@sme.up/ketchup2 2.0.0-SNAPSHOT-20250702073840 → 2.0.0-SNAPSHOT-20250702074628

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";var Yr=Object.defineProperty;var Ur=(r,e,t)=>e in r?Yr(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var de=(r,e,t)=>Ur(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),Wr=require("react-dom");function Br(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 Be=Br(R);var He={exports:{}},Ie={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("react"),Yn=require("react-dom");function Un(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const We=Un(T);var Be={exports:{}},Ae={};/**
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 Pt;function Hr(){if(Pt)return Ie;Pt=1;var r=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,s,a){var i=null;if(a!==void 0&&(i=""+a),s.key!==void 0&&(i=""+s.key),"key"in s){a={};for(var o in s)o!=="key"&&(a[o]=s[o])}else a=s;return s=a.ref,{$$typeof:r,type:n,key:i,ref:s!==void 0?s:null,props:a}}return Ie.Fragment=e,Ie.jsx=t,Ie.jsxs=t,Ie}var Ne={};/**
9
+ */var Lt;function Wn(){if(Lt)return Ae;Lt=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(r,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:n,type:r,key:i,ref:s!==void 0?s:null,props:a}}return Ae.Fragment=e,Ae.jsx=t,Ae.jsxs=t,Ae}var Ie={};/**
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 At;function Gr(){return At||(At=1,process.env.NODE_ENV!=="production"&&function(){function r(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===k?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case y:return"Fragment";case O:return"Profiler";case x:return"StrictMode";case b:return"Suspense";case $:return"SuspenseList";case T: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 p:return"Portal";case S:return(h.displayName||"Context")+".Provider";case w:return(h._context.displayName||"Context")+".Consumer";case E:var v=h.render;return h=h.displayName,h||(h=v.displayName||v.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case M:return v=h.displayName||null,v!==null?v:r(h.type)||"Memo";case A:v=h._payload,h=h._init;try{return r(h(v))}catch{}}return null}function e(h){return""+h}function t(h){try{e(h);var v=!1}catch{v=!0}if(v){v=console;var _=v.error,P=typeof Symbol=="function"&&Symbol.toStringTag&&h[Symbol.toStringTag]||h.constructor.name||"Object";return _.call(v,"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===y)return"<>";if(typeof h=="object"&&h!==null&&h.$$typeof===A)return"<...>";try{var v=r(h);return v?"<"+v+">":"<...>"}catch{return"<...>"}}function s(){var h=j.A;return h===null?null:h.getOwner()}function a(){return Error("react-stack-top-frame")}function i(h){if(D.call(h,"key")){var v=Object.getOwnPropertyDescriptor(h,"key").get;if(v&&v.isReactWarning)return!1}return h.key!==void 0}function o(h,v){function _(){I||(I=!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)",v))}_.isReactWarning=!0,Object.defineProperty(h,"key",{get:_,configurable:!0})}function l(){var h=r(this.type);return Y[h]||(Y[h]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),h=this.props.ref,h!==void 0?h:null}function c(h,v,_,P,L,N,B,H){return _=N.ref,h={$$typeof:m,type:h,key:v,props:N,_owner:L},(_!==void 0?_:null)!==null?Object.defineProperty(h,"ref",{enumerable:!1,get:l}):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:B}),Object.defineProperty(h,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:H}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h}function f(h,v,_,P,L,N,B,H){var W=v.children;if(W!==void 0)if(P)if(C(W)){for(P=0;P<W.length;P++)u(W[P]);Object.freeze&&Object.freeze(W)}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(W);if(D.call(v,"key")){W=r(h);var X=Object.keys(v).filter(function(se){return se!=="key"});P=0<X.length?"{key: someKey, "+X.join(": ..., ")+": ...}":"{key: someKey}",U[W+P]||(X=0<X.length?"{"+X.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var Pt;function Bn(){return Pt||(Pt=1,process.env.NODE_ENV!=="production"&&function(){function n(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===O?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case b:return"Fragment";case R:return"Profiler";case S:return"StrictMode";case v:return"Suspense";case $:return"SuspenseList";case P: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 p:return"Portal";case C:return(h.displayName||"Context")+".Provider";case E:return(h._context.displayName||"Context")+".Consumer";case x:var y=h.render;return h=h.displayName,h||(h=y.displayName||y.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case w:return y=h.displayName||null,y!==null?y:n(h.type)||"Memo";case D:y=h._payload,h=h._init;try{return n(h(y))}catch{}}return null}function e(h){return""+h}function t(h){try{e(h);var y=!1}catch{y=!0}if(y){y=console;var _=y.error,k=typeof Symbol=="function"&&Symbol.toStringTag&&h[Symbol.toStringTag]||h.constructor.name||"Object";return _.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",k),e(h)}}function r(h){if(h===b)return"<>";if(typeof h=="object"&&h!==null&&h.$$typeof===D)return"<...>";try{var y=n(h);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function s(){var h=A.A;return h===null?null:h.getOwner()}function a(){return Error("react-stack-top-frame")}function i(h){if(L.call(h,"key")){var y=Object.getOwnPropertyDescriptor(h,"key").get;if(y&&y.isReactWarning)return!1}return h.key!==void 0}function o(h,y){function _(){H||(H=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}_.isReactWarning=!0,Object.defineProperty(h,"key",{get:_,configurable:!0})}function l(){var h=n(this.type);return G[h]||(G[h]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),h=this.props.ref,h!==void 0?h:null}function c(h,y,_,k,j,I,U,W){return _=I.ref,h={$$typeof:g,type:h,key:y,props:I,_owner:j},(_!==void 0?_:null)!==null?Object.defineProperty(h,"ref",{enumerable:!1,get:l}):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:U}),Object.defineProperty(h,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:W}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h}function f(h,y,_,k,j,I,U,W){var Y=y.children;if(Y!==void 0)if(k)if(M(Y)){for(k=0;k<Y.length;k++)u(Y[k]);Object.freeze&&Object.freeze(Y)}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(Y);if(L.call(y,"key")){Y=n(h);var J=Object.keys(y).filter(function(re){return re!=="key"});k=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",V[Y+k]||(J=0<J.length?"{"+J.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,P,W,X,W),U[W+P]=!0)}if(W=null,_!==void 0&&(t(_),W=""+_),i(v)&&(t(v.key),W=""+v.key),"key"in v){_={};for(var K in v)K!=="key"&&(_[K]=v[K])}else _=v;return W&&o(_,typeof h=="function"?h.displayName||h.name||"Unknown":h),c(h,W,N,L,s(),_,B,H)}function u(h){typeof h=="object"&&h!==null&&h.$$typeof===m&&h._store&&(h._store.validated=1)}var d=R,m=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),S=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),T=Symbol.for("react.activity"),k=Symbol.for("react.client.reference"),j=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=Object.prototype.hasOwnProperty,C=Array.isArray,V=console.createTask?console.createTask:function(){return null};d={"react-stack-bottom-frame":function(h){return h()}};var I,Y={},z=d["react-stack-bottom-frame"].bind(d,a)(),J=V(n(a)),U={};Ne.Fragment=y,Ne.jsx=function(h,v,_,P,L){var N=1e4>j.recentlyCreatedOwnerStacks++;return f(h,v,_,!1,P,L,N?Error("react-stack-top-frame"):z,N?V(n(h)):J)},Ne.jsxs=function(h,v,_,P,L){var N=1e4>j.recentlyCreatedOwnerStacks++;return f(h,v,_,!0,P,L,N?Error("react-stack-top-frame"):z,N?V(n(h)):J)}}()),Ne}var It;function Kr(){return It||(It=1,process.env.NODE_ENV==="production"?He.exports=Hr():He.exports=Gr()),He.exports}var g=Kr();const 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})},pe={"smp-layout":"_smp-layout_fuh23_1","smp-layout-horizontal":"_smp-layout-horizontal_fuh23_9","smp-layout-vertical":"_smp-layout-vertical_fuh23_14","smp-layout-section-grid":"_smp-layout-section-grid_fuh23_19","smp-layout-section-vertical":"_smp-layout-section-vertical_fuh23_22","smp-layout-section-horizontal":"_smp-layout-section-horizontal_fuh23_26","smp-layout-cell-container":"_smp-layout-cell-container_fuh23_31","smp-layout-section-flex":"_smp-layout-section-flex_fuh23_35","smp-grid-template-cols":"_smp-grid-template-cols_fuh23_52","smp-grid-template-rows":"_smp-grid-template-rows_fuh23_56","smp-layout-section-with-title":"_smp-layout-section-with-title_fuh23_60","smp-layout-section-title":"_smp-layout-section-title_fuh23_66"},qr=(r,e)=>{const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},Er=(r,e)=>r.map(t=>{var a,i;if((a=t.sections)!=null&&a.length)return{...t,sections:Er(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=qr(t.content.filter(l=>e.includes(l.id)),+t.columns).map((l,c)=>({...t,id:`${t.id}-${c}`,content:l,gridCols:t.columns,horizontal:!0})),s=[]),{...t,sections:n,content:s}}),Nt=(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}},Mt=r=>r.some(e=>e.dim&&!e.dim.endsWith("%"));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 wt(r,e){return wt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},wt(r,e)}function Jr(r,e){r.prototype=Object.create(e.prototype),r.prototype.constructor=r,wt(r,e)}function pt(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 Ge={};/*!
22
+ <%s key={someKey} {...props} />`,k,Y,J,Y),V[Y+k]=!0)}if(Y=null,_!==void 0&&(t(_),Y=""+_),i(y)&&(t(y.key),Y=""+y.key),"key"in y){_={};for(var K in y)K!=="key"&&(_[K]=y[K])}else _=y;return Y&&o(_,typeof h=="function"?h.displayName||h.name||"Unknown":h),c(h,Y,I,j,s(),_,U,W)}function u(h){typeof h=="object"&&h!==null&&h.$$typeof===g&&h._store&&(h._store.validated=1)}var d=T,g=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),C=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),v=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),O=Symbol.for("react.client.reference"),A=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=Object.prototype.hasOwnProperty,M=Array.isArray,N=console.createTask?console.createTask:function(){return null};d={"react-stack-bottom-frame":function(h){return h()}};var H,G={},z=d["react-stack-bottom-frame"].bind(d,a)(),Z=N(r(a)),V={};Ie.Fragment=b,Ie.jsx=function(h,y,_,k,j){var I=1e4>A.recentlyCreatedOwnerStacks++;return f(h,y,_,!1,k,j,I?Error("react-stack-top-frame"):z,I?N(r(h)):Z)},Ie.jsxs=function(h,y,_,k,j){var I=1e4>A.recentlyCreatedOwnerStacks++;return f(h,y,_,!0,k,j,I?Error("react-stack-top-frame"):z,I?N(r(h)):Z)}}()),Ie}var At;function Hn(){return At||(At=1,process.env.NODE_ENV==="production"?Be.exports=Wn():Be.exports=Bn()),Be.exports}var m=Hn();const Te=({label:n,disabled:e,htmlFor:t})=>{const r={container:`smp-label ${e?"smp-label-disabled":""}`};return m.jsx("label",{className:r.container,htmlFor:t,children:n})},fe={"smp-layout":"_smp-layout_fuh23_1","smp-layout-horizontal":"_smp-layout-horizontal_fuh23_9","smp-layout-vertical":"_smp-layout-vertical_fuh23_14","smp-layout-section-grid":"_smp-layout-section-grid_fuh23_19","smp-layout-section-vertical":"_smp-layout-section-vertical_fuh23_22","smp-layout-section-horizontal":"_smp-layout-section-horizontal_fuh23_26","smp-layout-cell-container":"_smp-layout-cell-container_fuh23_31","smp-layout-section-flex":"_smp-layout-section-flex_fuh23_35","smp-grid-template-cols":"_smp-grid-template-cols_fuh23_52","smp-grid-template-rows":"_smp-grid-template-rows_fuh23_56","smp-layout-section-with-title":"_smp-layout-section-with-title_fuh23_60","smp-layout-section-title":"_smp-layout-section-title_fuh23_66"},Gn=(n,e)=>{const t=[];for(let r=0;r<n.length;r+=e)t.push(n.slice(r,r+e));return t},En=(n,e)=>n.map(t=>{if(t.sections?.length)return{...t,sections:En(t.sections,e),content:t.content};let r=t.sections,s=t.content;return t.content?.length&&t.columns&&+t.columns>1&&(r=Gn(t.content.filter(i=>e.includes(i.id)),+t.columns).map((i,o)=>({...t,id:`${t.id}-${o}`,content:i,gridCols:t.columns,horizontal:!0})),s=[]),{...t,sections:r,content:s}}),It=(n,e)=>{if(!e)return{};const t=n.some(r=>r.dim)?n.map(r=>r.dim||"auto").join(" "):`repeat(${n.length}, 1fr)`;return{[e]:t}},Nt=n=>n.some(e=>e.dim&&!e.dim.endsWith("%"));function Kn(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function et(){return et=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},et.apply(null,arguments)}function St(n,e){return St=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,r){return t.__proto__=r,t},St(n,e)}function qn(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,St(n,e)}function dt(n,e,t){if(t||arguments.length===2)for(var r=0,s=e.length,a;r<s;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return n.concat(a||Array.prototype.slice.call(e))}var He={};/*!
23
23
  * content-type
24
24
  * Copyright(c) 2015 Douglas Christopher Wilson
25
25
  * MIT Licensed
26
- */var Ft;function Xr(){if(Ft)return Ge;Ft=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-]+$/;Ge.format=i,Ge.parse=o;function i(u){if(!u||typeof u!="object")throw new TypeError("argument obj is required");var d=u.parameters,m=u.type;if(!m||!a.test(m))throw new TypeError("invalid type");var p=m;if(d&&typeof d=="object")for(var y,x=Object.keys(d).sort(),O=0;O<x.length;O++){if(y=x[O],!t.test(y))throw new TypeError("invalid parameter name");p+="; "+y+"="+c(d[y])}return p}function o(u){if(!u)throw new TypeError("argument string is required");var d=typeof u=="object"?l(u):u;if(typeof d!="string")throw new TypeError("argument string is required to be a string");var m=d.indexOf(";"),p=m!==-1?d.slice(0,m).trim():d.trim();if(!a.test(p))throw new TypeError("invalid media type");var y=new f(p.toLowerCase());if(m!==-1){var x,O,w;for(r.lastIndex=m;O=r.exec(d);){if(O.index!==m)throw new TypeError("invalid parameter format");m+=O[0].length,x=O[1].toLowerCase(),w=O[2],w.charCodeAt(0)===34&&(w=w.slice(1,-1),w.indexOf("\\")!==-1&&(w=w.replace(n,"$1"))),y.parameters[x]=w}if(m!==d.length)throw new TypeError("invalid parameter format")}return y}function l(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 c(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 Ge}var Zr=Xr(),ke=new Map,Tr=function(e){return e.cloneNode(!0)},Vt=function(){return window.location.protocol==="file:"},Or=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=Zr.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(Vt()?"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||Vt()&&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()},xe={},Yt=function(e,t){xe[e]=xe[e]||[],xe[e].push(t)},Qr=function(e){for(var t=function(i,o){setTimeout(function(){if(Array.isArray(xe[e])){var l=ke.get(e),c=xe[e][i];l instanceof SVGSVGElement&&c(null,Tr(l)),l instanceof Error&&c(l),i===xe[e].length-1&&delete xe[e]}},0)},n=0,s=xe[e].length;n<s;n++)t(n)},en=function(e,t,n){if(ke.has(e)){var s=ke.get(e);if(s===void 0){Yt(e,n);return}if(s instanceof SVGSVGElement){n(null,Tr(s));return}}ke.set(e,void 0),Yt(e,n),Or(e,t,function(a,i){var o;a?ke.set(e,a):((o=i.responseXML)===null||o===void 0?void 0:o.documentElement)instanceof SVGSVGElement&&ke.set(e,i.responseXML.documentElement),Qr(e)})},tn=function(e,t,n){Or(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)})},rn=0,nn=function(){return++rn},ge=[],Ut={},sn="http://www.w3.org/2000/svg",ht="http://www.w3.org/1999/xlink",Wt=function(e,t,n,s,a,i,o){var l=e.getAttribute("data-src")||e.getAttribute("src");if(!l){o(new Error("Invalid data-src or src attribute"));return}if(ge.indexOf(e)!==-1){ge.splice(ge.indexOf(e),1),e=null;return}ge.push(e),e.setAttribute("src","");var c=s?en:tn;c(l,a,function(f,u){if(!u){ge.splice(ge.indexOf(e),1),e=null,o(f);return}var d=e.getAttribute("id");d&&u.setAttribute("id",d);var m=e.getAttribute("title");m&&u.setAttribute("title",m);var p=e.getAttribute("width");p&&u.setAttribute("width",p);var y=e.getAttribute("height");y&&u.setAttribute("height",y);var x=Array.from(new Set(pt(pt(pt([],(u.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();u.setAttribute("class",x);var O=e.getAttribute("style");O&&u.setAttribute("style",O),u.setAttribute("data-src",l);var w=[].filter.call(e.attributes,function(J){return/^data-\w[\w-]*$/.test(J.name)});if(Array.prototype.forEach.call(w,function(J){J.name&&J.value&&u.setAttribute(J.name,J.value)}),n){var S={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"]},E,b,$,M,A;Object.keys(S).forEach(function(J){E=J,$=S[J],b=u.querySelectorAll(E+"[id]");for(var U=function(P,L){M=b[P].id,A=M+"-"+nn();var N;Array.prototype.forEach.call($,function(G){N=u.querySelectorAll("["+G+'*="'+M+'"]');for(var Z=0,re=N.length;Z<re;Z++){var ne=N[Z].getAttribute(G);ne&&!ne.match(new RegExp('url\\("?#'+M+'"?\\)'))||N[Z].setAttribute(G,"url(#"+A+")")}});for(var B=u.querySelectorAll("[*|href]"),H=[],W=0,X=B.length;W<X;W++){var K=B[W].getAttributeNS(ht,"href");K&&K.toString()==="#"+b[P].id&&H.push(B[W])}for(var se=0,F=H.length;se<F;se++)H[se].setAttributeNS(ht,"href","#"+A);b[P].id=A},h=0,v=b.length;h<v;h++)U(h)})}u.removeAttribute("xmlns:a");for(var T=u.querySelectorAll("script"),k=[],j,D,C=0,V=T.length;C<V;C++)D=T[C].getAttribute("type"),(!D||D==="application/ecmascript"||D==="application/javascript"||D==="text/javascript")&&(j=T[C].innerText||T[C].textContent,j&&k.push(j),u.removeChild(T[C]));if(k.length>0&&(t==="always"||t==="once"&&!Ut[l])){for(var I=0,Y=k.length;I<Y;I++)new Function(k[I])(window);Ut[l]=!0}var z=u.querySelectorAll("style");if(Array.prototype.forEach.call(z,function(J){J.textContent+=""}),u.setAttribute("xmlns",sn),u.setAttribute("xmlns:xlink",ht),i(u),!e.parentNode){ge.splice(ge.indexOf(e),1),e=null,o(new Error("Parent node is null"));return}e.parentNode.replaceChild(u,e),ge.splice(ge.indexOf(e),1),e=null,o(null,u)})},an=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,l=n.beforeEach,c=l===void 0?function(){}:l,f=n.cacheRequests,u=f===void 0?!0:f,d=n.evalScripts,m=d===void 0?"never":d,p=n.httpRequestWithCredentials,y=p===void 0?!1:p,x=n.renumerateIRIElements,O=x===void 0?!0:x;if(e&&"length"in e)for(var w=0,S=0,E=e.length;S<E;S++)Wt(e[S],m,O,u,y,c,function(b,$){o(b,$),e&&"length"in e&&e.length===++w&&a(w)});else e?Wt(e,m,O,u,y,c,function(b,$){o(b,$),a(1),e=null}):a(0)},Ke={exports:{}},qe={exports:{}},Q={};/** @license React v16.13.1
26
+ */var Mt;function zn(){if(Mt)return He;Mt=1;var n=/; *([!#$%&'*+.^_`|~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-]+$/,r=/\\([\u000b\u0020-\u00ff])/g,s=/([\\"])/g,a=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;He.format=i,He.parse=o;function i(u){if(!u||typeof u!="object")throw new TypeError("argument obj is required");var d=u.parameters,g=u.type;if(!g||!a.test(g))throw new TypeError("invalid type");var p=g;if(d&&typeof d=="object")for(var b,S=Object.keys(d).sort(),R=0;R<S.length;R++){if(b=S[R],!t.test(b))throw new TypeError("invalid parameter name");p+="; "+b+"="+c(d[b])}return p}function o(u){if(!u)throw new TypeError("argument string is required");var d=typeof u=="object"?l(u):u;if(typeof d!="string")throw new TypeError("argument string is required to be a string");var g=d.indexOf(";"),p=g!==-1?d.slice(0,g).trim():d.trim();if(!a.test(p))throw new TypeError("invalid media type");var b=new f(p.toLowerCase());if(g!==-1){var S,R,E;for(n.lastIndex=g;R=n.exec(d);){if(R.index!==g)throw new TypeError("invalid parameter format");g+=R[0].length,S=R[1].toLowerCase(),E=R[2],E.charCodeAt(0)===34&&(E=E.slice(1,-1),E.indexOf("\\")!==-1&&(E=E.replace(r,"$1"))),b.parameters[S]=E}if(g!==d.length)throw new TypeError("invalid parameter format")}return b}function l(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 c(u){var d=String(u);if(t.test(d))return d;if(d.length>0&&!e.test(d))throw new TypeError("invalid parameter value");return'"'+d.replace(s,"\\$1")+'"'}function f(u){this.parameters=Object.create(null),this.type=u}return He}var Jn=zn(),je=new Map,Cn=function(e){return e.cloneNode(!0)},Ft=function(){return window.location.protocol==="file:"},Tn=function(e,t,r){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=Jn.parse(a).type;if(!(i==="image/svg+xml"||i==="text/plain"))throw new Error("Invalid content type: ".concat(i))}if(s.readyState===4){if(s.status===404||s.responseXML===null)throw new Error(Ft()?"Note: SVG injection ajax calls do not work locally without adjusting security settings in your browser. Or consider using a local webserver.":"Unable to load SVG file: "+e);if(s.status===200||Ft()&&s.status===0)r(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)r(o,s);else throw o}},s.open("GET",e),s.withCredentials=t,s.overrideMimeType&&s.overrideMimeType("text/xml"),s.send()},ye={},Vt=function(e,t){ye[e]=ye[e]||[],ye[e].push(t)},Xn=function(e){for(var t=function(i,o){setTimeout(function(){if(Array.isArray(ye[e])){var l=je.get(e),c=ye[e][i];l instanceof SVGSVGElement&&c(null,Cn(l)),l instanceof Error&&c(l),i===ye[e].length-1&&delete ye[e]}},0)},r=0,s=ye[e].length;r<s;r++)t(r)},Zn=function(e,t,r){if(je.has(e)){var s=je.get(e);if(s===void 0){Vt(e,r);return}if(s instanceof SVGSVGElement){r(null,Cn(s));return}}je.set(e,void 0),Vt(e,r),Tn(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),Xn(e)})},Qn=function(e,t,r){Tn(e,t,function(s,a){var i;s?r(s):((i=a.responseXML)===null||i===void 0?void 0:i.documentElement)instanceof SVGSVGElement&&r(null,a.responseXML.documentElement)})},er=0,tr=function(){return++er},he=[],Yt={},nr="http://www.w3.org/2000/svg",pt="http://www.w3.org/1999/xlink",Ut=function(e,t,r,s,a,i,o){var l=e.getAttribute("data-src")||e.getAttribute("src");if(!l){o(new Error("Invalid data-src or src attribute"));return}if(he.indexOf(e)!==-1){he.splice(he.indexOf(e),1),e=null;return}he.push(e),e.setAttribute("src","");var c=s?Zn:Qn;c(l,a,function(f,u){if(!u){he.splice(he.indexOf(e),1),e=null,o(f);return}var d=e.getAttribute("id");d&&u.setAttribute("id",d);var g=e.getAttribute("title");g&&u.setAttribute("title",g);var p=e.getAttribute("width");p&&u.setAttribute("width",p);var b=e.getAttribute("height");b&&u.setAttribute("height",b);var S=Array.from(new Set(dt(dt(dt([],(u.getAttribute("class")||"").split(" "),!0),["injected-svg"],!1),(e.getAttribute("class")||"").split(" "),!0))).join(" ").trim();u.setAttribute("class",S);var R=e.getAttribute("style");R&&u.setAttribute("style",R),u.setAttribute("data-src",l);var E=[].filter.call(e.attributes,function(Z){return/^data-\w[\w-]*$/.test(Z.name)});if(Array.prototype.forEach.call(E,function(Z){Z.name&&Z.value&&u.setAttribute(Z.name,Z.value)}),r){var C={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"]},x,v,$,w,D;Object.keys(C).forEach(function(Z){x=Z,$=C[Z],v=u.querySelectorAll(x+"[id]");for(var V=function(k,j){w=v[k].id,D=w+"-"+tr();var I;Array.prototype.forEach.call($,function(B){I=u.querySelectorAll("["+B+'*="'+w+'"]');for(var X=0,ne=I.length;X<ne;X++){var se=I[X].getAttribute(B);se&&!se.match(new RegExp('url\\("?#'+w+'"?\\)'))||I[X].setAttribute(B,"url(#"+D+")")}});for(var U=u.querySelectorAll("[*|href]"),W=[],Y=0,J=U.length;Y<J;Y++){var K=U[Y].getAttributeNS(pt,"href");K&&K.toString()==="#"+v[k].id&&W.push(U[Y])}for(var re=0,F=W.length;re<F;re++)W[re].setAttributeNS(pt,"href","#"+D);v[k].id=D},h=0,y=v.length;h<y;h++)V(h)})}u.removeAttribute("xmlns:a");for(var P=u.querySelectorAll("script"),O=[],A,L,M=0,N=P.length;M<N;M++)L=P[M].getAttribute("type"),(!L||L==="application/ecmascript"||L==="application/javascript"||L==="text/javascript")&&(A=P[M].innerText||P[M].textContent,A&&O.push(A),u.removeChild(P[M]));if(O.length>0&&(t==="always"||t==="once"&&!Yt[l])){for(var H=0,G=O.length;H<G;H++)new Function(O[H])(window);Yt[l]=!0}var z=u.querySelectorAll("style");if(Array.prototype.forEach.call(z,function(Z){Z.textContent+=""}),u.setAttribute("xmlns",nr),u.setAttribute("xmlns:xlink",pt),i(u),!e.parentNode){he.splice(he.indexOf(e),1),e=null,o(new Error("Parent node is null"));return}e.parentNode.replaceChild(u,e),he.splice(he.indexOf(e),1),e=null,o(null,u)})},rr=function(e,t){var r=t===void 0?{}:t,s=r.afterAll,a=s===void 0?function(){}:s,i=r.afterEach,o=i===void 0?function(){}:i,l=r.beforeEach,c=l===void 0?function(){}:l,f=r.cacheRequests,u=f===void 0?!0:f,d=r.evalScripts,g=d===void 0?"never":d,p=r.httpRequestWithCredentials,b=p===void 0?!1:p,S=r.renumerateIRIElements,R=S===void 0?!0:S;if(e&&"length"in e)for(var E=0,C=0,x=e.length;C<x;C++)Ut(e[C],g,R,u,b,c,function(v,$){o(v,$),e&&"length"in e&&e.length===++E&&a(E)});else e?Ut(e,g,R,u,b,c,function(v,$){o(v,$),a(1),e=null}):a(0)},Ge={exports:{}},Ke={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 Bt;function on(){if(Bt)return Q;Bt=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,l=r?Symbol.for("react.async_mode"):60111,c=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,u=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,p=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,x=r?Symbol.for("react.fundamental"):60117,O=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function S(b){if(typeof b=="object"&&b!==null){var $=b.$$typeof;switch($){case e:switch(b=b.type,b){case l:case c:case n:case a:case s:case u:return b;default:switch(b=b&&b.$$typeof,b){case o:case f:case p:case m:case i:return b;default:return $}}case t:return $}}}function E(b){return S(b)===c}return Q.AsyncMode=l,Q.ConcurrentMode=c,Q.ContextConsumer=o,Q.ContextProvider=i,Q.Element=e,Q.ForwardRef=f,Q.Fragment=n,Q.Lazy=p,Q.Memo=m,Q.Portal=t,Q.Profiler=a,Q.StrictMode=s,Q.Suspense=u,Q.isAsyncMode=function(b){return E(b)||S(b)===l},Q.isConcurrentMode=E,Q.isContextConsumer=function(b){return S(b)===o},Q.isContextProvider=function(b){return S(b)===i},Q.isElement=function(b){return typeof b=="object"&&b!==null&&b.$$typeof===e},Q.isForwardRef=function(b){return S(b)===f},Q.isFragment=function(b){return S(b)===n},Q.isLazy=function(b){return S(b)===p},Q.isMemo=function(b){return S(b)===m},Q.isPortal=function(b){return S(b)===t},Q.isProfiler=function(b){return S(b)===a},Q.isStrictMode=function(b){return S(b)===s},Q.isSuspense=function(b){return S(b)===u},Q.isValidElementType=function(b){return typeof b=="string"||typeof b=="function"||b===n||b===c||b===a||b===s||b===u||b===d||typeof b=="object"&&b!==null&&(b.$$typeof===p||b.$$typeof===m||b.$$typeof===i||b.$$typeof===o||b.$$typeof===f||b.$$typeof===x||b.$$typeof===O||b.$$typeof===w||b.$$typeof===y)},Q.typeOf=S,Q}var ee={};/** @license React v16.13.1
33
+ */var Wt;function sr(){if(Wt)return Q;Wt=1;var n=typeof Symbol=="function"&&Symbol.for,e=n?Symbol.for("react.element"):60103,t=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,i=n?Symbol.for("react.provider"):60109,o=n?Symbol.for("react.context"):60110,l=n?Symbol.for("react.async_mode"):60111,c=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,u=n?Symbol.for("react.suspense"):60113,d=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,p=n?Symbol.for("react.lazy"):60116,b=n?Symbol.for("react.block"):60121,S=n?Symbol.for("react.fundamental"):60117,R=n?Symbol.for("react.responder"):60118,E=n?Symbol.for("react.scope"):60119;function C(v){if(typeof v=="object"&&v!==null){var $=v.$$typeof;switch($){case e:switch(v=v.type,v){case l:case c:case r:case a:case s:case u:return v;default:switch(v=v&&v.$$typeof,v){case o:case f:case p:case g:case i:return v;default:return $}}case t:return $}}}function x(v){return C(v)===c}return Q.AsyncMode=l,Q.ConcurrentMode=c,Q.ContextConsumer=o,Q.ContextProvider=i,Q.Element=e,Q.ForwardRef=f,Q.Fragment=r,Q.Lazy=p,Q.Memo=g,Q.Portal=t,Q.Profiler=a,Q.StrictMode=s,Q.Suspense=u,Q.isAsyncMode=function(v){return x(v)||C(v)===l},Q.isConcurrentMode=x,Q.isContextConsumer=function(v){return C(v)===o},Q.isContextProvider=function(v){return C(v)===i},Q.isElement=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===e},Q.isForwardRef=function(v){return C(v)===f},Q.isFragment=function(v){return C(v)===r},Q.isLazy=function(v){return C(v)===p},Q.isMemo=function(v){return C(v)===g},Q.isPortal=function(v){return C(v)===t},Q.isProfiler=function(v){return C(v)===a},Q.isStrictMode=function(v){return C(v)===s},Q.isSuspense=function(v){return C(v)===u},Q.isValidElementType=function(v){return typeof v=="string"||typeof v=="function"||v===r||v===c||v===a||v===s||v===u||v===d||typeof v=="object"&&v!==null&&(v.$$typeof===p||v.$$typeof===g||v.$$typeof===i||v.$$typeof===o||v.$$typeof===f||v.$$typeof===S||v.$$typeof===R||v.$$typeof===E||v.$$typeof===b)},Q.typeOf=C,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 Ht;function ln(){return Ht||(Ht=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,l=r?Symbol.for("react.async_mode"):60111,c=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,u=r?Symbol.for("react.suspense"):60113,d=r?Symbol.for("react.suspense_list"):60120,m=r?Symbol.for("react.memo"):60115,p=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,x=r?Symbol.for("react.fundamental"):60117,O=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function S(F){return typeof F=="string"||typeof F=="function"||F===n||F===c||F===a||F===s||F===u||F===d||typeof F=="object"&&F!==null&&(F.$$typeof===p||F.$$typeof===m||F.$$typeof===i||F.$$typeof===o||F.$$typeof===f||F.$$typeof===x||F.$$typeof===O||F.$$typeof===w||F.$$typeof===y)}function E(F){if(typeof F=="object"&&F!==null){var G=F.$$typeof;switch(G){case e:var Z=F.type;switch(Z){case l:case c:case n:case a:case s:case u:return Z;default:var re=Z&&Z.$$typeof;switch(re){case o:case f:case p:case m:case i:return re;default:return G}}case t:return G}}}var b=l,$=c,M=o,A=i,T=e,k=f,j=n,D=p,C=m,V=t,I=a,Y=s,z=u,J=!1;function U(F){return J||(J=!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(F)||E(F)===l}function h(F){return E(F)===c}function v(F){return E(F)===o}function _(F){return E(F)===i}function P(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function L(F){return E(F)===f}function N(F){return E(F)===n}function B(F){return E(F)===p}function H(F){return E(F)===m}function W(F){return E(F)===t}function X(F){return E(F)===a}function K(F){return E(F)===s}function se(F){return E(F)===u}ee.AsyncMode=b,ee.ConcurrentMode=$,ee.ContextConsumer=M,ee.ContextProvider=A,ee.Element=T,ee.ForwardRef=k,ee.Fragment=j,ee.Lazy=D,ee.Memo=C,ee.Portal=V,ee.Profiler=I,ee.StrictMode=Y,ee.Suspense=z,ee.isAsyncMode=U,ee.isConcurrentMode=h,ee.isContextConsumer=v,ee.isContextProvider=_,ee.isElement=P,ee.isForwardRef=L,ee.isFragment=N,ee.isLazy=B,ee.isMemo=H,ee.isPortal=W,ee.isProfiler=X,ee.isStrictMode=K,ee.isSuspense=se,ee.isValidElementType=S,ee.typeOf=E}()),ee}var Gt;function _r(){return Gt||(Gt=1,process.env.NODE_ENV==="production"?qe.exports=on():qe.exports=ln()),qe.exports}/*
40
+ */var Bt;function ar(){return Bt||(Bt=1,process.env.NODE_ENV!=="production"&&function(){var n=typeof Symbol=="function"&&Symbol.for,e=n?Symbol.for("react.element"):60103,t=n?Symbol.for("react.portal"):60106,r=n?Symbol.for("react.fragment"):60107,s=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,i=n?Symbol.for("react.provider"):60109,o=n?Symbol.for("react.context"):60110,l=n?Symbol.for("react.async_mode"):60111,c=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,u=n?Symbol.for("react.suspense"):60113,d=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,p=n?Symbol.for("react.lazy"):60116,b=n?Symbol.for("react.block"):60121,S=n?Symbol.for("react.fundamental"):60117,R=n?Symbol.for("react.responder"):60118,E=n?Symbol.for("react.scope"):60119;function C(F){return typeof F=="string"||typeof F=="function"||F===r||F===c||F===a||F===s||F===u||F===d||typeof F=="object"&&F!==null&&(F.$$typeof===p||F.$$typeof===g||F.$$typeof===i||F.$$typeof===o||F.$$typeof===f||F.$$typeof===S||F.$$typeof===R||F.$$typeof===E||F.$$typeof===b)}function x(F){if(typeof F=="object"&&F!==null){var B=F.$$typeof;switch(B){case e:var X=F.type;switch(X){case l:case c:case r:case a:case s:case u:return X;default:var ne=X&&X.$$typeof;switch(ne){case o:case f:case p:case g:case i:return ne;default:return B}}case t:return B}}}var v=l,$=c,w=o,D=i,P=e,O=f,A=r,L=p,M=g,N=t,H=a,G=s,z=u,Z=!1;function V(F){return Z||(Z=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),h(F)||x(F)===l}function h(F){return x(F)===c}function y(F){return x(F)===o}function _(F){return x(F)===i}function k(F){return typeof F=="object"&&F!==null&&F.$$typeof===e}function j(F){return x(F)===f}function I(F){return x(F)===r}function U(F){return x(F)===p}function W(F){return x(F)===g}function Y(F){return x(F)===t}function J(F){return x(F)===a}function K(F){return x(F)===s}function re(F){return x(F)===u}ee.AsyncMode=v,ee.ConcurrentMode=$,ee.ContextConsumer=w,ee.ContextProvider=D,ee.Element=P,ee.ForwardRef=O,ee.Fragment=A,ee.Lazy=L,ee.Memo=M,ee.Portal=N,ee.Profiler=H,ee.StrictMode=G,ee.Suspense=z,ee.isAsyncMode=V,ee.isConcurrentMode=h,ee.isContextConsumer=y,ee.isContextProvider=_,ee.isElement=k,ee.isForwardRef=j,ee.isFragment=I,ee.isLazy=U,ee.isMemo=W,ee.isPortal=Y,ee.isProfiler=J,ee.isStrictMode=K,ee.isSuspense=re,ee.isValidElementType=C,ee.typeOf=x}()),ee}var Ht;function On(){return Ht||(Ht=1,process.env.NODE_ENV==="production"?Ke.exports=sr():Ke.exports=ar()),Ke.exports}/*
41
41
  object-assign
42
42
  (c) Sindre Sorhus
43
43
  @license MIT
44
- */var mt,Kt;function cn(){if(Kt)return mt;Kt=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 l=Object.getOwnPropertyNames(i).map(function(f){return i[f]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(f){c[f]=f}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return mt=s()?Object.assign:function(a,i){for(var o,l=n(a),c,f=1;f<arguments.length;f++){o=Object(arguments[f]);for(var u in o)e.call(o,u)&&(l[u]=o[u]);if(r){c=r(o);for(var d=0;d<c.length;d++)t.call(o,c[d])&&(l[c[d]]=o[c[d]])}}return l},mt}var gt,qt;function Dt(){if(qt)return gt;qt=1;var r="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return gt=r,gt}var yt,zt;function Rr(){return zt||(zt=1,yt=Function.call.bind(Object.prototype.hasOwnProperty)),yt}var bt,Jt;function un(){if(Jt)return bt;Jt=1;var r=function(){};if(process.env.NODE_ENV!=="production"){var e=Dt(),t={},n=Rr();r=function(a){var i="Warning: "+a;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function s(a,i,o,l,c){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((l||"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,l,o,null,e)}catch(p){u=p}if(u&&!(u instanceof Error)&&r((l||"React class")+": type specification of "+o+" `"+f+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in t)){t[u.message]=!0;var m=c?c():"";r("Failed "+o+" type: "+u.message+(m??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},bt=s,bt}var vt,Xt;function fn(){if(Xt)return vt;Xt=1;var r=_r(),e=cn(),t=Dt(),n=Rr(),s=un(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(o){var l="Warning: "+o;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function i(){return null}return vt=function(o,l){var c=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function u(h){var v=h&&(c&&h[c]||h[f]);if(typeof v=="function")return v}var d="<<anonymous>>",m={array:O("array"),bigint:O("bigint"),bool:O("boolean"),func:O("function"),number:O("number"),object:O("object"),string:O("string"),symbol:O("symbol"),any:w(),arrayOf:S,element:E(),elementType:b(),instanceOf:$,node:k(),objectOf:A,oneOf:M,oneOfType:T,shape:D,exact:C};function p(h,v){return h===v?h!==0||1/h===1/v:h!==h&&v!==v}function y(h,v){this.message=h,this.data=v&&typeof v=="object"?v:{},this.stack=""}y.prototype=Error.prototype;function x(h){if(process.env.NODE_ENV!=="production")var v={},_=0;function P(N,B,H,W,X,K,se){if(W=W||d,K=K||H,se!==t){if(l){var F=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 F.name="Invariant Violation",F}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var G=W+":"+H;!v[G]&&_<3&&(a("You are manually calling a React.PropTypes validation function for the `"+K+"` prop on `"+W+"`. 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."),v[G]=!0,_++)}}return B[H]==null?N?B[H]===null?new y("The "+X+" `"+K+"` is marked as required "+("in `"+W+"`, but its value is `null`.")):new y("The "+X+" `"+K+"` is marked as required in "+("`"+W+"`, but its value is `undefined`.")):null:h(B,H,W,X,K)}var L=P.bind(null,!1);return L.isRequired=P.bind(null,!0),L}function O(h){function v(_,P,L,N,B,H){var W=_[P],X=Y(W);if(X!==h){var K=z(W);return new y("Invalid "+N+" `"+B+"` of type "+("`"+K+"` supplied to `"+L+"`, expected ")+("`"+h+"`."),{expectedType:h})}return null}return x(v)}function w(){return x(i)}function S(h){function v(_,P,L,N,B){if(typeof h!="function")return new y("Property `"+B+"` of component `"+L+"` has invalid PropType notation inside arrayOf.");var H=_[P];if(!Array.isArray(H)){var W=Y(H);return new y("Invalid "+N+" `"+B+"` of type "+("`"+W+"` supplied to `"+L+"`, expected an array."))}for(var X=0;X<H.length;X++){var K=h(H,X,L,N,B+"["+X+"]",t);if(K instanceof Error)return K}return null}return x(v)}function E(){function h(v,_,P,L,N){var B=v[_];if(!o(B)){var H=Y(B);return new y("Invalid "+L+" `"+N+"` of type "+("`"+H+"` supplied to `"+P+"`, expected a single ReactElement."))}return null}return x(h)}function b(){function h(v,_,P,L,N){var B=v[_];if(!r.isValidElementType(B)){var H=Y(B);return new y("Invalid "+L+" `"+N+"` of type "+("`"+H+"` supplied to `"+P+"`, expected a single ReactElement type."))}return null}return x(h)}function $(h){function v(_,P,L,N,B){if(!(_[P]instanceof h)){var H=h.name||d,W=U(_[P]);return new y("Invalid "+N+" `"+B+"` of type "+("`"+W+"` supplied to `"+L+"`, expected ")+("instance of `"+H+"`."))}return null}return x(v)}function M(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 v(_,P,L,N,B){for(var H=_[P],W=0;W<h.length;W++)if(p(H,h[W]))return null;var X=JSON.stringify(h,function(se,F){var G=z(F);return G==="symbol"?String(F):F});return new y("Invalid "+N+" `"+B+"` of value `"+String(H)+"` "+("supplied to `"+L+"`, expected one of "+X+"."))}return x(v)}function A(h){function v(_,P,L,N,B){if(typeof h!="function")return new y("Property `"+B+"` of component `"+L+"` has invalid PropType notation inside objectOf.");var H=_[P],W=Y(H);if(W!=="object")return new y("Invalid "+N+" `"+B+"` of type "+("`"+W+"` supplied to `"+L+"`, expected an object."));for(var X in H)if(n(H,X)){var K=h(H,X,L,N,B+"."+X,t);if(K instanceof Error)return K}return null}return x(v)}function T(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 v=0;v<h.length;v++){var _=h[v];if(typeof _!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+J(_)+" at index "+v+"."),i}function P(L,N,B,H,W){for(var X=[],K=0;K<h.length;K++){var se=h[K],F=se(L,N,B,H,W,t);if(F==null)return null;F.data&&n(F.data,"expectedType")&&X.push(F.data.expectedType)}var G=X.length>0?", expected one of type ["+X.join(", ")+"]":"";return new y("Invalid "+H+" `"+W+"` supplied to "+("`"+B+"`"+G+"."))}return x(P)}function k(){function h(v,_,P,L,N){return V(v[_])?null:new y("Invalid "+L+" `"+N+"` supplied to "+("`"+P+"`, expected a ReactNode."))}return x(h)}function j(h,v,_,P,L){return new y((h||"React class")+": "+v+" type `"+_+"."+P+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+L+"`.")}function D(h){function v(_,P,L,N,B){var H=_[P],W=Y(H);if(W!=="object")return new y("Invalid "+N+" `"+B+"` of type `"+W+"` "+("supplied to `"+L+"`, expected `object`."));for(var X in h){var K=h[X];if(typeof K!="function")return j(L,N,B,X,z(K));var se=K(H,X,L,N,B+"."+X,t);if(se)return se}return null}return x(v)}function C(h){function v(_,P,L,N,B){var H=_[P],W=Y(H);if(W!=="object")return new y("Invalid "+N+" `"+B+"` of type `"+W+"` "+("supplied to `"+L+"`, expected `object`."));var X=e({},_[P],h);for(var K in X){var se=h[K];if(n(h,K)&&typeof se!="function")return j(L,N,B,K,z(se));if(!se)return new y("Invalid "+N+" `"+B+"` key `"+K+"` supplied to `"+L+"`.\nBad object: "+JSON.stringify(_[P],null," ")+`
45
- Valid keys: `+JSON.stringify(Object.keys(h),null," "));var F=se(H,K,L,N,B+"."+K,t);if(F)return F}return null}return x(v)}function V(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(V);if(h===null||o(h))return!0;var v=u(h);if(v){var _=v.call(h),P;if(v!==h.entries){for(;!(P=_.next()).done;)if(!V(P.value))return!1}else for(;!(P=_.next()).done;){var L=P.value;if(L&&!V(L[1]))return!1}}else return!1;return!0;default:return!1}}function I(h,v){return h==="symbol"?!0:v?v["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&v instanceof Symbol:!1}function Y(h){var v=typeof h;return Array.isArray(h)?"array":h instanceof RegExp?"object":I(v,h)?"symbol":v}function z(h){if(typeof h>"u"||h===null)return""+h;var v=Y(h);if(v==="object"){if(h instanceof Date)return"date";if(h instanceof RegExp)return"regexp"}return v}function J(h){var v=z(h);switch(v){case"array":case"object":return"an "+v;case"boolean":case"date":case"regexp":return"a "+v;default:return v}}function U(h){return!h.constructor||!h.constructor.name?d:h.constructor.name}return m.checkPropTypes=s,m.resetWarningCache=s.resetWarningCache,m.PropTypes=m,m},vt}var xt,Zt;function dn(){if(Zt)return xt;Zt=1;var r=Dt();function e(){}function t(){}return t.resetWarningCache=e,xt=function(){function n(i,o,l,c,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},xt}var Qt;function pn(){if(Qt)return Ke.exports;if(Qt=1,process.env.NODE_ENV!=="production"){var r=_r(),e=!0;Ke.exports=fn()(r.isElement,e)}else Ke.exports=dn()();return Ke.exports}var ie=pn(),hn=function(e){var t=(e==null?void 0:e.ownerDocument)||document;return t.defaultView||window},mn=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},gn=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],ze="http://www.w3.org/2000/svg",er="http://www.w3.org/1999/xlink",Pe=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}Jr(e,r);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof hn(this.reactWrapper).Node){var a=this.props,i=a.desc,o=a.evalScripts,l=a.httpRequestWithCredentials,c=a.renumerateIRIElements,f=a.src,u=a.title,d=a.useRequestCache,m=this.props.onError,p=this.props.beforeInjection,y=this.props.afterInjection,x=this.props.wrapper,O,w;x==="svg"?(O=document.createElementNS(ze,x),O.setAttribute("xmlns",ze),O.setAttribute("xmlns:xlink",er),w=document.createElementNS(ze,x)):(O=document.createElement(x),w=document.createElement(x)),O.appendChild(w),w.dataset.src=f,this.nonReactWrapper=this.reactWrapper.appendChild(O);var S=function(M){if(s.removeSVG(),!s._isMounted){m(M);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){m(M)})},E=function(M,A){if(M){S(M);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{y(A)}catch(T){S(T)}})},b=function(M){if(M.setAttribute("role","img"),i){var A=M.querySelector(":scope > desc");A&&M.removeChild(A);var T=document.createElement("desc");T.innerHTML=i,M.prepend(T)}if(u){var k=M.querySelector(":scope > title");k&&M.removeChild(k);var j=document.createElement("title");j.innerHTML=u,M.prepend(j)}try{p(M)}catch(D){S(D)}};an(w,{afterEach:E,beforeEach:b,cacheRequests:d,evalScripts:o,httpRequestWithCredentials:l,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;mn(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,l=zr(s,gn),c=o;return Be.createElement(c,tt({},l,{ref:this.refCallback},o==="svg"?{xmlns:ze,xmlnsXlink:er}:{}),this.state.isLoading&&i&&Be.createElement(i,null),this.state.hasError&&a&&Be.createElement(a,null))},e}(Be.Component);Pe.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};Pe.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 Et={assets:"/"};const yn=r=>{Et={...Et,...r}},tr=r=>`${Et.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:l,isInteractable:c=!1,spin:f=!1,title:u,tabIndex:d})=>{const[m,p]=R.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")),O=tr(`assets/svg/${r}.svg`),w=tr(`assets/svg/${n}.svg`),S={img:`${c?"smp-image-interactable":""}`,svg:`smp-icon ${i?`smp-icon-${i}`:""} ${o?"smp-icon-rotated":""} ${c?"smp-icon-interactable":""} ${f?"smp-icon-spin":""}`},E=()=>{!a&&c&&l&&l()},b=$=>{!a&&c&&($.key==="Enter"||$.key===" ")&&($.preventDefault(),E())};return g.jsx(g.Fragment,{children:x?g.jsx(Pe,{src:r,fallback:()=>g.jsx(Pe,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:S.svg,onClick:E,onKeyDown:b,tabIndex:d}):y?g.jsx("img",{src:m,width:e||"16px",height:t||"auto",alt:u,onError:()=>p(w),onClick:E,className:S.img,title:u,onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&E()}}):g.jsx(Pe,{src:O,fallback:()=>g.jsx(Pe,{src:w,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:S.svg,onClick:E,onKeyDown:b,tabIndex:d})})}),rr=r=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[r],nr=r=>({primary:"onPrimary",danger:"onDanger",base:"base"})[r],Se=({bindValue:r,onClick:e,ariaLabel:t,icon:n,disabled:s,sizing:a="base",variant:i="primary",appearance:o="raised",showIcon:l=!0,showText:c=!0,fullWidth:f=!1,loading:u=!1,justify:d="center",title:m,optionalDisplayValue:p,squared:y=!1,submit:x=!1})=>{const O={container:`smp-button smp-button-container ${a?`smp-button-${a}`:""} ${i?`smp-buttonVariant-${i}`:""} ${o?`smp-buttonType-${o}`:""} ${f?"smp-button-fullWidth":""} smp-justifyContent-${d} ${y&&!c?"smp-button-squared":""}`};return g.jsx("button",{"data-component":"button",type:x?"submit":"button",className:O.container,onClick:e,"aria-label":t,disabled:s,"aria-busy":u,title:m||p,children:u?g.jsx(oe,{icon:"spinner",state:nr(i),spin:!0}):g.jsxs(g.Fragment,{children:[n&&l&&g.jsx(oe,{icon:n,disabled:s,state:nr(i),width:rr(a),height:rr(a)}),c&&g.jsx("span",{children:p||r})]})})},bn={titleLarge:"h2",title:"h3",body:"h6",label:"label"},_e=({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})},ye={"smp-tabbar-container":"_smp-tabbar-container_1scvh_1","smp-tabbar-scroll-button":"_smp-tabbar-scroll-button_1scvh_8","smp-tabbar-scroll-buttonRight":"_smp-tabbar-scroll-buttonRight_1scvh_13","smp-tabbar-scroll-buttonLeft":"_smp-tabbar-scroll-buttonLeft_1scvh_17","smp-tabbar-list-wrapper":"_smp-tabbar-list-wrapper_1scvh_21","smp-tabbar-list":"_smp-tabbar-list_1scvh_21","smp-tabbar-tab":"_smp-tabbar-tab_1scvh_38","smp-active":"_smp-active_1scvh_62","smp-tabbar-tab-extraSmall":"_smp-tabbar-tab-extraSmall_1scvh_75","smp-tabbar-tab-small":"_smp-tabbar-tab-small_1scvh_80","smp-tabbar-tab-base":"_smp-tabbar-tab-base_1scvh_85","smp-tabbar-tab-large":"_smp-tabbar-tab-large_1scvh_90","smp-tabbar-tab-extraLarge":"_smp-tabbar-tab-extraLarge_1scvh_95"},Dr=({data:r,sizing:e="large",toolbar:t=!0,selectedIndex:n,onTabChange:s})=>{const[a,i]=R.useState(0),o=n??a,[l,c]=R.useState(!1),[f,u]=R.useState(!1),d=R.useRef(null);if(R.useEffect(()=>{const S=d.current;if(!S)return;x();const E=()=>x();return S.addEventListener("scroll",E),window.addEventListener("resize",x),()=>{S.removeEventListener("scroll",E),window.removeEventListener("resize",x)}},[]),!r.children||r.children.length===0)return g.jsx("div",{className:"tab-bar-empty",children:"No tabs available"});const m={container:ye["smp-tabbar-container"],listWrapper:ye["smp-tabbar-list-wrapper"],list:ye["smp-tabbar-list"],tab:`${ye["smp-tabbar-tab"]} ${e?ye[`smp-tabbar-tab-${e}`]:""}`,scrollButtonRight:`${ye["smp-tabbar-scroll-button"]} ${ye["smp-tabbar-scroll-buttonRight"]}`,scrollButtonLeft:`${ye["smp-tabbar-scroll-button"]} ${ye["smp-tabbar-scroll-buttonLeft"]}`,active:ye["smp-active"]},p=100,y=2,x=()=>{const S=d.current;S&&(c(S.scrollLeft>0),u(S.scrollLeft+S.clientWidth<S.scrollWidth-y))},O=()=>{var S;(S=d.current)==null||S.scrollBy({left:-p,behavior:"smooth"})},w=()=>{var S;(S=d.current)==null||S.scrollBy({left:p,behavior:"smooth"})};return g.jsxs("div",{className:m.container,role:"tabpanel","data-component":"tab-bar",children:[l&&g.jsx("div",{className:m.scrollButtonLeft,children:g.jsx(Se,{bindValue:"",optionalDisplayValue:"<",onClick:O,variant:"base",sizing:e})}),g.jsx("div",{className:m.listWrapper,children:g.jsx("div",{className:m.list,ref:d,role:"tablist",children:r.children.map((S,E)=>g.jsxs("button",{type:"button",className:`${E===a?m.active:""} ${m.tab} `,role:"tab","aria-selected":E===o,tabIndex:E===o?0:-1,onClick:()=>{s&&s(E),i(E)},children:[S.icon&&g.jsx(oe,{icon:S.icon,placeholderIcon:S.placeholderIcon}),g.jsx(_e,{variant:"body",bindValue:S.decode||"Tab[object Object]"}),t&&(o===E?g.jsx(oe,{icon:"more_vert",isInteractable:!0,onClick:()=>{console.log("clicked icon")}}):g.jsx(oe,{icon:"empty"}))]},E))})}),f&&g.jsx("div",{className:m.scrollButtonRight,children:g.jsx(Se,{bindValue:"",optionalDisplayValue:">",onClick:w,variant:"base",sizing:e})})]})},rt=({children:r,layout:e={horizontal:!1,sectionsType:"tab",sections:[{id:"1",content:Array.isArray(r)?r.map(t=>({id:t.props.id})):[{id:r.props.id}]}]}})=>{const[t,n]=R.useState(0),s={};R.Children.forEach(r,p=>{R.isValidElement(p)&&(s[p.props.id]=p)});const a="--smp-grid-template-cols",i="--smp-grid-template-rows",o=Er(e.sections??[],Object.keys(s)),l=p=>p.reduce((y,x)=>{var b,$;let O="",w={},S={},E="";return(b=x.sections)!=null&&b.length?(O=pe["smp-layout-section-grid"],w=l(x.sections),x.gridCols===void 0&&(E=pe[x.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"],(x.horizontal||Mt(x.sections))&&(S=Nt(x.sections,x.horizontal?a:i)))):($=x.content)!=null&&$.length&&(x.gridCols!==void 0&&x.gridCols>0?(O=pe["smp-layout-section-grid"],E=pe["smp-grid-template-cols"],S={[a]:`repeat(${x.gridCols}, 1fr)`}):O=pe["smp-layout-section-flex"]),{...y,...w,[x.id]:{classes:`${O} ${pe[x.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${E} ${x.justify?`smp-justifyContent-${x.justify}`:""} ${x.align?`smp-alignItems-${x.align}`:""}`,styles:S}}},{}),c=l(o),f=`${pe["smp-layout"]} ${e.horizontal?pe["smp-layout-horizontal"]:pe["smp-layout-vertical"]}`,u=e.horizontal||Mt(e.sections||[])?Nt(o,e.horizontal?a:i):{},d=(p,y)=>{var O,w;const x=g.jsx("div",{"smp-id":`section-${p.id}`,className:c[p.id].classes,style:c[p.id].styles,children:(O=p.sections)!=null&&O.length?p.sections.map(S=>d(S)):(w=p.content)==null?void 0:w.map(S=>m(S,p.justify,p.align))},`section-${p.id}`);return p.title&&!y?g.jsxs("div",{className:pe["smp-layout-section-with-title"],children:[g.jsx("span",{className:`${pe["smp-layout-section-title"]} ${p.justify?`smp-justifyContent-${p.justify}`:""} ${p.align?`smp-alignItems-${p.align}`:""}`,children:g.jsx(De,{label:p.title})}),x]},`title-section-${p.id}`):x},m=(p,y,x)=>{const O=s[p.id];if(!O)return null;const S={gridColumnStart:(p.colSpan&&p.colSpan>0?`span ${p.colSpan}`:p.colStart&&p.colStart<1?"1":void 0)??p.colStart,gridColumnEnd:p.colEnd&&p.colEnd>0?p.colEnd:void 0},E=`${pe["smp-layout-cell-container"]} ${y?`smp-justifyContent-${y}`:""} ${x?`smp-alignItems-${x}`:""}`;return g.jsx("div",{className:E,style:S,"smp-id":p.id,children:O},p.id)};return g.jsxs("div",{className:f,style:u,"smp-id":"layout",children:[e.sectionsType==="tab"&&e.sections&&(e==null?void 0:e.sections.length)>1&&g.jsx(Dr,{data:{type:"SmeupDataTree",children:o.map(p=>({decode:p.title||p.id||"Tab",obj:{t:"",p:"",k:""},placeholderIcon:"tab",cells:{},children:[],shape:void 0}))},selectedIndex:t,onTabChange:n,toolbar:!1}),e.sectionsType?d(o[t],!0):o.map(p=>d(p))]})},te={AUTOCOMPLETE:"ACP",BUTTON_LIST:"BTL",BUTTON:"BTN",CHECKBOX:"CHK",CHIP:"CHI",COMBOBOX:"CMB",DATE:"CAL",EDITOR:"EDT",ICON:"ICO",IMAGE:"IMG",INPUT_NUMBER:"INR",MEMO:"MEM",MULTI_AUTOCOMPLETE:"AML",RADIO:"RAD",SPOTLIGHT:"SPL",SWITCH:"SWT",TEXT_FIELD:"ITX",TIME:"TIM",PASSWORD:"PWD"},vn=r=>r.t=="D8",xn=r=>r.t=="I1",Sn=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 nt{constructor(e,t){de(this,"class");de(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new nt(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 wn(r,e){if(jt(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,l=0,c="";switch(n.length){case 1:case 2:return o=parseInt(n),t.setDate(o),Je(t)?t:r;case 3:case 4:return o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),i===0?(t.setMonth(o-1),t.setDate(l)):a===0&&(t.setMonth(l-1),t.setDate(o)),Je(t)?t:r;case 5:case 6:{o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),Number(n.substring(4))>50?c="19"+n.substring(4):c="20"+n.substring(4);let f=0,u=0;return i===0?(f=l,u=o-1,t.setFullYear(parseInt(c),u,f)):a===0&&(f=o,u=l-1,t.setFullYear(parseInt(c),u,f)),Tt(o,u,parseInt(c))&&Je(t)?t:r}case 7:case 8:{o=parseInt(n.substring(0,2)),l=parseInt(n.substring(2,4)),c=n.substring(4);let f=0,u=0;return i===0?(f=l,u=o-1,t.setFullYear(parseInt(c),u,f)):a===0&&(f=o,u=l-1,t.setFullYear(parseInt(c),u,f)),Tt(f,u,parseInt(c))&&Je(t)?t:r}}return r}function jt(r){return/^\d{4}-\d{2}-\d{2}$/.test(r)&&r.length===10}function Je(r){return r instanceof Date&&!isNaN(r.getTime())}function En(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 Tt(n,t-1,e)}function Tt(r,e,t){const n=[31,Tn(t)?29:28,31,30,31,30,31,31,30,31,30,31];return!(e<0||e>11||r<1||r>n[e])}function Tn(r){return r%4===0&&(r%100!==0||r%400===0)}function On(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 st{constructor(e,t){de(this,"class");de(this,"date");this.class=e,this.date=t}static fromDataObj(e){const t=sr.get(`${e.t}${e.p}`);if(t)return new st(e,t.legacyToIso(e.k));throw new Error(`Date creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=sr.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 sr=new Map([["D8*YYMD",{legacyToIso(r){return En(r)&&`${r.substring(0,4)}-${r.substring(4,6)}-${r.substring(6,8)}`||r},isoToLegacy(r){return jt(r)&&r.replaceAll("-","")||r}}]]);function ct({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,l=n.current;if(!o||!l)return;const{top:c,left:f,width:u,height:d}=o.getBoundingClientRect();a(u);const m=l.offsetHeight,p=l.offsetWidth;if(p===0||m===0){requestAnimationFrame(i);return}let y=c+window.scrollY,x=f+window.scrollX;switch(r){case"top":y-=m;break;case"bottom":y+=d;break;case"left":x-=p;break;case"right":x+=u;break}requestAnimationFrame(()=>{l.style.transform=`translate(${x}px, ${y}px)`,l.style.opacity="1"})},[r]);return R.useLayoutEffect(()=>{if(!e)return;let o;const l=()=>{const f=t.current,u=n.current;f&&u?i():o=requestAnimationFrame(l)};o=requestAnimationFrame(l);const c=new MutationObserver(()=>{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 Ae=(r,e,t)=>{if(r==""&&(e==""||e==null))return"";if(t)switch(t){case"CodeOnly":return r;case"DescOnly":return e||"";case"Both":return`${r} - ${e}`}return r},jr=({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})},he={"smp-textfield-wrapper":"_smp-textfield-wrapper_ep1c3_4","smp-textfield":"_smp-textfield_ep1c3_4","smp-textfield-variant-notSelectable":"_smp-textfield-variant-notSelectable_ep1c3_29","smp-textfield-extraSmall":"_smp-textfield-extraSmall_ep1c3_35","smp-textfield-small":"_smp-textfield-small_ep1c3_40","smp-textfield-medium":"_smp-textfield-medium_ep1c3_45","smp-textfield-large":"_smp-textfield-large_ep1c3_50","smp-textfield-extraLarge":"_smp-textfield-extraLarge_ep1c3_55","smp-textfield-input":"_smp-textfield-input_ep1c3_61","smp-textfield-outlined":"_smp-textfield-outlined_ep1c3_84","smp-textfield-danger":"_smp-textfield-danger_ep1c3_95","smp-textfield-readOnly":"_smp-textfield-readOnly_ep1c3_99","smp-textfield-disabled":"_smp-textfield-disabled_ep1c3_114","smp-textfield-fullWidth":"_smp-textfield-fullWidth_ep1c3_123","smp-textfield-top-right-indicator":"_smp-textfield-top-right-indicator_ep1c3_127"},we=({disabled:r,bindValue:e,icon:t,placeholder:n,isEditable:s=!0,shapeIcon:a,sizing:i,state:o,variant:l,tooltip:c=!1,rotatedShapeIcon:f=!1,ref:u,inputRef:d,inputType:m="text",ariaLabel:p="input field",label:y,helperText:x=!1,error:O,appearance:w="base",fullWidth:S=!1,_dataComponent:E="textfield",min:b,max:$,step:M,inputMode:A="text",width:T,autocomplete:k,size:j,maxLength:D,onBlur:C,onChange:V,onKeyDown:I,onShapeIconClick:Y,onClick:z})=>{const J=R.useId(),U=`${J}-helper`,h=O?"danger":o,v=x||!!O,_=N=>{V==null||V(N.target.value)},P={wrapper:`${he["smp-textfield-wrapper"]} ${S?he["smp-textfield-fullWidth"]:""}`,container:`${he["smp-textfield"]} ${r?he["smp-textfield-disabled"]:""} ${n?he["smp-textfield-placeholder"]:""} ${i?he[`smp-textfield-${i}`]:""} ${h?he[`smp-textfield-${h}`]:""} ${w?he[`smp-textfield-${w}`]:""} ${s?"":he["smp-textfield-readOnly"]} ${c?he["smp-textfield-top-right-indicator"]:""}`,input:`${he["smp-textfield-input"]}`};if(l&&(l!=="notSelectable"||s)){const N=he[`smp-textfield-variant-${l}`];N&&(P.container+=` ${N}`)}const L=T?{"--smp-textField-width-base":T}:void 0;return g.jsxs("div",{className:P.wrapper,"data-component":E,children:[y&&g.jsx(De,{label:y,disabled:r,htmlFor:J}),g.jsxs("div",{className:P.container,ref:u,style:L,children:[t&&g.jsx(oe,{icon:t,disabled:r}),g.jsx("input",{id:J,type:m,value:e,placeholder:n,onChange:_,onBlur:C,className:P.input,disabled:r,readOnly:!s,onKeyDown:I,"aria-label":p,ref:d,"aria-describedby":v?U:void 0,min:b,max:$,step:M,inputMode:A,autoComplete:k,size:j,maxLength:D,onClick:z}),a&&g.jsx(oe,{icon:a,disabled:r,onClick:Y,rotated:f,isInteractable:s,tabIndex:0})]}),v&&g.jsx(jr,{helperText:O,disabled:r,state:h,id:U})]})};function $r({items:r,itemHeight:e,containerHeight:t,overscan:n=5}){const[s,a]=R.useState(0),i=R.useRef(null),o=r.length*e,l=Math.max(0,Math.floor(s/e)-n),c=Math.min(r.length-1,Math.floor((s+t)/e)+n),f=[];for(let m=l;m<=c;m++)f.push({item:r[m],index:m,offsetTop:m*e});const u=R.useCallback(m=>{const p=m.target.scrollTop;a(p)},[]),d=m=>{if(!i.current)return;const p=m*e,y=p+e,x=i.current,O=x.scrollTop,w=O+t;p<O?x.scrollTop=p:y>w&&(x.scrollTop=y-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:l,endIndex:c},scrollToIndex:d}}const Xe={"smp-list":"_smp-list_6ni6l_1","smp-list-container":"_smp-list-container_6ni6l_12","smp-list-listItem":"_smp-list-listItem_6ni6l_17"};function _n(r,e,t="14px IBM Plex Sans, sans-serif",n=32){const a=document.createElement("canvas").getContext("2d");if(!a)return 200;a.font=t;let i=0;for(const o of r){const l=Ae(o.id,o.label,e),c=a.measureText(l);i=Math.max(i,c.width)}return Math.ceil(i+n)}const Rn=10,Cr=({id:r,options:e,displayMode:t="Both",ref:n,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:l,onKeyDown:c,isOpen:f})=>{var V;const[u,d]=R.useState(""),m=40,[p,y]=R.useState(a!==null?a:-1),[x,O]=R.useState(o||200),w=R.useRef(null),S=s!==void 0?s:e.length>Rn,E=u?e.filter(I=>I.label.toLowerCase().includes(u.toLowerCase())):e,b=I=>{d(I)},{virtualItems:$,containerProps:M,innerProps:A,scrollToIndex:T}=$r({items:E,itemHeight:m,containerHeight:200,overscan:5});R.useEffect(()=>{a!==null&&a!==p&&y(a)},[a]),R.useEffect(()=>{p>=0&&p<E.length&&T(p)},[p,E]),R.useEffect(()=>{f&&(w!=null&&w.current)&&w.current.focus()},[f,w]),R.useEffect(()=>{const I=_n(e,t);O(I)},[e,t]);const k=I=>{if(I.key==="ArrowDown"||I.key==="ArrowUp"){I.preventDefault();let Y=p;I.key==="ArrowDown"?Y=p<E.length-1?p+1:0:I.key==="ArrowUp"&&(Y=p>0?p-1:E.length-1),y(Y)}else I.key==="Enter"?p>=0&&p<E.length&&(l==null||l(E[p])):I.key==="Escape"&&(I.preventDefault(),I.stopPropagation());c&&c(I)},j=I=>{k(I)},D=I=>{k(I)},C={wrapper:`${Xe["smp-list"]}`,container:`${Xe["smp-list-container"]}`,virtualScroll:`${Xe["smp-list-virtualScroll"]}`,listItem:`${Xe["smp-list-listItem"]}`};return g.jsxs("div",{id:r,ref:n,className:C.wrapper,"data-component":"list",style:{width:x,minWidth:o},children:[S&&g.jsx(we,{bindValue:u,placeholder:"Search...",fullWidth:!0,onChange:b,onKeyDown:j,inputRef:w}),g.jsx("div",{...M,className:C.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:D,"aria-activedescendant":p>=0&&p<E.length?(V=E[p])==null?void 0:V.id:void 0,children:g.jsx("div",{...A,className:C.virtualScroll,children:$.map(({item:I,index:Y,offsetTop:z})=>{const J=i.includes(I.id);return g.jsxs("li",{role:"option",id:I.id,"aria-selected":p===Y?"true":"false",tabIndex:-1,className:`${C.listItem} ${p===Y?"selected-item":""}`,"aria-label":I.id+"-"+I.label,style:{height:`${m}px`,lineHeight:`calc(${m}px - 2*2px)`,transform:`translateY(${z}px)`},onClick:()=>{l==null||l(I),y(Y)},children:[Ae(I.id,I.label,t),J&&g.jsx(oe,{icon:"check",width:16})]},I.id)})})})]})},$t=({displayMode:r,bindValue:e,optionalDisplayValue:t,...n})=>{const[s,a]=R.useState(Ae(e,t,r));return R.useEffect(()=>{a(e)},[e]),R.useEffect(()=>{a(Ae(e,t,r))},[t,r]),g.jsx(we,{...n,bindValue:s})},Dn=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 ut({children:r}){const[e,t]=R.useState(!1);return R.useEffect(()=>{t(!0)},[]),e?Wr.createPortal(r,document.body):null}const ft=(r,e,t)=>{R.useEffect(()=>{if(!e)return;const n=s=>{(r==null?void 0:r.some(i=>{if(typeof i=="object"&&i!==null&&"current"in i){const o=i==null?void 0:i.current;return o&&o.contains(s.target)}}))||t()};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[r,t,e])},q=r=>typeof r=="string",Me=()=>{let r,e;const t=new Promise((n,s)=>{r=n,e=s});return t.resolve=r,t.reject=e,t},ar=r=>r==null?"":""+r,jn=(r,e,t)=>{r.forEach(n=>{e[n]&&(t[n]=e[n])})},$n=/###/g,ir=r=>r&&r.indexOf("###")>-1?r.replace($n,"."):r,or=r=>!r||q(r),Ve=(r,e,t)=>{const n=q(e)?e.split("."):e;let s=0;for(;s<n.length-1;){if(or(r))return{};const a=ir(n[s]);!r[a]&&t&&(r[a]=new t),Object.prototype.hasOwnProperty.call(r,a)?r=r[a]:r={},++s}return or(r)?{}:{obj:r,k:ir(n[s])}},lr=(r,e,t)=>{const{obj:n,k:s}=Ve(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=Ve(r,i,Object);for(;o.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),o=Ve(r,i,Object),o!=null&&o.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=t},Cn=(r,e,t,n)=>{const{obj:s,k:a}=Ve(r,e,Object);s[a]=s[a]||[],s[a].push(t)},at=(r,e)=>{const{obj:t,k:n}=Ve(r,e);if(t&&Object.prototype.hasOwnProperty.call(t,n))return t[n]},kn=(r,e,t)=>{const n=at(r,t);return n!==void 0?n:at(e,t)},kr=(r,e,t)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in r?q(r[n])||r[n]instanceof String||q(e[n])||e[n]instanceof String?t&&(r[n]=e[n]):kr(r[n],e[n],t):r[n]=e[n]);return r},Ce=r=>r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Ln={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Pn=r=>q(r)?r.replace(/[&<>"'\/]/g,e=>Ln[e]):r;class An{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 In=[" ",",","?","!",";"],Nn=new An(20),Mn=(r,e,t)=>{e=e||"",t=t||"";const n=In.filter(i=>e.indexOf(i)<0&&t.indexOf(i)<0);if(n.length===0)return!0;const s=Nn.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},Ot=(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 l=a;l<n.length;++l)if(l!==a&&(o+=t),o+=n[l],i=s[o],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&l<n.length-1)continue;a+=l-a+1;break}s=i}return s},Ye=r=>r==null?void 0:r.replace("_","-"),Fn={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 it{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Fn,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,s){return s&&!this.debug?null:(q(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new it(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new it(this.logger,e)}}var be=new it;class dt{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 cr extends dt{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):q(n)&&a?o.push(...n.split(a)):o.push(n)));const l=at(this.data,o);return!l&&!t&&!n&&e.indexOf(".")>-1&&(e=o[0],t=o[1],n=o.slice(2).join(".")),l||!i||!q(n)?l:Ot((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),lr(this.data,o,s),a.silent||this.emit("added",e,t,n,s)}addResources(e,t,n,s={silent:!1}){for(const a in n)(q(n[a])||Array.isArray(n[a]))&&this.addResource(e,t,a,n[a],{silent:!0});s.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,s,a,i={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),s=n,n=t,t=o[1]),this.addNamespaces(t);let l=at(this.data,o)||{};i.skipCopy||(n=JSON.parse(JSON.stringify(n))),s?kr(l,n,a):l={...l,...n},lr(this.data,o,l),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 Lr={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 ur={},fr=r=>!q(r)&&typeof r!="boolean"&&typeof r!="number";class ot extends dt{constructor(e,t={}){super(),jn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=be.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&&!Mn(e,n,s);if(i&&!o){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:q(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:q(a)?[a]:a}}translate(e,t,n){let s=typeof t=="object"?{...t}:t;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof options=="object"&&(s={...s}),s||(s={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const a=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(e[e.length-1],s),c=l[l.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:`${c}${f}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:`${c}${f}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:o;const m=this.resolve(e,s);let p=m==null?void 0:m.res;const y=(m==null?void 0:m.usedKey)||o,x=(m==null?void 0:m.exactUsedKey)||o,O=["[object Number]","[object Function]","[object RegExp]"],w=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,S=!this.i18nFormat||this.i18nFormat.handleAsObject,E=s.count!==void 0&&!q(s.count),b=ot.hasDefaultValue(s),$=E?this.pluralResolver.getSuffix(u,s.count,s):"",M=s.ordinal&&E?this.pluralResolver.getSuffix(u,s.count,{ordinal:!1}):"",A=E&&!s.ordinal&&s.count===0,T=A&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${$}`]||s[`defaultValue${M}`]||s.defaultValue;let k=p;S&&!p&&b&&(k=T);const j=fr(k),D=Object.prototype.toString.apply(k);if(S&&k&&j&&O.indexOf(D)<0&&!(q(w)&&Array.isArray(k))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const C=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,k,{...s,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(m.res=C,m.usedParams=this.getUsedParamsDetails(s),m):C}if(i){const C=Array.isArray(k),V=C?[]:{},I=C?x:y;for(const Y in k)if(Object.prototype.hasOwnProperty.call(k,Y)){const z=`${I}${i}${Y}`;b&&!p?V[Y]=this.translate(z,{...s,defaultValue:fr(T)?T[Y]:void 0,joinArrays:!1,ns:l}):V[Y]=this.translate(z,{...s,joinArrays:!1,ns:l}),V[Y]===z&&(V[Y]=k[Y])}p=V}}else if(S&&q(w)&&Array.isArray(p))p=p.join(w),p&&(p=this.extendTranslation(p,e,s,n));else{let C=!1,V=!1;!this.isValidLookup(p)&&b&&(C=!0,p=T),this.isValidLookup(p)||(V=!0,p=o);const Y=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&V?void 0:p,z=b&&T!==p&&this.options.updateMissing;if(V||C||z){if(this.logger.log(z?"updateKey":"missingKey",u,c,o,z?T:p),i){const v=this.resolve(o,{...s,keySeparator:!1});v&&v.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let J=[];const U=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&U&&U[0])for(let v=0;v<U.length;v++)J.push(U[v]);else this.options.saveMissingTo==="all"?J=this.languageUtils.toResolveHierarchy(s.lng||this.language):J.push(s.lng||this.language);const h=(v,_,P)=>{var N;const L=b&&P!==p?P:Y;this.options.missingKeyHandler?this.options.missingKeyHandler(v,c,_,L,z,s):(N=this.backendConnector)!=null&&N.saveMissing&&this.backendConnector.saveMissing(v,c,_,L,z,s),this.emit("missingKey",v,c,_,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&E?J.forEach(v=>{const _=this.pluralResolver.getSuffixes(v,s);A&&s[`defaultValue${this.options.pluralSeparator}zero`]&&_.indexOf(`${this.options.pluralSeparator}zero`)<0&&_.push(`${this.options.pluralSeparator}zero`),_.forEach(P=>{h([v],o+P,s[`defaultValue${P}`]||T)})}):h(J,o,T))}p=this.extendTranslation(p,e,s,m,n),V&&p===o&&this.options.appendNamespaceToMissingKey&&(p=`${c}${f}${o}`),(V||C)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${f}${o}`:o,C?p:void 0,s))}return a?(m.res=p,m.usedParams=this.getUsedParamsDetails(s),m):p}extendTranslation(e,t,n,s,a){var l,c;if((l=this.i18nFormat)!=null&&l.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const f=q(e)&&(((c=n==null?void 0:n.interpolation)==null?void 0:c.skipOnVariables)!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(f){const m=e.match(this.interpolator.nestingRegexp);u=m&&m.length}let d=n.replace&&!q(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,n.lng||this.language||s.usedLng,n),f){const m=e.match(this.interpolator.nestingRegexp),p=m&&m.length;u<p&&(n.nest=!1)}!n.lng&&s&&s.res&&(n.lng=this.language||s.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,(...m)=>(a==null?void 0:a[0])===m[0]&&!n.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${t[0]}`),null):this.translate(...m,t),n)),n.interpolation&&this.interpolator.reset()}const i=n.postProcess||this.options.postProcess,o=q(i)?[i]:i;return e!=null&&(o!=null&&o.length)&&n.applyPostProcessor!==!1&&(e=Lr.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,s,a,i,o;return q(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(n))return;const c=this.extractFromKey(l,t),f=c.key;s=f;let u=c.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const d=t.count!==void 0&&!q(t.count),m=d&&!t.ordinal&&t.count===0,p=t.context!==void 0&&(q(t.context)||typeof t.context=="number")&&t.context!=="",y=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(x=>{var O,w;this.isValidLookup(n)||(o=x,!ur[`${y[0]}-${x}`]&&((O=this.utils)!=null&&O.hasLoadedNamespace)&&!((w=this.utils)!=null&&w.hasLoadedNamespace(o))&&(ur[`${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(S=>{var $;if(this.isValidLookup(n))return;i=S;const E=[f];if(($=this.i18nFormat)!=null&&$.addLookupKeys)this.i18nFormat.addLookupKeys(E,f,S,x,t);else{let M;d&&(M=this.pluralResolver.getSuffix(S,t.count,t));const A=`${this.options.pluralSeparator}zero`,T=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(E.push(f+M),t.ordinal&&M.indexOf(T)===0&&E.push(f+M.replace(T,this.options.pluralSeparator)),m&&E.push(f+A)),p){const k=`${f}${this.options.contextSeparator}${t.context}`;E.push(k),d&&(E.push(k+M),t.ordinal&&M.indexOf(T)===0&&E.push(k+M.replace(T,this.options.pluralSeparator)),m&&E.push(k+A))}}let b;for(;b=E.pop();)this.isValidLookup(n)||(a=b,n=this.getResource(S,x,b,t))}))})}),{res:n,usedKey:s,exactUsedKey:a,usedLng:i,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,t,n,s={}){var a;return(a=this.i18nFormat)!=null&&a.getResource?this.i18nFormat.getResource(e,t,n,s):this.resourceStore.getResource(e,t,n,s)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!q(e.replace);let s=n?e.replace:e;if(n&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!n){s={...s};for(const a of t)delete s[a]}return s}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&e[n]!==void 0)return!0;return!1}}class dr{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=be.create("languageUtils")}getScriptPartFromCode(e){if(e=Ye(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=Ye(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(q(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(n=>{if(t)return;const s=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(s))&&(t=s)}),!t&&this.options.supportedLngs&&e.forEach(n=>{if(t)return;const s=this.getScriptPartFromCode(n);if(this.isSupportedCode(s))return t=s;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return t=a;t=this.options.supportedLngs.find(i=>{if(i===a)return i;if(!(i.indexOf("-")<0&&a.indexOf("-")<0)&&(i.indexOf("-")>0&&a.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===a||i.indexOf(a)===0&&a.length>1))return i})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),q(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),s=[],a=i=>{i&&(this.isSupportedCode(i)?s.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return q(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):q(e)&&a(this.formatLanguageCode(e)),n.forEach(i=>{s.indexOf(i)<0&&a(this.formatLanguageCode(i))}),s}}const pr={zero:0,one:1,two:2,few:3,many:4,other:5},hr={select:r=>r===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Vn{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=be.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=Ye(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!"),hr;if(!e.match(/-|_/))return hr;const l=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(l,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)=>pr[s]-pr[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 mr=(r,e,t,n=".",s=!0)=>{let a=kn(r,e,t);return!a&&s&&q(t)&&(a=Ot(r,t,n),a===void 0&&(a=Ot(e,t,n))),a},St=r=>r.replace(/\$/g,"$$$$");class Yn{constructor(e={}){var t;this.logger=be.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:l,formatSeparator:c,unescapeSuffix:f,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:m,nestingSuffix:p,nestingSuffixEscaped:y,nestingOptionsSeparator:x,maxReplaces:O,alwaysFormat:w}=e.interpolation;this.escape=t!==void 0?t:Pn,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?Ce(a):i||"{{",this.suffix=o?Ce(o):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=f?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=d?Ce(d):m||Ce("$t("),this.nestingSuffix=p?Ce(p):y||Ce(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=O||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 m;let a,i,o;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=p=>{if(p.indexOf(this.formatSeparator)<0){const w=mr(t,l,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,n,{...s,...t,interpolationkey:p}):w}const y=p.split(this.formatSeparator),x=y.shift().trim(),O=y.join(this.formatSeparator).trim();return this.format(mr(t,l,x,this.options.keySeparator,this.options.ignoreJSONStructure),O,n,{...s,...t,interpolationkey:x})};this.resetRegExp();const f=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,u=((m=s==null?void 0:s.interpolation)==null?void 0:m.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>St(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?St(this.escape(p)):St(p)}].forEach(p=>{for(o=0;a=p.regex.exec(e);){const y=a[1].trim();if(i=c(y),i===void 0)if(typeof f=="function"){const O=f(e,a,s);i=q(O)?O:""}else if(s&&Object.prototype.hasOwnProperty.call(s,y))i="";else if(u){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${y} for interpolating ${e}`),i="";else!q(i)&&!this.useRawValueToEscape&&(i=ar(i));const x=p.safeValue(i);if(e=e.replace(a[0],x),u?(p.regex.lastIndex+=i.length,p.regex.lastIndex-=a[0].length):p.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,n={}){let s,a,i;const o=(l,c)=>{const f=this.nestingOptionsSeparator;if(l.indexOf(f)<0)return l;const u=l.split(new RegExp(`${f}[ ]*{`));let d=`{${u[1]}`;l=u[0],d=this.interpolate(d,i);const m=d.match(/'/g),p=d.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!p||p.length%2!==0)&&(d=d.replace(/'/g,'"'));try{i=JSON.parse(d),c&&(i={...c,...i})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${f}${d}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,l};for(;s=this.nestingRegexp.exec(e);){let l=[];i={...n},i=i.replace&&!q(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(u=>u.trim());s[1]=f.shift(),l=f,c=!0}if(a=t(o.call(this,s[1].trim(),i),i),a&&s[0]===e&&!q(a))return a;q(a)||(a=ar(a)),a||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),a=""),c&&(a=l.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 Un=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,...l]=i.split(":"),c=l.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}},gr=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(Ye(n),s),e[i]=o),o(t)}},Wn=r=>(e,t,n)=>r(Ye(t),n)(e);class Bn{constructor(e={}){this.logger=be.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?gr:Wn;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()]=gr(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(l=>l.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,o)].join(this.formatSeparator)}return a.reduce((o,l)=>{var u;const{formatName:c,formatOptions:f}=Un(l);if(this.formats[c]){let d=o;try{const m=((u=s==null?void 0:s.formatParams)==null?void 0:u[s.interpolationkey])||{},p=m.locale||m.lng||s.locale||s.lng||n;d=this.formats[c](o,p,{...f,...s,...m})}catch(m){this.logger.warn(m)}return d}else this.logger.warn(`there was no format function for ${c}`);return o},e)}}const Hn=(r,e)=>{r.pending[e]!==void 0&&(delete r.pending[e],r.pendingCount--)};class Gn extends dt{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=be.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={},l={};return e.forEach(c=>{let f=!0;t.forEach(u=>{const d=`${c}|${u}`;!n.reload&&this.store.hasResourceBundle(c,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),l[u]===void 0&&(l[u]=!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(l)}}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(l=>{Cn(l.loaded,[a],i),Hn(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{o[c]||(o[c]={});const f=l.loaded[c];f.length&&f.forEach(u=>{o[c][u]===void 0&&(o[c][u]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(l=>!l.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 u=this.waitingReads.shift();this.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.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)},l=this.backend[n].bind(this.backend);if(l.length===2){try{const c=l(e,t);c&&typeof c.then=="function"?c.then(f=>o(null,f)).catch(o):o(null,c)}catch(c){o(c)}return}return l(e,t,o)}prepareLoading(e,t,n={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();q(e)&&(e=this.languageUtils.toResolveHierarchy(e)),q(t)&&(t=[t]);const a=this.queueLoad(e,t,n,s);if(!a.toLoad.length)return a.pending.length||s(),null;a.toLoad.forEach(i=>{this.loadOne(i)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),s=n[0],a=n[1];this.read(s,a,"read",void 0,void 0,(i,o)=>{i&&this.logger.warn(`${t}loading namespace ${a} for language ${s} failed`,i),!i&&o&&this.logger.log(`${t}loaded namespace ${a} for language ${s}`,o),this.loaded(e,i,o)})}saveMissing(e,t,n,s,a,i={},o=()=>{}){var l,c,f,u,d;if((c=(l=this.services)==null?void 0:l.utils)!=null&&c.hasLoadedNamespace&&!((u=(f=this.services)==null?void 0:f.utils)!=null&&u.hasLoadedNamespace(t))){this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if((d=this.backend)!=null&&d.create){const m={...i,isUpdate:a},p=this.backend.create.bind(this.backend);if(p.length<6)try{let y;p.length===5?y=p(e,t,n,s,m):y=p(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 p(e,t,n,s,o,m)}!e||!e[0]||this.store.addResource(e[0],t,n,s)}}}const yr=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:r=>{let e={};if(typeof r[1]=="object"&&(e=r[1]),q(r[1])&&(e.defaultValue=r[1]),q(r[2])&&(e.tDescription=r[2]),typeof r[2]=="object"||typeof r[3]=="object"){const t=r[3]||r[2];Object.keys(t).forEach(n=>{e[n]=t[n]})}return e},interpolation:{escapeValue:!0,format:r=>r,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),br=r=>{var e,t;return q(r.ns)&&(r.ns=[r.ns]),q(r.fallbackLng)&&(r.fallbackLng=[r.fallbackLng]),q(r.fallbackNS)&&(r.fallbackNS=[r.fallbackNS]),((t=(e=r.supportedLngs)==null?void 0:e.indexOf)==null?void 0:t.call(e,"cimode"))<0&&(r.supportedLngs=r.supportedLngs.concat(["cimode"])),typeof r.initImmediate=="boolean"&&(r.initAsync=r.initImmediate),r},Ze=()=>{},Kn=r=>{Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach(t=>{typeof r[t]=="function"&&(r[t]=r[t].bind(r))})};class Ue extends dt{constructor(e={},t){if(super(),this.options=br(e),this.services={},this.logger=be,this.modules={external:[]},Kn(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(q(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=yr();this.options={...n,...this.options,...br(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?be.init(s(this.modules.logger),this.options):be.init(null,this.options);let c;this.modules.formatter?c=this.modules.formatter:c=Bn;const f=new dr(this.options);this.store=new cr(this.options.resources,this.options);const u=this.services;u.logger=be,u.resourceStore=this.store,u.languageUtils=f,u.pluralResolver=new Vn(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(u.formatter=s(c),u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new Yn(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Gn(s(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",(d,...m)=>{this.emit(d,...m)}),this.modules.languageDetector&&(u.languageDetector=s(this.modules.languageDetector),u.languageDetector.init&&u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=s(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new ot(this.services,this.options),this.translator.on("*",(d,...m)=>{this.emit(d,...m)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Ze),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const 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=Me(),l=()=>{const c=(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 c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),o}loadResources(e,t=Ze){var a,i;let n=t;const s=q(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const o=[],l=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(u=>{u!=="cimode"&&o.indexOf(u)<0&&o.push(u)})};s?l(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(f=>l(f)),(i=(a=this.options.preload)==null?void 0:a.forEach)==null||i.call(a,c=>l(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=Me();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"&&Lr.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=Me();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,l)=>{l?this.isLanguageChangingTo===e&&(s(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,n.resolve((...c)=>this.t(...c)),t&&t(o,(...c)=>this.t(...c))},i=o=>{var f,u;!e&&!o&&this.services.languageDetector&&(o=[]);const l=q(o)?o:o&&o[0],c=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(q(o)?[o]:o);c&&(this.language||s(c),this.translator.language||this.translator.changeLanguage(c),(u=(f=this.services.languageDetector)==null?void 0:f.cacheUserLanguage)==null||u.call(f,c)),this.loadResources(c,d=>{a(d,c)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?i(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e),n}getFixedT(e,t,n){const s=(a,i,...o)=>{let l;typeof i!="object"?l=this.options.overloadTranslationOptionHandler([a,i].concat(o)):l={...i},l.lng=l.lng||s.lng,l.lngs=l.lngs||s.lngs,l.ns=l.ns||s.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||n||s.keyPrefix);const c=this.options.keySeparator||".";let f;return l.keyPrefix&&Array.isArray(a)?f=a.map(u=>`${l.keyPrefix}${c}${u}`):f=l.keyPrefix?`${l.keyPrefix}${c}${a}`:a,this.t(f,l)};return q(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=n,s}t(...e){var t;return(t=this.translator)==null?void 0:t.translate(...e)}exists(...e){var t;return(t=this.translator)==null?void 0:t.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const i=(o,l)=>{const c=this.services.backendConnector.state[`${o}|${l}`];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=Me();return this.options.ns?(q(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{n.resolve(),t&&t(s)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=Me();q(e)&&(e=[e]);const s=this.options.preload||[],a=e.filter(i=>s.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return a.length?(this.options.preload=s.concat(a),this.loadResources(i=>{n.resolve(),t&&t(i)}),n):(t&&t(),Promise.resolve())}dir(e){var s,a;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";const t=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=((a=this.services)==null?void 0:a.languageUtils)||new dr(yr());return t.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new Ue(e,t)}cloneInstance(e={},t=Ze){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new Ue(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((l,c)=>(l[c]={...this.store.data[c]},l[c]=Object.keys(l[c]).reduce((f,u)=>(f[u]={...l[c][u]},f),l[c]),l),{});a.store=new cr(o,s),a.services.resourceStore=a.store}return a.translator=new ot(a.services,s),a.translator.on("*",(o,...l)=>{a.emit(o,...l)}),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=Ue.createInstance();ae.createInstance=Ue.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 qn={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"},zn={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},Jn={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando",CheckObjectWrongValidation:"Oggetto non valido",ConfirmButton:"Conferma",AutocompleteDefaultPlaceholder:"Inserisci codice o descrizione"},Xn={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:qn,Month:zn,Generic:Jn},Zn={Friday:"Friday",FridayShort:"Fri",Monday:"Monday",MondayShort:"Mon",Saturday:"Saturday",SaturdayShort:"Sat",Sunday:"Sunday",SundayShort:"Sun",Tuesday:"Tuesday",TuesdayShort:"Tue",Thursday:"Thursday",ThursdayShort:"Thu",Wednesday:"Wednesday",WednesdayShort:"Wed"},Qn={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},es={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command",CheckObjectWrongValidation:"Object not valid",ConfirmButton:"Confirm",AutocompleteDefaultPlaceholder:"Type code or description"},ts={Date:{NextDay:"Next Day",NextMonth:"Next Month",NextWeek:"Next Week",NextYear:"Next Year",PreviousDay:"Previous Day",PreviousMonth:"Previous Month",PreviousWeek:"Previous Week",PreviousYear:"Previous Year",Today:"Today",Tomorrow:"Tomorrow",Yesterday:"Yesterday"},Day:Zn,Month:Qn,Generic:es};function vr(r,e){return new RegExp(rs(r),e)}function rs(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const ns=(r,e,t)=>{let n=r;return isNaN(n)||(e!=null&&(n=Math.max(n,e)),t!=null&&(n=Math.min(n,t))),n},ss=(r,e)=>{var i,o;const n=Intl.NumberFormat(r).formatToParts(1000.1),s=((i=n.find(l=>l.type==="group"))==null?void 0:i.value)??",",a=e??((o=n.find(l=>l.type==="decimal"))==null?void 0:o.value)??".";return{groupingChar:s,decimalChar:a}};function as(r,e,t,n){let s=e;const a=ls(r,t);if(!s){const o=Math.abs(a);o-Math.floor(o)?s="0,0.00":s="0,0"}const i=cs(s);return new Intl.NumberFormat(n,i).format(a)}const is=(r,e,t)=>{const n=r.lastIndexOf(t);if(n!==-1)return r.length-n-1;const s=t==="."?",":".",a=r.lastIndexOf(s);return a!==-1&&!(s===e&&r.length-a-1===3)?r.length-a-1:0},os=(r,e,t)=>{if(!r)return NaN;let n=r.replace(/\s/g,""),s=t;const a=(n.match(/\./g)||[]).length,i=(n.match(/,/g)||[]).length;if(a&&i)s=n.lastIndexOf(".")>n.lastIndexOf(",")?".":",";else if(!n.includes(t)){const l=n.includes(".")?".":",",c=l==="."?a:i;c>1||c===1&&l===e&&n.length-n.lastIndexOf(l)-1===3||(s=l)}const o=s==="."?",":".";return n=n.replace(new RegExp(`\\${o}`,"g"),""),s!=="."&&(n=n.replace(new RegExp(`\\${s}`,"g"),".")),parseFloat(n)};function ls(r,e,t,n,s){let a=r;if(typeof a!="number"){let o;e&&n===void 0?o=",":o=".";const l=o=="."?",":".";a=a.replace(vr(l,"g"),""),a=a.replace(vr(o,"g"),"."),a=Number(a)}const i=Number(a);return isNaN(i)?NaN:i}function cs(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 as(r,e,a,t)}}}catch{return r}}},resources:{en:{translation:ts},it:{translation:Xn}}});const us=(r,e,t,n)=>ae.format(r,e,t||ae.language,n),fs=(r,e)=>ae.t(r,e);function je(){const r=R.useCallback((n,s,a,i)=>us(n,s,a||void 0,i),[]),e=R.useCallback(()=>ae.languages[0],[]),t=R.useCallback((n,s)=>fs(n,s),[]);return{format:r,getCurrentLanguage:e,translate:t}}var Te=(r=>(r.CALENDAR_FOR="Date.CalendarFor",r.CLOSE="Generic.Close",r.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",r.CHECK_OBJECT_WRONG_VALIDATION="Generic.CheckObjectWrongValidation",r.CONFIRM_BUTTON="Generic.ConfirmButton",r.AUTOCOMPLETE_DEFAULT_PLACEHOLDER="Generic.AutocompleteDefaultPlaceholder",r))(Te||{}),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||{}),_t=(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))(_t||{});const Ct=({bindValue:r,optionalDisplayValue:e,options:t,displayMode:n,listDisplayMode:s="Both",minimumChars:a=3,isEditable:i=!0,fun:o,_changeOnEnter:l=!1,onChange:c,onOptionsRequest:f,onBlur:u,_multiActiveIndex:d,...m})=>{const p=R.useRef(null),[y,x]=R.useState(r),[O,w]=R.useState(e),{translate:S}=je(),[E,b]=R.useState(!1),[$,M]=R.useState(t||[]),[A,T]=R.useState(0),[k,j]=R.useState([r]),{anchorRef:D,targetRef:C,anchorWidth:V}=ct({position:"bottom",enabled:E}),I=R.useCallback(()=>{var _;b(!1),(_=p==null?void 0:p.current)==null||_.focus()},[]);ft([C],E,()=>I());const Y=Dn(400),z=_=>{_.length>=a?o&&f&&Y(async()=>{const P=await f(o,_);M(P),T(P.length>0?0:-1),b(!0)}):I(),x(_),w(e),l||c==null||c(_,e)},J=()=>{E||u==null||u()},U=_=>{l?(x(""),w("")):(x(_.id),w(_.label)),c==null||c(_.id,_.label);const P=$.findIndex(L=>L.id===_.id);T(P),j([_.id]),I()},h=_=>{_.key==="Escape"&&(I(),T(-1))},v=_=>{if((_.key==="ArrowDown"||_.key==="ArrowUp")&&(_.preventDefault(),E)){const P=_.key==="ArrowDown"?(A+1)%$.length:(A-1+$.length)%$.length;T(P)}switch(_.key){case"Enter":A>=0&&A<$.length?U($[A]):l&&(c==null||c(y,""),I(),x(""),w(""));break;case"Escape":I(),T(-1);break}};return g.jsxs("div",{"data-component":"autocomplete",children:[g.jsx($t,{...m,bindValue:y,optionalDisplayValue:O,displayMode:n,isEditable:i,shapeIcon:"magnify",placeholder:S(Te.AUTOCOMPLETE_DEFAULT_PLACEHOLDER),ref:D,inputRef:p,onChange:z,onKeyDown:v,onBlur:J,"aria-autocomplete":"list"}),E&&g.jsx(ut,{children:g.jsx(Cr,{options:$,displayMode:s,onClick:U,ref:C,selectedIndex:A,activeIndex:d||k,width:V,showFilter:!1,onKeyDown:h,isOpen:E})})]})},Pr=({options:r,fun:e,direction:t="row",disposition:n="start",sizing:s,variant:a,appearance:i,showText:o,showIcon:l,fullWidth:c,disabled:f,justify:u,squared:d,onClick:m,onOptionsRequest:p})=>{const[y,x]=R.useState(r);R.useEffect(()=>{!y&&p&&e&&p(e,void 0).then(S=>x(S)).catch(S=>{console.error("Errore nel caricamento delle opzioni per ButtonList",S)})},[y,e,p]);const O={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${n}`},w=y==null?void 0:y.map((S,E)=>{const b={bindValue:S.id,optionalDisplayValue:S.label,fun:S.fun,icon:S.icon,variant:a,appearance:i,showText:o,showIcon:l,fullWidth:c,disabled:f,sizing:s,justify:u,squared:d,onClick:()=>{m==null||m(S.id,S.fun)}};return g.jsx(Se,{...b},`button-${E}`)});return g.jsx("div",{role:"list","data-component":"button-list",className:O.container,children:w})},ds={"smp-checkbox-wrapper":"_smp-checkbox-wrapper_z14lq_2"},Ar=({bindValue:r,_dataComponent:e="checkbox",disabled:t,label:n,isEditable:s=!0,onChange:a,onBlur:i,variant:o="checkbox"})=>{const l=R.useId(),c=u=>{s&&a&&a(u.target.checked)},f={wrapper:`${ds["smp-checkbox-wrapper"]}`};return g.jsxs("div",{className:f.wrapper,"data-component":e,children:[n&&g.jsx(De,{label:n,disabled:t,htmlFor:l}),g.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:r,onChange:c,onBlur:i,role:o==="switch"?"switch":"checkbox",id:l})]})},kt=({elements:r,isEditable:e=!1,displayMode:t="Both",onChange:n,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,l]=R.useState(null),c={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},f=m=>{n==null||n(r.filter((p,y)=>y!==m))},u=m=>{l(m)},d=m=>{if(o===null||o===m)return;const p=[...r],[y]=p.splice(o,1);p.splice(m,0,y),n==null||n(p),l(null)};return g.jsx("div",{className:c.container,role:"list","data-component":"chip",children:r.flatMap((m,p)=>{const y=Ae(m.bindValue,m.optionalDisplayValue,t),x=g.jsxs("div",{className:c.element,role:"listitem",draggable:i,onDragStart:()=>u(p),onDragOver:w=>i&&w.preventDefault(),onDrop:()=>i&&d(p),style:{"--smp-chips-backgroundColor-base":a},children:[i&&g.jsx(oe,{icon:"drag_indicator_horizontal",isInteractable:!0}),g.jsx(_e,{variant:"label",bindValue:y,color:s}),e&&g.jsx(oe,{icon:"close",isInteractable:!0,onClick:()=>f(p),color:s})]},`chip-${p}`),O=i&&p<r.length-1?g.jsx(oe,{icon:"chevron-right",color:s},`separator-${p}`):null;return[x,O].filter(Boolean)})})};function Lt(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(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 u=f[0],d=f[f.length-1];c.shiftKey&&document.activeElement===u?(c.preventDefault(),d.focus()):!c.shiftKey&&document.activeElement===d&&(c.preventDefault(),u.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 l=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",o),document.body.style.overflow=l,t.current&&requestAnimationFrame(()=>{var c;(c=t.current)==null||c.focus()})}},[r,e])}const Ir=({bindValue:r,onChange:e,options:t=[],optionalDisplayValue:n,isEditable:s,displayMode:a,listDisplayMode:i="Both",fun:o,onOptionsRequest:l,multiActiveIndex:c,...f})=>{const u=R.useRef(null),[d,m]=R.useState(!1),[p,y]=R.useState(t),[x,O]=R.useState(-1),[w,S]=R.useState([r]),E=R.useId(),{anchorRef:b,targetRef:$,anchorWidth:M}=ct({position:"bottom",enabled:d}),A=R.useCallback(()=>{var C;m(!1),(C=u==null?void 0:u.current)==null||C.focus()},[]);ft([$,b],d,()=>A()),Lt(d,$);const T=C=>{e==null||e(C.id,C.label);const V=p.findIndex(I=>I.id===C.id);O(V),S([C.id]),A()},k=C=>{C.key==="Escape"&&(A(),O(-1))},j=C=>{(C.key==="ArrowDown"||C.key==="ArrowUp")&&(C.preventDefault(),D())},D=()=>{s&&(o&&l?d?m(!1):l(o,void 0).then(C=>{y(C),O(C.length>0?0:-1),m(!0)}):m(C=>!C))};return g.jsxs("div",{role:"combobox","aria-expanded":d,"aria-controls":E,"aria-owns":E,"data-component":"combobox",children:[g.jsx($t,{...f,bindValue:r,optionalDisplayValue:n,displayMode:a,onShapeIconClick:D,onKeyDown:j,onClick:D,shapeIcon:"arrow_drop_down",rotatedShapeIcon:d,isEditable:s,ref:b,inputRef:u,"aria-autocomplete":"list",variant:"notSelectable"}),d&&g.jsx(ut,{children:g.jsx(Cr,{id:E,options:p,displayMode:i,ref:$,isOpen:d,selectedIndex:x,activeIndex:c||w,width:M,onClick:T,onKeyDown:k})})]})},ps={"smp-datepickercalendar-position":"_smp-datepickercalendar-position_1lf9g_1"};function hs({selectedDate:r,onDateChange:e,disabledDateRanges:t=[],initialValue:n,targetRef:s}){const{translate:a}=je(),i=()=>{if(!n)return;const U=new Date(n);return isNaN(U.getTime())?void 0:U},[o]=R.useState(new Date),[l,c]=R.useState(r||i()||new Date),[f,u]=R.useState(l?l.getMonth():new Date().getMonth()),[d,m]=R.useState(l?l.getFullYear():new Date().getFullYear()),[p,y]=R.useState(l?l.getDate():null),x=R.useRef(null),O=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)],S=[{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)}],E=U=>t.some(h=>{const v=h.start.getTime(),_=h.end.getTime(),P=U.getTime();return P>=v&&P<=_}),b=U=>{E(U)||(c(U),y(U.getDate()),e&&e(On(U)))},$=()=>{f===0?(u(11),m(d-1)):u(f-1),y(1)},M=()=>{f===11?(u(0),m(d+1)):u(f+1),y(1)},A=(U,h)=>new Date(U,h+1,0).getDate(),T=(U,h)=>new Date(U,h,1).getDay(),k=U=>{var v;const h=V.findIndex(_=>_!==null&&_.getDate()===U);h!==-1&&O.current[h]&&((v=O.current[h])==null||v.focus(),y(U))},j=(U,h)=>{const v=V[h];if(!v)return;const _=A(d,f),P=v.getDate();switch(U.key){case"ArrowRight":U.preventDefault();{let L=P+1,N=new Date(d,f,L);if(L>_){const B=f===11?d+1:d,H=f===11?0:f+1;L=1,N=new Date(B,H,L),M(),setTimeout(()=>{D(1,"forward")},0);return}E(N)?D(L,"forward"):k(L)}break;case"Tab":break;case"ArrowLeft":U.preventDefault();{let L=P-1,N=new Date(d,f,L);if(L<1){const B=f===0?d-1:d,H=f===0?11:f-1,W=A(B,H);L=W,N=new Date(B,H,L),$(),setTimeout(()=>{D(W,"backward")},0);return}E(N)?D(L,"backward"):k(L)}break;case"ArrowUp":U.preventDefault();{let L=P-7,N=new Date(d,f,L);if(L<1){const B=f===0?d-1:d,H=f===0?11:f-1;L=A(B,H)+L,N=new Date(B,H,L),$(),setTimeout(()=>{D(L,"backward")},0);return}E(N)?D(L,"backward"):k(L)}break;case"ArrowDown":U.preventDefault();{let L=P+7,N=new Date(d,f,L);if(L>_){const B=f===11?d+1:d,H=f===11?0:f+1;L=L-_,N=new Date(B,H,L),M(),setTimeout(()=>{D(L,"forward")},0);return}E(N)?D(L,"forward"):k(L)}break;case"Home":U.preventDefault(),D(1,"forward");break;case"End":U.preventDefault(),D(_,"backward");break;case"PageUp":U.preventDefault(),$(),setTimeout(()=>{const L=A(f===0?d-1:d,f===0?11:f-1),N=Math.min(P,L);D(N,"forward")},0);break;case"PageDown":U.preventDefault(),M(),setTimeout(()=>{const L=A(f===11?d+1:d,f===11?0:f+1),N=Math.min(P,L);D(N,"forward")},0);break;case" ":case"Space":if(E(v))return;y(v.getDate()),c(v);break;case"Enter":U.preventDefault(),b(v);break}},D=(U,h)=>{const v=A(d,f);if(h==="forward"){for(let _=U;_<=v;_++){const P=new Date(d,f,_);if(!E(P)){k(_);return}}M(),setTimeout(()=>{D(1,"forward")},0)}else{for(let N=U;N>=1;N--){const B=new Date(d,f,N);if(!E(B)){k(N);return}}const _=f===0?d-1:d,P=f===0?11:f-1,L=A(_,P);$(),setTimeout(()=>{D(L,"backward")},0)}},V=(()=>{const U=A(d,f),h=T(d,f),v=[];for(let _=0;_<h;_++)v.push(null);for(let _=1;_<=U;_++){const P=new Date(d,f,_);v.push(P)}return v})(),I=[];let Y=[];V.forEach((U,h)=>{if(Y.push(U),Y.length===7||h===V.length-1){for(;Y.length<7;)Y.push(null);I.push(Y),Y=[]}}),R.useEffect(()=>{var U;if(p!==null){const h=V.findIndex(v=>v!==null&&v.getDate()===p);h!==-1&&O.current[h]&&((U=O.current[h])==null||U.focus())}},[f,d,p,V]);const z={label:"smp-datepickercalendar-label",wrapper:`smp-datepickercalendar ${ps["smp-datepickercalendar-position"]}`,calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(U,h,v,_)=>`smp-datepickercalendar-td
46
- ${U?"smp-datepickercalendar-td-today":""}
44
+ */var ht,Gt;function or(){if(Gt)return ht;Gt=1;var n=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable;function r(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 l=Object.getOwnPropertyNames(i).map(function(f){return i[f]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(f){c[f]=f}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ht=s()?Object.assign:function(a,i){for(var o,l=r(a),c,f=1;f<arguments.length;f++){o=Object(arguments[f]);for(var u in o)e.call(o,u)&&(l[u]=o[u]);if(n){c=n(o);for(var d=0;d<c.length;d++)t.call(o,c[d])&&(l[c[d]]=o[c[d]])}}return l},ht}var mt,Kt;function Rt(){if(Kt)return mt;Kt=1;var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return mt=n,mt}var gt,qt;function Rn(){return qt||(qt=1,gt=Function.call.bind(Object.prototype.hasOwnProperty)),gt}var yt,zt;function ir(){if(zt)return yt;zt=1;var n=function(){};if(process.env.NODE_ENV!=="production"){var e=Rt(),t={},r=Rn();n=function(a){var i="Warning: "+a;typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}}function s(a,i,o,l,c){if(process.env.NODE_ENV!=="production"){for(var f in a)if(r(a,f)){var u;try{if(typeof a[f]!="function"){var d=Error((l||"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,l,o,null,e)}catch(p){u=p}if(u&&!(u instanceof Error)&&n((l||"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 g=c?c():"";n("Failed "+o+" type: "+u.message+(g??""))}}}}return s.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(t={})},yt=s,yt}var bt,Jt;function lr(){if(Jt)return bt;Jt=1;var n=On(),e=or(),t=Rt(),r=Rn(),s=ir(),a=function(){};process.env.NODE_ENV!=="production"&&(a=function(o){var l="Warning: "+o;typeof console<"u"&&console.error(l);try{throw new Error(l)}catch{}});function i(){return null}return bt=function(o,l){var c=typeof Symbol=="function"&&Symbol.iterator,f="@@iterator";function u(h){var y=h&&(c&&h[c]||h[f]);if(typeof y=="function")return y}var d="<<anonymous>>",g={array:R("array"),bigint:R("bigint"),bool:R("boolean"),func:R("function"),number:R("number"),object:R("object"),string:R("string"),symbol:R("symbol"),any:E(),arrayOf:C,element:x(),elementType:v(),instanceOf:$,node:O(),objectOf:D,oneOf:w,oneOfType:P,shape:L,exact:M};function p(h,y){return h===y?h!==0||1/h===1/y:h!==h&&y!==y}function b(h,y){this.message=h,this.data=y&&typeof y=="object"?y:{},this.stack=""}b.prototype=Error.prototype;function S(h){if(process.env.NODE_ENV!=="production")var y={},_=0;function k(I,U,W,Y,J,K,re){if(Y=Y||d,K=K||W,re!==t){if(l){var F=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 F.name="Invariant Violation",F}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var B=Y+":"+W;!y[B]&&_<3&&(a("You are manually calling a React.PropTypes validation function for the `"+K+"` prop on `"+Y+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),y[B]=!0,_++)}}return U[W]==null?I?U[W]===null?new b("The "+J+" `"+K+"` is marked as required "+("in `"+Y+"`, but its value is `null`.")):new b("The "+J+" `"+K+"` is marked as required in "+("`"+Y+"`, but its value is `undefined`.")):null:h(U,W,Y,J,K)}var j=k.bind(null,!1);return j.isRequired=k.bind(null,!0),j}function R(h){function y(_,k,j,I,U,W){var Y=_[k],J=G(Y);if(J!==h){var K=z(Y);return new b("Invalid "+I+" `"+U+"` of type "+("`"+K+"` supplied to `"+j+"`, expected ")+("`"+h+"`."),{expectedType:h})}return null}return S(y)}function E(){return S(i)}function C(h){function y(_,k,j,I,U){if(typeof h!="function")return new b("Property `"+U+"` of component `"+j+"` has invalid PropType notation inside arrayOf.");var W=_[k];if(!Array.isArray(W)){var Y=G(W);return new b("Invalid "+I+" `"+U+"` of type "+("`"+Y+"` supplied to `"+j+"`, expected an array."))}for(var J=0;J<W.length;J++){var K=h(W,J,j,I,U+"["+J+"]",t);if(K instanceof Error)return K}return null}return S(y)}function x(){function h(y,_,k,j,I){var U=y[_];if(!o(U)){var W=G(U);return new b("Invalid "+j+" `"+I+"` of type "+("`"+W+"` supplied to `"+k+"`, expected a single ReactElement."))}return null}return S(h)}function v(){function h(y,_,k,j,I){var U=y[_];if(!n.isValidElementType(U)){var W=G(U);return new b("Invalid "+j+" `"+I+"` of type "+("`"+W+"` supplied to `"+k+"`, expected a single ReactElement type."))}return null}return S(h)}function $(h){function y(_,k,j,I,U){if(!(_[k]instanceof h)){var W=h.name||d,Y=V(_[k]);return new b("Invalid "+I+" `"+U+"` of type "+("`"+Y+"` supplied to `"+j+"`, expected ")+("instance of `"+W+"`."))}return null}return S(y)}function w(h){if(!Array.isArray(h))return process.env.NODE_ENV!=="production"&&(arguments.length>1?a("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):a("Invalid argument supplied to oneOf, expected an array.")),i;function y(_,k,j,I,U){for(var W=_[k],Y=0;Y<h.length;Y++)if(p(W,h[Y]))return null;var J=JSON.stringify(h,function(re,F){var B=z(F);return B==="symbol"?String(F):F});return new b("Invalid "+I+" `"+U+"` of value `"+String(W)+"` "+("supplied to `"+j+"`, expected one of "+J+"."))}return S(y)}function D(h){function y(_,k,j,I,U){if(typeof h!="function")return new b("Property `"+U+"` of component `"+j+"` has invalid PropType notation inside objectOf.");var W=_[k],Y=G(W);if(Y!=="object")return new b("Invalid "+I+" `"+U+"` of type "+("`"+Y+"` supplied to `"+j+"`, expected an object."));for(var J in W)if(r(W,J)){var K=h(W,J,j,I,U+"."+J,t);if(K instanceof Error)return K}return null}return S(y)}function P(h){if(!Array.isArray(h))return process.env.NODE_ENV!=="production"&&a("Invalid argument supplied to oneOfType, expected an instance of array."),i;for(var y=0;y<h.length;y++){var _=h[y];if(typeof _!="function")return a("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+Z(_)+" at index "+y+"."),i}function k(j,I,U,W,Y){for(var J=[],K=0;K<h.length;K++){var re=h[K],F=re(j,I,U,W,Y,t);if(F==null)return null;F.data&&r(F.data,"expectedType")&&J.push(F.data.expectedType)}var B=J.length>0?", expected one of type ["+J.join(", ")+"]":"";return new b("Invalid "+W+" `"+Y+"` supplied to "+("`"+U+"`"+B+"."))}return S(k)}function O(){function h(y,_,k,j,I){return N(y[_])?null:new b("Invalid "+j+" `"+I+"` supplied to "+("`"+k+"`, expected a ReactNode."))}return S(h)}function A(h,y,_,k,j){return new b((h||"React class")+": "+y+" type `"+_+"."+k+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+j+"`.")}function L(h){function y(_,k,j,I,U){var W=_[k],Y=G(W);if(Y!=="object")return new b("Invalid "+I+" `"+U+"` of type `"+Y+"` "+("supplied to `"+j+"`, expected `object`."));for(var J in h){var K=h[J];if(typeof K!="function")return A(j,I,U,J,z(K));var re=K(W,J,j,I,U+"."+J,t);if(re)return re}return null}return S(y)}function M(h){function y(_,k,j,I,U){var W=_[k],Y=G(W);if(Y!=="object")return new b("Invalid "+I+" `"+U+"` of type `"+Y+"` "+("supplied to `"+j+"`, expected `object`."));var J=e({},_[k],h);for(var K in J){var re=h[K];if(r(h,K)&&typeof re!="function")return A(j,I,U,K,z(re));if(!re)return new b("Invalid "+I+" `"+U+"` key `"+K+"` supplied to `"+j+"`.\nBad object: "+JSON.stringify(_[k],null," ")+`
45
+ Valid keys: `+JSON.stringify(Object.keys(h),null," "));var F=re(W,K,j,I,U+"."+K,t);if(F)return F}return null}return S(y)}function N(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(N);if(h===null||o(h))return!0;var y=u(h);if(y){var _=y.call(h),k;if(y!==h.entries){for(;!(k=_.next()).done;)if(!N(k.value))return!1}else for(;!(k=_.next()).done;){var j=k.value;if(j&&!N(j[1]))return!1}}else return!1;return!0;default:return!1}}function H(h,y){return h==="symbol"?!0:y?y["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&y instanceof Symbol:!1}function G(h){var y=typeof h;return Array.isArray(h)?"array":h instanceof RegExp?"object":H(y,h)?"symbol":y}function z(h){if(typeof h>"u"||h===null)return""+h;var y=G(h);if(y==="object"){if(h instanceof Date)return"date";if(h instanceof RegExp)return"regexp"}return y}function Z(h){var y=z(h);switch(y){case"array":case"object":return"an "+y;case"boolean":case"date":case"regexp":return"a "+y;default:return y}}function V(h){return!h.constructor||!h.constructor.name?d:h.constructor.name}return g.checkPropTypes=s,g.resetWarningCache=s.resetWarningCache,g.PropTypes=g,g},bt}var vt,Xt;function cr(){if(Xt)return vt;Xt=1;var n=Rt();function e(){}function t(){}return t.resetWarningCache=e,vt=function(){function r(i,o,l,c,f,u){if(u!==n){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}}r.isRequired=r;function s(){return r}var a={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:s,element:r,elementType:r,instanceOf:s,node:r,objectOf:s,oneOf:s,oneOfType:s,shape:s,exact:s,checkPropTypes:t,resetWarningCache:e};return a.PropTypes=a,a},vt}var Zt;function ur(){if(Zt)return Ge.exports;if(Zt=1,process.env.NODE_ENV!=="production"){var n=On(),e=!0;Ge.exports=lr()(n.isElement,e)}else Ge.exports=cr()();return Ge.exports}var oe=ur(),fr=function(e){var t=e?.ownerDocument||document;return t.defaultView||window},dr=function(e,t){for(var r in e)if(!(r in t))return!0;for(var s in t)if(e[s]!==t[s])return!0;return!1},pr=["afterInjection","beforeInjection","desc","evalScripts","fallback","httpRequestWithCredentials","loading","renumerateIRIElements","src","title","useRequestCache","wrapper"],qe="http://www.w3.org/2000/svg",Qt="http://www.w3.org/1999/xlink",$e=function(n){function e(){for(var r,s=arguments.length,a=new Array(s),i=0;i<s;i++)a[i]=arguments[i];return r=n.call.apply(n,[this].concat(a))||this,r.initialState={hasError:!1,isLoading:!0},r.state=r.initialState,r._isMounted=!1,r.reactWrapper=void 0,r.nonReactWrapper=void 0,r.refCallback=function(o){r.reactWrapper=o},r}qn(e,n);var t=e.prototype;return t.renderSVG=function(){var s=this;if(this.reactWrapper instanceof fr(this.reactWrapper).Node){var a=this.props,i=a.desc,o=a.evalScripts,l=a.httpRequestWithCredentials,c=a.renumerateIRIElements,f=a.src,u=a.title,d=a.useRequestCache,g=this.props.onError,p=this.props.beforeInjection,b=this.props.afterInjection,S=this.props.wrapper,R,E;S==="svg"?(R=document.createElementNS(qe,S),R.setAttribute("xmlns",qe),R.setAttribute("xmlns:xlink",Qt),E=document.createElementNS(qe,S)):(R=document.createElement(S),E=document.createElement(S)),R.appendChild(E),E.dataset.src=f,this.nonReactWrapper=this.reactWrapper.appendChild(R);var C=function(w){if(s.removeSVG(),!s._isMounted){g(w);return}s.setState(function(){return{hasError:!0,isLoading:!1}},function(){g(w)})},x=function(w,D){if(w){C(w);return}s._isMounted&&s.setState(function(){return{isLoading:!1}},function(){try{b(D)}catch(P){C(P)}})},v=function(w){if(w.setAttribute("role","img"),i){var D=w.querySelector(":scope > desc");D&&w.removeChild(D);var P=document.createElement("desc");P.innerHTML=i,w.prepend(P)}if(u){var O=w.querySelector(":scope > title");O&&w.removeChild(O);var A=document.createElement("title");A.innerHTML=u,w.prepend(A)}try{p(w)}catch(L){C(L)}};rr(E,{afterEach:x,beforeEach:v,cacheRequests:d,evalScripts:o,httpRequestWithCredentials:l,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;dr(et({},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,l=Kn(s,pr),c=o;return We.createElement(c,et({},l,{ref:this.refCallback},o==="svg"?{xmlns:qe,xmlnsXlink:Qt}:{}),this.state.isLoading&&i&&We.createElement(i,null),this.state.hasError&&a&&We.createElement(a,null))},e}(We.Component);$e.defaultProps={afterInjection:function(){},beforeInjection:function(){},desc:"",evalScripts:"never",fallback:null,httpRequestWithCredentials:!1,loading:null,onError:function(){},renumerateIRIElements:!0,title:"",useRequestCache:!0,wrapper:"div"};$e.propTypes={afterInjection:oe.func,beforeInjection:oe.func,desc:oe.string,evalScripts:oe.oneOf(["always","once","never"]),fallback:oe.oneOfType([oe.func,oe.object,oe.string]),httpRequestWithCredentials:oe.bool,loading:oe.oneOfType([oe.func,oe.object,oe.string]),onError:oe.func,renumerateIRIElements:oe.bool,src:oe.string.isRequired,title:oe.string,useRequestCache:oe.bool,wrapper:oe.oneOf(["div","span","svg"])};let wt={assets:"/"};const hr=n=>{wt={...wt,...n}},en=n=>`${wt.assets}/${n}`.replace(/\/+/g,"/"),ie=T.memo(({icon:n,width:e,height:t,placeholderIcon:r,color:s,disabled:a,state:i="base",rotated:o=!1,onClick:l,isInteractable:c=!1,spin:f=!1,title:u,tabIndex:d})=>{const[g,p]=T.useState(n),b=n?.startsWith("http")||n?.startsWith("/"),S=b&&n?.toLowerCase().endsWith(".svg"),R=en(`assets/svg/${n}.svg`),E=en(`assets/svg/${r}.svg`),C={img:`${c?"smp-image-interactable":""}`,svg:`smp-icon ${i?`smp-icon-${i}`:""} ${o?"smp-icon-rotated":""} ${c?"smp-icon-interactable":""} ${f?"smp-icon-spin":""}`},x=()=>{!a&&c&&l&&l()},v=$=>{!a&&c&&($.key==="Enter"||$.key===" ")&&($.preventDefault(),x())};return m.jsx(m.Fragment,{children:S?m.jsx($e,{src:n,fallback:()=>m.jsx($e,{src:E,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:C.svg,onClick:x,onKeyDown:v,tabIndex:d}):b?m.jsx("img",{src:g,width:e||"16px",height:t||"auto",alt:u,onError:()=>p(E),onClick:x,className:C.img,title:u,onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&x()}}):m.jsx($e,{src:R,fallback:()=>m.jsx($e,{src:E,wrapper:"svg"}),width:e||"1rem",height:t||"1rem",wrapper:"svg",title:u,role:"application",fill:s,"aria-disabled":a,className:C.svg,onClick:x,onKeyDown:v,tabIndex:d})})}),tn=n=>({extraSmall:12,small:14,base:18,large:20,extraLarge:24})[n],nn=n=>({primary:"onPrimary",danger:"onDanger",base:"base"})[n],be=({bindValue:n,onClick:e,ariaLabel:t,icon:r,disabled:s,sizing:a="base",variant:i="primary",appearance:o="raised",showIcon:l=!0,showText:c=!0,fullWidth:f=!1,loading:u=!1,justify:d="center",title:g,optionalDisplayValue:p,squared:b=!1,submit:S=!1})=>{const R={container:`smp-button smp-button-container ${a?`smp-button-${a}`:""} ${i?`smp-buttonVariant-${i}`:""} ${o?`smp-buttonType-${o}`:""} ${f?"smp-button-fullWidth":""} smp-justifyContent-${d} ${b&&!c?"smp-button-squared":""}`};return m.jsx("button",{"data-component":"button",type:S?"submit":"button",className:R.container,onClick:e,"aria-label":t,disabled:s,"aria-busy":u,title:g||p,children:u?m.jsx(ie,{icon:"spinner",state:nn(i),spin:!0}):m.jsxs(m.Fragment,{children:[r&&l&&m.jsx(ie,{icon:r,disabled:s,state:nn(i),width:tn(a),height:tn(a)}),c&&m.jsx("span",{children:p||n})]})})},mr={titleLarge:"h2",title:"h3",body:"h6",label:"label"},Ee=({variant:n="body",bindValue:e,color:t,...r})=>{const s=mr[n],a={container:`smp-typography ${n?`smp-typography-${n}`:""} ${r.disabled?"smp-typography-disabled":""}`};return m.jsx(s,{className:a.container,disabled:r.disabled,style:{"--smp-typography-color-base":t},children:e})},me={"smp-tabbar-container":"_smp-tabbar-container_1scvh_1","smp-tabbar-scroll-button":"_smp-tabbar-scroll-button_1scvh_8","smp-tabbar-scroll-buttonRight":"_smp-tabbar-scroll-buttonRight_1scvh_13","smp-tabbar-scroll-buttonLeft":"_smp-tabbar-scroll-buttonLeft_1scvh_17","smp-tabbar-list-wrapper":"_smp-tabbar-list-wrapper_1scvh_21","smp-tabbar-list":"_smp-tabbar-list_1scvh_21","smp-tabbar-tab":"_smp-tabbar-tab_1scvh_38","smp-active":"_smp-active_1scvh_62","smp-tabbar-tab-extraSmall":"_smp-tabbar-tab-extraSmall_1scvh_75","smp-tabbar-tab-small":"_smp-tabbar-tab-small_1scvh_80","smp-tabbar-tab-base":"_smp-tabbar-tab-base_1scvh_85","smp-tabbar-tab-large":"_smp-tabbar-tab-large_1scvh_90","smp-tabbar-tab-extraLarge":"_smp-tabbar-tab-extraLarge_1scvh_95"},_n=({data:n,sizing:e="large",toolbar:t=!0,selectedIndex:r,onTabChange:s})=>{const[a,i]=T.useState(0),o=r??a,[l,c]=T.useState(!1),[f,u]=T.useState(!1),d=T.useRef(null);if(T.useEffect(()=>{const C=d.current;if(!C)return;S();const x=()=>S();return C.addEventListener("scroll",x),window.addEventListener("resize",S),()=>{C.removeEventListener("scroll",x),window.removeEventListener("resize",S)}},[]),!n.children||n.children.length===0)return m.jsx("div",{className:"tab-bar-empty",children:"No tabs available"});const g={container:me["smp-tabbar-container"],listWrapper:me["smp-tabbar-list-wrapper"],list:me["smp-tabbar-list"],tab:`${me["smp-tabbar-tab"]} ${e?me[`smp-tabbar-tab-${e}`]:""}`,scrollButtonRight:`${me["smp-tabbar-scroll-button"]} ${me["smp-tabbar-scroll-buttonRight"]}`,scrollButtonLeft:`${me["smp-tabbar-scroll-button"]} ${me["smp-tabbar-scroll-buttonLeft"]}`,active:me["smp-active"]},p=100,b=2,S=()=>{const C=d.current;C&&(c(C.scrollLeft>0),u(C.scrollLeft+C.clientWidth<C.scrollWidth-b))},R=()=>{d.current?.scrollBy({left:-p,behavior:"smooth"})},E=()=>{d.current?.scrollBy({left:p,behavior:"smooth"})};return m.jsxs("div",{className:g.container,role:"tabpanel","data-component":"tab-bar",children:[l&&m.jsx("div",{className:g.scrollButtonLeft,children:m.jsx(be,{bindValue:"",optionalDisplayValue:"<",onClick:R,variant:"base",sizing:e})}),m.jsx("div",{className:g.listWrapper,children:m.jsx("div",{className:g.list,ref:d,role:"tablist",children:n.children.map((C,x)=>m.jsxs("button",{type:"button",className:`${x===a?g.active:""} ${g.tab} `,role:"tab","aria-selected":x===o,tabIndex:x===o?0:-1,onClick:()=>{s&&s(x),i(x)},children:[C.icon&&m.jsx(ie,{icon:C.icon,placeholderIcon:C.placeholderIcon}),m.jsx(Ee,{variant:"body",bindValue:C.decode||"Tab[object Object]"}),t&&(o===x?m.jsx(ie,{icon:"more_vert",isInteractable:!0,onClick:()=>{console.log("clicked icon")}}):m.jsx(ie,{icon:"empty"}))]},x))})}),f&&m.jsx("div",{className:g.scrollButtonRight,children:m.jsx(be,{bindValue:"",optionalDisplayValue:">",onClick:E,variant:"base",sizing:e})})]})},tt=({children:n,layout:e={horizontal:!1,sectionsType:"tab",sections:[{id:"1",content:Array.isArray(n)?n.map(t=>({id:t.props.id})):[{id:n.props.id}]}]}})=>{const[t,r]=T.useState(0),s={};T.Children.forEach(n,p=>{T.isValidElement(p)&&(s[p.props.id]=p)});const a="--smp-grid-template-cols",i="--smp-grid-template-rows",o=En(e.sections??[],Object.keys(s)),l=p=>p.reduce((b,S)=>{let R="",E={},C={},x="";return S.sections?.length?(R=fe["smp-layout-section-grid"],E=l(S.sections),S.gridCols===void 0&&(x=fe[S.horizontal?"smp-grid-template-cols":"smp-grid-template-rows"],(S.horizontal||Nt(S.sections))&&(C=It(S.sections,S.horizontal?a:i)))):S.content?.length&&(S.gridCols!==void 0&&S.gridCols>0?(R=fe["smp-layout-section-grid"],x=fe["smp-grid-template-cols"],C={[a]:`repeat(${S.gridCols}, 1fr)`}):R=fe["smp-layout-section-flex"]),{...b,...E,[S.id]:{classes:`${R} ${fe[S.horizontal?"smp-layout-section-horizontal":"smp-layout-section-vertical"]} ${x} ${S.justify?`smp-justifyContent-${S.justify}`:""} ${S.align?`smp-alignItems-${S.align}`:""}`,styles:C}}},{}),c=l(o),f=`${fe["smp-layout"]} ${e.horizontal?fe["smp-layout-horizontal"]:fe["smp-layout-vertical"]}`,u=e.horizontal||Nt(e.sections||[])?It(o,e.horizontal?a:i):{},d=(p,b)=>{const S=m.jsx("div",{"smp-id":`section-${p.id}`,className:c[p.id].classes,style:c[p.id].styles,children:p.sections?.length?p.sections.map(R=>d(R)):p.content?.map(R=>g(R,p.justify,p.align))},`section-${p.id}`);return p.title&&!b?m.jsxs("div",{className:fe["smp-layout-section-with-title"],children:[m.jsx("span",{className:`${fe["smp-layout-section-title"]} ${p.justify?`smp-justifyContent-${p.justify}`:""} ${p.align?`smp-alignItems-${p.align}`:""}`,children:m.jsx(Te,{label:p.title})}),S]},`title-section-${p.id}`):S},g=(p,b,S)=>{const R=s[p.id];if(!R)return null;const C={gridColumnStart:(p.colSpan&&p.colSpan>0?`span ${p.colSpan}`:p.colStart&&p.colStart<1?"1":void 0)??p.colStart,gridColumnEnd:p.colEnd&&p.colEnd>0?p.colEnd:void 0},x=`${fe["smp-layout-cell-container"]} ${b?`smp-justifyContent-${b}`:""} ${S?`smp-alignItems-${S}`:""}`;return m.jsx("div",{className:x,style:C,"smp-id":p.id,children:R},p.id)};return m.jsxs("div",{className:f,style:u,"smp-id":"layout",children:[e.sectionsType==="tab"&&e.sections&&e?.sections.length>1&&m.jsx(_n,{data:{type:"SmeupDataTree",children:o.map(p=>({decode:p.title||p.id||"Tab",obj:{t:"",p:"",k:""},placeholderIcon:"tab",cells:{},children:[],shape:void 0}))},selectedIndex:t,onTabChange:r,toolbar:!1}),e.sectionsType?d(o[t],!0):o.map(p=>d(p))]})},te={AUTOCOMPLETE:"ACP",BUTTON_LIST:"BTL",BUTTON:"BTN",CHECKBOX:"CHK",CHIP:"CHI",COMBOBOX:"CMB",DATE:"CAL",EDITOR:"EDT",ICON:"ICO",IMAGE:"IMG",INPUT_NUMBER:"INR",MEMO:"MEM",MULTI_AUTOCOMPLETE:"AML",RADIO:"RAD",SPOTLIGHT:"SPL",SWITCH:"SWT",TEXT_FIELD:"ITX",TIME:"TIM",PASSWORD:"PWD"},gr=n=>n.t=="D8",yr=n=>n.t=="I1",br=n=>{if(n){const e=n.split(";");if(e.length==3)return{t:e[0],p:e[1],k:e[2]}}return{t:"",p:"",k:""}};class nt{class;value;constructor(e,t){this.class=e,this.value=t}static fromDataObj(e){return new nt(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 vr(n,e){if(_t(n)){const f=new Date(n);if(!isNaN(f.getTime()))return f}const t=new Date,r=n.replaceAll("/","").replaceAll("-","");let s="DDMMYYYY";e==="en"&&(s="MMDDYYYY");const a=s.indexOf("DD"),i=s.indexOf("MM");let o=0,l=0,c="";switch(r.length){case 1:case 2:return o=parseInt(r),t.setDate(o),ze(t)?t:n;case 3:case 4:return o=parseInt(r.substring(0,2)),l=parseInt(r.substring(2,4)),i===0?(t.setMonth(o-1),t.setDate(l)):a===0&&(t.setMonth(l-1),t.setDate(o)),ze(t)?t:n;case 5:case 6:{o=parseInt(r.substring(0,2)),l=parseInt(r.substring(2,4)),Number(r.substring(4))>50?c="19"+r.substring(4):c="20"+r.substring(4);let f=0,u=0;return i===0?(f=l,u=o-1,t.setFullYear(parseInt(c),u,f)):a===0&&(f=o,u=l-1,t.setFullYear(parseInt(c),u,f)),Et(o,u,parseInt(c))&&ze(t)?t:n}case 7:case 8:{o=parseInt(r.substring(0,2)),l=parseInt(r.substring(2,4)),c=r.substring(4);let f=0,u=0;return i===0?(f=l,u=o-1,t.setFullYear(parseInt(c),u,f)):a===0&&(f=o,u=l-1,t.setFullYear(parseInt(c),u,f)),Et(f,u,parseInt(c))&&ze(t)?t:n}}return n}function _t(n){return/^\d{4}-\d{2}-\d{2}$/.test(n)&&n.length===10}function ze(n){return n instanceof Date&&!isNaN(n.getTime())}function xr(n){if(!/^\d{8}$/.test(n))return!1;const e=parseInt(n.slice(0,4),10),t=parseInt(n.slice(4,6),10),r=parseInt(n.slice(6,8),10);return Et(r,t-1,e)}function Et(n,e,t){const r=[31,Sr(t)?29:28,31,30,31,30,31,31,30,31,30,31];return!(e<0||e>11||n<1||n>r[e])}function Sr(n){return n%4===0&&(n%100!==0||n%400===0)}function wr(n){const e=n.getFullYear(),t=String(n.getMonth()+1).padStart(2,"0"),r=String(n.getDate()).padStart(2,"0");return isNaN(e)||isNaN(Number(t))||isNaN(Number(r))?n.toString():`${e}-${t}-${r}`}class rt{class;date;constructor(e,t){this.class=e,this.date=t}static fromDataObj(e){const t=rn.get(`${e.t}${e.p}`);if(t)return new rt(e,t.legacyToIso(e.k));throw new Error(`Date creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=rn.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 rn=new Map([["D8*YYMD",{legacyToIso(n){return xr(n)&&`${n.substring(0,4)}-${n.substring(4,6)}-${n.substring(6,8)}`||n},isoToLegacy(n){return _t(n)&&n.replaceAll("-","")||n}}]]);function lt({position:n="bottom",enabled:e=!0}){const t=T.useRef(null),r=T.useRef(null),[s,a]=T.useState(0),i=T.useCallback(()=>{const o=t.current,l=r.current;if(!o||!l)return;const{top:c,left:f,width:u,height:d}=o.getBoundingClientRect();a(u);const g=l.offsetHeight,p=l.offsetWidth;if(p===0||g===0){requestAnimationFrame(i);return}let b=c+window.scrollY,S=f+window.scrollX;switch(n){case"top":b-=g;break;case"bottom":b+=d;break;case"left":S-=p;break;case"right":S+=u;break}requestAnimationFrame(()=>{l.style.transform=`translate(${S}px, ${b}px)`,l.style.opacity="1"})},[n]);return T.useLayoutEffect(()=>{if(!e)return;let o;const l=()=>{const f=t.current,u=r.current;f&&u?i():o=requestAnimationFrame(l)};o=requestAnimationFrame(l);const c=new MutationObserver(()=>{i()});return r.current&&c.observe(r.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:r,anchorWidth:s}}const Le=(n,e,t)=>{if(n==""&&(e==""||e==null))return"";if(t)switch(t){case"CodeOnly":return n;case"DescOnly":return e||"";case"Both":return`${n} - ${e}`}return n},Dn=({helperText:n,disabled:e,state:t,id:r})=>{const s={container:`smp-helper-text ${e?"smp-helper-text-disabled":""} ${t?`smp-helper-text-${t}`:""}`};return m.jsx("label",{className:s.container,id:r,children:n})},de={"smp-textfield-wrapper":"_smp-textfield-wrapper_ep1c3_4","smp-textfield":"_smp-textfield_ep1c3_4","smp-textfield-variant-notSelectable":"_smp-textfield-variant-notSelectable_ep1c3_29","smp-textfield-extraSmall":"_smp-textfield-extraSmall_ep1c3_35","smp-textfield-small":"_smp-textfield-small_ep1c3_40","smp-textfield-medium":"_smp-textfield-medium_ep1c3_45","smp-textfield-large":"_smp-textfield-large_ep1c3_50","smp-textfield-extraLarge":"_smp-textfield-extraLarge_ep1c3_55","smp-textfield-input":"_smp-textfield-input_ep1c3_61","smp-textfield-outlined":"_smp-textfield-outlined_ep1c3_84","smp-textfield-danger":"_smp-textfield-danger_ep1c3_95","smp-textfield-readOnly":"_smp-textfield-readOnly_ep1c3_99","smp-textfield-disabled":"_smp-textfield-disabled_ep1c3_114","smp-textfield-fullWidth":"_smp-textfield-fullWidth_ep1c3_123","smp-textfield-top-right-indicator":"_smp-textfield-top-right-indicator_ep1c3_127"},ve=({disabled:n,bindValue:e,icon:t,placeholder:r,isEditable:s=!0,shapeIcon:a,sizing:i,state:o,variant:l,tooltip:c=!1,rotatedShapeIcon:f=!1,ref:u,inputRef:d,inputType:g="text",ariaLabel:p="input field",label:b,helperText:S=!1,error:R,appearance:E="base",fullWidth:C=!1,_dataComponent:x="textfield",min:v,max:$,step:w,inputMode:D="text",width:P,autocomplete:O,size:A,maxLength:L,onBlur:M,onChange:N,onKeyDown:H,onShapeIconClick:G,onClick:z})=>{const Z=T.useId(),V=`${Z}-helper`,h=R?"danger":o,y=S||!!R,_=I=>{N?.(I.target.value)},k={wrapper:`${de["smp-textfield-wrapper"]} ${C?de["smp-textfield-fullWidth"]:""}`,container:`${de["smp-textfield"]} ${n?de["smp-textfield-disabled"]:""} ${r?de["smp-textfield-placeholder"]:""} ${i?de[`smp-textfield-${i}`]:""} ${h?de[`smp-textfield-${h}`]:""} ${E?de[`smp-textfield-${E}`]:""} ${s?"":de["smp-textfield-readOnly"]} ${c?de["smp-textfield-top-right-indicator"]:""}`,input:`${de["smp-textfield-input"]}`};if(l&&(l!=="notSelectable"||s)){const I=de[`smp-textfield-variant-${l}`];I&&(k.container+=` ${I}`)}const j=P?{"--smp-textField-width-base":P}:void 0;return m.jsxs("div",{className:k.wrapper,"data-component":x,children:[b&&m.jsx(Te,{label:b,disabled:n,htmlFor:Z}),m.jsxs("div",{className:k.container,ref:u,style:j,children:[t&&m.jsx(ie,{icon:t,disabled:n}),m.jsx("input",{id:Z,type:g,value:e,placeholder:r,onChange:_,onBlur:M,className:k.input,disabled:n,readOnly:!s,onKeyDown:H,"aria-label":p,ref:d,"aria-describedby":y?V:void 0,min:v,max:$,step:w,inputMode:D,autoComplete:O,size:A,maxLength:L,onClick:z}),a&&m.jsx(ie,{icon:a,disabled:n,onClick:G,rotated:f,isInteractable:s,tabIndex:0})]}),y&&m.jsx(Dn,{helperText:R,disabled:n,state:h,id:V})]})};function jn({items:n,itemHeight:e,containerHeight:t,overscan:r=5}){const[s,a]=T.useState(0),i=T.useRef(null),o=n.length*e,l=Math.max(0,Math.floor(s/e)-r),c=Math.min(n.length-1,Math.floor((s+t)/e)+r),f=[];for(let g=l;g<=c;g++)f.push({item:n[g],index:g,offsetTop:g*e});const u=T.useCallback(g=>{const p=g.target.scrollTop;a(p)},[]),d=g=>{if(!i.current)return;const p=g*e,b=p+e,S=i.current,R=S.scrollTop,E=R+t;p<R?S.scrollTop=p:b>E&&(S.scrollTop=b-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:l,endIndex:c},scrollToIndex:d}}const Je={"smp-list":"_smp-list_6ni6l_1","smp-list-container":"_smp-list-container_6ni6l_12","smp-list-listItem":"_smp-list-listItem_6ni6l_17"};function Er(n,e,t="14px IBM Plex Sans, sans-serif",r=32){const a=document.createElement("canvas").getContext("2d");if(!a)return 200;a.font=t;let i=0;for(const o of n){const l=Le(o.id,o.label,e),c=a.measureText(l);i=Math.max(i,c.width)}return Math.ceil(i+r)}const Cr=10,kn=({id:n,options:e,displayMode:t="Both",ref:r,showFilter:s,selectedIndex:a=null,activeIndex:i=[],width:o,onClick:l,onKeyDown:c,isOpen:f})=>{const[u,d]=T.useState(""),g=40,[p,b]=T.useState(a!==null?a:-1),[S,R]=T.useState(o||200),E=T.useRef(null),C=s!==void 0?s:e.length>Cr,x=u?e.filter(N=>N.label.toLowerCase().includes(u.toLowerCase())):e,v=N=>{d(N)},{virtualItems:$,containerProps:w,innerProps:D,scrollToIndex:P}=jn({items:x,itemHeight:g,containerHeight:200,overscan:5});T.useEffect(()=>{a!==null&&a!==p&&b(a)},[a]),T.useEffect(()=>{p>=0&&p<x.length&&P(p)},[p,x]),T.useEffect(()=>{f&&E?.current&&E.current.focus()},[f,E]),T.useEffect(()=>{const N=Er(e,t);R(N)},[e,t]);const O=N=>{if(N.key==="ArrowDown"||N.key==="ArrowUp"){N.preventDefault();let H=p;N.key==="ArrowDown"?H=p<x.length-1?p+1:0:N.key==="ArrowUp"&&(H=p>0?p-1:x.length-1),b(H)}else N.key==="Enter"?p>=0&&p<x.length&&l?.(x[p]):N.key==="Escape"&&(N.preventDefault(),N.stopPropagation());c&&c(N)},A=N=>{O(N)},L=N=>{O(N)},M={wrapper:`${Je["smp-list"]}`,container:`${Je["smp-list-container"]}`,virtualScroll:`${Je["smp-list-virtualScroll"]}`,listItem:`${Je["smp-list-listItem"]}`};return m.jsxs("div",{id:n,ref:r,className:M.wrapper,"data-component":"list",style:{width:S,minWidth:o},children:[C&&m.jsx(ve,{bindValue:u,placeholder:"Search...",fullWidth:!0,onChange:v,onKeyDown:A,inputRef:E}),m.jsx("div",{...w,className:M.container,tabIndex:0,role:"listbox","aria-label":"List",onKeyDown:L,"aria-activedescendant":p>=0&&p<x.length?x[p]?.id:void 0,children:m.jsx("div",{...D,className:M.virtualScroll,children:$.map(({item:N,index:H,offsetTop:G})=>{const z=i.includes(N.id);return m.jsxs("li",{role:"option",id:N.id,"aria-selected":p===H?"true":"false",tabIndex:-1,className:`${M.listItem} ${p===H?"selected-item":""}`,"aria-label":N.id+"-"+N.label,style:{height:`${g}px`,lineHeight:`calc(${g}px - 2*2px)`,transform:`translateY(${G}px)`},onClick:()=>{l?.(N),b(H)},children:[Le(N.id,N.label,t),z&&m.jsx(ie,{icon:"check",width:16})]},N.id)})})})]})},Dt=({displayMode:n,bindValue:e,optionalDisplayValue:t,...r})=>{const[s,a]=T.useState(Le(e,t,n));return T.useEffect(()=>{a(e)},[e]),T.useEffect(()=>{a(Le(e,t,n))},[t,n]),m.jsx(ve,{...r,bindValue:s})},Tr=n=>{const e=T.useRef(null);return T.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),r=>{e.current&&clearTimeout(e.current),e.current=setTimeout(()=>{r()},n)}};function ct({children:n}){const[e,t]=T.useState(!1);return T.useEffect(()=>{t(!0)},[]),e?Yn.createPortal(n,document.body):null}const ut=(n,e,t)=>{T.useEffect(()=>{if(!e)return;const r=s=>{n?.some(i=>{if(typeof i=="object"&&i!==null&&"current"in i){const o=i?.current;return o&&o.contains(s.target)}})||t()};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[n,t,e])},q=n=>typeof n=="string",Ne=()=>{let n,e;const t=new Promise((r,s)=>{n=r,e=s});return t.resolve=n,t.reject=e,t},sn=n=>n==null?"":""+n,Or=(n,e,t)=>{n.forEach(r=>{e[r]&&(t[r]=e[r])})},Rr=/###/g,an=n=>n&&n.indexOf("###")>-1?n.replace(Rr,"."):n,on=n=>!n||q(n),Fe=(n,e,t)=>{const r=q(e)?e.split("."):e;let s=0;for(;s<r.length-1;){if(on(n))return{};const a=an(r[s]);!n[a]&&t&&(n[a]=new t),Object.prototype.hasOwnProperty.call(n,a)?n=n[a]:n={},++s}return on(n)?{}:{obj:n,k:an(r[s])}},ln=(n,e,t)=>{const{obj:r,k:s}=Fe(n,e,Object);if(r!==void 0||e.length===1){r[s]=t;return}let a=e[e.length-1],i=e.slice(0,e.length-1),o=Fe(n,i,Object);for(;o.obj===void 0&&i.length;)a=`${i[i.length-1]}.${a}`,i=i.slice(0,i.length-1),o=Fe(n,i,Object),o?.obj&&typeof o.obj[`${o.k}.${a}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${a}`]=t},_r=(n,e,t,r)=>{const{obj:s,k:a}=Fe(n,e,Object);s[a]=s[a]||[],s[a].push(t)},st=(n,e)=>{const{obj:t,k:r}=Fe(n,e);if(t&&Object.prototype.hasOwnProperty.call(t,r))return t[r]},Dr=(n,e,t)=>{const r=st(n,t);return r!==void 0?r:st(e,t)},$n=(n,e,t)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in n?q(n[r])||n[r]instanceof String||q(e[r])||e[r]instanceof String?t&&(n[r]=e[r]):$n(n[r],e[r],t):n[r]=e[r]);return n},De=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var jr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const kr=n=>q(n)?n.replace(/[&<>"'\/]/g,e=>jr[e]):n;class $r{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 r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const Lr=[" ",",","?","!",";"],Pr=new $r(20),Ar=(n,e,t)=>{e=e||"",t=t||"";const r=Lr.filter(i=>e.indexOf(i)<0&&t.indexOf(i)<0);if(r.length===0)return!0;const s=Pr.getRegExp(`(${r.map(i=>i==="?"?"\\?":i).join("|")})`);let a=!s.test(n);if(!a){const i=n.indexOf(t);i>0&&!s.test(n.substring(0,i))&&(a=!0)}return a},Ct=(n,e,t=".")=>{if(!n)return;if(n[e])return Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0;const r=e.split(t);let s=n;for(let a=0;a<r.length;){if(!s||typeof s!="object")return;let i,o="";for(let l=a;l<r.length;++l)if(l!==a&&(o+=t),o+=r[l],i=s[o],i!==void 0){if(["string","number","boolean"].indexOf(typeof i)>-1&&l<r.length-1)continue;a+=l-a+1;break}s=i}return s},Ve=n=>n?.replace("_","-"),Ir={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,e){console?.[n]?.apply?.(console,e)}};class at{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Ir,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,r,s){return s&&!this.debug?null:(q(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new at(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new at(this.logger,e)}}var ge=new at;class ft{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(t)||0;this.observers[r].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 cn extends ft{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,r,s={}){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],r&&(Array.isArray(r)?o.push(...r):q(r)&&a?o.push(...r.split(a)):o.push(r)));const l=st(this.data,o);return!l&&!t&&!r&&e.indexOf(".")>-1&&(e=o[0],t=o[1],r=o.slice(2).join(".")),l||!i||!q(r)?l:Ct(this.data?.[e]?.[t],r,a)}addResource(e,t,r,s,a={silent:!1}){const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator;let o=[e,t];r&&(o=o.concat(i?r.split(i):r)),e.indexOf(".")>-1&&(o=e.split("."),s=t,t=o[1]),this.addNamespaces(t),ln(this.data,o,s),a.silent||this.emit("added",e,t,r,s)}addResources(e,t,r,s={silent:!1}){for(const a in r)(q(r[a])||Array.isArray(r[a]))&&this.addResource(e,t,a,r[a],{silent:!0});s.silent||this.emit("added",e,t,r)}addResourceBundle(e,t,r,s,a,i={silent:!1,skipCopy:!1}){let o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),s=r,r=t,t=o[1]),this.addNamespaces(t);let l=st(this.data,o)||{};i.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?$n(l,r,a):l={...l,...r},ln(this.data,o,l),i.silent||this.emit("added",e,t,r)}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 Ln={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,e,t,r,s){return n.forEach(a=>{e=this.processors[a]?.process(e,t,r,s)??e}),e}};const un={},fn=n=>!q(n)&&typeof n!="boolean"&&typeof n!="number";class ot extends ft{constructor(e,t={}){super(),Or(["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 r={...t};return e==null?!1:this.resolve(e,r)?.res!==void 0}extractFromKey(e,t){let r=t.nsSeparator!==void 0?t.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=t.keySeparator!==void 0?t.keySeparator:this.options.keySeparator;let a=t.ns||this.options.defaultNS||[];const i=r&&e.indexOf(r)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!Ar(e,r,s);if(i&&!o){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:q(a)?[a]:a};const c=e.split(r);(r!==s||r===s&&this.options.ns.indexOf(c[0])>-1)&&(a=c.shift()),e=c.join(s)}return{key:e,namespaces:q(a)?[a]:a}}translate(e,t,r){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:l}=this.extractFromKey(e[e.length-1],s),c=l[l.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?.toLowerCase()==="cimode")return d?a?{res:`${c}${f}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:`${c}${f}${o}`:a?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:o;const g=this.resolve(e,s);let p=g?.res;const b=g?.usedKey||o,S=g?.exactUsedKey||o,R=["[object Number]","[object Function]","[object RegExp]"],E=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,C=!this.i18nFormat||this.i18nFormat.handleAsObject,x=s.count!==void 0&&!q(s.count),v=ot.hasDefaultValue(s),$=x?this.pluralResolver.getSuffix(u,s.count,s):"",w=s.ordinal&&x?this.pluralResolver.getSuffix(u,s.count,{ordinal:!1}):"",D=x&&!s.ordinal&&s.count===0,P=D&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${$}`]||s[`defaultValue${w}`]||s.defaultValue;let O=p;C&&!p&&v&&(O=P);const A=fn(O),L=Object.prototype.toString.apply(O);if(C&&O&&A&&R.indexOf(L)<0&&!(q(E)&&Array.isArray(O))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const M=this.options.returnedObjectHandler?this.options.returnedObjectHandler(b,O,{...s,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(g.res=M,g.usedParams=this.getUsedParamsDetails(s),g):M}if(i){const M=Array.isArray(O),N=M?[]:{},H=M?S:b;for(const G in O)if(Object.prototype.hasOwnProperty.call(O,G)){const z=`${H}${i}${G}`;v&&!p?N[G]=this.translate(z,{...s,defaultValue:fn(P)?P[G]:void 0,joinArrays:!1,ns:l}):N[G]=this.translate(z,{...s,joinArrays:!1,ns:l}),N[G]===z&&(N[G]=O[G])}p=N}}else if(C&&q(E)&&Array.isArray(p))p=p.join(E),p&&(p=this.extendTranslation(p,e,s,r));else{let M=!1,N=!1;!this.isValidLookup(p)&&v&&(M=!0,p=P),this.isValidLookup(p)||(N=!0,p=o);const G=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&N?void 0:p,z=v&&P!==p&&this.options.updateMissing;if(N||M||z){if(this.logger.log(z?"updateKey":"missingKey",u,c,o,z?P:p),i){const y=this.resolve(o,{...s,keySeparator:!1});y&&y.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let Z=[];const V=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&V&&V[0])for(let y=0;y<V.length;y++)Z.push(V[y]);else this.options.saveMissingTo==="all"?Z=this.languageUtils.toResolveHierarchy(s.lng||this.language):Z.push(s.lng||this.language);const h=(y,_,k)=>{const j=v&&k!==p?k:G;this.options.missingKeyHandler?this.options.missingKeyHandler(y,c,_,j,z,s):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(y,c,_,j,z,s),this.emit("missingKey",y,c,_,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&x?Z.forEach(y=>{const _=this.pluralResolver.getSuffixes(y,s);D&&s[`defaultValue${this.options.pluralSeparator}zero`]&&_.indexOf(`${this.options.pluralSeparator}zero`)<0&&_.push(`${this.options.pluralSeparator}zero`),_.forEach(k=>{h([y],o+k,s[`defaultValue${k}`]||P)})}):h(Z,o,P))}p=this.extendTranslation(p,e,s,g,r),N&&p===o&&this.options.appendNamespaceToMissingKey&&(p=`${c}${f}${o}`),(N||M)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}${f}${o}`:o,M?p:void 0,s))}return a?(g.res=p,g.usedParams=this.getUsedParamsDetails(s),g):p}extendTranslation(e,t,r,s,a){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const l=q(e)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(l){const u=e.match(this.interpolator.nestingRegexp);c=u&&u.length}let f=r.replace&&!q(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),e=this.interpolator.interpolate(e,f,r.lng||this.language||s.usedLng,r),l){const u=e.match(this.interpolator.nestingRegexp),d=u&&u.length;c<d&&(r.nest=!1)}!r.lng&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,(...u)=>a?.[0]===u[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${u[0]} in key: ${t[0]}`),null):this.translate(...u,t),r)),r.interpolation&&this.interpolator.reset()}const i=r.postProcess||this.options.postProcess,o=q(i)?[i]:i;return e!=null&&o?.length&&r.applyPostProcessor!==!1&&(e=Ln.handle(o,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,t={}){let r,s,a,i,o;return q(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(r))return;const c=this.extractFromKey(l,t),f=c.key;s=f;let u=c.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const d=t.count!==void 0&&!q(t.count),g=d&&!t.ordinal&&t.count===0,p=t.context!==void 0&&(q(t.context)||typeof t.context=="number")&&t.context!=="",b=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);u.forEach(S=>{this.isValidLookup(r)||(o=S,!un[`${b[0]}-${S}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(un[`${b[0]}-${S}`]=!0,this.logger.warn(`key "${s}" for languages "${b.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!!!")),b.forEach(R=>{if(this.isValidLookup(r))return;i=R;const E=[f];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(E,f,R,S,t);else{let x;d&&(x=this.pluralResolver.getSuffix(R,t.count,t));const v=`${this.options.pluralSeparator}zero`,$=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(d&&(E.push(f+x),t.ordinal&&x.indexOf($)===0&&E.push(f+x.replace($,this.options.pluralSeparator)),g&&E.push(f+v)),p){const w=`${f}${this.options.contextSeparator}${t.context}`;E.push(w),d&&(E.push(w+x),t.ordinal&&x.indexOf($)===0&&E.push(w+x.replace($,this.options.pluralSeparator)),g&&E.push(w+v))}}let C;for(;C=E.pop();)this.isValidLookup(r)||(a=C,r=this.getResource(R,S,C,t))}))})}),{res:r,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,r,s={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,t,r,s):this.resourceStore.getResource(e,t,r,s)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!q(e.replace);let s=r?e.replace:e;if(r&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const a of t)delete s[a]}return s}static hasDefaultValue(e){const t="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t===r.substring(0,t.length)&&e[r]!==void 0)return!0;return!1}}class dn{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ge.create("languageUtils")}getScriptPartFromCode(e){if(e=Ve(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=Ve(e),!e||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(q(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch{}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(r=>{if(t)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(t=s)}),!t&&this.options.supportedLngs&&e.forEach(r=>{if(t)return;const s=this.getScriptPartFromCode(r);if(this.isSupportedCode(s))return t=s;const a=this.getLanguagePartFromCode(r);if(this.isSupportedCode(a))return t=a;t=this.options.supportedLngs.find(i=>{if(i===a)return i;if(!(i.indexOf("-")<0&&a.indexOf("-")<0)&&(i.indexOf("-")>0&&a.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===a||i.indexOf(a)===0&&a.length>1))return i})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if(typeof e=="function"&&(e=e(t)),q(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let r=e[t];return r||(r=e[this.getScriptPartFromCode(t)]),r||(r=e[this.formatLanguageCode(t)]),r||(r=e[this.getLanguagePartFromCode(t)]),r||(r=e.default),r||[]}toResolveHierarchy(e,t){const r=this.getFallbackCodes((t===!1?[]:t)||this.options.fallbackLng||[],e),s=[],a=i=>{i&&(this.isSupportedCode(i)?s.push(i):this.logger.warn(`rejecting language code not found in supportedLngs: ${i}`))};return q(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(e))):q(e)&&a(this.formatLanguageCode(e)),r.forEach(i=>{s.indexOf(i)<0&&a(this.formatLanguageCode(i))}),s}}const pn={zero:0,one:1,two:2,few:3,many:4,other:5},hn={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Nr{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 r=Ve(e==="dev"?"en":e),s=t.ordinal?"ordinal":"cardinal",a=JSON.stringify({cleanedCode:r,type:s});if(a in this.pluralRulesCache)return this.pluralRulesCache[a];let i;try{i=new Intl.PluralRules(r,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),hn;if(!e.match(/-|_/))return hn;const l=this.languageUtils.getLanguagePartFromCode(e);i=this.getRule(l,t)}return this.pluralRulesCache[a]=i,i}needsPlural(e,t={}){let r=this.getRule(e,t);return r||(r=this.getRule("dev",t)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,t,r={}){return this.getSuffixes(e,r).map(s=>`${t}${s}`)}getSuffixes(e,t={}){let r=this.getRule(e,t);return r||(r=this.getRule("dev",t)),r?r.resolvedOptions().pluralCategories.sort((s,a)=>pn[s]-pn[a]).map(s=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,t,r={}){const s=this.getRule(e,r);return s?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,r))}}const mn=(n,e,t,r=".",s=!0)=>{let a=Dr(n,e,t);return!a&&s&&q(t)&&(a=Ct(n,t,r),a===void 0&&(a=Ct(e,t,r))),a},xt=n=>n.replace(/\$/g,"$$$$");class Mr{constructor(e={}){this.logger=ge.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(t=>t),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:r,useRawValueToEscape:s,prefix:a,prefixEscaped:i,suffix:o,suffixEscaped:l,formatSeparator:c,unescapeSuffix:f,unescapePrefix:u,nestingPrefix:d,nestingPrefixEscaped:g,nestingSuffix:p,nestingSuffixEscaped:b,nestingOptionsSeparator:S,maxReplaces:R,alwaysFormat:E}=e.interpolation;this.escape=t!==void 0?t:kr,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=a?De(a):i||"{{",this.suffix=o?De(o):l||"}}",this.formatSeparator=c||",",this.unescapePrefix=f?"":u||"-",this.unescapeSuffix=this.unescapePrefix?"":f||"",this.nestingPrefix=d?De(d):g||De("$t("),this.nestingSuffix=p?De(p):b||De(")"),this.nestingOptionsSeparator=S||",",this.maxReplaces=R||1e3,this.alwaysFormat=E!==void 0?E:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(t,r)=>t?.source===r?(t.lastIndex=0,t):new RegExp(r,"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,r,s){let a,i,o;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},c=g=>{if(g.indexOf(this.formatSeparator)<0){const R=mn(t,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(R,void 0,r,{...s,...t,interpolationkey:g}):R}const p=g.split(this.formatSeparator),b=p.shift().trim(),S=p.join(this.formatSeparator).trim();return this.format(mn(t,l,b,this.options.keySeparator,this.options.ignoreJSONStructure),S,r,{...s,...t,interpolationkey:b})};this.resetRegExp();const f=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,u=s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>xt(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?xt(this.escape(g)):xt(g)}].forEach(g=>{for(o=0;a=g.regex.exec(e);){const p=a[1].trim();if(i=c(p),i===void 0)if(typeof f=="function"){const S=f(e,a,s);i=q(S)?S:""}else if(s&&Object.prototype.hasOwnProperty.call(s,p))i="";else if(u){i=a[0];continue}else this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`),i="";else!q(i)&&!this.useRawValueToEscape&&(i=sn(i));const b=g.safeValue(i);if(e=e.replace(a[0],b),u?(g.regex.lastIndex+=i.length,g.regex.lastIndex-=a[0].length):g.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,t,r={}){let s,a,i;const o=(l,c)=>{const f=this.nestingOptionsSeparator;if(l.indexOf(f)<0)return l;const u=l.split(new RegExp(`${f}[ ]*{`));let d=`{${u[1]}`;l=u[0],d=this.interpolate(d,i);const g=d.match(/'/g),p=d.match(/"/g);((g?.length??0)%2===0&&!p||p.length%2!==0)&&(d=d.replace(/'/g,'"'));try{i=JSON.parse(d),c&&(i={...c,...i})}catch(b){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,b),`${l}${f}${d}`}return i.defaultValue&&i.defaultValue.indexOf(this.prefix)>-1&&delete i.defaultValue,l};for(;s=this.nestingRegexp.exec(e);){let l=[];i={...r},i=i.replace&&!q(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(u=>u.trim());s[1]=f.shift(),l=f,c=!0}if(a=t(o.call(this,s[1].trim(),i),i),a&&s[0]===e&&!q(a))return a;q(a)||(a=sn(a)),a||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),a=""),c&&(a=l.reduce((f,u)=>this.format(f,u,r.lng,{...r,interpolationkey:s[1].trim()}),a.trim())),e=e.replace(s[0],a),this.regexp.lastIndex=0}return e}}const Fr=n=>{let e=n.toLowerCase().trim();const t={};if(n.indexOf("(")>-1){const r=n.split("(");e=r[0].toLowerCase().trim();const s=r[1].substring(0,r[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,...l]=i.split(":"),c=l.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}},gn=n=>{const e={};return(t,r,s)=>{let a=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(a={...a,[s.interpolationkey]:void 0});const i=r+JSON.stringify(a);let o=e[i];return o||(o=n(Ve(r),s),e[i]=o),o(t)}},Vr=n=>(e,t,r)=>n(Ve(t),r)(e);class Yr{constructor(e={}){this.logger=ge.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const r=t.cacheInBuiltFormats?gn:Vr;this.formats={number:r((s,a)=>{const i=new Intl.NumberFormat(s,{...a});return o=>i.format(o)}),currency:r((s,a)=>{const i=new Intl.NumberFormat(s,{...a,style:"currency"});return o=>i.format(o)}),datetime:r((s,a)=>{const i=new Intl.DateTimeFormat(s,{...a});return o=>i.format(o)}),relativetime:r((s,a)=>{const i=new Intl.RelativeTimeFormat(s,{...a});return o=>i.format(o,a.range||"day")}),list:r((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()]=gn(t)}format(e,t,r,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(l=>l.indexOf(")")>-1);a[0]=[a[0],...a.splice(1,o)].join(this.formatSeparator)}return a.reduce((o,l)=>{const{formatName:c,formatOptions:f}=Fr(l);if(this.formats[c]){let u=o;try{const d=s?.formatParams?.[s.interpolationkey]||{},g=d.locale||d.lng||s.locale||s.lng||r;u=this.formats[c](o,g,{...f,...s,...d})}catch(d){this.logger.warn(d)}return u}else this.logger.warn(`there was no format function for ${c}`);return o},e)}}const Ur=(n,e)=>{n.pending[e]!==void 0&&(delete n.pending[e],n.pendingCount--)};class Wr extends ft{constructor(e,t,r,s={}){super(),this.backend=e,this.store=t,this.services=r,this.languageUtils=r.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=[],this.backend?.init?.(r,s.backend,s)}queueLoad(e,t,r,s){const a={},i={},o={},l={};return e.forEach(c=>{let f=!0;t.forEach(u=>{const d=`${c}|${u}`;!r.reload&&this.store.hasResourceBundle(c,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),l[u]===void 0&&(l[u]=!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(l)}}loaded(e,t,r){const s=e.split("|"),a=s[0],i=s[1];t&&this.emit("failedLoading",a,i,t),!t&&r&&this.store.addResourceBundle(a,i,r,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&r&&(this.state[e]=0);const o={};this.queue.forEach(l=>{_r(l.loaded,[a],i),Ur(l,e),t&&l.errors.push(t),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(c=>{o[c]||(o[c]={});const f=l.loaded[c];f.length&&f.forEach(u=>{o[c][u]===void 0&&(o[c][u]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(l=>!l.done)}read(e,t,r,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:r,tried:s,wait:a,callback:i});return}this.readingCalls++;const o=(c,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(c&&f&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,r,s+1,a*2,i)},a);return}i(c,f)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const c=l(e,t);c&&typeof c.then=="function"?c.then(f=>o(null,f)).catch(o):o(null,c)}catch(c){o(c)}return}return l(e,t,o)}prepareLoading(e,t,r={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();q(e)&&(e=this.languageUtils.toResolveHierarchy(e)),q(t)&&(t=[t]);const a=this.queueLoad(e,t,r,s);if(!a.toLoad.length)return a.pending.length||s(),null;a.toLoad.forEach(i=>{this.loadOne(i)})}load(e,t,r){this.prepareLoading(e,t,{},r)}reload(e,t,r){this.prepareLoading(e,t,{reload:!0},r)}loadOne(e,t=""){const r=e.split("|"),s=r[0],a=r[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,r,s,a,i={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${r}" 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(!(r==null||r==="")){if(this.backend?.create){const l={...i,isUpdate:a},c=this.backend.create.bind(this.backend);if(c.length<6)try{let f;c.length===5?f=c(e,t,r,s,l):f=c(e,t,r,s),f&&typeof f.then=="function"?f.then(u=>o(null,u)).catch(o):o(null,f)}catch(f){o(f)}else c(e,t,r,s,o,l)}!e||!e[0]||this.store.addResource(e[0],t,r,s)}}}const yn=()=>({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:n=>{let e={};if(typeof n[1]=="object"&&(e=n[1]),q(n[1])&&(e.defaultValue=n[1]),q(n[2])&&(e.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const t=n[3]||n[2];Object.keys(t).forEach(r=>{e[r]=t[r]})}return e},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),bn=n=>(q(n.ns)&&(n.ns=[n.ns]),q(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),q(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs?.indexOf?.("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),typeof n.initImmediate=="boolean"&&(n.initAsync=n.initImmediate),n),Xe=()=>{},Br=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(t=>{typeof n[t]=="function"&&(n[t]=n[t].bind(n))})};class Ye extends ft{constructor(e={},t){if(super(),this.options=bn(e),this.services={},this.logger=ge,this.modules={external:[]},Br(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,typeof e=="function"&&(t=e,e={}),e.defaultNS==null&&e.ns&&(q(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const r=yn();this.options={...r,...this.options,...bn(e)},this.options.interpolation={...r.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=Yr;const f=new dn(this.options);this.store=new cn(this.options.resources,this.options);const u=this.services;u.logger=ge,u.resourceStore=this.store,u.languageUtils=f,u.pluralResolver=new Nr(f,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(u.formatter=s(c),u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new Mr(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new Wr(s(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",(d,...g)=>{this.emit(d,...g)}),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 ot(this.services,this.options),this.translator.on("*",(d,...g)=>{this.emit(d,...g)}),this.modules.external.forEach(d=>{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,t||(t=Xe),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=Ne(),l=()=>{const c=(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 c(null,this.t.bind(this));this.changeLanguage(this.options.lng,c)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),o}loadResources(e,t=Xe){let r=t;const s=q(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(s?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const a=[],i=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(c=>{c!=="cimode"&&a.indexOf(c)<0&&a.push(c)})};s?i(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>i(l)),this.options.preload?.forEach?.(o=>i(o)),this.services.backendConnector.load(a,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(o)})}else r(null)}reloadResources(e,t,r){const s=Ne();return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),r||(r=Xe),this.services.backendConnector.reload(e,t,a=>{s.resolve(),r(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"&&Ln.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 r=this.languages[t];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;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 r=Ne();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,l)=>{l?this.isLanguageChangingTo===e&&(s(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,r.resolve((...c)=>this.t(...c)),t&&t(o,(...c)=>this.t(...c))},i=o=>{!e&&!o&&this.services.languageDetector&&(o=[]);const l=q(o)?o:o&&o[0],c=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(q(o)?[o]:o);c&&(this.language||s(c),this.translator.language||this.translator.changeLanguage(c),this.services.languageDetector?.cacheUserLanguage?.(c)),this.loadResources(c,f=>{a(f,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),r}getFixedT(e,t,r){const s=(a,i,...o)=>{let l;typeof i!="object"?l=this.options.overloadTranslationOptionHandler([a,i].concat(o)):l={...i},l.lng=l.lng||s.lng,l.lngs=l.lngs||s.lngs,l.ns=l.ns||s.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||s.keyPrefix);const c=this.options.keySeparator||".";let f;return l.keyPrefix&&Array.isArray(a)?f=a.map(u=>`${l.keyPrefix}${c}${u}`):f=l.keyPrefix?`${l.keyPrefix}${c}${a}`:a,this.t(f,l)};return q(e)?s.lng=e:s.lngs=e,s.ns=t,s.keyPrefix=r,s}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.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 r=t.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,a=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const i=(o,l)=>{const c=this.services.backendConnector.state[`${o}|${l}`];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(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||i(r,e)&&(!s||i(a,e)))}loadNamespaces(e,t){const r=Ne();return this.options.ns?(q(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),t&&t(s)}),r):(t&&t(),Promise.resolve())}loadLanguages(e,t){const r=Ne();q(e)&&(e=[e]);const s=this.options.preload||[],a=e.filter(i=>s.indexOf(i)<0&&this.services.languageUtils.isSupportedCode(i));return a.length?(this.options.preload=s.concat(a),this.loadResources(i=>{r.resolve(),t&&t(i)}),r):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.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"],r=this.services?.languageUtils||new dn(yn());return t.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){return new Ye(e,t)}cloneInstance(e={},t=Xe){const r=e.forkResourceStore;r&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},a=new Ye(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)},r){const o=Object.keys(this.store.data).reduce((l,c)=>(l[c]={...this.store.data[c]},l[c]=Object.keys(l[c]).reduce((f,u)=>(f[u]={...l[c][u]},f),l[c]),l),{});a.store=new cn(o,s),a.services.resourceStore=a.store}return a.translator=new ot(a.services,s),a.translator.on("*",(o,...l)=>{a.emit(o,...l)}),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=Ye.createInstance();ae.createInstance=Ye.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 Hr={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"},Gr={April:"Aprile",August:"Agosto",December:"Dicembre",February:"Febbraio",January:"Gennaio",June:"Giugno",July:"Luglio",March:"Marzo",May:"Maggio",October:"Ottobre",November:"Novembre",September:"Settembre"},Kr={CalendarFor:"Calendario per",Close:"Chiudi",SpotlightDefaultPlaceholder:"Esegui Comando",CheckObjectWrongValidation:"Oggetto non valido",ConfirmButton:"Conferma",AutocompleteDefaultPlaceholder:"Inserisci codice o descrizione"},qr={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:Hr,Month:Gr,Generic:Kr},zr={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"},Jr={April:"April",August:"August",December:"December",February:"February",January:"January",July:"July",June:"June",March:"March",May:"May",November:"November",October:"October",September:"September"},Xr={CalendarFor:"Calendar for",Close:"Close",SpotlightDefaultPlaceholder:"Execute Command",CheckObjectWrongValidation:"Object not valid",ConfirmButton:"Confirm",AutocompleteDefaultPlaceholder:"Type code or description"},Zr={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:zr,Month:Jr,Generic:Xr};function vn(n,e){return new RegExp(Qr(n),e)}function Qr(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const es=(n,e,t)=>{let r=n;return isNaN(r)||(e!=null&&(r=Math.max(r,e)),t!=null&&(r=Math.min(r,t))),r},ts=(n,e)=>{const r=Intl.NumberFormat(n).formatToParts(1000.1),s=r.find(i=>i.type==="group")?.value??",",a=e??r.find(i=>i.type==="decimal")?.value??".";return{groupingChar:s,decimalChar:a}};function ns(n,e,t,r){let s=e;const a=as(n,t);if(!s){const o=Math.abs(a);o-Math.floor(o)?s="0,0.00":s="0,0"}const i=os(s);return new Intl.NumberFormat(r,i).format(a)}const rs=(n,e,t)=>{const r=n.lastIndexOf(t);if(r!==-1)return n.length-r-1;const s=t==="."?",":".",a=n.lastIndexOf(s);return a!==-1&&!(s===e&&n.length-a-1===3)?n.length-a-1:0},ss=(n,e,t)=>{if(!n)return NaN;let r=n.replace(/\s/g,""),s=t;const a=(r.match(/\./g)||[]).length,i=(r.match(/,/g)||[]).length;if(a&&i)s=r.lastIndexOf(".")>r.lastIndexOf(",")?".":",";else if(!r.includes(t)){const l=r.includes(".")?".":",",c=l==="."?a:i;c>1||c===1&&l===e&&r.length-r.lastIndexOf(l)-1===3||(s=l)}const o=s==="."?",":".";return r=r.replace(new RegExp(`\\${o}`,"g"),""),s!=="."&&(r=r.replace(new RegExp(`\\${s}`,"g"),".")),parseFloat(r)};function as(n,e,t,r,s){let a=n;if(typeof a!="number"){let o;e&&r===void 0?o=",":o=".";const l=o=="."?",":".";a=a.replace(vn(l,"g"),""),a=a.replace(vn(o,"g"),"."),a=Number(a)}const i=Number(a);return isNaN(i)?NaN:i}function os(n){const e={};n.includes(",")?e.useGrouping=!0:e.useGrouping=!1;const t=n.indexOf(".");if(t>-1){const s=(n.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:(n,e,t,r)=>{const s=r?.type??"number";try{switch(s){case"date":{const a=n instanceof Date?n:new Date(n);return new Intl.DateTimeFormat(t,{dateStyle:e||"short"}).format(a)}default:case"number":{const a=r?.inputIsLocalized??!1;return ns(n,e,a,t)}}}catch{return n}}},resources:{en:{translation:Zr},it:{translation:qr}}});const is=(n,e,t,r)=>ae.format(n,e,t||ae.language,r),ls=(n,e)=>ae.t(n,e);function Oe(){const n=T.useCallback((r,s,a,i)=>is(r,s,a||void 0,i),[]),e=T.useCallback(()=>ae.languages[0],[]),t=T.useCallback((r,s)=>ls(r,s),[]);return{format:n,getCurrentLanguage:e,translate:t}}var Se=(n=>(n.CALENDAR_FOR="Date.CalendarFor",n.CLOSE="Generic.Close",n.SPOTLIGHT_DEFAULT_PLACEHOLDER="Generic.SpotlightDefaultPlaceholder",n.CHECK_OBJECT_WRONG_VALIDATION="Generic.CheckObjectWrongValidation",n.CONFIRM_BUTTON="Generic.ConfirmButton",n.AUTOCOMPLETE_DEFAULT_PLACEHOLDER="Generic.AutocompleteDefaultPlaceholder",n))(Se||{}),le=(n=>(n.MONDAY="Day.Monday",n.MONDAY_SHORT="Day.MondayShort",n.TUESDAY="Day.Tuesday",n.TUESDAY_SHORT="Day.TuesdayShort",n.WEDNESDAY="Day.Wednesday",n.WEDNESDAY_SHORT="Day.WednesdayShort",n.THURSDAY="Day.Thursday",n.THURSDAY_SHORT="Day.ThursdayShort",n.FRIDAY="Day.Friday",n.FRIDAY_SHORT="Day.FridayShort",n.SATURDAY="Day.Saturday",n.SATURDAY_SHORT="Day.SaturdayShort",n.SUNDAY="Day.Sunday",n.SUNDAY_SHORT="Day.SundayShort",n))(le||{}),ue=(n=>(n.JANUARY="Month.January",n.FEBRUARY="Month.February",n.MARCH="Month.March",n.APRIL="Month.April",n.MAY="Month.May",n.JUNE="Month.June",n.JULY="Month.July",n.AUGUST="Month.August",n.SEPTEMBER="Month.September",n.OCTOBER="Month.October",n.NOVEMBER="Month.November",n.DECEMBER="Month.December",n))(ue||{}),Tt=(n=>(n.PREVIOUS_DAY="Date.PreviousDay",n.PREVIOUS_WEEK="Date.PreviousWeek",n.PREVIOUS_MONTH="Date.PreviousMonth",n.PREVIOUS_YEAR="Date.PreviousYear",n.NEXT_DAY="Date.NextDay",n.NEXT_WEEK="Date.NextWeek",n.NEXT_MONTH="Date.NextMonth",n.NEXT_YEAR="Date.NextYear",n.YESTERDAY="Date.Yesterday",n.TODAY="Date.Today",n.TOMORROW="Date.Tomorrow",n))(Tt||{});const jt=({bindValue:n,optionalDisplayValue:e,options:t,displayMode:r,listDisplayMode:s="Both",minimumChars:a=3,isEditable:i=!0,fun:o,_changeOnEnter:l=!1,onChange:c,onOptionsRequest:f,onBlur:u,_multiActiveIndex:d,...g})=>{const p=T.useRef(null),[b,S]=T.useState(n),[R,E]=T.useState(e),{translate:C}=Oe(),[x,v]=T.useState(!1),[$,w]=T.useState(t||[]),[D,P]=T.useState(0),[O,A]=T.useState([n]),{anchorRef:L,targetRef:M,anchorWidth:N}=lt({position:"bottom",enabled:x}),H=T.useCallback(()=>{v(!1),p?.current?.focus()},[]);ut([M],x,()=>H());const G=Tr(400),z=_=>{_.length>=a?o&&f&&G(async()=>{const k=await f(o,_);w(k),P(k.length>0?0:-1),v(!0)}):H(),S(_),E(e),l||c?.(_,e)},Z=()=>{x||u?.()},V=_=>{l?(S(""),E("")):(S(_.id),E(_.label)),c?.(_.id,_.label);const k=$.findIndex(j=>j.id===_.id);P(k),A([_.id]),H()},h=_=>{_.key==="Escape"&&(H(),P(-1))},y=_=>{if((_.key==="ArrowDown"||_.key==="ArrowUp")&&(_.preventDefault(),x)){const k=_.key==="ArrowDown"?(D+1)%$.length:(D-1+$.length)%$.length;P(k)}switch(_.key){case"Enter":D>=0&&D<$.length?V($[D]):l&&(c?.(b,""),H(),S(""),E(""));break;case"Escape":H(),P(-1);break}};return m.jsxs("div",{"data-component":"autocomplete",children:[m.jsx(Dt,{...g,bindValue:b,optionalDisplayValue:R,displayMode:r,isEditable:i,shapeIcon:"magnify",placeholder:C(Se.AUTOCOMPLETE_DEFAULT_PLACEHOLDER),ref:L,inputRef:p,onChange:z,onKeyDown:y,onBlur:Z,"aria-autocomplete":"list"}),x&&m.jsx(ct,{children:m.jsx(kn,{options:$,displayMode:s,onClick:V,ref:M,selectedIndex:D,activeIndex:d||O,width:N,showFilter:!1,onKeyDown:h,isOpen:x})})]})},Pn=({options:n,fun:e,direction:t="row",disposition:r="start",sizing:s,variant:a,appearance:i,showText:o,showIcon:l,fullWidth:c,disabled:f,justify:u,squared:d,onClick:g,onOptionsRequest:p})=>{const[b,S]=T.useState(n);T.useEffect(()=>{!b&&p&&e&&p(e,void 0).then(C=>S(C)).catch(C=>{console.error("Errore nel caricamento delle opzioni per ButtonList",C)})},[b,e,p]);const R={container:`smp-button-list smp-button-list-${t} smp-justifyContent-${r}`},E=b?.map((C,x)=>{const v={bindValue:C.id,optionalDisplayValue:C.label,fun:C.fun,icon:C.icon,variant:a,appearance:i,showText:o,showIcon:l,fullWidth:c,disabled:f,sizing:s,justify:u,squared:d,onClick:()=>{g?.(C.id,C.fun)}};return m.jsx(be,{...v},`button-${x}`)});return m.jsx("div",{role:"list","data-component":"button-list",className:R.container,children:E})},cs={"smp-checkbox-wrapper":"_smp-checkbox-wrapper_z14lq_2"},An=({bindValue:n,_dataComponent:e="checkbox",disabled:t,label:r,isEditable:s=!0,onChange:a,onBlur:i,variant:o="checkbox"})=>{const l=T.useId(),c=u=>{s&&a&&a(u.target.checked)},f={wrapper:`${cs["smp-checkbox-wrapper"]}`};return m.jsxs("div",{className:f.wrapper,"data-component":e,children:[r&&m.jsx(Te,{label:r,disabled:t,htmlFor:l}),m.jsx("input",{"data-component":"checkbox",type:"checkbox",checked:n,onChange:c,onBlur:i,role:o==="switch"?"switch":"checkbox",id:l})]})},kt=({elements:n,isEditable:e=!1,displayMode:t="Both",onChange:r,color:s,backgroundColor:a,isDraggable:i=!1})=>{const[o,l]=T.useState(null),c={container:`${["smp-chips-container"]}`,element:"smp-chips-element"},f=g=>{r?.(n.filter((p,b)=>b!==g))},u=g=>{l(g)},d=g=>{if(o===null||o===g)return;const p=[...n],[b]=p.splice(o,1);p.splice(g,0,b),r?.(p),l(null)};return m.jsx("div",{className:c.container,role:"list","data-component":"chip",children:n.flatMap((g,p)=>{const b=Le(g.bindValue,g.optionalDisplayValue,t),S=m.jsxs("div",{className:c.element,role:"listitem",draggable:i,onDragStart:()=>u(p),onDragOver:E=>i&&E.preventDefault(),onDrop:()=>i&&d(p),style:{"--smp-chips-backgroundColor-base":a},children:[i&&m.jsx(ie,{icon:"drag_indicator_horizontal",isInteractable:!0}),m.jsx(Ee,{variant:"label",bindValue:b,color:s}),e&&m.jsx(ie,{icon:"close",isInteractable:!0,onClick:()=>f(p),color:s})]},`chip-${p}`),R=i&&p<n.length-1?m.jsx(ie,{icon:"chevron-right",color:s},`separator-${p}`):null;return[S,R].filter(Boolean)})})};function $t(n,e){const t=T.useRef(null);T.useEffect(()=>{if(!n)return;const r=typeof e=="object"&&e!==null&&"current"in e?e.current:null;if(!r)return;t.current=document.activeElement;const s=()=>r?Array.from(r.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 u=f[0],d=f[f.length-1];c.shiftKey&&document.activeElement===u?(c.preventDefault(),d.focus()):!c.shiftKey&&document.activeElement===d&&(c.preventDefault(),u.focus())},o=c=>{if(r&&!r.contains(c.target)){c.preventDefault();const f=s();f.length>0&&f[0].focus()}};document.addEventListener("keydown",i),document.addEventListener("mousedown",o);const l=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",i),document.removeEventListener("mousedown",o),document.body.style.overflow=l,t.current&&requestAnimationFrame(()=>{t.current?.focus()})}},[n,e])}const In=({bindValue:n,onChange:e,options:t=[],optionalDisplayValue:r,isEditable:s,displayMode:a,listDisplayMode:i="Both",fun:o,onOptionsRequest:l,multiActiveIndex:c,...f})=>{const u=T.useRef(null),[d,g]=T.useState(!1),[p,b]=T.useState(t),[S,R]=T.useState(-1),[E,C]=T.useState([n]),x=T.useId(),{anchorRef:v,targetRef:$,anchorWidth:w}=lt({position:"bottom",enabled:d}),D=T.useCallback(()=>{g(!1),u?.current?.focus()},[]);ut([$,v],d,()=>D()),$t(d,$);const P=M=>{e?.(M.id,M.label);const N=p.findIndex(H=>H.id===M.id);R(N),C([M.id]),D()},O=M=>{M.key==="Escape"&&(D(),R(-1))},A=M=>{(M.key==="ArrowDown"||M.key==="ArrowUp")&&(M.preventDefault(),L())},L=()=>{s&&(o&&l?d?g(!1):l(o,void 0).then(M=>{b(M),R(M.length>0?0:-1),g(!0)}):g(M=>!M))};return m.jsxs("div",{role:"combobox","aria-expanded":d,"aria-controls":x,"aria-owns":x,"data-component":"combobox",children:[m.jsx(Dt,{...f,bindValue:n,optionalDisplayValue:r,displayMode:a,onShapeIconClick:L,onKeyDown:A,onClick:L,shapeIcon:"arrow_drop_down",rotatedShapeIcon:d,isEditable:s,ref:v,inputRef:u,"aria-autocomplete":"list",variant:"notSelectable"}),d&&m.jsx(ct,{children:m.jsx(kn,{id:x,options:p,displayMode:i,ref:$,isOpen:d,selectedIndex:S,activeIndex:c||E,width:w,onClick:P,onKeyDown:O})})]})},us={"smp-datepickercalendar-position":"_smp-datepickercalendar-position_1lf9g_1"};function fs({selectedDate:n,onDateChange:e,disabledDateRanges:t=[],initialValue:r,targetRef:s}){const{translate:a}=Oe(),i=()=>{if(!r)return;const V=new Date(r);return isNaN(V.getTime())?void 0:V},[o]=T.useState(new Date),[l,c]=T.useState(n||i()||new Date),[f,u]=T.useState(l?l.getMonth():new Date().getMonth()),[d,g]=T.useState(l?l.getFullYear():new Date().getFullYear()),[p,b]=T.useState(l?l.getDate():null),S=T.useRef(null),R=T.useRef([]),E=[a(ue.JANUARY),a(ue.FEBRUARY),a(ue.MARCH),a(ue.APRIL),a(ue.MAY),a(ue.JUNE),a(ue.JULY),a(ue.AUGUST),a(ue.SEPTEMBER),a(ue.OCTOBER),a(ue.NOVEMBER),a(ue.DECEMBER)],C=[{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)}],x=V=>t.some(h=>{const y=h.start.getTime(),_=h.end.getTime(),k=V.getTime();return k>=y&&k<=_}),v=V=>{x(V)||(c(V),b(V.getDate()),e&&e(wr(V)))},$=()=>{f===0?(u(11),g(d-1)):u(f-1),b(1)},w=()=>{f===11?(u(0),g(d+1)):u(f+1),b(1)},D=(V,h)=>new Date(V,h+1,0).getDate(),P=(V,h)=>new Date(V,h,1).getDay(),O=V=>{const h=N.findIndex(y=>y!==null&&y.getDate()===V);h!==-1&&R.current[h]&&(R.current[h]?.focus(),b(V))},A=(V,h)=>{const y=N[h];if(!y)return;const _=D(d,f),k=y.getDate();switch(V.key){case"ArrowRight":V.preventDefault();{let j=k+1,I=new Date(d,f,j);if(j>_){const U=f===11?d+1:d,W=f===11?0:f+1;j=1,I=new Date(U,W,j),w(),setTimeout(()=>{L(1,"forward")},0);return}x(I)?L(j,"forward"):O(j)}break;case"Tab":break;case"ArrowLeft":V.preventDefault();{let j=k-1,I=new Date(d,f,j);if(j<1){const U=f===0?d-1:d,W=f===0?11:f-1,Y=D(U,W);j=Y,I=new Date(U,W,j),$(),setTimeout(()=>{L(Y,"backward")},0);return}x(I)?L(j,"backward"):O(j)}break;case"ArrowUp":V.preventDefault();{let j=k-7,I=new Date(d,f,j);if(j<1){const U=f===0?d-1:d,W=f===0?11:f-1;j=D(U,W)+j,I=new Date(U,W,j),$(),setTimeout(()=>{L(j,"backward")},0);return}x(I)?L(j,"backward"):O(j)}break;case"ArrowDown":V.preventDefault();{let j=k+7,I=new Date(d,f,j);if(j>_){const U=f===11?d+1:d,W=f===11?0:f+1;j=j-_,I=new Date(U,W,j),w(),setTimeout(()=>{L(j,"forward")},0);return}x(I)?L(j,"forward"):O(j)}break;case"Home":V.preventDefault(),L(1,"forward");break;case"End":V.preventDefault(),L(_,"backward");break;case"PageUp":V.preventDefault(),$(),setTimeout(()=>{const j=D(f===0?d-1:d,f===0?11:f-1),I=Math.min(k,j);L(I,"forward")},0);break;case"PageDown":V.preventDefault(),w(),setTimeout(()=>{const j=D(f===11?d+1:d,f===11?0:f+1),I=Math.min(k,j);L(I,"forward")},0);break;case" ":case"Space":if(x(y))return;b(y.getDate()),c(y);break;case"Enter":V.preventDefault(),v(y);break}},L=(V,h)=>{const y=D(d,f);if(h==="forward"){for(let _=V;_<=y;_++){const k=new Date(d,f,_);if(!x(k)){O(_);return}}w(),setTimeout(()=>{L(1,"forward")},0)}else{for(let I=V;I>=1;I--){const U=new Date(d,f,I);if(!x(U)){O(I);return}}const _=f===0?d-1:d,k=f===0?11:f-1,j=D(_,k);$(),setTimeout(()=>{L(j,"backward")},0)}},N=(()=>{const V=D(d,f),h=P(d,f),y=[];for(let _=0;_<h;_++)y.push(null);for(let _=1;_<=V;_++){const k=new Date(d,f,_);y.push(k)}return y})(),H=[];let G=[];N.forEach((V,h)=>{if(G.push(V),G.length===7||h===N.length-1){for(;G.length<7;)G.push(null);H.push(G),G=[]}}),T.useEffect(()=>{if(p!==null){const V=N.findIndex(h=>h!==null&&h.getDate()===p);V!==-1&&R.current[V]&&R.current[V]?.focus()}},[f,d,p,N]);const z={label:"smp-datepickercalendar-label",wrapper:`smp-datepickercalendar ${us["smp-datepickercalendar-position"]}`,calendar:"smp-datepickercalendar",table:"smp-datepickercalendar-table",th:"smp-datepickercalendar-th",td:(V,h,y,_)=>`smp-datepickercalendar-td
46
+ ${V?"smp-datepickercalendar-td-today":""}
47
47
  ${h?"smp-datepickercalendar-td-selected":""}
48
- ${v?"smp-datepickercalendar-td-focused":""}
49
- ${_?"smp-datepickercalendar-td-disabled":""}`},J=()=>`${w[f]} ${d.toString()}`;return g.jsxs("div",{className:z.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[g.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[g.jsx(Se,{onClick:$,ariaLabel:a(_t.PREVIOUS_MONTH),optionalDisplayValue:"<",appearance:"ghost",variant:"base",bindValue:"<"}),g.jsx("div",{"aria-label":J(),className:z.label,children:J()}),g.jsx(Se,{onClick:M,ariaLabel:a(_t.NEXT_MONTH),bindValue:">",optionalDisplayValue:">",appearance:"ghost",variant:"base"})]}),g.jsxs("table",{ref:x,role:"grid","aria-label":`${a(Te.CALENDAR_FOR)} ${w[f]} ${d}`,className:z.table,children:[g.jsx("thead",{children:g.jsx("tr",{children:S.map(U=>g.jsx("th",{scope:"col",abbr:U.full,className:z.th,children:U.value},U.value))})}),g.jsx("tbody",{children:I.map((U,h)=>g.jsx("tr",{children:U.map((v,_)=>{const P=h*7+_;if(v===null)return g.jsx("td",{className:z.td(!1,!1,!1,!0)},`empty-${_}`);const L=v.getDate()===o.getDate()&&v.getMonth()===o.getMonth()&&v.getFullYear()===o.getFullYear(),N=l&&v.getDate()===l.getDate()&&v.getMonth()===l.getMonth()&&v.getFullYear()===l.getFullYear(),B=p===v.getDate(),H=E(v);return g.jsx("td",{role:"gridcell","aria-selected":N,tabIndex:B?0:-1,onClick:()=>b(v),onKeyDown:W=>j(W,P),"aria-label":`${v.getDate()} ${w[v.getMonth()]} ${v.getFullYear()}`,"data-selected":N,"aria-disabled":H,ref:W=>{O.current[P]=W},className:z.td(L,N,B,H),children:v.getDate()},`day-${_}`)})},`week-${h}`))})]})]})}const Nr=({bindValue:r,placeholder:e,onChange:t,disabledDateRanges:n,isEditable:s=!0,...a})=>{const i=R.useRef(null),[o,l]=R.useState(!1),[c,f]=R.useState(r||""),[u,d]=R.useState(""),{anchorRef:m,targetRef:p}=ct({position:"bottom",enabled:o}),y=R.useCallback(()=>{var T;l(!1),(T=i==null?void 0:i.current)==null||T.focus()},[]);ft([p,m],o,()=>{y()}),Lt(o,p);const{format:x,getCurrentLanguage:O}=je(),w=R.useCallback(T=>{const k=T.length>5&&wn(T,O())||T,j=x(k,void 0,void 0,{type:"date"}),D=typeof k!="string",C=D&&k.toISOString().substring(0,10)||"";return{isValid:D,formattedDate:j,isoDate:C,normalizedDate:k}},[O,x]);R.useEffect(()=>{const{formattedDate:T,isoDate:k,isValid:j}=w(r);f(j&&k||r),d(j&&T||r)},[r,x,w]);const S=()=>l(T=>!T),E=()=>{$(u)},b=T=>{$(T),y()},$=T=>{const{isoDate:k,isValid:j}=w(T);t&&t(j&&k||T)},M=T=>{d(T)},A=T=>{T.key==="Enter"&&(T.preventDefault(),$(u))};return g.jsxs("div",{"data-component":"date-picker",children:[g.jsx(we,{...a,bindValue:u,placeholder:e,onBlur:E,onChange:M,onKeyDown:A,shapeIcon:"calendar",onShapeIconClick:S,ref:m,inputRef:i,isEditable:s,size:10,maxLength:a.maxLength?a.maxLength:10}),o&&g.jsx(ut,{children:g.jsx(hs,{disabledDateRanges:n,onDateChange:b,initialValue:jt(c)&&c||"",targetRef:p})})]})},ms=({elements:r,displayMode:e,minimumChars:t,listDisplayMode:n,isEditable:s=!0,placeholder:a,label:i,disabled:o,fun:l,error:c,onOptionsRequest:f,onChange:u,onBlur:d})=>{const m=r.map(x=>x.bindValue),p=(x,O)=>{const w=[...r];if(x=="")w.pop();else{const S=w.findIndex(E=>E.bindValue===x&&E.optionalDisplayValue===O);S>=0?w.splice(S,1):w.push({bindValue:x,optionalDisplayValue:O})}u==null||u(w)},y={container:"smp-multipleAutocomplete-container"};return g.jsxs("div",{className:y.container,"data-component":"multiple-autocomplete",children:[i&&g.jsx(De,{label:i,disabled:o}),g.jsx(kt,{elements:r,displayMode:e,isEditable:s,onChange:x=>{u==null||u(x)}}),g.jsx(Ct,{bindValue:"",fun:l,isEditable:s,onChange:p,_changeOnEnter:!0,listDisplayMode:n,minimumChars:t,placeholder:a,onOptionsRequest:f,_multiActiveIndex:m,error:c,onBlur:d})]})},Mr=({...r})=>{const[e,t]=R.useState(!1),n=e?"visibility-off":"visibility";return g.jsx(we,{...r,inputType:e?"text":"password",shapeIcon:n,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},gs=({...r})=>{const[e,t]=R.useState(r.bindValue),{translate:n}=je(),s=a=>{var i;a.key==="Enter"&&(a.preventDefault(),(i=r.onEnter)==null||i.call(r,e))};return g.jsx(we,{...r,placeholder:r.placeholder?r.placeholder:n(Te.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})},ys=({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(_e,{variant:"body",bindValue:e||r})]}):g.jsx(_e,{variant:"body",bindValue:e||r})};class Re{constructor(e,t){de(this,"class");de(this,"value");this.class=e,this.value=t}static fromDataObj(e){return new Re(e,e.k==""?[]:e.k.split(";"))}static fromString(e){return new Re({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const Le=(r,e,t)=>({obj:{t:r.obj.t,p:r.obj.p,k:e},decode:t??r.decode,shape:r.shape,fun:r.fun}),xr=r=>{const e=Re.fromDataObj(r.obj),t=r.decode?Re.fromString(r.decode).getValue():[];return e.getValue().map((n,s)=>({bindValue:n,optionalDisplayValue:t.length>=s?t[s]:""}))},bs=(r,e)=>{const t=new Re(r.obj,e.map(s=>s.bindValue)).getLegacyValue(),n=new Re(r.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return Le(r,t,n)},vs=r=>{switch(r){case"CodeOnly":return 15;case"Both":case"CodeAndDesc":case"DescAndCode":return 50;case"DescOnly":default:return 35}},xs=({min:r,max:e,step:t=1,inputMode:n="decimal",dSep:s,bindValue:a,onChange:i,onEnter:o,...l})=>{const{getCurrentLanguage:c}=je(),f=R.useRef(null),u=c(),{groupingChar:d,decimalChar:m}=R.useMemo(()=>ss(u,s),[u,s]),p=R.useCallback((D,C)=>new Intl.NumberFormat(u,{minimumFractionDigits:C,maximumFractionDigits:C,useGrouping:!0}).format(D),[u]),y=R.useCallback(os,[d,m]),x=R.useCallback(ns,[r,e]),O=a!=null&&a.toString().includes(".")?a.toString().split(".")[1].length:0,[w,S]=R.useState(O),[E,b]=R.useState(a!=null?p(a,w):""),$=R.useRef(a??null);R.useEffect(()=>{if(a==null){b(""),$.current=null;return}const D=a.toString().includes(".")?a.toString().split(".")[1].length:0,C=D===0?w:D;C!==w&&S(C),b(p(a,C)),$.current=a},[a,p]);const M=R.useCallback((D,C=!1)=>{if(D.trim()===""){b(""),$.current=null,i==null||i(void 0,""),C&&(o==null||o(void 0));return}const V=y(D,d,m);if(isNaN(V))if($.current!=null){const I=p($.current,w);b(I)}else b("");else{const I=x(V,r,e),Y=is(D,d,m);S(Y);const z=p(I,Y);b(z),$.current=I,i==null||i(I,z),C&&(o==null||o(I))}},[y,d,m,x,r,e,p,i,o,w]),A=D=>b(D),T=()=>M(E),k=D=>{if(D.key==="Enter"){D.preventDefault(),M(E,!0);return}if(D.key==="ArrowUp"||D.key==="ArrowDown"){D.preventDefault();const C=D.key==="ArrowUp"?1:-1,V=$.current??0,I=x(V+C*t,r,e);M(p(I,w))}},j=D=>{if(!D.currentTarget.contains(document.activeElement))return;D.preventDefault();const C=D.deltaY<0?1:-1,V=$.current??0,I=x(V+C*t,r,e);M(p(I,w))};return g.jsx("div",{ref:f,"data-component":"input-number",onWheel:j,children:g.jsx(we,{...l,"aria-valuemin":r,"aria-valuemax":e,"aria-valuenow":$.current??void 0,bindValue:E,inputType:"text",inputMode:n,min:r,max:e,step:t,onChange:A,onBlur:T,onKeyDown:k})})};class We{constructor(e,t,n="."){de(this,"class");de(this,"value");de(this,"decimalSeparator");this.class=e,this.value=t,this.decimalSeparator=n}static fromDataObj(e,t){const n=t==="."?",":".";if(e.k=="")return new We(e,void 0,t);const s=e.k.replace(new RegExp(`\\${n}`,"g"),""),a=parseFloat(s.replace(t,"."));return new We(e,a,t)}getLegacyValue(){return this.value!=null?this.value.toString().replace(".",this.decimalSeparator):""}getValue(){return this.value}}const Ss=({disabled:r,bindValue:e,onChange:t,placeholder:n,state:s,appearance:a,isEditable:i,label:o,ariaLabel:l,helperText:c,error:f,onBlur:u,onKeyDown:d,rows:m=10,cols:p=35})=>{const y=R.useId(),x=`${y}-helper`,O=f?"danger":s,w=c||!!f,S=b=>{t==null||t(b.target.value)},E={wrapper:"smp-textarea-wrapper",container:`smp-textarea ${r?"smp-textarea-disabled":""} ${n?"smp-textarea-placeholder":""} ${O?`smp-textarea-${O}`:""} ${a?`smp-textarea-${a}`:""} ${i?"":"smp-textarea-readOnly"}`};return g.jsxs("div",{className:E.wrapper,"data-component":"textarea",children:[o&&g.jsx(De,{htmlFor:y,label:o,disabled:r}),g.jsx("textarea",{id:y,value:e,placeholder:n,onChange:S,onBlur:u,className:E.container,disabled:r,readOnly:!i,onKeyDown:d,"aria-label":o?void 0:l,"aria-labelledby":o?y:void 0,"aria-describedby":w?x:void 0,rows:m,cols:p}),w&&g.jsx(jr,{id:x,helperText:f,disabled:r,state:O})]})};var Rt=(r=>(r.PAGE_DIRECTION="pageDirection",r.LINE_DIRECTION="lineDirection",r))(Rt||{});const Fe={"smp-radio":"_smp-radio_1wj31_1","smp-radio-options-container":"_smp-radio-options-container_1wj31_10","smp-radio-horizontal":"_smp-radio-horizontal_1wj31_16","smp-radio-element":"_smp-radio-element_1wj31_20","smp-radio-disabled":"_smp-radio-disabled_1wj31_26"},ws=({disabled:r=!1,displayMode:e="DescOnly",RadLay:t=Rt.PAGE_DIRECTION,options:n,onOptionsRequest:s,fun:a,label:i,...o})=>{const[l,c]=R.useState(n),f=R.useId();R.useEffect(()=>{!l&&s&&a&&s(a,void 0).then(y=>c(y)).catch(y=>{console.error("Error during loading options (radio)",y)})},[l,s,a]);const u={container:Fe["smp-radio"],optionsContainer:`${Fe["smp-radio-options-container"]} ${t==Rt.LINE_DIRECTION?Fe["smp-radio-horizontal"]:""}`,option:`${Fe["smp-radio-element"]} ${r?Fe["smp-radio-disabled"]:""}`},d=()=>{var y;r||(y=o.onBlur)==null||y.call(o)},m=y=>{var x;r||(x=o.onChange)==null||x.call(o,y.id,y.label)},p=R.useId();return g.jsxs("div",{"smp-id":"radio-container",className:u.container,id:f,children:[i&&g.jsx(De,{label:i,disabled:r,htmlFor:f}),g.jsx("div",{className:u.optionsContainer,children:l==null?void 0:l.map((y,x)=>g.jsxs("label",{className:u.option,children:[g.jsx("input",{type:"radio",name:p,value:y.id,disabled:r,checked:y.id===o.bindValue,onChange:()=>m(y),onBlur:d}),g.jsx(_e,{variant:"body",bindValue:Ae(y.id,y.label,e)})]},x))})]})},Es=({value:r,onChange:e,targetRef:t,isOpen:n})=>{const s=R.useRef(null);R.useEffect(()=>{n&&(s!=null&&s.current)&&s.current.focus()},[n,s]);const[a,i,o]=r,l=c=>Array.from({length:c},(f,u)=>g.jsx("option",{value:u,children:u.toString().padStart(2,"0")},u));return g.jsxs("div",{className:"smp-timepicker-widget",ref:t,children:[g.jsx("select",{value:a,ref:s,onChange:c=>e(+c.target.value,i,o),id:"time-picker-hours",children:l(24)}),":",g.jsx("select",{value:i,onChange:c=>e(a,+c.target.value,o),id:"time-picker-minutes",children:l(60)}),":",g.jsx("select",{value:o||0,onChange:c=>e(a,i,+c.target.value),id:"time-picker-seconds",children:l(60)})]})},Sr=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)},Ts=r=>{const e=r.split(":").map(t=>parseInt(t,10));return[e[0]||0,e[1]||0,e[2]||0]},Os=(r,e,t)=>{const n=r!=null&&!isNaN(r)?r.toString().padStart(2,"0"):"",s=e!=null&&!isNaN(e)?e.toString().padStart(2,"0"):"",a=t!=null&&!isNaN(t)?t.toString().padStart(2,"0"):"";return n&&s?`${n}:${s}:${a}`:s?`${s}:${a}`:a},_s=({bindValue:r,placeholder:e="HH:MM:SS",onChange:t,isEditable:n=!0,...s})=>{const a=R.useRef(null),[i,o]=R.useState(!1),[l,c]=R.useState(r||""),[f,u]=R.useState(""),{anchorRef:d,targetRef:m}=ct({position:"bottom",enabled:i}),p=R.useCallback(()=>{var b;o(!1),(b=a==null?void 0:a.current)==null||b.focus()},[]);ft([m,d],i,()=>o(!1)),Lt(i,m),R.useEffect(()=>{const b=r||"",$=Sr(b)?b:r||"";c(b),u($)},[r]),R.useEffect(()=>{const b=$=>{$.key==="Escape"&&o(!1)};return i&&document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}},[i]);const y=()=>{n&&o(b=>!b)},x=b=>{u(b)},O=(b,$,M)=>{const A=Os(b,$,M);c(A),u(A),t==null||t(A),p()},w=()=>{E(f)},S=b=>{b.key==="Enter"&&(b.preventDefault(),E(f))},E=b=>{if(b.trim()===""){c(""),u(""),t==null||t("");return}Sr(b)?(c(b),u(b),t==null||t(b)):u(b)};return g.jsxs("div",{"data-component":"time-picker",children:[g.jsx($t,{...s,bindValue:f,placeholder:e,onChange:x,onBlur:w,onKeyDown:S,shapeIcon:"clock",onShapeIconClick:y,isEditable:n,ref:d,inputRef:a}),i&&g.jsx(ut,{children:g.jsx(Es,{value:Ts(l),onChange:O,targetRef:m,isOpen:i})})]})};function Rs(r){return typeof r=="string"&&/^\d{6}$/.test(r)}class lt{constructor(e,t){de(this,"class");de(this,"time");this.class=e,this.time=t}static fromDataObj(e){const t=wr.get(`${e.t}${e.p}`);if(t)return new lt(e,t.legacyToIso(e.k));throw new Error(`time creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=wr.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 wr=new Map([["I12",{legacyToIso(r){return Rs(r)&&`${r.substring(0,2)}:${r.substring(2,4)}:${r.substring(4,6)}`||r},isoToLegacy(r){return r.replaceAll(":","")||r}}]]),Ds={"smp-cell-wrapper":"_smp-cell-wrapper_mdlkz_1"},Oe=({decode:r,shape:e,obj:t,data:n,icon:s,fun:a,placeholderIcon:i,label:o,tooltip:l,options:c,onChange:f,onClick:u,onEnter:d,onBlur:m,onOptionsRequest:p,onContextMenu:y,isEditable:x,dSep:O="."})=>{var k;const w={obj:t,shape:e,decode:r,icon:s,fun:a,data:n},S={onBlur:m,onOptionsRequest:p,fun:a,icon:s,tooltip:l,label:o,isEditable:x,size:w.data&&w.data.size?w.data.size:((k=w.data)==null?void 0:k.displayMode)&&vs(w.data.displayMode||"CodeOnly"),...n},E=(j,D,C)=>vn(t)?Le(j,new st(t,D).getLegacyValue()):xn(t)?Le(j,new lt(t,D).getLegacyValue()):Le(j,D,C),b=(j,D)=>Le(j,new We(t,D,O).getLegacyValue()),$=j=>Le(w,new nt(t,j).getLegacyValue()),M=j=>bs(w,j),A=()=>{switch(e){case te.AUTOCOMPLETE:{const j={...S,bindValue:t.k,optionalDisplayValue:r,onChange:(D,C)=>{f==null||f(E(w,D,C))}};return g.jsx(Ct,{...j})}case te.BUTTON:{const j={...S,bindValue:t.k,optionalDisplayValue:n!=null&&n.label&&typeof n.label=="string"?n.label:void 0,title:r,onClick:()=>{u==null||u(E(w,t.k))}};return g.jsx(Se,{...j})}case te.BUTTON_LIST:{const j={...S,options:c,onClick:(D,C)=>{const V={...w,fun:C};u==null||u(E(V,D))}};return g.jsx(Pr,{...j})}case te.CHIP:{const j={...S,elements:xr(w)};return g.jsx(kt,{...j})}case te.CHECKBOX:case te.SWITCH:{const j=e===te.SWITCH,D={...S,bindValue:nt.fromDataObj(t).getValue(),optionalDisplayValue:r,onChange:C=>{f==null||f($(C))},...j&&{variant:"switch"}};return g.jsx(Ar,{...D})}case te.COMBOBOX:{const j={...S,bindValue:t.k,optionalDisplayValue:r,onChange:(D,C)=>{f==null||f(E(w,D,C))}};return g.jsx(Ir,{...j})}case te.DATE:{const j={...S,bindValue:st.fromDataObj(t).getValue(),onChange:D=>{f==null||f(E(w,D))}};return g.jsx(Nr,{...j})}case te.ICON:case te.IMAGE:{const j={...S,icon:s,placeholderIcon:i,isInteractable:!!S.fun,onClick:()=>{u==null||u(E(w,t.k))}};return g.jsx(oe,{...j})}case te.INPUT_NUMBER:{const j={...S,bindValue:We.fromDataObj(t,O).getValue(),onChange:D=>{f==null||f(b(w,D))}};return g.jsx(xs,{...j})}case te.EDITOR:case te.MEMO:{const j={...S,bindValue:t.k,optionalDisplayValue:r,onChange:D=>{f==null||f(E(w,D))}};return g.jsx(Ss,{...j})}case te.MULTI_AUTOCOMPLETE:{const j={...S,elements:xr(w),onChange:D=>{f==null||f(M(D))}};return g.jsx(ms,{...j})}case te.PASSWORD:{const j={...S,bindValue:t.k,onChange:D=>{f==null||f(E(w,D))}};return g.jsx(Mr,{...j})}case te.RADIO:{const j={...S,bindValue:t.k,onChange:(D,C)=>{f==null||f(E(w,D,C))}};return g.jsx(ws,{...j})}case te.SPOTLIGHT:{const j={...S,bindValue:t.k,onEnter:D=>{d==null||d(E(w,D))}};return g.jsx(gs,{...j})}case te.TEXT_FIELD:{const j={...S,bindValue:t.k,optionalDisplayValue:r,onChange:D=>{f==null||f(E(w,D))}};return g.jsx(we,{...j})}case te.TIME:{const j={...S,bindValue:lt.fromDataObj(t).getValue(),onChange:D=>{f==null||f(E(w,D))}};return g.jsx(_s,{...j})}default:{const j={...S,bindValue:t.k,optionalDisplayValue:r};return g.jsx(ys,{...j})}}},T={wrapper:`${Ds["smp-cell-wrapper"]}`};return g.jsx("span",{className:T.wrapper,onContextMenu:j=>{y&&l&&(j.preventDefault(),y(w,j.currentTarget))},children:A()})},js=({data:r,onClick:e,onEnter:t,onContextMenu:n})=>{var o,l;const[s,a]=R.useState(),i=R.useCallback(c=>{var u,d;if(!((u=c.rows)!=null&&u.length)||!((d=c.columns)!=null&&d.length))return{};const f=c.rows[0];return c.columns.filter(m=>m.visible).reduce((m,p)=>{const y=f.cells[p.name],x={...y,id:p.name,onChange:O=>{a(w=>w&&{...w,[p.name]:{...w[p.name],obj:{...w[p.name].obj,k:O.obj.k}}})},onClick:()=>{y.fun&&e&&e({...y})},onEnter:O=>{t&&t(O)},onContextMenu:(O,w)=>{n&&n(O,w)}};return{...m,[p.name]:x}},{})},[e,t,n]);return R.useEffect(()=>{r&&a(i(r))},[r,i]),!((o=r==null?void 0:r.rows)!=null&&o.length)||!((l=r.columns)!=null&&l.length)?null:s&&g.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:g.jsx(rt,{layout:r.rows[0].layout,children:Object.values(s).map(c=>g.jsx(Oe,{...c}))})})},$s=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,Cs=({data:r,logo:e,open:t,minifiedOnClose:n=!0,customHeight:s="100vh",onClick:a,onEnter:i,onClose:o,loadOptions:l,onContextMenu:c})=>{var E,b;const[f,u]=R.useState(),[d,m]=R.useState(t??!0),p=R.useRef(null),y=s.trim()?s:"100vh",x=R.useCallback($=>{var A,T;if(!((A=$==null?void 0:$.rows)!=null&&A.length)||!((T=$==null?void 0:$.columns)!=null&&T.length))return{};const M=$.rows[0];return $.columns.filter(k=>k.visible??!0).reduce((k,j)=>{const D=M.cells[j.name];if(!D||!d&&ce(n)&&D.shape!==te.BUTTON&&D.shape!==te.BUTTON_LIST)return k;const C={...D,id:j.name,onChange:V=>{u(I=>{const Y={...I};return Y!=null&&Y[j.name]&&(Y[j.name].obj.k=V.obj.k),Y})},onClick:V=>{V.fun&&a&&a(V)},onEnter:V=>{i&&i(V)},onContextMenu:(V,I)=>{c&&c(V,I)}};return l&&D.shape==te.BUTTON_LIST&&(C.onOptionsRequest=(V,I)=>l(V,I).then(Y=>$s(Y))),!d&&ce(n)&&(C.data={...C.data,showText:!1,justify:"center",squared:!0}),{...k,[j.name]:C}},{})},[d,n,a,i,l,c]),O=R.useCallback(()=>{o==null||o()},[o]),w=()=>{ce(n)?m($=>!$):(m(!1),o==null||o())};if(R.useEffect(()=>{u(x(r))},[r]),R.useEffect(()=>{if(!p.current)return;if(!ce(n)){u(x(r));return}const $=getComputedStyle(p.current).getPropertyValue("--smp-drawer-slide-transition");let M=Number($);$.endsWith("ms")?M=parseFloat($):$.endsWith("s")&&(M=parseFloat($)*1e3),setTimeout(()=>{u(x(r))},M/2)},[d,n]),R.useEffect(()=>{t!==void 0&&!ce(n)&&m(t)},[n,t]),!((E=r==null?void 0:r.rows)!=null&&E.length)||!((b=r.columns)!=null&&b.length))return null;const S={drawer:`smp-drawer ${ce(n)?"smp-drawer-minified":"smp-drawer-fixed"} ${d?"smp-drawer-open":""} ${!ce(n)&&!d?"smp-drawer-no-border":""}`,container:"smp-drawer-container",containerHeader:"smp-drawer-container-header",containerIcon:`${d?"":"smp-drawer-container-icon-close"} smp-drawer-container-icon`,containerLayout:"smp-drawer-container-layout",containerLogo:"smp-drawer-container-logo",backdrop:`smp-drawer-backdrop ${d?"smp-drawer-backdrop-open":""}`};return f&&g.jsxs(g.Fragment,{children:[!ce(n)&&g.jsx("div",{"aria-hidden":"true","aria-label":"drawer-backdrop",className:S.backdrop,onClick:O}),g.jsx("aside",{ref:p,className:S.drawer,style:{height:y},"aria-label":"Drawer","smp-id":"drawer",children:g.jsxs("div",{className:S.container,children:[g.jsxs("div",{className:S.containerHeader,children:[e&&g.jsx("div",{className:S.containerLogo,children:g.jsx(oe,{icon:e,title:"drawer_logo",width:"100%",height:24})}),g.jsx("div",{className:S.containerIcon,children:g.jsx(oe,{icon:ce(n)?"menu_close":"close",title:"drawer_icon",rotated:!d,isInteractable:!0,onClick:w,width:20,height:20})})]}),g.jsx("div",{className:S.containerLayout,children:g.jsx(rt,{layout:r.rows[0].layout,children:Object.values(f).map($=>g.jsx(Oe,{...$}))})})]})})]})},ks=({ColumnsNumber:r=1,data:e={},ForceText:t,TextColName:n,TextColor:s="var(--smp-dashList-color-base)",Fillspace:a,FontSize:i,Horizontal:o,ForceIcon:l,IconColName:c,IconColor:f="var(--smp-dashList-color-base)",NumberFormat:u,ForceUM:d,UmColName:m,UmColor:p="var(--smp-dashList-color-base)",ForceValue:y,ValueColName:x,ValueColor:O="var(--smp-dashList-color-base)",SelectLayout:w="1",onClick:S})=>{const E="N/A",b=(e==null?void 0:e.columns)||[],$=(e==null?void 0:e.rows)||[],M=$.length>0,A="--smp-dashList-color",T="smp-layout",k="descr",j="icon",D="um",C="value",V=i||"1em",I="18px",Y="--smp-dashList-columns",z="--smp-dashList-fontSize",J={dash:(G="1")=>{const Z=h(G),re=Z,ne=v(Z,k),fe=v(Z,j),ve=v(Z,D),me=v(Z,C);return{container:re,descr:ne,icon:fe,um:ve,value:me}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
50
- ${ce(o)?"smp-dash-list-horizontal":""}`},{format:U}=je(),h=G=>`${T}-${G}`,v=(G,Z)=>`${G}__${Z}`,_=G=>`${A}-${G}`,P=G=>{const Z=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(Z.test(G)){const ne=G.match(Z)||[];if((ne==null?void 0:ne.length)>3)return"rgb("+ne[1]+","+ne[2]+","+ne[3]+")"}return G},L=G=>{if(!u)return G;const[Z,re]=N(u).map($e=>parseInt($e||"0")),ne="0,0"+(re?"."+"0".repeat(re):""),fe=U(G,ne,"it");if(!Z)return fe;const[ve,me]=fe.split(",");return ve+(me?`,${me}`:"")},N=G=>G.includes(";")?G.split(";"):[G],B=G=>{const Z=ne=>{var fe;if(ne)return(fe=G==null?void 0:G.cells[ne])==null?void 0:fe.obj.k},re=ne=>{var fe,ve;if(!(b.length<=ne))return(ve=(fe=G==null?void 0:G.cells[b[ne].name])==null?void 0:fe.obj)==null?void 0:ve.k};return{descr:t||Z(n)||re(2)||"",icon:l||Z(c)||re(3)||"",um:d||Z(m)||re(1)||"",value:y||Z(x)||re(0)||""}},H=G=>{S==null||S(G)},W=(G,Z)=>{(G.key==="Enter"||G.key===" ")&&(G.preventDefault(),G.stopPropagation(),H(Z))},K=(G=>{const Z=J.dash(G);return{className:Z,descr:re=>g.jsx("div",{className:Z.descr,children:re},`${G}-${k}`),icon:re=>g.jsx("div",{className:Z.icon,children:g.jsx(oe,{color:f,height:I,icon:re,width:I})},`${G}-${j}`),um:re=>g.jsx("div",{className:Z.um,children:re},`${G}-${D}`),value:re=>g.jsx("div",{className:Z.value,children:re},`${G}-${C}`)}})(w),se=G=>{const{descr:Z,icon:re,um:ne,value:fe}=B(G),ve={[_(k)]:P(s),[_(D)]:P(p),[_(C)]:P(O)},me=[],$e=L(fe);switch(w){case"2":re&&me.push(K.icon(re)),me.push(K.descr(Z)),me.push(K.value(ne?$e+" "+ne:$e));break;default:case"1":me.push(K.descr(Z)),me.push(K.value(ne?$e+" "+ne:$e))}return g.jsx("div",{className:K.className.container,role:"button",style:ve,tabIndex:0,onClick:()=>H(G),onKeyDown:Vr=>W(Vr,G),children:me},G.rowId)},F={[Y]:String(r),[z]:V};return g.jsx("div",{className:J.dashList,style:F,children:M?$.map(G=>se(G)):E})},Qe={"smp-table":"_smp-table_1qmju_1","smp-headerCell":"_smp-headerCell_1qmju_35","smp-resizer":"_smp-resizer_1qmju_44"},Ls="_rowContent_20wit_2",Ps="_clickable_20wit_21",As="_indent_20wit_26",Is="_toggle_20wit_32",Ns="_cell_20wit_38",Ms="_leftSection_20wit_46",Ee={rowContent:Ls,clickable:Ps,indent:As,toggle:Is,cell:Ns,leftSection:Ms};function et(r){return!!r&&"children"in r}function Fs(r){return!et(r)}function Vs(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 Fr=({row:r,columnWidths:e={},level:t=0,rowHeight:n=26,offsetTop:s})=>{var w;const[a,i]=R.useState(!1),o=et(r)&&!!((w=r.children)!=null&&w.length),l=r.cells&&Object.keys(r.cells).length>0,c=o,f=t*20,u=()=>{o&&i(!a)},d={content:`${Ee.rowContent} ${o?Ee.clickable:""}`,toggle:`${Ee.toggle}`,indent:`${Ee.indent}`,cell:`${Ee.cell}`},m=S=>g.jsx(Oe,{...S}),p=()=>g.jsx("span",{className:d.toggle,children:c&&g.jsx(oe,{icon:a?"arrow_drop_right":"arrow_drop_down",width:16})}),y=()=>g.jsx("span",{className:d.indent,style:{width:`${f}px`},"aria-hidden":"true"}),x=()=>{const S=Fs(r)?"":r.decode||(l?"":"Untitled"),E=s??n*t;return g.jsxs("tr",{className:d.content,onClick:u,role:o?"button":"row","aria-expanded":o?!a:void 0,style:{height:`${n}px`,lineHeight:`calc(${n}px - 2*2px)`,transform:`translateY(${E}px)`},children:[et(r)&&g.jsxs("td",{className:Ee.leftSection,style:{height:`${n}px`},children:[y(),p(),g.jsx("span",{className:Ee.rowLabel,children:S})]}),r.cells&&Object.keys(r.cells).length>0&&Object.entries(r.cells).map(([b,$])=>g.jsx("td",{className:d.cell,style:{width:e[b],minWidth:e[b],height:`${n}px`},children:m({...$,id:b})},Vs($)||b))]})},O=()=>{var S;return a||!o?null:g.jsx(g.Fragment,{children:et(r)&&((S=r.children)==null?void 0:S.map((E,b)=>g.jsx(Fr,{row:E,level:t+1},`child-${b}`)))})};return g.jsxs(g.Fragment,{children:[x(),O()]})},Ys=({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(_e,{variant:"title",bindValue:r})]})})};function Us(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 Bs(r,e,t,n){const s=[];let a=0;return i(r,0,[]),{flatRows:s,offset:a};function i(u,d,m){if(d>=e.length){f(u);return}const p=e[d].column,y=o(u,p);for(const[x,O]of y){const w=[...m,x],S=l(w,d),E=n.has(S);s.push(c(x,S,d,E)),a+=t,E&&i(O,d+1,w)}}function o(u,d){var p;const m=new Map;for(const y of u){const x=((p=y.cells[d])==null?void 0:p.decode)??"N/D";m.has(x)||m.set(x,[]),m.get(x).push(y)}return m}function l(u,d){return`group-${u.join("-")}-${d}`}function c(u,d,m,p){return{isGroup:!0,value:u,cells:{},rowId:d,level:m,isExpanded:p}}function f(u){for(const d of u)s.push(d),a+=t}}const Hs=({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(kt,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:n})})]})},Gs=({columns:r,columnWidths:e})=>g.jsx("tfoot",{children:g.jsx("tr",{children:r.map(t=>t.visible&&g.jsx("td",{className:Qe["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 c=Object.fromEntries(r.map(f=>[f.name,120]));a(c)}else if(n==="fit-grid"){const l=((i=t.current)==null?void 0:i.offsetWidth)||800,c=r.filter(d=>d.visible!==!1),f=l/c.length,u=Object.fromEntries(c.map(d=>[d.name,f]));a(u)}else if(n==="fit-content"){const l={};for(const c of r){if(!c.visible)continue;const f=((o=c.title)==null?void 0:o.length)||0,u=Math.max(...e.map(d=>{var m,p,y,x;return`${((p=(m=d.cells)==null?void 0:m[c.name])==null?void 0:p.decode)||((x=(y=d.cells)==null?void 0:y[c.name])==null?void 0:x.value)||""}`.length}),f);l[c.name]=u*8+24}a(l)}}},[r,e,t,n]),[s,a]},qs=({data:r,lineHeight:e=28,TableHeight:t=400,groups:n,columnSizingMode:s="fixed",showGroupBar:a=!0})=>{var M;const[i,o]=R.useState(r??{columns:[],rows:[]}),[l,c]=R.useState(n||[]),[f,u]=R.useState(new Set),d=R.useRef(null),[m,p]=Ks({columns:(i==null?void 0:i.columns)??[],rows:(i==null?void 0:i.rows)??[],containerRef:d,sizingMode:s});R.useEffect(()=>{if(l!=null&&l.length&&r.rows){const{flatRows:A}=Bs(r.rows,l,e,f);o({...r,rows:A})}else o(r)},[r,l,f,e]);const y=A=>{c(Ws(A,l))},x=A=>{A.preventDefault();const T=A.dataTransfer.getData("text/plain");if(!T||l.some(D=>D.column===T))return;const j=[...l,{column:T,visible:!0}];c(j)},O=A=>{A.preventDefault()},{virtualItems:w,containerProps:S,innerProps:E}=$r({items:(i==null?void 0:i.rows)??[],itemHeight:e,containerHeight:t,overscan:5}),b=(A,T)=>{const k=A.clientX,j=m[T],D=V=>{const I=V.clientX-k,Y=Math.max(50,j+I);p(z=>({...z,[T]:Y}))},C=()=>{window.removeEventListener("mousemove",D),window.removeEventListener("mouseup",C)};window.addEventListener("mousemove",D),window.addEventListener("mouseup",C)},$={smpTable:`${Qe["smp-table"]}`,headerCell:`${Qe["smp-headerCell"]}`,resizer:`${Qe["smp-resizer"]}`};return i&&g.jsx("div",{className:$.smpTable,...S,ref:d,children:g.jsxs("table",{children:[g.jsxs("thead",{children:[(n||a)&&g.jsx(Hs,{groups:l,onChange:y,onDrop:x,onDragOver:O}),g.jsx("tr",{children:i.columns&&((M=i.columns)==null?void 0:M.map(A=>A.visible&&g.jsxs("th",{className:$.headerCell,draggable:!0,onDragStart:T=>{T.dataTransfer.setData("text/plain",A.name)},style:{width:m[A.name],minWidth:m[A.name],maxWidth:m[A.name]},children:[g.jsx(_e,{variant:"title",bindValue:A.title}),g.jsx("div",{className:$.resizer,onMouseDown:T=>b(T,A.name),role:"region"})]},A.name)))})]}),g.jsx("tbody",{...E,children:w.map(({item:A,index:T,offsetTop:k})=>{const j=A.rowId||A.value||`${A.isGroup?"group":"row"}-${T}`;return A.isGroup?g.jsx(Ys,{label:A.value||"",rowHeight:e,offsetTop:k,level:A.level,onClick:()=>{const D=A.rowId;D&&u(C=>Us(C,D))},isExpanded:A.isExpanded},`group-${j}`):g.jsx(Fr,{row:A,columnWidths:m,rowHeight:e,offsetTop:k,isGroup:!1},`row-${j}`)})}),g.jsx(Gs,{columns:i.columns,columnWidths:m})]})})},zs=({data:r,Type:e,ShowSubmit:t=!1,SubmitPosition:n="Right",DefaultValue:s,Label:a,LabelPosition:i="Left",onBlur:o,onClick:l,onOptionsRequest:c})=>{const[f,u]=R.useState();R.useEffect(()=>{u(()=>{if(!r)return;const y={...r};return e&&(y.shape=e),y.shape==null&&(y.shape=te.TEXT_FIELD),s&&(y.obj=Sn(s)),y})},[r,s,e]);const m={container:`smp-field-container ${ce(t)?`smp-field-position-${n}`:""}`},p=()=>{ce(t)||o==null||o(f)};if(f)return g.jsxs("div",{className:m.container,children:[g.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:g.jsx(Oe,{...f,id:"FLD",onChange:u,onOptionsRequest:c,fun:r==null?void 0:r.fun,onBlur:p,label:a,labelPosition:i})}),ce(t)&&g.jsx(Se,{optionalDisplayValue:"Confirm",onClick:()=>l==null?void 0:l(f),bindValue:"Confirm"})]})},Js=r=>(r==null?void 0:r.type)==="SmeupDataTree",Xs=r=>(r==null?void 0:r.type)==="SmeupDataTable",Zs=r=>Js(r)?r.children?r.children.map(e=>({id:e.obj.k,label:e.value??""})):[]:Xs(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}}):[],Qs=({data:r,id:e,readOnly:t=!1,hiddenSubmitButton:n=!1,updateOnClick:s=!1,decimalSeparator:a=".",optionsHandler:i,onSubmit:o,onCheck:l,onCheckObj:c,onContextMenu:f,onButtonClick:u})=>{var M,A;const[d,m]=R.useState({}),{translate:p}=je(),y=R.useId();R.useEffect(()=>{m(E(r))},[r]);const x=(T,k)=>{if(m(j=>({...j,[T]:{...j[T],obj:{...j[T].obj,k:k.obj.k},decode:k.decode,data:{...j[T].data,error:void 0},value:k.obj.k}})),s&&(k.shape==te.CHECKBOX||k.shape==te.SWITCH)){const j=structuredClone(d);j[T].obj.k=k.obj.k,j[T].value=k.obj.k,o({value:b(j),cell:T})}},O=T=>{const k=b(d);o({value:k,cell:T})},w=(T,k)=>{u==null||u({cellId:T,currentState:{type:"SmeupDataTable",columns:r.columns,rows:[{cells:d}]},fun:k||""})},S=async T=>{var k,j;if(d[T].obj.k!=r.rows[0].cells[T].obj.k&&((k=d[T].inputSettings)!=null&&k.checkObject&&c&&((await c({obj:d[T].obj,fun:d[T].fun,cellId:T})).valid||m(C=>({...C,[T]:{...C[T],data:{...C[T].data,error:p(Te.CHECK_OBJECT_WRONG_VALIDATION)}}}))),(j=d[T].inputSettings)!=null&&j.checkValueOnExit)){const D=b(d);l==null||l({value:D,cell:T})}},E=T=>{var j,D,C;if(!((j=T.rows)!=null&&j.length)||!((D=T.columns)!=null&&D.length))return{};const k=(C=T.rows)==null?void 0:C[0];return T.columns.filter(V=>V.visible??!0).reduce((V,I)=>{const Y={...k.cells[I.name],id:I.name,label:I.title,dSep:a,data:{...k.cells[I.name].data,dSep:a}};return Y.isEditable==null&&(Y.isEditable=!0),t&&(Y.isEditable=!1),Y.isEditable&&Y.shape==null&&(Y.shape=te.TEXT_FIELD),{...V,[I.name]:Y}},{})},b=T=>({before:r,after:{type:"SmeupDataTable",columns:JSON.parse(JSON.stringify(r.columns)),rows:[{cells:JSON.parse(JSON.stringify(T))}]}}),$=((A=(M=r.setup)==null?void 0:M.commands)==null?void 0:A.map((T,k)=>R.createElement(Oe,{...T,decode:T.value,data:{label:T.value},id:`command-${k}`,key:`command-${k}`,shape:te.BUTTON,onClick:()=>O(T.obj.k)})))||[];return n||$.unshift(g.jsx(Oe,{decode:p(Te.CONFIRM_BUTTON),shape:te.BUTTON,id:"",obj:{t:"",p:"",k:""},data:{submit:!0,label:p(Te.CONFIRM_BUTTON)}},"submit-command")),d&&g.jsxs("form",{"data-component":"input-panel",id:e||y,onSubmit:T=>{T.preventDefault(),O()},children:[g.jsx("div",{style:{padding:"1em 0"},children:g.jsx(rt,{layout:r.rows[0].layout,children:Object.values(d).map(T=>g.jsx(Oe,{...T,onOptionsRequest:T.fun?async(k,j)=>Zs(await i(k,j,r,T.id)):void 0,onChange:k=>x(T.id,k),onBlur:()=>S(T.id),onContextMenu:f,onClick:()=>{T.shape=="BTN"&&w(T.id,T.fun)},data:{...T.data,autocomplete:"off"}}))})}),$.length>0&&g.jsx(rt,{layout:{sections:[{id:"1",horizontal:!0,justify:"start",content:$.map(T=>({id:T.props.id}))}]},children:$})]})};exports.AppBar=js;exports.Autocomplete=Ct;exports.Button=Se;exports.ButtonList=Pr;exports.Checkbox=Ar;exports.Combobox=Ir;exports.DashList=ks;exports.DataTableComponent=qs;exports.DatePicker=Nr;exports.Drawer=Cs;exports.Field=zs;exports.Icon=oe;exports.InputPanel=Qs;exports.Password=Mr;exports.TabBar=Dr;exports.Textfield=we;exports.configurePaths=yn;
48
+ ${y?"smp-datepickercalendar-td-focused":""}
49
+ ${_?"smp-datepickercalendar-td-disabled":""}`},Z=()=>`${E[f]} ${d.toString()}`;return m.jsxs("div",{className:z.wrapper,ref:s,role:"dialog",tabIndex:-1,"aria-modal":"true","data-component":"datepicker-calendar",children:[m.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"16px"},children:[m.jsx(be,{onClick:$,ariaLabel:a(Tt.PREVIOUS_MONTH),optionalDisplayValue:"<",appearance:"ghost",variant:"base",bindValue:"<"}),m.jsx("div",{"aria-label":Z(),className:z.label,children:Z()}),m.jsx(be,{onClick:w,ariaLabel:a(Tt.NEXT_MONTH),bindValue:">",optionalDisplayValue:">",appearance:"ghost",variant:"base"})]}),m.jsxs("table",{ref:S,role:"grid","aria-label":`${a(Se.CALENDAR_FOR)} ${E[f]} ${d}`,className:z.table,children:[m.jsx("thead",{children:m.jsx("tr",{children:C.map(V=>m.jsx("th",{scope:"col",abbr:V.full,className:z.th,children:V.value},V.value))})}),m.jsx("tbody",{children:H.map((V,h)=>m.jsx("tr",{children:V.map((y,_)=>{const k=h*7+_;if(y===null)return m.jsx("td",{className:z.td(!1,!1,!1,!0)},`empty-${_}`);const j=y.getDate()===o.getDate()&&y.getMonth()===o.getMonth()&&y.getFullYear()===o.getFullYear(),I=l&&y.getDate()===l.getDate()&&y.getMonth()===l.getMonth()&&y.getFullYear()===l.getFullYear(),U=p===y.getDate(),W=x(y);return m.jsx("td",{role:"gridcell","aria-selected":I,tabIndex:U?0:-1,onClick:()=>v(y),onKeyDown:Y=>A(Y,k),"aria-label":`${y.getDate()} ${E[y.getMonth()]} ${y.getFullYear()}`,"data-selected":I,"aria-disabled":W,ref:Y=>{R.current[k]=Y},className:z.td(j,I,U,W),children:y.getDate()},`day-${_}`)})},`week-${h}`))})]})]})}const Nn=({bindValue:n,placeholder:e,onChange:t,disabledDateRanges:r,isEditable:s=!0,...a})=>{const i=T.useRef(null),[o,l]=T.useState(!1),[c,f]=T.useState(n||""),[u,d]=T.useState(""),{anchorRef:g,targetRef:p}=lt({position:"bottom",enabled:o}),b=T.useCallback(()=>{l(!1),i?.current?.focus()},[]);ut([p,g],o,()=>{b()}),$t(o,p);const{format:S,getCurrentLanguage:R}=Oe(),E=T.useCallback(P=>{const O=P.length>5&&vr(P,R())||P,A=S(O,void 0,void 0,{type:"date"}),L=typeof O!="string",M=L&&O.toISOString().substring(0,10)||"";return{isValid:L,formattedDate:A,isoDate:M,normalizedDate:O}},[R,S]);T.useEffect(()=>{const{formattedDate:P,isoDate:O,isValid:A}=E(n);f(A&&O||n),d(A&&P||n)},[n,S,E]);const C=()=>l(P=>!P),x=()=>{$(u)},v=P=>{$(P),b()},$=P=>{const{isoDate:O,isValid:A}=E(P);t&&t(A&&O||P)},w=P=>{d(P)},D=P=>{P.key==="Enter"&&(P.preventDefault(),$(u))};return m.jsxs("div",{"data-component":"date-picker",children:[m.jsx(ve,{...a,bindValue:u,placeholder:e,onBlur:x,onChange:w,onKeyDown:D,shapeIcon:"calendar",onShapeIconClick:C,ref:g,inputRef:i,isEditable:s,size:10,maxLength:a.maxLength?a.maxLength:10}),o&&m.jsx(ct,{children:m.jsx(fs,{disabledDateRanges:r,onDateChange:v,initialValue:_t(c)&&c||"",targetRef:p})})]})},ds=({elements:n,displayMode:e,minimumChars:t,listDisplayMode:r,isEditable:s=!0,placeholder:a,label:i,disabled:o,fun:l,error:c,onOptionsRequest:f,onChange:u,onBlur:d})=>{const g=n.map(S=>S.bindValue),p=(S,R)=>{const E=[...n];if(S=="")E.pop();else{const C=E.findIndex(x=>x.bindValue===S&&x.optionalDisplayValue===R);C>=0?E.splice(C,1):E.push({bindValue:S,optionalDisplayValue:R})}u?.(E)},b={container:"smp-multipleAutocomplete-container"};return m.jsxs("div",{className:b.container,"data-component":"multiple-autocomplete",children:[i&&m.jsx(Te,{label:i,disabled:o}),m.jsx(kt,{elements:n,displayMode:e,isEditable:s,onChange:S=>{u?.(S)}}),m.jsx(jt,{bindValue:"",fun:l,isEditable:s,onChange:p,_changeOnEnter:!0,listDisplayMode:r,minimumChars:t,placeholder:a,onOptionsRequest:f,_multiActiveIndex:g,error:c,onBlur:d})]})},Mn=({...n})=>{const[e,t]=T.useState(!1),r=e?"visibility-off":"visibility";return m.jsx(ve,{...n,inputType:e?"text":"password",shapeIcon:r,onShapeIconClick:()=>t(!e),ariaLabel:"password","data-component":"password"})},ps=({...n})=>{const[e,t]=T.useState(n.bindValue),{translate:r}=Oe(),s=a=>{a.key==="Enter"&&(a.preventDefault(),n.onEnter?.(e))};return m.jsx(ve,{...n,placeholder:n.placeholder?n.placeholder:r(Se.SPOTLIGHT_DEFAULT_PLACEHOLDER),icon:"magnify",inputType:"search",bindValue:e,onChange:t,onKeyDown:s,ariaLabel:"search bar",_dataComponent:"search-bar"})},hs=({bindValue:n,optionalDisplayValue:e,label:t})=>{const r={wrapper:"smp-text-wrapper"};return t?m.jsxs("div",{className:r.wrapper,children:[m.jsx(Te,{label:t}),m.jsx(Ee,{variant:"body",bindValue:e||n})]}):m.jsx(Ee,{variant:"body",bindValue:e||n})};class Ce{class;value;constructor(e,t){this.class=e,this.value=t}static fromDataObj(e){return new Ce(e,e.k==""?[]:e.k.split(";"))}static fromString(e){return new Ce({t:"",p:""},e.split(";"))}getValue(){return this.value}getLegacyValue(){return this.value.join(";")}}const ke=(n,e,t)=>({obj:{t:n.obj.t,p:n.obj.p,k:e},decode:t??n.decode,shape:n.shape,fun:n.fun}),xn=n=>{const e=Ce.fromDataObj(n.obj),t=n.decode?Ce.fromString(n.decode).getValue():[];return e.getValue().map((r,s)=>({bindValue:r,optionalDisplayValue:t.length>=s?t[s]:""}))},ms=(n,e)=>{const t=new Ce(n.obj,e.map(s=>s.bindValue)).getLegacyValue(),r=new Ce(n.obj,e.map(s=>s.optionalDisplayValue?s.optionalDisplayValue:"")).getLegacyValue();return ke(n,t,r)},gs=n=>{switch(n){case"CodeOnly":return 15;case"Both":case"CodeAndDesc":case"DescAndCode":return 50;case"DescOnly":default:return 35}},ys=({min:n,max:e,step:t=1,inputMode:r="decimal",dSep:s,bindValue:a,onChange:i,onEnter:o,...l})=>{const{getCurrentLanguage:c}=Oe(),f=T.useRef(null),u=c(),{groupingChar:d,decimalChar:g}=T.useMemo(()=>ts(u,s),[u,s]),p=T.useCallback((L,M)=>new Intl.NumberFormat(u,{minimumFractionDigits:M,maximumFractionDigits:M,useGrouping:!0}).format(L),[u]),b=T.useCallback(ss,[d,g]),S=T.useCallback(es,[n,e]),R=a!=null&&a.toString().includes(".")?a.toString().split(".")[1].length:0,[E,C]=T.useState(R),[x,v]=T.useState(a!=null?p(a,E):""),$=T.useRef(a??null);T.useEffect(()=>{if(a==null){v(""),$.current=null;return}const L=a.toString().includes(".")?a.toString().split(".")[1].length:0,M=L===0?E:L;M!==E&&C(M),v(p(a,M)),$.current=a},[a,p]);const w=T.useCallback((L,M=!1)=>{if(L.trim()===""){v(""),$.current=null,i?.(void 0,""),M&&o?.(void 0);return}const N=b(L,d,g);if(isNaN(N))if($.current!=null){const H=p($.current,E);v(H)}else v("");else{const H=S(N,n,e),G=rs(L,d,g);C(G);const z=p(H,G);v(z),$.current=H,i?.(H,z),M&&o?.(H)}},[b,d,g,S,n,e,p,i,o,E]),D=L=>v(L),P=()=>w(x),O=L=>{if(L.key==="Enter"){L.preventDefault(),w(x,!0);return}if(L.key==="ArrowUp"||L.key==="ArrowDown"){L.preventDefault();const M=L.key==="ArrowUp"?1:-1,N=$.current??0,H=S(N+M*t,n,e);w(p(H,E))}},A=L=>{if(!L.currentTarget.contains(document.activeElement))return;L.preventDefault();const M=L.deltaY<0?1:-1,N=$.current??0,H=S(N+M*t,n,e);w(p(H,E))};return m.jsx("div",{ref:f,"data-component":"input-number",onWheel:A,children:m.jsx(ve,{...l,"aria-valuemin":n,"aria-valuemax":e,"aria-valuenow":$.current??void 0,bindValue:x,inputType:"text",inputMode:r,min:n,max:e,step:t,onChange:D,onBlur:P,onKeyDown:O})})};class Ue{class;value;decimalSeparator;constructor(e,t,r="."){this.class=e,this.value=t,this.decimalSeparator=r}static fromDataObj(e,t){const r=t==="."?",":".";if(e.k=="")return new Ue(e,void 0,t);const s=e.k.replace(new RegExp(`\\${r}`,"g"),""),a=parseFloat(s.replace(t,"."));return new Ue(e,a,t)}getLegacyValue(){return this.value!=null?this.value.toString().replace(".",this.decimalSeparator):""}getValue(){return this.value}}const bs=({disabled:n,bindValue:e,onChange:t,placeholder:r,state:s,appearance:a,isEditable:i,label:o,ariaLabel:l,helperText:c,error:f,onBlur:u,onKeyDown:d,rows:g=10,cols:p=35})=>{const b=T.useId(),S=`${b}-helper`,R=f?"danger":s,E=c||!!f,C=v=>{t?.(v.target.value)},x={wrapper:"smp-textarea-wrapper",container:`smp-textarea ${n?"smp-textarea-disabled":""} ${r?"smp-textarea-placeholder":""} ${R?`smp-textarea-${R}`:""} ${a?`smp-textarea-${a}`:""} ${i?"":"smp-textarea-readOnly"}`};return m.jsxs("div",{className:x.wrapper,"data-component":"textarea",children:[o&&m.jsx(Te,{htmlFor:b,label:o,disabled:n}),m.jsx("textarea",{id:b,value:e,placeholder:r,onChange:C,onBlur:u,className:x.container,disabled:n,readOnly:!i,onKeyDown:d,"aria-label":o?void 0:l,"aria-labelledby":o?b:void 0,"aria-describedby":E?S:void 0,rows:g,cols:p}),E&&m.jsx(Dn,{id:S,helperText:f,disabled:n,state:R})]})};var Ot=(n=>(n.PAGE_DIRECTION="pageDirection",n.LINE_DIRECTION="lineDirection",n))(Ot||{});const Me={"smp-radio":"_smp-radio_1wj31_1","smp-radio-options-container":"_smp-radio-options-container_1wj31_10","smp-radio-horizontal":"_smp-radio-horizontal_1wj31_16","smp-radio-element":"_smp-radio-element_1wj31_20","smp-radio-disabled":"_smp-radio-disabled_1wj31_26"},vs=({disabled:n=!1,displayMode:e="DescOnly",RadLay:t=Ot.PAGE_DIRECTION,options:r,onOptionsRequest:s,fun:a,label:i,...o})=>{const[l,c]=T.useState(r),f=T.useId();T.useEffect(()=>{!l&&s&&a&&s(a,void 0).then(b=>c(b)).catch(b=>{console.error("Error during loading options (radio)",b)})},[l,s,a]);const u={container:Me["smp-radio"],optionsContainer:`${Me["smp-radio-options-container"]} ${t==Ot.LINE_DIRECTION?Me["smp-radio-horizontal"]:""}`,option:`${Me["smp-radio-element"]} ${n?Me["smp-radio-disabled"]:""}`},d=()=>{n||o.onBlur?.()},g=b=>{n||o.onChange?.(b.id,b.label)},p=T.useId();return m.jsxs("div",{"smp-id":"radio-container",className:u.container,id:f,children:[i&&m.jsx(Te,{label:i,disabled:n,htmlFor:f}),m.jsx("div",{className:u.optionsContainer,children:l?.map((b,S)=>m.jsxs("label",{className:u.option,children:[m.jsx("input",{type:"radio",name:p,value:b.id,disabled:n,checked:b.id===o.bindValue,onChange:()=>g(b),onBlur:d}),m.jsx(Ee,{variant:"body",bindValue:Le(b.id,b.label,e)})]},S))})]})},xs=({value:n,onChange:e,targetRef:t,isOpen:r})=>{const s=T.useRef(null);T.useEffect(()=>{r&&s?.current&&s.current.focus()},[r,s]);const[a,i,o]=n,l=c=>Array.from({length:c},(f,u)=>m.jsx("option",{value:u,children:u.toString().padStart(2,"0")},u));return m.jsxs("div",{className:"smp-timepicker-widget",ref:t,children:[m.jsx("select",{value:a,ref:s,onChange:c=>e(+c.target.value,i,o),id:"time-picker-hours",children:l(24)}),":",m.jsx("select",{value:i,onChange:c=>e(a,+c.target.value,o),id:"time-picker-minutes",children:l(60)}),":",m.jsx("select",{value:o||0,onChange:c=>e(a,i,+c.target.value),id:"time-picker-seconds",children:l(60)})]})},Sn=n=>{const e=n.match(/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?$/);if(!e)return!1;const[,t,r,s]=e,a=parseInt(t,10),i=parseInt(r,10),o=s?parseInt(s,10):0;return a>=0&&a<=23&&i>=0&&i<=59&&(s===void 0||o>=0&&o<=59)},Ss=n=>{const e=n.split(":").map(t=>parseInt(t,10));return[e[0]||0,e[1]||0,e[2]||0]},ws=(n,e,t)=>{const r=n!=null&&!isNaN(n)?n.toString().padStart(2,"0"):"",s=e!=null&&!isNaN(e)?e.toString().padStart(2,"0"):"",a=t!=null&&!isNaN(t)?t.toString().padStart(2,"0"):"";return r&&s?`${r}:${s}:${a}`:s?`${s}:${a}`:a},Es=({bindValue:n,placeholder:e="HH:MM:SS",onChange:t,isEditable:r=!0,...s})=>{const a=T.useRef(null),[i,o]=T.useState(!1),[l,c]=T.useState(n||""),[f,u]=T.useState(""),{anchorRef:d,targetRef:g}=lt({position:"bottom",enabled:i}),p=T.useCallback(()=>{o(!1),a?.current?.focus()},[]);ut([g,d],i,()=>o(!1)),$t(i,g),T.useEffect(()=>{const v=n||"",$=Sn(v)?v:n||"";c(v),u($)},[n]),T.useEffect(()=>{const v=$=>{$.key==="Escape"&&o(!1)};return i&&document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}},[i]);const b=()=>{r&&o(v=>!v)},S=v=>{u(v)},R=(v,$,w)=>{const D=ws(v,$,w);c(D),u(D),t?.(D),p()},E=()=>{x(f)},C=v=>{v.key==="Enter"&&(v.preventDefault(),x(f))},x=v=>{if(v.trim()===""){c(""),u(""),t?.("");return}Sn(v)?(c(v),u(v),t?.(v)):u(v)};return m.jsxs("div",{"data-component":"time-picker",children:[m.jsx(Dt,{...s,bindValue:f,placeholder:e,onChange:S,onBlur:E,onKeyDown:C,shapeIcon:"clock",onShapeIconClick:b,isEditable:r,ref:d,inputRef:a}),i&&m.jsx(ct,{children:m.jsx(xs,{value:Ss(l),onChange:R,targetRef:g,isOpen:i})})]})};function Cs(n){return typeof n=="string"&&/^\d{6}$/.test(n)}class it{class;time;constructor(e,t){this.class=e,this.time=t}static fromDataObj(e){const t=wn.get(`${e.t}${e.p}`);if(t)return new it(e,t.legacyToIso(e.k));throw new Error(`time creation from ${e.t}${e.p} not implemented yet`)}getLegacyValue(){const e=wn.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 wn=new Map([["I12",{legacyToIso(n){return Cs(n)&&`${n.substring(0,2)}:${n.substring(2,4)}:${n.substring(4,6)}`||n},isoToLegacy(n){return n.replaceAll(":","")||n}}]]),Ts={"smp-cell-wrapper":"_smp-cell-wrapper_mdlkz_1"},we=({decode:n,shape:e,obj:t,data:r,icon:s,fun:a,placeholderIcon:i,label:o,tooltip:l,options:c,onChange:f,onClick:u,onEnter:d,onBlur:g,onOptionsRequest:p,onContextMenu:b,isEditable:S,dSep:R="."})=>{const E={obj:t,shape:e,decode:n,icon:s,fun:a,data:r},C={onBlur:g,onOptionsRequest:p,fun:a,icon:s,tooltip:l,label:o,isEditable:S,size:E.data&&E.data.size?E.data.size:E.data?.displayMode&&gs(E.data.displayMode||"CodeOnly"),...r},x=(O,A,L)=>gr(t)?ke(O,new rt(t,A).getLegacyValue()):yr(t)?ke(O,new it(t,A).getLegacyValue()):ke(O,A,L),v=(O,A)=>ke(O,new Ue(t,A,R).getLegacyValue()),$=O=>ke(E,new nt(t,O).getLegacyValue()),w=O=>ms(E,O),D=()=>{switch(e){case te.AUTOCOMPLETE:{const O={...C,bindValue:t.k,optionalDisplayValue:n,onChange:(A,L)=>{f?.(x(E,A,L))}};return m.jsx(jt,{...O})}case te.BUTTON:{const O={...C,bindValue:t.k,optionalDisplayValue:r?.label&&typeof r.label=="string"?r.label:void 0,title:n,onClick:()=>{u?.(x(E,t.k))}};return m.jsx(be,{...O})}case te.BUTTON_LIST:{const O={...C,options:c,onClick:(A,L)=>{const M={...E,fun:L};u?.(x(M,A))}};return m.jsx(Pn,{...O})}case te.CHIP:{const O={...C,elements:xn(E)};return m.jsx(kt,{...O})}case te.CHECKBOX:case te.SWITCH:{const O=e===te.SWITCH,A={...C,bindValue:nt.fromDataObj(t).getValue(),optionalDisplayValue:n,onChange:L=>{f?.($(L))},...O&&{variant:"switch"}};return m.jsx(An,{...A})}case te.COMBOBOX:{const O={...C,bindValue:t.k,optionalDisplayValue:n,onChange:(A,L)=>{f?.(x(E,A,L))}};return m.jsx(In,{...O})}case te.DATE:{const O={...C,bindValue:rt.fromDataObj(t).getValue(),onChange:A=>{f?.(x(E,A))}};return m.jsx(Nn,{...O})}case te.ICON:case te.IMAGE:{const O={...C,icon:s,placeholderIcon:i,isInteractable:!!C.fun,onClick:()=>{u?.(x(E,t.k))}};return m.jsx(ie,{...O})}case te.INPUT_NUMBER:{const O={...C,bindValue:Ue.fromDataObj(t,R).getValue(),onChange:A=>{f?.(v(E,A))}};return m.jsx(ys,{...O})}case te.EDITOR:case te.MEMO:{const O={...C,bindValue:t.k,optionalDisplayValue:n,onChange:A=>{f?.(x(E,A))}};return m.jsx(bs,{...O})}case te.MULTI_AUTOCOMPLETE:{const O={...C,elements:xn(E),onChange:A=>{f?.(w(A))}};return m.jsx(ds,{...O})}case te.PASSWORD:{const O={...C,bindValue:t.k,onChange:A=>{f?.(x(E,A))}};return m.jsx(Mn,{...O})}case te.RADIO:{const O={...C,bindValue:t.k,onChange:(A,L)=>{f?.(x(E,A,L))}};return m.jsx(vs,{...O})}case te.SPOTLIGHT:{const O={...C,bindValue:t.k,onEnter:A=>{d?.(x(E,A))}};return m.jsx(ps,{...O})}case te.TEXT_FIELD:{const O={...C,bindValue:t.k,optionalDisplayValue:n,onChange:A=>{f?.(x(E,A))}};return m.jsx(ve,{...O})}case te.TIME:{const O={...C,bindValue:it.fromDataObj(t).getValue(),onChange:A=>{f?.(x(E,A))}};return m.jsx(Es,{...O})}default:{const O={...C,bindValue:t.k,optionalDisplayValue:n};return m.jsx(hs,{...O})}}},P={wrapper:`${Ts["smp-cell-wrapper"]}`};return m.jsx("span",{className:P.wrapper,onContextMenu:O=>{b&&l&&(O.preventDefault(),b(E,O.currentTarget))},children:D()})},Os=({data:n,onClick:e,onEnter:t,onContextMenu:r})=>{const[s,a]=T.useState(),i=T.useCallback(o=>{if(!o.rows?.length||!o.columns?.length)return{};const l=o.rows[0];return o.columns.filter(c=>c.visible).reduce((c,f)=>{const u=l.cells[f.name],d={...u,id:f.name,onChange:g=>{a(p=>p&&{...p,[f.name]:{...p[f.name],obj:{...p[f.name].obj,k:g.obj.k}}})},onClick:()=>{u.fun&&e&&e({...u})},onEnter:g=>{t&&t(g)},onContextMenu:(g,p)=>{r&&r(g,p)}};return{...c,[f.name]:d}},{})},[e,t,r]);return T.useEffect(()=>{n&&a(i(n))},[n,i]),!n?.rows?.length||!n.columns?.length?null:s&&m.jsx("header",{className:"smp-appbar","aria-label":"App Bar",children:m.jsx(tt,{layout:n.rows[0].layout,children:Object.values(s).map(o=>m.jsx(we,{...o}))})})},Rs=n=>n.children?.length?n.children.map(e=>({id:e.obj?.k??"",label:e.decode??e.value??e.obj?.k??"",fun:e.fun,icon:e.icon})):[],ce=n=>n==null?!1:typeof n=="string"?n.toLocaleLowerCase()=="yes":n,_s=({data:n,logo:e,open:t,minifiedOnClose:r=!0,customHeight:s="100vh",onClick:a,onEnter:i,onClose:o,loadOptions:l,onContextMenu:c})=>{const[f,u]=T.useState(),[d,g]=T.useState(t??!0),p=T.useRef(null),b=s.trim()?s:"100vh",S=T.useCallback(x=>{if(!x?.rows?.length||!x?.columns?.length)return{};const v=x.rows[0];return x.columns.filter($=>$.visible??!0).reduce(($,w)=>{const D=v.cells[w.name];if(!D||!d&&ce(r)&&D.shape!==te.BUTTON&&D.shape!==te.BUTTON_LIST)return $;const P={...D,id:w.name,onChange:O=>{u(A=>{const L={...A};return L?.[w.name]&&(L[w.name].obj.k=O.obj.k),L})},onClick:O=>{O.fun&&a&&a(O)},onEnter:O=>{i&&i(O)},onContextMenu:(O,A)=>{c&&c(O,A)}};return l&&D.shape==te.BUTTON_LIST&&(P.onOptionsRequest=(O,A)=>l(O,A).then(L=>Rs(L))),!d&&ce(r)&&(P.data={...P.data,showText:!1,justify:"center",squared:!0}),{...$,[w.name]:P}},{})},[d,r,a,i,l,c]),R=T.useCallback(()=>{o?.()},[o]),E=()=>{ce(r)?g(x=>!x):(g(!1),o?.())};if(T.useEffect(()=>{u(S(n))},[n]),T.useEffect(()=>{if(!p.current)return;if(!ce(r)){u(S(n));return}const x=getComputedStyle(p.current).getPropertyValue("--smp-drawer-slide-transition");let v=Number(x);x.endsWith("ms")?v=parseFloat(x):x.endsWith("s")&&(v=parseFloat(x)*1e3),setTimeout(()=>{u(S(n))},v/2)},[d,r]),T.useEffect(()=>{t!==void 0&&!ce(r)&&g(t)},[r,t]),!n?.rows?.length||!n.columns?.length)return null;const C={drawer:`smp-drawer ${ce(r)?"smp-drawer-minified":"smp-drawer-fixed"} ${d?"smp-drawer-open":""} ${!ce(r)&&!d?"smp-drawer-no-border":""}`,container:"smp-drawer-container",containerHeader:"smp-drawer-container-header",containerIcon:`${d?"":"smp-drawer-container-icon-close"} smp-drawer-container-icon`,containerLayout:"smp-drawer-container-layout",containerLogo:"smp-drawer-container-logo",backdrop:`smp-drawer-backdrop ${d?"smp-drawer-backdrop-open":""}`};return f&&m.jsxs(m.Fragment,{children:[!ce(r)&&m.jsx("div",{"aria-hidden":"true","aria-label":"drawer-backdrop",className:C.backdrop,onClick:R}),m.jsx("aside",{ref:p,className:C.drawer,style:{height:b},"aria-label":"Drawer","smp-id":"drawer",children:m.jsxs("div",{className:C.container,children:[m.jsxs("div",{className:C.containerHeader,children:[e&&m.jsx("div",{className:C.containerLogo,children:m.jsx(ie,{icon:e,title:"drawer_logo",width:"100%",height:24})}),m.jsx("div",{className:C.containerIcon,children:m.jsx(ie,{icon:ce(r)?"menu_close":"close",title:"drawer_icon",rotated:!d,isInteractable:!0,onClick:E,width:20,height:20})})]}),m.jsx("div",{className:C.containerLayout,children:m.jsx(tt,{layout:n.rows[0].layout,children:Object.values(f).map(x=>m.jsx(we,{...x}))})})]})})]})},Ds=({ColumnsNumber:n=1,data:e={},ForceText:t,TextColName:r,TextColor:s="var(--smp-dashList-color-base)",Fillspace:a,FontSize:i,Horizontal:o,ForceIcon:l,IconColName:c,IconColor:f="var(--smp-dashList-color-base)",NumberFormat:u,ForceUM:d,UmColName:g,UmColor:p="var(--smp-dashList-color-base)",ForceValue:b,ValueColName:S,ValueColor:R="var(--smp-dashList-color-base)",SelectLayout:E="1",onClick:C})=>{const x="N/A",v=e?.columns||[],$=e?.rows||[],w=$.length>0,D="--smp-dashList-color",P="smp-layout",O="descr",A="icon",L="um",M="value",N=i||"1em",H="18px",G="--smp-dashList-columns",z="--smp-dashList-fontSize",Z={dash:(B="1")=>{const X=h(B),ne=X,se=y(X,O),Re=y(X,A),Pe=y(X,L),pe=y(X,M);return{container:ne,descr:se,icon:Re,um:Pe,value:pe}},dashList:`smp-dash-list ${ce(a)?"smp-dash-list-fill-space":""}
50
+ ${ce(o)?"smp-dash-list-horizontal":""}`},{format:V}=Oe(),h=B=>`${P}-${B}`,y=(B,X)=>`${B}__${X}`,_=B=>`${D}-${B}`,k=B=>{const X=/R(\d{1,3})G(\d{1,3})B(\d{1,3})/;if(X.test(B)){const se=B.match(X)||[];if(se?.length>3)return"rgb("+se[1]+","+se[2]+","+se[3]+")"}return B},j=B=>{if(!u)return B;const[X,ne]=I(u).map(_e=>parseInt(_e||"0")),se="0,0"+(ne?"."+"0".repeat(ne):""),Re=V(B,se,"it");if(!X)return Re;const[Pe,pe]=Re.split(",");return Pe+(pe?`,${pe}`:"")},I=B=>B.includes(";")?B.split(";"):[B],U=B=>{const X=se=>{if(se)return B?.cells[se]?.obj.k},ne=se=>{if(!(v.length<=se))return B?.cells[v[se].name]?.obj?.k};return{descr:t||X(r)||ne(2)||"",icon:l||X(c)||ne(3)||"",um:d||X(g)||ne(1)||"",value:b||X(S)||ne(0)||""}},W=B=>{C?.(B)},Y=(B,X)=>{(B.key==="Enter"||B.key===" ")&&(B.preventDefault(),B.stopPropagation(),W(X))},K=(B=>{const X=Z.dash(B);return{className:X,descr:ne=>m.jsx("div",{className:X.descr,children:ne},`${B}-${O}`),icon:ne=>m.jsx("div",{className:X.icon,children:m.jsx(ie,{color:f,height:H,icon:ne,width:H})},`${B}-${A}`),um:ne=>m.jsx("div",{className:X.um,children:ne},`${B}-${L}`),value:ne=>m.jsx("div",{className:X.value,children:ne},`${B}-${M}`)}})(E),re=B=>{const{descr:X,icon:ne,um:se,value:Re}=U(B),Pe={[_(O)]:k(s),[_(L)]:k(p),[_(M)]:k(R)},pe=[],_e=j(Re);switch(E){case"2":ne&&pe.push(K.icon(ne)),pe.push(K.descr(X)),pe.push(K.value(se?_e+" "+se:_e));break;default:case"1":pe.push(K.descr(X)),pe.push(K.value(se?_e+" "+se:_e))}return m.jsx("div",{className:K.className.container,role:"button",style:Pe,tabIndex:0,onClick:()=>W(B),onKeyDown:Vn=>Y(Vn,B),children:pe},B.rowId)},F={[G]:String(n),[z]:N};return m.jsx("div",{className:Z.dashList,style:F,children:w?$.map(B=>re(B)):x})},Ze={"smp-table":"_smp-table_1qmju_1","smp-headerCell":"_smp-headerCell_1qmju_35","smp-resizer":"_smp-resizer_1qmju_44"},js="_rowContent_20wit_2",ks="_clickable_20wit_21",$s="_indent_20wit_26",Ls="_toggle_20wit_32",Ps="_cell_20wit_38",As="_leftSection_20wit_46",xe={rowContent:js,clickable:ks,indent:$s,toggle:Ls,cell:Ps,leftSection:As};function Qe(n){return!!n&&"children"in n}function Is(n){return!Qe(n)}function Ns(n){const e=JSON.stringify(n,Object.keys(n).sort());let t=0,r,s;if(e.length===0)return t.toString();for(r=0;r<e.length;r++)s=e.charCodeAt(r),t=(t<<5)-t+s,t|=0;return Math.abs(t).toString()}const Fn=({row:n,columnWidths:e={},level:t=0,rowHeight:r=26,offsetTop:s})=>{const[a,i]=T.useState(!1),o=Qe(n)&&!!n.children?.length,l=n.cells&&Object.keys(n.cells).length>0,c=o,f=t*20,u=()=>{o&&i(!a)},d={content:`${xe.rowContent} ${o?xe.clickable:""}`,toggle:`${xe.toggle}`,indent:`${xe.indent}`,cell:`${xe.cell}`},g=E=>m.jsx(we,{...E}),p=()=>m.jsx("span",{className:d.toggle,children:c&&m.jsx(ie,{icon:a?"arrow_drop_right":"arrow_drop_down",width:16})}),b=()=>m.jsx("span",{className:d.indent,style:{width:`${f}px`},"aria-hidden":"true"}),S=()=>{const E=Is(n)?"":n.decode||(l?"":"Untitled"),C=s??r*t;return m.jsxs("tr",{className:d.content,onClick:u,role:o?"button":"row","aria-expanded":o?!a:void 0,style:{height:`${r}px`,lineHeight:`calc(${r}px - 2*2px)`,transform:`translateY(${C}px)`},children:[Qe(n)&&m.jsxs("td",{className:xe.leftSection,style:{height:`${r}px`},children:[b(),p(),m.jsx("span",{className:xe.rowLabel,children:E})]}),n.cells&&Object.keys(n.cells).length>0&&Object.entries(n.cells).map(([x,v])=>m.jsx("td",{className:d.cell,style:{width:e[x],minWidth:e[x],height:`${r}px`},children:g({...v,id:x})},Ns(v)||x))]})},R=()=>a||!o?null:m.jsx(m.Fragment,{children:Qe(n)&&n.children?.map((E,C)=>m.jsx(Fn,{row:E,level:t+1},`child-${C}`))});return m.jsxs(m.Fragment,{children:[S(),R()]})},Ms=({label:n,rowHeight:e=28,offsetTop:t=0,level:r=0,onClick:s,isExpanded:a})=>{const i={tr:"smp-groupRow-tr",td:"smp-groupRow-td"};return m.jsx("tr",{className:i.tr,style:{height:e,top:t,lineHeight:`${e}px`},onClick:s,children:m.jsxs("td",{className:i.td,style:{paddingLeft:10+r*20},children:[m.jsx(ie,{icon:a?"arrow_drop_down":"arrow_drop_right",width:16}),m.jsx(Ee,{variant:"title",bindValue:n})]})})};function Fs(n,e){const t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}function Vs(n,e){return n.map(t=>{const r=e.find(s=>s.column===t.bindValue);return{column:t.bindValue,visible:r?.visible??!0}})}function Ys(n,e,t,r){const s=[];let a=0;return i(n,0,[]),{flatRows:s,offset:a};function i(u,d,g){if(d>=e.length){f(u);return}const p=e[d].column,b=o(u,p);for(const[S,R]of b){const E=[...g,S],C=l(E,d),x=r.has(C);s.push(c(S,C,d,x)),a+=t,x&&i(R,d+1,E)}}function o(u,d){const g=new Map;for(const p of u){const b=p.cells[d]?.decode??"N/D";g.has(b)||g.set(b,[]),g.get(b).push(p)}return g}function l(u,d){return`group-${u.join("-")}-${d}`}function c(u,d,g,p){return{isGroup:!0,value:u,cells:{},rowId:d,level:g,isExpanded:p}}function f(u){for(const d of u)s.push(d),a+=t}}const Us=({groups:n=[],isDraggable:e=!0,isEditable:t=!0,onChange:r,onDrop:s,onDragOver:a})=>{const i=n.map(o=>({bindValue:o.column}));return m.jsxs("tr",{className:"smp-groupBar-container",onDragOver:a,onDrop:s,children:[m.jsx("td",{children:m.jsx(ie,{icon:"groups"})}),m.jsx("td",{children:m.jsx(kt,{elements:i,isEditable:t,isDraggable:e,displayMode:"CodeOnly",onChange:r})})]})},Ws=({columns:n,columnWidths:e})=>m.jsx("tfoot",{children:m.jsx("tr",{children:n.map(t=>t.visible&&m.jsx("td",{className:Ze["smp-headerCell"],style:{width:e[t.name],minWidth:e[t.name],maxWidth:e[t.name]}},t.name))})}),Bs=({columns:n,rows:e,containerRef:t,sizingMode:r})=>{const[s,a]=T.useState({});return T.useEffect(()=>{if(!(!n||n.length===0)){if(r==="fixed"){const o=Object.fromEntries(n.map(l=>[l.name,120]));a(o)}else if(r==="fit-grid"){const i=t.current?.offsetWidth||800,o=n.filter(f=>f.visible!==!1),l=i/o.length,c=Object.fromEntries(o.map(f=>[f.name,l]));a(c)}else if(r==="fit-content"){const i={};for(const o of n){if(!o.visible)continue;const l=o.title?.length||0,c=Math.max(...e.map(f=>`${f.cells?.[o.name]?.decode||f.cells?.[o.name]?.value||""}`.length),l);i[o.name]=c*8+24}a(i)}}},[n,e,t,r]),[s,a]},Hs=({data:n,lineHeight:e=28,TableHeight:t=400,groups:r,columnSizingMode:s="fixed",showGroupBar:a=!0})=>{const[i,o]=T.useState(n??{columns:[],rows:[]}),[l,c]=T.useState(r||[]),[f,u]=T.useState(new Set),d=T.useRef(null),[g,p]=Bs({columns:i?.columns??[],rows:i?.rows??[],containerRef:d,sizingMode:s});T.useEffect(()=>{if(l?.length&&n.rows){const{flatRows:w}=Ys(n.rows,l,e,f);o({...n,rows:w})}else o(n)},[n,l,f,e]);const b=w=>{c(Vs(w,l))},S=w=>{w.preventDefault();const D=w.dataTransfer.getData("text/plain");if(!D||l.some(A=>A.column===D))return;const O=[...l,{column:D,visible:!0}];c(O)},R=w=>{w.preventDefault()},{virtualItems:E,containerProps:C,innerProps:x}=jn({items:i?.rows??[],itemHeight:e,containerHeight:t,overscan:5}),v=(w,D)=>{const P=w.clientX,O=g[D],A=M=>{const N=M.clientX-P,H=Math.max(50,O+N);p(G=>({...G,[D]:H}))},L=()=>{window.removeEventListener("mousemove",A),window.removeEventListener("mouseup",L)};window.addEventListener("mousemove",A),window.addEventListener("mouseup",L)},$={smpTable:`${Ze["smp-table"]}`,headerCell:`${Ze["smp-headerCell"]}`,resizer:`${Ze["smp-resizer"]}`};return i&&m.jsx("div",{className:$.smpTable,...C,ref:d,children:m.jsxs("table",{children:[m.jsxs("thead",{children:[(r||a)&&m.jsx(Us,{groups:l,onChange:b,onDrop:S,onDragOver:R}),m.jsx("tr",{children:i.columns&&i.columns?.map(w=>w.visible&&m.jsxs("th",{className:$.headerCell,draggable:!0,onDragStart:D=>{D.dataTransfer.setData("text/plain",w.name)},style:{width:g[w.name],minWidth:g[w.name],maxWidth:g[w.name]},children:[m.jsx(Ee,{variant:"title",bindValue:w.title}),m.jsx("div",{className:$.resizer,onMouseDown:D=>v(D,w.name),role:"region"})]},w.name))})]}),m.jsx("tbody",{...x,children:E.map(({item:w,index:D,offsetTop:P})=>{const O=w.rowId||w.value||`${w.isGroup?"group":"row"}-${D}`;return w.isGroup?m.jsx(Ms,{label:w.value||"",rowHeight:e,offsetTop:P,level:w.level,onClick:()=>{const A=w.rowId;A&&u(L=>Fs(L,A))},isExpanded:w.isExpanded},`group-${O}`):m.jsx(Fn,{row:w,columnWidths:g,rowHeight:e,offsetTop:P,isGroup:!1},`row-${O}`)})}),m.jsx(Ws,{columns:i.columns,columnWidths:g})]})})},Gs=({data:n,Type:e,ShowSubmit:t=!1,SubmitPosition:r="Right",DefaultValue:s,Label:a,LabelPosition:i="Left",onBlur:o,onClick:l,onOptionsRequest:c})=>{const[f,u]=T.useState();T.useEffect(()=>{u(()=>{if(!n)return;const b={...n};return e&&(b.shape=e),b.shape==null&&(b.shape=te.TEXT_FIELD),s&&(b.obj=br(s)),b})},[n,s,e]);const g={container:`smp-field-container ${ce(t)?`smp-field-position-${r}`:""}`},p=()=>{ce(t)||o?.(f)};if(f)return m.jsxs("div",{className:g.container,children:[m.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"8px",font:"var(--smp-fontLabel-base)"},children:m.jsx(we,{...f,id:"FLD",onChange:u,onOptionsRequest:c,fun:n?.fun,onBlur:p,label:a,labelPosition:i})}),ce(t)&&m.jsx(be,{optionalDisplayValue:"Confirm",onClick:()=>l?.(f),bindValue:"Confirm"})]})},Ks=n=>n?.type==="SmeupDataTree",qs=n=>n?.type==="SmeupDataTable",zs=n=>Ks(n)?n.children?n.children.map(e=>({id:e.obj.k,label:e.value??""})):[]:qs(n)?n.rows.map(e=>{const t=e.cells||e.cells,[r,s]=Object.keys(t);return{id:t[r].obj.k,label:t[s].value||t[s].obj.k}}):[],Js=({data:n,id:e,readOnly:t=!1,hiddenSubmitButton:r=!1,updateOnClick:s=!1,decimalSeparator:a=".",optionsHandler:i,onSubmit:o,onCheck:l,onCheckObj:c,onContextMenu:f,onButtonClick:u})=>{const[d,g]=T.useState({}),{translate:p}=Oe(),b=T.useId();T.useEffect(()=>{g(x(n))},[n]);const S=(w,D)=>{if(g(P=>({...P,[w]:{...P[w],obj:{...P[w].obj,k:D.obj.k},decode:D.decode,data:{...P[w].data,error:void 0},value:D.obj.k}})),s&&(D.shape==te.CHECKBOX||D.shape==te.SWITCH)){const P=structuredClone(d);P[w].obj.k=D.obj.k,P[w].value=D.obj.k,o({value:v(P),cell:w})}},R=w=>{const D=v(d);o({value:D,cell:w})},E=(w,D)=>{u?.({cellId:w,currentState:{type:"SmeupDataTable",columns:n.columns,rows:[{cells:d}]},fun:D||""})},C=async w=>{if(d[w].obj.k!=n.rows[0].cells[w].obj.k&&(d[w].inputSettings?.checkObject&&c&&((await c({obj:d[w].obj,fun:d[w].fun,cellId:w})).valid||g(P=>({...P,[w]:{...P[w],data:{...P[w].data,error:p(Se.CHECK_OBJECT_WRONG_VALIDATION)}}}))),d[w].inputSettings?.checkValueOnExit)){const D=v(d);l?.({value:D,cell:w})}},x=w=>{if(!w.rows?.length||!w.columns?.length)return{};const D=w.rows?.[0];return w.columns.filter(P=>P.visible??!0).reduce((P,O)=>{const A={...D.cells[O.name],id:O.name,label:O.title,dSep:a,data:{...D.cells[O.name].data,dSep:a}};return A.isEditable==null&&(A.isEditable=!0),t&&(A.isEditable=!1),A.isEditable&&A.shape==null&&(A.shape=te.TEXT_FIELD),{...P,[O.name]:A}},{})},v=w=>({before:n,after:{type:"SmeupDataTable",columns:JSON.parse(JSON.stringify(n.columns)),rows:[{cells:JSON.parse(JSON.stringify(w))}]}}),$=n.setup?.commands?.map((w,D)=>T.createElement(we,{...w,decode:w.value,data:{label:w.value},id:`command-${D}`,key:`command-${D}`,shape:te.BUTTON,onClick:()=>R(w.obj.k)}))||[];return r||$.unshift(m.jsx(we,{decode:p(Se.CONFIRM_BUTTON),shape:te.BUTTON,id:"",obj:{t:"",p:"",k:""},data:{submit:!0,label:p(Se.CONFIRM_BUTTON)}},"submit-command")),d&&m.jsxs("form",{"data-component":"input-panel",id:e||b,onSubmit:w=>{w.preventDefault(),R()},children:[m.jsx("div",{style:{padding:"1em 0"},children:m.jsx(tt,{layout:n.rows[0].layout,children:Object.values(d).map(w=>m.jsx(we,{...w,onOptionsRequest:w.fun?async(D,P)=>zs(await i(D,P,n,w.id)):void 0,onChange:D=>S(w.id,D),onBlur:()=>C(w.id),onContextMenu:f,onClick:()=>{w.shape=="BTN"&&E(w.id,w.fun)},data:{...w.data,autocomplete:"off"}}))})}),$.length>0&&m.jsx(tt,{layout:{sections:[{id:"1",horizontal:!0,justify:"start",content:$.map(w=>({id:w.props.id}))}]},children:$})]})};exports.AppBar=Os;exports.Autocomplete=jt;exports.Button=be;exports.ButtonList=Pn;exports.Checkbox=An;exports.Combobox=In;exports.DashList=Ds;exports.DataTableComponent=Hs;exports.DatePicker=Nn;exports.Drawer=_s;exports.Field=Gs;exports.Icon=ie;exports.InputPanel=Js;exports.Password=Mn;exports.TabBar=_n;exports.Textfield=ve;exports.configurePaths=hr;