lido-player 0.0.2-beta-17 → 0.0.2-beta-18-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/dist/cjs/{decode-BPWgujpW.js → decode-DUZYNXIv.js} +1 -1
- package/dist/cjs/{index-BnfJD-Dp.js → index-BEjUmVtH.js} +185 -86
- package/dist/cjs/{index-CACb9dlg.js → index-DnqQXD5x.js} +53 -12
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/lido-avatar_22.cjs.entry.js +61 -68
- package/dist/cjs/lido-player.cjs.js +3 -3
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/avatar/lido-avatar.css +4 -4
- package/dist/collection/components/avatar/lido-avatar.js +1 -1
- package/dist/collection/components/avatar/lido-avatar.tsx +207 -207
- package/dist/collection/components/avatar/readme.md +49 -49
- package/dist/collection/components/calculator/lido-calculator.css +89 -89
- package/dist/collection/components/calculator/lido-calculator.js +2 -2
- package/dist/collection/components/canvas/lido-canvas.css +33 -33
- package/dist/collection/components/canvas/lido-canvas.js +1 -1
- package/dist/collection/components/cell/lido-cell.css +100 -100
- package/dist/collection/components/cell/lido-cell.js +12 -12
- package/dist/collection/components/column/lido-col.css +19 -19
- package/dist/collection/components/column/lido-col.js +6 -6
- package/dist/collection/components/container/lido-container.css +10 -10
- package/dist/collection/components/container/lido-container.js +8 -8
- package/dist/collection/components/flashCard/lido-flash-card.css +28 -28
- package/dist/collection/components/flashCard/lido-flash-card.js +4 -4
- package/dist/collection/components/float/lido-float.css +30 -30
- package/dist/collection/components/float/lido-float.js +2 -2
- package/dist/collection/components/home/lido-home.css +309 -309
- package/dist/collection/components/home/lido-home.js +5 -5
- package/dist/collection/components/image/lido-image.css +17 -17
- package/dist/collection/components/image/lido-image.js +6 -6
- package/dist/collection/components/keyboard/lido-keyboard.css +38 -38
- package/dist/collection/components/keyboard/lido-keyboard.js +3 -3
- package/dist/collection/components/mathMatrix/lido-math-matrix.css +56 -56
- package/dist/collection/components/mathMatrix/lido-math-matrix.js +1 -1
- package/dist/collection/components/position/lido-pos.css +16 -16
- package/dist/collection/components/position/lido-pos.js +2 -2
- package/dist/collection/components/random/lido-random.css +8 -8
- package/dist/collection/components/random/lido-random.js +2 -2
- package/dist/collection/components/root/lido-root.js +5 -5
- package/dist/collection/components/row/lido-row.css +10 -10
- package/dist/collection/components/row/lido-row.js +6 -6
- package/dist/collection/components/scale/assets/Shadow.svg +9 -9
- package/dist/collection/components/scale/lido-balance.css +145 -145
- package/dist/collection/components/scale/lido-balance.js +13 -13
- package/dist/collection/components/shape/lido-shape.css +216 -216
- package/dist/collection/components/shape/lido-shape.js +6 -6
- package/dist/collection/components/slideFill/lido-slide-fill.css +3 -3
- package/dist/collection/components/slideFill/lido-slide-fill.js +13 -13
- package/dist/collection/components/text/lido-text.css +53 -53
- package/dist/collection/components/text/lido-text.js +31 -6
- package/dist/collection/components/trace/assets/Tracing-hand.svg +8 -8
- package/dist/collection/components/trace/lido-trace.css +97 -97
- package/dist/collection/components/trace/lido-trace.js +22 -35
- package/dist/collection/components/wrap/lido-wrap.css +18 -18
- package/dist/collection/components/wrap/lido-wrap.js +6 -6
- package/dist/collection/css/animation.css +211 -211
- package/dist/collection/css/index.css +315 -315
- package/dist/collection/stories/Templates/Fill-Up/fill-up.stories.js +61 -61
- package/dist/collection/stories/Templates/LetterPairing/LetterPairing.stories.js +123 -123
- package/dist/collection/stories/Templates/RocketGame/rocketGame.stories.js +48 -48
- package/dist/collection/stories/Templates/Tag/tagGame.stories.js +39 -39
- package/dist/collection/stories/Templates/arrangeLetters/arrangeLetters.stories.js +44 -44
- package/dist/collection/stories/Templates/balancing/balancing.stories.js +35 -35
- package/dist/collection/stories/Templates/balloonPop/balloonPop.stories.js +38 -38
- package/dist/collection/stories/Templates/blender/blender.stories.js +63 -59
- package/dist/collection/stories/Templates/bubbleType/bubbleType.stories.js +42 -42
- package/dist/collection/stories/Templates/calculator/calculator.stories.js +28 -28
- package/dist/collection/stories/Templates/categorize/categorize.stories.js +37 -37
- package/dist/collection/stories/Templates/categorize2/categorize2.stories.js +67 -67
- package/dist/collection/stories/Templates/checker-block/checkerBlock.stories.js +29 -29
- package/dist/collection/stories/Templates/checkerBlock/checkerBlock.stories.js +13 -13
- package/dist/collection/stories/Templates/create-sentence/createSentence.stories.js +74 -74
- package/dist/collection/stories/Templates/dragAndDrop/drag-drop.stories.js +69 -69
- package/dist/collection/stories/Templates/fillAnswer/fill-answer.stories.js +43 -43
- package/dist/collection/stories/Templates/fillBlank/fill-blank.stories.js +282 -282
- package/dist/collection/stories/Templates/foodJar/food-jar.stories.js +35 -35
- package/dist/collection/stories/Templates/grid/grid.stories.js +118 -118
- package/dist/collection/stories/Templates/gridGame/grid-game.stories.js +57 -57
- package/dist/collection/stories/Templates/imageMatch/imageMatch.stories.js +44 -44
- package/dist/collection/stories/Templates/jumpSentence/jumpSentence.stories.js +41 -41
- package/dist/collection/stories/Templates/letterboard/letterboard.stories.js +183 -183
- package/dist/collection/stories/Templates/makeSentence/make-sentence.stories.js +36 -36
- package/dist/collection/stories/Templates/matchBox/matchBox.stories.js +69 -69
- package/dist/collection/stories/Templates/matchBox/matchBox2.stories.js +84 -84
- package/dist/collection/stories/Templates/matchingCard/matching-card.stories.js +31 -31
- package/dist/collection/stories/Templates/multipleOption/mcqWithQuestionImage.stories.js +112 -112
- package/dist/collection/stories/Templates/multipleOption/multiple-option.stories.js +47 -47
- package/dist/collection/stories/Templates/multiplyBeeds/multiplyBeeds.stories.js +57 -57
- package/dist/collection/stories/Templates/nimbleTable/nimbleTable.stories.js +53 -53
- package/dist/collection/stories/Templates/numberBoard/numberBoard.stories.js +46 -46
- package/dist/collection/stories/Templates/numberBoardTwo/numberBoardTwo.stories.js +45 -45
- package/dist/collection/stories/Templates/numberIdentification/numberIdentificationimageTotext.stories.js +56 -56
- package/dist/collection/stories/Templates/numberIdentification/numberIdentificationtextTotext.stories.js +53 -53
- package/dist/collection/stories/Templates/numberPair/numberPair.stories.js +127 -127
- package/dist/collection/stories/Templates/openwindow/openwindow.stories.js +47 -47
- package/dist/collection/stories/Templates/openwindow/openwindow2.stories.js +38 -38
- package/dist/collection/stories/Templates/order-tractor/order-tractor-ascending-order.stories.js +97 -97
- package/dist/collection/stories/Templates/order-tractor/order-tractor.stories.js +90 -90
- package/dist/collection/stories/Templates/palEgmaCalculateSum/palEgmaMultiOption.stories.js +63 -63
- package/dist/collection/stories/Templates/palEgmaCalculateSum/palEgmaSumTogether.stories.js +45 -45
- package/dist/collection/stories/Templates/palEgmaPatternMatching/palEgmaPatternMatching.stories.js +63 -63
- package/dist/collection/stories/Templates/palEgmaWordProblem/palEgmaWordProblem.stories.js +79 -79
- package/dist/collection/stories/Templates/palEgraInventedSpelling/pal_egra_invented_spelling_schema.stories.js +32 -32
- package/dist/collection/stories/Templates/palEgraMCQWithImage/palEgraMCQWithImage.stories.js +42 -42
- package/dist/collection/stories/Templates/palEgraOptionWithAudio/palEgraOptionWithAudio.stories.js +63 -63
- package/dist/collection/stories/Templates/palEgraStoryMaking/pal_egra_story_making.stories.js +44 -44
- package/dist/collection/stories/Templates/palEgraTemplate1/palEgraLetterIdentification.stories.js +34 -34
- package/dist/collection/stories/Templates/palEgraWordMatch/palEgraWordMatch.stories.js +52 -52
- package/dist/collection/stories/Templates/palEgra_OddOneOut/palEgra_oddOneOut.stories.js +33 -33
- package/dist/collection/stories/Templates/palEgra_arrange_pictures/palEgra_arrange_pictures.stories.js +40 -40
- package/dist/collection/stories/Templates/palEgra_build_word/palEgra_build_word.stories.js +48 -48
- package/dist/collection/stories/Templates/palEgra_word_formation/palEgra_WordFormation.stories.js +48 -48
- package/dist/collection/stories/Templates/palStorytale/palStorytale.stories.js +18 -18
- package/dist/collection/stories/Templates/phonic-tractor/phonic-tractor.stories.js +44 -44
- package/dist/collection/stories/Templates/pictureClues/pictureClues.stories.js +34 -34
- package/dist/collection/stories/Templates/pictureWordMatch/pictureWordMatch1.stories.js +36 -36
- package/dist/collection/stories/Templates/pictureWordMatch/pictureWordMatch2.stories.js +30 -30
- package/dist/collection/stories/Templates/picturemeaning/pictureMeaningCocos.stories.js +20 -20
- package/dist/collection/stories/Templates/puzzleGame/puzzleGame.stories.js +17 -17
- package/dist/collection/stories/Templates/questionBoard/questionBoard.stories.js +58 -58
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracy.stories.js +50 -50
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWithText.stories.js +36 -36
- package/dist/collection/stories/Templates/quizLiteracy/quizLiteracyImageWord.stories.js +43 -43
- package/dist/collection/stories/Templates/quizMaths/quizMaths.stories.js +631 -631
- package/dist/collection/stories/Templates/reorder/reorder.stories.js +63 -63
- package/dist/collection/stories/Templates/rowBlocks/rowBlocks.stories.js +47 -47
- package/dist/collection/stories/Templates/sentenceMatch/sentenceMatch.stories.js +29 -29
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox1.stories.js +64 -64
- package/dist/collection/stories/Templates/sequenceBox/sequenceBox2.stories.js +62 -62
- package/dist/collection/stories/Templates/shapePair/shape-pair.stories.js +106 -106
- package/dist/collection/stories/Templates/shapeTractor/shape-tractor.stories.js +50 -50
- package/dist/collection/stories/Templates/spellDoor/spellDoor.stories.js +41 -41
- package/dist/collection/stories/Templates/storyTale/storyTale.stories.js +39 -39
- package/dist/collection/stories/Templates/substraction/substractionWithimg.stories.js +62 -62
- package/dist/collection/stories/Templates/substraction/substractionWithoutImg.stories.js +42 -42
- package/dist/collection/stories/Templates/sumTogether/sumTogether.stories.js +50 -50
- package/dist/collection/stories/Templates/tenBox/tenBox.stories.js +88 -88
- package/dist/collection/stories/Templates/total/total.stories.js +28 -28
- package/dist/collection/stories/Templates/wordBuilding/wordBuildingwithimg.stories.js +35 -35
- package/dist/collection/stories/Templates/wordBuilding/wordBuildingwithoutimg.stories.js +34 -34
- package/dist/collection/stories/Templates/writeCard/writeCard.stories.js +31 -31
- package/dist/collection/stories/Templates/writeLetter/writeLetter.stories.js +58 -58
- package/dist/collection/stories/Templates/writeNumber/writeNumber.stories.js +44 -44
- package/dist/collection/stories/Templates/writeSet/writeSet.stories.js +31 -31
- package/dist/collection/stories/Templates/writeWord/writeWord.stories.js +34 -34
- package/dist/collection/stories/components/flash-card.stories.js +48 -48
- package/dist/collection/stories/components/keyboard.stories.js +10 -10
- package/dist/collection/stories/components/slider.stories.js +4 -4
- package/dist/collection/stories/components/trace.stories.js +5 -5
- package/dist/collection/utils/utils.js +26 -17
- package/dist/collection/utils/utilsHandlers/dragDropHandler.js +36 -16
- package/dist/collection/utils/utilsHandlers/highlightHandler.js +54 -54
- package/dist/collection/utils/utilsHandlers/slideHandler.js +80 -23
- package/dist/collection/utils/utilsHandlers/sortHandler.js +10 -10
- package/dist/components/index.js +1 -1
- package/dist/components/lido-avatar.js +1 -1
- package/dist/components/lido-balance.js +1 -1
- package/dist/components/lido-calculator.js +1 -1
- package/dist/components/lido-canvas.js +1 -1
- package/dist/components/lido-cell.js +1 -1
- package/dist/components/lido-col.js +1 -1
- package/dist/components/lido-container.js +1 -1
- package/dist/components/lido-flash-card.js +1 -1
- package/dist/components/lido-float.js +1 -1
- package/dist/components/lido-home.js +1 -1
- package/dist/components/lido-keyboard.js +1 -1
- package/dist/components/lido-math-matrix.js +1 -1
- package/dist/components/lido-pos.js +1 -1
- package/dist/components/lido-random.js +1 -1
- package/dist/components/lido-root.js +1 -1
- package/dist/components/lido-row.js +1 -1
- package/dist/components/lido-shape.js +1 -1
- package/dist/components/lido-slide-fill.js +1 -1
- package/dist/components/lido-text.js +1 -1
- package/dist/components/lido-trace.js +1 -1
- package/dist/components/lido-wrap.js +1 -1
- package/dist/components/{p-CCR42e0i.js → p-BE25wHoo.js} +1 -1
- package/dist/components/p-BNNX1Pew.js +12 -0
- package/dist/components/p-BSV5U72F.js +1 -0
- package/dist/components/{p-CTlcpv4a.js → p-BfwUqpXc.js} +1 -1
- package/dist/components/{p-CgsPIpg0.js → p-Bw-OC9iR.js} +1 -1
- package/dist/components/{p-C5WmmkI6.js → p-CPYnt0P-.js} +1 -1
- package/dist/components/p-CTlwn9r7.js +1 -0
- package/dist/components/{p-CIbBOu51.js → p-Cj-6tqzU.js} +1 -1
- package/dist/components/{p-BfqihbR6.js → p-CjdDpXfk.js} +1 -1
- package/dist/components/{p-BeRr8u5m.js → p-CwDTdXe5.js} +1 -1
- package/dist/components/{p-CXHPZN3m.js → p-CyGxEcn7.js} +1 -1
- package/dist/components/p-D-B1groh.js +1 -0
- package/dist/components/{p-DuvxecDX.js → p-D54c-ybm.js} +1 -1
- package/dist/components/p-DbR5sNOj.js +1 -0
- package/dist/components/{p-B8nzzM8c.js → p-DdQ1eqJr.js} +1 -1
- package/dist/components/{p-CxkH5UIf.js → p-SPZTb5fI.js} +1 -1
- package/dist/components/{p-BBHM059l.js → p-Sl9R-E6h.js} +1 -1
- package/dist/components/p-leIEepjl.js +1 -0
- package/dist/components/{p-C70ykycD.js → p-useuhkjH.js} +1 -1
- package/dist/components/{p-BXvoOUIv.js → p-yT7udDfd.js} +1 -1
- package/dist/esm/{decode-To5V_Qqp.js → decode-BgBfbPZu.js} +1 -1
- package/dist/esm/{index-Dnvog_Mm.js → index-BeHFCsWf.js} +53 -12
- package/dist/esm/{index-CEJsA_x_.js → index-D-29PaRa.js} +185 -86
- package/dist/esm/index.js +2 -2
- package/dist/esm/lido-avatar_22.entry.js +61 -68
- package/dist/esm/lido-player.js +4 -4
- package/dist/esm/loader.js +3 -3
- package/dist/lido-player/assets/Shadow.svg +9 -9
- package/dist/lido-player/assets/Tracing-hand.svg +8 -8
- package/dist/lido-player/index.esm.js +1 -1
- package/dist/lido-player/lido-avatar.css +4 -4
- package/dist/lido-player/lido-avatar.tsx +207 -207
- package/dist/lido-player/lido-player.css +7 -7
- package/dist/lido-player/lido-player.esm.js +1 -1
- package/dist/lido-player/{p-3b6e3b51.entry.js → p-856e1956.entry.js} +3 -3
- package/dist/lido-player/{p-DUx4nii8.js → p-BA2X6O7O.js} +1 -1
- package/dist/lido-player/p-BeHFCsWf.js +3 -0
- package/dist/lido-player/p-TuBmCgtK.js +1 -0
- package/dist/lido-player/readme.md +49 -49
- package/dist/types/components/text/lido-text.d.ts +6 -1
- package/dist/types/components/trace/lido-trace.d.ts +1 -1
- package/dist/types/components.d.ts +11 -0
- package/dist/types/stencil-public-runtime.d.ts +12 -0
- package/dist/types/types/json.d.ts +3 -3
- package/dist/types/utils/utilsHandlers/slideHandler.d.ts +5 -0
- package/loader/index.d.ts +1 -1
- package/package.json +74 -73
- package/readme.md +113 -113
- package/dist/components/p-CwIlwnQk.js +0 -1
- package/dist/components/p-DBbLGy4y.js +0 -12
- package/dist/components/p-DLyacZap.js +0 -1
- package/dist/components/p-DONbWJGn.js +0 -1
- package/dist/components/p-DVTigdH_.js +0 -1
- package/dist/components/p-Dv1cIsyS.js +0 -1
- package/dist/lido-player/p-Dnvog_Mm.js +0 -2
- package/dist/lido-player/p-gkKsw3a6.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,p as i,H as e,B as s,getAssetPath as n,c as o,k as r,E as a,F as h,s as l,f as c,w as d,g as u,j as f,a as w,h as g,b as m}from"./index.js";const p=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.showSpeakIcon=!1,this.id="",this.svgSource="",this.svgUrls=[],this.audioUrls=[],this.currentSvgIndex=0,this.moving=!1,this.value="",this.height="auto",this.width="auto",this.audio="",this.x="0px",this.y="0px",this.z="0",this.ariaLabel="",this.ariaHidden="",this.tabIndex=0,this.mode=s.ShowFlow,this.fingerHintUrl=n("assets/Tracing-hand.svg"),this.highlightTextId="",this.animationTrace=!1,this.delayVisible="",this.disableSpeak=!1,this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles(),this.fileIndex=-1,this.isDragging=!1,this.activePointerId=null,this.freeTraceUpdateCounter=0,this.idleTimer=null,this.fingerImg=null}async initializeSVG(){let t={fileIndex:-1,currentPathIndex:0,lastLength:0,totalPathLength:0,isDragging:!1,circle:null,paths:[],svg:null,proximityThreshold:60,freeTraceProximityThreshold:350,rafId:null,pointerMoveEvent:null,activePointerId:null,mode:this.mode,flowMarkers:[],freeTraceLines:[],currentFreePath:[],lastPointerPos:null,dragOffset:null,isCompletingPath:!1,touchProximityThreshold:null};const i=this.svgUrls[this.currentSvgIndex];i&&""!==i.trim()?(await this.fetchSVG(o(i)),await this.loadAnotherSVG(t,!0)):console.error("No SVG URL provided or index out of bounds.")}componentDidLoad(){r(this.el,this.delayVisible)}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad),this.svgUrls=this.svgSource.split(";").map((t=>t.trim())),this.currentSvgIndex=0,this.showSpeakIcon&&(a(this.el),this.el.append(a(this.el))),this.initializeSVG()}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}resetIdleTimer(t){null!==this.idleTimer&&(clearTimeout(this.idleTimer),this.idleTimer=null),this.idleTimer=window.setTimeout((()=>{this.showFingerHint(t)}),3e3)}showFingerHint(t){var i;if(this.fingerImg)return;const e=t.paths[t.currentPathIndex];if(!e)return;const s=document.createElementNS("http://www.w3.org/2000/svg","image"),n=new Image;n.onload=()=>{s.setAttributeNS("http://www.w3.org/1999/xlink","href",o(this.fingerHintUrl))},n.onerror=()=>{s.setAttributeNS("http://www.w3.org/1999/xlink","href",o(h))},n.src=o(this.fingerHintUrl||h),s.setAttribute("width","40"),s.setAttribute("height","40"),s.setAttribute("id","lido-finger-hint"),s.style.pointerEvents="none",s.style.opacity="0.8",s.setAttribute("x","0"),s.setAttribute("y","0");const r=document.createElementNS("http://www.w3.org/2000/svg","animateMotion");r.setAttribute("dur","2s"),r.setAttribute("repeatCount","indefinite");const a=document.createElementNS("http://www.w3.org/2000/svg","mpath");a.setAttributeNS("http://www.w3.org/1999/xlink","href",`#${e.id}`),r.appendChild(a),s.appendChild(r),null===(i=t.svg)||void 0===i||i.appendChild(s),this.fingerImg=s}hideFingerHint(){this.fingerImg&&this.fingerImg.parentNode&&this.fingerImg.parentNode.removeChild(this.fingerImg),this.fingerImg=null}async fetchSVG(t){const i=await fetch(t);if(!i.ok)throw new Error(`Failed to fetch SVG (${t}): ${i.statusText}`);return await i.text()}calculateBoundingBox(t,i=22){let e=1/0,s=1/0,n=-1/0,o=-1/0;return t.forEach((t=>{const i=t.getTotalLength();for(let r=0;r<=100;r++){const a=t.getPointAtLength(r/100*i);a.x<e&&(e=a.x),a.y<s&&(s=a.y),a.x>n&&(n=a.x),a.y>o&&(o=a.y)}})),e-=i,s-=i,n+=i,o+=i,{minX:e,minY:s,maxX:n,maxY:o}}insertSVG(t){const i=document.getElementById("lido-svgContainer");if(!i)return;i.innerHTML=t;const e=i.querySelector("svg");e.classList.add("lido-trace-svg"),e.removeAttribute("width"),e.removeAttribute("height");const s=e.querySelectorAll("path, line"),n=this.calculateBoundingBox(Array.from(s));e.setAttribute("viewBox",`${n.minX} ${n.minY} ${n.maxX-n.minX} ${n.maxY-n.minY}`)}getSVGElement(){return document.getElementById("lido-svgContainer").querySelector("svg")}getPaths(t){return Array.from(t.querySelectorAll("path, line"))}createFlowMarkersForPath(t){var i;if(!t)return;const e=t.ownerSVGElement;if(!e)return;const s=document.createElementNS("http://www.w3.org/2000/svg","path");s.setAttribute("d",t.getAttribute("d")||""),s.setAttribute("stroke","blue"),s.setAttribute("stroke-width","2"),s.setAttribute("stroke-dasharray","6,6"),s.setAttribute("fill","none"),s.setAttribute("class","lido-flow-indicator"),null===(i=t.parentNode)||void 0===i||i.appendChild(s);let n=e.querySelector("defs#lido-flow-defs");n||(n=document.createElementNS("http://www.w3.org/2000/svg","defs"),n.setAttribute("id","lido-flow-defs"),e.insertBefore(n,e.firstChild));const o=`arrow-${Math.random().toString(36)}`,r=document.createElementNS("http://www.w3.org/2000/svg","marker");r.setAttribute("id",o),r.setAttribute("markerWidth","10"),r.setAttribute("markerHeight","10"),r.setAttribute("refX","5"),r.setAttribute("refY","5"),r.setAttribute("orient","auto"),r.setAttribute("markerUnits","strokeWidth");const a=document.createElementNS("http://www.w3.org/2000/svg","path");return a.setAttribute("d","M0,0 L10,5 L0,10 L2,5 Z"),a.setAttribute("fill","blue"),r.appendChild(a),n.appendChild(r),s.setAttribute("marker-end",`url(#${o})`),s}updateFlowIndicators(t){t.svg.querySelectorAll(".lido-flow-indicator").forEach((i=>{t.mode===s.NoFlow?i.style.display="none":t.mode===s.ShowFlow&&(i.style.display="block")}))}setupDrawingPath(t){t.paths.forEach(((i,e)=>{const n=i.getTotalLength();i._lidoTraceLength=n,i._lidoTraceStart=i.getPointAtLength(0),i._lidoTraceEnd=i.getPointAtLength(n),i._lidoTraceIsClosed=this.getDistanceSquared(i._lidoTraceStart,i._lidoTraceEnd)<200,i.setAttribute("id","lido-path-"+e);const o=i.cloneNode();o.style.opacity="100",o.style["stroke-opacity"]="100";const r=i.style["stroke-width"]||i.getAttribute("stroke-width");o.setAttribute("stroke-width",r),o.setAttribute("stroke-dasharray",n.toString()),o.setAttribute("stroke-dashoffset",n.toString()),i.parentNode.appendChild(o,i),i.setAttribute("class","lido-trace-path"),o.setAttribute("class","lido-trace-path-green"),i.greenPath=o,i.classList.add(t.mode),t.mode===s.BlindTracing||t.mode===s.BlindFreeTrace?i.setAttribute("stroke","none"):(i.setAttribute("stroke","#000"),i.setAttribute("stroke-width",r),i.setAttribute("fill","none"),i.setAttribute("stroke-dasharray",n.toString()),i.setAttribute("stroke-dashoffset","0")),e===t.currentPathIndex&&t.mode===s.ShowFlow&&(t.flowMarkers=this.createFlowMarkersForPath(i))})),t.totalPathLength=t.paths[t.currentPathIndex].getTotalLength()}setupDraggableCircle(t){var i;const e=t.paths[0].getPointAtLength(0),s=document.createElementNS("http://www.w3.org/2000/svg","circle");t.paths[t.currentPathIndex].style["stroke-width"]||t.paths[t.currentPathIndex].getAttribute("stroke-width"),s.setAttribute("id","lido-draggableCircle"),s.setAttribute("cx",e.x.toString()),s.setAttribute("cy",e.y.toString()),s.setAttribute("r","20"),s.setAttribute("fill","#CF1565"),null===(i=t.svg)||void 0===i||i.appendChild(s),t.circle=s,this.resetIdleTimer(t)}addEventListeners(t){var i,e,s,n;if(!t.circle||!t.paths||0===t.paths.length)return;t.svg.style.touchAction="none",t.circle.style.touchAction="none",t.circle.addEventListener("pointerdown",(i=>{i.preventDefault();const e=this.getPointerPosition(i,t.svg),s={x:parseFloat(t.circle.getAttribute("cx")),y:parseFloat(t.circle.getAttribute("cy"))},n=this.getDistanceSquared(e,s),o=this.getProximityThresholdForEvent(t,i);if(n<=o*o||"touch"===i.pointerType){t.isDragging=!0,t.activePointerId=i.pointerId,t.dragOffset={x:e.x-s.x,y:e.y-s.y};try{t.circle.setPointerCapture(i.pointerId)}catch(t){}t.lastPointerPos=s}this.hideFingerHint(),this.resetIdleTimer(t)}),{passive:!1}),null===(i=t.svg)||void 0===i||i.addEventListener("pointermove",(i=>{t.isDragging&&i.pointerId===t.activePointerId&&(i.preventDefault(),t.pointerMoveEvent=i,t.rafId||(t.rafId=requestAnimationFrame((()=>{this.handlePointerMove(t),t.rafId=null}))))}));const o=i=>{i.pointerId===t.activePointerId&&(t.isDragging=!1,t.activePointerId=null,t.lastPointerPos=null,t.dragOffset=null,this.hideFingerHint(),this.resetIdleTimer(t))};null===(e=t.svg)||void 0===e||e.addEventListener("pointerup",o),null===(s=t.svg)||void 0===s||s.addEventListener("pointercancel",o),null===(n=t.svg)||void 0===n||n.addEventListener("contextmenu",(t=>{t.preventDefault()}))}async handlePointerMove(t){var i,e,n,o,r;if(!t.isDragging)return;if(!t.circle||!t.paths||0===t.paths.length)return;if(t.isCompletingPath)return;this.hideFingerHint();const a=t.pointerMoveEvent,h=this.getPointerPosition(a,t.svg),l=t.dragOffset?{x:h.x-t.dragOffset.x,y:h.y-t.dragOffset.y}:h,c={x:parseFloat(t.circle.getAttribute("cx")),y:parseFloat(t.circle.getAttribute("cy"))};let d=1/0;if(t.lastPointerPos){const i=l.x-t.lastPointerPos.x,e=l.y-t.lastPointerPos.y;if(d=i*i+e*e,d<1)return}const u=t.paths[t.currentPathIndex];if(!u)return void console.error("No valid path found at the current index");const f=this.getProximityThresholdForEvent(t,a),w=f*f;if(this.getDistanceSquared(l,c)>w)return;const g=t.mode===s.FreeTrace||t.mode===s.BlindFreeTrace,m=this.getClosestPointOnPath(u,l,g?void 0:t.lastLength);if(this.getDistanceSquared(l,m)>w)return;if(g){if(this.freeTraceUpdateCounter=(this.freeTraceUpdateCounter||0)+1,this.freeTraceUpdateCounter%2!=0)return;if(t.currentFreePath||(t.currentFreePath=[]),!t.currentFreePath[t.currentPathIndex]){const e=document.createElementNS("http://www.w3.org/2000/svg","polyline"),s=t.paths[t.currentPathIndex].style["stroke-width"]||t.paths[t.currentPathIndex].getAttribute("stroke-width");e.setAttribute("stroke-width",s),e.setAttribute("fill","none"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke","lightgreen"),e.setAttribute("points",`${l.x},${l.y}`),null===(i=t.svg)||void 0===i||i.appendChild(e),t.currentFreePath[t.currentPathIndex]=e,t.currentFreePolylinePoints=t.currentFreePolylinePoints||[],t.currentFreePolylinePoints[t.currentPathIndex]=[{x:l.x,y:l.y}],t.lastPointerPos=l,t.freeTracePointsCount=1}const s=10;if(t.freeTracePointsCount=(t.freeTracePointsCount||1)+1,t.freeTracePointsCount>s)return;t.currentFreePolylinePoints=t.currentFreePolylinePoints||[];let n=t.currentFreePolylinePoints[t.currentPathIndex]||[];n.push({x:l.x,y:l.y}),t.currentFreePolylinePoints[t.currentPathIndex]=n;const o=n.map((t=>`${t.x},${t.y}`)).join(" ");return t.currentFreePath[t.currentPathIndex].setAttribute("points",o),t.circle.setAttribute("cx",l.x.toString()),t.circle.setAttribute("cy",l.y.toString()),t.circle.parentNode!==t.svg&&(null===(e=t.svg)||void 0===e||e.appendChild(t.circle)),t.lastPointerPos=l,void(n.length>=s&&(this.moveToNextPath(t),t.currentFreePath[t.currentPathIndex]=null,t.currentFreePolylinePoints[t.currentPathIndex]=[],t.freeTracePointsCount=0))}const p=Math.min(320,Math.max(160,.45*t.totalPathLength)),v=Math.min(60,Math.max(24,.12*t.totalPathLength));let x=m,y=x.length>=t.lastLength-20&&x.length-t.lastLength<=80;if(!y){const i=this.getClosestPointOnPath(u,l),e=this.getDistanceSquared(l,i);d>=64&&e<=w&&i.length>=t.lastLength-20&&i.length-t.lastLength<=p&&i.length<t.totalPathLength-v&&(x=i,y=!0)}if(t.isDragging&&y)if(t.lastLength=Math.max(t.lastLength,x.length),t.lastPointerPos=l,(Math.abs(x.x-c.x)>1||Math.abs(x.y-c.y)>1)&&(t.circle.setAttribute("cx",x.x.toString()),t.circle.setAttribute("cy",x.y.toString())),t.circle.parentNode!==t.svg&&(null===(n=t.svg)||void 0===n||n.appendChild(t.circle)),null===(o=u.greenPath)||void 0===o||o.setAttribute("stroke-dashoffset",(t.totalPathLength-t.lastLength).toString()),null!==(r=u._lidoTraceIsClosed)&&void 0!==r&&r&&t.totalPathLength>50){if(t.lastLength/t.totalPathLength>=.95){if(t.isCompletingPath)return;t.isCompletingPath=!0,await this.animatePathToEnd(t,u),t.currentPathIndex<t.paths.length-1?this.moveToNextPath(t):t.currentPathIndex===t.paths.length-1&&this.moveToNextContainer()}}else if(t.totalPathLength-1-t.lastLength<5&&t.currentPathIndex<t.paths.length-1){if(t.isCompletingPath)return;t.isCompletingPath=!0,this.moveToNextPath(t)}else if(t.totalPathLength-1-t.lastLength<5&&t.currentPathIndex===t.paths.length-1){if(t.isCompletingPath)return;t.isCompletingPath=!0,this.moveToNextContainer()}}animatePathToEnd(t,i,e=300){if(!i||!t.svg)return Promise.resolve();if(t._animatingToEnd)return Promise.resolve();t._animatingToEnd=!0;const s=t.lastLength||0,n=i.getTotalLength(),o=performance.now(),r=i.greenPath||i.parentNode&&i.parentNode.querySelector(".lido-trace-path-green");return new Promise((a=>{const h=l=>{const c=Math.min(1,(l-o)/e),d=s+(n-s)*c;t.lastLength=d;const u=i.getPointAtLength(d);if(t.circle&&(t.circle.setAttribute("cx",u.x.toString()),t.circle.setAttribute("cy",u.y.toString())),r&&r.setAttribute("stroke-dashoffset",(t.totalPathLength-d).toString()),c<1)requestAnimationFrame(h);else{if(t.lastLength=n,t.circle){const e=i.getPointAtLength(n);t.circle.setAttribute("cx",e.x.toString()),t.circle.setAttribute("cy",e.y.toString())}r&&r.setAttribute("stroke-dashoffset","0"),t._animatingToEnd=!1,a()}};requestAnimationFrame(h)}))}async moveToNextContainer(){if(this.isDragging=!1,this.moving)return;if(this.moving=!0,this.highlightTextId&&this.highlightLetter(this.currentSvgIndex),this.animationTrace&&await this.playTraceAnimation(),l(!0),this.currentSvgIndex<this.svgUrls.length-1)return await new Promise((t=>setTimeout(t,1e3))),this.currentSvgIndex++,await this.initializeSVG(),document.getElementById("lido-svgContainer").style.visibility="visible",this.moving=!1,void(this.el&&this.onCorrect&&await c(this.onCorrect,this.el));const t=document.querySelector(d),i=t.getAttribute("onCorrect");t&&i&&(await new Promise((t=>setTimeout(t,1e3))),await c(i,this.el)),u(),f()}getPointerPosition(t,i){var e;const s=this.getPointerPositionFromViewBox(t,i);if(s)return s;const n=i.createSVGPoint();n.x=t.clientX,n.y=t.clientY;const o=null===(e=i.getScreenCTM())||void 0===e?void 0:e.inverse();return o?n.matrixTransform(o):{x:t.clientX,y:t.clientY}}getPointerPositionFromViewBox(t,i){const e=i.getBoundingClientRect(),s=i.viewBox.baseVal;if(!(e.width&&e.height&&s.width&&s.height))return null;const{offsetX:n,offsetY:o,scaleX:r,scaleY:a}=this.getSvgViewBoxTransform(i,e);return{x:s.x+(t.clientX-e.left-n)/r,y:s.y+(t.clientY-e.top-o)/a}}getSvgViewBoxTransform(t,i=t.getBoundingClientRect()){const e=t.viewBox.baseVal,s=t.preserveAspectRatio.baseVal,n=i.width/e.width,o=i.height/e.height;if(1===s.align)return{offsetX:0,offsetY:0,scaleX:n,scaleY:o};const r=2===s.meetOrSlice?Math.max(n,o):Math.min(n,o),a=e.width*r,h=e.height*r;let l=0,c=0;const d=s.align;return 3===d||6===d||9===d?l=(i.width-a)/2:4!==d&&7!==d&&10!==d||(l=i.width-a),5===d||6===d||7===d?c=(i.height-h)/2:8!==d&&9!==d&&10!==d||(c=i.height-h),{offsetX:l,offsetY:c,scaleX:r,scaleY:r}}getProximityThresholdForEvent(t,i){const e=t.mode===s.FreeTrace||t.mode===s.BlindFreeTrace?t.freeTraceProximityThreshold:t.proximityThreshold;if("touch"!==(null==i?void 0:i.pointerType)||!t.svg)return e;const n=t.svg.getBoundingClientRect(),o=t.svg.viewBox.baseVal;if(!(n.width&&n.height&&o.width&&o.height))return e;const{scaleX:r,scaleY:a}=this.getSvgViewBoxTransform(t.svg,n),h=44*Math.max(1/r,1/a);return Math.max(e,h)}getDistanceSquared(t,i){const e=t.x-i.x,s=t.y-i.y;return e*e+s*s}getClosestPointOnPath(t,i,e){var s;const n=null!==(s=t._lidoTraceLength)&&void 0!==s?s:t.getTotalLength();let o={x:0,y:0,length:0},r=1/0,a=0,h=n;void 0!==e&&(a=Math.max(0,e-150),h=Math.min(n,e+150));let l={length:a};for(let e=a;e<=h;e+=40){const s=t.getPointAtLength(e),n=this.getDistanceSquared(i,s);n<r&&(r=n,l={x:s.x,y:s.y,length:e})}const c=Math.max(0,l.length-40),d=Math.min(n,l.length+40);r=1/0;for(let e=c;e<=d;e+=6){const s=t.getPointAtLength(e),n=this.getDistanceSquared(i,s);n<r&&(r=n,o={x:s.x,y:s.y,length:e})}return o}async loadAnotherSVG(t,i){t.isDragging=!1;try{t.svg&&this.cleanupPreviousSVG(t);const i=await this.fetchSVG(o(this.svgSource.split(";").map((t=>t.trim()))[this.currentSvgIndex]));this.insertSVG(i),t.svg=this.getSVGElement(),this.mode!==s.BlindTracing&&this.mode!==s.BlindFreeTrace||t.svg.querySelectorAll("image").forEach((t=>{t.style.display="none"})),t.paths=this.getPaths(t.svg),this.setupDrawingPath(t),this.setupDraggableCircle(t),this.addEventListeners(t)}catch(t){console.error(`Error loading SVG (${this.svgSource}):`,t)}}cleanupPreviousSVG(t){var i,e;t.circle&&(null===(i=t.svg)||void 0===i||i.removeChild(t.circle),t.circle=null),(null===(e=t.svg)||void 0===e?void 0:e.querySelectorAll(".lido-flow-indicator")).forEach((t=>{t.remove()})),t.currentPathIndex=0,t.lastLength=0,t.totalPathLength=t.paths[0].getTotalLength(),this.hideFingerHint(),this.resetIdleTimer(t)}async moveToNextPath(t){var i,e;if(t.isDragging=!1,t.currentPathIndex++,t.lastLength=0,t.isCompletingPath=!1,this.hideFingerHint(),t.currentPathIndex>=t.paths.length)return void this.moveToNextContainer();const n=t.paths[t.currentPathIndex];if(!n)return void console.error("No valid path found at the next index");t.totalPathLength=n.getTotalLength();const o=n.getPointAtLength(0);null===(i=t.circle)||void 0===i||i.setAttribute("cx",o.x.toString()),null===(e=t.circle)||void 0===e||e.setAttribute("cy",o.y.toString()),t.mode===s.ShowFlow&&(t.flowMarkers=this.createFlowMarkersForPath(n)),this.resetIdleTimer(t)}async playTraceAnimation(){const t=document.getElementById(this.id);t&&(t.classList.add("trace-animate"),await new Promise((t=>setTimeout(t,500))),t.classList.remove("trace-animate"))}async highlightLetter(t){if(!document.getElementById(d))return;const i=this.el;if(!i)return;const e=this.highlightTextId;if(!e)return;const s=document.getElementById(e);if(!s)return;const n=this.audio;if(!n)return;this.audioUrls=n.split(";").map((t=>t.trim()));const r=s.getAttribute("span-type");if(!r)return;const a=s.querySelector(".lido-text-content");if(a){if("letters"===r){const e=a.querySelectorAll(".text-letters");if(t<0||t>=e.length)return;const n=e[t];if(n){const t=i.querySelector("#lido-svgContainer");if(await c("this.alignMatch='true';",s,t),t.style.animation="trace-animation 0.4s forwards",t.style.setProperty("--trace-width",n.offsetWidth-5+"px"),t.style.setProperty("--trace-height",n.offsetHeight-5+"px"),await c("this.alignMatch='true';",n,t),setTimeout((()=>{n.classList.add("letter-highlight"),t.style.transform="",t.style.animation="",t.style.visibility="hidden"}),500),this.audioUrls[this.currentSvgIndex]){const t=new Audio(o(this.audioUrls[this.currentSvgIndex]));await t.play()}}}if("words"===r){const i=a.querySelectorAll(".text-words");if(t<0||t>=i.length)return;const e=i[t];if(e&&(e.classList.add("word-highlight"),this.audioUrls[this.currentSvgIndex])){const t=new Audio(o(this.audioUrls[this.currentSvgIndex]));await t.play()}}}}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:w(this.height,t),width:w(this.width,t),top:w(this.y,t),left:w(this.x,t),zIndex:this.z}}render(){return g(m,{key:"4955636a199ba56ca7f6d73144aca42ab4e3f411",class:"lido-trace",id:this.id,audio:this.audio,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,tabindex:this.tabIndex,"disable-speak":this.disableSpeak},g("div",{key:"b732946e97fefb0d4cb192e5c9b6863568ff64be",style:this.style,id:"lido-svgContainer"}))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{svgSource:[{initializeSVG:0}],mode:[{initializeSVG:0}]}}static get style(){return":host{display:block;position:relative}#lido-svgContainer{display:flex;justify-content:center;align-items:center;overflow:hidden}.lido-trace-svg{width:100%;height:100%;touch-action:none}#lido-draggableCircle{cursor:pointer;fill:#CF1565;transition:fill 0.2s, r 0.2s}.lido-blindTracing{stroke:none !important}.lido-blindFreeTrace{stroke:none !important}.lido-hovered{cursor:grab;fill:darkred}#lido-controls{position:fixed;bottom:0;left:0;right:0;display:flex;justify-content:space-between;padding:10px;background-color:#f0f0f0;border-top:1px solid #ccc}button{padding:10px;font-size:16px}@media (max-width: 600px){button{padding:8px;font-size:14px}}.lido-trace-path-green{}.lido-flow-indicator{stroke:blue;stroke-width:2;stroke-dasharray:6, 6;fill:none}.lido-trace{height:700px;width:700px;z-index:1;justify-items:center;align-content:center}.trace-animate{animation:trace-bounce 0.5s}@keyframes trace-bounce{0%{transform:scale(1)}30%{transform:scale(1.05)}60%{transform:scale(0.95)}100%{transform:scale(1)}}"}},[0,"lido-trace",{showSpeakIcon:[4,"show-speak-icon"],id:[1],svgSource:[1,"svg-source"],value:[1],height:[1],width:[1],audio:[1],x:[1],y:[1],z:[1],ariaLabel:[1,"aria-label"],ariaHidden:[1,"aria-hidden"],tabIndex:[2,"tab-index"],mode:[1],fingerHintUrl:[1,"finger-hint-url"],onInCorrect:[1,"on-in-correct"],onCorrect:[1,"on-correct"],highlightTextId:[1,"highlight-text-id"],animationTrace:[4,"animation-trace"],delayVisible:[1,"delay-visible"],disableSpeak:[4,"disable-speak"],svgUrls:[32],audioUrls:[32],currentSvgIndex:[32],moving:[32],style:[32],fileIndex:[32],isDragging:[32],activePointerId:[32],idleTimer:[32],fingerImg:[32]},void 0,{svgSource:[{initializeSVG:0}],mode:[{initializeSVG:0}]}]);function v(){"undefined"!=typeof customElements&&["lido-trace"].forEach((i=>{"lido-trace"===i&&(customElements.get(t(i))||customElements.define(t(i),p))}))}v();export{p as L,v as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as i,H as e,k as s,i as o,m as n,a3 as r,c as a,a as h,h as l,b as u,Y as c}from"./index.js";const d=t=>"string"==typeof t,g=()=>{let t,i;const e=new Promise(((e,s)=>{t=e,i=s}));return e.resolve=t,e.reject=i,e},p=t=>null==t?"":""+t,f=/###/g,m=t=>t&&t.indexOf("###")>-1?t.replace(f,"."):t,y=t=>!t||d(t),b=(t,i,e)=>{const s=d(i)?i.split("."):i;let o=0;for(;o<s.length-1;){if(y(t))return{};const i=m(s[o]);!t[i]&&e&&(t[i]=new e),t=Object.prototype.hasOwnProperty.call(t,i)?t[i]:{},++o}return y(t)?{}:{obj:t,k:m(s[o])}},w=(t,i,e)=>{const{obj:s,k:o}=b(t,i,Object);if(void 0!==s||1===i.length)return void(s[o]=e);let n=i[i.length-1],r=i.slice(0,i.length-1),a=b(t,r,Object);for(;void 0===a.obj&&r.length;)n=`${r[r.length-1]}.${n}`,r=r.slice(0,r.length-1),a=b(t,r,Object),a?.obj&&void 0!==a.obj[`${a.k}.${n}`]&&(a.obj=void 0);a.obj[`${a.k}.${n}`]=e},v=(t,i)=>{const{obj:e,k:s}=b(t,i);if(e&&Object.prototype.hasOwnProperty.call(e,s))return e[s]},x=(t,i,e)=>{for(const s in i)"__proto__"!==s&&"constructor"!==s&&(s in t?d(t[s])||t[s]instanceof String||d(i[s])||i[s]instanceof String?e&&(t[s]=i[s]):x(t[s],i[s],e):t[s]=i[s]);return t},$=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var k={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const A=t=>d(t)?t.replace(/[&<>"'\/]/g,(t=>k[t])):t,S=[" ",",","?","!",";"],E=new class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const i=this.regExpMap.get(t);if(void 0!==i)return i;const e=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,e),this.regExpQueue.push(t),e}}(20),I=(t,i,e=".")=>{if(!t)return;if(t[i]){if(!Object.prototype.hasOwnProperty.call(t,i))return;return t[i]}const s=i.split(e);let o=t;for(let t=0;t<s.length;){if(!o||"object"!=typeof o)return;let i,n="";for(let r=t;r<s.length;++r)if(r!==t&&(n+=e),n+=s[r],i=o[n],void 0!==i){if(["string","number","boolean"].indexOf(typeof i)>-1&&r<s.length-1)continue;t+=r-t+1;break}o=i}return o},W=t=>t?.replace(/_/g,"-"),O={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,i){console?.[t]?.apply?.(console,i)}};class j{constructor(t,i={}){this.init(t,i)}init(t,i={}){this.prefix=i.prefix||"i18next:",this.logger=t||O,this.options=i,this.debug=i.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,i,e,s){return s&&!this.debug?null:(d(t[0])&&(t[0]=`${e}${this.prefix} ${t[0]}`),this.logger[i](t))}create(t){return new j(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new j(this.logger,t)}}var L=new j;class P{constructor(){this.observers={}}on(t,i){return t.split(" ").forEach((t=>{this.observers[t]||(this.observers[t]=new Map);const e=this.observers[t].get(i)||0;this.observers[t].set(i,e+1)})),this}off(t,i){this.observers[t]&&(i?this.observers[t].delete(i):delete this.observers[t])}emit(t,...i){this.observers[t]&&Array.from(this.observers[t].entries()).forEach((([t,e])=>{for(let s=0;s<e;s++)t(...i)})),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach((([e,s])=>{for(let o=0;o<s;o++)e.apply(e,[t,...i])}))}}class M extends P{constructor(t,i={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=i,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const i=this.options.ns.indexOf(t);i>-1&&this.options.ns.splice(i,1)}getResource(t,i,e,s={}){const o=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,n=void 0!==s.ignoreJSONStructure?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let r;t.indexOf(".")>-1?r=t.split("."):(r=[t,i],e&&(Array.isArray(e)?r.push(...e):d(e)&&o?r.push(...e.split(o)):r.push(e)));const a=v(this.data,r);return!a&&!i&&!e&&t.indexOf(".")>-1&&(t=r[0],i=r[1],e=r.slice(2).join(".")),!a&&n&&d(e)?I(this.data?.[t]?.[i],e,o):a}addResource(t,i,e,s,o={silent:!1}){const n=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let r=[t,i];e&&(r=r.concat(n?e.split(n):e)),t.indexOf(".")>-1&&(r=t.split("."),s=i,i=r[1]),this.addNamespaces(i),w(this.data,r,s),o.silent||this.emit("added",t,i,e,s)}addResources(t,i,e,s={silent:!1}){for(const s in e)(d(e[s])||Array.isArray(e[s]))&&this.addResource(t,i,s,e[s],{silent:!0});s.silent||this.emit("added",t,i,e)}addResourceBundle(t,i,e,s,o,n={silent:!1,skipCopy:!1}){let r=[t,i];t.indexOf(".")>-1&&(r=t.split("."),s=e,e=i,i=r[1]),this.addNamespaces(i);let a=v(this.data,r)||{};n.skipCopy||(e=JSON.parse(JSON.stringify(e))),s?x(a,e,o):a={...a,...e},w(this.data,r,a),n.silent||this.emit("added",t,i,e)}removeResourceBundle(t,i){this.hasResourceBundle(t,i)&&delete this.data[t][i],this.removeNamespaces(i),this.emit("removed",t,i)}hasResourceBundle(t,i){return void 0!==this.getResource(t,i)}getResourceBundle(t,i){return i||(i=this.options.defaultNS),this.getResource(t,i)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const i=this.getDataByLanguage(t);return!!(i&&Object.keys(i)||[]).find((t=>i[t]&&Object.keys(i[t]).length>0))}toJSON(){return this.data}}var C={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,i,e,s,o){return t.forEach((t=>{i=this.processors[t]?.process(i,e,s,o)??i})),i}};const D=Symbol("i18next/PATH_KEY");function N(t,i){const{[D]:e}=t(function(){const t=[],i=Object.create(null);let e;return i.get=(s,o)=>(e?.revoke?.(),o===D?t:(t.push(o),e=Proxy.revocable(s,i),e.proxy)),Proxy.revocable(Object.create(null),i).proxy}()),s=i?.keySeparator??".",o=i?.nsSeparator??":";if(e.length>1&&o){const t=i?.ns,n=Array.isArray(t)?t:null;if(n&&n.length>1&&n.slice(1).includes(e[0]))return`${e[0]}${o}${e.slice(1).join(s)}`}return e.join(s)}const R={},T=t=>!d(t)&&"boolean"!=typeof t&&"number"!=typeof t;class K extends P{constructor(t,i={}){var e,s;super(),e=t,s=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((t=>{e[t]&&(s[t]=e[t])})),this.options=i,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=L.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,i={interpolation:{}}){const e={...i};if(null==t)return!1;const s=this.resolve(t,e);if(void 0===s?.res)return!1;const o=T(s.res);return!1!==e.returnObjects||!o}extractFromKey(t,i){let e=void 0!==i.nsSeparator?i.nsSeparator:this.options.nsSeparator;void 0===e&&(e=":");const s=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let o=i.ns||this.options.defaultNS||[];const n=e&&t.indexOf(e)>-1,r=!(this.options.userDefinedKeySeparator||i.keySeparator||this.options.userDefinedNsSeparator||i.nsSeparator||((t,i,e)=>{i=i||"",e=e||"";const s=S.filter((t=>i.indexOf(t)<0&&e.indexOf(t)<0));if(0===s.length)return!0;const o=E.getRegExp(`(${s.map((t=>"?"===t?"\\?":t)).join("|")})`);let n=!o.test(t);if(!n){const i=t.indexOf(e);i>0&&!o.test(t.substring(0,i))&&(n=!0)}return n})(t,e,s));if(n&&!r){const i=t.match(this.interpolator.nestingRegexp);if(i&&i.length>0)return{key:t,namespaces:d(o)?[o]:o};const n=t.split(e);(e!==s||e===s&&this.options.ns.indexOf(n[0])>-1)&&(o=n.shift()),t=n.join(s)}return{key:t,namespaces:d(o)?[o]:o}}translate(t,i,e){let s="object"==typeof i?{...i}:i;if("object"!=typeof s&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof s&&(s={...s}),s||(s={}),null==t)return"";"function"==typeof t&&(t=N(t,{...this.options,...s})),Array.isArray(t)||(t=[String(t)]),t=t.map((t=>"function"==typeof t?N(t,{...this.options,...s}):String(t)));const o=void 0!==s.returnDetails?s.returnDetails:this.options.returnDetails,n=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,{key:r,namespaces:a}=this.extractFromKey(t[t.length-1],s),h=a[a.length-1];let l=void 0!==s.nsSeparator?s.nsSeparator:this.options.nsSeparator;void 0===l&&(l=":");const u=s.lng||this.language,c=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===u?.toLowerCase())return c?o?{res:`${h}${l}${r}`,usedKey:r,exactUsedKey:r,usedLng:u,usedNS:h,usedParams:this.getUsedParamsDetails(s)}:`${h}${l}${r}`:o?{res:r,usedKey:r,exactUsedKey:r,usedLng:u,usedNS:h,usedParams:this.getUsedParamsDetails(s)}:r;const g=this.resolve(t,s);let p=g?.res;const f=g?.usedKey||r,m=g?.exactUsedKey||r,y=void 0!==s.joinArrays?s.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,w=void 0!==s.count&&!d(s.count),v=K.hasDefaultValue(s),x=w?this.pluralResolver.getSuffix(u,s.count,s):"",$=s.ordinal&&w?this.pluralResolver.getSuffix(u,s.count,{ordinal:!1}):"",k=w&&!s.ordinal&&0===s.count,A=k&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${x}`]||s[`defaultValue${$}`]||s.defaultValue;let S=p;b&&!p&&v&&(S=A);const E=T(S),I=Object.prototype.toString.apply(S);if(!(b&&S&&E&&["[object Number]","[object Function]","[object RegExp]"].indexOf(I)<0)||d(y)&&Array.isArray(S))if(b&&d(y)&&Array.isArray(p))p=p.join(y),p&&(p=this.extendTranslation(p,t,s,e));else{let i=!1,o=!1;!this.isValidLookup(p)&&v&&(i=!0,p=A),this.isValidLookup(p)||(o=!0,p=r);const a=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:p,c=v&&A!==p&&this.options.updateMissing;if(o||i||c){if(this.logger.log(c?"updateKey":"missingKey",u,h,r,c?A:p),n){const t=this.resolve(r,{...s,keySeparator:!1});t&&t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let t=[];const i=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if("fallback"===this.options.saveMissingTo&&i&&i[0])for(let e=0;e<i.length;e++)t.push(i[e]);else"all"===this.options.saveMissingTo?t=this.languageUtils.toResolveHierarchy(s.lng||this.language):t.push(s.lng||this.language);const e=(t,i,e)=>{const o=v&&e!==p?e:a;this.options.missingKeyHandler?this.options.missingKeyHandler(t,h,i,o,c,s):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(t,h,i,o,c,s),this.emit("missingKey",t,h,i,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?t.forEach((t=>{const i=this.pluralResolver.getSuffixes(t,s);k&&s[`defaultValue${this.options.pluralSeparator}zero`]&&i.indexOf(`${this.options.pluralSeparator}zero`)<0&&i.push(`${this.options.pluralSeparator}zero`),i.forEach((i=>{e([t],r+i,s[`defaultValue${i}`]||A)}))})):e(t,r,A))}p=this.extendTranslation(p,t,s,g,e),o&&p===r&&this.options.appendNamespaceToMissingKey&&(p=`${h}${l}${r}`),(o||i)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${l}${r}`:r,i?p:void 0,s))}else{if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,S,{...s,ns:a}):`key '${r} (${this.language})' returned an object instead of string.`;return o?(g.res=t,g.usedParams=this.getUsedParamsDetails(s),g):t}if(n){const t=Array.isArray(S),i=t?[]:{},e=t?m:f;for(const t in S)if(Object.prototype.hasOwnProperty.call(S,t)){const o=`${e}${n}${t}`;i[t]=this.translate(o,v&&!p?{...s,defaultValue:T(A)?A[t]:void 0,joinArrays:!1,ns:a}:{...s,joinArrays:!1,ns:a}),i[t]===o&&(i[t]=S[t])}p=i}}return o?(g.res=p,g.usedParams=this.getUsedParamsDetails(s),g):p}extendTranslation(t,i,e,s,o){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...e},e.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!e.skipInterpolation){e.interpolation&&this.interpolator.init({...e,interpolation:{...this.options.interpolation,...e.interpolation}});const n=d(t)&&(void 0!==e?.interpolation?.skipOnVariables?e.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let r;if(n){const i=t.match(this.interpolator.nestingRegexp);r=i&&i.length}let a=e.replace&&!d(e.replace)?e.replace:e;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),t=this.interpolator.interpolate(t,a,e.lng||this.language||s.usedLng,e),n){const i=t.match(this.interpolator.nestingRegexp);r<(i&&i.length)&&(e.nest=!1)}!e.lng&&s&&s.res&&(e.lng=this.language||s.usedLng),!1!==e.nest&&(t=this.interpolator.nest(t,((...t)=>o?.[0]!==t[0]||e.context?this.translate(...t,i):(this.logger.warn(`It seems you are nesting recursively key: ${t[0]} in key: ${i[0]}`),null)),e)),e.interpolation&&this.interpolator.reset()}const n=e.postProcess||this.options.postProcess,r=d(n)?[n]:n;return null!=t&&r?.length&&!1!==e.applyPostProcessor&&(t=C.handle(r,t,i,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(e)},...e}:e,this)),t}resolve(t,i={}){let e,s,o,n,r;return d(t)&&(t=[t]),Array.isArray(t)&&(t=t.map((t=>"function"==typeof t?N(t,{...this.options,...i}):t))),t.forEach((t=>{if(this.isValidLookup(e))return;const a=this.extractFromKey(t,i),h=a.key;s=h;let l=a.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const u=void 0!==i.count&&!d(i.count),c=u&&!i.ordinal&&0===i.count,g=void 0!==i.context&&(d(i.context)||"number"==typeof i.context)&&""!==i.context,p=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);l.forEach((t=>{this.isValidLookup(e)||(r=t,R[`${p[0]}-${t}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(r)||(R[`${p[0]}-${t}`]=!0,this.logger.warn(`key "${s}" for languages "${p.join(", ")}" won't get resolved as namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((s=>{if(this.isValidLookup(e))return;n=s;const r=[h];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(r,h,s,t,i);else{let t;u&&(t=this.pluralResolver.getSuffix(s,i.count,i));const e=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(i.ordinal&&0===t.indexOf(o)&&r.push(h+t.replace(o,this.options.pluralSeparator)),r.push(h+t),c&&r.push(h+e)),g){const s=`${h}${this.options.contextSeparator||"_"}${i.context}`;r.push(s),u&&(i.ordinal&&0===t.indexOf(o)&&r.push(s+t.replace(o,this.options.pluralSeparator)),r.push(s+t),c&&r.push(s+e))}}let a;for(;a=r.pop();)this.isValidLookup(e)||(o=a,e=this.getResource(s,t,a,i))})))}))})),{res:e,usedKey:s,exactUsedKey:o,usedLng:n,usedNS:r}}isValidLookup(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}getResource(t,i,e,s={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,i,e,s):this.resourceStore.getResource(t,i,e,s)}getUsedParamsDetails(t={}){const i=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],e=t.replace&&!d(t.replace);let s=e?t.replace:t;if(e&&void 0!==t.count&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!e){s={...s};for(const t of i)delete s[t]}return s}static hasDefaultValue(t){for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&"defaultValue"===i.substring(0,12)&&void 0!==t[i])return!0;return!1}}class H{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=L.create("languageUtils")}getScriptPartFromCode(t){if(!(t=W(t))||t.indexOf("-")<0)return null;const i=t.split("-");return 2===i.length?null:(i.pop(),"x"===i[i.length-1].toLowerCase()?null:this.formatLanguageCode(i.join("-")))}getLanguagePartFromCode(t){if(!(t=W(t))||t.indexOf("-")<0)return t;const i=t.split("-");return this.formatLanguageCode(i[0])}formatLanguageCode(t){if(d(t)&&t.indexOf("-")>-1){let i;try{i=Intl.getCanonicalLocales(t)[0]}catch(t){}return i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let i;return t.forEach((t=>{if(i)return;const e=this.formatLanguageCode(t);this.options.supportedLngs&&!this.isSupportedCode(e)||(i=e)})),!i&&this.options.supportedLngs&&t.forEach((t=>{if(i)return;const e=this.getScriptPartFromCode(t);if(this.isSupportedCode(e))return i=e;const s=this.getLanguagePartFromCode(t);if(this.isSupportedCode(s))return i=s;i=this.options.supportedLngs.find((t=>t===s?t:t.indexOf("-")<0&&s.indexOf("-")<0?void 0:t.indexOf("-")>0&&s.indexOf("-")<0&&t.substring(0,t.indexOf("-"))===s||0===t.indexOf(s)&&s.length>1?t:void 0))})),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}getFallbackCodes(t,i){if(!t)return[];if("function"==typeof t&&(t=t(i)),d(t)&&(t=[t]),Array.isArray(t))return t;if(!i)return t.default||[];let e=t[i];return e||(e=t[this.getScriptPartFromCode(i)]),e||(e=t[this.formatLanguageCode(i)]),e||(e=t[this.getLanguagePartFromCode(i)]),e||(e=t.default),e||[]}toResolveHierarchy(t,i){const e=this.getFallbackCodes((!1===i?[]:i)||this.options.fallbackLng||[],t),s=[],o=t=>{t&&(this.isSupportedCode(t)?s.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return d(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(t))):d(t)&&o(this.formatLanguageCode(t)),e.forEach((t=>{s.indexOf(t)<0&&o(this.formatLanguageCode(t))})),s}}const z={zero:0,one:1,two:2,few:3,many:4,other:5},B={select:t=>1===t?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class F{constructor(t,i={}){this.languageUtils=t,this.options=i,this.logger=L.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,i={}){const e=W("dev"===t?"en":t),s=i.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:e,type:s});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let n;try{n=new Intl.PluralRules(e,{type:s})}catch(e){if("undefined"==typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),B;if(!t.match(/-|_/))return B;const s=this.languageUtils.getLanguagePartFromCode(t);n=this.getRule(s,i)}return this.pluralRulesCache[o]=n,n}needsPlural(t,i={}){let e=this.getRule(t,i);return e||(e=this.getRule("dev",i)),e?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,i,e={}){return this.getSuffixes(t,e).map((t=>`${i}${t}`))}getSuffixes(t,i={}){let e=this.getRule(t,i);return e||(e=this.getRule("dev",i)),e?e.resolvedOptions().pluralCategories.sort(((t,i)=>z[t]-z[i])).map((t=>`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${t}`)):[]}getSuffix(t,i,e={}){const s=this.getRule(t,e);return s?`${this.options.prepend}${e.ordinal?`ordinal${this.options.prepend}`:""}${s.select(i)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",i,e))}}const V=(t,i,e,s=".",o=!0)=>{let n=((t,i,e)=>{const s=v(t,e);return void 0!==s?s:v(i,e)})(t,i,e);return!n&&o&&d(e)&&(n=I(t,e,s),void 0===n&&(n=I(i,e,s))),n},q=t=>t.replace(/\$/g,"$$$$");class _{constructor(t={}){this.logger=L.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(t=>t),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:i,escapeValue:e,useRawValueToEscape:s,prefix:o,prefixEscaped:n,suffix:r,suffixEscaped:a,formatSeparator:h,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:c,nestingPrefixEscaped:d,nestingSuffix:g,nestingSuffixEscaped:p,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:y}=t.interpolation;this.escape=void 0!==i?i:A,this.escapeValue=void 0===e||e,this.useRawValueToEscape=void 0!==s&&s,this.prefix=o?$(o):n||"{{",this.suffix=r?$(r):a||"}}",this.formatSeparator=h||",",this.unescapePrefix=l?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=c?$(c):d||$("$t("),this.nestingSuffix=g?$(g):p||$(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(t,i)=>t?.source===i?(t.lastIndex=0,t):new RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,i,e,s){let o,n,r;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=t=>{if(t.indexOf(this.formatSeparator)<0){const o=V(i,a,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,e,{...s,...i,interpolationkey:t}):o}const o=t.split(this.formatSeparator),n=o.shift().trim(),r=o.join(this.formatSeparator).trim();return this.format(V(i,a,n,this.options.keySeparator,this.options.ignoreJSONStructure),r,e,{...s,...i,interpolationkey:n})};this.resetRegExp();const l=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=void 0!==s?.interpolation?.skipOnVariables?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:t=>q(t)},{regex:this.regexp,safeValue:t=>q(this.escapeValue?this.escape(t):t)}].forEach((i=>{for(r=0;o=i.regex.exec(t);){const e=o[1].trim();if(n=h(e),void 0===n)if("function"==typeof l){const i=l(t,o,s);n=d(i)?i:""}else if(s&&Object.prototype.hasOwnProperty.call(s,e))n="";else{if(u){n=o[0];continue}this.logger.warn(`missed to pass in variable ${e} for interpolating ${t}`),n=""}else d(n)||this.useRawValueToEscape||(n=p(n));const a=i.safeValue(n);if(t=t.replace(o[0],a),u?(i.regex.lastIndex+=n.length,i.regex.lastIndex-=o[0].length):i.regex.lastIndex=0,r++,r>=this.maxReplaces)break}})),t}nest(t,i,e={}){let s,o,n;const r=(t,i)=>{const e=this.nestingOptionsSeparator;if(t.indexOf(e)<0)return t;const s=t.split(new RegExp(`${$(e)}[ ]*{`));let o=`{${s[1]}`;t=s[0],o=this.interpolate(o,n);const r=o.match(/'/g),a=o.match(/"/g);((r?.length??0)%2==0&&!a||(a?.length??0)%2!=0)&&(o=o.replace(/'/g,'"'));try{n=JSON.parse(o),i&&(n={...i,...n})}catch(i){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,i),`${t}${e}${o}`}return n.defaultValue&&n.defaultValue.indexOf(this.prefix)>-1&&delete n.defaultValue,t};for(;s=this.nestingRegexp.exec(t);){let a=[];n={...e},n=n.replace&&!d(n.replace)?n.replace:n,n.applyPostProcessor=!1,delete n.defaultValue;const h=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(-1!==h&&(a=s[1].slice(h).split(this.formatSeparator).map((t=>t.trim())).filter(Boolean),s[1]=s[1].slice(0,h)),o=i(r.call(this,s[1].trim(),n),n),o&&s[0]===t&&!d(o))return o;d(o)||(o=p(o)),o||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),o=""),a.length&&(o=a.reduce(((t,i)=>this.format(t,i,e.lng,{...e,interpolationkey:s[1].trim()})),o.trim())),t=t.replace(s[0],o),this.regexp.lastIndex=0}return t}}const U=t=>{const i={};return(e,s,o)=>{let n=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(n={...n,[o.interpolationkey]:void 0});const r=s+JSON.stringify(n);let a=i[r];return a||(a=t(W(s),o),i[r]=a),a(e)}},J=t=>(i,e,s)=>t(W(e),s)(i);class Y{constructor(t={}){this.logger=L.create("formatter"),this.options=t,this.init(t)}init(t,i={interpolation:{}}){this.formatSeparator=i.interpolation.formatSeparator||",";const e=i.cacheInBuiltFormats?U:J;this.formats={number:e(((t,i)=>{const e=new Intl.NumberFormat(t,{...i});return t=>e.format(t)})),currency:e(((t,i)=>{const e=new Intl.NumberFormat(t,{...i,style:"currency"});return t=>e.format(t)})),datetime:e(((t,i)=>{const e=new Intl.DateTimeFormat(t,{...i});return t=>e.format(t)})),relativetime:e(((t,i)=>{const e=new Intl.RelativeTimeFormat(t,{...i});return t=>e.format(t,i.range||"day")})),list:e(((t,i)=>{const e=new Intl.ListFormat(t,{...i});return t=>e.format(t)}))}}add(t,i){this.formats[t.toLowerCase().trim()]=i}addCached(t,i){this.formats[t.toLowerCase().trim()]=U(i)}format(t,i,e,s={}){const o=i.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find((t=>t.indexOf(")")>-1))){const t=o.findIndex((t=>t.indexOf(")")>-1));o[0]=[o[0],...o.splice(1,t)].join(this.formatSeparator)}return o.reduce(((t,i)=>{const{formatName:o,formatOptions:n}=(t=>{let i=t.toLowerCase().trim();const e={};if(t.indexOf("(")>-1){const s=t.split("(");i=s[0].toLowerCase().trim();const o=s[1].substring(0,s[1].length-1);"currency"===i&&o.indexOf(":")<0?e.currency||(e.currency=o.trim()):"relativetime"===i&&o.indexOf(":")<0?e.range||(e.range=o.trim()):o.split(";").forEach((t=>{if(t){const[i,...s]=t.split(":"),o=s.join(":").trim().replace(/^'+|'+$/g,""),n=i.trim();e[n]||(e[n]=o),"false"===o&&(e[n]=!1),"true"===o&&(e[n]=!0),isNaN(o)||(e[n]=parseInt(o,10))}}))}return{formatName:i,formatOptions:e}})(i);if(this.formats[o]){let i=t;try{const r=s?.formatParams?.[s.interpolationkey]||{};i=this.formats[o](t,r.locale||r.lng||s.locale||s.lng||e,{...n,...s,...r})}catch(t){this.logger.warn(t)}return i}return this.logger.warn(`there was no format function for ${o}`),t}),t)}}class G extends P{constructor(t,i,e,s={}){super(),this.backend=t,this.store=i,this.services=e,this.languageUtils=e.languageUtils,this.options=s,this.logger=L.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(e,s.backend,s)}queueLoad(t,i,e,s){const o={},n={},r={},a={};return t.forEach((t=>{let s=!0;i.forEach((i=>{const r=`${t}|${i}`;!e.reload&&this.store.hasResourceBundle(t,i)?this.state[r]=2:this.state[r]<0||(1===this.state[r]?void 0===n[r]&&(n[r]=!0):(this.state[r]=1,s=!1,void 0===n[r]&&(n[r]=!0),void 0===o[r]&&(o[r]=!0),void 0===a[i]&&(a[i]=!0)))})),s||(r[t]=!0)})),(Object.keys(o).length||Object.keys(n).length)&&this.queue.push({pending:n,pendingCount:Object.keys(n).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(o),pending:Object.keys(n),toLoadLanguages:Object.keys(r),toLoadNamespaces:Object.keys(a)}}loaded(t,i,e){const s=t.split("|"),o=s[0],n=s[1];i&&this.emit("failedLoading",o,n,i),!i&&e&&this.store.addResourceBundle(o,n,e,void 0,void 0,{skipCopy:!0}),this.state[t]=i?-1:2,i&&e&&(this.state[t]=0);const r={};this.queue.forEach((e=>{((t,i,e)=>{const{obj:s,k:o}=b(t,i,Object);s[o]=s[o]||[],s[o].push(e)})(e.loaded,[o],n),((t,i)=>{void 0!==t.pending[i]&&(delete t.pending[i],t.pendingCount--)})(e,t),i&&e.errors.push(i),0!==e.pendingCount||e.done||(Object.keys(e.loaded).forEach((t=>{r[t]||(r[t]={});const i=e.loaded[t];i.length&&i.forEach((i=>{void 0===r[t][i]&&(r[t][i]=!0)}))})),e.done=!0,e.errors.length?e.callback(e.errors):e.callback())})),this.emit("loaded",r),this.queue=this.queue.filter((t=>!t.done))}read(t,i,e,s=0,o=this.retryTimeout,n){if(!t.length)return n(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:t,ns:i,fcName:e,tried:s,wait:o,callback:n});this.readingCalls++;const r=(r,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}r&&a&&s<this.maxRetries?setTimeout((()=>{this.read.call(this,t,i,e,s+1,2*o,n)}),o):n(r,a)},a=this.backend[e].bind(this.backend);if(2!==a.length)return a(t,i,r);try{const e=a(t,i);e&&"function"==typeof e.then?e.then((t=>r(null,t))).catch(r):r(null,e)}catch(t){r(t)}}prepareLoading(t,i,e={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();d(t)&&(t=this.languageUtils.toResolveHierarchy(t)),d(i)&&(i=[i]);const o=this.queueLoad(t,i,e,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach((t=>{this.loadOne(t)}))}load(t,i,e){this.prepareLoading(t,i,{},e)}reload(t,i,e){this.prepareLoading(t,i,{reload:!0},e)}loadOne(t,i=""){const e=t.split("|"),s=e[0],o=e[1];this.read(s,o,"read",void 0,void 0,((e,n)=>{e&&this.logger.warn(`${i}loading namespace ${o} for language ${s} failed`,e),!e&&n&&this.logger.log(`${i}loaded namespace ${o} for language ${s}`,n),this.loaded(t,e,n)}))}saveMissing(t,i,e,s,o,n={},r=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(i)){if(null!=e&&""!==e){if(this.backend?.create){const a={...n,isUpdate:o},h=this.backend.create.bind(this.backend);if(h.length<6)try{let o;o=5===h.length?h(t,i,e,s,a):h(t,i,e,s),o&&"function"==typeof o.then?o.then((t=>r(null,t))).catch(r):r(null,o)}catch(t){r(t)}else h(t,i,e,s,r,a)}t&&t[0]&&this.store.addResource(t[0],i,e,s)}}else this.logger.warn(`did not save key "${e}" as the namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const Q=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let i={};if("object"==typeof t[1]&&(i=t[1]),d(t[1])&&(i.defaultValue=t[1]),d(t[2])&&(i.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){const e=t[3]||t[2];Object.keys(e).forEach((t=>{i[t]=e[t]}))}return i},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Z=t=>(d(t.ns)&&(t.ns=[t.ns]),d(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),d(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),"boolean"==typeof t.initImmediate&&(t.initAsync=t.initImmediate),t),X=()=>{},tt="__i18next_supportNoticeShown";class it extends P{constructor(t={},i){var e;if(super(),this.options=Z(t),this.services={},this.logger=L,this.modules={external:[]},e=this,Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})),i&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,i),this;setTimeout((()=>{this.init(t,i)}),0)}}init(t={},i){this.isInitializing=!0,"function"==typeof t&&(i=t,t={}),null==t.defaultNS&&t.ns&&(d(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const e=Q();var s;this.options={...e,...this.options,...Z(t)},this.options.interpolation={...e.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=e.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||(s=this,s?.modules?.backend?.name?.indexOf("Locize")>0||s?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||s?.options?.backend?.backends&&s.options.backend.backends.some((t=>t?.name?.indexOf("Locize")>0||t?.constructor?.name?.indexOf("Locize")>0))||s?.options?.backend?.projectId||s?.options?.backend?.backendOptions&&s.options.backend.backendOptions.some((t=>t?.projectId)))||"undefined"!=typeof globalThis&&globalThis[tt]||"undefined"!=typeof process&&process.env&&process.env.I18NEXT_NO_SUPPORT_NOTICE||"undefined"!=typeof process&&process.env||("undefined"!=typeof console&&void 0!==console.info&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),"undefined"!=typeof globalThis&&(globalThis[tt]=!0));const o=t=>t?"function"==typeof t?new t:t:null;if(!this.options.isClone){let t;L.init(this.modules.logger?o(this.modules.logger):null,this.options),t=this.modules.formatter?this.modules.formatter:Y;const i=new H(this.options);this.store=new M(this.options.resources,this.options);const s=this.services;s.logger=L,s.resourceStore=this.store,s.languageUtils=i,s.pluralResolver=new F(i,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==e.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!t||this.options.interpolation.format&&this.options.interpolation.format!==e.interpolation.format||(s.formatter=o(t),s.formatter.init&&s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new _(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new G(o(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",((t,...i)=>{this.emit(t,...i)})),this.modules.languageDetector&&(s.languageDetector=o(this.modules.languageDetector),s.languageDetector.init&&s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=o(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new K(this.services,this.options),this.translator.on("*",((t,...i)=>{this.emit(t,...i)})),this.modules.external.forEach((t=>{t.init&&t.init(this)}))}if(this.format=this.options.interpolation.format,i||(i=X),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=(...i)=>this.store[t](...i)})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=(...i)=>(this.store[t](...i),this)}));const n=g(),r=()=>{const t=(t,e)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),n.resolve(e),i(t,e)};if(this.languages&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initAsync?r():setTimeout(r,0),n}loadResources(t,i=X){let e=i;const s=d(t)?t:this.language;if("function"==typeof t&&(e=t),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===s?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return e();const t=[],i=i=>{i&&"cimode"!==i&&this.services.languageUtils.toResolveHierarchy(i).forEach((i=>{"cimode"!==i&&t.indexOf(i)<0&&t.push(i)}))};s?i(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((t=>i(t))),this.options.preload?.forEach?.((t=>i(t))),this.services.backendConnector.load(t,this.options.ns,(t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),e(t)}))}else e(null)}reloadResources(t,i,e){const s=g();return"function"==typeof t&&(e=t,t=void 0),"function"==typeof i&&(e=i,i=void 0),t||(t=this.languages),i||(i=this.options.ns),e||(e=X),this.services.backendConnector.reload(t,i,(t=>{s.resolve(),e(t)})),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&C.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1)){for(let t=0;t<this.languages.length;t++){const i=this.languages[t];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,i){this.isLanguageChangingTo=t;const e=g();this.emit("languageChanging",t);const s=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},o=(o,n)=>{n?this.isLanguageChangingTo===t&&(s(n),this.translator.changeLanguage(n),this.isLanguageChangingTo=void 0,this.emit("languageChanged",n),this.logger.log("languageChanged",n)):this.isLanguageChangingTo=void 0,e.resolve(((...t)=>this.t(...t))),i&&i(o,((...t)=>this.t(...t)))},n=i=>{t||i||!this.services.languageDetector||(i=[]);const e=d(i)?i:i&&i[0],n=this.store.hasLanguageSomeTranslations(e)?e:this.services.languageUtils.getBestMatchFromCodes(d(i)?[i]:i);n&&(this.language||s(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector?.cacheUserLanguage?.(n)),this.loadResources(n,(t=>{o(t,n)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(n):this.services.languageDetector.detect(n):n(t):n(this.services.languageDetector.detect()),e}getFixedT(t,i,e){const s=(t,i,...o)=>{let n;n="object"!=typeof i?this.options.overloadTranslationOptionHandler([t,i].concat(o)):{...i},n.lng=n.lng||s.lng,n.lngs=n.lngs||s.lngs,n.ns=n.ns||s.ns,""!==n.keyPrefix&&(n.keyPrefix=n.keyPrefix||e||s.keyPrefix);const r={...this.options,...n};"function"==typeof n.keyPrefix&&(n.keyPrefix=N(n.keyPrefix,r));const a=this.options.keySeparator||".";let h;return n.keyPrefix&&Array.isArray(t)?h=t.map((t=>("function"==typeof t&&(t=N(t,r)),`${n.keyPrefix}${a}${t}`))):("function"==typeof t&&(t=N(t,r)),h=n.keyPrefix?`${n.keyPrefix}${a}${t}`:t),this.t(h,n)};return d(t)?s.lng=t:s.lngs=t,s.ns=i,s.keyPrefix=e,s}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,i={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const e=i.lng||this.resolvedLanguage||this.languages[0],s=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===e.toLowerCase())return!0;const n=(t,i)=>{const e=this.services.backendConnector.state[`${t}|${i}`];return-1===e||0===e||2===e};if(i.precheck){const t=i.precheck(this,n);if(void 0!==t)return t}return!(!this.hasResourceBundle(e,t)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!n(e,t)||s&&!n(o,t)))}loadNamespaces(t,i){const e=g();return this.options.ns?(d(t)&&(t=[t]),t.forEach((t=>{this.options.ns.indexOf(t)<0&&this.options.ns.push(t)})),this.loadResources((t=>{e.resolve(),i&&i(t)})),e):(i&&i(),Promise.resolve())}loadLanguages(t,i){const e=g();d(t)&&(t=[t]);const s=this.options.preload||[],o=t.filter((t=>s.indexOf(t)<0&&this.services.languageUtils.isSupportedCode(t)));return o.length?(this.options.preload=s.concat(o),this.loadResources((t=>{e.resolve(),i&&i(t)})),e):(i&&i(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const i=new Intl.Locale(t);if(i&&i.getTextInfo){const t=i.getTextInfo();if(t&&t.direction)return t.direction}}catch(t){}const i=this.services?.languageUtils||new H(Q());return t.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(i.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},i){const e=new it(t,i);return e.createInstance=it.createInstance,e}cloneInstance(t={},i=X){const e=t.forkResourceStore;e&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},o=new it(s);if(void 0===t.debug&&void 0===t.prefix||(o.logger=o.logger.clone(t)),["store","services","language"].forEach((t=>{o[t]=this[t]})),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},e){const t=Object.keys(this.store.data).reduce(((t,i)=>(t[i]={...this.store.data[i]},t[i]=Object.keys(t[i]).reduce(((e,s)=>(e[s]={...t[i][s]},e)),t[i]),t)),{});o.store=new M(t,s),o.services.resourceStore=o.store}if(t.interpolation){const i={...Q().interpolation,...this.options.interpolation,...t.interpolation},e={...s,interpolation:i};o.services.interpolator=new _(e)}return o.translator=new K(o.services,s),o.translator.on("*",((t,...i)=>{o.emit(t,...i)})),o.init(s,i),o.translator.options=s,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const et=it.createInstance(),{slice:st,forEach:ot}=[],nt=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,rt={create(t,i,e,s){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};e&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+60*e*1e3)),s&&(o.domain=s),document.cookie=function(t,i){const e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"};let s=`${t}=${encodeURIComponent(i)}`;if(e.maxAge>0){const t=e.maxAge-0;if(Number.isNaN(t))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(t)}`}if(e.domain){if(!nt.test(e.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${e.domain}`}if(e.path){if(!nt.test(e.path))throw new TypeError("option path is invalid");s+=`; Path=${e.path}`}if(e.expires){if("function"!=typeof e.expires.toUTCString)throw new TypeError("option expires is invalid");s+=`; Expires=${e.expires.toUTCString()}`}if(e.httpOnly&&(s+="; HttpOnly"),e.secure&&(s+="; Secure"),e.sameSite)switch("string"==typeof e.sameSite?e.sameSite.toLowerCase():e.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return e.partitioned&&(s+="; Partitioned"),s}(t,i,o)},read(t){const i=`${t}=`,e=document.cookie.split(";");for(let t=0;t<e.length;t++){let s=e[t];for(;" "===s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(i))return s.substring(i.length,s.length)}return null},remove(t,i){this.create(t,"",-1,i)}};var at={name:"cookie",lookup(t){let{lookupCookie:i}=t;if(i&&"undefined"!=typeof document)return rt.read(i)||void 0},cacheUserLanguage(t,i){let{lookupCookie:e,cookieMinutes:s,cookieDomain:o,cookieOptions:n}=i;e&&"undefined"!=typeof document&&rt.create(e,t,s,o,n)}},ht={name:"querystring",lookup(t){let i,{lookupQuerystring:e}=t;if("undefined"!=typeof window){let{search:t}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(t=window.location.hash.substring(window.location.hash.indexOf("?")));const s=t.substring(1).split("&");for(let t=0;t<s.length;t++){const o=s[t].indexOf("=");o>0&&s[t].substring(0,o)===e&&(i=s[t].substring(o+1))}}return i}},lt={name:"hash",lookup(t){let i,{lookupHash:e,lookupFromHashIndex:s}=t;if("undefined"!=typeof window){const{hash:t}=window.location;if(t&&t.length>2){const o=t.substring(1);if(e){const t=o.split("&");for(let s=0;s<t.length;s++){const o=t[s].indexOf("=");o>0&&t[s].substring(0,o)===e&&(i=t[s].substring(o+1))}}if(i)return i;if(!i&&s>-1){const i=t.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(i))return;const e="number"==typeof s?s:0;return i[e]?.replace("/","")}}}return i}};let ut=null;const ct=()=>{if(null!==ut)return ut;try{if(ut="undefined"!=typeof window&&null!==window.localStorage,!ut)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch(t){ut=!1}return ut};var dt={name:"localStorage",lookup(t){let{lookupLocalStorage:i}=t;if(i&&ct())return window.localStorage.getItem(i)||void 0},cacheUserLanguage(t,i){let{lookupLocalStorage:e}=i;e&&ct()&&window.localStorage.setItem(e,t)}};let gt=null;const pt=()=>{if(null!==gt)return gt;try{if(gt="undefined"!=typeof window&&null!==window.sessionStorage,!gt)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch(t){gt=!1}return gt};var ft={name:"sessionStorage",lookup(t){let{lookupSessionStorage:i}=t;if(i&&pt())return window.sessionStorage.getItem(i)||void 0},cacheUserLanguage(t,i){let{lookupSessionStorage:e}=i;e&&pt()&&window.sessionStorage.setItem(e,t)}},mt={name:"navigator",lookup(t){const i=[];if("undefined"!=typeof navigator){const{languages:t,userLanguage:e,language:s}=navigator;if(t)for(let e=0;e<t.length;e++)i.push(t[e]);e&&i.push(e),s&&i.push(s)}return i.length>0?i:void 0}},yt={name:"htmlTag",lookup(t){let i,{htmlTag:e}=t;const s=e||("undefined"!=typeof document?document.documentElement:null);return s&&"function"==typeof s.getAttribute&&(i=s.getAttribute("lang")),i}},bt={name:"path",lookup(t){let{lookupFromPathIndex:i}=t;if("undefined"==typeof window)return;const e=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(e))return;const s="number"==typeof i?i:0;return e[s]?.replace("/","")}},wt={name:"subdomain",lookup(t){let{lookupFromSubdomainIndex:i}=t;const e="number"==typeof i?i+1:1,s="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(s)return s[e]}};let vt=!1;try{vt=!0}catch(t){}const xt=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];vt||xt.splice(1,1);class $t{constructor(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,i)}init(){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},this.options=function(t){return ot.call(st.call(arguments,1),(i=>{if(i)for(const e in i)void 0===t[e]&&(t[e]=i[e])})),t}(t,this.options||{},{order:xt,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=t=>t.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(at),this.addDetector(ht),this.addDetector(dt),this.addDetector(ft),this.addDetector(mt),this.addDetector(yt),this.addDetector(bt),this.addDetector(wt),this.addDetector(lt)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order).forEach((i=>{if(this.detectors[i]){let e=this.detectors[i].lookup(this.options);e&&"string"==typeof e&&(e=[e]),e&&(t=t.concat(e))}})),t=t.filter((t=>{return null!=t&&!("string"==typeof(i=t)&&[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some((t=>t.test(i))));var i})).map((t=>this.options.convertDetectedLanguage(t))),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;i&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||i.forEach((i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(t,this.options)})))}}$t.type="languageDetector";et.use($t).init({resources:{en:{translation:{"Do you want to exit? button":"Do you want to exit?","Exit button":"Exit","Continue playing button":"Continue playing","Drop the elements to match the given symbol order":"Drop the elements to match the given symbol order","Fill in the blanks":"Fill in the blanks",instruction:{dragAndDrop:"Match the items by dragging and dropping them into the correct places.",mcq:"Select the correct answer from the options provided.",tracing:"Trace the shape by following the outline carefully.",flashcards:"Review the flashcards to reinforce your learning.",substractionWithImage:"substractionWithImageEngAudio",substractionWithoutImage:"substractionWithoutImageEngAudio",numberIdentificationWithImage:"numberIdentificationWithImageEngAudio",numberIdentificationWithoutImage:"numberIdentificationWithoutImageEngAudio",wordBuildingWithImage:"wordBuildingWithImageEngAudio",wordBuildingWithoutImage:"wordBuildingWithoutImageEngAudio",pictureClues:"pictureCluesEngAudio",pictureWordMatchMultipleImages:"pictureWordMatchMultipleImagesEngAudio",pictureWordMatchSingleImage:"pictureWordMatchSingleImageEngAudio",sentenceMatch:"sentenceMatchEngAudio",imageMatch:"imageMatchEngAudio",palStoryTale:"palStoryTaleEngAudio",palEgmaPatternMatching:"palEgmaPatternMatchingEngAudio",palEgmaWordProblemDragnDrop:"palEgmaWordProblemDragnDropEngAudio",palEgmaWordProblemClick:"palEgmaWordProblemClickEngAudio",palEgraOddOneOut:"palEgraOddOneOutEngAudio",palEgraArrangePictures:"palEgraArrangePicturesEngAudio",palEgraBuildWord:"palEgraBuildWordEngAudio",palEgraWordFormation:"palEgraWordFormationEngAudio",palInventedSpelling:"palInventedSpellingEngAudio",palLetterIdentification:"palLetterIdentificationEngAudio",palStoryMaking:"palStoryMakingEngAudio",palegmasumtogether:"palegmasumtogetherEngAudio",palegmamultioption:"palegmamultioptionEngAudio",palegraoptionaudio:"palegraoptionaudioEngAudio",palegrawordmatch:"palegrawordmatchEngAudio",palegramcqimages:"palegramcqimagesEngAudio"}}},fr:{translation:{"Do you want to exit? button":"Voulez-vous quitter?","Exit button":"Quitter","Continue playing button":"Continuer à jouer","Drop the elements to match the given symbol order":"Déposez les éléments pour correspondre au symbole donné","Fill in the blanks":"Remplissez les blancs",instruction:{dragAndDrop:"Faites glisser les objets vers le bon emplacement.",mcq:"Choisissez la bonne réponse parmi les options proposées.",tracing:"Tracez soigneusement la forme en suivant la ligne.",flashcards:"Regardez les cartes mémoire pour renforcer l’apprentissage."}}},hi:{translation:{"Do you want to exit? button":"क्या आप बाहर निकलना चाहते हैं?","Exit button":"बाहर निकलें","Continue playing button":"खेलना जारी रखें","Drop the elements to match the given symbol order":"दिए गए चिन्ह से मिलाने के लिए तत्वों को ड्रॉप करें","Fill in the blanks":"रिक्त स्थान भरें",instruction:{dragAndDrop:"Match the items by dragging and dropping them into the correct places.",mcq:"Select the correct answer from the options provided.",tracing:"Trace the shape by following the outline carefully.",flashcards:"Review the flashcards to reinforce your learning.",substractionWithImage:"substractionWithImageHiAudio",substractionWithoutImage:"substractionWithoutImageHiAudio",numberIdentificationWithImage:"numberIdentificationWithImageHiAudio",numberIdentificationWithoutImage:"numberIdentificationWithoutImageHiAudio",wordBuildingWithImage:"wordBuildingWithImageHiAudio",wordBuildingWithoutImage:"wordBuildingWithoutImageHiAudio",pictureClues:"pictureCluesHiAudio",pictureWordMatchMultipleImages:"pictureWordMatchMultipleImagesHiAudio",pictureWordMatchSingleImage:"pictureWordMatchSingleImageHiAudio",sentenceMatch:"sentenceMatchHiAudio",imageMatch:"imageMatchHiAudio",palStoryTale:"palStoryTaleHiAudio",palEgmaPatternMatching:"palEgmaPatternMatchingHiAudio",palEgmaWordProblemDragnDrop:"palEgmaWordProblemDragnDropHiAudio",palEgmaWordProblemClick:"palEgmaWordProblemClickHiAudio",palEgraOddOneOut:"palEgraOddOneOutHiAudio",palEgraArrangePictures:"palEgraArrangePicturesHiAudio",palEgraBuildWord:"palEgraBuildWordHiAudio",palEgraWordFormation:"palEgraWordFormationHiAudio",palInventedSpelling:"palInventedSpellingHiAudio",palLetterIdentification:"palLetterIdentificationHiAudio",palStoryMaking:"palStoryMakingHiAudio",palegmasumtogether:"palegmasumtogetherHiAudio",palegmamultioption:"palegmamultioptionHiAudio",palegraoptionaudio:"palegraoptionaudioHiAudio",palegrawordmatch:"palegrawordmatchHiAudio",palegramcqimages:"palegramcqimagesHiAudio"}}},kn:{translation:{"Do you want to exit? button":"ನೀವು ನಿರ್ಗಮಿಸಲು ಬಯಸುವಿರಾ?","Exit button":"ನಿರ್ಗಮಿಸು","Continue playing button":"ಆಟವನ್ನು ಮುಂದುವರಿಸಿ","Drop the elements to match the given symbol order":"ನೀಡಿರುವ ಸಂಕೇತಕ್ಕೆ ಹೊಂದುವಂತೆ ಅಂಶಗಳನ್ನು ಬಿಡಿ","Fill in the blanks":"ಖಾಲಿ ಸ್ಥಳಗಳನ್ನು ಭರ್ತಿ ಮಾಡಿ",instruction:{dragAndDrop:"Match the items by dragging and dropping them into the correct places.",mcq:"Select the correct answer from the options provided.",tracing:"Trace the shape by following the outline carefully.",flashcards:"Review the flashcards to reinforce your learning.",substractionWithImage:"substractionWithImageKaAudio",substractionWithoutImage:"substractionWithoutImageKaAudio",numberIdentificationWithImage:"numberIdentificationWithImageKaAudio",numberIdentificationWithoutImage:"numberIdentificationWithoutImageKaAudio",wordBuildingWithImage:"wordBuildingWithImageKaAudio",wordBuildingWithoutImage:"wordBuildingWithoutImageKaAudio",pictureClues:"pictureCluesKaAudio",pictureWordMatchMultipleImages:"pictureWordMatchMultipleImagesKaAudio",pictureWordMatchSingleImage:"pictureWordMatchSingleImageKaAudio",sentenceMatch:"sentenceMatchKaAudio",imageMatch:"imageMatchKaAudio",palStoryTale:"palStoryTaleKaAudio",palEgmaPatternMatching:"palEgmaPatternMatchingKaAudio",palEgmaWordProblemDragnDrop:"palEgmaWordProblemDragnDropKaAudio",palEgmaWordProblemClick:"palEgmaWordProblemClickKaAudio",palEgraOddOneOut:"palEgraOddOneOutKaAudio",palEgraArrangePictures:"palEgraArrangePicturesKaAudio",palEgraBuildWord:"palEgraBuildWordKaAudio",palEgraWordFormation:"palEgraWordFormationKaAudio",palInventedSpelling:"palInventedSpellingKaAudio",palLetterIdentification:"palLetterIdentificationKaAudio",palStoryMaking:"palStoryMakingKaAudio",palegmasumtogether:"palegmasumtogetherKaAudio",palegmamultioption:"palegmamultioptionKaAudio",palegraoptionaudio:"palegraoptionaudioKaAudio",palegrawordmatch:"palegrawordmatchKaAudio",palegramcqimages:"palegramcqimagesKaAudio"}}},te:{translation:{"Do you want to exit? button":"మీరు బయటకు వెళ్లాలనుకుంటున్నారా?","Exit button":"బయటకు వెళ్ళు","Continue playing button":"ఆటను కొనసాగించు","Drop the elements to match the given symbol order":"ఇచ్చిన చిహ్నానికి సరిపడేలా అంశాలను డ్రాప్ చేయಂడಿ","Fill in the blanks":"ಖಾಲಿ ಸ್ಥಳಗಳನ್ನು ಭರ್ತಿ ಮಾಡಿ"}},pt:{translation:{"Do you want to exit? button":"Você deseja sair?","Exit button":"Sair","Continue playing button":"Continuar jogando","Drop the elements to match the given symbol order":"Solte os elementos para corresponder à ordem dos símbolos fornecida","Fill in the blanks":"Preencha os espaços em branco"}},mr:{translation:{"Do you want to exit? button":"तुम्हाला बाहेर पडायचे आहे का?","Exit button":"बाहेर पडा","Continue playing button":"खेळ सुरू ठेवा",instruction:{dragAndDrop:"वस्तू योग्य ठिकाणी ओढून आणि सोडून जुळवा.",mcq:"दिलेल्या पर्यायांमधून योग्य उत्तर निवडा.",tracing:"रेषेचा काळजीपूर्वक मागोवा घेत आकृती काढा.",flashcards:"तुमचे शिक्षण मजबूत करण्यासाठी फ्लॅशकार्ड्स पाहा."}}}},fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1},detection:{order:["querystring","localStorage","navigator","htmlTag"],caches:["localStorage"]}});const kt=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.showSpeakIcon=!1,this.id="",this.value="",this.string="",this.fontFamily="",this.fontSize="20px",this.fontColor="",this.highlightWhileSpeaking=!1,this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.move="false",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.borderImage="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.minDrops=1,this.maxDrops=1,this.onEntry="",this.margin="",this.padding="",this.borderRadius="0px",this.spanType="",this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles(),this.delayVisible="",this.disableSpeak=!1}componentDidLoad(){if(s(this.el,this.delayVisible),o(this.el,this.type),"words"!==this.spanType&&"letters"!==this.spanType||this.addSpanToText(),this.showSpeakIcon&&n(this.el),!this.audio||""===this.audio.trim()){const t=()=>{const t=this.resolveAutoAudio();t&&(this.audio=t)};window.__LIDO_COMMON_AUDIO_PATH__?t():window.addEventListener(r,t,{once:!0})}}resolveAutoAudio(){const t=window[c];return t&&this.string?`${t}/${this.string}.mp3`:null}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=this.borderImage?a(this.borderImage):"",i=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:h(this.height,i),width:h(this.width,i),backgroundColor:h(this.bgColor,i),top:h(this.y,i),left:h(this.x,i),zIndex:this.z,fontSize:h(this.fontSize,i),fontFamily:this.fontFamily,color:h(this.fontColor,i),display:"true"===h(`${this.visible}`,i)?"flex":"none",borderImage:`url(${t})`,borderImageSlice:t?"0 fill":"",margin:h(this.margin,i),padding:h(this.padding,i),borderRadius:h(this.borderRadius,i)}}async addSpanToText(){const t=this.el.querySelector(".lido-text-content");if(!t)return;const i=t.textContent||"";t.innerHTML="","letters"===this.spanType&&i.split("").forEach((i=>{if(""===i.trim())return;const e=document.createElement("span");e.textContent=i,e.className="text-letters",t.appendChild(e)})),"words"===this.spanType&&i.split(" ").forEach((i=>{const e=document.createElement("span");e.textContent=i,e.className="text-words",t.appendChild(e)}))}render(){const t=et.t(this.string).replace(/_phonics?/gi,"");return l(u,{key:"ff07be0272e5b035a5378e5108bc86ea03ac49aa",class:"lido-text",value:this.value,type:this.type,"tab-index":this.tabIndex,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,minDrops:this.minDrops,maxDrops:this.maxDrops,id:this.id,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,move:this.move,"span-type":this.spanType,"disable-speak":`${this.disableSpeak}`},""!==this.spanType?l("div",{class:"lido-text-content"}," ",t):t)}get el(){return this}static get style(){return".lido-text{transition:background-color 0.3s ease;user-select:none;align-items:center;justify-content:center;text-align:center;border-radius:24px;color:#333;cursor:pointer;font-family:'Baloo Bhai 2', serif}.text-letters{transition:color 0.3s, text-shadow 0.3s;display:inline-block;padding:0 2px}.text-letters.letter-highlight{color:#8e24aa;background:none;border-radius:0;text-shadow:0 2px 8px #8e24aa88;animation:text-letter-bounce 0.4s}.text-words{transition:color 0.3s, text-shadow 0.3s;display:inline-block;padding:0 2px}.text-words.word-highlight{color:#8e24aa;background:none;border-radius:0;text-shadow:0 2px 8px #8e24aa88;animation:text-word-bounce 0.4s}@keyframes text-letter-bounce{0%{transform:scale(1)}60%{transform:scale(1.4)}100%{transform:scale(1)}}@keyframes text-word-bounce{0%{transform:scale(1)}60%{transform:scale(1.3)}100%{transform:scale(1)}}"}},[0,"lido-text",{showSpeakIcon:[4,"show-speak-icon"],id:[1],value:[1],string:[1],fontFamily:[1,"font-family"],fontSize:[1,"font-size"],fontColor:[1,"font-color"],highlightWhileSpeaking:[4,"highlight-while-speaking"],height:[1],width:[1],ariaLabel:[1,"aria-label"],ariaHidden:[1,"aria-hidden"],move:[1],x:[1],y:[1],z:[1],bgColor:[1,"bg-color"],borderImage:[1,"border-image"],type:[1],tabIndex:[2,"tab-index"],visible:[8],audio:[1],onTouch:[1,"on-touch"],onInCorrect:[1,"on-in-correct"],onCorrect:[1,"on-correct"],minDrops:[2,"min-drops"],maxDrops:[2,"max-drops"],onEntry:[1,"on-entry"],margin:[1],padding:[1],borderRadius:[1,"border-radius"],spanType:[1,"span-type"],delayVisible:[1,"delay-visible"],disableSpeak:[4,"disable-speak"],style:[32]}]);function At(){"undefined"!=typeof customElements&&["lido-text"].forEach((i=>{"lido-text"===i&&(customElements.get(t(i))||customElements.define(t(i),kt))}))}At();export{kt as L,At as d,et as i}
|
|
1
|
+
import{t,p as i,H as e,k as s,i as o,m as n,a3 as r,c as a,a as h,h as l,b as u,Y as c}from"./index.js";const d=t=>"string"==typeof t,g=()=>{let t,i;const e=new Promise(((e,s)=>{t=e,i=s}));return e.resolve=t,e.reject=i,e},p=t=>null==t?"":""+t,f=/###/g,m=t=>t&&t.indexOf("###")>-1?t.replace(f,"."):t,y=t=>!t||d(t),b=(t,i,e)=>{const s=d(i)?i.split("."):i;let o=0;for(;o<s.length-1;){if(y(t))return{};const i=m(s[o]);!t[i]&&e&&(t[i]=new e),t=Object.prototype.hasOwnProperty.call(t,i)?t[i]:{},++o}return y(t)?{}:{obj:t,k:m(s[o])}},w=(t,i,e)=>{const{obj:s,k:o}=b(t,i,Object);if(void 0!==s||1===i.length)return void(s[o]=e);let n=i[i.length-1],r=i.slice(0,i.length-1),a=b(t,r,Object);for(;void 0===a.obj&&r.length;)n=`${r[r.length-1]}.${n}`,r=r.slice(0,r.length-1),a=b(t,r,Object),a?.obj&&void 0!==a.obj[`${a.k}.${n}`]&&(a.obj=void 0);a.obj[`${a.k}.${n}`]=e},v=(t,i)=>{const{obj:e,k:s}=b(t,i);if(e&&Object.prototype.hasOwnProperty.call(e,s))return e[s]},x=(t,i,e)=>{for(const s in i)"__proto__"!==s&&"constructor"!==s&&(s in t?d(t[s])||t[s]instanceof String||d(i[s])||i[s]instanceof String?e&&(t[s]=i[s]):x(t[s],i[s],e):t[s]=i[s]);return t},$=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var k={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const A=t=>d(t)?t.replace(/[&<>"'\/]/g,(t=>k[t])):t,S=[" ",",","?","!",";"],E=new class{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const i=this.regExpMap.get(t);if(void 0!==i)return i;const e=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,e),this.regExpQueue.push(t),e}}(20),I=(t,i,e=".")=>{if(!t)return;if(t[i]){if(!Object.prototype.hasOwnProperty.call(t,i))return;return t[i]}const s=i.split(e);let o=t;for(let t=0;t<s.length;){if(!o||"object"!=typeof o)return;let i,n="";for(let r=t;r<s.length;++r)if(r!==t&&(n+=e),n+=s[r],i=o[n],void 0!==i){if(["string","number","boolean"].indexOf(typeof i)>-1&&r<s.length-1)continue;t+=r-t+1;break}o=i}return o},W=t=>t?.replace(/_/g,"-"),O={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,i){console?.[t]?.apply?.(console,i)}};class j{constructor(t,i={}){this.init(t,i)}init(t,i={}){this.prefix=i.prefix||"i18next:",this.logger=t||O,this.options=i,this.debug=i.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,i,e,s){return s&&!this.debug?null:(d(t[0])&&(t[0]=`${e}${this.prefix} ${t[0]}`),this.logger[i](t))}create(t){return new j(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new j(this.logger,t)}}var L=new j;class P{constructor(){this.observers={}}on(t,i){return t.split(" ").forEach((t=>{this.observers[t]||(this.observers[t]=new Map);const e=this.observers[t].get(i)||0;this.observers[t].set(i,e+1)})),this}off(t,i){this.observers[t]&&(i?this.observers[t].delete(i):delete this.observers[t])}emit(t,...i){this.observers[t]&&Array.from(this.observers[t].entries()).forEach((([t,e])=>{for(let s=0;s<e;s++)t(...i)})),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach((([e,s])=>{for(let o=0;o<s;o++)e.apply(e,[t,...i])}))}}class M extends P{constructor(t,i={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=i,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const i=this.options.ns.indexOf(t);i>-1&&this.options.ns.splice(i,1)}getResource(t,i,e,s={}){const o=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,n=void 0!==s.ignoreJSONStructure?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let r;t.indexOf(".")>-1?r=t.split("."):(r=[t,i],e&&(Array.isArray(e)?r.push(...e):d(e)&&o?r.push(...e.split(o)):r.push(e)));const a=v(this.data,r);return!a&&!i&&!e&&t.indexOf(".")>-1&&(t=r[0],i=r[1],e=r.slice(2).join(".")),!a&&n&&d(e)?I(this.data?.[t]?.[i],e,o):a}addResource(t,i,e,s,o={silent:!1}){const n=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let r=[t,i];e&&(r=r.concat(n?e.split(n):e)),t.indexOf(".")>-1&&(r=t.split("."),s=i,i=r[1]),this.addNamespaces(i),w(this.data,r,s),o.silent||this.emit("added",t,i,e,s)}addResources(t,i,e,s={silent:!1}){for(const s in e)(d(e[s])||Array.isArray(e[s]))&&this.addResource(t,i,s,e[s],{silent:!0});s.silent||this.emit("added",t,i,e)}addResourceBundle(t,i,e,s,o,n={silent:!1,skipCopy:!1}){let r=[t,i];t.indexOf(".")>-1&&(r=t.split("."),s=e,e=i,i=r[1]),this.addNamespaces(i);let a=v(this.data,r)||{};n.skipCopy||(e=JSON.parse(JSON.stringify(e))),s?x(a,e,o):a={...a,...e},w(this.data,r,a),n.silent||this.emit("added",t,i,e)}removeResourceBundle(t,i){this.hasResourceBundle(t,i)&&delete this.data[t][i],this.removeNamespaces(i),this.emit("removed",t,i)}hasResourceBundle(t,i){return void 0!==this.getResource(t,i)}getResourceBundle(t,i){return i||(i=this.options.defaultNS),this.getResource(t,i)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const i=this.getDataByLanguage(t);return!!(i&&Object.keys(i)||[]).find((t=>i[t]&&Object.keys(i[t]).length>0))}toJSON(){return this.data}}var C={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,i,e,s,o){return t.forEach((t=>{i=this.processors[t]?.process(i,e,s,o)??i})),i}};const D=Symbol("i18next/PATH_KEY");function N(t,i){const{[D]:e}=t(function(){const t=[],i=Object.create(null);let e;return i.get=(s,o)=>(e?.revoke?.(),o===D?t:(t.push(o),e=Proxy.revocable(s,i),e.proxy)),Proxy.revocable(Object.create(null),i).proxy}()),s=i?.keySeparator??".",o=i?.nsSeparator??":";if(e.length>1&&o){const t=i?.ns,n=Array.isArray(t)?t:null;if(n&&n.length>1&&n.slice(1).includes(e[0]))return`${e[0]}${o}${e.slice(1).join(s)}`}return e.join(s)}const R={},T=t=>!d(t)&&"boolean"!=typeof t&&"number"!=typeof t;class K extends P{constructor(t,i={}){var e,s;super(),e=t,s=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((t=>{e[t]&&(s[t]=e[t])})),this.options=i,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=L.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,i={interpolation:{}}){const e={...i};if(null==t)return!1;const s=this.resolve(t,e);if(void 0===s?.res)return!1;const o=T(s.res);return!1!==e.returnObjects||!o}extractFromKey(t,i){let e=void 0!==i.nsSeparator?i.nsSeparator:this.options.nsSeparator;void 0===e&&(e=":");const s=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let o=i.ns||this.options.defaultNS||[];const n=e&&t.indexOf(e)>-1,r=!(this.options.userDefinedKeySeparator||i.keySeparator||this.options.userDefinedNsSeparator||i.nsSeparator||((t,i,e)=>{i=i||"",e=e||"";const s=S.filter((t=>i.indexOf(t)<0&&e.indexOf(t)<0));if(0===s.length)return!0;const o=E.getRegExp(`(${s.map((t=>"?"===t?"\\?":t)).join("|")})`);let n=!o.test(t);if(!n){const i=t.indexOf(e);i>0&&!o.test(t.substring(0,i))&&(n=!0)}return n})(t,e,s));if(n&&!r){const i=t.match(this.interpolator.nestingRegexp);if(i&&i.length>0)return{key:t,namespaces:d(o)?[o]:o};const n=t.split(e);(e!==s||e===s&&this.options.ns.indexOf(n[0])>-1)&&(o=n.shift()),t=n.join(s)}return{key:t,namespaces:d(o)?[o]:o}}translate(t,i,e){let s="object"==typeof i?{...i}:i;if("object"!=typeof s&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof s&&(s={...s}),s||(s={}),null==t)return"";"function"==typeof t&&(t=N(t,{...this.options,...s})),Array.isArray(t)||(t=[String(t)]),t=t.map((t=>"function"==typeof t?N(t,{...this.options,...s}):String(t)));const o=void 0!==s.returnDetails?s.returnDetails:this.options.returnDetails,n=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,{key:r,namespaces:a}=this.extractFromKey(t[t.length-1],s),h=a[a.length-1];let l=void 0!==s.nsSeparator?s.nsSeparator:this.options.nsSeparator;void 0===l&&(l=":");const u=s.lng||this.language,c=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===u?.toLowerCase())return c?o?{res:`${h}${l}${r}`,usedKey:r,exactUsedKey:r,usedLng:u,usedNS:h,usedParams:this.getUsedParamsDetails(s)}:`${h}${l}${r}`:o?{res:r,usedKey:r,exactUsedKey:r,usedLng:u,usedNS:h,usedParams:this.getUsedParamsDetails(s)}:r;const g=this.resolve(t,s);let p=g?.res;const f=g?.usedKey||r,m=g?.exactUsedKey||r,y=void 0!==s.joinArrays?s.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,w=void 0!==s.count&&!d(s.count),v=K.hasDefaultValue(s),x=w?this.pluralResolver.getSuffix(u,s.count,s):"",$=s.ordinal&&w?this.pluralResolver.getSuffix(u,s.count,{ordinal:!1}):"",k=w&&!s.ordinal&&0===s.count,A=k&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${x}`]||s[`defaultValue${$}`]||s.defaultValue;let S=p;b&&!p&&v&&(S=A);const E=T(S),I=Object.prototype.toString.apply(S);if(!(b&&S&&E&&["[object Number]","[object Function]","[object RegExp]"].indexOf(I)<0)||d(y)&&Array.isArray(S))if(b&&d(y)&&Array.isArray(p))p=p.join(y),p&&(p=this.extendTranslation(p,t,s,e));else{let i=!1,o=!1;!this.isValidLookup(p)&&v&&(i=!0,p=A),this.isValidLookup(p)||(o=!0,p=r);const a=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:p,c=v&&A!==p&&this.options.updateMissing;if(o||i||c){if(this.logger.log(c?"updateKey":"missingKey",u,h,r,c?A:p),n){const t=this.resolve(r,{...s,keySeparator:!1});t&&t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let t=[];const i=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if("fallback"===this.options.saveMissingTo&&i&&i[0])for(let e=0;e<i.length;e++)t.push(i[e]);else"all"===this.options.saveMissingTo?t=this.languageUtils.toResolveHierarchy(s.lng||this.language):t.push(s.lng||this.language);const e=(t,i,e)=>{const o=v&&e!==p?e:a;this.options.missingKeyHandler?this.options.missingKeyHandler(t,h,i,o,c,s):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(t,h,i,o,c,s),this.emit("missingKey",t,h,i,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&w?t.forEach((t=>{const i=this.pluralResolver.getSuffixes(t,s);k&&s[`defaultValue${this.options.pluralSeparator}zero`]&&i.indexOf(`${this.options.pluralSeparator}zero`)<0&&i.push(`${this.options.pluralSeparator}zero`),i.forEach((i=>{e([t],r+i,s[`defaultValue${i}`]||A)}))})):e(t,r,A))}p=this.extendTranslation(p,t,s,g,e),o&&p===r&&this.options.appendNamespaceToMissingKey&&(p=`${h}${l}${r}`),(o||i)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${l}${r}`:r,i?p:void 0,s))}else{if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,S,{...s,ns:a}):`key '${r} (${this.language})' returned an object instead of string.`;return o?(g.res=t,g.usedParams=this.getUsedParamsDetails(s),g):t}if(n){const t=Array.isArray(S),i=t?[]:{},e=t?m:f;for(const t in S)if(Object.prototype.hasOwnProperty.call(S,t)){const o=`${e}${n}${t}`;i[t]=this.translate(o,v&&!p?{...s,defaultValue:T(A)?A[t]:void 0,joinArrays:!1,ns:a}:{...s,joinArrays:!1,ns:a}),i[t]===o&&(i[t]=S[t])}p=i}}return o?(g.res=p,g.usedParams=this.getUsedParamsDetails(s),g):p}extendTranslation(t,i,e,s,o){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...e},e.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!e.skipInterpolation){e.interpolation&&this.interpolator.init({...e,interpolation:{...this.options.interpolation,...e.interpolation}});const n=d(t)&&(void 0!==e?.interpolation?.skipOnVariables?e.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let r;if(n){const i=t.match(this.interpolator.nestingRegexp);r=i&&i.length}let a=e.replace&&!d(e.replace)?e.replace:e;if(this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),t=this.interpolator.interpolate(t,a,e.lng||this.language||s.usedLng,e),n){const i=t.match(this.interpolator.nestingRegexp);r<(i&&i.length)&&(e.nest=!1)}!e.lng&&s&&s.res&&(e.lng=this.language||s.usedLng),!1!==e.nest&&(t=this.interpolator.nest(t,((...t)=>o?.[0]!==t[0]||e.context?this.translate(...t,i):(this.logger.warn(`It seems you are nesting recursively key: ${t[0]} in key: ${i[0]}`),null)),e)),e.interpolation&&this.interpolator.reset()}const n=e.postProcess||this.options.postProcess,r=d(n)?[n]:n;return null!=t&&r?.length&&!1!==e.applyPostProcessor&&(t=C.handle(r,t,i,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(e)},...e}:e,this)),t}resolve(t,i={}){let e,s,o,n,r;return d(t)&&(t=[t]),Array.isArray(t)&&(t=t.map((t=>"function"==typeof t?N(t,{...this.options,...i}):t))),t.forEach((t=>{if(this.isValidLookup(e))return;const a=this.extractFromKey(t,i),h=a.key;s=h;let l=a.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const u=void 0!==i.count&&!d(i.count),c=u&&!i.ordinal&&0===i.count,g=void 0!==i.context&&(d(i.context)||"number"==typeof i.context)&&""!==i.context,p=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);l.forEach((t=>{this.isValidLookup(e)||(r=t,R[`${p[0]}-${t}`]||!this.utils?.hasLoadedNamespace||this.utils?.hasLoadedNamespace(r)||(R[`${p[0]}-${t}`]=!0,this.logger.warn(`key "${s}" for languages "${p.join(", ")}" won't get resolved as namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((s=>{if(this.isValidLookup(e))return;n=s;const r=[h];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(r,h,s,t,i);else{let t;u&&(t=this.pluralResolver.getSuffix(s,i.count,i));const e=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(i.ordinal&&0===t.indexOf(o)&&r.push(h+t.replace(o,this.options.pluralSeparator)),r.push(h+t),c&&r.push(h+e)),g){const s=`${h}${this.options.contextSeparator||"_"}${i.context}`;r.push(s),u&&(i.ordinal&&0===t.indexOf(o)&&r.push(s+t.replace(o,this.options.pluralSeparator)),r.push(s+t),c&&r.push(s+e))}}let a;for(;a=r.pop();)this.isValidLookup(e)||(o=a,e=this.getResource(s,t,a,i))})))}))})),{res:e,usedKey:s,exactUsedKey:o,usedLng:n,usedNS:r}}isValidLookup(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}getResource(t,i,e,s={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,i,e,s):this.resourceStore.getResource(t,i,e,s)}getUsedParamsDetails(t={}){const i=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],e=t.replace&&!d(t.replace);let s=e?t.replace:t;if(e&&void 0!==t.count&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!e){s={...s};for(const t of i)delete s[t]}return s}static hasDefaultValue(t){for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&"defaultValue"===i.substring(0,12)&&void 0!==t[i])return!0;return!1}}class H{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=L.create("languageUtils")}getScriptPartFromCode(t){if(!(t=W(t))||t.indexOf("-")<0)return null;const i=t.split("-");return 2===i.length?null:(i.pop(),"x"===i[i.length-1].toLowerCase()?null:this.formatLanguageCode(i.join("-")))}getLanguagePartFromCode(t){if(!(t=W(t))||t.indexOf("-")<0)return t;const i=t.split("-");return this.formatLanguageCode(i[0])}formatLanguageCode(t){if(d(t)&&t.indexOf("-")>-1){let i;try{i=Intl.getCanonicalLocales(t)[0]}catch(t){}return i&&this.options.lowerCaseLng&&(i=i.toLowerCase()),i||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let i;return t.forEach((t=>{if(i)return;const e=this.formatLanguageCode(t);this.options.supportedLngs&&!this.isSupportedCode(e)||(i=e)})),!i&&this.options.supportedLngs&&t.forEach((t=>{if(i)return;const e=this.getScriptPartFromCode(t);if(this.isSupportedCode(e))return i=e;const s=this.getLanguagePartFromCode(t);if(this.isSupportedCode(s))return i=s;i=this.options.supportedLngs.find((t=>t===s?t:t.indexOf("-")<0&&s.indexOf("-")<0?void 0:t.indexOf("-")>0&&s.indexOf("-")<0&&t.substring(0,t.indexOf("-"))===s||0===t.indexOf(s)&&s.length>1?t:void 0))})),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}getFallbackCodes(t,i){if(!t)return[];if("function"==typeof t&&(t=t(i)),d(t)&&(t=[t]),Array.isArray(t))return t;if(!i)return t.default||[];let e=t[i];return e||(e=t[this.getScriptPartFromCode(i)]),e||(e=t[this.formatLanguageCode(i)]),e||(e=t[this.getLanguagePartFromCode(i)]),e||(e=t.default),e||[]}toResolveHierarchy(t,i){const e=this.getFallbackCodes((!1===i?[]:i)||this.options.fallbackLng||[],t),s=[],o=t=>{t&&(this.isSupportedCode(t)?s.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return d(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(t))):d(t)&&o(this.formatLanguageCode(t)),e.forEach((t=>{s.indexOf(t)<0&&o(this.formatLanguageCode(t))})),s}}const z={zero:0,one:1,two:2,few:3,many:4,other:5},B={select:t=>1===t?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class F{constructor(t,i={}){this.languageUtils=t,this.options=i,this.logger=L.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,i={}){const e=W("dev"===t?"en":t),s=i.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:e,type:s});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let n;try{n=new Intl.PluralRules(e,{type:s})}catch(e){if("undefined"==typeof Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),B;if(!t.match(/-|_/))return B;const s=this.languageUtils.getLanguagePartFromCode(t);n=this.getRule(s,i)}return this.pluralRulesCache[o]=n,n}needsPlural(t,i={}){let e=this.getRule(t,i);return e||(e=this.getRule("dev",i)),e?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,i,e={}){return this.getSuffixes(t,e).map((t=>`${i}${t}`))}getSuffixes(t,i={}){let e=this.getRule(t,i);return e||(e=this.getRule("dev",i)),e?e.resolvedOptions().pluralCategories.sort(((t,i)=>z[t]-z[i])).map((t=>`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${t}`)):[]}getSuffix(t,i,e={}){const s=this.getRule(t,e);return s?`${this.options.prepend}${e.ordinal?`ordinal${this.options.prepend}`:""}${s.select(i)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",i,e))}}const q=(t,i,e,s=".",o=!0)=>{let n=((t,i,e)=>{const s=v(t,e);return void 0!==s?s:v(i,e)})(t,i,e);return!n&&o&&d(e)&&(n=I(t,e,s),void 0===n&&(n=I(i,e,s))),n},V=t=>t.replace(/\$/g,"$$$$");class _{constructor(t={}){this.logger=L.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(t=>t),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:i,escapeValue:e,useRawValueToEscape:s,prefix:o,prefixEscaped:n,suffix:r,suffixEscaped:a,formatSeparator:h,unescapeSuffix:l,unescapePrefix:u,nestingPrefix:c,nestingPrefixEscaped:d,nestingSuffix:g,nestingSuffixEscaped:p,nestingOptionsSeparator:f,maxReplaces:m,alwaysFormat:y}=t.interpolation;this.escape=void 0!==i?i:A,this.escapeValue=void 0===e||e,this.useRawValueToEscape=void 0!==s&&s,this.prefix=o?$(o):n||"{{",this.suffix=r?$(r):a||"}}",this.formatSeparator=h||",",this.unescapePrefix=l?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":l||"",this.nestingPrefix=c?$(c):d||$("$t("),this.nestingSuffix=g?$(g):p||$(")"),this.nestingOptionsSeparator=f||",",this.maxReplaces=m||1e3,this.alwaysFormat=void 0!==y&&y,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(t,i)=>t?.source===i?(t.lastIndex=0,t):new RegExp(i,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,i,e,s){let o,n,r;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=t=>{if(t.indexOf(this.formatSeparator)<0){const o=q(i,a,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,e,{...s,...i,interpolationkey:t}):o}const o=t.split(this.formatSeparator),n=o.shift().trim(),r=o.join(this.formatSeparator).trim();return this.format(q(i,a,n,this.options.keySeparator,this.options.ignoreJSONStructure),r,e,{...s,...i,interpolationkey:n})};this.resetRegExp();const l=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=void 0!==s?.interpolation?.skipOnVariables?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:t=>V(t)},{regex:this.regexp,safeValue:t=>V(this.escapeValue?this.escape(t):t)}].forEach((i=>{for(r=0;o=i.regex.exec(t);){const e=o[1].trim();if(n=h(e),void 0===n)if("function"==typeof l){const i=l(t,o,s);n=d(i)?i:""}else if(s&&Object.prototype.hasOwnProperty.call(s,e))n="";else{if(u){n=o[0];continue}this.logger.warn(`missed to pass in variable ${e} for interpolating ${t}`),n=""}else d(n)||this.useRawValueToEscape||(n=p(n));const a=i.safeValue(n);if(t=t.replace(o[0],a),u?(i.regex.lastIndex+=n.length,i.regex.lastIndex-=o[0].length):i.regex.lastIndex=0,r++,r>=this.maxReplaces)break}})),t}nest(t,i,e={}){let s,o,n;const r=(t,i)=>{const e=this.nestingOptionsSeparator;if(t.indexOf(e)<0)return t;const s=t.split(new RegExp(`${$(e)}[ ]*{`));let o=`{${s[1]}`;t=s[0],o=this.interpolate(o,n);const r=o.match(/'/g),a=o.match(/"/g);((r?.length??0)%2==0&&!a||(a?.length??0)%2!=0)&&(o=o.replace(/'/g,'"'));try{n=JSON.parse(o),i&&(n={...i,...n})}catch(i){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,i),`${t}${e}${o}`}return n.defaultValue&&n.defaultValue.indexOf(this.prefix)>-1&&delete n.defaultValue,t};for(;s=this.nestingRegexp.exec(t);){let a=[];n={...e},n=n.replace&&!d(n.replace)?n.replace:n,n.applyPostProcessor=!1,delete n.defaultValue;const h=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(-1!==h&&(a=s[1].slice(h).split(this.formatSeparator).map((t=>t.trim())).filter(Boolean),s[1]=s[1].slice(0,h)),o=i(r.call(this,s[1].trim(),n),n),o&&s[0]===t&&!d(o))return o;d(o)||(o=p(o)),o||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),o=""),a.length&&(o=a.reduce(((t,i)=>this.format(t,i,e.lng,{...e,interpolationkey:s[1].trim()})),o.trim())),t=t.replace(s[0],o),this.regexp.lastIndex=0}return t}}const U=t=>{const i={};return(e,s,o)=>{let n=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(n={...n,[o.interpolationkey]:void 0});const r=s+JSON.stringify(n);let a=i[r];return a||(a=t(W(s),o),i[r]=a),a(e)}},J=t=>(i,e,s)=>t(W(e),s)(i);class Y{constructor(t={}){this.logger=L.create("formatter"),this.options=t,this.init(t)}init(t,i={interpolation:{}}){this.formatSeparator=i.interpolation.formatSeparator||",";const e=i.cacheInBuiltFormats?U:J;this.formats={number:e(((t,i)=>{const e=new Intl.NumberFormat(t,{...i});return t=>e.format(t)})),currency:e(((t,i)=>{const e=new Intl.NumberFormat(t,{...i,style:"currency"});return t=>e.format(t)})),datetime:e(((t,i)=>{const e=new Intl.DateTimeFormat(t,{...i});return t=>e.format(t)})),relativetime:e(((t,i)=>{const e=new Intl.RelativeTimeFormat(t,{...i});return t=>e.format(t,i.range||"day")})),list:e(((t,i)=>{const e=new Intl.ListFormat(t,{...i});return t=>e.format(t)}))}}add(t,i){this.formats[t.toLowerCase().trim()]=i}addCached(t,i){this.formats[t.toLowerCase().trim()]=U(i)}format(t,i,e,s={}){const o=i.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find((t=>t.indexOf(")")>-1))){const t=o.findIndex((t=>t.indexOf(")")>-1));o[0]=[o[0],...o.splice(1,t)].join(this.formatSeparator)}return o.reduce(((t,i)=>{const{formatName:o,formatOptions:n}=(t=>{let i=t.toLowerCase().trim();const e={};if(t.indexOf("(")>-1){const s=t.split("(");i=s[0].toLowerCase().trim();const o=s[1].substring(0,s[1].length-1);"currency"===i&&o.indexOf(":")<0?e.currency||(e.currency=o.trim()):"relativetime"===i&&o.indexOf(":")<0?e.range||(e.range=o.trim()):o.split(";").forEach((t=>{if(t){const[i,...s]=t.split(":"),o=s.join(":").trim().replace(/^'+|'+$/g,""),n=i.trim();e[n]||(e[n]=o),"false"===o&&(e[n]=!1),"true"===o&&(e[n]=!0),isNaN(o)||(e[n]=parseInt(o,10))}}))}return{formatName:i,formatOptions:e}})(i);if(this.formats[o]){let i=t;try{const r=s?.formatParams?.[s.interpolationkey]||{};i=this.formats[o](t,r.locale||r.lng||s.locale||s.lng||e,{...n,...s,...r})}catch(t){this.logger.warn(t)}return i}return this.logger.warn(`there was no format function for ${o}`),t}),t)}}class G extends P{constructor(t,i,e,s={}){super(),this.backend=t,this.store=i,this.services=e,this.languageUtils=e.languageUtils,this.options=s,this.logger=L.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(e,s.backend,s)}queueLoad(t,i,e,s){const o={},n={},r={},a={};return t.forEach((t=>{let s=!0;i.forEach((i=>{const r=`${t}|${i}`;!e.reload&&this.store.hasResourceBundle(t,i)?this.state[r]=2:this.state[r]<0||(1===this.state[r]?void 0===n[r]&&(n[r]=!0):(this.state[r]=1,s=!1,void 0===n[r]&&(n[r]=!0),void 0===o[r]&&(o[r]=!0),void 0===a[i]&&(a[i]=!0)))})),s||(r[t]=!0)})),(Object.keys(o).length||Object.keys(n).length)&&this.queue.push({pending:n,pendingCount:Object.keys(n).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(o),pending:Object.keys(n),toLoadLanguages:Object.keys(r),toLoadNamespaces:Object.keys(a)}}loaded(t,i,e){const s=t.split("|"),o=s[0],n=s[1];i&&this.emit("failedLoading",o,n,i),!i&&e&&this.store.addResourceBundle(o,n,e,void 0,void 0,{skipCopy:!0}),this.state[t]=i?-1:2,i&&e&&(this.state[t]=0);const r={};this.queue.forEach((e=>{((t,i,e)=>{const{obj:s,k:o}=b(t,i,Object);s[o]=s[o]||[],s[o].push(e)})(e.loaded,[o],n),((t,i)=>{void 0!==t.pending[i]&&(delete t.pending[i],t.pendingCount--)})(e,t),i&&e.errors.push(i),0!==e.pendingCount||e.done||(Object.keys(e.loaded).forEach((t=>{r[t]||(r[t]={});const i=e.loaded[t];i.length&&i.forEach((i=>{void 0===r[t][i]&&(r[t][i]=!0)}))})),e.done=!0,e.errors.length?e.callback(e.errors):e.callback())})),this.emit("loaded",r),this.queue=this.queue.filter((t=>!t.done))}read(t,i,e,s=0,o=this.retryTimeout,n){if(!t.length)return n(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:t,ns:i,fcName:e,tried:s,wait:o,callback:n});this.readingCalls++;const r=(r,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}r&&a&&s<this.maxRetries?setTimeout((()=>{this.read.call(this,t,i,e,s+1,2*o,n)}),o):n(r,a)},a=this.backend[e].bind(this.backend);if(2!==a.length)return a(t,i,r);try{const e=a(t,i);e&&"function"==typeof e.then?e.then((t=>r(null,t))).catch(r):r(null,e)}catch(t){r(t)}}prepareLoading(t,i,e={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();d(t)&&(t=this.languageUtils.toResolveHierarchy(t)),d(i)&&(i=[i]);const o=this.queueLoad(t,i,e,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach((t=>{this.loadOne(t)}))}load(t,i,e){this.prepareLoading(t,i,{},e)}reload(t,i,e){this.prepareLoading(t,i,{reload:!0},e)}loadOne(t,i=""){const e=t.split("|"),s=e[0],o=e[1];this.read(s,o,"read",void 0,void 0,((e,n)=>{e&&this.logger.warn(`${i}loading namespace ${o} for language ${s} failed`,e),!e&&n&&this.logger.log(`${i}loaded namespace ${o} for language ${s}`,n),this.loaded(t,e,n)}))}saveMissing(t,i,e,s,o,n={},r=()=>{}){if(!this.services?.utils?.hasLoadedNamespace||this.services?.utils?.hasLoadedNamespace(i)){if(null!=e&&""!==e){if(this.backend?.create){const a={...n,isUpdate:o},h=this.backend.create.bind(this.backend);if(h.length<6)try{let o;o=5===h.length?h(t,i,e,s,a):h(t,i,e,s),o&&"function"==typeof o.then?o.then((t=>r(null,t))).catch(r):r(null,o)}catch(t){r(t)}else h(t,i,e,s,r,a)}t&&t[0]&&this.store.addResource(t[0],i,e,s)}}else this.logger.warn(`did not save key "${e}" as the namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const Q=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let i={};if("object"==typeof t[1]&&(i=t[1]),d(t[1])&&(i.defaultValue=t[1]),d(t[2])&&(i.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){const e=t[3]||t[2];Object.keys(e).forEach((t=>{i[t]=e[t]}))}return i},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Z=t=>(d(t.ns)&&(t.ns=[t.ns]),d(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),d(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),"boolean"==typeof t.initImmediate&&(t.initAsync=t.initImmediate),t),X=()=>{},tt="__i18next_supportNoticeShown";class it extends P{constructor(t={},i){var e;if(super(),this.options=Z(t),this.services={},this.logger=L,this.modules={external:[]},e=this,Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})),i&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,i),this;setTimeout((()=>{this.init(t,i)}),0)}}init(t={},i){this.isInitializing=!0,"function"==typeof t&&(i=t,t={}),null==t.defaultNS&&t.ns&&(d(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const e=Q();var s;this.options={...e,...this.options,...Z(t)},this.options.interpolation={...e.interpolation,...this.options.interpolation},void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=e.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||(s=this,s?.modules?.backend?.name?.indexOf("Locize")>0||s?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||s?.options?.backend?.backends&&s.options.backend.backends.some((t=>t?.name?.indexOf("Locize")>0||t?.constructor?.name?.indexOf("Locize")>0))||s?.options?.backend?.projectId||s?.options?.backend?.backendOptions&&s.options.backend.backendOptions.some((t=>t?.projectId)))||"undefined"!=typeof globalThis&&globalThis[tt]||"undefined"!=typeof process&&process.env&&process.env.I18NEXT_NO_SUPPORT_NOTICE||"undefined"!=typeof process&&process.env||("undefined"!=typeof console&&void 0!==console.info&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),"undefined"!=typeof globalThis&&(globalThis[tt]=!0));const o=t=>t?"function"==typeof t?new t:t:null;if(!this.options.isClone){let t;L.init(this.modules.logger?o(this.modules.logger):null,this.options),t=this.modules.formatter?this.modules.formatter:Y;const i=new H(this.options);this.store=new M(this.options.resources,this.options);const s=this.services;s.logger=L,s.resourceStore=this.store,s.languageUtils=i,s.pluralResolver=new F(i,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==e.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!t||this.options.interpolation.format&&this.options.interpolation.format!==e.interpolation.format||(s.formatter=o(t),s.formatter.init&&s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new _(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new G(o(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",((t,...i)=>{this.emit(t,...i)})),this.modules.languageDetector&&(s.languageDetector=o(this.modules.languageDetector),s.languageDetector.init&&s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=o(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new K(this.services,this.options),this.translator.on("*",((t,...i)=>{this.emit(t,...i)})),this.modules.external.forEach((t=>{t.init&&t.init(this)}))}if(this.format=this.options.interpolation.format,i||(i=X),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=(...i)=>this.store[t](...i)})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=(...i)=>(this.store[t](...i),this)}));const n=g(),r=()=>{const t=(t,e)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),n.resolve(e),i(t,e)};if(this.languages&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initAsync?r():setTimeout(r,0),n}loadResources(t,i=X){let e=i;const s=d(t)?t:this.language;if("function"==typeof t&&(e=t),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===s?.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return e();const t=[],i=i=>{i&&"cimode"!==i&&this.services.languageUtils.toResolveHierarchy(i).forEach((i=>{"cimode"!==i&&t.indexOf(i)<0&&t.push(i)}))};s?i(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((t=>i(t))),this.options.preload?.forEach?.((t=>i(t))),this.services.backendConnector.load(t,this.options.ns,(t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),e(t)}))}else e(null)}reloadResources(t,i,e){const s=g();return"function"==typeof t&&(e=t,t=void 0),"function"==typeof i&&(e=i,i=void 0),t||(t=this.languages),i||(i=this.options.ns),e||(e=X),this.services.backendConnector.reload(t,i,(t=>{s.resolve(),e(t)})),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&C.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1)){for(let t=0;t<this.languages.length;t++){const i=this.languages[t];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,i){this.isLanguageChangingTo=t;const e=g();this.emit("languageChanging",t);const s=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},o=(o,n)=>{n?this.isLanguageChangingTo===t&&(s(n),this.translator.changeLanguage(n),this.isLanguageChangingTo=void 0,this.emit("languageChanged",n),this.logger.log("languageChanged",n)):this.isLanguageChangingTo=void 0,e.resolve(((...t)=>this.t(...t))),i&&i(o,((...t)=>this.t(...t)))},n=i=>{t||i||!this.services.languageDetector||(i=[]);const e=d(i)?i:i&&i[0],n=this.store.hasLanguageSomeTranslations(e)?e:this.services.languageUtils.getBestMatchFromCodes(d(i)?[i]:i);n&&(this.language||s(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector?.cacheUserLanguage?.(n)),this.loadResources(n,(t=>{o(t,n)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(n):this.services.languageDetector.detect(n):n(t):n(this.services.languageDetector.detect()),e}getFixedT(t,i,e){const s=(t,i,...o)=>{let n;n="object"!=typeof i?this.options.overloadTranslationOptionHandler([t,i].concat(o)):{...i},n.lng=n.lng||s.lng,n.lngs=n.lngs||s.lngs,n.ns=n.ns||s.ns,""!==n.keyPrefix&&(n.keyPrefix=n.keyPrefix||e||s.keyPrefix);const r={...this.options,...n};"function"==typeof n.keyPrefix&&(n.keyPrefix=N(n.keyPrefix,r));const a=this.options.keySeparator||".";let h;return n.keyPrefix&&Array.isArray(t)?h=t.map((t=>("function"==typeof t&&(t=N(t,r)),`${n.keyPrefix}${a}${t}`))):("function"==typeof t&&(t=N(t,r)),h=n.keyPrefix?`${n.keyPrefix}${a}${t}`:t),this.t(h,n)};return d(t)?s.lng=t:s.lngs=t,s.ns=i,s.keyPrefix=e,s}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,i={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const e=i.lng||this.resolvedLanguage||this.languages[0],s=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===e.toLowerCase())return!0;const n=(t,i)=>{const e=this.services.backendConnector.state[`${t}|${i}`];return-1===e||0===e||2===e};if(i.precheck){const t=i.precheck(this,n);if(void 0!==t)return t}return!(!this.hasResourceBundle(e,t)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!n(e,t)||s&&!n(o,t)))}loadNamespaces(t,i){const e=g();return this.options.ns?(d(t)&&(t=[t]),t.forEach((t=>{this.options.ns.indexOf(t)<0&&this.options.ns.push(t)})),this.loadResources((t=>{e.resolve(),i&&i(t)})),e):(i&&i(),Promise.resolve())}loadLanguages(t,i){const e=g();d(t)&&(t=[t]);const s=this.options.preload||[],o=t.filter((t=>s.indexOf(t)<0&&this.services.languageUtils.isSupportedCode(t)));return o.length?(this.options.preload=s.concat(o),this.loadResources((t=>{e.resolve(),i&&i(t)})),e):(i&&i(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const i=new Intl.Locale(t);if(i&&i.getTextInfo){const t=i.getTextInfo();if(t&&t.direction)return t.direction}}catch(t){}const i=this.services?.languageUtils||new H(Q());return t.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(i.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},i){const e=new it(t,i);return e.createInstance=it.createInstance,e}cloneInstance(t={},i=X){const e=t.forkResourceStore;e&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},o=new it(s);if(void 0===t.debug&&void 0===t.prefix||(o.logger=o.logger.clone(t)),["store","services","language"].forEach((t=>{o[t]=this[t]})),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},e){const t=Object.keys(this.store.data).reduce(((t,i)=>(t[i]={...this.store.data[i]},t[i]=Object.keys(t[i]).reduce(((e,s)=>(e[s]={...t[i][s]},e)),t[i]),t)),{});o.store=new M(t,s),o.services.resourceStore=o.store}if(t.interpolation){const i={...Q().interpolation,...this.options.interpolation,...t.interpolation},e={...s,interpolation:i};o.services.interpolator=new _(e)}return o.translator=new K(o.services,s),o.translator.on("*",((t,...i)=>{o.emit(t,...i)})),o.init(s,i),o.translator.options=s,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const et=it.createInstance(),{slice:st,forEach:ot}=[],nt=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,rt={create(t,i,e,s){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{path:"/",sameSite:"strict"};e&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+60*e*1e3)),s&&(o.domain=s),document.cookie=function(t,i){const e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{path:"/"};let s=`${t}=${encodeURIComponent(i)}`;if(e.maxAge>0){const t=e.maxAge-0;if(Number.isNaN(t))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(t)}`}if(e.domain){if(!nt.test(e.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${e.domain}`}if(e.path){if(!nt.test(e.path))throw new TypeError("option path is invalid");s+=`; Path=${e.path}`}if(e.expires){if("function"!=typeof e.expires.toUTCString)throw new TypeError("option expires is invalid");s+=`; Expires=${e.expires.toUTCString()}`}if(e.httpOnly&&(s+="; HttpOnly"),e.secure&&(s+="; Secure"),e.sameSite)switch("string"==typeof e.sameSite?e.sameSite.toLowerCase():e.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return e.partitioned&&(s+="; Partitioned"),s}(t,i,o)},read(t){const i=`${t}=`,e=document.cookie.split(";");for(let t=0;t<e.length;t++){let s=e[t];for(;" "===s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(i))return s.substring(i.length,s.length)}return null},remove(t,i){this.create(t,"",-1,i)}};var at={name:"cookie",lookup(t){let{lookupCookie:i}=t;if(i&&"undefined"!=typeof document)return rt.read(i)||void 0},cacheUserLanguage(t,i){let{lookupCookie:e,cookieMinutes:s,cookieDomain:o,cookieOptions:n}=i;e&&"undefined"!=typeof document&&rt.create(e,t,s,o,n)}},ht={name:"querystring",lookup(t){let i,{lookupQuerystring:e}=t;if("undefined"!=typeof window){let{search:t}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(t=window.location.hash.substring(window.location.hash.indexOf("?")));const s=t.substring(1).split("&");for(let t=0;t<s.length;t++){const o=s[t].indexOf("=");o>0&&s[t].substring(0,o)===e&&(i=s[t].substring(o+1))}}return i}},lt={name:"hash",lookup(t){let i,{lookupHash:e,lookupFromHashIndex:s}=t;if("undefined"!=typeof window){const{hash:t}=window.location;if(t&&t.length>2){const o=t.substring(1);if(e){const t=o.split("&");for(let s=0;s<t.length;s++){const o=t[s].indexOf("=");o>0&&t[s].substring(0,o)===e&&(i=t[s].substring(o+1))}}if(i)return i;if(!i&&s>-1){const i=t.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(i))return;const e="number"==typeof s?s:0;return i[e]?.replace("/","")}}}return i}};let ut=null;const ct=()=>{if(null!==ut)return ut;try{if(ut="undefined"!=typeof window&&null!==window.localStorage,!ut)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch(t){ut=!1}return ut};var dt={name:"localStorage",lookup(t){let{lookupLocalStorage:i}=t;if(i&&ct())return window.localStorage.getItem(i)||void 0},cacheUserLanguage(t,i){let{lookupLocalStorage:e}=i;e&&ct()&&window.localStorage.setItem(e,t)}};let gt=null;const pt=()=>{if(null!==gt)return gt;try{if(gt="undefined"!=typeof window&&null!==window.sessionStorage,!gt)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch(t){gt=!1}return gt};var ft={name:"sessionStorage",lookup(t){let{lookupSessionStorage:i}=t;if(i&&pt())return window.sessionStorage.getItem(i)||void 0},cacheUserLanguage(t,i){let{lookupSessionStorage:e}=i;e&&pt()&&window.sessionStorage.setItem(e,t)}},mt={name:"navigator",lookup(t){const i=[];if("undefined"!=typeof navigator){const{languages:t,userLanguage:e,language:s}=navigator;if(t)for(let e=0;e<t.length;e++)i.push(t[e]);e&&i.push(e),s&&i.push(s)}return i.length>0?i:void 0}},yt={name:"htmlTag",lookup(t){let i,{htmlTag:e}=t;const s=e||("undefined"!=typeof document?document.documentElement:null);return s&&"function"==typeof s.getAttribute&&(i=s.getAttribute("lang")),i}},bt={name:"path",lookup(t){let{lookupFromPathIndex:i}=t;if("undefined"==typeof window)return;const e=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(!Array.isArray(e))return;const s="number"==typeof i?i:0;return e[s]?.replace("/","")}},wt={name:"subdomain",lookup(t){let{lookupFromSubdomainIndex:i}=t;const e="number"==typeof i?i+1:1,s="undefined"!=typeof window&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(s)return s[e]}};let vt=!1;try{vt=!0}catch(t){}const xt=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];vt||xt.splice(1,1);class $t{constructor(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,i)}init(){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{languageUtils:{}},this.options=function(t){return ot.call(st.call(arguments,1),(i=>{if(i)for(const e in i)void 0===t[e]&&(t[e]=i[e])})),t}(t,this.options||{},{order:xt,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t}),"string"==typeof this.options.convertDetectedLanguage&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=t=>t.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(at),this.addDetector(ht),this.addDetector(dt),this.addDetector(ft),this.addDetector(mt),this.addDetector(yt),this.addDetector(bt),this.addDetector(wt),this.addDetector(lt)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.order).forEach((i=>{if(this.detectors[i]){let e=this.detectors[i].lookup(this.options);e&&"string"==typeof e&&(e=[e]),e&&(t=t.concat(e))}})),t=t.filter((t=>{return null!=t&&!("string"==typeof(i=t)&&[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some((t=>t.test(i))));var i})).map((t=>this.options.convertDetectedLanguage(t))),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?t:t.length>0?t[0]:null}cacheUserLanguage(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.caches;i&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||i.forEach((i=>{this.detectors[i]&&this.detectors[i].cacheUserLanguage(t,this.options)})))}}$t.type="languageDetector";et.use($t).init({resources:{en:{translation:{"Do you want to exit? button":"Do you want to exit?","Exit button":"Exit","Continue playing button":"Continue playing","Drop the elements to match the given symbol order":"Drop the elements to match the given symbol order","Fill in the blanks":"Fill in the blanks",instruction:{dragAndDrop:"Match the items by dragging and dropping them into the correct places.",mcq:"Select the correct answer from the options provided.",tracing:"Trace the shape by following the outline carefully.",flashcards:"Review the flashcards to reinforce your learning.",substractionWithImage:"substractionWithImageEngAudio",substractionWithoutImage:"substractionWithoutImageEngAudio",numberIdentificationWithImage:"numberIdentificationWithImageEngAudio",numberIdentificationWithoutImage:"numberIdentificationWithoutImageEngAudio",wordBuildingWithImage:"wordBuildingWithImageEngAudio",wordBuildingWithoutImage:"wordBuildingWithoutImageEngAudio",pictureClues:"pictureCluesEngAudio",pictureWordMatchMultipleImages:"pictureWordMatchMultipleImagesEngAudio",pictureWordMatchSingleImage:"pictureWordMatchSingleImageEngAudio",sentenceMatch:"sentenceMatchEngAudio",imageMatch:"imageMatchEngAudio",palStoryTale:"palStoryTaleEngAudio",palEgmaPatternMatching:"palEgmaPatternMatchingEngAudio",palEgmaWordProblemDragnDrop:"palEgmaWordProblemDragnDropEngAudio",palEgmaWordProblemClick:"palEgmaWordProblemClickEngAudio",palEgraOddOneOut:"palEgraOddOneOutEngAudio",palEgraArrangePictures:"palEgraArrangePicturesEngAudio",palEgraBuildWord:"palEgraBuildWordEngAudio",palEgraWordFormation:"palEgraWordFormationEngAudio",palInventedSpelling:"palInventedSpellingEngAudio",palLetterIdentification:"palLetterIdentificationEngAudio",palStoryMaking:"palStoryMakingEngAudio",palegmasumtogether:"palegmasumtogetherEngAudio",palegmamultioption:"palegmamultioptionEngAudio",palegraoptionaudio:"palegraoptionaudioEngAudio",palegrawordmatch:"palegrawordmatchEngAudio",palegramcqimages:"palegramcqimagesEngAudio"}}},fr:{translation:{"Do you want to exit? button":"Voulez-vous quitter?","Exit button":"Quitter","Continue playing button":"Continuer à jouer","Drop the elements to match the given symbol order":"Déposez les éléments pour correspondre au symbole donné","Fill in the blanks":"Remplissez les blancs",instruction:{dragAndDrop:"Faites glisser les objets vers le bon emplacement.",mcq:"Choisissez la bonne réponse parmi les options proposées.",tracing:"Tracez soigneusement la forme en suivant la ligne.",flashcards:"Regardez les cartes mémoire pour renforcer l’apprentissage."}}},hi:{translation:{"Do you want to exit? button":"क्या आप बाहर निकलना चाहते हैं?","Exit button":"बाहर निकलें","Continue playing button":"खेलना जारी रखें","Drop the elements to match the given symbol order":"दिए गए चिन्ह से मिलाने के लिए तत्वों को ड्रॉप करें","Fill in the blanks":"रिक्त स्थान भरें",instruction:{dragAndDrop:"Match the items by dragging and dropping them into the correct places.",mcq:"Select the correct answer from the options provided.",tracing:"Trace the shape by following the outline carefully.",flashcards:"Review the flashcards to reinforce your learning.",substractionWithImage:"substractionWithImageHiAudio",substractionWithoutImage:"substractionWithoutImageHiAudio",numberIdentificationWithImage:"numberIdentificationWithImageHiAudio",numberIdentificationWithoutImage:"numberIdentificationWithoutImageHiAudio",wordBuildingWithImage:"wordBuildingWithImageHiAudio",wordBuildingWithoutImage:"wordBuildingWithoutImageHiAudio",pictureClues:"pictureCluesHiAudio",pictureWordMatchMultipleImages:"pictureWordMatchMultipleImagesHiAudio",pictureWordMatchSingleImage:"pictureWordMatchSingleImageHiAudio",sentenceMatch:"sentenceMatchHiAudio",imageMatch:"imageMatchHiAudio",palStoryTale:"palStoryTaleHiAudio",palEgmaPatternMatching:"palEgmaPatternMatchingHiAudio",palEgmaWordProblemDragnDrop:"palEgmaWordProblemDragnDropHiAudio",palEgmaWordProblemClick:"palEgmaWordProblemClickHiAudio",palEgraOddOneOut:"palEgraOddOneOutHiAudio",palEgraArrangePictures:"palEgraArrangePicturesHiAudio",palEgraBuildWord:"palEgraBuildWordHiAudio",palEgraWordFormation:"palEgraWordFormationHiAudio",palInventedSpelling:"palInventedSpellingHiAudio",palLetterIdentification:"palLetterIdentificationHiAudio",palStoryMaking:"palStoryMakingHiAudio",palegmasumtogether:"palegmasumtogetherHiAudio",palegmamultioption:"palegmamultioptionHiAudio",palegraoptionaudio:"palegraoptionaudioHiAudio",palegrawordmatch:"palegrawordmatchHiAudio",palegramcqimages:"palegramcqimagesHiAudio"}}},kn:{translation:{"Do you want to exit? button":"ನೀವು ನಿರ್ಗಮಿಸಲು ಬಯಸುವಿರಾ?","Exit button":"ನಿರ್ಗಮಿಸು","Continue playing button":"ಆಟವನ್ನು ಮುಂದುವರಿಸಿ","Drop the elements to match the given symbol order":"ನೀಡಿರುವ ಸಂಕೇತಕ್ಕೆ ಹೊಂದುವಂತೆ ಅಂಶಗಳನ್ನು ಬಿಡಿ","Fill in the blanks":"ಖಾಲಿ ಸ್ಥಳಗಳನ್ನು ಭರ್ತಿ ಮಾಡಿ",instruction:{dragAndDrop:"Match the items by dragging and dropping them into the correct places.",mcq:"Select the correct answer from the options provided.",tracing:"Trace the shape by following the outline carefully.",flashcards:"Review the flashcards to reinforce your learning.",substractionWithImage:"substractionWithImageKaAudio",substractionWithoutImage:"substractionWithoutImageKaAudio",numberIdentificationWithImage:"numberIdentificationWithImageKaAudio",numberIdentificationWithoutImage:"numberIdentificationWithoutImageKaAudio",wordBuildingWithImage:"wordBuildingWithImageKaAudio",wordBuildingWithoutImage:"wordBuildingWithoutImageKaAudio",pictureClues:"pictureCluesKaAudio",pictureWordMatchMultipleImages:"pictureWordMatchMultipleImagesKaAudio",pictureWordMatchSingleImage:"pictureWordMatchSingleImageKaAudio",sentenceMatch:"sentenceMatchKaAudio",imageMatch:"imageMatchKaAudio",palStoryTale:"palStoryTaleKaAudio",palEgmaPatternMatching:"palEgmaPatternMatchingKaAudio",palEgmaWordProblemDragnDrop:"palEgmaWordProblemDragnDropKaAudio",palEgmaWordProblemClick:"palEgmaWordProblemClickKaAudio",palEgraOddOneOut:"palEgraOddOneOutKaAudio",palEgraArrangePictures:"palEgraArrangePicturesKaAudio",palEgraBuildWord:"palEgraBuildWordKaAudio",palEgraWordFormation:"palEgraWordFormationKaAudio",palInventedSpelling:"palInventedSpellingKaAudio",palLetterIdentification:"palLetterIdentificationKaAudio",palStoryMaking:"palStoryMakingKaAudio",palegmasumtogether:"palegmasumtogetherKaAudio",palegmamultioption:"palegmamultioptionKaAudio",palegraoptionaudio:"palegraoptionaudioKaAudio",palegrawordmatch:"palegrawordmatchKaAudio",palegramcqimages:"palegramcqimagesKaAudio"}}},te:{translation:{"Do you want to exit? button":"మీరు బయటకు వెళ్లాలనుకుంటున్నారా?","Exit button":"బయటకు వెళ్ళు","Continue playing button":"ఆటను కొనసాగించు","Drop the elements to match the given symbol order":"ఇచ్చిన చిహ్నానికి సరిపడేలా అంశాలను డ్రాప్ చేయಂడಿ","Fill in the blanks":"ಖಾಲಿ ಸ್ಥಳಗಳನ್ನು ಭರ್ತಿ ಮಾಡಿ"}},pt:{translation:{"Do you want to exit? button":"Você deseja sair?","Exit button":"Sair","Continue playing button":"Continuar jogando","Drop the elements to match the given symbol order":"Solte os elementos para corresponder à ordem dos símbolos fornecida","Fill in the blanks":"Preencha os espaços em branco"}},mr:{translation:{"Do you want to exit? button":"तुम्हाला बाहेर पडायचे आहे का?","Exit button":"बाहेर पडा","Continue playing button":"खेळ सुरू ठेवा",instruction:{dragAndDrop:"वस्तू योग्य ठिकाणी ओढून आणि सोडून जुळवा.",mcq:"दिलेल्या पर्यायांमधून योग्य उत्तर निवडा.",tracing:"रेषेचा काळजीपूर्वक मागोवा घेत आकृती काढा.",flashcards:"तुमचे शिक्षण मजबूत करण्यासाठी फ्लॅशकार्ड्स पाहा."}}}},fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1},detection:{order:["querystring","localStorage","navigator","htmlTag"],caches:["localStorage"]}});const kt=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.showSpeakIcon=!1,this.id="",this.value="",this.requiredDrops="",this.string="",this.fontFamily="",this.fontSize="20px",this.fontColor="",this.highlightWhileSpeaking=!1,this.height="auto",this.width="auto",this.ariaLabel="",this.ariaHidden="",this.move="false",this.x="0px",this.y="0px",this.z="0",this.bgColor="",this.borderImage="",this.type="",this.tabIndex=0,this.visible=!1,this.audio="",this.onTouch="",this.onInCorrect="",this.onCorrect="",this.minDrops=1,this.maxDrops=1,this.onEntry="",this.margin="",this.padding="",this.borderRadius="0px",this.spanType="",this.style={},this.handleWindowResize=()=>this.updateStyles(),this.handleWindowLoad=()=>this.updateStyles(),this.delayVisible="",this.disableSpeak=!1}componentDidLoad(){if(s(this.el,this.delayVisible),o(this.el,this.type),"words"!==this.spanType&&"letters"!==this.spanType||this.addSpanToText(),this.showSpeakIcon&&n(this.el),!this.audio||""===this.audio.trim()){const t=()=>{const t=this.resolveAutoAudio();t&&(this.audio=t)};window.__LIDO_COMMON_AUDIO_PATH__?t():window.addEventListener(r,t,{once:!0})}}resolveAutoAudio(){const t=window[c];return t&&this.string?`${t}/${this.string}.mp3`:null}componentWillLoad(){this.updateStyles(),window.addEventListener("resize",this.handleWindowResize),window.addEventListener("load",this.handleWindowLoad)}disconnectedCallback(){window.removeEventListener("resize",this.handleWindowResize),window.removeEventListener("load",this.handleWindowLoad)}updateStyles(){const t=this.borderImage?a(this.borderImage):"",i=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:h(this.height,i),width:h(this.width,i),backgroundColor:h(this.bgColor,i),top:h(this.y,i),left:h(this.x,i),zIndex:this.z,fontSize:h(this.fontSize,i),fontFamily:this.fontFamily,color:h(this.fontColor,i),display:"true"===h(`${this.visible}`,i)?"flex":"none",borderImage:`url(${t})`,borderImageSlice:t?"0 fill":"",margin:h(this.margin,i),padding:h(this.padding,i),borderRadius:h(this.borderRadius,i)}}async addSpanToText(){const t=this.el.querySelector(".lido-text-content");if(!t)return;const i=t.textContent||"";t.innerHTML="","letters"===this.spanType&&i.split("").forEach((i=>{if(""===i.trim())return;const e=document.createElement("span");e.textContent=i,e.className="text-letters",t.appendChild(e)})),"words"===this.spanType&&i.split(" ").forEach((i=>{const e=document.createElement("span");e.textContent=i,e.className="text-words",t.appendChild(e)}))}render(){const t=et.t(this.string).replace(/_phonics?/gi,"");return l(u,{key:"44bb34e461d90e1832066986454c5b0f8c392617",class:"lido-text",value:this.value,"required-drops":this.requiredDrops,type:this.type,"tab-index":this.tabIndex,audio:this.audio,onTouch:this.onTouch,onCorrect:this.onCorrect,onInCorrect:this.onInCorrect,onEntry:this.onEntry,minDrops:this.minDrops,maxDrops:this.maxDrops,id:this.id,style:this.style,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,move:this.move,"span-type":this.spanType,"disable-speak":`${this.disableSpeak}`},""!==this.spanType?l("div",{class:"lido-text-content"}," ",t):t)}get el(){return this}static get style(){return".lido-text{transition:background-color 0.3s ease;user-select:none;align-items:center;justify-content:center;text-align:center;border-radius:24px;color:#333;cursor:pointer;font-family:'Baloo Bhai 2', serif}.text-letters{transition:color 0.3s, text-shadow 0.3s;display:inline-block;padding:0 2px}.text-letters.letter-highlight{color:#8e24aa;background:none;border-radius:0;text-shadow:0 2px 8px #8e24aa88;animation:text-letter-bounce 0.4s}.text-words{transition:color 0.3s, text-shadow 0.3s;display:inline-block;padding:0 2px}.text-words.word-highlight{color:#8e24aa;background:none;border-radius:0;text-shadow:0 2px 8px #8e24aa88;animation:text-word-bounce 0.4s}@keyframes text-letter-bounce{0%{transform:scale(1)}60%{transform:scale(1.4)}100%{transform:scale(1)}}@keyframes text-word-bounce{0%{transform:scale(1)}60%{transform:scale(1.3)}100%{transform:scale(1)}}"}},[0,"lido-text",{showSpeakIcon:[4,"show-speak-icon"],id:[1],value:[1],requiredDrops:[1,"required-drops"],string:[1],fontFamily:[1,"font-family"],fontSize:[1,"font-size"],fontColor:[1,"font-color"],highlightWhileSpeaking:[4,"highlight-while-speaking"],height:[1],width:[1],ariaLabel:[1,"aria-label"],ariaHidden:[1,"aria-hidden"],move:[1],x:[1],y:[1],z:[1],bgColor:[1,"bg-color"],borderImage:[1,"border-image"],type:[1],tabIndex:[2,"tab-index"],visible:[8],audio:[1],onTouch:[1,"on-touch"],onInCorrect:[1,"on-in-correct"],onCorrect:[1,"on-correct"],minDrops:[2,"min-drops"],maxDrops:[2,"max-drops"],onEntry:[1,"on-entry"],margin:[1],padding:[1],borderRadius:[1,"border-radius"],spanType:[1,"span-type"],delayVisible:[1,"delay-visible"],disableSpeak:[4,"disable-speak"],style:[32]}]);function At(){"undefined"!=typeof customElements&&["lido-text"].forEach((i=>{"lido-text"===i&&(customElements.get(t(i))||customElements.define(t(i),kt))}))}At();export{kt as L,At as d,et as i}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t,p as i,H as e,c as a,i as s,getAssetPath as o,a as h,h as n,b as l}from"./index.js";const d=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.pivotimage="",this.scaleimage="",this.handlerimage="",this.fill="brown",this.tilt=0,this.maxTilt=9.5,this.onEntry="",this.height="auto",this.width="auto",this.x="0px",this.y="0px",this.z="0",this.visible=!1,this.margin="",this.padding="",this.balanceSymbol="=",this.showSymbol=!1,this.operation="count",this.pivotSvg="",this.scaleSvg="",this.handlerSvg="",this.style={},this.tiltf=0,this.leftVal=0,this.rightVal=0,this.currentAngle=0}async revealSymbol(){this.showSymbol=!0}async hideSymbol(){this.showSymbol=!1}async componentWillLoad(){this.updateStyles(),this.pivotSvg=await this.fetchAndApplyFill(a(this.pivotimage)),this.scaleSvg=await this.fetchAndApplyFill(a(this.scaleimage)),this.handlerSvg=await this.fetchAndApplyFill(a(this.handlerimage))}componentDidLoad(){this.animateBalance(),this.leftParentEl=document.getElementById("leftparent"),this.rightParentEl=document.getElementById("rightparent"),s(this.el)}disconnectedCallback(){null!=this.animationFrameId&&cancelAnimationFrame(this.animationFrameId)}async fetchAndApplyFill(t){try{const i=await fetch(t);if(!i.ok)return"";let e=await i.text();return e=e.replace(/fill="[^"]*"/g,""),e=e.replace(/stroke="[^"]*"/g,""),e=e.replace(/<svg([^>]*)>/,`<svg$1 fill="${this.fill}" stroke="${this.fill}">`),e}catch(t){return console.error("SVG fetch failed:",t),""}}tiltChanged(t){this.tiltf=t}async updateTilt(t,i){const e=Math.max(-5,Math.min(5,i-t));await new Promise((t=>setTimeout(t,700))),this.tiltf=e}animateBalance(){const t=()=>{let i=this.tiltf/5*this.maxTilt;if(i>this.maxTilt&&(i=this.maxTilt),i<-this.maxTilt&&(i=-this.maxTilt),this.currentAngle+=.1*(i-this.currentAngle),this.currentAngle>this.maxTilt&&(this.currentAngle=this.maxTilt),this.currentAngle<-this.maxTilt&&(this.currentAngle=-this.maxTilt),this.scaleEl&&(this.scaleEl.style.transform=`rotate(${this.currentAngle}deg)`,this.scaleEl.style.transformOrigin="50% 80%"),this.leftParentEl&&this.rightParentEl){const t=window.innerHeight>window.innerWidth,i=this.currentAngle/this.maxTilt*(t?40:60);this.leftParentEl.style.transform=`translateY(${-i}px)`,this.rightParentEl.style.transform=`translateY(${i}px)`}if(this.leftHandleEl&&this.rightHandleEl){const t=window.innerHeight>window.innerWidth,i=this.currentAngle/this.maxTilt*(t?40:60);this.leftHandleEl.style.transform=`translateY(${-i}px)`,this.rightHandleEl.style.transform=`translateY(${i}px)`}this.animationFrameId=requestAnimationFrame(t)};t()}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:h(this.height,t),width:h(this.width,t),top:h(this.y,t),left:h(this.x,t),zIndex:this.z,display:"true"===h(`${this.visible}`,t)?"flex":"none",margin:h(this.margin,t),padding:h(this.padding,t),"--lido-balance-shadow-url":`url(${o("assets/Shadow.svg")})`}}render(){return n(l,{key:"
|
|
1
|
+
import{t,p as i,H as e,c as a,i as s,getAssetPath as o,a as h,h as n,b as l}from"./index.js";const d=i(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.pivotimage="",this.scaleimage="",this.handlerimage="",this.fill="brown",this.tilt=0,this.maxTilt=9.5,this.onEntry="",this.height="auto",this.width="auto",this.x="0px",this.y="0px",this.z="0",this.visible=!1,this.margin="",this.padding="",this.balanceSymbol="=",this.showSymbol=!1,this.operation="count",this.pivotSvg="",this.scaleSvg="",this.handlerSvg="",this.style={},this.tiltf=0,this.leftVal=0,this.rightVal=0,this.currentAngle=0}async revealSymbol(){this.showSymbol=!0}async hideSymbol(){this.showSymbol=!1}async componentWillLoad(){this.updateStyles(),this.pivotSvg=await this.fetchAndApplyFill(a(this.pivotimage)),this.scaleSvg=await this.fetchAndApplyFill(a(this.scaleimage)),this.handlerSvg=await this.fetchAndApplyFill(a(this.handlerimage))}componentDidLoad(){this.animateBalance(),this.leftParentEl=document.getElementById("leftparent"),this.rightParentEl=document.getElementById("rightparent"),s(this.el)}disconnectedCallback(){null!=this.animationFrameId&&cancelAnimationFrame(this.animationFrameId)}async fetchAndApplyFill(t){try{const i=await fetch(t);if(!i.ok)return"";let e=await i.text();return e=e.replace(/fill="[^"]*"/g,""),e=e.replace(/stroke="[^"]*"/g,""),e=e.replace(/<svg([^>]*)>/,`<svg$1 fill="${this.fill}" stroke="${this.fill}">`),e}catch(t){return console.error("SVG fetch failed:",t),""}}tiltChanged(t){this.tiltf=t}async updateTilt(t,i){const e=Math.max(-5,Math.min(5,i-t));await new Promise((t=>setTimeout(t,700))),this.tiltf=e}animateBalance(){const t=()=>{let i=this.tiltf/5*this.maxTilt;if(i>this.maxTilt&&(i=this.maxTilt),i<-this.maxTilt&&(i=-this.maxTilt),this.currentAngle+=.1*(i-this.currentAngle),this.currentAngle>this.maxTilt&&(this.currentAngle=this.maxTilt),this.currentAngle<-this.maxTilt&&(this.currentAngle=-this.maxTilt),this.scaleEl&&(this.scaleEl.style.transform=`rotate(${this.currentAngle}deg)`,this.scaleEl.style.transformOrigin="50% 80%"),this.leftParentEl&&this.rightParentEl){const t=window.innerHeight>window.innerWidth,i=this.currentAngle/this.maxTilt*(t?40:60);this.leftParentEl.style.transform=`translateY(${-i}px)`,this.rightParentEl.style.transform=`translateY(${i}px)`}if(this.leftHandleEl&&this.rightHandleEl){const t=window.innerHeight>window.innerWidth,i=this.currentAngle/this.maxTilt*(t?40:60);this.leftHandleEl.style.transform=`translateY(${-i}px)`,this.rightHandleEl.style.transform=`translateY(${i}px)`}this.animationFrameId=requestAnimationFrame(t)};t()}updateStyles(){const t=window.innerHeight>window.innerWidth?"portrait":"landscape";this.style={height:h(this.height,t),width:h(this.width,t),top:h(this.y,t),left:h(this.x,t),zIndex:this.z,display:"true"===h(`${this.visible}`,t)?"flex":"none",margin:h(this.margin,t),padding:h(this.padding,t),"--lido-balance-shadow-url":`url(${o("assets/Shadow.svg")})`}}render(){return n(l,{key:"24eaa92142462fb2177b164d1f4f773deba5abc7",id:"lido-balance","bg-color":"red",onEntry:this.onEntry,class:"lido-balance",tilt:this.tilt.toString(),style:this.style,operation:this.operation.toString(),"pivot-image":this.pivotSvg,"scale-image":this.scaleSvg,"handler-image":this.handlerSvg},n("div",{key:"b8f95e748f8286cbedc45d1a7d54d8fdb671520f",innerHTML:this.pivotSvg,id:"pivotimg",class:"pivot"}),n("div",{key:"8877a0eee0f9662a2ef65fe6fc5f8426b3fa1d67",innerHTML:this.scaleSvg,id:"scaleimg",class:"scale",ref:t=>this.scaleEl=t}),n("div",{key:"9e93a52334facad8b582041185c89db879844ac1",innerHTML:this.handlerSvg,id:"handlerimg",class:"handler",ref:t=>this.leftHandleEl=t}),n("div",{key:"3a8bdea23a2a7cd8d923637186ae71fc39eeedb3",innerHTML:this.handlerSvg,id:"handimg",class:"hand",ref:t=>this.rightHandleEl=t}),n("div",{key:"0d0967805aa8b3e86e1220c53a18610f7106d425",id:"balanceSymbol",class:"lido-balance-symbol","aria-hidden":!this.showSymbol},this.showSymbol?this.balanceSymbol:""))}static get assetsDirs(){return["assets"]}get el(){return this}static get watchers(){return{tilt:[{tiltChanged:0}]}}static get style(){return'#lido-balance{position:relative;height:500px;width:1205px;top:20%;left:-91px;z-index:0}.lido-balance-symbol{position:absolute;top:64%;left:50%;transform:translate(-50%, -50%);font-size:5vw;font-weight:bold;color:black;pointer-events:none;z-index:999}@media (orientation: portrait){.lido-balance-shadow{height:100px;position:absolute;top:80%;left:28%}}@media (orientation: landscape){.lido-balance-shadow{height:100px;position:absolute;top:90%;left:33%}}@media (orientation: portrait){#pivotimg{position:absolute;height:auto;width:23%;bottom:18%;left:38%;z-index:100}}#pivotimg::after{content:"";position:absolute;bottom:-30px;left:50%;transform:translateX(-50%);width:120%;height:60px;background-image:var(--lido-balance-shadow-url);background-size:contain;background-repeat:no-repeat;background-position:center;pointer-events:none;z-index:10}@media (orientation: landscape){#pivotimg{position:absolute;height:auto;width:23%;bottom:8%;left:38%;z-index:100}}.lido-balance .pivot svg{width:100%;height:auto}#scaleimg{position:absolute;width:73%;height:auto;top:61%;left:14%;z-index:90}.lido-balance .scale svg{width:100%;height:auto}@media (orientation: landscape){#handlerimg{position:absolute;width:35%;height:auto;top:49%;left:2%}}@media (orientation:portrait ){#handlerimg{position:absolute;width:35%;height:auto;top:53%;left:2%}}.lido-balance .handler svg{width:100%;height:auto;fill:brown}@media (orientation: landscape){#handimg{position:absolute;width:35%;height:auto;top:49%;right:2%}}@media (orientation:portrait){#handimg{position:absolute;width:35%;height:auto;top:53%;right:2%}}.lido-balance .hand svg{width:100%;height:auto;fill:brown}.pivot svg path:nth-of-type(1){fill:brown}.pivot svg path[d^="M78.9414"]{fill:white}'}},[0,"lido-balance",{pivotimage:[1],scaleimage:[1],handlerimage:[1],fill:[1],tilt:[2],maxTilt:[2,"max-tilt"],onEntry:[1,"on-entry"],height:[1],width:[1],x:[1],y:[1],z:[1],visible:[8],margin:[1],padding:[1],balanceSymbol:[1537,"balance-symbol"],showSymbol:[1540,"show-symbol"],operation:[1],pivotSvg:[32],scaleSvg:[32],handlerSvg:[32],style:[32],tiltf:[32],leftVal:[32],rightVal:[32],revealSymbol:[64],hideSymbol:[64],updateTilt:[64]},void 0,{tilt:[{tiltChanged:0}]}]);function r(){"undefined"!=typeof customElements&&["lido-balance"].forEach((i=>{"lido-balance"===i&&(customElements.get(t(i))||customElements.define(t(i),d))}))}r();export{d as L,r as d}
|