PageSourceSearch

https://www.teachany.com/_nuxt/_id_-DfX8K0Ep-29.js

js teachany.com collected 2026-09-24 09:54:56 UTC 13,327 bytes, 1 lines download raw bytes

1import{_ as X}from"./nuxt-link-D_rgCK5z-29.js";import{a8 as Z,o as ee,H as m,$ as t,a0 as l,O as v,B as h,W as L,a1 as f,a2 as $,V as A,a3 as R,F as B,ab as E,T as re,ai as te,r as g,j as se,U as n,ag as oe,c as ae}from"./lazy-qrcode-oXPcgXJC-29.js";import{C as le,d as ne,g as de,c as O}from"./Grid-_kDueitS-29.js";import{f as V,a as ce,c as ie,b as ue}from"#entry";import{r as ge}from"./ExclamationTriangleIcon-DLko1OG1-29.js";import{r as F}from"./CheckCircleIcon-DMxaflmY-29.js";import{r as me}from"./EyeIcon-Z-H7U58h-29.js";import{r as be}from"./EyeSlashIcon-Df2FXzCZ-29.js";import{r as fe}from"./SparklesIcon-C8fouFii-29.js";import"./lazy-pdf-GO-7vVHk-29.js";import"./_plugin-vue_export-helper-DlAUqK2U-29.js";const pe={class:"min-h-screen bg-gradient-to-br from-slate-50 via-blue-50 to-indigo-50 dark:from-gray-900 dark:via-gray-800 dark:to-gray-900"},xe={class:"px-4 py-6 md:px-8 md:py-8 pt-20 md:pt-24 max-w-6xl mx-auto"},ve={key:0,class:"flex flex-col items-center justify-center py-20"},we={class:"text-gray-500 dark:text-gray-400 text-sm"},he={key:1,class:"flex flex-col items-center justify-center py-20 text-center"},ye={class:"w-16 h-16 bg-red-100 dark:bg-red-900/30 rounded-full flex items-center justify-center mb-4"},ke={class:"text-xl font-bold text-gray-900 dark:text-gray-100 mb-2"},_e={class:"text-gray-500 dark:text-gray-400 mb-6 text-sm max-w-sm"},Ce={key:2},$e={class:"text-center mb-6"},ze={class:"text-2xl md:text-3xl font-bold text-gray-900 dark:text-gray-100 mb-1"},Pe={class:"text-sm text-gray-500 dark:text-gray-400"},Ae={class:"flex flex-wrap items-center justify-center gap-2 mb-6"},je={key:0,class:"max-w-3xl mx-auto mb-4"},Te={key:1,class:"w-5 h-5 text-red-500",fill:"currentColor",viewBox:"0 0 20 20"},Ie={class:"flex flex-col lg:flex-row gap-6 items-start"},De={class:"flex-1 flex justify-center"},Le={class:"bg-white/80 dark:bg-gray-800/80 backdrop-blur-sm rounded-2xl shadow-lg border border-gray-200/50 dark:border-gray-700/50 p-4 md:p-6"},Fe={class:"text-xs text-gray-400 dark:text-gray-500 text-center mt-3"},Me={class:"w-full lg:w-80 lg:sticky lg:top-24 space-y-4"},Ne={class:"bg-white/80 dark:bg-gray-800/80 backdrop-blur-sm rounded-2xl shadow-lg border border-gray-200/50 dark:border-gray-700/50 p-4 md:p-5"},Se={class:"text-sm font-bold text-gray-800 dark:text-gray-200 mb-3 flex items-center gap-2"},Re={class:"space-y-1 max-h-[35vh] overflow-y-auto"},Be=["onClick"],Ee={class:"font-bold text-gray-900 dark:text-gray-100 mr-1"},Oe={class:"bg-white/80 dark:bg-gray-800/80 backdrop-blur-sm rounded-2xl shadow-lg border border-gray-200/50 dark:border-gray-700/50 p-4 md:p-5"},Ve={class:"text-sm font-bold text-gray-800 dark:text-gray-200 mb-3 flex items-center gap-2"},He={class:"space-y-1 max-h-[35vh] overflow-y-auto"},Ue=["onClick"],Ge={class:"font-bold text-gray-900 dark:text-gray-100 mr-1"},Ye={class:"text-center mt-8"},Je={class:"bg-white dark:bg-gray-800 rounded-3xl shadow-2xl p-6 md:p-8 max-w-sm w-full text-center"},We={class:"w-20 h-20 bg-gradient-to-br from-emerald-400 to-teal-500 rounded-full flex items-center justify-center mx-auto mb-5 shadow-lg shadow-emerald-500/30"},qe={class:"text-lg font-bold text-gray-900 dark:text-gray-100 mb-1"},Ke={class:"text-sm text-gray-500 dark:text-gray-400 mb-6"},ir={__name:"[id]",async setup(Qe){let z,M;const{t:j,locale:T}=V(),H=V(),U=ce().params.id;try{const{data:e}=([z,M]=Z(()=>ie(`i18n_crossword_share_${T.value}`,()=>$fetch(`https://project.deletetweets.ai/i18n_languages/teachany/crossword-puzzle-generator/1.0.0/${T.value}.json`))),z=await z,M(),z);e.value&&H.mergeLocaleMessage(T.value,e.value)}catch{}const I=g(!0),N=g(!1),s=se({grid:[],rows:0,cols:0,numbers:[],clues:{across:[],down:[]},title:""}),p=g([]),x=g(!1),y=g(!1),S=g([]),b=g(!1),_=g(!1),d=g(null),k=g(null),w=g("across"),C=g(null),P=ae(()=>{const e=[];for(const r of s.clues.across)e.push({...r,direction:"across"});for(const r of s.clues.down)e.push({...r,direction:"down"});return e});async function G(){try{const e=await fetch("https://usa.imgkits.com/site/get",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`key=${encodeURIComponent("crossword_"+U)}`});if(!e.ok)throw new Error("Failed to fetch");const r=await e.json();if(!r||!r.value)throw new Error("No data");const a=JSON.parse(r.value);
1s.grid=a.grid,s.rows=a.rows,s.cols=a.cols,s.numbers=a.numbers,s.clues=a.clues,s.title=a.title||j("crossword.sharePage.defaultTitle")||"Crossword Puzzle",p.value=ne(a.grid,a.rows,a.cols),I.value=!1}catch{N.value=!0,I.value=!1}}ee(()=>{G()});function Y({row:e,col:r,value:a}){p.value[e]&&(p.value[e][r]=a),y.value=!1,O(s.grid,p.value,s.rows,s.cols)&&(b.value=!0,_.value=!0,y.value=!0)}function J({row:e,col:r}){k.value={row:e,col:r};const a=q(e,r);if(a.length>0){const o=a.find(c=>c.direction===w.value);o?d.value=o:(d.value=a[0],w.value=a[0].direction)}}function W({row:e,col:r,direction:a}){if(a==="forward"){const o=w.value==="down"?1:0,c=w.value==="across"?1:0,i=e+o,u=r+c;i<s.rows&&u<s.cols&&s.grid[i]?.[u]&&(k.value={row:i,col:u},C.value?.focusCell(i,u))}else if(a==="backward"){const o=w.value==="down"?1:0,c=w.value==="across"?1:0,i=e-o,u=r-c;i>=0&&u>=0&&s.grid[i]?.[u]&&(k.value={row:i,col:u},C.value?.focusCell(i,u))}else if(a==="to")e>=0&&e<s.rows&&r>=0&&r<s.cols&&s.grid[e]?.[r]&&(k.value={row:e,col:r},C.value?.focusCell(e,r));else if(a==="nextClue"||a==="prevClue"){const o=P.value.findIndex(u=>d.value&&u.number===d.value.number&&u.direction===d.value.direction);let c=a==="nextClue"?o+1:o-1;c>=P.value.length&&(c=0),c<0&&(c=P.value.length-1);const i=P.value[c];i&&D(i,i.direction)}}function q(e,r){const a=[];for(const o of s.clues.across)e===o.row&&r>=o.col&&r<o.col+o.length&&a.push({...o,direction:"across"});for(const o of s.clues.down)r===o.col&&e>=o.row&&e<o.row+o.length&&a.push({...o,direction:"down"});return a}function D(e,r){d.value={...e,direction:r},w.value=r,k.value={row:e.row,col:e.col},C.value?.focusCell(e.row,e.col)}function K(){const e=de(s.grid,p.value,s.rows,s.cols);S.value=e,y.value=!0,b.value=e.length===0&&O(s.grid,p.value,s.rows,s.cols),b.value&&(_.value=!0)}function Q(){for(let e=0;e<s.rows;e++)for(let r=0;r<s.cols;r++)s.grid[e]?.[r]&&(p.value[e][r]=s.grid[e][r]);y.value=!1,b.value=!0}return ue({title:j("crossword.sharePage.metaTitle")||"Shared Crossword Puzzle - TeachAny",meta:[{name:"description",content:j("crossword.sharePage.metaDescription")||"Play a shared crossword puzzle challenge"},{name:"robots",content:"noindex"}]}),(e,r)=>{const a=X;return n(),m("div",pe,[t("div",xe,[I.value?(n(),m("div",ve,[r[3]||(r[3]=t("svg",{class:"animate-spin w-10 h-10 text-blue-500 mb-4",fill:"none",viewBox:"0 0 24 24"},[t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),t("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)),t("p",we,l(e.$t("crossword.sharePage.loading")||"Loading crossword..."),1)])):N.value?(n(),m("div",he,[t("div",ye,[v(h(ge),{class:"w-8 h-8 text-red-500"})]),t("h2",ke,l(e.$t("crossword.sharePage.notFound")||"Crossword Not Found"),1),t("p",_e,l(e.$t("crossword.sharePage.notFoundMessage")||"This crossword link may have expired or doesn't exist."),1),v(a,{to:"/tools/crossword-puzzle-generator",class:"px-5 py-2.5 bg-blue-600 hover:bg-blue-500 text-white font-semibold text-sm rounded-xl transition-all"},{default:L(()=>[f(l(e.$t("crossword.sharePage.createOwn")||"Create Your Own Crossword"),1)]),_:1})])):(n(),m("div",Ce,[t("div",$e,[t("h1",ze,l(s.title||e.$t("crossword.sharePage.defaultTitle")||"Crossword Puzzle"),1),t("p",Pe,l(s.clues.across.length+s.clues.down.length)+" "+l(e.$t("crossword.sharePage.cluesCount")||"clues"),1)]),t("div",Ae,[t("button",{onClick:K,class:"inline-flex items-center gap-1.5 px-4 py-2.5 text-sm font-semibold bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 border border-gray-200 dark:border-gray-700 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-750 transition-all"},[v(h(F),{class:"w-4 h-4"}),f(" "+l(e.$t("crossword.page.buttons.checkAnswers")||"Check Answers"),1)]),t("button",{onClick:r[0]||(r[0]=o=>x.value?x.value=!1:x.value=!0),class:$(["inline-flex items-center gap-1.5 px-4 py-2.5 text-sm font-semibold rounded-xl transition-all duration-200",x.value?"bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-300 border border-amber-200 dark:border-amber-800":"bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-750"])},[x.value?(n(),A(h(be),{key:1,class:"w-4 h-4"})):(n(),A(h(me),{key:0,class:"w-4 h-4"})),f(" "+l(x.value?e.$t("crossword.page.buttons.hideAnswers")||"Hide Answers":e.$t("crossword.page.buttons.showAnswers")||"Show Answers"),1)],2),t("button",{onClick:Q,class:"inline-flex items-center gap-1.5 px-4 py-2.5 text-sm font-semibold bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 border border-gray-200 dark:border-gray-700 rounded-xl hover:bg-gray-50 dark:hover:bg-gray-750 transition-all"},[v(h(fe),{class:"w-4 h-4"}),f(" "+l(e.$t("crossword.page.buttons.revealAll")||"Reveal All"),1)])]),y.value?(n(),m("div",je,[t("div",{class:$(["flex items-center gap-2.5 p-3 rounded-xl",b.value?"bg-emerald-50 dark:bg-emerald-900/20 border border-emerald-200 dark:border-emerald-800/50":"bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800/50"])},[b.value?(n(),A(h(F),{key:0,class:"w-5 h-5 text-emerald-500"})):(n(),m("svg",Te,[...r[4]||(r[4]=[t("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z","clip-rule":"evenodd"},null,-1)])])),t("p",{class:$(["text-sm font-medium",b.value?"text-emerald-700 dark:text-emerald-300":"text-red-700 dark:text-red-300"])},l(b.value?e.$t("crossword.page.status.complete")||"Puzzle Complete!":e.$t("crossword.page.status.errors")||"Some answers are incorrect"),3)],2)])):R("",!0),t("div",Ie,[t("div",De,[t("div",Le,[v(le,{ref_key:"gridRef",ref:C,grid:s.grid,rows:s.rows,cols:s.cols,numbers:s.numbers,userInput:p.value,interactive:!x.value,showAnswers:x.value,showErrors:y.value&&!b.value,errorCells:S.value,activeClue:d.value,selectedCell:k.value,onCellInput:Y,onCellFocus:J,onCellNavigate:W}
1,null,8,["grid","rows","cols","numbers","userInput","interactive","showAnswers","showErrors","errorCells","activeClue","selectedCell"]),t("p",Fe,l(e.$t("crossword.page.hints.gridInteraction")||"Click a cell to start typing. Use arrow keys or Tab to navigate."),1)])]),t("div",Me,[t("div",Ne,[t("h3",Se,[r[5]||(r[5]=t("span",{class:"w-6 h-6 bg-blue-100 dark:bg-blue-900/40 rounded-lg flex items-center justify-center text-blue-600 dark:text-blue-400 text-[10px] font-black"},"→",-1)),f(" "+l(e.$t("crossword.page.labels.across")||"Across"),1)]),t("div",Re,[(n(!0),m(B,null,E(s.clues.across,o=>(n(),m("button",{key:"a-"+o.number,onClick:c=>D(o,"across"),class:$(["w-full text-left px-3 py-2 rounded-lg text-sm transition-colors",d.value&&d.value.number===o.number&&d.value.direction==="across"?"bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300":"hover:bg-gray-50 dark:hover:bg-gray-700/50 text-gray-700 dark:text-gray-300"])},[t("span",Ee,l(o.number)+".",1),f(" "+l(o.clue),1)],10,Be))),128))])]),t("div",Oe,[t("h3",Ve,[r[6]||(r[6]=t("span",{class:"w-6 h-6 bg-purple-100 dark:bg-purple-900/40 rounded-lg flex items-center justify-center text-purple-600 dark:text-purple-400 text-[10px] font-black"},"↓",-1)),f(" "+l(e.$t("crossword.page.labels.down")||"Down"),1)]),t("div",He,[(n(!0),m(B,null,E(s.clues.down,o=>(n(),m("button",{key:"d-"+o.number,onClick:c=>D(o,"down"),class:$(["w-full text-left px-3 py-2 rounded-lg text-sm transition-colors",d.value&&d.value.number===o.number&&d.value.direction==="down"?"bg-purple-50 dark:bg-purple-900/30 text-purple-700 dark:text-purple-300":"hover:bg-gray-50 dark:hover:bg-gray-700/50 text-gray-700 dark:text-gray-300"])},[t("span",Ge,l(o.number)+".",1),f(" "+l(o.clue),1)],10,Ue))),128))])])])]),t("div",Ye,[v(a,{to:"/tools/crossword-puzzle-generator",class:"text-sm text-blue-600 dark:text-blue-400 hover:underline font-medium"},{default:L(()=>[f(l(e.$t("crossword.sharePage.createOwnLink")||"Create your own crossword puzzle")+" → ",1)]),_:1})])]))]),(n(),A(te,{to:"body"},[v(re,{name:"modal"},{default:L(()=>[_.value?(n(),m("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm p-4",onClick:r[2]||(r[2]=oe(o=>_.value=!1,["self"]))},[t("div",Je,[t("div",We,[v(h(F),{class:"w-10 h-10 text-white"})]),r[7]||(r[7]=t("h3",{class:"text-2xl font-bold text-gray-900 dark:text-gray-100 mb-2"},"🎉",-1)),t("p",qe,l(e.$t("crossword.sharePage.successTitle")||"Congratulations!"),1),t("p",Ke,l(e.$t("crossword.sharePage.successMessage")||"You completed the crossword!"),1),t("button",{onClick:r[1]||(r[1]=o=>_.value=!1),class:"w-full py-3 px-4 bg-gradient-to-r from-emerald-500 to-teal-600 hover:from-emerald-400 hover:to-teal-500 text-white font-semibold rounded-xl shadow-lg transition-all"},l(e.$t("crossword.sharePage.successDone")||"Done"),1)])])):R("",!0)]),_:1})]))])}}};export{ir as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.