@sme.up/ketchup2 2.0.0-SNAPSHOT-20250616095943 → 2.0.0-SNAPSHOT-20250616143804

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";var Cr=Object.defineProperty;var $r=(r,e,t)=>e in r?Cr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var ve=(r,e,t)=>$r(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("react");function Pr(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const ke=Pr(A);var Ie={exports:{}},je={};/**
1
+ "use strict";var $r=Object.defineProperty;var Pr=(r,e,t)=>e in r?$r(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var ve=(r,e,t)=>Pr(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react");function Ar(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const ke=Ar(P);var Ie={exports:{}},De={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Tt;function Ar(){if(Tt)return je;Tt=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var o in s)o!=="key"&&(a[o]=s[o])}else a=s;return s=a.ref,{$$typeof:r,type:n,key:i,ref:s!==void 0?s:null,props:a}}return je.Fragment=e,je.jsx=t,je.jsxs=t,je}var De={};/**
9
+ */var Tt;function Lr(){if(Tt)return De;Tt=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var o in s)o!=="key"&&(a[o]=s[o])}else a=s;return s=a.ref,{$$typeof:r,type:n,key:i,ref:s!==void 0?s:null,props:a}}return De.Fragment=e,De.jsx=t,De.jsxs=t,De}var Ce={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,37 +14,37 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Ot;function Lr(){return Ot||(Ot=1,process.env.NODE_ENV!=="production"&&function(){function r(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===P?null:p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case g:return"Fragment";case w:return"Profiler";case x:return"StrictMode";case b:return"Suspense";case N:return"SuspenseList";case R:return"Activity"}if(typeof p=="object")switch(typeof p.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),p.$$typeof){case h:return"Portal";case j:return(p.displayName||"Context")+".Provider";case E:return(p._context.displayName||"Context")+".Consumer";case S:var y=p.render;return p=p.displayName,p||(p=y.displayName||y.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case $:return y=p.displayName||null,y!==null?y:r(p.type)||"Memo";case W:y=p._payload,p=p._init;try{return r(p(y))}catch{}}return null}function e(p){return""+p}function t(p){try{e(p);var y=!1}catch{y=!0}if(y){y=console;var T=y.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object";return T.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",C),e(p)}}function n(p){if(p===g)return"<>";if(typeof p=="object"&&p!==null&&p.$$typeof===W)return"<...>";try{var y=r(p);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function s(){var p=D.A;return p===null?null:p.getOwner()}function a(){return Error("react-stack-top-frame")}function i(p){if(I.call(p,"key")){var y=Object.getOwnPropertyDescriptor(p,"key").get;if(y&&y.isReactWarning)return!1}return p.key!==void 0}function o(p,y){function T(){X||(X=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}T.isReactWarning=!0,Object.defineProperty(p,"key",{get:T,configurable:!0})}function c(){var p=r(this.type);return z[p]||(z[p]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),p=this.props.ref,p!==void 0?p:null}function l(p,y,T,C,O,L,F,V){return T=L.ref,p={$$typeof:m,type:p,key:y,props:L,_owner:O},(T!==void 0?T:null)!==null?Object.defineProperty(p,"ref",{enumerable:!1,get:c}):Object.defineProperty(p,"ref",{enumerable:!1,value:null}),p._store={},Object.defineProperty(p._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(p,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(p,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:F}),Object.defineProperty(p,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:V}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p}function f(p,y,T,C,O,L,F,V){var M=y.children;if(M!==void 0)if(C)if(U(M)){for(C=0;C<M.length;C++)u(M[C]);Object.freeze&&Object.freeze(M)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else u(M);if(I.call(y,"key")){M=r(p);var K=Object.keys(y).filter(function(ne){return ne!=="key"});C=0<K.length?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}",_[M+C]||(K=0<K.length?"{"+K.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var Ot;function _r(){return Ot||(Ot=1,process.env.NODE_ENV!=="production"&&function(){function r(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===A?null:p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case g:return"Fragment";case w:return"Profiler";case x:return"StrictMode";case b:return"Suspense";case N:return"SuspenseList";case j:return"Activity"}if(typeof p=="object")switch(typeof p.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),p.$$typeof){case m:return"Portal";case R:return(p.displayName||"Context")+".Provider";case E:return(p._context.displayName||"Context")+".Consumer";case S:var y=p.render;return p=p.displayName,p||(p=y.displayName||y.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case $:return y=p.displayName||null,y!==null?y:r(p.type)||"Memo";case U:y=p._payload,p=p._init;try{return r(p(y))}catch{}}return null}function e(p){return""+p}function t(p){try{e(p);var y=!1}catch{y=!0}if(y){y=console;var T=y.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object";return T.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",C),e(p)}}function n(p){if(p===g)return"<>";if(typeof p=="object"&&p!==null&&p.$$typeof===U)return"<...>";try{var y=r(p);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function s(){var p=D.A;return p===null?null:p.getOwner()}function a(){return Error("react-stack-top-frame")}function i(p){if(k.call(p,"key")){var y=Object.getOwnPropertyDescriptor(p,"key").get;if(y&&y.isReactWarning)return!1}return p.key!==void 0}function o(p,y){function T(){K||(K=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}T.isReactWarning=!0,Object.defineProperty(p,"key",{get:T,configurable:!0})}function c(){var p=r(this.type);return z[p]||(z[p]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),p=this.props.ref,p!==void 0?p:null}function l(p,y,T,C,O,L,F,V){return T=L.ref,p={$$typeof:h,type:p,key:y,props:L,_owner:O},(T!==void 0?T:null)!==null?Object.defineProperty(p,"ref",{enumerable:!1,get:c}):Object.defineProperty(p,"ref",{enumerable:!1,value:null}),p._store={},Object.defineProperty(p._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(p,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(p,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:F}),Object.defineProperty(p,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:V}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p}function u(p,y,T,C,O,L,F,V){var M=y.children;if(M!==void 0)if(C)if(W(M)){for(C=0;C<M.length;C++)f(M[C]);Object.freeze&&Object.freeze(M)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else f(M);if(k.call(y,"key")){M=r(p);var J=Object.keys(y).filter(function(se){return se!=="key"});C=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",_[M+C]||(J=0<J.length?"{"+J.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,C,M,K,M),_[M+C]=!0)}if(M=null,T!==void 0&&(t(T),M=""+T),i(y)&&(t(y.key),M=""+y.key),"key"in y){T={};for(var G in y)G!=="key"&&(T[G]=y[G])}else T=y;return M&&o(T,typeof p=="function"?p.displayName||p.name||"Unknown":p),l(p,M,L,O,s(),T,F,V)}function u(p){typeof p=="object"&&p!==null&&p.$$typeof===m&&p._store&&(p._store.validated=1)}var d=A,m=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),j=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),P=Symbol.for("react.client.reference"),D=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=Object.prototype.hasOwnProperty,U=Array.isArray,H=console.createTask?console.createTask:function(){return null};d={"react-stack-bottom-frame":function(p){return p()}};var X,z={},Z=d["react-stack-bottom-frame"].bind(d,a)(),B=H(n(a)),_={};De.Fragment=g,De.jsx=function(p,y,T,C,O){var L=1e4>D.recentlyCreatedOwnerStacks++;return f(p,y,T,!1,C,O,L?Error("react-stack-top-frame"):Z,L?H(n(p)):B)},De.jsxs=function(p,y,T,C,O){var L=1e4>D.recentlyCreatedOwnerStacks++;return f(p,y,T,!0,C,O,L?Error("react-stack-top-frame"):Z,L?H(n(p)):B)}}()),De}var Rt;function _r(){return Rt||(Rt=1,process.env.NODE_ENV==="production"?Ie.exports=Ar():Ie.exports=Lr()),Ie.exports}var v=_r();const se={AUTOCOMPLETE:"ACP",BUTTON_LIST:"BTL",BUTTON:"BTN",CHECKBOX:"CHK",CHIP:"CHI",COMBOBOX:"CMB",DATE:"CAL",ICON:"ICO",IMAGE:"IMG",MULTI_AUTOCOMPLETE:"AML",SPOTLIGHT:"SPL",TEXT_FIELD:"ITX",PASSWORD:"PWD"},kr=r=>r.t=="D8",Ir=r=>{if(r){const e=r.split(";");if(e.length==3)return{t:e[0],p:e[1],k:e[2]}}return{t:"",p:"",k:""}};class He{constructor(e,t){ve(this,"class");ve(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new He(e,e.k=="1"||e.k=="true")}getValue(){return this.value}getLegacyValue(){if(this.class.t=="V2"){if(this.class.p=="SI/NO")return this.value?"1":" ";if(this.class.p=="ON/OFF")return this.value?"1":"0"}return this.value?"true":"false"}}function Nr(r,e){if(gt(r)){const f=new Date(r);if(!isNaN(f.getTime()))return f}const t=new Date,n=r.replaceAll("/","").replaceAll("-","");let s="DDMMYYYY";e==="en"&&(s="MMDDYYYY");const a=s.indexOf("DD"),i=s.indexOf("MM");let o=0,c=0,l="";switch(n.length){case 1:case 2:return o=parseInt(n),t.setDate(o),Ne(t)?t:r;case 3:case 4:return o=parseInt(n.substring(0,2)),c=parseInt(n.substring(2,4)),i===0?(t.setMonth(o-1),t.setDate(c)):a===0&&(t.setMonth(c-1),t.setDate(o)),Ne(t)?t:r;case 5:case 6:{o=parseInt(n.substring(0,2)),c=parseInt(n.substring(2,4)),Number(n.substring(4))>50?l="19"+n.substring(4):l="20"+n.substring(4);let f=0,u=0;return i===0?(f=c,u=o-1,t.setFullYear(parseInt(l),u,f)):a===0&&(f=o,u=c-1,t.setFullYear(parseInt(l),u,f)),ft(o,u,parseInt(l))&&Ne(t)?t:r}case 7:case 8:{o=parseInt(n.substring(0,2)),c=parseInt(n.substring(2,4)),l=n.substring(4);let f=0,u=0;return i===0?(f=c,u=o-1,t.setFullYear(parseInt(l),u,f)):a===0&&(f=o,u=c-1,t.setFullYear(parseInt(l),u,f)),ft(f,u,parseInt(l))&&Ne(t)?t:r}}return r}function gt(r){return/^\d{4}-\d{2}-\d{2}$/.test(r)&&r.length===10}function Ne(r){return r instanceof Date&&!isNaN(r.getTime())}function Mr(r){if(!/^\d{8}$/.test(r))return!1;const e=parseInt(r.slice(0,4),10),t=parseInt(r.slice(4,6),10),n=parseInt(r.slice(6,8),10);return ft(n,t-1,e)}function ft(r,e,t){const n=[31,Fr(t)?29:28,31,30,31,30,31,31,30,31,30,31];return!(e<0||e>11||r<1||r>n[e])}function Fr(r){return r%4===0&&(r%100!==0||r%400===0)}function Vr(r){const e=r.getFullYear(),t=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0");return isNaN(e)||isNaN(Number(t))||isNaN(Number(n))?r.toString():`${e}-${t}-${n}`}class Ge{constructor(e,t){ve(this,"class");ve(this,"date");this.class=e,this.date=t}static fromDataObj(e){const t=jt.get(`${e.t}${e.p}`);if(t)return new Ge(e,t.legacyToIso(e.k));throw new Error(`Date creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=jt.get(`${this.class.t}${this.class.p}`);if(e)return e.isoToLegacy(this.date);throw new Error(`Date object not implemented ${this.class.t}${this.class.p}`)}getValue(){return this.date}}const jt=new Map([["D8*YYMD",{legacyToIso(r){return Mr(r)&&`${r.substring(0,4)}-${r.substring(4,6)}-${r.substring(6,8)}`||r},isoToLegacy(r){return gt(r)&&r.replaceAll("-","")||r}}]]),qe=(r,e)=>{A.useEffect(()=>{const t=n=>{typeof r=="object"&&r!==null&&"current"in r&&r.current&&!r.current.contains(n.target)&&e()};return document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[r,e])};function yt({position:r="bottom",enabled:e=!0}){const t=A.useRef(null),n=A.useRef(null),[s,a]=A.useState(0),i=A.useCallback(()=>{const o=t.current,c=n.current;if(!o||!c)return;const{top:l,left:f,width:u,height:d}=o.getBoundingClientRect();a(u);const m=c.offsetHeight,h=c.offsetWidth;if(h===0||m===0){requestAnimationFrame(i);return}let g=l+window.scrollY,x=f+window.scrollX;switch(r){case"top":g-=m;break;case"bottom":g+=d;break;case"left":x-=h;break;case"right":x+=u;break}requestAnimationFrame(()=>{c.style.transform=`translate(${x}px, ${g}px)`})},[r]);return A.useLayoutEffect(()=>{e&&t.current&&n.current&&i();const o=new MutationObserver(()=>{n.current&&i()});return n.current&&o.observe(n.current,{childList:!0,subtree:!0}),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),()=>{window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),o.disconnect()}},[i,e]),{anchorRef:t,targetRef:n,anchorWidth:s}}const ze=(r,e,t)=>{if(t)switch(t){case"CodeOnly":return r;case"DescOnly":return e||"";case"Both":return`${r} - ${e}`}return r},Yr=({helperText:r,disabled:e,state:t})=>{const n={container:`smp-helper-text ${e?"smp-helper-text-disabled":""} ${t?`smp-helper-text-${t}`:""}`};return v.jsx("span",{className:n.container,children:r})},_e=({label:r,disabled:e})=>{const t={container:`smp-label ${e?"smp-label-disabled":""}`};return v.jsx("span",{className:t.container,children:r})};function Ur(r,e){if(r==null)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.indexOf(n)!==-1)continue;t[n]=r[n]}return t}function Ke(){return Ke=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},Ke.apply(null,arguments)}function dt(r,e){return dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},dt(r,e)}function Wr(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,dt(r,e)}function tt(r,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,a;n<s;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))}var Me={};/*!
22
+ <%s key={someKey} {...props} />`,C,M,J,M),_[M+C]=!0)}if(M=null,T!==void 0&&(t(T),M=""+T),i(y)&&(t(y.key),M=""+y.key),"key"in y){T={};for(var G in y)G!=="key"&&(T[G]=y[G])}else T=y;return M&&o(T,typeof p=="function"?p.displayName||p.name||"Unknown":p),l(p,M,L,O,s(),T,F,V)}function f(p){typeof p=="object"&&p!==null&&p.$$typeof===h&&p._store&&(p._store.validated=1)}var d=P,h=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),R=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),A=Symbol.for("react.client.reference"),D=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=Object.prototype.hasOwnProperty,W=Array.isArray,B=console.createTask?console.createTask:function(){return null};d={"react-stack-bottom-frame":function(p){return p()}};var K,z={},X=d["react-stack-bottom-frame"].bind(d,a)(),H=B(n(a)),_={};Ce.Fragment=g,Ce.jsx=function(p,y,T,C,O){var L=1e4>D.recentlyCreatedOwnerStacks++;return u(p,y,T,!1,C,O,L?Error("react-stack-top-frame"):X,L?B(n(p)):H)},Ce.jsxs=function(p,y,T,C,O){var L=1e4>D.recentlyCreatedOwnerStacks++;return u(p,y,T,!0,C,O,L?Error("react-stack-top-frame"):X,L?B(n(p)):H)}}()),Ce}var Rt;function kr(){return Rt||(Rt=1,process.env.NODE_ENV==="production"?Ie.exports=Lr():Ie.exports=_r()),Ie.exports}var v=kr();const ne={AUTOCOMPLETE:"ACP",BUTTON_LIST:"BTL",BUTTON:"BTN",CHECKBOX:"CHK",CHIP:"CHI",COMBOBOX:"CMB",DATE:"CAL",ICON:"ICO",IMAGE:"IMG",MEMO:"MEM",MULTI_AUTOCOMPLETE:"AML",SPOTLIGHT:"SPL",SWITCH:"SWT",TEXT_FIELD:"ITX",PASSWORD:"PWD"},Ir=r=>r.t=="D8",Nr=r=>{if(r){const e=r.split(";");if(e.length==3)return{t:e[0],p:e[1],k:e[2]}}return{t:"",p:"",k:""}};class Be{constructor(e,t){ve(this,"class");ve(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Be(e,e.k=="1"||e.k=="true")}getValue(){return this.value}getLegacyValue(){if(this.class.t=="V2"){if(this.class.p=="SI/NO")return this.value?"1":" ";if(this.class.p=="ON/OFF")return this.value?"1":"0"}return this.value?"true":"false"}}function Mr(r,e){if(gt(r)){const u=new Date(r);if(!isNaN(u.getTime()))return u}const t=new Date,n=r.replaceAll("/","").replaceAll("-","");let s="DDMMYYYY";e==="en"&&(s="MMDDYYYY");const a=s.indexOf("DD"),i=s.indexOf("MM");let o=0,c=0,l="";switch(n.length){case 1:case 2:return o=parseInt(n),t.setDate(o),Ne(t)?t:r;case 3:case 4:return o=parseInt(n.substring(0,2)),c=parseInt(n.substring(2,4)),i===0?(t.setMonth(o-1),t.setDate(c)):a===0&&(t.setMonth(c-1),t.setDate(o)),Ne(t)?t:r;case 5:case 6:{o=parseInt(n.substring(0,2)),c=parseInt(n.substring(2,4)),Number(n.substring(4))>50?l="19"+n.substring(4):l="20"+n.substring(4);let u=0,f=0;return i===0?(u=c,f=o-1,t.setFullYear(parseInt(l),f,u)):a===0&&(u=o,f=c-1,t.setFullYear(parseInt(l),f,u)),ft(o,f,parseInt(l))&&Ne(t)?t:r}case 7:case 8:{o=parseInt(n.substring(0,2)),c=parseInt(n.substring(2,4)),l=n.substring(4);let u=0,f=0;return i===0?(u=c,f=o-1,t.setFullYear(parseInt(l),f,u)):a===0&&(u=o,f=c-1,t.setFullYear(parseInt(l),f,u)),ft(u,f,parseInt(l))&&Ne(t)?t:r}}return r}function gt(r){return/^\d{4}-\d{2}-\d{2}$/.test(r)&&r.length===10}function Ne(r){return r instanceof Date&&!isNaN(r.getTime())}function Fr(r){if(!/^\d{8}$/.test(r))return!1;const e=parseInt(r.slice(0,4),10),t=parseInt(r.slice(4,6),10),n=parseInt(r.slice(6,8),10);return ft(n,t-1,e)}function ft(r,e,t){const n=[31,Vr(t)?29:28,31,30,31,30,31,31,30,31,30,31];return!(e<0||e>11||r<1||r>n[e])}function Vr(r){return r%4===0&&(r%100!==0||r%400===0)}function Yr(r){const e=r.getFullYear(),t=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0");return isNaN(e)||isNaN(Number(t))||isNaN(Number(n))?r.toString():`${e}-${t}-${n}`}class Ge{constructor(e,t){ve(this,"class");ve(this,"date");this.class=e,this.date=t}static fromDataObj(e){const t=jt.get(`${e.t}${e.p}`);if(t)return new Ge(e,t.legacyToIso(e.k));throw new Error(`Date creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=jt.get(`${this.class.t}${this.class.p}`);if(e)return e.isoToLegacy(this.date);throw new Error(`Date object not implemented ${this.class.t}${this.class.p}`)}getValue(){return this.date}}const jt=new Map([["D8*YYMD",{legacyToIso(r){return Fr(r)&&`${r.substring(0,4)}-${r.substring(4,6)}-${r.substring(6,8)}`||r},isoToLegacy(r){return gt(r)&&r.replaceAll("-","")||r}}]]),qe=(r,e)=>{P.useEffect(()=>{const t=n=>{typeof r=="object"&&r!==null&&"current"in r&&r.current&&!r.current.contains(n.target)&&e()};return document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[r,e])};function yt({position:r="bottom",enabled:e=!0}){const t=P.useRef(null),n=P.useRef(null),[s,a]=P.useState(0),i=P.useCallback(()=>{const o=t.current,c=n.current;if(!o||!c)return;const{top:l,left:u,width:f,height:d}=o.getBoundingClientRect();a(f);const h=c.offsetHeight,m=c.offsetWidth;if(m===0||h===0){requestAnimationFrame(i);return}let g=l+window.scrollY,x=u+window.scrollX;switch(r){case"top":g-=h;break;case"bottom":g+=d;break;case"left":x-=m;break;case"right":x+=f;break}requestAnimationFrame(()=>{c.style.transform=`translate(${x}px, ${g}px)`})},[r]);return P.useLayoutEffect(()=>{e&&t.current&&n.current&&i();const o=new MutationObserver(()=>{n.current&&i()});return n.current&&o.observe(n.current,{childList:!0,subtree:!0}),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),()=>{window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),o.disconnect()}},[i,e]),{anchorRef:t,targetRef:n,anchorWidth:s}}const ze=(r,e,t)=>{if(t)switch(t){case"CodeOnly":return r;case"DescOnly":return e||"";case"Both":return`${r} - ${e}`}return r},fr=({helperText:r,disabled:e,state:t,id:n})=>{const s={container:`smp-helper-text ${e?"smp-helper-text-disabled":""} ${t?`smp-helper-text-${t}`:""}`};return v.jsx("label",{className:s.container,id:n,children:r})},je=({label:r,disabled:e,htmlFor:t})=>{const n={container:`smp-label ${e?"smp-label-disabled":""}`};return v.jsx("label",{className:n.container,htmlFor:t,children:r})};function Ur(r,e){if(r==null)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.indexOf(n)!==-1)continue;t[n]=r[n]}return t}function Ke(){return Ke=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},Ke.apply(null,arguments)}function dt(r,e){return dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},dt(r,e)}function Wr(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,dt(r,e)}function tt(r,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,a;n<s;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))}var Me={};/*!
23
23
  * content-type
24
24
  * Copyright(c) 2015 Douglas Christopher Wilson
25
25
  * MIT Licensed
26
- */var Dt;function Br(){if(Dt)return Me;Dt=1;var r=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,e=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,t=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,n=/\\([\u000b\u0020-\u00ff])/g,s=/([\\"])/g,a=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;Me.format=i,Me.parse=o;function i(u){if(!u||typeof u!="object")throw new TypeError("argument obj is required");var d=u.parameters,m=u.type;if(!m||!a.test(m))throw new TypeError("invalid type");var h=m;if(d&&typeof d=="object")for(var g,x=Object.keys(d).sort(),w=0;w<x.length;w++){if(g=x[w],!t.test(g))throw new TypeError("invalid parameter name");h+="; "+g+"="+l(d[g])}return h}function o(u){if(!u)throw new TypeError("argument string is required");var d=typeof u=="object"?c(u):u;if(typeof d!="string")throw new TypeError("argument string is required to be a string");var m=d.indexOf(";"),h=m!==-1?d.slice(0,m).trim():d.trim();if(!a.test(h))throw new TypeError("invalid media type");var g=new f(h.toLowerCase());if(m!==-1){var x,w,E;for(r.lastIndex=m;w=r.exec(d);){if(w.index!==m)throw new TypeError("invalid parameter format");m+=w[0].length,x=w[1].toLowerCase(),E=w[2],E.charCodeAt(0)===34&&(E=E.slice(1,-1),E.indexOf("\\")!==-1&&(E=E.replace(n,"$1"))),g.parameters[x]=E}if(m!==d.length)throw new TypeError("invalid parameter format")}return g}function c(u){var d;if(typeof u.getHeader=="function"?d=u.getHeader("content-type"):typeof u.headers=="object"&&(d=u.headers&&u.headers["content-type"]),typeof d!="string")throw new TypeError("content-type header is missing from object");return d}function l(u){var d=String(u);if(t.test(d))return d;if(d.length>0&&!e.test(d))throw new TypeError("invalid parameter value");return'"'+d.replace(s,"\\$1")+'"'}function f(u){this.parameters=Object.create(null),this.type=u}return Me}var Hr=Br(),Oe=new Map,fr=function(e){return e.cloneNode(!0)},Ct=function(){return window.location.protocol==="file:"},dr=function(e,t,n){var s=new XMLHttpRequest;s.onreadystatechange=function(){try{if(!/\.svg/i.test(e)&&s.readyState===2){var a=s.getResponseHeader("Content-Type");if(!a)throw new Error("Content type not found");var i=Hr.parse(a).type;if(!(i==="image/svg+xml"||i==="text/plain"))throw new Error("Invalid content type: ".concat(i))}if(s.readyState===4){if(s.status===404||s.responseXML===null)throw new Error(Ct()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+e);if(s.status===200||Ct()&&s.status===0)n(null,s);else throw new Error("There was a problem injecting the SVG: "+s.status+" "+s.statusText)}}catch(o){if(s.abort(),o instanceof Error)n(o,s);else throw o}},s.open("GET",e),s.withCredentials=t,s.overrideMimeType&&s.overrideMimeType("text/xml"),s.send()},ye={},$t=function(e,t){ye[e]=ye[e]||[],ye[e].push(t)},Gr=function(e){for(var t=function(i,o){setTimeout(function(){if(Array.isArray(ye[e])){var c=Oe.get(e),l=ye[e][i];c instanceof SVGSVGElement&&l(null,fr(c)),c instanceof Error&&l(c),i===ye[e].length-1&&delete ye[e]}},0)},n=0,s=ye[e].length;n<s;n++)t(n)},qr=function(e,t,n){if(Oe.has(e)){var s=Oe.get(e);if(s===void 0){$t(e,n);return}if(s instanceof SVGSVGElement){n(null,fr(s));return}}Oe.set(e,void 0),$t(e,n),dr(e,t,function(a,i){var o;a?Oe.set(e,a):((o=i.responseXML)===null||o===void 0?void 0:o.documentElement)instanceof SVGSVGElement&&Oe.set(e,i.responseXML.documentElement),Gr(e)})},zr=function(e,t,n){dr(e,t,function(s,a){var i;s?n(s):((i=a.responseXML)===null||i===void 0?void 0:i.documentElement)instanceof SVGSVGElement&&n(null,a.responseXML.documentElement)})},Kr=0,Jr=function(){return++Kr},he=[],Pt={},Xr="http://www.w3.org/2000/svg",rt="http://www.w3.org/1999/xlink",At=function(e,t,n,s,a,i,o){var c=e.getAttribute("data-src")||e.getAttribute("src");if(!c){o(new Error("Invalid data-src or src attribute"));return}if(he.indexOf(e)!==-1){he.splice(he.indexOf(e),1),e=null;return}he.push(e),e.setAttribute("src","");var l=s?qr:zr;l(c,a,function(f,u){if(!u){he.splice(he.indexOf(e),1),e=null,o(f);return}var d=e.getAttribute("id");d&&u.setAttribute("id",d);var m=e.getAttribute("title");m&&u.setAttribute("title",m);var h=e.getAttribute("width");h&&u.setAttribute("width",h);var g=e.getAttribute("height");g&&u.setAttribute("height",g);var x=Array.from(new Set(tt(tt(tt([],(u.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();u.setAttribute("class",x);var w=e.getAttribute("style");w&&u.setAttribute("style",w),u.setAttribute("data-src",c);var E=[].filter.call(e.attributes,function(B){return/^data-\w[\w-]*$/.test(B.name)});if(Array.prototype.forEach.call(E,function(B){B.name&&B.value&&u.setAttribute(B.name,B.value)}),n){var j={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]},S,b,N,$,W;Object.keys(j).forEach(function(B){S=B,N=j[B],b=u.querySelectorAll(S+"[id]");for(var _=function(C,O){$=b[C].id,W=$+"-"+Jr();var L;Array.prototype.forEach.call(N,function(Y){L=u.querySelectorAll("["+Y+'*="'+$+'"]');for(var J=0,te=L.length;J<te;J++){var re=L[J].getAttribute(Y);re&&!re.match(new RegExp('url\\("?#'+$+'"?\\)'))||L[J].setAttribute(Y,"url(#"+W+")")}});for(var F=u.querySelectorAll("[*|href]"),V=[],M=0,K=F.length;M<K;M++){var G=F[M].getAttributeNS(rt,"href");G&&G.toString()==="#"+b[C].id&&V.push(F[M])}for(var ne=0,k=V.length;ne<k;ne++)V[ne].setAttributeNS(rt,"href","#"+W);b[C].id=W},p=0,y=b.length;p<y;p++)_(p)})}u.removeAttribute("xmlns:a");for(var R=u.querySelectorAll("script"),P=[],D,I,U=0,H=R.length;U<H;U++)I=R[U].getAttribute("type"),(!I||I==="application/ecmascript"||I==="application/javascript"||I==="text/javascript")&&(D=R[U].innerText||R[U].textContent,D&&P.push(D),u.removeChild(R[U]));if(P.length>0&&(t==="always"||t==="once"&&!Pt[c])){for(var X=0,z=P.length;X<z;X++)new Function(P[X])(window);Pt[c]=!0}var Z=u.querySelectorAll("style");if(Array.prototype.forEach.call(Z,function(B){B.textContent+=""}),u.setAttribute("xmlns",Xr),u.setAttribute("xmlns:xlink",rt),i(u),!e.parentNode){he.splice(he.indexOf(e),1),e=null,o(new Error("Parent node is null"));return}e.parentNode.replaceChild(u,e),he.splice(he.indexOf(e),1),e=null,o(null,u)})},Zr=function(e,t){var n=t===void 0?{}:t,s=n.afterAll,a=s===void 0?function(){}:s,i=n.afterEach,o=i===void 0?function(){}:i,c=n.beforeEach,l=c===void 0?function(){}:c,f=n.cacheRequests,u=f===void 0?!0:f,d=n.evalScripts,m=d===void 0?"never":d,h=n.httpRequestWithCredentials,g=h===void 0?!1:h,x=n.renumerateIRIElements,w=x===void 0?!0:x;if(e&&"length"in e)for(var E=0,j=0,S=e.length;j<S;j++)At(e[j],m,w,u,g,l,function(b,N){o(b,N),e&&"length"in e&&e.length===++E&&a(E)});else e?At(e,m,w,u,g,l,function(b,N){o(b,N),a(1),e=null}):a(0)},Fe={exports:{}},Ve={exports:{}},Q={};/** @license React v16.13.1
26
+ */var Dt;function Hr(){if(Dt)return Me;Dt=1;var r=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,e=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,t=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,n=/\\([\u000b\u0020-\u00ff])/g,s=/([\\"])/g,a=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;Me.format=i,Me.parse=o;function i(f){if(!f||typeof f!="object")throw new TypeError("argument obj is required");var d=f.parameters,h=f.type;if(!h||!a.test(h))throw new TypeError("invalid type");var m=h;if(d&&typeof d=="object")for(var g,x=Object.keys(d).sort(),w=0;w<x.length;w++){if(g=x[w],!t.test(g))throw new TypeError("invalid parameter name");m+="; "+g+"="+l(d[g])}return m}function o(f){if(!f)throw new TypeError("argument string is required");var d=typeof f=="object"?c(f):f;if(typeof d!="string")throw new TypeError("argument string is required to be a string");var h=d.indexOf(";"),m=h!==-1?d.slice(0,h).trim():d.trim();if(!a.test(m))throw new TypeError("invalid media type");var g=new u(m.toLowerCase());if(h!==-1){var x,w,E;for(r.lastIndex=h;w=r.exec(d);){if(w.index!==h)throw new TypeError("invalid parameter format");h+=w[0].length,x=w[1].toLowerCase(),E=w[2],E.charCodeAt(0)===34&&(E=E.slice(1,-1),E.indexOf("\\")!==-1&&(E=E.replace(n,"$1"))),g.parameters[x]=E}if(h!==d.length)throw new TypeError("invalid parameter format")}return g}function c(f){var d;if(typeof f.getHeader=="function"?d=f.getHeader("content-type"):typeof f.headers=="object"&&(d=f.headers&&f.headers["content-type"]),typeof d!="string")throw new TypeError("content-type header is missing from object");return d}function l(f){var d=String(f);if(t.test(d))return d;if(d.length>0&&!e.test(d))throw new TypeError("invalid parameter value");return'"'+d.replace(s,"\\$1")+'"'}function u(f){this.parameters=Object.create(null),this.type=f}return Me}var Br=Hr(),Oe=new Map,dr=function(e){return e.cloneNode(!0)},Ct=function(){return window.location.protocol==="file:"},pr=function(e,t,n){var s=new XMLHttpRequest;s.onreadystatechange=function(){try{if(!/\.svg/i.test(e)&&s.readyState===2){var a=s.getResponseHeader("Content-Type");if(!a)throw new Error("Content type not found");var i=Br.parse(a).type;if(!(i==="image/svg+xml"||i==="text/plain"))throw new Error("Invalid content type: ".concat(i))}if(s.readyState===4){if(s.status===404||s.responseXML===null)throw new Error(Ct()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+e);if(s.status===200||Ct()&&s.status===0)n(null,s);else throw new Error("There was a problem injecting the SVG: "+s.status+" "+s.statusText)}}catch(o){if(s.abort(),o instanceof Error)n(o,s);else throw o}},s.open("GET",e),s.withCredentials=t,s.overrideMimeType&&s.overrideMimeType("text/xml"),s.send()},ye={},$t=function(e,t){ye[e]=ye[e]||[],ye[e].push(t)},Gr=function(e){for(var t=function(i,o){setTimeout(function(){if(Array.isArray(ye[e])){var c=Oe.get(e),l=ye[e][i];c instanceof SVGSVGElement&&l(null,dr(c)),c instanceof Error&&l(c),i===ye[e].length-1&&delete ye[e]}},0)},n=0,s=ye[e].length;n<s;n++)t(n)},qr=function(e,t,n){if(Oe.has(e)){var s=Oe.get(e);if(s===void 0){$t(e,n);return}if(s instanceof SVGSVGElement){n(null,dr(s));return}}Oe.set(e,void 0),$t(e,n),pr(e,t,function(a,i){var o;a?Oe.set(e,a):((o=i.responseXML)===null||o===void 0?void 0:o.documentElement)instanceof SVGSVGElement&&Oe.set(e,i.responseXML.documentElement),Gr(e)})},zr=function(e,t,n){pr(e,t,function(s,a){var i;s?n(s):((i=a.responseXML)===null||i===void 0?void 0:i.documentElement)instanceof SVGSVGElement&&n(null,a.responseXML.documentElement)})},Kr=0,Jr=function(){return++Kr},he=[],Pt={},Xr="http://www.w3.org/2000/svg",rt="http://www.w3.org/1999/xlink",At=function(e,t,n,s,a,i,o){var c=e.getAttribute("data-src")||e.getAttribute("src");if(!c){o(new Error("Invalid data-src or src attribute"));return}if(he.indexOf(e)!==-1){he.splice(he.indexOf(e),1),e=null;return}he.push(e),e.setAttribute("src","");var l=s?qr:zr;l(c,a,function(u,f){if(!f){he.splice(he.indexOf(e),1),e=null,o(u);return}var d=e.getAttribute("id");d&&f.setAttribute("id",d);var h=e.getAttribute("title");h&&f.setAttribute("title",h);var m=e.getAttribute("width");m&&f.setAttribute("width",m);var g=e.getAttribute("height");g&&f.setAttribute("height",g);var x=Array.from(new Set(tt(tt(tt([],(f.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();f.setAttribute("class",x);var w=e.getAttribute("style");w&&f.setAttribute("style",w),f.setAttribute("data-src",c);var E=[].filter.call(e.attributes,function(H){return/^data-\w[\w-]*$/.test(H.name)});if(Array.prototype.forEach.call(E,function(H){H.name&&H.value&&f.setAttribute(H.name,H.value)}),n){var R={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]},S,b,N,$,U;Object.keys(R).forEach(function(H){S=H,N=R[H],b=f.querySelectorAll(S+"[id]");for(var _=function(C,O){$=b[C].id,U=$+"-"+Jr();var L;Array.prototype.forEach.call(N,function(Y){L=f.querySelectorAll("["+Y+'*="'+$+'"]');for(var Z=0,te=L.length;Z<te;Z++){var re=L[Z].getAttribute(Y);re&&!re.match(new RegExp('url\\("?#'+$+'"?\\)'))||L[Z].setAttribute(Y,"url(#"+U+")")}});for(var F=f.querySelectorAll("[*|href]"),V=[],M=0,J=F.length;M<J;M++){var G=F[M].getAttributeNS(rt,"href");G&&G.toString()==="#"+b[C].id&&V.push(F[M])}for(var se=0,I=V.length;se<I;se++)V[se].setAttributeNS(rt,"href","#"+U);b[C].id=U},p=0,y=b.length;p<y;p++)_(p)})}f.removeAttribute("xmlns:a");for(var j=f.querySelectorAll("script"),A=[],D,k,W=0,B=j.length;W<B;W++)k=j[W].getAttribute("type"),(!k||k==="application/ecmascript"||k==="application/javascript"||k==="text/javascript")&&(D=j[W].innerText||j[W].textContent,D&&A.push(D),f.removeChild(j[W]));if(A.length>0&&(t==="always"||t==="once"&&!Pt[c])){for(var K=0,z=A.length;K<z;K++)new Function(A[K])(window);Pt[c]=!0}var X=f.querySelectorAll("style");if(Array.prototype.forEach.call(X,function(H){H.textContent+=""}),f.setAttribute("xmlns",Xr),f.setAttribute("xmlns:xlink",rt),i(f),!e.parentNode){he.splice(he.indexOf(e),1),e=null,o(new Error("Parent node is null"));return}e.parentNode.replaceChild(f,e),he.splice(he.indexOf(e),1),e=null,o(null,f)})},Zr=function(e,t){var n=t===void 0?{}:t,s=n.afterAll,a=s===void 0?function(){}:s,i=n.afterEach,o=i===void 0?function(){}:i,c=n.beforeEach,l=c===void 0?function(){}:c,u=n.cacheRequests,f=u===void 0?!0:u,d=n.evalScripts,h=d===void 0?"never":d,m=n.httpRequestWithCredentials,g=m===void 0?!1:m,x=n.renumerateIRIElements,w=x===void 0?!0:x;if(e&&"length"in e)for(var E=0,R=0,S=e.length;R<S;R++)At(e[R],h,w,f,g,l,function(b,N){o(b,N),e&&"length"in e&&e.length===++E&&a(E)});else e?At(e,h,w,f,g,l,function(b,N){o(b,N),a(1),e=null}):a(0)},Fe={exports:{}},Ve={exports:{}},Q={};/** @license React v16.13.1
27
27
  * react-is.production.min.js
28
28
  *
29
29
  * Copyright (c) Facebook, Inc. and its affiliates.
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var Lt;function Qr(){if(Lt)return Q;Lt=1;var r=typeof Symbol=="function"&&Symbol.for,e=r?Symbol.for("react.element"):60103,t=r?Symbol.for("react.portal"):60106,n=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,i=r?Symbol.for("react.provider"):60109,o=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,l=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,u=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,h=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,x=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function j(b){if(typeof b=="object"&&b!==null){var N=b.$$typeof;switch(N){case e:switch(b=b.type,b){case c:case l:case n:case a:case s:case u:return b;default:switch(b=b&&b.$$typeof,b){case o:case f:case h:case m:case i:return b;default:return N}}case t:return N}}}function S(b){return j(b)===l}return Q.AsyncMode=c,Q.ConcurrentMode=l,Q.ContextConsumer=o,Q.ContextProvider=i,Q.Element=e,Q.ForwardRef=f,Q.Fragment=n,Q.Lazy=h,Q.Memo=m,Q.Portal=t,Q.Profiler=a,Q.StrictMode=s,Q.Suspense=u,Q.isAsyncMode=function(b){return S(b)||j(b)===c},Q.isConcurrentMode=S,Q.isContextConsumer=function(b){return j(b)===o},Q.isContextProvider=function(b){return j(b)===i},Q.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},Q.isForwardRef=function(b){return j(b)===f},Q.isFragment=function(b){return j(b)===n},Q.isLazy=function(b){return j(b)===h},Q.isMemo=function(b){return j(b)===m},Q.isPortal=function(b){return j(b)===t},Q.isProfiler=function(b){return j(b)===a},Q.isStrictMode=function(b){return j(b)===s},Q.isSuspense=function(b){return j(b)===u},Q.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===l||b===a||b===s||b===u||b===d||typeof b=="object"&&b!==null&&(b.$$typeof===h||b.$$typeof===m||b.$$typeof===i||b.$$typeof===o||b.$$typeof===f||b.$$typeof===x||b.$$typeof===w||b.$$typeof===E||b.$$typeof===g)},Q.typeOf=j,Q}var ee={};/** @license React v16.13.1
33
+ */var Lt;function Qr(){if(Lt)return Q;Lt=1;var r=typeof Symbol=="function"&&Symbol.for,e=r?Symbol.for("react.element"):60103,t=r?Symbol.for("react.portal"):60106,n=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,i=r?Symbol.for("react.provider"):60109,o=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,l=r?Symbol.for("react.concurrent_mode"):60111,u=r?Symbol.for("react.forward_ref"):60112,f=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,h=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,x=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function R(b){if(typeof b=="object"&&b!==null){var N=b.$$typeof;switch(N){case e:switch(b=b.type,b){case c:case l:case n:case a:case s:case f:return b;default:switch(b=b&&b.$$typeof,b){case o:case u:case m:case h:case i:return b;default:return N}}case t:return N}}}function S(b){return R(b)===l}return Q.AsyncMode=c,Q.ConcurrentMode=l,Q.ContextConsumer=o,Q.ContextProvider=i,Q.Element=e,Q.ForwardRef=u,Q.Fragment=n,Q.Lazy=m,Q.Memo=h,Q.Portal=t,Q.Profiler=a,Q.StrictMode=s,Q.Suspense=f,Q.isAsyncMode=function(b){return S(b)||R(b)===c},Q.isConcurrentMode=S,Q.isContextConsumer=function(b){return R(b)===o},Q.isContextProvider=function(b){return R(b)===i},Q.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},Q.isForwardRef=function(b){return R(b)===u},Q.isFragment=function(b){return R(b)===n},Q.isLazy=function(b){return R(b)===m},Q.isMemo=function(b){return R(b)===h},Q.isPortal=function(b){return R(b)===t},Q.isProfiler=function(b){return R(b)===a},Q.isStrictMode=function(b){return R(b)===s},Q.isSuspense=function(b){return R(b)===f},Q.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===l||b===a||b===s||b===f||b===d||typeof b=="object"&&b!==null&&(b.$$typeof===m||b.$$typeof===h||b.$$typeof===i||b.$$typeof===o||b.$$typeof===u||b.$$typeof===x||b.$$typeof===w||b.$$typeof===E||b.$$typeof===g)},Q.typeOf=R,Q}var ee={};/** @license React v16.13.1
34
34
  * react-is.development.js
35
35
  *
36
36
  * Copyright (c) Facebook, Inc. and its affiliates.
37
37
  *
38
38
  * This source code is licensed under the MIT license found in the
39
39
  * LICENSE file in the root directory of this source tree.
40
- */var _t;function en(){return _t||(_t=1,process.env.NODE_ENV!=="production"&&function(){var r=typeof Symbol=="function"&&Symbol.for,e=r?Symbol.for("react.element"):60103,t=r?Symbol.for("react.portal"):60106,n=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,i=r?Symbol.for("react.provider"):60109,o=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,l=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,u=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,h=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,x=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function j(k){return typeof k=="string"||typeof k=="function"||k===n||k===l||k===a||k===s||k===u||k===d||typeof k=="object"&&k!==null&&(k.$$typeof===h||k.$$typeof===m||k.$$typeof===i||k.$$typeof===o||k.$$typeof===f||k.$$typeof===x||k.$$typeof===w||k.$$typeof===E||k.$$typeof===g)}function S(k){if(typeof k=="object"&&k!==null){var Y=k.$$typeof;switch(Y){case e:var J=k.type;switch(J){case c:case l:case n:case a:case s:case u:return J;default:var te=J&&J.$$typeof;switch(te){case o:case f:case h:case m:case i:return te;default:return Y}}case t:return Y}}}var b=c,N=l,$=o,W=i,R=e,P=f,D=n,I=h,U=m,H=t,X=a,z=s,Z=u,B=!1;function _(k){return B||(B=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),p(k)||S(k)===c}function p(k){return S(k)===l}function y(k){return S(k)===o}function T(k){return S(k)===i}function C(k){return typeof k=="object"&&k!==null&&k.$$typeof===e}function O(k){return S(k)===f}function L(k){return S(k)===n}function F(k){return S(k)===h}function V(k){return S(k)===m}function M(k){return S(k)===t}function K(k){return S(k)===a}function G(k){return S(k)===s}function ne(k){return S(k)===u}ee.AsyncMode=b,ee.ConcurrentMode=N,ee.ContextConsumer=$,ee.ContextProvider=W,ee.Element=R,ee.ForwardRef=P,ee.Fragment=D,ee.Lazy=I,ee.Memo=U,ee.Portal=H,ee.Profiler=X,ee.StrictMode=z,ee.Suspense=Z,ee.isAsyncMode=_,ee.isConcurrentMode=p,ee.isContextConsumer=y,ee.isContextProvider=T,ee.isElement=C,ee.isForwardRef=O,ee.isFragment=L,ee.isLazy=F,ee.isMemo=V,ee.isPortal=M,ee.isProfiler=K,ee.isStrictMode=G,ee.isSuspense=ne,ee.isValidElementType=j,ee.typeOf=S}()),ee}var kt;function pr(){return kt||(kt=1,process.env.NODE_ENV==="production"?Ve.exports=Qr():Ve.exports=en()),Ve.exports}/*
40
+ */var _t;function en(){return _t||(_t=1,process.env.NODE_ENV!=="production"&&function(){var r=typeof Symbol=="function"&&Symbol.for,e=r?Symbol.for("react.element"):60103,t=r?Symbol.for("react.portal"):60106,n=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,i=r?Symbol.for("react.provider"):60109,o=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,l=r?Symbol.for("react.concurrent_mode"):60111,u=r?Symbol.for("react.forward_ref"):60112,f=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,h=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,x=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function R(I){return typeof I=="string"||typeof I=="function"||I===n||I===l||I===a||I===s||I===f||I===d||typeof I=="object"&&I!==null&&(I.$$typeof===m||I.$$typeof===h||I.$$typeof===i||I.$$typeof===o||I.$$typeof===u||I.$$typeof===x||I.$$typeof===w||I.$$typeof===E||I.$$typeof===g)}function S(I){if(typeof I=="object"&&I!==null){var Y=I.$$typeof;switch(Y){case e:var Z=I.type;switch(Z){case c:case l:case n:case a:case s:case f:return Z;default:var te=Z&&Z.$$typeof;switch(te){case o:case u:case m:case h:case i:return te;default:return Y}}case t:return Y}}}var b=c,N=l,$=o,U=i,j=e,A=u,D=n,k=m,W=h,B=t,K=a,z=s,X=f,H=!1;function _(I){return H||(H=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),p(I)||S(I)===c}function p(I){return S(I)===l}function y(I){return S(I)===o}function T(I){return S(I)===i}function C(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function O(I){return S(I)===u}function L(I){return S(I)===n}function F(I){return S(I)===m}function V(I){return S(I)===h}function M(I){return S(I)===t}function J(I){return S(I)===a}function G(I){return S(I)===s}function se(I){return S(I)===f}ee.AsyncMode=b,ee.ConcurrentMode=N,ee.ContextConsumer=$,ee.ContextProvider=U,ee.Element=j,ee.ForwardRef=A,ee.Fragment=D,ee.Lazy=k,ee.Memo=W,ee.Portal=B,ee.Profiler=K,ee.StrictMode=z,ee.Suspense=X,ee.isAsyncMode=_,ee.isConcurrentMode=p,ee.isContextConsumer=y,ee.isContextProvider=T,ee.isElement=C,ee.isForwardRef=O,ee.isFragment=L,ee.isLazy=F,ee.isMemo=V,ee.isPortal=M,ee.isProfiler=J,ee.isStrictMode=G,ee.isSuspense=se,ee.isValidElementType=R,ee.typeOf=S}()),ee}var kt;function hr(){return kt||(kt=1,process.env.NODE_ENV==="production"?Ve.exports=Qr():Ve.exports=en()),Ve.exports}/*
41
41
  object-assign
42
42
  (c) Sindre Sorhus
43
43
  @license MIT
44
- */var nt,It;function tn(){if(It)return nt;It=1;var r=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function s(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var i={},o=0;o<10;o++)i["_"+String.fromCharCode(o)]=o;var c=Object.getOwnPropertyNames(i).map(function(f){return i[f]});if(c.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(f){l[f]=f}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return nt=s()?Object.assign:function(a,i){for(var o,c=n(a),l,f=1;f<arguments.length;f++){o=Object(arguments[f]);for(var u in o)e.call(o,u)&&(c[u]=o[u]);if(r){l=r(o);for(var d=0;d<l.length;d++)t.call(o,l[d])&&(c[l[d]]=o[l[d]])}}return c},nt}var st,Nt;function vt(){if(Nt)return st;Nt=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return st=r,st}var at,Mt;function hr(){return Mt||(Mt=1,at=Function.call.bind(Object.prototype.hasOwnProperty)),at}var it,Ft;function rn(){if(Ft)return it;Ft=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var e=vt(),t={},n=hr();r=function(a){var i="Warning: "+a;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function s(a,i,o,c,l){if(process.env.NODE_ENV!=="production"){for(var f in a)if(n(a,f)){var u;try{if(typeof a[f]!="function"){var d=Error((c||"React class")+": "+o+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}u=a[f](i,f,c,o,null,e)}catch(h){u=h}if(u&&!(u instanceof Error)&&r((c||"React class")+": type specification of "+o+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in t)){t[u.message]=!0;var m=l?l():"";r("Failed "+o+" type: "+u.message+(m??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},it=s,it}var ot,Vt;function nn(){if(Vt)return ot;Vt=1;var r=pr(),e=tn(),t=vt(),n=hr(),s=rn(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(o){var c="Warning: "+o;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function i(){return null}return ot=function(o,c){var l=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function u(p){var y=p&&(l&&p[l]||p[f]);if(typeof y=="function")return y}var d="<<anonymous>>",m={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:E(),arrayOf:j,element:S(),elementType:b(),instanceOf:N,node:P(),objectOf:W,oneOf:$,oneOfType:R,shape:I,exact:U};function h(p,y){return p===y?p!==0||1/p===1/y:p!==p&&y!==y}function g(p,y){this.message=p,this.data=y&&typeof y=="object"?y:{},this.stack=""}g.prototype=Error.prototype;function x(p){if(process.env.NODE_ENV!=="production")var y={},T=0;function C(L,F,V,M,K,G,ne){if(M=M||d,G=G||V,ne!==t){if(c){var k=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw k.name="Invariant Violation",k}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Y=M+":"+V;!y[Y]&&T<3&&(a("You are manually calling a React.PropTypes validation function for the `"+G+"` prop on `"+M+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),y[Y]=!0,T++)}}return F[V]==null?L?F[V]===null?new g("The "+K+" `"+G+"` is marked as required "+("in `"+M+"`, but its value is `null`.")):new g("The "+K+" `"+G+"` is marked as required in "+("`"+M+"`, but its value is `undefined`.")):null:p(F,V,M,K,G)}var O=C.bind(null,!1);return O.isRequired=C.bind(null,!0),O}function w(p){function y(T,C,O,L,F,V){var M=T[C],K=z(M);if(K!==p){var G=Z(M);return new g("Invalid "+L+" `"+F+"` of type "+("`"+G+"` supplied to `"+O+"`, expected ")+("`"+p+"`."),{expectedType:p})}return null}return x(y)}function E(){return x(i)}function j(p){function y(T,C,O,L,F){if(typeof p!="function")return new g("Property `"+F+"` of component `"+O+"` has invalid PropType notation inside arrayOf.");var V=T[C];if(!Array.isArray(V)){var M=z(V);return new g("Invalid "+L+" `"+F+"` of type "+("`"+M+"` supplied to `"+O+"`, expected an array."))}for(var K=0;K<V.length;K++){var G=p(V,K,O,L,F+"["+K+"]",t);if(G instanceof Error)return G}return null}return x(y)}function S(){function p(y,T,C,O,L){var F=y[T];if(!o(F)){var V=z(F);return new g("Invalid "+O+" `"+L+"` of type "+("`"+V+"` supplied to `"+C+"`, expected a single ReactElement."))}return null}return x(p)}function b(){function p(y,T,C,O,L){var F=y[T];if(!r.isValidElementType(F)){var V=z(F);return new g("Invalid "+O+" `"+L+"` of type "+("`"+V+"` supplied to `"+C+"`, expected a single ReactElement type."))}return null}return x(p)}function N(p){function y(T,C,O,L,F){if(!(T[C]instanceof p)){var V=p.name||d,M=_(T[C]);return new g("Invalid "+L+" `"+F+"` of type "+("`"+M+"` supplied to `"+O+"`, expected ")+("instance of `"+V+"`."))}return null}return x(y)}function $(p){if(!Array.isArray(p))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),i;function y(T,C,O,L,F){for(var V=T[C],M=0;M<p.length;M++)if(h(V,p[M]))return null;var K=JSON.stringify(p,function(ne,k){var Y=Z(k);return Y==="symbol"?String(k):k});return new g("Invalid "+L+" `"+F+"` of value `"+String(V)+"` "+("supplied to `"+O+"`, expected one of "+K+"."))}return x(y)}function W(p){function y(T,C,O,L,F){if(typeof p!="function")return new g("Property `"+F+"` of component `"+O+"` has invalid PropType notation inside objectOf.");var V=T[C],M=z(V);if(M!=="object")return new g("Invalid "+L+" `"+F+"` of type "+("`"+M+"` supplied to `"+O+"`, expected an object."));for(var K in V)if(n(V,K)){var G=p(V,K,O,L,F+"."+K,t);if(G instanceof Error)return G}return null}return x(y)}function R(p){if(!Array.isArray(p))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var y=0;y<p.length;y++){var T=p[y];if(typeof T!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+B(T)+" at index "+y+"."),i}function C(O,L,F,V,M){for(var K=[],G=0;G<p.length;G++){var ne=p[G],k=ne(O,L,F,V,M,t);if(k==null)return null;k.data&&n(k.data,"expectedType")&&K.push(k.data.expectedType)}var Y=K.length>0?", expected one of type ["+K.join(", ")+"]":"";return new g("Invalid "+V+" `"+M+"` supplied to "+("`"+F+"`"+Y+"."))}return x(C)}function P(){function p(y,T,C,O,L){return H(y[T])?null:new g("Invalid "+O+" `"+L+"` supplied to "+("`"+C+"`, expected a ReactNode."))}return x(p)}function D(p,y,T,C,O){return new g((p||"React class")+": "+y+" type `"+T+"."+C+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+O+"`.")}function I(p){function y(T,C,O,L,F){var V=T[C],M=z(V);if(M!=="object")return new g("Invalid "+L+" `"+F+"` of type `"+M+"` "+("supplied to `"+O+"`, expected `object`."));for(var K in p){var G=p[K];if(typeof G!="function")return D(O,L,F,K,Z(G));var ne=G(V,K,O,L,F+"."+K,t);if(ne)return ne}return null}return x(y)}function U(p){function y(T,C,O,L,F){var V=T[C],M=z(V);if(M!=="object")return new g("Invalid "+L+" `"+F+"` of type `"+M+"` "+("supplied to `"+O+"`, expected `object`."));var K=e({},T[C],p);for(var G in K){var ne=p[G];if(n(p,G)&&typeof ne!="function")return D(O,L,F,G,Z(ne));if(!ne)return new g("Invalid "+L+" `"+F+"` key `"+G+"` supplied to `"+O+"`.\nBad object: "+JSON.stringify(T[C],null," ")+`
45
- Valid keys: `+JSON.stringify(Object.keys(p),null," "));var k=ne(V,G,O,L,F+"."+G,t);if(k)return k}return null}return x(y)}function H(p){switch(typeof p){case"number":case"string":case"undefined":return!0;case"boolean":return!p;case"object":if(Array.isArray(p))return p.every(H);if(p===null||o(p))return!0;var y=u(p);if(y){var T=y.call(p),C;if(y!==p.entries){for(;!(C=T.next()).done;)if(!H(C.value))return!1}else for(;!(C=T.next()).done;){var O=C.value;if(O&&!H(O[1]))return!1}}else return!1;return!0;default:return!1}}function X(p,y){return p==="symbol"?!0:y?y["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&y instanceof Symbol:!1}function z(p){var y=typeof p;return Array.isArray(p)?"array":p instanceof RegExp?"object":X(y,p)?"symbol":y}function Z(p){if(typeof p>"u"||p===null)return""+p;var y=z(p);if(y==="object"){if(p instanceof Date)return"date";if(p instanceof RegExp)return"regexp"}return y}function B(p){var y=Z(p);switch(y){case"array":case"object":return"an "+y;case"boolean":case"date":case"regexp":return"a "+y;default:return y}}function _(p){return!p.constructor||!p.constructor.name?d:p.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},ot}var lt,Yt;function sn(){if(Yt)return lt;Yt=1;var r=vt();function e(){}function t(){}return t.resetWarningCache=e,lt=function(){function n(i,o,c,l,f,u){if(u!==r){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}n.isRequired=n;function s(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:e};return a.PropTypes=a,a},lt}var Ut;function an(){if(Ut)return Fe.exports;if(Ut=1,process.env.NODE_ENV!=="production"){var r=pr(),e=!0;Fe.exports=nn()(r.isElement,e)}else Fe.exports=sn()();return Fe.exports}var ie=an(),on=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},ln=function(e,t){for(var n in e)if(!(n in t))return!0;for(var s in t)if(e[s]!==t[s])return!0;return!1},cn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Ye="http://www.w3.org/2000/svg",Wt="http://www.w3.org/1999/xlink",Re=function(r){function e(){for(var n,s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];return n=r.call.apply(r,[this].concat(a))||this,n.initialState={hasError:!1,isLoading:!0},n.state=n.initialState,n._isMounted=!1,n.reactWrapper=void 0,n.nonReactWrapper=void 0,n.refCallback=function(o){n.reactWrapper=o},n}Wr(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof on(this.reactWrapper).Node){var a=this.props,i=a.desc,o=a.evalScripts,c=a.httpRequestWithCredentials,l=a.renumerateIRIElements,f=a.src,u=a.title,d=a.useRequestCache,m=this.props.onError,h=this.props.beforeInjection,g=this.props.afterInjection,x=this.props.wrapper,w,E;x==="svg"?(w=document.createElementNS(Ye,x),w.setAttribute("xmlns",Ye),w.setAttribute("xmlns:xlink",Wt),E=document.createElementNS(Ye,x)):(w=document.createElement(x),E=document.createElement(x)),w.appendChild(E),E.dataset.src=f,this.nonReactWrapper=this.reactWrapper.appendChild(w);var j=function($){if(s.removeSVG(),!s._isMounted){m($);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){m($)})},S=function($,W){if($){j($);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{g(W)}catch(R){j(R)}})},b=function($){if($.setAttribute("role","img"),i){var W=$.querySelector(":scope > desc");W&&$.removeChild(W);var R=document.createElement("desc");R.innerHTML=i,$.prepend(R)}if(u){var P=$.querySelector(":scope > title");P&&$.removeChild(P);var D=document.createElement("title");D.innerHTML=u,$.prepend(D)}try{h($)}catch(I){j(I)}};Zr(E,{afterEach:S,beforeEach:b,cacheRequests:d,evalScripts:o,httpRequestWithCredentials:c,renumerateIRIElements:l})}},t.removeSVG=function(){var s;(s=this.nonReactWrapper)!=null&&s.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},t.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},t.componentDidUpdate=function(s){var a=this;ln(Ke({},s),this.props)&&this.setState(function(){return a.initialState},function(){a.removeSVG(),a.renderSVG()})},t.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},t.render=function(){var s=this.props;s.afterInjection,s.beforeInjection,s.desc,s.evalScripts;var a=s.fallback;s.httpRequestWithCredentials;var i=s.loading;s.renumerateIRIElements,s.src,s.title,s.useRequestCache;var o=s.wrapper,c=Ur(s,cn),l=o;return ke.createElement(l,Ke({},c,{ref:this.refCallback},o==="svg"?{xmlns:Ye,xmlnsXlink:Wt}:{}),this.state.isLoading&&i&&ke.createElement(i,null),this.state.hasError&&a&&ke.createElement(a,null))},e}(ke.Component);Re.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};Re.propTypes={afterInjection:ie.func,beforeInjection:ie.func,desc:ie.string,evalScripts:ie.oneOf(["always","once","never"]),fallback:ie.oneOfType([ie.func,ie.object,ie.string]),httpRequestWithCredentials:ie.bool,loading:ie.oneOfType([ie.func,ie.object,ie.string]),onError:ie.func,renumerateIRIElements:ie.bool,src:ie.string.isRequired,title:ie.string,useRequestCache:ie.bool,wrapper:ie.oneOf(["div","span","svg"])};let pt={assets:"/"};const un=r=>{pt={...pt,...r}},Bt=r=>`${pt.assets}/${r}`.replace(/\/+/g,"/"),le=A.memo(({icon:r,width:e,height:t,placeholderIcon:n,color:s,disabled:a,state:i="base",rotated:o=!1,onClick:c,isInteractable:l=!1,spin:f=!1,title:u})=>{const[d,m]=A.useState(r),h=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),g=h&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),x=Bt(`assets/svg/${r}.svg`),w=Bt(`assets/svg/${n}.svg`),E={img:`${l?"smp-image-interactable":""}`,svg:`smp-icon ${i?`smp-icon-${i}`:""} ${o?"smp-icon-rotated":""} ${l?"smp-icon-interactable":""} ${f?"smp-icon-spin":""}`},j=()=>{!a&&l&&c&&c()};return v.jsx(v.Fragment,{children:g?v.jsx(Re,{src:r,fallback:()=>v.jsx(Re,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:E.svg,onClick:j}):h?v.jsx("img",{src:d,width:e||"16px",height:t||"auto",alt:u,onError:()=>m(w),onClick:j,className:E.img,title:u,onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&j()}}):v.jsx(Re,{src:x,fallback:()=>v.jsx(Re,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:E.svg,onClick:j})})}),we=({disabled:r,bindValue:e,icon:t,onBlur:n,onChange:s,placeholder:a,isEditable:i=!0,shapeIcon:o,sizing:c,state:l,variant:f,rotatedShapeIcon:u=!1,onShapeIconClick:d,ref:m,inputRef:h,onKeyDown:g,inputType:x="text",ariaLabel:w="input field",label:E,helperText:j=!1,error:S,appearance:b="base",fullWidth:N=!1,_dataComponent:$="textfield",width:W})=>{const R=S?"danger":l,P=S||l=="danger"?"error":o,D=j||!!S,I=X=>{s==null||s(X.target.value)},U={wrapper:`smp-textfield-wrapper ${N?"smp-textfield-fullWidth":""}`,container:`smp-textfield ${r?"smp-textfield-disabled":""} ${a?"smp-textfield-placeholder":""} ${c?`smp-textfield-${c}`:""} ${R?`smp-textfield-${R}`:""} ${b?`smp-textfield-${b}`:""} ${i?"":"smp-textfield-readOnly"}`,input:"smp-textfield-input "};f&&(f!="notSelectable"||i)&&(U.container+=`smp-textfield-variant-${f}`);const H=W?{"--smp-textField-width-base":W}:void 0;return v.jsxs("div",{className:U.wrapper,"data-component":$,children:[E&&v.jsx(_e,{label:E,disabled:r}),v.jsxs("div",{className:U.container,ref:m,style:H,children:[t&&v.jsx(le,{icon:t,disabled:r}),v.jsx("input",{type:x,value:e,placeholder:a,onChange:I,onBlur:n,className:U.input,disabled:r,readOnly:!i,onKeyDown:g,"aria-label":w,ref:h}),P&&v.jsx(le,{icon:P,disabled:r,state:R,onClick:d,rotated:u,isInteractable:i})]}),D&&v.jsx(Yr,{helperText:S,disabled:r,state:R})]})};function mr({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=A.useState(0),i=A.useRef(null),o=r.length*e,c=Math.max(0,Math.floor(s/e)-n),l=Math.min(r.length-1,Math.floor((s+t)/e)+n),f=[];for(let m=c;m<=l;m++)f.push({item:r[m],index:m,offsetTop:m*e});const u=A.useCallback(m=>{const h=m.target.scrollTop;a(h)},[]),d=m=>{if(!i.current)return;const h=m*e,g=h+e,x=i.current,w=x.scrollTop,E=w+t;h<w?x.scrollTop=h:g>E&&(x.scrollTop=g-t)};return{virtualItems:f,containerProps:{ref:i,style:{maxHeight:`${t}px`,overflowY:"auto",position:"relative",willChange:"transform"},onScroll:u},innerProps:{style:{height:`${o}px`,position:"relative",width:"100%"}},scrollInfo:{scrollTop:s,viewportHeight:t,totalHeight:o,startIndex:c,endIndex:l},scrollToIndex:d}}const fn=10,gr=({id:r,options:e,displayMode:t,ref:n,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:c,onKeyDown:l})=>{var P;const[f,u]=A.useState(""),d=24,[m,h]=A.useState(a!==null?a:-1),g=s!==void 0?s:e.length>fn,x=f?e.filter(D=>D.label.toLowerCase().includes(f.toLowerCase())):e,w=D=>{u(D)},{virtualItems:E,containerProps:j,innerProps:S,scrollToIndex:b}=mr({items:x,itemHeight:d,containerHeight:200,overscan:5});A.useEffect(()=>{a!==null&&a!==m&&h(a)},[a]),A.useEffect(()=>{m>=0&&m<x.length&&b(m)},[m,x]);const N=D=>{if(D.key==="ArrowDown"||D.key==="ArrowUp"){D.preventDefault();let I=m;D.key==="ArrowDown"?I=m<x.length-1?m+1:0:D.key==="ArrowUp"&&(I=m>0?m-1:x.length-1),h(I)}else D.key==="Enter"?m>=0&&m<x.length&&(c==null||c(x[m])):D.key==="Escape"&&(D.preventDefault(),D.stopPropagation());l&&l(D)},$=D=>{N(D)},W=D=>{N(D)},R={wrapper:"smp-list",container:"smp-list-container",virtualScroll:"smp-list-virtualScroll",listItem:"smp-list-listItem"};return v.jsxs("div",{id:r,ref:n,className:R.wrapper,"data-component":"list",style:{width:o},children:[g&&v.jsx(we,{bindValue:f,placeholder:"Search...",onChange:w,onKeyDown:$}),v.jsx("div",{...j,className:R.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:W,"aria-activedescendant":m>=0&&m<x.length?(P=x[m])==null?void 0:P.id:void 0,children:v.jsx("div",{...S,className:R.virtualScroll,children:E.map(({item:D,index:I,offsetTop:U})=>{const H=i.includes(D.id);return v.jsxs("li",{role:"option",id:D.id,"aria-selected":m===I?"true":"false",tabIndex:-1,className:`${R.listItem} ${m===I?"selected-item":""}`,"aria-label":D.id+"-"+D.label,style:{height:`${d}px`,lineHeight:`calc(${d}px - 2*2px)`,transform:`translateY(${U}px)`},onClick:()=>{c==null||c(D),h(I)},children:[ze(D.id,D.label,t),H&&v.jsx(le,{icon:"check",width:16})]},D.id)})})})]})},yr=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=A.useState(ze(e,t,r));return A.useEffect(()=>{a(e)},[e]),A.useEffect(()=>{a(ze(e,t,r))},[t,r]),v.jsx(we,{...n,bindValue:s})},dn=r=>{const e=A.useRef(null);return A.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},r)}},bt=({bindValue:r,optionalDisplayValue:e,options:t,displayMode:n,listDisplayMode:s="Both",minimumChars:a=3,isEditable:i=!0,placeholder:o,fun:c,_changeOnEnter:l=!1,onChange:f,onOptionsRequest:u,_multiActiveIndex:d,...m})=>{const[h,g]=A.useState(r),[x,w]=A.useState(e),[E,j]=A.useState(!1),[S,b]=A.useState(t||[]),[N,$]=A.useState(0),[W,R]=A.useState([r]),{anchorRef:P,targetRef:D,anchorWidth:I}=yt({position:"bottom",enabled:E});qe(D,()=>j(!1));const U=dn(400),H=B=>{B.length>=a?c&&u&&U(async()=>{const _=await u(c,B);b(_),$(_.length>0?0:-1),j(!0)}):j(!1),g(B),w(e),l||f==null||f(B,e)},X=B=>{l?(g(""),w("")):(g(B.id),w(B.label)),f==null||f(B.id,B.label);const _=S.findIndex(p=>p.id===B.id);$(_),R([B.id]),j(!1)},z=B=>{B.key==="Escape"&&(j(!1),$(-1))},Z=B=>{if((B.key==="ArrowDown"||B.key==="ArrowUp")&&(B.preventDefault(),E)){const _=B.key==="ArrowDown"?(N+1)%S.length:(N-1+S.length)%S.length;$(_)}switch(B.key){case"Enter":N>=0&&N<S.length?X(S[N]):l&&(f==null||f(h,""),j(!1),g(""),w(""));break;case"Escape":j(!1),$(-1);break}};return v.jsxs("div",{"data-component":"autocomplete",children:[v.jsx(yr,{...m,bindValue:h,optionalDisplayValue:x,displayMode:n,isEditable:i,shapeIcon:"magnify",placeholder:o,ref:P,onChange:H,onKeyDown:Z,"aria-autocomplete":"list"}),E&&v.jsx(gr,{options:S,displayMode:s,onClick:X,ref:D,selectedIndex:N,activeIndex:d||W,width:I,showFilter:!1,onKeyDown:z})]})},Ht=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],Gt=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],xe=({label:r,onClick:e,ariaLabel:t,icon:n,disabled:s,sizing:a="base",variant:i="primary",appearance:o="raised",showIcon:c=!0,showText:l=!0,fullWidth:f=!1,loading:u=!1,justify:d="center",title:m,optionalDisplayValue:h})=>{const g={container:`smp-button smp-button-container ${a?`smp-button-${a}`:""} ${i?`smp-buttonVariant-${i}`:""} ${o?`smp-buttonType-${o}`:""} ${f?"smp-button-fullWidth":""} smp-justifyContent-${d}`};return v.jsx("button",{"data-component":"button",className:g.container,onClick:e,"aria-label":t,disabled:s,"aria-busy":u,title:m||r||h,children:u?v.jsx(le,{icon:"spinner",state:Gt(i),spin:!0}):v.jsxs(v.Fragment,{children:[n&&c&&v.jsx(le,{icon:n,disabled:s,state:Gt(i),width:Ht(a),height:Ht(a)}),l&&h&&v.jsx("span",{children:h})]})})},vr=({options:r,fun:e,direction:t="row",disposition:n="start",sizing:s,variant:a,appearance:i,showText:o,showIcon:c,fullWidth:l,disabled:f,justify:u,onClick:d,onOptionsRequest:m})=>{const[h,g]=A.useState(r);A.useEffect(()=>{!h&&m&&e&&m(e,void 0).then(E=>g(E)).catch(E=>{console.error("Errore nel caricamento delle opzioni per ButtonList",E)})},[h,e,m]);const x={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${n}`},w=h==null?void 0:h.map((E,j)=>{const S={bindValue:E.id,optionalDisplayValue:E.label,fun:E.fun,icon:E.icon,variant:a,appearance:i,showText:o,showIcon:c,fullWidth:l,disabled:f,sizing:s,justify:u,onClick:()=>{d==null||d(E.id,E.fun)}};return v.jsx(xe,{...S},`button-${j}`)});return v.jsx("div",{role:"list","data-component":"button-list",className:x.container,children:w})},br=({bindValue:r,_dataComponent:e="checkbox",disabled:t,label:n,isEditable:s=!0,onChange:a,onBlur:i})=>{const o=l=>{s&&a&&a(l.target.checked)},c={wrapper:"smp-checkbox-wrapper"};return v.jsxs("div",{className:c.wrapper,"data-component":e,children:[n&&v.jsx(_e,{label:n,disabled:t}),v.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:o,onBlur:i})]})},pn={titleLarge:"h2",title:"h3",body:"h6",label:"label"},Pe=({variant:r="body",bindValue:e,color:t,...n})=>{const s=pn[r],a={container:`smp-typography ${r?`smp-typography-${r}`:""} ${n.disabled?"smp-typography-disabled":""}`};return v.jsx(s,{className:a.container,disabled:n.disabled,style:{"--smp-typography-color-base":t},children:e})},xt=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,c]=A.useState(null),l={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},f=m=>{n==null||n(r.filter((h,g)=>g!==m))},u=m=>{c(m)},d=m=>{if(o===null||o===m)return;const h=[...r],[g]=h.splice(o,1);h.splice(m,0,g),n==null||n(h),c(null)};return v.jsx("div",{className:l.container,role:"list","data-component":"chip",children:r.flatMap((m,h)=>{const g=ze(m.bindValue,m.optionalDisplayValue,t),x=v.jsxs("div",{className:l.element,role:"listitem",draggable:i,onDragStart:()=>u(h),onDragOver:E=>i&&E.preventDefault(),onDrop:()=>i&&d(h),style:{"--smp-chips-backgroundColor-base":a},children:[i&&v.jsx(le,{icon:"drag_indicator_horizontal",isInteractable:!0}),v.jsx(Pe,{variant:"label",bindValue:g,color:s}),e&&v.jsx(le,{icon:"close",isInteractable:!0,onClick:()=>f(h),color:s})]},`chip-${h}`),w=i&&h<r.length-1?v.jsx(le,{icon:"chevron-right",color:s},`separator-${h}`):null;return[x,w].filter(Boolean)})})};function xr(r,e){const t=A.useRef(null);A.useEffect(()=>{if(!r)return;const n=typeof e=="object"&&e!==null&&"current"in e?e.current:null;if(!n)return;t.current=document.activeElement;const s=()=>n?Array.from(n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(l=>!l.hasAttribute("disabled")&&l.offsetParent!==null):[];(()=>{const l=s();l.length>0&&requestAnimationFrame(()=>l[0].focus())})();const i=l=>{if(l.key==="Escape"||l.key!=="Tab")return;const f=s();if(f.length===0)return;const u=f[0],d=f[f.length-1];l.shiftKey&&document.activeElement===u?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),u.focus())},o=l=>{if(n&&!n.contains(l.target)){l.preventDefault();const f=s();f.length>0&&f[0].focus()}};document.addEventListener("keydown",i),document.addEventListener("mousedown",o);const c=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",o),document.body.style.overflow=c,t.current&&requestAnimationFrame(()=>{var l;(l=t.current)==null||l.focus()})}},[r,e])}const Sr=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,isEditable:s,displayMode:a,listDisplayMode:i="Both",fun:o,onOptionsRequest:c,multiActiveIndex:l,...f})=>{const[u,d]=A.useState(!1),[m,h]=A.useState(t),[g,x]=A.useState(-1),[w,E]=A.useState([r]),j=A.useId(),{anchorRef:S,targetRef:b,anchorWidth:N}=yt({position:"bottom",enabled:u});qe(b,()=>d(!1)),xr(u,b);const $=D=>{e==null||e(D.id,D.label);const I=m.findIndex(U=>U.id===D.id);x(I),E([D.id]),d(!1)},W=D=>{D.key==="Escape"&&(d(!1),x(-1))},R=D=>{(D.key==="ArrowDown"||D.key==="ArrowUp")&&(D.preventDefault(),P())},P=()=>{o&&c&&c(o,void 0).then(D=>{h(D),x(D.length>0?0:-1),d(!0)})};return v.jsxs("div",{role:"combobox","aria-expanded":u,"aria-controls":j,"aria-owns":j,"data-component":"combobox",children:[v.jsx(yr,{...f,bindValue:r,optionalDisplayValue:n,displayMode:a,onShapeIconClick:P,onKeyDown:R,shapeIcon:"arrow_drop_down",rotatedShapeIcon:u,isEditable:s,ref:S,"aria-autocomplete":"list",variant:"notSelectable"}),u&&v.jsx(gr,{id:j,options:m,displayMode:i,ref:b,selectedIndex:g,activeIndex:l||w,width:N,onClick:$,onKeyDown:W})]})},q=r=>typeof r=="string",Ce=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},qt=r=>r==null?"":""+r,hn=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},mn=/###/g,zt=r=>r&&r.indexOf("###")>-1?r.replace(mn,"."):r,Kt=r=>!r||q(r),$e=(r,e,t)=>{const n=q(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(Kt(r))return{};const a=zt(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return Kt(r)?{}:{obj:r,k:zt(n[s])}},Jt=(r,e,t)=>{const{obj:n,k:s}=$e(r,e,Object);if(n!==void 0||e.length===1){n[s]=t;return}let a=e[e.length-1],i=e.slice(0,e.length-1),o=$e(r,i,Object);for(;o.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),o=$e(r,i,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=t},gn=(r,e,t,n)=>{const{obj:s,k:a}=$e(r,e,Object);s[a]=s[a]||[],s[a].push(t)},Je=(r,e)=>{const{obj:t,k:n}=$e(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},yn=(r,e,t)=>{const n=Je(r,t);return n!==void 0?n:Je(e,t)},wr=(r,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?q(r[n])||r[n]instanceof String||q(e[n])||e[n]instanceof String?t&&(r[n]=e[n]):wr(r[n],e[n],t):r[n]=e[n]);return r},Te=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var vn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const bn=r=>q(r)?r.replace(/[&<>"'\/]/g,e=>vn[e]):r;class xn{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const Sn=[" ",",","?","!",";"],wn=new xn(20),En=(r,e,t)=>{e=e||"",t=t||"";const n=Sn.filter(i=>e.indexOf(i)<0&&t.indexOf(i)<0);if(n.length===0)return!0;const s=wn.getRegExp(`(${n.map(i=>i==="?"?"\\?":i).join("|")})`);let a=!s.test(r);if(!a){const i=r.indexOf(t);i>0&&!s.test(r.substring(0,i))&&(a=!0)}return a},ht=(r,e,t=".")=>{if(!r)return;if(r[e])return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0;const n=e.split(t);let s=r;for(let a=0;a<n.length;){if(!s||typeof s!="object")return;let i,o="";for(let c=a;c<n.length;++c)if(c!==a&&(o+=t),o+=n[c],i=s[o],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&c<n.length-1)continue;a+=c-a+1;break}s=i}return s},Ae=r=>r==null?void 0:r.replace("_","-"),Tn={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,e){var t,n;(n=(t=console==null?void 0:console[r])==null?void 0:t.apply)==null||n.call(t,console,e)}};class Xe{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Tn,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,s){return s&&!this.debug?null:(q(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Xe(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Xe(this.logger,e)}}var me=new Xe;class Qe{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const s=this.observers[n].get(t)||0;this.observers[n].set(t,s+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s.apply(s,[e,...t])})}}class Xt extends Qe{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,s={}){var l,f;const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,i=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):q(n)&&a?o.push(...n.split(a)):o.push(n)));const c=Je(this.data,o);return!c&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),c||!i||!q(n)?c:ht((f=(l=this.data)==null?void 0:l[e])==null?void 0:f[t],n,a)}addResource(e,t,n,s,a={silent:!1}){const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let o=[e,t];n&&(o=o.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=e.split("."),s=t,t=o[1]),this.addNamespaces(t),Jt(this.data,o,s),a.silent||this.emit("added",e,t,n,s)}addResources(e,t,n,s={silent:!1}){for(const a in n)(q(n[a])||Array.isArray(n[a]))&&this.addResource(e,t,a,n[a],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,a,i={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),s=n,n=t,t=o[1]),this.addNamespaces(t);let c=Je(this.data,o)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?wr(c,n,a):c={...c,...n},Jt(this.data,o,c),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(s=>t[s]&&Object.keys(t[s]).length>0)}toJSON(){return this.data}}var Er={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,n,s){return r.forEach(a=>{var i;e=((i=this.processors[a])==null?void 0:i.process(e,t,n,s))??e}),e}};const Zt={},Qt=r=>!q(r)&&typeof r!="boolean"&&typeof r!="number";class Ze extends Qe{constructor(e,t={}){super(),hn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=me.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(e==null)return!1;const s=this.resolve(e,n);return(s==null?void 0:s.res)!==void 0}extractFromKey(e,t){let n=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const s=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let a=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!En(e,n,s);if(i&&!o){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:q(a)?[a]:a};const l=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(l[0])>-1)&&(a=l.shift()),e=l.join(s)}return{key:e,namespaces:q(a)?[a]:a}}translate(e,t,n){let s=typeof t=="object"?{...t}:t;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(s={...s}),s||(s={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const a=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:o,namespaces:c}=this.extractFromKey(e[e.length-1],s),l=c[c.length-1];let f=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;f===void 0&&(f=":");const u=s.lng||this.language,d=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((u==null?void 0:u.toLowerCase())==="cimode")return d?a?{res:`${l}${f}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:`${l}${f}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:o;const m=this.resolve(e,s);let h=m==null?void 0:m.res;const g=(m==null?void 0:m.usedKey)||o,x=(m==null?void 0:m.exactUsedKey)||o,w=["[object Number]","[object Function]","[object RegExp]"],E=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject,S=s.count!==void 0&&!q(s.count),b=Ze.hasDefaultValue(s),N=S?this.pluralResolver.getSuffix(u,s.count,s):"",$=s.ordinal&&S?this.pluralResolver.getSuffix(u,s.count,{ordinal:!1}):"",W=S&&!s.ordinal&&s.count===0,R=W&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${N}`]||s[`defaultValue${$}`]||s.defaultValue;let P=h;j&&!h&&b&&(P=R);const D=Qt(P),I=Object.prototype.toString.apply(P);if(j&&P&&D&&w.indexOf(I)<0&&!(q(E)&&Array.isArray(P))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const U=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,P,{...s,ns:c}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(m.res=U,m.usedParams=this.getUsedParamsDetails(s),m):U}if(i){const U=Array.isArray(P),H=U?[]:{},X=U?x:g;for(const z in P)if(Object.prototype.hasOwnProperty.call(P,z)){const Z=`${X}${i}${z}`;b&&!h?H[z]=this.translate(Z,{...s,defaultValue:Qt(R)?R[z]:void 0,joinArrays:!1,ns:c}):H[z]=this.translate(Z,{...s,joinArrays:!1,ns:c}),H[z]===Z&&(H[z]=P[z])}h=H}}else if(j&&q(E)&&Array.isArray(h))h=h.join(E),h&&(h=this.extendTranslation(h,e,s,n));else{let U=!1,H=!1;!this.isValidLookup(h)&&b&&(U=!0,h=R),this.isValidLookup(h)||(H=!0,h=o);const z=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&H?void 0:h,Z=b&&R!==h&&this.options.updateMissing;if(H||U||Z){if(this.logger.log(Z?"updateKey":"missingKey",u,l,o,Z?R:h),i){const y=this.resolve(o,{...s,keySeparator:!1});y&&y.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let B=[];const _=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&_&&_[0])for(let y=0;y<_.length;y++)B.push(_[y]);else this.options.saveMissingTo==="all"?B=this.languageUtils.toResolveHierarchy(s.lng||this.language):B.push(s.lng||this.language);const p=(y,T,C)=>{var L;const O=b&&C!==h?C:z;this.options.missingKeyHandler?this.options.missingKeyHandler(y,l,T,O,Z,s):(L=this.backendConnector)!=null&&L.saveMissing&&this.backendConnector.saveMissing(y,l,T,O,Z,s),this.emit("missingKey",y,l,T,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&S?B.forEach(y=>{const T=this.pluralResolver.getSuffixes(y,s);W&&s[`defaultValue${this.options.pluralSeparator}zero`]&&T.indexOf(`${this.options.pluralSeparator}zero`)<0&&T.push(`${this.options.pluralSeparator}zero`),T.forEach(C=>{p([y],o+C,s[`defaultValue${C}`]||R)})}):p(B,o,R))}h=this.extendTranslation(h,e,s,m,n),H&&h===o&&this.options.appendNamespaceToMissingKey&&(h=`${l}${f}${o}`),(H||U)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${f}${o}`:o,U?h:void 0,s))}return a?(m.res=h,m.usedParams=this.getUsedParamsDetails(s),m):h}extendTranslation(e,t,n,s,a){var c,l;if((c=this.i18nFormat)!=null&&c.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const f=q(e)&&(((l=n==null?void 0:n.interpolation)==null?void 0:l.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(f){const m=e.match(this.interpolator.nestingRegexp);u=m&&m.length}let d=n.replace&&!q(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,n.lng||this.language||s.usedLng,n),f){const m=e.match(this.interpolator.nestingRegexp),h=m&&m.length;u<h&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...m)=>(a==null?void 0:a[0])===m[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${t[0]}`),null):this.translate(...m,t),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,o=q(i)?[i]:i;return e!=null&&(o!=null&&o.length)&&n.applyPostProcessor!==!1&&(e=Er.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,s,a,i,o;return q(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(n))return;const l=this.extractFromKey(c,t),f=l.key;s=f;let u=l.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const d=t.count!==void 0&&!q(t.count),m=d&&!t.ordinal&&t.count===0,h=t.context!==void 0&&(q(t.context)||typeof t.context=="number")&&t.context!=="",g=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(x=>{var w,E;this.isValidLookup(n)||(o=x,!Zt[`${g[0]}-${x}`]&&((w=this.utils)!=null&&w.hasLoadedNamespace)&&!((E=this.utils)!=null&&E.hasLoadedNamespace(o))&&(Zt[`${g[0]}-${x}`]=!0,this.logger.warn(`key "${s}" for languages "${g.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach(j=>{var N;if(this.isValidLookup(n))return;i=j;const S=[f];if((N=this.i18nFormat)!=null&&N.addLookupKeys)this.i18nFormat.addLookupKeys(S,f,j,x,t);else{let $;d&&($=this.pluralResolver.getSuffix(j,t.count,t));const W=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(S.push(f+$),t.ordinal&&$.indexOf(R)===0&&S.push(f+$.replace(R,this.options.pluralSeparator)),m&&S.push(f+W)),h){const P=`${f}${this.options.contextSeparator}${t.context}`;S.push(P),d&&(S.push(P+$),t.ordinal&&$.indexOf(R)===0&&S.push(P+$.replace(R,this.options.pluralSeparator)),m&&S.push(P+W))}}let b;for(;b=S.pop();)this.isValidLookup(n)||(a=b,n=this.getResource(j,x,b,t))}))})}),{res:n,usedKey:s,exactUsedKey:a,usedLng:i,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,n,s={}){var a;return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!q(e.replace);let s=n?e.replace:e;if(n&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const a of t)delete s[a]}return s}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&e[n]!==void 0)return!0;return!1}}class er{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=me.create("languageUtils")}getScriptPartFromCode(e){if(e=Ae(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=Ae(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(q(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(n=>{if(t)return;const s=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(s))&&(t=s)}),!t&&this.options.supportedLngs&&e.forEach(n=>{if(t)return;const s=this.getScriptPartFromCode(n);if(this.isSupportedCode(s))return t=s;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return t=a;t=this.options.supportedLngs.find(i=>{if(i===a)return i;if(!(i.indexOf("-")<0&&a.indexOf("-")<0)&&(i.indexOf("-")>0&&a.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===a||i.indexOf(a)===0&&a.length>1))return i})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),q(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),s=[],a=i=>{i&&(this.isSupportedCode(i)?s.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return q(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):q(e)&&a(this.formatLanguageCode(e)),n.forEach(i=>{s.indexOf(i)<0&&a(this.formatLanguageCode(i))}),s}}const tr={zero:0,one:1,two:2,few:3,many:4,other:5},rr={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class On{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=me.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Ae(e==="dev"?"en":e),s=t.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:s});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let i;try{i=new Intl.PluralRules(n,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),rr;if(!e.match(/-|_/))return rr;const c=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(c,t)}return this.pluralRulesCache[a]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(s=>`${t}${s}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((s,a)=>tr[s]-tr[a]).map(s=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,t,n={}){const s=this.getRule(e,n);return s?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const nr=(r,e,t,n=".",s=!0)=>{let a=yn(r,e,t);return!a&&s&&q(t)&&(a=ht(r,t,n),a===void 0&&(a=ht(e,t,n))),a},ct=r=>r.replace(/\$/g,"$$$$");class Rn{constructor(e={}){var t;this.logger=me.create("interpolator"),this.options=e,this.format=((t=e==null?void 0:e.interpolation)==null?void 0:t.format)||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:a,prefixEscaped:i,suffix:o,suffixEscaped:c,formatSeparator:l,unescapeSuffix:f,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:m,nestingSuffix:h,nestingSuffixEscaped:g,nestingOptionsSeparator:x,maxReplaces:w,alwaysFormat:E}=e.interpolation;this.escape=t!==void 0?t:bn,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?Te(a):i||"{{",this.suffix=o?Te(o):c||"}}",this.formatSeparator=l||",",this.unescapePrefix=f?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=d?Te(d):m||Te("$t("),this.nestingSuffix=h?Te(h):g||Te(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=w||1e3,this.alwaysFormat=E!==void 0?E:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,n)=>(t==null?void 0:t.source)===n?(t.lastIndex=0,t):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,s){var m;let a,i,o;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=h=>{if(h.indexOf(this.formatSeparator)<0){const E=nr(t,c,h,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,n,{...s,...t,interpolationkey:h}):E}const g=h.split(this.formatSeparator),x=g.shift().trim(),w=g.join(this.formatSeparator).trim();return this.format(nr(t,c,x,this.options.keySeparator,this.options.ignoreJSONStructure),w,n,{...s,...t,interpolationkey:x})};this.resetRegExp();const f=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,u=((m=s==null?void 0:s.interpolation)==null?void 0:m.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:h=>ct(h)},{regex:this.regexp,safeValue:h=>this.escapeValue?ct(this.escape(h)):ct(h)}].forEach(h=>{for(o=0;a=h.regex.exec(e);){const g=a[1].trim();if(i=l(g),i===void 0)if(typeof f=="function"){const w=f(e,a,s);i=q(w)?w:""}else if(s&&Object.prototype.hasOwnProperty.call(s,g))i="";else if(u){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${e}`),i="";else!q(i)&&!this.useRawValueToEscape&&(i=qt(i));const x=h.safeValue(i);if(e=e.replace(a[0],x),u?(h.regex.lastIndex+=i.length,h.regex.lastIndex-=a[0].length):h.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let s,a,i;const o=(c,l)=>{const f=this.nestingOptionsSeparator;if(c.indexOf(f)<0)return c;const u=c.split(new RegExp(`${f}[ ]*{`));let d=`{${u[1]}`;c=u[0],d=this.interpolate(d,i);const m=d.match(/'/g),h=d.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!h||h.length%2!==0)&&(d=d.replace(/'/g,'"'));try{i=JSON.parse(d),l&&(i={...l,...i})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,g),`${c}${f}${d}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,c};for(;s=this.nestingRegexp.exec(e);){let c=[];i={...n},i=i.replace&&!q(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let l=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const f=s[1].split(this.formatSeparator).map(u=>u.trim());s[1]=f.shift(),c=f,l=!0}if(a=t(o.call(this,s[1].trim(),i),i),a&&s[0]===e&&!q(a))return a;q(a)||(a=qt(a)),a||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),a=""),l&&(a=c.reduce((f,u)=>this.format(f,u,n.lng,{...n,interpolationkey:s[1].trim()}),a.trim())),e=e.replace(s[0],a),this.regexp.lastIndex=0}return e}}const jn=r=>{let e=r.toLowerCase().trim();const t={};if(r.indexOf("(")>-1){const n=r.split("(");e=n[0].toLowerCase().trim();const s=n[1].substring(0,n[1].length-1);e==="currency"&&s.indexOf(":")<0?t.currency||(t.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?t.range||(t.range=s.trim()):s.split(";").forEach(i=>{if(i){const[o,...c]=i.split(":"),l=c.join(":").trim().replace(/^'+|'+$/g,""),f=o.trim();t[f]||(t[f]=l),l==="false"&&(t[f]=!1),l==="true"&&(t[f]=!0),isNaN(l)||(t[f]=parseInt(l,10))}})}return{formatName:e,formatOptions:t}},sr=r=>{const e={};return(t,n,s)=>{let a=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(a={...a,[s.interpolationkey]:void 0});const i=n+JSON.stringify(a);let o=e[i];return o||(o=r(Ae(n),s),e[i]=o),o(t)}},Dn=r=>(e,t,n)=>r(Ae(t),n)(e);class Cn{constructor(e={}){this.logger=me.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?sr:Dn;this.formats={number:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a});return o=>i.format(o)}),currency:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a,style:"currency"});return o=>i.format(o)}),datetime:n((s,a)=>{const i=new Intl.DateTimeFormat(s,{...a});return o=>i.format(o)}),relativetime:n((s,a)=>{const i=new Intl.RelativeTimeFormat(s,{...a});return o=>i.format(o,a.range||"day")}),list:n((s,a)=>{const i=new Intl.ListFormat(s,{...a});return o=>i.format(o)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=sr(t)}format(e,t,n,s={}){const a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(o=>o.indexOf(")")>-1)){const o=a.findIndex(c=>c.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,o)].join(this.formatSeparator)}return a.reduce((o,c)=>{var u;const{formatName:l,formatOptions:f}=jn(c);if(this.formats[l]){let d=o;try{const m=((u=s==null?void 0:s.formatParams)==null?void 0:u[s.interpolationkey])||{},h=m.locale||m.lng||s.locale||s.lng||n;d=this.formats[l](o,h,{...f,...s,...m})}catch(m){this.logger.warn(m)}return d}else this.logger.warn(`there was no format function for ${l}`);return o},e)}}const $n=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class Pn extends Qe{constructor(e,t,n,s={}){var a,i;super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=me.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(i=(a=this.backend)==null?void 0:a.init)==null||i.call(a,n,s.backend,s)}queueLoad(e,t,n,s){const a={},i={},o={},c={};return e.forEach(l=>{let f=!0;t.forEach(u=>{const d=`${l}|${u}`;!n.reload&&this.store.hasResourceBundle(l,u)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?i[d]===void 0&&(i[d]=!0):(this.state[d]=1,f=!1,i[d]===void 0&&(i[d]=!0),a[d]===void 0&&(a[d]=!0),c[u]===void 0&&(c[u]=!0)))}),f||(o[l]=!0)}),(Object.keys(a).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(a),pending:Object.keys(i),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(c)}}loaded(e,t,n){const s=e.split("|"),a=s[0],i=s[1];t&&this.emit("failedLoading",a,i,t),!t&&n&&this.store.addResourceBundle(a,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const o={};this.queue.forEach(c=>{gn(c.loaded,[a],i),$n(c,e),t&&c.errors.push(t),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(l=>{o[l]||(o[l]={});const f=c.loaded[l];f.length&&f.forEach(u=>{o[l][u]===void 0&&(o[l][u]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(c=>!c.done)}read(e,t,n,s=0,a=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:a,callback:i});return}this.readingCalls++;const o=(l,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const u=this.waitingReads.shift();this.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}if(l&&f&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,s+1,a*2,i)},a);return}i(l,f)},c=this.backend[n].bind(this.backend);if(c.length===2){try{const l=c(e,t);l&&typeof l.then=="function"?l.then(f=>o(null,f)).catch(o):o(null,l)}catch(l){o(l)}return}return c(e,t,o)}prepareLoading(e,t,n={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();q(e)&&(e=this.languageUtils.toResolveHierarchy(e)),q(t)&&(t=[t]);const a=this.queueLoad(e,t,n,s);if(!a.toLoad.length)return a.pending.length||s(),null;a.toLoad.forEach(i=>{this.loadOne(i)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),s=n[0],a=n[1];this.read(s,a,"read",void 0,void 0,(i,o)=>{i&&this.logger.warn(`${t}loading namespace ${a} for language ${s} failed`,i),!i&&o&&this.logger.log(`${t}loaded namespace ${a} for language ${s}`,o),this.loaded(e,i,o)})}saveMissing(e,t,n,s,a,i={},o=()=>{}){var c,l,f,u,d;if((l=(c=this.services)==null?void 0:c.utils)!=null&&l.hasLoadedNamespace&&!((u=(f=this.services)==null?void 0:f.utils)!=null&&u.hasLoadedNamespace(t))){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((d=this.backend)!=null&&d.create){const m={...i,isUpdate:a},h=this.backend.create.bind(this.backend);if(h.length<6)try{let g;h.length===5?g=h(e,t,n,s,m):g=h(e,t,n,s),g&&typeof g.then=="function"?g.then(x=>o(null,x)).catch(o):o(null,g)}catch(g){o(g)}else h(e,t,n,s,o,m)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const ar=()=>({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:r=>{let e={};if(typeof r[1]=="object"&&(e=r[1]),q(r[1])&&(e.defaultValue=r[1]),q(r[2])&&(e.tDescription=r[2]),typeof r[2]=="object"||typeof r[3]=="object"){const t=r[3]||r[2];Object.keys(t).forEach(n=>{e[n]=t[n]})}return e},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ir=r=>{var e,t;return q(r.ns)&&(r.ns=[r.ns]),q(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),q(r.fallbackNS)&&(r.fallbackNS=[r.fallbackNS]),((t=(e=r.supportedLngs)==null?void 0:e.indexOf)==null?void 0:t.call(e,"cimode"))<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),typeof r.initImmediate=="boolean"&&(r.initAsync=r.initImmediate),r},Ue=()=>{},An=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class Le extends Qe{constructor(e={},t){if(super(),this.options=ir(e),this.services={},this.logger=me,this.modules={external:[]},An(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(q(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=ar();this.options={...n,...this.options,...ir(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const s=l=>l?typeof l=="function"?new l:l:null;if(!this.options.isClone){this.modules.logger?me.init(s(this.modules.logger),this.options):me.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:l=Cn;const f=new er(this.options);this.store=new Xt(this.options.resources,this.options);const u=this.services;u.logger=me,u.resourceStore=this.store,u.languageUtils=f,u.pluralResolver=new On(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),l&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(u.formatter=s(l),u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new Rn(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Pn(s(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",(d,...m)=>{this.emit(d,...m)}),this.modules.languageDetector&&(u.languageDetector=s(this.modules.languageDetector),u.languageDetector.init&&u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=s(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new Ze(this.services,this.options),this.translator.on("*",(d,...m)=>{this.emit(d,...m)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Ue),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[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(l=>{this[l]=(...f)=>this.store[l](...f)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=(...f)=>(this.store[l](...f),this)});const o=Ce(),c=()=>{const l=(f,u)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(u),t(f,u)};if(this.languages&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),o}loadResources(e,t=Ue){var a,i;let n=t;const s=q(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const o=[],c=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(u=>{u!=="cimode"&&o.indexOf(u)<0&&o.push(u)})};s?c(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>c(f)),(i=(a=this.options.preload)==null?void 0:a.forEach)==null||i.call(a,l=>c(l)),this.services.backendConnector.load(o,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(l)})}else n(null)}reloadResources(e,t,n){const s=Ce();return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Ue),this.services.backendConnector.reload(e,t,a=>{s.resolve(),n(a)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Er.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t<this.languages.length;t++){const n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=Ce();this.emit("languageChanging",e);const s=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},a=(o,c)=>{c?this.isLanguageChangingTo===e&&(s(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,n.resolve((...l)=>this.t(...l)),t&&t(o,(...l)=>this.t(...l))},i=o=>{var f,u;!e&&!o&&this.services.languageDetector&&(o=[]);const c=q(o)?o:o&&o[0],l=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(q(o)?[o]:o);l&&(this.language||s(l),this.translator.language||this.translator.changeLanguage(l),(u=(f=this.services.languageDetector)==null?void 0:f.cacheUserLanguage)==null||u.call(f,l)),this.loadResources(l,d=>{a(d,l)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?i(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e),n}getFixedT(e,t,n){const s=(a,i,...o)=>{let c;typeof i!="object"?c=this.options.overloadTranslationOptionHandler([a,i].concat(o)):c={...i},c.lng=c.lng||s.lng,c.lngs=c.lngs||s.lngs,c.ns=c.ns||s.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||n||s.keyPrefix);const l=this.options.keySeparator||".";let f;return c.keyPrefix&&Array.isArray(a)?f=a.map(u=>`${c.keyPrefix}${l}${u}`):f=c.keyPrefix?`${c.keyPrefix}${l}${a}`:a,this.t(f,c)};return q(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=n,s}t(...e){var t;return(t=this.translator)==null?void 0:t.translate(...e)}exists(...e){var t;return(t=this.translator)==null?void 0:t.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const i=(o,c)=>{const l=this.services.backendConnector.state[`${o}|${c}`];return l===-1||l===0||l===2};if(t.precheck){const o=t.precheck(this,i);if(o!==void 0)return o}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(n,e)&&(!s||i(a,e)))}loadNamespaces(e,t){const n=Ce();return this.options.ns?(q(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{n.resolve(),t&&t(s)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Ce();q(e)&&(e=[e]);const s=this.options.preload||[],a=e.filter(i=>s.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return a.length?(this.options.preload=s.concat(a),this.loadResources(i=>{n.resolve(),t&&t(i)}),n):(t&&t(),Promise.resolve())}dir(e){var s,a;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((a=this.services)==null?void 0:a.languageUtils)||new er(ar());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new Le(e,t)}cloneInstance(e={},t=Ue){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new Le(s);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(o=>{a[o]=this[o]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const o=Object.keys(this.store.data).reduce((c,l)=>(c[l]={...this.store.data[l]},c[l]=Object.keys(c[l]).reduce((f,u)=>(f[u]={...c[l][u]},f),c[l]),c),{});a.store=new Xt(o,s),a.services.resourceStore=a.store}return a.translator=new Ze(a.services,s),a.translator.on("*",(o,...c)=>{a.emit(o,...c)}),a.init(s,t),a.translator.options=s,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ae=Le.createInstance();ae.createInstance=Le.createInstance;ae.createInstance;ae.dir;ae.init;ae.loadResources;ae.reloadResources;ae.use;ae.changeLanguage;ae.getFixedT;ae.t;ae.exists;ae.setDefaultNamespace;ae.hasLoadedNamespace;ae.loadNamespaces;ae.loadLanguages;const Ln={Friday:"Venerdì",FridayShort:"Ven",Monday:"Lunedì",MondayShort:"Lun",Saturday:"Sabato",SaturdayShort:"Sab",Sunday:"Domenica",SundayShort:"Dom",Tuesday:"Martedì",TuesdayShort:"Mar",Thursday:"Giovedì",ThursdayShort:"Gio",Wednesday:"Mercoledì",WednesdayShort:"Mer"},_n={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},kn={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando"},In={Date:{NextDay:"Giorno Successivo",NextMonth:"Mese Successivo",NextWeek:"Settimana Successiva",NextYear:"Anno Successivo",PreviousDay:"Giorno Precedente",PreviousMonth:"Mese Precedente",PreviousWeek:"Settimana Precedente",PreviousYear:"Anno Precedente",Today:"Oggi",Tomorrow:"Domani",Yesterday:"Ieri"},Day:Ln,Month:_n,Generic:kn},Nn={Friday:"Friday",FridayShort:"Fri",Monday:"Monday",MondayShort:"Mon",Saturday:"Saturday",SaturdayShort:"Sat",Sunday:"Sunday",SundayShort:"Sun",Tuesday:"Tuesday",TuesdayShort:"Tue",Thursday:"Thursday",ThursdayShort:"Thu",Wednesday:"Wednesday",WednesdayShort:"Wed"},Mn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},Fn={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command"},Vn={Date:{NextDay:"Next Day",NextMonth:"Next Month",NextWeek:"Next Week",NextYear:"Next Year",PreviousDay:"Previous Day",PreviousMonth:"Previous Month",PreviousWeek:"Previous Week",PreviousYear:"Previous Year",Today:"Today",Tomorrow:"Tomorrow",Yesterday:"Yesterday"},Day:Nn,Month:Mn,Generic:Fn};function or(r,e){return new RegExp(Yn(r),e)}function Yn(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Un(r,e,t,n){let s=e;const a=Wn(r,t);if(!s){const o=Math.abs(a);o-Math.floor(o)?s="0,0.00":s="0,0"}const i=Bn(s);return new Intl.NumberFormat(n,i).format(a)}function Wn(r,e,t,n,s){let a=r;if(typeof a!="number"){let o;e&&n===void 0?o=",":o=".";const c=o=="."?",":".";a=a.replace(or(c,"g"),""),a=a.replace(or(o,"g"),"."),a=Number(a)}const i=Number(a);return isNaN(i)?NaN:i}function Bn(r){const e={};r.includes(",")?e.useGrouping=!0:e.useGrouping=!1;const t=r.indexOf(".");if(t>-1){const s=(r.substring(t+1).match(/0/g)||[]).length;e.minimumFractionDigits=s,e.maximumFractionDigits=s}else e.minimumFractionDigits=0,e.maximumFractionDigits=0;return e}ae.init({lng:typeof navigator<"u"&&navigator.language.split("-")[0]||"en",fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1,format:(r,e,t,n)=>{const s=(n==null?void 0:n.type)??"number";try{switch(s){case"date":{const a=r instanceof Date?r:new Date(r);return new Intl.DateTimeFormat(t,{dateStyle:e||"short"}).format(a)}default:case"number":{const a=(n==null?void 0:n.inputIsLocalized)??!1;return Un(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:Vn},it:{translation:In}}});const Hn=(r,e,t,n)=>ae.format(r,e,t||ae.language,n),Gn=(r,e)=>ae.t(r,e);function et(){const r=A.useCallback((n,s,a,i)=>Hn(n,s,a||void 0,i),[]),e=A.useCallback(()=>ae.languages[0],[]),t=A.useCallback((n,s)=>Gn(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var St=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r))(St||{}),oe=(r=>(r.MONDAY="Day.Monday",r.MONDAY_SHORT="Day.MondayShort",r.TUESDAY="Day.Tuesday",r.TUESDAY_SHORT="Day.TuesdayShort",r.WEDNESDAY="Day.Wednesday",r.WEDNESDAY_SHORT="Day.WednesdayShort",r.THURSDAY="Day.Thursday",r.THURSDAY_SHORT="Day.ThursdayShort",r.FRIDAY="Day.Friday",r.FRIDAY_SHORT="Day.FridayShort",r.SATURDAY="Day.Saturday",r.SATURDAY_SHORT="Day.SaturdayShort",r.SUNDAY="Day.Sunday",r.SUNDAY_SHORT="Day.SundayShort",r))(oe||{}),ue=(r=>(r.JANUARY="Month.January",r.FEBRUARY="Month.February",r.MARCH="Month.March",r.APRIL="Month.April",r.MAY="Month.May",r.JUNE="Month.June",r.JULY="Month.July",r.AUGUST="Month.August",r.SEPTEMBER="Month.September",r.OCTOBER="Month.October",r.NOVEMBER="Month.November",r.DECEMBER="Month.December",r))(ue||{}),mt=(r=>(r.PREVIOUS_DAY="Date.PreviousDay",r.PREVIOUS_WEEK="Date.PreviousWeek",r.PREVIOUS_MONTH="Date.PreviousMonth",r.PREVIOUS_YEAR="Date.PreviousYear",r.NEXT_DAY="Date.NextDay",r.NEXT_WEEK="Date.NextWeek",r.NEXT_MONTH="Date.NextMonth",r.NEXT_YEAR="Date.NextYear",r.YESTERDAY="Date.Yesterday",r.TODAY="Date.Today",r.TOMORROW="Date.Tomorrow",r))(mt||{});function qn({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=et(),i=()=>{if(!n)return;const _=new Date(n);return isNaN(_.getTime())?void 0:_},[o]=A.useState(new Date),[c,l]=A.useState(r||i()||new Date),[f,u]=A.useState(c?c.getMonth():new Date().getMonth()),[d,m]=A.useState(c?c.getFullYear():new Date().getFullYear()),[h,g]=A.useState(c?c.getDate():null),x=A.useRef(null),w=A.useRef([]),E=[a(ue.JANUARY),a(ue.FEBRUARY),a(ue.MARCH),a(ue.APRIL),a(ue.MAY),a(ue.JUNE),a(ue.JULY),a(ue.AUGUST),a(ue.SEPTEMBER),a(ue.OCTOBER),a(ue.NOVEMBER),a(ue.DECEMBER)],j=[{value:a(oe.SUNDAY_SHORT),full:a(oe.SUNDAY)},{value:a(oe.MONDAY_SHORT),full:a(oe.MONDAY)},{value:a(oe.TUESDAY_SHORT),full:a(oe.TUESDAY)},{value:a(oe.WEDNESDAY_SHORT),full:a(oe.WEDNESDAY)},{value:a(oe.THURSDAY_SHORT),full:a(oe.THURSDAY)},{value:a(oe.FRIDAY_SHORT),full:a(oe.FRIDAY)},{value:a(oe.SATURDAY_SHORT),full:a(oe.SATURDAY)}],S=_=>t.some(p=>{const y=p.start.getTime(),T=p.end.getTime(),C=_.getTime();return C>=y&&C<=T}),b=_=>{S(_)||(l(_),g(_.getDate()),e&&e(Vr(_)))},N=()=>{f===0?(u(11),m(d-1)):u(f-1),g(1)},$=()=>{f===11?(u(0),m(d+1)):u(f+1),g(1)},W=(_,p)=>new Date(_,p+1,0).getDate(),R=(_,p)=>new Date(_,p,1).getDay(),P=_=>{var y;const p=H.findIndex(T=>T!==null&&T.getDate()===_);p!==-1&&w.current[p]&&((y=w.current[p])==null||y.focus(),g(_))},D=(_,p)=>{const y=H[p];if(!y)return;const T=W(d,f),C=y.getDate();switch(_.key){case"ArrowRight":_.preventDefault();{let O=C+1,L=new Date(d,f,O);if(O>T){const F=f===11?d+1:d,V=f===11?0:f+1;O=1,L=new Date(F,V,O),$(),setTimeout(()=>{I(1,"forward")},0);return}S(L)?I(O,"forward"):P(O)}break;case"Tab":break;case"ArrowLeft":_.preventDefault();{let O=C-1,L=new Date(d,f,O);if(O<1){const F=f===0?d-1:d,V=f===0?11:f-1,M=W(F,V);O=M,L=new Date(F,V,O),N(),setTimeout(()=>{I(M,"backward")},0);return}S(L)?I(O,"backward"):P(O)}break;case"ArrowUp":_.preventDefault();{let O=C-7,L=new Date(d,f,O);if(O<1){const F=f===0?d-1:d,V=f===0?11:f-1;O=W(F,V)+O,L=new Date(F,V,O),N(),setTimeout(()=>{I(O,"backward")},0);return}S(L)?I(O,"backward"):P(O)}break;case"ArrowDown":_.preventDefault();{let O=C+7,L=new Date(d,f,O);if(O>T){const F=f===11?d+1:d,V=f===11?0:f+1;O=O-T,L=new Date(F,V,O),$(),setTimeout(()=>{I(O,"forward")},0);return}S(L)?I(O,"forward"):P(O)}break;case"Home":_.preventDefault(),I(1,"forward");break;case"End":_.preventDefault(),I(T,"backward");break;case"PageUp":_.preventDefault(),N(),setTimeout(()=>{const O=W(f===0?d-1:d,f===0?11:f-1),L=Math.min(C,O);I(L,"forward")},0);break;case"PageDown":_.preventDefault(),$(),setTimeout(()=>{const O=W(f===11?d+1:d,f===11?0:f+1),L=Math.min(C,O);I(L,"forward")},0);break;case" ":case"Space":if(S(y))return;g(y.getDate()),l(y);break;case"Enter":_.preventDefault(),b(y);break}},I=(_,p)=>{const y=W(d,f);if(p==="forward"){for(let T=_;T<=y;T++){const C=new Date(d,f,T);if(!S(C)){P(T);return}}$(),setTimeout(()=>{I(1,"forward")},0)}else{for(let L=_;L>=1;L--){const F=new Date(d,f,L);if(!S(F)){P(L);return}}const T=f===0?d-1:d,C=f===0?11:f-1,O=W(T,C);N(),setTimeout(()=>{I(O,"backward")},0)}},H=(()=>{const _=W(d,f),p=R(d,f),y=[];for(let T=0;T<p;T++)y.push(null);for(let T=1;T<=_;T++){const C=new Date(d,f,T);y.push(C)}return y})(),X=[];let z=[];H.forEach((_,p)=>{if(z.push(_),z.length===7||p===H.length-1){for(;z.length<7;)z.push(null);X.push(z),z=[]}}),A.useEffect(()=>{var _;if(h!==null){const p=H.findIndex(y=>y!==null&&y.getDate()===h);p!==-1&&w.current[p]&&((_=w.current[p])==null||_.focus())}},[f,d,h,H]);const Z={label:"smp-datepickercalendar-label",wrapper:"smp-datepickercalendar",calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(_,p,y,T)=>`smp-datepickercalendar-td
44
+ */var nt,It;function tn(){if(It)return nt;It=1;var r=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function s(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var i={},o=0;o<10;o++)i["_"+String.fromCharCode(o)]=o;var c=Object.getOwnPropertyNames(i).map(function(u){return i[u]});if(c.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(u){l[u]=u}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return nt=s()?Object.assign:function(a,i){for(var o,c=n(a),l,u=1;u<arguments.length;u++){o=Object(arguments[u]);for(var f in o)e.call(o,f)&&(c[f]=o[f]);if(r){l=r(o);for(var d=0;d<l.length;d++)t.call(o,l[d])&&(c[l[d]]=o[l[d]])}}return c},nt}var st,Nt;function vt(){if(Nt)return st;Nt=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return st=r,st}var at,Mt;function mr(){return Mt||(Mt=1,at=Function.call.bind(Object.prototype.hasOwnProperty)),at}var it,Ft;function rn(){if(Ft)return it;Ft=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var e=vt(),t={},n=mr();r=function(a){var i="Warning: "+a;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function s(a,i,o,c,l){if(process.env.NODE_ENV!=="production"){for(var u in a)if(n(a,u)){var f;try{if(typeof a[u]!="function"){var d=Error((c||"React class")+": "+o+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}f=a[u](i,u,c,o,null,e)}catch(m){f=m}if(f&&!(f instanceof Error)&&r((c||"React class")+": type specification of "+o+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in t)){t[f.message]=!0;var h=l?l():"";r("Failed "+o+" type: "+f.message+(h??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},it=s,it}var ot,Vt;function nn(){if(Vt)return ot;Vt=1;var r=hr(),e=tn(),t=vt(),n=mr(),s=rn(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(o){var c="Warning: "+o;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function i(){return null}return ot=function(o,c){var l=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function f(p){var y=p&&(l&&p[l]||p[u]);if(typeof y=="function")return y}var d="<<anonymous>>",h={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:E(),arrayOf:R,element:S(),elementType:b(),instanceOf:N,node:A(),objectOf:U,oneOf:$,oneOfType:j,shape:k,exact:W};function m(p,y){return p===y?p!==0||1/p===1/y:p!==p&&y!==y}function g(p,y){this.message=p,this.data=y&&typeof y=="object"?y:{},this.stack=""}g.prototype=Error.prototype;function x(p){if(process.env.NODE_ENV!=="production")var y={},T=0;function C(L,F,V,M,J,G,se){if(M=M||d,G=G||V,se!==t){if(c){var I=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw I.name="Invariant Violation",I}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var Y=M+":"+V;!y[Y]&&T<3&&(a("You are manually calling a React.PropTypes validation function for the `"+G+"` prop on `"+M+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),y[Y]=!0,T++)}}return F[V]==null?L?F[V]===null?new g("The "+J+" `"+G+"` is marked as required "+("in `"+M+"`, but its value is `null`.")):new g("The "+J+" `"+G+"` is marked as required in "+("`"+M+"`, but its value is `undefined`.")):null:p(F,V,M,J,G)}var O=C.bind(null,!1);return O.isRequired=C.bind(null,!0),O}function w(p){function y(T,C,O,L,F,V){var M=T[C],J=z(M);if(J!==p){var G=X(M);return new g("Invalid "+L+" `"+F+"` of type "+("`"+G+"` supplied to `"+O+"`, expected ")+("`"+p+"`."),{expectedType:p})}return null}return x(y)}function E(){return x(i)}function R(p){function y(T,C,O,L,F){if(typeof p!="function")return new g("Property `"+F+"` of component `"+O+"` has invalid PropType notation inside arrayOf.");var V=T[C];if(!Array.isArray(V)){var M=z(V);return new g("Invalid "+L+" `"+F+"` of type "+("`"+M+"` supplied to `"+O+"`, expected an array."))}for(var J=0;J<V.length;J++){var G=p(V,J,O,L,F+"["+J+"]",t);if(G instanceof Error)return G}return null}return x(y)}function S(){function p(y,T,C,O,L){var F=y[T];if(!o(F)){var V=z(F);return new g("Invalid "+O+" `"+L+"` of type "+("`"+V+"` supplied to `"+C+"`, expected a single ReactElement."))}return null}return x(p)}function b(){function p(y,T,C,O,L){var F=y[T];if(!r.isValidElementType(F)){var V=z(F);return new g("Invalid "+O+" `"+L+"` of type "+("`"+V+"` supplied to `"+C+"`, expected a single ReactElement type."))}return null}return x(p)}function N(p){function y(T,C,O,L,F){if(!(T[C]instanceof p)){var V=p.name||d,M=_(T[C]);return new g("Invalid "+L+" `"+F+"` of type "+("`"+M+"` supplied to `"+O+"`, expected ")+("instance of `"+V+"`."))}return null}return x(y)}function $(p){if(!Array.isArray(p))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),i;function y(T,C,O,L,F){for(var V=T[C],M=0;M<p.length;M++)if(m(V,p[M]))return null;var J=JSON.stringify(p,function(se,I){var Y=X(I);return Y==="symbol"?String(I):I});return new g("Invalid "+L+" `"+F+"` of value `"+String(V)+"` "+("supplied to `"+O+"`, expected one of "+J+"."))}return x(y)}function U(p){function y(T,C,O,L,F){if(typeof p!="function")return new g("Property `"+F+"` of component `"+O+"` has invalid PropType notation inside objectOf.");var V=T[C],M=z(V);if(M!=="object")return new g("Invalid "+L+" `"+F+"` of type "+("`"+M+"` supplied to `"+O+"`, expected an object."));for(var J in V)if(n(V,J)){var G=p(V,J,O,L,F+"."+J,t);if(G instanceof Error)return G}return null}return x(y)}function j(p){if(!Array.isArray(p))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var y=0;y<p.length;y++){var T=p[y];if(typeof T!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+H(T)+" at index "+y+"."),i}function C(O,L,F,V,M){for(var J=[],G=0;G<p.length;G++){var se=p[G],I=se(O,L,F,V,M,t);if(I==null)return null;I.data&&n(I.data,"expectedType")&&J.push(I.data.expectedType)}var Y=J.length>0?", expected one of type ["+J.join(", ")+"]":"";return new g("Invalid "+V+" `"+M+"` supplied to "+("`"+F+"`"+Y+"."))}return x(C)}function A(){function p(y,T,C,O,L){return B(y[T])?null:new g("Invalid "+O+" `"+L+"` supplied to "+("`"+C+"`, expected a ReactNode."))}return x(p)}function D(p,y,T,C,O){return new g((p||"React class")+": "+y+" type `"+T+"."+C+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+O+"`.")}function k(p){function y(T,C,O,L,F){var V=T[C],M=z(V);if(M!=="object")return new g("Invalid "+L+" `"+F+"` of type `"+M+"` "+("supplied to `"+O+"`, expected `object`."));for(var J in p){var G=p[J];if(typeof G!="function")return D(O,L,F,J,X(G));var se=G(V,J,O,L,F+"."+J,t);if(se)return se}return null}return x(y)}function W(p){function y(T,C,O,L,F){var V=T[C],M=z(V);if(M!=="object")return new g("Invalid "+L+" `"+F+"` of type `"+M+"` "+("supplied to `"+O+"`, expected `object`."));var J=e({},T[C],p);for(var G in J){var se=p[G];if(n(p,G)&&typeof se!="function")return D(O,L,F,G,X(se));if(!se)return new g("Invalid "+L+" `"+F+"` key `"+G+"` supplied to `"+O+"`.\nBad object: "+JSON.stringify(T[C],null," ")+`
45
+ Valid keys: `+JSON.stringify(Object.keys(p),null," "));var I=se(V,G,O,L,F+"."+G,t);if(I)return I}return null}return x(y)}function B(p){switch(typeof p){case"number":case"string":case"undefined":return!0;case"boolean":return!p;case"object":if(Array.isArray(p))return p.every(B);if(p===null||o(p))return!0;var y=f(p);if(y){var T=y.call(p),C;if(y!==p.entries){for(;!(C=T.next()).done;)if(!B(C.value))return!1}else for(;!(C=T.next()).done;){var O=C.value;if(O&&!B(O[1]))return!1}}else return!1;return!0;default:return!1}}function K(p,y){return p==="symbol"?!0:y?y["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&y instanceof Symbol:!1}function z(p){var y=typeof p;return Array.isArray(p)?"array":p instanceof RegExp?"object":K(y,p)?"symbol":y}function X(p){if(typeof p>"u"||p===null)return""+p;var y=z(p);if(y==="object"){if(p instanceof Date)return"date";if(p instanceof RegExp)return"regexp"}return y}function H(p){var y=X(p);switch(y){case"array":case"object":return"an "+y;case"boolean":case"date":case"regexp":return"a "+y;default:return y}}function _(p){return!p.constructor||!p.constructor.name?d:p.constructor.name}return h.checkPropTypes=s,h.resetWarningCache=s.resetWarningCache,h.PropTypes=h,h},ot}var lt,Yt;function sn(){if(Yt)return lt;Yt=1;var r=vt();function e(){}function t(){}return t.resetWarningCache=e,lt=function(){function n(i,o,c,l,u,f){if(f!==r){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}n.isRequired=n;function s(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:e};return a.PropTypes=a,a},lt}var Ut;function an(){if(Ut)return Fe.exports;if(Ut=1,process.env.NODE_ENV!=="production"){var r=hr(),e=!0;Fe.exports=nn()(r.isElement,e)}else Fe.exports=sn()();return Fe.exports}var ie=an(),on=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},ln=function(e,t){for(var n in e)if(!(n in t))return!0;for(var s in t)if(e[s]!==t[s])return!0;return!1},cn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Ye="http://www.w3.org/2000/svg",Wt="http://www.w3.org/1999/xlink",Re=function(r){function e(){for(var n,s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];return n=r.call.apply(r,[this].concat(a))||this,n.initialState={hasError:!1,isLoading:!0},n.state=n.initialState,n._isMounted=!1,n.reactWrapper=void 0,n.nonReactWrapper=void 0,n.refCallback=function(o){n.reactWrapper=o},n}Wr(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof on(this.reactWrapper).Node){var a=this.props,i=a.desc,o=a.evalScripts,c=a.httpRequestWithCredentials,l=a.renumerateIRIElements,u=a.src,f=a.title,d=a.useRequestCache,h=this.props.onError,m=this.props.beforeInjection,g=this.props.afterInjection,x=this.props.wrapper,w,E;x==="svg"?(w=document.createElementNS(Ye,x),w.setAttribute("xmlns",Ye),w.setAttribute("xmlns:xlink",Wt),E=document.createElementNS(Ye,x)):(w=document.createElement(x),E=document.createElement(x)),w.appendChild(E),E.dataset.src=u,this.nonReactWrapper=this.reactWrapper.appendChild(w);var R=function($){if(s.removeSVG(),!s._isMounted){h($);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){h($)})},S=function($,U){if($){R($);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{g(U)}catch(j){R(j)}})},b=function($){if($.setAttribute("role","img"),i){var U=$.querySelector(":scope > desc");U&&$.removeChild(U);var j=document.createElement("desc");j.innerHTML=i,$.prepend(j)}if(f){var A=$.querySelector(":scope > title");A&&$.removeChild(A);var D=document.createElement("title");D.innerHTML=f,$.prepend(D)}try{m($)}catch(k){R(k)}};Zr(E,{afterEach:S,beforeEach:b,cacheRequests:d,evalScripts:o,httpRequestWithCredentials:c,renumerateIRIElements:l})}},t.removeSVG=function(){var s;(s=this.nonReactWrapper)!=null&&s.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},t.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},t.componentDidUpdate=function(s){var a=this;ln(Ke({},s),this.props)&&this.setState(function(){return a.initialState},function(){a.removeSVG(),a.renderSVG()})},t.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},t.render=function(){var s=this.props;s.afterInjection,s.beforeInjection,s.desc,s.evalScripts;var a=s.fallback;s.httpRequestWithCredentials;var i=s.loading;s.renumerateIRIElements,s.src,s.title,s.useRequestCache;var o=s.wrapper,c=Ur(s,cn),l=o;return ke.createElement(l,Ke({},c,{ref:this.refCallback},o==="svg"?{xmlns:Ye,xmlnsXlink:Wt}:{}),this.state.isLoading&&i&&ke.createElement(i,null),this.state.hasError&&a&&ke.createElement(a,null))},e}(ke.Component);Re.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};Re.propTypes={afterInjection:ie.func,beforeInjection:ie.func,desc:ie.string,evalScripts:ie.oneOf(["always","once","never"]),fallback:ie.oneOfType([ie.func,ie.object,ie.string]),httpRequestWithCredentials:ie.bool,loading:ie.oneOfType([ie.func,ie.object,ie.string]),onError:ie.func,renumerateIRIElements:ie.bool,src:ie.string.isRequired,title:ie.string,useRequestCache:ie.bool,wrapper:ie.oneOf(["div","span","svg"])};let pt={assets:"/"};const un=r=>{pt={...pt,...r}},Ht=r=>`${pt.assets}/${r}`.replace(/\/+/g,"/"),le=P.memo(({icon:r,width:e,height:t,placeholderIcon:n,color:s,disabled:a,state:i="base",rotated:o=!1,onClick:c,isInteractable:l=!1,spin:u=!1,title:f})=>{const[d,h]=P.useState(r),m=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),g=m&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),x=Ht(`assets/svg/${r}.svg`),w=Ht(`assets/svg/${n}.svg`),E={img:`${l?"smp-image-interactable":""}`,svg:`smp-icon ${i?`smp-icon-${i}`:""} ${o?"smp-icon-rotated":""} ${l?"smp-icon-interactable":""} ${u?"smp-icon-spin":""}`},R=()=>{!a&&l&&c&&c()};return v.jsx(v.Fragment,{children:g?v.jsx(Re,{src:r,fallback:()=>v.jsx(Re,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:f,role:"application",fill:s,"aria-disabled":a,className:E.svg,onClick:R}):m?v.jsx("img",{src:d,width:e||"16px",height:t||"auto",alt:f,onError:()=>h(w),onClick:R,className:E.img,title:f,onKeyDown:S=>{(S.key==="Enter"||S.key===" ")&&R()}}):v.jsx(Re,{src:x,fallback:()=>v.jsx(Re,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:f,role:"application",fill:s,"aria-disabled":a,className:E.svg,onClick:R})})}),we=({disabled:r,bindValue:e,icon:t,onBlur:n,onChange:s,placeholder:a,isEditable:i=!0,shapeIcon:o,sizing:c,state:l,variant:u,rotatedShapeIcon:f=!1,onShapeIconClick:d,ref:h,inputRef:m,onKeyDown:g,inputType:x="text",ariaLabel:w="input field",label:E,helperText:R=!1,error:S,appearance:b="base",fullWidth:N=!1,_dataComponent:$="textfield",width:U})=>{const j=P.useId(),A=`${j}-helper`,D=S?"danger":l,k=S||l=="danger"?"error":o,W=R||!!S,B=X=>{s==null||s(X.target.value)},K={wrapper:`smp-textfield-wrapper ${N?"smp-textfield-fullWidth":""}`,container:`smp-textfield ${r?"smp-textfield-disabled":""} ${a?"smp-textfield-placeholder":""} ${c?`smp-textfield-${c}`:""} ${D?`smp-textfield-${D}`:""} ${b?`smp-textfield-${b}`:""} ${i?"":"smp-textfield-readOnly"}`,input:"smp-textfield-input "};u&&(u!="notSelectable"||i)&&(K.container+=`smp-textfield-variant-${u}`);const z=U?{"--smp-textField-width-base":U}:void 0;return v.jsxs("div",{className:K.wrapper,"data-component":$,children:[E&&v.jsx(je,{label:E,disabled:r,htmlFor:j}),v.jsxs("div",{className:K.container,ref:h,style:z,children:[t&&v.jsx(le,{icon:t,disabled:r}),v.jsx("input",{id:j,type:x,value:e,placeholder:a,onChange:B,onBlur:n,className:K.input,disabled:r,readOnly:!i,onKeyDown:g,"aria-label":w,ref:m,"aria-describedby":W?A:void 0}),k&&v.jsx(le,{icon:k,disabled:r,state:D,onClick:d,rotated:f,isInteractable:i})]}),W&&v.jsx(fr,{helperText:S,disabled:r,state:D,id:A})]})};function gr({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=P.useState(0),i=P.useRef(null),o=r.length*e,c=Math.max(0,Math.floor(s/e)-n),l=Math.min(r.length-1,Math.floor((s+t)/e)+n),u=[];for(let h=c;h<=l;h++)u.push({item:r[h],index:h,offsetTop:h*e});const f=P.useCallback(h=>{const m=h.target.scrollTop;a(m)},[]),d=h=>{if(!i.current)return;const m=h*e,g=m+e,x=i.current,w=x.scrollTop,E=w+t;m<w?x.scrollTop=m:g>E&&(x.scrollTop=g-t)};return{virtualItems:u,containerProps:{ref:i,style:{maxHeight:`${t}px`,overflowY:"auto",position:"relative",willChange:"transform"},onScroll:f},innerProps:{style:{height:`${o}px`,position:"relative",width:"100%"}},scrollInfo:{scrollTop:s,viewportHeight:t,totalHeight:o,startIndex:c,endIndex:l},scrollToIndex:d}}const fn=10,yr=({id:r,options:e,displayMode:t,ref:n,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:c,onKeyDown:l})=>{var A;const[u,f]=P.useState(""),d=24,[h,m]=P.useState(a!==null?a:-1),g=s!==void 0?s:e.length>fn,x=u?e.filter(D=>D.label.toLowerCase().includes(u.toLowerCase())):e,w=D=>{f(D)},{virtualItems:E,containerProps:R,innerProps:S,scrollToIndex:b}=gr({items:x,itemHeight:d,containerHeight:200,overscan:5});P.useEffect(()=>{a!==null&&a!==h&&m(a)},[a]),P.useEffect(()=>{h>=0&&h<x.length&&b(h)},[h,x]);const N=D=>{if(D.key==="ArrowDown"||D.key==="ArrowUp"){D.preventDefault();let k=h;D.key==="ArrowDown"?k=h<x.length-1?h+1:0:D.key==="ArrowUp"&&(k=h>0?h-1:x.length-1),m(k)}else D.key==="Enter"?h>=0&&h<x.length&&(c==null||c(x[h])):D.key==="Escape"&&(D.preventDefault(),D.stopPropagation());l&&l(D)},$=D=>{N(D)},U=D=>{N(D)},j={wrapper:"smp-list",container:"smp-list-container",virtualScroll:"smp-list-virtualScroll",listItem:"smp-list-listItem"};return v.jsxs("div",{id:r,ref:n,className:j.wrapper,"data-component":"list",style:{width:o},children:[g&&v.jsx(we,{bindValue:u,placeholder:"Search...",onChange:w,onKeyDown:$}),v.jsx("div",{...R,className:j.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:U,"aria-activedescendant":h>=0&&h<x.length?(A=x[h])==null?void 0:A.id:void 0,children:v.jsx("div",{...S,className:j.virtualScroll,children:E.map(({item:D,index:k,offsetTop:W})=>{const B=i.includes(D.id);return v.jsxs("li",{role:"option",id:D.id,"aria-selected":h===k?"true":"false",tabIndex:-1,className:`${j.listItem} ${h===k?"selected-item":""}`,"aria-label":D.id+"-"+D.label,style:{height:`${d}px`,lineHeight:`calc(${d}px - 2*2px)`,transform:`translateY(${W}px)`},onClick:()=>{c==null||c(D),m(k)},children:[ze(D.id,D.label,t),B&&v.jsx(le,{icon:"check",width:16})]},D.id)})})})]})},vr=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=P.useState(ze(e,t,r));return P.useEffect(()=>{a(e)},[e]),P.useEffect(()=>{a(ze(e,t,r))},[t,r]),v.jsx(we,{...n,bindValue:s})},dn=r=>{const e=P.useRef(null);return P.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},r)}},bt=({bindValue:r,optionalDisplayValue:e,options:t,displayMode:n,listDisplayMode:s="Both",minimumChars:a=3,isEditable:i=!0,placeholder:o,fun:c,_changeOnEnter:l=!1,onChange:u,onOptionsRequest:f,_multiActiveIndex:d,...h})=>{const[m,g]=P.useState(r),[x,w]=P.useState(e),[E,R]=P.useState(!1),[S,b]=P.useState(t||[]),[N,$]=P.useState(0),[U,j]=P.useState([r]),{anchorRef:A,targetRef:D,anchorWidth:k}=yt({position:"bottom",enabled:E});qe(D,()=>R(!1));const W=dn(400),B=H=>{H.length>=a?c&&f&&W(async()=>{const _=await f(c,H);b(_),$(_.length>0?0:-1),R(!0)}):R(!1),g(H),w(e),l||u==null||u(H,e)},K=H=>{l?(g(""),w("")):(g(H.id),w(H.label)),u==null||u(H.id,H.label);const _=S.findIndex(p=>p.id===H.id);$(_),j([H.id]),R(!1)},z=H=>{H.key==="Escape"&&(R(!1),$(-1))},X=H=>{if((H.key==="ArrowDown"||H.key==="ArrowUp")&&(H.preventDefault(),E)){const _=H.key==="ArrowDown"?(N+1)%S.length:(N-1+S.length)%S.length;$(_)}switch(H.key){case"Enter":N>=0&&N<S.length?K(S[N]):l&&(u==null||u(m,""),R(!1),g(""),w(""));break;case"Escape":R(!1),$(-1);break}};return v.jsxs("div",{"data-component":"autocomplete",children:[v.jsx(vr,{...h,bindValue:m,optionalDisplayValue:x,displayMode:n,isEditable:i,shapeIcon:"magnify",placeholder:o,ref:A,onChange:B,onKeyDown:X,"aria-autocomplete":"list"}),E&&v.jsx(yr,{options:S,displayMode:s,onClick:K,ref:D,selectedIndex:N,activeIndex:d||U,width:k,showFilter:!1,onKeyDown:z})]})},Bt=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],Gt=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],xe=({label:r,onClick:e,ariaLabel:t,icon:n,disabled:s,sizing:a="base",variant:i="primary",appearance:o="raised",showIcon:c=!0,showText:l=!0,fullWidth:u=!1,loading:f=!1,justify:d="center",title:h,optionalDisplayValue:m})=>{const g={container:`smp-button smp-button-container ${a?`smp-button-${a}`:""} ${i?`smp-buttonVariant-${i}`:""} ${o?`smp-buttonType-${o}`:""} ${u?"smp-button-fullWidth":""} smp-justifyContent-${d}`};return v.jsx("button",{"data-component":"button",className:g.container,onClick:e,"aria-label":t,disabled:s,"aria-busy":f,title:h||r||m,children:f?v.jsx(le,{icon:"spinner",state:Gt(i),spin:!0}):v.jsxs(v.Fragment,{children:[n&&c&&v.jsx(le,{icon:n,disabled:s,state:Gt(i),width:Bt(a),height:Bt(a)}),l&&m&&v.jsx("span",{children:m})]})})},br=({options:r,fun:e,direction:t="row",disposition:n="start",sizing:s,variant:a,appearance:i,showText:o,showIcon:c,fullWidth:l,disabled:u,justify:f,onClick:d,onOptionsRequest:h})=>{const[m,g]=P.useState(r);P.useEffect(()=>{!m&&h&&e&&h(e,void 0).then(E=>g(E)).catch(E=>{console.error("Errore nel caricamento delle opzioni per ButtonList",E)})},[m,e,h]);const x={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${n}`},w=m==null?void 0:m.map((E,R)=>{const S={bindValue:E.id,optionalDisplayValue:E.label,fun:E.fun,icon:E.icon,variant:a,appearance:i,showText:o,showIcon:c,fullWidth:l,disabled:u,sizing:s,justify:f,onClick:()=>{d==null||d(E.id,E.fun)}};return v.jsx(xe,{...S},`button-${R}`)});return v.jsx("div",{role:"list","data-component":"button-list",className:x.container,children:w})},xr=({bindValue:r,_dataComponent:e="checkbox",disabled:t,label:n,isEditable:s=!0,onChange:a,onBlur:i})=>{const o=l=>{s&&a&&a(l.target.checked)},c={wrapper:"smp-checkbox-wrapper"};return v.jsxs("div",{className:c.wrapper,"data-component":e,children:[n&&v.jsx(je,{label:n,disabled:t}),v.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:o,onBlur:i})]})},pn={titleLarge:"h2",title:"h3",body:"h6",label:"label"},Ae=({variant:r="body",bindValue:e,color:t,...n})=>{const s=pn[r],a={container:`smp-typography ${r?`smp-typography-${r}`:""} ${n.disabled?"smp-typography-disabled":""}`};return v.jsx(s,{className:a.container,disabled:n.disabled,style:{"--smp-typography-color-base":t},children:e})},xt=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,c]=P.useState(null),l={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},u=h=>{n==null||n(r.filter((m,g)=>g!==h))},f=h=>{c(h)},d=h=>{if(o===null||o===h)return;const m=[...r],[g]=m.splice(o,1);m.splice(h,0,g),n==null||n(m),c(null)};return v.jsx("div",{className:l.container,role:"list","data-component":"chip",children:r.flatMap((h,m)=>{const g=ze(h.bindValue,h.optionalDisplayValue,t),x=v.jsxs("div",{className:l.element,role:"listitem",draggable:i,onDragStart:()=>f(m),onDragOver:E=>i&&E.preventDefault(),onDrop:()=>i&&d(m),style:{"--smp-chips-backgroundColor-base":a},children:[i&&v.jsx(le,{icon:"drag_indicator_horizontal",isInteractable:!0}),v.jsx(Ae,{variant:"label",bindValue:g,color:s}),e&&v.jsx(le,{icon:"close",isInteractable:!0,onClick:()=>u(m),color:s})]},`chip-${m}`),w=i&&m<r.length-1?v.jsx(le,{icon:"chevron-right",color:s},`separator-${m}`):null;return[x,w].filter(Boolean)})})};function Sr(r,e){const t=P.useRef(null);P.useEffect(()=>{if(!r)return;const n=typeof e=="object"&&e!==null&&"current"in e?e.current:null;if(!n)return;t.current=document.activeElement;const s=()=>n?Array.from(n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(l=>!l.hasAttribute("disabled")&&l.offsetParent!==null):[];(()=>{const l=s();l.length>0&&requestAnimationFrame(()=>l[0].focus())})();const i=l=>{if(l.key==="Escape"||l.key!=="Tab")return;const u=s();if(u.length===0)return;const f=u[0],d=u[u.length-1];l.shiftKey&&document.activeElement===f?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),f.focus())},o=l=>{if(n&&!n.contains(l.target)){l.preventDefault();const u=s();u.length>0&&u[0].focus()}};document.addEventListener("keydown",i),document.addEventListener("mousedown",o);const c=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",o),document.body.style.overflow=c,t.current&&requestAnimationFrame(()=>{var l;(l=t.current)==null||l.focus()})}},[r,e])}const wr=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,isEditable:s,displayMode:a,listDisplayMode:i="Both",fun:o,onOptionsRequest:c,multiActiveIndex:l,...u})=>{const[f,d]=P.useState(!1),[h,m]=P.useState(t),[g,x]=P.useState(-1),[w,E]=P.useState([r]),R=P.useId(),{anchorRef:S,targetRef:b,anchorWidth:N}=yt({position:"bottom",enabled:f});qe(b,()=>d(!1)),Sr(f,b);const $=D=>{e==null||e(D.id,D.label);const k=h.findIndex(W=>W.id===D.id);x(k),E([D.id]),d(!1)},U=D=>{D.key==="Escape"&&(d(!1),x(-1))},j=D=>{(D.key==="ArrowDown"||D.key==="ArrowUp")&&(D.preventDefault(),A())},A=()=>{o&&c&&c(o,void 0).then(D=>{m(D),x(D.length>0?0:-1),d(!0)})};return v.jsxs("div",{role:"combobox","aria-expanded":f,"aria-controls":R,"aria-owns":R,"data-component":"combobox",children:[v.jsx(vr,{...u,bindValue:r,optionalDisplayValue:n,displayMode:a,onShapeIconClick:A,onKeyDown:j,shapeIcon:"arrow_drop_down",rotatedShapeIcon:f,isEditable:s,ref:S,"aria-autocomplete":"list",variant:"notSelectable"}),f&&v.jsx(yr,{id:R,options:h,displayMode:i,ref:b,selectedIndex:g,activeIndex:l||w,width:N,onClick:$,onKeyDown:U})]})},q=r=>typeof r=="string",$e=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},qt=r=>r==null?"":""+r,hn=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},mn=/###/g,zt=r=>r&&r.indexOf("###")>-1?r.replace(mn,"."):r,Kt=r=>!r||q(r),Pe=(r,e,t)=>{const n=q(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(Kt(r))return{};const a=zt(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return Kt(r)?{}:{obj:r,k:zt(n[s])}},Jt=(r,e,t)=>{const{obj:n,k:s}=Pe(r,e,Object);if(n!==void 0||e.length===1){n[s]=t;return}let a=e[e.length-1],i=e.slice(0,e.length-1),o=Pe(r,i,Object);for(;o.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),o=Pe(r,i,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=t},gn=(r,e,t,n)=>{const{obj:s,k:a}=Pe(r,e,Object);s[a]=s[a]||[],s[a].push(t)},Je=(r,e)=>{const{obj:t,k:n}=Pe(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},yn=(r,e,t)=>{const n=Je(r,t);return n!==void 0?n:Je(e,t)},Er=(r,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?q(r[n])||r[n]instanceof String||q(e[n])||e[n]instanceof String?t&&(r[n]=e[n]):Er(r[n],e[n],t):r[n]=e[n]);return r},Te=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var vn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const bn=r=>q(r)?r.replace(/[&<>"'\/]/g,e=>vn[e]):r;class xn{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const Sn=[" ",",","?","!",";"],wn=new xn(20),En=(r,e,t)=>{e=e||"",t=t||"";const n=Sn.filter(i=>e.indexOf(i)<0&&t.indexOf(i)<0);if(n.length===0)return!0;const s=wn.getRegExp(`(${n.map(i=>i==="?"?"\\?":i).join("|")})`);let a=!s.test(r);if(!a){const i=r.indexOf(t);i>0&&!s.test(r.substring(0,i))&&(a=!0)}return a},ht=(r,e,t=".")=>{if(!r)return;if(r[e])return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0;const n=e.split(t);let s=r;for(let a=0;a<n.length;){if(!s||typeof s!="object")return;let i,o="";for(let c=a;c<n.length;++c)if(c!==a&&(o+=t),o+=n[c],i=s[o],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&c<n.length-1)continue;a+=c-a+1;break}s=i}return s},Le=r=>r==null?void 0:r.replace("_","-"),Tn={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,e){var t,n;(n=(t=console==null?void 0:console[r])==null?void 0:t.apply)==null||n.call(t,console,e)}};class Xe{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Tn,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,s){return s&&!this.debug?null:(q(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Xe(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Xe(this.logger,e)}}var me=new Xe;class Qe{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const s=this.observers[n].get(t)||0;this.observers[n].set(t,s+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s.apply(s,[e,...t])})}}class Xt extends Qe{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,s={}){var l,u;const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,i=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):q(n)&&a?o.push(...n.split(a)):o.push(n)));const c=Je(this.data,o);return!c&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),c||!i||!q(n)?c:ht((u=(l=this.data)==null?void 0:l[e])==null?void 0:u[t],n,a)}addResource(e,t,n,s,a={silent:!1}){const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let o=[e,t];n&&(o=o.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=e.split("."),s=t,t=o[1]),this.addNamespaces(t),Jt(this.data,o,s),a.silent||this.emit("added",e,t,n,s)}addResources(e,t,n,s={silent:!1}){for(const a in n)(q(n[a])||Array.isArray(n[a]))&&this.addResource(e,t,a,n[a],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,a,i={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),s=n,n=t,t=o[1]),this.addNamespaces(t);let c=Je(this.data,o)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?Er(c,n,a):c={...c,...n},Jt(this.data,o,c),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(s=>t[s]&&Object.keys(t[s]).length>0)}toJSON(){return this.data}}var Tr={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,n,s){return r.forEach(a=>{var i;e=((i=this.processors[a])==null?void 0:i.process(e,t,n,s))??e}),e}};const Zt={},Qt=r=>!q(r)&&typeof r!="boolean"&&typeof r!="number";class Ze extends Qe{constructor(e,t={}){super(),hn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=me.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(e==null)return!1;const s=this.resolve(e,n);return(s==null?void 0:s.res)!==void 0}extractFromKey(e,t){let n=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const s=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let a=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!En(e,n,s);if(i&&!o){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:q(a)?[a]:a};const l=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(l[0])>-1)&&(a=l.shift()),e=l.join(s)}return{key:e,namespaces:q(a)?[a]:a}}translate(e,t,n){let s=typeof t=="object"?{...t}:t;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(s={...s}),s||(s={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const a=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:o,namespaces:c}=this.extractFromKey(e[e.length-1],s),l=c[c.length-1];let u=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;u===void 0&&(u=":");const f=s.lng||this.language,d=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return d?a?{res:`${l}${u}${o}`,usedKey:o,exactUsedKey:o,usedLng:f,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:`${l}${u}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:f,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:o;const h=this.resolve(e,s);let m=h==null?void 0:h.res;const g=(h==null?void 0:h.usedKey)||o,x=(h==null?void 0:h.exactUsedKey)||o,w=["[object Number]","[object Function]","[object RegExp]"],E=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,R=!this.i18nFormat||this.i18nFormat.handleAsObject,S=s.count!==void 0&&!q(s.count),b=Ze.hasDefaultValue(s),N=S?this.pluralResolver.getSuffix(f,s.count,s):"",$=s.ordinal&&S?this.pluralResolver.getSuffix(f,s.count,{ordinal:!1}):"",U=S&&!s.ordinal&&s.count===0,j=U&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${N}`]||s[`defaultValue${$}`]||s.defaultValue;let A=m;R&&!m&&b&&(A=j);const D=Qt(A),k=Object.prototype.toString.apply(A);if(R&&A&&D&&w.indexOf(k)<0&&!(q(E)&&Array.isArray(A))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const W=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,A,{...s,ns:c}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(h.res=W,h.usedParams=this.getUsedParamsDetails(s),h):W}if(i){const W=Array.isArray(A),B=W?[]:{},K=W?x:g;for(const z in A)if(Object.prototype.hasOwnProperty.call(A,z)){const X=`${K}${i}${z}`;b&&!m?B[z]=this.translate(X,{...s,defaultValue:Qt(j)?j[z]:void 0,joinArrays:!1,ns:c}):B[z]=this.translate(X,{...s,joinArrays:!1,ns:c}),B[z]===X&&(B[z]=A[z])}m=B}}else if(R&&q(E)&&Array.isArray(m))m=m.join(E),m&&(m=this.extendTranslation(m,e,s,n));else{let W=!1,B=!1;!this.isValidLookup(m)&&b&&(W=!0,m=j),this.isValidLookup(m)||(B=!0,m=o);const z=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&B?void 0:m,X=b&&j!==m&&this.options.updateMissing;if(B||W||X){if(this.logger.log(X?"updateKey":"missingKey",f,l,o,X?j:m),i){const y=this.resolve(o,{...s,keySeparator:!1});y&&y.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let H=[];const _=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&_&&_[0])for(let y=0;y<_.length;y++)H.push(_[y]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(s.lng||this.language):H.push(s.lng||this.language);const p=(y,T,C)=>{var L;const O=b&&C!==m?C:z;this.options.missingKeyHandler?this.options.missingKeyHandler(y,l,T,O,X,s):(L=this.backendConnector)!=null&&L.saveMissing&&this.backendConnector.saveMissing(y,l,T,O,X,s),this.emit("missingKey",y,l,T,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&S?H.forEach(y=>{const T=this.pluralResolver.getSuffixes(y,s);U&&s[`defaultValue${this.options.pluralSeparator}zero`]&&T.indexOf(`${this.options.pluralSeparator}zero`)<0&&T.push(`${this.options.pluralSeparator}zero`),T.forEach(C=>{p([y],o+C,s[`defaultValue${C}`]||j)})}):p(H,o,j))}m=this.extendTranslation(m,e,s,h,n),B&&m===o&&this.options.appendNamespaceToMissingKey&&(m=`${l}${u}${o}`),(B||W)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${u}${o}`:o,W?m:void 0,s))}return a?(h.res=m,h.usedParams=this.getUsedParamsDetails(s),h):m}extendTranslation(e,t,n,s,a){var c,l;if((c=this.i18nFormat)!=null&&c.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const u=q(e)&&(((l=n==null?void 0:n.interpolation)==null?void 0:l.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(u){const h=e.match(this.interpolator.nestingRegexp);f=h&&h.length}let d=n.replace&&!q(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,n.lng||this.language||s.usedLng,n),u){const h=e.match(this.interpolator.nestingRegexp),m=h&&h.length;f<m&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...h)=>(a==null?void 0:a[0])===h[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${h[0]} in key: ${t[0]}`),null):this.translate(...h,t),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,o=q(i)?[i]:i;return e!=null&&(o!=null&&o.length)&&n.applyPostProcessor!==!1&&(e=Tr.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,s,a,i,o;return q(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(n))return;const l=this.extractFromKey(c,t),u=l.key;s=u;let f=l.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const d=t.count!==void 0&&!q(t.count),h=d&&!t.ordinal&&t.count===0,m=t.context!==void 0&&(q(t.context)||typeof t.context=="number")&&t.context!=="",g=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);f.forEach(x=>{var w,E;this.isValidLookup(n)||(o=x,!Zt[`${g[0]}-${x}`]&&((w=this.utils)!=null&&w.hasLoadedNamespace)&&!((E=this.utils)!=null&&E.hasLoadedNamespace(o))&&(Zt[`${g[0]}-${x}`]=!0,this.logger.warn(`key "${s}" for languages "${g.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach(R=>{var N;if(this.isValidLookup(n))return;i=R;const S=[u];if((N=this.i18nFormat)!=null&&N.addLookupKeys)this.i18nFormat.addLookupKeys(S,u,R,x,t);else{let $;d&&($=this.pluralResolver.getSuffix(R,t.count,t));const U=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(S.push(u+$),t.ordinal&&$.indexOf(j)===0&&S.push(u+$.replace(j,this.options.pluralSeparator)),h&&S.push(u+U)),m){const A=`${u}${this.options.contextSeparator}${t.context}`;S.push(A),d&&(S.push(A+$),t.ordinal&&$.indexOf(j)===0&&S.push(A+$.replace(j,this.options.pluralSeparator)),h&&S.push(A+U))}}let b;for(;b=S.pop();)this.isValidLookup(n)||(a=b,n=this.getResource(R,x,b,t))}))})}),{res:n,usedKey:s,exactUsedKey:a,usedLng:i,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,n,s={}){var a;return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!q(e.replace);let s=n?e.replace:e;if(n&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const a of t)delete s[a]}return s}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&e[n]!==void 0)return!0;return!1}}class er{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=me.create("languageUtils")}getScriptPartFromCode(e){if(e=Le(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=Le(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(q(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(n=>{if(t)return;const s=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(s))&&(t=s)}),!t&&this.options.supportedLngs&&e.forEach(n=>{if(t)return;const s=this.getScriptPartFromCode(n);if(this.isSupportedCode(s))return t=s;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return t=a;t=this.options.supportedLngs.find(i=>{if(i===a)return i;if(!(i.indexOf("-")<0&&a.indexOf("-")<0)&&(i.indexOf("-")>0&&a.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===a||i.indexOf(a)===0&&a.length>1))return i})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),q(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),s=[],a=i=>{i&&(this.isSupportedCode(i)?s.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return q(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):q(e)&&a(this.formatLanguageCode(e)),n.forEach(i=>{s.indexOf(i)<0&&a(this.formatLanguageCode(i))}),s}}const tr={zero:0,one:1,two:2,few:3,many:4,other:5},rr={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class On{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=me.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Le(e==="dev"?"en":e),s=t.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:s});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let i;try{i=new Intl.PluralRules(n,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),rr;if(!e.match(/-|_/))return rr;const c=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(c,t)}return this.pluralRulesCache[a]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(s=>`${t}${s}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((s,a)=>tr[s]-tr[a]).map(s=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,t,n={}){const s=this.getRule(e,n);return s?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const nr=(r,e,t,n=".",s=!0)=>{let a=yn(r,e,t);return!a&&s&&q(t)&&(a=ht(r,t,n),a===void 0&&(a=ht(e,t,n))),a},ct=r=>r.replace(/\$/g,"$$$$");class Rn{constructor(e={}){var t;this.logger=me.create("interpolator"),this.options=e,this.format=((t=e==null?void 0:e.interpolation)==null?void 0:t.format)||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:a,prefixEscaped:i,suffix:o,suffixEscaped:c,formatSeparator:l,unescapeSuffix:u,unescapePrefix:f,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:m,nestingSuffixEscaped:g,nestingOptionsSeparator:x,maxReplaces:w,alwaysFormat:E}=e.interpolation;this.escape=t!==void 0?t:bn,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?Te(a):i||"{{",this.suffix=o?Te(o):c||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?Te(d):h||Te("$t("),this.nestingSuffix=m?Te(m):g||Te(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=w||1e3,this.alwaysFormat=E!==void 0?E:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,n)=>(t==null?void 0:t.source)===n?(t.lastIndex=0,t):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,s){var h;let a,i,o;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=m=>{if(m.indexOf(this.formatSeparator)<0){const E=nr(t,c,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,n,{...s,...t,interpolationkey:m}):E}const g=m.split(this.formatSeparator),x=g.shift().trim(),w=g.join(this.formatSeparator).trim();return this.format(nr(t,c,x,this.options.keySeparator,this.options.ignoreJSONStructure),w,n,{...s,...t,interpolationkey:x})};this.resetRegExp();const u=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((h=s==null?void 0:s.interpolation)==null?void 0:h.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:m=>ct(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?ct(this.escape(m)):ct(m)}].forEach(m=>{for(o=0;a=m.regex.exec(e);){const g=a[1].trim();if(i=l(g),i===void 0)if(typeof u=="function"){const w=u(e,a,s);i=q(w)?w:""}else if(s&&Object.prototype.hasOwnProperty.call(s,g))i="";else if(f){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${e}`),i="";else!q(i)&&!this.useRawValueToEscape&&(i=qt(i));const x=m.safeValue(i);if(e=e.replace(a[0],x),f?(m.regex.lastIndex+=i.length,m.regex.lastIndex-=a[0].length):m.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let s,a,i;const o=(c,l)=>{const u=this.nestingOptionsSeparator;if(c.indexOf(u)<0)return c;const f=c.split(new RegExp(`${u}[ ]*{`));let d=`{${f[1]}`;c=f[0],d=this.interpolate(d,i);const h=d.match(/'/g),m=d.match(/"/g);(((h==null?void 0:h.length)??0)%2===0&&!m||m.length%2!==0)&&(d=d.replace(/'/g,'"'));try{i=JSON.parse(d),l&&(i={...l,...i})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,g),`${c}${u}${d}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,c};for(;s=this.nestingRegexp.exec(e);){let c=[];i={...n},i=i.replace&&!q(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let l=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const u=s[1].split(this.formatSeparator).map(f=>f.trim());s[1]=u.shift(),c=u,l=!0}if(a=t(o.call(this,s[1].trim(),i),i),a&&s[0]===e&&!q(a))return a;q(a)||(a=qt(a)),a||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),a=""),l&&(a=c.reduce((u,f)=>this.format(u,f,n.lng,{...n,interpolationkey:s[1].trim()}),a.trim())),e=e.replace(s[0],a),this.regexp.lastIndex=0}return e}}const jn=r=>{let e=r.toLowerCase().trim();const t={};if(r.indexOf("(")>-1){const n=r.split("(");e=n[0].toLowerCase().trim();const s=n[1].substring(0,n[1].length-1);e==="currency"&&s.indexOf(":")<0?t.currency||(t.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?t.range||(t.range=s.trim()):s.split(";").forEach(i=>{if(i){const[o,...c]=i.split(":"),l=c.join(":").trim().replace(/^'+|'+$/g,""),u=o.trim();t[u]||(t[u]=l),l==="false"&&(t[u]=!1),l==="true"&&(t[u]=!0),isNaN(l)||(t[u]=parseInt(l,10))}})}return{formatName:e,formatOptions:t}},sr=r=>{const e={};return(t,n,s)=>{let a=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(a={...a,[s.interpolationkey]:void 0});const i=n+JSON.stringify(a);let o=e[i];return o||(o=r(Le(n),s),e[i]=o),o(t)}},Dn=r=>(e,t,n)=>r(Le(t),n)(e);class Cn{constructor(e={}){this.logger=me.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?sr:Dn;this.formats={number:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a});return o=>i.format(o)}),currency:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a,style:"currency"});return o=>i.format(o)}),datetime:n((s,a)=>{const i=new Intl.DateTimeFormat(s,{...a});return o=>i.format(o)}),relativetime:n((s,a)=>{const i=new Intl.RelativeTimeFormat(s,{...a});return o=>i.format(o,a.range||"day")}),list:n((s,a)=>{const i=new Intl.ListFormat(s,{...a});return o=>i.format(o)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=sr(t)}format(e,t,n,s={}){const a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(o=>o.indexOf(")")>-1)){const o=a.findIndex(c=>c.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,o)].join(this.formatSeparator)}return a.reduce((o,c)=>{var f;const{formatName:l,formatOptions:u}=jn(c);if(this.formats[l]){let d=o;try{const h=((f=s==null?void 0:s.formatParams)==null?void 0:f[s.interpolationkey])||{},m=h.locale||h.lng||s.locale||s.lng||n;d=this.formats[l](o,m,{...u,...s,...h})}catch(h){this.logger.warn(h)}return d}else this.logger.warn(`there was no format function for ${l}`);return o},e)}}const $n=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class Pn extends Qe{constructor(e,t,n,s={}){var a,i;super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=me.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(i=(a=this.backend)==null?void 0:a.init)==null||i.call(a,n,s.backend,s)}queueLoad(e,t,n,s){const a={},i={},o={},c={};return e.forEach(l=>{let u=!0;t.forEach(f=>{const d=`${l}|${f}`;!n.reload&&this.store.hasResourceBundle(l,f)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?i[d]===void 0&&(i[d]=!0):(this.state[d]=1,u=!1,i[d]===void 0&&(i[d]=!0),a[d]===void 0&&(a[d]=!0),c[f]===void 0&&(c[f]=!0)))}),u||(o[l]=!0)}),(Object.keys(a).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(a),pending:Object.keys(i),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(c)}}loaded(e,t,n){const s=e.split("|"),a=s[0],i=s[1];t&&this.emit("failedLoading",a,i,t),!t&&n&&this.store.addResourceBundle(a,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const o={};this.queue.forEach(c=>{gn(c.loaded,[a],i),$n(c,e),t&&c.errors.push(t),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(l=>{o[l]||(o[l]={});const u=c.loaded[l];u.length&&u.forEach(f=>{o[l][f]===void 0&&(o[l][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(c=>!c.done)}read(e,t,n,s=0,a=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:a,callback:i});return}this.readingCalls++;const o=(l,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(l&&u&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,s+1,a*2,i)},a);return}i(l,u)},c=this.backend[n].bind(this.backend);if(c.length===2){try{const l=c(e,t);l&&typeof l.then=="function"?l.then(u=>o(null,u)).catch(o):o(null,l)}catch(l){o(l)}return}return c(e,t,o)}prepareLoading(e,t,n={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();q(e)&&(e=this.languageUtils.toResolveHierarchy(e)),q(t)&&(t=[t]);const a=this.queueLoad(e,t,n,s);if(!a.toLoad.length)return a.pending.length||s(),null;a.toLoad.forEach(i=>{this.loadOne(i)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),s=n[0],a=n[1];this.read(s,a,"read",void 0,void 0,(i,o)=>{i&&this.logger.warn(`${t}loading namespace ${a} for language ${s} failed`,i),!i&&o&&this.logger.log(`${t}loaded namespace ${a} for language ${s}`,o),this.loaded(e,i,o)})}saveMissing(e,t,n,s,a,i={},o=()=>{}){var c,l,u,f,d;if((l=(c=this.services)==null?void 0:c.utils)!=null&&l.hasLoadedNamespace&&!((f=(u=this.services)==null?void 0:u.utils)!=null&&f.hasLoadedNamespace(t))){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((d=this.backend)!=null&&d.create){const h={...i,isUpdate:a},m=this.backend.create.bind(this.backend);if(m.length<6)try{let g;m.length===5?g=m(e,t,n,s,h):g=m(e,t,n,s),g&&typeof g.then=="function"?g.then(x=>o(null,x)).catch(o):o(null,g)}catch(g){o(g)}else m(e,t,n,s,o,h)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const ar=()=>({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:r=>{let e={};if(typeof r[1]=="object"&&(e=r[1]),q(r[1])&&(e.defaultValue=r[1]),q(r[2])&&(e.tDescription=r[2]),typeof r[2]=="object"||typeof r[3]=="object"){const t=r[3]||r[2];Object.keys(t).forEach(n=>{e[n]=t[n]})}return e},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ir=r=>{var e,t;return q(r.ns)&&(r.ns=[r.ns]),q(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),q(r.fallbackNS)&&(r.fallbackNS=[r.fallbackNS]),((t=(e=r.supportedLngs)==null?void 0:e.indexOf)==null?void 0:t.call(e,"cimode"))<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),typeof r.initImmediate=="boolean"&&(r.initAsync=r.initImmediate),r},Ue=()=>{},An=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class _e extends Qe{constructor(e={},t){if(super(),this.options=ir(e),this.services={},this.logger=me,this.modules={external:[]},An(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(q(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=ar();this.options={...n,...this.options,...ir(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const s=l=>l?typeof l=="function"?new l:l:null;if(!this.options.isClone){this.modules.logger?me.init(s(this.modules.logger),this.options):me.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:l=Cn;const u=new er(this.options);this.store=new Xt(this.options.resources,this.options);const f=this.services;f.logger=me,f.resourceStore=this.store,f.languageUtils=u,f.pluralResolver=new On(u,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),l&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(f.formatter=s(l),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Rn(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Pn(s(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(d,...h)=>{this.emit(d,...h)}),this.modules.languageDetector&&(f.languageDetector=s(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=s(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new Ze(this.services,this.options),this.translator.on("*",(d,...h)=>{this.emit(d,...h)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Ue),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[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(l=>{this[l]=(...u)=>this.store[l](...u)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=(...u)=>(this.store[l](...u),this)});const o=$e(),c=()=>{const l=(u,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(f),t(u,f)};if(this.languages&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),o}loadResources(e,t=Ue){var a,i;let n=t;const s=q(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const o=[],c=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(f=>{f!=="cimode"&&o.indexOf(f)<0&&o.push(f)})};s?c(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>c(u)),(i=(a=this.options.preload)==null?void 0:a.forEach)==null||i.call(a,l=>c(l)),this.services.backendConnector.load(o,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(l)})}else n(null)}reloadResources(e,t,n){const s=$e();return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Ue),this.services.backendConnector.reload(e,t,a=>{s.resolve(),n(a)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Tr.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t<this.languages.length;t++){const n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=$e();this.emit("languageChanging",e);const s=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},a=(o,c)=>{c?this.isLanguageChangingTo===e&&(s(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,n.resolve((...l)=>this.t(...l)),t&&t(o,(...l)=>this.t(...l))},i=o=>{var u,f;!e&&!o&&this.services.languageDetector&&(o=[]);const c=q(o)?o:o&&o[0],l=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(q(o)?[o]:o);l&&(this.language||s(l),this.translator.language||this.translator.changeLanguage(l),(f=(u=this.services.languageDetector)==null?void 0:u.cacheUserLanguage)==null||f.call(u,l)),this.loadResources(l,d=>{a(d,l)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?i(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e),n}getFixedT(e,t,n){const s=(a,i,...o)=>{let c;typeof i!="object"?c=this.options.overloadTranslationOptionHandler([a,i].concat(o)):c={...i},c.lng=c.lng||s.lng,c.lngs=c.lngs||s.lngs,c.ns=c.ns||s.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||n||s.keyPrefix);const l=this.options.keySeparator||".";let u;return c.keyPrefix&&Array.isArray(a)?u=a.map(f=>`${c.keyPrefix}${l}${f}`):u=c.keyPrefix?`${c.keyPrefix}${l}${a}`:a,this.t(u,c)};return q(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=n,s}t(...e){var t;return(t=this.translator)==null?void 0:t.translate(...e)}exists(...e){var t;return(t=this.translator)==null?void 0:t.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const i=(o,c)=>{const l=this.services.backendConnector.state[`${o}|${c}`];return l===-1||l===0||l===2};if(t.precheck){const o=t.precheck(this,i);if(o!==void 0)return o}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(n,e)&&(!s||i(a,e)))}loadNamespaces(e,t){const n=$e();return this.options.ns?(q(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{n.resolve(),t&&t(s)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=$e();q(e)&&(e=[e]);const s=this.options.preload||[],a=e.filter(i=>s.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return a.length?(this.options.preload=s.concat(a),this.loadResources(i=>{n.resolve(),t&&t(i)}),n):(t&&t(),Promise.resolve())}dir(e){var s,a;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((a=this.services)==null?void 0:a.languageUtils)||new er(ar());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new _e(e,t)}cloneInstance(e={},t=Ue){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new _e(s);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(o=>{a[o]=this[o]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const o=Object.keys(this.store.data).reduce((c,l)=>(c[l]={...this.store.data[l]},c[l]=Object.keys(c[l]).reduce((u,f)=>(u[f]={...c[l][f]},u),c[l]),c),{});a.store=new Xt(o,s),a.services.resourceStore=a.store}return a.translator=new Ze(a.services,s),a.translator.on("*",(o,...c)=>{a.emit(o,...c)}),a.init(s,t),a.translator.options=s,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ae=_e.createInstance();ae.createInstance=_e.createInstance;ae.createInstance;ae.dir;ae.init;ae.loadResources;ae.reloadResources;ae.use;ae.changeLanguage;ae.getFixedT;ae.t;ae.exists;ae.setDefaultNamespace;ae.hasLoadedNamespace;ae.loadNamespaces;ae.loadLanguages;const Ln={Friday:"Venerdì",FridayShort:"Ven",Monday:"Lunedì",MondayShort:"Lun",Saturday:"Sabato",SaturdayShort:"Sab",Sunday:"Domenica",SundayShort:"Dom",Tuesday:"Martedì",TuesdayShort:"Mar",Thursday:"Giovedì",ThursdayShort:"Gio",Wednesday:"Mercoledì",WednesdayShort:"Mer"},_n={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},kn={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando"},In={Date:{NextDay:"Giorno Successivo",NextMonth:"Mese Successivo",NextWeek:"Settimana Successiva",NextYear:"Anno Successivo",PreviousDay:"Giorno Precedente",PreviousMonth:"Mese Precedente",PreviousWeek:"Settimana Precedente",PreviousYear:"Anno Precedente",Today:"Oggi",Tomorrow:"Domani",Yesterday:"Ieri"},Day:Ln,Month:_n,Generic:kn},Nn={Friday:"Friday",FridayShort:"Fri",Monday:"Monday",MondayShort:"Mon",Saturday:"Saturday",SaturdayShort:"Sat",Sunday:"Sunday",SundayShort:"Sun",Tuesday:"Tuesday",TuesdayShort:"Tue",Thursday:"Thursday",ThursdayShort:"Thu",Wednesday:"Wednesday",WednesdayShort:"Wed"},Mn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},Fn={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command"},Vn={Date:{NextDay:"Next Day",NextMonth:"Next Month",NextWeek:"Next Week",NextYear:"Next Year",PreviousDay:"Previous Day",PreviousMonth:"Previous Month",PreviousWeek:"Previous Week",PreviousYear:"Previous Year",Today:"Today",Tomorrow:"Tomorrow",Yesterday:"Yesterday"},Day:Nn,Month:Mn,Generic:Fn};function or(r,e){return new RegExp(Yn(r),e)}function Yn(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Un(r,e,t,n){let s=e;const a=Wn(r,t);if(!s){const o=Math.abs(a);o-Math.floor(o)?s="0,0.00":s="0,0"}const i=Hn(s);return new Intl.NumberFormat(n,i).format(a)}function Wn(r,e,t,n,s){let a=r;if(typeof a!="number"){let o;e&&n===void 0?o=",":o=".";const c=o=="."?",":".";a=a.replace(or(c,"g"),""),a=a.replace(or(o,"g"),"."),a=Number(a)}const i=Number(a);return isNaN(i)?NaN:i}function Hn(r){const e={};r.includes(",")?e.useGrouping=!0:e.useGrouping=!1;const t=r.indexOf(".");if(t>-1){const s=(r.substring(t+1).match(/0/g)||[]).length;e.minimumFractionDigits=s,e.maximumFractionDigits=s}else e.minimumFractionDigits=0,e.maximumFractionDigits=0;return e}ae.init({lng:typeof navigator<"u"&&navigator.language.split("-")[0]||"en",fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1,format:(r,e,t,n)=>{const s=(n==null?void 0:n.type)??"number";try{switch(s){case"date":{const a=r instanceof Date?r:new Date(r);return new Intl.DateTimeFormat(t,{dateStyle:e||"short"}).format(a)}default:case"number":{const a=(n==null?void 0:n.inputIsLocalized)??!1;return Un(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:Vn},it:{translation:In}}});const Bn=(r,e,t,n)=>ae.format(r,e,t||ae.language,n),Gn=(r,e)=>ae.t(r,e);function et(){const r=P.useCallback((n,s,a,i)=>Bn(n,s,a||void 0,i),[]),e=P.useCallback(()=>ae.languages[0],[]),t=P.useCallback((n,s)=>Gn(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var St=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r))(St||{}),oe=(r=>(r.MONDAY="Day.Monday",r.MONDAY_SHORT="Day.MondayShort",r.TUESDAY="Day.Tuesday",r.TUESDAY_SHORT="Day.TuesdayShort",r.WEDNESDAY="Day.Wednesday",r.WEDNESDAY_SHORT="Day.WednesdayShort",r.THURSDAY="Day.Thursday",r.THURSDAY_SHORT="Day.ThursdayShort",r.FRIDAY="Day.Friday",r.FRIDAY_SHORT="Day.FridayShort",r.SATURDAY="Day.Saturday",r.SATURDAY_SHORT="Day.SaturdayShort",r.SUNDAY="Day.Sunday",r.SUNDAY_SHORT="Day.SundayShort",r))(oe||{}),ue=(r=>(r.JANUARY="Month.January",r.FEBRUARY="Month.February",r.MARCH="Month.March",r.APRIL="Month.April",r.MAY="Month.May",r.JUNE="Month.June",r.JULY="Month.July",r.AUGUST="Month.August",r.SEPTEMBER="Month.September",r.OCTOBER="Month.October",r.NOVEMBER="Month.November",r.DECEMBER="Month.December",r))(ue||{}),mt=(r=>(r.PREVIOUS_DAY="Date.PreviousDay",r.PREVIOUS_WEEK="Date.PreviousWeek",r.PREVIOUS_MONTH="Date.PreviousMonth",r.PREVIOUS_YEAR="Date.PreviousYear",r.NEXT_DAY="Date.NextDay",r.NEXT_WEEK="Date.NextWeek",r.NEXT_MONTH="Date.NextMonth",r.NEXT_YEAR="Date.NextYear",r.YESTERDAY="Date.Yesterday",r.TODAY="Date.Today",r.TOMORROW="Date.Tomorrow",r))(mt||{});function qn({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=et(),i=()=>{if(!n)return;const _=new Date(n);return isNaN(_.getTime())?void 0:_},[o]=P.useState(new Date),[c,l]=P.useState(r||i()||new Date),[u,f]=P.useState(c?c.getMonth():new Date().getMonth()),[d,h]=P.useState(c?c.getFullYear():new Date().getFullYear()),[m,g]=P.useState(c?c.getDate():null),x=P.useRef(null),w=P.useRef([]),E=[a(ue.JANUARY),a(ue.FEBRUARY),a(ue.MARCH),a(ue.APRIL),a(ue.MAY),a(ue.JUNE),a(ue.JULY),a(ue.AUGUST),a(ue.SEPTEMBER),a(ue.OCTOBER),a(ue.NOVEMBER),a(ue.DECEMBER)],R=[{value:a(oe.SUNDAY_SHORT),full:a(oe.SUNDAY)},{value:a(oe.MONDAY_SHORT),full:a(oe.MONDAY)},{value:a(oe.TUESDAY_SHORT),full:a(oe.TUESDAY)},{value:a(oe.WEDNESDAY_SHORT),full:a(oe.WEDNESDAY)},{value:a(oe.THURSDAY_SHORT),full:a(oe.THURSDAY)},{value:a(oe.FRIDAY_SHORT),full:a(oe.FRIDAY)},{value:a(oe.SATURDAY_SHORT),full:a(oe.SATURDAY)}],S=_=>t.some(p=>{const y=p.start.getTime(),T=p.end.getTime(),C=_.getTime();return C>=y&&C<=T}),b=_=>{S(_)||(l(_),g(_.getDate()),e&&e(Yr(_)))},N=()=>{u===0?(f(11),h(d-1)):f(u-1),g(1)},$=()=>{u===11?(f(0),h(d+1)):f(u+1),g(1)},U=(_,p)=>new Date(_,p+1,0).getDate(),j=(_,p)=>new Date(_,p,1).getDay(),A=_=>{var y;const p=B.findIndex(T=>T!==null&&T.getDate()===_);p!==-1&&w.current[p]&&((y=w.current[p])==null||y.focus(),g(_))},D=(_,p)=>{const y=B[p];if(!y)return;const T=U(d,u),C=y.getDate();switch(_.key){case"ArrowRight":_.preventDefault();{let O=C+1,L=new Date(d,u,O);if(O>T){const F=u===11?d+1:d,V=u===11?0:u+1;O=1,L=new Date(F,V,O),$(),setTimeout(()=>{k(1,"forward")},0);return}S(L)?k(O,"forward"):A(O)}break;case"Tab":break;case"ArrowLeft":_.preventDefault();{let O=C-1,L=new Date(d,u,O);if(O<1){const F=u===0?d-1:d,V=u===0?11:u-1,M=U(F,V);O=M,L=new Date(F,V,O),N(),setTimeout(()=>{k(M,"backward")},0);return}S(L)?k(O,"backward"):A(O)}break;case"ArrowUp":_.preventDefault();{let O=C-7,L=new Date(d,u,O);if(O<1){const F=u===0?d-1:d,V=u===0?11:u-1;O=U(F,V)+O,L=new Date(F,V,O),N(),setTimeout(()=>{k(O,"backward")},0);return}S(L)?k(O,"backward"):A(O)}break;case"ArrowDown":_.preventDefault();{let O=C+7,L=new Date(d,u,O);if(O>T){const F=u===11?d+1:d,V=u===11?0:u+1;O=O-T,L=new Date(F,V,O),$(),setTimeout(()=>{k(O,"forward")},0);return}S(L)?k(O,"forward"):A(O)}break;case"Home":_.preventDefault(),k(1,"forward");break;case"End":_.preventDefault(),k(T,"backward");break;case"PageUp":_.preventDefault(),N(),setTimeout(()=>{const O=U(u===0?d-1:d,u===0?11:u-1),L=Math.min(C,O);k(L,"forward")},0);break;case"PageDown":_.preventDefault(),$(),setTimeout(()=>{const O=U(u===11?d+1:d,u===11?0:u+1),L=Math.min(C,O);k(L,"forward")},0);break;case" ":case"Space":if(S(y))return;g(y.getDate()),l(y);break;case"Enter":_.preventDefault(),b(y);break}},k=(_,p)=>{const y=U(d,u);if(p==="forward"){for(let T=_;T<=y;T++){const C=new Date(d,u,T);if(!S(C)){A(T);return}}$(),setTimeout(()=>{k(1,"forward")},0)}else{for(let L=_;L>=1;L--){const F=new Date(d,u,L);if(!S(F)){A(L);return}}const T=u===0?d-1:d,C=u===0?11:u-1,O=U(T,C);N(),setTimeout(()=>{k(O,"backward")},0)}},B=(()=>{const _=U(d,u),p=j(d,u),y=[];for(let T=0;T<p;T++)y.push(null);for(let T=1;T<=_;T++){const C=new Date(d,u,T);y.push(C)}return y})(),K=[];let z=[];B.forEach((_,p)=>{if(z.push(_),z.length===7||p===B.length-1){for(;z.length<7;)z.push(null);K.push(z),z=[]}}),P.useEffect(()=>{var _;if(m!==null){const p=B.findIndex(y=>y!==null&&y.getDate()===m);p!==-1&&w.current[p]&&((_=w.current[p])==null||_.focus())}},[u,d,m,B]);const X={label:"smp-datepickercalendar-label",wrapper:"smp-datepickercalendar",calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(_,p,y,T)=>`smp-datepickercalendar-td
46
46
  ${_?"smp-datepickercalendar-td-today":""}
47
47
  ${p?"smp-datepickercalendar-td-selected":""}
48
48
  ${y?"smp-datepickercalendar-td-focused":""}
49
- ${T?"smp-datepickercalendar-td-disabled":""}`},B=()=>`${E[f]} ${d.toString()}`;return v.jsxs("div",{className:Z.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[v.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[v.jsx(xe,{onClick:N,ariaLabel:a(mt.PREVIOUS_MONTH),bindValue:"<",appearance:"ghost",variant:"base"}),v.jsx("div",{"aria-label":B(),className:Z.label,children:B()}),v.jsx(xe,{onClick:$,ariaLabel:a(mt.NEXT_MONTH),bindValue:">",appearance:"ghost",variant:"base"})]}),v.jsxs("table",{ref:x,role:"grid","aria-label":`${a(St.CALENDAR_FOR)} ${E[f]} ${d}`,className:Z.table,children:[v.jsx("thead",{children:v.jsx("tr",{children:j.map(_=>v.jsx("th",{scope:"col",abbr:_.full,className:Z.th,children:_.value},_.value))})}),v.jsx("tbody",{children:X.map((_,p)=>v.jsx("tr",{children:_.map((y,T)=>{const C=p*7+T;if(y===null)return v.jsx("td",{className:Z.td(!1,!1,!1,!0)},`empty-${T}`);const O=y.getDate()===o.getDate()&&y.getMonth()===o.getMonth()&&y.getFullYear()===o.getFullYear(),L=c&&y.getDate()===c.getDate()&&y.getMonth()===c.getMonth()&&y.getFullYear()===c.getFullYear(),F=h===y.getDate(),V=S(y);return v.jsx("td",{role:"gridcell","aria-selected":L,tabIndex:F?0:-1,onClick:()=>b(y),onKeyDown:M=>D(M,C),"aria-label":`${y.getDate()} ${E[y.getMonth()]} ${y.getFullYear()}`,"data-selected":L,"aria-disabled":V,ref:M=>{w.current[C]=M},className:Z.td(O,L,F,V),children:y.getDate()},`day-${T}`)})},`week-${p}`))})]})]})}const Tr=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,isEditable:s=!0,...a})=>{const[i,o]=A.useState(!1),[c,l]=A.useState(r||""),[f,u]=A.useState(""),{anchorRef:d,targetRef:m}=yt({position:"bottom",enabled:i});qe(m,()=>{o(!1)}),qe(d,()=>{if(typeof d=="object"&&d!==null&&"current"in d){const $=d.current.querySelector("input");$&&$===document.activeElement&&E()}}),xr(i,m);const{format:h,getCurrentLanguage:g}=et(),x=A.useCallback($=>{const W=$.length>5&&Nr($,g())||$,R=h(W,void 0,void 0,{type:"date"}),P=typeof W!="string",D=P&&W.toISOString().substring(0,10)||"";return{isValid:P,formattedDate:R,isoDate:D,normalizedDate:W}},[g,h]);A.useEffect(()=>{const{formattedDate:$,isoDate:W,isValid:R}=x(r);l(R&&W||r),u(R&&$||r)},[r,h,x]);const w=()=>o($=>!$),E=()=>{S(f)},j=$=>{S($),o(!1)},S=$=>{const{isoDate:W,isValid:R}=x($);t&&t(R&&W||$)},b=$=>{u($)},N=$=>{$.key==="Enter"&&($.preventDefault(),S(f))};return v.jsxs("div",{"data-component":"date-picker",children:[v.jsx(we,{bindValue:f,placeholder:e,onBlur:E,onChange:b,onKeyDown:N,shapeIcon:"calendar",onShapeIconClick:w,ref:d,isEditable:s,...a}),i&&v.jsx(qn,{disabledDateRanges:n,onDateChange:j,initialValue:gt(c)&&c||"",targetRef:m})]})},zn=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,isEditable:s=!0,placeholder:a,label:i,disabled:o,fun:c,onOptionsRequest:l,onChange:f})=>{const u=r.map(h=>h.bindValue),d=(h,g)=>{const x=[...r];if(h=="")x.pop();else{const w=x.findIndex(E=>E.bindValue===h&&E.optionalDisplayValue===g);w>=0?x.splice(w,1):x.push({bindValue:h,optionalDisplayValue:g})}f==null||f(x)},m={container:"smp-multipleAutocomplete-container"};return v.jsxs("div",{className:m.container,"data-component":"multiple-autocomplete",children:[i&&v.jsx(_e,{label:i,disabled:o}),v.jsx(xt,{elements:r,displayMode:e,isEditable:s,onChange:h=>{f==null||f(h)}}),v.jsx(bt,{bindValue:"",fun:c,isEditable:s,onChange:d,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:a,onOptionsRequest:l,_multiActiveIndex:u})]})},Or=({...r})=>{const[e,t]=A.useState(!1),n=e?"visibility-off":"visibility";return v.jsx(we,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},Kn=({...r})=>{const[e,t]=A.useState(r.bindValue),{translate:n}=et(),s=a=>{var i;a.key==="Enter"&&(a.preventDefault(),(i=r.onEnter)==null||i.call(r,e))};return v.jsx(we,{...r,placeholder:r.placeholder?r.placeholder:n(St.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})},Jn=({bindValue:r,optionalDisplayValue:e,label:t})=>{const n={wrapper:"smp-text-wrapper"};return t?v.jsxs("div",{className:n.wrapper,children:[v.jsx(_e,{label:t}),v.jsx(Pe,{variant:"body",bindValue:e||r})]}):v.jsx(Pe,{variant:"body",bindValue:e||r})};class Se{constructor(e,t){ve(this,"class");ve(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Se(e,e.k.split(";"))}static fromString(e){return new Se({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const We=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t??r.decode,shape:r.shape,fun:r.fun}),lr=r=>{const e=Se.fromDataObj(r.obj),t=r.decode?Se.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},Xn=(r,e)=>{const t=new Se(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new Se(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return We(r,t,n)},wt=({decode:r,shape:e,obj:t,data:n,icon:s,fun:a,placeholderIcon:i,label:o,options:c,onChange:l,onClick:f,onEnter:u,onBlur:d,onOptionsRequest:m,isEditable:h})=>{const g={obj:t,shape:e,decode:r,icon:s,fun:a},x={onBlur:d,onOptionsRequest:m,fun:a,icon:s,label:o,isEditable:h,...n},w=(S,b,N)=>kr(t)?We(S,new Ge(t,b).getLegacyValue()):We(S,b,N),E=S=>We(g,new He(t,S).getLegacyValue()),j=S=>Xn(g,S);switch(e){case se.AUTOCOMPLETE:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(b,N)=>{l==null||l(w(g,b,N))}};return v.jsx(bt,{...S})}case se.BUTTON:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onClick:()=>{f==null||f(w(g,t.k))}};return v.jsx(xe,{...S})}case se.BUTTON_LIST:{const S={...x,options:c,onClick:(b,N)=>{const $={...g,fun:N};f==null||f(w($,b))}};return v.jsx(vr,{...S})}case se.COMBOBOX:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(b,N)=>{l==null||l(w(g,b,N))}};return v.jsx(Sr,{...S})}case se.CHECKBOX:{const S={...x,bindValue:He.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:b=>{l==null||l(E(b))}};return v.jsx(br,{...S})}case se.CHIP:{const S={...x,elements:lr(g)};return v.jsx(xt,{...S})}case se.DATE:{const S={...x,bindValue:Ge.fromDataObj(t).getValue(),onChange:b=>{l==null||l(w(g,b))}};return v.jsx(Tr,{...S})}case se.ICON:case se.IMAGE:{const S={...x,icon:s,placeholderIcon:i,isInteractable:!!x.fun,onClick:()=>{f==null||f(w(g,t.k))}};return v.jsx(le,{...S})}case se.MULTI_AUTOCOMPLETE:{const S={...x,elements:lr(g),onChange:b=>{l==null||l(j(b))}};return v.jsx(zn,{...S})}case se.PASSWORD:{const S={...x,bindValue:t.k,onChange:b=>{l==null||l(w(g,b))}};return v.jsx(Or,{...S})}case se.SPOTLIGHT:{const S={...x,bindValue:t.k,onEnter:b=>{u==null||u(w(g,b))}};return v.jsx(Kn,{...S})}case se.TEXT_FIELD:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:b=>{l==null||l(w(g,b))}};return v.jsx(we,{...S})}default:{const S={...x,bindValue:t.k,optionalDisplayValue:r};return v.jsx(Jn,{...S})}}},Zn=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},Rr=(r,e)=>r.map(t=>{var a,i;if((a=t.sections)!=null&&a.length)return{...t,sections:Rr(t.sections,e),content:t.content};let n=t.sections,s=t.content;return(i=t.content)!=null&&i.length&&t.columns&&+t.columns>1&&(n=Zn(t.content.filter(c=>!!e[c.id]),+t.columns).map((c,l)=>({...t,id:`${t.id}-${l}`,content:c,gridCols:t.columns,horizontal:!0})),s=[]),{...t,sections:n,content:s}}),cr=(r,e)=>{if(!e)return{};const t=r.some(n=>n.dim)?r.map(n=>n.dim||"auto").join(" "):`repeat(${r.length}, 1fr)`;return{[e]:t}},ur=r=>r.some(e=>e.dim&&!e.dim.endsWith("%")),de={"smp-layout":"_smp-layout_xrjwg_1","smp-layout-horizontal":"_smp-layout-horizontal_xrjwg_9","smp-layout-vertical":"_smp-layout-vertical_xrjwg_13","smp-layout-section-grid":"_smp-layout-section-grid_xrjwg_18","smp-layout-section-vertical":"_smp-layout-section-vertical_xrjwg_20","smp-layout-section-horizontal":"_smp-layout-section-horizontal_xrjwg_24","smp-layout-section-flex":"_smp-layout-section-flex_xrjwg_29","smp-layout-cell-container":"_smp-layout-cell-container_xrjwg_34","smp-grid-template-cols":"_smp-grid-template-cols_xrjwg_44","smp-grid-template-rows":"_smp-grid-template-rows_xrjwg_48","smp-layout-section-with-title":"_smp-layout-section-with-title_xrjwg_52","smp-layout-section-title":"_smp-layout-section-title_xrjwg_58"},Et=({layout:r,cells:e})=>{var u;if(!((u=r.sections)!=null&&u.length))return v.jsx(v.Fragment,{});const t="--smp-grid-template-cols",n="--smp-grid-template-rows",s=Rr(r.sections,e),a=d=>d==null?void 0:d.reduce((m,h)=>{var j,S;let g="",x={},w={},E="";return(j=h.sections)!=null&&j.length?(g=de["smp-layout-section-grid"],x=a(h.sections),h.gridCols==null&&(E=`${de[h.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"]}`,(h.horizontal||ur(h.sections))&&(w=cr(h.sections,h.horizontal?t:n)))):(S=h.content)!=null&&S.length&&(h.gridCols!==void 0&&h.gridCols>0?(g=de["smp-layout-section-grid"],E=`${de["smp-grid-template-cols"]}`,w={[t]:`repeat(${h.gridCols}, 1fr)`}):g=de["smp-layout-section-flex"]),{...m,...x,[h.id]:{classes:`${g} ${de[h.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${E} ${h.justify?`smp-justifyContent-${h.justify}`:""} ${h.align?`smp-alignItems-${h.align}`:""}`,styles:w}}},{}),i=a(s),o={container:`${de["smp-layout"]} ${r.horizontal?de["smp-layout-horizontal"]:de["smp-layout-vertical"]}`,sections:i},c=r.horizontal||ur(r.sections)?cr(s,r.horizontal?t:n):{},l=d=>{var h;const m=v.jsx("div",{"smp-id":"section-"+d.id,className:o.sections[d.id].classes,style:o.sections[d.id].styles,children:(h=d.sections)!=null&&h.length?d.sections.map(g=>l(g)):d.content.map(g=>f(g,e[g.id],d.justify,d.align))},"section-"+d.id);return d.title?v.jsxs("div",{className:`${de["smp-layout-section-with-title"]}`,children:[v.jsx("span",{className:`${de["smp-layout-section-title"]} ${d.justify?`smp-justifyContent-${d.justify}`:""} ${d.align?`smp-alignItems-${d.align}`:""}`,children:v.jsx(_e,{label:d.title})}),m]}):m},f=(d,m,h,g)=>{const x=d.colSpan!==void 0?d.colSpan>0?d.colSpan:d.colStart!==void 0&&d.colStart<1?1:null:null,w=x!==null?`span ${x}`:d.colStart,E=d.colEnd!==void 0&&d.colEnd>0?d.colEnd:"",j={gridColumnStart:w,gridColumnEnd:E},S=`${de["smp-layout-cell-container"]} ${h?`smp-justifyContent-${h}`:""} ${g?`smp-alignItems-${g}`:""}`;return m?v.jsx("div",{className:S,style:{...j},"smp-id":d.id,children:v.jsx(wt,{...m})},d.id):v.jsx(v.Fragment,{})};return v.jsx("div",{className:o.container,style:c,"smp-id":"layout",children:s==null?void 0:s.map(d=>l(d))})},Qn=({data:r,onClick:e,onEnter:t})=>{var i,o;const[n,s]=A.useState(),a=A.useCallback(c=>{var f,u;if(!((f=c.rows)!=null&&f.length)||!((u=c.columns)!=null&&u.length))return{};const l=c.rows[0];return c.columns.filter(d=>d.visible).reduce((d,m)=>{const h=l.cells[m.name],g={...h,onChange:x=>{s(w=>w&&{...w,[m.name]:{...w[m.name],obj:{...w[m.name].obj,k:x.obj.k}}})},onClick:()=>{h.fun&&e&&e({...h})},onEnter:x=>{t&&t(x)}};return{...d,[m.name]:g}},{})},[e,t]);return A.useEffect(()=>{r&&s(a(r))},[r,a]),!((i=r==null?void 0:r.rows)!=null&&i.length)||!((o=r.columns)!=null&&o.length)?null:n&&v.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:v.jsx(Et,{layout:r.rows[0].layout,cells:n})})},es=r=>{var e;return(e=r.children)!=null&&e.length?r.children.map(t=>{var n,s;return{id:((n=t.obj)==null?void 0:n.k)??"",label:t.decode??t.value??((s=t.obj)==null?void 0:s.k)??"",fun:t.fun,icon:t.icon}}):[]},ce=r=>r==null?!1:typeof r=="string"?r.toLocaleLowerCase()=="yes":r,ts=({data:r,logo:e,open:t,minifiedOnClose:n=!0,customHeight:s="100vh",onClick:a,onEnter:i,onClose:o,loadOptions:c})=>{var j,S;const[l,f]=A.useState(),[u,d]=A.useState(t??!0),m=A.useRef(null),h=s.trim()?s:"100vh",g=A.useCallback(b=>{var $,W;if(!(($=b==null?void 0:b.rows)!=null&&$.length)||!((W=b==null?void 0:b.columns)!=null&&W.length))return{};const N=b.rows[0];return b.columns.filter(R=>R.visible??!0).reduce((R,P)=>{const D=N.cells[P.name];if(!D||!u&&ce(n)&&D.shape!==se.BUTTON&&D.shape!==se.BUTTON_LIST)return R;const I={...D,onChange:U=>{f(H=>{const X={...H};return X!=null&&X[P.name]&&(X[P.name].obj.k=U.obj.k),X})},onClick:U=>{U.fun&&a&&a(U)},onEnter:U=>{i&&i(U)}};return c&&D.shape==se.BUTTON_LIST&&(I.onOptionsRequest=(U,H)=>c(U,H).then(X=>es(X))),!u&&ce(n)&&(I.data={...I.data,showText:!1,justify:"center"}),{...R,[P.name]:I}},{})},[u,n,a,i,c]),x=A.useCallback(()=>{o==null||o()},[o]),w=()=>{ce(n)?d(b=>!b):(d(!1),o==null||o())};if(A.useEffect(()=>{f(g(r))},[r]),A.useEffect(()=>{if(!m.current)return;if(!ce(n)){f(g(r));return}const b=getComputedStyle(m.current).getPropertyValue("--smp-drawer-slide-transition");let N=Number(b);b.endsWith("ms")?N=parseFloat(b):b.endsWith("s")&&(N=parseFloat(b)*1e3),setTimeout(()=>{f(g(r))},N/2)},[u,n]),A.useEffect(()=>{t!==void 0&&!ce(n)&&d(t)},[n,t]),!((j=r==null?void 0:r.rows)!=null&&j.length)||!((S=r.columns)!=null&&S.length))return null;const E={drawer:`smp-drawer ${ce(n)?"smp-drawer-minified":"smp-drawer-fixed"} ${u?"smp-drawer-open":""} ${!ce(n)&&!u?"smp-drawer-no-border":""}`,container:"smp-drawer-container",containerHeader:"smp-drawer-container-header",containerIcon:`${u?"":"smp-drawer-container-icon-close"} smp-drawer-container-icon`,containerLayout:"smp-drawer-container-layout",containerLogo:"smp-drawer-container-logo",backdrop:`smp-drawer-backdrop ${u?"smp-drawer-backdrop-open":""}`};return l&&v.jsxs(v.Fragment,{children:[!ce(n)&&v.jsx("div",{"aria-hidden":"true","aria-label":"drawer-backdrop",className:E.backdrop,onClick:x}),v.jsx("aside",{ref:m,className:E.drawer,style:{height:h},"aria-label":"Drawer","smp-id":"drawer",children:v.jsxs("div",{className:E.container,children:[v.jsxs("div",{className:E.containerHeader,children:[e&&v.jsx("div",{className:E.containerLogo,children:v.jsx(le,{icon:e,title:"drawer_logo",width:"100%",height:24})}),v.jsx("div",{className:E.containerIcon,children:v.jsx(le,{icon:ce(n)?"menu_close":"close",title:"drawer_icon",rotated:!u,isInteractable:!0,onClick:w,width:20,height:20})})]}),v.jsx("div",{className:E.containerLayout,children:v.jsx(Et,{layout:r.rows[0].layout,cells:l})})]})})]})},rs=({ColumnsNumber:r=1,data:e={},ForceText:t,TextColName:n,TextColor:s="var(--smp-dashList-color-base)",Fillspace:a,FontSize:i,Horizontal:o,ForceIcon:c,IconColName:l,IconColor:f="var(--smp-dashList-color-base)",NumberFormat:u,ForceUM:d,UmColName:m,UmColor:h="var(--smp-dashList-color-base)",ForceValue:g,ValueColName:x,ValueColor:w="var(--smp-dashList-color-base)",SelectLayout:E="1",onClick:j})=>{const S="N/A",b=(e==null?void 0:e.columns)||[],N=(e==null?void 0:e.rows)||[],$=N.length>0,W="--smp-dashList-color",R="smp-layout",P="descr",D="icon",I="um",U="value",H=i||"1em",X="18px",z="--smp-dashList-columns",Z="--smp-dashList-fontSize",B={dash:(Y="1")=>{const J=p(Y),te=J,re=y(J,P),fe=y(J,D),ge=y(J,I),pe=y(J,U);return{container:te,descr:re,icon:fe,um:ge,value:pe}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
50
- ${ce(o)?"smp-dash-list-horizontal":""}`},{format:_}=et(),p=Y=>`${R}-${Y}`,y=(Y,J)=>`${Y}__${J}`,T=Y=>`${W}-${Y}`,C=Y=>{const J=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(J.test(Y)){const re=Y.match(J)||[];if((re==null?void 0:re.length)>3)return"rgb("+re[1]+","+re[2]+","+re[3]+")"}return Y},O=Y=>{if(!u)return Y;const[J,te]=L(u).map(Ee=>parseInt(Ee||"0")),re="0,0"+(te?"."+"0".repeat(te):""),fe=_(Y,re,"it");if(!J)return fe;const[ge,pe]=fe.split(",");return ge+(pe?`,${pe}`:"")},L=Y=>Y.includes(";")?Y.split(";"):[Y],F=Y=>{const J=re=>{var fe;if(re)return(fe=Y==null?void 0:Y.cells[re])==null?void 0:fe.obj.k},te=re=>{var fe,ge;if(!(b.length<=re))return(ge=(fe=Y==null?void 0:Y.cells[b[re].name])==null?void 0:fe.obj)==null?void 0:ge.k};return{descr:t||J(n)||te(2)||"",icon:c||J(l)||te(3)||"",um:d||J(m)||te(1)||"",value:g||J(x)||te(0)||""}},V=Y=>{j==null||j(Y)},M=(Y,J)=>{(Y.key==="Enter"||Y.key===" ")&&(Y.preventDefault(),Y.stopPropagation(),V(J))},G=(Y=>{const J=B.dash(Y);return{className:J,descr:te=>v.jsx("div",{className:J.descr,children:te},`${Y}-${P}`),icon:te=>v.jsx("div",{className:J.icon,children:v.jsx(le,{color:f,height:X,icon:te,width:X})},`${Y}-${D}`),um:te=>v.jsx("div",{className:J.um,children:te},`${Y}-${I}`),value:te=>v.jsx("div",{className:J.value,children:te},`${Y}-${U}`)}})(E),ne=Y=>{const{descr:J,icon:te,um:re,value:fe}=F(Y),ge={[T(P)]:C(s),[T(I)]:C(h),[T(U)]:C(w)},pe=[],Ee=O(fe);switch(E){case"2":te&&pe.push(G.icon(te)),pe.push(G.descr(J)),pe.push(G.value(re?Ee+" "+re:Ee));break;default:case"1":pe.push(G.descr(J)),pe.push(G.value(re?Ee+" "+re:Ee))}return v.jsx("div",{className:G.className.container,role:"button",style:ge,tabIndex:0,onClick:()=>V(Y),onKeyDown:Dr=>M(Dr,Y),children:pe},Y.rowId)},k={[z]:String(r),[Z]:H};return v.jsx("div",{className:B.dashList,style:k,children:$?N.map(Y=>ne(Y)):S})},ut={"smp-table":"_smp-table_8dmh0_1","smp-headerCell":"_smp-headerCell_8dmh0_35","smp-resizer":"_smp-resizer_8dmh0_44"},ns="_rowContent_gazwe_13",ss="_clickable_gazwe_42",as="_indent_gazwe_47",is="_toggle_gazwe_53",os="_rowLabel_gazwe_69",ls="_cell_gazwe_78",cs="_leftSection_gazwe_86",be={rowContent:ns,clickable:ss,indent:as,toggle:is,rowLabel:os,cell:ls,leftSection:cs};function Be(r){return!!r&&"children"in r}function us(r){return!Be(r)}function fs(r){return JSON.stringify(r).split("").reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0).toString()}const jr=({row:r,columnWidths:e={},level:t=0,rowHeight:n=26,offsetTop:s})=>{var E;const[a,i]=A.useState(!1),o=Be(r)&&!!((E=r.children)!=null&&E.length),c=r.cells&&Object.keys(r.cells).length>0,l=o,f=t*20,u=()=>{o&&i(!a)},d={content:`${be.rowContent} ${o?be.clickable:""}`,toggle:`${be.toggle}`,indent:`${be.indent}`,cell:`${be.cell}`},m=j=>v.jsx(wt,{...j}),h=()=>v.jsx("span",{className:d.toggle,children:l?a?"▶":"▼":" "}),g=()=>v.jsx("span",{className:d.indent,style:{width:`${f}px`},"aria-hidden":"true"}),x=()=>{const j=us(r)?"":r.decode||(c?"":"Untitled"),S=s??n*t;return v.jsxs("tr",{className:d.content,onClick:u,role:o?"button":"row","aria-expanded":o?!a:void 0,style:{height:`${n}px`,lineHeight:`calc(${n}px - 2*2px)`,transform:`translateY(${S}px)`},children:[Be(r)&&v.jsxs("td",{className:be.leftSection,style:{height:`${n}px`},children:[g(),h(),v.jsx("span",{className:be.rowLabel,children:j})]}),r.cells&&Object.keys(r.cells).length>0&&Object.entries(r.cells).map(([b,N])=>v.jsx("td",{className:d.cell,style:{width:e[b],minWidth:e[b],height:`${n}px`},children:m(N)},fs(N)||b))]})},w=()=>{var j;return a||!o?null:v.jsx(v.Fragment,{children:Be(r)&&((j=r.children)==null?void 0:j.map((S,b)=>v.jsx(jr,{row:S,level:t+1},`child-${b}`)))})};return v.jsxs(v.Fragment,{children:[x(),w()]})},ds=({label:r,rowHeight:e=28,offsetTop:t=0,level:n=0,onClick:s,isExpanded:a})=>{const i={tr:"smp-groupRow-tr",td:"smp-groupRow-td"};return v.jsx("tr",{className:i.tr,style:{height:e,top:t,lineHeight:`${e}px`},onClick:s,children:v.jsxs("td",{className:i.td,style:{paddingLeft:10+n*20},children:[v.jsx(le,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),v.jsx(Pe,{variant:"title",bindValue:r})]})})};function ps(r,e){const t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t}function hs(r,e){return r.map(t=>{const n=e.find(s=>s.column===t.bindValue);return{column:t.bindValue,visible:(n==null?void 0:n.visible)??!0}})}function ms(r,e,t,n){const s=[];let a=0;return i(r,0,[]),{flatRows:s,offset:a};function i(u,d,m){if(d>=e.length){f(u);return}const h=e[d].column,g=o(u,h);for(const[x,w]of g){const E=[...m,x],j=c(E,d),S=n.has(j);s.push(l(x,j,d,S)),a+=t,S&&i(w,d+1,E)}}function o(u,d){var h;const m=new Map;for(const g of u){const x=((h=g.cells[d])==null?void 0:h.decode)??"N/D";m.has(x)||m.set(x,[]),m.get(x).push(g)}return m}function c(u,d){return`group-${u.join("-")}-${d}`}function l(u,d,m,h){return{isGroup:!0,value:u,cells:{},rowId:d,level:m,isExpanded:h}}function f(u){for(const d of u)s.push(d),a+=t}}const gs=({groups:r=[],isDraggable:e=!0,isEditable:t=!0,onChange:n,onDrop:s,onDragOver:a})=>{const i=r.map(o=>({bindValue:o.column}));return v.jsxs("div",{className:"smp-groupBar-container",onDragOver:a,onDrop:s,children:[v.jsx(le,{icon:"groups"}),v.jsx(xt,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:n})]})},ys=({data:r,lineHeight:e=28,TableHeight:t=400,groups:n,columnSizingMode:s="fixed",showGroupBar:a=!0})=>{var W;const[i,o]=A.useState(r),[c,l]=A.useState(n||[]),[f,u]=A.useState(new Set),d=i&&i.columns?Object.fromEntries(i.columns.map(R=>[R.name,120])):{},[m,h]=A.useState(d),g=A.useRef(null);A.useEffect(()=>{var D;if(!i||!i.columns||i.columns.length)return;const R=((D=g.current)==null?void 0:D.clientWidth)??1e3;let P={};switch(s){case"fixed":P=Object.fromEntries(i.columns.map(I=>[I.name,120]));break;case"fit-grid":{const I=i.columns.filter(H=>H.visible),U=Math.floor(R/I.length);P=Object.fromEntries(I.map(H=>[H.name,U]));break}case"fit-content":P=Object.fromEntries(i.columns.map(I=>{const U=Math.max(...r.rows.map(B=>{var y;const _=(y=B==null?void 0:B.cells)==null?void 0:y[I.name],p=(_==null?void 0:_.decode)||(_==null?void 0:_.value);return p?String(p).length:0}),0),H=I.title?I.title.length:0,X=Math.max(U,H);return[I.name,Math.max(50,X*8+16)]}));break}h(P)},[s,r,i]),A.useEffect(()=>{if(c!=null&&c.length&&r.rows){const{flatRows:R}=ms(r.rows,c,e,f);o({...r,rows:R})}else o(r)},[r,c,f,e]);const x=R=>{l(hs(R,c))},w=R=>{R.preventDefault();const P=R.dataTransfer.getData("text/plain");if(!P||c.some(U=>U.column===P))return;const I=[...c,{column:P,visible:!0}];l(I)},E=R=>{R.preventDefault()},{virtualItems:j,containerProps:S,innerProps:b}=mr({items:(i==null?void 0:i.rows)||[],itemHeight:e,containerHeight:t,overscan:5}),N=(R,P)=>{const D=R.clientX,I=m[P],U=X=>{const z=X.clientX-D,Z=Math.max(50,I+z);h(B=>({...B,[P]:Z}))},H=()=>{window.removeEventListener("mousemove",U),window.removeEventListener("mouseup",H)};window.addEventListener("mousemove",U),window.addEventListener("mouseup",H)},$={smpTable:`${ut["smp-table"]}`,headerCell:`${ut["smp-headerCell"]}`,resizer:`${ut["smp-resizer"]}`};return i&&v.jsx("div",{className:$.smpTable,...S,ref:g,children:v.jsxs("table",{children:[v.jsxs("thead",{children:[(n||a)&&v.jsx(gs,{groups:c,onChange:x,onDrop:w,onDragOver:E}),v.jsx("tr",{children:i.columns&&((W=i.columns)==null?void 0:W.map(R=>R.visible&&v.jsxs("th",{className:$.headerCell,draggable:!0,onDragStart:P=>{P.dataTransfer.setData("text/plain",R.name)},style:{width:m[R.name],minWidth:m[R.name],maxWidth:m[R.name]},children:[v.jsx(Pe,{variant:"title",bindValue:R.title}),v.jsx("div",{className:$.resizer,onMouseDown:P=>N(P,R.name),role:"region"})]},R.name)))})]}),v.jsx("tbody",{...b,children:j.map(({item:R,index:P,offsetTop:D})=>R.isGroup?v.jsx(ds,{label:R.value||"",rowHeight:e,offsetTop:D,level:R.level,onClick:()=>{const I=R.rowId;I&&u(U=>ps(U,I))},isExpanded:R.isExpanded},R.rowId||`group-${P}`):v.jsx(jr,{row:R,columnWidths:m,rowHeight:e,offsetTop:D,isGroup:!1},R.rowId||`row-${P}`))}),v.jsx("tfoot",{children:v.jsx("span",{children:"Tfooter here"})})]})})},vs=({data:r,Type:e,ShowSubmit:t=!1,SubmitPosition:n="Right",DefaultValue:s,Label:a,LabelPosition:i="Left",onBlur:o,onClick:c,onOptionsRequest:l})=>{const[f,u]=A.useState();A.useEffect(()=>{u(()=>{if(!r)return;const g={...r};return e&&(g.shape=e),g.shape==null&&(g.shape=se.TEXT_FIELD),s&&(g.obj=Ir(s)),g})},[r,s,e]);const m={container:`smp-field-container ${ce(t)?`smp-field-position-${n}`:""}`},h=()=>{ce(t)||o==null||o(f)};if(f)return v.jsxs("div",{className:m.container,children:[v.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:v.jsx(wt,{...f,onChange:u,onOptionsRequest:l,fun:r==null?void 0:r.fun,onBlur:h,label:a,labelPosition:i})}),ce(t)&&v.jsx(xe,{optionalDisplayValue:"Confirm",onClick:()=>c==null?void 0:c(f),bindValue:"Confirm"})]})},bs=({data:r,readOnly:e=!1,optionsHandler:t,onSubmit:n})=>{const[s,a]=A.useState({});A.useEffect(()=>{a(o(r))},[r]);const i=()=>{const l=c();n({value:l})},o=l=>{var u,d,m;if(!((u=l.rows)!=null&&u.length)||!((d=l.columns)!=null&&d.length))return{};const f=(m=l.rows)==null?void 0:m[0];return l.columns.filter(h=>h.visible??!0).reduce((h,g)=>{const x={...f.cells[g.name],label:g.title,onChange:w=>{a(E=>({...E,[g.name]:{...E[g.name],obj:{...E[g.name].obj,k:w.obj.k},decode:w.decode}}))}};return x.fun&&(x.shape==se.AUTOCOMPLETE||x.shape==se.MULTI_AUTOCOMPLETE||x.shape==se.COMBOBOX)&&(x.onOptionsRequest=(w,E)=>t(w,E,r,g.name)),x.isEditable==null&&(x.isEditable=!0),e&&(x.isEditable=!1),x.isEditable&&x.shape==null&&(x.shape=se.TEXT_FIELD),{...h,[g.name]:x}},{})},c=()=>{const l={columns:[...r.columns],rows:[{cells:{}}]};return Object.entries(s).forEach(([f,u])=>{l.rows[0].cells[f]={obj:{...u.obj},decode:u.decode,shape:u.shape}}),{before:r,after:l}};return s&&v.jsxs("div",{"data-component":"input-panel",style:{display:"flex",flexDirection:"column",gap:"2rem",padding:"2rem"},children:[v.jsx(Et,{layout:r.rows[0].layout,cells:s}),v.jsx(xe,{onClick:i,bindValue:"submit",optionalDisplayValue:"Submit"})]})};exports.AppBar=Qn;exports.Autocomplete=bt;exports.Button=xe;exports.ButtonList=vr;exports.Checkbox=br;exports.Combobox=Sr;exports.DashList=rs;exports.DataTableComponent=ys;exports.DatePicker=Tr;exports.Drawer=ts;exports.Field=vs;exports.Icon=le;exports.InputPanel=bs;exports.Password=Or;exports.Textfield=we;exports.configurePaths=un;
49
+ ${T?"smp-datepickercalendar-td-disabled":""}`},H=()=>`${E[u]} ${d.toString()}`;return v.jsxs("div",{className:X.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[v.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[v.jsx(xe,{onClick:N,ariaLabel:a(mt.PREVIOUS_MONTH),bindValue:"<",appearance:"ghost",variant:"base"}),v.jsx("div",{"aria-label":H(),className:X.label,children:H()}),v.jsx(xe,{onClick:$,ariaLabel:a(mt.NEXT_MONTH),bindValue:">",appearance:"ghost",variant:"base"})]}),v.jsxs("table",{ref:x,role:"grid","aria-label":`${a(St.CALENDAR_FOR)} ${E[u]} ${d}`,className:X.table,children:[v.jsx("thead",{children:v.jsx("tr",{children:R.map(_=>v.jsx("th",{scope:"col",abbr:_.full,className:X.th,children:_.value},_.value))})}),v.jsx("tbody",{children:K.map((_,p)=>v.jsx("tr",{children:_.map((y,T)=>{const C=p*7+T;if(y===null)return v.jsx("td",{className:X.td(!1,!1,!1,!0)},`empty-${T}`);const O=y.getDate()===o.getDate()&&y.getMonth()===o.getMonth()&&y.getFullYear()===o.getFullYear(),L=c&&y.getDate()===c.getDate()&&y.getMonth()===c.getMonth()&&y.getFullYear()===c.getFullYear(),F=m===y.getDate(),V=S(y);return v.jsx("td",{role:"gridcell","aria-selected":L,tabIndex:F?0:-1,onClick:()=>b(y),onKeyDown:M=>D(M,C),"aria-label":`${y.getDate()} ${E[y.getMonth()]} ${y.getFullYear()}`,"data-selected":L,"aria-disabled":V,ref:M=>{w.current[C]=M},className:X.td(O,L,F,V),children:y.getDate()},`day-${T}`)})},`week-${p}`))})]})]})}const Or=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,isEditable:s=!0,...a})=>{const[i,o]=P.useState(!1),[c,l]=P.useState(r||""),[u,f]=P.useState(""),{anchorRef:d,targetRef:h}=yt({position:"bottom",enabled:i});qe(h,()=>{o(!1)}),qe(d,()=>{if(typeof d=="object"&&d!==null&&"current"in d){const $=d.current.querySelector("input");$&&$===document.activeElement&&E()}}),Sr(i,h);const{format:m,getCurrentLanguage:g}=et(),x=P.useCallback($=>{const U=$.length>5&&Mr($,g())||$,j=m(U,void 0,void 0,{type:"date"}),A=typeof U!="string",D=A&&U.toISOString().substring(0,10)||"";return{isValid:A,formattedDate:j,isoDate:D,normalizedDate:U}},[g,m]);P.useEffect(()=>{const{formattedDate:$,isoDate:U,isValid:j}=x(r);l(j&&U||r),f(j&&$||r)},[r,m,x]);const w=()=>o($=>!$),E=()=>{S(u)},R=$=>{S($),o(!1)},S=$=>{const{isoDate:U,isValid:j}=x($);t&&t(j&&U||$)},b=$=>{f($)},N=$=>{$.key==="Enter"&&($.preventDefault(),S(u))};return v.jsxs("div",{"data-component":"date-picker",children:[v.jsx(we,{bindValue:u,placeholder:e,onBlur:E,onChange:b,onKeyDown:N,shapeIcon:"calendar",onShapeIconClick:w,ref:d,isEditable:s,...a}),i&&v.jsx(qn,{disabledDateRanges:n,onDateChange:R,initialValue:gt(c)&&c||"",targetRef:h})]})},zn=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,isEditable:s=!0,placeholder:a,label:i,disabled:o,fun:c,onOptionsRequest:l,onChange:u})=>{const f=r.map(m=>m.bindValue),d=(m,g)=>{const x=[...r];if(m=="")x.pop();else{const w=x.findIndex(E=>E.bindValue===m&&E.optionalDisplayValue===g);w>=0?x.splice(w,1):x.push({bindValue:m,optionalDisplayValue:g})}u==null||u(x)},h={container:"smp-multipleAutocomplete-container"};return v.jsxs("div",{className:h.container,"data-component":"multiple-autocomplete",children:[i&&v.jsx(je,{label:i,disabled:o}),v.jsx(xt,{elements:r,displayMode:e,isEditable:s,onChange:m=>{u==null||u(m)}}),v.jsx(bt,{bindValue:"",fun:c,isEditable:s,onChange:d,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:a,onOptionsRequest:l,_multiActiveIndex:f})]})},Rr=({...r})=>{const[e,t]=P.useState(!1),n=e?"visibility-off":"visibility";return v.jsx(we,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},Kn=({...r})=>{const[e,t]=P.useState(r.bindValue),{translate:n}=et(),s=a=>{var i;a.key==="Enter"&&(a.preventDefault(),(i=r.onEnter)==null||i.call(r,e))};return v.jsx(we,{...r,placeholder:r.placeholder?r.placeholder:n(St.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})},Jn=({bindValue:r,optionalDisplayValue:e,label:t})=>{const n={wrapper:"smp-text-wrapper"};return t?v.jsxs("div",{className:n.wrapper,children:[v.jsx(je,{label:t}),v.jsx(Ae,{variant:"body",bindValue:e||r})]}):v.jsx(Ae,{variant:"body",bindValue:e||r})};class Se{constructor(e,t){ve(this,"class");ve(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Se(e,e.k.split(";"))}static fromString(e){return new Se({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const We=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t??r.decode,shape:r.shape,fun:r.fun}),lr=r=>{const e=Se.fromDataObj(r.obj),t=r.decode?Se.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},Xn=(r,e)=>{const t=new Se(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new Se(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return We(r,t,n)},Zn=({disabled:r,bindValue:e,onChange:t,placeholder:n,state:s,appearance:a,isEditable:i,label:o,ariaLabel:c,helperText:l,error:u,onBlur:f,onKeyDown:d})=>{const h=P.useId(),m=`${h}-helper`,g=u?"danger":s,x=l||!!u,w=R=>{t==null||t(R.target.value)},E={wrapper:"smp-textarea-wrapper",container:`smp-textarea ${r?"smp-textarea-disabled":""} ${n?"smp-textarea-placeholder":""} ${g?`smp-textarea-${g}`:""} ${a?`smp-textarea-${a}`:""} ${i?"":"smp-textarea-readOnly"}`};return v.jsxs("div",{className:E.wrapper,"data-component":"textarea",children:[o&&v.jsx(je,{htmlFor:h,label:o,disabled:r}),v.jsx("textarea",{id:h,value:e,placeholder:n,onChange:w,onBlur:f,className:E.container,disabled:r,readOnly:!i,onKeyDown:d,"aria-label":o?void 0:c,"aria-labelledby":o?h:void 0,"aria-describedby":x?m:void 0}),x&&v.jsx(fr,{id:m,helperText:u,disabled:r,state:g})]})},wt=({decode:r,shape:e,obj:t,data:n,icon:s,fun:a,placeholderIcon:i,label:o,options:c,onChange:l,onClick:u,onEnter:f,onBlur:d,onOptionsRequest:h,isEditable:m})=>{const g={obj:t,shape:e,decode:r,icon:s,fun:a},x={onBlur:d,onOptionsRequest:h,fun:a,icon:s,label:o,isEditable:m,...n},w=(S,b,N)=>Ir(t)?We(S,new Ge(t,b).getLegacyValue()):We(S,b,N),E=S=>We(g,new Be(t,S).getLegacyValue()),R=S=>Xn(g,S);switch(e){case ne.AUTOCOMPLETE:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(b,N)=>{l==null||l(w(g,b,N))}};return v.jsx(bt,{...S})}case ne.BUTTON:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onClick:()=>{u==null||u(w(g,t.k))}};return v.jsx(xe,{...S})}case ne.BUTTON_LIST:{const S={...x,options:c,onClick:(b,N)=>{const $={...g,fun:N};u==null||u(w($,b))}};return v.jsx(br,{...S})}case ne.COMBOBOX:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(b,N)=>{l==null||l(w(g,b,N))}};return v.jsx(wr,{...S})}case ne.SWITCH:case ne.CHECKBOX:{const S={...x,bindValue:Be.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:b=>{l==null||l(E(b))}};return v.jsx(xr,{...S})}case ne.CHIP:{const S={...x,elements:lr(g)};return v.jsx(xt,{...S})}case ne.DATE:{const S={...x,bindValue:Ge.fromDataObj(t).getValue(),onChange:b=>{l==null||l(w(g,b))}};return v.jsx(Or,{...S})}case ne.ICON:case ne.IMAGE:{const S={...x,icon:s,placeholderIcon:i,isInteractable:!!x.fun,onClick:()=>{u==null||u(w(g,t.k))}};return v.jsx(le,{...S})}case ne.MULTI_AUTOCOMPLETE:{const S={...x,elements:lr(g),onChange:b=>{l==null||l(R(b))}};return v.jsx(zn,{...S})}case ne.MEMO:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:b=>{l==null||l(w(g,b))}};return v.jsx(Zn,{...S})}case ne.PASSWORD:{const S={...x,bindValue:t.k,onChange:b=>{l==null||l(w(g,b))}};return v.jsx(Rr,{...S})}case ne.SPOTLIGHT:{const S={...x,bindValue:t.k,onEnter:b=>{f==null||f(w(g,b))}};return v.jsx(Kn,{...S})}case ne.TEXT_FIELD:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:b=>{l==null||l(w(g,b))}};return v.jsx(we,{...S})}default:{const S={...x,bindValue:t.k,optionalDisplayValue:r};return v.jsx(Jn,{...S})}}},Qn=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},jr=(r,e)=>r.map(t=>{var a,i;if((a=t.sections)!=null&&a.length)return{...t,sections:jr(t.sections,e),content:t.content};let n=t.sections,s=t.content;return(i=t.content)!=null&&i.length&&t.columns&&+t.columns>1&&(n=Qn(t.content.filter(c=>!!e[c.id]),+t.columns).map((c,l)=>({...t,id:`${t.id}-${l}`,content:c,gridCols:t.columns,horizontal:!0})),s=[]),{...t,sections:n,content:s}}),cr=(r,e)=>{if(!e)return{};const t=r.some(n=>n.dim)?r.map(n=>n.dim||"auto").join(" "):`repeat(${r.length}, 1fr)`;return{[e]:t}},ur=r=>r.some(e=>e.dim&&!e.dim.endsWith("%")),de={"smp-layout":"_smp-layout_xrjwg_1","smp-layout-horizontal":"_smp-layout-horizontal_xrjwg_9","smp-layout-vertical":"_smp-layout-vertical_xrjwg_13","smp-layout-section-grid":"_smp-layout-section-grid_xrjwg_18","smp-layout-section-vertical":"_smp-layout-section-vertical_xrjwg_20","smp-layout-section-horizontal":"_smp-layout-section-horizontal_xrjwg_24","smp-layout-section-flex":"_smp-layout-section-flex_xrjwg_29","smp-layout-cell-container":"_smp-layout-cell-container_xrjwg_34","smp-grid-template-cols":"_smp-grid-template-cols_xrjwg_44","smp-grid-template-rows":"_smp-grid-template-rows_xrjwg_48","smp-layout-section-with-title":"_smp-layout-section-with-title_xrjwg_52","smp-layout-section-title":"_smp-layout-section-title_xrjwg_58"},Et=({layout:r,cells:e})=>{var f;if(!((f=r.sections)!=null&&f.length))return v.jsx(v.Fragment,{});const t="--smp-grid-template-cols",n="--smp-grid-template-rows",s=jr(r.sections,e),a=d=>d==null?void 0:d.reduce((h,m)=>{var R,S;let g="",x={},w={},E="";return(R=m.sections)!=null&&R.length?(g=de["smp-layout-section-grid"],x=a(m.sections),m.gridCols==null&&(E=`${de[m.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"]}`,(m.horizontal||ur(m.sections))&&(w=cr(m.sections,m.horizontal?t:n)))):(S=m.content)!=null&&S.length&&(m.gridCols!==void 0&&m.gridCols>0?(g=de["smp-layout-section-grid"],E=`${de["smp-grid-template-cols"]}`,w={[t]:`repeat(${m.gridCols}, 1fr)`}):g=de["smp-layout-section-flex"]),{...h,...x,[m.id]:{classes:`${g} ${de[m.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${E} ${m.justify?`smp-justifyContent-${m.justify}`:""} ${m.align?`smp-alignItems-${m.align}`:""}`,styles:w}}},{}),i=a(s),o={container:`${de["smp-layout"]} ${r.horizontal?de["smp-layout-horizontal"]:de["smp-layout-vertical"]}`,sections:i},c=r.horizontal||ur(r.sections)?cr(s,r.horizontal?t:n):{},l=d=>{var m;const h=v.jsx("div",{"smp-id":"section-"+d.id,className:o.sections[d.id].classes,style:o.sections[d.id].styles,children:(m=d.sections)!=null&&m.length?d.sections.map(g=>l(g)):d.content.map(g=>u(g,e[g.id],d.justify,d.align))},"section-"+d.id);return d.title?v.jsxs("div",{className:`${de["smp-layout-section-with-title"]}`,children:[v.jsx("span",{className:`${de["smp-layout-section-title"]} ${d.justify?`smp-justifyContent-${d.justify}`:""} ${d.align?`smp-alignItems-${d.align}`:""}`,children:v.jsx(je,{label:d.title})}),h]}):h},u=(d,h,m,g)=>{const x=d.colSpan!==void 0?d.colSpan>0?d.colSpan:d.colStart!==void 0&&d.colStart<1?1:null:null,w=x!==null?`span ${x}`:d.colStart,E=d.colEnd!==void 0&&d.colEnd>0?d.colEnd:"",R={gridColumnStart:w,gridColumnEnd:E},S=`${de["smp-layout-cell-container"]} ${m?`smp-justifyContent-${m}`:""} ${g?`smp-alignItems-${g}`:""}`;return h?v.jsx("div",{className:S,style:{...R},"smp-id":d.id,children:v.jsx(wt,{...h})},d.id):v.jsx(v.Fragment,{})};return v.jsx("div",{className:o.container,style:c,"smp-id":"layout",children:s==null?void 0:s.map(d=>l(d))})},es=({data:r,onClick:e,onEnter:t})=>{var i,o;const[n,s]=P.useState(),a=P.useCallback(c=>{var u,f;if(!((u=c.rows)!=null&&u.length)||!((f=c.columns)!=null&&f.length))return{};const l=c.rows[0];return c.columns.filter(d=>d.visible).reduce((d,h)=>{const m=l.cells[h.name],g={...m,onChange:x=>{s(w=>w&&{...w,[h.name]:{...w[h.name],obj:{...w[h.name].obj,k:x.obj.k}}})},onClick:()=>{m.fun&&e&&e({...m})},onEnter:x=>{t&&t(x)}};return{...d,[h.name]:g}},{})},[e,t]);return P.useEffect(()=>{r&&s(a(r))},[r,a]),!((i=r==null?void 0:r.rows)!=null&&i.length)||!((o=r.columns)!=null&&o.length)?null:n&&v.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:v.jsx(Et,{layout:r.rows[0].layout,cells:n})})},ts=r=>{var e;return(e=r.children)!=null&&e.length?r.children.map(t=>{var n,s;return{id:((n=t.obj)==null?void 0:n.k)??"",label:t.decode??t.value??((s=t.obj)==null?void 0:s.k)??"",fun:t.fun,icon:t.icon}}):[]},ce=r=>r==null?!1:typeof r=="string"?r.toLocaleLowerCase()=="yes":r,rs=({data:r,logo:e,open:t,minifiedOnClose:n=!0,customHeight:s="100vh",onClick:a,onEnter:i,onClose:o,loadOptions:c})=>{var R,S;const[l,u]=P.useState(),[f,d]=P.useState(t??!0),h=P.useRef(null),m=s.trim()?s:"100vh",g=P.useCallback(b=>{var $,U;if(!(($=b==null?void 0:b.rows)!=null&&$.length)||!((U=b==null?void 0:b.columns)!=null&&U.length))return{};const N=b.rows[0];return b.columns.filter(j=>j.visible??!0).reduce((j,A)=>{const D=N.cells[A.name];if(!D||!f&&ce(n)&&D.shape!==ne.BUTTON&&D.shape!==ne.BUTTON_LIST)return j;const k={...D,onChange:W=>{u(B=>{const K={...B};return K!=null&&K[A.name]&&(K[A.name].obj.k=W.obj.k),K})},onClick:W=>{W.fun&&a&&a(W)},onEnter:W=>{i&&i(W)}};return c&&D.shape==ne.BUTTON_LIST&&(k.onOptionsRequest=(W,B)=>c(W,B).then(K=>ts(K))),!f&&ce(n)&&(k.data={...k.data,showText:!1,justify:"center"}),{...j,[A.name]:k}},{})},[f,n,a,i,c]),x=P.useCallback(()=>{o==null||o()},[o]),w=()=>{ce(n)?d(b=>!b):(d(!1),o==null||o())};if(P.useEffect(()=>{u(g(r))},[r]),P.useEffect(()=>{if(!h.current)return;if(!ce(n)){u(g(r));return}const b=getComputedStyle(h.current).getPropertyValue("--smp-drawer-slide-transition");let N=Number(b);b.endsWith("ms")?N=parseFloat(b):b.endsWith("s")&&(N=parseFloat(b)*1e3),setTimeout(()=>{u(g(r))},N/2)},[f,n]),P.useEffect(()=>{t!==void 0&&!ce(n)&&d(t)},[n,t]),!((R=r==null?void 0:r.rows)!=null&&R.length)||!((S=r.columns)!=null&&S.length))return null;const E={drawer:`smp-drawer ${ce(n)?"smp-drawer-minified":"smp-drawer-fixed"} ${f?"smp-drawer-open":""} ${!ce(n)&&!f?"smp-drawer-no-border":""}`,container:"smp-drawer-container",containerHeader:"smp-drawer-container-header",containerIcon:`${f?"":"smp-drawer-container-icon-close"} smp-drawer-container-icon`,containerLayout:"smp-drawer-container-layout",containerLogo:"smp-drawer-container-logo",backdrop:`smp-drawer-backdrop ${f?"smp-drawer-backdrop-open":""}`};return l&&v.jsxs(v.Fragment,{children:[!ce(n)&&v.jsx("div",{"aria-hidden":"true","aria-label":"drawer-backdrop",className:E.backdrop,onClick:x}),v.jsx("aside",{ref:h,className:E.drawer,style:{height:m},"aria-label":"Drawer","smp-id":"drawer",children:v.jsxs("div",{className:E.container,children:[v.jsxs("div",{className:E.containerHeader,children:[e&&v.jsx("div",{className:E.containerLogo,children:v.jsx(le,{icon:e,title:"drawer_logo",width:"100%",height:24})}),v.jsx("div",{className:E.containerIcon,children:v.jsx(le,{icon:ce(n)?"menu_close":"close",title:"drawer_icon",rotated:!f,isInteractable:!0,onClick:w,width:20,height:20})})]}),v.jsx("div",{className:E.containerLayout,children:v.jsx(Et,{layout:r.rows[0].layout,cells:l})})]})})]})},ns=({ColumnsNumber:r=1,data:e={},ForceText:t,TextColName:n,TextColor:s="var(--smp-dashList-color-base)",Fillspace:a,FontSize:i,Horizontal:o,ForceIcon:c,IconColName:l,IconColor:u="var(--smp-dashList-color-base)",NumberFormat:f,ForceUM:d,UmColName:h,UmColor:m="var(--smp-dashList-color-base)",ForceValue:g,ValueColName:x,ValueColor:w="var(--smp-dashList-color-base)",SelectLayout:E="1",onClick:R})=>{const S="N/A",b=(e==null?void 0:e.columns)||[],N=(e==null?void 0:e.rows)||[],$=N.length>0,U="--smp-dashList-color",j="smp-layout",A="descr",D="icon",k="um",W="value",B=i||"1em",K="18px",z="--smp-dashList-columns",X="--smp-dashList-fontSize",H={dash:(Y="1")=>{const Z=p(Y),te=Z,re=y(Z,A),fe=y(Z,D),ge=y(Z,k),pe=y(Z,W);return{container:te,descr:re,icon:fe,um:ge,value:pe}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
50
+ ${ce(o)?"smp-dash-list-horizontal":""}`},{format:_}=et(),p=Y=>`${j}-${Y}`,y=(Y,Z)=>`${Y}__${Z}`,T=Y=>`${U}-${Y}`,C=Y=>{const Z=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(Z.test(Y)){const re=Y.match(Z)||[];if((re==null?void 0:re.length)>3)return"rgb("+re[1]+","+re[2]+","+re[3]+")"}return Y},O=Y=>{if(!f)return Y;const[Z,te]=L(f).map(Ee=>parseInt(Ee||"0")),re="0,0"+(te?"."+"0".repeat(te):""),fe=_(Y,re,"it");if(!Z)return fe;const[ge,pe]=fe.split(",");return ge+(pe?`,${pe}`:"")},L=Y=>Y.includes(";")?Y.split(";"):[Y],F=Y=>{const Z=re=>{var fe;if(re)return(fe=Y==null?void 0:Y.cells[re])==null?void 0:fe.obj.k},te=re=>{var fe,ge;if(!(b.length<=re))return(ge=(fe=Y==null?void 0:Y.cells[b[re].name])==null?void 0:fe.obj)==null?void 0:ge.k};return{descr:t||Z(n)||te(2)||"",icon:c||Z(l)||te(3)||"",um:d||Z(h)||te(1)||"",value:g||Z(x)||te(0)||""}},V=Y=>{R==null||R(Y)},M=(Y,Z)=>{(Y.key==="Enter"||Y.key===" ")&&(Y.preventDefault(),Y.stopPropagation(),V(Z))},G=(Y=>{const Z=H.dash(Y);return{className:Z,descr:te=>v.jsx("div",{className:Z.descr,children:te},`${Y}-${A}`),icon:te=>v.jsx("div",{className:Z.icon,children:v.jsx(le,{color:u,height:K,icon:te,width:K})},`${Y}-${D}`),um:te=>v.jsx("div",{className:Z.um,children:te},`${Y}-${k}`),value:te=>v.jsx("div",{className:Z.value,children:te},`${Y}-${W}`)}})(E),se=Y=>{const{descr:Z,icon:te,um:re,value:fe}=F(Y),ge={[T(A)]:C(s),[T(k)]:C(m),[T(W)]:C(w)},pe=[],Ee=O(fe);switch(E){case"2":te&&pe.push(G.icon(te)),pe.push(G.descr(Z)),pe.push(G.value(re?Ee+" "+re:Ee));break;default:case"1":pe.push(G.descr(Z)),pe.push(G.value(re?Ee+" "+re:Ee))}return v.jsx("div",{className:G.className.container,role:"button",style:ge,tabIndex:0,onClick:()=>V(Y),onKeyDown:Cr=>M(Cr,Y),children:pe},Y.rowId)},I={[z]:String(r),[X]:B};return v.jsx("div",{className:H.dashList,style:I,children:$?N.map(Y=>se(Y)):S})},ut={"smp-table":"_smp-table_8dmh0_1","smp-headerCell":"_smp-headerCell_8dmh0_35","smp-resizer":"_smp-resizer_8dmh0_44"},ss="_rowContent_gazwe_13",as="_clickable_gazwe_42",is="_indent_gazwe_47",os="_toggle_gazwe_53",ls="_rowLabel_gazwe_69",cs="_cell_gazwe_78",us="_leftSection_gazwe_86",be={rowContent:ss,clickable:as,indent:is,toggle:os,rowLabel:ls,cell:cs,leftSection:us};function He(r){return!!r&&"children"in r}function fs(r){return!He(r)}function ds(r){return JSON.stringify(r).split("").reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0).toString()}const Dr=({row:r,columnWidths:e={},level:t=0,rowHeight:n=26,offsetTop:s})=>{var E;const[a,i]=P.useState(!1),o=He(r)&&!!((E=r.children)!=null&&E.length),c=r.cells&&Object.keys(r.cells).length>0,l=o,u=t*20,f=()=>{o&&i(!a)},d={content:`${be.rowContent} ${o?be.clickable:""}`,toggle:`${be.toggle}`,indent:`${be.indent}`,cell:`${be.cell}`},h=R=>v.jsx(wt,{...R}),m=()=>v.jsx("span",{className:d.toggle,children:l?a?"▶":"▼":" "}),g=()=>v.jsx("span",{className:d.indent,style:{width:`${u}px`},"aria-hidden":"true"}),x=()=>{const R=fs(r)?"":r.decode||(c?"":"Untitled"),S=s??n*t;return v.jsxs("tr",{className:d.content,onClick:f,role:o?"button":"row","aria-expanded":o?!a:void 0,style:{height:`${n}px`,lineHeight:`calc(${n}px - 2*2px)`,transform:`translateY(${S}px)`},children:[He(r)&&v.jsxs("td",{className:be.leftSection,style:{height:`${n}px`},children:[g(),m(),v.jsx("span",{className:be.rowLabel,children:R})]}),r.cells&&Object.keys(r.cells).length>0&&Object.entries(r.cells).map(([b,N])=>v.jsx("td",{className:d.cell,style:{width:e[b],minWidth:e[b],height:`${n}px`},children:h(N)},ds(N)||b))]})},w=()=>{var R;return a||!o?null:v.jsx(v.Fragment,{children:He(r)&&((R=r.children)==null?void 0:R.map((S,b)=>v.jsx(Dr,{row:S,level:t+1},`child-${b}`)))})};return v.jsxs(v.Fragment,{children:[x(),w()]})},ps=({label:r,rowHeight:e=28,offsetTop:t=0,level:n=0,onClick:s,isExpanded:a})=>{const i={tr:"smp-groupRow-tr",td:"smp-groupRow-td"};return v.jsx("tr",{className:i.tr,style:{height:e,top:t,lineHeight:`${e}px`},onClick:s,children:v.jsxs("td",{className:i.td,style:{paddingLeft:10+n*20},children:[v.jsx(le,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),v.jsx(Ae,{variant:"title",bindValue:r})]})})};function hs(r,e){const t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t}function ms(r,e){return r.map(t=>{const n=e.find(s=>s.column===t.bindValue);return{column:t.bindValue,visible:(n==null?void 0:n.visible)??!0}})}function gs(r,e,t,n){const s=[];let a=0;return i(r,0,[]),{flatRows:s,offset:a};function i(f,d,h){if(d>=e.length){u(f);return}const m=e[d].column,g=o(f,m);for(const[x,w]of g){const E=[...h,x],R=c(E,d),S=n.has(R);s.push(l(x,R,d,S)),a+=t,S&&i(w,d+1,E)}}function o(f,d){var m;const h=new Map;for(const g of f){const x=((m=g.cells[d])==null?void 0:m.decode)??"N/D";h.has(x)||h.set(x,[]),h.get(x).push(g)}return h}function c(f,d){return`group-${f.join("-")}-${d}`}function l(f,d,h,m){return{isGroup:!0,value:f,cells:{},rowId:d,level:h,isExpanded:m}}function u(f){for(const d of f)s.push(d),a+=t}}const ys=({groups:r=[],isDraggable:e=!0,isEditable:t=!0,onChange:n,onDrop:s,onDragOver:a})=>{const i=r.map(o=>({bindValue:o.column}));return v.jsxs("div",{className:"smp-groupBar-container",onDragOver:a,onDrop:s,children:[v.jsx(le,{icon:"groups"}),v.jsx(xt,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:n})]})},vs=({data:r,lineHeight:e=28,TableHeight:t=400,groups:n,columnSizingMode:s="fixed",showGroupBar:a=!0})=>{var U;const[i,o]=P.useState(r),[c,l]=P.useState(n||[]),[u,f]=P.useState(new Set),d=i&&i.columns?Object.fromEntries(i.columns.map(j=>[j.name,120])):{},[h,m]=P.useState(d),g=P.useRef(null);P.useEffect(()=>{var D;if(!i||!i.columns||i.columns.length)return;const j=((D=g.current)==null?void 0:D.clientWidth)??1e3;let A={};switch(s){case"fixed":A=Object.fromEntries(i.columns.map(k=>[k.name,120]));break;case"fit-grid":{const k=i.columns.filter(B=>B.visible),W=Math.floor(j/k.length);A=Object.fromEntries(k.map(B=>[B.name,W]));break}case"fit-content":A=Object.fromEntries(i.columns.map(k=>{const W=Math.max(...r.rows.map(H=>{var y;const _=(y=H==null?void 0:H.cells)==null?void 0:y[k.name],p=(_==null?void 0:_.decode)||(_==null?void 0:_.value);return p?String(p).length:0}),0),B=k.title?k.title.length:0,K=Math.max(W,B);return[k.name,Math.max(50,K*8+16)]}));break}m(A)},[s,r,i]),P.useEffect(()=>{if(c!=null&&c.length&&r.rows){const{flatRows:j}=gs(r.rows,c,e,u);o({...r,rows:j})}else o(r)},[r,c,u,e]);const x=j=>{l(ms(j,c))},w=j=>{j.preventDefault();const A=j.dataTransfer.getData("text/plain");if(!A||c.some(W=>W.column===A))return;const k=[...c,{column:A,visible:!0}];l(k)},E=j=>{j.preventDefault()},{virtualItems:R,containerProps:S,innerProps:b}=gr({items:(i==null?void 0:i.rows)||[],itemHeight:e,containerHeight:t,overscan:5}),N=(j,A)=>{const D=j.clientX,k=h[A],W=K=>{const z=K.clientX-D,X=Math.max(50,k+z);m(H=>({...H,[A]:X}))},B=()=>{window.removeEventListener("mousemove",W),window.removeEventListener("mouseup",B)};window.addEventListener("mousemove",W),window.addEventListener("mouseup",B)},$={smpTable:`${ut["smp-table"]}`,headerCell:`${ut["smp-headerCell"]}`,resizer:`${ut["smp-resizer"]}`};return i&&v.jsx("div",{className:$.smpTable,...S,ref:g,children:v.jsxs("table",{children:[v.jsxs("thead",{children:[(n||a)&&v.jsx(ys,{groups:c,onChange:x,onDrop:w,onDragOver:E}),v.jsx("tr",{children:i.columns&&((U=i.columns)==null?void 0:U.map(j=>j.visible&&v.jsxs("th",{className:$.headerCell,draggable:!0,onDragStart:A=>{A.dataTransfer.setData("text/plain",j.name)},style:{width:h[j.name],minWidth:h[j.name],maxWidth:h[j.name]},children:[v.jsx(Ae,{variant:"title",bindValue:j.title}),v.jsx("div",{className:$.resizer,onMouseDown:A=>N(A,j.name),role:"region"})]},j.name)))})]}),v.jsx("tbody",{...b,children:R.map(({item:j,index:A,offsetTop:D})=>j.isGroup?v.jsx(ps,{label:j.value||"",rowHeight:e,offsetTop:D,level:j.level,onClick:()=>{const k=j.rowId;k&&f(W=>hs(W,k))},isExpanded:j.isExpanded},j.rowId||`group-${A}`):v.jsx(Dr,{row:j,columnWidths:h,rowHeight:e,offsetTop:D,isGroup:!1},j.rowId||`row-${A}`))}),v.jsx("tfoot",{children:v.jsx("span",{children:"Tfooter here"})})]})})},bs=({data:r,Type:e,ShowSubmit:t=!1,SubmitPosition:n="Right",DefaultValue:s,Label:a,LabelPosition:i="Left",onBlur:o,onClick:c,onOptionsRequest:l})=>{const[u,f]=P.useState();P.useEffect(()=>{f(()=>{if(!r)return;const g={...r};return e&&(g.shape=e),g.shape==null&&(g.shape=ne.TEXT_FIELD),s&&(g.obj=Nr(s)),g})},[r,s,e]);const h={container:`smp-field-container ${ce(t)?`smp-field-position-${n}`:""}`},m=()=>{ce(t)||o==null||o(u)};if(u)return v.jsxs("div",{className:h.container,children:[v.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:v.jsx(wt,{...u,onChange:f,onOptionsRequest:l,fun:r==null?void 0:r.fun,onBlur:m,label:a,labelPosition:i})}),ce(t)&&v.jsx(xe,{optionalDisplayValue:"Confirm",onClick:()=>c==null?void 0:c(u),bindValue:"Confirm"})]})},xs=({data:r,readOnly:e=!1,optionsHandler:t,onSubmit:n})=>{const[s,a]=P.useState({});P.useEffect(()=>{a(o(r))},[r]);const i=()=>{const l=c();n({value:l})},o=l=>{var f,d,h;if(!((f=l.rows)!=null&&f.length)||!((d=l.columns)!=null&&d.length))return{};const u=(h=l.rows)==null?void 0:h[0];return l.columns.filter(m=>m.visible??!0).reduce((m,g)=>{const x={...u.cells[g.name],label:g.title,onChange:w=>{a(E=>({...E,[g.name]:{...E[g.name],obj:{...E[g.name].obj,k:w.obj.k},decode:w.decode}}))}};return x.fun&&(x.shape==ne.AUTOCOMPLETE||x.shape==ne.MULTI_AUTOCOMPLETE||x.shape==ne.COMBOBOX)&&(x.onOptionsRequest=(w,E)=>t(w,E,r,g.name)),x.isEditable==null&&(x.isEditable=!0),e&&(x.isEditable=!1),x.isEditable&&x.shape==null&&(x.shape=ne.TEXT_FIELD),{...m,[g.name]:x}},{})},c=()=>{const l={columns:[...r.columns],rows:[{cells:{}}]};return Object.entries(s).forEach(([u,f])=>{l.rows[0].cells[u]={obj:{...f.obj},decode:f.decode,shape:f.shape}}),{before:r,after:l}};return s&&v.jsxs("div",{"data-component":"input-panel",style:{display:"flex",flexDirection:"column",gap:"2rem",padding:"2rem"},children:[v.jsx(Et,{layout:r.rows[0].layout,cells:s}),v.jsx(xe,{onClick:i,bindValue:"submit",optionalDisplayValue:"Submit"})]})};exports.AppBar=es;exports.Autocomplete=bt;exports.Button=xe;exports.ButtonList=br;exports.Checkbox=xr;exports.Combobox=wr;exports.DashList=ns;exports.DataTableComponent=vs;exports.DatePicker=Or;exports.Drawer=rs;exports.Field=bs;exports.Icon=le;exports.InputPanel=xs;exports.Password=Rr;exports.Textfield=we;exports.configurePaths=un;