@sme.up/ketchup2 2.0.0-SNAPSHOT-20250624104712 → 2.0.0-SNAPSHOT-20250624130438

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 Nr=Object.defineProperty;var Mr=(r,e,t)=>e in r?Nr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var ye=(r,e,t)=>Mr(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react"),Fr=require("react-dom");function Vr(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 Ye=Vr(T);var Ue={exports:{}},_e={};/**
1
+ "use strict";var Mr=Object.defineProperty;var Fr=(r,e,t)=>e in r?Mr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var de=(r,e,t)=>Fr(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("react"),Vr=require("react-dom");function Yr(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 Ye=Yr(O);var Ue={exports:{}},Pe={};/**
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 Ct;function Yr(){if(Ct)return _e;Ct=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 _e.Fragment=e,_e.jsx=t,_e.jsxs=t,_e}var $e={};/**
9
+ */var Pt;function Ur(){if(Pt)return Pe;Pt=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 Pe.Fragment=e,Pe.jsx=t,Pe.jsxs=t,Pe}var ke={};/**
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 Pt;function Ur(){return Pt||(Pt=1,process.env.NODE_ENV!=="production"&&function(){function r(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===L?null:p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case v:return"Fragment";case w:return"Profiler";case b:return"StrictMode";case g:return"Suspense";case _:return"SuspenseList";case C: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 R:return(p.displayName||"Context")+".Provider";case E:return(p._context.displayName||"Context")+".Consumer";case S:var x=p.render;return p=p.displayName,p||(p=x.displayName||x.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case A:return x=p.displayName||null,x!==null?x:r(p.type)||"Memo";case $:x=p._payload,p=p._init;try{return r(p(x))}catch{}}return null}function e(p){return""+p}function t(p){try{e(p);var x=!1}catch{x=!0}if(x){x=console;var O=x.error,P=typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object";return O.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",P),e(p)}}function n(p){if(p===v)return"<>";if(typeof p=="object"&&p!==null&&p.$$typeof===$)return"<...>";try{var x=r(p);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function s(){var p=W.A;return p===null?null:p.getOwner()}function a(){return Error("react-stack-top-frame")}function i(p){if(N.call(p,"key")){var x=Object.getOwnPropertyDescriptor(p,"key").get;if(x&&x.isReactWarning)return!1}return p.key!==void 0}function o(p,x){function O(){z||(z=!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)",x))}O.isReactWarning=!0,Object.defineProperty(p,"key",{get:O,configurable:!0})}function c(){var p=r(this.type);return K[p]||(K[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,x,O,P,j,k,V,Y){return O=k.ref,p={$$typeof:m,type:p,key:x,props:k,_owner:j},(O!==void 0?O: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:V}),Object.defineProperty(p,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p}function f(p,x,O,P,j,k,V,Y){var M=x.children;if(M!==void 0)if(P)if(D(M)){for(P=0;P<M.length;P++)u(M[P]);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(N.call(x,"key")){M=r(p);var J=Object.keys(x).filter(function(se){return se!=="key"});P=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",F[M+P]||(J=0<J.length?"{"+J.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var kt;function Wr(){return kt||(kt=1,process.env.NODE_ENV!=="production"&&function(){function r(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===I?null:p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case x:return"Fragment";case w:return"Profiler";case v:return"StrictMode";case y:return"Suspense";case P:return"SuspenseList";case _: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 $:return(p.displayName||"Context")+".Provider";case S:return(p._context.displayName||"Context")+".Consumer";case R:var b=p.render;return p=p.displayName,p||(p=b.displayName||b.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case E:return b=p.displayName||null,b!==null?b:r(p.type)||"Memo";case T:b=p._payload,p=p._init;try{return r(p(b))}catch{}}return null}function e(p){return""+p}function t(p){try{e(p);var b=!1}catch{b=!0}if(b){b=console;var D=b.error,A=typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object";return D.call(b,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",A),e(p)}}function n(p){if(p===x)return"<>";if(typeof p=="object"&&p!==null&&p.$$typeof===T)return"<...>";try{var b=r(p);return b?"<"+b+">":"<...>"}catch{return"<...>"}}function s(){var p=B.A;return p===null?null:p.getOwner()}function a(){return Error("react-stack-top-frame")}function i(p){if(k.call(p,"key")){var b=Object.getOwnPropertyDescriptor(p,"key").get;if(b&&b.isReactWarning)return!1}return p.key!==void 0}function o(p,b){function D(){H||(H=!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)",b))}D.isReactWarning=!0,Object.defineProperty(p,"key",{get:D,configurable:!0})}function c(){var p=r(this.type);return G[p]||(G[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,b,D,A,C,L,Y,U){return D=L.ref,p={$$typeof:m,type:p,key:b,props:L,_owner:C},(D!==void 0?D: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:Y}),Object.defineProperty(p,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:U}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p}function f(p,b,D,A,C,L,Y,U){var V=b.children;if(V!==void 0)if(A)if(j(V)){for(A=0;A<V.length;A++)u(V[A]);Object.freeze&&Object.freeze(V)}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(V);if(k.call(b,"key")){V=r(p);var J=Object.keys(b).filter(function(se){return se!=="key"});A=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",M[V+A]||(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} />`,P,M,J,M),F[M+P]=!0)}if(M=null,O!==void 0&&(t(O),M=""+O),i(x)&&(t(x.key),M=""+x.key),"key"in x){O={};for(var B in x)B!=="key"&&(O[B]=x[B])}else O=x;return M&&o(O,typeof p=="function"?p.displayName||p.name||"Unknown":p),l(p,M,k,j,s(),O,V,Y)}function u(p){typeof p=="object"&&p!==null&&p.$$typeof===m&&p._store&&(p._store.validated=1)}var d=T,m=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),b=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"),g=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),L=Symbol.for("react.client.reference"),W=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=Object.prototype.hasOwnProperty,D=Array.isArray,H=console.createTask?console.createTask:function(){return null};d={"react-stack-bottom-frame":function(p){return p()}};var z,K={},q=d["react-stack-bottom-frame"].bind(d,a)(),Z=H(n(a)),F={};$e.Fragment=v,$e.jsx=function(p,x,O,P,j){var k=1e4>W.recentlyCreatedOwnerStacks++;return f(p,x,O,!1,P,j,k?Error("react-stack-top-frame"):q,k?H(n(p)):Z)},$e.jsxs=function(p,x,O,P,j){var k=1e4>W.recentlyCreatedOwnerStacks++;return f(p,x,O,!0,P,j,k?Error("react-stack-top-frame"):q,k?H(n(p)):Z)}}()),$e}var At;function Wr(){return At||(At=1,process.env.NODE_ENV==="production"?Ue.exports=Yr():Ue.exports=Ur()),Ue.exports}var y=Wr();const De=({label:r,disabled:e,htmlFor:t})=>{const n={container:`smp-label ${e?"smp-label-disabled":""}`};return y.jsx("label",{className:n.container,htmlFor:t,children:r})},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"},Hr=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},xr=(r,e)=>r.map(t=>{var a,i;if((a=t.sections)!=null&&a.length)return{...t,sections:xr(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=Hr(t.content.filter(c=>e.includes(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}}),kt=(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}},Lt=r=>r.some(e=>e.dim&&!e.dim.endsWith("%")),Tt=({children:r,layout:e={horizontal:!1,sections:[{id:"1",content:Array.isArray(r)?r.map(t=>({id:t.props.id})):[{id:r.props.id}]}]}})=>{const t={};T.Children.forEach(r,d=>{T.isValidElement(d)&&(t[d.props.id]=d)});const n="--smp-grid-template-cols",s="--smp-grid-template-rows",a=xr(e.sections??[],Object.keys(t)),i=d=>d.reduce((m,h)=>{var R,S;let v="",b={},w={},E="";return(R=h.sections)!=null&&R.length?(v=de["smp-layout-section-grid"],b=i(h.sections),h.gridCols===void 0&&(E=de[h.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"],(h.horizontal||Lt(h.sections))&&(w=kt(h.sections,h.horizontal?n:s)))):(S=h.content)!=null&&S.length&&(h.gridCols!==void 0&&h.gridCols>0?(v=de["smp-layout-section-grid"],E=de["smp-grid-template-cols"],w={[n]:`repeat(${h.gridCols}, 1fr)`}):v=de["smp-layout-section-flex"]),{...m,...b,[h.id]:{classes:`${v} ${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}}},{}),o=i(a),c=`${de["smp-layout"]} ${e.horizontal?de["smp-layout-horizontal"]:de["smp-layout-vertical"]}`,l=e.horizontal||Lt(e.sections||[])?kt(a,e.horizontal?n:s):{},f=d=>{var h,v;const m=y.jsx("div",{"smp-id":`section-${d.id}`,className:o[d.id].classes,style:o[d.id].styles,children:(h=d.sections)!=null&&h.length?d.sections.map(b=>f(b)):(v=d.content)==null?void 0:v.map(b=>u(b,d.justify,d.align))},`section-${d.id}`);return d.title?y.jsxs("div",{className:de["smp-layout-section-with-title"],children:[y.jsx("span",{className:`${de["smp-layout-section-title"]} ${d.justify?`smp-justifyContent-${d.justify}`:""} ${d.align?`smp-alignItems-${d.align}`:""}`,children:y.jsx(De,{label:d.title})}),m]},`title-section-${d.id}`):m},u=(d,m,h)=>{const v=t[d.id];if(!v)return null;const w={gridColumnStart:(d.colSpan&&d.colSpan>0?`span ${d.colSpan}`:d.colStart&&d.colStart<1?"1":void 0)??d.colStart,gridColumnEnd:d.colEnd&&d.colEnd>0?d.colEnd:void 0},E=`${de["smp-layout-cell-container"]} ${m?`smp-justifyContent-${m}`:""} ${h?`smp-alignItems-${h}`:""}`;return y.jsx("div",{className:E,style:w,"smp-id":d.id,children:v},d.id)};return y.jsx("div",{className:c,style:l,"smp-id":"layout",children:a.map(d=>f(d))})},re={AUTOCOMPLETE:"ACP",BUTTON_LIST:"BTL",BUTTON:"BTN",CHECKBOX:"CHK",CHIP:"CHI",COMBOBOX:"CMB",DATE:"CAL",ICON:"ICO",IMAGE:"IMG",MEMO:"MEM",MULTI_AUTOCOMPLETE:"AML",RADIO:"RAD",SPOTLIGHT:"SPL",SWITCH:"SWT",TEXT_FIELD:"ITX",TIME:"TIM",PASSWORD:"PWD"},Br=r=>r.t=="D8",Gr=r=>r.t=="I1",Kr=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 Qe{constructor(e,t){ye(this,"class");ye(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Qe(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 qr(r,e){if(Ot(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),We(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)),We(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)),bt(o,u,parseInt(l))&&We(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)),bt(f,u,parseInt(l))&&We(t)?t:r}}return r}function Ot(r){return/^\d{4}-\d{2}-\d{2}$/.test(r)&&r.length===10}function We(r){return r instanceof Date&&!isNaN(r.getTime())}function zr(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 bt(n,t-1,e)}function bt(r,e,t){const n=[31,Jr(t)?29:28,31,30,31,30,31,31,30,31,30,31];return!(e<0||e>11||r<1||r>n[e])}function Jr(r){return r%4===0&&(r%100!==0||r%400===0)}function Xr(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 et{constructor(e,t){ye(this,"class");ye(this,"date");this.class=e,this.date=t}static fromDataObj(e){const t=It.get(`${e.t}${e.p}`);if(t)return new et(e,t.legacyToIso(e.k));throw new Error(`Date creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=It.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 It=new Map([["D8*YYMD",{legacyToIso(r){return zr(r)&&`${r.substring(0,4)}-${r.substring(4,6)}-${r.substring(6,8)}`||r},isoToLegacy(r){return Ot(r)&&r.replaceAll("-","")||r}}]]),ke=(r,e)=>{T.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 it({position:r="bottom",enabled:e=!0}){const t=T.useRef(null),n=T.useRef(null),[s,a]=T.useState(0),i=T.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 v=l+window.scrollY,b=f+window.scrollX;switch(r){case"top":v-=m;break;case"bottom":v+=d;break;case"left":b-=h;break;case"right":b+=u;break}requestAnimationFrame(()=>{c.style.transform=`translate(${b}px, ${v}px)`,c.style.opacity="1"})},[r]);return T.useLayoutEffect(()=>{if(!e)return;const o=requestAnimationFrame(()=>{i()}),c=new MutationObserver(()=>{n.current&&i()});return n.current&&c.observe(n.current,{childList:!0,subtree:!0}),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),()=>{cancelAnimationFrame(o),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),c.disconnect()}},[i,e]),{anchorRef:t,targetRef:n,anchorWidth:s}}const Le=(r,e,t)=>{if(r=="")return"";if(t)switch(t){case"CodeOnly":return r;case"DescOnly":return e||"";case"Both":return`${r} - ${e}`}return r},Sr=({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 y.jsx("label",{className:s.container,id:n,children:r})};function Zr(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 tt(){return tt=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},tt.apply(null,arguments)}function xt(r,e){return xt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},xt(r,e)}function Qr(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,xt(r,e)}function ut(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 He={};/*!
22
+ <%s key={someKey} {...props} />`,A,V,J,V),M[V+A]=!0)}if(V=null,D!==void 0&&(t(D),V=""+D),i(b)&&(t(b.key),V=""+b.key),"key"in b){D={};for(var K in b)K!=="key"&&(D[K]=b[K])}else D=b;return V&&o(D,typeof p=="function"?p.displayName||p.name||"Unknown":p),l(p,V,L,C,s(),D,Y,U)}function u(p){typeof p=="object"&&p!==null&&p.$$typeof===m&&p._store&&(p._store.validated=1)}var d=O,m=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),S=Symbol.for("react.consumer"),$=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),I=Symbol.for("react.client.reference"),B=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=Object.prototype.hasOwnProperty,j=Array.isArray,F=console.createTask?console.createTask:function(){return null};d={"react-stack-bottom-frame":function(p){return p()}};var H,G={},z=d["react-stack-bottom-frame"].bind(d,a)(),Z=F(n(a)),M={};ke.Fragment=x,ke.jsx=function(p,b,D,A,C){var L=1e4>B.recentlyCreatedOwnerStacks++;return f(p,b,D,!1,A,C,L?Error("react-stack-top-frame"):z,L?F(n(p)):Z)},ke.jsxs=function(p,b,D,A,C){var L=1e4>B.recentlyCreatedOwnerStacks++;return f(p,b,D,!0,A,C,L?Error("react-stack-top-frame"):z,L?F(n(p)):Z)}}()),ke}var At;function Br(){return At||(At=1,process.env.NODE_ENV==="production"?Ue.exports=Ur():Ue.exports=Wr()),Ue.exports}var g=Br();const $e=({label:r,disabled:e,htmlFor:t})=>{const n={container:`smp-label ${e?"smp-label-disabled":""}`};return g.jsx("label",{className:n.container,htmlFor:t,children:r})},pe={"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"},Hr=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},Sr=(r,e)=>r.map(t=>{var a,i;if((a=t.sections)!=null&&a.length)return{...t,sections:Sr(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=Hr(t.content.filter(c=>e.includes(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}}),Lt=(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}},It=r=>r.some(e=>e.dim&&!e.dim.endsWith("%")),Ot=({children:r,layout:e={horizontal:!1,sections:[{id:"1",content:Array.isArray(r)?r.map(t=>({id:t.props.id})):[{id:r.props.id}]}]}})=>{const t={};O.Children.forEach(r,d=>{O.isValidElement(d)&&(t[d.props.id]=d)});const n="--smp-grid-template-cols",s="--smp-grid-template-rows",a=Sr(e.sections??[],Object.keys(t)),i=d=>d.reduce((m,h)=>{var $,R;let x="",v={},w={},S="";return($=h.sections)!=null&&$.length?(x=pe["smp-layout-section-grid"],v=i(h.sections),h.gridCols===void 0&&(S=pe[h.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"],(h.horizontal||It(h.sections))&&(w=Lt(h.sections,h.horizontal?n:s)))):(R=h.content)!=null&&R.length&&(h.gridCols!==void 0&&h.gridCols>0?(x=pe["smp-layout-section-grid"],S=pe["smp-grid-template-cols"],w={[n]:`repeat(${h.gridCols}, 1fr)`}):x=pe["smp-layout-section-flex"]),{...m,...v,[h.id]:{classes:`${x} ${pe[h.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${S} ${h.justify?`smp-justifyContent-${h.justify}`:""} ${h.align?`smp-alignItems-${h.align}`:""}`,styles:w}}},{}),o=i(a),c=`${pe["smp-layout"]} ${e.horizontal?pe["smp-layout-horizontal"]:pe["smp-layout-vertical"]}`,l=e.horizontal||It(e.sections||[])?Lt(a,e.horizontal?n:s):{},f=d=>{var h,x;const m=g.jsx("div",{"smp-id":`section-${d.id}`,className:o[d.id].classes,style:o[d.id].styles,children:(h=d.sections)!=null&&h.length?d.sections.map(v=>f(v)):(x=d.content)==null?void 0:x.map(v=>u(v,d.justify,d.align))},`section-${d.id}`);return d.title?g.jsxs("div",{className:pe["smp-layout-section-with-title"],children:[g.jsx("span",{className:`${pe["smp-layout-section-title"]} ${d.justify?`smp-justifyContent-${d.justify}`:""} ${d.align?`smp-alignItems-${d.align}`:""}`,children:g.jsx($e,{label:d.title})}),m]},`title-section-${d.id}`):m},u=(d,m,h)=>{const x=t[d.id];if(!x)return null;const w={gridColumnStart:(d.colSpan&&d.colSpan>0?`span ${d.colSpan}`:d.colStart&&d.colStart<1?"1":void 0)??d.colStart,gridColumnEnd:d.colEnd&&d.colEnd>0?d.colEnd:void 0},S=`${pe["smp-layout-cell-container"]} ${m?`smp-justifyContent-${m}`:""} ${h?`smp-alignItems-${h}`:""}`;return g.jsx("div",{className:S,style:w,"smp-id":d.id,children:x},d.id)};return g.jsx("div",{className:c,style:l,"smp-id":"layout",children:a.map(d=>f(d))})},re={AUTOCOMPLETE:"ACP",BUTTON_LIST:"BTL",BUTTON:"BTN",CHECKBOX:"CHK",CHIP:"CHI",COMBOBOX:"CMB",DATE:"CAL",ICON:"ICO",IMAGE:"IMG",INPUT_NUMBER:"INR",MEMO:"MEM",MULTI_AUTOCOMPLETE:"AML",RADIO:"RAD",SPOTLIGHT:"SPL",SWITCH:"SWT",TEXT_FIELD:"ITX",TIME:"TIM",PASSWORD:"PWD"},Gr=r=>r.t=="D8",Kr=r=>r.t=="I1",qr=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 Qe{constructor(e,t){de(this,"class");de(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Qe(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 zr(r,e){if(Rt(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),We(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)),We(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)),xt(o,u,parseInt(l))&&We(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)),xt(f,u,parseInt(l))&&We(t)?t:r}}return r}function Rt(r){return/^\d{4}-\d{2}-\d{2}$/.test(r)&&r.length===10}function We(r){return r instanceof Date&&!isNaN(r.getTime())}function Jr(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 xt(n,t-1,e)}function xt(r,e,t){const n=[31,Xr(t)?29:28,31,30,31,30,31,31,30,31,30,31];return!(e<0||e>11||r<1||r>n[e])}function Xr(r){return r%4===0&&(r%100!==0||r%400===0)}function Zr(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 et{constructor(e,t){de(this,"class");de(this,"date");this.class=e,this.date=t}static fromDataObj(e){const t=Nt.get(`${e.t}${e.p}`);if(t)return new et(e,t.legacyToIso(e.k));throw new Error(`Date creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=Nt.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 Nt=new Map([["D8*YYMD",{legacyToIso(r){return Jr(r)&&`${r.substring(0,4)}-${r.substring(4,6)}-${r.substring(6,8)}`||r},isoToLegacy(r){return Rt(r)&&r.replaceAll("-","")||r}}]]),_e=(r,e)=>{O.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 ot({position:r="bottom",enabled:e=!0}){const t=O.useRef(null),n=O.useRef(null),[s,a]=O.useState(0),i=O.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 x=l+window.scrollY,v=f+window.scrollX;switch(r){case"top":x-=m;break;case"bottom":x+=d;break;case"left":v-=h;break;case"right":v+=u;break}requestAnimationFrame(()=>{c.style.transform=`translate(${v}px, ${x}px)`,c.style.opacity="1"})},[r]);return O.useLayoutEffect(()=>{if(!e)return;const o=requestAnimationFrame(()=>{i()}),c=new MutationObserver(()=>{n.current&&i()});return n.current&&c.observe(n.current,{childList:!0,subtree:!0}),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),()=>{cancelAnimationFrame(o),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),c.disconnect()}},[i,e]),{anchorRef:t,targetRef:n,anchorWidth:s}}const Ie=(r,e,t)=>{if(r=="")return"";if(t)switch(t){case"CodeOnly":return r;case"DescOnly":return e||"";case"Both":return`${r} - ${e}`}return r},wr=({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 g.jsx("label",{className:s.container,id:n,children:r})};function Qr(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 tt(){return tt=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},tt.apply(null,arguments)}function St(r,e){return St=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},St(r,e)}function en(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,St(r,e)}function ft(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 Be={};/*!
23
23
  * content-type
24
24
  * Copyright(c) 2015 Douglas Christopher Wilson
25
25
  * MIT Licensed
26
- */var Nt;function en(){if(Nt)return He;Nt=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-]+$/;He.format=i,He.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 v,b=Object.keys(d).sort(),w=0;w<b.length;w++){if(v=b[w],!t.test(v))throw new TypeError("invalid parameter name");h+="; "+v+"="+l(d[v])}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 v=new f(h.toLowerCase());if(m!==-1){var b,w,E;for(r.lastIndex=m;w=r.exec(d);){if(w.index!==m)throw new TypeError("invalid parameter format");m+=w[0].length,b=w[1].toLowerCase(),E=w[2],E.charCodeAt(0)===34&&(E=E.slice(1,-1),E.indexOf("\\")!==-1&&(E=E.replace(n,"$1"))),v.parameters[b]=E}if(m!==d.length)throw new TypeError("invalid parameter format")}return v}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 He}var tn=en(),Re=new Map,wr=function(e){return e.cloneNode(!0)},Mt=function(){return window.location.protocol==="file:"},Er=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=tn.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(Mt()?"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||Mt()&&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()},be={},Ft=function(e,t){be[e]=be[e]||[],be[e].push(t)},rn=function(e){for(var t=function(i,o){setTimeout(function(){if(Array.isArray(be[e])){var c=Re.get(e),l=be[e][i];c instanceof SVGSVGElement&&l(null,wr(c)),c instanceof Error&&l(c),i===be[e].length-1&&delete be[e]}},0)},n=0,s=be[e].length;n<s;n++)t(n)},nn=function(e,t,n){if(Re.has(e)){var s=Re.get(e);if(s===void 0){Ft(e,n);return}if(s instanceof SVGSVGElement){n(null,wr(s));return}}Re.set(e,void 0),Ft(e,n),Er(e,t,function(a,i){var o;a?Re.set(e,a):((o=i.responseXML)===null||o===void 0?void 0:o.documentElement)instanceof SVGSVGElement&&Re.set(e,i.responseXML.documentElement),rn(e)})},sn=function(e,t,n){Er(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)})},an=0,on=function(){return++an},me=[],Vt={},ln="http://www.w3.org/2000/svg",ft="http://www.w3.org/1999/xlink",Yt=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(me.indexOf(e)!==-1){me.splice(me.indexOf(e),1),e=null;return}me.push(e),e.setAttribute("src","");var l=s?nn:sn;l(c,a,function(f,u){if(!u){me.splice(me.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 v=e.getAttribute("height");v&&u.setAttribute("height",v);var b=Array.from(new Set(ut(ut(ut([],(u.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();u.setAttribute("class",b);var w=e.getAttribute("style");w&&u.setAttribute("style",w),u.setAttribute("data-src",c);var E=[].filter.call(e.attributes,function(Z){return/^data-\w[\w-]*$/.test(Z.name)});if(Array.prototype.forEach.call(E,function(Z){Z.name&&Z.value&&u.setAttribute(Z.name,Z.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,g,_,A,$;Object.keys(R).forEach(function(Z){S=Z,_=R[Z],g=u.querySelectorAll(S+"[id]");for(var F=function(P,j){A=g[P].id,$=A+"-"+on();var k;Array.prototype.forEach.call(_,function(U){k=u.querySelectorAll("["+U+'*="'+A+'"]');for(var X=0,te=k.length;X<te;X++){var ne=k[X].getAttribute(U);ne&&!ne.match(new RegExp('url\\("?#'+A+'"?\\)'))||k[X].setAttribute(U,"url(#"+$+")")}});for(var V=u.querySelectorAll("[*|href]"),Y=[],M=0,J=V.length;M<J;M++){var B=V[M].getAttributeNS(ft,"href");B&&B.toString()==="#"+g[P].id&&Y.push(V[M])}for(var se=0,I=Y.length;se<I;se++)Y[se].setAttributeNS(ft,"href","#"+$);g[P].id=$},p=0,x=g.length;p<x;p++)F(p)})}u.removeAttribute("xmlns:a");for(var C=u.querySelectorAll("script"),L=[],W,N,D=0,H=C.length;D<H;D++)N=C[D].getAttribute("type"),(!N||N==="application/ecmascript"||N==="application/javascript"||N==="text/javascript")&&(W=C[D].innerText||C[D].textContent,W&&L.push(W),u.removeChild(C[D]));if(L.length>0&&(t==="always"||t==="once"&&!Vt[c])){for(var z=0,K=L.length;z<K;z++)new Function(L[z])(window);Vt[c]=!0}var q=u.querySelectorAll("style");if(Array.prototype.forEach.call(q,function(Z){Z.textContent+=""}),u.setAttribute("xmlns",ln),u.setAttribute("xmlns:xlink",ft),i(u),!e.parentNode){me.splice(me.indexOf(e),1),e=null,o(new Error("Parent node is null"));return}e.parentNode.replaceChild(u,e),me.splice(me.indexOf(e),1),e=null,o(null,u)})},cn=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,v=h===void 0?!1:h,b=n.renumerateIRIElements,w=b===void 0?!0:b;if(e&&"length"in e)for(var E=0,R=0,S=e.length;R<S;R++)Yt(e[R],m,w,u,v,l,function(g,_){o(g,_),e&&"length"in e&&e.length===++E&&a(E)});else e?Yt(e,m,w,u,v,l,function(g,_){o(g,_),a(1),e=null}):a(0)},Be={exports:{}},Ge={exports:{}},Q={};/** @license React v16.13.1
26
+ */var Mt;function tn(){if(Mt)return Be;Mt=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-]+$/;Be.format=i,Be.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 x,v=Object.keys(d).sort(),w=0;w<v.length;w++){if(x=v[w],!t.test(x))throw new TypeError("invalid parameter name");h+="; "+x+"="+l(d[x])}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 x=new f(h.toLowerCase());if(m!==-1){var v,w,S;for(r.lastIndex=m;w=r.exec(d);){if(w.index!==m)throw new TypeError("invalid parameter format");m+=w[0].length,v=w[1].toLowerCase(),S=w[2],S.charCodeAt(0)===34&&(S=S.slice(1,-1),S.indexOf("\\")!==-1&&(S=S.replace(n,"$1"))),x.parameters[v]=S}if(m!==d.length)throw new TypeError("invalid parameter format")}return x}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 Be}var rn=tn(),Re=new Map,Er=function(e){return e.cloneNode(!0)},Ft=function(){return window.location.protocol==="file:"},Tr=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=rn.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(Ft()?"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||Ft()&&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()},be={},Vt=function(e,t){be[e]=be[e]||[],be[e].push(t)},nn=function(e){for(var t=function(i,o){setTimeout(function(){if(Array.isArray(be[e])){var c=Re.get(e),l=be[e][i];c instanceof SVGSVGElement&&l(null,Er(c)),c instanceof Error&&l(c),i===be[e].length-1&&delete be[e]}},0)},n=0,s=be[e].length;n<s;n++)t(n)},sn=function(e,t,n){if(Re.has(e)){var s=Re.get(e);if(s===void 0){Vt(e,n);return}if(s instanceof SVGSVGElement){n(null,Er(s));return}}Re.set(e,void 0),Vt(e,n),Tr(e,t,function(a,i){var o;a?Re.set(e,a):((o=i.responseXML)===null||o===void 0?void 0:o.documentElement)instanceof SVGSVGElement&&Re.set(e,i.responseXML.documentElement),nn(e)})},an=function(e,t,n){Tr(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)})},on=0,ln=function(){return++on},ge=[],Yt={},cn="http://www.w3.org/2000/svg",dt="http://www.w3.org/1999/xlink",Ut=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(ge.indexOf(e)!==-1){ge.splice(ge.indexOf(e),1),e=null;return}ge.push(e),e.setAttribute("src","");var l=s?sn:an;l(c,a,function(f,u){if(!u){ge.splice(ge.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 x=e.getAttribute("height");x&&u.setAttribute("height",x);var v=Array.from(new Set(ft(ft(ft([],(u.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();u.setAttribute("class",v);var w=e.getAttribute("style");w&&u.setAttribute("style",w),u.setAttribute("data-src",c);var S=[].filter.call(e.attributes,function(Z){return/^data-\w[\w-]*$/.test(Z.name)});if(Array.prototype.forEach.call(S,function(Z){Z.name&&Z.value&&u.setAttribute(Z.name,Z.value)}),n){var $={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"]},R,y,P,E,T;Object.keys($).forEach(function(Z){R=Z,P=$[Z],y=u.querySelectorAll(R+"[id]");for(var M=function(A,C){E=y[A].id,T=E+"-"+ln();var L;Array.prototype.forEach.call(P,function(W){L=u.querySelectorAll("["+W+'*="'+E+'"]');for(var X=0,te=L.length;X<te;X++){var ne=L[X].getAttribute(W);ne&&!ne.match(new RegExp('url\\("?#'+E+'"?\\)'))||L[X].setAttribute(W,"url(#"+T+")")}});for(var Y=u.querySelectorAll("[*|href]"),U=[],V=0,J=Y.length;V<J;V++){var K=Y[V].getAttributeNS(dt,"href");K&&K.toString()==="#"+y[A].id&&U.push(Y[V])}for(var se=0,N=U.length;se<N;se++)U[se].setAttributeNS(dt,"href","#"+T);y[A].id=T},p=0,b=y.length;p<b;p++)M(p)})}u.removeAttribute("xmlns:a");for(var _=u.querySelectorAll("script"),I=[],B,k,j=0,F=_.length;j<F;j++)k=_[j].getAttribute("type"),(!k||k==="application/ecmascript"||k==="application/javascript"||k==="text/javascript")&&(B=_[j].innerText||_[j].textContent,B&&I.push(B),u.removeChild(_[j]));if(I.length>0&&(t==="always"||t==="once"&&!Yt[c])){for(var H=0,G=I.length;H<G;H++)new Function(I[H])(window);Yt[c]=!0}var z=u.querySelectorAll("style");if(Array.prototype.forEach.call(z,function(Z){Z.textContent+=""}),u.setAttribute("xmlns",cn),u.setAttribute("xmlns:xlink",dt),i(u),!e.parentNode){ge.splice(ge.indexOf(e),1),e=null,o(new Error("Parent node is null"));return}e.parentNode.replaceChild(u,e),ge.splice(ge.indexOf(e),1),e=null,o(null,u)})},un=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,x=h===void 0?!1:h,v=n.renumerateIRIElements,w=v===void 0?!0:v;if(e&&"length"in e)for(var S=0,$=0,R=e.length;$<R;$++)Ut(e[$],m,w,u,x,l,function(y,P){o(y,P),e&&"length"in e&&e.length===++S&&a(S)});else e?Ut(e,m,w,u,x,l,function(y,P){o(y,P),a(1),e=null}):a(0)},He={exports:{}},Ge={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 Ut;function un(){if(Ut)return Q;Ut=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,v=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function R(g){if(typeof g=="object"&&g!==null){var _=g.$$typeof;switch(_){case e:switch(g=g.type,g){case c:case l:case n:case a:case s:case u:return g;default:switch(g=g&&g.$$typeof,g){case o:case f:case h:case m:case i:return g;default:return _}}case t:return _}}}function S(g){return R(g)===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(g){return S(g)||R(g)===c},Q.isConcurrentMode=S,Q.isContextConsumer=function(g){return R(g)===o},Q.isContextProvider=function(g){return R(g)===i},Q.isElement=function(g){return typeof g=="object"&&g!==null&&g.$$typeof===e},Q.isForwardRef=function(g){return R(g)===f},Q.isFragment=function(g){return R(g)===n},Q.isLazy=function(g){return R(g)===h},Q.isMemo=function(g){return R(g)===m},Q.isPortal=function(g){return R(g)===t},Q.isProfiler=function(g){return R(g)===a},Q.isStrictMode=function(g){return R(g)===s},Q.isSuspense=function(g){return R(g)===u},Q.isValidElementType=function(g){return typeof g=="string"||typeof g=="function"||g===n||g===l||g===a||g===s||g===u||g===d||typeof g=="object"&&g!==null&&(g.$$typeof===h||g.$$typeof===m||g.$$typeof===i||g.$$typeof===o||g.$$typeof===f||g.$$typeof===b||g.$$typeof===w||g.$$typeof===E||g.$$typeof===v)},Q.typeOf=R,Q}var ee={};/** @license React v16.13.1
33
+ */var Wt;function fn(){if(Wt)return Q;Wt=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,x=r?Symbol.for("react.block"):60121,v=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,S=r?Symbol.for("react.scope"):60119;function $(y){if(typeof y=="object"&&y!==null){var P=y.$$typeof;switch(P){case e:switch(y=y.type,y){case c:case l:case n:case a:case s:case u:return y;default:switch(y=y&&y.$$typeof,y){case o:case f:case h:case m:case i:return y;default:return P}}case t:return P}}}function R(y){return $(y)===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(y){return R(y)||$(y)===c},Q.isConcurrentMode=R,Q.isContextConsumer=function(y){return $(y)===o},Q.isContextProvider=function(y){return $(y)===i},Q.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===e},Q.isForwardRef=function(y){return $(y)===f},Q.isFragment=function(y){return $(y)===n},Q.isLazy=function(y){return $(y)===h},Q.isMemo=function(y){return $(y)===m},Q.isPortal=function(y){return $(y)===t},Q.isProfiler=function(y){return $(y)===a},Q.isStrictMode=function(y){return $(y)===s},Q.isSuspense=function(y){return $(y)===u},Q.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===n||y===l||y===a||y===s||y===u||y===d||typeof y=="object"&&y!==null&&(y.$$typeof===h||y.$$typeof===m||y.$$typeof===i||y.$$typeof===o||y.$$typeof===f||y.$$typeof===v||y.$$typeof===w||y.$$typeof===S||y.$$typeof===x)},Q.typeOf=$,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 Wt;function fn(){return Wt||(Wt=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,v=r?Symbol.for("react.block"):60121,b=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===u||I===d||typeof I=="object"&&I!==null&&(I.$$typeof===h||I.$$typeof===m||I.$$typeof===i||I.$$typeof===o||I.$$typeof===f||I.$$typeof===b||I.$$typeof===w||I.$$typeof===E||I.$$typeof===v)}function S(I){if(typeof I=="object"&&I!==null){var U=I.$$typeof;switch(U){case e:var X=I.type;switch(X){case c:case l:case n:case a:case s:case u:return X;default:var te=X&&X.$$typeof;switch(te){case o:case f:case h:case m:case i:return te;default:return U}}case t:return U}}}var g=c,_=l,A=o,$=i,C=e,L=f,W=n,N=h,D=m,H=t,z=a,K=s,q=u,Z=!1;function F(I){return Z||(Z=!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 x(I){return S(I)===o}function O(I){return S(I)===i}function P(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function j(I){return S(I)===f}function k(I){return S(I)===n}function V(I){return S(I)===h}function Y(I){return S(I)===m}function M(I){return S(I)===t}function J(I){return S(I)===a}function B(I){return S(I)===s}function se(I){return S(I)===u}ee.AsyncMode=g,ee.ConcurrentMode=_,ee.ContextConsumer=A,ee.ContextProvider=$,ee.Element=C,ee.ForwardRef=L,ee.Fragment=W,ee.Lazy=N,ee.Memo=D,ee.Portal=H,ee.Profiler=z,ee.StrictMode=K,ee.Suspense=q,ee.isAsyncMode=F,ee.isConcurrentMode=p,ee.isContextConsumer=x,ee.isContextProvider=O,ee.isElement=P,ee.isForwardRef=j,ee.isFragment=k,ee.isLazy=V,ee.isMemo=Y,ee.isPortal=M,ee.isProfiler=J,ee.isStrictMode=B,ee.isSuspense=se,ee.isValidElementType=R,ee.typeOf=S}()),ee}var Ht;function Tr(){return Ht||(Ht=1,process.env.NODE_ENV==="production"?Ge.exports=un():Ge.exports=fn()),Ge.exports}/*
40
+ */var Bt;function dn(){return Bt||(Bt=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,x=r?Symbol.for("react.block"):60121,v=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,S=r?Symbol.for("react.scope"):60119;function $(N){return typeof N=="string"||typeof N=="function"||N===n||N===l||N===a||N===s||N===u||N===d||typeof N=="object"&&N!==null&&(N.$$typeof===h||N.$$typeof===m||N.$$typeof===i||N.$$typeof===o||N.$$typeof===f||N.$$typeof===v||N.$$typeof===w||N.$$typeof===S||N.$$typeof===x)}function R(N){if(typeof N=="object"&&N!==null){var W=N.$$typeof;switch(W){case e:var X=N.type;switch(X){case c:case l:case n:case a:case s:case u:return X;default:var te=X&&X.$$typeof;switch(te){case o:case f:case h:case m:case i:return te;default:return W}}case t:return W}}}var y=c,P=l,E=o,T=i,_=e,I=f,B=n,k=h,j=m,F=t,H=a,G=s,z=u,Z=!1;function M(N){return Z||(Z=!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(N)||R(N)===c}function p(N){return R(N)===l}function b(N){return R(N)===o}function D(N){return R(N)===i}function A(N){return typeof N=="object"&&N!==null&&N.$$typeof===e}function C(N){return R(N)===f}function L(N){return R(N)===n}function Y(N){return R(N)===h}function U(N){return R(N)===m}function V(N){return R(N)===t}function J(N){return R(N)===a}function K(N){return R(N)===s}function se(N){return R(N)===u}ee.AsyncMode=y,ee.ConcurrentMode=P,ee.ContextConsumer=E,ee.ContextProvider=T,ee.Element=_,ee.ForwardRef=I,ee.Fragment=B,ee.Lazy=k,ee.Memo=j,ee.Portal=F,ee.Profiler=H,ee.StrictMode=G,ee.Suspense=z,ee.isAsyncMode=M,ee.isConcurrentMode=p,ee.isContextConsumer=b,ee.isContextProvider=D,ee.isElement=A,ee.isForwardRef=C,ee.isFragment=L,ee.isLazy=Y,ee.isMemo=U,ee.isPortal=V,ee.isProfiler=J,ee.isStrictMode=K,ee.isSuspense=se,ee.isValidElementType=$,ee.typeOf=R}()),ee}var Ht;function Or(){return Ht||(Ht=1,process.env.NODE_ENV==="production"?Ge.exports=fn():Ge.exports=dn()),Ge.exports}/*
41
41
  object-assign
42
42
  (c) Sindre Sorhus
43
43
  @license MIT
44
- */var dt,Bt;function dn(){if(Bt)return dt;Bt=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 dt=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},dt}var pt,Gt;function Rt(){if(Gt)return pt;Gt=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return pt=r,pt}var ht,Kt;function Or(){return Kt||(Kt=1,ht=Function.call.bind(Object.prototype.hasOwnProperty)),ht}var mt,qt;function pn(){if(qt)return mt;qt=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var e=Rt(),t={},n=Or();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={})},mt=s,mt}var gt,zt;function hn(){if(zt)return gt;zt=1;var r=Tr(),e=dn(),t=Rt(),n=Or(),s=pn(),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 gt=function(o,c){var l=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function u(p){var x=p&&(l&&p[l]||p[f]);if(typeof x=="function")return x}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:R,element:S(),elementType:g(),instanceOf:_,node:L(),objectOf:$,oneOf:A,oneOfType:C,shape:N,exact:D};function h(p,x){return p===x?p!==0||1/p===1/x:p!==p&&x!==x}function v(p,x){this.message=p,this.data=x&&typeof x=="object"?x:{},this.stack=""}v.prototype=Error.prototype;function b(p){if(process.env.NODE_ENV!=="production")var x={},O=0;function P(k,V,Y,M,J,B,se){if(M=M||d,B=B||Y,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 U=M+":"+Y;!x[U]&&O<3&&(a("You are manually calling a React.PropTypes validation function for the `"+B+"` 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."),x[U]=!0,O++)}}return V[Y]==null?k?V[Y]===null?new v("The "+J+" `"+B+"` is marked as required "+("in `"+M+"`, but its value is `null`.")):new v("The "+J+" `"+B+"` is marked as required in "+("`"+M+"`, but its value is `undefined`.")):null:p(V,Y,M,J,B)}var j=P.bind(null,!1);return j.isRequired=P.bind(null,!0),j}function w(p){function x(O,P,j,k,V,Y){var M=O[P],J=K(M);if(J!==p){var B=q(M);return new v("Invalid "+k+" `"+V+"` of type "+("`"+B+"` supplied to `"+j+"`, expected ")+("`"+p+"`."),{expectedType:p})}return null}return b(x)}function E(){return b(i)}function R(p){function x(O,P,j,k,V){if(typeof p!="function")return new v("Property `"+V+"` of component `"+j+"` has invalid PropType notation inside arrayOf.");var Y=O[P];if(!Array.isArray(Y)){var M=K(Y);return new v("Invalid "+k+" `"+V+"` of type "+("`"+M+"` supplied to `"+j+"`, expected an array."))}for(var J=0;J<Y.length;J++){var B=p(Y,J,j,k,V+"["+J+"]",t);if(B instanceof Error)return B}return null}return b(x)}function S(){function p(x,O,P,j,k){var V=x[O];if(!o(V)){var Y=K(V);return new v("Invalid "+j+" `"+k+"` of type "+("`"+Y+"` supplied to `"+P+"`, expected a single ReactElement."))}return null}return b(p)}function g(){function p(x,O,P,j,k){var V=x[O];if(!r.isValidElementType(V)){var Y=K(V);return new v("Invalid "+j+" `"+k+"` of type "+("`"+Y+"` supplied to `"+P+"`, expected a single ReactElement type."))}return null}return b(p)}function _(p){function x(O,P,j,k,V){if(!(O[P]instanceof p)){var Y=p.name||d,M=F(O[P]);return new v("Invalid "+k+" `"+V+"` of type "+("`"+M+"` supplied to `"+j+"`, expected ")+("instance of `"+Y+"`."))}return null}return b(x)}function A(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 x(O,P,j,k,V){for(var Y=O[P],M=0;M<p.length;M++)if(h(Y,p[M]))return null;var J=JSON.stringify(p,function(se,I){var U=q(I);return U==="symbol"?String(I):I});return new v("Invalid "+k+" `"+V+"` of value `"+String(Y)+"` "+("supplied to `"+j+"`, expected one of "+J+"."))}return b(x)}function $(p){function x(O,P,j,k,V){if(typeof p!="function")return new v("Property `"+V+"` of component `"+j+"` has invalid PropType notation inside objectOf.");var Y=O[P],M=K(Y);if(M!=="object")return new v("Invalid "+k+" `"+V+"` of type "+("`"+M+"` supplied to `"+j+"`, expected an object."));for(var J in Y)if(n(Y,J)){var B=p(Y,J,j,k,V+"."+J,t);if(B instanceof Error)return B}return null}return b(x)}function C(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 x=0;x<p.length;x++){var O=p[x];if(typeof O!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Z(O)+" at index "+x+"."),i}function P(j,k,V,Y,M){for(var J=[],B=0;B<p.length;B++){var se=p[B],I=se(j,k,V,Y,M,t);if(I==null)return null;I.data&&n(I.data,"expectedType")&&J.push(I.data.expectedType)}var U=J.length>0?", expected one of type ["+J.join(", ")+"]":"";return new v("Invalid "+Y+" `"+M+"` supplied to "+("`"+V+"`"+U+"."))}return b(P)}function L(){function p(x,O,P,j,k){return H(x[O])?null:new v("Invalid "+j+" `"+k+"` supplied to "+("`"+P+"`, expected a ReactNode."))}return b(p)}function W(p,x,O,P,j){return new v((p||"React class")+": "+x+" type `"+O+"."+P+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+j+"`.")}function N(p){function x(O,P,j,k,V){var Y=O[P],M=K(Y);if(M!=="object")return new v("Invalid "+k+" `"+V+"` of type `"+M+"` "+("supplied to `"+j+"`, expected `object`."));for(var J in p){var B=p[J];if(typeof B!="function")return W(j,k,V,J,q(B));var se=B(Y,J,j,k,V+"."+J,t);if(se)return se}return null}return b(x)}function D(p){function x(O,P,j,k,V){var Y=O[P],M=K(Y);if(M!=="object")return new v("Invalid "+k+" `"+V+"` of type `"+M+"` "+("supplied to `"+j+"`, expected `object`."));var J=e({},O[P],p);for(var B in J){var se=p[B];if(n(p,B)&&typeof se!="function")return W(j,k,V,B,q(se));if(!se)return new v("Invalid "+k+" `"+V+"` key `"+B+"` supplied to `"+j+"`.\nBad object: "+JSON.stringify(O[P],null," ")+`
45
- Valid keys: `+JSON.stringify(Object.keys(p),null," "));var I=se(Y,B,j,k,V+"."+B,t);if(I)return I}return null}return b(x)}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 x=u(p);if(x){var O=x.call(p),P;if(x!==p.entries){for(;!(P=O.next()).done;)if(!H(P.value))return!1}else for(;!(P=O.next()).done;){var j=P.value;if(j&&!H(j[1]))return!1}}else return!1;return!0;default:return!1}}function z(p,x){return p==="symbol"?!0:x?x["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&x instanceof Symbol:!1}function K(p){var x=typeof p;return Array.isArray(p)?"array":p instanceof RegExp?"object":z(x,p)?"symbol":x}function q(p){if(typeof p>"u"||p===null)return""+p;var x=K(p);if(x==="object"){if(p instanceof Date)return"date";if(p instanceof RegExp)return"regexp"}return x}function Z(p){var x=q(p);switch(x){case"array":case"object":return"an "+x;case"boolean":case"date":case"regexp":return"a "+x;default:return x}}function F(p){return!p.constructor||!p.constructor.name?d:p.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},gt}var yt,Jt;function mn(){if(Jt)return yt;Jt=1;var r=Rt();function e(){}function t(){}return t.resetWarningCache=e,yt=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},yt}var Xt;function gn(){if(Xt)return Be.exports;if(Xt=1,process.env.NODE_ENV!=="production"){var r=Tr(),e=!0;Be.exports=hn()(r.isElement,e)}else Be.exports=mn()();return Be.exports}var ie=gn(),yn=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},vn=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},bn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Ke="http://www.w3.org/2000/svg",Zt="http://www.w3.org/1999/xlink",je=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}Qr(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof yn(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,v=this.props.afterInjection,b=this.props.wrapper,w,E;b==="svg"?(w=document.createElementNS(Ke,b),w.setAttribute("xmlns",Ke),w.setAttribute("xmlns:xlink",Zt),E=document.createElementNS(Ke,b)):(w=document.createElement(b),E=document.createElement(b)),w.appendChild(E),E.dataset.src=f,this.nonReactWrapper=this.reactWrapper.appendChild(w);var R=function(A){if(s.removeSVG(),!s._isMounted){m(A);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){m(A)})},S=function(A,$){if(A){R(A);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{v($)}catch(C){R(C)}})},g=function(A){if(A.setAttribute("role","img"),i){var $=A.querySelector(":scope > desc");$&&A.removeChild($);var C=document.createElement("desc");C.innerHTML=i,A.prepend(C)}if(u){var L=A.querySelector(":scope > title");L&&A.removeChild(L);var W=document.createElement("title");W.innerHTML=u,A.prepend(W)}try{h(A)}catch(N){R(N)}};cn(E,{afterEach:S,beforeEach:g,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;vn(tt({},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=Zr(s,bn),l=o;return Ye.createElement(l,tt({},c,{ref:this.refCallback},o==="svg"?{xmlns:Ke,xmlnsXlink:Zt}:{}),this.state.isLoading&&i&&Ye.createElement(i,null),this.state.hasError&&a&&Ye.createElement(a,null))},e}(Ye.Component);je.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};je.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 St={assets:"/"};const xn=r=>{St={...St,...r}},Qt=r=>`${St.assets}/${r}`.replace(/\/+/g,"/"),oe=T.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,tabIndex:d})=>{const[m,h]=T.useState(r),v=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),b=v&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),w=Qt(`assets/svg/${r}.svg`),E=Qt(`assets/svg/${n}.svg`),R={img:`${l?"smp-image-interactable":""}`,svg:`smp-icon ${i?`smp-icon-${i}`:""} ${o?"smp-icon-rotated":""} ${l?"smp-icon-interactable":""} ${f?"smp-icon-spin":""}`},S=()=>{!a&&l&&c&&c()},g=_=>{!a&&l&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),S())};return y.jsx(y.Fragment,{children:b?y.jsx(je,{src:r,fallback:()=>y.jsx(je,{src:E,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:R.svg,onClick:S,onKeyDown:g,tabIndex:d}):v?y.jsx("img",{src:m,width:e||"16px",height:t||"auto",alt:u,onError:()=>h(E),onClick:S,className:R.img,title:u,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&S()}}):y.jsx(je,{src:w,fallback:()=>y.jsx(je,{src:E,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:R.svg,onClick:S,onKeyDown:g,tabIndex:d})})}),he={"smp-textfield-wrapper":"_smp-textfield-wrapper_mmttf_4","smp-textfield":"_smp-textfield_mmttf_4","smp-textfield-extraSmall":"_smp-textfield-extraSmall_mmttf_30","smp-textfield-small":"_smp-textfield-small_mmttf_35","smp-textfield-medium":"_smp-textfield-medium_mmttf_40","smp-textfield-large":"_smp-textfield-large_mmttf_45","smp-textfield-extraLarge":"_smp-textfield-extraLarge_mmttf_50","smp-textfield-input":"_smp-textfield-input_mmttf_56","smp-textfield-outlined":"_smp-textfield-outlined_mmttf_79","smp-textfield-danger":"_smp-textfield-danger_mmttf_90","smp-textfield-readOnly":"_smp-textfield-readOnly_mmttf_94","smp-textfield-variant-notSelectable":"_smp-textfield-variant-notSelectable_mmttf_99","smp-textfield-disabled":"_smp-textfield-disabled_mmttf_109","smp-textfield-fullWidth":"_smp-textfield-fullWidth_mmttf_118"},Ee=({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:v,inputType:b="text",ariaLabel:w="input field",label:E,helperText:R=!1,error:S,appearance:g="base",fullWidth:_=!1,_dataComponent:A="textfield",width:$})=>{const C=T.useId(),L=`${C}-helper`,W=S?"danger":l,N=S||l=="danger"?"error":o,D=R||!!S,H=q=>{s==null||s(q.target.value)},z={wrapper:`${he["smp-textfield-wrapper"]} ${_?he["smp-textfield-fullWidth"]:""}`,container:`${he["smp-textfield"]} ${r?he["smp-textfield-disabled"]:""} ${a?he["smp-textfield-placeholder"]:""} ${c?he[`smp-textfield-${c}`]:""} ${W?he[`smp-textfield-${W}`]:""} ${g?he[`smp-textfield-${g}`]:""} ${i?"":he["smp-textfield-readOnly"]}`,input:`${he["smp-textfield-input"]}`};if(f&&(f!=="notSelectable"||i)){const q=he[`smp-textfield-variant-${f}`];q&&(z.container+=` ${q}`)}const K=$?{"--smp-textField-width-base":$}:void 0;return y.jsxs("div",{className:z.wrapper,"data-component":A,children:[E&&y.jsx(De,{label:E,disabled:r,htmlFor:C}),y.jsxs("div",{className:z.container,ref:m,style:K,children:[t&&y.jsx(oe,{icon:t,disabled:r}),y.jsx("input",{id:C,type:b,value:e,placeholder:a,onChange:H,onBlur:n,className:z.input,disabled:r,readOnly:!i,onKeyDown:v,"aria-label":w,ref:h,"aria-describedby":D?L:void 0}),N&&y.jsx(oe,{icon:N,disabled:r,state:W,onClick:d,rotated:u,isInteractable:i,tabIndex:0})]}),D&&y.jsx(Sr,{helperText:S,disabled:r,state:W,id:L})]})};function Rr({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=T.useState(0),i=T.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=T.useCallback(m=>{const h=m.target.scrollTop;a(h)},[]),d=m=>{if(!i.current)return;const h=m*e,v=h+e,b=i.current,w=b.scrollTop,E=w+t;h<w?b.scrollTop=h:v>E&&(b.scrollTop=v-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 qe={"smp-list":"_smp-list_t8eqj_1","smp-list-container":"_smp-list-container_t8eqj_10","smp-list-listItem":"_smp-list-listItem_t8eqj_15"},Sn=10,jr=({id:r,options:e,displayMode:t,ref:n,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:c,onKeyDown:l,isOpen:f})=>{var N;const[u,d]=T.useState(""),m=24,[h,v]=T.useState(a!==null?a:-1),b=s!==void 0?s:e.length>Sn,w=u?e.filter(D=>D.label.toLowerCase().includes(u.toLowerCase())):e,E=D=>{d(D)},{virtualItems:R,containerProps:S,innerProps:g,scrollToIndex:_}=Rr({items:w,itemHeight:m,containerHeight:200,overscan:5});T.useEffect(()=>{a!==null&&a!==h&&v(a)},[a]),T.useEffect(()=>{h>=0&&h<w.length&&_(h)},[h,w]);const A=D=>{if(D.key==="ArrowDown"||D.key==="ArrowUp"){D.preventDefault();let H=h;D.key==="ArrowDown"?H=h<w.length-1?h+1:0:D.key==="ArrowUp"&&(H=h>0?h-1:w.length-1),v(H)}else D.key==="Enter"?h>=0&&h<w.length&&(c==null||c(w[h])):D.key==="Escape"&&(D.preventDefault(),D.stopPropagation());l&&l(D)},$=D=>{A(D)},C=D=>{A(D)},L={wrapper:`${qe["smp-list"]}`,container:`${qe["smp-list-container"]}`,virtualScroll:`${qe["smp-list-virtualScroll"]}`,listItem:`${qe["smp-list-listItem"]}`},W=T.useRef(null);return T.useEffect(()=>{f&&(W!=null&&W.current)&&W.current.focus()},[f,W]),y.jsxs("div",{id:r,ref:n,className:L.wrapper,"data-component":"list",style:{width:o},children:[b&&y.jsx(Ee,{bindValue:u,placeholder:"Search...",onChange:E,onKeyDown:$,inputRef:W}),y.jsx("div",{...S,className:L.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:C,"aria-activedescendant":h>=0&&h<w.length?(N=w[h])==null?void 0:N.id:void 0,children:y.jsx("div",{...g,className:L.virtualScroll,children:R.map(({item:D,index:H,offsetTop:z})=>{const K=i.includes(D.id);return y.jsxs("li",{role:"option",id:D.id,"aria-selected":h===H?"true":"false",tabIndex:-1,className:`${L.listItem} ${h===H?"selected-item":""}`,"aria-label":D.id+"-"+D.label,style:{height:`${m}px`,lineHeight:`calc(${m}px - 2*2px)`,transform:`translateY(${z}px)`},onClick:()=>{c==null||c(D),v(H)},children:[Le(D.id,D.label,t),K&&y.jsx(oe,{icon:"check",width:16})]},D.id)})})})]})},jt=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=T.useState(Le(e,t,r));return T.useEffect(()=>{a(e)},[e]),T.useEffect(()=>{a(Le(e,t,r))},[t,r]),y.jsx(Ee,{...n,bindValue:s})},wn=r=>{const e=T.useRef(null);return T.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},r)}};function ot({children:r}){const[e,t]=T.useState(!1);return T.useEffect(()=>{t(!0)},[]),e?Fr.createPortal(r,document.body):null}const Dt=({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=T.useRef(null),[v,b]=T.useState(r),[w,E]=T.useState(e),[R,S]=T.useState(!1),[g,_]=T.useState(t||[]),[A,$]=T.useState(0),[C,L]=T.useState([r]),{anchorRef:W,targetRef:N,anchorWidth:D}=it({position:"bottom",enabled:R}),H=T.useCallback(()=>{var p;S(!1),(p=h==null?void 0:h.current)==null||p.focus()},[]);ke(N,()=>H());const z=wn(400),K=p=>{p.length>=a?c&&u&&z(async()=>{const x=await u(c,p);_(x),$(x.length>0?0:-1),S(!0)}):H(),b(p),E(e),l||f==null||f(p,e)},q=p=>{l?(b(""),E("")):(b(p.id),E(p.label)),f==null||f(p.id,p.label);const x=g.findIndex(O=>O.id===p.id);$(x),L([p.id]),H()},Z=p=>{p.key==="Escape"&&(H(),$(-1))},F=p=>{if((p.key==="ArrowDown"||p.key==="ArrowUp")&&(p.preventDefault(),R)){const x=p.key==="ArrowDown"?(A+1)%g.length:(A-1+g.length)%g.length;$(x)}switch(p.key){case"Enter":A>=0&&A<g.length?q(g[A]):l&&(f==null||f(v,""),H(),b(""),E(""));break;case"Escape":H(),$(-1);break}};return y.jsxs("div",{"data-component":"autocomplete",children:[y.jsx(jt,{...m,bindValue:v,optionalDisplayValue:w,displayMode:n,isEditable:i,shapeIcon:"magnify",placeholder:o,ref:W,inputRef:h,onChange:K,onKeyDown:F,"aria-autocomplete":"list"}),R&&y.jsx(ot,{children:y.jsx(jr,{options:g,displayMode:s,onClick:q,ref:N,selectedIndex:A,activeIndex:d||C,width:D,showFilter:!1,onKeyDown:Z,isOpen:R})})]})},er=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],tr=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],Se=({label:r,bindValue:e,onClick:t,ariaLabel:n,icon:s,disabled:a,sizing:i="base",variant:o="primary",appearance:c="raised",showIcon:l=!0,showText:f=!0,fullWidth:u=!1,loading:d=!1,justify:m="center",title:h,optionalDisplayValue:v})=>{const b={container:`smp-button smp-button-container ${i?`smp-button-${i}`:""} ${o?`smp-buttonVariant-${o}`:""} ${c?`smp-buttonType-${c}`:""} ${u?"smp-button-fullWidth":""} smp-justifyContent-${m}`};return y.jsx("button",{"data-component":"button",className:b.container,onClick:t,"aria-label":n,disabled:a,"aria-busy":d,title:h||r||v,children:d?y.jsx(oe,{icon:"spinner",state:tr(o),spin:!0}):y.jsxs(y.Fragment,{children:[s&&l&&y.jsx(oe,{icon:s,disabled:a,state:tr(o),width:er(i),height:er(i)}),f&&y.jsx("span",{children:v||e})]})})},Dr=({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,v]=T.useState(r);T.useEffect(()=>{!h&&m&&e&&m(e,void 0).then(E=>v(E)).catch(E=>{console.error("Errore nel caricamento delle opzioni per ButtonList",E)})},[h,e,m]);const b={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${n}`},w=h==null?void 0:h.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:f,sizing:s,justify:u,onClick:()=>{d==null||d(E.id,E.fun)}};return y.jsx(Se,{...S},`button-${R}`)});return y.jsx("div",{role:"list","data-component":"button-list",className:b.container,children:w})},En={"smp-checkbox-wrapper":"_smp-checkbox-wrapper_z14lq_2"},_r=({bindValue:r,_dataComponent:e="checkbox",disabled:t,label:n,isEditable:s=!0,onChange:a,onBlur:i,variant:o="checkbox"})=>{const c=T.useId(),l=u=>{s&&a&&a(u.target.checked)},f={wrapper:`${En["smp-checkbox-wrapper"]}`};return y.jsxs("div",{className:f.wrapper,"data-component":e,children:[n&&y.jsx(De,{label:n,disabled:t,htmlFor:c}),y.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:l,onBlur:i,role:o==="switch"?"switch":"checkbox",id:c})]})},Tn={titleLarge:"h2",title:"h3",body:"h6",label:"label"},Ie=({variant:r="body",bindValue:e,color:t,...n})=>{const s=Tn[r],a={container:`smp-typography ${r?`smp-typography-${r}`:""} ${n.disabled?"smp-typography-disabled":""}`};return y.jsx(s,{className:a.container,disabled:n.disabled,style:{"--smp-typography-color-base":t},children:e})},_t=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,c]=T.useState(null),l={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},f=m=>{n==null||n(r.filter((h,v)=>v!==m))},u=m=>{c(m)},d=m=>{if(o===null||o===m)return;const h=[...r],[v]=h.splice(o,1);h.splice(m,0,v),n==null||n(h),c(null)};return y.jsx("div",{className:l.container,role:"list","data-component":"chip",children:r.flatMap((m,h)=>{const v=Le(m.bindValue,m.optionalDisplayValue,t),b=y.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&&y.jsx(oe,{icon:"drag_indicator_horizontal",isInteractable:!0}),y.jsx(Ie,{variant:"label",bindValue:v,color:s}),e&&y.jsx(oe,{icon:"close",isInteractable:!0,onClick:()=>f(h),color:s})]},`chip-${h}`),w=i&&h<r.length-1?y.jsx(oe,{icon:"chevron-right",color:s},`separator-${h}`):null;return[b,w].filter(Boolean)})})};function $t(r,e){const t=T.useRef(null);T.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 $r=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,isEditable:s,displayMode:a,listDisplayMode:i="Both",fun:o,onOptionsRequest:c,multiActiveIndex:l,...f})=>{const u=T.useRef(null),[d,m]=T.useState(!1),[h,v]=T.useState(t),[b,w]=T.useState(-1),[E,R]=T.useState([r]),S=T.useId(),{anchorRef:g,targetRef:_,anchorWidth:A}=it({position:"bottom",enabled:d}),$=T.useCallback(()=>{var D;m(!1),(D=u==null?void 0:u.current)==null||D.focus()},[]);ke(_,()=>$()),$t(d,_);const C=D=>{e==null||e(D.id,D.label);const H=h.findIndex(z=>z.id===D.id);w(H),R([D.id]),$()},L=D=>{D.key==="Escape"&&($(),w(-1))},W=D=>{(D.key==="ArrowDown"||D.key==="ArrowUp")&&(D.preventDefault(),N())},N=()=>{o&&c&&c(o,void 0).then(D=>{v(D),w(D.length>0?0:-1),m(!0)})};return y.jsxs("div",{role:"combobox","aria-expanded":d,"aria-controls":S,"aria-owns":S,"data-component":"combobox",children:[y.jsx(jt,{...f,bindValue:r,optionalDisplayValue:n,displayMode:a,onShapeIconClick:N,onKeyDown:W,shapeIcon:"arrow_drop_down",rotatedShapeIcon:d,isEditable:s,ref:g,inputRef:u,"aria-autocomplete":"list",variant:"notSelectable"}),d&&y.jsx(ot,{children:y.jsx(jr,{id:S,options:h,displayMode:i,ref:_,isOpen:d,selectedIndex:b,activeIndex:l||E,width:A,onClick:C,onKeyDown:L})})]})},G=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},rr=r=>r==null?"":""+r,On=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},Rn=/###/g,nr=r=>r&&r.indexOf("###")>-1?r.replace(Rn,"."):r,sr=r=>!r||G(r),Ae=(r,e,t)=>{const n=G(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(sr(r))return{};const a=nr(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return sr(r)?{}:{obj:r,k:nr(n[s])}},ar=(r,e,t)=>{const{obj:n,k:s}=Ae(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=Ae(r,i,Object);for(;o.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),o=Ae(r,i,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=t},jn=(r,e,t,n)=>{const{obj:s,k:a}=Ae(r,e,Object);s[a]=s[a]||[],s[a].push(t)},rt=(r,e)=>{const{obj:t,k:n}=Ae(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},Dn=(r,e,t)=>{const n=rt(r,t);return n!==void 0?n:rt(e,t)},Cr=(r,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?G(r[n])||r[n]instanceof String||G(e[n])||e[n]instanceof String?t&&(r[n]=e[n]):Cr(r[n],e[n],t):r[n]=e[n]);return r},Oe=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var _n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const $n=r=>G(r)?r.replace(/[&<>"'\/]/g,e=>_n[e]):r;class Cn{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 Pn=[" ",",","?","!",";"],An=new Cn(20),kn=(r,e,t)=>{e=e||"",t=t||"";const n=Pn.filter(i=>e.indexOf(i)<0&&t.indexOf(i)<0);if(n.length===0)return!0;const s=An.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},wt=(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},Ne=r=>r==null?void 0:r.replace("_","-"),Ln={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 nt{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Ln,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:(G(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new nt(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new nt(this.logger,e)}}var ge=new nt;class lt{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 ir extends lt{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):G(n)&&a?o.push(...n.split(a)):o.push(n)));const c=rt(this.data,o);return!c&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),c||!i||!G(n)?c:wt((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),ar(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)(G(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=rt(this.data,o)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?Cr(c,n,a):c={...c,...n},ar(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 Pr={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 or={},lr=r=>!G(r)&&typeof r!="boolean"&&typeof r!="number";class st extends lt{constructor(e,t={}){super(),On(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ge.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&&!kn(e,n,s);if(i&&!o){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:G(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:G(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 v=(m==null?void 0:m.usedKey)||o,b=(m==null?void 0:m.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&&!G(s.count),g=st.hasDefaultValue(s),_=S?this.pluralResolver.getSuffix(u,s.count,s):"",A=s.ordinal&&S?this.pluralResolver.getSuffix(u,s.count,{ordinal:!1}):"",$=S&&!s.ordinal&&s.count===0,C=$&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${_}`]||s[`defaultValue${A}`]||s.defaultValue;let L=h;R&&!h&&g&&(L=C);const W=lr(L),N=Object.prototype.toString.apply(L);if(R&&L&&W&&w.indexOf(N)<0&&!(G(E)&&Array.isArray(L))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const D=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,L,{...s,ns:c}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(m.res=D,m.usedParams=this.getUsedParamsDetails(s),m):D}if(i){const D=Array.isArray(L),H=D?[]:{},z=D?b:v;for(const K in L)if(Object.prototype.hasOwnProperty.call(L,K)){const q=`${z}${i}${K}`;g&&!h?H[K]=this.translate(q,{...s,defaultValue:lr(C)?C[K]:void 0,joinArrays:!1,ns:c}):H[K]=this.translate(q,{...s,joinArrays:!1,ns:c}),H[K]===q&&(H[K]=L[K])}h=H}}else if(R&&G(E)&&Array.isArray(h))h=h.join(E),h&&(h=this.extendTranslation(h,e,s,n));else{let D=!1,H=!1;!this.isValidLookup(h)&&g&&(D=!0,h=C),this.isValidLookup(h)||(H=!0,h=o);const K=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&H?void 0:h,q=g&&C!==h&&this.options.updateMissing;if(H||D||q){if(this.logger.log(q?"updateKey":"missingKey",u,l,o,q?C:h),i){const x=this.resolve(o,{...s,keySeparator:!1});x&&x.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 Z=[];const F=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&F&&F[0])for(let x=0;x<F.length;x++)Z.push(F[x]);else this.options.saveMissingTo==="all"?Z=this.languageUtils.toResolveHierarchy(s.lng||this.language):Z.push(s.lng||this.language);const p=(x,O,P)=>{var k;const j=g&&P!==h?P:K;this.options.missingKeyHandler?this.options.missingKeyHandler(x,l,O,j,q,s):(k=this.backendConnector)!=null&&k.saveMissing&&this.backendConnector.saveMissing(x,l,O,j,q,s),this.emit("missingKey",x,l,O,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&S?Z.forEach(x=>{const O=this.pluralResolver.getSuffixes(x,s);$&&s[`defaultValue${this.options.pluralSeparator}zero`]&&O.indexOf(`${this.options.pluralSeparator}zero`)<0&&O.push(`${this.options.pluralSeparator}zero`),O.forEach(P=>{p([x],o+P,s[`defaultValue${P}`]||C)})}):p(Z,o,C))}h=this.extendTranslation(h,e,s,m,n),H&&h===o&&this.options.appendNamespaceToMissingKey&&(h=`${l}${f}${o}`),(H||D)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${f}${o}`:o,D?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=G(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&&!G(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=G(i)?[i]:i;return e!=null&&(o!=null&&o.length)&&n.applyPostProcessor!==!1&&(e=Pr.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 G(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&&!G(t.count),m=d&&!t.ordinal&&t.count===0,h=t.context!==void 0&&(G(t.context)||typeof t.context=="number")&&t.context!=="",v=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(b=>{var w,E;this.isValidLookup(n)||(o=b,!or[`${v[0]}-${b}`]&&((w=this.utils)!=null&&w.hasLoadedNamespace)&&!((E=this.utils)!=null&&E.hasLoadedNamespace(o))&&(or[`${v[0]}-${b}`]=!0,this.logger.warn(`key "${s}" for languages "${v.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!!!")),v.forEach(R=>{var _;if(this.isValidLookup(n))return;i=R;const S=[f];if((_=this.i18nFormat)!=null&&_.addLookupKeys)this.i18nFormat.addLookupKeys(S,f,R,b,t);else{let A;d&&(A=this.pluralResolver.getSuffix(R,t.count,t));const $=`${this.options.pluralSeparator}zero`,C=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(S.push(f+A),t.ordinal&&A.indexOf(C)===0&&S.push(f+A.replace(C,this.options.pluralSeparator)),m&&S.push(f+$)),h){const L=`${f}${this.options.contextSeparator}${t.context}`;S.push(L),d&&(S.push(L+A),t.ordinal&&A.indexOf(C)===0&&S.push(L+A.replace(C,this.options.pluralSeparator)),m&&S.push(L+$))}}let g;for(;g=S.pop();)this.isValidLookup(n)||(a=g,n=this.getResource(R,b,g,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&&!G(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 cr{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ge.create("languageUtils")}getScriptPartFromCode(e){if(e=Ne(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=Ne(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(G(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)),G(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 G(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))):G(e)&&a(this.formatLanguageCode(e)),n.forEach(i=>{s.indexOf(i)<0&&a(this.formatLanguageCode(i))}),s}}const ur={zero:0,one:1,two:2,few:3,many:4,other:5},fr={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class In{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=ge.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Ne(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!"),fr;if(!e.match(/-|_/))return fr;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)=>ur[s]-ur[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 dr=(r,e,t,n=".",s=!0)=>{let a=Dn(r,e,t);return!a&&s&&G(t)&&(a=wt(r,t,n),a===void 0&&(a=wt(e,t,n))),a},vt=r=>r.replace(/\$/g,"$$$$");class Nn{constructor(e={}){var t;this.logger=ge.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:v,nestingOptionsSeparator:b,maxReplaces:w,alwaysFormat:E}=e.interpolation;this.escape=t!==void 0?t:$n,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?Oe(a):i||"{{",this.suffix=o?Oe(o):c||"}}",this.formatSeparator=l||",",this.unescapePrefix=f?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=d?Oe(d):m||Oe("$t("),this.nestingSuffix=h?Oe(h):v||Oe(")"),this.nestingOptionsSeparator=b||",",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=dr(t,c,h,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,n,{...s,...t,interpolationkey:h}):E}const v=h.split(this.formatSeparator),b=v.shift().trim(),w=v.join(this.formatSeparator).trim();return this.format(dr(t,c,b,this.options.keySeparator,this.options.ignoreJSONStructure),w,n,{...s,...t,interpolationkey:b})};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=>vt(h)},{regex:this.regexp,safeValue:h=>this.escapeValue?vt(this.escape(h)):vt(h)}].forEach(h=>{for(o=0;a=h.regex.exec(e);){const v=a[1].trim();if(i=l(v),i===void 0)if(typeof f=="function"){const w=f(e,a,s);i=G(w)?w:""}else if(s&&Object.prototype.hasOwnProperty.call(s,v))i="";else if(u){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${v} for interpolating ${e}`),i="";else!G(i)&&!this.useRawValueToEscape&&(i=rr(i));const b=h.safeValue(i);if(e=e.replace(a[0],b),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(v){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,v),`${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&&!G(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&&!G(a))return a;G(a)||(a=rr(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 Mn=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}},pr=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(Ne(n),s),e[i]=o),o(t)}},Fn=r=>(e,t,n)=>r(Ne(t),n)(e);class Vn{constructor(e={}){this.logger=ge.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?pr:Fn;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()]=pr(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}=Mn(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 Yn=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class Un extends lt{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=ge.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=>{jn(c.loaded,[a],i),Yn(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();G(e)&&(e=this.languageUtils.toResolveHierarchy(e)),G(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 v;h.length===5?v=h(e,t,n,s,m):v=h(e,t,n,s),v&&typeof v.then=="function"?v.then(b=>o(null,b)).catch(o):o(null,v)}catch(v){o(v)}else h(e,t,n,s,o,m)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const hr=()=>({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]),G(r[1])&&(e.defaultValue=r[1]),G(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}),mr=r=>{var e,t;return G(r.ns)&&(r.ns=[r.ns]),G(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),G(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},ze=()=>{},Wn=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class Me extends lt{constructor(e={},t){if(super(),this.options=mr(e),this.services={},this.logger=ge,this.modules={external:[]},Wn(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&&(G(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=hr();this.options={...n,...this.options,...mr(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?ge.init(s(this.modules.logger),this.options):ge.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:l=Vn;const f=new cr(this.options);this.store=new ir(this.options.resources,this.options);const u=this.services;u.logger=ge,u.resourceStore=this.store,u.languageUtils=f,u.pluralResolver=new In(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 Nn(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Un(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 st(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=ze),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=ze){var a,i;let n=t;const s=G(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=ze),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"&&Pr.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=G(o)?o:o&&o[0],l=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(G(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 G(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?(G(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();G(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 cr(hr());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new Me(e,t)}cloneInstance(e={},t=ze){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new Me(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 ir(o,s),a.services.resourceStore=a.store}return a.translator=new st(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=Me.createInstance();ae.createInstance=Me.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 Hn={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"},Bn={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},Gn={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando",CheckObjectWrongValidation:"Oggetto non valido"},Kn={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:Hn,Month:Bn,Generic:Gn},qn={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"},zn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},Jn={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command",CheckObjectWrongValidation:"Object not valid"},Xn={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:qn,Month:zn,Generic:Jn};function gr(r,e){return new RegExp(Zn(r),e)}function Zn(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qn(r,e,t,n){let s=e;const a=es(r,t);if(!s){const o=Math.abs(a);o-Math.floor(o)?s="0,0.00":s="0,0"}const i=ts(s);return new Intl.NumberFormat(n,i).format(a)}function es(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(gr(c,"g"),""),a=a.replace(gr(o,"g"),"."),a=Number(a)}const i=Number(a);return isNaN(i)?NaN:i}function ts(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 Qn(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:Xn},it:{translation:Kn}}});const rs=(r,e,t,n)=>ae.format(r,e,t||ae.language,n),ns=(r,e)=>ae.t(r,e);function Fe(){const r=T.useCallback((n,s,a,i)=>rs(n,s,a||void 0,i),[]),e=T.useCallback(()=>ae.languages[0],[]),t=T.useCallback((n,s)=>ns(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var ct=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r.CHECK_OBJECT_WRONG_VALIDATION="Generic.CheckObjectWrongValidation",r))(ct||{}),le=(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))(le||{}),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||{}),Et=(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))(Et||{});const ss={"smp-datepickercalendar-position":"_smp-datepickercalendar-position_1lf9g_1"};function as({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=Fe(),i=()=>{if(!n)return;const F=new Date(n);return isNaN(F.getTime())?void 0:F},[o]=T.useState(new Date),[c,l]=T.useState(r||i()||new Date),[f,u]=T.useState(c?c.getMonth():new Date().getMonth()),[d,m]=T.useState(c?c.getFullYear():new Date().getFullYear()),[h,v]=T.useState(c?c.getDate():null),b=T.useRef(null),w=T.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(le.SUNDAY_SHORT),full:a(le.SUNDAY)},{value:a(le.MONDAY_SHORT),full:a(le.MONDAY)},{value:a(le.TUESDAY_SHORT),full:a(le.TUESDAY)},{value:a(le.WEDNESDAY_SHORT),full:a(le.WEDNESDAY)},{value:a(le.THURSDAY_SHORT),full:a(le.THURSDAY)},{value:a(le.FRIDAY_SHORT),full:a(le.FRIDAY)},{value:a(le.SATURDAY_SHORT),full:a(le.SATURDAY)}],S=F=>t.some(p=>{const x=p.start.getTime(),O=p.end.getTime(),P=F.getTime();return P>=x&&P<=O}),g=F=>{S(F)||(l(F),v(F.getDate()),e&&e(Xr(F)))},_=()=>{f===0?(u(11),m(d-1)):u(f-1),v(1)},A=()=>{f===11?(u(0),m(d+1)):u(f+1),v(1)},$=(F,p)=>new Date(F,p+1,0).getDate(),C=(F,p)=>new Date(F,p,1).getDay(),L=F=>{var x;const p=H.findIndex(O=>O!==null&&O.getDate()===F);p!==-1&&w.current[p]&&((x=w.current[p])==null||x.focus(),v(F))},W=(F,p)=>{const x=H[p];if(!x)return;const O=$(d,f),P=x.getDate();switch(F.key){case"ArrowRight":F.preventDefault();{let j=P+1,k=new Date(d,f,j);if(j>O){const V=f===11?d+1:d,Y=f===11?0:f+1;j=1,k=new Date(V,Y,j),A(),setTimeout(()=>{N(1,"forward")},0);return}S(k)?N(j,"forward"):L(j)}break;case"Tab":break;case"ArrowLeft":F.preventDefault();{let j=P-1,k=new Date(d,f,j);if(j<1){const V=f===0?d-1:d,Y=f===0?11:f-1,M=$(V,Y);j=M,k=new Date(V,Y,j),_(),setTimeout(()=>{N(M,"backward")},0);return}S(k)?N(j,"backward"):L(j)}break;case"ArrowUp":F.preventDefault();{let j=P-7,k=new Date(d,f,j);if(j<1){const V=f===0?d-1:d,Y=f===0?11:f-1;j=$(V,Y)+j,k=new Date(V,Y,j),_(),setTimeout(()=>{N(j,"backward")},0);return}S(k)?N(j,"backward"):L(j)}break;case"ArrowDown":F.preventDefault();{let j=P+7,k=new Date(d,f,j);if(j>O){const V=f===11?d+1:d,Y=f===11?0:f+1;j=j-O,k=new Date(V,Y,j),A(),setTimeout(()=>{N(j,"forward")},0);return}S(k)?N(j,"forward"):L(j)}break;case"Home":F.preventDefault(),N(1,"forward");break;case"End":F.preventDefault(),N(O,"backward");break;case"PageUp":F.preventDefault(),_(),setTimeout(()=>{const j=$(f===0?d-1:d,f===0?11:f-1),k=Math.min(P,j);N(k,"forward")},0);break;case"PageDown":F.preventDefault(),A(),setTimeout(()=>{const j=$(f===11?d+1:d,f===11?0:f+1),k=Math.min(P,j);N(k,"forward")},0);break;case" ":case"Space":if(S(x))return;v(x.getDate()),l(x);break;case"Enter":F.preventDefault(),g(x);break}},N=(F,p)=>{const x=$(d,f);if(p==="forward"){for(let O=F;O<=x;O++){const P=new Date(d,f,O);if(!S(P)){L(O);return}}A(),setTimeout(()=>{N(1,"forward")},0)}else{for(let k=F;k>=1;k--){const V=new Date(d,f,k);if(!S(V)){L(k);return}}const O=f===0?d-1:d,P=f===0?11:f-1,j=$(O,P);_(),setTimeout(()=>{N(j,"backward")},0)}},H=(()=>{const F=$(d,f),p=C(d,f),x=[];for(let O=0;O<p;O++)x.push(null);for(let O=1;O<=F;O++){const P=new Date(d,f,O);x.push(P)}return x})(),z=[];let K=[];H.forEach((F,p)=>{if(K.push(F),K.length===7||p===H.length-1){for(;K.length<7;)K.push(null);z.push(K),K=[]}}),T.useEffect(()=>{var F;if(h!==null){const p=H.findIndex(x=>x!==null&&x.getDate()===h);p!==-1&&w.current[p]&&((F=w.current[p])==null||F.focus())}},[f,d,h,H]);const q={label:"smp-datepickercalendar-label",wrapper:`smp-datepickercalendar ${ss["smp-datepickercalendar-position"]}`,calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(F,p,x,O)=>`smp-datepickercalendar-td
46
- ${F?"smp-datepickercalendar-td-today":""}
44
+ */var pt,Gt;function pn(){if(Gt)return pt;Gt=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 pt=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},pt}var ht,Kt;function jt(){if(Kt)return ht;Kt=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ht=r,ht}var mt,qt;function Rr(){return qt||(qt=1,mt=Function.call.bind(Object.prototype.hasOwnProperty)),mt}var gt,zt;function hn(){if(zt)return gt;zt=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var e=jt(),t={},n=Rr();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={})},gt=s,gt}var yt,Jt;function mn(){if(Jt)return yt;Jt=1;var r=Or(),e=pn(),t=jt(),n=Rr(),s=hn(),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 yt=function(o,c){var l=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function u(p){var b=p&&(l&&p[l]||p[f]);if(typeof b=="function")return b}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:S(),arrayOf:$,element:R(),elementType:y(),instanceOf:P,node:I(),objectOf:T,oneOf:E,oneOfType:_,shape:k,exact:j};function h(p,b){return p===b?p!==0||1/p===1/b:p!==p&&b!==b}function x(p,b){this.message=p,this.data=b&&typeof b=="object"?b:{},this.stack=""}x.prototype=Error.prototype;function v(p){if(process.env.NODE_ENV!=="production")var b={},D=0;function A(L,Y,U,V,J,K,se){if(V=V||d,K=K||U,se!==t){if(c){var N=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 N.name="Invariant Violation",N}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var W=V+":"+U;!b[W]&&D<3&&(a("You are manually calling a React.PropTypes validation function for the `"+K+"` prop on `"+V+"`. 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."),b[W]=!0,D++)}}return Y[U]==null?L?Y[U]===null?new x("The "+J+" `"+K+"` is marked as required "+("in `"+V+"`, but its value is `null`.")):new x("The "+J+" `"+K+"` is marked as required in "+("`"+V+"`, but its value is `undefined`.")):null:p(Y,U,V,J,K)}var C=A.bind(null,!1);return C.isRequired=A.bind(null,!0),C}function w(p){function b(D,A,C,L,Y,U){var V=D[A],J=G(V);if(J!==p){var K=z(V);return new x("Invalid "+L+" `"+Y+"` of type "+("`"+K+"` supplied to `"+C+"`, expected ")+("`"+p+"`."),{expectedType:p})}return null}return v(b)}function S(){return v(i)}function $(p){function b(D,A,C,L,Y){if(typeof p!="function")return new x("Property `"+Y+"` of component `"+C+"` has invalid PropType notation inside arrayOf.");var U=D[A];if(!Array.isArray(U)){var V=G(U);return new x("Invalid "+L+" `"+Y+"` of type "+("`"+V+"` supplied to `"+C+"`, expected an array."))}for(var J=0;J<U.length;J++){var K=p(U,J,C,L,Y+"["+J+"]",t);if(K instanceof Error)return K}return null}return v(b)}function R(){function p(b,D,A,C,L){var Y=b[D];if(!o(Y)){var U=G(Y);return new x("Invalid "+C+" `"+L+"` of type "+("`"+U+"` supplied to `"+A+"`, expected a single ReactElement."))}return null}return v(p)}function y(){function p(b,D,A,C,L){var Y=b[D];if(!r.isValidElementType(Y)){var U=G(Y);return new x("Invalid "+C+" `"+L+"` of type "+("`"+U+"` supplied to `"+A+"`, expected a single ReactElement type."))}return null}return v(p)}function P(p){function b(D,A,C,L,Y){if(!(D[A]instanceof p)){var U=p.name||d,V=M(D[A]);return new x("Invalid "+L+" `"+Y+"` of type "+("`"+V+"` supplied to `"+C+"`, expected ")+("instance of `"+U+"`."))}return null}return v(b)}function E(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 b(D,A,C,L,Y){for(var U=D[A],V=0;V<p.length;V++)if(h(U,p[V]))return null;var J=JSON.stringify(p,function(se,N){var W=z(N);return W==="symbol"?String(N):N});return new x("Invalid "+L+" `"+Y+"` of value `"+String(U)+"` "+("supplied to `"+C+"`, expected one of "+J+"."))}return v(b)}function T(p){function b(D,A,C,L,Y){if(typeof p!="function")return new x("Property `"+Y+"` of component `"+C+"` has invalid PropType notation inside objectOf.");var U=D[A],V=G(U);if(V!=="object")return new x("Invalid "+L+" `"+Y+"` of type "+("`"+V+"` supplied to `"+C+"`, expected an object."));for(var J in U)if(n(U,J)){var K=p(U,J,C,L,Y+"."+J,t);if(K instanceof Error)return K}return null}return v(b)}function _(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 b=0;b<p.length;b++){var D=p[b];if(typeof D!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Z(D)+" at index "+b+"."),i}function A(C,L,Y,U,V){for(var J=[],K=0;K<p.length;K++){var se=p[K],N=se(C,L,Y,U,V,t);if(N==null)return null;N.data&&n(N.data,"expectedType")&&J.push(N.data.expectedType)}var W=J.length>0?", expected one of type ["+J.join(", ")+"]":"";return new x("Invalid "+U+" `"+V+"` supplied to "+("`"+Y+"`"+W+"."))}return v(A)}function I(){function p(b,D,A,C,L){return F(b[D])?null:new x("Invalid "+C+" `"+L+"` supplied to "+("`"+A+"`, expected a ReactNode."))}return v(p)}function B(p,b,D,A,C){return new x((p||"React class")+": "+b+" type `"+D+"."+A+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+C+"`.")}function k(p){function b(D,A,C,L,Y){var U=D[A],V=G(U);if(V!=="object")return new x("Invalid "+L+" `"+Y+"` of type `"+V+"` "+("supplied to `"+C+"`, expected `object`."));for(var J in p){var K=p[J];if(typeof K!="function")return B(C,L,Y,J,z(K));var se=K(U,J,C,L,Y+"."+J,t);if(se)return se}return null}return v(b)}function j(p){function b(D,A,C,L,Y){var U=D[A],V=G(U);if(V!=="object")return new x("Invalid "+L+" `"+Y+"` of type `"+V+"` "+("supplied to `"+C+"`, expected `object`."));var J=e({},D[A],p);for(var K in J){var se=p[K];if(n(p,K)&&typeof se!="function")return B(C,L,Y,K,z(se));if(!se)return new x("Invalid "+L+" `"+Y+"` key `"+K+"` supplied to `"+C+"`.\nBad object: "+JSON.stringify(D[A],null," ")+`
45
+ Valid keys: `+JSON.stringify(Object.keys(p),null," "));var N=se(U,K,C,L,Y+"."+K,t);if(N)return N}return null}return v(b)}function F(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(F);if(p===null||o(p))return!0;var b=u(p);if(b){var D=b.call(p),A;if(b!==p.entries){for(;!(A=D.next()).done;)if(!F(A.value))return!1}else for(;!(A=D.next()).done;){var C=A.value;if(C&&!F(C[1]))return!1}}else return!1;return!0;default:return!1}}function H(p,b){return p==="symbol"?!0:b?b["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&b instanceof Symbol:!1}function G(p){var b=typeof p;return Array.isArray(p)?"array":p instanceof RegExp?"object":H(b,p)?"symbol":b}function z(p){if(typeof p>"u"||p===null)return""+p;var b=G(p);if(b==="object"){if(p instanceof Date)return"date";if(p instanceof RegExp)return"regexp"}return b}function Z(p){var b=z(p);switch(b){case"array":case"object":return"an "+b;case"boolean":case"date":case"regexp":return"a "+b;default:return b}}function M(p){return!p.constructor||!p.constructor.name?d:p.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},yt}var vt,Xt;function gn(){if(Xt)return vt;Xt=1;var r=jt();function e(){}function t(){}return t.resetWarningCache=e,vt=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},vt}var Zt;function yn(){if(Zt)return He.exports;if(Zt=1,process.env.NODE_ENV!=="production"){var r=Or(),e=!0;He.exports=mn()(r.isElement,e)}else He.exports=gn()();return He.exports}var ie=yn(),vn=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},bn=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},xn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Ke="http://www.w3.org/2000/svg",Qt="http://www.w3.org/1999/xlink",De=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}en(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof vn(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,x=this.props.afterInjection,v=this.props.wrapper,w,S;v==="svg"?(w=document.createElementNS(Ke,v),w.setAttribute("xmlns",Ke),w.setAttribute("xmlns:xlink",Qt),S=document.createElementNS(Ke,v)):(w=document.createElement(v),S=document.createElement(v)),w.appendChild(S),S.dataset.src=f,this.nonReactWrapper=this.reactWrapper.appendChild(w);var $=function(E){if(s.removeSVG(),!s._isMounted){m(E);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){m(E)})},R=function(E,T){if(E){$(E);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{x(T)}catch(_){$(_)}})},y=function(E){if(E.setAttribute("role","img"),i){var T=E.querySelector(":scope > desc");T&&E.removeChild(T);var _=document.createElement("desc");_.innerHTML=i,E.prepend(_)}if(u){var I=E.querySelector(":scope > title");I&&E.removeChild(I);var B=document.createElement("title");B.innerHTML=u,E.prepend(B)}try{h(E)}catch(k){$(k)}};un(S,{afterEach:R,beforeEach:y,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;bn(tt({},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=Qr(s,xn),l=o;return Ye.createElement(l,tt({},c,{ref:this.refCallback},o==="svg"?{xmlns:Ke,xmlnsXlink:Qt}:{}),this.state.isLoading&&i&&Ye.createElement(i,null),this.state.hasError&&a&&Ye.createElement(a,null))},e}(Ye.Component);De.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};De.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 wt={assets:"/"};const Sn=r=>{wt={...wt,...r}},er=r=>`${wt.assets}/${r}`.replace(/\/+/g,"/"),oe=O.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,tabIndex:d})=>{const[m,h]=O.useState(r),x=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),v=x&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),w=er(`assets/svg/${r}.svg`),S=er(`assets/svg/${n}.svg`),$={img:`${l?"smp-image-interactable":""}`,svg:`smp-icon ${i?`smp-icon-${i}`:""} ${o?"smp-icon-rotated":""} ${l?"smp-icon-interactable":""} ${f?"smp-icon-spin":""}`},R=()=>{!a&&l&&c&&c()},y=P=>{!a&&l&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),R())};return g.jsx(g.Fragment,{children:v?g.jsx(De,{src:r,fallback:()=>g.jsx(De,{src:S,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:$.svg,onClick:R,onKeyDown:y,tabIndex:d}):x?g.jsx("img",{src:m,width:e||"16px",height:t||"auto",alt:u,onError:()=>h(S),onClick:R,className:$.img,title:u,onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&R()}}):g.jsx(De,{src:w,fallback:()=>g.jsx(De,{src:S,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:$.svg,onClick:R,onKeyDown:y,tabIndex:d})})}),me={"smp-textfield-wrapper":"_smp-textfield-wrapper_mmttf_4","smp-textfield":"_smp-textfield_mmttf_4","smp-textfield-extraSmall":"_smp-textfield-extraSmall_mmttf_30","smp-textfield-small":"_smp-textfield-small_mmttf_35","smp-textfield-medium":"_smp-textfield-medium_mmttf_40","smp-textfield-large":"_smp-textfield-large_mmttf_45","smp-textfield-extraLarge":"_smp-textfield-extraLarge_mmttf_50","smp-textfield-input":"_smp-textfield-input_mmttf_56","smp-textfield-outlined":"_smp-textfield-outlined_mmttf_79","smp-textfield-danger":"_smp-textfield-danger_mmttf_90","smp-textfield-readOnly":"_smp-textfield-readOnly_mmttf_94","smp-textfield-variant-notSelectable":"_smp-textfield-variant-notSelectable_mmttf_99","smp-textfield-disabled":"_smp-textfield-disabled_mmttf_109","smp-textfield-fullWidth":"_smp-textfield-fullWidth_mmttf_118"},xe=({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:x,inputType:v="text",ariaLabel:w="input field",label:S,helperText:$=!1,error:R,appearance:y="base",fullWidth:P=!1,_dataComponent:E="textfield",min:T,max:_,step:I,inputMode:B="text",width:k})=>{const j=O.useId(),F=`${j}-helper`,H=R?"danger":l,G=R||l=="danger"?"error":o,z=$||!!R,Z=b=>{s==null||s(b.target.value)},M={wrapper:`${me["smp-textfield-wrapper"]} ${P?me["smp-textfield-fullWidth"]:""}`,container:`${me["smp-textfield"]} ${r?me["smp-textfield-disabled"]:""} ${a?me["smp-textfield-placeholder"]:""} ${c?me[`smp-textfield-${c}`]:""} ${H?me[`smp-textfield-${H}`]:""} ${y?me[`smp-textfield-${y}`]:""} ${i?"":me["smp-textfield-readOnly"]}`,input:`${me["smp-textfield-input"]}`};if(f&&(f!=="notSelectable"||i)){const b=me[`smp-textfield-variant-${f}`];b&&(M.container+=` ${b}`)}const p=k?{"--smp-textField-width-base":k}:void 0;return g.jsxs("div",{className:M.wrapper,"data-component":E,children:[S&&g.jsx($e,{label:S,disabled:r,htmlFor:j}),g.jsxs("div",{className:M.container,ref:m,style:p,children:[t&&g.jsx(oe,{icon:t,disabled:r}),g.jsx("input",{id:j,type:v,value:e,placeholder:a,onChange:Z,onBlur:n,className:M.input,disabled:r,readOnly:!i,onKeyDown:x,"aria-label":w,ref:h,"aria-describedby":z?F:void 0,min:T,max:_,step:I,inputMode:B}),G&&g.jsx(oe,{icon:G,disabled:r,state:H,onClick:d,rotated:u,isInteractable:i,tabIndex:0})]}),z&&g.jsx(wr,{helperText:R,disabled:r,state:H,id:F})]})};function jr({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=O.useState(0),i=O.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=O.useCallback(m=>{const h=m.target.scrollTop;a(h)},[]),d=m=>{if(!i.current)return;const h=m*e,x=h+e,v=i.current,w=v.scrollTop,S=w+t;h<w?v.scrollTop=h:x>S&&(v.scrollTop=x-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 qe={"smp-list":"_smp-list_t8eqj_1","smp-list-container":"_smp-list-container_t8eqj_10","smp-list-listItem":"_smp-list-listItem_t8eqj_15"},wn=10,Dr=({id:r,options:e,displayMode:t,ref:n,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:c,onKeyDown:l,isOpen:f})=>{var k;const[u,d]=O.useState(""),m=24,[h,x]=O.useState(a!==null?a:-1),v=s!==void 0?s:e.length>wn,w=u?e.filter(j=>j.label.toLowerCase().includes(u.toLowerCase())):e,S=j=>{d(j)},{virtualItems:$,containerProps:R,innerProps:y,scrollToIndex:P}=jr({items:w,itemHeight:m,containerHeight:200,overscan:5});O.useEffect(()=>{a!==null&&a!==h&&x(a)},[a]),O.useEffect(()=>{h>=0&&h<w.length&&P(h)},[h,w]);const E=j=>{if(j.key==="ArrowDown"||j.key==="ArrowUp"){j.preventDefault();let F=h;j.key==="ArrowDown"?F=h<w.length-1?h+1:0:j.key==="ArrowUp"&&(F=h>0?h-1:w.length-1),x(F)}else j.key==="Enter"?h>=0&&h<w.length&&(c==null||c(w[h])):j.key==="Escape"&&(j.preventDefault(),j.stopPropagation());l&&l(j)},T=j=>{E(j)},_=j=>{E(j)},I={wrapper:`${qe["smp-list"]}`,container:`${qe["smp-list-container"]}`,virtualScroll:`${qe["smp-list-virtualScroll"]}`,listItem:`${qe["smp-list-listItem"]}`},B=O.useRef(null);return O.useEffect(()=>{f&&(B!=null&&B.current)&&B.current.focus()},[f,B]),g.jsxs("div",{id:r,ref:n,className:I.wrapper,"data-component":"list",style:{width:o},children:[v&&g.jsx(xe,{bindValue:u,placeholder:"Search...",onChange:S,onKeyDown:T,inputRef:B}),g.jsx("div",{...R,className:I.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:_,"aria-activedescendant":h>=0&&h<w.length?(k=w[h])==null?void 0:k.id:void 0,children:g.jsx("div",{...y,className:I.virtualScroll,children:$.map(({item:j,index:F,offsetTop:H})=>{const G=i.includes(j.id);return g.jsxs("li",{role:"option",id:j.id,"aria-selected":h===F?"true":"false",tabIndex:-1,className:`${I.listItem} ${h===F?"selected-item":""}`,"aria-label":j.id+"-"+j.label,style:{height:`${m}px`,lineHeight:`calc(${m}px - 2*2px)`,transform:`translateY(${H}px)`},onClick:()=>{c==null||c(j),x(F)},children:[Ie(j.id,j.label,t),G&&g.jsx(oe,{icon:"check",width:16})]},j.id)})})})]})},Dt=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=O.useState(Ie(e,t,r));return O.useEffect(()=>{a(e)},[e]),O.useEffect(()=>{a(Ie(e,t,r))},[t,r]),g.jsx(xe,{...n,bindValue:s})},En=r=>{const e=O.useRef(null);return O.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},r)}};function lt({children:r}){const[e,t]=O.useState(!1);return O.useEffect(()=>{t(!0)},[]),e?Vr.createPortal(r,document.body):null}const _t=({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=O.useRef(null),[x,v]=O.useState(r),[w,S]=O.useState(e),[$,R]=O.useState(!1),[y,P]=O.useState(t||[]),[E,T]=O.useState(0),[_,I]=O.useState([r]),{anchorRef:B,targetRef:k,anchorWidth:j}=ot({position:"bottom",enabled:$}),F=O.useCallback(()=>{var p;R(!1),(p=h==null?void 0:h.current)==null||p.focus()},[]);_e(k,()=>F());const H=En(400),G=p=>{p.length>=a?c&&u&&H(async()=>{const b=await u(c,p);P(b),T(b.length>0?0:-1),R(!0)}):F(),v(p),S(e),l||f==null||f(p,e)},z=p=>{l?(v(""),S("")):(v(p.id),S(p.label)),f==null||f(p.id,p.label);const b=y.findIndex(D=>D.id===p.id);T(b),I([p.id]),F()},Z=p=>{p.key==="Escape"&&(F(),T(-1))},M=p=>{if((p.key==="ArrowDown"||p.key==="ArrowUp")&&(p.preventDefault(),$)){const b=p.key==="ArrowDown"?(E+1)%y.length:(E-1+y.length)%y.length;T(b)}switch(p.key){case"Enter":E>=0&&E<y.length?z(y[E]):l&&(f==null||f(x,""),F(),v(""),S(""));break;case"Escape":F(),T(-1);break}};return g.jsxs("div",{"data-component":"autocomplete",children:[g.jsx(Dt,{...m,bindValue:x,optionalDisplayValue:w,displayMode:n,isEditable:i,shapeIcon:"magnify",placeholder:o,ref:B,inputRef:h,onChange:G,onKeyDown:M,"aria-autocomplete":"list"}),$&&g.jsx(lt,{children:g.jsx(Dr,{options:y,displayMode:s,onClick:z,ref:k,selectedIndex:E,activeIndex:d||_,width:j,showFilter:!1,onKeyDown:Z,isOpen:$})})]})},tr=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],rr=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],we=({label:r,bindValue:e,onClick:t,ariaLabel:n,icon:s,disabled:a,sizing:i="base",variant:o="primary",appearance:c="raised",showIcon:l=!0,showText:f=!0,fullWidth:u=!1,loading:d=!1,justify:m="center",title:h,optionalDisplayValue:x})=>{const v={container:`smp-button smp-button-container ${i?`smp-button-${i}`:""} ${o?`smp-buttonVariant-${o}`:""} ${c?`smp-buttonType-${c}`:""} ${u?"smp-button-fullWidth":""} smp-justifyContent-${m}`};return g.jsx("button",{"data-component":"button",className:v.container,onClick:t,"aria-label":n,disabled:a,"aria-busy":d,title:h||r||x,children:d?g.jsx(oe,{icon:"spinner",state:rr(o),spin:!0}):g.jsxs(g.Fragment,{children:[s&&l&&g.jsx(oe,{icon:s,disabled:a,state:rr(o),width:tr(i),height:tr(i)}),f&&g.jsx("span",{children:x||e})]})})},_r=({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,x]=O.useState(r);O.useEffect(()=>{!h&&m&&e&&m(e,void 0).then(S=>x(S)).catch(S=>{console.error("Errore nel caricamento delle opzioni per ButtonList",S)})},[h,e,m]);const v={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${n}`},w=h==null?void 0:h.map((S,$)=>{const R={bindValue:S.id,optionalDisplayValue:S.label,fun:S.fun,icon:S.icon,variant:a,appearance:i,showText:o,showIcon:c,fullWidth:l,disabled:f,sizing:s,justify:u,onClick:()=>{d==null||d(S.id,S.fun)}};return g.jsx(we,{...R},`button-${$}`)});return g.jsx("div",{role:"list","data-component":"button-list",className:v.container,children:w})},Tn={"smp-checkbox-wrapper":"_smp-checkbox-wrapper_z14lq_2"},$r=({bindValue:r,_dataComponent:e="checkbox",disabled:t,label:n,isEditable:s=!0,onChange:a,onBlur:i,variant:o="checkbox"})=>{const c=O.useId(),l=u=>{s&&a&&a(u.target.checked)},f={wrapper:`${Tn["smp-checkbox-wrapper"]}`};return g.jsxs("div",{className:f.wrapper,"data-component":e,children:[n&&g.jsx($e,{label:n,disabled:t,htmlFor:c}),g.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:l,onBlur:i,role:o==="switch"?"switch":"checkbox",id:c})]})},On={titleLarge:"h2",title:"h3",body:"h6",label:"label"},Ne=({variant:r="body",bindValue:e,color:t,...n})=>{const s=On[r],a={container:`smp-typography ${r?`smp-typography-${r}`:""} ${n.disabled?"smp-typography-disabled":""}`};return g.jsx(s,{className:a.container,disabled:n.disabled,style:{"--smp-typography-color-base":t},children:e})},$t=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,c]=O.useState(null),l={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},f=m=>{n==null||n(r.filter((h,x)=>x!==m))},u=m=>{c(m)},d=m=>{if(o===null||o===m)return;const h=[...r],[x]=h.splice(o,1);h.splice(m,0,x),n==null||n(h),c(null)};return g.jsx("div",{className:l.container,role:"list","data-component":"chip",children:r.flatMap((m,h)=>{const x=Ie(m.bindValue,m.optionalDisplayValue,t),v=g.jsxs("div",{className:l.element,role:"listitem",draggable:i,onDragStart:()=>u(h),onDragOver:S=>i&&S.preventDefault(),onDrop:()=>i&&d(h),style:{"--smp-chips-backgroundColor-base":a},children:[i&&g.jsx(oe,{icon:"drag_indicator_horizontal",isInteractable:!0}),g.jsx(Ne,{variant:"label",bindValue:x,color:s}),e&&g.jsx(oe,{icon:"close",isInteractable:!0,onClick:()=>f(h),color:s})]},`chip-${h}`),w=i&&h<r.length-1?g.jsx(oe,{icon:"chevron-right",color:s},`separator-${h}`):null;return[v,w].filter(Boolean)})})};function Ct(r,e){const t=O.useRef(null);O.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 Cr=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,isEditable:s,displayMode:a,listDisplayMode:i="Both",fun:o,onOptionsRequest:c,multiActiveIndex:l,...f})=>{const u=O.useRef(null),[d,m]=O.useState(!1),[h,x]=O.useState(t),[v,w]=O.useState(-1),[S,$]=O.useState([r]),R=O.useId(),{anchorRef:y,targetRef:P,anchorWidth:E}=ot({position:"bottom",enabled:d}),T=O.useCallback(()=>{var j;m(!1),(j=u==null?void 0:u.current)==null||j.focus()},[]);_e(P,()=>T()),Ct(d,P);const _=j=>{e==null||e(j.id,j.label);const F=h.findIndex(H=>H.id===j.id);w(F),$([j.id]),T()},I=j=>{j.key==="Escape"&&(T(),w(-1))},B=j=>{(j.key==="ArrowDown"||j.key==="ArrowUp")&&(j.preventDefault(),k())},k=()=>{o&&c&&c(o,void 0).then(j=>{x(j),w(j.length>0?0:-1),m(!0)})};return g.jsxs("div",{role:"combobox","aria-expanded":d,"aria-controls":R,"aria-owns":R,"data-component":"combobox",children:[g.jsx(Dt,{...f,bindValue:r,optionalDisplayValue:n,displayMode:a,onShapeIconClick:k,onKeyDown:B,shapeIcon:"arrow_drop_down",rotatedShapeIcon:d,isEditable:s,ref:y,inputRef:u,"aria-autocomplete":"list",variant:"notSelectable"}),d&&g.jsx(lt,{children:g.jsx(Dr,{id:R,options:h,displayMode:i,ref:P,isOpen:d,selectedIndex:v,activeIndex:l||S,width:E,onClick:_,onKeyDown:I})})]})},q=r=>typeof r=="string",Ae=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},nr=r=>r==null?"":""+r,Rn=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},jn=/###/g,sr=r=>r&&r.indexOf("###")>-1?r.replace(jn,"."):r,ar=r=>!r||q(r),Le=(r,e,t)=>{const n=q(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(ar(r))return{};const a=sr(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return ar(r)?{}:{obj:r,k:sr(n[s])}},ir=(r,e,t)=>{const{obj:n,k:s}=Le(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=Le(r,i,Object);for(;o.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),o=Le(r,i,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=t},Dn=(r,e,t,n)=>{const{obj:s,k:a}=Le(r,e,Object);s[a]=s[a]||[],s[a].push(t)},rt=(r,e)=>{const{obj:t,k:n}=Le(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},_n=(r,e,t)=>{const n=rt(r,t);return n!==void 0?n:rt(e,t)},Pr=(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]):Pr(r[n],e[n],t):r[n]=e[n]);return r},Oe=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var $n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Cn=r=>q(r)?r.replace(/[&<>"'\/]/g,e=>$n[e]):r;class Pn{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 kn=[" ",",","?","!",";"],An=new Pn(20),Ln=(r,e,t)=>{e=e||"",t=t||"";const n=kn.filter(i=>e.indexOf(i)<0&&t.indexOf(i)<0);if(n.length===0)return!0;const s=An.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},Et=(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},Me=r=>r==null?void 0:r.replace("_","-"),In={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 nt{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||In,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 nt(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new nt(this.logger,e)}}var ye=new nt;class ct{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 or extends ct{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=rt(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:Et((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),ir(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=rt(this.data,o)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?Pr(c,n,a):c={...c,...n},ir(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 kr={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 lr={},cr=r=>!q(r)&&typeof r!="boolean"&&typeof r!="number";class st extends ct{constructor(e,t={}){super(),Rn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ye.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&&!Ln(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 x=(m==null?void 0:m.usedKey)||o,v=(m==null?void 0:m.exactUsedKey)||o,w=["[object Number]","[object Function]","[object RegExp]"],S=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,$=!this.i18nFormat||this.i18nFormat.handleAsObject,R=s.count!==void 0&&!q(s.count),y=st.hasDefaultValue(s),P=R?this.pluralResolver.getSuffix(u,s.count,s):"",E=s.ordinal&&R?this.pluralResolver.getSuffix(u,s.count,{ordinal:!1}):"",T=R&&!s.ordinal&&s.count===0,_=T&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${P}`]||s[`defaultValue${E}`]||s.defaultValue;let I=h;$&&!h&&y&&(I=_);const B=cr(I),k=Object.prototype.toString.apply(I);if($&&I&&B&&w.indexOf(k)<0&&!(q(S)&&Array.isArray(I))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const j=this.options.returnedObjectHandler?this.options.returnedObjectHandler(x,I,{...s,ns:c}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(m.res=j,m.usedParams=this.getUsedParamsDetails(s),m):j}if(i){const j=Array.isArray(I),F=j?[]:{},H=j?v:x;for(const G in I)if(Object.prototype.hasOwnProperty.call(I,G)){const z=`${H}${i}${G}`;y&&!h?F[G]=this.translate(z,{...s,defaultValue:cr(_)?_[G]:void 0,joinArrays:!1,ns:c}):F[G]=this.translate(z,{...s,joinArrays:!1,ns:c}),F[G]===z&&(F[G]=I[G])}h=F}}else if($&&q(S)&&Array.isArray(h))h=h.join(S),h&&(h=this.extendTranslation(h,e,s,n));else{let j=!1,F=!1;!this.isValidLookup(h)&&y&&(j=!0,h=_),this.isValidLookup(h)||(F=!0,h=o);const G=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&F?void 0:h,z=y&&_!==h&&this.options.updateMissing;if(F||j||z){if(this.logger.log(z?"updateKey":"missingKey",u,l,o,z?_:h),i){const b=this.resolve(o,{...s,keySeparator:!1});b&&b.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 Z=[];const M=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&M&&M[0])for(let b=0;b<M.length;b++)Z.push(M[b]);else this.options.saveMissingTo==="all"?Z=this.languageUtils.toResolveHierarchy(s.lng||this.language):Z.push(s.lng||this.language);const p=(b,D,A)=>{var L;const C=y&&A!==h?A:G;this.options.missingKeyHandler?this.options.missingKeyHandler(b,l,D,C,z,s):(L=this.backendConnector)!=null&&L.saveMissing&&this.backendConnector.saveMissing(b,l,D,C,z,s),this.emit("missingKey",b,l,D,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&R?Z.forEach(b=>{const D=this.pluralResolver.getSuffixes(b,s);T&&s[`defaultValue${this.options.pluralSeparator}zero`]&&D.indexOf(`${this.options.pluralSeparator}zero`)<0&&D.push(`${this.options.pluralSeparator}zero`),D.forEach(A=>{p([b],o+A,s[`defaultValue${A}`]||_)})}):p(Z,o,_))}h=this.extendTranslation(h,e,s,m,n),F&&h===o&&this.options.appendNamespaceToMissingKey&&(h=`${l}${f}${o}`),(F||j)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${f}${o}`:o,j?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=kr.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!=="",x=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(v=>{var w,S;this.isValidLookup(n)||(o=v,!lr[`${x[0]}-${v}`]&&((w=this.utils)!=null&&w.hasLoadedNamespace)&&!((S=this.utils)!=null&&S.hasLoadedNamespace(o))&&(lr[`${x[0]}-${v}`]=!0,this.logger.warn(`key "${s}" for languages "${x.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!!!")),x.forEach($=>{var P;if(this.isValidLookup(n))return;i=$;const R=[f];if((P=this.i18nFormat)!=null&&P.addLookupKeys)this.i18nFormat.addLookupKeys(R,f,$,v,t);else{let E;d&&(E=this.pluralResolver.getSuffix($,t.count,t));const T=`${this.options.pluralSeparator}zero`,_=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(R.push(f+E),t.ordinal&&E.indexOf(_)===0&&R.push(f+E.replace(_,this.options.pluralSeparator)),m&&R.push(f+T)),h){const I=`${f}${this.options.contextSeparator}${t.context}`;R.push(I),d&&(R.push(I+E),t.ordinal&&E.indexOf(_)===0&&R.push(I+E.replace(_,this.options.pluralSeparator)),m&&R.push(I+T))}}let y;for(;y=R.pop();)this.isValidLookup(n)||(a=y,n=this.getResource($,v,y,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 ur{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ye.create("languageUtils")}getScriptPartFromCode(e){if(e=Me(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=Me(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 fr={zero:0,one:1,two:2,few:3,many:4,other:5},dr={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Nn{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=ye.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Me(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!"),dr;if(!e.match(/-|_/))return dr;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)=>fr[s]-fr[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 pr=(r,e,t,n=".",s=!0)=>{let a=_n(r,e,t);return!a&&s&&q(t)&&(a=Et(r,t,n),a===void 0&&(a=Et(e,t,n))),a},bt=r=>r.replace(/\$/g,"$$$$");class Mn{constructor(e={}){var t;this.logger=ye.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:x,nestingOptionsSeparator:v,maxReplaces:w,alwaysFormat:S}=e.interpolation;this.escape=t!==void 0?t:Cn,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?Oe(a):i||"{{",this.suffix=o?Oe(o):c||"}}",this.formatSeparator=l||",",this.unescapePrefix=f?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=d?Oe(d):m||Oe("$t("),this.nestingSuffix=h?Oe(h):x||Oe(")"),this.nestingOptionsSeparator=v||",",this.maxReplaces=w||1e3,this.alwaysFormat=S!==void 0?S:!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 S=pr(t,c,h,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(S,void 0,n,{...s,...t,interpolationkey:h}):S}const x=h.split(this.formatSeparator),v=x.shift().trim(),w=x.join(this.formatSeparator).trim();return this.format(pr(t,c,v,this.options.keySeparator,this.options.ignoreJSONStructure),w,n,{...s,...t,interpolationkey:v})};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=>bt(h)},{regex:this.regexp,safeValue:h=>this.escapeValue?bt(this.escape(h)):bt(h)}].forEach(h=>{for(o=0;a=h.regex.exec(e);){const x=a[1].trim();if(i=l(x),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,x))i="";else if(u){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${x} for interpolating ${e}`),i="";else!q(i)&&!this.useRawValueToEscape&&(i=nr(i));const v=h.safeValue(i);if(e=e.replace(a[0],v),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(x){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,x),`${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=nr(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 Fn=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}},hr=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(Me(n),s),e[i]=o),o(t)}},Vn=r=>(e,t,n)=>r(Me(t),n)(e);class Yn{constructor(e={}){this.logger=ye.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?hr:Vn;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()]=hr(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}=Fn(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 Un=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class Wn extends ct{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=ye.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=>{Dn(c.loaded,[a],i),Un(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 x;h.length===5?x=h(e,t,n,s,m):x=h(e,t,n,s),x&&typeof x.then=="function"?x.then(v=>o(null,v)).catch(o):o(null,x)}catch(x){o(x)}else h(e,t,n,s,o,m)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const mr=()=>({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}),gr=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},ze=()=>{},Bn=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class Fe extends ct{constructor(e={},t){if(super(),this.options=gr(e),this.services={},this.logger=ye,this.modules={external:[]},Bn(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=mr();this.options={...n,...this.options,...gr(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?ye.init(s(this.modules.logger),this.options):ye.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:l=Yn;const f=new ur(this.options);this.store=new or(this.options.resources,this.options);const u=this.services;u.logger=ye,u.resourceStore=this.store,u.languageUtils=f,u.pluralResolver=new Nn(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 Mn(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Wn(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 st(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=ze),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=Ae(),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=ze){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=Ae();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=ze),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"&&kr.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=Ae();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=Ae();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=Ae();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 ur(mr());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new Fe(e,t)}cloneInstance(e={},t=ze){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new Fe(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 or(o,s),a.services.resourceStore=a.store}return a.translator=new st(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=Fe.createInstance();ae.createInstance=Fe.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 Hn={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"},Gn={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",CheckObjectWrongValidation:"Oggetto non valido"},qn={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:Hn,Month:Gn,Generic:Kn},zn={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"},Jn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},Xn={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command",CheckObjectWrongValidation:"Object not valid"},Zn={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:zn,Month:Jn,Generic:Xn};function yr(r,e){return new RegExp(Qn(r),e)}function Qn(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const es=(r,e,t)=>{let n=r;return isNaN(n)||(e!=null&&(n=Math.max(n,e)),t!=null&&(n=Math.min(n,t))),n},ts=(r,e)=>{var i,o;const n=Intl.NumberFormat(r).formatToParts(1000.1),s=((i=n.find(c=>c.type==="group"))==null?void 0:i.value)??",",a=e??((o=n.find(c=>c.type==="decimal"))==null?void 0:o.value)??".";return{groupingChar:s,decimalChar:a}};function rs(r,e,t,n){let s=e;const a=as(r,t);if(!s){const o=Math.abs(a);o-Math.floor(o)?s="0,0.00":s="0,0"}const i=is(s);return new Intl.NumberFormat(n,i).format(a)}const ns=(r,e,t)=>{const n=r.lastIndexOf(t);if(n!==-1)return r.length-n-1;const s=t==="."?",":".",a=r.lastIndexOf(s);return a!==-1&&!(s===e&&r.length-a-1===3)?r.length-a-1:0},ss=(r,e,t)=>{if(!r)return NaN;let n=r.replace(/\s/g,""),s=t;const a=(n.match(/\./g)||[]).length,i=(n.match(/,/g)||[]).length;if(a&&i)s=n.lastIndexOf(".")>n.lastIndexOf(",")?".":",";else if(!n.includes(t)){const c=n.includes(".")?".":",",l=c==="."?a:i;l>1||l===1&&c===e&&n.length-n.lastIndexOf(c)-1===3||(s=c)}const o=s==="."?",":".";return n=n.replace(new RegExp(`\\${o}`,"g"),""),s!=="."&&(n=n.replace(new RegExp(`\\${s}`,"g"),".")),parseFloat(n)};function as(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(yr(c,"g"),""),a=a.replace(yr(o,"g"),"."),a=Number(a)}const i=Number(a);return isNaN(i)?NaN:i}function is(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 rs(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:Zn},it:{translation:qn}}});const os=(r,e,t,n)=>ae.format(r,e,t||ae.language,n),ls=(r,e)=>ae.t(r,e);function Ce(){const r=O.useCallback((n,s,a,i)=>os(n,s,a||void 0,i),[]),e=O.useCallback(()=>ae.languages[0],[]),t=O.useCallback((n,s)=>ls(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var ut=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r.CHECK_OBJECT_WRONG_VALIDATION="Generic.CheckObjectWrongValidation",r))(ut||{}),le=(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))(le||{}),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||{}),Tt=(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))(Tt||{});const cs={"smp-datepickercalendar-position":"_smp-datepickercalendar-position_1lf9g_1"};function us({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=Ce(),i=()=>{if(!n)return;const M=new Date(n);return isNaN(M.getTime())?void 0:M},[o]=O.useState(new Date),[c,l]=O.useState(r||i()||new Date),[f,u]=O.useState(c?c.getMonth():new Date().getMonth()),[d,m]=O.useState(c?c.getFullYear():new Date().getFullYear()),[h,x]=O.useState(c?c.getDate():null),v=O.useRef(null),w=O.useRef([]),S=[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)],$=[{value:a(le.SUNDAY_SHORT),full:a(le.SUNDAY)},{value:a(le.MONDAY_SHORT),full:a(le.MONDAY)},{value:a(le.TUESDAY_SHORT),full:a(le.TUESDAY)},{value:a(le.WEDNESDAY_SHORT),full:a(le.WEDNESDAY)},{value:a(le.THURSDAY_SHORT),full:a(le.THURSDAY)},{value:a(le.FRIDAY_SHORT),full:a(le.FRIDAY)},{value:a(le.SATURDAY_SHORT),full:a(le.SATURDAY)}],R=M=>t.some(p=>{const b=p.start.getTime(),D=p.end.getTime(),A=M.getTime();return A>=b&&A<=D}),y=M=>{R(M)||(l(M),x(M.getDate()),e&&e(Zr(M)))},P=()=>{f===0?(u(11),m(d-1)):u(f-1),x(1)},E=()=>{f===11?(u(0),m(d+1)):u(f+1),x(1)},T=(M,p)=>new Date(M,p+1,0).getDate(),_=(M,p)=>new Date(M,p,1).getDay(),I=M=>{var b;const p=F.findIndex(D=>D!==null&&D.getDate()===M);p!==-1&&w.current[p]&&((b=w.current[p])==null||b.focus(),x(M))},B=(M,p)=>{const b=F[p];if(!b)return;const D=T(d,f),A=b.getDate();switch(M.key){case"ArrowRight":M.preventDefault();{let C=A+1,L=new Date(d,f,C);if(C>D){const Y=f===11?d+1:d,U=f===11?0:f+1;C=1,L=new Date(Y,U,C),E(),setTimeout(()=>{k(1,"forward")},0);return}R(L)?k(C,"forward"):I(C)}break;case"Tab":break;case"ArrowLeft":M.preventDefault();{let C=A-1,L=new Date(d,f,C);if(C<1){const Y=f===0?d-1:d,U=f===0?11:f-1,V=T(Y,U);C=V,L=new Date(Y,U,C),P(),setTimeout(()=>{k(V,"backward")},0);return}R(L)?k(C,"backward"):I(C)}break;case"ArrowUp":M.preventDefault();{let C=A-7,L=new Date(d,f,C);if(C<1){const Y=f===0?d-1:d,U=f===0?11:f-1;C=T(Y,U)+C,L=new Date(Y,U,C),P(),setTimeout(()=>{k(C,"backward")},0);return}R(L)?k(C,"backward"):I(C)}break;case"ArrowDown":M.preventDefault();{let C=A+7,L=new Date(d,f,C);if(C>D){const Y=f===11?d+1:d,U=f===11?0:f+1;C=C-D,L=new Date(Y,U,C),E(),setTimeout(()=>{k(C,"forward")},0);return}R(L)?k(C,"forward"):I(C)}break;case"Home":M.preventDefault(),k(1,"forward");break;case"End":M.preventDefault(),k(D,"backward");break;case"PageUp":M.preventDefault(),P(),setTimeout(()=>{const C=T(f===0?d-1:d,f===0?11:f-1),L=Math.min(A,C);k(L,"forward")},0);break;case"PageDown":M.preventDefault(),E(),setTimeout(()=>{const C=T(f===11?d+1:d,f===11?0:f+1),L=Math.min(A,C);k(L,"forward")},0);break;case" ":case"Space":if(R(b))return;x(b.getDate()),l(b);break;case"Enter":M.preventDefault(),y(b);break}},k=(M,p)=>{const b=T(d,f);if(p==="forward"){for(let D=M;D<=b;D++){const A=new Date(d,f,D);if(!R(A)){I(D);return}}E(),setTimeout(()=>{k(1,"forward")},0)}else{for(let L=M;L>=1;L--){const Y=new Date(d,f,L);if(!R(Y)){I(L);return}}const D=f===0?d-1:d,A=f===0?11:f-1,C=T(D,A);P(),setTimeout(()=>{k(C,"backward")},0)}},F=(()=>{const M=T(d,f),p=_(d,f),b=[];for(let D=0;D<p;D++)b.push(null);for(let D=1;D<=M;D++){const A=new Date(d,f,D);b.push(A)}return b})(),H=[];let G=[];F.forEach((M,p)=>{if(G.push(M),G.length===7||p===F.length-1){for(;G.length<7;)G.push(null);H.push(G),G=[]}}),O.useEffect(()=>{var M;if(h!==null){const p=F.findIndex(b=>b!==null&&b.getDate()===h);p!==-1&&w.current[p]&&((M=w.current[p])==null||M.focus())}},[f,d,h,F]);const z={label:"smp-datepickercalendar-label",wrapper:`smp-datepickercalendar ${cs["smp-datepickercalendar-position"]}`,calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(M,p,b,D)=>`smp-datepickercalendar-td
46
+ ${M?"smp-datepickercalendar-td-today":""}
47
47
  ${p?"smp-datepickercalendar-td-selected":""}
48
- ${x?"smp-datepickercalendar-td-focused":""}
49
- ${O?"smp-datepickercalendar-td-disabled":""}`},Z=()=>`${E[f]} ${d.toString()}`;return y.jsxs("div",{className:q.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[y.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[y.jsx(Se,{onClick:_,ariaLabel:a(Et.PREVIOUS_MONTH),optionalDisplayValue:"<",appearance:"ghost",variant:"base",bindValue:"<"}),y.jsx("div",{"aria-label":Z(),className:q.label,children:Z()}),y.jsx(Se,{onClick:A,ariaLabel:a(Et.NEXT_MONTH),bindValue:">",optionalDisplayValue:">",appearance:"ghost",variant:"base"})]}),y.jsxs("table",{ref:b,role:"grid","aria-label":`${a(ct.CALENDAR_FOR)} ${E[f]} ${d}`,className:q.table,children:[y.jsx("thead",{children:y.jsx("tr",{children:R.map(F=>y.jsx("th",{scope:"col",abbr:F.full,className:q.th,children:F.value},F.value))})}),y.jsx("tbody",{children:z.map((F,p)=>y.jsx("tr",{children:F.map((x,O)=>{const P=p*7+O;if(x===null)return y.jsx("td",{className:q.td(!1,!1,!1,!0)},`empty-${O}`);const j=x.getDate()===o.getDate()&&x.getMonth()===o.getMonth()&&x.getFullYear()===o.getFullYear(),k=c&&x.getDate()===c.getDate()&&x.getMonth()===c.getMonth()&&x.getFullYear()===c.getFullYear(),V=h===x.getDate(),Y=S(x);return y.jsx("td",{role:"gridcell","aria-selected":k,tabIndex:V?0:-1,onClick:()=>g(x),onKeyDown:M=>W(M,P),"aria-label":`${x.getDate()} ${E[x.getMonth()]} ${x.getFullYear()}`,"data-selected":k,"aria-disabled":Y,ref:M=>{w.current[P]=M},className:q.td(j,k,V,Y),children:x.getDate()},`day-${O}`)})},`week-${p}`))})]})]})}const Ar=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,isEditable:s=!0,...a})=>{const i=T.useRef(null),[o,c]=T.useState(!1),[l,f]=T.useState(r||""),[u,d]=T.useState(""),{anchorRef:m,targetRef:h}=it({position:"bottom",enabled:o}),v=T.useCallback(()=>{var C;c(!1),(C=i==null?void 0:i.current)==null||C.focus()},[]);ke(h,()=>{v()}),ke(m,()=>{if(typeof m=="object"&&m!==null&&"current"in m){const C=m.current.querySelector("input");C&&C===document.activeElement&&S()}v()}),$t(o,h);const{format:b,getCurrentLanguage:w}=Fe(),E=T.useCallback(C=>{const L=C.length>5&&qr(C,w())||C,W=b(L,void 0,void 0,{type:"date"}),N=typeof L!="string",D=N&&L.toISOString().substring(0,10)||"";return{isValid:N,formattedDate:W,isoDate:D,normalizedDate:L}},[w,b]);T.useEffect(()=>{const{formattedDate:C,isoDate:L,isValid:W}=E(r);f(W&&L||r),d(W&&C||r)},[r,b,E]);const R=()=>c(C=>!C),S=()=>{_(u)},g=C=>{_(C),v()},_=C=>{const{isoDate:L,isValid:W}=E(C);t&&t(W&&L||C)},A=C=>{d(C)},$=C=>{C.key==="Enter"&&(C.preventDefault(),_(u))};return y.jsxs("div",{"data-component":"date-picker",children:[y.jsx(Ee,{...a,bindValue:u,placeholder:e,onBlur:S,onChange:A,onKeyDown:$,shapeIcon:"calendar",onShapeIconClick:R,ref:m,inputRef:i,isEditable:s}),o&&y.jsx(ot,{children:y.jsx(as,{disabledDateRanges:n,onDateChange:g,initialValue:Ot(l)&&l||"",targetRef:h})})]})},is=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,isEditable:s=!0,placeholder:a,label:i,disabled:o,fun:c,error:l,onOptionsRequest:f,onChange:u,onBlur:d})=>{const m=r.map(b=>b.bindValue),h=(b,w)=>{const E=[...r];if(b=="")E.pop();else{const R=E.findIndex(S=>S.bindValue===b&&S.optionalDisplayValue===w);R>=0?E.splice(R,1):E.push({bindValue:b,optionalDisplayValue:w})}u==null||u(E)},v={container:"smp-multipleAutocomplete-container"};return y.jsxs("div",{className:v.container,"data-component":"multiple-autocomplete",children:[i&&y.jsx(De,{label:i,disabled:o}),y.jsx(_t,{elements:r,displayMode:e,isEditable:s,onChange:b=>{u==null||u(b)}}),y.jsx(Dt,{bindValue:"",fun:c,isEditable:s,onChange:h,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:a,onOptionsRequest:f,_multiActiveIndex:m,error:l,onBlur:d})]})},Je={"smp-radio":"_smp-radio_1vo2u_1","smp-radio-horizontal":"_smp-radio-horizontal_1vo2u_10","smp-radio-element":"_smp-radio-element_1vo2u_14","smp-radio-disabled":"_smp-radio-disabled_1vo2u_20"},os=({disabled:r=!1,displayMode:e="DescOnly",horizontal:t=!1,options:n,onOptionsRequest:s,fun:a,...i})=>{const[o,c]=T.useState(n);T.useEffect(()=>{!o&&s&&a&&s(a,void 0).then(m=>c(m)).catch(m=>{console.error("Error during loading options (radio)",m)})},[o,s,a]);const l={container:`${Je["smp-radio"]} ${t?Je["smp-radio-horizontal"]:""}`,option:`${Je["smp-radio-element"]} ${r?Je["smp-radio-disabled"]:""}`},f=()=>{var m;r||(m=i.onBlur)==null||m.call(i)},u=m=>{var h;r||(h=i.onChange)==null||h.call(i,m.id,m.label)},d=T.useId();return y.jsx("div",{"smp-id":"radio-container",className:l.container,children:o==null?void 0:o.map((m,h)=>y.jsxs("label",{className:l.option,children:[y.jsx("input",{type:"radio",name:d,value:m.id,disabled:r,checked:m.id===i.bindValue,onChange:()=>u(m),onBlur:f}),Le(m.id,m.label,e)]},h))})},kr=({...r})=>{const[e,t]=T.useState(!1),n=e?"visibility-off":"visibility";return y.jsx(Ee,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},ls=({...r})=>{const[e,t]=T.useState(r.bindValue),{translate:n}=Fe(),s=a=>{var i;a.key==="Enter"&&(a.preventDefault(),(i=r.onEnter)==null||i.call(r,e))};return y.jsx(Ee,{...r,placeholder:r.placeholder?r.placeholder:n(ct.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})},cs=({bindValue:r,optionalDisplayValue:e,label:t})=>{const n={wrapper:"smp-text-wrapper"};return t?y.jsxs("div",{className:n.wrapper,children:[y.jsx(De,{label:t}),y.jsx(Ie,{variant:"body",bindValue:e||r})]}):y.jsx(Ie,{variant:"body",bindValue:e||r})};class we{constructor(e,t){ye(this,"class");ye(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new we(e,e.k==""?[]:e.k.split(";"))}static fromString(e){return new we({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const Pe=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t??r.decode,shape:r.shape,fun:r.fun}),yr=r=>{const e=we.fromDataObj(r.obj),t=r.decode?we.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},us=(r,e)=>{const t=new we(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new we(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return Pe(r,t,n)},fs=({disabled:r,bindValue:e,onChange:t,placeholder:n,state:s,appearance:a,isEditable:i,label:o,ariaLabel:c,helperText:l,error:f,onBlur:u,onKeyDown:d})=>{const m=T.useId(),h=`${m}-helper`,v=f?"danger":s,b=l||!!f,w=R=>{t==null||t(R.target.value)},E={wrapper:"smp-textarea-wrapper",container:`smp-textarea ${r?"smp-textarea-disabled":""} ${n?"smp-textarea-placeholder":""} ${v?`smp-textarea-${v}`:""} ${a?`smp-textarea-${a}`:""} ${i?"":"smp-textarea-readOnly"}`};return y.jsxs("div",{className:E.wrapper,"data-component":"textarea",children:[o&&y.jsx(De,{htmlFor:m,label:o,disabled:r}),y.jsx("textarea",{id:m,value:e,placeholder:n,onChange:w,onBlur:u,className:E.container,disabled:r,readOnly:!i,onKeyDown:d,"aria-label":o?void 0:c,"aria-labelledby":o?m:void 0,"aria-describedby":b?h:void 0}),b&&y.jsx(Sr,{id:h,helperText:f,disabled:r,state:v})]})},ds=({value:r,onChange:e,targetRef:t,isOpen:n})=>{const s=T.useRef(null);T.useEffect(()=>{n&&(s!=null&&s.current)&&s.current.focus()},[n,s]);const[a,i,o]=r,c=l=>Array.from({length:l},(f,u)=>y.jsx("option",{value:u,children:u.toString().padStart(2,"0")},u));return y.jsxs("div",{className:"smp-timepicker-widget",ref:t,children:[y.jsx("select",{value:a,ref:s,onChange:l=>e(+l.target.value,i,o),id:"time-picker-hours",children:c(24)}),":",y.jsx("select",{value:i,onChange:l=>e(a,+l.target.value,o),id:"time-picker-minutes",children:c(60)}),":",y.jsx("select",{value:o||0,onChange:l=>e(a,i,+l.target.value),id:"time-picker-seconds",children:c(60)})]})},vr=r=>{const e=r.match(/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/);if(!e)return!1;const[,t,n,s]=e,a=parseInt(t,10),i=parseInt(n,10),o=s?parseInt(s,10):0;return a>=0&&a<=23&&i>=0&&i<=59&&(s===void 0||o>=0&&o<=59)},ps=r=>{const e=r.split(":").map(t=>parseInt(t,10));return[e[0]||0,e[1]||0,e[2]||0]},hs=(r,e,t)=>{const n=r!=null&&!isNaN(r)?r.toString().padStart(2,"0"):"",s=e!=null&&!isNaN(e)?e.toString().padStart(2,"0"):"",a=t!=null&&!isNaN(t)?t.toString().padStart(2,"0"):"";return n&&s?`${n}:${s}:${a}`:s?`${s}:${a}`:a},ms=({bindValue:r,placeholder:e="HH:MM:SS",onChange:t,isEditable:n=!0,...s})=>{const a=T.useRef(null),[i,o]=T.useState(!1),[c,l]=T.useState(r||""),[f,u]=T.useState(""),{anchorRef:d,targetRef:m}=it({position:"bottom",enabled:i}),h=T.useCallback(()=>{var g;o(!1),(g=a==null?void 0:a.current)==null||g.focus()},[]);ke(m,()=>o(!1)),$t(i,m),T.useEffect(()=>{const g=r||"",_=vr(g)?g:r||"";l(g),u(_)},[r]),T.useEffect(()=>{const g=_=>{_.key==="Escape"&&o(!1)};return i&&document.addEventListener("keydown",g),()=>{document.removeEventListener("keydown",g)}},[i]);const v=()=>{n&&o(g=>!g)},b=g=>{u(g)},w=(g,_,A)=>{const $=hs(g,_,A);l($),u($),t==null||t($),h()},E=()=>{S(f)},R=g=>{g.key==="Enter"&&(g.preventDefault(),S(f))},S=g=>{if(g.trim()===""){l(""),u(""),t==null||t("");return}vr(g)?(l(g),u(g),t==null||t(g)):u(g)};return y.jsxs("div",{"data-component":"time-picker",children:[y.jsx(jt,{...s,bindValue:f,placeholder:e,onChange:b,onBlur:E,onKeyDown:R,shapeIcon:"clock",onShapeIconClick:v,isEditable:n,ref:d,inputRef:a}),i&&y.jsx(ot,{children:y.jsx(ds,{value:ps(c),onChange:w,targetRef:m,isOpen:i})})]})};function gs(r){return typeof r=="string"&&/^\d{6}$/.test(r)}class at{constructor(e,t){ye(this,"class");ye(this,"time");this.class=e,this.time=t}static fromDataObj(e){const t=br.get(`${e.t}${e.p}`);if(t)return new at(e,t.legacyToIso(e.k));throw new Error(`time creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=br.get(`${this.class.t}${this.class.p}`);if(e)return e.isoToLegacy(this.time);throw new Error(`Time object not implemented ${this.class.t}${this.class.p}`)}getValue(){return this.time}}const br=new Map([["I12",{legacyToIso(r){return gs(r)&&`${r.substring(0,2)}:${r.substring(2,4)}:${r.substring(4,6)}`||r},isoToLegacy(r){return r.replaceAll(":","")||r}}]]),Ve=({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 v={obj:t,shape:e,decode:r,icon:s,fun:a},b={onBlur:d,onOptionsRequest:m,fun:a,icon:s,label:o,isEditable:h,...n},w=(S,g,_)=>Br(t)?Pe(S,new et(t,g).getLegacyValue()):Gr(t)?Pe(S,new at(t,g).getLegacyValue()):Pe(S,g,_),E=S=>Pe(v,new Qe(t,S).getLegacyValue()),R=S=>us(v,S);switch(e){case re.AUTOCOMPLETE:{const S={...b,bindValue:t.k,optionalDisplayValue:r,onChange:(g,_)=>{l==null||l(w(v,g,_))}};return y.jsx(Dt,{...S})}case re.BUTTON:{const S={...b,bindValue:t.k,optionalDisplayValue:r,onClick:()=>{f==null||f(w(v,t.k))}};return y.jsx(Se,{...S})}case re.BUTTON_LIST:{const S={...b,options:c,onClick:(g,_)=>{const A={...v,fun:_};f==null||f(w(A,g))}};return y.jsx(Dr,{...S})}case re.COMBOBOX:{const S={...b,bindValue:t.k,optionalDisplayValue:r,onChange:(g,_)=>{l==null||l(w(v,g,_))}};return y.jsx($r,{...S})}case re.RADIO:{const S={...b,bindValue:t.k,onChange:(g,_)=>{l==null||l(w(v,g,_))}};return y.jsx(os,{...S})}case re.SWITCH:case re.CHECKBOX:{const S=e===re.SWITCH,g={...b,bindValue:Qe.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:_=>{l==null||l(E(_))},...S&&{variant:"switch"}};return y.jsx(_r,{...g})}case re.CHIP:{const S={...b,elements:yr(v)};return y.jsx(_t,{...S})}case re.DATE:{const S={...b,bindValue:et.fromDataObj(t).getValue(),onChange:g=>{l==null||l(w(v,g))}};return y.jsx(Ar,{...S})}case re.ICON:case re.IMAGE:{const S={...b,icon:s,placeholderIcon:i,isInteractable:!!b.fun,onClick:()=>{f==null||f(w(v,t.k))}};return y.jsx(oe,{...S})}case re.MULTI_AUTOCOMPLETE:{const S={...b,elements:yr(v),onChange:g=>{l==null||l(R(g))}};return y.jsx(is,{...S})}case re.MEMO:{const S={...b,bindValue:t.k,optionalDisplayValue:r,onChange:g=>{l==null||l(w(v,g))}};return y.jsx(fs,{...S})}case re.PASSWORD:{const S={...b,bindValue:t.k,onChange:g=>{l==null||l(w(v,g))}};return y.jsx(kr,{...S})}case re.SPOTLIGHT:{const S={...b,bindValue:t.k,onEnter:g=>{u==null||u(w(v,g))}};return y.jsx(ls,{...S})}case re.TEXT_FIELD:{const S={...b,bindValue:t.k,optionalDisplayValue:r,onChange:g=>{l==null||l(w(v,g))}};return y.jsx(Ee,{...S})}case re.TIME:{const S={...b,bindValue:at.fromDataObj(t).getValue(),onChange:g=>{l==null||l(w(v,g))}};return y.jsx(ms,{...S})}default:{const S={...b,bindValue:t.k,optionalDisplayValue:r};return y.jsx(cs,{...S})}}},ys=({data:r,onClick:e,onEnter:t})=>{var i,o;const[n,s]=T.useState(),a=T.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],v={...h,id:m.name,onChange:b=>{s(w=>w&&{...w,[m.name]:{...w[m.name],obj:{...w[m.name].obj,k:b.obj.k}}})},onClick:()=>{h.fun&&e&&e({...h})},onEnter:b=>{t&&t(b)}};return{...d,[m.name]:v}},{})},[e,t]);return T.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&&y.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:y.jsx(Tt,{layout:r.rows[0].layout,children:Object.values(n).map(c=>y.jsx(Ve,{...c}))})})},vs=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,bs=({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,f]=T.useState(),[u,d]=T.useState(t??!0),m=T.useRef(null),h=s.trim()?s:"100vh",v=T.useCallback(g=>{var A,$;if(!((A=g==null?void 0:g.rows)!=null&&A.length)||!(($=g==null?void 0:g.columns)!=null&&$.length))return{};const _=g.rows[0];return g.columns.filter(C=>C.visible??!0).reduce((C,L)=>{const W=_.cells[L.name];if(!W||!u&&ce(n)&&W.shape!==re.BUTTON&&W.shape!==re.BUTTON_LIST)return C;const N={...W,id:L.name,onChange:D=>{f(H=>{const z={...H};return z!=null&&z[L.name]&&(z[L.name].obj.k=D.obj.k),z})},onClick:D=>{D.fun&&a&&a(D)},onEnter:D=>{i&&i(D)}};return c&&W.shape==re.BUTTON_LIST&&(N.onOptionsRequest=(D,H)=>c(D,H).then(z=>vs(z))),!u&&ce(n)&&(N.data={...N.data,showText:!1,justify:"center"}),{...C,[L.name]:N}},{})},[u,n,a,i,c]),b=T.useCallback(()=>{o==null||o()},[o]),w=()=>{ce(n)?d(g=>!g):(d(!1),o==null||o())};if(T.useEffect(()=>{f(v(r))},[r]),T.useEffect(()=>{if(!m.current)return;if(!ce(n)){f(v(r));return}const g=getComputedStyle(m.current).getPropertyValue("--smp-drawer-slide-transition");let _=Number(g);g.endsWith("ms")?_=parseFloat(g):g.endsWith("s")&&(_=parseFloat(g)*1e3),setTimeout(()=>{f(v(r))},_/2)},[u,n]),T.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"} ${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&&y.jsxs(y.Fragment,{children:[!ce(n)&&y.jsx("div",{"aria-hidden":"true","aria-label":"drawer-backdrop",className:E.backdrop,onClick:b}),y.jsx("aside",{ref:m,className:E.drawer,style:{height:h},"aria-label":"Drawer","smp-id":"drawer",children:y.jsxs("div",{className:E.container,children:[y.jsxs("div",{className:E.containerHeader,children:[e&&y.jsx("div",{className:E.containerLogo,children:y.jsx(oe,{icon:e,title:"drawer_logo",width:"100%",height:24})}),y.jsx("div",{className:E.containerIcon,children:y.jsx(oe,{icon:ce(n)?"menu_close":"close",title:"drawer_icon",rotated:!u,isInteractable:!0,onClick:w,width:20,height:20})})]}),y.jsx("div",{className:E.containerLayout,children:y.jsx(Tt,{layout:r.rows[0].layout,children:Object.values(l).map(g=>y.jsx(Ve,{...g}))})})]})})]})},xs=({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:v,ValueColName:b,ValueColor:w="var(--smp-dashList-color-base)",SelectLayout:E="1",onClick:R})=>{const S="N/A",g=(e==null?void 0:e.columns)||[],_=(e==null?void 0:e.rows)||[],A=_.length>0,$="--smp-dashList-color",C="smp-layout",L="descr",W="icon",N="um",D="value",H=i||"1em",z="18px",K="--smp-dashList-columns",q="--smp-dashList-fontSize",Z={dash:(U="1")=>{const X=p(U),te=X,ne=x(X,L),fe=x(X,W),ve=x(X,N),pe=x(X,D);return{container:te,descr:ne,icon:fe,um:ve,value:pe}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
50
- ${ce(o)?"smp-dash-list-horizontal":""}`},{format:F}=Fe(),p=U=>`${C}-${U}`,x=(U,X)=>`${U}__${X}`,O=U=>`${$}-${U}`,P=U=>{const X=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(X.test(U)){const ne=U.match(X)||[];if((ne==null?void 0:ne.length)>3)return"rgb("+ne[1]+","+ne[2]+","+ne[3]+")"}return U},j=U=>{if(!u)return U;const[X,te]=k(u).map(Te=>parseInt(Te||"0")),ne="0,0"+(te?"."+"0".repeat(te):""),fe=F(U,ne,"it");if(!X)return fe;const[ve,pe]=fe.split(",");return ve+(pe?`,${pe}`:"")},k=U=>U.includes(";")?U.split(";"):[U],V=U=>{const X=ne=>{var fe;if(ne)return(fe=U==null?void 0:U.cells[ne])==null?void 0:fe.obj.k},te=ne=>{var fe,ve;if(!(g.length<=ne))return(ve=(fe=U==null?void 0:U.cells[g[ne].name])==null?void 0:fe.obj)==null?void 0:ve.k};return{descr:t||X(n)||te(2)||"",icon:c||X(l)||te(3)||"",um:d||X(m)||te(1)||"",value:v||X(b)||te(0)||""}},Y=U=>{R==null||R(U)},M=(U,X)=>{(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),U.stopPropagation(),Y(X))},B=(U=>{const X=Z.dash(U);return{className:X,descr:te=>y.jsx("div",{className:X.descr,children:te},`${U}-${L}`),icon:te=>y.jsx("div",{className:X.icon,children:y.jsx(oe,{color:f,height:z,icon:te,width:z})},`${U}-${W}`),um:te=>y.jsx("div",{className:X.um,children:te},`${U}-${N}`),value:te=>y.jsx("div",{className:X.value,children:te},`${U}-${D}`)}})(E),se=U=>{const{descr:X,icon:te,um:ne,value:fe}=V(U),ve={[O(L)]:P(s),[O(N)]:P(h),[O(D)]:P(w)},pe=[],Te=j(fe);switch(E){case"2":te&&pe.push(B.icon(te)),pe.push(B.descr(X)),pe.push(B.value(ne?Te+" "+ne:Te));break;default:case"1":pe.push(B.descr(X)),pe.push(B.value(ne?Te+" "+ne:Te))}return y.jsx("div",{className:B.className.container,role:"button",style:ve,tabIndex:0,onClick:()=>Y(U),onKeyDown:Ir=>M(Ir,U),children:pe},U.rowId)},I={[K]:String(r),[q]:H};return y.jsx("div",{className:Z.dashList,style:I,children:A?_.map(U=>se(U)):S})},Xe={"smp-table":"_smp-table_1qmju_1","smp-headerCell":"_smp-headerCell_1qmju_35","smp-resizer":"_smp-resizer_1qmju_44"},Ss="_rowContent_20wit_2",ws="_clickable_20wit_21",Es="_indent_20wit_26",Ts="_toggle_20wit_32",Os="_cell_20wit_38",Rs="_leftSection_20wit_46",xe={rowContent:Ss,clickable:ws,indent:Es,toggle:Ts,cell:Os,leftSection:Rs};function Ze(r){return!!r&&"children"in r}function js(r){return!Ze(r)}function Ds(r){const e=JSON.stringify(r,Object.keys(r).sort());let t=0,n,s;if(e.length===0)return t.toString();for(n=0;n<e.length;n++)s=e.charCodeAt(n),t=(t<<5)-t+s,t|=0;return Math.abs(t).toString()}const Lr=({row:r,columnWidths:e={},level:t=0,rowHeight:n=26,offsetTop:s})=>{var E;const[a,i]=T.useState(!1),o=Ze(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:`${xe.rowContent} ${o?xe.clickable:""}`,toggle:`${xe.toggle}`,indent:`${xe.indent}`,cell:`${xe.cell}`},m=R=>y.jsx(Ve,{...R}),h=()=>y.jsx("span",{className:d.toggle,children:l&&y.jsx(oe,{icon:a?"arrow_drop_right":"arrow_drop_down",width:16})}),v=()=>y.jsx("span",{className:d.indent,style:{width:`${f}px`},"aria-hidden":"true"}),b=()=>{const R=js(r)?"":r.decode||(c?"":"Untitled"),S=s??n*t;return y.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:[Ze(r)&&y.jsxs("td",{className:xe.leftSection,style:{height:`${n}px`},children:[v(),h(),y.jsx("span",{className:xe.rowLabel,children:R})]}),r.cells&&Object.keys(r.cells).length>0&&Object.entries(r.cells).map(([g,_])=>y.jsx("td",{className:d.cell,style:{width:e[g],minWidth:e[g],height:`${n}px`},children:m({..._,id:g})},Ds(_)||g))]})},w=()=>{var R;return a||!o?null:y.jsx(y.Fragment,{children:Ze(r)&&((R=r.children)==null?void 0:R.map((S,g)=>y.jsx(Lr,{row:S,level:t+1},`child-${g}`)))})};return y.jsxs(y.Fragment,{children:[b(),w()]})},_s=({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 y.jsx("tr",{className:i.tr,style:{height:e,top:t,lineHeight:`${e}px`},onClick:s,children:y.jsxs("td",{className:i.td,style:{paddingLeft:10+n*20},children:[y.jsx(oe,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),y.jsx(Ie,{variant:"title",bindValue:r})]})})};function $s(r,e){const t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t}function Cs(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 Ps(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,v=o(u,h);for(const[b,w]of v){const E=[...m,b],R=c(E,d),S=n.has(R);s.push(l(b,R,d,S)),a+=t,S&&i(w,d+1,E)}}function o(u,d){var h;const m=new Map;for(const v of u){const b=((h=v.cells[d])==null?void 0:h.decode)??"N/D";m.has(b)||m.set(b,[]),m.get(b).push(v)}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 As=({groups:r=[],isDraggable:e=!0,isEditable:t=!0,onChange:n,onDrop:s,onDragOver:a})=>{const i=r.map(o=>({bindValue:o.column}));return y.jsxs("tr",{className:"smp-groupBar-container",onDragOver:a,onDrop:s,children:[y.jsx("td",{children:y.jsx(oe,{icon:"groups"})}),y.jsx("td",{children:y.jsx(_t,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:n})})]})},ks=({columns:r,columnWidths:e})=>y.jsx("tfoot",{children:y.jsx("tr",{children:r.map(t=>t.visible&&y.jsx("td",{className:Xe["smp-headerCell"],style:{width:e[t.name],minWidth:e[t.name],maxWidth:e[t.name]}},t.name))})}),Ls=({columns:r,rows:e,containerRef:t,sizingMode:n})=>{const[s,a]=T.useState({});return T.useEffect(()=>{var i,o;if(!(!r||r.length===0)){if(n==="fixed"){const l=Object.fromEntries(r.map(f=>[f.name,120]));a(l)}else if(n==="fit-grid"){const c=((i=t.current)==null?void 0:i.offsetWidth)||800,l=r.filter(d=>d.visible!==!1),f=c/l.length,u=Object.fromEntries(l.map(d=>[d.name,f]));a(u)}else if(n==="fit-content"){const c={};for(const l of r){if(!l.visible)continue;const f=((o=l.title)==null?void 0:o.length)||0,u=Math.max(...e.map(d=>{var m,h,v,b;return`${((h=(m=d.cells)==null?void 0:m[l.name])==null?void 0:h.decode)||((b=(v=d.cells)==null?void 0:v[l.name])==null?void 0:b.value)||""}`.length}),f);c[l.name]=u*8+24}a(c)}}},[r,e,t,n]),[s,a]},Is=({data:r,lineHeight:e=28,TableHeight:t=400,groups:n,columnSizingMode:s="fixed",showGroupBar:a=!0})=>{var A;const[i,o]=T.useState(r??{columns:[],rows:[]}),[c,l]=T.useState(n||[]),[f,u]=T.useState(new Set),d=T.useRef(null),[m,h]=Ls({columns:(i==null?void 0:i.columns)??[],rows:(i==null?void 0:i.rows)??[],containerRef:d,sizingMode:s});T.useEffect(()=>{if(c!=null&&c.length&&r.rows){const{flatRows:$}=Ps(r.rows,c,e,f);o({...r,rows:$})}else o(r)},[r,c,f,e]);const v=$=>{l(Cs($,c))},b=$=>{$.preventDefault();const C=$.dataTransfer.getData("text/plain");if(!C||c.some(N=>N.column===C))return;const W=[...c,{column:C,visible:!0}];l(W)},w=$=>{$.preventDefault()},{virtualItems:E,containerProps:R,innerProps:S}=Rr({items:(i==null?void 0:i.rows)??[],itemHeight:e,containerHeight:t,overscan:5}),g=($,C)=>{const L=$.clientX,W=m[C],N=H=>{const z=H.clientX-L,K=Math.max(50,W+z);h(q=>({...q,[C]:K}))},D=()=>{window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",D)};window.addEventListener("mousemove",N),window.addEventListener("mouseup",D)},_={smpTable:`${Xe["smp-table"]}`,headerCell:`${Xe["smp-headerCell"]}`,resizer:`${Xe["smp-resizer"]}`};return i&&y.jsx("div",{className:_.smpTable,...R,ref:d,children:y.jsxs("table",{children:[y.jsxs("thead",{children:[(n||a)&&y.jsx(As,{groups:c,onChange:v,onDrop:b,onDragOver:w}),y.jsx("tr",{children:i.columns&&((A=i.columns)==null?void 0:A.map($=>$.visible&&y.jsxs("th",{className:_.headerCell,draggable:!0,onDragStart:C=>{C.dataTransfer.setData("text/plain",$.name)},style:{width:m[$.name],minWidth:m[$.name],maxWidth:m[$.name]},children:[y.jsx(Ie,{variant:"title",bindValue:$.title}),y.jsx("div",{className:_.resizer,onMouseDown:C=>g(C,$.name),role:"region"})]},$.name)))})]}),y.jsx("tbody",{...S,children:E.map(({item:$,index:C,offsetTop:L})=>{const W=$.rowId||$.value||`${$.isGroup?"group":"row"}-${C}`;return $.isGroup?y.jsx(_s,{label:$.value||"",rowHeight:e,offsetTop:L,level:$.level,onClick:()=>{const N=$.rowId;N&&u(D=>$s(D,N))},isExpanded:$.isExpanded},`group-${W}`):y.jsx(Lr,{row:$,columnWidths:m,rowHeight:e,offsetTop:L,isGroup:!1},`row-${W}`)})}),y.jsx(ks,{columns:i.columns,columnWidths:m})]})})},Ns=({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]=T.useState();T.useEffect(()=>{u(()=>{if(!r)return;const v={...r};return e&&(v.shape=e),v.shape==null&&(v.shape=re.TEXT_FIELD),s&&(v.obj=Kr(s)),v})},[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 y.jsxs("div",{className:m.container,children:[y.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:y.jsx(Ve,{...f,id:"FLD",onChange:u,onOptionsRequest:l,fun:r==null?void 0:r.fun,onBlur:h,label:a,labelPosition:i})}),ce(t)&&y.jsx(Se,{optionalDisplayValue:"Confirm",onClick:()=>c==null?void 0:c(f),bindValue:"Confirm"})]})},Ms=r=>(r==null?void 0:r.type)==="SmeupDataTree",Fs=r=>(r==null?void 0:r.type)==="SmeupDataTable",Vs=r=>Ms(r)?r.children?r.children.map(e=>({id:e.obj.k,label:e.value??""})):[]:Fs(r)?r.rows.map(e=>{const t=e.cells||e.cells,[n,s]=Object.keys(t);return{id:t[n].obj.k,label:t[s].value||t[s].obj.k}}):[],Ys=({data:r,readOnly:e=!1,hiddenSubmitButton:t=!1,updateOnClick:n=!1,optionsHandler:s,onSubmit:a,onCheck:i,onCheckObj:o})=>{const[c,l]=T.useState({}),{translate:f}=Fe();T.useEffect(()=>{l(h(r))},[r]);const u=(b,w)=>{l(E=>({...E,[b]:{...E[b],obj:{...E[b].obj,k:w.obj.k},decode:w.decode,data:{...E[b].data,error:void 0}}})),n&&(w.shape==re.CHECKBOX||w.shape==re.SWITCH)&&d()},d=()=>{const b=v();a({value:b})},m=async b=>{var w,E;if((w=c[b].inputSettings)!=null&&w.checkObject&&o&&((await o({obj:c[b].obj,fun:c[b].fun,cellId:b})).valid||l(S=>({...S,[b]:{...S[b],data:{...S[b].data,error:f(ct.CHECK_OBJECT_WRONG_VALIDATION)}}}))),(E=c[b].inputSettings)!=null&&E.checkValueOnExit){const R=v();i==null||i({value:R,cell:b})}},h=b=>{var E,R,S;if(!((E=b.rows)!=null&&E.length)||!((R=b.columns)!=null&&R.length))return{};const w=(S=b.rows)==null?void 0:S[0];return b.columns.filter(g=>g.visible??!0).reduce((g,_)=>{const A={...w.cells[_.name],id:_.name,label:_.title};return A.fun&&(A.onOptionsRequest=async($,C)=>Vs(await s($,C,r,_.name))),A.isEditable==null&&(A.isEditable=!0),e&&(A.isEditable=!1),A.isEditable&&A.shape==null&&(A.shape=re.TEXT_FIELD),{...g,[_.name]:A}},{})},v=()=>({before:r,after:{type:"SmeupDataTable",columns:JSON.parse(JSON.stringify(r.columns)),rows:[{cells:JSON.parse(JSON.stringify(c))}]}});return c&&y.jsxs("div",{"data-component":"input-panel",style:{display:"flex",flexDirection:"column",gap:"2rem",padding:"2rem"},children:[y.jsx(Tt,{layout:r.rows[0].layout,children:Object.values(c).map(b=>y.jsx(Ve,{...b,onChange:w=>u(b.id,w),onBlur:()=>m(b.id)}))}),!t&&y.jsx(Se,{onClick:d,bindValue:"submit",optionalDisplayValue:"Submit"})]})};exports.AppBar=ys;exports.Autocomplete=Dt;exports.Button=Se;exports.ButtonList=Dr;exports.Checkbox=_r;exports.Combobox=$r;exports.DashList=xs;exports.DataTableComponent=Is;exports.DatePicker=Ar;exports.Drawer=bs;exports.Field=Ns;exports.Icon=oe;exports.InputPanel=Ys;exports.Password=kr;exports.Textfield=Ee;exports.configurePaths=xn;
48
+ ${b?"smp-datepickercalendar-td-focused":""}
49
+ ${D?"smp-datepickercalendar-td-disabled":""}`},Z=()=>`${S[f]} ${d.toString()}`;return g.jsxs("div",{className:z.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[g.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[g.jsx(we,{onClick:P,ariaLabel:a(Tt.PREVIOUS_MONTH),optionalDisplayValue:"<",appearance:"ghost",variant:"base",bindValue:"<"}),g.jsx("div",{"aria-label":Z(),className:z.label,children:Z()}),g.jsx(we,{onClick:E,ariaLabel:a(Tt.NEXT_MONTH),bindValue:">",optionalDisplayValue:">",appearance:"ghost",variant:"base"})]}),g.jsxs("table",{ref:v,role:"grid","aria-label":`${a(ut.CALENDAR_FOR)} ${S[f]} ${d}`,className:z.table,children:[g.jsx("thead",{children:g.jsx("tr",{children:$.map(M=>g.jsx("th",{scope:"col",abbr:M.full,className:z.th,children:M.value},M.value))})}),g.jsx("tbody",{children:H.map((M,p)=>g.jsx("tr",{children:M.map((b,D)=>{const A=p*7+D;if(b===null)return g.jsx("td",{className:z.td(!1,!1,!1,!0)},`empty-${D}`);const C=b.getDate()===o.getDate()&&b.getMonth()===o.getMonth()&&b.getFullYear()===o.getFullYear(),L=c&&b.getDate()===c.getDate()&&b.getMonth()===c.getMonth()&&b.getFullYear()===c.getFullYear(),Y=h===b.getDate(),U=R(b);return g.jsx("td",{role:"gridcell","aria-selected":L,tabIndex:Y?0:-1,onClick:()=>y(b),onKeyDown:V=>B(V,A),"aria-label":`${b.getDate()} ${S[b.getMonth()]} ${b.getFullYear()}`,"data-selected":L,"aria-disabled":U,ref:V=>{w.current[A]=V},className:z.td(C,L,Y,U),children:b.getDate()},`day-${D}`)})},`week-${p}`))})]})]})}const Ar=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,isEditable:s=!0,...a})=>{const i=O.useRef(null),[o,c]=O.useState(!1),[l,f]=O.useState(r||""),[u,d]=O.useState(""),{anchorRef:m,targetRef:h}=ot({position:"bottom",enabled:o}),x=O.useCallback(()=>{var _;c(!1),(_=i==null?void 0:i.current)==null||_.focus()},[]);_e(h,()=>{x()}),_e(m,()=>{if(typeof m=="object"&&m!==null&&"current"in m){const _=m.current.querySelector("input");_&&_===document.activeElement&&R()}x()}),Ct(o,h);const{format:v,getCurrentLanguage:w}=Ce(),S=O.useCallback(_=>{const I=_.length>5&&zr(_,w())||_,B=v(I,void 0,void 0,{type:"date"}),k=typeof I!="string",j=k&&I.toISOString().substring(0,10)||"";return{isValid:k,formattedDate:B,isoDate:j,normalizedDate:I}},[w,v]);O.useEffect(()=>{const{formattedDate:_,isoDate:I,isValid:B}=S(r);f(B&&I||r),d(B&&_||r)},[r,v,S]);const $=()=>c(_=>!_),R=()=>{P(u)},y=_=>{P(_),x()},P=_=>{const{isoDate:I,isValid:B}=S(_);t&&t(B&&I||_)},E=_=>{d(_)},T=_=>{_.key==="Enter"&&(_.preventDefault(),P(u))};return g.jsxs("div",{"data-component":"date-picker",children:[g.jsx(xe,{...a,bindValue:u,placeholder:e,onBlur:R,onChange:E,onKeyDown:T,shapeIcon:"calendar",onShapeIconClick:$,ref:m,inputRef:i,isEditable:s}),o&&g.jsx(lt,{children:g.jsx(us,{disabledDateRanges:n,onDateChange:y,initialValue:Rt(l)&&l||"",targetRef:h})})]})},fs=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,isEditable:s=!0,placeholder:a,label:i,disabled:o,fun:c,error:l,onOptionsRequest:f,onChange:u,onBlur:d})=>{const m=r.map(v=>v.bindValue),h=(v,w)=>{const S=[...r];if(v=="")S.pop();else{const $=S.findIndex(R=>R.bindValue===v&&R.optionalDisplayValue===w);$>=0?S.splice($,1):S.push({bindValue:v,optionalDisplayValue:w})}u==null||u(S)},x={container:"smp-multipleAutocomplete-container"};return g.jsxs("div",{className:x.container,"data-component":"multiple-autocomplete",children:[i&&g.jsx($e,{label:i,disabled:o}),g.jsx($t,{elements:r,displayMode:e,isEditable:s,onChange:v=>{u==null||u(v)}}),g.jsx(_t,{bindValue:"",fun:c,isEditable:s,onChange:h,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:a,onOptionsRequest:f,_multiActiveIndex:m,error:l,onBlur:d})]})},Lr=({...r})=>{const[e,t]=O.useState(!1),n=e?"visibility-off":"visibility";return g.jsx(xe,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},ds=({...r})=>{const[e,t]=O.useState(r.bindValue),{translate:n}=Ce(),s=a=>{var i;a.key==="Enter"&&(a.preventDefault(),(i=r.onEnter)==null||i.call(r,e))};return g.jsx(xe,{...r,placeholder:r.placeholder?r.placeholder:n(ut.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})},ps=({bindValue:r,optionalDisplayValue:e,label:t})=>{const n={wrapper:"smp-text-wrapper"};return t?g.jsxs("div",{className:n.wrapper,children:[g.jsx($e,{label:t}),g.jsx(Ne,{variant:"body",bindValue:e||r})]}):g.jsx(Ne,{variant:"body",bindValue:e||r})};class Ee{constructor(e,t){de(this,"class");de(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Ee(e,e.k==""?[]:e.k.split(";"))}static fromString(e){return new Ee({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const je=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t??r.decode,shape:r.shape,fun:r.fun}),vr=r=>{const e=Ee.fromDataObj(r.obj),t=r.decode?Ee.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},hs=(r,e)=>{const t=new Ee(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new Ee(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return je(r,t,n)},ms=({min:r,max:e,step:t=1,inputMode:n="decimal",dSep:s,bindValue:a,onChange:i,onEnter:o,...c})=>{const{getCurrentLanguage:l}=Ce(),f=O.useRef(null),u=l(),{groupingChar:d,decimalChar:m}=O.useMemo(()=>ts(u,s),[u,s]),h=O.useCallback((k,j)=>new Intl.NumberFormat(u,{minimumFractionDigits:j,maximumFractionDigits:j,useGrouping:!0}).format(k),[u]),x=O.useCallback(ss,[d,m]),v=O.useCallback(es,[r,e]),w=a!=null&&a.toString().includes(".")?a.toString().split(".")[1].length:0,[S,$]=O.useState(w),[R,y]=O.useState(a!=null?h(a,S):""),P=O.useRef(a??null);O.useEffect(()=>{if(a==null){y(""),P.current=null;return}const k=a.toString().includes(".")?a.toString().split(".")[1].length:0,j=k===0?S:k;j!==S&&$(j),y(h(a,j)),P.current=a},[a,h]);const E=O.useCallback((k,j=!1)=>{if(k.trim()===""){y(""),P.current=null,i==null||i(void 0,""),j&&(o==null||o(void 0));return}const F=x(k,d,m);if(isNaN(F))if(P.current!=null){const H=h(P.current,S);y(H)}else y("");else{const H=v(F,r,e),G=ns(k,d,m);$(G);const z=h(H,G);y(z),P.current=H,i==null||i(H,z),j&&(o==null||o(H))}},[x,d,m,v,r,e,h,i,o,S]),T=k=>y(k),_=()=>E(R),I=k=>{if(k.key==="Enter"){k.preventDefault(),E(R,!0);return}if(k.key==="ArrowUp"||k.key==="ArrowDown"){k.preventDefault();const j=k.key==="ArrowUp"?1:-1,F=P.current??0,H=v(F+j*t,r,e);E(h(H,S))}},B=k=>{if(!k.currentTarget.contains(document.activeElement))return;k.preventDefault();const j=k.deltaY<0?1:-1,F=P.current??0,H=v(F+j*t,r,e);E(h(H,S))};return _e(f,_),g.jsx("div",{ref:f,"data-component":"input-number",onWheel:B,children:g.jsx(xe,{...c,"aria-valuemin":r,"aria-valuemax":e,"aria-valuenow":P.current??void 0,bindValue:R,inputType:"text",inputMode:n,min:r,max:e,step:t,onChange:T,onBlur:_,onKeyDown:I})})};class at{constructor(e,t,n="."){de(this,"class");de(this,"value");de(this,"decimalSeparator");this.class=e,this.value=t,this.decimalSeparator=n}static fromDataObj(e,t){const n=t==="."?",":".",s=e.k.replace(new RegExp(`\\${n}`,"g"),""),a=parseFloat(s.replace(t,"."));return new at(e,a,t)}getLegacyValue(){return this.value.toString().replace(".",this.decimalSeparator)}getValue(){return this.value}}const gs=({disabled:r,bindValue:e,onChange:t,placeholder:n,state:s,appearance:a,isEditable:i,label:o,ariaLabel:c,helperText:l,error:f,onBlur:u,onKeyDown:d})=>{const m=O.useId(),h=`${m}-helper`,x=f?"danger":s,v=l||!!f,w=$=>{t==null||t($.target.value)},S={wrapper:"smp-textarea-wrapper",container:`smp-textarea ${r?"smp-textarea-disabled":""} ${n?"smp-textarea-placeholder":""} ${x?`smp-textarea-${x}`:""} ${a?`smp-textarea-${a}`:""} ${i?"":"smp-textarea-readOnly"}`};return g.jsxs("div",{className:S.wrapper,"data-component":"textarea",children:[o&&g.jsx($e,{htmlFor:m,label:o,disabled:r}),g.jsx("textarea",{id:m,value:e,placeholder:n,onChange:w,onBlur:u,className:S.container,disabled:r,readOnly:!i,onKeyDown:d,"aria-label":o?void 0:c,"aria-labelledby":o?m:void 0,"aria-describedby":v?h:void 0}),v&&g.jsx(wr,{id:h,helperText:f,disabled:r,state:x})]})},Je={"smp-radio":"_smp-radio_1vo2u_1","smp-radio-horizontal":"_smp-radio-horizontal_1vo2u_10","smp-radio-element":"_smp-radio-element_1vo2u_14","smp-radio-disabled":"_smp-radio-disabled_1vo2u_20"},ys=({disabled:r=!1,displayMode:e="DescOnly",horizontal:t=!1,options:n,onOptionsRequest:s,fun:a,...i})=>{const[o,c]=O.useState(n);O.useEffect(()=>{!o&&s&&a&&s(a,void 0).then(m=>c(m)).catch(m=>{console.error("Error during loading options (radio)",m)})},[o,s,a]);const l={container:`${Je["smp-radio"]} ${t?Je["smp-radio-horizontal"]:""}`,option:`${Je["smp-radio-element"]} ${r?Je["smp-radio-disabled"]:""}`},f=()=>{var m;r||(m=i.onBlur)==null||m.call(i)},u=m=>{var h;r||(h=i.onChange)==null||h.call(i,m.id,m.label)},d=O.useId();return g.jsx("div",{"smp-id":"radio-container",className:l.container,children:o==null?void 0:o.map((m,h)=>g.jsxs("label",{className:l.option,children:[g.jsx("input",{type:"radio",name:d,value:m.id,disabled:r,checked:m.id===i.bindValue,onChange:()=>u(m),onBlur:f}),Ie(m.id,m.label,e)]},h))})},vs=({value:r,onChange:e,targetRef:t,isOpen:n})=>{const s=O.useRef(null);O.useEffect(()=>{n&&(s!=null&&s.current)&&s.current.focus()},[n,s]);const[a,i,o]=r,c=l=>Array.from({length:l},(f,u)=>g.jsx("option",{value:u,children:u.toString().padStart(2,"0")},u));return g.jsxs("div",{className:"smp-timepicker-widget",ref:t,children:[g.jsx("select",{value:a,ref:s,onChange:l=>e(+l.target.value,i,o),id:"time-picker-hours",children:c(24)}),":",g.jsx("select",{value:i,onChange:l=>e(a,+l.target.value,o),id:"time-picker-minutes",children:c(60)}),":",g.jsx("select",{value:o||0,onChange:l=>e(a,i,+l.target.value),id:"time-picker-seconds",children:c(60)})]})},br=r=>{const e=r.match(/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/);if(!e)return!1;const[,t,n,s]=e,a=parseInt(t,10),i=parseInt(n,10),o=s?parseInt(s,10):0;return a>=0&&a<=23&&i>=0&&i<=59&&(s===void 0||o>=0&&o<=59)},bs=r=>{const e=r.split(":").map(t=>parseInt(t,10));return[e[0]||0,e[1]||0,e[2]||0]},xs=(r,e,t)=>{const n=r!=null&&!isNaN(r)?r.toString().padStart(2,"0"):"",s=e!=null&&!isNaN(e)?e.toString().padStart(2,"0"):"",a=t!=null&&!isNaN(t)?t.toString().padStart(2,"0"):"";return n&&s?`${n}:${s}:${a}`:s?`${s}:${a}`:a},Ss=({bindValue:r,placeholder:e="HH:MM:SS",onChange:t,isEditable:n=!0,...s})=>{const a=O.useRef(null),[i,o]=O.useState(!1),[c,l]=O.useState(r||""),[f,u]=O.useState(""),{anchorRef:d,targetRef:m}=ot({position:"bottom",enabled:i}),h=O.useCallback(()=>{var y;o(!1),(y=a==null?void 0:a.current)==null||y.focus()},[]);_e(m,()=>o(!1)),Ct(i,m),O.useEffect(()=>{const y=r||"",P=br(y)?y:r||"";l(y),u(P)},[r]),O.useEffect(()=>{const y=P=>{P.key==="Escape"&&o(!1)};return i&&document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[i]);const x=()=>{n&&o(y=>!y)},v=y=>{u(y)},w=(y,P,E)=>{const T=xs(y,P,E);l(T),u(T),t==null||t(T),h()},S=()=>{R(f)},$=y=>{y.key==="Enter"&&(y.preventDefault(),R(f))},R=y=>{if(y.trim()===""){l(""),u(""),t==null||t("");return}br(y)?(l(y),u(y),t==null||t(y)):u(y)};return g.jsxs("div",{"data-component":"time-picker",children:[g.jsx(Dt,{...s,bindValue:f,placeholder:e,onChange:v,onBlur:S,onKeyDown:$,shapeIcon:"clock",onShapeIconClick:x,isEditable:n,ref:d,inputRef:a}),i&&g.jsx(lt,{children:g.jsx(vs,{value:bs(c),onChange:w,targetRef:m,isOpen:i})})]})};function ws(r){return typeof r=="string"&&/^\d{6}$/.test(r)}class it{constructor(e,t){de(this,"class");de(this,"time");this.class=e,this.time=t}static fromDataObj(e){const t=xr.get(`${e.t}${e.p}`);if(t)return new it(e,t.legacyToIso(e.k));throw new Error(`time creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=xr.get(`${this.class.t}${this.class.p}`);if(e)return e.isoToLegacy(this.time);throw new Error(`Time object not implemented ${this.class.t}${this.class.p}`)}getValue(){return this.time}}const xr=new Map([["I12",{legacyToIso(r){return ws(r)&&`${r.substring(0,2)}:${r.substring(2,4)}:${r.substring(4,6)}`||r},isoToLegacy(r){return r.replaceAll(":","")||r}}]]),Ve=({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,onContextMenu:h,isEditable:x})=>{const v={obj:t,shape:e,decode:r,icon:s,fun:a},w={onBlur:d,onOptionsRequest:m,fun:a,icon:s,label:o,isEditable:x,...n},S=(E,T,_)=>Gr(t)?je(E,new et(t,T).getLegacyValue()):Kr(t)?je(E,new it(t,T).getLegacyValue()):je(E,T,_),$=(E,T)=>je(E,new at(t,T,".").getLegacyValue()),R=E=>je(v,new Qe(t,E).getLegacyValue()),y=E=>hs(v,E),P=()=>{switch(e){case re.AUTOCOMPLETE:{const E={...w,bindValue:t.k,optionalDisplayValue:r,onChange:(T,_)=>{l==null||l(S(v,T,_))}};return g.jsx(_t,{...E})}case re.BUTTON:{const E={...w,bindValue:t.k,optionalDisplayValue:r,onClick:()=>{f==null||f(S(v,t.k))}};return g.jsx(we,{...E})}case re.BUTTON_LIST:{const E={...w,options:c,onClick:(T,_)=>{const I={...v,fun:_};f==null||f(S(I,T))}};return g.jsx(_r,{...E})}case re.CHIP:{const E={...w,elements:vr(v)};return g.jsx($t,{...E})}case re.CHECKBOX:case re.SWITCH:{const E=e===re.SWITCH,T={...w,bindValue:Qe.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:_=>{l==null||l(R(_))},...E&&{variant:"switch"}};return g.jsx($r,{...T})}case re.COMBOBOX:{const E={...w,bindValue:t.k,optionalDisplayValue:r,onChange:(T,_)=>{l==null||l(S(v,T,_))}};return g.jsx(Cr,{...E})}case re.DATE:{const E={...w,bindValue:et.fromDataObj(t).getValue(),onChange:T=>{l==null||l(S(v,T))}};return g.jsx(Ar,{...E})}case re.ICON:case re.IMAGE:{const E={...w,icon:s,placeholderIcon:i,isInteractable:!!w.fun,onClick:()=>{f==null||f(S(v,t.k))}};return g.jsx(oe,{...E})}case re.INPUT_NUMBER:{const E={...w,bindValue:at.fromDataObj(t,".").getValue(),onChange:T=>{l==null||l($(v,T))}};return g.jsx(ms,{...E})}case re.MEMO:{const E={...w,bindValue:t.k,optionalDisplayValue:r,onChange:T=>{l==null||l(S(v,T))}};return g.jsx(gs,{...E})}case re.MULTI_AUTOCOMPLETE:{const E={...w,elements:vr(v),onChange:T=>{l==null||l(y(T))}};return g.jsx(fs,{...E})}case re.PASSWORD:{const E={...w,bindValue:t.k,onChange:T=>{l==null||l(S(v,T))}};return g.jsx(Lr,{...E})}case re.RADIO:{const E={...w,bindValue:t.k,onChange:(T,_)=>{l==null||l(S(v,T,_))}};return g.jsx(ys,{...E})}case re.SPOTLIGHT:{const E={...w,bindValue:t.k,onEnter:T=>{u==null||u(S(v,T))}};return g.jsx(ds,{...E})}case re.TEXT_FIELD:{const E={...w,bindValue:t.k,optionalDisplayValue:r,onChange:T=>{l==null||l(S(v,T))}};return g.jsx(xe,{...E})}case re.TIME:{const E={...w,bindValue:it.fromDataObj(t).getValue(),onChange:T=>{l==null||l(S(v,T))}};return g.jsx(Ss,{...E})}default:{const E={...w,bindValue:t.k,optionalDisplayValue:r};return g.jsx(ps,{...E})}}};return g.jsx("span",{className:"smp-cell-wrapper",onContextMenu:E=>{h&&(E.preventDefault(),h(v,E.currentTarget))},children:P()})},Es=({data:r,onClick:e,onEnter:t,onContextMenu:n})=>{var o,c;const[s,a]=O.useState(),i=O.useCallback(l=>{var u,d;if(!((u=l.rows)!=null&&u.length)||!((d=l.columns)!=null&&d.length))return{};const f=l.rows[0];return l.columns.filter(m=>m.visible).reduce((m,h)=>{const x=f.cells[h.name],v={...x,id:h.name,onChange:w=>{a(S=>S&&{...S,[h.name]:{...S[h.name],obj:{...S[h.name].obj,k:w.obj.k}}})},onClick:()=>{x.fun&&e&&e({...x})},onEnter:w=>{t&&t(w)},onContextMenu:(w,S)=>{n&&n(w,S)}};return{...m,[h.name]:v}},{})},[e,t,n]);return O.useEffect(()=>{r&&a(i(r))},[r,i]),!((o=r==null?void 0:r.rows)!=null&&o.length)||!((c=r.columns)!=null&&c.length)?null:s&&g.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:g.jsx(Ot,{layout:r.rows[0].layout,children:Object.values(s).map(l=>g.jsx(Ve,{...l}))})})},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,Os=({data:r,logo:e,open:t,minifiedOnClose:n=!0,customHeight:s="100vh",onClick:a,onEnter:i,onClose:o,loadOptions:c})=>{var $,R;const[l,f]=O.useState(),[u,d]=O.useState(t??!0),m=O.useRef(null),h=s.trim()?s:"100vh",x=O.useCallback(y=>{var E,T;if(!((E=y==null?void 0:y.rows)!=null&&E.length)||!((T=y==null?void 0:y.columns)!=null&&T.length))return{};const P=y.rows[0];return y.columns.filter(_=>_.visible??!0).reduce((_,I)=>{const B=P.cells[I.name];if(!B||!u&&ce(n)&&B.shape!==re.BUTTON&&B.shape!==re.BUTTON_LIST)return _;const k={...B,id:I.name,onChange:j=>{f(F=>{const H={...F};return H!=null&&H[I.name]&&(H[I.name].obj.k=j.obj.k),H})},onClick:j=>{j.fun&&a&&a(j)},onEnter:j=>{i&&i(j)}};return c&&B.shape==re.BUTTON_LIST&&(k.onOptionsRequest=(j,F)=>c(j,F).then(H=>Ts(H))),!u&&ce(n)&&(k.data={...k.data,showText:!1,justify:"center"}),{..._,[I.name]:k}},{})},[u,n,a,i,c]),v=O.useCallback(()=>{o==null||o()},[o]),w=()=>{ce(n)?d(y=>!y):(d(!1),o==null||o())};if(O.useEffect(()=>{f(x(r))},[r]),O.useEffect(()=>{if(!m.current)return;if(!ce(n)){f(x(r));return}const y=getComputedStyle(m.current).getPropertyValue("--smp-drawer-slide-transition");let P=Number(y);y.endsWith("ms")?P=parseFloat(y):y.endsWith("s")&&(P=parseFloat(y)*1e3),setTimeout(()=>{f(x(r))},P/2)},[u,n]),O.useEffect(()=>{t!==void 0&&!ce(n)&&d(t)},[n,t]),!(($=r==null?void 0:r.rows)!=null&&$.length)||!((R=r.columns)!=null&&R.length))return null;const S={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&&g.jsxs(g.Fragment,{children:[!ce(n)&&g.jsx("div",{"aria-hidden":"true","aria-label":"drawer-backdrop",className:S.backdrop,onClick:v}),g.jsx("aside",{ref:m,className:S.drawer,style:{height:h},"aria-label":"Drawer","smp-id":"drawer",children:g.jsxs("div",{className:S.container,children:[g.jsxs("div",{className:S.containerHeader,children:[e&&g.jsx("div",{className:S.containerLogo,children:g.jsx(oe,{icon:e,title:"drawer_logo",width:"100%",height:24})}),g.jsx("div",{className:S.containerIcon,children:g.jsx(oe,{icon:ce(n)?"menu_close":"close",title:"drawer_icon",rotated:!u,isInteractable:!0,onClick:w,width:20,height:20})})]}),g.jsx("div",{className:S.containerLayout,children:g.jsx(Ot,{layout:r.rows[0].layout,children:Object.values(l).map(y=>g.jsx(Ve,{...y}))})})]})})]})},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:x,ValueColName:v,ValueColor:w="var(--smp-dashList-color-base)",SelectLayout:S="1",onClick:$})=>{const R="N/A",y=(e==null?void 0:e.columns)||[],P=(e==null?void 0:e.rows)||[],E=P.length>0,T="--smp-dashList-color",_="smp-layout",I="descr",B="icon",k="um",j="value",F=i||"1em",H="18px",G="--smp-dashList-columns",z="--smp-dashList-fontSize",Z={dash:(W="1")=>{const X=p(W),te=X,ne=b(X,I),fe=b(X,B),ve=b(X,k),he=b(X,j);return{container:te,descr:ne,icon:fe,um:ve,value:he}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
50
+ ${ce(o)?"smp-dash-list-horizontal":""}`},{format:M}=Ce(),p=W=>`${_}-${W}`,b=(W,X)=>`${W}__${X}`,D=W=>`${T}-${W}`,A=W=>{const X=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(X.test(W)){const ne=W.match(X)||[];if((ne==null?void 0:ne.length)>3)return"rgb("+ne[1]+","+ne[2]+","+ne[3]+")"}return W},C=W=>{if(!u)return W;const[X,te]=L(u).map(Te=>parseInt(Te||"0")),ne="0,0"+(te?"."+"0".repeat(te):""),fe=M(W,ne,"it");if(!X)return fe;const[ve,he]=fe.split(",");return ve+(he?`,${he}`:"")},L=W=>W.includes(";")?W.split(";"):[W],Y=W=>{const X=ne=>{var fe;if(ne)return(fe=W==null?void 0:W.cells[ne])==null?void 0:fe.obj.k},te=ne=>{var fe,ve;if(!(y.length<=ne))return(ve=(fe=W==null?void 0:W.cells[y[ne].name])==null?void 0:fe.obj)==null?void 0:ve.k};return{descr:t||X(n)||te(2)||"",icon:c||X(l)||te(3)||"",um:d||X(m)||te(1)||"",value:x||X(v)||te(0)||""}},U=W=>{$==null||$(W)},V=(W,X)=>{(W.key==="Enter"||W.key===" ")&&(W.preventDefault(),W.stopPropagation(),U(X))},K=(W=>{const X=Z.dash(W);return{className:X,descr:te=>g.jsx("div",{className:X.descr,children:te},`${W}-${I}`),icon:te=>g.jsx("div",{className:X.icon,children:g.jsx(oe,{color:f,height:H,icon:te,width:H})},`${W}-${B}`),um:te=>g.jsx("div",{className:X.um,children:te},`${W}-${k}`),value:te=>g.jsx("div",{className:X.value,children:te},`${W}-${j}`)}})(S),se=W=>{const{descr:X,icon:te,um:ne,value:fe}=Y(W),ve={[D(I)]:A(s),[D(k)]:A(h),[D(j)]:A(w)},he=[],Te=C(fe);switch(S){case"2":te&&he.push(K.icon(te)),he.push(K.descr(X)),he.push(K.value(ne?Te+" "+ne:Te));break;default:case"1":he.push(K.descr(X)),he.push(K.value(ne?Te+" "+ne:Te))}return g.jsx("div",{className:K.className.container,role:"button",style:ve,tabIndex:0,onClick:()=>U(W),onKeyDown:Nr=>V(Nr,W),children:he},W.rowId)},N={[G]:String(r),[z]:F};return g.jsx("div",{className:Z.dashList,style:N,children:E?P.map(W=>se(W)):R})},Xe={"smp-table":"_smp-table_1qmju_1","smp-headerCell":"_smp-headerCell_1qmju_35","smp-resizer":"_smp-resizer_1qmju_44"},js="_rowContent_20wit_2",Ds="_clickable_20wit_21",_s="_indent_20wit_26",$s="_toggle_20wit_32",Cs="_cell_20wit_38",Ps="_leftSection_20wit_46",Se={rowContent:js,clickable:Ds,indent:_s,toggle:$s,cell:Cs,leftSection:Ps};function Ze(r){return!!r&&"children"in r}function ks(r){return!Ze(r)}function As(r){const e=JSON.stringify(r,Object.keys(r).sort());let t=0,n,s;if(e.length===0)return t.toString();for(n=0;n<e.length;n++)s=e.charCodeAt(n),t=(t<<5)-t+s,t|=0;return Math.abs(t).toString()}const Ir=({row:r,columnWidths:e={},level:t=0,rowHeight:n=26,offsetTop:s})=>{var S;const[a,i]=O.useState(!1),o=Ze(r)&&!!((S=r.children)!=null&&S.length),c=r.cells&&Object.keys(r.cells).length>0,l=o,f=t*20,u=()=>{o&&i(!a)},d={content:`${Se.rowContent} ${o?Se.clickable:""}`,toggle:`${Se.toggle}`,indent:`${Se.indent}`,cell:`${Se.cell}`},m=$=>g.jsx(Ve,{...$}),h=()=>g.jsx("span",{className:d.toggle,children:l&&g.jsx(oe,{icon:a?"arrow_drop_right":"arrow_drop_down",width:16})}),x=()=>g.jsx("span",{className:d.indent,style:{width:`${f}px`},"aria-hidden":"true"}),v=()=>{const $=ks(r)?"":r.decode||(c?"":"Untitled"),R=s??n*t;return g.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(${R}px)`},children:[Ze(r)&&g.jsxs("td",{className:Se.leftSection,style:{height:`${n}px`},children:[x(),h(),g.jsx("span",{className:Se.rowLabel,children:$})]}),r.cells&&Object.keys(r.cells).length>0&&Object.entries(r.cells).map(([y,P])=>g.jsx("td",{className:d.cell,style:{width:e[y],minWidth:e[y],height:`${n}px`},children:m({...P,id:y})},As(P)||y))]})},w=()=>{var $;return a||!o?null:g.jsx(g.Fragment,{children:Ze(r)&&(($=r.children)==null?void 0:$.map((R,y)=>g.jsx(Ir,{row:R,level:t+1},`child-${y}`)))})};return g.jsxs(g.Fragment,{children:[v(),w()]})},Ls=({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 g.jsx("tr",{className:i.tr,style:{height:e,top:t,lineHeight:`${e}px`},onClick:s,children:g.jsxs("td",{className:i.td,style:{paddingLeft:10+n*20},children:[g.jsx(oe,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),g.jsx(Ne,{variant:"title",bindValue:r})]})})};function Is(r,e){const t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t}function Ns(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,x=o(u,h);for(const[v,w]of x){const S=[...m,v],$=c(S,d),R=n.has($);s.push(l(v,$,d,R)),a+=t,R&&i(w,d+1,S)}}function o(u,d){var h;const m=new Map;for(const x of u){const v=((h=x.cells[d])==null?void 0:h.decode)??"N/D";m.has(v)||m.set(v,[]),m.get(v).push(x)}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 Fs=({groups:r=[],isDraggable:e=!0,isEditable:t=!0,onChange:n,onDrop:s,onDragOver:a})=>{const i=r.map(o=>({bindValue:o.column}));return g.jsxs("tr",{className:"smp-groupBar-container",onDragOver:a,onDrop:s,children:[g.jsx("td",{children:g.jsx(oe,{icon:"groups"})}),g.jsx("td",{children:g.jsx($t,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:n})})]})},Vs=({columns:r,columnWidths:e})=>g.jsx("tfoot",{children:g.jsx("tr",{children:r.map(t=>t.visible&&g.jsx("td",{className:Xe["smp-headerCell"],style:{width:e[t.name],minWidth:e[t.name],maxWidth:e[t.name]}},t.name))})}),Ys=({columns:r,rows:e,containerRef:t,sizingMode:n})=>{const[s,a]=O.useState({});return O.useEffect(()=>{var i,o;if(!(!r||r.length===0)){if(n==="fixed"){const l=Object.fromEntries(r.map(f=>[f.name,120]));a(l)}else if(n==="fit-grid"){const c=((i=t.current)==null?void 0:i.offsetWidth)||800,l=r.filter(d=>d.visible!==!1),f=c/l.length,u=Object.fromEntries(l.map(d=>[d.name,f]));a(u)}else if(n==="fit-content"){const c={};for(const l of r){if(!l.visible)continue;const f=((o=l.title)==null?void 0:o.length)||0,u=Math.max(...e.map(d=>{var m,h,x,v;return`${((h=(m=d.cells)==null?void 0:m[l.name])==null?void 0:h.decode)||((v=(x=d.cells)==null?void 0:x[l.name])==null?void 0:v.value)||""}`.length}),f);c[l.name]=u*8+24}a(c)}}},[r,e,t,n]),[s,a]},Us=({data:r,lineHeight:e=28,TableHeight:t=400,groups:n,columnSizingMode:s="fixed",showGroupBar:a=!0})=>{var E;const[i,o]=O.useState(r??{columns:[],rows:[]}),[c,l]=O.useState(n||[]),[f,u]=O.useState(new Set),d=O.useRef(null),[m,h]=Ys({columns:(i==null?void 0:i.columns)??[],rows:(i==null?void 0:i.rows)??[],containerRef:d,sizingMode:s});O.useEffect(()=>{if(c!=null&&c.length&&r.rows){const{flatRows:T}=Ms(r.rows,c,e,f);o({...r,rows:T})}else o(r)},[r,c,f,e]);const x=T=>{l(Ns(T,c))},v=T=>{T.preventDefault();const _=T.dataTransfer.getData("text/plain");if(!_||c.some(k=>k.column===_))return;const B=[...c,{column:_,visible:!0}];l(B)},w=T=>{T.preventDefault()},{virtualItems:S,containerProps:$,innerProps:R}=jr({items:(i==null?void 0:i.rows)??[],itemHeight:e,containerHeight:t,overscan:5}),y=(T,_)=>{const I=T.clientX,B=m[_],k=F=>{const H=F.clientX-I,G=Math.max(50,B+H);h(z=>({...z,[_]:G}))},j=()=>{window.removeEventListener("mousemove",k),window.removeEventListener("mouseup",j)};window.addEventListener("mousemove",k),window.addEventListener("mouseup",j)},P={smpTable:`${Xe["smp-table"]}`,headerCell:`${Xe["smp-headerCell"]}`,resizer:`${Xe["smp-resizer"]}`};return i&&g.jsx("div",{className:P.smpTable,...$,ref:d,children:g.jsxs("table",{children:[g.jsxs("thead",{children:[(n||a)&&g.jsx(Fs,{groups:c,onChange:x,onDrop:v,onDragOver:w}),g.jsx("tr",{children:i.columns&&((E=i.columns)==null?void 0:E.map(T=>T.visible&&g.jsxs("th",{className:P.headerCell,draggable:!0,onDragStart:_=>{_.dataTransfer.setData("text/plain",T.name)},style:{width:m[T.name],minWidth:m[T.name],maxWidth:m[T.name]},children:[g.jsx(Ne,{variant:"title",bindValue:T.title}),g.jsx("div",{className:P.resizer,onMouseDown:_=>y(_,T.name),role:"region"})]},T.name)))})]}),g.jsx("tbody",{...R,children:S.map(({item:T,index:_,offsetTop:I})=>{const B=T.rowId||T.value||`${T.isGroup?"group":"row"}-${_}`;return T.isGroup?g.jsx(Ls,{label:T.value||"",rowHeight:e,offsetTop:I,level:T.level,onClick:()=>{const k=T.rowId;k&&u(j=>Is(j,k))},isExpanded:T.isExpanded},`group-${B}`):g.jsx(Ir,{row:T,columnWidths:m,rowHeight:e,offsetTop:I,isGroup:!1},`row-${B}`)})}),g.jsx(Vs,{columns:i.columns,columnWidths:m})]})})},Ws=({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]=O.useState();O.useEffect(()=>{u(()=>{if(!r)return;const x={...r};return e&&(x.shape=e),x.shape==null&&(x.shape=re.TEXT_FIELD),s&&(x.obj=qr(s)),x})},[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 g.jsxs("div",{className:m.container,children:[g.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:g.jsx(Ve,{...f,id:"FLD",onChange:u,onOptionsRequest:l,fun:r==null?void 0:r.fun,onBlur:h,label:a,labelPosition:i})}),ce(t)&&g.jsx(we,{optionalDisplayValue:"Confirm",onClick:()=>c==null?void 0:c(f),bindValue:"Confirm"})]})},Bs=r=>(r==null?void 0:r.type)==="SmeupDataTree",Hs=r=>(r==null?void 0:r.type)==="SmeupDataTable",Gs=r=>Bs(r)?r.children?r.children.map(e=>({id:e.obj.k,label:e.value??""})):[]:Hs(r)?r.rows.map(e=>{const t=e.cells||e.cells,[n,s]=Object.keys(t);return{id:t[n].obj.k,label:t[s].value||t[s].obj.k}}):[],Ks=({data:r,readOnly:e=!1,hiddenSubmitButton:t=!1,updateOnClick:n=!1,optionsHandler:s,onSubmit:a,onCheck:i,onCheckObj:o})=>{const[c,l]=O.useState({}),{translate:f}=Ce();O.useEffect(()=>{l(h(r))},[r]);const u=(v,w)=>{l(S=>({...S,[v]:{...S[v],obj:{...S[v].obj,k:w.obj.k},decode:w.decode,data:{...S[v].data,error:void 0}}})),n&&(w.shape==re.CHECKBOX||w.shape==re.SWITCH)&&d()},d=()=>{const v=x();a({value:v})},m=async v=>{var w,S;if((w=c[v].inputSettings)!=null&&w.checkObject&&o&&((await o({obj:c[v].obj,fun:c[v].fun,cellId:v})).valid||l(R=>({...R,[v]:{...R[v],data:{...R[v].data,error:f(ut.CHECK_OBJECT_WRONG_VALIDATION)}}}))),(S=c[v].inputSettings)!=null&&S.checkValueOnExit){const $=x();i==null||i({value:$,cell:v})}},h=v=>{var S,$,R;if(!((S=v.rows)!=null&&S.length)||!(($=v.columns)!=null&&$.length))return{};const w=(R=v.rows)==null?void 0:R[0];return v.columns.filter(y=>y.visible??!0).reduce((y,P)=>{const E={...w.cells[P.name],id:P.name,label:P.title};return E.fun&&(E.onOptionsRequest=async(T,_)=>Gs(await s(T,_,r,P.name))),E.isEditable==null&&(E.isEditable=!0),e&&(E.isEditable=!1),E.isEditable&&E.shape==null&&(E.shape=re.TEXT_FIELD),{...y,[P.name]:E}},{})},x=()=>({before:r,after:{type:"SmeupDataTable",columns:JSON.parse(JSON.stringify(r.columns)),rows:[{cells:JSON.parse(JSON.stringify(c))}]}});return c&&g.jsxs("div",{"data-component":"input-panel",style:{display:"flex",flexDirection:"column",gap:"2rem",padding:"2rem"},children:[g.jsx(Ot,{layout:r.rows[0].layout,children:Object.values(c).map(v=>g.jsx(Ve,{...v,onChange:w=>u(v.id,w),onBlur:()=>m(v.id)}))}),!t&&g.jsx(we,{onClick:d,bindValue:"submit",optionalDisplayValue:"Submit"})]})};exports.AppBar=Es;exports.Autocomplete=_t;exports.Button=we;exports.ButtonList=_r;exports.Checkbox=$r;exports.Combobox=Cr;exports.DashList=Rs;exports.DataTableComponent=Us;exports.DatePicker=Ar;exports.Drawer=Os;exports.Field=Ws;exports.Icon=oe;exports.InputPanel=Ks;exports.Password=Lr;exports.Textfield=xe;exports.configurePaths=Sn;