@sme.up/ketchup2 2.0.0-SNAPSHOT-20250617073056 → 2.0.0-SNAPSHOT-20250617130134
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.
- package/dist/assets/buttonListAssets.d.ts.map +1 -1
- package/dist/assets/provinces.d.ts +3 -1
- package/dist/assets/provinces.d.ts.map +1 -1
- package/dist/assets/testAsset.d.ts.map +1 -1
- package/dist/basic-components/cell/tests/utils.d.ts +7 -1
- package/dist/basic-components/cell/tests/utils.d.ts.map +1 -1
- package/dist/basic-components/date-picker/date-picker-calendar/date-picker-calendar.d.ts.map +1 -1
- package/dist/basic-components/list/list.d.ts.map +1 -1
- package/dist/components/drawer/drawer.data.d.ts.map +1 -1
- package/dist/components/input-panel/assets/data.d.ts +1 -0
- package/dist/components/input-panel/assets/data.d.ts.map +1 -1
- package/dist/components/input-panel/input-panel-types.d.ts +3 -3
- package/dist/components/input-panel/input-panel-types.d.ts.map +1 -1
- package/dist/components/input-panel/input-panel.d.ts.map +1 -1
- package/dist/ketchup2.cjs.js +11 -11
- package/dist/ketchup2.css +1 -1
- package/dist/ketchup2.es.js +744 -730
- package/dist/types/data-structures.d.ts +1 -0
- package/dist/types/data-structures.d.ts.map +1 -1
- package/dist/utils/data-structures.d.ts +10 -0
- package/dist/utils/data-structures.d.ts.map +1 -0
- package/dist/utils/display-value.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/ketchup2.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var $r=Object.defineProperty;var Pr=(r,e,t)=>e in r?$r(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var ve=(r,e,t)=>Pr(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react");function Ar(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const ke=Ar(P);var Ie={exports:{}},
|
|
1
|
+
"use strict";var $r=Object.defineProperty;var Pr=(r,e,t)=>e in r?$r(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var ve=(r,e,t)=>Pr(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("react");function Ar(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const ke=Ar(P);var Ie={exports:{}},je={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Tt;function Lr(){if(Tt)return
|
|
9
|
+
*/var Tt;function Lr(){if(Tt)return je;Tt=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var o in s)o!=="key"&&(a[o]=s[o])}else a=s;return s=a.ref,{$$typeof:r,type:n,key:i,ref:s!==void 0?s:null,props:a}}return je.Fragment=e,je.jsx=t,je.jsxs=t,je}var Ce={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,37 +14,37 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Ot;function _r(){return Ot||(Ot=1,process.env.NODE_ENV!=="production"&&function(){function r(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===A?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case g:return"Fragment";case w:return"Profiler";case x:return"StrictMode";case b:return"Suspense";case _:return"SuspenseList";case
|
|
17
|
+
*/var Ot;function _r(){return Ot||(Ot=1,process.env.NODE_ENV!=="production"&&function(){function r(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===A?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case g:return"Fragment";case w:return"Profiler";case x:return"StrictMode";case b:return"Suspense";case _:return"SuspenseList";case D:return"Activity"}if(typeof h=="object")switch(typeof h.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),h.$$typeof){case m:return"Portal";case O:return(h.displayName||"Context")+".Provider";case E:return(h._context.displayName||"Context")+".Consumer";case S:var y=h.render;return h=h.displayName,h||(h=y.displayName||y.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case $:return y=h.displayName||null,y!==null?y:r(h.type)||"Memo";case U:y=h._payload,h=h._init;try{return r(h(y))}catch{}}return null}function e(h){return""+h}function t(h){try{e(h);var y=!1}catch{y=!0}if(y){y=console;var T=y.error,C=typeof Symbol=="function"&&Symbol.toStringTag&&h[Symbol.toStringTag]||h.constructor.name||"Object";return T.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",C),e(h)}}function n(h){if(h===g)return"<>";if(typeof h=="object"&&h!==null&&h.$$typeof===U)return"<...>";try{var y=r(h);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function s(){var h=j.A;return h===null?null:h.getOwner()}function a(){return Error("react-stack-top-frame")}function i(h){if(I.call(h,"key")){var y=Object.getOwnPropertyDescriptor(h,"key").get;if(y&&y.isReactWarning)return!1}return h.key!==void 0}function o(h,y){function T(){q||(q=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}T.isReactWarning=!0,Object.defineProperty(h,"key",{get:T,configurable:!0})}function u(){var h=r(this.type);return z[h]||(z[h]=!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.")),h=this.props.ref,h!==void 0?h:null}function c(h,y,T,C,R,L,F,V){return T=L.ref,h={$$typeof:d,type:h,key:y,props:L,_owner:R},(T!==void 0?T:null)!==null?Object.defineProperty(h,"ref",{enumerable:!1,get:u}):Object.defineProperty(h,"ref",{enumerable:!1,value:null}),h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(h,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(h,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:F}),Object.defineProperty(h,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:V}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h}function f(h,y,T,C,R,L,F,V){var M=y.children;if(M!==void 0)if(C)if(W(M)){for(C=0;C<M.length;C++)l(M[C]);Object.freeze&&Object.freeze(M)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else l(M);if(I.call(y,"key")){M=r(h);var J=Object.keys(y).filter(function(se){return se!=="key"});C=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",k[M+C]||(J=0<J.length?"{"+J.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,C,M,J,M),k[M+C]=!0)}if(M=null,T!==void 0&&(t(T),M=""+T),i(y)&&(t(y.key),M=""+y.key),"key"in y){T={};for(var G in y)G!=="key"&&(T[G]=y[G])}else T=y;return M&&o(T,typeof h=="function"?h.displayName||h.name||"Unknown":h),c(h,M,L,R,s(),T,F,V)}function l(h){typeof h=="object"&&h!==null&&h.$$typeof===
|
|
22
|
+
<%s key={someKey} {...props} />`,C,M,J,M),k[M+C]=!0)}if(M=null,T!==void 0&&(t(T),M=""+T),i(y)&&(t(y.key),M=""+y.key),"key"in y){T={};for(var G in y)G!=="key"&&(T[G]=y[G])}else T=y;return M&&o(T,typeof h=="function"?h.displayName||h.name||"Unknown":h),c(h,M,L,R,s(),T,F,V)}function l(h){typeof h=="object"&&h!==null&&h.$$typeof===d&&h._store&&(h._store.validated=1)}var p=P,d=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),O=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),A=Symbol.for("react.client.reference"),j=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=Object.prototype.hasOwnProperty,W=Array.isArray,B=console.createTask?console.createTask:function(){return null};p={"react-stack-bottom-frame":function(h){return h()}};var q,z={},X=p["react-stack-bottom-frame"].bind(p,a)(),H=B(n(a)),k={};Ce.Fragment=g,Ce.jsx=function(h,y,T,C,R){var L=1e4>j.recentlyCreatedOwnerStacks++;return f(h,y,T,!1,C,R,L?Error("react-stack-top-frame"):X,L?B(n(h)):H)},Ce.jsxs=function(h,y,T,C,R){var L=1e4>j.recentlyCreatedOwnerStacks++;return f(h,y,T,!0,C,R,L?Error("react-stack-top-frame"):X,L?B(n(h)):H)}}()),Ce}var Rt;function kr(){return Rt||(Rt=1,process.env.NODE_ENV==="production"?Ie.exports=Lr():Ie.exports=_r()),Ie.exports}var v=kr();const ne={AUTOCOMPLETE:"ACP",BUTTON_LIST:"BTL",BUTTON:"BTN",CHECKBOX:"CHK",CHIP:"CHI",COMBOBOX:"CMB",DATE:"CAL",ICON:"ICO",IMAGE:"IMG",MEMO:"MEM",MULTI_AUTOCOMPLETE:"AML",SPOTLIGHT:"SPL",SWITCH:"SWT",TEXT_FIELD:"ITX",PASSWORD:"PWD"},Ir=r=>r.t=="D8",Nr=r=>{if(r){const e=r.split(";");if(e.length==3)return{t:e[0],p:e[1],k:e[2]}}return{t:"",p:"",k:""}};class Be{constructor(e,t){ve(this,"class");ve(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Be(e,e.k=="1"||e.k=="true")}getValue(){return this.value}getLegacyValue(){if(this.class.t=="V2"){if(this.class.p=="SI/NO")return this.value?"1":" ";if(this.class.p=="ON/OFF")return this.value?"1":"0"}return this.value?"true":"false"}}function Mr(r,e){if(gt(r)){const 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,u=0,c="";switch(n.length){case 1:case 2:return o=parseInt(n),t.setDate(o),Ne(t)?t:r;case 3:case 4:return o=parseInt(n.substring(0,2)),u=parseInt(n.substring(2,4)),i===0?(t.setMonth(o-1),t.setDate(u)):a===0&&(t.setMonth(u-1),t.setDate(o)),Ne(t)?t:r;case 5:case 6:{o=parseInt(n.substring(0,2)),u=parseInt(n.substring(2,4)),Number(n.substring(4))>50?c="19"+n.substring(4):c="20"+n.substring(4);let f=0,l=0;return i===0?(f=u,l=o-1,t.setFullYear(parseInt(c),l,f)):a===0&&(f=o,l=u-1,t.setFullYear(parseInt(c),l,f)),ft(o,l,parseInt(c))&&Ne(t)?t:r}case 7:case 8:{o=parseInt(n.substring(0,2)),u=parseInt(n.substring(2,4)),c=n.substring(4);let f=0,l=0;return i===0?(f=u,l=o-1,t.setFullYear(parseInt(c),l,f)):a===0&&(f=o,l=u-1,t.setFullYear(parseInt(c),l,f)),ft(f,l,parseInt(c))&&Ne(t)?t:r}}return r}function gt(r){return/^\d{4}-\d{2}-\d{2}$/.test(r)&&r.length===10}function Ne(r){return r instanceof Date&&!isNaN(r.getTime())}function Fr(r){if(!/^\d{8}$/.test(r))return!1;const e=parseInt(r.slice(0,4),10),t=parseInt(r.slice(4,6),10),n=parseInt(r.slice(6,8),10);return ft(n,t-1,e)}function ft(r,e,t){const n=[31,Vr(t)?29:28,31,30,31,30,31,31,30,31,30,31];return!(e<0||e>11||r<1||r>n[e])}function Vr(r){return r%4===0&&(r%100!==0||r%400===0)}function Yr(r){const e=r.getFullYear(),t=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0");return isNaN(e)||isNaN(Number(t))||isNaN(Number(n))?r.toString():`${e}-${t}-${n}`}class Ge{constructor(e,t){ve(this,"class");ve(this,"date");this.class=e,this.date=t}static fromDataObj(e){const t=Dt.get(`${e.t}${e.p}`);if(t)return new Ge(e,t.legacyToIso(e.k));throw new Error(`Date creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=Dt.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 Dt=new Map([["D8*YYMD",{legacyToIso(r){return Fr(r)&&`${r.substring(0,4)}-${r.substring(4,6)}-${r.substring(6,8)}`||r},isoToLegacy(r){return gt(r)&&r.replaceAll("-","")||r}}]]),Ke=(r,e)=>{P.useEffect(()=>{const t=n=>{typeof r=="object"&&r!==null&&"current"in r&&r.current&&!r.current.contains(n.target)&&e()};return document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[r,e])};function yt({position:r="bottom",enabled:e=!0}){const t=P.useRef(null),n=P.useRef(null),[s,a]=P.useState(0),i=P.useCallback(()=>{const o=t.current,u=n.current;if(!o||!u)return;const{top:c,left:f,width:l,height:p}=o.getBoundingClientRect();a(l);const d=u.offsetHeight,m=u.offsetWidth;if(m===0||d===0){requestAnimationFrame(i);return}let g=c+window.scrollY,x=f+window.scrollX;switch(r){case"top":g-=d;break;case"bottom":g+=p;break;case"left":x-=m;break;case"right":x+=l;break}requestAnimationFrame(()=>{u.style.transform=`translate(${x}px, ${g}px)`})},[r]);return P.useLayoutEffect(()=>{e&&t.current&&n.current&&i();const o=new MutationObserver(()=>{n.current&&i()});return n.current&&o.observe(n.current,{childList:!0,subtree:!0}),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),()=>{window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),o.disconnect()}},[i,e]),{anchorRef:t,targetRef:n,anchorWidth:s}}const ze=(r,e,t)=>{if(r=="")return"";if(t)switch(t){case"CodeOnly":return r;case"DescOnly":return e||"";case"Both":return`${r} - ${e}`}return r},fr=({helperText:r,disabled:e,state:t,id:n})=>{const s={container:`smp-helper-text ${e?"smp-helper-text-disabled":""} ${t?`smp-helper-text-${t}`:""}`};return v.jsx("label",{className:s.container,id:n,children:r})},De=({label:r,disabled:e,htmlFor:t})=>{const n={container:`smp-label ${e?"smp-label-disabled":""}`};return v.jsx("label",{className:n.container,htmlFor:t,children:r})};function Ur(r,e){if(r==null)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.indexOf(n)!==-1)continue;t[n]=r[n]}return t}function qe(){return qe=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},qe.apply(null,arguments)}function dt(r,e){return dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},dt(r,e)}function Wr(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,dt(r,e)}function tt(r,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,a;n<s;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))}var Me={};/*!
|
|
23
23
|
* content-type
|
|
24
24
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
25
25
|
* MIT Licensed
|
|
26
|
-
*/var
|
|
26
|
+
*/var jt;function Hr(){if(jt)return Me;jt=1;var r=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,e=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,t=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,n=/\\([\u000b\u0020-\u00ff])/g,s=/([\\"])/g,a=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;Me.format=i,Me.parse=o;function i(l){if(!l||typeof l!="object")throw new TypeError("argument obj is required");var p=l.parameters,d=l.type;if(!d||!a.test(d))throw new TypeError("invalid type");var m=d;if(p&&typeof p=="object")for(var g,x=Object.keys(p).sort(),w=0;w<x.length;w++){if(g=x[w],!t.test(g))throw new TypeError("invalid parameter name");m+="; "+g+"="+c(p[g])}return m}function o(l){if(!l)throw new TypeError("argument string is required");var p=typeof l=="object"?u(l):l;if(typeof p!="string")throw new TypeError("argument string is required to be a string");var d=p.indexOf(";"),m=d!==-1?p.slice(0,d).trim():p.trim();if(!a.test(m))throw new TypeError("invalid media type");var g=new f(m.toLowerCase());if(d!==-1){var x,w,E;for(r.lastIndex=d;w=r.exec(p);){if(w.index!==d)throw new TypeError("invalid parameter format");d+=w[0].length,x=w[1].toLowerCase(),E=w[2],E.charCodeAt(0)===34&&(E=E.slice(1,-1),E.indexOf("\\")!==-1&&(E=E.replace(n,"$1"))),g.parameters[x]=E}if(d!==p.length)throw new TypeError("invalid parameter format")}return g}function u(l){var p;if(typeof l.getHeader=="function"?p=l.getHeader("content-type"):typeof l.headers=="object"&&(p=l.headers&&l.headers["content-type"]),typeof p!="string")throw new TypeError("content-type header is missing from object");return p}function c(l){var p=String(l);if(t.test(p))return p;if(p.length>0&&!e.test(p))throw new TypeError("invalid parameter value");return'"'+p.replace(s,"\\$1")+'"'}function f(l){this.parameters=Object.create(null),this.type=l}return Me}var Br=Hr(),Oe=new Map,dr=function(e){return e.cloneNode(!0)},Ct=function(){return window.location.protocol==="file:"},pr=function(e,t,n){var s=new XMLHttpRequest;s.onreadystatechange=function(){try{if(!/\.svg/i.test(e)&&s.readyState===2){var a=s.getResponseHeader("Content-Type");if(!a)throw new Error("Content type not found");var i=Br.parse(a).type;if(!(i==="image/svg+xml"||i==="text/plain"))throw new Error("Invalid content type: ".concat(i))}if(s.readyState===4){if(s.status===404||s.responseXML===null)throw new Error(Ct()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+e);if(s.status===200||Ct()&&s.status===0)n(null,s);else throw new Error("There was a problem injecting the SVG: "+s.status+" "+s.statusText)}}catch(o){if(s.abort(),o instanceof Error)n(o,s);else throw o}},s.open("GET",e),s.withCredentials=t,s.overrideMimeType&&s.overrideMimeType("text/xml"),s.send()},ye={},$t=function(e,t){ye[e]=ye[e]||[],ye[e].push(t)},Gr=function(e){for(var t=function(i,o){setTimeout(function(){if(Array.isArray(ye[e])){var u=Oe.get(e),c=ye[e][i];u instanceof SVGSVGElement&&c(null,dr(u)),u instanceof Error&&c(u),i===ye[e].length-1&&delete ye[e]}},0)},n=0,s=ye[e].length;n<s;n++)t(n)},Kr=function(e,t,n){if(Oe.has(e)){var s=Oe.get(e);if(s===void 0){$t(e,n);return}if(s instanceof SVGSVGElement){n(null,dr(s));return}}Oe.set(e,void 0),$t(e,n),pr(e,t,function(a,i){var o;a?Oe.set(e,a):((o=i.responseXML)===null||o===void 0?void 0:o.documentElement)instanceof SVGSVGElement&&Oe.set(e,i.responseXML.documentElement),Gr(e)})},zr=function(e,t,n){pr(e,t,function(s,a){var i;s?n(s):((i=a.responseXML)===null||i===void 0?void 0:i.documentElement)instanceof SVGSVGElement&&n(null,a.responseXML.documentElement)})},qr=0,Jr=function(){return++qr},he=[],Pt={},Xr="http://www.w3.org/2000/svg",rt="http://www.w3.org/1999/xlink",At=function(e,t,n,s,a,i,o){var u=e.getAttribute("data-src")||e.getAttribute("src");if(!u){o(new Error("Invalid data-src or src attribute"));return}if(he.indexOf(e)!==-1){he.splice(he.indexOf(e),1),e=null;return}he.push(e),e.setAttribute("src","");var c=s?Kr:zr;c(u,a,function(f,l){if(!l){he.splice(he.indexOf(e),1),e=null,o(f);return}var p=e.getAttribute("id");p&&l.setAttribute("id",p);var d=e.getAttribute("title");d&&l.setAttribute("title",d);var m=e.getAttribute("width");m&&l.setAttribute("width",m);var g=e.getAttribute("height");g&&l.setAttribute("height",g);var x=Array.from(new Set(tt(tt(tt([],(l.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();l.setAttribute("class",x);var w=e.getAttribute("style");w&&l.setAttribute("style",w),l.setAttribute("data-src",u);var E=[].filter.call(e.attributes,function(H){return/^data-\w[\w-]*$/.test(H.name)});if(Array.prototype.forEach.call(E,function(H){H.name&&H.value&&l.setAttribute(H.name,H.value)}),n){var O={clipPath:["clip-path"],"color-profile":["color-profile"],cursor:["cursor"],filter:["filter"],linearGradient:["fill","stroke"],marker:["marker","marker-start","marker-mid","marker-end"],mask:["mask"],path:[],pattern:["fill","stroke"],radialGradient:["fill","stroke"]},S,b,_,$,U;Object.keys(O).forEach(function(H){S=H,_=O[H],b=l.querySelectorAll(S+"[id]");for(var k=function(C,R){$=b[C].id,U=$+"-"+Jr();var L;Array.prototype.forEach.call(_,function(Y){L=l.querySelectorAll("["+Y+'*="'+$+'"]');for(var Z=0,te=L.length;Z<te;Z++){var re=L[Z].getAttribute(Y);re&&!re.match(new RegExp('url\\("?#'+$+'"?\\)'))||L[Z].setAttribute(Y,"url(#"+U+")")}});for(var F=l.querySelectorAll("[*|href]"),V=[],M=0,J=F.length;M<J;M++){var G=F[M].getAttributeNS(rt,"href");G&&G.toString()==="#"+b[C].id&&V.push(F[M])}for(var se=0,N=V.length;se<N;se++)V[se].setAttributeNS(rt,"href","#"+U);b[C].id=U},h=0,y=b.length;h<y;h++)k(h)})}l.removeAttribute("xmlns:a");for(var D=l.querySelectorAll("script"),A=[],j,I,W=0,B=D.length;W<B;W++)I=D[W].getAttribute("type"),(!I||I==="application/ecmascript"||I==="application/javascript"||I==="text/javascript")&&(j=D[W].innerText||D[W].textContent,j&&A.push(j),l.removeChild(D[W]));if(A.length>0&&(t==="always"||t==="once"&&!Pt[u])){for(var q=0,z=A.length;q<z;q++)new Function(A[q])(window);Pt[u]=!0}var X=l.querySelectorAll("style");if(Array.prototype.forEach.call(X,function(H){H.textContent+=""}),l.setAttribute("xmlns",Xr),l.setAttribute("xmlns:xlink",rt),i(l),!e.parentNode){he.splice(he.indexOf(e),1),e=null,o(new Error("Parent node is null"));return}e.parentNode.replaceChild(l,e),he.splice(he.indexOf(e),1),e=null,o(null,l)})},Zr=function(e,t){var n=t===void 0?{}:t,s=n.afterAll,a=s===void 0?function(){}:s,i=n.afterEach,o=i===void 0?function(){}:i,u=n.beforeEach,c=u===void 0?function(){}:u,f=n.cacheRequests,l=f===void 0?!0:f,p=n.evalScripts,d=p===void 0?"never":p,m=n.httpRequestWithCredentials,g=m===void 0?!1:m,x=n.renumerateIRIElements,w=x===void 0?!0:x;if(e&&"length"in e)for(var E=0,O=0,S=e.length;O<S;O++)At(e[O],d,w,l,g,c,function(b,_){o(b,_),e&&"length"in e&&e.length===++E&&a(E)});else e?At(e,d,w,l,g,c,function(b,_){o(b,_),a(1),e=null}):a(0)},Fe={exports:{}},Ve={exports:{}},Q={};/** @license React v16.13.1
|
|
27
27
|
* react-is.production.min.js
|
|
28
28
|
*
|
|
29
29
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var Lt;function Qr(){if(Lt)return Q;Lt=1;var r=typeof Symbol=="function"&&Symbol.for,e=r?Symbol.for("react.element"):60103,t=r?Symbol.for("react.portal"):60106,n=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,i=r?Symbol.for("react.provider"):60109,o=r?Symbol.for("react.context"):60110,
|
|
33
|
+
*/var Lt;function Qr(){if(Lt)return Q;Lt=1;var r=typeof Symbol=="function"&&Symbol.for,e=r?Symbol.for("react.element"):60103,t=r?Symbol.for("react.portal"):60106,n=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,i=r?Symbol.for("react.provider"):60109,o=r?Symbol.for("react.context"):60110,u=r?Symbol.for("react.async_mode"):60111,c=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,l=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,d=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,x=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function O(b){if(typeof b=="object"&&b!==null){var _=b.$$typeof;switch(_){case e:switch(b=b.type,b){case u:case c:case n:case a:case s:case l:return b;default:switch(b=b&&b.$$typeof,b){case o:case f:case m:case d:case i:return b;default:return _}}case t:return _}}}function S(b){return O(b)===c}return Q.AsyncMode=u,Q.ConcurrentMode=c,Q.ContextConsumer=o,Q.ContextProvider=i,Q.Element=e,Q.ForwardRef=f,Q.Fragment=n,Q.Lazy=m,Q.Memo=d,Q.Portal=t,Q.Profiler=a,Q.StrictMode=s,Q.Suspense=l,Q.isAsyncMode=function(b){return S(b)||O(b)===u},Q.isConcurrentMode=S,Q.isContextConsumer=function(b){return O(b)===o},Q.isContextProvider=function(b){return O(b)===i},Q.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},Q.isForwardRef=function(b){return O(b)===f},Q.isFragment=function(b){return O(b)===n},Q.isLazy=function(b){return O(b)===m},Q.isMemo=function(b){return O(b)===d},Q.isPortal=function(b){return O(b)===t},Q.isProfiler=function(b){return O(b)===a},Q.isStrictMode=function(b){return O(b)===s},Q.isSuspense=function(b){return O(b)===l},Q.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===c||b===a||b===s||b===l||b===p||typeof b=="object"&&b!==null&&(b.$$typeof===m||b.$$typeof===d||b.$$typeof===i||b.$$typeof===o||b.$$typeof===f||b.$$typeof===x||b.$$typeof===w||b.$$typeof===E||b.$$typeof===g)},Q.typeOf=O,Q}var ee={};/** @license React v16.13.1
|
|
34
34
|
* react-is.development.js
|
|
35
35
|
*
|
|
36
36
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
37
37
|
*
|
|
38
38
|
* This source code is licensed under the MIT license found in the
|
|
39
39
|
* LICENSE file in the root directory of this source tree.
|
|
40
|
-
*/var _t;function en(){return _t||(_t=1,process.env.NODE_ENV!=="production"&&function(){var r=typeof Symbol=="function"&&Symbol.for,e=r?Symbol.for("react.element"):60103,t=r?Symbol.for("react.portal"):60106,n=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,i=r?Symbol.for("react.provider"):60109,o=r?Symbol.for("react.context"):60110,
|
|
40
|
+
*/var _t;function en(){return _t||(_t=1,process.env.NODE_ENV!=="production"&&function(){var r=typeof Symbol=="function"&&Symbol.for,e=r?Symbol.for("react.element"):60103,t=r?Symbol.for("react.portal"):60106,n=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,i=r?Symbol.for("react.provider"):60109,o=r?Symbol.for("react.context"):60110,u=r?Symbol.for("react.async_mode"):60111,c=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,l=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,d=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,x=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function O(N){return typeof N=="string"||typeof N=="function"||N===n||N===c||N===a||N===s||N===l||N===p||typeof N=="object"&&N!==null&&(N.$$typeof===m||N.$$typeof===d||N.$$typeof===i||N.$$typeof===o||N.$$typeof===f||N.$$typeof===x||N.$$typeof===w||N.$$typeof===E||N.$$typeof===g)}function S(N){if(typeof N=="object"&&N!==null){var Y=N.$$typeof;switch(Y){case e:var Z=N.type;switch(Z){case u:case c:case n:case a:case s:case l:return Z;default:var te=Z&&Z.$$typeof;switch(te){case o:case f:case m:case d:case i:return te;default:return Y}}case t:return Y}}}var b=u,_=c,$=o,U=i,D=e,A=f,j=n,I=m,W=d,B=t,q=a,z=s,X=l,H=!1;function k(N){return H||(H=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),h(N)||S(N)===u}function h(N){return S(N)===c}function y(N){return S(N)===o}function T(N){return S(N)===i}function C(N){return typeof N=="object"&&N!==null&&N.$$typeof===e}function R(N){return S(N)===f}function L(N){return S(N)===n}function F(N){return S(N)===m}function V(N){return S(N)===d}function M(N){return S(N)===t}function J(N){return S(N)===a}function G(N){return S(N)===s}function se(N){return S(N)===l}ee.AsyncMode=b,ee.ConcurrentMode=_,ee.ContextConsumer=$,ee.ContextProvider=U,ee.Element=D,ee.ForwardRef=A,ee.Fragment=j,ee.Lazy=I,ee.Memo=W,ee.Portal=B,ee.Profiler=q,ee.StrictMode=z,ee.Suspense=X,ee.isAsyncMode=k,ee.isConcurrentMode=h,ee.isContextConsumer=y,ee.isContextProvider=T,ee.isElement=C,ee.isForwardRef=R,ee.isFragment=L,ee.isLazy=F,ee.isMemo=V,ee.isPortal=M,ee.isProfiler=J,ee.isStrictMode=G,ee.isSuspense=se,ee.isValidElementType=O,ee.typeOf=S}()),ee}var kt;function hr(){return kt||(kt=1,process.env.NODE_ENV==="production"?Ve.exports=Qr():Ve.exports=en()),Ve.exports}/*
|
|
41
41
|
object-assign
|
|
42
42
|
(c) Sindre Sorhus
|
|
43
43
|
@license MIT
|
|
44
|
-
*/var nt,It;function tn(){if(It)return nt;It=1;var r=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function s(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var i={},o=0;o<10;o++)i["_"+String.fromCharCode(o)]=o;var
|
|
45
|
-
Valid keys: `+JSON.stringify(Object.keys(h),null," "));var N=se(V,G,R,L,F+"."+G,t);if(N)return N}return null}return x(y)}function B(h){switch(typeof h){case"number":case"string":case"undefined":return!0;case"boolean":return!h;case"object":if(Array.isArray(h))return h.every(B);if(h===null||o(h))return!0;var y=l(h);if(y){var T=y.call(h),C;if(y!==h.entries){for(;!(C=T.next()).done;)if(!B(C.value))return!1}else for(;!(C=T.next()).done;){var R=C.value;if(R&&!B(R[1]))return!1}}else return!1;return!0;default:return!1}}function q(h,y){return h==="symbol"?!0:y?y["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&y instanceof Symbol:!1}function z(h){var y=typeof h;return Array.isArray(h)?"array":h instanceof RegExp?"object":q(y,h)?"symbol":y}function X(h){if(typeof h>"u"||h===null)return""+h;var y=z(h);if(y==="object"){if(h instanceof Date)return"date";if(h instanceof RegExp)return"regexp"}return y}function H(h){var y=X(h);switch(y){case"array":case"object":return"an "+y;case"boolean":case"date":case"regexp":return"a "+y;default:return y}}function k(h){return!h.constructor||!h.constructor.name?d:h.constructor.name}return p.checkPropTypes=s,p.resetWarningCache=s.resetWarningCache,p.PropTypes=p,p},ot}var lt,Yt;function sn(){if(Yt)return lt;Yt=1;var r=vt();function e(){}function t(){}return t.resetWarningCache=e,lt=function(){function n(i,o,f,c,u,l){if(l!==r){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}n.isRequired=n;function s(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:e};return a.PropTypes=a,a},lt}var Ut;function an(){if(Ut)return Fe.exports;if(Ut=1,process.env.NODE_ENV!=="production"){var r=hr(),e=!0;Fe.exports=nn()(r.isElement,e)}else Fe.exports=sn()();return Fe.exports}var ie=an(),on=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},ln=function(e,t){for(var n in e)if(!(n in t))return!0;for(var s in t)if(e[s]!==t[s])return!0;return!1},cn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Ye="http://www.w3.org/2000/svg",Wt="http://www.w3.org/1999/xlink",Re=function(r){function e(){for(var n,s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];return n=r.call.apply(r,[this].concat(a))||this,n.initialState={hasError:!1,isLoading:!0},n.state=n.initialState,n._isMounted=!1,n.reactWrapper=void 0,n.nonReactWrapper=void 0,n.refCallback=function(o){n.reactWrapper=o},n}Wr(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof on(this.reactWrapper).Node){var a=this.props,i=a.desc,o=a.evalScripts,f=a.httpRequestWithCredentials,c=a.renumerateIRIElements,u=a.src,l=a.title,d=a.useRequestCache,p=this.props.onError,m=this.props.beforeInjection,g=this.props.afterInjection,x=this.props.wrapper,w,E;x==="svg"?(w=document.createElementNS(Ye,x),w.setAttribute("xmlns",Ye),w.setAttribute("xmlns:xlink",Wt),E=document.createElementNS(Ye,x)):(w=document.createElement(x),E=document.createElement(x)),w.appendChild(E),E.dataset.src=u,this.nonReactWrapper=this.reactWrapper.appendChild(w);var O=function($){if(s.removeSVG(),!s._isMounted){p($);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){p($)})},S=function($,U){if($){O($);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{g(U)}catch(j){O(j)}})},b=function($){if($.setAttribute("role","img"),i){var U=$.querySelector(":scope > desc");U&&$.removeChild(U);var j=document.createElement("desc");j.innerHTML=i,$.prepend(j)}if(l){var A=$.querySelector(":scope > title");A&&$.removeChild(A);var D=document.createElement("title");D.innerHTML=l,$.prepend(D)}try{m($)}catch(I){O(I)}};Zr(E,{afterEach:S,beforeEach:b,cacheRequests:d,evalScripts:o,httpRequestWithCredentials:f,renumerateIRIElements:c})}},t.removeSVG=function(){var s;(s=this.nonReactWrapper)!=null&&s.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},t.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},t.componentDidUpdate=function(s){var a=this;ln(qe({},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,f=Ur(s,cn),c=o;return ke.createElement(c,qe({},f,{ref:this.refCallback},o==="svg"?{xmlns:Ye,xmlnsXlink:Wt}:{}),this.state.isLoading&&i&&ke.createElement(i,null),this.state.hasError&&a&&ke.createElement(a,null))},e}(ke.Component);Re.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};Re.propTypes={afterInjection:ie.func,beforeInjection:ie.func,desc:ie.string,evalScripts:ie.oneOf(["always","once","never"]),fallback:ie.oneOfType([ie.func,ie.object,ie.string]),httpRequestWithCredentials:ie.bool,loading:ie.oneOfType([ie.func,ie.object,ie.string]),onError:ie.func,renumerateIRIElements:ie.bool,src:ie.string.isRequired,title:ie.string,useRequestCache:ie.bool,wrapper:ie.oneOf(["div","span","svg"])};let pt={assets:"/"};const un=r=>{pt={...pt,...r}},Ht=r=>`${pt.assets}/${r}`.replace(/\/+/g,"/"),le=P.memo(({icon:r,width:e,height:t,placeholderIcon:n,color:s,disabled:a,state:i="base",rotated:o=!1,onClick:f,isInteractable:c=!1,spin:u=!1,title:l,tabIndex:d})=>{const[p,m]=P.useState(r),g=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),x=g&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),w=Ht(`assets/svg/${r}.svg`),E=Ht(`assets/svg/${n}.svg`),O={img:`${c?"smp-image-interactable":""}`,svg:`smp-icon ${i?`smp-icon-${i}`:""} ${o?"smp-icon-rotated":""} ${c?"smp-icon-interactable":""} ${u?"smp-icon-spin":""}`},S=()=>{!a&&c&&f&&f()},b=_=>{!a&&c&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),S())};return v.jsx(v.Fragment,{children:x?v.jsx(Re,{src:r,fallback:()=>v.jsx(Re,{src:E,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:l,role:"application",fill:s,"aria-disabled":a,className:O.svg,onClick:S,onKeyDown:b,tabIndex:d}):g?v.jsx("img",{src:p,width:e||"16px",height:t||"auto",alt:l,onError:()=>m(E),onClick:S,className:O.img,title:l,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&S()}}):v.jsx(Re,{src:w,fallback:()=>v.jsx(Re,{src:E,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:l,role:"application",fill:s,"aria-disabled":a,className:O.svg,onClick:S,onKeyDown:b,tabIndex:d})})}),we=({disabled:r,bindValue:e,icon:t,onBlur:n,onChange:s,placeholder:a,isEditable:i=!0,shapeIcon:o,sizing:f,state:c,variant:u,rotatedShapeIcon:l=!1,onShapeIconClick:d,ref:p,inputRef:m,onKeyDown:g,inputType:x="text",ariaLabel:w="input field",label:E,helperText:O=!1,error:S,appearance:b="base",fullWidth:_=!1,_dataComponent:$="textfield",width:U})=>{const j=P.useId(),A=`${j}-helper`,D=S?"danger":c,I=S||c=="danger"?"error":o,W=O||!!S,B=X=>{s==null||s(X.target.value)},q={wrapper:`smp-textfield-wrapper ${_?"smp-textfield-fullWidth":""}`,container:`smp-textfield ${r?"smp-textfield-disabled":""} ${a?"smp-textfield-placeholder":""} ${f?`smp-textfield-${f}`:""} ${D?`smp-textfield-${D}`:""} ${b?`smp-textfield-${b}`:""} ${i?"":"smp-textfield-readOnly"}`,input:"smp-textfield-input "};u&&(u!="notSelectable"||i)&&(q.container+=`smp-textfield-variant-${u}`);const z=U?{"--smp-textField-width-base":U}:void 0;return v.jsxs("div",{className:q.wrapper,"data-component":$,children:[E&&v.jsx(je,{label:E,disabled:r,htmlFor:j}),v.jsxs("div",{className:q.container,ref:p,style:z,children:[t&&v.jsx(le,{icon:t,disabled:r}),v.jsx("input",{id:j,type:x,value:e,placeholder:a,onChange:B,onBlur:n,className:q.input,disabled:r,readOnly:!i,onKeyDown:g,"aria-label":w,ref:m,"aria-describedby":W?A:void 0}),I&&v.jsx(le,{icon:I,disabled:r,state:D,onClick:d,rotated:l,isInteractable:i,tabIndex:0})]}),W&&v.jsx(fr,{helperText:S,disabled:r,state:D,id:A})]})};function gr({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=P.useState(0),i=P.useRef(null),o=r.length*e,f=Math.max(0,Math.floor(s/e)-n),c=Math.min(r.length-1,Math.floor((s+t)/e)+n),u=[];for(let p=f;p<=c;p++)u.push({item:r[p],index:p,offsetTop:p*e});const l=P.useCallback(p=>{const m=p.target.scrollTop;a(m)},[]),d=p=>{if(!i.current)return;const m=p*e,g=m+e,x=i.current,w=x.scrollTop,E=w+t;m<w?x.scrollTop=m:g>E&&(x.scrollTop=g-t)};return{virtualItems:u,containerProps:{ref:i,style:{maxHeight:`${t}px`,overflowY:"auto",position:"relative",willChange:"transform"},onScroll:l},innerProps:{style:{height:`${o}px`,position:"relative",width:"100%"}},scrollInfo:{scrollTop:s,viewportHeight:t,totalHeight:o,startIndex:f,endIndex:c},scrollToIndex:d}}const fn=10,yr=({id:r,options:e,displayMode:t,ref:n,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:f,onKeyDown:c})=>{var A;const[u,l]=P.useState(""),d=24,[p,m]=P.useState(a!==null?a:-1),g=s!==void 0?s:e.length>fn,x=u?e.filter(D=>D.label.toLowerCase().includes(u.toLowerCase())):e,w=D=>{l(D)},{virtualItems:E,containerProps:O,innerProps:S,scrollToIndex:b}=gr({items:x,itemHeight:d,containerHeight:200,overscan:5});P.useEffect(()=>{a!==null&&a!==p&&m(a)},[a]),P.useEffect(()=>{p>=0&&p<x.length&&b(p)},[p,x]);const _=D=>{if(D.key==="ArrowDown"||D.key==="ArrowUp"){D.preventDefault();let I=p;D.key==="ArrowDown"?I=p<x.length-1?p+1:0:D.key==="ArrowUp"&&(I=p>0?p-1:x.length-1),m(I)}else D.key==="Enter"?p>=0&&p<x.length&&(f==null||f(x[p])):D.key==="Escape"&&(D.preventDefault(),D.stopPropagation());c&&c(D)},$=D=>{_(D)},U=D=>{_(D)},j={wrapper:"smp-list",container:"smp-list-container",virtualScroll:"smp-list-virtualScroll",listItem:"smp-list-listItem"};return v.jsxs("div",{id:r,ref:n,className:j.wrapper,"data-component":"list",style:{width:o},children:[g&&v.jsx(we,{bindValue:u,placeholder:"Search...",onChange:w,onKeyDown:$}),v.jsx("div",{...O,className:j.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:U,"aria-activedescendant":p>=0&&p<x.length?(A=x[p])==null?void 0:A.id:void 0,children:v.jsx("div",{...S,className:j.virtualScroll,children:E.map(({item:D,index:I,offsetTop:W})=>{const B=i.includes(D.id);return v.jsxs("li",{role:"option",id:D.id,"aria-selected":p===I?"true":"false",tabIndex:-1,className:`${j.listItem} ${p===I?"selected-item":""}`,"aria-label":D.id+"-"+D.label,style:{height:`${d}px`,lineHeight:`calc(${d}px - 2*2px)`,transform:`translateY(${W}px)`},onClick:()=>{f==null||f(D),m(I)},children:[ze(D.id,D.label,t),B&&v.jsx(le,{icon:"check",width:16})]},D.id)})})})]})},vr=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=P.useState(ze(e,t,r));return P.useEffect(()=>{a(e)},[e]),P.useEffect(()=>{a(ze(e,t,r))},[t,r]),v.jsx(we,{...n,bindValue:s})},dn=r=>{const e=P.useRef(null);return P.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},r)}},bt=({bindValue:r,optionalDisplayValue:e,options:t,displayMode:n,listDisplayMode:s="Both",minimumChars:a=3,isEditable:i=!0,placeholder:o,fun:f,_changeOnEnter:c=!1,onChange:u,onOptionsRequest:l,_multiActiveIndex:d,...p})=>{const[m,g]=P.useState(r),[x,w]=P.useState(e),[E,O]=P.useState(!1),[S,b]=P.useState(t||[]),[_,$]=P.useState(0),[U,j]=P.useState([r]),{anchorRef:A,targetRef:D,anchorWidth:I}=yt({position:"bottom",enabled:E});Ke(D,()=>O(!1));const W=dn(400),B=H=>{H.length>=a?f&&l&&W(async()=>{const k=await l(f,H);b(k),$(k.length>0?0:-1),O(!0)}):O(!1),g(H),w(e),c||u==null||u(H,e)},q=H=>{c?(g(""),w("")):(g(H.id),w(H.label)),u==null||u(H.id,H.label);const k=S.findIndex(h=>h.id===H.id);$(k),j([H.id]),O(!1)},z=H=>{H.key==="Escape"&&(O(!1),$(-1))},X=H=>{if((H.key==="ArrowDown"||H.key==="ArrowUp")&&(H.preventDefault(),E)){const k=H.key==="ArrowDown"?(_+1)%S.length:(_-1+S.length)%S.length;$(k)}switch(H.key){case"Enter":_>=0&&_<S.length?q(S[_]):c&&(u==null||u(m,""),O(!1),g(""),w(""));break;case"Escape":O(!1),$(-1);break}};return v.jsxs("div",{"data-component":"autocomplete",children:[v.jsx(vr,{...p,bindValue:m,optionalDisplayValue:x,displayMode:n,isEditable:i,shapeIcon:"magnify",placeholder:o,ref:A,onChange:B,onKeyDown:X,"aria-autocomplete":"list"}),E&&v.jsx(yr,{options:S,displayMode:s,onClick:q,ref:D,selectedIndex:_,activeIndex:d||U,width:I,showFilter:!1,onKeyDown:z})]})},Bt=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],Gt=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],xe=({label:r,onClick:e,ariaLabel:t,icon:n,disabled:s,sizing:a="base",variant:i="primary",appearance:o="raised",showIcon:f=!0,showText:c=!0,fullWidth:u=!1,loading:l=!1,justify:d="center",title:p,optionalDisplayValue:m})=>{const g={container:`smp-button smp-button-container ${a?`smp-button-${a}`:""} ${i?`smp-buttonVariant-${i}`:""} ${o?`smp-buttonType-${o}`:""} ${u?"smp-button-fullWidth":""} smp-justifyContent-${d}`};return v.jsx("button",{"data-component":"button",className:g.container,onClick:e,"aria-label":t,disabled:s,"aria-busy":l,title:p||r||m,children:l?v.jsx(le,{icon:"spinner",state:Gt(i),spin:!0}):v.jsxs(v.Fragment,{children:[n&&f&&v.jsx(le,{icon:n,disabled:s,state:Gt(i),width:Bt(a),height:Bt(a)}),c&&m&&v.jsx("span",{children:m})]})})},br=({options:r,fun:e,direction:t="row",disposition:n="start",sizing:s,variant:a,appearance:i,showText:o,showIcon:f,fullWidth:c,disabled:u,justify:l,onClick:d,onOptionsRequest:p})=>{const[m,g]=P.useState(r);P.useEffect(()=>{!m&&p&&e&&p(e,void 0).then(E=>g(E)).catch(E=>{console.error("Errore nel caricamento delle opzioni per ButtonList",E)})},[m,e,p]);const x={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${n}`},w=m==null?void 0:m.map((E,O)=>{const S={bindValue:E.id,optionalDisplayValue:E.label,fun:E.fun,icon:E.icon,variant:a,appearance:i,showText:o,showIcon:f,fullWidth:c,disabled:u,sizing:s,justify:l,onClick:()=>{d==null||d(E.id,E.fun)}};return v.jsx(xe,{...S},`button-${O}`)});return v.jsx("div",{role:"list","data-component":"button-list",className:x.container,children:w})},xr=({bindValue:r,_dataComponent:e="checkbox",disabled:t,label:n,isEditable:s=!0,onChange:a,onBlur:i})=>{const o=c=>{s&&a&&a(c.target.checked)},f={wrapper:"smp-checkbox-wrapper"};return v.jsxs("div",{className:f.wrapper,"data-component":e,children:[n&&v.jsx(je,{label:n,disabled:t}),v.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:o,onBlur:i})]})},pn={titleLarge:"h2",title:"h3",body:"h6",label:"label"},Ae=({variant:r="body",bindValue:e,color:t,...n})=>{const s=pn[r],a={container:`smp-typography ${r?`smp-typography-${r}`:""} ${n.disabled?"smp-typography-disabled":""}`};return v.jsx(s,{className:a.container,disabled:n.disabled,style:{"--smp-typography-color-base":t},children:e})},xt=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,f]=P.useState(null),c={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},u=p=>{n==null||n(r.filter((m,g)=>g!==p))},l=p=>{f(p)},d=p=>{if(o===null||o===p)return;const m=[...r],[g]=m.splice(o,1);m.splice(p,0,g),n==null||n(m),f(null)};return v.jsx("div",{className:c.container,role:"list","data-component":"chip",children:r.flatMap((p,m)=>{const g=ze(p.bindValue,p.optionalDisplayValue,t),x=v.jsxs("div",{className:c.element,role:"listitem",draggable:i,onDragStart:()=>l(m),onDragOver:E=>i&&E.preventDefault(),onDrop:()=>i&&d(m),style:{"--smp-chips-backgroundColor-base":a},children:[i&&v.jsx(le,{icon:"drag_indicator_horizontal",isInteractable:!0}),v.jsx(Ae,{variant:"label",bindValue:g,color:s}),e&&v.jsx(le,{icon:"close",isInteractable:!0,onClick:()=>u(m),color:s})]},`chip-${m}`),w=i&&m<r.length-1?v.jsx(le,{icon:"chevron-right",color:s},`separator-${m}`):null;return[x,w].filter(Boolean)})})};function Sr(r,e){const t=P.useRef(null);P.useEffect(()=>{if(!r)return;const n=typeof e=="object"&&e!==null&&"current"in e?e.current:null;if(!n)return;t.current=document.activeElement;const s=()=>n?Array.from(n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(c=>!c.hasAttribute("disabled")&&c.offsetParent!==null):[];(()=>{const c=s();c.length>0&&requestAnimationFrame(()=>c[0].focus())})();const i=c=>{if(c.key==="Escape"||c.key!=="Tab")return;const u=s();if(u.length===0)return;const l=u[0],d=u[u.length-1];c.shiftKey&&document.activeElement===l?(c.preventDefault(),d.focus()):!c.shiftKey&&document.activeElement===d&&(c.preventDefault(),l.focus())},o=c=>{if(n&&!n.contains(c.target)){c.preventDefault();const u=s();u.length>0&&u[0].focus()}};document.addEventListener("keydown",i),document.addEventListener("mousedown",o);const f=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",o),document.body.style.overflow=f,t.current&&requestAnimationFrame(()=>{var c;(c=t.current)==null||c.focus()})}},[r,e])}const wr=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,isEditable:s,displayMode:a,listDisplayMode:i="Both",fun:o,onOptionsRequest:f,multiActiveIndex:c,...u})=>{const[l,d]=P.useState(!1),[p,m]=P.useState(t),[g,x]=P.useState(-1),[w,E]=P.useState([r]),O=P.useId(),{anchorRef:S,targetRef:b,anchorWidth:_}=yt({position:"bottom",enabled:l});Ke(b,()=>d(!1)),Sr(l,b);const $=D=>{e==null||e(D.id,D.label);const I=p.findIndex(W=>W.id===D.id);x(I),E([D.id]),d(!1)},U=D=>{D.key==="Escape"&&(d(!1),x(-1))},j=D=>{(D.key==="ArrowDown"||D.key==="ArrowUp")&&(D.preventDefault(),A())},A=()=>{o&&f&&f(o,void 0).then(D=>{m(D),x(D.length>0?0:-1),d(!0)})};return v.jsxs("div",{role:"combobox","aria-expanded":l,"aria-controls":O,"aria-owns":O,"data-component":"combobox",children:[v.jsx(vr,{...u,bindValue:r,optionalDisplayValue:n,displayMode:a,onShapeIconClick:A,onKeyDown:j,shapeIcon:"arrow_drop_down",rotatedShapeIcon:l,isEditable:s,ref:S,"aria-autocomplete":"list",variant:"notSelectable"}),l&&v.jsx(yr,{id:O,options:p,displayMode:i,ref:b,selectedIndex:g,activeIndex:c||w,width:_,onClick:$,onKeyDown:U})]})},K=r=>typeof r=="string",$e=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},Kt=r=>r==null?"":""+r,hn=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},mn=/###/g,zt=r=>r&&r.indexOf("###")>-1?r.replace(mn,"."):r,qt=r=>!r||K(r),Pe=(r,e,t)=>{const n=K(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(qt(r))return{};const a=zt(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return qt(r)?{}:{obj:r,k:zt(n[s])}},Jt=(r,e,t)=>{const{obj:n,k:s}=Pe(r,e,Object);if(n!==void 0||e.length===1){n[s]=t;return}let a=e[e.length-1],i=e.slice(0,e.length-1),o=Pe(r,i,Object);for(;o.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),o=Pe(r,i,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=t},gn=(r,e,t,n)=>{const{obj:s,k:a}=Pe(r,e,Object);s[a]=s[a]||[],s[a].push(t)},Je=(r,e)=>{const{obj:t,k:n}=Pe(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},yn=(r,e,t)=>{const n=Je(r,t);return n!==void 0?n:Je(e,t)},Er=(r,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?K(r[n])||r[n]instanceof String||K(e[n])||e[n]instanceof String?t&&(r[n]=e[n]):Er(r[n],e[n],t):r[n]=e[n]);return r},Te=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var vn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const bn=r=>K(r)?r.replace(/[&<>"'\/]/g,e=>vn[e]):r;class xn{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const Sn=[" ",",","?","!",";"],wn=new xn(20),En=(r,e,t)=>{e=e||"",t=t||"";const n=Sn.filter(i=>e.indexOf(i)<0&&t.indexOf(i)<0);if(n.length===0)return!0;const s=wn.getRegExp(`(${n.map(i=>i==="?"?"\\?":i).join("|")})`);let a=!s.test(r);if(!a){const i=r.indexOf(t);i>0&&!s.test(r.substring(0,i))&&(a=!0)}return a},ht=(r,e,t=".")=>{if(!r)return;if(r[e])return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0;const n=e.split(t);let s=r;for(let a=0;a<n.length;){if(!s||typeof s!="object")return;let i,o="";for(let f=a;f<n.length;++f)if(f!==a&&(o+=t),o+=n[f],i=s[o],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&f<n.length-1)continue;a+=f-a+1;break}s=i}return s},Le=r=>r==null?void 0:r.replace("_","-"),Tn={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,e){var t,n;(n=(t=console==null?void 0:console[r])==null?void 0:t.apply)==null||n.call(t,console,e)}};class Xe{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Tn,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,s){return s&&!this.debug?null:(K(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Xe(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Xe(this.logger,e)}}var me=new Xe;class Qe{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const s=this.observers[n].get(t)||0;this.observers[n].set(t,s+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s.apply(s,[e,...t])})}}class Xt extends Qe{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,s={}){var c,u;const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,i=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):K(n)&&a?o.push(...n.split(a)):o.push(n)));const f=Je(this.data,o);return!f&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),f||!i||!K(n)?f:ht((u=(c=this.data)==null?void 0:c[e])==null?void 0:u[t],n,a)}addResource(e,t,n,s,a={silent:!1}){const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let o=[e,t];n&&(o=o.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=e.split("."),s=t,t=o[1]),this.addNamespaces(t),Jt(this.data,o,s),a.silent||this.emit("added",e,t,n,s)}addResources(e,t,n,s={silent:!1}){for(const a in n)(K(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 f=Je(this.data,o)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?Er(f,n,a):f={...f,...n},Jt(this.data,o,f),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(s=>t[s]&&Object.keys(t[s]).length>0)}toJSON(){return this.data}}var Tr={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,n,s){return r.forEach(a=>{var i;e=((i=this.processors[a])==null?void 0:i.process(e,t,n,s))??e}),e}};const Zt={},Qt=r=>!K(r)&&typeof r!="boolean"&&typeof r!="number";class Ze extends Qe{constructor(e,t={}){super(),hn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=me.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(e==null)return!1;const s=this.resolve(e,n);return(s==null?void 0:s.res)!==void 0}extractFromKey(e,t){let n=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const s=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let a=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!En(e,n,s);if(i&&!o){const f=e.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:e,namespaces:K(a)?[a]:a};const c=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(c[0])>-1)&&(a=c.shift()),e=c.join(s)}return{key:e,namespaces:K(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:f}=this.extractFromKey(e[e.length-1],s),c=f[f.length-1];let u=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;u===void 0&&(u=":");const l=s.lng||this.language,d=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((l==null?void 0:l.toLowerCase())==="cimode")return d?a?{res:`${c}${u}${o}`,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:`${c}${u}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:o;const p=this.resolve(e,s);let m=p==null?void 0:p.res;const g=(p==null?void 0:p.usedKey)||o,x=(p==null?void 0:p.exactUsedKey)||o,w=["[object Number]","[object Function]","[object RegExp]"],E=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,O=!this.i18nFormat||this.i18nFormat.handleAsObject,S=s.count!==void 0&&!K(s.count),b=Ze.hasDefaultValue(s),_=S?this.pluralResolver.getSuffix(l,s.count,s):"",$=s.ordinal&&S?this.pluralResolver.getSuffix(l,s.count,{ordinal:!1}):"",U=S&&!s.ordinal&&s.count===0,j=U&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${_}`]||s[`defaultValue${$}`]||s.defaultValue;let A=m;O&&!m&&b&&(A=j);const D=Qt(A),I=Object.prototype.toString.apply(A);if(O&&A&&D&&w.indexOf(I)<0&&!(K(E)&&Array.isArray(A))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const W=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,A,{...s,ns:f}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(p.res=W,p.usedParams=this.getUsedParamsDetails(s),p):W}if(i){const W=Array.isArray(A),B=W?[]:{},q=W?x:g;for(const z in A)if(Object.prototype.hasOwnProperty.call(A,z)){const X=`${q}${i}${z}`;b&&!m?B[z]=this.translate(X,{...s,defaultValue:Qt(j)?j[z]:void 0,joinArrays:!1,ns:f}):B[z]=this.translate(X,{...s,joinArrays:!1,ns:f}),B[z]===X&&(B[z]=A[z])}m=B}}else if(O&&K(E)&&Array.isArray(m))m=m.join(E),m&&(m=this.extendTranslation(m,e,s,n));else{let W=!1,B=!1;!this.isValidLookup(m)&&b&&(W=!0,m=j),this.isValidLookup(m)||(B=!0,m=o);const z=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&B?void 0:m,X=b&&j!==m&&this.options.updateMissing;if(B||W||X){if(this.logger.log(X?"updateKey":"missingKey",l,c,o,X?j:m),i){const y=this.resolve(o,{...s,keySeparator:!1});y&&y.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let H=[];const k=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&k&&k[0])for(let y=0;y<k.length;y++)H.push(k[y]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(s.lng||this.language):H.push(s.lng||this.language);const h=(y,T,C)=>{var L;const R=b&&C!==m?C:z;this.options.missingKeyHandler?this.options.missingKeyHandler(y,c,T,R,X,s):(L=this.backendConnector)!=null&&L.saveMissing&&this.backendConnector.saveMissing(y,c,T,R,X,s),this.emit("missingKey",y,c,T,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&S?H.forEach(y=>{const T=this.pluralResolver.getSuffixes(y,s);U&&s[`defaultValue${this.options.pluralSeparator}zero`]&&T.indexOf(`${this.options.pluralSeparator}zero`)<0&&T.push(`${this.options.pluralSeparator}zero`),T.forEach(C=>{h([y],o+C,s[`defaultValue${C}`]||j)})}):h(H,o,j))}m=this.extendTranslation(m,e,s,p,n),B&&m===o&&this.options.appendNamespaceToMissingKey&&(m=`${c}${u}${o}`),(B||W)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${u}${o}`:o,W?m:void 0,s))}return a?(p.res=m,p.usedParams=this.getUsedParamsDetails(s),p):m}extendTranslation(e,t,n,s,a){var f,c;if((f=this.i18nFormat)!=null&&f.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const u=K(e)&&(((c=n==null?void 0:n.interpolation)==null?void 0:c.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let l;if(u){const p=e.match(this.interpolator.nestingRegexp);l=p&&p.length}let d=n.replace&&!K(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,n.lng||this.language||s.usedLng,n),u){const p=e.match(this.interpolator.nestingRegexp),m=p&&p.length;l<m&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...p)=>(a==null?void 0:a[0])===p[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${t[0]}`),null):this.translate(...p,t),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,o=K(i)?[i]:i;return e!=null&&(o!=null&&o.length)&&n.applyPostProcessor!==!1&&(e=Tr.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,s,a,i,o;return K(e)&&(e=[e]),e.forEach(f=>{if(this.isValidLookup(n))return;const c=this.extractFromKey(f,t),u=c.key;s=u;let l=c.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const d=t.count!==void 0&&!K(t.count),p=d&&!t.ordinal&&t.count===0,m=t.context!==void 0&&(K(t.context)||typeof t.context=="number")&&t.context!=="",g=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(x=>{var w,E;this.isValidLookup(n)||(o=x,!Zt[`${g[0]}-${x}`]&&((w=this.utils)!=null&&w.hasLoadedNamespace)&&!((E=this.utils)!=null&&E.hasLoadedNamespace(o))&&(Zt[`${g[0]}-${x}`]=!0,this.logger.warn(`key "${s}" for languages "${g.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach(O=>{var _;if(this.isValidLookup(n))return;i=O;const S=[u];if((_=this.i18nFormat)!=null&&_.addLookupKeys)this.i18nFormat.addLookupKeys(S,u,O,x,t);else{let $;d&&($=this.pluralResolver.getSuffix(O,t.count,t));const U=`${this.options.pluralSeparator}zero`,j=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(S.push(u+$),t.ordinal&&$.indexOf(j)===0&&S.push(u+$.replace(j,this.options.pluralSeparator)),p&&S.push(u+U)),m){const A=`${u}${this.options.contextSeparator}${t.context}`;S.push(A),d&&(S.push(A+$),t.ordinal&&$.indexOf(j)===0&&S.push(A+$.replace(j,this.options.pluralSeparator)),p&&S.push(A+U))}}let b;for(;b=S.pop();)this.isValidLookup(n)||(a=b,n=this.getResource(O,x,b,t))}))})}),{res:n,usedKey:s,exactUsedKey:a,usedLng:i,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,n,s={}){var a;return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!K(e.replace);let s=n?e.replace:e;if(n&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const a of t)delete s[a]}return s}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&e[n]!==void 0)return!0;return!1}}class er{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=me.create("languageUtils")}getScriptPartFromCode(e){if(e=Le(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=Le(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(K(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)),K(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 K(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))):K(e)&&a(this.formatLanguageCode(e)),n.forEach(i=>{s.indexOf(i)<0&&a(this.formatLanguageCode(i))}),s}}const tr={zero:0,one:1,two:2,few:3,many:4,other:5},rr={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class On{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=me.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Le(e==="dev"?"en":e),s=t.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:s});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let i;try{i=new Intl.PluralRules(n,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),rr;if(!e.match(/-|_/))return rr;const f=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(f,t)}return this.pluralRulesCache[a]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(s=>`${t}${s}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((s,a)=>tr[s]-tr[a]).map(s=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,t,n={}){const s=this.getRule(e,n);return s?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const nr=(r,e,t,n=".",s=!0)=>{let a=yn(r,e,t);return!a&&s&&K(t)&&(a=ht(r,t,n),a===void 0&&(a=ht(e,t,n))),a},ct=r=>r.replace(/\$/g,"$$$$");class Rn{constructor(e={}){var t;this.logger=me.create("interpolator"),this.options=e,this.format=((t=e==null?void 0:e.interpolation)==null?void 0:t.format)||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:a,prefixEscaped:i,suffix:o,suffixEscaped:f,formatSeparator:c,unescapeSuffix:u,unescapePrefix:l,nestingPrefix:d,nestingPrefixEscaped:p,nestingSuffix:m,nestingSuffixEscaped:g,nestingOptionsSeparator:x,maxReplaces:w,alwaysFormat:E}=e.interpolation;this.escape=t!==void 0?t:bn,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?Te(a):i||"{{",this.suffix=o?Te(o):f||"}}",this.formatSeparator=c||",",this.unescapePrefix=u?"":l||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?Te(d):p||Te("$t("),this.nestingSuffix=m?Te(m):g||Te(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=w||1e3,this.alwaysFormat=E!==void 0?E:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,n)=>(t==null?void 0:t.source)===n?(t.lastIndex=0,t):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,s){var p;let a,i,o;const f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=m=>{if(m.indexOf(this.formatSeparator)<0){const E=nr(t,f,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,n,{...s,...t,interpolationkey:m}):E}const g=m.split(this.formatSeparator),x=g.shift().trim(),w=g.join(this.formatSeparator).trim();return this.format(nr(t,f,x,this.options.keySeparator,this.options.ignoreJSONStructure),w,n,{...s,...t,interpolationkey:x})};this.resetRegExp();const u=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,l=((p=s==null?void 0:s.interpolation)==null?void 0:p.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:m=>ct(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?ct(this.escape(m)):ct(m)}].forEach(m=>{for(o=0;a=m.regex.exec(e);){const g=a[1].trim();if(i=c(g),i===void 0)if(typeof u=="function"){const w=u(e,a,s);i=K(w)?w:""}else if(s&&Object.prototype.hasOwnProperty.call(s,g))i="";else if(l){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${e}`),i="";else!K(i)&&!this.useRawValueToEscape&&(i=Kt(i));const x=m.safeValue(i);if(e=e.replace(a[0],x),l?(m.regex.lastIndex+=i.length,m.regex.lastIndex-=a[0].length):m.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let s,a,i;const o=(f,c)=>{const u=this.nestingOptionsSeparator;if(f.indexOf(u)<0)return f;const l=f.split(new RegExp(`${u}[ ]*{`));let d=`{${l[1]}`;f=l[0],d=this.interpolate(d,i);const p=d.match(/'/g),m=d.match(/"/g);(((p==null?void 0:p.length)??0)%2===0&&!m||m.length%2!==0)&&(d=d.replace(/'/g,'"'));try{i=JSON.parse(d),c&&(i={...c,...i})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${f}`,g),`${f}${u}${d}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,f};for(;s=this.nestingRegexp.exec(e);){let f=[];i={...n},i=i.replace&&!K(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let c=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const u=s[1].split(this.formatSeparator).map(l=>l.trim());s[1]=u.shift(),f=u,c=!0}if(a=t(o.call(this,s[1].trim(),i),i),a&&s[0]===e&&!K(a))return a;K(a)||(a=Kt(a)),a||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),a=""),c&&(a=f.reduce((u,l)=>this.format(u,l,n.lng,{...n,interpolationkey:s[1].trim()}),a.trim())),e=e.replace(s[0],a),this.regexp.lastIndex=0}return e}}const jn=r=>{let e=r.toLowerCase().trim();const t={};if(r.indexOf("(")>-1){const n=r.split("(");e=n[0].toLowerCase().trim();const s=n[1].substring(0,n[1].length-1);e==="currency"&&s.indexOf(":")<0?t.currency||(t.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?t.range||(t.range=s.trim()):s.split(";").forEach(i=>{if(i){const[o,...f]=i.split(":"),c=f.join(":").trim().replace(/^'+|'+$/g,""),u=o.trim();t[u]||(t[u]=c),c==="false"&&(t[u]=!1),c==="true"&&(t[u]=!0),isNaN(c)||(t[u]=parseInt(c,10))}})}return{formatName:e,formatOptions:t}},sr=r=>{const e={};return(t,n,s)=>{let a=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(a={...a,[s.interpolationkey]:void 0});const i=n+JSON.stringify(a);let o=e[i];return o||(o=r(Le(n),s),e[i]=o),o(t)}},Dn=r=>(e,t,n)=>r(Le(t),n)(e);class Cn{constructor(e={}){this.logger=me.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?sr:Dn;this.formats={number:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a});return o=>i.format(o)}),currency:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a,style:"currency"});return o=>i.format(o)}),datetime:n((s,a)=>{const i=new Intl.DateTimeFormat(s,{...a});return o=>i.format(o)}),relativetime:n((s,a)=>{const i=new Intl.RelativeTimeFormat(s,{...a});return o=>i.format(o,a.range||"day")}),list:n((s,a)=>{const i=new Intl.ListFormat(s,{...a});return o=>i.format(o)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=sr(t)}format(e,t,n,s={}){const a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(o=>o.indexOf(")")>-1)){const o=a.findIndex(f=>f.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,o)].join(this.formatSeparator)}return a.reduce((o,f)=>{var l;const{formatName:c,formatOptions:u}=jn(f);if(this.formats[c]){let d=o;try{const p=((l=s==null?void 0:s.formatParams)==null?void 0:l[s.interpolationkey])||{},m=p.locale||p.lng||s.locale||s.lng||n;d=this.formats[c](o,m,{...u,...s,...p})}catch(p){this.logger.warn(p)}return d}else this.logger.warn(`there was no format function for ${c}`);return o},e)}}const $n=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class Pn extends Qe{constructor(e,t,n,s={}){var a,i;super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=me.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(i=(a=this.backend)==null?void 0:a.init)==null||i.call(a,n,s.backend,s)}queueLoad(e,t,n,s){const a={},i={},o={},f={};return e.forEach(c=>{let u=!0;t.forEach(l=>{const d=`${c}|${l}`;!n.reload&&this.store.hasResourceBundle(c,l)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?i[d]===void 0&&(i[d]=!0):(this.state[d]=1,u=!1,i[d]===void 0&&(i[d]=!0),a[d]===void 0&&(a[d]=!0),f[l]===void 0&&(f[l]=!0)))}),u||(o[c]=!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(f)}}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(f=>{gn(f.loaded,[a],i),$n(f,e),t&&f.errors.push(t),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(c=>{o[c]||(o[c]={});const u=f.loaded[c];u.length&&u.forEach(l=>{o[c][l]===void 0&&(o[c][l]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(f=>!f.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=(c,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const l=this.waitingReads.shift();this.read(l.lng,l.ns,l.fcName,l.tried,l.wait,l.callback)}if(c&&u&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,s+1,a*2,i)},a);return}i(c,u)},f=this.backend[n].bind(this.backend);if(f.length===2){try{const c=f(e,t);c&&typeof c.then=="function"?c.then(u=>o(null,u)).catch(o):o(null,c)}catch(c){o(c)}return}return f(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();K(e)&&(e=this.languageUtils.toResolveHierarchy(e)),K(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 f,c,u,l,d;if((c=(f=this.services)==null?void 0:f.utils)!=null&&c.hasLoadedNamespace&&!((l=(u=this.services)==null?void 0:u.utils)!=null&&l.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 p={...i,isUpdate:a},m=this.backend.create.bind(this.backend);if(m.length<6)try{let g;m.length===5?g=m(e,t,n,s,p):g=m(e,t,n,s),g&&typeof g.then=="function"?g.then(x=>o(null,x)).catch(o):o(null,g)}catch(g){o(g)}else m(e,t,n,s,o,p)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const ar=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:r=>{let e={};if(typeof r[1]=="object"&&(e=r[1]),K(r[1])&&(e.defaultValue=r[1]),K(r[2])&&(e.tDescription=r[2]),typeof r[2]=="object"||typeof r[3]=="object"){const t=r[3]||r[2];Object.keys(t).forEach(n=>{e[n]=t[n]})}return e},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ir=r=>{var e,t;return K(r.ns)&&(r.ns=[r.ns]),K(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),K(r.fallbackNS)&&(r.fallbackNS=[r.fallbackNS]),((t=(e=r.supportedLngs)==null?void 0:e.indexOf)==null?void 0:t.call(e,"cimode"))<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),typeof r.initImmediate=="boolean"&&(r.initAsync=r.initImmediate),r},Ue=()=>{},An=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class _e extends Qe{constructor(e={},t){if(super(),this.options=ir(e),this.services={},this.logger=me,this.modules={external:[]},An(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(K(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=ar();this.options={...n,...this.options,...ir(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const s=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?me.init(s(this.modules.logger),this.options):me.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=Cn;const u=new er(this.options);this.store=new Xt(this.options.resources,this.options);const l=this.services;l.logger=me,l.resourceStore=this.store,l.languageUtils=u,l.pluralResolver=new On(u,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(l.formatter=s(c),l.formatter.init(l,this.options),this.options.interpolation.format=l.formatter.format.bind(l.formatter)),l.interpolator=new Rn(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new Pn(s(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",(d,...p)=>{this.emit(d,...p)}),this.modules.languageDetector&&(l.languageDetector=s(this.modules.languageDetector),l.languageDetector.init&&l.languageDetector.init(l,this.options.detection,this.options)),this.modules.i18nFormat&&(l.i18nFormat=s(this.modules.i18nFormat),l.i18nFormat.init&&l.i18nFormat.init(this)),this.translator=new Ze(this.services,this.options),this.translator.on("*",(d,...p)=>{this.emit(d,...p)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Ue),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[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(c=>{this[c]=(...u)=>this.store[c](...u)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=(...u)=>(this.store[c](...u),this)});const o=$e(),f=()=>{const c=(u,l)=>{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(l),t(u,l)};if(this.languages&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?f():setTimeout(f,0),o}loadResources(e,t=Ue){var a,i;let n=t;const s=K(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=[],f=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(l=>{l!=="cimode"&&o.indexOf(l)<0&&o.push(l)})};s?f(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(u=>f(u)),(i=(a=this.options.preload)==null?void 0:a.forEach)==null||i.call(a,c=>f(c)),this.services.backendConnector.load(o,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(c)})}else n(null)}reloadResources(e,t,n){const s=$e();return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Ue),this.services.backendConnector.reload(e,t,a=>{s.resolve(),n(a)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Tr.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t<this.languages.length;t++){const n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=$e();this.emit("languageChanging",e);const s=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},a=(o,f)=>{f?this.isLanguageChangingTo===e&&(s(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,n.resolve((...c)=>this.t(...c)),t&&t(o,(...c)=>this.t(...c))},i=o=>{var u,l;!e&&!o&&this.services.languageDetector&&(o=[]);const f=K(o)?o:o&&o[0],c=this.store.hasLanguageSomeTranslations(f)?f:this.services.languageUtils.getBestMatchFromCodes(K(o)?[o]:o);c&&(this.language||s(c),this.translator.language||this.translator.changeLanguage(c),(l=(u=this.services.languageDetector)==null?void 0:u.cacheUserLanguage)==null||l.call(u,c)),this.loadResources(c,d=>{a(d,c)})};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 f;typeof i!="object"?f=this.options.overloadTranslationOptionHandler([a,i].concat(o)):f={...i},f.lng=f.lng||s.lng,f.lngs=f.lngs||s.lngs,f.ns=f.ns||s.ns,f.keyPrefix!==""&&(f.keyPrefix=f.keyPrefix||n||s.keyPrefix);const c=this.options.keySeparator||".";let u;return f.keyPrefix&&Array.isArray(a)?u=a.map(l=>`${f.keyPrefix}${c}${l}`):u=f.keyPrefix?`${f.keyPrefix}${c}${a}`:a,this.t(u,f)};return K(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,f)=>{const c=this.services.backendConnector.state[`${o}|${f}`];return c===-1||c===0||c===2};if(t.precheck){const o=t.precheck(this,i);if(o!==void 0)return o}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(n,e)&&(!s||i(a,e)))}loadNamespaces(e,t){const n=$e();return this.options.ns?(K(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{n.resolve(),t&&t(s)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=$e();K(e)&&(e=[e]);const s=this.options.preload||[],a=e.filter(i=>s.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return a.length?(this.options.preload=s.concat(a),this.loadResources(i=>{n.resolve(),t&&t(i)}),n):(t&&t(),Promise.resolve())}dir(e){var s,a;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((a=this.services)==null?void 0:a.languageUtils)||new er(ar());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new _e(e,t)}cloneInstance(e={},t=Ue){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new _e(s);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(o=>{a[o]=this[o]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const o=Object.keys(this.store.data).reduce((f,c)=>(f[c]={...this.store.data[c]},f[c]=Object.keys(f[c]).reduce((u,l)=>(u[l]={...f[c][l]},u),f[c]),f),{});a.store=new Xt(o,s),a.services.resourceStore=a.store}return a.translator=new Ze(a.services,s),a.translator.on("*",(o,...f)=>{a.emit(o,...f)}),a.init(s,t),a.translator.options=s,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ae=_e.createInstance();ae.createInstance=_e.createInstance;ae.createInstance;ae.dir;ae.init;ae.loadResources;ae.reloadResources;ae.use;ae.changeLanguage;ae.getFixedT;ae.t;ae.exists;ae.setDefaultNamespace;ae.hasLoadedNamespace;ae.loadNamespaces;ae.loadLanguages;const Ln={Friday:"Venerdì",FridayShort:"Ven",Monday:"Lunedì",MondayShort:"Lun",Saturday:"Sabato",SaturdayShort:"Sab",Sunday:"Domenica",SundayShort:"Dom",Tuesday:"Martedì",TuesdayShort:"Mar",Thursday:"Giovedì",ThursdayShort:"Gio",Wednesday:"Mercoledì",WednesdayShort:"Mer"},_n={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},kn={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando"},In={Date:{NextDay:"Giorno Successivo",NextMonth:"Mese Successivo",NextWeek:"Settimana Successiva",NextYear:"Anno Successivo",PreviousDay:"Giorno Precedente",PreviousMonth:"Mese Precedente",PreviousWeek:"Settimana Precedente",PreviousYear:"Anno Precedente",Today:"Oggi",Tomorrow:"Domani",Yesterday:"Ieri"},Day:Ln,Month:_n,Generic:kn},Nn={Friday:"Friday",FridayShort:"Fri",Monday:"Monday",MondayShort:"Mon",Saturday:"Saturday",SaturdayShort:"Sat",Sunday:"Sunday",SundayShort:"Sun",Tuesday:"Tuesday",TuesdayShort:"Tue",Thursday:"Thursday",ThursdayShort:"Thu",Wednesday:"Wednesday",WednesdayShort:"Wed"},Mn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},Fn={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command"},Vn={Date:{NextDay:"Next Day",NextMonth:"Next Month",NextWeek:"Next Week",NextYear:"Next Year",PreviousDay:"Previous Day",PreviousMonth:"Previous Month",PreviousWeek:"Previous Week",PreviousYear:"Previous Year",Today:"Today",Tomorrow:"Tomorrow",Yesterday:"Yesterday"},Day:Nn,Month:Mn,Generic:Fn};function or(r,e){return new RegExp(Yn(r),e)}function Yn(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Un(r,e,t,n){let s=e;const a=Wn(r,t);if(!s){const o=Math.abs(a);o-Math.floor(o)?s="0,0.00":s="0,0"}const i=Hn(s);return new Intl.NumberFormat(n,i).format(a)}function Wn(r,e,t,n,s){let a=r;if(typeof a!="number"){let o;e&&n===void 0?o=",":o=".";const f=o=="."?",":".";a=a.replace(or(f,"g"),""),a=a.replace(or(o,"g"),"."),a=Number(a)}const i=Number(a);return isNaN(i)?NaN:i}function Hn(r){const e={};r.includes(",")?e.useGrouping=!0:e.useGrouping=!1;const t=r.indexOf(".");if(t>-1){const s=(r.substring(t+1).match(/0/g)||[]).length;e.minimumFractionDigits=s,e.maximumFractionDigits=s}else e.minimumFractionDigits=0,e.maximumFractionDigits=0;return e}ae.init({lng:typeof navigator<"u"&&navigator.language.split("-")[0]||"en",fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1,format:(r,e,t,n)=>{const s=(n==null?void 0:n.type)??"number";try{switch(s){case"date":{const a=r instanceof Date?r:new Date(r);return new Intl.DateTimeFormat(t,{dateStyle:e||"short"}).format(a)}default:case"number":{const a=(n==null?void 0:n.inputIsLocalized)??!1;return Un(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:Vn},it:{translation:In}}});const Bn=(r,e,t,n)=>ae.format(r,e,t||ae.language,n),Gn=(r,e)=>ae.t(r,e);function et(){const r=P.useCallback((n,s,a,i)=>Bn(n,s,a||void 0,i),[]),e=P.useCallback(()=>ae.languages[0],[]),t=P.useCallback((n,s)=>Gn(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var St=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r))(St||{}),oe=(r=>(r.MONDAY="Day.Monday",r.MONDAY_SHORT="Day.MondayShort",r.TUESDAY="Day.Tuesday",r.TUESDAY_SHORT="Day.TuesdayShort",r.WEDNESDAY="Day.Wednesday",r.WEDNESDAY_SHORT="Day.WednesdayShort",r.THURSDAY="Day.Thursday",r.THURSDAY_SHORT="Day.ThursdayShort",r.FRIDAY="Day.Friday",r.FRIDAY_SHORT="Day.FridayShort",r.SATURDAY="Day.Saturday",r.SATURDAY_SHORT="Day.SaturdayShort",r.SUNDAY="Day.Sunday",r.SUNDAY_SHORT="Day.SundayShort",r))(oe||{}),ue=(r=>(r.JANUARY="Month.January",r.FEBRUARY="Month.February",r.MARCH="Month.March",r.APRIL="Month.April",r.MAY="Month.May",r.JUNE="Month.June",r.JULY="Month.July",r.AUGUST="Month.August",r.SEPTEMBER="Month.September",r.OCTOBER="Month.October",r.NOVEMBER="Month.November",r.DECEMBER="Month.December",r))(ue||{}),mt=(r=>(r.PREVIOUS_DAY="Date.PreviousDay",r.PREVIOUS_WEEK="Date.PreviousWeek",r.PREVIOUS_MONTH="Date.PreviousMonth",r.PREVIOUS_YEAR="Date.PreviousYear",r.NEXT_DAY="Date.NextDay",r.NEXT_WEEK="Date.NextWeek",r.NEXT_MONTH="Date.NextMonth",r.NEXT_YEAR="Date.NextYear",r.YESTERDAY="Date.Yesterday",r.TODAY="Date.Today",r.TOMORROW="Date.Tomorrow",r))(mt||{});function Kn({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=et(),i=()=>{if(!n)return;const k=new Date(n);return isNaN(k.getTime())?void 0:k},[o]=P.useState(new Date),[f,c]=P.useState(r||i()||new Date),[u,l]=P.useState(f?f.getMonth():new Date().getMonth()),[d,p]=P.useState(f?f.getFullYear():new Date().getFullYear()),[m,g]=P.useState(f?f.getDate():null),x=P.useRef(null),w=P.useRef([]),E=[a(ue.JANUARY),a(ue.FEBRUARY),a(ue.MARCH),a(ue.APRIL),a(ue.MAY),a(ue.JUNE),a(ue.JULY),a(ue.AUGUST),a(ue.SEPTEMBER),a(ue.OCTOBER),a(ue.NOVEMBER),a(ue.DECEMBER)],O=[{value:a(oe.SUNDAY_SHORT),full:a(oe.SUNDAY)},{value:a(oe.MONDAY_SHORT),full:a(oe.MONDAY)},{value:a(oe.TUESDAY_SHORT),full:a(oe.TUESDAY)},{value:a(oe.WEDNESDAY_SHORT),full:a(oe.WEDNESDAY)},{value:a(oe.THURSDAY_SHORT),full:a(oe.THURSDAY)},{value:a(oe.FRIDAY_SHORT),full:a(oe.FRIDAY)},{value:a(oe.SATURDAY_SHORT),full:a(oe.SATURDAY)}],S=k=>t.some(h=>{const y=h.start.getTime(),T=h.end.getTime(),C=k.getTime();return C>=y&&C<=T}),b=k=>{S(k)||(c(k),g(k.getDate()),e&&e(Yr(k)))},_=()=>{u===0?(l(11),p(d-1)):l(u-1),g(1)},$=()=>{u===11?(l(0),p(d+1)):l(u+1),g(1)},U=(k,h)=>new Date(k,h+1,0).getDate(),j=(k,h)=>new Date(k,h,1).getDay(),A=k=>{var y;const h=B.findIndex(T=>T!==null&&T.getDate()===k);h!==-1&&w.current[h]&&((y=w.current[h])==null||y.focus(),g(k))},D=(k,h)=>{const y=B[h];if(!y)return;const T=U(d,u),C=y.getDate();switch(k.key){case"ArrowRight":k.preventDefault();{let R=C+1,L=new Date(d,u,R);if(R>T){const F=u===11?d+1:d,V=u===11?0:u+1;R=1,L=new Date(F,V,R),$(),setTimeout(()=>{I(1,"forward")},0);return}S(L)?I(R,"forward"):A(R)}break;case"Tab":break;case"ArrowLeft":k.preventDefault();{let R=C-1,L=new Date(d,u,R);if(R<1){const F=u===0?d-1:d,V=u===0?11:u-1,M=U(F,V);R=M,L=new Date(F,V,R),_(),setTimeout(()=>{I(M,"backward")},0);return}S(L)?I(R,"backward"):A(R)}break;case"ArrowUp":k.preventDefault();{let R=C-7,L=new Date(d,u,R);if(R<1){const F=u===0?d-1:d,V=u===0?11:u-1;R=U(F,V)+R,L=new Date(F,V,R),_(),setTimeout(()=>{I(R,"backward")},0);return}S(L)?I(R,"backward"):A(R)}break;case"ArrowDown":k.preventDefault();{let R=C+7,L=new Date(d,u,R);if(R>T){const F=u===11?d+1:d,V=u===11?0:u+1;R=R-T,L=new Date(F,V,R),$(),setTimeout(()=>{I(R,"forward")},0);return}S(L)?I(R,"forward"):A(R)}break;case"Home":k.preventDefault(),I(1,"forward");break;case"End":k.preventDefault(),I(T,"backward");break;case"PageUp":k.preventDefault(),_(),setTimeout(()=>{const R=U(u===0?d-1:d,u===0?11:u-1),L=Math.min(C,R);I(L,"forward")},0);break;case"PageDown":k.preventDefault(),$(),setTimeout(()=>{const R=U(u===11?d+1:d,u===11?0:u+1),L=Math.min(C,R);I(L,"forward")},0);break;case" ":case"Space":if(S(y))return;g(y.getDate()),c(y);break;case"Enter":k.preventDefault(),b(y);break}},I=(k,h)=>{const y=U(d,u);if(h==="forward"){for(let T=k;T<=y;T++){const C=new Date(d,u,T);if(!S(C)){A(T);return}}$(),setTimeout(()=>{I(1,"forward")},0)}else{for(let L=k;L>=1;L--){const F=new Date(d,u,L);if(!S(F)){A(L);return}}const T=u===0?d-1:d,C=u===0?11:u-1,R=U(T,C);_(),setTimeout(()=>{I(R,"backward")},0)}},B=(()=>{const k=U(d,u),h=j(d,u),y=[];for(let T=0;T<h;T++)y.push(null);for(let T=1;T<=k;T++){const C=new Date(d,u,T);y.push(C)}return y})(),q=[];let z=[];B.forEach((k,h)=>{if(z.push(k),z.length===7||h===B.length-1){for(;z.length<7;)z.push(null);q.push(z),z=[]}}),P.useEffect(()=>{var k;if(m!==null){const h=B.findIndex(y=>y!==null&&y.getDate()===m);h!==-1&&w.current[h]&&((k=w.current[h])==null||k.focus())}},[u,d,m,B]);const X={label:"smp-datepickercalendar-label",wrapper:"smp-datepickercalendar",calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(k,h,y,T)=>`smp-datepickercalendar-td
|
|
44
|
+
*/var nt,It;function tn(){if(It)return nt;It=1;var r=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function s(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var i={},o=0;o<10;o++)i["_"+String.fromCharCode(o)]=o;var u=Object.getOwnPropertyNames(i).map(function(f){return i[f]});if(u.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(f){c[f]=f}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return nt=s()?Object.assign:function(a,i){for(var o,u=n(a),c,f=1;f<arguments.length;f++){o=Object(arguments[f]);for(var l in o)e.call(o,l)&&(u[l]=o[l]);if(r){c=r(o);for(var p=0;p<c.length;p++)t.call(o,c[p])&&(u[c[p]]=o[c[p]])}}return u},nt}var st,Nt;function vt(){if(Nt)return st;Nt=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return st=r,st}var at,Mt;function mr(){return Mt||(Mt=1,at=Function.call.bind(Object.prototype.hasOwnProperty)),at}var it,Ft;function rn(){if(Ft)return it;Ft=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var e=vt(),t={},n=mr();r=function(a){var i="Warning: "+a;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function s(a,i,o,u,c){if(process.env.NODE_ENV!=="production"){for(var f in a)if(n(a,f)){var l;try{if(typeof a[f]!="function"){var p=Error((u||"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 p.name="Invariant Violation",p}l=a[f](i,f,u,o,null,e)}catch(m){l=m}if(l&&!(l instanceof Error)&&r((u||"React class")+": type specification of "+o+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof l+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),l instanceof Error&&!(l.message in t)){t[l.message]=!0;var d=c?c():"";r("Failed "+o+" type: "+l.message+(d??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},it=s,it}var ot,Vt;function nn(){if(Vt)return ot;Vt=1;var r=hr(),e=tn(),t=vt(),n=mr(),s=rn(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(o){var u="Warning: "+o;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}});function i(){return null}return ot=function(o,u){var c=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function l(h){var y=h&&(c&&h[c]||h[f]);if(typeof y=="function")return y}var p="<<anonymous>>",d={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:O,element:S(),elementType:b(),instanceOf:_,node:A(),objectOf:U,oneOf:$,oneOfType:D,shape:I,exact:W};function m(h,y){return h===y?h!==0||1/h===1/y:h!==h&&y!==y}function g(h,y){this.message=h,this.data=y&&typeof y=="object"?y:{},this.stack=""}g.prototype=Error.prototype;function x(h){if(process.env.NODE_ENV!=="production")var y={},T=0;function C(L,F,V,M,J,G,se){if(M=M||p,G=G||V,se!==t){if(u){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 Y=M+":"+V;!y[Y]&&T<3&&(a("You are manually calling a React.PropTypes validation function for the `"+G+"` prop on `"+M+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),y[Y]=!0,T++)}}return F[V]==null?L?F[V]===null?new g("The "+J+" `"+G+"` is marked as required "+("in `"+M+"`, but its value is `null`.")):new g("The "+J+" `"+G+"` is marked as required in "+("`"+M+"`, but its value is `undefined`.")):null:h(F,V,M,J,G)}var R=C.bind(null,!1);return R.isRequired=C.bind(null,!0),R}function w(h){function y(T,C,R,L,F,V){var M=T[C],J=z(M);if(J!==h){var G=X(M);return new g("Invalid "+L+" `"+F+"` of type "+("`"+G+"` supplied to `"+R+"`, expected ")+("`"+h+"`."),{expectedType:h})}return null}return x(y)}function E(){return x(i)}function O(h){function y(T,C,R,L,F){if(typeof h!="function")return new g("Property `"+F+"` of component `"+R+"` has invalid PropType notation inside arrayOf.");var V=T[C];if(!Array.isArray(V)){var M=z(V);return new g("Invalid "+L+" `"+F+"` of type "+("`"+M+"` supplied to `"+R+"`, expected an array."))}for(var J=0;J<V.length;J++){var G=h(V,J,R,L,F+"["+J+"]",t);if(G instanceof Error)return G}return null}return x(y)}function S(){function h(y,T,C,R,L){var F=y[T];if(!o(F)){var V=z(F);return new g("Invalid "+R+" `"+L+"` of type "+("`"+V+"` supplied to `"+C+"`, expected a single ReactElement."))}return null}return x(h)}function b(){function h(y,T,C,R,L){var F=y[T];if(!r.isValidElementType(F)){var V=z(F);return new g("Invalid "+R+" `"+L+"` of type "+("`"+V+"` supplied to `"+C+"`, expected a single ReactElement type."))}return null}return x(h)}function _(h){function y(T,C,R,L,F){if(!(T[C]instanceof h)){var V=h.name||p,M=k(T[C]);return new g("Invalid "+L+" `"+F+"` of type "+("`"+M+"` supplied to `"+R+"`, expected ")+("instance of `"+V+"`."))}return null}return x(y)}function $(h){if(!Array.isArray(h))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),i;function y(T,C,R,L,F){for(var V=T[C],M=0;M<h.length;M++)if(m(V,h[M]))return null;var J=JSON.stringify(h,function(se,N){var Y=X(N);return Y==="symbol"?String(N):N});return new g("Invalid "+L+" `"+F+"` of value `"+String(V)+"` "+("supplied to `"+R+"`, expected one of "+J+"."))}return x(y)}function U(h){function y(T,C,R,L,F){if(typeof h!="function")return new g("Property `"+F+"` of component `"+R+"` has invalid PropType notation inside objectOf.");var V=T[C],M=z(V);if(M!=="object")return new g("Invalid "+L+" `"+F+"` of type "+("`"+M+"` supplied to `"+R+"`, expected an object."));for(var J in V)if(n(V,J)){var G=h(V,J,R,L,F+"."+J,t);if(G instanceof Error)return G}return null}return x(y)}function D(h){if(!Array.isArray(h))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var y=0;y<h.length;y++){var T=h[y];if(typeof T!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+H(T)+" at index "+y+"."),i}function C(R,L,F,V,M){for(var J=[],G=0;G<h.length;G++){var se=h[G],N=se(R,L,F,V,M,t);if(N==null)return null;N.data&&n(N.data,"expectedType")&&J.push(N.data.expectedType)}var Y=J.length>0?", expected one of type ["+J.join(", ")+"]":"";return new g("Invalid "+V+" `"+M+"` supplied to "+("`"+F+"`"+Y+"."))}return x(C)}function A(){function h(y,T,C,R,L){return B(y[T])?null:new g("Invalid "+R+" `"+L+"` supplied to "+("`"+C+"`, expected a ReactNode."))}return x(h)}function j(h,y,T,C,R){return new g((h||"React class")+": "+y+" type `"+T+"."+C+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+R+"`.")}function I(h){function y(T,C,R,L,F){var V=T[C],M=z(V);if(M!=="object")return new g("Invalid "+L+" `"+F+"` of type `"+M+"` "+("supplied to `"+R+"`, expected `object`."));for(var J in h){var G=h[J];if(typeof G!="function")return j(R,L,F,J,X(G));var se=G(V,J,R,L,F+"."+J,t);if(se)return se}return null}return x(y)}function W(h){function y(T,C,R,L,F){var V=T[C],M=z(V);if(M!=="object")return new g("Invalid "+L+" `"+F+"` of type `"+M+"` "+("supplied to `"+R+"`, expected `object`."));var J=e({},T[C],h);for(var G in J){var se=h[G];if(n(h,G)&&typeof se!="function")return j(R,L,F,G,X(se));if(!se)return new g("Invalid "+L+" `"+F+"` key `"+G+"` supplied to `"+R+"`.\nBad object: "+JSON.stringify(T[C],null," ")+`
|
|
45
|
+
Valid keys: `+JSON.stringify(Object.keys(h),null," "));var N=se(V,G,R,L,F+"."+G,t);if(N)return N}return null}return x(y)}function B(h){switch(typeof h){case"number":case"string":case"undefined":return!0;case"boolean":return!h;case"object":if(Array.isArray(h))return h.every(B);if(h===null||o(h))return!0;var y=l(h);if(y){var T=y.call(h),C;if(y!==h.entries){for(;!(C=T.next()).done;)if(!B(C.value))return!1}else for(;!(C=T.next()).done;){var R=C.value;if(R&&!B(R[1]))return!1}}else return!1;return!0;default:return!1}}function q(h,y){return h==="symbol"?!0:y?y["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&y instanceof Symbol:!1}function z(h){var y=typeof h;return Array.isArray(h)?"array":h instanceof RegExp?"object":q(y,h)?"symbol":y}function X(h){if(typeof h>"u"||h===null)return""+h;var y=z(h);if(y==="object"){if(h instanceof Date)return"date";if(h instanceof RegExp)return"regexp"}return y}function H(h){var y=X(h);switch(y){case"array":case"object":return"an "+y;case"boolean":case"date":case"regexp":return"a "+y;default:return y}}function k(h){return!h.constructor||!h.constructor.name?p:h.constructor.name}return d.checkPropTypes=s,d.resetWarningCache=s.resetWarningCache,d.PropTypes=d,d},ot}var lt,Yt;function sn(){if(Yt)return lt;Yt=1;var r=vt();function e(){}function t(){}return t.resetWarningCache=e,lt=function(){function n(i,o,u,c,f,l){if(l!==r){var p=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 p.name="Invariant Violation",p}}n.isRequired=n;function s(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:e};return a.PropTypes=a,a},lt}var Ut;function an(){if(Ut)return Fe.exports;if(Ut=1,process.env.NODE_ENV!=="production"){var r=hr(),e=!0;Fe.exports=nn()(r.isElement,e)}else Fe.exports=sn()();return Fe.exports}var ie=an(),on=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},ln=function(e,t){for(var n in e)if(!(n in t))return!0;for(var s in t)if(e[s]!==t[s])return!0;return!1},cn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],Ye="http://www.w3.org/2000/svg",Wt="http://www.w3.org/1999/xlink",Re=function(r){function e(){for(var n,s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];return n=r.call.apply(r,[this].concat(a))||this,n.initialState={hasError:!1,isLoading:!0},n.state=n.initialState,n._isMounted=!1,n.reactWrapper=void 0,n.nonReactWrapper=void 0,n.refCallback=function(o){n.reactWrapper=o},n}Wr(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof on(this.reactWrapper).Node){var a=this.props,i=a.desc,o=a.evalScripts,u=a.httpRequestWithCredentials,c=a.renumerateIRIElements,f=a.src,l=a.title,p=a.useRequestCache,d=this.props.onError,m=this.props.beforeInjection,g=this.props.afterInjection,x=this.props.wrapper,w,E;x==="svg"?(w=document.createElementNS(Ye,x),w.setAttribute("xmlns",Ye),w.setAttribute("xmlns:xlink",Wt),E=document.createElementNS(Ye,x)):(w=document.createElement(x),E=document.createElement(x)),w.appendChild(E),E.dataset.src=f,this.nonReactWrapper=this.reactWrapper.appendChild(w);var O=function($){if(s.removeSVG(),!s._isMounted){d($);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){d($)})},S=function($,U){if($){O($);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{g(U)}catch(D){O(D)}})},b=function($){if($.setAttribute("role","img"),i){var U=$.querySelector(":scope > desc");U&&$.removeChild(U);var D=document.createElement("desc");D.innerHTML=i,$.prepend(D)}if(l){var A=$.querySelector(":scope > title");A&&$.removeChild(A);var j=document.createElement("title");j.innerHTML=l,$.prepend(j)}try{m($)}catch(I){O(I)}};Zr(E,{afterEach:S,beforeEach:b,cacheRequests:p,evalScripts:o,httpRequestWithCredentials:u,renumerateIRIElements:c})}},t.removeSVG=function(){var s;(s=this.nonReactWrapper)!=null&&s.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},t.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},t.componentDidUpdate=function(s){var a=this;ln(qe({},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,u=Ur(s,cn),c=o;return ke.createElement(c,qe({},u,{ref:this.refCallback},o==="svg"?{xmlns:Ye,xmlnsXlink:Wt}:{}),this.state.isLoading&&i&&ke.createElement(i,null),this.state.hasError&&a&&ke.createElement(a,null))},e}(ke.Component);Re.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};Re.propTypes={afterInjection:ie.func,beforeInjection:ie.func,desc:ie.string,evalScripts:ie.oneOf(["always","once","never"]),fallback:ie.oneOfType([ie.func,ie.object,ie.string]),httpRequestWithCredentials:ie.bool,loading:ie.oneOfType([ie.func,ie.object,ie.string]),onError:ie.func,renumerateIRIElements:ie.bool,src:ie.string.isRequired,title:ie.string,useRequestCache:ie.bool,wrapper:ie.oneOf(["div","span","svg"])};let pt={assets:"/"};const un=r=>{pt={...pt,...r}},Ht=r=>`${pt.assets}/${r}`.replace(/\/+/g,"/"),le=P.memo(({icon:r,width:e,height:t,placeholderIcon:n,color:s,disabled:a,state:i="base",rotated:o=!1,onClick:u,isInteractable:c=!1,spin:f=!1,title:l,tabIndex:p})=>{const[d,m]=P.useState(r),g=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),x=g&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),w=Ht(`assets/svg/${r}.svg`),E=Ht(`assets/svg/${n}.svg`),O={img:`${c?"smp-image-interactable":""}`,svg:`smp-icon ${i?`smp-icon-${i}`:""} ${o?"smp-icon-rotated":""} ${c?"smp-icon-interactable":""} ${f?"smp-icon-spin":""}`},S=()=>{!a&&c&&u&&u()},b=_=>{!a&&c&&(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),S())};return v.jsx(v.Fragment,{children:x?v.jsx(Re,{src:r,fallback:()=>v.jsx(Re,{src:E,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:l,role:"application",fill:s,"aria-disabled":a,className:O.svg,onClick:S,onKeyDown:b,tabIndex:p}):g?v.jsx("img",{src:d,width:e||"16px",height:t||"auto",alt:l,onError:()=>m(E),onClick:S,className:O.img,title:l,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&S()}}):v.jsx(Re,{src:w,fallback:()=>v.jsx(Re,{src:E,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:l,role:"application",fill:s,"aria-disabled":a,className:O.svg,onClick:S,onKeyDown:b,tabIndex:p})})}),we=({disabled:r,bindValue:e,icon:t,onBlur:n,onChange:s,placeholder:a,isEditable:i=!0,shapeIcon:o,sizing:u,state:c,variant:f,rotatedShapeIcon:l=!1,onShapeIconClick:p,ref:d,inputRef:m,onKeyDown:g,inputType:x="text",ariaLabel:w="input field",label:E,helperText:O=!1,error:S,appearance:b="base",fullWidth:_=!1,_dataComponent:$="textfield",width:U})=>{const D=P.useId(),A=`${D}-helper`,j=S?"danger":c,I=S||c=="danger"?"error":o,W=O||!!S,B=X=>{s==null||s(X.target.value)},q={wrapper:`smp-textfield-wrapper ${_?"smp-textfield-fullWidth":""}`,container:`smp-textfield ${r?"smp-textfield-disabled":""} ${a?"smp-textfield-placeholder":""} ${u?`smp-textfield-${u}`:""} ${j?`smp-textfield-${j}`:""} ${b?`smp-textfield-${b}`:""} ${i?"":"smp-textfield-readOnly"}`,input:"smp-textfield-input "};f&&(f!="notSelectable"||i)&&(q.container+=`smp-textfield-variant-${f}`);const z=U?{"--smp-textField-width-base":U}:void 0;return v.jsxs("div",{className:q.wrapper,"data-component":$,children:[E&&v.jsx(De,{label:E,disabled:r,htmlFor:D}),v.jsxs("div",{className:q.container,ref:d,style:z,children:[t&&v.jsx(le,{icon:t,disabled:r}),v.jsx("input",{id:D,type:x,value:e,placeholder:a,onChange:B,onBlur:n,className:q.input,disabled:r,readOnly:!i,onKeyDown:g,"aria-label":w,ref:m,"aria-describedby":W?A:void 0}),I&&v.jsx(le,{icon:I,disabled:r,state:j,onClick:p,rotated:l,isInteractable:i,tabIndex:0})]}),W&&v.jsx(fr,{helperText:S,disabled:r,state:j,id:A})]})};function gr({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=P.useState(0),i=P.useRef(null),o=r.length*e,u=Math.max(0,Math.floor(s/e)-n),c=Math.min(r.length-1,Math.floor((s+t)/e)+n),f=[];for(let d=u;d<=c;d++)f.push({item:r[d],index:d,offsetTop:d*e});const l=P.useCallback(d=>{const m=d.target.scrollTop;a(m)},[]),p=d=>{if(!i.current)return;const m=d*e,g=m+e,x=i.current,w=x.scrollTop,E=w+t;m<w?x.scrollTop=m:g>E&&(x.scrollTop=g-t)};return{virtualItems:f,containerProps:{ref:i,style:{maxHeight:`${t}px`,overflowY:"auto",position:"relative",willChange:"transform"},onScroll:l},innerProps:{style:{height:`${o}px`,position:"relative",width:"100%"}},scrollInfo:{scrollTop:s,viewportHeight:t,totalHeight:o,startIndex:u,endIndex:c},scrollToIndex:p}}const fn={"smp-list":"_smp-list_l1sf5_1"},dn=10,yr=({id:r,options:e,displayMode:t,ref:n,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:u,onKeyDown:c})=>{var A;const[f,l]=P.useState(""),p=24,[d,m]=P.useState(a!==null?a:-1),g=s!==void 0?s:e.length>dn,x=f?e.filter(j=>j.label.toLowerCase().includes(f.toLowerCase())):e,w=j=>{l(j)},{virtualItems:E,containerProps:O,innerProps:S,scrollToIndex:b}=gr({items:x,itemHeight:p,containerHeight:200,overscan:5});P.useEffect(()=>{a!==null&&a!==d&&m(a)},[a]),P.useEffect(()=>{d>=0&&d<x.length&&b(d)},[d,x]);const _=j=>{if(j.key==="ArrowDown"||j.key==="ArrowUp"){j.preventDefault();let I=d;j.key==="ArrowDown"?I=d<x.length-1?d+1:0:j.key==="ArrowUp"&&(I=d>0?d-1:x.length-1),m(I)}else j.key==="Enter"?d>=0&&d<x.length&&(u==null||u(x[d])):j.key==="Escape"&&(j.preventDefault(),j.stopPropagation());c&&c(j)},$=j=>{_(j)},U=j=>{_(j)},D={wrapper:`${fn["smp-list"]}`,container:"smp-list-container",virtualScroll:"smp-list-virtualScroll",listItem:"smp-list-listItem"};return v.jsxs("div",{id:r,ref:n,className:D.wrapper,"data-component":"list",style:{width:o},children:[g&&v.jsx(we,{bindValue:f,placeholder:"Search...",onChange:w,onKeyDown:$}),v.jsx("div",{...O,className:D.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:U,"aria-activedescendant":d>=0&&d<x.length?(A=x[d])==null?void 0:A.id:void 0,children:v.jsx("div",{...S,className:D.virtualScroll,children:E.map(({item:j,index:I,offsetTop:W})=>{const B=i.includes(j.id);return v.jsxs("li",{role:"option",id:j.id,"aria-selected":d===I?"true":"false",tabIndex:-1,className:`${D.listItem} ${d===I?"selected-item":""}`,"aria-label":j.id+"-"+j.label,style:{height:`${p}px`,lineHeight:`calc(${p}px - 2*2px)`,transform:`translateY(${W}px)`},onClick:()=>{u==null||u(j),m(I)},children:[ze(j.id,j.label,t),B&&v.jsx(le,{icon:"check",width:16})]},j.id)})})})]})},vr=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=P.useState(ze(e,t,r));return P.useEffect(()=>{a(e)},[e]),P.useEffect(()=>{a(ze(e,t,r))},[t,r]),v.jsx(we,{...n,bindValue:s})},pn=r=>{const e=P.useRef(null);return P.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},r)}},bt=({bindValue:r,optionalDisplayValue:e,options:t,displayMode:n,listDisplayMode:s="Both",minimumChars:a=3,isEditable:i=!0,placeholder:o,fun:u,_changeOnEnter:c=!1,onChange:f,onOptionsRequest:l,_multiActiveIndex:p,...d})=>{const[m,g]=P.useState(r),[x,w]=P.useState(e),[E,O]=P.useState(!1),[S,b]=P.useState(t||[]),[_,$]=P.useState(0),[U,D]=P.useState([r]),{anchorRef:A,targetRef:j,anchorWidth:I}=yt({position:"bottom",enabled:E});Ke(j,()=>O(!1));const W=pn(400),B=H=>{H.length>=a?u&&l&&W(async()=>{const k=await l(u,H);b(k),$(k.length>0?0:-1),O(!0)}):O(!1),g(H),w(e),c||f==null||f(H,e)},q=H=>{c?(g(""),w("")):(g(H.id),w(H.label)),f==null||f(H.id,H.label);const k=S.findIndex(h=>h.id===H.id);$(k),D([H.id]),O(!1)},z=H=>{H.key==="Escape"&&(O(!1),$(-1))},X=H=>{if((H.key==="ArrowDown"||H.key==="ArrowUp")&&(H.preventDefault(),E)){const k=H.key==="ArrowDown"?(_+1)%S.length:(_-1+S.length)%S.length;$(k)}switch(H.key){case"Enter":_>=0&&_<S.length?q(S[_]):c&&(f==null||f(m,""),O(!1),g(""),w(""));break;case"Escape":O(!1),$(-1);break}};return v.jsxs("div",{"data-component":"autocomplete",children:[v.jsx(vr,{...d,bindValue:m,optionalDisplayValue:x,displayMode:n,isEditable:i,shapeIcon:"magnify",placeholder:o,ref:A,onChange:B,onKeyDown:X,"aria-autocomplete":"list"}),E&&v.jsx(yr,{options:S,displayMode:s,onClick:q,ref:j,selectedIndex:_,activeIndex:p||U,width:I,showFilter:!1,onKeyDown:z})]})},Bt=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],Gt=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],xe=({label:r,onClick:e,ariaLabel:t,icon:n,disabled:s,sizing:a="base",variant:i="primary",appearance:o="raised",showIcon:u=!0,showText:c=!0,fullWidth:f=!1,loading:l=!1,justify:p="center",title:d,optionalDisplayValue:m})=>{const g={container:`smp-button smp-button-container ${a?`smp-button-${a}`:""} ${i?`smp-buttonVariant-${i}`:""} ${o?`smp-buttonType-${o}`:""} ${f?"smp-button-fullWidth":""} smp-justifyContent-${p}`};return v.jsx("button",{"data-component":"button",className:g.container,onClick:e,"aria-label":t,disabled:s,"aria-busy":l,title:d||r||m,children:l?v.jsx(le,{icon:"spinner",state:Gt(i),spin:!0}):v.jsxs(v.Fragment,{children:[n&&u&&v.jsx(le,{icon:n,disabled:s,state:Gt(i),width:Bt(a),height:Bt(a)}),c&&m&&v.jsx("span",{children:m})]})})},br=({options:r,fun:e,direction:t="row",disposition:n="start",sizing:s,variant:a,appearance:i,showText:o,showIcon:u,fullWidth:c,disabled:f,justify:l,onClick:p,onOptionsRequest:d})=>{const[m,g]=P.useState(r);P.useEffect(()=>{!m&&d&&e&&d(e,void 0).then(E=>g(E)).catch(E=>{console.error("Errore nel caricamento delle opzioni per ButtonList",E)})},[m,e,d]);const x={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${n}`},w=m==null?void 0:m.map((E,O)=>{const S={bindValue:E.id,optionalDisplayValue:E.label,fun:E.fun,icon:E.icon,variant:a,appearance:i,showText:o,showIcon:u,fullWidth:c,disabled:f,sizing:s,justify:l,onClick:()=>{p==null||p(E.id,E.fun)}};return v.jsx(xe,{...S},`button-${O}`)});return v.jsx("div",{role:"list","data-component":"button-list",className:x.container,children:w})},xr=({bindValue:r,_dataComponent:e="checkbox",disabled:t,label:n,isEditable:s=!0,onChange:a,onBlur:i})=>{const o=c=>{s&&a&&a(c.target.checked)},u={wrapper:"smp-checkbox-wrapper"};return v.jsxs("div",{className:u.wrapper,"data-component":e,children:[n&&v.jsx(De,{label:n,disabled:t}),v.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:o,onBlur:i})]})},hn={titleLarge:"h2",title:"h3",body:"h6",label:"label"},Ae=({variant:r="body",bindValue:e,color:t,...n})=>{const s=hn[r],a={container:`smp-typography ${r?`smp-typography-${r}`:""} ${n.disabled?"smp-typography-disabled":""}`};return v.jsx(s,{className:a.container,disabled:n.disabled,style:{"--smp-typography-color-base":t},children:e})},xt=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,u]=P.useState(null),c={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},f=d=>{n==null||n(r.filter((m,g)=>g!==d))},l=d=>{u(d)},p=d=>{if(o===null||o===d)return;const m=[...r],[g]=m.splice(o,1);m.splice(d,0,g),n==null||n(m),u(null)};return v.jsx("div",{className:c.container,role:"list","data-component":"chip",children:r.flatMap((d,m)=>{const g=ze(d.bindValue,d.optionalDisplayValue,t),x=v.jsxs("div",{className:c.element,role:"listitem",draggable:i,onDragStart:()=>l(m),onDragOver:E=>i&&E.preventDefault(),onDrop:()=>i&&p(m),style:{"--smp-chips-backgroundColor-base":a},children:[i&&v.jsx(le,{icon:"drag_indicator_horizontal",isInteractable:!0}),v.jsx(Ae,{variant:"label",bindValue:g,color:s}),e&&v.jsx(le,{icon:"close",isInteractable:!0,onClick:()=>f(m),color:s})]},`chip-${m}`),w=i&&m<r.length-1?v.jsx(le,{icon:"chevron-right",color:s},`separator-${m}`):null;return[x,w].filter(Boolean)})})};function Sr(r,e){const t=P.useRef(null);P.useEffect(()=>{if(!r)return;const n=typeof e=="object"&&e!==null&&"current"in e?e.current:null;if(!n)return;t.current=document.activeElement;const s=()=>n?Array.from(n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(c=>!c.hasAttribute("disabled")&&c.offsetParent!==null):[];(()=>{const c=s();c.length>0&&requestAnimationFrame(()=>c[0].focus())})();const i=c=>{if(c.key==="Escape"||c.key!=="Tab")return;const f=s();if(f.length===0)return;const l=f[0],p=f[f.length-1];c.shiftKey&&document.activeElement===l?(c.preventDefault(),p.focus()):!c.shiftKey&&document.activeElement===p&&(c.preventDefault(),l.focus())},o=c=>{if(n&&!n.contains(c.target)){c.preventDefault();const f=s();f.length>0&&f[0].focus()}};document.addEventListener("keydown",i),document.addEventListener("mousedown",o);const u=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",o),document.body.style.overflow=u,t.current&&requestAnimationFrame(()=>{var c;(c=t.current)==null||c.focus()})}},[r,e])}const wr=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,isEditable:s,displayMode:a,listDisplayMode:i="Both",fun:o,onOptionsRequest:u,multiActiveIndex:c,...f})=>{const[l,p]=P.useState(!1),[d,m]=P.useState(t),[g,x]=P.useState(-1),[w,E]=P.useState([r]),O=P.useId(),{anchorRef:S,targetRef:b,anchorWidth:_}=yt({position:"bottom",enabled:l});Ke(b,()=>p(!1)),Sr(l,b);const $=j=>{e==null||e(j.id,j.label);const I=d.findIndex(W=>W.id===j.id);x(I),E([j.id]),p(!1)},U=j=>{j.key==="Escape"&&(p(!1),x(-1))},D=j=>{(j.key==="ArrowDown"||j.key==="ArrowUp")&&(j.preventDefault(),A())},A=()=>{o&&u&&u(o,void 0).then(j=>{m(j),x(j.length>0?0:-1),p(!0)})};return v.jsxs("div",{role:"combobox","aria-expanded":l,"aria-controls":O,"aria-owns":O,"data-component":"combobox",children:[v.jsx(vr,{...f,bindValue:r,optionalDisplayValue:n,displayMode:a,onShapeIconClick:A,onKeyDown:D,shapeIcon:"arrow_drop_down",rotatedShapeIcon:l,isEditable:s,ref:S,"aria-autocomplete":"list",variant:"notSelectable"}),l&&v.jsx(yr,{id:O,options:d,displayMode:i,ref:b,selectedIndex:g,activeIndex:c||w,width:_,onClick:$,onKeyDown:U})]})},K=r=>typeof r=="string",$e=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},Kt=r=>r==null?"":""+r,mn=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},gn=/###/g,zt=r=>r&&r.indexOf("###")>-1?r.replace(gn,"."):r,qt=r=>!r||K(r),Pe=(r,e,t)=>{const n=K(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(qt(r))return{};const a=zt(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return qt(r)?{}:{obj:r,k:zt(n[s])}},Jt=(r,e,t)=>{const{obj:n,k:s}=Pe(r,e,Object);if(n!==void 0||e.length===1){n[s]=t;return}let a=e[e.length-1],i=e.slice(0,e.length-1),o=Pe(r,i,Object);for(;o.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),o=Pe(r,i,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=t},yn=(r,e,t,n)=>{const{obj:s,k:a}=Pe(r,e,Object);s[a]=s[a]||[],s[a].push(t)},Je=(r,e)=>{const{obj:t,k:n}=Pe(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},vn=(r,e,t)=>{const n=Je(r,t);return n!==void 0?n:Je(e,t)},Er=(r,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?K(r[n])||r[n]instanceof String||K(e[n])||e[n]instanceof String?t&&(r[n]=e[n]):Er(r[n],e[n],t):r[n]=e[n]);return r},Te=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var bn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const xn=r=>K(r)?r.replace(/[&<>"'\/]/g,e=>bn[e]):r;class Sn{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 wn=[" ",",","?","!",";"],En=new Sn(20),Tn=(r,e,t)=>{e=e||"",t=t||"";const n=wn.filter(i=>e.indexOf(i)<0&&t.indexOf(i)<0);if(n.length===0)return!0;const s=En.getRegExp(`(${n.map(i=>i==="?"?"\\?":i).join("|")})`);let a=!s.test(r);if(!a){const i=r.indexOf(t);i>0&&!s.test(r.substring(0,i))&&(a=!0)}return a},ht=(r,e,t=".")=>{if(!r)return;if(r[e])return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0;const n=e.split(t);let s=r;for(let a=0;a<n.length;){if(!s||typeof s!="object")return;let i,o="";for(let u=a;u<n.length;++u)if(u!==a&&(o+=t),o+=n[u],i=s[o],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&u<n.length-1)continue;a+=u-a+1;break}s=i}return s},Le=r=>r==null?void 0:r.replace("_","-"),On={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,e){var t,n;(n=(t=console==null?void 0:console[r])==null?void 0:t.apply)==null||n.call(t,console,e)}};class Xe{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||On,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:(K(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Xe(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Xe(this.logger,e)}}var me=new Xe;class Qe{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const s=this.observers[n].get(t)||0;this.observers[n].set(t,s+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s.apply(s,[e,...t])})}}class Xt extends Qe{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,s={}){var c,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):K(n)&&a?o.push(...n.split(a)):o.push(n)));const u=Je(this.data,o);return!u&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),u||!i||!K(n)?u:ht((f=(c=this.data)==null?void 0:c[e])==null?void 0:f[t],n,a)}addResource(e,t,n,s,a={silent:!1}){const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let o=[e,t];n&&(o=o.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=e.split("."),s=t,t=o[1]),this.addNamespaces(t),Jt(this.data,o,s),a.silent||this.emit("added",e,t,n,s)}addResources(e,t,n,s={silent:!1}){for(const a in n)(K(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 u=Je(this.data,o)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?Er(u,n,a):u={...u,...n},Jt(this.data,o,u),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(s=>t[s]&&Object.keys(t[s]).length>0)}toJSON(){return this.data}}var Tr={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,n,s){return r.forEach(a=>{var i;e=((i=this.processors[a])==null?void 0:i.process(e,t,n,s))??e}),e}};const Zt={},Qt=r=>!K(r)&&typeof r!="boolean"&&typeof r!="number";class Ze extends Qe{constructor(e,t={}){super(),mn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=me.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(e==null)return!1;const s=this.resolve(e,n);return(s==null?void 0:s.res)!==void 0}extractFromKey(e,t){let n=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const s=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let a=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!Tn(e,n,s);if(i&&!o){const u=e.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:e,namespaces:K(a)?[a]:a};const c=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(c[0])>-1)&&(a=c.shift()),e=c.join(s)}return{key:e,namespaces:K(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:u}=this.extractFromKey(e[e.length-1],s),c=u[u.length-1];let f=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;f===void 0&&(f=":");const l=s.lng||this.language,p=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((l==null?void 0:l.toLowerCase())==="cimode")return p?a?{res:`${c}${f}${o}`,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:`${c}${f}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:l,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:o;const d=this.resolve(e,s);let m=d==null?void 0:d.res;const g=(d==null?void 0:d.usedKey)||o,x=(d==null?void 0:d.exactUsedKey)||o,w=["[object Number]","[object Function]","[object RegExp]"],E=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,O=!this.i18nFormat||this.i18nFormat.handleAsObject,S=s.count!==void 0&&!K(s.count),b=Ze.hasDefaultValue(s),_=S?this.pluralResolver.getSuffix(l,s.count,s):"",$=s.ordinal&&S?this.pluralResolver.getSuffix(l,s.count,{ordinal:!1}):"",U=S&&!s.ordinal&&s.count===0,D=U&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${_}`]||s[`defaultValue${$}`]||s.defaultValue;let A=m;O&&!m&&b&&(A=D);const j=Qt(A),I=Object.prototype.toString.apply(A);if(O&&A&&j&&w.indexOf(I)<0&&!(K(E)&&Array.isArray(A))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const W=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,A,{...s,ns:u}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(d.res=W,d.usedParams=this.getUsedParamsDetails(s),d):W}if(i){const W=Array.isArray(A),B=W?[]:{},q=W?x:g;for(const z in A)if(Object.prototype.hasOwnProperty.call(A,z)){const X=`${q}${i}${z}`;b&&!m?B[z]=this.translate(X,{...s,defaultValue:Qt(D)?D[z]:void 0,joinArrays:!1,ns:u}):B[z]=this.translate(X,{...s,joinArrays:!1,ns:u}),B[z]===X&&(B[z]=A[z])}m=B}}else if(O&&K(E)&&Array.isArray(m))m=m.join(E),m&&(m=this.extendTranslation(m,e,s,n));else{let W=!1,B=!1;!this.isValidLookup(m)&&b&&(W=!0,m=D),this.isValidLookup(m)||(B=!0,m=o);const z=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&B?void 0:m,X=b&&D!==m&&this.options.updateMissing;if(B||W||X){if(this.logger.log(X?"updateKey":"missingKey",l,c,o,X?D:m),i){const y=this.resolve(o,{...s,keySeparator:!1});y&&y.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let H=[];const k=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&k&&k[0])for(let y=0;y<k.length;y++)H.push(k[y]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(s.lng||this.language):H.push(s.lng||this.language);const h=(y,T,C)=>{var L;const R=b&&C!==m?C:z;this.options.missingKeyHandler?this.options.missingKeyHandler(y,c,T,R,X,s):(L=this.backendConnector)!=null&&L.saveMissing&&this.backendConnector.saveMissing(y,c,T,R,X,s),this.emit("missingKey",y,c,T,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&S?H.forEach(y=>{const T=this.pluralResolver.getSuffixes(y,s);U&&s[`defaultValue${this.options.pluralSeparator}zero`]&&T.indexOf(`${this.options.pluralSeparator}zero`)<0&&T.push(`${this.options.pluralSeparator}zero`),T.forEach(C=>{h([y],o+C,s[`defaultValue${C}`]||D)})}):h(H,o,D))}m=this.extendTranslation(m,e,s,d,n),B&&m===o&&this.options.appendNamespaceToMissingKey&&(m=`${c}${f}${o}`),(B||W)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${f}${o}`:o,W?m:void 0,s))}return a?(d.res=m,d.usedParams=this.getUsedParamsDetails(s),d):m}extendTranslation(e,t,n,s,a){var u,c;if((u=this.i18nFormat)!=null&&u.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=K(e)&&(((c=n==null?void 0:n.interpolation)==null?void 0:c.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let l;if(f){const d=e.match(this.interpolator.nestingRegexp);l=d&&d.length}let p=n.replace&&!K(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),e=this.interpolator.interpolate(e,p,n.lng||this.language||s.usedLng,n),f){const d=e.match(this.interpolator.nestingRegexp),m=d&&d.length;l<m&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...d)=>(a==null?void 0:a[0])===d[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${d[0]} in key: ${t[0]}`),null):this.translate(...d,t),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,o=K(i)?[i]:i;return e!=null&&(o!=null&&o.length)&&n.applyPostProcessor!==!1&&(e=Tr.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,s,a,i,o;return K(e)&&(e=[e]),e.forEach(u=>{if(this.isValidLookup(n))return;const c=this.extractFromKey(u,t),f=c.key;s=f;let l=c.namespaces;this.options.fallbackNS&&(l=l.concat(this.options.fallbackNS));const p=t.count!==void 0&&!K(t.count),d=p&&!t.ordinal&&t.count===0,m=t.context!==void 0&&(K(t.context)||typeof t.context=="number")&&t.context!=="",g=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(x=>{var w,E;this.isValidLookup(n)||(o=x,!Zt[`${g[0]}-${x}`]&&((w=this.utils)!=null&&w.hasLoadedNamespace)&&!((E=this.utils)!=null&&E.hasLoadedNamespace(o))&&(Zt[`${g[0]}-${x}`]=!0,this.logger.warn(`key "${s}" for languages "${g.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach(O=>{var _;if(this.isValidLookup(n))return;i=O;const S=[f];if((_=this.i18nFormat)!=null&&_.addLookupKeys)this.i18nFormat.addLookupKeys(S,f,O,x,t);else{let $;p&&($=this.pluralResolver.getSuffix(O,t.count,t));const U=`${this.options.pluralSeparator}zero`,D=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(S.push(f+$),t.ordinal&&$.indexOf(D)===0&&S.push(f+$.replace(D,this.options.pluralSeparator)),d&&S.push(f+U)),m){const A=`${f}${this.options.contextSeparator}${t.context}`;S.push(A),p&&(S.push(A+$),t.ordinal&&$.indexOf(D)===0&&S.push(A+$.replace(D,this.options.pluralSeparator)),d&&S.push(A+U))}}let b;for(;b=S.pop();)this.isValidLookup(n)||(a=b,n=this.getResource(O,x,b,t))}))})}),{res:n,usedKey:s,exactUsedKey:a,usedLng:i,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,n,s={}){var a;return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!K(e.replace);let s=n?e.replace:e;if(n&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const a of t)delete s[a]}return s}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&e[n]!==void 0)return!0;return!1}}class er{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=me.create("languageUtils")}getScriptPartFromCode(e){if(e=Le(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=Le(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(K(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)),K(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 K(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))):K(e)&&a(this.formatLanguageCode(e)),n.forEach(i=>{s.indexOf(i)<0&&a(this.formatLanguageCode(i))}),s}}const tr={zero:0,one:1,two:2,few:3,many:4,other:5},rr={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Rn{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=me.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Le(e==="dev"?"en":e),s=t.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:s});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let i;try{i=new Intl.PluralRules(n,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),rr;if(!e.match(/-|_/))return rr;const u=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(u,t)}return this.pluralRulesCache[a]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(s=>`${t}${s}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((s,a)=>tr[s]-tr[a]).map(s=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,t,n={}){const s=this.getRule(e,n);return s?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const nr=(r,e,t,n=".",s=!0)=>{let a=vn(r,e,t);return!a&&s&&K(t)&&(a=ht(r,t,n),a===void 0&&(a=ht(e,t,n))),a},ct=r=>r.replace(/\$/g,"$$$$");class Dn{constructor(e={}){var t;this.logger=me.create("interpolator"),this.options=e,this.format=((t=e==null?void 0:e.interpolation)==null?void 0:t.format)||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:a,prefixEscaped:i,suffix:o,suffixEscaped:u,formatSeparator:c,unescapeSuffix:f,unescapePrefix:l,nestingPrefix:p,nestingPrefixEscaped:d,nestingSuffix:m,nestingSuffixEscaped:g,nestingOptionsSeparator:x,maxReplaces:w,alwaysFormat:E}=e.interpolation;this.escape=t!==void 0?t:xn,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?Te(a):i||"{{",this.suffix=o?Te(o):u||"}}",this.formatSeparator=c||",",this.unescapePrefix=f?"":l||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=p?Te(p):d||Te("$t("),this.nestingSuffix=m?Te(m):g||Te(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=w||1e3,this.alwaysFormat=E!==void 0?E:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,n)=>(t==null?void 0:t.source)===n?(t.lastIndex=0,t):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,n,s){var d;let a,i,o;const u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=m=>{if(m.indexOf(this.formatSeparator)<0){const E=nr(t,u,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,n,{...s,...t,interpolationkey:m}):E}const g=m.split(this.formatSeparator),x=g.shift().trim(),w=g.join(this.formatSeparator).trim();return this.format(nr(t,u,x,this.options.keySeparator,this.options.ignoreJSONStructure),w,n,{...s,...t,interpolationkey:x})};this.resetRegExp();const f=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,l=((d=s==null?void 0:s.interpolation)==null?void 0:d.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:m=>ct(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?ct(this.escape(m)):ct(m)}].forEach(m=>{for(o=0;a=m.regex.exec(e);){const g=a[1].trim();if(i=c(g),i===void 0)if(typeof f=="function"){const w=f(e,a,s);i=K(w)?w:""}else if(s&&Object.prototype.hasOwnProperty.call(s,g))i="";else if(l){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${e}`),i="";else!K(i)&&!this.useRawValueToEscape&&(i=Kt(i));const x=m.safeValue(i);if(e=e.replace(a[0],x),l?(m.regex.lastIndex+=i.length,m.regex.lastIndex-=a[0].length):m.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let s,a,i;const o=(u,c)=>{const f=this.nestingOptionsSeparator;if(u.indexOf(f)<0)return u;const l=u.split(new RegExp(`${f}[ ]*{`));let p=`{${l[1]}`;u=l[0],p=this.interpolate(p,i);const d=p.match(/'/g),m=p.match(/"/g);(((d==null?void 0:d.length)??0)%2===0&&!m||m.length%2!==0)&&(p=p.replace(/'/g,'"'));try{i=JSON.parse(p),c&&(i={...c,...i})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,g),`${u}${f}${p}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,u};for(;s=this.nestingRegexp.exec(e);){let u=[];i={...n},i=i.replace&&!K(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let c=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const f=s[1].split(this.formatSeparator).map(l=>l.trim());s[1]=f.shift(),u=f,c=!0}if(a=t(o.call(this,s[1].trim(),i),i),a&&s[0]===e&&!K(a))return a;K(a)||(a=Kt(a)),a||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),a=""),c&&(a=u.reduce((f,l)=>this.format(f,l,n.lng,{...n,interpolationkey:s[1].trim()}),a.trim())),e=e.replace(s[0],a),this.regexp.lastIndex=0}return e}}const jn=r=>{let e=r.toLowerCase().trim();const t={};if(r.indexOf("(")>-1){const n=r.split("(");e=n[0].toLowerCase().trim();const s=n[1].substring(0,n[1].length-1);e==="currency"&&s.indexOf(":")<0?t.currency||(t.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?t.range||(t.range=s.trim()):s.split(";").forEach(i=>{if(i){const[o,...u]=i.split(":"),c=u.join(":").trim().replace(/^'+|'+$/g,""),f=o.trim();t[f]||(t[f]=c),c==="false"&&(t[f]=!1),c==="true"&&(t[f]=!0),isNaN(c)||(t[f]=parseInt(c,10))}})}return{formatName:e,formatOptions:t}},sr=r=>{const e={};return(t,n,s)=>{let a=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(a={...a,[s.interpolationkey]:void 0});const i=n+JSON.stringify(a);let o=e[i];return o||(o=r(Le(n),s),e[i]=o),o(t)}},Cn=r=>(e,t,n)=>r(Le(t),n)(e);class $n{constructor(e={}){this.logger=me.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?sr:Cn;this.formats={number:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a});return o=>i.format(o)}),currency:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a,style:"currency"});return o=>i.format(o)}),datetime:n((s,a)=>{const i=new Intl.DateTimeFormat(s,{...a});return o=>i.format(o)}),relativetime:n((s,a)=>{const i=new Intl.RelativeTimeFormat(s,{...a});return o=>i.format(o,a.range||"day")}),list:n((s,a)=>{const i=new Intl.ListFormat(s,{...a});return o=>i.format(o)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=sr(t)}format(e,t,n,s={}){const a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(o=>o.indexOf(")")>-1)){const o=a.findIndex(u=>u.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,o)].join(this.formatSeparator)}return a.reduce((o,u)=>{var l;const{formatName:c,formatOptions:f}=jn(u);if(this.formats[c]){let p=o;try{const d=((l=s==null?void 0:s.formatParams)==null?void 0:l[s.interpolationkey])||{},m=d.locale||d.lng||s.locale||s.lng||n;p=this.formats[c](o,m,{...f,...s,...d})}catch(d){this.logger.warn(d)}return p}else this.logger.warn(`there was no format function for ${c}`);return o},e)}}const Pn=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class An extends Qe{constructor(e,t,n,s={}){var a,i;super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=me.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(i=(a=this.backend)==null?void 0:a.init)==null||i.call(a,n,s.backend,s)}queueLoad(e,t,n,s){const a={},i={},o={},u={};return e.forEach(c=>{let f=!0;t.forEach(l=>{const p=`${c}|${l}`;!n.reload&&this.store.hasResourceBundle(c,l)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?i[p]===void 0&&(i[p]=!0):(this.state[p]=1,f=!1,i[p]===void 0&&(i[p]=!0),a[p]===void 0&&(a[p]=!0),u[l]===void 0&&(u[l]=!0)))}),f||(o[c]=!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(u)}}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(u=>{yn(u.loaded,[a],i),Pn(u,e),t&&u.errors.push(t),u.pendingCount===0&&!u.done&&(Object.keys(u.loaded).forEach(c=>{o[c]||(o[c]={});const f=u.loaded[c];f.length&&f.forEach(l=>{o[c][l]===void 0&&(o[c][l]=!0)})}),u.done=!0,u.errors.length?u.callback(u.errors):u.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(u=>!u.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=(c,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const l=this.waitingReads.shift();this.read(l.lng,l.ns,l.fcName,l.tried,l.wait,l.callback)}if(c&&f&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,s+1,a*2,i)},a);return}i(c,f)},u=this.backend[n].bind(this.backend);if(u.length===2){try{const c=u(e,t);c&&typeof c.then=="function"?c.then(f=>o(null,f)).catch(o):o(null,c)}catch(c){o(c)}return}return u(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();K(e)&&(e=this.languageUtils.toResolveHierarchy(e)),K(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 u,c,f,l,p;if((c=(u=this.services)==null?void 0:u.utils)!=null&&c.hasLoadedNamespace&&!((l=(f=this.services)==null?void 0:f.utils)!=null&&l.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((p=this.backend)!=null&&p.create){const d={...i,isUpdate:a},m=this.backend.create.bind(this.backend);if(m.length<6)try{let g;m.length===5?g=m(e,t,n,s,d):g=m(e,t,n,s),g&&typeof g.then=="function"?g.then(x=>o(null,x)).catch(o):o(null,g)}catch(g){o(g)}else m(e,t,n,s,o,d)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const ar=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:r=>{let e={};if(typeof r[1]=="object"&&(e=r[1]),K(r[1])&&(e.defaultValue=r[1]),K(r[2])&&(e.tDescription=r[2]),typeof r[2]=="object"||typeof r[3]=="object"){const t=r[3]||r[2];Object.keys(t).forEach(n=>{e[n]=t[n]})}return e},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ir=r=>{var e,t;return K(r.ns)&&(r.ns=[r.ns]),K(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),K(r.fallbackNS)&&(r.fallbackNS=[r.fallbackNS]),((t=(e=r.supportedLngs)==null?void 0:e.indexOf)==null?void 0:t.call(e,"cimode"))<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),typeof r.initImmediate=="boolean"&&(r.initAsync=r.initImmediate),r},Ue=()=>{},Ln=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class _e extends Qe{constructor(e={},t){if(super(),this.options=ir(e),this.services={},this.logger=me,this.modules={external:[]},Ln(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&&(K(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=ar();this.options={...n,...this.options,...ir(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const s=c=>c?typeof c=="function"?new c:c:null;if(!this.options.isClone){this.modules.logger?me.init(s(this.modules.logger),this.options):me.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=$n;const f=new er(this.options);this.store=new Xt(this.options.resources,this.options);const l=this.services;l.logger=me,l.resourceStore=this.store,l.languageUtils=f,l.pluralResolver=new Rn(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(l.formatter=s(c),l.formatter.init(l,this.options),this.options.interpolation.format=l.formatter.format.bind(l.formatter)),l.interpolator=new Dn(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new An(s(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",(p,...d)=>{this.emit(p,...d)}),this.modules.languageDetector&&(l.languageDetector=s(this.modules.languageDetector),l.languageDetector.init&&l.languageDetector.init(l,this.options.detection,this.options)),this.modules.i18nFormat&&(l.i18nFormat=s(this.modules.i18nFormat),l.i18nFormat.init&&l.i18nFormat.init(this)),this.translator=new Ze(this.services,this.options),this.translator.on("*",(p,...d)=>{this.emit(p,...d)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Ue),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&c[0]!=="dev"&&(this.options.lng=c[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(c=>{this[c]=(...f)=>this.store[c](...f)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(c=>{this[c]=(...f)=>(this.store[c](...f),this)});const o=$e(),u=()=>{const c=(f,l)=>{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(l),t(f,l)};if(this.languages&&!this.isInitialized)return c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?u():setTimeout(u,0),o}loadResources(e,t=Ue){var a,i;let n=t;const s=K(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=[],u=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(l=>{l!=="cimode"&&o.indexOf(l)<0&&o.push(l)})};s?u(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>u(f)),(i=(a=this.options.preload)==null?void 0:a.forEach)==null||i.call(a,c=>u(c)),this.services.backendConnector.load(o,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(c)})}else n(null)}reloadResources(e,t,n){const s=$e();return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=Ue),this.services.backendConnector.reload(e,t,a=>{s.resolve(),n(a)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Tr.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t<this.languages.length;t++){const n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=$e();this.emit("languageChanging",e);const s=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},a=(o,u)=>{u?this.isLanguageChangingTo===e&&(s(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,n.resolve((...c)=>this.t(...c)),t&&t(o,(...c)=>this.t(...c))},i=o=>{var f,l;!e&&!o&&this.services.languageDetector&&(o=[]);const u=K(o)?o:o&&o[0],c=this.store.hasLanguageSomeTranslations(u)?u:this.services.languageUtils.getBestMatchFromCodes(K(o)?[o]:o);c&&(this.language||s(c),this.translator.language||this.translator.changeLanguage(c),(l=(f=this.services.languageDetector)==null?void 0:f.cacheUserLanguage)==null||l.call(f,c)),this.loadResources(c,p=>{a(p,c)})};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 u;typeof i!="object"?u=this.options.overloadTranslationOptionHandler([a,i].concat(o)):u={...i},u.lng=u.lng||s.lng,u.lngs=u.lngs||s.lngs,u.ns=u.ns||s.ns,u.keyPrefix!==""&&(u.keyPrefix=u.keyPrefix||n||s.keyPrefix);const c=this.options.keySeparator||".";let f;return u.keyPrefix&&Array.isArray(a)?f=a.map(l=>`${u.keyPrefix}${c}${l}`):f=u.keyPrefix?`${u.keyPrefix}${c}${a}`:a,this.t(f,u)};return K(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,u)=>{const c=this.services.backendConnector.state[`${o}|${u}`];return c===-1||c===0||c===2};if(t.precheck){const o=t.precheck(this,i);if(o!==void 0)return o}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(n,e)&&(!s||i(a,e)))}loadNamespaces(e,t){const n=$e();return this.options.ns?(K(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{n.resolve(),t&&t(s)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=$e();K(e)&&(e=[e]);const s=this.options.preload||[],a=e.filter(i=>s.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return a.length?(this.options.preload=s.concat(a),this.loadResources(i=>{n.resolve(),t&&t(i)}),n):(t&&t(),Promise.resolve())}dir(e){var s,a;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((a=this.services)==null?void 0:a.languageUtils)||new er(ar());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new _e(e,t)}cloneInstance(e={},t=Ue){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new _e(s);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(o=>{a[o]=this[o]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const o=Object.keys(this.store.data).reduce((u,c)=>(u[c]={...this.store.data[c]},u[c]=Object.keys(u[c]).reduce((f,l)=>(f[l]={...u[c][l]},f),u[c]),u),{});a.store=new Xt(o,s),a.services.resourceStore=a.store}return a.translator=new Ze(a.services,s),a.translator.on("*",(o,...u)=>{a.emit(o,...u)}),a.init(s,t),a.translator.options=s,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ae=_e.createInstance();ae.createInstance=_e.createInstance;ae.createInstance;ae.dir;ae.init;ae.loadResources;ae.reloadResources;ae.use;ae.changeLanguage;ae.getFixedT;ae.t;ae.exists;ae.setDefaultNamespace;ae.hasLoadedNamespace;ae.loadNamespaces;ae.loadLanguages;const _n={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"},kn={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},In={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando"},Nn={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:_n,Month:kn,Generic:In},Mn={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"},Fn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},Vn={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command"},Yn={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:Mn,Month:Fn,Generic:Vn};function or(r,e){return new RegExp(Un(r),e)}function Un(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Wn(r,e,t,n){let s=e;const a=Hn(r,t);if(!s){const o=Math.abs(a);o-Math.floor(o)?s="0,0.00":s="0,0"}const i=Bn(s);return new Intl.NumberFormat(n,i).format(a)}function Hn(r,e,t,n,s){let a=r;if(typeof a!="number"){let o;e&&n===void 0?o=",":o=".";const u=o=="."?",":".";a=a.replace(or(u,"g"),""),a=a.replace(or(o,"g"),"."),a=Number(a)}const i=Number(a);return isNaN(i)?NaN:i}function Bn(r){const e={};r.includes(",")?e.useGrouping=!0:e.useGrouping=!1;const t=r.indexOf(".");if(t>-1){const s=(r.substring(t+1).match(/0/g)||[]).length;e.minimumFractionDigits=s,e.maximumFractionDigits=s}else e.minimumFractionDigits=0,e.maximumFractionDigits=0;return e}ae.init({lng:typeof navigator<"u"&&navigator.language.split("-")[0]||"en",fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1,format:(r,e,t,n)=>{const s=(n==null?void 0:n.type)??"number";try{switch(s){case"date":{const a=r instanceof Date?r:new Date(r);return new Intl.DateTimeFormat(t,{dateStyle:e||"short"}).format(a)}default:case"number":{const a=(n==null?void 0:n.inputIsLocalized)??!1;return Wn(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:Yn},it:{translation:Nn}}});const Gn=(r,e,t,n)=>ae.format(r,e,t||ae.language,n),Kn=(r,e)=>ae.t(r,e);function et(){const r=P.useCallback((n,s,a,i)=>Gn(n,s,a||void 0,i),[]),e=P.useCallback(()=>ae.languages[0],[]),t=P.useCallback((n,s)=>Kn(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var St=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r))(St||{}),oe=(r=>(r.MONDAY="Day.Monday",r.MONDAY_SHORT="Day.MondayShort",r.TUESDAY="Day.Tuesday",r.TUESDAY_SHORT="Day.TuesdayShort",r.WEDNESDAY="Day.Wednesday",r.WEDNESDAY_SHORT="Day.WednesdayShort",r.THURSDAY="Day.Thursday",r.THURSDAY_SHORT="Day.ThursdayShort",r.FRIDAY="Day.Friday",r.FRIDAY_SHORT="Day.FridayShort",r.SATURDAY="Day.Saturday",r.SATURDAY_SHORT="Day.SaturdayShort",r.SUNDAY="Day.Sunday",r.SUNDAY_SHORT="Day.SundayShort",r))(oe||{}),ue=(r=>(r.JANUARY="Month.January",r.FEBRUARY="Month.February",r.MARCH="Month.March",r.APRIL="Month.April",r.MAY="Month.May",r.JUNE="Month.June",r.JULY="Month.July",r.AUGUST="Month.August",r.SEPTEMBER="Month.September",r.OCTOBER="Month.October",r.NOVEMBER="Month.November",r.DECEMBER="Month.December",r))(ue||{}),mt=(r=>(r.PREVIOUS_DAY="Date.PreviousDay",r.PREVIOUS_WEEK="Date.PreviousWeek",r.PREVIOUS_MONTH="Date.PreviousMonth",r.PREVIOUS_YEAR="Date.PreviousYear",r.NEXT_DAY="Date.NextDay",r.NEXT_WEEK="Date.NextWeek",r.NEXT_MONTH="Date.NextMonth",r.NEXT_YEAR="Date.NextYear",r.YESTERDAY="Date.Yesterday",r.TODAY="Date.Today",r.TOMORROW="Date.Tomorrow",r))(mt||{});const zn={"smp-datepickercalendar-position":"_smp-datepickercalendar-position_19hwj_1"};function qn({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=et(),i=()=>{if(!n)return;const k=new Date(n);return isNaN(k.getTime())?void 0:k},[o]=P.useState(new Date),[u,c]=P.useState(r||i()||new Date),[f,l]=P.useState(u?u.getMonth():new Date().getMonth()),[p,d]=P.useState(u?u.getFullYear():new Date().getFullYear()),[m,g]=P.useState(u?u.getDate():null),x=P.useRef(null),w=P.useRef([]),E=[a(ue.JANUARY),a(ue.FEBRUARY),a(ue.MARCH),a(ue.APRIL),a(ue.MAY),a(ue.JUNE),a(ue.JULY),a(ue.AUGUST),a(ue.SEPTEMBER),a(ue.OCTOBER),a(ue.NOVEMBER),a(ue.DECEMBER)],O=[{value:a(oe.SUNDAY_SHORT),full:a(oe.SUNDAY)},{value:a(oe.MONDAY_SHORT),full:a(oe.MONDAY)},{value:a(oe.TUESDAY_SHORT),full:a(oe.TUESDAY)},{value:a(oe.WEDNESDAY_SHORT),full:a(oe.WEDNESDAY)},{value:a(oe.THURSDAY_SHORT),full:a(oe.THURSDAY)},{value:a(oe.FRIDAY_SHORT),full:a(oe.FRIDAY)},{value:a(oe.SATURDAY_SHORT),full:a(oe.SATURDAY)}],S=k=>t.some(h=>{const y=h.start.getTime(),T=h.end.getTime(),C=k.getTime();return C>=y&&C<=T}),b=k=>{S(k)||(c(k),g(k.getDate()),e&&e(Yr(k)))},_=()=>{f===0?(l(11),d(p-1)):l(f-1),g(1)},$=()=>{f===11?(l(0),d(p+1)):l(f+1),g(1)},U=(k,h)=>new Date(k,h+1,0).getDate(),D=(k,h)=>new Date(k,h,1).getDay(),A=k=>{var y;const h=B.findIndex(T=>T!==null&&T.getDate()===k);h!==-1&&w.current[h]&&((y=w.current[h])==null||y.focus(),g(k))},j=(k,h)=>{const y=B[h];if(!y)return;const T=U(p,f),C=y.getDate();switch(k.key){case"ArrowRight":k.preventDefault();{let R=C+1,L=new Date(p,f,R);if(R>T){const F=f===11?p+1:p,V=f===11?0:f+1;R=1,L=new Date(F,V,R),$(),setTimeout(()=>{I(1,"forward")},0);return}S(L)?I(R,"forward"):A(R)}break;case"Tab":break;case"ArrowLeft":k.preventDefault();{let R=C-1,L=new Date(p,f,R);if(R<1){const F=f===0?p-1:p,V=f===0?11:f-1,M=U(F,V);R=M,L=new Date(F,V,R),_(),setTimeout(()=>{I(M,"backward")},0);return}S(L)?I(R,"backward"):A(R)}break;case"ArrowUp":k.preventDefault();{let R=C-7,L=new Date(p,f,R);if(R<1){const F=f===0?p-1:p,V=f===0?11:f-1;R=U(F,V)+R,L=new Date(F,V,R),_(),setTimeout(()=>{I(R,"backward")},0);return}S(L)?I(R,"backward"):A(R)}break;case"ArrowDown":k.preventDefault();{let R=C+7,L=new Date(p,f,R);if(R>T){const F=f===11?p+1:p,V=f===11?0:f+1;R=R-T,L=new Date(F,V,R),$(),setTimeout(()=>{I(R,"forward")},0);return}S(L)?I(R,"forward"):A(R)}break;case"Home":k.preventDefault(),I(1,"forward");break;case"End":k.preventDefault(),I(T,"backward");break;case"PageUp":k.preventDefault(),_(),setTimeout(()=>{const R=U(f===0?p-1:p,f===0?11:f-1),L=Math.min(C,R);I(L,"forward")},0);break;case"PageDown":k.preventDefault(),$(),setTimeout(()=>{const R=U(f===11?p+1:p,f===11?0:f+1),L=Math.min(C,R);I(L,"forward")},0);break;case" ":case"Space":if(S(y))return;g(y.getDate()),c(y);break;case"Enter":k.preventDefault(),b(y);break}},I=(k,h)=>{const y=U(p,f);if(h==="forward"){for(let T=k;T<=y;T++){const C=new Date(p,f,T);if(!S(C)){A(T);return}}$(),setTimeout(()=>{I(1,"forward")},0)}else{for(let L=k;L>=1;L--){const F=new Date(p,f,L);if(!S(F)){A(L);return}}const T=f===0?p-1:p,C=f===0?11:f-1,R=U(T,C);_(),setTimeout(()=>{I(R,"backward")},0)}},B=(()=>{const k=U(p,f),h=D(p,f),y=[];for(let T=0;T<h;T++)y.push(null);for(let T=1;T<=k;T++){const C=new Date(p,f,T);y.push(C)}return y})(),q=[];let z=[];B.forEach((k,h)=>{if(z.push(k),z.length===7||h===B.length-1){for(;z.length<7;)z.push(null);q.push(z),z=[]}}),P.useEffect(()=>{var k;if(m!==null){const h=B.findIndex(y=>y!==null&&y.getDate()===m);h!==-1&&w.current[h]&&((k=w.current[h])==null||k.focus())}},[f,p,m,B]);const X={label:"smp-datepickercalendar-label",wrapper:`smp-datepickercalendar ${zn["smp-datepickercalendar-position"]}`,calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(k,h,y,T)=>`smp-datepickercalendar-td
|
|
46
46
|
${k?"smp-datepickercalendar-td-today":""}
|
|
47
47
|
${h?"smp-datepickercalendar-td-selected":""}
|
|
48
48
|
${y?"smp-datepickercalendar-td-focused":""}
|
|
49
|
-
${T?"smp-datepickercalendar-td-disabled":""}`},H=()=>`${E[u]} ${d.toString()}`;return v.jsxs("div",{className:X.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[v.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[v.jsx(xe,{onClick:_,ariaLabel:a(mt.PREVIOUS_MONTH),optionalDisplayValue:"<",appearance:"ghost",variant:"base",bindValue:"<"}),v.jsx("div",{"aria-label":H(),className:X.label,children:H()}),v.jsx(xe,{onClick:$,ariaLabel:a(mt.NEXT_MONTH),bindValue:">",optionalDisplayValue:">",appearance:"ghost",variant:"base"})]}),v.jsxs("table",{ref:x,role:"grid","aria-label":`${a(St.CALENDAR_FOR)} ${E[u]} ${d}`,className:X.table,children:[v.jsx("thead",{children:v.jsx("tr",{children:O.map(k=>v.jsx("th",{scope:"col",abbr:k.full,className:X.th,children:k.value},k.value))})}),v.jsx("tbody",{children:q.map((k,h)=>v.jsx("tr",{children:k.map((y,T)=>{const C=h*7+T;if(y===null)return v.jsx("td",{className:X.td(!1,!1,!1,!0)},`empty-${T}`);const R=y.getDate()===o.getDate()&&y.getMonth()===o.getMonth()&&y.getFullYear()===o.getFullYear(),L=f&&y.getDate()===f.getDate()&&y.getMonth()===f.getMonth()&&y.getFullYear()===f.getFullYear(),F=m===y.getDate(),V=S(y);return v.jsx("td",{role:"gridcell","aria-selected":L,tabIndex:F?0:-1,onClick:()=>b(y),onKeyDown:M=>D(M,C),"aria-label":`${y.getDate()} ${E[y.getMonth()]} ${y.getFullYear()}`,"data-selected":L,"aria-disabled":V,ref:M=>{w.current[C]=M},className:X.td(R,L,F,V),children:y.getDate()},`day-${T}`)})},`week-${h}`))})]})]})}const Or=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,isEditable:s=!0,...a})=>{const[i,o]=P.useState(!1),[f,c]=P.useState(r||""),[u,l]=P.useState(""),{anchorRef:d,targetRef:p}=yt({position:"bottom",enabled:i});Ke(p,()=>{o(!1)}),Ke(d,()=>{if(typeof d=="object"&&d!==null&&"current"in d){const $=d.current.querySelector("input");$&&$===document.activeElement&&E()}}),Sr(i,p);const{format:m,getCurrentLanguage:g}=et(),x=P.useCallback($=>{const U=$.length>5&&Mr($,g())||$,j=m(U,void 0,void 0,{type:"date"}),A=typeof U!="string",D=A&&U.toISOString().substring(0,10)||"";return{isValid:A,formattedDate:j,isoDate:D,normalizedDate:U}},[g,m]);P.useEffect(()=>{const{formattedDate:$,isoDate:U,isValid:j}=x(r);c(j&&U||r),l(j&&$||r)},[r,m,x]);const w=()=>o($=>!$),E=()=>{S(u)},O=$=>{S($),o(!1)},S=$=>{const{isoDate:U,isValid:j}=x($);t&&t(j&&U||$)},b=$=>{l($)},_=$=>{$.key==="Enter"&&($.preventDefault(),S(u))};return v.jsxs("div",{"data-component":"date-picker",children:[v.jsx(we,{bindValue:u,placeholder:e,onBlur:E,onChange:b,onKeyDown:_,shapeIcon:"calendar",onShapeIconClick:w,ref:d,isEditable:s,...a}),i&&v.jsx(Kn,{disabledDateRanges:n,onDateChange:O,initialValue:gt(f)&&f||"",targetRef:p})]})},zn=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,isEditable:s=!0,placeholder:a,label:i,disabled:o,fun:f,onOptionsRequest:c,onChange:u})=>{const l=r.map(m=>m.bindValue),d=(m,g)=>{const x=[...r];if(m=="")x.pop();else{const w=x.findIndex(E=>E.bindValue===m&&E.optionalDisplayValue===g);w>=0?x.splice(w,1):x.push({bindValue:m,optionalDisplayValue:g})}u==null||u(x)},p={container:"smp-multipleAutocomplete-container"};return v.jsxs("div",{className:p.container,"data-component":"multiple-autocomplete",children:[i&&v.jsx(je,{label:i,disabled:o}),v.jsx(xt,{elements:r,displayMode:e,isEditable:s,onChange:m=>{u==null||u(m)}}),v.jsx(bt,{bindValue:"",fun:f,isEditable:s,onChange:d,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:a,onOptionsRequest:c,_multiActiveIndex:l})]})},Rr=({...r})=>{const[e,t]=P.useState(!1),n=e?"visibility-off":"visibility";return v.jsx(we,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},qn=({...r})=>{const[e,t]=P.useState(r.bindValue),{translate:n}=et(),s=a=>{var i;a.key==="Enter"&&(a.preventDefault(),(i=r.onEnter)==null||i.call(r,e))};return v.jsx(we,{...r,placeholder:r.placeholder?r.placeholder:n(St.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})},Jn=({bindValue:r,optionalDisplayValue:e,label:t})=>{const n={wrapper:"smp-text-wrapper"};return t?v.jsxs("div",{className:n.wrapper,children:[v.jsx(je,{label:t}),v.jsx(Ae,{variant:"body",bindValue:e||r})]}):v.jsx(Ae,{variant:"body",bindValue:e||r})};class Se{constructor(e,t){ve(this,"class");ve(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Se(e,e.k.split(";"))}static fromString(e){return new Se({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const We=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t??r.decode,shape:r.shape,fun:r.fun}),lr=r=>{const e=Se.fromDataObj(r.obj),t=r.decode?Se.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},Xn=(r,e)=>{const t=new Se(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new Se(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return We(r,t,n)},Zn=({disabled:r,bindValue:e,onChange:t,placeholder:n,state:s,appearance:a,isEditable:i,label:o,ariaLabel:f,helperText:c,error:u,onBlur:l,onKeyDown:d})=>{const p=P.useId(),m=`${p}-helper`,g=u?"danger":s,x=c||!!u,w=O=>{t==null||t(O.target.value)},E={wrapper:"smp-textarea-wrapper",container:`smp-textarea ${r?"smp-textarea-disabled":""} ${n?"smp-textarea-placeholder":""} ${g?`smp-textarea-${g}`:""} ${a?`smp-textarea-${a}`:""} ${i?"":"smp-textarea-readOnly"}`};return v.jsxs("div",{className:E.wrapper,"data-component":"textarea",children:[o&&v.jsx(je,{htmlFor:p,label:o,disabled:r}),v.jsx("textarea",{id:p,value:e,placeholder:n,onChange:w,onBlur:l,className:E.container,disabled:r,readOnly:!i,onKeyDown:d,"aria-label":o?void 0:f,"aria-labelledby":o?p:void 0,"aria-describedby":x?m:void 0}),x&&v.jsx(fr,{id:m,helperText:u,disabled:r,state:g})]})},wt=({decode:r,shape:e,obj:t,data:n,icon:s,fun:a,placeholderIcon:i,label:o,options:f,onChange:c,onClick:u,onEnter:l,onBlur:d,onOptionsRequest:p,isEditable:m})=>{const g={obj:t,shape:e,decode:r,icon:s,fun:a},x={onBlur:d,onOptionsRequest:p,fun:a,icon:s,label:o,isEditable:m,...n},w=(S,b,_)=>Ir(t)?We(S,new Ge(t,b).getLegacyValue()):We(S,b,_),E=S=>We(g,new Be(t,S).getLegacyValue()),O=S=>Xn(g,S);switch(e){case ne.AUTOCOMPLETE:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(b,_)=>{c==null||c(w(g,b,_))}};return v.jsx(bt,{...S})}case ne.BUTTON:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onClick:()=>{u==null||u(w(g,t.k))}};return v.jsx(xe,{...S})}case ne.BUTTON_LIST:{const S={...x,options:f,onClick:(b,_)=>{const $={...g,fun:_};u==null||u(w($,b))}};return v.jsx(br,{...S})}case ne.COMBOBOX:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(b,_)=>{c==null||c(w(g,b,_))}};return v.jsx(wr,{...S})}case ne.SWITCH:case ne.CHECKBOX:{const S={...x,bindValue:Be.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:b=>{c==null||c(E(b))}};return v.jsx(xr,{...S})}case ne.CHIP:{const S={...x,elements:lr(g)};return v.jsx(xt,{...S})}case ne.DATE:{const S={...x,bindValue:Ge.fromDataObj(t).getValue(),onChange:b=>{c==null||c(w(g,b))}};return v.jsx(Or,{...S})}case ne.ICON:case ne.IMAGE:{const S={...x,icon:s,placeholderIcon:i,isInteractable:!!x.fun,onClick:()=>{u==null||u(w(g,t.k))}};return v.jsx(le,{...S})}case ne.MULTI_AUTOCOMPLETE:{const S={...x,elements:lr(g),onChange:b=>{c==null||c(O(b))}};return v.jsx(zn,{...S})}case ne.MEMO:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:b=>{c==null||c(w(g,b))}};return v.jsx(Zn,{...S})}case ne.PASSWORD:{const S={...x,bindValue:t.k,onChange:b=>{c==null||c(w(g,b))}};return v.jsx(Rr,{...S})}case ne.SPOTLIGHT:{const S={...x,bindValue:t.k,onEnter:b=>{l==null||l(w(g,b))}};return v.jsx(qn,{...S})}case ne.TEXT_FIELD:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:b=>{c==null||c(w(g,b))}};return v.jsx(we,{...S})}default:{const S={...x,bindValue:t.k,optionalDisplayValue:r};return v.jsx(Jn,{...S})}}},Qn=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},jr=(r,e)=>r.map(t=>{var a,i;if((a=t.sections)!=null&&a.length)return{...t,sections:jr(t.sections,e),content:t.content};let n=t.sections,s=t.content;return(i=t.content)!=null&&i.length&&t.columns&&+t.columns>1&&(n=Qn(t.content.filter(f=>!!e[f.id]),+t.columns).map((f,c)=>({...t,id:`${t.id}-${c}`,content:f,gridCols:t.columns,horizontal:!0})),s=[]),{...t,sections:n,content:s}}),cr=(r,e)=>{if(!e)return{};const t=r.some(n=>n.dim)?r.map(n=>n.dim||"auto").join(" "):`repeat(${r.length}, 1fr)`;return{[e]:t}},ur=r=>r.some(e=>e.dim&&!e.dim.endsWith("%")),de={"smp-layout":"_smp-layout_xrjwg_1","smp-layout-horizontal":"_smp-layout-horizontal_xrjwg_9","smp-layout-vertical":"_smp-layout-vertical_xrjwg_13","smp-layout-section-grid":"_smp-layout-section-grid_xrjwg_18","smp-layout-section-vertical":"_smp-layout-section-vertical_xrjwg_20","smp-layout-section-horizontal":"_smp-layout-section-horizontal_xrjwg_24","smp-layout-section-flex":"_smp-layout-section-flex_xrjwg_29","smp-layout-cell-container":"_smp-layout-cell-container_xrjwg_34","smp-grid-template-cols":"_smp-grid-template-cols_xrjwg_44","smp-grid-template-rows":"_smp-grid-template-rows_xrjwg_48","smp-layout-section-with-title":"_smp-layout-section-with-title_xrjwg_52","smp-layout-section-title":"_smp-layout-section-title_xrjwg_58"},Et=({cells:r,layout:e={horizontal:!1,sections:[{id:"1",content:Object.keys(r).map(t=>({id:t}))}]}})=>{const t="--smp-grid-template-cols",n="--smp-grid-template-rows",s=jr(e.sections||[],r),a=l=>l==null?void 0:l.reduce((d,p)=>{var E,O;let m="",g={},x={},w="";return(E=p.sections)!=null&&E.length?(m=de["smp-layout-section-grid"],g=a(p.sections),p.gridCols==null&&(w=`${de[p.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"]}`,(p.horizontal||ur(p.sections))&&(x=cr(p.sections,p.horizontal?t:n)))):(O=p.content)!=null&&O.length&&(p.gridCols!==void 0&&p.gridCols>0?(m=de["smp-layout-section-grid"],w=`${de["smp-grid-template-cols"]}`,x={[t]:`repeat(${p.gridCols}, 1fr)`}):m=de["smp-layout-section-flex"]),{...d,...g,[p.id]:{classes:`${m} ${de[p.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${w} ${p.justify?`smp-justifyContent-${p.justify}`:""} ${p.align?`smp-alignItems-${p.align}`:""}`,styles:x}}},{}),i=a(s),o={container:`${de["smp-layout"]} ${e.horizontal?de["smp-layout-horizontal"]:de["smp-layout-vertical"]}`,sections:i},f=e.horizontal||ur(e.sections||[])?cr(s,e.horizontal?t:n):{},c=l=>{var p;const d=v.jsx("div",{"smp-id":"section-"+l.id,className:o.sections[l.id].classes,style:o.sections[l.id].styles,children:(p=l.sections)!=null&&p.length?l.sections.map(m=>c(m)):l.content.map(m=>u(m,r[m.id],l.justify,l.align))},"section-"+l.id);return l.title?v.jsxs("div",{className:`${de["smp-layout-section-with-title"]}`,children:[v.jsx("span",{className:`${de["smp-layout-section-title"]} ${l.justify?`smp-justifyContent-${l.justify}`:""} ${l.align?`smp-alignItems-${l.align}`:""}`,children:v.jsx(je,{label:l.title})}),d]}):d},u=(l,d,p,m)=>{const g=l.colSpan!==void 0?l.colSpan>0?l.colSpan:l.colStart!==void 0&&l.colStart<1?1:null:null,x=g!==null?`span ${g}`:l.colStart,w=l.colEnd!==void 0&&l.colEnd>0?l.colEnd:"",E={gridColumnStart:x,gridColumnEnd:w},O=`${de["smp-layout-cell-container"]} ${p?`smp-justifyContent-${p}`:""} ${m?`smp-alignItems-${m}`:""}`;return d?v.jsx("div",{className:O,style:{...E},"smp-id":l.id,children:v.jsx(wt,{...d})},l.id):v.jsx(v.Fragment,{})};return v.jsx("div",{className:o.container,style:f,"smp-id":"layout",children:s==null?void 0:s.map(l=>c(l))})},es=({data:r,onClick:e,onEnter:t})=>{var i,o;const[n,s]=P.useState(),a=P.useCallback(f=>{var u,l;if(!((u=f.rows)!=null&&u.length)||!((l=f.columns)!=null&&l.length))return{};const c=f.rows[0];return f.columns.filter(d=>d.visible).reduce((d,p)=>{const m=c.cells[p.name],g={...m,onChange:x=>{s(w=>w&&{...w,[p.name]:{...w[p.name],obj:{...w[p.name].obj,k:x.obj.k}}})},onClick:()=>{m.fun&&e&&e({...m})},onEnter:x=>{t&&t(x)}};return{...d,[p.name]:g}},{})},[e,t]);return P.useEffect(()=>{r&&s(a(r))},[r,a]),!((i=r==null?void 0:r.rows)!=null&&i.length)||!((o=r.columns)!=null&&o.length)?null:n&&v.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:v.jsx(Et,{layout:r.rows[0].layout,cells:n})})},ts=r=>{var e;return(e=r.children)!=null&&e.length?r.children.map(t=>{var n,s;return{id:((n=t.obj)==null?void 0:n.k)??"",label:t.decode??t.value??((s=t.obj)==null?void 0:s.k)??"",fun:t.fun,icon:t.icon}}):[]},ce=r=>r==null?!1:typeof r=="string"?r.toLocaleLowerCase()=="yes":r,rs=({data:r,logo:e,open:t,minifiedOnClose:n=!0,customHeight:s="100vh",onClick:a,onEnter:i,onClose:o,loadOptions:f})=>{var O,S;const[c,u]=P.useState(),[l,d]=P.useState(t??!0),p=P.useRef(null),m=s.trim()?s:"100vh",g=P.useCallback(b=>{var $,U;if(!(($=b==null?void 0:b.rows)!=null&&$.length)||!((U=b==null?void 0:b.columns)!=null&&U.length))return{};const _=b.rows[0];return b.columns.filter(j=>j.visible??!0).reduce((j,A)=>{const D=_.cells[A.name];if(!D||!l&&ce(n)&&D.shape!==ne.BUTTON&&D.shape!==ne.BUTTON_LIST)return j;const I={...D,onChange:W=>{u(B=>{const q={...B};return q!=null&&q[A.name]&&(q[A.name].obj.k=W.obj.k),q})},onClick:W=>{W.fun&&a&&a(W)},onEnter:W=>{i&&i(W)}};return f&&D.shape==ne.BUTTON_LIST&&(I.onOptionsRequest=(W,B)=>f(W,B).then(q=>ts(q))),!l&&ce(n)&&(I.data={...I.data,showText:!1,justify:"center"}),{...j,[A.name]:I}},{})},[l,n,a,i,f]),x=P.useCallback(()=>{o==null||o()},[o]),w=()=>{ce(n)?d(b=>!b):(d(!1),o==null||o())};if(P.useEffect(()=>{u(g(r))},[r]),P.useEffect(()=>{if(!p.current)return;if(!ce(n)){u(g(r));return}const b=getComputedStyle(p.current).getPropertyValue("--smp-drawer-slide-transition");let _=Number(b);b.endsWith("ms")?_=parseFloat(b):b.endsWith("s")&&(_=parseFloat(b)*1e3),setTimeout(()=>{u(g(r))},_/2)},[l,n]),P.useEffect(()=>{t!==void 0&&!ce(n)&&d(t)},[n,t]),!((O=r==null?void 0:r.rows)!=null&&O.length)||!((S=r.columns)!=null&&S.length))return null;const E={drawer:`smp-drawer ${ce(n)?"smp-drawer-minified":"smp-drawer-fixed"} ${l?"smp-drawer-open":""} ${!ce(n)&&!l?"smp-drawer-no-border":""}`,container:"smp-drawer-container",containerHeader:"smp-drawer-container-header",containerIcon:`${l?"":"smp-drawer-container-icon-close"} smp-drawer-container-icon`,containerLayout:"smp-drawer-container-layout",containerLogo:"smp-drawer-container-logo",backdrop:`smp-drawer-backdrop ${l?"smp-drawer-backdrop-open":""}`};return c&&v.jsxs(v.Fragment,{children:[!ce(n)&&v.jsx("div",{"aria-hidden":"true","aria-label":"drawer-backdrop",className:E.backdrop,onClick:x}),v.jsx("aside",{ref:p,className:E.drawer,style:{height:m},"aria-label":"Drawer","smp-id":"drawer",children:v.jsxs("div",{className:E.container,children:[v.jsxs("div",{className:E.containerHeader,children:[e&&v.jsx("div",{className:E.containerLogo,children:v.jsx(le,{icon:e,title:"drawer_logo",width:"100%",height:24})}),v.jsx("div",{className:E.containerIcon,children:v.jsx(le,{icon:ce(n)?"menu_close":"close",title:"drawer_icon",rotated:!l,isInteractable:!0,onClick:w,width:20,height:20})})]}),v.jsx("div",{className:E.containerLayout,children:v.jsx(Et,{layout:r.rows[0].layout,cells:c})})]})})]})},ns=({ColumnsNumber:r=1,data:e={},ForceText:t,TextColName:n,TextColor:s="var(--smp-dashList-color-base)",Fillspace:a,FontSize:i,Horizontal:o,ForceIcon:f,IconColName:c,IconColor:u="var(--smp-dashList-color-base)",NumberFormat:l,ForceUM:d,UmColName:p,UmColor:m="var(--smp-dashList-color-base)",ForceValue:g,ValueColName:x,ValueColor:w="var(--smp-dashList-color-base)",SelectLayout:E="1",onClick:O})=>{const S="N/A",b=(e==null?void 0:e.columns)||[],_=(e==null?void 0:e.rows)||[],$=_.length>0,U="--smp-dashList-color",j="smp-layout",A="descr",D="icon",I="um",W="value",B=i||"1em",q="18px",z="--smp-dashList-columns",X="--smp-dashList-fontSize",H={dash:(Y="1")=>{const Z=h(Y),te=Z,re=y(Z,A),fe=y(Z,D),ge=y(Z,I),pe=y(Z,W);return{container:te,descr:re,icon:fe,um:ge,value:pe}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
|
|
50
|
-
${ce(o)?"smp-dash-list-horizontal":""}`},{format:k}=et(),h=Y=>`${j}-${Y}`,y=(Y,Z)=>`${Y}__${Z}`,T=Y=>`${U}-${Y}`,C=Y=>{const Z=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(Z.test(Y)){const re=Y.match(Z)||[];if((re==null?void 0:re.length)>3)return"rgb("+re[1]+","+re[2]+","+re[3]+")"}return Y},R=Y=>{if(!l)return Y;const[Z,te]=L(l).map(Ee=>parseInt(Ee||"0")),re="0,0"+(te?"."+"0".repeat(te):""),fe=k(Y,re,"it");if(!Z)return fe;const[ge,pe]=fe.split(",");return ge+(pe?`,${pe}`:"")},L=Y=>Y.includes(";")?Y.split(";"):[Y],F=Y=>{const Z=re=>{var fe;if(re)return(fe=Y==null?void 0:Y.cells[re])==null?void 0:fe.obj.k},te=re=>{var fe,ge;if(!(b.length<=re))return(ge=(fe=Y==null?void 0:Y.cells[b[re].name])==null?void 0:fe.obj)==null?void 0:ge.k};return{descr:t||Z(n)||te(2)||"",icon:f||Z(c)||te(3)||"",um:d||Z(p)||te(1)||"",value:g||Z(x)||te(0)||""}},V=Y=>{O==null||O(Y)},M=(Y,Z)=>{(Y.key==="Enter"||Y.key===" ")&&(Y.preventDefault(),Y.stopPropagation(),V(Z))},G=(Y=>{const Z=H.dash(Y);return{className:Z,descr:te=>v.jsx("div",{className:Z.descr,children:te},`${Y}-${A}`),icon:te=>v.jsx("div",{className:Z.icon,children:v.jsx(le,{color:u,height:q,icon:te,width:q})},`${Y}-${D}`),um:te=>v.jsx("div",{className:Z.um,children:te},`${Y}-${I}`),value:te=>v.jsx("div",{className:Z.value,children:te},`${Y}-${W}`)}})(E),se=Y=>{const{descr:Z,icon:te,um:re,value:fe}=F(Y),ge={[T(A)]:C(s),[T(I)]:C(m),[T(W)]:C(w)},pe=[],Ee=R(fe);switch(E){case"2":te&&pe.push(G.icon(te)),pe.push(G.descr(Z)),pe.push(G.value(re?Ee+" "+re:Ee));break;default:case"1":pe.push(G.descr(Z)),pe.push(G.value(re?Ee+" "+re:Ee))}return v.jsx("div",{className:G.className.container,role:"button",style:ge,tabIndex:0,onClick:()=>V(Y),onKeyDown:Cr=>M(Cr,Y),children:pe},Y.rowId)},N={[z]:String(r),[X]:B};return v.jsx("div",{className:H.dashList,style:N,children:$?_.map(Y=>se(Y)):S})},ut={"smp-table":"_smp-table_8dmh0_1","smp-headerCell":"_smp-headerCell_8dmh0_35","smp-resizer":"_smp-resizer_8dmh0_44"},ss="_rowContent_gazwe_13",as="_clickable_gazwe_42",is="_indent_gazwe_47",os="_toggle_gazwe_53",ls="_rowLabel_gazwe_69",cs="_cell_gazwe_78",us="_leftSection_gazwe_86",be={rowContent:ss,clickable:as,indent:is,toggle:os,rowLabel:ls,cell:cs,leftSection:us};function He(r){return!!r&&"children"in r}function fs(r){return!He(r)}function ds(r){return JSON.stringify(r).split("").reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0).toString()}const Dr=({row:r,columnWidths:e={},level:t=0,rowHeight:n=26,offsetTop:s})=>{var E;const[a,i]=P.useState(!1),o=He(r)&&!!((E=r.children)!=null&&E.length),f=r.cells&&Object.keys(r.cells).length>0,c=o,u=t*20,l=()=>{o&&i(!a)},d={content:`${be.rowContent} ${o?be.clickable:""}`,toggle:`${be.toggle}`,indent:`${be.indent}`,cell:`${be.cell}`},p=O=>v.jsx(wt,{...O}),m=()=>v.jsx("span",{className:d.toggle,children:c?a?"▶":"▼":" "}),g=()=>v.jsx("span",{className:d.indent,style:{width:`${u}px`},"aria-hidden":"true"}),x=()=>{const O=fs(r)?"":r.decode||(f?"":"Untitled"),S=s??n*t;return v.jsxs("tr",{className:d.content,onClick:l,role:o?"button":"row","aria-expanded":o?!a:void 0,style:{height:`${n}px`,lineHeight:`calc(${n}px - 2*2px)`,transform:`translateY(${S}px)`},children:[He(r)&&v.jsxs("td",{className:be.leftSection,style:{height:`${n}px`},children:[g(),m(),v.jsx("span",{className:be.rowLabel,children:O})]}),r.cells&&Object.keys(r.cells).length>0&&Object.entries(r.cells).map(([b,_])=>v.jsx("td",{className:d.cell,style:{width:e[b],minWidth:e[b],height:`${n}px`},children:p(_)},ds(_)||b))]})},w=()=>{var O;return a||!o?null:v.jsx(v.Fragment,{children:He(r)&&((O=r.children)==null?void 0:O.map((S,b)=>v.jsx(Dr,{row:S,level:t+1},`child-${b}`)))})};return v.jsxs(v.Fragment,{children:[x(),w()]})},ps=({label:r,rowHeight:e=28,offsetTop:t=0,level:n=0,onClick:s,isExpanded:a})=>{const i={tr:"smp-groupRow-tr",td:"smp-groupRow-td"};return v.jsx("tr",{className:i.tr,style:{height:e,top:t,lineHeight:`${e}px`},onClick:s,children:v.jsxs("td",{className:i.td,style:{paddingLeft:10+n*20},children:[v.jsx(le,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),v.jsx(Ae,{variant:"title",bindValue:r})]})})};function hs(r,e){const t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t}function ms(r,e){return r.map(t=>{const n=e.find(s=>s.column===t.bindValue);return{column:t.bindValue,visible:(n==null?void 0:n.visible)??!0}})}function gs(r,e,t,n){const s=[];let a=0;return i(r,0,[]),{flatRows:s,offset:a};function i(l,d,p){if(d>=e.length){u(l);return}const m=e[d].column,g=o(l,m);for(const[x,w]of g){const E=[...p,x],O=f(E,d),S=n.has(O);s.push(c(x,O,d,S)),a+=t,S&&i(w,d+1,E)}}function o(l,d){var m;const p=new Map;for(const g of l){const x=((m=g.cells[d])==null?void 0:m.decode)??"N/D";p.has(x)||p.set(x,[]),p.get(x).push(g)}return p}function f(l,d){return`group-${l.join("-")}-${d}`}function c(l,d,p,m){return{isGroup:!0,value:l,cells:{},rowId:d,level:p,isExpanded:m}}function u(l){for(const d of l)s.push(d),a+=t}}const ys=({groups:r=[],isDraggable:e=!0,isEditable:t=!0,onChange:n,onDrop:s,onDragOver:a})=>{const i=r.map(o=>({bindValue:o.column}));return v.jsxs("div",{className:"smp-groupBar-container",onDragOver:a,onDrop:s,children:[v.jsx(le,{icon:"groups"}),v.jsx(xt,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:n})]})},vs=({data:r,lineHeight:e=28,TableHeight:t=400,groups:n,columnSizingMode:s="fixed",showGroupBar:a=!0})=>{var U;const[i,o]=P.useState(r),[f,c]=P.useState(n||[]),[u,l]=P.useState(new Set),d=i&&i.columns?Object.fromEntries(i.columns.map(j=>[j.name,120])):{},[p,m]=P.useState(d),g=P.useRef(null);P.useEffect(()=>{var D;if(!i||!i.columns||i.columns.length)return;const j=((D=g.current)==null?void 0:D.clientWidth)??1e3;let A={};switch(s){case"fixed":A=Object.fromEntries(i.columns.map(I=>[I.name,120]));break;case"fit-grid":{const I=i.columns.filter(B=>B.visible),W=Math.floor(j/I.length);A=Object.fromEntries(I.map(B=>[B.name,W]));break}case"fit-content":A=Object.fromEntries(i.columns.map(I=>{const W=Math.max(...r.rows.map(H=>{var y;const k=(y=H==null?void 0:H.cells)==null?void 0:y[I.name],h=(k==null?void 0:k.decode)||(k==null?void 0:k.value);return h?String(h).length:0}),0),B=I.title?I.title.length:0,q=Math.max(W,B);return[I.name,Math.max(50,q*8+16)]}));break}m(A)},[s,r,i]),P.useEffect(()=>{if(f!=null&&f.length&&r.rows){const{flatRows:j}=gs(r.rows,f,e,u);o({...r,rows:j})}else o(r)},[r,f,u,e]);const x=j=>{c(ms(j,f))},w=j=>{j.preventDefault();const A=j.dataTransfer.getData("text/plain");if(!A||f.some(W=>W.column===A))return;const I=[...f,{column:A,visible:!0}];c(I)},E=j=>{j.preventDefault()},{virtualItems:O,containerProps:S,innerProps:b}=gr({items:(i==null?void 0:i.rows)||[],itemHeight:e,containerHeight:t,overscan:5}),_=(j,A)=>{const D=j.clientX,I=p[A],W=q=>{const z=q.clientX-D,X=Math.max(50,I+z);m(H=>({...H,[A]:X}))},B=()=>{window.removeEventListener("mousemove",W),window.removeEventListener("mouseup",B)};window.addEventListener("mousemove",W),window.addEventListener("mouseup",B)},$={smpTable:`${ut["smp-table"]}`,headerCell:`${ut["smp-headerCell"]}`,resizer:`${ut["smp-resizer"]}`};return i&&v.jsx("div",{className:$.smpTable,...S,ref:g,children:v.jsxs("table",{children:[v.jsxs("thead",{children:[(n||a)&&v.jsx(ys,{groups:f,onChange:x,onDrop:w,onDragOver:E}),v.jsx("tr",{children:i.columns&&((U=i.columns)==null?void 0:U.map(j=>j.visible&&v.jsxs("th",{className:$.headerCell,draggable:!0,onDragStart:A=>{A.dataTransfer.setData("text/plain",j.name)},style:{width:p[j.name],minWidth:p[j.name],maxWidth:p[j.name]},children:[v.jsx(Ae,{variant:"title",bindValue:j.title}),v.jsx("div",{className:$.resizer,onMouseDown:A=>_(A,j.name),role:"region"})]},j.name)))})]}),v.jsx("tbody",{...b,children:O.map(({item:j,index:A,offsetTop:D})=>j.isGroup?v.jsx(ps,{label:j.value||"",rowHeight:e,offsetTop:D,level:j.level,onClick:()=>{const I=j.rowId;I&&l(W=>hs(W,I))},isExpanded:j.isExpanded},j.rowId||`group-${A}`):v.jsx(Dr,{row:j,columnWidths:p,rowHeight:e,offsetTop:D,isGroup:!1},j.rowId||`row-${A}`))}),v.jsx("tfoot",{children:v.jsx("span",{children:"Tfooter here"})})]})})},bs=({data:r,Type:e,ShowSubmit:t=!1,SubmitPosition:n="Right",DefaultValue:s,Label:a,LabelPosition:i="Left",onBlur:o,onClick:f,onOptionsRequest:c})=>{const[u,l]=P.useState();P.useEffect(()=>{l(()=>{if(!r)return;const g={...r};return e&&(g.shape=e),g.shape==null&&(g.shape=ne.TEXT_FIELD),s&&(g.obj=Nr(s)),g})},[r,s,e]);const p={container:`smp-field-container ${ce(t)?`smp-field-position-${n}`:""}`},m=()=>{ce(t)||o==null||o(u)};if(u)return v.jsxs("div",{className:p.container,children:[v.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:v.jsx(wt,{...u,onChange:l,onOptionsRequest:c,fun:r==null?void 0:r.fun,onBlur:m,label:a,labelPosition:i})}),ce(t)&&v.jsx(xe,{optionalDisplayValue:"Confirm",onClick:()=>f==null?void 0:f(u),bindValue:"Confirm"})]})},xs=({data:r,readOnly:e=!1,hiddenSubmitButton:t=!1,optionsHandler:n,onSubmit:s})=>{const[a,i]=P.useState({});P.useEffect(()=>{i(f(r))},[r]);const o=()=>{const u=c();s({value:u})},f=u=>{var d,p,m;if(!((d=u.rows)!=null&&d.length)||!((p=u.columns)!=null&&p.length))return{};const l=(m=u.rows)==null?void 0:m[0];return u.columns.filter(g=>g.visible??!0).reduce((g,x)=>{const w={...l.cells[x.name],label:x.title,onChange:E=>{i(O=>({...O,[x.name]:{...O[x.name],obj:{...O[x.name].obj,k:E.obj.k},decode:E.decode}}))}};return w.fun&&(w.shape==ne.AUTOCOMPLETE||w.shape==ne.MULTI_AUTOCOMPLETE||w.shape==ne.COMBOBOX)&&(w.onOptionsRequest=(E,O)=>n(E,O,r,x.name)),w.isEditable==null&&(w.isEditable=!0),e&&(w.isEditable=!1),w.isEditable&&w.shape==null&&(w.shape=ne.TEXT_FIELD),{...g,[x.name]:w}},{})},c=()=>{const u={columns:[...r.columns],rows:[{cells:{}}]};return Object.entries(a).forEach(([l,d])=>{u.rows[0].cells[l]={obj:{...d.obj},decode:d.decode,shape:d.shape}}),{before:r,after:u}};return a&&v.jsxs("div",{"data-component":"input-panel",style:{display:"flex",flexDirection:"column",gap:"2rem",padding:"2rem"},children:[v.jsx(Et,{layout:r.rows[0].layout,cells:a}),!t&&v.jsx(xe,{onClick:o,bindValue:"submit",optionalDisplayValue:"Submit"})]})};exports.AppBar=es;exports.Autocomplete=bt;exports.Button=xe;exports.ButtonList=br;exports.Checkbox=xr;exports.Combobox=wr;exports.DashList=ns;exports.DataTableComponent=vs;exports.DatePicker=Or;exports.Drawer=rs;exports.Field=bs;exports.Icon=le;exports.InputPanel=xs;exports.Password=Rr;exports.Textfield=we;exports.configurePaths=un;
|
|
49
|
+
${T?"smp-datepickercalendar-td-disabled":""}`},H=()=>`${E[f]} ${p.toString()}`;return v.jsxs("div",{className:X.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[v.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[v.jsx(xe,{onClick:_,ariaLabel:a(mt.PREVIOUS_MONTH),optionalDisplayValue:"<",appearance:"ghost",variant:"base",bindValue:"<"}),v.jsx("div",{"aria-label":H(),className:X.label,children:H()}),v.jsx(xe,{onClick:$,ariaLabel:a(mt.NEXT_MONTH),bindValue:">",optionalDisplayValue:">",appearance:"ghost",variant:"base"})]}),v.jsxs("table",{ref:x,role:"grid","aria-label":`${a(St.CALENDAR_FOR)} ${E[f]} ${p}`,className:X.table,children:[v.jsx("thead",{children:v.jsx("tr",{children:O.map(k=>v.jsx("th",{scope:"col",abbr:k.full,className:X.th,children:k.value},k.value))})}),v.jsx("tbody",{children:q.map((k,h)=>v.jsx("tr",{children:k.map((y,T)=>{const C=h*7+T;if(y===null)return v.jsx("td",{className:X.td(!1,!1,!1,!0)},`empty-${T}`);const R=y.getDate()===o.getDate()&&y.getMonth()===o.getMonth()&&y.getFullYear()===o.getFullYear(),L=u&&y.getDate()===u.getDate()&&y.getMonth()===u.getMonth()&&y.getFullYear()===u.getFullYear(),F=m===y.getDate(),V=S(y);return v.jsx("td",{role:"gridcell","aria-selected":L,tabIndex:F?0:-1,onClick:()=>b(y),onKeyDown:M=>j(M,C),"aria-label":`${y.getDate()} ${E[y.getMonth()]} ${y.getFullYear()}`,"data-selected":L,"aria-disabled":V,ref:M=>{w.current[C]=M},className:X.td(R,L,F,V),children:y.getDate()},`day-${T}`)})},`week-${h}`))})]})]})}const Or=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,isEditable:s=!0,...a})=>{const[i,o]=P.useState(!1),[u,c]=P.useState(r||""),[f,l]=P.useState(""),{anchorRef:p,targetRef:d}=yt({position:"bottom",enabled:i});Ke(d,()=>{o(!1)}),Ke(p,()=>{if(typeof p=="object"&&p!==null&&"current"in p){const $=p.current.querySelector("input");$&&$===document.activeElement&&E()}}),Sr(i,d);const{format:m,getCurrentLanguage:g}=et(),x=P.useCallback($=>{const U=$.length>5&&Mr($,g())||$,D=m(U,void 0,void 0,{type:"date"}),A=typeof U!="string",j=A&&U.toISOString().substring(0,10)||"";return{isValid:A,formattedDate:D,isoDate:j,normalizedDate:U}},[g,m]);P.useEffect(()=>{const{formattedDate:$,isoDate:U,isValid:D}=x(r);c(D&&U||r),l(D&&$||r)},[r,m,x]);const w=()=>o($=>!$),E=()=>{S(f)},O=$=>{S($),o(!1)},S=$=>{const{isoDate:U,isValid:D}=x($);t&&t(D&&U||$)},b=$=>{l($)},_=$=>{$.key==="Enter"&&($.preventDefault(),S(f))};return v.jsxs("div",{"data-component":"date-picker",children:[v.jsx(we,{bindValue:f,placeholder:e,onBlur:E,onChange:b,onKeyDown:_,shapeIcon:"calendar",onShapeIconClick:w,ref:p,isEditable:s,...a}),i&&v.jsx(qn,{disabledDateRanges:n,onDateChange:O,initialValue:gt(u)&&u||"",targetRef:d})]})},Jn=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,isEditable:s=!0,placeholder:a,label:i,disabled:o,fun:u,onOptionsRequest:c,onChange:f})=>{const l=r.map(m=>m.bindValue),p=(m,g)=>{const x=[...r];if(m=="")x.pop();else{const w=x.findIndex(E=>E.bindValue===m&&E.optionalDisplayValue===g);w>=0?x.splice(w,1):x.push({bindValue:m,optionalDisplayValue:g})}f==null||f(x)},d={container:"smp-multipleAutocomplete-container"};return v.jsxs("div",{className:d.container,"data-component":"multiple-autocomplete",children:[i&&v.jsx(De,{label:i,disabled:o}),v.jsx(xt,{elements:r,displayMode:e,isEditable:s,onChange:m=>{f==null||f(m)}}),v.jsx(bt,{bindValue:"",fun:u,isEditable:s,onChange:p,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:a,onOptionsRequest:c,_multiActiveIndex:l})]})},Rr=({...r})=>{const[e,t]=P.useState(!1),n=e?"visibility-off":"visibility";return v.jsx(we,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},Xn=({...r})=>{const[e,t]=P.useState(r.bindValue),{translate:n}=et(),s=a=>{var i;a.key==="Enter"&&(a.preventDefault(),(i=r.onEnter)==null||i.call(r,e))};return v.jsx(we,{...r,placeholder:r.placeholder?r.placeholder:n(St.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})},Zn=({bindValue:r,optionalDisplayValue:e,label:t})=>{const n={wrapper:"smp-text-wrapper"};return t?v.jsxs("div",{className:n.wrapper,children:[v.jsx(De,{label:t}),v.jsx(Ae,{variant:"body",bindValue:e||r})]}):v.jsx(Ae,{variant:"body",bindValue:e||r})};class Se{constructor(e,t){ve(this,"class");ve(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Se(e,e.k==""?[]:e.k.split(";"))}static fromString(e){return new Se({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const We=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t??r.decode,shape:r.shape,fun:r.fun}),lr=r=>{const e=Se.fromDataObj(r.obj),t=r.decode?Se.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},Qn=(r,e)=>{const t=new Se(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new Se(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return We(r,t,n)},es=({disabled:r,bindValue:e,onChange:t,placeholder:n,state:s,appearance:a,isEditable:i,label:o,ariaLabel:u,helperText:c,error:f,onBlur:l,onKeyDown:p})=>{const d=P.useId(),m=`${d}-helper`,g=f?"danger":s,x=c||!!f,w=O=>{t==null||t(O.target.value)},E={wrapper:"smp-textarea-wrapper",container:`smp-textarea ${r?"smp-textarea-disabled":""} ${n?"smp-textarea-placeholder":""} ${g?`smp-textarea-${g}`:""} ${a?`smp-textarea-${a}`:""} ${i?"":"smp-textarea-readOnly"}`};return v.jsxs("div",{className:E.wrapper,"data-component":"textarea",children:[o&&v.jsx(De,{htmlFor:d,label:o,disabled:r}),v.jsx("textarea",{id:d,value:e,placeholder:n,onChange:w,onBlur:l,className:E.container,disabled:r,readOnly:!i,onKeyDown:p,"aria-label":o?void 0:u,"aria-labelledby":o?d:void 0,"aria-describedby":x?m:void 0}),x&&v.jsx(fr,{id:m,helperText:f,disabled:r,state:g})]})},wt=({decode:r,shape:e,obj:t,data:n,icon:s,fun:a,placeholderIcon:i,label:o,options:u,onChange:c,onClick:f,onEnter:l,onBlur:p,onOptionsRequest:d,isEditable:m})=>{const g={obj:t,shape:e,decode:r,icon:s,fun:a},x={onBlur:p,onOptionsRequest:d,fun:a,icon:s,label:o,isEditable:m,...n},w=(S,b,_)=>Ir(t)?We(S,new Ge(t,b).getLegacyValue()):We(S,b,_),E=S=>We(g,new Be(t,S).getLegacyValue()),O=S=>Qn(g,S);switch(e){case ne.AUTOCOMPLETE:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(b,_)=>{c==null||c(w(g,b,_))}};return v.jsx(bt,{...S})}case ne.BUTTON:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onClick:()=>{f==null||f(w(g,t.k))}};return v.jsx(xe,{...S})}case ne.BUTTON_LIST:{const S={...x,options:u,onClick:(b,_)=>{const $={...g,fun:_};f==null||f(w($,b))}};return v.jsx(br,{...S})}case ne.COMBOBOX:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(b,_)=>{c==null||c(w(g,b,_))}};return v.jsx(wr,{...S})}case ne.SWITCH:case ne.CHECKBOX:{const S={...x,bindValue:Be.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:b=>{c==null||c(E(b))}};return v.jsx(xr,{...S})}case ne.CHIP:{const S={...x,elements:lr(g)};return v.jsx(xt,{...S})}case ne.DATE:{const S={...x,bindValue:Ge.fromDataObj(t).getValue(),onChange:b=>{c==null||c(w(g,b))}};return v.jsx(Or,{...S})}case ne.ICON:case ne.IMAGE:{const S={...x,icon:s,placeholderIcon:i,isInteractable:!!x.fun,onClick:()=>{f==null||f(w(g,t.k))}};return v.jsx(le,{...S})}case ne.MULTI_AUTOCOMPLETE:{const S={...x,elements:lr(g),onChange:b=>{c==null||c(O(b))}};return v.jsx(Jn,{...S})}case ne.MEMO:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:b=>{c==null||c(w(g,b))}};return v.jsx(es,{...S})}case ne.PASSWORD:{const S={...x,bindValue:t.k,onChange:b=>{c==null||c(w(g,b))}};return v.jsx(Rr,{...S})}case ne.SPOTLIGHT:{const S={...x,bindValue:t.k,onEnter:b=>{l==null||l(w(g,b))}};return v.jsx(Xn,{...S})}case ne.TEXT_FIELD:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:b=>{c==null||c(w(g,b))}};return v.jsx(we,{...S})}default:{const S={...x,bindValue:t.k,optionalDisplayValue:r};return v.jsx(Zn,{...S})}}},ts=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},Dr=(r,e)=>r.map(t=>{var a,i;if((a=t.sections)!=null&&a.length)return{...t,sections:Dr(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=ts(t.content.filter(u=>!!e[u.id]),+t.columns).map((u,c)=>({...t,id:`${t.id}-${c}`,content:u,gridCols:t.columns,horizontal:!0})),s=[]),{...t,sections:n,content:s}}),cr=(r,e)=>{if(!e)return{};const t=r.some(n=>n.dim)?r.map(n=>n.dim||"auto").join(" "):`repeat(${r.length}, 1fr)`;return{[e]:t}},ur=r=>r.some(e=>e.dim&&!e.dim.endsWith("%")),de={"smp-layout":"_smp-layout_xrjwg_1","smp-layout-horizontal":"_smp-layout-horizontal_xrjwg_9","smp-layout-vertical":"_smp-layout-vertical_xrjwg_13","smp-layout-section-grid":"_smp-layout-section-grid_xrjwg_18","smp-layout-section-vertical":"_smp-layout-section-vertical_xrjwg_20","smp-layout-section-horizontal":"_smp-layout-section-horizontal_xrjwg_24","smp-layout-section-flex":"_smp-layout-section-flex_xrjwg_29","smp-layout-cell-container":"_smp-layout-cell-container_xrjwg_34","smp-grid-template-cols":"_smp-grid-template-cols_xrjwg_44","smp-grid-template-rows":"_smp-grid-template-rows_xrjwg_48","smp-layout-section-with-title":"_smp-layout-section-with-title_xrjwg_52","smp-layout-section-title":"_smp-layout-section-title_xrjwg_58"},Et=({cells:r,layout:e={horizontal:!1,sections:[{id:"1",content:Object.keys(r).map(t=>({id:t}))}]}})=>{const t="--smp-grid-template-cols",n="--smp-grid-template-rows",s=Dr(e.sections||[],r),a=l=>l==null?void 0:l.reduce((p,d)=>{var E,O;let m="",g={},x={},w="";return(E=d.sections)!=null&&E.length?(m=de["smp-layout-section-grid"],g=a(d.sections),d.gridCols==null&&(w=`${de[d.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"]}`,(d.horizontal||ur(d.sections))&&(x=cr(d.sections,d.horizontal?t:n)))):(O=d.content)!=null&&O.length&&(d.gridCols!==void 0&&d.gridCols>0?(m=de["smp-layout-section-grid"],w=`${de["smp-grid-template-cols"]}`,x={[t]:`repeat(${d.gridCols}, 1fr)`}):m=de["smp-layout-section-flex"]),{...p,...g,[d.id]:{classes:`${m} ${de[d.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${w} ${d.justify?`smp-justifyContent-${d.justify}`:""} ${d.align?`smp-alignItems-${d.align}`:""}`,styles:x}}},{}),i=a(s),o={container:`${de["smp-layout"]} ${e.horizontal?de["smp-layout-horizontal"]:de["smp-layout-vertical"]}`,sections:i},u=e.horizontal||ur(e.sections||[])?cr(s,e.horizontal?t:n):{},c=l=>{var d;const p=v.jsx("div",{"smp-id":"section-"+l.id,className:o.sections[l.id].classes,style:o.sections[l.id].styles,children:(d=l.sections)!=null&&d.length?l.sections.map(m=>c(m)):l.content.map(m=>f(m,r[m.id],l.justify,l.align))},"section-"+l.id);return l.title?v.jsxs("div",{className:`${de["smp-layout-section-with-title"]}`,children:[v.jsx("span",{className:`${de["smp-layout-section-title"]} ${l.justify?`smp-justifyContent-${l.justify}`:""} ${l.align?`smp-alignItems-${l.align}`:""}`,children:v.jsx(De,{label:l.title})}),p]}):p},f=(l,p,d,m)=>{const g=l.colSpan!==void 0?l.colSpan>0?l.colSpan:l.colStart!==void 0&&l.colStart<1?1:null:null,x=g!==null?`span ${g}`:l.colStart,w=l.colEnd!==void 0&&l.colEnd>0?l.colEnd:"",E={gridColumnStart:x,gridColumnEnd:w},O=`${de["smp-layout-cell-container"]} ${d?`smp-justifyContent-${d}`:""} ${m?`smp-alignItems-${m}`:""}`;return p?v.jsx("div",{className:O,style:{...E},"smp-id":l.id,children:v.jsx(wt,{...p})},l.id):v.jsx(v.Fragment,{})};return v.jsx("div",{className:o.container,style:u,"smp-id":"layout",children:s==null?void 0:s.map(l=>c(l))})},rs=({data:r,onClick:e,onEnter:t})=>{var i,o;const[n,s]=P.useState(),a=P.useCallback(u=>{var f,l;if(!((f=u.rows)!=null&&f.length)||!((l=u.columns)!=null&&l.length))return{};const c=u.rows[0];return u.columns.filter(p=>p.visible).reduce((p,d)=>{const m=c.cells[d.name],g={...m,onChange:x=>{s(w=>w&&{...w,[d.name]:{...w[d.name],obj:{...w[d.name].obj,k:x.obj.k}}})},onClick:()=>{m.fun&&e&&e({...m})},onEnter:x=>{t&&t(x)}};return{...p,[d.name]:g}},{})},[e,t]);return P.useEffect(()=>{r&&s(a(r))},[r,a]),!((i=r==null?void 0:r.rows)!=null&&i.length)||!((o=r.columns)!=null&&o.length)?null:n&&v.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:v.jsx(Et,{layout:r.rows[0].layout,cells:n})})},ns=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,ss=({data:r,logo:e,open:t,minifiedOnClose:n=!0,customHeight:s="100vh",onClick:a,onEnter:i,onClose:o,loadOptions:u})=>{var O,S;const[c,f]=P.useState(),[l,p]=P.useState(t??!0),d=P.useRef(null),m=s.trim()?s:"100vh",g=P.useCallback(b=>{var $,U;if(!(($=b==null?void 0:b.rows)!=null&&$.length)||!((U=b==null?void 0:b.columns)!=null&&U.length))return{};const _=b.rows[0];return b.columns.filter(D=>D.visible??!0).reduce((D,A)=>{const j=_.cells[A.name];if(!j||!l&&ce(n)&&j.shape!==ne.BUTTON&&j.shape!==ne.BUTTON_LIST)return D;const I={...j,onChange:W=>{f(B=>{const q={...B};return q!=null&&q[A.name]&&(q[A.name].obj.k=W.obj.k),q})},onClick:W=>{W.fun&&a&&a(W)},onEnter:W=>{i&&i(W)}};return u&&j.shape==ne.BUTTON_LIST&&(I.onOptionsRequest=(W,B)=>u(W,B).then(q=>ns(q))),!l&&ce(n)&&(I.data={...I.data,showText:!1,justify:"center"}),{...D,[A.name]:I}},{})},[l,n,a,i,u]),x=P.useCallback(()=>{o==null||o()},[o]),w=()=>{ce(n)?p(b=>!b):(p(!1),o==null||o())};if(P.useEffect(()=>{f(g(r))},[r]),P.useEffect(()=>{if(!d.current)return;if(!ce(n)){f(g(r));return}const b=getComputedStyle(d.current).getPropertyValue("--smp-drawer-slide-transition");let _=Number(b);b.endsWith("ms")?_=parseFloat(b):b.endsWith("s")&&(_=parseFloat(b)*1e3),setTimeout(()=>{f(g(r))},_/2)},[l,n]),P.useEffect(()=>{t!==void 0&&!ce(n)&&p(t)},[n,t]),!((O=r==null?void 0:r.rows)!=null&&O.length)||!((S=r.columns)!=null&&S.length))return null;const E={drawer:`smp-drawer ${ce(n)?"smp-drawer-minified":"smp-drawer-fixed"} ${l?"smp-drawer-open":""} ${!ce(n)&&!l?"smp-drawer-no-border":""}`,container:"smp-drawer-container",containerHeader:"smp-drawer-container-header",containerIcon:`${l?"":"smp-drawer-container-icon-close"} smp-drawer-container-icon`,containerLayout:"smp-drawer-container-layout",containerLogo:"smp-drawer-container-logo",backdrop:`smp-drawer-backdrop ${l?"smp-drawer-backdrop-open":""}`};return c&&v.jsxs(v.Fragment,{children:[!ce(n)&&v.jsx("div",{"aria-hidden":"true","aria-label":"drawer-backdrop",className:E.backdrop,onClick:x}),v.jsx("aside",{ref:d,className:E.drawer,style:{height:m},"aria-label":"Drawer","smp-id":"drawer",children:v.jsxs("div",{className:E.container,children:[v.jsxs("div",{className:E.containerHeader,children:[e&&v.jsx("div",{className:E.containerLogo,children:v.jsx(le,{icon:e,title:"drawer_logo",width:"100%",height:24})}),v.jsx("div",{className:E.containerIcon,children:v.jsx(le,{icon:ce(n)?"menu_close":"close",title:"drawer_icon",rotated:!l,isInteractable:!0,onClick:w,width:20,height:20})})]}),v.jsx("div",{className:E.containerLayout,children:v.jsx(Et,{layout:r.rows[0].layout,cells:c})})]})})]})},as=({ColumnsNumber:r=1,data:e={},ForceText:t,TextColName:n,TextColor:s="var(--smp-dashList-color-base)",Fillspace:a,FontSize:i,Horizontal:o,ForceIcon:u,IconColName:c,IconColor:f="var(--smp-dashList-color-base)",NumberFormat:l,ForceUM:p,UmColName:d,UmColor:m="var(--smp-dashList-color-base)",ForceValue:g,ValueColName:x,ValueColor:w="var(--smp-dashList-color-base)",SelectLayout:E="1",onClick:O})=>{const S="N/A",b=(e==null?void 0:e.columns)||[],_=(e==null?void 0:e.rows)||[],$=_.length>0,U="--smp-dashList-color",D="smp-layout",A="descr",j="icon",I="um",W="value",B=i||"1em",q="18px",z="--smp-dashList-columns",X="--smp-dashList-fontSize",H={dash:(Y="1")=>{const Z=h(Y),te=Z,re=y(Z,A),fe=y(Z,j),ge=y(Z,I),pe=y(Z,W);return{container:te,descr:re,icon:fe,um:ge,value:pe}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
|
|
50
|
+
${ce(o)?"smp-dash-list-horizontal":""}`},{format:k}=et(),h=Y=>`${D}-${Y}`,y=(Y,Z)=>`${Y}__${Z}`,T=Y=>`${U}-${Y}`,C=Y=>{const Z=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(Z.test(Y)){const re=Y.match(Z)||[];if((re==null?void 0:re.length)>3)return"rgb("+re[1]+","+re[2]+","+re[3]+")"}return Y},R=Y=>{if(!l)return Y;const[Z,te]=L(l).map(Ee=>parseInt(Ee||"0")),re="0,0"+(te?"."+"0".repeat(te):""),fe=k(Y,re,"it");if(!Z)return fe;const[ge,pe]=fe.split(",");return ge+(pe?`,${pe}`:"")},L=Y=>Y.includes(";")?Y.split(";"):[Y],F=Y=>{const Z=re=>{var fe;if(re)return(fe=Y==null?void 0:Y.cells[re])==null?void 0:fe.obj.k},te=re=>{var fe,ge;if(!(b.length<=re))return(ge=(fe=Y==null?void 0:Y.cells[b[re].name])==null?void 0:fe.obj)==null?void 0:ge.k};return{descr:t||Z(n)||te(2)||"",icon:u||Z(c)||te(3)||"",um:p||Z(d)||te(1)||"",value:g||Z(x)||te(0)||""}},V=Y=>{O==null||O(Y)},M=(Y,Z)=>{(Y.key==="Enter"||Y.key===" ")&&(Y.preventDefault(),Y.stopPropagation(),V(Z))},G=(Y=>{const Z=H.dash(Y);return{className:Z,descr:te=>v.jsx("div",{className:Z.descr,children:te},`${Y}-${A}`),icon:te=>v.jsx("div",{className:Z.icon,children:v.jsx(le,{color:f,height:q,icon:te,width:q})},`${Y}-${j}`),um:te=>v.jsx("div",{className:Z.um,children:te},`${Y}-${I}`),value:te=>v.jsx("div",{className:Z.value,children:te},`${Y}-${W}`)}})(E),se=Y=>{const{descr:Z,icon:te,um:re,value:fe}=F(Y),ge={[T(A)]:C(s),[T(I)]:C(m),[T(W)]:C(w)},pe=[],Ee=R(fe);switch(E){case"2":te&&pe.push(G.icon(te)),pe.push(G.descr(Z)),pe.push(G.value(re?Ee+" "+re:Ee));break;default:case"1":pe.push(G.descr(Z)),pe.push(G.value(re?Ee+" "+re:Ee))}return v.jsx("div",{className:G.className.container,role:"button",style:ge,tabIndex:0,onClick:()=>V(Y),onKeyDown:Cr=>M(Cr,Y),children:pe},Y.rowId)},N={[z]:String(r),[X]:B};return v.jsx("div",{className:H.dashList,style:N,children:$?_.map(Y=>se(Y)):S})},ut={"smp-table":"_smp-table_8dmh0_1","smp-headerCell":"_smp-headerCell_8dmh0_35","smp-resizer":"_smp-resizer_8dmh0_44"},is="_rowContent_gazwe_13",os="_clickable_gazwe_42",ls="_indent_gazwe_47",cs="_toggle_gazwe_53",us="_rowLabel_gazwe_69",fs="_cell_gazwe_78",ds="_leftSection_gazwe_86",be={rowContent:is,clickable:os,indent:ls,toggle:cs,rowLabel:us,cell:fs,leftSection:ds};function He(r){return!!r&&"children"in r}function ps(r){return!He(r)}function hs(r){return JSON.stringify(r).split("").reduce((e,t)=>(e<<5)-e+t.charCodeAt(0)|0,0).toString()}const jr=({row:r,columnWidths:e={},level:t=0,rowHeight:n=26,offsetTop:s})=>{var E;const[a,i]=P.useState(!1),o=He(r)&&!!((E=r.children)!=null&&E.length),u=r.cells&&Object.keys(r.cells).length>0,c=o,f=t*20,l=()=>{o&&i(!a)},p={content:`${be.rowContent} ${o?be.clickable:""}`,toggle:`${be.toggle}`,indent:`${be.indent}`,cell:`${be.cell}`},d=O=>v.jsx(wt,{...O}),m=()=>v.jsx("span",{className:p.toggle,children:c?a?"▶":"▼":" "}),g=()=>v.jsx("span",{className:p.indent,style:{width:`${f}px`},"aria-hidden":"true"}),x=()=>{const O=ps(r)?"":r.decode||(u?"":"Untitled"),S=s??n*t;return v.jsxs("tr",{className:p.content,onClick:l,role:o?"button":"row","aria-expanded":o?!a:void 0,style:{height:`${n}px`,lineHeight:`calc(${n}px - 2*2px)`,transform:`translateY(${S}px)`},children:[He(r)&&v.jsxs("td",{className:be.leftSection,style:{height:`${n}px`},children:[g(),m(),v.jsx("span",{className:be.rowLabel,children:O})]}),r.cells&&Object.keys(r.cells).length>0&&Object.entries(r.cells).map(([b,_])=>v.jsx("td",{className:p.cell,style:{width:e[b],minWidth:e[b],height:`${n}px`},children:d(_)},hs(_)||b))]})},w=()=>{var O;return a||!o?null:v.jsx(v.Fragment,{children:He(r)&&((O=r.children)==null?void 0:O.map((S,b)=>v.jsx(jr,{row:S,level:t+1},`child-${b}`)))})};return v.jsxs(v.Fragment,{children:[x(),w()]})},ms=({label:r,rowHeight:e=28,offsetTop:t=0,level:n=0,onClick:s,isExpanded:a})=>{const i={tr:"smp-groupRow-tr",td:"smp-groupRow-td"};return v.jsx("tr",{className:i.tr,style:{height:e,top:t,lineHeight:`${e}px`},onClick:s,children:v.jsxs("td",{className:i.td,style:{paddingLeft:10+n*20},children:[v.jsx(le,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),v.jsx(Ae,{variant:"title",bindValue:r})]})})};function gs(r,e){const t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t}function ys(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 vs(r,e,t,n){const s=[];let a=0;return i(r,0,[]),{flatRows:s,offset:a};function i(l,p,d){if(p>=e.length){f(l);return}const m=e[p].column,g=o(l,m);for(const[x,w]of g){const E=[...d,x],O=u(E,p),S=n.has(O);s.push(c(x,O,p,S)),a+=t,S&&i(w,p+1,E)}}function o(l,p){var m;const d=new Map;for(const g of l){const x=((m=g.cells[p])==null?void 0:m.decode)??"N/D";d.has(x)||d.set(x,[]),d.get(x).push(g)}return d}function u(l,p){return`group-${l.join("-")}-${p}`}function c(l,p,d,m){return{isGroup:!0,value:l,cells:{},rowId:p,level:d,isExpanded:m}}function f(l){for(const p of l)s.push(p),a+=t}}const bs=({groups:r=[],isDraggable:e=!0,isEditable:t=!0,onChange:n,onDrop:s,onDragOver:a})=>{const i=r.map(o=>({bindValue:o.column}));return v.jsxs("div",{className:"smp-groupBar-container",onDragOver:a,onDrop:s,children:[v.jsx(le,{icon:"groups"}),v.jsx(xt,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:n})]})},xs=({data:r,lineHeight:e=28,TableHeight:t=400,groups:n,columnSizingMode:s="fixed",showGroupBar:a=!0})=>{var U;const[i,o]=P.useState(r),[u,c]=P.useState(n||[]),[f,l]=P.useState(new Set),p=i&&i.columns?Object.fromEntries(i.columns.map(D=>[D.name,120])):{},[d,m]=P.useState(p),g=P.useRef(null);P.useEffect(()=>{var j;if(!i||!i.columns||i.columns.length)return;const D=((j=g.current)==null?void 0:j.clientWidth)??1e3;let A={};switch(s){case"fixed":A=Object.fromEntries(i.columns.map(I=>[I.name,120]));break;case"fit-grid":{const I=i.columns.filter(B=>B.visible),W=Math.floor(D/I.length);A=Object.fromEntries(I.map(B=>[B.name,W]));break}case"fit-content":A=Object.fromEntries(i.columns.map(I=>{const W=Math.max(...r.rows.map(H=>{var y;const k=(y=H==null?void 0:H.cells)==null?void 0:y[I.name],h=(k==null?void 0:k.decode)||(k==null?void 0:k.value);return h?String(h).length:0}),0),B=I.title?I.title.length:0,q=Math.max(W,B);return[I.name,Math.max(50,q*8+16)]}));break}m(A)},[s,r,i]),P.useEffect(()=>{if(u!=null&&u.length&&r.rows){const{flatRows:D}=vs(r.rows,u,e,f);o({...r,rows:D})}else o(r)},[r,u,f,e]);const x=D=>{c(ys(D,u))},w=D=>{D.preventDefault();const A=D.dataTransfer.getData("text/plain");if(!A||u.some(W=>W.column===A))return;const I=[...u,{column:A,visible:!0}];c(I)},E=D=>{D.preventDefault()},{virtualItems:O,containerProps:S,innerProps:b}=gr({items:(i==null?void 0:i.rows)||[],itemHeight:e,containerHeight:t,overscan:5}),_=(D,A)=>{const j=D.clientX,I=d[A],W=q=>{const z=q.clientX-j,X=Math.max(50,I+z);m(H=>({...H,[A]:X}))},B=()=>{window.removeEventListener("mousemove",W),window.removeEventListener("mouseup",B)};window.addEventListener("mousemove",W),window.addEventListener("mouseup",B)},$={smpTable:`${ut["smp-table"]}`,headerCell:`${ut["smp-headerCell"]}`,resizer:`${ut["smp-resizer"]}`};return i&&v.jsx("div",{className:$.smpTable,...S,ref:g,children:v.jsxs("table",{children:[v.jsxs("thead",{children:[(n||a)&&v.jsx(bs,{groups:u,onChange:x,onDrop:w,onDragOver:E}),v.jsx("tr",{children:i.columns&&((U=i.columns)==null?void 0:U.map(D=>D.visible&&v.jsxs("th",{className:$.headerCell,draggable:!0,onDragStart:A=>{A.dataTransfer.setData("text/plain",D.name)},style:{width:d[D.name],minWidth:d[D.name],maxWidth:d[D.name]},children:[v.jsx(Ae,{variant:"title",bindValue:D.title}),v.jsx("div",{className:$.resizer,onMouseDown:A=>_(A,D.name),role:"region"})]},D.name)))})]}),v.jsx("tbody",{...b,children:O.map(({item:D,index:A,offsetTop:j})=>D.isGroup?v.jsx(ms,{label:D.value||"",rowHeight:e,offsetTop:j,level:D.level,onClick:()=>{const I=D.rowId;I&&l(W=>gs(W,I))},isExpanded:D.isExpanded},D.rowId||`group-${A}`):v.jsx(jr,{row:D,columnWidths:d,rowHeight:e,offsetTop:j,isGroup:!1},D.rowId||`row-${A}`))}),v.jsx("tfoot",{children:v.jsx("span",{children:"Tfooter here"})})]})})},Ss=({data:r,Type:e,ShowSubmit:t=!1,SubmitPosition:n="Right",DefaultValue:s,Label:a,LabelPosition:i="Left",onBlur:o,onClick:u,onOptionsRequest:c})=>{const[f,l]=P.useState();P.useEffect(()=>{l(()=>{if(!r)return;const g={...r};return e&&(g.shape=e),g.shape==null&&(g.shape=ne.TEXT_FIELD),s&&(g.obj=Nr(s)),g})},[r,s,e]);const d={container:`smp-field-container ${ce(t)?`smp-field-position-${n}`:""}`},m=()=>{ce(t)||o==null||o(f)};if(f)return v.jsxs("div",{className:d.container,children:[v.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:v.jsx(wt,{...f,onChange:l,onOptionsRequest:c,fun:r==null?void 0:r.fun,onBlur:m,label:a,labelPosition:i})}),ce(t)&&v.jsx(xe,{optionalDisplayValue:"Confirm",onClick:()=>u==null?void 0:u(f),bindValue:"Confirm"})]})},ws=r=>(r==null?void 0:r.type)==="SmeupDataTree",Es=r=>(r==null?void 0:r.type)==="SmeupDataTable",Ts=r=>ws(r)?r.children?r.children.map(e=>({id:e.obj.k,label:e.value??""})):[]:Es(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}}):[],Os=({data:r,readOnly:e=!1,hiddenSubmitButton:t=!1,optionsHandler:n,onSubmit:s})=>{const[a,i]=P.useState({});P.useEffect(()=>{i(u(r))},[r]);const o=()=>{const f=c();s({value:f})},u=f=>{var p,d,m;if(!((p=f.rows)!=null&&p.length)||!((d=f.columns)!=null&&d.length))return{};const l=(m=f.rows)==null?void 0:m[0];return f.columns.filter(g=>g.visible??!0).reduce((g,x)=>{const w={...l.cells[x.name],label:x.title,onChange:E=>{i(O=>({...O,[x.name]:{...O[x.name],obj:{...O[x.name].obj,k:E.obj.k},decode:E.decode}}))}};return w.fun&&(w.shape==ne.AUTOCOMPLETE||w.shape==ne.MULTI_AUTOCOMPLETE||w.shape==ne.COMBOBOX)&&(w.onOptionsRequest=async(E,O)=>Ts(await n(E,O,r,x.name))),w.isEditable==null&&(w.isEditable=!0),e&&(w.isEditable=!1),w.isEditable&&w.shape==null&&(w.shape=ne.TEXT_FIELD),{...g,[x.name]:w}},{})},c=()=>({before:r,after:{type:"SmeupDataTable",columns:JSON.parse(JSON.stringify(r.columns)),rows:[{cells:JSON.parse(JSON.stringify(a))}]}});return a&&v.jsxs("div",{"data-component":"input-panel",style:{display:"flex",flexDirection:"column",gap:"2rem",padding:"2rem"},children:[v.jsx(Et,{layout:r.rows[0].layout,cells:a}),!t&&v.jsx(xe,{onClick:o,bindValue:"submit",optionalDisplayValue:"Submit"})]})};exports.AppBar=rs;exports.Autocomplete=bt;exports.Button=xe;exports.ButtonList=br;exports.Checkbox=xr;exports.Combobox=wr;exports.DashList=as;exports.DataTableComponent=xs;exports.DatePicker=Or;exports.Drawer=ss;exports.Field=Ss;exports.Icon=le;exports.InputPanel=Os;exports.Password=Rr;exports.Textfield=we;exports.configurePaths=un;
|