@govtechsg/sgds-web-component 3.24.1-rc.0 → 3.24.1-rc.1

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.
@@ -78,7 +78,7 @@ function Ge(e){return(t,i)=>qe(t,i,{async get(){return await this.updateComplete
78
78
  * @license
79
79
  * Copyright 2020 Google LLC
80
80
  * SPDX-License-Identifier: BSD-3-Clause
81
- */const rt=()=>new at;class at{}const st=new WeakMap;const ct=te(class extends nt{render(e){return S}update(e,[t]){const i=t!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=t,this._context=e.options?.host,this._updateRefValue(this._element=e.element)),S}_updateRefValue(e){if(this.isConnected||(e=void 0),"function"==typeof this._ref){const t=this._context??globalThis;let i=st.get(t);void 0===i&&(i=new WeakMap,st.set(t,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,e),void 0!==e&&this._ref.call(this._context,e)}else this._ref.value=e}get _lastElementForRef(){return"function"==typeof this._ref?st.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),dt=["top","right","bottom","left"],ht=Math.min,ut=Math.max,vt=Math.round,pt=Math.floor,ft=e=>({x:e,y:e}),gt={left:"right",right:"left",bottom:"top",top:"bottom"},mt={start:"end",end:"start"};function wt(e,t,i){return ut(e,ht(t,i))}function _t(e,t){return"function"==typeof e?e(t):e}function bt(e){return e.split("-")[0]}function xt(e){return e.split("-")[1]}function yt(e){return"x"===e?"y":"x"}function Ct(e){return"y"===e?"height":"width"}const Zt=new Set(["top","bottom"]);function Mt(e){return Zt.has(bt(e))?"y":"x"}function Vt(e){return yt(Mt(e))}function kt(e,t,i){void 0===i&&(i=!1);const l=xt(e),o=Vt(e),n=Ct(o);let r="x"===o?l===(i?"end":"start")?"right":"left":"start"===l?"bottom":"top";return t.reference[n]>t.floating[n]&&(r=Bt(r)),[r,Bt(r)]}function Ht(e){return e.replace(/start|end/g,e=>mt[e])}const Pt=["left","right"],$t=["right","left"],Ot=["top","bottom"],zt=["bottom","top"];function St(e,t,i,l){const o=xt(e);let n=function(e,t,i){switch(e){case"top":case"bottom":return i?t?$t:Pt:t?Pt:$t;case"left":case"right":return t?Ot:zt;default:return[]}}(bt(e),"start"===i,l);return o&&(n=n.map(e=>e+"-"+o),t&&(n=n.concat(n.map(Ht)))),n}function Bt(e){return e.replace(/left|right|bottom|top/g,e=>gt[e])}function At(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Lt(e){const{x:t,y:i,width:l,height:o}=e;return{width:l,height:o,top:i,left:t,right:t+l,bottom:i+o,x:t,y:i}}function jt(e,t,i){let{reference:l,floating:o}=e;const n=Mt(t),r=Vt(t),a=Ct(r),s=bt(t),c="y"===n,d=l.x+l.width/2-o.width/2,h=l.y+l.height/2-o.height/2,u=l[a]/2-o[a]/2;let v;switch(s){case"top":v={x:d,y:l.y-o.height};break;case"bottom":v={x:d,y:l.y+l.height};break;case"right":v={x:l.x+l.width,y:h};break;case"left":v={x:l.x-o.width,y:h};break;default:v={x:l.x,y:l.y}}switch(xt(t)){case"start":v[r]-=u*(i&&c?-1:1);break;case"end":v[r]+=u*(i&&c?-1:1)}return v}async function Et(e,t){var i;void 0===t&&(t={});const{x:l,y:o,platform:n,rects:r,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:u=!1,padding:v=0}=_t(t,e),p=At(v),f=a[u?"floating"===h?"reference":"floating":h],g=Lt(await n.getClippingRect({element:null==(i=await(null==n.isElement?void 0:n.isElement(f)))||i?f:f.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:s})),m="floating"===h?{x:l,y:o,width:r.floating.width,height:r.floating.height}:r.reference,w=await(null==n.getOffsetParent?void 0:n.getOffsetParent(a.floating)),_=await(null==n.isElement?void 0:n.isElement(w))&&await(null==n.getScale?void 0:n.getScale(w))||{x:1,y:1},b=Lt(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:w,strategy:s}):m);return{top:(g.top-b.top+p.top)/_.y,bottom:(b.bottom-g.bottom+p.bottom)/_.y,left:(g.left-b.left+p.left)/_.x,right:(b.right-g.right+p.right)/_.x}}function It(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Tt(e){return dt.some(t=>e[t]>=0)}const Rt=new Set(["left","top"]);function Dt(){return"undefined"!=typeof window}function Ut(e){return Wt(e)?(e.nodeName||"").toLowerCase():"#document"}function Ft(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Nt(e){var t;return null==(t=(Wt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Wt(e){return!!Dt()&&(e instanceof Node||e instanceof Ft(e).Node)}function qt(e){return!!Dt()&&(e instanceof Element||e instanceof Ft(e).Element)}function Kt(e){return!!Dt()&&(e instanceof HTMLElement||e instanceof Ft(e).HTMLElement)}function Gt(e){return!(!Dt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Ft(e).ShadowRoot)}const Jt=new Set(["inline","contents"]);function Xt(e){const{overflow:t,overflowX:i,overflowY:l,display:o}=ci(e);return/auto|scroll|overlay|hidden|clip/.test(t+l+i)&&!Jt.has(o)}const Yt=new Set(["table","td","th"]);function Qt(e){return Yt.has(Ut(e))}const ei=[":popover-open",":modal"];function ti(e){return ei.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const ii=["transform","translate","scale","rotate","perspective"],li=["transform","translate","scale","rotate","perspective","filter"],oi=["paint","layout","strict","content"];function ni(e){const t=ri(),i=qt(e)?ci(e):e;return ii.some(e=>!!i[e]&&"none"!==i[e])||!!i.containerType&&"normal"!==i.containerType||!t&&!!i.backdropFilter&&"none"!==i.backdropFilter||!t&&!!i.filter&&"none"!==i.filter||li.some(e=>(i.willChange||"").includes(e))||oi.some(e=>(i.contain||"").includes(e))}function ri(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ai=new Set(["html","body","#document"]);function si(e){return ai.has(Ut(e))}function ci(e){return Ft(e).getComputedStyle(e)}function di(e){return qt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hi(e){if("html"===Ut(e))return e;const t=e.assignedSlot||e.parentNode||Gt(e)&&e.host||Nt(e);return Gt(t)?t.host:t}function ui(e){const t=hi(e);return si(t)?e.ownerDocument?e.ownerDocument.body:e.body:Kt(t)&&Xt(t)?t:ui(t)}function vi(e,t,i){var l;void 0===t&&(t=[]),void 0===i&&(i=!0);const o=ui(e),n=o===(null==(l=e.ownerDocument)?void 0:l.body),r=Ft(o);if(n){const e=pi(r);return t.concat(r,r.visualViewport||[],Xt(o)?o:[],e&&i?vi(e):[])}return t.concat(o,vi(o,[],i))}function pi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fi(e){const t=ci(e);let i=parseFloat(t.width)||0,l=parseFloat(t.height)||0;const o=Kt(e),n=o?e.offsetWidth:i,r=o?e.offsetHeight:l,a=vt(i)!==n||vt(l)!==r;return a&&(i=n,l=r),{width:i,height:l,$:a}}function gi(e){return qt(e)?e:e.contextElement}function mi(e){const t=gi(e);if(!Kt(t))return ft(1);const i=t.getBoundingClientRect(),{width:l,height:o,$:n}=fi(t);let r=(n?vt(i.width):i.width)/l,a=(n?vt(i.height):i.height)/o;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}const wi=ft(0);function _i(e){const t=Ft(e);return ri()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:wi}function bi(e,t,i,l){void 0===t&&(t=!1),void 0===i&&(i=!1);const o=e.getBoundingClientRect(),n=gi(e);let r=ft(1);t&&(l?qt(l)&&(r=mi(l)):r=mi(e));const a=function(e,t,i){return void 0===t&&(t=!1),!(!i||t&&i!==Ft(e))&&t}(n,i,l)?_i(n):ft(0);let s=(o.left+a.x)/r.x,c=(o.top+a.y)/r.y,d=o.width/r.x,h=o.height/r.y;if(n){const e=Ft(n),t=l&&qt(l)?Ft(l):l;let i=e,o=pi(i);for(;o&&l&&t!==i;){const e=mi(o),t=o.getBoundingClientRect(),l=ci(o),n=t.left+(o.clientLeft+parseFloat(l.paddingLeft))*e.x,r=t.top+(o.clientTop+parseFloat(l.paddingTop))*e.y;s*=e.x,c*=e.y,d*=e.x,h*=e.y,s+=n,c+=r,i=Ft(o),o=pi(i)}}return Lt({width:d,height:h,x:s,y:c})}function xi(e,t){const i=di(e).scrollLeft;return t?t.left+i:bi(Nt(e)).left+i}function yi(e,t){const i=e.getBoundingClientRect();return{x:i.left+t.scrollLeft-xi(e,i),y:i.top+t.scrollTop}}const Ci=new Set(["absolute","fixed"]);function Zi(e,t,i){let l;if("viewport"===t)l=function(e,t){const i=Ft(e),l=Nt(e),o=i.visualViewport;let n=l.clientWidth,r=l.clientHeight,a=0,s=0;if(o){n=o.width,r=o.height;const e=ri();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,s=o.offsetTop)}const c=xi(l);if(c<=0){const e=l.ownerDocument,t=e.body,i=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,r=Math.abs(l.clientWidth-t.clientWidth-o);r<=25&&(n-=r)}else c<=25&&(n+=c);return{width:n,height:r,x:a,y:s}}(e,i);else if("document"===t)l=function(e){const t=Nt(e),i=di(e),l=e.ownerDocument.body,o=ut(t.scrollWidth,t.clientWidth,l.scrollWidth,l.clientWidth),n=ut(t.scrollHeight,t.clientHeight,l.scrollHeight,l.clientHeight);let r=-i.scrollLeft+xi(e);const a=-i.scrollTop;return"rtl"===ci(l).direction&&(r+=ut(t.clientWidth,l.clientWidth)-o),{width:o,height:n,x:r,y:a}}(Nt(e));else if(qt(t))l=function(e,t){const i=bi(e,!0,"fixed"===t),l=i.top+e.clientTop,o=i.left+e.clientLeft,n=Kt(e)?mi(e):ft(1);return{width:e.clientWidth*n.x,height:e.clientHeight*n.y,x:o*n.x,y:l*n.y}}(t,i);else{const i=_i(e);l={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Lt(l)}function Mi(e,t){const i=hi(e);return!(i===t||!qt(i)||si(i))&&("fixed"===ci(i).position||Mi(i,t))}function Vi(e,t,i){const l=Kt(t),o=Nt(t),n="fixed"===i,r=bi(e,!0,n,t);let a={scrollLeft:0,scrollTop:0};const s=ft(0);function c(){s.x=xi(o)}if(l||!l&&!n)if(("body"!==Ut(t)||Xt(o))&&(a=di(t)),l){const e=bi(t,!0,n,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&c();n&&!l&&o&&c();const d=!o||l||n?ft(0):yi(o,a);return{x:r.left+a.scrollLeft-s.x-d.x,y:r.top+a.scrollTop-s.y-d.y,width:r.width,height:r.height}}function ki(e){return"static"===ci(e).position}function Hi(e,t){if(!Kt(e)||"fixed"===ci(e).position)return null;if(t)return t(e);let i=e.offsetParent;return Nt(e)===i&&(i=i.ownerDocument.body),i}function Pi(e,t){const i=Ft(e);if(ti(e))return i;if(!Kt(e)){let t=hi(e);for(;t&&!si(t);){if(qt(t)&&!ki(t))return t;t=hi(t)}return i}let l=Hi(e,t);for(;l&&Qt(l)&&ki(l);)l=Hi(l,t);return l&&si(l)&&ki(l)&&!ni(l)?i:l||function(e){let t=hi(e);for(;Kt(t)&&!si(t);){if(ni(t))return t;if(ti(t))return null;t=hi(t)}return null}(e)||i}const $i={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:i,offsetParent:l,strategy:o}=e;const n="fixed"===o,r=Nt(l),a=!!t&&ti(t.floating);if(l===r||a&&n)return i;let s={scrollLeft:0,scrollTop:0},c=ft(1);const d=ft(0),h=Kt(l);if((h||!h&&!n)&&(("body"!==Ut(l)||Xt(r))&&(s=di(l)),Kt(l))){const e=bi(l);c=mi(l),d.x=e.x+l.clientLeft,d.y=e.y+l.clientTop}const u=!r||h||n?ft(0):yi(r,s);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-s.scrollLeft*c.x+d.x+u.x,y:i.y*c.y-s.scrollTop*c.y+d.y+u.y}},getDocumentElement:Nt,getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:l,strategy:o}=e;const n=[..."clippingAncestors"===i?ti(t)?[]:function(e,t){const i=t.get(e);if(i)return i;let l=vi(e,[],!1).filter(e=>qt(e)&&"body"!==Ut(e)),o=null;const n="fixed"===ci(e).position;let r=n?hi(e):e;for(;qt(r)&&!si(r);){const t=ci(r),i=ni(r);i||"fixed"!==t.position||(o=null),(n?!i&&!o:!i&&"static"===t.position&&o&&Ci.has(o.position)||Xt(r)&&!i&&Mi(e,r))?l=l.filter(e=>e!==r):o=t,r=hi(r)}return t.set(e,l),l}(t,this._c):[].concat(i),l],r=n[0],a=n.reduce((e,i)=>{const l=Zi(t,i,o);return e.top=ut(l.top,e.top),e.right=ht(l.right,e.right),e.bottom=ht(l.bottom,e.bottom),e.left=ut(l.left,e.left),e},Zi(t,r,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Pi,getElementRects:async function(e){const t=this.getOffsetParent||Pi,i=this.getDimensions,l=await i(e.floating);return{reference:Vi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:i}=fi(e);return{width:t,height:i}},getScale:mi,isElement:qt,isRTL:function(e){return"rtl"===ci(e).direction}};function Oi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zi(e,t,i,l){void 0===l&&(l={});const{ancestorScroll:o=!0,ancestorResize:n=!0,elementResize:r="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:s=!1}=l,c=gi(e),d=o||n?[...c?vi(c):[],...vi(t)]:[];d.forEach(e=>{o&&e.addEventListener("scroll",i,{passive:!0}),n&&e.addEventListener("resize",i)});const h=c&&a?function(e,t){let i,l=null;const o=Nt(e);function n(){var e;clearTimeout(i),null==(e=l)||e.disconnect(),l=null}return function r(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),n();const c=e.getBoundingClientRect(),{left:d,top:h,width:u,height:v}=c;if(a||t(),!u||!v)return;const p={rootMargin:-pt(h)+"px "+-pt(o.clientWidth-(d+u))+"px "+-pt(o.clientHeight-(h+v))+"px "+-pt(d)+"px",threshold:ut(0,ht(1,s))||1};let f=!0;function g(t){const l=t[0].intersectionRatio;if(l!==s){if(!f)return r();l?r(!1,l):i=setTimeout(()=>{r(!1,1e-7)},1e3)}1!==l||Oi(c,e.getBoundingClientRect())||r(),f=!1}try{l=new IntersectionObserver(g,{...p,root:o.ownerDocument})}catch(e){l=new IntersectionObserver(g,p)}l.observe(e)}(!0),n}(c,i):null;let u,v=-1,p=null;r&&(p=new ResizeObserver(e=>{let[l]=e;l&&l.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),i()}),c&&!s&&p.observe(c),p.observe(t));let f=s?bi(e):null;return s&&function t(){const l=bi(e);f&&!Oi(f,l)&&i();f=l,u=requestAnimationFrame(t)}(),i(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",i),n&&e.removeEventListener("resize",i)}),null==h||h(),null==(e=p)||e.disconnect(),p=null,s&&cancelAnimationFrame(u)}}const Si=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var i,l;const{x:o,y:n,placement:r,middlewareData:a}=t,s=await async function(e,t){const{placement:i,platform:l,elements:o}=e,n=await(null==l.isRTL?void 0:l.isRTL(o.floating)),r=bt(i),a=xt(i),s="y"===Mt(i),c=Rt.has(r)?-1:1,d=n&&s?-1:1,h=_t(t,e);let{mainAxis:u,crossAxis:v,alignmentAxis:p}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&"number"==typeof p&&(v="end"===a?-1*p:p),s?{x:v*d,y:u*c}:{x:u*c,y:v*d}}(t,e);return r===(null==(i=a.offset)?void 0:i.placement)&&null!=(l=a.arrow)&&l.alignmentOffset?{}:{x:o+s.x,y:n+s.y,data:{...s,placement:r}}}}},Bi=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:l,placement:o}=t,{mainAxis:n=!0,crossAxis:r=!1,limiter:a={fn:e=>{let{x:t,y:i}=e;return{x:t,y:i}}},...s}=_t(e,t),c={x:i,y:l},d=await Et(t,s),h=Mt(bt(o)),u=yt(h);let v=c[u],p=c[h];if(n){const e="y"===u?"bottom":"right";v=wt(v+d["y"===u?"top":"left"],v,v-d[e])}if(r){const e="y"===h?"bottom":"right";p=wt(p+d["y"===h?"top":"left"],p,p-d[e])}const f=a.fn({...t,[u]:v,[h]:p});return{...f,data:{x:f.x-i,y:f.y-l,enabled:{[u]:n,[h]:r}}}}}},Ai=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var i,l;const{placement:o,middlewareData:n,rects:r,initialPlacement:a,platform:s,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:f=!0,...g}=_t(e,t);if(null!=(i=n.arrow)&&i.alignmentOffset)return{};const m=bt(o),w=Mt(a),_=bt(a)===a,b=await(null==s.isRTL?void 0:s.isRTL(c.floating)),x=u||(_||!f?[Bt(a)]:function(e){const t=Bt(e);return[Ht(e),t,Ht(t)]}(a)),y="none"!==p;!u&&y&&x.push(...St(a,f,p,b));const C=[a,...x],Z=await Et(t,g),M=[];let V=(null==(l=n.flip)?void 0:l.overflows)||[];if(d&&M.push(Z[m]),h){const e=kt(o,r,b);M.push(Z[e[0]],Z[e[1]])}if(V=[...V,{placement:o,overflows:M}],!M.every(e=>e<=0)){var k,H;const e=((null==(k=n.flip)?void 0:k.index)||0)+1,t=C[e];if(t){if(!("alignment"===h&&w!==Mt(t))||V.every(e=>Mt(e.placement)!==w||e.overflows[0]>0))return{data:{index:e,overflows:V},reset:{placement:t}}}let i=null==(H=V.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:H.placement;if(!i)switch(v){case"bestFit":{var P;const e=null==(P=V.filter(e=>{if(y){const t=Mt(e.placement);return t===w||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:P[0];e&&(i=e);break}case"initialPlacement":i=a}if(o!==i)return{reset:{placement:i}}}return{}}}},Li=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var i,l;const{placement:o,rects:n,platform:r,elements:a}=t,{apply:s=()=>{},...c}=_t(e,t),d=await Et(t,c),h=bt(o),u=xt(o),v="y"===Mt(o),{width:p,height:f}=n.floating;let g,m;"top"===h||"bottom"===h?(g=h,m=u===(await(null==r.isRTL?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(m=h,g="end"===u?"top":"bottom");const w=f-d.top-d.bottom,_=p-d.left-d.right,b=ht(f-d[g],w),x=ht(p-d[m],_),y=!t.middlewareData.shift;let C=b,Z=x;if(null!=(i=t.middlewareData.shift)&&i.enabled.x&&(Z=_),null!=(l=t.middlewareData.shift)&&l.enabled.y&&(C=w),y&&!u){const e=ut(d.left,0),t=ut(d.right,0),i=ut(d.top,0),l=ut(d.bottom,0);v?Z=p-2*(0!==e||0!==t?e+t:ut(d.left,d.right)):C=f-2*(0!==i||0!==l?i+l:ut(d.top,d.bottom))}await s({...t,availableWidth:Z,availableHeight:C});const M=await r.getDimensions(a.floating);return p!==M.width||f!==M.height?{reset:{rects:!0}}:{}}}},ji=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:i}=t,{strategy:l="referenceHidden",...o}=_t(e,t);switch(l){case"referenceHidden":{const e=It(await Et(t,{...o,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Tt(e)}}}case"escaped":{const e=It(await Et(t,{...o,altBoundary:!0}),i.floating);return{data:{escapedOffsets:e,escaped:Tt(e)}}}default:return{}}}}},Ei=(e,t,i)=>{const l=new Map,o={platform:$i,...i},n={...o.platform,_c:l};return(async(e,t,i)=>{const{placement:l="bottom",strategy:o="absolute",middleware:n=[],platform:r}=i,a=n.filter(Boolean),s=await(null==r.isRTL?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=jt(c,l,s),u=l,v={},p=0;for(let i=0;i<a.length;i++){const{name:n,fn:f}=a[i],{x:g,y:m,data:w,reset:_}=await f({x:d,y:h,initialPlacement:l,placement:u,strategy:o,middlewareData:v,rects:c,platform:r,elements:{reference:e,floating:t}});d=null!=g?g:d,h=null!=m?m:h,v={...v,[n]:{...v[n],...w}},_&&p<=50&&(p++,"object"==typeof _&&(_.placement&&(u=_.placement),_.rects&&(c=!0===_.rects?await r.getElementRects({reference:e,floating:t,strategy:o}):_.rects),({x:d,y:h}=jt(c,u,s))),i=-1)}return{x:d,y:h,placement:u,strategy:o,middlewareData:v}})(e,t,{...o,platform:n})};var Ii=we`:host([menuisopen]:not([disabled]):not([readonly])) .dropdown-menu{display:block}.dropdown-menu{background-clip:padding-box;background-color:var(--sgds-surface-default);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 1px 0 hsla(0,0%,5%,.12),0 4px 8px 0 hsla(0,0%,5%,.12);color:var(--sgds-color-default);display:none;list-style:none;margin:0;max-height:var(--sgds-dimension-480);min-width:var(--sgds-dimension-192);overflow-y:auto;padding:var(--sgds-padding-xs) 0;position:absolute;text-align:left;z-index:var(--sgds-z-index-floating)}.nav-tabs .dropdown-menu{border-top-left-radius:0;border-top-right-radius:0;margin-top:calc(var(--sgds-nav-tabs-border-width)*-1)}@media (min-width:512px){.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:768px){.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1024px){.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1280px){.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1440px){.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.sgds.navbar .dropdown-menu.megamenu{left:0;right:0;width:100%}.sgds.combobox>.dropdown-menu{min-width:100%}`,Ti=we`.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-14);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,Ri=we`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs)}.form-text.disabled{opacity:var(--sgds-opacity-40)}`,Di=we`.form-control-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.m-width-160{min-width:var(--sgds-dimension-160)}.m-width-256{min-width:var(--sgds-dimension-256)}.form-label{color:var(--sgds-form-color-default);font-size:var(--sgds-font-size-label-md);font-weight:var(--sgds-font-weight-semibold)}.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;overflow:hidden;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-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-label-md);line-height:var(--sgds-line-height-xs);min-width:0;outline:none;padding:0;width:100%}.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-40)}.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 Ui=(e="value")=>(t,i)=>{const l=t.constructor,o=l.prototype.attributeChangedCallback;l.prototype.attributeChangedCallback=function(t,n,r){var a;const s=l.getPropertyOptions(e);if(t===("string"==typeof s.attribute?s.attribute:e).toLowerCase()){const t=s.converter||Se,l=("function"==typeof t?t:null!==(a=null==t?void 0:t.fromAttribute)&&void 0!==a?a:Se.fromAttribute)(r,s.type);this[e]!==l&&(this[i]=l)}o.call(this,t,n,r)}};function Fi(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}class Ni{constructor(e,t){(this.host=e).addController(this),this._internals=e._internals||this.host.attachInternals(),this.options=Object.assign({setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input},t)}hostConnected(){this.host.addEventListener("invalid",e=>this.handleInvalid(e))}hostDisconnected(){this.host.removeEventListener("invalid",e=>this.handleInvalid(e))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){const t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){const t=e.target;this.validateInput(t),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(e,t,i){return this._internals.setValidity(e,t,i)}setFormValue(){const e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const t=e.validity;if(t.valid)this._internals.setValidity({});else for(const i in t)t[i]&&(this.validationError=i.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const Wi=t=>{class i extends t{constructor(...e){super(...e),this._isTouched=!1,this._internals=this.attachInternals()}connectedCallback(){var e;super.connectedCallback(),null!==(e=this.inputValidationController)&&void 0!==e||(this.inputValidationController=new Ni(this))}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this._isTouched&&(this._isTouched=!1),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinValidate(e){this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinSetFormValue(){const e=this.value;this._internals.setFormValue(e)}_mixinCheckValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.checkValidity()}_mixinReportValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.reportValidity()}_mixinGetValidity(){return this._internals.validity}_mixinGetValidationMessage(){return this._internals.validationMessage}_mixinSetValidity(e,t,i){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(e,t,i)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return i.formAssociated=!0,e([Ge("sgds-input")],i.prototype,"sgdsInput",void 0),e([Ge("sgds-datepicker-input")],i.prototype,"sgdsDatepickerInput",void 0),i};var qi=we`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-font-smoothing:antialiased;color:var(--sgds-body-color-default,#1a1a1a);display:block;font-family:var(--sgds-font-family-brand,"Inter",system-ui,sans-serif);font-size:var(--sgds-font-size-body-md,1rem);font-weight:var(--sgds-font-weight-regular,400);line-height:var(--sgds-line-height-xs,24px);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:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 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' viewBox='0 0 24 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:top;width:1em}::slotted(svg){vertical-align:middle}}`;class Ki extends Ie{emit(e,t){const i=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(i),i}static define(e,t=this,i={}){if(customElements.get(e));else try{customElements.define(e,t,i)}catch(l){customElements.define(e,class extends t{},i)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([e,t])=>{this.constructor.define(e,t)})}firstUpdated(e){var t;super.firstUpdated(e),this.ssr&&(null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("slot").forEach(e=>{e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}Ki.styles=[qi],Ki.dependencies={},e([Ne({type:Boolean,reflect:!0})],Ki.prototype,"ssr",void 0);class Gi extends Ki{constructor(){super(...arguments),this.myDropdown=rt(),this.dropdownMenuId=Fi("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=rt(),this._handleClickOutOfElement=e=>{this.menuIsOpen&&(e.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(e){super.firstUpdated(e),this.menuIsOpen&&requestAnimationFrame(async()=>{await this.updateFloatingPosition(),this._startAutoUpdate()})}async showMenu(){this.disabled||this.menuIsOpen||(this.menuIsOpen=!0,this.emit("sgds-show"),await this.updateFloatingPosition(),this.emit("sgds-after-show"),this._startAutoUpdate())}_startAutoUpdate(){this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=zi(this.myDropdown.value,this.menuRef.value,()=>this.updateFloatingPosition()))}hideMenu(e){this.menuIsOpen&&(this.emit("sgds-hide",{detail:{isOutside:e}}),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()}_handleKeyboardMenuEvent(e){if(!this.readonly)switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),this.menuIsOpen||this.showMenu();break;case"Escape":this.hideMenu()}}mergeMiddleware(e,t){const i=e=>{var t;return(null==e?void 0:e.name)||(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)},l=t.map(i),o=e.map(e=>{const o=i(e),n=l.indexOf(o);return-1!==n?t[n]:e}).concat(t.filter(t=>!e.some(e=>i(e)===i(t))));return o}async updateFloatingPosition(){if(!this.myDropdown.value||!this.menuRef.value)return;let e="bottom-start";switch(this.drop){case"up":e=this.menuAlignRight?"top-end":"top-start";break;case"right":e="right-start";break;case"left":e="left-start";break;case"down":e=this.menuAlignRight?"bottom-end":"bottom-start";break;default:e="bottom-start"}const t=[Si(8),this.noFlip?void 0:Ai(),Bi()].filter(Boolean);let i=t;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(i=this.mergeMiddleware(t,this.floatingOpts.middleware.filter(Boolean)));const l=Object.assign(Object.assign({strategy:"fixed",placement:e},this.floatingOpts),{middleware:i}),{x:o,y:n,strategy:r,placement:a}=await Ei(this.myDropdown.value,this.menuRef.value,l);this.menuRef.value.setAttribute("data-placement",a),Object.assign(this.menuRef.value.style,{position:r,left:`${o}px`,top:`${n}px`})}}e([Ne({type:Boolean,state:!0})],Gi.prototype,"noFlip",void 0),e([Ne({type:Boolean,reflect:!0,state:!0})],Gi.prototype,"menuAlignRight",void 0),e([Ne({type:String,reflect:!0,state:!0})],Gi.prototype,"drop",void 0),e([Ne({type:Object})],Gi.prototype,"floatingOpts",void 0),e([Ne({type:Boolean,reflect:!0})],Gi.prototype,"menuIsOpen",void 0),e([Ne({type:Boolean,reflect:!0})],Gi.prototype,"disabled",void 0),e([Ne({type:Boolean,reflect:!0})],Gi.prototype,"readonly",void 0);class Ji extends Gi{constructor(){super(...arguments),this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1,this.hidden=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-hide",this._resetMenu)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sgds-hide",this._resetMenu)}firstUpdated(e){super.firstUpdated(e),this.addEventListener("keydown",this._handleKeyboardMenuItemsEvent)}handleSelectSlot(e){const t=this._getActiveMenuItems(),i=t.find(t=>e.composedPath().includes(t));if(!i)return;const l=t.indexOf(i);this.nextDropdownItemNo=l+1,this.prevDropdownItemNo=l<=0?t.length-1:l-1,i.disabled||(this.emit("sgds-select",{detail:{item:i}}),"outside"!==this.close&&this.hideMenu())}_resetMenu(){this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1;this._getMenuItems().forEach(e=>{var t;const i=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".dropdown-item");i&&i.removeAttribute("tabindex")})}_handleKeyboardMenuItemsEvent(e){if(this.readonly)return;const t=this._getActiveMenuItems();if(0!==t.length)switch(e.key){case"ArrowDown":e.preventDefault(),this._setMenuItem(this.nextDropdownItemNo);break;case"ArrowUp":e.preventDefault(),this._setMenuItem(this.prevDropdownItemNo);break;case"Tab":if(!this.menuIsOpen)return;e.preventDefault(),e.shiftKey?this._setMenuItem(this.prevDropdownItemNo):this._setMenuItem(this.nextDropdownItemNo);break;case"Enter":t.find(t=>e.composedPath().includes(t))&&this.handleSelectSlot(e);break}}_getMenuItems(){var e,t;if(this.shadowRoot.querySelector("slot#default")){return null===(e=this.shadowRoot.querySelector("slot#default"))||void 0===e?void 0:e.assignedElements({flatten:!0}).filter(e=>!e.classList.contains("empty-menu")&&!e.hasAttribute("hidden"))}if(null===(t=this.menu)||void 0===t?void 0:t.hasChildNodes()){return[...Array.from(this.menu.children)]}return[]}_getActiveMenuItems(){return this._getMenuItems().filter(e=>!e.disabled&&!e.hidden)}_setMenuItem(e){const t=this._getActiveMenuItems();if(0===t.length)return;const i=(e%t.length+t.length)%t.length,l=t[i];this.emit("i-sgds-option-focus",{detail:{option:l}}),this.nextDropdownItemNo=(i+1)%t.length,this.prevDropdownItemNo=(i-1+t.length)%t.length,t.forEach(e=>{const t=e.shadowRoot.querySelector(".dropdown-item");t.setAttribute("tabindex",e===l?"0":"-1"),e===l&&t.focus()})}}var Xi,Yi;Ji.styles=Gi.styles,e([(Xi="ul.dropdown-menu",(e,t,i)=>{const l=e=>{const i=e.renderRoot?.querySelector(Xi)??null;if(null===i&&Yi&&!e.hasUpdated){const e="object"==typeof t?t.name:t;Ke("",`@query'd field ${JSON.stringify(String(e))} with the 'cache' flag set for selector '${Xi}' has been accessed before the first update and returned null. This is expected if the renderRoot tree has not been provided beforehand (e.g. via Declarative Shadow DOM). Therefore the value hasn't been cached.`)}return i};if(Yi){const{get:o,set:n}="object"==typeof t?e:i??(()=>{const e=Symbol(`${String(t)} (@query() cache)`);return{get(){return this[e]},set(t){this[e]=t}}})();return qe(e,t,{get(){let e=o.call(this);return void 0===e&&(e=l(this),(null!==e||this.hasUpdated)&&n.call(this,e)),e}})}return qe(e,t,{get(){return l(this)}})})],Ji.prototype,"menu",void 0),e([We()],Ji.prototype,"nextDropdownItemNo",void 0),e([We()],Ji.prototype,"prevDropdownItemNo",void 0),e([Ne({type:Boolean,reflect:!0})],Ji.prototype,"hidden",void 0);var Qi=we`.empty-menu,.loading-menu{padding:var(--sgds-padding-sm) var(--sgds-padding-lg,20px);pointer-events:none}.loading-menu{align-items:center;display:flex;gap:var(--sgds-gap-xs)}`;class el extends(Wi(Ji)){setInvalid(e){this.invalid=e,e?this.emit("sgds-invalid"):this.emit("sgds-valid")}constructor(){super(),this.label="",this.hintText="",this.autofocus=!1,this.disabled=!1,this.required=!1,this.loading=!1,this.value="",this.displayValue="",this.defaultValue="",this.hasFeedback=!1,this.invalidFeedback="",this.invalid=!1,this.autocomplete="on",this.menuList=[],this.selectedItems=[],this.filteredList=[],this._isTouched=!1,this._controlId=Fi("input"),this._labelId=Fi("label"),this.floatingOpts={middleware:[Li({apply({rects:e,elements:t}){t.floating.style.width=`${e.reference.width}px`}})]}}connectedCallback(){super.connectedCallback(),this.addEventListener("blur",async e=>{var t;if(this._mixinShouldSkipSgdsValidation())return;const i=this.constructor.childName,l=(null===(t=e.relatedTarget)||void 0===t?void 0:t.tagName.toLowerCase())===i;this.invalid=!l&&!this._mixinReportValidity()})}reportValidity(){return this._mixinReportValidity()}setValidity(e,t,i){return this._mixinSetValidity(e,t,i)}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_renderFeedback(){return this.invalid&&this.hasFeedback?$` <div class="invalid-feedback-container">
81
+ */const rt=()=>new at;class at{}const st=new WeakMap;const ct=te(class extends nt{render(e){return S}update(e,[t]){const i=t!==this._ref;return i&&void 0!==this._ref&&this._updateRefValue(void 0),(i||this._lastElementForRef!==this._element)&&(this._ref=t,this._context=e.options?.host,this._updateRefValue(this._element=e.element)),S}_updateRefValue(e){if(this.isConnected||(e=void 0),"function"==typeof this._ref){const t=this._context??globalThis;let i=st.get(t);void 0===i&&(i=new WeakMap,st.set(t,i)),void 0!==i.get(this._ref)&&this._ref.call(this._context,void 0),i.set(this._ref,e),void 0!==e&&this._ref.call(this._context,e)}else this._ref.value=e}get _lastElementForRef(){return"function"==typeof this._ref?st.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),dt=["top","right","bottom","left"],ht=Math.min,ut=Math.max,vt=Math.round,pt=Math.floor,ft=e=>({x:e,y:e}),gt={left:"right",right:"left",bottom:"top",top:"bottom"},mt={start:"end",end:"start"};function wt(e,t,i){return ut(e,ht(t,i))}function _t(e,t){return"function"==typeof e?e(t):e}function bt(e){return e.split("-")[0]}function xt(e){return e.split("-")[1]}function yt(e){return"x"===e?"y":"x"}function Ct(e){return"y"===e?"height":"width"}const Zt=new Set(["top","bottom"]);function Mt(e){return Zt.has(bt(e))?"y":"x"}function Vt(e){return yt(Mt(e))}function kt(e,t,i){void 0===i&&(i=!1);const l=xt(e),o=Vt(e),n=Ct(o);let r="x"===o?l===(i?"end":"start")?"right":"left":"start"===l?"bottom":"top";return t.reference[n]>t.floating[n]&&(r=Bt(r)),[r,Bt(r)]}function Ht(e){return e.replace(/start|end/g,e=>mt[e])}const Pt=["left","right"],$t=["right","left"],Ot=["top","bottom"],zt=["bottom","top"];function St(e,t,i,l){const o=xt(e);let n=function(e,t,i){switch(e){case"top":case"bottom":return i?t?$t:Pt:t?Pt:$t;case"left":case"right":return t?Ot:zt;default:return[]}}(bt(e),"start"===i,l);return o&&(n=n.map(e=>e+"-"+o),t&&(n=n.concat(n.map(Ht)))),n}function Bt(e){return e.replace(/left|right|bottom|top/g,e=>gt[e])}function At(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Lt(e){const{x:t,y:i,width:l,height:o}=e;return{width:l,height:o,top:i,left:t,right:t+l,bottom:i+o,x:t,y:i}}function jt(e,t,i){let{reference:l,floating:o}=e;const n=Mt(t),r=Vt(t),a=Ct(r),s=bt(t),c="y"===n,d=l.x+l.width/2-o.width/2,h=l.y+l.height/2-o.height/2,u=l[a]/2-o[a]/2;let v;switch(s){case"top":v={x:d,y:l.y-o.height};break;case"bottom":v={x:d,y:l.y+l.height};break;case"right":v={x:l.x+l.width,y:h};break;case"left":v={x:l.x-o.width,y:h};break;default:v={x:l.x,y:l.y}}switch(xt(t)){case"start":v[r]-=u*(i&&c?-1:1);break;case"end":v[r]+=u*(i&&c?-1:1)}return v}async function Et(e,t){var i;void 0===t&&(t={});const{x:l,y:o,platform:n,rects:r,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:u=!1,padding:v=0}=_t(t,e),p=At(v),f=a[u?"floating"===h?"reference":"floating":h],g=Lt(await n.getClippingRect({element:null==(i=await(null==n.isElement?void 0:n.isElement(f)))||i?f:f.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:s})),m="floating"===h?{x:l,y:o,width:r.floating.width,height:r.floating.height}:r.reference,w=await(null==n.getOffsetParent?void 0:n.getOffsetParent(a.floating)),_=await(null==n.isElement?void 0:n.isElement(w))&&await(null==n.getScale?void 0:n.getScale(w))||{x:1,y:1},b=Lt(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:w,strategy:s}):m);return{top:(g.top-b.top+p.top)/_.y,bottom:(b.bottom-g.bottom+p.bottom)/_.y,left:(g.left-b.left+p.left)/_.x,right:(b.right-g.right+p.right)/_.x}}function It(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Tt(e){return dt.some(t=>e[t]>=0)}const Rt=new Set(["left","top"]);function Dt(){return"undefined"!=typeof window}function Ut(e){return Wt(e)?(e.nodeName||"").toLowerCase():"#document"}function Ft(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Nt(e){var t;return null==(t=(Wt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Wt(e){return!!Dt()&&(e instanceof Node||e instanceof Ft(e).Node)}function qt(e){return!!Dt()&&(e instanceof Element||e instanceof Ft(e).Element)}function Kt(e){return!!Dt()&&(e instanceof HTMLElement||e instanceof Ft(e).HTMLElement)}function Gt(e){return!(!Dt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Ft(e).ShadowRoot)}const Jt=new Set(["inline","contents"]);function Xt(e){const{overflow:t,overflowX:i,overflowY:l,display:o}=ci(e);return/auto|scroll|overlay|hidden|clip/.test(t+l+i)&&!Jt.has(o)}const Yt=new Set(["table","td","th"]);function Qt(e){return Yt.has(Ut(e))}const ei=[":popover-open",":modal"];function ti(e){return ei.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const ii=["transform","translate","scale","rotate","perspective"],li=["transform","translate","scale","rotate","perspective","filter"],oi=["paint","layout","strict","content"];function ni(e){const t=ri(),i=qt(e)?ci(e):e;return ii.some(e=>!!i[e]&&"none"!==i[e])||!!i.containerType&&"normal"!==i.containerType||!t&&!!i.backdropFilter&&"none"!==i.backdropFilter||!t&&!!i.filter&&"none"!==i.filter||li.some(e=>(i.willChange||"").includes(e))||oi.some(e=>(i.contain||"").includes(e))}function ri(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ai=new Set(["html","body","#document"]);function si(e){return ai.has(Ut(e))}function ci(e){return Ft(e).getComputedStyle(e)}function di(e){return qt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function hi(e){if("html"===Ut(e))return e;const t=e.assignedSlot||e.parentNode||Gt(e)&&e.host||Nt(e);return Gt(t)?t.host:t}function ui(e){const t=hi(e);return si(t)?e.ownerDocument?e.ownerDocument.body:e.body:Kt(t)&&Xt(t)?t:ui(t)}function vi(e,t,i){var l;void 0===t&&(t=[]),void 0===i&&(i=!0);const o=ui(e),n=o===(null==(l=e.ownerDocument)?void 0:l.body),r=Ft(o);if(n){const e=pi(r);return t.concat(r,r.visualViewport||[],Xt(o)?o:[],e&&i?vi(e):[])}return t.concat(o,vi(o,[],i))}function pi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fi(e){const t=ci(e);let i=parseFloat(t.width)||0,l=parseFloat(t.height)||0;const o=Kt(e),n=o?e.offsetWidth:i,r=o?e.offsetHeight:l,a=vt(i)!==n||vt(l)!==r;return a&&(i=n,l=r),{width:i,height:l,$:a}}function gi(e){return qt(e)?e:e.contextElement}function mi(e){const t=gi(e);if(!Kt(t))return ft(1);const i=t.getBoundingClientRect(),{width:l,height:o,$:n}=fi(t);let r=(n?vt(i.width):i.width)/l,a=(n?vt(i.height):i.height)/o;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}const wi=ft(0);function _i(e){const t=Ft(e);return ri()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:wi}function bi(e,t,i,l){void 0===t&&(t=!1),void 0===i&&(i=!1);const o=e.getBoundingClientRect(),n=gi(e);let r=ft(1);t&&(l?qt(l)&&(r=mi(l)):r=mi(e));const a=function(e,t,i){return void 0===t&&(t=!1),!(!i||t&&i!==Ft(e))&&t}(n,i,l)?_i(n):ft(0);let s=(o.left+a.x)/r.x,c=(o.top+a.y)/r.y,d=o.width/r.x,h=o.height/r.y;if(n){const e=Ft(n),t=l&&qt(l)?Ft(l):l;let i=e,o=pi(i);for(;o&&l&&t!==i;){const e=mi(o),t=o.getBoundingClientRect(),l=ci(o),n=t.left+(o.clientLeft+parseFloat(l.paddingLeft))*e.x,r=t.top+(o.clientTop+parseFloat(l.paddingTop))*e.y;s*=e.x,c*=e.y,d*=e.x,h*=e.y,s+=n,c+=r,i=Ft(o),o=pi(i)}}return Lt({width:d,height:h,x:s,y:c})}function xi(e,t){const i=di(e).scrollLeft;return t?t.left+i:bi(Nt(e)).left+i}function yi(e,t){const i=e.getBoundingClientRect();return{x:i.left+t.scrollLeft-xi(e,i),y:i.top+t.scrollTop}}const Ci=new Set(["absolute","fixed"]);function Zi(e,t,i){let l;if("viewport"===t)l=function(e,t){const i=Ft(e),l=Nt(e),o=i.visualViewport;let n=l.clientWidth,r=l.clientHeight,a=0,s=0;if(o){n=o.width,r=o.height;const e=ri();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,s=o.offsetTop)}const c=xi(l);if(c<=0){const e=l.ownerDocument,t=e.body,i=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,r=Math.abs(l.clientWidth-t.clientWidth-o);r<=25&&(n-=r)}else c<=25&&(n+=c);return{width:n,height:r,x:a,y:s}}(e,i);else if("document"===t)l=function(e){const t=Nt(e),i=di(e),l=e.ownerDocument.body,o=ut(t.scrollWidth,t.clientWidth,l.scrollWidth,l.clientWidth),n=ut(t.scrollHeight,t.clientHeight,l.scrollHeight,l.clientHeight);let r=-i.scrollLeft+xi(e);const a=-i.scrollTop;return"rtl"===ci(l).direction&&(r+=ut(t.clientWidth,l.clientWidth)-o),{width:o,height:n,x:r,y:a}}(Nt(e));else if(qt(t))l=function(e,t){const i=bi(e,!0,"fixed"===t),l=i.top+e.clientTop,o=i.left+e.clientLeft,n=Kt(e)?mi(e):ft(1);return{width:e.clientWidth*n.x,height:e.clientHeight*n.y,x:o*n.x,y:l*n.y}}(t,i);else{const i=_i(e);l={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Lt(l)}function Mi(e,t){const i=hi(e);return!(i===t||!qt(i)||si(i))&&("fixed"===ci(i).position||Mi(i,t))}function Vi(e,t,i){const l=Kt(t),o=Nt(t),n="fixed"===i,r=bi(e,!0,n,t);let a={scrollLeft:0,scrollTop:0};const s=ft(0);function c(){s.x=xi(o)}if(l||!l&&!n)if(("body"!==Ut(t)||Xt(o))&&(a=di(t)),l){const e=bi(t,!0,n,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&c();n&&!l&&o&&c();const d=!o||l||n?ft(0):yi(o,a);return{x:r.left+a.scrollLeft-s.x-d.x,y:r.top+a.scrollTop-s.y-d.y,width:r.width,height:r.height}}function ki(e){return"static"===ci(e).position}function Hi(e,t){if(!Kt(e)||"fixed"===ci(e).position)return null;if(t)return t(e);let i=e.offsetParent;return Nt(e)===i&&(i=i.ownerDocument.body),i}function Pi(e,t){const i=Ft(e);if(ti(e))return i;if(!Kt(e)){let t=hi(e);for(;t&&!si(t);){if(qt(t)&&!ki(t))return t;t=hi(t)}return i}let l=Hi(e,t);for(;l&&Qt(l)&&ki(l);)l=Hi(l,t);return l&&si(l)&&ki(l)&&!ni(l)?i:l||function(e){let t=hi(e);for(;Kt(t)&&!si(t);){if(ni(t))return t;if(ti(t))return null;t=hi(t)}return null}(e)||i}const $i={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:i,offsetParent:l,strategy:o}=e;const n="fixed"===o,r=Nt(l),a=!!t&&ti(t.floating);if(l===r||a&&n)return i;let s={scrollLeft:0,scrollTop:0},c=ft(1);const d=ft(0),h=Kt(l);if((h||!h&&!n)&&(("body"!==Ut(l)||Xt(r))&&(s=di(l)),Kt(l))){const e=bi(l);c=mi(l),d.x=e.x+l.clientLeft,d.y=e.y+l.clientTop}const u=!r||h||n?ft(0):yi(r,s);return{width:i.width*c.x,height:i.height*c.y,x:i.x*c.x-s.scrollLeft*c.x+d.x+u.x,y:i.y*c.y-s.scrollTop*c.y+d.y+u.y}},getDocumentElement:Nt,getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:l,strategy:o}=e;const n=[..."clippingAncestors"===i?ti(t)?[]:function(e,t){const i=t.get(e);if(i)return i;let l=vi(e,[],!1).filter(e=>qt(e)&&"body"!==Ut(e)),o=null;const n="fixed"===ci(e).position;let r=n?hi(e):e;for(;qt(r)&&!si(r);){const t=ci(r),i=ni(r);i||"fixed"!==t.position||(o=null),(n?!i&&!o:!i&&"static"===t.position&&o&&Ci.has(o.position)||Xt(r)&&!i&&Mi(e,r))?l=l.filter(e=>e!==r):o=t,r=hi(r)}return t.set(e,l),l}(t,this._c):[].concat(i),l],r=n[0],a=n.reduce((e,i)=>{const l=Zi(t,i,o);return e.top=ut(l.top,e.top),e.right=ht(l.right,e.right),e.bottom=ht(l.bottom,e.bottom),e.left=ut(l.left,e.left),e},Zi(t,r,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Pi,getElementRects:async function(e){const t=this.getOffsetParent||Pi,i=this.getDimensions,l=await i(e.floating);return{reference:Vi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:i}=fi(e);return{width:t,height:i}},getScale:mi,isElement:qt,isRTL:function(e){return"rtl"===ci(e).direction}};function Oi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zi(e,t,i,l){void 0===l&&(l={});const{ancestorScroll:o=!0,ancestorResize:n=!0,elementResize:r="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:s=!1}=l,c=gi(e),d=o||n?[...c?vi(c):[],...vi(t)]:[];d.forEach(e=>{o&&e.addEventListener("scroll",i,{passive:!0}),n&&e.addEventListener("resize",i)});const h=c&&a?function(e,t){let i,l=null;const o=Nt(e);function n(){var e;clearTimeout(i),null==(e=l)||e.disconnect(),l=null}return function r(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),n();const c=e.getBoundingClientRect(),{left:d,top:h,width:u,height:v}=c;if(a||t(),!u||!v)return;const p={rootMargin:-pt(h)+"px "+-pt(o.clientWidth-(d+u))+"px "+-pt(o.clientHeight-(h+v))+"px "+-pt(d)+"px",threshold:ut(0,ht(1,s))||1};let f=!0;function g(t){const l=t[0].intersectionRatio;if(l!==s){if(!f)return r();l?r(!1,l):i=setTimeout(()=>{r(!1,1e-7)},1e3)}1!==l||Oi(c,e.getBoundingClientRect())||r(),f=!1}try{l=new IntersectionObserver(g,{...p,root:o.ownerDocument})}catch(e){l=new IntersectionObserver(g,p)}l.observe(e)}(!0),n}(c,i):null;let u,v=-1,p=null;r&&(p=new ResizeObserver(e=>{let[l]=e;l&&l.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),i()}),c&&!s&&p.observe(c),p.observe(t));let f=s?bi(e):null;return s&&function t(){const l=bi(e);f&&!Oi(f,l)&&i();f=l,u=requestAnimationFrame(t)}(),i(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",i),n&&e.removeEventListener("resize",i)}),null==h||h(),null==(e=p)||e.disconnect(),p=null,s&&cancelAnimationFrame(u)}}const Si=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var i,l;const{x:o,y:n,placement:r,middlewareData:a}=t,s=await async function(e,t){const{placement:i,platform:l,elements:o}=e,n=await(null==l.isRTL?void 0:l.isRTL(o.floating)),r=bt(i),a=xt(i),s="y"===Mt(i),c=Rt.has(r)?-1:1,d=n&&s?-1:1,h=_t(t,e);let{mainAxis:u,crossAxis:v,alignmentAxis:p}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&"number"==typeof p&&(v="end"===a?-1*p:p),s?{x:v*d,y:u*c}:{x:u*c,y:v*d}}(t,e);return r===(null==(i=a.offset)?void 0:i.placement)&&null!=(l=a.arrow)&&l.alignmentOffset?{}:{x:o+s.x,y:n+s.y,data:{...s,placement:r}}}}},Bi=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:l,placement:o}=t,{mainAxis:n=!0,crossAxis:r=!1,limiter:a={fn:e=>{let{x:t,y:i}=e;return{x:t,y:i}}},...s}=_t(e,t),c={x:i,y:l},d=await Et(t,s),h=Mt(bt(o)),u=yt(h);let v=c[u],p=c[h];if(n){const e="y"===u?"bottom":"right";v=wt(v+d["y"===u?"top":"left"],v,v-d[e])}if(r){const e="y"===h?"bottom":"right";p=wt(p+d["y"===h?"top":"left"],p,p-d[e])}const f=a.fn({...t,[u]:v,[h]:p});return{...f,data:{x:f.x-i,y:f.y-l,enabled:{[u]:n,[h]:r}}}}}},Ai=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var i,l;const{placement:o,middlewareData:n,rects:r,initialPlacement:a,platform:s,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:f=!0,...g}=_t(e,t);if(null!=(i=n.arrow)&&i.alignmentOffset)return{};const m=bt(o),w=Mt(a),_=bt(a)===a,b=await(null==s.isRTL?void 0:s.isRTL(c.floating)),x=u||(_||!f?[Bt(a)]:function(e){const t=Bt(e);return[Ht(e),t,Ht(t)]}(a)),y="none"!==p;!u&&y&&x.push(...St(a,f,p,b));const C=[a,...x],Z=await Et(t,g),M=[];let V=(null==(l=n.flip)?void 0:l.overflows)||[];if(d&&M.push(Z[m]),h){const e=kt(o,r,b);M.push(Z[e[0]],Z[e[1]])}if(V=[...V,{placement:o,overflows:M}],!M.every(e=>e<=0)){var k,H;const e=((null==(k=n.flip)?void 0:k.index)||0)+1,t=C[e];if(t){if(!("alignment"===h&&w!==Mt(t))||V.every(e=>Mt(e.placement)!==w||e.overflows[0]>0))return{data:{index:e,overflows:V},reset:{placement:t}}}let i=null==(H=V.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:H.placement;if(!i)switch(v){case"bestFit":{var P;const e=null==(P=V.filter(e=>{if(y){const t=Mt(e.placement);return t===w||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:P[0];e&&(i=e);break}case"initialPlacement":i=a}if(o!==i)return{reset:{placement:i}}}return{}}}},Li=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var i,l;const{placement:o,rects:n,platform:r,elements:a}=t,{apply:s=()=>{},...c}=_t(e,t),d=await Et(t,c),h=bt(o),u=xt(o),v="y"===Mt(o),{width:p,height:f}=n.floating;let g,m;"top"===h||"bottom"===h?(g=h,m=u===(await(null==r.isRTL?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(m=h,g="end"===u?"top":"bottom");const w=f-d.top-d.bottom,_=p-d.left-d.right,b=ht(f-d[g],w),x=ht(p-d[m],_),y=!t.middlewareData.shift;let C=b,Z=x;if(null!=(i=t.middlewareData.shift)&&i.enabled.x&&(Z=_),null!=(l=t.middlewareData.shift)&&l.enabled.y&&(C=w),y&&!u){const e=ut(d.left,0),t=ut(d.right,0),i=ut(d.top,0),l=ut(d.bottom,0);v?Z=p-2*(0!==e||0!==t?e+t:ut(d.left,d.right)):C=f-2*(0!==i||0!==l?i+l:ut(d.top,d.bottom))}await s({...t,availableWidth:Z,availableHeight:C});const M=await r.getDimensions(a.floating);return p!==M.width||f!==M.height?{reset:{rects:!0}}:{}}}},ji=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:i}=t,{strategy:l="referenceHidden",...o}=_t(e,t);switch(l){case"referenceHidden":{const e=It(await Et(t,{...o,elementContext:"reference"}),i.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Tt(e)}}}case"escaped":{const e=It(await Et(t,{...o,altBoundary:!0}),i.floating);return{data:{escapedOffsets:e,escaped:Tt(e)}}}default:return{}}}}},Ei=(e,t,i)=>{const l=new Map,o={platform:$i,...i},n={...o.platform,_c:l};return(async(e,t,i)=>{const{placement:l="bottom",strategy:o="absolute",middleware:n=[],platform:r}=i,a=n.filter(Boolean),s=await(null==r.isRTL?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=jt(c,l,s),u=l,v={},p=0;for(let i=0;i<a.length;i++){const{name:n,fn:f}=a[i],{x:g,y:m,data:w,reset:_}=await f({x:d,y:h,initialPlacement:l,placement:u,strategy:o,middlewareData:v,rects:c,platform:r,elements:{reference:e,floating:t}});d=null!=g?g:d,h=null!=m?m:h,v={...v,[n]:{...v[n],...w}},_&&p<=50&&(p++,"object"==typeof _&&(_.placement&&(u=_.placement),_.rects&&(c=!0===_.rects?await r.getElementRects({reference:e,floating:t,strategy:o}):_.rects),({x:d,y:h}=jt(c,u,s))),i=-1)}return{x:d,y:h,placement:u,strategy:o,middlewareData:v}})(e,t,{...o,platform:n})};var Ii=we`:host([menuisopen]:not([disabled]):not([readonly])) .dropdown-menu{display:block}.dropdown-menu{background-clip:padding-box;background-color:var(--sgds-surface-default);border-radius:var(--sgds-border-radius-md);box-shadow:0 0 1px 0 hsla(0,0%,5%,.12),0 4px 8px 0 hsla(0,0%,5%,.12);color:var(--sgds-color-default);display:none;list-style:none;margin:0;max-height:var(--sgds-dimension-480);min-width:var(--sgds-dimension-192);overflow-y:auto;padding:var(--sgds-padding-xs) 0;position:absolute;text-align:left;z-index:var(--sgds-z-index-floating)}.nav-tabs .dropdown-menu{border-top-left-radius:0;border-top-right-radius:0;margin-top:calc(var(--sgds-nav-tabs-border-width)*-1)}@media (min-width:512px){.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:768px){.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1024px){.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1280px){.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}}@media (min-width:1440px){.navbar-expand-xxl .navbar-nav .dropdown-menu{position:absolute}}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.sgds.navbar .dropdown-menu.megamenu{left:0;right:0;width:100%}.sgds.combobox>.dropdown-menu{min-width:100%}`,Ti=we`.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-14);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,Ri=we`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs)}.form-text.disabled{opacity:var(--sgds-opacity-40)}`,Di=we`.form-control-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.m-width-160{min-width:var(--sgds-dimension-160)}.m-width-256{min-width:var(--sgds-dimension-256)}.form-label{color:var(--sgds-form-color-default);font-size:var(--sgds-font-size-label-md);font-weight:var(--sgds-font-weight-semibold)}.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-xl);height:var(--sgds-dimension-48);justify-content:center;overflow:hidden;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-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-label-md);line-height:var(--sgds-line-height-xs);min-width:0;outline:none;padding:0;width:100%}.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-40)}.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 Ui=(e="value")=>(t,i)=>{const l=t.constructor,o=l.prototype.attributeChangedCallback;l.prototype.attributeChangedCallback=function(t,n,r){var a;const s=l.getPropertyOptions(e);if(t===("string"==typeof s.attribute?s.attribute:e).toLowerCase()){const t=s.converter||Se,l=("function"==typeof t?t:null!==(a=null==t?void 0:t.fromAttribute)&&void 0!==a?a:Se.fromAttribute)(r,s.type);this[e]!==l&&(this[i]=l)}o.call(this,t,n,r)}};function Fi(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}class Ni{constructor(e,t){(this.host=e).addController(this),this._internals=e._internals||this.host.attachInternals(),this.options=Object.assign({setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input},t)}hostConnected(){this.host.addEventListener("invalid",e=>this.handleInvalid(e))}hostDisconnected(){this.host.removeEventListener("invalid",e=>this.handleInvalid(e))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){const t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){const t=e.target;this.validateInput(t),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(e,t,i){return this._internals.setValidity(e,t,i)}setFormValue(){const e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const t=e.validity;if(t.valid)this._internals.setValidity({});else for(const i in t)t[i]&&(this.validationError=i.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const Wi=t=>{class i extends t{constructor(...e){super(...e),this._isTouched=!1,this._internals=this.attachInternals()}connectedCallback(){var e;super.connectedCallback(),null!==(e=this.inputValidationController)&&void 0!==e||(this.inputValidationController=new Ni(this))}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this._isTouched&&(this._isTouched=!1),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinValidate(e){this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinSetFormValue(){const e=this.value;this._internals.setFormValue(e)}_mixinCheckValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.checkValidity()}_mixinReportValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.reportValidity()}_mixinGetValidity(){return this._internals.validity}_mixinGetValidationMessage(){return this._internals.validationMessage}_mixinSetValidity(e,t,i){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(e,t,i)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return i.formAssociated=!0,e([Ge("sgds-input")],i.prototype,"sgdsInput",void 0),e([Ge("sgds-datepicker-input")],i.prototype,"sgdsDatepickerInput",void 0),i};var qi=we`:host{-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-font-smoothing:antialiased;color:var(--sgds-body-color-default,#1a1a1a);display:block;font-family:var(--sgds-font-family-brand,"Inter",system-ui,sans-serif);font-size:var(--sgds-font-size-body-md,1rem);font-weight:var(--sgds-font-weight-regular,400);line-height:var(--sgds-line-height-xs,24px);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:1em;-webkit-mask-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 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' viewBox='0 0 24 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:top;width:1em}::slotted(svg){vertical-align:middle}}`;class Ki extends Ie{emit(e,t){const i=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(i),i}static define(e,t=this,i={}){if(customElements.get(e));else try{customElements.define(e,t,i)}catch(l){customElements.define(e,class extends t{},i)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([e,t])=>{this.constructor.define(e,t)})}firstUpdated(e){var t;super.firstUpdated(e),this.ssr&&(null===(t=this.shadowRoot)||void 0===t||t.querySelectorAll("slot").forEach(e=>{e.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}Ki.styles=[qi],Ki.dependencies={},e([Ne({type:Boolean,reflect:!0})],Ki.prototype,"ssr",void 0);class Gi extends Ki{constructor(){super(...arguments),this.myDropdown=rt(),this.dropdownMenuId=Fi("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=rt(),this._handleClickOutOfElement=e=>{this.menuIsOpen&&(e.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(e){super.firstUpdated(e),this.menuIsOpen&&requestAnimationFrame(async()=>{await this.updateFloatingPosition(),this._startAutoUpdate()})}async showMenu(){this.disabled||this.menuIsOpen||(this.menuIsOpen=!0,this.emit("sgds-show"),await this.updateFloatingPosition(),this.emit("sgds-after-show"),this._startAutoUpdate())}_startAutoUpdate(){this.myDropdown.value&&this.menuRef.value&&(this._cleanupAutoUpdate=zi(this.myDropdown.value,this.menuRef.value,()=>this.updateFloatingPosition()))}hideMenu(e){this.menuIsOpen&&(this.emit("sgds-hide",{detail:{isOutside:e}}),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()}_handleKeyboardMenuEvent(e){if(!this.readonly)switch(e.key){case"ArrowDown":case"ArrowUp":e.preventDefault(),this.menuIsOpen||this.showMenu();break;case"Escape":this.hideMenu()}}mergeMiddleware(e,t){const i=e=>{var t;return(null==e?void 0:e.name)||(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)},l=t.map(i),o=e.map(e=>{const o=i(e),n=l.indexOf(o);return-1!==n?t[n]:e}).concat(t.filter(t=>!e.some(e=>i(e)===i(t))));return o}async updateFloatingPosition(){if(!this.myDropdown.value||!this.menuRef.value)return;let e="bottom-start";switch(this.drop){case"up":e=this.menuAlignRight?"top-end":"top-start";break;case"right":e="right-start";break;case"left":e="left-start";break;case"down":e=this.menuAlignRight?"bottom-end":"bottom-start";break;default:e="bottom-start"}const t=[Si(8),this.noFlip?void 0:Ai(),Bi()].filter(Boolean);let i=t;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(i=this.mergeMiddleware(t,this.floatingOpts.middleware.filter(Boolean)));const l=Object.assign(Object.assign({strategy:"fixed",placement:e},this.floatingOpts),{middleware:i}),{x:o,y:n,strategy:r,placement:a}=await Ei(this.myDropdown.value,this.menuRef.value,l);this.menuRef.value.setAttribute("data-placement",a),Object.assign(this.menuRef.value.style,{position:r,left:`${o}px`,top:`${n}px`})}}e([Ne({type:Boolean,state:!0})],Gi.prototype,"noFlip",void 0),e([Ne({type:Boolean,reflect:!0,state:!0})],Gi.prototype,"menuAlignRight",void 0),e([Ne({type:String,reflect:!0,state:!0})],Gi.prototype,"drop",void 0),e([Ne({type:Object})],Gi.prototype,"floatingOpts",void 0),e([Ne({type:Boolean,reflect:!0})],Gi.prototype,"menuIsOpen",void 0),e([Ne({type:Boolean,reflect:!0})],Gi.prototype,"disabled",void 0),e([Ne({type:Boolean,reflect:!0})],Gi.prototype,"readonly",void 0);class Ji extends Gi{constructor(){super(...arguments),this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1,this.hidden=!1}connectedCallback(){super.connectedCallback(),this.addEventListener("sgds-hide",this._resetMenu)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("sgds-hide",this._resetMenu)}firstUpdated(e){super.firstUpdated(e),this.addEventListener("keydown",this._handleKeyboardMenuItemsEvent)}handleSelectSlot(e){const t=this._getActiveMenuItems(),i=t.find(t=>e.composedPath().includes(t));if(!i)return;const l=t.indexOf(i);this.nextDropdownItemNo=l+1,this.prevDropdownItemNo=l<=0?t.length-1:l-1,i.disabled||(this.emit("sgds-select",{detail:{item:i}}),"outside"!==this.close&&this.hideMenu())}_resetMenu(){this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1;this._getMenuItems().forEach(e=>{var t;const i=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".dropdown-item");i&&i.removeAttribute("tabindex")})}_handleKeyboardMenuItemsEvent(e){if(this.readonly)return;const t=this._getActiveMenuItems();if(0!==t.length)switch(e.key){case"ArrowDown":e.preventDefault(),this._setMenuItem(this.nextDropdownItemNo);break;case"ArrowUp":e.preventDefault(),this._setMenuItem(this.prevDropdownItemNo);break;case"Tab":if(!this.menuIsOpen)return;e.preventDefault(),e.shiftKey?this._setMenuItem(this.prevDropdownItemNo):this._setMenuItem(this.nextDropdownItemNo);break;case"Enter":t.find(t=>e.composedPath().includes(t))&&this.handleSelectSlot(e);break}}_getMenuItems(){var e,t;if(this.shadowRoot.querySelector("slot#default")){return null===(e=this.shadowRoot.querySelector("slot#default"))||void 0===e?void 0:e.assignedElements({flatten:!0}).filter(e=>!e.classList.contains("empty-menu")&&!e.hasAttribute("hidden"))}if(null===(t=this.menu)||void 0===t?void 0:t.hasChildNodes()){return[...Array.from(this.menu.children)]}return[]}_getActiveMenuItems(){return this._getMenuItems().filter(e=>!e.disabled&&!e.hidden)}_setMenuItem(e){const t=this._getActiveMenuItems();if(0===t.length)return;const i=(e%t.length+t.length)%t.length,l=t[i];this.emit("i-sgds-option-focus",{detail:{option:l}}),this.nextDropdownItemNo=(i+1)%t.length,this.prevDropdownItemNo=(i-1+t.length)%t.length,t.forEach(e=>{const t=e.shadowRoot.querySelector(".dropdown-item");t.setAttribute("tabindex",e===l?"0":"-1"),e===l&&t.focus()})}}var Xi,Yi;Ji.styles=Gi.styles,e([(Xi="ul.dropdown-menu",(e,t,i)=>{const l=e=>{const i=e.renderRoot?.querySelector(Xi)??null;if(null===i&&Yi&&!e.hasUpdated){const e="object"==typeof t?t.name:t;Ke("",`@query'd field ${JSON.stringify(String(e))} with the 'cache' flag set for selector '${Xi}' has been accessed before the first update and returned null. This is expected if the renderRoot tree has not been provided beforehand (e.g. via Declarative Shadow DOM). Therefore the value hasn't been cached.`)}return i};if(Yi){const{get:o,set:n}="object"==typeof t?e:i??(()=>{const e=Symbol(`${String(t)} (@query() cache)`);return{get(){return this[e]},set(t){this[e]=t}}})();return qe(e,t,{get(){let e=o.call(this);return void 0===e&&(e=l(this),(null!==e||this.hasUpdated)&&n.call(this,e)),e}})}return qe(e,t,{get(){return l(this)}})})],Ji.prototype,"menu",void 0),e([We()],Ji.prototype,"nextDropdownItemNo",void 0),e([We()],Ji.prototype,"prevDropdownItemNo",void 0),e([Ne({type:Boolean,reflect:!0})],Ji.prototype,"hidden",void 0);var Qi=we`.empty-menu,.loading-menu{padding:var(--sgds-padding-sm) var(--sgds-padding-lg,20px);pointer-events:none}.loading-menu{align-items:center;display:flex;gap:var(--sgds-gap-xs)}`;class el extends(Wi(Ji)){setInvalid(e){this.invalid=e,e?this.emit("sgds-invalid"):this.emit("sgds-valid")}constructor(){super(),this.label="",this.hintText="",this.autofocus=!1,this.disabled=!1,this.required=!1,this.loading=!1,this.value="",this.displayValue="",this.defaultValue="",this.hasFeedback=!1,this.invalidFeedback="",this.invalid=!1,this.autocomplete="on",this.menuList=[],this.selectedItems=[],this.filteredList=[],this._isTouched=!1,this._controlId=Fi("input"),this._labelId=Fi("label"),this.floatingOpts={middleware:[Li({apply({rects:e,elements:t}){t.floating.style.width=`${e.reference.width}px`}})]}}connectedCallback(){super.connectedCallback(),this.addEventListener("blur",async e=>{var t;if(this._mixinShouldSkipSgdsValidation())return;const i=this.constructor.childName,l=(null===(t=e.relatedTarget)||void 0===t?void 0:t.tagName.toLowerCase())===i;this.invalid=!l&&!this._mixinReportValidity()})}reportValidity(){return this._mixinReportValidity()}setValidity(e,t,i){return this._mixinSetValidity(e,t,i)}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_renderFeedback(){return this.invalid&&this.hasFeedback?$` <div class="invalid-feedback-container">
82
82
  <slot name="invalidIcon">
83
83
  <sgds-icon name="exclamation-circle-fill" size="md"></sgds-icon>
84
84
  </slot>
@@ -245,7 +245,7 @@ class extends Ue{constructor(e){if(super(e),e.type!==Re&&e.type!==Te&&e.type!==Y
245
245
  >
246
246
  </sgds-icon-button>
247
247
  </div>
248
- `}}gl.styles=[fl],gl.dependencies={"sgds-icon":cl,"sgds-icon-button":pl,"sgds-button":el},e([Be({attribute:!1})],gl.prototype,"displayDate",void 0),e([Be({attribute:!1})],gl.prototype,"focusedDate",void 0),e([Be({attribute:!1})],gl.prototype,"selectedDate",void 0),e([Be()],gl.prototype,"view",void 0),e([Be()],gl.prototype,"focusedTabIndex",void 0),e([Ii("focusedTabIndex",{waitUntilFirstUpdate:!0})],gl.prototype,"_handleFocusedTabIndexChange",null);const ml=["January","February","March","April","May","June","July","August","September","October","November","December"];class wl{constructor(e,t){this.listeners=new Map,this.input=e,this.placeholderStr=this._buildPlaceholder(t.pattern),this._state=this.placeholderStr,this.listeners.set("accept",[]),this.listeners.set("complete",[]);const i={value:"",isComplete:!1};Object.defineProperties(i,{value:{get:()=>this._state,enumerable:!0},isComplete:{get:()=>this._state.length>0&&!/[DMY]/.test(this._state),enumerable:!0}}),this.masked=i,this.input.value&&this.input.value.length===this._state.length&&!/[DMY]/.test(this.input.value)?this._state=this.input.value:this.input.value=this._state,this._boundHandleBeforeInput=this._handleBeforeInput.bind(this),this._boundHandleInput=this._handleInput.bind(this),this._boundHandleKeydown=this._handleKeydown.bind(this),this._boundHandleFocus=this._handleFocus.bind(this),this._boundHandleBlur=this._handleBlur.bind(this),this._valueAtFocus=this._state,this.input.addEventListener("beforeinput",this._boundHandleBeforeInput),this.input.addEventListener("input",this._boundHandleInput),this.input.addEventListener("keydown",this._boundHandleKeydown),this.input.addEventListener("focus",this._boundHandleFocus),this.input.addEventListener("blur",this._boundHandleBlur)}get value(){return this._state}set value(e){this._state=e&&""!==e?e:this.placeholderStr,this.input.value=this._state,this._emit("accept")}on(e,t){var i;null===(i=this.listeners.get(e))||void 0===i||i.push(t)}updateValue(){this._state=this.input.value}destroy(){this.input.removeEventListener("beforeinput",this._boundHandleBeforeInput),this.input.removeEventListener("input",this._boundHandleInput),this.input.removeEventListener("keydown",this._boundHandleKeydown),this.input.removeEventListener("focus",this._boundHandleFocus),this.input.removeEventListener("blur",this._boundHandleBlur),this.listeners.clear()}_handleFocus(){this._valueAtFocus=this._state}_handleBlur(){this._state!==this._valueAtFocus&&this.input.dispatchEvent(new Event("change",{bubbles:!0}))}_buildPlaceholder(e){return e.replace(/`/g,"").replace(/\{(\/)\}/g,"$1").replace(/d/g,"D").replace(/m/g,"M").replace(/y/g,"Y")}_getDigitPositions(){const e=[];for(let t=0;t<this.placeholderStr.length;t++){const i=this.placeholderStr[t];"D"!==i&&"M"!==i&&"Y"!==i||e.push(t)}return e}_handleBeforeInput(e){e.preventDefault()}_handleInput(){this.input.value!==this._state&&(this.input.value=this._state)}_handleKeydown(e){"Backspace"===e.key?(e.preventDefault(),this._backspace()):"Delete"===e.key?(e.preventDefault(),this._deleteForward()):1===e.key.length&&/\d/.test(e.key)&&(e.preventDefault(),this._insertDigit(e.key))}_insertDigit(e){const t=this._getDigitPositions(),i=this._state.split("");let l=-1;for(const e of t)if(/[DMY]/.test(i[e])){l=e;break}if(-1===l)return;i[l]=e,this._state=i.join(""),this.input.value=this._state;const n=this._findNextInputPos(l);this.input.setSelectionRange(n,n),this._emit("accept"),this.masked.isComplete&&this._emit("complete")}_backspace(){var e;const t=null!==(e=this.input.selectionStart)&&void 0!==e?e:this._state.length,i=this._state.split("");let l=t-1;for(;l>=0&&!/\d/.test(i[l]);)l--;l>=0&&(i[l]=this.placeholderStr[l],this._state=i.join(""),this.input.value=this._state,this.input.setSelectionRange(l,l),this._emit("accept"))}_deleteForward(){var e;const t=null!==(e=this.input.selectionStart)&&void 0!==e?e:0,i=this._state.split("");let l=t;for(;l<i.length&&!/\d/.test(i[l]);)l++;l<i.length&&(i[l]=this.placeholderStr[l],this._state=i.join(""),this.input.value=this._state,this.input.setSelectionRange(t,t),this._emit("accept"))}_findNextInputPos(e){for(let t=e+1;t<this._state.length;t++)if(/[DMY]/.test(this._state[t]))return t;return this._state.length}_emit(e){const t=this.listeners.get(e);if(t)for(const e of t)e()}}var _l=f`.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-14);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,bl=f`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs)}.form-text.disabled{opacity:var(--sgds-opacity-40)}`,yl=f`.form-label{color:var(--sgds-form-color-default);font-weight:var(--sgds-font-weight-semibold);margin-bottom:0}.form-label.disabled{opacity:var(--sgds-opacity-40)}.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}`,xl=f`.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 Cl extends Di{constructor(){super(...arguments),this.label="",this.hintText="",this.disabled=!1,this.invalid=!1,this._controlId=Oi("input"),this._labelId=Oi("label")}setInvalid(e){this.invalid=e,e?this.emit("sgds-invalid"):this.emit("sgds-valid")}}Cl.styles=[...Di.styles,_l,bl,yl,xl],e([Be({reflect:!0})],Cl.prototype,"label",void 0),e([Be({reflect:!0})],Cl.prototype,"hintText",void 0),e([Be({reflect:!0})],Cl.prototype,"name",void 0),e([Be({type:Boolean,reflect:!0})],Cl.prototype,"disabled",void 0),e([Be({type:Boolean,reflect:!0})],Cl.prototype,"invalid",void 0);var Zl=f`.form-control-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.m-width-160{min-width:var(--sgds-dimension-160)}.m-width-256{min-width:var(--sgds-dimension-256)}.form-label{color:var(--sgds-form-color-default);font-size:var(--sgds-font-size-label-md);font-weight:var(--sgds-font-weight-semibold)}.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;overflow:hidden;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-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-label-md);line-height:var(--sgds-line-height-xs);min-width:0;outline:none;padding:0;width:100%}.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-40)}.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 Ml=(e="value")=>(t,i)=>{const l=t.constructor,n=l.prototype.attributeChangedCallback;l.prototype.attributeChangedCallback=function(t,r,a){var o;const s=l.getPropertyOptions(e);if(t===("string"==typeof s.attribute?s.attribute:e).toLowerCase()){const t=s.converter||H,l=("function"==typeof t?t:null!==(o=null==t?void 0:t.fromAttribute)&&void 0!==o?o:H.fromAttribute)(a,s.type);this[e]!==l&&(this[i]=l)}n.call(this,t,r,a)}};class Vl{constructor(e,t){(this.host=e).addController(this),this._internals=e._internals||this.host.attachInternals(),this.options=Object.assign({setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input},t)}hostConnected(){this.host.addEventListener("invalid",e=>this.handleInvalid(e))}hostDisconnected(){this.host.removeEventListener("invalid",e=>this.handleInvalid(e))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){const t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){const t=e.target;this.validateInput(t),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(e,t,i){return this._internals.setValidity(e,t,i)}setFormValue(){const e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const t=e.validity;if(t.valid)this._internals.setValidity({});else for(const i in t)t[i]&&(this.validationError=i.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const $l=t=>{class i extends t{constructor(...e){super(...e),this._isTouched=!1,this._internals=this.attachInternals()}connectedCallback(){var e;super.connectedCallback(),null!==(e=this.inputValidationController)&&void 0!==e||(this.inputValidationController=new Vl(this))}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this._isTouched&&(this._isTouched=!1),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinValidate(e){this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinSetFormValue(){const e=this.value;this._internals.setFormValue(e)}_mixinCheckValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.checkValidity()}_mixinReportValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.reportValidity()}_mixinGetValidity(){return this._internals.validity}_mixinGetValidationMessage(){return this._internals.validationMessage}_mixinSetValidity(e,t,i){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(e,t,i)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return i.formAssociated=!0,e([Ee("sgds-input")],i.prototype,"sgdsInput",void 0),e([Ee("sgds-datepicker-input")],i.prototype,"sgdsDatepickerInput",void 0),i};var kl=f`:host{--input-border-radius:var(--sgds-form-border-radius-md);--input-min-width:var(--sgds-dimension-160)}.form-control-container{min-width:var(--input-min-width)}: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-shrink:0;font-weight:var(--sgds-font-weight-semibold);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 Pl extends($l(Cl)){constructor(){super(...arguments),this.type="text",this.placeholder="placeholder",this.autofocus=!1,this.readonly=!1,this.autocomplete="on",this.defaultValue="",this.valid=!1,this.loading=!1,this.required=!1,this.noValidate=!1,this.value="",this._isTouched=!1,this._showPassword=!1}focus(e){this.input.focus(e)}blur(){this.input.blur()}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}setValidity(e,t,i){return this._mixinSetValidity(e,t,i)}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_handleFocus(){this.emit("sgds-focus")}_handleBlur(){const e=this.emit("sgds-blur",{cancelable:!0});this._mixinShouldSkipSgdsValidation()||e.defaultPrevented||(this.setInvalid(!this._mixinCheckValidity()),this._isTouched=!0)}_handleClick(){this.focus()}_handleChange(e){this.value=this.input.value;this.emit("sgds-change",{cancelable:!0}).defaultPrevented||super._mixinHandleChange(e)}_handleInputChange(e){this.value=this.input.value;this.emit("sgds-input",{cancelable:!0}).defaultPrevented||super._mixinHandleInputChange(e)}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&this.setInvalid(!this._mixinCheckValidity())}_handleDisabledChange(){this.setInvalid(!1)}_renderInput(){const e="both"===this.hasFeedback||"style"===this.hasFeedback,t="both"===this.hasFeedback||"text"===this.hasFeedback,i=[this.hintText?`${this._controlId}Help`:"",this.invalid&&t?`${this._controlId}-invalid`:""].filter(Boolean).join(" ")||void 0;return Ui`
248
+ `}}gl.styles=[fl],gl.dependencies={"sgds-icon":cl,"sgds-icon-button":pl,"sgds-button":el},e([Be({attribute:!1})],gl.prototype,"displayDate",void 0),e([Be({attribute:!1})],gl.prototype,"focusedDate",void 0),e([Be({attribute:!1})],gl.prototype,"selectedDate",void 0),e([Be()],gl.prototype,"view",void 0),e([Be()],gl.prototype,"focusedTabIndex",void 0),e([Ii("focusedTabIndex",{waitUntilFirstUpdate:!0})],gl.prototype,"_handleFocusedTabIndexChange",null);const ml=["January","February","March","April","May","June","July","August","September","October","November","December"];class wl{constructor(e,t){this.listeners=new Map,this.input=e,this.placeholderStr=this._buildPlaceholder(t.pattern),this._state=this.placeholderStr,this.listeners.set("accept",[]),this.listeners.set("complete",[]);const i={value:"",isComplete:!1};Object.defineProperties(i,{value:{get:()=>this._state,enumerable:!0},isComplete:{get:()=>this._state.length>0&&!/[DMY]/.test(this._state),enumerable:!0}}),this.masked=i,this.input.value&&this.input.value.length===this._state.length&&!/[DMY]/.test(this.input.value)?this._state=this.input.value:this.input.value=this._state,this._boundHandleBeforeInput=this._handleBeforeInput.bind(this),this._boundHandleInput=this._handleInput.bind(this),this._boundHandleKeydown=this._handleKeydown.bind(this),this._boundHandleFocus=this._handleFocus.bind(this),this._boundHandleBlur=this._handleBlur.bind(this),this._valueAtFocus=this._state,this.input.addEventListener("beforeinput",this._boundHandleBeforeInput),this.input.addEventListener("input",this._boundHandleInput),this.input.addEventListener("keydown",this._boundHandleKeydown),this.input.addEventListener("focus",this._boundHandleFocus),this.input.addEventListener("blur",this._boundHandleBlur)}get value(){return this._state}set value(e){this._state=e&&""!==e?e:this.placeholderStr,this.input.value=this._state,this._emit("accept")}on(e,t){var i;null===(i=this.listeners.get(e))||void 0===i||i.push(t)}updateValue(){this._state=this.input.value}destroy(){this.input.removeEventListener("beforeinput",this._boundHandleBeforeInput),this.input.removeEventListener("input",this._boundHandleInput),this.input.removeEventListener("keydown",this._boundHandleKeydown),this.input.removeEventListener("focus",this._boundHandleFocus),this.input.removeEventListener("blur",this._boundHandleBlur),this.listeners.clear()}_handleFocus(){this._valueAtFocus=this._state}_handleBlur(){this._state!==this._valueAtFocus&&this.input.dispatchEvent(new Event("change",{bubbles:!0}))}_buildPlaceholder(e){return e.replace(/`/g,"").replace(/\{(\/)\}/g,"$1").replace(/d/g,"D").replace(/m/g,"M").replace(/y/g,"Y")}_getDigitPositions(){const e=[];for(let t=0;t<this.placeholderStr.length;t++){const i=this.placeholderStr[t];"D"!==i&&"M"!==i&&"Y"!==i||e.push(t)}return e}_handleBeforeInput(e){e.preventDefault()}_handleInput(){this.input.value!==this._state&&(this.input.value=this._state)}_handleKeydown(e){"Backspace"===e.key?(e.preventDefault(),this._backspace()):"Delete"===e.key?(e.preventDefault(),this._deleteForward()):1===e.key.length&&/\d/.test(e.key)&&(e.preventDefault(),this._insertDigit(e.key))}_insertDigit(e){const t=this._getDigitPositions(),i=this._state.split("");let l=-1;for(const e of t)if(/[DMY]/.test(i[e])){l=e;break}if(-1===l)return;i[l]=e,this._state=i.join(""),this.input.value=this._state;const n=this._findNextInputPos(l);this.input.setSelectionRange(n,n),this._emit("accept"),this.masked.isComplete&&this._emit("complete")}_backspace(){var e;const t=null!==(e=this.input.selectionStart)&&void 0!==e?e:this._state.length,i=this._state.split("");let l=t-1;for(;l>=0&&!/\d/.test(i[l]);)l--;l>=0&&(i[l]=this.placeholderStr[l],this._state=i.join(""),this.input.value=this._state,this.input.setSelectionRange(l,l),this._emit("accept"))}_deleteForward(){var e;const t=null!==(e=this.input.selectionStart)&&void 0!==e?e:0,i=this._state.split("");let l=t;for(;l<i.length&&!/\d/.test(i[l]);)l++;l<i.length&&(i[l]=this.placeholderStr[l],this._state=i.join(""),this.input.value=this._state,this.input.setSelectionRange(t,t),this._emit("accept"))}_findNextInputPos(e){for(let t=e+1;t<this._state.length;t++)if(/[DMY]/.test(this._state[t]))return t;return this._state.length}_emit(e){const t=this.listeners.get(e);if(t)for(const e of t)e()}}var _l=f`.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-14);font-weight:var(--sgds-font-weight-regular)}.valid-icon{color:var(--sgds-form-success-color-default)}`,bl=f`.form-text{color:var(--sgds-form-color-subtle);font-size:var(--sgds-font-size-label-sm);line-height:var(--sgds-line-height-2-xs)}.form-text.disabled{opacity:var(--sgds-opacity-40)}`,yl=f`.form-label{color:var(--sgds-form-color-default);font-weight:var(--sgds-font-weight-semibold);margin-bottom:0}.form-label.disabled{opacity:var(--sgds-opacity-40)}.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}`,xl=f`.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 Cl extends Di{constructor(){super(...arguments),this.label="",this.hintText="",this.disabled=!1,this.invalid=!1,this._controlId=Oi("input"),this._labelId=Oi("label")}setInvalid(e){this.invalid=e,e?this.emit("sgds-invalid"):this.emit("sgds-valid")}}Cl.styles=[...Di.styles,_l,bl,yl,xl],e([Be({reflect:!0})],Cl.prototype,"label",void 0),e([Be({reflect:!0})],Cl.prototype,"hintText",void 0),e([Be({reflect:!0})],Cl.prototype,"name",void 0),e([Be({type:Boolean,reflect:!0})],Cl.prototype,"disabled",void 0),e([Be({type:Boolean,reflect:!0})],Cl.prototype,"invalid",void 0);var Zl=f`.form-control-container{display:flex;flex-direction:column;gap:var(--sgds-form-gap-md)}.m-width-160{min-width:var(--sgds-dimension-160)}.m-width-256{min-width:var(--sgds-dimension-256)}.form-label{color:var(--sgds-form-color-default);font-size:var(--sgds-font-size-label-md);font-weight:var(--sgds-font-weight-semibold)}.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-xl);height:var(--sgds-dimension-48);justify-content:center;overflow:hidden;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-family:var(--sgds-font-family-brand);font-size:var(--sgds-font-size-label-md);line-height:var(--sgds-line-height-xs);min-width:0;outline:none;padding:0;width:100%}.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-40)}.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 Ml=(e="value")=>(t,i)=>{const l=t.constructor,n=l.prototype.attributeChangedCallback;l.prototype.attributeChangedCallback=function(t,r,a){var o;const s=l.getPropertyOptions(e);if(t===("string"==typeof s.attribute?s.attribute:e).toLowerCase()){const t=s.converter||H,l=("function"==typeof t?t:null!==(o=null==t?void 0:t.fromAttribute)&&void 0!==o?o:H.fromAttribute)(a,s.type);this[e]!==l&&(this[i]=l)}n.call(this,t,r,a)}};class Vl{constructor(e,t){(this.host=e).addController(this),this._internals=e._internals||this.host.attachInternals(),this.options=Object.assign({setInvalid:(e,t)=>{e.invalid=t},value:e=>e.value,input:e=>e.input},t)}hostConnected(){this.host.addEventListener("invalid",e=>this.handleInvalid(e))}hostDisconnected(){this.host.removeEventListener("invalid",e=>this.handleInvalid(e))}handleInvalid(e){e.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(e){const t=e.target;this.options.setInvalid(this.host,!1),this.validateInput(t)}handleChange(e){const t=e.target;this.validateInput(t),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(e,t,i){return this._internals.setValidity(e,t,i)}setFormValue(){const e=this.options.value(this.host);this._internals.setFormValue(e)}validateInput(e){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const t=e.validity;if(t.valid)this._internals.setValidity({});else for(const i in t)t[i]&&(this.validationError=i.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const $l=t=>{class i extends t{constructor(...e){super(...e),this._isTouched=!1,this._internals=this.attachInternals()}connectedCallback(){var e;super.connectedCallback(),null!==(e=this.inputValidationController)&&void 0!==e||(this.inputValidationController=new Vl(this))}async firstUpdated(e){super.firstUpdated(e),this.input=this.shadowRoot.querySelector("input")||await this.sgdsInput||this.shadowRoot.querySelector("textarea")||await this.sgdsDatepickerInput,this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this._mixinValidate(this.input)}formResetCallback(){this._mixinResetFormControl?this._mixinResetFormControl():(this.value=this.defaultValue,this._mixinResetValidity(this.input)),this._mixinSetFormValue()}_mixinHandleChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleChange(e)}_mixinHandleInputChange(e){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleInput(e)}_mixinResetValidity(e){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this._isTouched&&(this._isTouched=!1),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinValidate(e){this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(e)}_mixinSetFormValue(){const e=this.value;this._internals.setFormValue(e)}_mixinCheckValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.checkValidity()}_mixinReportValidity(){return!!this._mixinShouldSkipSgdsValidation()||this.inputValidationController.reportValidity()}_mixinGetValidity(){return this._internals.validity}_mixinGetValidationMessage(){return this._internals.validationMessage}_mixinSetValidity(e,t,i){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(e,t,i)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return i.formAssociated=!0,e([Ee("sgds-input")],i.prototype,"sgdsInput",void 0),e([Ee("sgds-datepicker-input")],i.prototype,"sgdsDatepickerInput",void 0),i};var kl=f`:host{--input-border-radius:var(--sgds-form-border-radius-md);--input-min-width:var(--sgds-dimension-160)}.form-control-container{min-width:var(--input-min-width)}: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{align-items:center;color:var(--sgds-form-color-subtle);display:flex;flex-shrink:0;font-weight:var(--sgds-font-weight-semibold);gap:var(--sgds-gap-xs);height:100%;justify-content:center}.form-control-prefix{border-right:var(--sgds-form-border-width-default) solid var(--sgds-border-color-muted);padding-right:var(--sgds-form-padding-x)}.form-control-suffix{border-left:var(--sgds-form-border-width-default) solid var(--sgds-border-color-muted);padding-left:var(--sgds-form-padding-x)}.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 Pl extends($l(Cl)){constructor(){super(...arguments),this.type="text",this.placeholder="placeholder",this.autofocus=!1,this.readonly=!1,this.autocomplete="on",this.defaultValue="",this.valid=!1,this.loading=!1,this.required=!1,this.noValidate=!1,this.value="",this._isTouched=!1,this._showPassword=!1}focus(e){this.input.focus(e)}blur(){this.input.blur()}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}setValidity(e,t,i){return this._mixinSetValidity(e,t,i)}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_handleFocus(){this.emit("sgds-focus")}_handleBlur(){const e=this.emit("sgds-blur",{cancelable:!0});this._mixinShouldSkipSgdsValidation()||e.defaultPrevented||(this.setInvalid(!this._mixinCheckValidity()),this._isTouched=!0)}_handleClick(){this.focus()}_handleChange(e){this.value=this.input.value;this.emit("sgds-change",{cancelable:!0}).defaultPrevented||super._mixinHandleChange(e)}_handleInputChange(e){this.value=this.input.value;this.emit("sgds-input",{cancelable:!0}).defaultPrevented||super._mixinHandleInputChange(e)}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&this.setInvalid(!this._mixinCheckValidity())}_handleDisabledChange(){this.setInvalid(!1)}_renderInput(){const e="both"===this.hasFeedback||"style"===this.hasFeedback,t="both"===this.hasFeedback||"text"===this.hasFeedback,i=[this.hintText?`${this._controlId}Help`:"",this.invalid&&t?`${this._controlId}-invalid`:""].filter(Boolean).join(" ")||void 0;return Ui`
249
249
  <div
250
250
  class="form-control-group ${Ei({disabled:this.disabled,readonly:this.readonly,"is-invalid":this.invalid&&e})}"
251
251
  @click=${this._handleClick}