@govtechsg/sgds-web-component 3.6.0 → 3.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base/dropdown-element.d.ts +1 -1
- package/base/dropdown-element.js +3 -3
- package/base/dropdown-element.js.map +1 -1
- package/components/Breadcrumb/index.umd.min.js +7 -7
- package/components/Breadcrumb/index.umd.min.js.map +1 -1
- package/components/Checkbox/checkbox.js +1 -1
- package/components/Checkbox/index.umd.min.js +6 -6
- package/components/Checkbox/index.umd.min.js.map +1 -1
- package/components/Checkbox/sgds-checkbox.js +1 -1
- package/components/Checkbox/sgds-checkbox.js.map +1 -1
- package/components/ComboBox/index.umd.min.js +274 -260
- package/components/ComboBox/index.umd.min.js.map +1 -1
- package/components/ComboBox/sgds-combo-box-option.d.ts +0 -3
- package/components/ComboBox/sgds-combo-box-option.js +2 -20
- package/components/ComboBox/sgds-combo-box-option.js.map +1 -1
- package/components/ComboBox/sgds-combo-box.d.ts +4 -0
- package/components/ComboBox/sgds-combo-box.js +79 -24
- package/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/components/Datepicker/index.umd.min.js +2 -2
- package/components/Datepicker/index.umd.min.js.map +1 -1
- package/components/Dropdown/index.umd.min.js +1 -1
- package/components/Dropdown/index.umd.min.js.map +1 -1
- package/components/Footer/index.umd.min.js +1 -1
- package/components/Footer/index.umd.min.js.map +1 -1
- package/components/Input/index.umd.min.js +1 -1
- package/components/Input/index.umd.min.js.map +1 -1
- package/components/Link/index.umd.min.js +9 -9
- package/components/Link/index.umd.min.js.map +1 -1
- package/components/Link/link.js +1 -1
- package/components/Mainnav/index.umd.min.js +1 -1
- package/components/Mainnav/index.umd.min.js.map +1 -1
- package/components/OverflowMenu/index.umd.min.js +1 -1
- package/components/OverflowMenu/index.umd.min.js.map +1 -1
- package/components/QuantityToggle/index.umd.min.js +1 -1
- package/components/QuantityToggle/index.umd.min.js.map +1 -1
- package/components/Radio/index.umd.min.js +6 -6
- package/components/Radio/index.umd.min.js.map +1 -1
- package/components/Radio/radio.js +1 -1
- package/components/Select/index.umd.min.js +1 -1
- package/components/Select/index.umd.min.js.map +1 -1
- package/components/Switch/index.umd.min.js +1 -1
- package/components/Switch/index.umd.min.js.map +1 -1
- package/components/Switch/switch.js +1 -1
- package/components/SystemBanner/index.umd.min.js +5 -1
- package/components/SystemBanner/index.umd.min.js.map +1 -1
- package/components/SystemBanner/sgds-system-banner.js +5 -1
- package/components/SystemBanner/sgds-system-banner.js.map +1 -1
- package/components/Textarea/index.umd.min.js +1 -1
- package/components/Textarea/index.umd.min.js.map +1 -1
- package/components/index.umd.min.js +33 -14
- package/components/index.umd.min.js.map +1 -1
- package/index.umd.min.js +33 -14
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/base/dropdown-element.cjs.js +3 -3
- package/react/base/dropdown-element.cjs.js.map +1 -1
- package/react/base/dropdown-element.js +3 -3
- package/react/base/dropdown-element.js.map +1 -1
- package/react/components/Checkbox/checkbox.cjs.js +1 -1
- package/react/components/Checkbox/checkbox.js +1 -1
- package/react/components/Checkbox/sgds-checkbox.cjs.js +1 -1
- package/react/components/Checkbox/sgds-checkbox.cjs.js.map +1 -1
- package/react/components/Checkbox/sgds-checkbox.js +1 -1
- package/react/components/Checkbox/sgds-checkbox.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box-option.cjs.js +2 -20
- package/react/components/ComboBox/sgds-combo-box-option.cjs.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box-option.js +2 -20
- package/react/components/ComboBox/sgds-combo-box-option.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.cjs.js +79 -24
- package/react/components/ComboBox/sgds-combo-box.cjs.js.map +1 -1
- package/react/components/ComboBox/sgds-combo-box.js +79 -24
- package/react/components/ComboBox/sgds-combo-box.js.map +1 -1
- package/react/components/Link/link.cjs.js +1 -1
- package/react/components/Link/link.js +1 -1
- package/react/components/Radio/radio.cjs.js +1 -1
- package/react/components/Radio/radio.js +1 -1
- package/react/components/Switch/switch.cjs.js +1 -1
- package/react/components/Switch/switch.js +1 -1
- package/react/components/SystemBanner/sgds-system-banner.cjs.js +5 -1
- package/react/components/SystemBanner/sgds-system-banner.cjs.js.map +1 -1
- package/react/components/SystemBanner/sgds-system-banner.js +5 -1
- package/react/components/SystemBanner/sgds-system-banner.js.map +1 -1
- package/react/styles/form-check.cjs.js +1 -1
- package/react/styles/form-check.js +1 -1
- package/react/styles/form-text-control.cjs.js +1 -1
- package/react/styles/form-text-control.js +1 -1
- package/styles/form-check.js +1 -1
- package/styles/form-text-control.js +1 -1
|
@@ -83,7 +83,7 @@ class extends rs{constructor(t){if(super(t),t.type!==ss&&t.type!==es&&t.type!==a
|
|
|
83
83
|
* @license
|
|
84
84
|
* Copyright 2020 Google LLC
|
|
85
85
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
86
|
-
*/const ms=()=>new ws;class ws{}const ys=new WeakMap;const bs=ns(class extends fs{render(t){return ei}update(t,[e]){const i=e!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=e,this._context=t.options?.host,this._updateRefValue(this._element=t.element)),ei}_updateRefValue(t){if(this.isConnected||(t=void 0),"function"==typeof this._ref){const e=this._context??globalThis;let i=ys.get(e);void 0===i&&(i=new WeakMap,ys.set(e,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,t),void 0!==t&&this._ref.call(this._context,t)}else this._ref.value=t}get _lastElementForRef(){return"function"==typeof this._ref?ys.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),xs=Math.min,_s=Math.max,ks=Math.round,Cs=Math.floor,Ms=t=>({x:t,y:t}),Ss={left:"right",right:"left",bottom:"top",top:"bottom"},Ds={start:"end",end:"start"};function Vs(t,e,i){return _s(t,xs(e,i))}function Zs(t,e){return"function"==typeof t?t(e):t}function As(t){return t.split("-")[0]}function Es(t){return t.split("-")[1]}function Bs(t){return"x"===t?"y":"x"}function $s(t){return"y"===t?"height":"width"}const Fs=new Set(["top","bottom"]);function Ts(t){return Fs.has(As(t))?"y":"x"}function Ps(t){return Bs(Ts(t))}function Hs(t,e,i){void 0===i&&(i=!1);const s=Es(t),a=Ps(t),n=$s(a);let r="x"===a?s===(i?"end":"start")?"right":"left":"start"===s?"bottom":"top";return e.reference[n]>e.floating[n]&&(r=zs(r)),[r,zs(r)]}function Is(t){return t.replace(/start|end/g,(t=>Ds[t]))}const Ls=["left","right"],Rs=["right","left"],Os=["top","bottom"],Ns=["bottom","top"];function Ys(t,e,i,s){const a=Es(t);let n=function(t,e,i){switch(t){case"top":case"bottom":return i?e?Rs:Ls:e?Ls:Rs;case"left":case"right":return e?Os:Ns;default:return[]}}(As(t),"start"===i,s);return a&&(n=n.map((t=>t+"-"+a)),e&&(n=n.concat(n.map(Is)))),n}function zs(t){return t.replace(/left|right|bottom|top/g,(t=>Ss[t]))}function Us(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function qs(t){const{x:e,y:i,width:s,height:a}=t;return{width:s,height:a,top:i,left:e,right:e+s,bottom:i+a,x:e,y:i}}function Ws(t,e,i){let{reference:s,floating:a}=t;const n=Ts(e),r=Ps(e),o=$s(r),l=As(e),c="y"===n,d=s.x+s.width/2-a.width/2,h=s.y+s.height/2-a.height/2,u=s[o]/2-a[o]/2;let p;switch(l){case"top":p={x:d,y:s.y-a.height};break;case"bottom":p={x:d,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:h};break;case"left":p={x:s.x-a.width,y:h};break;default:p={x:s.x,y:s.y}}switch(Es(e)){case"start":p[r]-=u*(i&&c?-1:1);break;case"end":p[r]+=u*(i&&c?-1:1)}return p}async function js(t,e){var i;void 0===e&&(e={});const{x:s,y:a,platform:n,rects:r,elements:o,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:u=!1,padding:p=0}=Zs(e,t),g=Us(p),v=o[u?"floating"===h?"reference":"floating":h],f=qs(await n.getClippingRect({element:null==(i=await(null==n.isElement?void 0:n.isElement(v)))||i?v:v.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(o.floating)),boundary:c,rootBoundary:d,strategy:l})),m="floating"===h?{x:s,y:a,width:r.floating.width,height:r.floating.height}:r.reference,w=await(null==n.getOffsetParent?void 0:n.getOffsetParent(o.floating)),y=await(null==n.isElement?void 0:n.isElement(w))&&await(null==n.getScale?void 0:n.getScale(w))||{x:1,y:1},b=qs(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:m,offsetParent:w,strategy:l}):m);return{top:(f.top-b.top+g.top)/y.y,bottom:(b.bottom-f.bottom+g.bottom)/y.y,left:(f.left-b.left+g.left)/y.x,right:(b.right-f.right+g.right)/y.x}}const Gs=new Set(["left","top"]);function Ks(){return"undefined"!=typeof window}function Qs(t){return ta(t)?(t.nodeName||"").toLowerCase():"#document"}function Xs(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Js(t){var e;return null==(e=(ta(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function ta(t){return!!Ks()&&(t instanceof Node||t instanceof Xs(t).Node)}function ea(t){return!!Ks()&&(t instanceof Element||t instanceof Xs(t).Element)}function ia(t){return!!Ks()&&(t instanceof HTMLElement||t instanceof Xs(t).HTMLElement)}function sa(t){return!(!Ks()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof Xs(t).ShadowRoot)}const aa=new Set(["inline","contents"]);function na(t){const{overflow:e,overflowX:i,overflowY:s,display:a}=ma(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+i)&&!aa.has(a)}const ra=new Set(["table","td","th"]);function oa(t){return ra.has(Qs(t))}const la=[":popover-open",":modal"];function ca(t){return la.some((e=>{try{return t.matches(e)}catch(t){return!1}}))}const da=["transform","translate","scale","rotate","perspective"],ha=["transform","translate","scale","rotate","perspective","filter"],ua=["paint","layout","strict","content"];function pa(t){const e=ga(),i=ea(t)?ma(t):t;return da.some((t=>!!i[t]&&"none"!==i[t]))||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||ha.some((t=>(i.willChange||"").includes(t)))||ua.some((t=>(i.contain||"").includes(t)))}function ga(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const va=new Set(["html","body","#document"]);function fa(t){return va.has(Qs(t))}function ma(t){return Xs(t).getComputedStyle(t)}function wa(t){return ea(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ya(t){if("html"===Qs(t))return t;const e=t.assignedSlot||t.parentNode||sa(t)&&t.host||Js(t);return sa(e)?e.host:e}function ba(t){const e=ya(t);return fa(e)?t.ownerDocument?t.ownerDocument.body:t.body:ia(e)&&na(e)?e:ba(e)}function xa(t,e,i){var s;void 0===e&&(e=[]),void 0===i&&(i=!0);const a=ba(t),n=a===(null==(s=t.ownerDocument)?void 0:s.body),r=Xs(a);if(n){const t=_a(r);return e.concat(r,r.visualViewport||[],na(a)?a:[],t&&i?xa(t):[])}return e.concat(a,xa(a,[],i))}function _a(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ka(t){const e=ma(t);let i=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const a=ia(t),n=a?t.offsetWidth:i,r=a?t.offsetHeight:s,o=ks(i)!==n||ks(s)!==r;return o&&(i=n,s=r),{width:i,height:s,$:o}}function Ca(t){return ea(t)?t:t.contextElement}function Ma(t){const e=Ca(t);if(!ia(e))return Ms(1);const i=e.getBoundingClientRect(),{width:s,height:a,$:n}=ka(e);let r=(n?ks(i.width):i.width)/s,o=(n?ks(i.height):i.height)/a;return r&&Number.isFinite(r)||(r=1),o&&Number.isFinite(o)||(o=1),{x:r,y:o}}const Sa=Ms(0);function Da(t){const e=Xs(t);return ga()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Sa}function Va(t,e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1);const a=t.getBoundingClientRect(),n=Ca(t);let r=Ms(1);e&&(s?ea(s)&&(r=Ma(s)):r=Ma(t));const o=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==Xs(t))&&e}(n,i,s)?Da(n):Ms(0);let l=(a.left+o.x)/r.x,c=(a.top+o.y)/r.y,d=a.width/r.x,h=a.height/r.y;if(n){const t=Xs(n),e=s&&ea(s)?Xs(s):s;let i=t,a=_a(i);for(;a&&s&&e!==i;){const t=Ma(a),e=a.getBoundingClientRect(),s=ma(a),n=e.left+(a.clientLeft+parseFloat(s.paddingLeft))*t.x,r=e.top+(a.clientTop+parseFloat(s.paddingTop))*t.y;l*=t.x,c*=t.y,d*=t.x,h*=t.y,l+=n,c+=r,i=Xs(a),a=_a(i)}}return qs({width:d,height:h,x:l,y:c})}function Za(t,e){const i=wa(t).scrollLeft;return e?e.left+i:Va(Js(t)).left+i}function Aa(t,e){const i=t.getBoundingClientRect();return{x:i.left+e.scrollLeft-Za(t,i),y:i.top+e.scrollTop}}const Ea=25;const Ba=new Set(["absolute","fixed"]);function $a(t,e,i){let s;if("viewport"===e)s=function(t,e){const i=Xs(t),s=Js(t),a=i.visualViewport;let n=s.clientWidth,r=s.clientHeight,o=0,l=0;if(a){n=a.width,r=a.height;const t=ga();(!t||t&&"fixed"===e)&&(o=a.offsetLeft,l=a.offsetTop)}const c=Za(s);if(c<=0){const t=s.ownerDocument,e=t.body,i=getComputedStyle(e),a="CSS1Compat"===t.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,r=Math.abs(s.clientWidth-e.clientWidth-a);r<=Ea&&(n-=r)}else c<=Ea&&(n+=c);return{width:n,height:r,x:o,y:l}}(t,i);else if("document"===e)s=function(t){const e=Js(t),i=wa(t),s=t.ownerDocument.body,a=_s(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),n=_s(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let r=-i.scrollLeft+Za(t);const o=-i.scrollTop;return"rtl"===ma(s).direction&&(r+=_s(e.clientWidth,s.clientWidth)-a),{width:a,height:n,x:r,y:o}}(Js(t));else if(ea(e))s=function(t,e){const i=Va(t,!0,"fixed"===e),s=i.top+t.clientTop,a=i.left+t.clientLeft,n=ia(t)?Ma(t):Ms(1);return{width:t.clientWidth*n.x,height:t.clientHeight*n.y,x:a*n.x,y:s*n.y}}(e,i);else{const i=Da(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return qs(s)}function Fa(t,e){const i=ya(t);return!(i===e||!ea(i)||fa(i))&&("fixed"===ma(i).position||Fa(i,e))}function Ta(t,e,i){const s=ia(e),a=Js(e),n="fixed"===i,r=Va(t,!0,n,e);let o={scrollLeft:0,scrollTop:0};const l=Ms(0);function c(){l.x=Za(a)}if(s||!s&&!n)if(("body"!==Qs(e)||na(a))&&(o=wa(e)),s){const t=Va(e,!0,n,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else a&&c();n&&!s&&a&&c();const d=!a||s||n?Ms(0):Aa(a,o);return{x:r.left+o.scrollLeft-l.x-d.x,y:r.top+o.scrollTop-l.y-d.y,width:r.width,height:r.height}}function Pa(t){return"static"===ma(t).position}function Ha(t,e){if(!ia(t)||"fixed"===ma(t).position)return null;if(e)return e(t);let i=t.offsetParent;return Js(t)===i&&(i=i.ownerDocument.body),i}function Ia(t,e){const i=Xs(t);if(ca(t))return i;if(!ia(t)){let e=ya(t);for(;e&&!fa(e);){if(ea(e)&&!Pa(e))return e;e=ya(e)}return i}let s=Ha(t,e);for(;s&&oa(s)&&Pa(s);)s=Ha(s,e);return s&&fa(s)&&Pa(s)&&!pa(s)?i:s||function(t){let e=ya(t);for(;ia(e)&&!fa(e);){if(pa(e))return e;if(ca(e))return null;e=ya(e)}return null}(t)||i}const La={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:i,offsetParent:s,strategy:a}=t;const n="fixed"===a,r=Js(s),o=!!e&&ca(e.floating);if(s===r||o&&n)return i;let l={scrollLeft:0,scrollTop:0},c=Ms(1);const d=Ms(0),h=ia(s);if((h||!h&&!n)&&(("body"!==Qs(s)||na(r))&&(l=wa(s)),ia(s))){const t=Va(s);c=Ma(s),d.x=t.x+s.clientLeft,d.y=t.y+s.clientTop}const u=!r||h||n?Ms(0):Aa(r,l);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-l.scrollLeft*c.x+d.x+u.x,y:i.y*c.y-l.scrollTop*c.y+d.y+u.y}},getDocumentElement:Js,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:s,strategy:a}=t;const n=[..."clippingAncestors"===i?ca(e)?[]:function(t,e){const i=e.get(t);if(i)return i;let s=xa(t,[],!1).filter((t=>ea(t)&&"body"!==Qs(t))),a=null;const n="fixed"===ma(t).position;let r=n?ya(t):t;for(;ea(r)&&!fa(r);){const e=ma(r),i=pa(r);i||"fixed"!==e.position||(a=null),(n?!i&&!a:!i&&"static"===e.position&&a&&Ba.has(a.position)||na(r)&&!i&&Fa(t,r))?s=s.filter((t=>t!==r)):a=e,r=ya(r)}return e.set(t,s),s}(e,this._c):[].concat(i),s],r=n[0],o=n.reduce(((t,i)=>{const s=$a(e,i,a);return t.top=_s(s.top,t.top),t.right=xs(s.right,t.right),t.bottom=xs(s.bottom,t.bottom),t.left=_s(s.left,t.left),t}),$a(e,r,a));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:Ia,getElementRects:async function(t){const e=this.getOffsetParent||Ia,i=this.getDimensions,s=await i(t.floating);return{reference:Ta(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:i}=ka(t);return{width:e,height:i}},getScale:Ma,isElement:ea,isRTL:function(t){return"rtl"===ma(t).direction}};function Ra(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Oa(t,e,i,s){void 0===s&&(s={});const{ancestorScroll:a=!0,ancestorResize:n=!0,elementResize:r="function"==typeof ResizeObserver,layoutShift:o="function"==typeof IntersectionObserver,animationFrame:l=!1}=s,c=Ca(t),d=a||n?[...c?xa(c):[],...xa(e)]:[];d.forEach((t=>{a&&t.addEventListener("scroll",i,{passive:!0}),n&&t.addEventListener("resize",i)}));const h=c&&o?function(t,e){let i,s=null;const a=Js(t);function n(){var t;clearTimeout(i),null==(t=s)||t.disconnect(),s=null}return function r(o,l){void 0===o&&(o=!1),void 0===l&&(l=1),n();const c=t.getBoundingClientRect(),{left:d,top:h,width:u,height:p}=c;if(o||e(),!u||!p)return;const g={rootMargin:-Cs(h)+"px "+-Cs(a.clientWidth-(d+u))+"px "+-Cs(a.clientHeight-(h+p))+"px "+-Cs(d)+"px",threshold:_s(0,xs(1,l))||1};let v=!0;function f(e){const s=e[0].intersectionRatio;if(s!==l){if(!v)return r();s?r(!1,s):i=setTimeout((()=>{r(!1,1e-7)}),1e3)}1!==s||Ra(c,t.getBoundingClientRect())||r(),v=!1}try{s=new IntersectionObserver(f,{...g,root:a.ownerDocument})}catch(t){s=new IntersectionObserver(f,g)}s.observe(t)}(!0),n}(c,i):null;let u,p=-1,g=null;r&&(g=new ResizeObserver((t=>{let[s]=t;s&&s.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var t;null==(t=g)||t.observe(e)}))),i()})),c&&!l&&g.observe(c),g.observe(e));let v=l?Va(t):null;return l&&function e(){const s=Va(t);v&&!Ra(v,s)&&i();v=s,u=requestAnimationFrame(e)}(),i(),()=>{var t;d.forEach((t=>{a&&t.removeEventListener("scroll",i),n&&t.removeEventListener("resize",i)})),null==h||h(),null==(t=g)||t.disconnect(),g=null,l&&cancelAnimationFrame(u)}}const Na=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var i,s;const{x:a,y:n,placement:r,middlewareData:o}=e,l=await async function(t,e){const{placement:i,platform:s,elements:a}=t,n=await(null==s.isRTL?void 0:s.isRTL(a.floating)),r=As(i),o=Es(i),l="y"===Ts(i),c=Gs.has(r)?-1:1,d=n&&l?-1:1,h=Zs(e,t);let{mainAxis:u,crossAxis:p,alignmentAxis:g}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return o&&"number"==typeof g&&(p="end"===o?-1*g:g),l?{x:p*d,y:u*c}:{x:u*c,y:p*d}}(e,t);return r===(null==(i=o.offset)?void 0:i.placement)&&null!=(s=o.arrow)&&s.alignmentOffset?{}:{x:a+l.x,y:n+l.y,data:{...l,placement:r}}}}},Ya=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:s,placement:a}=e,{mainAxis:n=!0,crossAxis:r=!1,limiter:o={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...l}=Zs(t,e),c={x:i,y:s},d=await js(e,l),h=Ts(As(a)),u=Bs(h);let p=c[u],g=c[h];if(n){const t="y"===u?"bottom":"right";p=Vs(p+d["y"===u?"top":"left"],p,p-d[t])}if(r){const t="y"===h?"bottom":"right";g=Vs(g+d["y"===h?"top":"left"],g,g-d[t])}const v=o.fn({...e,[u]:p,[h]:g});return{...v,data:{x:v.x-i,y:v.y-s,enabled:{[u]:n,[h]:r}}}}}},za=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var i,s;const{placement:a,middlewareData:n,rects:r,initialPlacement:o,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...f}=Zs(t,e);if(null!=(i=n.arrow)&&i.alignmentOffset)return{};const m=As(a),w=Ts(o),y=As(o)===o,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=u||(y||!v?[zs(o)]:function(t){const e=zs(t);return[Is(t),e,Is(e)]}(o)),_="none"!==g;!u&&_&&x.push(...Ys(o,v,g,b));const k=[o,...x],C=await js(e,f),M=[];let S=(null==(s=n.flip)?void 0:s.overflows)||[];if(d&&M.push(C[m]),h){const t=Hs(a,r,b);M.push(C[t[0]],C[t[1]])}if(S=[...S,{placement:a,overflows:M}],!M.every((t=>t<=0))){var D,V;const t=((null==(D=n.flip)?void 0:D.index)||0)+1,e=k[t];if(e){if(!("alignment"===h&&w!==Ts(e))||S.every((t=>Ts(t.placement)!==w||t.overflows[0]>0)))return{data:{index:t,overflows:S},reset:{placement:e}}}let i=null==(V=S.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:V.placement;if(!i)switch(p){case"bestFit":{var Z;const t=null==(Z=S.filter((t=>{if(_){const e=Ts(t.placement);return e===w||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:Z[0];t&&(i=t);break}case"initialPlacement":i=o}if(a!==i)return{reset:{placement:i}}}return{}}}},Ua=(t,e,i)=>{const s=new Map,a={platform:La,...i},n={...a.platform,_c:s};return(async(t,e,i)=>{const{placement:s="bottom",strategy:a="absolute",middleware:n=[],platform:r}=i,o=n.filter(Boolean),l=await(null==r.isRTL?void 0:r.isRTL(e));let c=await r.getElementRects({reference:t,floating:e,strategy:a}),{x:d,y:h}=Ws(c,s,l),u=s,p={},g=0;for(let i=0;i<o.length;i++){const{name:n,fn:v}=o[i],{x:f,y:m,data:w,reset:y}=await v({x:d,y:h,initialPlacement:s,placement:u,strategy:a,middlewareData:p,rects:c,platform:r,elements:{reference:t,floating:e}});d=null!=f?f:d,h=null!=m?m:h,p={...p,[n]:{...p[n],...w}},y&&g<=50&&(g++,"object"==typeof y&&(y.placement&&(u=y.placement),y.rects&&(c=!0===y.rects?await r.getElementRects({reference:t,floating:e,strategy:a}):y.rects),({x:d,y:h}=Ws(c,u,l))),i=-1)}return{x:d,y:h,placement:u,strategy:a,middlewareData:p}})(t,e,{...a,platform:n})};var qa=_i`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--sgds-body-color-default);font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-2);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-24);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:var(--sgds-icon-size-lg);margin-left:.25rem;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:bottom;width:var(--sgds-icon-size-lg)}::slotted(svg){vertical-align:middle}}`;class Wa extends Ni{emit(t,e){const i=new CustomEvent(t,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},e));return this.dispatchEvent(i),i}static define(t,e=this,i={}){if(customElements.get(t));else try{customElements.define(t,e,i)}catch(s){customElements.define(t,class extends e{},i)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach((([t,e])=>{this.constructor.define(t,e)}))}firstUpdated(t){var e;super.firstUpdated(t),this.ssr&&(null===(e=this.shadowRoot)||void 0===e||e.querySelectorAll("slot").forEach((t=>{t.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))})))}}function ja(t="",e=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${t}-${e}`}Wa.styles=[qa],Wa.dependencies={},t([Gi({type:Boolean,reflect:!0})],Wa.prototype,"ssr",void 0);class Ga extends Wa{constructor(){super(...arguments),this.myDropdown=ms(),this.dropdownMenuId=ja("dropdown-menu","div"),this.noFlip=!1,this.menuAlignRight=!1,this.drop="down",this.floatingOpts={},this.menuIsOpen=!1,this.close="default",this.disabled=!1,this.readonly=!1,this.menuRef=ms(),this._handleKeyboardMenuEvent=t=>{if(!this.readonly)switch(t.key){case"ArrowDown":case"ArrowUp":t.preventDefault(),this.menuIsOpen||this.showMenu();break;case"Escape":this.hideMenu()}},this._handleClickOutOfElement=t=>{this.menuIsOpen&&(t.composedPath().includes(this)||this.hideMenu())}}connectedCallback(){super.connectedCallback(),"inside"!==this.close&&document.addEventListener("click",this._handleClickOutOfElement),this.addEventListener("keydown",this._handleKeyboardMenuEvent)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutOfElement),this.removeEventListener("keydown",this._handleKeyboardMenuEvent),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0)}firstUpdated(t){super.firstUpdated(t),this.menuIsOpen&&this.updateFloatingPosition()}async showMenu(){this.disabled||this.menuIsOpen||(this.menuIsOpen=!0,this.emit("sgds-show"),await this.updateFloatingPosition(),this.emit("sgds-after-show"),this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=Oa(this.myDropdown.value,this.menuRef.value,(()=>this.updateFloatingPosition()))))}async hideMenu(){this.menuIsOpen&&(this.emit("sgds-hide"),this.menuIsOpen=!1,setTimeout((()=>this.emit("sgds-after-hide")),0),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0))}toggleMenu(){this.menuIsOpen?this.hideMenu():this.showMenu()}mergeMiddleware(t,e){const i=t=>{var e;return(null==t?void 0:t.name)||(null===(e=null==t?void 0:t.constructor)||void 0===e?void 0:e.name)},s=e.map(i),a=t.map((t=>{const a=i(t),n=s.indexOf(a);return-1!==n?e[n]:t})).concat(e.filter((e=>!t.some((t=>i(t)===i(e))))));return a}async updateFloatingPosition(){if(!this.myDropdown.value||!this.menuRef.value)return;let t="bottom-start";switch(this.drop){case"up":t=this.menuAlignRight?"top-end":"top-start";break;case"right":t="right-start";break;case"left":t="left-start";break;case"down":t=this.menuAlignRight?"bottom-end":"bottom-start";break;default:t="bottom-start"}const e=[Na(8),this.noFlip?void 0:za(),Ya()].filter(Boolean);let i=e;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(i=this.mergeMiddleware(e,this.floatingOpts.middleware.filter(Boolean)));const s=Object.assign(Object.assign({strategy:"fixed",placement:t},this.floatingOpts),{middleware:i}),{x:a,y:n,strategy:r,placement:o}=await Ua(this.myDropdown.value,this.menuRef.value,s);this.menuRef.value.setAttribute("data-placement",o),Object.assign(this.menuRef.value.style,{position:r,left:`${a}px`,top:`${n}px`})}}t([Gi({type:Boolean,state:!0})],Ga.prototype,"noFlip",void 0),t([Gi({type:Boolean,reflect:!0,state:!0})],Ga.prototype,"menuAlignRight",void 0),t([Gi({type:String,reflect:!0,state:!0})],Ga.prototype,"drop",void 0),t([Gi({type:Object})],Ga.prototype,"floatingOpts",void 0),t([Gi({type:Boolean,reflect:!0})],Ga.prototype,"menuIsOpen",void 0),t([Gi({type:Boolean,reflect:!0})],Ga.prototype,"disabled",void 0),t([Gi({type:Boolean,reflect:!0})],Ga.prototype,"readonly",void 0);const Ka={"DD/MM/YYYY":{imPattern:"`dd{/}`mm{/}`yyyy",imRangePattern:"`dd{/}`mm{/}`yyyy - `DD{/}`MM{/}`YYYY",fnsPattern:"dd/MM/yyyy"},"MM/DD/YYYY":{imPattern:"`mm{/}`dd{/}`yyyy",imRangePattern:"`mm{/}`dd{/}`yyyy - `MM{/}`DD{/}`YYYY",fnsPattern:"MM/dd/yyyy"},"YYYY/MM/DD":{imPattern:"`yyyy{/}`mm{/}`dd",imRangePattern:"`yyyy{/}`mm{/}`dd - `YYYY{/}`MM{/}`DD",fnsPattern:"yyyy/MM/dd"}},Qa=t=>{const e=t.getMonth(),i=t.getFullYear(),s=t.getDate(),a=new Date(i,e+1),n=et(a);return g(t)&&n<s?it(a):new Date(i,e+1,s)},Xa=t=>{const e=t.getMonth(),i=t.getFullYear(),s=t.getDate(),a=new Date(i,e-1),n=et(a);return g(t)&&n<s?it(a):new Date(i,e-1,s)},Ja=t=>{const e=new Date(t);return e.setHours(12),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e};function tn(t,e){const i=Object.assign({waitUntilFirstUpdate:!1},e);return(e,s)=>{const{update:a}=e;if(t in e){const n=t;e.update=function(t){if(t.has(n)){const e=t.get(n),a=this[n];e!==a&&(i.waitUntilFirstUpdate&&!this.hasUpdated||this[s](e,a))}a.call(this,t)}}}}
|
|
86
|
+
*/const ms=()=>new ws;class ws{}const ys=new WeakMap;const bs=ns(class extends fs{render(t){return ei}update(t,[e]){const i=e!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=e,this._context=t.options?.host,this._updateRefValue(this._element=t.element)),ei}_updateRefValue(t){if(this.isConnected||(t=void 0),"function"==typeof this._ref){const e=this._context??globalThis;let i=ys.get(e);void 0===i&&(i=new WeakMap,ys.set(e,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,t),void 0!==t&&this._ref.call(this._context,t)}else this._ref.value=t}get _lastElementForRef(){return"function"==typeof this._ref?ys.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),xs=Math.min,_s=Math.max,ks=Math.round,Cs=Math.floor,Ms=t=>({x:t,y:t}),Ss={left:"right",right:"left",bottom:"top",top:"bottom"},Ds={start:"end",end:"start"};function Vs(t,e,i){return _s(t,xs(e,i))}function Zs(t,e){return"function"==typeof t?t(e):t}function As(t){return t.split("-")[0]}function Es(t){return t.split("-")[1]}function Bs(t){return"x"===t?"y":"x"}function $s(t){return"y"===t?"height":"width"}const Fs=new Set(["top","bottom"]);function Ts(t){return Fs.has(As(t))?"y":"x"}function Ps(t){return Bs(Ts(t))}function Hs(t,e,i){void 0===i&&(i=!1);const s=Es(t),a=Ps(t),n=$s(a);let r="x"===a?s===(i?"end":"start")?"right":"left":"start"===s?"bottom":"top";return e.reference[n]>e.floating[n]&&(r=zs(r)),[r,zs(r)]}function Is(t){return t.replace(/start|end/g,(t=>Ds[t]))}const Ls=["left","right"],Rs=["right","left"],Os=["top","bottom"],Ns=["bottom","top"];function Ys(t,e,i,s){const a=Es(t);let n=function(t,e,i){switch(t){case"top":case"bottom":return i?e?Rs:Ls:e?Ls:Rs;case"left":case"right":return e?Os:Ns;default:return[]}}(As(t),"start"===i,s);return a&&(n=n.map((t=>t+"-"+a)),e&&(n=n.concat(n.map(Is)))),n}function zs(t){return t.replace(/left|right|bottom|top/g,(t=>Ss[t]))}function Us(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function qs(t){const{x:e,y:i,width:s,height:a}=t;return{width:s,height:a,top:i,left:e,right:e+s,bottom:i+a,x:e,y:i}}function Ws(t,e,i){let{reference:s,floating:a}=t;const n=Ts(e),r=Ps(e),o=$s(r),l=As(e),c="y"===n,d=s.x+s.width/2-a.width/2,h=s.y+s.height/2-a.height/2,u=s[o]/2-a[o]/2;let p;switch(l){case"top":p={x:d,y:s.y-a.height};break;case"bottom":p={x:d,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:h};break;case"left":p={x:s.x-a.width,y:h};break;default:p={x:s.x,y:s.y}}switch(Es(e)){case"start":p[r]-=u*(i&&c?-1:1);break;case"end":p[r]+=u*(i&&c?-1:1)}return p}async function js(t,e){var i;void 0===e&&(e={});const{x:s,y:a,platform:n,rects:r,elements:o,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:u=!1,padding:p=0}=Zs(e,t),g=Us(p),v=o[u?"floating"===h?"reference":"floating":h],f=qs(await n.getClippingRect({element:null==(i=await(null==n.isElement?void 0:n.isElement(v)))||i?v:v.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(o.floating)),boundary:c,rootBoundary:d,strategy:l})),m="floating"===h?{x:s,y:a,width:r.floating.width,height:r.floating.height}:r.reference,w=await(null==n.getOffsetParent?void 0:n.getOffsetParent(o.floating)),y=await(null==n.isElement?void 0:n.isElement(w))&&await(null==n.getScale?void 0:n.getScale(w))||{x:1,y:1},b=qs(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:m,offsetParent:w,strategy:l}):m);return{top:(f.top-b.top+g.top)/y.y,bottom:(b.bottom-f.bottom+g.bottom)/y.y,left:(f.left-b.left+g.left)/y.x,right:(b.right-f.right+g.right)/y.x}}const Gs=new Set(["left","top"]);function Ks(){return"undefined"!=typeof window}function Qs(t){return ta(t)?(t.nodeName||"").toLowerCase():"#document"}function Xs(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Js(t){var e;return null==(e=(ta(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function ta(t){return!!Ks()&&(t instanceof Node||t instanceof Xs(t).Node)}function ea(t){return!!Ks()&&(t instanceof Element||t instanceof Xs(t).Element)}function ia(t){return!!Ks()&&(t instanceof HTMLElement||t instanceof Xs(t).HTMLElement)}function sa(t){return!(!Ks()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof Xs(t).ShadowRoot)}const aa=new Set(["inline","contents"]);function na(t){const{overflow:e,overflowX:i,overflowY:s,display:a}=ma(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+i)&&!aa.has(a)}const ra=new Set(["table","td","th"]);function oa(t){return ra.has(Qs(t))}const la=[":popover-open",":modal"];function ca(t){return la.some((e=>{try{return t.matches(e)}catch(t){return!1}}))}const da=["transform","translate","scale","rotate","perspective"],ha=["transform","translate","scale","rotate","perspective","filter"],ua=["paint","layout","strict","content"];function pa(t){const e=ga(),i=ea(t)?ma(t):t;return da.some((t=>!!i[t]&&"none"!==i[t]))||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||ha.some((t=>(i.willChange||"").includes(t)))||ua.some((t=>(i.contain||"").includes(t)))}function ga(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const va=new Set(["html","body","#document"]);function fa(t){return va.has(Qs(t))}function ma(t){return Xs(t).getComputedStyle(t)}function wa(t){return ea(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ya(t){if("html"===Qs(t))return t;const e=t.assignedSlot||t.parentNode||sa(t)&&t.host||Js(t);return sa(e)?e.host:e}function ba(t){const e=ya(t);return fa(e)?t.ownerDocument?t.ownerDocument.body:t.body:ia(e)&&na(e)?e:ba(e)}function xa(t,e,i){var s;void 0===e&&(e=[]),void 0===i&&(i=!0);const a=ba(t),n=a===(null==(s=t.ownerDocument)?void 0:s.body),r=Xs(a);if(n){const t=_a(r);return e.concat(r,r.visualViewport||[],na(a)?a:[],t&&i?xa(t):[])}return e.concat(a,xa(a,[],i))}function _a(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ka(t){const e=ma(t);let i=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const a=ia(t),n=a?t.offsetWidth:i,r=a?t.offsetHeight:s,o=ks(i)!==n||ks(s)!==r;return o&&(i=n,s=r),{width:i,height:s,$:o}}function Ca(t){return ea(t)?t:t.contextElement}function Ma(t){const e=Ca(t);if(!ia(e))return Ms(1);const i=e.getBoundingClientRect(),{width:s,height:a,$:n}=ka(e);let r=(n?ks(i.width):i.width)/s,o=(n?ks(i.height):i.height)/a;return r&&Number.isFinite(r)||(r=1),o&&Number.isFinite(o)||(o=1),{x:r,y:o}}const Sa=Ms(0);function Da(t){const e=Xs(t);return ga()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Sa}function Va(t,e,i,s){void 0===e&&(e=!1),void 0===i&&(i=!1);const a=t.getBoundingClientRect(),n=Ca(t);let r=Ms(1);e&&(s?ea(s)&&(r=Ma(s)):r=Ma(t));const o=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==Xs(t))&&e}(n,i,s)?Da(n):Ms(0);let l=(a.left+o.x)/r.x,c=(a.top+o.y)/r.y,d=a.width/r.x,h=a.height/r.y;if(n){const t=Xs(n),e=s&&ea(s)?Xs(s):s;let i=t,a=_a(i);for(;a&&s&&e!==i;){const t=Ma(a),e=a.getBoundingClientRect(),s=ma(a),n=e.left+(a.clientLeft+parseFloat(s.paddingLeft))*t.x,r=e.top+(a.clientTop+parseFloat(s.paddingTop))*t.y;l*=t.x,c*=t.y,d*=t.x,h*=t.y,l+=n,c+=r,i=Xs(a),a=_a(i)}}return qs({width:d,height:h,x:l,y:c})}function Za(t,e){const i=wa(t).scrollLeft;return e?e.left+i:Va(Js(t)).left+i}function Aa(t,e){const i=t.getBoundingClientRect();return{x:i.left+e.scrollLeft-Za(t,i),y:i.top+e.scrollTop}}const Ea=25;const Ba=new Set(["absolute","fixed"]);function $a(t,e,i){let s;if("viewport"===e)s=function(t,e){const i=Xs(t),s=Js(t),a=i.visualViewport;let n=s.clientWidth,r=s.clientHeight,o=0,l=0;if(a){n=a.width,r=a.height;const t=ga();(!t||t&&"fixed"===e)&&(o=a.offsetLeft,l=a.offsetTop)}const c=Za(s);if(c<=0){const t=s.ownerDocument,e=t.body,i=getComputedStyle(e),a="CSS1Compat"===t.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,r=Math.abs(s.clientWidth-e.clientWidth-a);r<=Ea&&(n-=r)}else c<=Ea&&(n+=c);return{width:n,height:r,x:o,y:l}}(t,i);else if("document"===e)s=function(t){const e=Js(t),i=wa(t),s=t.ownerDocument.body,a=_s(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),n=_s(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let r=-i.scrollLeft+Za(t);const o=-i.scrollTop;return"rtl"===ma(s).direction&&(r+=_s(e.clientWidth,s.clientWidth)-a),{width:a,height:n,x:r,y:o}}(Js(t));else if(ea(e))s=function(t,e){const i=Va(t,!0,"fixed"===e),s=i.top+t.clientTop,a=i.left+t.clientLeft,n=ia(t)?Ma(t):Ms(1);return{width:t.clientWidth*n.x,height:t.clientHeight*n.y,x:a*n.x,y:s*n.y}}(e,i);else{const i=Da(t);s={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return qs(s)}function Fa(t,e){const i=ya(t);return!(i===e||!ea(i)||fa(i))&&("fixed"===ma(i).position||Fa(i,e))}function Ta(t,e,i){const s=ia(e),a=Js(e),n="fixed"===i,r=Va(t,!0,n,e);let o={scrollLeft:0,scrollTop:0};const l=Ms(0);function c(){l.x=Za(a)}if(s||!s&&!n)if(("body"!==Qs(e)||na(a))&&(o=wa(e)),s){const t=Va(e,!0,n,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else a&&c();n&&!s&&a&&c();const d=!a||s||n?Ms(0):Aa(a,o);return{x:r.left+o.scrollLeft-l.x-d.x,y:r.top+o.scrollTop-l.y-d.y,width:r.width,height:r.height}}function Pa(t){return"static"===ma(t).position}function Ha(t,e){if(!ia(t)||"fixed"===ma(t).position)return null;if(e)return e(t);let i=t.offsetParent;return Js(t)===i&&(i=i.ownerDocument.body),i}function Ia(t,e){const i=Xs(t);if(ca(t))return i;if(!ia(t)){let e=ya(t);for(;e&&!fa(e);){if(ea(e)&&!Pa(e))return e;e=ya(e)}return i}let s=Ha(t,e);for(;s&&oa(s)&&Pa(s);)s=Ha(s,e);return s&&fa(s)&&Pa(s)&&!pa(s)?i:s||function(t){let e=ya(t);for(;ia(e)&&!fa(e);){if(pa(e))return e;if(ca(e))return null;e=ya(e)}return null}(t)||i}const La={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:i,offsetParent:s,strategy:a}=t;const n="fixed"===a,r=Js(s),o=!!e&&ca(e.floating);if(s===r||o&&n)return i;let l={scrollLeft:0,scrollTop:0},c=Ms(1);const d=Ms(0),h=ia(s);if((h||!h&&!n)&&(("body"!==Qs(s)||na(r))&&(l=wa(s)),ia(s))){const t=Va(s);c=Ma(s),d.x=t.x+s.clientLeft,d.y=t.y+s.clientTop}const u=!r||h||n?Ms(0):Aa(r,l);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-l.scrollLeft*c.x+d.x+u.x,y:i.y*c.y-l.scrollTop*c.y+d.y+u.y}},getDocumentElement:Js,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:s,strategy:a}=t;const n=[..."clippingAncestors"===i?ca(e)?[]:function(t,e){const i=e.get(t);if(i)return i;let s=xa(t,[],!1).filter((t=>ea(t)&&"body"!==Qs(t))),a=null;const n="fixed"===ma(t).position;let r=n?ya(t):t;for(;ea(r)&&!fa(r);){const e=ma(r),i=pa(r);i||"fixed"!==e.position||(a=null),(n?!i&&!a:!i&&"static"===e.position&&a&&Ba.has(a.position)||na(r)&&!i&&Fa(t,r))?s=s.filter((t=>t!==r)):a=e,r=ya(r)}return e.set(t,s),s}(e,this._c):[].concat(i),s],r=n[0],o=n.reduce(((t,i)=>{const s=$a(e,i,a);return t.top=_s(s.top,t.top),t.right=xs(s.right,t.right),t.bottom=xs(s.bottom,t.bottom),t.left=_s(s.left,t.left),t}),$a(e,r,a));return{width:o.right-o.left,height:o.bottom-o.top,x:o.left,y:o.top}},getOffsetParent:Ia,getElementRects:async function(t){const e=this.getOffsetParent||Ia,i=this.getDimensions,s=await i(t.floating);return{reference:Ta(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:i}=ka(t);return{width:e,height:i}},getScale:Ma,isElement:ea,isRTL:function(t){return"rtl"===ma(t).direction}};function Ra(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Oa(t,e,i,s){void 0===s&&(s={});const{ancestorScroll:a=!0,ancestorResize:n=!0,elementResize:r="function"==typeof ResizeObserver,layoutShift:o="function"==typeof IntersectionObserver,animationFrame:l=!1}=s,c=Ca(t),d=a||n?[...c?xa(c):[],...xa(e)]:[];d.forEach((t=>{a&&t.addEventListener("scroll",i,{passive:!0}),n&&t.addEventListener("resize",i)}));const h=c&&o?function(t,e){let i,s=null;const a=Js(t);function n(){var t;clearTimeout(i),null==(t=s)||t.disconnect(),s=null}return function r(o,l){void 0===o&&(o=!1),void 0===l&&(l=1),n();const c=t.getBoundingClientRect(),{left:d,top:h,width:u,height:p}=c;if(o||e(),!u||!p)return;const g={rootMargin:-Cs(h)+"px "+-Cs(a.clientWidth-(d+u))+"px "+-Cs(a.clientHeight-(h+p))+"px "+-Cs(d)+"px",threshold:_s(0,xs(1,l))||1};let v=!0;function f(e){const s=e[0].intersectionRatio;if(s!==l){if(!v)return r();s?r(!1,s):i=setTimeout((()=>{r(!1,1e-7)}),1e3)}1!==s||Ra(c,t.getBoundingClientRect())||r(),v=!1}try{s=new IntersectionObserver(f,{...g,root:a.ownerDocument})}catch(t){s=new IntersectionObserver(f,g)}s.observe(t)}(!0),n}(c,i):null;let u,p=-1,g=null;r&&(g=new ResizeObserver((t=>{let[s]=t;s&&s.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var t;null==(t=g)||t.observe(e)}))),i()})),c&&!l&&g.observe(c),g.observe(e));let v=l?Va(t):null;return l&&function e(){const s=Va(t);v&&!Ra(v,s)&&i();v=s,u=requestAnimationFrame(e)}(),i(),()=>{var t;d.forEach((t=>{a&&t.removeEventListener("scroll",i),n&&t.removeEventListener("resize",i)})),null==h||h(),null==(t=g)||t.disconnect(),g=null,l&&cancelAnimationFrame(u)}}const Na=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var i,s;const{x:a,y:n,placement:r,middlewareData:o}=e,l=await async function(t,e){const{placement:i,platform:s,elements:a}=t,n=await(null==s.isRTL?void 0:s.isRTL(a.floating)),r=As(i),o=Es(i),l="y"===Ts(i),c=Gs.has(r)?-1:1,d=n&&l?-1:1,h=Zs(e,t);let{mainAxis:u,crossAxis:p,alignmentAxis:g}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return o&&"number"==typeof g&&(p="end"===o?-1*g:g),l?{x:p*d,y:u*c}:{x:u*c,y:p*d}}(e,t);return r===(null==(i=o.offset)?void 0:i.placement)&&null!=(s=o.arrow)&&s.alignmentOffset?{}:{x:a+l.x,y:n+l.y,data:{...l,placement:r}}}}},Ya=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:s,placement:a}=e,{mainAxis:n=!0,crossAxis:r=!1,limiter:o={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...l}=Zs(t,e),c={x:i,y:s},d=await js(e,l),h=Ts(As(a)),u=Bs(h);let p=c[u],g=c[h];if(n){const t="y"===u?"bottom":"right";p=Vs(p+d["y"===u?"top":"left"],p,p-d[t])}if(r){const t="y"===h?"bottom":"right";g=Vs(g+d["y"===h?"top":"left"],g,g-d[t])}const v=o.fn({...e,[u]:p,[h]:g});return{...v,data:{x:v.x-i,y:v.y-s,enabled:{[u]:n,[h]:r}}}}}},za=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var i,s;const{placement:a,middlewareData:n,rects:r,initialPlacement:o,platform:l,elements:c}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...f}=Zs(t,e);if(null!=(i=n.arrow)&&i.alignmentOffset)return{};const m=As(a),w=Ts(o),y=As(o)===o,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=u||(y||!v?[zs(o)]:function(t){const e=zs(t);return[Is(t),e,Is(e)]}(o)),_="none"!==g;!u&&_&&x.push(...Ys(o,v,g,b));const k=[o,...x],C=await js(e,f),M=[];let S=(null==(s=n.flip)?void 0:s.overflows)||[];if(d&&M.push(C[m]),h){const t=Hs(a,r,b);M.push(C[t[0]],C[t[1]])}if(S=[...S,{placement:a,overflows:M}],!M.every((t=>t<=0))){var D,V;const t=((null==(D=n.flip)?void 0:D.index)||0)+1,e=k[t];if(e){if(!("alignment"===h&&w!==Ts(e))||S.every((t=>Ts(t.placement)!==w||t.overflows[0]>0)))return{data:{index:t,overflows:S},reset:{placement:e}}}let i=null==(V=S.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:V.placement;if(!i)switch(p){case"bestFit":{var Z;const t=null==(Z=S.filter((t=>{if(_){const e=Ts(t.placement);return e===w||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:Z[0];t&&(i=t);break}case"initialPlacement":i=o}if(a!==i)return{reset:{placement:i}}}return{}}}},Ua=(t,e,i)=>{const s=new Map,a={platform:La,...i},n={...a.platform,_c:s};return(async(t,e,i)=>{const{placement:s="bottom",strategy:a="absolute",middleware:n=[],platform:r}=i,o=n.filter(Boolean),l=await(null==r.isRTL?void 0:r.isRTL(e));let c=await r.getElementRects({reference:t,floating:e,strategy:a}),{x:d,y:h}=Ws(c,s,l),u=s,p={},g=0;for(let i=0;i<o.length;i++){const{name:n,fn:v}=o[i],{x:f,y:m,data:w,reset:y}=await v({x:d,y:h,initialPlacement:s,placement:u,strategy:a,middlewareData:p,rects:c,platform:r,elements:{reference:t,floating:e}});d=null!=f?f:d,h=null!=m?m:h,p={...p,[n]:{...p[n],...w}},y&&g<=50&&(g++,"object"==typeof y&&(y.placement&&(u=y.placement),y.rects&&(c=!0===y.rects?await r.getElementRects({reference:t,floating:e,strategy:a}):y.rects),({x:d,y:h}=Ws(c,u,l))),i=-1)}return{x:d,y:h,placement:u,strategy:a,middlewareData:p}})(t,e,{...a,platform:n})};var qa=_i`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);color:var(--sgds-body-color-default);font-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-2);font-weight:var(--sgds-font-weight-regular);line-height:var(--sgds-line-height-24);margin:0;*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:disabled{cursor:not-allowed}@media (prefers-reduced-motion:no-preference){:root{scroll-behavior:smooth}}::slotted(a[target=_blank]):after,a[target=_blank]:after{background-color:currentColor;content:"/";display:inline-block;height:var(--sgds-icon-size-lg);margin-left:.25rem;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='none'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9.774 4.4H9.8a.6.6 0 1 1 0 1.2c-.85 0-1.451 0-1.922.039-.463.038-.745.11-.968.223A2.4 2.4 0 0 0 5.861 6.91c-.113.223-.184.505-.222.968-.039.47-.04 1.072-.04 1.922v4.4c0 .85.001 1.451.04 1.922.038.463.11.745.222.968a2.4 2.4 0 0 0 1.05 1.048c.222.114.504.185.967.223.47.038 1.072.039 1.922.039h4.4c.85 0 1.451 0 1.921-.039.464-.038.746-.11.969-.223a2.4 2.4 0 0 0 1.048-1.048c.113-.223.185-.505.223-.968.038-.47.039-1.072.039-1.922a.6.6 0 1 1 1.2 0v.026c0 .818 0 1.468-.043 1.993-.044.538-.136.996-.35 1.415a3.6 3.6 0 0 1-1.573 1.574c-.42.213-.878.305-1.415.35-.525.042-1.175.042-1.993.042H9.774c-.818 0-1.469 0-1.993-.043-.538-.044-.996-.136-1.415-.35a3.6 3.6 0 0 1-1.574-1.573c-.213-.42-.305-.877-.35-1.415-.042-.525-.042-1.175-.042-1.993V9.774c0-.818 0-1.468.043-1.993.044-.538.136-.996.35-1.415a3.6 3.6 0 0 1 1.573-1.574c.42-.213.877-.305 1.415-.35C8.305 4.4 8.956 4.4 9.774 4.4ZM12.4 5a.6.6 0 0 1 .6-.6h6a.6.6 0 0 1 .6.6v6a.6.6 0 1 1-1.2 0V6.449l-5.976 5.975a.6.6 0 0 1-.848-.848L17.55 5.6H13a.6.6 0 0 1-.6-.6Z' fill='%230E0E0E'/%3E%3C/svg%3E");-webkit-mask-position:center;mask-position:center;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;vertical-align:bottom;width:var(--sgds-icon-size-lg)}::slotted(svg){vertical-align:middle}}`;class Wa extends Ni{emit(t,e){const i=new CustomEvent(t,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},e));return this.dispatchEvent(i),i}static define(t,e=this,i={}){if(customElements.get(t));else try{customElements.define(t,e,i)}catch(s){customElements.define(t,class extends e{},i)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach((([t,e])=>{this.constructor.define(t,e)}))}firstUpdated(t){var e;super.firstUpdated(t),this.ssr&&(null===(e=this.shadowRoot)||void 0===e||e.querySelectorAll("slot").forEach((t=>{t.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))})))}}function ja(t="",e=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${t}-${e}`}Wa.styles=[qa],Wa.dependencies={},t([Gi({type:Boolean,reflect:!0})],Wa.prototype,"ssr",void 0);class Ga extends Wa{constructor(){super(...arguments),this.myDropdown=ms(),this.dropdownMenuId=ja("dropdown-menu","div"),this.noFlip=!1,this.menuAlignRight=!1,this.drop="down",this.floatingOpts={},this.menuIsOpen=!1,this.close="default",this.disabled=!1,this.readonly=!1,this.menuRef=ms(),this._handleKeyboardMenuEvent=t=>{if(!this.readonly)switch(t.key){case"ArrowDown":case"ArrowUp":t.preventDefault(),this.menuIsOpen||this.showMenu();break;case"Escape":this.hideMenu()}},this._handleClickOutOfElement=t=>{this.menuIsOpen&&(t.composedPath().includes(this)||this.hideMenu(!0))}}connectedCallback(){super.connectedCallback(),"inside"!==this.close&&document.addEventListener("click",this._handleClickOutOfElement),this.addEventListener("keydown",this._handleKeyboardMenuEvent)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._handleClickOutOfElement),this.removeEventListener("keydown",this._handleKeyboardMenuEvent),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0)}firstUpdated(t){super.firstUpdated(t),this.menuIsOpen&&this.updateFloatingPosition()}async showMenu(){this.disabled||this.menuIsOpen||(this.menuIsOpen=!0,this.emit("sgds-show"),await this.updateFloatingPosition(),this.emit("sgds-after-show"),this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=Oa(this.myDropdown.value,this.menuRef.value,(()=>this.updateFloatingPosition()))))}async hideMenu(t){this.menuIsOpen&&(this.emit("sgds-hide",{detail:{isOutside:t}}),this.menuIsOpen=!1,setTimeout((()=>this.emit("sgds-after-hide")),0),this._cleanupAutoUpdate&&(this._cleanupAutoUpdate(),this._cleanupAutoUpdate=void 0))}toggleMenu(){this.menuIsOpen?this.hideMenu():this.showMenu()}mergeMiddleware(t,e){const i=t=>{var e;return(null==t?void 0:t.name)||(null===(e=null==t?void 0:t.constructor)||void 0===e?void 0:e.name)},s=e.map(i),a=t.map((t=>{const a=i(t),n=s.indexOf(a);return-1!==n?e[n]:t})).concat(e.filter((e=>!t.some((t=>i(t)===i(e))))));return a}async updateFloatingPosition(){if(!this.myDropdown.value||!this.menuRef.value)return;let t="bottom-start";switch(this.drop){case"up":t=this.menuAlignRight?"top-end":"top-start";break;case"right":t="right-start";break;case"left":t="left-start";break;case"down":t=this.menuAlignRight?"bottom-end":"bottom-start";break;default:t="bottom-start"}const e=[Na(8),this.noFlip?void 0:za(),Ya()].filter(Boolean);let i=e;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(i=this.mergeMiddleware(e,this.floatingOpts.middleware.filter(Boolean)));const s=Object.assign(Object.assign({strategy:"fixed",placement:t},this.floatingOpts),{middleware:i}),{x:a,y:n,strategy:r,placement:o}=await Ua(this.myDropdown.value,this.menuRef.value,s);this.menuRef.value.setAttribute("data-placement",o),Object.assign(this.menuRef.value.style,{position:r,left:`${a}px`,top:`${n}px`})}}t([Gi({type:Boolean,state:!0})],Ga.prototype,"noFlip",void 0),t([Gi({type:Boolean,reflect:!0,state:!0})],Ga.prototype,"menuAlignRight",void 0),t([Gi({type:String,reflect:!0,state:!0})],Ga.prototype,"drop",void 0),t([Gi({type:Object})],Ga.prototype,"floatingOpts",void 0),t([Gi({type:Boolean,reflect:!0})],Ga.prototype,"menuIsOpen",void 0),t([Gi({type:Boolean,reflect:!0})],Ga.prototype,"disabled",void 0),t([Gi({type:Boolean,reflect:!0})],Ga.prototype,"readonly",void 0);const Ka={"DD/MM/YYYY":{imPattern:"`dd{/}`mm{/}`yyyy",imRangePattern:"`dd{/}`mm{/}`yyyy - `DD{/}`MM{/}`YYYY",fnsPattern:"dd/MM/yyyy"},"MM/DD/YYYY":{imPattern:"`mm{/}`dd{/}`yyyy",imRangePattern:"`mm{/}`dd{/}`yyyy - `MM{/}`DD{/}`YYYY",fnsPattern:"MM/dd/yyyy"},"YYYY/MM/DD":{imPattern:"`yyyy{/}`mm{/}`dd",imRangePattern:"`yyyy{/}`mm{/}`dd - `YYYY{/}`MM{/}`DD",fnsPattern:"yyyy/MM/dd"}},Qa=t=>{const e=t.getMonth(),i=t.getFullYear(),s=t.getDate(),a=new Date(i,e+1),n=et(a);return g(t)&&n<s?it(a):new Date(i,e+1,s)},Xa=t=>{const e=t.getMonth(),i=t.getFullYear(),s=t.getDate(),a=new Date(i,e-1),n=et(a);return g(t)&&n<s?it(a):new Date(i,e-1,s)},Ja=t=>{const e=new Date(t);return e.setHours(12),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),e};function tn(t,e){const i=Object.assign({waitUntilFirstUpdate:!1},e);return(e,s)=>{const{update:a}=e;if(t in e){const n=t;e.update=function(t){if(t.has(n)){const e=t.get(n),a=this[n];e!==a&&(i.waitUntilFirstUpdate&&!this.hasUpdated||this[s](e,a))}a.call(this,t)}}}}
|
|
87
87
|
/**
|
|
88
88
|
* @license
|
|
89
89
|
* Copyright 2018 Google LLC
|
|
@@ -2142,7 +2142,7 @@ class extends rs{constructor(t){if(super(t),t.type!==ss&&t.type!==es&&t.type!==a
|
|
|
2142
2142
|
>
|
|
2143
2143
|
</sgds-icon-button>
|
|
2144
2144
|
</div>
|
|
2145
|
-
`}}En.styles=[An],En.dependencies={"sgds-icon":Cn,"sgds-icon-button":Zn,"sgds-button":fn},t([Gi({attribute:!1})],En.prototype,"displayDate",void 0),t([Gi({attribute:!1})],En.prototype,"focusedDate",void 0),t([Gi({attribute:!1})],En.prototype,"selectedDate",void 0),t([Gi()],En.prototype,"view",void 0),t([Gi()],En.prototype,"focusedTabIndex",void 0),t([tn("focusedTabIndex",{waitUntilFirstUpdate:!0})],En.prototype,"_handleFocusedTabIndexChange",null);const Bn=["January","February","March","April","May","June","July","August","September","October","November","December"];function $n(t){return"string"==typeof t||t instanceof String}function Fn(t){var e;return"object"==typeof t&&null!=t&&"Object"===(null==t||null==(e=t.constructor)?void 0:e.name)}function Tn(t,e){return Array.isArray(e)?Tn(t,((t,i)=>e.includes(i))):Object.entries(t).reduce(((t,i)=>{let[s,a]=i;return e(a,s)&&(t[s]=a),t}),{})}const Pn="NONE",Hn="LEFT",In="FORCE_LEFT",Ln="RIGHT",Rn="FORCE_RIGHT";function On(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function Nn(t,e){if(e===t)return!0;const i=Array.isArray(e),s=Array.isArray(t);let a;if(i&&s){if(e.length!=t.length)return!1;for(a=0;a<e.length;a++)if(!Nn(e[a],t[a]))return!1;return!0}if(i!=s)return!1;if(e&&t&&"object"==typeof e&&"object"==typeof t){const i=e instanceof Date,s=t instanceof Date;if(i&&s)return e.getTime()==t.getTime();if(i!=s)return!1;const n=e instanceof RegExp,r=t instanceof RegExp;if(n&&r)return e.toString()==t.toString();if(n!=r)return!1;const o=Object.keys(e);for(a=0;a<o.length;a++)if(!Object.prototype.hasOwnProperty.call(t,o[a]))return!1;for(a=0;a<o.length;a++)if(!Nn(t[o[a]],e[o[a]]))return!1;return!0}return!(!e||!t||"function"!=typeof e||"function"!=typeof t)&&e.toString()===t.toString()}class Yn{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?Pn:this.oldSelection.end!==this.cursorPos&&this.oldSelection.start!==this.cursorPos||this.oldSelection.end!==this.oldSelection.start?Hn:Ln}}function zn(t,e){return new zn.InputMask(t,e)}function Un(t){if(null==t)throw new Error("mask property should be defined");return t instanceof RegExp?zn.MaskedRegExp:$n(t)?zn.MaskedPattern:t===Date?zn.MaskedDate:t===Number?zn.MaskedNumber:Array.isArray(t)||t===Array?zn.MaskedDynamic:zn.Masked&&t.prototype instanceof zn.Masked?t:zn.Masked&&t instanceof zn.Masked?t.constructor:t instanceof Function?zn.MaskedFunction:(console.warn("Mask not found for mask",t),zn.Masked)}function qn(t){if(!t)throw new Error("Options in not defined");if(zn.Masked){if(t.prototype instanceof zn.Masked)return{mask:t};const{mask:e,...i}=t instanceof zn.Masked?{mask:t}:Fn(t)&&t.mask instanceof zn.Masked?t:{};if(e){const t=e.mask;return{...Tn(e,((t,e)=>!e.startsWith("_"))),mask:e.constructor,_mask:t,...i}}}return Fn(t)?{...t}:{mask:t}}function Wn(t){if(zn.Masked&&t instanceof zn.Masked)return t;const e=qn(t),i=Un(e.mask);if(!i)throw new Error("Masked class is not found for provided mask "+e.mask+", appropriate module needs to be imported manually before creating mask.");return e.mask===i&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new i(e)}zn.createMask=Wn;class jn{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return null!=t?t:this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return null!=t?t:this.value.length}select(t,e){if(null!=t&&null!=e&&(t!==this.selectionStart||e!==this.selectionEnd))try{this._unsafeSelect(t,e)}catch{}}get isActive(){return!1}}zn.MaskElement=jn;class Gn extends jn{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,e,i;return null!=(t=null==(e=(i=this.input).getRootNode)?void 0:e.call(i))?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){return this._handlers.redo&&(90===t.keyCode&&t.shiftKey&&(t.metaKey||t.ctrlKey)||89===t.keyCode&&t.ctrlKey)?(t.preventDefault(),this._handlers.redo(t)):this._handlers.undo&&90===t.keyCode&&(t.metaKey||t.ctrlKey)?(t.preventDefault(),this._handlers.undo(t)):void(t.isComposing||this._handlers.selectionChange(t))}_onBeforeinput(t){return"historyUndo"===t.inputType&&this._handlers.undo?(t.preventDefault(),this._handlers.undo(t)):"historyRedo"===t.inputType&&this._handlers.redo?(t.preventDefault(),this._handlers.redo(t)):void 0}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}zn.HTMLMaskElement=Gn;class Kn extends Gn{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return null!=this.input.selectionStart?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,e){this.input.setSelectionRange(t,e)}get value(){return this.input.value}set value(t){this.input.value=t}}zn.HTMLMaskElement=Gn;class Qn extends Gn{get _unsafeSelectionStart(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),i=e&&e.anchorOffset,s=e&&e.focusOffset;return null==s||null==i||i<s?i:s}get _unsafeSelectionEnd(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),i=e&&e.anchorOffset,s=e&&e.focusOffset;return null==s||null==i||i>s?i:s}_unsafeSelect(t,e){if(!this.rootElement.createRange)return;const i=this.rootElement.createRange();i.setStart(this.input.firstChild||this.input,t),i.setEnd(this.input.lastChild||this.input,e);const s=this.rootElement,a=s.getSelection&&s.getSelection();a&&(a.removeAllRanges(),a.addRange(i))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}zn.HTMLContenteditableMaskElement=Qn;class Xn{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return 0===this.states.length}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>Xn.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}Xn.MAX_LENGTH=100;zn.InputMask=class{constructor(t,e){this.el=t instanceof jn?t:t.isContentEditable&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName?new Qn(t):new Kn(t),this.masked=Wn(e),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Xn,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var e;return null==t||(null==(e=this.masked)?void 0:e.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof zn.Masked)&&this.masked.constructor===Un(t))return void this.masked.updateOptions({mask:t});const e=t instanceof zn.Masked?t:Wn({mask:t});e.unmaskedValue=this.masked.unmaskedValue,this.masked=e}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,e){const i=this._listeners[t];i&&i.forEach((t=>t(e)))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){this.el&&this.el.isActive&&(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const e=this.masked.unmaskedValue,i=this.masked.value,s=this.masked.rawInputValue,a=this.displayValue,n=this.unmaskedValue!==e||this.value!==i||this._rawInputValue!==s;this._unmaskedValue=e,this._value=i,this._rawInputValue=s,this.el.value!==a&&(this.el.value=a),"auto"===t?this.alignCursor():null!=t&&(this.cursorPos=t),n&&this._fireChangeEvents(),this._historyChanging||!n&&!this.history.isEmpty||this.history.push({unmaskedValue:e,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:e,...i}=t,s=!this.maskEquals(e),a=this.masked.optionsIsChanged(i);s&&(this.mask=e),a&&this.masked.updateOptions(i),(s||a)&&this.updateControl()}updateCursor(t){null!=t&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout((()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())}),10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,Hn))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,e){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e),this}off(t,e){if(!this._listeners[t])return this;if(!e)return delete this._listeners[t],this;const i=this._listeners[t].indexOf(e);return i>=0&&this._listeners[t].splice(i,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const e=new Yn({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),i=this.masked.rawInputValue,s=this.masked.splice(e.startChangePos,e.removed.length,e.inserted,e.removeDirection,{input:!0,raw:!0}).offset,a=i===this.masked.rawInputValue?e.removeDirection:Pn;let n=this.masked.nearestInputPos(e.startChangePos+s,a);a!==Pn&&(n=this.masked.nearestInputPos(n,Pn)),this.updateControl(n),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}};class Jn{static normalize(t){return Array.isArray(t)?t:[t,new Jn]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return Boolean(this.rawInserted)||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}zn.ChangeDetails=Jn;class tr{constructor(t,e,i){void 0===t&&(t=""),void 0===e&&(e=0),this.value=t,this.from=e,this.stop=i}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||null!=t&&this.from>=t)return"";const e=this.value[0];return this.value=this.value.slice(1),e}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class er{constructor(t){this._value="",this._update({...er.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,e){void 0===e&&(e={input:!0}),this.reset(),this.append(t,e,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,e){return t}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),Math.min(this.displayValue.length,e-t)}extractInput(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),this.displayValue.slice(t,e)}extractTail(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),new tr(this.extractInput(t,e),t)}appendTail(t){return $n(t)&&(t=new tr(String(t))),t.appendTo(this)}_appendCharRaw(t,e){return t?(this._value+=t,new Jn({inserted:t,rawInserted:t})):new Jn}_appendChar(t,e,i){void 0===e&&(e={});const s=this.state;let a;if([t,a]=this.doPrepareChar(t,e),t&&(a=a.aggregate(this._appendCharRaw(t,e)),!a.rawInserted&&"pad"===this.autofix)){const i=this.state;this.state=s;let n=this.pad(e);const r=this._appendCharRaw(t,e);n=n.aggregate(r),r.rawInserted||n.equals(a)?a=n:this.state=i}if(a.inserted){let t,n=!1!==this.doValidate(e);if(n&&null!=i){const e=this.state;if(!0===this.overwrite){t=i.state;for(let t=0;t<a.rawInserted.length;++t)i.unshift(this.displayValue.length-a.tailShift)}let s=this.appendTail(i);if(n=s.rawInserted.length===i.toString().length,!(n&&s.inserted||"shift"!==this.overwrite)){this.state=e,t=i.state;for(let t=0;t<a.rawInserted.length;++t)i.shift();s=this.appendTail(i),n=s.rawInserted.length===i.toString().length}n&&s.inserted&&(this.state=e)}n||(a=new Jn,this.state=s,i&&t&&(i.state=t))}return a}_appendPlaceholder(){return new Jn}_appendEager(){return new Jn}append(t,e,i){if(!$n(t))throw new Error("value should be string");const s=$n(i)?new tr(String(i)):i;let a;null!=e&&e.tail&&(e._beforeTailState=this.state),[t,a]=this.doPrepare(t,e);for(let i=0;i<t.length;++i){const n=this._appendChar(t[i],e,s);if(!n.rawInserted&&!this.doSkipInvalid(t[i],e,s))break;a.aggregate(n)}return(!0===this.eager||"append"===this.eager)&&null!=e&&e.input&&t&&a.aggregate(this._appendEager()),null!=s&&(a.tailShift+=this.appendTail(s).tailShift),a}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(e),new Jn}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const e=this.rawInputValue,i=this.value,s=t();return this.rawInputValue=e,this.value&&this.value!==i&&0===i.indexOf(this.value)&&(this.append(i.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,s}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const e=this.state,i=t(this);return this.state=e,delete this._isolated,i}doSkipInvalid(t,e,i){return Boolean(this.skipInvalid)}doPrepare(t,e){return void 0===e&&(e={}),Jn.normalize(this.prepare?this.prepare(t,this,e):t)}doPrepareChar(t,e){return void 0===e&&(e={}),Jn.normalize(this.prepareChar?this.prepareChar(t,this,e):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,e,i,s,a){void 0===i&&(i=""),void 0===s&&(s=Pn),void 0===a&&(a={input:!0});const n=t+e,r=this.extractTail(n),o=!0===this.eager||"remove"===this.eager;let l;o&&(s=function(t){switch(t){case Hn:return In;case Ln:return Rn;default:return t}}(s),l=this.extractInput(0,n,{raw:!0}));let c=t;const d=new Jn;if(s!==Pn&&(c=this.nearestInputPos(t,e>1&&0!==t&&!o?Pn:s),d.tailShift=c-t),d.aggregate(this.remove(c)),o&&s!==Pn&&l===this.rawInputValue)if(s===In){let t;for(;l===this.rawInputValue&&(t=this.displayValue.length);)d.aggregate(new Jn({tailShift:-1})).aggregate(this.remove(t-1))}else s===Rn&&r.unshift();return d.aggregate(this.append(i,a,r))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!Nn(this,t)}typedValueEquals(t){const e=this.typedValue;return t===e||er.EMPTY_VALUES.includes(t)&&er.EMPTY_VALUES.includes(e)||!!this.format&&this.format(t,this)===this.format(this.typedValue,this)}pad(t){return new Jn}}er.DEFAULTS={skipInvalid:!0},er.EMPTY_VALUES=[void 0,null,""],zn.Masked=er;class ir{constructor(t,e){void 0===t&&(t=[]),void 0===e&&(e=0),this.chunks=t,this.from=e}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=$n(t)?new tr(String(t)):t;const e=this.chunks[this.chunks.length-1],i=e&&(e.stop===t.stop||null==t.stop)&&t.from===e.from+e.toString().length;if(t instanceof tr)i?e.extend(t.toString()):this.chunks.push(t);else if(t instanceof ir){if(null==t.stop){let e;for(;t.chunks.length&&null==t.chunks[0].stop;)e=t.chunks.shift(),e.from+=t.from,this.extend(e)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof zn.MaskedPattern)){return new tr(this.toString()).appendTo(t)}const e=new Jn;for(let i=0;i<this.chunks.length;++i){const s=this.chunks[i],a=t._mapPosToBlock(t.displayValue.length),n=s.stop;let r;if(null!=n&&(!a||a.index<=n)&&((s instanceof ir||t._stops.indexOf(n)>=0)&&e.aggregate(t._appendPlaceholder(n)),r=s instanceof ir&&t._blocks[n]),r){const i=r.appendTail(s);e.aggregate(i);const a=s.toString().slice(i.rawInserted.length);a&&e.aggregate(t.append(a,{tail:!0}))}else e.aggregate(t.append(s.toString(),{tail:!0}))}return e}get state(){return{chunks:this.chunks.map((t=>t.state)),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:e,...i}=t;Object.assign(this,i),this.chunks=e.map((t=>{const e="chunks"in t?new ir:new tr;return e.state=t,e}))}unshift(t){if(!this.chunks.length||null!=t&&this.from>=t)return"";const e=null!=t?t-this.from:t;let i=0;for(;i<this.chunks.length;){const t=this.chunks[i],s=t.unshift(e);if(t.toString()){if(!s)break;++i}else this.chunks.splice(i,1);if(s)return s}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const e=this.chunks[t],i=e.shift();if(e.toString()){if(!i)break;--t}else this.chunks.splice(t,1);if(i)return i}return""}}class sr{constructor(t,e){this.masked=t,this._log=[];const{offset:i,index:s}=t._mapPosToBlock(e)||(e<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=i,this.index=s,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=(null==(e=this.block)?void 0:e.displayValue.length)||0){var e;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft((()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,In),0!==this.offset||void 0}))}pushLeftBeforeInput(){return this._pushLeft((()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Hn),!0}))}pushLeftBeforeRequired(){return this._pushLeft((()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Hn),!0}))}pushRightBeforeFilled(){return this._pushRight((()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,Rn),this.offset!==this.block.value.length||void 0}))}pushRightBeforeInput(){return this._pushRight((()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Pn),!0}))}pushRightBeforeRequired(){return this._pushRight((()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Pn),!0}))}}class ar{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(e),this._value||(this._isRawInput=!1),new Jn}nearestInputPos(t,e){void 0===e&&(e=Pn);const i=this._value.length;switch(e){case Hn:case In:return 0;default:return i}}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),this._isRawInput?e-t:0}extractInput(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),void 0===i&&(i={}),i.raw&&this._isRawInput&&this._value.slice(t,e)||""}get isComplete(){return!0}get isFilled(){return Boolean(this._value)}_appendChar(t,e){if(void 0===e&&(e={}),this.isFilled)return new Jn;const i=!0===this.eager||"append"===this.eager,s=this.char===t&&(this.isUnmasking||e.input||e.raw)&&(!e.raw||!i)&&!e.tail,a=new Jn({inserted:this.char,rawInserted:s?this.char:""});return this._value=this.char,this._isRawInput=s&&(e.raw||e.input),a}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new Jn;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new tr("")}appendTail(t){return $n(t)&&(t=new tr(String(t))),t.appendTo(this)}append(t,e,i){const s=this._appendChar(t[0],e);return null!=i&&(s.tailShift+=this.appendTail(i).tailShift),s}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=Boolean(t._rawInputValue)}pad(t){return this._appendPlaceholder()}}class nr{constructor(t){const{parent:e,isOptional:i,placeholderChar:s,displayChar:a,lazy:n,eager:r,...o}=t;this.masked=Wn(o),Object.assign(this,{parent:e,isOptional:i,placeholderChar:s,displayChar:a,lazy:n,eager:r})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),0===t&&e>=1?(this.isFilled=!1,this.masked.remove(t,e)):new Jn}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return Boolean(this.masked.value)||this.isOptional}_appendChar(t,e){if(void 0===e&&(e={}),this.isFilled)return new Jn;const i=this.masked.state;let s=this.masked._appendChar(t,this.currentMaskFlags(e));return s.inserted&&!1===this.doValidate(e)&&(s=new Jn,this.masked.state=i),s.inserted||this.isOptional||this.lazy||e.input||(s.inserted=this.placeholderChar),s.skip=!s.inserted&&!this.isOptional,this.isFilled=Boolean(s.inserted),s}append(t,e,i){return this.masked.append(t,this.currentMaskFlags(e),i)}_appendPlaceholder(){return this.isFilled||this.isOptional?new Jn:(this.isFilled=!0,new Jn({inserted:this.placeholderChar}))}_appendEager(){return new Jn}extractTail(t,e){return this.masked.extractTail(t,e)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),this.masked.extractInput(t,e,i)}nearestInputPos(t,e){void 0===e&&(e=Pn);const i=this.value.length,s=Math.min(Math.max(t,0),i);switch(e){case Hn:case In:return this.isComplete?s:0;case Ln:case Rn:return this.isComplete?s:i;default:return s}}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),this.value.slice(t,e).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var e;return{...t,_beforeTailState:(null==t||null==(e=t._beforeTailState)?void 0:e.masked)||(null==t?void 0:t._beforeTailState)}}pad(t){return new Jn}}nr.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};zn.MaskedRegExp=class extends er{updateOptions(t){super.updateOptions(t)}_update(t){const e=t.mask;e&&(t.validate=t=>t.search(e)>=0),super._update(t)}};class rr extends er{constructor(t){super({...rr.DEFAULTS,...t,definitions:Object.assign({},nr.DEFAULT_DEFINITIONS,null==t?void 0:t.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const e=this.mask;if(!e||!t)return;let i=!1,s=!1;for(let a=0;a<e.length;++a){if(this.blocks){const t=e.slice(a),i=Object.keys(this.blocks).filter((e=>0===t.indexOf(e)));i.sort(((t,e)=>e.length-t.length));const s=i[0];if(s){const{expose:t,repeat:e,...i}=qn(this.blocks[s]),n={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...i,repeat:e,parent:this},r=null!=e?new zn.RepeatBlock(n):Wn(n);r&&(this._blocks.push(r),t&&(this.exposeBlock=r),this._maskedBlocks[s]||(this._maskedBlocks[s]=[]),this._maskedBlocks[s].push(this._blocks.length-1)),a+=s.length-1;continue}}let n=e[a],r=n in t;if(n===rr.STOP_CHAR){this._stops.push(this._blocks.length);continue}if("{"===n||"}"===n){i=!i;continue}if("["===n||"]"===n){s=!s;continue}if(n===rr.ESCAPE_CHAR){if(++a,n=e[a],!n)break;r=!1}const o=r?new nr({isOptional:s,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...qn(t[n]),parent:this}):new ar({char:n,eager:this.eager,isUnmasking:i});this._blocks.push(o)}}get state(){return{...super.state,_blocks:this._blocks.map((t=>t.state))}}set state(t){if(!t)return void this.reset();const{_blocks:e,...i}=t;this._blocks.forEach(((t,i)=>t.state=e[i])),super.state=i}reset(){super.reset(),this._blocks.forEach((t=>t.reset()))}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every((t=>t.isComplete))}get isFilled(){return this._blocks.every((t=>t.isFilled))}get isFixed(){return this._blocks.every((t=>t.isFixed))}get isOptional(){return this._blocks.every((t=>t.isOptional))}doCommit(){this._blocks.forEach((t=>t.doCommit())),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce(((t,e)=>t+e.unmaskedValue),"")}set unmaskedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(e),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce(((t,e)=>t+e.value),"")}set value(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(e),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(e),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce(((t,e)=>t+e.displayValue),"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const e=new Jn;let i=null==(t=this._mapPosToBlock(this.displayValue.length))?void 0:t.index;if(null==i)return e;this._blocks[i].isFilled&&++i;for(let t=i;t<this._blocks.length;++t){const i=this._blocks[t]._appendEager();if(!i.inserted)break;e.aggregate(i)}return e}_appendCharRaw(t,e){void 0===e&&(e={});const i=this._mapPosToBlock(this.displayValue.length),s=new Jn;if(!i)return s;for(let n,r=i.index;n=this._blocks[r];++r){var a;const i=n._appendChar(t,{...e,_beforeTailState:null==(a=e._beforeTailState)||null==(a=a._blocks)?void 0:a[r]});if(s.aggregate(i),i.consumed)break}return s}extractTail(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const i=new ir;return t===e||this._forEachBlocksInRange(t,e,((t,e,s,a)=>{const n=t.extractTail(s,a);n.stop=this._findStopBefore(e),n.from=this._blockStartPos(e),n instanceof ir&&(n.blockIndex=e),i.extend(n)})),i}extractInput(t,e,i){if(void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),void 0===i&&(i={}),t===e)return"";let s="";return this._forEachBlocksInRange(t,e,((t,e,a,n)=>{s+=t.extractInput(a,n,i)})),s}_findStopBefore(t){let e;for(let i=0;i<this._stops.length;++i){const s=this._stops[i];if(!(s<=t))break;e=s}return e}_appendPlaceholder(t){const e=new Jn;if(this.lazy&&null==t)return e;const i=this._mapPosToBlock(this.displayValue.length);if(!i)return e;const s=i.index,a=null!=t?t:this._blocks.length;return this._blocks.slice(s,a).forEach((i=>{var s;i.lazy&&null==t||e.aggregate(i._appendPlaceholder(null==(s=i._blocks)?void 0:s.length))})),e}_mapPosToBlock(t){let e="";for(let i=0;i<this._blocks.length;++i){const s=this._blocks[i],a=e.length;if(e+=s.displayValue,t<=e.length)return{index:i,offset:t-a}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce(((t,e)=>t+e.displayValue.length),0)}_forEachBlocksInRange(t,e,i){void 0===e&&(e=this.displayValue.length);const s=this._mapPosToBlock(t);if(s){const t=this._mapPosToBlock(e),a=t&&s.index===t.index,n=s.offset,r=t&&a?t.offset:this._blocks[s.index].displayValue.length;if(i(this._blocks[s.index],s.index,n,r),t&&!a){for(let e=s.index+1;e<t.index;++e)i(this._blocks[e],e,0,this._blocks[e].displayValue.length);i(this._blocks[t.index],t.index,0,t.offset)}}}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const i=super.remove(t,e);return this._forEachBlocksInRange(t,e,((t,e,s,a)=>{i.aggregate(t.remove(s,a))})),i}nearestInputPos(t,e){if(void 0===e&&(e=Pn),!this._blocks.length)return 0;const i=new sr(this,t);if(e===Pn)return i.pushRightBeforeInput()?i.pos:(i.popState(),i.pushLeftBeforeInput()?i.pos:this.displayValue.length);if(e===Hn||e===In){if(e===Hn){if(i.pushRightBeforeFilled(),i.ok&&i.pos===t)return t;i.popState()}if(i.pushLeftBeforeInput(),i.pushLeftBeforeRequired(),i.pushLeftBeforeFilled(),e===Hn){if(i.pushRightBeforeInput(),i.pushRightBeforeRequired(),i.ok&&i.pos<=t)return i.pos;if(i.popState(),i.ok&&i.pos<=t)return i.pos;i.popState()}return i.ok?i.pos:e===In?0:(i.popState(),i.ok?i.pos:(i.popState(),i.ok?i.pos:0))}return e===Ln||e===Rn?(i.pushRightBeforeInput(),i.pushRightBeforeRequired(),i.pushRightBeforeFilled()?i.pos:e===Rn?this.displayValue.length:(i.popState(),i.ok?i.pos:(i.popState(),i.ok?i.pos:this.nearestInputPos(t,Hn)))):t}totalInputPositions(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);let i=0;return this._forEachBlocksInRange(t,e,((t,e,s,a)=>{i+=t.totalInputPositions(s,a)})),i}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const e=this._maskedBlocks[t];return e?e.map((t=>this._blocks[t])):[]}pad(t){const e=new Jn;return this._forEachBlocksInRange(0,this.displayValue.length,(i=>e.aggregate(i.pad(t)))),e}}rr.DEFAULTS={...er.DEFAULTS,lazy:!0,placeholderChar:"_"},rr.STOP_CHAR="`",rr.ESCAPE_CHAR="\\",rr.InputDefinition=nr,rr.FixedDefinition=ar,zn.MaskedPattern=rr;class or extends rr{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:e=this.to||0,from:i=this.from||0,maxLength:s=this.maxLength||0,autofix:a=this.autofix,...n}=t;this.to=e,this.from=i,this.maxLength=Math.max(String(e).length,s),this.autofix=a;const r=String(this.from).padStart(this.maxLength,"0"),o=String(this.to).padStart(this.maxLength,"0");let l=0;for(;l<o.length&&o[l]===r[l];)++l;n.mask=o.slice(0,l).replace(/0/g,"\\0")+"0".repeat(this.maxLength-l),super._update(n)}get isComplete(){return super.isComplete&&Boolean(this.value)}boundaries(t){let e="",i="";const[,s,a]=t.match(/^(\D*)(\d*)(\D*)/)||[];return a&&(e="0".repeat(s.length)+a,i="9".repeat(s.length)+a),e=e.padEnd(this.maxLength,"0"),i=i.padEnd(this.maxLength,"9"),[e,i]}doPrepareChar(t,e){let i;return void 0===e&&(e={}),[t,i]=super.doPrepareChar(t.replace(/\D/g,""),e),t||(i.skip=!this.isComplete),[t,i]}_appendCharRaw(t,e){if(void 0===e&&(e={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,e);const i=String(this.from).padStart(this.maxLength,"0"),s=String(this.to).padStart(this.maxLength,"0"),[a,n]=this.boundaries(this.value+t);return Number(n)<this.from?super._appendCharRaw(i[this.value.length],e):Number(a)>this.to?!e.tail&&"pad"===this.autofix&&this.value.length+1<this.maxLength?super._appendCharRaw(i[this.value.length],e).aggregate(this._appendCharRaw(t,e)):super._appendCharRaw(s[this.value.length],e):super._appendCharRaw(t,e)}doValidate(t){const e=this.value;if(-1===e.search(/[^0]/)&&e.length<=this._matchFrom)return!0;const[i,s]=this.boundaries(e);return this.from<=Number(s)&&Number(i)<=this.to&&super.doValidate(t)}pad(t){const e=new Jn;if(this.value.length===this.maxLength)return e;const i=this.value,s=this.maxLength-this.value.length;if(s){this.reset();for(let i=0;i<s;++i)e.aggregate(super._appendCharRaw("0",t));i.split("").forEach((t=>this._appendCharRaw(t)))}return e}}zn.MaskedRange=or;class lr extends rr{static extractPatternOptions(t){const{mask:e,pattern:i,...s}=t;return{...s,mask:$n(e)?e:i}}constructor(t){super(lr.extractPatternOptions({...lr.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:e,pattern:i,blocks:s,...a}={...lr.DEFAULTS,...t},n=Object.assign({},lr.GET_DEFAULT_BLOCKS());t.min&&(n.Y.from=t.min.getFullYear()),t.max&&(n.Y.to=t.max.getFullYear()),t.min&&t.max&&n.Y.from===n.Y.to&&(n.m.from=t.min.getMonth()+1,n.m.to=t.max.getMonth()+1,n.m.from===n.m.to&&(n.d.from=t.min.getDate(),n.d.to=t.max.getDate())),Object.assign(n,this.blocks,s),super._update({...a,mask:$n(e)?e:i,blocks:n})}doValidate(t){const e=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&null!=e&&(null==this.min||this.min<=e)&&(null==this.max||e<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(lr.extractPatternOptions(t))}}lr.GET_DEFAULT_BLOCKS=()=>({d:{mask:or,from:1,to:31,maxLength:2},m:{mask:or,from:1,to:12,maxLength:2},Y:{mask:or,from:1900,to:9999}}),lr.DEFAULTS={...rr.DEFAULTS,mask:Date,pattern:"d{.}`m{.}`Y",format:(t,e)=>{if(!t)return"";return[String(t.getDate()).padStart(2,"0"),String(t.getMonth()+1).padStart(2,"0"),t.getFullYear()].join(".")},parse:(t,e)=>{const[i,s,a]=t.split(".").map(Number);return new Date(a,s-1,i)}},zn.MaskedDate=lr;class cr extends er{constructor(t){super({...cr.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map((t=>{const{expose:e,...i}=qn(t),s=Wn({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return e&&(this.exposeMask=s),s})):[])}_appendCharRaw(t,e){void 0===e&&(e={});const i=this._applyDispatch(t,e);return this.currentMask&&i.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(e))),i}_applyDispatch(t,e,i){void 0===t&&(t=""),void 0===e&&(e={}),void 0===i&&(i="");const s=e.tail&&null!=e._beforeTailState?e._beforeTailState._value:this.value,a=this.rawInputValue,n=e.tail&&null!=e._beforeTailState?e._beforeTailState._rawInputValue:a,r=a.slice(n.length),o=this.currentMask,l=new Jn,c=null==o?void 0:o.state;return this.currentMask=this.doDispatch(t,{...e},i),this.currentMask&&(this.currentMask!==o?(this.currentMask.reset(),n&&(this.currentMask.append(n,{raw:!0}),l.tailShift=this.currentMask.value.length-s.length),r&&(l.tailShift+=this.currentMask.append(r,{raw:!0,tail:!0}).tailShift)):c&&(this.currentMask.state=c)),l}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const e=new Jn;return t&&e.aggregate(this._applyDispatch("",{},t)),e.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var e,i;return{...t,_beforeTailState:(null==(e=t._beforeTailState)?void 0:e.currentMaskRef)===this.currentMask&&(null==(i=t._beforeTailState)?void 0:i.currentMask)||t._beforeTailState}}doDispatch(t,e,i){return void 0===e&&(e={}),void 0===i&&(i=""),this.dispatch(t,this,e,i)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,e){void 0===e&&(e={});let[i,s]=super.doPrepare(t,e);if(this.currentMask){let t;[i,t]=super.doPrepare(i,this.currentMaskFlags(e)),s=s.aggregate(t)}return[i,s]}doPrepareChar(t,e){void 0===e&&(e={});let[i,s]=super.doPrepareChar(t,e);if(this.currentMask){let t;[i,t]=super.doPrepareChar(i,this.currentMaskFlags(e)),s=s.aggregate(t)}return[i,s]}reset(){var t;null==(t=this.currentMask)||t.reset(),this.compiledMasks.forEach((t=>t.reset()))}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask)return this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,void this._applyDispatch();let e=String(t);this.currentMask&&(this.currentMask.typedValue=t,e=this.currentMask.unmaskedValue),this.unmaskedValue=e}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return Boolean(null==(t=this.currentMask)?void 0:t.isComplete)}get isFilled(){var t;return Boolean(null==(t=this.currentMask)?void 0:t.isFilled)}remove(t,e){const i=new Jn;return this.currentMask&&i.aggregate(this.currentMask.remove(t,e)).aggregate(this._applyDispatch()),i}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map((t=>t.state)),currentMaskRef:this.currentMask,currentMask:null==(t=this.currentMask)?void 0:t.state}}set state(t){const{compiledMasks:e,currentMaskRef:i,currentMask:s,...a}=t;e&&this.compiledMasks.forEach(((t,i)=>t.state=e[i])),null!=i&&(this.currentMask=i,this.currentMask.state=s),super.state=a}extractInput(t,e,i){return this.currentMask?this.currentMask.extractInput(t,e,i):""}extractTail(t,e){return this.currentMask?this.currentMask.extractTail(t,e):super.extractTail(t,e)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,e){return this.currentMask?this.currentMask.nearestInputPos(t,e):super.nearestInputPos(t,e)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every(((e,i)=>{if(!t[i])return;const{mask:s,...a}=t[i];return Nn(e,a)&&e.maskEquals(s)})):super.maskEquals(t)}typedValueEquals(t){var e;return Boolean(null==(e=this.currentMask)?void 0:e.typedValueEquals(t))}}cr.DEFAULTS={...er.DEFAULTS,dispatch:(t,e,i,s)=>{if(!e.compiledMasks.length)return;const a=e.rawInputValue,n=e.compiledMasks.map(((n,r)=>{const o=e.currentMask===n,l=o?n.displayValue.length:n.nearestInputPos(n.displayValue.length,In);return n.rawInputValue!==a?(n.reset(),n.append(a,{raw:!0})):o||n.remove(l),n.append(t,e.currentMaskFlags(i)),n.appendTail(s),{index:r,weight:n.rawInputValue.length,totalInputPositions:n.totalInputPositions(0,Math.max(l,n.nearestInputPos(n.displayValue.length,In)))}}));return n.sort(((t,e)=>e.weight-t.weight||e.totalInputPositions-t.totalInputPositions)),e.compiledMasks[n[0].index]}},zn.MaskedDynamic=cr;class dr extends rr{constructor(t){super({...dr.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:e,...i}=t;if(e){const t=e.map((t=>t.length)),s=Math.min(...t),a=Math.max(...t)-s;i.mask="*".repeat(s),a&&(i.mask+="["+"*".repeat(a)+"]"),this.enum=e}super._update(i)}_appendCharRaw(t,e){void 0===e&&(e={});const i=Math.min(this.nearestInputPos(0,Rn),this.value.length),s=this.enum.filter((e=>this.matchValue(e,this.unmaskedValue+t,i)));if(s.length){1===s.length&&this._forEachBlocksInRange(0,this.value.length,((t,i)=>{const a=s[0][i];i>=this.value.length||a===t.value||(t.reset(),t._appendChar(a,e))}));const t=super._appendCharRaw(s[0][this.value.length],e);return 1===s.length&&s[0].slice(this.unmaskedValue.length).split("").forEach((e=>t.aggregate(super._appendCharRaw(e)))),t}return new Jn({skip:!this.isComplete})}extractTail(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),new tr("",t)}remove(t,e){if(void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),t===e)return new Jn;const i=Math.min(super.nearestInputPos(0,Rn),this.value.length);let s;for(s=t;s>=0;--s){if(this.enum.filter((t=>this.matchValue(t,this.value.slice(i,s),i))).length>1)break}const a=super.remove(s,e);return a.tailShift+=s-t,a}get isComplete(){return this.enum.indexOf(this.value)>=0}}dr.DEFAULTS={...rr.DEFAULTS,matchValue:(t,e,i)=>t.indexOf(e,i)===i},zn.MaskedEnum=dr;var hr;zn.MaskedFunction=class extends er{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}};class ur extends er{constructor(t){super({...ur.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),e=(this.scale?"("+On(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+"\\d*"+e),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(On).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(On(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)}doPrepareChar(t,e){void 0===e&&(e={});const[i,s]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(e.input&&e.raw||!e.input&&!e.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),e);return t&&!i&&(s.skip=!0),!i||this.allowPositive||this.value||"-"===i||s.aggregate(this._appendChar("-")),[i,s]}_separatorsCount(t,e){void 0===e&&(e=!1);let i=0;for(let s=0;s<t;++s)this._value.indexOf(this.thousandsSeparator,s)===s&&(++i,e&&(t+=this.thousandsSeparator.length));return i}_separatorsCountFromSlice(t){return void 0===t&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e),this._removeThousandsSeparators(super.extractInput(t,e,i))}_appendCharRaw(t,e){void 0===e&&(e={});const i=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,s=this._separatorsCountFromSlice(i);this._value=this._removeThousandsSeparators(this.value);const a=this._value;this._value+=t;const n=this.number;let r,o=!isNaN(n),l=!1;if(o){let t;null!=this.min&&this.min<0&&this.number<this.min&&(t=this.min),null!=this.max&&this.max>0&&this.number>this.max&&(t=this.max),null!=t&&(this.autofix?(this._value=this.format(t,this).replace(ur.UNMASKED_RADIX,this.radix),l||(l=a===this._value&&!e.tail)):o=!1),o&&(o=Boolean(this._value.match(this._numberRegExp)))}o?r=new Jn({inserted:this._value.slice(a.length),rawInserted:l?"":t,skip:l}):(this._value=a,r=new Jn),this._value=this._insertThousandsSeparators(this._value);const c=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,d=this._separatorsCountFromSlice(c);return r.tailShift+=(d-s)*this.thousandsSeparator.length,r}_findSeparatorAround(t){if(this.thousandsSeparator){const e=t-this.thousandsSeparator.length+1,i=this.value.indexOf(this.thousandsSeparator,e);if(i<=t)return i}return-1}_adjustRangeWithSeparators(t,e){const i=this._findSeparatorAround(t);i>=0&&(t=i);const s=this._findSeparatorAround(e);return s>=0&&(e=s+this.thousandsSeparator.length),[t,e]}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e);const i=this.value.slice(0,t),s=this.value.slice(e),a=this._separatorsCount(i.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(i+s));const n=this._separatorsCountFromSlice(i);return new Jn({tailShift:(n-a)*this.thousandsSeparator.length})}nearestInputPos(t,e){if(!this.thousandsSeparator)return t;switch(e){case Pn:case Hn:case In:{const i=this._findSeparatorAround(t-1);if(i>=0){const s=i+this.thousandsSeparator.length;if(t<s||this.value.length<=s||e===In)return i}break}case Ln:case Rn:{const e=this._findSeparatorAround(t);if(e>=0)return e+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let e=t;null!=this.min&&(e=Math.max(e,this.min)),null!=this.max&&(e=Math.min(e,this.max)),e!==t&&(this.unmaskedValue=this.format(e,this));let i=this.value;this.normalizeZeros&&(i=this._normalizeZeros(i)),this.padFractionalZeros&&this.scale>0&&(i=this._padFractionalZeros(i)),this._value=i}super.doCommit()}_normalizeZeros(t){const e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,((t,e,i,s)=>e+s)),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)}doSkipInvalid(t,e,i){void 0===e&&(e={});const s=0===this.scale&&t!==this.thousandsSeparator&&(t===this.radix||t===ur.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,e,i)&&!s}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,ur.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(ur.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return null!=this.min&&this.min<0||null!=this.max&&this.max<0}get allowPositive(){return null!=this.min&&this.min>0||null!=this.max&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||ur.EMPTY_VALUES.includes(t)&&ur.EMPTY_VALUES.includes(this.typedValue))&&!(0===t&&""===this.value)}}hr=ur,ur.UNMASKED_RADIX=".",ur.EMPTY_VALUES=[...er.EMPTY_VALUES,0],ur.DEFAULTS={...er.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[hr.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:t=>t.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},zn.MaskedNumber=ur;const pr={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function gr(t,e,i){void 0===e&&(e=pr.MASKED),void 0===i&&(i=pr.MASKED);const s=Wn(t);return t=>s.runIsolated((s=>(s[e]=t,s[i])))}zn.PIPE_TYPE=pr,zn.createPipe=gr,zn.pipe=function(t,e,i,s){return gr(e,i,s)(t)};zn.RepeatBlock=class extends rr{get repeatFrom(){var t;return null!=(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)?t:0}get repeatTo(){var t;return null!=(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var e,i,s;const{repeat:a,...n}=qn(t);this._blockOpts=Object.assign({},this._blockOpts,n);const r=Wn(this._blockOpts);this.repeat=null!=(e=null!=(i=null!=a?a:r.repeat)?i:this.repeat)?e:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&(null==(s=this._blocks)?void 0:s.length)||0,this.repeatFrom)),blocks:{m:r},eager:r.eager,overwrite:r.overwrite,skipInvalid:r.skipInvalid,lazy:r.lazy,placeholderChar:r.placeholderChar,displayChar:r.displayChar})}_allocateBlock(t){return t<this._blocks.length?this._blocks[t]:this.repeatTo===1/0||this._blocks.length<this.repeatTo?(this._blocks.push(Wn(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]):void 0}_appendCharRaw(t,e){void 0===e&&(e={});const i=new Jn;for(let o,l,c=null!=(s=null==(a=this._mapPosToBlock(this.displayValue.length))?void 0:a.index)?s:Math.max(this._blocks.length-1,0);o=null!=(n=this._blocks[c])?n:l=!l&&this._allocateBlock(c);++c){var s,a,n,r;const d=o._appendChar(t,{...e,_beforeTailState:null==(r=e._beforeTailState)||null==(r=r._blocks)?void 0:r[c]});if(d.skip&&l){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(i.aggregate(d),d.consumed)break}return i}_trimEmptyTail(t,e){var i,s;void 0===t&&(t=0);const a=Math.max((null==(i=this._mapPosToBlock(t))?void 0:i.index)||0,this.repeatFrom,0);let n;null!=e&&(n=null==(s=this._mapPosToBlock(e))?void 0:s.index),null==n&&(n=this._blocks.length-1);let r=0;for(let t=n;a<=t&&!this._blocks[t].unmaskedValue;--t,++r);r&&(this._blocks.splice(n-r+1,r),this.mask=this.mask.slice(r))}reset(){super.reset(),this._trimEmptyTail()}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const i=super.remove(t,e);return this._trimEmptyTail(t,e),i}totalInputPositions(t,e){return void 0===t&&(t=0),null==e&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,e)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}};try{globalThis.IMask=zn}catch{}var vr=_i`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-1);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,fr=_i`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-1);line-height:var(--sgds-line-height-20)}.form-text.disabled{opacity:var(--sgds-opacity-50)}`,mr=_i`.form-label{color:var(--sgds-form-color-default);margin-bottom:0}.form-label.disabled{opacity:var(--sgds-opacity-50)}.form-check-label{color:var(--sgds-form-color-default)}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{cursor:not-allowed}`,wr=_i`.form-control::placeholder{color:var(--sgds-form-color-subtle);font-family:var(--sgds-font-family-brand);font-weight:var(--sgds-font-weight-light);line-height:var(--sgds-line-height-24)}`;class yr extends Wa{constructor(){super(...arguments),this.label="",this.hintText="",this.disabled=!1,this.invalid=!1,this._controlId=ja("input"),this._labelId=ja("label")}setInvalid(t){this.invalid=t,t?this.emit("sgds-invalid"):this.emit("sgds-valid")}}yr.styles=[...Wa.styles,vr,fr,mr,wr],t([Gi({reflect:!0})],yr.prototype,"label",void 0),t([Gi({reflect:!0})],yr.prototype,"hintText",void 0),t([Gi({reflect:!0})],yr.prototype,"name",void 0),t([Gi({type:Boolean,reflect:!0})],yr.prototype,"disabled",void 0),t([Gi({type:Boolean,reflect:!0})],yr.prototype,"invalid",void 0);var br=_i`.form-control-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.form-control-group{align-items:center;background-color:var(--sgds-form-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);border-radius:var(--input-border-radius,var(--sgds-form-border-radius-md));display:flex;gap:var(--sgds-form-gap-md);height:var(--sgds-dimension-48);justify-content:center;min-width:var(--sgds-dimension-256);padding:0 var(--sgds-form-padding-x);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:-webkit-fill-available;width:-moz-available}.form-control{appearance:none;background-clip:padding-box;background:none;border:none;color:var(--sgds-form-color-default);display:block;flex-grow:1;font-size:var(--sgds-font-size-2);line-height:var(--sgds-line-height-24);outline:none;padding:0}@media (prefers-reduced-motion:reduce){.form-control-group{transition:none}}.form-control-group:not(.disabled):not(.is-invalid):not(.readonly):not(:focus-within):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-group:not(.disabled):not(.is-invalid):focus-within{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-container.disabled{opacity:var(--sgds-opacity-50)}.form-control-group.disabled{background-color:var(--sgds-form-surface-muted);cursor:not-allowed}.form-control-group.readonly{background-color:var(--sgds-form-surface-raised)}.form-control-group.is-invalid:not(.disabled){border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-control-group:not(.disabled).is-invalid:focus-within{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}`;const xr=(t="value")=>(e,i)=>{const s=e.constructor,a=s.prototype.attributeChangedCallback;s.prototype.attributeChangedCallback=function(e,n,r){var o;const l=s.getPropertyOptions(t);if(e===("string"==typeof l.attribute?l.attribute:t).toLowerCase()){const e=l.converter||Hi,s=("function"==typeof e?e:null!==(o=null==e?void 0:e.fromAttribute)&&void 0!==o?o:Hi.fromAttribute)(r,l.type);this[t]!==s&&(this[i]=s)}a.call(this,e,n,r)}};class _r{constructor(t,e){(this.host=t).addController(this),this._internals=this.host.attachInternals(),this.options=Object.assign({setInvalid:(t,e)=>{t.invalid=e},value:t=>t.value,input:t=>t.input},e)}hostConnected(){this.host.addEventListener("invalid",(t=>this.handleInvalid(t)))}hostDisconnected(){this.host.removeEventListener("invalid",(t=>this.handleInvalid(t)))}handleInvalid(t){t.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(t){const e=t.target;this.options.setInvalid(this.host,!1),this.validateInput(e)}handleChange(t){const e=t.target;this.validateInput(e),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(t,e,i){return this._internals.setValidity(t,e,i)}setFormValue(){const t=this.options.value(this.host);this._internals.setFormValue(t)}validateInput(t){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const e=t.validity;if(e.valid)this._internals.setValidity({});else for(const i in e)e[i]&&(this.validationError=i.toString(),this._internals.setValidity({[this.validationError]:!0},t.validationMessage,t))}}const kr=e=>{class i extends e{constructor(){super(...arguments),this._isTouched=!1}connectedCallback(){var t;super.connectedCallback(),this._mixinShouldSkipSgdsValidation()||null!==(t=this.inputValidationController)&&void 0!==t||(this.inputValidationController=new _r(this))}async firstUpdated(t){super.firstUpdated(t),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinShouldSkipSgdsValidation()||this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(t){this._mixinSetFormValue(),this.inputValidationController.handleChange(t)}_mixinHandleInputChange(t){this._mixinSetFormValue(),this.inputValidationController.handleInput(t)}_mixinResetValidity(t){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this.inputValidationController.validateInput(t),this._isTouched&&(this._isTouched=!1)}_mixinValidate(t){this.inputValidationController.validateInput(t)}_mixinSetFormValue(){this.inputValidationController.setFormValue()}_mixinCheckValidity(){return this.inputValidationController.checkValidity()}_mixinReportValidity(){return this.inputValidationController.reportValidity()}_mixinGetValidity(){return this.inputValidationController.validity}_mixinGetValidationMessage(){return this.inputValidationController.validationMessage}_mixinSetValidity(t,e,i){return this.inputValidationController.setValidity(t,e,i)}_mixinShouldSkipSgdsValidation(){const t=this.closest("form");return(null==t?void 0:t.noValidate)||this.noValidate}}return i.formAssociated=!0,t([ts("sgds-input")],i.prototype,"sgdsInput",void 0),t([ts("sgds-datepicker-input")],i.prototype,"sgdsDatepickerInput",void 0),i};var Cr=_i`:host{--input-border-radius:var(--sgds-form-border-radius-md)}:host(.quantity-toggle) input::-webkit-inner-spin-button{appearance:none;margin:0}:host(.quantity-toggle) input{text-align:center}.form-control-prefix,.form-control-suffix{color:var(--sgds-form-color-subtle);display:flex;flex-wrap:wrap;gap:var(--sgds-gap-xs)}.form-control-group.quantity-toggle{padding:0}sgds-icon[role=button]{cursor:pointer}sgds-icon[role=button]:focus,sgds-icon[role=button]:focus-visible{outline:var(--sgds-form-outline-focus)}.form-control-row{align-items:center;display:flex;gap:var(--sgds-gap-sm)}`;class Mr extends(kr(yr)){constructor(){super(...arguments),this.type="text",this.placeholder="placeholder",this.autofocus=!1,this.readonly=!1,this.defaultValue="",this.valid=!1,this.loading=!1,this.required=!1,this.noValidate=!1,this.value="",this._isTouched=!1,this._showPassword=!1}focus(t){this.input.focus(t)}blur(){this.input.blur()}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}setValidity(t,e,i){return this._mixinSetValidity(t,e,i)}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_handleFocus(){this.emit("sgds-focus")}_handleBlur(){const t=this.emit("sgds-blur",{cancelable:!0});this._mixinShouldSkipSgdsValidation()||t.defaultPrevented||(this.setInvalid(!this._mixinCheckValidity()),this._isTouched=!0)}_handleClick(){this.focus()}_handleChange(t){this.value=this.input.value;const e=this.emit("sgds-change",{cancelable:!0});this._mixinShouldSkipSgdsValidation()||e.defaultPrevented||super._mixinHandleChange(t)}_handleInputChange(t){this.value=this.input.value;const e=this.emit("sgds-input",{cancelable:!0});this._mixinShouldSkipSgdsValidation()||e.defaultPrevented||super._mixinHandleInputChange(t)}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&this.setInvalid(!this._mixinCheckValidity())}_handleDisabledChange(){this.setInvalid(!1)}_renderInput(){const t="both"===this.hasFeedback||"style"===this.hasFeedback;return ln`
|
|
2145
|
+
`}}En.styles=[An],En.dependencies={"sgds-icon":Cn,"sgds-icon-button":Zn,"sgds-button":fn},t([Gi({attribute:!1})],En.prototype,"displayDate",void 0),t([Gi({attribute:!1})],En.prototype,"focusedDate",void 0),t([Gi({attribute:!1})],En.prototype,"selectedDate",void 0),t([Gi()],En.prototype,"view",void 0),t([Gi()],En.prototype,"focusedTabIndex",void 0),t([tn("focusedTabIndex",{waitUntilFirstUpdate:!0})],En.prototype,"_handleFocusedTabIndexChange",null);const Bn=["January","February","March","April","May","June","July","August","September","October","November","December"];function $n(t){return"string"==typeof t||t instanceof String}function Fn(t){var e;return"object"==typeof t&&null!=t&&"Object"===(null==t||null==(e=t.constructor)?void 0:e.name)}function Tn(t,e){return Array.isArray(e)?Tn(t,((t,i)=>e.includes(i))):Object.entries(t).reduce(((t,i)=>{let[s,a]=i;return e(a,s)&&(t[s]=a),t}),{})}const Pn="NONE",Hn="LEFT",In="FORCE_LEFT",Ln="RIGHT",Rn="FORCE_RIGHT";function On(t){return t.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}function Nn(t,e){if(e===t)return!0;const i=Array.isArray(e),s=Array.isArray(t);let a;if(i&&s){if(e.length!=t.length)return!1;for(a=0;a<e.length;a++)if(!Nn(e[a],t[a]))return!1;return!0}if(i!=s)return!1;if(e&&t&&"object"==typeof e&&"object"==typeof t){const i=e instanceof Date,s=t instanceof Date;if(i&&s)return e.getTime()==t.getTime();if(i!=s)return!1;const n=e instanceof RegExp,r=t instanceof RegExp;if(n&&r)return e.toString()==t.toString();if(n!=r)return!1;const o=Object.keys(e);for(a=0;a<o.length;a++)if(!Object.prototype.hasOwnProperty.call(t,o[a]))return!1;for(a=0;a<o.length;a++)if(!Nn(t[o[a]],e[o[a]]))return!1;return!0}return!(!e||!t||"function"!=typeof e||"function"!=typeof t)&&e.toString()===t.toString()}class Yn{constructor(t){for(Object.assign(this,t);this.value.slice(0,this.startChangePos)!==this.oldValue.slice(0,this.startChangePos);)--this.oldSelection.start;if(this.insertedCount)for(;this.value.slice(this.cursorPos)!==this.oldValue.slice(this.oldSelection.end);)this.value.length-this.cursorPos<this.oldValue.length-this.oldSelection.end?++this.oldSelection.end:++this.cursorPos}get startChangePos(){return Math.min(this.cursorPos,this.oldSelection.start)}get insertedCount(){return this.cursorPos-this.startChangePos}get inserted(){return this.value.substr(this.startChangePos,this.insertedCount)}get removedCount(){return Math.max(this.oldSelection.end-this.startChangePos||this.oldValue.length-this.value.length,0)}get removed(){return this.oldValue.substr(this.startChangePos,this.removedCount)}get head(){return this.value.substring(0,this.startChangePos)}get tail(){return this.value.substring(this.startChangePos+this.insertedCount)}get removeDirection(){return!this.removedCount||this.insertedCount?Pn:this.oldSelection.end!==this.cursorPos&&this.oldSelection.start!==this.cursorPos||this.oldSelection.end!==this.oldSelection.start?Hn:Ln}}function zn(t,e){return new zn.InputMask(t,e)}function Un(t){if(null==t)throw new Error("mask property should be defined");return t instanceof RegExp?zn.MaskedRegExp:$n(t)?zn.MaskedPattern:t===Date?zn.MaskedDate:t===Number?zn.MaskedNumber:Array.isArray(t)||t===Array?zn.MaskedDynamic:zn.Masked&&t.prototype instanceof zn.Masked?t:zn.Masked&&t instanceof zn.Masked?t.constructor:t instanceof Function?zn.MaskedFunction:(console.warn("Mask not found for mask",t),zn.Masked)}function qn(t){if(!t)throw new Error("Options in not defined");if(zn.Masked){if(t.prototype instanceof zn.Masked)return{mask:t};const{mask:e,...i}=t instanceof zn.Masked?{mask:t}:Fn(t)&&t.mask instanceof zn.Masked?t:{};if(e){const t=e.mask;return{...Tn(e,((t,e)=>!e.startsWith("_"))),mask:e.constructor,_mask:t,...i}}}return Fn(t)?{...t}:{mask:t}}function Wn(t){if(zn.Masked&&t instanceof zn.Masked)return t;const e=qn(t),i=Un(e.mask);if(!i)throw new Error("Masked class is not found for provided mask "+e.mask+", appropriate module needs to be imported manually before creating mask.");return e.mask===i&&delete e.mask,e._mask&&(e.mask=e._mask,delete e._mask),new i(e)}zn.createMask=Wn;class jn{get selectionStart(){let t;try{t=this._unsafeSelectionStart}catch{}return null!=t?t:this.value.length}get selectionEnd(){let t;try{t=this._unsafeSelectionEnd}catch{}return null!=t?t:this.value.length}select(t,e){if(null!=t&&null!=e&&(t!==this.selectionStart||e!==this.selectionEnd))try{this._unsafeSelect(t,e)}catch{}}get isActive(){return!1}}zn.MaskElement=jn;class Gn extends jn{constructor(t){super(),this.input=t,this._onKeydown=this._onKeydown.bind(this),this._onInput=this._onInput.bind(this),this._onBeforeinput=this._onBeforeinput.bind(this),this._onCompositionEnd=this._onCompositionEnd.bind(this)}get rootElement(){var t,e,i;return null!=(t=null==(e=(i=this.input).getRootNode)?void 0:e.call(i))?t:document}get isActive(){return this.input===this.rootElement.activeElement}bindEvents(t){this.input.addEventListener("keydown",this._onKeydown),this.input.addEventListener("input",this._onInput),this.input.addEventListener("beforeinput",this._onBeforeinput),this.input.addEventListener("compositionend",this._onCompositionEnd),this.input.addEventListener("drop",t.drop),this.input.addEventListener("click",t.click),this.input.addEventListener("focus",t.focus),this.input.addEventListener("blur",t.commit),this._handlers=t}_onKeydown(t){return this._handlers.redo&&(90===t.keyCode&&t.shiftKey&&(t.metaKey||t.ctrlKey)||89===t.keyCode&&t.ctrlKey)?(t.preventDefault(),this._handlers.redo(t)):this._handlers.undo&&90===t.keyCode&&(t.metaKey||t.ctrlKey)?(t.preventDefault(),this._handlers.undo(t)):void(t.isComposing||this._handlers.selectionChange(t))}_onBeforeinput(t){return"historyUndo"===t.inputType&&this._handlers.undo?(t.preventDefault(),this._handlers.undo(t)):"historyRedo"===t.inputType&&this._handlers.redo?(t.preventDefault(),this._handlers.redo(t)):void 0}_onCompositionEnd(t){this._handlers.input(t)}_onInput(t){t.isComposing||this._handlers.input(t)}unbindEvents(){this.input.removeEventListener("keydown",this._onKeydown),this.input.removeEventListener("input",this._onInput),this.input.removeEventListener("beforeinput",this._onBeforeinput),this.input.removeEventListener("compositionend",this._onCompositionEnd),this.input.removeEventListener("drop",this._handlers.drop),this.input.removeEventListener("click",this._handlers.click),this.input.removeEventListener("focus",this._handlers.focus),this.input.removeEventListener("blur",this._handlers.commit),this._handlers={}}}zn.HTMLMaskElement=Gn;class Kn extends Gn{constructor(t){super(t),this.input=t}get _unsafeSelectionStart(){return null!=this.input.selectionStart?this.input.selectionStart:this.value.length}get _unsafeSelectionEnd(){return this.input.selectionEnd}_unsafeSelect(t,e){this.input.setSelectionRange(t,e)}get value(){return this.input.value}set value(t){this.input.value=t}}zn.HTMLMaskElement=Gn;class Qn extends Gn{get _unsafeSelectionStart(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),i=e&&e.anchorOffset,s=e&&e.focusOffset;return null==s||null==i||i<s?i:s}get _unsafeSelectionEnd(){const t=this.rootElement,e=t.getSelection&&t.getSelection(),i=e&&e.anchorOffset,s=e&&e.focusOffset;return null==s||null==i||i>s?i:s}_unsafeSelect(t,e){if(!this.rootElement.createRange)return;const i=this.rootElement.createRange();i.setStart(this.input.firstChild||this.input,t),i.setEnd(this.input.lastChild||this.input,e);const s=this.rootElement,a=s.getSelection&&s.getSelection();a&&(a.removeAllRanges(),a.addRange(i))}get value(){return this.input.textContent||""}set value(t){this.input.textContent=t}}zn.HTMLContenteditableMaskElement=Qn;class Xn{constructor(){this.states=[],this.currentIndex=0}get currentState(){return this.states[this.currentIndex]}get isEmpty(){return 0===this.states.length}push(t){this.currentIndex<this.states.length-1&&(this.states.length=this.currentIndex+1),this.states.push(t),this.states.length>Xn.MAX_LENGTH&&this.states.shift(),this.currentIndex=this.states.length-1}go(t){return this.currentIndex=Math.min(Math.max(this.currentIndex+t,0),this.states.length-1),this.currentState}undo(){return this.go(-1)}redo(){return this.go(1)}clear(){this.states.length=0,this.currentIndex=0}}Xn.MAX_LENGTH=100;zn.InputMask=class{constructor(t,e){this.el=t instanceof jn?t:t.isContentEditable&&"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName?new Qn(t):new Kn(t),this.masked=Wn(e),this._listeners={},this._value="",this._unmaskedValue="",this._rawInputValue="",this.history=new Xn,this._saveSelection=this._saveSelection.bind(this),this._onInput=this._onInput.bind(this),this._onChange=this._onChange.bind(this),this._onDrop=this._onDrop.bind(this),this._onFocus=this._onFocus.bind(this),this._onClick=this._onClick.bind(this),this._onUndo=this._onUndo.bind(this),this._onRedo=this._onRedo.bind(this),this.alignCursor=this.alignCursor.bind(this),this.alignCursorFriendly=this.alignCursorFriendly.bind(this),this._bindEvents(),this.updateValue(),this._onChange()}maskEquals(t){var e;return null==t||(null==(e=this.masked)?void 0:e.maskEquals(t))}get mask(){return this.masked.mask}set mask(t){if(this.maskEquals(t))return;if(!(t instanceof zn.Masked)&&this.masked.constructor===Un(t))return void this.masked.updateOptions({mask:t});const e=t instanceof zn.Masked?t:Wn({mask:t});e.unmaskedValue=this.masked.unmaskedValue,this.masked=e}get value(){return this._value}set value(t){this.value!==t&&(this.masked.value=t,this.updateControl("auto"))}get unmaskedValue(){return this._unmaskedValue}set unmaskedValue(t){this.unmaskedValue!==t&&(this.masked.unmaskedValue=t,this.updateControl("auto"))}get rawInputValue(){return this._rawInputValue}set rawInputValue(t){this.rawInputValue!==t&&(this.masked.rawInputValue=t,this.updateControl(),this.alignCursor())}get typedValue(){return this.masked.typedValue}set typedValue(t){this.masked.typedValueEquals(t)||(this.masked.typedValue=t,this.updateControl("auto"))}get displayValue(){return this.masked.displayValue}_bindEvents(){this.el.bindEvents({selectionChange:this._saveSelection,input:this._onInput,drop:this._onDrop,click:this._onClick,focus:this._onFocus,commit:this._onChange,undo:this._onUndo,redo:this._onRedo})}_unbindEvents(){this.el&&this.el.unbindEvents()}_fireEvent(t,e){const i=this._listeners[t];i&&i.forEach((t=>t(e)))}get selectionStart(){return this._cursorChanging?this._changingCursorPos:this.el.selectionStart}get cursorPos(){return this._cursorChanging?this._changingCursorPos:this.el.selectionEnd}set cursorPos(t){this.el&&this.el.isActive&&(this.el.select(t,t),this._saveSelection())}_saveSelection(){this.displayValue!==this.el.value&&console.warn("Element value was changed outside of mask. Syncronize mask using `mask.updateValue()` to work properly."),this._selection={start:this.selectionStart,end:this.cursorPos}}updateValue(){this.masked.value=this.el.value,this._value=this.masked.value,this._unmaskedValue=this.masked.unmaskedValue,this._rawInputValue=this.masked.rawInputValue}updateControl(t){const e=this.masked.unmaskedValue,i=this.masked.value,s=this.masked.rawInputValue,a=this.displayValue,n=this.unmaskedValue!==e||this.value!==i||this._rawInputValue!==s;this._unmaskedValue=e,this._value=i,this._rawInputValue=s,this.el.value!==a&&(this.el.value=a),"auto"===t?this.alignCursor():null!=t&&(this.cursorPos=t),n&&this._fireChangeEvents(),this._historyChanging||!n&&!this.history.isEmpty||this.history.push({unmaskedValue:e,selection:{start:this.selectionStart,end:this.cursorPos}})}updateOptions(t){const{mask:e,...i}=t,s=!this.maskEquals(e),a=this.masked.optionsIsChanged(i);s&&(this.mask=e),a&&this.masked.updateOptions(i),(s||a)&&this.updateControl()}updateCursor(t){null!=t&&(this.cursorPos=t,this._delayUpdateCursor(t))}_delayUpdateCursor(t){this._abortUpdateCursor(),this._changingCursorPos=t,this._cursorChanging=setTimeout((()=>{this.el&&(this.cursorPos=this._changingCursorPos,this._abortUpdateCursor())}),10)}_fireChangeEvents(){this._fireEvent("accept",this._inputEvent),this.masked.isComplete&&this._fireEvent("complete",this._inputEvent)}_abortUpdateCursor(){this._cursorChanging&&(clearTimeout(this._cursorChanging),delete this._cursorChanging)}alignCursor(){this.cursorPos=this.masked.nearestInputPos(this.masked.nearestInputPos(this.cursorPos,Hn))}alignCursorFriendly(){this.selectionStart===this.cursorPos&&this.alignCursor()}on(t,e){return this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push(e),this}off(t,e){if(!this._listeners[t])return this;if(!e)return delete this._listeners[t],this;const i=this._listeners[t].indexOf(e);return i>=0&&this._listeners[t].splice(i,1),this}_onInput(t){this._inputEvent=t,this._abortUpdateCursor();const e=new Yn({value:this.el.value,cursorPos:this.cursorPos,oldValue:this.displayValue,oldSelection:this._selection}),i=this.masked.rawInputValue,s=this.masked.splice(e.startChangePos,e.removed.length,e.inserted,e.removeDirection,{input:!0,raw:!0}).offset,a=i===this.masked.rawInputValue?e.removeDirection:Pn;let n=this.masked.nearestInputPos(e.startChangePos+s,a);a!==Pn&&(n=this.masked.nearestInputPos(n,Pn)),this.updateControl(n),delete this._inputEvent}_onChange(){this.displayValue!==this.el.value&&this.updateValue(),this.masked.doCommit(),this.updateControl(),this._saveSelection()}_onDrop(t){t.preventDefault(),t.stopPropagation()}_onFocus(t){this.alignCursorFriendly()}_onClick(t){this.alignCursorFriendly()}_onUndo(){this._applyHistoryState(this.history.undo())}_onRedo(){this._applyHistoryState(this.history.redo())}_applyHistoryState(t){t&&(this._historyChanging=!0,this.unmaskedValue=t.unmaskedValue,this.el.select(t.selection.start,t.selection.end),this._saveSelection(),this._historyChanging=!1)}destroy(){this._unbindEvents(),this._listeners.length=0,delete this.el}};class Jn{static normalize(t){return Array.isArray(t)?t:[t,new Jn]}constructor(t){Object.assign(this,{inserted:"",rawInserted:"",tailShift:0,skip:!1},t)}aggregate(t){return this.inserted+=t.inserted,this.rawInserted+=t.rawInserted,this.tailShift+=t.tailShift,this.skip=this.skip||t.skip,this}get offset(){return this.tailShift+this.inserted.length}get consumed(){return Boolean(this.rawInserted)||this.skip}equals(t){return this.inserted===t.inserted&&this.tailShift===t.tailShift&&this.rawInserted===t.rawInserted&&this.skip===t.skip}}zn.ChangeDetails=Jn;class tr{constructor(t,e,i){void 0===t&&(t=""),void 0===e&&(e=0),this.value=t,this.from=e,this.stop=i}toString(){return this.value}extend(t){this.value+=String(t)}appendTo(t){return t.append(this.toString(),{tail:!0}).aggregate(t._appendPlaceholder())}get state(){return{value:this.value,from:this.from,stop:this.stop}}set state(t){Object.assign(this,t)}unshift(t){if(!this.value.length||null!=t&&this.from>=t)return"";const e=this.value[0];return this.value=this.value.slice(1),e}shift(){if(!this.value.length)return"";const t=this.value[this.value.length-1];return this.value=this.value.slice(0,-1),t}}class er{constructor(t){this._value="",this._update({...er.DEFAULTS,...t}),this._initialized=!0}updateOptions(t){this.optionsIsChanged(t)&&this.withValueRefresh(this._update.bind(this,t))}_update(t){Object.assign(this,t)}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value}reset(){this._value=""}get value(){return this._value}set value(t){this.resolve(t,{input:!0})}resolve(t,e){void 0===e&&(e={input:!0}),this.reset(),this.append(t,e,""),this.doCommit()}get unmaskedValue(){return this.value}set unmaskedValue(t){this.resolve(t,{})}get typedValue(){return this.parse?this.parse(this.value,this):this.unmaskedValue}set typedValue(t){this.format?this.value=this.format(t,this):this.unmaskedValue=String(t)}get rawInputValue(){return this.extractInput(0,this.displayValue.length,{raw:!0})}set rawInputValue(t){this.resolve(t,{raw:!0})}get displayValue(){return this.value}get isComplete(){return!0}get isFilled(){return this.isComplete}nearestInputPos(t,e){return t}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),Math.min(this.displayValue.length,e-t)}extractInput(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),this.displayValue.slice(t,e)}extractTail(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),new tr(this.extractInput(t,e),t)}appendTail(t){return $n(t)&&(t=new tr(String(t))),t.appendTo(this)}_appendCharRaw(t,e){return t?(this._value+=t,new Jn({inserted:t,rawInserted:t})):new Jn}_appendChar(t,e,i){void 0===e&&(e={});const s=this.state;let a;if([t,a]=this.doPrepareChar(t,e),t&&(a=a.aggregate(this._appendCharRaw(t,e)),!a.rawInserted&&"pad"===this.autofix)){const i=this.state;this.state=s;let n=this.pad(e);const r=this._appendCharRaw(t,e);n=n.aggregate(r),r.rawInserted||n.equals(a)?a=n:this.state=i}if(a.inserted){let t,n=!1!==this.doValidate(e);if(n&&null!=i){const e=this.state;if(!0===this.overwrite){t=i.state;for(let t=0;t<a.rawInserted.length;++t)i.unshift(this.displayValue.length-a.tailShift)}let s=this.appendTail(i);if(n=s.rawInserted.length===i.toString().length,!(n&&s.inserted||"shift"!==this.overwrite)){this.state=e,t=i.state;for(let t=0;t<a.rawInserted.length;++t)i.shift();s=this.appendTail(i),n=s.rawInserted.length===i.toString().length}n&&s.inserted&&(this.state=e)}n||(a=new Jn,this.state=s,i&&t&&(i.state=t))}return a}_appendPlaceholder(){return new Jn}_appendEager(){return new Jn}append(t,e,i){if(!$n(t))throw new Error("value should be string");const s=$n(i)?new tr(String(i)):i;let a;null!=e&&e.tail&&(e._beforeTailState=this.state),[t,a]=this.doPrepare(t,e);for(let i=0;i<t.length;++i){const n=this._appendChar(t[i],e,s);if(!n.rawInserted&&!this.doSkipInvalid(t[i],e,s))break;a.aggregate(n)}return(!0===this.eager||"append"===this.eager)&&null!=e&&e.input&&t&&a.aggregate(this._appendEager()),null!=s&&(a.tailShift+=this.appendTail(s).tailShift),a}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),this._value=this.displayValue.slice(0,t)+this.displayValue.slice(e),new Jn}withValueRefresh(t){if(this._refreshing||!this._initialized)return t();this._refreshing=!0;const e=this.rawInputValue,i=this.value,s=t();return this.rawInputValue=e,this.value&&this.value!==i&&0===i.indexOf(this.value)&&(this.append(i.slice(this.displayValue.length),{},""),this.doCommit()),delete this._refreshing,s}runIsolated(t){if(this._isolated||!this._initialized)return t(this);this._isolated=!0;const e=this.state,i=t(this);return this.state=e,delete this._isolated,i}doSkipInvalid(t,e,i){return Boolean(this.skipInvalid)}doPrepare(t,e){return void 0===e&&(e={}),Jn.normalize(this.prepare?this.prepare(t,this,e):t)}doPrepareChar(t,e){return void 0===e&&(e={}),Jn.normalize(this.prepareChar?this.prepareChar(t,this,e):t)}doValidate(t){return(!this.validate||this.validate(this.value,this,t))&&(!this.parent||this.parent.doValidate(t))}doCommit(){this.commit&&this.commit(this.value,this)}splice(t,e,i,s,a){void 0===i&&(i=""),void 0===s&&(s=Pn),void 0===a&&(a={input:!0});const n=t+e,r=this.extractTail(n),o=!0===this.eager||"remove"===this.eager;let l;o&&(s=function(t){switch(t){case Hn:return In;case Ln:return Rn;default:return t}}(s),l=this.extractInput(0,n,{raw:!0}));let c=t;const d=new Jn;if(s!==Pn&&(c=this.nearestInputPos(t,e>1&&0!==t&&!o?Pn:s),d.tailShift=c-t),d.aggregate(this.remove(c)),o&&s!==Pn&&l===this.rawInputValue)if(s===In){let t;for(;l===this.rawInputValue&&(t=this.displayValue.length);)d.aggregate(new Jn({tailShift:-1})).aggregate(this.remove(t-1))}else s===Rn&&r.unshift();return d.aggregate(this.append(i,a,r))}maskEquals(t){return this.mask===t}optionsIsChanged(t){return!Nn(this,t)}typedValueEquals(t){const e=this.typedValue;return t===e||er.EMPTY_VALUES.includes(t)&&er.EMPTY_VALUES.includes(e)||!!this.format&&this.format(t,this)===this.format(this.typedValue,this)}pad(t){return new Jn}}er.DEFAULTS={skipInvalid:!0},er.EMPTY_VALUES=[void 0,null,""],zn.Masked=er;class ir{constructor(t,e){void 0===t&&(t=[]),void 0===e&&(e=0),this.chunks=t,this.from=e}toString(){return this.chunks.map(String).join("")}extend(t){if(!String(t))return;t=$n(t)?new tr(String(t)):t;const e=this.chunks[this.chunks.length-1],i=e&&(e.stop===t.stop||null==t.stop)&&t.from===e.from+e.toString().length;if(t instanceof tr)i?e.extend(t.toString()):this.chunks.push(t);else if(t instanceof ir){if(null==t.stop){let e;for(;t.chunks.length&&null==t.chunks[0].stop;)e=t.chunks.shift(),e.from+=t.from,this.extend(e)}t.toString()&&(t.stop=t.blockIndex,this.chunks.push(t))}}appendTo(t){if(!(t instanceof zn.MaskedPattern)){return new tr(this.toString()).appendTo(t)}const e=new Jn;for(let i=0;i<this.chunks.length;++i){const s=this.chunks[i],a=t._mapPosToBlock(t.displayValue.length),n=s.stop;let r;if(null!=n&&(!a||a.index<=n)&&((s instanceof ir||t._stops.indexOf(n)>=0)&&e.aggregate(t._appendPlaceholder(n)),r=s instanceof ir&&t._blocks[n]),r){const i=r.appendTail(s);e.aggregate(i);const a=s.toString().slice(i.rawInserted.length);a&&e.aggregate(t.append(a,{tail:!0}))}else e.aggregate(t.append(s.toString(),{tail:!0}))}return e}get state(){return{chunks:this.chunks.map((t=>t.state)),from:this.from,stop:this.stop,blockIndex:this.blockIndex}}set state(t){const{chunks:e,...i}=t;Object.assign(this,i),this.chunks=e.map((t=>{const e="chunks"in t?new ir:new tr;return e.state=t,e}))}unshift(t){if(!this.chunks.length||null!=t&&this.from>=t)return"";const e=null!=t?t-this.from:t;let i=0;for(;i<this.chunks.length;){const t=this.chunks[i],s=t.unshift(e);if(t.toString()){if(!s)break;++i}else this.chunks.splice(i,1);if(s)return s}return""}shift(){if(!this.chunks.length)return"";let t=this.chunks.length-1;for(;0<=t;){const e=this.chunks[t],i=e.shift();if(e.toString()){if(!i)break;--t}else this.chunks.splice(t,1);if(i)return i}return""}}class sr{constructor(t,e){this.masked=t,this._log=[];const{offset:i,index:s}=t._mapPosToBlock(e)||(e<0?{index:0,offset:0}:{index:this.masked._blocks.length,offset:0});this.offset=i,this.index=s,this.ok=!1}get block(){return this.masked._blocks[this.index]}get pos(){return this.masked._blockStartPos(this.index)+this.offset}get state(){return{index:this.index,offset:this.offset,ok:this.ok}}set state(t){Object.assign(this,t)}pushState(){this._log.push(this.state)}popState(){const t=this._log.pop();return t&&(this.state=t),t}bindBlock(){this.block||(this.index<0&&(this.index=0,this.offset=0),this.index>=this.masked._blocks.length&&(this.index=this.masked._blocks.length-1,this.offset=this.block.displayValue.length))}_pushLeft(t){for(this.pushState(),this.bindBlock();0<=this.index;--this.index,this.offset=(null==(e=this.block)?void 0:e.displayValue.length)||0){var e;if(t())return this.ok=!0}return this.ok=!1}_pushRight(t){for(this.pushState(),this.bindBlock();this.index<this.masked._blocks.length;++this.index,this.offset=0)if(t())return this.ok=!0;return this.ok=!1}pushLeftBeforeFilled(){return this._pushLeft((()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,In),0!==this.offset||void 0}))}pushLeftBeforeInput(){return this._pushLeft((()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Hn),!0}))}pushLeftBeforeRequired(){return this._pushLeft((()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Hn),!0}))}pushRightBeforeFilled(){return this._pushRight((()=>{if(!this.block.isFixed&&this.block.value)return this.offset=this.block.nearestInputPos(this.offset,Rn),this.offset!==this.block.value.length||void 0}))}pushRightBeforeInput(){return this._pushRight((()=>{if(!this.block.isFixed)return this.offset=this.block.nearestInputPos(this.offset,Pn),!0}))}pushRightBeforeRequired(){return this._pushRight((()=>{if(!(this.block.isFixed||this.block.isOptional&&!this.block.value))return this.offset=this.block.nearestInputPos(this.offset,Pn),!0}))}}class ar{constructor(t){Object.assign(this,t),this._value="",this.isFixed=!0}get value(){return this._value}get unmaskedValue(){return this.isUnmasking?this.value:""}get rawInputValue(){return this._isRawInput?this.value:""}get displayValue(){return this.value}reset(){this._isRawInput=!1,this._value=""}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),this._value=this._value.slice(0,t)+this._value.slice(e),this._value||(this._isRawInput=!1),new Jn}nearestInputPos(t,e){void 0===e&&(e=Pn);const i=this._value.length;switch(e){case Hn:case In:return 0;default:return i}}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),this._isRawInput?e-t:0}extractInput(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=this._value.length),void 0===i&&(i={}),i.raw&&this._isRawInput&&this._value.slice(t,e)||""}get isComplete(){return!0}get isFilled(){return Boolean(this._value)}_appendChar(t,e){if(void 0===e&&(e={}),this.isFilled)return new Jn;const i=!0===this.eager||"append"===this.eager,s=this.char===t&&(this.isUnmasking||e.input||e.raw)&&(!e.raw||!i)&&!e.tail,a=new Jn({inserted:this.char,rawInserted:s?this.char:""});return this._value=this.char,this._isRawInput=s&&(e.raw||e.input),a}_appendEager(){return this._appendChar(this.char,{tail:!0})}_appendPlaceholder(){const t=new Jn;return this.isFilled||(this._value=t.inserted=this.char),t}extractTail(){return new tr("")}appendTail(t){return $n(t)&&(t=new tr(String(t))),t.appendTo(this)}append(t,e,i){const s=this._appendChar(t[0],e);return null!=i&&(s.tailShift+=this.appendTail(i).tailShift),s}doCommit(){}get state(){return{_value:this._value,_rawInputValue:this.rawInputValue}}set state(t){this._value=t._value,this._isRawInput=Boolean(t._rawInputValue)}pad(t){return this._appendPlaceholder()}}class nr{constructor(t){const{parent:e,isOptional:i,placeholderChar:s,displayChar:a,lazy:n,eager:r,...o}=t;this.masked=Wn(o),Object.assign(this,{parent:e,isOptional:i,placeholderChar:s,displayChar:a,lazy:n,eager:r})}reset(){this.isFilled=!1,this.masked.reset()}remove(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),0===t&&e>=1?(this.isFilled=!1,this.masked.remove(t,e)):new Jn}get value(){return this.masked.value||(this.isFilled&&!this.isOptional?this.placeholderChar:"")}get unmaskedValue(){return this.masked.unmaskedValue}get rawInputValue(){return this.masked.rawInputValue}get displayValue(){return this.masked.value&&this.displayChar||this.value}get isComplete(){return Boolean(this.masked.value)||this.isOptional}_appendChar(t,e){if(void 0===e&&(e={}),this.isFilled)return new Jn;const i=this.masked.state;let s=this.masked._appendChar(t,this.currentMaskFlags(e));return s.inserted&&!1===this.doValidate(e)&&(s=new Jn,this.masked.state=i),s.inserted||this.isOptional||this.lazy||e.input||(s.inserted=this.placeholderChar),s.skip=!s.inserted&&!this.isOptional,this.isFilled=Boolean(s.inserted),s}append(t,e,i){return this.masked.append(t,this.currentMaskFlags(e),i)}_appendPlaceholder(){return this.isFilled||this.isOptional?new Jn:(this.isFilled=!0,new Jn({inserted:this.placeholderChar}))}_appendEager(){return new Jn}extractTail(t,e){return this.masked.extractTail(t,e)}appendTail(t){return this.masked.appendTail(t)}extractInput(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),this.masked.extractInput(t,e,i)}nearestInputPos(t,e){void 0===e&&(e=Pn);const i=this.value.length,s=Math.min(Math.max(t,0),i);switch(e){case Hn:case In:return this.isComplete?s:0;case Ln:case Rn:return this.isComplete?s:i;default:return s}}totalInputPositions(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.value.length),this.value.slice(t,e).length}doValidate(t){return this.masked.doValidate(this.currentMaskFlags(t))&&(!this.parent||this.parent.doValidate(this.currentMaskFlags(t)))}doCommit(){this.masked.doCommit()}get state(){return{_value:this.value,_rawInputValue:this.rawInputValue,masked:this.masked.state,isFilled:this.isFilled}}set state(t){this.masked.state=t.masked,this.isFilled=t.isFilled}currentMaskFlags(t){var e;return{...t,_beforeTailState:(null==t||null==(e=t._beforeTailState)?void 0:e.masked)||(null==t?void 0:t._beforeTailState)}}pad(t){return new Jn}}nr.DEFAULT_DEFINITIONS={0:/\d/,a:/[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,"*":/./};zn.MaskedRegExp=class extends er{updateOptions(t){super.updateOptions(t)}_update(t){const e=t.mask;e&&(t.validate=t=>t.search(e)>=0),super._update(t)}};class rr extends er{constructor(t){super({...rr.DEFAULTS,...t,definitions:Object.assign({},nr.DEFAULT_DEFINITIONS,null==t?void 0:t.definitions)})}updateOptions(t){super.updateOptions(t)}_update(t){t.definitions=Object.assign({},this.definitions,t.definitions),super._update(t),this._rebuildMask()}_rebuildMask(){const t=this.definitions;this._blocks=[],this.exposeBlock=void 0,this._stops=[],this._maskedBlocks={};const e=this.mask;if(!e||!t)return;let i=!1,s=!1;for(let a=0;a<e.length;++a){if(this.blocks){const t=e.slice(a),i=Object.keys(this.blocks).filter((e=>0===t.indexOf(e)));i.sort(((t,e)=>e.length-t.length));const s=i[0];if(s){const{expose:t,repeat:e,...i}=qn(this.blocks[s]),n={lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,overwrite:this.overwrite,autofix:this.autofix,...i,repeat:e,parent:this},r=null!=e?new zn.RepeatBlock(n):Wn(n);r&&(this._blocks.push(r),t&&(this.exposeBlock=r),this._maskedBlocks[s]||(this._maskedBlocks[s]=[]),this._maskedBlocks[s].push(this._blocks.length-1)),a+=s.length-1;continue}}let n=e[a],r=n in t;if(n===rr.STOP_CHAR){this._stops.push(this._blocks.length);continue}if("{"===n||"}"===n){i=!i;continue}if("["===n||"]"===n){s=!s;continue}if(n===rr.ESCAPE_CHAR){if(++a,n=e[a],!n)break;r=!1}const o=r?new nr({isOptional:s,lazy:this.lazy,eager:this.eager,placeholderChar:this.placeholderChar,displayChar:this.displayChar,...qn(t[n]),parent:this}):new ar({char:n,eager:this.eager,isUnmasking:i});this._blocks.push(o)}}get state(){return{...super.state,_blocks:this._blocks.map((t=>t.state))}}set state(t){if(!t)return void this.reset();const{_blocks:e,...i}=t;this._blocks.forEach(((t,i)=>t.state=e[i])),super.state=i}reset(){super.reset(),this._blocks.forEach((t=>t.reset()))}get isComplete(){return this.exposeBlock?this.exposeBlock.isComplete:this._blocks.every((t=>t.isComplete))}get isFilled(){return this._blocks.every((t=>t.isFilled))}get isFixed(){return this._blocks.every((t=>t.isFixed))}get isOptional(){return this._blocks.every((t=>t.isOptional))}doCommit(){this._blocks.forEach((t=>t.doCommit())),super.doCommit()}get unmaskedValue(){return this.exposeBlock?this.exposeBlock.unmaskedValue:this._blocks.reduce(((t,e)=>t+e.unmaskedValue),"")}set unmaskedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.unmaskedValue=t,this.appendTail(e),this.doCommit()}else super.unmaskedValue=t}get value(){return this.exposeBlock?this.exposeBlock.value:this._blocks.reduce(((t,e)=>t+e.value),"")}set value(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.value=t,this.appendTail(e),this.doCommit()}else super.value=t}get typedValue(){return this.exposeBlock?this.exposeBlock.typedValue:super.typedValue}set typedValue(t){if(this.exposeBlock){const e=this.extractTail(this._blockStartPos(this._blocks.indexOf(this.exposeBlock))+this.exposeBlock.displayValue.length);this.exposeBlock.typedValue=t,this.appendTail(e),this.doCommit()}else super.typedValue=t}get displayValue(){return this._blocks.reduce(((t,e)=>t+e.displayValue),"")}appendTail(t){return super.appendTail(t).aggregate(this._appendPlaceholder())}_appendEager(){var t;const e=new Jn;let i=null==(t=this._mapPosToBlock(this.displayValue.length))?void 0:t.index;if(null==i)return e;this._blocks[i].isFilled&&++i;for(let t=i;t<this._blocks.length;++t){const i=this._blocks[t]._appendEager();if(!i.inserted)break;e.aggregate(i)}return e}_appendCharRaw(t,e){void 0===e&&(e={});const i=this._mapPosToBlock(this.displayValue.length),s=new Jn;if(!i)return s;for(let n,r=i.index;n=this._blocks[r];++r){var a;const i=n._appendChar(t,{...e,_beforeTailState:null==(a=e._beforeTailState)||null==(a=a._blocks)?void 0:a[r]});if(s.aggregate(i),i.consumed)break}return s}extractTail(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const i=new ir;return t===e||this._forEachBlocksInRange(t,e,((t,e,s,a)=>{const n=t.extractTail(s,a);n.stop=this._findStopBefore(e),n.from=this._blockStartPos(e),n instanceof ir&&(n.blockIndex=e),i.extend(n)})),i}extractInput(t,e,i){if(void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),void 0===i&&(i={}),t===e)return"";let s="";return this._forEachBlocksInRange(t,e,((t,e,a,n)=>{s+=t.extractInput(a,n,i)})),s}_findStopBefore(t){let e;for(let i=0;i<this._stops.length;++i){const s=this._stops[i];if(!(s<=t))break;e=s}return e}_appendPlaceholder(t){const e=new Jn;if(this.lazy&&null==t)return e;const i=this._mapPosToBlock(this.displayValue.length);if(!i)return e;const s=i.index,a=null!=t?t:this._blocks.length;return this._blocks.slice(s,a).forEach((i=>{var s;i.lazy&&null==t||e.aggregate(i._appendPlaceholder(null==(s=i._blocks)?void 0:s.length))})),e}_mapPosToBlock(t){let e="";for(let i=0;i<this._blocks.length;++i){const s=this._blocks[i],a=e.length;if(e+=s.displayValue,t<=e.length)return{index:i,offset:t-a}}}_blockStartPos(t){return this._blocks.slice(0,t).reduce(((t,e)=>t+e.displayValue.length),0)}_forEachBlocksInRange(t,e,i){void 0===e&&(e=this.displayValue.length);const s=this._mapPosToBlock(t);if(s){const t=this._mapPosToBlock(e),a=t&&s.index===t.index,n=s.offset,r=t&&a?t.offset:this._blocks[s.index].displayValue.length;if(i(this._blocks[s.index],s.index,n,r),t&&!a){for(let e=s.index+1;e<t.index;++e)i(this._blocks[e],e,0,this._blocks[e].displayValue.length);i(this._blocks[t.index],t.index,0,t.offset)}}}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const i=super.remove(t,e);return this._forEachBlocksInRange(t,e,((t,e,s,a)=>{i.aggregate(t.remove(s,a))})),i}nearestInputPos(t,e){if(void 0===e&&(e=Pn),!this._blocks.length)return 0;const i=new sr(this,t);if(e===Pn)return i.pushRightBeforeInput()?i.pos:(i.popState(),i.pushLeftBeforeInput()?i.pos:this.displayValue.length);if(e===Hn||e===In){if(e===Hn){if(i.pushRightBeforeFilled(),i.ok&&i.pos===t)return t;i.popState()}if(i.pushLeftBeforeInput(),i.pushLeftBeforeRequired(),i.pushLeftBeforeFilled(),e===Hn){if(i.pushRightBeforeInput(),i.pushRightBeforeRequired(),i.ok&&i.pos<=t)return i.pos;if(i.popState(),i.ok&&i.pos<=t)return i.pos;i.popState()}return i.ok?i.pos:e===In?0:(i.popState(),i.ok?i.pos:(i.popState(),i.ok?i.pos:0))}return e===Ln||e===Rn?(i.pushRightBeforeInput(),i.pushRightBeforeRequired(),i.pushRightBeforeFilled()?i.pos:e===Rn?this.displayValue.length:(i.popState(),i.ok?i.pos:(i.popState(),i.ok?i.pos:this.nearestInputPos(t,Hn)))):t}totalInputPositions(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);let i=0;return this._forEachBlocksInRange(t,e,((t,e,s,a)=>{i+=t.totalInputPositions(s,a)})),i}maskedBlock(t){return this.maskedBlocks(t)[0]}maskedBlocks(t){const e=this._maskedBlocks[t];return e?e.map((t=>this._blocks[t])):[]}pad(t){const e=new Jn;return this._forEachBlocksInRange(0,this.displayValue.length,(i=>e.aggregate(i.pad(t)))),e}}rr.DEFAULTS={...er.DEFAULTS,lazy:!0,placeholderChar:"_"},rr.STOP_CHAR="`",rr.ESCAPE_CHAR="\\",rr.InputDefinition=nr,rr.FixedDefinition=ar,zn.MaskedPattern=rr;class or extends rr{get _matchFrom(){return this.maxLength-String(this.from).length}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){const{to:e=this.to||0,from:i=this.from||0,maxLength:s=this.maxLength||0,autofix:a=this.autofix,...n}=t;this.to=e,this.from=i,this.maxLength=Math.max(String(e).length,s),this.autofix=a;const r=String(this.from).padStart(this.maxLength,"0"),o=String(this.to).padStart(this.maxLength,"0");let l=0;for(;l<o.length&&o[l]===r[l];)++l;n.mask=o.slice(0,l).replace(/0/g,"\\0")+"0".repeat(this.maxLength-l),super._update(n)}get isComplete(){return super.isComplete&&Boolean(this.value)}boundaries(t){let e="",i="";const[,s,a]=t.match(/^(\D*)(\d*)(\D*)/)||[];return a&&(e="0".repeat(s.length)+a,i="9".repeat(s.length)+a),e=e.padEnd(this.maxLength,"0"),i=i.padEnd(this.maxLength,"9"),[e,i]}doPrepareChar(t,e){let i;return void 0===e&&(e={}),[t,i]=super.doPrepareChar(t.replace(/\D/g,""),e),t||(i.skip=!this.isComplete),[t,i]}_appendCharRaw(t,e){if(void 0===e&&(e={}),!this.autofix||this.value.length+1>this.maxLength)return super._appendCharRaw(t,e);const i=String(this.from).padStart(this.maxLength,"0"),s=String(this.to).padStart(this.maxLength,"0"),[a,n]=this.boundaries(this.value+t);return Number(n)<this.from?super._appendCharRaw(i[this.value.length],e):Number(a)>this.to?!e.tail&&"pad"===this.autofix&&this.value.length+1<this.maxLength?super._appendCharRaw(i[this.value.length],e).aggregate(this._appendCharRaw(t,e)):super._appendCharRaw(s[this.value.length],e):super._appendCharRaw(t,e)}doValidate(t){const e=this.value;if(-1===e.search(/[^0]/)&&e.length<=this._matchFrom)return!0;const[i,s]=this.boundaries(e);return this.from<=Number(s)&&Number(i)<=this.to&&super.doValidate(t)}pad(t){const e=new Jn;if(this.value.length===this.maxLength)return e;const i=this.value,s=this.maxLength-this.value.length;if(s){this.reset();for(let i=0;i<s;++i)e.aggregate(super._appendCharRaw("0",t));i.split("").forEach((t=>this._appendCharRaw(t)))}return e}}zn.MaskedRange=or;class lr extends rr{static extractPatternOptions(t){const{mask:e,pattern:i,...s}=t;return{...s,mask:$n(e)?e:i}}constructor(t){super(lr.extractPatternOptions({...lr.DEFAULTS,...t}))}updateOptions(t){super.updateOptions(t)}_update(t){const{mask:e,pattern:i,blocks:s,...a}={...lr.DEFAULTS,...t},n=Object.assign({},lr.GET_DEFAULT_BLOCKS());t.min&&(n.Y.from=t.min.getFullYear()),t.max&&(n.Y.to=t.max.getFullYear()),t.min&&t.max&&n.Y.from===n.Y.to&&(n.m.from=t.min.getMonth()+1,n.m.to=t.max.getMonth()+1,n.m.from===n.m.to&&(n.d.from=t.min.getDate(),n.d.to=t.max.getDate())),Object.assign(n,this.blocks,s),super._update({...a,mask:$n(e)?e:i,blocks:n})}doValidate(t){const e=this.date;return super.doValidate(t)&&(!this.isComplete||this.isDateExist(this.value)&&null!=e&&(null==this.min||this.min<=e)&&(null==this.max||e<=this.max))}isDateExist(t){return this.format(this.parse(t,this),this).indexOf(t)>=0}get date(){return this.typedValue}set date(t){this.typedValue=t}get typedValue(){return this.isComplete?super.typedValue:null}set typedValue(t){super.typedValue=t}maskEquals(t){return t===Date||super.maskEquals(t)}optionsIsChanged(t){return super.optionsIsChanged(lr.extractPatternOptions(t))}}lr.GET_DEFAULT_BLOCKS=()=>({d:{mask:or,from:1,to:31,maxLength:2},m:{mask:or,from:1,to:12,maxLength:2},Y:{mask:or,from:1900,to:9999}}),lr.DEFAULTS={...rr.DEFAULTS,mask:Date,pattern:"d{.}`m{.}`Y",format:(t,e)=>{if(!t)return"";return[String(t.getDate()).padStart(2,"0"),String(t.getMonth()+1).padStart(2,"0"),t.getFullYear()].join(".")},parse:(t,e)=>{const[i,s,a]=t.split(".").map(Number);return new Date(a,s-1,i)}},zn.MaskedDate=lr;class cr extends er{constructor(t){super({...cr.DEFAULTS,...t}),this.currentMask=void 0}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),"mask"in t&&(this.exposeMask=void 0,this.compiledMasks=Array.isArray(t.mask)?t.mask.map((t=>{const{expose:e,...i}=qn(t),s=Wn({overwrite:this._overwrite,eager:this._eager,skipInvalid:this._skipInvalid,...i});return e&&(this.exposeMask=s),s})):[])}_appendCharRaw(t,e){void 0===e&&(e={});const i=this._applyDispatch(t,e);return this.currentMask&&i.aggregate(this.currentMask._appendChar(t,this.currentMaskFlags(e))),i}_applyDispatch(t,e,i){void 0===t&&(t=""),void 0===e&&(e={}),void 0===i&&(i="");const s=e.tail&&null!=e._beforeTailState?e._beforeTailState._value:this.value,a=this.rawInputValue,n=e.tail&&null!=e._beforeTailState?e._beforeTailState._rawInputValue:a,r=a.slice(n.length),o=this.currentMask,l=new Jn,c=null==o?void 0:o.state;return this.currentMask=this.doDispatch(t,{...e},i),this.currentMask&&(this.currentMask!==o?(this.currentMask.reset(),n&&(this.currentMask.append(n,{raw:!0}),l.tailShift=this.currentMask.value.length-s.length),r&&(l.tailShift+=this.currentMask.append(r,{raw:!0,tail:!0}).tailShift)):c&&(this.currentMask.state=c)),l}_appendPlaceholder(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendPlaceholder()),t}_appendEager(){const t=this._applyDispatch();return this.currentMask&&t.aggregate(this.currentMask._appendEager()),t}appendTail(t){const e=new Jn;return t&&e.aggregate(this._applyDispatch("",{},t)),e.aggregate(this.currentMask?this.currentMask.appendTail(t):super.appendTail(t))}currentMaskFlags(t){var e,i;return{...t,_beforeTailState:(null==(e=t._beforeTailState)?void 0:e.currentMaskRef)===this.currentMask&&(null==(i=t._beforeTailState)?void 0:i.currentMask)||t._beforeTailState}}doDispatch(t,e,i){return void 0===e&&(e={}),void 0===i&&(i=""),this.dispatch(t,this,e,i)}doValidate(t){return super.doValidate(t)&&(!this.currentMask||this.currentMask.doValidate(this.currentMaskFlags(t)))}doPrepare(t,e){void 0===e&&(e={});let[i,s]=super.doPrepare(t,e);if(this.currentMask){let t;[i,t]=super.doPrepare(i,this.currentMaskFlags(e)),s=s.aggregate(t)}return[i,s]}doPrepareChar(t,e){void 0===e&&(e={});let[i,s]=super.doPrepareChar(t,e);if(this.currentMask){let t;[i,t]=super.doPrepareChar(i,this.currentMaskFlags(e)),s=s.aggregate(t)}return[i,s]}reset(){var t;null==(t=this.currentMask)||t.reset(),this.compiledMasks.forEach((t=>t.reset()))}get value(){return this.exposeMask?this.exposeMask.value:this.currentMask?this.currentMask.value:""}set value(t){this.exposeMask?(this.exposeMask.value=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.value=t}get unmaskedValue(){return this.exposeMask?this.exposeMask.unmaskedValue:this.currentMask?this.currentMask.unmaskedValue:""}set unmaskedValue(t){this.exposeMask?(this.exposeMask.unmaskedValue=t,this.currentMask=this.exposeMask,this._applyDispatch()):super.unmaskedValue=t}get typedValue(){return this.exposeMask?this.exposeMask.typedValue:this.currentMask?this.currentMask.typedValue:""}set typedValue(t){if(this.exposeMask)return this.exposeMask.typedValue=t,this.currentMask=this.exposeMask,void this._applyDispatch();let e=String(t);this.currentMask&&(this.currentMask.typedValue=t,e=this.currentMask.unmaskedValue),this.unmaskedValue=e}get displayValue(){return this.currentMask?this.currentMask.displayValue:""}get isComplete(){var t;return Boolean(null==(t=this.currentMask)?void 0:t.isComplete)}get isFilled(){var t;return Boolean(null==(t=this.currentMask)?void 0:t.isFilled)}remove(t,e){const i=new Jn;return this.currentMask&&i.aggregate(this.currentMask.remove(t,e)).aggregate(this._applyDispatch()),i}get state(){var t;return{...super.state,_rawInputValue:this.rawInputValue,compiledMasks:this.compiledMasks.map((t=>t.state)),currentMaskRef:this.currentMask,currentMask:null==(t=this.currentMask)?void 0:t.state}}set state(t){const{compiledMasks:e,currentMaskRef:i,currentMask:s,...a}=t;e&&this.compiledMasks.forEach(((t,i)=>t.state=e[i])),null!=i&&(this.currentMask=i,this.currentMask.state=s),super.state=a}extractInput(t,e,i){return this.currentMask?this.currentMask.extractInput(t,e,i):""}extractTail(t,e){return this.currentMask?this.currentMask.extractTail(t,e):super.extractTail(t,e)}doCommit(){this.currentMask&&this.currentMask.doCommit(),super.doCommit()}nearestInputPos(t,e){return this.currentMask?this.currentMask.nearestInputPos(t,e):super.nearestInputPos(t,e)}get overwrite(){return this.currentMask?this.currentMask.overwrite:this._overwrite}set overwrite(t){this._overwrite=t}get eager(){return this.currentMask?this.currentMask.eager:this._eager}set eager(t){this._eager=t}get skipInvalid(){return this.currentMask?this.currentMask.skipInvalid:this._skipInvalid}set skipInvalid(t){this._skipInvalid=t}get autofix(){return this.currentMask?this.currentMask.autofix:this._autofix}set autofix(t){this._autofix=t}maskEquals(t){return Array.isArray(t)?this.compiledMasks.every(((e,i)=>{if(!t[i])return;const{mask:s,...a}=t[i];return Nn(e,a)&&e.maskEquals(s)})):super.maskEquals(t)}typedValueEquals(t){var e;return Boolean(null==(e=this.currentMask)?void 0:e.typedValueEquals(t))}}cr.DEFAULTS={...er.DEFAULTS,dispatch:(t,e,i,s)=>{if(!e.compiledMasks.length)return;const a=e.rawInputValue,n=e.compiledMasks.map(((n,r)=>{const o=e.currentMask===n,l=o?n.displayValue.length:n.nearestInputPos(n.displayValue.length,In);return n.rawInputValue!==a?(n.reset(),n.append(a,{raw:!0})):o||n.remove(l),n.append(t,e.currentMaskFlags(i)),n.appendTail(s),{index:r,weight:n.rawInputValue.length,totalInputPositions:n.totalInputPositions(0,Math.max(l,n.nearestInputPos(n.displayValue.length,In)))}}));return n.sort(((t,e)=>e.weight-t.weight||e.totalInputPositions-t.totalInputPositions)),e.compiledMasks[n[0].index]}},zn.MaskedDynamic=cr;class dr extends rr{constructor(t){super({...dr.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){const{enum:e,...i}=t;if(e){const t=e.map((t=>t.length)),s=Math.min(...t),a=Math.max(...t)-s;i.mask="*".repeat(s),a&&(i.mask+="["+"*".repeat(a)+"]"),this.enum=e}super._update(i)}_appendCharRaw(t,e){void 0===e&&(e={});const i=Math.min(this.nearestInputPos(0,Rn),this.value.length),s=this.enum.filter((e=>this.matchValue(e,this.unmaskedValue+t,i)));if(s.length){1===s.length&&this._forEachBlocksInRange(0,this.value.length,((t,i)=>{const a=s[0][i];i>=this.value.length||a===t.value||(t.reset(),t._appendChar(a,e))}));const t=super._appendCharRaw(s[0][this.value.length],e);return 1===s.length&&s[0].slice(this.unmaskedValue.length).split("").forEach((e=>t.aggregate(super._appendCharRaw(e)))),t}return new Jn({skip:!this.isComplete})}extractTail(t,e){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),new tr("",t)}remove(t,e){if(void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),t===e)return new Jn;const i=Math.min(super.nearestInputPos(0,Rn),this.value.length);let s;for(s=t;s>=0;--s){if(this.enum.filter((t=>this.matchValue(t,this.value.slice(i,s),i))).length>1)break}const a=super.remove(s,e);return a.tailShift+=s-t,a}get isComplete(){return this.enum.indexOf(this.value)>=0}}dr.DEFAULTS={...rr.DEFAULTS,matchValue:(t,e,i)=>t.indexOf(e,i)===i},zn.MaskedEnum=dr;var hr;zn.MaskedFunction=class extends er{updateOptions(t){super.updateOptions(t)}_update(t){super._update({...t,validate:t.mask})}};class ur extends er{constructor(t){super({...ur.DEFAULTS,...t})}updateOptions(t){super.updateOptions(t)}_update(t){super._update(t),this._updateRegExps()}_updateRegExps(){const t="^"+(this.allowNegative?"[+|\\-]?":""),e=(this.scale?"("+On(this.radix)+"\\d{0,"+this.scale+"})?":"")+"$";this._numberRegExp=new RegExp(t+"\\d*"+e),this._mapToRadixRegExp=new RegExp("["+this.mapToRadix.map(On).join("")+"]","g"),this._thousandsSeparatorRegExp=new RegExp(On(this.thousandsSeparator),"g")}_removeThousandsSeparators(t){return t.replace(this._thousandsSeparatorRegExp,"")}_insertThousandsSeparators(t){const e=t.split(this.radix);return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,this.thousandsSeparator),e.join(this.radix)}doPrepareChar(t,e){void 0===e&&(e={});const[i,s]=super.doPrepareChar(this._removeThousandsSeparators(this.scale&&this.mapToRadix.length&&(e.input&&e.raw||!e.input&&!e.raw)?t.replace(this._mapToRadixRegExp,this.radix):t),e);return t&&!i&&(s.skip=!0),!i||this.allowPositive||this.value||"-"===i||s.aggregate(this._appendChar("-")),[i,s]}_separatorsCount(t,e){void 0===e&&(e=!1);let i=0;for(let s=0;s<t;++s)this._value.indexOf(this.thousandsSeparator,s)===s&&(++i,e&&(t+=this.thousandsSeparator.length));return i}_separatorsCountFromSlice(t){return void 0===t&&(t=this._value),this._separatorsCount(this._removeThousandsSeparators(t).length,!0)}extractInput(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e),this._removeThousandsSeparators(super.extractInput(t,e,i))}_appendCharRaw(t,e){void 0===e&&(e={});const i=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,s=this._separatorsCountFromSlice(i);this._value=this._removeThousandsSeparators(this.value);const a=this._value;this._value+=t;const n=this.number;let r,o=!isNaN(n),l=!1;if(o){let t;null!=this.min&&this.min<0&&this.number<this.min&&(t=this.min),null!=this.max&&this.max>0&&this.number>this.max&&(t=this.max),null!=t&&(this.autofix?(this._value=this.format(t,this).replace(ur.UNMASKED_RADIX,this.radix),l||(l=a===this._value&&!e.tail)):o=!1),o&&(o=Boolean(this._value.match(this._numberRegExp)))}o?r=new Jn({inserted:this._value.slice(a.length),rawInserted:l?"":t,skip:l}):(this._value=a,r=new Jn),this._value=this._insertThousandsSeparators(this._value);const c=e.tail&&e._beforeTailState?e._beforeTailState._value:this._value,d=this._separatorsCountFromSlice(c);return r.tailShift+=(d-s)*this.thousandsSeparator.length,r}_findSeparatorAround(t){if(this.thousandsSeparator){const e=t-this.thousandsSeparator.length+1,i=this.value.indexOf(this.thousandsSeparator,e);if(i<=t)return i}return-1}_adjustRangeWithSeparators(t,e){const i=this._findSeparatorAround(t);i>=0&&(t=i);const s=this._findSeparatorAround(e);return s>=0&&(e=s+this.thousandsSeparator.length),[t,e]}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length),[t,e]=this._adjustRangeWithSeparators(t,e);const i=this.value.slice(0,t),s=this.value.slice(e),a=this._separatorsCount(i.length);this._value=this._insertThousandsSeparators(this._removeThousandsSeparators(i+s));const n=this._separatorsCountFromSlice(i);return new Jn({tailShift:(n-a)*this.thousandsSeparator.length})}nearestInputPos(t,e){if(!this.thousandsSeparator)return t;switch(e){case Pn:case Hn:case In:{const i=this._findSeparatorAround(t-1);if(i>=0){const s=i+this.thousandsSeparator.length;if(t<s||this.value.length<=s||e===In)return i}break}case Ln:case Rn:{const e=this._findSeparatorAround(t);if(e>=0)return e+this.thousandsSeparator.length}}return t}doCommit(){if(this.value){const t=this.number;let e=t;null!=this.min&&(e=Math.max(e,this.min)),null!=this.max&&(e=Math.min(e,this.max)),e!==t&&(this.unmaskedValue=this.format(e,this));let i=this.value;this.normalizeZeros&&(i=this._normalizeZeros(i)),this.padFractionalZeros&&this.scale>0&&(i=this._padFractionalZeros(i)),this._value=i}super.doCommit()}_normalizeZeros(t){const e=this._removeThousandsSeparators(t).split(this.radix);return e[0]=e[0].replace(/^(\D*)(0*)(\d*)/,((t,e,i,s)=>e+s)),t.length&&!/\d$/.test(e[0])&&(e[0]=e[0]+"0"),e.length>1&&(e[1]=e[1].replace(/0*$/,""),e[1].length||(e.length=1)),this._insertThousandsSeparators(e.join(this.radix))}_padFractionalZeros(t){if(!t)return t;const e=t.split(this.radix);return e.length<2&&e.push(""),e[1]=e[1].padEnd(this.scale,"0"),e.join(this.radix)}doSkipInvalid(t,e,i){void 0===e&&(e={});const s=0===this.scale&&t!==this.thousandsSeparator&&(t===this.radix||t===ur.UNMASKED_RADIX||this.mapToRadix.includes(t));return super.doSkipInvalid(t,e,i)&&!s}get unmaskedValue(){return this._removeThousandsSeparators(this._normalizeZeros(this.value)).replace(this.radix,ur.UNMASKED_RADIX)}set unmaskedValue(t){super.unmaskedValue=t}get typedValue(){return this.parse(this.unmaskedValue,this)}set typedValue(t){this.rawInputValue=this.format(t,this).replace(ur.UNMASKED_RADIX,this.radix)}get number(){return this.typedValue}set number(t){this.typedValue=t}get allowNegative(){return null!=this.min&&this.min<0||null!=this.max&&this.max<0}get allowPositive(){return null!=this.min&&this.min>0||null!=this.max&&this.max>0}typedValueEquals(t){return(super.typedValueEquals(t)||ur.EMPTY_VALUES.includes(t)&&ur.EMPTY_VALUES.includes(this.typedValue))&&!(0===t&&""===this.value)}}hr=ur,ur.UNMASKED_RADIX=".",ur.EMPTY_VALUES=[...er.EMPTY_VALUES,0],ur.DEFAULTS={...er.DEFAULTS,mask:Number,radix:",",thousandsSeparator:"",mapToRadix:[hr.UNMASKED_RADIX],min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,scale:2,normalizeZeros:!0,padFractionalZeros:!1,parse:Number,format:t=>t.toLocaleString("en-US",{useGrouping:!1,maximumFractionDigits:20})},zn.MaskedNumber=ur;const pr={MASKED:"value",UNMASKED:"unmaskedValue",TYPED:"typedValue"};function gr(t,e,i){void 0===e&&(e=pr.MASKED),void 0===i&&(i=pr.MASKED);const s=Wn(t);return t=>s.runIsolated((s=>(s[e]=t,s[i])))}zn.PIPE_TYPE=pr,zn.createPipe=gr,zn.pipe=function(t,e,i,s){return gr(e,i,s)(t)};zn.RepeatBlock=class extends rr{get repeatFrom(){var t;return null!=(t=Array.isArray(this.repeat)?this.repeat[0]:this.repeat===1/0?0:this.repeat)?t:0}get repeatTo(){var t;return null!=(t=Array.isArray(this.repeat)?this.repeat[1]:this.repeat)?t:1/0}constructor(t){super(t)}updateOptions(t){super.updateOptions(t)}_update(t){var e,i,s;const{repeat:a,...n}=qn(t);this._blockOpts=Object.assign({},this._blockOpts,n);const r=Wn(this._blockOpts);this.repeat=null!=(e=null!=(i=null!=a?a:r.repeat)?i:this.repeat)?e:1/0,super._update({mask:"m".repeat(Math.max(this.repeatTo===1/0&&(null==(s=this._blocks)?void 0:s.length)||0,this.repeatFrom)),blocks:{m:r},eager:r.eager,overwrite:r.overwrite,skipInvalid:r.skipInvalid,lazy:r.lazy,placeholderChar:r.placeholderChar,displayChar:r.displayChar})}_allocateBlock(t){return t<this._blocks.length?this._blocks[t]:this.repeatTo===1/0||this._blocks.length<this.repeatTo?(this._blocks.push(Wn(this._blockOpts)),this.mask+="m",this._blocks[this._blocks.length-1]):void 0}_appendCharRaw(t,e){void 0===e&&(e={});const i=new Jn;for(let o,l,c=null!=(s=null==(a=this._mapPosToBlock(this.displayValue.length))?void 0:a.index)?s:Math.max(this._blocks.length-1,0);o=null!=(n=this._blocks[c])?n:l=!l&&this._allocateBlock(c);++c){var s,a,n,r;const d=o._appendChar(t,{...e,_beforeTailState:null==(r=e._beforeTailState)||null==(r=r._blocks)?void 0:r[c]});if(d.skip&&l){this._blocks.pop(),this.mask=this.mask.slice(1);break}if(i.aggregate(d),d.consumed)break}return i}_trimEmptyTail(t,e){var i,s;void 0===t&&(t=0);const a=Math.max((null==(i=this._mapPosToBlock(t))?void 0:i.index)||0,this.repeatFrom,0);let n;null!=e&&(n=null==(s=this._mapPosToBlock(e))?void 0:s.index),null==n&&(n=this._blocks.length-1);let r=0;for(let t=n;a<=t&&!this._blocks[t].unmaskedValue;--t,++r);r&&(this._blocks.splice(n-r+1,r),this.mask=this.mask.slice(r))}reset(){super.reset(),this._trimEmptyTail()}remove(t,e){void 0===t&&(t=0),void 0===e&&(e=this.displayValue.length);const i=super.remove(t,e);return this._trimEmptyTail(t,e),i}totalInputPositions(t,e){return void 0===t&&(t=0),null==e&&this.repeatTo===1/0?1/0:super.totalInputPositions(t,e)}get state(){return super.state}set state(t){this._blocks.length=t._blocks.length,this.mask=this.mask.slice(0,this._blocks.length),super.state=t}};try{globalThis.IMask=zn}catch{}var vr=_i`.invalid-feedback-container{display:flex;gap:var(--sgds-form-gap-sm)}.invalid-feedback,.invalid-feedback-container{color:var(--sgds-form-danger-color-default);line-height:var(--sgds-line-height-20)}.invalid-feedback{font-size:var(--sgds-font-size-1);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,fr=_i`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-1);line-height:var(--sgds-line-height-20)}.form-text.disabled{opacity:var(--sgds-opacity-50)}`,mr=_i`.form-label{color:var(--sgds-form-color-default);margin-bottom:0}.form-label.disabled{opacity:var(--sgds-opacity-50)}.form-check-label{color:var(--sgds-form-color-default)}.form-check-input:disabled~.form-check-label,.form-check-input[disabled]~.form-check-label{cursor:not-allowed}`,wr=_i`.form-control::placeholder{color:var(--sgds-form-color-subtle);font-family:var(--sgds-font-family-brand);font-weight:var(--sgds-font-weight-light);line-height:var(--sgds-line-height-24)}`;class yr extends Wa{constructor(){super(...arguments),this.label="",this.hintText="",this.disabled=!1,this.invalid=!1,this._controlId=ja("input"),this._labelId=ja("label")}setInvalid(t){this.invalid=t,t?this.emit("sgds-invalid"):this.emit("sgds-valid")}}yr.styles=[...Wa.styles,vr,fr,mr,wr],t([Gi({reflect:!0})],yr.prototype,"label",void 0),t([Gi({reflect:!0})],yr.prototype,"hintText",void 0),t([Gi({reflect:!0})],yr.prototype,"name",void 0),t([Gi({type:Boolean,reflect:!0})],yr.prototype,"disabled",void 0),t([Gi({type:Boolean,reflect:!0})],yr.prototype,"invalid",void 0);var br=_i`.form-control-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.form-control-group{align-items:center;background-color:var(--sgds-form-surface-default);border:var(--sgds-form-border-width-default) solid var(--sgds-border-color-default);border-radius:var(--input-border-radius,var(--sgds-form-border-radius-md));display:flex;gap:var(--sgds-form-gap-md);height:var(--sgds-dimension-48);justify-content:center;min-width:var(--sgds-dimension-256);padding:0 var(--sgds-form-padding-x);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out;width:-webkit-fill-available;width:-moz-available}.form-control{appearance:none;background-clip:padding-box;background:none;border:none;color:var(--sgds-form-color-default);display:block;flex-grow:1;font-size:var(--sgds-font-size-2);line-height:var(--sgds-line-height-24);outline:none;padding:0}.form-clearable{color:var(--sgds-color-subtle);cursor:pointer}@media (prefers-reduced-motion:reduce){.form-control-group{transition:none}}.form-control-group:not(.disabled):not(.is-invalid):not(.readonly):not(:focus-within):hover{outline:var(--sgds-form-border-width-thick) solid var(--sgds-border-color-emphasis);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-group:not(.disabled):not(.is-invalid):focus-within{outline:var(--sgds-form-outline-focus);outline-offset:var(--sgds-form-outline-offset-focus)}.form-control-container.disabled{opacity:var(--sgds-opacity-50)}.form-control-group.disabled{background-color:var(--sgds-form-surface-muted);cursor:not-allowed}.form-control-group.readonly{background-color:var(--sgds-form-surface-raised)}.form-control-group.is-invalid:not(.disabled){border:var(--sgds-form-border-width-default) solid var(--sgds-form-danger-border-color-default)}.form-control-group:not(.disabled).is-invalid:focus-within{outline:var(--sgds-border-width-2) solid var(--sgds-form-danger-color-default);outline-offset:var(--sgds-form-outline-offset-focus)}`;const xr=(t="value")=>(e,i)=>{const s=e.constructor,a=s.prototype.attributeChangedCallback;s.prototype.attributeChangedCallback=function(e,n,r){var o;const l=s.getPropertyOptions(t);if(e===("string"==typeof l.attribute?l.attribute:t).toLowerCase()){const e=l.converter||Hi,s=("function"==typeof e?e:null!==(o=null==e?void 0:e.fromAttribute)&&void 0!==o?o:Hi.fromAttribute)(r,l.type);this[t]!==s&&(this[i]=s)}a.call(this,e,n,r)}};class _r{constructor(t,e){(this.host=t).addController(this),this._internals=this.host.attachInternals(),this.options=Object.assign({setInvalid:(t,e)=>{t.invalid=e},value:t=>t.value,input:t=>t.input},e)}hostConnected(){this.host.addEventListener("invalid",(t=>this.handleInvalid(t)))}hostDisconnected(){this.host.removeEventListener("invalid",(t=>this.handleInvalid(t)))}handleInvalid(t){t.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(t){const e=t.target;this.options.setInvalid(this.host,!1),this.validateInput(e)}handleChange(t){const e=t.target;this.validateInput(e),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(t,e,i){return this._internals.setValidity(t,e,i)}setFormValue(){const t=this.options.value(this.host);this._internals.setFormValue(t)}validateInput(t){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const e=t.validity;if(e.valid)this._internals.setValidity({});else for(const i in e)e[i]&&(this.validationError=i.toString(),this._internals.setValidity({[this.validationError]:!0},t.validationMessage,t))}}const kr=e=>{class i extends e{constructor(){super(...arguments),this._isTouched=!1}connectedCallback(){var t;super.connectedCallback(),this._mixinShouldSkipSgdsValidation()||null!==(t=this.inputValidationController)&&void 0!==t||(this.inputValidationController=new _r(this))}async firstUpdated(t){super.firstUpdated(t),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinShouldSkipSgdsValidation()||this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(t){this._mixinSetFormValue(),this.inputValidationController.handleChange(t)}_mixinHandleInputChange(t){this._mixinSetFormValue(),this.inputValidationController.handleInput(t)}_mixinResetValidity(t){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this.inputValidationController.validateInput(t),this._isTouched&&(this._isTouched=!1)}_mixinValidate(t){this.inputValidationController.validateInput(t)}_mixinSetFormValue(){this.inputValidationController.setFormValue()}_mixinCheckValidity(){return this.inputValidationController.checkValidity()}_mixinReportValidity(){return this.inputValidationController.reportValidity()}_mixinGetValidity(){return this.inputValidationController.validity}_mixinGetValidationMessage(){return this.inputValidationController.validationMessage}_mixinSetValidity(t,e,i){return this.inputValidationController.setValidity(t,e,i)}_mixinShouldSkipSgdsValidation(){const t=this.closest("form");return(null==t?void 0:t.noValidate)||this.noValidate}}return i.formAssociated=!0,t([ts("sgds-input")],i.prototype,"sgdsInput",void 0),t([ts("sgds-datepicker-input")],i.prototype,"sgdsDatepickerInput",void 0),i};var Cr=_i`:host{--input-border-radius:var(--sgds-form-border-radius-md)}:host(.quantity-toggle) input::-webkit-inner-spin-button{appearance:none;margin:0}:host(.quantity-toggle) input{text-align:center}.form-control-prefix,.form-control-suffix{color:var(--sgds-form-color-subtle);display:flex;flex-wrap:wrap;gap:var(--sgds-gap-xs)}.form-control-group.quantity-toggle{padding:0}sgds-icon[role=button]{cursor:pointer}sgds-icon[role=button]:focus,sgds-icon[role=button]:focus-visible{outline:var(--sgds-form-outline-focus)}.form-control-row{align-items:center;display:flex;gap:var(--sgds-gap-sm)}`;class Mr extends(kr(yr)){constructor(){super(...arguments),this.type="text",this.placeholder="placeholder",this.autofocus=!1,this.readonly=!1,this.defaultValue="",this.valid=!1,this.loading=!1,this.required=!1,this.noValidate=!1,this.value="",this._isTouched=!1,this._showPassword=!1}focus(t){this.input.focus(t)}blur(){this.input.blur()}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}setValidity(t,e,i){return this._mixinSetValidity(t,e,i)}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_handleFocus(){this.emit("sgds-focus")}_handleBlur(){const t=this.emit("sgds-blur",{cancelable:!0});this._mixinShouldSkipSgdsValidation()||t.defaultPrevented||(this.setInvalid(!this._mixinCheckValidity()),this._isTouched=!0)}_handleClick(){this.focus()}_handleChange(t){this.value=this.input.value;const e=this.emit("sgds-change",{cancelable:!0});this._mixinShouldSkipSgdsValidation()||e.defaultPrevented||super._mixinHandleChange(t)}_handleInputChange(t){this.value=this.input.value;const e=this.emit("sgds-input",{cancelable:!0});this._mixinShouldSkipSgdsValidation()||e.defaultPrevented||super._mixinHandleInputChange(t)}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&this.setInvalid(!this._mixinCheckValidity())}_handleDisabledChange(){this.setInvalid(!1)}_renderInput(){const t="both"===this.hasFeedback||"style"===this.hasFeedback;return ln`
|
|
2146
2146
|
<div
|
|
2147
2147
|
class="form-control-group ${en({disabled:this.disabled,readonly:this.readonly,"is-invalid":this.invalid&&t})}"
|
|
2148
2148
|
@click=${this._handleClick}
|