@ihabdevteam/core 0.271.0 → 0.272.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.
@@ -1651,7 +1651,7 @@ export declare function copyText(text: string): Promise<boolean>;
1651
1651
  *
1652
1652
  * 값은 손으로 적고 `test/coreVersion.test.ts` 가 package.json 과 어긋나면 운다.
1653
1653
  */
1654
- export declare const CORE_VERSION = "0.271.0";
1654
+ export declare const CORE_VERSION = "0.272.0";
1655
1655
 
1656
1656
  /** @public */
1657
1657
  declare const coreDefault: Record<string, unknown>;
@@ -281,6 +281,46 @@ export default function TrainingStepAudioPlayer({ btnLabel, soundSrc, bucketPath
281
281
  const 소리놓기 = () => { 소리놓기Ref.current?.(); 소리놓기Ref.current = null; };
282
282
  useEffect(() => () => { if (소리멈춤Ref.current)
283
283
  stopSoundIfOwner(소리멈춤Ref.current); }, []);
284
+ /* 이벤트 손잡이·비동기 흐름 안에서 **지금 값**을 읽어야 한다 — 효과가 다시 돌 때까지
285
+ 기다리면 이미 실은 소리에 옛 빠르기가 걸린다(이 파일의 `disabledRef`·`leadInMsRef` 와 같은 결). */
286
+ const playbackRateRef = useRef(playbackRate);
287
+ useEffect(() => { playbackRateRef.current = playbackRate || 1.0; }, [playbackRate]);
288
+ /**
289
+ * **재생 속도를 요소에 건다** — `playbackRate` 와 `defaultPlaybackRate` **둘 다**.
290
+ *
291
+ * `load()` 는 명세대로 `playbackRate` 를 **`defaultPlaybackRate` 로 되돌린다.** 기본값을
292
+ * 안 세워 두면 그 되돌림이 늘 1 이라, 소리를 실을 때마다 사용자가 고른 빠르기가 지워진다.
293
+ */
294
+ const 빠르기걸기 = useCallback((a) => {
295
+ const r = playbackRateRef.current || 1.0;
296
+ try {
297
+ a.defaultPlaybackRate = r;
298
+ }
299
+ catch (e) { }
300
+ try {
301
+ a.playbackRate = r;
302
+ }
303
+ catch (e) { }
304
+ }, []);
305
+ /**
306
+ * **소리를 싣는 **유일한** 자리**(말귀 요청 (78), 2026-10-06).
307
+ *
308
+ * 전에는 `a.src = …; a.load();` 가 **다섯 군데**에 흩어져 있었다 — 첫 재생 · 다음 트랙 ·
309
+ * TTS 길 둘 · 번호 단추. `load()` 가 빠르기를 되돌리는데 **다시 거는 자리가 없었고**,
310
+ * 빠르기를 보는 효과는 **값이 바뀔 때만** 돌아서(값은 그대로 0.75 다) 아무도 안 고쳤다.
311
+ * 말귀 실측: 훈련을 열 때 `playbackRate = 0.75`, 누르면 `1`, 소리 길이 583ms(0.75x 면 780ms).
312
+ *
313
+ * 청능훈련에서 **느리게 들려주는 것**은 흔히 쓰는 길이라 이 설정이 안 먹으면 쓸 수가 없다.
314
+ *
315
+ * 자리를 하나로 모은다 — 흩어진 다섯을 글로 단속하지 않고 **셈으로 막는다**
316
+ * (`test/audioPlaybackRateSurvivesLoad.test.tsx` 가 `load()` 자리 수를 센다).
317
+ */
318
+ const 소리싣기 = useCallback((a, src) => {
319
+ a.src = src;
320
+ 빠르기걸기(a); // defaultPlaybackRate 를 먼저 세워 둔다 — load() 가 그것으로 되돌린다
321
+ a.load();
322
+ 빠르기걸기(a); // 되돌린 뒤 한 번 더 — 기본값을 못 세우는 환경에서도 선다
323
+ }, [빠르기걸기]);
284
324
  const tryPlayWithRetry = useCallback(async (a, attempts = 3, delayMs = 50) => {
285
325
  const 의도 = 재생의도Ref.current;
286
326
  /* **앞 뜸** — 소리를 틀기 전에 기다린다. 기다리는 동안 진행바는 돌아야 하므로
@@ -395,8 +435,7 @@ export default function TrainingStepAudioPlayer({ btnLabel, soundSrc, bucketPath
395
435
  set구간표시(true);
396
436
  const nextSrc = sref?.[next] && sref[next].src;
397
437
  if (nextSrc && a) {
398
- a.src = nextSrc;
399
- a.load();
438
+ 소리싣기(a, nextSrc);
400
439
  tryPlayWithRetry(a).catch(() => { });
401
440
  return;
402
441
  }
@@ -603,8 +642,7 @@ export default function TrainingStepAudioPlayer({ btnLabel, soundSrc, bucketPath
603
642
  const loadAndPlay = async (a, src) => {
604
643
  markCompletedByEnd(false);
605
644
  fetchingRef.current = false;
606
- a.src = src;
607
- a.load();
645
+ 소리싣기(a, src);
608
646
  await waitForCanPlay(a);
609
647
  // 기다리는 사이 떠났으면(false) 이어 가지 않는다 — 떼어진 <audio> 를 틀던 것
610
648
  if ((await waitForWaveReady()) === false)
@@ -759,8 +797,7 @@ export default function TrainingStepAudioPlayer({ btnLabel, soundSrc, bucketPath
759
797
  fetchingRef.current = false;
760
798
  if (first.src && a) {
761
799
  try {
762
- a.src = first.src;
763
- a.load();
800
+ 소리싣기(a, first.src);
764
801
  // canplay 이벤트 대기 — load() 직후 play() 호출 시 발생하는 AbortError 방지.
765
802
  // 짧은 파일도 canplay가 빠르게 발생하므로 재생 지연 없음.
766
803
  // (같은 기다림이 이 파일 위쪽에 waitForCanPlay 로 이미 있었다. 여기에 한 벌
@@ -895,8 +932,7 @@ export default function TrainingStepAudioPlayer({ btnLabel, soundSrc, bucketPath
895
932
  try {
896
933
  if (first.src && a) {
897
934
  try {
898
- a.src = first.src;
899
- a.load();
935
+ 소리싣기(a, first.src);
900
936
  if (a)
901
937
  await tryPlayWithRetry(a);
902
938
  }
@@ -1040,8 +1076,7 @@ export default function TrainingStepAudioPlayer({ btnLabel, soundSrc, bucketPath
1040
1076
  // 같은 구간을 다시 트는 것이면 파형은 그대로다 — 괜히 기다리지 않는다.
1041
1077
  if (!sameSegment)
1042
1078
  markWaveNotReady();
1043
- a.src = src;
1044
- a.load();
1079
+ 소리싣기(a, src);
1045
1080
  if (!sameSegment && (await waitForWaveReady()) === false)
1046
1081
  return;
1047
1082
  if (myToken !== jumpTokenRef.current)
@@ -1177,10 +1212,10 @@ export default function TrainingStepAudioPlayer({ btnLabel, soundSrc, bucketPath
1177
1212
  try {
1178
1213
  const a = audioRef.current;
1179
1214
  if (a && typeof a.playbackRate === 'number')
1180
- a.playbackRate = playbackRate || 1.0;
1215
+ 빠르기걸기(a);
1181
1216
  }
1182
1217
  catch (e) { }
1183
- }, [playbackRate]);
1218
+ }, [playbackRate, 빠르기걸기]);
1184
1219
  // 문장(메인) 볼륨 반영 — 문제 소리 볼륨(effectiveSpeechVolume = 전체 소리). setElementVolume 이 그래프에 태운
1185
1220
  // 요소면 GainNode, 아니면 요소 volume 에 건다(iOS 실기기는 요소 volume 이 안 먹는다). 재생 중이면 소음과 같은 150ms 램프로 옮기고, 멈춰 있으면 바로 건다.
1186
1221
  // 백그라운드 탭에서는 RAF 가 멈춰 램프가 중간에 설 수 있으므로 끝값을 타이머로 한 번 더 박는다.
@@ -46,4 +46,4 @@
46
46
  *
47
47
  * 값은 손으로 적고 `test/coreVersion.test.ts` 가 package.json 과 어긋나면 운다.
48
48
  */
49
- export declare const CORE_VERSION = "0.271.0";
49
+ export declare const CORE_VERSION = "0.272.0";
@@ -46,4 +46,4 @@
46
46
  *
47
47
  * 값은 손으로 적고 `test/coreVersion.test.ts` 가 package.json 과 어긋나면 운다.
48
48
  */
49
- export const CORE_VERSION = '0.271.0';
49
+ export const CORE_VERSION = '0.272.0';
package/dist/utils.cjs.js CHANGED
@@ -17,4 +17,4 @@
17
17
  \uC124\uCE58 \uBA85\uB839\uC5B4 (\uC2A4\uD1A0\uB9AC\uC9C0 SDK \uBBF8\uC124\uCE58 \uC2DC):
18
18
  npm install @supabase/supabase-js
19
19
  pnpm add @supabase/supabase-js
20
- `),this.name="StorageNotConfiguredError"}};function Zt(e){Xt(e)}function eo(e,n){if(!e)return null;const t=X();return t?.resolvePath?t.resolvePath(e,n):n?`${n}/${e}.mp3`:null}async function Rn(e){if(!e)return!1;const n=X();if(!n)throw new Je("fileExists");if(n.exists)return n.exists(e);try{return await n.resolveUrl(e)!==null}catch{return!1}}async function On(e){if(!e)return null;const n=X();if(!n)throw new Je("getSignedOrPublicUrl");try{return await n.resolveUrl(e)}catch{return null}}async function no(e){const n=X();if(!n)throw new Je("downloadSound");return n.download(e)}function to(){return X()?.noiseBaseUrl??"/sounds/noise"}function oo(){const e=Number(X()?.noiseFileGain);return Number.isFinite(e)&&e>0?e:1}function uo(e){const n=AbortSignal.timeout;if(typeof n=="function")return n.call(AbortSignal,e);const t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal}const Qe="__ihab_core_tts_config__";function ro(e){globalThis[Qe]=e}function io(){return globalThis[Qe]?.urlResolver??null}function ao(){return globalThis[Qe]?.fallbackUrlResolver??null}const so=new Map;function lo(){so.clear()}const kn="__ihab_core_pronunciation_resolver__";function co(e){globalThis[kn]=e}function Co(){return globalThis[kn]??null}let K=null;const ie=new WeakMap,Xe=new WeakMap,Ze=new WeakMap;let $n=!1;const In=e=>Math.max(0,Math.min(1,Number.isFinite(e)?e:0));function go(){if($n||typeof document>"u")return;$n=!0;const e=()=>{try{K&&K.state!=="running"&&K.resume()}catch{}};for(const n of["pointerdown","touchend","keydown"])document.addEventListener(n,e,{capture:!0,passive:!0})}function Pn(){if(K)return K;try{const e=window.AudioContext||window.webkitAudioContext;return e?(K=new e,go(),K):null}catch{return null}}function fo(){try{K?.resume()}catch{}}function en(e,n){const t=ie.get(n);if(t)return t;try{const o=e.createMediaElementSource(n),r=e.createGain(),a=e.createAnalyser();a.fftSize=1024,a.smoothingTimeConstant=.6,r.gain.value=In(Xe.get(n)??n.volume),o.connect(r),r.connect(a),r.connect(e.destination);try{n.volume=1}catch{}const u={gain:r,analyser:a};return ie.set(n,u),u}catch{return null}}function Mn(e){if(!e)return Promise.resolve(null);const n=ie.get(e);if(n)return Promise.resolve(n.analyser);const t=Pn();if(!t)return Promise.resolve(null);if(t.state==="running")return Promise.resolve(en(t,e)?.analyser??null);const o=Ze.get(e);if(o)return o;const r=Promise.resolve().then(()=>t.resume()).then(()=>t.state==="running"?en(t,e)?.analyser??null:null).catch(()=>null).finally(()=>{Ze.delete(e)});return Ze.set(e,r),r}function ho(e){if(!e)return null;const n=ie.get(e);if(n)return n.analyser;const t=Pn();return t?t.state==="running"?en(t,e)?.analyser??null:(Mn(e),null):null}function mo(e,n){const t=In(n);Xe.set(e,t);const o=ie.get(e);if(o){try{e.volume!==1&&(e.volume=1)}catch{}const r=o.gain.gain;try{const a=o.gain.context.currentTime;r.cancelScheduledValues(a),r.setTargetAtTime(t,a,.01)}catch{try{r.value=t}catch{}}return"gain"}try{e.volume=t}catch{}return"element"}function So(e){return Xe.get(e)??e.volume}function Eo(e,n){e.getFloatTimeDomainData(n);let t=0;for(let o=0;o<n.length;o++){const r=n[o];t+=r*r}return Math.sqrt(t/n.length)}const vn="__ihab_core_image_config__";function yo(e){globalThis[vn]=e}function Fn(){return globalThis[vn]??null}const ae="word_image_existence_map_v1";let M=null,se=0,Gn=-1,le=null;const Le=new Map;function ce(){if(M)return M;try{const e=typeof localStorage<"u"?localStorage.getItem(ae):null,n=e?JSON.parse(e):null;M=n&&typeof n=="object"&&!Array.isArray(n)?n:{}}catch{M={}}return M}let nn=null;function Do(){nn||(nn=setTimeout(()=>{nn=null;try{typeof localStorage<"u"&&M&&localStorage.setItem(ae,JSON.stringify(M))}catch{}},200))}function je(e,n){return`${e}_${n??1}`}async function xn(e,n){const t=ce(),o=je(e,n);if(o in t)return t[o];if(Le.has(o))return Le.get(o);const r=Fn();if(!r)return!1;const a=r(e,n);if(!a)return!1;const u=fetch(a,{method:"HEAD",signal:uo(8e3)}).then(i=>i.status>=500?null:i.ok,()=>null).then(i=>(Le.delete(o),i===null?!1:(t[o]=i,se++,Do(),i)));return Le.set(o,u),u}function To(e,n){const t=ce(),o=je(e,n);return o in t?t[o]:void 0}async function po(e,n={}){const{force:t=!1,concurrency:o=16,onProgress:r}=n,a=ce(),u=t?Array.from(new Set(e)):Array.from(new Set(e)).filter(s=>!(je(s)in a));let i=0;if(u.length>0){let s=0;const c=Array.from({length:Math.min(o,u.length)},async()=>{for(;s<u.length;){const C=s++,l=u[C],g=je(l);if(!t&&g in a){i++,r?.(i,u.length);continue}try{await xn(l)}catch{}i++,r?.(i,u.length)}});await Promise.all(c)}try{typeof localStorage<"u"&&M&&localStorage.setItem(ae,JSON.stringify(M))}catch{}return{checked:u.length,cached:Object.keys(a).length,total:e.length}}function Ao(){const e=ce();if(Gn===se)return le?{...le}:null;const n=Object.values(e);return le=n.length===0?null:{total:n.length,exists:n.filter(Boolean).length},Gn=se,le?{...le}:null}function wo(e){const n=ce();Object.assign(n,e),se++;try{typeof localStorage<"u"&&localStorage.setItem(ae,JSON.stringify(n))}catch{}}function bo(){M={},se++;try{typeof localStorage<"u"&&localStorage.removeItem(ae)}catch{}}const _o={\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"},Wn={\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 Bo(e,n){return(Wn[e]?.glide??"")!==(Wn[n]?.glide??"")}function Re(e){return _o[e]??e}const A=["\u3131","\u3132","\u3134","\u3137","\u3138","\u3139","\u3141","\u3142","\u3143","\u3145","\u3146","\u3147","\u3148","\u3149","\u314A","\u314B","\u314C","\u314D","\u314E"],w=["\u314F","\u3150","\u3151","\u3152","\u3153","\u3154","\u3155","\u3156","\u3157","\u3158","\u3159","\u315A","\u315B","\u315C","\u315D","\u315E","\u315F","\u3160","\u3161","\u3162","\u3163"],B=["","\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 S(e){if(!e)return null;const n=e.charCodeAt(0)-44032;return n<0||n>=11172?null:{cho:Math.floor(n/588),jung:Math.floor(n%588/28),jong:n%28}}function No(){const e=new Map;return n=>{let t=e.get(n);return t||(t=[...n].map(o=>S(o)),e.set(n,t)),t}}function x(e,n,t=0){return String.fromCharCode(44032+(e*21+n)*28+t)}function Lo(e,n){if(!e||!n||e===n||e.length!==n.length)return"random";let t=0,o=null;for(let r=0;r<e.length;r++){const a=S(e[r]),u=S(n[r]);if(!a||!u)return"random";if(a.cho===u.cho&&a.jung===u.jung&&a.jong===u.jong)continue;t++;const i=a.cho!==u.cho,s=a.jung!==u.jung,c=a.jong!==u.jong;(i?1:0)+(s?1:0)+(c?1:0)>1?o="multi":i?o="cho":s?o="jung":o="jong"}return t!==1?"random":o==="cho"?"cho":o==="jung"?"jung":o==="jong"?"jong":"random"}function Hn(e){const n=S(e[0]||"");return n?A[n.cho]:""}function Yn(e){return[...e].map(n=>{const t=S(n);return t?A[t.cho]:n}).join("")}function Kn(e){return!!e&&[...e].every(n=>A.includes(n))}function jo(e,n){return n?(e=e.normalize("NFC"),n=n.normalize("NFC"),Kn(n)?Yn(e).includes(n):e.toLowerCase().includes(n.toLowerCase())):!0}function Ro(e,n){return Un(n)(e)}function Un(e){if(!e)return()=>!0;e=e.normalize("NFC");const n=[...e],t=u=>A.includes(u),o=u=>w.includes(u),r=n.map(u=>t(u)?"cho":o(u)?"jung":S(u)?"syl":"other"),a=n.map(u=>S(u));if(r.includes("other")){const u=e.toLowerCase();return i=>i.normalize("NFC").toLowerCase().includes(u)}return u=>{const i=[...u.normalize("NFC")];for(let s=0;s+n.length<=i.length;s++){let c=!0;for(let C=0;C<n.length;C++){const l=i[s+C],g=r[C];if(g==="cho"){if(Hn(l)!==n[C]){c=!1;break}}else if(g==="jung"){const h=S(l);if(!h||w[h.jung]!==n[C]){c=!1;break}}else{const h=a[C];if(h&&h.jong===0){const m=S(l);if(!m||m.cho!==h.cho||m.jung!==h.jung){c=!1;break}}else if(l!==n[C]){c=!1;break}}}if(c)return!0}return!1}}const Vn={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"]},zn=Object.fromEntries(Object.entries(Vn).map(([e,n])=>[n.join(""),B[Number(e)]]));function Oo(e,n){if(!e||!n)return!1;for(const t of e){const o=S(t);if(o&&A[o.cho]===n)return!0}return!1}function ko(e,n){if(!e||!n)return!1;for(const t of e){const o=S(t);if(o&&w[o.jung]===n)return!0}return!1}function qn(e,n,t){const o=B[e];return o===n?!0:t==="phoneme"&&Re(o)===Re(n)}function $o(e,n,t="glyph"){if(!e||!n)return!1;for(const o of e){const r=S(o);if(!(!r||r.jong<=0)&&qn(r.jong,n,t))return!0}return!1}function Io(e){if(!e)return 0;let n=0;for(const t of e)S(t)&&n++;return n}function Po(e){if(!e)return!1;let n=!1;for(const t of e){const o=S(t);if(o&&(n=!0,o.jong>0))return!1}return n}function Mo(e,n,t){return e.jong<=0?!1:n.some(o=>qn(e.jong,o,t))}function vo(e,n,t,o="glyph"){if(!e)return!1;const r=[...e],a=u=>{const i=S(r[u]);if(!i||n.cho&&!n.cho.includes(A[i.cho])||n.jung&&!n.jung.includes(w[i.jung]))return!1;if(n.jongNone){if(i.jong>0)return!1}else if(n.jong&&!Mo(i,n.jong,o))return!1;return!0};if(t==="head")return a(0);if(t==="tail")return a(r.length-1);if(t==="mid"){for(let u=1;u<r.length-1;u++)if(a(u))return!0;return!1}for(let u=0;u<r.length;u++)if(a(u))return!0;return!1}function Jn(e){return e.includes(",")||e.includes("_")}function Qn(e){if(e==="")return[{kind:"any"}];if(e.includes("_")){const n=[...e];if(n.length>4)return[{kind:"invalid"}];const t=n[0]??"_",o=n[1]??"_";let r=n.slice(2).join("");if(r.length===2){const a=zn[r];if(!a)return[{kind:"invalid"}];r=a}return[{kind:"template",cho:t,jung:o,jong:r||"_"}]}return[...e].map(n=>S(n)?{kind:"syllable",ch:n}:A.includes(n)?{kind:"cho",jamo:n}:w.includes(n)?{kind:"jung",jamo:n}:{kind:"invalid"})}function Fo(e,n){switch(n.kind){case"any":return!0;case"syllable":{const t=S(n.ch);if(!t)return e===n.ch;if(t.jong===0){const o=S(e);return!!o&&o.cho===t.cho&&o.jung===t.jung}return e===n.ch}case"cho":{const t=S(e);return!!t&&A[t.cho]===n.jamo}case"jung":{const t=S(e);return!!t&&w[t.jung]===n.jamo}case"template":{const t=S(e);return!(!t||n.cho!=="_"&&A[t.cho]!==n.cho||n.jung!=="_"&&w[t.jung]!==n.jung||n.jong!=="_"&&B[t.jong]!==n.jong)}case"invalid":return!1}}function Xn(e,n){e=e.normalize("NFC"),n=n.normalize("NFC");const t=n.split(",").flatMap(r=>Qn(r.trim()));if(t.length===0)return!0;const o=[...e];if(o.length<t.length)return!1;for(let r=0;r+t.length<=o.length;r++)if(t.every((a,u)=>Fo(o[r+u],a)))return!0;return!1}function Go(e){const n=e.split(",").flatMap(a=>Qn(a.trim())),t=new Set,o=new Set,r=new Set;for(const a of n)switch(a.kind){case"cho":t.add(a.jamo);break;case"jung":o.add(a.jamo);break;case"template":a.cho!=="_"&&t.add(a.cho),a.jung!=="_"&&o.add(a.jung),a.jong!=="_"&&r.add(a.jong);break;case"syllable":{const u=S(a.ch);u&&(t.add(A[u.cho]),o.add(w[u.jung]),u.jong!==0&&r.add(B[u.jong]));break}}return t.size===0&&o.size===0&&r.size===0?null:{cho:t.size?[...t]:null,jung:o.size?[...o]:null,jong:r.size?[...r]:null}}function xo(e){return!!S(e)||A.includes(e)||w.includes(e)}function Wo(e){const n=e.normalize("NFC").trim();if(!n)return{ok:!0};for(const t of n.split(",")){const o=t.trim();if(o!==""){if(o.includes("_")){const r=[...o];if(r.length>4)return{ok:!1};const a=r[0],u=r[1],i=r.slice(2).join(""),s=a===void 0||a==="_"||A.includes(a),c=u===void 0||u==="_"||w.includes(u),C=i===""||i==="_"||B.filter(Boolean).includes(i)||!!zn[i];if(s&&c&&C)continue;return{ok:!1}}if(![...o].every(xo))return{ok:!1}}}return{ok:!0}}A.length,w.length,B.length;function Ho(e,n){const t=n.normalize("NFC").trim();if(!t||!/[^\s,_]/.test(t))return e;if(Jn(t))return e.filter(s=>Xn(s.word,t));const o=Un(t),r=[...t].length,a=s=>!!s&&o(s.normalize("NFC").slice(0,r)),u=[],i=[];for(const s of e)(o(s.word)||o(s.pronunciation??""))&&(a(s.word)||a(s.pronunciation??"")?u:i).push(s);return u.concat(i)}const tn="word_pair_index_v2",on="word_pair_index_sig_v2";let v=null,Ce=null;function Zn(){try{if(typeof localStorage>"u")return null;const e=localStorage.getItem(tn),n=localStorage.getItem(on);return!e||!n?null:{index:JSON.parse(e),sig:n}}catch{return null}}function Yo(e,n){try{if(typeof localStorage>"u")return;localStorage.setItem(tn,JSON.stringify(e)),localStorage.setItem(on,n)}catch{}}function Ko(e){const n=e.map(o=>`${o.word}|${o.pron??""}`).sort();let t=0;for(const o of n)for(let r=0;r<o.length;r++)t=(t<<5)-t+o.charCodeAt(r)|0;return`${n.length}-${t}`}async function Uo(e,n){const t=new Set,o=[];for(const c of e){if(!c.word||t.has(c.word))continue;const C=c.pron||c.word,l=Array.from(C).map(S);l.some(g=>g===null)||l.length===Array.from(c.word).length&&(t.add(c.word),o.push({word:c.word,syls:l}))}const r={},a=o.length,u=new Map;for(const c of o){const C=c.syls.length;u.has(C)||u.set(C,[]),u.get(C).push(c)}let i=0;const s=["cho","jung","jong"];for(const c of u.values()){const C=c[0].syls.length;for(let l=0;l<C;l++)for(const g of s){const h=new Map;for(const m of c){let E="";for(let f=0;f<C;f++){f>0&&(E+="~");const d=m.syls[f];f===l?g==="cho"?E+=`*:${d.jung}:${d.jong}`:g==="jung"?E+=`${d.cho}:*:${d.jong}`:E+=`${d.cho}:${d.jung}:*`:E+=`${d.cho}:${d.jung}:${d.jong}`}let y=h.get(E);y||(y=[],h.set(E,y)),y.push(m)}for(const m of h.values())if(!(m.length<2))for(let E=0;E<m.length;E++){const y=m[E];for(let f=E+1;f<m.length;f++){const d=m[f];y.syls[l][g]!==d.syls[l][g]&&(r[y.word]||(r[y.word]={cho:[],jung:[],jong:[]}),r[d.word]||(r[d.word]={cho:[],jung:[],jong:[]}),r[y.word][g].push(d.word),r[d.word][g].push(y.word))}}}i+=c.length,n?.(i,a),await new Promise(l=>setTimeout(l,0))}return a>0&&n?.(a,a),r}let un=0;async function Vo(e,n={}){const t=Ko(e);if(!n.force){if(v&&Ce===t)return v;const a=Zn();if(a&&a.sig===t)return v=a.index,Ce=t,v}const o=++un,r=await Uo(e,n.onProgress);return o===un&&(v=r,Ce=t,Yo(r,t)),r}function et(){if(v)return v;const e=Zn();return e?(v=e.index,Ce=e.sig,v):null}function zo(){un+=1,v=null,Ce=null;try{typeof localStorage<"u"&&(localStorage.removeItem(tn),localStorage.removeItem(on))}catch{}}const rn={cho:A,jung:w,jong:B},k=e=>Array.isArray(e)?e.length>0:!!e;function an(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++){const o=e[t],r=n[t];if(!(!o||!r)&&(o.cho!==r.cho&&A[o.cho]==="\u3147"!=(A[r.cho]==="\u3147")||o.jung!==r.jung&&Bo(w[o.jung],w[r.jung])||o.jong!==r.jong&&o.jong===0!=(r.jong===0)))return!0}return!1}function nt(e,n,t){const o=t.pronOf(e),r=t.decompOf,a=t.sameStructureOnly&&r?r(o):null,u=[];for(const i of n)i!==e&&(t.okSet&&!t.okSet.has(i)||t.pronOf(i)!==o&&(a&&r&&an(a,r(t.pronOf(i)))||u.push(i)));return u}function qo(e,n,t){const o=n?.[e];if(!o)return[];const r=t.kind?o[t.kind]??[]:[...o.cho??[],...o.jung??[],...o.jong??[]];return nt(e,r,t)}function Jo(e,n,t,o,r,a,u){const i=["cho","jung","jong"].filter(g=>k(e[g])),s={};for(const g of i){const h=e[g];s[g]=new Set(Array.isArray(h)?h:[h])}const c=r==="pron",C=new Map;for(const g of n){const h=t(a(g));if(h.some(f=>!f))continue;let m=h;if(!c&&(m=t(g),m.length!==h.length||m.some(f=>!f)))continue;const E=h.length,y=C.get(E);y?y.push({w:g,dPron:h,dPos:m}):C.set(E,[{w:g,dPron:h,dPos:m}])}const l=new Map;for(const[g,h]of C){const m=new Map,E=(y,f)=>{const d=y.dPos[f];return d!=null&&i.every(D=>s[D].has(rn[D][d[D]]))};for(const y of h){let f;if(u==="head")f=E(y,0)?0:-1;else if(u==="tail")f=E(y,g-1)?g-1:-1;else if(u==="mid"){f=-1;for(let D=1;D<g-1;D++)if(E(y,D)){f=D;break}}else f=y.dPos.findIndex(D=>D!=null&&i.every(p=>s[p].has(rn[p][D[p]])));if(f<0)continue;const d=m.get(f);d?d.push(y):m.set(f,[y])}for(const[y,f]of m){const d=i.includes("cho"),D=i.includes("jung"),p=i.includes("jong"),P=b=>{let j="";for(let O=0;O<g;O++){const T=b[O];O===y?j+=(d?"*":T.cho)+"."+(D?"*":T.jung)+"."+(p?"*":T.jong)+".":j+=T.cho+"."+T.jung+"."+T.jong+"."}return j},L=new Map;for(const b of h){const j=P(b.dPron),O=L.get(j);O?O.push(b):L.set(j,[b])}for(const b of f){const j=L.get(P(b.dPron))??[],O=[];for(const T of j){if(T.w===b.w)continue;let $=!0;for(const G of i){const Q=b.dPron[y][G],z=T.dPron[y][G];if(z===Q){$=!1;break}if(c&&s[G].has(rn[G][z])){$=!1;break}}$&&(o&&an(b.dPron,T.dPron)||O.push(T.w))}l.set(b.w,O)}}}return l}const Oe=0,tt=1,q=2,sn=3,Qo=4,ke=5,ln=6,$e=7,Xo=8,cn=9,Z=10,Zo=11,ge=12,eu=13,de=14,Ie=15,Pe=16,fe=17,nu=18,I=0,W=1,tu=3,U=4,Cn=5,he=6,F=7,_=8,ot=9,ut=10,Me=11,rt=12,gn=13,ee=15,ve=16,H=17,it=18,dn=21,fn=27,ou=20,uu={1:Oe,2:tt,4:q,7:sn,8:ke,16:ln,17:$e,19:cn,20:Z,22:ge,23:de,24:Ie,25:Pe,26:fe},ru={[tu]:[W,Z],[Cn]:[U,ge],[ot]:[_,Oe],[ut]:[_,ln],[Me]:[_,$e],[rt]:[_,Z],[gn]:[_,Pe],14:[_,fe],[it]:[H,Z]},iu={[he]:q,[ee]:ke},hn={2:W,24:W,3:W,9:W,5:U,6:U,19:F,20:F,22:F,23:F,25:F,27:F,11:_,12:_,13:_,15:_,10:ve,14:H,18:H,26:H},at={[Oe]:Ie,[sn]:Pe,[$e]:fe,[ge]:de},st={[Oe]:tt,[sn]:Qo,[$e]:Xo,[cn]:Z,[ge]:eu},au=new Set([Cn,ut,Me,rt,gn,ee,it]),su=new Set(["\uBC1F"]);function lu(e){const n=(e??"").trim();if(!n)return"";const t=[...n],o=t.map(S);if(o.some(a=>a===null))return n;const r=o;for(let a=0;a<r.length;a++){const u=r[a],i=r[a+1],s=u.jong;if(!i){u.jong=hn[u.jong]??u.jong;break}if(u.jong===I)continue;if(i.cho===Zo){if(i.jung===ou){if(u.jong===F){u.jong=I,i.cho=ge;continue}if(u.jong===25){u.jong=I,i.cho=de;continue}if(u.jong===gn){u.jong=_,i.cho=de;continue}}if(u.jong===fn){u.jong=I;continue}const C=iu[u.jong];if(C!==void 0){u.jong=I,i.cho=C;continue}const l=ru[u.jong];if(l){u.jong=l[0],i.cho=l[1];continue}const g=uu[u.jong];g!==void 0&&(u.jong=I,i.cho=g);continue}if((u.jong===fn||u.jong===he||u.jong===ee)&&at[i.cho]!==void 0){i.cho=at[i.cho],u.jong=u.jong===he?U:u.jong===ee?_:I;continue}if((u.jong===fn||u.jong===he||u.jong===ee)&&i.cho===cn){i.cho=Z,u.jong=u.jong===he?U:u.jong===ee?_:I;continue}if(i.cho===nu){if(u.jong===Cn){u.jong=U,i.cho=de;continue}if(u.jong===ot){u.jong=_,i.cho=Ie;continue}if(u.jong===Me){u.jong=_,i.cho=fe;continue}const C=hn[u.jong]??u.jong;if(C===W){u.jong=I,i.cho=Ie;continue}if(C===F){u.jong=I,i.cho=Pe;continue}if(C===H){u.jong=I,i.cho=fe;continue}}let c=hn[u.jong]??u.jong;s===Me&&su.has(t[a])&&(c=H),u.jong=c,st[i.cho]!==void 0&&(c===W||c===F||c===H||au.has(s))&&(i.cho=st[i.cho]),(i.cho===q||i.cho===ln)&&(u.jong===W?u.jong=dn:u.jong===F?u.jong=U:u.jong===H&&(u.jong=ve)),i.cho===ke?u.jong===U?u.jong=_:u.jong===ve||u.jong===dn?i.cho=q:u.jong===W?(u.jong=dn,i.cho=q):u.jong===H&&(u.jong=ve,i.cho=q):u.jong===_&&i.cho===q&&(i.cho=ke)}return r.map(a=>x(a.cho,a.jung,a.jong)).join("")}const ne=/[ㄱ-ㅎ]/,cu=/[ㅏ-ㅣ]/;function me(e){e=e.normalize("NFC");for(let n=e.length-1;n>=0;n--){const t=e[n],o=t.charCodeAt(0);if(o>=44032&&o<=55203||ne.test(t)||cu.test(t))return t}return null}function lt(e){const n=me(e);if(!n)return"\uAC00";const t=n.charCodeAt(0);return t>=44032&&t<=55203?(t-44032)%28!==0?"\uC774":"\uAC00":ne.test(n)?"\uC774":"\uAC00"}function Cu(e){return`${e}${lt(e)}`}function ct(e){const n=me(e);if(!n)return"\uB97C";const t=n.charCodeAt(0);return t>=44032&&t<=55203?(t-44032)%28!==0?"\uC744":"\uB97C":ne.test(n)?"\uC744":"\uB97C"}function gu(e){return`${e}${ct(e)}`}function Ct(e){const n=me(e);if(!n)return"\uB294";const t=n.charCodeAt(0);return t>=44032&&t<=55203?(t-44032)%28!==0?"\uC740":"\uB294":ne.test(n)?"\uC740":"\uB294"}function du(e){return`${e}${Ct(e)}`}function gt(e){const n=me(e);if(!n)return"\uC640";const t=n.charCodeAt(0);return t>=44032&&t<=55203?(t-44032)%28!==0?"\uACFC":"\uC640":ne.test(n)?"\uACFC":"\uC640"}function fu(e){return`${e}${gt(e)}`}function dt(e){const n=me(e);if(!n)return"\uB85C";const t=n.charCodeAt(0);if(t>=44032&&t<=55203){const o=(t-44032)%28;return o===0||o===8?"\uB85C":"\uC73C\uB85C"}return n==="\u3139"?"\uB85C":ne.test(n)?"\uC73C\uB85C":"\uB85C"}function hu(e){return`${e}${dt(e)}`}function mu(e,n,t){const o=e.slice(),[r]=o.splice(n,1);return o.splice(t,0,r),o}function R(e,n=Math.random){const t=e.slice();for(let o=t.length-1;o>0;o--){const r=Math.floor(n()*(o+1));[t[o],t[r]]=[t[r],t[o]]}return t}function Y(e,n,t=Math.random){return!Array.isArray(e)||e.length===0||n<=0?[]:n>=e.length?R(e,t):R(e,t).slice(0,n)}const ft={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"}};function Su(e){const n=e?ft[e]?.group:void 0;return n==="synthesis"||n==="deletion"||n==="substitution"?n:null}const mn=A.indexOf("\u3147"),ht={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&&e.cho!==mn},MERGE_3_PHONEMES:{syllables:1,syllable:e=>e.jong>0&&!Vn[e.jong]&&e.cho!==mn}},Eu=new Set([]);function yu(e){return e in ht}function Du(e,n){const t=ht[e];if(!t)return!0;const o=[...n];if(o.length!==t.syllables)return!1;const r=S(o[0]);return!!r&&t.syllable(r)}function Tu(e){return Eu.has(e)}function pu(e){const n=e.charCodeAt((e.length||1)-1)||0;return n<44032||n>55203||(n-44032)%28===0?"\uC640":"\uACFC"}function Se(e){const n=e.charCodeAt((e.length||1)-1)||0;return n<44032||n>55203||(n-44032)%28===0?"\uB97C":"\uC744"}function Sn(e){const n=e.charCodeAt((e.length||1)-1)||0;if(n<44032||n>55203)return"\uB85C";const t=(n-44032)%28;return t===0||t===8?"\uB85C":"\uC73C\uB85C"}function mt(e){const n=e.charAt((e.length||1)-1),t=n.charCodeAt(0)||0;return t>=44032&&t<=55203?(t-44032)%28===0?"\uAC00":"\uC774":/[ㄱ-ㅎ]/.test(n)?"\uC774":"\uAC00"}const En={\u3131:"\uAE30\uC5ED",\u3132:"\uC30D\uAE30\uC5ED",\u3134:"\uB2C8\uC740",\u3137:"\uB514\uADFF",\u3138:"\uC30D\uB514\uADFF",\u3139:"\uB9AC\uC744",\u3141:"\uBBF8\uC74C",\u3142:"\uBE44\uC74D",\u3143:"\uC30D\uBE44\uC74D",\u3145:"\uC2DC\uC637",\u3146:"\uC30D\uC2DC\uC637",\u3147:"\uC774\uC751",\u3148:"\uC9C0\uC752",\u3149:"\uC30D\uC9C0\uC752",\u314A:"\uCE58\uC753",\u314B:"\uD0A4\uC754",\u314C:"\uD2F0\uC755",\u314D:"\uD53C\uC756",\u314E:"\uD788\uC757",\u3133:"\uAE30\uC5ED\uC2DC\uC637",\u3135:"\uB2C8\uC740\uC9C0\uC752",\u3136:"\uB2C8\uC740\uD788\uC757",\u313A:"\uB9AC\uC744\uAE30\uC5ED",\u313B:"\uB9AC\uC744\uBBF8\uC74C",\u313C:"\uB9AC\uC744\uBE44\uC74D",\u313D:"\uB9AC\uC744\uC2DC\uC637",\u313E:"\uB9AC\uC744\uD2F0\uC755",\u313F:"\uB9AC\uC744\uD53C\uC756",\u3140:"\uB9AC\uC744\uD788\uC757",\u3144:"\uBE44\uC74D\uC2DC\uC637",\u314F:"\uC544",\u3150:"\uC560",\u3151:"\uC57C",\u3152:"\uC598",\u3153:"\uC5B4",\u3154:"\uC5D0",\u3155:"\uC5EC",\u3156:"\uC608",\u3157:"\uC624",\u3158:"\uC640",\u3159:"\uC65C",\u315A:"\uC678",\u315B:"\uC694",\u315C:"\uC6B0",\u315D:"\uC6CC",\u315E:"\uC6E8",\u315F:"\uC704",\u3160:"\uC720",\u3161:"\uC73C",\u3162:"\uC758",\u3163:"\uC774"};function Au(e){if([...e].length!==1)return[e];const n=S(e);if(!n)return[e];const t=[A[n.cho],w[n.jung]];return n.jong!==0&&t.push(B[n.jong]),t}function St(e,n=!1){const t=e.filter(Boolean);if(t.length<2)return"";const o=i=>En[i]??i,r=t.slice(0,-1).map(i=>`"${i}"${pu(o(i))}`).join(" "),a=t[t.length-1],u=`"${a}"${Se(o(a))}`;return`${r} ${u} \uD569\uCE58\uBA74 \uC5B4\uB5A4 ${n?"\uC18C\uB9AC":"\uB2E8\uC5B4"}\uAC00 \uB418\uB098\uC694?`}function wu(e,n){return St(n,e==="MERGE_2_PHONEMES"||e==="MERGE_3_PHONEMES")}const yn=e=>En[e]??e,bu={cho:"\uCD08\uC131",jung:"\uBAA8\uC74C",jong:"\uBC1B\uCE68"};function _u(e,n){const t=(s,c)=>{const C=[...s].length===1?S(s):null,l=[...c].length===1?S(c):null;if(!C||!l)return null;const g=["cho","jung","jong"].filter(h=>C[h]!==l[h]);return g.length===1?{part:g[0],sx:C,sy:l}:null},o=t(e,n)??t(Fe(e),Fe(n));if(!o)return null;const r=o.part==="cho"?A:o.part==="jung"?w:B,a=r[o.sx[o.part]],u=r[o.sy[o.part]],i=o.part==="jong"&&!a?"add":o.part==="jong"&&!u?"remove":"swap";return{part:o.part,from:a,to:u,kind:i}}function Bu(e,n){const t=String(n?.word??n?.original??""),o=String(n?.changedFrom??""),r=String(n?.changedTo??"");if(e==="CHANGE_1_PHONEME_IN_1SYLL"||e==="CHANGE_1_PHONEME_IN_2SYLL"){const a=e==="CHANGE_1_PHONEME_IN_1SYLL",u=a?o||t:o,i=_u(u,r);if(i){const s=a?`"${t}"`:`"${t}"\uC758 "${u}"`,c=i.kind==="add"?"\uC5D0":"\uC5D0\uC11C",C=`"${i.from}"${Se(yn(i.from))}`,l=`"${i.to}"${Sn(yn(i.to))}`;return i.kind==="add"?`${s}${c} \uBC1B\uCE68 "${i.to}"${Se(yn(i.to))} \uB354\uD558\uBA74 \uBB34\uC5C7\uC774 \uB418\uB098\uC694?`:i.kind==="remove"?`${s}${c} \uBC1B\uCE68 ${C} \uBE7C\uBA74 \uBB34\uC5C7\uC774 \uB418\uB098\uC694?`:`${s}${c} ${bu[i.part]} ${C} ${l} \uBC14\uAFB8\uBA74 \uBB34\uC5C7\uC774 \uB418\uB098\uC694?`}}return e==="CHANGE_1_PHONEME_IN_1SYLL"?`"${t}"${Se(t)} "${r}"${Sn(r)} \uBC14\uAFB8\uBA74 \uBB34\uC5C7\uC774 \uB418\uB098\uC694?`:`"${t}"\uC5D0\uC11C "${o}"${Se(o)} "${r}"${Sn(r)} \uBC14\uAFB8\uBA74 \uBB34\uC5C7\uC774 \uB418\uB098\uC694?`}function Nu(e,n){const t=String(n?.word??n?.original??n?.base??""),o=String(n?.dropped??"");if(e==="DROP_FINAL_CONSONANT_FROM_1SYLL")return`"${t}"\uC5D0\uC11C \uBC1B\uCE68\uC774 \uC5C6\uC5B4\uC9C0\uBA74 \uC5B4\uB5A4 \uB9D0\uC774 \uB418\uB098\uC694?`;if(e==="REMOVE_CONSONANT_AND_IDENTIFY_PHONEME"){const r=String(n?.missingConsonant??"");return`"${t}"\uC5D0\uC11C "${r}"${mt(r)} \uC5C6\uC5B4\uC9C0\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB418\uB098\uC694?`}return`"${t}"\uC5D0\uC11C "${o}"${mt(o)} \uC5C6\uC5B4\uC9C0\uBA74 \uC5B4\uB5A4 \uB9D0\uC774 \uB418\uB098\uC694?`}function Lu(e,n,t){switch(Su(e)){case"synthesis":return wu(e,t);case"substitution":return Bu(e,n);case"deletion":return Nu(e,n);default:return""}}function ju(e){return e.replace(/"([ㄱ-ㅣ])"(으로|와|과|을|를|이|가|은|는|로)?/g,(n,t,o)=>{const r=En[t];if(!r)return n;if(!o)return`"${r}"`;const a=(r.charCodeAt(r.length-1)-44032)%28,u=a!==0;let i=o;return o==="\uC640"||o==="\uACFC"?i=u?"\uACFC":"\uC640":o==="\uC744"||o==="\uB97C"?i=u?"\uC744":"\uB97C":o==="\uC774"||o==="\uAC00"?i=u?"\uC774":"\uAC00":o==="\uC740"||o==="\uB294"?i=u?"\uC740":"\uB294":(o==="\uC73C\uB85C"||o==="\uB85C")&&(i=a===0||a===8?"\uB85C":"\uC73C\uB85C"),`"${r}"${i}`})}const Ru=e=>e==null?[]:Array.isArray(e)?e:[e];function Fe(e){if([...e].length!==1)return"";const n=S(e);if(!n)return"";const t=Re(B[n.jong]),o=t===""?0:B.indexOf(t);return x(n.cho,n.jung,o<0?0:o)}function Dn(e,n){return n.get(e)||Fe(e)||e}function Ge(e){return e?k(e.cho)?"cho":k(e.jung)?"jung":k(e.jong)?"jong":null:null}function J(e,n){const t=(r,a)=>!k(r)||Ru(r).includes(a),o=n.jongNone?e.jong===0:t(n.jong,B[e.jong]);return t(n.cho,A[e.cho])&&t(n.jung,w[e.jung])&&o}function te(e,n,t){const o=[...e];if(t!=="pron")return o.map(a=>S(a));const r=[...n.get(e)||e];return r.length!==o.length?o.map(a=>S(a)):r.map(a=>S(a))}function oe(e,n,t,o,r){const a=n==="cho"?A:n==="jung"?w:B,u=e[n],i=[],s=l=>n==="jung"?ku(Dn(l,r)):Dn(l,r),c=new Map([[s(t),-1]]),C=R(a.map((l,g)=>g).filter(l=>l!==u&&(n!=="cho"||a[l]!=="\u3147")&&(n!=="jong"||l!==0)));for(const l of C){if(i.length>=o)break;const g=n==="cho"?x(l,e.jung,e.jong):n==="jung"?x(e.cho,l,e.jong):x(e.cho,e.jung,l),h=s(g),m=c.get(h);if(m!==void 0){n==="jung"&&m>=0&&r.has(g)&&!r.has(i[m])&&(i[m]=g);continue}c.set(h,i.length),i.push(g)}return i}const Ou={\u3154:"\u3150",\u3156:"\u3152",\u315A:"\u3159",\u315E:"\u3159"};function ku(e){if([...e].length!==1)return e;const n=S(e);if(!n)return e;const t=Ou[w[n.jung]];return t?x(n.cho,w.indexOf(t),n.jong):e}function $u(e,n,t,o,r,a=null){const u=[...e];if(u.length!==2)return null;const i=u.map(l=>S(l));if(i.some(l=>!l))return null;const s=te(e,t,o);if(s.some(l=>!l))return null;const c=Ge(n);let C=c&&n?s.map((l,g)=>J(l,n)?g:-1).filter(l=>l>=0):[0,1];if(a!=null&&(C=C.filter(l=>l!==a)),!C.length)return null;for(const l of R(C)){const g=u[l];if(!r.has(g))continue;const h=oe(i[l],c??"cho",g,40,t),m=[];for(const E of h)if(E!==g&&r.has(E)&&!m.includes(E)&&m.push(E),m.length>=2)break;if(!(m.length<2))return{question:e,distractors:[g,...m]}}return null}function Iu(e,n,t,o,r,a=null){const u=[...e];if(u.length!==3)return null;const i=u.map(l=>S(l));if(i.some(l=>!l))return null;const s=te(e,t,o);if(s.some(l=>!l))return null;const c=Ge(n),C=c&&n?s.map((l,g)=>J(l,n)?g:-1).filter(l=>l>=0):[0,1,2];if(!C.length)return null;for(const l of R(C))for(const g of R([0,1,2].filter(h=>h!==l&&(a==null||h===a)))){const h=[0,1,2].filter(d=>d!==g),m=h.map(d=>u[d]).join("");if(!r.has(m))continue;const E=h.indexOf(l),y=oe(i[l],c??"cho",u[l],40,t),f=[];for(const d of y){const D=h.map(P=>u[P]);D[E]=d;const p=D.join("");if(p!==m&&r.has(p)&&!f.includes(p)&&f.push(p),f.length>=2)break}if(!(f.length<2))return{question:e,distractors:[m,...f]}}return null}function Pu(e,n,t,o,r,a=null){const u=[...e],i=u.length;if(i<2)return null;const s=[];for(let C=1;C<=i-1;C++)s.push({remain:u.slice(0,C).join(""),dropped:u.slice(C).join(""),droppedEnd:1}),s.push({remain:u.slice(i-C).join(""),dropped:u.slice(0,i-C).join(""),droppedEnd:0});const c=Ge(n);for(const{remain:C,dropped:l,droppedEnd:g}of R(s)){if(a!=null&&g!==a||[...C].length===1&&[...l].length===1||C===e||!r.has(C)||!r.has(l))continue;const h=[...C],m=h.map(f=>S(f));if(m.some(f=>!f))continue;const E=te(C,t,o);if(E.some(f=>!f))continue;const y=c&&n?E.map((f,d)=>J(f,n)?d:-1).filter(f=>f>=0):h.map((f,d)=>d);if(y.length)for(const f of R(y)){const d=oe(m[f],c??"cho",h[f],40,t),D=[];for(const p of d){const P=[...h];P[f]=p;const L=P.join("");if(L!==C&&r.has(L)&&!D.includes(L)&&D.push(L),D.length>=2)break}if(D.length>=2)return{question:e,distractors:[C,...D],dropped:l}}}return null}function Mu(e,n,t,o,r,a=null){if([...e].length!==1)return null;const u=S(t.get(e)||e);if(!u||u.jong===0)return null;const i=x(u.cho,u.jung,0),s=oe({cho:u.cho,jung:u.jung,jong:0},"cho",i,2,t);return s.length<2?null:{question:e,distractors:[i,...s]}}const Tn=A.indexOf("\u3147");function vu(e,n,t,o,r,a=null){if([...e].length!==1)return null;const u=S(t.get(e)||e);if(!u||u.jong!==0||u.cho===Tn)return null;const i=x(Tn,u.jung,0),s=oe({cho:Tn,jung:u.jung,jong:0},"jung",i,2,t);return s.length<2?null:{question:e,distractors:[i,...s]}}function Fu(e){const n=new Map;for(const t of e){const o=[...t],r=o.length;if(!(r<2||r>3))for(let a=0;a<r;a++){let u=r+"|"+a+"|";for(let s=0;s<r;s++)u+=s===a?"*":o[s];const i=n.get(u);i?i.push(t):n.set(u,[t])}}return n}function Gu(e,n,t,o,r,a=null,u=null,i=2){const s=[...e],c=s.length;if(c<2||c>3)return null;const C=s.map(d=>S(d));if(C.some(d=>!d))return null;const l=te(e,t,o);if(l.some(d=>!d))return null;const g=d=>t.get(d)??d,h=g(e),m=!!n&&(k(n.cho)||k(n.jung)||k(n.jong)),E=!!u&&(k(u.cho)||k(u.jung)||k(u.jong)),y=d=>{let D=c+"|"+d+"|";for(let p=0;p<c;p++)D+=p===d?"*":s[p];return D};let f;if(a!=null){if(a>=c||m&&!J(l[a],n))return null;f=[a]}else m?f=l.map((d,D)=>J(d,n)?D:-1).filter(d=>d>=0):f=Array.from({length:c},(d,D)=>D);for(const d of R(f)){const D=r.get(y(d))??[],p=[],P=[];for(const T of D){if(T===e)continue;const $=[...T].map(Be=>S(Be)),G=C[d],Q=$[d];if(!G||!Q)continue;let z=0;if(G.cho!==Q.cho&&z++,G.jung!==Q.jung&&z++,G.jong!==Q.jong&&z++,!(z<i||g(T)===h))if(E){const Be=te(T,t,o)[d];Be&&J(Be,u)?p.push(T):P.push(T)}else p.push(T)}if(!p.length)continue;const L=R(p)[0],b=[],j=new Set([h,g(L)]),O=E?P:p.filter(T=>T!==L);for(const T of R(O)){const $=g(T);if(!j.has($)&&(j.add($),b.push(T),b.length>=2))break}if(!E&&b.length<2)for(const T of R(D)){if(T===e||T===L)continue;const $=g(T);if(!j.has($)&&(j.add($),b.push(T),b.length>=2))break}if(!(b.length<2))return{question:e,distractors:[L,...b]}}return null}const xu=()=>{const e="\uC54C \uC218 \uC5C6\uB294 \uC624\uB958",n=typeof Ne?.t=="function"?Ne.t("common.unknownError",{defaultValue:e}):void 0;return typeof n=="string"&&n?n:e};function Wu(e,n){if(n===void 0&&(n=xu()),e instanceof Error)return e.message||n;if(typeof e=="string")return e||n;if(e&&typeof e=="object"){const t=e;for(const o of[t.message,t.error_description,t.error])if(typeof o=="string"&&o)return o}return n}const pn="\uB124\uD2B8\uC6CC\uD06C \uC5F0\uACB0\uC774 \uBD88\uC548\uC815\uD569\uB2C8\uB2E4. \uC5F0\uACB0 \uC0C1\uD0DC\uB97C \uD655\uC778\uD55C \uB4A4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uC8FC\uC138\uC694.",Hu=()=>{const e=typeof Ne?.t=="function"?Ne.t("common.networkError",{defaultValue:pn}):void 0;return typeof e=="string"&&e?e:pn};function Et(e){return e?/failed to fetch|load failed|networkerror|network request failed|fetcherror/i.test(e):!1}function Yu(e){return Et(e)?Hu():e}function Ku(e,n){return e==="id"?void 0:`${e}|${n?"asc":"desc"}`}function Uu(e){const[n,t]=e.split("|");return{key:n,asc:t==="asc"}}function Vu(e){let n=e==null?"":String(e);return!(typeof e=="number"&&Number.isFinite(e))&&/^[=+\-@\t\r]/.test(n)&&(n="'"+n),/[",\n\r]/.test(n)?`"${n.replaceAll('"','""')}"`:n}const zu=1e3;function qu(e,n){const t=new Blob([n.startsWith("\uFEFF")?n:"\uFEFF"+n],{type:"text/csv;charset=utf-8"}),o=URL.createObjectURL(t),r=document.createElement("a");r.href=o,r.download=e,r.click(),setTimeout(()=>URL.revokeObjectURL(o),zu)}const yt="__ihab_core_word_pool__";function Ju(){typeof window<"u"&&window.dispatchEvent(new CustomEvent("wordpool:update"))}function Qu(e,n){const t=new Map;for(const r of e)t.set(r.word,r);const o={entries:e,pairIndex:n??null,byWord:t};globalThis[yt]=o,Ju()}function Dt(){return globalThis[yt]??null}const ue=globalThis;function An(e,n){const t=o=>{};try{const o=n();o&&typeof o.catch=="function"&&o.catch(t)}catch(o){t(o)}}function Xu(e){ue.__ihabTrainingTimeLogger=e}function Zu(e){An("time",()=>ue.__ihabTrainingTimeLogger?.(e))}function er(e){ue.__ihabTrainingCompletionLogger=e}function nr(e){An("completion",()=>ue.__ihabTrainingCompletionLogger?.(e))}function tr(e){ue.__ihabCrosswordLogger=e}function or(e){An("crossword",()=>ue.__ihabCrosswordLogger?.(e))}function xe(e){if(typeof e=="string"){const n=e.trim();return n?Number.isNaN(new Date(n).getTime())?null:n:null}if(e instanceof Date)return Number.isNaN(e.getTime())?null:e.toISOString();if(typeof e=="number"&&Number.isFinite(e)){const n=new Date(e);return Number.isNaN(n.getTime())?null:n.toISOString()}return null}function N(e){return typeof e=="string"?e.trim()||null:typeof e=="number"?String(e):null}function Tt(e){for(const n of["correct","isCorrect","heard","judgement"])if(typeof e[n]=="boolean")return e[n];return e.score===1?!0:e.score===0?!1:null}function ur(e){return Array.isArray(e)?e.map((n,t)=>{const o=n??{};return{index:t,itemId:N(o.contextCode)??N(o.itemId)??N(o.itemCode)??N(o.id),question:N(o.question)??N(o.q)??N(o.sentence)??N(o.text)??N(o.prompt)??N(o.word)??N(o.targetSyllable),answer:N(o.answer),selected:N(o.selectedText)??N(o.selected),correct:Tt(o),shownAt:xe(o.shownAt)??xe(o.shown_at),answeredAt:xe(o.answeredAt)??xe(o.answered_at)}}):[]}function rr(e){return e.filter(n=>n.correct===!1)}let pt=null,At=null,wt=null;function ir(e){pt=e}function ar(e){At=e}function sr(e){wt=e}async function lr(e,n){try{return await pt?.(e,n)??null}catch{return null}}async function cr(){try{return await At?.()??null}catch{return null}}async function Cr(e,n){try{return await wt?.(e,n)??null}catch{return null}}const We=globalThis;function gr(e){We.__ihabNoiseSettingsStore=e}async function dr(){try{return await We.__ihabNoiseSettingsStore?.load()??null}catch{return null}}function fr(e){const n=t=>{};try{const t=We.__ihabNoiseSettingsStore?.save(e);t&&typeof t.catch=="function"&&t.catch(n)}catch(t){n(t)}}function hr(e){try{We.__ihabNoiseSettingsStore?.applied?.(e)}catch{}}function He(e){const n=new TextEncoder().encode(String(e).normalize("NFC"));let t="";return n.forEach(o=>{t+=o.toString(16).padStart(2,"0")}),t}const mr=He;function Sr(e,n){return`${e}/${He(n)}.mp3`}function Er(e={}){const n=e.storagePrefix??"audio-cache",t=e.voice??"ko-f",o=typeof e.speed=="number"?e.speed:1,r=e.filenameSanitizer??He;return async function(a){const u=String(a||"").trim();if(!u)return"";const i=`${r(u)}_${t}.mp3`,s=`${n}/${i}`;try{if(await Rn(s)){const c=await On(s);if(c)return c}}catch{}if(e.generator)try{const c=await e.generator(u,s,e);if(c)return c}catch{}try{const c=`/api/tts?word=${encodeURIComponent(u)}&voice=${encodeURIComponent(t)}&speed=${encodeURIComponent(String(o))}`;return await fetch(c,{method:"GET"}),`/audio-cache/${i}`}catch{return`/audio-cache/${i}`}}}async function yr(e){if(typeof document<"u"){const n=document.activeElement;let t=null;try{if(t=document.createElement("textarea"),t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.opacity="0",t.style.pointerEvents="none",document.body.appendChild(t),t.focus(),t.select(),t.setSelectionRange(0,e.length),document.execCommand("copy"))return!0}catch{}finally{if(t?.parentNode&&t.parentNode.removeChild(t),n&&n!==document.activeElement&&typeof n.focus=="function"&&n.isConnected)try{n.focus({preventScroll:!0})}catch{}}}try{if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function")return await navigator.clipboard.writeText(e),!0}catch{}return!1}const re="Asia/Seoul",Dr=/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2})(?::(\d{2})(?:\.(\d+))?)?$/;function Ye(e){let n;if(e instanceof Date)n=e;else if(typeof e=="string"){const t=e.trim(),o=Dr.exec(t);n=new Date(o?`${o[1]}T${o[2]}:${o[3]??"00"}${o[4]?`.${o[4].slice(0,3).padEnd(3,"0")}`:""}+09:00`:t)}else n=new Date(e);return Number.isNaN(n.getTime())?null:n}const Ee=e=>Ye(e);function Tr(e){const n=Ee(e);return n?n.toLocaleDateString("ko-KR",{timeZone:re,year:"numeric",month:"short",day:"numeric"}):""}function pr(e){const n=Ee(e);return n?n.toLocaleString("ko-KR",{timeZone:re,year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):""}function Ar(e,n){const t=n.startsWith("ko")?"ko-KR":"en-US",o=Ee(e);return o?o.toLocaleDateString(t,{timeZone:re,year:"numeric",month:"short",day:"numeric"}):""}function wr(e,n){const t=n.startsWith("ko")?"ko-KR":"en-US",o=Ee(e);return o?o.toLocaleString(t,{timeZone:re,year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):""}function br(e){const n=Ee(e);return n?n.toLocaleString("ko-KR",{timeZone:re,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function _r(e){if(e==null||e==="")return"";const n=Ye(e);return n?new Intl.DateTimeFormat("en-GB",{timeZone:re,hour:"2-digit",minute:"2-digit",hour12:!1}).format(n):""}function wn(){return ye(new Date)}function Br(){return bt(wn())}const Nr=540*60*1e3;function Lr(e,n,t){return new Date(Date.UTC(e,n,t)-Nr)}function bt(e){const[n,t,o]=e.split("-").map(Number);return new Date(n,(t||1)-1,o||1)}function ye(e){if(e==null||e==="")return"";const n=Ye(e);return n?new Intl.DateTimeFormat("fr-CA",{timeZone:"Asia/Seoul"}).format(n):""}function jr(e,n){if(!e)return"";const t=Ye(e);if(!t)return"";const o=t.getTime(),r=Math.max(0,Math.floor((Date.now()-o)/1e3)),a=Math.floor(r/60),u=Math.floor(a/60),i=Math.floor(u/24),s=Math.floor(i/7),c=Math.floor(i/30),C=Math.floor(i/365);return a<1?n("store.time.justNow","\uBC29\uAE08 \uC804"):a<60?n("store.time.minutesAgo",{n:a}):u<24?n("store.time.hoursAgo",{n:u}):i<7?n("store.time.daysAgo",{n:i}):s<5?n("store.time.weeksAgo",{n:s}):i<365?n("store.time.monthsAgo",{n:Math.min(c,11)}):n("store.time.yearsAgo",{n:C})}function Rr(e,n={}){const{sep:t=".",pad:o=!0,trailingDot:r=!1,fallback:a="\u2014"}=n;if(!e)return a;const u=ye(e instanceof Date?e:String(e));if(!u)return a;const[i,s,c]=u.split("-"),C=o?s:String(Number(s)),l=o?c:String(Number(c));return`${i}${t}${C}${t}${l}${r?".":""}`}function Or(e){const n=e.normalize("NFKC").replace(/\D/g,"");if(/^(050\d|0303)/.test(n)){const o=n.slice(0,12);return o.length<=4?o:o.length<=8?`${o.slice(0,4)}-${o.slice(4)}`:`${o.slice(0,4)}-${o.slice(4,o.length-4)}-${o.slice(o.length-4)}`}if(/^1[5-9]\d{2}/.test(n)&&n.length<=8)return n.length<=4?n:`${n.slice(0,4)}-${n.slice(4)}`;const t=n.slice(0,11);return t.startsWith("02")?t.length<=2?t:t.length<=6?`${t.slice(0,2)}-${t.slice(2)}`:`${t.slice(0,2)}-${t.slice(2,t.length-4)}-${t.slice(t.length-4)}`:t.length<=3?t:t.length<=7?`${t.slice(0,3)}-${t.slice(3)}`:`${t.slice(0,3)}-${t.slice(3,t.length-4)}-${t.slice(t.length-4)}`}const _t=String.raw`(?:0\d{1,2}|050\d|0303)-\d{3,4}-\d{4}`,kr=String.raw`1[5-9]\d{2}-\d{4}`,Bt=new RegExp(`^(?:${_t}|${kr})$`),Nt=new RegExp(`^${_t}$`);function $r(e){return Bt.test(e)}function Ir(e){return Nt.test(e)}function Pr(e){if(e){if(/^\d{4}\.\d{2}\.\d{2}$/.test(e))return e;if(/^\d{8}$/.test(e))return`${e.slice(0,4)}.${e.slice(4,6)}.${e.slice(6,8)}`;if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e.replace(/-/g,".");if(/^\d{4}-\d{2}-\d{2}[T ]/.test(e)){const n=ye(e);return n?n.replace(/-/g,"."):void 0}}}function Mr(e){if(e)return/^\d{4}\.\d{2}\.\d{2}$/.test(e)?e.replace(/\./g,"-"):e}function vr(e,n){if(!e)return"-";const t=/^(\d{1,2}):(\d{2})$/.exec(e.trim());if(!t)return e;const o=Number(t[1]),r=Number(t[2]),a=t[1].padStart(2,"0");return r===0?n("date.timeH",{h:o,hh:a,mm:t[2]}):n("date.timeHM",{h:o,hh:a,m:r,mm:t[2]})}function Fr(e){return(e??0).toLocaleString("ko-KR")}const Gr=[{key:"FOOD",label:"\uC74C\uC2DD",icon:"salad",color:"#FF8A65",subs:[{key:"TRKRFD",label:"\uD55C\uAD6D \uC804\uD1B5\uC74C\uC2DD"},{key:"MDKRFD",label:"\uD55C\uAD6D \uD604\uB300\uC74C\uC2DD"},{key:"WRLDFD",label:"\uC138\uACC4\uC758 \uC74C\uC2DD"},{key:"MTRFRT",label:"\uC2DD\uC7AC\uB8CC\uC640 \uACFC\uC77C"},{key:"GEFDKL",label:"\uC74C\uC2DD \uC0C1\uC2DD"}]},{key:"HLTH",label:"\uAC74\uAC15",icon:"heart",color:"#66BB6A",subs:[{key:"HTETHB",label:"\uAC74\uAC15\uD55C \uC2DD\uC2B5\uAD00"},{key:"DISILL",label:"\uBCD1\uACFC \uC9C8\uD658"},{key:"EXCISE",label:"\uC6B4\uB3D9"},{key:"GEHTKL",label:"\uAC74\uAC15\uC0C1\uC2DD"}]},{key:"WETH",label:"\uB0A0\uC528",icon:"sun-medium",color:"#42A5F5",subs:[{key:"GESSKL",label:"\uACC4\uC808\uC0C1\uC2DD"},{key:"SNWRAN",label:"\uB208\uACFC \uBE44"},{key:"WTHFCT",label:"\uC77C\uAE30\uC608\uBCF4"},{key:"GEWTKL",label:"\uB0A0\uC528\uC0C1\uC2DD"}]},{key:"PRSN",label:"\uC778\uBB3C",icon:"user-round",color:"#AB47BC",subs:[{key:"JODYPS",label:"\uC870\uC120\uC2DC\uB300"},{key:"MDKRPS",label:"\uD55C\uAD6D \uADFC\uD604\uB300"},{key:"THKDPS",label:"\uC0BC\uAD6D\uC2DC\uB300"},{key:"WRLART",label:"\uC138\uACC4\uC758 \uC608\uC220\uAC00"},{key:"WRLPSN",label:"\uC138\uACC4\uC758 \uC778\uBB3C"}]},{key:"KRCT",label:"\uD55C\uAD6D\uBB38\uD654",icon:"bow-arrow",color:"#EC407A",subs:[{key:"KRLANG",label:"\uC6B0\uB9AC\uB9D0"},{key:"TRPLCT",label:"\uC804\uD1B5\uB180\uC774"},{key:"HERITG",label:"\uBB38\uD654\uC7AC"},{key:"EVTFES",label:"\uD589\uC0AC\uC640 \uCD95\uC81C"},{key:"GECTKL",label:"\uC0C1\uC2DD"}]},{key:"STRY",label:"\uC774\uC57C\uAE30",icon:"message-circle",color:"#8D6E63",subs:[{key:"FRYTAL",label:"\uB3D9\uD654"},{key:"AMZING",label:"\uC2E0\uAE30\uD55C \uC774\uC57C\uAE30"},{key:"DAYSTR",label:"\uC77C\uC0C1 \uC18D \uC774\uC57C\uAE30"}]},{key:"LOCA",label:"\uC9C0\uC5ED",icon:"map-pin",color:"#26A69A",subs:[{key:"KRLDMK",label:"\uD55C\uAD6D\uC758 \uBA85\uC18C"},{key:"SELNMK",label:"\uC11C\uC6B8\uC758 \uBA85\uC18C"},{key:"WRDTRB",label:"\uC138\uACC4\uC5EC\uD589"},{key:"NAVIGT",label:"\uAE38 \uCC3E\uAE30"}]},{key:"SOAR",label:"\uC0AC\uD68C\uC640 \uC608\uC220",icon:"landmark",color:"#5C6BC0",subs:[{key:"KRSOCI",label:"\uD55C\uAD6D"},{key:"ECONEW",label:"\uACBD\uC81C\uC640 \uB274\uC2A4"},{key:"GENART",label:"\uC608\uC220"},{key:"GELFKL",label:"\uC0DD\uD65C \uC0C1\uC2DD"}]},{key:"NTSC",label:"\uC790\uC5F0\uACFC \uACFC\uD559",icon:"leaf",color:"#9CCC65",subs:[{key:"ANIMAL",label:"\uB3D9\uBB3C"},{key:"PLANTS",label:"\uC2DD\uBB3C"},{key:"ETHPLT",label:"\uC9C0\uAD6C"},{key:"TOLELC",label:"\uB3C4\uAD6C\uC640 \uC804\uC790\uC81C\uD488"},{key:"GESCKL",label:"\uACFC\uD559\uC0C1\uC2DD"}]},{key:"SPRT",label:"\uC2A4\uD3EC\uCE20",icon:"trophy",color:"#FFCA28",subs:[{key:"INVDSP",label:"\uAC1C\uC778\uACBD\uAE30"},{key:"MARART",label:"\uACA9\uD22C\uAE30"},{key:"TEAMSP",label:"\uB2E8\uCCB4\uACBD\uAE30"},{key:"FOOTBL",label:"\uCD95\uAD6C"},{key:"GESPKL",label:"\uC2A4\uD3EC\uCE20 \uC0C1\uC2DD"}]}],xr=[{key:"LISTEN_IN_NOISE",label:"\uC18C\uC74C \uD558 \uBB38\uC7A5 \uB4E3\uAE30",icon:"party-popper",desc:"\uC18C\uC74C \uD658\uACBD \uC18D \uBB38\uC7A5 \uC774\uD574 \uD6C8\uB828"},{key:"SHORT_STORY",label:"\uC9E7\uC740 \uC774\uC57C\uAE30 \uB4E3\uAE30",icon:"message-square",desc:"\uC9E7\uC740 \uC774\uC57C\uAE30 + 4\uBB38\uC81C"},{key:"LONG_STORY",label:"\uAE34 \uC774\uC57C\uAE30 \uB4E3\uAE30",icon:"message-square-text",desc:"\uAE34 \uC774\uC57C\uAE30 \uC2EC\uD654 \uD6C8\uB828"},{key:"ORDERING_SENTENCE",label:"\uBB38\uC7A5 \uC21C\uC11C\uD654 \uD558\uAE30",icon:"align-start-vertical",desc:"\uC21C\uC11C \uBC30\uC5F4 \uD6C8\uB828"}];let bn=null;function Wr(e){bn=e}function Hr(){return bn?.topicTypes??Gr}function Yr(){return bn?.trainingTypes??xr}const Lt="ihab_theme",jt="light";function Rt(){try{const e=localStorage.getItem(Lt);if(e==="light"||e==="dark"||e==="auto")return e}catch{}return jt}function Ot(e){const n=e==="light"||e==="dark"||e==="auto"?e:jt;try{document.documentElement.setAttribute("data-theme",n),localStorage.setItem(Lt,n)}catch{}}function Kr(){Ot(Rt())}const kt="ihab_font_scale",Ur="medium",Vr=["medium","large1","large2","large3"];function $t(){try{const e=localStorage.getItem(kt);if(Vr.includes(e))return e}catch{}return Ur}function It(e){try{document.documentElement.setAttribute("data-font-scale",e),localStorage.setItem(kt,e)}catch{}}function zr(){It($t())}const De=[],Te=[],pe=[],Ae=[],we={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},be={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},qr={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};let _n=null,Pt=null,V=null;function Mt({counts:e,forceRefresh:n}={}){const t=Object.assign({},qr,e||{}),o=wn(),r=ye(new Date(`${o}T00:00:00+09:00`).getTime()-864e5),a=JSON.stringify(t);if(!n&&Pt===o&&_n===a&&V)return Object.assign(we,V.today),Object.assign(be,V.yesterday?.selection||{LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),{today:we,yesterday:be};const u={LISTEN_IN_NOISE:Y(De,Math.max(0,Number(t.LISTEN_IN_NOISE)||0)),SHORT_STORY:Y(Te,Math.max(0,Number(t.SHORT_STORY)||0)),LONG_STORY:Y(pe,Math.max(0,Number(t.LONG_STORY)||0)),ORDERING_SENTENCE:Y(Ae,Math.max(0,Number(t.ORDERING_SENTENCE)||0))};let i=null;return V&&_n===a&&V.yesterday&&V.yesterday.date===r&&(i=V.yesterday.selection),i||(i={LISTEN_IN_NOISE:Y(De,Math.max(0,Number(t.LISTEN_IN_NOISE)||0)),SHORT_STORY:Y(Te,Math.max(0,Number(t.SHORT_STORY)||0)),LONG_STORY:Y(pe,Math.max(0,Number(t.LONG_STORY)||0)),ORDERING_SENTENCE:Y(Ae,Math.max(0,Number(t.ORDERING_SENTENCE)||0))}),Object.assign(we,u),Object.assign(be,i),Pt=o,_n=a,V={today:u,yesterday:{date:r,countsKey:a,selection:i}},{today:we,yesterday:be}}function Jr(){return{today:we,yesterday:be}}function Qr(){return{LISTEN_IN_NOISE:De,SHORT_STORY:Te,LONG_STORY:pe,ORDERING_SENTENCE:Ae}}let Ke=!1,_e=null;async function Xr(){try{const e={url:typeof document>"u"?require("url").pathToFileURL(__filename).href:Ve&&Ve.tagName.toUpperCase()==="SCRIPT"&&Ve.src||new URL("utils.cjs.js",document.baseURI).href}&&void 0||"/",n=await fetch(`${e}data/allTrainingData.json`);return n.ok?await n.json():null}catch{return null}}async function vt(){if(!Ke)return _e||(_e=(async()=>{const e=await Xr();if(!e){_e=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}const n={noise:[],short:[],long:[],order:[]};try{for(const t of Object.keys(e||{})){const o=e[t]||[];for(const r of o){if(!r||typeof r!="object")continue;const a=r,u=String(a.training_type||t),i=String(a.category_main_code||a.category_main||a.category_0||""),s=String(a.category_sub_code||a.category_sub||a.category_1||""),c=Object.assign({},a,{training_type:u,category_0:i,category_1:s});u==="LISTEN_IN_NOISE"?n.noise.push(c):u==="SHORT_STORY"?n.short.push(c):u==="LONG_STORY"?n.long.push(c):u==="ORDERING_SENTENCE"&&n.order.push(c)}}}catch{_e=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}De.push(...n.noise),Te.push(...n.short),pe.push(...n.long),Ae.push(...n.order),Ke=!0;try{Mt()}catch{}try{window.dispatchEvent(new Event("speechear.data.updated"))}catch{}})(),_e)}function Zr(){return Ke}async function ei(e=3e3){const n=vt();let t;try{await Promise.race([n,new Promise(o=>{t=setTimeout(o,e)})])}finally{t!==void 0&&clearTimeout(t)}return Ke}const ni=[{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."}],ti=[{key:"FOOD",label:"\uC74C\uC2DD",icon:"salad",color:"#FF8A65",subs:[{key:"TRKRFD",label:"\uD55C\uAD6D \uC804\uD1B5\uC74C\uC2DD"},{key:"MDKRFD",label:"\uD55C\uAD6D \uD604\uB300\uC74C\uC2DD"},{key:"WRLDFD",label:"\uC138\uACC4\uC758 \uC74C\uC2DD"},{key:"MTRFRT",label:"\uC2DD\uC7AC\uB8CC\uC640 \uACFC\uC77C"},{key:"GEFDKL",label:"\uC74C\uC2DD \uC0C1\uC2DD"}]},{key:"HLTH",label:"\uAC74\uAC15",icon:"heart",color:"#66BB6A",subs:[{key:"HTETHB",label:"\uAC74\uAC15\uD55C \uC2DD\uC2B5\uAD00"},{key:"DISILL",label:"\uBCD1\uACFC \uC9C8\uD658"},{key:"EXCISE",label:"\uC6B4\uB3D9"},{key:"GEHTKL",label:"\uAC74\uAC15\uC0C1\uC2DD"}]},{key:"WETH",label:"\uB0A0\uC528",icon:"sun-medium",color:"#42A5F5",subs:[{key:"GESSKL",label:"\uACC4\uC808\uC0C1\uC2DD"},{key:"SNWRAN",label:"\uB208\uACFC \uBE44"},{key:"WTHFCT",label:"\uC77C\uAE30\uC608\uBCF4"},{key:"GEWTKL",label:"\uB0A0\uC528\uC0C1\uC2DD"}]},{key:"PRSN",label:"\uC778\uBB3C",icon:"user-round",color:"#AB47BC",subs:[{key:"JODYPS",label:"\uC870\uC120\uC2DC\uB300"},{key:"MDKRPS",label:"\uD55C\uAD6D \uADFC\uD604\uB300"},{key:"THKDPS",label:"\uC0BC\uAD6D\uC2DC\uB300"},{key:"WRLART",label:"\uC138\uACC4\uC758 \uC608\uC220\uAC00"},{key:"WRLPSN",label:"\uC138\uACC4\uC758 \uC778\uBB3C"}]},{key:"KRCT",label:"\uD55C\uAD6D\uBB38\uD654",icon:"bow-arrow",color:"#EC407A",subs:[{key:"KRLANG",label:"\uC6B0\uB9AC\uB9D0"},{key:"TRPLCT",label:"\uC804\uD1B5\uB180\uC774"},{key:"HERITG",label:"\uBB38\uD654\uC7AC"},{key:"EVTFES",label:"\uD589\uC0AC\uC640 \uCD95\uC81C"},{key:"GECTKL",label:"\uC0C1\uC2DD"}]},{key:"STRY",label:"\uC774\uC57C\uAE30",icon:"message-circle",color:"#8D6E63",subs:[{key:"FRYTAL",label:"\uB3D9\uD654"},{key:"AMZING",label:"\uC2E0\uAE30\uD55C \uC774\uC57C\uAE30"},{key:"DAYSTR",label:"\uC77C\uC0C1 \uC18D \uC774\uC57C\uAE30"}]},{key:"LOCA",label:"\uC9C0\uC5ED",icon:"map-pin",color:"#26A69A",subs:[{key:"KRLDMK",label:"\uD55C\uAD6D\uC758 \uBA85\uC18C"},{key:"SELNMK",label:"\uC11C\uC6B8\uC758 \uBA85\uC18C"},{key:"WRDTRB",label:"\uC138\uACC4\uC5EC\uD589"},{key:"NAVIGT",label:"\uAE38 \uCC3E\uAE30"}]},{key:"SOAR",label:"\uC0AC\uD68C\uC640 \uC608\uC220",icon:"landmark",color:"#5C6BC0",subs:[{key:"KRSOCI",label:"\uD55C\uAD6D"},{key:"ECONEW",label:"\uACBD\uC81C\uC640 \uB274\uC2A4"},{key:"GENART",label:"\uC608\uC220"},{key:"GELFKL",label:"\uC0DD\uD65C \uC0C1\uC2DD"}]},{key:"NTSC",label:"\uC790\uC5F0\uACFC \uACFC\uD559",icon:"leaf",color:"#9CCC65",subs:[{key:"ANIMAL",label:"\uB3D9\uBB3C"},{key:"PLANTS",label:"\uC2DD\uBB3C"},{key:"ETHPLT",label:"\uC9C0\uAD6C"},{key:"TOLELC",label:"\uB3C4\uAD6C\uC640 \uC804\uC790\uC81C\uD488"},{key:"GESCKL",label:"\uACFC\uD559\uC0C1\uC2DD"}]},{key:"SPRT",label:"\uC2A4\uD3EC\uCE20",icon:"trophy",color:"#FFCA28",subs:[{key:"INVDSP",label:"\uAC1C\uC778\uACBD\uAE30"},{key:"MARART",label:"\uACA9\uD22C\uAE30"},{key:"TEAMSP",label:"\uB2E8\uCCB4\uACBD\uAE30"},{key:"FOOTBL",label:"\uCD95\uAD6C"},{key:"GESPKL",label:"\uC2A4\uD3EC\uCE20 \uC0C1\uC2DD"}]}],oi={LISTEN_IN_NOISE:"listenInNoise",SHORT_STORY:"shortStory",LONG_STORY:"longStory",ORDERING_SENTENCE:"orderingSentence"};let Ue=null,Ft=null,Gt=null;function ui(){const e=Dt();if(e&&e.entries.length>0){const n=et();if(Ue&&Ft===e&&Gt===n)return Ue;const t=new Set,o=[];for(const r of e.entries)!r.word||t.has(r.word)||(t.add(r.word),o.push({w:r.word,s:r.syllables,p:n?.[r.word]?[...n[r.word].cho??[],...n[r.word].jung??[],...n[r.word].jong??[]]:[],pron:r.pronunciation||r.word,grade:r.grade}));return Ue=o,Ft=e,Gt=n,Ue}return[]}new Proxy([],{get(e,n){const t=ui(),o=t[n];return typeof o=="function"?o.bind(t):o}});const ri={free:{maxCustomers:0,visitWord:!1,visitSentence:!1,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!1,wordTablePrint:!1,addToMyList:!1,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!1,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:1,sentenceDataLevel:0,crossword:!1,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!1,sentenceTrainingView:!1},personal_standard:{maxCustomers:0,visitWord:!1,visitSentence:!1,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!0,wordTrainingSetting:!0,myWordList:!0,wordListShare:!0,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!0,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!0,wordSearchAddToGroupList:!1,wordDataLevel:2,sentenceDataLevel:2,crossword:!0,crosswordMid:!0,crosswordHigh:!1,wordTrainingView:!0,sentenceTrainingView:!0},mgr_free:{maxCustomers:5,visitWord:!0,visitSentence:!0,homework:!0,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!1,wordTablePrint:!1,addToMyList:!1,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!1,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:1,sentenceDataLevel:1,crossword:!1,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!1,sentenceTrainingView:!1},none:{maxCustomers:0,visitWord:!1,visitSentence:!1,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!1,wordTableSetting:!1,wordTablePrint:!1,addToMyList:!1,addToGroupList:!1,wordSearch:!1,wordSearchPrint:!1,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:0,sentenceDataLevel:0,crossword:!1,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!1,sentenceTrainingView:!1},lite_word:{maxCustomers:10,visitWord:!0,visitSentence:!1,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!1,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:1,sentenceDataLevel:0,crossword:!0,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!0,sentenceTrainingView:!1},lite_sentence:{maxCustomers:10,visitWord:!1,visitSentence:!0,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!1,wordTableSetting:!1,wordTablePrint:!0,addToMyList:!1,addToGroupList:!1,wordSearch:!1,wordSearchPrint:!0,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:0,sentenceDataLevel:1,crossword:!0,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!1,sentenceTrainingView:!0},lite:{maxCustomers:10,visitWord:!0,visitSentence:!0,homework:!0,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!1,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:1,sentenceDataLevel:1,crossword:!0,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!0,sentenceTrainingView:!0},standard:{maxCustomers:30,visitWord:!0,visitSentence:!0,homework:!0,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!0,wordTrainingSetting:!0,myWordList:!0,wordListShare:!0,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!0,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!0,wordSearchAddToGroupList:!1,wordDataLevel:2,sentenceDataLevel:2,crossword:!0,crosswordMid:!0,crosswordHigh:!1,wordTrainingView:!0,sentenceTrainingView:!0},pro:{maxCustomers:50,visitWord:!0,visitSentence:!0,homework:!0,customerStats:!0,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!0,wordTrainingSetting:!0,myWordList:!0,wordListShare:!0,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!0,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!0,wordSearchAddToGroupList:!1,wordDataLevel:3,sentenceDataLevel:3,crossword:!0,crosswordMid:!0,crosswordHigh:!0,wordTrainingView:!0,sentenceTrainingView:!0},enterprise:{maxCustomers:1/0,visitWord:!0,visitSentence:!0,homework:!0,customerStats:!0,managerCustomerSplit:!0,managerManagement:!0,sentenceTrainingSetting:!0,wordTrainingSetting:!0,myWordList:!0,wordListShare:!0,groupTrainingSetting:!0,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!0,addToGroupList:!0,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!0,wordSearchAddToGroupList:!0,wordDataLevel:3,sentenceDataLevel:3,crossword:!0,crosswordMid:!0,crosswordHigh:!0,wordTrainingView:!0,sentenceTrainingView:!0}},ii={none:0,free:1,personal_standard:2,mgr_free:10,lite_word:11,lite_sentence:11,lite:12,standard:13,pro:14,enterprise:15},ai=new Set(["mgr_free","lite_word","lite_sentence","lite","standard","pro","enterprise"]);function si(e){return ai.has(e)}const li={free:{sentenceTrainingDaily:2,wordTrainingDaily:2,gameDaily:1},personal_standard:{sentenceTrainingDaily:null,wordTrainingDaily:null,gameDaily:null},mgr_free:{sentenceTrainingDaily:2,wordTrainingDaily:2,gameDaily:1,trainingItemMax:5,customerMax:5,homeworkSendDaily:1},lite:{sentenceTrainingDaily:5,wordTrainingDaily:5,gameDaily:5,trainingItemMax:10,customerMax:10,homeworkSendDaily:10},standard:{sentenceTrainingDaily:null,wordTrainingDaily:null,gameDaily:null,trainingItemMax:30,customerMax:30,homeworkSendDaily:30},pro:{sentenceTrainingDaily:null,wordTrainingDaily:null,gameDaily:null,trainingItemMax:null,customerMax:50,homeworkSendDaily:50},enterprise:{sentenceTrainingDaily:null,wordTrainingDaily:null,gameDaily:null,trainingItemMax:null,customerMax:null,homeworkSendDaily:null}};function ci(e){const n=(e??"").toLowerCase();return n==="speechear_free"||n==="free"?"free":n.startsWith("manager_free")||n.startsWith("mgr_free")?"mgr_free":n.startsWith("manager_enterprise")?"enterprise":n.startsWith("manager_pro")?"pro":n.startsWith("manager_standard")?"standard":n.startsWith("manager_lite_word")?"lite_word":n.startsWith("manager_lite_sentence")?"lite_sentence":n.startsWith("manager_lite")||n.startsWith("mgr_lite")?"lite":n.startsWith("mgr_standard")?"standard":n.startsWith("mgr_pro")?"pro":n.startsWith("content_")||n.startsWith("speechear_")||n.startsWith("light_")||n==="light"?"personal_standard":"none"}const Ci=5,gi=5;function di({rank:e,voteCount:n,quota:t=5}){return e<t&&n>0}const fi={selected:"ALREADY_SELECTED",added:"ALREADY_ADDED",rejected:"ALREADY_REJECTED"},xt="chunk-reload-ts";function Wt(){try{return Number(sessionStorage.getItem(xt)||0)}catch{return 0}}function Bn(e=Date.now()){if(e-Wt()<=1e4)return!1;try{sessionStorage.setItem(xt,String(e))}catch{}return window.location.reload(),!0}function Ht(e=Date.now()){const n=Wt();return n>0&&e-n<=1e4}function hi(){if(typeof window>"u")return()=>{};const e=t=>{Bn()&&t.preventDefault()},n=t=>{const o=t.target;o instanceof HTMLLinkElement&&o.rel==="stylesheet"&&Bn()};return window.addEventListener("vite:preloadError",e),window.addEventListener("error",n,!0),()=>{window.removeEventListener("vite:preloadError",e),window.removeEventListener("error",n,!0)}}function mi(e,n){return e?!!n&&n.access_token===e.access_token:!0}function Si(e,n){return Yt.lazy(async()=>{const t=await n();if(t&&typeof t=="object"&&"default"in t)return t;if(Ht())return new Promise(()=>{});throw new Error(`[lazyPage] ${e}: \uD654\uBA74 \uBAA8\uB4C8\uC744 \uBC1B\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4(default \uB0B4\uBCF4\uB0B4\uAE30 \uC5C6\uC74C). \uBC30\uD3EC \uC9C1\uD6C4\uB77C\uBA74 \uC0C8\uB85C\uACE0\uCE68\uC73C\uB85C \uD480\uB9BD\uB2C8\uB2E4.`)})}function Ei(...e){let n=!1;const t=()=>{if(!n)for(const a of e)a().catch(()=>{})},o=globalThis.requestIdleCallback;if(o){const a=o(t,{timeout:2e3});return()=>{n=!0;const u=globalThis.cancelIdleCallback;u?.(a)}}const r=setTimeout(t,300);return()=>{n=!0,clearTimeout(r)}}const yi=e=>({word:e.Word,pronunciation:e.SP,colloquialPronunciation:e.CP??void 0,grade:String(e.Grade),pos:e.POS,wordType:e.Class,homonum:e.Homonum!=null?Number(e.Homonum):void 0}),Di="0.271.0";exports.CAPABILITY=ft,exports.CHOSEONG=A,exports.CORE_VERSION=Di,exports.JONGSEONG=B,exports.JUNGSEONG=w,exports.LONG_STORIES=pe,exports.NETWORK_ERROR_MESSAGE=pn,exports.NOISE_DATAS=De,exports.ORDER_SETS=Ae,exports.PERSONAL_PHONE_REGEX=Nt,exports.PHONE_REGEX=Bt,exports.PLAN_FEATURES=ri,exports.PLAN_LIMITS=li,exports.SHORT_STORIES=Te,exports.TIER_RANK=ii,exports.TOPIC_TYPES=ti,exports.TRAINING_TYPES=ni,exports.TRAINING_TYPE_I18N_KEY=oi,exports.WORD_SUGGESTION_ACCOUNT_LIMIT=gi,exports.WORD_SUGGESTION_EXISTING_ERROR=fi,exports.WORD_SUGGESTION_WEEKLY_QUOTA=Ci,exports.applyFontScale=It,exports.applyTheme=Ot,exports.buildChangeWholeSyllableProblem=Gu,exports.buildDropCompoundProblem=Pu,exports.buildDropContrast3Problem=Iu,exports.buildDropContrastProblem=$u,exports.buildDropFinalConsonantProblem=Mu,exports.buildMultiPartPosContrast=Jo,exports.buildPairIndex=Vo,exports.buildRemoveConsonantProblem=vu,exports.buildSyllableMaskIndex=Fu,exports.bulkSetImageExistence=wo,exports.cardQuestionTitle=Lu,exports.checkImageExists=xn,exports.classifyPairDifficulty=Lo,exports.clearAudioExistsCache=lo,exports.clearImageExistenceCache=bo,exports.clearPairIndexCache=zo,exports.composeSyllable=x,exports.computeDailySelection=Mt,exports.configureImageResolver=yo,exports.configureNoiseSettingsStore=gr,exports.configurePronunciationResolver=co,exports.configureStorage=Zt,exports.configureTTS=ro,exports.configureTrainingCategories=Wr,exports.copyText=yr,exports.createDecompCache=No,exports.createTTSUrlResolver=Er,exports.dateToDb=Mr,exports.downloadCsvText=qu,exports.downloadSound=no,exports.ensureTrainingDataLoaded=ei,exports.escapeCsvField=Vu,exports.fileExists=Rn,exports.filterContrastCandidates=nt,exports.finalToPhoneme=Re,exports.firstChoseongOf=Hn,exports.formatCount=Fr,exports.formatDateKo=Tr,exports.formatDateLocale=Ar,exports.formatDateLongKo=pr,exports.formatDateLongLocale=wr,exports.formatDatetimeKo=br,exports.formatPhone=Or,exports.formatRelativeTime=jr,exports.formatTimeHM=vr,exports.formatYmd=Rr,exports.getAssetBaseUrl=Ln,exports.getDailySelection=Jr,exports.getElementAnalyser=ho,exports.getElementVolume=So,exports.getErrorMessage=Wu,exports.getImageExistenceStats=Ao,exports.getImageExistsCached=To,exports.getImageResolver=Fn,exports.getNoiseBaseUrl=to,exports.getNoiseFileGain=oo,exports.getPairIndex=et,exports.getPlanTier=ci,exports.getPronunciationResolver=Co,exports.getSavedFontScale=$t,exports.getSavedTheme=Rt,exports.getSignedOrPublicUrl=On,exports.getTTSFallbackUrlResolver=ao,exports.getTTSUrlResolver=io,exports.getTodayKst=wn,exports.getTodayKstDate=Br,exports.getTopicTypes=Hr,exports.getTrainingPools=Qr,exports.getTrainingTypes=Yr,exports.getWordPool=Dt,exports.hasQuestionWordConstraint=yu,exports.hasSel=k,exports.hasStructureContrast=an,exports.initFontScale=zr,exports.initTheme=Kr,exports.installSkewRecovery=hi,exports.isAllChoseong=Kn,exports.isManagerTier=si,exports.isManualOnlyType=Tu,exports.isNetworkErrorMessage=Et,exports.isPersonalPhone=Ir,exports.isSessionForThisTab=mi,exports.isSyllablePattern=Jn,exports.isThisWeekPick=di,exports.isTrainingDataLoaded=Zr,exports.isValidPhone=$r,exports.isValidQuestionWord=Du,exports.itemCorrectness=Tt,exports.jamoToNamesForSpeech=ju,exports.kstStartOfDay=Lr,exports.lazyPage=Si,exports.loadGameLeaderboard=Cr,exports.loadMyGameRanks=cr,exports.loadNoiseSettings=dr,exports.loadTrainingData=vt,exports.logCrossword=or,exports.logTrainingCompletion=nr,exports.logTrainingTime=Zu,exports.matchSyllables=te,exports.matchesChoseongSearch=jo,exports.matchesSyllablePattern=Xn,exports.matchesWordQuery=Ro,exports.mergeQuestionText=St,exports.minimalPairDistractors=qo,exports.normalizeDate=Pr,exports.officialSoundPath=Sr,exports.parseLocalYmd=bt,exports.parseSortValue=Uu,exports.parseSyllable=S,exports.patternToComposition=Go,exports.phonemePartsOf=Au,exports.pickEuRo=dt,exports.pickEulReul=ct,exports.pickEunNeun=Ct,exports.pickIga=lt,exports.pickWaGwa=gt,exports.prefetchChunk=Ei,exports.prewarmImageCache=po,exports.primarySelPart=Ge,exports.readLevel=Eo,exports.recoverFromSkew=Bn,exports.reorderArray=mu,exports.reportAppliedNoiseSettings=hr,exports.resolveAssetUrl=Qt,exports.resolveSoundPath=eo,exports.resumeAudioMeter=fo,exports.routeElementAudio=Mn,exports.sample=Y,exports.saveNoiseSettings=fr,exports.searchAndRankWords=Ho,exports.setAssetBaseUrl=Jt,exports.setCrosswordLogger=tr,exports.setElementVolume=mo,exports.setGameLeaderboardLoader=sr,exports.setGameRanksLoader=ar,exports.setGameScoreSubmitter=ir,exports.setTrainingCompletionLogger=er,exports.setTrainingTimeLogger=Xu,exports.setWordPool=Qu,exports.shuffle=R,exports.skewReloadPending=Ht,exports.sortToValue=Ku,exports.soundOf=Dn,exports.speak=Ut,exports.stopSpeaking=Vt,exports.submitGameScore=lr,exports.syllMatchesComp=J,exports.syllableContrasts=oe,exports.syllableLength=Io,exports.syllablePron=Fe,exports.toBase64UrlSafe=mr,exports.toChoseong=Yn,exports.toItemResults=ur,exports.toKstHm=_r,exports.toKstYmd=ye,exports.toStandardPronunciation=lu,exports.toStorageName=He,exports.toUserErrorMessage=Yu,exports.toWordEntry=yi,exports.validateSyllableSearchInput=Wo,exports.withEuRo=hu,exports.withEulReul=gu,exports.withEunNeun=du,exports.withIga=Cu,exports.withWaGwa=fu,exports.wordContainsChoseong=Oo,exports.wordContainsJongseong=$o,exports.wordContainsJungseong=ko,exports.wordHasNoCoda=Po,exports.wordHasSyllableMatching=vo,exports.wrongItems=rr;
20
+ `),this.name="StorageNotConfiguredError"}};function Zt(e){Xt(e)}function eo(e,n){if(!e)return null;const t=X();return t?.resolvePath?t.resolvePath(e,n):n?`${n}/${e}.mp3`:null}async function Rn(e){if(!e)return!1;const n=X();if(!n)throw new Je("fileExists");if(n.exists)return n.exists(e);try{return await n.resolveUrl(e)!==null}catch{return!1}}async function On(e){if(!e)return null;const n=X();if(!n)throw new Je("getSignedOrPublicUrl");try{return await n.resolveUrl(e)}catch{return null}}async function no(e){const n=X();if(!n)throw new Je("downloadSound");return n.download(e)}function to(){return X()?.noiseBaseUrl??"/sounds/noise"}function oo(){const e=Number(X()?.noiseFileGain);return Number.isFinite(e)&&e>0?e:1}function uo(e){const n=AbortSignal.timeout;if(typeof n=="function")return n.call(AbortSignal,e);const t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal}const Qe="__ihab_core_tts_config__";function ro(e){globalThis[Qe]=e}function io(){return globalThis[Qe]?.urlResolver??null}function ao(){return globalThis[Qe]?.fallbackUrlResolver??null}const so=new Map;function lo(){so.clear()}const kn="__ihab_core_pronunciation_resolver__";function co(e){globalThis[kn]=e}function Co(){return globalThis[kn]??null}let K=null;const ie=new WeakMap,Xe=new WeakMap,Ze=new WeakMap;let $n=!1;const In=e=>Math.max(0,Math.min(1,Number.isFinite(e)?e:0));function go(){if($n||typeof document>"u")return;$n=!0;const e=()=>{try{K&&K.state!=="running"&&K.resume()}catch{}};for(const n of["pointerdown","touchend","keydown"])document.addEventListener(n,e,{capture:!0,passive:!0})}function Pn(){if(K)return K;try{const e=window.AudioContext||window.webkitAudioContext;return e?(K=new e,go(),K):null}catch{return null}}function fo(){try{K?.resume()}catch{}}function en(e,n){const t=ie.get(n);if(t)return t;try{const o=e.createMediaElementSource(n),r=e.createGain(),a=e.createAnalyser();a.fftSize=1024,a.smoothingTimeConstant=.6,r.gain.value=In(Xe.get(n)??n.volume),o.connect(r),r.connect(a),r.connect(e.destination);try{n.volume=1}catch{}const u={gain:r,analyser:a};return ie.set(n,u),u}catch{return null}}function Mn(e){if(!e)return Promise.resolve(null);const n=ie.get(e);if(n)return Promise.resolve(n.analyser);const t=Pn();if(!t)return Promise.resolve(null);if(t.state==="running")return Promise.resolve(en(t,e)?.analyser??null);const o=Ze.get(e);if(o)return o;const r=Promise.resolve().then(()=>t.resume()).then(()=>t.state==="running"?en(t,e)?.analyser??null:null).catch(()=>null).finally(()=>{Ze.delete(e)});return Ze.set(e,r),r}function ho(e){if(!e)return null;const n=ie.get(e);if(n)return n.analyser;const t=Pn();return t?t.state==="running"?en(t,e)?.analyser??null:(Mn(e),null):null}function mo(e,n){const t=In(n);Xe.set(e,t);const o=ie.get(e);if(o){try{e.volume!==1&&(e.volume=1)}catch{}const r=o.gain.gain;try{const a=o.gain.context.currentTime;r.cancelScheduledValues(a),r.setTargetAtTime(t,a,.01)}catch{try{r.value=t}catch{}}return"gain"}try{e.volume=t}catch{}return"element"}function So(e){return Xe.get(e)??e.volume}function Eo(e,n){e.getFloatTimeDomainData(n);let t=0;for(let o=0;o<n.length;o++){const r=n[o];t+=r*r}return Math.sqrt(t/n.length)}const vn="__ihab_core_image_config__";function yo(e){globalThis[vn]=e}function Fn(){return globalThis[vn]??null}const ae="word_image_existence_map_v1";let M=null,se=0,Gn=-1,le=null;const Le=new Map;function ce(){if(M)return M;try{const e=typeof localStorage<"u"?localStorage.getItem(ae):null,n=e?JSON.parse(e):null;M=n&&typeof n=="object"&&!Array.isArray(n)?n:{}}catch{M={}}return M}let nn=null;function Do(){nn||(nn=setTimeout(()=>{nn=null;try{typeof localStorage<"u"&&M&&localStorage.setItem(ae,JSON.stringify(M))}catch{}},200))}function je(e,n){return`${e}_${n??1}`}async function xn(e,n){const t=ce(),o=je(e,n);if(o in t)return t[o];if(Le.has(o))return Le.get(o);const r=Fn();if(!r)return!1;const a=r(e,n);if(!a)return!1;const u=fetch(a,{method:"HEAD",signal:uo(8e3)}).then(i=>i.status>=500?null:i.ok,()=>null).then(i=>(Le.delete(o),i===null?!1:(t[o]=i,se++,Do(),i)));return Le.set(o,u),u}function To(e,n){const t=ce(),o=je(e,n);return o in t?t[o]:void 0}async function po(e,n={}){const{force:t=!1,concurrency:o=16,onProgress:r}=n,a=ce(),u=t?Array.from(new Set(e)):Array.from(new Set(e)).filter(s=>!(je(s)in a));let i=0;if(u.length>0){let s=0;const c=Array.from({length:Math.min(o,u.length)},async()=>{for(;s<u.length;){const C=s++,l=u[C],g=je(l);if(!t&&g in a){i++,r?.(i,u.length);continue}try{await xn(l)}catch{}i++,r?.(i,u.length)}});await Promise.all(c)}try{typeof localStorage<"u"&&M&&localStorage.setItem(ae,JSON.stringify(M))}catch{}return{checked:u.length,cached:Object.keys(a).length,total:e.length}}function Ao(){const e=ce();if(Gn===se)return le?{...le}:null;const n=Object.values(e);return le=n.length===0?null:{total:n.length,exists:n.filter(Boolean).length},Gn=se,le?{...le}:null}function wo(e){const n=ce();Object.assign(n,e),se++;try{typeof localStorage<"u"&&localStorage.setItem(ae,JSON.stringify(n))}catch{}}function bo(){M={},se++;try{typeof localStorage<"u"&&localStorage.removeItem(ae)}catch{}}const _o={\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"},Wn={\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 Bo(e,n){return(Wn[e]?.glide??"")!==(Wn[n]?.glide??"")}function Re(e){return _o[e]??e}const A=["\u3131","\u3132","\u3134","\u3137","\u3138","\u3139","\u3141","\u3142","\u3143","\u3145","\u3146","\u3147","\u3148","\u3149","\u314A","\u314B","\u314C","\u314D","\u314E"],w=["\u314F","\u3150","\u3151","\u3152","\u3153","\u3154","\u3155","\u3156","\u3157","\u3158","\u3159","\u315A","\u315B","\u315C","\u315D","\u315E","\u315F","\u3160","\u3161","\u3162","\u3163"],B=["","\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 S(e){if(!e)return null;const n=e.charCodeAt(0)-44032;return n<0||n>=11172?null:{cho:Math.floor(n/588),jung:Math.floor(n%588/28),jong:n%28}}function No(){const e=new Map;return n=>{let t=e.get(n);return t||(t=[...n].map(o=>S(o)),e.set(n,t)),t}}function x(e,n,t=0){return String.fromCharCode(44032+(e*21+n)*28+t)}function Lo(e,n){if(!e||!n||e===n||e.length!==n.length)return"random";let t=0,o=null;for(let r=0;r<e.length;r++){const a=S(e[r]),u=S(n[r]);if(!a||!u)return"random";if(a.cho===u.cho&&a.jung===u.jung&&a.jong===u.jong)continue;t++;const i=a.cho!==u.cho,s=a.jung!==u.jung,c=a.jong!==u.jong;(i?1:0)+(s?1:0)+(c?1:0)>1?o="multi":i?o="cho":s?o="jung":o="jong"}return t!==1?"random":o==="cho"?"cho":o==="jung"?"jung":o==="jong"?"jong":"random"}function Hn(e){const n=S(e[0]||"");return n?A[n.cho]:""}function Yn(e){return[...e].map(n=>{const t=S(n);return t?A[t.cho]:n}).join("")}function Kn(e){return!!e&&[...e].every(n=>A.includes(n))}function jo(e,n){return n?(e=e.normalize("NFC"),n=n.normalize("NFC"),Kn(n)?Yn(e).includes(n):e.toLowerCase().includes(n.toLowerCase())):!0}function Ro(e,n){return Un(n)(e)}function Un(e){if(!e)return()=>!0;e=e.normalize("NFC");const n=[...e],t=u=>A.includes(u),o=u=>w.includes(u),r=n.map(u=>t(u)?"cho":o(u)?"jung":S(u)?"syl":"other"),a=n.map(u=>S(u));if(r.includes("other")){const u=e.toLowerCase();return i=>i.normalize("NFC").toLowerCase().includes(u)}return u=>{const i=[...u.normalize("NFC")];for(let s=0;s+n.length<=i.length;s++){let c=!0;for(let C=0;C<n.length;C++){const l=i[s+C],g=r[C];if(g==="cho"){if(Hn(l)!==n[C]){c=!1;break}}else if(g==="jung"){const h=S(l);if(!h||w[h.jung]!==n[C]){c=!1;break}}else{const h=a[C];if(h&&h.jong===0){const m=S(l);if(!m||m.cho!==h.cho||m.jung!==h.jung){c=!1;break}}else if(l!==n[C]){c=!1;break}}}if(c)return!0}return!1}}const Vn={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"]},zn=Object.fromEntries(Object.entries(Vn).map(([e,n])=>[n.join(""),B[Number(e)]]));function Oo(e,n){if(!e||!n)return!1;for(const t of e){const o=S(t);if(o&&A[o.cho]===n)return!0}return!1}function ko(e,n){if(!e||!n)return!1;for(const t of e){const o=S(t);if(o&&w[o.jung]===n)return!0}return!1}function qn(e,n,t){const o=B[e];return o===n?!0:t==="phoneme"&&Re(o)===Re(n)}function $o(e,n,t="glyph"){if(!e||!n)return!1;for(const o of e){const r=S(o);if(!(!r||r.jong<=0)&&qn(r.jong,n,t))return!0}return!1}function Io(e){if(!e)return 0;let n=0;for(const t of e)S(t)&&n++;return n}function Po(e){if(!e)return!1;let n=!1;for(const t of e){const o=S(t);if(o&&(n=!0,o.jong>0))return!1}return n}function Mo(e,n,t){return e.jong<=0?!1:n.some(o=>qn(e.jong,o,t))}function vo(e,n,t,o="glyph"){if(!e)return!1;const r=[...e],a=u=>{const i=S(r[u]);if(!i||n.cho&&!n.cho.includes(A[i.cho])||n.jung&&!n.jung.includes(w[i.jung]))return!1;if(n.jongNone){if(i.jong>0)return!1}else if(n.jong&&!Mo(i,n.jong,o))return!1;return!0};if(t==="head")return a(0);if(t==="tail")return a(r.length-1);if(t==="mid"){for(let u=1;u<r.length-1;u++)if(a(u))return!0;return!1}for(let u=0;u<r.length;u++)if(a(u))return!0;return!1}function Jn(e){return e.includes(",")||e.includes("_")}function Qn(e){if(e==="")return[{kind:"any"}];if(e.includes("_")){const n=[...e];if(n.length>4)return[{kind:"invalid"}];const t=n[0]??"_",o=n[1]??"_";let r=n.slice(2).join("");if(r.length===2){const a=zn[r];if(!a)return[{kind:"invalid"}];r=a}return[{kind:"template",cho:t,jung:o,jong:r||"_"}]}return[...e].map(n=>S(n)?{kind:"syllable",ch:n}:A.includes(n)?{kind:"cho",jamo:n}:w.includes(n)?{kind:"jung",jamo:n}:{kind:"invalid"})}function Fo(e,n){switch(n.kind){case"any":return!0;case"syllable":{const t=S(n.ch);if(!t)return e===n.ch;if(t.jong===0){const o=S(e);return!!o&&o.cho===t.cho&&o.jung===t.jung}return e===n.ch}case"cho":{const t=S(e);return!!t&&A[t.cho]===n.jamo}case"jung":{const t=S(e);return!!t&&w[t.jung]===n.jamo}case"template":{const t=S(e);return!(!t||n.cho!=="_"&&A[t.cho]!==n.cho||n.jung!=="_"&&w[t.jung]!==n.jung||n.jong!=="_"&&B[t.jong]!==n.jong)}case"invalid":return!1}}function Xn(e,n){e=e.normalize("NFC"),n=n.normalize("NFC");const t=n.split(",").flatMap(r=>Qn(r.trim()));if(t.length===0)return!0;const o=[...e];if(o.length<t.length)return!1;for(let r=0;r+t.length<=o.length;r++)if(t.every((a,u)=>Fo(o[r+u],a)))return!0;return!1}function Go(e){const n=e.split(",").flatMap(a=>Qn(a.trim())),t=new Set,o=new Set,r=new Set;for(const a of n)switch(a.kind){case"cho":t.add(a.jamo);break;case"jung":o.add(a.jamo);break;case"template":a.cho!=="_"&&t.add(a.cho),a.jung!=="_"&&o.add(a.jung),a.jong!=="_"&&r.add(a.jong);break;case"syllable":{const u=S(a.ch);u&&(t.add(A[u.cho]),o.add(w[u.jung]),u.jong!==0&&r.add(B[u.jong]));break}}return t.size===0&&o.size===0&&r.size===0?null:{cho:t.size?[...t]:null,jung:o.size?[...o]:null,jong:r.size?[...r]:null}}function xo(e){return!!S(e)||A.includes(e)||w.includes(e)}function Wo(e){const n=e.normalize("NFC").trim();if(!n)return{ok:!0};for(const t of n.split(",")){const o=t.trim();if(o!==""){if(o.includes("_")){const r=[...o];if(r.length>4)return{ok:!1};const a=r[0],u=r[1],i=r.slice(2).join(""),s=a===void 0||a==="_"||A.includes(a),c=u===void 0||u==="_"||w.includes(u),C=i===""||i==="_"||B.filter(Boolean).includes(i)||!!zn[i];if(s&&c&&C)continue;return{ok:!1}}if(![...o].every(xo))return{ok:!1}}}return{ok:!0}}A.length,w.length,B.length;function Ho(e,n){const t=n.normalize("NFC").trim();if(!t||!/[^\s,_]/.test(t))return e;if(Jn(t))return e.filter(s=>Xn(s.word,t));const o=Un(t),r=[...t].length,a=s=>!!s&&o(s.normalize("NFC").slice(0,r)),u=[],i=[];for(const s of e)(o(s.word)||o(s.pronunciation??""))&&(a(s.word)||a(s.pronunciation??"")?u:i).push(s);return u.concat(i)}const tn="word_pair_index_v2",on="word_pair_index_sig_v2";let v=null,Ce=null;function Zn(){try{if(typeof localStorage>"u")return null;const e=localStorage.getItem(tn),n=localStorage.getItem(on);return!e||!n?null:{index:JSON.parse(e),sig:n}}catch{return null}}function Yo(e,n){try{if(typeof localStorage>"u")return;localStorage.setItem(tn,JSON.stringify(e)),localStorage.setItem(on,n)}catch{}}function Ko(e){const n=e.map(o=>`${o.word}|${o.pron??""}`).sort();let t=0;for(const o of n)for(let r=0;r<o.length;r++)t=(t<<5)-t+o.charCodeAt(r)|0;return`${n.length}-${t}`}async function Uo(e,n){const t=new Set,o=[];for(const c of e){if(!c.word||t.has(c.word))continue;const C=c.pron||c.word,l=Array.from(C).map(S);l.some(g=>g===null)||l.length===Array.from(c.word).length&&(t.add(c.word),o.push({word:c.word,syls:l}))}const r={},a=o.length,u=new Map;for(const c of o){const C=c.syls.length;u.has(C)||u.set(C,[]),u.get(C).push(c)}let i=0;const s=["cho","jung","jong"];for(const c of u.values()){const C=c[0].syls.length;for(let l=0;l<C;l++)for(const g of s){const h=new Map;for(const m of c){let E="";for(let f=0;f<C;f++){f>0&&(E+="~");const d=m.syls[f];f===l?g==="cho"?E+=`*:${d.jung}:${d.jong}`:g==="jung"?E+=`${d.cho}:*:${d.jong}`:E+=`${d.cho}:${d.jung}:*`:E+=`${d.cho}:${d.jung}:${d.jong}`}let y=h.get(E);y||(y=[],h.set(E,y)),y.push(m)}for(const m of h.values())if(!(m.length<2))for(let E=0;E<m.length;E++){const y=m[E];for(let f=E+1;f<m.length;f++){const d=m[f];y.syls[l][g]!==d.syls[l][g]&&(r[y.word]||(r[y.word]={cho:[],jung:[],jong:[]}),r[d.word]||(r[d.word]={cho:[],jung:[],jong:[]}),r[y.word][g].push(d.word),r[d.word][g].push(y.word))}}}i+=c.length,n?.(i,a),await new Promise(l=>setTimeout(l,0))}return a>0&&n?.(a,a),r}let un=0;async function Vo(e,n={}){const t=Ko(e);if(!n.force){if(v&&Ce===t)return v;const a=Zn();if(a&&a.sig===t)return v=a.index,Ce=t,v}const o=++un,r=await Uo(e,n.onProgress);return o===un&&(v=r,Ce=t,Yo(r,t)),r}function et(){if(v)return v;const e=Zn();return e?(v=e.index,Ce=e.sig,v):null}function zo(){un+=1,v=null,Ce=null;try{typeof localStorage<"u"&&(localStorage.removeItem(tn),localStorage.removeItem(on))}catch{}}const rn={cho:A,jung:w,jong:B},k=e=>Array.isArray(e)?e.length>0:!!e;function an(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++){const o=e[t],r=n[t];if(!(!o||!r)&&(o.cho!==r.cho&&A[o.cho]==="\u3147"!=(A[r.cho]==="\u3147")||o.jung!==r.jung&&Bo(w[o.jung],w[r.jung])||o.jong!==r.jong&&o.jong===0!=(r.jong===0)))return!0}return!1}function nt(e,n,t){const o=t.pronOf(e),r=t.decompOf,a=t.sameStructureOnly&&r?r(o):null,u=[];for(const i of n)i!==e&&(t.okSet&&!t.okSet.has(i)||t.pronOf(i)!==o&&(a&&r&&an(a,r(t.pronOf(i)))||u.push(i)));return u}function qo(e,n,t){const o=n?.[e];if(!o)return[];const r=t.kind?o[t.kind]??[]:[...o.cho??[],...o.jung??[],...o.jong??[]];return nt(e,r,t)}function Jo(e,n,t,o,r,a,u){const i=["cho","jung","jong"].filter(g=>k(e[g])),s={};for(const g of i){const h=e[g];s[g]=new Set(Array.isArray(h)?h:[h])}const c=r==="pron",C=new Map;for(const g of n){const h=t(a(g));if(h.some(f=>!f))continue;let m=h;if(!c&&(m=t(g),m.length!==h.length||m.some(f=>!f)))continue;const E=h.length,y=C.get(E);y?y.push({w:g,dPron:h,dPos:m}):C.set(E,[{w:g,dPron:h,dPos:m}])}const l=new Map;for(const[g,h]of C){const m=new Map,E=(y,f)=>{const d=y.dPos[f];return d!=null&&i.every(D=>s[D].has(rn[D][d[D]]))};for(const y of h){let f;if(u==="head")f=E(y,0)?0:-1;else if(u==="tail")f=E(y,g-1)?g-1:-1;else if(u==="mid"){f=-1;for(let D=1;D<g-1;D++)if(E(y,D)){f=D;break}}else f=y.dPos.findIndex(D=>D!=null&&i.every(p=>s[p].has(rn[p][D[p]])));if(f<0)continue;const d=m.get(f);d?d.push(y):m.set(f,[y])}for(const[y,f]of m){const d=i.includes("cho"),D=i.includes("jung"),p=i.includes("jong"),P=b=>{let j="";for(let O=0;O<g;O++){const T=b[O];O===y?j+=(d?"*":T.cho)+"."+(D?"*":T.jung)+"."+(p?"*":T.jong)+".":j+=T.cho+"."+T.jung+"."+T.jong+"."}return j},L=new Map;for(const b of h){const j=P(b.dPron),O=L.get(j);O?O.push(b):L.set(j,[b])}for(const b of f){const j=L.get(P(b.dPron))??[],O=[];for(const T of j){if(T.w===b.w)continue;let $=!0;for(const G of i){const Q=b.dPron[y][G],z=T.dPron[y][G];if(z===Q){$=!1;break}if(c&&s[G].has(rn[G][z])){$=!1;break}}$&&(o&&an(b.dPron,T.dPron)||O.push(T.w))}l.set(b.w,O)}}}return l}const Oe=0,tt=1,q=2,sn=3,Qo=4,ke=5,ln=6,$e=7,Xo=8,cn=9,Z=10,Zo=11,ge=12,eu=13,de=14,Ie=15,Pe=16,fe=17,nu=18,I=0,W=1,tu=3,U=4,Cn=5,he=6,F=7,_=8,ot=9,ut=10,Me=11,rt=12,gn=13,ee=15,ve=16,H=17,it=18,dn=21,fn=27,ou=20,uu={1:Oe,2:tt,4:q,7:sn,8:ke,16:ln,17:$e,19:cn,20:Z,22:ge,23:de,24:Ie,25:Pe,26:fe},ru={[tu]:[W,Z],[Cn]:[U,ge],[ot]:[_,Oe],[ut]:[_,ln],[Me]:[_,$e],[rt]:[_,Z],[gn]:[_,Pe],14:[_,fe],[it]:[H,Z]},iu={[he]:q,[ee]:ke},hn={2:W,24:W,3:W,9:W,5:U,6:U,19:F,20:F,22:F,23:F,25:F,27:F,11:_,12:_,13:_,15:_,10:ve,14:H,18:H,26:H},at={[Oe]:Ie,[sn]:Pe,[$e]:fe,[ge]:de},st={[Oe]:tt,[sn]:Qo,[$e]:Xo,[cn]:Z,[ge]:eu},au=new Set([Cn,ut,Me,rt,gn,ee,it]),su=new Set(["\uBC1F"]);function lu(e){const n=(e??"").trim();if(!n)return"";const t=[...n],o=t.map(S);if(o.some(a=>a===null))return n;const r=o;for(let a=0;a<r.length;a++){const u=r[a],i=r[a+1],s=u.jong;if(!i){u.jong=hn[u.jong]??u.jong;break}if(u.jong===I)continue;if(i.cho===Zo){if(i.jung===ou){if(u.jong===F){u.jong=I,i.cho=ge;continue}if(u.jong===25){u.jong=I,i.cho=de;continue}if(u.jong===gn){u.jong=_,i.cho=de;continue}}if(u.jong===fn){u.jong=I;continue}const C=iu[u.jong];if(C!==void 0){u.jong=I,i.cho=C;continue}const l=ru[u.jong];if(l){u.jong=l[0],i.cho=l[1];continue}const g=uu[u.jong];g!==void 0&&(u.jong=I,i.cho=g);continue}if((u.jong===fn||u.jong===he||u.jong===ee)&&at[i.cho]!==void 0){i.cho=at[i.cho],u.jong=u.jong===he?U:u.jong===ee?_:I;continue}if((u.jong===fn||u.jong===he||u.jong===ee)&&i.cho===cn){i.cho=Z,u.jong=u.jong===he?U:u.jong===ee?_:I;continue}if(i.cho===nu){if(u.jong===Cn){u.jong=U,i.cho=de;continue}if(u.jong===ot){u.jong=_,i.cho=Ie;continue}if(u.jong===Me){u.jong=_,i.cho=fe;continue}const C=hn[u.jong]??u.jong;if(C===W){u.jong=I,i.cho=Ie;continue}if(C===F){u.jong=I,i.cho=Pe;continue}if(C===H){u.jong=I,i.cho=fe;continue}}let c=hn[u.jong]??u.jong;s===Me&&su.has(t[a])&&(c=H),u.jong=c,st[i.cho]!==void 0&&(c===W||c===F||c===H||au.has(s))&&(i.cho=st[i.cho]),(i.cho===q||i.cho===ln)&&(u.jong===W?u.jong=dn:u.jong===F?u.jong=U:u.jong===H&&(u.jong=ve)),i.cho===ke?u.jong===U?u.jong=_:u.jong===ve||u.jong===dn?i.cho=q:u.jong===W?(u.jong=dn,i.cho=q):u.jong===H&&(u.jong=ve,i.cho=q):u.jong===_&&i.cho===q&&(i.cho=ke)}return r.map(a=>x(a.cho,a.jung,a.jong)).join("")}const ne=/[ㄱ-ㅎ]/,cu=/[ㅏ-ㅣ]/;function me(e){e=e.normalize("NFC");for(let n=e.length-1;n>=0;n--){const t=e[n],o=t.charCodeAt(0);if(o>=44032&&o<=55203||ne.test(t)||cu.test(t))return t}return null}function lt(e){const n=me(e);if(!n)return"\uAC00";const t=n.charCodeAt(0);return t>=44032&&t<=55203?(t-44032)%28!==0?"\uC774":"\uAC00":ne.test(n)?"\uC774":"\uAC00"}function Cu(e){return`${e}${lt(e)}`}function ct(e){const n=me(e);if(!n)return"\uB97C";const t=n.charCodeAt(0);return t>=44032&&t<=55203?(t-44032)%28!==0?"\uC744":"\uB97C":ne.test(n)?"\uC744":"\uB97C"}function gu(e){return`${e}${ct(e)}`}function Ct(e){const n=me(e);if(!n)return"\uB294";const t=n.charCodeAt(0);return t>=44032&&t<=55203?(t-44032)%28!==0?"\uC740":"\uB294":ne.test(n)?"\uC740":"\uB294"}function du(e){return`${e}${Ct(e)}`}function gt(e){const n=me(e);if(!n)return"\uC640";const t=n.charCodeAt(0);return t>=44032&&t<=55203?(t-44032)%28!==0?"\uACFC":"\uC640":ne.test(n)?"\uACFC":"\uC640"}function fu(e){return`${e}${gt(e)}`}function dt(e){const n=me(e);if(!n)return"\uB85C";const t=n.charCodeAt(0);if(t>=44032&&t<=55203){const o=(t-44032)%28;return o===0||o===8?"\uB85C":"\uC73C\uB85C"}return n==="\u3139"?"\uB85C":ne.test(n)?"\uC73C\uB85C":"\uB85C"}function hu(e){return`${e}${dt(e)}`}function mu(e,n,t){const o=e.slice(),[r]=o.splice(n,1);return o.splice(t,0,r),o}function R(e,n=Math.random){const t=e.slice();for(let o=t.length-1;o>0;o--){const r=Math.floor(n()*(o+1));[t[o],t[r]]=[t[r],t[o]]}return t}function Y(e,n,t=Math.random){return!Array.isArray(e)||e.length===0||n<=0?[]:n>=e.length?R(e,t):R(e,t).slice(0,n)}const ft={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"}};function Su(e){const n=e?ft[e]?.group:void 0;return n==="synthesis"||n==="deletion"||n==="substitution"?n:null}const mn=A.indexOf("\u3147"),ht={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&&e.cho!==mn},MERGE_3_PHONEMES:{syllables:1,syllable:e=>e.jong>0&&!Vn[e.jong]&&e.cho!==mn}},Eu=new Set([]);function yu(e){return e in ht}function Du(e,n){const t=ht[e];if(!t)return!0;const o=[...n];if(o.length!==t.syllables)return!1;const r=S(o[0]);return!!r&&t.syllable(r)}function Tu(e){return Eu.has(e)}function pu(e){const n=e.charCodeAt((e.length||1)-1)||0;return n<44032||n>55203||(n-44032)%28===0?"\uC640":"\uACFC"}function Se(e){const n=e.charCodeAt((e.length||1)-1)||0;return n<44032||n>55203||(n-44032)%28===0?"\uB97C":"\uC744"}function Sn(e){const n=e.charCodeAt((e.length||1)-1)||0;if(n<44032||n>55203)return"\uB85C";const t=(n-44032)%28;return t===0||t===8?"\uB85C":"\uC73C\uB85C"}function mt(e){const n=e.charAt((e.length||1)-1),t=n.charCodeAt(0)||0;return t>=44032&&t<=55203?(t-44032)%28===0?"\uAC00":"\uC774":/[ㄱ-ㅎ]/.test(n)?"\uC774":"\uAC00"}const En={\u3131:"\uAE30\uC5ED",\u3132:"\uC30D\uAE30\uC5ED",\u3134:"\uB2C8\uC740",\u3137:"\uB514\uADFF",\u3138:"\uC30D\uB514\uADFF",\u3139:"\uB9AC\uC744",\u3141:"\uBBF8\uC74C",\u3142:"\uBE44\uC74D",\u3143:"\uC30D\uBE44\uC74D",\u3145:"\uC2DC\uC637",\u3146:"\uC30D\uC2DC\uC637",\u3147:"\uC774\uC751",\u3148:"\uC9C0\uC752",\u3149:"\uC30D\uC9C0\uC752",\u314A:"\uCE58\uC753",\u314B:"\uD0A4\uC754",\u314C:"\uD2F0\uC755",\u314D:"\uD53C\uC756",\u314E:"\uD788\uC757",\u3133:"\uAE30\uC5ED\uC2DC\uC637",\u3135:"\uB2C8\uC740\uC9C0\uC752",\u3136:"\uB2C8\uC740\uD788\uC757",\u313A:"\uB9AC\uC744\uAE30\uC5ED",\u313B:"\uB9AC\uC744\uBBF8\uC74C",\u313C:"\uB9AC\uC744\uBE44\uC74D",\u313D:"\uB9AC\uC744\uC2DC\uC637",\u313E:"\uB9AC\uC744\uD2F0\uC755",\u313F:"\uB9AC\uC744\uD53C\uC756",\u3140:"\uB9AC\uC744\uD788\uC757",\u3144:"\uBE44\uC74D\uC2DC\uC637",\u314F:"\uC544",\u3150:"\uC560",\u3151:"\uC57C",\u3152:"\uC598",\u3153:"\uC5B4",\u3154:"\uC5D0",\u3155:"\uC5EC",\u3156:"\uC608",\u3157:"\uC624",\u3158:"\uC640",\u3159:"\uC65C",\u315A:"\uC678",\u315B:"\uC694",\u315C:"\uC6B0",\u315D:"\uC6CC",\u315E:"\uC6E8",\u315F:"\uC704",\u3160:"\uC720",\u3161:"\uC73C",\u3162:"\uC758",\u3163:"\uC774"};function Au(e){if([...e].length!==1)return[e];const n=S(e);if(!n)return[e];const t=[A[n.cho],w[n.jung]];return n.jong!==0&&t.push(B[n.jong]),t}function St(e,n=!1){const t=e.filter(Boolean);if(t.length<2)return"";const o=i=>En[i]??i,r=t.slice(0,-1).map(i=>`"${i}"${pu(o(i))}`).join(" "),a=t[t.length-1],u=`"${a}"${Se(o(a))}`;return`${r} ${u} \uD569\uCE58\uBA74 \uC5B4\uB5A4 ${n?"\uC18C\uB9AC":"\uB2E8\uC5B4"}\uAC00 \uB418\uB098\uC694?`}function wu(e,n){return St(n,e==="MERGE_2_PHONEMES"||e==="MERGE_3_PHONEMES")}const yn=e=>En[e]??e,bu={cho:"\uCD08\uC131",jung:"\uBAA8\uC74C",jong:"\uBC1B\uCE68"};function _u(e,n){const t=(s,c)=>{const C=[...s].length===1?S(s):null,l=[...c].length===1?S(c):null;if(!C||!l)return null;const g=["cho","jung","jong"].filter(h=>C[h]!==l[h]);return g.length===1?{part:g[0],sx:C,sy:l}:null},o=t(e,n)??t(Fe(e),Fe(n));if(!o)return null;const r=o.part==="cho"?A:o.part==="jung"?w:B,a=r[o.sx[o.part]],u=r[o.sy[o.part]],i=o.part==="jong"&&!a?"add":o.part==="jong"&&!u?"remove":"swap";return{part:o.part,from:a,to:u,kind:i}}function Bu(e,n){const t=String(n?.word??n?.original??""),o=String(n?.changedFrom??""),r=String(n?.changedTo??"");if(e==="CHANGE_1_PHONEME_IN_1SYLL"||e==="CHANGE_1_PHONEME_IN_2SYLL"){const a=e==="CHANGE_1_PHONEME_IN_1SYLL",u=a?o||t:o,i=_u(u,r);if(i){const s=a?`"${t}"`:`"${t}"\uC758 "${u}"`,c=i.kind==="add"?"\uC5D0":"\uC5D0\uC11C",C=`"${i.from}"${Se(yn(i.from))}`,l=`"${i.to}"${Sn(yn(i.to))}`;return i.kind==="add"?`${s}${c} \uBC1B\uCE68 "${i.to}"${Se(yn(i.to))} \uB354\uD558\uBA74 \uBB34\uC5C7\uC774 \uB418\uB098\uC694?`:i.kind==="remove"?`${s}${c} \uBC1B\uCE68 ${C} \uBE7C\uBA74 \uBB34\uC5C7\uC774 \uB418\uB098\uC694?`:`${s}${c} ${bu[i.part]} ${C} ${l} \uBC14\uAFB8\uBA74 \uBB34\uC5C7\uC774 \uB418\uB098\uC694?`}}return e==="CHANGE_1_PHONEME_IN_1SYLL"?`"${t}"${Se(t)} "${r}"${Sn(r)} \uBC14\uAFB8\uBA74 \uBB34\uC5C7\uC774 \uB418\uB098\uC694?`:`"${t}"\uC5D0\uC11C "${o}"${Se(o)} "${r}"${Sn(r)} \uBC14\uAFB8\uBA74 \uBB34\uC5C7\uC774 \uB418\uB098\uC694?`}function Nu(e,n){const t=String(n?.word??n?.original??n?.base??""),o=String(n?.dropped??"");if(e==="DROP_FINAL_CONSONANT_FROM_1SYLL")return`"${t}"\uC5D0\uC11C \uBC1B\uCE68\uC774 \uC5C6\uC5B4\uC9C0\uBA74 \uC5B4\uB5A4 \uB9D0\uC774 \uB418\uB098\uC694?`;if(e==="REMOVE_CONSONANT_AND_IDENTIFY_PHONEME"){const r=String(n?.missingConsonant??"");return`"${t}"\uC5D0\uC11C "${r}"${mt(r)} \uC5C6\uC5B4\uC9C0\uBA74 \uC5B4\uB5A4 \uC18C\uB9AC\uAC00 \uB418\uB098\uC694?`}return`"${t}"\uC5D0\uC11C "${o}"${mt(o)} \uC5C6\uC5B4\uC9C0\uBA74 \uC5B4\uB5A4 \uB9D0\uC774 \uB418\uB098\uC694?`}function Lu(e,n,t){switch(Su(e)){case"synthesis":return wu(e,t);case"substitution":return Bu(e,n);case"deletion":return Nu(e,n);default:return""}}function ju(e){return e.replace(/"([ㄱ-ㅣ])"(으로|와|과|을|를|이|가|은|는|로)?/g,(n,t,o)=>{const r=En[t];if(!r)return n;if(!o)return`"${r}"`;const a=(r.charCodeAt(r.length-1)-44032)%28,u=a!==0;let i=o;return o==="\uC640"||o==="\uACFC"?i=u?"\uACFC":"\uC640":o==="\uC744"||o==="\uB97C"?i=u?"\uC744":"\uB97C":o==="\uC774"||o==="\uAC00"?i=u?"\uC774":"\uAC00":o==="\uC740"||o==="\uB294"?i=u?"\uC740":"\uB294":(o==="\uC73C\uB85C"||o==="\uB85C")&&(i=a===0||a===8?"\uB85C":"\uC73C\uB85C"),`"${r}"${i}`})}const Ru=e=>e==null?[]:Array.isArray(e)?e:[e];function Fe(e){if([...e].length!==1)return"";const n=S(e);if(!n)return"";const t=Re(B[n.jong]),o=t===""?0:B.indexOf(t);return x(n.cho,n.jung,o<0?0:o)}function Dn(e,n){return n.get(e)||Fe(e)||e}function Ge(e){return e?k(e.cho)?"cho":k(e.jung)?"jung":k(e.jong)?"jong":null:null}function J(e,n){const t=(r,a)=>!k(r)||Ru(r).includes(a),o=n.jongNone?e.jong===0:t(n.jong,B[e.jong]);return t(n.cho,A[e.cho])&&t(n.jung,w[e.jung])&&o}function te(e,n,t){const o=[...e];if(t!=="pron")return o.map(a=>S(a));const r=[...n.get(e)||e];return r.length!==o.length?o.map(a=>S(a)):r.map(a=>S(a))}function oe(e,n,t,o,r){const a=n==="cho"?A:n==="jung"?w:B,u=e[n],i=[],s=l=>n==="jung"?ku(Dn(l,r)):Dn(l,r),c=new Map([[s(t),-1]]),C=R(a.map((l,g)=>g).filter(l=>l!==u&&(n!=="cho"||a[l]!=="\u3147")&&(n!=="jong"||l!==0)));for(const l of C){if(i.length>=o)break;const g=n==="cho"?x(l,e.jung,e.jong):n==="jung"?x(e.cho,l,e.jong):x(e.cho,e.jung,l),h=s(g),m=c.get(h);if(m!==void 0){n==="jung"&&m>=0&&r.has(g)&&!r.has(i[m])&&(i[m]=g);continue}c.set(h,i.length),i.push(g)}return i}const Ou={\u3154:"\u3150",\u3156:"\u3152",\u315A:"\u3159",\u315E:"\u3159"};function ku(e){if([...e].length!==1)return e;const n=S(e);if(!n)return e;const t=Ou[w[n.jung]];return t?x(n.cho,w.indexOf(t),n.jong):e}function $u(e,n,t,o,r,a=null){const u=[...e];if(u.length!==2)return null;const i=u.map(l=>S(l));if(i.some(l=>!l))return null;const s=te(e,t,o);if(s.some(l=>!l))return null;const c=Ge(n);let C=c&&n?s.map((l,g)=>J(l,n)?g:-1).filter(l=>l>=0):[0,1];if(a!=null&&(C=C.filter(l=>l!==a)),!C.length)return null;for(const l of R(C)){const g=u[l];if(!r.has(g))continue;const h=oe(i[l],c??"cho",g,40,t),m=[];for(const E of h)if(E!==g&&r.has(E)&&!m.includes(E)&&m.push(E),m.length>=2)break;if(!(m.length<2))return{question:e,distractors:[g,...m]}}return null}function Iu(e,n,t,o,r,a=null){const u=[...e];if(u.length!==3)return null;const i=u.map(l=>S(l));if(i.some(l=>!l))return null;const s=te(e,t,o);if(s.some(l=>!l))return null;const c=Ge(n),C=c&&n?s.map((l,g)=>J(l,n)?g:-1).filter(l=>l>=0):[0,1,2];if(!C.length)return null;for(const l of R(C))for(const g of R([0,1,2].filter(h=>h!==l&&(a==null||h===a)))){const h=[0,1,2].filter(d=>d!==g),m=h.map(d=>u[d]).join("");if(!r.has(m))continue;const E=h.indexOf(l),y=oe(i[l],c??"cho",u[l],40,t),f=[];for(const d of y){const D=h.map(P=>u[P]);D[E]=d;const p=D.join("");if(p!==m&&r.has(p)&&!f.includes(p)&&f.push(p),f.length>=2)break}if(!(f.length<2))return{question:e,distractors:[m,...f]}}return null}function Pu(e,n,t,o,r,a=null){const u=[...e],i=u.length;if(i<2)return null;const s=[];for(let C=1;C<=i-1;C++)s.push({remain:u.slice(0,C).join(""),dropped:u.slice(C).join(""),droppedEnd:1}),s.push({remain:u.slice(i-C).join(""),dropped:u.slice(0,i-C).join(""),droppedEnd:0});const c=Ge(n);for(const{remain:C,dropped:l,droppedEnd:g}of R(s)){if(a!=null&&g!==a||[...C].length===1&&[...l].length===1||C===e||!r.has(C)||!r.has(l))continue;const h=[...C],m=h.map(f=>S(f));if(m.some(f=>!f))continue;const E=te(C,t,o);if(E.some(f=>!f))continue;const y=c&&n?E.map((f,d)=>J(f,n)?d:-1).filter(f=>f>=0):h.map((f,d)=>d);if(y.length)for(const f of R(y)){const d=oe(m[f],c??"cho",h[f],40,t),D=[];for(const p of d){const P=[...h];P[f]=p;const L=P.join("");if(L!==C&&r.has(L)&&!D.includes(L)&&D.push(L),D.length>=2)break}if(D.length>=2)return{question:e,distractors:[C,...D],dropped:l}}}return null}function Mu(e,n,t,o,r,a=null){if([...e].length!==1)return null;const u=S(t.get(e)||e);if(!u||u.jong===0)return null;const i=x(u.cho,u.jung,0),s=oe({cho:u.cho,jung:u.jung,jong:0},"cho",i,2,t);return s.length<2?null:{question:e,distractors:[i,...s]}}const Tn=A.indexOf("\u3147");function vu(e,n,t,o,r,a=null){if([...e].length!==1)return null;const u=S(t.get(e)||e);if(!u||u.jong!==0||u.cho===Tn)return null;const i=x(Tn,u.jung,0),s=oe({cho:Tn,jung:u.jung,jong:0},"jung",i,2,t);return s.length<2?null:{question:e,distractors:[i,...s]}}function Fu(e){const n=new Map;for(const t of e){const o=[...t],r=o.length;if(!(r<2||r>3))for(let a=0;a<r;a++){let u=r+"|"+a+"|";for(let s=0;s<r;s++)u+=s===a?"*":o[s];const i=n.get(u);i?i.push(t):n.set(u,[t])}}return n}function Gu(e,n,t,o,r,a=null,u=null,i=2){const s=[...e],c=s.length;if(c<2||c>3)return null;const C=s.map(d=>S(d));if(C.some(d=>!d))return null;const l=te(e,t,o);if(l.some(d=>!d))return null;const g=d=>t.get(d)??d,h=g(e),m=!!n&&(k(n.cho)||k(n.jung)||k(n.jong)),E=!!u&&(k(u.cho)||k(u.jung)||k(u.jong)),y=d=>{let D=c+"|"+d+"|";for(let p=0;p<c;p++)D+=p===d?"*":s[p];return D};let f;if(a!=null){if(a>=c||m&&!J(l[a],n))return null;f=[a]}else m?f=l.map((d,D)=>J(d,n)?D:-1).filter(d=>d>=0):f=Array.from({length:c},(d,D)=>D);for(const d of R(f)){const D=r.get(y(d))??[],p=[],P=[];for(const T of D){if(T===e)continue;const $=[...T].map(Be=>S(Be)),G=C[d],Q=$[d];if(!G||!Q)continue;let z=0;if(G.cho!==Q.cho&&z++,G.jung!==Q.jung&&z++,G.jong!==Q.jong&&z++,!(z<i||g(T)===h))if(E){const Be=te(T,t,o)[d];Be&&J(Be,u)?p.push(T):P.push(T)}else p.push(T)}if(!p.length)continue;const L=R(p)[0],b=[],j=new Set([h,g(L)]),O=E?P:p.filter(T=>T!==L);for(const T of R(O)){const $=g(T);if(!j.has($)&&(j.add($),b.push(T),b.length>=2))break}if(!E&&b.length<2)for(const T of R(D)){if(T===e||T===L)continue;const $=g(T);if(!j.has($)&&(j.add($),b.push(T),b.length>=2))break}if(!(b.length<2))return{question:e,distractors:[L,...b]}}return null}const xu=()=>{const e="\uC54C \uC218 \uC5C6\uB294 \uC624\uB958",n=typeof Ne?.t=="function"?Ne.t("common.unknownError",{defaultValue:e}):void 0;return typeof n=="string"&&n?n:e};function Wu(e,n){if(n===void 0&&(n=xu()),e instanceof Error)return e.message||n;if(typeof e=="string")return e||n;if(e&&typeof e=="object"){const t=e;for(const o of[t.message,t.error_description,t.error])if(typeof o=="string"&&o)return o}return n}const pn="\uB124\uD2B8\uC6CC\uD06C \uC5F0\uACB0\uC774 \uBD88\uC548\uC815\uD569\uB2C8\uB2E4. \uC5F0\uACB0 \uC0C1\uD0DC\uB97C \uD655\uC778\uD55C \uB4A4 \uB2E4\uC2DC \uC2DC\uB3C4\uD574 \uC8FC\uC138\uC694.",Hu=()=>{const e=typeof Ne?.t=="function"?Ne.t("common.networkError",{defaultValue:pn}):void 0;return typeof e=="string"&&e?e:pn};function Et(e){return e?/failed to fetch|load failed|networkerror|network request failed|fetcherror/i.test(e):!1}function Yu(e){return Et(e)?Hu():e}function Ku(e,n){return e==="id"?void 0:`${e}|${n?"asc":"desc"}`}function Uu(e){const[n,t]=e.split("|");return{key:n,asc:t==="asc"}}function Vu(e){let n=e==null?"":String(e);return!(typeof e=="number"&&Number.isFinite(e))&&/^[=+\-@\t\r]/.test(n)&&(n="'"+n),/[",\n\r]/.test(n)?`"${n.replaceAll('"','""')}"`:n}const zu=1e3;function qu(e,n){const t=new Blob([n.startsWith("\uFEFF")?n:"\uFEFF"+n],{type:"text/csv;charset=utf-8"}),o=URL.createObjectURL(t),r=document.createElement("a");r.href=o,r.download=e,r.click(),setTimeout(()=>URL.revokeObjectURL(o),zu)}const yt="__ihab_core_word_pool__";function Ju(){typeof window<"u"&&window.dispatchEvent(new CustomEvent("wordpool:update"))}function Qu(e,n){const t=new Map;for(const r of e)t.set(r.word,r);const o={entries:e,pairIndex:n??null,byWord:t};globalThis[yt]=o,Ju()}function Dt(){return globalThis[yt]??null}const ue=globalThis;function An(e,n){const t=o=>{};try{const o=n();o&&typeof o.catch=="function"&&o.catch(t)}catch(o){t(o)}}function Xu(e){ue.__ihabTrainingTimeLogger=e}function Zu(e){An("time",()=>ue.__ihabTrainingTimeLogger?.(e))}function er(e){ue.__ihabTrainingCompletionLogger=e}function nr(e){An("completion",()=>ue.__ihabTrainingCompletionLogger?.(e))}function tr(e){ue.__ihabCrosswordLogger=e}function or(e){An("crossword",()=>ue.__ihabCrosswordLogger?.(e))}function xe(e){if(typeof e=="string"){const n=e.trim();return n?Number.isNaN(new Date(n).getTime())?null:n:null}if(e instanceof Date)return Number.isNaN(e.getTime())?null:e.toISOString();if(typeof e=="number"&&Number.isFinite(e)){const n=new Date(e);return Number.isNaN(n.getTime())?null:n.toISOString()}return null}function N(e){return typeof e=="string"?e.trim()||null:typeof e=="number"?String(e):null}function Tt(e){for(const n of["correct","isCorrect","heard","judgement"])if(typeof e[n]=="boolean")return e[n];return e.score===1?!0:e.score===0?!1:null}function ur(e){return Array.isArray(e)?e.map((n,t)=>{const o=n??{};return{index:t,itemId:N(o.contextCode)??N(o.itemId)??N(o.itemCode)??N(o.id),question:N(o.question)??N(o.q)??N(o.sentence)??N(o.text)??N(o.prompt)??N(o.word)??N(o.targetSyllable),answer:N(o.answer),selected:N(o.selectedText)??N(o.selected),correct:Tt(o),shownAt:xe(o.shownAt)??xe(o.shown_at),answeredAt:xe(o.answeredAt)??xe(o.answered_at)}}):[]}function rr(e){return e.filter(n=>n.correct===!1)}let pt=null,At=null,wt=null;function ir(e){pt=e}function ar(e){At=e}function sr(e){wt=e}async function lr(e,n){try{return await pt?.(e,n)??null}catch{return null}}async function cr(){try{return await At?.()??null}catch{return null}}async function Cr(e,n){try{return await wt?.(e,n)??null}catch{return null}}const We=globalThis;function gr(e){We.__ihabNoiseSettingsStore=e}async function dr(){try{return await We.__ihabNoiseSettingsStore?.load()??null}catch{return null}}function fr(e){const n=t=>{};try{const t=We.__ihabNoiseSettingsStore?.save(e);t&&typeof t.catch=="function"&&t.catch(n)}catch(t){n(t)}}function hr(e){try{We.__ihabNoiseSettingsStore?.applied?.(e)}catch{}}function He(e){const n=new TextEncoder().encode(String(e).normalize("NFC"));let t="";return n.forEach(o=>{t+=o.toString(16).padStart(2,"0")}),t}const mr=He;function Sr(e,n){return`${e}/${He(n)}.mp3`}function Er(e={}){const n=e.storagePrefix??"audio-cache",t=e.voice??"ko-f",o=typeof e.speed=="number"?e.speed:1,r=e.filenameSanitizer??He;return async function(a){const u=String(a||"").trim();if(!u)return"";const i=`${r(u)}_${t}.mp3`,s=`${n}/${i}`;try{if(await Rn(s)){const c=await On(s);if(c)return c}}catch{}if(e.generator)try{const c=await e.generator(u,s,e);if(c)return c}catch{}try{const c=`/api/tts?word=${encodeURIComponent(u)}&voice=${encodeURIComponent(t)}&speed=${encodeURIComponent(String(o))}`;return await fetch(c,{method:"GET"}),`/audio-cache/${i}`}catch{return`/audio-cache/${i}`}}}async function yr(e){if(typeof document<"u"){const n=document.activeElement;let t=null;try{if(t=document.createElement("textarea"),t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.opacity="0",t.style.pointerEvents="none",document.body.appendChild(t),t.focus(),t.select(),t.setSelectionRange(0,e.length),document.execCommand("copy"))return!0}catch{}finally{if(t?.parentNode&&t.parentNode.removeChild(t),n&&n!==document.activeElement&&typeof n.focus=="function"&&n.isConnected)try{n.focus({preventScroll:!0})}catch{}}}try{if(typeof navigator<"u"&&navigator.clipboard&&typeof navigator.clipboard.writeText=="function")return await navigator.clipboard.writeText(e),!0}catch{}return!1}const re="Asia/Seoul",Dr=/^(\d{4}-\d{2}-\d{2})[T ](\d{2}:\d{2})(?::(\d{2})(?:\.(\d+))?)?$/;function Ye(e){let n;if(e instanceof Date)n=e;else if(typeof e=="string"){const t=e.trim(),o=Dr.exec(t);n=new Date(o?`${o[1]}T${o[2]}:${o[3]??"00"}${o[4]?`.${o[4].slice(0,3).padEnd(3,"0")}`:""}+09:00`:t)}else n=new Date(e);return Number.isNaN(n.getTime())?null:n}const Ee=e=>Ye(e);function Tr(e){const n=Ee(e);return n?n.toLocaleDateString("ko-KR",{timeZone:re,year:"numeric",month:"short",day:"numeric"}):""}function pr(e){const n=Ee(e);return n?n.toLocaleString("ko-KR",{timeZone:re,year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):""}function Ar(e,n){const t=n.startsWith("ko")?"ko-KR":"en-US",o=Ee(e);return o?o.toLocaleDateString(t,{timeZone:re,year:"numeric",month:"short",day:"numeric"}):""}function wr(e,n){const t=n.startsWith("ko")?"ko-KR":"en-US",o=Ee(e);return o?o.toLocaleString(t,{timeZone:re,year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):""}function br(e){const n=Ee(e);return n?n.toLocaleString("ko-KR",{timeZone:re,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):""}function _r(e){if(e==null||e==="")return"";const n=Ye(e);return n?new Intl.DateTimeFormat("en-GB",{timeZone:re,hour:"2-digit",minute:"2-digit",hour12:!1}).format(n):""}function wn(){return ye(new Date)}function Br(){return bt(wn())}const Nr=540*60*1e3;function Lr(e,n,t){return new Date(Date.UTC(e,n,t)-Nr)}function bt(e){const[n,t,o]=e.split("-").map(Number);return new Date(n,(t||1)-1,o||1)}function ye(e){if(e==null||e==="")return"";const n=Ye(e);return n?new Intl.DateTimeFormat("fr-CA",{timeZone:"Asia/Seoul"}).format(n):""}function jr(e,n){if(!e)return"";const t=Ye(e);if(!t)return"";const o=t.getTime(),r=Math.max(0,Math.floor((Date.now()-o)/1e3)),a=Math.floor(r/60),u=Math.floor(a/60),i=Math.floor(u/24),s=Math.floor(i/7),c=Math.floor(i/30),C=Math.floor(i/365);return a<1?n("store.time.justNow","\uBC29\uAE08 \uC804"):a<60?n("store.time.minutesAgo",{n:a}):u<24?n("store.time.hoursAgo",{n:u}):i<7?n("store.time.daysAgo",{n:i}):s<5?n("store.time.weeksAgo",{n:s}):i<365?n("store.time.monthsAgo",{n:Math.min(c,11)}):n("store.time.yearsAgo",{n:C})}function Rr(e,n={}){const{sep:t=".",pad:o=!0,trailingDot:r=!1,fallback:a="\u2014"}=n;if(!e)return a;const u=ye(e instanceof Date?e:String(e));if(!u)return a;const[i,s,c]=u.split("-"),C=o?s:String(Number(s)),l=o?c:String(Number(c));return`${i}${t}${C}${t}${l}${r?".":""}`}function Or(e){const n=e.normalize("NFKC").replace(/\D/g,"");if(/^(050\d|0303)/.test(n)){const o=n.slice(0,12);return o.length<=4?o:o.length<=8?`${o.slice(0,4)}-${o.slice(4)}`:`${o.slice(0,4)}-${o.slice(4,o.length-4)}-${o.slice(o.length-4)}`}if(/^1[5-9]\d{2}/.test(n)&&n.length<=8)return n.length<=4?n:`${n.slice(0,4)}-${n.slice(4)}`;const t=n.slice(0,11);return t.startsWith("02")?t.length<=2?t:t.length<=6?`${t.slice(0,2)}-${t.slice(2)}`:`${t.slice(0,2)}-${t.slice(2,t.length-4)}-${t.slice(t.length-4)}`:t.length<=3?t:t.length<=7?`${t.slice(0,3)}-${t.slice(3)}`:`${t.slice(0,3)}-${t.slice(3,t.length-4)}-${t.slice(t.length-4)}`}const _t=String.raw`(?:0\d{1,2}|050\d|0303)-\d{3,4}-\d{4}`,kr=String.raw`1[5-9]\d{2}-\d{4}`,Bt=new RegExp(`^(?:${_t}|${kr})$`),Nt=new RegExp(`^${_t}$`);function $r(e){return Bt.test(e)}function Ir(e){return Nt.test(e)}function Pr(e){if(e){if(/^\d{4}\.\d{2}\.\d{2}$/.test(e))return e;if(/^\d{8}$/.test(e))return`${e.slice(0,4)}.${e.slice(4,6)}.${e.slice(6,8)}`;if(/^\d{4}-\d{2}-\d{2}$/.test(e))return e.replace(/-/g,".");if(/^\d{4}-\d{2}-\d{2}[T ]/.test(e)){const n=ye(e);return n?n.replace(/-/g,"."):void 0}}}function Mr(e){if(e)return/^\d{4}\.\d{2}\.\d{2}$/.test(e)?e.replace(/\./g,"-"):e}function vr(e,n){if(!e)return"-";const t=/^(\d{1,2}):(\d{2})$/.exec(e.trim());if(!t)return e;const o=Number(t[1]),r=Number(t[2]),a=t[1].padStart(2,"0");return r===0?n("date.timeH",{h:o,hh:a,mm:t[2]}):n("date.timeHM",{h:o,hh:a,m:r,mm:t[2]})}function Fr(e){return(e??0).toLocaleString("ko-KR")}const Gr=[{key:"FOOD",label:"\uC74C\uC2DD",icon:"salad",color:"#FF8A65",subs:[{key:"TRKRFD",label:"\uD55C\uAD6D \uC804\uD1B5\uC74C\uC2DD"},{key:"MDKRFD",label:"\uD55C\uAD6D \uD604\uB300\uC74C\uC2DD"},{key:"WRLDFD",label:"\uC138\uACC4\uC758 \uC74C\uC2DD"},{key:"MTRFRT",label:"\uC2DD\uC7AC\uB8CC\uC640 \uACFC\uC77C"},{key:"GEFDKL",label:"\uC74C\uC2DD \uC0C1\uC2DD"}]},{key:"HLTH",label:"\uAC74\uAC15",icon:"heart",color:"#66BB6A",subs:[{key:"HTETHB",label:"\uAC74\uAC15\uD55C \uC2DD\uC2B5\uAD00"},{key:"DISILL",label:"\uBCD1\uACFC \uC9C8\uD658"},{key:"EXCISE",label:"\uC6B4\uB3D9"},{key:"GEHTKL",label:"\uAC74\uAC15\uC0C1\uC2DD"}]},{key:"WETH",label:"\uB0A0\uC528",icon:"sun-medium",color:"#42A5F5",subs:[{key:"GESSKL",label:"\uACC4\uC808\uC0C1\uC2DD"},{key:"SNWRAN",label:"\uB208\uACFC \uBE44"},{key:"WTHFCT",label:"\uC77C\uAE30\uC608\uBCF4"},{key:"GEWTKL",label:"\uB0A0\uC528\uC0C1\uC2DD"}]},{key:"PRSN",label:"\uC778\uBB3C",icon:"user-round",color:"#AB47BC",subs:[{key:"JODYPS",label:"\uC870\uC120\uC2DC\uB300"},{key:"MDKRPS",label:"\uD55C\uAD6D \uADFC\uD604\uB300"},{key:"THKDPS",label:"\uC0BC\uAD6D\uC2DC\uB300"},{key:"WRLART",label:"\uC138\uACC4\uC758 \uC608\uC220\uAC00"},{key:"WRLPSN",label:"\uC138\uACC4\uC758 \uC778\uBB3C"}]},{key:"KRCT",label:"\uD55C\uAD6D\uBB38\uD654",icon:"bow-arrow",color:"#EC407A",subs:[{key:"KRLANG",label:"\uC6B0\uB9AC\uB9D0"},{key:"TRPLCT",label:"\uC804\uD1B5\uB180\uC774"},{key:"HERITG",label:"\uBB38\uD654\uC7AC"},{key:"EVTFES",label:"\uD589\uC0AC\uC640 \uCD95\uC81C"},{key:"GECTKL",label:"\uC0C1\uC2DD"}]},{key:"STRY",label:"\uC774\uC57C\uAE30",icon:"message-circle",color:"#8D6E63",subs:[{key:"FRYTAL",label:"\uB3D9\uD654"},{key:"AMZING",label:"\uC2E0\uAE30\uD55C \uC774\uC57C\uAE30"},{key:"DAYSTR",label:"\uC77C\uC0C1 \uC18D \uC774\uC57C\uAE30"}]},{key:"LOCA",label:"\uC9C0\uC5ED",icon:"map-pin",color:"#26A69A",subs:[{key:"KRLDMK",label:"\uD55C\uAD6D\uC758 \uBA85\uC18C"},{key:"SELNMK",label:"\uC11C\uC6B8\uC758 \uBA85\uC18C"},{key:"WRDTRB",label:"\uC138\uACC4\uC5EC\uD589"},{key:"NAVIGT",label:"\uAE38 \uCC3E\uAE30"}]},{key:"SOAR",label:"\uC0AC\uD68C\uC640 \uC608\uC220",icon:"landmark",color:"#5C6BC0",subs:[{key:"KRSOCI",label:"\uD55C\uAD6D"},{key:"ECONEW",label:"\uACBD\uC81C\uC640 \uB274\uC2A4"},{key:"GENART",label:"\uC608\uC220"},{key:"GELFKL",label:"\uC0DD\uD65C \uC0C1\uC2DD"}]},{key:"NTSC",label:"\uC790\uC5F0\uACFC \uACFC\uD559",icon:"leaf",color:"#9CCC65",subs:[{key:"ANIMAL",label:"\uB3D9\uBB3C"},{key:"PLANTS",label:"\uC2DD\uBB3C"},{key:"ETHPLT",label:"\uC9C0\uAD6C"},{key:"TOLELC",label:"\uB3C4\uAD6C\uC640 \uC804\uC790\uC81C\uD488"},{key:"GESCKL",label:"\uACFC\uD559\uC0C1\uC2DD"}]},{key:"SPRT",label:"\uC2A4\uD3EC\uCE20",icon:"trophy",color:"#FFCA28",subs:[{key:"INVDSP",label:"\uAC1C\uC778\uACBD\uAE30"},{key:"MARART",label:"\uACA9\uD22C\uAE30"},{key:"TEAMSP",label:"\uB2E8\uCCB4\uACBD\uAE30"},{key:"FOOTBL",label:"\uCD95\uAD6C"},{key:"GESPKL",label:"\uC2A4\uD3EC\uCE20 \uC0C1\uC2DD"}]}],xr=[{key:"LISTEN_IN_NOISE",label:"\uC18C\uC74C \uD558 \uBB38\uC7A5 \uB4E3\uAE30",icon:"party-popper",desc:"\uC18C\uC74C \uD658\uACBD \uC18D \uBB38\uC7A5 \uC774\uD574 \uD6C8\uB828"},{key:"SHORT_STORY",label:"\uC9E7\uC740 \uC774\uC57C\uAE30 \uB4E3\uAE30",icon:"message-square",desc:"\uC9E7\uC740 \uC774\uC57C\uAE30 + 4\uBB38\uC81C"},{key:"LONG_STORY",label:"\uAE34 \uC774\uC57C\uAE30 \uB4E3\uAE30",icon:"message-square-text",desc:"\uAE34 \uC774\uC57C\uAE30 \uC2EC\uD654 \uD6C8\uB828"},{key:"ORDERING_SENTENCE",label:"\uBB38\uC7A5 \uC21C\uC11C\uD654 \uD558\uAE30",icon:"align-start-vertical",desc:"\uC21C\uC11C \uBC30\uC5F4 \uD6C8\uB828"}];let bn=null;function Wr(e){bn=e}function Hr(){return bn?.topicTypes??Gr}function Yr(){return bn?.trainingTypes??xr}const Lt="ihab_theme",jt="light";function Rt(){try{const e=localStorage.getItem(Lt);if(e==="light"||e==="dark"||e==="auto")return e}catch{}return jt}function Ot(e){const n=e==="light"||e==="dark"||e==="auto"?e:jt;try{document.documentElement.setAttribute("data-theme",n),localStorage.setItem(Lt,n)}catch{}}function Kr(){Ot(Rt())}const kt="ihab_font_scale",Ur="medium",Vr=["medium","large1","large2","large3"];function $t(){try{const e=localStorage.getItem(kt);if(Vr.includes(e))return e}catch{}return Ur}function It(e){try{document.documentElement.setAttribute("data-font-scale",e),localStorage.setItem(kt,e)}catch{}}function zr(){It($t())}const De=[],Te=[],pe=[],Ae=[],we={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},be={LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]},qr={LISTEN_IN_NOISE:3,SHORT_STORY:2,LONG_STORY:1,ORDERING_SENTENCE:2};let _n=null,Pt=null,V=null;function Mt({counts:e,forceRefresh:n}={}){const t=Object.assign({},qr,e||{}),o=wn(),r=ye(new Date(`${o}T00:00:00+09:00`).getTime()-864e5),a=JSON.stringify(t);if(!n&&Pt===o&&_n===a&&V)return Object.assign(we,V.today),Object.assign(be,V.yesterday?.selection||{LISTEN_IN_NOISE:[],SHORT_STORY:[],LONG_STORY:[],ORDERING_SENTENCE:[]}),{today:we,yesterday:be};const u={LISTEN_IN_NOISE:Y(De,Math.max(0,Number(t.LISTEN_IN_NOISE)||0)),SHORT_STORY:Y(Te,Math.max(0,Number(t.SHORT_STORY)||0)),LONG_STORY:Y(pe,Math.max(0,Number(t.LONG_STORY)||0)),ORDERING_SENTENCE:Y(Ae,Math.max(0,Number(t.ORDERING_SENTENCE)||0))};let i=null;return V&&_n===a&&V.yesterday&&V.yesterday.date===r&&(i=V.yesterday.selection),i||(i={LISTEN_IN_NOISE:Y(De,Math.max(0,Number(t.LISTEN_IN_NOISE)||0)),SHORT_STORY:Y(Te,Math.max(0,Number(t.SHORT_STORY)||0)),LONG_STORY:Y(pe,Math.max(0,Number(t.LONG_STORY)||0)),ORDERING_SENTENCE:Y(Ae,Math.max(0,Number(t.ORDERING_SENTENCE)||0))}),Object.assign(we,u),Object.assign(be,i),Pt=o,_n=a,V={today:u,yesterday:{date:r,countsKey:a,selection:i}},{today:we,yesterday:be}}function Jr(){return{today:we,yesterday:be}}function Qr(){return{LISTEN_IN_NOISE:De,SHORT_STORY:Te,LONG_STORY:pe,ORDERING_SENTENCE:Ae}}let Ke=!1,_e=null;async function Xr(){try{const e={url:typeof document>"u"?require("url").pathToFileURL(__filename).href:Ve&&Ve.tagName.toUpperCase()==="SCRIPT"&&Ve.src||new URL("utils.cjs.js",document.baseURI).href}&&void 0||"/",n=await fetch(`${e}data/allTrainingData.json`);return n.ok?await n.json():null}catch{return null}}async function vt(){if(!Ke)return _e||(_e=(async()=>{const e=await Xr();if(!e){_e=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}const n={noise:[],short:[],long:[],order:[]};try{for(const t of Object.keys(e||{})){const o=e[t]||[];for(const r of o){if(!r||typeof r!="object")continue;const a=r,u=String(a.training_type||t),i=String(a.category_main_code||a.category_main||a.category_0||""),s=String(a.category_sub_code||a.category_sub||a.category_1||""),c=Object.assign({},a,{training_type:u,category_0:i,category_1:s});u==="LISTEN_IN_NOISE"?n.noise.push(c):u==="SHORT_STORY"?n.short.push(c):u==="LONG_STORY"?n.long.push(c):u==="ORDERING_SENTENCE"&&n.order.push(c)}}}catch{_e=null;try{window.dispatchEvent(new Event("speechear.data.error"))}catch{}return}De.push(...n.noise),Te.push(...n.short),pe.push(...n.long),Ae.push(...n.order),Ke=!0;try{Mt()}catch{}try{window.dispatchEvent(new Event("speechear.data.updated"))}catch{}})(),_e)}function Zr(){return Ke}async function ei(e=3e3){const n=vt();let t;try{await Promise.race([n,new Promise(o=>{t=setTimeout(o,e)})])}finally{t!==void 0&&clearTimeout(t)}return Ke}const ni=[{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."}],ti=[{key:"FOOD",label:"\uC74C\uC2DD",icon:"salad",color:"#FF8A65",subs:[{key:"TRKRFD",label:"\uD55C\uAD6D \uC804\uD1B5\uC74C\uC2DD"},{key:"MDKRFD",label:"\uD55C\uAD6D \uD604\uB300\uC74C\uC2DD"},{key:"WRLDFD",label:"\uC138\uACC4\uC758 \uC74C\uC2DD"},{key:"MTRFRT",label:"\uC2DD\uC7AC\uB8CC\uC640 \uACFC\uC77C"},{key:"GEFDKL",label:"\uC74C\uC2DD \uC0C1\uC2DD"}]},{key:"HLTH",label:"\uAC74\uAC15",icon:"heart",color:"#66BB6A",subs:[{key:"HTETHB",label:"\uAC74\uAC15\uD55C \uC2DD\uC2B5\uAD00"},{key:"DISILL",label:"\uBCD1\uACFC \uC9C8\uD658"},{key:"EXCISE",label:"\uC6B4\uB3D9"},{key:"GEHTKL",label:"\uAC74\uAC15\uC0C1\uC2DD"}]},{key:"WETH",label:"\uB0A0\uC528",icon:"sun-medium",color:"#42A5F5",subs:[{key:"GESSKL",label:"\uACC4\uC808\uC0C1\uC2DD"},{key:"SNWRAN",label:"\uB208\uACFC \uBE44"},{key:"WTHFCT",label:"\uC77C\uAE30\uC608\uBCF4"},{key:"GEWTKL",label:"\uB0A0\uC528\uC0C1\uC2DD"}]},{key:"PRSN",label:"\uC778\uBB3C",icon:"user-round",color:"#AB47BC",subs:[{key:"JODYPS",label:"\uC870\uC120\uC2DC\uB300"},{key:"MDKRPS",label:"\uD55C\uAD6D \uADFC\uD604\uB300"},{key:"THKDPS",label:"\uC0BC\uAD6D\uC2DC\uB300"},{key:"WRLART",label:"\uC138\uACC4\uC758 \uC608\uC220\uAC00"},{key:"WRLPSN",label:"\uC138\uACC4\uC758 \uC778\uBB3C"}]},{key:"KRCT",label:"\uD55C\uAD6D\uBB38\uD654",icon:"bow-arrow",color:"#EC407A",subs:[{key:"KRLANG",label:"\uC6B0\uB9AC\uB9D0"},{key:"TRPLCT",label:"\uC804\uD1B5\uB180\uC774"},{key:"HERITG",label:"\uBB38\uD654\uC7AC"},{key:"EVTFES",label:"\uD589\uC0AC\uC640 \uCD95\uC81C"},{key:"GECTKL",label:"\uC0C1\uC2DD"}]},{key:"STRY",label:"\uC774\uC57C\uAE30",icon:"message-circle",color:"#8D6E63",subs:[{key:"FRYTAL",label:"\uB3D9\uD654"},{key:"AMZING",label:"\uC2E0\uAE30\uD55C \uC774\uC57C\uAE30"},{key:"DAYSTR",label:"\uC77C\uC0C1 \uC18D \uC774\uC57C\uAE30"}]},{key:"LOCA",label:"\uC9C0\uC5ED",icon:"map-pin",color:"#26A69A",subs:[{key:"KRLDMK",label:"\uD55C\uAD6D\uC758 \uBA85\uC18C"},{key:"SELNMK",label:"\uC11C\uC6B8\uC758 \uBA85\uC18C"},{key:"WRDTRB",label:"\uC138\uACC4\uC5EC\uD589"},{key:"NAVIGT",label:"\uAE38 \uCC3E\uAE30"}]},{key:"SOAR",label:"\uC0AC\uD68C\uC640 \uC608\uC220",icon:"landmark",color:"#5C6BC0",subs:[{key:"KRSOCI",label:"\uD55C\uAD6D"},{key:"ECONEW",label:"\uACBD\uC81C\uC640 \uB274\uC2A4"},{key:"GENART",label:"\uC608\uC220"},{key:"GELFKL",label:"\uC0DD\uD65C \uC0C1\uC2DD"}]},{key:"NTSC",label:"\uC790\uC5F0\uACFC \uACFC\uD559",icon:"leaf",color:"#9CCC65",subs:[{key:"ANIMAL",label:"\uB3D9\uBB3C"},{key:"PLANTS",label:"\uC2DD\uBB3C"},{key:"ETHPLT",label:"\uC9C0\uAD6C"},{key:"TOLELC",label:"\uB3C4\uAD6C\uC640 \uC804\uC790\uC81C\uD488"},{key:"GESCKL",label:"\uACFC\uD559\uC0C1\uC2DD"}]},{key:"SPRT",label:"\uC2A4\uD3EC\uCE20",icon:"trophy",color:"#FFCA28",subs:[{key:"INVDSP",label:"\uAC1C\uC778\uACBD\uAE30"},{key:"MARART",label:"\uACA9\uD22C\uAE30"},{key:"TEAMSP",label:"\uB2E8\uCCB4\uACBD\uAE30"},{key:"FOOTBL",label:"\uCD95\uAD6C"},{key:"GESPKL",label:"\uC2A4\uD3EC\uCE20 \uC0C1\uC2DD"}]}],oi={LISTEN_IN_NOISE:"listenInNoise",SHORT_STORY:"shortStory",LONG_STORY:"longStory",ORDERING_SENTENCE:"orderingSentence"};let Ue=null,Ft=null,Gt=null;function ui(){const e=Dt();if(e&&e.entries.length>0){const n=et();if(Ue&&Ft===e&&Gt===n)return Ue;const t=new Set,o=[];for(const r of e.entries)!r.word||t.has(r.word)||(t.add(r.word),o.push({w:r.word,s:r.syllables,p:n?.[r.word]?[...n[r.word].cho??[],...n[r.word].jung??[],...n[r.word].jong??[]]:[],pron:r.pronunciation||r.word,grade:r.grade}));return Ue=o,Ft=e,Gt=n,Ue}return[]}new Proxy([],{get(e,n){const t=ui(),o=t[n];return typeof o=="function"?o.bind(t):o}});const ri={free:{maxCustomers:0,visitWord:!1,visitSentence:!1,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!1,wordTablePrint:!1,addToMyList:!1,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!1,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:1,sentenceDataLevel:0,crossword:!1,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!1,sentenceTrainingView:!1},personal_standard:{maxCustomers:0,visitWord:!1,visitSentence:!1,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!0,wordTrainingSetting:!0,myWordList:!0,wordListShare:!0,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!0,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!0,wordSearchAddToGroupList:!1,wordDataLevel:2,sentenceDataLevel:2,crossword:!0,crosswordMid:!0,crosswordHigh:!1,wordTrainingView:!0,sentenceTrainingView:!0},mgr_free:{maxCustomers:5,visitWord:!0,visitSentence:!0,homework:!0,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!1,wordTablePrint:!1,addToMyList:!1,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!1,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:1,sentenceDataLevel:1,crossword:!1,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!1,sentenceTrainingView:!1},none:{maxCustomers:0,visitWord:!1,visitSentence:!1,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!1,wordTableSetting:!1,wordTablePrint:!1,addToMyList:!1,addToGroupList:!1,wordSearch:!1,wordSearchPrint:!1,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:0,sentenceDataLevel:0,crossword:!1,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!1,sentenceTrainingView:!1},lite_word:{maxCustomers:10,visitWord:!0,visitSentence:!1,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!1,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:1,sentenceDataLevel:0,crossword:!0,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!0,sentenceTrainingView:!1},lite_sentence:{maxCustomers:10,visitWord:!1,visitSentence:!0,homework:!1,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!1,wordTableSetting:!1,wordTablePrint:!0,addToMyList:!1,addToGroupList:!1,wordSearch:!1,wordSearchPrint:!0,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:0,sentenceDataLevel:1,crossword:!0,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!1,sentenceTrainingView:!0},lite:{maxCustomers:10,visitWord:!0,visitSentence:!0,homework:!0,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!1,wordTrainingSetting:!1,myWordList:!1,wordListShare:!1,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!1,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!1,wordSearchAddToGroupList:!1,wordDataLevel:1,sentenceDataLevel:1,crossword:!0,crosswordMid:!1,crosswordHigh:!1,wordTrainingView:!0,sentenceTrainingView:!0},standard:{maxCustomers:30,visitWord:!0,visitSentence:!0,homework:!0,customerStats:!1,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!0,wordTrainingSetting:!0,myWordList:!0,wordListShare:!0,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!0,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!0,wordSearchAddToGroupList:!1,wordDataLevel:2,sentenceDataLevel:2,crossword:!0,crosswordMid:!0,crosswordHigh:!1,wordTrainingView:!0,sentenceTrainingView:!0},pro:{maxCustomers:50,visitWord:!0,visitSentence:!0,homework:!0,customerStats:!0,managerCustomerSplit:!1,managerManagement:!1,sentenceTrainingSetting:!0,wordTrainingSetting:!0,myWordList:!0,wordListShare:!0,groupTrainingSetting:!1,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!0,addToGroupList:!1,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!0,wordSearchAddToGroupList:!1,wordDataLevel:3,sentenceDataLevel:3,crossword:!0,crosswordMid:!0,crosswordHigh:!0,wordTrainingView:!0,sentenceTrainingView:!0},enterprise:{maxCustomers:1/0,visitWord:!0,visitSentence:!0,homework:!0,customerStats:!0,managerCustomerSplit:!0,managerManagement:!0,sentenceTrainingSetting:!0,wordTrainingSetting:!0,myWordList:!0,wordListShare:!0,groupTrainingSetting:!0,minimalPairSearch:!0,wordTableSetting:!0,wordTablePrint:!0,addToMyList:!0,addToGroupList:!0,wordSearch:!0,wordSearchPrint:!0,wordSearchAddToMyList:!0,wordSearchAddToGroupList:!0,wordDataLevel:3,sentenceDataLevel:3,crossword:!0,crosswordMid:!0,crosswordHigh:!0,wordTrainingView:!0,sentenceTrainingView:!0}},ii={none:0,free:1,personal_standard:2,mgr_free:10,lite_word:11,lite_sentence:11,lite:12,standard:13,pro:14,enterprise:15},ai=new Set(["mgr_free","lite_word","lite_sentence","lite","standard","pro","enterprise"]);function si(e){return ai.has(e)}const li={free:{sentenceTrainingDaily:2,wordTrainingDaily:2,gameDaily:1},personal_standard:{sentenceTrainingDaily:null,wordTrainingDaily:null,gameDaily:null},mgr_free:{sentenceTrainingDaily:2,wordTrainingDaily:2,gameDaily:1,trainingItemMax:5,customerMax:5,homeworkSendDaily:1},lite:{sentenceTrainingDaily:5,wordTrainingDaily:5,gameDaily:5,trainingItemMax:10,customerMax:10,homeworkSendDaily:10},standard:{sentenceTrainingDaily:null,wordTrainingDaily:null,gameDaily:null,trainingItemMax:30,customerMax:30,homeworkSendDaily:30},pro:{sentenceTrainingDaily:null,wordTrainingDaily:null,gameDaily:null,trainingItemMax:null,customerMax:50,homeworkSendDaily:50},enterprise:{sentenceTrainingDaily:null,wordTrainingDaily:null,gameDaily:null,trainingItemMax:null,customerMax:null,homeworkSendDaily:null}};function ci(e){const n=(e??"").toLowerCase();return n==="speechear_free"||n==="free"?"free":n.startsWith("manager_free")||n.startsWith("mgr_free")?"mgr_free":n.startsWith("manager_enterprise")?"enterprise":n.startsWith("manager_pro")?"pro":n.startsWith("manager_standard")?"standard":n.startsWith("manager_lite_word")?"lite_word":n.startsWith("manager_lite_sentence")?"lite_sentence":n.startsWith("manager_lite")||n.startsWith("mgr_lite")?"lite":n.startsWith("mgr_standard")?"standard":n.startsWith("mgr_pro")?"pro":n.startsWith("content_")||n.startsWith("speechear_")||n.startsWith("light_")||n==="light"?"personal_standard":"none"}const Ci=5,gi=5;function di({rank:e,voteCount:n,quota:t=5}){return e<t&&n>0}const fi={selected:"ALREADY_SELECTED",added:"ALREADY_ADDED",rejected:"ALREADY_REJECTED"},xt="chunk-reload-ts";function Wt(){try{return Number(sessionStorage.getItem(xt)||0)}catch{return 0}}function Bn(e=Date.now()){if(e-Wt()<=1e4)return!1;try{sessionStorage.setItem(xt,String(e))}catch{}return window.location.reload(),!0}function Ht(e=Date.now()){const n=Wt();return n>0&&e-n<=1e4}function hi(){if(typeof window>"u")return()=>{};const e=t=>{Bn()&&t.preventDefault()},n=t=>{const o=t.target;o instanceof HTMLLinkElement&&o.rel==="stylesheet"&&Bn()};return window.addEventListener("vite:preloadError",e),window.addEventListener("error",n,!0),()=>{window.removeEventListener("vite:preloadError",e),window.removeEventListener("error",n,!0)}}function mi(e,n){return e?!!n&&n.access_token===e.access_token:!0}function Si(e,n){return Yt.lazy(async()=>{const t=await n();if(t&&typeof t=="object"&&"default"in t)return t;if(Ht())return new Promise(()=>{});throw new Error(`[lazyPage] ${e}: \uD654\uBA74 \uBAA8\uB4C8\uC744 \uBC1B\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4(default \uB0B4\uBCF4\uB0B4\uAE30 \uC5C6\uC74C). \uBC30\uD3EC \uC9C1\uD6C4\uB77C\uBA74 \uC0C8\uB85C\uACE0\uCE68\uC73C\uB85C \uD480\uB9BD\uB2C8\uB2E4.`)})}function Ei(...e){let n=!1;const t=()=>{if(!n)for(const a of e)a().catch(()=>{})},o=globalThis.requestIdleCallback;if(o){const a=o(t,{timeout:2e3});return()=>{n=!0;const u=globalThis.cancelIdleCallback;u?.(a)}}const r=setTimeout(t,300);return()=>{n=!0,clearTimeout(r)}}const yi=e=>({word:e.Word,pronunciation:e.SP,colloquialPronunciation:e.CP??void 0,grade:String(e.Grade),pos:e.POS,wordType:e.Class,homonum:e.Homonum!=null?Number(e.Homonum):void 0}),Di="0.272.0";exports.CAPABILITY=ft,exports.CHOSEONG=A,exports.CORE_VERSION=Di,exports.JONGSEONG=B,exports.JUNGSEONG=w,exports.LONG_STORIES=pe,exports.NETWORK_ERROR_MESSAGE=pn,exports.NOISE_DATAS=De,exports.ORDER_SETS=Ae,exports.PERSONAL_PHONE_REGEX=Nt,exports.PHONE_REGEX=Bt,exports.PLAN_FEATURES=ri,exports.PLAN_LIMITS=li,exports.SHORT_STORIES=Te,exports.TIER_RANK=ii,exports.TOPIC_TYPES=ti,exports.TRAINING_TYPES=ni,exports.TRAINING_TYPE_I18N_KEY=oi,exports.WORD_SUGGESTION_ACCOUNT_LIMIT=gi,exports.WORD_SUGGESTION_EXISTING_ERROR=fi,exports.WORD_SUGGESTION_WEEKLY_QUOTA=Ci,exports.applyFontScale=It,exports.applyTheme=Ot,exports.buildChangeWholeSyllableProblem=Gu,exports.buildDropCompoundProblem=Pu,exports.buildDropContrast3Problem=Iu,exports.buildDropContrastProblem=$u,exports.buildDropFinalConsonantProblem=Mu,exports.buildMultiPartPosContrast=Jo,exports.buildPairIndex=Vo,exports.buildRemoveConsonantProblem=vu,exports.buildSyllableMaskIndex=Fu,exports.bulkSetImageExistence=wo,exports.cardQuestionTitle=Lu,exports.checkImageExists=xn,exports.classifyPairDifficulty=Lo,exports.clearAudioExistsCache=lo,exports.clearImageExistenceCache=bo,exports.clearPairIndexCache=zo,exports.composeSyllable=x,exports.computeDailySelection=Mt,exports.configureImageResolver=yo,exports.configureNoiseSettingsStore=gr,exports.configurePronunciationResolver=co,exports.configureStorage=Zt,exports.configureTTS=ro,exports.configureTrainingCategories=Wr,exports.copyText=yr,exports.createDecompCache=No,exports.createTTSUrlResolver=Er,exports.dateToDb=Mr,exports.downloadCsvText=qu,exports.downloadSound=no,exports.ensureTrainingDataLoaded=ei,exports.escapeCsvField=Vu,exports.fileExists=Rn,exports.filterContrastCandidates=nt,exports.finalToPhoneme=Re,exports.firstChoseongOf=Hn,exports.formatCount=Fr,exports.formatDateKo=Tr,exports.formatDateLocale=Ar,exports.formatDateLongKo=pr,exports.formatDateLongLocale=wr,exports.formatDatetimeKo=br,exports.formatPhone=Or,exports.formatRelativeTime=jr,exports.formatTimeHM=vr,exports.formatYmd=Rr,exports.getAssetBaseUrl=Ln,exports.getDailySelection=Jr,exports.getElementAnalyser=ho,exports.getElementVolume=So,exports.getErrorMessage=Wu,exports.getImageExistenceStats=Ao,exports.getImageExistsCached=To,exports.getImageResolver=Fn,exports.getNoiseBaseUrl=to,exports.getNoiseFileGain=oo,exports.getPairIndex=et,exports.getPlanTier=ci,exports.getPronunciationResolver=Co,exports.getSavedFontScale=$t,exports.getSavedTheme=Rt,exports.getSignedOrPublicUrl=On,exports.getTTSFallbackUrlResolver=ao,exports.getTTSUrlResolver=io,exports.getTodayKst=wn,exports.getTodayKstDate=Br,exports.getTopicTypes=Hr,exports.getTrainingPools=Qr,exports.getTrainingTypes=Yr,exports.getWordPool=Dt,exports.hasQuestionWordConstraint=yu,exports.hasSel=k,exports.hasStructureContrast=an,exports.initFontScale=zr,exports.initTheme=Kr,exports.installSkewRecovery=hi,exports.isAllChoseong=Kn,exports.isManagerTier=si,exports.isManualOnlyType=Tu,exports.isNetworkErrorMessage=Et,exports.isPersonalPhone=Ir,exports.isSessionForThisTab=mi,exports.isSyllablePattern=Jn,exports.isThisWeekPick=di,exports.isTrainingDataLoaded=Zr,exports.isValidPhone=$r,exports.isValidQuestionWord=Du,exports.itemCorrectness=Tt,exports.jamoToNamesForSpeech=ju,exports.kstStartOfDay=Lr,exports.lazyPage=Si,exports.loadGameLeaderboard=Cr,exports.loadMyGameRanks=cr,exports.loadNoiseSettings=dr,exports.loadTrainingData=vt,exports.logCrossword=or,exports.logTrainingCompletion=nr,exports.logTrainingTime=Zu,exports.matchSyllables=te,exports.matchesChoseongSearch=jo,exports.matchesSyllablePattern=Xn,exports.matchesWordQuery=Ro,exports.mergeQuestionText=St,exports.minimalPairDistractors=qo,exports.normalizeDate=Pr,exports.officialSoundPath=Sr,exports.parseLocalYmd=bt,exports.parseSortValue=Uu,exports.parseSyllable=S,exports.patternToComposition=Go,exports.phonemePartsOf=Au,exports.pickEuRo=dt,exports.pickEulReul=ct,exports.pickEunNeun=Ct,exports.pickIga=lt,exports.pickWaGwa=gt,exports.prefetchChunk=Ei,exports.prewarmImageCache=po,exports.primarySelPart=Ge,exports.readLevel=Eo,exports.recoverFromSkew=Bn,exports.reorderArray=mu,exports.reportAppliedNoiseSettings=hr,exports.resolveAssetUrl=Qt,exports.resolveSoundPath=eo,exports.resumeAudioMeter=fo,exports.routeElementAudio=Mn,exports.sample=Y,exports.saveNoiseSettings=fr,exports.searchAndRankWords=Ho,exports.setAssetBaseUrl=Jt,exports.setCrosswordLogger=tr,exports.setElementVolume=mo,exports.setGameLeaderboardLoader=sr,exports.setGameRanksLoader=ar,exports.setGameScoreSubmitter=ir,exports.setTrainingCompletionLogger=er,exports.setTrainingTimeLogger=Xu,exports.setWordPool=Qu,exports.shuffle=R,exports.skewReloadPending=Ht,exports.sortToValue=Ku,exports.soundOf=Dn,exports.speak=Ut,exports.stopSpeaking=Vt,exports.submitGameScore=lr,exports.syllMatchesComp=J,exports.syllableContrasts=oe,exports.syllableLength=Io,exports.syllablePron=Fe,exports.toBase64UrlSafe=mr,exports.toChoseong=Yn,exports.toItemResults=ur,exports.toKstHm=_r,exports.toKstYmd=ye,exports.toStandardPronunciation=lu,exports.toStorageName=He,exports.toUserErrorMessage=Yu,exports.toWordEntry=yi,exports.validateSyllableSearchInput=Wo,exports.withEuRo=hu,exports.withEulReul=gu,exports.withEunNeun=du,exports.withIga=Cu,exports.withWaGwa=fu,exports.wordContainsChoseong=Oo,exports.wordContainsJongseong=$o,exports.wordContainsJungseong=ko,exports.wordHasNoCoda=Po,exports.wordHasSyllableMatching=vo,exports.wrongItems=rr;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ihabdevteam/core",
3
- "version": "0.271.0",
3
+ "version": "0.272.0",
4
4
  "private": false,
5
5
  "main": "dist/ihabdevteam-core.cjs.js",
6
6
  "module": "dist/packages/core/src/index.js",