@connectycube/chat-widget
Version:
A React component that seamlessly integrates ConnectyCube's real-time chat capabilities into your web applications. This widget offers an out-of-the-box solution for embedding chat features—such as instant messaging, user presence, and file sharing—withou
30 lines (28 loc) • 781 kB
JavaScript
(function(S,de){typeof exports=="object"&&typeof module<"u"?module.exports=de(require("react"),require("connectycube"),require("react-dom")):typeof define=="function"&&define.amd?define(["react","connectycube","react-dom"],de):(S=typeof globalThis<"u"?globalThis:S||self,S.ConnectyCubeChatWidget=de(S.React,S.ConnectyCube,S.ReactDOM))})(this,function(S,de,no){"use strict";function TA(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}function lt(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const o in n)if(o!=="default"&&!(o in e)){const s=Object.getOwnPropertyDescriptor(n,o);s&&Object.defineProperty(e,o,s.get?s:{enumerable:!0,get:()=>n[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const V=TA(S),RA=TA(no);var Js=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ot(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Bp(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}),r}var oo={exports:{}},mn={};/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var qA;function Pp(){if(qA)return mn;qA=1;var e=S,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function i(a,l,c){var d,A={},f=null,v=null;c!==void 0&&(f=""+c),l.key!==void 0&&(f=""+l.key),l.ref!==void 0&&(v=l.ref);for(d in l)n.call(l,d)&&!s.hasOwnProperty(d)&&(A[d]=l[d]);if(a&&a.defaultProps)for(d in l=a.defaultProps,l)A[d]===void 0&&(A[d]=l[d]);return{$$typeof:t,type:a,key:f,ref:v,props:A,_owner:o.current}}return mn.Fragment=r,mn.jsx=i,mn.jsxs=i,mn}var yn={},NA;function Mp(){if(NA)return yn;NA=1;/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/return"production".NODE_ENV!=="production"&&function(){var e=S,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),w=Symbol.iterator,y="@@iterator";function I(O){if(O===null||typeof O!="object")return null;var _=w&&O[w]||O[y];return typeof _=="function"?_:null}var b=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h(O){{for(var _=arguments.length,Ae=new Array(_>1?_-1:0),pe=1;pe<_;pe++)Ae[pe-1]=arguments[pe];m("error",O,Ae)}}function m(O,_,Ae){{var pe=b.ReactDebugCurrentFrame,Oe=pe.getStackAddendum();Oe!==""&&(_+="%s",Ae=Ae.concat([Oe]));var De=Ae.map(function(Ve){return String(Ve)});De.unshift("Warning: "+_),Function.prototype.apply.call(console[O],console,De)}}var g=!1,u=!1,C=!1,E=!1,B=!1,k;k=Symbol.for("react.module.reference");function F(O){return!!(typeof O=="string"||typeof O=="function"||O===n||O===s||B||O===o||O===c||O===d||E||O===v||g||u||C||typeof O=="object"&&O!==null&&(O.$$typeof===f||O.$$typeof===A||O.$$typeof===i||O.$$typeof===a||O.$$typeof===l||O.$$typeof===k||O.getModuleId!==void 0))}function Q(O,_,Ae){var pe=O.displayName;if(pe)return pe;var Oe=_.displayName||_.name||"";return Oe!==""?Ae+"("+Oe+")":Ae}function N(O){return O.displayName||"Context"}function R(O){if(O==null)return null;if(typeof O.tag=="number"&&h("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof O=="function")return O.displayName||O.name||null;if(typeof O=="string")return O;switch(O){case n:return"Fragment";case r:return"Portal";case s:return"Profiler";case o:return"StrictMode";case c:return"Suspense";case d:return"SuspenseList"}if(typeof O=="object")switch(O.$$typeof){case a:var _=O;return N(_)+".Consumer";case i:var Ae=O;return N(Ae._context)+".Provider";case l:return Q(O,O.render,"ForwardRef");case A:var pe=O.displayName||null;return pe!==null?pe:R(O.type)||"Memo";case f:{var Oe=O,De=Oe._payload,Ve=Oe._init;try{return R(Ve(De))}catch{return null}}}return null}var M=Object.assign,x=0,T,X,j,q,D,K,W;function Z(){}Z.__reactDisabledLog=!0;function $(){{if(x===0){T=console.log,X=console.info,j=console.warn,q=console.error,D=console.group,K=console.groupCollapsed,W=console.groupEnd;var O={configurable:!0,enumerable:!0,value:Z,writable:!0};Object.defineProperties(console,{info:O,log:O,warn:O,error:O,group:O,groupCollapsed:O,groupEnd:O})}x++}}function ae(){{if(x--,x===0){var O={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},O,{value:T}),info:M({},O,{value:X}),warn:M({},O,{value:j}),error:M({},O,{value:q}),group:M({},O,{value:D}),groupCollapsed:M({},O,{value:K}),groupEnd:M({},O,{value:W})})}x<0&&h("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var re=b.ReactCurrentDispatcher,ne;function L(O,_,Ae){{if(ne===void 0)try{throw Error()}catch(Oe){var pe=Oe.stack.trim().match(/\n( *(at )?)/);ne=pe&&pe[1]||""}return`
`+ne+O}}var U=!1,Y;{var H=typeof WeakMap=="function"?WeakMap:Map;Y=new H}function G(O,_){if(!O||U)return"";{var Ae=Y.get(O);if(Ae!==void 0)return Ae}var pe;U=!0;var Oe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var De;De=re.current,re.current=null,$();try{if(_){var Ve=function(){throw Error()};if(Object.defineProperty(Ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ve,[])}catch(mt){pe=mt}Reflect.construct(O,[],Ve)}else{try{Ve.call()}catch(mt){pe=mt}O.call(Ve.prototype)}}else{try{throw Error()}catch(mt){pe=mt}O()}}catch(mt){if(mt&&pe&&typeof mt.stack=="string"){for(var Ee=mt.stack.split(`
`),At=pe.stack.split(`
`),Ke=Ee.length-1,Ye=At.length-1;Ke>=1&&Ye>=0&&Ee[Ke]!==At[Ye];)Ye--;for(;Ke>=1&&Ye>=0;Ke--,Ye--)if(Ee[Ke]!==At[Ye]){if(Ke!==1||Ye!==1)do if(Ke--,Ye--,Ye<0||Ee[Ke]!==At[Ye]){var Vt=`
`+Ee[Ke].replace(" at new "," at ");return O.displayName&&Vt.includes("<anonymous>")&&(Vt=Vt.replace("<anonymous>",O.displayName)),typeof O=="function"&&Y.set(O,Vt),Vt}while(Ke>=1&&Ye>=0);break}}}finally{U=!1,re.current=De,ae(),Error.prepareStackTrace=Oe}var hn=O?O.displayName||O.name:"",zr=hn?L(hn):"";return typeof O=="function"&&Y.set(O,zr),zr}function se(O,_,Ae){return G(O,!1)}function ge(O){var _=O.prototype;return!!(_&&_.isReactComponent)}function Se(O,_,Ae){if(O==null)return"";if(typeof O=="function")return G(O,ge(O));if(typeof O=="string")return L(O);switch(O){case c:return L("Suspense");case d:return L("SuspenseList")}if(typeof O=="object")switch(O.$$typeof){case l:return se(O.render);case A:return Se(O.type,_,Ae);case f:{var pe=O,Oe=pe._payload,De=pe._init;try{return Se(De(Oe),_,Ae)}catch{}}}return""}var ye=Object.prototype.hasOwnProperty,Ce={},ze=b.ReactDebugCurrentFrame;function qe(O){if(O){var _=O._owner,Ae=Se(O.type,O._source,_?_.type:null);ze.setExtraStackFrame(Ae)}else ze.setExtraStackFrame(null)}function cr(O,_,Ae,pe,Oe){{var De=Function.call.bind(ye);for(var Ve in O)if(De(O,Ve)){var Ee=void 0;try{if(typeof O[Ve]!="function"){var At=Error((pe||"React class")+": "+Ae+" type `"+Ve+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof O[Ve]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw At.name="Invariant Violation",At}Ee=O[Ve](_,Ve,pe,Ae,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ke){Ee=Ke}Ee&&!(Ee instanceof Error)&&(qe(Oe),h("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",pe||"React class",Ae,Ve,typeof Ee),qe(null)),Ee instanceof Error&&!(Ee.message in Ce)&&(Ce[Ee.message]=!0,qe(Oe),h("Failed %s type: %s",Ae,Ee.message),qe(null))}}}var Wt=Array.isArray;function P(O){return Wt(O)}function z(O){{var _=typeof Symbol=="function"&&Symbol.toStringTag,Ae=_&&O[Symbol.toStringTag]||O.constructor.name||"Object";return Ae}}function J(O){try{return ie(O),!1}catch{return!0}}function ie(O){return""+O}function oe(O){if(J(O))return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",z(O)),ie(O)}var te=b.ReactCurrentOwner,le={key:!0,ref:!0,__self:!0,__source:!0},Ie,ke;function Qe(O){if(ye.call(O,"ref")){var _=Object.getOwnPropertyDescriptor(O,"ref").get;if(_&&_.isReactWarning)return!1}return O.ref!==void 0}function Jt(O){if(ye.call(O,"key")){var _=Object.getOwnPropertyDescriptor(O,"key").get;if(_&&_.isReactWarning)return!1}return O.key!==void 0}function Ur(O,_){typeof O.ref=="string"&&te.current}function Kr(O,_){{var Ae=function(){Ie||(Ie=!0,h("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",_))};Ae.isReactWarning=!0,Object.defineProperty(O,"key",{get:Ae,configurable:!0})}}function gn(O,_){{var Ae=function(){ke||(ke=!0,h("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",_))};Ae.isReactWarning=!0,Object.defineProperty(O,"ref",{get:Ae,configurable:!0})}}var Fr=function(O,_,Ae,pe,Oe,De,Ve){var Ee={$$typeof:t,type:O,key:_,ref:Ae,props:Ve,_owner:De};return Ee._store={},Object.defineProperty(Ee._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Ee,"_self",{configurable:!1,enumerable:!1,writable:!1,value:pe}),Object.defineProperty(Ee,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Oe}),Object.freeze&&(Object.freeze(Ee.props),Object.freeze(Ee)),Ee};function eo(O,_,Ae,pe,Oe){{var De,Ve={},Ee=null,At=null;Ae!==void 0&&(oe(Ae),Ee=""+Ae),Jt(_)&&(oe(_.key),Ee=""+_.key),Qe(_)&&(At=_.ref,Ur(_,Oe));for(De in _)ye.call(_,De)&&!le.hasOwnProperty(De)&&(Ve[De]=_[De]);if(O&&O.defaultProps){var Ke=O.defaultProps;for(De in Ke)Ve[De]===void 0&&(Ve[De]=Ke[De])}if(Ee||At){var Ye=typeof O=="function"?O.displayName||O.name||"Unknown":O;Ee&&Kr(Ve,Ye),At&&gn(Ve,Ye)}return Fr(O,Ee,At,Oe,pe,te.current,Ve)}}var Xt=b.ReactCurrentOwner,Tt=b.ReactDebugCurrentFrame;function Vr(O){if(O){var _=O._owner,Ae=Se(O.type,O._source,_?_.type:null);Tt.setExtraStackFrame(Ae)}else Tt.setExtraStackFrame(null)}var to;to=!1;function pn(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function ro(){{if(Xt.current){var O=R(Xt.current.type);if(O)return`
Check the render method of \``+O+"`."}return""}}function ve(O){return""}var Ue={};function He(O){{var _=ro();if(!_){var Ae=typeof O=="string"?O:O.displayName||O.name;Ae&&(_=`
Check the top-level render call using <`+Ae+">.")}return _}}function nt(O,_){{if(!O._store||O._store.validated||O.key!=null)return;O._store.validated=!0;var Ae=He(_);if(Ue[Ae])return;Ue[Ae]=!0;var pe="";O&&O._owner&&O._owner!==Xt.current&&(pe=" It was passed a child from "+R(O._owner.type)+"."),Vr(O),h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',Ae,pe),Vr(null)}}function jr(O,_){{if(typeof O!="object")return;if(P(O))for(var Ae=0;Ae<O.length;Ae++){var pe=O[Ae];pn(pe)&&nt(pe,_)}else if(pn(O))O._store&&(O._store.validated=!0);else if(O){var Oe=I(O);if(typeof Oe=="function"&&Oe!==O.entries)for(var De=Oe.call(O),Ve;!(Ve=De.next()).done;)pn(Ve.value)&&nt(Ve.value,_)}}}function Xe(O){{var _=O.type;if(_==null||typeof _=="string")return;var Ae;if(typeof _=="function")Ae=_.propTypes;else if(typeof _=="object"&&(_.$$typeof===l||_.$$typeof===A))Ae=_.propTypes;else return;if(Ae){var pe=R(_);cr(Ae,O.props,"prop",pe,O)}else if(_.PropTypes!==void 0&&!to){to=!0;var Oe=R(_);h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Oe||"Unknown")}typeof _.getDefaultProps=="function"&&!_.getDefaultProps.isReactClassApproved&&h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function pt(O){{for(var _=Object.keys(O.props),Ae=0;Ae<_.length;Ae++){var pe=_[Ae];if(pe!=="children"&&pe!=="key"){Vr(O),h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",pe),Vr(null);break}}O.ref!==null&&(Vr(O),h("Invalid attribute `ref` supplied to `React.Fragment`."),Vr(null))}}var Gr={};function ht(O,_,Ae,pe,Oe,De){{var Ve=F(O);if(!Ve){var Ee="";(O===void 0||typeof O=="object"&&O!==null&&Object.keys(O).length===0)&&(Ee+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var At=ve();At?Ee+=At:Ee+=ro();var Ke;O===null?Ke="null":P(O)?Ke="array":O!==void 0&&O.$$typeof===t?(Ke="<"+(R(O.type)||"Unknown")+" />",Ee=" Did you accidentally export a JSX literal instead of a component?"):Ke=typeof O,h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ke,Ee)}var Ye=eo(O,_,Ae,Oe,De);if(Ye==null)return Ye;if(Ve){var Vt=_.children;if(Vt!==void 0)if(pe)if(P(Vt)){for(var hn=0;hn<Vt.length;hn++)jr(Vt[hn],O);Object.freeze&&Object.freeze(Vt)}else h("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else jr(Vt,O)}if(ye.call(_,"key")){var zr=R(O),mt=Object.keys(_).filter(function(aV){return aV!=="key"}),DA=mt.length>0?"{key: someKey, "+mt.join(": ..., ")+": ...}":"{key: someKey}";if(!Gr[zr+DA]){var iV=mt.length>0?"{"+mt.join(": ..., ")+": ...}":"{}";h(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`,DA,zr,iV,zr),Gr[zr+DA]=!0}}return O===n?pt(Ye):Xe(Ye),Ye}}function bt(O,_,Ae){return ht(O,_,Ae,!0)}function Ws(O,_,Ae){return ht(O,_,Ae,!1)}var ur=Ws,Sp=bt;yn.Fragment=n,yn.jsx=ur,yn.jsxs=Sp}(),yn}var LA;function kp(){return LA||(LA=1,"production".NODE_ENV==="production"?oo.exports=Pp():oo.exports=Mp()),oo.exports}var p=kp();const he=e=>typeof e=="string",vn=()=>{let e,t;const r=new Promise((n,o)=>{e=n,t=o});return r.resolve=e,r.reject=t,r},QA=e=>e==null?"":""+e,Op=(e,t,r)=>{e.forEach(n=>{t[n]&&(r[n]=t[n])})},Dp=/###/g,UA=e=>e&&e.indexOf("###")>-1?e.replace(Dp,"."):e,KA=e=>!e||he(e),wn=(e,t,r)=>{const n=he(t)?t.split("."):t;let o=0;for(;o<n.length-1;){if(KA(e))return{};const s=UA(n[o]);!e[s]&&r&&(e[s]=new r),Object.prototype.hasOwnProperty.call(e,s)?e=e[s]:e={},++o}return KA(e)?{}:{obj:e,k:UA(n[o])}},FA=(e,t,r)=>{const{obj:n,k:o}=wn(e,t,Object);if(n!==void 0||t.length===1){n[o]=r;return}let s=t[t.length-1],i=t.slice(0,t.length-1),a=wn(e,i,Object);for(;a.obj===void 0&&i.length;)s=`${i[i.length-1]}.${s}`,i=i.slice(0,i.length-1),a=wn(e,i,Object),a!=null&&a.obj&&typeof a.obj[`${a.k}.${s}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${s}`]=r},Tp=(e,t,r,n)=>{const{obj:o,k:s}=wn(e,t,Object);o[s]=o[s]||[],o[s].push(r)},so=(e,t)=>{const{obj:r,k:n}=wn(e,t);if(r&&Object.prototype.hasOwnProperty.call(r,n))return r[n]},Rp=(e,t,r)=>{const n=so(e,r);return n!==void 0?n:so(t,r)},jA=(e,t,r)=>{for(const n in t)n!=="__proto__"&&n!=="constructor"&&(n in e?he(e[n])||e[n]instanceof String||he(t[n])||t[n]instanceof String?r&&(e[n]=t[n]):jA(e[n],t[n],r):e[n]=t[n]);return e},Yr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var qp={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Np=e=>he(e)?e.replace(/[&<>"'\/]/g,t=>qp[t]):e;class Lp{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const r=this.regExpMap.get(t);if(r!==void 0)return r;const n=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,n),this.regExpQueue.push(t),n}}const Qp=[" ",",","?","!",";"],Up=new Lp(20),Kp=(e,t,r)=>{t=t||"",r=r||"";const n=Qp.filter(i=>t.indexOf(i)<0&&r.indexOf(i)<0);if(n.length===0)return!0;const o=Up.getRegExp(`(${n.map(i=>i==="?"?"\\?":i).join("|")})`);let s=!o.test(e);if(!s){const i=e.indexOf(r);i>0&&!o.test(e.substring(0,i))&&(s=!0)}return s},Xs=function(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const n=t.split(r);let o=e;for(let s=0;s<n.length;){if(!o||typeof o!="object")return;let i,a="";for(let l=s;l<n.length;++l)if(l!==s&&(a+=r),a+=n[l],i=o[a],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&l<n.length-1)continue;s+=l-s+1;break}o=i}return o},io=e=>e==null?void 0:e.replace("_","-"),Fp={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var r,n;(n=(r=console==null?void 0:console[e])==null?void 0:r.apply)==null||n.call(r,console,t)}};class ao{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(t,r)}init(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=t||Fp,this.options=r,this.debug=r.debug}log(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"log","",!0)}warn(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"warn","",!0)}error(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"error","")}deprecate(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}forward(t,r,n,o){return o&&!this.debug?null:(he(t[0])&&(t[0]=`${n}${this.prefix} ${t[0]}`),this.logger[r](t))}create(t){return new ao(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new ao(this.logger,t)}}var Rt=new ao;class Ao{constructor(){this.observers={}}on(t,r){return t.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const o=this.observers[n].get(r)||0;this.observers[n].set(r,o+1)}),this}off(t,r){if(this.observers[t]){if(!r){delete this.observers[t];return}this.observers[t].delete(r)}}emit(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];this.observers[t]&&Array.from(this.observers[t].entries()).forEach(i=>{let[a,l]=i;for(let c=0;c<l;c++)a(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(i=>{let[a,l]=i;for(let c=0;c<l;c++)a.apply(a,[t,...n])})}}class GA extends Ao{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=t||{},this.options=r,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 r=this.options.ns.indexOf(t);r>-1&&this.options.ns.splice(r,1)}getResource(t,r,n){var c,d;let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,i=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;t.indexOf(".")>-1?a=t.split("."):(a=[t,r],n&&(Array.isArray(n)?a.push(...n):he(n)&&s?a.push(...n.split(s)):a.push(n)));const l=so(this.data,a);return!l&&!r&&!n&&t.indexOf(".")>-1&&(t=a[0],r=a[1],n=a.slice(2).join(".")),l||!i||!he(n)?l:Xs((d=(c=this.data)==null?void 0:c[t])==null?void 0:d[r],n,s)}addResource(t,r,n,o){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let a=[t,r];n&&(a=a.concat(i?n.split(i):n)),t.indexOf(".")>-1&&(a=t.split("."),o=r,r=a[1]),this.addNamespaces(r),FA(this.data,a,o),s.silent||this.emit("added",t,r,n,o)}addResources(t,r,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const s in n)(he(n[s])||Array.isArray(n[s]))&&this.addResource(t,r,s,n[s],{silent:!0});o.silent||this.emit("added",t,r,n)}addResourceBundle(t,r,n,o,s){let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},a=[t,r];t.indexOf(".")>-1&&(a=t.split("."),o=n,n=r,r=a[1]),this.addNamespaces(r);let l=so(this.data,a)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),o?jA(l,n,s):l={...l,...n},FA(this.data,a,l),i.silent||this.emit("added",t,r,n)}removeResourceBundle(t,r){this.hasResourceBundle(t,r)&&delete this.data[t][r],this.removeNamespaces(r),this.emit("removed",t,r)}hasResourceBundle(t,r){return this.getResource(t,r)!==void 0}getResourceBundle(t,r){return r||(r=this.options.defaultNS),this.getResource(t,r)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const r=this.getDataByLanguage(t);return!!(r&&Object.keys(r)||[]).find(o=>r[o]&&Object.keys(r[o]).length>0)}toJSON(){return this.data}}var zA={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,r,n,o){return e.forEach(s=>{var i;t=((i=this.processors[s])==null?void 0:i.process(t,r,n,o))??t}),t}};const YA={},WA=e=>!he(e)&&typeof e!="boolean"&&typeof e!="number";class lo extends Ao{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),Op(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Rt.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(t==null)return!1;const n=this.resolve(t,r);return(n==null?void 0:n.res)!==void 0}extractFromKey(t,r){let n=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const o=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let s=r.ns||this.options.defaultNS||[];const i=n&&t.indexOf(n)>-1,a=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!Kp(t,n,o);if(i&&!a){const l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:he(s)?[s]:s};const c=t.split(n);(n!==o||n===o&&this.options.ns.indexOf(c[0])>-1)&&(s=c.shift()),t=c.join(o)}return{key:t,namespaces:he(s)?[s]:s}}translate(t,r,n){if(typeof r!="object"&&this.options.overloadTranslationOptionHandler&&(r=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(r={...r}),r||(r={}),t==null)return"";Array.isArray(t)||(t=[String(t)]);const o=r.returnDetails!==void 0?r.returnDetails:this.options.returnDetails,s=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator,{key:i,namespaces:a}=this.extractFromKey(t[t.length-1],r),l=a[a.length-1],c=r.lng||this.language,d=r.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((c==null?void 0:c.toLowerCase())==="cimode"){if(d){const Q=r.nsSeparator||this.options.nsSeparator;return o?{res:`${l}${Q}${i}`,usedKey:i,exactUsedKey:i,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:`${l}${Q}${i}`}return o?{res:i,usedKey:i,exactUsedKey:i,usedLng:c,usedNS:l,usedParams:this.getUsedParamsDetails(r)}:i}const A=this.resolve(t,r);let f=A==null?void 0:A.res;const v=(A==null?void 0:A.usedKey)||i,w=(A==null?void 0:A.exactUsedKey)||i,y=["[object Number]","[object Function]","[object RegExp]"],I=r.joinArrays!==void 0?r.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,h=r.count!==void 0&&!he(r.count),m=lo.hasDefaultValue(r),g=h?this.pluralResolver.getSuffix(c,r.count,r):"",u=r.ordinal&&h?this.pluralResolver.getSuffix(c,r.count,{ordinal:!1}):"",C=h&&!r.ordinal&&r.count===0,E=C&&r[`defaultValue${this.options.pluralSeparator}zero`]||r[`defaultValue${g}`]||r[`defaultValue${u}`]||r.defaultValue;let B=f;b&&!f&&m&&(B=E);const k=WA(B),F=Object.prototype.toString.apply(B);if(b&&B&&k&&y.indexOf(F)<0&&!(he(I)&&Array.isArray(B))){if(!r.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const Q=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,B,{...r,ns:a}):`key '${i} (${this.language})' returned an object instead of string.`;return o?(A.res=Q,A.usedParams=this.getUsedParamsDetails(r),A):Q}if(s){const Q=Array.isArray(B),N=Q?[]:{},R=Q?w:v;for(const M in B)if(Object.prototype.hasOwnProperty.call(B,M)){const x=`${R}${s}${M}`;m&&!f?N[M]=this.translate(x,{...r,defaultValue:WA(E)?E[M]:void 0,joinArrays:!1,ns:a}):N[M]=this.translate(x,{...r,joinArrays:!1,ns:a}),N[M]===x&&(N[M]=B[M])}f=N}}else if(b&&he(I)&&Array.isArray(f))f=f.join(I),f&&(f=this.extendTranslation(f,t,r,n));else{let Q=!1,N=!1;!this.isValidLookup(f)&&m&&(Q=!0,f=E),this.isValidLookup(f)||(N=!0,f=i);const M=(r.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&N?void 0:f,x=m&&E!==f&&this.options.updateMissing;if(N||Q||x){if(this.logger.log(x?"updateKey":"missingKey",c,l,i,x?E:f),s){const q=this.resolve(i,{...r,keySeparator:!1});q&&q.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 X=this.languageUtils.getFallbackCodes(this.options.fallbackLng,r.lng||this.language);if(this.options.saveMissingTo==="fallback"&&X&&X[0])for(let q=0;q<X.length;q++)T.push(X[q]);else this.options.saveMissingTo==="all"?T=this.languageUtils.toResolveHierarchy(r.lng||this.language):T.push(r.lng||this.language);const j=(q,D,K)=>{var Z;const W=m&&K!==f?K:M;this.options.missingKeyHandler?this.options.missingKeyHandler(q,l,D,W,x,r):(Z=this.backendConnector)!=null&&Z.saveMissing&&this.backendConnector.saveMissing(q,l,D,W,x,r),this.emit("missingKey",q,l,D,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&h?T.forEach(q=>{const D=this.pluralResolver.getSuffixes(q,r);C&&r[`defaultValue${this.options.pluralSeparator}zero`]&&D.indexOf(`${this.options.pluralSeparator}zero`)<0&&D.push(`${this.options.pluralSeparator}zero`),D.forEach(K=>{j([q],i+K,r[`defaultValue${K}`]||E)})}):j(T,i,E))}f=this.extendTranslation(f,t,r,A,n),N&&f===i&&this.options.appendNamespaceToMissingKey&&(f=`${l}:${i}`),(N||Q)&&this.options.parseMissingKeyHandler&&(f=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${i}`:i,Q?f:void 0))}return o?(A.res=f,A.usedParams=this.getUsedParamsDetails(r),A):f}extendTranslation(t,r,n,o,s){var c,d;var i=this;if((c=this.i18nFormat)!=null&&c.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const A=he(t)&&(((d=n==null?void 0:n.interpolation)==null?void 0:d.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(A){const w=t.match(this.interpolator.nestingRegexp);f=w&&w.length}let v=n.replace&&!he(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(v={...this.options.interpolation.defaultVariables,...v}),t=this.interpolator.interpolate(t,v,n.lng||this.language||o.usedLng,n),A){const w=t.match(this.interpolator.nestingRegexp),y=w&&w.length;f<y&&(n.nest=!1)}!n.lng&&o&&o.res&&(n.lng=this.language||o.usedLng),n.nest!==!1&&(t=this.interpolator.nest(t,function(){for(var w=arguments.length,y=new Array(w),I=0;I<w;I++)y[I]=arguments[I];return(s==null?void 0:s[0])===y[0]&&!n.context?(i.logger.warn(`It seems you are nesting recursively key: ${y[0]} in key: ${r[0]}`),null):i.translate(...y,r)},n)),n.interpolation&&this.interpolator.reset()}const a=n.postProcess||this.options.postProcess,l=he(a)?[a]:a;return t!=null&&(l!=null&&l.length)&&n.applyPostProcessor!==!1&&(t=zA.handle(l,t,r,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...o,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),t}resolve(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,o,s,i,a;return he(t)&&(t=[t]),t.forEach(l=>{if(this.isValidLookup(n))return;const c=this.extractFromKey(l,r),d=c.key;o=d;let A=c.namespaces;this.options.fallbackNS&&(A=A.concat(this.options.fallbackNS));const f=r.count!==void 0&&!he(r.count),v=f&&!r.ordinal&&r.count===0,w=r.context!==void 0&&(he(r.context)||typeof r.context=="number")&&r.context!=="",y=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);A.forEach(I=>{var b,h;this.isValidLookup(n)||(a=I,!YA[`${y[0]}-${I}`]&&((b=this.utils)!=null&&b.hasLoadedNamespace)&&!((h=this.utils)!=null&&h.hasLoadedNamespace(a))&&(YA[`${y[0]}-${I}`]=!0,this.logger.warn(`key "${o}" for languages "${y.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(m=>{var C;if(this.isValidLookup(n))return;i=m;const g=[d];if((C=this.i18nFormat)!=null&&C.addLookupKeys)this.i18nFormat.addLookupKeys(g,d,m,I,r);else{let E;f&&(E=this.pluralResolver.getSuffix(m,r.count,r));const B=`${this.options.pluralSeparator}zero`,k=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(g.push(d+E),r.ordinal&&E.indexOf(k)===0&&g.push(d+E.replace(k,this.options.pluralSeparator)),v&&g.push(d+B)),w){const F=`${d}${this.options.contextSeparator}${r.context}`;g.push(F),f&&(g.push(F+E),r.ordinal&&E.indexOf(k)===0&&g.push(F+E.replace(k,this.options.pluralSeparator)),v&&g.push(F+B))}}let u;for(;u=g.pop();)this.isValidLookup(n)||(s=u,n=this.getResource(m,I,u,r))}))})}),{res:n,usedKey:o,exactUsedKey:s,usedLng:i,usedNS:a}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,r,n){var s;let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(t,r,n,o):this.resourceStore.getResource(t,r,n,o)}getUsedParamsDetails(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=t.replace&&!he(t.replace);let o=n?t.replace:t;if(n&&typeof t.count<"u"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o={...this.options.interpolation.defaultVariables,...o}),!n){o={...o};for(const s of r)delete o[s]}return o}static hasDefaultValue(t){const r="defaultValue";for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&r===n.substring(0,r.length)&&t[n]!==void 0)return!0;return!1}}class JA{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Rt.create("languageUtils")}getScriptPartFromCode(t){if(t=io(t),!t||t.indexOf("-")<0)return null;const r=t.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(t){if(t=io(t),!t||t.indexOf("-")<0)return t;const r=t.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(t){if(he(t)&&t.indexOf("-")>-1){let r;try{r=Intl.getCanonicalLocales(t)[0]}catch{}return r&&this.options.lowerCaseLng&&(r=r.toLowerCase()),r||(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 r;return t.forEach(n=>{if(r)return;const o=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(o))&&(r=o)}),!r&&this.options.supportedLngs&&t.forEach(n=>{if(r)return;const o=this.getScriptPartFromCode(n);if(this.isSupportedCode(o))return r=o;const s=this.getLanguagePartFromCode(n);if(this.isSupportedCode(s))return r=s;r=this.options.supportedLngs.find(i=>{if(i===s)return i;if(!(i.indexOf("-")<0&&s.indexOf("-")<0)&&(i.indexOf("-")>0&&s.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===s||i.indexOf(s)===0&&s.length>1))return i})}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),he(t)&&(t=[t]),Array.isArray(t))return t;if(!r)return t.default||[];let n=t[r];return n||(n=t[this.getScriptPartFromCode(r)]),n||(n=t[this.formatLanguageCode(r)]),n||(n=t[this.getLanguagePartFromCode(r)]),n||(n=t.default),n||[]}toResolveHierarchy(t,r){const n=this.getFallbackCodes(r||this.options.fallbackLng||[],t),o=[],s=i=>{i&&(this.isSupportedCode(i)?o.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return he(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(t))):he(t)&&s(this.formatLanguageCode(t)),n.forEach(i=>{o.indexOf(i)<0&&s(this.formatLanguageCode(i))}),o}}const XA={zero:0,one:1,two:2,few:3,many:4,other:5},HA={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class jp{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=t,this.options=r,this.logger=Rt.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,r){this.rules[t]=r}clearCache(){this.pluralRulesCache={}}getRule(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=io(t==="dev"?"en":t),o=r.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:n,type:o});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let i;try{i=new Intl.PluralRules(n,{type:o})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),HA;if(!t.match(/-|_/))return HA;const l=this.languageUtils.getLanguagePartFromCode(t);i=this.getRule(l,r)}return this.pluralRulesCache[s]=i,i}needsPlural(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(t,r);return n||(n=this.getRule("dev",r)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(t,n).map(o=>`${r}${o}`)}getSuffixes(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=this.getRule(t,r);return n||(n=this.getRule("dev",r)),n?n.resolvedOptions().pluralCategories.sort((o,s)=>XA[o]-XA[s]).map(o=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const o=this.getRule(t,n);return o?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${o.select(r)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",r,n))}}const ZA=function(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,s=Rp(e,t,r);return!s&&o&&he(r)&&(s=Xs(e,r,n),s===void 0&&(s=Xs(t,r,n))),s},Hs=e=>e.replace(/\$/g,"$$$$");class Gp{constructor(){var r;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Rt.create("interpolator"),this.options=t,this.format=((r=t==null?void 0:t.interpolation)==null?void 0:r.format)||(n=>n),this.init(t)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});const{escape:r,escapeValue:n,useRawValueToEscape:o,prefix:s,prefixEscaped:i,suffix:a,suffixEscaped:l,formatSeparator:c,unescapeSuffix:d,unescapePrefix:A,nestingPrefix:f,nestingPrefixEscaped:v,nestingSuffix:w,nestingSuffixEscaped:y,nestingOptionsSeparator:I,maxReplaces:b,alwaysFormat:h}=t.interpolation;this.escape=r!==void 0?r:Np,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=s?Yr(s):i||"{{",this.suffix=a?Yr(a):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=d?"":A||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=f?Yr(f):v||Yr("$t("),this.nestingSuffix=w?Yr(w):y||Yr(")"),this.nestingOptionsSeparator=I||",",this.maxReplaces=b||1e3,this.alwaysFormat=h!==void 0?h:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(r,n)=>(r==null?void 0:r.source)===n?(r.lastIndex=0,r):new RegExp(n,"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,r,n,o){var v;let s,i,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=w=>{if(w.indexOf(this.formatSeparator)<0){const h=ZA(r,l,w,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(h,void 0,n,{...o,...r,interpolationkey:w}):h}const y=w.split(this.formatSeparator),I=y.shift().trim(),b=y.join(this.formatSeparator).trim();return this.format(ZA(r,l,I,this.options.keySeparator,this.options.ignoreJSONStructure),b,n,{...o,...r,interpolationkey:I})};this.resetRegExp();const d=(o==null?void 0:o.missingInterpolationHandler)||this.options.missingInterpolationHandler,A=((v=o==null?void 0:o.interpolation)==null?void 0:v.skipOnVariables)!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:w=>Hs(w)},{regex:this.regexp,safeValue:w=>this.escapeValue?Hs(this.escape(w)):Hs(w)}].forEach(w=>{for(a=0;s=w.regex.exec(t);){const y=s[1].trim();if(i=c(y),i===void 0)if(typeof d=="function"){const b=d(t,s,o);i=he(b)?b:""}else if(o&&Object.prototype.hasOwnProperty.call(o,y))i="";else if(A){i=s[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${t}`),i="";else!he(i)&&!this.useRawValueToEscape&&(i=QA(i));const I=w.safeValue(i);if(t=t.replace(s[0],I),A?(w.regex.lastIndex+=i.length,w.regex.lastIndex-=s[0].length):w.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),t}nest(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,s,i;const a=(l,c)=>{const d=this.nestingOptionsSeparator;if(l.indexOf(d)<0)return l;const A=l.split(new RegExp(`${d}[ ]*{`));let f=`{${A[1]}`;l=A[0],f=this.interpolate(f,i);const v=f.match(/'/g),w=f.match(/"/g);(((v==null?void 0:v.length)??0)%2===0&&!w||w.length%2!==0)&&(f=f.replace(/'/g,'"'));try{i=JSON.parse(f),c&&(i={...c,...i})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${d}${f}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,l};for(;o=this.nestingRegexp.exec(t);){let l=[];i={...n},i=i.replace&&!he(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let c=!1;if(o[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(o[1])){const d=o[1].split(this.formatSeparator).map(A=>A.trim());o[1]=d.shift(),l=d,c=!0}if(s=r(a.call(this,o[1].trim(),i),i),s&&o[0]===t&&!he(s))return s;he(s)||(s=QA(s)),s||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),s=""),c&&(s=l.reduce((d,A)=>this.format(d,A,n.lng,{...n,interpolationkey:o[1].trim()}),s.trim())),t=t.replace(o[0],s),this.regexp.lastIndex=0}return t}}const zp=e=>{let t=e.toLowerCase().trim();const r={};if(e.indexOf("(")>-1){const n=e.split("(");t=n[0].toLowerCase().trim();const o=n[1].substring(0,n[1].length-1);t==="currency"&&o.indexOf(":")<0?r.currency||(r.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?r.range||(r.range=o.trim()):o.split(";").forEach(i=>{if(i){const[a,...l]=i.split(":"),c=l.join(":").trim().replace(/^'+|'+$/g,""),d=a.trim();r[d]||(r[d]=c),c==="false"&&(r[d]=!1),c==="true"&&(r[d]=!0),isNaN(c)||(r[d]=parseInt(c,10))}})}return{formatName:t,formatOptions:r}},Wr=e=>{const t={};return(r,n,o)=>{let s=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(s={...s,[o.interpolationkey]:void 0});const i=n+JSON.stringify(s);let a=t[i];return a||(a=e(io(n),o),t[i]=a),a(r)}};class Yp{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=Rt.create("formatter"),this.options=t,this.formats={number:Wr((r,n)=>{const o=new Intl.NumberFormat(r,{...n});return s=>o.format(s)}),currency:Wr((r,n)=>{const o=new Intl.NumberFormat(r,{...n,style:"currency"});return s=>o.format(s)}),datetime:Wr((r,n)=>{const o=new Intl.DateTimeFormat(r,{...n});return s=>o.format(s)}),relativetime:Wr((r,n)=>{const o=new Intl.RelativeTimeFormat(r,{...n});return s=>o.format(s,n.range||"day")}),list:Wr((r,n)=>{const o=new Intl.ListFormat(r,{...n});return s=>o.format(s)})},this.init(t)}init(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=r.interpolation.formatSeparator||","}add(t,r){this.formats[t.toLowerCase().trim()]=r}addCached(t,r){this.formats[t.toLowerCase().trim()]=Wr(r)}format(t,r,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const s=r.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(a=>a.indexOf(")")>-1)){const a=s.findIndex(l=>l.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,a)].join(this.formatSeparator)}return s.reduce((a,l)=>{var A;const{formatName:c,formatOptions:d}=zp(l);if(this.formats[c]){let f=a;try{const v=((A=o==null?void 0:o.formatParams)==null?void 0:A[o.interpolationkey])||{},w=v.locale||v.lng||o.locale||o.lng||n;f=this.formats[c](a,w,{...d,...o,...v})}catch(v){this.logger.warn(v)}return f}else this.logger.warn(`there was no format function for ${c}`);return a},t)}}const Wp=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Jp extends Ao{constructor(t,r,n){var s,i;let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=t,this.store=r,this.services=n,this.languageUtils=n.languageUtils,this.options=o,this.logger=Rt.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=o.maxParallelReads||10,this.readingCalls=0,this.maxRetries=o.maxRetries>=0?o.maxRetries:5,this.retryTimeout=o.retryTimeout>=1?o.retryTimeout:350,this.state={},this.queue=[],(i=(s=this.backend)==null?void 0:s.init)==null||i.call(s,n,o.backend,o)}queueLoad(t,r,n,o){const s={},i={},a={},l={};return t.forEach(c=>{let d=!0;r.forEach(A=>{const f=`${c}|${A}`;!n.reload&&this.store.hasResourceBundle(c,A)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?i[f]===void 0&&(i[f]=!0):(this.state[f]=1,d=!1,i[f]===void 0&&(i[f]=!0),s[f]===void 0&&(s[f]=!0),l[A]===void 0&&(l[A]=!0)))}),d||(a[c]=!0)}),(Object.keys(s).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(s),pending:Object.keys(i),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(t,r,n){const o=t.split("|"),s=o[0],i=o[1];r&&this.emit("failedLoading",s,i,r),!r&&n&&this.store.addResourceBundle(s,i,n,void 0,void 0,{skipCopy:!0}),this.state[t]=r?-1:2,r&&n&&(this.state[t]=0);const a={};this.queue.forEach(l=>{Tp(l.loaded,[s],i),Wp(l,t),r&&l.errors.push(r),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{a[c]||(a[c]={});const d=l.loaded[c];d.length&&d.forEach(A=>{a[c][A]===void 0&&(a[c][A]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(t,r,n){let o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!t.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:r,fcName:n,tried:o,wait:s,callback:i});return}this.readingCalls++;const a=(c,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const A=this.waitingReads.shift();this.read(A.lng,A.ns,A.fcName,A.tried,A.wait,A.callback)}if(c&&d&&o<this.maxRetries){setTimeout(()=>{this.read.call(this,t,r,n,o+1,s*2,i)},s);return}i(c,d)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const c=l(t,r);c&&typeof c.then=="function"?c.then(d=>a(null,d)).catch(a):a(null,c)}catch(c){a(c)}return}return l(t,r,a)}prepareLoading(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=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."),o&&o();he(t)&&(t=this.languageUtils.toResolveHierarchy(t)),he(r)&&(r=[r]);const s=this.queueLoad(t,r,n,o);if(!s.toLoad.length)return s.pending.length||o(),null;s.toLoad.forEach(i=>{this.loadOne(i)})}load(t,r,n){this.prepareLoading(t,r,{},n)}reload(t,r,n){this.prepareLoading(t,r,{reload:!0},n)}loadOne(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=t.split("|"),o=n[0],s=n[1];this.read(o,s,"read",void 0,void 0,(i,a)=>{i&&this.logger.warn(`${r}loading namespace ${s} for language ${o} failed`,i),!i&&a&&this.logger.log(`${r}loaded namespace ${s} for language ${o}`,a),this.loaded(t,i,a)})}saveMissing(t,r,n,o,s){var l,c,d,A,f;let i=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if((c=(l=this.services)==null?void 0:l.utils)!=null&&c.hasLoadedNamespace&&!((A=(d=this.services)==null?void 0:d.utils)!=null&&A.hasLoadedNamespace(r))){this.logger.warn(`did not save key "${n}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((f=this.backend)!=null&&f.create){const v={...i,isUpdate:s},w=this.backend.create.bind(this.backend);if(w.length<6)try{let y;w.length===5?y=w(t,r,n,o,v):y=w(t,r,n,o),y&&typeof y.then=="function"?y.then(I=>a(null,I)).catch(a):a(null,y)}catch(y){a(y)}else w(t,r,n,o,a,v)}!t||!t[0]||this.store.addResource(t[0],r,n,o)}}}const _A=()=>({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]),he(e[1])&&(t.defaultValue=e[1]),he(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const r=e[3]||e[2];Object.keys(r).forEach(n=>{t[n]=r[n]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),$A=e=>{var t,r;return he(e.ns)&&(e.ns=[e.ns]),he(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),he(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((r=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:r.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},co=()=>{},Xp=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(r=>{typeof e[r]=="function"&&(e[r]=e[r].bind(e))})};class bn extends Ao{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(super(),this.options=$A(t),this.services={},this.logger=Rt,this.modules={external:[]},Xp(this),r&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,r),this;setTimeout(()=>{