@ihabdevteam/core 0.145.0 → 0.146.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/components.cjs.js +175 -175
  3. package/dist/hooks.cjs.js +1 -1
  4. package/dist/i18n.cjs.js +1 -1
  5. package/dist/ihabdevteam-core.cjs.js +182 -182
  6. package/dist/ihabdevteam-core.d.ts +3 -1
  7. package/dist/packages/core/src/components/ActionCard.js +10 -2
  8. package/dist/packages/core/src/components/LandingHeader.js +12 -5
  9. package/dist/packages/core/src/components/Popup/ConfirmPopup.js +17 -4
  10. package/dist/packages/core/src/components/Popup/ListPopup.js +1 -0
  11. package/dist/packages/core/src/components/Popup/Popup.js +4 -0
  12. package/dist/packages/core/src/components/Section.js +2 -1
  13. package/dist/packages/core/src/components/Table.js +18 -8
  14. package/dist/packages/core/src/components/Training/TrainingPagePopup.js +2 -0
  15. package/dist/packages/core/src/components/Training/TrainingStepCardOrder.js +11 -1
  16. package/dist/packages/core/src/hooks/useTablePaging.js +4 -3
  17. package/dist/packages/core/src/utils/textSort.d.ts +4 -4
  18. package/dist/packages/core/src/utils/textSort.js +56 -28
  19. package/dist/packages/core/src/utils/trainingItemResults.js +3 -1
  20. package/dist/packages/core/src/utils/wordTrainingGenerators.d.ts +2 -0
  21. package/dist/packages/core/src/utils/wordTrainingGenerators.js +5 -2
  22. package/dist/packages/core/src/utils/wordTrainingPool.d.ts +1 -0
  23. package/dist/packages/core/src/utils/wordTrainingPool.js +20 -6
  24. package/dist/packages/core/src/utils/wordTrainingRuntime.js +35 -14
  25. package/dist/packages/core/src/utils/wordTrainingRuntimeTypes.js +4 -3
  26. package/dist/packages/core/src/version.d.ts +1 -1
  27. package/dist/packages/core/src/version.js +1 -1
  28. package/dist/utils.cjs.js +2 -2
  29. package/package.json +1 -1
package/dist/hooks.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";var a=require("react"),Ce=require("react-i18next"),Gu=require("i18next"),mu=typeof document<"u"?document.currentScript:null;function cn(e){var u=Object.create(null);return e&&Object.keys(e).forEach(function(t){if(t!=="default"){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(u,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),u.default=e,Object.freeze(u)}var Yu=cn(a);function Cn({storageKey:e="fontScale",baseFont:u=20,minScale:t=.8,maxScale:n=1.4,step:o=.1,lineHeightRatio:r=1.4}={}){const l=E=>Math.max(t,Math.min(n,Number(E))),s=E=>{try{const B=localStorage.getItem(E),M=B?Number(B):1;return Number.isFinite(M)?l(M):l(1)}catch{return l(1)}},[i,c]=a.useState(()=>s(e)),[h,d]=a.useState(e);h!==e&&(d(e),c(s(e))),a.useEffect(()=>{try{localStorage.setItem(e,String(i))}catch{}},[e,i]);const C=E=>{c(typeof E=="function"?B=>l(E(B)):l(E))},g=()=>C(E=>+(E+o).toFixed(6)),f=()=>C(E=>+(E-o).toFixed(6)),w=i<n-Number.EPSILON,y=i>t+Number.EPSILON,m=Math.round(u*i),S=Math.round(m*r);return{scale:i,setScale:C,increase:g,decrease:f,canIncrease:w,canDecrease:y,fontSize:m,lineHeight:S}}const Uu=a.createContext(null);function dn(e){return/max-width:\s*7[0-9][0-9]px/.test(e)}const Wu=e=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches;function fn(e){const u=a.useCallback(t=>{if(typeof window>"u"||!window.matchMedia)return()=>{};const n=window.matchMedia(e);return n.addEventListener?n.addEventListener("change",t):n.addListener&&n.addListener(t),()=>{n.removeEventListener?n.removeEventListener("change",t):n.removeListener&&n.removeListener(t)}},[e]);return Yu.useSyncExternalStore(u,()=>Wu(e),()=>!1)}function gn(e){const[u,t]=a.useState(Wu(e));return a.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const n=window.matchMedia(e),o=l=>t(l.matches),r=n;return r.addEventListener?r.addEventListener("change",o):r.addListener&&r.addListener(o),t(n.matches),()=>{r.removeEventListener?r.removeEventListener("change",o):r.removeListener&&r.removeListener(o)}},[e]),u}const hn=typeof Yu.useSyncExternalStore=="function"?fn:gn;function mn(e){const u=a.useContext(Uu),t=hn(e);return u&&typeof u.mobile=="boolean"&&dn(e)?u.mobile:t}function Ku(e){const u=a.useRef(e);return a.useEffect(()=>{u.current=e}),u}function qu(e,u){const t=Ku(u);a.useEffect(()=>{const n=()=>t.current();try{window.addEventListener(e,n)}catch{}return()=>{try{window.removeEventListener(e,n)}catch{}}},[e,t])}const pu=" \xB7 ",zu=(()=>{if(typeof document>"u")return"";const e=document.title;return e.includes(pu)?e.split(pu).pop()??e:e})(),Ju=a.createContext(!1),me=[];let Qu=null;function pn(e){const u=a.useContext(Ju);a.useEffect(()=>{if(u||typeof e!="string"||!e)return;me.length===0&&(Qu=document.title);const t={text:zu?`${e}${pu}${zu}`:e};return me.push(t),document.title=t.text,()=>{const n=me.lastIndexOf(t);n>=0&&me.splice(n,1),document.title=me.length?me[me.length-1].text:Qu??document.title}},[e,u])}function Sn(){const{t:e}=Ce.useTranslation();return a.useCallback(u=>{if(!u)return"";const t=new Date(u).getTime();if(Number.isNaN(t))return"";const n=Math.floor((Date.now()-t)/864e5);return n<=0?e("myHomework.relativeDay.today","\uC624\uB298"):n===1?e("myHomework.relativeDay.yesterday","\uC5B4\uC81C"):e("myHomework.relativeDay.daysAgo",{n})},[e])}const yn=()=>{const e="\uC54C \uC218 \uC5C6\uB294 \uC624\uB958",u=typeof Gu?.t=="function"?Gu.t("common.unknownError",{defaultValue:e}):void 0;return typeof u=="string"&&u?u:e};function En(e,u){if(u===void 0&&(u=yn()),e instanceof Error)return e.message||u;if(typeof e=="string")return e||u;if(e&&typeof e=="object"){const t=e;for(const n of[t.message,t.error_description,t.error])if(typeof n=="string"&&n)return n}return u}function wn(e){const{t:u}=Ce.useTranslation(),[t,n]=a.useState({current:"",next:"",confirm:""}),[o,r]=a.useState(null),[l,s]=a.useState(!1),i=a.useRef(null),c=a.useRef(!1);a.useEffect(()=>()=>{i.current!==null&&clearTimeout(i.current)},[]);const h=a.useCallback(()=>{n({current:"",next:"",confirm:""}),r(null)},[]),d=a.useCallback(async()=>{if(c.current)return;if(!t.current){r({type:"error",text:u("account.security.password.currentRequired","\uD604\uC7AC \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC138\uC694.")});return}if(!t.next){r({type:"error",text:u("account.security.password.newRequired","\uC0C8 \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC138\uC694.")});return}if(t.next!==t.confirm){r({type:"error",text:u("account.security.password.mismatch","\uC0C8 \uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.")});return}s(!0),c.current=!0;let C;try{C=e?await e(t.current,t.next):null}catch(g){C=En(g)}finally{c.current=!1,s(!1)}if(C){r({type:"error",text:C});return}r({type:"success",text:u("account.security.password.changed","\uBE44\uBC00\uBC88\uD638\uAC00 \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.")}),n({current:"",next:"",confirm:""}),i.current!==null&&clearTimeout(i.current),i.current=setTimeout(()=>r(null),1500)},[t,e,u]);return{pw:t,setPw:n,pwMsg:o,setPwMsg:r,pwLoading:l,handleChangePw:d,reset:h}}const J=["\u3131","\u3132","\u3134","\u3137","\u3138","\u3139","\u3141","\u3142","\u3143","\u3145","\u3146","\u3147","\u3148","\u3149","\u314A","\u314B","\u314C","\u314D","\u314E"],ne=["\u314F","\u3150","\u3151","\u3152","\u3153","\u3154","\u3155","\u3156","\u3157","\u3158","\u3159","\u315A","\u315B","\u315C","\u315D","\u315E","\u315F","\u3160","\u3161","\u3162","\u3163"],ue=["","\u3131","\u3132","\u3133","\u3134","\u3135","\u3136","\u3137","\u3139","\u313A","\u313B","\u313C","\u313D","\u313E","\u313F","\u3140","\u3141","\u3142","\u3144","\u3145","\u3146","\u3147","\u3148","\u314A","\u314B","\u314C","\u314D","\u314E"];function H(e){if(!e)return null;const u=e.charCodeAt(0)-44032;return u<0||u>=11172?null:{cho:Math.floor(u/588),jung:Math.floor(u%588/28),jong:u%28}}function Bn(){const e=new Map;return u=>{let t=e.get(u);return t||(t=[...u].map(n=>H(n)),e.set(u,t)),t}}function de(e,u,t=0){return String.fromCharCode(44032+(e*21+u)*28+t)}function bn(e,u){if(!e||!u||e===u||e.length!==u.length)return"random";let t=0,n=null;for(let o=0;o<e.length;o++){const r=H(e[o]),l=H(u[o]);if(!r||!l)return"random";if(r.cho===l.cho&&r.jung===l.jung&&r.jong===l.jong)continue;t++;const s=r.cho!==l.cho,i=r.jung!==l.jung,c=r.jong!==l.jong;(s?1:0)+(i?1:0)+(c?1:0)>1?n="multi":s?n="cho":i?n="jung":n="jong"}return t!==1?"random":n==="cho"?"cho":n==="jung"?"jung":n==="jong"?"jong":"random"}const Ae={3:["\u3131","\u3145"],5:["\u3134","\u3148"],6:["\u3134","\u314E"],9:["\u3139","\u3131"],10:["\u3139","\u3141"],11:["\u3139","\u3142"],12:["\u3139","\u3145"],13:["\u3139","\u314C"],14:["\u3139","\u314D"],15:["\u3139","\u314E"],18:["\u3142","\u3145"]};Object.fromEntries(Object.entries(Ae).map(([e,u])=>[u.join(""),ue[Number(e)]]));function An(e,u){if(!e||!u)return!1;for(const t of e){const n=H(t);if(n){if(J[n.cho]===u)return!0;if(n.jong>0){if(ue[n.jong]===u)return!0;const o=Ae[n.jong];if(o&&o.includes(u))return!0}}}return!1}function _e(e){if(!e)return 0;let u=0;for(const t of e)H(t)&&u++;return u}function _n(e){if(!e)return!1;let u=!1;for(const t of e){const n=H(t);if(n&&(u=!0,n.jong>0))return!1}return u}function Dn(e,u){if(e.jong<=0)return!1;if(u.includes(ue[e.jong]))return!0;const t=Ae[e.jong];return!!t&&t.some(n=>u.includes(n))}function On(e,u,t){if(!e)return!1;const n=[...e],o=r=>{const l=H(n[r]);if(!l||u.cho&&!u.cho.includes(J[l.cho])||u.jung&&!u.jung.includes(ne[l.jung]))return!1;if(u.jongNone){if(l.jong>0)return!1}else if(u.jong&&!Dn(l,u.jong))return!1;return!0};if(t==="head")return o(0);if(t==="tail")return o(n.length-1);if(t==="mid"){for(let r=1;r<n.length-1;r++)if(o(r))return!0;return!1}for(let r=0;r<n.length;r++)if(o(r))return!0;return!1}const Nn={cho:J.length,jung:ne.length,jong:ue.length};function jn(e,u,t,n,o=1/0){if(!e||t<1)return[];const r=[...e].map(d=>H(d));if(r.some(d=>!d))return[];const l=r,s=l.length;if(t>s)return[];const i=Nn[u],c=new Set,h=[];(function d(C,g){if(g.length===t){h.push([...g]);return}for(let f=C;f<s;f++)g.push(f),d(f+1,g),g.pop()})(0,[]);for(const d of h)if((function C(g,f){if(c.size>=o)return;if(g===d.length){const m=f.map(S=>de(S.cho,S.jung,S.jong)).join("");m!==e&&n.has(m)&&c.add(m);return}const w=d[g],y=l[w][u];for(let m=0;m<i;m++){if(m===y)continue;const S=f.slice();if(S[w]={...f[w],[u]:m},C(g+1,S),c.size>=o)return}})(0,l),c.size>=o)break;return[...c]}function Tn(e,u){if(!e||!u||e.length!==u.length)return-1;let t=0;for(let n=0;n<e.length;n++){const o=H(e[n]),r=H(u[n]);if(!o||!r)return-1;o.cho!==r.cho&&t++,o.jung!==r.jung&&t++,o.jong!==r.jong&&t++}return t}const Xu="word_pair_index_v2",Zu="word_pair_index_sig_v2";let De=null;function In(){try{if(typeof localStorage>"u")return null;const e=localStorage.getItem(Xu),u=localStorage.getItem(Zu);return!e||!u?null:{index:JSON.parse(e),sig:u}}catch{return null}}function Oe(){if(De)return De;const e=In();return e?(De=e.index,e.sig,De):null}function Rn(){De=null;try{typeof localStorage<"u"&&(localStorage.removeItem(Xu),localStorage.removeItem(Zu))}catch{}}const et="word_image_existence_map_v1";let we=null,Ne=0,ut=-1,je=null,tt=-1,nt=new Set;function ot(){if(we)return we;try{const e=typeof localStorage<"u"?localStorage.getItem(et):null,u=e?JSON.parse(e):null;we=u&&typeof u=="object"&&!Array.isArray(u)?u:{}}catch{we={}}return we}function rt(){const e=ot();if(ut===Ne)return je?{...je}:null;const u=Object.values(e);return je=u.length===0?null:{total:u.length,exists:u.filter(Boolean).length},ut=Ne,je?{...je}:null}function Mn(){const e=ot();if(tt===Ne)return nt;const u=new Set;for(const t in e)e[t]===!0&&t.endsWith("_1")&&u.add(t.slice(0,-2));return nt=u,tt=Ne,u}function Ln(){we={},Ne++;try{typeof localStorage<"u"&&localStorage.removeItem(et)}catch{}}const lt=[{id:"wordData",labelKey:"settings.cache.group.wordData.label",subKey:"settings.cache.group.wordData.sub",keys:["word_data_cache","word_data_version"]},{id:"pairIndex",labelKey:"settings.cache.group.pairIndex.label",subKey:"settings.cache.group.pairIndex.sub",keys:["word_pair_index_v2","word_pair_index_sig_v2"]},{id:"imageCache",labelKey:"settings.cache.group.imageCache.label",subKey:"settings.cache.group.imageCache.sub",keys:["word_image_existence_map_v1"]}];function st(e){return e.reduce((u,t)=>{try{const n=localStorage.getItem(t);return u+(n?new Blob([n]).size:0)}catch{return u}},0)}function vn(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(2)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function kn(e){const{t:u}=Ce.useTranslation(),[t,n]=a.useState({}),[o,r]=a.useState(null),[l,s]=a.useState(null),[i,c]=a.useState(null),h=a.useCallback(()=>{const C={};lt.forEach(g=>{C[g.id]=st([...g.keys])}),n(C),typeof navigator<"u"&&navigator.storage?.estimate&&navigator.storage.estimate().then(g=>{c({usage:g.usage??0,quota:g.quota??0})}).catch(()=>{})},[]);a.useEffect(()=>{h()},[h]);const d=a.useCallback(async C=>{r(C);try{C==="wordData"?(localStorage.removeItem("word_data_cache"),localStorage.removeItem("word_data_version")):C==="pairIndex"?Rn():C==="imageCache"&&Ln(),h(),e?.(u("settings.cache.cleared","\uCE90\uC2DC\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4."))}finally{r(null)}},[h,e,u]);return{cacheSizes:t,clearingId:o,confirmCacheId:l,setConfirmCacheId:s,storageEstimate:i,refreshCacheSizes:h,handleClearCache:d}}function xn(e){const[u,t]=a.useState(null),[n,o]=a.useState(null),r=a.useCallback(()=>{const l=Oe();if(l){const i=Object.values(l),c=i.filter(h=>h.cho.length+h.jung.length+h.jong.length>0).length;t({matched:c,total:i.length})}else t(null);const s=rt();o(s?{exists:s.exists,total:s.total}:null)},[]);return a.useEffect(()=>{r();const l=setTimeout(r,1e3);return()=>clearTimeout(l)},[e?.length,r]),{pairStats:u,imgStats:n,setPairStats:t,setImgStats:o,refreshStats:r}}function Te(e,u){if(e===u)return!0;const t=e?.id,n=u?.id;return t!=null&&t!==""&&t===n}function at(e,u=[]){const[t,n]=a.useState(u),[o,r]=a.useState(null),[l,s]=a.useState(!1),[i,c]=a.useState(e),h=a.useRef(!1),d=a.useRef(null);a.useEffect(()=>{if(l)return;if(h.current){h.current=!1;return}const m=d.current;m!==null&&m.length===u.length&&m.every((S,E)=>S===u[E])||(d.current=u,n(u),r(S=>S==null?S:u.find(E=>Te(E,S))??S))},[u,l]),a.useEffect(()=>{!l&&o!=null&&c({...o})},[l,o]);const C=a.useCallback(m=>{r(m),s(!1),c({...m})},[]),g=a.useCallback(()=>s(!0),[]),f=a.useCallback(()=>s(!1),[]),w=a.useCallback((m,S)=>{n(m),r(S),s(E=>(E&&(h.current=!0),!1))},[]),y=a.useCallback(m=>{n(S=>S.filter(E=>!Te(E,m))),r(null)},[]);return{list:t,setList:n,selected:o,setSelected:r,isEditing:l,setIsEditing:s,editForm:i,setEditForm:c,openDetail:C,startEditing:g,cancelEditing:f,commitEdit:w,remove:y}}function qe(){return ze(new Date)}function ze(e){if(e==null||e==="")return"";const u=e instanceof Date?e:new Date(e);return isNaN(u.getTime())?"":new Intl.DateTimeFormat("fr-CA",{timeZone:"Asia/Seoul"}).format(u)}const Ie=()=>{const[e,u,t]=qe().split("-");return{year:e,month:u,day:t}},Pn={year:"",month:"",day:"",hour:"09",minute:"00",memo:""};function Fn(e=[]){const{list:u,setList:t,selected:n,setSelected:o,isEditing:r,setIsEditing:l,editForm:s,setEditForm:i,openDetail:c,commitEdit:h}=at(Pn,e),{year:d,month:C,day:g}=Ie(),[f,w]=a.useState({year:d,month:C,day:g,hour:"09",minute:"00",memo:""});return{visitHistory:u,visitForm:f,setVisitForm:w,setVisit:y=>m=>w(S=>({...S,[y]:m})),selectedVisit:n,setSelectedVisit:o,isEditingVisit:r,setIsEditingVisit:l,editVisitForm:s,setEditVisitForm:i,openVisitDetail:c,handleVisitSave:y=>{t(B=>[f,...B]);const{year:m,month:S,day:E}=Ie();w({year:m,month:S,day:E,hour:"09",minute:"00",memo:""}),y?.()},handleVisitEditSave:()=>{h(y=>y.map(m=>n!=null&&Te(m,n)?s:m),s)},addVisit:y=>{t(m=>[y,...m])},removeVisit:y=>{t(m=>m.filter(S=>S!==y))},revertVisitEdit:(y,m)=>{t(S=>S.map(E=>E===m?y:E)),o(S=>S===m?y:S)}}}const it=e=>`${e.year.padStart(4,"0")}-${e.month.padStart(2,"0")}-${e.day.padStart(2,"0")} ${e.hour.padStart(2,"0")}:${e.minute.padStart(2,"0")}`,Je=e=>[...e].sort((u,t)=>{const n=it(u),o=it(t);return n<o?-1:n>o?1:0}),$n={year:"",month:"",day:"",hour:"09",minute:"00",memo:""};function Vn(e,u=[]){const t=a.useMemo(()=>Je(u),[u]),{list:n,setList:o,selected:r,setSelected:l,isEditing:s,setIsEditing:i,editForm:c,setEditForm:h,openDetail:d,commitEdit:C,remove:g}=at($n,t),[f,w]=a.useState([]),{year:y,month:m,day:S}=Ie(),[E,B]=a.useState({year:y,month:m,day:S,hour:"09",minute:"00",memo:""}),M=T=>v=>B(G=>({...G,[T]:v})),b=T=>{o(K=>Je([...K,E]));const{year:v,month:G,day:X}=Ie();B({year:v,month:G,day:X,hour:"09",minute:"00",memo:""}),T?.()},D=()=>{C(T=>Je(T.map(v=>r!=null&&Te(v,r)?c:v)),c)},O=a.useCallback(T=>{g(T)},[g]),P=a.useCallback(T=>{e({year:T.year,month:T.month,day:T.day,hour:T.hour,minute:T.minute,memo:T.memo,...T.id!=null?{id:T.id}:{}}),g(T)},[e,g]),_=a.useCallback(T=>{o(v=>v.filter(G=>!Te(G,T))),w(v=>[T,...v]),l(null)},[o,l]),V=a.useCallback(T=>{o(v=>Je([...v,T]))},[o]),Y=a.useCallback(T=>{o(v=>v.filter(G=>G!==T))},[o]),L=a.useCallback((T,v)=>{o(G=>G.map(X=>X===v?T:X)),l(G=>G===v?T:G)},[o,l]);return{scheduleList:n,noShowList:f,addSchedule:V,removeSchedule:Y,revertScheduleEdit:L,scheduleForm:E,setScheduleForm:B,setSchedule:M,selectedSchedule:r,setSelectedSchedule:l,isEditingSchedule:s,setIsEditingSchedule:i,editScheduleForm:c,setEditScheduleForm:h,openScheduleDetail:d,handleScheduleSave:b,handleScheduleEditSave:D,handleScheduleDelete:O,handleScheduleToVisit:P,handleScheduleNoVisit:_}}const Qe=[{value:"10",label:"10\uAC1C\uC529 \uBCF4\uAE30"},{value:"25",label:"25\uAC1C\uC529 \uBCF4\uAE30"},{value:"50",label:"50\uAC1C\uC529 \uBCF4\uAE30"},{value:"100",label:"100\uAC1C\uC529 \uBCF4\uAE30"}];function Hn(e){const{t:u}=Ce.useTranslation(),[t,n]=a.useState(""),[o,r]=a.useState("25"),[l,s]=a.useState("all"),[i,c]=a.useState(1),h=a.useMemo(()=>e.filter(({item:w,status:y})=>!(t&&!w.memo.includes(t)||l!=="all"&&y!==l)),[e,t,l]),d=Math.max(1,Math.ceil(h.length/Number(o))),C=Math.min(i,d),g=a.useMemo(()=>h.slice((C-1)*Number(o),C*Number(o)),[h,C,o]),f=a.useMemo(()=>Qe.map(w=>({...w,label:u("common.pageSizeLabel",{n:w.value,defaultValue:w.label})})),[u]);return{vapSearch:t,setVapSearch:n,vapPageSize:o,setVapPageSize:r,vapPageSizeOptions:f,vapStatus:l,setVapStatus:s,vapPage:C,setVapPage:c,vapFiltered:h,vapTotal:d,vapPageItems:g}}function Gn(e,u,t){const{t:n}=Ce.useTranslation(),[o,r]=a.useState(()=>{const f=t?.initialPageSize;return f&&Qe.some(w=>w.value===f)?f:"25"}),[l,s]=a.useState(1),[i,c]=a.useState(u);Object.is(i,u)||(c(u),l!==1&&s(1));const h=a.useMemo(()=>Qe.map(f=>({...f,label:n("visits.showN",{n:f.value})})),[n]),d=a.useCallback(f=>{r(f),s(1)},[]),C=Math.max(1,Math.ceil(e.length/Number(o)));l>C&&s(C);const g=Math.min(l,C);return{pageRows:a.useMemo(()=>e.slice((g-1)*Number(o),g*Number(o)),[e,g,o]),pageSizeProps:{options:h,value:o,onChange:d},paginationProps:{page:g,total:C,onChange:s},setPage:s}}function Yn(){const[e,u]=a.useState(null),t=a.useCallback(o=>{u(r=>r?.key===o?{key:o,asc:!r.asc}:{key:o,asc:!0})},[]),n=a.useCallback((o,r)=>({label:o,sortDir:e?.key===r?e.asc?"asc":"desc":null,onClick:()=>t(r)}),[e,t]);return{\uC815\uB82C:e,\uCE78:n}}const ct=e=>e==="\uC88C"||e==="\uC6B0"?e:null;function Un(){const[e,u]=a.useState(!1),[t,n]=a.useState("\uC88C"),[o,r]=a.useState({\uC88C:null,\uC6B0:null}),[l,s]=a.useState({\uC88C:[],\uC6B0:[]}),[i,c]=a.useState(!1),[h,d]=a.useState("\uC88C"),C=a.useCallback(f=>{const w=ct(f.direction);w&&(r(y=>({...y,[w]:f})),s(y=>({...y,[w]:[f,...y[w]]})),u(!1))},[]),g=a.useCallback(f=>{const w=ct(f.direction);w&&(r(y=>({...y,[w]:f})),c(!1))},[]);return{showDevice:e,setShowDevice:u,deviceDirection:t,setDeviceDirection:n,devices:o,setDevices:r,deviceHistory:l,setDeviceHistory:s,showDeviceList:i,setShowDeviceList:c,listForSide:h,setListForSide:d,handleDeviceSubmit:C,handleSelectFromList:g}}const Wn="__ihab_core_word_pool__";function Xe(){return globalThis[Wn]??null}function F(e,u=Math.random){const t=e.slice();for(let n=t.length-1;n>0;n--){const o=Math.floor(u()*(n+1));[t[n],t[o]]=[t[o],t[n]]}return t}function ae(e,u,t=Math.random){return!Array.isArray(e)||e.length===0||u<=0?[]:u>=e.length?F(e,t):F(e,t).slice(0,u)}const Su={SAME_SOUND_PICK:{difficulty:!0,choseong:!0,group:"discrimination"},SAME_OR_DIFF:{difficulty:!0,choseong:!0,group:"discrimination"},HEAR_AND_PICK_SAME:{difficulty:!0,choseong:!0,group:"discrimination"},HEAR_AND_PICK_INCLUDED:{difficulty:!0,choseong:!0,group:"discrimination"},STARTS_WITH_SAME_SOUND:{difficulty:!1,choseong:!0,group:"discrimination"},LISTEN_AND_REMEMBER_ORDER:{difficulty:!1,choseong:!0,group:"attention"},MERGE_2_SYLLABLES:{difficulty:!1,choseong:!0,group:"synthesis"},MERGE_3_SYLLABLES:{difficulty:!1,choseong:!0,group:"synthesis"},MERGE_2_PHONEMES:{difficulty:!1,choseong:!0,group:"synthesis"},MERGE_3_PHONEMES:{difficulty:!1,choseong:!0,group:"synthesis"},DROP_1_FROM_2SYLL:{difficulty:!1,choseong:!0,group:"deletion"},DROP_1_FROM_3SYLL:{difficulty:!1,choseong:!0,group:"deletion"},DROP_PART_FROM_COMPOUND:{difficulty:!1,choseong:!0,group:"deletion"},DROP_FINAL_CONSONANT_FROM_1SYLL:{difficulty:!1,choseong:!0,group:"deletion"},REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:{difficulty:!1,choseong:!0,group:"deletion"},CHANGE_1_SYLL_IN_2SYLL:{difficulty:!0,choseong:!0,group:"substitution"},CHANGE_1_SYLL_IN_3SYLL:{difficulty:!0,choseong:!0,group:"substitution"},CHANGE_1_PHONEME_IN_1SYLL:{difficulty:!1,choseong:!0,group:"substitution"},CHANGE_1_PHONEME_IN_2SYLL:{difficulty:!0,choseong:!0,group:"substitution"}},Kn=J.indexOf("\u3147"),Ct={DROP_FINAL_CONSONANT_FROM_1SYLL:{syllables:1,syllable:e=>e.jong>0},REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:{syllables:1,syllable:e=>e.jong===0&&e.cho!==Kn},MERGE_2_SYLLABLES:{syllables:2,syllable:()=>!0},MERGE_3_SYLLABLES:{syllables:3,syllable:()=>!0},MERGE_2_PHONEMES:{syllables:1,syllable:e=>e.jong===0},MERGE_3_PHONEMES:{syllables:1,syllable:e=>e.jong>0}},qn={\u3131:"\u3131",\u3132:"\u3131",\u314B:"\u3131",\u3133:"\u3131",\u313A:"\u3131",\u3134:"\u3134",\u3135:"\u3134",\u3136:"\u3134",\u3137:"\u3137",\u3145:"\u3137",\u3146:"\u3137",\u3148:"\u3137",\u314A:"\u3137",\u314C:"\u3137",\u314E:"\u3137",\u3139:"\u3139",\u313C:"\u3139",\u313D:"\u3139",\u313E:"\u3139",\u3140:"\u3139",\u3141:"\u3141",\u313B:"\u3141",\u3142:"\u3142",\u314D:"\u3142",\u313F:"\u3142",\u3144:"\u3142",\u3147:"\u3147"},zn={\u314F:{nucleus:"\u314F"},\u3151:{glide:"j",nucleus:"\u314F"},\u3153:{nucleus:"\u3153"},\u3155:{glide:"j",nucleus:"\u3153"},\u3157:{nucleus:"\u3157"},\u315B:{glide:"j",nucleus:"\u3157"},\u315C:{nucleus:"\u315C"},\u3160:{glide:"j",nucleus:"\u315C"},\u3161:{nucleus:"\u3161"},\u3163:{nucleus:"\u3163"},\u3150:{nucleus:"\u3154/\u3150"},\u3152:{glide:"j",nucleus:"\u3154/\u3150"},\u3154:{nucleus:"\u3154/\u3150"},\u3156:{glide:"j",nucleus:"\u3154/\u3150"},\u3158:{glide:"w",nucleus:"\u314F"},\u3159:{glide:"w",nucleus:"\u3154/\u3150"},\u315A:{glide:"w",nucleus:"\u3154/\u3150"},\u315D:{glide:"w",nucleus:"\u3153"},\u315E:{glide:"w",nucleus:"\u3154/\u3150"},\u315F:{glide:"w",nucleus:"\u3163"},\u3162:{glide:"\u0270",nucleus:"\u3163"}};function yu(e){return qn[e]??e}const Eu={cho:J,jung:ne,jong:ue},q=e=>Array.isArray(e)?e.length>0:!!e;function wu(e,u){if(e.length!==u.length)return!1;for(let t=0;t<e.length;t++){const n=e[t],o=u[t];if(!(!n||!o)&&(n.cho!==o.cho&&J[n.cho]==="\u3147"!=(J[o.cho]==="\u3147")||n.jong!==o.jong&&n.jong===0!=(o.jong===0)))return!0}return!1}function Jn(e,u,t){const n=t.pronOf(e),o=t.decompOf,r=t.sameStructureOnly&&o?o(n):null,l=[];for(const s of u)s!==e&&(t.okSet&&!t.okSet.has(s)||t.pronOf(s)!==n&&(r&&o&&wu(r,o(t.pronOf(s)))||l.push(s)));return l}function dt(e,u,t){const n=u?.[e];if(!n)return[];const o=t.kind?n[t.kind]??[]:[...n.cho??[],...n.jung??[],...n.jong??[]];return Jn(e,o,t)}function Qn(e,u,t,n,o,r,l){const s=["cho","jung","jong"].filter(C=>q(e[C])),i={};for(const C of s){const g=e[C];i[C]=new Set(Array.isArray(g)?g:[g])}const c=o==="pron",h=new Map;for(const C of u){const g=t(r(C));if(g.some(m=>!m))continue;let f=g;if(!c&&(f=t(C),f.length!==g.length||f.some(m=>!m)))continue;const w=g.length,y=h.get(w);y?y.push({w:C,dPron:g,dPos:f}):h.set(w,[{w:C,dPron:g,dPos:f}])}const d=new Map;for(const[C,g]of h){const f=new Map,w=(y,m)=>{const S=y.dPos[m];return S!=null&&s.every(E=>i[E].has(Eu[E][S[E]]))};for(const y of g){let m;if(l==="head")m=w(y,0)?0:-1;else if(l==="tail")m=w(y,C-1)?C-1:-1;else if(l==="mid"){m=-1;for(let E=1;E<C-1;E++)if(w(y,E)){m=E;break}}else m=y.dPos.findIndex(E=>E!=null&&s.every(B=>i[B].has(Eu[B][E[B]])));if(m<0)continue;const S=f.get(m);S?S.push(y):f.set(m,[y])}for(const[y,m]of f){const S=s.includes("cho"),E=s.includes("jung"),B=s.includes("jong"),M=D=>{let O="";for(let P=0;P<C;P++){const _=D[P];P===y?O+=(S?"*":_.cho)+"."+(E?"*":_.jung)+"."+(B?"*":_.jong)+".":O+=_.cho+"."+_.jung+"."+_.jong+"."}return O},b=new Map;for(const D of g){const O=M(D.dPron),P=b.get(O);P?P.push(D):b.set(O,[D])}for(const D of m){const O=b.get(M(D.dPron))??[],P=[];for(const _ of O){if(_.w===D.w)continue;let V=!0;for(const Y of s){const L=D.dPron[y][Y],T=_.dPron[y][Y];if(T===L){V=!1;break}if(c&&i[Y].has(Eu[Y][T])){V=!1;break}}V&&(n&&wu(D.dPron,_.dPron)||P.push(_.w))}d.set(D.w,P)}}}return d}const Xn=e=>e==null?[]:Array.isArray(e)?e:[e];function Zn(e){if([...e].length!==1)return"";const u=H(e);if(!u)return"";const t=yu(ue[u.jong]),n=t===""?0:ue.indexOf(t);return de(u.cho,u.jung,n<0?0:n)}function ft(e,u){return u.get(e)||Zn(e)||e}function Bu(e){return e?q(e.cho)?"cho":q(e.jung)?"jung":q(e.jong)?"jong":null:null}function Be(e,u){const t=(n,o)=>!q(n)||Xn(n).includes(o);return t(u.cho,J[e.cho])&&t(u.jung,ne[e.jung])&&t(u.jong,ue[e.jong])}function Re(e,u,t){const n=[...e];if(t!=="pron")return n.map(r=>H(r));const o=[...u.get(e)||e];return o.length!==n.length?n.map(r=>H(r)):o.map(r=>H(r))}function Me(e,u,t,n,o){const r=u==="cho"?J:u==="jung"?ne:ue,l=e[u],s=[],i=d=>u==="jung"?uo(ft(d,o)):ft(d,o),c=new Map([[i(t),-1]]),h=F(r.map((d,C)=>C).filter(d=>d!==l&&(u!=="cho"||r[d]!=="\u3147")&&(u!=="jong"||d!==0)));for(const d of h){if(s.length>=n)break;const C=u==="cho"?de(d,e.jung,e.jong):u==="jung"?de(e.cho,d,e.jong):de(e.cho,e.jung,d),g=i(C),f=c.get(g);if(f!==void 0){u==="jung"&&f>=0&&o.has(C)&&!o.has(s[f])&&(s[f]=C);continue}c.set(g,s.length),s.push(C)}return s}const eo={\u3154:"\u3150",\u3156:"\u3152",\u315A:"\u3159",\u315E:"\u3159"};function uo(e){if([...e].length!==1)return e;const u=H(e);if(!u)return e;const t=eo[ne[u.jung]];return t?de(u.cho,ne.indexOf(t),u.jong):e}function to(e,u,t,n,o,r=null){const l=[...e];if(l.length!==2)return null;const s=l.map(d=>H(d));if(s.some(d=>!d))return null;const i=Re(e,t,n);if(i.some(d=>!d))return null;const c=Bu(u);let h=c&&u?i.map((d,C)=>Be(d,u)?C:-1).filter(d=>d>=0):[0,1];if(r!=null&&(h=h.filter(d=>d!==r)),!h.length)return null;for(const d of F(h)){const C=l[d];if(!o.has(C))continue;const g=Me(s[d],c??"cho",C,40,t),f=[];for(const w of g)if(w!==C&&o.has(w)&&!f.includes(w)&&f.push(w),f.length>=2)break;if(!(f.length<2))return{question:e,distractors:[C,...f]}}return null}function no(e,u,t,n,o,r=null){const l=[...e];if(l.length!==3)return null;const s=l.map(d=>H(d));if(s.some(d=>!d))return null;const i=Re(e,t,n);if(i.some(d=>!d))return null;const c=Bu(u),h=c&&u?i.map((d,C)=>Be(d,u)?C:-1).filter(d=>d>=0):[0,1,2];if(!h.length)return null;for(const d of F(h))for(const C of F([0,1,2].filter(g=>g!==d&&(r==null||g===r)))){const g=[0,1,2].filter(S=>S!==C),f=g.map(S=>l[S]).join("");if(!o.has(f))continue;const w=g.indexOf(d),y=Me(s[d],c??"cho",l[d],40,t),m=[];for(const S of y){const E=g.map(M=>l[M]);E[w]=S;const B=E.join("");if(B!==f&&o.has(B)&&!m.includes(B)&&m.push(B),m.length>=2)break}if(!(m.length<2))return{question:e,distractors:[f,...m]}}return null}function oo(e,u,t,n,o,r=null){const l=[...e],s=l.length;if(s<2)return null;const i=[];for(let h=1;h<=s-1;h++)i.push({remain:l.slice(0,h).join(""),dropped:l.slice(h).join(""),droppedEnd:1}),i.push({remain:l.slice(s-h).join(""),dropped:l.slice(0,s-h).join(""),droppedEnd:0});const c=Bu(u);for(const{remain:h,dropped:d,droppedEnd:C}of F(i)){if(r!=null&&C!==r||h===e||!o.has(h)||!o.has(d))continue;const g=[...h],f=g.map(m=>H(m));if(f.some(m=>!m))continue;const w=Re(h,t,n);if(w.some(m=>!m))continue;const y=c&&u?w.map((m,S)=>Be(m,u)?S:-1).filter(m=>m>=0):g.map((m,S)=>S);if(y.length)for(const m of F(y)){const S=Me(f[m],c??"cho",g[m],40,t),E=[];for(const B of S){const M=[...g];M[m]=B;const b=M.join("");if(b!==h&&o.has(b)&&!E.includes(b)&&E.push(b),E.length>=2)break}if(E.length>=2)return{question:e,distractors:[h,...E]}}}return null}function ro(e,u,t,n,o,r=null){if([...e].length!==1)return null;const l=H(t.get(e)||e);if(!l||l.jong===0)return null;const s=de(l.cho,l.jung,0),i=Me({cho:l.cho,jung:l.jung,jong:0},"cho",s,2,t);return i.length<2?null:{question:e,distractors:[s,...i]}}const bu=J.indexOf("\u3147");function lo(e,u,t,n,o,r=null){if([...e].length!==1)return null;const l=H(t.get(e)||e);if(!l||l.jong!==0||l.cho===bu)return null;const s=de(bu,l.jung,0),i=Me({cho:bu,jung:l.jung,jong:0},"jung",s,2,t);return i.length<2?null:{question:e,distractors:[s,...i]}}function so(e){const u=new Map;for(const t of e){const n=[...t],o=n.length;if(!(o<2||o>3))for(let r=0;r<o;r++){let l=o+"|"+r+"|";for(let i=0;i<o;i++)l+=i===r?"*":n[i];const s=u.get(l);s?s.push(t):u.set(l,[t])}}return u}function ao(e,u,t,n,o,r=null,l=null,s=2){const i=[...e],c=i.length;if(c<2||c>3)return null;const h=i.map(S=>H(S));if(h.some(S=>!S))return null;const d=Re(e,t,n);if(d.some(S=>!S))return null;const C=S=>t.get(S)??S,g=C(e),f=!!u&&(q(u.cho)||q(u.jung)||q(u.jong)),w=!!l&&(q(l.cho)||q(l.jung)||q(l.jong)),y=S=>{let E=c+"|"+S+"|";for(let B=0;B<c;B++)E+=B===S?"*":i[B];return E};let m;if(r!=null){if(r>=c||f&&!Be(d[r],u))return null;m=[r]}else f?m=d.map((S,E)=>Be(S,u)?E:-1).filter(S=>S>=0):m=Array.from({length:c},(S,E)=>E);for(const S of F(m)){const E=o.get(y(S))??[],B=[],M=[];for(const _ of E){if(_===e)continue;const V=[..._].map(v=>H(v)),Y=h[S],L=V[S];if(!Y||!L)continue;let T=0;if(Y.cho!==L.cho&&T++,Y.jung!==L.jung&&T++,Y.jong!==L.jong&&T++,!(T<s||C(_)===g))if(w){const v=Re(_,t,n)[S];v&&Be(v,l)?B.push(_):M.push(_)}else B.push(_)}if(!B.length)continue;const b=F(B)[0],D=[],O=new Set([g,C(b)]),P=w?M:B.filter(_=>_!==b);for(const _ of F(P)){const V=C(_);if(!O.has(V)&&(O.add(V),D.push(_),D.length>=2))break}if(!w&&D.length<2)for(const _ of F(E)){if(_===e||_===b)continue;const V=C(_);if(!O.has(V)&&(O.add(V),D.push(_),D.length>=2))break}if(!(D.length<2))return{question:e,distractors:[b,...D]}}return null}let Ze=null,gt=null,ht=null;function io(){const e=Xe();if(e&&e.entries.length>0){const u=Oe();if(Ze&&gt===e&&ht===u)return Ze;const t=new Set,n=[];for(const o of e.entries)!o.word||t.has(o.word)||(t.add(o.word),n.push({w:o.word,s:o.syllables,p:u?.[o.word]?[...u[o.word].cho??[],...u[o.word].jung??[],...u[o.word].jong??[]]:[],pron:o.pronunciation||o.word,grade:o.grade}));return Ze=n,gt=e,ht=u,Ze}return[]}const oe=new Proxy([],{get(e,u){const t=io(),n=t[u];return typeof n=="function"?n.bind(t):n}});function Au(e){return e.length?e[Math.floor(Math.random()*e.length)]:void 0}function te(e,u){if(u>=e.length)return F(e);if(u===0)return[];const t=e.slice();for(let n=0;n<u;n++){const o=n+Math.floor(Math.random()*(t.length-n)),r=t[n];t[n]=t[o],t[o]=r}return t.slice(0,u)}let _u=null,mt=null;function fe(){const e=Xe();if(_u&&mt===e)return _u;const u=new Map;for(const t of oe)t.w&&u.set(t.w,t.pron);return _u=u,mt=e,u}function Z(e){return fe().get(e)||e}function eu(e,u,t=new Set){const n=[];for(const o of F(e)){if(n.length>=u)break;const r=Z(o);t.has(r)||(t.add(r),n.push(o))}return n}let co=0;function Q(e){return`${e}-rt-${++co}`}function Le(e){const u=rt();if(!u||u.total===0){const o=new Set;for(const r of e)o.add(r);return o}const t=Mn(),n=new Set;for(const o of e)t.has(o)&&n.add(o);return n}const uu=new Map;let pt=null,St=null;function ve(e){return e==null?"":Array.isArray(e)?e.slice().sort().join(","):e}function yt(e){const u=ve(e.choseong),t=e.composition,n=t?.syllable==null?"":Array.isArray(t.syllable)?t.syllable.slice().sort().join(","):String(t.syllable),o=t?`${ve(t.cho)}/${ve(t.jung)}/${ve(t.jong)}/${t.jongNone?"N":""}/${n}`:"",r=ve(e.grade);return`${e.difficulty??""}|${u}|${o}|${e.excludeNoImage?"1":"0"}|${e.count??""}|x${e.contrastCount??1}|${e.fullCount?"F":""}|s${e.sameStructureOnly===!1?"0":"1"}|v${e.phonemeView==="pron"?"p":"c"}|g${r}|t${e.targetSyllable??""}|c${e.choicesPerItem??""}`}async function ee(e){const u=Xe(),t=Oe();(u!==pt||t!==St)&&(uu.clear(),pt=u,St=t);const n=yt(e);return uu.has(n)||uu.set(n,Co(e)),uu.get(n)}function Et(e){if(!e)return null;const u=l=>l==null?null:Array.isArray(l)?l.length?l:null:[l],t=u(e.cho),n=u(e.jung),o=!!e.jongNone,r=o?null:u(e.jong);return t||n||r||o?o&&!t&&!n&&!r?l=>_n(l):l=>On(l,{cho:t,jung:n,jong:r,jongNone:o}):null}function wt(e){const u=e.grade&&e.grade.length>0?new Set(e.grade):null,t=e.composition??null,n=t?.syllable!=null?new Set(Array.isArray(t.syllable)?t.syllable:[t.syllable]):null,o=t?[Et(t),n?l=>n.has(_e(l)):null].filter(l=>l!=null):[];if(!u&&o.length===0)return null;const r=e.phonemeView==="pron";return l=>{if(u&&(!l.grade||!u.has(l.grade)))return!1;if(o.length===0)return!0;const s=r?Z(l.w):l.w;return o.every(i=>i(s))}}async function Co(e){const{difficulty:u=null,choseong:t=null,composition:n=null,targetSyllable:o=null,excludeNoImage:r=!1}=e,l=e.grade&&e.grade.length>0?new Set(e.grade):null,s=e.sameStructureOnly??!0,i=e.phonemeView==="pron"?"pron":"char",c=Math.max(1,e.contrastCount??1),h=u==="cho"||u==="jung"||u==="jong",d=h&&c>=2,C=u==="count",g=t?new Set(Array.isArray(t)?t:[t]):null,f=n?.syllable!=null?new Set(Array.isArray(n.syllable)?n.syllable:[n.syllable]):null,w=n?[Et(n),f?A=>f.has(_e(A)):null].filter(A=>A!=null):[],y=u==="random"||u===null,m=y||C,S=y||d||C;let E=oe.filter(A=>!A.w||l&&(!A.grade||!l.has(A.grade))?!1:S?!0:Array.isArray(A.p)&&A.p.length>0);g&&(E=E.filter(A=>{for(const I of g)if(An(A.w,I))return!0;return!1})),w.length>0&&(E=E.filter(A=>{const I=i==="pron"?Z(A.w):A.w;return w.every(R=>R(I))})),o&&(E=E.filter(A=>A.w[0]===o));let B;if(r){const A=new Set;for(const I of E)if(A.add(I.w),Array.isArray(I.p))for(const R of I.p)A.add(R);if(m)for(const I of oe)I.w&&A.add(I.w);B=Le(A)}else{const A=new Set;for(const I of E)if(A.add(I.w),Array.isArray(I.p))for(const R of I.p)A.add(R);if(m)for(const I of oe)I.w&&A.add(I.w);B=A}let M=null;if(d){const A=new Set;for(const I of oe)I.w&&A.add(I.w);M=r?Le(A):A}const b=E.filter(A=>B.has(A.w)),D=600,O=Array.from(B),P=O.length>D?te(O,D):O,_=C&&n!=null&&(q(n.cho)||q(n.jung)||q(n.jong)),V=2500,Y=new Map;if(C&&!_&&c>=2){for(const A of O){const I=_e(A),R=Y.get(I);R?R.push(A):Y.set(I,[A])}for(const[A,I]of Y)I.length>V&&Y.set(A,te(I,V))}const L=Bn(),T=_?Qn(n,O,L,s,i,Z):null,v=500,G=1500,X=e.fullCount?b:u==="random"?b.length>v?te(b,v):b:b.length>G?te(b,G):b,K=Oe(),he=[];for(const A of X){let I;const R=Z(A.w);if(d)I=jn(A.w,u,c,M,24).filter($=>Z($)!==R);else if(C)_?I=(T.get(A.w)??[]).filter($=>Z($)!==R):c<=1?I=dt(A.w,K,{okSet:B,pronOf:Z,decompOf:L,sameStructureOnly:!1}):I=(Y.get(_e(A.w))??[]).filter($=>{if($===A.w||Z($)===R)return!1;const U=Tn(A.w,$);return c>=5?U>=5:U===c});else if(y){const $=U=>U!==A.w&&U.length===A.w.length&&Z(U)!==R;if(e.fullCount){const U=P.find($);I=U===void 0?[]:[U]}else I=P.filter($)}else{const $=u;I=dt(A.w,K,{kind:$,okSet:B,pronOf:Z,decompOf:L,sameStructureOnly:!1}),I.length===0&&(I=(P.length>30?te(P,30):P).filter(U=>U!==A.w&&bn(A.w,U)===u&&Z(U)!==R))}if(s&&I.length>0&&(h||C&&!_)){const $=L(Z(A.w));I=I.filter(U=>!wu($,L(Z(U))))}I.length!==0&&he.push({word:A,usable:I})}return he}async function Bt(e,u){const{choicesPerItem:t=3,count:n=10}=u,o=t-1,r=(await ee(u)).filter(s=>s.usable.length>=o),l=[];for(const s of F(r)){if(l.length>=n)break;const i=eu(s.usable,o);if(i.length<o)continue;const c=F([s.word.w,...i]);l.push({id:Q(e+"-item"),index:l.length+1,word:s.word.w,syllables:s.word.s,choices:c,answerIndex:c.indexOf(s.word.w)})}return l}async function fo(e){const{choicesPerItem:u=3,count:t=10}=e,n=u-1,o=await ee({...e,difficulty:null});if(o.length<u)return[];const r=[],l=F([...o]);for(const s of l){if(r.length>=t)break;const i=s.word.w,c=[...s.word.pron||i],h=Au(c);if(!h)continue;const d=o.filter(f=>f.word.w!==i&&f.word.s===s.word.s&&!(f.word.pron||f.word.w).includes(h)&&f.word.pron!==s.word.pron);if(d.length<n)continue;const C=eu(d.map(f=>f.word.w),n);if(C.length<n)continue;const g=F([i,...C]);r.push({id:Q("HPI-item"),index:r.length+1,targetSyllable:h,word:i,choices:g,answerIndex:g.indexOf(i)})}return r}async function go(e){const{count:u=10}=e,t=(await ee(e)).filter(r=>r.usable.length>=1);if(!t.length)return[];const n=t.length>=u?te(t,u):F(Array.from({length:u},(r,l)=>t[l%t.length])),o=F(Array.from({length:u},(r,l)=>l<Math.ceil(u/2)));return n.map((r,l)=>{const s=o[l];let i;if(s)i=[r.word.w,r.word.w];else{const c=Au(r.usable);i=Math.random()<.5?[r.word.w,c]:[c,r.word.w]}return{id:Q("SOD-item"),index:l+1,word:r.word.w,pair:i,same:s}})}async function ho(e){const{choicesPerItem:u=3,count:t=10}=e,n=u-1,o=await ee({...e,difficulty:null});if(o.length<u+1)return[];const r=o.map(C=>C.word.w),l=new Map(o.map(C=>[C.word.w,C.word.pron])),s=C=>(l.get(C)||C)[0]??"",i={};for(const C of o){const g=s(C.word.w);g&&(i[g]||(i[g]=[]),i[g].push(C.word.w))}const c=Object.entries(i).filter(([,C])=>C.length>=2).map(([C])=>C);if(c.length===0)return[];const h=[],d=F([...c]);for(let C=0;h.length<t&&C<t*4;C++){const g=d[C%d.length],f=i[g];if(f.length<2)continue;const w=F([...f]),y=w[0],m=w[1];if(!y||!m||y===m||(l.get(y)||y)===(l.get(m)||m))continue;const S=l.get(m)||m,E=r.filter(b=>s(b)!==g&&b!==y&&b!==m&&b.length===m.length&&(l.get(b)||b)!==S);if(E.length<n)continue;const B=eu(E,n);if(B.length<n)continue;const M=F([m,...B]);h.push({id:Q("SWS-item"),index:h.length+1,sourceWord:y,targetSyllable:g,word:m,choices:M,answerIndex:M.indexOf(m)})}return h}function bt(e,u,t){const n=fe(),o=s=>n.get(s)||s,r=(s,i)=>{const c=[...s],h=[...i];if(c.length!==h.length)return-1;let d=-1;for(let C=0;C<c.length;C++)if(c[C]!==h[C]){if(d>=0)return-1;d=C}return d},l=e.map(s=>({e:s,swaps:s.usable.filter(i=>!!i&&r(s.word.w,i)>=0&&o(i)!==o(s.word.w))})).filter(s=>s.swaps.length>0);return te(l,u).map(({e:s,swaps:i},c)=>{const h=Au(i)??"",d=[...s.word.w],C=[...h],g=r(s.word.w,h),f=eu(s.usable.filter(w=>w&&w!==h),2,new Set([o(h),o(s.word.w)]));return{id:Q(t),index:c+1,word:s.word.w,original:s.word.w,changed:h,changedFrom:g>=0?d[g]:"",changedTo:g>=0?C[g]:"",distractors:f}})}async function At(e,u,t){const{count:n=10}=u,o=fe(),r=oe.filter(f=>f.w&&f.s===e),l=u.excludeNoImage?Le(r.map(f=>f.w)):null,s=l?r.filter(f=>l.has(f.w)):r,i=new Set(s.map(f=>f.w)),c=so(i),h=u.phonemeView??"char",d=u.composition??null,C=wt({grade:u.grade}),g=[];for(const f of F(s)){if(g.length>=n)break;if(C&&!C(f))continue;const w=ao(f.w,d,o,h,c,null,null);if(!w)continue;const y=w.distractors[0],m=[...f.w],S=[...y],E=m.findIndex((B,M)=>B!==S[M]);g.push({id:Q(t),index:g.length+1,word:f.w,original:f.w,changed:y,changedFrom:E>=0?m[E]:"",changedTo:E>=0?S[E]:"",distractors:w.distractors.slice(1)})}return g}async function mo(e){return At(2,e,"CS2-item")}async function po(e){return At(3,e,"CS3-item")}async function So(e){const u=(await ee({...e,difficulty:"count",contrastCount:1})).filter(t=>t.word.s===1&&t.usable.length>=1);return bt(u,e.count??10,"CP1-item")}async function yo(e){const u=e.difficulty&&e.difficulty!=="random"?e.difficulty:"count",t=(await ee({...e,difficulty:u,contrastCount:1})).filter(n=>n.word.s===2&&n.usable.length>=1);return bt(t,e.count??10,"CP2-item")}async function Eo(e){const{count:u=10}=e,t=(await ee({...e})).filter(n=>n.word.s===2);return te(t,u).map((n,o)=>({id:Q("M2S-item"),index:o+1,word:n.word.w,answer:n.word.w,parts:[...n.word.w]}))}async function wo(e){const{count:u=10}=e,t=(await ee({...e})).filter(n=>n.word.s===3);return te(t,u).map((n,o)=>({id:Q("M3S-item"),index:o+1,word:n.word.w,answer:n.word.w,parts:[...n.word.w]}))}async function Bo(e){const{count:u=10}=e,t=(await ee({...e})).filter(s=>s.word.s===2),n=fe(),o=new Set(oe.map(s=>s.w)),r=e.phonemeView??"char",l=[];for(const s of F(t)){if(l.length>=u)break;const i=to(s.word.w,e.composition??null,n,r,o);if(!i)continue;const[c,...h]=i.distractors,d=[...s.word.w],C=d[0]===c?d[1]:d[0];l.push({id:Q("D2-item"),index:l.length+1,original:s.word.w,word:s.word.w,dropped:C,missingResult:c,distractors:h})}return l}async function bo(e){const{count:u=10}=e,t=(await ee({...e})).filter(s=>s.word.s===3),n=fe(),o=new Set(oe.map(s=>s.w)),r=e.phonemeView??"char",l=[];for(const s of F(t)){if(l.length>=u)break;const i=no(s.word.w,e.composition??null,n,r,o);if(!i)continue;const[c,...h]=i.distractors,d=[...s.word.w];let C="";for(let g=0;g<d.length;g++)if(d.filter((f,w)=>w!==g).join("")===c){C=d[g];break}l.push({id:Q("D3-item"),index:l.length+1,original:s.word.w,word:s.word.w,dropped:C,missingResult:c,distractors:h})}return l}async function Ao(e){const{count:u=10}=e,t=(await ee({...e})).filter(s=>s.word.s>=2),n=fe(),o=new Set(oe.map(s=>s.w)),r=e.phonemeView??"char",l=[];for(const s of F(t)){if(l.length>=u)break;const i=oo(s.word.w,e.composition??null,n,r,o);if(!i)continue;const[c,...h]=i.distractors,d=s.word.w,C=d.startsWith(c)?d.slice(c.length):d.endsWith(c)?d.slice(0,d.length-c.length):"";l.push({id:Q("DPC-item"),index:l.length+1,original:d,word:d,dropped:C,missingResult:c,distractors:h})}return l}async function _o(e){const{count:u=10}=e,t=(await ee({...e})).map(n=>n.word.w);return t.length<3?[]:Array.from({length:u},(n,o)=>{const r=te(t,3);return{id:Q("LRO-item"),index:o+1,sequence:r,choices:F(r)}})}function tu(e,u,t){const n=oe.filter(s=>s.w&&s.s===e),o=u.excludeNoImage?Le(n.map(s=>s.w)):null,r=wt(u),l=[];for(const s of n)if(!(o&&!o.has(s.w))&&!(r&&!r(s))){if(t){const i=H(s.w);if(!i||!t(i))continue}l.push(s)}return l}function Do(e){const u=tu(1,e,t=>t.jong===0);return te(u,e.count??10).map((t,n)=>{const o=H(t.w);return{id:Q("M2P-item"),index:n+1,parts:[J[o.cho],ne[o.jung]],answer:t.w,word:t.w}})}function Oo(e){const u=tu(1,e,t=>t.jong>0&&!Ae[t.jong]);return te(u,e.count??10).map((t,n)=>{const o=H(t.w);return{id:Q("M3P-item"),index:n+1,parts:[J[o.cho],ne[o.jung],ue[o.jong]],answer:t.w,word:t.w}})}function No(e){const u=Ct.DROP_FINAL_CONSONANT_FROM_1SYLL,t=tu(u.syllables,e,u.syllable),n=fe(),o=[];for(const r of F(t)){if(o.length>=(e.count??10))break;const l=ro(r.w,null,n);if(!l)continue;const[s,...i]=l.distractors;o.push({id:Q("DFC-item"),index:o.length+1,original:r.w,word:r.w,result:s,distractors:i})}return o}function jo(e){const u=Ct.REMOVE_CONSONANT_AND_IDENTIFY_PHONEME,t=tu(u.syllables,e,u.syllable),n=fe(),o=[];for(const r of F(t)){if(o.length>=(e.count??10))break;const l=lo(r.w,null,n);if(!l)continue;const s=H(n.get(r.w)||r.w);if(!s)continue;const[i,...c]=l.distractors;o.push({id:Q("RCP-item"),index:o.length+1,base:r.w,word:r.w,missingConsonant:J[s.cho],remaining:i,distractors:c})}return o}const nu=new Map;let _t=null,Dt=null;async function Ot(e,u={}){const t=Xe(),n=Oe();(t!==_t||n!==Dt)&&(nu.clear(),_t=t,Dt=n);const o=`${e}:${yt(u)}`;if(nu.has(o))return nu.get(o);const r=await Io(e,u);return nu.set(o,r),r}const To={SAME_SOUND_PICK:e=>Bt("SSP",e),HEAR_AND_PICK_SAME:e=>Bt("HPS",e),HEAR_AND_PICK_INCLUDED:e=>fo(e),SAME_OR_DIFF:e=>go(e),STARTS_WITH_SAME_SOUND:e=>ho(e),LISTEN_AND_REMEMBER_ORDER:e=>_o(e),MERGE_2_SYLLABLES:e=>Eo(e),MERGE_3_SYLLABLES:e=>wo(e),MERGE_2_PHONEMES:e=>Do(e),MERGE_3_PHONEMES:e=>Oo(e),DROP_1_FROM_2SYLL:e=>Bo(e),DROP_1_FROM_3SYLL:e=>bo(e),DROP_PART_FROM_COMPOUND:e=>Ao(e),DROP_FINAL_CONSONANT_FROM_1SYLL:e=>No(e),REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:e=>jo(e),CHANGE_1_SYLL_IN_2SYLL:e=>mo(e),CHANGE_1_SYLL_IN_3SYLL:e=>po(e),CHANGE_1_PHONEME_IN_1SYLL:e=>So(e),CHANGE_1_PHONEME_IN_2SYLL:e=>yo(e)};async function Io(e,u={}){const t=To[e];return t?await t(u):[]}async function Ro(e){const u=["random","count"],t=Object.keys(Su);let n=0;for(const o of u)for(const r of t){const l=Su[r];Ot(r,{difficulty:l.difficulty?o:null,contrastCount:1,composition:null,count:5,excludeNoImage:e,sameStructureOnly:!0,phonemeView:"char",grade:null}).catch(()=>{}),++n%6===0&&await new Promise(s=>setTimeout(s,0))}}async function Mo(e){return(await ee({...e,fullCount:!0})).length}async function Lo(e={}){const u=[];for(const s of oe)s.w&&u.push(s.w);const t=e.excludeNoImage?Le(u):u,n=new Set,o=new Set,r=new Set,l=new Set;for(const s of t){l.add(_e(s));for(const i of s){const c=H(i);if(c&&(J[c.cho]!=="\u3147"&&n.add(J[c.cho]),o.add(ne[c.jung]),c.jong>0)){r.add(ue[c.jong]);const h=Ae[c.jong];h&&h.forEach(d=>r.add(d))}}}return{cho:n,jung:o,jong:r,syllable:l}}const pe="\uC804\uCCB4";function Nt(){const{t:e}=Ce.useTranslation();return a.useMemo(()=>({difficulty:e("wordSearch.filter.difficulty","\uB4F1\uAE09"),syllables:e("wordSearch.filter.syllables","\uC74C\uC808 \uC218"),syllable5plus:e("wordSearch.filter.syllable5plus","5\uC74C\uC808 \uC774\uC0C1"),partOfSpeech:e("wordSearch.filter.partOfSpeech","\uD488\uC0AC"),wordType:e("wordSearch.filter.wordType","\uC720\uD615"),posMap:{[e("wordSearch.filter.pos.noun","\uCCB4\uC5B8(\uBA85\uC0AC, \uC218\uC0AC)")]:["\uBA85","\uC218"],[e("wordSearch.filter.pos.verb","\uC6A9\uC5B8(\uB3D9\uC0AC, \uD615\uC6A9\uC0AC)")]:["\uB3D9","\uD615"],[e("wordSearch.filter.pos.modifier","\uC218\uC2DD\uC5B8(\uBD80\uC0AC, \uAD00\uD615\uC0AC)")]:["\uBD80","\uAD00"]},typeMap:{[e("wordSearch.filter.type.native","\uACE0\uC720\uC5B4")]:"\uACE0\uC720",[e("wordSearch.filter.type.sino","\uD55C\uC790\uC5B4")]:"\uD55C\uC790",[e("wordSearch.filter.type.foreign","\uC678\uB798\uC5B4")]:"\uC678\uB798",[e("wordSearch.filter.type.mixed","\uD63C\uC885\uC5B4")]:"\uD63C\uC885"}}),[e])}function jt(e,u,t){return{label:u.difficulty,items:[1,2,3,4].map(n=>e("wordSearch.filter.grade",{n})),multiple:!0,allOption:!0,allLabel:t?.allLabel,labelAction:t?.labelAction,labelInfo:t?.labelInfo}}function Tt(e){return{label:e.partOfSpeech,items:Object.keys(e.posMap),multiple:!0,allOption:!0}}function It(e){return{label:e.wordType,items:Object.keys(e.typeMap),multiple:!0,allOption:!0}}function vo(e,u){return{label:u.syllables,items:[e("wordSearch.filter.syllable",{n:1}),e("wordSearch.filter.syllable",{n:2}),e("wordSearch.filter.syllable",{n:3}),e("wordSearch.filter.syllable",{n:4}),u.syllable5plus],multiple:!0,allOption:!0}}function ko(e,u){const t=[e("wordPairs.filter.onlyHasImage","\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC")];return u?.includeStructure&&t.push(e("wordPairs.filter.onlySameStructure","\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC")),{label:e("wordPairs.filter.selectLabel","\uC120\uD0DD"),items:t,multiple:!0,labelAction:u?.labelAction,labelInfo:u?.labelInfo}}function xo(e,u){const{label:t,headValue:n,midValue:o,tailValue:r,includeMid:l=!0,headDisabled:s,midDisabled:i,tailDisabled:c,allOptionDisabled:h,groupLabel:d,labelAction:C}=u;return{label:t,...d?{groupLabel:d}:{},...C?{labelAction:C}:{},allOption:!0,allLabel:e("wordSearch.filter.positionAny",{defaultValue:"\uBB34\uAD00"}),...h?{allOptionDisabled:h}:{},items:[{value:n,displayLabel:e("wordSearch.filter.positionHead",{defaultValue:"\uC5B4\uB450"}),disabled:s},...l?[{value:o,displayLabel:e("wordSearch.filter.positionMid",{defaultValue:"\uC5B4\uC911"}),disabled:i}]:[],{value:r,displayLabel:e("wordSearch.filter.positionTail",{defaultValue:"\uC5B4\uB9D0"}),disabled:c}]}}function Po(e,u,t){if(u===pe){const{[t]:r,...l}=e;return l}const n=e[t]??[],o=n.includes(u)?n.filter(r=>r!==u):[...n,u];if(o.length===0){const{[t]:r,...l}=e;return l}return{...e,[t]:o}}Object.fromEntries(Object.entries(zn).map(([e,{nucleus:u}])=>[e,u]));const Fo={\uACE0\uC720\uC5B4:"\uACE0\uC720",\uD55C\uC790\uC5B4:"\uD55C\uC790",\uC678\uB798\uC5B4:"\uC678\uB798",\uD63C\uC885\uC5B4:"\uD63C\uC885"},$o={"\uCCB4\uC5B8(\uBA85\uC0AC,\uC218\uC0AC)":["\uBA85","\uC218"],"\uC6A9\uC5B8(\uB3D9\uC0AC,\uD615\uC6A9\uC0AC)":["\uB3D9","\uD615"],"\uC218\uC2DD\uC5B8(\uBD80\uC0AC,\uAD00\uD615\uC0AC)":["\uBD80","\uAD00"]},Vo={difficulty:"\uB09C\uC774\uB3C4 \uB4F1\uAE09",syllables:"\uC74C\uC808 \uC218",syllable5plus:"5\uC74C\uC808 \uC774\uC0C1",partOfSpeech:"\uD488\uC0AC",wordType:"\uC720\uD615",posMap:$o,typeMap:Fo};function Ho(e,u,t=Vo){const n=u[t.difficulty];if(n?.length&&!n.some(s=>e.grade===s.replace(/\D/g,"")))return!1;const o=u[t.syllables];if(o?.length){const s=e.syllables??0;if(!o.some(i=>i===t.syllable5plus?s>=5:s===parseInt(i)))return!1}const r=u[t.partOfSpeech];if(r?.length&&!r.flatMap(s=>t.posMap[s]??[s]).some(s=>(e.pos??"").includes(s)))return!1;const l=u[t.wordType];return!(l?.length&&!l.some(s=>e.wordType===t.typeMap[s]))}const Go={labial:e=>e("common.phonetics.place.labial",{defaultValue:"\uC591\uC21C\uC74C"}),alveolar:e=>e("common.phonetics.place.alveolar",{defaultValue:"\uCE58\uC870\uC74C"}),palatal:e=>e("common.phonetics.place.palatal",{defaultValue:"\uACBD\uAD6C\uAC1C\uC74C"}),velar:e=>e("common.phonetics.place.velar",{defaultValue:"\uC5F0\uAD6C\uAC1C\uC74C"}),glottal:e=>e("common.phonetics.place.glottal",{defaultValue:"\uC131\uBB38\uC74C"})},Yo={frontHigh:e=>e("common.phonetics.vowel.frontHigh",{defaultValue:"\uC804\uC124 \uACE0\uBAA8\uC74C"}),backHighUnrounded:e=>e("common.phonetics.vowel.backHighUnrounded",{defaultValue:"\uD6C4\uC124 \uACE0\uBAA8\uC74C \uD3C9\uC21C"}),backHighRounded:e=>e("common.phonetics.vowel.backHighRounded",{defaultValue:"\uD6C4\uC124 \uACE0\uBAA8\uC74C \uC6D0\uC21C"}),frontMid:e=>e("common.phonetics.vowel.frontMid",{defaultValue:"\uC804\uC124 \uC911\uBAA8\uC74C"}),backMidUnrounded:e=>e("common.phonetics.vowel.backMidUnrounded",{defaultValue:"\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C"}),backMidRounded:e=>e("common.phonetics.vowel.backMidRounded",{defaultValue:"\uD6C4\uC124 \uC911\uBAA8\uC74C \uC6D0\uC21C"}),low:e=>e("common.phonetics.vowel.low",{defaultValue:"\uC800\uBAA8\uC74C"})},Uo={j:e=>e("common.phonetics.glide.j",{defaultValue:"j\uD65C\uC74C"}),w:e=>e("common.phonetics.glide.w",{defaultValue:"w\uD65C\uC74C"}),velar:e=>e("common.phonetics.glide.velar",{defaultValue:"\u0270\uD65C\uC74C"})};function Rt(e,u){if("place"in u)return Go[u.place](e);const t=Yo[u.vowel](e);return u.glide?`${t} \xB7 ${Uo[u.glide](e)}`:t}const Wo=(e,{defaultValue:u})=>u,Mt=(e,u)=>({jamos:e,phonetic:u,tooltip:Rt(Wo,u)}),ie=(e,u)=>u.map(t=>Mt([t],{place:e})),z=(e,u,t)=>Mt([...e],t?{vowel:u,glide:t}:{vowel:u}),Du={cho:[ie("labial",["\u3142","\u3143","\u314D","\u3141"]),ie("alveolar",["\u3137","\u3138","\u314C","\u3134","\u3139"]),ie("alveolar",["\u3145","\u3146"]),ie("palatal",["\u3148","\u3149","\u314A"]),ie("velar",["\u3131","\u3132","\u314B"]),ie("glottal",["\u314E"])],jung:[[z("\u3163","frontHigh"),z("\u315F","frontHigh","w"),z("\u3162","frontHigh","velar")],[z("\u3161","backHighUnrounded")],[z("\u315C","backHighRounded"),z("\u3160","backHighRounded","j")],[z("\u3154\u3150","frontMid"),z("\u3156\u3152","frontMid","j"),z("\u3159\u315A\u315E","frontMid","w")],[z("\u3153","backMidUnrounded"),z("\u3155","backMidUnrounded","j"),z("\u315D","backMidUnrounded","w")],[z("\u3157","backMidRounded"),z("\u315B","backMidRounded","j")],[z("\u314F","low"),z("\u3151","low","j"),z("\u3158","low","w")]],jong:[ie("labial",["\u3142","\u3141"]),ie("alveolar",["\u3137","\u3134","\u3139"]),ie("velar",["\u3131","\u3147"])]},Ko=[...J],qo=[...ne],zo=ue.filter(e=>e!==""),ce=e=>e===re?[]:Array.from(e),re="__NO_CODA__",Lt=[1,2,3,4],le=5,Jo=12,vt="SYL_",Ou=e=>`${vt}${e}`,Qo=e=>Number(e.slice(vt.length));function Nu(e){return e>=le?Array.from({length:Jo-le+1},(u,t)=>le+t):[e]}const kt={cho:Ko,jung:qo,jong:zo},ju=e=>e.map(u=>u.map(({jamos:t,phonetic:n,tooltip:o})=>({v:t.join(""),phonetic:n,tooltip:o}))),Tu={cho:ju(Du.cho),jung:ju(Du.jung),jong:ju(Du.jong)},xt={};Tu.jung.flat().forEach(({v:e})=>{for(const u of ce(e))xt[u]=e});const Xo=new Set(Tu.cho.flat().map(e=>e.v));function Pt(e,u){return e==="cho"?Xo.has(u)?u:null:e==="jung"?xt[u]??u:yu(u)}function Ft(e,u,t){if(e==="jung"){const n=ce(u);return t&&n.includes(t)?t:n[0]??u}return e==="jong"&&t&&yu(t)===u?t:u}function $t(e,u,t,n){const o=(r,l)=>l?r==="jong"&&l===re?re:u==="pron"?Pt(r,l):Ft(r,l,r==="jung"?t:r==="jong"?n:null):null;return{...e,cho:o("cho",e.cho),jung:o("jung",e.jung),jong:o("jong",e.jong)}}const Iu={cho:null,jung:null,jong:null,syllable:null},Zo="wt_filter",Vt=e=>`wt_filter_${e}`,Ru=["noun","verb","modifier"],Mu=["native","sino","foreign","mixed"];function Ht(e,u,t,n,o){if(!Array.isArray(e))return[];const r=[];for(const l of e){if(typeof l!="string")continue;const s=u.includes(l)?l:u.find(i=>o.some(c=>n(c,t(i))===l));s&&!r.includes(s)&&r.push(s)}return r}function Gt(e){try{const u=localStorage.getItem(Vt(e))??localStorage.getItem(Zo);if(u)return JSON.parse(u)}catch{}return null}function Yt(e){const u=e?.phonemeView;return u==="pron"?"pron":u==="direct"?"direct":"char"}function er(e){const u=e;return u?.composition?{cho:u.composition.cho??null,jung:u.composition.jung??null,jong:u.composition.jong??null,syllable:u.composition.syllable??null}:u?.choseong?{...Iu,cho:u.choseong}:Iu}function ur(e,u,t){const{t:n,i18n:o}=Ce.useTranslation(),[r]=a.useState(()=>t?.resetOnMount?null:Gt(e)),[l,s]=a.useState(Yt(r)),[i,c]=a.useState(()=>er(r)),h=a.useCallback(()=>u.requireSyllable?{cho:"\u3131",jung:"\u314F",jong:re,syllable:u.fixedSyllable??null}:{cho:null,jung:null,jong:u.fixedNoCoda?re:null,syllable:u.fixedSyllable??null},[u.requireSyllable,u.fixedSyllable,u.fixedNoCoda]);a.useEffect(()=>{!u.requireSyllable&&u.fixedSyllable==null&&!u.fixedNoCoda||c(p=>p.cho||p.jung||p.syllable!=null||p.jong?p:h())},[]);const d=a.useMemo(()=>q(i.cho)||q(i.jung)||q(i.jong)?"count":"random",[i.cho,i.jung,i.jong]),C=a.useRef(l==="char"?i.jung:null),g=a.useRef(l==="char"?i.jong:null);a.useEffect(()=>{l==="char"&&(C.current=i.jung,g.current=i.jong)},[l,i.jung,i.jong]);const[f,w]=a.useState(t?.resetOnMount?!!t?.defaultImageOnly:r?.excludeNoImage??!0),[y,m]=a.useState(t?.resetOnMount?!1:r?.sameStructureOnly??!0),[S,E]=a.useState(Array.isArray(r?.gradeFilter)?r.gradeFilter:[]),B=Array.from(new Set([o.language,"ko","en"].filter(Boolean))),M=(p,N)=>o.getFixedT(p)(N),b=p=>Ht(p,Ru,N=>`wordSearch.filter.pos.${N}`,M,B),D=p=>Ht(p,Mu,N=>`wordSearch.filter.type.${N}`,M,B),[O,P]=a.useState(()=>b(r?.posFilter)),[_,V]=a.useState(()=>D(r?.wordTypeFilter)),Y=a.useRef(t?.resetKey);a.useEffect(()=>{Y.current!==t?.resetKey&&(Y.current=t?.resetKey,c(h()),w(!!t?.defaultImageOnly),m(!1),E([]),P([]),V([]))},[t?.resetKey]);const L=Nt(),T=a.useMemo(()=>Object.keys(L.posMap),[L]),v=a.useMemo(()=>Object.keys(L.typeMap),[L]),G=a.useMemo(()=>O.map(p=>T[Ru.indexOf(p)]).filter(Boolean),[O,T]),X=a.useMemo(()=>_.map(p=>v[Mu.indexOf(p)]).filter(Boolean),[_,v]),[K,he]=a.useState({cho:new Set,jung:new Set,jong:new Set,syllable:new Set}),[A,I]=a.useState(!1),[R,$]=a.useState(null),U=1,se=Math.max(1,[i.cho,i.jung,i.jong].filter(Boolean).length),[Ye,Xt]=a.useState(e);a.useEffect(()=>{if(Ye!==e){if(!t?.resetOnMount){const p=Gt(e);c(p?.composition??h()),w(p?.excludeNoImage??!0),m(p?.sameStructureOnly??!0),s(Yt(p)),E(Array.isArray(p?.gradeFilter)?p.gradeFilter:[]),P(b(p?.posFilter)),V(D(p?.wordTypeFilter))}Xt(e)}},[e,Ye,t?.resetOnMount]),a.useEffect(()=>{if(!t?.resetOnMount&&Ye===e)try{localStorage.setItem(Vt(e),JSON.stringify({contrastCount:se,composition:i,excludeNoImage:f,sameStructureOnly:y,phonemeView:l,gradeFilter:S,posFilter:O,wordTypeFilter:_}))}catch{}},[t?.resetOnMount,e,Ye,se,i,f,y,l,S,O,_]);const[Cu,xu]=a.useState(0);qu("wordpool:update",()=>xu(p=>p+1));const Pu=a.useRef(o.language);a.useEffect(()=>{Pu.current!==o.language&&(Pu.current=o.language,xu(p=>p+1))},[o.language]),a.useEffect(()=>{if(!u.choseong)return;let p=!1;return Lo({difficulty:d,excludeNoImage:f}).then(N=>{p||(he(N),N.cho.size+N.jung.size+N.jong.size>0&&I(!0))}).catch(()=>{p||he({cho:new Set,jung:new Set,jong:new Set,syllable:new Set})}),()=>{p=!0}},[u.choseong,d,f,Cu]),a.useEffect(()=>{let p=!1;const N=i,j=N.cho?ce(N.cho):null,k=N.jung?ce(N.jung):null,W=N.jong===re,Se=W?null:N.jong?ce(N.jong):null,ye=N.syllable!=null?Nu(N.syllable):null,We=!!(j||k||Se||W||ye);return Mo({difficulty:u.difficulty?d:null,contrastCount:u.difficulty?se:1,composition:u.choseong&&We?{cho:j,jung:k,jong:Se,jongNone:W,syllable:ye}:null,excludeNoImage:f,sameStructureOnly:y,phonemeView:l==="pron"?"pron":"char",grade:S.length>0?S:null}).then(Ke=>{p||$(Ke)}).catch(()=>{p||$(null)}),()=>{p=!0}},[u.choseong,u.difficulty,d,se,i,l,f,y,Cu,S]),a.useEffect(()=>{A&&c(p=>{const N={...p};let j=!1;return["cho","jung","jong"].forEach(k=>{const W=p[k];!W||W===re||ce(W).some(Se=>K[k].has(Se))||(N[k]=null,j=!0)}),p.syllable!=null&&u.fixedSyllable==null&&(p.syllable>=le?[...K.syllable].some(k=>k>=le)||(N.syllable=null,j=!0):(!K.syllable.has(p.syllable)||p.syllable<U)&&(N.syllable=null,j=!0)),j?N:p})},[K,A,U,u.fixedSyllable]);const Fu=a.useMemo(()=>{const p=N=>{const j=new Set;for(const k of kt[N])K[N].has(k)&&j.add(k);return j};return{cho:p("cho"),jung:p("jung"),jong:p("jong")}},[K]),du=a.useMemo(()=>({exact:new Set(Lt.filter(p=>K.syllable.has(p))),min:[...K.syllable].some(p=>p>=le)}),[K]),x=a.useMemo(()=>({composition:n("wordPairs.composition","\uC815\uB2F5 \uB2E8\uC5B4 \uAD6C\uC131"),syllableCount:n("wordPairs.syllableCount","\uC74C\uC808 \uC218"),onset:n("wordPairs.onset","\uCD08\uC131"),vowel:n("wordPairs.vowel","\uBAA8\uC74C"),coda:n("wordPairs.coda","\uC885\uC131"),phonemeGroup:n("training.filter.phonemeGroup",{defaultValue:"\uD6C8\uB828 \uC74C\uC808"}),trainOnset:n("training.filter.trainOnset",{defaultValue:"\uCD08\uC131"}),trainVowel:n("training.filter.trainVowel",{defaultValue:"\uBAA8\uC74C"}),trainCoda:n("training.filter.trainCoda",{defaultValue:"\uC885\uC131"}),random:n("training.filter.random","\uBB34\uC791\uC704"),exclude:n("wordSearch.filter.exclude","\uC81C\uC678"),selectLabel:n("training.filter.selectSection",{defaultValue:"\uC120\uD0DD"}),none:n("common.none","\uC5C6\uC74C"),noImage:n("wordSearch.filter.excludeNoImage","\uC774\uBBF8\uC9C0 \uC5C6\uC74C"),excludeImage:n("training.filter.excludeImage",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC"}),sameStructure:n("training.filter.sameStructure",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC"}),noLimit:n("training.filter.noLimit",{defaultValue:"\uBB34\uAD00"}),codaExclude:n("training.filter.codaExclude",{defaultValue:"\uC81C\uC678"}),gradeLabel:n("training.filter.gradeLabel",{defaultValue:"\uB09C\uC774\uB3C4 \uB4F1\uAE09"})}),[n]),$u=a.useMemo(()=>({[x.trainOnset]:"cho",[x.trainVowel]:"jung",[x.trainCoda]:"jong"}),[x]),Ue=a.useCallback((p,N)=>({title:N,items:p}),[]),fu=a.useMemo(()=>[n("training.filter.excludeImageInfo",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC: \uB2E8\uC5B4 \uC911\uC5D0 \uC774\uBBF8\uC9C0\uAC00 \uC788\uB294 \uB2E8\uC5B4\uB9CC \uACB0\uACFC\uC5D0 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4."}),n("training.filter.sameStructureInfo",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC: \uC815\uB2F5\uACFC \uC624\uB2F5\uC758 \uC74C\uC808 \uAD6C\uC870(\uAE00\uC790 \uC218\xB7\uBC1B\uCE68 \uC720\uBB34 \uB4F1)\uAC00 \uAC19\uC740 \uACB0\uACFC\uB9CC \uB0A8\uACA8\uC694."})],[n]),Zt=a.useMemo(()=>{const p=[];if(u.choseong){const N={value:re,displayLabel:x.codaExclude},j=u.fixedNoCoda===!0,k=(W,Se)=>{const ye=j&&W==="jong",We={label:Se,groupLabel:x.phonemeGroup,allOption:!u.requireSyllable,allLabel:x.noLimit,allOptionDisabled:ye};if(l==="pron"){const Ee=Tu[W].map(ln=>ln.map(({v:gu,phonetic:sn})=>{const hu=ce(gu),Vu=Rt(n,sn),Hu=ye||!hu.some(an=>K[W].has(an));return hu.length>1?{value:gu,labels:hu,tooltip:Vu,disabled:Hu}:{value:gu,tooltip:Vu,disabled:Hu}}));return W==="jong"&&!u.requireCoda&&Ee.unshift([N]),{...We,groups:Ee}}const Ke=kt[W].map(Ee=>!ye&&Fu[W].has(Ee)?Ee:{value:Ee,disabled:!0});return{...We,items:W==="jong"&&!u.requireCoda?[N,...Ke]:Ke}};p.push(k("cho",x.trainOnset)),p.push(k("jung",x.trainVowel)),p.push(k("jong",x.trainCoda))}if(p.push({...jt(n,L,{labelInfo:Ue([n("wordPairs.filter.difficultyInfo",{defaultValue:"\uAD6D\uB9BD\uAD6D\uC5B4\uC6D0\uC758 \uAE30\uCD08 \uC5B4\uD718 \uB4F1\uAE09\uC774 \uACB0\uACFC\uC5D0 \uBC18\uC601\uB429\uB2C8\uB2E4."})])}),label:x.gradeLabel}),u.partOfSpeech&&p.push(Tt(L)),u.wordType&&p.push(It(L)),u.choseong||u.fixedSyllable!=null){const N=u.fixedSyllable;p.push({label:x.syllableCount,items:[...Lt.map(j=>({value:Ou(j),displayLabel:n("wordPairs.syllableN",{n:j,defaultValue:"{{n}}\uC74C\uC808"}),disabled:N!=null?j!==N:!du.exact.has(j)||j<U})),{value:Ou(le),displayLabel:n("wordPairs.syllableNPlus",{n:le,defaultValue:"{{n}}\uC74C\uC808 \uC774\uC0C1"}),disabled:N!=null?le!==N:!du.min}],allOption:!0,allOptionDisabled:N!=null})}return u.choseong?p.push({label:x.exclude,displayLabel:x.selectLabel,multiple:!0,items:[x.excludeImage,x.sameStructure],labelInfo:Ue(fu)}):p.push({label:x.exclude,displayLabel:x.selectLabel,multiple:!0,items:[x.excludeImage],labelInfo:Ue([fu[0]])}),p},[u.choseong,u.partOfSpeech,u.wordType,u.requireSyllable,u.fixedSyllable,u.fixedNoCoda,u.requireCoda,U,Fu,K,l,du,x,n,Ue,fu,L]),en={...(u.choseong||u.fixedSyllable!=null)&&i.syllable!=null?{[x.syllableCount]:Ou(i.syllable)}:{},...u.choseong&&i.cho?{[x.trainOnset]:i.cho}:{},...u.choseong&&i.jung?{[x.trainVowel]:i.jung}:{},...u.choseong&&i.jong?{[x.trainCoda]:i.jong}:{},[x.exclude]:[...f?[x.excludeImage]:[],...y?[x.sameStructure]:[]],[x.gradeLabel]:S.map(p=>n("wordSearch.filter.grade",{n:Number(p),defaultValue:"{{n}}\uB4F1\uAE09"})),...u.partOfSpeech?{[L.partOfSpeech]:G}:{},...u.wordType?{[L.wordType]:X}:{}},un=a.useCallback((p,N)=>{if(N===x.exclude)p===x.excludeImage?w(j=>!j):p===x.sameStructure&&m(j=>!j);else if(N===x.syllableCount)c(j=>{if(!p||p===pe)return{...j,syllable:null};const k=Qo(p);return{...j,syllable:j.syllable===k?null:k}});else if(N===x.gradeLabel){if(!p||p===pe){E([]);return}const j=p.replace(/\D/g,"");E(k=>k.includes(j)?k.filter(W=>W!==j):[...k,j])}else if(N===L.partOfSpeech){if(!p||p===pe){P([]);return}const j=Ru[T.indexOf(p)]??b([p])[0];if(!j)return;P(k=>k.includes(j)?k.filter(W=>W!==j):[...k,j])}else if(N===L.wordType){if(!p||p===pe){V([]);return}const j=Mu[v.indexOf(p)]??D([p])[0];if(!j)return;V(k=>k.includes(j)?k.filter(W=>W!==j):[...k,j])}else{const j=$u[N];if(!j)return;c(k=>u.requireSyllable?p&&p!==pe?{...k,[j]:p}:k:!p||p===pe||k[j]===p?{...k,[j]:null}:{...k,[j]:p})}},[x,$u,L,T,v,u.requireSyllable]),tn=a.useCallback(p=>!u.partOfSpeech&&!u.wordType?!0:Ho(p,{...u.partOfSpeech?{[L.partOfSpeech]:G}:{},...u.wordType?{[L.wordType]:X}:{}},L),[u.partOfSpeech,u.wordType,G,X,L]),nn=a.useCallback(p=>{p!==l&&(p!=="direct"&&l!=="direct"&&c(N=>$t(N,p,C.current,g.current)),s(p))},[l]),on=a.useCallback(()=>({composition:i,contrastCount:se,excludeNoImage:f,sameStructureOnly:y,phonemeView:l,gradeFilter:S,posFilter:O,wordTypeFilter:_}),[i,se,f,y,l,S,O,_]),rn=a.useCallback(p=>{c(p.composition),w(p.excludeNoImage),m(p.sameStructureOnly??!0),s(p.phonemeView),E(Array.isArray(p.gradeFilter)?p.gradeFilter:[]),Array.isArray(p.posFilter)&&P(b(p.posFilter)),Array.isArray(p.wordTypeFilter)&&V(D(p.wordTypeFilter))},[]);return{difficulty:d,contrastCount:se,composition:i,choseong:i.cho,excludeNoImage:f,sameStructureOnly:y,gradeFilter:S,posFilter:G,wordTypeFilter:X,matchesWordAttributes:tn,poolVersion:Cu,filterSections:Zt,filterSelected:en,handleFilterSelect:un,phonemeView:l,setPhonemeView:nn,phonemeGroupLabel:x.phonemeGroup,wordCount:R,getFilterSnapshot:on,restoreFilterSnapshot:rn}}function tr(e){const u=s=>s?ce(s):null,t=u(e.cho),n=u(e.jung),o=e.jong===re,r=o?null:u(e.jong),l=e.syllable!=null?Nu(e.syllable):null;return!t&&!n&&!r&&!o&&!l?null:{cho:t,jung:n,jong:r,jongNone:o,syllable:l}}function nr(e,u,t,n,o,r,l=!0,s="char",i=[]){const[c,h]=a.useState({}),[d,C]=a.useState(!1),{cho:g=null,jung:f=null,jong:w=null,syllable:y=null}=n??{},m=i.length>0?i.slice().sort().join(","):"",S=e.map(B=>B.key).join("|");a.useEffect(()=>{r>0&&Ro(o).catch(()=>{})},[r,o]),a.useEffect(()=>{let B=!1;return C(!0),(async()=>{const M=tr({cho:g,jung:f,jong:w,syllable:y}),b=`${g??""}_${f??""}_${w??""}_${y??""}_${m}`,D={};await Promise.all(e.map(async O=>{const P=Su[O.key];try{const _=await Ot(O.key,{difficulty:P.difficulty?u:null,contrastCount:P.difficulty?t:1,composition:P.choseong?M:null,count:5,excludeNoImage:o,sameStructureOnly:l,phonemeView:s,grade:i.length>0?i:null});_&&_.length>0?D[O.key]={id:`wt-${O.key}-${u}-${b}-${Date.now()}`,name:O.label,training_type:O.key,category_main_code:"WORD",iconColor:O.color,subTitle:O.subTitle,items:_,itemCount:_.length}:D[O.key]={id:`wt-${O.key}-empty`,name:O.label,training_type:O.key,category_main_code:"WORD",iconColor:O.color,subTitle:O.subTitle,items:[],itemCount:0,__empty:!0}}catch{D[O.key]=null}})),B||(h(D),C(!1))})(),()=>{B=!0}},[u,t,g,f,w,y,o,l,s,r,m,S]);const E=JSON.stringify(e.map(B=>[B.key,B.label,B.color,B.subTitle]));return{perTypeData:a.useMemo(()=>{const B={};for(const[M,b]of Object.entries(c)){const D=e.find(O=>O.key===M);B[M]=b&&D?{...b,name:D.label,iconColor:D.color,subTitle:D.subTitle}:b}return B},[c,E]),generating:d}}const ke=[],xe=[],Pe=[],Fe=[],ou={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},ru={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},or={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};let Lu=null,Ut=null,ge=null;function rr({counts:e,forceRefresh:u}={}){const t=Object.assign({},or,e||{}),n=qe(),o=ze(new Date(`${n}T00:00:00+09:00`).getTime()-864e5),r=JSON.stringify(t);if(!u&&Ut===n&&Lu===r&&ge)return Object.assign(ou,ge.today),Object.assign(ru,ge.yesterday?.selection||{LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),{today:ou,yesterday:ru};const l={LISTEN_IN_NOISE:ae(ke,Math.max(0,Number(t.LISTEN_IN_NOISE)||0)),SHORT_STORY:ae(xe,Math.max(0,Number(t.SHORT_STORY)||0)),LONG_STORY:ae(Pe,Math.max(0,Number(t.LONG_STORY)||0)),ORDERING_SENTENCE:ae(Fe,Math.max(0,Number(t.ORDERING_SENTENCE)||0))};let s=null;return ge&&Lu===r&&ge.yesterday&&ge.yesterday.date===o&&(s=ge.yesterday.selection),s||(s={LISTEN_IN_NOISE:ae(ke,Math.max(0,Number(t.LISTEN_IN_NOISE)||0)),SHORT_STORY:ae(xe,Math.max(0,Number(t.SHORT_STORY)||0)),LONG_STORY:ae(Pe,Math.max(0,Number(t.LONG_STORY)||0)),ORDERING_SENTENCE:ae(Fe,Math.max(0,Number(t.ORDERING_SENTENCE)||0))}),Object.assign(ou,l),Object.assign(ru,s),Ut=n,Lu=r,ge={today:l,yesterday:{date:o,countsKey:r,selection:s}},{today:ou,yesterday:ru}}let Wt=!1,$e=null;async function lr(){try{const e={url:typeof document>"u"?require("url").pathToFileURL(__filename).href:mu&&mu.tagName.toUpperCase()==="SCRIPT"&&mu.src||new URL("hooks.cjs.js",document.baseURI).href}&&void 0||"/",u=await fetch(`${e}data/allTrainingData.json`);return u.ok?await u.json():null}catch{return null}}async function sr(){if(!Wt)return $e||($e=(async()=>{const e=await lr();if(!e){$e=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}const u={noise:[],short:[],long:[],order:[]};try{for(const t of Object.keys(e||{})){const n=e[t]||[];for(const o of n){const r=o,l=String(r.training_type||t),s=String(r.category_main_code||r.category_main||r.category_0||""),i=String(r.category_sub_code||r.category_sub||r.category_1||""),c=Object.assign({},r,{training_type:l,category_0:s,category_1:i});l==="LISTEN_IN_NOISE"?u.noise.push(c):l==="SHORT_STORY"?u.short.push(c):l==="LONG_STORY"?u.long.push(c):l==="ORDERING_SENTENCE"&&u.order.push(c)}}}catch{$e=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}ke.push(...u.noise),xe.push(...u.short),Pe.push(...u.long),Fe.push(...u.order);try{window.dispatchEvent(new Event("speechear.data.updated"))}catch{}try{rr()}catch{}Wt=!0})(),$e)}async function ar(e=3e3){const u=sr();return Promise.race([u,new Promise(t=>setTimeout(t,e))])}function ir(e){let u=2166136261;for(let t=0;t<e.length;t++)u^=e.charCodeAt(t),u=Math.imul(u,16777619);return u>>>0}function cr(e){let u=e>>>0;return()=>{u|=0,u=u+1831565813|0;let t=Math.imul(u^u>>>15,1|u);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}const lu=ae;function vu(e,u){const t=u?cr(ir(u)):Math.random;return{LISTEN_IN_NOISE:lu(ke,Math.max(0,e.LISTEN_IN_NOISE||0),t),SHORT_STORY:lu(xe,Math.max(0,e.SHORT_STORY||0),t),LONG_STORY:lu(Pe,Math.max(0,e.LONG_STORY||0),t),ORDERING_SENTENCE:lu(Fe,Math.max(0,e.ORDERING_SENTENCE||0),t)}}function Kt(e){return e?!!(e.LISTEN_IN_NOISE?.length||e.SHORT_STORY?.length||e.LONG_STORY?.length||e.ORDERING_SENTENCE?.length):!1}const Cr={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};function qt(e=!1,u=Cr,t){const n=ze(Date.now()),o=ze(Date.now()-864e5),r=`${t??""}|${n}`,l=`${t??""}|${o}`;return ke.length>0||xe.length>0||Pe.length>0||Fe.length>0?{today:vu(u,r),yesterday:vu(u,l)}:{today:vu(u,r),yesterday:null}}function dr(e){const u=a.useRef({LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),t=a.useRef(null),[n,o]=a.useState(!1),[r,l]=a.useState(!1),[s,i]=a.useState(0),[c,h]=a.useState(!1),[d,C]=a.useState(()=>qe());a.useEffect(()=>{const f=()=>{const y=Date.now(),m=new Date(y+9*36e5),S=Date.UTC(m.getUTCFullYear(),m.getUTCMonth(),m.getUTCDate()+1)-9*36e5;return Math.max(1e3,S-y+1e3)};let w=setTimeout(function y(){C(qe()),w=setTimeout(y,f())},f());return()=>clearTimeout(w)},[]),a.useEffect(()=>{let f=!1,w,y=0;const m=40,S=()=>{w!==void 0&&(clearInterval(w),w=void 0)};let E=!1;try{const b=new URLSearchParams(window.location.search),D=b.get("forceRefresh")||b.get("force");E=D==="1"||D==="true"}catch{}const B=b=>{u.current=b.today,t.current=b.yesterday,o(!0),h(!0),i(D=>D+1),f=!0,S()},M=async()=>{if(f)return;if(!E){const D=qt(!1,void 0,e);if(Kt(D.today)){B(D);return}}try{await ar(3e3)}catch{}if(f)return;const b=qt(E,void 0,e);if(Kt(b.today)){B(b);return}++y>=m&&(o(!0),h(!1),f=!0,S())};return M(),w=setInterval(M,250),()=>{f=!0,S()}},[e,d]);const g=a.useCallback(f=>{const w=r?t.current:u.current,y=r?u.current:t.current;return w?.[f]?.length?w[f]:y?.[f]?.length?y[f]:void 0},[r,s]);return{loaded:n,hasData:c,showYesterday:r,setShowYesterday:l,getTrainingPerType:g}}const be=[];let su=!1;function zt(e){if(e.key!=="Escape"||e.defaultPrevented||e.isComposing||e.keyCode===229)return;const u=be[be.length-1];u&&(e.stopPropagation(),u())}function Jt(e){return be.push(e),!su&&typeof document<"u"&&(document.addEventListener("keydown",zt),su=!0),()=>{const u=be.lastIndexOf(e);u>=0&&be.splice(u,1),be.length===0&&su&&typeof document<"u"&&(document.removeEventListener("keydown",zt),su=!1)}}function fr(e,u=!0){const t=Ku(e);a.useEffect(()=>{if(u)return Jt(()=>{t.current?.()})},[u,t])}const ku=(e,u)=>`${e}:${u??1}`,au=new Map,Qt=new Set;function gr(e,u){const[t,n]=a.useState(0),o=Array.from(new Set(e.map(r=>ku(r.word,r.homonum)))).sort().join("|");return a.useEffect(()=>{const r=(o?o.split("|"):[]).filter(i=>!au.has(i)&&!Qt.has(i));if(r.length===0)return;let l=!1;const s=Array.from(new Set(r.map(i=>i.slice(0,i.lastIndexOf(":")))));return u(s).then(i=>{for(const c of i)c.Meaning&&au.set(ku(c.Word,c.Homonum??void 0),c.Meaning);if(i.length>0)for(const c of r)au.has(c)||Qt.add(c);l||i.length===0||n(c=>c+1)}).catch(()=>{}),()=>{l=!0}},[o,u]),a.useMemo(()=>{const r=o?o.split("|"):[],l=new Map;for(const s of r){const i=au.get(s);i!=null&&l.set(s,i)}return l},[o,t])}function hr(){const[e,u]=a.useState(null),t=a.useCallback(r=>u(r.getBoundingClientRect()),[]),n=a.useCallback(()=>u(null),[]),o=a.useCallback(r=>{const l=r.getBoundingClientRect();u(s=>s?null:l)},[]);return{anchorRect:e,isOpen:e!=null,openAt:t,close:n,toggleAt:o}}function mr(e){const[u,t]=a.useState(null),[n,o]=a.useState(null),r=a.useRef(null);a.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]);const l=a.useCallback((i,c)=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{t(i),o(c)},e)},[e]),s=a.useCallback(()=>{r.current&&clearTimeout(r.current),t(null),o(null)},[]);return{payload:u,anchorRect:n,openAfterDelay:l,close:s}}function pr(e,u,t){const n=Number.isFinite(u)&&u>=1?Math.floor(u):1,o=Math.max(1,Math.ceil(e.length/n)),r=Number.isFinite(t)?Math.min(Math.max(1,Math.floor(t)),o):1;return{pageItems:a.useMemo(()=>e.slice((r-1)*n,r*n),[e,r,n]),totalPages:o,curPage:r}}function Sr(e="warning"){const[u,t]=a.useState(""),[n,o]=a.useState(e),[r,l]=a.useState(0),s=a.useCallback((d,C)=>{o(C),t(d),l(g=>g+1)},[]),i=a.useCallback(d=>s(d,"warning"),[s]),c=a.useCallback(d=>s(d,"normal"),[s]),h=a.useCallback(()=>t(""),[]);return{toastMessage:u,toastType:n,toastKey:r,showToast:s,showWarning:i,showNormal:c,clearToast:h}}const yr=[{key:"LISTEN_IN_NOISE",label:"\uC18C\uC74C \uD558 \uBB38\uC7A5 \uB4E3\uAE30",icon:"party-popper",desc:"\uB2E4\uC591\uD55C \uC18C\uC74C \uD658\uACBD\uC5D0\uC11C \uBB38\uC7A5 \uCCAD\uB825\uC744 \uD6C8\uB828\uD569\uB2C8\uB2E4."},{key:"SHORT_STORY",label:"\uC9E7\uC740 \uC774\uC57C\uAE30 \uB4E3\uAE30",icon:"message-square",desc:"\uC9E7\uC740 \uC774\uC57C\uAE30\uB97C \uB4E3\uACE0 \uAE30\uC5B5\uD558\uC5EC \uBB38\uC81C\uB97C \uD480\uC5B4\uBD05\uB2C8\uB2E4."},{key:"LONG_STORY",label:"\uAE34 \uC774\uC57C\uAE30 \uB4E3\uAE30",icon:"message-square-text",desc:"\uAE34 \uC774\uC57C\uAE30\uB97C \uB4E3\uACE0 \uAE30\uC5B5\uD558\uC5EC \uB2E4\uC218\uC758 \uBB38\uC81C\uB97C \uD480\uC5B4\uBD05\uB2C8\uB2E4."},{key:"ORDERING_SENTENCE",label:"\uBB38\uC7A5 \uC21C\uC11C\uD654 \uD558\uAE30",icon:"align-start-vertical",desc:"\uC5EC\uB7EC\uAC1C\uC758 \uC9E7\uC740 \uBB38\uC7A5\uC744 \uB4E3\uACE0 \uAE30\uC5B5\uD558\uC5EC \uADF8 \uC21C\uC11C\uC5D0 \uB9DE\uAC8C \uBC30\uC5F4\uD569\uB2C8\uB2E4."}],Er={LISTEN_IN_NOISE:"listenInNoise",SHORT_STORY:"shortStory",LONG_STORY:"longStory",ORDERING_SENTENCE:"orderingSentence"};function wr(e){return yr.map(u=>{const t=Er[u.key];return t?{...u,label:e(`trainingType.${t}.title`),desc:e(`trainingType.${t}.desc`)}:u})}const Ve={blue:"#60A5FA",green:"#4ADE80",amber:"#FBBF24",purple:"#A78BFA",pink:"#F472B6"},He=Ve.blue,iu=Ve.green,Ge=Ve.amber,cu=Ve.purple,Br=Ve.pink,br=[{key:"discrimination",label:"\uBCC0\uBCC4\uD6C8\uB828",disc:"\uB450 \uC18C\uB9AC\uAC00 \uAC19\uC740\uC9C0 \uB2E4\uB978\uC9C0, \uB610\uB294 \uD2B9\uC815 \uC18C\uB9AC\uB97C \uAD6C\uBCC4\uD558\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"ear",types:[{key:"SAME_SOUND_PICK",label:"\uAC19\uC740 \uC18C\uB9AC \uACE0\uB974\uAE30",icon:"volume-2",color:He,subTitle:"\uB4E4\uC740 \uC18C\uB9AC\uC640 \uAC19\uC740 \uB2E8\uC5B4 \uCE74\uB4DC\uB97C \uACE0\uB974\uC138\uC694."},{key:"SAME_OR_DIFF",label:"\uAC19\uC740\uC9C0 \uB2E4\uB978\uC9C0 \uB9DE\uD788\uAE30",icon:"diff",color:He,subTitle:"\uB450 \uC18C\uB9AC\uAC00 \uAC19\uC740\uC9C0, \uB2E4\uB978\uC9C0 \uAD6C\uBD84\uD558\uC138\uC694."},{key:"HEAR_AND_PICK_SAME",label:"\uC77C\uCE58\uD558\uB294 \uB2E8\uC5B4 \uB9DE\uD788\uAE30",icon:"headphones",color:He,subTitle:"\uB4E4\uC740 \uC18C\uB9AC\uC758 \uB2E8\uC5B4 \uCE74\uB4DC\uB97C \uACE0\uB974\uC138\uC694."},{key:"HEAR_AND_PICK_INCLUDED",label:"\uD55C \uC74C\uC808 \uD3EC\uD568 \uB2E8\uC5B4 \uB9DE\uD788\uAE30",icon:"scan-search",color:He,subTitle:"\uB4E4\uC740 \uC74C\uC808\uC774 \uD3EC\uD568\uB41C \uB2E8\uC5B4 \uCE74\uB4DC\uB97C \uACE0\uB974\uC138\uC694."},{key:"STARTS_WITH_SAME_SOUND",label:"\uCCAB \uC74C\uC808\uC774 \uAC19\uC740 \uB2E8\uC5B4 \uB9DE\uD788\uAE30",icon:"play-circle",color:He,subTitle:"\uB4E4\uC740 \uB2E8\uC5B4\uC640 \uAC19\uC740 \uC18C\uB9AC\uB85C \uC2DC\uC791\uD558\uB294 \uB2E8\uC5B4\uB97C \uACE0\uB974\uC138\uC694."}]},{key:"synthesis",label:"\uD569\uC131\uD6C8\uB828",disc:"\uB450 \uAC1C \uC774\uC0C1\uC758 \uC74C\uC808\uC774\uB098 \uC74C\uC18C\uB97C \uD569\uCCD0 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"git-merge",types:[{key:"MERGE_2_SYLLABLES",label:"\uC74C\uC808 2\uAC1C \uD569\uCE58\uAE30",icon:"link-2",color:iu,subTitle:"\uB450 \uC74C\uC808\uC744 \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uB2E8\uC5B4\uAC00 \uB420\uAE4C\uC694?"},{key:"MERGE_3_SYLLABLES",label:"\uC74C\uC808 3\uAC1C \uD569\uCE58\uAE30",icon:"git-merge",color:iu,subTitle:"\uC138 \uC74C\uC808\uC744 \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uB2E8\uC5B4\uAC00 \uB420\uAE4C\uC694?"},{key:"MERGE_2_PHONEMES",label:"\uC74C\uC18C 2\uAC1C \uD569\uCE58\uAE30",icon:"combine",color:iu,subTitle:"\uB450 \uC74C\uC18C\uB97C \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"MERGE_3_PHONEMES",label:"\uC74C\uC18C 3\uAC1C \uD569\uCE58\uAE30",icon:"braces",color:iu,subTitle:"\uC138 \uC74C\uC18C\uB97C \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"}]},{key:"deletion",label:"\uD0C8\uB77D\uD6C8\uB828",disc:"\uB2E8\uC5B4\uC5D0\uC11C \uC74C\uC808\uC774\uB098 \uC74C\uC18C\uB97C \uC81C\uAC70\uD588\uC744 \uB54C \uB0A8\uB294 \uC18C\uB9AC\uB97C \uC778\uC2DD\uD558\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"scissors",types:[{key:"DROP_1_FROM_2SYLL",label:"2\uC74C\uC808\uC5D0\uC11C 1\uC74C\uC808 \uD0C8\uB77D",icon:"scissors",color:Ge,subTitle:"2\uC74C\uC808 \uB2E8\uC5B4\uC5D0\uC11C \uD55C \uC74C\uC808\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"DROP_1_FROM_3SYLL",label:"3\uC74C\uC808\uC5D0\uC11C 1\uC74C\uC808 \uD0C8\uB77D",icon:"minus-circle",color:Ge,subTitle:"3\uC74C\uC808 \uB2E8\uC5B4\uC5D0\uC11C \uD55C \uC74C\uC808\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"DROP_PART_FROM_COMPOUND",label:"\uD569\uC131\uC5B4\uC5D0\uC11C \uBD80\uBD84\uD0C8\uB77D",icon:"unlink",color:Ge,subTitle:"\uD569\uC131\uC5B4\uC758 \uC77C\uBD80\uB97C \uBE7C\uBA74 \uC5B4\uB5A4 \uB2E8\uC5B4\uAC00 \uB420\uAE4C\uC694?"},{key:"DROP_FINAL_CONSONANT_FROM_1SYLL",label:"1\uC74C\uC808\uC5D0\uC11C \uBC1B\uCE68 \uD0C8\uB77D",icon:"eraser",color:Ge,subTitle:"\uBC1B\uCE68\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"REMOVE_CONSONANT_AND_IDENTIFY_PHONEME",label:"1\uC74C\uC808\uC5D0\uC11C \uC790\uC74C \uD0C8\uB77D",icon:"audio-lines",color:Ge,subTitle:"\uC790\uC74C\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB0A8\uC744\uAE4C\uC694?"}]},{key:"substitution",label:"\uB300\uCE58\uD6C8\uB828",disc:"\uB2E8\uC5B4\uC758 \uC77C\uBD80 \uC74C\uC808\uC774\uB098 \uC74C\uC18C\uB97C \uBC14\uAFB8\uC5B4 \uC0C8\uB85C\uC6B4 \uC18C\uB9AC\uB97C \uB9CC\uB4DC\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"replace",types:[{key:"CHANGE_1_SYLL_IN_2SYLL",label:"2\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC808 \uBC14\uAFB8\uAE30",icon:"replace",color:cu,subTitle:"2\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC808\uC744 \uBC14\uAFD4 \uC0C8 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uC138\uC694."},{key:"CHANGE_1_SYLL_IN_3SYLL",label:"3\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC808 \uBC14\uAFB8\uAE30",icon:"shuffle",color:cu,subTitle:"3\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC808\uC744 \uBC14\uAFD4 \uC0C8 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uC138\uC694."},{key:"CHANGE_1_PHONEME_IN_1SYLL",label:"1\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC18C \uBC14\uAFB8\uAE30",icon:"arrow-right-left",color:cu,subTitle:"1\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC18C\uB97C \uBC14\uAFD4 \uC0C8 \uC18C\uB9AC\uB97C \uB9CC\uB4DC\uC138\uC694."},{key:"CHANGE_1_PHONEME_IN_2SYLL",label:"2\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC18C \uBC14\uAFB8\uAE30",icon:"flip-horizontal",color:cu,subTitle:"2\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC18C\uB97C \uBC14\uAFD4 \uC0C8 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uC138\uC694."}]},{key:"attention",label:"\uCCAD\uAC01\uC801\uC8FC\uC758\uB825\uD6C8\uB828",disc:"\uC5EC\uB7EC \uC18C\uB9AC\uB97C \uB4E3\uACE0 \uC21C\uC11C\uB97C \uAE30\uC5B5\uD558\uB294 \uC8FC\uC758\uB825\uACFC \uB2E8\uAE30 \uAE30\uC5B5 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"list-ordered",types:[{key:"LISTEN_AND_REMEMBER_ORDER",label:"\uB4E3\uACE0 \uC21C\uC11C\uB300\uB85C \uAE30\uC5B5\uD558\uAE30",icon:"list-ordered",color:Br,subTitle:"\uC138 \uB2E8\uC5B4\uB97C \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694."}]}];function Ar(){const{t:e}=Ce.useTranslation();return a.useMemo(()=>{const u=Object.fromEntries(wr(e).map(n=>[n.key,n.label])),t={...u};return br.flatMap(n=>n.types).forEach(n=>{t[n.key]=e(`trainingType.${n.key}.label`,{defaultValue:n.label})}),{sentence:u,all:t}},[e])}const _r="0.145.0";function Dr({computeStyle:e,onScroll:u="close",onResize:t="close",ignoreOutsideClickSelector:n}){const[o,r]=a.useState(!1),[l,s]=a.useState({}),i=a.useRef(null),c=a.useRef(null),h=a.useCallback(()=>{i.current&&s(e(i.current.getBoundingClientRect()))},[e]);a.useEffect(()=>{if(!o)return;h();const g=y=>{const m=y.target;n&&m.closest?.(n)||i.current?.contains(m)||c.current?.contains(m)||r(!1)};document.addEventListener("mousedown",g),document.addEventListener("pointerdown",g);const f=y=>{c.current?.contains(y.target)||(u==="reposition"?h():u==="close"&&r(!1))};u!=="ignore"&&window.addEventListener("scroll",f,!0);const w=()=>{t==="reposition"?h():t==="close"&&r(!1)};return t!=="ignore"&&window.addEventListener("resize",w),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("pointerdown",g),u!=="ignore"&&window.removeEventListener("scroll",f,!0),t!=="ignore"&&window.removeEventListener("resize",w)}},[o,h,u,t,n]),a.useEffect(()=>{if(o)return Jt(()=>r(!1))},[o]);const d=a.useCallback(()=>r(g=>!g),[]),C=a.useCallback(()=>r(!1),[]);return{open:o,setOpen:r,toggle:d,close:C,style:l,triggerRef:i,menuRef:c}}function Or(e,{mode:u="playback",autoStart:t=!1,onPlaySpeaker:n,onComplete:o,playMs:r=1100,feedbackMs:l=1500}={}){const[s,i]=a.useState([]),[c,h]=a.useState(0),[d,C]=a.useState("idle"),[g,f]=a.useState(null),[w,y]=a.useState([]),[m,S]=a.useState(null),[E,B]=a.useState(0),M=a.useRef(0),b=a.useCallback(R=>{M.current=typeof R=="function"?R(M.current):R,B(M.current)},[]),D=a.useRef(n),O=a.useRef(o);a.useEffect(()=>{D.current=n,O.current=o},[n,o]);const P=a.useRef([]),_=()=>{P.current.forEach(clearTimeout),P.current=[]},V=(R,$)=>{P.current.push(setTimeout($,R))};a.useEffect(()=>()=>_(),[]);const Y=s[c]?.id??null,L=a.useRef(null),T=a.useCallback(()=>{_(),C("playing"),y([]),S(null),b(0);let R=0;e.forEach(($,U)=>{V(R,()=>{h(U),f($.id),D.current?.($)}),V(R+1e3,()=>{f(null),y(se=>[...se,$.id])}),R+=1300}),V(R,()=>{C("done"),O.current?.({score:0,total:e.length})})},[e,b]),v=a.useCallback((R,$)=>{if($>=R.length){C("done"),O.current?.({score:M.current,total:R.length});return}L.current=null,h($),S(null),C("playing"),f(R[$].id),D.current?.(R[$]),V(r,()=>{f(null),C("waiting")})},[r]),G=a.useCallback(()=>{_();const R=F(e);i(R),b(0),y([]),v(R,0)},[e,v,b]),X=a.useCallback(()=>{u==="playback"?(i(e),T()):G()},[u,e,T,G]),K=a.useCallback(()=>{_(),C("idle"),f(null),y([]),S(null),h(0),b(0),i([])},[b]),he=e.map(R=>R.id).join("|");a.useEffect(()=>(t?X():K(),()=>_()),[u,he,t]);const A=a.useCallback(R=>{d!=="waiting"||u==="playback"||L.current===c||(L.current=c,S(R),R===s[c]?.id&&b($=>$+1),u==="exam"?(C("playing"),V(400,()=>v(s,c+1))):(C("feedback"),V(l,()=>v(s,c+1))))},[d,u,s,c,v,l,b]),I=u==="playback"?e.length:s.length;return{bind:{activeSpeakerId:g,playedIds:w,selectedId:m,answerId:Y,showFeedback:d==="feedback",clickable:d==="waiting",onSelectSpeaker:A},index:c,total:I,score:E,phase:d,done:d==="done",start:X,reset:K}}exports.CACHE_GROUPS=lt,exports.CORE_VERSION=_r,exports.DocumentTitleSuppressContext=Ju,exports.EMPTY_COMPOSITION=Iu,exports.MediaQueryOverrideContext=Uu,exports.NO_CODA=re,exports.SYLLABLE_MIN=le,exports.VAP_PAGE_SIZE_OPTIONS=Qe,exports.buildGradeSection=jt,exports.buildPartOfSpeechSection=Tt,exports.buildPositionSection=xo,exports.buildSelectSection=ko,exports.buildSyllableSection=vo,exports.buildWordTypeSection=It,exports.charToPronValue=Pt,exports.convertComposition=$t,exports.fmtBytes=vn,exports.lsBytes=st,exports.meaningKey=ku,exports.pronToCharValue=Ft,exports.syllableToFilter=Nu,exports.today=Ie,exports.toggleAttributeFilter=Po,exports.useAnchoredMenu=Dr,exports.useCacheManagement=kn,exports.useDailyTrainingSelection=dr,exports.useDelayedHoverAnchor=mr,exports.useDeviceManagement=Un,exports.useDocumentTitle=pn,exports.useEscToClose=fr,exports.useFontScale=Cn,exports.useHoverAnchor=hr,exports.useMediaQuery=mn,exports.usePagedList=pr,exports.usePasswordChange=wn,exports.useRelativeDay=Sn,exports.useSoundCompassExam=Or,exports.useTablePaging=Gn,exports.useTableSort=Yn,exports.useToastState=Sr,exports.useTrainingTypeLabels=Ar,exports.useVisitAllPanel=Hn,exports.useVisitHistory=Fn,exports.useVisitSchedule=Vn,exports.useWindowEvent=qu,exports.useWordAttributeFilterKeys=Nt,exports.useWordDataStats=xn,exports.useWordMeanings=gr,exports.useWordTrainingDataGeneration=nr,exports.useWordTrainingFilter=ur,exports.valueToJamos=ce;
1
+ "use strict";var i=require("react"),Ce=require("react-i18next"),Wu=require("i18next"),pu=typeof document<"u"?document.currentScript:null;function Cn(e){var u=Object.create(null);return e&&Object.keys(e).forEach(function(t){if(t!=="default"){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(u,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}}),u.default=e,Object.freeze(u)}var Ku=Cn(i);function dn({storageKey:e="fontScale",baseFont:u=20,minScale:t=.8,maxScale:n=1.4,step:o=.1,lineHeightRatio:r=1.4}={}){const l=E=>Math.max(t,Math.min(n,Number(E))),s=E=>{try{const w=localStorage.getItem(E),R=w?Number(w):1;return Number.isFinite(R)?l(R):l(1)}catch{return l(1)}},[a,c]=i.useState(()=>s(e)),[h,d]=i.useState(e);h!==e&&(d(e),c(s(e))),i.useEffect(()=>{try{localStorage.setItem(e,String(a))}catch{}},[e,a]);const C=E=>{c(typeof E=="function"?w=>l(E(w)):l(E))},g=()=>C(E=>+(E+o).toFixed(6)),f=()=>C(E=>+(E-o).toFixed(6)),B=a<n-Number.EPSILON,y=a>t+Number.EPSILON,m=Math.round(u*a),S=Math.round(m*r);return{scale:a,setScale:C,increase:g,decrease:f,canIncrease:B,canDecrease:y,fontSize:m,lineHeight:S}}const qu=i.createContext(null);function fn(e){return/max-width:\s*7[0-9][0-9]px/.test(e)}const zu=e=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(e).matches;function gn(e){const u=i.useCallback(t=>{if(typeof window>"u"||!window.matchMedia)return()=>{};const n=window.matchMedia(e);return n.addEventListener?n.addEventListener("change",t):n.addListener&&n.addListener(t),()=>{n.removeEventListener?n.removeEventListener("change",t):n.removeListener&&n.removeListener(t)}},[e]);return Ku.useSyncExternalStore(u,()=>zu(e),()=>!1)}function hn(e){const[u,t]=i.useState(zu(e));return i.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const n=window.matchMedia(e),o=l=>t(l.matches),r=n;return r.addEventListener?r.addEventListener("change",o):r.addListener&&r.addListener(o),t(n.matches),()=>{r.removeEventListener?r.removeEventListener("change",o):r.removeListener&&r.removeListener(o)}},[e]),u}const mn=typeof Ku.useSyncExternalStore=="function"?gn:hn;function pn(e){const u=i.useContext(qu),t=mn(e);return u&&typeof u.mobile=="boolean"&&fn(e)?u.mobile:t}function Ju(e){const u=i.useRef(e);return i.useEffect(()=>{u.current=e}),u}function Qu(e,u){const t=Ju(u);i.useEffect(()=>{const n=()=>t.current();try{window.addEventListener(e,n)}catch{}return()=>{try{window.removeEventListener(e,n)}catch{}}},[e,t])}const Su=" \xB7 ",Xu=(()=>{if(typeof document>"u")return"";const e=document.title;return e.includes(Su)?e.split(Su).pop()??e:e})(),Zu=i.createContext(!1),pe=[];let et=null;function Sn(e){const u=i.useContext(Zu);i.useEffect(()=>{if(u||typeof e!="string"||!e)return;pe.length===0&&(et=document.title);const t={text:Xu?`${e}${Su}${Xu}`:e};return pe.push(t),document.title=t.text,()=>{const n=pe.lastIndexOf(t);n>=0&&pe.splice(n,1),document.title=pe.length?pe[pe.length-1].text:et??document.title}},[e,u])}function yn(){const{t:e}=Ce.useTranslation();return i.useCallback(u=>{if(!u)return"";const t=new Date(u).getTime();if(Number.isNaN(t))return"";const n=Math.floor((Date.now()-t)/864e5);return n<=0?e("myHomework.relativeDay.today","\uC624\uB298"):n===1?e("myHomework.relativeDay.yesterday","\uC5B4\uC81C"):e("myHomework.relativeDay.daysAgo",{n})},[e])}const En=()=>{const e="\uC54C \uC218 \uC5C6\uB294 \uC624\uB958",u=typeof Wu?.t=="function"?Wu.t("common.unknownError",{defaultValue:e}):void 0;return typeof u=="string"&&u?u:e};function Bn(e,u){if(u===void 0&&(u=En()),e instanceof Error)return e.message||u;if(typeof e=="string")return e||u;if(e&&typeof e=="object"){const t=e;for(const n of[t.message,t.error_description,t.error])if(typeof n=="string"&&n)return n}return u}function wn(e){const{t:u}=Ce.useTranslation(),[t,n]=i.useState({current:"",next:"",confirm:""}),[o,r]=i.useState(null),[l,s]=i.useState(!1),a=i.useRef(null),c=i.useRef(!1);i.useEffect(()=>()=>{a.current!==null&&clearTimeout(a.current)},[]);const h=i.useCallback(()=>{n({current:"",next:"",confirm:""}),r(null)},[]),d=i.useCallback(async()=>{if(c.current)return;if(!t.current){r({type:"error",text:u("account.security.password.currentRequired","\uD604\uC7AC \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC138\uC694.")});return}if(!t.next){r({type:"error",text:u("account.security.password.newRequired","\uC0C8 \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC138\uC694.")});return}if(t.next!==t.confirm){r({type:"error",text:u("account.security.password.mismatch","\uC0C8 \uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.")});return}s(!0),c.current=!0;let C;try{C=e?await e(t.current,t.next):null}catch(g){C=Bn(g)}finally{c.current=!1,s(!1)}if(C){r({type:"error",text:C});return}r({type:"success",text:u("account.security.password.changed","\uBE44\uBC00\uBC88\uD638\uAC00 \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4.")}),n({current:"",next:"",confirm:""}),a.current!==null&&clearTimeout(a.current),a.current=setTimeout(()=>r(null),1500)},[t,e,u]);return{pw:t,setPw:n,pwMsg:o,setPwMsg:r,pwLoading:l,handleChangePw:d,reset:h}}const Q=["\u3131","\u3132","\u3134","\u3137","\u3138","\u3139","\u3141","\u3142","\u3143","\u3145","\u3146","\u3147","\u3148","\u3149","\u314A","\u314B","\u314C","\u314D","\u314E"],ne=["\u314F","\u3150","\u3151","\u3152","\u3153","\u3154","\u3155","\u3156","\u3157","\u3158","\u3159","\u315A","\u315B","\u315C","\u315D","\u315E","\u315F","\u3160","\u3161","\u3162","\u3163"],te=["","\u3131","\u3132","\u3133","\u3134","\u3135","\u3136","\u3137","\u3139","\u313A","\u313B","\u313C","\u313D","\u313E","\u313F","\u3140","\u3141","\u3142","\u3144","\u3145","\u3146","\u3147","\u3148","\u314A","\u314B","\u314C","\u314D","\u314E"];function H(e){if(!e)return null;const u=e.charCodeAt(0)-44032;return u<0||u>=11172?null:{cho:Math.floor(u/588),jung:Math.floor(u%588/28),jong:u%28}}function bn(){const e=new Map;return u=>{let t=e.get(u);return t||(t=[...u].map(n=>H(n)),e.set(u,t)),t}}function de(e,u,t=0){return String.fromCharCode(44032+(e*21+u)*28+t)}function An(e,u){if(!e||!u||e===u||e.length!==u.length)return"random";let t=0,n=null;for(let o=0;o<e.length;o++){const r=H(e[o]),l=H(u[o]);if(!r||!l)return"random";if(r.cho===l.cho&&r.jung===l.jung&&r.jong===l.jong)continue;t++;const s=r.cho!==l.cho,a=r.jung!==l.jung,c=r.jong!==l.jong;(s?1:0)+(a?1:0)+(c?1:0)>1?n="multi":s?n="cho":a?n="jung":n="jong"}return t!==1?"random":n==="cho"?"cho":n==="jung"?"jung":n==="jong"?"jong":"random"}const Ne={3:["\u3131","\u3145"],5:["\u3134","\u3148"],6:["\u3134","\u314E"],9:["\u3139","\u3131"],10:["\u3139","\u3141"],11:["\u3139","\u3142"],12:["\u3139","\u3145"],13:["\u3139","\u314C"],14:["\u3139","\u314D"],15:["\u3139","\u314E"],18:["\u3142","\u3145"]};Object.fromEntries(Object.entries(Ne).map(([e,u])=>[u.join(""),te[Number(e)]]));function _n(e,u){if(!e||!u)return!1;for(const t of e){const n=H(t);if(n){if(Q[n.cho]===u)return!0;if(n.jong>0){if(te[n.jong]===u)return!0;const o=Ne[n.jong];if(o&&o.includes(u))return!0}}}return!1}function je(e){if(!e)return 0;let u=0;for(const t of e)H(t)&&u++;return u}function Dn(e){if(!e)return!1;let u=!1;for(const t of e){const n=H(t);if(n&&(u=!0,n.jong>0))return!1}return u}function On(e,u){if(e.jong<=0)return!1;if(u.includes(te[e.jong]))return!0;const t=Ne[e.jong];return!!t&&t.some(n=>u.includes(n))}function Nn(e,u,t){if(!e)return!1;const n=[...e],o=r=>{const l=H(n[r]);if(!l||u.cho&&!u.cho.includes(Q[l.cho])||u.jung&&!u.jung.includes(ne[l.jung]))return!1;if(u.jongNone){if(l.jong>0)return!1}else if(u.jong&&!On(l,u.jong))return!1;return!0};if(t==="head")return o(0);if(t==="tail")return o(n.length-1);if(t==="mid"){for(let r=1;r<n.length-1;r++)if(o(r))return!0;return!1}for(let r=0;r<n.length;r++)if(o(r))return!0;return!1}const jn={cho:Q.length,jung:ne.length,jong:te.length};function Tn(e,u,t,n,o=1/0){if(!e||t<1)return[];const r=[...e].map(d=>H(d));if(r.some(d=>!d))return[];const l=r,s=l.length;if(t>s)return[];const a=jn[u],c=new Set,h=[];(function d(C,g){if(g.length===t){h.push([...g]);return}for(let f=C;f<s;f++)g.push(f),d(f+1,g),g.pop()})(0,[]);for(const d of h)if((function C(g,f){if(c.size>=o)return;if(g===d.length){const m=f.map(S=>de(S.cho,S.jung,S.jong)).join("");m!==e&&n.has(m)&&c.add(m);return}const B=d[g],y=l[B][u];for(let m=0;m<a;m++){if(m===y)continue;const S=f.slice();if(S[B]={...f[B],[u]:m},C(g+1,S),c.size>=o)return}})(0,l),c.size>=o)break;return[...c]}function In(e,u){if(!e||!u||e.length!==u.length)return-1;let t=0;for(let n=0;n<e.length;n++){const o=H(e[n]),r=H(u[n]);if(!o||!r)return-1;o.cho!==r.cho&&t++,o.jung!==r.jung&&t++,o.jong!==r.jong&&t++}return t}const ut="word_pair_index_v2",tt="word_pair_index_sig_v2";let Te=null;function Mn(){try{if(typeof localStorage>"u")return null;const e=localStorage.getItem(ut),u=localStorage.getItem(tt);return!e||!u?null:{index:JSON.parse(e),sig:u}}catch{return null}}function Ie(){if(Te)return Te;const e=Mn();return e?(Te=e.index,e.sig,Te):null}function Rn(){Te=null;try{typeof localStorage<"u"&&(localStorage.removeItem(ut),localStorage.removeItem(tt))}catch{}}const nt="word_image_existence_map_v1";let be=null,Me=0,ot=-1,Re=null,rt=-1,lt=new Set;function st(){if(be)return be;try{const e=typeof localStorage<"u"?localStorage.getItem(nt):null,u=e?JSON.parse(e):null;be=u&&typeof u=="object"&&!Array.isArray(u)?u:{}}catch{be={}}return be}function at(){const e=st();if(ot===Me)return Re?{...Re}:null;const u=Object.values(e);return Re=u.length===0?null:{total:u.length,exists:u.filter(Boolean).length},ot=Me,Re?{...Re}:null}function Ln(){const e=st();if(rt===Me)return lt;const u=new Set;for(const t in e)e[t]===!0&&t.endsWith("_1")&&u.add(t.slice(0,-2));return lt=u,rt=Me,u}function vn(){be={},Me++;try{typeof localStorage<"u"&&localStorage.removeItem(nt)}catch{}}const it=[{id:"wordData",labelKey:"settings.cache.group.wordData.label",subKey:"settings.cache.group.wordData.sub",keys:["word_data_cache","word_data_version"]},{id:"pairIndex",labelKey:"settings.cache.group.pairIndex.label",subKey:"settings.cache.group.pairIndex.sub",keys:["word_pair_index_v2","word_pair_index_sig_v2"]},{id:"imageCache",labelKey:"settings.cache.group.imageCache.label",subKey:"settings.cache.group.imageCache.sub",keys:["word_image_existence_map_v1"]}];function ct(e){return e.reduce((u,t)=>{try{const n=localStorage.getItem(t);return u+(n?new Blob([n]).size:0)}catch{return u}},0)}function xn(e){return e===0?"0 B":e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/(1024*1024)).toFixed(2)} MB`:`${(e/(1024*1024*1024)).toFixed(2)} GB`}function Pn(e){const{t:u}=Ce.useTranslation(),[t,n]=i.useState({}),[o,r]=i.useState(null),[l,s]=i.useState(null),[a,c]=i.useState(null),h=i.useCallback(()=>{const C={};it.forEach(g=>{C[g.id]=ct([...g.keys])}),n(C),typeof navigator<"u"&&navigator.storage?.estimate&&navigator.storage.estimate().then(g=>{c({usage:g.usage??0,quota:g.quota??0})}).catch(()=>{})},[]);i.useEffect(()=>{h()},[h]);const d=i.useCallback(async C=>{r(C);try{C==="wordData"?(localStorage.removeItem("word_data_cache"),localStorage.removeItem("word_data_version")):C==="pairIndex"?Rn():C==="imageCache"&&vn(),h(),e?.(u("settings.cache.cleared","\uCE90\uC2DC\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4."))}finally{r(null)}},[h,e,u]);return{cacheSizes:t,clearingId:o,confirmCacheId:l,setConfirmCacheId:s,storageEstimate:a,refreshCacheSizes:h,handleClearCache:d}}function kn(e){const[u,t]=i.useState(null),[n,o]=i.useState(null),r=i.useCallback(()=>{const l=Ie();if(l){const a=Object.values(l),c=a.filter(h=>h.cho.length+h.jung.length+h.jong.length>0).length;t({matched:c,total:a.length})}else t(null);const s=at();o(s?{exists:s.exists,total:s.total}:null)},[]);return i.useEffect(()=>{r();const l=setTimeout(r,1e3);return()=>clearTimeout(l)},[e?.length,r]),{pairStats:u,imgStats:n,setPairStats:t,setImgStats:o,refreshStats:r}}function Le(e,u){if(e===u)return!0;const t=e?.id,n=u?.id;return t!=null&&t!==""&&t===n}function Ct(e,u=[]){const[t,n]=i.useState(u),[o,r]=i.useState(null),[l,s]=i.useState(!1),[a,c]=i.useState(e),h=i.useRef(!1),d=i.useRef(null);i.useEffect(()=>{if(l)return;if(h.current){h.current=!1;return}const m=d.current;m!==null&&m.length===u.length&&m.every((S,E)=>S===u[E])||(d.current=u,n(u),r(S=>S==null?S:u.find(E=>Le(E,S))??S))},[u,l]),i.useEffect(()=>{!l&&o!=null&&c({...o})},[l,o]);const C=i.useCallback(m=>{r(m),s(!1),c({...m})},[]),g=i.useCallback(()=>s(!0),[]),f=i.useCallback(()=>s(!1),[]),B=i.useCallback((m,S)=>{n(m),r(S),s(E=>(E&&(h.current=!0),!1))},[]),y=i.useCallback(m=>{n(S=>S.filter(E=>!Le(E,m))),r(null)},[]);return{list:t,setList:n,selected:o,setSelected:r,isEditing:l,setIsEditing:s,editForm:a,setEditForm:c,openDetail:C,startEditing:g,cancelEditing:f,commitEdit:B,remove:y}}function Je(){return Qe(new Date)}function Qe(e){if(e==null||e==="")return"";const u=e instanceof Date?e:new Date(e);return isNaN(u.getTime())?"":new Intl.DateTimeFormat("fr-CA",{timeZone:"Asia/Seoul"}).format(u)}const ve=()=>{const[e,u,t]=Je().split("-");return{year:e,month:u,day:t}},Fn={year:"",month:"",day:"",hour:"09",minute:"00",memo:""};function $n(e=[]){const{list:u,setList:t,selected:n,setSelected:o,isEditing:r,setIsEditing:l,editForm:s,setEditForm:a,openDetail:c,commitEdit:h}=Ct(Fn,e),{year:d,month:C,day:g}=ve(),[f,B]=i.useState({year:d,month:C,day:g,hour:"09",minute:"00",memo:""});return{visitHistory:u,visitForm:f,setVisitForm:B,setVisit:y=>m=>B(S=>({...S,[y]:m})),selectedVisit:n,setSelectedVisit:o,isEditingVisit:r,setIsEditingVisit:l,editVisitForm:s,setEditVisitForm:a,openVisitDetail:c,handleVisitSave:y=>{t(w=>[f,...w]);const{year:m,month:S,day:E}=ve();B({year:m,month:S,day:E,hour:"09",minute:"00",memo:""}),y?.()},handleVisitEditSave:()=>{h(y=>y.map(m=>n!=null&&Le(m,n)?s:m),s)},addVisit:y=>{t(m=>[y,...m])},removeVisit:y=>{t(m=>m.filter(S=>S!==y))},revertVisitEdit:(y,m)=>{t(S=>S.map(E=>E===m?y:E)),o(S=>S===m?y:S)}}}const dt=e=>`${e.year.padStart(4,"0")}-${e.month.padStart(2,"0")}-${e.day.padStart(2,"0")} ${e.hour.padStart(2,"0")}:${e.minute.padStart(2,"0")}`,Xe=e=>[...e].sort((u,t)=>{const n=dt(u),o=dt(t);return n<o?-1:n>o?1:0}),Vn={year:"",month:"",day:"",hour:"09",minute:"00",memo:""};function Hn(e,u=[]){const t=i.useMemo(()=>Xe(u),[u]),{list:n,setList:o,selected:r,setSelected:l,isEditing:s,setIsEditing:a,editForm:c,setEditForm:h,openDetail:d,commitEdit:C,remove:g}=Ct(Vn,t),[f,B]=i.useState([]),{year:y,month:m,day:S}=ve(),[E,w]=i.useState({year:y,month:m,day:S,hour:"09",minute:"00",memo:""}),R=T=>v=>w(G=>({...G,[T]:v})),b=T=>{o(K=>Xe([...K,E]));const{year:v,month:G,day:Z}=ve();w({year:v,month:G,day:Z,hour:"09",minute:"00",memo:""}),T?.()},D=()=>{C(T=>Xe(T.map(v=>r!=null&&Le(v,r)?c:v)),c)},O=i.useCallback(T=>{g(T)},[g]),k=i.useCallback(T=>{e({year:T.year,month:T.month,day:T.day,hour:T.hour,minute:T.minute,memo:T.memo,...T.id!=null?{id:T.id}:{}}),g(T)},[e,g]),_=i.useCallback(T=>{o(v=>v.filter(G=>!Le(G,T))),B(v=>[T,...v]),l(null)},[o,l]),V=i.useCallback(T=>{o(v=>Xe([...v,T]))},[o]),Y=i.useCallback(T=>{o(v=>v.filter(G=>G!==T))},[o]),L=i.useCallback((T,v)=>{o(G=>G.map(Z=>Z===v?T:Z)),l(G=>G===v?T:G)},[o,l]);return{scheduleList:n,noShowList:f,addSchedule:V,removeSchedule:Y,revertScheduleEdit:L,scheduleForm:E,setScheduleForm:w,setSchedule:R,selectedSchedule:r,setSelectedSchedule:l,isEditingSchedule:s,setIsEditingSchedule:a,editScheduleForm:c,setEditScheduleForm:h,openScheduleDetail:d,handleScheduleSave:b,handleScheduleEditSave:D,handleScheduleDelete:O,handleScheduleToVisit:k,handleScheduleNoVisit:_}}const Ze=[{value:"10",label:"10\uAC1C\uC529 \uBCF4\uAE30"},{value:"25",label:"25\uAC1C\uC529 \uBCF4\uAE30"},{value:"50",label:"50\uAC1C\uC529 \uBCF4\uAE30"},{value:"100",label:"100\uAC1C\uC529 \uBCF4\uAE30"}];function Gn(e){const{t:u}=Ce.useTranslation(),[t,n]=i.useState(""),[o,r]=i.useState("25"),[l,s]=i.useState("all"),[a,c]=i.useState(1),h=i.useMemo(()=>e.filter(({item:B,status:y})=>!(t&&!B.memo.includes(t)||l!=="all"&&y!==l)),[e,t,l]),d=Math.max(1,Math.ceil(h.length/Number(o))),C=Math.min(a,d),g=i.useMemo(()=>h.slice((C-1)*Number(o),C*Number(o)),[h,C,o]),f=i.useMemo(()=>Ze.map(B=>({...B,label:u("common.pageSizeLabel",{n:B.value,defaultValue:B.label})})),[u]);return{vapSearch:t,setVapSearch:n,vapPageSize:o,setVapPageSize:r,vapPageSizeOptions:f,vapStatus:l,setVapStatus:s,vapPage:C,setVapPage:c,vapFiltered:h,vapTotal:d,vapPageItems:g}}function Yn(e,u,t){const{t:n}=Ce.useTranslation(),[o,r]=i.useState(()=>{const f=t?.initialPageSize;return f&&Ze.some(B=>B.value===f)?f:"25"}),[l,s]=i.useState(1),[a,c]=i.useState(u);Object.is(a,u)||(c(u),l!==1&&s(1));const h=i.useMemo(()=>Ze.map(f=>({...f,label:n("visits.showN",{n:f.value})})),[n]),d=i.useCallback(f=>{r(f),s(1)},[]),C=Math.max(1,Math.ceil(e.length/Number(o)));(l>C||l<1||!Number.isFinite(l))&&s(Math.min(Math.max(1,Number.isFinite(l)?l:1),C));const g=Math.min(Math.max(1,Number.isFinite(l)?l:1),C);return{pageRows:i.useMemo(()=>e.slice((g-1)*Number(o),g*Number(o)),[e,g,o]),pageSizeProps:{options:h,value:o,onChange:d},paginationProps:{page:g,total:C,onChange:s},setPage:s}}function Un(){const[e,u]=i.useState(null),t=i.useCallback(o=>{u(r=>r?.key===o?{key:o,asc:!r.asc}:{key:o,asc:!0})},[]),n=i.useCallback((o,r)=>({label:o,sortDir:e?.key===r?e.asc?"asc":"desc":null,onClick:()=>t(r)}),[e,t]);return{\uC815\uB82C:e,\uCE78:n}}const ft=e=>e==="\uC88C"||e==="\uC6B0"?e:null;function Wn(){const[e,u]=i.useState(!1),[t,n]=i.useState("\uC88C"),[o,r]=i.useState({\uC88C:null,\uC6B0:null}),[l,s]=i.useState({\uC88C:[],\uC6B0:[]}),[a,c]=i.useState(!1),[h,d]=i.useState("\uC88C"),C=i.useCallback(f=>{const B=ft(f.direction);B&&(r(y=>({...y,[B]:f})),s(y=>({...y,[B]:[f,...y[B]]})),u(!1))},[]),g=i.useCallback(f=>{const B=ft(f.direction);B&&(r(y=>({...y,[B]:f})),c(!1))},[]);return{showDevice:e,setShowDevice:u,deviceDirection:t,setDeviceDirection:n,devices:o,setDevices:r,deviceHistory:l,setDeviceHistory:s,showDeviceList:a,setShowDeviceList:c,listForSide:h,setListForSide:d,handleDeviceSubmit:C,handleSelectFromList:g}}const Kn="__ihab_core_word_pool__";function eu(){return globalThis[Kn]??null}function F(e,u=Math.random){const t=e.slice();for(let n=t.length-1;n>0;n--){const o=Math.floor(u()*(n+1));[t[n],t[o]]=[t[o],t[n]]}return t}function se(e,u,t=Math.random){return!Array.isArray(e)||e.length===0||u<=0?[]:u>=e.length?F(e,t):F(e,t).slice(0,u)}const yu={SAME_SOUND_PICK:{difficulty:!0,choseong:!0,group:"discrimination"},SAME_OR_DIFF:{difficulty:!0,choseong:!0,group:"discrimination"},HEAR_AND_PICK_SAME:{difficulty:!0,choseong:!0,group:"discrimination"},HEAR_AND_PICK_INCLUDED:{difficulty:!0,choseong:!0,group:"discrimination"},STARTS_WITH_SAME_SOUND:{difficulty:!1,choseong:!0,group:"discrimination"},LISTEN_AND_REMEMBER_ORDER:{difficulty:!1,choseong:!0,group:"attention"},MERGE_2_SYLLABLES:{difficulty:!1,choseong:!0,group:"synthesis"},MERGE_3_SYLLABLES:{difficulty:!1,choseong:!0,group:"synthesis"},MERGE_2_PHONEMES:{difficulty:!1,choseong:!0,group:"synthesis"},MERGE_3_PHONEMES:{difficulty:!1,choseong:!0,group:"synthesis"},DROP_1_FROM_2SYLL:{difficulty:!1,choseong:!0,group:"deletion"},DROP_1_FROM_3SYLL:{difficulty:!1,choseong:!0,group:"deletion"},DROP_PART_FROM_COMPOUND:{difficulty:!1,choseong:!0,group:"deletion"},DROP_FINAL_CONSONANT_FROM_1SYLL:{difficulty:!1,choseong:!0,group:"deletion"},REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:{difficulty:!1,choseong:!0,group:"deletion"},CHANGE_1_SYLL_IN_2SYLL:{difficulty:!0,choseong:!0,group:"substitution"},CHANGE_1_SYLL_IN_3SYLL:{difficulty:!0,choseong:!0,group:"substitution"},CHANGE_1_PHONEME_IN_1SYLL:{difficulty:!1,choseong:!0,group:"substitution"},CHANGE_1_PHONEME_IN_2SYLL:{difficulty:!0,choseong:!0,group:"substitution"}},qn=Q.indexOf("\u3147"),Eu={DROP_FINAL_CONSONANT_FROM_1SYLL:{syllables:1,syllable:e=>e.jong>0},REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:{syllables:1,syllable:e=>e.jong===0&&e.cho!==qn},MERGE_2_SYLLABLES:{syllables:2,syllable:()=>!0},MERGE_3_SYLLABLES:{syllables:3,syllable:()=>!0},MERGE_2_PHONEMES:{syllables:1,syllable:e=>e.jong===0},MERGE_3_PHONEMES:{syllables:1,syllable:e=>e.jong>0&&!Ne[e.jong]}},zn={\u3131:"\u3131",\u3132:"\u3131",\u314B:"\u3131",\u3133:"\u3131",\u313A:"\u3131",\u3134:"\u3134",\u3135:"\u3134",\u3136:"\u3134",\u3137:"\u3137",\u3145:"\u3137",\u3146:"\u3137",\u3148:"\u3137",\u314A:"\u3137",\u314C:"\u3137",\u314E:"\u3137",\u3139:"\u3139",\u313C:"\u3139",\u313D:"\u3139",\u313E:"\u3139",\u3140:"\u3139",\u3141:"\u3141",\u313B:"\u3141",\u3142:"\u3142",\u314D:"\u3142",\u313F:"\u3142",\u3144:"\u3142",\u3147:"\u3147"},Jn={\u314F:{nucleus:"\u314F"},\u3151:{glide:"j",nucleus:"\u314F"},\u3153:{nucleus:"\u3153"},\u3155:{glide:"j",nucleus:"\u3153"},\u3157:{nucleus:"\u3157"},\u315B:{glide:"j",nucleus:"\u3157"},\u315C:{nucleus:"\u315C"},\u3160:{glide:"j",nucleus:"\u315C"},\u3161:{nucleus:"\u3161"},\u3163:{nucleus:"\u3163"},\u3150:{nucleus:"\u3154/\u3150"},\u3152:{glide:"j",nucleus:"\u3154/\u3150"},\u3154:{nucleus:"\u3154/\u3150"},\u3156:{glide:"j",nucleus:"\u3154/\u3150"},\u3158:{glide:"w",nucleus:"\u314F"},\u3159:{glide:"w",nucleus:"\u3154/\u3150"},\u315A:{glide:"w",nucleus:"\u3154/\u3150"},\u315D:{glide:"w",nucleus:"\u3153"},\u315E:{glide:"w",nucleus:"\u3154/\u3150"},\u315F:{glide:"w",nucleus:"\u3163"},\u3162:{glide:"\u0270",nucleus:"\u3163"}};function Bu(e){return zn[e]??e}const wu={cho:Q,jung:ne,jong:te},q=e=>Array.isArray(e)?e.length>0:!!e;function bu(e,u){if(e.length!==u.length)return!1;for(let t=0;t<e.length;t++){const n=e[t],o=u[t];if(!(!n||!o)&&(n.cho!==o.cho&&Q[n.cho]==="\u3147"!=(Q[o.cho]==="\u3147")||n.jong!==o.jong&&n.jong===0!=(o.jong===0)))return!0}return!1}function Qn(e,u,t){const n=t.pronOf(e),o=t.decompOf,r=t.sameStructureOnly&&o?o(n):null,l=[];for(const s of u)s!==e&&(t.okSet&&!t.okSet.has(s)||t.pronOf(s)!==n&&(r&&o&&bu(r,o(t.pronOf(s)))||l.push(s)));return l}function gt(e,u,t){const n=u?.[e];if(!n)return[];const o=t.kind?n[t.kind]??[]:[...n.cho??[],...n.jung??[],...n.jong??[]];return Qn(e,o,t)}function Xn(e,u,t,n,o,r,l){const s=["cho","jung","jong"].filter(C=>q(e[C])),a={};for(const C of s){const g=e[C];a[C]=new Set(Array.isArray(g)?g:[g])}const c=o==="pron",h=new Map;for(const C of u){const g=t(r(C));if(g.some(m=>!m))continue;let f=g;if(!c&&(f=t(C),f.length!==g.length||f.some(m=>!m)))continue;const B=g.length,y=h.get(B);y?y.push({w:C,dPron:g,dPos:f}):h.set(B,[{w:C,dPron:g,dPos:f}])}const d=new Map;for(const[C,g]of h){const f=new Map,B=(y,m)=>{const S=y.dPos[m];return S!=null&&s.every(E=>a[E].has(wu[E][S[E]]))};for(const y of g){let m;if(l==="head")m=B(y,0)?0:-1;else if(l==="tail")m=B(y,C-1)?C-1:-1;else if(l==="mid"){m=-1;for(let E=1;E<C-1;E++)if(B(y,E)){m=E;break}}else m=y.dPos.findIndex(E=>E!=null&&s.every(w=>a[w].has(wu[w][E[w]])));if(m<0)continue;const S=f.get(m);S?S.push(y):f.set(m,[y])}for(const[y,m]of f){const S=s.includes("cho"),E=s.includes("jung"),w=s.includes("jong"),R=D=>{let O="";for(let k=0;k<C;k++){const _=D[k];k===y?O+=(S?"*":_.cho)+"."+(E?"*":_.jung)+"."+(w?"*":_.jong)+".":O+=_.cho+"."+_.jung+"."+_.jong+"."}return O},b=new Map;for(const D of g){const O=R(D.dPron),k=b.get(O);k?k.push(D):b.set(O,[D])}for(const D of m){const O=b.get(R(D.dPron))??[],k=[];for(const _ of O){if(_.w===D.w)continue;let V=!0;for(const Y of s){const L=D.dPron[y][Y],T=_.dPron[y][Y];if(T===L){V=!1;break}if(c&&a[Y].has(wu[Y][T])){V=!1;break}}V&&(n&&bu(D.dPron,_.dPron)||k.push(_.w))}d.set(D.w,k)}}}return d}const Zn=e=>e==null?[]:Array.isArray(e)?e:[e];function eo(e){if([...e].length!==1)return"";const u=H(e);if(!u)return"";const t=Bu(te[u.jong]),n=t===""?0:te.indexOf(t);return de(u.cho,u.jung,n<0?0:n)}function ht(e,u){return u.get(e)||eo(e)||e}function Au(e){return e?q(e.cho)?"cho":q(e.jung)?"jung":q(e.jong)?"jong":null:null}function Ae(e,u){const t=(o,r)=>!q(o)||Zn(o).includes(r),n=u.jongNone?e.jong===0:t(u.jong,te[e.jong]);return t(u.cho,Q[e.cho])&&t(u.jung,ne[e.jung])&&n}function xe(e,u,t){const n=[...e];if(t!=="pron")return n.map(r=>H(r));const o=[...u.get(e)||e];return o.length!==n.length?n.map(r=>H(r)):o.map(r=>H(r))}function Pe(e,u,t,n,o){const r=u==="cho"?Q:u==="jung"?ne:te,l=e[u],s=[],a=d=>u==="jung"?to(ht(d,o)):ht(d,o),c=new Map([[a(t),-1]]),h=F(r.map((d,C)=>C).filter(d=>d!==l&&(u!=="cho"||r[d]!=="\u3147")&&(u!=="jong"||d!==0)));for(const d of h){if(s.length>=n)break;const C=u==="cho"?de(d,e.jung,e.jong):u==="jung"?de(e.cho,d,e.jong):de(e.cho,e.jung,d),g=a(C),f=c.get(g);if(f!==void 0){u==="jung"&&f>=0&&o.has(C)&&!o.has(s[f])&&(s[f]=C);continue}c.set(g,s.length),s.push(C)}return s}const uo={\u3154:"\u3150",\u3156:"\u3152",\u315A:"\u3159",\u315E:"\u3159"};function to(e){if([...e].length!==1)return e;const u=H(e);if(!u)return e;const t=uo[ne[u.jung]];return t?de(u.cho,ne.indexOf(t),u.jong):e}function no(e,u,t,n,o,r=null){const l=[...e];if(l.length!==2)return null;const s=l.map(d=>H(d));if(s.some(d=>!d))return null;const a=xe(e,t,n);if(a.some(d=>!d))return null;const c=Au(u);let h=c&&u?a.map((d,C)=>Ae(d,u)?C:-1).filter(d=>d>=0):[0,1];if(r!=null&&(h=h.filter(d=>d!==r)),!h.length)return null;for(const d of F(h)){const C=l[d];if(!o.has(C))continue;const g=Pe(s[d],c??"cho",C,40,t),f=[];for(const B of g)if(B!==C&&o.has(B)&&!f.includes(B)&&f.push(B),f.length>=2)break;if(!(f.length<2))return{question:e,distractors:[C,...f]}}return null}function oo(e,u,t,n,o,r=null){const l=[...e];if(l.length!==3)return null;const s=l.map(d=>H(d));if(s.some(d=>!d))return null;const a=xe(e,t,n);if(a.some(d=>!d))return null;const c=Au(u),h=c&&u?a.map((d,C)=>Ae(d,u)?C:-1).filter(d=>d>=0):[0,1,2];if(!h.length)return null;for(const d of F(h))for(const C of F([0,1,2].filter(g=>g!==d&&(r==null||g===r)))){const g=[0,1,2].filter(S=>S!==C),f=g.map(S=>l[S]).join("");if(!o.has(f))continue;const B=g.indexOf(d),y=Pe(s[d],c??"cho",l[d],40,t),m=[];for(const S of y){const E=g.map(R=>l[R]);E[B]=S;const w=E.join("");if(w!==f&&o.has(w)&&!m.includes(w)&&m.push(w),m.length>=2)break}if(!(m.length<2))return{question:e,distractors:[f,...m]}}return null}function ro(e,u,t,n,o,r=null){const l=[...e],s=l.length;if(s<2)return null;const a=[];for(let h=1;h<=s-1;h++)a.push({remain:l.slice(0,h).join(""),dropped:l.slice(h).join(""),droppedEnd:1}),a.push({remain:l.slice(s-h).join(""),dropped:l.slice(0,s-h).join(""),droppedEnd:0});const c=Au(u);for(const{remain:h,dropped:d,droppedEnd:C}of F(a)){if(r!=null&&C!==r||h===e||!o.has(h)||!o.has(d))continue;const g=[...h],f=g.map(m=>H(m));if(f.some(m=>!m))continue;const B=xe(h,t,n);if(B.some(m=>!m))continue;const y=c&&u?B.map((m,S)=>Ae(m,u)?S:-1).filter(m=>m>=0):g.map((m,S)=>S);if(y.length)for(const m of F(y)){const S=Pe(f[m],c??"cho",g[m],40,t),E=[];for(const w of S){const R=[...g];R[m]=w;const b=R.join("");if(b!==h&&o.has(b)&&!E.includes(b)&&E.push(b),E.length>=2)break}if(E.length>=2)return{question:e,distractors:[h,...E],dropped:d}}}return null}function lo(e,u,t,n,o,r=null){if([...e].length!==1)return null;const l=H(t.get(e)||e);if(!l||l.jong===0)return null;const s=de(l.cho,l.jung,0),a=Pe({cho:l.cho,jung:l.jung,jong:0},"cho",s,2,t);return a.length<2?null:{question:e,distractors:[s,...a]}}const _u=Q.indexOf("\u3147");function so(e,u,t,n,o,r=null){if([...e].length!==1)return null;const l=H(t.get(e)||e);if(!l||l.jong!==0||l.cho===_u)return null;const s=de(_u,l.jung,0),a=Pe({cho:_u,jung:l.jung,jong:0},"jung",s,2,t);return a.length<2?null:{question:e,distractors:[s,...a]}}function ao(e){const u=new Map;for(const t of e){const n=[...t],o=n.length;if(!(o<2||o>3))for(let r=0;r<o;r++){let l=o+"|"+r+"|";for(let a=0;a<o;a++)l+=a===r?"*":n[a];const s=u.get(l);s?s.push(t):u.set(l,[t])}}return u}function io(e,u,t,n,o,r=null,l=null,s=2){const a=[...e],c=a.length;if(c<2||c>3)return null;const h=a.map(S=>H(S));if(h.some(S=>!S))return null;const d=xe(e,t,n);if(d.some(S=>!S))return null;const C=S=>t.get(S)??S,g=C(e),f=!!u&&(q(u.cho)||q(u.jung)||q(u.jong)),B=!!l&&(q(l.cho)||q(l.jung)||q(l.jong)),y=S=>{let E=c+"|"+S+"|";for(let w=0;w<c;w++)E+=w===S?"*":a[w];return E};let m;if(r!=null){if(r>=c||f&&!Ae(d[r],u))return null;m=[r]}else f?m=d.map((S,E)=>Ae(S,u)?E:-1).filter(S=>S>=0):m=Array.from({length:c},(S,E)=>E);for(const S of F(m)){const E=o.get(y(S))??[],w=[],R=[];for(const _ of E){if(_===e)continue;const V=[..._].map(v=>H(v)),Y=h[S],L=V[S];if(!Y||!L)continue;let T=0;if(Y.cho!==L.cho&&T++,Y.jung!==L.jung&&T++,Y.jong!==L.jong&&T++,!(T<s||C(_)===g))if(B){const v=xe(_,t,n)[S];v&&Ae(v,l)?w.push(_):R.push(_)}else w.push(_)}if(!w.length)continue;const b=F(w)[0],D=[],O=new Set([g,C(b)]),k=B?R:w.filter(_=>_!==b);for(const _ of F(k)){const V=C(_);if(!O.has(V)&&(O.add(V),D.push(_),D.length>=2))break}if(!B&&D.length<2)for(const _ of F(E)){if(_===e||_===b)continue;const V=C(_);if(!O.has(V)&&(O.add(V),D.push(_),D.length>=2))break}if(!(D.length<2))return{question:e,distractors:[b,...D]}}return null}let uu=null,mt=null,pt=null;function co(){const e=eu();if(e&&e.entries.length>0){const u=Ie();if(uu&&mt===e&&pt===u)return uu;const t=new Set,n=[];for(const o of e.entries)!o.word||t.has(o.word)||(t.add(o.word),n.push({w:o.word,s:o.syllables,p:u?.[o.word]?[...u[o.word].cho??[],...u[o.word].jung??[],...u[o.word].jong??[]]:[],pron:o.pronunciation||o.word,grade:o.grade}));return uu=n,mt=e,pt=u,uu}return[]}const ae=new Proxy([],{get(e,u){const t=co(),n=t[u];return typeof n=="function"?n.bind(t):n}});function Du(e){return e.length?e[Math.floor(Math.random()*e.length)]:void 0}function oe(e,u){if(u>=e.length)return F(e);if(u===0)return[];const t=e.slice();for(let n=0;n<u;n++){const o=n+Math.floor(Math.random()*(t.length-n)),r=t[n];t[n]=t[o],t[o]=r}return t.slice(0,u)}let Ou=null,St=null;function fe(){const e=eu();if(Ou&&St===e)return Ou;const u=new Map;for(const t of ae)t.w&&u.set(t.w,t.pron);return Ou=u,St=e,u}function z(e){return fe().get(e)||e}function tu(e,u,t=new Set){const n=[];for(const o of F(e)){if(n.length>=u)break;const r=z(o);t.has(r)||(t.add(r),n.push(o))}return n}let Co=0;function X(e){return`${e}-rt-${++Co}`}function _e(e){const u=at();if(!u||u.total===0){const o=new Set;for(const r of e)o.add(r);return o}const t=Ln(),n=new Set;for(const o of e)t.has(o)&&n.add(o);return n}const nu=new Map;let yt=null,Et=null;function ke(e){return e==null?"":Array.isArray(e)?e.slice().sort().join(","):e}function Bt(e){const u=ke(e.choseong),t=e.composition,n=t?.syllable==null?"":Array.isArray(t.syllable)?t.syllable.slice().sort().join(","):String(t.syllable),o=t?`${ke(t.cho)}/${ke(t.jung)}/${ke(t.jong)}/${t.jongNone?"N":""}/${n}`:"",r=ke(e.grade);return`${e.difficulty??""}|${u}|${o}|${e.excludeNoImage?"1":"0"}|${e.count??""}|x${e.contrastCount??1}|${e.fullCount?"F":""}|s${e.sameStructureOnly===!1?"0":"1"}|v${e.phonemeView==="pron"?"p":"c"}|g${r}|t${e.targetSyllable??""}|c${e.choicesPerItem??""}`}async function ue(e){const u=eu(),t=Ie();(u!==yt||t!==Et)&&(nu.clear(),yt=u,Et=t);const n=Bt(e);return nu.has(n)||nu.set(n,fo(e)),nu.get(n)}function wt(e){if(!e)return null;const u=l=>l==null?null:Array.isArray(l)?l.length?l:null:[l],t=u(e.cho),n=u(e.jung),o=!!e.jongNone,r=o?null:u(e.jong);return t||n||r||o?o&&!t&&!n&&!r?l=>Dn(l):l=>Nn(l,{cho:t,jung:n,jong:r,jongNone:o}):null}function bt(e){const u=e.grade&&e.grade.length>0?new Set(e.grade):null,t=e.composition??null,n=t?.syllable!=null?new Set(Array.isArray(t.syllable)?t.syllable:[t.syllable]):null,o=t?[wt(t),n?l=>n.has(je(l)):null].filter(l=>l!=null):[];if(!u&&o.length===0)return null;const r=e.phonemeView==="pron";return l=>{if(u&&(!l.grade||!u.has(l.grade)))return!1;if(o.length===0)return!0;const s=r?z(l.w):l.w;return o.every(a=>a(s))}}async function fo(e){const{difficulty:u=null,choseong:t=null,composition:n=null,targetSyllable:o=null,excludeNoImage:r=!1}=e,l=e.grade&&e.grade.length>0?new Set(e.grade):null,s=e.sameStructureOnly??!0,a=e.phonemeView==="pron"?"pron":"char",c=Math.max(1,e.contrastCount??1),h=u==="cho"||u==="jung"||u==="jong",d=h&&c>=2,C=u==="count",g=t?new Set(Array.isArray(t)?t:[t]):null,f=n?.syllable!=null?new Set(Array.isArray(n.syllable)?n.syllable:[n.syllable]):null,B=n?[wt(n),f?A=>f.has(je(A)):null].filter(A=>A!=null):[],y=u==="random"||u===null,m=y||C,S=y||d||C;let E=ae.filter(A=>!A.w||l&&(!A.grade||!l.has(A.grade))?!1:S?!0:Array.isArray(A.p)&&A.p.length>0);g&&(E=E.filter(A=>{for(const I of g)if(_n(A.w,I))return!0;return!1})),B.length>0&&(E=E.filter(A=>{const I=a==="pron"?z(A.w):A.w;return B.every(M=>M(I))})),o&&(E=E.filter(A=>A.w[0]===o));let w;if(r){const A=new Set;for(const I of E)if(A.add(I.w),Array.isArray(I.p))for(const M of I.p)A.add(M);if(m)for(const I of ae)I.w&&A.add(I.w);w=_e(A)}else{const A=new Set;for(const I of E)if(A.add(I.w),Array.isArray(I.p))for(const M of I.p)A.add(M);if(m)for(const I of ae)I.w&&A.add(I.w);w=A}let R=null;if(d){const A=new Set;for(const I of ae)I.w&&A.add(I.w);R=r?_e(A):A}const b=E.filter(A=>w.has(A.w)),D=600,O=Array.from(w),k=O.length>D?oe(O,D):O,_=C&&n!=null&&(q(n.cho)||q(n.jung)||q(n.jong)),V=2500,Y=new Map;if(C&&!_&&c>=2){for(const A of O){const I=je(A),M=Y.get(I);M?M.push(A):Y.set(I,[A])}for(const[A,I]of Y)I.length>V&&Y.set(A,oe(I,V))}const L=bn(),T=_?Xn(n,O,L,s,a,z):null,v=500,G=1500,Z=e.fullCount?b:u==="random"?b.length>v?oe(b,v):b:b.length>G?oe(b,G):b,K=Ie(),he=[];for(const A of Z){let I;const M=z(A.w);if(d)I=Tn(A.w,u,c,R,24).filter($=>z($)!==M);else if(C)_?I=(T.get(A.w)??[]).filter($=>z($)!==M):c<=1?I=gt(A.w,K,{okSet:w,pronOf:z,decompOf:L,sameStructureOnly:!1}):I=(Y.get(je(A.w))??[]).filter($=>{if($===A.w||z($)===M)return!1;const U=In(M,z($));return c>=5?U>=5:U===c});else if(y){const $=U=>U!==A.w&&U.length===A.w.length&&z(U)!==M;if(e.fullCount){const U=Math.max(1,(e.choicesPerItem??3)-1),ee=[],me=new Set;for(const Oe of k){if(!$(Oe))continue;const ye=z(Oe);if(!me.has(ye)&&(me.add(ye),ee.push(Oe),ee.length>=U))break}I=ee}else I=k.filter($)}else{const $=u;I=gt(A.w,K,{kind:$,okSet:w,pronOf:z,decompOf:L,sameStructureOnly:!1}),I.length===0&&(I=(k.length>30?oe(k,30):k).filter(U=>U!==A.w&&An(A.w,U)===u&&z(U)!==M))}if(s&&I.length>0&&(h||C&&!_)){const $=L(z(A.w));I=I.filter(U=>!bu($,L(z(U))))}I.length!==0&&he.push({word:A,usable:I})}return he}async function At(e,u){const{choicesPerItem:t=3,count:n=10}=u,o=t-1,r=(await ue(u)).filter(s=>s.usable.length>=o),l=[];for(const s of F(r)){if(l.length>=n)break;const a=tu(s.usable,o);if(a.length<o)continue;const c=F([s.word.w,...a]);l.push({id:X(e+"-item"),index:l.length+1,word:s.word.w,syllables:s.word.s,choices:c,answerIndex:c.indexOf(s.word.w)})}return l}async function go(e){const{choicesPerItem:u=3,count:t=10}=e,n=u-1,o=await ue({...e,difficulty:null});if(o.length<u)return[];const r=[],l=F([...o]);for(const s of l){if(r.length>=t)break;const a=s.word.w,c=[...s.word.pron||a],h=Du(c);if(!h)continue;const d=o.filter(f=>f.word.w!==a&&f.word.s===s.word.s&&!(f.word.pron||f.word.w).includes(h)&&f.word.pron!==s.word.pron);if(d.length<n)continue;const C=tu(d.map(f=>f.word.w),n);if(C.length<n)continue;const g=F([a,...C]);r.push({id:X("HPI-item"),index:r.length+1,targetSyllable:h,word:a,choices:g,answerIndex:g.indexOf(a)})}return r}async function ho(e){const{count:u=10}=e,t=(await ue(e)).filter(r=>r.usable.length>=1);if(!t.length)return[];const n=t.length>=u?oe(t,u):F(Array.from({length:u},(r,l)=>t[l%t.length])),o=F(Array.from({length:u},(r,l)=>l<Math.ceil(u/2)));return n.map((r,l)=>{const s=o[l];let a;if(s)a=[r.word.w,r.word.w];else{const c=Du(r.usable);a=Math.random()<.5?[r.word.w,c]:[c,r.word.w]}return{id:X("SOD-item"),index:l+1,word:r.word.w,pair:a,same:s}})}async function mo(e){const{choicesPerItem:u=3,count:t=10}=e,n=u-1,o=await ue({...e,difficulty:null});if(o.length<u+1)return[];const r=o.map(C=>C.word.w),l=new Map(o.map(C=>[C.word.w,C.word.pron])),s=C=>(l.get(C)||C)[0]??"",a={};for(const C of o){const g=s(C.word.w);g&&(a[g]||(a[g]=[]),a[g].push(C.word.w))}const c=Object.entries(a).filter(([,C])=>C.length>=2).map(([C])=>C);if(c.length===0)return[];const h=[],d=F([...c]);for(let C=0;h.length<t&&C<t*4;C++){const g=d[C%d.length],f=a[g];if(f.length<2)continue;const B=F([...f]),y=B[0],m=B[1];if(!y||!m||y===m||(l.get(y)||y)===(l.get(m)||m))continue;const S=l.get(m)||m,E=r.filter(b=>s(b)!==g&&b!==y&&b!==m&&b.length===m.length&&(l.get(b)||b)!==S);if(E.length<n)continue;const w=tu(E,n);if(w.length<n)continue;const R=F([m,...w]);h.push({id:X("SWS-item"),index:h.length+1,sourceWord:y,targetSyllable:g,word:m,choices:R,answerIndex:R.indexOf(m)})}return h}function _t(e,u,t){const n=fe(),o=a=>n.get(a)||a,r=(a,c)=>{const h=[...a],d=[...c];if(h.length!==d.length)return-1;let C=-1;for(let g=0;g<h.length;g++)if(h[g]!==d[g]){if(C>=0)return-1;C=g}return C},l=e.map(a=>({e:a,swaps:a.usable.filter(c=>!!c&&r(a.word.w,c)>=0&&o(c)!==o(a.word.w))})).filter(a=>a.swaps.length>0),s=[];for(const{e:a,swaps:c}of F(l)){if(s.length>=u)break;const h=Du(c)??"",d=[...a.word.w],C=[...h],g=r(a.word.w,h),f=tu(a.usable.filter(B=>B&&B!==h),2,new Set([o(h),o(a.word.w)]));f.length<2||s.push({id:X(t),index:s.length+1,word:a.word.w,original:a.word.w,changed:h,changedFrom:g>=0?d[g]:"",changedTo:g>=0?C[g]:"",distractors:f})}return s}async function Dt(e,u,t){const{count:n=10}=u,o=fe(),r=ae.filter(f=>f.w&&f.s===e),l=u.excludeNoImage?_e(r.map(f=>f.w)):null,s=l?r.filter(f=>l.has(f.w)):r,a=new Set(s.map(f=>f.w)),c=ao(a),h=u.phonemeView??"char",d=u.composition??null,C=bt(u),g=[];for(const f of F(s)){if(g.length>=n)break;if(C&&!C(f))continue;const B=io(f.w,d,o,h,c,null,null);if(!B)continue;const y=B.distractors[0],m=[...f.w],S=[...y],E=m.findIndex((w,R)=>w!==S[R]);g.push({id:X(t),index:g.length+1,word:f.w,original:f.w,changed:y,changedFrom:E>=0?m[E]:"",changedTo:E>=0?S[E]:"",distractors:B.distractors.slice(1)})}return g}async function po(e){return Dt(2,e,"CS2-item")}async function So(e){return Dt(3,e,"CS3-item")}async function yo(e){const u=(await ue({...e,difficulty:"count",contrastCount:1})).filter(t=>t.word.s===1&&t.usable.length>=1);return _t(u,e.count??10,"CP1-item")}async function Eo(e){const u=e.difficulty&&e.difficulty!=="random"?e.difficulty:"count",t=(await ue({...e,difficulty:u,contrastCount:1})).filter(n=>n.word.s===2&&n.usable.length>=1);return _t(t,e.count??10,"CP2-item")}async function Bo(e){const{count:u=10}=e,t=(await ue({...e})).filter(n=>n.word.s===2);return oe(t,u).map((n,o)=>({id:X("M2S-item"),index:o+1,word:n.word.w,answer:n.word.w,parts:[...n.word.w]}))}async function wo(e){const{count:u=10}=e,t=(await ue({...e})).filter(n=>n.word.s===3);return oe(t,u).map((n,o)=>({id:X("M3S-item"),index:o+1,word:n.word.w,answer:n.word.w,parts:[...n.word.w]}))}function Nu(e){const u=ae.map(t=>t.w);return e.excludeNoImage?_e(u):new Set(u)}async function bo(e){const{count:u=10}=e,t=(await ue({...e})).filter(s=>s.word.s===2),n=fe(),o=Nu(e),r=e.phonemeView??"char",l=[];for(const s of F(t)){if(l.length>=u)break;const a=no(s.word.w,e.composition??null,n,r,o);if(!a)continue;const[c,...h]=a.distractors,d=[...s.word.w],C=d[0]===c?d[1]:d[0];l.push({id:X("D2-item"),index:l.length+1,original:s.word.w,word:s.word.w,dropped:C,missingResult:c,distractors:h})}return l}async function Ao(e){const{count:u=10}=e,t=(await ue({...e})).filter(s=>s.word.s===3),n=fe(),o=Nu(e),r=e.phonemeView??"char",l=[];for(const s of F(t)){if(l.length>=u)break;const a=oo(s.word.w,e.composition??null,n,r,o);if(!a)continue;const[c,...h]=a.distractors,d=[...s.word.w];let C="";for(let g=0;g<d.length;g++)if(d.filter((f,B)=>B!==g).join("")===c){C=d[g];break}l.push({id:X("D3-item"),index:l.length+1,original:s.word.w,word:s.word.w,dropped:C,missingResult:c,distractors:h})}return l}async function _o(e){const{count:u=10}=e,t=(await ue({...e})).filter(s=>s.word.s>=2),n=fe(),o=Nu(e),r=e.phonemeView??"char",l=[];for(const s of F(t)){if(l.length>=u)break;const a=ro(s.word.w,e.composition??null,n,r,o);if(!a)continue;const[c,...h]=a.distractors,d=s.word.w,C=a.dropped??(d.startsWith(c)?d.slice(c.length):d.endsWith(c)?d.slice(0,d.length-c.length):"");l.push({id:X("DPC-item"),index:l.length+1,original:d,word:d,dropped:C,missingResult:c,distractors:h})}return l}async function Do(e){const{count:u=10}=e,t=(await ue({...e})).map(n=>n.word.w);return t.length<3?[]:Array.from({length:u},(n,o)=>{const r=oe(t,3);return{id:X("LRO-item"),index:o+1,sequence:r,choices:F(r)}})}function ou(e,u,t){const n=ae.filter(s=>s.w&&s.s===e),o=u.excludeNoImage?_e(n.map(s=>s.w)):null,r=bt(u),l=[];for(const s of n)if(!(o&&!o.has(s.w))&&!(r&&!r(s))){if(t){const a=H(s.w);if(!a||!t(a))continue}l.push(s)}return l}function Oo(e){const u=ou(1,e,t=>t.jong===0);return oe(u,e.count??10).map((t,n)=>{const o=H(t.w);return{id:X("M2P-item"),index:n+1,parts:[Q[o.cho],ne[o.jung]],answer:t.w,word:t.w}})}function No(e){const u=ou(1,e,Eu.MERGE_3_PHONEMES.syllable);return oe(u,e.count??10).map((t,n)=>{const o=H(t.w);return{id:X("M3P-item"),index:n+1,parts:[Q[o.cho],ne[o.jung],te[o.jong]],answer:t.w,word:t.w}})}function jo(e){const u=Eu.DROP_FINAL_CONSONANT_FROM_1SYLL,t=ou(u.syllables,e,u.syllable),n=fe(),o=[];for(const r of F(t)){if(o.length>=(e.count??10))break;const l=lo(r.w,null,n);if(!l)continue;const[s,...a]=l.distractors;o.push({id:X("DFC-item"),index:o.length+1,original:r.w,word:r.w,result:s,distractors:a})}return o}function To(e){const u=Eu.REMOVE_CONSONANT_AND_IDENTIFY_PHONEME,t=ou(u.syllables,e,u.syllable),n=fe(),o=[];for(const r of F(t)){if(o.length>=(e.count??10))break;const l=so(r.w,null,n);if(!l)continue;const s=H(n.get(r.w)||r.w);if(!s)continue;const[a,...c]=l.distractors;o.push({id:X("RCP-item"),index:o.length+1,base:r.w,word:r.w,missingConsonant:Q[s.cho],remaining:a,distractors:c})}return o}const ru=new Map;let Ot=null,Nt=null;async function jt(e,u={}){const t=eu(),n=Ie();(t!==Ot||n!==Nt)&&(ru.clear(),Ot=t,Nt=n);const o=`${e}:${Bt(u)}`;if(ru.has(o))return ru.get(o);const r=await Mo(e,u);return ru.set(o,r),r}const Io={SAME_SOUND_PICK:e=>At("SSP",e),HEAR_AND_PICK_SAME:e=>At("HPS",e),HEAR_AND_PICK_INCLUDED:e=>go(e),SAME_OR_DIFF:e=>ho(e),STARTS_WITH_SAME_SOUND:e=>mo(e),LISTEN_AND_REMEMBER_ORDER:e=>Do(e),MERGE_2_SYLLABLES:e=>Bo(e),MERGE_3_SYLLABLES:e=>wo(e),MERGE_2_PHONEMES:e=>Oo(e),MERGE_3_PHONEMES:e=>No(e),DROP_1_FROM_2SYLL:e=>bo(e),DROP_1_FROM_3SYLL:e=>Ao(e),DROP_PART_FROM_COMPOUND:e=>_o(e),DROP_FINAL_CONSONANT_FROM_1SYLL:e=>jo(e),REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:e=>To(e),CHANGE_1_SYLL_IN_2SYLL:e=>po(e),CHANGE_1_SYLL_IN_3SYLL:e=>So(e),CHANGE_1_PHONEME_IN_1SYLL:e=>yo(e),CHANGE_1_PHONEME_IN_2SYLL:e=>Eo(e)};async function Mo(e,u={}){const t=Io[e];return t?await t(u):[]}async function Ro(e){const u=["random","count"],t=Object.keys(yu);let n=0;for(const o of u)for(const r of t){const l=yu[r];jt(r,{difficulty:l.difficulty?o:null,contrastCount:1,composition:null,count:5,excludeNoImage:e,sameStructureOnly:!0,phonemeView:"char",grade:null}).catch(()=>{}),++n%6===0&&await new Promise(s=>setTimeout(s,0))}}async function Lo(e){const u=await ue({...e,fullCount:!0}),t=Math.max(1,(e.choicesPerItem??3)-1);return u.filter(n=>new Set(n.usable.map(o=>z(o))).size>=t).length}async function vo(e={}){const u=[];for(const s of ae)s.w&&u.push(s.w);const t=e.excludeNoImage?_e(u):u,n=new Set,o=new Set,r=new Set,l=new Set;for(const s of t){l.add(je(s));for(const a of s){const c=H(a);if(c&&(Q[c.cho]!=="\u3147"&&n.add(Q[c.cho]),o.add(ne[c.jung]),c.jong>0)){r.add(te[c.jong]);const h=Ne[c.jong];h&&h.forEach(d=>r.add(d))}}}return{cho:n,jung:o,jong:r,syllable:l}}const Se="\uC804\uCCB4";function Tt(){const{t:e}=Ce.useTranslation();return i.useMemo(()=>({difficulty:e("wordSearch.filter.difficulty","\uB4F1\uAE09"),syllables:e("wordSearch.filter.syllables","\uC74C\uC808 \uC218"),syllable5plus:e("wordSearch.filter.syllable5plus","5\uC74C\uC808 \uC774\uC0C1"),partOfSpeech:e("wordSearch.filter.partOfSpeech","\uD488\uC0AC"),wordType:e("wordSearch.filter.wordType","\uC720\uD615"),posMap:{[e("wordSearch.filter.pos.noun","\uCCB4\uC5B8(\uBA85\uC0AC, \uC218\uC0AC)")]:["\uBA85","\uC218"],[e("wordSearch.filter.pos.verb","\uC6A9\uC5B8(\uB3D9\uC0AC, \uD615\uC6A9\uC0AC)")]:["\uB3D9","\uD615"],[e("wordSearch.filter.pos.modifier","\uC218\uC2DD\uC5B8(\uBD80\uC0AC, \uAD00\uD615\uC0AC)")]:["\uBD80","\uAD00"]},typeMap:{[e("wordSearch.filter.type.native","\uACE0\uC720\uC5B4")]:"\uACE0\uC720",[e("wordSearch.filter.type.sino","\uD55C\uC790\uC5B4")]:"\uD55C\uC790",[e("wordSearch.filter.type.foreign","\uC678\uB798\uC5B4")]:"\uC678\uB798",[e("wordSearch.filter.type.mixed","\uD63C\uC885\uC5B4")]:"\uD63C\uC885"}}),[e])}function It(e,u,t){return{label:u.difficulty,items:[1,2,3,4].map(n=>e("wordSearch.filter.grade",{n})),multiple:!0,allOption:!0,allLabel:t?.allLabel,labelAction:t?.labelAction,labelInfo:t?.labelInfo}}function Mt(e){return{label:e.partOfSpeech,items:Object.keys(e.posMap),multiple:!0,allOption:!0}}function Rt(e){return{label:e.wordType,items:Object.keys(e.typeMap),multiple:!0,allOption:!0}}function xo(e,u){return{label:u.syllables,items:[e("wordSearch.filter.syllable",{n:1}),e("wordSearch.filter.syllable",{n:2}),e("wordSearch.filter.syllable",{n:3}),e("wordSearch.filter.syllable",{n:4}),u.syllable5plus],multiple:!0,allOption:!0}}function Po(e,u){const t=[e("wordPairs.filter.onlyHasImage","\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC")];return u?.includeStructure&&t.push(e("wordPairs.filter.onlySameStructure","\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC")),{label:e("wordPairs.filter.selectLabel","\uC120\uD0DD"),items:t,multiple:!0,labelAction:u?.labelAction,labelInfo:u?.labelInfo}}function ko(e,u){const{label:t,headValue:n,midValue:o,tailValue:r,includeMid:l=!0,headDisabled:s,midDisabled:a,tailDisabled:c,allOptionDisabled:h,groupLabel:d,labelAction:C}=u;return{label:t,...d?{groupLabel:d}:{},...C?{labelAction:C}:{},allOption:!0,allLabel:e("wordSearch.filter.positionAny",{defaultValue:"\uBB34\uAD00"}),...h?{allOptionDisabled:h}:{},items:[{value:n,displayLabel:e("wordSearch.filter.positionHead",{defaultValue:"\uC5B4\uB450"}),disabled:s},...l?[{value:o,displayLabel:e("wordSearch.filter.positionMid",{defaultValue:"\uC5B4\uC911"}),disabled:a}]:[],{value:r,displayLabel:e("wordSearch.filter.positionTail",{defaultValue:"\uC5B4\uB9D0"}),disabled:c}]}}function Fo(e,u,t){if(u===Se){const{[t]:r,...l}=e;return l}const n=e[t]??[],o=n.includes(u)?n.filter(r=>r!==u):[...n,u];if(o.length===0){const{[t]:r,...l}=e;return l}return{...e,[t]:o}}Object.fromEntries(Object.entries(Jn).map(([e,{nucleus:u}])=>[e,u]));const $o={\uACE0\uC720\uC5B4:"\uACE0\uC720",\uD55C\uC790\uC5B4:"\uD55C\uC790",\uC678\uB798\uC5B4:"\uC678\uB798",\uD63C\uC885\uC5B4:"\uD63C\uC885"},Vo={"\uCCB4\uC5B8(\uBA85\uC0AC,\uC218\uC0AC)":["\uBA85","\uC218"],"\uC6A9\uC5B8(\uB3D9\uC0AC,\uD615\uC6A9\uC0AC)":["\uB3D9","\uD615"],"\uC218\uC2DD\uC5B8(\uBD80\uC0AC,\uAD00\uD615\uC0AC)":["\uBD80","\uAD00"]},Ho={difficulty:"\uB09C\uC774\uB3C4 \uB4F1\uAE09",syllables:"\uC74C\uC808 \uC218",syllable5plus:"5\uC74C\uC808 \uC774\uC0C1",partOfSpeech:"\uD488\uC0AC",wordType:"\uC720\uD615",posMap:Vo,typeMap:$o};function Go(e,u,t=Ho){const n=u[t.difficulty];if(n?.length&&!n.some(s=>e.grade===s.replace(/\D/g,"")))return!1;const o=u[t.syllables];if(o?.length){const s=e.syllables??0;if(!o.some(a=>a===t.syllable5plus?s>=5:s===parseInt(a)))return!1}const r=u[t.partOfSpeech];if(r?.length&&!r.flatMap(s=>t.posMap[s]??[s]).some(s=>(e.pos??"").includes(s)))return!1;const l=u[t.wordType];return!(l?.length&&!l.some(s=>e.wordType===t.typeMap[s]))}const Yo={labial:e=>e("common.phonetics.place.labial",{defaultValue:"\uC591\uC21C\uC74C"}),alveolar:e=>e("common.phonetics.place.alveolar",{defaultValue:"\uCE58\uC870\uC74C"}),palatal:e=>e("common.phonetics.place.palatal",{defaultValue:"\uACBD\uAD6C\uAC1C\uC74C"}),velar:e=>e("common.phonetics.place.velar",{defaultValue:"\uC5F0\uAD6C\uAC1C\uC74C"}),glottal:e=>e("common.phonetics.place.glottal",{defaultValue:"\uC131\uBB38\uC74C"})},Uo={frontHigh:e=>e("common.phonetics.vowel.frontHigh",{defaultValue:"\uC804\uC124 \uACE0\uBAA8\uC74C"}),backHighUnrounded:e=>e("common.phonetics.vowel.backHighUnrounded",{defaultValue:"\uD6C4\uC124 \uACE0\uBAA8\uC74C \uD3C9\uC21C"}),backHighRounded:e=>e("common.phonetics.vowel.backHighRounded",{defaultValue:"\uD6C4\uC124 \uACE0\uBAA8\uC74C \uC6D0\uC21C"}),frontMid:e=>e("common.phonetics.vowel.frontMid",{defaultValue:"\uC804\uC124 \uC911\uBAA8\uC74C"}),backMidUnrounded:e=>e("common.phonetics.vowel.backMidUnrounded",{defaultValue:"\uD6C4\uC124 \uC911\uBAA8\uC74C \uD3C9\uC21C"}),backMidRounded:e=>e("common.phonetics.vowel.backMidRounded",{defaultValue:"\uD6C4\uC124 \uC911\uBAA8\uC74C \uC6D0\uC21C"}),low:e=>e("common.phonetics.vowel.low",{defaultValue:"\uC800\uBAA8\uC74C"})},Wo={j:e=>e("common.phonetics.glide.j",{defaultValue:"j\uD65C\uC74C"}),w:e=>e("common.phonetics.glide.w",{defaultValue:"w\uD65C\uC74C"}),velar:e=>e("common.phonetics.glide.velar",{defaultValue:"\u0270\uD65C\uC74C"})};function Lt(e,u){if("place"in u)return Yo[u.place](e);const t=Uo[u.vowel](e);return u.glide?`${t} \xB7 ${Wo[u.glide](e)}`:t}const Ko=(e,{defaultValue:u})=>u,vt=(e,u)=>({jamos:e,phonetic:u,tooltip:Lt(Ko,u)}),ie=(e,u)=>u.map(t=>vt([t],{place:e})),J=(e,u,t)=>vt([...e],t?{vowel:u,glide:t}:{vowel:u}),ju={cho:[ie("labial",["\u3142","\u3143","\u314D","\u3141"]),ie("alveolar",["\u3137","\u3138","\u314C","\u3134","\u3139"]),ie("alveolar",["\u3145","\u3146"]),ie("palatal",["\u3148","\u3149","\u314A"]),ie("velar",["\u3131","\u3132","\u314B"]),ie("glottal",["\u314E"])],jung:[[J("\u3163","frontHigh"),J("\u315F","frontHigh","w"),J("\u3162","frontHigh","velar")],[J("\u3161","backHighUnrounded")],[J("\u315C","backHighRounded"),J("\u3160","backHighRounded","j")],[J("\u3154\u3150","frontMid"),J("\u3156\u3152","frontMid","j"),J("\u3159\u315A\u315E","frontMid","w")],[J("\u3153","backMidUnrounded"),J("\u3155","backMidUnrounded","j"),J("\u315D","backMidUnrounded","w")],[J("\u3157","backMidRounded"),J("\u315B","backMidRounded","j")],[J("\u314F","low"),J("\u3151","low","j"),J("\u3158","low","w")]],jong:[ie("labial",["\u3142","\u3141"]),ie("alveolar",["\u3137","\u3134","\u3139"]),ie("velar",["\u3131","\u3147"])]},qo=[...Q],zo=[...ne],Jo=te.filter(e=>e!==""),ce=e=>e===re?[]:Array.from(e),re="__NO_CODA__",xt=[1,2,3,4],le=5,Qo=12,Pt="SYL_",Tu=e=>`${Pt}${e}`,Xo=e=>Number(e.slice(Pt.length));function Iu(e){return e>=le?Array.from({length:Qo-le+1},(u,t)=>le+t):[e]}const kt={cho:qo,jung:zo,jong:Jo},Mu=e=>e.map(u=>u.map(({jamos:t,phonetic:n,tooltip:o})=>({v:t.join(""),phonetic:n,tooltip:o}))),Ru={cho:Mu(ju.cho),jung:Mu(ju.jung),jong:Mu(ju.jong)},Ft={};Ru.jung.flat().forEach(({v:e})=>{for(const u of ce(e))Ft[u]=e});const Zo=new Set(Ru.cho.flat().map(e=>e.v));function $t(e,u){return e==="cho"?Zo.has(u)?u:null:e==="jung"?Ft[u]??u:Bu(u)}function Vt(e,u,t){if(e==="jung"){const n=ce(u);return t&&n.includes(t)?t:n[0]??u}return e==="jong"&&t&&Bu(t)===u?t:u}function Ht(e,u,t,n){const o=(r,l)=>l?r==="jong"&&l===re?re:u==="pron"?$t(r,l):Vt(r,l,r==="jung"?t:r==="jong"?n:null):null;return{...e,cho:o("cho",e.cho),jung:o("jung",e.jung),jong:o("jong",e.jong)}}const Lu={cho:null,jung:null,jong:null,syllable:null},er="wt_filter",Gt=e=>`wt_filter_${e}`,vu=["noun","verb","modifier"],xu=["native","sino","foreign","mixed"];function Yt(e,u,t,n,o){if(!Array.isArray(e))return[];const r=[];for(const l of e){if(typeof l!="string")continue;const s=u.includes(l)?l:u.find(a=>o.some(c=>n(c,t(a))===l));s&&!r.includes(s)&&r.push(s)}return r}function Ut(e){try{const u=localStorage.getItem(Gt(e))??localStorage.getItem(er);if(u)return JSON.parse(u)}catch{}return null}function Wt(e){const u=e?.phonemeView;return u==="pron"?"pron":u==="direct"?"direct":"char"}function ur(e){const u=e;return u?.composition?{cho:u.composition.cho??null,jung:u.composition.jung??null,jong:u.composition.jong??null,syllable:u.composition.syllable??null}:u?.choseong?{...Lu,cho:u.choseong}:Lu}function tr(e,u,t){const{t:n,i18n:o}=Ce.useTranslation(),[r]=i.useState(()=>t?.resetOnMount?null:Ut(e)),[l,s]=i.useState(Wt(r)),[a,c]=i.useState(()=>ur(r)),h=i.useCallback(()=>u.requireSyllable?{cho:"\u3131",jung:"\u314F",jong:re,syllable:u.fixedSyllable??null}:{cho:null,jung:null,jong:u.fixedNoCoda?re:null,syllable:u.fixedSyllable??null},[u.requireSyllable,u.fixedSyllable,u.fixedNoCoda]);i.useEffect(()=>{!u.requireSyllable&&u.fixedSyllable==null&&!u.fixedNoCoda||c(p=>p.cho||p.jung||p.syllable!=null||p.jong?p:h())},[]);const d=i.useMemo(()=>q(a.cho)||q(a.jung)||q(a.jong)?"count":"random",[a.cho,a.jung,a.jong]),C=i.useRef(l==="char"?a.jung:null),g=i.useRef(l==="char"?a.jong:null);i.useEffect(()=>{l==="char"&&(C.current=a.jung,g.current=a.jong)},[l,a.jung,a.jong]);const[f,B]=i.useState(t?.resetOnMount?!!t?.defaultImageOnly:r?.excludeNoImage??!0),[y,m]=i.useState(t?.resetOnMount?!1:r?.sameStructureOnly??!0),[S,E]=i.useState(Array.isArray(r?.gradeFilter)?r.gradeFilter:[]),w=Array.from(new Set([o.language,"ko","en"].filter(Boolean))),R=(p,N)=>o.getFixedT(p)(N),b=p=>Yt(p,vu,N=>`wordSearch.filter.pos.${N}`,R,w),D=p=>Yt(p,xu,N=>`wordSearch.filter.type.${N}`,R,w),[O,k]=i.useState(()=>b(r?.posFilter)),[_,V]=i.useState(()=>D(r?.wordTypeFilter)),Y=i.useRef(t?.resetKey);i.useEffect(()=>{Y.current!==t?.resetKey&&(Y.current=t?.resetKey,c(h()),B(!!t?.defaultImageOnly),m(!1),E([]),k([]),V([]))},[t?.resetKey]);const L=Tt(),T=i.useMemo(()=>Object.keys(L.posMap),[L]),v=i.useMemo(()=>Object.keys(L.typeMap),[L]),G=i.useMemo(()=>O.map(p=>T[vu.indexOf(p)]).filter(Boolean),[O,T]),Z=i.useMemo(()=>_.map(p=>v[xu.indexOf(p)]).filter(Boolean),[_,v]),[K,he]=i.useState({cho:new Set,jung:new Set,jong:new Set,syllable:new Set}),[A,I]=i.useState(!1),[M,$]=i.useState(null),U=1,ee=Math.max(1,[a.cho,a.jung,a.jong].filter(Boolean).length),[me,Oe]=i.useState(e);i.useEffect(()=>{if(me!==e){if(!t?.resetOnMount){const p=Ut(e);c(p?.composition??h()),B(p?.excludeNoImage??!0),m(p?.sameStructureOnly??!0),s(Wt(p)),E(Array.isArray(p?.gradeFilter)?p.gradeFilter:[]),k(b(p?.posFilter)),V(D(p?.wordTypeFilter))}Oe(e)}},[e,me,t?.resetOnMount]),i.useEffect(()=>{if(!t?.resetOnMount&&me===e)try{localStorage.setItem(Gt(e),JSON.stringify({contrastCount:ee,composition:a,excludeNoImage:f,sameStructureOnly:y,phonemeView:l,gradeFilter:S,posFilter:O,wordTypeFilter:_}))}catch{}},[t?.resetOnMount,e,me,ee,a,f,y,l,S,O,_]);const[ye,$u]=i.useState(0);Qu("wordpool:update",()=>$u(p=>p+1));const Vu=i.useRef(o.language);i.useEffect(()=>{Vu.current!==o.language&&(Vu.current=o.language,$u(p=>p+1))},[o.language]),i.useEffect(()=>{if(!u.choseong)return;let p=!1;return vo({difficulty:d,excludeNoImage:f}).then(N=>{p||(he(N),N.cho.size+N.jung.size+N.jong.size>0&&I(!0))}).catch(()=>{p||he({cho:new Set,jung:new Set,jong:new Set,syllable:new Set})}),()=>{p=!0}},[u.choseong,d,f,ye]),i.useEffect(()=>{let p=!1;const N=a,j=N.cho?ce(N.cho):null,x=N.jung?ce(N.jung):null,W=N.jong===re,Ee=W?null:N.jong?ce(N.jong):null,Be=N.syllable!=null?Iu(N.syllable):null,qe=!!(j||x||Ee||W||Be);return Lo({difficulty:u.difficulty?d:null,contrastCount:u.difficulty?ee:1,composition:u.choseong&&qe?{cho:j,jung:x,jong:Ee,jongNone:W,syllable:Be}:null,excludeNoImage:f,sameStructureOnly:y,phonemeView:l==="pron"?"pron":"char",grade:S.length>0?S:null}).then(ze=>{p||$(ze)}).catch(()=>{p||$(null)}),()=>{p=!0}},[u.choseong,u.difficulty,d,ee,a,l,f,y,ye,S]),i.useEffect(()=>{A&&c(p=>{const N={...p};let j=!1;return["cho","jung","jong"].forEach(x=>{const W=p[x];!W||W===re||ce(W).some(Ee=>K[x].has(Ee))||(N[x]=null,j=!0)}),p.syllable!=null&&u.fixedSyllable==null&&(p.syllable>=le?[...K.syllable].some(x=>x>=le)||(N.syllable=null,j=!0):(!K.syllable.has(p.syllable)||p.syllable<U)&&(N.syllable=null,j=!0)),j?N:p})},[K,A,U,u.fixedSyllable]);const Hu=i.useMemo(()=>{const p=N=>{const j=new Set;for(const x of kt[N])K[N].has(x)&&j.add(x);return j};return{cho:p("cho"),jung:p("jung"),jong:p("jong")}},[K]),fu=i.useMemo(()=>({exact:new Set(xt.filter(p=>K.syllable.has(p))),min:[...K.syllable].some(p=>p>=le)}),[K]),P=i.useMemo(()=>({composition:n("wordPairs.composition","\uC815\uB2F5 \uB2E8\uC5B4 \uAD6C\uC131"),syllableCount:n("wordPairs.syllableCount","\uC74C\uC808 \uC218"),onset:n("wordPairs.onset","\uCD08\uC131"),vowel:n("wordPairs.vowel","\uBAA8\uC74C"),coda:n("wordPairs.coda","\uC885\uC131"),phonemeGroup:n("training.filter.phonemeGroup",{defaultValue:"\uD6C8\uB828 \uC74C\uC808"}),trainOnset:n("training.filter.trainOnset",{defaultValue:"\uCD08\uC131"}),trainVowel:n("training.filter.trainVowel",{defaultValue:"\uBAA8\uC74C"}),trainCoda:n("training.filter.trainCoda",{defaultValue:"\uC885\uC131"}),random:n("training.filter.random","\uBB34\uC791\uC704"),exclude:n("wordSearch.filter.exclude","\uC81C\uC678"),selectLabel:n("training.filter.selectSection",{defaultValue:"\uC120\uD0DD"}),none:n("common.none","\uC5C6\uC74C"),noImage:n("wordSearch.filter.excludeNoImage","\uC774\uBBF8\uC9C0 \uC5C6\uC74C"),excludeImage:n("training.filter.excludeImage",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC"}),sameStructure:n("training.filter.sameStructure",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC"}),noLimit:n("training.filter.noLimit",{defaultValue:"\uBB34\uAD00"}),codaExclude:n("training.filter.codaExclude",{defaultValue:"\uC81C\uC678"}),gradeLabel:n("training.filter.gradeLabel",{defaultValue:"\uB09C\uC774\uB3C4 \uB4F1\uAE09"})}),[n]),Gu=i.useMemo(()=>({[P.trainOnset]:"cho",[P.trainVowel]:"jung",[P.trainCoda]:"jong"}),[P]),Ke=i.useCallback((p,N)=>({title:N,items:p}),[]),gu=i.useMemo(()=>[n("training.filter.excludeImageInfo",{defaultValue:"\uC774\uBBF8\uC9C0 \uC788\uB294 \uB2E8\uC5B4\uB9CC: \uB2E8\uC5B4 \uC911\uC5D0 \uC774\uBBF8\uC9C0\uAC00 \uC788\uB294 \uB2E8\uC5B4\uB9CC \uACB0\uACFC\uC5D0 \uBCF4\uC5EC\uC90D\uB2C8\uB2E4."}),n("training.filter.sameStructureInfo",{defaultValue:"\uC74C\uC18C \uAD6C\uC870 \uAC19\uC740 \uB2E8\uC5B4\uB9CC: \uC815\uB2F5\uACFC \uC624\uB2F5\uC758 \uC74C\uC808 \uAD6C\uC870(\uAE00\uC790 \uC218\xB7\uBC1B\uCE68 \uC720\uBB34 \uB4F1)\uAC00 \uAC19\uC740 \uACB0\uACFC\uB9CC \uB0A8\uACA8\uC694."})],[n]),en=i.useMemo(()=>{const p=[];if(u.choseong){const N={value:re,displayLabel:P.codaExclude},j=u.fixedNoCoda===!0,x=(W,Ee)=>{const Be=j&&W==="jong",qe={label:Ee,groupLabel:P.phonemeGroup,allOption:!u.requireSyllable,allLabel:P.noLimit,allOptionDisabled:Be};if(l==="pron"){const we=Ru[W].map(sn=>sn.map(({v:hu,phonetic:an})=>{const mu=ce(hu),Yu=Lt(n,an),Uu=Be||!mu.some(cn=>K[W].has(cn));return mu.length>1?{value:hu,labels:mu,tooltip:Yu,disabled:Uu}:{value:hu,tooltip:Yu,disabled:Uu}}));return W==="jong"&&!u.requireCoda&&we.unshift([N]),{...qe,groups:we}}const ze=kt[W].map(we=>!Be&&Hu[W].has(we)?we:{value:we,disabled:!0});return{...qe,items:W==="jong"&&!u.requireCoda?[N,...ze]:ze}};p.push(x("cho",P.trainOnset)),p.push(x("jung",P.trainVowel)),p.push(x("jong",P.trainCoda))}if(p.push({...It(n,L,{labelInfo:Ke([n("wordPairs.filter.difficultyInfo",{defaultValue:"\uAD6D\uB9BD\uAD6D\uC5B4\uC6D0\uC758 \uAE30\uCD08 \uC5B4\uD718 \uB4F1\uAE09\uC774 \uACB0\uACFC\uC5D0 \uBC18\uC601\uB429\uB2C8\uB2E4."})])}),label:P.gradeLabel}),u.partOfSpeech&&p.push(Mt(L)),u.wordType&&p.push(Rt(L)),u.choseong||u.fixedSyllable!=null){const N=u.fixedSyllable;p.push({label:P.syllableCount,items:[...xt.map(j=>({value:Tu(j),displayLabel:n("wordPairs.syllableN",{n:j,defaultValue:"{{n}}\uC74C\uC808"}),disabled:N!=null?j!==N:!fu.exact.has(j)||j<U})),{value:Tu(le),displayLabel:n("wordPairs.syllableNPlus",{n:le,defaultValue:"{{n}}\uC74C\uC808 \uC774\uC0C1"}),disabled:N!=null?le!==N:!fu.min}],allOption:!0,allOptionDisabled:N!=null})}return u.choseong?p.push({label:P.exclude,displayLabel:P.selectLabel,multiple:!0,items:[P.excludeImage,P.sameStructure],labelInfo:Ke(gu)}):p.push({label:P.exclude,displayLabel:P.selectLabel,multiple:!0,items:[P.excludeImage],labelInfo:Ke([gu[0]])}),p},[u.choseong,u.partOfSpeech,u.wordType,u.requireSyllable,u.fixedSyllable,u.fixedNoCoda,u.requireCoda,U,Hu,K,l,fu,P,n,Ke,gu,L]),un={...(u.choseong||u.fixedSyllable!=null)&&a.syllable!=null?{[P.syllableCount]:Tu(a.syllable)}:{},...u.choseong&&a.cho?{[P.trainOnset]:a.cho}:{},...u.choseong&&a.jung?{[P.trainVowel]:a.jung}:{},...u.choseong&&a.jong?{[P.trainCoda]:a.jong}:{},[P.exclude]:[...f?[P.excludeImage]:[],...y?[P.sameStructure]:[]],[P.gradeLabel]:S.map(p=>n("wordSearch.filter.grade",{n:Number(p),defaultValue:"{{n}}\uB4F1\uAE09"})),...u.partOfSpeech?{[L.partOfSpeech]:G}:{},...u.wordType?{[L.wordType]:Z}:{}},tn=i.useCallback((p,N)=>{if(N===P.exclude)p===P.excludeImage?B(j=>!j):p===P.sameStructure&&m(j=>!j);else if(N===P.syllableCount)c(j=>{if(!p||p===Se)return{...j,syllable:null};const x=Xo(p);return{...j,syllable:j.syllable===x?null:x}});else if(N===P.gradeLabel){if(!p||p===Se){E([]);return}const j=p.replace(/\D/g,"");E(x=>x.includes(j)?x.filter(W=>W!==j):[...x,j])}else if(N===L.partOfSpeech){if(!p||p===Se){k([]);return}const j=vu[T.indexOf(p)]??b([p])[0];if(!j)return;k(x=>x.includes(j)?x.filter(W=>W!==j):[...x,j])}else if(N===L.wordType){if(!p||p===Se){V([]);return}const j=xu[v.indexOf(p)]??D([p])[0];if(!j)return;V(x=>x.includes(j)?x.filter(W=>W!==j):[...x,j])}else{const j=Gu[N];if(!j)return;c(x=>u.requireSyllable?p&&p!==Se?{...x,[j]:p}:x:!p||p===Se||x[j]===p?{...x,[j]:null}:{...x,[j]:p})}},[P,Gu,L,T,v,u.requireSyllable]),nn=i.useCallback(p=>!u.partOfSpeech&&!u.wordType?!0:Go(p,{...u.partOfSpeech?{[L.partOfSpeech]:G}:{},...u.wordType?{[L.wordType]:Z}:{}},L),[u.partOfSpeech,u.wordType,G,Z,L]),on=i.useCallback(p=>{p!==l&&(p!=="direct"&&l!=="direct"&&c(N=>Ht(N,p,C.current,g.current)),s(p))},[l]),rn=i.useCallback(()=>({composition:a,contrastCount:ee,excludeNoImage:f,sameStructureOnly:y,phonemeView:l,gradeFilter:S,posFilter:O,wordTypeFilter:_}),[a,ee,f,y,l,S,O,_]),ln=i.useCallback(p=>{c(p.composition),B(p.excludeNoImage),m(p.sameStructureOnly??!0),s(p.phonemeView),E(Array.isArray(p.gradeFilter)?p.gradeFilter:[]),Array.isArray(p.posFilter)&&k(b(p.posFilter)),Array.isArray(p.wordTypeFilter)&&V(D(p.wordTypeFilter))},[]);return{difficulty:d,contrastCount:ee,composition:a,choseong:a.cho,excludeNoImage:f,sameStructureOnly:y,gradeFilter:S,posFilter:G,wordTypeFilter:Z,matchesWordAttributes:nn,poolVersion:ye,filterSections:en,filterSelected:un,handleFilterSelect:tn,phonemeView:l,setPhonemeView:on,phonemeGroupLabel:P.phonemeGroup,wordCount:M,getFilterSnapshot:rn,restoreFilterSnapshot:ln}}function nr(e){const u=s=>s?ce(s):null,t=u(e.cho),n=u(e.jung),o=e.jong===re,r=o?null:u(e.jong),l=e.syllable!=null?Iu(e.syllable):null;return!t&&!n&&!r&&!o&&!l?null:{cho:t,jung:n,jong:r,jongNone:o,syllable:l}}function or(e,u,t,n,o,r,l=!0,s="char",a=[]){const[c,h]=i.useState({}),[d,C]=i.useState(!1),{cho:g=null,jung:f=null,jong:B=null,syllable:y=null}=n??{},m=a.length>0?a.slice().sort().join(","):"",S=e.map(w=>w.key).join("|");i.useEffect(()=>{r>0&&Ro(o).catch(()=>{})},[r,o]),i.useEffect(()=>{let w=!1;return C(!0),(async()=>{const R=nr({cho:g,jung:f,jong:B,syllable:y}),b=`${g??""}_${f??""}_${B??""}_${y??""}_${m}`,D={};await Promise.all(e.map(async O=>{const k=yu[O.key];try{const _=await jt(O.key,{difficulty:k.difficulty?u:null,contrastCount:k.difficulty?t:1,composition:k.choseong?R:null,count:5,excludeNoImage:o,sameStructureOnly:l,phonemeView:s,grade:a.length>0?a:null});_&&_.length>0?D[O.key]={id:`wt-${O.key}-${u}-${b}-${Date.now()}`,name:O.label,training_type:O.key,category_main_code:"WORD",iconColor:O.color,subTitle:O.subTitle,items:_,itemCount:_.length}:D[O.key]={id:`wt-${O.key}-empty`,name:O.label,training_type:O.key,category_main_code:"WORD",iconColor:O.color,subTitle:O.subTitle,items:[],itemCount:0,__empty:!0}}catch{D[O.key]=null}})),w||(h(D),C(!1))})(),()=>{w=!0}},[u,t,g,f,B,y,o,l,s,r,m,S]);const E=JSON.stringify(e.map(w=>[w.key,w.label,w.color,w.subTitle]));return{perTypeData:i.useMemo(()=>{const w={};for(const[R,b]of Object.entries(c)){const D=e.find(O=>O.key===R);w[R]=b&&D?{...b,name:D.label,iconColor:D.color,subTitle:D.subTitle}:b}return w},[c,E]),generating:d}}const Fe=[],$e=[],Ve=[],He=[],lu={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},su={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},rr={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};let Pu=null,Kt=null,ge=null;function lr({counts:e,forceRefresh:u}={}){const t=Object.assign({},rr,e||{}),n=Je(),o=Qe(new Date(`${n}T00:00:00+09:00`).getTime()-864e5),r=JSON.stringify(t);if(!u&&Kt===n&&Pu===r&&ge)return Object.assign(lu,ge.today),Object.assign(su,ge.yesterday?.selection||{LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),{today:lu,yesterday:su};const l={LISTEN_IN_NOISE:se(Fe,Math.max(0,Number(t.LISTEN_IN_NOISE)||0)),SHORT_STORY:se($e,Math.max(0,Number(t.SHORT_STORY)||0)),LONG_STORY:se(Ve,Math.max(0,Number(t.LONG_STORY)||0)),ORDERING_SENTENCE:se(He,Math.max(0,Number(t.ORDERING_SENTENCE)||0))};let s=null;return ge&&Pu===r&&ge.yesterday&&ge.yesterday.date===o&&(s=ge.yesterday.selection),s||(s={LISTEN_IN_NOISE:se(Fe,Math.max(0,Number(t.LISTEN_IN_NOISE)||0)),SHORT_STORY:se($e,Math.max(0,Number(t.SHORT_STORY)||0)),LONG_STORY:se(Ve,Math.max(0,Number(t.LONG_STORY)||0)),ORDERING_SENTENCE:se(He,Math.max(0,Number(t.ORDERING_SENTENCE)||0))}),Object.assign(lu,l),Object.assign(su,s),Kt=n,Pu=r,ge={today:l,yesterday:{date:o,countsKey:r,selection:s}},{today:lu,yesterday:su}}let qt=!1,Ge=null;async function sr(){try{const e={url:typeof document>"u"?require("url").pathToFileURL(__filename).href:pu&&pu.tagName.toUpperCase()==="SCRIPT"&&pu.src||new URL("hooks.cjs.js",document.baseURI).href}&&void 0||"/",u=await fetch(`${e}data/allTrainingData.json`);return u.ok?await u.json():null}catch{return null}}async function ar(){if(!qt)return Ge||(Ge=(async()=>{const e=await sr();if(!e){Ge=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}const u={noise:[],short:[],long:[],order:[]};try{for(const t of Object.keys(e||{})){const n=e[t]||[];for(const o of n){const r=o,l=String(r.training_type||t),s=String(r.category_main_code||r.category_main||r.category_0||""),a=String(r.category_sub_code||r.category_sub||r.category_1||""),c=Object.assign({},r,{training_type:l,category_0:s,category_1:a});l==="LISTEN_IN_NOISE"?u.noise.push(c):l==="SHORT_STORY"?u.short.push(c):l==="LONG_STORY"?u.long.push(c):l==="ORDERING_SENTENCE"&&u.order.push(c)}}}catch{Ge=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}Fe.push(...u.noise),$e.push(...u.short),Ve.push(...u.long),He.push(...u.order);try{window.dispatchEvent(new Event("speechear.data.updated"))}catch{}try{lr()}catch{}qt=!0})(),Ge)}async function ir(e=3e3){const u=ar();return Promise.race([u,new Promise(t=>setTimeout(t,e))])}function cr(e){let u=2166136261;for(let t=0;t<e.length;t++)u^=e.charCodeAt(t),u=Math.imul(u,16777619);return u>>>0}function Cr(e){let u=e>>>0;return()=>{u|=0,u=u+1831565813|0;let t=Math.imul(u^u>>>15,1|u);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}const au=se;function ku(e,u){const t=u?Cr(cr(u)):Math.random;return{LISTEN_IN_NOISE:au(Fe,Math.max(0,e.LISTEN_IN_NOISE||0),t),SHORT_STORY:au($e,Math.max(0,e.SHORT_STORY||0),t),LONG_STORY:au(Ve,Math.max(0,e.LONG_STORY||0),t),ORDERING_SENTENCE:au(He,Math.max(0,e.ORDERING_SENTENCE||0),t)}}function zt(e){return e?!!(e.LISTEN_IN_NOISE?.length||e.SHORT_STORY?.length||e.LONG_STORY?.length||e.ORDERING_SENTENCE?.length):!1}const dr={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};function Jt(e=!1,u=dr,t){const n=Qe(Date.now()),o=Qe(Date.now()-864e5),r=`${t??""}|${n}`,l=`${t??""}|${o}`;return Fe.length>0||$e.length>0||Ve.length>0||He.length>0?{today:ku(u,r),yesterday:ku(u,l)}:{today:ku(u,r),yesterday:null}}function fr(e){const u=i.useRef({LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),t=i.useRef(null),[n,o]=i.useState(!1),[r,l]=i.useState(!1),[s,a]=i.useState(0),[c,h]=i.useState(!1),[d,C]=i.useState(()=>Je());i.useEffect(()=>{const f=()=>{const y=Date.now(),m=new Date(y+9*36e5),S=Date.UTC(m.getUTCFullYear(),m.getUTCMonth(),m.getUTCDate()+1)-9*36e5;return Math.max(1e3,S-y+1e3)};let B=setTimeout(function y(){C(Je()),B=setTimeout(y,f())},f());return()=>clearTimeout(B)},[]),i.useEffect(()=>{let f=!1,B,y=0;const m=40,S=()=>{B!==void 0&&(clearInterval(B),B=void 0)};let E=!1;try{const b=new URLSearchParams(window.location.search),D=b.get("forceRefresh")||b.get("force");E=D==="1"||D==="true"}catch{}const w=b=>{u.current=b.today,t.current=b.yesterday,o(!0),h(!0),a(D=>D+1),f=!0,S()},R=async()=>{if(f)return;if(!E){const D=Jt(!1,void 0,e);if(zt(D.today)){w(D);return}}try{await ir(3e3)}catch{}if(f)return;const b=Jt(E,void 0,e);if(zt(b.today)){w(b);return}++y>=m&&(o(!0),h(!1),f=!0,S())};return R(),B=setInterval(R,250),()=>{f=!0,S()}},[e,d]);const g=i.useCallback(f=>{const B=r?t.current:u.current,y=r?u.current:t.current;return B?.[f]?.length?B[f]:y?.[f]?.length?y[f]:void 0},[r,s]);return{loaded:n,hasData:c,showYesterday:r,setShowYesterday:l,getTrainingPerType:g}}const De=[];let iu=!1;function Qt(e){if(e.key!=="Escape"||e.defaultPrevented||e.isComposing||e.keyCode===229)return;const u=De[De.length-1];u&&(e.stopPropagation(),u())}function Xt(e){return De.push(e),!iu&&typeof document<"u"&&(document.addEventListener("keydown",Qt),iu=!0),()=>{const u=De.lastIndexOf(e);u>=0&&De.splice(u,1),De.length===0&&iu&&typeof document<"u"&&(document.removeEventListener("keydown",Qt),iu=!1)}}function gr(e,u=!0){const t=Ju(e);i.useEffect(()=>{if(u)return Xt(()=>{t.current?.()})},[u,t])}const Fu=(e,u)=>`${e}:${u??1}`,cu=new Map,Zt=new Set;function hr(e,u){const[t,n]=i.useState(0),o=Array.from(new Set(e.map(r=>Fu(r.word,r.homonum)))).sort().join("|");return i.useEffect(()=>{const r=(o?o.split("|"):[]).filter(a=>!cu.has(a)&&!Zt.has(a));if(r.length===0)return;let l=!1;const s=Array.from(new Set(r.map(a=>a.slice(0,a.lastIndexOf(":")))));return u(s).then(a=>{for(const c of a)c.Meaning&&cu.set(Fu(c.Word,c.Homonum??void 0),c.Meaning);if(a.length>0)for(const c of r)cu.has(c)||Zt.add(c);l||a.length===0||n(c=>c+1)}).catch(()=>{}),()=>{l=!0}},[o,u]),i.useMemo(()=>{const r=o?o.split("|"):[],l=new Map;for(const s of r){const a=cu.get(s);a!=null&&l.set(s,a)}return l},[o,t])}function mr(){const[e,u]=i.useState(null),t=i.useCallback(r=>u(r.getBoundingClientRect()),[]),n=i.useCallback(()=>u(null),[]),o=i.useCallback(r=>{const l=r.getBoundingClientRect();u(s=>s?null:l)},[]);return{anchorRect:e,isOpen:e!=null,openAt:t,close:n,toggleAt:o}}function pr(e){const[u,t]=i.useState(null),[n,o]=i.useState(null),r=i.useRef(null);i.useEffect(()=>()=>{r.current&&clearTimeout(r.current)},[]);const l=i.useCallback((a,c)=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{t(a),o(c)},e)},[e]),s=i.useCallback(()=>{r.current&&clearTimeout(r.current),t(null),o(null)},[]);return{payload:u,anchorRect:n,openAfterDelay:l,close:s}}function Sr(e,u,t){const n=Number.isFinite(u)&&u>=1?Math.floor(u):1,o=Math.max(1,Math.ceil(e.length/n)),r=Number.isFinite(t)?Math.min(Math.max(1,Math.floor(t)),o):1;return{pageItems:i.useMemo(()=>e.slice((r-1)*n,r*n),[e,r,n]),totalPages:o,curPage:r}}function yr(e="warning"){const[u,t]=i.useState(""),[n,o]=i.useState(e),[r,l]=i.useState(0),s=i.useCallback((d,C)=>{o(C),t(d),l(g=>g+1)},[]),a=i.useCallback(d=>s(d,"warning"),[s]),c=i.useCallback(d=>s(d,"normal"),[s]),h=i.useCallback(()=>t(""),[]);return{toastMessage:u,toastType:n,toastKey:r,showToast:s,showWarning:a,showNormal:c,clearToast:h}}const Er=[{key:"LISTEN_IN_NOISE",label:"\uC18C\uC74C \uD558 \uBB38\uC7A5 \uB4E3\uAE30",icon:"party-popper",desc:"\uB2E4\uC591\uD55C \uC18C\uC74C \uD658\uACBD\uC5D0\uC11C \uBB38\uC7A5 \uCCAD\uB825\uC744 \uD6C8\uB828\uD569\uB2C8\uB2E4."},{key:"SHORT_STORY",label:"\uC9E7\uC740 \uC774\uC57C\uAE30 \uB4E3\uAE30",icon:"message-square",desc:"\uC9E7\uC740 \uC774\uC57C\uAE30\uB97C \uB4E3\uACE0 \uAE30\uC5B5\uD558\uC5EC \uBB38\uC81C\uB97C \uD480\uC5B4\uBD05\uB2C8\uB2E4."},{key:"LONG_STORY",label:"\uAE34 \uC774\uC57C\uAE30 \uB4E3\uAE30",icon:"message-square-text",desc:"\uAE34 \uC774\uC57C\uAE30\uB97C \uB4E3\uACE0 \uAE30\uC5B5\uD558\uC5EC \uB2E4\uC218\uC758 \uBB38\uC81C\uB97C \uD480\uC5B4\uBD05\uB2C8\uB2E4."},{key:"ORDERING_SENTENCE",label:"\uBB38\uC7A5 \uC21C\uC11C\uD654 \uD558\uAE30",icon:"align-start-vertical",desc:"\uC5EC\uB7EC\uAC1C\uC758 \uC9E7\uC740 \uBB38\uC7A5\uC744 \uB4E3\uACE0 \uAE30\uC5B5\uD558\uC5EC \uADF8 \uC21C\uC11C\uC5D0 \uB9DE\uAC8C \uBC30\uC5F4\uD569\uB2C8\uB2E4."}],Br={LISTEN_IN_NOISE:"listenInNoise",SHORT_STORY:"shortStory",LONG_STORY:"longStory",ORDERING_SENTENCE:"orderingSentence"};function wr(e){return Er.map(u=>{const t=Br[u.key];return t?{...u,label:e(`trainingType.${t}.title`),desc:e(`trainingType.${t}.desc`)}:u})}const Ye={blue:"#60A5FA",green:"#4ADE80",amber:"#FBBF24",purple:"#A78BFA",pink:"#F472B6"},Ue=Ye.blue,Cu=Ye.green,We=Ye.amber,du=Ye.purple,br=Ye.pink,Ar=[{key:"discrimination",label:"\uBCC0\uBCC4\uD6C8\uB828",disc:"\uB450 \uC18C\uB9AC\uAC00 \uAC19\uC740\uC9C0 \uB2E4\uB978\uC9C0, \uB610\uB294 \uD2B9\uC815 \uC18C\uB9AC\uB97C \uAD6C\uBCC4\uD558\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"ear",types:[{key:"SAME_SOUND_PICK",label:"\uAC19\uC740 \uC18C\uB9AC \uACE0\uB974\uAE30",icon:"volume-2",color:Ue,subTitle:"\uB4E4\uC740 \uC18C\uB9AC\uC640 \uAC19\uC740 \uB2E8\uC5B4 \uCE74\uB4DC\uB97C \uACE0\uB974\uC138\uC694."},{key:"SAME_OR_DIFF",label:"\uAC19\uC740\uC9C0 \uB2E4\uB978\uC9C0 \uB9DE\uD788\uAE30",icon:"diff",color:Ue,subTitle:"\uB450 \uC18C\uB9AC\uAC00 \uAC19\uC740\uC9C0, \uB2E4\uB978\uC9C0 \uAD6C\uBD84\uD558\uC138\uC694."},{key:"HEAR_AND_PICK_SAME",label:"\uC77C\uCE58\uD558\uB294 \uB2E8\uC5B4 \uB9DE\uD788\uAE30",icon:"headphones",color:Ue,subTitle:"\uB4E4\uC740 \uC18C\uB9AC\uC758 \uB2E8\uC5B4 \uCE74\uB4DC\uB97C \uACE0\uB974\uC138\uC694."},{key:"HEAR_AND_PICK_INCLUDED",label:"\uD55C \uC74C\uC808 \uD3EC\uD568 \uB2E8\uC5B4 \uB9DE\uD788\uAE30",icon:"scan-search",color:Ue,subTitle:"\uB4E4\uC740 \uC74C\uC808\uC774 \uD3EC\uD568\uB41C \uB2E8\uC5B4 \uCE74\uB4DC\uB97C \uACE0\uB974\uC138\uC694."},{key:"STARTS_WITH_SAME_SOUND",label:"\uCCAB \uC74C\uC808\uC774 \uAC19\uC740 \uB2E8\uC5B4 \uB9DE\uD788\uAE30",icon:"play-circle",color:Ue,subTitle:"\uB4E4\uC740 \uB2E8\uC5B4\uC640 \uAC19\uC740 \uC18C\uB9AC\uB85C \uC2DC\uC791\uD558\uB294 \uB2E8\uC5B4\uB97C \uACE0\uB974\uC138\uC694."}]},{key:"synthesis",label:"\uD569\uC131\uD6C8\uB828",disc:"\uB450 \uAC1C \uC774\uC0C1\uC758 \uC74C\uC808\uC774\uB098 \uC74C\uC18C\uB97C \uD569\uCCD0 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"git-merge",types:[{key:"MERGE_2_SYLLABLES",label:"\uC74C\uC808 2\uAC1C \uD569\uCE58\uAE30",icon:"link-2",color:Cu,subTitle:"\uB450 \uC74C\uC808\uC744 \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uB2E8\uC5B4\uAC00 \uB420\uAE4C\uC694?"},{key:"MERGE_3_SYLLABLES",label:"\uC74C\uC808 3\uAC1C \uD569\uCE58\uAE30",icon:"git-merge",color:Cu,subTitle:"\uC138 \uC74C\uC808\uC744 \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uB2E8\uC5B4\uAC00 \uB420\uAE4C\uC694?"},{key:"MERGE_2_PHONEMES",label:"\uC74C\uC18C 2\uAC1C \uD569\uCE58\uAE30",icon:"combine",color:Cu,subTitle:"\uB450 \uC74C\uC18C\uB97C \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"MERGE_3_PHONEMES",label:"\uC74C\uC18C 3\uAC1C \uD569\uCE58\uAE30",icon:"braces",color:Cu,subTitle:"\uC138 \uC74C\uC18C\uB97C \uD569\uCE58\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"}]},{key:"deletion",label:"\uD0C8\uB77D\uD6C8\uB828",disc:"\uB2E8\uC5B4\uC5D0\uC11C \uC74C\uC808\uC774\uB098 \uC74C\uC18C\uB97C \uC81C\uAC70\uD588\uC744 \uB54C \uB0A8\uB294 \uC18C\uB9AC\uB97C \uC778\uC2DD\uD558\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"scissors",types:[{key:"DROP_1_FROM_2SYLL",label:"2\uC74C\uC808\uC5D0\uC11C 1\uC74C\uC808 \uD0C8\uB77D",icon:"scissors",color:We,subTitle:"2\uC74C\uC808 \uB2E8\uC5B4\uC5D0\uC11C \uD55C \uC74C\uC808\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"DROP_1_FROM_3SYLL",label:"3\uC74C\uC808\uC5D0\uC11C 1\uC74C\uC808 \uD0C8\uB77D",icon:"minus-circle",color:We,subTitle:"3\uC74C\uC808 \uB2E8\uC5B4\uC5D0\uC11C \uD55C \uC74C\uC808\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"DROP_PART_FROM_COMPOUND",label:"\uD569\uC131\uC5B4\uC5D0\uC11C \uBD80\uBD84\uD0C8\uB77D",icon:"unlink",color:We,subTitle:"\uD569\uC131\uC5B4\uC758 \uC77C\uBD80\uB97C \uBE7C\uBA74 \uC5B4\uB5A4 \uB2E8\uC5B4\uAC00 \uB420\uAE4C\uC694?"},{key:"DROP_FINAL_CONSONANT_FROM_1SYLL",label:"1\uC74C\uC808\uC5D0\uC11C \uBC1B\uCE68 \uD0C8\uB77D",icon:"eraser",color:We,subTitle:"\uBC1B\uCE68\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB420\uAE4C\uC694?"},{key:"REMOVE_CONSONANT_AND_IDENTIFY_PHONEME",label:"1\uC74C\uC808\uC5D0\uC11C \uC790\uC74C \uD0C8\uB77D",icon:"audio-lines",color:We,subTitle:"\uC790\uC74C\uC744 \uBE7C\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB0A8\uC744\uAE4C\uC694?"}]},{key:"substitution",label:"\uB300\uCE58\uD6C8\uB828",disc:"\uB2E8\uC5B4\uC758 \uC77C\uBD80 \uC74C\uC808\uC774\uB098 \uC74C\uC18C\uB97C \uBC14\uAFB8\uC5B4 \uC0C8\uB85C\uC6B4 \uC18C\uB9AC\uB97C \uB9CC\uB4DC\uB294 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"replace",types:[{key:"CHANGE_1_SYLL_IN_2SYLL",label:"2\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC808 \uBC14\uAFB8\uAE30",icon:"replace",color:du,subTitle:"2\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC808\uC744 \uBC14\uAFD4 \uC0C8 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uC138\uC694."},{key:"CHANGE_1_SYLL_IN_3SYLL",label:"3\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC808 \uBC14\uAFB8\uAE30",icon:"shuffle",color:du,subTitle:"3\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC808\uC744 \uBC14\uAFD4 \uC0C8 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uC138\uC694."},{key:"CHANGE_1_PHONEME_IN_1SYLL",label:"1\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC18C \uBC14\uAFB8\uAE30",icon:"arrow-right-left",color:du,subTitle:"1\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC18C\uB97C \uBC14\uAFD4 \uC0C8 \uC18C\uB9AC\uB97C \uB9CC\uB4DC\uC138\uC694."},{key:"CHANGE_1_PHONEME_IN_2SYLL",label:"2\uC74C\uC808\uC5D0\uC11C \uD55C \uC74C\uC18C \uBC14\uAFB8\uAE30",icon:"flip-horizontal",color:du,subTitle:"2\uC74C\uC808 \uB2E8\uC5B4\uC758 \uD55C \uC74C\uC18C\uB97C \uBC14\uAFD4 \uC0C8 \uB2E8\uC5B4\uB97C \uB9CC\uB4DC\uC138\uC694."}]},{key:"attention",label:"\uCCAD\uAC01\uC801\uC8FC\uC758\uB825\uD6C8\uB828",disc:"\uC5EC\uB7EC \uC18C\uB9AC\uB97C \uB4E3\uACE0 \uC21C\uC11C\uB97C \uAE30\uC5B5\uD558\uB294 \uC8FC\uC758\uB825\uACFC \uB2E8\uAE30 \uAE30\uC5B5 \uD6C8\uB828\uC785\uB2C8\uB2E4.",icon:"list-ordered",types:[{key:"LISTEN_AND_REMEMBER_ORDER",label:"\uB4E3\uACE0 \uC21C\uC11C\uB300\uB85C \uAE30\uC5B5\uD558\uAE30",icon:"list-ordered",color:br,subTitle:"\uC138 \uB2E8\uC5B4\uB97C \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694."}]}];function _r(){const{t:e}=Ce.useTranslation();return i.useMemo(()=>{const u=Object.fromEntries(wr(e).map(n=>[n.key,n.label])),t={...u};return Ar.flatMap(n=>n.types).forEach(n=>{t[n.key]=e(`trainingType.${n.key}.label`,{defaultValue:n.label})}),{sentence:u,all:t}},[e])}const Dr="0.146.0";function Or({computeStyle:e,onScroll:u="close",onResize:t="close",ignoreOutsideClickSelector:n}){const[o,r]=i.useState(!1),[l,s]=i.useState({}),a=i.useRef(null),c=i.useRef(null),h=i.useCallback(()=>{a.current&&s(e(a.current.getBoundingClientRect()))},[e]);i.useEffect(()=>{if(!o)return;h();const g=y=>{const m=y.target;n&&m.closest?.(n)||a.current?.contains(m)||c.current?.contains(m)||r(!1)};document.addEventListener("mousedown",g),document.addEventListener("pointerdown",g);const f=y=>{c.current?.contains(y.target)||(u==="reposition"?h():u==="close"&&r(!1))};u!=="ignore"&&window.addEventListener("scroll",f,!0);const B=()=>{t==="reposition"?h():t==="close"&&r(!1)};return t!=="ignore"&&window.addEventListener("resize",B),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("pointerdown",g),u!=="ignore"&&window.removeEventListener("scroll",f,!0),t!=="ignore"&&window.removeEventListener("resize",B)}},[o,h,u,t,n]),i.useEffect(()=>{if(o)return Xt(()=>r(!1))},[o]);const d=i.useCallback(()=>r(g=>!g),[]),C=i.useCallback(()=>r(!1),[]);return{open:o,setOpen:r,toggle:d,close:C,style:l,triggerRef:a,menuRef:c}}function Nr(e,{mode:u="playback",autoStart:t=!1,onPlaySpeaker:n,onComplete:o,playMs:r=1100,feedbackMs:l=1500}={}){const[s,a]=i.useState([]),[c,h]=i.useState(0),[d,C]=i.useState("idle"),[g,f]=i.useState(null),[B,y]=i.useState([]),[m,S]=i.useState(null),[E,w]=i.useState(0),R=i.useRef(0),b=i.useCallback(M=>{R.current=typeof M=="function"?M(R.current):M,w(R.current)},[]),D=i.useRef(n),O=i.useRef(o);i.useEffect(()=>{D.current=n,O.current=o},[n,o]);const k=i.useRef([]),_=()=>{k.current.forEach(clearTimeout),k.current=[]},V=(M,$)=>{k.current.push(setTimeout($,M))};i.useEffect(()=>()=>_(),[]);const Y=s[c]?.id??null,L=i.useRef(null),T=i.useCallback(()=>{_(),C("playing"),y([]),S(null),b(0);let M=0;e.forEach(($,U)=>{V(M,()=>{h(U),f($.id),D.current?.($)}),V(M+1e3,()=>{f(null),y(ee=>[...ee,$.id])}),M+=1300}),V(M,()=>{C("done"),O.current?.({score:0,total:e.length})})},[e,b]),v=i.useCallback((M,$)=>{if($>=M.length){C("done"),O.current?.({score:R.current,total:M.length});return}L.current=null,h($),S(null),C("playing"),f(M[$].id),D.current?.(M[$]),V(r,()=>{f(null),C("waiting")})},[r]),G=i.useCallback(()=>{_();const M=F(e);a(M),b(0),y([]),v(M,0)},[e,v,b]),Z=i.useCallback(()=>{u==="playback"?(a(e),T()):G()},[u,e,T,G]),K=i.useCallback(()=>{_(),C("idle"),f(null),y([]),S(null),h(0),b(0),a([])},[b]),he=e.map(M=>M.id).join("|");i.useEffect(()=>(t?Z():K(),()=>_()),[u,he,t]);const A=i.useCallback(M=>{d!=="waiting"||u==="playback"||L.current===c||(L.current=c,S(M),M===s[c]?.id&&b($=>$+1),u==="exam"?(C("playing"),V(400,()=>v(s,c+1))):(C("feedback"),V(l,()=>v(s,c+1))))},[d,u,s,c,v,l,b]),I=u==="playback"?e.length:s.length;return{bind:{activeSpeakerId:g,playedIds:B,selectedId:m,answerId:Y,showFeedback:d==="feedback",clickable:d==="waiting",onSelectSpeaker:A},index:c,total:I,score:E,phase:d,done:d==="done",start:Z,reset:K}}exports.CACHE_GROUPS=it,exports.CORE_VERSION=Dr,exports.DocumentTitleSuppressContext=Zu,exports.EMPTY_COMPOSITION=Lu,exports.MediaQueryOverrideContext=qu,exports.NO_CODA=re,exports.SYLLABLE_MIN=le,exports.VAP_PAGE_SIZE_OPTIONS=Ze,exports.buildGradeSection=It,exports.buildPartOfSpeechSection=Mt,exports.buildPositionSection=ko,exports.buildSelectSection=Po,exports.buildSyllableSection=xo,exports.buildWordTypeSection=Rt,exports.charToPronValue=$t,exports.convertComposition=Ht,exports.fmtBytes=xn,exports.lsBytes=ct,exports.meaningKey=Fu,exports.pronToCharValue=Vt,exports.syllableToFilter=Iu,exports.today=ve,exports.toggleAttributeFilter=Fo,exports.useAnchoredMenu=Or,exports.useCacheManagement=Pn,exports.useDailyTrainingSelection=fr,exports.useDelayedHoverAnchor=pr,exports.useDeviceManagement=Wn,exports.useDocumentTitle=Sn,exports.useEscToClose=gr,exports.useFontScale=dn,exports.useHoverAnchor=mr,exports.useMediaQuery=pn,exports.usePagedList=Sr,exports.usePasswordChange=wn,exports.useRelativeDay=yn,exports.useSoundCompassExam=Nr,exports.useTablePaging=Yn,exports.useTableSort=Un,exports.useToastState=yr,exports.useTrainingTypeLabels=_r,exports.useVisitAllPanel=Gn,exports.useVisitHistory=$n,exports.useVisitSchedule=Hn,exports.useWindowEvent=Qu,exports.useWordAttributeFilterKeys=Tt,exports.useWordDataStats=kn,exports.useWordMeanings=hr,exports.useWordTrainingDataGeneration=or,exports.useWordTrainingFilter=tr,exports.valueToJamos=ce;
package/dist/i18n.cjs.js CHANGED
@@ -2,4 +2,4 @@
2
2
  \uC2E0\uB8B0\uB97C \uC313\uACE0
3
3
  \uD68C\uBCF5\uC744 \uB3D5\uC2B5\uB2C8\uB2E4.`,site:{title:"\uC0AC\uC774\uD2B8",malgwi:"\uB9D0\uADC0",soundDirection:"\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C",vrSoundDirection:"VR\uC18C\uB9AC\uBC29\uD5A5\uC131\uC2DC\uC2A4\uD15C",hearingTest:"\uCCAD\uB825\uD14C\uC2A4\uD2B8 \uD504\uB85C"},sns:{title:"SNS",naverBlog:"\uB124\uC774\uBC84 \uBE14\uB85C\uADF8",kakao:"KAKAO Talk \uC624\uD508\uCC44\uD305"},policy:{title:"\uC815\uCC45",terms:"\uC774\uC6A9\uC57D\uAD00",privacy:"\uAC1C\uC778\uC815\uBCF4 \uCC98\uB9AC\uBC29\uCE68"},ceo:"\uB300\uD45C",address:"\uC8FC\uC18C",support:"\uACE0\uAC1D\uC13C\uD130",ceoName:"\uD55C\uC9C0\uD61C",addressValue:"\uAC15\uC6D0\uB3C4 \uCD98\uCC9C\uC2DC \uC2DC\uCCAD\uAE38 32 \uD574\uCC2C\uBE4C\uB529 3\uCE35 302\uD638"},U={trainingPhone:{topic:"\uD143\uBC2D\uAC00\uAFB8\uAE30",prev:"\uC774\uC804",next:"\uB2E4\uC74C",speed:"\uBE60\uB974\uAE30 3",noiseType:"\uC640\uAE00\uC640\uAE00",settings:"\uC124\uC815",start:{caption:"\uC544\uB798 \uD50C\uB808\uC774(\u25B6) \uBC84\uD2BC\uC744 \uB20C\uB7EC \uBB38\uC7A5\uC744 \uC798 \uB4E4\uC5B4\uBCF4\uC138\uC694. \uC798 \uB4E4\uC73C\uC2E0 \uB4A4 \uBB38\uC7A5\uC744 \uD655\uC778\uD558\uC138\uC694."},feedback:{caption:"\uC798 \uD0A4\uC6B4 \uBAA8\uC885\uC744 \uD143\uBC2D\uC5D0 \uC2EC\uACE0 \uBE44\uB2D0\uC744 \uC798 \uB36E\uC5B4 \uC90D\uB2C8\uB2E4."},done:{heardWell:"\uC798 \uB4E4\uB9B0 \uBB38\uC7A5",listenAgain:"\uD55C \uBC88 \uB354 \uB4E3\uAE30"}}},z={timeHM:"{{h}}\uC2DC {{m}}\uBD84",timeH:"{{h}}\uC2DC"},q={options:"\uD6C8\uB828 \uC635\uC158",difficulty:"\uB09C\uC774\uB3C4",exclude:"\uC81C\uC678",chosung:"\uCD08\uC131",excludeOptions:{none:"\uC5C6\uC74C",noImage:"\uC774\uBBF8\uC9C0 \uC5C6\uC74C"}},j={answer:"\uC815\uB2F5",distractor:"\uC624\uB2F5"},Q={phaseWordDownload:"\uB2E8\uC5B4 \uB370\uC774\uD130 \uB2E4\uC6B4\uB85C\uB4DC",phaseImageCheck:"\uC774\uBBF8\uC9C0 \uD655\uC778",phasePairAnalysis:"\uB2E8\uC5B4\uC30D \uBD84\uC11D",downloadingCount:"{{n}}\uAC1C \uB2E4\uC6B4\uB85C\uB4DC \uC911",checkingPage:"{{page}}\uD398\uC774\uC9C0 \uBAA9\uB85D \uD655\uC778 \uC911",imageCount:"{{done}} / {{total}}\uAC1C"},J={clearAriaLabel:"\uC785\uB825\uAC12 \uC9C0\uC6B0\uAE30"},Z={ariaLabel:"\uC120\uD0DD \uD0ED"},X={ariaLabel:"\uD0ED"},ee={dragPrompt:"\uD30C\uC77C\uC744 \uC774\uACF3\uC5D0 \uB4DC\uB798\uADF8\uD558\uC5EC \uC5C5\uB85C\uB4DC",browseButton:"\uD30C\uC77C \uC120\uD0DD",removeAriaLabel:"{{name}} \uC81C\uAC70"},te={ariaLabel:"\uC0AC\uC6A9\uC790 \uC544\uBC14\uD0C0"},ae={relativeDay:{today:"\uC624\uB298",yesterday:"\uC5B4\uC81C",daysAgo:"{{n}}\uC77C \uC804"},reason:{notLoggedIn:"\uB85C\uADF8\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4."},list:{title:"\uBC1B\uC740 \uC219\uC81C"},status:{expired:"\uB9CC\uB8CC\uB428",done:"\uC644\uB8CC {{count}}\uD68C \xB7 {{date}}",notDone:"\uBBF8\uC644\uB8CC"}},oe={weekly:{title:"\uC8FC\uAC04 \uD6C8\uB828 \uD604\uD669",daily:"\uC624\uB298\uC758 \uB4E3\uAE30",crossword:"\uAC00\uB85C\uC138\uB85C"},homework:{title:"\uC219\uC81C \uC9C4\uD589\uD604\uD669",totalRate:"\uC804\uCCB4 \uC644\uB8CC\uC728",count:"\uC804\uCCB4",done:"\uC644\uB8CC",remaining:"\uBBF8\uC644\uB8CC"},today:{tooltipTotal:"\uC804\uCCB4",tooltipDone:"\uC644\uB8CC"},filter:{countSuffix:" \uD6C8\uB828"},time:{countLabel:"{{n}}\uD68C \uD6C8\uB828",empty:"\uD6C8\uB828 \uAE30\uB85D\uC774 \uC5C6\uC2B5\uB2C8\uB2E4."},daily:{title:"\uC624\uB298\uC758 \uB4E3\uAE30 \uAE30\uB85D",empty:"\uC644\uB8CC\uD55C \uD68C\uCC28\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4."},crossword:{title:"\uAC00\uB85C\uC138\uB85C\uD034\uC988",empty:"\uC644\uB8CC\uD55C \uB808\uBCA8\uC774 \uC5C6\uC2B5\uB2C8\uB2E4"},visit:{title:"\uBC29\uBB38 \uC5F0\uB3D9 \uAE30\uB85D"},detail:"\uC0C1\uC138\uBCF4\uAE30",trainingType:{LISTEN_IN_NOISE:"\uC18C\uC74C \uD558 \uBB38\uC7A5",SHORT_STORY:"\uC9E7\uC740 \uC774\uC57C\uAE30",LONG_STORY:"\uAE34 \uC774\uC57C\uAE30",ORDERING_SENTENCE:"\uBB38\uC7A5 \uC21C\uC11C\uD654"}},ne={publish:{descPlaceholder:"\uB9D0\uADC0\uC790\uB8CC\uC2E4\uC5D0 \uD45C\uC2DC\uD560 \uD55C \uC904 \uC124\uBA85 (\uC120\uD0DD)"},import:"\uB0B4 \uD6C8\uB828\uC5D0 \uAC00\uC838\uC624\uAE30",publisher:"\uAC8C\uC2DC\uC790",time:{justNow:"\uBC29\uAE08 \uC804",minutesAgo:"{{n}}\uBD84 \uC804",hoursAgo:"{{n}}\uC2DC\uAC04 \uC804",daysAgo:"{{n}}\uC77C \uC804",weeksAgo:"{{n}}\uC8FC \uC804",monthsAgo:"{{n}}\uAC1C\uC6D4 \uC804",yearsAgo:"{{n}}\uB144 \uC804"},badge:{shared:"\uB9D0\uADC0\uC790\uB8CC\uC2E4"}},ie={manage:{unit:"\uAC74"}},re={cancelLabel:"\uCDE8\uC18C"},le={steps:"\uC9C4\uD589 \uB2E8\uACC4 {{current}} / {{total}}"},se={panelTitle:"\uD6C8\uB828 \uC624\uB2F5",viewItems:"\uBB38\uD56D",viewTypes:"\uC720\uD615",colPending:"\uB0A8\uC740 \uAC83",colTrend:"\uBCC0\uD654",colRuns:"\uD310",unitItem:"\uAC1C",skippedOnly:"\uC61B \uAE30\uB85D {{n}}\uAC74\uC740 \uBB34\uC5C7\uC744 \uD47C \uAC83\uC778\uC9C0 \uC548 \uB0A8\uC544 \uC788\uC5B4 \uC148\uC5D0\uC11C \uBE90\uC2B5\uB2C8\uB2E4.",summaryLabel:"\uC313\uC778 \uAE30\uB85D",summaryValue:"{{items}}\uBB38\uD56D \xB7 \uC544\uC9C1 \uBABB \uC7A1\uC740 \uAC83 {{pending}}\uAC1C",nextLabel:"\uB2E4\uC74C\uC5D0 \uBCFC \uAC83",nextCount:"{{count}}\uAC1C",nextCountCapped:"{{total}}\uAC1C \uC911 {{shown}}\uAC1C",picked:"\u2192 {{what}}",typeClear:"\uB2E4 \uC7A1\uC558\uC5B4\uC694",typePending:"{{total}}\uAC1C \uC911 {{pending}}\uAC1C \uB0A8\uC74C",flat:"\uBCC0\uD654 \uC5C6\uC74C",runs:"{{count}}\uD310",avgDuration:"\uD3C9\uADE0 {{sec}}\uCD08"},de={resetColumns:"\uCE78 \uB108\uBE44 \uCD08\uAE30\uD654"},ce={panelTitle:"\uB2E8\uC5B4\uD45C \uCC44\uC810",viewWords:"\uB0B1\uB9D0",viewTables:"\uD45C",colLatest:"\uB9C8\uC9C0\uB9C9",colTrend:"\uBCC0\uD654",unitTime:"\uD68C",summaryLabel:"\uC313\uC778 \uCC44\uC810",summaryValue:"{{times}}\uD68C \xB7 \uB0B1\uB9D0 {{words}}\uAC1C",nextLabel:"\uB2E4\uC74C\uC5D0 \uBCFC \uAC83",nextCount:"{{count}}\uAC1C",allClear:"\uC9C0\uB09C\uBC88\uC5D0 \uBAA8\uB450 \uB9DE\uD614\uC2B5\uB2C8\uB2E4.",times:"{{count}}\uD68C",flat:"\uBCC0\uD654 \uC5C6\uC74C",recentLabel:"\uCD5C\uADFC \uCC44\uC810",nextCountCapped:"{{total}}\uAC1C \uC911 {{shown}}\uAC1C"},ue={ariaLabel:"\uBC30\uB108",dotAriaLabel:"{{count}}\uAC1C \uC911 {{index}}\uBC88\uC9F8 \uBC30\uB108"},pe={selectYearMonth:"\uC5F0\uC6D4 \uC120\uD0DD",chooseDate:"\uB0A0\uC9DC \uC120\uD0DD"},me={previewRegion:"\uBCF4\uACE0\uC11C \uBBF8\uB9AC\uBCF4\uAE30 \u2014 \uC88C\uC6B0\uB85C \uAD74\uB824 \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4"},ge={description:"\uC124\uBA85",textbox:"\uBCF8\uBB38",training:"\uD6C8\uB828 \uC548\uB0B4",menu:"\uBA54\uB274"},he={devNone:"\uBC1C\uB2EC \uC790\uB8CC \uC5C6\uC74C",place:{labial:"\uC591\uC21C\uC74C",alveolar:"\uCE58\uC870\uC74C",palatal:"\uACBD\uAD6C\uAC1C\uC74C",velar:"\uC5F0\uAD6C\uAC1C\uC74C",glottal:"\uC131\uBB38\uC74C"}},be={clearSelection:"\uC120\uD0DD \uD574\uC81C"},ye={showResult:"{{type}} \uACB0\uACFC\uBCF4\uAE30"},Se={selected:"\uC120\uD0DD\uB428",remove:"\uC81C\uAC70",exclude:"\uC81C\uC678",nthSelected:"{{n}}\uBC88\uC9F8 \uC120\uD0DD"},ve={loading:"\uBD88\uB7EC\uC624\uB294 \uC911\u2026"},we={state:{active:"\uC18C\uB9AC \uB098\uB294 \uC911",played:"\uB4E4\uC74C",correct:"\uC815\uB2F5",wrong:"\uC624\uB2F5"}},fe={ariaLabel:"\uC774\uB3D9 \uACBD\uB85C"},Te={common:d,calendar:c,passCard:u,searchField:p,rating:m,colorPicker:g,dropdown:h,accordion:b,header:y,nav:S,settings:v,usage:w,account:f,help:T,training:L,trainingSettings:C,customers:P,payment:N,coupons:R,visits:A,company:E,trainingType:k,myWordTraining:D,myWordTable:M,keyWords:I,wordTable:O,wordSearch:_,wordPrint:x,topic:F,accessLinkManager:W,login:H,trainingPlanRun:B,device:G,manager:$,wordPairs:K,game:V,footer:Y,landing:U,date:z,trainingSetPage:q,wordTrainingPreview:j,wordData:Q,textField:J,segmentedControl:Z,tabs:X,fileUpload:ee,avatar:te,myHomework:ae,trainingStatus:oe,store:ne,homework:ie,inquiry:re,progress:le,trainingMiss:se,table:de,wordScore:ce,topBanner:ue,datePicker:pe,report:me,tooltip:ge,phonemeProfile:he,bulkBar:be,debug:ye,badge:Se,loader:ve,soundCompass:we,breadcrumb:fe},Le={statusFilter:"Filter by status",pageSizeSelect:"Items per page",selectedCount_one:"{{count}} selected",selectedCount_other:"{{count}} selected",moreFor:"More options for {{name}}",cancel:"Cancel",info:"Info",errorState:{message:"Couldn't load this.",retry:"Try again"},save:"Save",confirm:"Confirm",close:"Close",back:"Back",emptyTrainingName:"Training name is empty.",remove:"Remove",image:"Image",delete:"Delete",reset:"Reset",update:"Update",download:"Download",search:"Search",empty:"No data.",yes:"Yes",no:"No",all:"All",none:"None",days_one:"{{count}} day",days_other:"{{count}} days",loadMore:"Load More",retry:"Try Again",prevPage:"Previous page",nextPage:"Next page",play:"Play",pause:"Pause",playPause:"Play / Pause",replay:"Replay",subscription:"Subscription",done:"Done",failed:"Failed",continue:"Continue",notification:"Notice",emptyList:"No items",menu:"Menu",resetSelection:"Reset Selection",pageSizeLabel:"Show {{n}}",totalCountPrefix:"Total: ",totalCountSuffix:"",expand:"Expand",collapse:"Collapse",popup:"Popup",more:"More",codeBlock:"Code block",totalPrefix:"",copyCode:"Copy code",copied:"Copied",col:{problem:"Question"},phonetics:{place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"},vowel:{frontHigh:"Front high vowel",backHighUnrounded:"Back high unrounded vowel",backHighRounded:"Back high rounded vowel",frontMid:"Front mid vowel",backMidUnrounded:"Back mid unrounded vowel",backMidRounded:"Back mid rounded vowel",low:"Low vowel"},glide:{j:"j-glide",w:"w-glide",velar:"\u0270-glide"}},unknownError:"Unknown error",networkError:"The network connection is unstable. Check your connection and try again."},Ce={rangeSelect:"Select period",dow:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],yearMonth:"{{month}}/{{year}}",prevMonth:"Previous month",addOnDate:"Add a visit on {{date}}",nextMonth:"Next month",prevWeek:"Previous week",nextWeek:"Next week",legend:{visited:"Visited",scheduled:"Scheduled",noVisit:"No Show"},periodSelect:"Period unit"},Pe={planSuffix:"Plan",labeledPlan:"{{label}} Plan",couponCode:"Pass Code",specialLabel:"Open Special",unitDay:"d",unitYear:"yr",remainingDay:"{{n}}d left",remainingHour:"{{n}}h left",remainingMinute:"{{n}}m left",remainingSecond:"{{n}}s left",menu:{use:"Activate",refund:"Refund",delete:"Delete"}},Ne={clearAriaLabel:"Clear search"},Re={starLabel:"Select star {{n}}",valueLabel:"{{value}} out of {{max}}",groupLabel:"Rating"},Ae={selected:"selected"},Ee={placeholder:"Select"},ke={collapse:"Collapse",expand:"Expand"},De={biArea:"BI area",biSymbol:"BI symbol",logoMalgwi:"Malgwi logo",logoManager:"Malgwi Manager logo",menuOpen:"Open menu",utilMenu:"Utility menu",menuClose:"Close menu"},Me={mainMenu:"Main menu",bottomNav:"Bottom navigation",goToManager:"Go to Malgwi Manager",goToMalgwi:"Go to Malgwi",modeLabelManager:"Malgwi Manager",modeLabelMalgwi:"Malgwi",training:"Training",settings:"Settings",notifications:"Notifications",account:"Account",help:"Help",debug:"Debug",coupons:"Coupons",topic:"By Topic",trainingType:"By Training Type",wordPairs:"Word Pairs",wordSearch:"Word Search",wordTable:"Word Table Creator",company:"Company Info",more:"More",moreMenu:"More menu",badgeLabel:"{{label}}, {{count}}"},Ie={language:{training:{label:"Training Language",sub:"Language used for training words and speech"}},notifications:{title:"Notifications"},display:{fontSize:{small:"Small",large:"Large"}},cache:{title:"Cache Management",confirmMessage:"Delete cache ({{size}}). Do you want to continue?",delete:"Delete",deleting:"Deleting",cleared:"Cache cleared successfully.",group:{wordData:{label:"Word Data",sub:"Word list and version info"},pairIndex:{label:"Pair Index",sub:"Onset\xB7vowel\xB7coda minimal pair analysis cache"},imageCache:{label:"Image Cache",sub:"Word image existence check results"},trainingRecord:{label:"Training Record",sub:"Daily training progress and streak"}}},button:{save:"Save Settings"},popup:{clear:{confirm:"Reset"},update:{confirm:"Update"},cache:{title:"Delete {{label}}",message:"Delete {{label}} ({{size}}). Do you want to continue?"}},saved:"\u2713 Saved",account:{title:"Account",delete:{sub:"You can restore your account within 30 days of withdrawal."}}},Oe={addButton:"Add Subscription",couponButton:"Enter Coupon",active:{infoTitle:"Subscription Info",refund:"Request Refund",startDate:"Start Date",endDate:"End Date",remaining:"Remaining"},pending:{title:"Pending",empty:"No pending subscriptions."},loading:"Loading\u2026",segment:{personal:"Malgwi",org:"Malgwi Manager"},org:{title:"Current Plan",disc:"Subscription plan in use by your organization.",empty:"No organization plan registered.",fallbackTitle:"Organization Plan",startDate:"Start Date",endDate:"End Date",remaining:"Remaining",duration:"Duration"}},_e={profile:{planSuffix:"",plan:"Plan"},basicInfo:{name:{placeholder:"John Doe"}},security:{title:"Security",password:{label:"Password",currentRequired:"Enter your current password.",newRequired:"Enter a new password.",mismatch:"The new passwords do not match.",changed:"Your password has been changed."},twoFactor:{label:"Two-Factor Authentication",sub:"Strengthen your account security"}}},xe={guide:{faq:{title:"FAQ",desc:"View all frequently asked questions"}}},Fe={settings:"Settings",start:{title:"Start Word Training",description:"Select a training type below to begin"},difficulty:{tooltip:"The easiest difficulty is 'Random', the hardest is 'Initial Consonant Difference'."},contrast:{label:"Contrast",type:"Contrast Type",count:"Contrast Count",n:"{{n}}"},filter:{random:"Random",trainOnset:"Onset",trainVowel:"Vowel",trainCoda:"Coda",phonemeGroup:"Training phonemes",noLimit:"Any",codaExclude:"Exclude",gradeLabel:"Grade",excludeImageInfo:"Only words with images: keeps only results with a registered word image.",sameStructureInfo:"Only same phoneme structure: keeps only pairs where the correct and wrong answers share the same syllable structure (length, batchim, etc.).",selectSection:"Select",excludeImage:"Only words with images",sameStructure:"Only same phoneme structure"},noQuestions:"No questions available.",countQuestions:"{{n}} questions",countSentences:"{{n}} sentences",comingSoon:"Coming Soon",nextQuestion:"Next",noiseRatioTitle:"Noise Ratio",noiseRatioValue:"{{ratio}}\xD7",noiseTypeTitle:"Noise Type",playVolumeTitle:"Volume",playSpeedTitle:"Speed",meter:{sentence:"Playback",noise:"Noise",toggle:"Show Audio Meter"},viewResult:"View Results",problemNotice:"Problem {{n}}.",trainingSettingsTitle:"Training Settings",sentencePreview:"Sentence Preview",notHeard:"Didn't hear it.",heardWell:"Heard it well.",confirmTitle:"Check the sentence and select whether you heard it.",noSoundWaveform:"Waveform is not shown for sound-comparison questions.",noise:{level:{none:"None",weak:"Weak",medium:"Medium",strong:"Strong",veryStrong:"Very Strong"},type:{none:"None",default:"Default",street:"Street",buzz:"Buzzing",restaurant:"Restaurant"}},listenTitle:"Please listen to the sentence.",listenButton:"Listen",playSound:"Play Sound",playAll:"Play All",selectInOrder:"Select the cards in the order you heard.",stop:"Stop",preview:"Preview",next:"Next",completed:"Completed",selected:"Selected",nthSelected:"Selection {{n}}",fontSizeMin:"Font size is at the minimum.",fontSizeMax:"Font size is at the maximum.",fontSizeDecrease:"Decrease font size",fontSizeIncrease:"Increase font size",toggleBackground:"Toggle background",cardInstructions:"Look at the word card, listen to the sound, and check it.",noCards:"No cards.",audioFetchError:"Failed to load the sound source.",selectConfirm:"Look at the question and select the answer.",orderListDefault:"Arrange the sentences in the order you heard.",result:{eyebrow:"Training Complete",title:"You've finished all the training!",scoreAria:"{{correct}} / {{total}} questions",elapsed:"Time Elapsed",summary:"You heard {{correct}} item(s) correctly.",tableAriaLabel:"Per-question judgement",colJudge:"Judgement",colAnswerSelected:"Answer \xB7 Selected",colAnswer:"Answer",colSelected:"Selected",heardWell:"Heard well",notHeard:"Didn't hear",notJudged:"Not judged",replay:"Replay",done:"Done",viewResult:"View Results",noContent:"(No content)"},up:"Move up",down:"Move down",prev:"Previous",listenLabel:"Listen",sourcePlay:"Play source {{n}}",listen:"Listen",audioStatus:{idle:"Idle",resolving:"Resolving\u2026",checking_exists:"Checking file\u2026",getting_signed_url:"Getting URL\u2026",downloading:"Downloading\u2026",measuring_duration:"Measuring length\u2026",ready:"Ready",error:"Error"}},We={totalCount:" training bundles",sort:{customers:"Customers"},copyLink:"Copy Link",removeLink:"Remove Link",linkRemoved:"Link removed.",linkSaveFirst:"Please save the training bundle first.",linkSaveFirstHint:"You can only create a shared link from a saved training bundle.",linkCopySelect:"Copy blocked \u2014 link selected. Press Ctrl/\u2318+C to copy.",nameRequired:"Please enter a training bundle name.",itemRequired:"Please add at least one training item.",randomAdd:"Random Add",menu:{publish:"Post to Store",duplicate:"Duplicate Training Bundle",edit:"Edit Training Bundle",move:"Move Group",rename:"Rename"},itemCount:"Number of Items",renameGroup:"Rename Group"},He={totalCount:" customers",loadError:"Failed to load list",basicInfo:{editTooltip:"Edit"},member:{placeholder:"Email or phone",link:"Link",linking:"Linking\u2026"},device:{title:"Hearing Devices",addTooltip:"Add New",addButton:"Add device",listTooltip:"View List",listTitle:" Device List",historyEmpty:"No device history registered",wearing:" in use",notRegistered:"Not registered",unit:"",wearingNow:"In use",wear:"Wear",unwear:"Remove",wornSince:"Since {{date}}",release:"Release",historyTitle:"Hearing device history"},schedule:{title:"Upcoming Visits",addTooltip:"Add Schedule",listTooltip:"View All",empty:"No upcoming visits",registerTitle:" Register Schedule",memoPlaceholder:"Enter a memo for this visit."},visitHistory:{title:"Visit History",addTooltip:"Add Visit",empty:"No visit history yet",popupTitle:" Visit History",registerTitle:" Register Visit"},moreItems:"more",viewAll:"View All",visits:{title:"Visits"},trainingRecord:{title:"Customer Training Records"},status:{trainingSubtitle:"Training Status"},detail:{session:{completedFmt:"Done {{done}}/{{total}} \xB7 {{duration}}"},visitSuffix:" visits"},homework:{active:"Active",copied:"Link copied.",copy:"Copy Link",inactive:"Inactive",title:"Homework Progress"},duration:{minSec:"{{m}}m {{s}}s",min:"{{m}}m",sec:"{{s}}s"}},Be={plan:{recommendedFor:"Recommended for",features:"Key Features",freePrice:"Free",contact:"Contact Us",tierFallback:"Plan",openPromo:"Launch offer"},products:{mgrEnterprise:{tier:{price:"Contact us"}}}},Ge={title:"Coupons",subtitle:"Enter a coupon code or view your coupons",input:{label:"Coupon code",placeholder:"Enter coupon code"},applyButton:"Apply",error:{invalid:"Invalid coupon code.",alreadyUsed:"This coupon has already been used."},success:{applied:'"{{name}}" coupon applied.'},section:{owned:"My Coupons"},status:{used:"Used",available:"Available"}},$e={unitVisit:"",periodAll:"All",showN:"Show {{n}}"},Ke={subtitle:"Manage company and business information",editButton:"Edit Info",basicInfo:{title:"Basic Info"},contactInfo:{title:"Contact Info"}},Ve={title:"Training by Type",subtitle:"Select the training type you want",listenInNoise:{title:"Sentence Listening in Noise",desc:"Train sentence comprehension in various noise environments."},shortStory:{title:"Short Story Listening",desc:"Listen to short stories and understand the content."},longStory:{title:"Long Story Listening",desc:"Focus on listening to long stories and grasp the content."},orderingSentence:{title:"Sentence Ordering",desc:"Arrange heard sentences in the correct order."},SAME_SOUND_PICK:{label:"Listen & Pick Same Sound",sub:"Pick the word card that matches what you heard."},SAME_OR_DIFF:{label:"Same or Different?",sub:"Decide whether the two sounds are the same or different."},HEAR_AND_PICK_SAME:{label:"Hear & Match Word",sub:"Pick the word card that matches the sound you heard."},HEAR_AND_PICK_INCLUDED:{label:"Find Word Containing Sound",sub:"Pick the word card that contains the syllable you heard."},STARTS_WITH_SAME_SOUND:{label:"Find Word Starting with Same Sound",sub:"Pick a word that starts with the same sound as what you heard."},LISTEN_AND_REMEMBER_ORDER:{label:"Listen & Recall Order",sub:"Select the cards in the order you heard the three words."},MERGE_2_SYLLABLES:{label:"Combine 2 Syllables",sub:"What word do two syllables make?"},MERGE_3_SYLLABLES:{label:"Combine 3 Syllables",sub:"What word do three syllables make?"},MERGE_2_PHONEMES:{label:"Combine 2 Phonemes",sub:"What sound do two phonemes make?"},MERGE_3_PHONEMES:{label:"Combine 3 Phonemes",sub:"What sound do three phonemes make?"},DROP_1_FROM_2SYLL:{label:"Drop 1 Syllable from 2-Syllable",sub:"What sound remains when you remove a syllable from a 2-syllable word?"},DROP_1_FROM_3SYLL:{label:"Drop 1 Syllable from 3-Syllable",sub:"What sound remains when you remove a syllable from a 3-syllable word?"},DROP_PART_FROM_COMPOUND:{label:"Drop Part of Compound Word",sub:"What word remains when you remove part of a compound word?"},DROP_FINAL_CONSONANT_FROM_1SYLL:{label:"Drop Final Consonant",sub:"What sound remains when you remove the final consonant?"},REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:{label:"Drop Consonant",sub:"What sound remains when you remove the consonant?"},CHANGE_1_SYLL_IN_2SYLL:{label:"Change 1 Syllable (2-Syllable)",sub:"Change one syllable in a 2-syllable word to make a new word."},CHANGE_1_SYLL_IN_3SYLL:{label:"Change 1 Syllable (3-Syllable)",sub:"Change one syllable in a 3-syllable word to make a new word."},CHANGE_1_PHONEME_IN_1SYLL:{label:"Change 1 Phoneme (1-Syllable)",sub:"Change one phoneme in a 1-syllable word to make a new sound."},CHANGE_1_PHONEME_IN_2SYLL:{label:"Change 1 Phoneme (2-Syllable)",sub:"Change one phoneme in a 2-syllable word to make a new word."}},Ye={comingSoon:"Word training is coming soon."},Ue={colName:"Table Name",open:"Open",countSuffix:" tables",addCard:"Add Word Table Card",cardsEmpty:"No word table cards created yet.",menu:{publishStore:"Post to Training Store",unpublishStore:"Remove from Training Store"},newBadge:"Newly created",tab:{cards:"Word Table Cards",tables:"Word Tables"},publishedBadge:"Published",sharedBadge:"Shared"},ze={title:"Key Words",empty:"No key words available."},qe={defaultName:"Word Table",title:"Word Table Builder",subtitle:"Set columns and add words to build a table.",filterTitle:"Table Settings",filter:{composition:"Composition",image:"Image",word:"Word",standardPron:"Standard Pronunciation",colloquialPron:"Colloquial Pronunciation",paperOrientation:"Paper Orientation",landscape:"Landscape",portrait:"Portrait",columns:"Columns",column:"{{count}} col",itemsPerPageWord:"Words per page",itemsPerPagePair:"Pairs per page",itemsPerPageOption:"{{count}}",pageIndicator:"{{current}} / {{total}}",pageNumber:"Page Number",pageNumberLeft:"Left",pageNumberCenter:"Center",pageNumberRight:"Right",border:"Border",cutLine:"Cut Line",show:"Show",hide:"Hide",dotted:"Dotted",corner:"Corner"},addWord:"Add",wordInfo:"Info for {{word}}",emptyItems:"Please add at least one word.",load:"Load",openNewWindow:"Open in New Window",saveButton:"Save",saveAsNewButton:"Save as New",print:"Print",popupBlocked:"Popup was blocked. Please allow popups in your browser settings.",printFileNameSingle:"Word Table",printFileNamePair:"Contrast Pair Table",save:{title:"Save Word Table",nameLabel:"Name",desc:"Enter a name for the word table.",placeholder:"Enter a title for this word table.",descriptionLabel:"Description",descriptionPlaceholder:"Enter a description for this word table.",duplicateName:"This name is already in use.",nameRequired:"Please enter a table name.",autoFillHint:" (Press Tab or Space to autofill)",copyName:"{{name}} (copy)"},loadTable:{title:"Load Saved Word Table",empty:"No saved word tables.",loadButton:"Load",itemCount:"{{count}} words",deleteAriaLabel:"Delete",sort:{newest:"Newest",oldest:"Oldest",name:"Name",count:"Word Count"},view:{grid:"Grid View",list:"List View"}},groupDeleteMessage:"Word tables in this group will be moved to 'No Group'.",groupNamePlaceholder:"Group name",store:{badge:"Training Store"},card:{sub:"Word Table Card",empty:"No word tables in this card."},toast:{renameError:"Failed to rename",saveError:"Failed to save",deleteError:"Failed to delete",duplicateError:"Failed to duplicate",saveSuccess:"Word table saved."},scoring:{o:"{{word}} correct",triangle:"{{word}} partial",x:"{{word}} incorrect",button:"Score",pickTitle:"Who are you scoring?",pickSubtitle:"Choose the customer who trained with \u201C{{name}}\u201D.",pickSearch:"Search by name or phone",pickEmpty:"No customers registered.",pickNoMatch:"No matching customer.",pickAgain:"Choose another",scoringFor:"Scoring {{name}}",none:"Tap a cell to mark \u25CB \xB7 \u25B3 \xB7 \u2715.",tally:"{{marked}} scored \xB7 \u25CB {{o}} \xB7 \u25B3 {{triangle}} \xB7 \u2715 {{x}} \xB7 {{rate}}%",save:"Save score",saved:"Saved {{count}} marks for {{name}}.",reviewTitle:"Create a review table?",reviewMessage:"Builds a new table from the {{count}} cells {{name}} got wrong or partial. Correct ones are left out.",reviewConfirm:"Create review table",reviewDescription:"Cells marked wrong or partial in \u201C{{name}}\u201D \u2014 {{count}} of them.",reviewCreated:"Created \u201C{{name}}\u201D \u2014 {{count}} cells.",discardTitle:"Discard this scoring?",discardMessage:"You marked {{count}} cells but have not saved. Leaving discards them.",discardConfirm:"Discard and leave"},info:{grade:"Grade: {{n}}",syllables:"Syllables: {{n}}",pos:"Part of speech: {{v}}",wordType:"Type: {{v}}"},pos:{noun:"Noun",verb:"Verb",adjective:"Adjective",adverb:"Adverb",numeral:"Numeral",determiner:"Determiner",interjection:"Interjection",particle:"Particle",affix:"Affix",dependentNoun:"Dependent noun",pronoun:"Pronoun",auxVerb:"Auxiliary verb",auxAdjective:"Auxiliary adjective"}},je={editBanner:{message:"Saving will update the word table you're editing."},filterTitle:"Word Search Settings",filter:{positionAny:"Any",positionHead:"Start",positionMid:"Middle",positionTail:"End",difficulty:"Grade",grade:"Grade {{n}}",syllables:"Syllables",syllable:"{{n}} Syll.",syllable5plus:"5+ Syllables",partOfSpeech:"Part of Speech",pos:{noun:"Noun/Numeral",verb:"Verb/Adjective",modifier:"Adverb/Determiner"},wordType:"Word Type",type:{native:"Native Korean",sino:"Sino-Korean",foreign:"Loanword",mixed:"Hybrid"},exclude:"Exclude",excludeNoImage:"No Image"},searchButton:"Search",resultUnit:"words",remaining:"{{count}} remaining",resultDisc:"Select {{unit}}. Up to {{max}} items. ({{selected}}/{{max}})",resultTitlePrefix:"",resultTitleSuffix:" {{unit}} found.",emptyResult:"No results found.",groupCount:"{{count}}",sort:{aria:"Sort",match:"Best Match",ganada:"A\u2013Z \u2191",ganadaDesc:"A\u2013Z \u2193",syllable:"Syllables \u2191",syllableDesc:"Syllables \u2193",grade:"Grade \u2191",gradeDesc:"Grade \u2193"},pageSize:"Show {{count}}",pageSizeAria:"Page size",popup:{title:"Select a word for cell {{n}}"}},Qe={clearAllSelection:"Clear All Selections",divLine:"Contrast Line",removePair:"Remove pair",removeWord:"Remove word"},Je={title:"By Topic",subtitle:"Select a topic to start listening training",noiseTitle:"Sentence Listening in Noise",shortStoryTitle:"Short Story Listening",FOOD:"Food",HLTH:"Health",WETH:"Weather",PRSN:"People",KRCT:"Korean Culture",STRY:"Stories",LOCA:"Locations",SOAR:"Society & Arts",NTSC:"Nature & Science",SPRT:"Sports",sub:{TRKRFD:"Traditional Korean Food",MDKRFD:"Modern Korean Food",WRLDFD:"World Cuisine",MTRFRT:"Ingredients & Fruits",GEFDKL:"Food Facts",HTETHB:"Healthy Eating",DISILL:"Diseases",EXCISE:"Exercise",GEHTKL:"Health Facts",GESSKL:"Seasons",SNWRAN:"Snow & Rain",WTHFCT:"Weather Forecast",GEWTKL:"Weather Facts",JODYPS:"Joseon Dynasty",MDKRPS:"Modern Korea",THKDPS:"Three Kingdoms",WRLART:"World Artists",WRLPSN:"World Figures",KRLANG:"Korean Language",TRPLCT:"Traditional Games",HERITG:"Heritage",EVTFES:"Events & Festivals",GECTKL:"General Knowledge",FRYTAL:"Fairy Tales",AMZING:"Amazing Stories",DAYSTR:"Everyday Stories",KRLDMK:"Korean Landmarks",SELNMK:"Seoul Landmarks",WRDTRB:"World Travel",NAVIGT:"Navigation",KRSOCI:"Korea",ECONEW:"Economy & News",GENART:"Arts",GELFKL:"Life Tips",ANIMAL:"Animals",PLANTS:"Plants",ETHPLT:"Earth",TOLELC:"Tools & Electronics",GESCKL:"Science Facts",INVDSP:"Individual Sports",MARART:"Martial Arts",TEAMSP:"Team Sports",FOOTBL:"Soccer",GESPKL:"Sports Facts"}},Ze={maxUses:"Max uses (leave blank for unlimited)",redirect:"Redirect URL (leave blank for app home)",creating:"Creating\u2026",create:"Create link",created:"\u2713 Link created",copied:"Copied!",copy:"Copy",loading:"Loading\u2026",empty:"No links created yet.",uses:"Used {{count}} times",expiresAt:"Expires: {{date}}",createdAt:"Created: {{date}}",confirmDelete:"Delete this link?",deactivate:"Deactivate",delete:"Delete",status:{active:"Active",expired:"Expired",inactive:"Inactive"}},Xe={passwordPlaceholder:"Enter password"},et={direction:{left:"L",right:"R",label:"Side"},wornDate:"Date Worn",deviceType:"Device Type",brand:"Brand",fitType:"Fit Type",productName:"Product Name",validationError:{brandAndProduct:"Please enter brand and product name."},addNew:"Add New Device",selectFromList:"Select from List",removeDevice:"Remove",type:{hearingAid:"Hearing Aid",cochlearImplant:"Cochlear Implant"}},tt={stat:{totalCustomers:"Total Customers",monthlyVisits:"This Month's Visits"},chart:{visitDetail:"Visit Details",trainingDetail:"Training Details",weekly:"Weekly",daily:"Daily",periodMonth:"Month",periodWeek:"Week",weeklyPrefix:"Weekly",monthlyPrefix:"Monthly",visit:"Visits",reservation:"Reservations",trainingDone:"Completed",trainingInProgress:"In Progress",weekRange:"{{start}}\u2013{{end}}",week:"W{{n}}"},subscriptionStatus:{active:"{{pct}}% Active",expired:"{{pct}}% Expired",unused:"{{pct}}% Unused"}},at={editBanner:{message:"Saving will update the contrast pair table you're editing."},phonemeSelect:{title:"Phoneme Selection",vs:"vs"},caution:"Caution",mode:{include:"Phoneme Include",pick:"Phoneme Contrast",contrast:"Specify Contrast",infoTitle:"Contrast Mode",infoInclude:"Include \u2014 finds words containing all selected phonemes, plus their minimal pair.",infoPick:"Contrast \u2014 matches only if the selected phoneme is the actual point of difference in the pair.",infoContrast:"Specify Contrast \u2014 directly choose phonemes for the base word and the contrasting word to find pairs."},count:"{{n}}",input:{char:"Choose Letters",pron:"Choose Sound",infoTitle:"Input mode",infoChar:"Choose Letters \u2014 finds words by the selected phonemes (spelling), then finds their standard-pronunciation contrast pairs.",infoPron:"Choose Sound \u2014 finds standard-pronunciation contrast pairs directly from the selected phonemes."},phonemeN:"Syllable {{n}}",phonemeSingleLabel:"Syllable",phonemeContrastSingleLabel:"Contrast Syllable",ordinals:["First","Second","Third","Fourth"],phonemeOrdinalLabel:"{{ordinal}} Syllable",phonemeContrastOrdinalLabel:"Contrast {{ordinal}} Syllable",composition:"Answer Word Composition",syllableCount:"Syllables",syllableN:"{{n}} syll.",syllableNPlus:"{{n}}+ syll.",onset:"Onset",vowel:"Vowel",coda:"Coda",filter:{searchOptionsTitle:"Contrast Settings",searchModeLabel:"Contrast Mode",countLabel:"Input Syllable Count",inputModeLabel:"Input mode",phonemeOrder:"Input Syllable Position",phonemeOrderInfo:["Match: the pair must differ at exactly the same position (syllable).","Any: the differing position doesn't matter."],orderAny:"Any",orderMatch:"Match",difficultyInfo:"Reflects the National Institute of Korean Language's basic vocabulary grade.",selectLabel:"Select",onlyHasImage:"Only words with images",onlySameStructure:"Only same phoneme structure"},searchLabel:{error:"Failed to load data",loading:"Loading\u2026"},confirmMessage:"The word table with {{count}} selected {{unit}} will be lost.",resetOptions:"Reset Options",phonemeContrast:"Contrast Syllable {{n}}",infoNotes:["The preview character is an example of the selected phoneme combination. The actual search covers all words containing the phoneme.","Initial consonant '\u3147' cannot be selected. \u3147 at the start of a word is effectively silent.","If only onset and coda are selected, the vowel is automatically displayed as '\u314F'.","Increasing the phoneme count searches for minimal pairs between each phoneme."]},ot={sentenceTyping:{roundCount:"{{rounds}} rounds \xB7 {{timeLimit}}s each"},wordDefense:{me:"Me"},dictation:{title:"Dictation",desc:"Practice writing down exactly what you hear.",comingSoon:"Coming soon: audio playback, input field, answer comparison"},result:{heading:"Level {{number}} Answer",retry:"Try Again"},common:{accuracy:"{{pct}}% accuracy"},soundMatch:{title:"Sound Match",desc:"Quickly match words or sentences that share the same sound.",comingSoon:"Coming soon: play button, timer, score tracking"},orderSequence:{title:"Sentence Ordering",desc:"Arrange scattered sentence fragments in the correct order.",comingSoon:"Coming soon: sentence sets, ordering interface"},speedListen:{title:"Speed Listen",desc:"A challenge game to count the number of words in a sentence within a time limit.",comingSoon:"Coming soon: time limit, scoreboard"},noiseChallenge:{title:"Noise Challenge",desc:"Practice distinguishing sentences amid background noise.",comingSoon:"Coming soon: various noise levels, score tracking"},fastListen:{title:"Fast Listen",desc:"Listen to short sentences at speed and select the key word.",comingSoon:"Coming soon: speed by difficulty, timer"},shadowing:{title:"Shadowing",desc:"Practice pronunciation and intonation by repeating sentences aloud.",comingSoon:"Coming soon: playback, recording, comparison feedback"},phonemeHunt:{title:"Phoneme Hunt",desc:"Find words that contain a specific phoneme (sound).",comingSoon:"Coming soon: phoneme filter, hint feature"}},nt={lead:`IHAB builds trust
4
4
  through sound
5
- and aids recovery.`,site:{title:"Site",malgwi:"Malgwi",soundDirection:"Sound Direction System",vrSoundDirection:"VR Sound Direction System",hearingTest:"Hearing Test Pro"},sns:{title:"SNS",naverBlog:"Naver Blog",kakao:"KAKAO Talk Open Chat"},policy:{title:"Policy",terms:"Terms of Service",privacy:"Privacy Policy"},ceo:"CEO",address:"Address",support:"Support",ceoName:"Ji-hye Han",addressValue:"302, 3F, Haechan Bldg, 32 Siocheong-gil, Chuncheon, Gangwon, Korea"},it={trainingPhone:{topic:"Gardening",prev:"Prev",next:"Next",speed:"Speed 3",noiseType:"Crowd noise",settings:"Settings",start:{caption:"Press the play (\u25B6) button below and listen carefully. After listening, check the sentence."},feedback:{caption:"Plant the well-grown seedlings in the garden bed and cover them carefully with plastic film."},done:{heardWell:"Heard clearly",listenAgain:"Listen again"}}},rt={timeHM:"{{hh}}:{{mm}}",timeH:"{{hh}}:{{mm}}"},lt={options:"Training Options",difficulty:"Difficulty",exclude:"Exclude",chosung:"Initial Consonant",excludeOptions:{none:"None",noImage:"No Image"}},st={answer:"Answer",distractor:"Distractor"},dt={phaseWordDownload:"Download Word Data",phaseImageCheck:"Check Images",phasePairAnalysis:"Analyze Word Pairs",downloadingCount:"Downloading {{n}} words",checkingPage:"Checking page {{page}} list",imageCount:"{{done}} / {{total}} items"},ct={clearAriaLabel:"Clear input"},ut={ariaLabel:"Select tab"},pt={ariaLabel:"Tabs"},mt={dragPrompt:"Drag and drop files here",browseButton:"Choose Files",removeAriaLabel:"Remove {{name}}"},gt={ariaLabel:"User avatar"},ht={relativeDay:{today:"Today",yesterday:"Yesterday",daysAgo:"{{n}}d ago"},reason:{notLoggedIn:"Login required."},list:{title:"Received Homework"},status:{expired:"Expired",done:"Done {{count}}\xD7 \xB7 {{date}}",notDone:"Not done"}},bt={weekly:{title:"Weekly Training",daily:"Daily Listening",crossword:"Crossword"},homework:{title:"Homework Progress",totalRate:"Overall rate",count:"Total",done:"Done",remaining:"Remaining"},today:{tooltipTotal:"Total",tooltipDone:"Done"},filter:{countSuffix:" sessions"},time:{countLabel:"{{n}} sessions",empty:"No training records"},daily:{title:"Today's Listening Record",empty:"No completed sessions"},crossword:{title:"Crossword Quiz",empty:"No completed levels"},visit:{title:"Linked Visit Records"},detail:"Details",trainingType:{LISTEN_IN_NOISE:"Sentence in Noise",SHORT_STORY:"Short Story",LONG_STORY:"Long Story",ORDERING_SENTENCE:"Sentence Ordering"}},yt={import:"Add to my trainings",publisher:"Publisher",time:{justNow:"just now",minutesAgo:"{{n}}m ago",hoursAgo:"{{n}}h ago",daysAgo:"{{n}}d ago",weeksAgo:"{{n}}w ago",monthsAgo:"{{n}}mo ago",yearsAgo:"{{n}}y ago"},badge:{shared:"Store"},publish:{descPlaceholder:"One-line description for the Training Store (optional)"}},St={manage:{unit:"item(s)"}},vt={cancelLabel:"Cancel"},wt={subtitle:"Select a topic to start listening practice."},ft={steps:"Step {{current}} of {{total}}"},Tt={panelTitle:"Training misses",viewItems:"Items",viewTypes:"Types",colPending:"Left",colTrend:"Change",colRuns:"Runs",unitItem:" items",skippedOnly:"{{n}} older record(s) were excluded \u2014 they do not say what was answered.",summaryLabel:"Recorded",summaryValue:"{{items}} items \xB7 {{pending}} still missed",nextLabel:"Next to work on",nextCount:"{{count}}",nextCountCapped:"{{shown}} of {{total}}",picked:"\u2192 {{what}}",typeClear:"All caught up",typePending:"{{pending}} of {{total}} left",flat:"no change",runs:"{{count}} run(s)",avgDuration:"{{sec}}s avg"},Lt={resetColumns:"Reset column widths"},Ct={panelTitle:"Word table scores",viewWords:"Words",viewTables:"Tables",colLatest:"When",colTrend:"Change",unitTime:" times",summaryLabel:"Scored",summaryValue:"{{times}} times \xB7 {{words}} words",nextLabel:"Focus next",nextCount:"{{count}}",allClear:"All correct last time.",times:"{{count}}x",flat:"no change",recentLabel:"Recent scorings",nextCountCapped:"{{shown}} of {{total}}"},Pt={ariaLabel:"Banner",dotAriaLabel:"Banner {{index}} of {{count}}"},Nt={selectYearMonth:"Select year and month",chooseDate:"Choose a date"},Rt={previewRegion:"Report preview \u2014 scrollable sideways"},At={description:"Description",textbox:"Text",training:"Training guide",menu:"Menu"},Et={devNone:"No acquisition data",place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"}},kt={clearSelection:"Clear selection"},Dt={showResult:"Show {{type}} result"},Mt={selected:"Selected",remove:"Remove",exclude:"Excluded",nthSelected:"Selection {{n}}"},It={loading:"Loading"},Ot={state:{active:"playing",played:"heard",correct:"correct",wrong:"wrong"}},_t={ariaLabel:"Breadcrumb"},xt={common:Le,calendar:Ce,passCard:Pe,searchField:Ne,rating:Re,colorPicker:Ae,dropdown:Ee,accordion:ke,header:De,nav:Me,settings:Ie,usage:Oe,account:_e,help:xe,training:Fe,trainingSettings:We,customers:He,payment:Be,coupons:Ge,visits:$e,company:Ke,trainingType:Ve,myWordTraining:Ye,myWordTable:Ue,keyWords:ze,wordTable:qe,wordSearch:je,wordPrint:Qe,topic:Je,accessLinkManager:Ze,login:Xe,device:et,manager:tt,wordPairs:at,game:ot,footer:nt,landing:it,date:rt,trainingSetPage:lt,wordTrainingPreview:st,wordData:dt,textField:ct,segmentedControl:ut,tabs:pt,fileUpload:mt,avatar:gt,myHomework:ht,trainingStatus:bt,store:yt,homework:St,inquiry:vt,trainingPlanRun:wt,progress:ft,trainingMiss:Tt,table:Lt,wordScore:Ct,topBanner:Pt,datePicker:Nt,report:Rt,tooltip:At,phonemeProfile:Et,bulkBar:kt,debug:Dt,badge:Mt,loader:It,soundCompass:Ot,breadcrumb:_t};const Ft="0.145.0",n=[{code:"ko",label:"\uD55C\uAD6D\uC5B4"},{code:"en",label:"English"}],a="ko",o="ihab_display_language";function i(){try{const e=localStorage.getItem(o);if(e&&n.some(l=>l.code===e))return e}catch{}return a}function Wt(e){try{localStorage.setItem(o,e)}catch{}}function r(e){try{document.documentElement.lang=e}catch{}}t.on("languageChanged",r),r(i()),t.use(s.initReactI18next).init({resources:{ko:{translation:Te},en:{translation:xt}},lng:i(),fallbackLng:a,interpolation:{escapeValue:!1},react:{useSuspense:!1}}),exports.default=t,exports.CORE_VERSION=Ft,exports.DEFAULT_LOCALE=a,exports.LOCALE_STORAGE_KEY=o,exports.SUPPORTED_LOCALES=n,exports.saveLocale=Wt;
5
+ and aids recovery.`,site:{title:"Site",malgwi:"Malgwi",soundDirection:"Sound Direction System",vrSoundDirection:"VR Sound Direction System",hearingTest:"Hearing Test Pro"},sns:{title:"SNS",naverBlog:"Naver Blog",kakao:"KAKAO Talk Open Chat"},policy:{title:"Policy",terms:"Terms of Service",privacy:"Privacy Policy"},ceo:"CEO",address:"Address",support:"Support",ceoName:"Ji-hye Han",addressValue:"302, 3F, Haechan Bldg, 32 Siocheong-gil, Chuncheon, Gangwon, Korea"},it={trainingPhone:{topic:"Gardening",prev:"Prev",next:"Next",speed:"Speed 3",noiseType:"Crowd noise",settings:"Settings",start:{caption:"Press the play (\u25B6) button below and listen carefully. After listening, check the sentence."},feedback:{caption:"Plant the well-grown seedlings in the garden bed and cover them carefully with plastic film."},done:{heardWell:"Heard clearly",listenAgain:"Listen again"}}},rt={timeHM:"{{hh}}:{{mm}}",timeH:"{{hh}}:{{mm}}"},lt={options:"Training Options",difficulty:"Difficulty",exclude:"Exclude",chosung:"Initial Consonant",excludeOptions:{none:"None",noImage:"No Image"}},st={answer:"Answer",distractor:"Distractor"},dt={phaseWordDownload:"Download Word Data",phaseImageCheck:"Check Images",phasePairAnalysis:"Analyze Word Pairs",downloadingCount:"Downloading {{n}} words",checkingPage:"Checking page {{page}} list",imageCount:"{{done}} / {{total}} items"},ct={clearAriaLabel:"Clear input"},ut={ariaLabel:"Select tab"},pt={ariaLabel:"Tabs"},mt={dragPrompt:"Drag and drop files here",browseButton:"Choose Files",removeAriaLabel:"Remove {{name}}"},gt={ariaLabel:"User avatar"},ht={relativeDay:{today:"Today",yesterday:"Yesterday",daysAgo:"{{n}}d ago"},reason:{notLoggedIn:"Login required."},list:{title:"Received Homework"},status:{expired:"Expired",done:"Done {{count}}\xD7 \xB7 {{date}}",notDone:"Not done"}},bt={weekly:{title:"Weekly Training",daily:"Daily Listening",crossword:"Crossword"},homework:{title:"Homework Progress",totalRate:"Overall rate",count:"Total",done:"Done",remaining:"Remaining"},today:{tooltipTotal:"Total",tooltipDone:"Done"},filter:{countSuffix:" sessions"},time:{countLabel:"{{n}} sessions",empty:"No training records"},daily:{title:"Today's Listening Record",empty:"No completed sessions"},crossword:{title:"Crossword Quiz",empty:"No completed levels"},visit:{title:"Linked Visit Records"},detail:"Details",trainingType:{LISTEN_IN_NOISE:"Sentence in Noise",SHORT_STORY:"Short Story",LONG_STORY:"Long Story",ORDERING_SENTENCE:"Sentence Ordering"}},yt={import:"Add to my trainings",publisher:"Publisher",time:{justNow:"just now",minutesAgo:"{{n}}m ago",hoursAgo:"{{n}}h ago",daysAgo:"{{n}}d ago",weeksAgo:"{{n}}w ago",monthsAgo:"{{n}}mo ago",yearsAgo:"{{n}}y ago"},badge:{shared:"Store"},publish:{descPlaceholder:"One-line description for the Training Store (optional)"}},St={manage:{unit:"item(s)"}},vt={cancelLabel:"Cancel"},wt={subtitle:"Select a topic to start listening practice."},ft={steps:"Step {{current}} of {{total}}"},Tt={panelTitle:"Training misses",viewItems:"Items",viewTypes:"Types",colPending:"Left",colTrend:"Change",colRuns:"Runs",unitItem:" items",skippedOnly:"{{n}} older record(s) were excluded \u2014 they do not say what was answered.",summaryLabel:"Recorded",summaryValue:"{{items}} items \xB7 {{pending}} still missed",nextLabel:"Next to work on",nextCount:"{{count}}",nextCountCapped:"{{shown}} of {{total}}",picked:"\u2192 {{what}}",typeClear:"All caught up",typePending:"{{pending}} of {{total}} left",flat:"no change",runs:"{{count}} run(s)",avgDuration:"{{sec}}s avg"},Lt={resetColumns:"Reset column widths"},Ct={panelTitle:"Word table scores",viewWords:"Words",viewTables:"Tables",colLatest:"When",colTrend:"Change",unitTime:" times",summaryLabel:"Scored",summaryValue:"{{times}} times \xB7 {{words}} words",nextLabel:"Focus next",nextCount:"{{count}}",allClear:"All correct last time.",times:"{{count}}x",flat:"no change",recentLabel:"Recent scorings",nextCountCapped:"{{shown}} of {{total}}"},Pt={ariaLabel:"Banner",dotAriaLabel:"Banner {{index}} of {{count}}"},Nt={selectYearMonth:"Select year and month",chooseDate:"Choose a date"},Rt={previewRegion:"Report preview \u2014 scrollable sideways"},At={description:"Description",textbox:"Text",training:"Training guide",menu:"Menu"},Et={devNone:"No acquisition data",place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"}},kt={clearSelection:"Clear selection"},Dt={showResult:"Show {{type}} result"},Mt={selected:"Selected",remove:"Remove",exclude:"Excluded",nthSelected:"Selection {{n}}"},It={loading:"Loading"},Ot={state:{active:"playing",played:"heard",correct:"correct",wrong:"wrong"}},_t={ariaLabel:"Breadcrumb"},xt={common:Le,calendar:Ce,passCard:Pe,searchField:Ne,rating:Re,colorPicker:Ae,dropdown:Ee,accordion:ke,header:De,nav:Me,settings:Ie,usage:Oe,account:_e,help:xe,training:Fe,trainingSettings:We,customers:He,payment:Be,coupons:Ge,visits:$e,company:Ke,trainingType:Ve,myWordTraining:Ye,myWordTable:Ue,keyWords:ze,wordTable:qe,wordSearch:je,wordPrint:Qe,topic:Je,accessLinkManager:Ze,login:Xe,device:et,manager:tt,wordPairs:at,game:ot,footer:nt,landing:it,date:rt,trainingSetPage:lt,wordTrainingPreview:st,wordData:dt,textField:ct,segmentedControl:ut,tabs:pt,fileUpload:mt,avatar:gt,myHomework:ht,trainingStatus:bt,store:yt,homework:St,inquiry:vt,trainingPlanRun:wt,progress:ft,trainingMiss:Tt,table:Lt,wordScore:Ct,topBanner:Pt,datePicker:Nt,report:Rt,tooltip:At,phonemeProfile:Et,bulkBar:kt,debug:Dt,badge:Mt,loader:It,soundCompass:Ot,breadcrumb:_t};const Ft="0.146.0",n=[{code:"ko",label:"\uD55C\uAD6D\uC5B4"},{code:"en",label:"English"}],a="ko",o="ihab_display_language";function i(){try{const e=localStorage.getItem(o);if(e&&n.some(l=>l.code===e))return e}catch{}return a}function Wt(e){try{localStorage.setItem(o,e)}catch{}}function r(e){try{document.documentElement.lang=e}catch{}}t.on("languageChanged",r),r(i()),t.use(s.initReactI18next).init({resources:{ko:{translation:Te},en:{translation:xt}},lng:i(),fallbackLng:a,interpolation:{escapeValue:!1},react:{useSuspense:!1}}),exports.default=t,exports.CORE_VERSION=Ft,exports.DEFAULT_LOCALE=a,exports.LOCALE_STORAGE_KEY=o,exports.SUPPORTED_LOCALES=n,exports.saveLocale=Wt;