(()=>{"use strict";var t={665:(t,e,n)=>{n.d(e,{H:()=>i});const s=["initialized","loaded","languageChanged"];class i extends HTMLElement{set i18next(t){this._i18next!==t&&(this._disconnect(),this._i18next=t,this._connect())}static get observedAttributes(){return[]}constructor(t){super(),this._observedAttributes=[],this._initialized=!1,this._props={},this._i18next=window.i18next;const e=t.reduce(((t,e)=>{const n=e.toLowerCase();return n!==e&&(t[n]=e),t}),{});this._observedAttributes=t,this._attrMap=t=>e[t]||t}connectedCallback(){this._assignProps(),this._disconnect(),this._connect(),this._initialized=!0,this._render()}disconnectedCallback(){this._disconnect()}attributeChangedCallback(t,e,n){e!==n&&(this._properties(this._attrMap(t),n),window.requestAnimationFrame((()=>{this._render()})))}_assignProps(){Array.from(this.attributes).forEach((t=>this._properties(this._attrMap(t.name),t.value))),this._observedAttributes.forEach((t=>{void 0!==this[t]&&this._properties(t,this[t]),Object.defineProperty(this,t,{get(){return this._props[t]},set(e){this.attributeChangedCallback(t,this._props[t],e)},configurable:!0,enumerable:!0})}))}_connect(){this._i18next&&(this._off=s.map((t=>{const e=()=>{window.requestAnimationFrame((()=>{this._assignProps(),this._render()}))};return this._i18next.on(t,e),()=>this._i18next.off(t,e)})))}_disconnect(){this._off&&this._off.forEach((t=>t()))}_languages(t){const e=this._i18next&&this._i18next.languages||navigator.languages;return[].concat(t,e).filter(Boolean)}_properties(t,e){}_render(){}}},213:(t,e,n)=>{n.d(e,{NM:()=>s.N,YC:()=>i.Y,cJ:()=>r.c,z_:()=>o.z});var s=n(200),i=n(834),o=n(743),r=n(563)},834:(t,e,n)=>{n.d(e,{Y:()=>c});var s=n(665),i=n(903);const o=["value","lng","options","date","time","weekday","era","year","month","day","hour","minute","second","hour12","hourCycle","timeZone","timeZoneName","localeMatcher","formatMatcher","numberingSystem","calendar"],r={year:"numeric",month:"numeric",day:"numeric"},a={hour:"numeric",minute:"numeric",second:"numeric"};class l extends s.H{static get observedAttributes(){return(0,i.C8)(o)}constructor(){super(o)}_properties(t,e){const{_props:n}=this;switch(t){case"value":n[t]=(0,i.ZU)(e);break;case"date":(0,i.Pl)(e)&&(this._props=Object.assign(n,r));break;case"time":if((0,i.Pl)(e)){const t=n.hour12||!1;this._props=Object.assign(n,a,{hour12:t})}else{const{hour:t,minute:e,second:s,...i}=n;this._props=i}break;case"hour12":n[t]=(0,i.Pl)(e);break;case"options":this._props=Object.assign(n,(0,i.Qs)(e,e));break;default:n[t]=(0,i.Qs)(e,e)}}_render(){if(this._initialized){const{value:t,lng:e,...n}=this._props,s=t||new Date,i=this._languages(e);try{this.textContent=new Intl.DateTimeFormat(i,n).format(s)}catch(t){this.textContent=new Intl.DateTimeFormat(i).format(s),console.log(t)}}}}function c(t){return(0,i.uT)("intl-datetime",t)}customElements.define("intl-datetime",l)},200:(t,e,n)=>{n.d(e,{N:()=>a});var s=n(665),i=n(903);const o=["key","label","count","context","lng","ns","options","value","dangerous"];class r extends s.H{static get observedAttributes(){return(0,i.C8)(o)}constructor(){super(o),this._props={}}_properties(t,e){if("dangerous"===t)this._props.interpolation={escapeValue:!(0,i.Pl)(e)};else{const n=(0,i.ZU)(e)||(0,i.Qs)(e)||e;"options"===t&&"object"==typeof n?this._props={...this._props,...n}:this._props[t]=n}}_render(){if(this._initialized){const{label:t,key:e,...n}=this._props,s=this._i18next.t(t||e,n);s&&(this.innerHTML=s)}}}function a(t={}){return(0,i.uT)("intl-message",t)}customElements.define("intl-message",r)},563:(t,e,n)=>{n.d(e,{c:()=>a});var s=n(665),i=n(903);const o=["value","lng","options","styleProp","currency","currencyDisplay","currencySign","unit","unitDisplay","notation","compactDisplay","useGrouping","signDisplay","localeMatcher","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","numberingSystem"];class r extends s.H{static get observedAttributes(){return(0,i.C8)(o)}constructor(){super(o),this._props.value=0}_properties(t,e){const{_props:n}=this;switch(t){case"options":this._props=Object.assign(n,(0,i.Qs)(e));break;case"styleProp":"string"==typeof e&&(n.style=e);break;default:n[t]=(0,i.Qs)(e,e)}}_render(){if(this._initialized){const{value:t,lng:e,...n}=this._props,s=this._languages(e);try{this.textContent=new Intl.NumberFormat(s,n).format(t)}catch(e){this.textContent=new Intl.NumberFormat(s).format(t),console.log(e)}}}}function a(t){return(0,i.uT)("intl-number",t)}customElements.define("intl-number",r)},743:(t,e,n)=>{n.d(e,{z:()=>g});var s=n(665),i=n(903);const o=["year","month","week","day","hour","minute","second"],r=[12,4,7,24,60,60],a={year:31536e3,quarter:10368e3,month:2592e3,week:604800,day:86400,hour:3600,minute:60},l=(t,e)=>{const n=e.getDay(),{day:s}=t,i=s<0?s+n-7:s-n+7;return s<0?Math.ceil(i/7):Math.floor(i/7)},c=(t,e,n=1)=>Math.trunc((t.getTime()-e.getTime())/1e3/n),u=(t,e)=>{if((u=t)&&u instanceof Date&&!isNaN(u.getTime())){const e=new Date,i=c(t,e,a.day),u=(n=t,s=e,r=i,Math.abs(r)<31?0:Math.trunc(n.getMonth()+12*n.getFullYear()-(s.getMonth()+12*s.getFullYear()))),h={year:Math.trunc(u/12),month:u,week:c(t,e,a.week),day:i,hour:c(t,e,a.hour),minute:c(t,e,a.minute),second:c(t,e)};for(let n=0;n{const s=a[e]||1;let i=(s+c(t,new Date))%s||s;return i<0&&(i=s+i||1),n||(i=Math.trunc(i/6)||1),1e3*i},p=["value","lng","options","unit","localeMatcher","styleProp","numeric","update"];class d extends s.H{static get observedAttributes(){return(0,i.C8)(p)}constructor(){super(p)}disconnectedCallback(){clearTimeout(this._timerId),super.disconnectedCallback()}_setTimer(){const{date:t,value:e,unit:n}=this._props,s=h({date:t,unit:n});this._timerId=setTimeout((()=>{this._timerId=null;const s=(({value:t,unit:e})=>{if(1===t){const n=o.indexOf(e);t=r[n]||t,e=-1!==n&&o[n+1]||"second"}return{value:t,unit:e}})(u(t,n));s.value!==e?(this._props.value=s.value,this._properties("unit",s.unit),this._render()):this._props.update&&this._setTimer()}),s)}_properties(t,e){const{_props:n}=this;switch(t){case"value":const r=(0,i.ZU)(e)||(0,i.He)(e)||0;this._props=Object.assign(n,u(r,n.unit));break;case"options":const a=(0,i.Qs)(e);"object"==typeof a&&(this._props=Object.assign(n,a));break;case"update":(n[t]=(0,i.Pl)(e))||clearTimeout(this._timerId);break;case"styleProp":"string"==typeof e&&(n.style=e);break;case"unit":n[t]=(s=e,s=String(s).replace(/s$/,""),-1!==o.indexOf(s)?s:"second");break;default:n[t]=(0,i.Qs)(e,e)}var s}_render(){if(this._initialized){const{value:t=0,lng:e,unit:n="second",date:s,update:i,...o}=this._props;i&&!this._timerId&&this._setTimer();const r=this._languages(e);try{this.textContent=new Intl.RelativeTimeFormat(r,o).format(t,n)}catch(e){this.textContent=new Intl.RelativeTimeFormat(r).format(t,n),console.log(e)}}}}function g(t){const{update:e,...n}=t;return(0,i.uT)("intl-relative-time",n)}customElements.define("intl-relative-time",d)},903:(t,e,n)=>{n.d(e,{C8:()=>u,He:()=>l,Pl:()=>s,Qs:()=>a,ZU:()=>r,uT:()=>c});const s=t=>""===t||!!t,i=t=>t instanceof Date&&!isNaN(t.getTime()),o=/^\d{4}-\d{2}-\d{2}/,r=t=>{if(i(t))return t;if("string"==typeof t){const e=new Date(t);if(o.test(String(t))&&i(e))return e}},a=(t,e)=>{if("string"==typeof t)try{return JSON.parse(t)}catch(t){}return e},l=t=>{const e=Number(t);if(!isNaN(e))return e},c=(t,e)=>{const n=document.createElement(t);return Object.entries(e).forEach((([t,e])=>{n[t]=e})),n.connectedCallback(),n.textContent},u=t=>t.map((t=>t.toLowerCase()))}},e={};function n(s){var i=e[s];if(void 0!==i)return i.exports;var o=e[s]={exports:{}};return t[s](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var s in e)n.o(e,s)&&!n.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{class t{constructor(){this._events={}}on(t,e,n={}){this._events[t]=this._events[t]||[],this._events[t].push({fn:e,options:n})}off(t,e){const n=this._events[t]||[];this._events[t]=n.filter((t=>t.fn!==e))}find(t){return this._events[t]}run(t,...e){const n=this.getSubscribers(t,this._events);return console.assert(n&&n.length>0,"No subscriber for event: "+t),n.forEach((n=>{const{fn:s,options:i}=n;return i.delay?this.delay(t,s,e,i):Object.keys(i).length>0?s.apply(this,[...e,i]):s.apply(this,e),!n.options.once})),n.length}once(t,e,n={}){this.on(t,e,Object.assign(Object.assign({},n),{once:!0}))}delay(t,e,n,s){s._t&&clearTimeout(s._t),s._t=setTimeout((()=>{clearTimeout(s._t),Object.keys(s).length>0?e.apply(this,[...n,s]):e.apply(this,n)}),s.delay)}query(t,...e){const n=this.getSubscribers(t,this._events);console.assert(n&&n.length>0,"No subscriber for event: "+t);const s=n.map((t=>{const{fn:n,options:s}=t;return Object.keys(s).length>0?n.apply(this,[...e,s]):n.apply(this,e)}));return Promise.all(s)}getSubscribers(t,e){const n=e[t]||[];return e[t]=n.filter((t=>!t.options.once)),Object.keys(e).filter((e=>e.endsWith("*")&&t.startsWith(e.replace("*","")))).sort(((t,e)=>e.length-t.length)).forEach((s=>n.push(...e[s].map((e=>Object.assign(Object.assign({},e),{options:Object.assign(Object.assign({},e.options),{event:t})})))))),n}}let e;const s="object"==typeof self&&self.self===self&&self||"object"==typeof n.g&&n.g.global===n.g&&n.g;s.app&&s._AppRunVersions?e=s.app:(e=new t,s.app=e,s._AppRunVersions="AppRun-3");const i=e,o=(t,e)=>(e?t.state[e]:t.state)||"",r=(t,e,n)=>{if(e){const s=t.state||{};s[e]=n,t.setState(s)}else t.setState(n)},a=(t,e)=>{if(Array.isArray(t))return t.map((t=>a(t,e)));{let{tag:n,props:s,children:l}=t;return n?(s&&Object.keys(s).forEach((t=>{t.startsWith("$")&&(((t,e,n,s)=>{if(t.startsWith("$on")){const n=e[t];if(t=t.substring(1),"boolean"==typeof n)e[t]=e=>s.run?s.run(t,e):i.run(t,e);else if("string"==typeof n)e[t]=t=>s.run?s.run(n,t):i.run(n,t);else if("function"==typeof n)e[t]=t=>s.setState(n(s.state,t));else if(Array.isArray(n)){const[o,...r]=n;"string"==typeof o?e[t]=t=>s.run?s.run(o,...r,t):i.run(o,...r,t):"function"==typeof o&&(e[t]=t=>s.setState(o(s.state,...r,t)))}}else if("$bind"===t){const i=e.type||"text",a="string"==typeof e[t]?e[t]:e.name;if("input"===n)switch(i){case"checkbox":e.checked=o(s,a),e.onclick=t=>r(s,a||t.target.name,t.target.checked);break;case"radio":e.checked=o(s,a)===e.value,e.onclick=t=>r(s,a||t.target.name,t.target.value);break;case"number":case"range":e.value=o(s,a),e.oninput=t=>r(s,a||t.target.name,Number(t.target.value));break;default:e.value=o(s,a),e.oninput=t=>r(s,a||t.target.name,t.target.value)}else"select"===n?(e.value=o(s,a),e.onchange=t=>{t.target.multiple||r(s,a||t.target.name,t.target.value)}):"option"===n?(e.selected=o(s,a),e.onclick=t=>r(s,a||t.target.name,t.target.selected)):"textarea"===n&&(e.innerHTML=o(s,a),e.oninput=t=>r(s,a||t.target.name,t.target.value))}else i.run("$",{key:t,tag:n,props:e,component:s})})(t,s,n,e),delete s[t])})),l&&(l=a(l,e)),{tag:n,props:s,children:l}):t}},l=a,c="_props";function u(t){const e=[],n=t=>{null!=t&&""!==t&&!1!==t&&e.push("function"==typeof t||"object"==typeof t?t:`${t}`)};return t&&t.forEach((t=>{Array.isArray(t)?t.forEach((t=>n(t))):n(t)})),e}const h=new WeakMap;function p(t,e,n){3!==e._op&&(n=n||"svg"===e.tag,function(t,e){const n=t.nodeName,s=`${e.tag||""}`;return n.toUpperCase()===s.toUpperCase()}(t,e)?(!(2&e._op)&&d(t,e.children,n),!(1&e._op)&&y(t,e.props,n)):t.parentNode.replaceChild(m(e,n),t))}function d(t,e,n){var s,i;const o=(null===(s=t.childNodes)||void 0===s?void 0:s.length)||0,r=(null==e?void 0:e.length)||0,a=Math.min(o,r);for(let s=0;sa;)t.removeChild(t.lastChild),l--;if(r>a){const s=document.createDocumentFragment();for(let t=a;t{const e=document.createElement("section");return e.insertAdjacentHTML("afterbegin",t),Array.from(e.children)};function f(t){if(0===(null==t?void 0:t.indexOf("_html:"))){const e=document.createElement("div");return e.insertAdjacentHTML("afterbegin",t.substring(6)),e}return document.createTextNode(null!=t?t:"")}function m(t,e){if(t instanceof HTMLElement||t instanceof SVGElement)return t;if("string"==typeof t)return f(t);if(!t.tag||"function"==typeof t.tag)return f(JSON.stringify(t));const n=(e=e||"svg"===t.tag)?document.createElementNS("http://www.w3.org/2000/svg",t.tag):document.createElement(t.tag);return y(n,t.props,e),t.children&&t.children.forEach((t=>n.appendChild(m(t,e)))),n}function y(t,e,n){const s=t[c]||{};e=function(t,e){e.class=e.class||e.className,delete e.className;const n={};return t&&Object.keys(t).forEach((t=>n[t]=null)),e&&Object.keys(e).forEach((t=>n[t]=e[t])),n}(s,e||{}),t[c]=e;for(const s in e){const i=e[s];if(s.startsWith("data-")){const e=s.substring(5).replace(/-(\w)/g,(t=>t[1].toUpperCase()));t.dataset[e]!==i&&(i||""===i?t.dataset[e]=i:delete t.dataset[e])}else if("style"===s)if(t.style.cssText&&(t.style.cssText=""),"string"==typeof i)t.style.cssText=i;else for(const e in i)t.style[e]!==i[e]&&(t.style[e]=i[e]);else if(s.startsWith("xlink")){const e=s.replace("xlink","").toLowerCase();null==i||!1===i?t.removeAttributeNS("http://www.w3.org/1999/xlink",e):t.setAttributeNS("http://www.w3.org/1999/xlink",e,i)}else s.startsWith("on")?i&&"function"!=typeof i?"string"==typeof i&&(i?t.setAttribute(s,i):t.removeAttribute(s)):t[s]=i:/^id$|^class$|^list$|^readonly$|^contenteditable$|^role|-|^for$/g.test(s)||n?t.getAttribute(s)!==i&&(i?t.setAttribute(s,i):t.removeAttribute(s)):t[s]!==i&&(t[s]=i);"key"===s&&i&&(h[i]=t)}e&&"function"==typeof e.ref&&window.requestAnimationFrame((()=>e.ref(t)))}function b(t,e,n=0){var s;if("string"==typeof t)return t;if(Array.isArray(t))return t.map((t=>b(t,e,n++)));let i=t;if(t&&"function"==typeof t.tag&&Object.getPrototypeOf(t.tag).__isAppRunComponent&&(i=function(t,e,n){const{tag:s,props:i,children:o}=t;let r=`_${n}`,a=i&&i.id;a?r=a:a=`_${n}${Date.now()}`;let l="section";i&&i.as&&(l=i.as,delete i.as),e.__componentCache||(e.__componentCache={});let c=e.__componentCache[r];if(c&&c instanceof s&&c.element)c.renderState(c.state);else{const t=document.createElement(l);c=e.__componentCache[r]=new s(Object.assign(Object.assign({},i),{children:o})).start(t)}if(c.mounted){const t=c.mounted(i,o,c.state);void 0!==t&&c.setState(t)}return y(c.element,i,!1),c.element}(t,e,n)),i&&Array.isArray(i.children)){const t=null===(s=i.props)||void 0===s?void 0:s._component;if(t){let e=0;i.children=i.children.map((n=>b(n,t,e++)))}else i.children=i.children.map((t=>b(t,e,n++)))}return i}const v=(t,e={})=>class extends HTMLElement{constructor(){super()}get component(){return this._component}get state(){return this._component.state}static get observedAttributes(){return(e.observedAttributes||[]).map((t=>t.toLowerCase()))}connectedCallback(){if(this.isConnected&&!this._component){const n=e||{};this._shadowRoot=n.shadow?this.attachShadow({mode:"open"}):this;const s=n.observedAttributes||[],i=s.reduce(((t,e)=>{const n=e.toLowerCase();return n!==e&&(t[n]=e),t}),{});this._attrMap=t=>i[t]||t;const o={};Array.from(this.attributes).forEach((t=>o[this._attrMap(t.name)]=t.value)),s.forEach((t=>{void 0!==this[t]&&(o[t]=this[t]),Object.defineProperty(this,t,{get:()=>o[t],set(e){this.attributeChangedCallback(t,o[t],e)},configurable:!0,enumerable:!0})})),requestAnimationFrame((()=>{const e=this.children?Array.from(this.children):[];if(e.forEach((t=>t.parentElement.removeChild(t))),this._component=new t(Object.assign(Object.assign({},o),{children:e})).mount(this._shadowRoot,n),this._component._props=o,this._component.dispatchEvent=this.dispatchEvent.bind(this),this._component.mounted){const t=this._component.mounted(o,e,this._component.state);void 0!==t&&(this._component.state=t)}this.on=this._component.on.bind(this._component),this.run=this._component.run.bind(this._component),!1!==n.render&&this._component.run(".")}))}}disconnectedCallback(){var t,e,n,s;null===(e=null===(t=this._component)||void 0===t?void 0:t.unload)||void 0===e||e.call(t),null===(s=null===(n=this._component)||void 0===n?void 0:n.unmount)||void 0===s||s.call(n),this._component=null}attributeChangedCallback(t,n,s){if(this._component){const i=this._attrMap(t);this._component._props[i]=s,this._component.run("attributeChanged",i,n,s),s!==n&&!1!==e.render&&window.requestAnimationFrame((()=>{this._component.run(".")}))}}},x=(t,e,n)=>{"undefined"!=typeof customElements&&customElements.define(t,v(e,n))},_={meta:new WeakMap,defineMetadata(t,e,n){this.meta.has(n)||this.meta.set(n,{}),this.meta.get(n)[t]=e},getMetadataKeys(t){return t=Object.getPrototypeOf(t),this.meta.get(t)?Object.keys(this.meta.get(t)):[]},getMetadata(t,e){return e=Object.getPrototypeOf(e),this.meta.get(e)?this.meta.get(e)[t]:null}},k=new Map;i.find("get-components")||i.on("get-components",(t=>t.components=k));const w=t=>t;class S{constructor(e,n,s,i){this.state=e,this.view=n,this.update=s,this.options=i,this._app=new t,this._actions=[],this._global_events=[],this._history=[],this._history_idx=-1,this._history_prev=()=>{this._history_idx--,this._history_idx>=0?this.setState(this._history[this._history_idx],{render:!0,history:!1}):this._history_idx=0},this._history_next=()=>{this._history_idx++,this._history_idxthis.mount(t,Object.assign({render:!0},e))}renderState(t,e=null){if(!this.view)return;let n=e||this.view(t);if(i.debug&&i.run("debug",{component:this,_:n?".":"-",state:t,vdom:n,el:this.element}),"object"!=typeof document)return;const s="string"==typeof this.element&&this.element?document.getElementById(this.element)||document.querySelector(this.element):this.element;if(s){const t="_c";this.unload?s._component===this&&s.getAttribute(t)===this.tracking_id||(this.tracking_id=(new Date).valueOf().toString(),s.setAttribute(t,this.tracking_id),"undefined"!=typeof MutationObserver&&(this.observer||(this.observer=new MutationObserver((t=>{t[0].oldValue!==this.tracking_id&&document.body.contains(s)||(this.unload(this.state),this.observer.disconnect(),this.observer=null)}))),this.observer.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,attributeFilter:[t]}))):s.removeAttribute&&s.removeAttribute(t),s._component=this}!e&&n&&(n=l(n,this),this.options.transition&&document&&document.startViewTransition?document.startViewTransition((()=>i.render(s,n,this))):i.render(s,n,this)),this.rendered&&this.rendered(this.state)}setState(t,e={render:!0,history:!1}){if(t instanceof Promise)Promise.resolve(t).then((n=>{this.setState(n,e),this._state=t}));else{if(this._state=t,null==t)return;this.state=t,!1!==e.render&&(e.transition&&document&&document.startViewTransition?document.startViewTransition((()=>this.renderState(t))):this.renderState(t)),!1!==e.history&&this.enable_history&&(this._history=[...this._history,t],this._history_idx=this._history.length-1),"function"==typeof e.callback&&e.callback(this.state)}}mount(t=null,e){var n,s;return console.assert(!this.element,"Component already mounted."),this.options=e=Object.assign(Object.assign({},this.options),e),this.element=t,this.global_event=e.global_event,this.enable_history=!!e.history,this.enable_history&&(this.on(e.history.prev||"history-prev",this._history_prev),this.on(e.history.next||"history-next",this._history_next)),e.route&&(this.update=this.update||{},this.update[e.route]||(this.update[e.route]=w)),this.add_actions(),this.state=null!==(s=null!==(n=this.state)&&void 0!==n?n:this.model)&&void 0!==s?s:{},"function"==typeof this.state&&(this.state=this.state()),this.setState(this.state,{render:!!e.render,history:!0}),i.debug&&(k.get(t)?k.get(t).push(this):k.set(t,[this])),this}is_global_event(t){return t&&(this.global_event||this._global_events.indexOf(t)>=0||t.startsWith("#")||t.startsWith("/")||t.startsWith("@"))}add_action(t,e,n={}){e&&"function"==typeof e&&(n.global&&this._global_events.push(t),this.on(t,((...s)=>{i.debug&&i.run("debug",{component:this,_:">",event:t,p:s,current_state:this.state,options:n});const o=e(this.state,...s);i.debug&&i.run("debug",{component:this,_:"<",event:t,p:s,newState:o,state:this.state,options:n}),this.setState(o,n)}),n))}add_actions(){const t=this.update||{};_.getMetadataKeys(this).forEach((e=>{if(e.startsWith("apprun-update:")){const n=_.getMetadata(e,this);t[n.name]=[this[n.key].bind(this),n.options]}}));const e={};Array.isArray(t)?t.forEach((t=>{const[n,s,i]=t;n.toString().split(",").forEach((t=>e[t.trim()]=[s,i]))})):Object.keys(t).forEach((n=>{const s=t[n];("function"==typeof s||Array.isArray(s))&&n.split(",").forEach((t=>e[t.trim()]=s))})),e["."]||(e["."]=w),Object.keys(e).forEach((t=>{const n=e[t];"function"==typeof n?this.add_action(t,n):Array.isArray(n)&&this.add_action(t,n[0],n[1])}))}run(t,...e){if(this.state instanceof Promise)return Promise.resolve(this.state).then((n=>{this.state=n,this.run(t,...e)}));{const n=t.toString();return this.is_global_event(n)?i.run(n,...e):this._app.run(n,...e)}}on(t,e,n){const s=t.toString();return this._actions.push({name:s,fn:e}),this.is_global_event(s)?i.on(s,e,n):this._app.on(s,e,n)}query(t,...e){const n=t.toString();return this.is_global_event(n)?i.query(n,...e):this._app.query(n,...e)}unmount(){var t;null===(t=this.observer)||void 0===t||t.disconnect(),this._actions.forEach((t=>{const{name:e,fn:n}=t;this.is_global_event(e)?i.off(e,n):this._app.off(e,n)}))}}S.__isAppRunComponent=!0;const O="//",L="///",E=t=>{if(t||(t="#"),t.startsWith("#")){const[e,...n]=t.split("/");i.run(e,...n)||i.run(L,e,...n),i.run(O,e,...n)}else if(t.startsWith("/")){const[e,n,...s]=t.split("/");i.run("/"+n,...s)||i.run(L,"/"+n,...s),i.run(O,"/"+n,...s)}else i.run(t)||i.run(L,t),i.run(O,t)};i.h=i.createElement=function(t,e,...n){const s=u(n);if("string"==typeof t)return{tag:t,props:e,children:s};if(Array.isArray(t))return t;if(void 0===t&&n)return s;if(Object.getPrototypeOf(t).__isAppRunComponent)return{tag:t,props:e,children:s};if("function"==typeof t)return t(e,s);throw new Error(`Unknown tag in vdom ${t}`)},i.render=(t,e,n={})=>{null!=e&&!1!==e&&function(t,e,n={}){if(null==e||!1===e)return;if(e=b(e,n),!t)return;const s="SVG"===t.nodeName;Array.isArray(e)?d(t,e,s):d(t,[e],s)}("string"==typeof t&&t?document.getElementById(t)||document.querySelector(t):t,e=l(e,n),n)},i.Fragment=function(t,...e){return u(e)},i.webComponent=x,i.safeHTML=g,i.start=(t,e,n,s,i)=>{const o=Object.assign({render:!0,global_event:!0},i),r=new S(e,n,s);return i&&i.rendered&&(r.rendered=i.rendered),r.mount(t,o),r};const C=t=>{};i.on("$",C),i.on("debug",(t=>C)),i.on(O,C),i.on("#",C),i.route=E,i.on("route",(t=>i.route&&i.route(t))),"object"==typeof document&&document.addEventListener("DOMContentLoaded",(()=>{i.route===E&&(window.onpopstate=()=>E(location.hash),document.body.hasAttribute("apprun-no-init")||i["no-init-route"]||E(location.hash))}));const N=i;"object"==typeof window&&(window.Component=S,window._React=window.React,window.React=i,window.on=function(t,e={}){return function(n,s){const i=t?t.toString():s;_.defineMetadata(`apprun-update:${i}`,{name:i,key:s,options:e},n)}},window.customElement=function(t,e){return function(n){return x(t,n,e),n}},window.safeHTML=g);const j={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}};class P{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(t,e)}init(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=e.prefix||"i18next:",this.logger=t||j,this.options=e,this.debug=e.debug}log(){for(var t=arguments.length,e=new Array(t),n=0;n{this.observers[t]=this.observers[t]||[],this.observers[t].push(e)})),this}off(t,e){this.observers[t]&&(e?this.observers[t]=this.observers[t].filter((t=>t!==e)):delete this.observers[t])}emit(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),s=1;s{t(...n)})),this.observers["*"]&&[].concat(this.observers["*"]).forEach((e=>{e.apply(e,[t,...n])}))}}function A(){let t,e;const n=new Promise(((n,s)=>{t=n,e=s}));return n.resolve=t,n.reject=e,n}function T(t){return null==t?"":""+t}function D(t,e,n){function s(t){return t&&t.indexOf("###")>-1?t.replace(/###/g,"."):t}function i(){return!t||"string"==typeof t}const o="string"!=typeof e?[].concat(e):e.split(".");for(;o.length>1;){if(i())return{};const e=s(o.shift());!t[e]&&n&&(t[e]=new n),t=Object.prototype.hasOwnProperty.call(t,e)?t[e]:{}}return i()?{}:{obj:t,k:s(o.shift())}}function F(t,e,n){const{obj:s,k:i}=D(t,e,Object);s[i]=n}function M(t,e){const{obj:n,k:s}=D(t,e);if(n)return n[s]}function I(t,e,n){for(const s in e)"__proto__"!==s&&"constructor"!==s&&(s in t?"string"==typeof t[s]||t[s]instanceof String||"string"==typeof e[s]||e[s]instanceof String?n&&(t[s]=e[s]):I(t[s],e[s],n):t[s]=e[s]);return t}function V(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var U={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function H(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,(t=>U[t])):t}const K=[" ",",","?","!",";"];function z(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!t)return;if(t[e])return t[e];const s=e.split(n);let i=t;for(let t=0;tt+o;)o++,r=s.slice(t,t+o).join(n),a=i[r];if(void 0===a)return;if(null===a)return null;if(e.endsWith(r)){if("string"==typeof a)return a;if(r&&"string"==typeof a[r])return a[r]}const l=s.slice(t+o).join(n);return l?z(a,l,n):void 0}i=i[s[t]]}return i}function B(t){return t&&t.indexOf("_")>0?t.replace("_","-"):t}class J extends ${constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const e=this.options.ns.indexOf(t);e>-1&&this.options.ns.splice(e,1)}getResource(t,e,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=void 0!==s.keySeparator?s.keySeparator:this.options.keySeparator,o=void 0!==s.ignoreJSONStructure?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let r=[t,e];n&&"string"!=typeof n&&(r=r.concat(n)),n&&"string"==typeof n&&(r=r.concat(i?n.split(i):n)),t.indexOf(".")>-1&&(r=t.split("."));const a=M(this.data,r);return a||!o||"string"!=typeof n?a:z(this.data&&this.data[t]&&this.data[t][e],n,i)}addResource(t,e,n,s){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const o=void 0!==i.keySeparator?i.keySeparator:this.options.keySeparator;let r=[t,e];n&&(r=r.concat(o?n.split(o):n)),t.indexOf(".")>-1&&(r=t.split("."),s=e,e=r[1]),this.addNamespaces(e),F(this.data,r,s),i.silent||this.emit("added",t,e,n,s)}addResources(t,e,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const s in n)"string"!=typeof n[s]&&"[object Array]"!==Object.prototype.toString.apply(n[s])||this.addResource(t,e,s,n[s],{silent:!0});s.silent||this.emit("added",t,e,n)}addResourceBundle(t,e,n,s,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},r=[t,e];t.indexOf(".")>-1&&(r=t.split("."),s=n,n=e,e=r[1]),this.addNamespaces(e);let a=M(this.data,r)||{};s?I(a,n,i):a={...a,...n},F(this.data,r,a),o.silent||this.emit("added",t,e,n)}removeResourceBundle(t,e){this.hasResourceBundle(t,e)&&delete this.data[t][e],this.removeNamespaces(e),this.emit("removed",t,e)}hasResourceBundle(t,e){return void 0!==this.getResource(t,e)}getResourceBundle(t,e){return e||(e=this.options.defaultNS),"v1"===this.options.compatibilityAPI?{...this.getResource(t,e)}:this.getResource(t,e)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const e=this.getDataByLanguage(t);return!!(e&&Object.keys(e)||[]).find((t=>e[t]&&Object.keys(e[t]).length>0))}toJSON(){return this.data}}var W={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,s,i){return t.forEach((t=>{this.processors[t]&&(e=this.processors[t].process(e,n,s,i))})),e}};const q={};class Y extends ${constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var n,s;super(),n=t,s=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach((t=>{n[t]&&(s[t]=n[t])})),this.options=e,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=R.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==t)return!1;const n=this.resolve(t,e);return n&&void 0!==n.res}extractFromKey(t,e){let n=void 0!==e.nsSeparator?e.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const s=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator;let i=e.ns||this.options.defaultNS||[];const o=n&&t.indexOf(n)>-1,r=!(this.options.userDefinedKeySeparator||e.keySeparator||this.options.userDefinedNsSeparator||e.nsSeparator||function(t,e,n){e=e||"",n=n||"";const s=K.filter((t=>e.indexOf(t)<0&&n.indexOf(t)<0));if(0===s.length)return!0;const i=new RegExp(`(${s.map((t=>"?"===t?"\\?":t)).join("|")})`);let o=!i.test(t);if(!o){const e=t.indexOf(n);e>0&&!i.test(t.substring(0,e))&&(o=!0)}return o}(t,n,s));if(o&&!r){const e=t.match(this.interpolator.nestingRegexp);if(e&&e.length>0)return{key:t,namespaces:i};const o=t.split(n);(n!==s||n===s&&this.options.ns.indexOf(o[0])>-1)&&(i=o.shift()),t=o.join(s)}return"string"==typeof i&&(i=[i]),{key:t,namespaces:i}}translate(t,e,n){if("object"!=typeof e&&this.options.overloadTranslationOptionHandler&&(e=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof e&&(e={...e}),e||(e={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);const s=void 0!==e.returnDetails?e.returnDetails:this.options.returnDetails,i=void 0!==e.keySeparator?e.keySeparator:this.options.keySeparator,{key:o,namespaces:r}=this.extractFromKey(t[t.length-1],e),a=r[r.length-1],l=e.lng||this.language,c=e.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&"cimode"===l.toLowerCase()){if(c){const t=e.nsSeparator||this.options.nsSeparator;return s?{res:`${a}${t}${o}`,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(e)}:`${a}${t}${o}`}return s?{res:o,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(e)}:o}const u=this.resolve(t,e);let h=u&&u.res;const p=u&&u.usedKey||o,d=u&&u.exactUsedKey||o,g=Object.prototype.toString.apply(h),f=void 0!==e.joinArrays?e.joinArrays:this.options.joinArrays,m=!this.i18nFormat||this.i18nFormat.handleAsObject;if(m&&h&&"string"!=typeof h&&"boolean"!=typeof h&&"number"!=typeof h&&["[object Number]","[object Function]","[object RegExp]"].indexOf(g)<0&&("string"!=typeof f||"[object Array]"!==g)){if(!e.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const t=this.options.returnedObjectHandler?this.options.returnedObjectHandler(p,h,{...e,ns:r}):`key '${o} (${this.language})' returned an object instead of string.`;return s?(u.res=t,u.usedParams=this.getUsedParamsDetails(e),u):t}if(i){const t="[object Array]"===g,n=t?[]:{},s=t?d:p;for(const t in h)if(Object.prototype.hasOwnProperty.call(h,t)){const o=`${s}${i}${t}`;n[t]=this.translate(o,{...e,joinArrays:!1,ns:r}),n[t]===o&&(n[t]=h[t])}h=n}}else if(m&&"string"==typeof f&&"[object Array]"===g)h=h.join(f),h&&(h=this.extendTranslation(h,t,e,n));else{let s=!1,r=!1;const c=void 0!==e.count&&"string"!=typeof e.count,p=Y.hasDefaultValue(e),d=c?this.pluralResolver.getSuffix(l,e.count,e):"",g=e.ordinal&&c?this.pluralResolver.getSuffix(l,e.count,{ordinal:!1}):"",f=e[`defaultValue${d}`]||e[`defaultValue${g}`]||e.defaultValue;!this.isValidLookup(h)&&p&&(s=!0,h=f),this.isValidLookup(h)||(r=!0,h=o);const m=(e.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&r?void 0:h,y=p&&f!==h&&this.options.updateMissing;if(r||s||y){if(this.logger.log(y?"updateKey":"missingKey",l,a,o,y?f:h),i){const t=this.resolve(o,{...e,keySeparator:!1});t&&t.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let t=[];const n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,e.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let e=0;e{const i=p&&s!==h?s:m;this.options.missingKeyHandler?this.options.missingKeyHandler(t,a,n,i,y,e):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(t,a,n,i,y,e),this.emit("missingKey",t,a,n,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&c?t.forEach((t=>{this.pluralResolver.getSuffixes(t,e).forEach((n=>{s([t],o+n,e[`defaultValue${n}`]||f)}))})):s(t,o,f))}h=this.extendTranslation(h,t,e,u,n),r&&h===o&&this.options.appendNamespaceToMissingKey&&(h=`${a}:${o}`),(r||s)&&this.options.parseMissingKeyHandler&&(h="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${a}:${o}`:o,s?h:void 0):this.options.parseMissingKeyHandler(h))}return s?(u.res=h,u.usedParams=this.getUsedParamsDetails(e),u):h}extendTranslation(t,e,n,s,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const r="string"==typeof t&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let a;if(r){const e=t.match(this.interpolator.nestingRegexp);a=e&&e.length}let l=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),t=this.interpolator.interpolate(t,l,n.lng||this.language,n),r){const e=t.match(this.interpolator.nestingRegexp);a<(e&&e.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&s&&s.res&&(n.lng=s.usedLng),!1!==n.nest&&(t=this.interpolator.nest(t,(function(){for(var t=arguments.length,s=new Array(t),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach((t=>{if(this.isValidLookup(e))return;const a=this.extractFromKey(t,r),l=a.key;n=l;let c=a.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const u=void 0!==r.count&&"string"!=typeof r.count,h=u&&!r.ordinal&&0===r.count&&this.pluralResolver.shouldUseIntlApi(),p=void 0!==r.context&&("string"==typeof r.context||"number"==typeof r.context)&&""!==r.context,d=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);c.forEach((t=>{this.isValidLookup(e)||(o=t,!q[`${d[0]}-${t}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(o)&&(q[`${d[0]}-${t}`]=!0,this.logger.warn(`key "${n}" for languages "${d.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),d.forEach((n=>{if(this.isValidLookup(e))return;i=n;const o=[l];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(o,l,n,t,r);else{let t;u&&(t=this.pluralResolver.getSuffix(n,r.count,r));const e=`${this.options.pluralSeparator}zero`,s=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(o.push(l+t),r.ordinal&&0===t.indexOf(s)&&o.push(l+t.replace(s,this.options.pluralSeparator)),h&&o.push(l+e)),p){const n=`${l}${this.options.contextSeparator}${r.context}`;o.push(n),u&&(o.push(n+t),r.ordinal&&0===t.indexOf(s)&&o.push(n+t.replace(s,this.options.pluralSeparator)),h&&o.push(n+e))}}let a;for(;a=o.pop();)this.isValidLookup(e)||(s=a,e=this.getResource(n,t,a,r))})))}))})),{res:e,usedKey:n,exactUsedKey:s,usedLng:i,usedNS:o}}isValidLookup(t){return!(void 0===t||!this.options.returnNull&&null===t||!this.options.returnEmptyString&&""===t)}getResource(t,e,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,e,n,s):this.resourceStore.getResource(t,e,n,s)}getUsedParamsDetails(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=t.replace&&"string"!=typeof t.replace;let s=n?t.replace:t;if(n&&void 0!==t.count&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const t of e)delete s[t]}return s}static hasDefaultValue(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)&&"defaultValue"===e.substring(0,12)&&void 0!==t[e])return!0;return!1}}function G(t){return t.charAt(0).toUpperCase()+t.slice(1)}class Q{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=R.create("languageUtils")}getScriptPartFromCode(t){if(!(t=B(t))||t.indexOf("-")<0)return null;const e=t.split("-");return 2===e.length?null:(e.pop(),"x"===e[e.length-1].toLowerCase()?null:this.formatLanguageCode(e.join("-")))}getLanguagePartFromCode(t){if(!(t=B(t))||t.indexOf("-")<0)return t;const e=t.split("-");return this.formatLanguageCode(e[0])}formatLanguageCode(t){if("string"==typeof t&&t.indexOf("-")>-1){const e=["hans","hant","latn","cyrl","cans","mong","arab"];let n=t.split("-");return this.options.lowerCaseLng?n=n.map((t=>t.toLowerCase())):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=G(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),e.indexOf(n[1].toLowerCase())>-1&&(n[1]=G(n[1].toLowerCase())),e.indexOf(n[2].toLowerCase())>-1&&(n[2]=G(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let e;return t.forEach((t=>{if(e)return;const n=this.formatLanguageCode(t);this.options.supportedLngs&&!this.isSupportedCode(n)||(e=n)})),!e&&this.options.supportedLngs&&t.forEach((t=>{if(e)return;const n=this.getLanguagePartFromCode(t);if(this.isSupportedCode(n))return e=n;e=this.options.supportedLngs.find((t=>t===n?t:t.indexOf("-")<0&&n.indexOf("-")<0?void 0:0===t.indexOf(n)?t:void 0))})),e||(e=this.getFallbackCodes(this.options.fallbackLng)[0]),e}getFallbackCodes(t,e){if(!t)return[];if("function"==typeof t&&(t=t(e)),"string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!e)return t.default||[];let n=t[e];return n||(n=t[this.getScriptPartFromCode(e)]),n||(n=t[this.formatLanguageCode(e)]),n||(n=t[this.getLanguagePartFromCode(e)]),n||(n=t.default),n||[]}toResolveHierarchy(t,e){const n=this.getFallbackCodes(e||this.options.fallbackLng||[],t),s=[],i=t=>{t&&(this.isSupportedCode(t)?s.push(t):this.logger.warn(`rejecting language code not found in supportedLngs: ${t}`))};return"string"==typeof t&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?("languageOnly"!==this.options.load&&i(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&i(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&i(this.getLanguagePartFromCode(t))):"string"==typeof t&&i(this.formatLanguageCode(t)),n.forEach((t=>{s.indexOf(t)<0&&i(this.formatLanguageCode(t))})),s}}let Z=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],X={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(1==t||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0==t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)}};const tt=["v1","v2","v3"],et=["v4"],nt={zero:0,one:1,two:2,few:3,many:4,other:5};class st{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=t,this.options=e,this.logger=R.create("pluralResolver"),this.options.compatibilityJSON&&!et.includes(this.options.compatibilityJSON)||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=function(){const t={};return Z.forEach((e=>{e.lngs.forEach((n=>{t[n]={numbers:e.nr,plurals:X[e.fc]}}))})),t}()}addRule(t,e){this.rules[t]=e}getRule(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(B(t),{type:e.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}needsPlural(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(t,e);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(t,n).map((t=>`${e}${t}`))}getSuffixes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(t,e);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort(((t,e)=>nt[t]-nt[e])).map((t=>`${this.options.prepend}${e.ordinal?`ordinal${this.options.prepend}`:""}${t}`)):n.numbers.map((n=>this.getSuffix(t,n,e))):[]}getSuffix(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const s=this.getRule(t,n);return s?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s.select(e)}`:this.getSuffixRetroCompatible(s,e):(this.logger.warn(`no plural rule found for: ${t}`),"")}getSuffixRetroCompatible(t,e){const n=t.noAbs?t.plurals(e):t.plurals(Math.abs(e));let s=t.numbers[n];this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]&&(2===s?s="plural":1===s&&(s=""));const i=()=>this.options.prepend&&s.toString()?this.options.prepend+s.toString():s.toString();return"v1"===this.options.compatibilityJSON?1===s?"":"number"==typeof s?`_plural_${s.toString()}`:i():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]?i():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!tt.includes(this.options.compatibilityJSON)}}function it(t,e,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=function(t,e,n){const s=M(t,n);return void 0!==s?s:M(e,n)}(t,e,n);return!o&&i&&"string"==typeof n&&(o=z(t,n,s),void 0===o&&(o=z(e,n,s))),o}class ot{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=R.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||(t=>t),this.init(t)}init(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const e=t.interpolation;this.escape=void 0!==e.escape?e.escape:H,this.escapeValue=void 0===e.escapeValue||e.escapeValue,this.useRawValueToEscape=void 0!==e.useRawValueToEscape&&e.useRawValueToEscape,this.prefix=e.prefix?V(e.prefix):e.prefixEscaped||"{{",this.suffix=e.suffix?V(e.suffix):e.suffixEscaped||"}}",this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||",",this.unescapePrefix=e.unescapeSuffix?"":e.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":e.unescapeSuffix||"",this.nestingPrefix=e.nestingPrefix?V(e.nestingPrefix):e.nestingPrefixEscaped||V("$t("),this.nestingSuffix=e.nestingSuffix?V(e.nestingSuffix):e.nestingSuffixEscaped||V(")"),this.nestingOptionsSeparator=e.nestingOptionsSeparator?e.nestingOptionsSeparator:e.nestingOptionsSeparator||",",this.maxReplaces=e.maxReplaces?e.maxReplaces:1e3,this.alwaysFormat=void 0!==e.alwaysFormat&&e.alwaysFormat,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(t,"g");const e=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(e,"g");const n=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(n,"g")}interpolate(t,e,n,s){let i,o,r;const a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(t){return t.replace(/\$/g,"$$$$")}const c=t=>{if(t.indexOf(this.formatSeparator)<0){const i=it(e,a,t,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(i,void 0,n,{...s,...e,interpolationkey:t}):i}const i=t.split(this.formatSeparator),o=i.shift().trim(),r=i.join(this.formatSeparator).trim();return this.format(it(e,a,o,this.options.keySeparator,this.options.ignoreJSONStructure),r,n,{...s,...e,interpolationkey:o})};this.resetRegExp();const u=s&&s.missingInterpolationHandler||this.options.missingInterpolationHandler,h=s&&s.interpolation&&void 0!==s.interpolation.skipOnVariables?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:t=>l(t)},{regex:this.regexp,safeValue:t=>this.escapeValue?l(this.escape(t)):l(t)}].forEach((e=>{for(r=0;i=e.regex.exec(t);){const n=i[1].trim();if(o=c(n),void 0===o)if("function"==typeof u){const e=u(t,i,s);o="string"==typeof e?e:""}else if(s&&Object.prototype.hasOwnProperty.call(s,n))o="";else{if(h){o=i[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${t}`),o=""}else"string"==typeof o||this.useRawValueToEscape||(o=T(o));const a=e.safeValue(o);if(t=t.replace(i[0],a),h?(e.regex.lastIndex+=o.length,e.regex.lastIndex-=i[0].length):e.regex.lastIndex=0,r++,r>=this.maxReplaces)break}})),t}nest(t,e){let n,s,i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function r(t,e){const n=this.nestingOptionsSeparator;if(t.indexOf(n)<0)return t;const s=t.split(new RegExp(`${n}[ ]*{`));let o=`{${s[1]}`;t=s[0],o=this.interpolate(o,i);const r=o.match(/'/g),a=o.match(/"/g);(r&&r.length%2==0&&!a||a.length%2!=0)&&(o=o.replace(/'/g,'"'));try{i=JSON.parse(o),e&&(i={...e,...i})}catch(e){return this.logger.warn(`failed parsing options string in nesting for key ${t}`,e),`${t}${n}${o}`}return delete i.defaultValue,t}for(;n=this.nestingRegexp.exec(t);){let a=[];i={...o},i=i.replace&&"string"!=typeof i.replace?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let l=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const t=n[1].split(this.formatSeparator).map((t=>t.trim()));n[1]=t.shift(),a=t,l=!0}if(s=e(r.call(this,n[1].trim(),i),i),s&&n[0]===t&&"string"!=typeof s)return s;"string"!=typeof s&&(s=T(s)),s||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${t}`),s=""),l&&(s=a.reduce(((t,e)=>this.format(t,e,o.lng,{...o,interpolationkey:n[1].trim()})),s.trim())),t=t.replace(n[0],s),this.regexp.lastIndex=0}return t}}function rt(t){const e={};return function(n,s,i){const o=s+JSON.stringify(i);let r=e[o];return r||(r=t(B(s),i),e[o]=r),r(n)}}class at{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=R.create("formatter"),this.options=t,this.formats={number:rt(((t,e)=>{const n=new Intl.NumberFormat(t,{...e});return t=>n.format(t)})),currency:rt(((t,e)=>{const n=new Intl.NumberFormat(t,{...e,style:"currency"});return t=>n.format(t)})),datetime:rt(((t,e)=>{const n=new Intl.DateTimeFormat(t,{...e});return t=>n.format(t)})),relativetime:rt(((t,e)=>{const n=new Intl.RelativeTimeFormat(t,{...e});return t=>n.format(t,e.range||"day")})),list:rt(((t,e)=>{const n=new Intl.ListFormat(t,{...e});return t=>n.format(t)}))},this.init(t)}init(t){const e=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=e.formatSeparator?e.formatSeparator:e.formatSeparator||","}add(t,e){this.formats[t.toLowerCase().trim()]=e}addCached(t,e){this.formats[t.toLowerCase().trim()]=rt(e)}format(t,e,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return e.split(this.formatSeparator).reduce(((t,e)=>{const{formatName:i,formatOptions:o}=function(t){let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const s=t.split("(");e=s[0].toLowerCase().trim();const i=s[1].substring(0,s[1].length-1);"currency"===e&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):"relativetime"===e&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach((t=>{if(!t)return;const[e,...s]=t.split(":"),i=s.join(":").trim().replace(/^'+|'+$/g,"");n[e.trim()]||(n[e.trim()]=i),"false"===i&&(n[e.trim()]=!1),"true"===i&&(n[e.trim()]=!0),isNaN(i)||(n[e.trim()]=parseInt(i,10))}))}return{formatName:e,formatOptions:n}}(e);if(this.formats[i]){let e=t;try{const r=s&&s.formatParams&&s.formatParams[s.interpolationkey]||{},a=r.locale||r.lng||s.locale||s.lng||n;e=this.formats[i](t,a,{...o,...s,...r})}catch(t){this.logger.warn(t)}return e}return this.logger.warn(`there was no format function for ${i}`),t}),t)}}class lt extends ${constructor(t,e,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=t,this.store=e,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=R.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,s.backend,s)}queueLoad(t,e,n,s){const i={},o={},r={},a={};return t.forEach((t=>{let s=!0;e.forEach((e=>{const r=`${t}|${e}`;!n.reload&&this.store.hasResourceBundle(t,e)?this.state[r]=2:this.state[r]<0||(1===this.state[r]?void 0===o[r]&&(o[r]=!0):(this.state[r]=1,s=!1,void 0===o[r]&&(o[r]=!0),void 0===i[r]&&(i[r]=!0),void 0===a[e]&&(a[e]=!0)))})),s||(r[t]=!0)})),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(r),toLoadNamespaces:Object.keys(a)}}loaded(t,e,n){const s=t.split("|"),i=s[0],o=s[1];e&&this.emit("failedLoading",i,o,e),n&&this.store.addResourceBundle(i,o,n),this.state[t]=e?-1:2;const r={};this.queue.forEach((n=>{!function(t,e,n,s){const{obj:i,k:o}=D(t,e,Object);i[o]=i[o]||[],i[o].push(n)}(n.loaded,[i],o),function(t,e){void 0!==t.pending[e]&&(delete t.pending[e],t.pendingCount--)}(n,t),e&&n.errors.push(e),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((t=>{r[t]||(r[t]={});const e=n.loaded[t];e.length&&e.forEach((e=>{void 0===r[t][e]&&(r[t][e]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",r),this.queue=this.queue.filter((t=>!t.done))}read(t,e,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:t,ns:e,fcName:n,tried:s,wait:i,callback:o});this.readingCalls++;const r=(r,a)=>{if(this.readingCalls--,this.waitingReads.length>0){const t=this.waitingReads.shift();this.read(t.lng,t.ns,t.fcName,t.tried,t.wait,t.callback)}r&&a&&s{this.read.call(this,t,e,n,s+1,2*i,o)}),i):o(r,a)},a=this.backend[n].bind(this.backend);if(2!==a.length)return a(t,e,r);try{const n=a(t,e);n&&"function"==typeof n.then?n.then((t=>r(null,t))).catch(r):r(null,n)}catch(t){r(t)}}prepareLoading(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof e&&(e=[e]);const i=this.queueLoad(t,e,n,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach((t=>{this.loadOne(t)}))}load(t,e,n){this.prepareLoading(t,e,{},n)}reload(t,e,n){this.prepareLoading(t,e,{reload:!0},n)}loadOne(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=t.split("|"),s=n[0],i=n[1];this.read(s,i,"read",void 0,void 0,((n,o)=>{n&&this.logger.warn(`${e}loading namespace ${i} for language ${s} failed`,n),!n&&o&&this.logger.log(`${e}loaded namespace ${i} for language ${s}`,o),this.loaded(t,n,o)}))}saveMissing(t,e,n,s,i){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(e))this.logger.warn(`did not save key "${n}" as the namespace "${e}" 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!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){const a={...o,isUpdate:i},l=this.backend.create.bind(this.backend);if(l.length<6)try{let i;i=5===l.length?l(t,e,n,s,a):l(t,e,n,s),i&&"function"==typeof i.then?i.then((t=>r(null,t))).catch(r):r(null,i)}catch(t){r(t)}else l(t,e,n,s,r,a)}t&&t[0]&&this.store.addResource(t[0],e,n,s)}}}function ct(){return{debug:!1,initImmediate:!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:function(t){let e={};if("object"==typeof t[1]&&(e=t[1]),"string"==typeof t[1]&&(e.defaultValue=t[1]),"string"==typeof t[2]&&(e.tDescription=t[2]),"object"==typeof t[2]||"object"==typeof t[3]){const n=t[3]||t[2];Object.keys(n).forEach((t=>{e[t]=n[t]}))}return e},interpolation:{escapeValue:!0,format:(t,e,n,s)=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function ut(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function ht(){}class pt extends ${constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=ut(t),this.services={},this.logger=R,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((t=>{"function"==typeof n[t]&&(n[t]=n[t].bind(n))})),e&&!this.isInitialized&&!t.isClone){if(!this.options.initImmediate)return this.init(t,e),this;setTimeout((()=>{this.init(t,e)}),0)}}init(){var t=this;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof e&&(n=e,e={}),!e.defaultNS&&!1!==e.defaultNS&&e.ns&&("string"==typeof e.ns?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const s=ct();function i(t){return t?"function"==typeof t?new t:t:null}if(this.options={...s,...this.options,...ut(e)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...s.interpolation,...this.options.interpolation}),void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),!this.options.isClone){let e;this.modules.logger?R.init(i(this.modules.logger),this.options):R.init(null,this.options),this.modules.formatter?e=this.modules.formatter:"undefined"!=typeof Intl&&(e=at);const n=new Q(this.options);this.store=new J(this.options.resources,this.options);const o=this.services;o.logger=R,o.resourceStore=this.store,o.languageUtils=n,o.pluralResolver=new st(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!e||this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format||(o.formatter=i(e),o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new ot(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new lt(i(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",(function(e){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i1?n-1:0),i=1;i{t.init&&t.init(this)}))}if(this.format=this.options.interpolation.format,n||(n=ht),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const t=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);t.length>0&&"dev"!==t[0]&&(this.options.lng=t[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((e=>{this[e]=function(){return t.store[e](...arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((e=>{this[e]=function(){return t.store[e](...arguments),t}}));const o=A(),r=()=>{const t=(t,e)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(e),n(t,e)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return t(null,this.t.bind(this));this.changeLanguage(this.options.lng,t)};return this.options.resources||!this.options.initImmediate?r():setTimeout(r,0),o}loadResources(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ht;const n="string"==typeof t?t:this.language;if("function"==typeof t&&(e=t),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return e();const t=[],s=e=>{e&&"cimode"!==e&&this.services.languageUtils.toResolveHierarchy(e).forEach((e=>{"cimode"!==e&&t.indexOf(e)<0&&t.push(e)}))};n?s(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((t=>s(t))),this.options.preload&&this.options.preload.forEach((t=>s(t))),this.services.backendConnector.load(t,this.options.ns,(t=>{t||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),e(t)}))}else e(null)}reloadResources(t,e,n){const s=A();return t||(t=this.languages),e||(e=this.options.ns),n||(n=ht),this.services.backendConnector.reload(t,e,(t=>{s.resolve(),n(t)})),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&W.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}setResolvedLanguage(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1))for(let t=0;t-1)&&this.store.hasLanguageSomeTranslations(e)){this.resolvedLanguage=e;break}}}changeLanguage(t,e){var n=this;this.isLanguageChangingTo=t;const s=A();this.emit("languageChanging",t);const i=t=>{this.language=t,this.languages=this.services.languageUtils.toResolveHierarchy(t),this.resolvedLanguage=void 0,this.setResolvedLanguage(t)},o=(t,o)=>{o?(i(o),this.translator.changeLanguage(o),this.isLanguageChangingTo=void 0,this.emit("languageChanged",o),this.logger.log("languageChanged",o)):this.isLanguageChangingTo=void 0,s.resolve((function(){return n.t(...arguments)})),e&&e(t,(function(){return n.t(...arguments)}))},r=e=>{t||e||!this.services.languageDetector||(e=[]);const n="string"==typeof e?e:this.services.languageUtils.getBestMatchFromCodes(e);n&&(this.language||i(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,(t=>{o(t,n)}))};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(r):this.services.languageDetector.detect(r):r(t):r(this.services.languageDetector.detect()),s}getFixedT(t,e,n){var s=this;const i=function(t,e){let o;if("object"!=typeof e){for(var r=arguments.length,a=new Array(r>2?r-2:0),l=2;l`${o.keyPrefix}${c}${t}`)):o.keyPrefix?`${o.keyPrefix}${c}${t}`:t,s.t(u,o)};return"string"==typeof t?i.lng=t:i.lngs=t,i.ns=e,i.keyPrefix=n,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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 n=e.lng||this.resolvedLanguage||this.languages[0],s=!!this.options&&this.options.fallbackLng,i=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const o=(t,e)=>{const n=this.services.backendConnector.state[`${t}|${e}`];return-1===n||2===n};if(e.precheck){const t=e.precheck(this,o);if(void 0!==t)return t}return!(!this.hasResourceBundle(n,t)&&this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages)&&(!o(n,t)||s&&!o(i,t)))}loadNamespaces(t,e){const n=A();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach((t=>{this.options.ns.indexOf(t)<0&&this.options.ns.push(t)})),this.loadResources((t=>{n.resolve(),e&&e(t)})),n):(e&&e(),Promise.resolve())}loadLanguages(t,e){const n=A();"string"==typeof t&&(t=[t]);const s=this.options.preload||[],i=t.filter((t=>s.indexOf(t)<0));return i.length?(this.options.preload=s.concat(i),this.loadResources((t=>{n.resolve(),e&&e(t)})),n):(e&&e(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!t)return"rtl";const e=this.services&&this.services.languageUtils||new Q(ct());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(e.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new pt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ht;const n=t.forkResourceStore;n&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},i=new pt(s);return void 0===t.debug&&void 0===t.prefix||(i.logger=i.logger.clone(t)),["store","services","language"].forEach((t=>{i[t]=this[t]})),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},n&&(i.store=new J(this.store.data,s),i.services.resourceStore=i.store),i.translator=new Y(i.services,s),i.translator.on("*",(function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),s=1;sN.createElement("intl-message",{i18next:dt,...t}),yt=t=>N.createElement("intl-datetime",{i18next:dt,...t}),bt=t=>N.createElement("intl-relative-time",{i18next:dt,...t}),vt=t=>N.createElement("intl-number",{i18next:dt,...t}),xt={lng:(t,e)=>(dt.changeLanguage(e),e)};N.start(document.body,ft,(t=>N.createElement("section",null,N.createElement("h1",null,"demo with JSX"),N.createElement("p",null,N.createElement(mt,{label:"Selected language"})," ",N.createElement("strong",null,t)),N.createElement("button",{onclick:()=>N.run("lng","en-GB")},"en-GB"),N.createElement("button",{onclick:()=>N.run("lng","en-US")},"en-US"),N.createElement("button",{onclick:()=>N.run("lng","fr")},"fr"),N.createElement("button",{onclick:()=>N.run("lng","ar")},"ar"),N.createElement("button",{onclick:()=>N.run("lng","zh-CN")},"zh-CN"),N.createElement("section",null,N.createElement("h2",null,"intl-message"),N.createElement(mt,{label:"deep",value:{key:"Hello",val:"World"}}),N.createElement(mt,{label:"html",value:'dangerous'}),N.createElement(mt,{label:"html",dangerous:!0,value:'dangerous'}),N.createElement(mt,{label:"item",count:1}),N.createElement(mt,{label:"item",count:10}),N.createElement("p",null,N.createElement("input",{placeholder:(0,gt.NM)({i18next:dt,key:"placeholder"})}))),N.createElement("section",null,N.createElement("h2",null,"intl-datetime"),N.createElement(yt,null),N.createElement(yt,{value:"2020-03-12"}),N.createElement(yt,{value:new Date("2020-03-12"),lng:"en-US"}),N.createElement(yt,{value:"2020-03-12",options:{weekday:"short",year:"numeric",month:"long",day:"numeric"}}),N.createElement(yt,{value:"2020-03-12 12:00:00",date:!0,time:!0,timeZone:"Asia/Tokyo"}),N.createElement("p",null,'as text: "',(0,gt.YC)({i18next:dt,time:!0,date:!0}),'"')),N.createElement("section",null,N.createElement("h2",null,"intl-relative-time"),N.createElement(bt,{numeric:"auto"}),N.createElement(bt,{value:new Date(Date.now()-18144e5)}),N.createElement("p",null,'as text: "',(0,gt.z_)({i18next:dt}),'"')),N.createElement("section",null,N.createElement("h2",null,"intl-number"),N.createElement(vt,null),N.createElement(vt,{value:123456.789}),N.createElement(vt,{value:123456.789,options:{style:"currency",currency:"EUR"}}),N.createElement(vt,{value:123456.789,styleProp:"currency",currency:"JPY"}),N.createElement(vt,{value:50,styleProp:"unit",unit:"mile-per-hour"}),N.createElement(vt,{value:987654321,notation:"scientific"}),N.createElement(vt,{value:"987654321",notation:"engineering"}),N.createElement(vt,{value:987654321,notation:"compact"}),N.createElement("p",null,'as text: "',(0,gt.cJ)({i18next:dt,value:987654321,notation:"compact"}),'"')))),xt)})()})(); //# sourceMappingURL=jsx.js.map