@runfusion/fusion 0.43.1 → 0.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/dist/automation-store-EKXXEE2S.js +10 -0
  2. package/dist/automation-store-PLNG3X72.js +10 -0
  3. package/dist/automation-store-RDDYZFUJ.js +10 -0
  4. package/dist/bin.js +8097 -1796
  5. package/dist/chunk-2JI3F6MG.js +948 -0
  6. package/dist/chunk-4L6CLWJC.js +8345 -0
  7. package/dist/chunk-4VNS5WPM.js +42 -0
  8. package/dist/chunk-5RGECGQL.js +1139 -0
  9. package/dist/chunk-6JDLN7IL.js +409 -0
  10. package/dist/chunk-AICJATVW.js +948 -0
  11. package/dist/chunk-AWKNRUOR.js +1148 -0
  12. package/dist/chunk-BHM3UYWS.js +4651 -0
  13. package/dist/chunk-BMUXDSBF.js +4647 -0
  14. package/dist/chunk-GETECT6V.js +353 -0
  15. package/dist/chunk-GUV4QQT3.js +1143 -0
  16. package/dist/chunk-JKQO7YYZ.js +8369 -0
  17. package/dist/chunk-LYZVU6UV.js +409 -0
  18. package/dist/chunk-MAN4WYHO.js +353 -0
  19. package/dist/chunk-MCUG2Z7M.js +4651 -0
  20. package/dist/chunk-PSDYB45U.js +948 -0
  21. package/dist/chunk-RR2HM46R.js +8345 -0
  22. package/dist/chunk-RXMQ5OMY.js +9226 -0
  23. package/dist/chunk-S2EVJUY3.js +353 -0
  24. package/dist/chunk-UXR5XZFZ.js +409 -0
  25. package/dist/client/.vite/manifest.json +272 -261
  26. package/dist/client/assets/{AgentDetailView-BGN03dyz.css → AgentDetailView-CanIeYHg.css} +1 -1
  27. package/dist/client/assets/{AgentDetailView-DKMz3r04.js → AgentDetailView-DxV8pFHX.js} +3 -3
  28. package/dist/client/assets/{AgentPermissionPolicyEditor-BiY1a4KR.js → AgentPermissionPolicyEditor--YS4iMUY.js} +2 -2
  29. package/dist/client/assets/AgentsView-BVILQjdS.css +1 -0
  30. package/dist/client/assets/{AgentsView-Co-k4vjh.js → AgentsView-CTzbcvhK.js} +3 -3
  31. package/dist/client/assets/ChatView-COygcnyk.js +6 -0
  32. package/dist/client/assets/CommandCenter-CTaopaC0.css +1 -0
  33. package/dist/client/assets/CommandCenter-DoKX2HWm.js +56 -0
  34. package/dist/client/assets/DevServerView-Cyevyvqx.js +1 -0
  35. package/dist/client/assets/{DirectoryPicker-DTKtd8L2.css → DirectoryPicker-0rspvcMz.css} +1 -1
  36. package/dist/client/assets/{DirectoryPicker-CkcGjyv0.js → DirectoryPicker-DBdyXEhR.js} +1 -1
  37. package/dist/client/assets/DocumentsView-BzSMyrns.js +1 -0
  38. package/dist/client/assets/{EvalsView-CUfyj5GW.js → EvalsView-ikz00o9g.js} +1 -1
  39. package/dist/client/assets/ExperimentalAgentOnboardingModal-CZ_jbgep.css +1 -0
  40. package/dist/client/assets/{ExperimentalAgentOnboardingModal-Dau9RTU_.js → ExperimentalAgentOnboardingModal-D-rzCCET.js} +10 -10
  41. package/dist/client/assets/GoalsView-Bfu1Oy2-.js +2 -0
  42. package/dist/client/assets/GoalsView-rg9VSIza.css +1 -0
  43. package/dist/client/assets/{InsightsView-BQPxHxKI.js → InsightsView-Cgmf5nES.js} +1 -1
  44. package/dist/client/assets/InsightsView-LMv1M1dU.css +1 -0
  45. package/dist/client/assets/MemoryView-DkEuDKQs.js +2 -0
  46. package/dist/client/assets/{NodesView-CSMvGwDU.js → NodesView-B_KYfS4o.js} +3 -3
  47. package/dist/client/assets/{PiExtensionsManager-BtqXF3fl.js → PiExtensionsManager-Dz69kkKs.js} +2 -2
  48. package/dist/client/assets/PluginManager-DSiHizRD.css +1 -0
  49. package/dist/client/assets/{PluginManager-CSSDb3VO.js → PluginManager-LHCVcduP.js} +1 -1
  50. package/dist/client/assets/PullRequestView-3AdbS2a1.css +1 -0
  51. package/dist/client/assets/{PullRequestView-Bjyfffdu.js → PullRequestView-DBJutLLl.js} +2 -2
  52. package/dist/client/assets/{ResearchView-CRU_NPho.js → ResearchView-gpn1XcVy.js} +1 -1
  53. package/dist/client/assets/{SecretsView-Bs8ySyC5.js → SecretsView-B7YqIowt.js} +1 -1
  54. package/dist/client/assets/SessionTerminal-9l4bdKcn.js +2 -0
  55. package/dist/client/assets/SessionTerminal-BNgtmXb3.css +1 -0
  56. package/dist/client/assets/SettingsModal-BGEK9_9A.js +31 -0
  57. package/dist/client/assets/{SettingsModal-DpAxDq6M.css → SettingsModal-CKv0TJfM.css} +1 -1
  58. package/dist/client/assets/SettingsModal-CXogw-Er.css +1 -0
  59. package/dist/client/assets/{SettingsModal-Nw5cTKAK.js → SettingsModal-DIIoHGUH.js} +1 -1
  60. package/dist/client/assets/{SetupWizardModal-CE79myEy.js → SetupWizardModal-BcVeMxeX.js} +1 -1
  61. package/dist/client/assets/{SkillsView-Dc8YskAX.js → SkillsView-BxSJ4PHL.js} +1 -1
  62. package/dist/client/assets/{StashRecoveryView-CqKOFiXT.js → StashRecoveryView-BhFQ2FsP.js} +1 -1
  63. package/dist/client/assets/{TodoView-BqIRwcZw.js → TodoView-BZpewjy0.js} +2 -2
  64. package/dist/client/assets/WorkflowNodeEditor-Yn1FRF2v.css +1 -0
  65. package/dist/client/assets/WorkflowNodeEditor-tWsgCdVt.js +8 -0
  66. package/dist/client/assets/{addon-fit-B4jkcKk4.js → addon-fit-SnYDEvGm.js} +1 -1
  67. package/dist/client/assets/{addon-unicode11-Cdne2Sj4.js → addon-unicode11-s5GoZCpi.js} +1 -1
  68. package/dist/client/assets/{addon-web-links-CRNLzj7m.js → addon-web-links-jjt2f_oV.js} +1 -1
  69. package/dist/client/assets/{addon-webgl-CeCSULF1.js → addon-webgl-Icn-RnEx.js} +1 -1
  70. package/dist/client/assets/{app-sEkTyT-w.js → app-BmGA0Hiz.js} +3 -3
  71. package/dist/client/assets/{app-BffGU_HQ.js → app-CEVYlVuJ.js} +3 -3
  72. package/dist/client/assets/{app-C8AHhs5N.js → app-CbBFax2C.js} +3 -3
  73. package/dist/client/assets/{app-B2ZxMfJT.js → app-DORKrGAz.js} +3 -3
  74. package/dist/client/assets/{app-Ri9Te2Dv.js → app-DQibuQ9z.js} +3 -3
  75. package/dist/client/assets/app-k76GrQP0.js +13 -0
  76. package/dist/client/assets/{createLucideIcon-BYvOGRiO.js → createLucideIcon-DmVITl5d.js} +1 -1
  77. package/dist/client/assets/{dashboard-view-C3SsjXo1.js → dashboard-view-B4LXCv5H.js} +4 -4
  78. package/dist/client/assets/{dashboard-view-DlKsVySD.js → dashboard-view-BFoyhTYF.js} +1 -1
  79. package/dist/client/assets/{dashboard-view-BhbN8LPh.js → dashboard-view-Cxzm_eqc.js} +1 -1
  80. package/dist/client/assets/dashboard-view-_8yfNwju.css +1 -0
  81. package/dist/client/assets/{folder-open-Bw1mxVfa.js → folder-open-33WGVnbp.js} +1 -1
  82. package/dist/client/assets/index-Bglw05rM.js +791 -0
  83. package/dist/client/assets/index-FYgnflWD.css +1 -0
  84. package/dist/client/assets/shield-alert-CqeGWBUK.js +6 -0
  85. package/dist/client/assets/{upload-BCmd-1I0.js → upload-C11J2diI.js} +1 -1
  86. package/dist/client/assets/{users-DO_t3V1p.js → users-a-ELbyyZ.js} +1 -1
  87. package/dist/client/assets/{vendor-i18n-CV0mwX_-.js → vendor-i18n-DYlSUfot.js} +1 -1
  88. package/dist/client/assets/vendor-react-BTgM5bbZ.js +49 -0
  89. package/dist/client/assets/{vendor-reactflow-CRZcPCXF.js → vendor-reactflow-ZasuEfF9.js} +3 -3
  90. package/dist/client/assets/{vendor-xterm-tcedd2Jt.js → vendor-xterm-ea7-K05z.js} +1 -1
  91. package/dist/client/assets/{x-CqNX_9E2.js → x-PItWc-wQ.js} +1 -1
  92. package/dist/client/assets/{zoom-out-CSTHbJgD.js → zoom-out-CzlHv0Kj.js} +1 -1
  93. package/dist/client/icons/icon-192.png +0 -0
  94. package/dist/client/icons/icon-512.png +0 -0
  95. package/dist/client/index.html +6 -6
  96. package/dist/client/sw.js +1 -1
  97. package/dist/client/theme-data.css +288 -285
  98. package/dist/client/version.json +1 -1
  99. package/dist/droid-cli/package.json +1 -1
  100. package/dist/droid-cli/src/__tests__/execsync-guard.test.ts +17 -0
  101. package/dist/droid-cli/src/__tests__/process-manager.test.ts +1 -45
  102. package/dist/extension.js +4780 -793
  103. package/dist/extract-zip-WL55Z3AU.js +2497 -0
  104. package/dist/index.min-CHQ3ABYJ.js +2926 -0
  105. package/dist/memory-dreams-7USISKVE.js +32 -0
  106. package/dist/memory-dreams-PBPISUDD.js +32 -0
  107. package/dist/memory-dreams-XNO2B2QF.js +32 -0
  108. package/dist/migration-EH2YOCYQ.js +15 -0
  109. package/dist/migration-PLGTTKL5.js +15 -0
  110. package/dist/migration-WZEZK22R.js +15 -0
  111. package/dist/pi-claude-cli/index.ts +47 -8
  112. package/dist/pi-claude-cli/package.json +4 -1
  113. package/dist/pi-claude-cli/src/__tests__/acp-dispatch.test.ts +80 -0
  114. package/dist/pi-claude-cli/src/__tests__/acp-driver.test.ts +423 -0
  115. package/dist/pi-claude-cli/src/__tests__/execsync-guard.test.ts +14 -0
  116. package/dist/pi-claude-cli/src/__tests__/process-manager.test.ts +1 -45
  117. package/dist/pi-claude-cli/src/__tests__/provider.test.ts +0 -1
  118. package/dist/pi-claude-cli/src/acp-driver.ts +585 -0
  119. package/dist/pi-claude-cli/src/event-bridge.ts +7 -0
  120. package/dist/pi-claude-cli/src/mcp-config.ts +29 -0
  121. package/dist/pi-claude-cli/src/process-manager.ts +6 -38
  122. package/dist/plugin-sdk/index.d.ts +5179 -5144
  123. package/dist/plugins/fusion-plugin-acp-runtime/bundled.js +263 -19
  124. package/dist/plugins/fusion-plugin-acp-runtime/package.json +1 -1
  125. package/dist/plugins/fusion-plugin-cli-printing-press/package.json +1 -1
  126. package/dist/plugins/fusion-plugin-compound-engineering/bundled.js +37 -7
  127. package/dist/plugins/fusion-plugin-compound-engineering/manifest.json +4 -4
  128. package/dist/plugins/fusion-plugin-compound-engineering/package.json +1 -1
  129. package/dist/plugins/fusion-plugin-cursor-runtime/package.json +1 -1
  130. package/dist/plugins/fusion-plugin-dependency-graph/package.json +1 -1
  131. package/dist/plugins/fusion-plugin-droid-runtime/bundled.js +1 -1
  132. package/dist/plugins/fusion-plugin-droid-runtime/package.json +1 -1
  133. package/dist/plugins/fusion-plugin-hermes-runtime/package.json +1 -1
  134. package/dist/plugins/fusion-plugin-openclaw-runtime/package.json +1 -1
  135. package/dist/plugins/fusion-plugin-paperclip-runtime/package.json +1 -1
  136. package/dist/plugins/fusion-plugin-reports/package.json +1 -1
  137. package/dist/plugins/fusion-plugin-roadmap/package.json +1 -1
  138. package/dist/plugins/fusion-plugin-whatsapp-chat/package.json +1 -1
  139. package/dist/plugins/fusion-plugin-whatsapp-chat/src/__tests__/index.test.ts +5 -1
  140. package/dist/routine-store-GIJ6MXWY.js +10 -0
  141. package/dist/routine-store-HTVC2PUQ.js +10 -0
  142. package/dist/routine-store-KGHZBPDF.js +10 -0
  143. package/package.json +1 -1
  144. package/skill/fusion/references/engine-tools.md +6 -4
  145. package/dist/client/assets/AgentsView-DfznJDek.css +0 -1
  146. package/dist/client/assets/ChatView-BkAG99bj.js +0 -6
  147. package/dist/client/assets/DevServerView-C6DC0URX.js +0 -1
  148. package/dist/client/assets/DocumentsView-OCK1Vsw_.js +0 -1
  149. package/dist/client/assets/ExperimentalAgentOnboardingModal-BNpveCEk.css +0 -1
  150. package/dist/client/assets/GoalsView-CNLTn0rX.js +0 -2
  151. package/dist/client/assets/GoalsView-DI66UsjT.css +0 -1
  152. package/dist/client/assets/InsightsView-C9-mqVvf.css +0 -1
  153. package/dist/client/assets/MemoryView-D3xQIFjj.js +0 -2
  154. package/dist/client/assets/PluginManager-UHVLvWWl.css +0 -1
  155. package/dist/client/assets/PullRequestView-WQIS0zUC.css +0 -1
  156. package/dist/client/assets/ReliabilityView-QKMUDebT.js +0 -1
  157. package/dist/client/assets/ReliabilityView-eoKBhBc4.css +0 -1
  158. package/dist/client/assets/SessionTerminal-BiigPP2l.css +0 -1
  159. package/dist/client/assets/SessionTerminal-Dk1NgmN2.js +0 -2
  160. package/dist/client/assets/SettingsModal-JCaNvdAb.js +0 -31
  161. package/dist/client/assets/SettingsModal-nF_GaeeK.css +0 -1
  162. package/dist/client/assets/WorkflowNodeEditor-2jDuk2FR.js +0 -8
  163. package/dist/client/assets/WorkflowNodeEditor-BokhW3de.css +0 -1
  164. package/dist/client/assets/app-CUu1sm3x.js +0 -13
  165. package/dist/client/assets/dashboard-view-Du53JbmQ.css +0 -1
  166. package/dist/client/assets/index-CpTBp1RG.js +0 -793
  167. package/dist/client/assets/index-DqhCiU35.css +0 -1
  168. package/dist/client/assets/vendor-react-D37HfzIf.js +0 -49
@@ -0,0 +1,6 @@
1
+ import{c as e}from"./index-Bglw05rM.js";/**
2
+ * @license lucide-react v1.7.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const a=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],o=e("shield-alert",a);export{o as S};
@@ -1,4 +1,4 @@
1
- import{c as a}from"./index-CpTBp1RG.js";/**
1
+ import{c as a}from"./index-Bglw05rM.js";/**
2
2
  * @license lucide-react v1.7.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-CpTBp1RG.js";/**
1
+ import{c as e}from"./index-Bglw05rM.js";/**
2
2
  * @license lucide-react v1.7.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{g as nt,r as O,a as it}from"./vendor-react-D37HfzIf.js";const x=i=>typeof i=="string",G=()=>{let i,e;const t=new Promise((s,n)=>{i=s,e=n});return t.resolve=i,t.reject=e,t},Ce=i=>i==null?"":String(i),rt=(i,e,t)=>{i.forEach(s=>{e[s]&&(t[s]=e[s])})},at=/###/g,Ee=i=>i&&i.includes("###")?i.replace(at,"."):i,Ne=i=>!i||x(i),ee=(i,e,t)=>{const s=x(e)?e.split("."):e;let n=0;for(;n<s.length-1;){if(Ne(i))return{};const r=Ee(s[n]);!i[r]&&t&&(i[r]=new t),Object.prototype.hasOwnProperty.call(i,r)?i=i[r]:i={},++n}return Ne(i)?{}:{obj:i,k:Ee(s[n])}},$e=(i,e,t)=>{const{obj:s,k:n}=ee(i,e,Object);if(s!==void 0||e.length===1){s[n]=t;return}let r=e[e.length-1],a=e.slice(0,e.length-1),o=ee(i,a,Object);for(;o.obj===void 0&&a.length;)r=`${a[a.length-1]}.${r}`,a=a.slice(0,a.length-1),o=ee(i,a,Object),o?.obj&&typeof o.obj[`${o.k}.${r}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${r}`]=t},ot=(i,e,t,s)=>{const{obj:n,k:r}=ee(i,e,Object);n[r]=n[r]||[],n[r].push(t)},oe=(i,e)=>{const{obj:t,k:s}=ee(i,e);if(t&&Object.prototype.hasOwnProperty.call(t,s))return t[s]},lt=(i,e,t)=>{const s=oe(i,t);return s!==void 0?s:oe(e,t)},Je=(i,e,t)=>{for(const s in e)s!=="__proto__"&&s!=="constructor"&&(s in i?x(i[s])||i[s]instanceof String||x(e[s])||e[s]instanceof String?t&&(i[s]=e[s]):Je(i[s],e[s],t):i[s]=e[s]);return i},z=i=>i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),ut={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},ct=i=>x(i)?i.replace(/[&<>"'\/]/g,e=>ut[e]):i;class ft{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}const dt=[" ",",","?","!",";"],ht=new ft(20),pt=(i,e,t)=>{e=e||"",t=t||"";const s=dt.filter(a=>!e.includes(a)&&!t.includes(a));if(s.length===0)return!0;const n=ht.getRegExp(`(${s.map(a=>a==="?"?"\\?":a).join("|")})`);let r=!n.test(i);if(!r){const a=i.indexOf(t);a>0&&!n.test(i.substring(0,a))&&(r=!0)}return r},xe=(i,e,t=".")=>{if(!i)return;if(i[e])return Object.prototype.hasOwnProperty.call(i,e)?i[e]:void 0;const s=e.split(t);let n=i;for(let r=0;r<s.length;){if(!n||typeof n!="object")return;let a,o="";for(let l=r;l<s.length;++l)if(l!==r&&(o+=t),o+=s[l],a=n[o],a!==void 0){if(["string","number","boolean"].includes(typeof a)&&l<s.length-1)continue;r+=l-r+1;break}n=a}return n},se=i=>i?.replace(/_/g,"-"),gt={type:"logger",log(i){this.output("log",i)},warn(i){this.output("warn",i)},error(i){this.output("error",i)},output(i,e){console?.[i]?.apply?.(console,e)}};class le{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||gt,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,s,n){return n&&!this.debug?null:(e=e.map(r=>x(r)?r.replace(/[\r\n\x00-\x1F\x7F]/g," "):r),x(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new le(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new le(this.logger,e)}}var M=new le;class ce{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const n=this.observers[s].get(t)||0;this.observers[s].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){const s=(...n)=>{t(...n),this.off(e,s)};return this.on(e,s),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([n,r])=>{for(let a=0;a<r;a++)n(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let a=0;a<r;a++)n(e,...t)})}}class ke extends ce{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,s,n={}){const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,a=n.ignoreJSONStructure!==void 0?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.includes(".")?o=e.split("."):(o=[e,t],s&&(Array.isArray(s)?o.push(...s):x(s)&&r?o.push(...s.split(r)):o.push(s)));const l=oe(this.data,o);return!l&&!t&&!s&&e.includes(".")&&(e=o[0],t=o[1],s=o.slice(2).join(".")),l||!a||!x(s)?l:xe(this.data?.[e]?.[t],s,r)}addResource(e,t,s,n,r={silent:!1}){const a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let o=[e,t];s&&(o=o.concat(a?s.split(a):s)),e.includes(".")&&(o=e.split("."),n=t,t=o[1]),this.addNamespaces(t),$e(this.data,o,n),r.silent||this.emit("added",e,t,s,n)}addResources(e,t,s,n={silent:!1}){for(const r in s)(x(s[r])||Array.isArray(s[r]))&&this.addResource(e,t,r,s[r],{silent:!0});n.silent||this.emit("added",e,t,s)}addResourceBundle(e,t,s,n,r,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(".")&&(o=e.split("."),n=s,s=t,t=o[1]),this.addNamespaces(t);let l=oe(this.data,o)||{};a.skipCopy||(s=JSON.parse(JSON.stringify(s))),n?Je(l,s,r):l={...l,...s},$e(this.data,o,l),a.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(n=>t[n]&&Object.keys(t[n]).length>0)}toJSON(){return this.data}}var qe={processors:{},addPostProcessor(i){this.processors[i.name]=i},handle(i,e,t,s,n){return i.forEach(r=>{e=this.processors[r]?.process(e,t,s,n)??e}),e}};const Ye=Symbol("i18next/PATH_KEY");function mt(){const i=[],e=Object.create(null);let t;return e.get=(s,n)=>(t?.revoke?.(),n===Ye?i:(i.push(n),t=Proxy.revocable(s,e),t.proxy)),Proxy.revocable(Object.create(null),e).proxy}function q(i,e){const{[Ye]:t}=i(mt()),s=e?.keySeparator??".",n=e?.nsSeparator??":",r=e?.enableSelector==="strict";if(t.length>1&&n){const a=e?.ns,o=r?Array.isArray(a)?a:a?[a]:null:Array.isArray(a)?a:null;if(o&&(r?o:o.length>1?o.slice(1):[]).includes(t[0]))return`${t[0]}${n}${t.slice(1).join(s)}`}return t.join(s)}const de=i=>!x(i)&&typeof i!="boolean"&&typeof i!="number";class ue extends ce{constructor(e,t={}){super(),rt(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=M.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const s={...t};if(e==null)return!1;const n=this.resolve(e,s);if(n?.res===void 0)return!1;const r=de(n.res);return!(s.returnObjects===!1&&r)}extractFromKey(e,t){let s=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const n=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let r=t.ns||this.options.defaultNS||[];const a=s&&e.includes(s),o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!pt(e,s,n);if(a&&!o){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:x(r)?[r]:r};const u=e.split(s);(s!==n||s===n&&this.options.ns.includes(u[0]))&&(r=u.shift()),e=u.join(n)}return{key:e,namespaces:x(r)?[r]:r}}translate(e,t,s){let n=typeof t=="object"?{...t}:t;if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";typeof e=="function"&&(e=q(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]),e=e.map(L=>typeof L=="function"?q(L,{...this.options,...n}):String(L));const r=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(e[e.length-1],n),u=l[l.length-1];let f=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;f===void 0&&(f=":");const c=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode")return d?r?{res:`${u}${f}${o}`,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:`${u}${f}${o}`:r?{res:o,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:o;const g=this.resolve(e,n);let h=g?.res;const y=g?.usedKey||o,S=g?.exactUsedKey||o,R=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,v=n.count!==void 0&&!x(n.count),C=ue.hasDefaultValue(n),A=v?this.pluralResolver.getSuffix(c,n.count,n):"",$=n.ordinal&&v?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",P=v&&!n.ordinal&&n.count===0,p=P&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${A}`]||n[`defaultValue${$}`]||n.defaultValue;let m=h;E&&!h&&C&&(m=p);const k=de(m),N=Object.prototype.toString.apply(m);if(E&&m&&k&&!R.includes(N)&&!(x(b)&&Array.isArray(m))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const L=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,m,{...n,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return r?(g.res=L,g.usedParams=this.getUsedParamsDetails(n),g):L}if(a){const L=Array.isArray(m),w=L?[]:{},U=L?S:y;for(const j in m)if(Object.prototype.hasOwnProperty.call(m,j)){const I=`${U}${a}${j}`;C&&!h?w[j]=this.translate(I,{...n,defaultValue:de(p)?p[j]:void 0,joinArrays:!1,ns:l}):w[j]=this.translate(I,{...n,joinArrays:!1,ns:l}),w[j]===I&&(w[j]=m[j])}h=w}}else if(E&&x(b)&&Array.isArray(h))h=h.join(b),h&&(h=this.extendTranslation(h,e,n,s));else{let L=!1,w=!1;!this.isValidLookup(h)&&C&&(L=!0,h=p),this.isValidLookup(h)||(w=!0,h=o);const j=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&w?void 0:h,I=C&&p!==h&&this.options.updateMissing;if(w||L||I){if(this.logger.log(I?"updateKey":"missingKey",c,u,v&&!I?`${o}${this.pluralResolver.getSuffix(c,n.count,n)}`:o,I?p:h),a){const F=this.resolve(o,{...n,keySeparator:!1});F&&F.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 H=[];const T=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&T&&T[0])for(let F=0;F<T.length;F++)H.push(T[F]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(n.lng||this.language):H.push(n.lng||this.language);const K=(F,_,J)=>{const Y=C&&J!==h?J:j;this.options.missingKeyHandler?this.options.missingKeyHandler(F,u,_,Y,I,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(F,u,_,Y,I,n),this.emit("missingKey",F,u,_,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?H.forEach(F=>{const _=this.pluralResolver.getSuffixes(F,n);P&&n[`defaultValue${this.options.pluralSeparator}zero`]&&!_.includes(`${this.options.pluralSeparator}zero`)&&_.push(`${this.options.pluralSeparator}zero`),_.forEach(J=>{K([F],o+J,n[`defaultValue${J}`]||p)})}):K(H,o,p))}h=this.extendTranslation(h,e,n,g,s),w&&h===o&&this.options.appendNamespaceToMissingKey&&(h=`${u}${f}${o}`),(w||L)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${f}${o}`:o,L?h:void 0,n))}return r?(g.res=h,g.usedParams=this.getUsedParamsDetails(n),g):h}extendTranslation(e,t,s,n,r){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const l=x(e)&&(s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(l){const c=e.match(this.interpolator.nestingRegexp);u=c&&c.length}let f=s.replace&&!x(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),e=this.interpolator.interpolate(e,f,s.lng||this.language||n.usedLng,s),l){const c=e.match(this.interpolator.nestingRegexp),d=c&&c.length;u<d&&(s.nest=!1)}!s.lng&&n&&n.res&&(s.lng=this.language||n.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,(...c)=>r?.[0]===c[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${c[0]} in key: ${t[0]}`),null):this.translate(...c,t),s)),s.interpolation&&this.interpolator.reset()}const a=s.postProcess||this.options.postProcess,o=x(a)?[a]:a;return e!=null&&o?.length&&s.applyPostProcessor!==!1&&(e=qe.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e,t={}){let s,n,r,a,o;return x(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(l=>typeof l=="function"?q(l,{...this.options,...t}):l)),e.forEach(l=>{if(this.isValidLookup(s))return;const u=this.extractFromKey(l,t),f=u.key;n=f;let c=u.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const d=t.count!==void 0&&!x(t.count),g=d&&!t.ordinal&&t.count===0,h=t.context!==void 0&&(x(t.context)||typeof t.context=="number")&&t.context!=="",y=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(S=>{this.isValidLookup(s)||(o=S,!this.checkedLoadedFor[`${y[0]}-${S}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(this.checkedLoadedFor[`${y[0]}-${S}`]=!0,this.logger.warn(`key "${n}" for languages "${y.join(", ")}" won't get resolved as namespace "${o}" 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!!!")),y.forEach(R=>{if(this.isValidLookup(s))return;a=R;const b=[f];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(b,f,R,S,t);else{let v;d&&(v=this.pluralResolver.getSuffix(R,t.count,t));const C=`${this.options.pluralSeparator}zero`,A=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(t.ordinal&&v.startsWith(A)&&b.push(f+v.replace(A,this.options.pluralSeparator)),b.push(f+v),g&&b.push(f+C)),h){const $=`${f}${this.options.contextSeparator||"_"}${t.context}`;b.push($),d&&(t.ordinal&&v.startsWith(A)&&b.push($+v.replace(A,this.options.pluralSeparator)),b.push($+v),g&&b.push($+C))}}let E;for(;E=b.pop();)this.isValidLookup(s)||(r=E,s=this.getResource(R,S,E,t))}))})}),{res:s,usedKey:n,exactUsedKey:r,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,s,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,s,n):this.resourceStore.getResource(e,t,s,n)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&!x(e.replace);let n=s?e.replace:e;if(s&&typeof e.count<"u"&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!s){n={...n};for(const r of t)delete n[r]}return n}static hasDefaultValue(e){const t="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&s.startsWith(t)&&e[s]!==void 0)return!0;return!1}}class Re{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=M.create("languageUtils")}getScriptPartFromCode(e){if(e=se(e),!e||!e.includes("-"))return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=se(e),!e||!e.includes("-"))return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(x(e)&&e.includes("-")){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(s=>{if(t)return;const n=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(s=>{if(t)return;const n=this.getScriptPartFromCode(s);if(this.isSupportedCode(n))return t=n;const r=this.getLanguagePartFromCode(s);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(a=>a===r?!0:!a.includes("-")&&!r.includes("-")?!1:!!(a.includes("-")&&!r.includes("-")&&a.slice(0,a.indexOf("-"))===r||a.startsWith(r)&&r.length>1))}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),x(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let s=e[t];return s||(s=e[this.getScriptPartFromCode(t)]),s||(s=e[this.formatLanguageCode(t)]),s||(s=e[this.getLanguagePartFromCode(t)]),s||(s=e.default),s||[]}toResolveHierarchy(e,t){const s=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),n=[],r=a=>{a&&(this.isSupportedCode(a)?n.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return x(e)&&(e.includes("-")||e.includes("_"))?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(e))):x(e)&&r(this.formatLanguageCode(e)),s.forEach(a=>{n.includes(a)||r(this.formatLanguageCode(a))}),n}}const Pe={zero:0,one:1,two:2,few:3,many:4,other:5},Te={select:i=>i===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class yt{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=M.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const s=se(e==="dev"?"en":e),n=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:s,type:n});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let a;try{a=new Intl.PluralRules(s,{type:n})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Te;if(!e.match(/-|_/))return Te;const l=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(l,t)}return this.pluralRulesCache[r]=a,a}needsPlural(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,s={}){return this.getSuffixes(e,s).map(n=>`${t}${n}`)}getSuffixes(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?s.resolvedOptions().pluralCategories.sort((n,r)=>Pe[n]-Pe[r]).map(n=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${n}`):[]}getSuffix(e,t,s={}){const n=this.getRule(e,s);return n?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,s))}}const Ae=(i,e,t,s=".",n=!0)=>{let r=lt(i,e,t);return!r&&n&&x(t)&&(r=xe(i,t,s),r===void 0&&(r=xe(e,t,s))),r},he=i=>i.replace(/\$/g,"$$$$");class Fe{constructor(e={}){this.logger=M.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(t=>t),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:s,useRawValueToEscape:n,prefix:r,prefixEscaped:a,suffix:o,suffixEscaped:l,formatSeparator:u,unescapeSuffix:f,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:g,nestingSuffix:h,nestingSuffixEscaped:y,nestingOptionsSeparator:S,maxReplaces:R,alwaysFormat:b}=e.interpolation;this.escape=t!==void 0?t:ct,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=n!==void 0?n:!1,this.prefix=r?z(r):a||"{{",this.suffix=o?z(o):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=f?"":c?z(c):"-",this.unescapeSuffix=this.unescapePrefix?"":f?z(f):"",this.nestingPrefix=d?z(d):g||z("$t("),this.nestingSuffix=h?z(h):y||z(")"),this.nestingOptionsSeparator=S||",",this.maxReplaces=R||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,s)=>t?.source===s?(t.lastIndex=0,t):new RegExp(s,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,s,n){let r,a,o;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const R=Ae(t,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(R,void 0,s,{...n,...t,interpolationkey:g}):R}const h=g.split(this.formatSeparator),y=h.shift().trim(),S=h.join(this.formatSeparator).trim();return this.format(Ae(t,l,y,this.options.keySeparator,this.options.ignoreJSONStructure),S,s,{...n,...t,interpolationkey:y})};this.resetRegExp(),!this.escapeValue&&typeof e=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const f=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>he(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?he(this.escape(g)):he(g)}].forEach(g=>{for(o=0;r=g.regex.exec(e);){const h=r[1].trim();if(a=u(h),a===void 0)if(typeof f=="function"){const S=f(e,r,n);a=x(S)?S:""}else if(n&&Object.prototype.hasOwnProperty.call(n,h))a="";else if(c){a=r[0];continue}else this.logger.warn(`missed to pass in variable ${h} for interpolating ${e}`),a="";else!x(a)&&!this.useRawValueToEscape&&(a=Ce(a));const y=g.safeValue(a);if(e=e.replace(r[0],y),c?(g.regex.lastIndex+=a.length,g.regex.lastIndex-=r[0].length):g.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,s={}){let n,r,a;const o=(l,u)=>{const f=this.nestingOptionsSeparator;if(!l.includes(f))return l;const c=l.split(new RegExp(`${z(f)}[ ]*{`));let d=`{${c[1]}`;l=c[0],d=this.interpolate(d,a);const g=d.match(/'/g),h=d.match(/"/g);((g?.length??0)%2===0&&!h||(h?.length??0)%2!==0)&&(d=d.replace(/'/g,'"'));try{a=JSON.parse(d),u&&(a={...u,...a})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${f}${d}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,l};for(;n=this.nestingRegexp.exec(e);){let l=[];a={...s},a=a.replace&&!x(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const u=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(u!==-1&&(l=n[1].slice(u).split(this.formatSeparator).map(f=>f.trim()).filter(Boolean),n[1]=n[1].slice(0,u)),r=t(o.call(this,n[1].trim(),a),a),r&&n[0]===e&&!x(r))return r;x(r)||(r=Ce(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),l.length&&(r=l.reduce((f,c)=>this.format(f,c,s.lng,{...s,interpolationkey:n[1].trim()}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}const xt=i=>{let e=i.toLowerCase().trim();const t={};if(i.includes("(")){const s=i.split("(");e=s[0].toLowerCase().trim();const n=s[1].slice(0,-1);e==="currency"&&!n.includes(":")?t.currency||(t.currency=n.trim()):e==="relativetime"&&!n.includes(":")?t.range||(t.range=n.trim()):n.split(";").forEach(a=>{if(a){const[o,...l]=a.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),f=o.trim();t[f]||(t[f]=u),u==="false"&&(t[f]=!1),u==="true"&&(t[f]=!0),isNaN(u)||(t[f]=parseInt(u,10))}})}return{formatName:e,formatOptions:t}},je=i=>{const e={};return(t,s,n)=>{let r=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(r={...r,[n.interpolationkey]:void 0});const a=s+JSON.stringify(r);let o=e[a];return o||(o=i(se(s),n),e[a]=o),o(t)}},St=i=>(e,t,s)=>i(se(t),s)(e);class bt{constructor(e={}){this.logger=M.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const s=t.cacheInBuiltFormats?je:St;this.formats={number:s((n,r)=>{const a=new Intl.NumberFormat(n,{...r});return o=>a.format(o)}),currency:s((n,r)=>{const a=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>a.format(o)}),datetime:s((n,r)=>{const a=new Intl.DateTimeFormat(n,{...r});return o=>a.format(o)}),relativetime:s((n,r)=>{const a=new Intl.RelativeTimeFormat(n,{...r});return o=>a.format(o,r.range||"day")}),list:s((n,r)=>{const a=new Intl.ListFormat(n,{...r});return o=>a.format(o)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=je(t)}format(e,t,s,n={}){if(!t||e==null)return e;const r=t.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&!r[0].includes(")")&&r.find(o=>o.includes(")"))){const o=r.findIndex(l=>l.includes(")"));r[0]=[r[0],...r.splice(1,o)].join(this.formatSeparator)}return r.reduce((o,l)=>{const{formatName:u,formatOptions:f}=xt(l);if(this.formats[u]){let c=o;try{const d=n?.formatParams?.[n.interpolationkey]||{},g=d.locale||d.lng||n.locale||n.lng||s;c=this.formats[u](o,g,{...f,...n,...d})}catch(d){this.logger.warn(d)}return c}else this.logger.warn(`there was no format function for ${u}`);return o},e)}}const vt=(i,e)=>{i.pending[e]!==void 0&&(delete i.pending[e],i.pendingCount--)};class wt extends ce{constructor(e,t,s,n={}){super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=n,this.logger=M.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(s,n.backend,n)}queueLoad(e,t,s,n){const r={},a={},o={},l={};return e.forEach(u=>{let f=!0;t.forEach(c=>{const d=`${u}|${c}`;!s.reload&&this.store.hasResourceBundle(u,c)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?a[d]===void 0&&(a[d]=!0):(this.state[d]=1,f=!1,a[d]===void 0&&(a[d]=!0),r[d]===void 0&&(r[d]=!0),l[c]===void 0&&(l[c]=!0)))}),f||(o[u]=!0)}),(Object.keys(r).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(r),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(l)}}loaded(e,t,s){const n=e.split("|"),r=n[0],a=n[1];t&&this.emit("failedLoading",r,a,t),!t&&s&&this.store.addResourceBundle(r,a,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0);const o={};this.queue.forEach(l=>{ot(l.loaded,[r],a),vt(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{o[u]||(o[u]={});const f=l.loaded[u];f.length&&f.forEach(c=>{o[u][c]===void 0&&(o[u][c]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(l=>!l.done)}read(e,t,s,n=0,r=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:s,tried:n,wait:r,callback:a});return}this.readingCalls++;const o=(u,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const c=this.waitingReads.shift();this.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}if(u&&f&&n<this.maxRetries){setTimeout(()=>{this.read(e,t,s,n+1,r*2,a)},r);return}a(u,f)},l=this.backend[s].bind(this.backend);if(l.length===2){try{const u=l(e,t);u&&typeof u.then=="function"?u.then(f=>o(null,f)).catch(o):o(null,u)}catch(u){o(u)}return}return l(e,t,o)}prepareLoading(e,t,s={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();x(e)&&(e=this.languageUtils.toResolveHierarchy(e)),x(t)&&(t=[t]);const r=this.queueLoad(e,t,s,n);if(!r.toLoad.length)return r.pending.length||n(),null;r.toLoad.forEach(a=>{this.loadOne(a)})}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e,t=""){const s=e.split("|"),n=s[0],r=s[1];this.read(n,r,"read",void 0,void 0,(a,o)=>{a&&this.logger.warn(`${t}loading namespace ${r} for language ${n} failed`,a),!a&&o&&this.logger.log(`${t}loaded namespace ${r} for language ${n}`,o),this.loaded(e,a,o)})}saveMissing(e,t,s,n,r,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${s}" as the namespace "${t}" 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!!!");return}if(!(s==null||s==="")){if(this.backend?.create){const l={...a,isUpdate:r},u=this.backend.create.bind(this.backend);if(u.length<6)try{let f;u.length===5?f=u(e,t,s,n,l):f=u(e,t,s,n),f&&typeof f.then=="function"?f.then(c=>o(null,c)).catch(o):o(null,f)}catch(f){o(f)}else u(e,t,s,n,o,l)}!e||!e[0]||this.store.addResource(e[0],t,s,n)}}}const pe=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,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:i=>{let e={};if(typeof i[1]=="object"&&(e=i[1]),x(i[1])&&(e.defaultValue=i[1]),x(i[2])&&(e.tDescription=i[2]),typeof i[2]=="object"||typeof i[3]=="object"){const t=i[3]||i[2];Object.keys(t).forEach(s=>{e[s]=t[s]})}return e},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Ie=i=>(x(i.ns)&&(i.ns=[i.ns]),x(i.fallbackLng)&&(i.fallbackLng=[i.fallbackLng]),x(i.fallbackNS)&&(i.fallbackNS=[i.fallbackNS]),i.supportedLngs&&!i.supportedLngs.includes("cimode")&&(i.supportedLngs=i.supportedLngs.concat(["cimode"])),i),ie=()=>{},Lt=i=>{Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach(t=>{typeof i[t]=="function"&&(i[t]=i[t].bind(i))})};class te extends ce{constructor(e={},t){if(super(),this.options=Ie(e),this.services={},this.logger=M,this.modules={external:[]},Lt(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(x(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const s=pe();this.options={...s,...this.options,...Ie(e)},this.options.interpolation={...s.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=s.overloadTranslationOptionHandler);const n=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?M.init(n(this.modules.logger),this.options):M.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=bt;const f=new Re(this.options);this.store=new ke(this.options.resources,this.options);const c=this.services;c.logger=M,c.resourceStore=this.store,c.languageUtils=f,c.pluralResolver=new yt(f,{prepend:this.options.pluralSeparator}),u&&(c.formatter=n(u),c.formatter.init&&c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new Fe(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new wt(n(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",(d,...g)=>{this.emit(d,...g)}),this.modules.languageDetector&&(c.languageDetector=n(this.modules.languageDetector),c.languageDetector.init&&c.languageDetector.init(c,this.options.detection,this.options)),this.modules.i18nFormat&&(c.i18nFormat=n(this.modules.i18nFormat),c.i18nFormat.init&&c.i18nFormat.init(this)),this.translator=new ue(this.services,this.options),this.translator.on("*",(d,...g)=>{this.emit(d,...g)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,t||(t=ie),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[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(u=>{this[u]=(...f)=>this.store[u](...f)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...f)=>(this.store[u](...f),this)});const o=G(),l=()=>{const u=(f,c)=>{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),o.resolve(c),t(f,c)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),o}loadResources(e,t=ie){let s=t;const n=x(e)?e:this.language;if(typeof e=="function"&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if(n?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const r=[],a=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(u=>{u!=="cimode"&&(r.includes(u)||r.push(u))})};n?a(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>a(l)),this.options.preload?.forEach?.(o=>a(o)),this.services.backendConnector.load(r,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(o)})}else s(null)}reloadResources(e,t,s){const n=G();return typeof e=="function"&&(s=e,e=void 0),typeof t=="function"&&(s=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),s||(s=ie),this.services.backendConnector.reload(e,t,r=>{n.resolve(),s(r)}),n}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&qe.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!["cimode","dev"].includes(e)){for(let t=0;t<this.languages.length;t++){const s=this.languages[t];if(!["cimode","dev"].includes(s)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const s=G();this.emit("languageChanging",e);const n=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},r=(o,l)=>{l?this.isLanguageChangingTo===e&&(n(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,s.resolve((...u)=>this.t(...u)),t&&t(o,(...u)=>this.t(...u))},a=o=>{!e&&!o&&this.services.languageDetector&&(o=[]);const l=x(o)?o:o&&o[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(x(o)?[o]:o);u&&(this.language||n(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector?.cacheUserLanguage?.(u)),this.loadResources(u,f=>{r(f,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),s}getFixedT(e,t,s,n){const r=n?.scopeNs,a=(o,l,...u)=>{let f;typeof l!="object"?f=this.options.overloadTranslationOptionHandler([o,l].concat(u)):f={...l},f.lng=f.lng||a.lng,f.lngs=f.lngs||a.lngs;const c=f.ns!==void 0&&f.ns!==null;f.ns=f.ns||a.ns,f.keyPrefix!==""&&(f.keyPrefix=f.keyPrefix||s||a.keyPrefix);const d={...this.options,...f};Array.isArray(r)&&!c&&(d.ns=r),typeof f.keyPrefix=="function"&&(f.keyPrefix=q(f.keyPrefix,d));const g=this.options.keySeparator||".";let h;return f.keyPrefix&&Array.isArray(o)?h=o.map(y=>(typeof y=="function"&&(y=q(y,d)),`${f.keyPrefix}${g}${y}`)):(typeof o=="function"&&(o=q(o,d)),h=f.keyPrefix?`${f.keyPrefix}${g}${o}`:o),this.t(h,f)};return x(e)?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=s,a}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){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 s=t.lng||this.resolvedLanguage||this.languages[0],n=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const a=(o,l)=>{const u=this.services.backendConnector.state[`${o}|${l}`];return u===-1||u===0||u===2};if(t.precheck){const o=t.precheck(this,a);if(o!==void 0)return o}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(s,e)&&(!n||a(r,e)))}loadNamespaces(e,t){const s=G();return this.options.ns?(x(e)&&(e=[e]),e.forEach(n=>{this.options.ns.includes(n)||this.options.ns.push(n)}),this.loadResources(n=>{s.resolve(),t&&t(n)}),s):(t&&t(),Promise.resolve())}loadLanguages(e,t){const s=G();x(e)&&(e=[e]);const n=this.options.preload||[],r=e.filter(a=>!n.includes(a)&&this.services.languageUtils.isSupportedCode(a));return r.length?(this.options.preload=n.concat(r),this.loadResources(a=>{s.resolve(),t&&t(a)}),s):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const n=new Intl.Locale(e);if(n&&n.getTextInfo){const r=n.getTextInfo();if(r&&r.direction)return r.direction}}catch{}const t=["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"],s=this.services?.languageUtils||new Re(pe());return e.toLowerCase().indexOf("-latn")>1?"ltr":t.includes(s.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const s=new te(e,t);return s.createInstance=te.createInstance,s}cloneInstance(e={},t=ie){const s=e.forkResourceStore;s&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},r=new te(n);if((e.debug!==void 0||e.prefix!==void 0)&&(r.logger=r.logger.clone(e)),["store","services","language"].forEach(o=>{r[o]=this[o]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},s){const o=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((f,c)=>(f[c]={...l[u][c]},f),l[u]),l),{});r.store=new ke(o,n),r.services.resourceStore=r.store}if(e.interpolation){const l={...pe().interpolation,...this.options.interpolation,...e.interpolation},u={...n,interpolation:l};r.services.interpolator=new Fe(u)}return r.translator=new ue(r.services,n),r.translator.on("*",(o,...l)=>{r.emit(o,...l)}),r.init(n,t),r.translator.options=n,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const V=te.createInstance();V.createInstance;V.dir;V.init;V.loadResources;V.reloadResources;V.use;V.changeLanguage;V.getFixedT;V.t;V.exists;V.setDefaultNamespace;V.hasLoadedNamespace;V.loadNamespaces;V.loadLanguages;var ge,De;function Ot(){return De||(De=1,ge={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),ge}var Ct=Ot();const Et=nt(Ct);var Nt=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Ve(i){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},t=i.match(/<\/?([^\s]+?)[/\s>]/);if(t&&(e.name=t[1],(Et[t[1]]||i.charAt(i.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){var s=i.indexOf("-->");return{type:"comment",comment:s!==-1?i.slice(4,s):""}}for(var n=new RegExp(Nt),r=null;(r=n.exec(i))!==null;)if(r[0].trim())if(r[1]){var a=r[1].trim(),o=[a,""];a.indexOf("=")>-1&&(o=a.split("=")),e.attrs[o[0]]=o[1],n.lastIndex--}else r[2]&&(e.attrs[r[2]]=r[3].trim().substring(1,r[3].length-1));return e}var $t=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,kt=/^\s*$/,Rt=Object.create(null);function Qe(i,e){switch(e.type){case"text":return i+e.content;case"tag":return i+="<"+e.name+(e.attrs?(function(t){var s=[];for(var n in t)s.push(n+'="'+t[n]+'"');return s.length?" "+s.join(" "):""})(e.attrs):"")+(e.voidElement?"/>":">"),e.voidElement?i:i+e.children.reduce(Qe,"")+"</"+e.name+">";case"comment":return i+"<!--"+e.comment+"-->"}}var Pt={parse:function(i,e){e||(e={}),e.components||(e.components=Rt);var t,s=[],n=[],r=-1,a=!1;if(i.indexOf("<")!==0){var o=i.indexOf("<");s.push({type:"text",content:o===-1?i:i.substring(0,o)})}return i.replace($t,function(l,u){if(a){if(l!=="</"+t.name+">")return;a=!1}var f,c=l.charAt(1)!=="/",d=l.startsWith("<!--"),g=u+l.length,h=i.charAt(g);if(d){var y=Ve(l);return r<0?(s.push(y),s):((f=n[r]).children.push(y),s)}if(c&&(r++,(t=Ve(l)).type==="tag"&&e.components[t.name]&&(t.type="component",a=!0),t.voidElement||a||!h||h==="<"||t.children.push({type:"text",content:i.slice(g,i.indexOf("<",g))}),r===0&&s.push(t),(f=n[r-1])&&f.children.push(t),n[r]=t),(!c||t.voidElement)&&(r>-1&&(t.voidElement||t.name===l.slice(2,-1))&&(r--,t=r===-1?s:n[r]),!a&&h!=="<"&&h)){f=r===-1?s:n[r].children;var S=i.indexOf("<",g),R=i.slice(g,S===-1?void 0:S);kt.test(R)&&(R=" "),(S>-1&&r+f.length>=0||R!==" ")&&f.push({type:"text",content:R})}}),s},stringify:function(i){return i.reduce(function(e,t){return e+Qe("",t)},"")}};const re=(i,e,t,s)=>{const n=[t,{code:e,...s||{}}];if(i?.services?.logger?.forward)return i.services.logger.forward(n,"warn","react-i18next::",!0);D(n[0])&&(n[0]=`react-i18next:: ${n[0]}`),i?.services?.logger?.warn?i.services.logger.warn(...n):console?.warn&&console.warn(...n)},Ue={},ne=(i,e,t,s)=>{D(t)&&Ue[t]||(D(t)&&(Ue[t]=new Date),re(i,e,t,s))},Ze=(i,e)=>()=>{if(i.isInitialized)e();else{const t=()=>{setTimeout(()=>{i.off("initialized",t)},0),e()};i.on("initialized",t)}},Se=(i,e,t)=>{i.loadNamespaces(e,Ze(i,t))},Ke=(i,e,t,s)=>{if(D(t)&&(t=[t]),i.options.preload&&i.options.preload.indexOf(e)>-1)return Se(i,t,s);t.forEach(n=>{i.options.ns.indexOf(n)<0&&i.options.ns.push(n)}),i.loadLanguages(e,Ze(i,s))},Tt=(i,e,t={})=>!e.languages||!e.languages.length?(ne(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(i,{lng:t.lng,precheck:(s,n)=>{if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!n(s.isLanguageChangingTo,i))return!1}}),D=i=>typeof i=="string",B=i=>typeof i=="object"&&i!==null,At=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Ft={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},jt=i=>Ft[i],Ge=i=>i.replace(At,jt);let be={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Ge,transDefaultProps:void 0};const It=(i={})=>{be={...be,...i}},we=()=>be;let Xe;const Dt=i=>{Xe=i},Le=()=>Xe,ae=(i,e)=>{if(!i)return!1;const t=i.props?.children??i.children;return e?t.length>0:!!t},X=i=>{if(!i)return[];const e=i.props?.children??i.children;return i.props?.i18nIsDynamicList?W(e):e},Vt=i=>Array.isArray(i)&&i.every(O.isValidElement),W=i=>Array.isArray(i)?i:[i],Ut=(i,e)=>{const t={...e};return t.props={...e.props,...i.props},t},Kt=i=>{const e={};if(!i)return e;const t=s=>{W(s).forEach(r=>{D(r)||(ae(r)?t(X(r)):B(r)&&!O.isValidElement(r)&&Object.assign(e,r))})};return t(i),e},ve=(i,e,t,s)=>{if(!i)return"";let n="";const r=W(i),a=e?.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return r.forEach((o,l)=>{if(D(o)){n+=`${o}`;return}if(O.isValidElement(o)){const{props:u,type:f}=o,c=Object.keys(u).length,d=a.indexOf(f)>-1,g=u.children;if(!g&&d&&!c){n+=`<${f}/>`;return}if(!g&&(!d||c)||u.i18nIsDynamicList){n+=`<${l}></${l}>`;return}if(d&&c<=1){const y=D(g)?g:ve(g,e,t,s);n+=`<${f}>${y}</${f}>`;return}const h=ve(g,e,t,s);n+=`<${l}>${h}</${l}>`;return}if(o===null){re(t,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:s});return}if(B(o)){const{format:u,...f}=o,c=Object.keys(f);if(c.length===1){const d=u?`${c[0]}, ${u}`:c[0];n+=`{{${d}}}`;return}re(t,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:s,child:o});return}re(t,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:s,child:o})}),n},Ht=(i,e=[],t={})=>{if(!i)return i;const s=Object.keys(t),n=[...e,...s];let r="",a=0;for(;a<i.length;)if(i[a]==="<"){let o=!1;const l=i.slice(a).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(l){const u=l[1];(/^\d+$/.test(u)||n.includes(u))&&(o=!0,r+=l[0],a+=l[0].length)}if(!o){const u=i.slice(a).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(u){const f=u[1];(/^\d+$/.test(f)||n.includes(f))&&(o=!0,r+=u[0],a+=u[0].length)}}o||(r+="&lt;",a+=1)}else r+=i[a],a+=1;return r},Mt=(i,e,t,s,n,r,a)=>{if(t==="")return[];const o=n.transKeepBasicHtmlNodesFor||[],l=t&&new RegExp(o.map(b=>`<${b}`).join("|")).test(t);if(!i&&!e&&!l&&!a)return[t];const u=e??{},f=b=>{W(b).forEach(v=>{D(v)||(ae(v)?f(X(v)):B(v)&&!O.isValidElement(v)&&Object.assign(u,v))})};f(i);const c=Ht(t,o,u),d=Pt.parse(`<0>${c}</0>`),g={...u,...r},h=(b,E,v)=>{const C=X(b),A=S(C,E.children,v);return Vt(C)&&A.length===0||b.props?.i18nIsDynamicList?C:A},y=(b,E,v,C,A)=>{b.dummy?(b.children=E,v.push(O.cloneElement(b,{key:C},A?void 0:E))):v.push(...O.Children.map([b],$=>{if($.type===O.Fragment||$.props?.i18nIsDynamicList!==void 0){const p={key:C};return $&&$.props&&Object.keys($.props).forEach(m=>{m==="children"||m==="i18nIsDynamicList"||(p[m]=$.props[m])}),O.createElement($.type,p,A?null:E)}const P={key:C};return $&&$.props&&Object.keys($.props).forEach(p=>{p==="ref"||p==="children"||(P[p]=$.props[p])}),O.cloneElement($,P,A?null:E)}))},S=(b,E,v)=>{const C=W(b),A=W(E),$={};return A.reduce((P,p,m)=>{const k=p.children?.[0]?.content&&s.services.interpolator.interpolate(p.children[0].content,g,s.language);if(p.type==="tag"){let N=C[parseInt(p.name,10)];!N&&e&&(N=e[p.name]),v.length===1&&!N&&(N=v[0][p.name]),N||(N={});const L={...p.attrs};a&&Object.keys(L).forEach(T=>{const K=L[T];D(K)&&(L[T]=Ge(K))});const w=Object.keys(L).length!==0?Ut({props:L},N):N,U=O.isValidElement(w),j=U&&ae(p,!0)&&!p.voidElement,I=l&&B(w)&&w.dummy&&!U,H=B(e)&&Object.hasOwnProperty.call(e,p.name);if(D(w)){const T=s.services.interpolator.interpolate(w,g,s.language);P.push(T)}else if(ae(w)||j){const T=h(w,p,v);y(w,T,P,m)}else if(I){const T=S(C,p.children,v);y(w,T,P,m)}else if(Number.isNaN(parseFloat(p.name)))if(H){const T=h(w,p,v);y(w,T,P,m,p.voidElement)}else if(n.transSupportBasicHtmlNodes&&o.indexOf(p.name)>-1)if(p.voidElement)P.push(O.createElement(p.name,{key:`${p.name}-${m}`}));else{const T=$[p.name]||0;$[p.name]=T+1;let K,F=0;for(let Y=0;Y<C.length;Y+=1){const fe=C[Y];if(O.isValidElement(fe)&&fe.type===p.name){if(F===T){K=fe;break}F+=1}}const _=K?W(X(K)):C,J=S(_,p.children,v);P.push(O.createElement(p.name,{key:`${p.name}-${m}`},J))}else if(p.voidElement)P.push(`<${p.name} />`);else{const T=S(C,p.children,v);P.push(`<${p.name}>${T}</${p.name}>`)}else if(B(w)&&!U){const T=p.children[0]?k:null;T&&P.push(T)}else y(w,k,P,m,p.children.length!==1||!k)}else if(p.type==="text"){const N=n.transWrapTextNodes,L=typeof n.unescape=="function"?n.unescape:we().unescape,w=a?L(s.services.interpolator.interpolate(p.content,g,s.language)):s.services.interpolator.interpolate(p.content,g,s.language);N?P.push(O.createElement(N,{key:`${p.name}-${m}`},w)):P.push(w)}return P},[])},R=S([{dummy:!0,children:i||[]}],d,W(i||[]));return X(R[0])},et=(i,e,t)=>{const s=i.key||e,n=O.cloneElement(i,{key:s});if(!n.props||!n.props.children||t.indexOf(`${e}/>`)<0&&t.indexOf(`${e} />`)<0)return n;function r(){return O.createElement(O.Fragment,null,n)}return O.createElement(r,{key:s})},_t=(i,e)=>i.map((t,s)=>et(t,s,e)),zt=(i,e)=>{const t={};return Object.keys(i).forEach(s=>{Object.assign(t,{[s]:et(i[s],s,e)})}),t},Bt=(i,e,t,s)=>i?Array.isArray(i)?_t(i,e):B(i)?zt(i,e):(ne(t,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:s}),null):null,Wt=i=>!B(i)||Array.isArray(i)?!1:Object.keys(i).reduce((e,t)=>e&&Number.isNaN(Number.parseFloat(t)),!0);function Jt({children:i,count:e,parent:t,i18nKey:s,context:n,tOptions:r={},values:a,defaults:o,components:l,ns:u,i18n:f,t:c,shouldUnescape:d,...g}){const h=f||Le();if(!h)return ne(h,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:s}),i;const y=c||h.t.bind(h)||(K=>K),S={...we(),...h.options?.react};let R=u||y.ns||h.options?.defaultNS;R=D(R)?[R]:R||["translation"];const{transDefaultProps:b}=S,E=b?.tOptions?{...b.tOptions,...r}:r,v=d??b?.shouldUnescape,C=b?.values?{...b.values,...a}:a,A=b?.components?{...b.components,...l}:l,$=ve(i,S,h,s),P=o||E?.defaultValue||$||S.transEmptyNodeValue||(typeof s=="function"?q(s):s),{hashTransKey:p}=S,m=s||(p?p($||P):$||P);h.options?.interpolation?.defaultVariables?a=C&&Object.keys(C).length>0?{...C,...h.options.interpolation.defaultVariables}:{...h.options.interpolation.defaultVariables}:a=C;const k=Kt(i);k&&typeof k.count=="number"&&e===void 0&&(e=k.count);const N=a||e!==void 0&&!h.options?.interpolation?.alwaysFormat||!i?E.interpolation:{interpolation:{...E.interpolation,prefix:"#$?",suffix:"?$#"}},L={...E,context:n||E.context,count:e,...a,...N,defaultValue:P,ns:R};let w=m?y(m,L):P;w===m&&P&&(w=P);const U=Bt(A,w,h,s);let j=U||i,I=null;Wt(U)&&(I=U,j=i);const H=Mt(j,I,w,h,S,L,v),T=t??S.defaultTransParent;return T?O.createElement(T,g,H):H}const xs={type:"3rdParty",init(i){It(i.options.react),Dt(i)}},Oe=O.createContext();class qt{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Ss({children:i,count:e,parent:t,i18nKey:s,context:n,tOptions:r={},values:a,defaults:o,components:l,ns:u,i18n:f,t:c,shouldUnescape:d,...g}){const{i18n:h,defaultNS:y}=O.useContext(Oe)||{},S=f||h||Le(),R=c||S?.t.bind(S);return Jt({children:i,count:e,parent:t,i18nKey:s,context:n,tOptions:r,values:a,defaults:o,components:l,ns:u||R?.ns||y||S?.options?.defaultNS,i18n:S,t:c,shouldUnescape:d,...g})}var me={exports:{}},ye={};/**
1
+ import{g as nt,r as O,a as it}from"./vendor-react-BTgM5bbZ.js";const x=i=>typeof i=="string",G=()=>{let i,e;const t=new Promise((s,n)=>{i=s,e=n});return t.resolve=i,t.reject=e,t},Ce=i=>i==null?"":String(i),rt=(i,e,t)=>{i.forEach(s=>{e[s]&&(t[s]=e[s])})},at=/###/g,Ee=i=>i&&i.includes("###")?i.replace(at,"."):i,Ne=i=>!i||x(i),ee=(i,e,t)=>{const s=x(e)?e.split("."):e;let n=0;for(;n<s.length-1;){if(Ne(i))return{};const r=Ee(s[n]);!i[r]&&t&&(i[r]=new t),Object.prototype.hasOwnProperty.call(i,r)?i=i[r]:i={},++n}return Ne(i)?{}:{obj:i,k:Ee(s[n])}},$e=(i,e,t)=>{const{obj:s,k:n}=ee(i,e,Object);if(s!==void 0||e.length===1){s[n]=t;return}let r=e[e.length-1],a=e.slice(0,e.length-1),o=ee(i,a,Object);for(;o.obj===void 0&&a.length;)r=`${a[a.length-1]}.${r}`,a=a.slice(0,a.length-1),o=ee(i,a,Object),o?.obj&&typeof o.obj[`${o.k}.${r}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${r}`]=t},ot=(i,e,t,s)=>{const{obj:n,k:r}=ee(i,e,Object);n[r]=n[r]||[],n[r].push(t)},oe=(i,e)=>{const{obj:t,k:s}=ee(i,e);if(t&&Object.prototype.hasOwnProperty.call(t,s))return t[s]},lt=(i,e,t)=>{const s=oe(i,t);return s!==void 0?s:oe(e,t)},Je=(i,e,t)=>{for(const s in e)s!=="__proto__"&&s!=="constructor"&&(s in i?x(i[s])||i[s]instanceof String||x(e[s])||e[s]instanceof String?t&&(i[s]=e[s]):Je(i[s],e[s],t):i[s]=e[s]);return i},z=i=>i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),ut={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"},ct=i=>x(i)?i.replace(/[&<>"'\/]/g,e=>ut[e]):i;class ft{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}const dt=[" ",",","?","!",";"],ht=new ft(20),pt=(i,e,t)=>{e=e||"",t=t||"";const s=dt.filter(a=>!e.includes(a)&&!t.includes(a));if(s.length===0)return!0;const n=ht.getRegExp(`(${s.map(a=>a==="?"?"\\?":a).join("|")})`);let r=!n.test(i);if(!r){const a=i.indexOf(t);a>0&&!n.test(i.substring(0,a))&&(r=!0)}return r},xe=(i,e,t=".")=>{if(!i)return;if(i[e])return Object.prototype.hasOwnProperty.call(i,e)?i[e]:void 0;const s=e.split(t);let n=i;for(let r=0;r<s.length;){if(!n||typeof n!="object")return;let a,o="";for(let l=r;l<s.length;++l)if(l!==r&&(o+=t),o+=s[l],a=n[o],a!==void 0){if(["string","number","boolean"].includes(typeof a)&&l<s.length-1)continue;r+=l-r+1;break}n=a}return n},se=i=>i?.replace(/_/g,"-"),gt={type:"logger",log(i){this.output("log",i)},warn(i){this.output("warn",i)},error(i){this.output("error",i)},output(i,e){console?.[i]?.apply?.(console,e)}};class le{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||gt,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,s,n){return n&&!this.debug?null:(e=e.map(r=>x(r)?r.replace(/[\r\n\x00-\x1F\x7F]/g," "):r),x(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new le(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new le(this.logger,e)}}var M=new le;class ce{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const n=this.observers[s].get(t)||0;this.observers[s].set(t,n+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}once(e,t){const s=(...n)=>{t(...n),this.off(e,s)};return this.on(e,s),this}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([n,r])=>{for(let a=0;a<r;a++)n(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,r])=>{for(let a=0;a<r;a++)n(e,...t)})}}class ke extends ce{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.includes(e)||this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,s,n={}){const r=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,a=n.ignoreJSONStructure!==void 0?n.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.includes(".")?o=e.split("."):(o=[e,t],s&&(Array.isArray(s)?o.push(...s):x(s)&&r?o.push(...s.split(r)):o.push(s)));const l=oe(this.data,o);return!l&&!t&&!s&&e.includes(".")&&(e=o[0],t=o[1],s=o.slice(2).join(".")),l||!a||!x(s)?l:xe(this.data?.[e]?.[t],s,r)}addResource(e,t,s,n,r={silent:!1}){const a=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let o=[e,t];s&&(o=o.concat(a?s.split(a):s)),e.includes(".")&&(o=e.split("."),n=t,t=o[1]),this.addNamespaces(t),$e(this.data,o,n),r.silent||this.emit("added",e,t,s,n)}addResources(e,t,s,n={silent:!1}){for(const r in s)(x(s[r])||Array.isArray(s[r]))&&this.addResource(e,t,r,s[r],{silent:!0});n.silent||this.emit("added",e,t,s)}addResourceBundle(e,t,s,n,r,a={silent:!1,skipCopy:!1}){let o=[e,t];e.includes(".")&&(o=e.split("."),n=s,s=t,t=o[1]),this.addNamespaces(t);let l=oe(this.data,o)||{};a.skipCopy||(s=JSON.parse(JSON.stringify(s))),n?Je(l,s,r):l={...l,...s},$e(this.data,o,l),a.silent||this.emit("added",e,t,s)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(n=>t[n]&&Object.keys(t[n]).length>0)}toJSON(){return this.data}}var qe={processors:{},addPostProcessor(i){this.processors[i.name]=i},handle(i,e,t,s,n){return i.forEach(r=>{e=this.processors[r]?.process(e,t,s,n)??e}),e}};const Ye=Symbol("i18next/PATH_KEY");function mt(){const i=[],e=Object.create(null);let t;return e.get=(s,n)=>(t?.revoke?.(),n===Ye?i:(i.push(n),t=Proxy.revocable(s,e),t.proxy)),Proxy.revocable(Object.create(null),e).proxy}function q(i,e){const{[Ye]:t}=i(mt()),s=e?.keySeparator??".",n=e?.nsSeparator??":",r=e?.enableSelector==="strict";if(t.length>1&&n){const a=e?.ns,o=r?Array.isArray(a)?a:a?[a]:null:Array.isArray(a)?a:null;if(o&&(r?o:o.length>1?o.slice(1):[]).includes(t[0]))return`${t[0]}${n}${t.slice(1).join(s)}`}return t.join(s)}const de=i=>!x(i)&&typeof i!="boolean"&&typeof i!="number";class ue extends ce{constructor(e,t={}){super(),rt(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=M.create("translator"),this.checkedLoadedFor={}}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const s={...t};if(e==null)return!1;const n=this.resolve(e,s);if(n?.res===void 0)return!1;const r=de(n.res);return!(s.returnObjects===!1&&r)}extractFromKey(e,t){let s=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const n=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let r=t.ns||this.options.defaultNS||[];const a=s&&e.includes(s),o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!pt(e,s,n);if(a&&!o){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:x(r)?[r]:r};const u=e.split(s);(s!==n||s===n&&this.options.ns.includes(u[0]))&&(r=u.shift()),e=u.join(n)}return{key:e,namespaces:x(r)?[r]:r}}translate(e,t,s){let n=typeof t=="object"?{...t}:t;if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";typeof e=="function"&&(e=q(e,{...this.options,...n})),Array.isArray(e)||(e=[String(e)]),e=e.map(L=>typeof L=="function"?q(L,{...this.options,...n}):String(L));const r=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(e[e.length-1],n),u=l[l.length-1];let f=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;f===void 0&&(f=":");const c=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(c?.toLowerCase()==="cimode")return d?r?{res:`${u}${f}${o}`,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:`${u}${f}${o}`:r?{res:o,usedKey:o,exactUsedKey:o,usedLng:c,usedNS:u,usedParams:this.getUsedParamsDetails(n)}:o;const g=this.resolve(e,n);let h=g?.res;const y=g?.usedKey||o,S=g?.exactUsedKey||o,R=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,v=n.count!==void 0&&!x(n.count),C=ue.hasDefaultValue(n),A=v?this.pluralResolver.getSuffix(c,n.count,n):"",$=n.ordinal&&v?this.pluralResolver.getSuffix(c,n.count,{ordinal:!1}):"",P=v&&!n.ordinal&&n.count===0,p=P&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${A}`]||n[`defaultValue${$}`]||n.defaultValue;let m=h;E&&!h&&C&&(m=p);const k=de(m),N=Object.prototype.toString.apply(m);if(E&&m&&k&&!R.includes(N)&&!(x(b)&&Array.isArray(m))){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const L=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,m,{...n,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return r?(g.res=L,g.usedParams=this.getUsedParamsDetails(n),g):L}if(a){const L=Array.isArray(m),w=L?[]:{},U=L?S:y;for(const j in m)if(Object.prototype.hasOwnProperty.call(m,j)){const I=`${U}${a}${j}`;C&&!h?w[j]=this.translate(I,{...n,defaultValue:de(p)?p[j]:void 0,joinArrays:!1,ns:l}):w[j]=this.translate(I,{...n,joinArrays:!1,ns:l}),w[j]===I&&(w[j]=m[j])}h=w}}else if(E&&x(b)&&Array.isArray(h))h=h.join(b),h&&(h=this.extendTranslation(h,e,n,s));else{let L=!1,w=!1;!this.isValidLookup(h)&&C&&(L=!0,h=p),this.isValidLookup(h)||(w=!0,h=o);const j=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&w?void 0:h,I=C&&p!==h&&this.options.updateMissing;if(w||L||I){if(this.logger.log(I?"updateKey":"missingKey",c,u,v&&!I?`${o}${this.pluralResolver.getSuffix(c,n.count,n)}`:o,I?p:h),a){const F=this.resolve(o,{...n,keySeparator:!1});F&&F.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 H=[];const T=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&T&&T[0])for(let F=0;F<T.length;F++)H.push(T[F]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(n.lng||this.language):H.push(n.lng||this.language);const K=(F,_,J)=>{const Y=C&&J!==h?J:j;this.options.missingKeyHandler?this.options.missingKeyHandler(F,u,_,Y,I,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(F,u,_,Y,I,n),this.emit("missingKey",F,u,_,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&v?H.forEach(F=>{const _=this.pluralResolver.getSuffixes(F,n);P&&n[`defaultValue${this.options.pluralSeparator}zero`]&&!_.includes(`${this.options.pluralSeparator}zero`)&&_.push(`${this.options.pluralSeparator}zero`),_.forEach(J=>{K([F],o+J,n[`defaultValue${J}`]||p)})}):K(H,o,p))}h=this.extendTranslation(h,e,n,g,s),w&&h===o&&this.options.appendNamespaceToMissingKey&&(h=`${u}${f}${o}`),(w||L)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${f}${o}`:o,L?h:void 0,n))}return r?(g.res=h,g.usedParams=this.getUsedParamsDetails(n),g):h}extendTranslation(e,t,s,n,r){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const l=x(e)&&(s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(l){const c=e.match(this.interpolator.nestingRegexp);u=c&&c.length}let f=s.replace&&!x(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),e=this.interpolator.interpolate(e,f,s.lng||this.language||n.usedLng,s),l){const c=e.match(this.interpolator.nestingRegexp),d=c&&c.length;u<d&&(s.nest=!1)}!s.lng&&n&&n.res&&(s.lng=this.language||n.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,(...c)=>r?.[0]===c[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${c[0]} in key: ${t[0]}`),null):this.translate(...c,t),s)),s.interpolation&&this.interpolator.reset()}const a=s.postProcess||this.options.postProcess,o=x(a)?[a]:a;return e!=null&&o?.length&&s.applyPostProcessor!==!1&&(e=qe.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e,t={}){let s,n,r,a,o;return x(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(l=>typeof l=="function"?q(l,{...this.options,...t}):l)),e.forEach(l=>{if(this.isValidLookup(s))return;const u=this.extractFromKey(l,t),f=u.key;n=f;let c=u.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const d=t.count!==void 0&&!x(t.count),g=d&&!t.ordinal&&t.count===0,h=t.context!==void 0&&(x(t.context)||typeof t.context=="number")&&t.context!=="",y=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(S=>{this.isValidLookup(s)||(o=S,!this.checkedLoadedFor[`${y[0]}-${S}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(this.checkedLoadedFor[`${y[0]}-${S}`]=!0,this.logger.warn(`key "${n}" for languages "${y.join(", ")}" won't get resolved as namespace "${o}" 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!!!")),y.forEach(R=>{if(this.isValidLookup(s))return;a=R;const b=[f];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(b,f,R,S,t);else{let v;d&&(v=this.pluralResolver.getSuffix(R,t.count,t));const C=`${this.options.pluralSeparator}zero`,A=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(t.ordinal&&v.startsWith(A)&&b.push(f+v.replace(A,this.options.pluralSeparator)),b.push(f+v),g&&b.push(f+C)),h){const $=`${f}${this.options.contextSeparator||"_"}${t.context}`;b.push($),d&&(t.ordinal&&v.startsWith(A)&&b.push($+v.replace(A,this.options.pluralSeparator)),b.push($+v),g&&b.push($+C))}}let E;for(;E=b.pop();)this.isValidLookup(s)||(r=E,s=this.getResource(R,S,E,t))}))})}),{res:s,usedKey:n,exactUsedKey:r,usedLng:a,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,s,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,s,n):this.resourceStore.getResource(e,t,s,n)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&!x(e.replace);let n=s?e.replace:e;if(s&&typeof e.count<"u"&&(n.count=e.count),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!s){n={...n};for(const r of t)delete n[r]}return n}static hasDefaultValue(e){const t="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&s.startsWith(t)&&e[s]!==void 0)return!0;return!1}}class Re{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=M.create("languageUtils")}getScriptPartFromCode(e){if(e=se(e),!e||!e.includes("-"))return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=se(e),!e||!e.includes("-"))return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(x(e)&&e.includes("-")){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.includes(e)}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(s=>{if(t)return;const n=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(n))&&(t=n)}),!t&&this.options.supportedLngs&&e.forEach(s=>{if(t)return;const n=this.getScriptPartFromCode(s);if(this.isSupportedCode(n))return t=n;const r=this.getLanguagePartFromCode(s);if(this.isSupportedCode(r))return t=r;t=this.options.supportedLngs.find(a=>a===r?!0:!a.includes("-")&&!r.includes("-")?!1:!!(a.includes("-")&&!r.includes("-")&&a.slice(0,a.indexOf("-"))===r||a.startsWith(r)&&r.length>1))}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),x(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let s=e[t];return s||(s=e[this.getScriptPartFromCode(t)]),s||(s=e[this.formatLanguageCode(t)]),s||(s=e[this.getLanguagePartFromCode(t)]),s||(s=e.default),s||[]}toResolveHierarchy(e,t){const s=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),n=[],r=a=>{a&&(this.isSupportedCode(a)?n.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return x(e)&&(e.includes("-")||e.includes("_"))?(this.options.load!=="languageOnly"&&r(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&r(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&r(this.getLanguagePartFromCode(e))):x(e)&&r(this.formatLanguageCode(e)),s.forEach(a=>{n.includes(a)||r(this.formatLanguageCode(a))}),n}}const Pe={zero:0,one:1,two:2,few:3,many:4,other:5},Te={select:i=>i===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class yt{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=M.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const s=se(e==="dev"?"en":e),n=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:s,type:n});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let a;try{a=new Intl.PluralRules(s,{type:n})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Te;if(!e.match(/-|_/))return Te;const l=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(l,t)}return this.pluralRulesCache[r]=a,a}needsPlural(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,s={}){return this.getSuffixes(e,s).map(n=>`${t}${n}`)}getSuffixes(e,t={}){let s=this.getRule(e,t);return s||(s=this.getRule("dev",t)),s?s.resolvedOptions().pluralCategories.sort((n,r)=>Pe[n]-Pe[r]).map(n=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${n}`):[]}getSuffix(e,t,s={}){const n=this.getRule(e,s);return n?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,s))}}const Ae=(i,e,t,s=".",n=!0)=>{let r=lt(i,e,t);return!r&&n&&x(t)&&(r=xe(i,t,s),r===void 0&&(r=xe(e,t,s))),r},he=i=>i.replace(/\$/g,"$$$$");class Fe{constructor(e={}){this.logger=M.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(t=>t),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:s,useRawValueToEscape:n,prefix:r,prefixEscaped:a,suffix:o,suffixEscaped:l,formatSeparator:u,unescapeSuffix:f,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:g,nestingSuffix:h,nestingSuffixEscaped:y,nestingOptionsSeparator:S,maxReplaces:R,alwaysFormat:b}=e.interpolation;this.escape=t!==void 0?t:ct,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=n!==void 0?n:!1,this.prefix=r?z(r):a||"{{",this.suffix=o?z(o):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=f?"":c?z(c):"-",this.unescapeSuffix=this.unescapePrefix?"":f?z(f):"",this.nestingPrefix=d?z(d):g||z("$t("),this.nestingSuffix=h?z(h):y||z(")"),this.nestingOptionsSeparator=S||",",this.maxReplaces=R||1e3,this.alwaysFormat=b!==void 0?b:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,s)=>t?.source===s?(t.lastIndex=0,t):new RegExp(s,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,s,n){let r,a,o;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(!g.includes(this.formatSeparator)){const R=Ae(t,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(R,void 0,s,{...n,...t,interpolationkey:g}):R}const h=g.split(this.formatSeparator),y=h.shift().trim(),S=h.join(this.formatSeparator).trim();return this.format(Ae(t,l,y,this.options.keySeparator,this.options.ignoreJSONStructure),S,s,{...n,...t,interpolationkey:y})};this.resetRegExp(),!this.escapeValue&&typeof e=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(e)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const f=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>he(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?he(this.escape(g)):he(g)}].forEach(g=>{for(o=0;r=g.regex.exec(e);){const h=r[1].trim();if(a=u(h),a===void 0)if(typeof f=="function"){const S=f(e,r,n);a=x(S)?S:""}else if(n&&Object.prototype.hasOwnProperty.call(n,h))a="";else if(c){a=r[0];continue}else this.logger.warn(`missed to pass in variable ${h} for interpolating ${e}`),a="";else!x(a)&&!this.useRawValueToEscape&&(a=Ce(a));const y=g.safeValue(a);if(e=e.replace(r[0],y),c?(g.regex.lastIndex+=a.length,g.regex.lastIndex-=r[0].length):g.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,s={}){let n,r,a;const o=(l,u)=>{const f=this.nestingOptionsSeparator;if(!l.includes(f))return l;const c=l.split(new RegExp(`${z(f)}[ ]*{`));let d=`{${c[1]}`;l=c[0],d=this.interpolate(d,a);const g=d.match(/'/g),h=d.match(/"/g);((g?.length??0)%2===0&&!h||(h?.length??0)%2!==0)&&(d=d.replace(/'/g,'"'));try{a=JSON.parse(d),u&&(a={...u,...a})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${f}${d}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,l};for(;n=this.nestingRegexp.exec(e);){let l=[];a={...s},a=a.replace&&!x(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const u=/{.*}/.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(u!==-1&&(l=n[1].slice(u).split(this.formatSeparator).map(f=>f.trim()).filter(Boolean),n[1]=n[1].slice(0,u)),r=t(o.call(this,n[1].trim(),a),a),r&&n[0]===e&&!x(r))return r;x(r)||(r=Ce(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),l.length&&(r=l.reduce((f,c)=>this.format(f,c,s.lng,{...s,interpolationkey:n[1].trim()}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}const xt=i=>{let e=i.toLowerCase().trim();const t={};if(i.includes("(")){const s=i.split("(");e=s[0].toLowerCase().trim();const n=s[1].slice(0,-1);e==="currency"&&!n.includes(":")?t.currency||(t.currency=n.trim()):e==="relativetime"&&!n.includes(":")?t.range||(t.range=n.trim()):n.split(";").forEach(a=>{if(a){const[o,...l]=a.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),f=o.trim();t[f]||(t[f]=u),u==="false"&&(t[f]=!1),u==="true"&&(t[f]=!0),isNaN(u)||(t[f]=parseInt(u,10))}})}return{formatName:e,formatOptions:t}},je=i=>{const e={};return(t,s,n)=>{let r=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(r={...r,[n.interpolationkey]:void 0});const a=s+JSON.stringify(r);let o=e[a];return o||(o=i(se(s),n),e[a]=o),o(t)}},St=i=>(e,t,s)=>i(se(t),s)(e);class bt{constructor(e={}){this.logger=M.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const s=t.cacheInBuiltFormats?je:St;this.formats={number:s((n,r)=>{const a=new Intl.NumberFormat(n,{...r});return o=>a.format(o)}),currency:s((n,r)=>{const a=new Intl.NumberFormat(n,{...r,style:"currency"});return o=>a.format(o)}),datetime:s((n,r)=>{const a=new Intl.DateTimeFormat(n,{...r});return o=>a.format(o)}),relativetime:s((n,r)=>{const a=new Intl.RelativeTimeFormat(n,{...r});return o=>a.format(o,r.range||"day")}),list:s((n,r)=>{const a=new Intl.ListFormat(n,{...r});return o=>a.format(o)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=je(t)}format(e,t,s,n={}){if(!t||e==null)return e;const r=t.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&!r[0].includes(")")&&r.find(o=>o.includes(")"))){const o=r.findIndex(l=>l.includes(")"));r[0]=[r[0],...r.splice(1,o)].join(this.formatSeparator)}return r.reduce((o,l)=>{const{formatName:u,formatOptions:f}=xt(l);if(this.formats[u]){let c=o;try{const d=n?.formatParams?.[n.interpolationkey]||{},g=d.locale||d.lng||n.locale||n.lng||s;c=this.formats[u](o,g,{...f,...n,...d})}catch(d){this.logger.warn(d)}return c}else this.logger.warn(`there was no format function for ${u}`);return o},e)}}const vt=(i,e)=>{i.pending[e]!==void 0&&(delete i.pending[e],i.pendingCount--)};class wt extends ce{constructor(e,t,s,n={}){super(),this.backend=e,this.store=t,this.services=s,this.languageUtils=s.languageUtils,this.options=n,this.logger=M.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(s,n.backend,n)}queueLoad(e,t,s,n){const r={},a={},o={},l={};return e.forEach(u=>{let f=!0;t.forEach(c=>{const d=`${u}|${c}`;!s.reload&&this.store.hasResourceBundle(u,c)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?a[d]===void 0&&(a[d]=!0):(this.state[d]=1,f=!1,a[d]===void 0&&(a[d]=!0),r[d]===void 0&&(r[d]=!0),l[c]===void 0&&(l[c]=!0)))}),f||(o[u]=!0)}),(Object.keys(r).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(r),pending:Object.keys(a),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(l)}}loaded(e,t,s){const n=e.split("|"),r=n[0],a=n[1];t&&this.emit("failedLoading",r,a,t),!t&&s&&this.store.addResourceBundle(r,a,s,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&s&&(this.state[e]=0);const o={};this.queue.forEach(l=>{ot(l.loaded,[r],a),vt(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{o[u]||(o[u]={});const f=l.loaded[u];f.length&&f.forEach(c=>{o[u][c]===void 0&&(o[u][c]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(l=>!l.done)}read(e,t,s,n=0,r=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:s,tried:n,wait:r,callback:a});return}this.readingCalls++;const o=(u,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const c=this.waitingReads.shift();this.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}if(u&&f&&n<this.maxRetries){setTimeout(()=>{this.read(e,t,s,n+1,r*2,a)},r);return}a(u,f)},l=this.backend[s].bind(this.backend);if(l.length===2){try{const u=l(e,t);u&&typeof u.then=="function"?u.then(f=>o(null,f)).catch(o):o(null,u)}catch(u){o(u)}return}return l(e,t,o)}prepareLoading(e,t,s={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();x(e)&&(e=this.languageUtils.toResolveHierarchy(e)),x(t)&&(t=[t]);const r=this.queueLoad(e,t,s,n);if(!r.toLoad.length)return r.pending.length||n(),null;r.toLoad.forEach(a=>{this.loadOne(a)})}load(e,t,s){this.prepareLoading(e,t,{},s)}reload(e,t,s){this.prepareLoading(e,t,{reload:!0},s)}loadOne(e,t=""){const s=e.split("|"),n=s[0],r=s[1];this.read(n,r,"read",void 0,void 0,(a,o)=>{a&&this.logger.warn(`${t}loading namespace ${r} for language ${n} failed`,a),!a&&o&&this.logger.log(`${t}loaded namespace ${r} for language ${n}`,o),this.loaded(e,a,o)})}saveMissing(e,t,s,n,r,a={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${s}" as the namespace "${t}" 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!!!");return}if(!(s==null||s==="")){if(this.backend?.create){const l={...a,isUpdate:r},u=this.backend.create.bind(this.backend);if(u.length<6)try{let f;u.length===5?f=u(e,t,s,n,l):f=u(e,t,s,n),f&&typeof f.then=="function"?f.then(c=>o(null,c)).catch(o):o(null,f)}catch(f){o(f)}else u(e,t,s,n,o,l)}!e||!e[0]||this.store.addResource(e[0],t,s,n)}}}const pe=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,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:i=>{let e={};if(typeof i[1]=="object"&&(e=i[1]),x(i[1])&&(e.defaultValue=i[1]),x(i[2])&&(e.tDescription=i[2]),typeof i[2]=="object"||typeof i[3]=="object"){const t=i[3]||i[2];Object.keys(t).forEach(s=>{e[s]=t[s]})}return e},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Ie=i=>(x(i.ns)&&(i.ns=[i.ns]),x(i.fallbackLng)&&(i.fallbackLng=[i.fallbackLng]),x(i.fallbackNS)&&(i.fallbackNS=[i.fallbackNS]),i.supportedLngs&&!i.supportedLngs.includes("cimode")&&(i.supportedLngs=i.supportedLngs.concat(["cimode"])),i),ie=()=>{},Lt=i=>{Object.getOwnPropertyNames(Object.getPrototypeOf(i)).forEach(t=>{typeof i[t]=="function"&&(i[t]=i[t].bind(i))})};class te extends ce{constructor(e={},t){if(super(),this.options=Ie(e),this.services={},this.logger=M,this.modules={external:[]},Lt(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(x(e.ns)?e.defaultNS=e.ns:e.ns.includes("translation")||(e.defaultNS=e.ns[0]));const s=pe();this.options={...s,...this.options,...Ie(e)},this.options.interpolation={...s.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=s.overloadTranslationOptionHandler);const n=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?M.init(n(this.modules.logger),this.options):M.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=bt;const f=new Re(this.options);this.store=new ke(this.options.resources,this.options);const c=this.services;c.logger=M,c.resourceStore=this.store,c.languageUtils=f,c.pluralResolver=new yt(f,{prepend:this.options.pluralSeparator}),u&&(c.formatter=n(u),c.formatter.init&&c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new Fe(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new wt(n(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",(d,...g)=>{this.emit(d,...g)}),this.modules.languageDetector&&(c.languageDetector=n(this.modules.languageDetector),c.languageDetector.init&&c.languageDetector.init(c,this.options.detection,this.options)),this.modules.i18nFormat&&(c.i18nFormat=n(this.modules.i18nFormat),c.i18nFormat.init&&c.i18nFormat.init(this)),this.translator=new ue(this.services,this.options),this.translator.on("*",(d,...g)=>{this.emit(d,...g)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,t||(t=ie),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[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(u=>{this[u]=(...f)=>this.store[u](...f)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...f)=>(this.store[u](...f),this)});const o=G(),l=()=>{const u=(f,c)=>{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),o.resolve(c),t(f,c)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),o}loadResources(e,t=ie){let s=t;const n=x(e)?e:this.language;if(typeof e=="function"&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if(n?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const r=[],a=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(u=>{u!=="cimode"&&(r.includes(u)||r.push(u))})};n?a(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>a(l)),this.options.preload?.forEach?.(o=>a(o)),this.services.backendConnector.load(r,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(o)})}else s(null)}reloadResources(e,t,s){const n=G();return typeof e=="function"&&(s=e,e=void 0),typeof t=="function"&&(s=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),s||(s=ie),this.services.backendConnector.reload(e,t,r=>{n.resolve(),s(r)}),n}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&qe.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!["cimode","dev"].includes(e)){for(let t=0;t<this.languages.length;t++){const s=this.languages[t];if(!["cimode","dev"].includes(s)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&!this.languages.includes(e)&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const s=G();this.emit("languageChanging",e);const n=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},r=(o,l)=>{l?this.isLanguageChangingTo===e&&(n(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,s.resolve((...u)=>this.t(...u)),t&&t(o,(...u)=>this.t(...u))},a=o=>{!e&&!o&&this.services.languageDetector&&(o=[]);const l=x(o)?o:o&&o[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(x(o)?[o]:o);u&&(this.language||n(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector?.cacheUserLanguage?.(u)),this.loadResources(u,f=>{r(f,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),s}getFixedT(e,t,s,n){const r=n?.scopeNs,a=(o,l,...u)=>{let f;typeof l!="object"?f=this.options.overloadTranslationOptionHandler([o,l].concat(u)):f={...l},f.lng=f.lng||a.lng,f.lngs=f.lngs||a.lngs;const c=f.ns!==void 0&&f.ns!==null;f.ns=f.ns||a.ns,f.keyPrefix!==""&&(f.keyPrefix=f.keyPrefix||s||a.keyPrefix);const d={...this.options,...f};Array.isArray(r)&&!c&&(d.ns=r),typeof f.keyPrefix=="function"&&(f.keyPrefix=q(f.keyPrefix,d));const g=this.options.keySeparator||".";let h;return f.keyPrefix&&Array.isArray(o)?h=o.map(y=>(typeof y=="function"&&(y=q(y,d)),`${f.keyPrefix}${g}${y}`)):(typeof o=="function"&&(o=q(o,d)),h=f.keyPrefix?`${f.keyPrefix}${g}${o}`:o),this.t(h,f)};return x(e)?a.lng=e:a.lngs=e,a.ns=t,a.keyPrefix=s,a}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){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 s=t.lng||this.resolvedLanguage||this.languages[0],n=this.options?this.options.fallbackLng:!1,r=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const a=(o,l)=>{const u=this.services.backendConnector.state[`${o}|${l}`];return u===-1||u===0||u===2};if(t.precheck){const o=t.precheck(this,a);if(o!==void 0)return o}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(s,e)&&(!n||a(r,e)))}loadNamespaces(e,t){const s=G();return this.options.ns?(x(e)&&(e=[e]),e.forEach(n=>{this.options.ns.includes(n)||this.options.ns.push(n)}),this.loadResources(n=>{s.resolve(),t&&t(n)}),s):(t&&t(),Promise.resolve())}loadLanguages(e,t){const s=G();x(e)&&(e=[e]);const n=this.options.preload||[],r=e.filter(a=>!n.includes(a)&&this.services.languageUtils.isSupportedCode(a));return r.length?(this.options.preload=n.concat(r),this.loadResources(a=>{s.resolve(),t&&t(a)}),s):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const n=new Intl.Locale(e);if(n&&n.getTextInfo){const r=n.getTextInfo();if(r&&r.direction)return r.direction}}catch{}const t=["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"],s=this.services?.languageUtils||new Re(pe());return e.toLowerCase().indexOf("-latn")>1?"ltr":t.includes(s.getLanguagePartFromCode(e))||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const s=new te(e,t);return s.createInstance=te.createInstance,s}cloneInstance(e={},t=ie){const s=e.forkResourceStore;s&&delete e.forkResourceStore;const n={...this.options,...e,isClone:!0},r=new te(n);if((e.debug!==void 0||e.prefix!==void 0)&&(r.logger=r.logger.clone(e)),["store","services","language"].forEach(o=>{r[o]=this[o]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},s){const o=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((f,c)=>(f[c]={...l[u][c]},f),l[u]),l),{});r.store=new ke(o,n),r.services.resourceStore=r.store}if(e.interpolation){const l={...pe().interpolation,...this.options.interpolation,...e.interpolation},u={...n,interpolation:l};r.services.interpolator=new Fe(u)}return r.translator=new ue(r.services,n),r.translator.on("*",(o,...l)=>{r.emit(o,...l)}),r.init(n,t),r.translator.options=n,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const V=te.createInstance();V.createInstance;V.dir;V.init;V.loadResources;V.reloadResources;V.use;V.changeLanguage;V.getFixedT;V.t;V.exists;V.setDefaultNamespace;V.hasLoadedNamespace;V.loadNamespaces;V.loadLanguages;var ge,De;function Ot(){return De||(De=1,ge={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),ge}var Ct=Ot();const Et=nt(Ct);var Nt=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function Ve(i){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},t=i.match(/<\/?([^\s]+?)[/\s>]/);if(t&&(e.name=t[1],(Et[t[1]]||i.charAt(i.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){var s=i.indexOf("-->");return{type:"comment",comment:s!==-1?i.slice(4,s):""}}for(var n=new RegExp(Nt),r=null;(r=n.exec(i))!==null;)if(r[0].trim())if(r[1]){var a=r[1].trim(),o=[a,""];a.indexOf("=")>-1&&(o=a.split("=")),e.attrs[o[0]]=o[1],n.lastIndex--}else r[2]&&(e.attrs[r[2]]=r[3].trim().substring(1,r[3].length-1));return e}var $t=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,kt=/^\s*$/,Rt=Object.create(null);function Qe(i,e){switch(e.type){case"text":return i+e.content;case"tag":return i+="<"+e.name+(e.attrs?(function(t){var s=[];for(var n in t)s.push(n+'="'+t[n]+'"');return s.length?" "+s.join(" "):""})(e.attrs):"")+(e.voidElement?"/>":">"),e.voidElement?i:i+e.children.reduce(Qe,"")+"</"+e.name+">";case"comment":return i+"<!--"+e.comment+"-->"}}var Pt={parse:function(i,e){e||(e={}),e.components||(e.components=Rt);var t,s=[],n=[],r=-1,a=!1;if(i.indexOf("<")!==0){var o=i.indexOf("<");s.push({type:"text",content:o===-1?i:i.substring(0,o)})}return i.replace($t,function(l,u){if(a){if(l!=="</"+t.name+">")return;a=!1}var f,c=l.charAt(1)!=="/",d=l.startsWith("<!--"),g=u+l.length,h=i.charAt(g);if(d){var y=Ve(l);return r<0?(s.push(y),s):((f=n[r]).children.push(y),s)}if(c&&(r++,(t=Ve(l)).type==="tag"&&e.components[t.name]&&(t.type="component",a=!0),t.voidElement||a||!h||h==="<"||t.children.push({type:"text",content:i.slice(g,i.indexOf("<",g))}),r===0&&s.push(t),(f=n[r-1])&&f.children.push(t),n[r]=t),(!c||t.voidElement)&&(r>-1&&(t.voidElement||t.name===l.slice(2,-1))&&(r--,t=r===-1?s:n[r]),!a&&h!=="<"&&h)){f=r===-1?s:n[r].children;var S=i.indexOf("<",g),R=i.slice(g,S===-1?void 0:S);kt.test(R)&&(R=" "),(S>-1&&r+f.length>=0||R!==" ")&&f.push({type:"text",content:R})}}),s},stringify:function(i){return i.reduce(function(e,t){return e+Qe("",t)},"")}};const re=(i,e,t,s)=>{const n=[t,{code:e,...s||{}}];if(i?.services?.logger?.forward)return i.services.logger.forward(n,"warn","react-i18next::",!0);D(n[0])&&(n[0]=`react-i18next:: ${n[0]}`),i?.services?.logger?.warn?i.services.logger.warn(...n):console?.warn&&console.warn(...n)},Ue={},ne=(i,e,t,s)=>{D(t)&&Ue[t]||(D(t)&&(Ue[t]=new Date),re(i,e,t,s))},Ze=(i,e)=>()=>{if(i.isInitialized)e();else{const t=()=>{setTimeout(()=>{i.off("initialized",t)},0),e()};i.on("initialized",t)}},Se=(i,e,t)=>{i.loadNamespaces(e,Ze(i,t))},Ke=(i,e,t,s)=>{if(D(t)&&(t=[t]),i.options.preload&&i.options.preload.indexOf(e)>-1)return Se(i,t,s);t.forEach(n=>{i.options.ns.indexOf(n)<0&&i.options.ns.push(n)}),i.loadLanguages(e,Ze(i,s))},Tt=(i,e,t={})=>!e.languages||!e.languages.length?(ne(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(i,{lng:t.lng,precheck:(s,n)=>{if(t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!n(s.isLanguageChangingTo,i))return!1}}),D=i=>typeof i=="string",B=i=>typeof i=="object"&&i!==null,At=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Ft={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},jt=i=>Ft[i],Ge=i=>i.replace(At,jt);let be={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Ge,transDefaultProps:void 0};const It=(i={})=>{be={...be,...i}},we=()=>be;let Xe;const Dt=i=>{Xe=i},Le=()=>Xe,ae=(i,e)=>{if(!i)return!1;const t=i.props?.children??i.children;return e?t.length>0:!!t},X=i=>{if(!i)return[];const e=i.props?.children??i.children;return i.props?.i18nIsDynamicList?W(e):e},Vt=i=>Array.isArray(i)&&i.every(O.isValidElement),W=i=>Array.isArray(i)?i:[i],Ut=(i,e)=>{const t={...e};return t.props={...e.props,...i.props},t},Kt=i=>{const e={};if(!i)return e;const t=s=>{W(s).forEach(r=>{D(r)||(ae(r)?t(X(r)):B(r)&&!O.isValidElement(r)&&Object.assign(e,r))})};return t(i),e},ve=(i,e,t,s)=>{if(!i)return"";let n="";const r=W(i),a=e?.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return r.forEach((o,l)=>{if(D(o)){n+=`${o}`;return}if(O.isValidElement(o)){const{props:u,type:f}=o,c=Object.keys(u).length,d=a.indexOf(f)>-1,g=u.children;if(!g&&d&&!c){n+=`<${f}/>`;return}if(!g&&(!d||c)||u.i18nIsDynamicList){n+=`<${l}></${l}>`;return}if(d&&c<=1){const y=D(g)?g:ve(g,e,t,s);n+=`<${f}>${y}</${f}>`;return}const h=ve(g,e,t,s);n+=`<${l}>${h}</${l}>`;return}if(o===null){re(t,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:s});return}if(B(o)){const{format:u,...f}=o,c=Object.keys(f);if(c.length===1){const d=u?`${c[0]}, ${u}`:c[0];n+=`{{${d}}}`;return}re(t,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:s,child:o});return}re(t,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:s,child:o})}),n},Ht=(i,e=[],t={})=>{if(!i)return i;const s=Object.keys(t),n=[...e,...s];let r="",a=0;for(;a<i.length;)if(i[a]==="<"){let o=!1;const l=i.slice(a).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(l){const u=l[1];(/^\d+$/.test(u)||n.includes(u))&&(o=!0,r+=l[0],a+=l[0].length)}if(!o){const u=i.slice(a).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(u){const f=u[1];(/^\d+$/.test(f)||n.includes(f))&&(o=!0,r+=u[0],a+=u[0].length)}}o||(r+="&lt;",a+=1)}else r+=i[a],a+=1;return r},Mt=(i,e,t,s,n,r,a)=>{if(t==="")return[];const o=n.transKeepBasicHtmlNodesFor||[],l=t&&new RegExp(o.map(b=>`<${b}`).join("|")).test(t);if(!i&&!e&&!l&&!a)return[t];const u=e??{},f=b=>{W(b).forEach(v=>{D(v)||(ae(v)?f(X(v)):B(v)&&!O.isValidElement(v)&&Object.assign(u,v))})};f(i);const c=Ht(t,o,u),d=Pt.parse(`<0>${c}</0>`),g={...u,...r},h=(b,E,v)=>{const C=X(b),A=S(C,E.children,v);return Vt(C)&&A.length===0||b.props?.i18nIsDynamicList?C:A},y=(b,E,v,C,A)=>{b.dummy?(b.children=E,v.push(O.cloneElement(b,{key:C},A?void 0:E))):v.push(...O.Children.map([b],$=>{if($.type===O.Fragment||$.props?.i18nIsDynamicList!==void 0){const p={key:C};return $&&$.props&&Object.keys($.props).forEach(m=>{m==="children"||m==="i18nIsDynamicList"||(p[m]=$.props[m])}),O.createElement($.type,p,A?null:E)}const P={key:C};return $&&$.props&&Object.keys($.props).forEach(p=>{p==="ref"||p==="children"||(P[p]=$.props[p])}),O.cloneElement($,P,A?null:E)}))},S=(b,E,v)=>{const C=W(b),A=W(E),$={};return A.reduce((P,p,m)=>{const k=p.children?.[0]?.content&&s.services.interpolator.interpolate(p.children[0].content,g,s.language);if(p.type==="tag"){let N=C[parseInt(p.name,10)];!N&&e&&(N=e[p.name]),v.length===1&&!N&&(N=v[0][p.name]),N||(N={});const L={...p.attrs};a&&Object.keys(L).forEach(T=>{const K=L[T];D(K)&&(L[T]=Ge(K))});const w=Object.keys(L).length!==0?Ut({props:L},N):N,U=O.isValidElement(w),j=U&&ae(p,!0)&&!p.voidElement,I=l&&B(w)&&w.dummy&&!U,H=B(e)&&Object.hasOwnProperty.call(e,p.name);if(D(w)){const T=s.services.interpolator.interpolate(w,g,s.language);P.push(T)}else if(ae(w)||j){const T=h(w,p,v);y(w,T,P,m)}else if(I){const T=S(C,p.children,v);y(w,T,P,m)}else if(Number.isNaN(parseFloat(p.name)))if(H){const T=h(w,p,v);y(w,T,P,m,p.voidElement)}else if(n.transSupportBasicHtmlNodes&&o.indexOf(p.name)>-1)if(p.voidElement)P.push(O.createElement(p.name,{key:`${p.name}-${m}`}));else{const T=$[p.name]||0;$[p.name]=T+1;let K,F=0;for(let Y=0;Y<C.length;Y+=1){const fe=C[Y];if(O.isValidElement(fe)&&fe.type===p.name){if(F===T){K=fe;break}F+=1}}const _=K?W(X(K)):C,J=S(_,p.children,v);P.push(O.createElement(p.name,{key:`${p.name}-${m}`},J))}else if(p.voidElement)P.push(`<${p.name} />`);else{const T=S(C,p.children,v);P.push(`<${p.name}>${T}</${p.name}>`)}else if(B(w)&&!U){const T=p.children[0]?k:null;T&&P.push(T)}else y(w,k,P,m,p.children.length!==1||!k)}else if(p.type==="text"){const N=n.transWrapTextNodes,L=typeof n.unescape=="function"?n.unescape:we().unescape,w=a?L(s.services.interpolator.interpolate(p.content,g,s.language)):s.services.interpolator.interpolate(p.content,g,s.language);N?P.push(O.createElement(N,{key:`${p.name}-${m}`},w)):P.push(w)}return P},[])},R=S([{dummy:!0,children:i||[]}],d,W(i||[]));return X(R[0])},et=(i,e,t)=>{const s=i.key||e,n=O.cloneElement(i,{key:s});if(!n.props||!n.props.children||t.indexOf(`${e}/>`)<0&&t.indexOf(`${e} />`)<0)return n;function r(){return O.createElement(O.Fragment,null,n)}return O.createElement(r,{key:s})},_t=(i,e)=>i.map((t,s)=>et(t,s,e)),zt=(i,e)=>{const t={};return Object.keys(i).forEach(s=>{Object.assign(t,{[s]:et(i[s],s,e)})}),t},Bt=(i,e,t,s)=>i?Array.isArray(i)?_t(i,e):B(i)?zt(i,e):(ne(t,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:s}),null):null,Wt=i=>!B(i)||Array.isArray(i)?!1:Object.keys(i).reduce((e,t)=>e&&Number.isNaN(Number.parseFloat(t)),!0);function Jt({children:i,count:e,parent:t,i18nKey:s,context:n,tOptions:r={},values:a,defaults:o,components:l,ns:u,i18n:f,t:c,shouldUnescape:d,...g}){const h=f||Le();if(!h)return ne(h,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:s}),i;const y=c||h.t.bind(h)||(K=>K),S={...we(),...h.options?.react};let R=u||y.ns||h.options?.defaultNS;R=D(R)?[R]:R||["translation"];const{transDefaultProps:b}=S,E=b?.tOptions?{...b.tOptions,...r}:r,v=d??b?.shouldUnescape,C=b?.values?{...b.values,...a}:a,A=b?.components?{...b.components,...l}:l,$=ve(i,S,h,s),P=o||E?.defaultValue||$||S.transEmptyNodeValue||(typeof s=="function"?q(s):s),{hashTransKey:p}=S,m=s||(p?p($||P):$||P);h.options?.interpolation?.defaultVariables?a=C&&Object.keys(C).length>0?{...C,...h.options.interpolation.defaultVariables}:{...h.options.interpolation.defaultVariables}:a=C;const k=Kt(i);k&&typeof k.count=="number"&&e===void 0&&(e=k.count);const N=a||e!==void 0&&!h.options?.interpolation?.alwaysFormat||!i?E.interpolation:{interpolation:{...E.interpolation,prefix:"#$?",suffix:"?$#"}},L={...E,context:n||E.context,count:e,...a,...N,defaultValue:P,ns:R};let w=m?y(m,L):P;w===m&&P&&(w=P);const U=Bt(A,w,h,s);let j=U||i,I=null;Wt(U)&&(I=U,j=i);const H=Mt(j,I,w,h,S,L,v),T=t??S.defaultTransParent;return T?O.createElement(T,g,H):H}const xs={type:"3rdParty",init(i){It(i.options.react),Dt(i)}},Oe=O.createContext();class qt{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(t=>{this.usedNamespaces[t]||(this.usedNamespaces[t]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function Ss({children:i,count:e,parent:t,i18nKey:s,context:n,tOptions:r={},values:a,defaults:o,components:l,ns:u,i18n:f,t:c,shouldUnescape:d,...g}){const{i18n:h,defaultNS:y}=O.useContext(Oe)||{},S=f||h||Le(),R=c||S?.t.bind(S);return Jt({children:i,count:e,parent:t,i18nKey:s,context:n,tOptions:r,values:a,defaults:o,components:l,ns:u||R?.ns||y||S?.options?.defaultNS,i18n:S,t:c,shouldUnescape:d,...g})}var me={exports:{}},ye={};/**
2
2
  * @license React
3
3
  * use-sync-external-store-shim.production.js
4
4
  *