var yk=Object.defineProperty,bk=Object.defineProperties;var vk=Object.getOwnPropertyDescriptors;var I0=Object.getOwnPropertySymbols;var L1=Object.prototype.hasOwnProperty,M1=Object.prototype.propertyIsEnumerable;var Yl=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),_k=e=>{throw TypeError(e)};var Zm=(e,t,a)=>t in e?yk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,ie=(e,t)=>{for(var a in t||(t={}))L1.call(t,a)&&Zm(e,a,t[a]);if(I0)for(var a of I0(t))M1.call(t,a)&&Zm(e,a,t[a]);return e},Le=(e,t)=>bk(e,vk(t));var tn=(e,t)=>{var a={};for(var s in e)L1.call(e,s)&&t.indexOf(s)<0&&(a[s]=e[s]);if(e!=null&&I0)for(var s of I0(e))t.indexOf(s)<0&&M1.call(e,s)&&(a[s]=e[s]);return a};var wk=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Os=(e,t,a)=>Zm(e,typeof t!="symbol"?t+"":t,a);var ge=(e,t,a)=>new Promise((s,o)=>{var u=p=>{try{f(a.next(p))}catch(g){o(g)}},c=p=>{try{f(a.throw(p))}catch(g){o(g)}},f=p=>p.done?s(p.value):Promise.resolve(p.value).then(u,c);f((a=a.apply(e,t)).next())}),Bo=function(e,t){this[0]=e,this[1]=t},qm=(e,t,a)=>{var s=(c,f,p,g)=>{try{var x=a[c](f),v=(f=x.value)instanceof Bo,_=x.done;Promise.resolve(v?f[0]:f).then(k=>v?s(c==="return"?c:"next",f[1]?{done:k.done,value:k.value}:k,p,g):p({value:k,done:_})).catch(k=>s("throw",k,p,g))}catch(k){g(k)}},o=c=>u[c]=f=>new Promise((p,g)=>s(c,f,p,g)),u={};return a=a.apply(e,t),u[Yl("asyncIterator")]=()=>u,o("next"),o("throw"),o("return"),u},Ym=e=>{var t=e[Yl("asyncIterator")],a=!1,s,o={};return t==null?(t=e[Yl("iterator")](),s=u=>o[u]=c=>t[u](c)):(t=t.call(e),s=u=>o[u]=c=>{if(a){if(a=!1,u==="throw")throw c;return c}return a=!0,{done:!1,value:new Bo(new Promise(f=>{var p=t[u](c);p instanceof Object||_k("Object expected"),f(p)}),1)}}),o[Yl("iterator")]=()=>o,s("next"),"throw"in t?s("throw"):o.throw=u=>{throw u},"return"in t&&s("return"),o},D1=(e,t,a)=>(t=e[Yl("asyncIterator")])?t.call(e):(e=e[Yl("iterator")](),t={},a=(s,o)=>(o=e[s])&&(t[s]=u=>new Promise((c,f,p)=>(u=o.call(e,u),p=u.done,Promise.resolve(u.value).then(g=>c({value:g,done:p}),f)))),a("next"),a("return"),t);var jM=wk(dt=>{(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function a(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(o){if(o.ep)return;o.ep=!0;const u=a(o);fetch(o.href,u)}})();function Iv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xm={exports:{}},Ed={};var R1;function kk(){if(R1)return Ed;R1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(s,o,u){var c=null;if(u!==void 0&&(c=""+u),o.key!==void 0&&(c=""+o.key),"key"in o){u={};for(var f in o)f!=="key"&&(u[f]=o[f])}else u=o;return o=u.ref,{$$typeof:e,type:s,key:c,ref:o!==void 0?o:null,props:u}}return Ed.Fragment=t,Ed.jsx=a,Ed.jsxs=a,Ed}var P1;function Nk(){return P1||(P1=1,Xm.exports=kk()),Xm.exports}var r=Nk(),Km={exports:{}},It={};var F1;function Sk(){if(F1)return It;F1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),_=Symbol.iterator;function k(z){return z===null||typeof z!="object"?null:(z=_&&z[_]||z["@@iterator"],typeof z=="function"?z:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,j={};function P(z,D,G){this.props=z,this.context=D,this.refs=j,this.updater=G||T}P.prototype.isReactComponent={},P.prototype.setState=function(z,D){if(typeof z!="object"&&typeof z!="function"&&z!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,z,D,"setState")},P.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function C(){}C.prototype=P.prototype;function O(z,D,G){this.props=z,this.context=D,this.refs=j,this.updater=G||T}var R=O.prototype=new C;R.constructor=O,N(R,P.prototype),R.isPureReactComponent=!0;var U=Array.isArray;function H(){}var B={H:null,A:null,T:null,S:null},oe=Object.prototype.hasOwnProperty;function se(z,D,G){var q=G.ref;return{$$typeof:e,type:z,key:D,ref:q!==void 0?q:null,props:G}}function pe(z,D){return se(z.type,D,z.props)}function le(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function re(z){var D={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(G){return D[G]})}var de=/\/+/g;function ye(z,D){return typeof z=="object"&&z!==null&&z.key!=null?re(""+z.key):D.toString(36)}function ue(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(H,H):(z.status="pending",z.then(function(D){z.status==="pending"&&(z.status="fulfilled",z.value=D)},function(D){z.status==="pending"&&(z.status="rejected",z.reason=D)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function te(z,D,G,q,K){var fe=typeof z;(fe==="undefined"||fe==="boolean")&&(z=null);var Pe=!1;if(z===null)Pe=!0;else switch(fe){case"bigint":case"string":case"number":Pe=!0;break;case"object":switch(z.$$typeof){case e:case t:Pe=!0;break;case x:return Pe=z._init,te(Pe(z._payload),D,G,q,K)}}if(Pe)return K=K(z),Pe=q===""?"."+ye(z,0):q,U(K)?(G="",Pe!=null&&(G=Pe.replace(de,"$&/")+"/"),te(K,D,G,"",function(He){return He})):K!=null&&(le(K)&&(K=pe(K,G+(K.key==null||z&&z.key===K.key?"":(""+K.key).replace(de,"$&/")+"/")+Pe)),D.push(K)),1;Pe=0;var We=q===""?".":q+":";if(U(z))for(var Fe=0;Fe>>1,ae=te[ne];if(0>>1;neo(G,J))qo(K,G)?(te[ne]=K,te[q]=J,ne=q):(te[ne]=G,te[D]=J,ne=D);else if(qo(K,J))te[ne]=K,te[q]=J,ne=q;else break e}}return V}function o(te,V){var J=te.sortIndex-V.sortIndex;return J!==0?J:te.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var p=[],g=[],x=1,v=null,_=3,k=!1,T=!1,N=!1,j=!1,P=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate!="undefined"?setImmediate:null;function R(te){for(var V=a(g);V!==null;){if(V.callback===null)s(g);else if(V.startTime<=te)s(g),V.sortIndex=V.expirationTime,t(p,V);else break;V=a(g)}}function U(te){if(N=!1,R(te),!T)if(a(p)!==null)T=!0,H||(H=!0,re());else{var V=a(g);V!==null&&ue(U,V.startTime-te)}}var H=!1,B=-1,oe=5,se=-1;function pe(){return j?!0:!(e.unstable_now()-sete&&pe());){var ne=v.callback;if(typeof ne=="function"){v.callback=null,_=v.priorityLevel;var ae=ne(v.expirationTime<=te);if(te=e.unstable_now(),typeof ae=="function"){v.callback=ae,R(te),V=!0;break t}v===a(p)&&s(p),R(te)}else s(p);v=a(p)}if(v!==null)V=!0;else{var z=a(g);z!==null&&ue(U,z.startTime-te),V=!1}}break e}finally{v=null,_=J,k=!1}V=void 0}}finally{V?re():H=!1}}}var re;if(typeof O=="function")re=function(){O(le)};else if(typeof MessageChannel!="undefined"){var de=new MessageChannel,ye=de.port2;de.port1.onmessage=le,re=function(){ye.postMessage(null)}}else re=function(){P(le,0)};function ue(te,V){B=P(function(){te(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(te){te.callback=null},e.unstable_forceFrameRate=function(te){0>te||125ne?(te.sortIndex=J,t(g,te),a(p)===null&&te===a(g)&&(N?(C(B),B=-1):N=!0,ue(U,J-ne))):(te.sortIndex=ae,t(p,te),T||k||(T=!0,H||(H=!0,re()))),te},e.unstable_shouldYield=pe,e.unstable_wrapCallback=function(te){var V=_;return function(){var J=_;_=V;try{return te.apply(this,arguments)}finally{_=J}}}})(eg)),eg}var z1;function Tk(){return z1||(z1=1,Qm.exports=jk()),Qm.exports}var tg={exports:{}},Ar={};var U1;function Ek(){if(U1)return Ar;U1=1;var e=Of();function t(p){var g="https://react.dev/errors/"+p;if(1ae||(n.current=ne[ae],ne[ae]=null,ae--)}function G(n,i){ae++,ne[ae]=n.current,n.current=i}var q=z(null),K=z(null),fe=z(null),Pe=z(null);function We(n,i){switch(G(fe,i),G(K,n),G(q,null),i.nodeType){case 9:case 11:n=(n=i.documentElement)&&(n=n.namespaceURI)?t1(n):0;break;default:if(n=i.tagName,i=i.namespaceURI)i=t1(i),n=a1(i,n);else switch(n){case"svg":n=1;break;case"math":n=2;break;default:n=0}}D(q),G(q,n)}function Fe(){D(q),D(K),D(fe)}function He(n){n.memoizedState!==null&&G(Pe,n);var i=q.current,d=a1(i,n.type);i!==d&&(G(K,n),G(q,d))}function it(n){K.current===n&&(D(q),D(K)),Pe.current===n&&(D(Pe),Nd._currentValue=J)}var ht,Vt;function _t(n){if(ht===void 0)try{throw Error()}catch(d){var i=d.stack.trim().match(/\n( *(at )?)/);ht=i&&i[1]||"",Vt=-1)":-1b||me[m]!==Ce[b]){var Ue=` `+me[m].replace(" at new "," at ");return n.displayName&&Ue.includes("")&&(Ue=Ue.replace("",n.displayName)),Ue}while(1<=m&&0<=b);break}}}finally{ia=!1,Error.prepareStackTrace=d}return(d=n?n.displayName||n.name:"")?_t(d):""}function Be(n,i){switch(n.tag){case 26:case 27:case 5:return _t(n.type);case 16:return _t("Lazy");case 13:return n.child!==i&&i!==null?_t("Suspense Fallback"):_t("Suspense");case 19:return _t("SuspenseList");case 0:case 15:return Lt(n.type,!1);case 11:return Lt(n.type.render,!1);case 1:return Lt(n.type,!0);case 31:return _t("Activity");default:return""}}function yt(n){try{var i="",d=null;do i+=Be(n,d),d=n,n=n.return;while(n);return i}catch(m){return` Error generating stack: `+m.message+` `+m.stack}}var ke=Object.prototype.hasOwnProperty,ze=e.unstable_scheduleCallback,Je=e.unstable_cancelCallback,nt=e.unstable_shouldYield,ut=e.unstable_requestPaint,ft=e.unstable_now,bt=e.unstable_getCurrentPriorityLevel,Ut=e.unstable_ImmediatePriority,Rt=e.unstable_UserBlockingPriority,Pt=e.unstable_NormalPriority,qe=e.unstable_LowPriority,at=e.unstable_IdlePriority,wt=e.log,kt=e.unstable_setDisableYieldValue,da=null,xe=null;function De(n){if(typeof wt=="function"&&kt(n),xe&&typeof xe.setStrictMode=="function")try{xe.setStrictMode(da,n)}catch(i){}}var $e=Math.clz32?Math.clz32:Sa,Et=Math.log,Gt=Math.LN2;function Sa(n){return n>>>=0,n===0?32:31-(Et(n)/Gt|0)|0}var tt=256,Zt=262144,Ia=4194304;function Ba(n){var i=n&42;if(i!==0)return i;switch(n&-n){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return n&261888;case 262144:case 524288:case 1048576:case 2097152:return n&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return n&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return n}}function Dr(n,i,d){var m=n.pendingLanes;if(m===0)return 0;var b=0,w=n.suspendedLanes,M=n.pingedLanes;n=n.warmLanes;var Z=m&134217727;return Z!==0?(m=Z&~w,m!==0?b=Ba(m):(M&=Z,M!==0?b=Ba(M):d||(d=Z&~n,d!==0&&(b=Ba(d))))):(Z=m&~w,Z!==0?b=Ba(Z):M!==0?b=Ba(M):d||(d=m&~n,d!==0&&(b=Ba(d)))),b===0?0:i!==0&&i!==b&&(i&w)===0&&(w=b&-b,d=i&-i,w>=d||w===32&&(d&4194048)!==0)?i:b}function cn(n,i){return(n.pendingLanes&~(n.suspendedLanes&~n.pingedLanes)&i)===0}function gs(n,i){switch(n){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ps(){var n=Ia;return Ia<<=1,(Ia&62914560)===0&&(Ia=4194304),n}function Zn(n){for(var i=[],d=0;31>d;d++)i.push(n);return i}function Rr(n,i){n.pendingLanes|=i,i!==268435456&&(n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0)}function qn(n,i,d,m,b,w){var M=n.pendingLanes;n.pendingLanes=d,n.suspendedLanes=0,n.pingedLanes=0,n.warmLanes=0,n.expiredLanes&=d,n.entangledLanes&=d,n.errorRecoveryDisabledLanes&=d,n.shellSuspendCounter=0;var Z=n.entanglements,me=n.expirationTimes,Ce=n.hiddenUpdates;for(d=M&~d;0=ki),xl=" ",Ou=!1;function Lu(n,i){switch(n){case"keyup":return Gr.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vc(n){return n=n.detail,typeof n=="object"&&"data"in n?n.data:null}var Ni=!1;function pn(n,i){switch(n){case"compositionend":return Vc(i);case"keypress":return i.which!==32?null:(Ou=!0,xl);case"textInput":return n=i.data,n===xl&&Ou?null:n;default:return null}}function Si(n,i){if(Ni)return n==="compositionend"||!gl&&Lu(n,i)?(n=bs(),Ua=Us=On=null,Ni=!1,n):null;switch(n){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1=i)return{node:d,offset:i-n};n=m}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=bl(d)}}function vl(n,i){return n&&i?n===i?!0:n&&n.nodeType===3?!1:i&&i.nodeType===3?vl(n,i.parentNode):"contains"in n?n.contains(i):n.compareDocumentPosition?!!(n.compareDocumentPosition(i)&16):!1:!1}function vo(n){n=n!=null&&n.ownerDocument!=null&&n.ownerDocument.defaultView!=null?n.ownerDocument.defaultView:window;for(var i=xi(n.document);i instanceof n.HTMLIFrameElement;){try{var d=typeof i.contentWindow.location.href=="string"}catch(m){d=!1}if(d)n=i.contentWindow;else break;i=xi(n.document)}return i}function _s(n){var i=n&&n.nodeName&&n.nodeName.toLowerCase();return i&&(i==="input"&&(n.type==="text"||n.type==="search"||n.type==="tel"||n.type==="url"||n.type==="password")||i==="textarea"||n.contentEditable==="true")}var _l=mn&&"documentMode"in document&&11>=document.documentMode,ws=null,wl=null,_o=null,Ci=!1;function Fu(n,i,d){var m=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Ci||ws==null||ws!==xi(m)||(m=ws,"selectionStart"in m&&_s(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),_o&&Ei(_o,m)||(_o=m,m=k0(wl,"onSelect"),0>=M,b-=M,Ge=1<<32-$e(i)+b|d<$t?(Qt=xt,xt=null):Qt=xt.sibling;var na=Oe(we,xt,Te[$t],Ve);if(na===null){xt===null&&(xt=Qt);break}n&&xt&&na.alternate===null&&i(we,xt),ve=w(na,ve,$t),ra===null?Nt=na:ra.sibling=na,ra=na,xt=Qt}if($t===Te.length)return d(we,xt),qt&&vt(we,$t),Nt;if(xt===null){for(;$t$t?(Qt=xt,xt=null):Qt=xt.sibling;var Ki=Oe(we,xt,na.value,Ve);if(Ki===null){xt===null&&(xt=Qt);break}n&&xt&&Ki.alternate===null&&i(we,xt),ve=w(Ki,ve,$t),ra===null?Nt=Ki:ra.sibling=Ki,ra=Ki,xt=Qt}if(na.done)return d(we,xt),qt&&vt(we,$t),Nt;if(xt===null){for(;!na.done;$t++,na=Te.next())na=Ze(we,na.value,Ve),na!==null&&(ve=w(na,ve,$t),ra===null?Nt=na:ra.sibling=na,ra=na);return qt&&vt(we,$t),Nt}for(xt=m(xt);!na.done;$t++,na=Te.next())na=Re(xt,we,$t,na.value,Ve),na!==null&&(n&&na.alternate!==null&&xt.delete(na.key===null?$t:na.key),ve=w(na,ve,$t),ra===null?Nt=na:ra.sibling=na,ra=na);return n&&xt.forEach(function(xk){return i(we,xk)}),qt&&vt(we,$t),Nt}function ka(we,ve,Te,Ve){if(typeof Te=="object"&&Te!==null&&Te.type===N&&Te.key===null&&(Te=Te.props.children),typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case k:e:{for(var Nt=Te.key;ve!==null;){if(ve.key===Nt){if(Nt=Te.type,Nt===N){if(ve.tag===7){d(we,ve.sibling),Ve=b(ve,Te.props.children),Ve.return=we,we=Ve;break e}}else if(ve.elementType===Nt||typeof Nt=="object"&&Nt!==null&&Nt.$$typeof===oe&&Lo(Nt)===ve.type){d(we,ve.sibling),Ve=b(ve,Te.props),td(Ve,Te),Ve.return=we,we=Ve;break e}d(we,ve);break}else i(we,ve);ve=ve.sibling}Te.type===N?(Ve=Ws(Te.props.children,we.mode,Ve,Te.key),Ve.return=we,we=Ve):(Ve=To(Te.type,Te.key,Te.props,null,we.mode,Ve),td(Ve,Te),Ve.return=we,we=Ve)}return M(we);case T:e:{for(Nt=Te.key;ve!==null;){if(ve.key===Nt)if(ve.tag===4&&ve.stateNode.containerInfo===Te.containerInfo&&ve.stateNode.implementation===Te.implementation){d(we,ve.sibling),Ve=b(ve,Te.children||[]),Ve.return=we,we=Ve;break e}else{d(we,ve);break}else i(we,ve);ve=ve.sibling}Ve=Yc(Te,we.mode,Ve),Ve.return=we,we=Ve}return M(we);case oe:return Te=Lo(Te),ka(we,ve,Te,Ve)}if(ue(Te))return gt(we,ve,Te,Ve);if(re(Te)){if(Nt=re(Te),typeof Nt!="function")throw Error(s(150));return Te=Nt.call(Te),Tt(we,ve,Te,Ve)}if(typeof Te.then=="function")return ka(we,ve,Zu(Te),Ve);if(Te.$$typeof===O)return ka(we,ve,$u(we,Te),Ve);qu(we,Te)}return typeof Te=="string"&&Te!==""||typeof Te=="number"||typeof Te=="bigint"?(Te=""+Te,ve!==null&&ve.tag===6?(d(we,ve.sibling),Ve=b(ve,Te),Ve.return=we,we=Ve):(d(we,ve),Ve=jl(Te,we.mode,Ve),Ve.return=we,we=Ve),M(we)):d(we,ve)}return function(we,ve,Te,Ve){try{ed=0;var Nt=ka(we,ve,Te,Ve);return Ll=null,Nt}catch(xt){if(xt===Ol||xt===Vu)throw xt;var ra=Cr(29,xt,null,we.mode);return ra.lanes=Ve,ra.return=we,ra}finally{}}}var Do=Gp(!0),Zp=Gp(!1),Di=!1;function kh(n){n.updateQueue={baseState:n.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Nh(n,i){n=n.updateQueue,i.updateQueue===n&&(i.updateQueue={baseState:n.baseState,firstBaseUpdate:n.firstBaseUpdate,lastBaseUpdate:n.lastBaseUpdate,shared:n.shared,callbacks:null})}function Ri(n){return{lane:n,tag:0,payload:null,callback:null,next:null}}function Pi(n,i,d){var m=n.updateQueue;if(m===null)return null;if(m=m.shared,(oa&2)!==0){var b=m.pending;return b===null?i.next=i:(i.next=b.next,b.next=i),m.pending=i,i=jo(n),Li(n,null,d),i}return Ss(n,m,i,d),jo(n)}function ad(n,i,d){if(i=i.updateQueue,i!==null&&(i=i.shared,(d&4194048)!==0)){var m=i.lanes;m&=n.pendingLanes,d|=m,i.lanes=d,Cn(n,d)}}function Sh(n,i){var d=n.updateQueue,m=n.alternate;if(m!==null&&(m=m.updateQueue,d===m)){var b=null,w=null;if(d=d.firstBaseUpdate,d!==null){do{var M={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};w===null?b=w=M:w=w.next=M,d=d.next}while(d!==null);w===null?b=w=i:w=w.next=i}else b=w=i;d={baseState:m.baseState,firstBaseUpdate:b,lastBaseUpdate:w,shared:m.shared,callbacks:m.callbacks},n.updateQueue=d;return}n=d.lastBaseUpdate,n===null?d.firstBaseUpdate=i:n.next=i,d.lastBaseUpdate=i}var jh=!1;function rd(){if(jh){var n=Al;if(n!==null)throw n}}function nd(n,i,d,m){jh=!1;var b=n.updateQueue;Di=!1;var w=b.firstBaseUpdate,M=b.lastBaseUpdate,Z=b.shared.pending;if(Z!==null){b.shared.pending=null;var me=Z,Ce=me.next;me.next=null,M===null?w=Ce:M.next=Ce,M=me;var Ue=n.alternate;Ue!==null&&(Ue=Ue.updateQueue,Z=Ue.lastBaseUpdate,Z!==M&&(Z===null?Ue.firstBaseUpdate=Ce:Z.next=Ce,Ue.lastBaseUpdate=me))}if(w!==null){var Ze=b.baseState;M=0,Ue=Ce=me=null,Z=w;do{var Oe=Z.lane&-536870913,Re=Oe!==Z.lane;if(Re?(Jt&Oe)===Oe:(m&Oe)===Oe){Oe!==0&&Oe===Cl&&(jh=!0),Ue!==null&&(Ue=Ue.next={lane:0,tag:Z.tag,payload:Z.payload,callback:null,next:null});e:{var gt=n,Tt=Z;Oe=i;var ka=d;switch(Tt.tag){case 1:if(gt=Tt.payload,typeof gt=="function"){Ze=gt.call(ka,Ze,Oe);break e}Ze=gt;break e;case 3:gt.flags=gt.flags&-65537|128;case 0:if(gt=Tt.payload,Oe=typeof gt=="function"?gt.call(ka,Ze,Oe):gt,Oe==null)break e;Ze=v({},Ze,Oe);break e;case 2:Di=!0}}Oe=Z.callback,Oe!==null&&(n.flags|=64,Re&&(n.flags|=8192),Re=b.callbacks,Re===null?b.callbacks=[Oe]:Re.push(Oe))}else Re={lane:Oe,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},Ue===null?(Ce=Ue=Re,me=Ze):Ue=Ue.next=Re,M|=Oe;if(Z=Z.next,Z===null){if(Z=b.shared.pending,Z===null)break;Re=Z,Z=Re.next,Re.next=null,b.lastBaseUpdate=Re,b.shared.pending=null}}while(!0);Ue===null&&(me=Ze),b.baseState=me,b.firstBaseUpdate=Ce,b.lastBaseUpdate=Ue,w===null&&(b.shared.lanes=0),Ui|=M,n.lanes=M,n.memoizedState=Ze}}function qp(n,i){if(typeof n!="function")throw Error(s(191,n));n.call(i)}function Yp(n,i){var d=n.callbacks;if(d!==null)for(n.callbacks=null,n=0;nw?w:8;var M=te.T,Z={};te.T=Z,Vh(n,!1,i,d);try{var me=b(),Ce=te.S;if(Ce!==null&&Ce(Z,me),me!==null&&typeof me=="object"&&typeof me.then=="function"){var Ue=i4(me,m);od(n,i,Ue,_n(n))}else od(n,i,m,_n(n))}catch(Ze){od(n,i,{then:function(){},status:"rejected",reason:Ze},_n())}finally{V.p=w,M!==null&&Z.types!==null&&(M.types=Z.types),te.T=M}}function f4(){}function $h(n,i,d,m){if(n.tag!==5)throw Error(s(476));var b=Tx(n).queue;jx(n,b,i,J,d===null?f4:function(){return Ex(n),d(m)})}function Tx(n){var i=n.memoizedState;if(i!==null)return i;i={memoizedState:J,baseState:J,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qs,lastRenderedState:J},next:null};var d={};return i.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qs,lastRenderedState:d},next:null},n.memoizedState=i,n=n.alternate,n!==null&&(n.memoizedState=i),i}function Ex(n){var i=Tx(n);i.next===null&&(i=n.alternate.memoizedState),od(n,i.next.queue,{},_n())}function Wh(){return yr(Nd)}function Cx(){return Ya().memoizedState}function Ax(){return Ya().memoizedState}function h4(n){for(var i=n.return;i!==null;){switch(i.tag){case 24:case 3:var d=_n();n=Ri(d);var m=Pi(i,n,d);m!==null&&(en(m,i,d),ad(m,i,d)),i={cache:bh()},n.payload=i;return}i=i.return}}function m4(n,i,d){var m=_n();d={lane:m,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},n0(n)?Lx(i,d):(d=Gc(n,i,d,m),d!==null&&(en(d,n,m),Mx(d,i,m)))}function Ox(n,i,d){var m=_n();od(n,i,d,m)}function od(n,i,d,m){var b={lane:m,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(n0(n))Lx(i,b);else{var w=n.alternate;if(n.lanes===0&&(w===null||w.lanes===0)&&(w=i.lastRenderedReducer,w!==null))try{var M=i.lastRenderedState,Z=w(M,d);if(b.hasEagerState=!0,b.eagerState=Z,cr(Z,M))return Ss(n,i,b,0),Ta===null&&So(),!1}catch(me){}finally{}if(d=Gc(n,i,b,m),d!==null)return en(d,n,m),Mx(d,i,m),!0}return!1}function Vh(n,i,d,m){if(m={lane:2,revertLane:km(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},n0(n)){if(i)throw Error(s(479))}else i=Gc(n,d,m,2),i!==null&&en(i,n,2)}function n0(n){var i=n.alternate;return n===Bt||i!==null&&i===Bt}function Lx(n,i){Dl=Ku=!0;var d=n.pending;d===null?i.next=i:(i.next=d.next,d.next=i),n.pending=i}function Mx(n,i,d){if((d&4194048)!==0){var m=i.lanes;m&=n.pendingLanes,d|=m,i.lanes=d,Cn(n,d)}}var ld={readContext:yr,use:e0,useCallback:$a,useContext:$a,useEffect:$a,useImperativeHandle:$a,useLayoutEffect:$a,useInsertionEffect:$a,useMemo:$a,useReducer:$a,useRef:$a,useState:$a,useDebugValue:$a,useDeferredValue:$a,useTransition:$a,useSyncExternalStore:$a,useId:$a,useHostTransitionStatus:$a,useFormState:$a,useActionState:$a,useOptimistic:$a,useMemoCache:$a,useCacheRefresh:$a};ld.useEffectEvent=$a;var Dx={readContext:yr,use:e0,useCallback:function(n,i){return Ir().memoizedState=[n,i===void 0?null:i],n},useContext:yr,useEffect:xx,useImperativeHandle:function(n,i,d){d=d!=null?d.concat([n]):null,a0(4194308,4,_x.bind(null,i,n),d)},useLayoutEffect:function(n,i){return a0(4194308,4,n,i)},useInsertionEffect:function(n,i){a0(4,2,n,i)},useMemo:function(n,i){var d=Ir();i=i===void 0?null:i;var m=n();if(Ro){De(!0);try{n()}finally{De(!1)}}return d.memoizedState=[m,i],m},useReducer:function(n,i,d){var m=Ir();if(d!==void 0){var b=d(i);if(Ro){De(!0);try{d(i)}finally{De(!1)}}}else b=i;return m.memoizedState=m.baseState=b,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:n,lastRenderedState:b},m.queue=n,n=n.dispatch=m4.bind(null,Bt,n),[m.memoizedState,n]},useRef:function(n){var i=Ir();return n={current:n},i.memoizedState=n},useState:function(n){n=Ih(n);var i=n.queue,d=Ox.bind(null,Bt,i);return i.dispatch=d,[n.memoizedState,d]},useDebugValue:Uh,useDeferredValue:function(n,i){var d=Ir();return Hh(d,n,i)},useTransition:function(){var n=Ih(!1);return n=jx.bind(null,Bt,n.queue,!0,!1),Ir().memoizedState=n,[!1,n]},useSyncExternalStore:function(n,i,d){var m=Bt,b=Ir();if(qt){if(d===void 0)throw Error(s(407));d=d()}else{if(d=i(),Ta===null)throw Error(s(349));(Jt&127)!==0||tx(m,i,d)}b.memoizedState=d;var w={value:d,getSnapshot:i};return b.queue=w,xx(rx.bind(null,m,w,n),[n]),m.flags|=2048,Pl(9,{destroy:void 0},ax.bind(null,m,w,d,i),null),d},useId:function(){var n=Ir(),i=Ta.identifierPrefix;if(qt){var d=ct,m=Ge;d=(m&~(1<<32-$e(m)-1)).toString(32)+d,i="_"+i+"R_"+d,d=Ju++,0<\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof m.is=="string"?M.createElement("select",{is:m.is}):M.createElement("select"),m.multiple?w.multiple=!0:m.size&&(w.size=m.size);break;default:w=typeof m.is=="string"?M.createElement(b,{is:m.is}):M.createElement(b)}}w[X]=i,w[Q]=m;e:for(M=i.child;M!==null;){if(M.tag===5||M.tag===6)w.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===i)break e;for(;M.sibling===null;){if(M.return===null||M.return===i)break e;M=M.return}M.sibling.return=M.return,M=M.sibling}i.stateNode=w;e:switch(vr(w,b,m),b){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Xs(i)}}return Aa(i),sm(i,i.type,n===null?null:n.memoizedProps,i.pendingProps,d),null;case 6:if(n&&i.stateNode!=null)n.memoizedProps!==m&&Xs(i);else{if(typeof m!="string"&&i.stateNode===null)throw Error(s(166));if(n=fe.current,as(i)){if(n=i.stateNode,d=i.memoizedProps,m=null,b=ta,b!==null)switch(b.tag){case 27:case 5:m=b.memoizedProps}n[X]=i,n=!!(n.nodeValue===d||m!==null&&m.suppressHydrationWarning===!0||Qy(n.nodeValue,d)),n||Ts(i,!0)}else n=N0(n).createTextNode(m),n[X]=i,i.stateNode=n}return Aa(i),null;case 31:if(d=i.memoizedState,n===null||n.memoizedState!==null){if(m=as(i),d!==null){if(n===null){if(!m)throw Error(s(318));if(n=i.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(s(557));n[X]=i}else Vs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Aa(i),n=!1}else d=Kc(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=d),n=!0;if(!n)return i.flags&256?(yn(i),i):(yn(i),null);if((i.flags&128)!==0)throw Error(s(558))}return Aa(i),null;case 13:if(m=i.memoizedState,n===null||n.memoizedState!==null&&n.memoizedState.dehydrated!==null){if(b=as(i),m!==null&&m.dehydrated!==null){if(n===null){if(!b)throw Error(s(318));if(b=i.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(s(317));b[X]=i}else Vs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Aa(i),b=!1}else b=Kc(),n!==null&&n.memoizedState!==null&&(n.memoizedState.hydrationErrors=b),b=!0;if(!b)return i.flags&256?(yn(i),i):(yn(i),null)}return yn(i),(i.flags&128)!==0?(i.lanes=d,i):(d=m!==null,n=n!==null&&n.memoizedState!==null,d&&(m=i.child,b=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(b=m.alternate.memoizedState.cachePool.pool),w=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(w=m.memoizedState.cachePool.pool),w!==b&&(m.flags|=2048)),d!==n&&d&&(i.child.flags|=8192),c0(i,i.updateQueue),Aa(i),null);case 4:return Fe(),n===null&&Tm(i.stateNode.containerInfo),Aa(i),null;case 10:return Gs(i.type),Aa(i),null;case 19:if(D(qa),m=i.memoizedState,m===null)return Aa(i),null;if(b=(i.flags&128)!==0,w=m.rendering,w===null)if(b)dd(m,!1);else{if(Wa!==0||n!==null&&(n.flags&128)!==0)for(n=i.child;n!==null;){if(w=Xu(n),w!==null){for(i.flags|=128,dd(m,!1),n=w.updateQueue,i.updateQueue=n,c0(i,n),i.subtreeFlags=0,n=d,d=i.child;d!==null;)Zc(d,n),d=d.sibling;return G(qa,qa.current&1|2),qt&&vt(i,m.treeForkCount),i.child}n=n.sibling}m.tail!==null&&ft()>m0&&(i.flags|=128,b=!0,dd(m,!1),i.lanes=4194304)}else{if(!b)if(n=Xu(w),n!==null){if(i.flags|=128,b=!0,n=n.updateQueue,i.updateQueue=n,c0(i,n),dd(m,!0),m.tail===null&&m.tailMode==="hidden"&&!w.alternate&&!qt)return Aa(i),null}else 2*ft()-m.renderingStartTime>m0&&d!==536870912&&(i.flags|=128,b=!0,dd(m,!1),i.lanes=4194304);m.isBackwards?(w.sibling=i.child,i.child=w):(n=m.last,n!==null?n.sibling=w:i.child=w,m.last=w)}return m.tail!==null?(n=m.tail,m.rendering=n,m.tail=n.sibling,m.renderingStartTime=ft(),n.sibling=null,d=qa.current,G(qa,b?d&1|2:d&1),qt&&vt(i,m.treeForkCount),n):(Aa(i),null);case 22:case 23:return yn(i),Eh(),m=i.memoizedState!==null,n!==null?n.memoizedState!==null!==m&&(i.flags|=8192):m&&(i.flags|=8192),m?(d&536870912)!==0&&(i.flags&128)===0&&(Aa(i),i.subtreeFlags&6&&(i.flags|=8192)):Aa(i),d=i.updateQueue,d!==null&&c0(i,d.retryQueue),d=null,n!==null&&n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(d=n.memoizedState.cachePool.pool),m=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(m=i.memoizedState.cachePool.pool),m!==d&&(i.flags|=2048),n!==null&&D(Oo),null;case 24:return d=null,n!==null&&(d=n.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),Gs(Ja),Aa(i),null;case 25:return null;case 30:return null}throw Error(s(156,i.tag))}function b4(n,i){switch(Ha(i),i.tag){case 1:return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 3:return Gs(Ja),Fe(),n=i.flags,(n&65536)!==0&&(n&128)===0?(i.flags=n&-65537|128,i):null;case 26:case 27:case 5:return it(i),null;case 31:if(i.memoizedState!==null){if(yn(i),i.alternate===null)throw Error(s(340));Vs()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 13:if(yn(i),n=i.memoizedState,n!==null&&n.dehydrated!==null){if(i.alternate===null)throw Error(s(340));Vs()}return n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 19:return D(qa),null;case 4:return Fe(),null;case 10:return Gs(i.type),null;case 22:case 23:return yn(i),Eh(),n!==null&&D(Oo),n=i.flags,n&65536?(i.flags=n&-65537|128,i):null;case 24:return Gs(Ja),null;case 25:return null;default:return null}}function ny(n,i){switch(Ha(i),i.tag){case 3:Gs(Ja),Fe();break;case 26:case 27:case 5:it(i);break;case 4:Fe();break;case 31:i.memoizedState!==null&&yn(i);break;case 13:yn(i);break;case 19:D(qa);break;case 10:Gs(i.type);break;case 22:case 23:yn(i),Eh(),n!==null&&D(Oo);break;case 24:Gs(Ja)}}function ud(n,i){try{var d=i.updateQueue,m=d!==null?d.lastEffect:null;if(m!==null){var b=m.next;d=b;do{if((d.tag&n)===n){m=void 0;var w=d.create,M=d.inst;m=w(),M.destroy=m}d=d.next}while(d!==b)}}catch(Z){fa(i,i.return,Z)}}function Bi(n,i,d){try{var m=i.updateQueue,b=m!==null?m.lastEffect:null;if(b!==null){var w=b.next;m=w;do{if((m.tag&n)===n){var M=m.inst,Z=M.destroy;if(Z!==void 0){M.destroy=void 0,b=i;var me=d,Ce=Z;try{Ce()}catch(Ue){fa(b,me,Ue)}}}m=m.next}while(m!==w)}}catch(Ue){fa(i,i.return,Ue)}}function sy(n){var i=n.updateQueue;if(i!==null){var d=n.stateNode;try{Yp(i,d)}catch(m){fa(n,n.return,m)}}}function iy(n,i,d){d.props=Po(n.type,n.memoizedProps),d.state=n.memoizedState;try{d.componentWillUnmount()}catch(m){fa(n,i,m)}}function fd(n,i){try{var d=n.ref;if(d!==null){switch(n.tag){case 26:case 27:case 5:var m=n.stateNode;break;case 30:m=n.stateNode;break;default:m=n.stateNode}typeof d=="function"?n.refCleanup=d(m):d.current=m}}catch(b){fa(n,i,b)}}function Cs(n,i){var d=n.ref,m=n.refCleanup;if(d!==null)if(typeof m=="function")try{m()}catch(b){fa(n,i,b)}finally{n.refCleanup=null,n=n.alternate,n!=null&&(n.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(b){fa(n,i,b)}else d.current=null}function oy(n){var i=n.type,d=n.memoizedProps,m=n.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":d.autoFocus&&m.focus();break e;case"img":d.src?m.src=d.src:d.srcSet&&(m.srcset=d.srcSet)}}catch(b){fa(n,n.return,b)}}function im(n,i,d){try{var m=n.stateNode;U4(m,n.type,d,i),m[Q]=i}catch(b){fa(n,n.return,b)}}function ly(n){return n.tag===5||n.tag===3||n.tag===26||n.tag===27&&Gi(n.type)||n.tag===4}function om(n){e:for(;;){for(;n.sibling===null;){if(n.return===null||ly(n.return))return null;n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.tag===27&&Gi(n.type)||n.flags&2||n.child===null||n.tag===4)continue e;n.child.return=n,n=n.child}if(!(n.flags&2))return n.stateNode}}function lm(n,i,d){var m=n.tag;if(m===5||m===6)n=n.stateNode,i?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(n,i):(i=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,i.appendChild(n),d=d._reactRootContainer,d!=null||i.onclick!==null||(i.onclick=Vr));else if(m!==4&&(m===27&&Gi(n.type)&&(d=n.stateNode,i=null),n=n.child,n!==null))for(lm(n,i,d),n=n.sibling;n!==null;)lm(n,i,d),n=n.sibling}function d0(n,i,d){var m=n.tag;if(m===5||m===6)n=n.stateNode,i?d.insertBefore(n,i):d.appendChild(n);else if(m!==4&&(m===27&&Gi(n.type)&&(d=n.stateNode),n=n.child,n!==null))for(d0(n,i,d),n=n.sibling;n!==null;)d0(n,i,d),n=n.sibling}function cy(n){var i=n.stateNode,d=n.memoizedProps;try{for(var m=n.type,b=i.attributes;b.length;)i.removeAttributeNode(b[0]);vr(i,m,d),i[X]=n,i[Q]=d}catch(w){fa(n,n.return,w)}}var Ks=!1,tr=!1,cm=!1,dy=typeof WeakSet=="function"?WeakSet:Set,ur=null;function v4(n,i){if(n=n.containerInfo,Am=O0,n=vo(n),_s(n)){if("selectionStart"in n)var d={start:n.selectionStart,end:n.selectionEnd};else e:{d=(d=n.ownerDocument)&&d.defaultView||window;var m=d.getSelection&&d.getSelection();if(m&&m.rangeCount!==0){d=m.anchorNode;var b=m.anchorOffset,w=m.focusNode;m=m.focusOffset;try{d.nodeType,w.nodeType}catch(Tt){d=null;break e}var M=0,Z=-1,me=-1,Ce=0,Ue=0,Ze=n,Oe=null;t:for(;;){for(var Re;Ze!==d||b!==0&&Ze.nodeType!==3||(Z=M+b),Ze!==w||m!==0&&Ze.nodeType!==3||(me=M+m),Ze.nodeType===3&&(M+=Ze.nodeValue.length),(Re=Ze.firstChild)!==null;)Oe=Ze,Ze=Re;for(;;){if(Ze===n)break t;if(Oe===d&&++Ce===b&&(Z=M),Oe===w&&++Ue===m&&(me=M),(Re=Ze.nextSibling)!==null)break;Ze=Oe,Oe=Ze.parentNode}Ze=Re}d=Z===-1||me===-1?null:{start:Z,end:me}}else d=null}d=d||{start:0,end:0}}else d=null;for(Om={focusedElem:n,selectionRange:d},O0=!1,ur=i;ur!==null;)if(i=ur,n=i.child,(i.subtreeFlags&1028)!==0&&n!==null)n.return=i,ur=n;else for(;ur!==null;){switch(i=ur,w=i.alternate,n=i.flags,i.tag){case 0:if((n&4)!==0&&(n=i.updateQueue,n=n!==null?n.events:null,n!==null))for(d=0;d title"))),vr(w,m,d),w[X]=n,mt(w),m=w;break e;case"link":var M=p1("link","href",b).get(m+(d.href||""));if(M){for(var Z=0;Zka&&(M=ka,ka=Tt,Tt=M);var we=bo(Z,Tt),ve=bo(Z,ka);if(we&&ve&&(Re.rangeCount!==1||Re.anchorNode!==we.node||Re.anchorOffset!==we.offset||Re.focusNode!==ve.node||Re.focusOffset!==ve.offset)){var Te=Ze.createRange();Te.setStart(we.node,we.offset),Re.removeAllRanges(),Tt>ka?(Re.addRange(Te),Re.extend(ve.node,ve.offset)):(Te.setEnd(ve.node,ve.offset),Re.addRange(Te))}}}}for(Ze=[],Re=Z;Re=Re.parentNode;)Re.nodeType===1&&Ze.push({element:Re,left:Re.scrollLeft,top:Re.scrollTop});for(typeof Z.focus=="function"&&Z.focus(),Z=0;Zd?32:d,te.T=null,d=pm,pm=null;var w=$i,M=ai;if(or=0,Ul=$i=null,ai=0,(oa&6)!==0)throw Error(s(331));var Z=oa;if(oa|=4,_y(w.current),yy(w,w.current,M,d),oa=Z,yd(0,!1),xe&&typeof xe.onPostCommitFiberRoot=="function")try{xe.onPostCommitFiberRoot(da,w)}catch(me){}return!0}finally{V.p=b,te.T=m,By(n,i)}}function Uy(n,i,d){i=h(d,i),i=Yh(n.stateNode,i,2),n=Pi(n,i,2),n!==null&&(Rr(n,2),As(n))}function fa(n,i,d){if(n.tag===3)Uy(n,n,d);else for(;i!==null;){if(i.tag===3){Uy(i,n,d);break}else if(i.tag===1){var m=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Hi===null||!Hi.has(m))){n=h(d,n),d=Hx(2),m=Pi(i,d,2),m!==null&&($x(d,m,i,n),Rr(m,2),As(m));break}}i=i.return}}function vm(n,i,d){var m=n.pingCache;if(m===null){m=n.pingCache=new k4;var b=new Set;m.set(i,b)}else b=m.get(i),b===void 0&&(b=new Set,m.set(i,b));b.has(d)||(fm=!0,b.add(d),n=E4.bind(null,n,i,d),i.then(n,n))}function E4(n,i,d){var m=n.pingCache;m!==null&&m.delete(i),n.pingedLanes|=n.suspendedLanes&d,n.warmLanes&=~d,Ta===n&&(Jt&d)===d&&(Wa===4||Wa===3&&(Jt&62914560)===Jt&&300>ft()-h0?(oa&2)===0&&Hl(n,0):hm|=d,zl===Jt&&(zl=0)),As(n)}function Hy(n,i){i===0&&(i=ps()),n=Pn(n,i),n!==null&&(Rr(n,i),As(n))}function C4(n){var i=n.memoizedState,d=0;i!==null&&(d=i.retryLane),Hy(n,d)}function A4(n,i){var d=0;switch(n.tag){case 31:case 13:var m=n.stateNode,b=n.memoizedState;b!==null&&(d=b.retryLane);break;case 19:m=n.stateNode;break;case 22:m=n.stateNode._retryCache;break;default:throw Error(s(314))}m!==null&&m.delete(i),Hy(n,d)}function O4(n,i){return ze(n,i)}var v0=null,Wl=null,_m=!1,_0=!1,wm=!1,Vi=0;function As(n){n!==Wl&&n.next===null&&(Wl===null?v0=Wl=n:Wl=Wl.next=n),_0=!0,_m||(_m=!0,M4())}function yd(n,i){if(!wm&&_0){wm=!0;do for(var d=!1,m=v0;m!==null;){if(n!==0){var b=m.pendingLanes;if(b===0)var w=0;else{var M=m.suspendedLanes,Z=m.pingedLanes;w=(1<<31-$e(42|n)+1)-1,w&=b&~(M&~Z),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(d=!0,Gy(m,w))}else w=Jt,w=Dr(m,m===Ta?w:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(w&3)===0||cn(m,w)||(d=!0,Gy(m,w));m=m.next}while(d);wm=!1}}function L4(){$y()}function $y(){_0=_m=!1;var n=0;Vi!==0&&$4()&&(n=Vi);for(var i=ft(),d=null,m=v0;m!==null;){var b=m.next,w=Wy(m,i);w===0?(m.next=null,d===null?v0=b:d.next=b,b===null&&(Wl=d)):(d=m,(n!==0||(w&3)!==0)&&(_0=!0)),m=b}or!==0&&or!==5||yd(n),Vi!==0&&(Vi=0)}function Wy(n,i){for(var d=n.suspendedLanes,m=n.pingedLanes,b=n.expirationTimes,w=n.pendingLanes&-62914561;0Z)break;var Ue=me.transferSize,Ze=me.initiatorType;Ue&&e1(Ze)&&(me=me.responseEnd,M+=Ue*(me title"):null)}function ik(n,i,d){if(d===1||i.itemProp!=null)return!1;switch(n){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return n=i.disabled,typeof i.precedence=="string"&&n==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function y1(n){return!(n.type==="stylesheet"&&(n.state.loading&3)===0)}function ok(n,i,d,m){if(d.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var b=Gl(m.href),w=i.querySelector(wd(b));if(w){i=w._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(n.count++,n=E0.bind(n),i.then(n,n)),d.state.loading|=4,d.instance=w,mt(w);return}w=i.ownerDocument||i,m=m1(m),(b=zn.get(b))&&Im(m,b),w=w.createElement("link"),mt(w);var M=w;M._p=new Promise(function(Z,me){M.onload=Z,M.onerror=me}),vr(w,"link",m),d.instance=w}n.stylesheets===null&&(n.stylesheets=new Map),n.stylesheets.set(d,i),(i=d.state.preload)&&(d.state.loading&3)===0&&(n.count++,d=E0.bind(n),i.addEventListener("load",d),i.addEventListener("error",d))}}var zm=0;function lk(n,i){return n.stylesheets&&n.count===0&&A0(n,n.stylesheets),0zm?50:800)+i);return n.unsuspend=d,function(){n.unsuspend=null,clearTimeout(m),clearTimeout(b)}}:null}function E0(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)A0(this,this.stylesheets);else if(this.unsuspend){var n=this.unsuspend;this.unsuspend=null,n()}}}var C0=null;function A0(n,i){n.stylesheets=null,n.unsuspend!==null&&(n.count++,C0=new Map,i.forEach(ck,n),C0=null,E0.call(n))}function ck(n,i){if(!(i.state.loading&4)){var d=C0.get(n);if(d)var m=d.get(null);else{d=new Map,C0.set(n,d);for(var b=n.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;wtypeof e=="string",Ad=()=>{let e,t;const a=new Promise((s,o)=>{e=s,t=o});return a.resolve=e,a.reject=t,a},V1=e=>e==null?"":""+e,Lk=(e,t,a)=>{e.forEach(s=>{t[s]&&(a[s]=t[s])})},Mk=/###/g,G1=e=>e&&e.indexOf("###")>-1?e.replace(Mk,"."):e,Z1=e=>!e||Dt(e),Id=(e,t,a)=>{const s=Dt(t)?t.split("."):t;let o=0;for(;o{const{obj:s,k:o}=Id(e,t,Object);if(s!==void 0||t.length===1){s[o]=a;return}let u=t[t.length-1],c=t.slice(0,t.length-1),f=Id(e,c,Object);for(;f.obj===void 0&&c.length;)u=`${c[c.length-1]}.${u}`,c=c.slice(0,c.length-1),f=Id(e,c,Object),f!=null&&f.obj&&typeof f.obj[`${f.k}.${u}`]!="undefined"&&(f.obj=void 0);f.obj[`${f.k}.${u}`]=a},Dk=(e,t,a,s)=>{const{obj:o,k:u}=Id(e,t,Object);o[u]=o[u]||[],o[u].push(a)},of=(e,t)=>{const{obj:a,k:s}=Id(e,t);if(a&&Object.prototype.hasOwnProperty.call(a,s))return a[s]},Rk=(e,t,a)=>{const s=of(e,a);return s!==void 0?s:of(t,a)},zv=(e,t,a)=>{for(const s in t)s!=="__proto__"&&s!=="constructor"&&(s in e?Dt(e[s])||e[s]instanceof String||Dt(t[s])||t[s]instanceof String?a&&(e[s]=t[s]):zv(e[s],t[s],a):e[s]=t[s]);return e},Xl=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Pk={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Fk=e=>Dt(e)?e.replace(/[&<>"'\/]/g,t=>Pk[t]):e;class Ik{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const a=this.regExpMap.get(t);if(a!==void 0)return a;const s=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,s),this.regExpQueue.push(t),s}}const Bk=[" ",",","?","!",";"],zk=new Ik(20),Uk=(e,t,a)=>{t=t||"",a=a||"";const s=Bk.filter(c=>t.indexOf(c)<0&&a.indexOf(c)<0);if(s.length===0)return!0;const o=zk.getRegExp(`(${s.map(c=>c==="?"?"\\?":c).join("|")})`);let u=!o.test(e);if(!u){const c=e.indexOf(a);c>0&&!o.test(e.substring(0,c))&&(u=!0)}return u},Ng=(e,t,a=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const s=t.split(a);let o=e;for(let u=0;u-1&&pe==null?void 0:e.replace("_","-"),Hk={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var a,s;(s=(a=console==null?void 0:console[e])==null?void 0:a.apply)==null||s.call(a,console,t)}};class lf{constructor(t,a={}){this.init(t,a)}init(t,a={}){this.prefix=a.prefix||"i18next:",this.logger=t||Hk,this.options=a,this.debug=a.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,a,s,o){return o&&!this.debug?null:(Dt(t[0])&&(t[0]=`${s}${this.prefix} ${t[0]}`),this.logger[a](t))}create(t){return new lf(this.logger,ie({prefix:`${this.prefix}:${t}:`},this.options))}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new lf(this.logger,t)}}var Rs=new lf;class Lf{constructor(){this.observers={}}on(t,a){return t.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const o=this.observers[s].get(a)||0;this.observers[s].set(a,o+1)}),this}off(t,a){if(this.observers[t]){if(!a){delete this.observers[t];return}this.observers[t].delete(a)}}emit(t,...a){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([o,u])=>{for(let c=0;c{for(let c=0;c-1&&this.options.ns.splice(a,1)}getResource(t,a,s,o={}){var g,x;const u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,c=o.ignoreJSONStructure!==void 0?o.ignoreJSONStructure:this.options.ignoreJSONStructure;let f;t.indexOf(".")>-1?f=t.split("."):(f=[t,a],s&&(Array.isArray(s)?f.push(...s):Dt(s)&&u?f.push(...s.split(u)):f.push(s)));const p=of(this.data,f);return!p&&!a&&!s&&t.indexOf(".")>-1&&(t=f[0],a=f[1],s=f.slice(2).join(".")),p||!c||!Dt(s)?p:Ng((x=(g=this.data)==null?void 0:g[t])==null?void 0:x[a],s,u)}addResource(t,a,s,o,u={silent:!1}){const c=u.keySeparator!==void 0?u.keySeparator:this.options.keySeparator;let f=[t,a];s&&(f=f.concat(c?s.split(c):s)),t.indexOf(".")>-1&&(f=t.split("."),o=a,a=f[1]),this.addNamespaces(a),q1(this.data,f,o),u.silent||this.emit("added",t,a,s,o)}addResources(t,a,s,o={silent:!1}){for(const u in s)(Dt(s[u])||Array.isArray(s[u]))&&this.addResource(t,a,u,s[u],{silent:!0});o.silent||this.emit("added",t,a,s)}addResourceBundle(t,a,s,o,u,c={silent:!1,skipCopy:!1}){let f=[t,a];t.indexOf(".")>-1&&(f=t.split("."),o=s,s=a,a=f[1]),this.addNamespaces(a);let p=of(this.data,f)||{};c.skipCopy||(s=JSON.parse(JSON.stringify(s))),o?zv(p,s,u):p=ie(ie({},p),s),q1(this.data,f,p),c.silent||this.emit("added",t,a,s)}removeResourceBundle(t,a){this.hasResourceBundle(t,a)&&delete this.data[t][a],this.removeNamespaces(a),this.emit("removed",t,a)}hasResourceBundle(t,a){return this.getResource(t,a)!==void 0}getResourceBundle(t,a){return a||(a=this.options.defaultNS),this.getResource(t,a)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const a=this.getDataByLanguage(t);return!!(a&&Object.keys(a)||[]).find(o=>a[o]&&Object.keys(a[o]).length>0)}toJSON(){return this.data}}var Uv={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,a,s,o){return e.forEach(u=>{var c,f;t=(f=(c=this.processors[u])==null?void 0:c.process(t,a,s,o))!=null?f:t}),t}};const Hv=Symbol("i18next/PATH_KEY");function $k(){const e=[],t=Object.create(null);let a;return t.get=(s,o)=>{var u;return(u=a==null?void 0:a.revoke)==null||u.call(a),o===Hv?e:(e.push(o),a=Proxy.revocable(s,t),a.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Sg(e,t){var s;const{[Hv]:a}=e($k());return a.join((s=t==null?void 0:t.keySeparator)!=null?s:".")}const X1={},ag=e=>!Dt(e)&&typeof e!="boolean"&&typeof e!="number";class cf extends Lf{constructor(t,a={}){super(),Lk(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=a,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Rs.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,a={interpolation:{}}){const s=ie({},a);if(t==null)return!1;const o=this.resolve(t,s);if((o==null?void 0:o.res)===void 0)return!1;const u=ag(o.res);return!(s.returnObjects===!1&&u)}extractFromKey(t,a){let s=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let u=a.ns||this.options.defaultNS||[];const c=s&&t.indexOf(s)>-1,f=!this.options.userDefinedKeySeparator&&!a.keySeparator&&!this.options.userDefinedNsSeparator&&!a.nsSeparator&&!Uk(t,s,o);if(c&&!f){const p=t.match(this.interpolator.nestingRegexp);if(p&&p.length>0)return{key:t,namespaces:Dt(u)?[u]:u};const g=t.split(s);(s!==o||s===o&&this.options.ns.indexOf(g[0])>-1)&&(u=g.shift()),t=g.join(o)}return{key:t,namespaces:Dt(u)?[u]:u}}translate(t,a,s){let o=typeof a=="object"?ie({},a):a;if(typeof o!="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),typeof o=="object"&&(o=ie({},o)),o||(o={}),t==null)return"";typeof t=="function"&&(t=Sg(t,ie(ie({},this.options),o))),Array.isArray(t)||(t=[String(t)]);const u=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,c=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,{key:f,namespaces:p}=this.extractFromKey(t[t.length-1],o),g=p[p.length-1];let x=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;x===void 0&&(x=":");const v=o.lng||this.language,_=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((v==null?void 0:v.toLowerCase())==="cimode")return _?u?{res:`${g}${x}${f}`,usedKey:f,exactUsedKey:f,usedLng:v,usedNS:g,usedParams:this.getUsedParamsDetails(o)}:`${g}${x}${f}`:u?{res:f,usedKey:f,exactUsedKey:f,usedLng:v,usedNS:g,usedParams:this.getUsedParamsDetails(o)}:f;const k=this.resolve(t,o);let T=k==null?void 0:k.res;const N=(k==null?void 0:k.usedKey)||f,j=(k==null?void 0:k.exactUsedKey)||f,P=["[object Number]","[object Function]","[object RegExp]"],C=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,O=!this.i18nFormat||this.i18nFormat.handleAsObject,R=o.count!==void 0&&!Dt(o.count),U=cf.hasDefaultValue(o),H=R?this.pluralResolver.getSuffix(v,o.count,o):"",B=o.ordinal&&R?this.pluralResolver.getSuffix(v,o.count,{ordinal:!1}):"",oe=R&&!o.ordinal&&o.count===0,se=oe&&o[`defaultValue${this.options.pluralSeparator}zero`]||o[`defaultValue${H}`]||o[`defaultValue${B}`]||o.defaultValue;let pe=T;O&&!T&&U&&(pe=se);const le=ag(pe),re=Object.prototype.toString.apply(pe);if(O&&pe&&le&&P.indexOf(re)<0&&!(Dt(C)&&Array.isArray(pe))){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const de=this.options.returnedObjectHandler?this.options.returnedObjectHandler(N,pe,Le(ie({},o),{ns:p})):`key '${f} (${this.language})' returned an object instead of string.`;return u?(k.res=de,k.usedParams=this.getUsedParamsDetails(o),k):de}if(c){const de=Array.isArray(pe),ye=de?[]:{},ue=de?j:N;for(const te in pe)if(Object.prototype.hasOwnProperty.call(pe,te)){const V=`${ue}${c}${te}`;U&&!T?ye[te]=this.translate(V,Le(ie({},o),{defaultValue:ag(se)?se[te]:void 0,joinArrays:!1,ns:p})):ye[te]=this.translate(V,Le(ie({},o),{joinArrays:!1,ns:p})),ye[te]===V&&(ye[te]=pe[te])}T=ye}}else if(O&&Dt(C)&&Array.isArray(T))T=T.join(C),T&&(T=this.extendTranslation(T,t,o,s));else{let de=!1,ye=!1;!this.isValidLookup(T)&&U&&(de=!0,T=se),this.isValidLookup(T)||(ye=!0,T=f);const te=(o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ye?void 0:T,V=U&&se!==T&&this.options.updateMissing;if(ye||de||V){if(this.logger.log(V?"updateKey":"missingKey",v,g,f,V?se:T),c){const z=this.resolve(f,Le(ie({},o),{keySeparator:!1}));z&&z.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 J=[];const ne=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ne&&ne[0])for(let z=0;z{var K;const q=U&&G!==T?G:te;this.options.missingKeyHandler?this.options.missingKeyHandler(z,g,D,q,V,o):(K=this.backendConnector)!=null&&K.saveMissing&&this.backendConnector.saveMissing(z,g,D,q,V,o),this.emit("missingKey",z,g,D,T)};this.options.saveMissing&&(this.options.saveMissingPlurals&&R?J.forEach(z=>{const D=this.pluralResolver.getSuffixes(z,o);oe&&o[`defaultValue${this.options.pluralSeparator}zero`]&&D.indexOf(`${this.options.pluralSeparator}zero`)<0&&D.push(`${this.options.pluralSeparator}zero`),D.forEach(G=>{ae([z],f+G,o[`defaultValue${G}`]||se)})}):ae(J,f,se))}T=this.extendTranslation(T,t,o,k,s),ye&&T===f&&this.options.appendNamespaceToMissingKey&&(T=`${g}${x}${f}`),(ye||de)&&this.options.parseMissingKeyHandler&&(T=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${g}${x}${f}`:f,de?T:void 0,o))}return u?(k.res=T,k.usedParams=this.getUsedParamsDetails(o),k):T}extendTranslation(t,a,s,o,u){var p,g;if((p=this.i18nFormat)!=null&&p.parse)t=this.i18nFormat.parse(t,ie(ie({},this.options.interpolation.defaultVariables),s),s.lng||this.language||o.usedLng,o.usedNS,o.usedKey,{resolved:o});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init(Le(ie({},s),{interpolation:ie(ie({},this.options.interpolation),s.interpolation)}));const x=Dt(t)&&(((g=s==null?void 0:s.interpolation)==null?void 0:g.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let v;if(x){const k=t.match(this.interpolator.nestingRegexp);v=k&&k.length}let _=s.replace&&!Dt(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(_=ie(ie({},this.options.interpolation.defaultVariables),_)),t=this.interpolator.interpolate(t,_,s.lng||this.language||o.usedLng,s),x){const k=t.match(this.interpolator.nestingRegexp),T=k&&k.length;v(u==null?void 0:u[0])===k[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${k[0]} in key: ${a[0]}`),null):this.translate(...k,a),s)),s.interpolation&&this.interpolator.reset()}const c=s.postProcess||this.options.postProcess,f=Dt(c)?[c]:c;return t!=null&&(f!=null&&f.length)&&s.applyPostProcessor!==!1&&(t=Uv.handle(f,t,a,this.options&&this.options.postProcessPassResolved?ie({i18nResolved:Le(ie({},o),{usedParams:this.getUsedParamsDetails(s)})},s):s,this)),t}resolve(t,a={}){let s,o,u,c,f;return Dt(t)&&(t=[t]),t.forEach(p=>{if(this.isValidLookup(s))return;const g=this.extractFromKey(p,a),x=g.key;o=x;let v=g.namespaces;this.options.fallbackNS&&(v=v.concat(this.options.fallbackNS));const _=a.count!==void 0&&!Dt(a.count),k=_&&!a.ordinal&&a.count===0,T=a.context!==void 0&&(Dt(a.context)||typeof a.context=="number")&&a.context!=="",N=a.lngs?a.lngs:this.languageUtils.toResolveHierarchy(a.lng||this.language,a.fallbackLng);v.forEach(j=>{var P,C;this.isValidLookup(s)||(f=j,!X1[`${N[0]}-${j}`]&&((P=this.utils)!=null&&P.hasLoadedNamespace)&&!((C=this.utils)!=null&&C.hasLoadedNamespace(f))&&(X1[`${N[0]}-${j}`]=!0,this.logger.warn(`key "${o}" for languages "${N.join(", ")}" won't get resolved as namespace "${f}" 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!!!")),N.forEach(O=>{var H;if(this.isValidLookup(s))return;c=O;const R=[x];if((H=this.i18nFormat)!=null&&H.addLookupKeys)this.i18nFormat.addLookupKeys(R,x,O,j,a);else{let B;_&&(B=this.pluralResolver.getSuffix(O,a.count,a));const oe=`${this.options.pluralSeparator}zero`,se=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(_&&(a.ordinal&&B.indexOf(se)===0&&R.push(x+B.replace(se,this.options.pluralSeparator)),R.push(x+B),k&&R.push(x+oe)),T){const pe=`${x}${this.options.contextSeparator||"_"}${a.context}`;R.push(pe),_&&(a.ordinal&&B.indexOf(se)===0&&R.push(pe+B.replace(se,this.options.pluralSeparator)),R.push(pe+B),k&&R.push(pe+oe))}}let U;for(;U=R.pop();)this.isValidLookup(s)||(u=U,s=this.getResource(O,j,U,a))}))})}),{res:s,usedKey:o,exactUsedKey:u,usedLng:c,usedNS:f}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,a,s,o={}){var u;return(u=this.i18nFormat)!=null&&u.getResource?this.i18nFormat.getResource(t,a,s,o):this.resourceStore.getResource(t,a,s,o)}getUsedParamsDetails(t={}){const a=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=t.replace&&!Dt(t.replace);let o=s?t.replace:t;if(s&&typeof t.count!="undefined"&&(o.count=t.count),this.options.interpolation.defaultVariables&&(o=ie(ie({},this.options.interpolation.defaultVariables),o)),!s){o=ie({},o);for(const u of a)delete o[u]}return o}static hasDefaultValue(t){const a="defaultValue";for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&a===s.substring(0,a.length)&&t[s]!==void 0)return!0;return!1}}class K1{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Rs.create("languageUtils")}getScriptPartFromCode(t){if(t=Zd(t),!t||t.indexOf("-")<0)return null;const a=t.split("-");return a.length===2||(a.pop(),a[a.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(a.join("-"))}getLanguagePartFromCode(t){if(t=Zd(t),!t||t.indexOf("-")<0)return t;const a=t.split("-");return this.formatLanguageCode(a[0])}formatLanguageCode(t){if(Dt(t)&&t.indexOf("-")>-1){let a;try{a=Intl.getCanonicalLocales(t)[0]}catch(s){}return a&&this.options.lowerCaseLng&&(a=a.toLowerCase()),a||(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 a;return t.forEach(s=>{if(a)return;const o=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(o))&&(a=o)}),!a&&this.options.supportedLngs&&t.forEach(s=>{if(a)return;const o=this.getScriptPartFromCode(s);if(this.isSupportedCode(o))return a=o;const u=this.getLanguagePartFromCode(s);if(this.isSupportedCode(u))return a=u;a=this.options.supportedLngs.find(c=>{if(c===u)return c;if(!(c.indexOf("-")<0&&u.indexOf("-")<0)&&(c.indexOf("-")>0&&u.indexOf("-")<0&&c.substring(0,c.indexOf("-"))===u||c.indexOf(u)===0&&u.length>1))return c})}),a||(a=this.getFallbackCodes(this.options.fallbackLng)[0]),a}getFallbackCodes(t,a){if(!t)return[];if(typeof t=="function"&&(t=t(a)),Dt(t)&&(t=[t]),Array.isArray(t))return t;if(!a)return t.default||[];let s=t[a];return s||(s=t[this.getScriptPartFromCode(a)]),s||(s=t[this.formatLanguageCode(a)]),s||(s=t[this.getLanguagePartFromCode(a)]),s||(s=t.default),s||[]}toResolveHierarchy(t,a){const s=this.getFallbackCodes((a===!1?[]:a)||this.options.fallbackLng||[],t),o=[],u=c=>{c&&(this.isSupportedCode(c)?o.push(c):this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`))};return Dt(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&u(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&u(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&u(this.getLanguagePartFromCode(t))):Dt(t)&&u(this.formatLanguageCode(t)),s.forEach(c=>{o.indexOf(c)<0&&u(this.formatLanguageCode(c))}),o}}const J1={zero:0,one:1,two:2,few:3,many:4,other:5},Q1={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Wk{constructor(t,a={}){this.languageUtils=t,this.options=a,this.logger=Rs.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,a){this.rules[t]=a}clearCache(){this.pluralRulesCache={}}getRule(t,a={}){const s=Zd(t==="dev"?"en":t),o=a.ordinal?"ordinal":"cardinal",u=JSON.stringify({cleanedCode:s,type:o});if(u in this.pluralRulesCache)return this.pluralRulesCache[u];let c;try{c=new Intl.PluralRules(s,{type:o})}catch(f){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Q1;if(!t.match(/-|_/))return Q1;const p=this.languageUtils.getLanguagePartFromCode(t);c=this.getRule(p,a)}return this.pluralRulesCache[u]=c,c}needsPlural(t,a={}){let s=this.getRule(t,a);return s||(s=this.getRule("dev",a)),(s==null?void 0:s.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,a,s={}){return this.getSuffixes(t,s).map(o=>`${a}${o}`)}getSuffixes(t,a={}){let s=this.getRule(t,a);return s||(s=this.getRule("dev",a)),s?s.resolvedOptions().pluralCategories.sort((o,u)=>J1[o]-J1[u]).map(o=>`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${o}`):[]}getSuffix(t,a,s={}){const o=this.getRule(t,s);return o?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${o.select(a)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",a,s))}}const eb=(e,t,a,s=".",o=!0)=>{let u=Rk(e,t,a);return!u&&o&&Dt(a)&&(u=Ng(e,a,s),u===void 0&&(u=Ng(t,a,s))),u},rg=e=>e.replace(/\$/g,"$$$$");class tb{constructor(t={}){var a;this.logger=Rs.create("interpolator"),this.options=t,this.format=((a=t==null?void 0:t.interpolation)==null?void 0:a.format)||(s=>s),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:a,escapeValue:s,useRawValueToEscape:o,prefix:u,prefixEscaped:c,suffix:f,suffixEscaped:p,formatSeparator:g,unescapeSuffix:x,unescapePrefix:v,nestingPrefix:_,nestingPrefixEscaped:k,nestingSuffix:T,nestingSuffixEscaped:N,nestingOptionsSeparator:j,maxReplaces:P,alwaysFormat:C}=t.interpolation;this.escape=a!==void 0?a:Fk,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=o!==void 0?o:!1,this.prefix=u?Xl(u):c||"{{",this.suffix=f?Xl(f):p||"}}",this.formatSeparator=g||",",this.unescapePrefix=x?"":v||"-",this.unescapeSuffix=this.unescapePrefix?"":x||"",this.nestingPrefix=_?Xl(_):k||Xl("$t("),this.nestingSuffix=T?Xl(T):N||Xl(")"),this.nestingOptionsSeparator=j||",",this.maxReplaces=P||1e3,this.alwaysFormat=C!==void 0?C:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(a,s)=>(a==null?void 0:a.source)===s?(a.lastIndex=0,a):new RegExp(s,"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,a,s,o){var k;let u,c,f;const p=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},g=T=>{if(T.indexOf(this.formatSeparator)<0){const C=eb(a,p,T,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(C,void 0,s,Le(ie(ie({},o),a),{interpolationkey:T})):C}const N=T.split(this.formatSeparator),j=N.shift().trim(),P=N.join(this.formatSeparator).trim();return this.format(eb(a,p,j,this.options.keySeparator,this.options.ignoreJSONStructure),P,s,Le(ie(ie({},o),a),{interpolationkey:j}))};this.resetRegExp();const x=(o==null?void 0:o.missingInterpolationHandler)||this.options.missingInterpolationHandler,v=((k=o==null?void 0:o.interpolation)==null?void 0:k.skipOnVariables)!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:T=>rg(T)},{regex:this.regexp,safeValue:T=>this.escapeValue?rg(this.escape(T)):rg(T)}].forEach(T=>{for(f=0;u=T.regex.exec(t);){const N=u[1].trim();if(c=g(N),c===void 0)if(typeof x=="function"){const P=x(t,u,o);c=Dt(P)?P:""}else if(o&&Object.prototype.hasOwnProperty.call(o,N))c="";else if(v){c=u[0];continue}else this.logger.warn(`missed to pass in variable ${N} for interpolating ${t}`),c="";else!Dt(c)&&!this.useRawValueToEscape&&(c=V1(c));const j=T.safeValue(c);if(t=t.replace(u[0],j),v?(T.regex.lastIndex+=c.length,T.regex.lastIndex-=u[0].length):T.regex.lastIndex=0,f++,f>=this.maxReplaces)break}}),t}nest(t,a,s={}){let o,u,c;const f=(p,g)=>{var N;const x=this.nestingOptionsSeparator;if(p.indexOf(x)<0)return p;const v=p.split(new RegExp(`${x}[ ]*{`));let _=`{${v[1]}`;p=v[0],_=this.interpolate(_,c);const k=_.match(/'/g),T=_.match(/"/g);(((N=k==null?void 0:k.length)!=null?N:0)%2===0&&!T||T.length%2!==0)&&(_=_.replace(/'/g,'"'));try{c=JSON.parse(_),g&&(c=ie(ie({},g),c))}catch(j){return this.logger.warn(`failed parsing options string in nesting for key ${p}`,j),`${p}${x}${_}`}return c.defaultValue&&c.defaultValue.indexOf(this.prefix)>-1&&delete c.defaultValue,p};for(;o=this.nestingRegexp.exec(t);){let p=[];c=ie({},s),c=c.replace&&!Dt(c.replace)?c.replace:c,c.applyPostProcessor=!1,delete c.defaultValue;const g=/{.*}/.test(o[1])?o[1].lastIndexOf("}")+1:o[1].indexOf(this.formatSeparator);if(g!==-1&&(p=o[1].slice(g).split(this.formatSeparator).map(x=>x.trim()).filter(Boolean),o[1]=o[1].slice(0,g)),u=a(f.call(this,o[1].trim(),c),c),u&&o[0]===t&&!Dt(u))return u;Dt(u)||(u=V1(u)),u||(this.logger.warn(`missed to resolve ${o[1]} for nesting ${t}`),u=""),p.length&&(u=p.reduce((x,v)=>this.format(x,v,s.lng,Le(ie({},s),{interpolationkey:o[1].trim()})),u.trim())),t=t.replace(o[0],u),this.regexp.lastIndex=0}return t}}const Vk=e=>{let t=e.toLowerCase().trim();const a={};if(e.indexOf("(")>-1){const s=e.split("(");t=s[0].toLowerCase().trim();const o=s[1].substring(0,s[1].length-1);t==="currency"&&o.indexOf(":")<0?a.currency||(a.currency=o.trim()):t==="relativetime"&&o.indexOf(":")<0?a.range||(a.range=o.trim()):o.split(";").forEach(c=>{if(c){const[f,...p]=c.split(":"),g=p.join(":").trim().replace(/^'+|'+$/g,""),x=f.trim();a[x]||(a[x]=g),g==="false"&&(a[x]=!1),g==="true"&&(a[x]=!0),isNaN(g)||(a[x]=parseInt(g,10))}})}return{formatName:t,formatOptions:a}},ab=e=>{const t={};return(a,s,o)=>{let u=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(u=Le(ie({},u),{[o.interpolationkey]:void 0}));const c=s+JSON.stringify(u);let f=t[c];return f||(f=e(Zd(s),o),t[c]=f),f(a)}},Gk=e=>(t,a,s)=>e(Zd(a),s)(t);class Zk{constructor(t={}){this.logger=Rs.create("formatter"),this.options=t,this.init(t)}init(t,a={interpolation:{}}){this.formatSeparator=a.interpolation.formatSeparator||",";const s=a.cacheInBuiltFormats?ab:Gk;this.formats={number:s((o,u)=>{const c=new Intl.NumberFormat(o,ie({},u));return f=>c.format(f)}),currency:s((o,u)=>{const c=new Intl.NumberFormat(o,Le(ie({},u),{style:"currency"}));return f=>c.format(f)}),datetime:s((o,u)=>{const c=new Intl.DateTimeFormat(o,ie({},u));return f=>c.format(f)}),relativetime:s((o,u)=>{const c=new Intl.RelativeTimeFormat(o,ie({},u));return f=>c.format(f,u.range||"day")}),list:s((o,u)=>{const c=new Intl.ListFormat(o,ie({},u));return f=>c.format(f)})}}add(t,a){this.formats[t.toLowerCase().trim()]=a}addCached(t,a){this.formats[t.toLowerCase().trim()]=ab(a)}format(t,a,s,o={}){const u=a.split(this.formatSeparator);if(u.length>1&&u[0].indexOf("(")>1&&u[0].indexOf(")")<0&&u.find(f=>f.indexOf(")")>-1)){const f=u.findIndex(p=>p.indexOf(")")>-1);u[0]=[u[0],...u.splice(1,f)].join(this.formatSeparator)}return u.reduce((f,p)=>{var v;const{formatName:g,formatOptions:x}=Vk(p);if(this.formats[g]){let _=f;try{const k=((v=o==null?void 0:o.formatParams)==null?void 0:v[o.interpolationkey])||{},T=k.locale||k.lng||o.locale||o.lng||s;_=this.formats[g](f,T,ie(ie(ie({},x),o),k))}catch(k){this.logger.warn(k)}return _}else this.logger.warn(`there was no format function for ${g}`);return f},t)}}const qk=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Yk extends Lf{constructor(t,a,s,o={}){var u,c;super(),this.backend=t,this.store=a,this.services=s,this.languageUtils=s.languageUtils,this.options=o,this.logger=Rs.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=[],(c=(u=this.backend)==null?void 0:u.init)==null||c.call(u,s,o.backend,o)}queueLoad(t,a,s,o){const u={},c={},f={},p={};return t.forEach(g=>{let x=!0;a.forEach(v=>{const _=`${g}|${v}`;!s.reload&&this.store.hasResourceBundle(g,v)?this.state[_]=2:this.state[_]<0||(this.state[_]===1?c[_]===void 0&&(c[_]=!0):(this.state[_]=1,x=!1,c[_]===void 0&&(c[_]=!0),u[_]===void 0&&(u[_]=!0),p[v]===void 0&&(p[v]=!0)))}),x||(f[g]=!0)}),(Object.keys(u).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:o}),{toLoad:Object.keys(u),pending:Object.keys(c),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(p)}}loaded(t,a,s){const o=t.split("|"),u=o[0],c=o[1];a&&this.emit("failedLoading",u,c,a),!a&&s&&this.store.addResourceBundle(u,c,s,void 0,void 0,{skipCopy:!0}),this.state[t]=a?-1:2,a&&s&&(this.state[t]=0);const f={};this.queue.forEach(p=>{Dk(p.loaded,[u],c),qk(p,t),a&&p.errors.push(a),p.pendingCount===0&&!p.done&&(Object.keys(p.loaded).forEach(g=>{f[g]||(f[g]={});const x=p.loaded[g];x.length&&x.forEach(v=>{f[g][v]===void 0&&(f[g][v]=!0)})}),p.done=!0,p.errors.length?p.callback(p.errors):p.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(p=>!p.done)}read(t,a,s,o=0,u=this.retryTimeout,c){if(!t.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:a,fcName:s,tried:o,wait:u,callback:c});return}this.readingCalls++;const f=(g,x)=>{if(this.readingCalls--,this.waitingReads.length>0){const v=this.waitingReads.shift();this.read(v.lng,v.ns,v.fcName,v.tried,v.wait,v.callback)}if(g&&x&&o{this.read.call(this,t,a,s,o+1,u*2,c)},u);return}c(g,x)},p=this.backend[s].bind(this.backend);if(p.length===2){try{const g=p(t,a);g&&typeof g.then=="function"?g.then(x=>f(null,x)).catch(f):f(null,g)}catch(g){f(g)}return}return p(t,a,f)}prepareLoading(t,a,s={},o){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();Dt(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Dt(a)&&(a=[a]);const u=this.queueLoad(t,a,s,o);if(!u.toLoad.length)return u.pending.length||o(),null;u.toLoad.forEach(c=>{this.loadOne(c)})}load(t,a,s){this.prepareLoading(t,a,{},s)}reload(t,a,s){this.prepareLoading(t,a,{reload:!0},s)}loadOne(t,a=""){const s=t.split("|"),o=s[0],u=s[1];this.read(o,u,"read",void 0,void 0,(c,f)=>{c&&this.logger.warn(`${a}loading namespace ${u} for language ${o} failed`,c),!c&&f&&this.logger.log(`${a}loaded namespace ${u} for language ${o}`,f),this.loaded(t,c,f)})}saveMissing(t,a,s,o,u,c={},f=()=>{}){var p,g,x,v,_;if((g=(p=this.services)==null?void 0:p.utils)!=null&&g.hasLoadedNamespace&&!((v=(x=this.services)==null?void 0:x.utils)!=null&&v.hasLoadedNamespace(a))){this.logger.warn(`did not save key "${s}" as the 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!!!");return}if(!(s==null||s==="")){if((_=this.backend)!=null&&_.create){const k=Le(ie({},c),{isUpdate:u}),T=this.backend.create.bind(this.backend);if(T.length<6)try{let N;T.length===5?N=T(t,a,s,o,k):N=T(t,a,s,o),N&&typeof N.then=="function"?N.then(j=>f(null,j)).catch(f):f(null,N)}catch(N){f(N)}else T(t,a,s,o,f,k)}!t||!t[0]||this.store.addResource(t[0],a,s,o)}}}const rb=()=>({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]),Dt(e[1])&&(t.defaultValue=e[1]),Dt(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const a=e[3]||e[2];Object.keys(a).forEach(s=>{t[s]=a[s]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),nb=e=>{var t,a;return Dt(e.ns)&&(e.ns=[e.ns]),Dt(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Dt(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((a=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:a.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},B0=()=>{},Xk=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(a=>{typeof e[a]=="function"&&(e[a]=e[a].bind(e))})};class Bd extends Lf{constructor(t={},a){if(super(),this.options=nb(t),this.services={},this.logger=Rs,this.modules={external:[]},Xk(this),a&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,a),this;setTimeout(()=>{this.init(t,a)},0)}}init(t={},a){this.isInitializing=!0,typeof t=="function"&&(a=t,t={}),t.defaultNS==null&&t.ns&&(Dt(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const s=rb();this.options=ie(ie(ie({},s),this.options),nb(t)),this.options.interpolation=ie(ie({},s.interpolation),this.options.interpolation),t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=s.overloadTranslationOptionHandler);const o=g=>g?typeof g=="function"?new g:g:null;if(!this.options.isClone){this.modules.logger?Rs.init(o(this.modules.logger),this.options):Rs.init(null,this.options);let g;this.modules.formatter?g=this.modules.formatter:g=Zk;const x=new K1(this.options);this.store=new Y1(this.options.resources,this.options);const v=this.services;v.logger=Rs,v.resourceStore=this.store,v.languageUtils=x,v.pluralResolver=new Wk(x,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),g&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(v.formatter=o(g),v.formatter.init&&v.formatter.init(v,this.options),this.options.interpolation.format=v.formatter.format.bind(v.formatter)),v.interpolator=new tb(this.options),v.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},v.backendConnector=new Yk(o(this.modules.backend),v.resourceStore,v,this.options),v.backendConnector.on("*",(k,...T)=>{this.emit(k,...T)}),this.modules.languageDetector&&(v.languageDetector=o(this.modules.languageDetector),v.languageDetector.init&&v.languageDetector.init(v,this.options.detection,this.options)),this.modules.i18nFormat&&(v.i18nFormat=o(this.modules.i18nFormat),v.i18nFormat.init&&v.i18nFormat.init(this)),this.translator=new cf(this.services,this.options),this.translator.on("*",(k,...T)=>{this.emit(k,...T)}),this.modules.external.forEach(k=>{k.init&&k.init(this)})}if(this.format=this.options.interpolation.format,a||(a=B0),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const g=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);g.length>0&&g[0]!=="dev"&&(this.options.lng=g[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(g=>{this[g]=(...x)=>this.store[g](...x)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(g=>{this[g]=(...x)=>(this.store[g](...x),this)});const f=Ad(),p=()=>{const g=(x,v)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),f.resolve(v),a(x,v)};if(this.languages&&!this.isInitialized)return g(null,this.t.bind(this));this.changeLanguage(this.options.lng,g)};return this.options.resources||!this.options.initAsync?p():setTimeout(p,0),f}loadResources(t,a=B0){var u,c;let s=a;const o=Dt(t)?t:this.language;if(typeof t=="function"&&(s=t),!this.options.resources||this.options.partialBundledLanguages){if((o==null?void 0:o.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const f=[],p=g=>{if(!g||g==="cimode")return;this.services.languageUtils.toResolveHierarchy(g).forEach(v=>{v!=="cimode"&&f.indexOf(v)<0&&f.push(v)})};o?p(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(x=>p(x)),(c=(u=this.options.preload)==null?void 0:u.forEach)==null||c.call(u,g=>p(g)),this.services.backendConnector.load(f,this.options.ns,g=>{!g&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(g)})}else s(null)}reloadResources(t,a,s){const o=Ad();return typeof t=="function"&&(s=t,t=void 0),typeof a=="function"&&(s=a,a=void 0),t||(t=this.languages),a||(a=this.options.ns),s||(s=B0),this.services.backendConnector.reload(t,a,u=>{o.resolve(),s(u)}),o}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&Uv.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let a=0;a-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,a){this.isLanguageChangingTo=t;const s=Ad();this.emit("languageChanging",t);const o=f=>{this.language=f,this.languages=this.services.languageUtils.toResolveHierarchy(f),this.resolvedLanguage=void 0,this.setResolvedLanguage(f)},u=(f,p)=>{p?this.isLanguageChangingTo===t&&(o(p),this.translator.changeLanguage(p),this.isLanguageChangingTo=void 0,this.emit("languageChanged",p),this.logger.log("languageChanged",p)):this.isLanguageChangingTo=void 0,s.resolve((...g)=>this.t(...g)),a&&a(f,(...g)=>this.t(...g))},c=f=>{var x,v;!t&&!f&&this.services.languageDetector&&(f=[]);const p=Dt(f)?f:f&&f[0],g=this.store.hasLanguageSomeTranslations(p)?p:this.services.languageUtils.getBestMatchFromCodes(Dt(f)?[f]:f);g&&(this.language||o(g),this.translator.language||this.translator.changeLanguage(g),(v=(x=this.services.languageDetector)==null?void 0:x.cacheUserLanguage)==null||v.call(x,g)),this.loadResources(g,_=>{u(_,g)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(t),s}getFixedT(t,a,s){const o=(u,c,...f)=>{let p;typeof c!="object"?p=this.options.overloadTranslationOptionHandler([u,c].concat(f)):p=ie({},c),p.lng=p.lng||o.lng,p.lngs=p.lngs||o.lngs,p.ns=p.ns||o.ns,p.keyPrefix!==""&&(p.keyPrefix=p.keyPrefix||s||o.keyPrefix);const g=this.options.keySeparator||".";let x;return p.keyPrefix&&Array.isArray(u)?x=u.map(v=>(typeof v=="function"&&(v=Sg(v,ie(ie({},this.options),c))),`${p.keyPrefix}${g}${v}`)):(typeof u=="function"&&(u=Sg(u,ie(ie({},this.options),c))),x=p.keyPrefix?`${p.keyPrefix}${g}${u}`:u),this.t(x,p)};return Dt(t)?o.lng=t:o.lngs=t,o.ns=a,o.keyPrefix=s,o}t(...t){var a;return(a=this.translator)==null?void 0:a.translate(...t)}exists(...t){var a;return(a=this.translator)==null?void 0:a.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,a={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=a.lng||this.resolvedLanguage||this.languages[0],o=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const c=(f,p)=>{const g=this.services.backendConnector.state[`${f}|${p}`];return g===-1||g===0||g===2};if(a.precheck){const f=a.precheck(this,c);if(f!==void 0)return f}return!!(this.hasResourceBundle(s,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(s,t)&&(!o||c(u,t)))}loadNamespaces(t,a){const s=Ad();return this.options.ns?(Dt(t)&&(t=[t]),t.forEach(o=>{this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}),this.loadResources(o=>{s.resolve(),a&&a(o)}),s):(a&&a(),Promise.resolve())}loadLanguages(t,a){const s=Ad();Dt(t)&&(t=[t]);const o=this.options.preload||[],u=t.filter(c=>o.indexOf(c)<0&&this.services.languageUtils.isSupportedCode(c));return u.length?(this.options.preload=o.concat(u),this.loadResources(c=>{s.resolve(),a&&a(c)}),s):(a&&a(),Promise.resolve())}dir(t){var o,u;if(t||(t=this.resolvedLanguage||(((o=this.languages)==null?void 0:o.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const c=new Intl.Locale(t);if(c&&c.getTextInfo){const f=c.getTextInfo();if(f&&f.direction)return f.direction}}catch(c){}const a=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=((u=this.services)==null?void 0:u.languageUtils)||new K1(rb());return t.toLowerCase().indexOf("-latn")>1?"ltr":a.indexOf(s.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},a){const s=new Bd(t,a);return s.createInstance=Bd.createInstance,s}cloneInstance(t={},a=B0){const s=t.forkResourceStore;s&&delete t.forkResourceStore;const o=Le(ie(ie({},this.options),t),{isClone:!0}),u=new Bd(o);if((t.debug!==void 0||t.prefix!==void 0)&&(u.logger=u.logger.clone(t)),["store","services","language"].forEach(f=>{u[f]=this[f]}),u.services=ie({},this.services),u.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},s){const f=Object.keys(this.store.data).reduce((p,g)=>(p[g]=ie({},this.store.data[g]),p[g]=Object.keys(p[g]).reduce((x,v)=>(x[v]=ie({},p[g][v]),x),p[g]),p),{});u.store=new Y1(f,o),u.services.resourceStore=u.store}return t.interpolation&&(u.services.interpolator=new tb(o)),u.translator=new cf(u.services,o),u.translator.on("*",(f,...p)=>{u.emit(f,...p)}),u.init(o,a),u.translator.options=o,u.translator.backendConnector.services.utils={hasLoadedNamespace:u.hasLoadedNamespace.bind(u)},u}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const gr=Bd.createInstance();gr.createInstance;gr.dir;gr.init;gr.loadResources;gr.reloadResources;gr.use;gr.changeLanguage;gr.getFixedT;gr.t;gr.exists;gr.setDefaultNamespace;gr.hasLoadedNamespace;gr.loadNamespaces;gr.loadLanguages;const Kk=(e,t,a,s)=>{var u,c,f,p;const o=[a,ie({code:t},s||{})];if((c=(u=e==null?void 0:e.services)==null?void 0:u.logger)!=null&&c.forward)return e.services.logger.forward(o,"warn","react-i18next::",!0);Yo(o[0])&&(o[0]=`react-i18next:: ${o[0]}`),(p=(f=e==null?void 0:e.services)==null?void 0:f.logger)!=null&&p.warn?e.services.logger.warn(...o):console!=null&&console.warn&&console.warn(...o)},sb={},$v=(e,t,a,s)=>{Yo(a)&&sb[a]||(Yo(a)&&(sb[a]=new Date),Kk(e,t,a,s))},Wv=(e,t)=>()=>{if(e.isInitialized)t();else{const a=()=>{setTimeout(()=>{e.off("initialized",a)},0),t()};e.on("initialized",a)}},jg=(e,t,a)=>{e.loadNamespaces(t,Wv(e,a))},ib=(e,t,a,s)=>{if(Yo(a)&&(a=[a]),e.options.preload&&e.options.preload.indexOf(t)>-1)return jg(e,a,s);a.forEach(o=>{e.options.ns.indexOf(o)<0&&e.options.ns.push(o)}),e.loadLanguages(t,Wv(e,s))},Jk=(e,t,a={})=>!t.languages||!t.languages.length?($v(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:a.lng,precheck:(s,o)=>{if(a.bindI18n&&a.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!o(s.isLanguageChangingTo,e))return!1}}),Yo=e=>typeof e=="string",Qk=e=>typeof e=="object"&&e!==null,e3=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,t3={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},a3=e=>t3[e],r3=e=>e.replace(e3,a3);let Tg={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:r3};const n3=(e={})=>{Tg=ie(ie({},Tg),e)},s3=()=>Tg;let Vv;const i3=e=>{Vv=e},o3=()=>Vv,l3={type:"3rdParty",init(e){n3(e.options.react),i3(e)}},c3=E.createContext();class d3{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(a=>{this.usedNamespaces[a]||(this.usedNamespaces[a]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var ng={exports:{}},sg={};var ob;function u3(){if(ob)return sg;ob=1;var e=Of();function t(v,_){return v===_&&(v!==0||1/v===1/_)||v!==v&&_!==_}var a=typeof Object.is=="function"?Object.is:t,s=e.useState,o=e.useEffect,u=e.useLayoutEffect,c=e.useDebugValue;function f(v,_){var k=_(),T=s({inst:{value:k,getSnapshot:_}}),N=T[0].inst,j=T[1];return u(function(){N.value=k,N.getSnapshot=_,p(N)&&j({inst:N})},[v,k,_]),o(function(){return p(N)&&j({inst:N}),v(function(){p(N)&&j({inst:N})})},[v]),c(k),k}function p(v){var _=v.getSnapshot;v=v.value;try{var k=_();return!a(v,k)}catch(T){return!0}}function g(v,_){return _()}var x=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?g:f;return sg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:x,sg}var lb;function f3(){return lb||(lb=1,ng.exports=u3()),ng.exports}var h3=f3();const m3=(e,t)=>Yo(t)?t:Qk(t)&&Yo(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,g3={t:m3,ready:!1},p3=()=>()=>{},ln=(e,t={})=>{var se,pe,le;const{i18n:a}=t,{i18n:s,defaultNS:o}=E.useContext(c3)||{},u=a||s||o3();u&&!u.reportNamespaces&&(u.reportNamespaces=new d3),u||$v(u,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const c=E.useMemo(()=>{var re;return ie(ie(ie({},s3()),(re=u==null?void 0:u.options)==null?void 0:re.react),t)},[u,t]),{useSuspense:f,keyPrefix:p}=c,g=o||((se=u==null?void 0:u.options)==null?void 0:se.defaultNS),x=Yo(g)?[g]:g||["translation"],v=E.useMemo(()=>x,x);(le=(pe=u==null?void 0:u.reportNamespaces)==null?void 0:pe.addUsedNamespaces)==null||le.call(pe,v);const _=E.useRef(0),k=E.useCallback(re=>{if(!u)return p3;const{bindI18n:de,bindI18nStore:ye}=c,ue=()=>{_.current+=1,re()};return de&&u.on(de,ue),ye&&u.store.on(ye,ue),()=>{de&&de.split(" ").forEach(te=>u.off(te,ue)),ye&&ye.split(" ").forEach(te=>u.store.off(te,ue))}},[u,c]),T=E.useRef(),N=E.useCallback(()=>{if(!u)return g3;const re=!!(u.isInitialized||u.initializedStoreOnce)&&v.every(J=>Jk(J,u,c)),de=t.lng||u.language,ye=_.current,ue=T.current;if(ue&&ue.ready===re&&ue.lng===de&&ue.keyPrefix===p&&ue.revision===ye)return ue;const V={t:u.getFixedT(de,c.nsMode==="fallback"?v:v[0],p),ready:re,lng:de,keyPrefix:p,revision:ye};return T.current=V,V},[u,v,p,c,t.lng]),[j,P]=E.useState(0),{t:C,ready:O}=h3.useSyncExternalStore(k,N,N);E.useEffect(()=>{if(u&&!O&&!f){const re=()=>P(de=>de+1);t.lng?ib(u,t.lng,v,re):jg(u,v,re)}},[u,t.lng,v,O,f,j]);const R=u||{},U=E.useRef(null),H=E.useRef(),B=re=>{const de=Object.getOwnPropertyDescriptors(re);de.__original&&delete de.__original;const ye=Object.create(Object.getPrototypeOf(re),de);if(!Object.prototype.hasOwnProperty.call(ye,"__original"))try{Object.defineProperty(ye,"__original",{value:re,writable:!1,enumerable:!1,configurable:!1})}catch(ue){}return ye},oe=E.useMemo(()=>{const re=R,de=re==null?void 0:re.language;let ye=re;re&&(U.current&&U.current.__original===re?H.current!==de?(ye=B(re),U.current=ye,H.current=de):ye=U.current:(ye=B(re),U.current=ye,H.current=de));const ue=[C,ye,O];return ue.t=C,ue.i18n=ye,ue.ready=O,ue},[C,R,O,R.resolvedLanguage,R.language,R.languages]);if(u&&f&&!O)throw new Promise(re=>{const de=()=>re();t.lng?ib(u,t.lng,v,de):jg(u,v,de)});return oe},{slice:x3,forEach:y3}=[];function b3(e){return y3.call(x3.call(arguments,1),t=>{if(t)for(const a in t)e[a]===void 0&&(e[a]=t[a])}),e}function v3(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(a=>a.test(e))}const cb=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,_3=function(e,t){const s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},o=encodeURIComponent(t);let u=`${e}=${o}`;if(s.maxAge>0){const c=s.maxAge-0;if(Number.isNaN(c))throw new Error("maxAge should be a Number");u+=`; Max-Age=${Math.floor(c)}`}if(s.domain){if(!cb.test(s.domain))throw new TypeError("option domain is invalid");u+=`; Domain=${s.domain}`}if(s.path){if(!cb.test(s.path))throw new TypeError("option path is invalid");u+=`; Path=${s.path}`}if(s.expires){if(typeof s.expires.toUTCString!="function")throw new TypeError("option expires is invalid");u+=`; Expires=${s.expires.toUTCString()}`}if(s.httpOnly&&(u+="; HttpOnly"),s.secure&&(u+="; Secure"),s.sameSite)switch(typeof s.sameSite=="string"?s.sameSite.toLowerCase():s.sameSite){case!0:u+="; SameSite=Strict";break;case"lax":u+="; SameSite=Lax";break;case"strict":u+="; SameSite=Strict";break;case"none":u+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return s.partitioned&&(u+="; Partitioned"),u},db={create(e,t,a,s){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};a&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+a*60*1e3)),s&&(o.domain=s),document.cookie=_3(e,t,o)},read(e){const t=`${e}=`,a=document.cookie.split(";");for(let s=0;s-1&&(o=window.location.hash.substring(window.location.hash.indexOf("?")));const c=o.substring(1).split("&");for(let f=0;f0&&c[f].substring(0,p)===t&&(a=c[f].substring(p+1))}}return a}},N3={name:"hash",lookup(e){var o;let{lookupHash:t,lookupFromHashIndex:a}=e,s;if(typeof window!="undefined"){const{hash:u}=window.location;if(u&&u.length>2){const c=u.substring(1);if(t){const f=c.split("&");for(let p=0;p0&&f[p].substring(0,g)===t&&(s=f[p].substring(g+1))}}if(s)return s;if(!s&&a>-1){const f=u.match(/\/([a-zA-Z-]*)/g);return Array.isArray(f)?(o=f[typeof a=="number"?a:0])==null?void 0:o.replace("/",""):void 0}}}return s}};let Kl=null;const ub=()=>{if(Kl!==null)return Kl;try{if(Kl=typeof window!="undefined"&&window.localStorage!==null,!Kl)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch(e){Kl=!1}return Kl};var S3={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&ub())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:a}=t;a&&ub()&&window.localStorage.setItem(a,e)}};let Jl=null;const fb=()=>{if(Jl!==null)return Jl;try{if(Jl=typeof window!="undefined"&&window.sessionStorage!==null,!Jl)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch(e){Jl=!1}return Jl};var j3={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&fb())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:a}=t;a&&fb()&&window.sessionStorage.setItem(a,e)}},T3={name:"navigator",lookup(e){const t=[];if(typeof navigator!="undefined"){const{languages:a,userLanguage:s,language:o}=navigator;if(a)for(let u=0;u0?t:void 0}},E3={name:"htmlTag",lookup(e){let{htmlTag:t}=e,a;const s=t||(typeof document!="undefined"?document.documentElement:null);return s&&typeof s.getAttribute=="function"&&(a=s.getAttribute("lang")),a}},C3={name:"path",lookup(e){var o;let{lookupFromPathIndex:t}=e;if(typeof window=="undefined")return;const a=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?(o=a[typeof t=="number"?t:0])==null?void 0:o.replace("/",""):void 0}},A3={name:"subdomain",lookup(e){var o,u;let{lookupFromSubdomainIndex:t}=e;const a=typeof t=="number"?t+1:1,s=typeof window!="undefined"&&((u=(o=window.location)==null?void 0:o.hostname)==null?void 0:u.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(s)return s[a]}};let Gv=!1;try{document.cookie,Gv=!0}catch(e){}const Zv=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Gv||Zv.splice(1,1);const O3=()=>({order:Zv,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class qv{constructor(t){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,a)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=b3(a,this.options||{},O3()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=s,this.addDetector(w3),this.addDetector(k3),this.addDetector(S3),this.addDetector(j3),this.addDetector(T3),this.addDetector(E3),this.addDetector(C3),this.addDetector(A3),this.addDetector(N3)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,a=[];return t.forEach(s=>{if(this.detectors[s]){let o=this.detectors[s].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(a=a.concat(o))}}),a=a.filter(s=>s!=null&&!v3(s)).map(s=>this.options.convertDetectedLanguage(s)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?a:a.length>0?a[0]:null}cacheUserLanguage(t){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;a&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||a.forEach(s=>{this.detectors[s]&&this.detectors[s].cacheUserLanguage(t,this.options)}))}}qv.type="languageDetector";const L3={dashboard:"Dashboard",assets:"Assets",workOrders:"Work Orders",maintenance:"Asset Maintenance",ppm:"PPM",logout:"Logout",login:"Login",email:"Email",password:"Password",submit:"Submit",cancel:"Cancel",save:"Save",delete:"Delete",edit:"Edit",create:"Create",search:"Search",filter:"Filter",export:"Export",import:"Import",loading:"Loading...",noData:"No data available",error:"Error",success:"Success",darkMode:"Dark Mode",lightMode:"Light Mode",language:"Language",english:"English",arabic:"Arabic"},M3={title:"Seera-ASM",loggedInAs:"Logged in as:",version:"Seera-ASM v1.0"},D3={title:"Seera-ASM",subtitle:"Asset Management System",signIn:"Sign in to continue",emailPlaceholder:"Enter your email",passwordPlaceholder:"Enter your password",loginFailed:"Login failed. Please check your credentials.",demoLogin:"Demo Login"},R3={title:"Dashboard",loading:"Loading dashboard...",totalAssets:"TOTAL NO. OF ASSETS",openWorkOrders:"OPEN WORK ORDERS",workOrdersInProgress:"WORK ORDERS IN PROGRESS",completedWorkOrders:"COMPLETED WORK ORDERS",totalWorkOrders:"TOTAL WORK ORDERS",overdueWorkOrders:"OVERDUE WORK ORDERS",upTime:"Up Time",downTime:"Down Time",workOrderStatus:"Work Order Status",workOrderByType:"Work Order by Type",maintenanceByAsset:"Maintenance by Asset",assigneesStatus:"Assignees Status",maintenanceFrequency:"Maintenance Frequency",maintenanceLogs:"MAINTENANCE LOGS",assetUptime:"Asset Uptime",avgResponseTime:"Avg Response Time",maintenanceEfficiency:"Maintenance Efficiency",overdueMaintenance:"Overdue Maintenance",upDownTimeChart:"Up & Down Time Chart",ppmStatus:"PPM Status"},P3={assetId:"Asset ID",assetName:"Asset Name",serialNumber:"Serial Number",company:"Company/Hospital",location:"Location",department:"Department",deviceStatus:"Device Status",modality:"Modality",manufacturer:"Manufacturer",supplier:"Supplier",assetCategory:"Asset Category",purchaseDate:"Purchase Date",purchaseAmount:"Purchase Amount",availableForUseDate:"Available For Use Date",createdOn:"Created On",modifiedOn:"Modified On",createdBy:"Created By",modifiedBy:"Modified By",workOrderId:"Work Order ID",workOrderType:"Type",status:"Status",priority:"Priority",description:"Description",assignedTo:"Assigned To",scheduledDate:"Scheduled Date",completedDate:"Completed Date"},F3={addNew:"Add New",searchPlaceholder:"Search...",noResults:"No results found",showing:"Showing",of:"of",results:"results",selectAll:"Select All",deselectAll:"Deselect All",selected:"selected",actions:"Actions",view:"View",edit:"Edit",delete:"Delete",duplicate:"Duplicate",export:"Export",print:"Print",filters:"Filters",clearFilters:"Clear Filters",applyFilters:"Apply Filters",columns:"Columns",exportSelected:"Export Selected",exportAllOnPage:"Export All on Page",exportAllWithFilters:"Export All with Filters",exportFormat:"Export Format",csv:"CSV",excel:"Excel",exporting:"Exporting...",exportComplete:"Export Complete",close:"Close",loading:"Loading...",refresh:"Refresh"},I3={title:"Assets",addAsset:"Add New Asset",assetDetails:"Asset Details"},B3={title:"Work Orders",addWorkOrder:"Add New Work Order",workOrderDetails:"Work Order Details",newWorkOrder:"New Work Order",duplicateWorkOrder:"Duplicate Work Order",createFromAsset:"Create Work Order from Asset"},z3={title:"Asset Maintenance",maintenanceLogs:"Maintenance Logs",maintenanceDetails:"Maintenance Details",addMaintenance:"Add New Maintenance"},U3={title:"PPM",ppmDetails:"PPM Details",addPPM:"Add New PPM"},H3={title:"Export",whatToExport:"What to Export",selectedRows:"Selected Rows",currentPage:"Current Page",allWithFilters:"All with Filters",exportSelected:"Export {count} selected",exportPage:"Export {count} on current page",exportAll:"Export all {count}",columnsToExport:"Columns to Export",selectAll:"Select All",selectDefault:"Select Default",exporting:"Exporting...",exportingSelected:"Exporting {count} selected row(s)",exportingPage:"Exporting {count} row(s) from current page",exportingAll:"Exporting all {count} row(s)",selected:"selected",rows:"rows"},$3={common:L3,sidebar:M3,login:D3,dashboard:R3,commonFields:P3,listPages:F3,assets:I3,workOrders:B3,maintenance:z3,ppm:U3,exportModal:H3},W3={dashboard:"لوحة التحكم",assets:"الأصول",workOrders:"أوامر العمل",maintenance:"صيانة الأصول",ppm:"الصيانة الوقائية",logout:"تسجيل الخروج",login:"تسجيل الدخول",email:"البريد الإلكتروني",password:"كلمة المرور",submit:"إرسال",cancel:"إلغاء",save:"حفظ",delete:"حذف",edit:"تعديل",create:"إنشاء",search:"بحث",filter:"تصفية",export:"تصدير",import:"استيراد",loading:"جاري التحميل...",noData:"لا توجد بيانات",error:"خطأ",success:"نجح",darkMode:"الوضع الداكن",lightMode:"الوضع الفاتح",language:"اللغة",english:"الإنجليزية",arabic:"العربية"},V3={title:"أصول سيرا",loggedInAs:"تم تسجيل الدخول كـ:",version:"أصول سيرا نظام إدارة الأصول الإصدار 1.0"},G3={title:"أصول سيرا",subtitle:"نظام إدارة الأصول",signIn:"قم بتسجيل الدخول للمتابعة",emailPlaceholder:"أدخل بريدك الإلكتروني",passwordPlaceholder:"أدخل كلمة المرور",loginFailed:"فشل تسجيل الدخول. يرجى التحقق من بيانات الاعتماد الخاصة بك.",demoLogin:"تسجيل دخول تجريبي"},Z3={title:"لوحة التحكم",loading:"جاري تحميل لوحة التحكم...",totalAssets:"إجمالي عدد الأصول",openWorkOrders:"أوامر العمل المفتوحة",workOrdersInProgress:"أوامر العمل قيد التنفيذ",completedWorkOrders:"أوامر العمل المكتملة",totalWorkOrders:"إجمالي أوامر العمل",overdueWorkOrders:"أوامر العمل المتأخرة",upTime:"وقت التشغيل",downTime:"وقت التوقف",workOrderStatus:"حالة أمر العمل",workOrderByType:"أمر العمل حسب النوع",maintenanceByAsset:"الصيانة حسب الأصل",assigneesStatus:"حالة المكلفين",maintenanceFrequency:"تكرار الصيانة",maintenanceLogs:"سجلات الصيانة",assetUptime:"وقت تشغيل الأصل",avgResponseTime:"متوسط وقت الاستجابة",maintenanceEfficiency:"كفاءة الصيانة",overdueMaintenance:"صيانة متأخرة",upDownTimeChart:"مخطط وقت التشغيل والتوقف",ppmStatus:"حالة الصيانة الوقائية"},q3={assetId:"معرف الأصل",assetName:"اسم الأصل",serialNumber:"الرقم التسلسلي",company:"الشركة/المستشفى",location:"الموقع",department:"القسم",deviceStatus:"حالة الجهاز",modality:"الطريقة",manufacturer:"الشركة المصنعة",supplier:"المورد",assetCategory:"فئة الأصل",purchaseDate:"تاريخ الشراء",purchaseAmount:"مبلغ الشراء",availableForUseDate:"تاريخ التوفر للاستخدام",createdOn:"تم الإنشاء في",modifiedOn:"تم التعديل في",createdBy:"تم الإنشاء بواسطة",modifiedBy:"تم التعديل بواسطة",workOrderId:"معرف أمر العمل",workOrderType:"النوع",status:"الحالة",priority:"الأولوية",description:"الوصف",assignedTo:"مكلف إلى",scheduledDate:"التاريخ المجدول",completedDate:"تاريخ الإكمال"},Y3={addNew:"إضافة جديد",searchPlaceholder:"بحث...",noResults:"لم يتم العثور على نتائج",showing:"عرض",of:"من",results:"نتائج",selectAll:"تحديد الكل",deselectAll:"إلغاء تحديد الكل",selected:"محدد",actions:"الإجراءات",view:"عرض",edit:"تعديل",delete:"حذف",duplicate:"نسخ",export:"تصدير",print:"طباعة",filters:"المرشحات",clearFilters:"مسح المرشحات",applyFilters:"تطبيق المرشحات",columns:"الأعمدة",exportSelected:"تصدير المحدد",exportAllOnPage:"تصدير الكل في الصفحة",exportAllWithFilters:"تصدير الكل مع المرشحات",exportFormat:"تنسيق التصدير",csv:"CSV",excel:"Excel",exporting:"جاري التصدير...",exportComplete:"اكتمل التصدير",close:"إغلاق",loading:"جاري التحميل...",refresh:"تحديث"},X3={title:"الأصول",addAsset:"إضافة أصل جديد",assetDetails:"تفاصيل الأصل"},K3={title:"أوامر العمل",addWorkOrder:"إضافة أمر عمل جديد",workOrderDetails:"تفاصيل أمر العمل",newWorkOrder:"أمر عمل جديد",duplicateWorkOrder:"نسخ أمر العمل",createFromAsset:"إنشاء أمر عمل من الأصل"},J3={title:"صيانة الأصول",maintenanceLogs:"سجلات الصيانة",maintenanceDetails:"تفاصيل الصيانة",addMaintenance:"إضافة صيانة جديدة"},Q3={title:"الصيانة الوقائية",ppmDetails:"تفاصيل الصيانة الوقائية",addPPM:"إضافة صيانة وقائية جديدة"},eN={title:"تصدير",whatToExport:"ما الذي سيتم تصديره",selectedRows:"الصفوف المحددة",currentPage:"الصفحة الحالية",allWithFilters:"الكل مع المرشحات",exportSelected:"تصدير {count} محدد",exportPage:"تصدير {count} في الصفحة الحالية",exportAll:"تصدير الكل {count}",columnsToExport:"الأعمدة للتصدير",selectAll:"تحديد الكل",selectDefault:"تحديد الافتراضي",exporting:"جاري التصدير...",exportingSelected:"جاري تصدير {count} صف(وف) محدد(ة)",exportingPage:"جاري تصدير {count} صف(وف) من الصفحة الحالية",exportingAll:"جاري تصدير جميع {count} صف(وف)",selected:"محدد",rows:"صفوف"},tN={common:W3,sidebar:V3,login:G3,dashboard:Z3,commonFields:q3,listPages:Y3,assets:X3,workOrders:K3,maintenance:J3,ppm:Q3,exportModal:eN},Ot={BASE_URL:"https://imanrdh-seeraasm.seeraarabia.com",ENDPOINTS:{USER_DETAILS:"/api/method/asset_lite.api.custom_api.get_user_details",DOCTYPE_RECORDS:"/api/method/asset_lite.api.custom_api.get_doctype_records",DASHBOARD_STATS:"/api/method/asset_lite.api.custom_api.get_dashboard_stats",DASHBOARD_NUMBER_CARDS:"/api/method/asset_lite.api.dashboard_api.get_number_cards",DASHBOARD_LIST_CHARTS:"/api/method/asset_lite.api.dashboard_api.list_dashboard_charts",DASHBOARD_CHART_DATA:"/api/method/asset_lite.api.dashboard_api.get_dashboard_chart_data",DASHBOARD_REPAIR_COST:"/api/method/asset_lite.api.dashboard_api.get_repair_cost_by_item",KYC_DETAILS:"/api/method/asset_lite.api.custom_api.get_kyc_details",GET_ASSETS:"/api/method/asset_lite.api.asset_api.get_assets",GET_ASSET_DETAILS:"/api/method/asset_lite.api.asset_api.get_asset_details",CREATE_ASSET:"/api/method/asset_lite.api.asset_api.create_asset",UPDATE_ASSET:"/api/method/asset_lite.api.asset_api.update_asset",DELETE_ASSET:"/api/method/asset_lite.api.asset_api.delete_asset",GET_ASSET_FILTERS:"/api/method/asset_lite.api.asset_api.get_asset_filters",GET_ASSET_STATS:"/api/method/asset_lite.api.asset_api.get_asset_stats",SEARCH_ASSETS:"/api/method/asset_lite.api.asset_api.search_assets",SUBMIT_ASSET:"/api/method/asset_lite.api.asset_api.submit_asset",CANCEL_ASSET:"/api/method/asset_lite.api.asset_api.cancel_asset",GET_WORK_ORDERS:"/api/method/asset_lite.api.work_order_api.get_work_orders",GET_WORK_ORDER_DETAILS:"/api/method/asset_lite.api.work_order_api.get_work_order_details",CREATE_WORK_ORDER:"/api/method/asset_lite.api.work_order_api.create_work_order",UPDATE_WORK_ORDER:"/api/method/asset_lite.api.work_order_api.update_work_order",DELETE_WORK_ORDER:"/api/method/asset_lite.api.work_order_api.delete_work_order",UPDATE_WORK_ORDER_STATUS:"/api/method/asset_lite.api.work_order_api.update_work_order_status",GET_ASSET_MAINTENANCE_LOGS:"/api/method/asset_lite.api.asset_maintenance_api.get_asset_maintenance_logs",GET_ASSET_MAINTENANCE_LOG_DETAILS:"/api/method/asset_lite.api.asset_maintenance_api.get_asset_maintenance_log_details",CREATE_ASSET_MAINTENANCE_LOG:"/api/method/asset_lite.api.asset_maintenance_api.create_asset_maintenance_log",UPDATE_ASSET_MAINTENANCE_LOG:"/api/method/asset_lite.api.asset_maintenance_api.update_asset_maintenance_log",DELETE_ASSET_MAINTENANCE_LOG:"/api/method/asset_lite.api.asset_maintenance_api.delete_asset_maintenance_log",UPDATE_MAINTENANCE_STATUS:"/api/method/asset_lite.api.asset_maintenance_api.update_maintenance_status",GET_MAINTENANCE_LOGS_BY_ASSET:"/api/method/asset_lite.api.asset_maintenance_api.get_maintenance_logs_by_asset",GET_OVERDUE_MAINTENANCE_LOGS:"/api/method/asset_lite.api.asset_maintenance_api.get_overdue_maintenance_logs",GET_ASSET_MAINTENANCES:"/api/method/asset_lite.api.ppm_api.get_asset_maintenances",GET_ASSET_MAINTENANCE_DETAILS:"/api/method/asset_lite.api.ppm_api.get_asset_maintenance_details",CREATE_ASSET_MAINTENANCE:"/api/method/asset_lite.api.ppm_api.create_asset_maintenance",UPDATE_ASSET_MAINTENANCE:"/api/method/asset_lite.api.ppm_api.update_asset_maintenance",DELETE_ASSET_MAINTENANCE:"/api/method/asset_lite.api.ppm_api.delete_asset_maintenance",GET_MAINTENANCE_TASKS:"/api/method/asset_lite.api.ppm_api.get_maintenance_tasks",GET_SERVICE_COVERAGE:"/api/method/asset_lite.api.ppm_api.get_service_coverage",GET_MAINTENANCES_BY_ASSET:"/api/method/asset_lite.api.ppm_api.get_maintenances_by_asset",GET_ACTIVE_SERVICE_CONTRACTS:"/api/method/asset_lite.api.ppm_api.get_active_service_contracts",LOGIN:"/api/method/login",LOGOUT:"/api/method/logout",CSRF_TOKEN:"/api/method/frappe.sessions.get_csrf_token",UPLOAD_FILE:"/api/method/upload_file",GET_USER_PERMISSIONS:"/api/method/asset_lite.api.userperm_api.get_user_permissions",GET_PERMISSION_FILTERS:"/api/method/asset_lite.api.userperm_api.get_permission_filters",GET_ALLOWED_VALUES:"/api/method/asset_lite.api.userperm_api.get_allowed_values",CHECK_DOCUMENT_ACCESS:"/api/method/asset_lite.api.userperm_api.check_document_access",GET_CONFIGURED_DOCTYPES:"/api/method/asset_lite.api.userperm_api.get_configured_doctypes",GET_USER_DEFAULTS:"/api/method/asset_lite.api.userperm_api.get_user_defaults"},DEFAULT_HEADERS:{"Content-Type":"application/json",Accept:"application/json"},TIMEOUT:parseInt("60000")};class aN{constructor(){Os(this,"baseURL");Os(this,"endpoints");Os(this,"defaultHeaders");Os(this,"timeout");this.baseURL=Ot.BASE_URL,this.endpoints=Ot.ENDPOINTS,this.defaultHeaders=Ot.DEFAULT_HEADERS,this.timeout=Ot.TIMEOUT}getCSRFToken(){return ge(this,null,function*(){try{if(typeof window!="undefined"&&window.csrf_token)return window.csrf_token;if(!localStorage.getItem("user"))return null;const a=yield fetch(`${this.baseURL}${this.endpoints.CSRF_TOKEN}`,{method:"GET",headers:{Accept:"application/json"},credentials:"include"});return a.ok&&(yield a.json()).message||null}catch(t){return null}})}apiCall(s){return ge(this,arguments,function*(t,a={}){const o=`${this.baseURL}${t}`,u=ie({method:"GET",headers:ie(ie({},this.defaultHeaders),a.headers)},a),c=yield this.getCSRFToken();c&&(u.headers["X-Frappe-CSRF-Token"]=c);try{const f=new AbortController,p=setTimeout(()=>f.abort(),this.timeout),g=yield fetch(o,Le(ie({},u),{signal:f.signal}));if(clearTimeout(p),!g.ok){const v=yield g.json().catch(()=>({}));throw new Wo(v.error||`HTTP error! status: ${g.status}`,g.status)}const x=yield g.json();return x.message!==void 0?x.message:x}catch(f){throw f instanceof Error?(console.error("API call failed:",f),new Wo(f.message)):f}})}login(t){return ge(this,null,function*(){const a=new FormData;a.append("usr",t.email),a.append("pwd",t.password);const s=`${this.baseURL}${this.endpoints.LOGIN}`;try{const o=new AbortController,u=setTimeout(()=>o.abort(),this.timeout),c=yield fetch(s,{method:"POST",headers:{Accept:"application/json"},body:a,credentials:"include",signal:o.signal});if(clearTimeout(u),!c.ok){const p=yield c.json().catch(()=>({})),g="Invalid credentials. Please try again.";throw new Wo(g,c.status)}const f=yield c.json();return typeof f.message=="string"&&f.message==="Logged In"?{message:{full_name:f.full_name,user_id:f.user||f.email,home_page:f.home_page,sid:f.sid}}:f.message&&typeof f.message=="object"?{message:f.message}:f.full_name||f.user?{message:f}:{message:f}}catch(o){throw o instanceof Error?new Wo("Login failed. Please try again."):o}})}logout(){return ge(this,null,function*(){yield this.apiCall(this.endpoints.LOGOUT,{method:"POST"})})}getUserDetails(t){return ge(this,null,function*(){const a=t?`?user_id=${t}`:"";return this.apiCall(`${this.endpoints.USER_DETAILS}${a}`)})}getDoctypeRecords(t,a,s,o=20,u=0){return ge(this,null,function*(){const c=new URLSearchParams({doctype:t,limit:o.toString(),offset:u.toString()});return a&&c.append("filters",JSON.stringify(a)),s&&c.append("fields",JSON.stringify(s)),this.apiCall(`${this.endpoints.DOCTYPE_RECORDS}?${c}`)})}getDashboardStats(){return ge(this,null,function*(){return this.apiCall(this.endpoints.DASHBOARD_STATS)})}getNumberCards(){return ge(this,null,function*(){return this.apiCall(this.endpoints.DASHBOARD_NUMBER_CARDS)})}listDashboardCharts(t=!0){return ge(this,null,function*(){const a=new URLSearchParams({public_only:t?"1":"0"});return this.apiCall(`${this.endpoints.DASHBOARD_LIST_CHARTS}?${a}`)})}getDashboardChartData(t,a){return ge(this,null,function*(){const s=new URLSearchParams({chart_name:t});return a&&s.append("report_filters",JSON.stringify(a)),this.apiCall(`${this.endpoints.DASHBOARD_CHART_DATA}?${s}`)})}getKycDetails(){return ge(this,null,function*(){return this.apiCall(this.endpoints.KYC_DETAILS)})}uploadFile(t){return ge(this,null,function*(){const a=new FormData;return a.append("file",t.file),a.append("doctype",t.doctype),a.append("docname",t.docname),a.append("fieldname",t.fieldname),this.apiCall(this.endpoints.UPLOAD_FILE,{method:"POST",headers:{},body:a})})}getUserPermissions(t){return ge(this,null,function*(){const a=t?`?user=${encodeURIComponent(t)}`:"";return this.apiCall(`${this.endpoints.GET_USER_PERMISSIONS}${a}`)})}getPermissionFilters(t,a){return ge(this,null,function*(){const s=new URLSearchParams({target_doctype:t});return a&&s.append("user",a),this.apiCall(`${this.endpoints.GET_PERMISSION_FILTERS}?${s}`)})}getAllowedValues(t,a){return ge(this,null,function*(){const s=new URLSearchParams({allow_doctype:t});return a&&s.append("user",a),this.apiCall(`${this.endpoints.GET_ALLOWED_VALUES}?${s}`)})}checkDocumentAccess(t,a,s){return ge(this,null,function*(){const o=new URLSearchParams({doctype:t,docname:a});return s&&o.append("user",s),this.apiCall(`${this.endpoints.CHECK_DOCUMENT_ACCESS}?${o}`)})}getConfiguredDoctypes(){return ge(this,null,function*(){return this.apiCall(this.endpoints.GET_CONFIGURED_DOCTYPES)})}getUserDefaults(t){return ge(this,null,function*(){const a=t?`?user=${encodeURIComponent(t)}`:"";return this.apiCall(`${this.endpoints.GET_USER_DEFAULTS}${a}`)})}isAuthenticated(){return!!localStorage.getItem("frappe_session_id")}getSessionId(){return localStorage.getItem("frappe_session_id")}setSessionId(t){localStorage.setItem("frappe_session_id",t)}}class Wo extends Error{constructor(a,s,o){super(a);Os(this,"status");Os(this,"code");this.name="ApiError",this.status=s,this.code=o}}const Ke=new aN,rN=Object.freeze(Object.defineProperty({__proto__:null,ApiError:Wo,default:Ke},Symbol.toStringTag,{value:"Module"}));function nN(e){return ge(this,null,function*(){try{const t=yield Ke.getDoctypeRecords("Translation",{language:e},["source_text","translated_text","context"],1e4,0),a={};return t.records&&t.records.length>0&&t.records.forEach(s=>{const o=s.source_text,u=s.translated_text||o;if(s.context){const c=`${s.context}.${o}`;a[c]=u}else o.includes("."),a[o]=u}),a}catch(t){return console.error("Error fetching translations from Frappe:",t),{}}})}function sN(e){const t={};return Object.keys(e).forEach(a=>{if(a.includes(".")){const s=a.split(".");let o=t;for(let u=0;u0&&gr.addResourceBundle("en","translation",t,!0,!0);const a=yield hb("ar");Object.keys(a).length>0&&gr.addResourceBundle("ar","translation",a,!0,!0),console.log("✓ Translations loaded from Frappe")}catch(e){console.warn("⚠ Could not load translations from Frappe, using static translations:",e)}})}gr.on("initialized",()=>{df()});var mb="popstate";function iN(e={}){function t(s,o){let{pathname:u,search:c,hash:f}=s.location;return Eg("",{pathname:u,search:c,hash:f},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function a(s,o){return typeof o=="string"?o:qd(o)}return lN(t,a,null,e)}function Fa(e,t){if(e===!1||e===null||typeof e=="undefined")throw new Error(t)}function jn(e,t){if(!e){typeof console!="undefined"&&console.warn(t);try{throw new Error(t)}catch(a){}}}function oN(){return Math.random().toString(36).substring(2,10)}function gb(e,t){return{usr:e.state,key:e.key,idx:t}}function Eg(e,t,a=null,s){return Le(ie({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?yc(t):t),{state:a,key:t&&t.key||s||oN()})}function qd({pathname:e="/",search:t="",hash:a=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function yc(e){let t={};if(e){let a=e.indexOf("#");a>=0&&(t.hash=e.substring(a),e=e.substring(0,a));let s=e.indexOf("?");s>=0&&(t.search=e.substring(s),e=e.substring(0,s)),e&&(t.pathname=e)}return t}function lN(e,t,a,s={}){let{window:o=document.defaultView,v5Compat:u=!1}=s,c=o.history,f="POP",p=null,g=x();g==null&&(g=0,c.replaceState(Le(ie({},c.state),{idx:g}),""));function x(){return(c.state||{idx:null}).idx}function v(){f="POP";let j=x(),P=j==null?null:j-g;g=j,p&&p({action:f,location:N.location,delta:P})}function _(j,P){f="PUSH";let C=Eg(N.location,j,P);g=x()+1;let O=gb(C,g),R=N.createHref(C);try{c.pushState(O,"",R)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;o.location.assign(R)}u&&p&&p({action:f,location:N.location,delta:1})}function k(j,P){f="REPLACE";let C=Eg(N.location,j,P);g=x();let O=gb(C,g),R=N.createHref(C);c.replaceState(O,"",R),u&&p&&p({action:f,location:N.location,delta:0})}function T(j){return cN(j)}let N={get action(){return f},get location(){return e(o,c)},listen(j){if(p)throw new Error("A history only accepts one active listener");return o.addEventListener(mb,v),p=j,()=>{o.removeEventListener(mb,v),p=null}},createHref(j){return t(o,j)},createURL:T,encodeLocation(j){let P=T(j);return{pathname:P.pathname,search:P.search,hash:P.hash}},push:_,replace:k,go(j){return c.go(j)}};return N}function cN(e,t=!1){let a="http://localhost";typeof window!="undefined"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),Fa(a,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:qd(e);return s=s.replace(/ $/,"%20"),!t&&s.startsWith("//")&&(s=a+s),new URL(s,a)}function Yv(e,t,a="/"){return dN(e,t,a,!1)}function dN(e,t,a,s){let o=typeof t=="string"?yc(t):t,u=di(o.pathname||"/",a);if(u==null)return null;let c=Xv(e);uN(c);let f=null;for(let p=0;f==null&&p{let x={relativePath:g===void 0?c.path||"":g,caseSensitive:c.caseSensitive===!0,childrenIndex:f,route:c};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(s)&&p)return;Fa(x.relativePath.startsWith(s),`Absolute route path "${x.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(s.length)}let v=ni([s,x.relativePath]),_=a.concat(x);c.children&&c.children.length>0&&(Fa(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),Xv(c.children,t,_,v,p)),!(c.path==null&&!c.index)&&t.push({path:v,score:yN(v,c.index),routesMeta:_})};return e.forEach((c,f)=>{var p;if(c.path===""||!((p=c.path)!=null&&p.includes("?")))u(c,f);else for(let g of Kv(c.path))u(c,f,!0,g)}),t}function Kv(e){let t=e.split("/");if(t.length===0)return[];let[a,...s]=t,o=a.endsWith("?"),u=a.replace(/\?$/,"");if(s.length===0)return o?[u,""]:[u];let c=Kv(s.join("/")),f=[];return f.push(...c.map(p=>p===""?u:[u,p].join("/"))),o&&f.push(...c),f.map(p=>e.startsWith("/")&&p===""?"/":p)}function uN(e){e.sort((t,a)=>t.score!==a.score?a.score-t.score:bN(t.routesMeta.map(s=>s.childrenIndex),a.routesMeta.map(s=>s.childrenIndex)))}var fN=/^:[\w-]+$/,hN=3,mN=2,gN=1,pN=10,xN=-2,pb=e=>e==="*";function yN(e,t){let a=e.split("/"),s=a.length;return a.some(pb)&&(s+=xN),t&&(s+=mN),a.filter(o=>!pb(o)).reduce((o,u)=>o+(fN.test(u)?hN:u===""?gN:pN),s)}function bN(e,t){return e.length===t.length&&e.slice(0,-1).every((s,o)=>s===t[o])?e[e.length-1]-t[t.length-1]:0}function vN(e,t,a=!1){let{routesMeta:s}=e,o={},u="/",c=[];for(let f=0;f{if(x==="*"){let T=f[_]||"";c=u.slice(0,u.length-T.length).replace(/(.)\/+$/,"$1")}const k=f[_];return v&&!k?g[x]=void 0:g[x]=(k||"").replace(/%2F/g,"/"),g},{}),pathname:u,pathnameBase:c,pattern:e}}function _N(e,t=!1,a=!0){jn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,f,p)=>(s.push({paramName:f,isOptional:p!=null}),p?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),s]}function wN(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return jn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function di(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,s=e.charAt(a);return s&&s!=="/"?null:e.slice(a)||"/"}var kN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,NN=e=>kN.test(e);function SN(e,t="/"){let{pathname:a,search:s="",hash:o=""}=typeof e=="string"?yc(e):e,u;if(a)if(NN(a))u=a;else{if(a.includes("//")){let c=a;a=a.replace(/\/\/+/g,"/"),jn(!1,`Pathnames cannot have embedded double slashes - normalizing ${c} -> ${a}`)}a.startsWith("/")?u=xb(a.substring(1),"/"):u=xb(a,t)}else u=t;return{pathname:u,search:EN(s),hash:CN(o)}}function xb(e,t){let a=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?a.length>1&&a.pop():o!=="."&&a.push(o)}),a.length>1?a.join("/"):"/"}function ig(e,t,a,s){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function jN(e){return e.filter((t,a)=>a===0||t.route.path&&t.route.path.length>0)}function Vg(e){let t=jN(e);return t.map((a,s)=>s===t.length-1?a.pathname:a.pathnameBase)}function Gg(e,t,a,s=!1){let o;typeof e=="string"?o=yc(e):(o=ie({},e),Fa(!o.pathname||!o.pathname.includes("?"),ig("?","pathname","search",o)),Fa(!o.pathname||!o.pathname.includes("#"),ig("#","pathname","hash",o)),Fa(!o.search||!o.search.includes("#"),ig("#","search","hash",o)));let u=e===""||o.pathname==="",c=u?"/":o.pathname,f;if(c==null)f=a;else{let v=t.length-1;if(!s&&c.startsWith("..")){let _=c.split("/");for(;_[0]==="..";)_.shift(),v-=1;o.pathname=_.join("/")}f=v>=0?t[v]:"/"}let p=SN(o,f),g=c&&c!=="/"&&c.endsWith("/"),x=(u||c===".")&&a.endsWith("/");return!p.pathname.endsWith("/")&&(g||x)&&(p.pathname+="/"),p}var ni=e=>e.join("/").replace(/\/\/+/g,"/"),TN=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),EN=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,CN=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function AN(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function ON(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Jv=["POST","PUT","PATCH","DELETE"];new Set(Jv);var LN=["GET",...Jv];new Set(LN);var bc=E.createContext(null);bc.displayName="DataRouter";var Mf=E.createContext(null);Mf.displayName="DataRouterState";E.createContext(!1);var Qv=E.createContext({isTransitioning:!1});Qv.displayName="ViewTransition";var MN=E.createContext(new Map);MN.displayName="Fetchers";var DN=E.createContext(null);DN.displayName="Await";var Vn=E.createContext(null);Vn.displayName="Navigation";var ru=E.createContext(null);ru.displayName="Location";var hs=E.createContext({outlet:null,matches:[],isDataRoute:!1});hs.displayName="Route";var Zg=E.createContext(null);Zg.displayName="RouteError";function RN(e,{relative:t}={}){Fa(vc(),"useHref() may be used only in the context of a component.");let{basename:a,navigator:s}=E.useContext(Vn),{hash:o,pathname:u,search:c}=nu(e,{relative:t}),f=u;return a!=="/"&&(f=u==="/"?a:ni([a,u])),s.createHref({pathname:f,search:c,hash:o})}function vc(){return E.useContext(ru)!=null}function Is(){return Fa(vc(),"useLocation() may be used only in the context of a component."),E.useContext(ru).location}var e_="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function t_(e){E.useContext(Vn).static||E.useLayoutEffect(e)}function Da(){let{isDataRoute:e}=E.useContext(hs);return e?qN():PN()}function PN(){Fa(vc(),"useNavigate() may be used only in the context of a component.");let e=E.useContext(bc),{basename:t,navigator:a}=E.useContext(Vn),{matches:s}=E.useContext(hs),{pathname:o}=Is(),u=JSON.stringify(Vg(s)),c=E.useRef(!1);return t_(()=>{c.current=!0}),E.useCallback((p,g={})=>{if(jn(c.current,e_),!c.current)return;if(typeof p=="number"){a.go(p);return}let x=Gg(p,JSON.parse(u),o,g.relative==="path");e==null&&t!=="/"&&(x.pathname=x.pathname==="/"?t:ni([t,x.pathname])),(g.replace?a.replace:a.push)(x,g.state,g)},[t,a,u,o,e])}E.createContext(null);function _c(){let{matches:e}=E.useContext(hs),t=e[e.length-1];return t?t.params:{}}function nu(e,{relative:t}={}){let{matches:a}=E.useContext(hs),{pathname:s}=Is(),o=JSON.stringify(Vg(a));return E.useMemo(()=>Gg(e,JSON.parse(o),s,t==="path"),[e,o,s,t])}function FN(e,t){return a_(e,t)}function a_(e,t,a,s,o){var C;Fa(vc(),"useRoutes() may be used only in the context of a component.");let{navigator:u}=E.useContext(Vn),{matches:c}=E.useContext(hs),f=c[c.length-1],p=f?f.params:{},g=f?f.pathname:"/",x=f?f.pathnameBase:"/",v=f&&f.route;{let O=v&&v.path||"";r_(g,!v||O.endsWith("*")||O.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${g}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. Please change the parent to .`)}let _=Is(),k;if(t){let O=typeof t=="string"?yc(t):t;Fa(x==="/"||((C=O.pathname)==null?void 0:C.startsWith(x)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${x}" but pathname "${O.pathname}" was given in the \`location\` prop.`),k=O}else k=_;let T=k.pathname||"/",N=T;if(x!=="/"){let O=x.replace(/^\//,"").split("/");N="/"+T.replace(/^\//,"").split("/").slice(O.length).join("/")}let j=Yv(e,{pathname:N});jn(v||j!=null,`No routes matched location "${k.pathname}${k.search}${k.hash}" `),jn(j==null||j[j.length-1].route.element!==void 0||j[j.length-1].route.Component!==void 0||j[j.length-1].route.lazy!==void 0,`Matched leaf route at location "${k.pathname}${k.search}${k.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let P=HN(j&&j.map(O=>Object.assign({},O,{params:Object.assign({},p,O.params),pathname:ni([x,u.encodeLocation?u.encodeLocation(O.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathname]),pathnameBase:O.pathnameBase==="/"?x:ni([x,u.encodeLocation?u.encodeLocation(O.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathnameBase])})),c,a,s,o);return t&&P?E.createElement(ru.Provider,{value:{location:ie({pathname:"/",search:"",hash:"",state:null,key:"default"},k),navigationType:"POP"}},P):P}function IN(){let e=ZN(),t=AN(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:s},u={padding:"2px 4px",backgroundColor:s},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=E.createElement(E.Fragment,null,E.createElement("p",null,"💿 Hey developer 👋"),E.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",E.createElement("code",{style:u},"ErrorBoundary")," or"," ",E.createElement("code",{style:u},"errorElement")," prop on your route.")),E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},t),a?E.createElement("pre",{style:o},a):null,c)}var BN=E.createElement(IN,null),zN=class extends E.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?E.createElement(hs.Provider,{value:this.props.routeContext},E.createElement(Zg.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function UN({routeContext:e,match:t,children:a}){let s=E.useContext(bc);return s&&s.static&&s.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=t.route.id),E.createElement(hs.Provider,{value:e},a)}function HN(e,t=[],a=null,s=null,o=null){if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(t.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let u=e,c=a==null?void 0:a.errors;if(c!=null){let x=u.findIndex(v=>v.route.id&&(c==null?void 0:c[v.route.id])!==void 0);Fa(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),u=u.slice(0,Math.min(u.length,x+1))}let f=!1,p=-1;if(a)for(let x=0;x=0?u=u.slice(0,p+1):u=[u[0]];break}}}let g=a&&s?(x,v)=>{var _,k,T;s(x,{location:a.location,params:(T=(k=(_=a.matches)==null?void 0:_[0])==null?void 0:k.params)!=null?T:{},unstable_pattern:ON(a.matches),errorInfo:v})}:void 0;return u.reduceRight((x,v,_)=>{let k,T=!1,N=null,j=null;a&&(k=c&&v.route.id?c[v.route.id]:void 0,N=v.route.errorElement||BN,f&&(p<0&&_===0?(r_("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,j=null):p===_&&(T=!0,j=v.route.hydrateFallbackElement||null)));let P=t.concat(u.slice(0,_+1)),C=()=>{let O;return k?O=N:T?O=j:v.route.Component?O=E.createElement(v.route.Component,null):v.route.element?O=v.route.element:O=x,E.createElement(UN,{match:v,routeContext:{outlet:x,matches:P,isDataRoute:a!=null},children:O})};return a&&(v.route.ErrorBoundary||v.route.errorElement||_===0)?E.createElement(zN,{location:a.location,revalidation:a.revalidation,component:N,error:k,children:C(),routeContext:{outlet:null,matches:P,isDataRoute:!0},onError:g}):C()},null)}function qg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $N(e){let t=E.useContext(bc);return Fa(t,qg(e)),t}function WN(e){let t=E.useContext(Mf);return Fa(t,qg(e)),t}function VN(e){let t=E.useContext(hs);return Fa(t,qg(e)),t}function Yg(e){let t=VN(e),a=t.matches[t.matches.length-1];return Fa(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function GN(){return Yg("useRouteId")}function ZN(){var s;let e=E.useContext(Zg),t=WN("useRouteError"),a=Yg("useRouteError");return e!==void 0?e:(s=t.errors)==null?void 0:s[a]}function qN(){let{router:e}=$N("useNavigate"),t=Yg("useNavigate"),a=E.useRef(!1);return t_(()=>{a.current=!0}),E.useCallback((c,...f)=>ge(null,[c,...f],function*(o,u={}){jn(a.current,e_),a.current&&(typeof o=="number"?yield e.navigate(o):yield e.navigate(o,ie({fromRouteId:t},u)))}),[e,t])}var yb={};function r_(e,t,a){!t&&!yb[e]&&(yb[e]=!0,jn(!1,a))}E.memo(YN);function YN({routes:e,future:t,state:a,unstable_onError:s}){return a_(e,void 0,a,s,t)}function Cg({to:e,replace:t,state:a,relative:s}){Fa(vc()," may be used only in the context of a component.");let{static:o}=E.useContext(Vn);jn(!o," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:u}=E.useContext(hs),{pathname:c}=Is(),f=Da(),p=Gg(e,Vg(u),c,s==="path"),g=JSON.stringify(p);return E.useEffect(()=>{f(JSON.parse(g),{replace:t,state:a,relative:s})},[f,g,s,t,a]),null}function ha(e){Fa(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function XN({basename:e="/",children:t=null,location:a,navigationType:s="POP",navigator:o,static:u=!1,unstable_useTransitions:c}){Fa(!vc(),"You cannot render a inside another . You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),p=E.useMemo(()=>({basename:f,navigator:o,static:u,unstable_useTransitions:c,future:{}}),[f,o,u,c]);typeof a=="string"&&(a=yc(a));let{pathname:g="/",search:x="",hash:v="",state:_=null,key:k="default"}=a,T=E.useMemo(()=>{let N=di(g,f);return N==null?null:{location:{pathname:N,search:x,hash:v,state:_,key:k},navigationType:s}},[f,g,x,v,_,k,s]);return jn(T!=null,` is not able to match the URL "${g}${x}${v}" because it does not start with the basename, so the won't render anything.`),T==null?null:E.createElement(Vn.Provider,{value:p},E.createElement(ru.Provider,{children:t,value:T}))}function KN({children:e,location:t}){return FN(Ag(e),t)}function Ag(e,t=[]){let a=[];return E.Children.forEach(e,(s,o)=>{if(!E.isValidElement(s))return;let u=[...t,o];if(s.type===E.Fragment){a.push.apply(a,Ag(s.props.children,u));return}Fa(s.type===ha,`[${typeof s.type=="string"?s.type:s.type.name}] is not a component. All component children of must be a or `),Fa(!s.props.index||!s.props.children,"An index route cannot have child routes.");let c={id:s.props.id||u.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(c.children=Ag(s.props.children,u)),a.push(c)}),a}var ef="get",tf="application/x-www-form-urlencoded";function Df(e){return typeof HTMLElement!="undefined"&&e instanceof HTMLElement}function JN(e){return Df(e)&&e.tagName.toLowerCase()==="button"}function QN(e){return Df(e)&&e.tagName.toLowerCase()==="form"}function eS(e){return Df(e)&&e.tagName.toLowerCase()==="input"}function tS(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function aS(e,t){return e.button===0&&(!t||t==="_self")&&!tS(e)}function Og(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,a)=>{let s=e[a];return t.concat(Array.isArray(s)?s.map(o=>[a,o]):[[a,s]])},[]))}function rS(e,t){let a=Og(e);return t&&t.forEach((s,o)=>{a.has(o)||t.getAll(o).forEach(u=>{a.append(o,u)})}),a}var z0=null;function nS(){if(z0===null)try{new FormData(document.createElement("form"),0),z0=!1}catch(e){z0=!0}return z0}var sS=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function og(e){return e!=null&&!sS.has(e)?(jn(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${tf}"`),null):e}function iS(e,t){let a,s,o,u,c;if(QN(e)){let f=e.getAttribute("action");s=f?di(f,t):null,a=e.getAttribute("method")||ef,o=og(e.getAttribute("enctype"))||tf,u=new FormData(e)}else if(JN(e)||eS(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a
${qe}
Asset ID Asset Name Serial Number Due Date Periodicity Maintenance Type Assigned To Status
Summary: ${Rt.length} planned maintenance entries for the next 5 years
`),Pt.document.close()}catch(ke){console.error("Error fetching PPM Plan:",ke),alert("Failed to load PPM Plan. Please try again.")}}),ia=()=>ge(null,null,function*(){if(!e||o){alert("Please save the asset first to view Asset History");return}try{const ke=yield Ke.apiCall(`/api/resource/Asset/${e}`),ze=(ke==null?void 0:ke.data)||{},Je=yield Ke.apiCall(`/api/resource/Work_Order?filters=[["asset","=","${e}"]]&fields=["name","work_order_type","repair_status","creation","total_repair_cost"]`),nt=(Je==null?void 0:Je.data)||[],ut=yield Ke.apiCall(`/api/resource/Asset Maintenance?filters=[["asset_name","=","${e}"]]&fields=["name","maintenance_team","custom_type_of_maintenance"]`),ft=(ut==null?void 0:ut.data)||[];let bt=[],Ut=[];for(const tt of ft){const Zt=yield Ke.apiCall(`/api/resource/Asset Maintenance/${tt.name}`),Ia=(Zt==null?void 0:Zt.data)||{};Ia.asset_maintenance_tasks&&(Ut=[...Ut,...Ia.asset_maintenance_tasks.map(Dr=>Le(ie({},Dr),{maintenance_id:tt.name}))]);const Ba=yield Ke.apiCall(`/api/resource/Asset Maintenance Log?filters=[["asset_maintenance","=","${tt.name}"]]&fields=["name","maintenance_status","assign_to_name","maintenance_type","due_date","completion_date","periodicity","actions_performed"]&order_by=completion_date desc`);bt=[...bt,...(Ba==null?void 0:Ba.data)||[]]}const Rt=bt.filter(tt=>tt.maintenance_status==="Completed"),Pt=bt.filter(tt=>tt.maintenance_status!=="Completed"),qe={};bt.forEach(tt=>{qe[tt.maintenance_status]=(qe[tt.maintenance_status]||0)+1});const at=ze.custom_spare_parts||[],wt={};at.forEach(tt=>{const Zt=tt.work_order||"Unassigned";wt[Zt]||(wt[Zt]=[]),wt[Zt].push(tt)});const kt=window.open("","_blank");if(!kt)return;const da=nt.length>0?nt.map((tt,Zt)=>{const Ia=tt.repair_status==="Completed"?"bg-green-100 text-green-800":tt.repair_status==="Work In Progress"?"bg-yellow-100 text-yellow-800":"bg-gray-100 text-gray-800";return` ${tt.name} ${tt.work_order_type||"-"} ${tt.repair_status||"-"} ${parseFloat(tt.total_repair_cost||0).toFixed(2)} ر.س ${tt.creation?new Date(tt.creation).toLocaleDateString():"-"} `}).join(""):'No Work Orders Found';let xe="";Object.keys(wt).length>0?Object.keys(wt).forEach(tt=>{xe+=`
Work Order: ${tt}
${wt[tt].map((Zt,Ia)=>` `).join("")}
Item Name Quantity Cost Amount
${Zt.item_code||"-"} ${Zt.qty||0} ${Zt.rate||0} ر.س ${Zt.amount||0} ر.س
`}):xe='

No Spare Parts Used

';const De=ft.length>0?ft.map(tt=>`

Maintenance ID

${tt.name}

Type

${tt.custom_type_of_maintenance||"-"}

Maintenance Team

${tt.maintenance_team||"-"}

`).join(""):'

No Maintenance Records Found

',$e=Ut.length>0?Ut.map((tt,Zt)=>` ${tt.assign_to_name||"-"} ${tt.periodicity||"-"} ${tt.next_due_date||"-"} ${tt.maintenance_id||"-"} `).join(""):'No Maintenance Tasks Found',Et=Object.keys(qe).length>0?Object.entries(qe).map(([tt,Zt])=>`
${tt} ${Zt}
`).join(""):'

No Data

',Gt=Rt.length>0?Rt.map((tt,Zt)=>` ${tt.name} ${tt.assign_to_name||"-"} ${tt.maintenance_type||"-"} ${tt.due_date||"-"} ${tt.completion_date||"-"} ${tt.periodicity||"-"} ${tt.actions_performed||"-"} `).join(""):'No Completed Maintenance Logs',Sa=Pt.length>0?Pt.map((tt,Zt)=>{const Ia=tt.maintenance_status==="Planned"?"bg-blue-100 text-blue-800":"bg-yellow-100 text-yellow-800";return` ${tt.name} ${tt.assign_to_name||"-"} ${tt.maintenance_type||"-"} ${tt.due_date||"-"} ${tt.periodicity||"-"} ${tt.maintenance_status||"-"} ${tt.actions_performed||"-"} `}).join(""):'No Pending/Planned Maintenance Logs';kt.document.write(` Asset History - ${e}