@ihabdevteam/core 0.121.0 → 0.123.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.
- package/CHANGELOG.md +36 -0
- package/dist/components.cjs.js +176 -176
- package/dist/components.esm.css +1 -1
- package/dist/hooks.cjs.js +1 -1
- package/dist/i18n.cjs.js +1 -1
- package/dist/ihabdevteam-core.cjs.js +181 -181
- package/dist/ihabdevteam-core.d.ts +5 -4
- package/dist/packages/core/src/components/Training/AudioPlayerWaveForm.js +1 -1
- package/dist/packages/core/src/components/Training/NoisePlayerContext.d.ts +9 -4
- package/dist/packages/core/src/components/Training/NoisePlayerContext.js +36 -7
- package/dist/packages/core/src/components/Training/NoiseSettingsTooltip.css +5 -5
- package/dist/packages/core/src/components/Training/TrainingStepAudioPlayer.js +50 -11
- package/dist/packages/core/src/components/Training/useTTSPlayback.d.ts +1 -0
- package/dist/packages/core/src/types/training.d.ts +4 -3
- package/dist/packages/core/src/version.d.ts +1 -1
- package/dist/packages/core/src/version.js +1 -1
- package/dist/utils.cjs.js +1 -1
- package/package.json +1 -1
package/dist/hooks.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var i=require("react"),Se=require("react-i18next"),ru=typeof document<"u"?document.currentScript:null;function xt({storageKey:e="fontScale",baseFont:u=20,minScale:t=.8,maxScale:n=1.4,step:o=.1,lineHeightRatio:l=1.4}={}){const a=E=>Math.max(t,Math.min(n,Number(E))),[r,c]=i.useState(()=>{try{const E=localStorage.getItem(e),h=E?Number(E):1;return Number.isFinite(h)?h:1}catch{return 1}});i.useEffect(()=>{try{localStorage.setItem(e,String(r))}catch{}},[e,r]);const C=E=>{c(typeof E=="function"?h=>a(E(h)):a(E))},d=()=>C(E=>+(E+o).toFixed(6)),f=()=>C(E=>+(E-o).toFixed(6)),s=r<n-Number.EPSILON,g=r>t+Number.EPSILON,p=Math.round(u*r),w=Math.round(p*l);return{scale:r,setScale:C,increase:d,decrease:f,canIncrease:s,canDecrease:g,fontSize:p,lineHeight:w}}const Iu=i.createContext(null);function vt(e){return/max-width:\s*7[0-9][0-9]px/.test(e)}function Ft(e){const u=i.useContext(Iu),t=l=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(l).matches,[n,o]=i.useState(t(e));return i.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const l=window.matchMedia(e),a=c=>o(c.matches),r=l;return r.addEventListener?r.addEventListener("change",a):r.addListener&&r.addListener(a),o(l.matches),()=>{r.removeEventListener?r.removeEventListener("change",a):r.removeListener&&r.removeListener(a)}},[e]),u&&typeof u.mobile=="boolean"&&vt(e)?u.mobile:n}function Ru(e){const u=i.useRef(e);return i.useEffect(()=>{u.current=e}),u}function Lu(e,u){const t=Ru(u);i.useEffect(()=>{const n=()=>t.current();try{window.addEventListener(e,n)}catch{}return()=>{try{window.removeEventListener(e,n)}catch{}}},[e,t])}const au=" \xB7 ",Mu=(()=>{if(typeof document>"u")return"";const e=document.title;return e.includes(au)?e.split(au).pop()??e:e})(),ku=i.createContext(!1);function Vt(e){const u=i.useContext(ku);i.useEffect(()=>{if(u||typeof e!="string"||!e)return;const t=document.title;return document.title=Mu?`${e}${au}${Mu}`:e,()=>{document.title=t}},[e,u])}function Ht(){const{t:e}=Se.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])}function $t(e){const[u,t]=i.useState({current:"",next:"",confirm:""}),[n,o]=i.useState(null),[l,a]=i.useState(!1),r=i.useRef(null);i.useEffect(()=>()=>{r.current!==null&&clearTimeout(r.current)},[]);const c=i.useCallback(()=>{t({current:"",next:"",confirm:""}),o(null)},[]),C=i.useCallback(async()=>{if(!u.current){o({type:"error",text:"\uD604\uC7AC \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC138\uC694."});return}if(!u.next){o({type:"error",text:"\uC0C8 \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC138\uC694."});return}if(u.next!==u.confirm){o({type:"error",text:"\uC0C8 \uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."});return}a(!0);const d=e?await e(u.current,u.next):null;if(a(!1),d){o({type:"error",text:d});return}o({type:"success",text:"\uBE44\uBC00\uBC88\uD638\uAC00 \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4."}),t({current:"",next:"",confirm:""}),r.current!==null&&clearTimeout(r.current),r.current=setTimeout(()=>o(null),1500)},[u,e]);return{pw:u,setPw:t,pwMsg:n,setPwMsg:o,pwLoading:l,handleChangePw:C,reset:c}}const q=["\u3131","\u3132","\u3134","\u3137","\u3138","\u3139","\u3141","\u3142","\u3143","\u3145","\u3146","\u3147","\u3148","\u3149","\u314A","\u314B","\u314C","\u314D","\u314E"],ae=["\u314F","\u3150","\u3151","\u3152","\u3153","\u3154","\u3155","\u3156","\u3157","\u3158","\u3159","\u315A","\u315B","\u315C","\u315D","\u315E","\u315F","\u3160","\u3161","\u3162","\u3163"],Q=["","\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 V(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 Gt(){const e=new Map;return u=>{let t=e.get(u);return t||(t=[...u].map(n=>V(n)),e.set(u,t)),t}}function de(e,u,t=0){return String.fromCharCode(44032+(e*21+u)*28+t)}function Yt(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 l=V(e[o]),a=V(u[o]);if(!l||!a)return"random";if(l.cho===a.cho&&l.jung===a.jung&&l.jong===a.jong)continue;t++;const r=l.cho!==a.cho,c=l.jung!==a.jung,C=l.jong!==a.jong;(r?1:0)+(c?1:0)+(C?1:0)>1?n="multi":r?n="cho":c?n="jung":n="jong"}return t!==1?"random":n==="cho"?"cho":n==="jung"?"jung":n==="jong"?"jong":"random"}const we={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(we).map(([e,u])=>[u.join(""),Q[Number(e)]]));function Ut(e,u){if(!e||!u)return!1;for(const t of e){const n=V(t);if(n){if(q[n.cho]===u)return!0;if(n.jong>0){if(Q[n.jong]===u)return!0;const o=we[n.jong];if(o&&o.includes(u))return!0}}}return!1}function He(e){if(!e)return 0;let u=0;for(const t of e)V(t)&&u++;return u}function Kt(e){if(!e)return!1;let u=!1;for(const t of e){const n=V(t);if(n&&(u=!0,n.jong>0))return!1}return u}function Wt(e,u){if(e.jong<=0)return!1;if(u.includes(Q[e.jong]))return!0;const t=we[e.jong];return!!t&&t.some(n=>u.includes(n))}function qt(e,u,t){if(!e)return!1;const n=[...e],o=l=>{const a=V(n[l]);if(!a||u.cho&&!u.cho.includes(q[a.cho])||u.jung&&!u.jung.includes(ae[a.jung]))return!1;if(u.jongNone){if(a.jong>0)return!1}else if(u.jong&&!Wt(a,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 l=1;l<n.length-1;l++)if(o(l))return!0;return!1}for(let l=0;l<n.length;l++)if(o(l))return!0;return!1}const zt={cho:q.length,jung:ae.length,jong:Q.length};function Jt(e,u,t,n,o=1/0){if(!e||t<1)return[];const l=[...e].map(f=>V(f));if(l.some(f=>!f))return[];const a=l,r=a.length;if(t>r)return[];const c=zt[u],C=new Set,d=[];(function f(s,g){if(g.length===t){d.push([...g]);return}for(let p=s;p<r;p++)g.push(p),f(p+1,g),g.pop()})(0,[]);for(const f of d)if((function s(g,p){if(C.size>=o)return;if(g===f.length){const h=p.map(S=>de(S.cho,S.jung,S.jong)).join("");h!==e&&n.has(h)&&C.add(h);return}const w=f[g],E=a[w][u];for(let h=0;h<c;h++){if(h===E)continue;const S=p.slice();if(S[w]={...p[w],[u]:h},s(g+1,S),C.size>=o)return}})(0,a),C.size>=o)break;return[...C]}function Zt(e,u){if(!e||!u||e.length!==u.length)return-1;let t=0;for(let n=0;n<e.length;n++){const o=V(e[n]),l=V(u[n]);if(!o||!l)return-1;o.cho!==l.cho&&t++,o.jung!==l.jung&&t++,o.jong!==l.jong&&t++}return t}const Pu="word_pair_index_v2",xu="word_pair_index_sig_v2";let be=null;function Qt(){try{if(typeof localStorage>"u")return null;const e=localStorage.getItem(Pu),u=localStorage.getItem(xu);return!e||!u?null:{index:JSON.parse(e),sig:u}}catch{return null}}function Ae(){if(be)return be;const e=Qt();return e?(be=e.index,e.sig,be):null}function Xt(){be=null;try{typeof localStorage<"u"&&(localStorage.removeItem(Pu),localStorage.removeItem(xu))}catch{}}const vu="word_image_existence_map_v1";let Ee=null;function Fu(){if(Ee)return Ee;try{const e=typeof localStorage<"u"?localStorage.getItem(vu):null;Ee=e?JSON.parse(e):{}}catch{Ee={}}return Ee}function en(e,u){return`${e}_${u??1}`}function un(e,u){const t=Fu(),n=en(e,u);return n in t?t[n]:void 0}function Vu(){const e=Fu(),u=Object.values(e);return u.length===0?null:{total:u.length,exists:u.filter(Boolean).length}}function tn(){Ee={};try{typeof localStorage<"u"&&localStorage.removeItem(vu)}catch{}}const Hu=[{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 $u(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 nn(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 on(e){const{t:u}=Se.useTranslation(),[t,n]=i.useState({}),[o,l]=i.useState(null),[a,r]=i.useState(null),[c,C]=i.useState(null),d=i.useCallback(()=>{const s={};Hu.forEach(g=>{s[g.id]=$u([...g.keys])}),n(s),typeof navigator<"u"&&navigator.storage?.estimate&&navigator.storage.estimate().then(g=>{C({usage:g.usage??0,quota:g.quota??0})}).catch(()=>{})},[]);i.useEffect(()=>{d()},[d]);const f=i.useCallback(async s=>{l(s);try{s==="wordData"?(localStorage.removeItem("word_data_cache"),localStorage.removeItem("word_data_version")):s==="pairIndex"?Xt():s==="imageCache"&&tn(),d(),e?.(u("settings.cache.cleared","\uCE90\uC2DC\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4."))}finally{l(null)}},[d,e,u]);return{cacheSizes:t,clearingId:o,confirmCacheId:a,setConfirmCacheId:r,storageEstimate:c,refreshCacheSizes:d,handleClearCache:f}}function ln(e){const[u,t]=i.useState(null),[n,o]=i.useState(null),l=i.useCallback(()=>{const a=Ae();if(a){const c=Object.values(a),C=c.filter(d=>d.cho.length+d.jung.length+d.jong.length>0).length;t({matched:C,total:c.length})}else t(null);const r=Vu();o(r?{exists:r.exists,total:r.total}:null)},[]);return i.useEffect(()=>{l();const a=setTimeout(l,1e3);return()=>clearTimeout(a)},[e?.length,l]),{pairStats:u,imgStats:n,setPairStats:t,setImgStats:o,refreshStats:l}}function Gu(e,u=[]){const[t,n]=i.useState(u),[o,l]=i.useState(null),[a,r]=i.useState(!1),[c,C]=i.useState(e),d=i.useRef(a);i.useEffect(()=>{d.current=a});const f=i.useRef(null);i.useEffect(()=>{if(d.current)return;const h=f.current;h!==null&&h.length===u.length&&h.every((S,B)=>S===u[B])||(f.current=u,n(u))},[u]);const s=i.useCallback(h=>{l(h),r(!1),C({...h})},[]),g=i.useCallback(()=>r(!0),[]),p=i.useCallback(()=>r(!1),[]),w=i.useCallback((h,S)=>{n(h),l(S),r(!1)},[]),E=i.useCallback(h=>{n(S=>S.filter(B=>B!==h)),l(null)},[]);return{list:t,setList:n,selected:o,setSelected:l,isEditing:a,setIsEditing:r,editForm:c,setEditForm:C,openDetail:s,startEditing:g,cancelEditing:p,commitEdit:w,remove:E}}const _e=()=>{const e=new Date;return{year:String(e.getFullYear()),month:String(e.getMonth()+1).padStart(2,"0"),day:String(e.getDate()).padStart(2,"0")}},rn={year:"",month:"",day:"",hour:"09",minute:"00",memo:""};function an(e=[]){const{list:u,setList:t,selected:n,setSelected:o,isEditing:l,setIsEditing:a,editForm:r,setEditForm:c,openDetail:C,commitEdit:d}=Gu(rn,e),{year:f,month:s,day:g}=_e(),[p,w]=i.useState({year:f,month:s,day:g,hour:"09",minute:"00",memo:""});return{visitHistory:u,visitForm:p,setVisitForm:w,setVisit:E=>h=>w(S=>({...S,[E]:h})),selectedVisit:n,setSelectedVisit:o,isEditingVisit:l,setIsEditingVisit:a,editVisitForm:r,setEditVisitForm:c,openVisitDetail:C,handleVisitSave:E=>{t(A=>[p,...A]);const{year:h,month:S,day:B}=_e();w({year:h,month:S,day:B,hour:"09",minute:"00",memo:""}),E?.()},handleVisitEditSave:()=>{d(E=>E.map(h=>h===n?r:h),r)},addVisit:E=>{t(h=>[E,...h])},removeVisit:E=>{t(h=>h.filter(S=>S!==E))},revertVisitEdit:(E,h)=>{t(S=>S.map(B=>B===h?E:B)),o(S=>S===h?E:S)}}}const Yu=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")}`,$e=e=>[...e].sort((u,t)=>{const n=Yu(u),o=Yu(t);return n<o?-1:n>o?1:0}),sn={year:"",month:"",day:"",hour:"09",minute:"00",memo:""};function cn(e,u=[]){const t=i.useMemo(()=>$e(u),[u]),{list:n,setList:o,selected:l,setSelected:a,isEditing:r,setIsEditing:c,editForm:C,setEditForm:d,openDetail:f,commitEdit:s,remove:g}=Gu(sn,t),[p,w]=i.useState([]),{year:E,month:h,day:S}=_e(),[B,A]=i.useState({year:E,month:h,day:S,hour:"09",minute:"00",memo:""}),D=T=>P=>A(G=>({...G,[T]:P})),b=T=>{o(le=>$e([...le,B]));const{year:P,month:G,day:X}=_e();A({year:P,month:G,day:X,hour:"09",minute:"00",memo:""}),T?.()},I=()=>{s(T=>$e(T.map(P=>P===l?C:P)),C)},L=i.useCallback(T=>{g(T)},[g]),F=i.useCallback(T=>{e({year:T.year,month:T.month,day:T.day,hour:T.hour,minute:T.minute,memo:T.memo}),g(T)},[e,g]),j=i.useCallback(T=>{o(P=>P.filter(G=>G!==T)),w(P=>[T,...P]),a(null)},[o,a]),H=i.useCallback(T=>{o(P=>$e([...P,T]))},[o]),k=i.useCallback(T=>{o(P=>P.filter(G=>G!==T))},[o]),v=i.useCallback((T,P)=>{o(G=>G.map(X=>X===P?T:X)),a(G=>G===P?T:G)},[o,a]);return{scheduleList:n,noShowList:p,addSchedule:H,removeSchedule:k,revertScheduleEdit:v,scheduleForm:B,setScheduleForm:A,setSchedule:D,selectedSchedule:l,setSelectedSchedule:a,isEditingSchedule:r,setIsEditingSchedule:c,editScheduleForm:C,setEditScheduleForm:d,openScheduleDetail:f,handleScheduleSave:b,handleScheduleEditSave:I,handleScheduleDelete:L,handleScheduleToVisit:F,handleScheduleNoVisit:j}}const iu=[{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 Cn(e){const[u,t]=i.useState(""),[n,o]=i.useState("25"),[l,a]=i.useState("all"),[r,c]=i.useState(1),C=i.useMemo(()=>e.filter(({item:g,status:p})=>!(u&&!g.memo.includes(u)||l!=="all"&&p!==l)),[e,u,l]),d=Math.max(1,Math.ceil(C.length/Number(n))),f=Math.min(r,d),s=i.useMemo(()=>C.slice((f-1)*Number(n),f*Number(n)),[C,f,n]);return{vapSearch:u,setVapSearch:t,vapPageSize:n,setVapPageSize:o,vapStatus:l,setVapStatus:a,vapPage:f,setVapPage:c,vapFiltered:C,vapTotal:d,vapPageItems:s}}function dn(e,u,t){const{t:n}=Se.useTranslation(),[o,l]=i.useState(()=>{const p=t?.initialPageSize;return p&&iu.some(w=>w.value===p)?p:"25"}),[a,r]=i.useState(1),[c,C]=i.useState(u);c!==u&&(C(u),a!==1&&r(1));const d=i.useMemo(()=>iu.map(p=>({...p,label:n("visits.showN",{n:p.value})})),[n]),f=i.useCallback(p=>{l(p),r(1)},[]),s=Math.max(1,Math.ceil(e.length/Number(o))),g=Math.min(a,s);return{pageRows:i.useMemo(()=>e.slice((g-1)*Number(o),g*Number(o)),[e,g,o]),pageSizeProps:{options:d,value:o,onChange:f},paginationProps:{page:g,total:s,onChange:r},setPage:r}}function fn(){const[e,u]=i.useState(null),t=i.useCallback(o=>{u(l=>l?.key===o?{key:o,asc:!l.asc}:{key:o,asc:!0})},[]),n=i.useCallback((o,l)=>({label:o,sortDir:e?.key===l?e.asc?"asc":"desc":null,onClick:()=>t(l)}),[e,t]);return{\uC815\uB82C:e,\uCE78:n}}function gn(){const[e,u]=i.useState(!1),[t,n]=i.useState("\uC88C"),[o,l]=i.useState({\uC88C:null,\uC6B0:null}),[a,r]=i.useState({\uC88C:[],\uC6B0:[]}),[c,C]=i.useState(!1),[d,f]=i.useState("\uC88C"),s=i.useCallback(p=>{const w=p.direction;l(E=>({...E,[w]:p})),r(E=>({...E,[w]:[p,...E[w]]})),u(!1)},[]),g=i.useCallback(p=>{const w=p.direction;l(E=>({...E,[w]:p})),C(!1)},[]);return{showDevice:e,setShowDevice:u,deviceDirection:t,setDeviceDirection:n,devices:o,setDevices:l,deviceHistory:a,setDeviceHistory:r,showDeviceList:c,setShowDeviceList:C,listForSide:d,setListForSide:f,handleDeviceSubmit:s,handleSelectFromList:g}}const hn="__ihab_core_word_pool__";function Ge(){return globalThis[hn]??null}function x(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 ie(e,u,t=Math.random){return!Array.isArray(e)||e.length===0||u<=0?[]:u>=e.length?x(e,t):x(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"}},mn=q.indexOf("\u3147"),Uu={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!==mn},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}},pn={\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"},Sn={\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 Ku(e){return pn[e]??e}const cu={cho:q,jung:ae,jong:Q},K=e=>Array.isArray(e)?e.length>0:!!e;function Cu(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 En(e,u,t){const n=t.pronOf(e),o=t.decompOf,l=t.sameStructureOnly&&o?o(n):null,a=[];for(const r of u)r!==e&&(t.okSet&&!t.okSet.has(r)||t.pronOf(r)!==n&&(l&&o&&Cu(l,o(t.pronOf(r)))||a.push(r)));return a}function Wu(e,u,t){const n=u?.[e];if(!n)return[];const o=t.kind?n[t.kind]??[]:[...n.cho??[],...n.jung??[],...n.jong??[]];return En(e,o,t)}function yn(e,u,t,n,o,l,a){const r=["cho","jung","jong"].filter(s=>K(e[s])),c={};for(const s of r){const g=e[s];c[s]=new Set(Array.isArray(g)?g:[g])}const C=o==="pron",d=new Map;for(const s of u){const g=t(l(s));if(g.some(h=>!h))continue;let p=g;if(!C&&(p=t(s),p.length!==g.length||p.some(h=>!h)))continue;const w=g.length,E=d.get(w);E?E.push({w:s,dPron:g,dPos:p}):d.set(w,[{w:s,dPron:g,dPos:p}])}const f=new Map;for(const[s,g]of d){const p=new Map,w=(E,h)=>{const S=E.dPos[h];return S!=null&&r.every(B=>c[B].has(cu[B][S[B]]))};for(const E of g){let h;if(a==="head")h=w(E,0)?0:-1;else if(a==="tail")h=w(E,s-1)?s-1:-1;else if(a==="mid"){h=-1;for(let B=1;B<s-1;B++)if(w(E,B)){h=B;break}}else h=E.dPos.findIndex(B=>B!=null&&r.every(A=>c[A].has(cu[A][B[A]])));if(h<0)continue;const S=p.get(h);S?S.push(E):p.set(h,[E])}for(const[E,h]of p){const S=new Set(r.map(D=>E+":"+D)),B=D=>{let b="";for(let I=0;I<s;I++){const L=D[I];for(const F of["cho","jung","jong"])b+=(S.has(I+":"+F)?"*":L[F])+"."}return b},A=new Map;for(const D of g){const b=B(D.dPron),I=A.get(b);I?I.push(D):A.set(b,[D])}for(const D of h){const b=A.get(B(D.dPron))??[],I=[];for(const L of b){if(L.w===D.w)continue;let F=!0;for(const j of r){const H=D.dPron[E][j],k=L.dPron[E][j];if(k===H){F=!1;break}if(C&&c[j].has(cu[j][k])){F=!1;break}}F&&(n&&Cu(D.dPron,L.dPron)||I.push(L.w))}f.set(D.w,I)}}}return f}const Bn=e=>e==null?[]:Array.isArray(e)?e:[e];function wn(e){if([...e].length!==1)return"";const u=V(e);if(!u)return"";const t=Ku(Q[u.jong]),n=t===""?0:Q.indexOf(t);return de(u.cho,u.jung,n<0?0:n)}function qu(e,u){return u.get(e)||wn(e)||e}function du(e){return e?K(e.cho)?"cho":K(e.jung)?"jung":K(e.jong)?"jong":null:null}function ye(e,u){const t=(n,o)=>!K(n)||Bn(n).includes(o);return t(u.cho,q[e.cho])&&t(u.jung,ae[e.jung])&&t(u.jong,Q[e.jong])}function De(e,u,t){const n=[...e];if(t!=="pron")return n.map(l=>V(l));const o=[...u.get(e)||e];return o.length!==n.length?n.map(l=>V(l)):o.map(l=>V(l))}function Oe(e,u,t,n,o){const l=u==="cho"?q:u==="jung"?ae:Q,a=e[u],r=[],c=new Set([qu(t,o)]),C=x(l.map((d,f)=>f).filter(d=>d!==a&&(u!=="cho"||l[d]!=="\u3147")&&(u!=="jong"||d!==0)));for(const d of C){if(r.length>=n)break;const f=u==="cho"?de(d,e.jung,e.jong):u==="jung"?de(e.cho,d,e.jong):de(e.cho,e.jung,d),s=qu(f,o);c.has(s)||(c.add(s),r.push(f))}return r}function bn(e,u,t,n,o,l=null){const a=[...e];if(a.length!==2)return null;const r=a.map(f=>V(f));if(r.some(f=>!f))return null;const c=De(e,t,n);if(c.some(f=>!f))return null;const C=du(u);let d=C&&u?c.map((f,s)=>ye(f,u)?s:-1).filter(f=>f>=0):[0,1];if(l!=null&&(d=d.filter(f=>f!==l)),!d.length)return null;for(const f of x(d)){const s=a[f];if(!o.has(s))continue;const g=Oe(r[f],C??"cho",s,40,t),p=[];for(const w of g)if(w!==s&&o.has(w)&&!p.includes(w)&&p.push(w),p.length>=2)break;if(!(p.length<2))return{question:e,distractors:[s,...p]}}return null}function An(e,u,t,n,o,l=null){const a=[...e];if(a.length!==3)return null;const r=a.map(f=>V(f));if(r.some(f=>!f))return null;const c=De(e,t,n);if(c.some(f=>!f))return null;const C=du(u),d=C&&u?c.map((f,s)=>ye(f,u)?s:-1).filter(f=>f>=0):[0,1,2];if(!d.length)return null;for(const f of x(d))for(const s of x([0,1,2].filter(g=>g!==f&&(l==null||g===l)))){const g=[0,1,2].filter(S=>S!==s),p=g.map(S=>a[S]).join("");if(!o.has(p))continue;const w=g.indexOf(f),E=Oe(r[f],C??"cho",a[f],40,t),h=[];for(const S of E){const B=g.map(D=>a[D]);B[w]=S;const A=B.join("");if(A!==p&&o.has(A)&&!h.includes(A)&&h.push(A),h.length>=2)break}if(!(h.length<2))return{question:e,distractors:[p,...h]}}return null}function _n(e,u,t,n,o,l=null){const a=[...e],r=a.length;if(r<2)return null;const c=[];for(let d=1;d<=r-1;d++)c.push({remain:a.slice(0,d).join(""),dropped:a.slice(d).join(""),droppedEnd:1}),c.push({remain:a.slice(r-d).join(""),dropped:a.slice(0,r-d).join(""),droppedEnd:0});const C=du(u);for(const{remain:d,dropped:f,droppedEnd:s}of x(c)){if(l!=null&&s!==l||d===e||!o.has(d)||!o.has(f))continue;const g=[...d],p=g.map(h=>V(h));if(p.some(h=>!h))continue;const w=De(d,t,n);if(w.some(h=>!h))continue;const E=C&&u?w.map((h,S)=>ye(h,u)?S:-1).filter(h=>h>=0):g.map((h,S)=>S);if(E.length)for(const h of x(E)){const S=Oe(p[h],C??"cho",g[h],40,t),B=[];for(const A of S){const D=[...g];D[h]=A;const b=D.join("");if(b!==d&&o.has(b)&&!B.includes(b)&&B.push(b),B.length>=2)break}if(B.length>=2)return{question:e,distractors:[d,...B]}}}return null}function Dn(e,u,t,n,o,l=null){if([...e].length!==1)return null;const a=V(t.get(e)||e);if(!a||a.jong===0)return null;const r=de(a.cho,a.jung,0),c=Oe({cho:a.cho,jung:a.jung,jong:0},"cho",r,2,t);return c.length<2?null:{question:e,distractors:[r,...c]}}const fu=q.indexOf("\u3147");function On(e,u,t,n,o,l=null){if([...e].length!==1)return null;const a=V(t.get(e)||e);if(!a||a.jong!==0||a.cho===fu)return null;const r=de(fu,a.jung,0),c=Oe({cho:fu,jung:a.jung,jong:0},"jung",r,2,t);return c.length<2?null:{question:e,distractors:[r,...c]}}function Nn(e){const u=new Map;for(const t of e){const n=[...t],o=n.length;if(!(o<2||o>3))for(let l=0;l<o;l++){let a=o+"|"+l+"|";for(let c=0;c<o;c++)a+=c===l?"*":n[c];const r=u.get(a);r?r.push(t):u.set(a,[t])}}return u}function Tn(e,u,t,n,o,l=null,a=null,r=2){const c=[...e],C=c.length;if(C<2||C>3)return null;const d=c.map(S=>V(S));if(d.some(S=>!S))return null;const f=De(e,t,n);if(f.some(S=>!S))return null;const s=S=>t.get(S)??S,g=s(e),p=!!u&&(K(u.cho)||K(u.jung)||K(u.jong)),w=!!a&&(K(a.cho)||K(a.jung)||K(a.jong)),E=S=>{let B=C+"|"+S+"|";for(let A=0;A<C;A++)B+=A===S?"*":c[A];return B};let h;if(l!=null){if(l>=C||p&&!ye(f[l],u))return null;h=[l]}else p?h=f.map((S,B)=>ye(S,u)?B:-1).filter(S=>S>=0):h=Array.from({length:C},(S,B)=>B);for(const S of x(h)){const B=o.get(E(S))??[],A=[],D=[];for(const j of B){if(j===e)continue;const H=[...j].map(P=>V(P)),k=d[S],v=H[S];if(!k||!v)continue;let T=0;if(k.cho!==v.cho&&T++,k.jung!==v.jung&&T++,k.jong!==v.jong&&T++,!(T<r||s(j)===g))if(w){const P=De(j,t,n)[S];P&&ye(P,a)?A.push(j):D.push(j)}else A.push(j)}if(!A.length)continue;const b=x(A)[0],I=[],L=new Set([g,s(b)]),F=w?D:A.filter(j=>j!==b);for(const j of x(F)){const H=s(j);if(!L.has(H)&&(L.add(H),I.push(j),I.length>=2))break}if(!w&&I.length<2)for(const j of x(B)){if(j===e||j===b)continue;const H=s(j);if(!L.has(H)&&(L.add(H),I.push(j),I.length>=2))break}if(!(I.length<2))return{question:e,distractors:[b,...I]}}return null}let Ye=null,zu=null,Ju=null;function jn(){const e=Ge();if(e&&e.entries.length>0){const u=Ae();if(Ye&&zu===e&&Ju===u)return Ye;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 Ye=n,zu=e,Ju=u,Ye}return[]}const ue=new Proxy([],{get(e,u){const t=jn(),n=t[u];return typeof n=="function"?n.bind(t):n}});function Ue(e){return e.length?e[Math.floor(Math.random()*e.length)]:void 0}function te(e,u){if(u>=e.length)return x(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)),l=t[n];t[n]=t[o],t[o]=l}return t.slice(0,u)}let gu=null,Zu=null;function fe(){const e=Ge();if(gu&&Zu===e)return gu;const u=new Map;for(const t of ue)t.w&&u.set(t.w,t.pron);return gu=u,Zu=e,u}function J(e){return fe().get(e)||e}function hu(e,u,t=new Set){const n=[];for(const o of x(e)){if(n.length>=u)break;const l=J(o);t.has(l)||(t.add(l),n.push(o))}return n}let In=0;function z(e){return`${e}-rt-${++In}`}function Ne(e){const u=Vu();if(!u||u.total===0){const n=new Set;for(const o of e)n.add(o);return n}const t=new Set;for(const n of e)un(n)===!0&&t.add(n);return t}const Ke=new Map;let Qu=null,Xu=null;function Te(e){return e==null?"":Array.isArray(e)?e.slice().sort().join(","):e}function et(e){const u=Te(e.choseong),t=e.composition,n=t?.syllable==null?"":Array.isArray(t.syllable)?t.syllable.slice().sort().join(","):String(t.syllable),o=t?`${Te(t.cho)}/${Te(t.jung)}/${Te(t.jong)}/${t.jongNone?"N":""}/${n}`:"",l=Te(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${l}|t${e.targetSyllable??""}|c${e.choicesPerItem??""}`}async function Z(e){const u=Ge(),t=Ae();(u!==Qu||t!==Xu)&&(Ke.clear(),Qu=u,Xu=t);const n=et(e);return Ke.has(n)||Ke.set(n,Ln(e)),Ke.get(n)}function Rn(e){if(!e)return null;const u=a=>a==null?null:Array.isArray(a)?a.length?a:null:[a],t=u(e.cho),n=u(e.jung),o=!!e.jongNone,l=o?null:u(e.jong);return t||n||l||o?o&&!t&&!n&&!l?a=>Kt(a):a=>qt(a,{cho:t,jung:n,jong:l,jongNone:o}):null}async function Ln(e){const{difficulty:u=null,choseong:t=null,composition:n=null,targetSyllable:o=null,excludeNoImage:l=!1}=e,a=e.grade&&e.grade.length>0?new Set(e.grade):null,r=e.sameStructureOnly??!0,c=e.phonemeView==="pron"?"pron":"char",C=Math.max(1,e.contrastCount??1),d=u==="cho"||u==="jung"||u==="jong",f=d&&C>=2,s=u==="count",g=t?new Set(Array.isArray(t)?t:[t]):null,p=n?.syllable!=null?new Set(Array.isArray(n.syllable)?n.syllable:[n.syllable]):null,w=n?[Rn(n),p?y=>p.has(He(y)):null].filter(y=>y!=null):[],E=u==="random"||u===null,h=E||s,S=E||f||s;let B=ue.filter(y=>!y.w||a&&(!y.grade||!a.has(y.grade))?!1:S?!0:Array.isArray(y.p)&&y.p.length>0);g&&(B=B.filter(y=>{for(const _ of g)if(Ut(y.w,_))return!0;return!1})),w.length>0&&(B=B.filter(y=>{const _=c==="pron"?J(y.w):y.w;return w.every(Y=>Y(_))})),o&&(B=B.filter(y=>y.w[0]===o));let A;if(l){const y=new Set;for(const _ of B)if(y.add(_.w),Array.isArray(_.p))for(const Y of _.p)y.add(Y);if(h)for(const _ of ue)_.w&&y.add(_.w);A=Ne(y)}else{const y=new Set;for(const _ of B)if(y.add(_.w),Array.isArray(_.p))for(const Y of _.p)y.add(Y);if(h)for(const _ of ue)_.w&&y.add(_.w);A=y}let D=null;if(f){const y=new Set;for(const _ of ue)_.w&&y.add(_.w);D=l?Ne(y):y}const b=B.filter(y=>A.has(y.w)),I=600,L=Array.from(A),F=L.length>I?te(L,I):L,j=s&&n!=null&&(K(n.cho)||K(n.jung)||K(n.jong)),H=2500,k=new Map;if(s&&!j&&C>=2){for(const y of L){const _=He(y),Y=k.get(_);Y?Y.push(y):k.set(_,[y])}for(const[y,_]of k)_.length>H&&k.set(y,te(_,H))}const v=Gt(),T=j?yn(n,L,v,r,c,J):null,P=500,G=1500,X=e.fullCount?b:u==="random"?b.length>P?te(b,P):b:b.length>G?te(b,G):b,le=Ae(),re=[];for(const y of X){let _;const Y=J(y.w);if(f)_=Jt(y.w,u,C,D,24).filter($=>J($)!==Y);else if(s)j?_=(T.get(y.w)??[]).filter($=>J($)!==Y):C<=1?_=Wu(y.w,le,{okSet:A,pronOf:J,decompOf:v,sameStructureOnly:!1}):_=(k.get(He(y.w))??[]).filter($=>{if($===y.w||J($)===Y)return!1;const ee=Zt(y.w,$);return C>=5?ee>=5:ee===C});else if(E)_=F.filter($=>$!==y.w&&$.length===y.w.length&&J($)!==Y);else{const $=u;_=Wu(y.w,le,{kind:$,okSet:A,pronOf:J,decompOf:v,sameStructureOnly:!1}),_.length===0&&(_=(F.length>30?te(F,30):F).filter(ee=>ee!==y.w&&Yt(y.w,ee)===u&&J(ee)!==Y))}if(r&&_.length>0&&(d||s&&!j)){const $=v(J(y.w));_=_.filter(ee=>!Cu($,v(J(ee))))}_.length!==0&&re.push({word:y,usable:_})}return re}async function ut(e,u){const{choicesPerItem:t=3,count:n=10}=u,o=t-1,l=(await Z(u)).filter(r=>r.usable.length>=o),a=[];for(const r of x(l)){if(a.length>=n)break;const c=hu(r.usable,o);if(c.length<o)continue;const C=x([r.word.w,...c]);a.push({id:z(e+"-item"),index:a.length+1,word:r.word.w,syllables:r.word.s,choices:C,answerIndex:C.indexOf(r.word.w)})}return a}async function Mn(e){const{choicesPerItem:u=3,count:t=10}=e,n=u-1,o=await Z({...e,difficulty:null});if(o.length<u)return[];const l=[],a=x([...o]);for(const r of a){if(l.length>=t)break;const c=r.word.w,C=[...r.word.pron||c],d=Ue(C);if(!d)continue;const f=o.filter(p=>p.word.w!==c&&p.word.s===r.word.s&&!(p.word.pron||p.word.w).includes(d)&&p.word.pron!==r.word.pron);if(f.length<n)continue;const s=hu(f.map(p=>p.word.w),n);if(s.length<n)continue;const g=x([c,...s]);l.push({id:z("HPI-item"),index:l.length+1,targetSyllable:d,word:c,choices:g,answerIndex:g.indexOf(c)})}return l}async function kn(e){const{count:u=10}=e,t=(await Z(e)).filter(n=>n.usable.length>=1);return Array.from({length:u},(n,o)=>{const l=Ue(t);if(!l)return null;const a=o%2===0;let r;if(a)r=[l.word.w,l.word.w];else{const c=Ue(l.usable);r=Math.random()<.5?[l.word.w,c]:[c,l.word.w]}return{id:z("SOD-item"),index:o+1,word:l.word.w,pair:r,same:a}}).filter(n=>!!n)}async function Pn(e){const{choicesPerItem:u=3,count:t=10}=e,n=u-1,o=await Z({...e,difficulty:null});if(o.length<u+1)return[];const l=o.map(s=>s.word.w),a=new Map(o.map(s=>[s.word.w,s.word.pron])),r=s=>(a.get(s)||s)[0]??"",c={};for(const s of o){const g=r(s.word.w);g&&(c[g]||(c[g]=[]),c[g].push(s.word.w))}const C=Object.entries(c).filter(([,s])=>s.length>=2).map(([s])=>s);if(C.length===0)return[];const d=[],f=x([...C]);for(let s=0;d.length<t&&s<t*4;s++){const g=f[s%f.length],p=c[g];if(p.length<2)continue;const w=x([...p]),E=w[0],h=w[1];if(!E||!h||E===h||(a.get(E)||E)===(a.get(h)||h))continue;const S=a.get(h)||h,B=l.filter(b=>r(b)!==g&&b!==E&&b!==h&&b.length===h.length&&(a.get(b)||b)!==S);if(B.length<n)continue;const A=hu(B,n);if(A.length<n)continue;const D=x([h,...A]);d.push({id:z("SWS-item"),index:d.length+1,sourceWord:E,targetSyllable:g,word:h,choices:D,answerIndex:D.indexOf(h)})}return d}function tt(e,u,t){return te(e,u).map((n,o)=>{const l=Ue(n.usable)??"",a=[...n.word.w],r=[...l],c=a.findIndex((d,f)=>d!==r[f]),C=x(n.usable.filter(d=>d&&d!==l)).slice(0,2);return{id:z(t),index:o+1,word:n.word.w,original:n.word.w,changed:l,changedFrom:c>=0?a[c]:"",changedTo:c>=0?r[c]:"",distractors:C}})}async function nt(e,u,t){const{count:n=10}=u,o=fe(),l=ue.filter(g=>g.w&&g.s===e),a=u.excludeNoImage?Ne(l.map(g=>g.w)):null,r=a?l.filter(g=>a.has(g.w)):l,c=new Set(r.map(g=>g.w)),C=Nn(c),d=u.phonemeView??"char",f=u.composition??null,s=[];for(const g of x(r)){if(s.length>=n)break;const p=Tn(g.w,f,o,d,C,null,null);if(!p)continue;const w=p.distractors[0],E=[...g.w],h=[...w],S=E.findIndex((B,A)=>B!==h[A]);s.push({id:z(t),index:s.length+1,word:g.w,original:g.w,changed:w,changedFrom:S>=0?E[S]:"",changedTo:S>=0?h[S]:"",distractors:p.distractors.slice(1)})}return s}async function xn(e){return nt(2,e,"CS2-item")}async function vn(e){return nt(3,e,"CS3-item")}async function Fn(e){const u=(await Z({...e,difficulty:"count",contrastCount:1})).filter(t=>t.word.s===1&&t.usable.length>=1);return tt(u,e.count??10,"CP1-item")}async function Vn(e){const u=e.difficulty&&e.difficulty!=="random"?e.difficulty:"count",t=(await Z({...e,difficulty:u,contrastCount:1})).filter(n=>n.word.s===2&&n.usable.length>=1);return tt(t,e.count??10,"CP2-item")}async function Hn(e){const{count:u=10}=e,t=(await Z({...e})).filter(n=>n.word.s===2);return te(t,u).map((n,o)=>({id:z("M2S-item"),index:o+1,word:n.word.w,answer:n.word.w,parts:[...n.word.w]}))}async function $n(e){const{count:u=10}=e,t=(await Z({...e})).filter(n=>n.word.s===3);return te(t,u).map((n,o)=>({id:z("M3S-item"),index:o+1,word:n.word.w,answer:n.word.w,parts:[...n.word.w]}))}async function Gn(e){const{count:u=10}=e,t=(await Z({...e})).filter(r=>r.word.s===2),n=fe(),o=new Set(ue.map(r=>r.w)),l=e.phonemeView??"char",a=[];for(const r of x(t)){if(a.length>=u)break;const c=bn(r.word.w,e.composition??null,n,l,o);if(!c)continue;const[C,...d]=c.distractors,f=[...r.word.w],s=f[0]===C?f[1]:f[0];a.push({id:z("D2-item"),index:a.length+1,original:r.word.w,word:r.word.w,dropped:s,missingResult:C,distractors:d})}return a}async function Yn(e){const{count:u=10}=e,t=(await Z({...e})).filter(r=>r.word.s===3),n=fe(),o=new Set(ue.map(r=>r.w)),l=e.phonemeView??"char",a=[];for(const r of x(t)){if(a.length>=u)break;const c=An(r.word.w,e.composition??null,n,l,o);if(!c)continue;const[C,...d]=c.distractors,f=[...r.word.w];let s="";for(let g=0;g<f.length;g++)if(f.filter((p,w)=>w!==g).join("")===C){s=f[g];break}a.push({id:z("D3-item"),index:a.length+1,original:r.word.w,word:r.word.w,dropped:s,missingResult:C,distractors:d})}return a}async function Un(e){const{count:u=10}=e,t=(await Z({...e})).filter(r=>r.word.s>=2),n=fe(),o=new Set(ue.map(r=>r.w)),l=e.phonemeView??"char",a=[];for(const r of x(t)){if(a.length>=u)break;const c=_n(r.word.w,e.composition??null,n,l,o);if(!c)continue;const[C,...d]=c.distractors,f=r.word.w,s=f.startsWith(C)?f.slice(C.length):f.endsWith(C)?f.slice(0,f.length-C.length):"";a.push({id:z("DPC-item"),index:a.length+1,original:f,word:f,dropped:s,missingResult:C,distractors:d})}return a}async function Kn(e){const{count:u=10}=e,t=(await Z({...e})).map(n=>n.word.w);return t.length<3?[]:Array.from({length:u},(n,o)=>{const l=te(t,3);return{id:z("LRO-item"),index:o+1,sequence:l,choices:x(l)}})}function We(e,u,t){const n=ue.filter(a=>a.w&&a.s===e),o=u?Ne(n.map(a=>a.w)):null,l=[];for(const a of n)if(!(o&&!o.has(a.w))){if(t){const r=V(a.w);if(!r||!t(r))continue}l.push(a)}return l}function Wn(e){const u=We(1,e.excludeNoImage??!1,t=>t.jong===0);return te(u,e.count??10).map((t,n)=>{const o=V(t.w);return{id:z("M2P-item"),index:n+1,parts:[q[o.cho],ae[o.jung]],answer:t.w,word:t.w}})}function qn(e){const u=We(1,e.excludeNoImage??!1,t=>t.jong>0&&!we[t.jong]);return te(u,e.count??10).map((t,n)=>{const o=V(t.w);return{id:z("M3P-item"),index:n+1,parts:[q[o.cho],ae[o.jung],Q[o.jong]],answer:t.w,word:t.w}})}function zn(e){const u=Uu.DROP_FINAL_CONSONANT_FROM_1SYLL,t=We(u.syllables,e.excludeNoImage??!1,u.syllable),n=fe(),o=[];for(const l of x(t)){if(o.length>=(e.count??10))break;const a=Dn(l.w,null,n);if(!a)continue;const[r,...c]=a.distractors;o.push({id:z("DFC-item"),index:o.length+1,original:l.w,word:l.w,result:r,distractors:c})}return o}function Jn(e){const u=Uu.REMOVE_CONSONANT_AND_IDENTIFY_PHONEME,t=We(u.syllables,e.excludeNoImage??!1,u.syllable),n=fe(),o=[];for(const l of x(t)){if(o.length>=(e.count??10))break;const a=On(l.w,null,n);if(!a)continue;const r=V(n.get(l.w)||l.w);if(!r)continue;const[c,...C]=a.distractors;o.push({id:z("RCP-item"),index:o.length+1,base:l.w,word:l.w,missingConsonant:q[r.cho],remaining:c,distractors:C})}return o}const qe=new Map;let ot=null,lt=null;async function rt(e,u={}){const t=Ge(),n=Ae();(t!==ot||n!==lt)&&(qe.clear(),ot=t,lt=n);const o=`${e}:${et(u)}`;if(qe.has(o))return qe.get(o);const l=await Qn(e,u);return qe.set(o,l),l}const Zn={SAME_SOUND_PICK:e=>ut("SSP",e),HEAR_AND_PICK_SAME:e=>ut("HPS",e),HEAR_AND_PICK_INCLUDED:e=>Mn(e),SAME_OR_DIFF:e=>kn(e),STARTS_WITH_SAME_SOUND:e=>Pn(e),LISTEN_AND_REMEMBER_ORDER:e=>Kn(e),MERGE_2_SYLLABLES:e=>Hn(e),MERGE_3_SYLLABLES:e=>$n(e),MERGE_2_PHONEMES:e=>Wn(e),MERGE_3_PHONEMES:e=>qn(e),DROP_1_FROM_2SYLL:e=>Gn(e),DROP_1_FROM_3SYLL:e=>Yn(e),DROP_PART_FROM_COMPOUND:e=>Un(e),DROP_FINAL_CONSONANT_FROM_1SYLL:e=>zn(e),REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:e=>Jn(e),CHANGE_1_SYLL_IN_2SYLL:e=>xn(e),CHANGE_1_SYLL_IN_3SYLL:e=>vn(e),CHANGE_1_PHONEME_IN_1SYLL:e=>Fn(e),CHANGE_1_PHONEME_IN_2SYLL:e=>Vn(e)};async function Qn(e,u={}){const t=Zn[e];return t?await t(u):[]}async function Xn(e){const u=[null,"count"],t=Object.keys(su);let n=0;for(const o of u)for(const l of t){const a=su[l];rt(l,{difficulty:a.difficulty?o:null,choseong:null,count:10,excludeNoImage:e}).catch(()=>{}),++n%6===0&&await new Promise(r=>setTimeout(r,0))}}async function eo(e){return(await Z({...e,fullCount:!0})).length}async function uo(e={}){const u=[];for(const r of ue)r.w&&u.push(r.w);const t=e.excludeNoImage?Ne(u):u,n=new Set,o=new Set,l=new Set,a=new Set;for(const r of t){a.add(He(r));for(const c of r){const C=V(c);if(C&&(q[C.cho]!=="\u3147"&&n.add(q[C.cho]),o.add(ae[C.jung]),C.jong>0)){l.add(Q[C.jong]);const d=we[C.jong];d&&d.forEach(f=>l.add(f))}}}return{cho:n,jung:o,jong:l,syllable:a}}const ge="\uC804\uCCB4";function at(){const{t:e}=Se.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 st(e){return{label:e.partOfSpeech,items:Object.keys(e.posMap),multiple:!0,allOption:!0}}function ct(e){return{label:e.wordType,items:Object.keys(e.typeMap),multiple:!0,allOption:!0}}function to(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 no(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 oo(e,u){const{label:t,headValue:n,midValue:o,tailValue:l,includeMid:a=!0,headDisabled:r,midDisabled:c,tailDisabled:C,allOptionDisabled:d,groupLabel:f,labelAction:s}=u;return{label:t,...f?{groupLabel:f}:{},...s?{labelAction:s}:{},allOption:!0,allLabel:e("wordSearch.filter.positionAny",{defaultValue:"\uBB34\uAD00"}),...d?{allOptionDisabled:d}:{},items:[{value:n,displayLabel:e("wordSearch.filter.positionHead",{defaultValue:"\uC5B4\uB450"}),disabled:r},...a?[{value:o,displayLabel:e("wordSearch.filter.positionMid",{defaultValue:"\uC5B4\uC911"}),disabled:c}]:[],{value:l,displayLabel:e("wordSearch.filter.positionTail",{defaultValue:"\uC5B4\uB9D0"}),disabled:C}]}}function lo(e,u,t){if(u===ge){const{[t]:l,...a}=e;return a}const n=e[t]??[],o=n.includes(u)?n.filter(l=>l!==u):[...n,u];if(o.length===0){const{[t]:l,...a}=e;return a}return{...e,[t]:o}}Object.fromEntries(Object.entries(Sn).map(([e,{nucleus:u}])=>[e,u]));const ro={\uACE0\uC720\uC5B4:"\uACE0\uC720",\uD55C\uC790\uC5B4:"\uD55C\uC790",\uC678\uB798\uC5B4:"\uC678\uB798",\uD63C\uC885\uC5B4:"\uD63C\uC885"},ao={"\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"]},io={difficulty:"\uB09C\uC774\uB3C4 \uB4F1\uAE09",syllables:"\uC74C\uC808 \uC218",syllable5plus:"5\uC74C\uC808 \uC774\uC0C1",partOfSpeech:"\uD488\uC0AC",wordType:"\uC720\uD615",posMap:ao,typeMap:ro};function so(e,u,t=io){const n=u[t.difficulty];if(n?.length&&!n.some(r=>e.grade===r.replace(/\D/g,"")))return!1;const o=u[t.syllables];if(o?.length){const r=e.syllables??0;if(!o.some(c=>c===t.syllable5plus?r>=5:r===parseInt(c)))return!1}const l=u[t.partOfSpeech];if(l?.length&&!l.flatMap(r=>t.posMap[r]??[r]).some(r=>(e.pos??"").includes(r)))return!1;const a=u[t.wordType];return!(a?.length&&!a.some(r=>e.wordType===t.typeMap[r]))}const co={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"})},Co={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"})},fo={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 Ct(e,u){if("place"in u)return co[u.place](e);const t=Co[u.vowel](e);return u.glide?`${t} \xB7 ${fo[u.glide](e)}`:t}const go=(e,{defaultValue:u})=>u,dt=(e,u)=>({jamos:e,phonetic:u,tooltip:Ct(go,u)}),se=(e,u)=>u.map(t=>dt([t],{place:e})),W=(e,u,t)=>dt([...e],t?{vowel:u,glide:t}:{vowel:u}),mu={cho:[se("labial",["\u3142","\u3143","\u314D","\u3141"]),se("alveolar",["\u3137","\u3138","\u314C","\u3134","\u3139"]),se("alveolar",["\u3145","\u3146"]),se("palatal",["\u3148","\u3149","\u314A"]),se("velar",["\u3131","\u3132","\u314B"]),se("glottal",["\u314E"])],jung:[[W("\u3163","frontHigh"),W("\u315F","frontHigh","w"),W("\u3162","frontHigh","velar")],[W("\u3161","backHighUnrounded")],[W("\u315C","backHighRounded"),W("\u3160","backHighRounded","j")],[W("\u3154\u3150","frontMid"),W("\u3156\u3152","frontMid","j"),W("\u3159\u315A\u315E","frontMid","w")],[W("\u3153","backMidUnrounded"),W("\u3155","backMidUnrounded","j"),W("\u315D","backMidUnrounded","w")],[W("\u3157","backMidRounded"),W("\u315B","backMidRounded","j")],[W("\u314F","low"),W("\u3151","low","j"),W("\u3158","low","w")]],jong:[se("labial",["\u3142","\u3141"]),se("alveolar",["\u3137","\u3134","\u3139"]),se("velar",["\u3131","\u3147"])]},ho=[...q],mo=[...ae],po=Q.filter(e=>e!==""),ce=e=>e===ne?[]:Array.from(e),ne="__NO_CODA__",ft=[1,2,3,4],oe=5,So=12,gt="SYL_",pu=e=>`${gt}${e}`,Eo=e=>Number(e.slice(gt.length));function Su(e){return e>=oe?Array.from({length:So-oe+1},(u,t)=>oe+t):[e]}const ht={cho:ho,jung:mo,jong:po},Eu=e=>e.map(u=>u.map(({jamos:t,phonetic:n,tooltip:o})=>({v:t.join(""),phonetic:n,tooltip:o}))),yu={cho:Eu(mu.cho),jung:Eu(mu.jung),jong:Eu(mu.jong)},mt={};yu.jung.flat().forEach(({v:e})=>{for(const u of ce(e))mt[u]=e});const yo=new Set(yu.cho.flat().map(e=>e.v));function pt(e,u){return e==="cho"?yo.has(u)?u:null:e==="jung"?mt[u]??u:Ku(u)}function St(e,u,t){if(e==="jung"){const n=ce(u);return t&&n.includes(t)?t:n[0]??u}return u}function Et(e,u,t){const n=(o,l)=>l?o==="jong"&&l===ne?ne:u==="pron"?pt(o,l):St(o,l,o==="jung"?t:null):null;return{...e,cho:n("cho",e.cho),jung:n("jung",e.jung),jong:n("jong",e.jong)}}const Bu={cho:null,jung:null,jong:null,syllable:null},Bo="wt_filter",yt=e=>`wt_filter_${e}`;function Bt(e){try{const u=localStorage.getItem(yt(e))??localStorage.getItem(Bo);if(u)return JSON.parse(u)}catch{}return null}function wo(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?{...Bu,cho:u.choseong}:Bu}function bo(e,u,t){const{t:n,i18n:o}=Se.useTranslation(),[l]=i.useState(()=>t?.resetOnMount?null:Bt(e)),a=l?.contrastCount,r=typeof a=="number"&&Number.isFinite(a)?a:1,[c,C]=i.useState(Math.min(5,Math.max(1,r))),[d,f]=i.useState(l?.phonemeView==="pron"?"pron":l?.phonemeView==="direct"?"direct":"char"),[s,g]=i.useState(()=>wo(l)),p=i.useCallback(()=>u.requireSyllable?{cho:"\u3131",jung:"\u314F",jong:ne,syllable:u.fixedSyllable??null}:{cho:null,jung:null,jong:u.fixedNoCoda?ne:null,syllable:u.fixedSyllable??null},[u.requireSyllable,u.fixedSyllable,u.fixedNoCoda]);i.useEffect(()=>{!u.requireSyllable&&u.fixedSyllable==null&&!u.fixedNoCoda||g(m=>m.cho||m.jung||m.syllable!=null||m.jong?m:p())},[]);const w=i.useMemo(()=>K(s.cho)||K(s.jung)||K(s.jong)?"count":"random",[s.cho,s.jung,s.jong]),E=i.useRef(d==="char"?s.jung:null);i.useEffect(()=>{d==="char"&&(E.current=s.jung)},[d,s.jung]);const[h,S]=i.useState(t?.resetOnMount?!!t?.defaultImageOnly:l?.excludeNoImage??!0),[B,A]=i.useState(t?.resetOnMount?!1:l?.sameStructureOnly??!0),[D,b]=i.useState(Array.isArray(l?.gradeFilter)?l.gradeFilter:[]),[I,L]=i.useState(Array.isArray(l?.posFilter)?l.posFilter:[]),[F,j]=i.useState(Array.isArray(l?.wordTypeFilter)?l.wordTypeFilter:[]),H=i.useRef(t?.resetKey);i.useEffect(()=>{H.current!==t?.resetKey&&(H.current=t?.resetKey,g(p()),S(!1),A(!1),b([]),L([]),j([]),C(1))},[t?.resetKey]);const k=at(),[v,T]=i.useState({cho:new Set,jung:new Set,jong:new Set,syllable:new Set}),[P,G]=i.useState(!1),[X,le]=i.useState(null),re=1,y=Math.max(1,[s.cho,s.jung,s.jong].filter(Boolean).length);i.useEffect(()=>{c<y&&C(y)},[y,c]);const[_,Y]=i.useState(e);i.useEffect(()=>{if(_!==e){if(!t?.resetOnMount){const m=Bt(e),N=typeof m?.contrastCount=="number"&&Number.isFinite(m.contrastCount)?m.contrastCount:1;C(Math.min(5,Math.max(1,N))),g(m?.composition??p()),S(m?.excludeNoImage??!0),A(m?.sameStructureOnly??!0),f(m?.phonemeView==="pron"?"pron":"char"),b(Array.isArray(m?.gradeFilter)?m.gradeFilter:[]),L(Array.isArray(m?.posFilter)?m.posFilter:[]),j(Array.isArray(m?.wordTypeFilter)?m.wordTypeFilter:[])}Y(e)}},[e,_,t?.resetOnMount]),i.useEffect(()=>{if(!t?.resetOnMount&&_===e)try{localStorage.setItem(yt(e),JSON.stringify({contrastCount:c,composition:s,excludeNoImage:h,sameStructureOnly:B,phonemeView:d,gradeFilter:D,posFilter:I,wordTypeFilter:F}))}catch{}},[t?.resetOnMount,e,_,c,s,h,B,d,D,I,F]);const[$,ee]=i.useState(0);Lu("wordpool:update",()=>ee(m=>m+1));const Du=i.useRef(o.language);i.useEffect(()=>{Du.current!==o.language&&(Du.current=o.language,ee(m=>m+1))},[o.language]),i.useEffect(()=>{if(!u.choseong)return;let m=!1;return uo({difficulty:w,excludeNoImage:h}).then(N=>{m||(T(N),N.cho.size+N.jung.size+N.jong.size>0&&G(!0))}).catch(()=>{m||T({cho:new Set,jung:new Set,jong:new Set,syllable:new Set})}),()=>{m=!0}},[u.choseong,w,h,$]),i.useEffect(()=>{let m=!1;const N=s,O=N.cho?ce(N.cho):null,M=N.jung?ce(N.jung):null,U=N.jong===ne,he=U?null:N.jong?ce(N.jong):null,me=N.syllable!=null?Su(N.syllable):null,Fe=!!(O||M||he||U||me);return eo({difficulty:u.difficulty?w:null,contrastCount:u.difficulty?c:1,composition:u.choseong&&Fe?{cho:O,jung:M,jong:he,jongNone:U,syllable:me}:null,excludeNoImage:h,sameStructureOnly:B,phonemeView:d==="pron"?"pron":"char",grade:D.length>0?D:null}).then(Ve=>{m||le(Ve)}).catch(()=>{m||le(null)}),()=>{m=!0}},[u.choseong,u.difficulty,w,c,s,d,h,B,$,D]),i.useEffect(()=>{P&&g(m=>{const N={...m};let O=!1;return["cho","jung","jong"].forEach(M=>{const U=m[M];!U||U===ne||ce(U).some(he=>v[M].has(he))||(N[M]=null,O=!0)}),m.syllable!=null&&u.fixedSyllable==null&&(m.syllable>=oe?[...v.syllable].some(M=>M>=oe)||(N.syllable=null,O=!0):(!v.syllable.has(m.syllable)||m.syllable<re)&&(N.syllable=null,O=!0)),O?N:m})},[v,P,re,u.fixedSyllable]);const Ou=i.useMemo(()=>{const m=N=>{const O=new Set;for(const M of ht[N])v[N].has(M)&&O.add(M);return O};return{cho:m("cho"),jung:m("jung"),jong:m("jong")}},[v]),tu=i.useMemo(()=>({exact:new Set(ft.filter(m=>v.syllable.has(m))),min:[...v.syllable].some(m=>m>=oe)}),[v]),R=i.useMemo(()=>({diffPhonemeCount:n("training.contrast.diffPhonemeCount",{defaultValue:"\uB2E4\uB978 \uC74C\uC18C\uC758 \uCD1D \uAC2F\uC218"}),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]),Nu=i.useMemo(()=>({[R.trainOnset]:"cho",[R.trainVowel]:"jung",[R.trainCoda]:"jong"}),[R]),ve=i.useCallback((m,N)=>({title:N,items:m}),[]),nu=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]),Ot=i.useMemo(()=>{const m=[];if(u.choseong){const N={value:ne,displayLabel:R.codaExclude},O=u.fixedNoCoda===!0,M=(U,he)=>{const me=O&&U==="jong",Fe={label:he,groupLabel:R.phonemeGroup,allOption:!u.requireSyllable,allLabel:R.noLimit,allOptionDisabled:me};if(d==="pron"){const pe=yu[U].map(Mt=>Mt.map(({v:ou,phonetic:kt})=>{const lu=ce(ou),Tu=Ct(n,kt),ju=me||!lu.some(Pt=>v[U].has(Pt));return lu.length>1?{value:ou,labels:lu,tooltip:Tu,disabled:ju}:{value:ou,tooltip:Tu,disabled:ju}}));return U==="jong"&&!u.requireCoda&&pe.unshift([N]),{...Fe,groups:pe}}const Ve=ht[U].map(pe=>!me&&Ou[U].has(pe)?pe:{value:pe,disabled:!0});return{...Fe,items:U==="jong"&&!u.requireCoda?[N,...Ve]:Ve}};m.push(M("cho",R.trainOnset)),m.push(M("jung",R.trainVowel)),m.push(M("jong",R.trainCoda))}if(m.push({...it(n,k,{labelInfo:ve([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:R.gradeLabel}),u.partOfSpeech&&m.push(st(k)),u.wordType&&m.push(ct(k)),u.choseong||u.fixedSyllable!=null){const N=u.fixedSyllable;m.push({label:R.syllableCount,items:[...ft.map(O=>({value:pu(O),displayLabel:n("wordPairs.syllableN",{n:O,defaultValue:"{{n}}\uC74C\uC808"}),disabled:N!=null?O!==N:!tu.exact.has(O)||O<re})),{value:pu(oe),displayLabel:n("wordPairs.syllableNPlus",{n:oe,defaultValue:"{{n}}\uC74C\uC808 \uC774\uC0C1"}),disabled:N!=null?oe!==N:!tu.min}],allOption:!0,allOptionDisabled:N!=null})}return u.choseong?m.push({label:R.exclude,displayLabel:R.selectLabel,multiple:!0,items:[R.excludeImage,R.sameStructure],labelInfo:ve(nu)}):m.push({label:R.exclude,displayLabel:R.selectLabel,multiple:!0,items:[R.excludeImage],labelInfo:ve([nu[0]])}),m},[u.choseong,u.partOfSpeech,u.wordType,u.requireSyllable,u.fixedSyllable,u.fixedNoCoda,u.requireCoda,re,Ou,v,d,tu,R,n,ve,nu,k]),Nt={...u.difficulty?{[R.diffPhonemeCount]:String(c)}:{},...(u.choseong||u.fixedSyllable!=null)&&s.syllable!=null?{[R.syllableCount]:pu(s.syllable)}:{},...u.choseong&&s.cho?{[R.trainOnset]:s.cho}:{},...u.choseong&&s.jung?{[R.trainVowel]:s.jung}:{},...u.choseong&&s.jong?{[R.trainCoda]:s.jong}:{},[R.exclude]:[...h?[R.excludeImage]:[],...B?[R.sameStructure]:[]],[R.gradeLabel]:D.map(m=>n("wordSearch.filter.grade",{n:Number(m),defaultValue:"{{n}}\uB4F1\uAE09"})),...u.partOfSpeech?{[k.partOfSpeech]:I}:{},...u.wordType?{[k.wordType]:F}:{}},Tt=i.useCallback((m,N)=>{if(N===R.diffPhonemeCount){const O=Number(m);O>=1&&C(O)}else if(N===R.exclude)m===R.excludeImage?S(O=>!O):m===R.sameStructure&&A(O=>!O);else if(N===R.syllableCount)g(O=>{if(!m||m===ge)return{...O,syllable:null};const M=Eo(m);return{...O,syllable:O.syllable===M?null:M}});else if(N===R.gradeLabel){if(!m||m===ge){b([]);return}const O=m.replace(/\D/g,"");b(M=>M.includes(O)?M.filter(U=>U!==O):[...M,O])}else if(N===k.partOfSpeech){if(!m||m===ge){L([]);return}L(O=>O.includes(m)?O.filter(M=>M!==m):[...O,m])}else if(N===k.wordType){if(!m||m===ge){j([]);return}j(O=>O.includes(m)?O.filter(M=>M!==m):[...O,m])}else{const O=Nu[N];if(!O)return;g(M=>u.requireSyllable?m&&m!==ge?{...M,[O]:m}:M:!m||m===ge||M[O]===m?{...M,[O]:null}:{...M,[O]:m})}},[R,Nu,k,u.requireSyllable]),jt=i.useCallback(m=>!u.partOfSpeech&&!u.wordType?!0:so(m,{...u.partOfSpeech?{[k.partOfSpeech]:I}:{},...u.wordType?{[k.wordType]:F}:{}},k),[u.partOfSpeech,u.wordType,I,F,k]),It=i.useCallback(m=>{m!==d&&(m!=="direct"&&d!=="direct"&&g(N=>Et(N,m,E.current)),f(m))},[d]),Rt=i.useCallback(()=>({composition:s,contrastCount:c,excludeNoImage:h,sameStructureOnly:B,phonemeView:d,gradeFilter:D}),[s,c,h,B,d,D]),Lt=i.useCallback(m=>{g(m.composition),C(m.contrastCount),S(m.excludeNoImage),A(m.sameStructureOnly??!0),f(m.phonemeView),b(Array.isArray(m.gradeFilter)?m.gradeFilter:[])},[]);return{difficulty:w,contrastCount:c,composition:s,choseong:s.cho,excludeNoImage:h,sameStructureOnly:B,gradeFilter:D,posFilter:I,wordTypeFilter:F,matchesWordAttributes:jt,poolVersion:$,filterSections:Ot,filterSelected:Nt,handleFilterSelect:Tt,phonemeView:d,setPhonemeView:It,phonemeGroupLabel:R.phonemeGroup,wordCount:X,getFilterSnapshot:Rt,restoreFilterSnapshot:Lt}}function Ao(e){const u=r=>r?ce(r):null,t=u(e.cho),n=u(e.jung),o=e.jong===ne,l=o?null:u(e.jong),a=e.syllable!=null?Su(e.syllable):null;return!t&&!n&&!l&&!o&&!a?null:{cho:t,jung:n,jong:l,jongNone:o,syllable:a}}function _o(e,u,t,n,o,l,a=!0,r="char",c=[]){const[C,d]=i.useState({}),[f,s]=i.useState(!1),{cho:g=null,jung:p=null,jong:w=null,syllable:E=null}=n??{},h=c.length>0?c.slice().sort().join(","):"";return i.useEffect(()=>{l>0&&Xn(o).catch(()=>{})},[l,o]),i.useEffect(()=>{let S=!1;return s(!0),(async()=>{const B=Ao({cho:g,jung:p,jong:w,syllable:E}),A=`${g??""}_${p??""}_${w??""}_${E??""}_${h}`,D={};await Promise.all(e.map(async b=>{const I=su[b.key];try{const L=await rt(b.key,{difficulty:I.difficulty?u:null,contrastCount:I.difficulty?t:1,composition:I.choseong?B:null,count:5,excludeNoImage:o,sameStructureOnly:a,phonemeView:r,grade:c.length>0?c:null});L&&L.length>0?D[b.key]={id:`wt-${b.key}-${u}-${A}-${Date.now()}`,name:b.label,training_type:b.key,category_main_code:"WORD",iconColor:b.color,subTitle:b.subTitle,items:L,itemCount:L.length}:D[b.key]={id:`wt-${b.key}-empty`,name:b.label,training_type:b.key,category_main_code:"WORD",iconColor:b.color,subTitle:b.subTitle,items:[],itemCount:0,__empty:!0}}catch{D[b.key]=null}})),S||(d(D),s(!1))})(),()=>{S=!0}},[u,t,g,p,w,E,o,a,r,l,h]),{perTypeData:C,generating:f}}function Do(){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 je=[],Ie=[],Re=[],Le=[],Je={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},Ze={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},Oo={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};let wu=null,wt=null,Ce=null;function No({counts:e,forceRefresh:u}={}){const t=Object.assign({},Oo,e||{}),n=Do(),o=ze(new Date(`${n}T00:00:00+09:00`).getTime()-864e5),l=JSON.stringify(t);if(!u&&wt===n&&wu===l&&Ce)return Object.assign(Je,Ce.today),Object.assign(Ze,Ce.yesterday?.selection||{LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),{today:Je,yesterday:Ze};const a={LISTEN_IN_NOISE:ie(je,Math.max(0,Number(t.LISTEN_IN_NOISE)||0)),SHORT_STORY:ie(Ie,Math.max(0,Number(t.SHORT_STORY)||0)),LONG_STORY:ie(Re,Math.max(0,Number(t.LONG_STORY)||0)),ORDERING_SENTENCE:ie(Le,Math.max(0,Number(t.ORDERING_SENTENCE)||0))};let r=null;return Ce&&wu===l&&Ce.yesterday&&Ce.yesterday.date===o&&(r=Ce.yesterday.selection),r||(r={LISTEN_IN_NOISE:ie(je,Math.max(0,Number(t.LISTEN_IN_NOISE)||0)),SHORT_STORY:ie(Ie,Math.max(0,Number(t.SHORT_STORY)||0)),LONG_STORY:ie(Re,Math.max(0,Number(t.LONG_STORY)||0)),ORDERING_SENTENCE:ie(Le,Math.max(0,Number(t.ORDERING_SENTENCE)||0))}),Object.assign(Je,a),Object.assign(Ze,r),wt=n,wu=l,Ce={today:a,yesterday:{date:o,countsKey:l,selection:r}},{today:Je,yesterday:Ze}}let bt=!1,Me=null;async function To(){try{const e={url:typeof document>"u"?require("url").pathToFileURL(__filename).href:ru&&ru.tagName.toUpperCase()==="SCRIPT"&&ru.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 jo(){if(!bt)return Me||(Me=(async()=>{const e=await To();if(!e){Me=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}try{for(const u of Object.keys(e||{})){const t=e[u]||[];for(const n of t){const o=n,l=String(o.training_type||u),a=String(o.category_main_code||o.category_main||o.category_0||""),r=String(o.category_sub_code||o.category_sub||o.category_1||""),c=Object.assign({},o,{training_type:l,category_0:a,category_1:r});l==="LISTEN_IN_NOISE"?je.push(c):l==="SHORT_STORY"?Ie.push(c):l==="LONG_STORY"?Re.push(c):l==="ORDERING_SENTENCE"&&Le.push(c)}}}catch{Me=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}try{window.dispatchEvent(new Event("speechear.data.updated"))}catch{}try{No()}catch{}bt=!0})(),Me)}async function Io(e=3e3){const u=jo();return Promise.race([u,new Promise(t=>setTimeout(t,e))])}function Ro(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 Lo(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 Qe=ie;function bu(e,u){const t=u?Lo(Ro(u)):Math.random;return{LISTEN_IN_NOISE:Qe(je,Math.max(0,e.LISTEN_IN_NOISE||0),t),SHORT_STORY:Qe(Ie,Math.max(0,e.SHORT_STORY||0),t),LONG_STORY:Qe(Re,Math.max(0,e.LONG_STORY||0),t),ORDERING_SENTENCE:Qe(Le,Math.max(0,e.ORDERING_SENTENCE||0),t)}}function At(e){return e?!!(e.LISTEN_IN_NOISE?.length||e.SHORT_STORY?.length||e.LONG_STORY?.length||e.ORDERING_SENTENCE?.length):!1}const Mo={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};function _t(e=!1,u=Mo,t){const n=ze(Date.now()),o=ze(Date.now()-864e5),l=`${t??""}|${n}`,a=`${t??""}|${o}`;return je.length>0||Ie.length>0||Re.length>0||Le.length>0?{today:bu(u,l),yesterday:bu(u,a)}:{today:bu(u,l),yesterday:null}}function ko(e){const u=i.useRef({LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),t=i.useRef(null),[n,o]=i.useState(!1),[l,a]=i.useState(!1),[r,c]=i.useState(0),[C,d]=i.useState(!1);i.useEffect(()=>{let s=!1,g,p=0;const w=40,E=()=>{g!==void 0&&(clearInterval(g),g=void 0)};let h=!1;try{const A=new URLSearchParams(window.location.search),D=A.get("forceRefresh")||A.get("force");h=D==="1"||D==="true"}catch{}const S=A=>{u.current=A.today,t.current=A.yesterday,o(!0),d(!0),c(D=>D+1),s=!0,E()},B=async()=>{if(s)return;if(!h){const D=_t(!1,void 0,e);if(At(D.today)){S(D);return}}try{await Io(3e3)}catch{}if(s)return;const A=_t(h,void 0,e);if(At(A.today)){S(A);return}++p>=w&&(o(!0),d(!1),s=!0,E())};return B(),g=setInterval(B,250),()=>{s=!0,E()}},[e]);const f=i.useCallback(s=>{const g=l?t.current:u.current,p=l?u.current:t.current;return g?.[s]?.length?g[s]:p?.[s]?.length?p[s]:void 0},[l,r]);return{loaded:n,hasData:C,showYesterday:l,setShowYesterday:a,getTrainingPerType:f}}const Be=[];let Xe=!1;function Dt(e){if(e.key!=="Escape"||e.defaultPrevented)return;const u=Be[Be.length-1];u&&(e.stopPropagation(),u())}function Po(e){return Be.push(e),!Xe&&typeof document<"u"&&(document.addEventListener("keydown",Dt),Xe=!0),()=>{const u=Be.lastIndexOf(e);u>=0&&Be.splice(u,1),Be.length===0&&Xe&&typeof document<"u"&&(document.removeEventListener("keydown",Dt),Xe=!1)}}function xo(e,u=!0){const t=Ru(e);i.useEffect(()=>{if(u)return Po(()=>{t.current?.()})},[u,t])}const Au=(e,u)=>`${e}:${u??1}`,_u=new Map;function vo(e,u){const[t,n]=i.useState(0),o=e.map(l=>Au(l.word,l.homonum)).join("|");return i.useEffect(()=>{const l=(o?o.split("|"):[]).filter(c=>!_u.has(c));if(l.length===0)return;let a=!1;const r=Array.from(new Set(l.map(c=>c.slice(0,c.lastIndexOf(":")))));return u(r).then(c=>{if(!(a||c.length===0)){for(const C of c)C.Meaning&&_u.set(Au(C.Word,C.Homonum??void 0),C.Meaning);n(C=>C+1)}}),()=>{a=!0}},[o,u]),i.useMemo(()=>{const l=o?o.split("|"):[],a=new Map;for(const r of l){const c=_u.get(r);c!=null&&a.set(r,c)}return a},[o,t])}function Fo(){const[e,u]=i.useState(null),t=i.useCallback(l=>u(l.getBoundingClientRect()),[]),n=i.useCallback(()=>u(null),[]),o=i.useCallback(l=>{const a=l.getBoundingClientRect();u(r=>r?null:a)},[]);return{anchorRect:e,isOpen:e!=null,openAt:t,close:n,toggleAt:o}}function Vo(e){const[u,t]=i.useState(null),[n,o]=i.useState(null),l=i.useRef(null);i.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]);const a=i.useCallback((c,C)=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{t(c),o(C)},e)},[e]),r=i.useCallback(()=>{l.current&&clearTimeout(l.current),t(null),o(null)},[]);return{payload:u,anchorRect:n,openAfterDelay:a,close:r}}function Ho(e,u,t){const n=Number.isFinite(u)&&u>=1?Math.floor(u):1,o=Math.max(1,Math.ceil(e.length/n)),l=Number.isFinite(t)?Math.min(Math.max(1,Math.floor(t)),o):1;return{pageItems:i.useMemo(()=>e.slice((l-1)*n,l*n),[e,l,n]),totalPages:o,curPage:l}}function $o(e="warning"){const[u,t]=i.useState(""),[n,o]=i.useState(e),[l,a]=i.useState(0),r=i.useCallback((f,s)=>{o(s),t(f),a(g=>g+1)},[]),c=i.useCallback(f=>r(f,"warning"),[r]),C=i.useCallback(f=>r(f,"normal"),[r]),d=i.useCallback(()=>t(""),[]);return{toastMessage:u,toastType:n,toastKey:l,showToast:r,showWarning:c,showNormal:C,clearToast:d}}const Go=[{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."}],Yo={LISTEN_IN_NOISE:"listenInNoise",SHORT_STORY:"shortStory",LONG_STORY:"longStory",ORDERING_SENTENCE:"orderingSentence"};function Uo(e){return Go.map(u=>{const t=Yo[u.key];return t?{...u,label:e(`trainingType.${t}.title`),desc:e(`trainingType.${t}.desc`)}:u})}const ke={blue:"#60A5FA",green:"#4ADE80",amber:"#FBBF24",purple:"#A78BFA",pink:"#F472B6"},Pe=ke.blue,eu=ke.green,xe=ke.amber,uu=ke.purple,Ko=ke.pink,Wo=[{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:Pe,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:Pe,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:Pe,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:Pe,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:Pe,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:eu,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:eu,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:eu,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:eu,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:xe,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:xe,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:xe,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:xe,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:xe,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:uu,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:uu,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:uu,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:uu,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:Ko,subTitle:"\uC138 \uB2E8\uC5B4\uB97C \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694."}]}];function qo(){const{t:e}=Se.useTranslation();return i.useMemo(()=>{const u=Object.fromEntries(Uo(e).map(n=>[n.key,n.label])),t={...u};return Wo.flatMap(n=>n.types).forEach(n=>{t[n.key]=e(`trainingType.${n.key}.label`,{defaultValue:n.label})}),{sentence:u,all:t}},[e])}const zo="0.121.0";function Jo({computeStyle:e,onScroll:u="close",onResize:t="close",ignoreOutsideClickSelector:n}){const[o,l]=i.useState(!1),[a,r]=i.useState({}),c=i.useRef(null),C=i.useRef(null),d=i.useCallback(()=>{c.current&&r(e(c.current.getBoundingClientRect()))},[e]);i.useEffect(()=>{if(!o)return;d();const g=h=>{const S=h.target;n&&S.closest?.(n)||c.current?.contains(S)||C.current?.contains(S)||l(!1)};document.addEventListener("mousedown",g);const p=h=>{C.current?.contains(h.target)||(u==="reposition"?d():u==="close"&&l(!1))};u!=="ignore"&&window.addEventListener("scroll",p,!0);const w=()=>{t==="reposition"?d():t==="close"&&l(!1)};t!=="ignore"&&window.addEventListener("resize",w);const E=h=>{h.key==="Escape"&&l(!1)};return document.addEventListener("keydown",E),()=>{document.removeEventListener("mousedown",g),u!=="ignore"&&window.removeEventListener("scroll",p,!0),t!=="ignore"&&window.removeEventListener("resize",w),document.removeEventListener("keydown",E)}},[o,d,u,t,n]);const f=i.useCallback(()=>l(g=>!g),[]),s=i.useCallback(()=>l(!1),[]);return{open:o,setOpen:l,toggle:f,close:s,style:a,triggerRef:c,menuRef:C}}function Zo(e,{mode:u="playback",autoStart:t=!1,onPlaySpeaker:n,onComplete:o,playMs:l=1100,feedbackMs:a=1500}={}){const[r,c]=i.useState([]),[C,d]=i.useState(0),[f,s]=i.useState("idle"),[g,p]=i.useState(null),[w,E]=i.useState([]),[h,S]=i.useState(null),[B,A]=i.useState(0),D=i.useRef(0),b=i.useCallback(y=>{D.current=typeof y=="function"?y(D.current):y,A(D.current)},[]),I=i.useRef(n),L=i.useRef(o);i.useEffect(()=>{I.current=n,L.current=o},[n,o]);const F=i.useRef([]),j=()=>{F.current.forEach(clearTimeout),F.current=[]},H=(y,_)=>{F.current.push(setTimeout(_,y))};i.useEffect(()=>()=>j(),[]);const k=r[C]?.id??null,v=i.useCallback(()=>{j(),s("playing"),E([]),S(null),b(0);let y=0;e.forEach((_,Y)=>{H(y,()=>{d(Y),p(_.id),I.current?.(_)}),H(y+1e3,()=>{p(null),E($=>[...$,_.id])}),y+=1300}),H(y,()=>{s("done"),L.current?.({score:0,total:e.length})})},[e,b]),T=i.useCallback((y,_)=>{if(_>=y.length){s("done"),L.current?.({score:D.current,total:y.length});return}d(_),S(null),s("playing"),p(y[_].id),I.current?.(y[_]),H(l,()=>{p(null),s("waiting")})},[l]),P=i.useCallback(()=>{j();const y=x(e);c(y),b(0),E([]),T(y,0)},[e,T,b]),G=i.useCallback(()=>{u==="playback"?(c(e),v()):P()},[u,e,v,P]),X=i.useCallback(()=>{j(),s("idle"),p(null),E([]),S(null),d(0),b(0),c([])},[b]);i.useEffect(()=>{t?G():X()},[u,e.length,t]);const le=i.useCallback(y=>{f!=="waiting"||u==="playback"||(S(y),y===r[C]?.id&&b(_=>_+1),u==="exam"?(s("playing"),H(400,()=>T(r,C+1))):(s("feedback"),H(a,()=>T(r,C+1))))},[f,u,r,C,T,a,b]),re=u==="playback"?e.length:r.length;return{bind:{activeSpeakerId:g,playedIds:w,selectedId:h,answerId:k,showFeedback:f==="feedback",clickable:f==="waiting",onSelectSpeaker:le},index:C,total:re,score:B,phase:f,done:f==="done",start:G,reset:X}}exports.CACHE_GROUPS=Hu,exports.CORE_VERSION=zo,exports.DocumentTitleSuppressContext=ku,exports.EMPTY_COMPOSITION=Bu,exports.MediaQueryOverrideContext=Iu,exports.NO_CODA=ne,exports.SYLLABLE_MIN=oe,exports.VAP_PAGE_SIZE_OPTIONS=iu,exports.buildGradeSection=it,exports.buildPartOfSpeechSection=st,exports.buildPositionSection=oo,exports.buildSelectSection=no,exports.buildSyllableSection=to,exports.buildWordTypeSection=ct,exports.charToPronValue=pt,exports.convertComposition=Et,exports.fmtBytes=nn,exports.lsBytes=$u,exports.meaningKey=Au,exports.pronToCharValue=St,exports.syllableToFilter=Su,exports.today=_e,exports.toggleAttributeFilter=lo,exports.useAnchoredMenu=Jo,exports.useCacheManagement=on,exports.useDailyTrainingSelection=ko,exports.useDelayedHoverAnchor=Vo,exports.useDeviceManagement=gn,exports.useDocumentTitle=Vt,exports.useEscToClose=xo,exports.useFontScale=xt,exports.useHoverAnchor=Fo,exports.useMediaQuery=Ft,exports.usePagedList=Ho,exports.usePasswordChange=$t,exports.useRelativeDay=Ht,exports.useSoundCompassExam=Zo,exports.useTablePaging=dn,exports.useTableSort=fn,exports.useToastState=$o,exports.useTrainingTypeLabels=qo,exports.useVisitAllPanel=Cn,exports.useVisitHistory=an,exports.useVisitSchedule=cn,exports.useWindowEvent=Lu,exports.useWordAttributeFilterKeys=at,exports.useWordDataStats=ln,exports.useWordMeanings=vo,exports.useWordTrainingDataGeneration=_o,exports.useWordTrainingFilter=bo,exports.valueToJamos=ce;
|
|
1
|
+
"use strict";var i=require("react"),Se=require("react-i18next"),ru=typeof document<"u"?document.currentScript:null;function xt({storageKey:e="fontScale",baseFont:u=20,minScale:t=.8,maxScale:n=1.4,step:o=.1,lineHeightRatio:l=1.4}={}){const a=E=>Math.max(t,Math.min(n,Number(E))),[r,c]=i.useState(()=>{try{const E=localStorage.getItem(e),h=E?Number(E):1;return Number.isFinite(h)?h:1}catch{return 1}});i.useEffect(()=>{try{localStorage.setItem(e,String(r))}catch{}},[e,r]);const C=E=>{c(typeof E=="function"?h=>a(E(h)):a(E))},d=()=>C(E=>+(E+o).toFixed(6)),f=()=>C(E=>+(E-o).toFixed(6)),s=r<n-Number.EPSILON,g=r>t+Number.EPSILON,p=Math.round(u*r),w=Math.round(p*l);return{scale:r,setScale:C,increase:d,decrease:f,canIncrease:s,canDecrease:g,fontSize:p,lineHeight:w}}const Iu=i.createContext(null);function vt(e){return/max-width:\s*7[0-9][0-9]px/.test(e)}function Ft(e){const u=i.useContext(Iu),t=l=>typeof window>"u"||!window.matchMedia?!1:window.matchMedia(l).matches,[n,o]=i.useState(t(e));return i.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const l=window.matchMedia(e),a=c=>o(c.matches),r=l;return r.addEventListener?r.addEventListener("change",a):r.addListener&&r.addListener(a),o(l.matches),()=>{r.removeEventListener?r.removeEventListener("change",a):r.removeListener&&r.removeListener(a)}},[e]),u&&typeof u.mobile=="boolean"&&vt(e)?u.mobile:n}function Ru(e){const u=i.useRef(e);return i.useEffect(()=>{u.current=e}),u}function Lu(e,u){const t=Ru(u);i.useEffect(()=>{const n=()=>t.current();try{window.addEventListener(e,n)}catch{}return()=>{try{window.removeEventListener(e,n)}catch{}}},[e,t])}const au=" \xB7 ",Mu=(()=>{if(typeof document>"u")return"";const e=document.title;return e.includes(au)?e.split(au).pop()??e:e})(),ku=i.createContext(!1);function Vt(e){const u=i.useContext(ku);i.useEffect(()=>{if(u||typeof e!="string"||!e)return;const t=document.title;return document.title=Mu?`${e}${au}${Mu}`:e,()=>{document.title=t}},[e,u])}function Ht(){const{t:e}=Se.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])}function $t(e){const[u,t]=i.useState({current:"",next:"",confirm:""}),[n,o]=i.useState(null),[l,a]=i.useState(!1),r=i.useRef(null);i.useEffect(()=>()=>{r.current!==null&&clearTimeout(r.current)},[]);const c=i.useCallback(()=>{t({current:"",next:"",confirm:""}),o(null)},[]),C=i.useCallback(async()=>{if(!u.current){o({type:"error",text:"\uD604\uC7AC \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC138\uC694."});return}if(!u.next){o({type:"error",text:"\uC0C8 \uBE44\uBC00\uBC88\uD638\uB97C \uC785\uB825\uD558\uC138\uC694."});return}if(u.next!==u.confirm){o({type:"error",text:"\uC0C8 \uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."});return}a(!0);const d=e?await e(u.current,u.next):null;if(a(!1),d){o({type:"error",text:d});return}o({type:"success",text:"\uBE44\uBC00\uBC88\uD638\uAC00 \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4."}),t({current:"",next:"",confirm:""}),r.current!==null&&clearTimeout(r.current),r.current=setTimeout(()=>o(null),1500)},[u,e]);return{pw:u,setPw:t,pwMsg:n,setPwMsg:o,pwLoading:l,handleChangePw:C,reset:c}}const q=["\u3131","\u3132","\u3134","\u3137","\u3138","\u3139","\u3141","\u3142","\u3143","\u3145","\u3146","\u3147","\u3148","\u3149","\u314A","\u314B","\u314C","\u314D","\u314E"],ae=["\u314F","\u3150","\u3151","\u3152","\u3153","\u3154","\u3155","\u3156","\u3157","\u3158","\u3159","\u315A","\u315B","\u315C","\u315D","\u315E","\u315F","\u3160","\u3161","\u3162","\u3163"],Q=["","\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 V(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 Gt(){const e=new Map;return u=>{let t=e.get(u);return t||(t=[...u].map(n=>V(n)),e.set(u,t)),t}}function de(e,u,t=0){return String.fromCharCode(44032+(e*21+u)*28+t)}function Yt(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 l=V(e[o]),a=V(u[o]);if(!l||!a)return"random";if(l.cho===a.cho&&l.jung===a.jung&&l.jong===a.jong)continue;t++;const r=l.cho!==a.cho,c=l.jung!==a.jung,C=l.jong!==a.jong;(r?1:0)+(c?1:0)+(C?1:0)>1?n="multi":r?n="cho":c?n="jung":n="jong"}return t!==1?"random":n==="cho"?"cho":n==="jung"?"jung":n==="jong"?"jong":"random"}const we={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(we).map(([e,u])=>[u.join(""),Q[Number(e)]]));function Ut(e,u){if(!e||!u)return!1;for(const t of e){const n=V(t);if(n){if(q[n.cho]===u)return!0;if(n.jong>0){if(Q[n.jong]===u)return!0;const o=we[n.jong];if(o&&o.includes(u))return!0}}}return!1}function He(e){if(!e)return 0;let u=0;for(const t of e)V(t)&&u++;return u}function Kt(e){if(!e)return!1;let u=!1;for(const t of e){const n=V(t);if(n&&(u=!0,n.jong>0))return!1}return u}function Wt(e,u){if(e.jong<=0)return!1;if(u.includes(Q[e.jong]))return!0;const t=we[e.jong];return!!t&&t.some(n=>u.includes(n))}function qt(e,u,t){if(!e)return!1;const n=[...e],o=l=>{const a=V(n[l]);if(!a||u.cho&&!u.cho.includes(q[a.cho])||u.jung&&!u.jung.includes(ae[a.jung]))return!1;if(u.jongNone){if(a.jong>0)return!1}else if(u.jong&&!Wt(a,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 l=1;l<n.length-1;l++)if(o(l))return!0;return!1}for(let l=0;l<n.length;l++)if(o(l))return!0;return!1}const zt={cho:q.length,jung:ae.length,jong:Q.length};function Jt(e,u,t,n,o=1/0){if(!e||t<1)return[];const l=[...e].map(f=>V(f));if(l.some(f=>!f))return[];const a=l,r=a.length;if(t>r)return[];const c=zt[u],C=new Set,d=[];(function f(s,g){if(g.length===t){d.push([...g]);return}for(let p=s;p<r;p++)g.push(p),f(p+1,g),g.pop()})(0,[]);for(const f of d)if((function s(g,p){if(C.size>=o)return;if(g===f.length){const h=p.map(S=>de(S.cho,S.jung,S.jong)).join("");h!==e&&n.has(h)&&C.add(h);return}const w=f[g],E=a[w][u];for(let h=0;h<c;h++){if(h===E)continue;const S=p.slice();if(S[w]={...p[w],[u]:h},s(g+1,S),C.size>=o)return}})(0,a),C.size>=o)break;return[...C]}function Zt(e,u){if(!e||!u||e.length!==u.length)return-1;let t=0;for(let n=0;n<e.length;n++){const o=V(e[n]),l=V(u[n]);if(!o||!l)return-1;o.cho!==l.cho&&t++,o.jung!==l.jung&&t++,o.jong!==l.jong&&t++}return t}const Pu="word_pair_index_v2",xu="word_pair_index_sig_v2";let be=null;function Qt(){try{if(typeof localStorage>"u")return null;const e=localStorage.getItem(Pu),u=localStorage.getItem(xu);return!e||!u?null:{index:JSON.parse(e),sig:u}}catch{return null}}function Ae(){if(be)return be;const e=Qt();return e?(be=e.index,e.sig,be):null}function Xt(){be=null;try{typeof localStorage<"u"&&(localStorage.removeItem(Pu),localStorage.removeItem(xu))}catch{}}const vu="word_image_existence_map_v1";let Ee=null;function Fu(){if(Ee)return Ee;try{const e=typeof localStorage<"u"?localStorage.getItem(vu):null;Ee=e?JSON.parse(e):{}}catch{Ee={}}return Ee}function en(e,u){return`${e}_${u??1}`}function un(e,u){const t=Fu(),n=en(e,u);return n in t?t[n]:void 0}function Vu(){const e=Fu(),u=Object.values(e);return u.length===0?null:{total:u.length,exists:u.filter(Boolean).length}}function tn(){Ee={};try{typeof localStorage<"u"&&localStorage.removeItem(vu)}catch{}}const Hu=[{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 $u(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 nn(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 on(e){const{t:u}=Se.useTranslation(),[t,n]=i.useState({}),[o,l]=i.useState(null),[a,r]=i.useState(null),[c,C]=i.useState(null),d=i.useCallback(()=>{const s={};Hu.forEach(g=>{s[g.id]=$u([...g.keys])}),n(s),typeof navigator<"u"&&navigator.storage?.estimate&&navigator.storage.estimate().then(g=>{C({usage:g.usage??0,quota:g.quota??0})}).catch(()=>{})},[]);i.useEffect(()=>{d()},[d]);const f=i.useCallback(async s=>{l(s);try{s==="wordData"?(localStorage.removeItem("word_data_cache"),localStorage.removeItem("word_data_version")):s==="pairIndex"?Xt():s==="imageCache"&&tn(),d(),e?.(u("settings.cache.cleared","\uCE90\uC2DC\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4."))}finally{l(null)}},[d,e,u]);return{cacheSizes:t,clearingId:o,confirmCacheId:a,setConfirmCacheId:r,storageEstimate:c,refreshCacheSizes:d,handleClearCache:f}}function ln(e){const[u,t]=i.useState(null),[n,o]=i.useState(null),l=i.useCallback(()=>{const a=Ae();if(a){const c=Object.values(a),C=c.filter(d=>d.cho.length+d.jung.length+d.jong.length>0).length;t({matched:C,total:c.length})}else t(null);const r=Vu();o(r?{exists:r.exists,total:r.total}:null)},[]);return i.useEffect(()=>{l();const a=setTimeout(l,1e3);return()=>clearTimeout(a)},[e?.length,l]),{pairStats:u,imgStats:n,setPairStats:t,setImgStats:o,refreshStats:l}}function Gu(e,u=[]){const[t,n]=i.useState(u),[o,l]=i.useState(null),[a,r]=i.useState(!1),[c,C]=i.useState(e),d=i.useRef(a);i.useEffect(()=>{d.current=a});const f=i.useRef(null);i.useEffect(()=>{if(d.current)return;const h=f.current;h!==null&&h.length===u.length&&h.every((S,B)=>S===u[B])||(f.current=u,n(u))},[u]);const s=i.useCallback(h=>{l(h),r(!1),C({...h})},[]),g=i.useCallback(()=>r(!0),[]),p=i.useCallback(()=>r(!1),[]),w=i.useCallback((h,S)=>{n(h),l(S),r(!1)},[]),E=i.useCallback(h=>{n(S=>S.filter(B=>B!==h)),l(null)},[]);return{list:t,setList:n,selected:o,setSelected:l,isEditing:a,setIsEditing:r,editForm:c,setEditForm:C,openDetail:s,startEditing:g,cancelEditing:p,commitEdit:w,remove:E}}const _e=()=>{const e=new Date;return{year:String(e.getFullYear()),month:String(e.getMonth()+1).padStart(2,"0"),day:String(e.getDate()).padStart(2,"0")}},rn={year:"",month:"",day:"",hour:"09",minute:"00",memo:""};function an(e=[]){const{list:u,setList:t,selected:n,setSelected:o,isEditing:l,setIsEditing:a,editForm:r,setEditForm:c,openDetail:C,commitEdit:d}=Gu(rn,e),{year:f,month:s,day:g}=_e(),[p,w]=i.useState({year:f,month:s,day:g,hour:"09",minute:"00",memo:""});return{visitHistory:u,visitForm:p,setVisitForm:w,setVisit:E=>h=>w(S=>({...S,[E]:h})),selectedVisit:n,setSelectedVisit:o,isEditingVisit:l,setIsEditingVisit:a,editVisitForm:r,setEditVisitForm:c,openVisitDetail:C,handleVisitSave:E=>{t(A=>[p,...A]);const{year:h,month:S,day:B}=_e();w({year:h,month:S,day:B,hour:"09",minute:"00",memo:""}),E?.()},handleVisitEditSave:()=>{d(E=>E.map(h=>h===n?r:h),r)},addVisit:E=>{t(h=>[E,...h])},removeVisit:E=>{t(h=>h.filter(S=>S!==E))},revertVisitEdit:(E,h)=>{t(S=>S.map(B=>B===h?E:B)),o(S=>S===h?E:S)}}}const Yu=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")}`,$e=e=>[...e].sort((u,t)=>{const n=Yu(u),o=Yu(t);return n<o?-1:n>o?1:0}),sn={year:"",month:"",day:"",hour:"09",minute:"00",memo:""};function cn(e,u=[]){const t=i.useMemo(()=>$e(u),[u]),{list:n,setList:o,selected:l,setSelected:a,isEditing:r,setIsEditing:c,editForm:C,setEditForm:d,openDetail:f,commitEdit:s,remove:g}=Gu(sn,t),[p,w]=i.useState([]),{year:E,month:h,day:S}=_e(),[B,A]=i.useState({year:E,month:h,day:S,hour:"09",minute:"00",memo:""}),D=T=>P=>A(G=>({...G,[T]:P})),b=T=>{o(le=>$e([...le,B]));const{year:P,month:G,day:X}=_e();A({year:P,month:G,day:X,hour:"09",minute:"00",memo:""}),T?.()},I=()=>{s(T=>$e(T.map(P=>P===l?C:P)),C)},L=i.useCallback(T=>{g(T)},[g]),F=i.useCallback(T=>{e({year:T.year,month:T.month,day:T.day,hour:T.hour,minute:T.minute,memo:T.memo}),g(T)},[e,g]),j=i.useCallback(T=>{o(P=>P.filter(G=>G!==T)),w(P=>[T,...P]),a(null)},[o,a]),H=i.useCallback(T=>{o(P=>$e([...P,T]))},[o]),k=i.useCallback(T=>{o(P=>P.filter(G=>G!==T))},[o]),v=i.useCallback((T,P)=>{o(G=>G.map(X=>X===P?T:X)),a(G=>G===P?T:G)},[o,a]);return{scheduleList:n,noShowList:p,addSchedule:H,removeSchedule:k,revertScheduleEdit:v,scheduleForm:B,setScheduleForm:A,setSchedule:D,selectedSchedule:l,setSelectedSchedule:a,isEditingSchedule:r,setIsEditingSchedule:c,editScheduleForm:C,setEditScheduleForm:d,openScheduleDetail:f,handleScheduleSave:b,handleScheduleEditSave:I,handleScheduleDelete:L,handleScheduleToVisit:F,handleScheduleNoVisit:j}}const iu=[{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 Cn(e){const[u,t]=i.useState(""),[n,o]=i.useState("25"),[l,a]=i.useState("all"),[r,c]=i.useState(1),C=i.useMemo(()=>e.filter(({item:g,status:p})=>!(u&&!g.memo.includes(u)||l!=="all"&&p!==l)),[e,u,l]),d=Math.max(1,Math.ceil(C.length/Number(n))),f=Math.min(r,d),s=i.useMemo(()=>C.slice((f-1)*Number(n),f*Number(n)),[C,f,n]);return{vapSearch:u,setVapSearch:t,vapPageSize:n,setVapPageSize:o,vapStatus:l,setVapStatus:a,vapPage:f,setVapPage:c,vapFiltered:C,vapTotal:d,vapPageItems:s}}function dn(e,u,t){const{t:n}=Se.useTranslation(),[o,l]=i.useState(()=>{const p=t?.initialPageSize;return p&&iu.some(w=>w.value===p)?p:"25"}),[a,r]=i.useState(1),[c,C]=i.useState(u);c!==u&&(C(u),a!==1&&r(1));const d=i.useMemo(()=>iu.map(p=>({...p,label:n("visits.showN",{n:p.value})})),[n]),f=i.useCallback(p=>{l(p),r(1)},[]),s=Math.max(1,Math.ceil(e.length/Number(o))),g=Math.min(a,s);return{pageRows:i.useMemo(()=>e.slice((g-1)*Number(o),g*Number(o)),[e,g,o]),pageSizeProps:{options:d,value:o,onChange:f},paginationProps:{page:g,total:s,onChange:r},setPage:r}}function fn(){const[e,u]=i.useState(null),t=i.useCallback(o=>{u(l=>l?.key===o?{key:o,asc:!l.asc}:{key:o,asc:!0})},[]),n=i.useCallback((o,l)=>({label:o,sortDir:e?.key===l?e.asc?"asc":"desc":null,onClick:()=>t(l)}),[e,t]);return{\uC815\uB82C:e,\uCE78:n}}function gn(){const[e,u]=i.useState(!1),[t,n]=i.useState("\uC88C"),[o,l]=i.useState({\uC88C:null,\uC6B0:null}),[a,r]=i.useState({\uC88C:[],\uC6B0:[]}),[c,C]=i.useState(!1),[d,f]=i.useState("\uC88C"),s=i.useCallback(p=>{const w=p.direction;l(E=>({...E,[w]:p})),r(E=>({...E,[w]:[p,...E[w]]})),u(!1)},[]),g=i.useCallback(p=>{const w=p.direction;l(E=>({...E,[w]:p})),C(!1)},[]);return{showDevice:e,setShowDevice:u,deviceDirection:t,setDeviceDirection:n,devices:o,setDevices:l,deviceHistory:a,setDeviceHistory:r,showDeviceList:c,setShowDeviceList:C,listForSide:d,setListForSide:f,handleDeviceSubmit:s,handleSelectFromList:g}}const hn="__ihab_core_word_pool__";function Ge(){return globalThis[hn]??null}function x(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 ie(e,u,t=Math.random){return!Array.isArray(e)||e.length===0||u<=0?[]:u>=e.length?x(e,t):x(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"}},mn=q.indexOf("\u3147"),Uu={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!==mn},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}},pn={\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"},Sn={\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 Ku(e){return pn[e]??e}const cu={cho:q,jung:ae,jong:Q},K=e=>Array.isArray(e)?e.length>0:!!e;function Cu(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 En(e,u,t){const n=t.pronOf(e),o=t.decompOf,l=t.sameStructureOnly&&o?o(n):null,a=[];for(const r of u)r!==e&&(t.okSet&&!t.okSet.has(r)||t.pronOf(r)!==n&&(l&&o&&Cu(l,o(t.pronOf(r)))||a.push(r)));return a}function Wu(e,u,t){const n=u?.[e];if(!n)return[];const o=t.kind?n[t.kind]??[]:[...n.cho??[],...n.jung??[],...n.jong??[]];return En(e,o,t)}function yn(e,u,t,n,o,l,a){const r=["cho","jung","jong"].filter(s=>K(e[s])),c={};for(const s of r){const g=e[s];c[s]=new Set(Array.isArray(g)?g:[g])}const C=o==="pron",d=new Map;for(const s of u){const g=t(l(s));if(g.some(h=>!h))continue;let p=g;if(!C&&(p=t(s),p.length!==g.length||p.some(h=>!h)))continue;const w=g.length,E=d.get(w);E?E.push({w:s,dPron:g,dPos:p}):d.set(w,[{w:s,dPron:g,dPos:p}])}const f=new Map;for(const[s,g]of d){const p=new Map,w=(E,h)=>{const S=E.dPos[h];return S!=null&&r.every(B=>c[B].has(cu[B][S[B]]))};for(const E of g){let h;if(a==="head")h=w(E,0)?0:-1;else if(a==="tail")h=w(E,s-1)?s-1:-1;else if(a==="mid"){h=-1;for(let B=1;B<s-1;B++)if(w(E,B)){h=B;break}}else h=E.dPos.findIndex(B=>B!=null&&r.every(A=>c[A].has(cu[A][B[A]])));if(h<0)continue;const S=p.get(h);S?S.push(E):p.set(h,[E])}for(const[E,h]of p){const S=new Set(r.map(D=>E+":"+D)),B=D=>{let b="";for(let I=0;I<s;I++){const L=D[I];for(const F of["cho","jung","jong"])b+=(S.has(I+":"+F)?"*":L[F])+"."}return b},A=new Map;for(const D of g){const b=B(D.dPron),I=A.get(b);I?I.push(D):A.set(b,[D])}for(const D of h){const b=A.get(B(D.dPron))??[],I=[];for(const L of b){if(L.w===D.w)continue;let F=!0;for(const j of r){const H=D.dPron[E][j],k=L.dPron[E][j];if(k===H){F=!1;break}if(C&&c[j].has(cu[j][k])){F=!1;break}}F&&(n&&Cu(D.dPron,L.dPron)||I.push(L.w))}f.set(D.w,I)}}}return f}const Bn=e=>e==null?[]:Array.isArray(e)?e:[e];function wn(e){if([...e].length!==1)return"";const u=V(e);if(!u)return"";const t=Ku(Q[u.jong]),n=t===""?0:Q.indexOf(t);return de(u.cho,u.jung,n<0?0:n)}function qu(e,u){return u.get(e)||wn(e)||e}function du(e){return e?K(e.cho)?"cho":K(e.jung)?"jung":K(e.jong)?"jong":null:null}function ye(e,u){const t=(n,o)=>!K(n)||Bn(n).includes(o);return t(u.cho,q[e.cho])&&t(u.jung,ae[e.jung])&&t(u.jong,Q[e.jong])}function De(e,u,t){const n=[...e];if(t!=="pron")return n.map(l=>V(l));const o=[...u.get(e)||e];return o.length!==n.length?n.map(l=>V(l)):o.map(l=>V(l))}function Oe(e,u,t,n,o){const l=u==="cho"?q:u==="jung"?ae:Q,a=e[u],r=[],c=new Set([qu(t,o)]),C=x(l.map((d,f)=>f).filter(d=>d!==a&&(u!=="cho"||l[d]!=="\u3147")&&(u!=="jong"||d!==0)));for(const d of C){if(r.length>=n)break;const f=u==="cho"?de(d,e.jung,e.jong):u==="jung"?de(e.cho,d,e.jong):de(e.cho,e.jung,d),s=qu(f,o);c.has(s)||(c.add(s),r.push(f))}return r}function bn(e,u,t,n,o,l=null){const a=[...e];if(a.length!==2)return null;const r=a.map(f=>V(f));if(r.some(f=>!f))return null;const c=De(e,t,n);if(c.some(f=>!f))return null;const C=du(u);let d=C&&u?c.map((f,s)=>ye(f,u)?s:-1).filter(f=>f>=0):[0,1];if(l!=null&&(d=d.filter(f=>f!==l)),!d.length)return null;for(const f of x(d)){const s=a[f];if(!o.has(s))continue;const g=Oe(r[f],C??"cho",s,40,t),p=[];for(const w of g)if(w!==s&&o.has(w)&&!p.includes(w)&&p.push(w),p.length>=2)break;if(!(p.length<2))return{question:e,distractors:[s,...p]}}return null}function An(e,u,t,n,o,l=null){const a=[...e];if(a.length!==3)return null;const r=a.map(f=>V(f));if(r.some(f=>!f))return null;const c=De(e,t,n);if(c.some(f=>!f))return null;const C=du(u),d=C&&u?c.map((f,s)=>ye(f,u)?s:-1).filter(f=>f>=0):[0,1,2];if(!d.length)return null;for(const f of x(d))for(const s of x([0,1,2].filter(g=>g!==f&&(l==null||g===l)))){const g=[0,1,2].filter(S=>S!==s),p=g.map(S=>a[S]).join("");if(!o.has(p))continue;const w=g.indexOf(f),E=Oe(r[f],C??"cho",a[f],40,t),h=[];for(const S of E){const B=g.map(D=>a[D]);B[w]=S;const A=B.join("");if(A!==p&&o.has(A)&&!h.includes(A)&&h.push(A),h.length>=2)break}if(!(h.length<2))return{question:e,distractors:[p,...h]}}return null}function _n(e,u,t,n,o,l=null){const a=[...e],r=a.length;if(r<2)return null;const c=[];for(let d=1;d<=r-1;d++)c.push({remain:a.slice(0,d).join(""),dropped:a.slice(d).join(""),droppedEnd:1}),c.push({remain:a.slice(r-d).join(""),dropped:a.slice(0,r-d).join(""),droppedEnd:0});const C=du(u);for(const{remain:d,dropped:f,droppedEnd:s}of x(c)){if(l!=null&&s!==l||d===e||!o.has(d)||!o.has(f))continue;const g=[...d],p=g.map(h=>V(h));if(p.some(h=>!h))continue;const w=De(d,t,n);if(w.some(h=>!h))continue;const E=C&&u?w.map((h,S)=>ye(h,u)?S:-1).filter(h=>h>=0):g.map((h,S)=>S);if(E.length)for(const h of x(E)){const S=Oe(p[h],C??"cho",g[h],40,t),B=[];for(const A of S){const D=[...g];D[h]=A;const b=D.join("");if(b!==d&&o.has(b)&&!B.includes(b)&&B.push(b),B.length>=2)break}if(B.length>=2)return{question:e,distractors:[d,...B]}}}return null}function Dn(e,u,t,n,o,l=null){if([...e].length!==1)return null;const a=V(t.get(e)||e);if(!a||a.jong===0)return null;const r=de(a.cho,a.jung,0),c=Oe({cho:a.cho,jung:a.jung,jong:0},"cho",r,2,t);return c.length<2?null:{question:e,distractors:[r,...c]}}const fu=q.indexOf("\u3147");function On(e,u,t,n,o,l=null){if([...e].length!==1)return null;const a=V(t.get(e)||e);if(!a||a.jong!==0||a.cho===fu)return null;const r=de(fu,a.jung,0),c=Oe({cho:fu,jung:a.jung,jong:0},"jung",r,2,t);return c.length<2?null:{question:e,distractors:[r,...c]}}function Nn(e){const u=new Map;for(const t of e){const n=[...t],o=n.length;if(!(o<2||o>3))for(let l=0;l<o;l++){let a=o+"|"+l+"|";for(let c=0;c<o;c++)a+=c===l?"*":n[c];const r=u.get(a);r?r.push(t):u.set(a,[t])}}return u}function Tn(e,u,t,n,o,l=null,a=null,r=2){const c=[...e],C=c.length;if(C<2||C>3)return null;const d=c.map(S=>V(S));if(d.some(S=>!S))return null;const f=De(e,t,n);if(f.some(S=>!S))return null;const s=S=>t.get(S)??S,g=s(e),p=!!u&&(K(u.cho)||K(u.jung)||K(u.jong)),w=!!a&&(K(a.cho)||K(a.jung)||K(a.jong)),E=S=>{let B=C+"|"+S+"|";for(let A=0;A<C;A++)B+=A===S?"*":c[A];return B};let h;if(l!=null){if(l>=C||p&&!ye(f[l],u))return null;h=[l]}else p?h=f.map((S,B)=>ye(S,u)?B:-1).filter(S=>S>=0):h=Array.from({length:C},(S,B)=>B);for(const S of x(h)){const B=o.get(E(S))??[],A=[],D=[];for(const j of B){if(j===e)continue;const H=[...j].map(P=>V(P)),k=d[S],v=H[S];if(!k||!v)continue;let T=0;if(k.cho!==v.cho&&T++,k.jung!==v.jung&&T++,k.jong!==v.jong&&T++,!(T<r||s(j)===g))if(w){const P=De(j,t,n)[S];P&&ye(P,a)?A.push(j):D.push(j)}else A.push(j)}if(!A.length)continue;const b=x(A)[0],I=[],L=new Set([g,s(b)]),F=w?D:A.filter(j=>j!==b);for(const j of x(F)){const H=s(j);if(!L.has(H)&&(L.add(H),I.push(j),I.length>=2))break}if(!w&&I.length<2)for(const j of x(B)){if(j===e||j===b)continue;const H=s(j);if(!L.has(H)&&(L.add(H),I.push(j),I.length>=2))break}if(!(I.length<2))return{question:e,distractors:[b,...I]}}return null}let Ye=null,zu=null,Ju=null;function jn(){const e=Ge();if(e&&e.entries.length>0){const u=Ae();if(Ye&&zu===e&&Ju===u)return Ye;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 Ye=n,zu=e,Ju=u,Ye}return[]}const ue=new Proxy([],{get(e,u){const t=jn(),n=t[u];return typeof n=="function"?n.bind(t):n}});function Ue(e){return e.length?e[Math.floor(Math.random()*e.length)]:void 0}function te(e,u){if(u>=e.length)return x(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)),l=t[n];t[n]=t[o],t[o]=l}return t.slice(0,u)}let gu=null,Zu=null;function fe(){const e=Ge();if(gu&&Zu===e)return gu;const u=new Map;for(const t of ue)t.w&&u.set(t.w,t.pron);return gu=u,Zu=e,u}function J(e){return fe().get(e)||e}function hu(e,u,t=new Set){const n=[];for(const o of x(e)){if(n.length>=u)break;const l=J(o);t.has(l)||(t.add(l),n.push(o))}return n}let In=0;function z(e){return`${e}-rt-${++In}`}function Ne(e){const u=Vu();if(!u||u.total===0){const n=new Set;for(const o of e)n.add(o);return n}const t=new Set;for(const n of e)un(n)===!0&&t.add(n);return t}const Ke=new Map;let Qu=null,Xu=null;function Te(e){return e==null?"":Array.isArray(e)?e.slice().sort().join(","):e}function et(e){const u=Te(e.choseong),t=e.composition,n=t?.syllable==null?"":Array.isArray(t.syllable)?t.syllable.slice().sort().join(","):String(t.syllable),o=t?`${Te(t.cho)}/${Te(t.jung)}/${Te(t.jong)}/${t.jongNone?"N":""}/${n}`:"",l=Te(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${l}|t${e.targetSyllable??""}|c${e.choicesPerItem??""}`}async function Z(e){const u=Ge(),t=Ae();(u!==Qu||t!==Xu)&&(Ke.clear(),Qu=u,Xu=t);const n=et(e);return Ke.has(n)||Ke.set(n,Ln(e)),Ke.get(n)}function Rn(e){if(!e)return null;const u=a=>a==null?null:Array.isArray(a)?a.length?a:null:[a],t=u(e.cho),n=u(e.jung),o=!!e.jongNone,l=o?null:u(e.jong);return t||n||l||o?o&&!t&&!n&&!l?a=>Kt(a):a=>qt(a,{cho:t,jung:n,jong:l,jongNone:o}):null}async function Ln(e){const{difficulty:u=null,choseong:t=null,composition:n=null,targetSyllable:o=null,excludeNoImage:l=!1}=e,a=e.grade&&e.grade.length>0?new Set(e.grade):null,r=e.sameStructureOnly??!0,c=e.phonemeView==="pron"?"pron":"char",C=Math.max(1,e.contrastCount??1),d=u==="cho"||u==="jung"||u==="jong",f=d&&C>=2,s=u==="count",g=t?new Set(Array.isArray(t)?t:[t]):null,p=n?.syllable!=null?new Set(Array.isArray(n.syllable)?n.syllable:[n.syllable]):null,w=n?[Rn(n),p?y=>p.has(He(y)):null].filter(y=>y!=null):[],E=u==="random"||u===null,h=E||s,S=E||f||s;let B=ue.filter(y=>!y.w||a&&(!y.grade||!a.has(y.grade))?!1:S?!0:Array.isArray(y.p)&&y.p.length>0);g&&(B=B.filter(y=>{for(const _ of g)if(Ut(y.w,_))return!0;return!1})),w.length>0&&(B=B.filter(y=>{const _=c==="pron"?J(y.w):y.w;return w.every(Y=>Y(_))})),o&&(B=B.filter(y=>y.w[0]===o));let A;if(l){const y=new Set;for(const _ of B)if(y.add(_.w),Array.isArray(_.p))for(const Y of _.p)y.add(Y);if(h)for(const _ of ue)_.w&&y.add(_.w);A=Ne(y)}else{const y=new Set;for(const _ of B)if(y.add(_.w),Array.isArray(_.p))for(const Y of _.p)y.add(Y);if(h)for(const _ of ue)_.w&&y.add(_.w);A=y}let D=null;if(f){const y=new Set;for(const _ of ue)_.w&&y.add(_.w);D=l?Ne(y):y}const b=B.filter(y=>A.has(y.w)),I=600,L=Array.from(A),F=L.length>I?te(L,I):L,j=s&&n!=null&&(K(n.cho)||K(n.jung)||K(n.jong)),H=2500,k=new Map;if(s&&!j&&C>=2){for(const y of L){const _=He(y),Y=k.get(_);Y?Y.push(y):k.set(_,[y])}for(const[y,_]of k)_.length>H&&k.set(y,te(_,H))}const v=Gt(),T=j?yn(n,L,v,r,c,J):null,P=500,G=1500,X=e.fullCount?b:u==="random"?b.length>P?te(b,P):b:b.length>G?te(b,G):b,le=Ae(),re=[];for(const y of X){let _;const Y=J(y.w);if(f)_=Jt(y.w,u,C,D,24).filter($=>J($)!==Y);else if(s)j?_=(T.get(y.w)??[]).filter($=>J($)!==Y):C<=1?_=Wu(y.w,le,{okSet:A,pronOf:J,decompOf:v,sameStructureOnly:!1}):_=(k.get(He(y.w))??[]).filter($=>{if($===y.w||J($)===Y)return!1;const ee=Zt(y.w,$);return C>=5?ee>=5:ee===C});else if(E)_=F.filter($=>$!==y.w&&$.length===y.w.length&&J($)!==Y);else{const $=u;_=Wu(y.w,le,{kind:$,okSet:A,pronOf:J,decompOf:v,sameStructureOnly:!1}),_.length===0&&(_=(F.length>30?te(F,30):F).filter(ee=>ee!==y.w&&Yt(y.w,ee)===u&&J(ee)!==Y))}if(r&&_.length>0&&(d||s&&!j)){const $=v(J(y.w));_=_.filter(ee=>!Cu($,v(J(ee))))}_.length!==0&&re.push({word:y,usable:_})}return re}async function ut(e,u){const{choicesPerItem:t=3,count:n=10}=u,o=t-1,l=(await Z(u)).filter(r=>r.usable.length>=o),a=[];for(const r of x(l)){if(a.length>=n)break;const c=hu(r.usable,o);if(c.length<o)continue;const C=x([r.word.w,...c]);a.push({id:z(e+"-item"),index:a.length+1,word:r.word.w,syllables:r.word.s,choices:C,answerIndex:C.indexOf(r.word.w)})}return a}async function Mn(e){const{choicesPerItem:u=3,count:t=10}=e,n=u-1,o=await Z({...e,difficulty:null});if(o.length<u)return[];const l=[],a=x([...o]);for(const r of a){if(l.length>=t)break;const c=r.word.w,C=[...r.word.pron||c],d=Ue(C);if(!d)continue;const f=o.filter(p=>p.word.w!==c&&p.word.s===r.word.s&&!(p.word.pron||p.word.w).includes(d)&&p.word.pron!==r.word.pron);if(f.length<n)continue;const s=hu(f.map(p=>p.word.w),n);if(s.length<n)continue;const g=x([c,...s]);l.push({id:z("HPI-item"),index:l.length+1,targetSyllable:d,word:c,choices:g,answerIndex:g.indexOf(c)})}return l}async function kn(e){const{count:u=10}=e,t=(await Z(e)).filter(n=>n.usable.length>=1);return Array.from({length:u},(n,o)=>{const l=Ue(t);if(!l)return null;const a=o%2===0;let r;if(a)r=[l.word.w,l.word.w];else{const c=Ue(l.usable);r=Math.random()<.5?[l.word.w,c]:[c,l.word.w]}return{id:z("SOD-item"),index:o+1,word:l.word.w,pair:r,same:a}}).filter(n=>!!n)}async function Pn(e){const{choicesPerItem:u=3,count:t=10}=e,n=u-1,o=await Z({...e,difficulty:null});if(o.length<u+1)return[];const l=o.map(s=>s.word.w),a=new Map(o.map(s=>[s.word.w,s.word.pron])),r=s=>(a.get(s)||s)[0]??"",c={};for(const s of o){const g=r(s.word.w);g&&(c[g]||(c[g]=[]),c[g].push(s.word.w))}const C=Object.entries(c).filter(([,s])=>s.length>=2).map(([s])=>s);if(C.length===0)return[];const d=[],f=x([...C]);for(let s=0;d.length<t&&s<t*4;s++){const g=f[s%f.length],p=c[g];if(p.length<2)continue;const w=x([...p]),E=w[0],h=w[1];if(!E||!h||E===h||(a.get(E)||E)===(a.get(h)||h))continue;const S=a.get(h)||h,B=l.filter(b=>r(b)!==g&&b!==E&&b!==h&&b.length===h.length&&(a.get(b)||b)!==S);if(B.length<n)continue;const A=hu(B,n);if(A.length<n)continue;const D=x([h,...A]);d.push({id:z("SWS-item"),index:d.length+1,sourceWord:E,targetSyllable:g,word:h,choices:D,answerIndex:D.indexOf(h)})}return d}function tt(e,u,t){return te(e,u).map((n,o)=>{const l=Ue(n.usable)??"",a=[...n.word.w],r=[...l],c=a.findIndex((d,f)=>d!==r[f]),C=x(n.usable.filter(d=>d&&d!==l)).slice(0,2);return{id:z(t),index:o+1,word:n.word.w,original:n.word.w,changed:l,changedFrom:c>=0?a[c]:"",changedTo:c>=0?r[c]:"",distractors:C}})}async function nt(e,u,t){const{count:n=10}=u,o=fe(),l=ue.filter(g=>g.w&&g.s===e),a=u.excludeNoImage?Ne(l.map(g=>g.w)):null,r=a?l.filter(g=>a.has(g.w)):l,c=new Set(r.map(g=>g.w)),C=Nn(c),d=u.phonemeView??"char",f=u.composition??null,s=[];for(const g of x(r)){if(s.length>=n)break;const p=Tn(g.w,f,o,d,C,null,null);if(!p)continue;const w=p.distractors[0],E=[...g.w],h=[...w],S=E.findIndex((B,A)=>B!==h[A]);s.push({id:z(t),index:s.length+1,word:g.w,original:g.w,changed:w,changedFrom:S>=0?E[S]:"",changedTo:S>=0?h[S]:"",distractors:p.distractors.slice(1)})}return s}async function xn(e){return nt(2,e,"CS2-item")}async function vn(e){return nt(3,e,"CS3-item")}async function Fn(e){const u=(await Z({...e,difficulty:"count",contrastCount:1})).filter(t=>t.word.s===1&&t.usable.length>=1);return tt(u,e.count??10,"CP1-item")}async function Vn(e){const u=e.difficulty&&e.difficulty!=="random"?e.difficulty:"count",t=(await Z({...e,difficulty:u,contrastCount:1})).filter(n=>n.word.s===2&&n.usable.length>=1);return tt(t,e.count??10,"CP2-item")}async function Hn(e){const{count:u=10}=e,t=(await Z({...e})).filter(n=>n.word.s===2);return te(t,u).map((n,o)=>({id:z("M2S-item"),index:o+1,word:n.word.w,answer:n.word.w,parts:[...n.word.w]}))}async function $n(e){const{count:u=10}=e,t=(await Z({...e})).filter(n=>n.word.s===3);return te(t,u).map((n,o)=>({id:z("M3S-item"),index:o+1,word:n.word.w,answer:n.word.w,parts:[...n.word.w]}))}async function Gn(e){const{count:u=10}=e,t=(await Z({...e})).filter(r=>r.word.s===2),n=fe(),o=new Set(ue.map(r=>r.w)),l=e.phonemeView??"char",a=[];for(const r of x(t)){if(a.length>=u)break;const c=bn(r.word.w,e.composition??null,n,l,o);if(!c)continue;const[C,...d]=c.distractors,f=[...r.word.w],s=f[0]===C?f[1]:f[0];a.push({id:z("D2-item"),index:a.length+1,original:r.word.w,word:r.word.w,dropped:s,missingResult:C,distractors:d})}return a}async function Yn(e){const{count:u=10}=e,t=(await Z({...e})).filter(r=>r.word.s===3),n=fe(),o=new Set(ue.map(r=>r.w)),l=e.phonemeView??"char",a=[];for(const r of x(t)){if(a.length>=u)break;const c=An(r.word.w,e.composition??null,n,l,o);if(!c)continue;const[C,...d]=c.distractors,f=[...r.word.w];let s="";for(let g=0;g<f.length;g++)if(f.filter((p,w)=>w!==g).join("")===C){s=f[g];break}a.push({id:z("D3-item"),index:a.length+1,original:r.word.w,word:r.word.w,dropped:s,missingResult:C,distractors:d})}return a}async function Un(e){const{count:u=10}=e,t=(await Z({...e})).filter(r=>r.word.s>=2),n=fe(),o=new Set(ue.map(r=>r.w)),l=e.phonemeView??"char",a=[];for(const r of x(t)){if(a.length>=u)break;const c=_n(r.word.w,e.composition??null,n,l,o);if(!c)continue;const[C,...d]=c.distractors,f=r.word.w,s=f.startsWith(C)?f.slice(C.length):f.endsWith(C)?f.slice(0,f.length-C.length):"";a.push({id:z("DPC-item"),index:a.length+1,original:f,word:f,dropped:s,missingResult:C,distractors:d})}return a}async function Kn(e){const{count:u=10}=e,t=(await Z({...e})).map(n=>n.word.w);return t.length<3?[]:Array.from({length:u},(n,o)=>{const l=te(t,3);return{id:z("LRO-item"),index:o+1,sequence:l,choices:x(l)}})}function We(e,u,t){const n=ue.filter(a=>a.w&&a.s===e),o=u?Ne(n.map(a=>a.w)):null,l=[];for(const a of n)if(!(o&&!o.has(a.w))){if(t){const r=V(a.w);if(!r||!t(r))continue}l.push(a)}return l}function Wn(e){const u=We(1,e.excludeNoImage??!1,t=>t.jong===0);return te(u,e.count??10).map((t,n)=>{const o=V(t.w);return{id:z("M2P-item"),index:n+1,parts:[q[o.cho],ae[o.jung]],answer:t.w,word:t.w}})}function qn(e){const u=We(1,e.excludeNoImage??!1,t=>t.jong>0&&!we[t.jong]);return te(u,e.count??10).map((t,n)=>{const o=V(t.w);return{id:z("M3P-item"),index:n+1,parts:[q[o.cho],ae[o.jung],Q[o.jong]],answer:t.w,word:t.w}})}function zn(e){const u=Uu.DROP_FINAL_CONSONANT_FROM_1SYLL,t=We(u.syllables,e.excludeNoImage??!1,u.syllable),n=fe(),o=[];for(const l of x(t)){if(o.length>=(e.count??10))break;const a=Dn(l.w,null,n);if(!a)continue;const[r,...c]=a.distractors;o.push({id:z("DFC-item"),index:o.length+1,original:l.w,word:l.w,result:r,distractors:c})}return o}function Jn(e){const u=Uu.REMOVE_CONSONANT_AND_IDENTIFY_PHONEME,t=We(u.syllables,e.excludeNoImage??!1,u.syllable),n=fe(),o=[];for(const l of x(t)){if(o.length>=(e.count??10))break;const a=On(l.w,null,n);if(!a)continue;const r=V(n.get(l.w)||l.w);if(!r)continue;const[c,...C]=a.distractors;o.push({id:z("RCP-item"),index:o.length+1,base:l.w,word:l.w,missingConsonant:q[r.cho],remaining:c,distractors:C})}return o}const qe=new Map;let ot=null,lt=null;async function rt(e,u={}){const t=Ge(),n=Ae();(t!==ot||n!==lt)&&(qe.clear(),ot=t,lt=n);const o=`${e}:${et(u)}`;if(qe.has(o))return qe.get(o);const l=await Qn(e,u);return qe.set(o,l),l}const Zn={SAME_SOUND_PICK:e=>ut("SSP",e),HEAR_AND_PICK_SAME:e=>ut("HPS",e),HEAR_AND_PICK_INCLUDED:e=>Mn(e),SAME_OR_DIFF:e=>kn(e),STARTS_WITH_SAME_SOUND:e=>Pn(e),LISTEN_AND_REMEMBER_ORDER:e=>Kn(e),MERGE_2_SYLLABLES:e=>Hn(e),MERGE_3_SYLLABLES:e=>$n(e),MERGE_2_PHONEMES:e=>Wn(e),MERGE_3_PHONEMES:e=>qn(e),DROP_1_FROM_2SYLL:e=>Gn(e),DROP_1_FROM_3SYLL:e=>Yn(e),DROP_PART_FROM_COMPOUND:e=>Un(e),DROP_FINAL_CONSONANT_FROM_1SYLL:e=>zn(e),REMOVE_CONSONANT_AND_IDENTIFY_PHONEME:e=>Jn(e),CHANGE_1_SYLL_IN_2SYLL:e=>xn(e),CHANGE_1_SYLL_IN_3SYLL:e=>vn(e),CHANGE_1_PHONEME_IN_1SYLL:e=>Fn(e),CHANGE_1_PHONEME_IN_2SYLL:e=>Vn(e)};async function Qn(e,u={}){const t=Zn[e];return t?await t(u):[]}async function Xn(e){const u=[null,"count"],t=Object.keys(su);let n=0;for(const o of u)for(const l of t){const a=su[l];rt(l,{difficulty:a.difficulty?o:null,choseong:null,count:10,excludeNoImage:e}).catch(()=>{}),++n%6===0&&await new Promise(r=>setTimeout(r,0))}}async function eo(e){return(await Z({...e,fullCount:!0})).length}async function uo(e={}){const u=[];for(const r of ue)r.w&&u.push(r.w);const t=e.excludeNoImage?Ne(u):u,n=new Set,o=new Set,l=new Set,a=new Set;for(const r of t){a.add(He(r));for(const c of r){const C=V(c);if(C&&(q[C.cho]!=="\u3147"&&n.add(q[C.cho]),o.add(ae[C.jung]),C.jong>0)){l.add(Q[C.jong]);const d=we[C.jong];d&&d.forEach(f=>l.add(f))}}}return{cho:n,jung:o,jong:l,syllable:a}}const ge="\uC804\uCCB4";function at(){const{t:e}=Se.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 st(e){return{label:e.partOfSpeech,items:Object.keys(e.posMap),multiple:!0,allOption:!0}}function ct(e){return{label:e.wordType,items:Object.keys(e.typeMap),multiple:!0,allOption:!0}}function to(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 no(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 oo(e,u){const{label:t,headValue:n,midValue:o,tailValue:l,includeMid:a=!0,headDisabled:r,midDisabled:c,tailDisabled:C,allOptionDisabled:d,groupLabel:f,labelAction:s}=u;return{label:t,...f?{groupLabel:f}:{},...s?{labelAction:s}:{},allOption:!0,allLabel:e("wordSearch.filter.positionAny",{defaultValue:"\uBB34\uAD00"}),...d?{allOptionDisabled:d}:{},items:[{value:n,displayLabel:e("wordSearch.filter.positionHead",{defaultValue:"\uC5B4\uB450"}),disabled:r},...a?[{value:o,displayLabel:e("wordSearch.filter.positionMid",{defaultValue:"\uC5B4\uC911"}),disabled:c}]:[],{value:l,displayLabel:e("wordSearch.filter.positionTail",{defaultValue:"\uC5B4\uB9D0"}),disabled:C}]}}function lo(e,u,t){if(u===ge){const{[t]:l,...a}=e;return a}const n=e[t]??[],o=n.includes(u)?n.filter(l=>l!==u):[...n,u];if(o.length===0){const{[t]:l,...a}=e;return a}return{...e,[t]:o}}Object.fromEntries(Object.entries(Sn).map(([e,{nucleus:u}])=>[e,u]));const ro={\uACE0\uC720\uC5B4:"\uACE0\uC720",\uD55C\uC790\uC5B4:"\uD55C\uC790",\uC678\uB798\uC5B4:"\uC678\uB798",\uD63C\uC885\uC5B4:"\uD63C\uC885"},ao={"\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"]},io={difficulty:"\uB09C\uC774\uB3C4 \uB4F1\uAE09",syllables:"\uC74C\uC808 \uC218",syllable5plus:"5\uC74C\uC808 \uC774\uC0C1",partOfSpeech:"\uD488\uC0AC",wordType:"\uC720\uD615",posMap:ao,typeMap:ro};function so(e,u,t=io){const n=u[t.difficulty];if(n?.length&&!n.some(r=>e.grade===r.replace(/\D/g,"")))return!1;const o=u[t.syllables];if(o?.length){const r=e.syllables??0;if(!o.some(c=>c===t.syllable5plus?r>=5:r===parseInt(c)))return!1}const l=u[t.partOfSpeech];if(l?.length&&!l.flatMap(r=>t.posMap[r]??[r]).some(r=>(e.pos??"").includes(r)))return!1;const a=u[t.wordType];return!(a?.length&&!a.some(r=>e.wordType===t.typeMap[r]))}const co={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"})},Co={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"})},fo={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 Ct(e,u){if("place"in u)return co[u.place](e);const t=Co[u.vowel](e);return u.glide?`${t} \xB7 ${fo[u.glide](e)}`:t}const go=(e,{defaultValue:u})=>u,dt=(e,u)=>({jamos:e,phonetic:u,tooltip:Ct(go,u)}),se=(e,u)=>u.map(t=>dt([t],{place:e})),W=(e,u,t)=>dt([...e],t?{vowel:u,glide:t}:{vowel:u}),mu={cho:[se("labial",["\u3142","\u3143","\u314D","\u3141"]),se("alveolar",["\u3137","\u3138","\u314C","\u3134","\u3139"]),se("alveolar",["\u3145","\u3146"]),se("palatal",["\u3148","\u3149","\u314A"]),se("velar",["\u3131","\u3132","\u314B"]),se("glottal",["\u314E"])],jung:[[W("\u3163","frontHigh"),W("\u315F","frontHigh","w"),W("\u3162","frontHigh","velar")],[W("\u3161","backHighUnrounded")],[W("\u315C","backHighRounded"),W("\u3160","backHighRounded","j")],[W("\u3154\u3150","frontMid"),W("\u3156\u3152","frontMid","j"),W("\u3159\u315A\u315E","frontMid","w")],[W("\u3153","backMidUnrounded"),W("\u3155","backMidUnrounded","j"),W("\u315D","backMidUnrounded","w")],[W("\u3157","backMidRounded"),W("\u315B","backMidRounded","j")],[W("\u314F","low"),W("\u3151","low","j"),W("\u3158","low","w")]],jong:[se("labial",["\u3142","\u3141"]),se("alveolar",["\u3137","\u3134","\u3139"]),se("velar",["\u3131","\u3147"])]},ho=[...q],mo=[...ae],po=Q.filter(e=>e!==""),ce=e=>e===ne?[]:Array.from(e),ne="__NO_CODA__",ft=[1,2,3,4],oe=5,So=12,gt="SYL_",pu=e=>`${gt}${e}`,Eo=e=>Number(e.slice(gt.length));function Su(e){return e>=oe?Array.from({length:So-oe+1},(u,t)=>oe+t):[e]}const ht={cho:ho,jung:mo,jong:po},Eu=e=>e.map(u=>u.map(({jamos:t,phonetic:n,tooltip:o})=>({v:t.join(""),phonetic:n,tooltip:o}))),yu={cho:Eu(mu.cho),jung:Eu(mu.jung),jong:Eu(mu.jong)},mt={};yu.jung.flat().forEach(({v:e})=>{for(const u of ce(e))mt[u]=e});const yo=new Set(yu.cho.flat().map(e=>e.v));function pt(e,u){return e==="cho"?yo.has(u)?u:null:e==="jung"?mt[u]??u:Ku(u)}function St(e,u,t){if(e==="jung"){const n=ce(u);return t&&n.includes(t)?t:n[0]??u}return u}function Et(e,u,t){const n=(o,l)=>l?o==="jong"&&l===ne?ne:u==="pron"?pt(o,l):St(o,l,o==="jung"?t:null):null;return{...e,cho:n("cho",e.cho),jung:n("jung",e.jung),jong:n("jong",e.jong)}}const Bu={cho:null,jung:null,jong:null,syllable:null},Bo="wt_filter",yt=e=>`wt_filter_${e}`;function Bt(e){try{const u=localStorage.getItem(yt(e))??localStorage.getItem(Bo);if(u)return JSON.parse(u)}catch{}return null}function wo(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?{...Bu,cho:u.choseong}:Bu}function bo(e,u,t){const{t:n,i18n:o}=Se.useTranslation(),[l]=i.useState(()=>t?.resetOnMount?null:Bt(e)),a=l?.contrastCount,r=typeof a=="number"&&Number.isFinite(a)?a:1,[c,C]=i.useState(Math.min(5,Math.max(1,r))),[d,f]=i.useState(l?.phonemeView==="pron"?"pron":l?.phonemeView==="direct"?"direct":"char"),[s,g]=i.useState(()=>wo(l)),p=i.useCallback(()=>u.requireSyllable?{cho:"\u3131",jung:"\u314F",jong:ne,syllable:u.fixedSyllable??null}:{cho:null,jung:null,jong:u.fixedNoCoda?ne:null,syllable:u.fixedSyllable??null},[u.requireSyllable,u.fixedSyllable,u.fixedNoCoda]);i.useEffect(()=>{!u.requireSyllable&&u.fixedSyllable==null&&!u.fixedNoCoda||g(m=>m.cho||m.jung||m.syllable!=null||m.jong?m:p())},[]);const w=i.useMemo(()=>K(s.cho)||K(s.jung)||K(s.jong)?"count":"random",[s.cho,s.jung,s.jong]),E=i.useRef(d==="char"?s.jung:null);i.useEffect(()=>{d==="char"&&(E.current=s.jung)},[d,s.jung]);const[h,S]=i.useState(t?.resetOnMount?!!t?.defaultImageOnly:l?.excludeNoImage??!0),[B,A]=i.useState(t?.resetOnMount?!1:l?.sameStructureOnly??!0),[D,b]=i.useState(Array.isArray(l?.gradeFilter)?l.gradeFilter:[]),[I,L]=i.useState(Array.isArray(l?.posFilter)?l.posFilter:[]),[F,j]=i.useState(Array.isArray(l?.wordTypeFilter)?l.wordTypeFilter:[]),H=i.useRef(t?.resetKey);i.useEffect(()=>{H.current!==t?.resetKey&&(H.current=t?.resetKey,g(p()),S(!1),A(!1),b([]),L([]),j([]),C(1))},[t?.resetKey]);const k=at(),[v,T]=i.useState({cho:new Set,jung:new Set,jong:new Set,syllable:new Set}),[P,G]=i.useState(!1),[X,le]=i.useState(null),re=1,y=Math.max(1,[s.cho,s.jung,s.jong].filter(Boolean).length);i.useEffect(()=>{c<y&&C(y)},[y,c]);const[_,Y]=i.useState(e);i.useEffect(()=>{if(_!==e){if(!t?.resetOnMount){const m=Bt(e),N=typeof m?.contrastCount=="number"&&Number.isFinite(m.contrastCount)?m.contrastCount:1;C(Math.min(5,Math.max(1,N))),g(m?.composition??p()),S(m?.excludeNoImage??!0),A(m?.sameStructureOnly??!0),f(m?.phonemeView==="pron"?"pron":"char"),b(Array.isArray(m?.gradeFilter)?m.gradeFilter:[]),L(Array.isArray(m?.posFilter)?m.posFilter:[]),j(Array.isArray(m?.wordTypeFilter)?m.wordTypeFilter:[])}Y(e)}},[e,_,t?.resetOnMount]),i.useEffect(()=>{if(!t?.resetOnMount&&_===e)try{localStorage.setItem(yt(e),JSON.stringify({contrastCount:c,composition:s,excludeNoImage:h,sameStructureOnly:B,phonemeView:d,gradeFilter:D,posFilter:I,wordTypeFilter:F}))}catch{}},[t?.resetOnMount,e,_,c,s,h,B,d,D,I,F]);const[$,ee]=i.useState(0);Lu("wordpool:update",()=>ee(m=>m+1));const Du=i.useRef(o.language);i.useEffect(()=>{Du.current!==o.language&&(Du.current=o.language,ee(m=>m+1))},[o.language]),i.useEffect(()=>{if(!u.choseong)return;let m=!1;return uo({difficulty:w,excludeNoImage:h}).then(N=>{m||(T(N),N.cho.size+N.jung.size+N.jong.size>0&&G(!0))}).catch(()=>{m||T({cho:new Set,jung:new Set,jong:new Set,syllable:new Set})}),()=>{m=!0}},[u.choseong,w,h,$]),i.useEffect(()=>{let m=!1;const N=s,O=N.cho?ce(N.cho):null,M=N.jung?ce(N.jung):null,U=N.jong===ne,he=U?null:N.jong?ce(N.jong):null,me=N.syllable!=null?Su(N.syllable):null,Fe=!!(O||M||he||U||me);return eo({difficulty:u.difficulty?w:null,contrastCount:u.difficulty?c:1,composition:u.choseong&&Fe?{cho:O,jung:M,jong:he,jongNone:U,syllable:me}:null,excludeNoImage:h,sameStructureOnly:B,phonemeView:d==="pron"?"pron":"char",grade:D.length>0?D:null}).then(Ve=>{m||le(Ve)}).catch(()=>{m||le(null)}),()=>{m=!0}},[u.choseong,u.difficulty,w,c,s,d,h,B,$,D]),i.useEffect(()=>{P&&g(m=>{const N={...m};let O=!1;return["cho","jung","jong"].forEach(M=>{const U=m[M];!U||U===ne||ce(U).some(he=>v[M].has(he))||(N[M]=null,O=!0)}),m.syllable!=null&&u.fixedSyllable==null&&(m.syllable>=oe?[...v.syllable].some(M=>M>=oe)||(N.syllable=null,O=!0):(!v.syllable.has(m.syllable)||m.syllable<re)&&(N.syllable=null,O=!0)),O?N:m})},[v,P,re,u.fixedSyllable]);const Ou=i.useMemo(()=>{const m=N=>{const O=new Set;for(const M of ht[N])v[N].has(M)&&O.add(M);return O};return{cho:m("cho"),jung:m("jung"),jong:m("jong")}},[v]),tu=i.useMemo(()=>({exact:new Set(ft.filter(m=>v.syllable.has(m))),min:[...v.syllable].some(m=>m>=oe)}),[v]),R=i.useMemo(()=>({diffPhonemeCount:n("training.contrast.diffPhonemeCount",{defaultValue:"\uB2E4\uB978 \uC74C\uC18C\uC758 \uCD1D \uAC2F\uC218"}),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]),Nu=i.useMemo(()=>({[R.trainOnset]:"cho",[R.trainVowel]:"jung",[R.trainCoda]:"jong"}),[R]),ve=i.useCallback((m,N)=>({title:N,items:m}),[]),nu=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]),Ot=i.useMemo(()=>{const m=[];if(u.choseong){const N={value:ne,displayLabel:R.codaExclude},O=u.fixedNoCoda===!0,M=(U,he)=>{const me=O&&U==="jong",Fe={label:he,groupLabel:R.phonemeGroup,allOption:!u.requireSyllable,allLabel:R.noLimit,allOptionDisabled:me};if(d==="pron"){const pe=yu[U].map(Mt=>Mt.map(({v:ou,phonetic:kt})=>{const lu=ce(ou),Tu=Ct(n,kt),ju=me||!lu.some(Pt=>v[U].has(Pt));return lu.length>1?{value:ou,labels:lu,tooltip:Tu,disabled:ju}:{value:ou,tooltip:Tu,disabled:ju}}));return U==="jong"&&!u.requireCoda&&pe.unshift([N]),{...Fe,groups:pe}}const Ve=ht[U].map(pe=>!me&&Ou[U].has(pe)?pe:{value:pe,disabled:!0});return{...Fe,items:U==="jong"&&!u.requireCoda?[N,...Ve]:Ve}};m.push(M("cho",R.trainOnset)),m.push(M("jung",R.trainVowel)),m.push(M("jong",R.trainCoda))}if(m.push({...it(n,k,{labelInfo:ve([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:R.gradeLabel}),u.partOfSpeech&&m.push(st(k)),u.wordType&&m.push(ct(k)),u.choseong||u.fixedSyllable!=null){const N=u.fixedSyllable;m.push({label:R.syllableCount,items:[...ft.map(O=>({value:pu(O),displayLabel:n("wordPairs.syllableN",{n:O,defaultValue:"{{n}}\uC74C\uC808"}),disabled:N!=null?O!==N:!tu.exact.has(O)||O<re})),{value:pu(oe),displayLabel:n("wordPairs.syllableNPlus",{n:oe,defaultValue:"{{n}}\uC74C\uC808 \uC774\uC0C1"}),disabled:N!=null?oe!==N:!tu.min}],allOption:!0,allOptionDisabled:N!=null})}return u.choseong?m.push({label:R.exclude,displayLabel:R.selectLabel,multiple:!0,items:[R.excludeImage,R.sameStructure],labelInfo:ve(nu)}):m.push({label:R.exclude,displayLabel:R.selectLabel,multiple:!0,items:[R.excludeImage],labelInfo:ve([nu[0]])}),m},[u.choseong,u.partOfSpeech,u.wordType,u.requireSyllable,u.fixedSyllable,u.fixedNoCoda,u.requireCoda,re,Ou,v,d,tu,R,n,ve,nu,k]),Nt={...u.difficulty?{[R.diffPhonemeCount]:String(c)}:{},...(u.choseong||u.fixedSyllable!=null)&&s.syllable!=null?{[R.syllableCount]:pu(s.syllable)}:{},...u.choseong&&s.cho?{[R.trainOnset]:s.cho}:{},...u.choseong&&s.jung?{[R.trainVowel]:s.jung}:{},...u.choseong&&s.jong?{[R.trainCoda]:s.jong}:{},[R.exclude]:[...h?[R.excludeImage]:[],...B?[R.sameStructure]:[]],[R.gradeLabel]:D.map(m=>n("wordSearch.filter.grade",{n:Number(m),defaultValue:"{{n}}\uB4F1\uAE09"})),...u.partOfSpeech?{[k.partOfSpeech]:I}:{},...u.wordType?{[k.wordType]:F}:{}},Tt=i.useCallback((m,N)=>{if(N===R.diffPhonemeCount){const O=Number(m);O>=1&&C(O)}else if(N===R.exclude)m===R.excludeImage?S(O=>!O):m===R.sameStructure&&A(O=>!O);else if(N===R.syllableCount)g(O=>{if(!m||m===ge)return{...O,syllable:null};const M=Eo(m);return{...O,syllable:O.syllable===M?null:M}});else if(N===R.gradeLabel){if(!m||m===ge){b([]);return}const O=m.replace(/\D/g,"");b(M=>M.includes(O)?M.filter(U=>U!==O):[...M,O])}else if(N===k.partOfSpeech){if(!m||m===ge){L([]);return}L(O=>O.includes(m)?O.filter(M=>M!==m):[...O,m])}else if(N===k.wordType){if(!m||m===ge){j([]);return}j(O=>O.includes(m)?O.filter(M=>M!==m):[...O,m])}else{const O=Nu[N];if(!O)return;g(M=>u.requireSyllable?m&&m!==ge?{...M,[O]:m}:M:!m||m===ge||M[O]===m?{...M,[O]:null}:{...M,[O]:m})}},[R,Nu,k,u.requireSyllable]),jt=i.useCallback(m=>!u.partOfSpeech&&!u.wordType?!0:so(m,{...u.partOfSpeech?{[k.partOfSpeech]:I}:{},...u.wordType?{[k.wordType]:F}:{}},k),[u.partOfSpeech,u.wordType,I,F,k]),It=i.useCallback(m=>{m!==d&&(m!=="direct"&&d!=="direct"&&g(N=>Et(N,m,E.current)),f(m))},[d]),Rt=i.useCallback(()=>({composition:s,contrastCount:c,excludeNoImage:h,sameStructureOnly:B,phonemeView:d,gradeFilter:D}),[s,c,h,B,d,D]),Lt=i.useCallback(m=>{g(m.composition),C(m.contrastCount),S(m.excludeNoImage),A(m.sameStructureOnly??!0),f(m.phonemeView),b(Array.isArray(m.gradeFilter)?m.gradeFilter:[])},[]);return{difficulty:w,contrastCount:c,composition:s,choseong:s.cho,excludeNoImage:h,sameStructureOnly:B,gradeFilter:D,posFilter:I,wordTypeFilter:F,matchesWordAttributes:jt,poolVersion:$,filterSections:Ot,filterSelected:Nt,handleFilterSelect:Tt,phonemeView:d,setPhonemeView:It,phonemeGroupLabel:R.phonemeGroup,wordCount:X,getFilterSnapshot:Rt,restoreFilterSnapshot:Lt}}function Ao(e){const u=r=>r?ce(r):null,t=u(e.cho),n=u(e.jung),o=e.jong===ne,l=o?null:u(e.jong),a=e.syllable!=null?Su(e.syllable):null;return!t&&!n&&!l&&!o&&!a?null:{cho:t,jung:n,jong:l,jongNone:o,syllable:a}}function _o(e,u,t,n,o,l,a=!0,r="char",c=[]){const[C,d]=i.useState({}),[f,s]=i.useState(!1),{cho:g=null,jung:p=null,jong:w=null,syllable:E=null}=n??{},h=c.length>0?c.slice().sort().join(","):"";return i.useEffect(()=>{l>0&&Xn(o).catch(()=>{})},[l,o]),i.useEffect(()=>{let S=!1;return s(!0),(async()=>{const B=Ao({cho:g,jung:p,jong:w,syllable:E}),A=`${g??""}_${p??""}_${w??""}_${E??""}_${h}`,D={};await Promise.all(e.map(async b=>{const I=su[b.key];try{const L=await rt(b.key,{difficulty:I.difficulty?u:null,contrastCount:I.difficulty?t:1,composition:I.choseong?B:null,count:5,excludeNoImage:o,sameStructureOnly:a,phonemeView:r,grade:c.length>0?c:null});L&&L.length>0?D[b.key]={id:`wt-${b.key}-${u}-${A}-${Date.now()}`,name:b.label,training_type:b.key,category_main_code:"WORD",iconColor:b.color,subTitle:b.subTitle,items:L,itemCount:L.length}:D[b.key]={id:`wt-${b.key}-empty`,name:b.label,training_type:b.key,category_main_code:"WORD",iconColor:b.color,subTitle:b.subTitle,items:[],itemCount:0,__empty:!0}}catch{D[b.key]=null}})),S||(d(D),s(!1))})(),()=>{S=!0}},[u,t,g,p,w,E,o,a,r,l,h]),{perTypeData:C,generating:f}}function Do(){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 je=[],Ie=[],Re=[],Le=[],Je={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},Ze={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},Oo={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};let wu=null,wt=null,Ce=null;function No({counts:e,forceRefresh:u}={}){const t=Object.assign({},Oo,e||{}),n=Do(),o=ze(new Date(`${n}T00:00:00+09:00`).getTime()-864e5),l=JSON.stringify(t);if(!u&&wt===n&&wu===l&&Ce)return Object.assign(Je,Ce.today),Object.assign(Ze,Ce.yesterday?.selection||{LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),{today:Je,yesterday:Ze};const a={LISTEN_IN_NOISE:ie(je,Math.max(0,Number(t.LISTEN_IN_NOISE)||0)),SHORT_STORY:ie(Ie,Math.max(0,Number(t.SHORT_STORY)||0)),LONG_STORY:ie(Re,Math.max(0,Number(t.LONG_STORY)||0)),ORDERING_SENTENCE:ie(Le,Math.max(0,Number(t.ORDERING_SENTENCE)||0))};let r=null;return Ce&&wu===l&&Ce.yesterday&&Ce.yesterday.date===o&&(r=Ce.yesterday.selection),r||(r={LISTEN_IN_NOISE:ie(je,Math.max(0,Number(t.LISTEN_IN_NOISE)||0)),SHORT_STORY:ie(Ie,Math.max(0,Number(t.SHORT_STORY)||0)),LONG_STORY:ie(Re,Math.max(0,Number(t.LONG_STORY)||0)),ORDERING_SENTENCE:ie(Le,Math.max(0,Number(t.ORDERING_SENTENCE)||0))}),Object.assign(Je,a),Object.assign(Ze,r),wt=n,wu=l,Ce={today:a,yesterday:{date:o,countsKey:l,selection:r}},{today:Je,yesterday:Ze}}let bt=!1,Me=null;async function To(){try{const e={url:typeof document>"u"?require("url").pathToFileURL(__filename).href:ru&&ru.tagName.toUpperCase()==="SCRIPT"&&ru.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 jo(){if(!bt)return Me||(Me=(async()=>{const e=await To();if(!e){Me=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}try{for(const u of Object.keys(e||{})){const t=e[u]||[];for(const n of t){const o=n,l=String(o.training_type||u),a=String(o.category_main_code||o.category_main||o.category_0||""),r=String(o.category_sub_code||o.category_sub||o.category_1||""),c=Object.assign({},o,{training_type:l,category_0:a,category_1:r});l==="LISTEN_IN_NOISE"?je.push(c):l==="SHORT_STORY"?Ie.push(c):l==="LONG_STORY"?Re.push(c):l==="ORDERING_SENTENCE"&&Le.push(c)}}}catch{Me=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}try{window.dispatchEvent(new Event("speechear.data.updated"))}catch{}try{No()}catch{}bt=!0})(),Me)}async function Io(e=3e3){const u=jo();return Promise.race([u,new Promise(t=>setTimeout(t,e))])}function Ro(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 Lo(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 Qe=ie;function bu(e,u){const t=u?Lo(Ro(u)):Math.random;return{LISTEN_IN_NOISE:Qe(je,Math.max(0,e.LISTEN_IN_NOISE||0),t),SHORT_STORY:Qe(Ie,Math.max(0,e.SHORT_STORY||0),t),LONG_STORY:Qe(Re,Math.max(0,e.LONG_STORY||0),t),ORDERING_SENTENCE:Qe(Le,Math.max(0,e.ORDERING_SENTENCE||0),t)}}function At(e){return e?!!(e.LISTEN_IN_NOISE?.length||e.SHORT_STORY?.length||e.LONG_STORY?.length||e.ORDERING_SENTENCE?.length):!1}const Mo={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};function _t(e=!1,u=Mo,t){const n=ze(Date.now()),o=ze(Date.now()-864e5),l=`${t??""}|${n}`,a=`${t??""}|${o}`;return je.length>0||Ie.length>0||Re.length>0||Le.length>0?{today:bu(u,l),yesterday:bu(u,a)}:{today:bu(u,l),yesterday:null}}function ko(e){const u=i.useRef({LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),t=i.useRef(null),[n,o]=i.useState(!1),[l,a]=i.useState(!1),[r,c]=i.useState(0),[C,d]=i.useState(!1);i.useEffect(()=>{let s=!1,g,p=0;const w=40,E=()=>{g!==void 0&&(clearInterval(g),g=void 0)};let h=!1;try{const A=new URLSearchParams(window.location.search),D=A.get("forceRefresh")||A.get("force");h=D==="1"||D==="true"}catch{}const S=A=>{u.current=A.today,t.current=A.yesterday,o(!0),d(!0),c(D=>D+1),s=!0,E()},B=async()=>{if(s)return;if(!h){const D=_t(!1,void 0,e);if(At(D.today)){S(D);return}}try{await Io(3e3)}catch{}if(s)return;const A=_t(h,void 0,e);if(At(A.today)){S(A);return}++p>=w&&(o(!0),d(!1),s=!0,E())};return B(),g=setInterval(B,250),()=>{s=!0,E()}},[e]);const f=i.useCallback(s=>{const g=l?t.current:u.current,p=l?u.current:t.current;return g?.[s]?.length?g[s]:p?.[s]?.length?p[s]:void 0},[l,r]);return{loaded:n,hasData:C,showYesterday:l,setShowYesterday:a,getTrainingPerType:f}}const Be=[];let Xe=!1;function Dt(e){if(e.key!=="Escape"||e.defaultPrevented)return;const u=Be[Be.length-1];u&&(e.stopPropagation(),u())}function Po(e){return Be.push(e),!Xe&&typeof document<"u"&&(document.addEventListener("keydown",Dt),Xe=!0),()=>{const u=Be.lastIndexOf(e);u>=0&&Be.splice(u,1),Be.length===0&&Xe&&typeof document<"u"&&(document.removeEventListener("keydown",Dt),Xe=!1)}}function xo(e,u=!0){const t=Ru(e);i.useEffect(()=>{if(u)return Po(()=>{t.current?.()})},[u,t])}const Au=(e,u)=>`${e}:${u??1}`,_u=new Map;function vo(e,u){const[t,n]=i.useState(0),o=e.map(l=>Au(l.word,l.homonum)).join("|");return i.useEffect(()=>{const l=(o?o.split("|"):[]).filter(c=>!_u.has(c));if(l.length===0)return;let a=!1;const r=Array.from(new Set(l.map(c=>c.slice(0,c.lastIndexOf(":")))));return u(r).then(c=>{if(!(a||c.length===0)){for(const C of c)C.Meaning&&_u.set(Au(C.Word,C.Homonum??void 0),C.Meaning);n(C=>C+1)}}),()=>{a=!0}},[o,u]),i.useMemo(()=>{const l=o?o.split("|"):[],a=new Map;for(const r of l){const c=_u.get(r);c!=null&&a.set(r,c)}return a},[o,t])}function Fo(){const[e,u]=i.useState(null),t=i.useCallback(l=>u(l.getBoundingClientRect()),[]),n=i.useCallback(()=>u(null),[]),o=i.useCallback(l=>{const a=l.getBoundingClientRect();u(r=>r?null:a)},[]);return{anchorRect:e,isOpen:e!=null,openAt:t,close:n,toggleAt:o}}function Vo(e){const[u,t]=i.useState(null),[n,o]=i.useState(null),l=i.useRef(null);i.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]);const a=i.useCallback((c,C)=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{t(c),o(C)},e)},[e]),r=i.useCallback(()=>{l.current&&clearTimeout(l.current),t(null),o(null)},[]);return{payload:u,anchorRect:n,openAfterDelay:a,close:r}}function Ho(e,u,t){const n=Number.isFinite(u)&&u>=1?Math.floor(u):1,o=Math.max(1,Math.ceil(e.length/n)),l=Number.isFinite(t)?Math.min(Math.max(1,Math.floor(t)),o):1;return{pageItems:i.useMemo(()=>e.slice((l-1)*n,l*n),[e,l,n]),totalPages:o,curPage:l}}function $o(e="warning"){const[u,t]=i.useState(""),[n,o]=i.useState(e),[l,a]=i.useState(0),r=i.useCallback((f,s)=>{o(s),t(f),a(g=>g+1)},[]),c=i.useCallback(f=>r(f,"warning"),[r]),C=i.useCallback(f=>r(f,"normal"),[r]),d=i.useCallback(()=>t(""),[]);return{toastMessage:u,toastType:n,toastKey:l,showToast:r,showWarning:c,showNormal:C,clearToast:d}}const Go=[{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."}],Yo={LISTEN_IN_NOISE:"listenInNoise",SHORT_STORY:"shortStory",LONG_STORY:"longStory",ORDERING_SENTENCE:"orderingSentence"};function Uo(e){return Go.map(u=>{const t=Yo[u.key];return t?{...u,label:e(`trainingType.${t}.title`),desc:e(`trainingType.${t}.desc`)}:u})}const ke={blue:"#60A5FA",green:"#4ADE80",amber:"#FBBF24",purple:"#A78BFA",pink:"#F472B6"},Pe=ke.blue,eu=ke.green,xe=ke.amber,uu=ke.purple,Ko=ke.pink,Wo=[{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:Pe,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:Pe,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:Pe,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:Pe,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:Pe,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:eu,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:eu,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:eu,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:eu,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:xe,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:xe,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:xe,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:xe,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:xe,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:uu,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:uu,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:uu,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:uu,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:Ko,subTitle:"\uC138 \uB2E8\uC5B4\uB97C \uB4E4\uC740 \uC21C\uC11C\uB300\uB85C \uCE74\uB4DC\uB97C \uC120\uD0DD\uD558\uC138\uC694."}]}];function qo(){const{t:e}=Se.useTranslation();return i.useMemo(()=>{const u=Object.fromEntries(Uo(e).map(n=>[n.key,n.label])),t={...u};return Wo.flatMap(n=>n.types).forEach(n=>{t[n.key]=e(`trainingType.${n.key}.label`,{defaultValue:n.label})}),{sentence:u,all:t}},[e])}const zo="0.123.0";function Jo({computeStyle:e,onScroll:u="close",onResize:t="close",ignoreOutsideClickSelector:n}){const[o,l]=i.useState(!1),[a,r]=i.useState({}),c=i.useRef(null),C=i.useRef(null),d=i.useCallback(()=>{c.current&&r(e(c.current.getBoundingClientRect()))},[e]);i.useEffect(()=>{if(!o)return;d();const g=h=>{const S=h.target;n&&S.closest?.(n)||c.current?.contains(S)||C.current?.contains(S)||l(!1)};document.addEventListener("mousedown",g);const p=h=>{C.current?.contains(h.target)||(u==="reposition"?d():u==="close"&&l(!1))};u!=="ignore"&&window.addEventListener("scroll",p,!0);const w=()=>{t==="reposition"?d():t==="close"&&l(!1)};t!=="ignore"&&window.addEventListener("resize",w);const E=h=>{h.key==="Escape"&&l(!1)};return document.addEventListener("keydown",E),()=>{document.removeEventListener("mousedown",g),u!=="ignore"&&window.removeEventListener("scroll",p,!0),t!=="ignore"&&window.removeEventListener("resize",w),document.removeEventListener("keydown",E)}},[o,d,u,t,n]);const f=i.useCallback(()=>l(g=>!g),[]),s=i.useCallback(()=>l(!1),[]);return{open:o,setOpen:l,toggle:f,close:s,style:a,triggerRef:c,menuRef:C}}function Zo(e,{mode:u="playback",autoStart:t=!1,onPlaySpeaker:n,onComplete:o,playMs:l=1100,feedbackMs:a=1500}={}){const[r,c]=i.useState([]),[C,d]=i.useState(0),[f,s]=i.useState("idle"),[g,p]=i.useState(null),[w,E]=i.useState([]),[h,S]=i.useState(null),[B,A]=i.useState(0),D=i.useRef(0),b=i.useCallback(y=>{D.current=typeof y=="function"?y(D.current):y,A(D.current)},[]),I=i.useRef(n),L=i.useRef(o);i.useEffect(()=>{I.current=n,L.current=o},[n,o]);const F=i.useRef([]),j=()=>{F.current.forEach(clearTimeout),F.current=[]},H=(y,_)=>{F.current.push(setTimeout(_,y))};i.useEffect(()=>()=>j(),[]);const k=r[C]?.id??null,v=i.useCallback(()=>{j(),s("playing"),E([]),S(null),b(0);let y=0;e.forEach((_,Y)=>{H(y,()=>{d(Y),p(_.id),I.current?.(_)}),H(y+1e3,()=>{p(null),E($=>[...$,_.id])}),y+=1300}),H(y,()=>{s("done"),L.current?.({score:0,total:e.length})})},[e,b]),T=i.useCallback((y,_)=>{if(_>=y.length){s("done"),L.current?.({score:D.current,total:y.length});return}d(_),S(null),s("playing"),p(y[_].id),I.current?.(y[_]),H(l,()=>{p(null),s("waiting")})},[l]),P=i.useCallback(()=>{j();const y=x(e);c(y),b(0),E([]),T(y,0)},[e,T,b]),G=i.useCallback(()=>{u==="playback"?(c(e),v()):P()},[u,e,v,P]),X=i.useCallback(()=>{j(),s("idle"),p(null),E([]),S(null),d(0),b(0),c([])},[b]);i.useEffect(()=>{t?G():X()},[u,e.length,t]);const le=i.useCallback(y=>{f!=="waiting"||u==="playback"||(S(y),y===r[C]?.id&&b(_=>_+1),u==="exam"?(s("playing"),H(400,()=>T(r,C+1))):(s("feedback"),H(a,()=>T(r,C+1))))},[f,u,r,C,T,a,b]),re=u==="playback"?e.length:r.length;return{bind:{activeSpeakerId:g,playedIds:w,selectedId:h,answerId:k,showFeedback:f==="feedback",clickable:f==="waiting",onSelectSpeaker:le},index:C,total:re,score:B,phase:f,done:f==="done",start:G,reset:X}}exports.CACHE_GROUPS=Hu,exports.CORE_VERSION=zo,exports.DocumentTitleSuppressContext=ku,exports.EMPTY_COMPOSITION=Bu,exports.MediaQueryOverrideContext=Iu,exports.NO_CODA=ne,exports.SYLLABLE_MIN=oe,exports.VAP_PAGE_SIZE_OPTIONS=iu,exports.buildGradeSection=it,exports.buildPartOfSpeechSection=st,exports.buildPositionSection=oo,exports.buildSelectSection=no,exports.buildSyllableSection=to,exports.buildWordTypeSection=ct,exports.charToPronValue=pt,exports.convertComposition=Et,exports.fmtBytes=nn,exports.lsBytes=$u,exports.meaningKey=Au,exports.pronToCharValue=St,exports.syllableToFilter=Su,exports.today=_e,exports.toggleAttributeFilter=lo,exports.useAnchoredMenu=Jo,exports.useCacheManagement=on,exports.useDailyTrainingSelection=ko,exports.useDelayedHoverAnchor=Vo,exports.useDeviceManagement=gn,exports.useDocumentTitle=Vt,exports.useEscToClose=xo,exports.useFontScale=xt,exports.useHoverAnchor=Fo,exports.useMediaQuery=Ft,exports.usePagedList=Ho,exports.usePasswordChange=$t,exports.useRelativeDay=Ht,exports.useSoundCompassExam=Zo,exports.useTablePaging=dn,exports.useTableSort=fn,exports.useToastState=$o,exports.useTrainingTypeLabels=qo,exports.useVisitAllPanel=Cn,exports.useVisitHistory=an,exports.useVisitSchedule=cn,exports.useWindowEvent=Lu,exports.useWordAttributeFilterKeys=at,exports.useWordDataStats=ln,exports.useWordMeanings=vo,exports.useWordTrainingDataGeneration=_o,exports.useWordTrainingFilter=bo,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"},z={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"}}},U={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={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:D,myWordTraining:k,myWordTable:M,keyWords:I,wordTable:O,wordSearch:_,wordPrint:x,topic:F,accessLinkManager:W,login:H,trainingPlanRun:B,device:G,manager:K,wordPairs:$,game:V,footer:Y,landing:z,date:U,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},ye={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"}}},Se={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"},ve={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"}},we={clearAriaLabel:"Clear search"},fe={starLabel:"Select star {{n}}",valueLabel:"{{value}} out of {{max}}",groupLabel:"Rating"},Te={selected:"selected"},Le={placeholder:"Select"},Ce={collapse:"Collapse",expand:"Expand"},Pe={biArea:"BI area",biSymbol:"BI symbol",logoMalgwi:"Malgwi logo",logoManager:"Malgwi Manager logo",menuOpen:"Open menu",utilMenu:"Utility menu"},Ne={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"},Re={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."}}},Ae={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"}},Ee={profile:{planSuffix:"",plan:"Plan"},basicInfo:{name:{placeholder:"John Doe"}},security:{title:"Security",password:{label:"Password"},twoFactor:{label:"Two-Factor Authentication",sub:"Strengthen your account security"}}},De={guide:{faq:{title:"FAQ",desc:"View all frequently asked questions"}}},ke={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",diffPhonemeCount:"Total differing phonemes",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",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"},up:"Move up",down:"Move down",prev:"Previous",listenLabel:"Listen",sourcePlay:"Play source {{n}}",listen:"Listen"},Me={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"},Ie={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"}},Oe={plan:{recommendedFor:"Recommended for",features:"Key Features",freePrice:"Free",contact:"Contact Us",tierFallback:"Plan",openPromo:"Launch offer"},products:{mgrEnterprise:{tier:{price:"Contact us"}}}},_e={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"}},xe={unitVisit:"",periodAll:"All",showN:"Show {{n}}"},Fe={subtitle:"Manage company and business information",editButton:"Edit Info",basicInfo:{title:"Basic Info"},contactInfo:{title:"Contact Info"}},We={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."}},He={comingSoon:"Word training is coming soon."},Be={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"}},Ge={title:"Key Words",empty:"No key words available."},Ke={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)"},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"}},$e={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}}"}},Ve={clearAllSelection:"Clear All Selections",divLine:"Contrast Line",removePair:"Remove pair",removeWord:"Remove word"},Ye={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"}},Ue={passwordPlaceholder:"Enter password"},qe={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"},je={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"}},Qe={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."]},Je={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"}},Ze={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"},Xe={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"}}},et={timeHM:"{{hh}}:{{mm}}",timeH:"{{hh}}:{{mm}}"},tt={options:"Training Options",difficulty:"Difficulty",exclude:"Exclude",chosung:"Initial Consonant",excludeOptions:{none:"None",noImage:"No Image"}},at={answer:"Answer",distractor:"Distractor"},ot={phaseWordDownload:"Download Word Data",phaseImageCheck:"Check Images",phasePairAnalysis:"Analyze Word Pairs",downloadingCount:"Downloading {{n}} words",checkingPage:"Checking page {{page}} list",imageCount:"{{done}} / {{total}} items"},nt={clearAriaLabel:"Clear input"},it={ariaLabel:"Select tab"},rt={ariaLabel:"Tabs"},lt={dragPrompt:"Drag and drop files here",browseButton:"Choose Files",removeAriaLabel:"Remove {{name}}"},st={ariaLabel:"User avatar"},dt={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"}},ct={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"}},ut={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)"}},pt={manage:{unit:"item(s)"}},mt={cancelLabel:"Cancel"},gt={subtitle:"Select a topic to start listening practice."},ht={steps:"Step {{current}} of {{total}}"},bt={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"},yt={resetColumns:"Reset column widths"},St={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}}"},vt={ariaLabel:"Banner",dotAriaLabel:"Banner {{index}} of {{count}}"},wt={selectYearMonth:"Select year and month",chooseDate:"Choose a date"},ft={previewRegion:"Report preview \u2014 scrollable sideways"},Tt={description:"Description",textbox:"Text",training:"Training guide",menu:"Menu"},Lt={devNone:"No acquisition data",place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"}},Ct={common:ye,calendar:Se,passCard:ve,searchField:we,rating:fe,colorPicker:Te,dropdown:Le,accordion:Ce,header:Pe,nav:Ne,settings:Re,usage:Ae,account:Ee,help:De,training:ke,trainingSettings:Me,customers:Ie,payment:Oe,coupons:_e,visits:xe,company:Fe,trainingType:We,myWordTraining:He,myWordTable:Be,keyWords:Ge,wordTable:Ke,wordSearch:$e,wordPrint:Ve,topic:Ye,accessLinkManager:ze,login:Ue,device:qe,manager:je,wordPairs:Qe,game:Je,footer:Ze,landing:Xe,date:et,trainingSetPage:tt,wordTrainingPreview:at,wordData:ot,textField:nt,segmentedControl:it,tabs:rt,fileUpload:lt,avatar:st,myHomework:dt,trainingStatus:ct,store:ut,homework:pt,inquiry:mt,trainingPlanRun:gt,progress:ht,trainingMiss:bt,table:yt,wordScore:St,topBanner:vt,datePicker:wt,report:ft,tooltip:Tt,phonemeProfile:Lt};const Pt="0.
|
|
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"},Xe={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"}}},et={timeHM:"{{hh}}:{{mm}}",timeH:"{{hh}}:{{mm}}"},tt={options:"Training Options",difficulty:"Difficulty",exclude:"Exclude",chosung:"Initial Consonant",excludeOptions:{none:"None",noImage:"No Image"}},at={answer:"Answer",distractor:"Distractor"},ot={phaseWordDownload:"Download Word Data",phaseImageCheck:"Check Images",phasePairAnalysis:"Analyze Word Pairs",downloadingCount:"Downloading {{n}} words",checkingPage:"Checking page {{page}} list",imageCount:"{{done}} / {{total}} items"},nt={clearAriaLabel:"Clear input"},it={ariaLabel:"Select tab"},rt={ariaLabel:"Tabs"},lt={dragPrompt:"Drag and drop files here",browseButton:"Choose Files",removeAriaLabel:"Remove {{name}}"},st={ariaLabel:"User avatar"},dt={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"}},ct={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"}},ut={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)"}},pt={manage:{unit:"item(s)"}},mt={cancelLabel:"Cancel"},gt={subtitle:"Select a topic to start listening practice."},ht={steps:"Step {{current}} of {{total}}"},bt={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"},yt={resetColumns:"Reset column widths"},St={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}}"},vt={ariaLabel:"Banner",dotAriaLabel:"Banner {{index}} of {{count}}"},wt={selectYearMonth:"Select year and month",chooseDate:"Choose a date"},ft={previewRegion:"Report preview \u2014 scrollable sideways"},Tt={description:"Description",textbox:"Text",training:"Training guide",menu:"Menu"},Lt={devNone:"No acquisition data",place:{labial:"Bilabial",alveolar:"Alveolar",palatal:"Palatal",velar:"Velar",glottal:"Glottal"}},Ct={common:ye,calendar:Se,passCard:ve,searchField:we,rating:fe,colorPicker:Te,dropdown:Le,accordion:Ce,header:Pe,nav:Ne,settings:Re,usage:Ae,account:Ee,help:De,training:ke,trainingSettings:Me,customers:Ie,payment:Oe,coupons:_e,visits:xe,company:Fe,trainingType:We,myWordTraining:He,myWordTable:Be,keyWords:Ge,wordTable:Ke,wordSearch:$e,wordPrint:Ve,topic:Ye,accessLinkManager:ze,login:Ue,device:qe,manager:je,wordPairs:Qe,game:Je,footer:Ze,landing:Xe,date:et,trainingSetPage:tt,wordTrainingPreview:at,wordData:ot,textField:nt,segmentedControl:it,tabs:rt,fileUpload:lt,avatar:st,myHomework:dt,trainingStatus:ct,store:ut,homework:pt,inquiry:mt,trainingPlanRun:gt,progress:ht,trainingMiss:bt,table:yt,wordScore:St,topBanner:vt,datePicker:wt,report:ft,tooltip:Tt,phonemeProfile:Lt};const Pt="0.123.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 Nt(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:be},en:{translation:Ct}},lng:i(),fallbackLng:a,interpolation:{escapeValue:!1},react:{useSuspense:!1}}),exports.default=t,exports.CORE_VERSION=Pt,exports.DEFAULT_LOCALE=a,exports.LOCALE_STORAGE_KEY=o,exports.SUPPORTED_LOCALES=n,exports.saveLocale=Nt;
|