UNPKG

@wikimedia/codex

Version:

Codex Design System for Wikimedia

1 lines 166 kB
"use strict";var _n=Object.defineProperty,zn=Object.defineProperties;var Kn=Object.getOwnPropertyDescriptors;var He=Object.getOwnPropertySymbols;var Mt=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable;var dt=(e,n,o)=>n in e?_n(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,Y=(e,n)=>{for(var o in n||(n={}))Mt.call(n,o)&&dt(e,o,n[o]);if(He)for(var o of He(n))Dt.call(n,o)&&dt(e,o,n[o]);return e},ae=(e,n)=>zn(e,Kn(n));var de=(e,n)=>{var o={};for(var l in e)Mt.call(e,l)&&n.indexOf(l)<0&&(o[l]=e[l]);if(e!=null&&He)for(var l of He(e))n.indexOf(l)<0&&Dt.call(e,l)&&(o[l]=e[l]);return o};var me=(e,n,o)=>dt(e,typeof n!="symbol"?n+"":n,o);var J=(e,n,o)=>new Promise((l,a)=>{var d=s=>{try{r(o.next(s))}catch(u){a(u)}},i=s=>{try{r(o.throw(s))}catch(u){a(u)}},r=s=>s.done?l(s.value):Promise.resolve(s.value).then(d,i);r((o=o.apply(e,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),Hn='<path d="M11.53 2.3A1.85 1.85 0 0010 1.21 1.85 1.85 0 008.48 2.3L.36 16.36C-.48 17.81.21 19 1.88 19h16.24c1.67 0 2.36-1.19 1.52-2.64zM11 16H9v-2h2zm0-4H9V6h2z"/>',Wn='<path d="M12.43 14.34A5 5 0 0110 15a5 5 0 113.95-2L17 16.09V3a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 001.45-.63z"/><circle cx="10" cy="10" r="3"/>',Un='<path d="M7 14.17 2.83 10l-1.41 1.41L7 17 19 5l-1.41-1.42z"/>',jn='<path d="M10 0a10 10 0 1010 10A10 10 0 0010 0m5.66 14.24-1.41 1.41L10 11.41l-4.24 4.25-1.42-1.42L8.59 10 4.34 5.76l1.42-1.42L10 8.59l4.24-4.24 1.41 1.41L11.41 10z"/>',qn='<path d="m4.34 2.93 12.73 12.73-1.41 1.41L2.93 4.35z"/><path d="M17.07 4.34 4.34 17.07l-1.41-1.41L15.66 2.93z"/>',Qn='<path d="M10 15 2 5h16z"/>',Gn='<path d="M13.728 1H6.272L1 6.272v7.456L6.272 19h7.456L19 13.728V6.272zM11 15H9v-2h2zm0-4H9V5h2z"/>',Yn='<path d="m17.5 4.75-7.5 7.5-7.5-7.5L1 6.25l9 9 9-9z"/>',Xn='<path d="M19 3H1v14h18zM3 14l3.5-4.5 2.5 3L12.5 8l4.5 6z"/><path d="M19 5H1V3h18zm0 12H1v-2h18z"/>',Zn='<path d="M8 19a1 1 0 001 1h2a1 1 0 001-1v-1H8zm9-12a7 7 0 10-12 4.9S7 14 7 15v1a1 1 0 001 1h4a1 1 0 001-1v-1c0-1 2-3.1 2-3.1A7 7 0 0017 7"/>',Jn='<path d="M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10S15.523 0 10 0M9 5h2v2H9zm0 4h2v6H9z"/>',eo='<path d="M3 1h2v18H3zm13.5 1.5L15 1l-9 9 9 9 1.5-1.5L9 10z"/>',to='<path d="M15 1h2v18h-2zM3.5 2.5 11 10l-7.5 7.5L5 19l9-9-9-9z"/>',no='<path d="M7 1 5.6 2.5 13 10l-7.4 7.5L7 19l9-9z"/>',oo='<path d="m4 10 9 9 1.4-1.5L7 10l7.4-7.5L13 1z"/>',lo='<path d="M12.2 13.6a7 7 0 111.4-1.4l5.4 5.4-1.4 1.4zM3 8a5 5 0 1010 0A5 5 0 003 8"/>',ao='<path d="M10 0 3 8h14zm0 18-7-8h14z"/>',so='<path d="M10 20a10 10 0 010-20 10 10 0 110 20m-2-5 9-8.5L15.5 5 8 12 4.5 8.5 3 10z"/>',io='<path d="m10 5 8 10H2z"/>',Wt=Hn,ro=Wn,uo=Un,co=jn,Xe=qn,po=Qn,Ut=Gn,jt=Yn,fo=Xn,qt={langCodeMap:{ar:Zn},default:Jn},mo={ltr:eo,shouldFlip:!0},ho={ltr:to,shouldFlip:!0},Qt={ltr:no,shouldFlip:!0},Gt={ltr:oo,shouldFlip:!0},vo=lo,go=ao,Yt=so,bo=io;function yo(e,n,o){if(typeof e=="string"||"path"in e)return e;if("shouldFlip"in e)return e.ltr;if("rtl"in e)return o==="rtl"?e.rtl:e.ltr;const l=n in e.langCodeMap?e.langCodeMap[n]:e.default;return typeof l=="string"||"path"in l?l:l.ltr}function Co(e,n){if(typeof e=="string")return!1;if("langCodeMap"in e){const o=n in e.langCodeMap?e.langCodeMap[n]:e.default;if(typeof o=="string")return!1;e=o}if("shouldFlipExceptions"in e&&Array.isArray(e.shouldFlipExceptions)){const o=e.shouldFlipExceptions.indexOf(n);return o===void 0||o===-1}return"shouldFlip"in e?e.shouldFlip:!1}function Pe(e){const n=t.ref(null);return t.onMounted(()=>{const o=window.getComputedStyle(e.value).direction;n.value=o==="ltr"||o==="rtl"?o:null}),n}function Xt(e){const n=t.ref("");return t.onMounted(()=>{let o=e.value;for(;o&&o.lang==="";)o=o.parentElement;n.value=o?o.lang:null}),n}function ee(e){return n=>typeof n=="string"&&e.includes(n)}const Re="cdx",wo=["default","progressive","destructive"],ko=["normal","primary","quiet"],$o=["medium","large"],Bo=["x-small","small","medium"],So=["notice","warning","error","success"],Zt=ee(So),Io=["text","search","number","email","month","password","tel","url","week","date","datetime-local","time"],pe=["default","warning","error","success"],xo=["start","center","end","number"],Vo=120,Eo=500,Ve="cdx-menu-footer-item",Jt=Symbol("CdxTabs"),en=Symbol("CdxActiveTab"),tn=Symbol("CdxAllowArbitrary"),nn=Symbol("CdxFieldInputId"),Ze=Symbol("CdxFieldDescriptionId"),on=Symbol("CdxFieldStatus"),ln=Symbol("CdxDisabled"),No="".concat(Re,"-no-invert"),je=Symbol("CdxTableRowIdentifier"),Ao=["top","bottom","both"],an={left:"right","left-start":"right","left-end":"right",top:"bottom","top-start":"bottom","top-end":"bottom",bottom:"top","bottom-start":"top","bottom-end":"top",right:"left","right-start":"left","right-end":"left"},Mo=ee(Bo),Do=t.defineComponent({name:"CdxIcon",props:{icon:{type:[String,Object],required:!0},iconLabel:{type:String,default:""},lang:{type:String,default:null},dir:{type:String,default:null},size:{type:String,default:"medium",validator:Mo}},setup(e){const n=t.ref(),o=Pe(n),l=Xt(n),a=t.computed(()=>{var c;return(c=e.dir)!=null?c:o.value}),d=t.computed(()=>{var c;return(c=e.lang)!=null?c:l.value}),i=t.computed(()=>({"cdx-icon--flipped":a.value==="rtl"&&d.value!==null&&Co(e.icon,d.value),["cdx-icon--".concat(e.size)]:!0})),r=t.computed(()=>{var c,p;return yo(e.icon,(c=d.value)!=null?c:"",(p=a.value)!=null?p:"ltr")}),s=t.computed(()=>typeof r.value=="string"?r.value:""),u=t.computed(()=>typeof r.value!="string"?r.value.path:"");return{rootElement:n,rootClasses:i,iconSvg:s,iconPath:u}}}),_=(e,n)=>{const o=e.__vccOpts||e;for(const[l,a]of n)o[l]=a;return o},Lo=["aria-hidden"],To={key:0},Ro=["innerHTML"],Oo=["d"];function Fo(e,n,o,l,a,d){return t.openBlock(),t.createElementBlock("span",{ref:"rootElement",class:t.normalizeClass(["cdx-icon",e.rootClasses])},[(t.openBlock(),t.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20","aria-hidden":e.iconLabel?void 0:!0},[e.iconLabel?(t.openBlock(),t.createElementBlock("title",To,t.toDisplayString(e.iconLabel),1)):t.createCommentVNode("v-if",!0),e.iconSvg?(t.openBlock(),t.createElementBlock("g",{key:1,innerHTML:e.iconSvg},null,8,Ro)):(t.openBlock(),t.createElementBlock("path",{key:2,d:e.iconPath},null,8,Oo))],8,Lo))],2)}const G=_(Do,[["render",Fo]]);function sn(e){const n=[];for(const o of e)typeof o.type=="string"||typeof o.type=="object"?n.push(o):o.type!==t.Comment&&(typeof o.children=="string"&&o.children.trim()!==""?n.push(o.children):Array.isArray(o.children)&&n.push(...sn(o.children)));return n}function rn(e,n){return typeof e.type=="object"&&"name"in e.type?n!==void 0?e.type.name===n:!0:!1}function Po(e,n){return typeof e.type=="string"?e.type===n.toLowerCase():!1}function Ae(e){const n=typeof e=="function"?e():e;return n?sn(n):[]}function Je(e,n){if(e()){t.warn(n);return}const o=t.watch(e,l=>{l&&(t.warn(n),o())})}function dn(e,n,o){const l=t.computed(()=>{const a=Ae(e);if(a.length!==1)return!1;const d=a[0];return!!(typeof d=="object"&&(rn(d,"CdxIcon")||Po(d,"svg")))});return Je(()=>l.value&&!n["aria-label"]&&!n["aria-hidden"],"".concat(o,": Icon-only buttons require one of the following attributes: aria-label or aria-hidden. See documentation at https://doc.wikimedia.org/codex/latest/components/demos/button.html#icon-only-button")),l}const _o=ee(wo),zo=ee(ko),Ko=ee($o),Ho=t.defineComponent({name:"CdxButton",props:{action:{type:String,default:"default",validator:_o},weight:{type:String,default:"normal",validator:zo},size:{type:String,default:"medium",validator:Ko}},emits:["click"],setup(e,{emit:n,slots:o,attrs:l}){const a=t.ref(),d=dn(o.default,l,"CdxButton"),i=t.ref(!1),r=t.computed(()=>({["cdx-button--action-".concat(e.action)]:!0,["cdx-button--weight-".concat(e.weight)]:!0,["cdx-button--size-".concat(e.size)]:!0,"cdx-button--framed":e.weight!=="quiet","cdx-button--icon-only":d.value,"cdx-button--is-active":i.value})),s=f=>{n("click",f)},u=f=>{i.value=f};function c(){u(!0)}function p(){var f;u(!1),(f=a.value)==null||f.click()}return{button:a,rootClasses:r,onClick:s,onKeyDown:c,onKeyUp:p}}});function Wo(e,n,o,l,a,d){return t.openBlock(),t.createElementBlock("button",{ref:"button",class:t.normalizeClass(["cdx-button",e.rootClasses]),onKeydown:n[0]||(n[0]=t.withKeys(t.withModifiers((...i)=>e.onKeyDown&&e.onKeyDown(...i),["prevent"]),["space","enter"])),onKeyup:n[1]||(n[1]=t.withKeys((...i)=>e.onKeyUp&&e.onKeyUp(...i),["space","enter"])),onClick:n[2]||(n[2]=(...i)=>e.onClick&&e.onClick(...i))},[t.renderSlot(e.$slots,"default")],34)}const fe=_(Ho,[["render",Wo]]);function _e(e,n,o,l){return t.computed({get:()=>{var a;return(a=n.value)!=null?a:e.value},set:a=>{n.value!==null?o(l||"update:modelValue",a):e.value=a}})}const Uo=t.defineComponent({name:"CdxAccordion",components:{CdxButton:fe,CdxIcon:G},props:{modelValue:{type:[Boolean,null],default:null},actionAlwaysVisible:{type:Boolean,default:!1},actionIcon:{type:[String,Object],default:null},actionButtonLabel:{type:String,default:""},headingLevel:{type:String,default:"h3"}},emits:["action-button-click","update:modelValue","toggle"],setup(e,{attrs:n,emit:o}){const l=t.ref("open"in n),a=_e(l,t.toRef(e,"modelValue"),o),d=()=>{o("action-button-click")},i=u=>{a.value=u.newState==="open",o("toggle",a.value)},r=t.computed(()=>e.actionIcon?a.value?!0:!!e.actionAlwaysVisible:!1),s=t.computed(()=>({"cdx-accordion--has-icon":r.value}));return{emitActionButtonClick:d,rootClasses:s,shouldShowActionButton:r,onToggle:i,computedOpen:a}}}),jo=["open"],qo={class:"cdx-accordion__header__title"},Qo={class:"cdx-accordion__header__description"};function Go(e,n,o,l,a,d){const i=t.resolveComponent("cdx-icon"),r=t.resolveComponent("cdx-button");return t.openBlock(),t.createElementBlock("details",{class:t.normalizeClass(["cdx-accordion",e.rootClasses]),open:e.computedOpen||void 0,onToggle:n[1]||(n[1]=(...s)=>e.onToggle&&e.onToggle(...s))},[t.createElementVNode("summary",null,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.headingLevel),{class:"cdx-accordion__header"},{default:t.withCtx(()=>[t.createElementVNode("span",qo,[t.renderSlot(e.$slots,"title")]),t.createElementVNode("span",Qo,[t.renderSlot(e.$slots,"description")])]),_:3})),e.shouldShowActionButton?(t.openBlock(),t.createBlock(r,{key:0,class:"cdx-accordion__action","aria-label":e.actionButtonLabel,type:"button",weight:"quiet",onClick:t.withModifiers(e.emitActionButtonClick,["stop"])},{default:t.withCtx(()=>[t.createVNode(i,{icon:e.actionIcon,"icon-label":e.actionButtonLabel,size:"medium"},null,8,["icon","icon-label"])]),_:1},8,["aria-label","onClick"])):t.createCommentVNode("v-if",!0)]),t.createElementVNode("div",{class:"cdx-accordion__content",onClick:n[0]||(n[0]=t.withModifiers(()=>{},["stop"]))},[t.renderSlot(e.$slots,"default")])],42,jo)}const Yo=_(Uo,[["render",Go]]);function un(e){return e.label===void 0?e.value:e.label===null?"":e.label}function cn(e){const n=t.ref(),o=t.ref(),l=t.ref(new Map),a=Pe(n);function d(h,v){const g=h;g&&l.value.set(v,g)}function i(h){o.value=h}function r(){o.value=void 0}function s(h,v){var B;const g=h+v,C=e.value[g];if(C)if(C.disabled)s(g,v);else{const S=(B=l.value.get(g))==null?void 0:B.$el;S==null||S.focus()}}function u(){var h;s((h=o.value)!=null?h:-1,1)}function c(){var h;s((h=o.value)!=null?h:e.value.length,-1)}function p(){a.value==="rtl"?c():u()}function f(){a.value==="rtl"?u():c()}function m(h){switch(h.key){case"ArrowRight":h.preventDefault(),p();break;case"ArrowLeft":h.preventDefault(),f();break;case"ArrowDown":h.preventDefault(),u();break;case"ArrowUp":h.preventDefault(),c();break}}return{rootElement:n,assignTemplateRef:d,onFocus:i,onBlur:r,onKeydown:m}}const Xo=t.defineComponent({name:"CdxButtonGroup",components:{CdxButton:fe,CdxIcon:G},props:{buttons:{type:Array,required:!0,validator:e=>Array.isArray(e)&&e.length>=1},disabled:{type:Boolean,default:!1}},emits:["click"],setup(e){const{rootElement:n,assignTemplateRef:o,onFocus:l,onBlur:a,onKeydown:d}=cn(t.toRef(e,"buttons"));return{rootElement:n,assignTemplateRef:o,onFocus:l,onBlur:a,onKeydown:d,getButtonLabel:un}}}),Zo={ref:"rootElement",class:"cdx-button-group"};function Jo(e,n,o,l,a,d){const i=t.resolveComponent("cdx-icon"),r=t.resolveComponent("cdx-button");return t.openBlock(),t.createElementBlock("div",Zo,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.buttons,(s,u)=>(t.openBlock(),t.createBlock(r,{key:s.value,ref_for:!0,ref:c=>e.assignTemplateRef(c,u),disabled:s.disabled||e.disabled,"aria-label":s.ariaLabel,onClick:c=>e.$emit("click",s.value),onFocus:c=>e.onFocus(u),onBlur:e.onBlur,onKeydown:e.onKeydown},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{button:s},()=>[s.icon?(t.openBlock(),t.createBlock(i,{key:0,icon:s.icon},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createTextVNode(" "+t.toDisplayString(e.getButtonLabel(s)),1)])]),_:2},1032,["disabled","aria-label","onClick","onFocus","onBlur","onKeydown"]))),128))],512)}const el=_(Xo,[["render",Jo]]),tl=t.defineComponent({name:"CdxThumbnail",components:{CdxIcon:G},props:{thumbnail:{type:[Object,null],default:null},placeholderIcon:{type:[String,Object],default:fo}},setup:e=>{const n=t.ref(!1),o=t.ref({}),l=a=>{const d=a.replace(/([\\"\n])/g,"\\$1"),i=new Image;i.onload=()=>{o.value={backgroundImage:'url("'.concat(d,'")')},n.value=!0},i.onerror=()=>{n.value=!1},i.src=d};return t.onMounted(()=>{var a;(a=e.thumbnail)!=null&&a.url&&l(e.thumbnail.url)}),t.watch(t.toRef(e,"thumbnail"),(a,d)=>{if(!(a!=null&&a.url)){n.value=!1,o.value={};return}(d==null?void 0:d.url)!==a.url&&(n.value=!1,l(a.url))},{deep:!0}),{thumbnailStyle:o,thumbnailLoaded:n,NoInvertClass:No}}}),nl={class:"cdx-thumbnail"},ol={key:0,class:"cdx-thumbnail__placeholder"};function ll(e,n,o,l,a,d){const i=t.resolveComponent("cdx-icon");return t.openBlock(),t.createElementBlock("span",nl,[e.thumbnailLoaded?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock("span",ol,[t.createVNode(i,{icon:e.placeholderIcon,class:"cdx-thumbnail__placeholder__icon--vue"},null,8,["icon"])])),t.createVNode(t.Transition,{name:"cdx-thumbnail__image"},{default:t.withCtx(()=>[e.thumbnailLoaded?(t.openBlock(),t.createElementBlock("span",{key:0,style:t.normalizeStyle(e.thumbnailStyle),class:t.normalizeClass([e.NoInvertClass,"cdx-thumbnail__image"])},null,6)):t.createCommentVNode("v-if",!0)]),_:1})])}const gt=_(tl,[["render",ll]]),al=t.defineComponent({name:"CdxCard",components:{CdxIcon:G,CdxThumbnail:gt},props:{url:{type:String,default:""},icon:{type:[String,Object],default:""},thumbnail:{type:[Object,null],default:null},forceThumbnail:{type:Boolean,default:!1},customPlaceholderIcon:{type:[String,Object],default:void 0}},setup(e){const n=t.computed(()=>!!e.url),o=t.computed(()=>n.value?"a":"span"),l=t.computed(()=>n.value?e.url:void 0);return{isLink:n,contentTag:o,cardLink:l}}}),sl={class:"cdx-card__text"},il={class:"cdx-card__text__title"},rl={key:0,class:"cdx-card__text__description"},dl={key:1,class:"cdx-card__text__supporting-text"};function ul(e,n,o,l,a,d){const i=t.resolveComponent("cdx-thumbnail"),r=t.resolveComponent("cdx-icon");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.contentTag),{href:e.cardLink,class:t.normalizeClass(["cdx-card",{"cdx-card--is-link":e.isLink,"cdx-card--title-only":!e.$slots.description&&!e.$slots["supporting-text"]}])},{default:t.withCtx(()=>[e.thumbnail||e.forceThumbnail?(t.openBlock(),t.createBlock(i,{key:0,thumbnail:e.thumbnail,"placeholder-icon":e.customPlaceholderIcon,class:"cdx-card__thumbnail"},null,8,["thumbnail","placeholder-icon"])):e.icon?(t.openBlock(),t.createBlock(r,{key:1,icon:e.icon,class:"cdx-card__icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",sl,[t.createElementVNode("span",il,[t.renderSlot(e.$slots,"title")]),e.$slots.description?(t.openBlock(),t.createElementBlock("span",rl,[t.renderSlot(e.$slots,"description")])):t.createCommentVNode("v-if",!0),e.$slots["supporting-text"]?(t.openBlock(),t.createElementBlock("span",dl,[t.renderSlot(e.$slots,"supporting-text")])):t.createCommentVNode("v-if",!0)])]),_:3},8,["href","class"])}const cl=_(al,[["render",ul]]);function bt(e){const n=t.inject(ln,t.ref(!1));return t.computed(()=>n.value||e.value)}function se(e,n,o){const l=bt(e),a=t.inject(on,t.ref("default")),d=t.computed(()=>n!=null&&n.value&&n.value!=="default"?n.value:a.value),i=t.inject(nn,void 0),r=t.computed(()=>{var s;return(s=i==null?void 0:i.value)!=null?s:o});return{computedDisabled:l,computedStatus:d,computedInputId:r}}function le(e,n=t.computed(()=>({}))){const o=t.computed(()=>{const d=de(n.value,[]);return e.class&&e.class.split(" ").forEach(r=>{d[r]=!0}),d}),l=t.computed(()=>{if("style"in e)return e.style}),a=t.computed(()=>{const s=e,{class:d,style:i}=s;return de(s,["class","style"])});return{rootClasses:o,rootStyle:l,otherAttrs:a}}function X(e,n,o=[]){const l=t.inject("CdxI18nFunction",void 0);return t.computed(()=>{const a=o.map(i=>typeof i=="function"?i():i.value),d=l==null?void 0:l(e,...a);return d!=null?d:typeof n=="function"?n(...a):n})}function ze(e,n,o,l=[]){const a=X(n,o,l);return t.computed(()=>e.value||a.value)}const pl=t.defineComponent({name:"CdxLabel",components:{CdxIcon:G},inheritAttrs:!1,props:{icon:{type:[String,Object],default:null},optional:{type:Boolean,default:!1},optionalFlag:{type:String,default:""},visuallyHidden:{type:Boolean,default:!1},isLegend:{type:Boolean,default:!1},inputId:{type:String,default:""},descriptionId:{type:String,default:""},disabled:{type:Boolean,default:!1}},setup(e,{attrs:n}){const{computedDisabled:o}=se(t.toRef(e,"disabled")),l=t.computed(()=>({"cdx-label--visually-hidden":e.visuallyHidden,"cdx-label--disabled":o.value})),{rootClasses:a,rootStyle:d,otherAttrs:i}=le(n,l),r=ze(t.toRef(e,"optionalFlag"),"cdx-label-optional-flag","(optional)");return{rootClasses:a,rootStyle:d,otherAttrs:i,translatedOptionalFlag:r}}}),fl=["for"],ml={class:"cdx-label__label__text"},hl={key:1,class:"cdx-label__label__optional-flag"},vl=["id"],gl={class:"cdx-label__label"},bl={class:"cdx-label__label__text"},yl={key:1,class:"cdx-label__label__optional-flag"},Cl={key:0,class:"cdx-label__description"};function wl(e,n,o,l,a,d){const i=t.resolveComponent("cdx-icon");return e.isLegend?(t.openBlock(),t.createElementBlock("legend",t.mergeProps({key:1,class:["cdx-label",e.rootClasses],style:e.rootStyle},e.otherAttrs),[t.createElementVNode("span",gl,[e.icon?(t.openBlock(),t.createBlock(i,{key:0,icon:e.icon,class:"cdx-label__label__icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",bl,[t.renderSlot(e.$slots,"default")]),e.optionalFlag||e.optional?(t.openBlock(),t.createElementBlock("span",yl,t.toDisplayString(" ")+" "+t.toDisplayString(e.translatedOptionalFlag),1)):t.createCommentVNode("v-if",!0)]),e.$slots.description&&e.$slots.description().length>0?(t.openBlock(),t.createElementBlock("span",Cl,[t.renderSlot(e.$slots,"description")])):t.createCommentVNode("v-if",!0)],16)):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["cdx-label",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.createElementVNode("label",t.mergeProps({class:"cdx-label__label",for:e.inputId?e.inputId:void 0},e.otherAttrs),[e.icon?(t.openBlock(),t.createBlock(i,{key:0,icon:e.icon,class:"cdx-label__label__icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",ml,[t.renderSlot(e.$slots,"default")]),e.optionalFlag||e.optional?(t.openBlock(),t.createElementBlock("span",hl,t.toDisplayString(" ")+" "+t.toDisplayString(e.translatedOptionalFlag),1)):t.createCommentVNode("v-if",!0)],16,fl),e.$slots.description&&e.$slots.description().length>0?(t.openBlock(),t.createElementBlock("span",{key:0,id:e.descriptionId||void 0,class:"cdx-label__description"},[t.renderSlot(e.$slots,"description")],8,vl)):t.createCommentVNode("v-if",!0)],6))}const Me=_(pl,[["render",wl]]);function et(e,n,o){Je(()=>Ae(e).length===0&&!(n!=null&&n["aria-label"])&&!(n!=null&&n["aria-labelledby"]),"".concat(o,": Inputs must have an associated label. Provide one of the following:\n - A label via the appropriate slot\n - An `aria-label` attribute set to the label text\n - An `aria-labelledby` attribute set to the ID of the label element"))}function oe(e,n,o){return t.computed({get:()=>e.value,set:l=>n(o||"update:modelValue",l)})}const kl=ee(pe),$l=t.defineComponent({name:"CdxCheckbox",components:{CdxLabel:Me},props:{modelValue:{type:[Boolean,Array],default:!1},inputValue:{type:[String,Number,Boolean],default:!1},name:{type:String,default:null},disabled:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},inline:{type:Boolean,default:!1},hideLabel:{type:Boolean,default:!1},status:{type:String,default:"default",validator:kl}},emits:["update:modelValue"],setup(e,{emit:n,slots:o,attrs:l}){var f;et((f=o.default)==null?void 0:f.call(o),l,"CdxCheckbox");const{computedDisabled:a,computedStatus:d}=se(t.toRef(e,"disabled"),t.toRef(e,"status")),i=t.computed(()=>({"cdx-checkbox--inline":e.inline,["cdx-checkbox--status-".concat(d.value)]:!0})),r=t.computed(()=>({"cdx-checkbox__custom-input--inline":e.inline})),s=t.ref(),u=t.useId(),c=t.useId(),p=oe(t.toRef(e,"modelValue"),n);return{rootClasses:i,computedDisabled:a,input:s,checkboxId:u,descriptionId:c,wrappedModel:p,customInputClasses:r}}}),Bl={class:"cdx-checkbox__wrapper"},Sl=["id","aria-describedby","value","name","disabled",".indeterminate"];function Il(e,n,o,l,a,d){const i=t.resolveComponent("cdx-label");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-checkbox",e.rootClasses])},[t.createElementVNode("div",Bl,[t.withDirectives(t.createElementVNode("input",{id:e.checkboxId,ref:"input","onUpdate:modelValue":n[0]||(n[0]=r=>e.wrappedModel=r),class:"cdx-checkbox__input",type:"checkbox","aria-describedby":e.$slots.description&&e.$slots.description().length>0?e.descriptionId:void 0,value:e.inputValue,name:e.name,disabled:e.computedDisabled,".indeterminate":e.indeterminate},null,40,Sl),[[t.vModelCheckbox,e.wrappedModel]]),n[1]||(n[1]=t.createElementVNode("span",{class:"cdx-checkbox__icon"},null,-1)),e.$slots.default&&e.$slots.default().length?(t.openBlock(),t.createBlock(i,{key:0,class:"cdx-checkbox__label","input-id":e.checkboxId,"description-id":e.$slots.description&&e.$slots.description().length>0?e.descriptionId:void 0,disabled:e.computedDisabled,"visually-hidden":e.hideLabel},t.createSlots({default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:2},[e.$slots.description&&e.$slots.description().length>0?{name:"description",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"description")]),key:"0"}:void 0]),1032,["input-id","description-id","disabled","visually-hidden"])):t.createCommentVNode("v-if",!0)]),e.$slots["custom-input"]?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["cdx-checkbox__custom-input",e.customInputClasses])},[t.renderSlot(e.$slots,"custom-input")],2)):t.createCommentVNode("v-if",!0)],2)}const pn=_($l,[["render",Il]]),xl=["top","right","bottom","left"],ye=Math.min,ie=Math.max,qe=Math.round,We=Math.floor,he=e=>({x:e,y:e}),Vl={left:"right",right:"left",bottom:"top",top:"bottom"},El={start:"end",end:"start"};function pt(e,n,o){return ie(e,ye(n,o))}function Be(e,n){return typeof e=="function"?e(n):e}function Ce(e){return e.split("-")[0]}function De(e){return e.split("-")[1]}function fn(e){return e==="x"?"y":"x"}function yt(e){return e==="y"?"height":"width"}function ke(e){return["top","bottom"].includes(Ce(e))?"y":"x"}function Ct(e){return fn(ke(e))}function Nl(e,n,o){o===void 0&&(o=!1);const l=De(e),a=Ct(e),d=yt(a);let i=a==="x"?l===(o?"end":"start")?"right":"left":l==="start"?"bottom":"top";return n.reference[d]>n.floating[d]&&(i=Qe(i)),[i,Qe(i)]}function Al(e){const n=Qe(e);return[ft(e),n,ft(n)]}function ft(e){return e.replace(/start|end/g,n=>El[n])}function Ml(e,n,o){const l=["left","right"],a=["right","left"],d=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return o?n?a:l:n?l:a;case"left":case"right":return n?d:i;default:return[]}}function Dl(e,n,o,l){const a=De(e);let d=Ml(Ce(e),o==="start",l);return a&&(d=d.map(i=>i+"-"+a),n&&(d=d.concat(d.map(ft)))),d}function Qe(e){return e.replace(/left|right|bottom|top/g,n=>Vl[n])}function Ll(e){return Y({top:0,right:0,bottom:0,left:0},e)}function mn(e){return typeof e!="number"?Ll(e):{top:e,right:e,bottom:e,left:e}}function Ge(e){const{x:n,y:o,width:l,height:a}=e;return{width:l,height:a,top:o,left:n,right:n+l,bottom:o+a,x:n,y:o}}function Lt(e,n,o){let{reference:l,floating:a}=e;const d=ke(n),i=Ct(n),r=yt(i),s=Ce(n),u=d==="y",c=l.x+l.width/2-a.width/2,p=l.y+l.height/2-a.height/2,f=l[r]/2-a[r]/2;let m;switch(s){case"top":m={x:c,y:l.y-a.height};break;case"bottom":m={x:c,y:l.y+l.height};break;case"right":m={x:l.x+l.width,y:p};break;case"left":m={x:l.x-a.width,y:p};break;default:m={x:l.x,y:l.y}}switch(De(n)){case"start":m[i]-=f*(o&&u?-1:1);break;case"end":m[i]+=f*(o&&u?-1:1);break}return m}const Tl=(e,n,o)=>J(exports,null,function*(){const{placement:l="bottom",strategy:a="absolute",middleware:d=[],platform:i}=o,r=d.filter(Boolean),s=yield i.isRTL==null?void 0:i.isRTL(n);let u=yield i.getElementRects({reference:e,floating:n,strategy:a}),{x:c,y:p}=Lt(u,l,s),f=l,m={},h=0;for(let v=0;v<r.length;v++){const{name:g,fn:C}=r[v],{x:B,y:S,data:E,reset:V}=yield C({x:c,y:p,initialPlacement:l,placement:f,strategy:a,middlewareData:m,rects:u,platform:i,elements:{reference:e,floating:n}});c=B!=null?B:c,p=S!=null?S:p,m=ae(Y({},m),{[g]:Y(Y({},m[g]),E)}),V&&h<=50&&(h++,typeof V=="object"&&(V.placement&&(f=V.placement),V.rects&&(u=V.rects===!0?yield i.getElementRects({reference:e,floating:n,strategy:a}):V.rects),{x:c,y:p}=Lt(u,f,s)),v=-1)}return{x:c,y:p,placement:f,strategy:a,middlewareData:m}});function Oe(e,n){return J(this,null,function*(){var o;n===void 0&&(n={});const{x:l,y:a,platform:d,rects:i,elements:r,strategy:s}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:p="floating",altBoundary:f=!1,padding:m=0}=Be(n,e),h=mn(m),g=r[f?p==="floating"?"reference":"floating":p],C=Ge(yield d.getClippingRect({element:(o=yield d.isElement==null?void 0:d.isElement(g))==null||o?g:g.contextElement||(yield d.getDocumentElement==null?void 0:d.getDocumentElement(r.floating)),boundary:u,rootBoundary:c,strategy:s})),B=p==="floating"?{x:l,y:a,width:i.floating.width,height:i.floating.height}:i.reference,S=yield d.getOffsetParent==null?void 0:d.getOffsetParent(r.floating),E=(yield d.isElement==null?void 0:d.isElement(S))?(yield d.getScale==null?void 0:d.getScale(S))||{x:1,y:1}:{x:1,y:1},V=Ge(d.convertOffsetParentRelativeRectToViewportRelativeRect?yield d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:r,rect:B,offsetParent:S,strategy:s}):B);return{top:(C.top-V.top+h.top)/E.y,bottom:(V.bottom-C.bottom+h.bottom)/E.y,left:(C.left-V.left+h.left)/E.x,right:(V.right-C.right+h.right)/E.x}})}const Rl=e=>({name:"arrow",options:e,fn(o){return J(this,null,function*(){const{x:l,y:a,placement:d,rects:i,platform:r,elements:s,middlewareData:u}=o,{element:c,padding:p=0}=Be(e,o)||{};if(c==null)return{};const f=mn(p),m={x:l,y:a},h=Ct(d),v=yt(h),g=yield r.getDimensions(c),C=h==="y",B=C?"top":"left",S=C?"bottom":"right",E=C?"clientHeight":"clientWidth",V=i.reference[v]+i.reference[h]-m[h]-i.floating[v],M=m[h]-i.reference[h],A=yield r.getOffsetParent==null?void 0:r.getOffsetParent(c);let $=A?A[E]:0;(!$||!(yield r.isElement==null?void 0:r.isElement(A)))&&($=s.floating[E]||i.floating[v]);const b=V/2-M/2,k=$/2-g[v]/2-1,I=ye(f[B],k),x=ye(f[S],k),R=I,K=$-g[v]-x,z=$/2-g[v]/2+b,O=pt(R,z,K),W=!u.arrow&&De(d)!=null&&z!==O&&i.reference[v]/2-(z<R?I:x)-g[v]/2<0,L=W?z<R?z-R:z-K:0;return{[h]:m[h]+L,data:Y({[h]:O,centerOffset:z-O-L},W&&{alignmentOffset:L}),reset:W}})}}),Ol=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(o){return J(this,null,function*(){var l,a;const{placement:d,middlewareData:i,rects:r,initialPlacement:s,platform:u,elements:c}=o,z=Be(e,o),{mainAxis:p=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:g=!0}=z,C=de(z,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((l=i.arrow)!=null&&l.alignmentOffset)return{};const B=Ce(d),S=ke(s),E=Ce(s)===s,V=yield u.isRTL==null?void 0:u.isRTL(c.floating),M=m||(E||!g?[Qe(s)]:Al(s)),A=v!=="none";!m&&A&&M.push(...Dl(s,g,v,V));const $=[s,...M],b=yield Oe(o,C),k=[];let I=((a=i.flip)==null?void 0:a.overflows)||[];if(p&&k.push(b[B]),f){const O=Nl(d,r,V);k.push(b[O[0]],b[O[1]])}if(I=[...I,{placement:d,overflows:k}],!k.every(O=>O<=0)){var x,R;const O=(((x=i.flip)==null?void 0:x.index)||0)+1,W=$[O];if(W)return{data:{index:O,overflows:I},reset:{placement:W}};let L=(R=I.filter(H=>H.overflows[0]<=0).sort((H,q)=>H.overflows[1]-q.overflows[1])[0])==null?void 0:R.placement;if(!L)switch(h){case"bestFit":{var K;const H=(K=I.filter(q=>{if(A){const y=ke(q.placement);return y===S||y==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(y=>y>0).reduce((y,T)=>y+T,0)]).sort((q,y)=>q[1]-y[1])[0])==null?void 0:K[0];H&&(L=H);break}case"initialPlacement":L=s;break}if(d!==L)return{reset:{placement:L}}}return{}})}}};function Tt(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function Rt(e){return xl.some(n=>e[n]>=0)}const Fl=function(e){return e===void 0&&(e={}),{name:"hide",options:e,fn(o){return J(this,null,function*(){const{rects:l}=o,i=Be(e,o),{strategy:a="referenceHidden"}=i,d=de(i,["strategy"]);switch(a){case"referenceHidden":{const r=yield Oe(o,ae(Y({},d),{elementContext:"reference"})),s=Tt(r,l.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Rt(s)}}}case"escaped":{const r=yield Oe(o,ae(Y({},d),{altBoundary:!0})),s=Tt(r,l.floating);return{data:{escapedOffsets:s,escaped:Rt(s)}}}default:return{}}})}}};function Pl(e,n){return J(this,null,function*(){const{placement:o,platform:l,elements:a}=e,d=yield l.isRTL==null?void 0:l.isRTL(a.floating),i=Ce(o),r=De(o),s=ke(o)==="y",u=["left","top"].includes(i)?-1:1,c=d&&s?-1:1,p=Be(n,e);let{mainAxis:f,crossAxis:m,alignmentAxis:h}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return r&&typeof h=="number"&&(m=r==="end"?h*-1:h),s?{x:m*c,y:f*u}:{x:f*u,y:m*c}})}const _l=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(o){return J(this,null,function*(){var l,a;const{x:d,y:i,placement:r,middlewareData:s}=o,u=yield Pl(o,e);return r===((l=s.offset)==null?void 0:l.placement)&&(a=s.arrow)!=null&&a.alignmentOffset?{}:{x:d+u.x,y:i+u.y,data:ae(Y({},u),{placement:r})}})}}},zl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(o){return J(this,null,function*(){const{x:l,y:a,placement:d}=o,C=Be(e,o),{mainAxis:i=!0,crossAxis:r=!1,limiter:s={fn:B=>{let{x:S,y:E}=B;return{x:S,y:E}}}}=C,u=de(C,["mainAxis","crossAxis","limiter"]),c={x:l,y:a},p=yield Oe(o,u),f=ke(Ce(d)),m=fn(f);let h=c[m],v=c[f];if(i){const B=m==="y"?"top":"left",S=m==="y"?"bottom":"right",E=h+p[B],V=h-p[S];h=pt(E,h,V)}if(r){const B=f==="y"?"top":"left",S=f==="y"?"bottom":"right",E=v+p[B],V=v-p[S];v=pt(E,v,V)}const g=s.fn(ae(Y({},o),{[m]:h,[f]:v}));return ae(Y({},g),{data:{x:g.x-l,y:g.y-a,enabled:{[m]:i,[f]:r}}})})}}},Kl=function(e){return e===void 0&&(e={}),{name:"size",options:e,fn(o){return J(this,null,function*(){var l,a;const{placement:d,rects:i,platform:r,elements:s}=o,I=Be(e,o),{apply:u=()=>{}}=I,c=de(I,["apply"]),p=yield Oe(o,c),f=Ce(d),m=De(d),h=ke(d)==="y",{width:v,height:g}=i.floating;let C,B;f==="top"||f==="bottom"?(C=f,B=m===((yield r.isRTL==null?void 0:r.isRTL(s.floating))?"start":"end")?"left":"right"):(B=f,C=m==="end"?"top":"bottom");const S=g-p.top-p.bottom,E=v-p.left-p.right,V=ye(g-p[C],S),M=ye(v-p[B],E),A=!o.middlewareData.shift;let $=V,b=M;if((l=o.middlewareData.shift)!=null&&l.enabled.x&&(b=E),(a=o.middlewareData.shift)!=null&&a.enabled.y&&($=S),A&&!m){const x=ie(p.left,0),R=ie(p.right,0),K=ie(p.top,0),z=ie(p.bottom,0);h?b=v-2*(x!==0||R!==0?x+R:ie(p.left,p.right)):$=g-2*(K!==0||z!==0?K+z:ie(p.top,p.bottom))}yield u(ae(Y({},o),{availableWidth:b,availableHeight:$}));const k=yield r.getDimensions(s.floating);return v!==k.width||g!==k.height?{reset:{rects:!0}}:{}})}}};function tt(){return typeof window!="undefined"}function Se(e){return wt(e)?(e.nodeName||"").toLowerCase():"#document"}function re(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function ge(e){var n;return(n=(wt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function wt(e){return tt()?e instanceof Node||e instanceof re(e).Node:!1}function ue(e){return tt()?e instanceof Element||e instanceof re(e).Element:!1}function ve(e){return tt()?e instanceof HTMLElement||e instanceof re(e).HTMLElement:!1}function Ot(e){return!tt()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof re(e).ShadowRoot}function Ke(e){const{overflow:n,overflowX:o,overflowY:l,display:a}=ce(e);return/auto|scroll|overlay|hidden|clip/.test(n+l+o)&&!["inline","contents"].includes(a)}function Hl(e){return["table","td","th"].includes(Se(e))}function nt(e){return[":popover-open",":modal"].some(n=>{try{return e.matches(n)}catch(o){return!1}})}function kt(e){const n=$t(),o=ue(e)?ce(e):e;return o.transform!=="none"||o.perspective!=="none"||(o.containerType?o.containerType!=="normal":!1)||!n&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!n&&(o.filter?o.filter!=="none":!1)||["transform","perspective","filter"].some(l=>(o.willChange||"").includes(l))||["paint","layout","strict","content"].some(l=>(o.contain||"").includes(l))}function Wl(e){let n=we(e);for(;ve(n)&&!Ne(n);){if(kt(n))return n;if(nt(n))return null;n=we(n)}return null}function $t(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ne(e){return["html","body","#document"].includes(Se(e))}function ce(e){return re(e).getComputedStyle(e)}function ot(e){return ue(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function we(e){if(Se(e)==="html")return e;const n=e.assignedSlot||e.parentNode||Ot(e)&&e.host||ge(e);return Ot(n)?n.host:n}function hn(e){const n=we(e);return Ne(n)?e.ownerDocument?e.ownerDocument.body:e.body:ve(n)&&Ke(n)?n:hn(n)}function Fe(e,n,o){var l;n===void 0&&(n=[]),o===void 0&&(o=!0);const a=hn(e),d=a===((l=e.ownerDocument)==null?void 0:l.body),i=re(a);if(d){const r=mt(i);return n.concat(i,i.visualViewport||[],Ke(a)?a:[],r&&o?Fe(r):[])}return n.concat(a,Fe(a,[],o))}function mt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function vn(e){const n=ce(e);let o=parseFloat(n.width)||0,l=parseFloat(n.height)||0;const a=ve(e),d=a?e.offsetWidth:o,i=a?e.offsetHeight:l,r=qe(o)!==d||qe(l)!==i;return r&&(o=d,l=i),{width:o,height:l,$:r}}function Bt(e){return ue(e)?e:e.contextElement}function Ee(e){const n=Bt(e);if(!ve(n))return he(1);const o=n.getBoundingClientRect(),{width:l,height:a,$:d}=vn(n);let i=(d?qe(o.width):o.width)/l,r=(d?qe(o.height):o.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!r||!Number.isFinite(r))&&(r=1),{x:i,y:r}}const Ul=he(0);function gn(e){const n=re(e);return!$t()||!n.visualViewport?Ul:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function jl(e,n,o){return n===void 0&&(n=!1),!o||n&&o!==re(e)?!1:n}function $e(e,n,o,l){n===void 0&&(n=!1),o===void 0&&(o=!1);const a=e.getBoundingClientRect(),d=Bt(e);let i=he(1);n&&(l?ue(l)&&(i=Ee(l)):i=Ee(e));const r=jl(d,o,l)?gn(d):he(0);let s=(a.left+r.x)/i.x,u=(a.top+r.y)/i.y,c=a.width/i.x,p=a.height/i.y;if(d){const f=re(d),m=l&&ue(l)?re(l):l;let h=f,v=mt(h);for(;v&&l&&m!==h;){const g=Ee(v),C=v.getBoundingClientRect(),B=ce(v),S=C.left+(v.clientLeft+parseFloat(B.paddingLeft))*g.x,E=C.top+(v.clientTop+parseFloat(B.paddingTop))*g.y;s*=g.x,u*=g.y,c*=g.x,p*=g.y,s+=S,u+=E,h=re(v),v=mt(h)}}return Ge({width:c,height:p,x:s,y:u})}function St(e,n){const o=ot(e).scrollLeft;return n?n.left+o:$e(ge(e)).left+o}function bn(e,n,o){o===void 0&&(o=!1);const l=e.getBoundingClientRect(),a=l.left+n.scrollLeft-(o?0:St(e,l)),d=l.top+n.scrollTop;return{x:a,y:d}}function ql(e){let{elements:n,rect:o,offsetParent:l,strategy:a}=e;const d=a==="fixed",i=ge(l),r=n?nt(n.floating):!1;if(l===i||r&&d)return o;let s={scrollLeft:0,scrollTop:0},u=he(1);const c=he(0),p=ve(l);if((p||!p&&!d)&&((Se(l)!=="body"||Ke(i))&&(s=ot(l)),ve(l))){const m=$e(l);u=Ee(l),c.x=m.x+l.clientLeft,c.y=m.y+l.clientTop}const f=i&&!p&&!d?bn(i,s,!0):he(0);return{width:o.width*u.x,height:o.height*u.y,x:o.x*u.x-s.scrollLeft*u.x+c.x+f.x,y:o.y*u.y-s.scrollTop*u.y+c.y+f.y}}function Ql(e){return Array.from(e.getClientRects())}function Gl(e){const n=ge(e),o=ot(e),l=e.ownerDocument.body,a=ie(n.scrollWidth,n.clientWidth,l.scrollWidth,l.clientWidth),d=ie(n.scrollHeight,n.clientHeight,l.scrollHeight,l.clientHeight);let i=-o.scrollLeft+St(e);const r=-o.scrollTop;return ce(l).direction==="rtl"&&(i+=ie(n.clientWidth,l.clientWidth)-a),{width:a,height:d,x:i,y:r}}function Yl(e,n){const o=re(e),l=ge(e),a=o.visualViewport;let d=l.clientWidth,i=l.clientHeight,r=0,s=0;if(a){d=a.width,i=a.height;const u=$t();(!u||u&&n==="fixed")&&(r=a.offsetLeft,s=a.offsetTop)}return{width:d,height:i,x:r,y:s}}function Xl(e,n){const o=$e(e,!0,n==="fixed"),l=o.top+e.clientTop,a=o.left+e.clientLeft,d=ve(e)?Ee(e):he(1),i=e.clientWidth*d.x,r=e.clientHeight*d.y,s=a*d.x,u=l*d.y;return{width:i,height:r,x:s,y:u}}function Ft(e,n,o){let l;if(n==="viewport")l=Yl(e,o);else if(n==="document")l=Gl(ge(e));else if(ue(n))l=Xl(n,o);else{const a=gn(e);l={x:n.x-a.x,y:n.y-a.y,width:n.width,height:n.height}}return Ge(l)}function yn(e,n){const o=we(e);return o===n||!ue(o)||Ne(o)?!1:ce(o).position==="fixed"||yn(o,n)}function Zl(e,n){const o=n.get(e);if(o)return o;let l=Fe(e,[],!1).filter(r=>ue(r)&&Se(r)!=="body"),a=null;const d=ce(e).position==="fixed";let i=d?we(e):e;for(;ue(i)&&!Ne(i);){const r=ce(i),s=kt(i);!s&&r.position==="fixed"&&(a=null),(d?!s&&!a:!s&&r.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||Ke(i)&&!s&&yn(e,i))?l=l.filter(c=>c!==i):a=r,i=we(i)}return n.set(e,l),l}function Jl(e){let{element:n,boundary:o,rootBoundary:l,strategy:a}=e;const i=[...o==="clippingAncestors"?nt(n)?[]:Zl(n,this._c):[].concat(o),l],r=i[0],s=i.reduce((u,c)=>{const p=Ft(n,c,a);return u.top=ie(p.top,u.top),u.right=ye(p.right,u.right),u.bottom=ye(p.bottom,u.bottom),u.left=ie(p.left,u.left),u},Ft(n,r,a));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function ea(e){const{width:n,height:o}=vn(e);return{width:n,height:o}}function ta(e,n,o){const l=ve(n),a=ge(n),d=o==="fixed",i=$e(e,!0,d,n);let r={scrollLeft:0,scrollTop:0};const s=he(0);if(l||!l&&!d)if((Se(n)!=="body"||Ke(a))&&(r=ot(n)),l){const f=$e(n,!0,d,n);s.x=f.x+n.clientLeft,s.y=f.y+n.clientTop}else a&&(s.x=St(a));const u=a&&!l&&!d?bn(a,r):he(0),c=i.left+r.scrollLeft-s.x-u.x,p=i.top+r.scrollTop-s.y-u.y;return{x:c,y:p,width:i.width,height:i.height}}function ut(e){return ce(e).position==="static"}function Pt(e,n){if(!ve(e)||ce(e).position==="fixed")return null;if(n)return n(e);let o=e.offsetParent;return ge(e)===o&&(o=o.ownerDocument.body),o}function Cn(e,n){const o=re(e);if(nt(e))return o;if(!ve(e)){let a=we(e);for(;a&&!Ne(a);){if(ue(a)&&!ut(a))return a;a=we(a)}return o}let l=Pt(e,n);for(;l&&Hl(l)&&ut(l);)l=Pt(l,n);return l&&Ne(l)&&ut(l)&&!kt(l)?o:l||Wl(e)||o}const na=function(e){return J(this,null,function*(){const n=this.getOffsetParent||Cn,o=this.getDimensions,l=yield o(e.floating);return{reference:ta(e.reference,yield n(e.floating),e.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}})};function oa(e){return ce(e).direction==="rtl"}const la={convertOffsetParentRelativeRectToViewportRelativeRect:ql,getDocumentElement:ge,getClippingRect:Jl,getOffsetParent:Cn,getElementRects:na,getClientRects:Ql,getDimensions:ea,getScale:Ee,isElement:ue,isRTL:oa};function aa(e,n){let o=null,l;const a=ge(e);function d(){var r;clearTimeout(l),(r=o)==null||r.disconnect(),o=null}function i(r,s){r===void 0&&(r=!1),s===void 0&&(s=1),d();const{left:u,top:c,width:p,height:f}=e.getBoundingClientRect();if(r||n(),!p||!f)return;const m=We(c),h=We(a.clientWidth-(u+p)),v=We(a.clientHeight-(c+f)),g=We(u),B={rootMargin:-m+"px "+-h+"px "+-v+"px "+-g+"px",threshold:ie(0,ye(1,s))||1};let S=!0;function E(V){const M=V[0].intersectionRatio;if(M!==s){if(!S)return i();M?i(!1,M):l=setTimeout(()=>{i(!1,1e-7)},1e3)}S=!1}try{o=new IntersectionObserver(E,ae(Y({},B),{root:a.ownerDocument}))}catch(V){o=new IntersectionObserver(E,B)}o.observe(e)}return i(!0),d}function It(e,n,o,l){l===void 0&&(l={});const{ancestorScroll:a=!0,ancestorResize:d=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:r=typeof IntersectionObserver=="function",animationFrame:s=!1}=l,u=Bt(e),c=a||d?[...u?Fe(u):[],...Fe(n)]:[];c.forEach(C=>{a&&C.addEventListener("scroll",o,{passive:!0}),d&&C.addEventListener("resize",o)});const p=u&&r?aa(u,o):null;let f=-1,m=null;i&&(m=new ResizeObserver(C=>{let[B]=C;B&&B.target===u&&m&&(m.unobserve(n),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=m)==null||S.observe(n)})),o()}),u&&!s&&m.observe(u),m.observe(n));let h,v=s?$e(e):null;s&&g();function g(){const C=$e(e);v&&(C.x!==v.x||C.y!==v.y||C.width!==v.width||C.height!==v.height)&&o(),v=C,h=requestAnimationFrame(g)}return o(),()=>{var C;c.forEach(B=>{a&&B.removeEventListener("scroll",o),d&&B.removeEventListener("resize",o)}),p==null||p(),(C=m)==null||C.disconnect(),m=null,s&&cancelAnimationFrame(h)}}const xt=_l,sa=zl,Vt=Ol,wn=Kl,ht=Fl,ia=Rl,kn=(e,n,o)=>{const l=new Map,a=Y({platform:la},o),d=ae(Y({},a.platform),{_c:l});return Tl(e,n,ae(Y({},a),{platform:d}))};function ra(e){return e!=null&&typeof e=="object"&&"$el"in e}function vt(e){if(ra(e)){const n=e.$el;return wt(n)&&Se(n)==="#comment"?null:n}return e}function da(e){return{name:"arrow",options:e,fn(n){const o=vt(t.unref(e.element));return o==null?{}:ia({element:o,padding:e.padding}).fn(n)}}}function $n(e){return typeof window=="undefined"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function _t(e,n){const o=$n(e);return Math.round(n*o)/o}function Bn(e,n,o){o===void 0&&(o={});const l=o.whileElementsMounted,a=t.computed(()=>{var A;return(A=t.unref(o.open))!=null?A:!0}),d=t.computed(()=>t.unref(o.middleware)),i=t.computed(()=>{var A;return(A=t.unref(o.placement))!=null?A:"bottom"}),r=t.computed(()=>{var A;return(A=t.unref(o.strategy))!=null?A:"absolute"}),s=t.computed(()=>{var A;return(A=t.unref(o.transform))!=null?A:!0}),u=t.computed(()=>vt(e.value)),c=t.computed(()=>vt(n.value)),p=t.ref(0),f=t.ref(0),m=t.ref(r.value),h=t.ref(i.value),v=t.shallowRef({}),g=t.ref(!1),C=t.computed(()=>{const A={position:m.value,left:"0",top:"0"};if(!c.value)return A;const $=_t(c.value,p.value),b=_t(c.value,f.value);return s.value?Y(ae(Y({},A),{transform:"translate("+$+"px, "+b+"px)"}),$n(c.value)>=1.5&&{willChange:"transform"}):{position:m.value,left:$+"px",top:b+"px"}});let B;function S(){u.value==null||c.value==null||kn(u.value,c.value,{middleware:d.value,placement:i.value,strategy:r.value}).then(A=>{p.value=A.x,f.value=A.y,m.value=A.strategy,h.value=A.placement,v.value=A.middlewareData,g.value=!0})}function E(){typeof B=="function"&&(B(),B=void 0)}function V(){if(E(),l===void 0){S();return}if(u.value!=null&&c.value!=null){B=l(u.value,c.value,S);return}}function M(){a.value||(g.value=!1)}return t.watch([d,i,r],S,{flush:"sync"}),t.watch([u,c],V,{flush:"sync"}),t.watch(a,M,{flush:"sync"}),t.getCurrentScope()&&t.onScopeDispose(E),{x:t.shallowReadonly(p),y:t.shallowReadonly(f),strategy:t.shallowReadonly(m),placement:t.shallowReadonly(h),middlewareData:t.shallowReadonly(v),isPositioned:t.shallowReadonly(g),floatingStyles:C,update:S}}function ua(e,n=Re){let l=Array.from(e).reduce((d,i)=>d*31+i.charCodeAt(0)&4294967295,0);l=l>>>0;const a=l.toString(36);return"".concat(n,"-").concat(a)}const zt=new Map;class Kt{constructor(n,o){me(this,"referenceElement");me(this,"tooltipElement");me(this,"textContent");me(this,"placement");me(this,"autoUpdateCleanup");me(this,"referenceElementHandlers");me(this,"tooltipElementHandlers");me(this,"escapeHandler");me(this,"timeoutId");var d,i;const l=n.ownerDocument,a=this.generateTooltipId(o.textContent);this.referenceElement=n,this.textContent=o.textContent,this.placement=(d=o.placement)!=null?d:"bottom",this.timeoutId=null,this.tooltipElement=l.createElement("div"),this.tooltipElement.classList.add("cdx-tooltip"),this.tooltipElement.role="tooltip",this.tooltipElement.id=a,this.referenceElement.setAttribute("aria-describedby",a),this.tooltipElement.textContent=this.textContent,(i=this.referenceElement.parentElement)==null||i.appendChild(this.tooltipElement),this.referenceElementHandlers={},this.referenceElementHandlers.mouseenter=this.show.bind(this),this.referenceElementHandlers.mouseleave=this.hideAfterDelay.bind(this),this.referenceElementHandlers.focus=this.show.bind(this),this.referenceElementHandlers.blur=this.hide.bind(this),this.tooltipElementHandlers={},this.tooltipElementHandlers.mouseenter=this.show.bind(this),this.tooltipElementHandlers.mouseleave=this.hideAfterDelay.bind(this),this.escapeHandler=this.onKeyup.bind(this),this.addEventListeners(),this.autoUpdateCleanup=It(this.referenceElement,this.tooltipElement,()=>this.update())}generateTooltipId(n){var a;const o=n.trim(),l=(a=zt.get(o))!=null?a:0;return zt.set(o,l+1),ua(o+"-"+l,"cdx-tooltip")}isVisible(){return this.tooltipElement.style.display==="block"}show(){this.timeoutId&&clearTimeout(this.timeoutId),this.tooltipElement.style.display="block",this.tooltipElement.ownerDocument.addEventListener("keyup",this.escapeHandler)}hide(){this.tooltipElement.style.display="none",this.tooltipElement.ownerDocument.removeEventListener("keyup",this.escapeHandler)}hideAfterDelay(){this.timeoutId=setTimeout(this.hide.bind(this),250)}onKeyup(n){n.key==="Escape"&&this.isVisible()&&this.hide()}addEventListeners(){Object.keys(this.referenceElementHandlers).forEach(n=>{this.referenceElement.addEventListener(n,this.referenceElementHandlers[n])}),Object.keys(this.tooltipElementHandlers).forEach(n=>{this.tooltipElement.addEventListener(n,this.tooltipElementHandlers[n])})}removeEventListeners(){Object.keys(this.referenceElementHandlers).forEach(n=>{this.referenceElement.removeEventListener(n,this.referenceElementHandlers[n])}),Object.keys(this.tooltipElementHandlers).forEach(n=>{this.tooltipElement.removeEventListener(n,this.tooltipElementHandlers[n])})}update(){kn(this.referenceElement,this.tooltipElement,{placement:this.placement,middleware:[xt(4),Vt(),sa(),ht()]}).then(({x:n,y:o,middlewareData:l})=>{var d,i,r;const a=(i=(d=l.offset)==null?void 0:d.placement)!=null?i:this.placement;Object.assign(this.tooltipElement.style,{left:"".concat(n,"px"),top:"".concat(o,"px"),visibility:(r=l.hide)!=null&&r.referenceHidden?"hidden":"visible",transformOrigin:an[a]})})}updateWithOptions(n){var o;this.textContent=n.textContent,this.placement=(o=n.placement)!=null?o:this.placement,this.tooltipElement.textContent=this.textContent,this.update()}remove(){this.tooltipElement.remove(),this.autoUpdateCleanup(),this.removeEventListeners()}}const Et={mounted(e,{value:n,arg:o}){n&&(typeof n=="string"&&n.trim()===""||(e.tooltip=new Kt(e,{textContent:String(n),placement:o})))},updated(e,{value:n,arg:o}){n!==null&&(e.tooltip?e.tooltip.updateWithOptions({textContent:String(n),placement:o}):e.tooltip=new Kt(e,{textContent:String(n),placement:o}))},beforeUnmount(e){e.tooltip&&e.tooltip.remove()}},ca=t.defineComponent({name:"CdxInputChip",components:{CdxButton:fe,CdxIcon:G},directives:{tooltip:Et},props:{icon:{type:[String,Object],default:null},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},className:{type:String,default:""}},emits:["remove-chip","click-chip","arrow-left","arrow-right"],setup(e,{emit:n,slots:o}){const l=t.computed(()=>e.disabled?-1:0),a=t.ref(),d=t.computed(()=>({"cdx-input-chip--disabled":e.disabled,"cdx-input-chip--readonly":e.readonly,[e.className]:e.className.length>0})),i=X("cdx-input-chip-aria-description","Press Enter to edit or Delete to remove"),r=t.ref(),s=t.ref(!1),u=t.computed(()=>s.value&&r.value&&r.value.scrollWidth>r.value.clientWidth?Ae(o==null?void 0:o.default)[0]:null);t.onMounted(()=>{s.value=!0});function c(p){var f;switch(p.key){case"Enter":n("click-chip"),p.preventDefault(),p.stopPropagation();break;case"Escape":(f=a.value)==null||f.blur(),p.preventDefault(),p.stopPropagation();break;case"Backspace":case"Delete":n("remove-chip",p.key),p.preventDefault(),p.stopPropagation();break;case"ArrowLeft":n("arrow-left"),p.preventDefault(),p.stopPropagation();break;case"ArrowRight":n("arrow-right"),p.preventDefault(),p.stopPropagation();break}}return{rootElement:a,rootClasses:d,ariaDescription:i,onKeydown:c,cdxIconClose:Xe,tabIndex:l,tooltipContent:u,textElement:r}},methods:{focus(){this.$refs.rootElement.focus()}}}),pa=["tabindex","aria-description"],fa={ref:"textElement",class:"cdx-input-chip__text"};function ma(e,n,o,l,a,d){const i=t.resolveComponent("cdx-icon"),r=t.resolveComponent("cdx-button"),s=t.resolveDirective("tooltip");return t.withDirectives((t.openBlock(),t.createElementBlock("div",{ref:"rootElement",class:t.normalizeClass(["cdx-input-chip",e.rootClasses]),tabindex:e.tabIndex,role:"option","aria-description":e.ariaDescription,onKeydown:n[1]||(n[1]=(...u)=>e.onKeydown&&e.onKeydown(...u)),onClick:n[2]||(n[2]=u=>e.$emit("click-chip"))},[e.icon?(t.openBlock(),t.createBlock(i,{key:0,icon:e.icon,size:"small"},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",fa,[t.renderSlot(e.$slots,"default")],512),t.createVNode(r,{class:"cdx-input-chip__button",weight:"quiet",tabindex:"-1","aria-hidden":"true",disabled:e.disabled||e.readonly,onClick:n[0]||(n[0]=t.withModifiers(u=>e.$emit("remove-chip","button"),["stop"]))},{default:t.withCtx(()=>[t.createVNode(i,{ic