"use strict";var Vn=Object.defineProperty,En=Object.defineProperties;var Nn=Object.getOwnPropertyDescriptors;var Oe=Object.getOwnPropertySymbols;var Bt=Object.prototype.hasOwnProperty,St=Object.prototype.propertyIsEnumerable;var st=(e,n,o)=>n in e?Vn(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o,Q=(e,n)=>{for(var o in n||(n={}))Bt.call(n,o)&&st(e,o,n[o]);if(Oe)for(var o of Oe(n))St.call(n,o)&&st(e,o,n[o]);return e},oe=(e,n)=>En(e,Nn(n));var de=(e,n)=>{var o={};for(var l in e)Bt.call(e,l)&&n.indexOf(l)<0&&(o[l]=e[l]);if(e!=null&&Oe)for(var l of Oe(e))n.indexOf(l)<0&&St.call(e,l)&&(o[l]=e[l]);return o};var fe=(e,n,o)=>(st(e,typeof n!="symbol"?n+"":n,o),o);var ee=(e,n,o)=>new Promise((l,r)=>{var d=a=>{try{i(o.next(a))}catch(u){r(u)}},s=a=>{try{i(o.throw(a))}catch(u){r(u)}},i=a=>a.done?l(a.value):Promise.resolve(a.value).then(d,s);i((o=o.apply(e,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),An='',Dn='',Mn='',Ln='',Tn='',Rn='',Fn='',On='',_n='',Pn='',zn='',Kn='',Hn='',Un='',jn='',Wn='',qn='',Qn='',Gn='',Rt=An,Yn=Dn,Xn=Mn,Jn=Ln,ft=Tn,Zn=Rn,Ft=Fn,Ot=On,eo=_n,_t={langCodeMap:{ar:Pn},default:zn},to={ltr:Kn,shouldFlip:!0},no={ltr:Hn,shouldFlip:!0},Pt={ltr:Un,shouldFlip:!0},zt={ltr:jn,shouldFlip:!0},oo=Wn,lo=qn,Kt=Qn,ao=Gn;function so(e,n,o){if(typeof e=="string"||"path"in e)return e;if("shouldFlip"in e)return e.ltr;if("rtl"in e)return o==="rtl"?e.rtl:e.ltr;const l=n in e.langCodeMap?e.langCodeMap[n]:e.default;return typeof l=="string"||"path"in l?l:l.ltr}function io(e,n){if(typeof e=="string")return!1;if("langCodeMap"in e){const o=n in e.langCodeMap?e.langCodeMap[n]:e.default;if(typeof o=="string")return!1;e=o}if("shouldFlipExceptions"in e&&Array.isArray(e.shouldFlipExceptions)){const o=e.shouldFlipExceptions.indexOf(n);return o===void 0||o===-1}return"shouldFlip"in e?e.shouldFlip:!1}function Me(e){const n=t.ref(null);return t.onMounted(()=>{const o=window.getComputedStyle(e.value).direction;n.value=o==="ltr"||o==="rtl"?o:null}),n}function Ht(e){const n=t.ref("");return t.onMounted(()=>{let o=e.value;for(;o&&o.lang==="";)o=o.parentElement;n.value=o?o.lang:null}),n}function J(e){return n=>typeof n=="string"&&e.indexOf(n)!==-1}const ze="cdx",ro=["default","progressive","destructive"],uo=["normal","primary","quiet"],co=["medium","large"],po=["x-small","small","medium"],fo=["notice","warning","error","success"],Ut=J(fo),mo=["text","search","number","email","month","password","tel","url","week","date","datetime-local","time"],pe=["default","warning","error","success"],ho=["start","center","end","number"],vo=120,go=500,Se="cdx-menu-footer-item",jt=Symbol("CdxTabs"),Wt=Symbol("CdxActiveTab"),qt=Symbol("CdxAllowArbitrary"),Qt=Symbol("CdxFieldInputId"),qe=Symbol("CdxFieldDescriptionId"),Gt=Symbol("CdxFieldStatus"),Yt=Symbol("CdxDisabled"),bo="".concat(ze,"-no-invert"),Ke=Symbol("CdxTableRowIdentifier"),yo=["top","bottom","both"],Co=J(po),wo=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:Co}},setup(e){const n=t.ref(),o=Me(n),l=Ht(n),r=t.computed(()=>{var c;return(c=e.dir)!=null?c:o.value}),d=t.computed(()=>{var c;return(c=e.lang)!=null?c:l.value}),s=t.computed(()=>({"cdx-icon--flipped":r.value==="rtl"&&d.value!==null&&io(e.icon,d.value),["cdx-icon--".concat(e.size)]:!0})),i=t.computed(()=>{var c,p;return so(e.icon,(c=d.value)!=null?c:"",(p=r.value)!=null?p:"ltr")}),a=t.computed(()=>typeof i.value=="string"?i.value:""),u=t.computed(()=>typeof i.value!="string"?i.value.path:"");return{rootElement:n,rootClasses:s,iconSvg:a,iconPath:u}}}),_=(e,n)=>{const o=e.__vccOpts||e;for(const[l,r]of n)o[l]=r;return o},ko=["aria-hidden"],$o={key:0},Bo=["innerHTML"],So=["d"];function xo(e,n,o,l,r,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","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"20",height:"20",viewBox:"0 0 20 20","aria-hidden":e.iconLabel?void 0:!0},[e.iconLabel?(t.openBlock(),t.createElementBlock("title",$o,t.toDisplayString(e.iconLabel),1)):t.createCommentVNode("v-if",!0),e.iconSvg?(t.openBlock(),t.createElementBlock("g",{key:1,innerHTML:e.iconSvg},null,8,Bo)):(t.openBlock(),t.createElementBlock("path",{key:2,d:e.iconPath},null,8,So))],8,ko))],2)}const q=_(wo,[["render",xo]]);function Xt(e){const n=[];for(const o of e)typeof o.type=="string"||typeof o.type=="object"?n.push(o):o.type!==t.Comment&&(typeof o.children=="string"&&o.children.trim()!==""?n.push(o.children):Array.isArray(o.children)&&n.push(...Xt(o.children)));return n}function Jt(e,n){return typeof e.type=="object"&&"name"in e.type?n!==void 0?e.type.name===n:!0:!1}function Io(e,n){return typeof e.type=="string"?e.type===n.toLowerCase():!1}function Qe(e){const n=typeof e=="function"?e():e;return n?Xt(n):[]}function Ge(e,n){if(e()){t.warn(n);return}const o=t.watch(e,l=>{l&&(t.warn(n),o())})}function Zt(e,n,o){const l=t.computed(()=>{const r=Qe(e);if(r.length!==1)return!1;const d=r[0];return!!(typeof d=="object"&&(Jt(d,"CdxIcon")||Io(d,"svg")))});return Ge(()=>l.value&&!n["aria-label"]&&!n["aria-hidden"],"".concat(o,": Icon-only buttons require one of the following attributes: aria-label or aria-hidden. See documentation at https://doc.wikimedia.org/codex/latest/components/demos/button.html#icon-only-button")),l}const Vo=J(ro),Eo=J(uo),No=J(co),Ao=t.defineComponent({name:"CdxButton",props:{action:{type:String,default:"default",validator:Vo},weight:{type:String,default:"normal",validator:Eo},size:{type:String,default:"medium",validator:No}},emits:["click"],setup(e,{emit:n,slots:o,attrs:l}){const r=t.ref(),d=Zt(o.default,l,"CdxButton"),s=t.ref(!1),i=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":s.value})),a=f=>{n("click",f)},u=f=>{s.value=f};function c(){u(!0)}function p(){var f;u(!1),(f=r.value)==null||f.click()}return{button:r,rootClasses:i,onClick:a,onKeyDown:c,onKeyUp:p}}});function Do(e,n,o,l,r,d){return t.openBlock(),t.createElementBlock("button",{ref:"button",class:t.normalizeClass(["cdx-button",e.rootClasses]),onKeydown:n[0]||(n[0]=t.withKeys(t.withModifiers((...s)=>e.onKeyDown&&e.onKeyDown(...s),["prevent"]),["space","enter"])),onKeyup:n[1]||(n[1]=t.withKeys((...s)=>e.onKeyUp&&e.onKeyUp(...s),["space","enter"])),onClick:n[2]||(n[2]=(...s)=>e.onClick&&e.onClick(...s))},[t.renderSlot(e.$slots,"default")],34)}const ve=_(Ao,[["render",Do]]),Mo=t.defineComponent({name:"CdxAccordion",components:{CdxButton:ve,CdxIcon:q},props:{actionAlwaysVisible:{type:Boolean,default:!1},actionIcon:{type:[String,Object],default:null},actionButtonLabel:{type:String,default:""},headingLevel:{type:String,default:"h3"}},emits:["action-button-click"],setup(e,{attrs:n,emit:o}){const l=t.ref("open"in n),r=()=>{o("action-button-click")},d=a=>{l.value=a.newState==="open"},s=t.computed(()=>e.actionIcon&&(l.value||e.actionAlwaysVisible)),i=t.computed(()=>({"cdx-accordion--has-icon":s.value}));return{emitActionButtonClick:r,rootClasses:i,shouldShowActionButton:s,onToggle:d}}}),Lo={class:"cdx-accordion__header__title"},To={class:"cdx-accordion__header__description"};function Ro(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon"),i=t.resolveComponent("cdx-button");return t.openBlock(),t.createElementBlock("details",{class:t.normalizeClass(["cdx-accordion",e.rootClasses]),onToggle:n[1]||(n[1]=(...a)=>e.onToggle&&e.onToggle(...a))},[t.createElementVNode("summary",null,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.headingLevel),{class:"cdx-accordion__header"},{default:t.withCtx(()=>[t.createElementVNode("span",Lo,[t.renderSlot(e.$slots,"title")]),t.createElementVNode("span",To,[t.renderSlot(e.$slots,"description")])]),_:3})),e.shouldShowActionButton?(t.openBlock(),t.createBlock(i,{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(s,{icon:e.actionIcon,"icon-label":e.actionButtonLabel,size:"medium"},null,8,["icon","icon-label"])]),_:1},8,["aria-label","onClick"])):t.createCommentVNode("v-if",!0)]),t.createElementVNode("div",{class:"cdx-accordion__content",onClick:n[0]||(n[0]=t.withModifiers(()=>{},["stop"]))},[t.renderSlot(e.$slots,"default")])],34)}const Fo=_(Mo,[["render",Ro]]);function en(e){return e.label===void 0?e.value:e.label===null?"":e.label}function tn(e){const n=t.ref(),o=t.ref(),l=t.ref(new Map),r=Me(n);function d(h,g){const C=h;C&&l.value.set(g,C)}function s(h){o.value=h}function i(){o.value=void 0}function a(h,g){var B;const C=h+g,k=e.value[C];if(k)if(k.disabled)a(C,g);else{const $=(B=l.value.get(C))==null?void 0:B.$el;$==null||$.focus()}}function u(){var h;a((h=o.value)!=null?h:-1,1)}function c(){var h;a((h=o.value)!=null?h:e.value.length,-1)}function p(){r.value==="rtl"?c():u()}function f(){r.value==="rtl"?u():c()}function m(h){switch(h.key){case"ArrowRight":h.preventDefault(),p();break;case"ArrowLeft":h.preventDefault(),f();break;case"ArrowDown":h.preventDefault(),u();break;case"ArrowUp":h.preventDefault(),c();break}}return{rootElement:n,assignTemplateRef:d,onFocus:s,onBlur:i,onKeydown:m}}const Oo=t.defineComponent({name:"CdxButtonGroup",components:{CdxButton:ve,CdxIcon:q},props:{buttons:{type:Array,required:!0,validator:e=>Array.isArray(e)&&e.length>=1},disabled:{type:Boolean,default:!1}},emits:["click"],setup(e){const{rootElement:n,assignTemplateRef:o,onFocus:l,onBlur:r,onKeydown:d}=tn(t.toRef(e,"buttons"));return{rootElement:n,assignTemplateRef:o,onFocus:l,onBlur:r,onKeydown:d,getButtonLabel:en}}}),_o={ref:"rootElement",class:"cdx-button-group"};function Po(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon"),i=t.resolveComponent("cdx-button");return t.openBlock(),t.createElementBlock("div",_o,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.buttons,(a,u)=>(t.openBlock(),t.createBlock(i,{key:a.value,ref_for:!0,ref:c=>e.assignTemplateRef(c,u),disabled:a.disabled||e.disabled,"aria-label":a.ariaLabel,onClick:c=>e.$emit("click",a.value),onFocus:c=>e.onFocus(u),onBlur:e.onBlur,onKeydown:e.onKeydown},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{button:a},()=>[a.icon?(t.openBlock(),t.createBlock(s,{key:0,icon:a.icon},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createTextVNode(" "+t.toDisplayString(e.getButtonLabel(a)),1)])]),_:2},1032,["disabled","aria-label","onClick","onFocus","onBlur","onKeydown"]))),128))],512)}const zo=_(Oo,[["render",Po]]),Ko=t.defineComponent({name:"CdxThumbnail",components:{CdxIcon:q},props:{thumbnail:{type:[Object,null],default:null},placeholderIcon:{type:[String,Object],default:eo}},setup:e=>{const n=t.ref(!1),o=t.ref({}),l=r=>{const d=r.replace(/([\\"\n])/g,"\\$1"),s=new Image;s.onload=()=>{o.value={backgroundImage:'url("'.concat(d,'")')},n.value=!0},s.onerror=()=>{n.value=!1},s.src=d};return t.onMounted(()=>{var r;(r=e.thumbnail)!=null&&r.url&&l(e.thumbnail.url)}),{thumbnailStyle:o,thumbnailLoaded:n,NoInvertClass:bo}}}),Ho={class:"cdx-thumbnail"},Uo={key:0,class:"cdx-thumbnail__placeholder"};function jo(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon");return t.openBlock(),t.createElementBlock("span",Ho,[e.thumbnailLoaded?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock("span",Uo,[t.createVNode(s,{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 mt=_(Ko,[["render",jo]]),Wo=t.defineComponent({name:"CdxCard",components:{CdxIcon:q,CdxThumbnail:mt},props:{url:{type:String,default:""},icon:{type:[String,Object],default:""},thumbnail:{type:[Object,null],default:null},forceThumbnail:{type:Boolean,default:!1},customPlaceholderIcon:{type:[String,Object],default:void 0}},setup(e){const n=t.computed(()=>!!e.url),o=t.computed(()=>n.value?"a":"span"),l=t.computed(()=>n.value?e.url:void 0);return{isLink:n,contentTag:o,cardLink:l}}}),qo={class:"cdx-card__text"},Qo={class:"cdx-card__text__title"},Go={key:0,class:"cdx-card__text__description"},Yo={key:1,class:"cdx-card__text__supporting-text"};function Xo(e,n,o,l,r,d){const s=t.resolveComponent("cdx-thumbnail"),i=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(s,{key:0,thumbnail:e.thumbnail,"placeholder-icon":e.customPlaceholderIcon,class:"cdx-card__thumbnail"},null,8,["thumbnail","placeholder-icon"])):e.icon?(t.openBlock(),t.createBlock(i,{key:1,icon:e.icon,class:"cdx-card__icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",qo,[t.createElementVNode("span",Qo,[t.renderSlot(e.$slots,"title")]),e.$slots.description?(t.openBlock(),t.createElementBlock("span",Go,[t.renderSlot(e.$slots,"description")])):t.createCommentVNode("v-if",!0),e.$slots["supporting-text"]?(t.openBlock(),t.createElementBlock("span",Yo,[t.renderSlot(e.$slots,"supporting-text")])):t.createCommentVNode("v-if",!0)])]),_:3},8,["href","class"])}const Jo=_(Wo,[["render",Xo]]);function ht(e){const n=t.inject(Yt,t.ref(!1));return t.computed(()=>n.value||e.value)}function le(e,n,o){const l=ht(e),r=t.inject(Gt,t.ref("default")),d=t.computed(()=>n!=null&&n.value&&n.value!=="default"?n.value:r.value),s=t.inject(Qt,void 0),i=t.computed(()=>{var a;return(a=s==null?void 0:s.value)!=null?a:o});return{computedDisabled:l,computedStatus:d,computedInputId:i}}function ae(e,n=t.computed(()=>({}))){const o=t.computed(()=>{const d=de(n.value,[]);return e.class&&e.class.split(" ").forEach(i=>{d[i]=!0}),d}),l=t.computed(()=>{if("style"in e)return e.style}),r=t.computed(()=>{const a=e,{class:d,style:s}=a;return de(a,["class","style"])});return{rootClasses:o,rootStyle:l,otherAttrs:r}}function W(e,n,o=[]){const l=t.inject("CdxI18nFunction",void 0);return t.computed(()=>{const r=o.map(s=>typeof s=="function"?s():s.value),d=l==null?void 0:l(e,...r);return d!=null?d:typeof n=="function"?n(...r):n})}function Ye(e,n,o,l=[]){const r=W(n,o,l);return t.computed(()=>e.value||r.value)}const Zo=t.defineComponent({name:"CdxLabel",components:{CdxIcon:q},inheritAttrs:!1,props:{icon:{type:[String,Object],default:null},optional:{type:Boolean,default:!1},optionalFlag:{type:String,default:""},visuallyHidden:{type:Boolean,default:!1},isLegend:{type:Boolean,default:!1},inputId:{type:String,default:""},descriptionId:{type:String,default:""},disabled:{type:Boolean,default:!1}},setup(e,{attrs:n}){const{computedDisabled:o}=le(t.toRef(e,"disabled")),l=t.computed(()=>({"cdx-label--visually-hidden":e.visuallyHidden,"cdx-label--disabled":o.value})),{rootClasses:r,rootStyle:d,otherAttrs:s}=ae(n,l),i=Ye(t.toRef(e,"optionalFlag"),"cdx-label-optional-flag","(optional)");return{rootClasses:r,rootStyle:d,otherAttrs:s,translatedOptionalFlag:i}}}),el=["for"],tl={class:"cdx-label__label__text"},nl={key:1,class:"cdx-label__label__optional-flag"},ol=["id"],ll={class:"cdx-label__label"},al={class:"cdx-label__label__text"},sl={key:1,class:"cdx-label__label__optional-flag"},il={key:0,class:"cdx-label__description"};function rl(e,n,o,l,r,d){const s=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",ll,[e.icon?(t.openBlock(),t.createBlock(s,{key:0,icon:e.icon,class:"cdx-label__label__icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",al,[t.renderSlot(e.$slots,"default")]),e.optionalFlag||e.optional?(t.openBlock(),t.createElementBlock("span",sl,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",il,[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(s,{key:0,icon:e.icon,class:"cdx-label__label__icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",tl,[t.renderSlot(e.$slots,"default")]),e.optionalFlag||e.optional?(t.openBlock(),t.createElementBlock("span",nl,t.toDisplayString(" ")+" "+t.toDisplayString(e.translatedOptionalFlag),1)):t.createCommentVNode("v-if",!0)],16,el),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,ol)):t.createCommentVNode("v-if",!0)],6))}const Le=_(Zo,[["render",rl]]);function vt(e,n,o){Ge(()=>Qe(e).length===0&&!(n!=null&&n["aria-label"])&&!(n!=null&&n["aria-labelledby"]),"".concat(o,": Inputs must have an associated label. Provide one of the following:\n - A label via the appropriate slot\n - An `aria-label` attribute set to the label text\n - An `aria-labelledby` attribute set to the ID of the label element"))}function ne(e,n,o){return t.computed({get:()=>e.value,set:l=>n(o||"update:modelValue",l)})}let it=0;function U(e){var l;const n=t.getCurrentInstance(),o=(l=n==null?void 0:n.props.id)!=null?l:n==null?void 0:n.attrs.id;return e?"".concat(ze,"-").concat(e,"-").concat(it++):o?"".concat(ze,"-").concat(o,"-").concat(it++):"".concat(ze,"-").concat(it++)}const dl=J(pe),ul=t.defineComponent({name:"CdxCheckbox",components:{CdxLabel:Le},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:dl}},emits:["update:modelValue"],setup(e,{emit:n,slots:o,attrs:l}){var f;vt((f=o.default)==null?void 0:f.call(o),l,"CdxCheckbox");const{computedDisabled:r,computedStatus:d}=le(t.toRef(e,"disabled"),t.toRef(e,"status")),s=t.computed(()=>({"cdx-checkbox--inline":e.inline,["cdx-checkbox--status-".concat(d.value)]:!0})),i=t.computed(()=>({"cdx-checkbox__custom-input--inline":e.inline})),a=t.ref(),u=U("checkbox"),c=U("description"),p=ne(t.toRef(e,"modelValue"),n);return{rootClasses:s,computedDisabled:r,input:a,checkboxId:u,descriptionId:c,wrappedModel:p,customInputClasses:i}}}),cl={class:"cdx-checkbox__wrapper"},pl=["id","aria-describedby","value","name","disabled",".indeterminate"],fl=t.createElementVNode("span",{class:"cdx-checkbox__icon"},null,-1);function ml(e,n,o,l,r,d){const s=t.resolveComponent("cdx-label");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-checkbox",e.rootClasses])},[t.createElementVNode("div",cl,[t.withDirectives(t.createElementVNode("input",{id:e.checkboxId,ref:"input","onUpdate:modelValue":n[0]||(n[0]=i=>e.wrappedModel=i),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,pl),[[t.vModelCheckbox,e.wrappedModel]]),fl,e.$slots.default&&e.$slots.default().length?(t.openBlock(),t.createBlock(s,{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 nn=_(ul,[["render",ml]]),hl=t.defineComponent({name:"CdxInputChip",components:{CdxButton:ve,CdxIcon:q},props:{icon:{type:[String,Object],default:null},disabled:{type:Boolean,default:!1}},expose:["focus"],emits:["remove-chip","click-chip","arrow-left","arrow-right"],setup(e,{emit:n}){const o=t.ref(),l=t.computed(()=>({"cdx-input-chip--disabled":e.disabled})),r=W("cdx-input-chip-aria-description","Press Enter to edit or Delete to remove");function d(s){var i;switch(s.key){case"Enter":n("click-chip"),s.preventDefault(),s.stopPropagation();break;case"Escape":(i=o.value)==null||i.blur(),s.preventDefault(),s.stopPropagation();break;case"Backspace":case"Delete":n("remove-chip",s.key),s.preventDefault(),s.stopPropagation();break;case"ArrowLeft":n("arrow-left"),s.preventDefault(),s.stopPropagation();break;case"ArrowRight":n("arrow-right"),s.preventDefault(),s.stopPropagation();break}}return{rootElement:o,rootClasses:l,ariaDescription:r,onKeydown:d,cdxIconClose:ft}},methods:{focus(){this.$refs.rootElement.focus()}}}),vl=["aria-description"],gl={class:"cdx-input-chip__text"};function bl(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon"),i=t.resolveComponent("cdx-button");return t.openBlock(),t.createElementBlock("div",{ref:"rootElement",class:t.normalizeClass(["cdx-input-chip",e.rootClasses]),tabindex:"0",role:"option","aria-description":e.ariaDescription,onKeydown:n[1]||(n[1]=(...a)=>e.onKeydown&&e.onKeydown(...a)),onClick:n[2]||(n[2]=a=>e.$emit("click-chip"))},[e.icon?(t.openBlock(),t.createBlock(s,{key:0,icon:e.icon,size:"small"},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",gl,[t.renderSlot(e.$slots,"default")]),t.createVNode(i,{class:"cdx-input-chip__button",weight:"quiet",tabindex:"-1","aria-hidden":"true",disabled:e.disabled,onClick:n[0]||(n[0]=t.withModifiers(a=>e.$emit("remove-chip","button"),["stop"]))},{default:t.withCtx(()=>[t.createVNode(s,{icon:e.cdxIconClose,size:"x-small"},null,8,["icon"])]),_:1},8,["disabled"])],42,vl)}const yl=_(hl,[["render",bl]]);function Xe(e,n,o,l){return t.computed({get:()=>{var r;return(r=n.value)!=null?r:e.value},set:r=>{n.value!==null?o(l||"update:modelValue",r):e.value=r}})}const Cl=J(pe),wl=t.defineComponent({name:"CdxChipInput",components:{CdxInputChip:yl},inheritAttrs:!1,props:{inputChips:{type:Array,required:!0},inputValue:{type:[String,Number],default:null},separateInput:{type:Boolean,default:!1},status:{type:String,default:"default",validator:Cl},chipValidator:{type:Function,default:e=>!0},disabled:{type:Boolean,default:!1}},emits:["update:input-chips","update:input-value"],setup(e,{emit:n,attrs:o}){const l=t.ref(),r=t.ref(),d=t.ref(),s=t.ref(""),i=Me(l),a=t.ref(),u=t.inject(qt,t.ref(!0)),c=t.ref(""),p=Xe(c,t.toRef(e,"inputValue"),n,"update:input-value"),f=t.ref("default"),m=t.computed(()=>f.value==="error"||e.status==="error"?"error":"default"),{computedDisabled:h,computedStatus:g}=le(t.toRef(e,"disabled"),m),C=t.ref(!1),k=t.computed(()=>({"cdx-chip-input--has-separate-input":e.separateInput,["cdx-chip-input--status-".concat(g.value)]:!0,"cdx-chip-input--focused":C.value,"cdx-chip-input--disabled":h.value})),{rootClasses:B,rootStyle:$,otherAttrs:I}=ae(o,k),E=[],M=t.ref(null),A=t.computed(()=>M.value?M.value.value:""),x=W("cdx-chip-input-chip-added",w=>"Chip ".concat(w," was added."),[p]),y=W("cdx-chip-input-chip-removed",w=>"Chip ".concat(w," was removed."),[A]);function b(w,T){w!==null&&(E[T]=w)}const S=()=>{a.value.focus()};function V(){e.inputChips.find(w=>w.value===p.value)||!e.chipValidator(p.value)?f.value="error":p.value.toString().length>0&&(s.value=x.value,n("update:input-chips",e.inputChips.concat({value:p.value})),p.value="")}function R(w){n("update:input-chips",e.inputChips.filter(T=>T.value!==w.value))}function z(w,T){const K=i.value==="ltr"&&w==="left"||i.value==="rtl"&&w==="right"?-1:1,Y=T+K;if(!(Y<0)){if(Y>=e.inputChips.length){S();return}E[Y].focus()}}function L(w){return ee(this,null,function*(){var T;V(),yield t.nextTick(),R(w),p.value=(T=w.label)!=null?T:w.value,S()})}function F(w,T,K){if(M.value=w,s.value=y.value,K==="button")S();else if(K==="Backspace"){const Y=T===0?1:T-1;Y0&&u.value){V(),w.preventDefault(),w.stopPropagation();return}break;case"Escape":(K=a.value)==null||K.blur(),w.preventDefault(),w.stopPropagation();return;case"Backspace":case T:if(((Y=a.value)==null?void 0:Y.selectionStart)===0&&a.value.selectionEnd===0&&e.inputChips.length>0){E[e.inputChips.length-1].focus(),w.preventDefault(),w.stopPropagation();return}break}}function j(){C.value=!0}function te(){C.value=!1}function Z(w){var T;!((T=l.value)!=null&&T.contains(w.relatedTarget))&&u.value&&V()}return t.watch(t.toRef(e,"inputChips"),w=>{const T=w.find(K=>K.value===p.value);f.value=T?"error":"default"}),t.watch(p,()=>{f.value==="error"&&(f.value="default")}),{rootElement:l,chipsContainer:r,separateInputWrapper:d,input:a,computedInputValue:p,rootClasses:B,rootStyle:$,otherAttrs:I,assignChipTemplateRef:b,handleChipClick:L,handleChipRemove:F,moveChipFocus:z,onInputKeydown:G,focusInput:S,onInputFocus:j,onInputBlur:te,onFocusOut:Z,computedDisabled:h,statusMessageContent:s}}}),kl={ref:"chipsContainer",class:"cdx-chip-input__chips",role:"listbox","aria-orientation":"horizontal"},$l=["disabled"],Bl={key:0,ref:"separateInputWrapper",class:"cdx-chip-input__separate-input"},Sl=["disabled"],xl={class:"cdx-chip-input__aria-status",role:"status","aria-live":"polite"};function Il(e,n,o,l,r,d){const s=t.resolveComponent("cdx-input-chip");return t.openBlock(),t.createElementBlock("div",{ref:"rootElement",class:t.normalizeClass(["cdx-chip-input",e.rootClasses]),style:t.normalizeStyle(e.rootStyle),onClick:n[8]||(n[8]=(...i)=>e.focusInput&&e.focusInput(...i)),onFocusout:n[9]||(n[9]=(...i)=>e.onFocusOut&&e.onFocusOut(...i))},[t.createElementVNode("div",kl,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.inputChips,(i,a)=>(t.openBlock(),t.createBlock(s,{key:i.value,ref_for:!0,ref:u=>e.assignChipTemplateRef(u,a),class:"cdx-chip-input__item",icon:i.icon,disabled:e.computedDisabled,onClickChip:u=>e.handleChipClick(i),onRemoveChip:u=>e.handleChipRemove(i,a,u),onArrowLeft:u=>e.moveChipFocus("left",a),onArrowRight:u=>e.moveChipFocus("right",a)},{default:t.withCtx(()=>{var u;return[t.createTextVNode(t.toDisplayString((u=i.label)!=null?u:i.value),1)]}),_:2},1032,["icon","disabled","onClickChip","onRemoveChip","onArrowLeft","onArrowRight"]))),128)),e.separateInput?t.createCommentVNode("v-if",!0):t.withDirectives((t.openBlock(),t.createElementBlock("input",t.mergeProps({key:0,ref:"input","onUpdate:modelValue":n[0]||(n[0]=i=>e.computedInputValue=i),class:"cdx-chip-input__input",disabled:e.computedDisabled},e.otherAttrs,{onBlur:n[1]||(n[1]=(...i)=>e.onInputBlur&&e.onInputBlur(...i)),onFocus:n[2]||(n[2]=(...i)=>e.onInputFocus&&e.onInputFocus(...i)),onKeydown:n[3]||(n[3]=(...i)=>e.onInputKeydown&&e.onInputKeydown(...i))}),null,16,$l)),[[t.vModelDynamic,e.computedInputValue]])],512),e.separateInput?(t.openBlock(),t.createElementBlock("div",Bl,[t.withDirectives(t.createElementVNode("input",t.mergeProps({ref:"input","onUpdate:modelValue":n[4]||(n[4]=i=>e.computedInputValue=i),class:"cdx-chip-input__input",disabled:e.computedDisabled},e.otherAttrs,{onBlur:n[5]||(n[5]=(...i)=>e.onInputBlur&&e.onInputBlur(...i)),onFocus:n[6]||(n[6]=(...i)=>e.onInputFocus&&e.onInputFocus(...i)),onKeydown:n[7]||(n[7]=(...i)=>e.onInputKeydown&&e.onInputKeydown(...i))}),null,16,Sl),[[t.vModelDynamic,e.computedInputValue]])],512)):t.createCommentVNode("v-if",!0),t.createElementVNode("div",xl,t.toDisplayString(e.statusMessageContent),1)],38)}const on=_(wl,[["render",Il]]);function ln(e){return e.replace(/([\\{}()|.?*+\-^$[\]])/g,"\\$1")}const Vl="[̀-ͯ҃-҉֑-ׇֽֿׁׂׅׄؐ-ًؚ-ٰٟۖ-ۜ۟-۪ۤۧۨ-ܑۭܰ-݊ަ-ް߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࣓-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣঁ-ঃ়া-ৄেৈো-্ৗৢৣ৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑੰੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣஂா-ூெ-ைொ-்ௗఀ-ఄా-ౄె-ైొ-్ౕౖౢౣಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣංඃ්ා-ුූෘ-ෟෲෳัิ-ฺ็-๎ັິ-ູົຼ່-ໍ༹༘༙༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏႚ-ႝ፝-፟ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝᠋-᠍ᢅᢆᢩᤠ-ᤫᤰ-᤻ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼᪰-᪾ᬀ-ᬄ᬴-᭄᭫-᭳ᮀ-ᮂᮡ-ᮭ᯦-᯳ᰤ-᰷᳐-᳔᳒-᳨᳭ᳲ-᳴᳷-᳹᷀-᷹᷻-᷿⃐-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꙯-꙲ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-ꣅ꣠-꣱ꣿꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀ꧥꨩ-ꨶꩃꩌꩍꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭ﬞ︀-️︠-︯]";function an(e,n){if(!e)return[n,"",""];const o=ln(e),l=new RegExp(o+Vl+"*","i").exec(n);if(!l||l.index===void 0)return[n,"",""];const r=l.index,d=r+l[0].length,s=n.slice(r,d),i=n.slice(0,r),a=n.slice(d,n.length);return[i,s,a]}const El=Object.freeze(Object.defineProperty({__proto__:null,regExpEscape:ln,splitStringAtMatch:an},Symbol.toStringTag,{value:"Module"})),Nl=t.defineComponent({name:"CdxSearchResultTitle",props:{title:{type:String,required:!0},searchQuery:{type:String,default:""}},setup:e=>({titleChunks:t.computed(()=>an(e.searchQuery,String(e.title)))})}),Al={class:"cdx-search-result-title"},Dl={class:"cdx-search-result-title__match"};function Ml(e,n,o,l,r,d){return t.openBlock(),t.createElementBlock("span",Al,[t.createElementVNode("bdi",null,[t.createTextVNode(t.toDisplayString(e.titleChunks[0]),1),t.createElementVNode("span",Dl,t.toDisplayString(e.titleChunks[1]),1),t.createTextVNode(t.toDisplayString(e.titleChunks[2]),1)])])}const sn=_(Nl,[["render",Ml]]),Ll=t.defineComponent({name:"CdxMenuItem",components:{CdxIcon:q,CdxThumbnail:mt,CdxSearchResultTitle:sn},props:{id:{type:String,required:!0},value:{type:[String,Number],required:!0},disabled:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},active:{type:Boolean,default:!1},highlighted:{type:Boolean,default:!1},label:{type:String,default:""},match:{type:String,default:""},supportingText:{type:String,default:""},url:{type:String,default:""},icon:{type:[String,Object],default:""},showThumbnail:{type:Boolean,default:!1},thumbnail:{type:[Object,null],default:null},description:{type:[String,null],default:""},searchQuery:{type:String,default:""},boldLabel:{type:Boolean,default:!1},hideDescriptionOverflow:{type:Boolean,default:!1},language:{type:Object,default:()=>({})},action:{type:String,default:"default"},multiselect:{type:Boolean,default:!1}},emits:["change"],setup:(e,{emit:n})=>{const o=()=>{e.highlighted||n("change","highlighted",!0)},l=()=>{n("change","highlighted",!1)},r=c=>{c.button===0&&n("change","active",!0)},d=()=>{n("change","selected",!0)},s=t.computed(()=>e.searchQuery.length>0),i=t.computed(()=>({"cdx-menu-item--selected":e.selected,"cdx-menu-item--active":e.active&&e.highlighted,"cdx-menu-item--highlighted":e.highlighted,"cdx-menu-item--destructive":e.action&&e.action==="destructive","cdx-menu-item--enabled":!e.disabled,"cdx-menu-item--disabled":e.disabled,"cdx-menu-item--highlight-query":s.value,"cdx-menu-item--bold-label":e.boldLabel,"cdx-menu-item--has-description":!!e.description,"cdx-menu-item--hide-description-overflow":e.hideDescriptionOverflow})),a=t.computed(()=>e.url?"a":"span"),u=t.computed(()=>e.label||String(e.value));return{onMouseMove:o,onMouseLeave:l,onMouseDown:r,onClick:d,highlightQuery:s,rootClasses:i,contentTag:a,title:u,cdxIconCheck:Xn}}}),Tl=["id","aria-disabled","aria-selected","aria-checked"],Rl={class:"cdx-menu-item__text"},Fl=["lang"],Ol=["lang"],_l=["lang"],Pl=["lang"];function zl(e,n,o,l,r,d){const s=t.resolveComponent("cdx-thumbnail"),i=t.resolveComponent("cdx-icon"),a=t.resolveComponent("cdx-search-result-title");return t.openBlock(),t.createElementBlock("li",{id:e.id,role:"option",class:t.normalizeClass(["cdx-menu-item",e.rootClasses]),"aria-disabled":e.disabled,"aria-selected":e.selected&&!e.multiselect?!0:void 0,"aria-checked":e.selected&&e.multiselect?!0:void 0,onMousemove:n[0]||(n[0]=(...u)=>e.onMouseMove&&e.onMouseMove(...u)),onMouseleave:n[1]||(n[1]=(...u)=>e.onMouseLeave&&e.onMouseLeave(...u)),onMousedown:n[2]||(n[2]=t.withModifiers((...u)=>e.onMouseDown&&e.onMouseDown(...u),["prevent"])),onClick:n[3]||(n[3]=(...u)=>e.onClick&&e.onClick(...u))},[t.renderSlot(e.$slots,"default",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.contentTag),{href:e.url?e.url:void 0,class:"cdx-menu-item__content"},{default:t.withCtx(()=>{var u,c,p,f,m,h;return[e.showThumbnail?(t.openBlock(),t.createBlock(s,{key:0,thumbnail:e.thumbnail,class:"cdx-menu-item__thumbnail"},null,8,["thumbnail"])):e.icon?(t.openBlock(),t.createBlock(i,{key:1,icon:e.icon,class:"cdx-menu-item__icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",Rl,[e.highlightQuery?(t.openBlock(),t.createBlock(a,{key:0,title:e.title,"search-query":e.searchQuery,lang:(u=e.language)==null?void 0:u.label},null,8,["title","search-query","lang"])):(t.openBlock(),t.createElementBlock("span",{key:1,class:"cdx-menu-item__text__label",lang:(c=e.language)==null?void 0:c.label},[t.createElementVNode("bdi",null,t.toDisplayString(e.title),1)],8,Fl)),e.match?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createTextVNode(t.toDisplayString(" ")+" "),e.highlightQuery?(t.openBlock(),t.createBlock(a,{key:0,title:e.match,"search-query":e.searchQuery,lang:(p=e.language)==null?void 0:p.match},null,8,["title","search-query","lang"])):(t.openBlock(),t.createElementBlock("span",{key:1,class:"cdx-menu-item__text__match",lang:(f=e.language)==null?void 0:f.match},[t.createElementVNode("bdi",null,t.toDisplayString(e.match),1)],8,Ol))],64)):t.createCommentVNode("v-if",!0),e.supportingText?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createTextVNode(t.toDisplayString(" ")+" "),t.createElementVNode("span",{class:"cdx-menu-item__text__supporting-text",lang:(m=e.language)==null?void 0:m.supportingText},[t.createElementVNode("bdi",null,t.toDisplayString(e.supportingText),1)],8,_l)],64)):t.createCommentVNode("v-if",!0),e.description?(t.openBlock(),t.createElementBlock("span",{key:4,class:"cdx-menu-item__text__description",lang:(h=e.language)==null?void 0:h.description},[t.createElementVNode("bdi",null,t.toDisplayString(e.description),1)],8,Pl)):t.createCommentVNode("v-if",!0)]),e.multiselect&&e.selected?(t.openBlock(),t.createBlock(i,{key:2,icon:e.cdxIconCheck,size:"small",class:"cdx-menu-item__selected-icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0)]}),_:1},8,["href"]))])],42,Tl)}const rn=_(Ll,[["render",zl]]),Kl=t.defineComponent({name:"CdxProgressBar",props:{inline:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(e,{attrs:n}){Ge(()=>!e.inline&&!n["aria-label"]&&!n["aria-hidden"],"CdxProgressBar: Progress bars require one of the following attribute, aria-label or aria-hidden. See documentation on https://doc.wikimedia.org/codex/latest/components/demos/progressbar.html");const o=t.computed(()=>({"cdx-progress-bar--block":!e.inline,"cdx-progress-bar--inline":e.inline,"cdx-progress-bar--enabled":!e.disabled,"cdx-progress-bar--disabled":e.disabled})),l=t.computed(()=>e.inline?"true":void 0);return{rootClasses:o,computedAriaHidden:l}}}),Hl=["aria-hidden","aria-disabled"],Ul=t.createElementVNode("div",{class:"cdx-progress-bar__bar"},null,-1),jl=[Ul];function Wl(e,n,o,l,r,d){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-progress-bar",e.rootClasses]),role:"progressbar","aria-hidden":e.computedAriaHidden,"aria-disabled":e.disabled},jl,10,Hl)}const gt=_(Kl,[["render",Wl]]);function He(e,n){const o=t.ref(!1);let l=!1;if(typeof window!="object"||!("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype))return o;const r=new window.IntersectionObserver(d=>{const s=d[0];s&&(o.value=s.isIntersecting)},n);return t.onMounted(()=>{l=!0,e.value&&r.observe(e.value)}),t.onUnmounted(()=>{l=!1,r.disconnect()}),t.watch(e,d=>{l&&(r.disconnect(),o.value=!1,d&&r.observe(d))}),o}function _e(e){return e!==null&&Array.isArray(e)}function rt(e){return"items"in e}const ql=t.defineComponent({name:"CdxMenu",components:{CdxMenuItem:rn,CdxIcon:q,CdxProgressBar:gt},inheritAttrs:!1,props:{menuItems:{type:Array,required:!0},footer:{type:Object,default:null},selected:{type:[String,Number,Array,null],required:!0},expanded:{type:Boolean,required:!0},showPending:{type:Boolean,default:!1},visibleItemLimit:{type:Number,default:null},showThumbnail:{type:Boolean,default:!1},boldLabel:{type:Boolean,default:!1},hideDescriptionOverflow:{type:Boolean,default:!1},searchQuery:{type:String,default:""},showNoResultsSlot:{type:Boolean,default:null}},emits:["update:selected","update:expanded","menu-item-click","menu-item-keyboard-navigation","load-more"],expose:["isExpanded","clearActive","getHighlightedMenuItem","getHighlightedViaKeyboard","getComputedMenuItems","delegateKeyNavigation"],setup(e,{emit:n,slots:o,attrs:l}){const r=t.computed(()=>{const v=e.footer&&e.menuItems?[...e.menuItems,e.footer]:e.menuItems,D=P=>oe(Q({},P),{id:U("menu-item")});return v.map(P=>rt(P)?oe(Q({},P),{id:U("menu-group"),items:P.items.map(X=>D(X))}):D(P))}),d=t.computed(()=>{const v=[];return r.value.forEach(D=>{rt(D)?v.push(...D.items):v.push(D)}),v}),s=t.computed(()=>o["no-results"]?e.showNoResultsSlot!==null?e.showNoResultsSlot:d.value.length===0:!1),i=t.ref(null),a=t.ref(!1),u=t.ref(null),c="additions removals";let p="",f=null;function m(){p="",f!==null&&(clearTimeout(f),f=null)}function h(){f!==null&&clearTimeout(f),f=setTimeout(m,1500)}function g(){var v;return(v=d.value.find(D=>_e(e.selected)?e.selected.indexOf(D.value)!==-1:D.value===e.selected))!=null?v:null}const C=t.computed(()=>_e(e.selected));function k(v){return _e(e.selected)?e.selected.indexOf(v)!==-1:v===e.selected}function B(v){if(_e(e.selected)){const D=e.selected.indexOf(v)===-1?e.selected.concat(v):e.selected.filter(P=>P!==v);n("update:selected",D)}else n("update:selected",v)}function $(v,D){if(!(D&&D.disabled))switch(v){case"selected":D&&B(D.value),C.value||n("update:expanded",!1),u.value=null;break;case"highlighted":i.value=D!=null?D:null,a.value=!1;break;case"highlightedViaKeyboard":i.value=D!=null?D:null,a.value=!0;break;case"active":u.value=D!=null?D:null;break}}const I=t.computed(()=>{if(i.value!==null)return d.value.findIndex(v=>v.value===i.value.value)});function E(v){v&&($("highlightedViaKeyboard",v),n("menu-item-keyboard-navigation",v))}function M(v){var X;const D=Be=>{for(let re=Be-1;re>=0;re--)if(!d.value[re].disabled)return d.value[re]};v=v!=null?v:d.value.length;const P=(X=D(v))!=null?X:D(d.value.length);E(P)}function A(v){var X;const D=Be=>d.value.find((re,Fe)=>!re.disabled&&Fe>Be);v=v!=null?v:-1;const P=(X=D(v))!=null?X:D(-1);E(P)}function x(v){if(v.key==="Clear")return m(),!0;if(v.key==="Backspace")return p=p.slice(0,-1),h(),!0;if(v.key.length===1&&!v.metaKey&&!v.ctrlKey&&!v.altKey){if(e.expanded||n("update:expanded",!0),v.key===" "&&p.length<1)return!1;p+=v.key.toLowerCase();const D=p.length>1&&p.split("").every(re=>re===p[0]);let P=d.value,X=p;D&&I.value!==void 0&&(P=P.slice(I.value+1).concat(P.slice(0,I.value)),X=p[0]);const Be=P.find(re=>{var Fe;return!re.disabled&&String((Fe=re.label)!=null?Fe:re.value).toLowerCase().startsWith(X)});return Be&&($("highlightedViaKeyboard",Be),F()),h(),!0}return!1}function y(v,{prevent:D=!0,characterNavigation:P=!1}={}){if(P){if(x(v))return v.preventDefault(),!0;m()}function X(){D&&(v.preventDefault(),v.stopPropagation())}switch(v.key){case"Enter":case" ":return X(),e.expanded?(i.value&&a.value&&B(i.value.value),C.value||n("update:expanded",!1)):n("update:expanded",!0),!0;case"Tab":return e.expanded&&i.value&&a.value&&!C.value&&(B(i.value.value),n("update:expanded",!1)),!0;case"ArrowUp":return X(),e.expanded?(i.value===null&&$("highlightedViaKeyboard",g()),M(I.value)):n("update:expanded",!0),F(),!0;case"ArrowDown":return X(),e.expanded?(i.value===null&&$("highlightedViaKeyboard",g()),A(I.value)):n("update:expanded",!0),F(),!0;case"Home":return X(),e.expanded?(i.value===null&&$("highlightedViaKeyboard",g()),A()):n("update:expanded",!0),F(),!0;case"End":return X(),e.expanded?(i.value===null&&$("highlightedViaKeyboard",g()),M()):n("update:expanded",!0),F(),!0;case"Escape":return X(),n("update:expanded",!1),!0;default:return!1}}function b(){$("active",null)}const S=[],V=t.ref(void 0),R=He(V,{threshold:.8});t.watch(R,v=>{v&&n("load-more")});function z(v,D){if(v){S[D]=v.$el;const P=e.visibleItemLimit;if(!P||e.menuItems.lengthL.value.clientHeight;if(I.value===void 0||!v)return;const D=I.value>=0?I.value:0;S[D].scrollIntoView({behavior:"smooth",block:"nearest"})}const G=t.ref(null),j=t.ref(null);function te(){return ee(this,null,function*(){yield t.nextTick(),Z(),w(),yield t.nextTick(),F()})}function Z(){if(e.footer){const v=S[S.length-1];j.value=v.scrollHeight}else j.value=null}function w(){if(!e.visibleItemLimit||S.length<=e.visibleItemLimit){G.value=null;return}const v=S[0].getBoundingClientRect().top,D=S[e.visibleItemLimit].getBoundingClientRect().top;G.value=D-v+2}function T(v){return{"cdx-menu__group-wrapper--hide-label":!!v.hideLabel}}function K(v){return d.value.indexOf(v)}function Y(v){var D,P;return Q({selected:k(v.value),active:v.value===((D=u.value)==null?void 0:D.value),highlighted:v.value===((P=i.value)==null?void 0:P.value),showThumbnail:e.showThumbnail,boldLabel:e.boldLabel,hideDescriptionOverflow:e.hideDescriptionOverflow,searchQuery:e.searchQuery,multiselect:C.value},v)}function nt(v){return{change:(D,P)=>$(D,P?v:null),click:()=>n("menu-item-click",v)}}function ot(v){var D,P;return{menuItem:v,active:v.value===((D=u.value)==null?void 0:D.value)&&v.value===((P=i.value)==null?void 0:P.value)}}t.onMounted(()=>{document.addEventListener("mouseup",b)}),t.onUnmounted(()=>{document.removeEventListener("mouseup",b)}),t.watch(t.toRef(e,"expanded"),v=>ee(this,null,function*(){if(v){const D=g();D&&!i.value&&$("highlighted",D),yield te()}else $("highlighted",null)})),t.watch(t.toRef(e,"menuItems"),v=>ee(this,null,function*(){v.length({"max-height":G.value?"".concat(G.value,"px"):void 0,"margin-bottom":j.value?"".concat(j.value,"px"):void 0})),at=t.computed(()=>({"cdx-menu--has-footer":!!e.footer})),{rootClasses:N,rootStyle:O,otherAttrs:H}=ae(l,at);return{listBoxStyle:lt,rootClasses:N,rootStyle:O,otherAttrs:H,assignTemplateRef:z,computedMenuEntries:r,computedMenuItems:d,computedShowNoResultsSlot:s,highlightedMenuItem:i,highlightedViaKeyboard:a,handleMenuItemChange:$,handleKeyNavigation:y,ariaRelevant:c,isMultiselect:C,menuListbox:L,getGroupWrapperClasses:T,getMenuItemIndex:K,getMenuItemBindings:Y,getMenuItemHandlers:nt,getSlotBindings:ot,isMenuGroupData:rt}},methods:{isExpanded(){return this.expanded},getHighlightedMenuItem(){return this.expanded?this.highlightedMenuItem:null},getHighlightedViaKeyboard(){return this.highlightedViaKeyboard},getComputedMenuItems(){return this.computedMenuItems},clearActive(){this.handleMenuItemChange("active",null)},delegateKeyNavigation(e,{prevent:n=!0,characterNavigation:o=!1}={}){return this.handleKeyNavigation(e,{prevent:n,characterNavigation:o})}}}),Ql=["aria-live","aria-relevant","aria-multiselectable"],Gl={key:0,class:"cdx-menu__pending cdx-menu-item"},Yl={key:1,class:"cdx-menu__no-results cdx-menu-item",role:"option"},Xl=["aria-labelledby","aria-describedby"],Jl={class:"cdx-menu__group__meta"},Zl={class:"cdx-menu__group__meta__text"},ea=["id"],ta=["id"];function na(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon"),i=t.resolveComponent("cdx-menu-item"),a=t.resolveComponent("cdx-progress-bar");return t.withDirectives((t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-menu",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.createElementVNode("ul",t.mergeProps({ref:"menuListbox",class:"cdx-menu__listbox",role:"listbox",style:e.listBoxStyle,"aria-live":e.showPending?"polite":void 0,"aria-relevant":e.showPending?e.ariaRelevant:void 0,"aria-multiselectable":e.isMultiselect?!0:void 0},e.otherAttrs),[e.showPending&&e.computedMenuItems.length===0&&e.$slots.pending?(t.openBlock(),t.createElementBlock("li",Gl,[t.renderSlot(e.$slots,"pending")])):t.createCommentVNode("v-if",!0),e.computedShowNoResultsSlot?(t.openBlock(),t.createElementBlock("li",Yl,[t.renderSlot(e.$slots,"no-results")])):t.createCommentVNode("v-if",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.computedMenuEntries,(u,c)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:c},[e.isMenuGroupData(u)?(t.openBlock(),t.createElementBlock("li",{key:0,class:t.normalizeClass(["cdx-menu__group-wrapper",e.getGroupWrapperClasses(u)])},[t.createElementVNode("ul",{class:"cdx-menu__group",role:"group","aria-labelledby":u.id+"-label","aria-describedby":u.id+"-description"},[t.createElementVNode("span",Jl,[u.icon?(t.openBlock(),t.createBlock(s,{key:0,class:"cdx-menu__group__icon",icon:u.icon},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",Zl,[t.createElementVNode("span",{id:u.id+"-label",class:"cdx-menu__group__label"},t.toDisplayString(u.label),9,ea),u.description?(t.openBlock(),t.createElementBlock("span",{key:0,id:u.id+"-description",class:"cdx-menu__group__description"},t.toDisplayString(u.description),9,ta)):t.createCommentVNode("v-if",!0)])]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.items,p=>(t.openBlock(),t.createBlock(i,t.mergeProps({key:p.value,ref_for:!0,ref:f=>e.assignTemplateRef(f,e.getMenuItemIndex(p)),class:"cdx-menu__group__item"},e.getMenuItemBindings(p),t.toHandlers(e.getMenuItemHandlers(p))),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",t.mergeProps({ref_for:!0},e.getSlotBindings(p)))]),_:2},1040))),128))],8,Xl)],2)):(t.openBlock(),t.createBlock(i,t.mergeProps({key:1,ref_for:!0,ref:p=>e.assignTemplateRef(p,e.getMenuItemIndex(u))},e.getMenuItemBindings(u),t.toHandlers(e.getMenuItemHandlers(u))),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",t.mergeProps({ref_for:!0},e.getSlotBindings(u)))]),_:2},1040))],64))),128)),e.showPending?(t.openBlock(),t.createBlock(a,{key:2,class:"cdx-menu__progress-bar",inline:!0})):t.createCommentVNode("v-if",!0)],16,Ql)],6)),[[t.vShow,e.expanded]])}const ke=_(ql,[["render",na]]),oa=J(mo),la=J(pe),aa=t.defineComponent({name:"CdxTextInput",components:{CdxIcon:q},inheritAttrs:!1,expose:["focus","blur","checkValidity","reportValidity","setCustomValidity"],props:{modelValue:{type:[String,Number],default:""},inputType:{type:String,default:"text",validator:oa},status:{type:String,default:"default",validator:la},disabled:{type:Boolean,default:!1},startIcon:{type:[String,Object],default:void 0},endIcon:{type:[String,Object],default:void 0},clearable:{type:Boolean,default:!1}},emits:["update:modelValue","keydown","input","change","focus","blur","clear","invalid"],setup(e,{emit:n,attrs:o}){const l=o.id,{computedDisabled:r,computedStatus:d,computedInputId:s}=le(t.toRef(e,"disabled"),t.toRef(e,"status"),l),i=t.inject(qe,void 0),a=ne(t.toRef(e,"modelValue"),n),u=t.computed(()=>e.clearable&&!!a.value&&!r.value),c=t.computed(()=>({"cdx-text-input--has-start-icon":!!e.startIcon,"cdx-text-input--has-end-icon":!!e.endIcon,"cdx-text-input--clearable":u.value,["cdx-text-input--status-".concat(d.value)]:!0})),{rootClasses:p,rootStyle:f,otherAttrs:m}=ae(o,c),h=t.computed(()=>{const b=m.value,{id:x}=b;return de(b,["id"])}),g=t.computed(()=>({"cdx-text-input__input--has-value":!!a.value})),C=x=>{a.value="",n("clear",x)},k=x=>{(x.key==="Home"||x.key==="End")&&!x.ctrlKey&&!x.metaKey||n("keydown",x)},B=x=>{n("input",x)},$=x=>{n("change",x)},I=x=>{n("focus",x)},E=x=>{n("blur",x)},M=t.ref(!0);return{computedInputId:s,descriptionId:i,wrappedModel:a,isClearable:u,rootClasses:p,rootStyle:f,otherAttrsMinusId:h,inputClasses:g,computedDisabled:r,onClear:C,onInput:B,onChange:$,onKeydown:k,onFocus:I,onBlur:E,onInvalid:(x,y)=>{y&&x.preventDefault(),n("invalid",x),M.value=!0},shouldPreventDefault:M,cdxIconClear:Jn}},methods:{focus(){this.$refs.input.focus()},blur(){this.$refs.input.blur()},checkValidity(){return this.$refs.input.checkValidity()},reportValidity(){return this.shouldPreventDefault=!1,this.$refs.input.reportValidity()},setCustomValidity(e){this.$refs.input.setCustomValidity(e)}}}),sa=["id","type","aria-describedby","disabled"];function ia(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-text-input",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.withDirectives(t.createElementVNode("input",t.mergeProps({id:e.computedInputId,ref:"input","onUpdate:modelValue":n[0]||(n[0]=i=>e.wrappedModel=i),class:["cdx-text-input__input",e.inputClasses]},e.otherAttrsMinusId,{type:e.inputType,"aria-describedby":e.descriptionId,disabled:e.computedDisabled,size:"1",onInput:n[1]||(n[1]=(...i)=>e.onInput&&e.onInput(...i)),onChange:n[2]||(n[2]=(...i)=>e.onChange&&e.onChange(...i)),onFocus:n[3]||(n[3]=(...i)=>e.onFocus&&e.onFocus(...i)),onBlur:n[4]||(n[4]=(...i)=>e.onBlur&&e.onBlur(...i)),onKeydown:n[5]||(n[5]=(...i)=>e.onKeydown&&e.onKeydown(...i)),onInvalid:n[6]||(n[6]=i=>e.onInvalid(i,e.shouldPreventDefault))}),null,16,sa),[[t.vModelDynamic,e.wrappedModel]]),e.startIcon?(t.openBlock(),t.createBlock(s,{key:0,icon:e.startIcon,class:"cdx-text-input__icon-vue cdx-text-input__start-icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),e.endIcon?(t.openBlock(),t.createBlock(s,{key:1,icon:e.endIcon,class:"cdx-text-input__icon-vue cdx-text-input__end-icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),e.isClearable?(t.openBlock(),t.createBlock(s,{key:2,icon:e.cdxIconClear,class:"cdx-text-input__icon-vue cdx-text-input__clear-icon",onMousedown:n[7]||(n[7]=t.withModifiers(()=>{},["prevent"])),onClick:e.onClear},null,8,["icon","onClick"])):t.createCommentVNode("v-if",!0)],6)}const Je=_(aa,[["render",ia]]),ra=["top","right","bottom","left"],Ie=Math.min,se=Math.max,Ue=Math.round,Pe=Math.floor,me=e=>({x:e,y:e}),da={left:"right",right:"left",bottom:"top",top:"bottom"},ua={start:"end",end:"start"};function xt(e,n,o){return se(e,Ie(n,o))}function Ee(e,n){return typeof e=="function"?e(n):e}function be(e){return e.split("-")[0]}function Te(e){return e.split("-")[1]}function dn(e){return e==="x"?"y":"x"}function un(e){return e==="y"?"height":"width"}function Ce(e){return["top","bottom"].includes(be(e))?"y":"x"}function cn(e){return dn(Ce(e))}function ca(e,n,o){o===void 0&&(o=!1);const l=Te(e),r=cn(e),d=un(r);let s=r==="x"?l===(o?"end":"start")?"right":"left":l==="start"?"bottom":"top";return n.reference[d]>n.floating[d]&&(s=je(s)),[s,je(s)]}function pa(e){const n=je(e);return[ut(e),n,ut(n)]}function ut(e){return e.replace(/start|end/g,n=>ua[n])}function fa(e,n,o){const l=["left","right"],r=["right","left"],d=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return o?n?r:l:n?l:r;case"left":case"right":return n?d:s;default:return[]}}function ma(e,n,o,l){const r=Te(e);let d=fa(be(e),o==="start",l);return r&&(d=d.map(s=>s+"-"+r),n&&(d=d.concat(d.map(ut)))),d}function je(e){return e.replace(/left|right|bottom|top/g,n=>da[n])}function ha(e){return Q({top:0,right:0,bottom:0,left:0},e)}function va(e){return typeof e!="number"?ha(e):{top:e,right:e,bottom:e,left:e}}function We(e){const{x:n,y:o,width:l,height:r}=e;return{width:l,height:r,top:o,left:n,right:n+l,bottom:o+r,x:n,y:o}}function It(e,n,o){let{reference:l,floating:r}=e;const d=Ce(n),s=cn(n),i=un(s),a=be(n),u=d==="y",c=l.x+l.width/2-r.width/2,p=l.y+l.height/2-r.height/2,f=l[i]/2-r[i]/2;let m;switch(a){case"top":m={x:c,y:l.y-r.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-r.width,y:p};break;default:m={x:l.x,y:l.y}}switch(Te(n)){case"start":m[s]-=f*(o&&u?-1:1);break;case"end":m[s]+=f*(o&&u?-1:1);break}return m}const ga=(e,n,o)=>ee(exports,null,function*(){const{placement:l="bottom",strategy:r="absolute",middleware:d=[],platform:s}=o,i=d.filter(Boolean),a=yield s.isRTL==null?void 0:s.isRTL(n);let u=yield s.getElementRects({reference:e,floating:n,strategy:r}),{x:c,y:p}=It(u,l,a),f=l,m={},h=0;for(let g=0;gF<=0)){var V,R;const F=(((V=s.flip)==null?void 0:V.index)||0)+1,G=x[F];if(G)return{data:{index:F,overflows:S},reset:{placement:G}};let j=(R=S.filter(te=>te.overflows[0]<=0).sort((te,Z)=>te.overflows[1]-Z.overflows[1])[0])==null?void 0:R.placement;if(!j)switch(h){case"bestFit":{var z;const te=(z=S.filter(Z=>{if(A){const w=Ce(Z.placement);return w===$||w==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(w=>w>0).reduce((w,T)=>w+T,0)]).sort((Z,w)=>Z[1]-w[1])[0])==null?void 0:z[0];te&&(j=te);break}case"initialPlacement":j=a;break}if(d!==j)return{reset:{placement:j}}}return{}})}}};function Vt(e,n){return{top:e.top-n.height,right:e.right-n.width,bottom:e.bottom-n.height,left:e.left-n.width}}function Et(e){return ra.some(n=>e[n]>=0)}const ya=function(e){return e===void 0&&(e={}),{name:"hide",options:e,fn(o){return ee(this,null,function*(){const{rects:l}=o,s=Ee(e,o),{strategy:r="referenceHidden"}=s,d=de(s,["strategy"]);switch(r){case"referenceHidden":{const i=yield Ae(o,oe(Q({},d),{elementContext:"reference"})),a=Vt(i,l.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Et(a)}}}case"escaped":{const i=yield Ae(o,oe(Q({},d),{altBoundary:!0})),a=Vt(i,l.floating);return{data:{escapedOffsets:a,escaped:Et(a)}}}default:return{}}})}}};function Ca(e,n){return ee(this,null,function*(){const{placement:o,platform:l,elements:r}=e,d=yield l.isRTL==null?void 0:l.isRTL(r.floating),s=be(o),i=Te(o),a=Ce(o)==="y",u=["left","top"].includes(s)?-1:1,c=d&&a?-1:1,p=Ee(n,e);let{mainAxis:f,crossAxis:m,alignmentAxis:h}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return i&&typeof h=="number"&&(m=i==="end"?h*-1:h),a?{x:m*c,y:f*u}:{x:f*u,y:m*c}})}const wa=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(o){return ee(this,null,function*(){var l,r;const{x:d,y:s,placement:i,middlewareData:a}=o,u=yield Ca(o,e);return i===((l=a.offset)==null?void 0:l.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:d+u.x,y:s+u.y,data:oe(Q({},u),{placement:i})}})}}},ka=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(o){return ee(this,null,function*(){const{x:l,y:r,placement:d}=o,k=Ee(e,o),{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:B=>{let{x:$,y:I}=B;return{x:$,y:I}}}}=k,u=de(k,["mainAxis","crossAxis","limiter"]),c={x:l,y:r},p=yield Ae(o,u),f=Ce(be(d)),m=dn(f);let h=c[m],g=c[f];if(s){const B=m==="y"?"top":"left",$=m==="y"?"bottom":"right",I=h+p[B],E=h-p[$];h=xt(I,h,E)}if(i){const B=f==="y"?"top":"left",$=f==="y"?"bottom":"right",I=g+p[B],E=g-p[$];g=xt(I,g,E)}const C=a.fn(oe(Q({},o),{[m]:h,[f]:g}));return oe(Q({},C),{data:{x:C.x-l,y:C.y-r,enabled:{[m]:s,[f]:i}}})})}}},$a=function(e){return e===void 0&&(e={}),{name:"size",options:e,fn(o){return ee(this,null,function*(){var l,r;const{placement:d,rects:s,platform:i,elements:a}=o,S=Ee(e,o),{apply:u=()=>{}}=S,c=de(S,["apply"]),p=yield Ae(o,c),f=be(d),m=Te(d),h=Ce(d)==="y",{width:g,height:C}=s.floating;let k,B;f==="top"||f==="bottom"?(k=f,B=m===((yield i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(B=f,k=m==="end"?"top":"bottom");const $=C-p.top-p.bottom,I=g-p.left-p.right,E=Ie(C-p[k],$),M=Ie(g-p[B],I),A=!o.middlewareData.shift;let x=E,y=M;if((l=o.middlewareData.shift)!=null&&l.enabled.x&&(y=I),(r=o.middlewareData.shift)!=null&&r.enabled.y&&(x=$),A&&!m){const V=se(p.left,0),R=se(p.right,0),z=se(p.top,0),L=se(p.bottom,0);h?y=g-2*(V!==0||R!==0?V+R:se(p.left,p.right)):x=C-2*(z!==0||L!==0?z+L:se(p.top,p.bottom))}yield u(oe(Q({},o),{availableWidth:y,availableHeight:x}));const b=yield i.getDimensions(a.floating);return g!==b.width||C!==b.height?{reset:{rects:!0}}:{}})}}};function Ze(){return typeof window!="undefined"}function $e(e){return bt(e)?(e.nodeName||"").toLowerCase():"#document"}function ie(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function ge(e){var n;return(n=(bt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function bt(e){return Ze()?e instanceof Node||e instanceof ie(e).Node:!1}function ue(e){return Ze()?e instanceof Element||e instanceof ie(e).Element:!1}function he(e){return Ze()?e instanceof HTMLElement||e instanceof ie(e).HTMLElement:!1}function Nt(e){return!Ze()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof ie(e).ShadowRoot}function Re(e){const{overflow:n,overflowX:o,overflowY:l,display:r}=ce(e);return/auto|scroll|overlay|hidden|clip/.test(n+l+o)&&!["inline","contents"].includes(r)}function Ba(e){return["table","td","th"].includes($e(e))}function et(e){return[":popover-open",":modal"].some(n=>{try{return e.matches(n)}catch(o){return!1}})}function yt(e){const n=Ct(),o=ue(e)?ce(e):e;return o.transform!=="none"||o.perspective!=="none"||(o.containerType?o.containerType!=="normal":!1)||!n&&(o.backdropFilter?o.backdropFilter!=="none":!1)||!n&&(o.filter?o.filter!=="none":!1)||["transform","perspective","filter"].some(l=>(o.willChange||"").includes(l))||["paint","layout","strict","content"].some(l=>(o.contain||"").includes(l))}function Sa(e){let n=ye(e);for(;he(n)&&!Ve(n);){if(yt(n))return n;if(et(n))return null;n=ye(n)}return null}function Ct(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ve(e){return["html","body","#document"].includes($e(e))}function ce(e){return ie(e).getComputedStyle(e)}function tt(e){return ue(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ye(e){if($e(e)==="html")return e;const n=e.assignedSlot||e.parentNode||Nt(e)&&e.host||ge(e);return Nt(n)?n.host:n}function pn(e){const n=ye(e);return Ve(n)?e.ownerDocument?e.ownerDocument.body:e.body:he(n)&&Re(n)?n:pn(n)}function De(e,n,o){var l;n===void 0&&(n=[]),o===void 0&&(o=!0);const r=pn(e),d=r===((l=e.ownerDocument)==null?void 0:l.body),s=ie(r);if(d){const i=ct(s);return n.concat(s,s.visualViewport||[],Re(r)?r:[],i&&o?De(i):[])}return n.concat(r,De(r,[],o))}function ct(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fn(e){const n=ce(e);let o=parseFloat(n.width)||0,l=parseFloat(n.height)||0;const r=he(e),d=r?e.offsetWidth:o,s=r?e.offsetHeight:l,i=Ue(o)!==d||Ue(l)!==s;return i&&(o=d,l=s),{width:o,height:l,$:i}}function wt(e){return ue(e)?e:e.contextElement}function xe(e){const n=wt(e);if(!he(n))return me(1);const o=n.getBoundingClientRect(),{width:l,height:r,$:d}=fn(n);let s=(d?Ue(o.width):o.width)/l,i=(d?Ue(o.height):o.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}const xa=me(0);function mn(e){const n=ie(e);return!Ct()||!n.visualViewport?xa:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Ia(e,n,o){return n===void 0&&(n=!1),!o||n&&o!==ie(e)?!1:n}function we(e,n,o,l){n===void 0&&(n=!1),o===void 0&&(o=!1);const r=e.getBoundingClientRect(),d=wt(e);let s=me(1);n&&(l?ue(l)&&(s=xe(l)):s=xe(e));const i=Ia(d,o,l)?mn(d):me(0);let a=(r.left+i.x)/s.x,u=(r.top+i.y)/s.y,c=r.width/s.x,p=r.height/s.y;if(d){const f=ie(d),m=l&&ue(l)?ie(l):l;let h=f,g=ct(h);for(;g&&l&&m!==h;){const C=xe(g),k=g.getBoundingClientRect(),B=ce(g),$=k.left+(g.clientLeft+parseFloat(B.paddingLeft))*C.x,I=k.top+(g.clientTop+parseFloat(B.paddingTop))*C.y;a*=C.x,u*=C.y,c*=C.x,p*=C.y,a+=$,u+=I,h=ie(g),g=ct(h)}}return We({width:c,height:p,x:a,y:u})}function kt(e,n){const o=tt(e).scrollLeft;return n?n.left+o:we(ge(e)).left+o}function hn(e,n,o){o===void 0&&(o=!1);const l=e.getBoundingClientRect(),r=l.left+n.scrollLeft-(o?0:kt(e,l)),d=l.top+n.scrollTop;return{x:r,y:d}}function Va(e){let{elements:n,rect:o,offsetParent:l,strategy:r}=e;const d=r==="fixed",s=ge(l),i=n?et(n.floating):!1;if(l===s||i&&d)return o;let a={scrollLeft:0,scrollTop:0},u=me(1);const c=me(0),p=he(l);if((p||!p&&!d)&&(($e(l)!=="body"||Re(s))&&(a=tt(l)),he(l))){const m=we(l);u=xe(l),c.x=m.x+l.clientLeft,c.y=m.y+l.clientTop}const f=s&&!p&&!d?hn(s,a,!0):me(0);return{width:o.width*u.x,height:o.height*u.y,x:o.x*u.x-a.scrollLeft*u.x+c.x+f.x,y:o.y*u.y-a.scrollTop*u.y+c.y+f.y}}function Ea(e){return Array.from(e.getClientRects())}function Na(e){const n=ge(e),o=tt(e),l=e.ownerDocument.body,r=se(n.scrollWidth,n.clientWidth,l.scrollWidth,l.clientWidth),d=se(n.scrollHeight,n.clientHeight,l.scrollHeight,l.clientHeight);let s=-o.scrollLeft+kt(e);const i=-o.scrollTop;return ce(l).direction==="rtl"&&(s+=se(n.clientWidth,l.clientWidth)-r),{width:r,height:d,x:s,y:i}}function Aa(e,n){const o=ie(e),l=ge(e),r=o.visualViewport;let d=l.clientWidth,s=l.clientHeight,i=0,a=0;if(r){d=r.width,s=r.height;const u=Ct();(!u||u&&n==="fixed")&&(i=r.offsetLeft,a=r.offsetTop)}return{width:d,height:s,x:i,y:a}}function Da(e,n){const o=we(e,!0,n==="fixed"),l=o.top+e.clientTop,r=o.left+e.clientLeft,d=he(e)?xe(e):me(1),s=e.clientWidth*d.x,i=e.clientHeight*d.y,a=r*d.x,u=l*d.y;return{width:s,height:i,x:a,y:u}}function At(e,n,o){let l;if(n==="viewport")l=Aa(e,o);else if(n==="document")l=Na(ge(e));else if(ue(n))l=Da(n,o);else{const r=mn(e);l={x:n.x-r.x,y:n.y-r.y,width:n.width,height:n.height}}return We(l)}function vn(e,n){const o=ye(e);return o===n||!ue(o)||Ve(o)?!1:ce(o).position==="fixed"||vn(o,n)}function Ma(e,n){const o=n.get(e);if(o)return o;let l=De(e,[],!1).filter(i=>ue(i)&&$e(i)!=="body"),r=null;const d=ce(e).position==="fixed";let s=d?ye(e):e;for(;ue(s)&&!Ve(s);){const i=ce(s),a=yt(s);!a&&i.position==="fixed"&&(r=null),(d?!a&&!r:!a&&i.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||Re(s)&&!a&&vn(e,s))?l=l.filter(c=>c!==s):r=i,s=ye(s)}return n.set(e,l),l}function La(e){let{element:n,boundary:o,rootBoundary:l,strategy:r}=e;const s=[...o==="clippingAncestors"?et(n)?[]:Ma(n,this._c):[].concat(o),l],i=s[0],a=s.reduce((u,c)=>{const p=At(n,c,r);return u.top=se(p.top,u.top),u.right=Ie(p.right,u.right),u.bottom=Ie(p.bottom,u.bottom),u.left=se(p.left,u.left),u},At(n,i,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Ta(e){const{width:n,height:o}=fn(e);return{width:n,height:o}}function Ra(e,n,o){const l=he(n),r=ge(n),d=o==="fixed",s=we(e,!0,d,n);let i={scrollLeft:0,scrollTop:0};const a=me(0);if(l||!l&&!d)if(($e(n)!=="body"||Re(r))&&(i=tt(n)),l){const f=we(n,!0,d,n);a.x=f.x+n.clientLeft,a.y=f.y+n.clientTop}else r&&(a.x=kt(r));const u=r&&!l&&!d?hn(r,i):me(0),c=s.left+i.scrollLeft-a.x-u.x,p=s.top+i.scrollTop-a.y-u.y;return{x:c,y:p,width:s.width,height:s.height}}function dt(e){return ce(e).position==="static"}function Dt(e,n){if(!he(e)||ce(e).position==="fixed")return null;if(n)return n(e);let o=e.offsetParent;return ge(e)===o&&(o=o.ownerDocument.body),o}function gn(e,n){const o=ie(e);if(et(e))return o;if(!he(e)){let r=ye(e);for(;r&&!Ve(r);){if(ue(r)&&!dt(r))return r;r=ye(r)}return o}let l=Dt(e,n);for(;l&&Ba(l)&&dt(l);)l=Dt(l,n);return l&&Ve(l)&&dt(l)&&!yt(l)?o:l||Sa(e)||o}const Fa=function(e){return ee(this,null,function*(){const n=this.getOffsetParent||gn,o=this.getDimensions,l=yield o(e.floating);return{reference:Ra(e.reference,yield n(e.floating),e.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}})};function Oa(e){return ce(e).direction==="rtl"}const _a={convertOffsetParentRelativeRectToViewportRelativeRect:Va,getDocumentElement:ge,getClippingRect:La,getOffsetParent:gn,getElementRects:Fa,getClientRects:Ea,getDimensions:Ta,getScale:xe,isElement:ue,isRTL:Oa};function Pa(e,n){let o=null,l;const r=ge(e);function d(){var i;clearTimeout(l),(i=o)==null||i.disconnect(),o=null}function s(i,a){i===void 0&&(i=!1),a===void 0&&(a=1),d();const{left:u,top:c,width:p,height:f}=e.getBoundingClientRect();if(i||n(),!p||!f)return;const m=Pe(c),h=Pe(r.clientWidth-(u+p)),g=Pe(r.clientHeight-(c+f)),C=Pe(u),B={rootMargin:-m+"px "+-h+"px "+-g+"px "+-C+"px",threshold:se(0,Ie(1,a))||1};let $=!0;function I(E){const M=E[0].intersectionRatio;if(M!==a){if(!$)return s();M?s(!1,M):l=setTimeout(()=>{s(!1,1e-7)},1e3)}$=!1}try{o=new IntersectionObserver(I,oe(Q({},B),{root:r.ownerDocument}))}catch(E){o=new IntersectionObserver(I,B)}o.observe(e)}return s(!0),d}function bn(e,n,o,l){l===void 0&&(l={});const{ancestorScroll:r=!0,ancestorResize:d=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:a=!1}=l,u=wt(e),c=r||d?[...u?De(u):[],...De(n)]:[];c.forEach(k=>{r&&k.addEventListener("scroll",o,{passive:!0}),d&&k.addEventListener("resize",o)});const p=u&&i?Pa(u,o):null;let f=-1,m=null;s&&(m=new ResizeObserver(k=>{let[B]=k;B&&B.target===u&&m&&(m.unobserve(n),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var $;($=m)==null||$.observe(n)})),o()}),u&&!a&&m.observe(u),m.observe(n));let h,g=a?we(e):null;a&&C();function C(){const k=we(e);g&&(k.x!==g.x||k.y!==g.y||k.width!==g.width||k.height!==g.height)&&o(),g=k,h=requestAnimationFrame(C)}return o(),()=>{var k;c.forEach(B=>{r&&B.removeEventListener("scroll",o),d&&B.removeEventListener("resize",o)}),p==null||p(),(k=m)==null||k.disconnect(),m=null,a&&cancelAnimationFrame(h)}}const yn=wa,za=ka,Cn=ba,Ka=$a,pt=ya,wn=(e,n,o)=>{const l=new Map,r=Q({platform:_a},o),d=oe(Q({},r.platform),{_c:l});return ga(e,n,oe(Q({},r),{platform:d}))};function Ha(e){return e!=null&&typeof e=="object"&&"$el"in e}function Mt(e){if(Ha(e)){const n=e.$el;return bt(n)&&$e(n)==="#comment"?null:n}return e}function kn(e){return typeof window=="undefined"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Lt(e,n){const o=kn(e);return Math.round(n*o)/o}function Ua(e,n,o){o===void 0&&(o={});const l=o.whileElementsMounted,r=t.computed(()=>{var A;return(A=t.unref(o.open))!=null?A:!0}),d=t.computed(()=>t.unref(o.middleware)),s=t.computed(()=>{var A;return(A=t.unref(o.placement))!=null?A:"bottom"}),i=t.computed(()=>{var A;return(A=t.unref(o.strategy))!=null?A:"absolute"}),a=t.computed(()=>{var A;return(A=t.unref(o.transform))!=null?A:!0}),u=t.computed(()=>Mt(e.value)),c=t.computed(()=>Mt(n.value)),p=t.ref(0),f=t.ref(0),m=t.ref(i.value),h=t.ref(s.value),g=t.shallowRef({}),C=t.ref(!1),k=t.computed(()=>{const A={position:m.value,left:"0",top:"0"};if(!c.value)return A;const x=Lt(c.value,p.value),y=Lt(c.value,f.value);return a.value?Q(oe(Q({},A),{transform:"translate("+x+"px, "+y+"px)"}),kn(c.value)>=1.5&&{willChange:"transform"}):{position:m.value,left:x+"px",top:y+"px"}});let B;function $(){u.value==null||c.value==null||wn(u.value,c.value,{middleware:d.value,placement:s.value,strategy:i.value}).then(A=>{p.value=A.x,f.value=A.y,m.value=A.strategy,h.value=A.placement,g.value=A.middlewareData,C.value=!0})}function I(){typeof B=="function"&&(B(),B=void 0)}function E(){if(I(),l===void 0){$();return}if(u.value!=null&&c.value!=null){B=l(u.value,c.value,$);return}}function M(){r.value||(C.value=!1)}return t.watch([d,s,i],$,{flush:"sync"}),t.watch([u,c],E,{flush:"sync"}),t.watch(r,M,{flush:"sync"}),t.getCurrentScope()&&t.onScopeDispose(I),{x:t.shallowReadonly(p),y:t.shallowReadonly(f),strategy:t.shallowReadonly(m),placement:t.shallowReadonly(h),middlewareData:t.shallowReadonly(g),isPositioned:t.shallowReadonly(C),floatingStyles:k,update:$}}function ja(e){return e&&"$el"in e?e.$el:e}const Tt=16,Wa=128;function Ne(e,n,o){var p;const l=()=>{var f;return(f=n.value)==null?void 0:f.isExpanded()},r=[yn(o==null?void 0:o.offset),Ka({padding:Tt,apply({rects:f,elements:m,availableHeight:h,availableWidth:g}){Object.assign(m.floating.style,{width:"".concat(o!=null&&o.useAvailableWidth?g:f.reference.width,"px"),maxHeight:"".concat(Math.max(Wa,h),"px")})}}),Cn({padding:Tt}),pt({strategy:"escaped"}),pt()],{floatingStyles:d,placement:s,middlewareData:i,update:a}=Ua(e,n,{middleware:r,placement:(p=o==null?void 0:o.placement)!=null?p:"bottom"}),u=t.computed(()=>{var m,h;return!l()||!!((m=i.value.hide)!=null&&m.escaped)||((h=i.value.hide)==null?void 0:h.referenceHidden)?"hidden":"visible"});t.watch([d,u,s],([f,m,h])=>{var g,C,k,B,$;Object.assign((C=(g=n.value)==null?void 0:g.$el.style)!=null?C:{},{visibility:m,position:f.position,top:"".concat(f.top,"px"),right:"unset",left:"".concat(f.left,"px"),transform:(k=f.transform)!=null?k:"none",borderTopLeftRadius:h==="bottom"&&m==="visible"?"0":"",borderTopRightRadius:h==="bottom"&&m==="visible"?"0":"",borderBottomLeftRadius:h==="top"&&m==="visible"?"0":"",borderBottomRightRadius:h==="top"&&m==="visible"?"0":""}),Object.assign(($=(B=ja(e.value))==null?void 0:B.style)!=null?$:{},{borderTopLeftRadius:h==="top"&&m==="visible"?"0":"",borderTopRightRadius:h==="top"&&m==="visible"?"0":"",borderBottomLeftRadius:h==="bottom"&&m==="visible"?"0":"",borderBottomRightRadius:h==="bottom"&&m==="visible"?"0":""})});let c=null;t.watch(l,f=>{var m;f?c=bn(e.value&&"$el"in e.value?e.value.$el:e,(m=n.value)==null?void 0:m.$el,a):c&&(c(),c=null)})}const qa=J(pe),Qa=t.defineComponent({name:"CdxCombobox",components:{CdxButton:ve,CdxIcon:q,CdxMenu:ke,CdxTextInput:Je},inheritAttrs:!1,props:{menuItems:{type:Array,required:!0},selected:{type:[String,Number],required:!0},disabled:{type:Boolean,default:!1},menuConfig:{type:Object,default:()=>({})},status:{type:String,default:"default",validator:qa}},emits:["update:selected","load-more","input","change","focus","blur"],setup(e,{emit:n,attrs:o,slots:l}){const r=t.ref(),d=t.ref(),s=t.ref(),i=U("combobox"),a=t.toRef(e,"selected"),u=ne(a,n,"update:selected"),c=t.ref(!1),p=t.ref(!1),f=t.computed(()=>{var x,y;return(y=(x=s.value)==null?void 0:x.getHighlightedMenuItem())==null?void 0:y.id}),{computedDisabled:m,computedStatus:h}=le(t.toRef(e,"disabled"),t.toRef(e,"status")),g=t.computed(()=>({"cdx-combobox--expanded":c.value,"cdx-combobox--disabled":m.value})),{rootClasses:C,rootStyle:k,otherAttrs:B}=ae(o,g);function $(x){p.value&&c.value?c.value=!1:(e.menuItems.length>0||l["no-results"])&&(c.value=!0),n("focus",x)}function I(x){c.value=p.value&&c.value,n("blur",x)}function E(){m.value||(p.value=!0)}function M(){var x;m.value||(x=r.value)==null||x.focus()}function A(x){!s.value||m.value||e.menuItems.length===0||x.key===" "||s.value.delegateKeyNavigation(x)}return Ne(r,s),t.watch(c,()=>{p.value=!1}),{input:r,inputWrapper:d,menu:s,menuId:i,modelWrapper:u,expanded:c,highlightedId:f,computedDisabled:m,computedStatus:h,onInputFocus:$,onInputBlur:I,onKeydown:A,onButtonClick:M,onButtonMousedown:E,cdxIconExpand:Ot,rootClasses:C,rootStyle:k,otherAttrs:B}}}),Ga={ref:"inputWrapper",class:"cdx-combobox__input-wrapper"};function Ya(e,n,o,l,r,d){const s=t.resolveComponent("cdx-text-input"),i=t.resolveComponent("cdx-icon"),a=t.resolveComponent("cdx-button"),u=t.resolveComponent("cdx-menu");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-combobox",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.createElementVNode("div",Ga,[t.createVNode(s,t.mergeProps({ref:"input",modelValue:e.modelWrapper,"onUpdate:modelValue":n[0]||(n[0]=c=>e.modelWrapper=c)},e.otherAttrs,{class:"cdx-combobox__input","aria-activedescendant":e.highlightedId,"aria-expanded":e.expanded,"aria-controls":e.menuId,disabled:e.computedDisabled,status:e.computedStatus,autocomplete:"off",role:"combobox",onKeydown:e.onKeydown,onInput:n[1]||(n[1]=c=>e.$emit("input",c)),onChange:n[2]||(n[2]=c=>e.$emit("change",c)),onFocus:e.onInputFocus,onBlur:e.onInputBlur}),null,16,["modelValue","aria-activedescendant","aria-expanded","aria-controls","disabled","status","onKeydown","onFocus","onBlur"]),t.createVNode(a,{class:"cdx-combobox__expand-button","aria-hidden":"true",disabled:e.computedDisabled,tabindex:"-1",type:"button",onMousedown:e.onButtonMousedown,onClick:e.onButtonClick},{default:t.withCtx(()=>[t.createVNode(i,{class:"cdx-combobox__expand-icon",icon:e.cdxIconExpand},null,8,["icon"])]),_:1},8,["disabled","onMousedown","onClick"])],512),t.createVNode(u,t.mergeProps({id:e.menuId,ref:"menu",selected:e.modelWrapper,"onUpdate:selected":n[3]||(n[3]=c=>e.modelWrapper=c),expanded:e.expanded,"onUpdate:expanded":n[4]||(n[4]=c=>e.expanded=c),"menu-items":e.menuItems},e.menuConfig,{onLoadMore:n[5]||(n[5]=c=>e.$emit("load-more"))}),{default:t.withCtx(({menuItem:c})=>[t.renderSlot(e.$slots,"menu-item",{menuItem:c})]),"no-results":t.withCtx(()=>[t.renderSlot(e.$slots,"no-results")]),_:3},16,["id","selected","expanded","menu-items"])],6)}const Xa=_(Qa,[["render",Ya]]);function $n(e){const n=t.ref({width:void 0,height:void 0});if(typeof window!="object"||!("ResizeObserver"in window)||!("ResizeObserverEntry"in window))return n;const o=new window.ResizeObserver(r=>{const d=r[0];d&&(n.value={width:d.borderBoxSize[0].inlineSize,height:d.borderBoxSize[0].blockSize})});let l=!1;return t.onMounted(()=>{l=!0,e.value&&o.observe(e.value)}),t.onUnmounted(()=>{l=!1,o.disconnect()}),t.watch(e,r=>{l&&(o.disconnect(),n.value={width:void 0,height:void 0},r&&o.observe(r))}),n}const Ja=t.defineComponent({name:"CdxDialog",components:{CdxButton:ve,CdxIcon:q},inheritAttrs:!1,props:{open:{type:Boolean,default:!1},title:{type:String,required:!0},subtitle:{type:String,required:!1,default:null},hideTitle:{type:Boolean,default:!1},useCloseButton:{type:Boolean,default:!1},closeButtonLabel:{type:String,default:""},primaryAction:{type:Object,default:null},defaultAction:{type:Object,default:null},stackedActions:{type:Boolean,default:!1},target:{type:String,default:null},renderInPlace:{type:Boolean,default:!1}},emits:["update:open","primary","default"],setup(e,{emit:n}){const o=U("dialog-label"),l=t.ref(),r=t.ref(),d=t.ref(),s=t.ref(),i=t.ref(),a=t.ref();let u=null;const c=t.computed(()=>e.useCloseButton||e.closeButtonLabel.length>0),p=Ye(t.toRef(e,"closeButtonLabel"),"cdx-dialog-close-button-label","Close"),f=t.computed(()=>!e.hideTitle||c.value),m=t.computed(()=>!!e.primaryAction||!!e.defaultAction),h=$n(d),g=t.computed(()=>{var L;return(L=h.value.height)!=null?L:0}),C=t.ref(!1),k=t.computed(()=>({"cdx-dialog--vertical-actions":e.stackedActions,"cdx-dialog--horizontal-actions":!e.stackedActions,"cdx-dialog--dividers":C.value})),B=t.inject("CdxTeleportTarget",void 0),$=t.computed(()=>{var L,F;return(F=(L=e.target)!=null?L:B)!=null?F:"body"}),I=t.ref(0);function E(){n("update:open",!1)}function M(){x(r.value)}function A(){x(r.value,!0)}function x(L,F=!1){let G=Array.from(L.querySelectorAll('\n input, select, textarea, button, object, a, area,\n [contenteditable], [tabindex]:not([tabindex^="-"])\n '));F&&(G=G.reverse());for(const j of G)if(j.focus(),document.activeElement===j)return!0;return!1}let y=[],b=[];function S(){let L=l.value;for(;L.parentElement&&L.nodeName!=="BODY";){for(const F of Array.from(L.parentElement.children))F===L||F.nodeName==="SCRIPT"||(F.hasAttribute("aria-hidden")||(F.setAttribute("aria-hidden","true"),y.push(F)),F.hasAttribute("inert")||(F.setAttribute("inert",""),b.push(F)));L=L.parentElement}}function V(){for(const L of y)L.removeAttribute("aria-hidden");for(const L of b)L.removeAttribute("inert");y=[],b=[]}function R(){return ee(this,null,function*(){var L;yield t.nextTick(),I.value=window.innerWidth-document.documentElement.clientWidth,document.documentElement.style.setProperty("margin-right","".concat(I.value,"px")),document.body.classList.add("cdx-dialog-open"),S(),u=document.activeElement,x(d.value)||(L=s.value)==null||L.focus()})}function z(){document.body.classList.remove("cdx-dialog-open"),document.documentElement.style.removeProperty("margin-right"),V(),u instanceof HTMLElement&&document.contains(u)&&(u.focus(),u=null)}return t.onMounted(()=>{e.open&&R()}),t.onUnmounted(()=>{e.open&&z()}),t.watch(t.toRef(e,"open"),L=>{L?R():z()}),t.watch(g,()=>{d.value&&(C.value=d.value.clientHeight[e.open?(t.openBlock(),t.createElementBlock("div",{key:0,ref:"backdrop",class:"cdx-dialog-backdrop",onClick:n[5]||(n[5]=(...a)=>e.close&&e.close(...a)),onKeyup:n[6]||(n[6]=t.withKeys((...a)=>e.close&&e.close(...a),["escape"]))},[t.createElementVNode("div",{ref:"focusTrapStart",tabindex:"0",onFocus:n[0]||(n[0]=(...a)=>e.focusLast&&e.focusLast(...a))},null,544),t.createElementVNode("div",t.mergeProps({ref:"dialogElement",class:["cdx-dialog",e.rootClasses],role:"dialog"},e.$attrs,{"aria-label":e.$slots.header||e.hideTitle?e.title:void 0,"aria-labelledby":!e.$slots.header&&!e.hideTitle?e.labelId:void 0,"aria-modal":"true",onClick:n[3]||(n[3]=t.withModifiers(()=>{},["stop"]))}),[e.showHeader||e.$slots.header?(t.openBlock(),t.createElementBlock("header",{key:0,class:t.normalizeClass(["cdx-dialog__header",{"cdx-dialog__header--default":!e.$slots.header}])},[t.renderSlot(e.$slots,"header",{},()=>[e.hideTitle?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock("div",es,[t.createElementVNode("h2",{id:e.labelId,class:"cdx-dialog__header__title"},t.toDisplayString(e.title),9,ts),e.subtitle?(t.openBlock(),t.createElementBlock("p",ns,t.toDisplayString(e.subtitle),1)):t.createCommentVNode("v-if",!0)])),e.useCloseButtonOrLabel?(t.openBlock(),t.createBlock(i,{key:1,class:"cdx-dialog__header__close-button",weight:"quiet",type:"button","aria-label":e.translatedCloseButtonLabel,onClick:e.close},{default:t.withCtx(()=>[t.createVNode(s,{icon:e.cdxIconClose},null,8,["icon"])]),_:1},8,["aria-label","onClick"])):t.createCommentVNode("v-if",!0)])],2)):t.createCommentVNode("v-if",!0),t.createElementVNode("div",os,null,512),t.createElementVNode("div",{ref:"dialogBody",class:t.normalizeClass(["cdx-dialog__body",{"cdx-dialog__body--no-header":!(e.showHeader||e.$slots.header),"cdx-dialog__body--no-footer":!(e.showFooterActions||e.$slots.footer||e.$slots["footer-text"])}])},[t.renderSlot(e.$slots,"default")],2),e.showFooterActions||e.$slots.footer||e.$slots["footer-text"]?(t.openBlock(),t.createElementBlock("footer",{key:1,class:t.normalizeClass(["cdx-dialog__footer",{"cdx-dialog__footer--default":!e.$slots.footer}])},[t.renderSlot(e.$slots,"footer",{},()=>[e.$slots["footer-text"]?(t.openBlock(),t.createElementBlock("p",ls,[t.renderSlot(e.$slots,"footer-text")])):t.createCommentVNode("v-if",!0),e.showFooterActions?(t.openBlock(),t.createElementBlock("div",as,[e.primaryAction?(t.openBlock(),t.createBlock(i,{key:0,class:"cdx-dialog__footer__primary-action",weight:"primary",action:e.primaryAction.actionType,disabled:e.primaryAction.disabled,onClick:n[1]||(n[1]=a=>e.$emit("primary"))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.primaryAction.label),1)]),_:1},8,["action","disabled"])):t.createCommentVNode("v-if",!0),e.defaultAction?(t.openBlock(),t.createBlock(i,{key:1,class:"cdx-dialog__footer__default-action",disabled:e.defaultAction.disabled,onClick:n[2]||(n[2]=a=>e.$emit("default"))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.defaultAction.label),1)]),_:1},8,["disabled"])):t.createCommentVNode("v-if",!0)])):t.createCommentVNode("v-if",!0)])],2)):t.createCommentVNode("v-if",!0)],16,Za),t.createElementVNode("div",{ref:"focusTrapEnd",tabindex:"0",onFocus:n[4]||(n[4]=(...a)=>e.focusFirst&&e.focusFirst(...a))},null,544)],544)):t.createCommentVNode("v-if",!0)]),_:3})],8,["to","disabled"])}const is=_(Ja,[["render",ss]]),rs={notice:_t,error:Ft,warning:Rt,success:Kt},ds=t.defineComponent({name:"CdxMessage",components:{CdxButton:ve,CdxIcon:q},props:{type:{type:String,default:"notice",validator:Ut},inline:{type:Boolean,default:!1},icon:{type:[String,Object],default:null},fadeIn:{type:Boolean,default:!1},allowUserDismiss:{type:Boolean,default:!1},dismissButtonLabel:{type:String,default:""},autoDismiss:{type:[Boolean,Number],default:!1,validator:e=>typeof e=="boolean"||typeof e=="number"&&e>0}},emits:["user-dismissed","auto-dismissed"],setup(e,{emit:n}){const o=t.ref(!1),l=t.computed(()=>e.inline===!1&&(e.dismissButtonLabel.length>0||e.allowUserDismiss)),r=Ye(t.toRef(e,"dismissButtonLabel"),"cdx-message-dismiss-button-label","Close"),d=t.computed(()=>e.autoDismiss===!1||e.type==="error"?!1:e.autoDismiss===!0?4e3:e.autoDismiss),s=t.computed(()=>({"cdx-message--inline":e.inline,"cdx-message--block":!e.inline,"cdx-message--user-dismissable":l.value,["cdx-message--".concat(e.type)]:!0})),i=t.computed(()=>e.icon&&e.type==="notice"?e.icon:rs[e.type]),a=t.ref("");function u(c){o.value||(a.value=c==="user-dismissed"?"cdx-message-leave-active-user":"cdx-message-leave-active-system",o.value=!0,n(c))}return t.onMounted(()=>{e.type==="error"&&e.autoDismiss!==!1?t.warn('CdxMessage: Message with type="error" cannot use auto-dismiss'):d.value&&setTimeout(()=>u("auto-dismissed"),d.value)}),{dismissed:o,userDismissable:l,translatedDismissButtonLabel:r,rootClasses:s,leaveActiveClass:a,computedIcon:i,onDismiss:u,cdxIconClose:ft}}}),us=["aria-live","role"],cs={class:"cdx-message__content"};function ps(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon"),i=t.resolveComponent("cdx-button");return t.openBlock(),t.createBlock(t.Transition,{name:"cdx-message",appear:e.fadeIn,"leave-active-class":e.leaveActiveClass},{default:t.withCtx(()=>[e.dismissed?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["cdx-message",e.rootClasses]),"aria-live":e.type!=="error"?"polite":void 0,role:e.type==="error"?"alert":void 0},[t.createVNode(s,{class:"cdx-message__icon--vue",icon:e.computedIcon},null,8,["icon"]),t.createElementVNode("div",cs,[t.renderSlot(e.$slots,"default")]),e.userDismissable?(t.openBlock(),t.createBlock(i,{key:0,class:"cdx-message__dismiss-button",weight:"quiet",type:"button","aria-label":e.translatedDismissButtonLabel,onClick:n[0]||(n[0]=a=>e.onDismiss("user-dismissed"))},{default:t.withCtx(()=>[t.createVNode(s,{icon:e.cdxIconClose},null,8,["icon"])]),_:1},8,["aria-label"])):t.createCommentVNode("v-if",!0)],10,us))]),_:3},8,["appear","leave-active-class"])}const Bn=_(ds,[["render",ps]]),fs=J(pe),ms=t.defineComponent({name:"CdxField",components:{CdxLabel:Le,CdxMessage:Bn},props:{labelIcon:{type:[String,Object],default:""},optional:{type:Boolean,default:!1},optionalFlag:{type:String,default:""},hideLabel:{type:Boolean,default:!1},isFieldset:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},status:{type:String,default:"default",validator:fs},messages:{type:Object,default:()=>({})}},setup(e,{slots:n}){const{disabled:o,status:l,isFieldset:r}=t.toRefs(e),d=ht(o),s=t.computed(()=>({"cdx-field--disabled":d.value,"cdx-field--is-fieldset":r.value})),i=U("label"),a=U("description"),u=U("input"),c=t.computed(()=>r.value?void 0:u);t.provide(Qt,c);const p=t.computed(()=>!r.value&&n.description?a:void 0);t.provide(qe,p),t.provide(Yt,d),t.provide(Gt,l);const f=t.computed(()=>e.status!=="default"&&e.status in e.messages?e.messages[e.status]:""),m=t.computed(()=>e.status==="default"?"notice":e.status);return{rootClasses:s,computedDisabled:d,labelId:i,descriptionId:a,inputId:u,validationMessage:f,validationMessageType:m}}}),hs={class:"cdx-field__control"},vs={class:"cdx-field__help-text"},gs={key:0,class:"cdx-field__validation-message"};function bs(e,n,o,l,r,d){const s=t.resolveComponent("cdx-label"),i=t.resolveComponent("cdx-message");return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.isFieldset?"fieldset":"div"),{class:t.normalizeClass(["cdx-field",e.rootClasses]),"aria-disabled":!e.isFieldset&&e.computedDisabled?!0:void 0,disabled:e.isFieldset&&e.computedDisabled?!0:void 0},{default:t.withCtx(()=>[t.createVNode(s,{id:e.labelId,icon:e.labelIcon,"visually-hidden":e.hideLabel,optional:e.optional,"optional-flag":e.optionalFlag,"input-id":e.inputId,"description-id":e.descriptionId,disabled:e.computedDisabled,"is-legend":e.isFieldset},t.createSlots({default:t.withCtx(()=>[t.renderSlot(e.$slots,"label")]),_:2},[e.$slots.description&&e.$slots.description().length>0?{name:"description",fn:t.withCtx(()=>[t.renderSlot(e.$slots,"description")]),key:"0"}:void 0]),1032,["id","icon","visually-hidden","optional","optional-flag","input-id","description-id","disabled","is-legend"]),t.createElementVNode("div",hs,[t.renderSlot(e.$slots,"default")]),t.createElementVNode("div",vs,[t.renderSlot(e.$slots,"help-text")]),!e.computedDisabled&&e.validationMessage||e.$slots[e.validationMessageType]?(t.openBlock(),t.createElementBlock("div",gs,[t.createVNode(i,{type:e.validationMessageType,inline:!0},{default:t.withCtx(()=>[e.status==="warning"&&e.$slots.warning?t.renderSlot(e.$slots,"warning",{key:0}):e.status==="error"&&e.$slots.error?t.renderSlot(e.$slots,"error",{key:1}):e.status==="success"&&e.$slots.success?t.renderSlot(e.$slots,"success",{key:2}):(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createTextVNode(t.toDisplayString(e.validationMessage),1)],64))]),_:3},8,["type"])])):t.createCommentVNode("v-if",!0)]),_:3},8,["class","aria-disabled","disabled"])}const ys=_(ms,[["render",bs]]),Cs={notice:_t,error:Ft,warning:Rt,success:Kt},ws=t.defineComponent({name:"CdxInfoChip",components:{CdxIcon:q},props:{status:{type:String,default:"notice",validator:Ut},icon:{type:[String,Object],default:null}},setup(e){const n=t.computed(()=>({["cdx-info-chip--".concat(e.status)]:!0})),o=t.computed(()=>e.status==="notice"?e.icon:Cs[e.status]);return{rootClasses:n,computedIcon:o}}}),ks={class:"cdx-info-chip__text"};function $s(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-info-chip",e.rootClasses])},[e.computedIcon?(t.openBlock(),t.createBlock(s,{key:0,class:"cdx-info-chip__icon--vue",icon:e.computedIcon},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createElementVNode("span",ks,[t.renderSlot(e.$slots,"default")])],2)}const Bs=_(ws,[["render",$s]]),Ss=J(pe),xs=t.defineComponent({name:"CdxLookup",components:{CdxMenu:ke,CdxTextInput:Je},inheritAttrs:!1,props:{selected:{type:[String,Number,null],required:!0},menuItems:{type:Array,required:!0},inputValue:{type:[String,Number],default:null},initialInputValue:{type:[String,Number],default:"",validator:e=>(e&&console.warn("CdxLookup: prop initialInputValue is deprecated. Use inputValue instead."),!0)},disabled:{type:Boolean,default:!1},menuConfig:{type:Object,default:()=>({})},status:{type:String,default:"default",validator:Ss}},emits:["update:selected","update:input-value","load-more","input","change","focus","blur"],setup:(e,{emit:n,attrs:o,slots:l})=>{const r=t.ref(),d=t.ref(),s=t.ref(),i=U("lookup-menu"),a=t.ref(!1),u=t.ref(!1),c=t.ref(!1),p=t.ref(e.menuItems),{computedDisabled:f,computedStatus:m}=le(t.toRef(e,"disabled"),t.toRef(e,"status")),h=t.toRef(e,"selected"),g=ne(h,n,"update:selected"),C=t.computed(()=>{var V;return(V=s.value)==null?void 0:V.getComputedMenuItems().find(R=>R.value===g.value)}),k=t.computed(()=>{var V,R;return(R=(V=s.value)==null?void 0:V.getHighlightedMenuItem())==null?void 0:R.id}),B=t.ref(e.initialInputValue),$=Xe(B,t.toRef(e,"inputValue"),n,"update:input-value"),I=t.computed(()=>({"cdx-lookup--disabled":f.value,"cdx-lookup--pending":a.value})),{rootClasses:E,rootStyle:M,otherAttrs:A}=ae(o,I);function x(V){C.value?C.value.label!==V&&C.value.value!==V&&(g.value=null):e.selected!==null&&e.selected!==V&&(g.value=null),V===""&&p.value.length===0?(u.value=!1,a.value=!1):a.value=!0,n("input",V)}function y(V){c.value=!0;const R=$.value!==null&&$.value!=="";!!(e.menuItems.length>0||l["no-results"])&&(R||p.value.length>0)&&(u.value=!0),n("focus",V)}function b(V){c.value=!1,u.value=!1,n("blur",V)}function S(V){!s.value||f.value||e.menuItems.length===0&&!l["no-results"]||V.key===" "||s.value.delegateKeyNavigation(V)}return Ne(d,s),t.watch(g,V=>{var R;if(V!==null){const z=C.value?(R=C.value.label)!=null?R:C.value.value:"";$.value!==z&&($.value=z,n("input",z))}}),t.watch(t.toRef(e,"menuItems"),V=>{c.value&&a.value&&(V.length>0||l["no-results"])&&(u.value=!0),V.length===0&&!l["no-results"]&&(u.value=!1),a.value=!1}),{rootElement:r,textInput:d,menu:s,menuId:i,highlightedId:k,computedInputValue:$,selection:g,expanded:u,computedDisabled:f,computedStatus:m,onInputBlur:b,rootClasses:E,rootStyle:M,otherAttrs:A,onUpdateInput:x,onInputFocus:y,onKeydown:S}}});function Is(e,n,o,l,r,d){const s=t.resolveComponent("cdx-text-input"),i=t.resolveComponent("cdx-menu");return t.openBlock(),t.createElementBlock("div",{ref:"rootElement",class:t.normalizeClass(["cdx-lookup",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.createVNode(s,t.mergeProps({ref:"textInput",modelValue:e.computedInputValue,"onUpdate:modelValue":n[0]||(n[0]=a=>e.computedInputValue=a)},e.otherAttrs,{class:"cdx-lookup__input",role:"combobox",autocomplete:"off","aria-autocomplete":"list","aria-controls":e.menuId,"aria-expanded":e.expanded,"aria-activedescendant":e.highlightedId,disabled:e.computedDisabled,status:e.computedStatus,"onUpdate:modelValue":e.onUpdateInput,onChange:n[1]||(n[1]=a=>e.$emit("change",a)),onFocus:e.onInputFocus,onBlur:e.onInputBlur,onKeydown:e.onKeydown}),null,16,["modelValue","aria-controls","aria-expanded","aria-activedescendant","disabled","status","onUpdate:modelValue","onFocus","onBlur","onKeydown"]),t.createVNode(i,t.mergeProps({id:e.menuId,ref:"menu",selected:e.selection,"onUpdate:selected":n[2]||(n[2]=a=>e.selection=a),expanded:e.expanded,"onUpdate:expanded":n[3]||(n[3]=a=>e.expanded=a),"menu-items":e.menuItems},e.menuConfig,{onLoadMore:n[4]||(n[4]=a=>e.$emit("load-more"))}),{default:t.withCtx(({menuItem:a})=>[t.renderSlot(e.$slots,"menu-item",{menuItem:a})]),"no-results":t.withCtx(()=>[t.renderSlot(e.$slots,"no-results")]),_:3},16,["id","selected","expanded","menu-items"])],6)}const Vs=_(xs,[["render",Is]]),Es=t.defineComponent({name:"CdxToggleButton",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},quiet:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:n,slots:o,attrs:l}){const r=Zt(o.default,l,"CdxToggleButton"),d=t.ref(!1),s=t.computed(()=>({"cdx-toggle-button--quiet":e.quiet,"cdx-toggle-button--framed":!e.quiet,"cdx-toggle-button--toggled-on":e.modelValue,"cdx-toggle-button--toggled-off":!e.modelValue,"cdx-toggle-button--icon-only":r.value,"cdx-toggle-button--is-active":d.value})),i=()=>{n("update:modelValue",!e.modelValue)},a=p=>{d.value=p};function u(){a(!0)}function c(){a(!1),i()}return{rootClasses:s,onClick:i,onKeyDown:u,onKeyUp:c}}}),Ns=["aria-pressed","disabled"];function As(e,n,o,l,r,d){return t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(["cdx-toggle-button",e.rootClasses]),"aria-pressed":e.modelValue,disabled:e.disabled,type:"button",onClick:n[0]||(n[0]=(...s)=>e.onClick&&e.onClick(...s)),onKeydown:n[1]||(n[1]=t.withKeys(t.withModifiers((...s)=>e.onKeyDown&&e.onKeyDown(...s),["prevent"]),["space","enter"])),onKeyup:n[2]||(n[2]=t.withKeys((...s)=>e.onKeyUp&&e.onKeyUp(...s),["space","enter"]))},[t.renderSlot(e.$slots,"default")],42,Ns)}const $t=_(Es,[["render",As]]),Ds=t.defineComponent({name:"CdxMenuButton",components:{CdxToggleButton:$t,CdxMenu:ke},inheritAttrs:!1,props:{selected:{type:[String,Number,null],required:!0},menuItems:{type:Array,required:!0},menuConfig:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},footer:{type:Object,default:null}},emits:["update:selected"],setup(e,{emit:n,attrs:o}){const l=t.ref(),r=t.ref(),d=t.toRef(e,"selected"),s=ne(d,n,"update:selected"),i=t.ref(!1),a=U("menuToggle"),u=U("menu"),{computedDisabled:c}=le(t.toRef(e,"disabled")),{rootClasses:p,rootStyle:f,otherAttrs:m}=ae(o);function h(g){!l.value||c.value||e.menuItems.length===0||g.key===" "||l.value.delegateKeyNavigation(g)}return Ne(r,l,{useAvailableWidth:!0,placement:"bottom-start",offset:4}),{computedDisabled:c,expanded:i,menu:l,menuId:u,modelWrapper:s,onKeydown:h,toggle:r,toggleId:a,rootClasses:p,rootStyle:f,otherAttrs:m}}}),Ms={class:"cdx-menu-button__menu-wrapper"};function Ls(e,n,o,l,r,d){const s=t.resolveComponent("cdx-toggle-button"),i=t.resolveComponent("cdx-menu");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-menu-button",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.createVNode(s,t.mergeProps({id:e.toggleId,ref:"toggle"},e.otherAttrs,{modelValue:e.expanded,"onUpdate:modelValue":n[0]||(n[0]=a=>e.expanded=a),disabled:e.computedDisabled,quiet:"","aria-haspopup":"menu","aria-controls":e.menuId,"aria-expanded":e.expanded,onBlur:n[1]||(n[1]=a=>e.expanded=!1),onKeydown:e.onKeydown}),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["id","modelValue","disabled","aria-controls","aria-expanded","onKeydown"]),t.createElementVNode("div",Ms,[t.createVNode(i,t.mergeProps({id:e.menuId,ref:"menu",selected:e.modelWrapper,"onUpdate:selected":n[2]||(n[2]=a=>e.modelWrapper=a),expanded:e.expanded,"onUpdate:expanded":n[3]||(n[3]=a=>e.expanded=a),"menu-items":e.menuItems},e.menuConfig,{role:"menu","aria-labelledby":e.toggleId,footer:e.footer}),{default:t.withCtx(({menuItem:a})=>[t.renderSlot(e.$slots,"menu-item",{menuItem:a})]),_:3},16,["id","selected","expanded","menu-items","aria-labelledby","footer"])])],6)}const Ts=_(Ds,[["render",Ls]]),Rs=J(pe),Fs=t.defineComponent({name:"CdxMultiselectLookup",components:{CdxChipInput:on,CdxMenu:ke},props:{inputChips:{type:Array,required:!0},selected:{type:[Array],required:!0},menuItems:{type:Array,required:!0},inputValue:{type:[String,Number],default:null},separateInput:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},status:{type:String,default:"default",validator:Rs},menuConfig:{type:Object,default:()=>({})}},emits:["update:input-chips","update:selected","update:input-value","load-more","input","change","focus","blur"],setup:(e,{emit:n,attrs:o,slots:l})=>{const r=t.ref(),d=t.ref(),s=U("multiselect-lookup-menu"),i=t.computed(()=>{var b,S;return(S=(b=d.value)==null?void 0:b.getHighlightedMenuItem())==null?void 0:S.id}),a=t.ref(!1),u=t.ref(!1),c=t.ref(!1);t.provide(qt,t.ref(!1));const{computedDisabled:p,computedStatus:f}=le(t.toRef(e,"disabled"),t.toRef(e,"status")),m=t.computed(()=>({"cdx-multiselect-lookup--disabled":p.value,"cdx-multiselect-lookup--pending":a.value})),{rootClasses:h,rootStyle:g,otherAttrs:C}=ae(o,m);Ne(r,d);const k=ne(t.toRef(e,"selected"),n,"update:selected"),B=ne(t.toRef(e,"inputChips"),n,"update:input-chips"),$=t.ref(""),I=Xe($,t.toRef(e,"inputValue"),n,"update:input-value"),E=t.computed(()=>I.value.toString().length>0&&l["no-results"]);function M(b){return ee(this,null,function*(){yield t.nextTick(),a.value=b!==null&&b!=="",n("input",b)})}function A(b){c.value=!0,(e.menuItems.length>0||E.value)&&(u.value=!0),n("focus",b)}function x(b){c.value=!1,u.value=!1,n("blur",b)}function y(b){!d.value||p.value||e.menuItems.length===0&&!E.value||b.key===" "||d.value.delegateKeyNavigation(b)}return t.watch(t.toRef(e,"selected"),b=>{const S=b.filter(V=>B.value.find(R=>V===R.value)===void 0);S.length>0&&(S.forEach(V=>{var z;const R=(z=d.value)==null?void 0:z.getComputedMenuItems().find(F=>F.value===V);if(R){const L=R,{id:F}=L,G=de(L,["id"]);B.value.push(G)}}),I.value="",n("input","")),B.value=B.value.filter(V=>b.find(R=>V.value===R)!==void 0)}),t.watch(t.toRef(e,"inputChips"),b=>{b.lengthS.value))}),t.watch(t.toRef(e,"menuItems"),b=>{b.length===0&&!E.value?u.value=!1:c.value&&a.value&&(u.value=!0),a.value=!1}),{chipInput:r,menu:d,menuId:s,highlightedId:i,expanded:u,computedDisabled:p,computedStatus:f,rootClasses:h,rootStyle:g,otherAttrs:C,selectedWrapper:k,inputChipsWrapper:B,computedInputValue:I,onUpdateInputValue:M,onInputBlur:x,onInputFocus:A,onKeydown:y}}});function Os(e,n,o,l,r,d){const s=t.resolveComponent("cdx-chip-input"),i=t.resolveComponent("cdx-menu");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-multiselect-lookup",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.createVNode(s,t.mergeProps({ref:"chipInput","input-chips":e.inputChipsWrapper,"onUpdate:inputChips":n[0]||(n[0]=a=>e.inputChipsWrapper=a),"input-value":e.computedInputValue,"onUpdate:inputValue":n[1]||(n[1]=a=>e.computedInputValue=a)},e.otherAttrs,{class:"cdx-multiselect-lookup__chip-input",role:"combobox",autocomplete:"off","aria-autocomplete":"list","aria-controls":e.menuId,"aria-expanded":e.expanded,"aria-activedescendant":e.highlightedId,"separate-input":e.separateInput,disabled:e.computedDisabled,status:e.computedStatus,"disallow-arbitrary":!0,"onUpdate:inputValue":e.onUpdateInputValue,onFocus:e.onInputFocus,onBlur:e.onInputBlur,onKeydown:e.onKeydown}),null,16,["input-chips","input-value","aria-controls","aria-expanded","aria-activedescendant","separate-input","disabled","status","onUpdate:inputValue","onFocus","onBlur","onKeydown"]),t.createVNode(i,t.mergeProps({id:e.menuId,ref:"menu",selected:e.selectedWrapper,"onUpdate:selected":n[2]||(n[2]=a=>e.selectedWrapper=a),expanded:e.expanded,"onUpdate:expanded":n[3]||(n[3]=a=>e.expanded=a),"menu-items":e.menuItems},e.menuConfig,{onLoadMore:n[4]||(n[4]=a=>e.$emit("load-more"))}),{default:t.withCtx(({menuItem:a})=>[t.renderSlot(e.$slots,"menu-item",{menuItem:a})]),"no-results":t.withCtx(()=>[t.renderSlot(e.$slots,"no-results")]),_:3},16,["id","selected","expanded","menu-items"])],6)}const _s=_(Fs,[["render",Os]]),Ps=J(pe),zs=t.defineComponent({name:"CdxRadio",components:{CdxLabel:Le},props:{modelValue:{type:[String,Number,Boolean],default:""},inputValue:{type:[String,Number,Boolean],default:!1},name:{type:String,required:!0},disabled:{type:Boolean,default:!1},inline:{type:Boolean,default:!1},status:{type:String,default:"default",validator:Ps}},emits:["update:modelValue"],setup(e,{emit:n,slots:o,attrs:l}){var m;vt((m=o.default)==null?void 0:m.call(o),l,"CdxRadio");const{computedDisabled:r,computedStatus:d}=le(t.toRef(e,"disabled"),t.toRef(e,"status")),s=t.computed(()=>({"cdx-radio--inline":e.inline,["cdx-radio--status-".concat(d.value)]:!0})),i=t.computed(()=>({"cdx-radio__custom-input--inline":e.inline})),a=t.ref(),u=U("radio"),c=U("description"),p=()=>{a.value.focus()},f=ne(t.toRef(e,"modelValue"),n);return{rootClasses:s,computedDisabled:r,input:a,radioId:u,descriptionId:c,focusInput:p,wrappedModel:f,customInputClasses:i}}}),Ks={class:"cdx-radio__wrapper"},Hs=["id","aria-describedby","name","value","disabled"],Us=t.createElementVNode("span",{class:"cdx-radio__icon"},null,-1);function js(e,n,o,l,r,d){const s=t.resolveComponent("cdx-label");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-radio",e.rootClasses])},[t.createElementVNode("div",Ks,[t.withDirectives(t.createElementVNode("input",{id:e.radioId,ref:"input","onUpdate:modelValue":n[0]||(n[0]=i=>e.wrappedModel=i),class:"cdx-radio__input",type:"radio","aria-describedby":e.$slots.description&&e.$slots.description().length>0?e.descriptionId:void 0,name:e.name,value:e.inputValue,disabled:e.computedDisabled},null,8,Hs),[[t.vModelRadio,e.wrappedModel]]),Us,e.$slots.default&&e.$slots.default().length?(t.openBlock(),t.createBlock(s,{key:0,class:"cdx-radio__label","input-id":e.radioId,"description-id":e.$slots.description&&e.$slots.description().length>0?e.descriptionId:void 0,disabled:e.computedDisabled,onClick:e.focusInput},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","onClick"])):t.createCommentVNode("v-if",!0)]),e.$slots["custom-input"]?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["cdx-radio__custom-input",e.customInputClasses])},[t.renderSlot(e.$slots,"custom-input")],2)):t.createCommentVNode("v-if",!0)],2)}const Ws=_(zs,[["render",js]]),qs=J(pe),Qs=t.defineComponent({name:"CdxSearchInput",components:{CdxButton:ve,CdxTextInput:Je},inheritAttrs:!1,props:{modelValue:{type:[String,Number],default:""},useButton:{type:Boolean,default:!1},buttonLabel:{type:String,default:""},disabled:{type:Boolean,default:!1},status:{type:String,default:"default",validator:qs}},emits:["update:modelValue","submit-click","input","change","focus","blur"],setup(e,{emit:n,attrs:o}){const l=ne(t.toRef(e,"modelValue"),n),{computedDisabled:r}=le(t.toRef(e,"disabled")),d=t.computed(()=>({"cdx-search-input--has-end-button":!!e.buttonLabel||e.useButton})),{rootClasses:s,rootStyle:i,otherAttrs:a}=ae(o,d),u=Ye(t.toRef(e,"buttonLabel"),"cdx-search-input-search-button-label","Search"),c=t.computed(()=>e.useButton||e.buttonLabel.length>0);return{wrappedModel:l,computedDisabled:r,rootClasses:s,rootStyle:i,otherAttrs:a,handleSubmit:()=>{n("submit-click",l.value)},searchIcon:oo,translatedSearchButtonLabel:u,useButtonOrLabel:c}},methods:{focus(){this.$refs.textInput.focus()}}}),Gs={class:"cdx-search-input__input-wrapper"};function Ys(e,n,o,l,r,d){const s=t.resolveComponent("cdx-text-input"),i=t.resolveComponent("cdx-button");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-search-input",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.createElementVNode("div",Gs,[t.createVNode(s,t.mergeProps({ref:"textInput",modelValue:e.wrappedModel,"onUpdate:modelValue":n[0]||(n[0]=a=>e.wrappedModel=a),class:"cdx-search-input__text-input","input-type":"search","start-icon":e.searchIcon,disabled:e.computedDisabled,status:e.status},e.otherAttrs,{onKeydown:t.withKeys(e.handleSubmit,["enter"]),onInput:n[1]||(n[1]=a=>e.$emit("input",a)),onChange:n[2]||(n[2]=a=>e.$emit("change",a)),onFocus:n[3]||(n[3]=a=>e.$emit("focus",a)),onBlur:n[4]||(n[4]=a=>e.$emit("blur",a))}),null,16,["modelValue","start-icon","disabled","status","onKeydown"]),t.renderSlot(e.$slots,"default")]),e.useButtonOrLabel?(t.openBlock(),t.createBlock(i,{key:0,class:"cdx-search-input__end-button",disabled:e.computedDisabled,onClick:e.handleSubmit},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.translatedSearchButtonLabel),1)]),_:1},8,["disabled","onClick"])):t.createCommentVNode("v-if",!0)],6)}const Sn=_(Qs,[["render",Ys]]),Xs=J(pe),Js=t.defineComponent({name:"CdxSelect",components:{CdxIcon:q,CdxMenu:ke},inheritAttrs:!1,props:{menuItems:{type:Array,required:!0},selected:{type:[String,Number,null],required:!0},defaultLabel:{type:String,default:""},disabled:{type:Boolean,default:!1},menuConfig:{type:Object,default:()=>({})},defaultIcon:{type:[String,Object],default:void 0},status:{type:String,default:"default",validator:Xs}},emits:["update:selected","load-more"],setup(e,{emit:n,attrs:o}){const l=t.ref(),r=t.ref(),d=t.inject(qe,void 0),s=U("select-menu"),i=t.ref(!1),a=o.id||U("select-handle"),{computedDisabled:u,computedStatus:c,computedInputId:p}=le(t.toRef(e,"disabled"),t.toRef(e,"status"),a),f=ne(t.toRef(e,"selected"),n,"update:selected"),m=t.computed(()=>{var y;return(y=r.value)==null?void 0:y.getComputedMenuItems().find(b=>b.value===e.selected)}),h=t.computed(()=>{var y;return m.value?(y=m.value.label)!=null?y:m.value.value:e.defaultLabel}),g=t.computed(()=>{var y;if(e.defaultIcon&&!m.value)return e.defaultIcon;if((y=m.value)!=null&&y.icon)return m.value.icon}),C=t.computed(()=>({"cdx-select-vue--enabled":!u.value,"cdx-select-vue--disabled":u.value,"cdx-select-vue--expanded":i.value,"cdx-select-vue--value-selected":!!m.value,"cdx-select-vue--no-selections":!m.value,"cdx-select-vue--has-start-icon":!!g.value,["cdx-select-vue--status-".concat(c.value)]:!0})),{rootClasses:k,rootStyle:B,otherAttrs:$}=ae(o,C),I=t.computed(()=>{const S=$.value,{id:y}=S;return de(S,["id"])}),E=t.computed(()=>{var y,b;return(b=(y=r.value)==null?void 0:y.getHighlightedMenuItem())==null?void 0:b.id});function M(){i.value=!1}function A(){var y;u.value||(i.value=!i.value,(y=l.value)==null||y.focus())}function x(y){var b;u.value||(b=r.value)==null||b.delegateKeyNavigation(y,{characterNavigation:!0})}return Ne(l,r),{handle:l,menu:r,computedHandleId:p,descriptionId:d,menuId:s,modelWrapper:f,selectedMenuItem:m,highlightedId:E,expanded:i,computedDisabled:u,onBlur:M,currentLabel:h,rootClasses:k,rootStyle:B,otherAttrsMinusId:I,onClick:A,onKeydown:x,startIcon:g,cdxIconExpand:Ot}}}),Zs=["aria-disabled"],ei=["id","aria-controls","aria-activedescendant","aria-expanded","aria-describedby"];function ti(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon"),i=t.resolveComponent("cdx-menu");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-select-vue",e.rootClasses]),style:t.normalizeStyle(e.rootStyle),"aria-disabled":e.computedDisabled},[t.createElementVNode("div",t.mergeProps({id:e.computedHandleId,ref:"handle",class:"cdx-select-vue__handle"},e.otherAttrsMinusId,{tabindex:"0",role:"combobox","aria-controls":e.menuId,"aria-activedescendant":e.highlightedId,"aria-expanded":e.expanded,"aria-describedby":e.descriptionId,onClick:n[0]||(n[0]=(...a)=>e.onClick&&e.onClick(...a)),onBlur:n[1]||(n[1]=(...a)=>e.onBlur&&e.onBlur(...a)),onKeydown:n[2]||(n[2]=(...a)=>e.onKeydown&&e.onKeydown(...a))}),[t.renderSlot(e.$slots,"label",{selectedMenuItem:e.selectedMenuItem,defaultLabel:e.defaultLabel},()=>[t.createTextVNode(t.toDisplayString(e.currentLabel),1)]),e.startIcon?(t.openBlock(),t.createBlock(s,{key:0,icon:e.startIcon,class:"cdx-select-vue__start-icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createVNode(s,{icon:e.cdxIconExpand,class:"cdx-select-vue__indicator"},null,8,["icon"])],16,ei),t.createVNode(i,t.mergeProps({id:e.menuId,ref:"menu",selected:e.modelWrapper,"onUpdate:selected":n[3]||(n[3]=a=>e.modelWrapper=a),expanded:e.expanded,"onUpdate:expanded":n[4]||(n[4]=a=>e.expanded=a),"menu-items":e.menuItems},e.menuConfig,{onLoadMore:n[5]||(n[5]=a=>e.$emit("load-more"))}),{default:t.withCtx(({menuItem:a})=>[t.renderSlot(e.$slots,"menu-item",{menuItem:a})]),_:3},16,["id","selected","expanded","menu-items"])],14,Zs)}const xn=_(Js,[["render",ti]]),ni=t.defineComponent({name:"CdxTablePager",components:{CdxButton:ve,CdxIcon:q,CdxSelect:xn},props:{paginationSizeOptions:{type:Array,required:!0},itemsPerPage:{type:Number,required:!0},nextDisabled:{type:Boolean,default:!1},prevDisabled:{type:Boolean,default:!1},lastDisabled:{type:Boolean,default:!1}},emits:["update:itemsPerPage","first","last","next","prev"],setup(e,{emit:n}){const o=ne(t.toRef(e,"itemsPerPage"),n,"update:itemsPerPage"),l=W("cdx-table-pager-items-per-page-default","Results per page"),r=W("cdx-table-pager-items-per-page-current",u=>"".concat(u," rows"),[o]),d=W("cdx-table-pager-button-first-page","First page"),s=W("cdx-table-pager-button-next-page","Next page"),i=W("cdx-table-pager-button-prev-page","Previous page"),a=W("cdx-table-pager-button-last-page","Last page");return{defaultItemsPerPageLabel:l,currentItemsPerPageLabel:r,btnLabelFirst:d,btnLabelNext:s,btnLabelPrev:i,btnLabelLast:a,wrappedItemsPerPage:o,cdxIconPrevious:zt,cdxIconNext:Pt,cdxIconMoveFirst:to,cdxIconMoveLast:no}}}),oi={class:"cdx-table-pager"},li={class:"cdx-table-pager__start"},ai={key:0},si={key:1},ii={class:"cdx-table-pager__center"},ri={class:"cdx-table-pager__end"};function di(e,n,o,l,r,d){const s=t.resolveComponent("cdx-select"),i=t.resolveComponent("cdx-icon"),a=t.resolveComponent("cdx-button");return t.openBlock(),t.createElementBlock("div",oi,[t.createElementVNode("div",li,[t.createVNode(s,{selected:e.wrappedItemsPerPage,"onUpdate:selected":n[0]||(n[0]=u=>e.wrappedItemsPerPage=u),"default-label":e.defaultItemsPerPageLabel,"menu-items":e.paginationSizeOptions},{label:t.withCtx(({selectedMenuItem:u,defaultLabel:c})=>[u?(t.openBlock(),t.createElementBlock("span",ai,[t.createElementVNode("span",null,t.toDisplayString(e.currentItemsPerPageLabel),1)])):(t.openBlock(),t.createElementBlock("span",si,t.toDisplayString(c),1))]),_:1},8,["selected","default-label","menu-items"])]),t.createElementVNode("div",ii,[t.renderSlot(e.$slots,"default")]),t.createElementVNode("div",ri,[t.createVNode(a,{disabled:e.prevDisabled,class:"cdx-table-pager__button-first",weight:"quiet","aria-label":e.btnLabelFirst,onClick:n[1]||(n[1]=u=>e.$emit("first"))},{default:t.withCtx(()=>[t.createVNode(i,{icon:e.cdxIconMoveFirst},null,8,["icon"])]),_:1},8,["disabled","aria-label"]),t.createVNode(a,{disabled:e.prevDisabled,class:"cdx-table-pager__button-prev",weight:"quiet","aria-label":e.btnLabelPrev,onClick:n[2]||(n[2]=u=>e.$emit("prev"))},{default:t.withCtx(()=>[t.createVNode(i,{icon:e.cdxIconPrevious},null,8,["icon"])]),_:1},8,["disabled","aria-label"]),t.createVNode(a,{disabled:e.nextDisabled,class:"cdx-table-pager__button-next",weight:"quiet","aria-label":e.btnLabelNext,onClick:n[3]||(n[3]=u=>e.$emit("next"))},{default:t.withCtx(()=>[t.createVNode(i,{icon:e.cdxIconNext},null,8,["icon"])]),_:1},8,["disabled","aria-label"]),t.createVNode(a,{disabled:e.nextDisabled||e.lastDisabled,class:"cdx-table-pager__button-last",weight:"quiet","aria-label":e.btnLabelLast,onClick:n[4]||(n[4]=u=>e.$emit("last"))},{default:t.withCtx(()=>[t.createVNode(i,{icon:e.cdxIconMoveLast},null,8,["icon"])]),_:1},8,["disabled","aria-label"])])])}const ui=_(ni,[["render",di]]),ci=J(ho),pi=J(yo),fi={none:lo,asc:ao,desc:Zn},mi={none:"none",asc:"ascending",desc:"descending"},hi=t.defineComponent({name:"CdxTable",components:{CdxCheckbox:nn,CdxIcon:q,CdxTablePager:ui,CdxProgressBar:gt},props:{caption:{type:String,required:!0},hideCaption:{type:Boolean,default:!1},columns:{type:Array,default:()=>[],validator:e=>{const n=e.map(l=>l.id);return new Set(n).size===n.length?!0:(console.warn('Each column in the "columns" prop of CdxTable must have a unique "id".'),!1)}},data:{type:Array,default:()=>[],validator:(e,n)=>{if(!Array.isArray(n.columns)||n.columns.length===0||e.length===0)return!0;const o=n.columns.some(r=>"allowSort"in r),l=e.every(r=>Ke in r);return o&&n.useRowSelection&&!l?(console.warn('For CdxTables with sorting and row selection, each row in the "data" prop must have a "TableRowIdentifier".'),!1):!0}},useRowHeaders:{type:Boolean,default:!1},showVerticalBorders:{type:Boolean,default:!1},useRowSelection:{type:Boolean,default:!1},selectedRows:{type:Array,default:()=>[]},sort:{type:Object,default:()=>({})},pending:{type:Boolean,default:!1},paginate:{type:Boolean,default:!1},serverPagination:{type:Boolean,default:!1},totalRows:{type:Number,default:NaN},paginationPosition:{type:String,default:"bottom",validator:pi},paginationSizeOptions:{type:Array,default:()=>[{value:10},{value:20},{value:50}],validator:e=>{const n=o=>typeof o.value=="number";return e.every(n)?!0:(console.warn('"value" property of all menu items in PaginationOptions must be a number.'),!1)}},paginationSizeDefault:{type:Number,default:e=>e.paginate&&e.serverPagination?e.data.length:e.paginationSizeOptions[0].value}},emits:["update:selectedRows","update:sort","load-more","last"],setup(e,{emit:n}){const o=t.ref(0),l=t.ref(e.paginationSizeDefault),r=t.computed(()=>e.serverPagination&&e.paginate?e.data:e.paginate?e.data.slice(o.value,l.value+o.value):e.data),d=t.computed(()=>{var N;return e.serverPagination?(N=e.totalRows)!=null?N:NaN:e.data.length}),s=t.computed(()=>isNaN(d.value)),i=t.computed(()=>r.value.length),a=t.computed(()=>o.value+1),u=t.computed(()=>o.value+i.value),c=t.computed(()=>s.value),p=t.computed(()=>o.value<=0),f=t.computed(()=>s.value?i.value=d.value),m=W("cdx-table-pagination-status-message-determinate-short",(N,O,H)=>"".concat(N,"–").concat(O," of ").concat(H),[a,u,d]),h=W("cdx-table-pagination-status-message-determinate-long",(N,O,H)=>"Showing results ".concat(N,"–").concat(O," of ").concat(H),[a,u,d]),g=W("cdx-table-pagination-status-message-indeterminate-short",(N,O)=>"".concat(N,"–").concat(O," of many"),[a,u]),C=W("cdx-table-pagination-status-message-indeterminate-long",(N,O)=>"Showing results ".concat(N,"–").concat(O," of many"),[a,u]),k=W("cdx-table-pagination-status-message-indeterminate-final",N=>"Showing the last ".concat(N," results"),[i]),B=W("cdx-table-pagination-status-message-pending","Loading results..."),$=t.computed(()=>e.pending?B.value:s.value&&f.value?k.value:s.value?g.value:m.value),I=t.computed(()=>e.pending?B.value:s.value&&f.value?k.value:s.value?C.value:h.value);function E(){o.value+=l.value,e.serverPagination&&n("load-more",o.value,l.value)}function M(){o.value-l.value<1?A():(o.value-=l.value,e.serverPagination&&n("load-more",o.value,l.value))}function A(){o.value=0,e.serverPagination&&n("load-more",o.value,l.value)}function x(){d.value%l.value===0?(o.value=d.value-l.value,n("load-more",o.value,l.value)):(o.value=Math.floor(d.value/l.value)*l.value,n("load-more",o.value,l.value))}t.watch(l,N=>{e.serverPagination&&n("load-more",o.value,N)});const y=ne(t.toRef(e,"selectedRows"),n,"update:selectedRows"),b=t.ref(d.value===y.value.length),S=t.ref(!1),V=t.computed(()=>Object.keys(e.sort)[0]),R=t.computed(()=>e.columns.some(N=>N.allowSort)),z=t.computed(()=>{var O;return{"cdx-table__table--layout-fixed":(O=e.columns)==null?void 0:O.some(H=>"width"in H||"minWidth"in H),"cdx-table__table--borders-vertical":e.showVerticalBorders}}),L=W("cdx-table-sort-caption",N=>"".concat(N," (column headers with buttons are sortable)."),[t.toRef(e,"caption")]),F=(N,O)=>W("cdx-table-select-row-label",(H,v)=>"Select row ".concat(H," of ").concat(v),[()=>N,()=>O]).value,G=W("cdx-table-select-all-label","Select all rows");function j(N,O){return Ke in N?N[Ke]:O}function te(N,O){const H=j(N,O);return{"cdx-table__row--selected":y.value.indexOf(H)!==-1}}function Z(N){const O=e.columns[0].id;if(e.useRowHeaders&&N===O)return"row"}function w(N){const O=e.columns[0].id;return e.useRowHeaders&&N===O?"th":"td"}function T(N,O=!1){if("textAlign"in N&&!ci(N.textAlign)){console.warn("Invalid value for TableColumn textAlign property.");return}return{["cdx-table__table__cell--align-".concat(N.textAlign)]:"textAlign"in N&&N.textAlign!=="start","cdx-table__table__cell--has-sort":O}}function K(N){const O={};return"width"in N&&(O.width=N.width),"minWidth"in N&&(O.minWidth=N.minWidth),O}function Y(N){if(d.value===N.length){b.value=!0,S.value=!1;return}b.value=!1,d.value>N.length&&(S.value=!0),N.length===0&&(S.value=!1)}function nt(N){S.value=!1,N?y.value=e.data.map((O,H)=>j(O,H)):y.value=[]}function ot(N){var v;const O=(v=e.sort[N])!=null?v:"none";let H="asc";O==="asc"&&(H="desc"),O==="desc"&&(H="none"),n("update:sort",{[N]:H})}function lt(N){var H;const O=(H=e.sort[N])!=null?H:"none";return fi[O]}function at(N,O=!1){var H;if(O){const v=(H=e.sort[N])!=null?H:"none";return v==="none"?void 0:mi[v]}}return{dataForDisplay:r,pageSize:l,onNext:E,onPrev:M,onFirst:A,onLast:x,nextDisabled:f,prevDisabled:p,lastDisabled:c,paginationStatusMessageShort:$,paginationStatusMessageLong:I,wrappedSelectedRows:y,selectAll:b,selectAllIndeterminate:S,activeSortColumn:V,hasSortableColumns:R,tableClasses:z,getRowKey:j,getRowClass:te,getRowHeaderScope:Z,getCellElement:w,getCellClass:T,getCellStyle:K,handleRowSelection:Y,handleSelectAll:nt,handleSort:ot,getSortIcon:lt,getSortOrder:at,translatedSortCaption:L,translatedSelectRowLabel:F,translatedSelectAllLabel:G}}}),vi={class:"cdx-table",tabindex:"0"},gi={key:0,class:"cdx-table__header"},bi=["aria-hidden"],yi={class:"cdx-table__header__content"},Ci={class:"cdx-table__pagination-status--long"},wi={class:"cdx-table__pagination-status--short"},ki={class:"cdx-table__table-wrapper"},$i={key:0},Bi={key:0,class:"cdx-table__table__select-rows"},Si=["aria-sort"],xi=["aria-selected","onClick"],Ii={class:"cdx-table__table__sort-label"},Vi={key:0},Ei={key:0},Ni={key:1},Ai={class:"cdx-table__table__empty-state"},Di=["colspan"],Mi={class:"cdx-table__pagination-status--long"},Li={class:"cdx-table__pagination-status--short"},Ti={key:3,class:"cdx-table__footer"};function Ri(e,n,o,l,r,d){const s=t.resolveComponent("cdx-table-pager"),i=t.resolveComponent("cdx-checkbox"),a=t.resolveComponent("cdx-icon"),u=t.resolveComponent("cdx-progress-bar");return t.openBlock(),t.createElementBlock("div",vi,[!e.hideCaption||e.$slots.header&&e.$slots.header().length>0?(t.openBlock(),t.createElementBlock("div",gi,[t.createElementVNode("div",{class:"cdx-table__header__caption","aria-hidden":e.$slots.header&&e.$slots.header().length>0?void 0:!0},[e.hideCaption?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(e.caption),1)],64))],8,bi),t.createElementVNode("div",yi,[t.renderSlot(e.$slots,"header")])])):t.createCommentVNode("v-if",!0),e.paginate&&(e.paginationPosition==="top"||e.paginationPosition==="both")?(t.openBlock(),t.createBlock(s,{key:1,"items-per-page":e.pageSize,"onUpdate:itemsPerPage":n[0]||(n[0]=c=>e.pageSize=c),class:"cdx-table__pagination--top","pagination-size-options":e.paginationSizeOptions,"prev-disabled":e.prevDisabled,"next-disabled":e.nextDisabled,"last-disabled":e.lastDisabled,onNext:e.onNext,onPrev:e.onPrev,onFirst:e.onFirst,onLast:e.onLast},{default:t.withCtx(()=>[t.createElementVNode("span",Ci,t.toDisplayString(e.paginationStatusMessageLong),1),t.createElementVNode("span",wi,t.toDisplayString(e.paginationStatusMessageShort),1)]),_:1},8,["items-per-page","pagination-size-options","prev-disabled","next-disabled","last-disabled","onNext","onPrev","onFirst","onLast"])):t.createCommentVNode("v-if",!0),t.createElementVNode("div",ki,[t.createElementVNode("table",{class:t.normalizeClass(["cdx-table__table",e.tableClasses])},[t.createElementVNode("caption",null,[e.hasSortableColumns?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(e.translatedSortCaption),1)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode(t.toDisplayString(e.caption),1)],64))]),t.renderSlot(e.$slots,"thead",{},()=>[e.columns.length>0?(t.openBlock(),t.createElementBlock("thead",$i,[t.createElementVNode("tr",null,[e.useRowSelection?(t.openBlock(),t.createElementBlock("th",Bi,[t.createVNode(i,{modelValue:e.selectAll,"onUpdate:modelValue":[n[1]||(n[1]=c=>e.selectAll=c),e.handleSelectAll],"hide-label":!0,indeterminate:e.selectAllIndeterminate},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.translatedSelectAllLabel),1)]),_:1},8,["modelValue","indeterminate","onUpdate:modelValue"])])):t.createCommentVNode("v-if",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.columns,c=>(t.openBlock(),t.createElementBlock("th",{key:c.id,scope:"col",class:t.normalizeClass(e.getCellClass(c,c.allowSort)),"aria-sort":e.getSortOrder(c.id,c.allowSort),style:t.normalizeStyle(e.getCellStyle(c))},[c.allowSort?(t.openBlock(),t.createElementBlock("button",{key:0,"aria-selected":c.id===e.activeSortColumn,class:"cdx-table__table__sort-button",onClick:p=>e.handleSort(c.id)},[t.createElementVNode("span",Ii,t.toDisplayString(c.label),1),t.createVNode(a,{icon:e.getSortIcon(c.id),size:"small",class:"cdx-table__table__sort-icon--vue","aria-hidden":"true"},null,8,["icon"])],8,xi)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(c.label),1)],64))],14,Si))),128))])])):t.createCommentVNode("v-if",!0)]),e.pending?(t.openBlock(),t.createBlock(u,{key:0,inline:!0,class:"cdx-table__pending-indicator"})):t.createCommentVNode("v-if",!0),t.renderSlot(e.$slots,"tbody",{},()=>[e.dataForDisplay.length>0?(t.openBlock(),t.createElementBlock("tbody",Vi,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.dataForDisplay,(c,p)=>(t.openBlock(),t.createElementBlock("tr",{key:e.getRowKey(c,p),class:t.normalizeClass(e.getRowClass(c,p))},[e.useRowSelection?(t.openBlock(),t.createElementBlock("td",Ei,[t.createVNode(i,{modelValue:e.wrappedSelectedRows,"onUpdate:modelValue":[n[2]||(n[2]=f=>e.wrappedSelectedRows=f),e.handleRowSelection],"input-value":e.getRowKey(c,p),"hide-label":!0},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(e.translatedSelectRowLabel(p+1,e.dataForDisplay.length)),1)]),_:2},1032,["modelValue","input-value","onUpdate:modelValue"])])):t.createCommentVNode("v-if",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.columns,f=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.getCellElement(f.id)),{key:f.id,scope:e.getRowHeaderScope(f.id),class:t.normalizeClass(e.getCellClass(f))},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"item-"+f.id,{item:c[f.id],row:c},()=>[t.createTextVNode(t.toDisplayString(c[f.id]),1)])]),_:2},1032,["scope","class"]))),128))],2))),128))])):e.$slots["empty-state"]&&e.$slots["empty-state"]().length>0?(t.openBlock(),t.createElementBlock("tbody",Ni,[t.createElementVNode("tr",Ai,[t.createElementVNode("td",{colspan:e.columns.length,class:"cdx-table__table__empty-state-content"},[t.renderSlot(e.$slots,"empty-state")],8,Di)])])):t.createCommentVNode("v-if",!0)]),t.renderSlot(e.$slots,"tfoot")],2)]),e.paginate&&(e.paginationPosition==="bottom"||e.paginationPosition==="both")?(t.openBlock(),t.createBlock(s,{key:2,"items-per-page":e.pageSize,"onUpdate:itemsPerPage":n[3]||(n[3]=c=>e.pageSize=c),class:"cdx-table__pagination--bottom","pagination-size-options":e.paginationSizeOptions,"prev-disabled":e.prevDisabled,"next-disabled":e.nextDisabled,"last-disabled":e.lastDisabled,onNext:e.onNext,onPrev:e.onPrev,onFirst:e.onFirst,onLast:e.onLast},{default:t.withCtx(()=>[t.createElementVNode("span",Mi,t.toDisplayString(e.paginationStatusMessageLong),1),t.createElementVNode("span",Li,t.toDisplayString(e.paginationStatusMessageShort),1)]),_:1},8,["items-per-page","pagination-size-options","prev-disabled","next-disabled","last-disabled","onNext","onPrev","onFirst","onLast"])):t.createCommentVNode("v-if",!0),e.$slots.footer&&e.$slots.footer().length>0?(t.openBlock(),t.createElementBlock("div",Ti,[t.renderSlot(e.$slots,"footer")])):t.createCommentVNode("v-if",!0)])}const Fi=_(hi,[["render",Ri]]),Oi=t.defineComponent({name:"CdxTab",props:{name:{type:String,required:!0},label:{type:String,default:""},disabled:{type:Boolean,default:!1}},setup(e){var d;const n=t.inject(jt),o=t.inject(Wt);if(!n||!o)throw new Error("Tab component must be used inside a Tabs component");const l=(d=n.value.get(e.name))!=null?d:{},r=t.computed(()=>e.name===o.value);return{tab:l,isActive:r}}}),_i=["id","aria-hidden","aria-labelledby"];function Pi(e,n,o,l,r,d){return t.withDirectives((t.openBlock(),t.createElementBlock("section",{id:e.tab.id,"aria-hidden":e.isActive?void 0:!0,"aria-labelledby":"".concat(e.tab.id,"-label"),class:"cdx-tab",role:"tabpanel",tabindex:"-1"},[t.renderSlot(e.$slots,"default")],8,_i)),[[t.vShow,e.isActive]])}const In=_(Oi,[["render",Pi]]),zi=t.defineComponent({name:"CdxTabs",components:{CdxButton:ve,CdxIcon:q},props:{active:{type:String,default:null},framed:{type:Boolean,default:!1}},emits:["update:active"],expose:["select","next","prev"],setup(e,{slots:n,emit:o}){const l=t.ref(),r=t.ref(),d=t.ref(),s=t.ref(),i=Me(l),a=t.computed(()=>{const y=Qe(n.default);if(!y.every(b=>typeof b=="object"&&Jt(b,In.name)))throw new Error("Slot content may only contain CdxTab components");if(y.length===0)throw new Error("Slot content cannot be empty");return y}),u=t.computed(()=>a.value.reduce((y,b)=>{var S;if((S=b.props)!=null&&S.name&&typeof b.props.name=="string"){if(y.get(b.props.name))throw new Error("Tab names must be unique");y.set(b.props.name,{name:b.props.name,id:U(b.props.name),label:b.props.label||b.props.name,disabled:b.props.disabled})}return y},new Map)),c=t.ref(Array.from(u.value.keys())[0]),p=Xe(c,t.toRef(e,"active"),o,"update:active"),f=t.computed(()=>Array.from(u.value.keys())),m=t.computed(()=>f.value.indexOf(p.value)),h=t.computed(()=>{var y;return(y=u.value.get(p.value))==null?void 0:y.id});t.provide(Wt,p),t.provide(jt,u);const g=t.ref(new Map),C=t.ref(),k=t.ref(),B=He(C,{threshold:.95}),$=He(k,{threshold:.95});function I(y,b){const S=y;S&&(g.value.set(b,S),b===0?C.value=S:b===f.value.length-1&&(k.value=S))}const E=t.computed(()=>({"cdx-tabs--framed":e.framed,"cdx-tabs--quiet":!e.framed}));function M(){var y;(y=g.value.get(m.value))==null||y.focus()}function A(y){if(!r.value||!d.value||!s.value)return 0;const b=i.value==="rtl"?s.value:d.value,S=i.value==="rtl"?d.value:s.value,V=y.offsetLeft,R=V+y.clientWidth,z=r.value.scrollLeft+b.clientWidth,L=r.value.scrollLeft+r.value.clientWidth-S.clientWidth;return VL?R-L:0}function x(y){if(!r.value||!d.value||!s.value)return;const b=y==="next"&&i.value==="ltr"||y==="prev"&&i.value==="rtl"?1:-1;let S=0,V=y==="next"?r.value.firstElementChild:r.value.lastElementChild;for(;V;){const R=y==="next"?V.nextElementSibling:V.previousElementSibling;if(S=A(V),Math.sign(S)===b){R&&Math.abs(S)<.25*r.value.clientWidth&&(S=A(R));break}V=R}r.value.scrollBy({left:S,behavior:"smooth"}),M()}return t.watch(p,()=>{if(h.value===void 0||!r.value||!d.value||!s.value)return;const y=document.getElementById("".concat(h.value,"-label"));y&&r.value.scrollBy({left:A(y),behavior:"smooth"})}),{activeTab:p,activeTabIndex:m,activeTabId:h,currentDirection:i,rootElement:l,tabListElement:r,prevScroller:d,nextScroller:s,rootClasses:E,tabNames:f,tabsData:u,firstLabelVisible:B,lastLabelVisible:$,assignTemplateRefForTabButton:I,scrollTabs:x,focusActiveTab:M,cdxIconPrevious:zt,cdxIconNext:Pt}},methods:{select(e,n){const o=this.tabsData.get(e);o&&!(o!=null&&o.disabled)&&(this.activeTab=e,n&&t.nextTick(()=>{this.focusActiveTab()}))},selectNonDisabled(e,n,o){const l=this.tabsData.get(this.tabNames[e+n]);l&&(l.disabled?this.selectNonDisabled(e+n,n,o):this.select(l.name,o))},next(e){this.selectNonDisabled(this.activeTabIndex,1,e)},prev(e){this.selectNonDisabled(this.activeTabIndex,-1,e)},onLeftArrowKeypress(){this.currentDirection==="rtl"?this.next(!0):this.prev(!0)},onRightArrowKeypress(){this.currentDirection==="rtl"?this.prev(!0):this.next(!0)},onDownArrowKeypress(){var e;this.activeTabId&&((e=document.getElementById(this.activeTabId))==null||e.focus())}}}),Ki={class:"cdx-tabs__header"},Hi={ref:"prevScroller",class:"cdx-tabs__prev-scroller"},Ui={ref:"tabListElement",class:"cdx-tabs__list",role:"tablist"},ji=["id","disabled","aria-controls","aria-selected","tabindex","onClick","onKeyup"],Wi={ref:"nextScroller",class:"cdx-tabs__next-scroller"},qi={class:"cdx-tabs__content"};function Qi(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon"),i=t.resolveComponent("cdx-button");return t.openBlock(),t.createElementBlock("div",{ref:"rootElement",class:t.normalizeClass(["cdx-tabs",e.rootClasses])},[t.createElementVNode("div",Ki,[t.withDirectives(t.createElementVNode("div",Hi,[t.createVNode(i,{class:"cdx-tabs__scroll-button",weight:"quiet",type:"button",tabindex:"-1","aria-hidden":!0,onMousedown:n[0]||(n[0]=t.withModifiers(()=>{},["prevent"])),onClick:n[1]||(n[1]=a=>e.scrollTabs("prev"))},{default:t.withCtx(()=>[t.createVNode(s,{icon:e.cdxIconPrevious},null,8,["icon"])]),_:1})],512),[[t.vShow,!e.firstLabelVisible]]),t.createElementVNode("div",Ui,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.tabsData.values(),(a,u)=>(t.openBlock(),t.createElementBlock("button",{id:"".concat(a.id,"-label"),key:u,ref_for:!0,ref:c=>e.assignTemplateRefForTabButton(c,u),disabled:a.disabled?!0:void 0,"aria-controls":a.id,"aria-selected":a.name===e.activeTab,tabindex:a.name===e.activeTab?void 0:-1,class:"cdx-tabs__list__item",role:"tab",onClick:t.withModifiers(c=>e.select(a.name),["prevent"]),onKeyup:t.withKeys(c=>e.select(a.name),["enter"]),onKeydown:[n[2]||(n[2]=t.withKeys(t.withModifiers((...c)=>e.onRightArrowKeypress&&e.onRightArrowKeypress(...c),["prevent"]),["right"])),n[3]||(n[3]=t.withKeys(t.withModifiers((...c)=>e.onDownArrowKeypress&&e.onDownArrowKeypress(...c),["prevent"]),["down"])),n[4]||(n[4]=t.withKeys(t.withModifiers((...c)=>e.onLeftArrowKeypress&&e.onLeftArrowKeypress(...c),["prevent"]),["left"]))]},[t.createElementVNode("span",null,t.toDisplayString(a.label),1)],40,ji))),128))],512),t.withDirectives(t.createElementVNode("div",Wi,[t.createVNode(i,{class:"cdx-tabs__scroll-button",weight:"quiet",type:"button",tabindex:"-1","aria-hidden":!0,onMousedown:n[5]||(n[5]=t.withModifiers(()=>{},["prevent"])),onClick:n[6]||(n[6]=a=>e.scrollTabs("next"))},{default:t.withCtx(()=>[t.createVNode(s,{icon:e.cdxIconNext},null,8,["icon"])]),_:1})],512),[[t.vShow,!e.lastLabelVisible]])]),t.createElementVNode("div",qi,[t.renderSlot(e.$slots,"default")])],2)}const Gi=_(zi,[["render",Qi]]),Yi=J(pe),Xi=t.defineComponent({name:"CdxTextArea",components:{CdxIcon:q},inheritAttrs:!1,expose:["focus","blur","checkValidity","reportValidity","setCustomValidity"],props:{modelValue:{type:String,default:""},status:{type:String,default:"default",validator:Yi},disabled:{type:Boolean,default:!1},autosize:{type:Boolean,default:!1},startIcon:{type:[String,Object],default:void 0},endIcon:{type:[String,Object],default:void 0}},emits:["update:modelValue","input","change","focus","blur","invalid"],setup(e,{attrs:n,emit:o}){const l=t.ref(),r=ne(t.toRef(e,"modelValue"),o),d=n.id,{computedDisabled:s,computedStatus:i,computedInputId:a}=le(t.toRef(e,"disabled"),t.toRef(e,"status"),d),u=t.inject(qe,void 0),c=t.computed(()=>({"cdx-text-area__textarea--has-value":!!r.value,"cdx-text-area__textarea--is-autosize":e.autosize})),p=t.computed(()=>({"cdx-text-area--status-default":i.value==="default","cdx-text-area--status-error":i.value==="error","cdx-text-area--has-start-icon":!!e.startIcon,"cdx-text-area--has-end-icon":!!e.endIcon})),{rootClasses:f,rootStyle:m,otherAttrs:h}=ae(n,p),g=t.computed(()=>{const x=h.value,{id:M}=x;return de(x,["id"])});function C(M){l.value&&e.autosize&&(l.value.style.height="auto",l.value.style.height="".concat(l.value.scrollHeight,"px")),o("input",M)}const k=M=>{o("change",M)},B=M=>{o("focus",M)},$=M=>{o("blur",M)},I=t.ref(!0);return{textarea:l,rootClasses:f,rootStyle:m,wrappedModel:r,computedDisabled:s,computedInputId:a,descriptionId:u,textareaClasses:c,otherAttrsMinusId:g,onInput:C,onChange:k,onFocus:B,onBlur:$,onInvalid:(M,A)=>{A&&M.preventDefault(),o("invalid",M),I.value=!0},shouldPreventDefault:I}},methods:{focus(){this.$refs.textarea.focus()},blur(){this.$refs.textarea.blur()},checkValidity(){return this.$refs.textarea.checkValidity()},reportValidity(){return this.shouldPreventDefault=!1,this.$refs.textarea.reportValidity()},setCustomValidity(e){this.$refs.textarea.setCustomValidity(e)}}}),Ji=["id","aria-describedby","disabled"];function Zi(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-text-area",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.withDirectives(t.createElementVNode("textarea",t.mergeProps({id:e.computedInputId,ref:"textarea"},e.otherAttrsMinusId,{"onUpdate:modelValue":n[0]||(n[0]=i=>e.wrappedModel=i),class:[e.textareaClasses,"cdx-text-area__textarea"],"aria-describedby":e.descriptionId,disabled:e.computedDisabled,onInput:n[1]||(n[1]=(...i)=>e.onInput&&e.onInput(...i)),onChange:n[2]||(n[2]=(...i)=>e.onChange&&e.onChange(...i)),onFocus:n[3]||(n[3]=(...i)=>e.onFocus&&e.onFocus(...i)),onBlur:n[4]||(n[4]=(...i)=>e.onBlur&&e.onBlur(...i)),onInvalid:n[5]||(n[5]=i=>e.onInvalid(i,e.shouldPreventDefault))}),null,16,Ji),[[t.vModelText,e.wrappedModel]]),e.startIcon?(t.openBlock(),t.createBlock(s,{key:0,icon:e.startIcon,class:"cdx-text-area__icon-vue cdx-text-area__start-icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0),e.endIcon?(t.openBlock(),t.createBlock(s,{key:1,icon:e.endIcon,class:"cdx-text-area__icon-vue cdx-text-area__end-icon"},null,8,["icon"])):t.createCommentVNode("v-if",!0)],6)}const er=_(Xi,[["render",Zi]]),tr=t.defineComponent({name:"CdxToggleButtonGroup",components:{CdxIcon:q,CdxToggleButton:$t},props:{buttons:{type:Array,required:!0,validator:e=>Array.isArray(e)&&e.length>=1},modelValue:{type:[String,Number,null,Array],required:!0},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:n}){const{rootElement:o,assignTemplateRef:l,onFocus:r,onBlur:d,onKeydown:s}=tn(t.toRef(e,"buttons"));function i(u){return Array.isArray(e.modelValue)?e.modelValue.indexOf(u.value)!==-1:e.modelValue!==null?e.modelValue===u.value:!1}function a(u,c){if(Array.isArray(e.modelValue)){const p=e.modelValue.indexOf(u.value)!==-1;c&&!p?n("update:modelValue",e.modelValue.concat(u.value)):!c&&p&&n("update:modelValue",e.modelValue.filter(f=>f!==u.value))}else c&&e.modelValue!==u.value&&n("update:modelValue",u.value)}return{rootElement:o,assignTemplateRef:l,onFocus:r,onBlur:d,onKeydown:s,getButtonLabel:en,isSelected:i,onUpdate:a}}}),nr={ref:"rootElement",class:"cdx-toggle-button-group"};function or(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon"),i=t.resolveComponent("cdx-toggle-button");return t.openBlock(),t.createElementBlock("div",nr,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.buttons,(a,u)=>(t.openBlock(),t.createBlock(i,{key:a.value,ref_for:!0,ref:c=>e.assignTemplateRef(c,u),"model-value":e.isSelected(a),disabled:a.disabled||e.disabled,"aria-label":a.ariaLabel,"onUpdate:modelValue":c=>e.onUpdate(a,c),onFocus:c=>e.onFocus(u),onBlur:e.onBlur,onKeydown:e.onKeydown},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default",{button:a,selected:e.isSelected(a)},()=>[a.icon?(t.openBlock(),t.createBlock(s,{key:0,icon:a.icon},null,8,["icon"])):t.createCommentVNode("v-if",!0),t.createTextVNode(" "+t.toDisplayString(e.getButtonLabel(a)),1)])]),_:2},1032,["model-value","disabled","aria-label","onUpdate:modelValue","onFocus","onBlur","onKeydown"]))),128))],512)}const lr=_(tr,[["render",or]]),ar=t.defineComponent({name:"CdxToggleSwitch",components:{CdxLabel:Le},inheritAttrs:!1,props:{modelValue:{type:[Boolean,Array],default:!1},inputValue:{type:[String,Number,Boolean],default:!1},alignSwitch:{type:Boolean,default:!1},hideLabel:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:n,slots:o,attrs:l}){var h;vt((h=o.default)==null?void 0:h.call(o),l,"CdxToggleSwitch");const r=t.ref(),d=U("toggle-switch"),s=U("description"),i=t.computed(()=>({"cdx-toggle-switch--align-switch":e.alignSwitch})),{rootClasses:a,rootStyle:u,otherAttrs:c}=ae(l,i),{computedDisabled:p}=le(t.toRef(e,"disabled")),f=ne(t.toRef(e,"modelValue"),n);return{input:r,inputId:d,descriptionId:s,rootClasses:a,rootStyle:u,otherAttrs:c,computedDisabled:p,wrappedModel:f,clickInput:()=>{r.value.click()}}}}),sr=["id","aria-describedby","value","disabled"],ir=t.createElementVNode("span",{class:"cdx-toggle-switch__switch"},[t.createElementVNode("span",{class:"cdx-toggle-switch__switch__grip"})],-1);function rr(e,n,o,l,r,d){const s=t.resolveComponent("cdx-label");return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(["cdx-toggle-switch",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.withDirectives(t.createElementVNode("input",t.mergeProps({id:e.inputId,ref:"input","onUpdate:modelValue":n[0]||(n[0]=i=>e.wrappedModel=i),class:"cdx-toggle-switch__input",type:"checkbox",role:"switch","aria-describedby":e.$slots.description&&e.$slots.description().length>0?e.descriptionId:void 0,value:e.inputValue,disabled:e.computedDisabled},e.otherAttrs,{onKeydown:n[1]||(n[1]=t.withKeys(t.withModifiers((...i)=>e.clickInput&&e.clickInput(...i),["prevent"]),["enter"]))}),null,16,sr),[[t.vModelCheckbox,e.wrappedModel]]),ir,e.$slots.default&&e.$slots.default().length?(t.openBlock(),t.createBlock(s,{key:0,class:"cdx-toggle-switch__label","input-id":e.inputId,"description-id":e.$slots.description&&e.$slots.description().length>0?e.descriptionId:void 0,"visually-hidden":e.hideLabel,disabled:e.computedDisabled},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","visually-hidden","disabled"])):t.createCommentVNode("v-if",!0)],6)}const dr=_(ar,[["render",rr]]);class ur{constructor(n,o){fe(this,"referenceElement");fe(this,"tooltipElement");fe(this,"textContent");fe(this,"placement");fe(this,"autoUpdateCleanup");fe(this,"referenceElementHandlers");fe(this,"tooltipElementHandlers");fe(this,"escapeHandler");fe(this,"timeoutId");var d,s;const l=n.ownerDocument,r=U("tooltip");this.referenceElement=n,this.textContent=o.textContent,this.placement=(d=o.placement)!=null?d:"bottom",this.timeoutId=null,this.tooltipElement=l.createElement("div"),this.tooltipElement.classList.add("cdx-tooltip"),this.tooltipElement.role="tooltip",this.tooltipElement.id=r,this.referenceElement.setAttribute("aria-describedby",r),this.tooltipElement.textContent=this.textContent,(s=this.referenceElement.parentElement)==null||s.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=bn(this.referenceElement,this.tooltipElement,()=>this.update())}isVisible(){return this.tooltipElement.style.display==="block"}show(){this.timeoutId&&clearTimeout(this.timeoutId),this.tooltipElement.style.display="block",this.tooltipElement.ownerDocument.addEventListener("keyup",this.escapeHandler)}hide(){this.tooltipElement.style.display="none",this.tooltipElement.ownerDocument.removeEventListener("keyup",this.escapeHandler)}hideAfterDelay(){this.timeoutId=setTimeout(this.hide.bind(this),250)}onKeyup(n){n.key==="Escape"&&this.isVisible()&&this.hide()}addEventListeners(){Object.keys(this.referenceElementHandlers).forEach(n=>{this.referenceElement.addEventListener(n,this.referenceElementHandlers[n])}),Object.keys(this.tooltipElementHandlers).forEach(n=>{this.tooltipElement.addEventListener(n,this.tooltipElementHandlers[n])})}removeEventListeners(){Object.keys(this.referenceElementHandlers).forEach(n=>{this.referenceElement.removeEventListener(n,this.referenceElementHandlers[n])}),Object.keys(this.tooltipElementHandlers).forEach(n=>{this.tooltipElement.removeEventListener(n,this.tooltipElementHandlers[n])})}update(){wn(this.referenceElement,this.tooltipElement,{placement:this.placement,middleware:[yn(4),Cn(),za(),pt()]}).then(({x:n,y:o,middlewareData:l})=>{var s,i,a;const r=(i=(s=l.offset)==null?void 0:s.placement)!=null?i:this.placement,d={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"};Object.assign(this.tooltipElement.style,{left:"".concat(n,"px"),top:"".concat(o,"px"),visibility:(a=l.hide)!=null&&a.referenceHidden?"hidden":"visible",transformOrigin:d[r]})})}remove(){this.tooltipElement.remove(),this.autoUpdateCleanup(),this.removeEventListeners()}}const cr={mounted(e,{value:n,arg:o}){e.tooltip=new ur(e,{textContent:String(n),placement:o})},beforeUnmount(e){e.tooltip&&e.tooltip.remove()}},pr=t.defineComponent({name:"CdxTypeaheadSearch",components:{CdxIcon:q,CdxMenu:ke,CdxSearchInput:Sn},inheritAttrs:!1,props:{id:{type:String,required:!0},formAction:{type:String,required:!0},searchResults:{type:Array,required:!0},useButton:{type:Boolean,default:!1},buttonLabel:{type:String,default:""},initialInputValue:{type:String,default:""},searchFooterUrl:{type:String,default:""},debounceInterval:{type:Number,default:vo},highlightQuery:{type:Boolean,default:!1},showThumbnail:{type:Boolean,default:!1},autoExpandWidth:{type:Boolean,default:!1},visibleItemLimit:{type:Number,default:null}},emits:["input","search-result-click","submit","load-more"],setup(e,{attrs:n,emit:o,slots:l}){const r=t.ref(),d=t.ref(),s=U("typeahead-search-menu"),i=W("cdx-typeahead-search-search-results-label","Search results"),a=t.ref(!1),u=t.ref(!1),c=t.ref(!1),p=t.ref(!1),f=t.ref(e.initialInputValue),m=t.ref(""),h=t.computed(()=>{var w,T;return(T=(w=d.value)==null?void 0:w.getHighlightedMenuItem())==null?void 0:T.id}),g=t.ref(null),C=t.computed(()=>({"cdx-typeahead-search__menu-message--has-thumbnail":e.showThumbnail})),k=t.computed(()=>e.searchResults.find(w=>w.value===g.value)),B=t.computed(()=>e.searchFooterUrl?{value:Se,url:e.searchFooterUrl}:void 0),$=t.computed(()=>({"cdx-typeahead-search--show-thumbnail":e.showThumbnail,"cdx-typeahead-search--expanded":a.value,"cdx-typeahead-search--auto-expand-width":e.showThumbnail&&e.autoExpandWidth})),{rootClasses:I,rootStyle:E,otherAttrs:M}=ae(n,$);function A(w){return w}const x=t.computed(()=>({visibleItemLimit:e.visibleItemLimit,showThumbnail:e.showThumbnail,boldLabel:!0,hideDescriptionOverflow:!0}));let y,b;function S(w,T=!1){k.value&&k.value.label!==w&&k.value.value!==w&&(g.value=null),b!==void 0&&(clearTimeout(b),b=void 0),w===""?a.value=!1:(u.value=!0,l["search-results-pending"]&&(b=setTimeout(()=>{p.value&&(a.value=!0),c.value=!0},go))),y!==void 0&&(clearTimeout(y),y=void 0);const K=()=>{o("input",w)};T?K():y=setTimeout(()=>{K()},e.debounceInterval)}function V(w){var T;if(w===Se){g.value=null,f.value=m.value;return}g.value=w,w!==null&&(f.value=k.value?(T=k.value.label)!=null?T:String(k.value.value):"")}function R(){p.value=!0,(m.value||c.value)&&(a.value=!0)}function z(){p.value=!1,a.value=!1}function L(w){const Y=w,{id:T}=Y,K=de(Y,["id"]);if(K.value===Se){o("search-result-click",{searchResult:null,index:e.searchResults.length,numberOfResults:e.searchResults.length});return}F(K)}function F(w){const T={searchResult:w,index:e.searchResults.findIndex(K=>K.value===w.value),numberOfResults:e.searchResults.length};o("search-result-click",T)}function G(w){var T;if(w.value===Se){f.value=m.value;return}f.value=w.value?(T=w.label)!=null?T:String(w.value):""}function j(w){var T;a.value=!1,(T=d.value)==null||T.clearActive(),L(w)}function te(w){if(k.value)F(k.value),w.stopPropagation(),window.location.assign(k.value.url),w.preventDefault();else{const T={searchResult:null,index:-1,numberOfResults:e.searchResults.length};o("submit",T)}}function Z(w){if(!d.value||!m.value||w.key===" ")return;const T=d.value.getHighlightedMenuItem(),K=d.value.getHighlightedViaKeyboard();switch(w.key){case"Enter":T&&(T.value===Se&&K?window.location.assign(e.searchFooterUrl):d.value.delegateKeyNavigation(w,{prevent:!1})),a.value=!1;break;case"Tab":a.value=!1;break;default:d.value.delegateKeyNavigation(w);break}}return t.onMounted(()=>{e.initialInputValue&&S(e.initialInputValue,!0)}),t.watch(t.toRef(e,"searchResults"),()=>{m.value=f.value.trim(),p.value&&u.value&&m.value.length>0&&(a.value=!0),b!==void 0&&(clearTimeout(b),b=void 0),u.value=!1,c.value=!1}),{form:r,menu:d,menuId:s,highlightedId:h,selection:g,menuMessageClass:C,footer:B,asSearchResult:A,inputValue:f,searchQuery:m,expanded:a,showPending:c,rootClasses:I,rootStyle:E,otherAttrs:M,menuConfig:x,onUpdateInputValue:S,onUpdateMenuSelection:V,onFocus:R,onBlur:z,onSearchResultClick:L,onSearchResultKeyboardNavigation:G,onSearchFooterClick:j,onSubmit:te,onKeydown:Z,MenuFooterValue:Se,articleIcon:Yn,translatedSearchResultsLabel:i}},methods:{focus(){this.$refs.searchInput.focus()}}}),fr=["id","action"],mr={class:"cdx-typeahead-search__menu-message__text"},hr={class:"cdx-typeahead-search__menu-message__text"},vr=["href","onClickCapture"],gr={class:"cdx-menu-item__text cdx-typeahead-search__search-footer__text"},br={class:"cdx-typeahead-search__search-footer__query"};function yr(e,n,o,l,r,d){const s=t.resolveComponent("cdx-icon"),i=t.resolveComponent("cdx-menu"),a=t.resolveComponent("cdx-search-input");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["cdx-typeahead-search",e.rootClasses]),style:t.normalizeStyle(e.rootStyle)},[t.createElementVNode("form",{id:e.id,ref:"form",class:"cdx-typeahead-search__form",action:e.formAction,onSubmit:n[4]||(n[4]=(...u)=>e.onSubmit&&e.onSubmit(...u))},[t.createVNode(a,t.mergeProps({ref:"searchInput",modelValue:e.inputValue,"onUpdate:modelValue":n[3]||(n[3]=u=>e.inputValue=u),"button-label":e.buttonLabel,"use-button":e.useButton},e.otherAttrs,{class:"cdx-typeahead-search__input",name:"search",role:"combobox",autocomplete:"off","aria-autocomplete":"list","aria-controls":e.menuId,"aria-expanded":e.expanded,"aria-activedescendant":e.highlightedId,"onUpdate:modelValue":e.onUpdateInputValue,onFocus:e.onFocus,onBlur:e.onBlur,onKeydown:e.onKeydown}),{default:t.withCtx(()=>[t.createVNode(i,t.mergeProps({id:e.menuId,ref:"menu",expanded:e.expanded,"onUpdate:expanded":n[0]||(n[0]=u=>e.expanded=u),class:"cdx-typeahead-search__menu","show-pending":e.showPending,selected:e.selection,"menu-items":e.searchResults,footer:e.footer,"search-query":e.highlightQuery?e.searchQuery:"","show-no-results-slot":e.searchQuery.length>0&&e.searchResults.length===0&&e.$slots["search-no-results-text"]&&e.$slots["search-no-results-text"]().length>0},e.menuConfig,{"aria-label":e.translatedSearchResultsLabel,"onUpdate:selected":e.onUpdateMenuSelection,onMenuItemClick:n[1]||(n[1]=u=>e.onSearchResultClick(e.asSearchResult(u))),onMenuItemKeyboardNavigation:e.onSearchResultKeyboardNavigation,onLoadMore:n[2]||(n[2]=u=>e.$emit("load-more"))}),{pending:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["cdx-menu-item__content cdx-typeahead-search__menu-message",e.menuMessageClass])},[t.createElementVNode("span",mr,[t.renderSlot(e.$slots,"search-results-pending")])],2)]),"no-results":t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["cdx-menu-item__content cdx-typeahead-search__menu-message",e.menuMessageClass])},[t.createElementVNode("span",hr,[t.renderSlot(e.$slots,"search-no-results-text")])],2)]),default:t.withCtx(({menuItem:u,active:c})=>[u.value===e.MenuFooterValue?(t.openBlock(),t.createElementBlock("a",{key:0,class:t.normalizeClass(["cdx-menu-item__content cdx-typeahead-search__search-footer",{"cdx-typeahead-search__search-footer__active":c}]),href:e.asSearchResult(u).url,onClickCapture:t.withModifiers(p=>e.onSearchFooterClick(e.asSearchResult(u)),["stop"])},[t.createVNode(s,{class:"cdx-menu-item__thumbnail cdx-typeahead-search__search-footer__icon",icon:e.articleIcon},null,8,["icon"]),t.createElementVNode("span",gr,[t.renderSlot(e.$slots,"search-footer-text",{searchQuery:e.searchQuery},()=>[t.createElementVNode("strong",br,t.toDisplayString(e.searchQuery),1)])])],42,vr)):t.createCommentVNode("v-if",!0)]),_:3},16,["id","expanded","show-pending","selected","menu-items","footer","search-query","show-no-results-slot","aria-label","onUpdate:selected","onMenuItemKeyboardNavigation"])]),_:3},16,["modelValue","button-label","use-button","aria-controls","aria-expanded","aria-activedescendant","onUpdate:modelValue","onFocus","onBlur","onKeydown"]),t.renderSlot(e.$slots,"default")],40,fr)],6)}const Cr=_(pr,[["render",yr]]);exports.CdxAccordion=Fo;exports.CdxButton=ve;exports.CdxButtonGroup=zo;exports.CdxCard=Jo;exports.CdxCheckbox=nn;exports.CdxChipInput=on;exports.CdxCombobox=Xa;exports.CdxDialog=is;exports.CdxField=ys;exports.CdxIcon=q;exports.CdxInfoChip=Bs;exports.CdxLabel=Le;exports.CdxLookup=Vs;exports.CdxMenu=ke;exports.CdxMenuButton=Ts;exports.CdxMenuItem=rn;exports.CdxMessage=Bn;exports.CdxMultiselectLookup=_s;exports.CdxProgressBar=gt;exports.CdxRadio=Ws;exports.CdxSearchInput=Sn;exports.CdxSearchResultTitle=sn;exports.CdxSelect=xn;exports.CdxTab=In;exports.CdxTable=Fi;exports.CdxTabs=Gi;exports.CdxTextArea=er;exports.CdxTextInput=Je;exports.CdxThumbnail=mt;exports.CdxToggleButton=$t;exports.CdxToggleButtonGroup=lr;exports.CdxToggleSwitch=dr;exports.CdxTooltip=cr;exports.CdxTypeaheadSearch=Cr;exports.TableRowIdentifier=Ke;exports.stringHelpers=El;exports.useComputedDirection=Me;exports.useComputedDisabled=ht;exports.useComputedLanguage=Ht;exports.useFieldData=le;exports.useFloatingMenu=Ne;exports.useGeneratedId=U;exports.useI18n=W;exports.useIntersectionObserver=He;exports.useModelWrapper=ne;exports.useResizeObserver=$n;exports.useSlotContents=Qe;exports.useSplitAttributes=ae;exports.useWarnOnce=Ge;