@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.
- package/components/ComboBox/index.umd.min.js +1 -1
- package/components/Datepicker/index.umd.min.js +1 -1
- package/components/Datepicker/index.umd.min.js.map +1 -1
- package/components/Input/index.umd.min.js +2 -2
- package/components/Input/index.umd.min.js.map +1 -1
- package/components/Input/input.js +1 -1
- package/components/QuantityToggle/index.umd.min.js +1 -1
- package/components/QuantityToggle/index.umd.min.js.map +1 -1
- package/components/Select/index.umd.min.js +1 -1
- package/components/Textarea/index.umd.min.js +1 -1
- package/components/index.umd.min.js +2 -2
- package/components/index.umd.min.js.map +1 -1
- package/css/fouc.css +1 -1
- package/custom-elements.json +893 -893
- package/index.umd.min.js +2 -2
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/react/components/Input/input.cjs.js +1 -1
- package/react/components/Input/input.js +1 -1
- package/react/index.cjs.js +4 -4
- package/react/index.d.ts +1 -1
- package/react/index.js +1 -1
- package/react/styles/form-text-control.cjs.js +1 -1
- package/react/styles/form-text-control.js +1 -1
- package/styles/form-text-control.js +1 -1
- package/types/react.d.ts +23 -23
|
@@ -80,7 +80,7 @@ window.ShadyDOM?.inUse&&!0===window.ShadyDOM?.noPatch&&window.ShadyDOM.wrap;cons
|
|
|
80
80
|
* @license
|
|
81
81
|
* Copyright 2020 Google LLC
|
|
82
82
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
83
|
-
*/const Fe=()=>new We;class We{}const qe=new WeakMap;const Ke=je(class extends Ue{render(e){return oe}update(e,[t]){const l=t!==this._ref;return l&&void 0!==this._ref&&this._updateRefValue(void 0),(l||this._lastElementForRef!==this._element)&&(this._ref=t,this._context=e.options?.host,this._updateRefValue(this._element=e.element)),oe}_updateRefValue(e){if(this.isConnected||(e=void 0),"function"==typeof this._ref){const t=this._context??globalThis;let l=qe.get(t);void 0===l&&(l=new WeakMap,qe.set(t,l)),void 0!==l.get(this._ref)&&this._ref.call(this._context,void 0),l.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?qe.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),Je=Math.min,Ge=Math.max,Ye=Math.round,Xe=Math.floor,Qe=e=>({x:e,y:e}),et={left:"right",right:"left",bottom:"top",top:"bottom"},tt={start:"end",end:"start"};function lt(e,t,l){return Ge(e,Je(t,l))}function ot(e,t){return"function"==typeof e?e(t):e}function nt(e){return e.split("-")[0]}function it(e){return e.split("-")[1]}function rt(e){return"x"===e?"y":"x"}function at(e){return"y"===e?"height":"width"}const st=new Set(["top","bottom"]);function ct(e){return st.has(nt(e))?"y":"x"}function dt(e){return rt(ct(e))}function ht(e,t,l){void 0===l&&(l=!1);const o=it(e),n=dt(e),i=at(n);let r="x"===n?o===(l?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(r=wt(r)),[r,wt(r)]}function ut(e){return e.replace(/start|end/g,e=>tt[e])}const vt=["left","right"],ft=["right","left"],pt=["top","bottom"],gt=["bottom","top"];function mt(e,t,l,o){const n=it(e);let i=function(e,t,l){switch(e){case"top":case"bottom":return l?t?ft:vt:t?vt:ft;case"left":case"right":return t?pt:gt;default:return[]}}(nt(e),"start"===l,o);return n&&(i=i.map(e=>e+"-"+n),t&&(i=i.concat(i.map(ut)))),i}function wt(e){return e.replace(/left|right|bottom|top/g,e=>et[e])}function _t(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 bt(e){const{x:t,y:l,width:o,height:n}=e;return{width:o,height:n,top:l,left:t,right:t+o,bottom:l+n,x:t,y:l}}function xt(e,t,l){let{reference:o,floating:n}=e;const i=ct(t),r=dt(t),a=at(r),s=nt(t),c="y"===i,d=o.x+o.width/2-n.width/2,h=o.y+o.height/2-n.height/2,u=o[a]/2-n[a]/2;let v;switch(s){case"top":v={x:d,y:o.y-n.height};break;case"bottom":v={x:d,y:o.y+o.height};break;case"right":v={x:o.x+o.width,y:h};break;case"left":v={x:o.x-n.width,y:h};break;default:v={x:o.x,y:o.y}}switch(it(t)){case"start":v[r]-=u*(l&&c?-1:1);break;case"end":v[r]+=u*(l&&c?-1:1)}return v}async function Zt(e,t){var l;void 0===t&&(t={});const{x:o,y:n,platform:i,rects:r,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:u=!1,padding:v=0}=ot(t,e),f=_t(v),p=a[u?"floating"===h?"reference":"floating":h],g=bt(await i.getClippingRect({element:null==(l=await(null==i.isElement?void 0:i.isElement(p)))||l?p:p.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:s})),m="floating"===h?{x:o,y:n,width:r.floating.width,height:r.floating.height}:r.reference,w=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),_=await(null==i.isElement?void 0:i.isElement(w))&&await(null==i.getScale?void 0:i.getScale(w))||{x:1,y:1},b=bt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:w,strategy:s}):m);return{top:(g.top-b.top+f.top)/_.y,bottom:(b.bottom-g.bottom+f.bottom)/_.y,left:(g.left-b.left+f.left)/_.x,right:(b.right-g.right+f.right)/_.x}}const Ct=new Set(["left","top"]);function yt(){return"undefined"!=typeof window}function Mt(e){return Pt(e)?(e.nodeName||"").toLowerCase():"#document"}function Vt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Ht(e){var t;return null==(t=(Pt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Pt(e){return!!yt()&&(e instanceof Node||e instanceof Vt(e).Node)}function Ot(e){return!!yt()&&(e instanceof Element||e instanceof Vt(e).Element)}function zt(e){return!!yt()&&(e instanceof HTMLElement||e instanceof Vt(e).HTMLElement)}function $t(e){return!(!yt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Vt(e).ShadowRoot)}const St=new Set(["inline","contents"]);function Bt(e){const{overflow:t,overflowX:l,overflowY:o,display:n}=Ft(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+l)&&!St.has(n)}const jt=new Set(["table","td","th"]);function At(e){return jt.has(Mt(e))}const kt=[":popover-open",":modal"];function Lt(e){return kt.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Et=["transform","translate","scale","rotate","perspective"],It=["transform","translate","scale","rotate","perspective","filter"],Tt=["paint","layout","strict","content"];function Rt(e){const t=Dt(),l=Ot(e)?Ft(e):e;return Et.some(e=>!!l[e]&&"none"!==l[e])||!!l.containerType&&"normal"!==l.containerType||!t&&!!l.backdropFilter&&"none"!==l.backdropFilter||!t&&!!l.filter&&"none"!==l.filter||It.some(e=>(l.willChange||"").includes(e))||Tt.some(e=>(l.contain||"").includes(e))}function Dt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Nt=new Set(["html","body","#document"]);function Ut(e){return Nt.has(Mt(e))}function Ft(e){return Vt(e).getComputedStyle(e)}function Wt(e){return Ot(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qt(e){if("html"===Mt(e))return e;const t=e.assignedSlot||e.parentNode||$t(e)&&e.host||Ht(e);return $t(t)?t.host:t}function Kt(e){const t=qt(e);return Ut(t)?e.ownerDocument?e.ownerDocument.body:e.body:zt(t)&&Bt(t)?t:Kt(t)}function Jt(e,t,l){var o;void 0===t&&(t=[]),void 0===l&&(l=!0);const n=Kt(e),i=n===(null==(o=e.ownerDocument)?void 0:o.body),r=Vt(n);if(i){const e=Gt(r);return t.concat(r,r.visualViewport||[],Bt(n)?n:[],e&&l?Jt(e):[])}return t.concat(n,Jt(n,[],l))}function Gt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Yt(e){const t=Ft(e);let l=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const n=zt(e),i=n?e.offsetWidth:l,r=n?e.offsetHeight:o,a=Ye(l)!==i||Ye(o)!==r;return a&&(l=i,o=r),{width:l,height:o,$:a}}function Xt(e){return Ot(e)?e:e.contextElement}function Qt(e){const t=Xt(e);if(!zt(t))return Qe(1);const l=t.getBoundingClientRect(),{width:o,height:n,$:i}=Yt(t);let r=(i?Ye(l.width):l.width)/o,a=(i?Ye(l.height):l.height)/n;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}const el=Qe(0);function tl(e){const t=Vt(e);return Dt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:el}function ll(e,t,l,o){void 0===t&&(t=!1),void 0===l&&(l=!1);const n=e.getBoundingClientRect(),i=Xt(e);let r=Qe(1);t&&(o?Ot(o)&&(r=Qt(o)):r=Qt(e));const a=function(e,t,l){return void 0===t&&(t=!1),!(!l||t&&l!==Vt(e))&&t}(i,l,o)?tl(i):Qe(0);let s=(n.left+a.x)/r.x,c=(n.top+a.y)/r.y,d=n.width/r.x,h=n.height/r.y;if(i){const e=Vt(i),t=o&&Ot(o)?Vt(o):o;let l=e,n=Gt(l);for(;n&&o&&t!==l;){const e=Qt(n),t=n.getBoundingClientRect(),o=Ft(n),i=t.left+(n.clientLeft+parseFloat(o.paddingLeft))*e.x,r=t.top+(n.clientTop+parseFloat(o.paddingTop))*e.y;s*=e.x,c*=e.y,d*=e.x,h*=e.y,s+=i,c+=r,l=Vt(n),n=Gt(l)}}return bt({width:d,height:h,x:s,y:c})}function ol(e,t){const l=Wt(e).scrollLeft;return t?t.left+l:ll(Ht(e)).left+l}function nl(e,t){const l=e.getBoundingClientRect();return{x:l.left+t.scrollLeft-ol(e,l),y:l.top+t.scrollTop}}const il=new Set(["absolute","fixed"]);function rl(e,t,l){let o;if("viewport"===t)o=function(e,t){const l=Vt(e),o=Ht(e),n=l.visualViewport;let i=o.clientWidth,r=o.clientHeight,a=0,s=0;if(n){i=n.width,r=n.height;const e=Dt();(!e||e&&"fixed"===t)&&(a=n.offsetLeft,s=n.offsetTop)}const c=ol(o);if(c<=0){const e=o.ownerDocument,t=e.body,l=getComputedStyle(t),n="CSS1Compat"===e.compatMode&&parseFloat(l.marginLeft)+parseFloat(l.marginRight)||0,r=Math.abs(o.clientWidth-t.clientWidth-n);r<=25&&(i-=r)}else c<=25&&(i+=c);return{width:i,height:r,x:a,y:s}}(e,l);else if("document"===t)o=function(e){const t=Ht(e),l=Wt(e),o=e.ownerDocument.body,n=Ge(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=Ge(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-l.scrollLeft+ol(e);const a=-l.scrollTop;return"rtl"===Ft(o).direction&&(r+=Ge(t.clientWidth,o.clientWidth)-n),{width:n,height:i,x:r,y:a}}(Ht(e));else if(Ot(t))o=function(e,t){const l=ll(e,!0,"fixed"===t),o=l.top+e.clientTop,n=l.left+e.clientLeft,i=zt(e)?Qt(e):Qe(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:n*i.x,y:o*i.y}}(t,l);else{const l=tl(e);o={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return bt(o)}function al(e,t){const l=qt(e);return!(l===t||!Ot(l)||Ut(l))&&("fixed"===Ft(l).position||al(l,t))}function sl(e,t,l){const o=zt(t),n=Ht(t),i="fixed"===l,r=ll(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const s=Qe(0);function c(){s.x=ol(n)}if(o||!o&&!i)if(("body"!==Mt(t)||Bt(n))&&(a=Wt(t)),o){const e=ll(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else n&&c();i&&!o&&n&&c();const d=!n||o||i?Qe(0):nl(n,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 cl(e){return"static"===Ft(e).position}function dl(e,t){if(!zt(e)||"fixed"===Ft(e).position)return null;if(t)return t(e);let l=e.offsetParent;return Ht(e)===l&&(l=l.ownerDocument.body),l}function hl(e,t){const l=Vt(e);if(Lt(e))return l;if(!zt(e)){let t=qt(e);for(;t&&!Ut(t);){if(Ot(t)&&!cl(t))return t;t=qt(t)}return l}let o=dl(e,t);for(;o&&At(o)&&cl(o);)o=dl(o,t);return o&&Ut(o)&&cl(o)&&!Rt(o)?l:o||function(e){let t=qt(e);for(;zt(t)&&!Ut(t);){if(Rt(t))return t;if(Lt(t))return null;t=qt(t)}return null}(e)||l}const ul={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:l,offsetParent:o,strategy:n}=e;const i="fixed"===n,r=Ht(o),a=!!t&&Lt(t.floating);if(o===r||a&&i)return l;let s={scrollLeft:0,scrollTop:0},c=Qe(1);const d=Qe(0),h=zt(o);if((h||!h&&!i)&&(("body"!==Mt(o)||Bt(r))&&(s=Wt(o)),zt(o))){const e=ll(o);c=Qt(o),d.x=e.x+o.clientLeft,d.y=e.y+o.clientTop}const u=!r||h||i?Qe(0):nl(r,s);return{width:l.width*c.x,height:l.height*c.y,x:l.x*c.x-s.scrollLeft*c.x+d.x+u.x,y:l.y*c.y-s.scrollTop*c.y+d.y+u.y}},getDocumentElement:Ht,getClippingRect:function(e){let{element:t,boundary:l,rootBoundary:o,strategy:n}=e;const i=[..."clippingAncestors"===l?Lt(t)?[]:function(e,t){const l=t.get(e);if(l)return l;let o=Jt(e,[],!1).filter(e=>Ot(e)&&"body"!==Mt(e)),n=null;const i="fixed"===Ft(e).position;let r=i?qt(e):e;for(;Ot(r)&&!Ut(r);){const t=Ft(r),l=Rt(r);l||"fixed"!==t.position||(n=null),(i?!l&&!n:!l&&"static"===t.position&&n&&il.has(n.position)||Bt(r)&&!l&&al(e,r))?o=o.filter(e=>e!==r):n=t,r=qt(r)}return t.set(e,o),o}(t,this._c):[].concat(l),o],r=i[0],a=i.reduce((e,l)=>{const o=rl(t,l,n);return e.top=Ge(o.top,e.top),e.right=Je(o.right,e.right),e.bottom=Je(o.bottom,e.bottom),e.left=Ge(o.left,e.left),e},rl(t,r,n));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:hl,getElementRects:async function(e){const t=this.getOffsetParent||hl,l=this.getDimensions,o=await l(e.floating);return{reference:sl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:l}=Yt(e);return{width:t,height:l}},getScale:Qt,isElement:Ot,isRTL:function(e){return"rtl"===Ft(e).direction}};function vl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fl(e,t,l,o){void 0===o&&(o={});const{ancestorScroll:n=!0,ancestorResize:i=!0,elementResize:r="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:s=!1}=o,c=Xt(e),d=n||i?[...c?Jt(c):[],...Jt(t)]:[];d.forEach(e=>{n&&e.addEventListener("scroll",l,{passive:!0}),i&&e.addEventListener("resize",l)});const h=c&&a?function(e,t){let l,o=null;const n=Ht(e);function i(){var e;clearTimeout(l),null==(e=o)||e.disconnect(),o=null}return function r(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),i();const c=e.getBoundingClientRect(),{left:d,top:h,width:u,height:v}=c;if(a||t(),!u||!v)return;const f={rootMargin:-Xe(h)+"px "+-Xe(n.clientWidth-(d+u))+"px "+-Xe(n.clientHeight-(h+v))+"px "+-Xe(d)+"px",threshold:Ge(0,Je(1,s))||1};let p=!0;function g(t){const o=t[0].intersectionRatio;if(o!==s){if(!p)return r();o?r(!1,o):l=setTimeout(()=>{r(!1,1e-7)},1e3)}1!==o||vl(c,e.getBoundingClientRect())||r(),p=!1}try{o=new IntersectionObserver(g,{...f,root:n.ownerDocument})}catch(e){o=new IntersectionObserver(g,f)}o.observe(e)}(!0),i}(c,l):null;let u,v=-1,f=null;r&&(f=new ResizeObserver(e=>{let[o]=e;o&&o.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),l()}),c&&!s&&f.observe(c),f.observe(t));let p=s?ll(e):null;return s&&function t(){const o=ll(e);p&&!vl(p,o)&&l();p=o,u=requestAnimationFrame(t)}(),l(),()=>{var e;d.forEach(e=>{n&&e.removeEventListener("scroll",l),i&&e.removeEventListener("resize",l)}),null==h||h(),null==(e=f)||e.disconnect(),f=null,s&&cancelAnimationFrame(u)}}const pl=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var l,o;const{x:n,y:i,placement:r,middlewareData:a}=t,s=await async function(e,t){const{placement:l,platform:o,elements:n}=e,i=await(null==o.isRTL?void 0:o.isRTL(n.floating)),r=nt(l),a=it(l),s="y"===ct(l),c=Ct.has(r)?-1:1,d=i&&s?-1:1,h=ot(t,e);let{mainAxis:u,crossAxis:v,alignmentAxis:f}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&"number"==typeof f&&(v="end"===a?-1*f:f),s?{x:v*d,y:u*c}:{x:u*c,y:v*d}}(t,e);return r===(null==(l=a.offset)?void 0:l.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:n+s.x,y:i+s.y,data:{...s,placement:r}}}}},gl=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:l,y:o,placement:n}=t,{mainAxis:i=!0,crossAxis:r=!1,limiter:a={fn:e=>{let{x:t,y:l}=e;return{x:t,y:l}}},...s}=ot(e,t),c={x:l,y:o},d=await Zt(t,s),h=ct(nt(n)),u=rt(h);let v=c[u],f=c[h];if(i){const e="y"===u?"bottom":"right";v=lt(v+d["y"===u?"top":"left"],v,v-d[e])}if(r){const e="y"===h?"bottom":"right";f=lt(f+d["y"===h?"top":"left"],f,f-d[e])}const p=a.fn({...t,[u]:v,[h]:f});return{...p,data:{x:p.x-l,y:p.y-o,enabled:{[u]:i,[h]:r}}}}}},ml=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var l,o;const{placement:n,middlewareData:i,rects:r,initialPlacement:a,platform:s,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...g}=ot(e,t);if(null!=(l=i.arrow)&&l.alignmentOffset)return{};const m=nt(n),w=ct(a),_=nt(a)===a,b=await(null==s.isRTL?void 0:s.isRTL(c.floating)),x=u||(_||!p?[wt(a)]:function(e){const t=wt(e);return[ut(e),t,ut(t)]}(a)),Z="none"!==f;!u&&Z&&x.push(...mt(a,p,f,b));const C=[a,...x],y=await Zt(t,g),M=[];let V=(null==(o=i.flip)?void 0:o.overflows)||[];if(d&&M.push(y[m]),h){const e=ht(n,r,b);M.push(y[e[0]],y[e[1]])}if(V=[...V,{placement:n,overflows:M}],!M.every(e=>e<=0)){var H,P;const e=((null==(H=i.flip)?void 0:H.index)||0)+1,t=C[e];if(t){if(!("alignment"===h&&w!==ct(t))||V.every(e=>ct(e.placement)!==w||e.overflows[0]>0))return{data:{index:e,overflows:V},reset:{placement:t}}}let l=null==(P=V.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:P.placement;if(!l)switch(v){case"bestFit":{var O;const e=null==(O=V.filter(e=>{if(Z){const t=ct(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:O[0];e&&(l=e);break}case"initialPlacement":l=a}if(n!==l)return{reset:{placement:l}}}return{}}}},wl=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var l,o;const{placement:n,rects:i,platform:r,elements:a}=t,{apply:s=()=>{},...c}=ot(e,t),d=await Zt(t,c),h=nt(n),u=it(n),v="y"===ct(n),{width:f,height:p}=i.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=p-d.top-d.bottom,_=f-d.left-d.right,b=Je(p-d[g],w),x=Je(f-d[m],_),Z=!t.middlewareData.shift;let C=b,y=x;if(null!=(l=t.middlewareData.shift)&&l.enabled.x&&(y=_),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(C=w),Z&&!u){const e=Ge(d.left,0),t=Ge(d.right,0),l=Ge(d.top,0),o=Ge(d.bottom,0);v?y=f-2*(0!==e||0!==t?e+t:Ge(d.left,d.right)):C=p-2*(0!==l||0!==o?l+o:Ge(d.top,d.bottom))}await s({...t,availableWidth:y,availableHeight:C});const M=await r.getDimensions(a.floating);return f!==M.width||p!==M.height?{reset:{rects:!0}}:{}}}},_l=(e,t,l)=>{const o=new Map,n={platform:ul,...l},i={...n.platform,_c:o};return(async(e,t,l)=>{const{placement:o="bottom",strategy:n="absolute",middleware:i=[],platform:r}=l,a=i.filter(Boolean),s=await(null==r.isRTL?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:n}),{x:d,y:h}=xt(c,o,s),u=o,v={},f=0;for(let l=0;l<a.length;l++){const{name:i,fn:p}=a[l],{x:g,y:m,data:w,reset:_}=await p({x:d,y:h,initialPlacement:o,placement:u,strategy:n,middlewareData:v,rects:c,platform:r,elements:{reference:e,floating:t}});d=null!=g?g:d,h=null!=m?m:h,v={...v,[i]:{...v[i],...w}},_&&f<=50&&(f++,"object"==typeof _&&(_.placement&&(u=_.placement),_.rects&&(c=!0===_.rects?await r.getElementRects({reference:e,floating:t,strategy:n}):_.rects),({x:d,y:h}=xt(c,u,s))),l=-1)}return{x:d,y:h,placement:u,strategy:n,middlewareData:v}})(e,t,{...n,platform:i})};var bl=a`: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%}`,xl=a`.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)}`,Zl=a`.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)}`,Cl=a`.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)}`;function yl(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}class Ml{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,l){return this._internals.setValidity(e,t,l)}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 l in t)t[l]&&(this.validationError=l.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const Vl=e=>{class l extends e{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 Ml(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,l){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(e,t,l)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return l.formAssociated=!0,t([$e("sgds-input")],l.prototype,"sgdsInput",void 0),t([$e("sgds-datepicker-input")],l.prototype,"sgdsDatepickerInput",void 0),l};var Hl=a`: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 Pl extends xe{emit(e,t){const l=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(l),l}static define(e,t=this,l={}){if(customElements.get(e));else try{customElements.define(e,t,l)}catch(o){customElements.define(e,class extends t{},l)}}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}))}))}}Pl.styles=[Hl],Pl.dependencies={},t([He({type:Boolean,reflect:!0})],Pl.prototype,"ssr",void 0);class Ol extends Pl{constructor(){super(...arguments),this.myDropdown=Fe(),this.dropdownMenuId=yl("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=Fe(),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=fl(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 l=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)},o=t.map(l),n=e.map(e=>{const n=l(e),i=o.indexOf(n);return-1!==i?t[i]:e}).concat(t.filter(t=>!e.some(e=>l(e)===l(t))));return n}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=[pl(8),this.noFlip?void 0:ml(),gl()].filter(Boolean);let l=t;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(l=this.mergeMiddleware(t,this.floatingOpts.middleware.filter(Boolean)));const o=Object.assign(Object.assign({strategy:"fixed",placement:e},this.floatingOpts),{middleware:l}),{x:n,y:i,strategy:r,placement:a}=await _l(this.myDropdown.value,this.menuRef.value,o);this.menuRef.value.setAttribute("data-placement",a),Object.assign(this.menuRef.value.style,{position:r,left:`${n}px`,top:`${i}px`})}}t([He({type:Boolean,state:!0})],Ol.prototype,"noFlip",void 0),t([He({type:Boolean,reflect:!0,state:!0})],Ol.prototype,"menuAlignRight",void 0),t([He({type:String,reflect:!0,state:!0})],Ol.prototype,"drop",void 0),t([He({type:Object})],Ol.prototype,"floatingOpts",void 0),t([He({type:Boolean,reflect:!0})],Ol.prototype,"menuIsOpen",void 0),t([He({type:Boolean,reflect:!0})],Ol.prototype,"disabled",void 0),t([He({type:Boolean,reflect:!0})],Ol.prototype,"readonly",void 0);class zl extends Ol{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(),l=t.find(t=>e.composedPath().includes(t));if(!l)return;const o=t.indexOf(l);this.nextDropdownItemNo=o+1,this.prevDropdownItemNo=o<=0?t.length-1:o-1,l.disabled||(this.emit("sgds-select",{detail:{item:l}}),"outside"!==this.close&&this.hideMenu())}_resetMenu(){this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1;this._getMenuItems().forEach(e=>{var t;const l=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".dropdown-item");l&&l.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 l=(e%t.length+t.length)%t.length,o=t[l];this.emit("i-sgds-option-focus",{detail:{option:o}}),this.nextDropdownItemNo=(l+1)%t.length,this.prevDropdownItemNo=(l-1+t.length)%t.length,t.forEach(e=>{const t=e.shadowRoot.querySelector(".dropdown-item");t.setAttribute("tabindex",e===o?"0":"-1"),e===o&&t.focus()})}}var $l,Sl;zl.styles=Ol.styles,t([($l="ul.dropdown-menu",(e,t,l)=>{const o=e=>{const l=e.renderRoot?.querySelector($l)??null;if(null===l&&Sl&&!e.hasUpdated){const e="object"==typeof t?t.name:t;ze("",`@query'd field ${JSON.stringify(String(e))} with the 'cache' flag set for selector '${$l}' 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 l};if(Sl){const{get:n,set:i}="object"==typeof t?e:l??(()=>{const e=Symbol(`${String(t)} (@query() cache)`);return{get(){return this[e]},set(t){this[e]=t}}})();return Oe(e,t,{get(){let e=n.call(this);return void 0===e&&(e=o(this),(null!==e||this.hasUpdated)&&i.call(this,e)),e}})}return Oe(e,t,{get(){return o(this)}})})],zl.prototype,"menu",void 0),t([Pe()],zl.prototype,"nextDropdownItemNo",void 0),t([Pe()],zl.prototype,"prevDropdownItemNo",void 0),t([He({type:Boolean,reflect:!0})],zl.prototype,"hidden",void 0);var Bl=a`.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 jl extends(Vl(zl)){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=yl("input"),this._labelId=yl("label"),this.floatingOpts={middleware:[wl({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 l=this.constructor.childName,o=(null===(t=e.relatedTarget)||void 0===t?void 0:t.tagName.toLowerCase())===l;this.invalid=!o&&!this._mixinReportValidity()})}reportValidity(){return this._mixinReportValidity()}setValidity(e,t,l){return this._mixinSetValidity(e,t,l)}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_renderFeedback(){return this.invalid&&this.hasFeedback?ee` <div class="invalid-feedback-container">
|
|
83
|
+
*/const Fe=()=>new We;class We{}const qe=new WeakMap;const Ke=je(class extends Ue{render(e){return oe}update(e,[t]){const l=t!==this._ref;return l&&void 0!==this._ref&&this._updateRefValue(void 0),(l||this._lastElementForRef!==this._element)&&(this._ref=t,this._context=e.options?.host,this._updateRefValue(this._element=e.element)),oe}_updateRefValue(e){if(this.isConnected||(e=void 0),"function"==typeof this._ref){const t=this._context??globalThis;let l=qe.get(t);void 0===l&&(l=new WeakMap,qe.set(t,l)),void 0!==l.get(this._ref)&&this._ref.call(this._context,void 0),l.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?qe.get(this._context??globalThis)?.get(this._ref):this._ref?.value}disconnected(){this._lastElementForRef===this._element&&this._updateRefValue(void 0)}reconnected(){this._updateRefValue(this._element)}}),Je=Math.min,Ge=Math.max,Ye=Math.round,Xe=Math.floor,Qe=e=>({x:e,y:e}),et={left:"right",right:"left",bottom:"top",top:"bottom"},tt={start:"end",end:"start"};function lt(e,t,l){return Ge(e,Je(t,l))}function ot(e,t){return"function"==typeof e?e(t):e}function nt(e){return e.split("-")[0]}function it(e){return e.split("-")[1]}function rt(e){return"x"===e?"y":"x"}function at(e){return"y"===e?"height":"width"}const st=new Set(["top","bottom"]);function ct(e){return st.has(nt(e))?"y":"x"}function dt(e){return rt(ct(e))}function ht(e,t,l){void 0===l&&(l=!1);const o=it(e),n=dt(e),i=at(n);let r="x"===n?o===(l?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(r=wt(r)),[r,wt(r)]}function ut(e){return e.replace(/start|end/g,e=>tt[e])}const vt=["left","right"],ft=["right","left"],pt=["top","bottom"],gt=["bottom","top"];function mt(e,t,l,o){const n=it(e);let i=function(e,t,l){switch(e){case"top":case"bottom":return l?t?ft:vt:t?vt:ft;case"left":case"right":return t?pt:gt;default:return[]}}(nt(e),"start"===l,o);return n&&(i=i.map(e=>e+"-"+n),t&&(i=i.concat(i.map(ut)))),i}function wt(e){return e.replace(/left|right|bottom|top/g,e=>et[e])}function _t(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 bt(e){const{x:t,y:l,width:o,height:n}=e;return{width:o,height:n,top:l,left:t,right:t+o,bottom:l+n,x:t,y:l}}function xt(e,t,l){let{reference:o,floating:n}=e;const i=ct(t),r=dt(t),a=at(r),s=nt(t),c="y"===i,d=o.x+o.width/2-n.width/2,h=o.y+o.height/2-n.height/2,u=o[a]/2-n[a]/2;let v;switch(s){case"top":v={x:d,y:o.y-n.height};break;case"bottom":v={x:d,y:o.y+o.height};break;case"right":v={x:o.x+o.width,y:h};break;case"left":v={x:o.x-n.width,y:h};break;default:v={x:o.x,y:o.y}}switch(it(t)){case"start":v[r]-=u*(l&&c?-1:1);break;case"end":v[r]+=u*(l&&c?-1:1)}return v}async function Zt(e,t){var l;void 0===t&&(t={});const{x:o,y:n,platform:i,rects:r,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:u=!1,padding:v=0}=ot(t,e),f=_t(v),p=a[u?"floating"===h?"reference":"floating":h],g=bt(await i.getClippingRect({element:null==(l=await(null==i.isElement?void 0:i.isElement(p)))||l?p:p.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:d,strategy:s})),m="floating"===h?{x:o,y:n,width:r.floating.width,height:r.floating.height}:r.reference,w=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),_=await(null==i.isElement?void 0:i.isElement(w))&&await(null==i.getScale?void 0:i.getScale(w))||{x:1,y:1},b=bt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:m,offsetParent:w,strategy:s}):m);return{top:(g.top-b.top+f.top)/_.y,bottom:(b.bottom-g.bottom+f.bottom)/_.y,left:(g.left-b.left+f.left)/_.x,right:(b.right-g.right+f.right)/_.x}}const Ct=new Set(["left","top"]);function yt(){return"undefined"!=typeof window}function Mt(e){return Pt(e)?(e.nodeName||"").toLowerCase():"#document"}function Vt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Ht(e){var t;return null==(t=(Pt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Pt(e){return!!yt()&&(e instanceof Node||e instanceof Vt(e).Node)}function Ot(e){return!!yt()&&(e instanceof Element||e instanceof Vt(e).Element)}function zt(e){return!!yt()&&(e instanceof HTMLElement||e instanceof Vt(e).HTMLElement)}function $t(e){return!(!yt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Vt(e).ShadowRoot)}const St=new Set(["inline","contents"]);function Bt(e){const{overflow:t,overflowX:l,overflowY:o,display:n}=Ft(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+l)&&!St.has(n)}const jt=new Set(["table","td","th"]);function At(e){return jt.has(Mt(e))}const kt=[":popover-open",":modal"];function Lt(e){return kt.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Et=["transform","translate","scale","rotate","perspective"],It=["transform","translate","scale","rotate","perspective","filter"],Tt=["paint","layout","strict","content"];function Rt(e){const t=Dt(),l=Ot(e)?Ft(e):e;return Et.some(e=>!!l[e]&&"none"!==l[e])||!!l.containerType&&"normal"!==l.containerType||!t&&!!l.backdropFilter&&"none"!==l.backdropFilter||!t&&!!l.filter&&"none"!==l.filter||It.some(e=>(l.willChange||"").includes(e))||Tt.some(e=>(l.contain||"").includes(e))}function Dt(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Nt=new Set(["html","body","#document"]);function Ut(e){return Nt.has(Mt(e))}function Ft(e){return Vt(e).getComputedStyle(e)}function Wt(e){return Ot(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qt(e){if("html"===Mt(e))return e;const t=e.assignedSlot||e.parentNode||$t(e)&&e.host||Ht(e);return $t(t)?t.host:t}function Kt(e){const t=qt(e);return Ut(t)?e.ownerDocument?e.ownerDocument.body:e.body:zt(t)&&Bt(t)?t:Kt(t)}function Jt(e,t,l){var o;void 0===t&&(t=[]),void 0===l&&(l=!0);const n=Kt(e),i=n===(null==(o=e.ownerDocument)?void 0:o.body),r=Vt(n);if(i){const e=Gt(r);return t.concat(r,r.visualViewport||[],Bt(n)?n:[],e&&l?Jt(e):[])}return t.concat(n,Jt(n,[],l))}function Gt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Yt(e){const t=Ft(e);let l=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const n=zt(e),i=n?e.offsetWidth:l,r=n?e.offsetHeight:o,a=Ye(l)!==i||Ye(o)!==r;return a&&(l=i,o=r),{width:l,height:o,$:a}}function Xt(e){return Ot(e)?e:e.contextElement}function Qt(e){const t=Xt(e);if(!zt(t))return Qe(1);const l=t.getBoundingClientRect(),{width:o,height:n,$:i}=Yt(t);let r=(i?Ye(l.width):l.width)/o,a=(i?Ye(l.height):l.height)/n;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}const el=Qe(0);function tl(e){const t=Vt(e);return Dt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:el}function ll(e,t,l,o){void 0===t&&(t=!1),void 0===l&&(l=!1);const n=e.getBoundingClientRect(),i=Xt(e);let r=Qe(1);t&&(o?Ot(o)&&(r=Qt(o)):r=Qt(e));const a=function(e,t,l){return void 0===t&&(t=!1),!(!l||t&&l!==Vt(e))&&t}(i,l,o)?tl(i):Qe(0);let s=(n.left+a.x)/r.x,c=(n.top+a.y)/r.y,d=n.width/r.x,h=n.height/r.y;if(i){const e=Vt(i),t=o&&Ot(o)?Vt(o):o;let l=e,n=Gt(l);for(;n&&o&&t!==l;){const e=Qt(n),t=n.getBoundingClientRect(),o=Ft(n),i=t.left+(n.clientLeft+parseFloat(o.paddingLeft))*e.x,r=t.top+(n.clientTop+parseFloat(o.paddingTop))*e.y;s*=e.x,c*=e.y,d*=e.x,h*=e.y,s+=i,c+=r,l=Vt(n),n=Gt(l)}}return bt({width:d,height:h,x:s,y:c})}function ol(e,t){const l=Wt(e).scrollLeft;return t?t.left+l:ll(Ht(e)).left+l}function nl(e,t){const l=e.getBoundingClientRect();return{x:l.left+t.scrollLeft-ol(e,l),y:l.top+t.scrollTop}}const il=new Set(["absolute","fixed"]);function rl(e,t,l){let o;if("viewport"===t)o=function(e,t){const l=Vt(e),o=Ht(e),n=l.visualViewport;let i=o.clientWidth,r=o.clientHeight,a=0,s=0;if(n){i=n.width,r=n.height;const e=Dt();(!e||e&&"fixed"===t)&&(a=n.offsetLeft,s=n.offsetTop)}const c=ol(o);if(c<=0){const e=o.ownerDocument,t=e.body,l=getComputedStyle(t),n="CSS1Compat"===e.compatMode&&parseFloat(l.marginLeft)+parseFloat(l.marginRight)||0,r=Math.abs(o.clientWidth-t.clientWidth-n);r<=25&&(i-=r)}else c<=25&&(i+=c);return{width:i,height:r,x:a,y:s}}(e,l);else if("document"===t)o=function(e){const t=Ht(e),l=Wt(e),o=e.ownerDocument.body,n=Ge(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=Ge(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-l.scrollLeft+ol(e);const a=-l.scrollTop;return"rtl"===Ft(o).direction&&(r+=Ge(t.clientWidth,o.clientWidth)-n),{width:n,height:i,x:r,y:a}}(Ht(e));else if(Ot(t))o=function(e,t){const l=ll(e,!0,"fixed"===t),o=l.top+e.clientTop,n=l.left+e.clientLeft,i=zt(e)?Qt(e):Qe(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:n*i.x,y:o*i.y}}(t,l);else{const l=tl(e);o={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return bt(o)}function al(e,t){const l=qt(e);return!(l===t||!Ot(l)||Ut(l))&&("fixed"===Ft(l).position||al(l,t))}function sl(e,t,l){const o=zt(t),n=Ht(t),i="fixed"===l,r=ll(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const s=Qe(0);function c(){s.x=ol(n)}if(o||!o&&!i)if(("body"!==Mt(t)||Bt(n))&&(a=Wt(t)),o){const e=ll(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else n&&c();i&&!o&&n&&c();const d=!n||o||i?Qe(0):nl(n,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 cl(e){return"static"===Ft(e).position}function dl(e,t){if(!zt(e)||"fixed"===Ft(e).position)return null;if(t)return t(e);let l=e.offsetParent;return Ht(e)===l&&(l=l.ownerDocument.body),l}function hl(e,t){const l=Vt(e);if(Lt(e))return l;if(!zt(e)){let t=qt(e);for(;t&&!Ut(t);){if(Ot(t)&&!cl(t))return t;t=qt(t)}return l}let o=dl(e,t);for(;o&&At(o)&&cl(o);)o=dl(o,t);return o&&Ut(o)&&cl(o)&&!Rt(o)?l:o||function(e){let t=qt(e);for(;zt(t)&&!Ut(t);){if(Rt(t))return t;if(Lt(t))return null;t=qt(t)}return null}(e)||l}const ul={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:l,offsetParent:o,strategy:n}=e;const i="fixed"===n,r=Ht(o),a=!!t&&Lt(t.floating);if(o===r||a&&i)return l;let s={scrollLeft:0,scrollTop:0},c=Qe(1);const d=Qe(0),h=zt(o);if((h||!h&&!i)&&(("body"!==Mt(o)||Bt(r))&&(s=Wt(o)),zt(o))){const e=ll(o);c=Qt(o),d.x=e.x+o.clientLeft,d.y=e.y+o.clientTop}const u=!r||h||i?Qe(0):nl(r,s);return{width:l.width*c.x,height:l.height*c.y,x:l.x*c.x-s.scrollLeft*c.x+d.x+u.x,y:l.y*c.y-s.scrollTop*c.y+d.y+u.y}},getDocumentElement:Ht,getClippingRect:function(e){let{element:t,boundary:l,rootBoundary:o,strategy:n}=e;const i=[..."clippingAncestors"===l?Lt(t)?[]:function(e,t){const l=t.get(e);if(l)return l;let o=Jt(e,[],!1).filter(e=>Ot(e)&&"body"!==Mt(e)),n=null;const i="fixed"===Ft(e).position;let r=i?qt(e):e;for(;Ot(r)&&!Ut(r);){const t=Ft(r),l=Rt(r);l||"fixed"!==t.position||(n=null),(i?!l&&!n:!l&&"static"===t.position&&n&&il.has(n.position)||Bt(r)&&!l&&al(e,r))?o=o.filter(e=>e!==r):n=t,r=qt(r)}return t.set(e,o),o}(t,this._c):[].concat(l),o],r=i[0],a=i.reduce((e,l)=>{const o=rl(t,l,n);return e.top=Ge(o.top,e.top),e.right=Je(o.right,e.right),e.bottom=Je(o.bottom,e.bottom),e.left=Ge(o.left,e.left),e},rl(t,r,n));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:hl,getElementRects:async function(e){const t=this.getOffsetParent||hl,l=this.getDimensions,o=await l(e.floating);return{reference:sl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:l}=Yt(e);return{width:t,height:l}},getScale:Qt,isElement:Ot,isRTL:function(e){return"rtl"===Ft(e).direction}};function vl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fl(e,t,l,o){void 0===o&&(o={});const{ancestorScroll:n=!0,ancestorResize:i=!0,elementResize:r="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:s=!1}=o,c=Xt(e),d=n||i?[...c?Jt(c):[],...Jt(t)]:[];d.forEach(e=>{n&&e.addEventListener("scroll",l,{passive:!0}),i&&e.addEventListener("resize",l)});const h=c&&a?function(e,t){let l,o=null;const n=Ht(e);function i(){var e;clearTimeout(l),null==(e=o)||e.disconnect(),o=null}return function r(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),i();const c=e.getBoundingClientRect(),{left:d,top:h,width:u,height:v}=c;if(a||t(),!u||!v)return;const f={rootMargin:-Xe(h)+"px "+-Xe(n.clientWidth-(d+u))+"px "+-Xe(n.clientHeight-(h+v))+"px "+-Xe(d)+"px",threshold:Ge(0,Je(1,s))||1};let p=!0;function g(t){const o=t[0].intersectionRatio;if(o!==s){if(!p)return r();o?r(!1,o):l=setTimeout(()=>{r(!1,1e-7)},1e3)}1!==o||vl(c,e.getBoundingClientRect())||r(),p=!1}try{o=new IntersectionObserver(g,{...f,root:n.ownerDocument})}catch(e){o=new IntersectionObserver(g,f)}o.observe(e)}(!0),i}(c,l):null;let u,v=-1,f=null;r&&(f=new ResizeObserver(e=>{let[o]=e;o&&o.target===c&&f&&(f.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var e;null==(e=f)||e.observe(t)})),l()}),c&&!s&&f.observe(c),f.observe(t));let p=s?ll(e):null;return s&&function t(){const o=ll(e);p&&!vl(p,o)&&l();p=o,u=requestAnimationFrame(t)}(),l(),()=>{var e;d.forEach(e=>{n&&e.removeEventListener("scroll",l),i&&e.removeEventListener("resize",l)}),null==h||h(),null==(e=f)||e.disconnect(),f=null,s&&cancelAnimationFrame(u)}}const pl=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var l,o;const{x:n,y:i,placement:r,middlewareData:a}=t,s=await async function(e,t){const{placement:l,platform:o,elements:n}=e,i=await(null==o.isRTL?void 0:o.isRTL(n.floating)),r=nt(l),a=it(l),s="y"===ct(l),c=Ct.has(r)?-1:1,d=i&&s?-1:1,h=ot(t,e);let{mainAxis:u,crossAxis:v,alignmentAxis:f}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&"number"==typeof f&&(v="end"===a?-1*f:f),s?{x:v*d,y:u*c}:{x:u*c,y:v*d}}(t,e);return r===(null==(l=a.offset)?void 0:l.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:n+s.x,y:i+s.y,data:{...s,placement:r}}}}},gl=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:l,y:o,placement:n}=t,{mainAxis:i=!0,crossAxis:r=!1,limiter:a={fn:e=>{let{x:t,y:l}=e;return{x:t,y:l}}},...s}=ot(e,t),c={x:l,y:o},d=await Zt(t,s),h=ct(nt(n)),u=rt(h);let v=c[u],f=c[h];if(i){const e="y"===u?"bottom":"right";v=lt(v+d["y"===u?"top":"left"],v,v-d[e])}if(r){const e="y"===h?"bottom":"right";f=lt(f+d["y"===h?"top":"left"],f,f-d[e])}const p=a.fn({...t,[u]:v,[h]:f});return{...p,data:{x:p.x-l,y:p.y-o,enabled:{[u]:i,[h]:r}}}}}},ml=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var l,o;const{placement:n,middlewareData:i,rects:r,initialPlacement:a,platform:s,elements:c}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...g}=ot(e,t);if(null!=(l=i.arrow)&&l.alignmentOffset)return{};const m=nt(n),w=ct(a),_=nt(a)===a,b=await(null==s.isRTL?void 0:s.isRTL(c.floating)),x=u||(_||!p?[wt(a)]:function(e){const t=wt(e);return[ut(e),t,ut(t)]}(a)),Z="none"!==f;!u&&Z&&x.push(...mt(a,p,f,b));const C=[a,...x],y=await Zt(t,g),M=[];let V=(null==(o=i.flip)?void 0:o.overflows)||[];if(d&&M.push(y[m]),h){const e=ht(n,r,b);M.push(y[e[0]],y[e[1]])}if(V=[...V,{placement:n,overflows:M}],!M.every(e=>e<=0)){var H,P;const e=((null==(H=i.flip)?void 0:H.index)||0)+1,t=C[e];if(t){if(!("alignment"===h&&w!==ct(t))||V.every(e=>ct(e.placement)!==w||e.overflows[0]>0))return{data:{index:e,overflows:V},reset:{placement:t}}}let l=null==(P=V.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:P.placement;if(!l)switch(v){case"bestFit":{var O;const e=null==(O=V.filter(e=>{if(Z){const t=ct(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:O[0];e&&(l=e);break}case"initialPlacement":l=a}if(n!==l)return{reset:{placement:l}}}return{}}}},wl=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var l,o;const{placement:n,rects:i,platform:r,elements:a}=t,{apply:s=()=>{},...c}=ot(e,t),d=await Zt(t,c),h=nt(n),u=it(n),v="y"===ct(n),{width:f,height:p}=i.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=p-d.top-d.bottom,_=f-d.left-d.right,b=Je(p-d[g],w),x=Je(f-d[m],_),Z=!t.middlewareData.shift;let C=b,y=x;if(null!=(l=t.middlewareData.shift)&&l.enabled.x&&(y=_),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(C=w),Z&&!u){const e=Ge(d.left,0),t=Ge(d.right,0),l=Ge(d.top,0),o=Ge(d.bottom,0);v?y=f-2*(0!==e||0!==t?e+t:Ge(d.left,d.right)):C=p-2*(0!==l||0!==o?l+o:Ge(d.top,d.bottom))}await s({...t,availableWidth:y,availableHeight:C});const M=await r.getDimensions(a.floating);return f!==M.width||p!==M.height?{reset:{rects:!0}}:{}}}},_l=(e,t,l)=>{const o=new Map,n={platform:ul,...l},i={...n.platform,_c:o};return(async(e,t,l)=>{const{placement:o="bottom",strategy:n="absolute",middleware:i=[],platform:r}=l,a=i.filter(Boolean),s=await(null==r.isRTL?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:n}),{x:d,y:h}=xt(c,o,s),u=o,v={},f=0;for(let l=0;l<a.length;l++){const{name:i,fn:p}=a[l],{x:g,y:m,data:w,reset:_}=await p({x:d,y:h,initialPlacement:o,placement:u,strategy:n,middlewareData:v,rects:c,platform:r,elements:{reference:e,floating:t}});d=null!=g?g:d,h=null!=m?m:h,v={...v,[i]:{...v[i],...w}},_&&f<=50&&(f++,"object"==typeof _&&(_.placement&&(u=_.placement),_.rects&&(c=!0===_.rects?await r.getElementRects({reference:e,floating:t,strategy:n}):_.rects),({x:d,y:h}=xt(c,u,s))),l=-1)}return{x:d,y:h,placement:u,strategy:n,middlewareData:v}})(e,t,{...n,platform:i})};var bl=a`: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%}`,xl=a`.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)}`,Zl=a`.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)}`,Cl=a`.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)}`;function yl(e="",t=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${e}-${t}`}class Ml{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,l){return this._internals.setValidity(e,t,l)}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 l in t)t[l]&&(this.validationError=l.toString(),this._internals.setValidity({[this.validationError]:!0},e.validationMessage,e))}}const Vl=e=>{class l extends e{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 Ml(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,l){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(e,t,l)}_mixinShouldSkipSgdsValidation(){const e=this.closest("form");return(null==e?void 0:e.noValidate)||this.noValidate}}return l.formAssociated=!0,t([$e("sgds-input")],l.prototype,"sgdsInput",void 0),t([$e("sgds-datepicker-input")],l.prototype,"sgdsDatepickerInput",void 0),l};var Hl=a`: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 Pl extends xe{emit(e,t){const l=new CustomEvent(e,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},t));return this.dispatchEvent(l),l}static define(e,t=this,l={}){if(customElements.get(e));else try{customElements.define(e,t,l)}catch(o){customElements.define(e,class extends t{},l)}}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}))}))}}Pl.styles=[Hl],Pl.dependencies={},t([He({type:Boolean,reflect:!0})],Pl.prototype,"ssr",void 0);class Ol extends Pl{constructor(){super(...arguments),this.myDropdown=Fe(),this.dropdownMenuId=yl("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=Fe(),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=fl(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 l=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)},o=t.map(l),n=e.map(e=>{const n=l(e),i=o.indexOf(n);return-1!==i?t[i]:e}).concat(t.filter(t=>!e.some(e=>l(e)===l(t))));return n}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=[pl(8),this.noFlip?void 0:ml(),gl()].filter(Boolean);let l=t;Array.isArray(this.floatingOpts.middleware)&&this.floatingOpts.middleware.length>0&&(l=this.mergeMiddleware(t,this.floatingOpts.middleware.filter(Boolean)));const o=Object.assign(Object.assign({strategy:"fixed",placement:e},this.floatingOpts),{middleware:l}),{x:n,y:i,strategy:r,placement:a}=await _l(this.myDropdown.value,this.menuRef.value,o);this.menuRef.value.setAttribute("data-placement",a),Object.assign(this.menuRef.value.style,{position:r,left:`${n}px`,top:`${i}px`})}}t([He({type:Boolean,state:!0})],Ol.prototype,"noFlip",void 0),t([He({type:Boolean,reflect:!0,state:!0})],Ol.prototype,"menuAlignRight",void 0),t([He({type:String,reflect:!0,state:!0})],Ol.prototype,"drop",void 0),t([He({type:Object})],Ol.prototype,"floatingOpts",void 0),t([He({type:Boolean,reflect:!0})],Ol.prototype,"menuIsOpen",void 0),t([He({type:Boolean,reflect:!0})],Ol.prototype,"disabled",void 0),t([He({type:Boolean,reflect:!0})],Ol.prototype,"readonly",void 0);class zl extends Ol{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(),l=t.find(t=>e.composedPath().includes(t));if(!l)return;const o=t.indexOf(l);this.nextDropdownItemNo=o+1,this.prevDropdownItemNo=o<=0?t.length-1:o-1,l.disabled||(this.emit("sgds-select",{detail:{item:l}}),"outside"!==this.close&&this.hideMenu())}_resetMenu(){this.nextDropdownItemNo=0,this.prevDropdownItemNo=-1;this._getMenuItems().forEach(e=>{var t;const l=null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(".dropdown-item");l&&l.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 l=(e%t.length+t.length)%t.length,o=t[l];this.emit("i-sgds-option-focus",{detail:{option:o}}),this.nextDropdownItemNo=(l+1)%t.length,this.prevDropdownItemNo=(l-1+t.length)%t.length,t.forEach(e=>{const t=e.shadowRoot.querySelector(".dropdown-item");t.setAttribute("tabindex",e===o?"0":"-1"),e===o&&t.focus()})}}var $l,Sl;zl.styles=Ol.styles,t([($l="ul.dropdown-menu",(e,t,l)=>{const o=e=>{const l=e.renderRoot?.querySelector($l)??null;if(null===l&&Sl&&!e.hasUpdated){const e="object"==typeof t?t.name:t;ze("",`@query'd field ${JSON.stringify(String(e))} with the 'cache' flag set for selector '${$l}' 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 l};if(Sl){const{get:n,set:i}="object"==typeof t?e:l??(()=>{const e=Symbol(`${String(t)} (@query() cache)`);return{get(){return this[e]},set(t){this[e]=t}}})();return Oe(e,t,{get(){let e=n.call(this);return void 0===e&&(e=o(this),(null!==e||this.hasUpdated)&&i.call(this,e)),e}})}return Oe(e,t,{get(){return o(this)}})})],zl.prototype,"menu",void 0),t([Pe()],zl.prototype,"nextDropdownItemNo",void 0),t([Pe()],zl.prototype,"prevDropdownItemNo",void 0),t([He({type:Boolean,reflect:!0})],zl.prototype,"hidden",void 0);var Bl=a`.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 jl extends(Vl(zl)){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=yl("input"),this._labelId=yl("label"),this.floatingOpts={middleware:[wl({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 l=this.constructor.childName,o=(null===(t=e.relatedTarget)||void 0===t?void 0:t.tagName.toLowerCase())===l;this.invalid=!o&&!this._mixinReportValidity()})}reportValidity(){return this._mixinReportValidity()}setValidity(e,t,l){return this._mixinSetValidity(e,t,l)}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_renderFeedback(){return this.invalid&&this.hasFeedback?ee` <div class="invalid-feedback-container">
|
|
84
84
|
<slot name="invalidIcon">
|
|
85
85
|
<sgds-icon name="exclamation-circle-fill" size="md"></sgds-icon>
|
|
86
86
|
</slot>
|
|
@@ -76,7 +76,7 @@ class extends Nt{constructor(t){if(super(t),t.type!==It&&t.type!==Et&&t.type!==z
|
|
|
76
76
|
* @license
|
|
77
77
|
* Copyright 2020 Google LLC
|
|
78
78
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
79
|
-
*/var jt,Ht=r`.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)}`,qt=r`.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)}`,Bt=r`.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}`,Zt=r`.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)}`,Jt=r`: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 Gt extends bt{emit(t,e){const i=new CustomEvent(t,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},e));return this.dispatchEvent(i),i}static define(t,e=this,i={}){if(customElements.get(t));else try{customElements.define(t,e,i)}catch(s){customElements.define(t,class extends e{},i)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([t,e])=>{this.constructor.define(t,e)})}firstUpdated(t){var e;super.firstUpdated(t),this.ssr&&(null===(e=this.shadowRoot)||void 0===e||e.querySelectorAll("slot").forEach(t=>{t.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}function Yt(t="",e=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${t}-${e}`}Gt.styles=[Jt],Gt.dependencies={},t([kt({type:Boolean,reflect:!0})],Gt.prototype,"ssr",void 0);class Xt extends Gt{constructor(){super(...arguments),this.label="",this.hintText="",this.disabled=!1,this.invalid=!1,this._controlId=Yt("input"),this._labelId=Yt("label")}setInvalid(t){this.invalid=t,t?this.emit("sgds-invalid"):this.emit("sgds-valid")}}Xt.styles=[...Gt.styles,Ht,qt,Bt,Zt],t([kt({reflect:!0})],Xt.prototype,"label",void 0),t([kt({reflect:!0})],Xt.prototype,"hintText",void 0),t([kt({reflect:!0})],Xt.prototype,"name",void 0),t([kt({type:Boolean,reflect:!0})],Xt.prototype,"disabled",void 0),t([kt({type:Boolean,reflect:!0})],Xt.prototype,"invalid",void 0);class Kt{constructor(t,e){(this.host=t).addController(this),this._internals=t._internals||this.host.attachInternals(),this.options=Object.assign({setInvalid:(t,e)=>{t.invalid=e},value:t=>t.value,input:t=>t.input},e)}hostConnected(){this.host.addEventListener("invalid",t=>this.handleInvalid(t))}hostDisconnected(){this.host.removeEventListener("invalid",t=>this.handleInvalid(t))}handleInvalid(t){t.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(t){const e=t.target;this.options.setInvalid(this.host,!1),this.validateInput(e)}handleChange(t){const e=t.target;this.validateInput(e),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(t,e,i){return this._internals.setValidity(t,e,i)}setFormValue(){const t=this.options.value(this.host);this._internals.setFormValue(t)}validateInput(t){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const e=t.validity;if(e.valid)this._internals.setValidity({});else for(const i in e)e[i]&&(this.validationError=i.toString(),this._internals.setValidity({[this.validationError]:!0},t.validationMessage,t))}}const Qt=e=>{class i extends e{constructor(...t){super(...t),this._isTouched=!1,this._internals=this.attachInternals()}connectedCallback(){var t;super.connectedCallback(),null!==(t=this.inputValidationController)&&void 0!==t||(this.inputValidationController=new Kt(this))}async firstUpdated(t){super.firstUpdated(t),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(t){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleChange(t)}_mixinHandleInputChange(t){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleInput(t)}_mixinResetValidity(t){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this._isTouched&&(this._isTouched=!1),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(t)}_mixinValidate(t){this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(t)}_mixinSetFormValue(){const t=this.value;this._internals.setFormValue(t)}_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(t,e,i){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(t,e,i)}_mixinShouldSkipSgdsValidation(){const t=this.closest("form");return(null==t?void 0:t.noValidate)||this.noValidate}}return i.formAssociated=!0,t([Tt("sgds-input")],i.prototype,"sgdsInput",void 0),t([Tt("sgds-datepicker-input")],i.prototype,"sgdsDatepickerInput",void 0),i};function te(t,e){const i=Object.assign({waitUntilFirstUpdate:!1},e);return(e,s)=>{const{update:n}=e;if(t in e){const o=t;e.update=function(t){if(t.has(o)){const e=t.get(o),n=this[o];e!==n&&(i.waitUntilFirstUpdate&&!this.hasUpdated||this[s](e,n))}n.call(this,t)}}}}var ee,ie,se,ne,oe,re=r`textarea{font-family:inherit;font-size:inherit;line-height:inherit;margin:0;resize:vertical}textarea.form-control-group{min-height:var(--sgds-dimension-136);overflow:auto;padding:var(--sgds-form-padding-y) var(--sgds-form-padding-x)}.textarea-resize-none{resize:none}.textarea-resize-vertical{resize:vertical}.textarea-resize-auto{height:auto;overflow-y:hidden;resize:none}.textarea-info-container{display:flex;justify-content:space-between}.word-count{margin-left:auto}`,ae=r`.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)}`;class le extends(Qt(Xt)){constructor(){super(...arguments),this.value="",this.spellcheck=!1,this.rows=4,this.placeholder="Placeholder",this.invalidFeedback="",this.autofocus=!1,this.readonly=!1,this.resize="vertical",this.defaultValue="",this.hasFeedback=!1,this.required=!1,this.noValidate=!1,this.hintText="",this._isTouched=!1}focus(t){this.textarea.focus(t)}blur(){this.textarea.blur()}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}select(){this.textarea.select()}_handleInvalid(t){t.preventDefault(),this.invalid=!0}_handleChange(t){this.value=this.input.value,this.emit("sgds-change"),super._mixinHandleChange(t)}_handleInputChange(t){this.value=this.input.value,this.emit("sgds-input"),super._mixinHandleInputChange(t)}_handleFocus(){this.emit("sgds-focus")}_handleBlur(){const t=this.emit("sgds-blur",{cancelable:!0});this._mixinShouldSkipSgdsValidation()||t.defaultPrevented||(this.setInvalid(!this._mixinCheckValidity()),this._isTouched=!0)}_handleRowsChange(){this._setTextareaHeight()}_setTextareaHeight(){"auto"===this.resize?(this.textarea.style.height="auto",this.textarea.style.height=`${this.textarea.scrollHeight}px`):this.textarea.style.height=void 0}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&this.setInvalid(!this._mixinCheckValidity())}_handleDisabledChange(){this.setInvalid(!1)}_handleValueChange(){this.updateComplete.then(()=>this._setTextareaHeight())}_renderHintText(){const t=Lt` <div id="${this._controlId}Help" class="form-text">${this.hintText}</div> `;return this.hintText&&t}_wordCount(){return Lt`
|
|
79
|
+
*/var jt,Ht=r`.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)}`,qt=r`.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)}`,Bt=r`.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}`,Zt=r`.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)}`,Jt=r`: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 Gt extends bt{emit(t,e){const i=new CustomEvent(t,Object.assign({bubbles:!0,cancelable:!1,composed:!0,detail:{}},e));return this.dispatchEvent(i),i}static define(t,e=this,i={}){if(customElements.get(t));else try{customElements.define(t,e,i)}catch(s){customElements.define(t,class extends e{},i)}}constructor(){super(),this.ssr=Boolean(this.shadowRoot),Object.entries(this.constructor.dependencies).forEach(([t,e])=>{this.constructor.define(t,e)})}firstUpdated(t){var e;super.firstUpdated(t),this.ssr&&(null===(e=this.shadowRoot)||void 0===e||e.querySelectorAll("slot").forEach(t=>{t.dispatchEvent(new Event("slotchange",{bubbles:!0,composed:!1,cancelable:!1}))}))}}function Yt(t="",e=""){return`id-${Math.random().toString().substring(2,6)}-sgds-${t}-${e}`}Gt.styles=[Jt],Gt.dependencies={},t([kt({type:Boolean,reflect:!0})],Gt.prototype,"ssr",void 0);class Xt extends Gt{constructor(){super(...arguments),this.label="",this.hintText="",this.disabled=!1,this.invalid=!1,this._controlId=Yt("input"),this._labelId=Yt("label")}setInvalid(t){this.invalid=t,t?this.emit("sgds-invalid"):this.emit("sgds-valid")}}Xt.styles=[...Gt.styles,Ht,qt,Bt,Zt],t([kt({reflect:!0})],Xt.prototype,"label",void 0),t([kt({reflect:!0})],Xt.prototype,"hintText",void 0),t([kt({reflect:!0})],Xt.prototype,"name",void 0),t([kt({type:Boolean,reflect:!0})],Xt.prototype,"disabled",void 0),t([kt({type:Boolean,reflect:!0})],Xt.prototype,"invalid",void 0);class Kt{constructor(t,e){(this.host=t).addController(this),this._internals=t._internals||this.host.attachInternals(),this.options=Object.assign({setInvalid:(t,e)=>{t.invalid=e},value:t=>t.value,input:t=>t.input},e)}hostConnected(){this.host.addEventListener("invalid",t=>this.handleInvalid(t))}hostDisconnected(){this.host.removeEventListener("invalid",t=>this.handleInvalid(t))}handleInvalid(t){t.preventDefault(),this.options.setInvalid(this.host,!0)}handleInput(t){const e=t.target;this.options.setInvalid(this.host,!1),this.validateInput(e)}handleChange(t){const e=t.target;this.validateInput(e),this.options.setInvalid(this.host,!this.checkValidity())}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}updateInvalidState(){this.options.setInvalid(this.host,!this.checkValidity())}resetValidity(){return this._internals.setValidity({})}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}setValidity(t,e,i){return this._internals.setValidity(t,e,i)}setFormValue(){const t=this.options.value(this.host);this._internals.setFormValue(t)}validateInput(t){if(this.options.input(this.host).disabled)return this._internals.setValidity({});const e=t.validity;if(e.valid)this._internals.setValidity({});else for(const i in e)e[i]&&(this.validationError=i.toString(),this._internals.setValidity({[this.validationError]:!0},t.validationMessage,t))}}const Qt=e=>{class i extends e{constructor(...t){super(...t),this._isTouched=!1,this._internals=this.attachInternals()}connectedCallback(){var t;super.connectedCallback(),null!==(t=this.inputValidationController)&&void 0!==t||(this.inputValidationController=new Kt(this))}async firstUpdated(t){super.firstUpdated(t),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(t){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleChange(t)}_mixinHandleInputChange(t){this._mixinSetFormValue(),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.handleInput(t)}_mixinResetValidity(t){this.inputValidationController.resetValidity(),this.inputValidationController.updateInvalidState(),this._isTouched&&(this._isTouched=!1),this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(t)}_mixinValidate(t){this._mixinShouldSkipSgdsValidation()||this.inputValidationController.validateInput(t)}_mixinSetFormValue(){const t=this.value;this._internals.setFormValue(t)}_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(t,e,i){if(!this._mixinShouldSkipSgdsValidation())return this.inputValidationController.setValidity(t,e,i)}_mixinShouldSkipSgdsValidation(){const t=this.closest("form");return(null==t?void 0:t.noValidate)||this.noValidate}}return i.formAssociated=!0,t([Tt("sgds-input")],i.prototype,"sgdsInput",void 0),t([Tt("sgds-datepicker-input")],i.prototype,"sgdsDatepickerInput",void 0),i};function te(t,e){const i=Object.assign({waitUntilFirstUpdate:!1},e);return(e,s)=>{const{update:n}=e;if(t in e){const o=t;e.update=function(t){if(t.has(o)){const e=t.get(o),n=this[o];e!==n&&(i.waitUntilFirstUpdate&&!this.hasUpdated||this[s](e,n))}n.call(this,t)}}}}var ee,ie,se,ne,oe,re=r`textarea{font-family:inherit;font-size:inherit;line-height:inherit;margin:0;resize:vertical}textarea.form-control-group{min-height:var(--sgds-dimension-136);overflow:auto;padding:var(--sgds-form-padding-y) var(--sgds-form-padding-x)}.textarea-resize-none{resize:none}.textarea-resize-vertical{resize:vertical}.textarea-resize-auto{height:auto;overflow-y:hidden;resize:none}.textarea-info-container{display:flex;justify-content:space-between}.word-count{margin-left:auto}`,ae=r`.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)}`;class le extends(Qt(Xt)){constructor(){super(...arguments),this.value="",this.spellcheck=!1,this.rows=4,this.placeholder="Placeholder",this.invalidFeedback="",this.autofocus=!1,this.readonly=!1,this.resize="vertical",this.defaultValue="",this.hasFeedback=!1,this.required=!1,this.noValidate=!1,this.hintText="",this._isTouched=!1}focus(t){this.textarea.focus(t)}blur(){this.textarea.blur()}reportValidity(){return this._mixinReportValidity()}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}select(){this.textarea.select()}_handleInvalid(t){t.preventDefault(),this.invalid=!0}_handleChange(t){this.value=this.input.value,this.emit("sgds-change"),super._mixinHandleChange(t)}_handleInputChange(t){this.value=this.input.value,this.emit("sgds-input"),super._mixinHandleInputChange(t)}_handleFocus(){this.emit("sgds-focus")}_handleBlur(){const t=this.emit("sgds-blur",{cancelable:!0});this._mixinShouldSkipSgdsValidation()||t.defaultPrevented||(this.setInvalid(!this._mixinCheckValidity()),this._isTouched=!0)}_handleRowsChange(){this._setTextareaHeight()}_setTextareaHeight(){"auto"===this.resize?(this.textarea.style.height="auto",this.textarea.style.height=`${this.textarea.scrollHeight}px`):this.textarea.style.height=void 0}_handleIsTouched(){this._mixinShouldSkipSgdsValidation()||this._isTouched&&this.setInvalid(!this._mixinCheckValidity())}_handleDisabledChange(){this.setInvalid(!1)}_handleValueChange(){this.updateComplete.then(()=>this._setTextareaHeight())}_renderHintText(){const t=Lt` <div id="${this._controlId}Help" class="form-text">${this.hintText}</div> `;return this.hintText&&t}_wordCount(){return Lt`
|
|
80
80
|
<div
|
|
81
81
|
class="form-text word-count ${Mt({"invalid-feedback":this.invalid&&this.hasFeedback})}"
|
|
82
82
|
>
|
|
@@ -328,7 +328,7 @@ class extends Ke{constructor(e){if(super(e),e.type!==Ue&&e.type!==Ne&&e.type!==q
|
|
|
328
328
|
</div>
|
|
329
329
|
`:ae}
|
|
330
330
|
</fieldset>
|
|
331
|
-
`}}fa.styles=[...la.styles,va],fa.dependencies={"sgds-icon":_t},t([ze({reflect:!0})],fa.prototype,"label",void 0),t([ze({type:String,reflect:!0})],fa.prototype,"invalidFeedback",void 0),t([ze({type:Boolean,reflect:!0})],fa.prototype,"hasFeedback",void 0),t([ze({reflect:!0})],fa.prototype,"hintText",void 0),t([ze({type:Boolean,reflect:!0})],fa.prototype,"required",void 0),t([ze({type:Boolean,reflect:!0})],fa.prototype,"noValidate",void 0),t([ze({reflect:!0})],fa.prototype,"value",void 0),t([Ie()],fa.prototype,"_isTouched",void 0),t([da()],fa.prototype,"defaultValue",void 0),t([Ie()],fa.prototype,"_blurredCheckboxes",void 0),t([Ee()],fa.prototype,"_checkboxes",void 0),t([nt("value",{waitUntilFirstUpdate:!0})],fa.prototype,"_handleValueChange",null),t([nt("_isTouched",{waitUntilFirstUpdate:!0})],fa.prototype,"_handleIsTouched",null),t([nt("invalid",{waitUntilFirstUpdate:!0})],fa.prototype,"_updateInvalid",null);var ma=r`.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-
|
|
331
|
+
`}}fa.styles=[...la.styles,va],fa.dependencies={"sgds-icon":_t},t([ze({reflect:!0})],fa.prototype,"label",void 0),t([ze({type:String,reflect:!0})],fa.prototype,"invalidFeedback",void 0),t([ze({type:Boolean,reflect:!0})],fa.prototype,"hasFeedback",void 0),t([ze({reflect:!0})],fa.prototype,"hintText",void 0),t([ze({type:Boolean,reflect:!0})],fa.prototype,"required",void 0),t([ze({type:Boolean,reflect:!0})],fa.prototype,"noValidate",void 0),t([ze({reflect:!0})],fa.prototype,"value",void 0),t([Ie()],fa.prototype,"_isTouched",void 0),t([da()],fa.prototype,"defaultValue",void 0),t([Ie()],fa.prototype,"_blurredCheckboxes",void 0),t([Ee()],fa.prototype,"_checkboxes",void 0),t([nt("value",{waitUntilFirstUpdate:!0})],fa.prototype,"_handleValueChange",null),t([nt("_isTouched",{waitUntilFirstUpdate:!0})],fa.prototype,"_handleIsTouched",null),t([nt("invalid",{waitUntilFirstUpdate:!0})],fa.prototype,"_updateInvalid",null);var ma=r`.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)}`,ba=r`.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 wa extends(ha(zi)){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=Zi("input"),this._labelId=Zi("label"),this.floatingOpts={middleware:[yi({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 s=this.constructor.childName,i=(null===(t=e.relatedTarget)||void 0===t?void 0:t.tagName.toLowerCase())===s;this.invalid=!i&&!this._mixinReportValidity()})}reportValidity(){return this._mixinReportValidity()}setValidity(e,t,s){return this._mixinSetValidity(e,t,s)}checkValidity(){return this._mixinCheckValidity()}get validity(){return this._mixinGetValidity()}get validationMessage(){return this._mixinGetValidationMessage()}_renderFeedback(){return this.invalid&&this.hasFeedback?te` <div class="invalid-feedback-container">
|
|
332
332
|
<slot name="invalidIcon">
|
|
333
333
|
<sgds-icon name="exclamation-circle-fill" size="md"></sgds-icon>
|
|
334
334
|
</slot>
|
|
@@ -596,7 +596,7 @@ const Ca=(e,t,s)=>{const i=new Map;for(let a=t;a<=s;a++)i.set(e[a],a);return i};
|
|
|
596
596
|
>
|
|
597
597
|
</sgds-icon-button>
|
|
598
598
|
</div>
|
|
599
|
-
`}}Wa.styles=[Ka],Wa.dependencies={"sgds-icon":_t,"sgds-icon-button":Ya,"sgds-button":Yi},t([ze({attribute:!1})],Wa.prototype,"displayDate",void 0),t([ze({attribute:!1})],Wa.prototype,"focusedDate",void 0),t([ze({attribute:!1})],Wa.prototype,"selectedDate",void 0),t([ze()],Wa.prototype,"view",void 0),t([ze()],Wa.prototype,"focusedTabIndex",void 0),t([nt("focusedTabIndex",{waitUntilFirstUpdate:!0})],Wa.prototype,"_handleFocusedTabIndexChange",null);const Ga=["January","February","March","April","May","June","July","August","September","October","November","December"];class Ja{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 s={value:"",isComplete:!1};Object.defineProperties(s,{value:{get:()=>this._state,enumerable:!0},isComplete:{get:()=>this._state.length>0&&!/[DMY]/.test(this._state),enumerable:!0}}),this.masked=s,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 s;null===(s=this.listeners.get(e))||void 0===s||s.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 s=this.placeholderStr[t];"D"!==s&&"M"!==s&&"Y"!==s||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(),s=this._state.split("");let i=-1;for(const e of t)if(/[DMY]/.test(s[e])){i=e;break}if(-1===i)return;s[i]=e,this._state=s.join(""),this.input.value=this._state;const a=this._findNextInputPos(i);this.input.setSelectionRange(a,a),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,s=this._state.split("");let i=t-1;for(;i>=0&&!/\d/.test(s[i]);)i--;i>=0&&(s[i]=this.placeholderStr[i],this._state=s.join(""),this.input.value=this._state,this.input.setSelectionRange(i,i),this._emit("accept"))}_deleteForward(){var e;const t=null!==(e=this.input.selectionStart)&&void 0!==e?e:0,s=this._state.split("");let i=t;for(;i<s.length&&!/\d/.test(s[i]);)i++;i<s.length&&(s[i]=this.placeholderStr[i],this._state=s.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 Xa=r`: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 Qa extends(ha(la)){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,s){return this._mixinSetValidity(e,t,s)}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,s=[this.hintText?`${this._controlId}Help`:"",this.invalid&&t?`${this._controlId}-invalid`:""].filter(Boolean).join(" ")||void 0;return ut`
|
|
599
|
+
`}}Wa.styles=[Ka],Wa.dependencies={"sgds-icon":_t,"sgds-icon-button":Ya,"sgds-button":Yi},t([ze({attribute:!1})],Wa.prototype,"displayDate",void 0),t([ze({attribute:!1})],Wa.prototype,"focusedDate",void 0),t([ze({attribute:!1})],Wa.prototype,"selectedDate",void 0),t([ze()],Wa.prototype,"view",void 0),t([ze()],Wa.prototype,"focusedTabIndex",void 0),t([nt("focusedTabIndex",{waitUntilFirstUpdate:!0})],Wa.prototype,"_handleFocusedTabIndexChange",null);const Ga=["January","February","March","April","May","June","July","August","September","October","November","December"];class Ja{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 s={value:"",isComplete:!1};Object.defineProperties(s,{value:{get:()=>this._state,enumerable:!0},isComplete:{get:()=>this._state.length>0&&!/[DMY]/.test(this._state),enumerable:!0}}),this.masked=s,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 s;null===(s=this.listeners.get(e))||void 0===s||s.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 s=this.placeholderStr[t];"D"!==s&&"M"!==s&&"Y"!==s||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(),s=this._state.split("");let i=-1;for(const e of t)if(/[DMY]/.test(s[e])){i=e;break}if(-1===i)return;s[i]=e,this._state=s.join(""),this.input.value=this._state;const a=this._findNextInputPos(i);this.input.setSelectionRange(a,a),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,s=this._state.split("");let i=t-1;for(;i>=0&&!/\d/.test(s[i]);)i--;i>=0&&(s[i]=this.placeholderStr[i],this._state=s.join(""),this.input.value=this._state,this.input.setSelectionRange(i,i),this._emit("accept"))}_deleteForward(){var e;const t=null!==(e=this.input.selectionStart)&&void 0!==e?e:0,s=this._state.split("");let i=t;for(;i<s.length&&!/\d/.test(s[i]);)i++;i<s.length&&(s[i]=this.placeholderStr[i],this._state=s.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 Xa=r`: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 Qa extends(ha(la)){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,s){return this._mixinSetValidity(e,t,s)}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,s=[this.hintText?`${this._controlId}Help`:"",this.invalid&&t?`${this._controlId}-invalid`:""].filter(Boolean).join(" ")||void 0;return ut`
|
|
600
600
|
<div
|
|
601
601
|
class="form-control-group ${We({disabled:this.disabled,readonly:this.readonly,"is-invalid":this.invalid&&e})}"
|
|
602
602
|
@click=${this._handleClick}
|