@sme.up/ketchup2 2.0.0-SNAPSHOT-20250620145158 → 2.0.0-SNAPSHOT-20250624071954
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/layoutAssets.d.ts.map +1 -1
- package/dist/assets/svg/clock.svg +1 -0
- package/dist/basic-components/button/button.d.ts.map +1 -1
- package/dist/basic-components/cell/cell-types.d.ts +11 -1
- package/dist/basic-components/cell/cell-types.d.ts.map +1 -1
- package/dist/basic-components/cell/cell.d.ts.map +1 -1
- package/dist/basic-components/cell/tests/utils.d.ts.map +1 -1
- package/dist/basic-components/mulitple-autocomplete/multiple-autocomplete.d.ts.map +1 -1
- package/dist/basic-components/textfield/textfield-types.d.ts +0 -5
- package/dist/basic-components/textfield/textfield-types.d.ts.map +1 -1
- package/dist/basic-components/time-picker/time-picker-clock/time-picker-clock.d.ts +9 -0
- package/dist/basic-components/time-picker/time-picker-clock/time-picker-clock.d.ts.map +1 -0
- package/dist/basic-components/time-picker/time-picker-types.d.ts +5 -0
- package/dist/basic-components/time-picker/time-picker-types.d.ts.map +1 -0
- package/dist/basic-components/time-picker/time-picker-utils.d.ts +25 -0
- package/dist/basic-components/time-picker/time-picker-utils.d.ts.map +1 -0
- package/dist/basic-components/time-picker/time-picker.d.ts +3 -0
- package/dist/basic-components/time-picker/time-picker.d.ts.map +1 -0
- package/dist/components/app-bar/app-bar.d.ts.map +1 -1
- package/dist/components/drawer/drawer.d.ts.map +1 -1
- package/dist/components/field/field.d.ts.map +1 -1
- package/dist/components/input-panel/assets/data.d.ts +2 -0
- package/dist/components/input-panel/assets/data.d.ts.map +1 -1
- package/dist/components/input-panel/input-panel-types.d.ts +16 -1
- 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/components/spotlight/spotlight.d.ts.map +1 -1
- package/dist/functional-components/layout/layout-types.d.ts +2 -3
- package/dist/functional-components/layout/layout-types.d.ts.map +1 -1
- package/dist/functional-components/layout/layout-utils.d.ts +2 -3
- package/dist/functional-components/layout/layout-utils.d.ts.map +1 -1
- package/dist/functional-components/layout/layout.d.ts +1 -0
- package/dist/functional-components/layout/layout.d.ts.map +1 -1
- package/dist/functional-components/row/row.d.ts.map +1 -1
- package/dist/ketchup2.cjs.js +13 -13
- package/dist/ketchup2.css +1 -1
- package/dist/ketchup2.es.js +2324 -2100
- package/dist/locale/en/translation.json.d.ts +2 -1
- package/dist/locale/it/translation.json.d.ts +2 -1
- package/dist/types/data-structures.d.ts +5 -0
- package/dist/types/data-structures.d.ts.map +1 -1
- package/dist/types/translation.d.ts +2 -1
- package/dist/types/translation.d.ts.map +1 -1
- package/dist/utils/hash.d.ts.map +1 -1
- package/dist/utils/objects.d.ts +6 -0
- package/dist/utils/objects.d.ts.map +1 -1
- package/dist/utils/wrapper-types/time.d.ts +16 -0
- package/dist/utils/wrapper-types/time.d.ts.map +1 -0
- package/package.json +1 -1
package/dist/ketchup2.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Nr=Object.defineProperty;var Mr=(r,e,t)=>e in r?Nr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var ye=(r,e,t)=>Mr(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),Fr=require("react-dom");function Vr(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const Ye=Vr(R);var Ue={exports:{}},_e={};/**
|
|
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
|
|
9
|
+
*/var $t;function Yr(){if($t)return _e;$t=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var o in s)o!=="key"&&(a[o]=s[o])}else a=s;return s=a.ref,{$$typeof:r,type:n,key:i,ref:s!==void 0?s:null,props:a}}return _e.Fragment=e,_e.jsx=t,_e.jsxs=t,_e}var $e={};/**
|
|
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
|
|
17
|
+
*/var Ct;function Ur(){return Ct||(Ct=1,process.env.NODE_ENV!=="production"&&function(){function r(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===I?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case g:return"Fragment";case E:return"Profiler";case b:return"StrictMode";case v:return"Suspense";case D:return"SuspenseList";case k: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 T:return(h.displayName||"Context")+".Provider";case w:return(h._context.displayName||"Context")+".Consumer";case S:var x=h.render;return h=h.displayName,h||(h=x.displayName||x.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case $:return x=h.displayName||null,x!==null?x:r(h.type)||"Memo";case C:x=h._payload,h=h._init;try{return r(h(x))}catch{}}return null}function e(h){return""+h}function t(h){try{e(h);var x=!1}catch{x=!0}if(x){x=console;var O=x.error,P=typeof Symbol=="function"&&Symbol.toStringTag&&h[Symbol.toStringTag]||h.constructor.name||"Object";return O.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",P),e(h)}}function n(h){if(h===g)return"<>";if(typeof h=="object"&&h!==null&&h.$$typeof===C)return"<...>";try{var x=r(h);return x?"<"+x+">":"<...>"}catch{return"<...>"}}function s(){var h=_.A;return h===null?null:h.getOwner()}function a(){return Error("react-stack-top-frame")}function i(h){if(F.call(h,"key")){var x=Object.getOwnPropertyDescriptor(h,"key").get;if(x&&x.isReactWarning)return!1}return h.key!==void 0}function o(h,x){function O(){Z||(Z=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",x))}O.isReactWarning=!0,Object.defineProperty(h,"key",{get:O,configurable:!0})}function c(){var h=r(this.type);return K[h]||(K[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 l(h,x,O,P,j,A,V,Y){return O=A.ref,h={$$typeof:p,type:h,key:x,props:A,_owner:j},(O!==void 0?O:null)!==null?Object.defineProperty(h,"ref",{enumerable:!1,get:c}):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:V}),Object.defineProperty(h,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h}function f(h,x,O,P,j,A,V,Y){var M=x.children;if(M!==void 0)if(P)if(W(M)){for(P=0;P<M.length;P++)u(M[P]);Object.freeze&&Object.freeze(M)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else u(M);if(F.call(x,"key")){M=r(h);var J=Object.keys(x).filter(function(se){return se!=="key"});P=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",N[M+P]||(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} />`,_,M,J,M),I[M+_]=!0)}if(M=null,T!==void 0&&(t(T),M=""+T),i(b)&&(t(b.key),M=""+b.key),"key"in b){T={};for(var H in b)H!=="key"&&(T[H]=b[H])}else T=b;return M&&o(T,typeof h=="function"?h.displayName||h.name||"Unknown":h),c(h,M,A,R,s(),T,V,Y)}function l(h){typeof h=="object"&&h!==null&&h.$$typeof===d&&h._store&&(h._store.validated=1)}var p=D,d=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),y=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"),v=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),N=Symbol.for("react.client.reference"),j=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,W=Array.isArray,q=console.createTask?console.createTask:function(){return null};p={"react-stack-bottom-frame":function(h){return h()}};var Z,K={},z=p["react-stack-bottom-frame"].bind(p,a)(),B=q(n(a)),I={};$e.Fragment=y,$e.jsx=function(h,b,T,_,R){var A=1e4>j.recentlyCreatedOwnerStacks++;return f(h,b,T,!1,_,R,A?Error("react-stack-top-frame"):z,A?q(n(h)):B)},$e.jsxs=function(h,b,T,_,R){var A=1e4>j.recentlyCreatedOwnerStacks++;return f(h,b,T,!0,_,R,A?Error("react-stack-top-frame"):z,A?q(n(h)):B)}}()),$e}var $t;function Vr(){return $t||($t=1,process.env.NODE_ENV==="production"?Me.exports=Mr():Me.exports=Fr()),Me.exports}var g=Vr();const re={AUTOCOMPLETE:"ACP",BUTTON_LIST:"BTL",BUTTON:"BTN",CHECKBOX:"CHK",CHIP:"CHI",COMBOBOX:"CMB",DATE:"CAL",ICON:"ICO",IMAGE:"IMG",MEMO:"MEM",MULTI_AUTOCOMPLETE:"AML",RADIO:"RAD",SPOTLIGHT:"SPL",SWITCH:"SWT",TEXT_FIELD:"ITX",PASSWORD:"PWD"},Yr=r=>r.t=="D8",Ur=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 Je{constructor(e,t){be(this,"class");be(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Je(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 Wr(r,e){if(bt(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),Fe(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)),Fe(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)),ht(o,l,parseInt(c))&&Fe(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)),ht(f,l,parseInt(c))&&Fe(t)?t:r}}return r}function bt(r){return/^\d{4}-\d{2}-\d{2}$/.test(r)&&r.length===10}function Fe(r){return r instanceof Date&&!isNaN(r.getTime())}function Br(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 ht(n,t-1,e)}function ht(r,e,t){const n=[31,Hr(t)?29:28,31,30,31,30,31,31,30,31,30,31];return!(e<0||e>11||r<1||r>n[e])}function Hr(r){return r%4===0&&(r%100!==0||r%400===0)}function Gr(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 Xe{constructor(e,t){be(this,"class");be(this,"date");this.class=e,this.date=t}static fromDataObj(e){const t=Ct.get(`${e.t}${e.p}`);if(t)return new Xe(e,t.legacyToIso(e.k));throw new Error(`Date creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=Ct.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 Ct=new Map([["D8*YYMD",{legacyToIso(r){return Br(r)&&`${r.substring(0,4)}-${r.substring(4,6)}-${r.substring(6,8)}`||r},isoToLegacy(r){return bt(r)&&r.replaceAll("-","")||r}}]]),Ze=(r,e)=>{D.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 xt({position:r="bottom",enabled:e=!0}){const t=D.useRef(null),n=D.useRef(null),[s,a]=D.useState(0),i=D.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 y=c+window.scrollY,x=f+window.scrollX;switch(r){case"top":y-=d;break;case"bottom":y+=p;break;case"left":x-=m;break;case"right":x+=l;break}requestAnimationFrame(()=>{u.style.transform=`translate(${x}px, ${y}px)`,u.style.opacity="1"})},[r]);return D.useLayoutEffect(()=>{if(!e)return;const o=requestAnimationFrame(()=>{i()}),u=new MutationObserver(()=>{n.current&&i()});return n.current&&u.observe(n.current,{childList:!0,subtree:!0}),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),()=>{cancelAnimationFrame(o),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),u.disconnect()}},[i,e]),{anchorRef:t,targetRef:n,anchorWidth:s}}const Ae=(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},mr=({helperText:r,disabled:e,state:t,id:n})=>{const s={container:`smp-helper-text ${e?"smp-helper-text-disabled":""} ${t?`smp-helper-text-${t}`:""}`};return g.jsx("label",{className:s.container,id:n,children:r})},De=({label:r,disabled:e,htmlFor:t})=>{const n={container:`smp-label ${e?"smp-label-disabled":""}`};return g.jsx("label",{className:n.container,htmlFor:t,children:r})};function qr(r,e){if(r==null)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.indexOf(n)!==-1)continue;t[n]=r[n]}return t}function 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 mt(r,e){return mt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},mt(r,e)}function Kr(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,mt(r,e)}function at(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 Ve={};/*!
|
|
22
|
+
<%s key={someKey} {...props} />`,P,M,J,M),N[M+P]=!0)}if(M=null,O!==void 0&&(t(O),M=""+O),i(x)&&(t(x.key),M=""+x.key),"key"in x){O={};for(var H in x)H!=="key"&&(O[H]=x[H])}else O=x;return M&&o(O,typeof h=="function"?h.displayName||h.name||"Unknown":h),l(h,M,A,j,s(),O,V,Y)}function u(h){typeof h=="object"&&h!==null&&h.$$typeof===p&&h._store&&(h._store.validated=1)}var d=R,p=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),T=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),k=Symbol.for("react.activity"),I=Symbol.for("react.client.reference"),_=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=Object.prototype.hasOwnProperty,W=Array.isArray,q=console.createTask?console.createTask:function(){return null};d={"react-stack-bottom-frame":function(h){return h()}};var Z,K={},z=d["react-stack-bottom-frame"].bind(d,a)(),B=q(n(a)),N={};$e.Fragment=g,$e.jsx=function(h,x,O,P,j){var A=1e4>_.recentlyCreatedOwnerStacks++;return f(h,x,O,!1,P,j,A?Error("react-stack-top-frame"):z,A?q(n(h)):B)},$e.jsxs=function(h,x,O,P,j){var A=1e4>_.recentlyCreatedOwnerStacks++;return f(h,x,O,!0,P,j,A?Error("react-stack-top-frame"):z,A?q(n(h)):B)}}()),$e}var Pt;function Wr(){return Pt||(Pt=1,process.env.NODE_ENV==="production"?Ue.exports=Yr():Ue.exports=Ur()),Ue.exports}var y=Wr();const De=({label:r,disabled:e,htmlFor:t})=>{const n={container:`smp-label ${e?"smp-label-disabled":""}`};return y.jsx("label",{className:n.container,htmlFor:t,children:r})},de={"smp-layout":"_smp-layout_xrjwg_1","smp-layout-horizontal":"_smp-layout-horizontal_xrjwg_9","smp-layout-vertical":"_smp-layout-vertical_xrjwg_13","smp-layout-section-grid":"_smp-layout-section-grid_xrjwg_18","smp-layout-section-vertical":"_smp-layout-section-vertical_xrjwg_20","smp-layout-section-horizontal":"_smp-layout-section-horizontal_xrjwg_24","smp-layout-section-flex":"_smp-layout-section-flex_xrjwg_29","smp-layout-cell-container":"_smp-layout-cell-container_xrjwg_34","smp-grid-template-cols":"_smp-grid-template-cols_xrjwg_44","smp-grid-template-rows":"_smp-grid-template-rows_xrjwg_48","smp-layout-section-with-title":"_smp-layout-section-with-title_xrjwg_52","smp-layout-section-title":"_smp-layout-section-title_xrjwg_58"},Br=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},br=(r,e)=>r.map(t=>{var a,i;if((a=t.sections)!=null&&a.length)return{...t,sections:br(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=Br(t.content.filter(c=>e.includes(c.id)),+t.columns).map((c,l)=>({...t,id:`${t.id}-${l}`,content:c,gridCols:t.columns,horizontal:!0})),s=[]),{...t,sections:n,content:s}}),At=(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}},kt=r=>r.some(e=>e.dim&&!e.dim.endsWith("%")),Tt=({children:r,layout:e={horizontal:!1,sections:[{id:"1",content:Array.isArray(r)?r.map(t=>({id:t.props.id})):[{id:r.props.id}]}]}})=>{const t={};R.Children.forEach(r,d=>{R.isValidElement(d)&&(t[d.props.id]=d)});const n="--smp-grid-template-cols",s="--smp-grid-template-rows",a=br(e.sections??[],Object.keys(t)),i=d=>d.reduce((p,m)=>{var T,S;let g="",b={},E={},w="";return(T=m.sections)!=null&&T.length?(g=de["smp-layout-section-grid"],b=i(m.sections),m.gridCols===void 0&&(w=de[m.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"],(m.horizontal||kt(m.sections))&&(E=At(m.sections,m.horizontal?n:s)))):(S=m.content)!=null&&S.length&&(m.gridCols!==void 0&&m.gridCols>0?(g=de["smp-layout-section-grid"],w=de["smp-grid-template-cols"],E={[n]:`repeat(${m.gridCols}, 1fr)`}):g=de["smp-layout-section-flex"]),{...p,...b,[m.id]:{classes:`${g} ${de[m.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${w} ${m.justify?`smp-justifyContent-${m.justify}`:""} ${m.align?`smp-alignItems-${m.align}`:""}`,styles:E}}},{}),o=i(a),c=`${de["smp-layout"]} ${e.horizontal?de["smp-layout-horizontal"]:de["smp-layout-vertical"]}`,l=e.horizontal||kt(e.sections||[])?At(a,e.horizontal?n:s):{},f=d=>{var m,g;const p=y.jsx("div",{"smp-id":`section-${d.id}`,className:o[d.id].classes,style:o[d.id].styles,children:(m=d.sections)!=null&&m.length?d.sections.map(b=>f(b)):(g=d.content)==null?void 0:g.map(b=>u(b,d.justify,d.align))},`section-${d.id}`);return d.title?y.jsxs("div",{className:de["smp-layout-section-with-title"],children:[y.jsx("span",{className:`${de["smp-layout-section-title"]} ${d.justify?`smp-justifyContent-${d.justify}`:""} ${d.align?`smp-alignItems-${d.align}`:""}`,children:y.jsx(De,{label:d.title})}),p]},`title-section-${d.id}`):p},u=(d,p,m)=>{const g=t[d.id];if(!g)return null;const E={gridColumnStart:(d.colSpan&&d.colSpan>0?`span ${d.colSpan}`:d.colStart&&d.colStart<1?"1":void 0)??d.colStart,gridColumnEnd:d.colEnd&&d.colEnd>0?d.colEnd:void 0},w=`${de["smp-layout-cell-container"]} ${p?`smp-justifyContent-${p}`:""} ${m?`smp-alignItems-${m}`:""}`;return y.jsx("div",{className:w,style:E,"smp-id":d.id,children:g},d.id)};return y.jsx("div",{className:c,style:l,"smp-id":"layout",children:a.map(d=>f(d))})},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",RADIO:"RAD",SPOTLIGHT:"SPL",SWITCH:"SWT",TEXT_FIELD:"ITX",TIME:"TIM",PASSWORD:"PWD"},Hr=r=>r.t=="D8",Gr=r=>r.t=="I1",qr=r=>{if(r){const e=r.split(";");if(e.length==3)return{t:e[0],p:e[1],k:e[2]}}return{t:"",p:"",k:""}};class Qe{constructor(e,t){ye(this,"class");ye(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Qe(e,e.k=="1"||e.k=="true")}getValue(){return this.value}getLegacyValue(){if(this.class.t=="V2"){if(this.class.p=="SI/NO")return this.value?"1":" ";if(this.class.p=="ON/OFF")return this.value?"1":"0"}return this.value?"true":"false"}}function Kr(r,e){if(Ot(r)){const f=new Date(r);if(!isNaN(f.getTime()))return f}const t=new Date,n=r.replaceAll("/","").replaceAll("-","");let s="DDMMYYYY";e==="en"&&(s="MMDDYYYY");const a=s.indexOf("DD"),i=s.indexOf("MM");let o=0,c=0,l="";switch(n.length){case 1:case 2:return o=parseInt(n),t.setDate(o),We(t)?t:r;case 3:case 4:return o=parseInt(n.substring(0,2)),c=parseInt(n.substring(2,4)),i===0?(t.setMonth(o-1),t.setDate(c)):a===0&&(t.setMonth(c-1),t.setDate(o)),We(t)?t:r;case 5:case 6:{o=parseInt(n.substring(0,2)),c=parseInt(n.substring(2,4)),Number(n.substring(4))>50?l="19"+n.substring(4):l="20"+n.substring(4);let f=0,u=0;return i===0?(f=c,u=o-1,t.setFullYear(parseInt(l),u,f)):a===0&&(f=o,u=c-1,t.setFullYear(parseInt(l),u,f)),bt(o,u,parseInt(l))&&We(t)?t:r}case 7:case 8:{o=parseInt(n.substring(0,2)),c=parseInt(n.substring(2,4)),l=n.substring(4);let f=0,u=0;return i===0?(f=c,u=o-1,t.setFullYear(parseInt(l),u,f)):a===0&&(f=o,u=c-1,t.setFullYear(parseInt(l),u,f)),bt(f,u,parseInt(l))&&We(t)?t:r}}return r}function Ot(r){return/^\d{4}-\d{2}-\d{2}$/.test(r)&&r.length===10}function We(r){return r instanceof Date&&!isNaN(r.getTime())}function zr(r){if(!/^\d{8}$/.test(r))return!1;const e=parseInt(r.slice(0,4),10),t=parseInt(r.slice(4,6),10),n=parseInt(r.slice(6,8),10);return bt(n,t-1,e)}function bt(r,e,t){const n=[31,Jr(t)?29:28,31,30,31,30,31,31,30,31,30,31];return!(e<0||e>11||r<1||r>n[e])}function Jr(r){return r%4===0&&(r%100!==0||r%400===0)}function Xr(r){const e=r.getFullYear(),t=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0");return isNaN(e)||isNaN(Number(t))||isNaN(Number(n))?r.toString():`${e}-${t}-${n}`}class et{constructor(e,t){ye(this,"class");ye(this,"date");this.class=e,this.date=t}static fromDataObj(e){const t=Lt.get(`${e.t}${e.p}`);if(t)return new et(e,t.legacyToIso(e.k));throw new Error(`Date creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=Lt.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 Lt=new Map([["D8*YYMD",{legacyToIso(r){return zr(r)&&`${r.substring(0,4)}-${r.substring(4,6)}-${r.substring(6,8)}`||r},isoToLegacy(r){return Ot(r)&&r.replaceAll("-","")||r}}]]),ke=(r,e)=>{R.useEffect(()=>{const t=n=>{typeof r=="object"&&r!==null&&"current"in r&&r.current&&!r.current.contains(n.target)&&e()};return document.addEventListener("mousedown",t),()=>{document.removeEventListener("mousedown",t)}},[r,e])};function it({position:r="bottom",enabled:e=!0}){const t=R.useRef(null),n=R.useRef(null),[s,a]=R.useState(0),i=R.useCallback(()=>{const o=t.current,c=n.current;if(!o||!c)return;const{top:l,left:f,width:u,height:d}=o.getBoundingClientRect();a(u);const p=c.offsetHeight,m=c.offsetWidth;if(m===0||p===0){requestAnimationFrame(i);return}let g=l+window.scrollY,b=f+window.scrollX;switch(r){case"top":g-=p;break;case"bottom":g+=d;break;case"left":b-=m;break;case"right":b+=u;break}requestAnimationFrame(()=>{c.style.transform=`translate(${b}px, ${g}px)`,c.style.opacity="1"})},[r]);return R.useLayoutEffect(()=>{if(!e)return;const o=requestAnimationFrame(()=>{i()}),c=new MutationObserver(()=>{n.current&&i()});return n.current&&c.observe(n.current,{childList:!0,subtree:!0}),window.addEventListener("resize",i),window.addEventListener("scroll",i,!0),()=>{cancelAnimationFrame(o),window.removeEventListener("resize",i),window.removeEventListener("scroll",i,!0),c.disconnect()}},[i,e]),{anchorRef:t,targetRef:n,anchorWidth:s}}const Le=(r,e,t)=>{if(r=="")return"";if(t)switch(t){case"CodeOnly":return r;case"DescOnly":return e||"";case"Both":return`${r} - ${e}`}return r},xr=({helperText:r,disabled:e,state:t,id:n})=>{const s={container:`smp-helper-text ${e?"smp-helper-text-disabled":""} ${t?`smp-helper-text-${t}`:""}`};return y.jsx("label",{className:s.container,id:n,children:r})};function Zr(r,e){if(r==null)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(e.indexOf(n)!==-1)continue;t[n]=r[n]}return t}function tt(){return tt=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(r[n]=t[n])}return r},tt.apply(null,arguments)}function xt(r,e){return xt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},xt(r,e)}function Qr(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,xt(r,e)}function ut(r,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,a;n<s;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return r.concat(a||Array.prototype.slice.call(e))}var Be={};/*!
|
|
23
23
|
* content-type
|
|
24
24
|
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
25
25
|
* MIT Licensed
|
|
26
|
-
*/var
|
|
26
|
+
*/var It;function en(){if(It)return Be;It=1;var r=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,e=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,t=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,n=/\\([\u000b\u0020-\u00ff])/g,s=/([\\"])/g,a=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;Be.format=i,Be.parse=o;function i(u){if(!u||typeof u!="object")throw new TypeError("argument obj is required");var d=u.parameters,p=u.type;if(!p||!a.test(p))throw new TypeError("invalid type");var m=p;if(d&&typeof d=="object")for(var g,b=Object.keys(d).sort(),E=0;E<b.length;E++){if(g=b[E],!t.test(g))throw new TypeError("invalid parameter name");m+="; "+g+"="+l(d[g])}return m}function o(u){if(!u)throw new TypeError("argument string is required");var d=typeof u=="object"?c(u):u;if(typeof d!="string")throw new TypeError("argument string is required to be a string");var p=d.indexOf(";"),m=p!==-1?d.slice(0,p).trim():d.trim();if(!a.test(m))throw new TypeError("invalid media type");var g=new f(m.toLowerCase());if(p!==-1){var b,E,w;for(r.lastIndex=p;E=r.exec(d);){if(E.index!==p)throw new TypeError("invalid parameter format");p+=E[0].length,b=E[1].toLowerCase(),w=E[2],w.charCodeAt(0)===34&&(w=w.slice(1,-1),w.indexOf("\\")!==-1&&(w=w.replace(n,"$1"))),g.parameters[b]=w}if(p!==d.length)throw new TypeError("invalid parameter format")}return g}function c(u){var d;if(typeof u.getHeader=="function"?d=u.getHeader("content-type"):typeof u.headers=="object"&&(d=u.headers&&u.headers["content-type"]),typeof d!="string")throw new TypeError("content-type header is missing from object");return d}function l(u){var d=String(u);if(t.test(d))return d;if(d.length>0&&!e.test(d))throw new TypeError("invalid parameter value");return'"'+d.replace(s,"\\$1")+'"'}function f(u){this.parameters=Object.create(null),this.type=u}return Be}var tn=en(),je=new Map,Sr=function(e){return e.cloneNode(!0)},Nt=function(){return window.location.protocol==="file:"},wr=function(e,t,n){var s=new XMLHttpRequest;s.onreadystatechange=function(){try{if(!/\.svg/i.test(e)&&s.readyState===2){var a=s.getResponseHeader("Content-Type");if(!a)throw new Error("Content type not found");var i=tn.parse(a).type;if(!(i==="image/svg+xml"||i==="text/plain"))throw new Error("Invalid content type: ".concat(i))}if(s.readyState===4){if(s.status===404||s.responseXML===null)throw new Error(Nt()?"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||Nt()&&s.status===0)n(null,s);else throw new Error("There was a problem injecting the SVG: "+s.status+" "+s.statusText)}}catch(o){if(s.abort(),o instanceof Error)n(o,s);else throw o}},s.open("GET",e),s.withCredentials=t,s.overrideMimeType&&s.overrideMimeType("text/xml"),s.send()},be={},Mt=function(e,t){be[e]=be[e]||[],be[e].push(t)},rn=function(e){for(var t=function(i,o){setTimeout(function(){if(Array.isArray(be[e])){var c=je.get(e),l=be[e][i];c instanceof SVGSVGElement&&l(null,Sr(c)),c instanceof Error&&l(c),i===be[e].length-1&&delete be[e]}},0)},n=0,s=be[e].length;n<s;n++)t(n)},nn=function(e,t,n){if(je.has(e)){var s=je.get(e);if(s===void 0){Mt(e,n);return}if(s instanceof SVGSVGElement){n(null,Sr(s));return}}je.set(e,void 0),Mt(e,n),wr(e,t,function(a,i){var o;a?je.set(e,a):((o=i.responseXML)===null||o===void 0?void 0:o.documentElement)instanceof SVGSVGElement&&je.set(e,i.responseXML.documentElement),rn(e)})},sn=function(e,t,n){wr(e,t,function(s,a){var i;s?n(s):((i=a.responseXML)===null||i===void 0?void 0:i.documentElement)instanceof SVGSVGElement&&n(null,a.responseXML.documentElement)})},an=0,on=function(){return++an},me=[],Ft={},ln="http://www.w3.org/2000/svg",ft="http://www.w3.org/1999/xlink",Vt=function(e,t,n,s,a,i,o){var c=e.getAttribute("data-src")||e.getAttribute("src");if(!c){o(new Error("Invalid data-src or src attribute"));return}if(me.indexOf(e)!==-1){me.splice(me.indexOf(e),1),e=null;return}me.push(e),e.setAttribute("src","");var l=s?nn:sn;l(c,a,function(f,u){if(!u){me.splice(me.indexOf(e),1),e=null,o(f);return}var d=e.getAttribute("id");d&&u.setAttribute("id",d);var p=e.getAttribute("title");p&&u.setAttribute("title",p);var m=e.getAttribute("width");m&&u.setAttribute("width",m);var g=e.getAttribute("height");g&&u.setAttribute("height",g);var b=Array.from(new Set(ut(ut(ut([],(u.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();u.setAttribute("class",b);var E=e.getAttribute("style");E&&u.setAttribute("style",E),u.setAttribute("data-src",c);var w=[].filter.call(e.attributes,function(B){return/^data-\w[\w-]*$/.test(B.name)});if(Array.prototype.forEach.call(w,function(B){B.name&&B.value&&u.setAttribute(B.name,B.value)}),n){var T={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,v,D,$,C;Object.keys(T).forEach(function(B){S=B,D=T[B],v=u.querySelectorAll(S+"[id]");for(var N=function(P,j){$=v[P].id,C=$+"-"+on();var A;Array.prototype.forEach.call(D,function(U){A=u.querySelectorAll("["+U+'*="'+$+'"]');for(var X=0,te=A.length;X<te;X++){var re=A[X].getAttribute(U);re&&!re.match(new RegExp('url\\("?#'+$+'"?\\)'))||A[X].setAttribute(U,"url(#"+C+")")}});for(var V=u.querySelectorAll("[*|href]"),Y=[],M=0,J=V.length;M<J;M++){var H=V[M].getAttributeNS(ft,"href");H&&H.toString()==="#"+v[P].id&&Y.push(V[M])}for(var se=0,L=Y.length;se<L;se++)Y[se].setAttributeNS(ft,"href","#"+C);v[P].id=C},h=0,x=v.length;h<x;h++)N(h)})}u.removeAttribute("xmlns:a");for(var k=u.querySelectorAll("script"),I=[],_,F,W=0,q=k.length;W<q;W++)F=k[W].getAttribute("type"),(!F||F==="application/ecmascript"||F==="application/javascript"||F==="text/javascript")&&(_=k[W].innerText||k[W].textContent,_&&I.push(_),u.removeChild(k[W]));if(I.length>0&&(t==="always"||t==="once"&&!Ft[c])){for(var Z=0,K=I.length;Z<K;Z++)new Function(I[Z])(window);Ft[c]=!0}var z=u.querySelectorAll("style");if(Array.prototype.forEach.call(z,function(B){B.textContent+=""}),u.setAttribute("xmlns",ln),u.setAttribute("xmlns:xlink",ft),i(u),!e.parentNode){me.splice(me.indexOf(e),1),e=null,o(new Error("Parent node is null"));return}e.parentNode.replaceChild(u,e),me.splice(me.indexOf(e),1),e=null,o(null,u)})},cn=function(e,t){var n=t===void 0?{}:t,s=n.afterAll,a=s===void 0?function(){}:s,i=n.afterEach,o=i===void 0?function(){}:i,c=n.beforeEach,l=c===void 0?function(){}:c,f=n.cacheRequests,u=f===void 0?!0:f,d=n.evalScripts,p=d===void 0?"never":d,m=n.httpRequestWithCredentials,g=m===void 0?!1:m,b=n.renumerateIRIElements,E=b===void 0?!0:b;if(e&&"length"in e)for(var w=0,T=0,S=e.length;T<S;T++)Vt(e[T],p,E,u,g,l,function(v,D){o(v,D),e&&"length"in e&&e.length===++w&&a(w)});else e?Vt(e,p,E,u,g,l,function(v,D){o(v,D),a(1),e=null}):a(0)},He={exports:{}},Ge={exports:{}},Q={};/** @license React v16.13.1
|
|
27
27
|
* react-is.production.min.js
|
|
28
28
|
*
|
|
29
29
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
30
|
*
|
|
31
31
|
* This source code is licensed under the MIT license found in the
|
|
32
32
|
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var
|
|
33
|
+
*/var Yt;function un(){if(Yt)return Q;Yt=1;var r=typeof Symbol=="function"&&Symbol.for,e=r?Symbol.for("react.element"):60103,t=r?Symbol.for("react.portal"):60106,n=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,i=r?Symbol.for("react.provider"):60109,o=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,l=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,u=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,p=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,E=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function T(v){if(typeof v=="object"&&v!==null){var D=v.$$typeof;switch(D){case e:switch(v=v.type,v){case c:case l:case n:case a:case s:case u:return v;default:switch(v=v&&v.$$typeof,v){case o:case f:case m:case p:case i:return v;default:return D}}case t:return D}}}function S(v){return T(v)===l}return Q.AsyncMode=c,Q.ConcurrentMode=l,Q.ContextConsumer=o,Q.ContextProvider=i,Q.Element=e,Q.ForwardRef=f,Q.Fragment=n,Q.Lazy=m,Q.Memo=p,Q.Portal=t,Q.Profiler=a,Q.StrictMode=s,Q.Suspense=u,Q.isAsyncMode=function(v){return S(v)||T(v)===c},Q.isConcurrentMode=S,Q.isContextConsumer=function(v){return T(v)===o},Q.isContextProvider=function(v){return T(v)===i},Q.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===e},Q.isForwardRef=function(v){return T(v)===f},Q.isFragment=function(v){return T(v)===n},Q.isLazy=function(v){return T(v)===m},Q.isMemo=function(v){return T(v)===p},Q.isPortal=function(v){return T(v)===t},Q.isProfiler=function(v){return T(v)===a},Q.isStrictMode=function(v){return T(v)===s},Q.isSuspense=function(v){return T(v)===u},Q.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===n||v===l||v===a||v===s||v===u||v===d||typeof v=="object"&&v!==null&&(v.$$typeof===m||v.$$typeof===p||v.$$typeof===i||v.$$typeof===o||v.$$typeof===f||v.$$typeof===b||v.$$typeof===E||v.$$typeof===w||v.$$typeof===g)},Q.typeOf=T,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
|
|
40
|
+
*/var Ut;function fn(){return Ut||(Ut=1,process.env.NODE_ENV!=="production"&&function(){var r=typeof Symbol=="function"&&Symbol.for,e=r?Symbol.for("react.element"):60103,t=r?Symbol.for("react.portal"):60106,n=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,i=r?Symbol.for("react.provider"):60109,o=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,l=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,u=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,p=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116,g=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,E=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function T(L){return typeof L=="string"||typeof L=="function"||L===n||L===l||L===a||L===s||L===u||L===d||typeof L=="object"&&L!==null&&(L.$$typeof===m||L.$$typeof===p||L.$$typeof===i||L.$$typeof===o||L.$$typeof===f||L.$$typeof===b||L.$$typeof===E||L.$$typeof===w||L.$$typeof===g)}function S(L){if(typeof L=="object"&&L!==null){var U=L.$$typeof;switch(U){case e:var X=L.type;switch(X){case c:case l:case n:case a:case s:case u:return X;default:var te=X&&X.$$typeof;switch(te){case o:case f:case m:case p:case i:return te;default:return U}}case t:return U}}}var v=c,D=l,$=o,C=i,k=e,I=f,_=n,F=m,W=p,q=t,Z=a,K=s,z=u,B=!1;function N(L){return B||(B=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),h(L)||S(L)===c}function h(L){return S(L)===l}function x(L){return S(L)===o}function O(L){return S(L)===i}function P(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function j(L){return S(L)===f}function A(L){return S(L)===n}function V(L){return S(L)===m}function Y(L){return S(L)===p}function M(L){return S(L)===t}function J(L){return S(L)===a}function H(L){return S(L)===s}function se(L){return S(L)===u}ee.AsyncMode=v,ee.ConcurrentMode=D,ee.ContextConsumer=$,ee.ContextProvider=C,ee.Element=k,ee.ForwardRef=I,ee.Fragment=_,ee.Lazy=F,ee.Memo=W,ee.Portal=q,ee.Profiler=Z,ee.StrictMode=K,ee.Suspense=z,ee.isAsyncMode=N,ee.isConcurrentMode=h,ee.isContextConsumer=x,ee.isContextProvider=O,ee.isElement=P,ee.isForwardRef=j,ee.isFragment=A,ee.isLazy=V,ee.isMemo=Y,ee.isPortal=M,ee.isProfiler=J,ee.isStrictMode=H,ee.isSuspense=se,ee.isValidElementType=T,ee.typeOf=S}()),ee}var Wt;function Er(){return Wt||(Wt=1,process.env.NODE_ENV==="production"?Ge.exports=un():Ge.exports=fn()),Ge.exports}/*
|
|
41
41
|
object-assign
|
|
42
42
|
(c) Sindre Sorhus
|
|
43
43
|
@license MIT
|
|
44
|
-
*/var
|
|
45
|
-
Valid keys: `+JSON.stringify(Object.keys(h),null," "));var k=se(Y,H,R,A,V+"."+H,t);if(k)return k}return null}return x(b)}function q(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(q);if(h===null||o(h))return!0;var b=l(h);if(b){var T=b.call(h),_;if(b!==h.entries){for(;!(_=T.next()).done;)if(!q(_.value))return!1}else for(;!(_=T.next()).done;){var R=_.value;if(R&&!q(R[1]))return!1}}else return!1;return!0;default:return!1}}function Z(h,b){return h==="symbol"?!0:b?b["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&b instanceof Symbol:!1}function K(h){var b=typeof h;return Array.isArray(h)?"array":h instanceof RegExp?"object":Z(b,h)?"symbol":b}function z(h){if(typeof h>"u"||h===null)return""+h;var b=K(h);if(b==="object"){if(h instanceof Date)return"date";if(h instanceof RegExp)return"regexp"}return b}function B(h){var b=z(h);switch(b){case"array":case"object":return"an "+b;case"boolean":case"date":case"regexp":return"a "+b;default:return b}}function I(h){return!h.constructor||!h.constructor.name?p:h.constructor.name}return d.checkPropTypes=s,d.resetWarningCache=s.resetWarningCache,d.PropTypes=d,d},ft}var dt,Ht;function un(){if(Ht)return dt;Ht=1;var r=St();function e(){}function t(){}return t.resetWarningCache=e,dt=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},dt}var Gt;function fn(){if(Gt)return Ye.exports;if(Gt=1,process.env.NODE_ENV!=="production"){var r=vr(),e=!0;Ye.exports=cn()(r.isElement,e)}else Ye.exports=un()();return Ye.exports}var ie=fn(),dn=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},pn=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},hn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],We="http://www.w3.org/2000/svg",qt="http://www.w3.org/1999/xlink",je=function(r){function e(){for(var n,s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];return n=r.call.apply(r,[this].concat(a))||this,n.initialState={hasError:!1,isLoading:!0},n.state=n.initialState,n._isMounted=!1,n.reactWrapper=void 0,n.nonReactWrapper=void 0,n.refCallback=function(o){n.reactWrapper=o},n}Kr(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof dn(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,y=this.props.afterInjection,x=this.props.wrapper,w,E;x==="svg"?(w=document.createElementNS(We,x),w.setAttribute("xmlns",We),w.setAttribute("xmlns:xlink",qt),E=document.createElementNS(We,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($,C){if($){O($);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{y(C)}catch(L){O(L)}})},v=function($){if($.setAttribute("role","img"),i){var C=$.querySelector(":scope > desc");C&&$.removeChild(C);var L=document.createElement("desc");L.innerHTML=i,$.prepend(L)}if(l){var N=$.querySelector(":scope > title");N&&$.removeChild(N);var j=document.createElement("title");j.innerHTML=l,$.prepend(j)}try{m($)}catch(F){O(F)}};nn(E,{afterEach:S,beforeEach:v,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;pn(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=qr(s,hn),c=o;return Ne.createElement(c,Qe({},u,{ref:this.refCallback},o==="svg"?{xmlns:We,xmlnsXlink:qt}:{}),this.state.isLoading&&i&&Ne.createElement(i,null),this.state.hasError&&a&&Ne.createElement(a,null))},e}(Ne.Component);je.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};je.propTypes={afterInjection:ie.func,beforeInjection:ie.func,desc:ie.string,evalScripts:ie.oneOf(["always","once","never"]),fallback:ie.oneOfType([ie.func,ie.object,ie.string]),httpRequestWithCredentials:ie.bool,loading:ie.oneOfType([ie.func,ie.object,ie.string]),onError:ie.func,renumerateIRIElements:ie.bool,src:ie.string.isRequired,title:ie.string,useRequestCache:ie.bool,wrapper:ie.oneOf(["div","span","svg"])};let gt={assets:"/"};const mn=r=>{gt={...gt,...r}},Kt=r=>`${gt.assets}/${r}`.replace(/\/+/g,"/"),oe=D.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]=D.useState(r),y=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),x=y&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),w=Kt(`assets/svg/${r}.svg`),E=Kt(`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()},v=P=>{!a&&c&&(P.key==="Enter"||P.key===" ")&&(P.preventDefault(),S())};return g.jsx(g.Fragment,{children:x?g.jsx(je,{src:r,fallback:()=>g.jsx(je,{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:v,tabIndex:p}):y?g.jsx("img",{src:d,width:e||"16px",height:t||"auto",alt:l,onError:()=>m(E),onClick:S,className:O.img,title:l,onKeyDown:P=>{(P.key==="Enter"||P.key===" ")&&S()}}):g.jsx(je,{src:w,fallback:()=>g.jsx(je,{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:v,tabIndex:p})})}),he={"smp-textfield-wrapper":"_smp-textfield-wrapper_mmttf_4","smp-textfield":"_smp-textfield_mmttf_4","smp-textfield-extraSmall":"_smp-textfield-extraSmall_mmttf_30","smp-textfield-small":"_smp-textfield-small_mmttf_35","smp-textfield-medium":"_smp-textfield-medium_mmttf_40","smp-textfield-large":"_smp-textfield-large_mmttf_45","smp-textfield-extraLarge":"_smp-textfield-extraLarge_mmttf_50","smp-textfield-input":"_smp-textfield-input_mmttf_56","smp-textfield-outlined":"_smp-textfield-outlined_mmttf_79","smp-textfield-danger":"_smp-textfield-danger_mmttf_90","smp-textfield-readOnly":"_smp-textfield-readOnly_mmttf_94","smp-textfield-variant-notSelectable":"_smp-textfield-variant-notSelectable_mmttf_99","smp-textfield-disabled":"_smp-textfield-disabled_mmttf_109","smp-textfield-fullWidth":"_smp-textfield-fullWidth_mmttf_118"},Ee=({disabled:r,bindValue:e,icon:t,onBlur:n,onChange:s,placeholder:a,isEditable:i=!0,shapeIcon:o,sizing:u,state:c,variant:f,rotatedShapeIcon:l=!1,onShapeIconClick:p,ref:d,inputRef:m,onKeyDown:y,inputType:x="text",ariaLabel:w="input field",label:E,helperText:O=!1,error:S,appearance:v="base",fullWidth:P=!1,_dataComponent:$="textfield",width:C})=>{const L=D.useId(),N=`${L}-helper`,j=S?"danger":c,F=S||c=="danger"?"error":o,W=O||!!S,q=z=>{s==null||s(z.target.value)},Z={wrapper:`${he["smp-textfield-wrapper"]} ${P?he["smp-textfield-fullWidth"]:""}`,container:`${he["smp-textfield"]} ${r?he["smp-textfield-disabled"]:""} ${a?he["smp-textfield-placeholder"]:""} ${u?he[`smp-textfield-${u}`]:""} ${j?he[`smp-textfield-${j}`]:""} ${v?he[`smp-textfield-${v}`]:""} ${i?"":he["smp-textfield-readOnly"]}`,input:`${he["smp-textfield-input"]}`};if(f&&(f!=="notSelectable"||i)){const z=he[`smp-textfield-variant-${f}`];z&&(Z.container+=` ${z}`)}const K=C?{"--smp-textField-width-base":C}:void 0;return g.jsxs("div",{className:Z.wrapper,"data-component":$,children:[E&&g.jsx(De,{label:E,disabled:r,htmlFor:L}),g.jsxs("div",{className:Z.container,ref:d,style:K,children:[t&&g.jsx(oe,{icon:t,disabled:r}),g.jsx("input",{id:L,type:x,value:e,placeholder:a,onChange:q,onBlur:n,className:Z.input,disabled:r,readOnly:!i,onKeyDown:y,"aria-label":w,ref:m,"aria-describedby":W?N:void 0}),F&&g.jsx(oe,{icon:F,disabled:r,state:j,onClick:p,rotated:l,isInteractable:i,tabIndex:0})]}),W&&g.jsx(mr,{helperText:S,disabled:r,state:j,id:N})]})};function xr({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=D.useState(0),i=D.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=D.useCallback(d=>{const m=d.target.scrollTop;a(m)},[]),p=d=>{if(!i.current)return;const m=d*e,y=m+e,x=i.current,w=x.scrollTop,E=w+t;m<w?x.scrollTop=m:y>E&&(x.scrollTop=y-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 Be={"smp-list":"_smp-list_t8eqj_1","smp-list-container":"_smp-list-container_t8eqj_10","smp-list-listItem":"_smp-list-listItem_t8eqj_15"},gn=10,Sr=({id:r,options:e,displayMode:t,ref:n,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:u,onKeyDown:c})=>{var N;const[f,l]=D.useState(""),p=24,[d,m]=D.useState(a!==null?a:-1),y=s!==void 0?s:e.length>gn,x=f?e.filter(j=>j.label.toLowerCase().includes(f.toLowerCase())):e,w=j=>{l(j)},{virtualItems:E,containerProps:O,innerProps:S,scrollToIndex:v}=xr({items:x,itemHeight:p,containerHeight:200,overscan:5});D.useEffect(()=>{a!==null&&a!==d&&m(a)},[a]),D.useEffect(()=>{d>=0&&d<x.length&&v(d)},[d,x]);const P=j=>{if(j.key==="ArrowDown"||j.key==="ArrowUp"){j.preventDefault();let F=d;j.key==="ArrowDown"?F=d<x.length-1?d+1:0:j.key==="ArrowUp"&&(F=d>0?d-1:x.length-1),m(F)}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=>{P(j)},C=j=>{P(j)},L={wrapper:`${Be["smp-list"]}`,container:`${Be["smp-list-container"]}`,virtualScroll:`${Be["smp-list-virtualScroll"]}`,listItem:`${Be["smp-list-listItem"]}`};return g.jsxs("div",{id:r,ref:n,className:L.wrapper,"data-component":"list",style:{width:o},children:[y&&g.jsx(Ee,{bindValue:f,placeholder:"Search...",onChange:w,onKeyDown:$}),g.jsx("div",{...O,className:L.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:C,"aria-activedescendant":d>=0&&d<x.length?(N=x[d])==null?void 0:N.id:void 0,children:g.jsx("div",{...S,className:L.virtualScroll,children:E.map(({item:j,index:F,offsetTop:W})=>{const q=i.includes(j.id);return g.jsxs("li",{role:"option",id:j.id,"aria-selected":d===F?"true":"false",tabIndex:-1,className:`${L.listItem} ${d===F?"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(F)},children:[Ae(j.id,j.label,t),q&&g.jsx(oe,{icon:"check",width:16})]},j.id)})})})]})},wr=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=D.useState(Ae(e,t,r));return D.useEffect(()=>{a(e)},[e]),D.useEffect(()=>{a(Ae(e,t,r))},[t,r]),g.jsx(Ee,{...n,bindValue:s})},yn=r=>{const e=D.useRef(null);return D.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},r)}};function wt({children:r}){const[e,t]=D.useState(!1);return D.useEffect(()=>{t(!0)},[]),e?Ir.createPortal(r,document.body):null}const Et=({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,y]=D.useState(r),[x,w]=D.useState(e),[E,O]=D.useState(!1),[S,v]=D.useState(t||[]),[P,$]=D.useState(0),[C,L]=D.useState([r]),{anchorRef:N,targetRef:j,anchorWidth:F}=xt({position:"bottom",enabled:E});Ze(j,()=>O(!1));const W=yn(400),q=B=>{B.length>=a?u&&l&&W(async()=>{const I=await l(u,B);v(I),$(I.length>0?0:-1),O(!0)}):O(!1),y(B),w(e),c||f==null||f(B,e)},Z=B=>{c?(y(""),w("")):(y(B.id),w(B.label)),f==null||f(B.id,B.label);const I=S.findIndex(h=>h.id===B.id);$(I),L([B.id]),O(!1)},K=B=>{B.key==="Escape"&&(O(!1),$(-1))},z=B=>{if((B.key==="ArrowDown"||B.key==="ArrowUp")&&(B.preventDefault(),E)){const I=B.key==="ArrowDown"?(P+1)%S.length:(P-1+S.length)%S.length;$(I)}switch(B.key){case"Enter":P>=0&&P<S.length?Z(S[P]):c&&(f==null||f(m,""),O(!1),y(""),w(""));break;case"Escape":O(!1),$(-1);break}};return g.jsxs("div",{"data-component":"autocomplete",children:[g.jsx(wr,{...d,bindValue:m,optionalDisplayValue:x,displayMode:n,isEditable:i,shapeIcon:"magnify",placeholder:o,ref:N,onChange:q,onKeyDown:z,"aria-autocomplete":"list"}),E&&g.jsx(wt,{children:g.jsx(Sr,{options:S,displayMode:s,onClick:Z,ref:j,selectedIndex:P,activeIndex:p||C,width:F,showFilter:!1,onKeyDown:K})})]})},zt=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],Jt=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],Se=({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 y={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 g.jsx("button",{"data-component":"button",className:y.container,onClick:e,"aria-label":t,disabled:s,"aria-busy":l,title:d||r||m,children:l?g.jsx(oe,{icon:"spinner",state:Jt(i),spin:!0}):g.jsxs(g.Fragment,{children:[n&&u&&g.jsx(oe,{icon:n,disabled:s,state:Jt(i),width:zt(a),height:zt(a)}),c&&m&&g.jsx("span",{children:m})]})})},Er=({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,y]=D.useState(r);D.useEffect(()=>{!m&&d&&e&&d(e,void 0).then(E=>y(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 g.jsx(Se,{...S},`button-${O}`)});return g.jsx("div",{role:"list","data-component":"button-list",className:x.container,children:w})},vn={"smp-checkbox-wrapper":"_smp-checkbox-wrapper_z14lq_2"},Tr=({bindValue:r,_dataComponent:e="checkbox",disabled:t,label:n,isEditable:s=!0,onChange:a,onBlur:i,variant:o="checkbox"})=>{const u=D.useId(),c=l=>{s&&a&&a(l.target.checked)},f={wrapper:`${vn["smp-checkbox-wrapper"]}`};return g.jsxs("div",{className:f.wrapper,"data-component":e,children:[n&&g.jsx(De,{label:n,disabled:t,htmlFor:u}),g.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:c,onBlur:i,role:o==="switch"?"switch":"checkbox",id:u})]})},bn={titleLarge:"h2",title:"h3",body:"h6",label:"label"},Le=({variant:r="body",bindValue:e,color:t,...n})=>{const s=bn[r],a={container:`smp-typography ${r?`smp-typography-${r}`:""} ${n.disabled?"smp-typography-disabled":""}`};return g.jsx(s,{className:a.container,disabled:n.disabled,style:{"--smp-typography-color-base":t},children:e})},Tt=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,u]=D.useState(null),c={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},f=d=>{n==null||n(r.filter((m,y)=>y!==d))},l=d=>{u(d)},p=d=>{if(o===null||o===d)return;const m=[...r],[y]=m.splice(o,1);m.splice(d,0,y),n==null||n(m),u(null)};return g.jsx("div",{className:c.container,role:"list","data-component":"chip",children:r.flatMap((d,m)=>{const y=Ae(d.bindValue,d.optionalDisplayValue,t),x=g.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&&g.jsx(oe,{icon:"drag_indicator_horizontal",isInteractable:!0}),g.jsx(Le,{variant:"label",bindValue:y,color:s}),e&&g.jsx(oe,{icon:"close",isInteractable:!0,onClick:()=>f(m),color:s})]},`chip-${m}`),w=i&&m<r.length-1?g.jsx(oe,{icon:"chevron-right",color:s},`separator-${m}`):null;return[x,w].filter(Boolean)})})};function Or(r,e){const t=D.useRef(null);D.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 Rr=({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]=D.useState(!1),[d,m]=D.useState(t),[y,x]=D.useState(-1),[w,E]=D.useState([r]),O=D.useId(),{anchorRef:S,targetRef:v,anchorWidth:P}=xt({position:"bottom",enabled:l});Ze(v,()=>p(!1)),Or(l,v);const $=j=>{e==null||e(j.id,j.label);const F=d.findIndex(W=>W.id===j.id);x(F),E([j.id]),p(!1)},C=j=>{j.key==="Escape"&&(p(!1),x(-1))},L=j=>{(j.key==="ArrowDown"||j.key==="ArrowUp")&&(j.preventDefault(),N())},N=()=>{o&&u&&u(o,void 0).then(j=>{m(j),x(j.length>0?0:-1),p(!0)})};return g.jsxs("div",{role:"combobox","aria-expanded":l,"aria-controls":O,"aria-owns":O,"data-component":"combobox",children:[g.jsx(wr,{...f,bindValue:r,optionalDisplayValue:n,displayMode:a,onShapeIconClick:N,onKeyDown:L,shapeIcon:"arrow_drop_down",rotatedShapeIcon:l,isEditable:s,ref:S,"aria-autocomplete":"list",variant:"notSelectable"}),l&&g.jsx(wt,{children:g.jsx(Sr,{id:O,options:d,displayMode:i,ref:v,selectedIndex:y,activeIndex:c||w,width:P,onClick:$,onKeyDown:C})})]})},G=r=>typeof r=="string",Ce=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},Xt=r=>r==null?"":""+r,xn=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},Sn=/###/g,Zt=r=>r&&r.indexOf("###")>-1?r.replace(Sn,"."):r,Qt=r=>!r||G(r),Pe=(r,e,t)=>{const n=G(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])}},er=(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},wn=(r,e,t,n)=>{const{obj:s,k:a}=Pe(r,e,Object);s[a]=s[a]||[],s[a].push(t)},et=(r,e)=>{const{obj:t,k:n}=Pe(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},En=(r,e,t)=>{const n=et(r,t);return n!==void 0?n:et(e,t)},jr=(r,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?G(r[n])||r[n]instanceof String||G(e[n])||e[n]instanceof String?t&&(r[n]=e[n]):jr(r[n],e[n],t):r[n]=e[n]);return r},Oe=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Tn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const On=r=>G(r)?r.replace(/[&<>"'\/]/g,e=>Tn[e]):r;class Rn{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 jn=[" ",",","?","!",";"],Dn=new Rn(20),_n=(r,e,t)=>{e=e||"",t=t||"";const n=jn.filter(i=>e.indexOf(i)<0&&t.indexOf(i)<0);if(n.length===0)return!0;const s=Dn.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},yt=(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},ke=r=>r==null?void 0:r.replace("_","-"),$n={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 tt{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||$n,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,s){return s&&!this.debug?null:(G(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new tt(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new tt(this.logger,e)}}var ge=new tt;class nt{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 tr extends nt{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):G(n)&&a?o.push(...n.split(a)):o.push(n)));const u=et(this.data,o);return!u&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),u||!i||!G(n)?u:yt((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),er(this.data,o,s),a.silent||this.emit("added",e,t,n,s)}addResources(e,t,n,s={silent:!1}){for(const a in n)(G(n[a])||Array.isArray(n[a]))&&this.addResource(e,t,a,n[a],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,a,i={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),s=n,n=t,t=o[1]),this.addNamespaces(t);let u=et(this.data,o)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?jr(u,n,a):u={...u,...n},er(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 Dr={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 rr={},nr=r=>!G(r)&&typeof r!="boolean"&&typeof r!="number";class rt extends nt{constructor(e,t={}){super(),xn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ge.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(e==null)return!1;const s=this.resolve(e,n);return(s==null?void 0:s.res)!==void 0}extractFromKey(e,t){let n=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const s=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let a=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!_n(e,n,s);if(i&&!o){const u=e.match(this.interpolator.nestingRegexp);if(u&&u.length>0)return{key:e,namespaces:G(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:G(a)?[a]:a}}translate(e,t,n){let s=typeof t=="object"?{...t}:t;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(s={...s}),s||(s={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const a=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:o,namespaces: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 y=(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&&!G(s.count),v=rt.hasDefaultValue(s),P=S?this.pluralResolver.getSuffix(l,s.count,s):"",$=s.ordinal&&S?this.pluralResolver.getSuffix(l,s.count,{ordinal:!1}):"",C=S&&!s.ordinal&&s.count===0,L=C&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${P}`]||s[`defaultValue${$}`]||s.defaultValue;let N=m;O&&!m&&v&&(N=L);const j=nr(N),F=Object.prototype.toString.apply(N);if(O&&N&&j&&w.indexOf(F)<0&&!(G(E)&&Array.isArray(N))){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(y,N,{...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(N),q=W?[]:{},Z=W?x:y;for(const K in N)if(Object.prototype.hasOwnProperty.call(N,K)){const z=`${Z}${i}${K}`;v&&!m?q[K]=this.translate(z,{...s,defaultValue:nr(L)?L[K]:void 0,joinArrays:!1,ns:u}):q[K]=this.translate(z,{...s,joinArrays:!1,ns:u}),q[K]===z&&(q[K]=N[K])}m=q}}else if(O&&G(E)&&Array.isArray(m))m=m.join(E),m&&(m=this.extendTranslation(m,e,s,n));else{let W=!1,q=!1;!this.isValidLookup(m)&&v&&(W=!0,m=L),this.isValidLookup(m)||(q=!0,m=o);const K=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&q?void 0:m,z=v&&L!==m&&this.options.updateMissing;if(q||W||z){if(this.logger.log(z?"updateKey":"missingKey",l,c,o,z?L:m),i){const b=this.resolve(o,{...s,keySeparator:!1});b&&b.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let B=[];const I=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&I&&I[0])for(let b=0;b<I.length;b++)B.push(I[b]);else this.options.saveMissingTo==="all"?B=this.languageUtils.toResolveHierarchy(s.lng||this.language):B.push(s.lng||this.language);const h=(b,T,_)=>{var A;const R=v&&_!==m?_:K;this.options.missingKeyHandler?this.options.missingKeyHandler(b,c,T,R,z,s):(A=this.backendConnector)!=null&&A.saveMissing&&this.backendConnector.saveMissing(b,c,T,R,z,s),this.emit("missingKey",b,c,T,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&S?B.forEach(b=>{const T=this.pluralResolver.getSuffixes(b,s);C&&s[`defaultValue${this.options.pluralSeparator}zero`]&&T.indexOf(`${this.options.pluralSeparator}zero`)<0&&T.push(`${this.options.pluralSeparator}zero`),T.forEach(_=>{h([b],o+_,s[`defaultValue${_}`]||L)})}):h(B,o,L))}m=this.extendTranslation(m,e,s,d,n),q&&m===o&&this.options.appendNamespaceToMissingKey&&(m=`${c}${f}${o}`),(q||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=G(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&&!G(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=G(i)?[i]:i;return e!=null&&(o!=null&&o.length)&&n.applyPostProcessor!==!1&&(e=Dr.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,s,a,i,o;return G(e)&&(e=[e]),e.forEach(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&&!G(t.count),d=p&&!t.ordinal&&t.count===0,m=t.context!==void 0&&(G(t.context)||typeof t.context=="number")&&t.context!=="",y=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);l.forEach(x=>{var w,E;this.isValidLookup(n)||(o=x,!rr[`${y[0]}-${x}`]&&((w=this.utils)!=null&&w.hasLoadedNamespace)&&!((E=this.utils)!=null&&E.hasLoadedNamespace(o))&&(rr[`${y[0]}-${x}`]=!0,this.logger.warn(`key "${s}" for languages "${y.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!!!")),y.forEach(O=>{var P;if(this.isValidLookup(n))return;i=O;const S=[f];if((P=this.i18nFormat)!=null&&P.addLookupKeys)this.i18nFormat.addLookupKeys(S,f,O,x,t);else{let $;p&&($=this.pluralResolver.getSuffix(O,t.count,t));const C=`${this.options.pluralSeparator}zero`,L=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(S.push(f+$),t.ordinal&&$.indexOf(L)===0&&S.push(f+$.replace(L,this.options.pluralSeparator)),d&&S.push(f+C)),m){const N=`${f}${this.options.contextSeparator}${t.context}`;S.push(N),p&&(S.push(N+$),t.ordinal&&$.indexOf(L)===0&&S.push(N+$.replace(L,this.options.pluralSeparator)),d&&S.push(N+C))}}let v;for(;v=S.pop();)this.isValidLookup(n)||(a=v,n=this.getResource(O,x,v,t))}))})}),{res:n,usedKey:s,exactUsedKey:a,usedLng:i,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,n,s={}){var a;return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!G(e.replace);let s=n?e.replace:e;if(n&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const a of t)delete s[a]}return s}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&e[n]!==void 0)return!0;return!1}}class sr{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ge.create("languageUtils")}getScriptPartFromCode(e){if(e=ke(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=ke(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(G(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(n=>{if(t)return;const s=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(s))&&(t=s)}),!t&&this.options.supportedLngs&&e.forEach(n=>{if(t)return;const s=this.getScriptPartFromCode(n);if(this.isSupportedCode(s))return t=s;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return t=a;t=this.options.supportedLngs.find(i=>{if(i===a)return i;if(!(i.indexOf("-")<0&&a.indexOf("-")<0)&&(i.indexOf("-")>0&&a.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===a||i.indexOf(a)===0&&a.length>1))return i})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),G(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),s=[],a=i=>{i&&(this.isSupportedCode(i)?s.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return G(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):G(e)&&a(this.formatLanguageCode(e)),n.forEach(i=>{s.indexOf(i)<0&&a(this.formatLanguageCode(i))}),s}}const ar={zero:0,one:1,two:2,few:3,many:4,other:5},ir={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Cn{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=ge.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=ke(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!"),ir;if(!e.match(/-|_/))return ir;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)=>ar[s]-ar[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 or=(r,e,t,n=".",s=!0)=>{let a=En(r,e,t);return!a&&s&&G(t)&&(a=yt(r,t,n),a===void 0&&(a=yt(e,t,n))),a},pt=r=>r.replace(/\$/g,"$$$$");class Pn{constructor(e={}){var t;this.logger=ge.create("interpolator"),this.options=e,this.format=((t=e==null?void 0:e.interpolation)==null?void 0:t.format)||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:a,prefixEscaped:i,suffix:o,suffixEscaped:u,formatSeparator:c,unescapeSuffix:f,unescapePrefix:l,nestingPrefix:p,nestingPrefixEscaped:d,nestingSuffix:m,nestingSuffixEscaped:y,nestingOptionsSeparator:x,maxReplaces:w,alwaysFormat:E}=e.interpolation;this.escape=t!==void 0?t:On,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?Oe(a):i||"{{",this.suffix=o?Oe(o):u||"}}",this.formatSeparator=c||",",this.unescapePrefix=f?"":l||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=p?Oe(p):d||Oe("$t("),this.nestingSuffix=m?Oe(m):y||Oe(")"),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=or(t,u,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,n,{...s,...t,interpolationkey:m}):E}const y=m.split(this.formatSeparator),x=y.shift().trim(),w=y.join(this.formatSeparator).trim();return this.format(or(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=>pt(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?pt(this.escape(m)):pt(m)}].forEach(m=>{for(o=0;a=m.regex.exec(e);){const y=a[1].trim();if(i=c(y),i===void 0)if(typeof f=="function"){const w=f(e,a,s);i=G(w)?w:""}else if(s&&Object.prototype.hasOwnProperty.call(s,y))i="";else if(l){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${e}`),i="";else!G(i)&&!this.useRawValueToEscape&&(i=Xt(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(y){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,y),`${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&&!G(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&&!G(a))return a;G(a)||(a=Xt(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 An=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}},lr=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(ke(n),s),e[i]=o),o(t)}},Ln=r=>(e,t,n)=>r(ke(t),n)(e);class kn{constructor(e={}){this.logger=ge.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?lr:Ln;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()]=lr(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}=An(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 In=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class Nn extends nt{constructor(e,t,n,s={}){var a,i;super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=ge.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(i=(a=this.backend)==null?void 0:a.init)==null||i.call(a,n,s.backend,s)}queueLoad(e,t,n,s){const a={},i={},o={},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=>{wn(u.loaded,[a],i),In(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();G(e)&&(e=this.languageUtils.toResolveHierarchy(e)),G(t)&&(t=[t]);const a=this.queueLoad(e,t,n,s);if(!a.toLoad.length)return a.pending.length||s(),null;a.toLoad.forEach(i=>{this.loadOne(i)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),s=n[0],a=n[1];this.read(s,a,"read",void 0,void 0,(i,o)=>{i&&this.logger.warn(`${t}loading namespace ${a} for language ${s} failed`,i),!i&&o&&this.logger.log(`${t}loaded namespace ${a} for language ${s}`,o),this.loaded(e,i,o)})}saveMissing(e,t,n,s,a,i={},o=()=>{}){var 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 y;m.length===5?y=m(e,t,n,s,d):y=m(e,t,n,s),y&&typeof y.then=="function"?y.then(x=>o(null,x)).catch(o):o(null,y)}catch(y){o(y)}else m(e,t,n,s,o,d)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const cr=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:r=>{let e={};if(typeof r[1]=="object"&&(e=r[1]),G(r[1])&&(e.defaultValue=r[1]),G(r[2])&&(e.tDescription=r[2]),typeof r[2]=="object"||typeof r[3]=="object"){const t=r[3]||r[2];Object.keys(t).forEach(n=>{e[n]=t[n]})}return e},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ur=r=>{var e,t;return G(r.ns)&&(r.ns=[r.ns]),G(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),G(r.fallbackNS)&&(r.fallbackNS=[r.fallbackNS]),((t=(e=r.supportedLngs)==null?void 0:e.indexOf)==null?void 0:t.call(e,"cimode"))<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),typeof r.initImmediate=="boolean"&&(r.initAsync=r.initImmediate),r},He=()=>{},Mn=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class Ie extends nt{constructor(e={},t){if(super(),this.options=ur(e),this.services={},this.logger=ge,this.modules={external:[]},Mn(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(G(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=cr();this.options={...n,...this.options,...ur(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?ge.init(s(this.modules.logger),this.options):ge.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=kn;const f=new sr(this.options);this.store=new tr(this.options.resources,this.options);const l=this.services;l.logger=ge,l.resourceStore=this.store,l.languageUtils=f,l.pluralResolver=new Cn(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 Pn(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new Nn(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 rt(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=He),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=Ce(),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=He){var a,i;let n=t;const s=G(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const o=[],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=Ce();return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=He),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"&&Dr.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t<this.languages.length;t++){const n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=Ce();this.emit("languageChanging",e);const s=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},a=(o,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=G(o)?o:o&&o[0],c=this.store.hasLanguageSomeTranslations(u)?u:this.services.languageUtils.getBestMatchFromCodes(G(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 G(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=n,s}t(...e){var t;return(t=this.translator)==null?void 0:t.translate(...e)}exists(...e){var t;return(t=this.translator)==null?void 0:t.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const i=(o,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=Ce();return this.options.ns?(G(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{n.resolve(),t&&t(s)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Ce();G(e)&&(e=[e]);const s=this.options.preload||[],a=e.filter(i=>s.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return a.length?(this.options.preload=s.concat(a),this.loadResources(i=>{n.resolve(),t&&t(i)}),n):(t&&t(),Promise.resolve())}dir(e){var s,a;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((a=this.services)==null?void 0:a.languageUtils)||new sr(cr());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new Ie(e,t)}cloneInstance(e={},t=He){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new Ie(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 tr(o,s),a.services.resourceStore=a.store}return a.translator=new rt(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=Ie.createInstance();ae.createInstance=Ie.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 Fn={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"},Vn={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},Yn={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando"},Un={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:Fn,Month:Vn,Generic:Yn},Wn={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"},Bn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},Hn={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command"},Gn={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:Wn,Month:Bn,Generic:Hn};function fr(r,e){return new RegExp(qn(r),e)}function qn(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Kn(r,e,t,n){let s=e;const a=zn(r,t);if(!s){const o=Math.abs(a);o-Math.floor(o)?s="0,0.00":s="0,0"}const i=Jn(s);return new Intl.NumberFormat(n,i).format(a)}function zn(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(fr(u,"g"),""),a=a.replace(fr(o,"g"),"."),a=Number(a)}const i=Number(a);return isNaN(i)?NaN:i}function Jn(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 Kn(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:Gn},it:{translation:Un}}});const Xn=(r,e,t,n)=>ae.format(r,e,t||ae.language,n),Zn=(r,e)=>ae.t(r,e);function st(){const r=D.useCallback((n,s,a,i)=>Xn(n,s,a||void 0,i),[]),e=D.useCallback(()=>ae.languages[0],[]),t=D.useCallback((n,s)=>Zn(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var Ot=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r))(Ot||{}),le=(r=>(r.MONDAY="Day.Monday",r.MONDAY_SHORT="Day.MondayShort",r.TUESDAY="Day.Tuesday",r.TUESDAY_SHORT="Day.TuesdayShort",r.WEDNESDAY="Day.Wednesday",r.WEDNESDAY_SHORT="Day.WednesdayShort",r.THURSDAY="Day.Thursday",r.THURSDAY_SHORT="Day.ThursdayShort",r.FRIDAY="Day.Friday",r.FRIDAY_SHORT="Day.FridayShort",r.SATURDAY="Day.Saturday",r.SATURDAY_SHORT="Day.SaturdayShort",r.SUNDAY="Day.Sunday",r.SUNDAY_SHORT="Day.SundayShort",r))(le||{}),ue=(r=>(r.JANUARY="Month.January",r.FEBRUARY="Month.February",r.MARCH="Month.March",r.APRIL="Month.April",r.MAY="Month.May",r.JUNE="Month.June",r.JULY="Month.July",r.AUGUST="Month.August",r.SEPTEMBER="Month.September",r.OCTOBER="Month.October",r.NOVEMBER="Month.November",r.DECEMBER="Month.December",r))(ue||{}),vt=(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))(vt||{});const Qn={"smp-datepickercalendar-position":"_smp-datepickercalendar-position_19hwj_1"};function es({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=st(),i=()=>{if(!n)return;const I=new Date(n);return isNaN(I.getTime())?void 0:I},[o]=D.useState(new Date),[u,c]=D.useState(r||i()||new Date),[f,l]=D.useState(u?u.getMonth():new Date().getMonth()),[p,d]=D.useState(u?u.getFullYear():new Date().getFullYear()),[m,y]=D.useState(u?u.getDate():null),x=D.useRef(null),w=D.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(le.SUNDAY_SHORT),full:a(le.SUNDAY)},{value:a(le.MONDAY_SHORT),full:a(le.MONDAY)},{value:a(le.TUESDAY_SHORT),full:a(le.TUESDAY)},{value:a(le.WEDNESDAY_SHORT),full:a(le.WEDNESDAY)},{value:a(le.THURSDAY_SHORT),full:a(le.THURSDAY)},{value:a(le.FRIDAY_SHORT),full:a(le.FRIDAY)},{value:a(le.SATURDAY_SHORT),full:a(le.SATURDAY)}],S=I=>t.some(h=>{const b=h.start.getTime(),T=h.end.getTime(),_=I.getTime();return _>=b&&_<=T}),v=I=>{S(I)||(c(I),y(I.getDate()),e&&e(Gr(I)))},P=()=>{f===0?(l(11),d(p-1)):l(f-1),y(1)},$=()=>{f===11?(l(0),d(p+1)):l(f+1),y(1)},C=(I,h)=>new Date(I,h+1,0).getDate(),L=(I,h)=>new Date(I,h,1).getDay(),N=I=>{var b;const h=q.findIndex(T=>T!==null&&T.getDate()===I);h!==-1&&w.current[h]&&((b=w.current[h])==null||b.focus(),y(I))},j=(I,h)=>{const b=q[h];if(!b)return;const T=C(p,f),_=b.getDate();switch(I.key){case"ArrowRight":I.preventDefault();{let R=_+1,A=new Date(p,f,R);if(R>T){const V=f===11?p+1:p,Y=f===11?0:f+1;R=1,A=new Date(V,Y,R),$(),setTimeout(()=>{F(1,"forward")},0);return}S(A)?F(R,"forward"):N(R)}break;case"Tab":break;case"ArrowLeft":I.preventDefault();{let R=_-1,A=new Date(p,f,R);if(R<1){const V=f===0?p-1:p,Y=f===0?11:f-1,M=C(V,Y);R=M,A=new Date(V,Y,R),P(),setTimeout(()=>{F(M,"backward")},0);return}S(A)?F(R,"backward"):N(R)}break;case"ArrowUp":I.preventDefault();{let R=_-7,A=new Date(p,f,R);if(R<1){const V=f===0?p-1:p,Y=f===0?11:f-1;R=C(V,Y)+R,A=new Date(V,Y,R),P(),setTimeout(()=>{F(R,"backward")},0);return}S(A)?F(R,"backward"):N(R)}break;case"ArrowDown":I.preventDefault();{let R=_+7,A=new Date(p,f,R);if(R>T){const V=f===11?p+1:p,Y=f===11?0:f+1;R=R-T,A=new Date(V,Y,R),$(),setTimeout(()=>{F(R,"forward")},0);return}S(A)?F(R,"forward"):N(R)}break;case"Home":I.preventDefault(),F(1,"forward");break;case"End":I.preventDefault(),F(T,"backward");break;case"PageUp":I.preventDefault(),P(),setTimeout(()=>{const R=C(f===0?p-1:p,f===0?11:f-1),A=Math.min(_,R);F(A,"forward")},0);break;case"PageDown":I.preventDefault(),$(),setTimeout(()=>{const R=C(f===11?p+1:p,f===11?0:f+1),A=Math.min(_,R);F(A,"forward")},0);break;case" ":case"Space":if(S(b))return;y(b.getDate()),c(b);break;case"Enter":I.preventDefault(),v(b);break}},F=(I,h)=>{const b=C(p,f);if(h==="forward"){for(let T=I;T<=b;T++){const _=new Date(p,f,T);if(!S(_)){N(T);return}}$(),setTimeout(()=>{F(1,"forward")},0)}else{for(let A=I;A>=1;A--){const V=new Date(p,f,A);if(!S(V)){N(A);return}}const T=f===0?p-1:p,_=f===0?11:f-1,R=C(T,_);P(),setTimeout(()=>{F(R,"backward")},0)}},q=(()=>{const I=C(p,f),h=L(p,f),b=[];for(let T=0;T<h;T++)b.push(null);for(let T=1;T<=I;T++){const _=new Date(p,f,T);b.push(_)}return b})(),Z=[];let K=[];q.forEach((I,h)=>{if(K.push(I),K.length===7||h===q.length-1){for(;K.length<7;)K.push(null);Z.push(K),K=[]}}),D.useEffect(()=>{var I;if(m!==null){const h=q.findIndex(b=>b!==null&&b.getDate()===m);h!==-1&&w.current[h]&&((I=w.current[h])==null||I.focus())}},[f,p,m,q]);const z={label:"smp-datepickercalendar-label",wrapper:`smp-datepickercalendar ${Qn["smp-datepickercalendar-position"]}`,calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(I,h,b,T)=>`smp-datepickercalendar-td
|
|
46
|
-
${
|
|
44
|
+
*/var dt,Bt;function dn(){if(Bt)return dt;Bt=1;var r=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function n(a){if(a==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}function s(){try{if(!Object.assign)return!1;var a=new String("abc");if(a[5]="de",Object.getOwnPropertyNames(a)[0]==="5")return!1;for(var i={},o=0;o<10;o++)i["_"+String.fromCharCode(o)]=o;var c=Object.getOwnPropertyNames(i).map(function(f){return i[f]});if(c.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(f){l[f]=f}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return dt=s()?Object.assign:function(a,i){for(var o,c=n(a),l,f=1;f<arguments.length;f++){o=Object(arguments[f]);for(var u in o)e.call(o,u)&&(c[u]=o[u]);if(r){l=r(o);for(var d=0;d<l.length;d++)t.call(o,l[d])&&(c[l[d]]=o[l[d]])}}return c},dt}var pt,Ht;function jt(){if(Ht)return pt;Ht=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return pt=r,pt}var ht,Gt;function Tr(){return Gt||(Gt=1,ht=Function.call.bind(Object.prototype.hasOwnProperty)),ht}var mt,qt;function pn(){if(qt)return mt;qt=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var e=jt(),t={},n=Tr();r=function(a){var i="Warning: "+a;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function s(a,i,o,c,l){if(process.env.NODE_ENV!=="production"){for(var f in a)if(n(a,f)){var u;try{if(typeof a[f]!="function"){var d=Error((c||"React class")+": "+o+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw d.name="Invariant Violation",d}u=a[f](i,f,c,o,null,e)}catch(m){u=m}if(u&&!(u instanceof Error)&&r((c||"React class")+": type specification of "+o+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in t)){t[u.message]=!0;var p=l?l():"";r("Failed "+o+" type: "+u.message+(p??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},mt=s,mt}var gt,Kt;function hn(){if(Kt)return gt;Kt=1;var r=Er(),e=dn(),t=jt(),n=Tr(),s=pn(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(o){var c="Warning: "+o;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function i(){return null}return gt=function(o,c){var l=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function u(h){var x=h&&(l&&h[l]||h[f]);if(typeof x=="function")return x}var d="<<anonymous>>",p={array:E("array"),bigint:E("bigint"),bool:E("boolean"),func:E("function"),number:E("number"),object:E("object"),string:E("string"),symbol:E("symbol"),any:w(),arrayOf:T,element:S(),elementType:v(),instanceOf:D,node:I(),objectOf:C,oneOf:$,oneOfType:k,shape:F,exact:W};function m(h,x){return h===x?h!==0||1/h===1/x:h!==h&&x!==x}function g(h,x){this.message=h,this.data=x&&typeof x=="object"?x:{},this.stack=""}g.prototype=Error.prototype;function b(h){if(process.env.NODE_ENV!=="production")var x={},O=0;function P(A,V,Y,M,J,H,se){if(M=M||d,H=H||Y,se!==t){if(c){var L=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 L.name="Invariant Violation",L}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var U=M+":"+Y;!x[U]&&O<3&&(a("You are manually calling a React.PropTypes validation function for the `"+H+"` prop on `"+M+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),x[U]=!0,O++)}}return V[Y]==null?A?V[Y]===null?new g("The "+J+" `"+H+"` is marked as required "+("in `"+M+"`, but its value is `null`.")):new g("The "+J+" `"+H+"` is marked as required in "+("`"+M+"`, but its value is `undefined`.")):null:h(V,Y,M,J,H)}var j=P.bind(null,!1);return j.isRequired=P.bind(null,!0),j}function E(h){function x(O,P,j,A,V,Y){var M=O[P],J=K(M);if(J!==h){var H=z(M);return new g("Invalid "+A+" `"+V+"` of type "+("`"+H+"` supplied to `"+j+"`, expected ")+("`"+h+"`."),{expectedType:h})}return null}return b(x)}function w(){return b(i)}function T(h){function x(O,P,j,A,V){if(typeof h!="function")return new g("Property `"+V+"` of component `"+j+"` has invalid PropType notation inside arrayOf.");var Y=O[P];if(!Array.isArray(Y)){var M=K(Y);return new g("Invalid "+A+" `"+V+"` of type "+("`"+M+"` supplied to `"+j+"`, expected an array."))}for(var J=0;J<Y.length;J++){var H=h(Y,J,j,A,V+"["+J+"]",t);if(H instanceof Error)return H}return null}return b(x)}function S(){function h(x,O,P,j,A){var V=x[O];if(!o(V)){var Y=K(V);return new g("Invalid "+j+" `"+A+"` of type "+("`"+Y+"` supplied to `"+P+"`, expected a single ReactElement."))}return null}return b(h)}function v(){function h(x,O,P,j,A){var V=x[O];if(!r.isValidElementType(V)){var Y=K(V);return new g("Invalid "+j+" `"+A+"` of type "+("`"+Y+"` supplied to `"+P+"`, expected a single ReactElement type."))}return null}return b(h)}function D(h){function x(O,P,j,A,V){if(!(O[P]instanceof h)){var Y=h.name||d,M=N(O[P]);return new g("Invalid "+A+" `"+V+"` of type "+("`"+M+"` supplied to `"+j+"`, expected ")+("instance of `"+Y+"`."))}return null}return b(x)}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 x(O,P,j,A,V){for(var Y=O[P],M=0;M<h.length;M++)if(m(Y,h[M]))return null;var J=JSON.stringify(h,function(se,L){var U=z(L);return U==="symbol"?String(L):L});return new g("Invalid "+A+" `"+V+"` of value `"+String(Y)+"` "+("supplied to `"+j+"`, expected one of "+J+"."))}return b(x)}function C(h){function x(O,P,j,A,V){if(typeof h!="function")return new g("Property `"+V+"` of component `"+j+"` has invalid PropType notation inside objectOf.");var Y=O[P],M=K(Y);if(M!=="object")return new g("Invalid "+A+" `"+V+"` of type "+("`"+M+"` supplied to `"+j+"`, expected an object."));for(var J in Y)if(n(Y,J)){var H=h(Y,J,j,A,V+"."+J,t);if(H instanceof Error)return H}return null}return b(x)}function k(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 x=0;x<h.length;x++){var O=h[x];if(typeof O!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+B(O)+" at index "+x+"."),i}function P(j,A,V,Y,M){for(var J=[],H=0;H<h.length;H++){var se=h[H],L=se(j,A,V,Y,M,t);if(L==null)return null;L.data&&n(L.data,"expectedType")&&J.push(L.data.expectedType)}var U=J.length>0?", expected one of type ["+J.join(", ")+"]":"";return new g("Invalid "+Y+" `"+M+"` supplied to "+("`"+V+"`"+U+"."))}return b(P)}function I(){function h(x,O,P,j,A){return q(x[O])?null:new g("Invalid "+j+" `"+A+"` supplied to "+("`"+P+"`, expected a ReactNode."))}return b(h)}function _(h,x,O,P,j){return new g((h||"React class")+": "+x+" type `"+O+"."+P+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+j+"`.")}function F(h){function x(O,P,j,A,V){var Y=O[P],M=K(Y);if(M!=="object")return new g("Invalid "+A+" `"+V+"` of type `"+M+"` "+("supplied to `"+j+"`, expected `object`."));for(var J in h){var H=h[J];if(typeof H!="function")return _(j,A,V,J,z(H));var se=H(Y,J,j,A,V+"."+J,t);if(se)return se}return null}return b(x)}function W(h){function x(O,P,j,A,V){var Y=O[P],M=K(Y);if(M!=="object")return new g("Invalid "+A+" `"+V+"` of type `"+M+"` "+("supplied to `"+j+"`, expected `object`."));var J=e({},O[P],h);for(var H in J){var se=h[H];if(n(h,H)&&typeof se!="function")return _(j,A,V,H,z(se));if(!se)return new g("Invalid "+A+" `"+V+"` key `"+H+"` supplied to `"+j+"`.\nBad object: "+JSON.stringify(O[P],null," ")+`
|
|
45
|
+
Valid keys: `+JSON.stringify(Object.keys(h),null," "));var L=se(Y,H,j,A,V+"."+H,t);if(L)return L}return null}return b(x)}function q(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(q);if(h===null||o(h))return!0;var x=u(h);if(x){var O=x.call(h),P;if(x!==h.entries){for(;!(P=O.next()).done;)if(!q(P.value))return!1}else for(;!(P=O.next()).done;){var j=P.value;if(j&&!q(j[1]))return!1}}else return!1;return!0;default:return!1}}function Z(h,x){return h==="symbol"?!0:x?x["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&x instanceof Symbol:!1}function K(h){var x=typeof h;return Array.isArray(h)?"array":h instanceof RegExp?"object":Z(x,h)?"symbol":x}function z(h){if(typeof h>"u"||h===null)return""+h;var x=K(h);if(x==="object"){if(h instanceof Date)return"date";if(h instanceof RegExp)return"regexp"}return x}function B(h){var x=z(h);switch(x){case"array":case"object":return"an "+x;case"boolean":case"date":case"regexp":return"a "+x;default:return x}}function N(h){return!h.constructor||!h.constructor.name?d:h.constructor.name}return p.checkPropTypes=s,p.resetWarningCache=s.resetWarningCache,p.PropTypes=p,p},gt}var yt,zt;function mn(){if(zt)return yt;zt=1;var r=jt();function e(){}function t(){}return t.resetWarningCache=e,yt=function(){function n(i,o,c,l,f,u){if(u!==r){var d=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw d.name="Invariant Violation",d}}n.isRequired=n;function s(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:s,element:n,elementType:n,instanceOf:s,node:n,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:e};return a.PropTypes=a,a},yt}var Jt;function gn(){if(Jt)return He.exports;if(Jt=1,process.env.NODE_ENV!=="production"){var r=Er(),e=!0;He.exports=hn()(r.isElement,e)}else He.exports=mn()();return He.exports}var ie=gn(),yn=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},vn=function(e,t){for(var n in e)if(!(n in t))return!0;for(var s in t)if(e[s]!==t[s])return!0;return!1},bn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],qe="http://www.w3.org/2000/svg",Xt="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}Qr(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof yn(this.reactWrapper).Node){var a=this.props,i=a.desc,o=a.evalScripts,c=a.httpRequestWithCredentials,l=a.renumerateIRIElements,f=a.src,u=a.title,d=a.useRequestCache,p=this.props.onError,m=this.props.beforeInjection,g=this.props.afterInjection,b=this.props.wrapper,E,w;b==="svg"?(E=document.createElementNS(qe,b),E.setAttribute("xmlns",qe),E.setAttribute("xmlns:xlink",Xt),w=document.createElementNS(qe,b)):(E=document.createElement(b),w=document.createElement(b)),E.appendChild(w),w.dataset.src=f,this.nonReactWrapper=this.reactWrapper.appendChild(E);var T=function($){if(s.removeSVG(),!s._isMounted){p($);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){p($)})},S=function($,C){if($){T($);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{g(C)}catch(k){T(k)}})},v=function($){if($.setAttribute("role","img"),i){var C=$.querySelector(":scope > desc");C&&$.removeChild(C);var k=document.createElement("desc");k.innerHTML=i,$.prepend(k)}if(u){var I=$.querySelector(":scope > title");I&&$.removeChild(I);var _=document.createElement("title");_.innerHTML=u,$.prepend(_)}try{m($)}catch(F){T(F)}};cn(w,{afterEach:S,beforeEach:v,cacheRequests:d,evalScripts:o,httpRequestWithCredentials:c,renumerateIRIElements:l})}},t.removeSVG=function(){var s;(s=this.nonReactWrapper)!=null&&s.parentNode&&(this.nonReactWrapper.parentNode.removeChild(this.nonReactWrapper),this.nonReactWrapper=null)},t.componentDidMount=function(){this._isMounted=!0,this.renderSVG()},t.componentDidUpdate=function(s){var a=this;vn(tt({},s),this.props)&&this.setState(function(){return a.initialState},function(){a.removeSVG(),a.renderSVG()})},t.componentWillUnmount=function(){this._isMounted=!1,this.removeSVG()},t.render=function(){var s=this.props;s.afterInjection,s.beforeInjection,s.desc,s.evalScripts;var a=s.fallback;s.httpRequestWithCredentials;var i=s.loading;s.renumerateIRIElements,s.src,s.title,s.useRequestCache;var o=s.wrapper,c=Zr(s,bn),l=o;return Ye.createElement(l,tt({},c,{ref:this.refCallback},o==="svg"?{xmlns:qe,xmlnsXlink:Xt}:{}),this.state.isLoading&&i&&Ye.createElement(i,null),this.state.hasError&&a&&Ye.createElement(a,null))},e}(Ye.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 St={assets:"/"};const xn=r=>{St={...St,...r}},Zt=r=>`${St.assets}/${r}`.replace(/\/+/g,"/"),oe=R.memo(({icon:r,width:e,height:t,placeholderIcon:n,color:s,disabled:a,state:i="base",rotated:o=!1,onClick:c,isInteractable:l=!1,spin:f=!1,title:u,tabIndex:d})=>{const[p,m]=R.useState(r),g=(r==null?void 0:r.startsWith("http"))||(r==null?void 0:r.startsWith("/")),b=g&&(r==null?void 0:r.toLowerCase().endsWith(".svg")),E=Zt(`assets/svg/${r}.svg`),w=Zt(`assets/svg/${n}.svg`),T={img:`${l?"smp-image-interactable":""}`,svg:`smp-icon ${i?`smp-icon-${i}`:""} ${o?"smp-icon-rotated":""} ${l?"smp-icon-interactable":""} ${f?"smp-icon-spin":""}`},S=()=>{!a&&l&&c&&c()},v=D=>{!a&&l&&(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),S())};return y.jsx(y.Fragment,{children:b?y.jsx(Re,{src:r,fallback:()=>y.jsx(Re,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:T.svg,onClick:S,onKeyDown:v,tabIndex:d}):g?y.jsx("img",{src:p,width:e||"16px",height:t||"auto",alt:u,onError:()=>m(w),onClick:S,className:T.img,title:u,onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&S()}}):y.jsx(Re,{src:E,fallback:()=>y.jsx(Re,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:T.svg,onClick:S,onKeyDown:v,tabIndex:d})})}),he={"smp-textfield-wrapper":"_smp-textfield-wrapper_mmttf_4","smp-textfield":"_smp-textfield_mmttf_4","smp-textfield-extraSmall":"_smp-textfield-extraSmall_mmttf_30","smp-textfield-small":"_smp-textfield-small_mmttf_35","smp-textfield-medium":"_smp-textfield-medium_mmttf_40","smp-textfield-large":"_smp-textfield-large_mmttf_45","smp-textfield-extraLarge":"_smp-textfield-extraLarge_mmttf_50","smp-textfield-input":"_smp-textfield-input_mmttf_56","smp-textfield-outlined":"_smp-textfield-outlined_mmttf_79","smp-textfield-danger":"_smp-textfield-danger_mmttf_90","smp-textfield-readOnly":"_smp-textfield-readOnly_mmttf_94","smp-textfield-variant-notSelectable":"_smp-textfield-variant-notSelectable_mmttf_99","smp-textfield-disabled":"_smp-textfield-disabled_mmttf_109","smp-textfield-fullWidth":"_smp-textfield-fullWidth_mmttf_118"},xe=({disabled:r,bindValue:e,icon:t,onBlur:n,onChange:s,placeholder:a,isEditable:i=!0,shapeIcon:o,sizing:c,state:l,variant:f,rotatedShapeIcon:u=!1,onShapeIconClick:d,ref:p,inputRef:m,onKeyDown:g,inputType:b="text",ariaLabel:E="input field",label:w,helperText:T=!1,error:S,appearance:v="base",fullWidth:D=!1,_dataComponent:$="textfield",width:C})=>{const k=R.useId(),I=`${k}-helper`,_=S?"danger":l,F=S||l=="danger"?"error":o,W=T||!!S,q=z=>{s==null||s(z.target.value)},Z={wrapper:`${he["smp-textfield-wrapper"]} ${D?he["smp-textfield-fullWidth"]:""}`,container:`${he["smp-textfield"]} ${r?he["smp-textfield-disabled"]:""} ${a?he["smp-textfield-placeholder"]:""} ${c?he[`smp-textfield-${c}`]:""} ${_?he[`smp-textfield-${_}`]:""} ${v?he[`smp-textfield-${v}`]:""} ${i?"":he["smp-textfield-readOnly"]}`,input:`${he["smp-textfield-input"]}`};if(f&&(f!=="notSelectable"||i)){const z=he[`smp-textfield-variant-${f}`];z&&(Z.container+=` ${z}`)}const K=C?{"--smp-textField-width-base":C}:void 0;return y.jsxs("div",{className:Z.wrapper,"data-component":$,children:[w&&y.jsx(De,{label:w,disabled:r,htmlFor:k}),y.jsxs("div",{className:Z.container,ref:p,style:K,children:[t&&y.jsx(oe,{icon:t,disabled:r}),y.jsx("input",{id:k,type:b,value:e,placeholder:a,onChange:q,onBlur:n,className:Z.input,disabled:r,readOnly:!i,onKeyDown:g,"aria-label":E,ref:m,"aria-describedby":W?I:void 0}),F&&y.jsx(oe,{icon:F,disabled:r,state:_,onClick:d,rotated:u,isInteractable:i,tabIndex:0})]}),W&&y.jsx(xr,{helperText:S,disabled:r,state:_,id:I})]})};function Or({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=R.useState(0),i=R.useRef(null),o=r.length*e,c=Math.max(0,Math.floor(s/e)-n),l=Math.min(r.length-1,Math.floor((s+t)/e)+n),f=[];for(let p=c;p<=l;p++)f.push({item:r[p],index:p,offsetTop:p*e});const u=R.useCallback(p=>{const m=p.target.scrollTop;a(m)},[]),d=p=>{if(!i.current)return;const m=p*e,g=m+e,b=i.current,E=b.scrollTop,w=E+t;m<E?b.scrollTop=m:g>w&&(b.scrollTop=g-t)};return{virtualItems:f,containerProps:{ref:i,style:{maxHeight:`${t}px`,overflowY:"auto",position:"relative",willChange:"transform"},onScroll:u},innerProps:{style:{height:`${o}px`,position:"relative",width:"100%"}},scrollInfo:{scrollTop:s,viewportHeight:t,totalHeight:o,startIndex:c,endIndex:l},scrollToIndex:d}}const Ke={"smp-list":"_smp-list_t8eqj_1","smp-list-container":"_smp-list-container_t8eqj_10","smp-list-listItem":"_smp-list-listItem_t8eqj_15"},Sn=10,jr=({id:r,options:e,displayMode:t,ref:n,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:c,onKeyDown:l})=>{var I;const[f,u]=R.useState(""),d=24,[p,m]=R.useState(a!==null?a:-1),g=s!==void 0?s:e.length>Sn,b=f?e.filter(_=>_.label.toLowerCase().includes(f.toLowerCase())):e,E=_=>{u(_)},{virtualItems:w,containerProps:T,innerProps:S,scrollToIndex:v}=Or({items:b,itemHeight:d,containerHeight:200,overscan:5});R.useEffect(()=>{a!==null&&a!==p&&m(a)},[a]),R.useEffect(()=>{p>=0&&p<b.length&&v(p)},[p,b]);const D=_=>{if(_.key==="ArrowDown"||_.key==="ArrowUp"){_.preventDefault();let F=p;_.key==="ArrowDown"?F=p<b.length-1?p+1:0:_.key==="ArrowUp"&&(F=p>0?p-1:b.length-1),m(F)}else _.key==="Enter"?p>=0&&p<b.length&&(c==null||c(b[p])):_.key==="Escape"&&(_.preventDefault(),_.stopPropagation());l&&l(_)},$=_=>{D(_)},C=_=>{D(_)},k={wrapper:`${Ke["smp-list"]}`,container:`${Ke["smp-list-container"]}`,virtualScroll:`${Ke["smp-list-virtualScroll"]}`,listItem:`${Ke["smp-list-listItem"]}`};return y.jsxs("div",{id:r,ref:n,className:k.wrapper,"data-component":"list",style:{width:o},children:[g&&y.jsx(xe,{bindValue:f,placeholder:"Search...",onChange:E,onKeyDown:$}),y.jsx("div",{...T,className:k.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:C,"aria-activedescendant":p>=0&&p<b.length?(I=b[p])==null?void 0:I.id:void 0,children:y.jsx("div",{...S,className:k.virtualScroll,children:w.map(({item:_,index:F,offsetTop:W})=>{const q=i.includes(_.id);return y.jsxs("li",{role:"option",id:_.id,"aria-selected":p===F?"true":"false",tabIndex:-1,className:`${k.listItem} ${p===F?"selected-item":""}`,"aria-label":_.id+"-"+_.label,style:{height:`${d}px`,lineHeight:`calc(${d}px - 2*2px)`,transform:`translateY(${W}px)`},onClick:()=>{c==null||c(_),m(F)},children:[Le(_.id,_.label,t),q&&y.jsx(oe,{icon:"check",width:16})]},_.id)})})})]})},Rr=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=R.useState(Le(e,t,r));return R.useEffect(()=>{a(e)},[e]),R.useEffect(()=>{a(Le(e,t,r))},[t,r]),y.jsx(xe,{...n,bindValue:s})},wn=r=>{const e=R.useRef(null);return R.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),n=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{n()},r)}};function ot({children:r}){const[e,t]=R.useState(!1);return R.useEffect(()=>{t(!0)},[]),e?Fr.createPortal(r,document.body):null}const Rt=({bindValue:r,optionalDisplayValue:e,options:t,displayMode:n,listDisplayMode:s="Both",minimumChars:a=3,isEditable:i=!0,placeholder:o,fun:c,_changeOnEnter:l=!1,onChange:f,onOptionsRequest:u,_multiActiveIndex:d,...p})=>{const[m,g]=R.useState(r),[b,E]=R.useState(e),[w,T]=R.useState(!1),[S,v]=R.useState(t||[]),[D,$]=R.useState(0),[C,k]=R.useState([r]),{anchorRef:I,targetRef:_,anchorWidth:F}=it({position:"bottom",enabled:w});ke(_,()=>T(!1));const W=wn(400),q=B=>{B.length>=a?c&&u&&W(async()=>{const N=await u(c,B);v(N),$(N.length>0?0:-1),T(!0)}):T(!1),g(B),E(e),l||f==null||f(B,e)},Z=B=>{l?(g(""),E("")):(g(B.id),E(B.label)),f==null||f(B.id,B.label);const N=S.findIndex(h=>h.id===B.id);$(N),k([B.id]),T(!1)},K=B=>{B.key==="Escape"&&(T(!1),$(-1))},z=B=>{if((B.key==="ArrowDown"||B.key==="ArrowUp")&&(B.preventDefault(),w)){const N=B.key==="ArrowDown"?(D+1)%S.length:(D-1+S.length)%S.length;$(N)}switch(B.key){case"Enter":D>=0&&D<S.length?Z(S[D]):l&&(f==null||f(m,""),T(!1),g(""),E(""));break;case"Escape":T(!1),$(-1);break}};return y.jsxs("div",{"data-component":"autocomplete",children:[y.jsx(Rr,{...p,bindValue:m,optionalDisplayValue:b,displayMode:n,isEditable:i,shapeIcon:"magnify",placeholder:o,ref:I,onChange:q,onKeyDown:z,"aria-autocomplete":"list"}),w&&y.jsx(ot,{children:y.jsx(jr,{options:S,displayMode:s,onClick:Z,ref:_,selectedIndex:D,activeIndex:d||C,width:F,showFilter:!1,onKeyDown:K})})]})},Qt=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],er=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],we=({label:r,bindValue:e,onClick:t,ariaLabel:n,icon:s,disabled:a,sizing:i="base",variant:o="primary",appearance:c="raised",showIcon:l=!0,showText:f=!0,fullWidth:u=!1,loading:d=!1,justify:p="center",title:m,optionalDisplayValue:g})=>{const b={container:`smp-button smp-button-container ${i?`smp-button-${i}`:""} ${o?`smp-buttonVariant-${o}`:""} ${c?`smp-buttonType-${c}`:""} ${u?"smp-button-fullWidth":""} smp-justifyContent-${p}`};return y.jsx("button",{"data-component":"button",className:b.container,onClick:t,"aria-label":n,disabled:a,"aria-busy":d,title:m||r||g,children:d?y.jsx(oe,{icon:"spinner",state:er(o),spin:!0}):y.jsxs(y.Fragment,{children:[s&&l&&y.jsx(oe,{icon:s,disabled:a,state:er(o),width:Qt(i),height:Qt(i)}),f&&y.jsx("span",{children:g||e})]})})},Dr=({options:r,fun:e,direction:t="row",disposition:n="start",sizing:s,variant:a,appearance:i,showText:o,showIcon:c,fullWidth:l,disabled:f,justify:u,onClick:d,onOptionsRequest:p})=>{const[m,g]=R.useState(r);R.useEffect(()=>{!m&&p&&e&&p(e,void 0).then(w=>g(w)).catch(w=>{console.error("Errore nel caricamento delle opzioni per ButtonList",w)})},[m,e,p]);const b={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${n}`},E=m==null?void 0:m.map((w,T)=>{const S={bindValue:w.id,optionalDisplayValue:w.label,fun:w.fun,icon:w.icon,variant:a,appearance:i,showText:o,showIcon:c,fullWidth:l,disabled:f,sizing:s,justify:u,onClick:()=>{d==null||d(w.id,w.fun)}};return y.jsx(we,{...S},`button-${T}`)});return y.jsx("div",{role:"list","data-component":"button-list",className:b.container,children:E})},En={"smp-checkbox-wrapper":"_smp-checkbox-wrapper_z14lq_2"},_r=({bindValue:r,_dataComponent:e="checkbox",disabled:t,label:n,isEditable:s=!0,onChange:a,onBlur:i,variant:o="checkbox"})=>{const c=R.useId(),l=u=>{s&&a&&a(u.target.checked)},f={wrapper:`${En["smp-checkbox-wrapper"]}`};return y.jsxs("div",{className:f.wrapper,"data-component":e,children:[n&&y.jsx(De,{label:n,disabled:t,htmlFor:c}),y.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:l,onBlur:i,role:o==="switch"?"switch":"checkbox",id:c})]})},Tn={titleLarge:"h2",title:"h3",body:"h6",label:"label"},Ie=({variant:r="body",bindValue:e,color:t,...n})=>{const s=Tn[r],a={container:`smp-typography ${r?`smp-typography-${r}`:""} ${n.disabled?"smp-typography-disabled":""}`};return y.jsx(s,{className:a.container,disabled:n.disabled,style:{"--smp-typography-color-base":t},children:e})},Dt=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,c]=R.useState(null),l={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},f=p=>{n==null||n(r.filter((m,g)=>g!==p))},u=p=>{c(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),c(null)};return y.jsx("div",{className:l.container,role:"list","data-component":"chip",children:r.flatMap((p,m)=>{const g=Le(p.bindValue,p.optionalDisplayValue,t),b=y.jsxs("div",{className:l.element,role:"listitem",draggable:i,onDragStart:()=>u(m),onDragOver:w=>i&&w.preventDefault(),onDrop:()=>i&&d(m),style:{"--smp-chips-backgroundColor-base":a},children:[i&&y.jsx(oe,{icon:"drag_indicator_horizontal",isInteractable:!0}),y.jsx(Ie,{variant:"label",bindValue:g,color:s}),e&&y.jsx(oe,{icon:"close",isInteractable:!0,onClick:()=>f(m),color:s})]},`chip-${m}`),E=i&&m<r.length-1?y.jsx(oe,{icon:"chevron-right",color:s},`separator-${m}`):null;return[b,E].filter(Boolean)})})};function _t(r,e){const t=R.useRef(null);R.useEffect(()=>{if(!r)return;const n=typeof e=="object"&&e!==null&&"current"in e?e.current:null;if(!n)return;t.current=document.activeElement;const s=()=>n?Array.from(n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(l=>!l.hasAttribute("disabled")&&l.offsetParent!==null):[];(()=>{const l=s();l.length>0&&requestAnimationFrame(()=>l[0].focus())})();const i=l=>{if(l.key==="Escape"||l.key!=="Tab")return;const f=s();if(f.length===0)return;const u=f[0],d=f[f.length-1];l.shiftKey&&document.activeElement===u?(l.preventDefault(),d.focus()):!l.shiftKey&&document.activeElement===d&&(l.preventDefault(),u.focus())},o=l=>{if(n&&!n.contains(l.target)){l.preventDefault();const f=s();f.length>0&&f[0].focus()}};document.addEventListener("keydown",i),document.addEventListener("mousedown",o);const c=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",o),document.body.style.overflow=c,t.current&&requestAnimationFrame(()=>{var l;(l=t.current)==null||l.focus()})}},[r,e])}const $r=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,isEditable:s,displayMode:a,listDisplayMode:i="Both",fun:o,onOptionsRequest:c,multiActiveIndex:l,...f})=>{const[u,d]=R.useState(!1),[p,m]=R.useState(t),[g,b]=R.useState(-1),[E,w]=R.useState([r]),T=R.useId(),{anchorRef:S,targetRef:v,anchorWidth:D}=it({position:"bottom",enabled:u});ke(v,()=>d(!1)),_t(u,v);const $=_=>{e==null||e(_.id,_.label);const F=p.findIndex(W=>W.id===_.id);b(F),w([_.id]),d(!1)},C=_=>{_.key==="Escape"&&(d(!1),b(-1))},k=_=>{(_.key==="ArrowDown"||_.key==="ArrowUp")&&(_.preventDefault(),I())},I=()=>{o&&c&&c(o,void 0).then(_=>{m(_),b(_.length>0?0:-1),d(!0)})};return y.jsxs("div",{role:"combobox","aria-expanded":u,"aria-controls":T,"aria-owns":T,"data-component":"combobox",children:[y.jsx(Rr,{...f,bindValue:r,optionalDisplayValue:n,displayMode:a,onShapeIconClick:I,onKeyDown:k,shapeIcon:"arrow_drop_down",rotatedShapeIcon:u,isEditable:s,ref:S,"aria-autocomplete":"list",variant:"notSelectable"}),u&&y.jsx(ot,{children:y.jsx(jr,{id:T,options:p,displayMode:i,ref:v,selectedIndex:g,activeIndex:l||E,width:D,onClick:$,onKeyDown:C})})]})},G=r=>typeof r=="string",Ce=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},tr=r=>r==null?"":""+r,On=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},jn=/###/g,rr=r=>r&&r.indexOf("###")>-1?r.replace(jn,"."):r,nr=r=>!r||G(r),Ae=(r,e,t)=>{const n=G(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(nr(r))return{};const a=rr(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return nr(r)?{}:{obj:r,k:rr(n[s])}},sr=(r,e,t)=>{const{obj:n,k:s}=Ae(r,e,Object);if(n!==void 0||e.length===1){n[s]=t;return}let a=e[e.length-1],i=e.slice(0,e.length-1),o=Ae(r,i,Object);for(;o.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),o=Ae(r,i,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=t},Rn=(r,e,t,n)=>{const{obj:s,k:a}=Ae(r,e,Object);s[a]=s[a]||[],s[a].push(t)},rt=(r,e)=>{const{obj:t,k:n}=Ae(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},Dn=(r,e,t)=>{const n=rt(r,t);return n!==void 0?n:rt(e,t)},Cr=(r,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?G(r[n])||r[n]instanceof String||G(e[n])||e[n]instanceof String?t&&(r[n]=e[n]):Cr(r[n],e[n],t):r[n]=e[n]);return r},Oe=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var _n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const $n=r=>G(r)?r.replace(/[&<>"'\/]/g,e=>_n[e]):r;class Cn{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(t!==void 0)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const Pn=[" ",",","?","!",";"],An=new Cn(20),kn=(r,e,t)=>{e=e||"",t=t||"";const n=Pn.filter(i=>e.indexOf(i)<0&&t.indexOf(i)<0);if(n.length===0)return!0;const s=An.getRegExp(`(${n.map(i=>i==="?"?"\\?":i).join("|")})`);let a=!s.test(r);if(!a){const i=r.indexOf(t);i>0&&!s.test(r.substring(0,i))&&(a=!0)}return a},wt=(r,e,t=".")=>{if(!r)return;if(r[e])return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0;const n=e.split(t);let s=r;for(let a=0;a<n.length;){if(!s||typeof s!="object")return;let i,o="";for(let c=a;c<n.length;++c)if(c!==a&&(o+=t),o+=n[c],i=s[o],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&c<n.length-1)continue;a+=c-a+1;break}s=i}return s},Ne=r=>r==null?void 0:r.replace("_","-"),Ln={type:"logger",log(r){this.output("log",r)},warn(r){this.output("warn",r)},error(r){this.output("error",r)},output(r,e){var t,n;(n=(t=console==null?void 0:console[r])==null?void 0:t.apply)==null||n.call(t,console,e)}};class nt{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Ln,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,s){return s&&!this.debug?null:(G(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new nt(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new nt(this.logger,e)}}var ge=new nt;class lt{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const s=this.observers[n].get(t)||0;this.observers[n].set(t,s+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e,...t){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s(...t)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,a])=>{for(let i=0;i<a;i++)s.apply(s,[e,...t])})}}class ar extends lt{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,s={}){var l,f;const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,i=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,t],n&&(Array.isArray(n)?o.push(...n):G(n)&&a?o.push(...n.split(a)):o.push(n)));const c=rt(this.data,o);return!c&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),c||!i||!G(n)?c:wt((f=(l=this.data)==null?void 0:l[e])==null?void 0:f[t],n,a)}addResource(e,t,n,s,a={silent:!1}){const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let o=[e,t];n&&(o=o.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=e.split("."),s=t,t=o[1]),this.addNamespaces(t),sr(this.data,o,s),a.silent||this.emit("added",e,t,n,s)}addResources(e,t,n,s={silent:!1}){for(const a in n)(G(n[a])||Array.isArray(n[a]))&&this.addResource(e,t,a,n[a],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,a,i={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),s=n,n=t,t=o[1]),this.addNamespaces(t);let c=rt(this.data,o)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?Cr(c,n,a):c={...c,...n},sr(this.data,o,c),i.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return this.getResource(e,t)!==void 0}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(s=>t[s]&&Object.keys(t[s]).length>0)}toJSON(){return this.data}}var Pr={processors:{},addPostProcessor(r){this.processors[r.name]=r},handle(r,e,t,n,s){return r.forEach(a=>{var i;e=((i=this.processors[a])==null?void 0:i.process(e,t,n,s))??e}),e}};const ir={},or=r=>!G(r)&&typeof r!="boolean"&&typeof r!="number";class st extends lt{constructor(e,t={}){super(),On(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ge.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(e==null)return!1;const s=this.resolve(e,n);return(s==null?void 0:s.res)!==void 0}extractFromKey(e,t){let n=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const s=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let a=t.ns||this.options.defaultNS||[];const i=n&&e.indexOf(n)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!kn(e,n,s);if(i&&!o){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:G(a)?[a]:a};const l=e.split(n);(n!==s||n===s&&this.options.ns.indexOf(l[0])>-1)&&(a=l.shift()),e=l.join(s)}return{key:e,namespaces:G(a)?[a]:a}}translate(e,t,n){let s=typeof t=="object"?{...t}:t;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(s={...s}),s||(s={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const a=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:o,namespaces:c}=this.extractFromKey(e[e.length-1],s),l=c[c.length-1];let f=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;f===void 0&&(f=":");const u=s.lng||this.language,d=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((u==null?void 0:u.toLowerCase())==="cimode")return d?a?{res:`${l}${f}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:`${l}${f}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(s)}:o;const p=this.resolve(e,s);let m=p==null?void 0:p.res;const g=(p==null?void 0:p.usedKey)||o,b=(p==null?void 0:p.exactUsedKey)||o,E=["[object Number]","[object Function]","[object RegExp]"],w=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,T=!this.i18nFormat||this.i18nFormat.handleAsObject,S=s.count!==void 0&&!G(s.count),v=st.hasDefaultValue(s),D=S?this.pluralResolver.getSuffix(u,s.count,s):"",$=s.ordinal&&S?this.pluralResolver.getSuffix(u,s.count,{ordinal:!1}):"",C=S&&!s.ordinal&&s.count===0,k=C&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${D}`]||s[`defaultValue${$}`]||s.defaultValue;let I=m;T&&!m&&v&&(I=k);const _=or(I),F=Object.prototype.toString.apply(I);if(T&&I&&_&&E.indexOf(F)<0&&!(G(w)&&Array.isArray(I))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const W=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,I,{...s,ns:c}):`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(I),q=W?[]:{},Z=W?b:g;for(const K in I)if(Object.prototype.hasOwnProperty.call(I,K)){const z=`${Z}${i}${K}`;v&&!m?q[K]=this.translate(z,{...s,defaultValue:or(k)?k[K]:void 0,joinArrays:!1,ns:c}):q[K]=this.translate(z,{...s,joinArrays:!1,ns:c}),q[K]===z&&(q[K]=I[K])}m=q}}else if(T&&G(w)&&Array.isArray(m))m=m.join(w),m&&(m=this.extendTranslation(m,e,s,n));else{let W=!1,q=!1;!this.isValidLookup(m)&&v&&(W=!0,m=k),this.isValidLookup(m)||(q=!0,m=o);const K=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&q?void 0:m,z=v&&k!==m&&this.options.updateMissing;if(q||W||z){if(this.logger.log(z?"updateKey":"missingKey",u,l,o,z?k:m),i){const x=this.resolve(o,{...s,keySeparator:!1});x&&x.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let B=[];const N=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&N&&N[0])for(let x=0;x<N.length;x++)B.push(N[x]);else this.options.saveMissingTo==="all"?B=this.languageUtils.toResolveHierarchy(s.lng||this.language):B.push(s.lng||this.language);const h=(x,O,P)=>{var A;const j=v&&P!==m?P:K;this.options.missingKeyHandler?this.options.missingKeyHandler(x,l,O,j,z,s):(A=this.backendConnector)!=null&&A.saveMissing&&this.backendConnector.saveMissing(x,l,O,j,z,s),this.emit("missingKey",x,l,O,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&S?B.forEach(x=>{const O=this.pluralResolver.getSuffixes(x,s);C&&s[`defaultValue${this.options.pluralSeparator}zero`]&&O.indexOf(`${this.options.pluralSeparator}zero`)<0&&O.push(`${this.options.pluralSeparator}zero`),O.forEach(P=>{h([x],o+P,s[`defaultValue${P}`]||k)})}):h(B,o,k))}m=this.extendTranslation(m,e,s,p,n),q&&m===o&&this.options.appendNamespaceToMissingKey&&(m=`${l}${f}${o}`),(q||W)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${f}${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 c,l;if((c=this.i18nFormat)!=null&&c.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const f=G(e)&&(((l=n==null?void 0:n.interpolation)==null?void 0:l.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(f){const p=e.match(this.interpolator.nestingRegexp);u=p&&p.length}let d=n.replace&&!G(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,n.lng||this.language||s.usedLng,n),f){const p=e.match(this.interpolator.nestingRegexp),m=p&&p.length;u<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=G(i)?[i]:i;return e!=null&&(o!=null&&o.length)&&n.applyPostProcessor!==!1&&(e=Pr.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,s,a,i,o;return G(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(n))return;const l=this.extractFromKey(c,t),f=l.key;s=f;let u=l.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const d=t.count!==void 0&&!G(t.count),p=d&&!t.ordinal&&t.count===0,m=t.context!==void 0&&(G(t.context)||typeof t.context=="number")&&t.context!=="",g=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(b=>{var E,w;this.isValidLookup(n)||(o=b,!ir[`${g[0]}-${b}`]&&((E=this.utils)!=null&&E.hasLoadedNamespace)&&!((w=this.utils)!=null&&w.hasLoadedNamespace(o))&&(ir[`${g[0]}-${b}`]=!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(T=>{var D;if(this.isValidLookup(n))return;i=T;const S=[f];if((D=this.i18nFormat)!=null&&D.addLookupKeys)this.i18nFormat.addLookupKeys(S,f,T,b,t);else{let $;d&&($=this.pluralResolver.getSuffix(T,t.count,t));const C=`${this.options.pluralSeparator}zero`,k=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(S.push(f+$),t.ordinal&&$.indexOf(k)===0&&S.push(f+$.replace(k,this.options.pluralSeparator)),p&&S.push(f+C)),m){const I=`${f}${this.options.contextSeparator}${t.context}`;S.push(I),d&&(S.push(I+$),t.ordinal&&$.indexOf(k)===0&&S.push(I+$.replace(k,this.options.pluralSeparator)),p&&S.push(I+C))}}let v;for(;v=S.pop();)this.isValidLookup(n)||(a=v,n=this.getResource(T,b,v,t))}))})}),{res:n,usedKey:s,exactUsedKey:a,usedLng:i,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,n,s={}){var a;return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!G(e.replace);let s=n?e.replace:e;if(n&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const a of t)delete s[a]}return s}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&e[n]!==void 0)return!0;return!1}}class lr{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ge.create("languageUtils")}getScriptPartFromCode(e){if(e=Ne(e),!e||e.indexOf("-")<0)return null;const t=e.split("-");return t.length===2||(t.pop(),t[t.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(e=Ne(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(G(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(n=>{if(t)return;const s=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(s))&&(t=s)}),!t&&this.options.supportedLngs&&e.forEach(n=>{if(t)return;const s=this.getScriptPartFromCode(n);if(this.isSupportedCode(s))return t=s;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return t=a;t=this.options.supportedLngs.find(i=>{if(i===a)return i;if(!(i.indexOf("-")<0&&a.indexOf("-")<0)&&(i.indexOf("-")>0&&a.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===a||i.indexOf(a)===0&&a.length>1))return i})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),G(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),s=[],a=i=>{i&&(this.isSupportedCode(i)?s.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return G(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):G(e)&&a(this.formatLanguageCode(e)),n.forEach(i=>{s.indexOf(i)<0&&a(this.formatLanguageCode(i))}),s}}const cr={zero:0,one:1,two:2,few:3,many:4,other:5},ur={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class In{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=ge.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Ne(e==="dev"?"en":e),s=t.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:n,type:s});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let i;try{i=new Intl.PluralRules(n,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),ur;if(!e.match(/-|_/))return ur;const c=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(c,t)}return this.pluralRulesCache[a]=i,i}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),(n==null?void 0:n.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(s=>`${t}${s}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((s,a)=>cr[s]-cr[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 fr=(r,e,t,n=".",s=!0)=>{let a=Dn(r,e,t);return!a&&s&&G(t)&&(a=wt(r,t,n),a===void 0&&(a=wt(e,t,n))),a},vt=r=>r.replace(/\$/g,"$$$$");class Nn{constructor(e={}){var t;this.logger=ge.create("interpolator"),this.options=e,this.format=((t=e==null?void 0:e.interpolation)==null?void 0:t.format)||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:s,prefix:a,prefixEscaped:i,suffix:o,suffixEscaped:c,formatSeparator:l,unescapeSuffix:f,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:p,nestingSuffix:m,nestingSuffixEscaped:g,nestingOptionsSeparator:b,maxReplaces:E,alwaysFormat:w}=e.interpolation;this.escape=t!==void 0?t:$n,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?Oe(a):i||"{{",this.suffix=o?Oe(o):c||"}}",this.formatSeparator=l||",",this.unescapePrefix=f?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=d?Oe(d):p||Oe("$t("),this.nestingSuffix=m?Oe(m):g||Oe(")"),this.nestingOptionsSeparator=b||",",this.maxReplaces=E||1e3,this.alwaysFormat=w!==void 0?w:!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 c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},l=m=>{if(m.indexOf(this.formatSeparator)<0){const w=fr(t,c,m,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,n,{...s,...t,interpolationkey:m}):w}const g=m.split(this.formatSeparator),b=g.shift().trim(),E=g.join(this.formatSeparator).trim();return this.format(fr(t,c,b,this.options.keySeparator,this.options.ignoreJSONStructure),E,n,{...s,...t,interpolationkey:b})};this.resetRegExp();const f=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,u=((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=>vt(m)},{regex:this.regexp,safeValue:m=>this.escapeValue?vt(this.escape(m)):vt(m)}].forEach(m=>{for(o=0;a=m.regex.exec(e);){const g=a[1].trim();if(i=l(g),i===void 0)if(typeof f=="function"){const E=f(e,a,s);i=G(E)?E:""}else if(s&&Object.prototype.hasOwnProperty.call(s,g))i="";else if(u){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${e}`),i="";else!G(i)&&!this.useRawValueToEscape&&(i=tr(i));const b=m.safeValue(i);if(e=e.replace(a[0],b),u?(m.regex.lastIndex+=i.length,m.regex.lastIndex-=a[0].length):m.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let s,a,i;const o=(c,l)=>{const f=this.nestingOptionsSeparator;if(c.indexOf(f)<0)return c;const u=c.split(new RegExp(`${f}[ ]*{`));let d=`{${u[1]}`;c=u[0],d=this.interpolate(d,i);const 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),l&&(i={...l,...i})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,g),`${c}${f}${d}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,c};for(;s=this.nestingRegexp.exec(e);){let c=[];i={...n},i=i.replace&&!G(i.replace)?i.replace:i,i.applyPostProcessor=!1,delete i.defaultValue;let l=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){const f=s[1].split(this.formatSeparator).map(u=>u.trim());s[1]=f.shift(),c=f,l=!0}if(a=t(o.call(this,s[1].trim(),i),i),a&&s[0]===e&&!G(a))return a;G(a)||(a=tr(a)),a||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),a=""),l&&(a=c.reduce((f,u)=>this.format(f,u,n.lng,{...n,interpolationkey:s[1].trim()}),a.trim())),e=e.replace(s[0],a),this.regexp.lastIndex=0}return e}}const Mn=r=>{let e=r.toLowerCase().trim();const t={};if(r.indexOf("(")>-1){const n=r.split("(");e=n[0].toLowerCase().trim();const s=n[1].substring(0,n[1].length-1);e==="currency"&&s.indexOf(":")<0?t.currency||(t.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?t.range||(t.range=s.trim()):s.split(";").forEach(i=>{if(i){const[o,...c]=i.split(":"),l=c.join(":").trim().replace(/^'+|'+$/g,""),f=o.trim();t[f]||(t[f]=l),l==="false"&&(t[f]=!1),l==="true"&&(t[f]=!0),isNaN(l)||(t[f]=parseInt(l,10))}})}return{formatName:e,formatOptions:t}},dr=r=>{const e={};return(t,n,s)=>{let a=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(a={...a,[s.interpolationkey]:void 0});const i=n+JSON.stringify(a);let o=e[i];return o||(o=r(Ne(n),s),e[i]=o),o(t)}},Fn=r=>(e,t,n)=>r(Ne(t),n)(e);class Vn{constructor(e={}){this.logger=ge.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?dr:Fn;this.formats={number:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a});return o=>i.format(o)}),currency:n((s,a)=>{const i=new Intl.NumberFormat(s,{...a,style:"currency"});return o=>i.format(o)}),datetime:n((s,a)=>{const i=new Intl.DateTimeFormat(s,{...a});return o=>i.format(o)}),relativetime:n((s,a)=>{const i=new Intl.RelativeTimeFormat(s,{...a});return o=>i.format(o,a.range||"day")}),list:n((s,a)=>{const i=new Intl.ListFormat(s,{...a});return o=>i.format(o)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=dr(t)}format(e,t,n,s={}){const a=t.split(this.formatSeparator);if(a.length>1&&a[0].indexOf("(")>1&&a[0].indexOf(")")<0&&a.find(o=>o.indexOf(")")>-1)){const o=a.findIndex(c=>c.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,o)].join(this.formatSeparator)}return a.reduce((o,c)=>{var u;const{formatName:l,formatOptions:f}=Mn(c);if(this.formats[l]){let d=o;try{const p=((u=s==null?void 0:s.formatParams)==null?void 0:u[s.interpolationkey])||{},m=p.locale||p.lng||s.locale||s.lng||n;d=this.formats[l](o,m,{...f,...s,...p})}catch(p){this.logger.warn(p)}return d}else this.logger.warn(`there was no format function for ${l}`);return o},e)}}const Yn=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class Un extends lt{constructor(e,t,n,s={}){var a,i;super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=s,this.logger=ge.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(i=(a=this.backend)==null?void 0:a.init)==null||i.call(a,n,s.backend,s)}queueLoad(e,t,n,s){const a={},i={},o={},c={};return e.forEach(l=>{let f=!0;t.forEach(u=>{const d=`${l}|${u}`;!n.reload&&this.store.hasResourceBundle(l,u)?this.state[d]=2:this.state[d]<0||(this.state[d]===1?i[d]===void 0&&(i[d]=!0):(this.state[d]=1,f=!1,i[d]===void 0&&(i[d]=!0),a[d]===void 0&&(a[d]=!0),c[u]===void 0&&(c[u]=!0)))}),f||(o[l]=!0)}),(Object.keys(a).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(a),pending:Object.keys(i),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(c)}}loaded(e,t,n){const s=e.split("|"),a=s[0],i=s[1];t&&this.emit("failedLoading",a,i,t),!t&&n&&this.store.addResourceBundle(a,i,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const o={};this.queue.forEach(c=>{Rn(c.loaded,[a],i),Yn(c,e),t&&c.errors.push(t),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(l=>{o[l]||(o[l]={});const f=c.loaded[l];f.length&&f.forEach(u=>{o[l][u]===void 0&&(o[l][u]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(c=>!c.done)}read(e,t,n,s=0,a=this.retryTimeout,i){if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:n,tried:s,wait:a,callback:i});return}this.readingCalls++;const o=(l,f)=>{if(this.readingCalls--,this.waitingReads.length>0){const u=this.waitingReads.shift();this.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}if(l&&f&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,n,s+1,a*2,i)},a);return}i(l,f)},c=this.backend[n].bind(this.backend);if(c.length===2){try{const l=c(e,t);l&&typeof l.then=="function"?l.then(f=>o(null,f)).catch(o):o(null,l)}catch(l){o(l)}return}return c(e,t,o)}prepareLoading(e,t,n={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();G(e)&&(e=this.languageUtils.toResolveHierarchy(e)),G(t)&&(t=[t]);const a=this.queueLoad(e,t,n,s);if(!a.toLoad.length)return a.pending.length||s(),null;a.toLoad.forEach(i=>{this.loadOne(i)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),s=n[0],a=n[1];this.read(s,a,"read",void 0,void 0,(i,o)=>{i&&this.logger.warn(`${t}loading namespace ${a} for language ${s} failed`,i),!i&&o&&this.logger.log(`${t}loaded namespace ${a} for language ${s}`,o),this.loaded(e,i,o)})}saveMissing(e,t,n,s,a,i={},o=()=>{}){var c,l,f,u,d;if((l=(c=this.services)==null?void 0:c.utils)!=null&&l.hasLoadedNamespace&&!((u=(f=this.services)==null?void 0:f.utils)!=null&&u.hasLoadedNamespace(t))){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((d=this.backend)!=null&&d.create){const 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(b=>o(null,b)).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 pr=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:r=>{let e={};if(typeof r[1]=="object"&&(e=r[1]),G(r[1])&&(e.defaultValue=r[1]),G(r[2])&&(e.tDescription=r[2]),typeof r[2]=="object"||typeof r[3]=="object"){const t=r[3]||r[2];Object.keys(t).forEach(n=>{e[n]=t[n]})}return e},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),hr=r=>{var e,t;return G(r.ns)&&(r.ns=[r.ns]),G(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),G(r.fallbackNS)&&(r.fallbackNS=[r.fallbackNS]),((t=(e=r.supportedLngs)==null?void 0:e.indexOf)==null?void 0:t.call(e,"cimode"))<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),typeof r.initImmediate=="boolean"&&(r.initAsync=r.initImmediate),r},ze=()=>{},Wn=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class Me extends lt{constructor(e={},t){if(super(),this.options=hr(e),this.services={},this.logger=ge,this.modules={external:[]},Wn(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(G(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=pr();this.options={...n,...this.options,...hr(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const s=l=>l?typeof l=="function"?new l:l:null;if(!this.options.isClone){this.modules.logger?ge.init(s(this.modules.logger),this.options):ge.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:l=Vn;const f=new lr(this.options);this.store=new ar(this.options.resources,this.options);const u=this.services;u.logger=ge,u.resourceStore=this.store,u.languageUtils=f,u.pluralResolver=new In(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),l&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(u.formatter=s(l),u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new Nn(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Un(s(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",(d,...p)=>{this.emit(d,...p)}),this.modules.languageDetector&&(u.languageDetector=s(this.modules.languageDetector),u.languageDetector.init&&u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=s(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new st(this.services,this.options),this.translator.on("*",(d,...p)=>{this.emit(d,...p)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,t||(t=ze),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(l=>{this[l]=(...f)=>this.store[l](...f)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=(...f)=>(this.store[l](...f),this)});const o=Ce(),c=()=>{const l=(f,u)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(u),t(f,u)};if(this.languages&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),o}loadResources(e,t=ze){var a,i;let n=t;const s=G(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const o=[],c=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(u=>{u!=="cimode"&&o.indexOf(u)<0&&o.push(u)})};s?c(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>c(f)),(i=(a=this.options.preload)==null?void 0:a.forEach)==null||i.call(a,l=>c(l)),this.services.backendConnector.load(o,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(l)})}else n(null)}reloadResources(e,t,n){const s=Ce();return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=ze),this.services.backendConnector.reload(e,t,a=>{s.resolve(),n(a)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&Pr.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let t=0;t<this.languages.length;t++){const n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=Ce();this.emit("languageChanging",e);const s=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},a=(o,c)=>{c?this.isLanguageChangingTo===e&&(s(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,n.resolve((...l)=>this.t(...l)),t&&t(o,(...l)=>this.t(...l))},i=o=>{var f,u;!e&&!o&&this.services.languageDetector&&(o=[]);const c=G(o)?o:o&&o[0],l=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(G(o)?[o]:o);l&&(this.language||s(l),this.translator.language||this.translator.changeLanguage(l),(u=(f=this.services.languageDetector)==null?void 0:f.cacheUserLanguage)==null||u.call(f,l)),this.loadResources(l,d=>{a(d,l)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?i(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e),n}getFixedT(e,t,n){const s=(a,i,...o)=>{let c;typeof i!="object"?c=this.options.overloadTranslationOptionHandler([a,i].concat(o)):c={...i},c.lng=c.lng||s.lng,c.lngs=c.lngs||s.lngs,c.ns=c.ns||s.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||n||s.keyPrefix);const l=this.options.keySeparator||".";let f;return c.keyPrefix&&Array.isArray(a)?f=a.map(u=>`${c.keyPrefix}${l}${u}`):f=c.keyPrefix?`${c.keyPrefix}${l}${a}`:a,this.t(f,c)};return G(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=n,s}t(...e){var t;return(t=this.translator)==null?void 0:t.translate(...e)}exists(...e){var t;return(t=this.translator)==null?void 0:t.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const i=(o,c)=>{const l=this.services.backendConnector.state[`${o}|${c}`];return l===-1||l===0||l===2};if(t.precheck){const o=t.precheck(this,i);if(o!==void 0)return o}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(n,e)&&(!s||i(a,e)))}loadNamespaces(e,t){const n=Ce();return this.options.ns?(G(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{n.resolve(),t&&t(s)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Ce();G(e)&&(e=[e]);const s=this.options.preload||[],a=e.filter(i=>s.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return a.length?(this.options.preload=s.concat(a),this.loadResources(i=>{n.resolve(),t&&t(i)}),n):(t&&t(),Promise.resolve())}dir(e){var s,a;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((a=this.services)==null?void 0:a.languageUtils)||new lr(pr());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new Me(e,t)}cloneInstance(e={},t=ze){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new Me(s);if((e.debug!==void 0||e.prefix!==void 0)&&(a.logger=a.logger.clone(e)),["store","services","language"].forEach(o=>{a[o]=this[o]}),a.services={...this.services},a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},n){const o=Object.keys(this.store.data).reduce((c,l)=>(c[l]={...this.store.data[l]},c[l]=Object.keys(c[l]).reduce((f,u)=>(f[u]={...c[l][u]},f),c[l]),c),{});a.store=new ar(o,s),a.services.resourceStore=a.store}return a.translator=new st(a.services,s),a.translator.on("*",(o,...c)=>{a.emit(o,...c)}),a.init(s,t),a.translator.options=s,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ae=Me.createInstance();ae.createInstance=Me.createInstance;ae.createInstance;ae.dir;ae.init;ae.loadResources;ae.reloadResources;ae.use;ae.changeLanguage;ae.getFixedT;ae.t;ae.exists;ae.setDefaultNamespace;ae.hasLoadedNamespace;ae.loadNamespaces;ae.loadLanguages;const Bn={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"},Hn={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},Gn={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando",CheckObjectWrongValidation:"Oggetto non valido"},qn={Date:{NextDay:"Giorno Successivo",NextMonth:"Mese Successivo",NextWeek:"Settimana Successiva",NextYear:"Anno Successivo",PreviousDay:"Giorno Precedente",PreviousMonth:"Mese Precedente",PreviousWeek:"Settimana Precedente",PreviousYear:"Anno Precedente",Today:"Oggi",Tomorrow:"Domani",Yesterday:"Ieri"},Day:Bn,Month:Hn,Generic:Gn},Kn={Friday:"Friday",FridayShort:"Fri",Monday:"Monday",MondayShort:"Mon",Saturday:"Saturday",SaturdayShort:"Sat",Sunday:"Sunday",SundayShort:"Sun",Tuesday:"Tuesday",TuesdayShort:"Tue",Thursday:"Thursday",ThursdayShort:"Thu",Wednesday:"Wednesday",WednesdayShort:"Wed"},zn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},Jn={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command",CheckObjectWrongValidation:"Object not valid"},Xn={Date:{NextDay:"Next Day",NextMonth:"Next Month",NextWeek:"Next Week",NextYear:"Next Year",PreviousDay:"Previous Day",PreviousMonth:"Previous Month",PreviousWeek:"Previous Week",PreviousYear:"Previous Year",Today:"Today",Tomorrow:"Tomorrow",Yesterday:"Yesterday"},Day:Kn,Month:zn,Generic:Jn};function mr(r,e){return new RegExp(Zn(r),e)}function Zn(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qn(r,e,t,n){let s=e;const a=es(r,t);if(!s){const o=Math.abs(a);o-Math.floor(o)?s="0,0.00":s="0,0"}const i=ts(s);return new Intl.NumberFormat(n,i).format(a)}function es(r,e,t,n,s){let a=r;if(typeof a!="number"){let o;e&&n===void 0?o=",":o=".";const c=o=="."?",":".";a=a.replace(mr(c,"g"),""),a=a.replace(mr(o,"g"),"."),a=Number(a)}const i=Number(a);return isNaN(i)?NaN:i}function ts(r){const e={};r.includes(",")?e.useGrouping=!0:e.useGrouping=!1;const t=r.indexOf(".");if(t>-1){const s=(r.substring(t+1).match(/0/g)||[]).length;e.minimumFractionDigits=s,e.maximumFractionDigits=s}else e.minimumFractionDigits=0,e.maximumFractionDigits=0;return e}ae.init({lng:typeof navigator<"u"&&navigator.language.split("-")[0]||"en",fallbackLng:"en",debug:!1,interpolation:{escapeValue:!1,format:(r,e,t,n)=>{const s=(n==null?void 0:n.type)??"number";try{switch(s){case"date":{const a=r instanceof Date?r:new Date(r);return new Intl.DateTimeFormat(t,{dateStyle:e||"short"}).format(a)}default:case"number":{const a=(n==null?void 0:n.inputIsLocalized)??!1;return Qn(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:Xn},it:{translation:qn}}});const rs=(r,e,t,n)=>ae.format(r,e,t||ae.language,n),ns=(r,e)=>ae.t(r,e);function Fe(){const r=R.useCallback((n,s,a,i)=>rs(n,s,a||void 0,i),[]),e=R.useCallback(()=>ae.languages[0],[]),t=R.useCallback((n,s)=>ns(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var ct=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r.CHECK_OBJECT_WRONG_VALIDATION="Generic.CheckObjectWrongValidation",r))(ct||{}),le=(r=>(r.MONDAY="Day.Monday",r.MONDAY_SHORT="Day.MondayShort",r.TUESDAY="Day.Tuesday",r.TUESDAY_SHORT="Day.TuesdayShort",r.WEDNESDAY="Day.Wednesday",r.WEDNESDAY_SHORT="Day.WednesdayShort",r.THURSDAY="Day.Thursday",r.THURSDAY_SHORT="Day.ThursdayShort",r.FRIDAY="Day.Friday",r.FRIDAY_SHORT="Day.FridayShort",r.SATURDAY="Day.Saturday",r.SATURDAY_SHORT="Day.SaturdayShort",r.SUNDAY="Day.Sunday",r.SUNDAY_SHORT="Day.SundayShort",r))(le||{}),ue=(r=>(r.JANUARY="Month.January",r.FEBRUARY="Month.February",r.MARCH="Month.March",r.APRIL="Month.April",r.MAY="Month.May",r.JUNE="Month.June",r.JULY="Month.July",r.AUGUST="Month.August",r.SEPTEMBER="Month.September",r.OCTOBER="Month.October",r.NOVEMBER="Month.November",r.DECEMBER="Month.December",r))(ue||{}),Et=(r=>(r.PREVIOUS_DAY="Date.PreviousDay",r.PREVIOUS_WEEK="Date.PreviousWeek",r.PREVIOUS_MONTH="Date.PreviousMonth",r.PREVIOUS_YEAR="Date.PreviousYear",r.NEXT_DAY="Date.NextDay",r.NEXT_WEEK="Date.NextWeek",r.NEXT_MONTH="Date.NextMonth",r.NEXT_YEAR="Date.NextYear",r.YESTERDAY="Date.Yesterday",r.TODAY="Date.Today",r.TOMORROW="Date.Tomorrow",r))(Et||{});const ss={"smp-datepickercalendar-position":"_smp-datepickercalendar-position_19hwj_1"};function as({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=Fe(),i=()=>{if(!n)return;const N=new Date(n);return isNaN(N.getTime())?void 0:N},[o]=R.useState(new Date),[c,l]=R.useState(r||i()||new Date),[f,u]=R.useState(c?c.getMonth():new Date().getMonth()),[d,p]=R.useState(c?c.getFullYear():new Date().getFullYear()),[m,g]=R.useState(c?c.getDate():null),b=R.useRef(null),E=R.useRef([]),w=[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)],T=[{value:a(le.SUNDAY_SHORT),full:a(le.SUNDAY)},{value:a(le.MONDAY_SHORT),full:a(le.MONDAY)},{value:a(le.TUESDAY_SHORT),full:a(le.TUESDAY)},{value:a(le.WEDNESDAY_SHORT),full:a(le.WEDNESDAY)},{value:a(le.THURSDAY_SHORT),full:a(le.THURSDAY)},{value:a(le.FRIDAY_SHORT),full:a(le.FRIDAY)},{value:a(le.SATURDAY_SHORT),full:a(le.SATURDAY)}],S=N=>t.some(h=>{const x=h.start.getTime(),O=h.end.getTime(),P=N.getTime();return P>=x&&P<=O}),v=N=>{S(N)||(l(N),g(N.getDate()),e&&e(Xr(N)))},D=()=>{f===0?(u(11),p(d-1)):u(f-1),g(1)},$=()=>{f===11?(u(0),p(d+1)):u(f+1),g(1)},C=(N,h)=>new Date(N,h+1,0).getDate(),k=(N,h)=>new Date(N,h,1).getDay(),I=N=>{var x;const h=q.findIndex(O=>O!==null&&O.getDate()===N);h!==-1&&E.current[h]&&((x=E.current[h])==null||x.focus(),g(N))},_=(N,h)=>{const x=q[h];if(!x)return;const O=C(d,f),P=x.getDate();switch(N.key){case"ArrowRight":N.preventDefault();{let j=P+1,A=new Date(d,f,j);if(j>O){const V=f===11?d+1:d,Y=f===11?0:f+1;j=1,A=new Date(V,Y,j),$(),setTimeout(()=>{F(1,"forward")},0);return}S(A)?F(j,"forward"):I(j)}break;case"Tab":break;case"ArrowLeft":N.preventDefault();{let j=P-1,A=new Date(d,f,j);if(j<1){const V=f===0?d-1:d,Y=f===0?11:f-1,M=C(V,Y);j=M,A=new Date(V,Y,j),D(),setTimeout(()=>{F(M,"backward")},0);return}S(A)?F(j,"backward"):I(j)}break;case"ArrowUp":N.preventDefault();{let j=P-7,A=new Date(d,f,j);if(j<1){const V=f===0?d-1:d,Y=f===0?11:f-1;j=C(V,Y)+j,A=new Date(V,Y,j),D(),setTimeout(()=>{F(j,"backward")},0);return}S(A)?F(j,"backward"):I(j)}break;case"ArrowDown":N.preventDefault();{let j=P+7,A=new Date(d,f,j);if(j>O){const V=f===11?d+1:d,Y=f===11?0:f+1;j=j-O,A=new Date(V,Y,j),$(),setTimeout(()=>{F(j,"forward")},0);return}S(A)?F(j,"forward"):I(j)}break;case"Home":N.preventDefault(),F(1,"forward");break;case"End":N.preventDefault(),F(O,"backward");break;case"PageUp":N.preventDefault(),D(),setTimeout(()=>{const j=C(f===0?d-1:d,f===0?11:f-1),A=Math.min(P,j);F(A,"forward")},0);break;case"PageDown":N.preventDefault(),$(),setTimeout(()=>{const j=C(f===11?d+1:d,f===11?0:f+1),A=Math.min(P,j);F(A,"forward")},0);break;case" ":case"Space":if(S(x))return;g(x.getDate()),l(x);break;case"Enter":N.preventDefault(),v(x);break}},F=(N,h)=>{const x=C(d,f);if(h==="forward"){for(let O=N;O<=x;O++){const P=new Date(d,f,O);if(!S(P)){I(O);return}}$(),setTimeout(()=>{F(1,"forward")},0)}else{for(let A=N;A>=1;A--){const V=new Date(d,f,A);if(!S(V)){I(A);return}}const O=f===0?d-1:d,P=f===0?11:f-1,j=C(O,P);D(),setTimeout(()=>{F(j,"backward")},0)}},q=(()=>{const N=C(d,f),h=k(d,f),x=[];for(let O=0;O<h;O++)x.push(null);for(let O=1;O<=N;O++){const P=new Date(d,f,O);x.push(P)}return x})(),Z=[];let K=[];q.forEach((N,h)=>{if(K.push(N),K.length===7||h===q.length-1){for(;K.length<7;)K.push(null);Z.push(K),K=[]}}),R.useEffect(()=>{var N;if(m!==null){const h=q.findIndex(x=>x!==null&&x.getDate()===m);h!==-1&&E.current[h]&&((N=E.current[h])==null||N.focus())}},[f,d,m,q]);const z={label:"smp-datepickercalendar-label",wrapper:`smp-datepickercalendar ${ss["smp-datepickercalendar-position"]}`,calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(N,h,x,O)=>`smp-datepickercalendar-td
|
|
46
|
+
${N?"smp-datepickercalendar-td-today":""}
|
|
47
47
|
${h?"smp-datepickercalendar-td-selected":""}
|
|
48
|
-
${
|
|
49
|
-
${T?"smp-datepickercalendar-td-disabled":""}`},B=()=>`${E[f]} ${p.toString()}`;return g.jsxs("div",{className:z.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[g.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[g.jsx(Se,{onClick:P,ariaLabel:a(vt.PREVIOUS_MONTH),optionalDisplayValue:"<",appearance:"ghost",variant:"base",bindValue:"<"}),g.jsx("div",{"aria-label":B(),className:z.label,children:B()}),g.jsx(Se,{onClick:$,ariaLabel:a(vt.NEXT_MONTH),bindValue:">",optionalDisplayValue:">",appearance:"ghost",variant:"base"})]}),g.jsxs("table",{ref:x,role:"grid","aria-label":`${a(Ot.CALENDAR_FOR)} ${E[f]} ${p}`,className:z.table,children:[g.jsx("thead",{children:g.jsx("tr",{children:O.map(I=>g.jsx("th",{scope:"col",abbr:I.full,className:z.th,children:I.value},I.value))})}),g.jsx("tbody",{children:Z.map((I,h)=>g.jsx("tr",{children:I.map((b,T)=>{const _=h*7+T;if(b===null)return g.jsx("td",{className:z.td(!1,!1,!1,!0)},`empty-${T}`);const R=b.getDate()===o.getDate()&&b.getMonth()===o.getMonth()&&b.getFullYear()===o.getFullYear(),A=u&&b.getDate()===u.getDate()&&b.getMonth()===u.getMonth()&&b.getFullYear()===u.getFullYear(),V=m===b.getDate(),Y=S(b);return g.jsx("td",{role:"gridcell","aria-selected":A,tabIndex:V?0:-1,onClick:()=>v(b),onKeyDown:M=>j(M,_),"aria-label":`${b.getDate()} ${E[b.getMonth()]} ${b.getFullYear()}`,"data-selected":A,"aria-disabled":Y,ref:M=>{w.current[_]=M},className:z.td(R,A,V,Y),children:b.getDate()},`day-${T}`)})},`week-${h}`))})]})]})}const _r=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,isEditable:s=!0,...a})=>{const[i,o]=D.useState(!1),[u,c]=D.useState(r||""),[f,l]=D.useState(""),{anchorRef:p,targetRef:d}=xt({position:"bottom",enabled:i});Ze(d,()=>{o(!1)}),Ze(p,()=>{if(typeof p=="object"&&p!==null&&"current"in p){const $=p.current.querySelector("input");$&&$===document.activeElement&&E()}}),Or(i,d);const{format:m,getCurrentLanguage:y}=st(),x=D.useCallback($=>{const C=$.length>5&&Wr($,y())||$,L=m(C,void 0,void 0,{type:"date"}),N=typeof C!="string",j=N&&C.toISOString().substring(0,10)||"";return{isValid:N,formattedDate:L,isoDate:j,normalizedDate:C}},[y,m]);D.useEffect(()=>{const{formattedDate:$,isoDate:C,isValid:L}=x(r);c(L&&C||r),l(L&&$||r)},[r,m,x]);const w=()=>o($=>!$),E=()=>{S(f)},O=$=>{S($),o(!1)},S=$=>{const{isoDate:C,isValid:L}=x($);t&&t(L&&C||$)},v=$=>{l($)},P=$=>{$.key==="Enter"&&($.preventDefault(),S(f))};return g.jsxs("div",{"data-component":"date-picker",children:[g.jsx(Ee,{bindValue:f,placeholder:e,onBlur:E,onChange:v,onKeyDown:P,shapeIcon:"calendar",onShapeIconClick:w,ref:p,isEditable:s,...a}),i&&g.jsx(wt,{children:g.jsx(es,{disabledDateRanges:n,onDateChange:O,initialValue:bt(u)&&u||"",targetRef:d})})]})},ts=({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,y)=>{const x=[...r];if(m=="")x.pop();else{const w=x.findIndex(E=>E.bindValue===m&&E.optionalDisplayValue===y);w>=0?x.splice(w,1):x.push({bindValue:m,optionalDisplayValue:y})}f==null||f(x)},d={container:"smp-multipleAutocomplete-container"};return g.jsxs("div",{className:d.container,"data-component":"multiple-autocomplete",children:[i&&g.jsx(De,{label:i,disabled:o}),g.jsx(Tt,{elements:r,displayMode:e,isEditable:s,onChange:m=>{f==null||f(m)}}),g.jsx(Et,{bindValue:"",fun:u,isEditable:s,onChange:p,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:a,onOptionsRequest:c,_multiActiveIndex:l})]})},Ge={"smp-radio":"_smp-radio_1vo2u_1","smp-radio-horizontal":"_smp-radio-horizontal_1vo2u_10","smp-radio-element":"_smp-radio-element_1vo2u_14","smp-radio-disabled":"_smp-radio-disabled_1vo2u_20"},rs=({disabled:r=!1,displayMode:e="DescOnly",horizontal:t=!1,options:n,onOptionsRequest:s,fun:a,...i})=>{const[o,u]=D.useState(n);D.useEffect(()=>{!o&&s&&a&&s(a,void 0).then(d=>u(d)).catch(d=>{console.error("Errore nel caricamento delle opzioni per ButtonList",d)})},[o,s,a]);const c={container:`${Ge["smp-radio"]} ${t?Ge["smp-radio-horizontal"]:""}`,option:`${Ge["smp-radio-element"]} ${r?Ge["smp-radio-disabled"]:""}`},f=()=>{var d;r||(d=i.onBlur)==null||d.call(i)},l=d=>{var m;r||(m=i.onChange)==null||m.call(i,d.target.value)},p=D.useId();return g.jsx("div",{"smp-id":"radio-container",className:c.container,children:o==null?void 0:o.map((d,m)=>g.jsxs("label",{className:c.option,children:[g.jsx("input",{type:"radio",name:p,value:d.id,disabled:r,checked:d.id===i.bindValue,onChange:l,onBlur:f}),Ae(d.id,d.label,e)]},m))})},$r=({...r})=>{const[e,t]=D.useState(!1),n=e?"visibility-off":"visibility";return g.jsx(Ee,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},ns=({...r})=>{const[e,t]=D.useState(r.bindValue),{translate:n}=st(),s=a=>{var i;a.key==="Enter"&&(a.preventDefault(),(i=r.onEnter)==null||i.call(r,e))};return g.jsx(Ee,{...r,placeholder:r.placeholder?r.placeholder:n(Ot.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})},ss=({bindValue:r,optionalDisplayValue:e,label:t})=>{const n={wrapper:"smp-text-wrapper"};return t?g.jsxs("div",{className:n.wrapper,children:[g.jsx(De,{label:t}),g.jsx(Le,{variant:"body",bindValue:e||r})]}):g.jsx(Le,{variant:"body",bindValue:e||r})};class we{constructor(e,t){be(this,"class");be(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new we(e,e.k==""?[]:e.k.split(";"))}static fromString(e){return new we({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const qe=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t??r.decode,shape:r.shape,fun:r.fun}),dr=r=>{const e=we.fromDataObj(r.obj),t=r.decode?we.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},as=(r,e)=>{const t=new we(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new we(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return qe(r,t,n)},is=({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=D.useId(),m=`${d}-helper`,y=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":""} ${y?`smp-textarea-${y}`:""} ${a?`smp-textarea-${a}`:""} ${i?"":"smp-textarea-readOnly"}`};return g.jsxs("div",{className:E.wrapper,"data-component":"textarea",children:[o&&g.jsx(De,{htmlFor:d,label:o,disabled:r}),g.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&&g.jsx(mr,{id:m,helperText:f,disabled:r,state:y})]})},Rt=({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 y={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,v,P)=>Yr(t)?qe(S,new Xe(t,v).getLegacyValue()):qe(S,v,P),E=S=>qe(y,new Je(t,S).getLegacyValue()),O=S=>as(y,S);switch(e){case re.AUTOCOMPLETE:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(v,P)=>{c==null||c(w(y,v,P))}};return g.jsx(Et,{...S})}case re.BUTTON:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onClick:()=>{f==null||f(w(y,t.k))}};return g.jsx(Se,{...S})}case re.BUTTON_LIST:{const S={...x,options:u,onClick:(v,P)=>{const $={...y,fun:P};f==null||f(w($,v))}};return g.jsx(Er,{...S})}case re.COMBOBOX:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:(v,P)=>{c==null||c(w(y,v,P))}};return g.jsx(Rr,{...S})}case re.RADIO:{const S={...x,bindValue:t.k,onChange:v=>{c==null||c(w(y,v))}};return g.jsx(rs,{...S})}case re.SWITCH:case re.CHECKBOX:{const S=e===re.SWITCH,v={...x,bindValue:Je.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:P=>{c==null||c(E(P))},...S&&{variant:"switch"}};return g.jsx(Tr,{...v})}case re.CHIP:{const S={...x,elements:dr(y)};return g.jsx(Tt,{...S})}case re.DATE:{const S={...x,bindValue:Xe.fromDataObj(t).getValue(),onChange:v=>{c==null||c(w(y,v))}};return g.jsx(_r,{...S})}case re.ICON:case re.IMAGE:{const S={...x,icon:s,placeholderIcon:i,isInteractable:!!x.fun,onClick:()=>{f==null||f(w(y,t.k))}};return g.jsx(oe,{...S})}case re.MULTI_AUTOCOMPLETE:{const S={...x,elements:dr(y),onChange:v=>{c==null||c(O(v))}};return g.jsx(ts,{...S})}case re.MEMO:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:v=>{c==null||c(w(y,v))}};return g.jsx(is,{...S})}case re.PASSWORD:{const S={...x,bindValue:t.k,onChange:v=>{c==null||c(w(y,v))}};return g.jsx($r,{...S})}case re.SPOTLIGHT:{const S={...x,bindValue:t.k,onEnter:v=>{l==null||l(w(y,v))}};return g.jsx(ns,{...S})}case re.TEXT_FIELD:{const S={...x,bindValue:t.k,optionalDisplayValue:r,onChange:v=>{c==null||c(w(y,v))}};return g.jsx(Ee,{...S})}default:{const S={...x,bindValue:t.k,optionalDisplayValue:r};return g.jsx(ss,{...S})}}},os=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},Cr=(r,e)=>r.map(t=>{var a,i;if((a=t.sections)!=null&&a.length)return{...t,sections:Cr(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=os(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}}),pr=(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}},hr=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"},jt=({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=Cr(e.sections||[],r),a=l=>l==null?void 0:l.reduce((p,d)=>{var E,O;let m="",y={},x={},w="";return(E=d.sections)!=null&&E.length?(m=de["smp-layout-section-grid"],y=a(d.sections),d.gridCols==null&&(w=`${de[d.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"]}`,(d.horizontal||hr(d.sections))&&(x=pr(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,...y,[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||hr(e.sections||[])?pr(s,e.horizontal?t:n):{},c=l=>{var d;const p=g.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?g.jsxs("div",{className:`${de["smp-layout-section-with-title"]}`,children:[g.jsx("span",{className:`${de["smp-layout-section-title"]} ${l.justify?`smp-justifyContent-${l.justify}`:""} ${l.align?`smp-alignItems-${l.align}`:""}`,children:g.jsx(De,{label:l.title})}),p]}):p},f=(l,p,d,m)=>{const y=l.colSpan!==void 0?l.colSpan>0?l.colSpan:l.colStart!==void 0&&l.colStart<1?1:null:null,x=y!==null?`span ${y}`: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?g.jsx("div",{className:O,style:{...E},"smp-id":l.id,children:g.jsx(Rt,{...p})},l.id):g.jsx(g.Fragment,{})};return g.jsx("div",{className:o.container,style:u,"smp-id":"layout",children:s==null?void 0:s.map(l=>c(l))})},ls=({data:r,onClick:e,onEnter:t})=>{var i,o;const[n,s]=D.useState(),a=D.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],y={...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]:y}},{})},[e,t]);return D.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&&g.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:g.jsx(jt,{layout:r.rows[0].layout,cells:n})})},cs=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,us=({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]=D.useState(),[l,p]=D.useState(t??!0),d=D.useRef(null),m=s.trim()?s:"100vh",y=D.useCallback(v=>{var $,C;if(!(($=v==null?void 0:v.rows)!=null&&$.length)||!((C=v==null?void 0:v.columns)!=null&&C.length))return{};const P=v.rows[0];return v.columns.filter(L=>L.visible??!0).reduce((L,N)=>{const j=P.cells[N.name];if(!j||!l&&ce(n)&&j.shape!==re.BUTTON&&j.shape!==re.BUTTON_LIST)return L;const F={...j,onChange:W=>{f(q=>{const Z={...q};return Z!=null&&Z[N.name]&&(Z[N.name].obj.k=W.obj.k),Z})},onClick:W=>{W.fun&&a&&a(W)},onEnter:W=>{i&&i(W)}};return u&&j.shape==re.BUTTON_LIST&&(F.onOptionsRequest=(W,q)=>u(W,q).then(Z=>cs(Z))),!l&&ce(n)&&(F.data={...F.data,showText:!1,justify:"center"}),{...L,[N.name]:F}},{})},[l,n,a,i,u]),x=D.useCallback(()=>{o==null||o()},[o]),w=()=>{ce(n)?p(v=>!v):(p(!1),o==null||o())};if(D.useEffect(()=>{f(y(r))},[r]),D.useEffect(()=>{if(!d.current)return;if(!ce(n)){f(y(r));return}const v=getComputedStyle(d.current).getPropertyValue("--smp-drawer-slide-transition");let P=Number(v);v.endsWith("ms")?P=parseFloat(v):v.endsWith("s")&&(P=parseFloat(v)*1e3),setTimeout(()=>{f(y(r))},P/2)},[l,n]),D.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&&g.jsxs(g.Fragment,{children:[!ce(n)&&g.jsx("div",{"aria-hidden":"true","aria-label":"drawer-backdrop",className:E.backdrop,onClick:x}),g.jsx("aside",{ref:d,className:E.drawer,style:{height:m},"aria-label":"Drawer","smp-id":"drawer",children:g.jsxs("div",{className:E.container,children:[g.jsxs("div",{className:E.containerHeader,children:[e&&g.jsx("div",{className:E.containerLogo,children:g.jsx(oe,{icon:e,title:"drawer_logo",width:"100%",height:24})}),g.jsx("div",{className:E.containerIcon,children:g.jsx(oe,{icon:ce(n)?"menu_close":"close",title:"drawer_icon",rotated:!l,isInteractable:!0,onClick:w,width:20,height:20})})]}),g.jsx("div",{className:E.containerLayout,children:g.jsx(jt,{layout:r.rows[0].layout,cells:c})})]})})]})},fs=({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:y,ValueColName:x,ValueColor:w="var(--smp-dashList-color-base)",SelectLayout:E="1",onClick:O})=>{const S="N/A",v=(e==null?void 0:e.columns)||[],P=(e==null?void 0:e.rows)||[],$=P.length>0,C="--smp-dashList-color",L="smp-layout",N="descr",j="icon",F="um",W="value",q=i||"1em",Z="18px",K="--smp-dashList-columns",z="--smp-dashList-fontSize",B={dash:(U="1")=>{const X=h(U),te=X,ne=b(X,N),fe=b(X,j),ye=b(X,F),pe=b(X,W);return{container:te,descr:ne,icon:fe,um:ye,value:pe}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
|
|
50
|
-
${ce(o)?"smp-dash-list-horizontal":""}`},{format:I}=st(),h=U=>`${L}-${U}`,b=(U,X)=>`${U}__${X}`,T=U=>`${C}-${U}`,_=U=>{const X=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(X.test(U)){const ne=U.match(X)||[];if((ne==null?void 0:ne.length)>3)return"rgb("+ne[1]+","+ne[2]+","+ne[3]+")"}return U},R=U=>{if(!l)return U;const[X,te]=A(l).map(Te=>parseInt(Te||"0")),ne="0,0"+(te?"."+"0".repeat(te):""),fe=I(U,ne,"it");if(!X)return fe;const[ye,pe]=fe.split(",");return ye+(pe?`,${pe}`:"")},A=U=>U.includes(";")?U.split(";"):[U],V=U=>{const X=ne=>{var fe;if(ne)return(fe=U==null?void 0:U.cells[ne])==null?void 0:fe.obj.k},te=ne=>{var fe,ye;if(!(v.length<=ne))return(ye=(fe=U==null?void 0:U.cells[v[ne].name])==null?void 0:fe.obj)==null?void 0:ye.k};return{descr:t||X(n)||te(2)||"",icon:u||X(c)||te(3)||"",um:p||X(d)||te(1)||"",value:y||X(x)||te(0)||""}},Y=U=>{O==null||O(U)},M=(U,X)=>{(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),U.stopPropagation(),Y(X))},H=(U=>{const X=B.dash(U);return{className:X,descr:te=>g.jsx("div",{className:X.descr,children:te},`${U}-${N}`),icon:te=>g.jsx("div",{className:X.icon,children:g.jsx(oe,{color:f,height:Z,icon:te,width:Z})},`${U}-${j}`),um:te=>g.jsx("div",{className:X.um,children:te},`${U}-${F}`),value:te=>g.jsx("div",{className:X.value,children:te},`${U}-${W}`)}})(E),se=U=>{const{descr:X,icon:te,um:ne,value:fe}=V(U),ye={[T(N)]:_(s),[T(F)]:_(m),[T(W)]:_(w)},pe=[],Te=R(fe);switch(E){case"2":te&&pe.push(H.icon(te)),pe.push(H.descr(X)),pe.push(H.value(ne?Te+" "+ne:Te));break;default:case"1":pe.push(H.descr(X)),pe.push(H.value(ne?Te+" "+ne:Te))}return g.jsx("div",{className:H.className.container,role:"button",style:ye,tabIndex:0,onClick:()=>Y(U),onKeyDown:Ar=>M(Ar,U),children:pe},U.rowId)},k={[K]:String(r),[z]:q};return g.jsx("div",{className:B.dashList,style:k,children:$?P.map(U=>se(U)):S})},Ke={"smp-table":"_smp-table_1qmju_1","smp-headerCell":"_smp-headerCell_1qmju_35","smp-resizer":"_smp-resizer_1qmju_44"},ds="_rowContent_20wit_2",ps="_clickable_20wit_21",hs="_indent_20wit_26",ms="_toggle_20wit_32",gs="_cell_20wit_38",ys="_leftSection_20wit_46",xe={rowContent:ds,clickable:ps,indent:hs,toggle:ms,cell:gs,leftSection:ys};function ze(r){return!!r&&"children"in r}function vs(r){return!ze(r)}function bs(r){const e=JSON.stringify(r,Object.keys(r).sort());let t=0,n,s;if(e.length===0)return t.toString();for(n=0;n<e.length;n++)s=e.charCodeAt(n),t=(t<<5)-t+s,t|=0;return Math.abs(t).toString()}const Pr=({row:r,columnWidths:e={},level:t=0,rowHeight:n=26,offsetTop:s})=>{var E;const[a,i]=D.useState(!1),o=ze(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:`${xe.rowContent} ${o?xe.clickable:""}`,toggle:`${xe.toggle}`,indent:`${xe.indent}`,cell:`${xe.cell}`},d=O=>g.jsx(Rt,{...O}),m=()=>g.jsx("span",{className:p.toggle,children:c&&g.jsx(oe,{icon:a?"arrow_drop_right":"arrow_drop_down",width:16})}),y=()=>g.jsx("span",{className:p.indent,style:{width:`${f}px`},"aria-hidden":"true"}),x=()=>{const O=vs(r)?"":r.decode||(u?"":"Untitled"),S=s??n*t;return g.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:[ze(r)&&g.jsxs("td",{className:xe.leftSection,style:{height:`${n}px`},children:[y(),m(),g.jsx("span",{className:xe.rowLabel,children:O})]}),r.cells&&Object.keys(r.cells).length>0&&Object.entries(r.cells).map(([v,P])=>g.jsx("td",{className:p.cell,style:{width:e[v],minWidth:e[v],height:`${n}px`},children:d(P)},bs(P)||v))]})},w=()=>{var O;return a||!o?null:g.jsx(g.Fragment,{children:ze(r)&&((O=r.children)==null?void 0:O.map((S,v)=>g.jsx(Pr,{row:S,level:t+1},`child-${v}`)))})};return g.jsxs(g.Fragment,{children:[x(),w()]})},xs=({label:r,rowHeight:e=28,offsetTop:t=0,level:n=0,onClick:s,isExpanded:a})=>{const i={tr:"smp-groupRow-tr",td:"smp-groupRow-td"};return g.jsx("tr",{className:i.tr,style:{height:e,top:t,lineHeight:`${e}px`},onClick:s,children:g.jsxs("td",{className:i.td,style:{paddingLeft:10+n*20},children:[g.jsx(oe,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),g.jsx(Le,{variant:"title",bindValue:r})]})})};function Ss(r,e){const t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t}function ws(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 Es(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,y=o(l,m);for(const[x,w]of y){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 y of l){const x=((m=y.cells[p])==null?void 0:m.decode)??"N/D";d.has(x)||d.set(x,[]),d.get(x).push(y)}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 Ts=({groups:r=[],isDraggable:e=!0,isEditable:t=!0,onChange:n,onDrop:s,onDragOver:a})=>{const i=r.map(o=>({bindValue:o.column}));return g.jsxs("tr",{className:"smp-groupBar-container",onDragOver:a,onDrop:s,children:[g.jsx("td",{children:g.jsx(oe,{icon:"groups"})}),g.jsx("td",{children:g.jsx(Tt,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:n})})]})},Os=({columns:r,columnWidths:e})=>g.jsx("tfoot",{children:g.jsx("tr",{children:r.map(t=>t.visible&&g.jsx("td",{className:Ke["smp-headerCell"],style:{width:e[t.name],minWidth:e[t.name],maxWidth:e[t.name]}},t.name))})}),Rs=({columns:r,rows:e,containerRef:t,sizingMode:n})=>{const[s,a]=D.useState({});return D.useEffect(()=>{var i,o;if(!(!r||r.length===0)){if(n==="fixed"){const c=Object.fromEntries(r.map(f=>[f.name,120]));a(c)}else if(n==="fit-grid"){const u=((i=t.current)==null?void 0:i.offsetWidth)||800,c=r.filter(p=>p.visible!==!1),f=u/c.length,l=Object.fromEntries(c.map(p=>[p.name,f]));a(l)}else if(n==="fit-content"){const u={};for(const c of r){if(!c.visible)continue;const f=((o=c.title)==null?void 0:o.length)||0,l=Math.max(...e.map(p=>{var d,m,y,x;return`${((m=(d=p.cells)==null?void 0:d[c.name])==null?void 0:m.decode)||((x=(y=p.cells)==null?void 0:y[c.name])==null?void 0:x.value)||""}`.length}),f);u[c.name]=l*8+24}a(u)}}},[r,e,t,n]),[s,a]},js=({data:r,lineHeight:e=28,TableHeight:t=400,groups:n,columnSizingMode:s="fixed",showGroupBar:a=!0})=>{var $;const[i,o]=D.useState(r??{columns:[],rows:[]}),[u,c]=D.useState(n||[]),[f,l]=D.useState(new Set),p=D.useRef(null),[d,m]=Rs({columns:(i==null?void 0:i.columns)??[],rows:(i==null?void 0:i.rows)??[],containerRef:p,sizingMode:s});D.useEffect(()=>{if(u!=null&&u.length&&r.rows){const{flatRows:C}=Es(r.rows,u,e,f);o({...r,rows:C})}else o(r)},[r,u,f,e]);const y=C=>{c(ws(C,u))},x=C=>{C.preventDefault();const L=C.dataTransfer.getData("text/plain");if(!L||u.some(F=>F.column===L))return;const j=[...u,{column:L,visible:!0}];c(j)},w=C=>{C.preventDefault()},{virtualItems:E,containerProps:O,innerProps:S}=xr({items:(i==null?void 0:i.rows)??[],itemHeight:e,containerHeight:t,overscan:5}),v=(C,L)=>{const N=C.clientX,j=d[L],F=q=>{const Z=q.clientX-N,K=Math.max(50,j+Z);m(z=>({...z,[L]:K}))},W=()=>{window.removeEventListener("mousemove",F),window.removeEventListener("mouseup",W)};window.addEventListener("mousemove",F),window.addEventListener("mouseup",W)},P={smpTable:`${Ke["smp-table"]}`,headerCell:`${Ke["smp-headerCell"]}`,resizer:`${Ke["smp-resizer"]}`};return i&&g.jsx("div",{className:P.smpTable,...O,ref:p,children:g.jsxs("table",{children:[g.jsxs("thead",{children:[(n||a)&&g.jsx(Ts,{groups:u,onChange:y,onDrop:x,onDragOver:w}),g.jsx("tr",{children:i.columns&&(($=i.columns)==null?void 0:$.map(C=>C.visible&&g.jsxs("th",{className:P.headerCell,draggable:!0,onDragStart:L=>{L.dataTransfer.setData("text/plain",C.name)},style:{width:d[C.name],minWidth:d[C.name],maxWidth:d[C.name]},children:[g.jsx(Le,{variant:"title",bindValue:C.title}),g.jsx("div",{className:P.resizer,onMouseDown:L=>v(L,C.name),role:"region"})]},C.name)))})]}),g.jsx("tbody",{...S,children:E.map(({item:C,index:L,offsetTop:N})=>{const j=C.rowId||C.value||`${C.isGroup?"group":"row"}-${L}`;return C.isGroup?g.jsx(xs,{label:C.value||"",rowHeight:e,offsetTop:N,level:C.level,onClick:()=>{const F=C.rowId;F&&l(W=>Ss(W,F))},isExpanded:C.isExpanded},`group-${j}`):g.jsx(Pr,{row:C,columnWidths:d,rowHeight:e,offsetTop:N,isGroup:!1},`row-${j}`)})}),g.jsx(Os,{columns:i.columns,columnWidths:d})]})})},Ds=({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]=D.useState();D.useEffect(()=>{l(()=>{if(!r)return;const y={...r};return e&&(y.shape=e),y.shape==null&&(y.shape=re.TEXT_FIELD),s&&(y.obj=Ur(s)),y})},[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 g.jsxs("div",{className:d.container,children:[g.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:g.jsx(Rt,{...f,onChange:l,onOptionsRequest:c,fun:r==null?void 0:r.fun,onBlur:m,label:a,labelPosition:i})}),ce(t)&&g.jsx(Se,{optionalDisplayValue:"Confirm",onClick:()=>u==null?void 0:u(f),bindValue:"Confirm"})]})},_s=r=>(r==null?void 0:r.type)==="SmeupDataTree",$s=r=>(r==null?void 0:r.type)==="SmeupDataTable",Cs=r=>_s(r)?r.children?r.children.map(e=>({id:e.obj.k,label:e.value??""})):[]:$s(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}}):[],Ps=({data:r,readOnly:e=!1,hiddenSubmitButton:t=!1,optionsHandler:n,onSubmit:s})=>{const[a,i]=D.useState({});D.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(y=>y.visible??!0).reduce((y,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==re.AUTOCOMPLETE||w.shape==re.MULTI_AUTOCOMPLETE||w.shape==re.COMBOBOX||w.shape==re.RADIO)&&(w.onOptionsRequest=async(E,O)=>Cs(await n(E,O,r,x.name))),w.isEditable==null&&(w.isEditable=!0),e&&(w.isEditable=!1),w.isEditable&&w.shape==null&&(w.shape=re.TEXT_FIELD),{...y,[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&&g.jsxs("div",{"data-component":"input-panel",style:{display:"flex",flexDirection:"column",gap:"2rem",padding:"2rem"},children:[g.jsx(jt,{layout:r.rows[0].layout,cells:a}),!t&&g.jsx(Se,{onClick:o,bindValue:"submit",optionalDisplayValue:"Submit"})]})};exports.AppBar=ls;exports.Autocomplete=Et;exports.Button=Se;exports.ButtonList=Er;exports.Checkbox=Tr;exports.Combobox=Rr;exports.DashList=fs;exports.DataTableComponent=js;exports.DatePicker=_r;exports.Drawer=us;exports.Field=Ds;exports.Icon=oe;exports.InputPanel=Ps;exports.Password=$r;exports.Textfield=Ee;exports.configurePaths=mn;
|
|
48
|
+
${x?"smp-datepickercalendar-td-focused":""}
|
|
49
|
+
${O?"smp-datepickercalendar-td-disabled":""}`},B=()=>`${w[f]} ${d.toString()}`;return y.jsxs("div",{className:z.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[y.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[y.jsx(we,{onClick:D,ariaLabel:a(Et.PREVIOUS_MONTH),optionalDisplayValue:"<",appearance:"ghost",variant:"base",bindValue:"<"}),y.jsx("div",{"aria-label":B(),className:z.label,children:B()}),y.jsx(we,{onClick:$,ariaLabel:a(Et.NEXT_MONTH),bindValue:">",optionalDisplayValue:">",appearance:"ghost",variant:"base"})]}),y.jsxs("table",{ref:b,role:"grid","aria-label":`${a(ct.CALENDAR_FOR)} ${w[f]} ${d}`,className:z.table,children:[y.jsx("thead",{children:y.jsx("tr",{children:T.map(N=>y.jsx("th",{scope:"col",abbr:N.full,className:z.th,children:N.value},N.value))})}),y.jsx("tbody",{children:Z.map((N,h)=>y.jsx("tr",{children:N.map((x,O)=>{const P=h*7+O;if(x===null)return y.jsx("td",{className:z.td(!1,!1,!1,!0)},`empty-${O}`);const j=x.getDate()===o.getDate()&&x.getMonth()===o.getMonth()&&x.getFullYear()===o.getFullYear(),A=c&&x.getDate()===c.getDate()&&x.getMonth()===c.getMonth()&&x.getFullYear()===c.getFullYear(),V=m===x.getDate(),Y=S(x);return y.jsx("td",{role:"gridcell","aria-selected":A,tabIndex:V?0:-1,onClick:()=>v(x),onKeyDown:M=>_(M,P),"aria-label":`${x.getDate()} ${w[x.getMonth()]} ${x.getFullYear()}`,"data-selected":A,"aria-disabled":Y,ref:M=>{E.current[P]=M},className:z.td(j,A,V,Y),children:x.getDate()},`day-${O}`)})},`week-${h}`))})]})]})}const Ar=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,isEditable:s=!0,...a})=>{const[i,o]=R.useState(!1),[c,l]=R.useState(r||""),[f,u]=R.useState(""),{anchorRef:d,targetRef:p}=it({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&&w()}}),_t(i,p);const{format:m,getCurrentLanguage:g}=Fe(),b=R.useCallback($=>{const C=$.length>5&&Kr($,g())||$,k=m(C,void 0,void 0,{type:"date"}),I=typeof C!="string",_=I&&C.toISOString().substring(0,10)||"";return{isValid:I,formattedDate:k,isoDate:_,normalizedDate:C}},[g,m]);R.useEffect(()=>{const{formattedDate:$,isoDate:C,isValid:k}=b(r);l(k&&C||r),u(k&&$||r)},[r,m,b]);const E=()=>o($=>!$),w=()=>{S(f)},T=$=>{S($),o(!1)},S=$=>{const{isoDate:C,isValid:k}=b($);t&&t(k&&C||$)},v=$=>{u($)},D=$=>{$.key==="Enter"&&($.preventDefault(),S(f))};return y.jsxs("div",{"data-component":"date-picker",children:[y.jsx(xe,{bindValue:f,placeholder:e,onBlur:w,onChange:v,onKeyDown:D,shapeIcon:"calendar",onShapeIconClick:E,ref:d,isEditable:s,...a}),i&&y.jsx(ot,{children:y.jsx(as,{disabledDateRanges:n,onDateChange:T,initialValue:Ot(c)&&c||"",targetRef:p})})]})},is=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,isEditable:s=!0,placeholder:a,label:i,disabled:o,fun:c,error:l,onOptionsRequest:f,onChange:u,onBlur:d})=>{const p=r.map(b=>b.bindValue),m=(b,E)=>{const w=[...r];if(b=="")w.pop();else{const T=w.findIndex(S=>S.bindValue===b&&S.optionalDisplayValue===E);T>=0?w.splice(T,1):w.push({bindValue:b,optionalDisplayValue:E})}u==null||u(w)},g={container:"smp-multipleAutocomplete-container"};return y.jsxs("div",{className:g.container,"data-component":"multiple-autocomplete",children:[i&&y.jsx(De,{label:i,disabled:o}),y.jsx(Dt,{elements:r,displayMode:e,isEditable:s,onChange:b=>{u==null||u(b)}}),y.jsx(Rt,{bindValue:"",fun:c,isEditable:s,onChange:m,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:a,onOptionsRequest:f,_multiActiveIndex:p,error:l,onBlur:d})]})},Je={"smp-radio":"_smp-radio_1vo2u_1","smp-radio-horizontal":"_smp-radio-horizontal_1vo2u_10","smp-radio-element":"_smp-radio-element_1vo2u_14","smp-radio-disabled":"_smp-radio-disabled_1vo2u_20"},os=({disabled:r=!1,displayMode:e="DescOnly",horizontal:t=!1,options:n,onOptionsRequest:s,fun:a,...i})=>{const[o,c]=R.useState(n);R.useEffect(()=>{!o&&s&&a&&s(a,void 0).then(p=>c(p)).catch(p=>{console.error("Errore nel caricamento delle opzioni per ButtonList",p)})},[o,s,a]);const l={container:`${Je["smp-radio"]} ${t?Je["smp-radio-horizontal"]:""}`,option:`${Je["smp-radio-element"]} ${r?Je["smp-radio-disabled"]:""}`},f=()=>{var p;r||(p=i.onBlur)==null||p.call(i)},u=p=>{var m;r||(m=i.onChange)==null||m.call(i,p.target.value)},d=R.useId();return y.jsx("div",{"smp-id":"radio-container",className:l.container,children:o==null?void 0:o.map((p,m)=>y.jsxs("label",{className:l.option,children:[y.jsx("input",{type:"radio",name:d,value:p.id,disabled:r,checked:p.id===i.bindValue,onChange:u,onBlur:f}),Le(p.id,p.label,e)]},m))})},kr=({...r})=>{const[e,t]=R.useState(!1),n=e?"visibility-off":"visibility";return y.jsx(xe,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},ls=({...r})=>{const[e,t]=R.useState(r.bindValue),{translate:n}=Fe(),s=a=>{var i;a.key==="Enter"&&(a.preventDefault(),(i=r.onEnter)==null||i.call(r,e))};return y.jsx(xe,{...r,placeholder:r.placeholder?r.placeholder:n(ct.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})},cs=({bindValue:r,optionalDisplayValue:e,label:t})=>{const n={wrapper:"smp-text-wrapper"};return t?y.jsxs("div",{className:n.wrapper,children:[y.jsx(De,{label:t}),y.jsx(Ie,{variant:"body",bindValue:e||r})]}):y.jsx(Ie,{variant:"body",bindValue:e||r})};class Ee{constructor(e,t){ye(this,"class");ye(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Ee(e,e.k==""?[]:e.k.split(";"))}static fromString(e){return new Ee({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const Pe=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t??r.decode,shape:r.shape,fun:r.fun}),gr=r=>{const e=Ee.fromDataObj(r.obj),t=r.decode?Ee.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},us=(r,e)=>{const t=new Ee(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new Ee(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return Pe(r,t,n)},fs=({disabled:r,bindValue:e,onChange:t,placeholder:n,state:s,appearance:a,isEditable:i,label:o,ariaLabel:c,helperText:l,error:f,onBlur:u,onKeyDown:d})=>{const p=R.useId(),m=`${p}-helper`,g=f?"danger":s,b=l||!!f,E=T=>{t==null||t(T.target.value)},w={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 y.jsxs("div",{className:w.wrapper,"data-component":"textarea",children:[o&&y.jsx(De,{htmlFor:p,label:o,disabled:r}),y.jsx("textarea",{id:p,value:e,placeholder:n,onChange:E,onBlur:u,className:w.container,disabled:r,readOnly:!i,onKeyDown:d,"aria-label":o?void 0:c,"aria-labelledby":o?p:void 0,"aria-describedby":b?m:void 0}),b&&y.jsx(xr,{id:m,helperText:f,disabled:r,state:g})]})},ds=({value:r,onChange:e,targetRef:t})=>{const[n,s,a]=r,i=o=>Array.from({length:o},(c,l)=>y.jsx("option",{value:l,children:l.toString().padStart(2,"0")},l));return y.jsxs("div",{className:"smp-timepicker-widget",ref:t,children:[y.jsx("select",{value:n,onChange:o=>e(+o.target.value,s,a),id:"time-picker-hours",children:i(24)}),":",y.jsx("select",{value:s,onChange:o=>e(n,+o.target.value,a),id:"time-picker-minutes",children:i(60)}),":",y.jsx("select",{value:a||0,onChange:o=>e(n,s,+o.target.value),id:"time-picker-seconds",children:i(60)})]})},yr=r=>{const e=r.match(/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/);if(!e)return!1;const[,t,n,s]=e,a=parseInt(t,10),i=parseInt(n,10),o=s?parseInt(s,10):0;return a>=0&&a<=23&&i>=0&&i<=59&&(s===void 0||o>=0&&o<=59)},ps=r=>{const e=r.split(":").map(t=>parseInt(t,10));return[e[0]||0,e[1]||0,e[2]||0]},hs=(r,e,t)=>{const n=r.toString().padStart(2,"0"),s=e.toString().padStart(2,"0"),a=t.toString().padStart(2,"0");return`${n}:${s}:${a}`},ms=({bindValue:r,placeholder:e="HH:MM:SS",onChange:t,isEditable:n=!0})=>{const[s,a]=R.useState(!1),[i,o]=R.useState(r||""),[c,l]=R.useState(""),{anchorRef:f,targetRef:u}=it({position:"bottom",enabled:s});ke(u,()=>a(!1)),_t(s,u),R.useEffect(()=>{const w=r||"",T=yr(w)?w:r||"";o(w),l(T)},[r]),R.useEffect(()=>{const w=T=>{T.key==="Escape"&&a(!1)};return s&&document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w)}},[s]);const d=()=>{n&&a(w=>!w)},p=w=>{l(w)},m=(w,T,S)=>{const v=hs(w,T,S);o(v),l(v),t==null||t(v),a(!1)},g=()=>{E(c)},b=w=>{w.key==="Enter"&&(w.preventDefault(),E(c))},E=w=>{if(w.trim()===""){o(""),l(""),t==null||t("");return}yr(w)?(o(w),l(w),t==null||t(w)):l(w)};return y.jsxs("div",{"data-component":"time-picker",children:[y.jsx(xe,{bindValue:c,placeholder:e,onChange:p,onBlur:g,onKeyDown:b,shapeIcon:"clock",onShapeIconClick:d,isEditable:n,ref:f}),s&&y.jsx(ot,{children:y.jsx(ds,{value:ps(i),onChange:m,targetRef:u})})]})};class at{constructor(e,t){ye(this,"class");ye(this,"time");this.class=e,this.time=t}static fromDataObj(e){const t=vr.get(`${e.t}${e.p}`);if(t)return new at(e,t.legacyToIso(e.k));throw new Error(`time creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=vr.get(`${this.class.t}${this.class.p}`);if(e)return e.isoToLegacy(this.time);throw new Error(`Time object not implemented ${this.class.t}${this.class.p}`)}getValue(){return this.time}}const vr=new Map([["I12",{legacyToIso(r){return`${r.substring(0,2)}:${r.substring(2,4)}:${r.substring(4,6)}`},isoToLegacy(r){return r.replaceAll(":","")||r}}]]),Ve=({decode:r,shape:e,obj:t,data:n,icon:s,fun:a,placeholderIcon:i,label:o,options:c,onChange:l,onClick:f,onEnter:u,onBlur:d,onOptionsRequest:p,isEditable:m})=>{const g={obj:t,shape:e,decode:r,icon:s,fun:a},b={onBlur:d,onOptionsRequest:p,fun:a,icon:s,label:o,isEditable:m,...n},E=(S,v,D)=>Hr(t)?Pe(S,new et(t,v).getLegacyValue()):Gr(t)?Pe(S,new at(t,v).getLegacyValue()):Pe(S,v,D),w=S=>Pe(g,new Qe(t,S).getLegacyValue()),T=S=>us(g,S);switch(e){case ne.AUTOCOMPLETE:{const S={...b,bindValue:t.k,optionalDisplayValue:r,onChange:(v,D)=>{l==null||l(E(g,v,D))}};return y.jsx(Rt,{...S})}case ne.BUTTON:{const S={...b,bindValue:t.k,optionalDisplayValue:r,onClick:()=>{f==null||f(E(g,t.k))}};return y.jsx(we,{...S})}case ne.BUTTON_LIST:{const S={...b,options:c,onClick:(v,D)=>{const $={...g,fun:D};f==null||f(E($,v))}};return y.jsx(Dr,{...S})}case ne.COMBOBOX:{const S={...b,bindValue:t.k,optionalDisplayValue:r,onChange:(v,D)=>{l==null||l(E(g,v,D))}};return y.jsx($r,{...S})}case ne.RADIO:{const S={...b,bindValue:t.k,onChange:v=>{l==null||l(E(g,v))}};return y.jsx(os,{...S})}case ne.SWITCH:case ne.CHECKBOX:{const S=e===ne.SWITCH,v={...b,bindValue:Qe.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:D=>{l==null||l(w(D))},...S&&{variant:"switch"}};return y.jsx(_r,{...v})}case ne.CHIP:{const S={...b,elements:gr(g)};return y.jsx(Dt,{...S})}case ne.DATE:{const S={...b,bindValue:et.fromDataObj(t).getValue(),onChange:v=>{l==null||l(E(g,v))}};return y.jsx(Ar,{...S})}case ne.ICON:case ne.IMAGE:{const S={...b,icon:s,placeholderIcon:i,isInteractable:!!b.fun,onClick:()=>{f==null||f(E(g,t.k))}};return y.jsx(oe,{...S})}case ne.MULTI_AUTOCOMPLETE:{const S={...b,elements:gr(g),onChange:v=>{l==null||l(T(v))}};return y.jsx(is,{...S})}case ne.MEMO:{const S={...b,bindValue:t.k,optionalDisplayValue:r,onChange:v=>{l==null||l(E(g,v))}};return y.jsx(fs,{...S})}case ne.PASSWORD:{const S={...b,bindValue:t.k,onChange:v=>{l==null||l(E(g,v))}};return y.jsx(kr,{...S})}case ne.SPOTLIGHT:{const S={...b,bindValue:t.k,onEnter:v=>{u==null||u(E(g,v))}};return y.jsx(ls,{...S})}case ne.TEXT_FIELD:{const S={...b,bindValue:t.k,optionalDisplayValue:r,onChange:v=>{l==null||l(E(g,v))}};return y.jsx(xe,{...S})}case ne.TIME:{const S={...b,bindValue:at.fromDataObj(t).getValue(),onChange:v=>{l==null||l(E(g,v))}};return y.jsx(ms,{...S})}default:{const S={...b,bindValue:t.k,optionalDisplayValue:r};return y.jsx(cs,{...S})}}},gs=({data:r,onClick:e,onEnter:t})=>{var i,o;const[n,s]=R.useState(),a=R.useCallback(c=>{var f,u;if(!((f=c.rows)!=null&&f.length)||!((u=c.columns)!=null&&u.length))return{};const l=c.rows[0];return c.columns.filter(d=>d.visible).reduce((d,p)=>{const m=l.cells[p.name],g={...m,id:p.name,onChange:b=>{s(E=>E&&{...E,[p.name]:{...E[p.name],obj:{...E[p.name].obj,k:b.obj.k}}})},onClick:()=>{m.fun&&e&&e({...m})},onEnter:b=>{t&&t(b)}};return{...d,[p.name]:g}},{})},[e,t]);return R.useEffect(()=>{r&&s(a(r))},[r,a]),!((i=r==null?void 0:r.rows)!=null&&i.length)||!((o=r.columns)!=null&&o.length)?null:n&&y.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:y.jsx(Tt,{layout:r.rows[0].layout,children:Object.values(n).map(c=>y.jsx(Ve,{...c}))})})},ys=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,vs=({data:r,logo:e,open:t,minifiedOnClose:n=!0,customHeight:s="100vh",onClick:a,onEnter:i,onClose:o,loadOptions:c})=>{var T,S;const[l,f]=R.useState(),[u,d]=R.useState(t??!0),p=R.useRef(null),m=s.trim()?s:"100vh",g=R.useCallback(v=>{var $,C;if(!(($=v==null?void 0:v.rows)!=null&&$.length)||!((C=v==null?void 0:v.columns)!=null&&C.length))return{};const D=v.rows[0];return v.columns.filter(k=>k.visible??!0).reduce((k,I)=>{const _=D.cells[I.name];if(!_||!u&&ce(n)&&_.shape!==ne.BUTTON&&_.shape!==ne.BUTTON_LIST)return k;const F={..._,id:I.name,onChange:W=>{f(q=>{const Z={...q};return Z!=null&&Z[I.name]&&(Z[I.name].obj.k=W.obj.k),Z})},onClick:W=>{W.fun&&a&&a(W)},onEnter:W=>{i&&i(W)}};return c&&_.shape==ne.BUTTON_LIST&&(F.onOptionsRequest=(W,q)=>c(W,q).then(Z=>ys(Z))),!u&&ce(n)&&(F.data={...F.data,showText:!1,justify:"center"}),{...k,[I.name]:F}},{})},[u,n,a,i,c]),b=R.useCallback(()=>{o==null||o()},[o]),E=()=>{ce(n)?d(v=>!v):(d(!1),o==null||o())};if(R.useEffect(()=>{f(g(r))},[r]),R.useEffect(()=>{if(!p.current)return;if(!ce(n)){f(g(r));return}const v=getComputedStyle(p.current).getPropertyValue("--smp-drawer-slide-transition");let D=Number(v);v.endsWith("ms")?D=parseFloat(v):v.endsWith("s")&&(D=parseFloat(v)*1e3),setTimeout(()=>{f(g(r))},D/2)},[u,n]),R.useEffect(()=>{t!==void 0&&!ce(n)&&d(t)},[n,t]),!((T=r==null?void 0:r.rows)!=null&&T.length)||!((S=r.columns)!=null&&S.length))return null;const w={drawer:`smp-drawer ${ce(n)?"smp-drawer-minified":"smp-drawer-fixed"} ${u?"smp-drawer-open":""} ${!ce(n)&&!u?"smp-drawer-no-border":""}`,container:"smp-drawer-container",containerHeader:"smp-drawer-container-header",containerIcon:`${u?"":"smp-drawer-container-icon-close"} smp-drawer-container-icon`,containerLayout:"smp-drawer-container-layout",containerLogo:"smp-drawer-container-logo",backdrop:`smp-drawer-backdrop ${u?"smp-drawer-backdrop-open":""}`};return l&&y.jsxs(y.Fragment,{children:[!ce(n)&&y.jsx("div",{"aria-hidden":"true","aria-label":"drawer-backdrop",className:w.backdrop,onClick:b}),y.jsx("aside",{ref:p,className:w.drawer,style:{height:m},"aria-label":"Drawer","smp-id":"drawer",children:y.jsxs("div",{className:w.container,children:[y.jsxs("div",{className:w.containerHeader,children:[e&&y.jsx("div",{className:w.containerLogo,children:y.jsx(oe,{icon:e,title:"drawer_logo",width:"100%",height:24})}),y.jsx("div",{className:w.containerIcon,children:y.jsx(oe,{icon:ce(n)?"menu_close":"close",title:"drawer_icon",rotated:!u,isInteractable:!0,onClick:E,width:20,height:20})})]}),y.jsx("div",{className:w.containerLayout,children:y.jsx(Tt,{layout:r.rows[0].layout,children:Object.values(l).map(v=>y.jsx(Ve,{...v}))})})]})})]})},bs=({ColumnsNumber:r=1,data:e={},ForceText:t,TextColName:n,TextColor:s="var(--smp-dashList-color-base)",Fillspace:a,FontSize:i,Horizontal:o,ForceIcon:c,IconColName:l,IconColor:f="var(--smp-dashList-color-base)",NumberFormat:u,ForceUM:d,UmColName:p,UmColor:m="var(--smp-dashList-color-base)",ForceValue:g,ValueColName:b,ValueColor:E="var(--smp-dashList-color-base)",SelectLayout:w="1",onClick:T})=>{const S="N/A",v=(e==null?void 0:e.columns)||[],D=(e==null?void 0:e.rows)||[],$=D.length>0,C="--smp-dashList-color",k="smp-layout",I="descr",_="icon",F="um",W="value",q=i||"1em",Z="18px",K="--smp-dashList-columns",z="--smp-dashList-fontSize",B={dash:(U="1")=>{const X=h(U),te=X,re=x(X,I),fe=x(X,_),ve=x(X,F),pe=x(X,W);return{container:te,descr:re,icon:fe,um:ve,value:pe}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
|
|
50
|
+
${ce(o)?"smp-dash-list-horizontal":""}`},{format:N}=Fe(),h=U=>`${k}-${U}`,x=(U,X)=>`${U}__${X}`,O=U=>`${C}-${U}`,P=U=>{const X=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(X.test(U)){const re=U.match(X)||[];if((re==null?void 0:re.length)>3)return"rgb("+re[1]+","+re[2]+","+re[3]+")"}return U},j=U=>{if(!u)return U;const[X,te]=A(u).map(Te=>parseInt(Te||"0")),re="0,0"+(te?"."+"0".repeat(te):""),fe=N(U,re,"it");if(!X)return fe;const[ve,pe]=fe.split(",");return ve+(pe?`,${pe}`:"")},A=U=>U.includes(";")?U.split(";"):[U],V=U=>{const X=re=>{var fe;if(re)return(fe=U==null?void 0:U.cells[re])==null?void 0:fe.obj.k},te=re=>{var fe,ve;if(!(v.length<=re))return(ve=(fe=U==null?void 0:U.cells[v[re].name])==null?void 0:fe.obj)==null?void 0:ve.k};return{descr:t||X(n)||te(2)||"",icon:c||X(l)||te(3)||"",um:d||X(p)||te(1)||"",value:g||X(b)||te(0)||""}},Y=U=>{T==null||T(U)},M=(U,X)=>{(U.key==="Enter"||U.key===" ")&&(U.preventDefault(),U.stopPropagation(),Y(X))},H=(U=>{const X=B.dash(U);return{className:X,descr:te=>y.jsx("div",{className:X.descr,children:te},`${U}-${I}`),icon:te=>y.jsx("div",{className:X.icon,children:y.jsx(oe,{color:f,height:Z,icon:te,width:Z})},`${U}-${_}`),um:te=>y.jsx("div",{className:X.um,children:te},`${U}-${F}`),value:te=>y.jsx("div",{className:X.value,children:te},`${U}-${W}`)}})(w),se=U=>{const{descr:X,icon:te,um:re,value:fe}=V(U),ve={[O(I)]:P(s),[O(F)]:P(m),[O(W)]:P(E)},pe=[],Te=j(fe);switch(w){case"2":te&&pe.push(H.icon(te)),pe.push(H.descr(X)),pe.push(H.value(re?Te+" "+re:Te));break;default:case"1":pe.push(H.descr(X)),pe.push(H.value(re?Te+" "+re:Te))}return y.jsx("div",{className:H.className.container,role:"button",style:ve,tabIndex:0,onClick:()=>Y(U),onKeyDown:Ir=>M(Ir,U),children:pe},U.rowId)},L={[K]:String(r),[z]:q};return y.jsx("div",{className:B.dashList,style:L,children:$?D.map(U=>se(U)):S})},Xe={"smp-table":"_smp-table_1qmju_1","smp-headerCell":"_smp-headerCell_1qmju_35","smp-resizer":"_smp-resizer_1qmju_44"},xs="_rowContent_20wit_2",Ss="_clickable_20wit_21",ws="_indent_20wit_26",Es="_toggle_20wit_32",Ts="_cell_20wit_38",Os="_leftSection_20wit_46",Se={rowContent:xs,clickable:Ss,indent:ws,toggle:Es,cell:Ts,leftSection:Os};function Ze(r){return!!r&&"children"in r}function js(r){return!Ze(r)}function Rs(r){const e=JSON.stringify(r,Object.keys(r).sort());let t=0,n,s;if(e.length===0)return t.toString();for(n=0;n<e.length;n++)s=e.charCodeAt(n),t=(t<<5)-t+s,t|=0;return Math.abs(t).toString()}const Lr=({row:r,columnWidths:e={},level:t=0,rowHeight:n=26,offsetTop:s})=>{var w;const[a,i]=R.useState(!1),o=Ze(r)&&!!((w=r.children)!=null&&w.length),c=r.cells&&Object.keys(r.cells).length>0,l=o,f=t*20,u=()=>{o&&i(!a)},d={content:`${Se.rowContent} ${o?Se.clickable:""}`,toggle:`${Se.toggle}`,indent:`${Se.indent}`,cell:`${Se.cell}`},p=T=>y.jsx(Ve,{...T}),m=()=>y.jsx("span",{className:d.toggle,children:l&&y.jsx(oe,{icon:a?"arrow_drop_right":"arrow_drop_down",width:16})}),g=()=>y.jsx("span",{className:d.indent,style:{width:`${f}px`},"aria-hidden":"true"}),b=()=>{const T=js(r)?"":r.decode||(c?"":"Untitled"),S=s??n*t;return y.jsxs("tr",{className:d.content,onClick:u,role:o?"button":"row","aria-expanded":o?!a:void 0,style:{height:`${n}px`,lineHeight:`calc(${n}px - 2*2px)`,transform:`translateY(${S}px)`},children:[Ze(r)&&y.jsxs("td",{className:Se.leftSection,style:{height:`${n}px`},children:[g(),m(),y.jsx("span",{className:Se.rowLabel,children:T})]}),r.cells&&Object.keys(r.cells).length>0&&Object.entries(r.cells).map(([v,D])=>y.jsx("td",{className:d.cell,style:{width:e[v],minWidth:e[v],height:`${n}px`},children:p({...D,id:v})},Rs(D)||v))]})},E=()=>{var T;return a||!o?null:y.jsx(y.Fragment,{children:Ze(r)&&((T=r.children)==null?void 0:T.map((S,v)=>y.jsx(Lr,{row:S,level:t+1},`child-${v}`)))})};return y.jsxs(y.Fragment,{children:[b(),E()]})},Ds=({label:r,rowHeight:e=28,offsetTop:t=0,level:n=0,onClick:s,isExpanded:a})=>{const i={tr:"smp-groupRow-tr",td:"smp-groupRow-td"};return y.jsx("tr",{className:i.tr,style:{height:e,top:t,lineHeight:`${e}px`},onClick:s,children:y.jsxs("td",{className:i.td,style:{paddingLeft:10+n*20},children:[y.jsx(oe,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),y.jsx(Ie,{variant:"title",bindValue:r})]})})};function _s(r,e){const t=new Set(r);return t.has(e)?t.delete(e):t.add(e),t}function $s(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 Cs(r,e,t,n){const s=[];let a=0;return i(r,0,[]),{flatRows:s,offset:a};function i(u,d,p){if(d>=e.length){f(u);return}const m=e[d].column,g=o(u,m);for(const[b,E]of g){const w=[...p,b],T=c(w,d),S=n.has(T);s.push(l(b,T,d,S)),a+=t,S&&i(E,d+1,w)}}function o(u,d){var m;const p=new Map;for(const g of u){const b=((m=g.cells[d])==null?void 0:m.decode)??"N/D";p.has(b)||p.set(b,[]),p.get(b).push(g)}return p}function c(u,d){return`group-${u.join("-")}-${d}`}function l(u,d,p,m){return{isGroup:!0,value:u,cells:{},rowId:d,level:p,isExpanded:m}}function f(u){for(const d of u)s.push(d),a+=t}}const Ps=({groups:r=[],isDraggable:e=!0,isEditable:t=!0,onChange:n,onDrop:s,onDragOver:a})=>{const i=r.map(o=>({bindValue:o.column}));return y.jsxs("tr",{className:"smp-groupBar-container",onDragOver:a,onDrop:s,children:[y.jsx("td",{children:y.jsx(oe,{icon:"groups"})}),y.jsx("td",{children:y.jsx(Dt,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:n})})]})},As=({columns:r,columnWidths:e})=>y.jsx("tfoot",{children:y.jsx("tr",{children:r.map(t=>t.visible&&y.jsx("td",{className:Xe["smp-headerCell"],style:{width:e[t.name],minWidth:e[t.name],maxWidth:e[t.name]}},t.name))})}),ks=({columns:r,rows:e,containerRef:t,sizingMode:n})=>{const[s,a]=R.useState({});return R.useEffect(()=>{var i,o;if(!(!r||r.length===0)){if(n==="fixed"){const l=Object.fromEntries(r.map(f=>[f.name,120]));a(l)}else if(n==="fit-grid"){const c=((i=t.current)==null?void 0:i.offsetWidth)||800,l=r.filter(d=>d.visible!==!1),f=c/l.length,u=Object.fromEntries(l.map(d=>[d.name,f]));a(u)}else if(n==="fit-content"){const c={};for(const l of r){if(!l.visible)continue;const f=((o=l.title)==null?void 0:o.length)||0,u=Math.max(...e.map(d=>{var p,m,g,b;return`${((m=(p=d.cells)==null?void 0:p[l.name])==null?void 0:m.decode)||((b=(g=d.cells)==null?void 0:g[l.name])==null?void 0:b.value)||""}`.length}),f);c[l.name]=u*8+24}a(c)}}},[r,e,t,n]),[s,a]},Ls=({data:r,lineHeight:e=28,TableHeight:t=400,groups:n,columnSizingMode:s="fixed",showGroupBar:a=!0})=>{var $;const[i,o]=R.useState(r??{columns:[],rows:[]}),[c,l]=R.useState(n||[]),[f,u]=R.useState(new Set),d=R.useRef(null),[p,m]=ks({columns:(i==null?void 0:i.columns)??[],rows:(i==null?void 0:i.rows)??[],containerRef:d,sizingMode:s});R.useEffect(()=>{if(c!=null&&c.length&&r.rows){const{flatRows:C}=Cs(r.rows,c,e,f);o({...r,rows:C})}else o(r)},[r,c,f,e]);const g=C=>{l($s(C,c))},b=C=>{C.preventDefault();const k=C.dataTransfer.getData("text/plain");if(!k||c.some(F=>F.column===k))return;const _=[...c,{column:k,visible:!0}];l(_)},E=C=>{C.preventDefault()},{virtualItems:w,containerProps:T,innerProps:S}=Or({items:(i==null?void 0:i.rows)??[],itemHeight:e,containerHeight:t,overscan:5}),v=(C,k)=>{const I=C.clientX,_=p[k],F=q=>{const Z=q.clientX-I,K=Math.max(50,_+Z);m(z=>({...z,[k]:K}))},W=()=>{window.removeEventListener("mousemove",F),window.removeEventListener("mouseup",W)};window.addEventListener("mousemove",F),window.addEventListener("mouseup",W)},D={smpTable:`${Xe["smp-table"]}`,headerCell:`${Xe["smp-headerCell"]}`,resizer:`${Xe["smp-resizer"]}`};return i&&y.jsx("div",{className:D.smpTable,...T,ref:d,children:y.jsxs("table",{children:[y.jsxs("thead",{children:[(n||a)&&y.jsx(Ps,{groups:c,onChange:g,onDrop:b,onDragOver:E}),y.jsx("tr",{children:i.columns&&(($=i.columns)==null?void 0:$.map(C=>C.visible&&y.jsxs("th",{className:D.headerCell,draggable:!0,onDragStart:k=>{k.dataTransfer.setData("text/plain",C.name)},style:{width:p[C.name],minWidth:p[C.name],maxWidth:p[C.name]},children:[y.jsx(Ie,{variant:"title",bindValue:C.title}),y.jsx("div",{className:D.resizer,onMouseDown:k=>v(k,C.name),role:"region"})]},C.name)))})]}),y.jsx("tbody",{...S,children:w.map(({item:C,index:k,offsetTop:I})=>{const _=C.rowId||C.value||`${C.isGroup?"group":"row"}-${k}`;return C.isGroup?y.jsx(Ds,{label:C.value||"",rowHeight:e,offsetTop:I,level:C.level,onClick:()=>{const F=C.rowId;F&&u(W=>_s(W,F))},isExpanded:C.isExpanded},`group-${_}`):y.jsx(Lr,{row:C,columnWidths:p,rowHeight:e,offsetTop:I,isGroup:!1},`row-${_}`)})}),y.jsx(As,{columns:i.columns,columnWidths:p})]})})},Is=({data:r,Type:e,ShowSubmit:t=!1,SubmitPosition:n="Right",DefaultValue:s,Label:a,LabelPosition:i="Left",onBlur:o,onClick:c,onOptionsRequest:l})=>{const[f,u]=R.useState();R.useEffect(()=>{u(()=>{if(!r)return;const g={...r};return e&&(g.shape=e),g.shape==null&&(g.shape=ne.TEXT_FIELD),s&&(g.obj=qr(s)),g})},[r,s,e]);const p={container:`smp-field-container ${ce(t)?`smp-field-position-${n}`:""}`},m=()=>{ce(t)||o==null||o(f)};if(f)return y.jsxs("div",{className:p.container,children:[y.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:y.jsx(Ve,{...f,id:"FLD",onChange:u,onOptionsRequest:l,fun:r==null?void 0:r.fun,onBlur:m,label:a,labelPosition:i})}),ce(t)&&y.jsx(we,{optionalDisplayValue:"Confirm",onClick:()=>c==null?void 0:c(f),bindValue:"Confirm"})]})},Ns=r=>(r==null?void 0:r.type)==="SmeupDataTree",Ms=r=>(r==null?void 0:r.type)==="SmeupDataTable",Fs=r=>Ns(r)?r.children?r.children.map(e=>({id:e.obj.k,label:e.value??""})):[]:Ms(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}}):[],Vs=({data:r,readOnly:e=!1,hiddenSubmitButton:t=!1,optionsHandler:n,onSubmit:s,onCheck:a,onCheckObj:i})=>{const[o,c]=R.useState({}),{translate:l}=Fe();R.useEffect(()=>{c(p(r))},[r]);const f=(g,b)=>{c(E=>({...E,[g]:{...E[g],obj:{...E[g].obj,k:b.obj.k},decode:b.decode,data:{...E[g].data,error:void 0}}}))},u=()=>{const g=m();s({value:g})},d=async g=>{var b,E;if((b=o[g].inputSettings)!=null&&b.checkObject&&i&&((await i({obj:o[g].obj,fun:o[g].fun,cellId:g})).valid||c(T=>({...T,[g]:{...T[g],data:{...T[g].data,error:l(ct.CHECK_OBJECT_WRONG_VALIDATION)}}}))),(E=o[g].inputSettings)!=null&&E.checkValueOnExit){const w=m();a==null||a({value:w,cell:g})}},p=g=>{var E,w,T;if(!((E=g.rows)!=null&&E.length)||!((w=g.columns)!=null&&w.length))return{};const b=(T=g.rows)==null?void 0:T[0];return g.columns.filter(S=>S.visible??!0).reduce((S,v)=>{const D={...b.cells[v.name],id:v.name,label:v.title};return D.fun&&(D.onOptionsRequest=async($,C)=>Fs(await n($,C,r,v.name))),D.isEditable==null&&(D.isEditable=!0),e&&(D.isEditable=!1),D.isEditable&&D.shape==null&&(D.shape=ne.TEXT_FIELD),{...S,[v.name]:D}},{})},m=()=>({before:r,after:{type:"SmeupDataTable",columns:JSON.parse(JSON.stringify(r.columns)),rows:[{cells:JSON.parse(JSON.stringify(o))}]}});return o&&y.jsxs("div",{"data-component":"input-panel",style:{display:"flex",flexDirection:"column",gap:"2rem",padding:"2rem"},children:[y.jsx(Tt,{layout:r.rows[0].layout,children:Object.values(o).map(g=>y.jsx(Ve,{...g,onChange:b=>f(g.id,b),onBlur:()=>d(g.id)}))}),!t&&y.jsx(we,{onClick:u,bindValue:"submit",optionalDisplayValue:"Submit"})]})};exports.AppBar=gs;exports.Autocomplete=Rt;exports.Button=we;exports.ButtonList=Dr;exports.Checkbox=_r;exports.Combobox=$r;exports.DashList=bs;exports.DataTableComponent=Ls;exports.DatePicker=Ar;exports.Drawer=vs;exports.Field=Is;exports.Icon=oe;exports.InputPanel=Vs;exports.Password=kr;exports.Textfield=xe;exports.configurePaths=xn;
|