score-viewer 1.0.52 → 1.0.53

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.
@@ -2605,7 +2605,7 @@ class XI {
2605
2605
  const ga = oa(HI), Cr = oa(jI), Ei = oa(VI), Zn = oa(UI), Yi = oa(WI), Ln = oa(YI), va = oa(qI), ge = new XI();
2606
2606
  function KI(e) {
2607
2607
  return new Worker(
2608
- "" + new URL("assets/verovio.worker-c9SE8jl3.js", import.meta.url).href,
2608
+ "" + new URL("assets/verovio.worker-BU_hF9pg.js", import.meta.url).href,
2609
2609
  {
2610
2610
  name: e == null ? void 0 : e.name
2611
2611
  }
@@ -1,4 +1,4 @@
1
- (function(Mn,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("react"),require("react/jsx-runtime"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react/jsx-runtime","react-dom"],C):(Mn=typeof globalThis<"u"?globalThis:Mn||self,C(Mn.ScoreViewer={},Mn.React,Mn.jsxRuntime,Mn.ReactDOM))})(this,function(Mn,C,Y,zr){"use strict";var KJ=Object.defineProperty;var GJ=(Mn,C,Y)=>C in Mn?KJ(Mn,C,{enumerable:!0,configurable:!0,writable:!0,value:Y}):Mn[C]=Y;var no=(Mn,C,Y)=>GJ(Mn,typeof C!="symbol"?C+"":C,Y);function Vg(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const m=Vg(C),Ug=Vg(zr),Ot=e=>typeof e=="string",ds=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},Wg=e=>e==null?"":""+e,MN=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},LN=/###/g,Yg=e=>e&&e.indexOf("###")>-1?e.replace(LN,"."):e,qg=e=>!e||Ot(e),fs=(e,t,n)=>{const r=Ot(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(qg(e))return{};const o=Yg(r[i]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++i}return qg(e)?{}:{obj:e,k:Yg(r[i])}},Xg=(e,t,n)=>{const{obj:r,k:i}=fs(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],a=t.slice(0,t.length-1),s=fs(e,a,Object);for(;s.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),s=fs(e,a,Object),s!=null&&s.obj&&typeof s.obj[`${s.k}.${o}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=n},DN=(e,t,n,r)=>{const{obj:i,k:o}=fs(e,t,Object);i[o]=i[o]||[],i[o].push(n)},jl=(e,t)=>{const{obj:n,k:r}=fs(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},kN=(e,t,n)=>{const r=jl(e,n);return r!==void 0?r:jl(t,n)},Kg=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?Ot(e[r])||e[r]instanceof String||Ot(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Kg(e[r],t[r],n):e[r]=t[r]);return e},ia=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var RN={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const $N=e=>Ot(e)?e.replace(/[&<>"'\/]/g,t=>RN[t]):e;class FN{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const BN=[" ",",","?","!",";"],zN=new FN(20),HN=(e,t,n)=>{t=t||"",n=n||"";const r=BN.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const i=zN.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!i.test(e);if(!o){const a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o},_d=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let i=e;for(let o=0;o<r.length;){if(!i||typeof i!="object")return;let a,s="";for(let l=o;l<r.length;++l)if(l!==o&&(s+=n),s+=r[l],a=i[s],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&l<r.length-1)continue;o+=l-o+1;break}i=a}return i},hs=e=>e==null?void 0:e.replace("_","-"),jN={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class Vl{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||jN,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,i){return i&&!this.debug?null:(Ot(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Vl(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Vl(this.logger,t)}}var hi=new Vl;class Ul{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([i,o])=>{for(let a=0;a<o;a++)i(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,o])=>{for(let a=0;a<o;a++)i.apply(i,[t,...n])})}}class Gg extends Ul{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,i={}){var u,c;const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;t.indexOf(".")>-1?s=t.split("."):(s=[t,n],r&&(Array.isArray(r)?s.push(...r):Ot(r)&&o?s.push(...r.split(o)):s.push(r)));const l=jl(this.data,s);return!l&&!n&&!r&&t.indexOf(".")>-1&&(t=s[0],n=s[1],r=s.slice(2).join(".")),l||!a||!Ot(r)?l:_d((c=(u=this.data)==null?void 0:u[t])==null?void 0:c[n],r,o)}addResource(t,n,r,i,o={silent:!1}){const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let s=[t,n];r&&(s=s.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(s=t.split("."),i=n,n=s[1]),this.addNamespaces(n),Xg(this.data,s,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r,i={silent:!1}){for(const o in r)(Ot(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o,a={silent:!1,skipCopy:!1}){let s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),i=r,r=n,n=s[1]),this.addNamespaces(n);let l=jl(this.data,s)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?Kg(l,r,o):l={...l,...r},Xg(this.data,s,l),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var Qg={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{var a;t=((a=this.processors[o])==null?void 0:a.process(t,n,r,i))??t}),t}};const Zg={},Jg=e=>!Ot(e)&&typeof e!="boolean"&&typeof e!="number";class Wl extends Ul{constructor(t,n={}){super(),MN(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=hi.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const i=this.resolve(t,r);return(i==null?void 0:i.res)!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!HN(t,r,i);if(a&&!s){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:Ot(o)?[o]:o};const u=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),t=u.join(i)}return{key:t,namespaces:Ot(o)?[o]:o}}translate(t,n,r){let i=typeof n=="object"?{...n}:n;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(i={...i}),i||(i={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const o=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:s,namespaces:l}=this.extractFromKey(t[t.length-1],i),u=l[l.length-1];let c=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");const d=i.lng||this.language,h=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((d==null?void 0:d.toLowerCase())==="cimode")return h?o?{res:`${u}${c}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:`${u}${c}${s}`:o?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:s;const f=this.resolve(t,i);let p=f==null?void 0:f.res;const g=(f==null?void 0:f.usedKey)||s,v=(f==null?void 0:f.exactUsedKey)||s,b=["[object Number]","[object Function]","[object RegExp]"],y=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,T=i.count!==void 0&&!Ot(i.count),x=Wl.hasDefaultValue(i),S=T?this.pluralResolver.getSuffix(d,i.count,i):"",O=i.ordinal&&T?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):"",I=T&&!i.ordinal&&i.count===0,_=I&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${O}`]||i.defaultValue;let N=p;E&&!p&&x&&(N=_);const P=Jg(N),A=Object.prototype.toString.apply(N);if(E&&N&&P&&b.indexOf(A)<0&&!(Ot(y)&&Array.isArray(N))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const M=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,N,{...i,ns:l}):`key '${s} (${this.language})' returned an object instead of string.`;return o?(f.res=M,f.usedParams=this.getUsedParamsDetails(i),f):M}if(a){const M=Array.isArray(N),D=M?[]:{},R=M?v:g;for(const $ in N)if(Object.prototype.hasOwnProperty.call(N,$)){const F=`${R}${a}${$}`;x&&!p?D[$]=this.translate(F,{...i,defaultValue:Jg(_)?_[$]:void 0,joinArrays:!1,ns:l}):D[$]=this.translate(F,{...i,joinArrays:!1,ns:l}),D[$]===F&&(D[$]=N[$])}p=D}}else if(E&&Ot(y)&&Array.isArray(p))p=p.join(y),p&&(p=this.extendTranslation(p,t,i,r));else{let M=!1,D=!1;!this.isValidLookup(p)&&x&&(M=!0,p=_),this.isValidLookup(p)||(D=!0,p=s);const $=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&D?void 0:p,F=x&&_!==p&&this.options.updateMissing;if(D||M||F){if(this.logger.log(F?"updateKey":"missingKey",d,u,s,F?_:p),a){const U=this.resolve(s,{...i,keySeparator:!1});U&&U.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 B=[];const z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&z&&z[0])for(let U=0;U<z.length;U++)B.push(z[U]);else this.options.saveMissingTo==="all"?B=this.languageUtils.toResolveHierarchy(i.lng||this.language):B.push(i.lng||this.language);const k=(U,q,L)=>{var W;const X=x&&L!==p?L:$;this.options.missingKeyHandler?this.options.missingKeyHandler(U,u,q,X,F,i):(W=this.backendConnector)!=null&&W.saveMissing&&this.backendConnector.saveMissing(U,u,q,X,F,i),this.emit("missingKey",U,u,q,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?B.forEach(U=>{const q=this.pluralResolver.getSuffixes(U,i);I&&i[`defaultValue${this.options.pluralSeparator}zero`]&&q.indexOf(`${this.options.pluralSeparator}zero`)<0&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(L=>{k([U],s+L,i[`defaultValue${L}`]||_)})}):k(B,s,_))}p=this.extendTranslation(p,t,i,f,r),D&&p===s&&this.options.appendNamespaceToMissingKey&&(p=`${u}${c}${s}`),(D||M)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${c}${s}`:s,M?p:void 0,i))}return o?(f.res=p,f.usedParams=this.getUsedParamsDetails(i),f):p}extendTranslation(t,n,r,i,o){var l,u;if((l=this.i18nFormat)!=null&&l.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const c=Ot(t)&&(((u=r==null?void 0:r.interpolation)==null?void 0:u.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(c){const f=t.match(this.interpolator.nestingRegexp);d=f&&f.length}let h=r.replace&&!Ot(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,r.lng||this.language||i.usedLng,r),c){const f=t.match(this.interpolator.nestingRegexp),p=f&&f.length;d<p&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...f)=>(o==null?void 0:o[0])===f[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${n[0]}`),null):this.translate(...f,n),r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,s=Ot(a)?[a]:a;return t!=null&&(s!=null&&s.length)&&r.applyPostProcessor!==!1&&(t=Qg.handle(s,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,i,o,a,s;return Ot(t)&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(l,n),c=u.key;i=c;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const h=n.count!==void 0&&!Ot(n.count),f=h&&!n.ordinal&&n.count===0,p=n.context!==void 0&&(Ot(n.context)||typeof n.context=="number")&&n.context!=="",g=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(v=>{var b,y;this.isValidLookup(r)||(s=v,!Zg[`${g[0]}-${v}`]&&((b=this.utils)!=null&&b.hasLoadedNamespace)&&!((y=this.utils)!=null&&y.hasLoadedNamespace(s))&&(Zg[`${g[0]}-${v}`]=!0,this.logger.warn(`key "${i}" for languages "${g.join(", ")}" won't get resolved as namespace "${s}" 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!!!")),g.forEach(E=>{var S;if(this.isValidLookup(r))return;a=E;const T=[c];if((S=this.i18nFormat)!=null&&S.addLookupKeys)this.i18nFormat.addLookupKeys(T,c,E,v,n);else{let O;h&&(O=this.pluralResolver.getSuffix(E,n.count,n));const I=`${this.options.pluralSeparator}zero`,_=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(T.push(c+O),n.ordinal&&O.indexOf(_)===0&&T.push(c+O.replace(_,this.options.pluralSeparator)),f&&T.push(c+I)),p){const N=`${c}${this.options.contextSeparator}${n.context}`;T.push(N),h&&(T.push(N+O),n.ordinal&&O.indexOf(_)===0&&T.push(N+O.replace(_,this.options.pluralSeparator)),f&&T.push(N+I))}}let x;for(;x=T.pop();)this.isValidLookup(r)||(o=x,r=this.getResource(E,v,x,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,i={}){var o;return(o=this.i18nFormat)!=null&&o.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!Ot(t.replace);let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class e0{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=hi.create("languageUtils")}getScriptPartFromCode(t){if(t=hs(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=hs(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Ot(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getScriptPartFromCode(r);if(this.isSupportedCode(i))return n=i;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(a=>{if(a===o)return a;if(!(a.indexOf("-")<0&&o.indexOf("-")<0)&&(a.indexOf("-")>0&&o.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===o||a.indexOf(o)===0&&o.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Ot(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),i=[],o=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return Ot(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):Ot(t)&&o(this.formatLanguageCode(t)),r.forEach(a=>{i.indexOf(a)<0&&o(this.formatLanguageCode(a))}),i}}const t0={zero:0,one:1,two:2,few:3,many:4,other:5},n0={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class VN{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=hi.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=hs(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let a;try{a=new Intl.PluralRules(r,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),n0;if(!t.match(/-|_/))return n0;const l=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(l,n)}return this.pluralRulesCache[o]=a,a}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,o)=>t0[i]-t0[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,n,r={}){const i=this.getRule(t,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const r0=(e,t,n,r=".",i=!0)=>{let o=kN(e,t,n);return!o&&i&&Ot(n)&&(o=_d(e,n,r),o===void 0&&(o=_d(t,n,r))),o},Id=e=>e.replace(/\$/g,"$$$$");class UN{constructor(t={}){var n;this.logger=hi.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:a,suffix:s,suffixEscaped:l,formatSeparator:u,unescapeSuffix:c,unescapePrefix:d,nestingPrefix:h,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:g,nestingOptionsSeparator:v,maxReplaces:b,alwaysFormat:y}=t.interpolation;this.escape=n!==void 0?n:$N,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?ia(o):a||"{{",this.suffix=s?ia(s):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=c?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=h?ia(h):f||ia("$t("),this.nestingSuffix=p?ia(p):g||ia(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=b||1e3,this.alwaysFormat=y!==void 0?y:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,i){var f;let o,a,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=p=>{if(p.indexOf(this.formatSeparator)<0){const y=r0(n,l,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(y,void 0,r,{...i,...n,interpolationkey:p}):y}const g=p.split(this.formatSeparator),v=g.shift().trim(),b=g.join(this.formatSeparator).trim();return this.format(r0(n,l,v,this.options.keySeparator,this.options.ignoreJSONStructure),b,r,{...i,...n,interpolationkey:v})};this.resetRegExp();const c=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,d=((f=i==null?void 0:i.interpolation)==null?void 0:f.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>Id(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?Id(this.escape(p)):Id(p)}].forEach(p=>{for(s=0;o=p.regex.exec(t);){const g=o[1].trim();if(a=u(g),a===void 0)if(typeof c=="function"){const b=c(t,o,i);a=Ot(b)?b:""}else if(i&&Object.prototype.hasOwnProperty.call(i,g))a="";else if(d){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${t}`),a="";else!Ot(a)&&!this.useRawValueToEscape&&(a=Wg(a));const v=p.safeValue(a);if(t=t.replace(o[0],v),d?(p.regex.lastIndex+=a.length,p.regex.lastIndex-=o[0].length):p.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,n,r={}){let i,o,a;const s=(l,u)=>{const c=this.nestingOptionsSeparator;if(l.indexOf(c)<0)return l;const d=l.split(new RegExp(`${c}[ ]*{`));let h=`{${d[1]}`;l=d[0],h=this.interpolate(h,a);const f=h.match(/'/g),p=h.match(/"/g);(((f==null?void 0:f.length)??0)%2===0&&!p||p.length%2!==0)&&(h=h.replace(/'/g,'"'));try{a=JSON.parse(h),u&&(a={...u,...a})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,g),`${l}${c}${h}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,l};for(;i=this.nestingRegexp.exec(t);){let l=[];a={...r},a=a.replace&&!Ot(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const u=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(u!==-1&&(l=i[1].slice(u).split(this.formatSeparator).map(c=>c.trim()).filter(Boolean),i[1]=i[1].slice(0,u)),o=n(s.call(this,i[1].trim(),a),a),o&&i[0]===t&&!Ot(o))return o;Ot(o)||(o=Wg(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),l.length&&(o=l.reduce((c,d)=>this.format(c,d,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const WN=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(a=>{if(a){const[s,...l]=a.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),c=s.trim();n[c]||(n[c]=u),u==="false"&&(n[c]=!1),u==="true"&&(n[c]=!0),isNaN(u)||(n[c]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},i0=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const a=r+JSON.stringify(o);let s=t[a];return s||(s=e(hs(r),i),t[a]=s),s(n)}},YN=e=>(t,n,r)=>e(hs(n),r)(t);class qN{constructor(t={}){this.logger=hi.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?i0:YN;this.formats={number:r((i,o)=>{const a=new Intl.NumberFormat(i,{...o});return s=>a.format(s)}),currency:r((i,o)=>{const a=new Intl.NumberFormat(i,{...o,style:"currency"});return s=>a.format(s)}),datetime:r((i,o)=>{const a=new Intl.DateTimeFormat(i,{...o});return s=>a.format(s)}),relativetime:r((i,o)=>{const a=new Intl.RelativeTimeFormat(i,{...o});return s=>a.format(s,o.range||"day")}),list:r((i,o)=>{const a=new Intl.ListFormat(i,{...o});return s=>a.format(s)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=i0(n)}format(t,n,r,i={}){const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(s=>s.indexOf(")")>-1)){const s=o.findIndex(l=>l.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,s)].join(this.formatSeparator)}return o.reduce((s,l)=>{var d;const{formatName:u,formatOptions:c}=WN(l);if(this.formats[u]){let h=s;try{const f=((d=i==null?void 0:i.formatParams)==null?void 0:d[i.interpolationkey])||{},p=f.locale||f.lng||i.locale||i.lng||r;h=this.formats[u](s,p,{...c,...i,...f})}catch(f){this.logger.warn(f)}return h}else this.logger.warn(`there was no format function for ${u}`);return s},t)}}const XN=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class KN extends Ul{constructor(t,n,r,i={}){var o,a;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=hi.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(a=(o=this.backend)==null?void 0:o.init)==null||a.call(o,r,i.backend,i)}queueLoad(t,n,r,i){const o={},a={},s={},l={};return t.forEach(u=>{let c=!0;n.forEach(d=>{const h=`${u}|${d}`;!r.reload&&this.store.hasResourceBundle(u,d)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?a[h]===void 0&&(a[h]=!0):(this.state[h]=1,c=!1,a[h]===void 0&&(a[h]=!0),o[h]===void 0&&(o[h]=!0),l[d]===void 0&&(l[d]=!0)))}),c||(s[u]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const i=t.split("|"),o=i[0],a=i[1];n&&this.emit("failedLoading",o,a,n),!n&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const s={};this.queue.forEach(l=>{DN(l.loaded,[o],a),XN(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{s[u]||(s[u]={});const c=l.loaded[u];c.length&&c.forEach(d=>{s[u][d]===void 0&&(s[u][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(t,n,r,i=0,o=this.retryTimeout,a){if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:a});return}this.readingCalls++;const s=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(u&&c&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,o*2,a)},o);return}a(u,c)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const u=l(t,n);u&&typeof u.then=="function"?u.then(c=>s(null,c)).catch(s):s(null,u)}catch(u){s(u)}return}return l(t,n,s)}prepareLoading(t,n,r={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();Ot(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Ot(n)&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(a,s)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,a),!a&&s&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,s),this.loaded(t,a,s)})}saveMissing(t,n,r,i,o,a={},s=()=>{}){var l,u,c,d,h;if((u=(l=this.services)==null?void 0:l.utils)!=null&&u.hasLoadedNamespace&&!((d=(c=this.services)==null?void 0:c.utils)!=null&&d.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" 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(!(r==null||r==="")){if((h=this.backend)!=null&&h.create){const f={...a,isUpdate:o},p=this.backend.create.bind(this.backend);if(p.length<6)try{let g;p.length===5?g=p(t,n,r,i,f):g=p(t,n,r,i),g&&typeof g.then=="function"?g.then(v=>s(null,v)).catch(s):s(null,g)}catch(g){s(g)}else p(t,n,r,i,s,f)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const o0=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Ot(e[1])&&(t.defaultValue=e[1]),Ot(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),a0=e=>{var t,n;return Ot(e.ns)&&(e.ns=[e.ns]),Ot(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ot(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((n=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:n.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},Yl=()=>{},GN=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class ms extends Ul{constructor(t={},n){if(super(),this.options=a0(t),this.services={},this.logger=hi,this.modules={external:[]},GN(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(Ot(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=o0();this.options={...r,...this.options,...a0(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const i=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?hi.init(i(this.modules.logger),this.options):hi.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=qN;const c=new e0(this.options);this.store=new Gg(this.options.resources,this.options);const d=this.services;d.logger=hi,d.resourceStore=this.store,d.languageUtils=c,d.pluralResolver=new VN(c,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.warn("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),u&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(d.formatter=i(u),d.formatter.init&&d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new UN(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new KN(i(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",(f,...p)=>{this.emit(f,...p)}),this.modules.languageDetector&&(d.languageDetector=i(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=i(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new Wl(this.services,this.options),this.translator.on("*",(f,...p)=>{this.emit(f,...p)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Yl),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]=(...c)=>this.store[u](...c)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...c)=>(this.store[u](...c),this)});const s=ds(),l=()=>{const u=(c,d)=>{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),s.resolve(d),n(c,d)};if(this.languages&&!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),s}loadResources(t,n=Yl){var o,a;let r=n;const i=Ot(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const s=[],l=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(d=>{d!=="cimode"&&s.indexOf(d)<0&&s.push(d)})};i?l(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>l(c)),(a=(o=this.options.preload)==null?void 0:o.forEach)==null||a.call(o,u=>l(u)),this.services.backendConnector.load(s,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(t,n,r){const i=ds();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Yl),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Qg.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=ds();this.emit("languageChanging",t);const i=s=>{this.language=s,this.languages=this.services.languageUtils.toResolveHierarchy(s),this.resolvedLanguage=void 0,this.setResolvedLanguage(s)},o=(s,l)=>{l?this.isLanguageChangingTo===t&&(i(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,r.resolve((...u)=>this.t(...u)),n&&n(s,(...u)=>this.t(...u))},a=s=>{var c,d;!t&&!s&&this.services.languageDetector&&(s=[]);const l=Ot(s)?s:s&&s[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(Ot(s)?[s]:s);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),(d=(c=this.services.languageDetector)==null?void 0:c.cacheUserLanguage)==null||d.call(c,u)),this.loadResources(u,h=>{o(h,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&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(t),r}getFixedT(t,n,r){const i=(o,a,...s)=>{let l;typeof a!="object"?l=this.options.overloadTranslationOptionHandler([o,a].concat(s)):l={...a},l.lng=l.lng||i.lng,l.lngs=l.lngs||i.lngs,l.ns=l.ns||i.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||i.keyPrefix);const u=this.options.keySeparator||".";let c;return l.keyPrefix&&Array.isArray(o)?c=o.map(d=>`${l.keyPrefix}${u}${d}`):c=l.keyPrefix?`${l.keyPrefix}${u}${o}`:o,this.t(c,l)};return Ot(t)?i.lng=t:i.lngs=t,i.ns=n,i.keyPrefix=r,i}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){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 r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const u=this.services.backendConnector.state[`${s}|${l}`];return u===-1||u===0||u===2};if(n.precheck){const s=n.precheck(this,a);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!i||a(o,t)))}loadNamespaces(t,n){const r=ds();return this.options.ns?(Ot(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=ds();Ot(t)&&(t=[t]);const i=this.options.preload||[],o=t.filter(a=>i.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=i.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){var i,o;if(t||(t=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const a=new Intl.Locale(t);if(a&&a.getTextInfo){const s=a.getTextInfo();if(s&&s.direction)return s.direction}}catch{}const n=["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"],r=((o=this.services)==null?void 0:o.languageUtils)||new e0(o0());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){return new ms(t,n)}cloneInstance(t={},n=Yl){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new ms(i);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(s=>{o[s]=this[s]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const s=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((c,d)=>(c[d]={...l[u][d]},c),l[u]),l),{});o.store=new Gg(s,i),o.services.resourceStore=o.store}return o.translator=new Wl(o.services,i),o.translator.on("*",(s,...l)=>{o.emit(s,...l)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const An=ms.createInstance();An.createInstance=ms.createInstance,An.createInstance,An.dir,An.init,An.loadResources,An.reloadResources,An.use,An.changeLanguage,An.getFixedT,An.t,An.exists,An.setDefaultNamespace,An.hasLoadedNamespace,An.loadNamespaces,An.loadLanguages;var Nn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ql(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}const QN=(e,t,n,r)=>{var o,a,s,l;const i=[n,{code:t,...r||{}}];if((a=(o=e==null?void 0:e.services)==null?void 0:o.logger)!=null&&a.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);No(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(l=(s=e==null?void 0:e.services)==null?void 0:s.logger)!=null&&l.warn?e.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},s0={},Ad=(e,t,n,r)=>{No(n)&&s0[n]||(No(n)&&(s0[n]=new Date),QN(e,t,n,r))},l0=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},Pd=(e,t,n)=>{e.loadNamespaces(t,l0(e,n))},u0=(e,t,n,r)=>{if(No(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Pd(e,n,r);n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,l0(e,r))},ZN=(e,t,n={})=>!t.languages||!t.languages.length?(Ad(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),No=e=>typeof e=="string",JN=e=>typeof e=="object"&&e!==null,e_=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,t_={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},n_=e=>t_[e];let Md={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(e_,n_)};const r_=(e={})=>{Md={...Md,...e}},i_=()=>Md;let c0;const o_=e=>{c0=e},a_=()=>c0,s_={type:"3rdParty",init(e){r_(e.options.react),o_(e)}},l_=C.createContext();class u_{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const c_=(e,t)=>{const n=C.useRef();return C.useEffect(()=>{n.current=e},[e,t]),n.current},d0=(e,t,n,r)=>e.getFixedT(t,n,r),d_=(e,t,n,r)=>C.useCallback(d0(e,t,n,r),[e,t,n,r]),cr=(e,t={})=>{var T,x,S;const{i18n:n}=t,{i18n:r,defaultNS:i}=C.useContext(l_)||{},o=n||r||a_();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new u_),!o){Ad(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const O=(_,N)=>No(N)?N:JN(N)&&No(N.defaultValue)?N.defaultValue:Array.isArray(_)?_[_.length-1]:_,I=[O,{},!1];return I.t=O,I.i18n={},I.ready=!1,I}(T=o.options.react)!=null&&T.wait&&Ad(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...i_(),...o.options.react,...t},{useSuspense:s,keyPrefix:l}=a;let u=e;u=No(u)?[u]:u||["translation"],(S=(x=o.reportNamespaces).addUsedNamespaces)==null||S.call(x,u);const c=(o.isInitialized||o.initializedStoreOnce)&&u.every(O=>ZN(O,o,a)),d=d_(o,t.lng||null,a.nsMode==="fallback"?u:u[0],l),h=()=>d,f=()=>d0(o,t.lng||null,a.nsMode==="fallback"?u:u[0],l),[p,g]=C.useState(h);let v=u.join();t.lng&&(v=`${t.lng}${v}`);const b=c_(v),y=C.useRef(!0);C.useEffect(()=>{const{bindI18n:O,bindI18nStore:I}=a;y.current=!0,!c&&!s&&(t.lng?u0(o,t.lng,u,()=>{y.current&&g(f)}):Pd(o,u,()=>{y.current&&g(f)})),c&&b&&b!==v&&y.current&&g(f);const _=()=>{y.current&&g(f)};return O&&(o==null||o.on(O,_)),I&&(o==null||o.store.on(I,_)),()=>{y.current=!1,o&&O&&(O==null||O.split(" ").forEach(N=>o.off(N,_))),I&&o&&I.split(" ").forEach(N=>o.store.off(N,_))}},[o,v]),C.useEffect(()=>{y.current&&c&&g(h)},[o,l,c]);const E=[p,o,c];if(E.t=p,E.i18n=o,E.ready=c,c||!c&&!s)return E;throw new Promise(O=>{t.lng?u0(o,t.lng,u,()=>O()):Pd(o,u,()=>O())})},{slice:f_,forEach:h_}=[];function m_(e){return h_.call(f_.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}function p_(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(e))}const f0=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,g_=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(t);let o=`${e}=${i}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!f0.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!f0.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},h0={create(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=g_(e,t,i)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let i=n[r];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return i.substring(t.length,i.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var v_={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return h0.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:o}=t;n&&typeof document<"u"&&h0.create(n,e,r,i,o)}},b_={name:"querystring",lookup(e){var r;let{lookupQuerystring:t}=e,n;if(typeof window<"u"){let{search:i}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const a=i.substring(1).split("&");for(let s=0;s<a.length;s++){const l=a[s].indexOf("=");l>0&&a[s].substring(0,l)===t&&(n=a[s].substring(l+1))}}return n}},y_={name:"hash",lookup(e){var i;let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const a=o.substring(1);if(t){const s=a.split("&");for(let l=0;l<s.length;l++){const u=s[l].indexOf("=");u>0&&s[l].substring(0,u)===t&&(r=s[l].substring(u+1))}}if(r)return r;if(!r&&n>-1){const s=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(s)?(i=s[typeof n=="number"?n:0])==null?void 0:i.replace("/",""):void 0}}}return r}};let oa=null;const m0=()=>{if(oa!==null)return oa;try{if(oa=typeof window<"u"&&window.localStorage!==null,!oa)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{oa=!1}return oa};var E_={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&m0())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&m0()&&window.localStorage.setItem(n,e)}};let aa=null;const p0=()=>{if(aa!==null)return aa;try{if(aa=typeof window<"u"&&window.sessionStorage!==null,!aa)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{aa=!1}return aa};var S_={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&p0())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&p0()&&window.sessionStorage.setItem(n,e)}},C_={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:i}=navigator;if(n)for(let o=0;o<n.length;o++)t.push(n[o]);r&&t.push(r),i&&t.push(i)}return t.length>0?t:void 0}},w_={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},x_={name:"path",lookup(e){var i;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(i=n[typeof t=="number"?t:0])==null?void 0:i.replace("/",""):void 0}},T_={name:"subdomain",lookup(e){var i,o;let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&((o=(i=window.location)==null?void 0:i.hostname)==null?void 0:o.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let g0=!1;try{document.cookie,g0=!0}catch{}const v0=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];g0||v0.splice(1,1);const O_=()=>({order:v0,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class b0{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=m_(n,this.options||{},O_()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(v_),this.addDetector(b_),this.addDetector(E_),this.addDetector(S_),this.addDetector(C_),this.addDetector(w_),this.addDetector(x_),this.addDetector(T_),this.addDetector(y_)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(n=n.concat(i))}}),n=n.filter(r=>r!=null&&!p_(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}b0.type="languageDetector";const N_=50,Ld=30,Dd=120,y0=[{key:"en",label:"English"},{key:"es",label:"Español"}],kd="i18nextLng";var sa=(e=>(e[e.FADE_OUT=0]="FADE_OUT",e[e.FADE_IN=1]="FADE_IN",e))(sa||{});const __={Music:"Música",save:"Guardar",cancel:"Cancelar",Text:"Texto",Introduction:"Introducción",heading:{work:"Obra",section:"Sección",splitViewSelectorHorizontal:"Contenido de la vista derecha",splitViewSelectorVertical:"Contenido de la vista inferior"},tab:{introduction:"Introducción",music:"Música",text:"Texto",facsimile:"Facsimil"},editorial:{preferredReading:"lectura preferida",alternativeReading:"lectura alternativa",regReading:"lectura regularizada",origReading:"lectura original",alternativeReadingNumber:"lectura alternativa nº",currentlyShowing:"Actualmente se muestra la {{what}}",availableOptions:"Opciones disponibles",reason:"Razón",resp:"Responsable",optionNumber:"Opción nº{{number}}",formatType:{corr:"Corrección aplicada",unclear:"Elemento poco claro en la fuente",choice:"Opciones disponibles",app:"Lecturas alternativas",lem:"lectura preferida",rdg:"otra lectura",sic:"error evidente",supplied:"parte añadida",reg:"Regularización",clefChange:"Cambio de clave",default:"tipo: {{type}}"}},error:{scoreViewerError:"Algo fue mal en el visor de partituras",tryAgain:"Intentar de nuevo",fetchingScore:{title:"Error al obtener la partitura",details:"Error al cargar la partitura de la red: {{url}}"},fetchIntroError:"Error al obtener el texto de introducción",fetchLyricsItemError:"Error al obtener el texto poético",fetchTextCommentsError:"Comentarios del texto",fetchErrorDescription:"Se produjeron los siguientes errores al obtener elementos de la red",fetchLyricsItemErrorWithSection:"Texto poético para la sección {{section}}",fetchTextSeeErrorAbove:"Error: ver arriba para más detalles"},ok:"Ok",reset:"Reset",playerMode:{autoscroll:"auto scroll",normal:"normal"},anonymous:"Anónimo",scoreControls:{settings:"Configuración"},scoreOptions:{title:"Opciones de visualizacion",reconstruction:"Reconstrucción {{voiceName}}",uiSettings:{title:"Configuración de la interfaz de usuario"},scoreViewerSettings:{title:"Configuración del visor de partituras"},scoreSettings:{title:"Opciones de la partitura seleccionada"},editorialNotes:{title:"Notas editoriales",description:"Muestra una capa con las notas críticas y elección de variantes variantes"},normalizeFicta:{title:"Normalizar musica ficta",description:"Mostrar las alteraciones subintelectas de como las normales prececiendo a la nota"},originalClefs:{title:"Claves originales",description:"Muestra las claves originales del manuscrito sin modernizar"},noTransposition:{title:"Sin transposición",description:"Muestra la partitura deshaciendo la transposición desde claves altas ({{encodedTransposition}})"},harmonicAnalysis:{title:"Análisis armónico",description:"Muestra la clasificación de las disonancias presentes en la partitura"},limitVerses:{title:"Limitar estrofas",description:"Elige la cantidad de estrofas a mostrar en las coplas"},verseAmmount_one:"1 estrofa",verseAmmount_other:"{{count}} estrofas",reconstructionNone:"ninguna",language:{title:"Idioma",description:"Idioma de la interfaz de usuario"},uiLayout:{title:"Diseño de la interfaz de usuario",description:"Define cómo se organizan los componentes en la pantalla"},measureNumberInterval:{title:"Número de compás",description:"Define con qué frecuencia se muestran los números de compás en la partitura"},measureIntervalPage:"Al comienzo de la página",measureInterval10:"Cada 10 compases",measureInterval5:"Cada 5 compases",measureInterval1:"Cada compás",coloredNotes:{title:"Notas ennegrecidas",description:"Señalar las notas ennegrecidas con corchetes superiores"},resetSettings:"Restablecer configuración por defecto"},scoreProcessor:{reconstructionByIA:"Reconstrucción por IA. Modelo {{name}}",reconstructionByHuman:"Reconstrucción por {{name}}"},score:{measureNumber:"Compás {{number}}"},textView:{intro:"Introducción",poeticText:"Texto poético",notes:"Notas al texto"},test:{score1:"Obra 1",score2:"Obra 2",score3:"Obra 3",basic:"en esp test"},configValidation:{configRequired:"La configuración es requerida",settingsRequired:"El objeto de configuración (settings) es requerido",showScoreSelectorBoolean:"showScoreSelector debe ser un booleano",showTitleBoolean:"showTitle debe ser un booleano",showDownloadButtonBoolean:"showDownloadButton debe ser un booleano",showIntroductionSectionBoolean:"showIntroductionSection debe ser un booleano",showTextSectionBoolean:"showTextSection debe ser un booleano",showFacsimileSectionBoolean:"showFacsimileSection debe ser un booleano",renderTitlesFromMEIBoolean:"renderTitlesFromMEI debe ser un booleano",allowUserLanguageChangeBoolean:"allowUserLanguageChange debe ser un booleano",basePathRequired:"basePath es requerido y debe ser una cadena de texto",facsimileImagesPathRequired:"facsimileImagesPath es requerido y debe ser una cadena de texto",backgroundColorString:"backgroundColor debe ser una cadena de texto si se proporciona",languageString:"language debe ser una cadena de texto si se proporciona",scoresArray:"Scores debe ser un array",scoresNotEmpty:"Se requiere al menos una partitura",scoreTitleRequired:"El título de la partitura es requerido y debe ser una cadena de texto",scorePathRequired:"La ruta de la partitura es requerida y debe ser una cadena de texto",scoreMeiFileRequired:"El archivo MEI de la partitura es requerido y debe ser una cadena de texto",scoreEncodingPropertiesRequired:"El objeto encodingProperties es requerido",scoreAudioOverlaysArray:"audioOverlays debe ser un array si se proporciona",scoreTextArray:"text debe ser un array si se proporciona",scoreFacsimileItemsArray:"facsimileItems debe ser un array si se proporciona",configurationError:"Error de Configuración",configurationErrorDescription:"La configuración del ScoreViewer contiene errores:"}},I_={Music:"Música",save:"Guardar",cancel:"Cancelar",Text:"Texto",Introduction:"Introducción",heading:{work:"Work",section:"Section",splitViewSelectorHorizontal:"Right view content",splitViewSelectorVertical:"Bottom view content"},tab:{introduction:"Introduction",music:"Music",text:"Text",facsimile:"Facsimile"},editorial:{preferredReading:"preferred reading",alternativeReading:"alternative reading",regReading:"regularized reading",origReading:"original reading",alternativeReadingNumber:"alternative reading #",currentlyShowing:"Currently showing the {{what}}",availableOptions:"Available options",reason:"Reason",resp:"Responsible person",optionNumber:"Option #{{number}}",formatType:{corr:"Applied correction",unclear:"Unclear element in the source",choice:"Available options",app:"Alternative readings",lem:"preferred reading",rdg:"other reading",sic:"obvious error",supplied:"added part",reg:"Regularization",clefChange:"Clef change",default:"type: {{type}}"}},error:{scoreViewerError:"Something went wrong in the score viewer.",tryAgain:"Try again",fetchingScore:{title:"Error fetching the score",details:"Error loading the score from the network: {{url}}"},fetchIntroError:"Error fetching the introduction text",fetchErrorDescription:"The following errors occurred fetching items from the network",fetchLyricsItemErrorWithSection:"Poetic text for section {{section}}",fetchTextCommentsError:"Text comments",fetchTextSeeErrorAbove:"Error: see above for details"},ok:"Ok",reset:"Reset",playerMode:{autoscroll:"auto scroll",normal:"normal"},anonymous:"Anonymous",scoreControls:{settings:"Settings"},scoreOptions:{title:"Display options",reconstruction:"Reconstruction {{voiceName}}",uiSettings:{title:"UI settings"},scoreViewerSettings:{title:"Score viewer settings"},scoreSettings:{title:"Current score options"},editorialNotes:{title:"Editorial notes",description:"Shows a layer with critical notes and variant selection options"},normalizeFicta:{title:"Normalize musica ficta",description:"Show the subsemitonium alterations as normal ones preceding the note"},originalClefs:{title:"Original clefs",description:"Shows the original manuscript clefs without modernization"},noTransposition:{title:"No transposition",description:"Shows the score undoing the transposition from high clefs ({{encodedTransposition}})"},harmonicAnalysis:{title:"Harmonic analysis",description:"Shows classification dissonances present in the score"},limitVerses:{title:"Limit verses",description:"Choose the number of verses to show in the couplets"},verseAmmount_one:"1 verse",verseAmmount_other:"{{count}} verses",reconstructionNone:"none",language:{title:"Language",description:"Language for the UI"},uiLayout:{title:"UI Layout",description:"Define how components are arranged on the screen"},measureNumberInterval:{title:"Measure number",description:"Define how often measure numbers are shown in the score"},measureIntervalPage:"At the beginning of the page",measureInterval10:"Every 10 measures",measureInterval5:"Every 5 measures",measureInterval1:"Every measure",coloredNotes:{title:"Colored notes",description:"Mark colored notes with brackets on top of them"},resetSettings:"Reset settings to default"},scoreProcessor:{reconstructionByIA:"Reconstruction by AI. Model {{name}}",reconstructionByHuman:"Reconstruction by {{name}}"},score:{measureNumber:"Measure {{number}}"},textView:{intro:"Introduction",poeticText:"Poetical text",notes:"Notes to the text"},test:{score1:"Score 1",score2:"Score 2",score3:"Score 3",basic:"Basic",selectTest:"Select Test:",sections:"Sections"},configValidation:{configRequired:"Configuration is required",settingsRequired:"Settings object is required",showScoreSelectorBoolean:"showScoreSelector must be a boolean",showTitleBoolean:"showTitle must be a boolean",showDownloadButtonBoolean:"showDownloadButton must be a boolean",showIntroductionSectionBoolean:"showIntroductionSection must be a boolean",showTextSectionBoolean:"showTextSection must be a boolean",showFacsimileSectionBoolean:"showFacsimileSection must be a boolean",renderTitlesFromMEIBoolean:"renderTitlesFromMEI must be a boolean",allowUserLanguageChangeBoolean:"allowUserLanguageChange must be a boolean",basePathRequired:"basePath is required and must be a string",facsimileImagesPathRequired:"facsimileImagesPath is required and must be a string",backgroundColorString:"backgroundColor must be a string if provided",languageString:"language must be a string if provided",scoresArray:"Scores must be an array",scoresNotEmpty:"At least one score is required",scoreTitleRequired:"Score title is required and must be a string",scorePathRequired:"Score path is required and must be a string",scoreMeiFileRequired:"Score meiFile is required and must be a string",scoreEncodingPropertiesRequired:"encodingProperties object is required",scoreAudioOverlaysArray:"audioOverlays must be an array if provided",scoreTextArray:"text must be an array if provided",scoreFacsimileItemsArray:"facsimileItems must be an array if provided",configurationError:"Configuration Error",configurationErrorDescription:"The ScoreViewer configuration contains errors:"}},A_={order:["sessionStorage","navigator"],lookupSessionStorage:kd,caches:["sessionStorage"]},P_={en:{common:I_},es:{common:__}};An.use(s_).use(b0).init({supportedLngs:y0.map(e=>e.key),resources:P_,...A_,fallbackLng:"en",debug:!1,defaultNS:"common",interpolation:{escapeValue:!1}});const E0=e=>{let t;const n=new Set,r=(u,c)=>{const d=typeof u=="function"?u(t):u;if(!Object.is(d,t)){const h=t;t=c??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(f=>f(t,h))}},i=()=>t,s={setState:r,getState:i,getInitialState:()=>l,subscribe:u=>(n.add(u),()=>n.delete(u))},l=t=e(r,i,s);return s},M_=e=>e?E0(e):E0,L_=e=>e;function D_(e,t=L_){const n=C.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return C.useDebugValue(n),n}const S0=e=>{const t=M_(e),n=r=>D_(t,r);return Object.assign(n,t),n},_o=e=>e?S0(e):S0;function k_(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const a=l=>l===null?null:JSON.parse(l,void 0),s=(o=n.getItem(i))!=null?o:null;return s instanceof Promise?s.then(a):a(s)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const Rd=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Rd(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Rd(r)(n)}}}},C0=(e,t)=>(n,r,i)=>{let o={storage:k_(()=>localStorage),partialize:g=>g,version:0,merge:(g,v)=>({...v,...g}),...t},a=!1;const s=new Set,l=new Set;let u=o.storage;if(!u)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...g)},r,i);const c=()=>{const g=o.partialize({...r()});return u.setItem(o.name,{state:g,version:o.version})},d=i.setState;i.setState=(g,v)=>{d(g,v),c()};const h=e((...g)=>{n(...g),c()},r,i);i.getInitialState=()=>h;let f;const p=()=>{var g,v;if(!u)return;a=!1,s.forEach(y=>{var E;return y((E=r())!=null?E:h)});const b=((v=o.onRehydrateStorage)==null?void 0:v.call(o,(g=r())!=null?g:h))||void 0;return Rd(u.getItem.bind(u))(o.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==o.version){if(o.migrate){const E=o.migrate(y.state,y.version);return E instanceof Promise?E.then(T=>[!0,T]):[!0,E]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var E;const[T,x]=y;if(f=o.merge(x,(E=r())!=null?E:h),n(f,!0),T)return c()}).then(()=>{b==null||b(f,void 0),f=r(),a=!0,l.forEach(y=>y(f))}).catch(y=>{b==null||b(void 0,y)})};return i.persist={setOptions:g=>{o={...o,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>p(),hasHydrated:()=>a,onHydrate:g=>(s.add(g),()=>{s.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},o.skipHydration||p(),f||h};function Io(e){const t=e;t.use={};const n=Object.keys(e.getState());for(const r of n)t.use[r]=()=>e(i=>i[r]);return t}const ps=e=>({type:"load",config:e}),R_=e=>({type:"loadAutoScroll",config:e}),$d=e=>({type:"render",config:e}),$_=e=>({type:"renderAutoScroll",config:e});class ti extends Error{constructor(n,r){super(r);no(this,"type");this.type=n,Object.setPrototypeOf(this,ti.prototype)}}var At=(e=>(e[e.PLAYING=0]="PLAYING",e[e.PAUSED=1]="PAUSED",e[e.STOPPED=2]="STOPPED",e))(At||{});const F_=_o(e=>({targetWidth:0,targetHeight:0,pendingAction:null,setTargetWidth:t=>e(()=>({targetWidth:t})),setTargetHeight:t=>e(()=>({targetHeight:t})),setPendingAction:t=>e(()=>({pendingAction:t}))})),B_=_o(e=>({score:null,showingMei:null,scoreCache:{},textCache:{},textComments:void 0,textIntroduction:void 0,textLyrics:void 0,setScore:t=>e(()=>({score:t})),setShowingMei:t=>e(()=>({showingMei:t})),setScoreCache:t=>e(n=>({scoreCache:{...n.scoreCache,...t}})),setTextCache:(t,n)=>e(r=>({textCache:n?t:{...r.textCache,...t}})),setTextComments:t=>e(()=>({textComments:t})),setTextIntroduction:t=>e(()=>({textIntroduction:t})),setTextLyrics:(t,n)=>e(r=>({textLyrics:n?t:[...r.textLyrics||[],...t||[]]}))})),z_=_o((e,t)=>({pageCount:0,currentPage:1,sectionPageMap:{},setScoreLayout:({pageCount:n,sectionPageMap:r,currentPage:i})=>{e({pageCount:n,sectionPageMap:r,currentPage:i,navigationCommand:null})},goToPage:n=>e({currentPage:Math.max(1,Math.min(n,t().pageCount))}),goToNextPage:()=>t().goToPage(t().currentPage+1),goToPreviousPage:()=>t().goToPage(t().currentPage-1),goToSection:n=>{const r=t().sectionPageMap[n];r&&e({navigationCommand:{type:"section",target:n},currentPage:r})},navigationCommand:null,clearNavigationCommand:()=>e({navigationCommand:null})})),w0={isSplitView:!1,activeSplitView:"facsimile",splitViewOrientation:"horizontal",activeTab:"music"},H_=_o()(C0(e=>({isLoading:!0,scoreSvg:null,scale:N_,reachedEffectiveMaxScale:!1,...w0,setIsLoading:t=>e(()=>({isLoading:t})),setScoreSvg:t=>e(()=>({scoreSvg:t})),setScale:t=>e(n=>({scale:t<=Dd&&t>=Ld?t:n.scale})),increaseScale:()=>e(t=>({scale:Math.min(t.scale+10,Dd)})),decreaseScale:()=>e(t=>({scale:Math.max(t.scale-10,Ld)})),setReachedEffectiveMaxScale:t=>e(()=>({reachedEffectiveMaxScale:t})),setIsSplitView:t=>e(()=>({isSplitView:t})),setActiveSplitView:t=>e(()=>({activeSplitView:t})),setSplitViewOrientation:t=>e(()=>({splitViewOrientation:t})),setActiveTab:t=>e(()=>({activeTab:t})),reset:()=>e(w0)}),{name:"ui-layout-store",partialize:e=>({isSplitView:e.isSplitView,activeSplitView:e.activeSplitView,splitViewOrientation:e.splitViewOrientation,activeTab:e.activeTab})})),j_=_o(e=>({playingState:At.STOPPED,playingPosition:0,seekPosition:-1,autoScroll:!1,setPlayingState:t=>e(()=>({playingState:t})),setPlayingPosition:t=>e(()=>({playingPosition:t})),setSeekPosition:t=>e(()=>({seekPosition:t})),setAutoScroll:t=>e(()=>({autoScroll:t})),resetPlayerPosition:()=>e(()=>({playingPosition:0,seekPosition:0}))})),x0={showNVerses:8,showEditorial:!1,showOriginalClefs:!1,normalizeFicta:!1,showingEditorial:null,appOptions:[],choiceOptions:[],withoutTransposition:!1,showMusicAnalysis:!1,measureNumberInterval:0,showColoredNotes:!1},V_=_o()(C0(e=>({...x0,setShowNVerses:t=>e(()=>({showNVerses:t})),setShowEditorial:t=>e(()=>({showEditorial:t})),setShowOriginalClefs:t=>e(()=>({showOriginalClefs:t})),setNormalizeFicta:t=>e(()=>({normalizeFicta:t})),setShowingEditorial:t=>e(()=>({showingEditorial:t})),setAppOptions:(t,n)=>e(r=>({appOptions:n?t:[...r.appOptions,...t]})),setChoiceOptions:(t,n)=>e(r=>({choiceOptions:n?t:[...r.choiceOptions,...t]})),setWithoutTransposition:t=>e(()=>({withoutTransposition:t})),setShowMusicAnalysis:t=>e(()=>({showMusicAnalysis:t})),setMeasureNumberInterval:t=>e(()=>({measureNumberInterval:t})),setShowColoredNotes:t=>e(()=>({showColoredNotes:t})),resetScoreSettings:()=>e({...x0})}),{name:"score-settings-store"})),U_=_o((e,t)=>({renderedSvgData:null,pageCache:new Map,setRenderedSvgData:n=>e(()=>({renderedSvgData:n})),setCachedPage:(n,r)=>{const i=new Map(t().pageCache);if(i.size>=3&&!i.has(n)){const a=i.keys().next().value;a!==void 0&&i.delete(a)}i.set(n,r),e({pageCache:i})},getCachedPage:n=>t().pageCache.get(n)||null,clearPageCache:()=>e({pageCache:new Map})}));class W_{constructor(){no(this,"use",{targetWidth:la.use.targetWidth,setTargetWidth:la.use.setTargetWidth,targetHeight:la.use.targetHeight,setTargetHeight:la.use.setTargetHeight,pendingAction:la.use.pendingAction,setPendingAction:la.use.setPendingAction,score:hr.use.score,showingMei:hr.use.showingMei,scoreCache:hr.use.scoreCache,textCache:hr.use.textCache,textComments:hr.use.textComments,textIntroduction:hr.use.textIntroduction,textLyrics:hr.use.textLyrics,setScore:hr.use.setScore,setShowingMei:hr.use.setShowingMei,setScoreCache:hr.use.setScoreCache,setTextCache:hr.use.setTextCache,setTextComments:hr.use.setTextComments,setTextIntroduction:hr.use.setTextIntroduction,setTextLyrics:hr.use.setTextLyrics,isLoading:Wn.use.isLoading,scoreSvg:Wn.use.scoreSvg,scale:Wn.use.scale,reachedEffectiveMaxScale:Wn.use.reachedEffectiveMaxScale,isSplitView:Wn.use.isSplitView,activeSplitView:Wn.use.activeSplitView,splitViewOrientation:Wn.use.splitViewOrientation,activeTab:Wn.use.activeTab,setIsLoading:Wn.use.setIsLoading,setScoreSvg:Wn.use.setScoreSvg,setScale:Wn.use.setScale,increaseScale:Wn.use.increaseScale,decreaseScale:Wn.use.decreaseScale,setReachedEffectiveMaxScale:Wn.use.setReachedEffectiveMaxScale,setIsSplitView:Wn.use.setIsSplitView,setSplitViewOrientation:Wn.use.setSplitViewOrientation,setActiveTab:Wn.use.setActiveTab,setActiveSplitView:Wn.use.setActiveSplitView,resetUILayout:Wn.use.reset,pageCount:mi.use.pageCount,currentPage:mi.use.currentPage,sectionPageMap:mi.use.sectionPageMap,setScoreLayout:mi.use.setScoreLayout,goToPage:mi.use.goToPage,goToNextPage:mi.use.goToNextPage,goToPreviousPage:mi.use.goToPreviousPage,goToSection:mi.use.goToSection,navigationCommand:mi.use.navigationCommand,clearNavigationCommand:mi.use.clearNavigationCommand,playingState:$i.use.playingState,playingPosition:$i.use.playingPosition,seekPosition:$i.use.seekPosition,autoScroll:$i.use.autoScroll,setPlayingState:$i.use.setPlayingState,setPlayingPosition:$i.use.setPlayingPosition,setSeekPosition:$i.use.setSeekPosition,setAutoScroll:$i.use.setAutoScroll,resetPlayerPosition:$i.use.resetPlayerPosition,showNVerses:_n.use.showNVerses,showEditorial:_n.use.showEditorial,showOriginalClefs:_n.use.showOriginalClefs,normalizeFicta:_n.use.normalizeFicta,showingEditorial:_n.use.showingEditorial,appOptions:_n.use.appOptions,choiceOptions:_n.use.choiceOptions,withoutTransposition:_n.use.withoutTransposition,showMusicAnalysis:_n.use.showMusicAnalysis,measureNumberInterval:_n.use.measureNumberInterval,showColoredNotes:_n.use.showColoredNotes,setShowNVerses:_n.use.setShowNVerses,setShowEditorial:_n.use.setShowEditorial,setShowOriginalClefs:_n.use.setShowOriginalClefs,setNormalizeFicta:_n.use.setNormalizeFicta,setShowingEditorial:_n.use.setShowingEditorial,setAppOptions:_n.use.setAppOptions,setChoiceOptions:_n.use.setChoiceOptions,setWithoutTransposition:_n.use.setWithoutTransposition,setShowMusicAnalysis:_n.use.setShowMusicAnalysis,setMeasureNumberInterval:_n.use.setMeasureNumberInterval,setShowColoredNotes:_n.use.setShowColoredNotes,resetScoreSettings:_n.use.resetScoreSettings,renderedSvgData:ua.use.renderedSvgData,setRenderedSvgData:ua.use.setRenderedSvgData,pageCache:ua.use.pageCache,setCachedPage:ua.use.setCachedPage,getCachedPage:ua.use.getCachedPage,clearPageCache:ua.use.clearPageCache})}}const la=Io(F_),hr=Io(B_),mi=Io(z_),Wn=Io(H_),$i=Io(j_),_n=Io(V_),ua=Io(U_),ge=new W_;function Y_(e){return new Worker(""+(typeof document>"u"&&typeof ug>"u"?require("url").pathToFileURL(__dirname+"/assets/verovio.worker-c9SE8jl3.js").href:new URL("assets/verovio.worker-c9SE8jl3.js",typeof document>"u"?ug.href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),{name:e==null?void 0:e.name})}let pi=null,Xl=!1,T0=null;const Fd=new Map;let Bd=null,q_=0;function X_(){return pi||(console.log("[useVerovio] Creating Verovio worker..."),pi=new Y_,Bd=new Promise((e,t)=>{const n=setTimeout(()=>{t(new Error("Worker initialization timeout"))},3e4);pi.onmessage=r=>{const i=r.data;if(i.type==="init"){clearTimeout(n);const o=i;o.status==="ready"?(Xl=!0,T0=o.version||null,console.log("[useVerovio] Worker ready, Verovio version:",T0),e()):(console.error("[useVerovio] Worker initialization failed:",o.error),t(new Error(o.error||"Worker initialization failed"))),pi.onmessage=K_;return}},pi.onerror=r=>{clearTimeout(n),console.error("[useVerovio] Worker error during init:",r),t(r)}}),pi)}function K_(e){const t=e.data,n=Fd.get(t.id);n&&(Fd.delete(t.id),t.error?n.reject(new Error(t.error)):n.resolve(t.result))}async function Fi(e,...t){if(!pi)throw new Error("Worker not initialized");if(!Xl&&Bd&&await Bd,!Xl)throw new Error("Worker not ready");return new Promise((n,r)=>{if(!pi){r(new Error("Worker not initialized"));return}const i=`req_${++q_}`;Fd.set(i,{resolve:n,reject:r});const o={id:i,method:e,args:t};pi.postMessage(o)})}function G_(){return{get isReady(){return Xl},setOptions:e=>Fi("setOptions",e),loadData:e=>Fi("loadData",e),getPageCount:()=>Fi("getPageCount"),renderToSVG:e=>Fi("renderToSVG",e),renderToTimemap:e=>Fi("renderToTimemap",e),getMEI:e=>Fi("getMEI",e),getPageWithElement:e=>Fi("getPageWithElement",e),getElementsAtTime:e=>Fi("getElementsAtTime",e),getVersion:()=>Fi("getVersion")}}function O0(){const[e,t]=C.useState(null),n=C.useRef(null);return C.useEffect(()=>(n.current||(n.current=X_(),t(G_())),()=>{}),[]),e}const Kl=C.createContext({verovio:void 0});var N0={exports:{}};/*!
1
+ (function(Mn,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("react"),require("react/jsx-runtime"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react/jsx-runtime","react-dom"],C):(Mn=typeof globalThis<"u"?globalThis:Mn||self,C(Mn.ScoreViewer={},Mn.React,Mn.jsxRuntime,Mn.ReactDOM))})(this,function(Mn,C,Y,zr){"use strict";var KJ=Object.defineProperty;var GJ=(Mn,C,Y)=>C in Mn?KJ(Mn,C,{enumerable:!0,configurable:!0,writable:!0,value:Y}):Mn[C]=Y;var no=(Mn,C,Y)=>GJ(Mn,typeof C!="symbol"?C+"":C,Y);function Vg(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const m=Vg(C),Ug=Vg(zr),Ot=e=>typeof e=="string",ds=()=>{let e,t;const n=new Promise((r,i)=>{e=r,t=i});return n.resolve=e,n.reject=t,n},Wg=e=>e==null?"":""+e,MN=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},LN=/###/g,Yg=e=>e&&e.indexOf("###")>-1?e.replace(LN,"."):e,qg=e=>!e||Ot(e),fs=(e,t,n)=>{const r=Ot(t)?t.split("."):t;let i=0;for(;i<r.length-1;){if(qg(e))return{};const o=Yg(r[i]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++i}return qg(e)?{}:{obj:e,k:Yg(r[i])}},Xg=(e,t,n)=>{const{obj:r,k:i}=fs(e,t,Object);if(r!==void 0||t.length===1){r[i]=n;return}let o=t[t.length-1],a=t.slice(0,t.length-1),s=fs(e,a,Object);for(;s.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),s=fs(e,a,Object),s!=null&&s.obj&&typeof s.obj[`${s.k}.${o}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${o}`]=n},DN=(e,t,n,r)=>{const{obj:i,k:o}=fs(e,t,Object);i[o]=i[o]||[],i[o].push(n)},jl=(e,t)=>{const{obj:n,k:r}=fs(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},kN=(e,t,n)=>{const r=jl(e,n);return r!==void 0?r:jl(t,n)},Kg=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?Ot(e[r])||e[r]instanceof String||Ot(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):Kg(e[r],t[r],n):e[r]=t[r]);return e},ia=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var RN={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const $N=e=>Ot(e)?e.replace(/[&<>"'\/]/g,t=>RN[t]):e;class FN{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const BN=[" ",",","?","!",";"],zN=new FN(20),HN=(e,t,n)=>{t=t||"",n=n||"";const r=BN.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const i=zN.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!i.test(e);if(!o){const a=e.indexOf(n);a>0&&!i.test(e.substring(0,a))&&(o=!0)}return o},_d=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let i=e;for(let o=0;o<r.length;){if(!i||typeof i!="object")return;let a,s="";for(let l=o;l<r.length;++l)if(l!==o&&(s+=n),s+=r[l],a=i[s],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&l<r.length-1)continue;o+=l-o+1;break}i=a}return i},hs=e=>e==null?void 0:e.replace("_","-"),jN={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class Vl{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||jN,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,i){return i&&!this.debug?null:(Ot(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Vl(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Vl(this.logger,t)}}var hi=new Vl;class Ul{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([i,o])=>{for(let a=0;a<o;a++)i(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,o])=>{for(let a=0;a<o;a++)i.apply(i,[t,...n])})}}class Gg extends Ul{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,i={}){var u,c;const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;t.indexOf(".")>-1?s=t.split("."):(s=[t,n],r&&(Array.isArray(r)?s.push(...r):Ot(r)&&o?s.push(...r.split(o)):s.push(r)));const l=jl(this.data,s);return!l&&!n&&!r&&t.indexOf(".")>-1&&(t=s[0],n=s[1],r=s.slice(2).join(".")),l||!a||!Ot(r)?l:_d((c=(u=this.data)==null?void 0:u[t])==null?void 0:c[n],r,o)}addResource(t,n,r,i,o={silent:!1}){const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let s=[t,n];r&&(s=s.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(s=t.split("."),i=n,n=s[1]),this.addNamespaces(n),Xg(this.data,s,i),o.silent||this.emit("added",t,n,r,i)}addResources(t,n,r,i={silent:!1}){for(const o in r)(Ot(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});i.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,i,o,a={silent:!1,skipCopy:!1}){let s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),i=r,r=n,n=s[1]),this.addNamespaces(n);let l=jl(this.data,s)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?Kg(l,r,o):l={...l,...r},Xg(this.data,s,l),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var Qg={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,i){return e.forEach(o=>{var a;t=((a=this.processors[o])==null?void 0:a.process(t,n,r,i))??t}),t}};const Zg={},Jg=e=>!Ot(e)&&typeof e!="boolean"&&typeof e!="number";class Wl extends Ul{constructor(t,n={}){super(),MN(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=hi.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const i=this.resolve(t,r);return(i==null?void 0:i.res)!==void 0}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!HN(t,r,i);if(a&&!s){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:Ot(o)?[o]:o};const u=t.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(o=u.shift()),t=u.join(i)}return{key:t,namespaces:Ot(o)?[o]:o}}translate(t,n,r){let i=typeof n=="object"?{...n}:n;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(i={...i}),i||(i={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const o=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:s,namespaces:l}=this.extractFromKey(t[t.length-1],i),u=l[l.length-1];let c=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;c===void 0&&(c=":");const d=i.lng||this.language,h=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((d==null?void 0:d.toLowerCase())==="cimode")return h?o?{res:`${u}${c}${s}`,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:`${u}${c}${s}`:o?{res:s,usedKey:s,exactUsedKey:s,usedLng:d,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:s;const f=this.resolve(t,i);let p=f==null?void 0:f.res;const g=(f==null?void 0:f.usedKey)||s,v=(f==null?void 0:f.exactUsedKey)||s,b=["[object Number]","[object Function]","[object RegExp]"],y=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,E=!this.i18nFormat||this.i18nFormat.handleAsObject,T=i.count!==void 0&&!Ot(i.count),x=Wl.hasDefaultValue(i),S=T?this.pluralResolver.getSuffix(d,i.count,i):"",O=i.ordinal&&T?this.pluralResolver.getSuffix(d,i.count,{ordinal:!1}):"",I=T&&!i.ordinal&&i.count===0,_=I&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${S}`]||i[`defaultValue${O}`]||i.defaultValue;let N=p;E&&!p&&x&&(N=_);const P=Jg(N),A=Object.prototype.toString.apply(N);if(E&&N&&P&&b.indexOf(A)<0&&!(Ot(y)&&Array.isArray(N))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const M=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,N,{...i,ns:l}):`key '${s} (${this.language})' returned an object instead of string.`;return o?(f.res=M,f.usedParams=this.getUsedParamsDetails(i),f):M}if(a){const M=Array.isArray(N),D=M?[]:{},R=M?v:g;for(const $ in N)if(Object.prototype.hasOwnProperty.call(N,$)){const F=`${R}${a}${$}`;x&&!p?D[$]=this.translate(F,{...i,defaultValue:Jg(_)?_[$]:void 0,joinArrays:!1,ns:l}):D[$]=this.translate(F,{...i,joinArrays:!1,ns:l}),D[$]===F&&(D[$]=N[$])}p=D}}else if(E&&Ot(y)&&Array.isArray(p))p=p.join(y),p&&(p=this.extendTranslation(p,t,i,r));else{let M=!1,D=!1;!this.isValidLookup(p)&&x&&(M=!0,p=_),this.isValidLookup(p)||(D=!0,p=s);const $=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&D?void 0:p,F=x&&_!==p&&this.options.updateMissing;if(D||M||F){if(this.logger.log(F?"updateKey":"missingKey",d,u,s,F?_:p),a){const U=this.resolve(s,{...i,keySeparator:!1});U&&U.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 B=[];const z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&z&&z[0])for(let U=0;U<z.length;U++)B.push(z[U]);else this.options.saveMissingTo==="all"?B=this.languageUtils.toResolveHierarchy(i.lng||this.language):B.push(i.lng||this.language);const k=(U,q,L)=>{var W;const X=x&&L!==p?L:$;this.options.missingKeyHandler?this.options.missingKeyHandler(U,u,q,X,F,i):(W=this.backendConnector)!=null&&W.saveMissing&&this.backendConnector.saveMissing(U,u,q,X,F,i),this.emit("missingKey",U,u,q,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&T?B.forEach(U=>{const q=this.pluralResolver.getSuffixes(U,i);I&&i[`defaultValue${this.options.pluralSeparator}zero`]&&q.indexOf(`${this.options.pluralSeparator}zero`)<0&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(L=>{k([U],s+L,i[`defaultValue${L}`]||_)})}):k(B,s,_))}p=this.extendTranslation(p,t,i,f,r),D&&p===s&&this.options.appendNamespaceToMissingKey&&(p=`${u}${c}${s}`),(D||M)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${c}${s}`:s,M?p:void 0,i))}return o?(f.res=p,f.usedParams=this.getUsedParamsDetails(i),f):p}extendTranslation(t,n,r,i,o){var l,u;if((l=this.i18nFormat)!=null&&l.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const c=Ot(t)&&(((u=r==null?void 0:r.interpolation)==null?void 0:u.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let d;if(c){const f=t.match(this.interpolator.nestingRegexp);d=f&&f.length}let h=r.replace&&!Ot(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,r.lng||this.language||i.usedLng,r),c){const f=t.match(this.interpolator.nestingRegexp),p=f&&f.length;d<p&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...f)=>(o==null?void 0:o[0])===f[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${n[0]}`),null):this.translate(...f,n),r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,s=Ot(a)?[a]:a;return t!=null&&(s!=null&&s.length)&&r.applyPostProcessor!==!1&&(t=Qg.handle(s,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,i,o,a,s;return Ot(t)&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(l,n),c=u.key;i=c;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const h=n.count!==void 0&&!Ot(n.count),f=h&&!n.ordinal&&n.count===0,p=n.context!==void 0&&(Ot(n.context)||typeof n.context=="number")&&n.context!=="",g=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(v=>{var b,y;this.isValidLookup(r)||(s=v,!Zg[`${g[0]}-${v}`]&&((b=this.utils)!=null&&b.hasLoadedNamespace)&&!((y=this.utils)!=null&&y.hasLoadedNamespace(s))&&(Zg[`${g[0]}-${v}`]=!0,this.logger.warn(`key "${i}" for languages "${g.join(", ")}" won't get resolved as namespace "${s}" 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!!!")),g.forEach(E=>{var S;if(this.isValidLookup(r))return;a=E;const T=[c];if((S=this.i18nFormat)!=null&&S.addLookupKeys)this.i18nFormat.addLookupKeys(T,c,E,v,n);else{let O;h&&(O=this.pluralResolver.getSuffix(E,n.count,n));const I=`${this.options.pluralSeparator}zero`,_=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(T.push(c+O),n.ordinal&&O.indexOf(_)===0&&T.push(c+O.replace(_,this.options.pluralSeparator)),f&&T.push(c+I)),p){const N=`${c}${this.options.contextSeparator}${n.context}`;T.push(N),h&&(T.push(N+O),n.ordinal&&O.indexOf(_)===0&&T.push(N+O.replace(_,this.options.pluralSeparator)),f&&T.push(N+I))}}let x;for(;x=T.pop();)this.isValidLookup(r)||(o=x,r=this.getResource(E,v,x,n))}))})}),{res:r,usedKey:i,exactUsedKey:o,usedLng:a,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,i={}){var o;return(o=this.i18nFormat)!=null&&o.getResource?this.i18nFormat.getResource(t,n,r,i):this.resourceStore.getResource(t,n,r,i)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!Ot(t.replace);let i=r?t.replace:t;if(r&&typeof t.count<"u"&&(i.count=t.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class e0{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=hi.create("languageUtils")}getScriptPartFromCode(t){if(t=hs(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=hs(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Ot(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const i=this.getScriptPartFromCode(r);if(this.isSupportedCode(i))return n=i;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(a=>{if(a===o)return a;if(!(a.indexOf("-")<0&&o.indexOf("-")<0)&&(a.indexOf("-")>0&&o.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===o||a.indexOf(o)===0&&o.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Ot(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),i=[],o=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return Ot(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):Ot(t)&&o(this.formatLanguageCode(t)),r.forEach(a=>{i.indexOf(a)<0&&o(this.formatLanguageCode(a))}),i}}const t0={zero:0,one:1,two:2,few:3,many:4,other:5},n0={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class VN{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=hi.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=hs(t==="dev"?"en":t),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let a;try{a=new Intl.PluralRules(r,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),n0;if(!t.match(/-|_/))return n0;const l=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(l,n)}return this.pluralRulesCache[o]=a,a}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(i=>`${n}${i}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,o)=>t0[i]-t0[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(t,n,r={}){const i=this.getRule(t,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const r0=(e,t,n,r=".",i=!0)=>{let o=kN(e,t,n);return!o&&i&&Ot(n)&&(o=_d(e,n,r),o===void 0&&(o=_d(t,n,r))),o},Id=e=>e.replace(/\$/g,"$$$$");class UN{constructor(t={}){var n;this.logger=hi.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:o,prefixEscaped:a,suffix:s,suffixEscaped:l,formatSeparator:u,unescapeSuffix:c,unescapePrefix:d,nestingPrefix:h,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:g,nestingOptionsSeparator:v,maxReplaces:b,alwaysFormat:y}=t.interpolation;this.escape=n!==void 0?n:$N,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?ia(o):a||"{{",this.suffix=s?ia(s):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=c?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=h?ia(h):f||ia("$t("),this.nestingSuffix=p?ia(p):g||ia(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=b||1e3,this.alwaysFormat=y!==void 0?y:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(t,n,r,i){var f;let o,a,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=p=>{if(p.indexOf(this.formatSeparator)<0){const y=r0(n,l,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(y,void 0,r,{...i,...n,interpolationkey:p}):y}const g=p.split(this.formatSeparator),v=g.shift().trim(),b=g.join(this.formatSeparator).trim();return this.format(r0(n,l,v,this.options.keySeparator,this.options.ignoreJSONStructure),b,r,{...i,...n,interpolationkey:v})};this.resetRegExp();const c=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,d=((f=i==null?void 0:i.interpolation)==null?void 0:f.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>Id(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?Id(this.escape(p)):Id(p)}].forEach(p=>{for(s=0;o=p.regex.exec(t);){const g=o[1].trim();if(a=u(g),a===void 0)if(typeof c=="function"){const b=c(t,o,i);a=Ot(b)?b:""}else if(i&&Object.prototype.hasOwnProperty.call(i,g))a="";else if(d){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${t}`),a="";else!Ot(a)&&!this.useRawValueToEscape&&(a=Wg(a));const v=p.safeValue(a);if(t=t.replace(o[0],v),d?(p.regex.lastIndex+=a.length,p.regex.lastIndex-=o[0].length):p.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,n,r={}){let i,o,a;const s=(l,u)=>{const c=this.nestingOptionsSeparator;if(l.indexOf(c)<0)return l;const d=l.split(new RegExp(`${c}[ ]*{`));let h=`{${d[1]}`;l=d[0],h=this.interpolate(h,a);const f=h.match(/'/g),p=h.match(/"/g);(((f==null?void 0:f.length)??0)%2===0&&!p||p.length%2!==0)&&(h=h.replace(/'/g,'"'));try{a=JSON.parse(h),u&&(a={...u,...a})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,g),`${l}${c}${h}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,l};for(;i=this.nestingRegexp.exec(t);){let l=[];a={...r},a=a.replace&&!Ot(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const u=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(u!==-1&&(l=i[1].slice(u).split(this.formatSeparator).map(c=>c.trim()).filter(Boolean),i[1]=i[1].slice(0,u)),o=n(s.call(this,i[1].trim(),a),a),o&&i[0]===t&&!Ot(o))return o;Ot(o)||(o=Wg(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${t}`),o=""),l.length&&(o=l.reduce((c,d)=>this.format(c,d,r.lng,{...r,interpolationkey:i[1].trim()}),o.trim())),t=t.replace(i[0],o),this.regexp.lastIndex=0}return t}}const WN=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);t==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):t==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(a=>{if(a){const[s,...l]=a.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),c=s.trim();n[c]||(n[c]=u),u==="false"&&(n[c]=!1),u==="true"&&(n[c]=!0),isNaN(u)||(n[c]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},i0=e=>{const t={};return(n,r,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const a=r+JSON.stringify(o);let s=t[a];return s||(s=e(hs(r),i),t[a]=s),s(n)}},YN=e=>(t,n,r)=>e(hs(n),r)(t);class qN{constructor(t={}){this.logger=hi.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?i0:YN;this.formats={number:r((i,o)=>{const a=new Intl.NumberFormat(i,{...o});return s=>a.format(s)}),currency:r((i,o)=>{const a=new Intl.NumberFormat(i,{...o,style:"currency"});return s=>a.format(s)}),datetime:r((i,o)=>{const a=new Intl.DateTimeFormat(i,{...o});return s=>a.format(s)}),relativetime:r((i,o)=>{const a=new Intl.RelativeTimeFormat(i,{...o});return s=>a.format(s,o.range||"day")}),list:r((i,o)=>{const a=new Intl.ListFormat(i,{...o});return s=>a.format(s)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=i0(n)}format(t,n,r,i={}){const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(s=>s.indexOf(")")>-1)){const s=o.findIndex(l=>l.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,s)].join(this.formatSeparator)}return o.reduce((s,l)=>{var d;const{formatName:u,formatOptions:c}=WN(l);if(this.formats[u]){let h=s;try{const f=((d=i==null?void 0:i.formatParams)==null?void 0:d[i.interpolationkey])||{},p=f.locale||f.lng||i.locale||i.lng||r;h=this.formats[u](s,p,{...c,...i,...f})}catch(f){this.logger.warn(f)}return h}else this.logger.warn(`there was no format function for ${u}`);return s},t)}}const XN=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class KN extends Ul{constructor(t,n,r,i={}){var o,a;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=hi.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(a=(o=this.backend)==null?void 0:o.init)==null||a.call(o,r,i.backend,i)}queueLoad(t,n,r,i){const o={},a={},s={},l={};return t.forEach(u=>{let c=!0;n.forEach(d=>{const h=`${u}|${d}`;!r.reload&&this.store.hasResourceBundle(u,d)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?a[h]===void 0&&(a[h]=!0):(this.state[h]=1,c=!1,a[h]===void 0&&(a[h]=!0),o[h]===void 0&&(o[h]=!0),l[d]===void 0&&(l[d]=!0)))}),c||(s[u]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(t,n,r){const i=t.split("|"),o=i[0],a=i[1];n&&this.emit("failedLoading",o,a,n),!n&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const s={};this.queue.forEach(l=>{DN(l.loaded,[o],a),XN(l,t),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{s[u]||(s[u]={});const c=l.loaded[u];c.length&&c.forEach(d=>{s[u][d]===void 0&&(s[u][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(t,n,r,i=0,o=this.retryTimeout,a){if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:i,wait:o,callback:a});return}this.readingCalls++;const s=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(u&&c&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,i+1,o*2,a)},o);return}a(u,c)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const u=l(t,n);u&&typeof u.then=="function"?u.then(c=>s(null,c)).catch(s):s(null,u)}catch(u){s(u)}return}return l(t,n,s)}prepareLoading(t,n,r={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();Ot(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Ot(n)&&(n=[n]);const o=this.queueLoad(t,n,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(a,s)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,a),!a&&s&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,s),this.loaded(t,a,s)})}saveMissing(t,n,r,i,o,a={},s=()=>{}){var l,u,c,d,h;if((u=(l=this.services)==null?void 0:l.utils)!=null&&u.hasLoadedNamespace&&!((d=(c=this.services)==null?void 0:c.utils)!=null&&d.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" 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(!(r==null||r==="")){if((h=this.backend)!=null&&h.create){const f={...a,isUpdate:o},p=this.backend.create.bind(this.backend);if(p.length<6)try{let g;p.length===5?g=p(t,n,r,i,f):g=p(t,n,r,i),g&&typeof g.then=="function"?g.then(v=>s(null,v)).catch(s):s(null,g)}catch(g){s(g)}else p(t,n,r,i,s,f)}!t||!t[0]||this.store.addResource(t[0],n,r,i)}}}const o0=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Ot(e[1])&&(t.defaultValue=e[1]),Ot(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),a0=e=>{var t,n;return Ot(e.ns)&&(e.ns=[e.ns]),Ot(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ot(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((n=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:n.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},Yl=()=>{},GN=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class ms extends Ul{constructor(t={},n){if(super(),this.options=a0(t),this.services={},this.logger=hi,this.modules={external:[]},GN(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(Ot(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=o0();this.options={...r,...this.options,...a0(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const i=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?hi.init(i(this.modules.logger),this.options):hi.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=qN;const c=new e0(this.options);this.store=new Gg(this.options.resources,this.options);const d=this.services;d.logger=hi,d.resourceStore=this.store,d.languageUtils=c,d.pluralResolver=new VN(c,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.warn("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),u&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(d.formatter=i(u),d.formatter.init&&d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new UN(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new KN(i(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",(f,...p)=>{this.emit(f,...p)}),this.modules.languageDetector&&(d.languageDetector=i(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=i(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new Wl(this.services,this.options),this.translator.on("*",(f,...p)=>{this.emit(f,...p)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Yl),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]=(...c)=>this.store[u](...c)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...c)=>(this.store[u](...c),this)});const s=ds(),l=()=>{const u=(c,d)=>{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),s.resolve(d),n(c,d)};if(this.languages&&!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),s}loadResources(t,n=Yl){var o,a;let r=n;const i=Ot(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const s=[],l=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(d=>{d!=="cimode"&&s.indexOf(d)<0&&s.push(d)})};i?l(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>l(c)),(a=(o=this.options.preload)==null?void 0:o.forEach)==null||a.call(o,u=>l(u)),this.services.backendConnector.load(s,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(t,n,r){const i=ds();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Yl),this.services.backendConnector.reload(t,n,o=>{i.resolve(),r(o)}),i}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Qg.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=ds();this.emit("languageChanging",t);const i=s=>{this.language=s,this.languages=this.services.languageUtils.toResolveHierarchy(s),this.resolvedLanguage=void 0,this.setResolvedLanguage(s)},o=(s,l)=>{l?this.isLanguageChangingTo===t&&(i(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,r.resolve((...u)=>this.t(...u)),n&&n(s,(...u)=>this.t(...u))},a=s=>{var c,d;!t&&!s&&this.services.languageDetector&&(s=[]);const l=Ot(s)?s:s&&s[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(Ot(s)?[s]:s);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),(d=(c=this.services.languageDetector)==null?void 0:c.cacheUserLanguage)==null||d.call(c,u)),this.loadResources(u,h=>{o(h,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&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(t),r}getFixedT(t,n,r){const i=(o,a,...s)=>{let l;typeof a!="object"?l=this.options.overloadTranslationOptionHandler([o,a].concat(s)):l={...a},l.lng=l.lng||i.lng,l.lngs=l.lngs||i.lngs,l.ns=l.ns||i.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||i.keyPrefix);const u=this.options.keySeparator||".";let c;return l.keyPrefix&&Array.isArray(o)?c=o.map(d=>`${l.keyPrefix}${u}${d}`):c=l.keyPrefix?`${l.keyPrefix}${u}${o}`:o,this.t(c,l)};return Ot(t)?i.lng=t:i.lngs=t,i.ns=n,i.keyPrefix=r,i}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){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 r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(s,l)=>{const u=this.services.backendConnector.state[`${s}|${l}`];return u===-1||u===0||u===2};if(n.precheck){const s=n.precheck(this,a);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!i||a(o,t)))}loadNamespaces(t,n){const r=ds();return this.options.ns?(Ot(t)&&(t=[t]),t.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=ds();Ot(t)&&(t=[t]);const i=this.options.preload||[],o=t.filter(a=>i.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=i.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){var i,o;if(t||(t=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const a=new Intl.Locale(t);if(a&&a.getTextInfo){const s=a.getTextInfo();if(s&&s.direction)return s.direction}}catch{}const n=["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"],r=((o=this.services)==null?void 0:o.languageUtils)||new e0(o0());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){return new ms(t,n)}cloneInstance(t={},n=Yl){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const i={...this.options,...t,isClone:!0},o=new ms(i);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(s=>{o[s]=this[s]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const s=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((c,d)=>(c[d]={...l[u][d]},c),l[u]),l),{});o.store=new Gg(s,i),o.services.resourceStore=o.store}return o.translator=new Wl(o.services,i),o.translator.on("*",(s,...l)=>{o.emit(s,...l)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const An=ms.createInstance();An.createInstance=ms.createInstance,An.createInstance,An.dir,An.init,An.loadResources,An.reloadResources,An.use,An.changeLanguage,An.getFixedT,An.t,An.exists,An.setDefaultNamespace,An.hasLoadedNamespace,An.loadNamespaces,An.loadLanguages;var Nn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ql(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}const QN=(e,t,n,r)=>{var o,a,s,l;const i=[n,{code:t,...r||{}}];if((a=(o=e==null?void 0:e.services)==null?void 0:o.logger)!=null&&a.forward)return e.services.logger.forward(i,"warn","react-i18next::",!0);No(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(l=(s=e==null?void 0:e.services)==null?void 0:s.logger)!=null&&l.warn?e.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},s0={},Ad=(e,t,n,r)=>{No(n)&&s0[n]||(No(n)&&(s0[n]=new Date),QN(e,t,n,r))},l0=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},Pd=(e,t,n)=>{e.loadNamespaces(t,l0(e,n))},u0=(e,t,n,r)=>{if(No(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Pd(e,n,r);n.forEach(i=>{e.options.ns.indexOf(i)<0&&e.options.ns.push(i)}),e.loadLanguages(t,l0(e,r))},ZN=(e,t,n={})=>!t.languages||!t.languages.length?(Ad(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!i(r.isLanguageChangingTo,e))return!1}}),No=e=>typeof e=="string",JN=e=>typeof e=="object"&&e!==null,e_=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,t_={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},n_=e=>t_[e];let Md={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(e_,n_)};const r_=(e={})=>{Md={...Md,...e}},i_=()=>Md;let c0;const o_=e=>{c0=e},a_=()=>c0,s_={type:"3rdParty",init(e){r_(e.options.react),o_(e)}},l_=C.createContext();class u_{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const c_=(e,t)=>{const n=C.useRef();return C.useEffect(()=>{n.current=e},[e,t]),n.current},d0=(e,t,n,r)=>e.getFixedT(t,n,r),d_=(e,t,n,r)=>C.useCallback(d0(e,t,n,r),[e,t,n,r]),cr=(e,t={})=>{var T,x,S;const{i18n:n}=t,{i18n:r,defaultNS:i}=C.useContext(l_)||{},o=n||r||a_();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new u_),!o){Ad(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const O=(_,N)=>No(N)?N:JN(N)&&No(N.defaultValue)?N.defaultValue:Array.isArray(_)?_[_.length-1]:_,I=[O,{},!1];return I.t=O,I.i18n={},I.ready=!1,I}(T=o.options.react)!=null&&T.wait&&Ad(o,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const a={...i_(),...o.options.react,...t},{useSuspense:s,keyPrefix:l}=a;let u=e;u=No(u)?[u]:u||["translation"],(S=(x=o.reportNamespaces).addUsedNamespaces)==null||S.call(x,u);const c=(o.isInitialized||o.initializedStoreOnce)&&u.every(O=>ZN(O,o,a)),d=d_(o,t.lng||null,a.nsMode==="fallback"?u:u[0],l),h=()=>d,f=()=>d0(o,t.lng||null,a.nsMode==="fallback"?u:u[0],l),[p,g]=C.useState(h);let v=u.join();t.lng&&(v=`${t.lng}${v}`);const b=c_(v),y=C.useRef(!0);C.useEffect(()=>{const{bindI18n:O,bindI18nStore:I}=a;y.current=!0,!c&&!s&&(t.lng?u0(o,t.lng,u,()=>{y.current&&g(f)}):Pd(o,u,()=>{y.current&&g(f)})),c&&b&&b!==v&&y.current&&g(f);const _=()=>{y.current&&g(f)};return O&&(o==null||o.on(O,_)),I&&(o==null||o.store.on(I,_)),()=>{y.current=!1,o&&O&&(O==null||O.split(" ").forEach(N=>o.off(N,_))),I&&o&&I.split(" ").forEach(N=>o.store.off(N,_))}},[o,v]),C.useEffect(()=>{y.current&&c&&g(h)},[o,l,c]);const E=[p,o,c];if(E.t=p,E.i18n=o,E.ready=c,c||!c&&!s)return E;throw new Promise(O=>{t.lng?u0(o,t.lng,u,()=>O()):Pd(o,u,()=>O())})},{slice:f_,forEach:h_}=[];function m_(e){return h_.call(f_.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}function p_(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(e))}const f0=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,g_=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(t);let o=`${e}=${i}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!f0.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!f0.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},h0={create(e,t,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=g_(e,t,i)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let i=n[r];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return i.substring(t.length,i.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var v_={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return h0.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:o}=t;n&&typeof document<"u"&&h0.create(n,e,r,i,o)}},b_={name:"querystring",lookup(e){var r;let{lookupQuerystring:t}=e,n;if(typeof window<"u"){let{search:i}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(i=window.location.hash.substring(window.location.hash.indexOf("?")));const a=i.substring(1).split("&");for(let s=0;s<a.length;s++){const l=a[s].indexOf("=");l>0&&a[s].substring(0,l)===t&&(n=a[s].substring(l+1))}}return n}},y_={name:"hash",lookup(e){var i;let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const a=o.substring(1);if(t){const s=a.split("&");for(let l=0;l<s.length;l++){const u=s[l].indexOf("=");u>0&&s[l].substring(0,u)===t&&(r=s[l].substring(u+1))}}if(r)return r;if(!r&&n>-1){const s=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(s)?(i=s[typeof n=="number"?n:0])==null?void 0:i.replace("/",""):void 0}}}return r}};let oa=null;const m0=()=>{if(oa!==null)return oa;try{if(oa=typeof window<"u"&&window.localStorage!==null,!oa)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{oa=!1}return oa};var E_={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&m0())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&m0()&&window.localStorage.setItem(n,e)}};let aa=null;const p0=()=>{if(aa!==null)return aa;try{if(aa=typeof window<"u"&&window.sessionStorage!==null,!aa)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{aa=!1}return aa};var S_={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&p0())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&p0()&&window.sessionStorage.setItem(n,e)}},C_={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:i}=navigator;if(n)for(let o=0;o<n.length;o++)t.push(n[o]);r&&t.push(r),i&&t.push(i)}return t.length>0?t:void 0}},w_={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},x_={name:"path",lookup(e){var i;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(i=n[typeof t=="number"?t:0])==null?void 0:i.replace("/",""):void 0}},T_={name:"subdomain",lookup(e){var i,o;let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&((o=(i=window.location)==null?void 0:i.hostname)==null?void 0:o.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let g0=!1;try{document.cookie,g0=!0}catch{}const v0=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];g0||v0.splice(1,1);const O_=()=>({order:v0,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class b0{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=m_(n,this.options||{},O_()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(v_),this.addDetector(b_),this.addDetector(E_),this.addDetector(S_),this.addDetector(C_),this.addDetector(w_),this.addDetector(x_),this.addDetector(T_),this.addDetector(y_)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(n=n.concat(i))}}),n=n.filter(r=>r!=null&&!p_(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}b0.type="languageDetector";const N_=50,Ld=30,Dd=120,y0=[{key:"en",label:"English"},{key:"es",label:"Español"}],kd="i18nextLng";var sa=(e=>(e[e.FADE_OUT=0]="FADE_OUT",e[e.FADE_IN=1]="FADE_IN",e))(sa||{});const __={Music:"Música",save:"Guardar",cancel:"Cancelar",Text:"Texto",Introduction:"Introducción",heading:{work:"Obra",section:"Sección",splitViewSelectorHorizontal:"Contenido de la vista derecha",splitViewSelectorVertical:"Contenido de la vista inferior"},tab:{introduction:"Introducción",music:"Música",text:"Texto",facsimile:"Facsimil"},editorial:{preferredReading:"lectura preferida",alternativeReading:"lectura alternativa",regReading:"lectura regularizada",origReading:"lectura original",alternativeReadingNumber:"lectura alternativa nº",currentlyShowing:"Actualmente se muestra la {{what}}",availableOptions:"Opciones disponibles",reason:"Razón",resp:"Responsable",optionNumber:"Opción nº{{number}}",formatType:{corr:"Corrección aplicada",unclear:"Elemento poco claro en la fuente",choice:"Opciones disponibles",app:"Lecturas alternativas",lem:"lectura preferida",rdg:"otra lectura",sic:"error evidente",supplied:"parte añadida",reg:"Regularización",clefChange:"Cambio de clave",default:"tipo: {{type}}"}},error:{scoreViewerError:"Algo fue mal en el visor de partituras",tryAgain:"Intentar de nuevo",fetchingScore:{title:"Error al obtener la partitura",details:"Error al cargar la partitura de la red: {{url}}"},fetchIntroError:"Error al obtener el texto de introducción",fetchLyricsItemError:"Error al obtener el texto poético",fetchTextCommentsError:"Comentarios del texto",fetchErrorDescription:"Se produjeron los siguientes errores al obtener elementos de la red",fetchLyricsItemErrorWithSection:"Texto poético para la sección {{section}}",fetchTextSeeErrorAbove:"Error: ver arriba para más detalles"},ok:"Ok",reset:"Reset",playerMode:{autoscroll:"auto scroll",normal:"normal"},anonymous:"Anónimo",scoreControls:{settings:"Configuración"},scoreOptions:{title:"Opciones de visualizacion",reconstruction:"Reconstrucción {{voiceName}}",uiSettings:{title:"Configuración de la interfaz de usuario"},scoreViewerSettings:{title:"Configuración del visor de partituras"},scoreSettings:{title:"Opciones de la partitura seleccionada"},editorialNotes:{title:"Notas editoriales",description:"Muestra una capa con las notas críticas y elección de variantes variantes"},normalizeFicta:{title:"Normalizar musica ficta",description:"Mostrar las alteraciones subintelectas de como las normales prececiendo a la nota"},originalClefs:{title:"Claves originales",description:"Muestra las claves originales del manuscrito sin modernizar"},noTransposition:{title:"Sin transposición",description:"Muestra la partitura deshaciendo la transposición desde claves altas ({{encodedTransposition}})"},harmonicAnalysis:{title:"Análisis armónico",description:"Muestra la clasificación de las disonancias presentes en la partitura"},limitVerses:{title:"Limitar estrofas",description:"Elige la cantidad de estrofas a mostrar en las coplas"},verseAmmount_one:"1 estrofa",verseAmmount_other:"{{count}} estrofas",reconstructionNone:"ninguna",language:{title:"Idioma",description:"Idioma de la interfaz de usuario"},uiLayout:{title:"Diseño de la interfaz de usuario",description:"Define cómo se organizan los componentes en la pantalla"},measureNumberInterval:{title:"Número de compás",description:"Define con qué frecuencia se muestran los números de compás en la partitura"},measureIntervalPage:"Al comienzo de la página",measureInterval10:"Cada 10 compases",measureInterval5:"Cada 5 compases",measureInterval1:"Cada compás",coloredNotes:{title:"Notas ennegrecidas",description:"Señalar las notas ennegrecidas con corchetes superiores"},resetSettings:"Restablecer configuración por defecto"},scoreProcessor:{reconstructionByIA:"Reconstrucción por IA. Modelo {{name}}",reconstructionByHuman:"Reconstrucción por {{name}}"},score:{measureNumber:"Compás {{number}}"},textView:{intro:"Introducción",poeticText:"Texto poético",notes:"Notas al texto"},test:{score1:"Obra 1",score2:"Obra 2",score3:"Obra 3",basic:"en esp test"},configValidation:{configRequired:"La configuración es requerida",settingsRequired:"El objeto de configuración (settings) es requerido",showScoreSelectorBoolean:"showScoreSelector debe ser un booleano",showTitleBoolean:"showTitle debe ser un booleano",showDownloadButtonBoolean:"showDownloadButton debe ser un booleano",showIntroductionSectionBoolean:"showIntroductionSection debe ser un booleano",showTextSectionBoolean:"showTextSection debe ser un booleano",showFacsimileSectionBoolean:"showFacsimileSection debe ser un booleano",renderTitlesFromMEIBoolean:"renderTitlesFromMEI debe ser un booleano",allowUserLanguageChangeBoolean:"allowUserLanguageChange debe ser un booleano",basePathRequired:"basePath es requerido y debe ser una cadena de texto",facsimileImagesPathRequired:"facsimileImagesPath es requerido y debe ser una cadena de texto",backgroundColorString:"backgroundColor debe ser una cadena de texto si se proporciona",languageString:"language debe ser una cadena de texto si se proporciona",scoresArray:"Scores debe ser un array",scoresNotEmpty:"Se requiere al menos una partitura",scoreTitleRequired:"El título de la partitura es requerido y debe ser una cadena de texto",scorePathRequired:"La ruta de la partitura es requerida y debe ser una cadena de texto",scoreMeiFileRequired:"El archivo MEI de la partitura es requerido y debe ser una cadena de texto",scoreEncodingPropertiesRequired:"El objeto encodingProperties es requerido",scoreAudioOverlaysArray:"audioOverlays debe ser un array si se proporciona",scoreTextArray:"text debe ser un array si se proporciona",scoreFacsimileItemsArray:"facsimileItems debe ser un array si se proporciona",configurationError:"Error de Configuración",configurationErrorDescription:"La configuración del ScoreViewer contiene errores:"}},I_={Music:"Música",save:"Guardar",cancel:"Cancelar",Text:"Texto",Introduction:"Introducción",heading:{work:"Work",section:"Section",splitViewSelectorHorizontal:"Right view content",splitViewSelectorVertical:"Bottom view content"},tab:{introduction:"Introduction",music:"Music",text:"Text",facsimile:"Facsimile"},editorial:{preferredReading:"preferred reading",alternativeReading:"alternative reading",regReading:"regularized reading",origReading:"original reading",alternativeReadingNumber:"alternative reading #",currentlyShowing:"Currently showing the {{what}}",availableOptions:"Available options",reason:"Reason",resp:"Responsible person",optionNumber:"Option #{{number}}",formatType:{corr:"Applied correction",unclear:"Unclear element in the source",choice:"Available options",app:"Alternative readings",lem:"preferred reading",rdg:"other reading",sic:"obvious error",supplied:"added part",reg:"Regularization",clefChange:"Clef change",default:"type: {{type}}"}},error:{scoreViewerError:"Something went wrong in the score viewer.",tryAgain:"Try again",fetchingScore:{title:"Error fetching the score",details:"Error loading the score from the network: {{url}}"},fetchIntroError:"Error fetching the introduction text",fetchErrorDescription:"The following errors occurred fetching items from the network",fetchLyricsItemErrorWithSection:"Poetic text for section {{section}}",fetchTextCommentsError:"Text comments",fetchTextSeeErrorAbove:"Error: see above for details"},ok:"Ok",reset:"Reset",playerMode:{autoscroll:"auto scroll",normal:"normal"},anonymous:"Anonymous",scoreControls:{settings:"Settings"},scoreOptions:{title:"Display options",reconstruction:"Reconstruction {{voiceName}}",uiSettings:{title:"UI settings"},scoreViewerSettings:{title:"Score viewer settings"},scoreSettings:{title:"Current score options"},editorialNotes:{title:"Editorial notes",description:"Shows a layer with critical notes and variant selection options"},normalizeFicta:{title:"Normalize musica ficta",description:"Show the subsemitonium alterations as normal ones preceding the note"},originalClefs:{title:"Original clefs",description:"Shows the original manuscript clefs without modernization"},noTransposition:{title:"No transposition",description:"Shows the score undoing the transposition from high clefs ({{encodedTransposition}})"},harmonicAnalysis:{title:"Harmonic analysis",description:"Shows classification dissonances present in the score"},limitVerses:{title:"Limit verses",description:"Choose the number of verses to show in the couplets"},verseAmmount_one:"1 verse",verseAmmount_other:"{{count}} verses",reconstructionNone:"none",language:{title:"Language",description:"Language for the UI"},uiLayout:{title:"UI Layout",description:"Define how components are arranged on the screen"},measureNumberInterval:{title:"Measure number",description:"Define how often measure numbers are shown in the score"},measureIntervalPage:"At the beginning of the page",measureInterval10:"Every 10 measures",measureInterval5:"Every 5 measures",measureInterval1:"Every measure",coloredNotes:{title:"Colored notes",description:"Mark colored notes with brackets on top of them"},resetSettings:"Reset settings to default"},scoreProcessor:{reconstructionByIA:"Reconstruction by AI. Model {{name}}",reconstructionByHuman:"Reconstruction by {{name}}"},score:{measureNumber:"Measure {{number}}"},textView:{intro:"Introduction",poeticText:"Poetical text",notes:"Notes to the text"},test:{score1:"Score 1",score2:"Score 2",score3:"Score 3",basic:"Basic",selectTest:"Select Test:",sections:"Sections"},configValidation:{configRequired:"Configuration is required",settingsRequired:"Settings object is required",showScoreSelectorBoolean:"showScoreSelector must be a boolean",showTitleBoolean:"showTitle must be a boolean",showDownloadButtonBoolean:"showDownloadButton must be a boolean",showIntroductionSectionBoolean:"showIntroductionSection must be a boolean",showTextSectionBoolean:"showTextSection must be a boolean",showFacsimileSectionBoolean:"showFacsimileSection must be a boolean",renderTitlesFromMEIBoolean:"renderTitlesFromMEI must be a boolean",allowUserLanguageChangeBoolean:"allowUserLanguageChange must be a boolean",basePathRequired:"basePath is required and must be a string",facsimileImagesPathRequired:"facsimileImagesPath is required and must be a string",backgroundColorString:"backgroundColor must be a string if provided",languageString:"language must be a string if provided",scoresArray:"Scores must be an array",scoresNotEmpty:"At least one score is required",scoreTitleRequired:"Score title is required and must be a string",scorePathRequired:"Score path is required and must be a string",scoreMeiFileRequired:"Score meiFile is required and must be a string",scoreEncodingPropertiesRequired:"encodingProperties object is required",scoreAudioOverlaysArray:"audioOverlays must be an array if provided",scoreTextArray:"text must be an array if provided",scoreFacsimileItemsArray:"facsimileItems must be an array if provided",configurationError:"Configuration Error",configurationErrorDescription:"The ScoreViewer configuration contains errors:"}},A_={order:["sessionStorage","navigator"],lookupSessionStorage:kd,caches:["sessionStorage"]},P_={en:{common:I_},es:{common:__}};An.use(s_).use(b0).init({supportedLngs:y0.map(e=>e.key),resources:P_,...A_,fallbackLng:"en",debug:!1,defaultNS:"common",interpolation:{escapeValue:!1}});const E0=e=>{let t;const n=new Set,r=(u,c)=>{const d=typeof u=="function"?u(t):u;if(!Object.is(d,t)){const h=t;t=c??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(f=>f(t,h))}},i=()=>t,s={setState:r,getState:i,getInitialState:()=>l,subscribe:u=>(n.add(u),()=>n.delete(u))},l=t=e(r,i,s);return s},M_=e=>e?E0(e):E0,L_=e=>e;function D_(e,t=L_){const n=C.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return C.useDebugValue(n),n}const S0=e=>{const t=M_(e),n=r=>D_(t,r);return Object.assign(n,t),n},_o=e=>e?S0(e):S0;function k_(e,t){let n;try{n=e()}catch{return}return{getItem:i=>{var o;const a=l=>l===null?null:JSON.parse(l,void 0),s=(o=n.getItem(i))!=null?o:null;return s instanceof Promise?s.then(a):a(s)},setItem:(i,o)=>n.setItem(i,JSON.stringify(o,void 0)),removeItem:i=>n.removeItem(i)}}const Rd=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Rd(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Rd(r)(n)}}}},C0=(e,t)=>(n,r,i)=>{let o={storage:k_(()=>localStorage),partialize:g=>g,version:0,merge:(g,v)=>({...v,...g}),...t},a=!1;const s=new Set,l=new Set;let u=o.storage;if(!u)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...g)},r,i);const c=()=>{const g=o.partialize({...r()});return u.setItem(o.name,{state:g,version:o.version})},d=i.setState;i.setState=(g,v)=>{d(g,v),c()};const h=e((...g)=>{n(...g),c()},r,i);i.getInitialState=()=>h;let f;const p=()=>{var g,v;if(!u)return;a=!1,s.forEach(y=>{var E;return y((E=r())!=null?E:h)});const b=((v=o.onRehydrateStorage)==null?void 0:v.call(o,(g=r())!=null?g:h))||void 0;return Rd(u.getItem.bind(u))(o.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==o.version){if(o.migrate){const E=o.migrate(y.state,y.version);return E instanceof Promise?E.then(T=>[!0,T]):[!0,E]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var E;const[T,x]=y;if(f=o.merge(x,(E=r())!=null?E:h),n(f,!0),T)return c()}).then(()=>{b==null||b(f,void 0),f=r(),a=!0,l.forEach(y=>y(f))}).catch(y=>{b==null||b(void 0,y)})};return i.persist={setOptions:g=>{o={...o,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u==null||u.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>p(),hasHydrated:()=>a,onHydrate:g=>(s.add(g),()=>{s.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},o.skipHydration||p(),f||h};function Io(e){const t=e;t.use={};const n=Object.keys(e.getState());for(const r of n)t.use[r]=()=>e(i=>i[r]);return t}const ps=e=>({type:"load",config:e}),R_=e=>({type:"loadAutoScroll",config:e}),$d=e=>({type:"render",config:e}),$_=e=>({type:"renderAutoScroll",config:e});class ti extends Error{constructor(n,r){super(r);no(this,"type");this.type=n,Object.setPrototypeOf(this,ti.prototype)}}var At=(e=>(e[e.PLAYING=0]="PLAYING",e[e.PAUSED=1]="PAUSED",e[e.STOPPED=2]="STOPPED",e))(At||{});const F_=_o(e=>({targetWidth:0,targetHeight:0,pendingAction:null,setTargetWidth:t=>e(()=>({targetWidth:t})),setTargetHeight:t=>e(()=>({targetHeight:t})),setPendingAction:t=>e(()=>({pendingAction:t}))})),B_=_o(e=>({score:null,showingMei:null,scoreCache:{},textCache:{},textComments:void 0,textIntroduction:void 0,textLyrics:void 0,setScore:t=>e(()=>({score:t})),setShowingMei:t=>e(()=>({showingMei:t})),setScoreCache:t=>e(n=>({scoreCache:{...n.scoreCache,...t}})),setTextCache:(t,n)=>e(r=>({textCache:n?t:{...r.textCache,...t}})),setTextComments:t=>e(()=>({textComments:t})),setTextIntroduction:t=>e(()=>({textIntroduction:t})),setTextLyrics:(t,n)=>e(r=>({textLyrics:n?t:[...r.textLyrics||[],...t||[]]}))})),z_=_o((e,t)=>({pageCount:0,currentPage:1,sectionPageMap:{},setScoreLayout:({pageCount:n,sectionPageMap:r,currentPage:i})=>{e({pageCount:n,sectionPageMap:r,currentPage:i,navigationCommand:null})},goToPage:n=>e({currentPage:Math.max(1,Math.min(n,t().pageCount))}),goToNextPage:()=>t().goToPage(t().currentPage+1),goToPreviousPage:()=>t().goToPage(t().currentPage-1),goToSection:n=>{const r=t().sectionPageMap[n];r&&e({navigationCommand:{type:"section",target:n},currentPage:r})},navigationCommand:null,clearNavigationCommand:()=>e({navigationCommand:null})})),w0={isSplitView:!1,activeSplitView:"facsimile",splitViewOrientation:"horizontal",activeTab:"music"},H_=_o()(C0(e=>({isLoading:!0,scoreSvg:null,scale:N_,reachedEffectiveMaxScale:!1,...w0,setIsLoading:t=>e(()=>({isLoading:t})),setScoreSvg:t=>e(()=>({scoreSvg:t})),setScale:t=>e(n=>({scale:t<=Dd&&t>=Ld?t:n.scale})),increaseScale:()=>e(t=>({scale:Math.min(t.scale+10,Dd)})),decreaseScale:()=>e(t=>({scale:Math.max(t.scale-10,Ld)})),setReachedEffectiveMaxScale:t=>e(()=>({reachedEffectiveMaxScale:t})),setIsSplitView:t=>e(()=>({isSplitView:t})),setActiveSplitView:t=>e(()=>({activeSplitView:t})),setSplitViewOrientation:t=>e(()=>({splitViewOrientation:t})),setActiveTab:t=>e(()=>({activeTab:t})),reset:()=>e(w0)}),{name:"ui-layout-store",partialize:e=>({isSplitView:e.isSplitView,activeSplitView:e.activeSplitView,splitViewOrientation:e.splitViewOrientation,activeTab:e.activeTab})})),j_=_o(e=>({playingState:At.STOPPED,playingPosition:0,seekPosition:-1,autoScroll:!1,setPlayingState:t=>e(()=>({playingState:t})),setPlayingPosition:t=>e(()=>({playingPosition:t})),setSeekPosition:t=>e(()=>({seekPosition:t})),setAutoScroll:t=>e(()=>({autoScroll:t})),resetPlayerPosition:()=>e(()=>({playingPosition:0,seekPosition:0}))})),x0={showNVerses:8,showEditorial:!1,showOriginalClefs:!1,normalizeFicta:!1,showingEditorial:null,appOptions:[],choiceOptions:[],withoutTransposition:!1,showMusicAnalysis:!1,measureNumberInterval:0,showColoredNotes:!1},V_=_o()(C0(e=>({...x0,setShowNVerses:t=>e(()=>({showNVerses:t})),setShowEditorial:t=>e(()=>({showEditorial:t})),setShowOriginalClefs:t=>e(()=>({showOriginalClefs:t})),setNormalizeFicta:t=>e(()=>({normalizeFicta:t})),setShowingEditorial:t=>e(()=>({showingEditorial:t})),setAppOptions:(t,n)=>e(r=>({appOptions:n?t:[...r.appOptions,...t]})),setChoiceOptions:(t,n)=>e(r=>({choiceOptions:n?t:[...r.choiceOptions,...t]})),setWithoutTransposition:t=>e(()=>({withoutTransposition:t})),setShowMusicAnalysis:t=>e(()=>({showMusicAnalysis:t})),setMeasureNumberInterval:t=>e(()=>({measureNumberInterval:t})),setShowColoredNotes:t=>e(()=>({showColoredNotes:t})),resetScoreSettings:()=>e({...x0})}),{name:"score-settings-store"})),U_=_o((e,t)=>({renderedSvgData:null,pageCache:new Map,setRenderedSvgData:n=>e(()=>({renderedSvgData:n})),setCachedPage:(n,r)=>{const i=new Map(t().pageCache);if(i.size>=3&&!i.has(n)){const a=i.keys().next().value;a!==void 0&&i.delete(a)}i.set(n,r),e({pageCache:i})},getCachedPage:n=>t().pageCache.get(n)||null,clearPageCache:()=>e({pageCache:new Map})}));class W_{constructor(){no(this,"use",{targetWidth:la.use.targetWidth,setTargetWidth:la.use.setTargetWidth,targetHeight:la.use.targetHeight,setTargetHeight:la.use.setTargetHeight,pendingAction:la.use.pendingAction,setPendingAction:la.use.setPendingAction,score:hr.use.score,showingMei:hr.use.showingMei,scoreCache:hr.use.scoreCache,textCache:hr.use.textCache,textComments:hr.use.textComments,textIntroduction:hr.use.textIntroduction,textLyrics:hr.use.textLyrics,setScore:hr.use.setScore,setShowingMei:hr.use.setShowingMei,setScoreCache:hr.use.setScoreCache,setTextCache:hr.use.setTextCache,setTextComments:hr.use.setTextComments,setTextIntroduction:hr.use.setTextIntroduction,setTextLyrics:hr.use.setTextLyrics,isLoading:Wn.use.isLoading,scoreSvg:Wn.use.scoreSvg,scale:Wn.use.scale,reachedEffectiveMaxScale:Wn.use.reachedEffectiveMaxScale,isSplitView:Wn.use.isSplitView,activeSplitView:Wn.use.activeSplitView,splitViewOrientation:Wn.use.splitViewOrientation,activeTab:Wn.use.activeTab,setIsLoading:Wn.use.setIsLoading,setScoreSvg:Wn.use.setScoreSvg,setScale:Wn.use.setScale,increaseScale:Wn.use.increaseScale,decreaseScale:Wn.use.decreaseScale,setReachedEffectiveMaxScale:Wn.use.setReachedEffectiveMaxScale,setIsSplitView:Wn.use.setIsSplitView,setSplitViewOrientation:Wn.use.setSplitViewOrientation,setActiveTab:Wn.use.setActiveTab,setActiveSplitView:Wn.use.setActiveSplitView,resetUILayout:Wn.use.reset,pageCount:mi.use.pageCount,currentPage:mi.use.currentPage,sectionPageMap:mi.use.sectionPageMap,setScoreLayout:mi.use.setScoreLayout,goToPage:mi.use.goToPage,goToNextPage:mi.use.goToNextPage,goToPreviousPage:mi.use.goToPreviousPage,goToSection:mi.use.goToSection,navigationCommand:mi.use.navigationCommand,clearNavigationCommand:mi.use.clearNavigationCommand,playingState:$i.use.playingState,playingPosition:$i.use.playingPosition,seekPosition:$i.use.seekPosition,autoScroll:$i.use.autoScroll,setPlayingState:$i.use.setPlayingState,setPlayingPosition:$i.use.setPlayingPosition,setSeekPosition:$i.use.setSeekPosition,setAutoScroll:$i.use.setAutoScroll,resetPlayerPosition:$i.use.resetPlayerPosition,showNVerses:_n.use.showNVerses,showEditorial:_n.use.showEditorial,showOriginalClefs:_n.use.showOriginalClefs,normalizeFicta:_n.use.normalizeFicta,showingEditorial:_n.use.showingEditorial,appOptions:_n.use.appOptions,choiceOptions:_n.use.choiceOptions,withoutTransposition:_n.use.withoutTransposition,showMusicAnalysis:_n.use.showMusicAnalysis,measureNumberInterval:_n.use.measureNumberInterval,showColoredNotes:_n.use.showColoredNotes,setShowNVerses:_n.use.setShowNVerses,setShowEditorial:_n.use.setShowEditorial,setShowOriginalClefs:_n.use.setShowOriginalClefs,setNormalizeFicta:_n.use.setNormalizeFicta,setShowingEditorial:_n.use.setShowingEditorial,setAppOptions:_n.use.setAppOptions,setChoiceOptions:_n.use.setChoiceOptions,setWithoutTransposition:_n.use.setWithoutTransposition,setShowMusicAnalysis:_n.use.setShowMusicAnalysis,setMeasureNumberInterval:_n.use.setMeasureNumberInterval,setShowColoredNotes:_n.use.setShowColoredNotes,resetScoreSettings:_n.use.resetScoreSettings,renderedSvgData:ua.use.renderedSvgData,setRenderedSvgData:ua.use.setRenderedSvgData,pageCache:ua.use.pageCache,setCachedPage:ua.use.setCachedPage,getCachedPage:ua.use.getCachedPage,clearPageCache:ua.use.clearPageCache})}}const la=Io(F_),hr=Io(B_),mi=Io(z_),Wn=Io(H_),$i=Io(j_),_n=Io(V_),ua=Io(U_),ge=new W_;function Y_(e){return new Worker(""+(typeof document>"u"&&typeof ug>"u"?require("url").pathToFileURL(__dirname+"/assets/verovio.worker-BU_hF9pg.js").href:new URL("assets/verovio.worker-BU_hF9pg.js",typeof document>"u"?ug.href:document.currentScript&&document.currentScript.tagName.toUpperCase()==="SCRIPT"&&document.currentScript.src||document.baseURI).href),{name:e==null?void 0:e.name})}let pi=null,Xl=!1,T0=null;const Fd=new Map;let Bd=null,q_=0;function X_(){return pi||(console.log("[useVerovio] Creating Verovio worker..."),pi=new Y_,Bd=new Promise((e,t)=>{const n=setTimeout(()=>{t(new Error("Worker initialization timeout"))},3e4);pi.onmessage=r=>{const i=r.data;if(i.type==="init"){clearTimeout(n);const o=i;o.status==="ready"?(Xl=!0,T0=o.version||null,console.log("[useVerovio] Worker ready, Verovio version:",T0),e()):(console.error("[useVerovio] Worker initialization failed:",o.error),t(new Error(o.error||"Worker initialization failed"))),pi.onmessage=K_;return}},pi.onerror=r=>{clearTimeout(n),console.error("[useVerovio] Worker error during init:",r),t(r)}}),pi)}function K_(e){const t=e.data,n=Fd.get(t.id);n&&(Fd.delete(t.id),t.error?n.reject(new Error(t.error)):n.resolve(t.result))}async function Fi(e,...t){if(!pi)throw new Error("Worker not initialized");if(!Xl&&Bd&&await Bd,!Xl)throw new Error("Worker not ready");return new Promise((n,r)=>{if(!pi){r(new Error("Worker not initialized"));return}const i=`req_${++q_}`;Fd.set(i,{resolve:n,reject:r});const o={id:i,method:e,args:t};pi.postMessage(o)})}function G_(){return{get isReady(){return Xl},setOptions:e=>Fi("setOptions",e),loadData:e=>Fi("loadData",e),getPageCount:()=>Fi("getPageCount"),renderToSVG:e=>Fi("renderToSVG",e),renderToTimemap:e=>Fi("renderToTimemap",e),getMEI:e=>Fi("getMEI",e),getPageWithElement:e=>Fi("getPageWithElement",e),getElementsAtTime:e=>Fi("getElementsAtTime",e),getVersion:()=>Fi("getVersion")}}function O0(){const[e,t]=C.useState(null),n=C.useRef(null);return C.useEffect(()=>(n.current||(n.current=X_(),t(G_())),()=>{}),[]),e}const Kl=C.createContext({verovio:void 0});var N0={exports:{}};/*!
2
2
  Copyright (c) 2018 Jed Watson.
3
3
  Licensed under the MIT License (MIT), see
4
4
  http://jedwatson.github.io/classnames
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "./style.css": "./dist/style.css"
14
14
  },
15
15
  "private": false,
16
- "version": "1.0.52",
16
+ "version": "1.0.53",
17
17
  "type": "module",
18
18
  "files": [
19
19
  "dist"
@@ -43,7 +43,7 @@
43
43
  "rehype-raw": "^7.0.0",
44
44
  "remark-gfm": "^4.0.1",
45
45
  "remark-sectionize": "^2.1.0",
46
- "verovio": "~5.3.2",
46
+ "verovio": "~5.1.0",
47
47
  "vite-plugin-dts": "^4.5.3",
48
48
  "zustand": "^5.0.3"
49
49
  },