UNPKG

@wikimedia/codex

Version:

Codex Design System for Wikimedia

1 lines 193 kB
(function(I,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(I=typeof globalThis!="undefined"?globalThis:I||self,t(I.codex={},I.Vue))})(this,function(I,t){"use strict";var jd=Object.defineProperty,Wd=Object.defineProperties;var qd=Object.getOwnPropertyDescriptors;var $t=Object.getOwnPropertySymbols;var mn=Object.prototype.hasOwnProperty,hn=Object.prototype.propertyIsEnumerable;var so=(I,t,oe)=>t in I?jd(I,t,{enumerable:!0,configurable:!0,writable:!0,value:oe}):I[t]=oe,Y=(I,t)=>{for(var oe in t||(t={}))mn.call(t,oe)&&so(I,oe,t[oe]);if($t)for(var oe of $t(t))hn.call(t,oe)&&so(I,oe,t[oe]);return I},se=(I,t)=>Wd(I,qd(t));var ge=(I,t)=>{var oe={};for(var be in I)mn.call(I,be)&&t.indexOf(be)<0&&(oe[be]=I[be]);if(I!=null&&$t)for(var be of $t(I))t.indexOf(be)<0&&hn.call(I,be)&&(oe[be]=I[be]);return oe};var Ve=(I,t,oe)=>so(I,typeof t!="symbol"?t+"":t,oe);function oe(e){return e.replace(/([\\{}()|.?*+\-^$[\]])/g,"\\$1")}const be="[̀-ͯ҃-҉֑-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣ৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఀ-ఄా-ౄె-ైొ-్ౕౖౢౣಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝᠋-᠍ᢅᢆᢩᤠ-ᤫᤰ-᤻ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼᪰-᪾ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-ᮭ᯦-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ-᳴᳷-᳹᷀-᷹᷻-᷿⃐-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯-꙲ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣠-꣱ꣿꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꧥꨩ-ꨶꩃꩌꩍꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭ﬞ︀-️︠-︯]";function io(e,o){if(!e)return[o,"",""];const n=oe(e),l=new RegExp(n+be+"*","i").exec(o);if(!l||l.index===void 0)return[o,"",""];const s=l.index,d=s+l[0].length,r=o.slice(s,d),a=o.slice(0,s),i=o.slice(d,o.length);return[a,r,i]}const gn=Object.freeze(Object.defineProperty({__proto__:null,regExpEscape:oe,splitStringAtMatch:io},Symbol.toStringTag,{value:"Module"})),bn='<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"/>',yn='<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"/>',Cn='<path d="M7 14.17 2.83 10l-1.41 1.41L7 17 19 5l-1.41-1.42z"/>',wn='<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"/>',kn='<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"/>',Bn='<path d="M10 15 2 5h16z"/>',$n='<path d="M13.728 1H6.272L1 6.272v7.456L6.272 19h7.456L19 13.728V6.272zM11 15H9v-2h2zm0-4H9V5h2z"/>',Sn='<path d="m17.5 4.75-7.5 7.5-7.5-7.5L1 6.25l9 9 9-9z"/>',In='<path d="M2 2a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V4a2 2 0 00-2-2zm-.17 13 4.09-5.25 2.92 3.51L12.92 8l5.25 7z"/>',Vn='<path d="M19 3H1v14h18zM3 14l3.5-4.5 2.5 3L12.5 8l4.5 6z"/><path d="M19 5H1V3h18zm0 12H1v-2h18z"/>',En='<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"/>',xn='<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"/>',Tn='<path d="M3 1h2v18H3zm13.5 1.5L15 1l-9 9 9 9 1.5-1.5L9 10z"/>',Nn='<path d="M15 1h2v18h-2zM3.5 2.5 11 10l-7.5 7.5L5 19l9-9-9-9z"/>',Dn='<path d="M7 1 5.6 2.5 13 10l-7.4 7.5L7 19l9-9z"/>',An='<path d="m4 10 9 9 1.4-1.5L7 10l7.4-7.5L13 1z"/>',Ln='<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"/>',Mn='<path d="M10 0 3 8h14zm0 18-7-8h14z"/>',vn='<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"/>',Rn='<path d="m10 5 8 10H2z"/>',ro=bn,Pn=yn,Fn=Cn,On=wn,at=kn,zn=Bn,co=$n,uo=Sn,Hn=In,Kn=Vn,ze={langCodeMap:{ar:En},default:xn},_n={ltr:Tn,shouldFlip:!0},Un={ltr:Nn,shouldFlip:!0},po={ltr:Dn,shouldFlip:!0},fo={ltr:An,shouldFlip:!0},jn=Ln,Wn=Mn,mo=vn,qn=Rn;function Qn(e,o,n){if(typeof e=="string"||"path"in e)return e;if("shouldFlip"in e)return e.ltr;if("rtl"in e)return n==="rtl"?e.rtl:e.ltr;const l=o in e.langCodeMap?e.langCodeMap[o]:e.default;return typeof l=="string"||"path"in l?l:l.ltr}function Xn(e,o){if(typeof e=="string")return!1;if("langCodeMap"in e){const n=o in e.langCodeMap?e.langCodeMap[o]:e.default;if(typeof n=="string")return!1;e=n}if("shouldFlipExceptions"in e&&Array.isArray(e.shouldFlipExceptions)){const n=e.shouldFlipExceptions.indexOf(o);return n===void 0||n===-1}return"shouldFlip"in e?e.shouldFlip:!1}function Ge(e){const o=t.ref(null);return t.onMounted(()=>{const n=window.getComputedStyle(e.value).direction;o.value=n==="ltr"||n==="rtl"?n:null}),o}function ho(e){const o=t.ref("");return t.onMounted(()=>{let n=e.value;for(;(n==null?void 0:n.lang)==="";)n=n.parentElement;o.value=n?n==null?void 0:n.lang:null}),o}function J(e){return o=>typeof o=="string"&&e.includes(o)}const Ye="cdx",Gn=["default","progressive","destructive"],Yn=["normal","primary","quiet"],go=["small","medium","large"],Jn=["x-small","small","medium"],st=J(["subtle","notice","progressive","warning","error","success"]),Zn=["text","search","number","email","month","password","tel","url","week","date","datetime-local","time"],ye=["default","warning","error","success"],el=["start","center","end","number"],tl=J(["16:9","3:2","4:3","1:1","3:4","2:3"]),ol=J(["fill","contain","cover","none","scale-down"]),nl=J(["top","bottom","left","right","center"]),ll=["none","minimal","divider","outline"],al=120,sl=500,He="cdx-menu-footer-item",bo=Symbol("CdxTabs"),yo=Symbol("CdxActiveTab"),Co=Symbol("CdxAllowArbitrary"),wo=Symbol("CdxFieldInputId"),it=Symbol("CdxFieldDescriptionId"),ko=Symbol("CdxFieldStatus"),Bo=Symbol("CdxDisabled"),il="".concat(Ye,"-no-invert"),rt=Symbol("CdxTableRowIdentifier"),rl=["top","bottom","both"],$o={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"},dl=J(Jn),cl=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:dl}},setup(e){const o=t.ref(),n=Ge(o),l=ho(o),s=t.computed(()=>{var c;return(c=e.dir)!=null?c:n.value}),d=t.computed(()=>{var c;return(c=e.lang)!=null?c:l.value}),r=t.computed(()=>({"cdx-icon--flipped":s.value==="rtl"&&d.value!==null&&Xn(e.icon,d.value),["cdx-icon--".concat(e.size)]:!0})),a=t.computed(()=>{var c,p;return Qn(e.icon,(c=d.value)!=null?c:"",(p=s.value)!=null?p:"ltr")}),i=t.computed(()=>typeof a.value=="string"?a.value:""),u=t.computed(()=>typeof a.value!="string"?a.value.path:"");return{rootElement:o,rootClasses:r,iconSvg:i,iconPath:u}}}),_=(e,o)=>{const n=e.__vccOpts||e;for(const[l,s]of o)n[l]=s;return n},ul=["aria-hidden"],pl={key:0},fl=["innerHTML"],ml=["d"];function hl(e,o,n,l,s,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",pl,t.toDisplayString(e.iconLabel),1)):t.createCommentVNode("v-if",!0),e.iconSvg?(t.openBlock(),t.createElementBlock("g",{key:1,innerHTML:e.iconSvg},null,8,fl)):(t.openBlock(),t.createElementBlock("path",{key:2,d:e.iconPath},null,8,ml))],8,ul))],2)}const Z=_(cl,[["render",hl]]);function So(e){const o=[];for(const n of e)typeof n.type=="string"||typeof n.type=="object"?o.push(n):n.type!==t.Comment&&(typeof n.children=="string"&&n.children.trim()!==""?o.push(n.children):Array.isArray(n.children)&&o.push(...So(n.children)));return o}function Io(e,o){return typeof e.type=="object"&&"name"in e.type?o!==void 0?e.type.name===o:!0:!1}function gl(e,o){return typeof e.type=="string"?e.type===o.toLowerCase():!1}function Ke(e){const o=typeof e=="function"?e():e;return o?So(o):[]}function dt(e,o){if(e()){t.warn(o);return}const n=t.watch(e,l=>{l&&(t.warn(o),n())})}function Vo(e,o,n){const l=t.computed(()=>{const s=Ke(e);if(s.length!==1)return!1;const d=s[0];return!!(typeof d=="object"&&(Io(d,"CdxIcon")||gl(d,"svg")))});return dt(()=>l.value&&!o["aria-label"]&&!o["aria-hidden"],"".concat(n,": 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 bl=J(Gn),yl=J(Yn),Cl=J(go),wl=t.defineComponent({name:"CdxButton",props:{action:{type:String,default:"default",validator:bl},weight:{type:String,default:"normal",validator:yl},size:{type:String,default:"medium",validator:Cl}},emits:["click"],setup(e,{emit:o,slots:n,attrs:l}){const s=t.ref(),d=Vo(n.default,l,"CdxButton"),r=t.ref(!1),a=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":r.value})),i=f=>{o("click",f)},u=f=>{r.value=f};function c(){u(!0)}function p(){var f;u(!1),(f=s.value)==null||f.click()}return{button:s,rootClasses:a,onClick:i,onKeyDown:c,onKeyUp:p}}});function kl(e,o,n,l,s,d){return t.openBlock(),t.createElementBlock("button",{ref:"button",class:t.normalizeClass(["cdx-button",e.rootClasses]),onKeydown:o[0]||(o[0]=t.withKeys(t.withModifiers((...r)=>e.onKeyDown&&e.onKeyDown(...r),["prevent"]),["space","enter"])),onKeyup:o[1]||(o[1]=t.withKeys((...r)=>e.onKeyUp&&e.onKeyUp(...r),["space","enter"])),onClick:o[2]||(o[2]=(...r)=>e.onClick&&e.onClick(...r))},[t.renderSlot(e.$slots,"default")],34)}const he=_(wl,[["render",kl]]);function Je(e,o,n,l){return t.computed({get:()=>{var s;return(s=o.value)!=null?s:e.value},set:s=>{o.value!==null?n(l||"update:modelValue",s):e.value=s}})}const Bl=J(ll),$l=t.defineComponent({name:"CdxAccordion",components:{CdxButton:he,CdxIcon:Z},props:{modelValue:{type:[Boolean,null],default:null},actionAlwaysVisible:{type:Boolean,default:!1},separation:{type:String,default:"divider",validator:Bl},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:o,emit:n}){const l=t.ref("open"in o),s=Je(l,t.toRef(e,"modelValue"),n),d=()=>{n("action-button-click")},r=u=>{s.value=u.newState==="open",n("toggle",s.value)},a=t.computed(()=>e.actionIcon?s.value?!0:!!e.actionAlwaysVisible:!1),i=t.computed(()=>({"cdx-accordion--has-icon":a.value,["cdx-accordion--separation-".concat(e.separation)]:!0}));return{emitActionButtonClick:d,rootClasses:i,shouldShowActionButton:a,onToggle:r,computedOpen:s}}}),Sl=["open"],Il={class:"cdx-accordion__header__title"},Vl={class:"cdx-accordion__header__description"};function El(e,o,n,l,s,d){const r=t.resolveComponent("cdx-icon"),a=t.resolveComponent("cdx-button");return t.openBlock(),t.createElementBlock("details",{class:t.normalizeClass(["cdx-accordion",e.rootClasses]),open:e.computedOpen||void 0,onToggle:o[1]||(o[1]=(...i)=>e.onToggle&&e.onToggle(...i))},[t.createElementVNode("summary",null,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.headingLevel),{class:"cdx-accordion__header"},{default:t.withCtx(()=>[t.createElementVNode("span",Il,[t.renderSlot(e.$slots,"title")]),t.createElementVNode("span",Vl,[t.renderSlot(e.$slots,"description")])]),_:3})),e.shouldShowActionButton?(t.openBlock(),t.createBlock(a,{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(r,{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:o[0]||(o[0]=t.withModifiers(()=>{},["stop"]))},[t.renderSlot(e.$slots,"default")])],42,Sl)}const xl=_($l,[["render",El]]);function Eo(e){return e.label===void 0?e.value:e.label===null?"":e.label}function xo(e){const o=t.ref(),n=t.ref(),l=t.ref(new Map),s=Ge(o);function d(g,b){const y=g;y&&l.value.set(b,y)}function r(g){n.value=g}function a(){n.value=void 0}function i(g,b){var k;const y=g+b,w=e.value[y];if(w)if(w.disabled)i(y,b);else{const S=(k=l.value.get(y))==null?void 0:k.$el;S==null||S.focus()}}function u(){var g;i((g=n.value)!=null?g:-1,1)}function c(){var g;i((g=n.value)!=null?g:e.value.length,-1)}function p(){s.value==="rtl"?c():u()}function f(){s.value==="rtl"?u():c()}function m(g){switch(g.key){case"ArrowRight":g.preventDefault(),p();break;case"ArrowLeft":g.preventDefault(),f();break;case"ArrowDown":g.preventDefault(),u();break;case"ArrowUp":g.preventDefault(),c();break}}return{rootElement:o,assignTemplateRef:d,onFocus:r,onBlur:a,onKeydown:m}}const Tl=t.defineComponent({name:"CdxButtonGroup",components:{CdxButton:he,CdxIcon:Z},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:o,assignTemplateRef:n,onFocus:l,onBlur:s,onKeydown:d}=xo(t.toRef(e,"buttons"));return{rootElement:o,assignTemplateRef:n,onFocus:l,onBlur:s,onKeydown:d,getButtonLabel:Eo}}}),Nl={ref:"rootElement",class:"cdx-button-group"};function Dl(e,o,n,l,s,d){const r=t.resolveComponent("cdx-icon"),a=t.resolveComponent("cdx-button");return t.openBlock(),t.createElementBlock("div",Nl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.buttons,(i,u)=>(t.openBlock(),t.createBlock(a,{key:i.value,ref_for:!0,ref:c=>e.assignTemplateRef(c,u),disabled:i.disabled||e.disabled,"aria-label":i.ariaLabel,onClick:c=>e.$emit("click",i.value),onFocus:c=>e.onFocus(u),onBlur:e.onBlur,onKeydown:e.onKeydown},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{button:i},()=>[i.icon?(t.openBlock(),t.createBlock(r,{key:0,icon:i.icon},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createTextVNode(" "+t.toDisplayString(e.getButtonLabel(i)),1)])]),_:2},1032,["disabled","aria-label","onClick","onFocus","onBlur","onKeydown"]))),128))],512)}const Al=_(Tl,[["render",Dl]]),Ll=t.defineComponent({name:"CdxThumbnail",components:{CdxIcon:Z},props:{thumbnail:{type:[Object,null],default:null},placeholderIcon:{type:[String,Object],default:Kn}},setup:e=>{const o=t.ref(!1),n=t.ref({}),l=s=>{const d=s.replace(/([\\"\n])/g,"\\$1"),r=new Image;r.onload=()=>{n.value={backgroundImage:'url("'.concat(d,'")')},o.value=!0},r.onerror=()=>{o.value=!1},r.src=d};return t.onMounted(()=>{var s;(s=e.thumbnail)!=null&&s.url&&l(e.thumbnail.url)}),t.watch(t.toRef(e,"thumbnail"),(s,d)=>{if(!(s!=null&&s.url)){o.value=!1,n.value={};return}(d==null?void 0:d.url)!==s.url&&(o.value=!1,l(s.url))},{deep:!0}),{thumbnailStyle:n,thumbnailLoaded:o,NoInvertClass:il}}}),Ml={class:"cdx-thumbnail"},vl={key:0,class:"cdx-thumbnail__placeholder"};function Rl(e,o,n,l,s,d){const r=t.resolveComponent("cdx-icon");return t.openBlock(),t.createElementBlock("span",Ml,[e.thumbnailLoaded?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock("span",vl,[t.createVNode(r,{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 St=_(Ll,[["render",Rl]]),Pl=t.defineComponent({name:"CdxCard",components:{CdxIcon:Z,CdxThumbnail:St},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 o=t.computed(()=>!!e.url),n=t.computed(()=>o.value?"a":"span"),l=t.computed(()=>o.value?e.url:void 0);return{isLink:o,contentTag:n,cardLink:l}}}),Fl={class:"cdx-card__text"},Ol={class:"cdx-card__text__title"},zl={key:0,class:"cdx-card__text__description"},Hl={key:1,class:"cdx-card__text__supporting-text"};function Kl(e,o,n,l,s,d){const r=t.resolveComponent("cdx-thumbnail"),a=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(r,{key:0,thumbnail:e.thumbnail,"placeholder-icon":e.customPlaceholderIcon,class:"cdx-card__thumbnail"},null,8,["thumbnail","placeholder-icon"])):e.icon?(t.openBlock(),t.createBlock(a,{key:1,icon:e.icon,class:"cdx-card__icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",Fl,[t.createElementVNode("span",Ol,[t.renderSlot(e.$slots,"title")]),e.$slots.description?(t.openBlock(),t.createElementBlock("span",zl,[t.renderSlot(e.$slots,"description")])):t.createCommentVNode("v-if",!0),e.$slots["supporting-text"]?(t.openBlock(),t.createElementBlock("span",Hl,[t.renderSlot(e.$slots,"supporting-text")])):t.createCommentVNode("v-if",!0)])]),_:3},8,["href","class"])}const _l=_(Pl,[["render",Kl]]);function It(e){const o=t.inject(Bo,t.ref(!1));return t.computed(()=>o.value||e.value)}function pe(e,o,n){const l=It(e),s=t.inject(ko,t.ref("default")),d=t.computed(()=>o!=null&&o.value&&o.value!=="default"?o.value:s.value),r=t.inject(wo,void 0),a=t.computed(()=>{var i;return(i=r==null?void 0:r.value)!=null?i:n});return{computedDisabled:l,computedStatus:d,computedInputId:a}}function ie(e,o=t.computed(()=>({}))){const n=t.computed(()=>{const d=ge(o.value,[]);return e.class&&e.class.split(" ").forEach(a=>{d[a]=!0}),d}),l=t.computed(()=>{if("style"in e)return e.style}),s=t.computed(()=>{const i=e,{class:d,style:r}=i;return ge(i,["class","style"])});return{rootClasses:n,rootStyle:l,otherAttrs:s}}function te(e,o,n=[]){const l=t.inject("CdxI18nFunction",void 0);return t.computed(()=>{const s=n.map(r=>typeof r=="function"?r():r.value),d=l==null?void 0:l(e,...s);return d!=null?d:typeof o=="function"?o(...s):o})}function Ze(e,o,n,l=[]){const s=te(o,n,l);return t.computed(()=>e.value||s.value)}const Ul=t.defineComponent({name:"CdxLabel",components:{CdxIcon:Z},inheritAttrs:!1,props:{icon:{type:[String,Object],default:null},optional:{type:Boolean,default:!1},optionalFlag:{type:String,default:"",validator:(e,o)=>e.length>0&&!o.optional?(console.warn("[CdxLabel]: The boolean `optional` prop is required to show the optional flag.\n\nRefer to https://doc.wikimedia.org/codex/latest/components/demos/label.html#props."),!1):!0},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:o}){const{computedDisabled:n}=pe(t.toRef(e,"disabled")),l=t.computed(()=>({"cdx-label--visually-hidden":e.visuallyHidden,"cdx-label--disabled":n.value})),{rootClasses:s,rootStyle:d,otherAttrs:r}=ie(o,l),a=Ze(t.toRef(e,"optionalFlag"),"cdx-label-optional-flag","(optional)");return{rootClasses:s,rootStyle:d,otherAttrs:r,translatedOptionalFlag:a}}}),jl=["for"],Wl={class:"cdx-label__label__text"},ql={key:1,class:"cdx-label__label__optional-flag"},Ql=["id"],Xl={class:"cdx-label__label"},Gl={class:"cdx-label__label__text"},Yl={key:1,class:"cdx-label__label__optional-flag"},Jl={key:0,class:"cdx-label__description"};function Zl(e,o,n,l,s,d){const r=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",Xl,[e.icon?(t.openBlock(),t.createBlock(r,{key:0,icon:e.icon,class:"cdx-label__label__icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",Gl,[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",Jl,[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(r,{key:0,icon:e.icon,class:"cdx-label__label__icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",Wl,[t.renderSlot(e.$slots,"default")]),e.optionalFlag||e.optional?(t.openBlock(),t.createElementBlock("span",ql,t.toDisplayString(" ")+" "+t.toDisplayString(e.translatedOptionalFlag),1)):t.createCommentVNode("v-if",!0)],16,jl),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,Ql)):t.createCommentVNode("v-if",!0)],6))}const _e=_(Ul,[["render",Zl]]);function ct(e,o,n){dt(()=>Ke(e).length===0&&!(o!=null&&o["aria-label"])&&!(o!=null&&o["aria-labelledby"]),"".concat(n,": 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 ce(e,o,n){return t.computed({get:()=>e.value,set:l=>o(n||"update:modelValue",l)})}const ea=J(ye),ta=t.defineComponent({name:"CdxCheckbox",components:{CdxLabel:_e},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:ea}},emits:["update:modelValue"],setup(e,{emit:o,slots:n,attrs:l}){var f;ct((f=n.default)==null?void 0:f.call(n),l,"CdxCheckbox");const{computedDisabled:s,computedStatus:d}=pe(t.toRef(e,"disabled"),t.toRef(e,"status")),r=t.computed(()=>({"cdx-checkbox--inline":e.inline,["cdx-checkbox--status-".concat(d.value)]:!0})),a=t.computed(()=>({"cdx-checkbox__custom-input--inline":e.inline})),i=t.ref(),u=t.useId(),c=t.useId(),p=ce(t.toRef(e,"modelValue"),o);return{rootClasses:r,computedDisabled:s,input:i,checkboxId:u,descriptionId:c,wrappedModel:p,customInputClasses:a}}}),oa={class:"cdx-checkbox__wrapper"},na=["id","aria-describedby","value","name","disabled",".indeterminate"];function la(e,o,n,l,s,d){const r=t.resolveComponent("cdx-label");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-checkbox",e.rootClasses])},[t.createElementVNode("div",oa,[t.withDirectives(t.createElementVNode("input",{id:e.checkboxId,ref:"input","onUpdate:modelValue":o[0]||(o[0]=a=>e.wrappedModel=a),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,na),[[t.vModelCheckbox,e.wrappedModel]]),o[1]||(o[1]=t.createElementVNode("span",{class:"cdx-checkbox__icon"},null,-1)),e.$slots.default&&e.$slots.default().length?(t.openBlock(),t.createBlock(r,{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 To=_(ta,[["render",la]]),aa=["top","right","bottom","left"],Te=Math.min,fe=Math.max,ut=Math.round,pt=Math.floor,$e=e=>({x:e,y:e}),sa={left:"right",right:"left",bottom:"top",top:"bottom"},ia={start:"end",end:"start"};function Vt(e,o,n){return fe(e,Te(o,n))}function Me(e,o){return typeof e=="function"?e(o):e}function Ne(e){return e.split("-")[0]}function Ue(e){return e.split("-")[1]}function No(e){return e==="x"?"y":"x"}function Et(e){return e==="y"?"height":"width"}function ve(e){return["top","bottom"].includes(Ne(e))?"y":"x"}function xt(e){return No(ve(e))}function ra(e,o,n){n===void 0&&(n=!1);const l=Ue(e),s=xt(e),d=Et(s);let r=s==="x"?l===(n?"end":"start")?"right":"left":l==="start"?"bottom":"top";return o.reference[d]>o.floating[d]&&(r=ft(r)),[r,ft(r)]}function da(e){const o=ft(e);return[Tt(e),o,Tt(o)]}function Tt(e){return e.replace(/start|end/g,o=>ia[o])}function ca(e,o,n){const l=["left","right"],s=["right","left"],d=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return n?o?s:l:o?l:s;case"left":case"right":return o?d:r;default:return[]}}function ua(e,o,n,l){const s=Ue(e);let d=ca(Ne(e),n==="start",l);return s&&(d=d.map(r=>r+"-"+s),o&&(d=d.concat(d.map(Tt)))),d}function ft(e){return e.replace(/left|right|bottom|top/g,o=>sa[o])}function pa(e){return Y({top:0,right:0,bottom:0,left:0},e)}function Do(e){return typeof e!="number"?pa(e):{top:e,right:e,bottom:e,left:e}}function mt(e){const{x:o,y:n,width:l,height:s}=e;return{width:l,height:s,top:n,left:o,right:o+l,bottom:n+s,x:o,y:n}}function Ao(e,o,n){let{reference:l,floating:s}=e;const d=ve(o),r=xt(o),a=Et(r),i=Ne(o),u=d==="y",c=l.x+l.width/2-s.width/2,p=l.y+l.height/2-s.height/2,f=l[a]/2-s[a]/2;let m;switch(i){case"top":m={x:c,y:l.y-s.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-s.width,y:p};break;default:m={x:l.x,y:l.y}}switch(Ue(o)){case"start":m[r]-=f*(n&&u?-1:1);break;case"end":m[r]+=f*(n&&u?-1:1);break}return m}const fa=async(e,o,n)=>{const{placement:l="bottom",strategy:s="absolute",middleware:d=[],platform:r}=n,a=d.filter(Boolean),i=await(r.isRTL==null?void 0:r.isRTL(o));let u=await r.getElementRects({reference:e,floating:o,strategy:s}),{x:c,y:p}=Ao(u,l,i),f=l,m={},g=0;for(let b=0;b<a.length;b++){const{name:y,fn:w}=a[b],{x:k,y:S,data:V,reset:A}=await w({x:c,y:p,initialPlacement:l,placement:f,strategy:s,middlewareData:m,rects:u,platform:r,elements:{reference:e,floating:o}});c=k!=null?k:c,p=S!=null?S:p,m=se(Y({},m),{[y]:Y(Y({},m[y]),V)}),A&&g<=50&&(g++,typeof A=="object"&&(A.placement&&(f=A.placement),A.rects&&(u=A.rects===!0?await r.getElementRects({reference:e,floating:o,strategy:s}):A.rects),{x:c,y:p}=Ao(u,f,i)),b=-1)}return{x:c,y:p,placement:f,strategy:s,middlewareData:m}};async function et(e,o){var n;o===void 0&&(o={});const{x:l,y:s,platform:d,rects:r,elements:a,strategy:i}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:p="floating",altBoundary:f=!1,padding:m=0}=Me(o,e),g=Do(m),y=a[f?p==="floating"?"reference":"floating":p],w=mt(await d.getClippingRect({element:(n=await(d.isElement==null?void 0:d.isElement(y)))==null||n?y:y.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:i})),k=p==="floating"?{x:l,y:s,width:r.floating.width,height:r.floating.height}:r.reference,S=await(d.getOffsetParent==null?void 0:d.getOffsetParent(a.floating)),V=await(d.isElement==null?void 0:d.isElement(S))?await(d.getScale==null?void 0:d.getScale(S))||{x:1,y:1}:{x:1,y:1},A=mt(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:k,offsetParent:S,strategy:i}):k);return{top:(w.top-A.top+g.top)/V.y,bottom:(A.bottom-w.bottom+g.bottom)/V.y,left:(w.left-A.left+g.left)/V.x,right:(A.right-w.right+g.right)/V.x}}const ma=e=>({name:"arrow",options:e,async fn(o){const{x:n,y:l,placement:s,rects:d,platform:r,elements:a,middlewareData:i}=o,{element:u,padding:c=0}=Me(e,o)||{};if(u==null)return{};const p=Do(c),f={x:n,y:l},m=xt(s),g=Et(m),b=await r.getDimensions(u),y=m==="y",w=y?"top":"left",k=y?"bottom":"right",S=y?"clientHeight":"clientWidth",V=d.reference[g]+d.reference[m]-f[m]-d.floating[g],A=f[m]-d.reference[m],L=await(r.getOffsetParent==null?void 0:r.getOffsetParent(u));let E=L?L[S]:0;(!E||!await(r.isElement==null?void 0:r.isElement(L)))&&(E=a.floating[S]||d.floating[g]);const M=V/2-A/2,B=E/2-b[g]/2-1,D=Te(p[w],B),h=Te(p[k],B),$=D,N=E-b[g]-h,P=E/2-b[g]/2+M,W=Vt($,P,N),X=!i.arrow&&Ue(s)!=null&&P!==W&&d.reference[g]/2-(P<$?D:h)-b[g]/2<0,Q=X?P<$?P-$:P-N:0;return{[m]:f[m]+Q,data:Y({[m]:W,centerOffset:P-W-Q},X&&{alignmentOffset:Q}),reset:X}}}),ha=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(o){var n,l;const{placement:s,middlewareData:d,rects:r,initialPlacement:a,platform:i,elements:u}=o,P=Me(e,o),{mainAxis:c=!0,crossAxis:p=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:b=!0}=P,y=ge(P,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((n=d.arrow)!=null&&n.alignmentOffset)return{};const w=Ne(s),k=ve(a),S=Ne(a)===a,V=await(i.isRTL==null?void 0:i.isRTL(u.floating)),A=f||(S||!b?[ft(a)]:da(a)),L=g!=="none";!f&&L&&A.push(...ua(a,b,g,V));const E=[a,...A],M=await et(o,y),B=[];let D=((l=d.flip)==null?void 0:l.overflows)||[];if(c&&B.push(M[w]),p){const W=ra(s,r,V);B.push(M[W[0]],M[W[1]])}if(D=[...D,{placement:s,overflows:B}],!B.every(W=>W<=0)){var h,$;const W=(((h=d.flip)==null?void 0:h.index)||0)+1,X=E[W];if(X)return{data:{index:W,overflows:D},reset:{placement:X}};let Q=($=D.filter(ee=>ee.overflows[0]<=0).sort((ee,z)=>ee.overflows[1]-z.overflows[1])[0])==null?void 0:$.placement;if(!Q)switch(m){case"bestFit":{var N;const ee=(N=D.filter(z=>{if(L){const O=ve(z.placement);return O===k||O==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(O=>O>0).reduce((O,F)=>O+F,0)]).sort((z,O)=>z[1]-O[1])[0])==null?void 0:N[0];ee&&(Q=ee);break}case"initialPlacement":Q=a;break}if(s!==Q)return{reset:{placement:Q}}}return{}}}};function Lo(e,o){return{top:e.top-o.height,right:e.right-o.width,bottom:e.bottom-o.height,left:e.left-o.width}}function Mo(e){return aa.some(o=>e[o]>=0)}const ga=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(o){const{rects:n}=o,d=Me(e,o),{strategy:l="referenceHidden"}=d,s=ge(d,["strategy"]);switch(l){case"referenceHidden":{const r=await et(o,se(Y({},s),{elementContext:"reference"})),a=Lo(r,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Mo(a)}}}case"escaped":{const r=await et(o,se(Y({},s),{altBoundary:!0})),a=Lo(r,n.floating);return{data:{escapedOffsets:a,escaped:Mo(a)}}}default:return{}}}}};async function ba(e,o){const{placement:n,platform:l,elements:s}=e,d=await(l.isRTL==null?void 0:l.isRTL(s.floating)),r=Ne(n),a=Ue(n),i=ve(n)==="y",u=["left","top"].includes(r)?-1:1,c=d&&i?-1:1,p=Me(o,e);let{mainAxis:f,crossAxis:m,alignmentAxis:g}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return a&&typeof g=="number"&&(m=a==="end"?g*-1:g),i?{x:m*c,y:f*u}:{x:f*u,y:m*c}}const ya=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(o){var n,l;const{x:s,y:d,placement:r,middlewareData:a}=o,i=await ba(o,e);return r===((n=a.offset)==null?void 0:n.placement)&&(l=a.arrow)!=null&&l.alignmentOffset?{}:{x:s+i.x,y:d+i.y,data:se(Y({},i),{placement:r})}}}},Ca=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(o){const{x:n,y:l,placement:s}=o,y=Me(e,o),{mainAxis:d=!0,crossAxis:r=!1,limiter:a={fn:w=>{let{x:k,y:S}=w;return{x:k,y:S}}}}=y,i=ge(y,["mainAxis","crossAxis","limiter"]),u={x:n,y:l},c=await et(o,i),p=ve(Ne(s)),f=No(p);let m=u[f],g=u[p];if(d){const w=f==="y"?"top":"left",k=f==="y"?"bottom":"right",S=m+c[w],V=m-c[k];m=Vt(S,m,V)}if(r){const w=p==="y"?"top":"left",k=p==="y"?"bottom":"right",S=g+c[w],V=g-c[k];g=Vt(S,g,V)}const b=a.fn(se(Y({},o),{[f]:m,[p]:g}));return se(Y({},b),{data:{x:b.x-n,y:b.y-l,enabled:{[f]:d,[p]:r}}})}}},wa=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(o){var n,l;const{placement:s,rects:d,platform:r,elements:a}=o,D=Me(e,o),{apply:i=()=>{}}=D,u=ge(D,["apply"]),c=await et(o,u),p=Ne(s),f=Ue(s),m=ve(s)==="y",{width:g,height:b}=d.floating;let y,w;p==="top"||p==="bottom"?(y=p,w=f===(await(r.isRTL==null?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(w=p,y=f==="end"?"top":"bottom");const k=b-c.top-c.bottom,S=g-c.left-c.right,V=Te(b-c[y],k),A=Te(g-c[w],S),L=!o.middlewareData.shift;let E=V,M=A;if((n=o.middlewareData.shift)!=null&&n.enabled.x&&(M=S),(l=o.middlewareData.shift)!=null&&l.enabled.y&&(E=k),L&&!f){const h=fe(c.left,0),$=fe(c.right,0),N=fe(c.top,0),P=fe(c.bottom,0);m?M=g-2*(h!==0||$!==0?h+$:fe(c.left,c.right)):E=b-2*(N!==0||P!==0?N+P:fe(c.top,c.bottom))}await i(se(Y({},o),{availableWidth:M,availableHeight:E}));const B=await r.getDimensions(a.floating);return g!==B.width||b!==B.height?{reset:{rects:!0}}:{}}}};function ht(){return typeof window!="undefined"}function Re(e){return Nt(e)?(e.nodeName||"").toLowerCase():"#document"}function me(e){var o;return(e==null||(o=e.ownerDocument)==null?void 0:o.defaultView)||window}function Se(e){var o;return(o=(Nt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:o.documentElement}function Nt(e){return ht()?e instanceof Node||e instanceof me(e).Node:!1}function Ce(e){return ht()?e instanceof Element||e instanceof me(e).Element:!1}function Ie(e){return ht()?e instanceof HTMLElement||e instanceof me(e).HTMLElement:!1}function vo(e){return!ht()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof me(e).ShadowRoot}function tt(e){const{overflow:o,overflowX:n,overflowY:l,display:s}=we(e);return/auto|scroll|overlay|hidden|clip/.test(o+l+n)&&!["inline","contents"].includes(s)}function ka(e){return["table","td","th"].includes(Re(e))}function gt(e){return[":popover-open",":modal"].some(o=>{try{return e.matches(o)}catch(n){return!1}})}function Dt(e){const o=At(),n=Ce(e)?we(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!o&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!o&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(l=>(n.willChange||"").includes(l))||["paint","layout","strict","content"].some(l=>(n.contain||"").includes(l))}function Ba(e){let o=De(e);for(;Ie(o)&&!je(o);){if(Dt(o))return o;if(gt(o))return null;o=De(o)}return null}function At(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function je(e){return["html","body","#document"].includes(Re(e))}function we(e){return me(e).getComputedStyle(e)}function bt(e){return Ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function De(e){if(Re(e)==="html")return e;const o=e.assignedSlot||e.parentNode||vo(e)&&e.host||Se(e);return vo(o)?o.host:o}function Ro(e){const o=De(e);return je(o)?e.ownerDocument?e.ownerDocument.body:e.body:Ie(o)&&tt(o)?o:Ro(o)}function ot(e,o,n){var l;o===void 0&&(o=[]),n===void 0&&(n=!0);const s=Ro(e),d=s===((l=e.ownerDocument)==null?void 0:l.body),r=me(s);if(d){const a=Lt(r);return o.concat(r,r.visualViewport||[],tt(s)?s:[],a&&n?ot(a):[])}return o.concat(s,ot(s,[],n))}function Lt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Po(e){const o=we(e);let n=parseFloat(o.width)||0,l=parseFloat(o.height)||0;const s=Ie(e),d=s?e.offsetWidth:n,r=s?e.offsetHeight:l,a=ut(n)!==d||ut(l)!==r;return a&&(n=d,l=r),{width:n,height:l,$:a}}function Mt(e){return Ce(e)?e:e.contextElement}function We(e){const o=Mt(e);if(!Ie(o))return $e(1);const n=o.getBoundingClientRect(),{width:l,height:s,$:d}=Po(o);let r=(d?ut(n.width):n.width)/l,a=(d?ut(n.height):n.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const $a=$e(0);function Fo(e){const o=me(e);return!At()||!o.visualViewport?$a:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function Sa(e,o,n){return o===void 0&&(o=!1),!n||o&&n!==me(e)?!1:o}function Pe(e,o,n,l){o===void 0&&(o=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),d=Mt(e);let r=$e(1);o&&(l?Ce(l)&&(r=We(l)):r=We(e));const a=Sa(d,n,l)?Fo(d):$e(0);let i=(s.left+a.x)/r.x,u=(s.top+a.y)/r.y,c=s.width/r.x,p=s.height/r.y;if(d){const f=me(d),m=l&&Ce(l)?me(l):l;let g=f,b=Lt(g);for(;b&&l&&m!==g;){const y=We(b),w=b.getBoundingClientRect(),k=we(b),S=w.left+(b.clientLeft+parseFloat(k.paddingLeft))*y.x,V=w.top+(b.clientTop+parseFloat(k.paddingTop))*y.y;i*=y.x,u*=y.y,c*=y.x,p*=y.y,i+=S,u+=V,g=me(b),b=Lt(g)}}return mt({width:c,height:p,x:i,y:u})}function vt(e,o){const n=bt(e).scrollLeft;return o?o.left+n:Pe(Se(e)).left+n}function Oo(e,o,n){n===void 0&&(n=!1);const l=e.getBoundingClientRect(),s=l.left+o.scrollLeft-(n?0:vt(e,l)),d=l.top+o.scrollTop;return{x:s,y:d}}function Ia(e){let{elements:o,rect:n,offsetParent:l,strategy:s}=e;const d=s==="fixed",r=Se(l),a=o?gt(o.floating):!1;if(l===r||a&&d)return n;let i={scrollLeft:0,scrollTop:0},u=$e(1);const c=$e(0),p=Ie(l);if((p||!p&&!d)&&((Re(l)!=="body"||tt(r))&&(i=bt(l)),Ie(l))){const m=Pe(l);u=We(l),c.x=m.x+l.clientLeft,c.y=m.y+l.clientTop}const f=r&&!p&&!d?Oo(r,i,!0):$e(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-i.scrollLeft*u.x+c.x+f.x,y:n.y*u.y-i.scrollTop*u.y+c.y+f.y}}function Va(e){return Array.from(e.getClientRects())}function Ea(e){const o=Se(e),n=bt(e),l=e.ownerDocument.body,s=fe(o.scrollWidth,o.clientWidth,l.scrollWidth,l.clientWidth),d=fe(o.scrollHeight,o.clientHeight,l.scrollHeight,l.clientHeight);let r=-n.scrollLeft+vt(e);const a=-n.scrollTop;return we(l).direction==="rtl"&&(r+=fe(o.clientWidth,l.clientWidth)-s),{width:s,height:d,x:r,y:a}}function xa(e,o){const n=me(e),l=Se(e),s=n.visualViewport;let d=l.clientWidth,r=l.clientHeight,a=0,i=0;if(s){d=s.width,r=s.height;const u=At();(!u||u&&o==="fixed")&&(a=s.offsetLeft,i=s.offsetTop)}return{width:d,height:r,x:a,y:i}}function Ta(e,o){const n=Pe(e,!0,o==="fixed"),l=n.top+e.clientTop,s=n.left+e.clientLeft,d=Ie(e)?We(e):$e(1),r=e.clientWidth*d.x,a=e.clientHeight*d.y,i=s*d.x,u=l*d.y;return{width:r,height:a,x:i,y:u}}function zo(e,o,n){let l;if(o==="viewport")l=xa(e,n);else if(o==="document")l=Ea(Se(e));else if(Ce(o))l=Ta(o,n);else{const s=Fo(e);l={x:o.x-s.x,y:o.y-s.y,width:o.width,height:o.height}}return mt(l)}function Ho(e,o){const n=De(e);return n===o||!Ce(n)||je(n)?!1:we(n).position==="fixed"||Ho(n,o)}function Na(e,o){const n=o.get(e);if(n)return n;let l=ot(e,[],!1).filter(a=>Ce(a)&&Re(a)!=="body"),s=null;const d=we(e).position==="fixed";let r=d?De(e):e;for(;Ce(r)&&!je(r);){const a=we(r),i=Dt(r);!i&&a.position==="fixed"&&(s=null),(d?!i&&!s:!i&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||tt(r)&&!i&&Ho(e,r))?l=l.filter(c=>c!==r):s=a,r=De(r)}return o.set(e,l),l}function Da(e){let{element:o,boundary:n,rootBoundary:l,strategy:s}=e;const r=[...n==="clippingAncestors"?gt(o)?[]:Na(o,this._c):[].concat(n),l],a=r[0],i=r.reduce((u,c)=>{const p=zo(o,c,s);return u.top=fe(p.top,u.top),u.right=Te(p.right,u.right),u.bottom=Te(p.bottom,u.bottom),u.left=fe(p.left,u.left),u},zo(o,a,s));return{width:i.right-i.left,height:i.bottom-i.top,x:i.left,y:i.top}}function Aa(e){const{width:o,height:n}=Po(e);return{width:o,height:n}}function La(e,o,n){const l=Ie(o),s=Se(o),d=n==="fixed",r=Pe(e,!0,d,o);let a={scrollLeft:0,scrollTop:0};const i=$e(0);if(l||!l&&!d)if((Re(o)!=="body"||tt(s))&&(a=bt(o)),l){const f=Pe(o,!0,d,o);i.x=f.x+o.clientLeft,i.y=f.y+o.clientTop}else s&&(i.x=vt(s));const u=s&&!l&&!d?Oo(s,a):$e(0),c=r.left+a.scrollLeft-i.x-u.x,p=r.top+a.scrollTop-i.y-u.y;return{x:c,y:p,width:r.width,height:r.height}}function Rt(e){return we(e).position==="static"}function Ko(e,o){if(!Ie(e)||we(e).position==="fixed")return null;if(o)return o(e);let n=e.offsetParent;return Se(e)===n&&(n=n.ownerDocument.body),n}function _o(e,o){const n=me(e);if(gt(e))return n;if(!Ie(e)){let s=De(e);for(;s&&!je(s);){if(Ce(s)&&!Rt(s))return s;s=De(s)}return n}let l=Ko(e,o);for(;l&&ka(l)&&Rt(l);)l=Ko(l,o);return l&&je(l)&&Rt(l)&&!Dt(l)?n:l||Ba(e)||n}const Ma=async function(e){const o=this.getOffsetParent||_o,n=this.getDimensions,l=await n(e.floating);return{reference:La(e.reference,await o(e.floating),e.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}};function va(e){return we(e).direction==="rtl"}const Ra={convertOffsetParentRelativeRectToViewportRelativeRect:Ia,getDocumentElement:Se,getClippingRect:Da,getOffsetParent:_o,getElementRects:Ma,getClientRects:Va,getDimensions:Aa,getScale:We,isElement:Ce,isRTL:va};function Pa(e,o){let n=null,l;const s=Se(e);function d(){var a;clearTimeout(l),(a=n)==null||a.disconnect(),n=null}function r(a,i){a===void 0&&(a=!1),i===void 0&&(i=1),d();const{left:u,top:c,width:p,height:f}=e.getBoundingClientRect();if(a||o(),!p||!f)return;const m=pt(c),g=pt(s.clientWidth-(u+p)),b=pt(s.clientHeight-(c+f)),y=pt(u),k={rootMargin:-m+"px "+-g+"px "+-b+"px "+-y+"px",threshold:fe(0,Te(1,i))||1};let S=!0;function V(A){const L=A[0].intersectionRatio;if(L!==i){if(!S)return r();L?r(!1,L):l=setTimeout(()=>{r(!1,1e-7)},1e3)}S=!1}try{n=new IntersectionObserver(V,se(Y({},k),{root:s.ownerDocument}))}catch(A){n=new IntersectionObserver(V,k)}n.observe(e)}return r(!0),d}function Pt(e,o,n,l){l===void 0&&(l={});const{ancestorScroll:s=!0,ancestorResize:d=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:i=!1}=l,u=Mt(e),c=s||d?[...u?ot(u):[],...ot(o)]:[];c.forEach(w=>{s&&w.addEventListener("scroll",n,{passive:!0}),d&&w.addEventListener("resize",n)});const p=u&&a?Pa(u,n):null;let f=-1,m=null;r&&(m=new ResizeObserver(w=>{let[k]=w;k&&k.target===u&&m&&(m.unobserve(o),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var S;(S=m)==null||S.observe(o)})),n()}),u&&!i&&m.observe(u),m.observe(o));let g,b=i?Pe(e):null;i&&y();function y(){const w=Pe(e);b&&(w.x!==b.x||w.y!==b.y||w.width!==b.width||w.height!==b.height)&&n(),b=w,g=requestAnimationFrame(y)}return n(),()=>{var w;c.forEach(k=>{s&&k.removeEventListener("scroll",n),d&&k.removeEventListener("resize",n)}),p==null||p(),(w=m)==null||w.disconnect(),m=null,i&&cancelAnimationFrame(g)}}const Ft=ya,Fa=Ca,Ot=ha,Uo=wa,zt=ga,Oa=ma,jo=(e,o,n)=>{const l=new Map,s=Y({platform:Ra},n),d=se(Y({},s.platform),{_c:l});return fa(e,o,se(Y({},s),{platform:d}))};function za(e){return e!=null&&typeof e=="object"&&"$el"in e}function Ht(e){if(za(e)){const o=e.$el;return Nt(o)&&Re(o)==="#comment"?null:o}return e}function Ha(e){return{name:"arrow",options:e,fn(o){const n=Ht(t.unref(e.element));return n==null?{}:Oa({element:n,padding:e.padding}).fn(o)}}}function Wo(e){return typeof window=="undefined"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qo(e,o){const n=Wo(e);return Math.round(o*n)/n}function Qo(e,o,n){n===void 0&&(n={});const l=n.whileElementsMounted,s=t.computed(()=>{var E;return(E=t.unref(n.open))!=null?E:!0}),d=t.computed(()=>t.unref(n.middleware)),r=t.computed(()=>{var E;return(E=t.unref(n.placement))!=null?E:"bottom"}),a=t.computed(()=>{var E;return(E=t.unref(n.strategy))!=null?E:"absolute"}),i=t.computed(()=>{var E;return(E=t.unref(n.transform))!=null?E:!0}),u=t.computed(()=>Ht(e.value)),c=t.computed(()=>Ht(o.value)),p=t.ref(0),f=t.ref(0),m=t.ref(a.value),g=t.ref(r.value),b=t.shallowRef({}),y=t.ref(!1),w=t.computed(()=>{const E={position:m.value,left:"0",top:"0"};if(!c.value)return E;const M=qo(c.value,p.value),B=qo(c.value,f.value);return i.value?Y(se(Y({},E),{transform:"translate("+M+"px, "+B+"px)"}),Wo(c.value)>=1.5&&{willChange:"transform"}):{position:m.value,left:M+"px",top:B+"px"}});let k;function S(){u.value==null||c.value==null||jo(u.value,c.value,{middleware:d.value,placement:r.value,strategy:a.value}).then(E=>{p.value=E.x,f.value=E.y,m.value=E.strategy,g.value=E.placement,b.value=E.middlewareData,y.value=!0})}function V(){typeof k=="function"&&(k(),k=void 0)}function A(){if(V(),l===void 0){S();return}if(u.value!=null&&c.value!=null){k=l(u.value,c.value,S);return}}function L(){s.value||(y.value=!1)}return t.watch([d,r,a],S,{flush:"sync"}),t.watch([u,c],A,{flush:"sync"}),t.watch(s,L,{flush:"sync"}),t.getCurrentScope()&&t.onScopeDispose(V),{x:t.shallowReadonly(p),y:t.shallowReadonly(f),strategy:t.shallowReadonly(m),placement:t.shallowReadonly(g),middlewareData:t.shallowReadonly(b),isPositioned:t.shallowReadonly(y),floatingStyles:w,update:S}}function Ka(e,o=Ye){let l=Array.from(e).reduce((d,r)=>d*31+r.charCodeAt(0)&4294967295,0);l=l>>>0;const s=l.toString(36);return"".concat(o,"-").concat(s)}const Xo=new Map;class Go{constructor(o,n){Ve(this,"referenceElement");Ve(this,"tooltipElement");Ve(this,"textContent");Ve(this,"placement");Ve(this,"autoUpdateCleanup");Ve(this,"referenceElementHandlers");Ve(this,"tooltipElementHandlers");Ve(this,"escapeHandler");Ve(this,"timeoutId");var d,r;const l=o.ownerDocument,s=this.generateTooltipId(n.textContent);this.referenceElement=o,this.textContent=n.textContent,this.placement=(d=n.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=s,this.referenceElement.setAttribute("aria-describedby",s),this.tooltipElement.textContent=this.textContent,(r=this.referenceElement.parentElement)==null||r.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=Pt(this.referenceElement,this.tooltipElement,()=>this.update())}generateTooltipId(o){var s;const n=o.trim(),l=(s=Xo.get(n))!=null?s:0;return Xo.set(n,l+1),Ka(n+"-"+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(o){o.key==="Escape"&&this.isVisible()&&this.hide()}addEventListeners(){Object.entries(this.referenceElementHandlers).forEach(([o,n])=>{this.referenceElement.addEventListener(o,n)}),Object.entries(this.tooltipElementHandlers).forEach(([o,n])=>{this.tooltipElement.addEventListener(o,n)})}removeEventListeners(){Object.entries(this.referenceElementHandlers).forEach(([o,n])=>{this.referenceElement.removeEventListener(o,n)}),Object.entries(this.tooltipElementHandlers).forEach(([o,n])=>{this.tooltipElement.removeEventListener(o,n)})}update(){jo(this.referenceElement,this.tooltipElement,{placement:this.placement,middleware:[Ft(4),Ot(),Fa(),zt()]}).then(({x:o,y:n,middlewareData:l})=>{var d,r,a;const s=(r=(d=l.offset)==null?void 0:d.placement)!=null?r:this.placement;Object.assign(this.tooltipElement.style,{left:"".concat(o,"px"),top:"".concat(n,"px"),visibility:(a=l.hide)!=null&&a.referenceHidden?"hidden":"visible",transformOrigin:$o[s]})})}updateWithOptions(o){var n;this.textContent=o.textContent,this.placement=(n=o.placement)!=null?n:this.placement,this.tooltipElement.textContent=this.textContent,this.update()}remove(){this.tooltipElement.remove(),this.autoUpdateCleanup(),this.removeEventListeners()}}const Kt={mounted(e,{value:o,arg:n}){o&&(typeof o=="string"&&o.trim()===""||(e.tooltip=new Go(e,{textContent:String(o),placement:n})))},updated(e,{value:o,arg:n}){o!==null&&(e.tooltip?e.tooltip.updateWithOptions({textContent:String(o),placement:n}):e.tooltip=new Go(e,{textContent:String(o),placement:n}))},beforeUnmount(e){e.tooltip&&e.tooltip.remove()}},_a=t.defineComponent({name:"CdxInputChip",components:{CdxButton:he,CdxIcon:Z},directives:{tooltip:Kt},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:o,slots:n}){const l=t.computed(()=>e.disabled?-1:0),s=t.ref(),d=t.computed(()=>({"cdx-input-chip--disabled":e.disabled,"cdx-input-chip--readonly":e.readonly,[e.className]:e.className.length>0})),r=te("cdx-input-chip-aria-description","Press Enter to edit or Delete to remove"),a=t.ref(),i=t.ref(!1),u=t.computed(()=>i.value&&a.value&&a.value.scrollWidth>a.value.clientWidth?Ke(n==null?void 0:n.default)[0]:null);t.onMounted(()=>{i.value=!0});function c(p){var f;switch(p.key){case"Enter":o("click-chip"),p.preventDefault(),p.stopPropagation();break;case"Escape":(f=s.value)==null||f.blur(),p.preventDefault(),p.stopPropagation();break;case"Backspace":case"Delete":o("remove-chip",p.key),p.preventDefault(),p.stopPropagation();break;case"ArrowLeft":o("arrow-left"),p.preventDefault(),p.stopPropagation()