UNPKG

@wikimedia/codex

Version:

Codex Design System for Wikimedia

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