@ctrliq/quantic-components 1.61.4 → 1.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/combobox/index.d.ts +2 -0
- package/dist/combobox/index.js +48 -8
- package/dist/combobox/index.stories.d.ts +3 -0
- package/dist/combobox/index.stories.js +37 -0
- package/dist/field/combobox/combobox-field.component.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/quantic-components.js +49 -8
- package/dist/quantic-components.js.map +1 -1
- package/dist/quantic-components.min.js +3 -2
- package/dist/quantic-components.min.js.map +1 -1
- package/dist/types/combobox/index.d.ts +2 -0
- package/dist/types/combobox/index.stories.d.ts +3 -0
- package/package.json +1 -1
|
@@ -32399,7 +32399,7 @@ const{I:Ze}=re,Ge=()=>document.createComment(""),Ne=(e,t,i)=>{const n=e._$AA.par
|
|
|
32399
32399
|
* @license
|
|
32400
32400
|
* Copyright 2020 Google LLC
|
|
32401
32401
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
32402
|
-
*/const ct=()=>new rt;class rt{}const lt=new WeakMap,at=Fe(class extends st{render(e){return W}update(e,[t]){const i=t!==this.G;return i&&void 0!==this.G&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),W}rt(e){if(this.isConnected||(e=void 0),"function"==typeof this.G){const t=this.ht??globalThis;let i=lt.get(t);void 0===i&&(i=new WeakMap,lt.set(t,i)),void 0!==i.get(this.G)&&this.G.call(this.ht,void 0),i.set(this.G,e),void 0!==e&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return"function"==typeof this.G?lt.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),dt=Math.min,ut=Math.max,ht=Math.round,pt=Math.floor,gt=e=>({x:e,y:e}),vt={left:"right",right:"left",bottom:"top",top:"bottom"};function wt(e,t,i){return ut(e,dt(t,i))}function mt(e,t){return"function"==typeof e?e(t):e}function kt(e){return e.split("-")[0]}function xt(e){return e.split("-")[1]}function yt(e){return"x"===e?"y":"x"}function Lt(e){return"y"===e?"height":"width"}function It(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function ft(e){return yt(It(e))}function Ct(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const bt=["left","right"],Mt=["right","left"],qt=["top","bottom"],St=["bottom","top"];function Bt(e,t,i,n){const o=xt(e);let s=function(e,t,i){switch(e){case"top":case"bottom":return i?t?Mt:bt:t?bt:Mt;case"left":case"right":return t?qt:St;default:return[]}}(kt(e),"start"===i,n);return o&&(s=s.map(e=>e+"-"+o),t&&(s=s.concat(s.map(Ct)))),s}function At(e){const t=kt(e);return vt[t]+e.slice(t.length)}function Pt(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 jt(e){const{x:t,y:i,width:n,height:o}=e;return{width:n,height:o,top:i,left:t,right:t+n,bottom:i+o,x:t,y:i}}function zt(e,t,i){let{reference:n,floating:o}=e;const s=It(t),c=ft(t),r=Lt(c),l=kt(t),a="y"===s,d=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,h=n[r]/2-o[r]/2;let p;switch(l){case"top":p={x:d,y:n.y-o.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:u};break;case"left":p={x:n.x-o.width,y:u};break;default:p={x:n.x,y:n.y}}switch(xt(t)){case"start":p[c]-=h*(i&&a?-1:1);break;case"end":p[c]+=h*(i&&a?-1:1)}return p}async function Ht(e,t){var i;void 0===t&&(t={});const{x:n,y:o,platform:s,rects:c,elements:r,strategy:l}=e,{boundary:a="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=mt(t,e),g=Pt(p),v=r[h?"floating"===u?"reference":"floating":u],w=jt(await s.getClippingRect({element:null==(i=await(null==s.isElement?void 0:s.isElement(v)))||i?v:v.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(r.floating)),boundary:a,rootBoundary:d,strategy:l})),m="floating"===u?{x:n,y:o,width:c.floating.width,height:c.floating.height}:c.reference,k=await(null==s.getOffsetParent?void 0:s.getOffsetParent(r.floating)),x=await(null==s.isElement?void 0:s.isElement(k))&&await(null==s.getScale?void 0:s.getScale(k))||{x:1,y:1},y=jt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:r,rect:m,offsetParent:k,strategy:l}):m);return{top:(w.top-y.top+g.top)/x.y,bottom:(y.bottom-w.bottom+g.bottom)/x.y,left:(w.left-y.left+g.left)/x.x,right:(y.right-w.right+g.right)/x.x}}const Tt=new Set(["left","top"]);function Dt(){return"undefined"!=typeof window}function Vt(e){return Ot(e)?(e.nodeName||"").toLowerCase():"#document"}function Ft(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Rt(e){var t;return null==(t=(Ot(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Ot(e){return!!Dt()&&(e instanceof Node||e instanceof Ft(e).Node)}function $t(e){return!!Dt()&&(e instanceof Element||e instanceof Ft(e).Element)}function _t(e){return!!Dt()&&(e instanceof HTMLElement||e instanceof Ft(e).HTMLElement)}function Et(e){return!(!Dt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Ft(e).ShadowRoot)}function Ut(e){const{overflow:t,overflowX:i,overflowY:n,display:o}=ei(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&"inline"!==o&&"contents"!==o}function Zt(e){return/^(table|td|th)$/.test(Vt(e))}function Gt(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const Nt=/transform|translate|scale|rotate|perspective|filter/,Wt=/paint|layout|strict|content/,Xt=e=>!!e&&"none"!==e;let Kt;function Jt(e){const t=$t(e)?ei(e):e;return Xt(t.transform)||Xt(t.translate)||Xt(t.scale)||Xt(t.rotate)||Xt(t.perspective)||!Qt()&&(Xt(t.backdropFilter)||Xt(t.filter))||Nt.test(t.willChange||"")||Wt.test(t.contain||"")}function Qt(){return null==Kt&&(Kt="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Kt}function Yt(e){return/^(html|body|#document)$/.test(Vt(e))}function ei(e){return Ft(e).getComputedStyle(e)}function ti(e){return $t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ii(e){if("html"===Vt(e))return e;const t=e.assignedSlot||e.parentNode||Et(e)&&e.host||Rt(e);return Et(t)?t.host:t}function ni(e){const t=ii(e);return Yt(t)?e.ownerDocument?e.ownerDocument.body:e.body:_t(t)&&Ut(t)?t:ni(t)}function oi(e,t,i){var n;void 0===t&&(t=[]),void 0===i&&(i=!0);const o=ni(e),s=o===(null==(n=e.ownerDocument)?void 0:n.body),c=Ft(o);if(s){const e=si(c);return t.concat(c,c.visualViewport||[],Ut(o)?o:[],e&&i?oi(e):[])}return t.concat(o,oi(o,[],i))}function si(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ci(e){const t=ei(e);let i=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=_t(e),s=o?e.offsetWidth:i,c=o?e.offsetHeight:n,r=ht(i)!==s||ht(n)!==c;return r&&(i=s,n=c),{width:i,height:n,$:r}}function ri(e){return $t(e)?e:e.contextElement}function li(e){const t=ri(e);if(!_t(t))return gt(1);const i=t.getBoundingClientRect(),{width:n,height:o,$:s}=ci(t);let c=(s?ht(i.width):i.width)/n,r=(s?ht(i.height):i.height)/o;return c&&Number.isFinite(c)||(c=1),r&&Number.isFinite(r)||(r=1),{x:c,y:r}}const ai=gt(0);function di(e){const t=Ft(e);return Qt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ai}function ui(e,t,i,n){void 0===t&&(t=!1),void 0===i&&(i=!1);const o=e.getBoundingClientRect(),s=ri(e);let c=gt(1);t&&(n?$t(n)&&(c=li(n)):c=li(e));const r=function(e,t,i){return void 0===t&&(t=!1),!(!i||t&&i!==Ft(e))&&t}(s,i,n)?di(s):gt(0);let l=(o.left+r.x)/c.x,a=(o.top+r.y)/c.y,d=o.width/c.x,u=o.height/c.y;if(s){const e=Ft(s),t=n&&$t(n)?Ft(n):n;let i=e,o=si(i);for(;o&&n&&t!==i;){const e=li(o),t=o.getBoundingClientRect(),n=ei(o),s=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,c=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,a*=e.y,d*=e.x,u*=e.y,l+=s,a+=c,i=Ft(o),o=si(i)}}return jt({width:d,height:u,x:l,y:a})}function hi(e,t){const i=ti(e).scrollLeft;return t?t.left+i:ui(Rt(e)).left+i}function pi(e,t){const i=e.getBoundingClientRect();return{x:i.left+t.scrollLeft-hi(e,i),y:i.top+t.scrollTop}}function gi(e,t,i){let n;if("viewport"===t)n=function(e,t){const i=Ft(e),n=Rt(e),o=i.visualViewport;let s=n.clientWidth,c=n.clientHeight,r=0,l=0;if(o){s=o.width,c=o.height;const e=Qt();(!e||e&&"fixed"===t)&&(r=o.offsetLeft,l=o.offsetTop)}const a=hi(n);if(a<=0){const e=n.ownerDocument,t=e.body,i=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,c=Math.abs(n.clientWidth-t.clientWidth-o);c<=25&&(s-=c)}else a<=25&&(s+=a);return{width:s,height:c,x:r,y:l}}(e,i);else if("document"===t)n=function(e){const t=Rt(e),i=ti(e),n=e.ownerDocument.body,o=ut(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=ut(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let c=-i.scrollLeft+hi(e);const r=-i.scrollTop;return"rtl"===ei(n).direction&&(c+=ut(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:c,y:r}}(Rt(e));else if($t(t))n=function(e,t){const i=ui(e,!0,"fixed"===t),n=i.top+e.clientTop,o=i.left+e.clientLeft,s=_t(e)?li(e):gt(1);return{width:e.clientWidth*s.x,height:e.clientHeight*s.y,x:o*s.x,y:n*s.y}}(t,i);else{const i=di(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return jt(n)}function vi(e,t){const i=ii(e);return!(i===t||!$t(i)||Yt(i))&&("fixed"===ei(i).position||vi(i,t))}function wi(e,t,i){const n=_t(t),o=Rt(t),s="fixed"===i,c=ui(e,!0,s,t);let r={scrollLeft:0,scrollTop:0};const l=gt(0);function a(){l.x=hi(o)}if(n||!n&&!s)if(("body"!==Vt(t)||Ut(o))&&(r=ti(t)),n){const e=ui(t,!0,s,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&a();s&&!n&&o&&a();const d=!o||n||s?gt(0):pi(o,r);return{x:c.left+r.scrollLeft-l.x-d.x,y:c.top+r.scrollTop-l.y-d.y,width:c.width,height:c.height}}function mi(e){return"static"===ei(e).position}function ki(e,t){if(!_t(e)||"fixed"===ei(e).position)return null;if(t)return t(e);let i=e.offsetParent;return Rt(e)===i&&(i=i.ownerDocument.body),i}function xi(e,t){const i=Ft(e);if(Gt(e))return i;if(!_t(e)){let t=ii(e);for(;t&&!Yt(t);){if($t(t)&&!mi(t))return t;t=ii(t)}return i}let n=ki(e,t);for(;n&&Zt(n)&&mi(n);)n=ki(n,t);return n&&Yt(n)&&mi(n)&&!Jt(n)?i:n||function(e){let t=ii(e);for(;_t(t)&&!Yt(t);){if(Jt(t))return t;if(Gt(t))return null;t=ii(t)}return null}(e)||i}const yi={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:i,offsetParent:n,strategy:o}=e;const s="fixed"===o,c=Rt(n),r=!!t&&Gt(t.floating);if(n===c||r&&s)return i;let l={scrollLeft:0,scrollTop:0},a=gt(1);const d=gt(0),u=_t(n);if((u||!u&&!s)&&(("body"!==Vt(n)||Ut(c))&&(l=ti(n)),u)){const e=ui(n);a=li(n),d.x=e.x+n.clientLeft,d.y=e.y+n.clientTop}const h=!c||u||s?gt(0):pi(c,l);return{width:i.width*a.x,height:i.height*a.y,x:i.x*a.x-l.scrollLeft*a.x+d.x+h.x,y:i.y*a.y-l.scrollTop*a.y+d.y+h.y}},getDocumentElement:Rt,getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:n,strategy:o}=e;const s=[..."clippingAncestors"===i?Gt(t)?[]:function(e,t){const i=t.get(e);if(i)return i;let n=oi(e,[],!1).filter(e=>$t(e)&&"body"!==Vt(e)),o=null;const s="fixed"===ei(e).position;let c=s?ii(e):e;for(;$t(c)&&!Yt(c);){const t=ei(c),i=Jt(c);i||"fixed"!==t.position||(o=null),(s?!i&&!o:!i&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||Ut(c)&&!i&&vi(e,c))?n=n.filter(e=>e!==c):o=t,c=ii(c)}return t.set(e,n),n}(t,this._c):[].concat(i),n],c=gi(t,s[0],o);let r=c.top,l=c.right,a=c.bottom,d=c.left;for(let e=1;e<s.length;e++){const i=gi(t,s[e],o);r=ut(i.top,r),l=dt(i.right,l),a=dt(i.bottom,a),d=ut(i.left,d)}return{width:l-d,height:a-r,x:d,y:r}},getOffsetParent:xi,getElementRects:async function(e){const t=this.getOffsetParent||xi,i=this.getDimensions,n=await i(e.floating);return{reference:wi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:i}=ci(e);return{width:t,height:i}},getScale:li,isElement:$t,isRTL:function(e){return"rtl"===ei(e).direction}};function Li(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ii(e,t,i,n){void 0===n&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:c="function"==typeof ResizeObserver,layoutShift:r="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,a=ri(e),d=o||s?[...a?oi(a):[],...t?oi(t):[]]:[];d.forEach(e=>{o&&e.addEventListener("scroll",i,{passive:!0}),s&&e.addEventListener("resize",i)});const u=a&&r?function(e,t){let i,n=null;const o=Rt(e);function s(){var e;clearTimeout(i),null==(e=n)||e.disconnect(),n=null}return function c(r,l){void 0===r&&(r=!1),void 0===l&&(l=1),s();const a=e.getBoundingClientRect(),{left:d,top:u,width:h,height:p}=a;if(r||t(),!h||!p)return;const g={rootMargin:-pt(u)+"px "+-pt(o.clientWidth-(d+h))+"px "+-pt(o.clientHeight-(u+p))+"px "+-pt(d)+"px",threshold:ut(0,dt(1,l))||1};let v=!0;function w(t){const n=t[0].intersectionRatio;if(n!==l){if(!v)return c();n?c(!1,n):i=setTimeout(()=>{c(!1,1e-7)},1e3)}1!==n||Li(a,e.getBoundingClientRect())||c(),v=!1}try{n=new IntersectionObserver(w,{...g,root:o.ownerDocument})}catch(e){n=new IntersectionObserver(w,g)}n.observe(e)}(!0),s}(a,i):null;let h,p=-1,g=null;c&&(g=new ResizeObserver(e=>{let[n]=e;n&&n.target===a&&g&&t&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=g)||e.observe(t)})),i()}),a&&!l&&g.observe(a),t&&g.observe(t));let v=l?ui(e):null;return l&&function t(){const n=ui(e);v&&!Li(v,n)&&i();v=n,h=requestAnimationFrame(t)}(),i(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",i),s&&e.removeEventListener("resize",i)}),null==u||u(),null==(e=g)||e.disconnect(),g=null,l&&cancelAnimationFrame(h)}}const fi=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var i,n;const{x:o,y:s,placement:c,middlewareData:r}=t,l=await async function(e,t){const{placement:i,platform:n,elements:o}=e,s=await(null==n.isRTL?void 0:n.isRTL(o.floating)),c=kt(i),r=xt(i),l="y"===It(i),a=Tt.has(c)?-1:1,d=s&&l?-1:1,u=mt(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:g}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return r&&"number"==typeof g&&(p="end"===r?-1*g:g),l?{x:p*d,y:h*a}:{x:h*a,y:p*d}}(t,e);return c===(null==(i=r.offset)?void 0:i.placement)&&null!=(n=r.arrow)&&n.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:c}}}}},Ci=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:n,placement:o,platform:s}=t,{mainAxis:c=!0,crossAxis:r=!1,limiter:l={fn:e=>{let{x:t,y:i}=e;return{x:t,y:i}}},...a}=mt(e,t),d={x:i,y:n},u=await s.detectOverflow(t,a),h=It(kt(o)),p=yt(h);let g=d[p],v=d[h];if(c){const e="y"===p?"bottom":"right";g=wt(g+u["y"===p?"top":"left"],g,g-u[e])}if(r){const e="y"===h?"bottom":"right";v=wt(v+u["y"===h?"top":"left"],v,v-u[e])}const w=l.fn({...t,[p]:g,[h]:v});return{...w,data:{x:w.x-i,y:w.y-n,enabled:{[p]:c,[h]:r}}}}}},bi=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var i,n;const{placement:o,middlewareData:s,rects:c,initialPlacement:r,platform:l,elements:a}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...w}=mt(e,t);if(null!=(i=s.arrow)&&i.alignmentOffset)return{};const m=kt(o),k=It(r),x=kt(r)===r,y=await(null==l.isRTL?void 0:l.isRTL(a.floating)),L=h||(x||!v?[At(r)]:function(e){const t=At(e);return[Ct(e),t,Ct(t)]}(r)),I="none"!==g;!h&&I&&L.push(...Bt(r,v,g,y));const f=[r,...L],C=await l.detectOverflow(t,w),b=[];let M=(null==(n=s.flip)?void 0:n.overflows)||[];if(d&&b.push(C[m]),u){const e=function(e,t,i){void 0===i&&(i=!1);const n=xt(e),o=ft(e),s=Lt(o);let c="x"===o?n===(i?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=At(c)),[c,At(c)]}(o,c,y);b.push(C[e[0]],C[e[1]])}if(M=[...M,{placement:o,overflows:b}],!b.every(e=>e<=0)){var q,S;const e=((null==(q=s.flip)?void 0:q.index)||0)+1,t=f[e];if(t){if(!("alignment"===u&&k!==It(t))||M.every(e=>It(e.placement)!==k||e.overflows[0]>0))return{data:{index:e,overflows:M},reset:{placement:t}}}let i=null==(S=M.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:S.placement;if(!i)switch(p){case"bestFit":{var B;const e=null==(B=M.filter(e=>{if(I){const t=It(e.placement);return t===k||"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:B[0];e&&(i=e);break}case"initialPlacement":i=r}if(o!==i)return{reset:{placement:i}}}return{}}}},Mi=e=>({name:"arrow",options:e,async fn(t){const{x:i,y:n,placement:o,rects:s,platform:c,elements:r,middlewareData:l}=t,{element:a,padding:d=0}=mt(e,t)||{};if(null==a)return{};const u=Pt(d),h={x:i,y:n},p=ft(o),g=Lt(p),v=await c.getDimensions(a),w="y"===p,m=w?"top":"left",k=w?"bottom":"right",x=w?"clientHeight":"clientWidth",y=s.reference[g]+s.reference[p]-h[p]-s.floating[g],L=h[p]-s.reference[p],I=await(null==c.getOffsetParent?void 0:c.getOffsetParent(a));let f=I?I[x]:0;f&&await(null==c.isElement?void 0:c.isElement(I))||(f=r.floating[x]||s.floating[g]);const C=y/2-L/2,b=f/2-v[g]/2-1,M=dt(u[m],b),q=dt(u[k],b),S=M,B=f-v[g]-q,A=f/2-v[g]/2+C,P=wt(S,A,B),j=!l.arrow&&null!=xt(o)&&A!==P&&s.reference[g]/2-(A<S?M:q)-v[g]/2<0,z=j?A<S?A-S:A-B:0;return{[p]:h[p]+z,data:{[p]:P,centerOffset:A-P-z,...j&&{alignmentOffset:z}},reset:j}}}),qi=(e,t,i)=>{const n=new Map,o={platform:yi,...i},s={...o.platform,_c:n};return(async(e,t,i)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:c}=i,r=c.detectOverflow?c:{...c,detectOverflow:Ht},l=await(null==c.isRTL?void 0:c.isRTL(t));let a=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=zt(a,n,l),h=n,p=0;const g={};for(let i=0;i<s.length;i++){const v=s[i];if(!v)continue;const{name:w,fn:m}=v,{x:k,y:x,data:y,reset:L}=await m({x:d,y:u,initialPlacement:n,placement:h,strategy:o,middlewareData:g,rects:a,platform:r,elements:{reference:e,floating:t}});d=null!=k?k:d,u=null!=x?x:u,g[w]={...g[w],...y},L&&p<50&&(p++,"object"==typeof L&&(L.placement&&(h=L.placement),L.rects&&(a=!0===L.rects?await c.getElementRects({reference:e,floating:t,strategy:o}):L.rects),({x:d,y:u}=zt(a,h,l))),i=-1)}return{x:d,y:u,placement:h,strategy:o,middlewareData:g}})(e,t,{...o,platform:s})};function Si(e){class i extends e{constructor(){super(...arguments),this.ariaLabel=null,this.ariaDescription=null,this.ariaInvalid=null}getA11yAttributes(e){const t=e?.label??this.ariaLabel,i=e?.description??this.ariaDescription,n=e?.invalid??"true"===this.ariaInvalid;return{label:$e(t||void 0),description:$e(i||void 0),invalid:$e(n?"true":void 0)}}}return t([Le({type:"string",attribute:"aria-label",description:"Accessible label for the component (aria-label)."})],i.prototype,"ariaLabel",void 0),t([Le({type:"string",attribute:"aria-description",description:"Accessible description bound directly to aria-description."})],i.prototype,"ariaDescription",void 0),t([Le({type:"string",attribute:"aria-invalid",description:"Marks the component invalid for assistive technologies (aria-invalid)."})],i.prototype,"ariaInvalid",void 0),i}const Bi={Gray:"gray",Brand:"brand",Error:"error",Warning:"warning",Success:"success",GrayBlue:"gray-blue",BlueLight:"blue-light",Blue:"blue",Indigo:"indigo",Purple:"purple",Pink:"pink",Orange:"orange"},Ai=["gray","brand","error","warning","success","gray-blue","blue-light","blue","indigo","purple","pink","orange"],Pi="24rem",ji="36rem",zi="48rem",Hi="64rem",Ti="75rem",Di="96rem";function Vi(e,t,i){return Math.min(Math.max(e,t),i)}function Fi(e){return Ai.map(t=>`.color--${t} {\n ${e(t)}\n}`).join("\n")}function Ri(e){const t="undefined"!=typeof crypto?crypto.randomUUID():Math.random().toString(36).substring(2);return e?`${e}-${t}`:t}const Oi={ExtraSmall:"xs",Small:"sm",Medium:"md",Large:"lg"};e.LucideIconChevronDown.ensureDefined(),e.LucideIconCircleAlert.ensureDefined(),e.Combobox=class extends(Si(fe)){constructor(){super(),this.listboxId=Ri("combobox-listbox"),this.value="",this.name="",this.placeholder="",this.options=[],this.size=Oi.Medium,this.disabled=!1,this.required=!1,this.invalid=!1,this.emptyLabel="No results",this._open=!1,this._inputValue="",this._activeIndex=-1,this._inputRef=ct(),this._listboxRef=ct(),this.internals=this.attachInternals()}updated(e){if(e.has("value")||e.has("options")){const e=this.options.find(e=>e.value===this.value);this._inputValue=e?e.label:""}e.has("value")&&this.internals.setFormValue(this.value),(e.has("value")||e.has("required"))&&this.updateValidity(),e.has("options")&&this._open&&(this._activeIndex=-1),e.has("_activeIndex")&&this._activeIndex>=0&&this.shadowRoot?.querySelectorAll('[role="option"]')[this._activeIndex]?.scrollIntoView({block:"nearest"})}get filteredOptions(){if(!this._inputValue)return this.options;const e=this.filterFn??((e,t)=>e.label.toLowerCase().includes(t.toLowerCase()));return this.options.filter(t=>e(t,this._inputValue))}firstNavigableIndex(){return this.filteredOptions.findIndex(e=>!e.disabled)}lastNavigableIndex(){const e=this.filteredOptions;for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}nextNavigableIndex(e,t){const i=this.filteredOptions;let n=e+t;for(;n>=0&&n<i.length;){if(!i[n].disabled)return n;n+=t}return e}async openList(){this._open||this.disabled||(this._open=!0,this._activeIndex=-1,await this.updateComplete,this.positionListbox())}closeList(){if(!this._open)return;this._open=!1,this._activeIndex=-1,this.cleanup?.(),this.cleanup=void 0;const e=this.options.find(e=>e.value===this.value);this._inputValue=e?.label??""}positionListbox(){const e=this._listboxRef.value;e&&(this.cleanup=Ii(this,e,async()=>{if(!e)return;const{x:t,y:i}=await qi(this,e,{placement:"bottom-start",middleware:[fi(4),bi(),Ci({padding:8})],strategy:"absolute"});Object.assign(e.style,{left:`${t}px`,top:`${i}px`,width:`${this.getBoundingClientRect().width}px`})}))}selectOption(e){this.value=e.value,this._inputValue=e.label,this.internals.setFormValue(e.value),this._open=!1,this._activeIndex=-1,this.cleanup?.(),this.cleanup=void 0,this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this.value},bubbles:!0,composed:!0})),this._inputRef.value?.focus()}handleInput(e){const t=e.target;this._inputValue=t.value,this._activeIndex=-1,this._open||this.openList(),this.dispatchEvent(new CustomEvent("input-changed",{detail:{value:this._inputValue},bubbles:!0,composed:!0}))}handleKeyDown(e){switch(e.key){case"ArrowDown":e.preventDefault(),this._open?this._activeIndex=this.nextNavigableIndex(this._activeIndex,1):this.openList().then(()=>{this._activeIndex=this.firstNavigableIndex()});break;case"ArrowUp":if(!this._open)return;e.preventDefault(),this._activeIndex=this.nextNavigableIndex(this._activeIndex,-1);break;case"Home":if(!this._open)return;e.preventDefault(),this._activeIndex=this.firstNavigableIndex();break;case"End":if(!this._open)return;e.preventDefault(),this._activeIndex=this.lastNavigableIndex();break;case"Enter":if(this._open&&this._activeIndex>=0){const t=this.filteredOptions[this._activeIndex];t&&!t.disabled&&(e.preventDefault(),this.selectOption(t))}break;case"Escape":e.preventDefault(),this.closeList();break;case"Tab":this.closeList()}}handleBlur(){this.closeList(),this.dispatchEvent(new Event("blur",{bubbles:!0,composed:!0}))}handleFocus(){this.dispatchEvent(new Event("focus",{bubbles:!0,composed:!0}))}handleChevronMouseDown(e){e.preventDefault(),this._open?this.closeList():(this._inputRef.value?.focus(),this.openList())}formResetCallback(){this.value="",this._inputValue="",this.internals.setFormValue("")}formStateRestoreCallback(e){this.value=e,this.internals.setFormValue(e);const t=this.options.find(t=>t.value===e);this._inputValue=t?.label??""}formDisabledCallback(e){this.disabled=e}disconnectedCallback(){super.disconnectedCallback(),this.cleanup?.()}updateValidity(){const e=this._inputRef.value;e&&this.internals.setValidity(e.validity,e.validationMessage,e)}get activeDescendant(){if(this._open&&!(this._activeIndex<0))return`${this.listboxId}-opt-${this._activeIndex}`}render(){const e=Oe({main:!0,[`size--${this.size}`]:!0}),t=Oe({listbox:!0,"is-open":this._open,[`size--${this.size}`]:!0}),i=this.getA11yAttributes({invalid:this.invalid}),n=this.filteredOptions;return Z`
|
|
32402
|
+
*/const ct=()=>new rt;class rt{}const lt=new WeakMap,at=Fe(class extends st{render(e){return W}update(e,[t]){const i=t!==this.G;return i&&void 0!==this.G&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),W}rt(e){if(this.isConnected||(e=void 0),"function"==typeof this.G){const t=this.ht??globalThis;let i=lt.get(t);void 0===i&&(i=new WeakMap,lt.set(t,i)),void 0!==i.get(this.G)&&this.G.call(this.ht,void 0),i.set(this.G,e),void 0!==e&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return"function"==typeof this.G?lt.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),dt=Math.min,ut=Math.max,ht=Math.round,pt=Math.floor,gt=e=>({x:e,y:e}),vt={left:"right",right:"left",bottom:"top",top:"bottom"};function wt(e,t,i){return ut(e,dt(t,i))}function mt(e,t){return"function"==typeof e?e(t):e}function kt(e){return e.split("-")[0]}function xt(e){return e.split("-")[1]}function yt(e){return"x"===e?"y":"x"}function Lt(e){return"y"===e?"height":"width"}function It(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function ft(e){return yt(It(e))}function Ct(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const bt=["left","right"],Mt=["right","left"],qt=["top","bottom"],St=["bottom","top"];function Bt(e,t,i,n){const o=xt(e);let s=function(e,t,i){switch(e){case"top":case"bottom":return i?t?Mt:bt:t?bt:Mt;case"left":case"right":return t?qt:St;default:return[]}}(kt(e),"start"===i,n);return o&&(s=s.map(e=>e+"-"+o),t&&(s=s.concat(s.map(Ct)))),s}function At(e){const t=kt(e);return vt[t]+e.slice(t.length)}function Pt(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 jt(e){const{x:t,y:i,width:n,height:o}=e;return{width:n,height:o,top:i,left:t,right:t+n,bottom:i+o,x:t,y:i}}function zt(e,t,i){let{reference:n,floating:o}=e;const s=It(t),c=ft(t),r=Lt(c),l=kt(t),a="y"===s,d=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,h=n[r]/2-o[r]/2;let p;switch(l){case"top":p={x:d,y:n.y-o.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:u};break;case"left":p={x:n.x-o.width,y:u};break;default:p={x:n.x,y:n.y}}switch(xt(t)){case"start":p[c]-=h*(i&&a?-1:1);break;case"end":p[c]+=h*(i&&a?-1:1)}return p}async function Ht(e,t){var i;void 0===t&&(t={});const{x:n,y:o,platform:s,rects:c,elements:r,strategy:l}=e,{boundary:a="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:p=0}=mt(t,e),g=Pt(p),v=r[h?"floating"===u?"reference":"floating":u],w=jt(await s.getClippingRect({element:null==(i=await(null==s.isElement?void 0:s.isElement(v)))||i?v:v.contextElement||await(null==s.getDocumentElement?void 0:s.getDocumentElement(r.floating)),boundary:a,rootBoundary:d,strategy:l})),m="floating"===u?{x:n,y:o,width:c.floating.width,height:c.floating.height}:c.reference,k=await(null==s.getOffsetParent?void 0:s.getOffsetParent(r.floating)),x=await(null==s.isElement?void 0:s.isElement(k))&&await(null==s.getScale?void 0:s.getScale(k))||{x:1,y:1},y=jt(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:r,rect:m,offsetParent:k,strategy:l}):m);return{top:(w.top-y.top+g.top)/x.y,bottom:(y.bottom-w.bottom+g.bottom)/x.y,left:(w.left-y.left+g.left)/x.x,right:(y.right-w.right+g.right)/x.x}}const Tt=new Set(["left","top"]);function Dt(){return"undefined"!=typeof window}function Vt(e){return Ot(e)?(e.nodeName||"").toLowerCase():"#document"}function Ft(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Rt(e){var t;return null==(t=(Ot(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Ot(e){return!!Dt()&&(e instanceof Node||e instanceof Ft(e).Node)}function $t(e){return!!Dt()&&(e instanceof Element||e instanceof Ft(e).Element)}function _t(e){return!!Dt()&&(e instanceof HTMLElement||e instanceof Ft(e).HTMLElement)}function Et(e){return!(!Dt()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Ft(e).ShadowRoot)}function Ut(e){const{overflow:t,overflowX:i,overflowY:n,display:o}=ei(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&"inline"!==o&&"contents"!==o}function Zt(e){return/^(table|td|th)$/.test(Vt(e))}function Gt(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const Nt=/transform|translate|scale|rotate|perspective|filter/,Wt=/paint|layout|strict|content/,Xt=e=>!!e&&"none"!==e;let Kt;function Jt(e){const t=$t(e)?ei(e):e;return Xt(t.transform)||Xt(t.translate)||Xt(t.scale)||Xt(t.rotate)||Xt(t.perspective)||!Qt()&&(Xt(t.backdropFilter)||Xt(t.filter))||Nt.test(t.willChange||"")||Wt.test(t.contain||"")}function Qt(){return null==Kt&&(Kt="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Kt}function Yt(e){return/^(html|body|#document)$/.test(Vt(e))}function ei(e){return Ft(e).getComputedStyle(e)}function ti(e){return $t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ii(e){if("html"===Vt(e))return e;const t=e.assignedSlot||e.parentNode||Et(e)&&e.host||Rt(e);return Et(t)?t.host:t}function ni(e){const t=ii(e);return Yt(t)?e.ownerDocument?e.ownerDocument.body:e.body:_t(t)&&Ut(t)?t:ni(t)}function oi(e,t,i){var n;void 0===t&&(t=[]),void 0===i&&(i=!0);const o=ni(e),s=o===(null==(n=e.ownerDocument)?void 0:n.body),c=Ft(o);if(s){const e=si(c);return t.concat(c,c.visualViewport||[],Ut(o)?o:[],e&&i?oi(e):[])}return t.concat(o,oi(o,[],i))}function si(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ci(e){const t=ei(e);let i=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=_t(e),s=o?e.offsetWidth:i,c=o?e.offsetHeight:n,r=ht(i)!==s||ht(n)!==c;return r&&(i=s,n=c),{width:i,height:n,$:r}}function ri(e){return $t(e)?e:e.contextElement}function li(e){const t=ri(e);if(!_t(t))return gt(1);const i=t.getBoundingClientRect(),{width:n,height:o,$:s}=ci(t);let c=(s?ht(i.width):i.width)/n,r=(s?ht(i.height):i.height)/o;return c&&Number.isFinite(c)||(c=1),r&&Number.isFinite(r)||(r=1),{x:c,y:r}}const ai=gt(0);function di(e){const t=Ft(e);return Qt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ai}function ui(e,t,i,n){void 0===t&&(t=!1),void 0===i&&(i=!1);const o=e.getBoundingClientRect(),s=ri(e);let c=gt(1);t&&(n?$t(n)&&(c=li(n)):c=li(e));const r=function(e,t,i){return void 0===t&&(t=!1),!(!i||t&&i!==Ft(e))&&t}(s,i,n)?di(s):gt(0);let l=(o.left+r.x)/c.x,a=(o.top+r.y)/c.y,d=o.width/c.x,u=o.height/c.y;if(s){const e=Ft(s),t=n&&$t(n)?Ft(n):n;let i=e,o=si(i);for(;o&&n&&t!==i;){const e=li(o),t=o.getBoundingClientRect(),n=ei(o),s=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,c=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,a*=e.y,d*=e.x,u*=e.y,l+=s,a+=c,i=Ft(o),o=si(i)}}return jt({width:d,height:u,x:l,y:a})}function hi(e,t){const i=ti(e).scrollLeft;return t?t.left+i:ui(Rt(e)).left+i}function pi(e,t){const i=e.getBoundingClientRect();return{x:i.left+t.scrollLeft-hi(e,i),y:i.top+t.scrollTop}}function gi(e,t,i){let n;if("viewport"===t)n=function(e,t){const i=Ft(e),n=Rt(e),o=i.visualViewport;let s=n.clientWidth,c=n.clientHeight,r=0,l=0;if(o){s=o.width,c=o.height;const e=Qt();(!e||e&&"fixed"===t)&&(r=o.offsetLeft,l=o.offsetTop)}const a=hi(n);if(a<=0){const e=n.ownerDocument,t=e.body,i=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(i.marginLeft)+parseFloat(i.marginRight)||0,c=Math.abs(n.clientWidth-t.clientWidth-o);c<=25&&(s-=c)}else a<=25&&(s+=a);return{width:s,height:c,x:r,y:l}}(e,i);else if("document"===t)n=function(e){const t=Rt(e),i=ti(e),n=e.ownerDocument.body,o=ut(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=ut(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let c=-i.scrollLeft+hi(e);const r=-i.scrollTop;return"rtl"===ei(n).direction&&(c+=ut(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:c,y:r}}(Rt(e));else if($t(t))n=function(e,t){const i=ui(e,!0,"fixed"===t),n=i.top+e.clientTop,o=i.left+e.clientLeft,s=_t(e)?li(e):gt(1);return{width:e.clientWidth*s.x,height:e.clientHeight*s.y,x:o*s.x,y:n*s.y}}(t,i);else{const i=di(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return jt(n)}function vi(e,t){const i=ii(e);return!(i===t||!$t(i)||Yt(i))&&("fixed"===ei(i).position||vi(i,t))}function wi(e,t,i){const n=_t(t),o=Rt(t),s="fixed"===i,c=ui(e,!0,s,t);let r={scrollLeft:0,scrollTop:0};const l=gt(0);function a(){l.x=hi(o)}if(n||!n&&!s)if(("body"!==Vt(t)||Ut(o))&&(r=ti(t)),n){const e=ui(t,!0,s,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&a();s&&!n&&o&&a();const d=!o||n||s?gt(0):pi(o,r);return{x:c.left+r.scrollLeft-l.x-d.x,y:c.top+r.scrollTop-l.y-d.y,width:c.width,height:c.height}}function mi(e){return"static"===ei(e).position}function ki(e,t){if(!_t(e)||"fixed"===ei(e).position)return null;if(t)return t(e);let i=e.offsetParent;return Rt(e)===i&&(i=i.ownerDocument.body),i}function xi(e,t){const i=Ft(e);if(Gt(e))return i;if(!_t(e)){let t=ii(e);for(;t&&!Yt(t);){if($t(t)&&!mi(t))return t;t=ii(t)}return i}let n=ki(e,t);for(;n&&Zt(n)&&mi(n);)n=ki(n,t);return n&&Yt(n)&&mi(n)&&!Jt(n)?i:n||function(e){let t=ii(e);for(;_t(t)&&!Yt(t);){if(Jt(t))return t;if(Gt(t))return null;t=ii(t)}return null}(e)||i}const yi={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:i,offsetParent:n,strategy:o}=e;const s="fixed"===o,c=Rt(n),r=!!t&&Gt(t.floating);if(n===c||r&&s)return i;let l={scrollLeft:0,scrollTop:0},a=gt(1);const d=gt(0),u=_t(n);if((u||!u&&!s)&&(("body"!==Vt(n)||Ut(c))&&(l=ti(n)),u)){const e=ui(n);a=li(n),d.x=e.x+n.clientLeft,d.y=e.y+n.clientTop}const h=!c||u||s?gt(0):pi(c,l);return{width:i.width*a.x,height:i.height*a.y,x:i.x*a.x-l.scrollLeft*a.x+d.x+h.x,y:i.y*a.y-l.scrollTop*a.y+d.y+h.y}},getDocumentElement:Rt,getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:n,strategy:o}=e;const s=[..."clippingAncestors"===i?Gt(t)?[]:function(e,t){const i=t.get(e);if(i)return i;let n=oi(e,[],!1).filter(e=>$t(e)&&"body"!==Vt(e)),o=null;const s="fixed"===ei(e).position;let c=s?ii(e):e;for(;$t(c)&&!Yt(c);){const t=ei(c),i=Jt(c);i||"fixed"!==t.position||(o=null),(s?!i&&!o:!i&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||Ut(c)&&!i&&vi(e,c))?n=n.filter(e=>e!==c):o=t,c=ii(c)}return t.set(e,n),n}(t,this._c):[].concat(i),n],c=gi(t,s[0],o);let r=c.top,l=c.right,a=c.bottom,d=c.left;for(let e=1;e<s.length;e++){const i=gi(t,s[e],o);r=ut(i.top,r),l=dt(i.right,l),a=dt(i.bottom,a),d=ut(i.left,d)}return{width:l-d,height:a-r,x:d,y:r}},getOffsetParent:xi,getElementRects:async function(e){const t=this.getOffsetParent||xi,i=this.getDimensions,n=await i(e.floating);return{reference:wi(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:i}=ci(e);return{width:t,height:i}},getScale:li,isElement:$t,isRTL:function(e){return"rtl"===ei(e).direction}};function Li(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ii(e,t,i,n){void 0===n&&(n={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:c="function"==typeof ResizeObserver,layoutShift:r="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,a=ri(e),d=o||s?[...a?oi(a):[],...t?oi(t):[]]:[];d.forEach(e=>{o&&e.addEventListener("scroll",i,{passive:!0}),s&&e.addEventListener("resize",i)});const u=a&&r?function(e,t){let i,n=null;const o=Rt(e);function s(){var e;clearTimeout(i),null==(e=n)||e.disconnect(),n=null}return function c(r,l){void 0===r&&(r=!1),void 0===l&&(l=1),s();const a=e.getBoundingClientRect(),{left:d,top:u,width:h,height:p}=a;if(r||t(),!h||!p)return;const g={rootMargin:-pt(u)+"px "+-pt(o.clientWidth-(d+h))+"px "+-pt(o.clientHeight-(u+p))+"px "+-pt(d)+"px",threshold:ut(0,dt(1,l))||1};let v=!0;function w(t){const n=t[0].intersectionRatio;if(n!==l){if(!v)return c();n?c(!1,n):i=setTimeout(()=>{c(!1,1e-7)},1e3)}1!==n||Li(a,e.getBoundingClientRect())||c(),v=!1}try{n=new IntersectionObserver(w,{...g,root:o.ownerDocument})}catch(e){n=new IntersectionObserver(w,g)}n.observe(e)}(!0),s}(a,i):null;let h,p=-1,g=null;c&&(g=new ResizeObserver(e=>{let[n]=e;n&&n.target===a&&g&&t&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=g)||e.observe(t)})),i()}),a&&!l&&g.observe(a),t&&g.observe(t));let v=l?ui(e):null;return l&&function t(){const n=ui(e);v&&!Li(v,n)&&i();v=n,h=requestAnimationFrame(t)}(),i(),()=>{var e;d.forEach(e=>{o&&e.removeEventListener("scroll",i),s&&e.removeEventListener("resize",i)}),null==u||u(),null==(e=g)||e.disconnect(),g=null,l&&cancelAnimationFrame(h)}}const fi=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var i,n;const{x:o,y:s,placement:c,middlewareData:r}=t,l=await async function(e,t){const{placement:i,platform:n,elements:o}=e,s=await(null==n.isRTL?void 0:n.isRTL(o.floating)),c=kt(i),r=xt(i),l="y"===It(i),a=Tt.has(c)?-1:1,d=s&&l?-1:1,u=mt(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:g}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return r&&"number"==typeof g&&(p="end"===r?-1*g:g),l?{x:p*d,y:h*a}:{x:h*a,y:p*d}}(t,e);return c===(null==(i=r.offset)?void 0:i.placement)&&null!=(n=r.arrow)&&n.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:c}}}}},Ci=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:n,placement:o,platform:s}=t,{mainAxis:c=!0,crossAxis:r=!1,limiter:l={fn:e=>{let{x:t,y:i}=e;return{x:t,y:i}}},...a}=mt(e,t),d={x:i,y:n},u=await s.detectOverflow(t,a),h=It(kt(o)),p=yt(h);let g=d[p],v=d[h];if(c){const e="y"===p?"bottom":"right";g=wt(g+u["y"===p?"top":"left"],g,g-u[e])}if(r){const e="y"===h?"bottom":"right";v=wt(v+u["y"===h?"top":"left"],v,v-u[e])}const w=l.fn({...t,[p]:g,[h]:v});return{...w,data:{x:w.x-i,y:w.y-n,enabled:{[p]:c,[h]:r}}}}}},bi=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var i,n;const{placement:o,middlewareData:s,rects:c,initialPlacement:r,platform:l,elements:a}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...w}=mt(e,t);if(null!=(i=s.arrow)&&i.alignmentOffset)return{};const m=kt(o),k=It(r),x=kt(r)===r,y=await(null==l.isRTL?void 0:l.isRTL(a.floating)),L=h||(x||!v?[At(r)]:function(e){const t=At(e);return[Ct(e),t,Ct(t)]}(r)),I="none"!==g;!h&&I&&L.push(...Bt(r,v,g,y));const f=[r,...L],C=await l.detectOverflow(t,w),b=[];let M=(null==(n=s.flip)?void 0:n.overflows)||[];if(d&&b.push(C[m]),u){const e=function(e,t,i){void 0===i&&(i=!1);const n=xt(e),o=ft(e),s=Lt(o);let c="x"===o?n===(i?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=At(c)),[c,At(c)]}(o,c,y);b.push(C[e[0]],C[e[1]])}if(M=[...M,{placement:o,overflows:b}],!b.every(e=>e<=0)){var q,S;const e=((null==(q=s.flip)?void 0:q.index)||0)+1,t=f[e];if(t){if(!("alignment"===u&&k!==It(t))||M.every(e=>It(e.placement)!==k||e.overflows[0]>0))return{data:{index:e,overflows:M},reset:{placement:t}}}let i=null==(S=M.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:S.placement;if(!i)switch(p){case"bestFit":{var B;const e=null==(B=M.filter(e=>{if(I){const t=It(e.placement);return t===k||"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:B[0];e&&(i=e);break}case"initialPlacement":i=r}if(o!==i)return{reset:{placement:i}}}return{}}}},Mi=e=>({name:"arrow",options:e,async fn(t){const{x:i,y:n,placement:o,rects:s,platform:c,elements:r,middlewareData:l}=t,{element:a,padding:d=0}=mt(e,t)||{};if(null==a)return{};const u=Pt(d),h={x:i,y:n},p=ft(o),g=Lt(p),v=await c.getDimensions(a),w="y"===p,m=w?"top":"left",k=w?"bottom":"right",x=w?"clientHeight":"clientWidth",y=s.reference[g]+s.reference[p]-h[p]-s.floating[g],L=h[p]-s.reference[p],I=await(null==c.getOffsetParent?void 0:c.getOffsetParent(a));let f=I?I[x]:0;f&&await(null==c.isElement?void 0:c.isElement(I))||(f=r.floating[x]||s.floating[g]);const C=y/2-L/2,b=f/2-v[g]/2-1,M=dt(u[m],b),q=dt(u[k],b),S=M,B=f-v[g]-q,A=f/2-v[g]/2+C,P=wt(S,A,B),j=!l.arrow&&null!=xt(o)&&A!==P&&s.reference[g]/2-(A<S?M:q)-v[g]/2<0,z=j?A<S?A-S:A-B:0;return{[p]:h[p]+z,data:{[p]:P,centerOffset:A-P-z,...j&&{alignmentOffset:z}},reset:j}}}),qi=(e,t,i)=>{const n=new Map,o={platform:yi,...i},s={...o.platform,_c:n};return(async(e,t,i)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:c}=i,r=c.detectOverflow?c:{...c,detectOverflow:Ht},l=await(null==c.isRTL?void 0:c.isRTL(t));let a=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=zt(a,n,l),h=n,p=0;const g={};for(let i=0;i<s.length;i++){const v=s[i];if(!v)continue;const{name:w,fn:m}=v,{x:k,y:x,data:y,reset:L}=await m({x:d,y:u,initialPlacement:n,placement:h,strategy:o,middlewareData:g,rects:a,platform:r,elements:{reference:e,floating:t}});d=null!=k?k:d,u=null!=x?x:u,g[w]={...g[w],...y},L&&p<50&&(p++,"object"==typeof L&&(L.placement&&(h=L.placement),L.rects&&(a=!0===L.rects?await c.getElementRects({reference:e,floating:t,strategy:o}):L.rects),({x:d,y:u}=zt(a,h,l))),i=-1)}return{x:d,y:u,placement:h,strategy:o,middlewareData:g}})(e,t,{...o,platform:s})};function Si(e){class i extends e{constructor(){super(...arguments),this.ariaLabel=null,this.ariaDescription=null,this.ariaInvalid=null}getA11yAttributes(e){const t=e?.label??this.ariaLabel,i=e?.description??this.ariaDescription,n=e?.invalid??"true"===this.ariaInvalid;return{label:$e(t||void 0),description:$e(i||void 0),invalid:$e(n?"true":void 0)}}}return t([Le({type:"string",attribute:"aria-label",description:"Accessible label for the component (aria-label)."})],i.prototype,"ariaLabel",void 0),t([Le({type:"string",attribute:"aria-description",description:"Accessible description bound directly to aria-description."})],i.prototype,"ariaDescription",void 0),t([Le({type:"string",attribute:"aria-invalid",description:"Marks the component invalid for assistive technologies (aria-invalid)."})],i.prototype,"ariaInvalid",void 0),i}const Bi={Gray:"gray",Brand:"brand",Error:"error",Warning:"warning",Success:"success",GrayBlue:"gray-blue",BlueLight:"blue-light",Blue:"blue",Indigo:"indigo",Purple:"purple",Pink:"pink",Orange:"orange"},Ai=["gray","brand","error","warning","success","gray-blue","blue-light","blue","indigo","purple","pink","orange"],Pi="24rem",ji="36rem",zi="48rem",Hi="64rem",Ti="75rem",Di="96rem";function Vi(e,t,i){return Math.min(Math.max(e,t),i)}function Fi(e){return Ai.map(t=>`.color--${t} {\n ${e(t)}\n}`).join("\n")}function Ri(e){const t="undefined"!=typeof crypto?crypto.randomUUID():Math.random().toString(36).substring(2);return e?`${e}-${t}`:t}const Oi={ExtraSmall:"xs",Small:"sm",Medium:"md",Large:"lg"};e.LucideIconChevronDown.ensureDefined(),e.LucideIconCircleAlert.ensureDefined(),e.Combobox=class extends(Si(fe)){constructor(){super(),this.listboxId=Ri("combobox-listbox"),this.value="",this.name="",this.placeholder="",this.options=[],this.size=Oi.Medium,this.disabled=!1,this.required=!1,this.invalid=!1,this.emptyLabel="No results",this.allowCustomValue=!1,this._open=!1,this._inputValue="",this._activeIndex=-1,this._inputRef=ct(),this._listboxRef=ct(),this.internals=this.attachInternals()}updated(e){const t=e.has("value"),i=e.has("options"),n=e.has("allowCustomValue");if(t||n||i&&!this._open){const e=this.options.find(e=>e.value===this.value);e?this._inputValue=e.label:this.allowCustomValue?this._inputValue=this.value:this._inputValue=""}e.has("value")&&this.internals.setFormValue(this.value),(e.has("value")||e.has("required"))&&this.updateValidity(),e.has("options")&&this._open&&(this._activeIndex=-1),e.has("_activeIndex")&&this._activeIndex>=0&&this.shadowRoot?.querySelectorAll('[role="option"]')[this._activeIndex]?.scrollIntoView({block:"nearest"})}get filteredOptions(){if(!this._inputValue)return this.options;const e=this.filterFn??((e,t)=>e.label.toLowerCase().includes(t.toLowerCase()));return this.options.filter(t=>e(t,this._inputValue))}firstNavigableIndex(){return this.filteredOptions.findIndex(e=>!e.disabled)}lastNavigableIndex(){const e=this.filteredOptions;for(let t=e.length-1;t>=0;t--)if(!e[t].disabled)return t;return-1}nextNavigableIndex(e,t){const i=this.filteredOptions;let n=e+t;for(;n>=0&&n<i.length;){if(!i[n].disabled)return n;n+=t}return e}async openList(){this._open||this.disabled||(this._open=!0,this._activeIndex=-1,await this.updateComplete,this.positionListbox())}closeList(e=!1){if(this._open)if(this._open=!1,this._activeIndex=-1,this.cleanup?.(),this.cleanup=void 0,this.allowCustomValue&&e)this.commitCustomValue();else{const e=this.options.find(e=>e.value===this.value);this._inputValue=e?.label??(this.allowCustomValue?this.value:"")}}commitCustomValue(){const e=this._inputValue.trim();this._inputValue=e,e!==this.value&&(this.value=e,this.internals.setFormValue(e),this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:e},bubbles:!0,composed:!0})))}positionListbox(){const e=this._listboxRef.value;e&&(this.cleanup=Ii(this,e,async()=>{if(!e)return;const{x:t,y:i}=await qi(this,e,{placement:"bottom-start",middleware:[fi(4),bi(),Ci({padding:8})],strategy:"absolute"});Object.assign(e.style,{left:`${t}px`,top:`${i}px`,width:`${this.getBoundingClientRect().width}px`})}))}selectOption(e){this.value=e.value,this._inputValue=e.label,this.internals.setFormValue(e.value),this._open=!1,this._activeIndex=-1,this.cleanup?.(),this.cleanup=void 0,this.dispatchEvent(new CustomEvent("value-changed",{detail:{value:this.value},bubbles:!0,composed:!0})),this._inputRef.value?.focus()}handleInput(e){const t=e.target;this._inputValue=t.value,this._activeIndex=-1,this._open||this.openList(),this.dispatchEvent(new CustomEvent("input-changed",{detail:{value:this._inputValue},bubbles:!0,composed:!0}))}handleKeyDown(e){switch(e.key){case"ArrowDown":e.preventDefault(),this._open?this._activeIndex=this.nextNavigableIndex(this._activeIndex,1):this.openList().then(()=>{this._activeIndex=this.firstNavigableIndex()});break;case"ArrowUp":if(!this._open)return;e.preventDefault(),this._activeIndex=this.nextNavigableIndex(this._activeIndex,-1);break;case"Home":if(!this._open)return;e.preventDefault(),this._activeIndex=this.firstNavigableIndex();break;case"End":if(!this._open)return;e.preventDefault(),this._activeIndex=this.lastNavigableIndex();break;case"Enter":if(this._open&&this._activeIndex>=0){const t=this.filteredOptions[this._activeIndex];t&&!t.disabled&&(e.preventDefault(),this.selectOption(t))}else this.allowCustomValue&&this._inputValue.trim()&&(e.preventDefault(),this.closeList(!0),this.commitCustomValue());break;case"Escape":e.preventDefault(),this.closeList();break;case"Tab":this.closeList(!0)}}handleBlur(){this.closeList(!0),this.dispatchEvent(new Event("blur",{bubbles:!0,composed:!0}))}handleFocus(){this.dispatchEvent(new Event("focus",{bubbles:!0,composed:!0}))}handleChevronMouseDown(e){e.preventDefault(),this._open?this.closeList():(this._inputRef.value?.focus(),this.openList())}formResetCallback(){this.value="",this._inputValue="",this.internals.setFormValue("")}formStateRestoreCallback(e){this.value=e,this.internals.setFormValue(e);const t=this.options.find(t=>t.value===e);this._inputValue=t?.label??(this.allowCustomValue?e:"")}formDisabledCallback(e){this.disabled=e}disconnectedCallback(){super.disconnectedCallback(),this.cleanup?.()}updateValidity(){const e=this._inputRef.value;e&&this.internals.setValidity(e.validity,e.validationMessage,e)}get activeDescendant(){if(this._open&&!(this._activeIndex<0))return`${this.listboxId}-opt-${this._activeIndex}`}render(){const e=Oe({main:!0,[`size--${this.size}`]:!0}),t=Oe({listbox:!0,"is-open":this._open,[`size--${this.size}`]:!0}),i=this.getA11yAttributes({invalid:this.invalid}),n=this.filteredOptions;return Z`
|
|
32403
32403
|
<div class=${e}>
|
|
32404
32404
|
<input
|
|
32405
32405
|
${at(this._inputRef)}
|
|
@@ -32740,7 +32740,7 @@ const{I:Ze}=re,Ge=()=>document.createComment(""),Ne=(e,t,i)=>{const n=e._$AA.par
|
|
|
32740
32740
|
);
|
|
32741
32741
|
color: var(--quantic-text-tertiary);
|
|
32742
32742
|
}
|
|
32743
|
-
`,t([Le({type:"string",default:"",reflect:!0,description:"Currently selected value submitted with the form."})],e.Combobox.prototype,"value",void 0),t([Le({type:"string",description:"Name submitted with form data."})],e.Combobox.prototype,"name",void 0),t([Le({type:"string",description:"Placeholder shown when no option is selected."})],e.Combobox.prototype,"placeholder",void 0),t([Le({type:"ComboboxOption[]",default:"[]",description:"Options to display. Each item must have a label (display text) and value (form value). Set this prop reactively to implement async/server-side filtering."})],e.Combobox.prototype,"options",void 0),t([Le({type:"ComboboxSize",options:Object.values(Oi),default:Oi.Medium,description:"Controls padding and font size."})],e.Combobox.prototype,"size",void 0),t([Le({type:"boolean",default:"false",reflect:!0,description:"Prevents interaction."})],e.Combobox.prototype,"disabled",void 0),t([Le({type:"boolean",default:"false",reflect:!0,description:"Marks the field as required for form validation."})],e.Combobox.prototype,"required",void 0),t([Le({type:"boolean",default:"false",reflect:!0,description:"Applies error styling. Set alongside an error message in the parent quantic-combobox-field."})],e.Combobox.prototype,"invalid",void 0),t([Le({type:"string",default:"No results",description:"Text shown in the listbox when no options match the input."})],e.Combobox.prototype,"emptyLabel",void 0),t([Le({type:"(option: ComboboxOption, inputValue: string) => boolean",description:"Custom filter predicate. If omitted, defaults to case-insensitive substring match on option.label."})],e.Combobox.prototype,"filterFn",void 0),t([ve()],e.Combobox.prototype,"_open",void 0),t([ve()],e.Combobox.prototype,"_inputValue",void 0),t([ve()],e.Combobox.prototype,"_activeIndex",void 0),e.Combobox=t([Ie("value-changed",{description:"Fired when the user selects an option from the list.",detail:"{ value: string }"}),Ie("input-changed",{description:"Fired on every keystroke in the text field. Use to drive async filtering by updating the options prop in response.",detail:"{ value: string }"}),Ie("focus",{forwarded:!0}),Ie("blur",{forwarded:!0}),Ce("quantic-combobox")],e.Combobox);const $i=Bi,_i={ExtraSmall:"xs",Small:"sm",Medium:"md",Large:"lg"};e.Badge=class extends fe{constructor(){super(...arguments),this.color=$i.Brand,this.size=_i.Medium,this.rounded=!1,this.icon=!1}render(){const e=Oe({main:!0,[`size--${this.size}`]:!0,[`color--${this.color}`]:!0,icon:this.icon,rounded:this.rounded});return je`
|
|
32743
|
+
`,t([Le({type:"string",default:"",reflect:!0,description:"Currently selected value submitted with the form."})],e.Combobox.prototype,"value",void 0),t([Le({type:"string",description:"Name submitted with form data."})],e.Combobox.prototype,"name",void 0),t([Le({type:"string",description:"Placeholder shown when no option is selected."})],e.Combobox.prototype,"placeholder",void 0),t([Le({type:"ComboboxOption[]",default:"[]",description:"Options to display. Each item must have a label (display text) and value (form value). Set this prop reactively to implement async/server-side filtering."})],e.Combobox.prototype,"options",void 0),t([Le({type:"ComboboxSize",options:Object.values(Oi),default:Oi.Medium,description:"Controls padding and font size."})],e.Combobox.prototype,"size",void 0),t([Le({type:"boolean",default:"false",reflect:!0,description:"Prevents interaction."})],e.Combobox.prototype,"disabled",void 0),t([Le({type:"boolean",default:"false",reflect:!0,description:"Marks the field as required for form validation."})],e.Combobox.prototype,"required",void 0),t([Le({type:"boolean",default:"false",reflect:!0,description:"Applies error styling. Set alongside an error message in the parent quantic-combobox-field."})],e.Combobox.prototype,"invalid",void 0),t([Le({type:"string",default:"No results",description:"Text shown in the listbox when no options match the input."})],e.Combobox.prototype,"emptyLabel",void 0),t([Le({type:"boolean",default:"false",description:"When true, the user can type a value that does not match any option. The typed text is preserved on blur/Enter and surfaced through the value-changed event. When false (default), only values from the options list are accepted."})],e.Combobox.prototype,"allowCustomValue",void 0),t([Le({type:"(option: ComboboxOption, inputValue: string) => boolean",description:"Custom filter predicate. If omitted, defaults to case-insensitive substring match on option.label."})],e.Combobox.prototype,"filterFn",void 0),t([ve()],e.Combobox.prototype,"_open",void 0),t([ve()],e.Combobox.prototype,"_inputValue",void 0),t([ve()],e.Combobox.prototype,"_activeIndex",void 0),e.Combobox=t([Ie("value-changed",{description:"Fired when the user selects an option from the list, or commits a custom value when allowCustomValue is enabled.",detail:"{ value: string }"}),Ie("input-changed",{description:"Fired on every keystroke in the text field. Use to drive async filtering by updating the options prop in response.",detail:"{ value: string }"}),Ie("focus",{forwarded:!0}),Ie("blur",{forwarded:!0}),Ce("quantic-combobox")],e.Combobox);const $i=Bi,_i={ExtraSmall:"xs",Small:"sm",Medium:"md",Large:"lg"};e.Badge=class extends fe{constructor(){super(...arguments),this.color=$i.Brand,this.size=_i.Medium,this.rounded=!1,this.icon=!1}render(){const e=Oe({main:!0,[`size--${this.size}`]:!0,[`color--${this.color}`]:!0,icon:this.icon,rounded:this.rounded});return je`
|
|
32744
32744
|
<div class=${e}>
|
|
32745
32745
|
<slot name="before" data-description="Content before the label (e.g. icon)."></slot>
|
|
32746
32746
|
<slot data-description="Badge label text or icon."></slot>
|
|
@@ -35436,6 +35436,7 @@ const Jn="important",Qn=" !"+Jn,Yn=Fe(class extends Re{constructor(e){if(super(e
|
|
|
35436
35436
|
.options=${this.options}
|
|
35437
35437
|
.size=${this.size}
|
|
35438
35438
|
.emptyLabel=${this.emptyLabel}
|
|
35439
|
+
.allowCustomValue=${this.allowCustomValue}
|
|
35439
35440
|
.filterFn=${this.filterFn}
|
|
35440
35441
|
?disabled=${this.disabled}
|
|
35441
35442
|
?required=${this.required}
|