@speckle/ui-components 2.15.0 → 2.15.2-alpha1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/InfiniteLoading.vue.d.ts +14 -16
- package/dist/components/SourceAppBadge.vue.d.ts +5 -6
- package/dist/components/common/Alert.vue.d.ts +23 -20
- package/dist/components/common/Badge.vue.d.ts +28 -34
- package/dist/components/common/loading/Bar.vue.d.ts +5 -6
- package/dist/components/common/steps/Bullet.vue.d.ts +23 -36
- package/dist/components/common/steps/Number.vue.d.ts +21 -32
- package/dist/components/common/text/Link.vue.d.ts +21 -11
- package/dist/components/form/Button.vue.d.ts +13 -4
- package/dist/components/form/CardButton.vue.d.ts +20 -15
- package/dist/components/form/Checkbox.vue.d.ts +10 -8
- package/dist/components/form/TextArea.vue.d.ts +96 -107
- package/dist/components/form/TextInput.vue.d.ts +41 -15
- package/dist/components/form/select/Base.vue.d.ts +48 -15
- package/dist/components/form/select/SourceApps.vue.d.ts +9 -7
- package/dist/components/global/ToastRenderer.vue.d.ts +9 -8
- package/dist/components/layout/Dialog.vue.d.ts +24 -21
- package/dist/components/layout/Disclosure.vue.d.ts +20 -18
- package/dist/components/layout/GridListToggle.vue.d.ts +11 -11
- package/dist/components/layout/Menu.vue.d.ts +32 -13
- package/dist/components/layout/Panel.vue.d.ts +15 -4
- package/dist/components/layout/Tabs.vue.d.ts +14 -6
- package/dist/composables/common/async.d.ts +28 -0
- package/dist/helpers/common/components.d.ts +2 -0
- package/dist/helpers/layout/components.d.ts +1 -0
- package/dist/helpers/testing.d.ts +1 -0
- package/dist/lib-utils.d.ts +9 -0
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.ts +3 -2
- package/dist/lib.js +1024 -992
- package/dist/main.d.ts +0 -0
- package/dist/stories/composables/toast.d.ts +23 -0
- package/dist/stories/helpers/storybook.d.ts +10 -0
- package/package.json +18 -18
- package/vite.config.ts +7 -2
package/dist/lib.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),C=require("lodash"),z=require("@heroicons/vue/24/solid"),D=require("@heroicons/vue/24/outline"),I=require("@heroicons/vue/20/solid"),H=require("vee-validate"),G=require("nanoid"),M=require("@speckle/shared"),A=require("@vueuse/core"),E=require("@headlessui/vue"),he=require("vue-tippy"),ge=require("v3-infinite-loading");const ye={key:2,style:{margin:"0 !important",width:"0.01px"}},ke=e.defineComponent({__name:"Button",props:{to:{type:String,required:!1,default:void 0},size:{type:String,default:"base"},fullWidth:{type:Boolean,default:!1},outlined:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},text:{type:Boolean,default:!1},link:{type:Boolean,default:!1},color:{type:String,default:"default"},external:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},submit:{type:Boolean,default:!1},iconLeft:{type:[Object,Function],default:null},iconRight:{type:[Object,Function],default:null},hideText:{type:Boolean,default:!1},linkComponent:{type:[Object,Function],default:null},loading:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:o}){const n=t,l=e.resolveDynamicComponent("NuxtLink"),r=e.resolveDynamicComponent("RouterLink"),i=e.computed(()=>n.linkComponent?n.linkComponent:n.external?"a":C.isObjectLike(l)?l:C.isObjectLike(r)?r:"a"),c=e.computed(()=>{if(!n.to)return n.submit?"submit":"button"}),a=e.computed(()=>n.disabled||n.loading),s=e.computed(()=>n.loading?z.ArrowPathIcon:n.iconLeft),u=e.computed(()=>{const f=[];if(f.push("border-2"),a.value)f.push(n.outlined?"border-foreground-disabled":"bg-foundation-disabled border-transparent");else switch(n.color){case"invert":f.push(n.outlined?"border-foundation dark:border-foreground":"bg-foundation dark:bg-foreground border-transparent");break;case"card":f.push(n.outlined?"border-foundation-2 shadow":"bg-foundation-2 dark:bg-foundation-2 border-foundation shadow");break;case"danger":f.push(n.outlined?"border-danger":"bg-danger border-danger");break;case"secondary":f.push(n.outlined?"border-foundation":"bg-foundation border-foundation-2");break;case"warning":f.push(n.outlined?"border-warning":"bg-warning border-warning");break;case"info":f.push(n.outlined?"border-info":"bg-info border-info");break;case"success":f.push(n.outlined?"border-success":"bg-success border-success");break;case"default":default:f.push(n.outlined?"border-primary hover:border-primary-focus":"bg-primary hover:bg-primary-focus border-transparent");break}return f.join(" ")}),g=e.computed(()=>{const f=[];if(!n.text&&!n.link)if(a.value)f.push((n.outlined,"text-foreground-disabled"));else switch(n.color){case"invert":f.push(n.outlined?"text-foundation dark:text-foreground":"text-primary");break;case"card":f.push((n.outlined,"text-foreground"));break;case"danger":f.push(n.outlined?"text-danger":"text-foundation dark:text-foreground");break;case"warning":f.push(n.outlined?"text-warning":"text-foundation dark:text-foreground");break;case"info":f.push(n.outlined?"text-info":"text-foundation dark:text-foreground");break;case"success":f.push(n.outlined?"text-success":"text-foundation dark:text-foreground");break;case"secondary":f.push((n.outlined,"text-foreground hover:text-primary"));break;case"default":default:f.push(n.outlined?"text-primary hover:text-primary-focus":"text-foundation dark:text-foreground");break}else a.value?f.push("text-foreground-disabled"):n.color==="invert"?f.push("text-foundation hover:text-foundation-2 dark:text-foreground dark:hover:text-foreground"):n.color==="secondary"?f.push("text-foreground-2 hover:text-primary-focus"):n.color==="success"?f.push("text-success"):n.color==="warning"?f.push("text-warning"):n.color==="info"?f.push("text-info"):n.color==="danger"?f.push("text-danger"):f.push("text-primary hover:text-primary-focus");return f.join(" ")}),m=e.computed(()=>{const f=[];return f.push(n.rounded?"rounded-full":"rounded-md"),f.join(" ")}),d=e.computed(()=>{const f=[];if(!a.value)switch(n.color){case"invert":f.push("hover:ring-4 ring-white/50");break;case"danger":f.push("hover:ring-4 ring-danger-lighter dark:ring-danger-darker");break;case"warning":f.push("hover:ring-4 ring-warning-lighter dark:ring-warning-darker");break;case"info":f.push("hover:ring-4 ring-info-lighter dark:ring-info-darker");break;case"success":f.push("hover:ring-4 ring-success-lighter dark:ring-success-darker");break;case"default":default:f.push("hover:ring-2");break}return f.join(" ")}),h=e.computed(()=>{switch(n.size){case"xs":return"h-5 text-xs font-medium xxx-tracking-wide";case"sm":return"h-6 text-sm font-medium xxx-tracking-wide";case"lg":return"h-10 text-lg font-semibold xxx-tracking-wide";case"xl":return"h-14 text-xl font-bold xxx-tracking-wide";default:case"base":return"h-8 text-base font-medium xxx-tracking-wide"}}),x=e.computed(()=>{switch(n.size){case"xs":return"px-1";case"sm":return"px-2";case"lg":return"px-4";case"xl":return"px-5";default:case"base":return"px-3"}}),b=e.computed(()=>{const f=[];return n.fullWidth&&f.push("w-full"),a.value&&f.push("cursor-not-allowed"),f.join(" ")}),v=e.computed(()=>{const f=[];return!a.value&&!n.link&&!n.text&&f.push("active:scale-[0.97]"),!a.value&&n.link&&f.push("underline decoration-transparent decoration-2 underline-offset-4 hover:decoration-inherit"),f.join(" ")}),k=e.computed(()=>{const f=n.link||n.text;return["transition inline-flex justify-center items-center space-x-2 outline-none select-none",b.value,h.value,g.value,f?"":u.value,f?"":m.value,f?"":d.value,n.link?"":x.value,v.value].join(" ")}),y=e.computed(()=>{const f=[""];switch(n.loading&&f.push("animate-spin"),n.size){case"xs":f.push("h-3 w-3");break;case"sm":f.push("h-4 w-4");break;case"lg":f.push("h-6 w-6");break;case"xl":f.push("h-8 w-8");break;case"base":default:f.push("h-5 w-5");break}return f.join(" ")}),_=f=>{if(a.value){f.preventDefault(),f.stopPropagation(),f.stopImmediatePropagation();return}o("click",f)};return(f,B)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.to?e.unref(i):"button"),{href:t.to,to:t.to,type:e.unref(c),external:t.external,class:e.normalizeClass(e.unref(k)),disabled:e.unref(a),role:"button",onClick:_},{default:e.withCtx(()=>[e.unref(s)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(s)),{key:0,class:e.normalizeClass(`${e.unref(y)} ${t.hideText?"":"mr-2"}`)},null,8,["class"])):e.createCommentVNode("",!0),t.hideText?(e.openBlock(),e.createElementBlock("div",ye," ")):e.renderSlot(f.$slots,"default",{key:1},()=>[e.createTextVNode("Button")],!0),t.iconRight||!t.loading?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.iconRight),{key:3,class:e.normalizeClass(`${e.unref(y)} ${t.hideText?"":"ml-2"}`)},null,8,["class"])):e.createCommentVNode("",!0)]),_:3},8,["href","to","type","external","class","disabled"]))}});const ee=(t,o)=>{const n=t.__vccOpts||t;for(const[l,r]of o)n[l]=r;return n},F=ee(ke,[["__scopeId","data-v-38aa371e"]]),te=e.defineComponent({__name:"Link",props:{to:{type:String,required:!1,default:void 0},external:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},size:{type:String,default:"base"},foregroundLink:{type:Boolean,default:!1},iconLeft:{type:[Object,Function],default:null},iconRight:{type:[Object,Function],default:null},hideText:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:o}){const n=t,l=r=>{if(n.disabled){r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation();return}o("click",r)};return(r,i)=>(e.openBlock(),e.createBlock(F,{link:"",to:t.to,external:t.external,disabled:t.disabled,size:t.size,"foreground-link":t.foregroundLink,"icon-left":t.iconLeft,"icon-right":t.iconRight,"hide-text":t.hideText,role:"link",onClickCapture:l},{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},()=>[e.createTextVNode("Link")])]),_:3},8,["to","external","disabled","size","foreground-link","icon-left","icon-right","hide-text"]))}});var j=(t=>(t[t.Success=0]="Success",t[t.Warning=1]="Warning",t[t.Danger=2]="Danger",t[t.Info=3]="Info",t))(j||{});const ve={"aria-live":"assertive",class:"pointer-events-none fixed inset-0 flex items-end px-4 py-6 mt-10 sm:items-start sm:p-6 z-50"},xe={class:"flex w-full flex-col items-center space-y-4 sm:items-end"},be={key:0,class:"pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-foundation text-foreground shadow-lg ring-1 ring-primary-muted ring-opacity-5"},Ce={class:"p-4"},Be={class:"flex items-start"},we={class:"flex-shrink-0"},Ve={class:"ml-2 w-0 flex-1 flex flex-col"},Ee={key:0,class:"text-foreground font-bold"},Ne={key:1,class:"label label--light text-foreground-2"},Se={key:2,class:"flex justify-start mt-2"},$e=e.createElementVNode("span",{class:"sr-only"},"Close",-1),_e=e.defineComponent({__name:"ToastRenderer",props:{notification:null},emits:["update:notification"],setup(t,{emit:o}){const n=t,l=e.computed(()=>{var c,a;return!((c=n.notification)!=null&&c.description)&&!((a=n.notification)!=null&&a.cta)}),r=()=>{o("update:notification",null)},i=c=>{var a,s,u;(u=(s=(a=n.notification)==null?void 0:a.cta)==null?void 0:s.onClick)==null||u.call(s,c),r()};return(c,a)=>(e.openBlock(),e.createElementBlock("div",ve,[e.createElementVNode("div",xe,[e.createVNode(e.Transition,{"enter-active-class":"transform ease-out duration-300 transition","enter-from-class":"translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2","enter-to-class":"translate-y-0 opacity-100 sm:translate-x-0","leave-active-class":"transition ease-in duration-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[t.notification?(e.openBlock(),e.createElementBlock("div",be,[e.createElementVNode("div",Ce,[e.createElementVNode("div",Be,[e.createElementVNode("div",we,[t.notification.type===e.unref(j).Success?(e.openBlock(),e.createBlock(e.unref(D.CheckCircleIcon),{key:0,class:"h-6 w-6 text-success","aria-hidden":"true"})):t.notification.type===e.unref(j).Danger?(e.openBlock(),e.createBlock(e.unref(D.XCircleIcon),{key:1,class:"h-6 w-6 text-danger","aria-hidden":"true"})):t.notification.type===e.unref(j).Warning?(e.openBlock(),e.createBlock(e.unref(D.ExclamationCircleIcon),{key:2,class:"h-6 w-6 text-warning","aria-hidden":"true"})):t.notification.type===e.unref(j).Info?(e.openBlock(),e.createBlock(e.unref(D.InformationCircleIcon),{key:3,class:"h-6 w-6 text-info","aria-hidden":"true"})):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ve,[t.notification.title?(e.openBlock(),e.createElementBlock("p",Ee,e.toDisplayString(t.notification.title),1)):e.createCommentVNode("",!0),t.notification.description?(e.openBlock(),e.createElementBlock("p",Ne,e.toDisplayString(t.notification.description),1)):e.createCommentVNode("",!0),t.notification.cta?(e.openBlock(),e.createElementBlock("div",Se,[e.createVNode(te,{to:t.notification.cta.url,class:"label",primary:"",onClick:i},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.notification.cta.title),1)]),_:1},8,["to"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["ml-4 flex flex-shrink-0",{"self-center":e.unref(l)}])},[e.createElementVNode("button",{type:"button",class:"inline-flex rounded-md bg-foundation text-foreground-2 hover:text-foreground focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",onClick:r},[$e,e.createVNode(e.unref(I.XMarkIcon),{class:"h-6 w-6","aria-hidden":"true"})])],2)])])])):e.createCommentVNode("",!0)]),_:1})])]))}}),Ie=e.createElementVNode("circle",{cx:"4",cy:"4",r:"3"},null,-1),ze=[Ie],ne=e.defineComponent({__name:"Badge",props:{size:null,colorClasses:null,dot:{type:Boolean},dotIconColorClasses:null,iconLeft:null,rounded:{type:Boolean},clickableIcon:{type:Boolean}},emits:["click-icon"],setup(t,{emit:o}){const n=t,l=e.computed(()=>n.colorClasses||"bg-blue-100 text-blue-800"),r=e.computed(()=>n.dotIconColorClasses||"text-blue-400"),i=e.computed(()=>{const u=["inline-flex items-center",l.value,n.size==="lg"?"px-3 py-0.5 label":"px-2.5 py-0.5 caption font-medium"];return n.rounded?(u.push("rounded"),u.push(n.size==="lg"?"px-2 py-0.5 label":"px-2.5 py-0.5 caption font-medium")):(u.push("rounded-full"),u.push(n.size==="lg"?"px-2.5 py-0.5 label":"px-2.5 py-0.5 caption font-medium")),u.join(" ")}),c=e.computed(()=>{const u=["mt-0.5 ml-0.5 inline-flex h-4 w-4 flex-shrink-0 items-center justify-center rounded-full focus:outline-none"];return n.clickableIcon?u.push("cursor-pointer"):u.push("cursor-default"),u.join(" ")}),a=e.computed(()=>["-ml-0.5 mr-1.5 h-2 w-2",r.value].join(" ")),s=u=>{if(!n.clickableIcon){u.stopPropagation(),u.stopImmediatePropagation(),u.preventDefault();return}o("click-icon",u)};return(u,g)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(e.unref(i))},[t.dot?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(e.unref(a)),fill:"currentColor",viewBox:"0 0 8 8"},ze,2)):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"default",{},()=>[e.createTextVNode("Badge")]),t.iconLeft?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(e.unref(c)),onClick:g[0]||(g[0]=m=>s(m))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.iconLeft),{class:e.normalizeClass(["h-4 w-4",e.unref(r)])},null,8,["class"]))],2)):e.createCommentVNode("",!0)],2))}});let Z=[];function Le(t){Z=Z?t:t.slice()}var O=(t=>(t[t.sm=640]="sm",t[t.md=746]="md",t[t.lg=1024]="lg",t[t.xl=1280]="xl",t[t["2xl"]=1536]="2xl",t))(O||{});function oe(t){const{props:{modelValue:o,steps:n,orientation:l,goVerticalBelow:r,nonInteractive:i,stepsPadding:c},emit:a}=t,s=e.computed(()=>(l==null?void 0:l.value)==="vertical"?"vertical":"horizontal"),u=e.computed({get:()=>C.clamp((o==null?void 0:o.value)||0,-1,n.value.length),set:v=>a("update:modelValue",C.clamp(v,0,n.value.length))}),g=v=>`${v+1}`,m=v=>v===u.value,d=v=>v<u.value,h=(v,k)=>{var _;if(i!=null&&i.value){k==null||k.preventDefault(),k==null||k.stopPropagation(),k==null||k.stopImmediatePropagation();return}u.value=v;const y=n.value[u.value];(_=y==null?void 0:y.onClick)==null||_.call(y)},x=e.computed(()=>{const v=["flex"];let k,y;return(c==null?void 0:c.value)==="xs"?(k="space-x-2",y="space-y-1"):(c==null?void 0:c.value)==="sm"?(k="space-x-4",y="space-y-1"):(k="space-x-8",y="space-y-4"),v.push("flex"),s.value==="vertical"||r!=null&&r.value?(v.push(`flex-col ${y} justify-center`),(r==null?void 0:r.value)===O.sm?v.push(`sm:flex-row sm:space-y-0 sm:justify-start sm:${k} sm:items-center`):(r==null?void 0:r.value)===O.md?v.push(`md:flex-row md:space-y-0 md:justify-start md:${k} md:items-center`):(r==null?void 0:r.value)===O.lg?v.push(`lg:flex-row lg:space-y-0 lg:justify-start lg:${k} lg:items-center`):(r==null?void 0:r.value)===O.xl&&v.push(`xl:flex-row xl:space-y-0 xl:justify-start xl:${k} xl:items-center`)):v.push(`flex-row ${k} items-center`),v.join(" ")}),b=e.computed(()=>{const v=["flex items-center"];return i!=null&&i.value||v.push("cursor-pointer"),v.join(" ")});return{value:u,isCurrentStep:m,isFinishedStep:d,switchStep:h,getStepDisplayValue:g,listClasses:x,linkClasses:b,orientation:s}}Le(["sm:space-x-8","md:space-x-8","lg:space-x-8","xl:space-x-8","sm:space-x-2","md:space-x-2","lg:space-x-2","xl:space-x-2","sm:space-x-4","md:space-x-4","lg:space-x-4","xl:space-x-4"]);const De=["aria-label"],Pe=["href","onClick"],je={class:"flex space-x-3 items-center text-primary-focus normal font-medium leading-5"},Oe={class:"shrink-0 h-8 w-8 rounded-full bg-primary-focus text-foreground-on-primary inline-flex items-center justify-center"},Te={class:"flex flex-col"},Me={key:0,class:"label label--light text-foreground"},Ae=["href","onClick"],Fe={class:"flex space-x-3 items-center text-primary-focus normal font-medium leading-5"},Re={class:"shrink-0 h-8 w-8 rounded-full border-2 border-primary-focus inline-flex items-center justify-center"},qe={class:"flex flex-col"},Ue={key:0,class:"label label--light text-foreground"},We=["href","onClick"],He={class:"flex space-x-3 items-center text-foreground-disabled normal font-medium leading-5"},Ge={class:"shrink-0 h-8 w-8 rounded-full border-2 border-foreground-disabled inline-flex items-center justify-center"},Ke={class:"flex flex-col"},Xe={key:0,class:"label label--light"},Je=e.defineComponent({__name:"Number",props:{ariaLabel:null,orientation:null,steps:null,modelValue:null,goVerticalBelow:null,nonInteractive:{type:Boolean},stepsPadding:null},emits:["update:modelValue"],setup(t,{emit:o}){const n=t,{isCurrentStep:l,isFinishedStep:r,switchStep:i,getStepDisplayValue:c,listClasses:a,linkClasses:s}=oe({props:e.toRefs(n),emit:o});return(u,g)=>(e.openBlock(),e.createElementBlock("nav",{class:"flex justify-center","aria-label":t.ariaLabel||"Progress steps"},[e.createElementVNode("ol",{class:e.normalizeClass(e.unref(a))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.steps,(m,d)=>(e.openBlock(),e.createElementBlock("li",{key:m.name},[e.unref(r)(d)?(e.openBlock(),e.createElementBlock("a",{key:0,href:m.href,class:e.normalizeClass(e.unref(s)),onClick:h=>e.unref(i)(d,h)},[e.createElementVNode("div",je,[e.createElementVNode("div",Oe,[e.createVNode(e.unref(I.CheckIcon),{class:"w-5 h-5"})]),e.createElementVNode("div",Te,[e.createElementVNode("div",null,e.toDisplayString(m.name),1),m.description?(e.openBlock(),e.createElementBlock("div",Me,e.toDisplayString(m.description),1)):e.createCommentVNode("",!0)])])],10,Pe)):e.unref(l)(d)?(e.openBlock(),e.createElementBlock("a",{key:1,href:m.href,class:e.normalizeClass(e.unref(s)),"aria-current":"step",onClick:h=>e.unref(i)(d,h)},[e.createElementVNode("div",Fe,[e.createElementVNode("div",Re,e.toDisplayString(e.unref(c)(d)),1),e.createElementVNode("div",qe,[e.createElementVNode("div",null,e.toDisplayString(m.name),1),m.description?(e.openBlock(),e.createElementBlock("div",Ue,e.toDisplayString(m.description),1)):e.createCommentVNode("",!0)])])],10,Ae)):(e.openBlock(),e.createElementBlock("a",{key:2,href:m.href,class:e.normalizeClass(e.unref(s)),onClick:h=>e.unref(i)(d,h)},[e.createElementVNode("div",He,[e.createElementVNode("div",Ge,e.toDisplayString(e.unref(c)(d)),1),e.createElementVNode("div",Ke,[e.createElementVNode("div",null,e.toDisplayString(m.name),1),m.description?(e.openBlock(),e.createElementBlock("div",Xe,e.toDisplayString(m.description),1)):e.createCommentVNode("",!0)])])],10,We))]))),128))],2)],8,De))}}),Qe=["aria-label"],Ye=["href","onClick"],Ze={class:"relative flex h-5 w-5 flex-shrink-0 items-center justify-center"},et={key:0,class:"h-3 w-3 rounded-full bg-foreground-2"},tt=["href","onClick"],nt={class:"relative flex h-5 w-5 flex-shrink-0 items-center justify-center","aria-hidden":"true"},ot={key:0,class:"h-3 w-3 rounded-full bg-foreground"},lt=e.createElementVNode("span",{class:"absolute h-4 w-4 rounded-full bg-outline-2"},null,-1),rt=e.createElementVNode("span",{class:"relative block h-2 w-2 rounded-full bg-primary-focus"},null,-1),st=["href","onClick"],at={class:"relative flex h-5 w-5 flex-shrink-0 items-center justify-center","aria-hidden":"true"},it={key:0,class:"h-3 w-3 rounded-full bg-foreground-2"},ct={key:1,class:"h-4 w-4 rounded-full bg-foreground-disabled"},ut=e.defineComponent({__name:"Bullet",props:{ariaLabel:null,basic:{type:Boolean},orientation:null,steps:null,modelValue:null,goVerticalBelow:null,nonInteractive:{type:Boolean},stepsPadding:null},emits:["update:modelValue"],setup(t,{emit:o}){const n=t,{isCurrentStep:l,isFinishedStep:r,switchStep:i,listClasses:c,linkClasses:a}=oe({props:e.toRefs(n),emit:o}),s=e.computed(()=>{const g=["h6 font-medium leading-7"];let m;return n.stepsPadding==="xs"?m="ml-1":n.stepsPadding==="sm"?m="ml-2":m="ml-3",g.push(m),n.basic&&g.push("sr-only"),g.join(" ")}),u=e.computed(()=>{const g=[];return n.basic&&g.push("basic"),g.join(" ")});return(g,m)=>(e.openBlock(),e.createElementBlock("nav",{class:"flex justify-center","aria-label":t.ariaLabel||"Progress steps"},[e.createElementVNode("ol",{class:e.normalizeClass([e.unref(c),e.unref(u)])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.steps,(d,h)=>(e.openBlock(),e.createElementBlock("li",{key:d.name},[e.unref(r)(h)?(e.openBlock(),e.createElementBlock("a",{key:0,href:d.href,class:e.normalizeClass(e.unref(a)),onClick:x=>e.unref(i)(h,x)},[e.createElementVNode("span",Ze,[t.basic?(e.openBlock(),e.createElementBlock("span",et)):(e.openBlock(),e.createBlock(e.unref(I.CheckCircleIcon),{key:1,class:"h-full w-full text-primary","aria-hidden":"true"}))]),e.createElementVNode("span",{class:e.normalizeClass(["text-foreground",e.unref(s)])},e.toDisplayString(d.name),3)],10,Ye)):e.unref(l)(h)?(e.openBlock(),e.createElementBlock("a",{key:1,href:d.href,class:e.normalizeClass(e.unref(a)),"aria-current":"step",onClick:x=>e.unref(i)(h,x)},[e.createElementVNode("span",nt,[t.basic?(e.openBlock(),e.createElementBlock("span",ot)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[lt,rt],64))]),e.createElementVNode("span",{class:e.normalizeClass(["text-primary-focus",e.unref(s)])},e.toDisplayString(d.name),3)],10,tt)):(e.openBlock(),e.createElementBlock("a",{key:2,href:d.href,class:e.normalizeClass(e.unref(a)),onClick:x=>e.unref(i)(h,x)},[e.createElementVNode("div",at,[t.basic?(e.openBlock(),e.createElementBlock("span",it)):(e.openBlock(),e.createElementBlock("div",ct))]),e.createElementVNode("p",{class:e.normalizeClass(["text-foreground-disabled",e.unref(s)])},e.toDisplayString(d.name),3)],10,st))]))),128))],2)],8,Qe))}}),dt=["disabled"],ft=e.defineComponent({__name:"CardButton",props:{disabled:{type:Boolean},modelValue:{type:Boolean}},emits:["update:modelValue","click"],setup(t,{emit:o}){const n=t,l=e.computed(()=>{const i=["h-20 bg-foundation-2 inline-flex justify-center items-center outline-none","normal px-16 py-5 shadow rounded transition active:scale-95"];return n.disabled?i.push("bg-foundation-disabled text-foreground-2 cursor-not-allowed"):(i.push(n.modelValue?"bg-primary-focus text-foreground-on-primary":"bg-foundation text-foreground"),i.push("ring-outline-2 hover:ring-4")),i.join(" ")}),r=i=>{if(n.disabled){i.preventDefault(),i.stopPropagation(),i.stopImmediatePropagation();return}o("update:modelValue",!n.modelValue),o("click",i)};return(i,c)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(e.unref(l)),disabled:t.disabled,onClick:r},[e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode("Text")])],10,dt))}}),mt={class:"relative flex items-start"},pt={class:"flex h-6 items-center"},ht=["id","checked","aria-describedby","name","value","disabled"],gt={class:"ml-2 text-sm",style:{"padding-top":"2px"}},yt=["for"],kt={key:0,class:"text-danger ml-1"},vt=["id"],xt=e.defineComponent({inheritAttrs:!1}),bt=e.defineComponent({...xt,__name:"Checkbox",props:{name:{type:String,required:!0},disabled:{type:Boolean,default:!1},label:{type:String,default:void 0},description:{type:String,default:void 0},inlineDescription:{type:Boolean,default:!1},rules:{type:[String,Object,Function,Array],default:void 0},validateOnMount:{type:Boolean,default:!1},showRequired:{type:Boolean,default:!1},modelValue:{type:[String,Boolean],default:void 0},value:{type:[String,Boolean],default:!0},id:{type:String,default:void 0},hideLabel:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t){const o=t,n=b=>`${b}-${G.nanoid()}`,l=e.computed(()=>o.value||o.name),{checked:r,errorMessage:i,handleChange:c}=H.useField(o.name,o.rules,{validateOnMount:o.validateOnMount,type:"checkbox",checkedValue:l,initialValue:o.modelValue||void 0}),a=b=>{o.disabled||c(b)},s=e.computed(()=>o.label||o.name),u=e.computed(()=>i.value?"border-danger-lighter":"border-foreground-4 "),g=e.computed(()=>o.description||i.value),m=e.computed(()=>`${o.name}-description`),d=e.computed(()=>{const b=[];return o.inlineDescription?b.push("inline ml-2"):b.push("block"),i.value?b.push("text-danger"):b.push("text-foreground-2"),b.join(" ")}),h=e.ref(n("checkbox")),x=e.computed(()=>o.id||h.value);return(b,v)=>(e.openBlock(),e.createElementBlock("div",mt,[e.createElementVNode("div",pt,[e.createElementVNode("input",e.mergeProps({id:e.unref(x),checked:e.unref(r),"aria-describedby":e.unref(m),name:t.name,value:e.unref(l),disabled:t.disabled,type:"checkbox",class:["h-4 w-4 rounded text-primary focus:ring-primary bg-foundation disabled:cursor-not-allowed disabled:bg-disabled disabled:text-disabled-2",e.unref(u)]},b.$attrs,{onChange:a}),null,16,ht)]),e.createElementVNode("div",gt,[e.createElementVNode("label",{for:e.unref(x),class:e.normalizeClass(["font-medium text-foreground",{"sr-only":t.hideLabel}])},[e.createElementVNode("span",null,e.toDisplayString(e.unref(s)),1),t.showRequired?(e.openBlock(),e.createElementBlock("span",kt,"*")):e.createCommentVNode("",!0)],10,yt),e.unref(g)?(e.openBlock(),e.createElementBlock("p",{key:0,id:e.unref(m),class:e.normalizeClass(e.unref(d))},e.toDisplayString(e.unref(g)),11,vt)):e.createCommentVNode("",!0)])]))}});function le(t){const{props:o,inputEl:n,emit:l}=t,{value:r,errorMessage:i}=H.useField(o.name,o.rules,{validateOnMount:e.unref(o.validateOnMount),validateOnValueUpdate:e.unref(o.validateOnValueUpdate),initialValue:e.unref(o.modelValue)||void 0}),c=e.computed(()=>{const y=["block label text-foreground-2 mb-2"];return e.unref(o.showLabel)||y.push("sr-only"),y.join(" ")}),a=e.computed(()=>{const y=["block w-full rounded focus:outline-none text-foreground transition-all","disabled:cursor-not-allowed disabled:bg-foundation-disabled disabled:text-disabled-muted","placeholder:text-foreground-2"];return i.value?y.push("border-2 border-danger text-danger-darker focus:border-danger focus:ring-danger"):y.push("border-0 focus:ring-2 focus:ring-outline-2"),e.unref(o.color)==="foundation"?y.push("bg-foundation shadow-sm hover:shadow"):y.push("bg-foundation-page"),y.join(" ")}),s=e.ref(G.nanoid()),u=e.computed(()=>e.unref(o.label)||e.unref(o.name)),g=e.computed(()=>{const y=i.value;return!y||!e.unref(o.useLabelInErrors)?y:y.replace("Value",u.value)}),m=e.computed(()=>g.value&&e.unref(o.hideErrorMessage)),d=e.computed(()=>g.value||e.unref(o.help)),h=e.computed(()=>!!d.value),x=e.computed(()=>h.value?`${e.unref(o.name)}-${s.value}`:void 0),b=e.computed(()=>{const y=["mt-2 text-sm"];return y.push(i.value?"text-danger":"text-foreground-2"),y.join(" ")}),v=()=>{var y;(y=n.value)==null||y.focus()},k=()=>{r.value="",l("change",{value:""}),l("clear")};return e.onMounted(()=>{e.unref(o.autoFocus)&&v()}),{coreClasses:a,title:u,value:r,helpTipId:x,helpTipClasses:b,helpTip:d,hideHelpTip:m,errorMessage:g,clear:k,focus:v,labelClasses:c}}const Ct=["for"],Bt={class:"relative"},wt=["id","name","placeholder","disabled","aria-invalid","aria-describedby"],Vt=e.createElementVNode("span",{class:"text-xs sr-only"},"Clear input",-1),Et={key:2,class:"pointer-events-none absolute inset-y-0 mt-3 text-4xl right-0 flex items-center pr-2 text-danger opacity-50"},Nt=["id"],St=e.defineComponent({__name:"TextArea",props:{name:null,showLabel:{type:Boolean},help:null,placeholder:null,label:null,disabled:{type:Boolean},rules:null,validateOnMount:{type:Boolean},validateOnValueUpdate:{type:Boolean},useLabelInErrors:{type:Boolean,default:!0},autoFocus:{type:Boolean},modelValue:{default:""},showClear:{type:Boolean},fullWidth:{type:Boolean},showRequired:{type:Boolean},color:{default:"page"}},emits:["update:modelValue","change","input","clear"],setup(t,{expose:o,emit:n}){const l=t,r=e.ref(null),{coreClasses:i,title:c,value:a,helpTipId:s,helpTipClasses:u,helpTip:g,errorMessage:m,labelClasses:d,clear:h,focus:x}=le({props:e.toRefs(l),emit:n,inputEl:r}),b=e.computed(()=>{const v=["pl-2"];return l.showClear&&m.value?v.push("pr-12"):(l.showClear||m.value)&&v.push("pr-8"),v.join(" ")});return o({focus:x}),(v,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.fullWidth?"w-full":""])},[e.createElementVNode("label",{for:t.name,class:e.normalizeClass(e.unref(d))},[e.createElementVNode("span",null,e.toDisplayString(e.unref(c)),1)],10,Ct),e.createElementVNode("div",Bt,[e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:t.name,ref_key:"inputElement",ref:r,"onUpdate:modelValue":k[0]||(k[0]=y=>e.isRef(a)?a.value=y:null),name:t.name,class:[e.unref(i),e.unref(b),"min-h-[4rem]"],placeholder:t.placeholder,disabled:t.disabled,"aria-invalid":e.unref(m)?"true":"false","aria-describedby":e.unref(s)},v.$attrs,{onChange:k[1]||(k[1]=y=>v.$emit("change",{event:y,value:e.unref(a)})),onInput:k[2]||(k[2]=y=>v.$emit("input",{event:y,value:e.unref(a)}))}),null,16,wt),[[e.vModelText,e.unref(a)]]),t.showClear?(e.openBlock(),e.createElementBlock("a",{key:0,title:"Clear input",class:"absolute top-2 right-0 flex items-center pr-2 cursor-pointer",onClick:k[3]||(k[3]=(...y)=>e.unref(h)&&e.unref(h)(...y)),onKeydown:k[4]||(k[4]=(...y)=>e.unref(h)&&e.unref(h)(...y))},[Vt,e.createVNode(e.unref(I.XMarkIcon),{class:"h-5 w-5 text-foreground","aria-hidden":"true"})],32)):e.createCommentVNode("",!0),e.unref(m)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["pointer-events-none absolute inset-y-0 right-0 flex items-center",t.showClear?"pr-8":"pr-2"])},[e.createVNode(e.unref(I.ExclamationCircleIcon),{class:"h-4 w-4 text-danger","aria-hidden":"true"})],2)):e.createCommentVNode("",!0),t.showRequired&&!e.unref(m)?(e.openBlock(),e.createElementBlock("div",Et," * ")):e.createCommentVNode("",!0)]),e.unref(s)?(e.openBlock(),e.createElementBlock("p",{key:0,id:e.unref(s),class:e.normalizeClass(e.unref(u))},e.toDisplayString(e.unref(g)),11,Nt)):e.createCommentVNode("",!0)],2))}}),$t=["for"],_t={class:"relative"},It={key:0,class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2"},zt=["id","type","name","placeholder","disabled","aria-invalid","aria-describedby"],Lt=e.createElementVNode("span",{class:"text-xs sr-only"},"Clear input",-1),Dt={key:2,class:"pointer-events-none absolute inset-y-0 mt-3 text-4xl right-0 flex items-center pr-2 text-danger opacity-50"},Pt=["id"],jt=e.defineComponent({inheritAttrs:!1}),Ot=e.defineComponent({...jt,__name:"TextInput",props:{type:{type:String,default:"text"},name:{type:String,required:!0},showLabel:{type:Boolean,required:!1},help:{type:String,default:void 0},placeholder:{type:String,default:void 0},label:{type:String,default:void 0},showRequired:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},rules:{type:[String,Object,Function,Array],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnValueUpdate:{type:Boolean,default:!1},useLabelInErrors:{type:Boolean,default:!0},customIcon:{type:[Object,Function],default:void 0},autoFocus:{type:Boolean,default:!1},modelValue:{type:String,default:""},size:{type:String,default:"base"},showClear:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1},inputClasses:{type:String,default:null},hideErrorMessage:{type:Boolean,default:!1},wrapperClasses:{type:String,default:()=>""},color:{type:String,default:"page"}},emits:["update:modelValue","change","input","clear","focusin","focusout"],setup(t,{expose:o,emit:n}){const l=t,r=e.useSlots(),i=e.ref(null),{coreClasses:c,title:a,value:s,helpTipId:u,helpTipClasses:g,helpTip:m,hideHelpTip:d,errorMessage:h,clear:x,focus:b,labelClasses:v}=le({props:e.toRefs(l),emit:n,inputEl:i}),k=e.computed(()=>{const B=["h-5 w-5"];return h.value?B.push("text-danger"):B.push("text-foreground-2"),B.join(" ")}),y=e.computed(()=>["email","password"].includes(l.type)||l.customIcon),_=e.computed(()=>{const B=[];return y.value?B.push("pl-8"):B.push("pl-2"),r["input-right"]||(h.value||l.showClear)&&(h.value&&l.showClear?B.push("pr-12"):B.push("pr-8")),B.join(" ")}),f=e.computed(()=>{switch(l.size){case"sm":return"h-6";case"lg":return"h-10";case"xl":return"h-14";case"base":default:return"h-8"}});return o({focus:b}),(B,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.fullWidth?"w-full":"",t.wrapperClasses])},[e.createElementVNode("label",{for:t.name,class:e.normalizeClass(e.unref(v))},[e.createElementVNode("span",null,e.toDisplayString(e.unref(a)),1)],10,$t),e.createElementVNode("div",_t,[e.unref(y)?(e.openBlock(),e.createElementBlock("div",It,[t.customIcon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.customIcon),{key:0,class:e.normalizeClass(e.unref(k)),"aria-hidden":"true"},null,8,["class"])):t.type==="email"?(e.openBlock(),e.createBlock(e.unref(I.EnvelopeIcon),{key:1,class:e.normalizeClass(e.unref(k)),"aria-hidden":"true"},null,8,["class"])):t.type==="password"?(e.openBlock(),e.createBlock(e.unref(I.KeyIcon),{key:2,class:e.normalizeClass(e.unref(k)),"aria-hidden":"true"},null,8,["class"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:t.name,ref_key:"inputElement",ref:i,"onUpdate:modelValue":w[0]||(w[0]=N=>e.isRef(s)?s.value=N:null),type:t.type,name:t.name,class:[e.unref(c),e.unref(_),e.unref(f),t.inputClasses||""],placeholder:t.placeholder,disabled:t.disabled,"aria-invalid":e.unref(h)?"true":"false","aria-describedby":e.unref(u),role:"textbox"},B.$attrs,{onChange:w[1]||(w[1]=N=>B.$emit("change",{event:N,value:e.unref(s)})),onInput:w[2]||(w[2]=N=>B.$emit("input",{event:N,value:e.unref(s)}))}),null,16,zt),[[e.vModelDynamic,e.unref(s)]]),e.renderSlot(B.$slots,"input-right",{},()=>[t.showClear?(e.openBlock(),e.createElementBlock("a",{key:0,title:"Clear input",class:"absolute inset-y-0 right-0 flex items-center pr-2 cursor-pointer",onClick:w[3]||(w[3]=(...N)=>e.unref(x)&&e.unref(x)(...N)),onKeydown:w[4]||(w[4]=(...N)=>e.unref(x)&&e.unref(x)(...N))},[Lt,e.createVNode(e.unref(I.XMarkIcon),{class:"h-5 w-5 text-foreground","aria-hidden":"true"})],32)):e.createCommentVNode("",!0),e.unref(h)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["pointer-events-none absolute inset-y-0 right-0 flex items-center",t.showClear?"pr-8":"pr-2"])},[e.createVNode(e.unref(I.ExclamationCircleIcon),{class:"h-4 w-4 text-danger","aria-hidden":"true"})],2)):e.createCommentVNode("",!0),t.showRequired&&!e.unref(h)?(e.openBlock(),e.createElementBlock("div",Dt," * ")):e.createCommentVNode("",!0)])]),e.unref(u)&&!e.unref(d)?(e.openBlock(),e.createElementBlock("p",{key:0,id:e.unref(u),class:e.normalizeClass(e.unref(g))},e.toDisplayString(e.unref(m)),11,Pt)):e.createCommentVNode("",!0)],2))}}),Tt=/^https?:\/\//,K=/^[\w-_.+]+@[\w-_.+]+$/,Mt=t=>(t||"").match(K)?!0:"Value should be a valid e-mail address",At=t=>(t||"").split(",").map(l=>l.trim()).every(l=>l.match(K))||"Value should be one or multiple comma-delimited e-mail addresses",Ft=t=>(C.isString(t)&&(t=t.trim()),t?!0:"Value is required"),Rt=(t,o)=>(n,l)=>n===l.form[t]?!0:`Value must be the same as in field '${o||t}'`,qt=t=>o=>{const{minLength:n,maxLength:l}=t;return o=M.isNullOrUndefined(o)?"":o,C.isString(o)?!C.isUndefined(n)&&o.length<n?`Value needs to be at least ${n} characters long`:!C.isUndefined(l)&&o.length>l?`Value needs to be no more than ${l} characters long`:!0:"Value should be a text string"},Ut=t=>o=>{const{match:n,message:l}=t;return C.isString(o)?n?C.isString(n)?o.includes(n)?!0:l:n.test(o)?!0:l:!0:"Value should be a text string"},Wt=Object.freeze(Object.defineProperty({__proto__:null,VALID_EMAIL:K,VALID_HTTP_URL:Tt,isEmail:Mt,isOneOrMultipleEmails:At,isRequired:Ft,isSameAs:Rt,isStringOfLength:qt,stringContains:Ut},Symbol.toStringTag,{value:"Module"}));function re(t){const{skipCalculation:o,elementToWatchForChanges:n,itemContainer:l,trackResize:r=!1,trackMutations:i=!0}=t||{},c=e.ref(0),a=()=>{const s=l.value;if(o!=null&&o.value||!s)return;const u=s.children;let g=0,m=0,d;for(const h of u){const x=h.offsetTop;C.isUndefined(d)?(d=x,g+=1):x===d&&(g+=1),m+=1}c.value=m-g};return r&&A.useResizeObserver(n,a),i&&A.useMutationObserver(n,a,{childList:!0,subtree:!0}),{hiddenItemCount:c}}function se(t){const{props:o,emit:n,dynamicVisibility:l}=t;let r;if(l){const{elementToWatchForChanges:u,itemContainer:g}=l;r=re({skipCalculation:e.computed(()=>{var d;return!((d=o.multiple)!=null&&d.value)}),elementToWatchForChanges:u,itemContainer:g}).hiddenItemCount}else r=e.ref(0);const i=e.computed({get:()=>{var g,m;const u=(g=o.modelValue)==null?void 0:g.value;return(m=o.multiple)!=null&&m.value?C.isArray(u)?u:[]:C.isArray(u)?void 0:u},set:u=>{var g,m,d;if((g=o.multiple)!=null&&g.value&&!C.isArray(u)){console.warn("Attempting to set non-array value in selector w/ multiple=true");return}else if(!((m=o.multiple)!=null&&m.value)&&C.isArray(u)){console.warn("Attempting to set array value in selector w/ multiple=false");return}n("update:modelValue",(d=o.multiple)!=null&&d.value?u||[]:u)}}),c=u=>C.isArray(u);return{selectedValue:i,hiddenSelectedItemCount:r,isArrayValue:c,isMultiItemArrayValue:u=>C.isArray(u)&&u.length>1,firstItem:u=>c(u)?u[0]:u}}const Ht=t=>(e.pushScopeId("data-v-60cf597b"),t=t(),e.popScopeId(),t),Gt=Ht(()=>e.createElementVNode("div",{class:"swoosher relative top-0 bg-blue-500/50"},null,-1)),Kt=[Gt],Xt=e.defineComponent({__name:"Bar",props:{loading:{type:Boolean}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative w-full h-1 bg-blue-500/30 text-xs text-foreground-on-primary overflow-hidden rounded-xl",t.loading?"opacity-100":"opacity-0"])},Kt,2))}});const X=ee(Xt,[["__scopeId","data-v-60cf597b"]]),Jt={class:"flex items-center justify-between w-full"},Qt={class:"block truncate grow text-left"},Yt={class:"pointer-events-none shrink-0 ml-1 flex items-center"},Zt=["disabled"],en={key:0,class:"flex flex-col mx-1 mb-1"},tn=e.createElementVNode("span",{class:"sr-only label text-foreground"},"Search",-1),nn={class:"relative"},on={class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2"},ln=["placeholder"],rn={key:0,class:"px-1"},sn={key:1},an=e.createElementVNode("div",{class:"text-foreground-2 text-center"},"Nothing found 🤷♂️",-1),cn={class:e.normalizeClass(["block truncate"])},un=["id"],ae=e.defineComponent({__name:"Base",props:{multiple:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},modelValue:{type:[Object,Array,String],default:void 0},search:{type:Boolean,default:!1},filterPredicate:{type:Function,default:void 0},getSearchResults:{type:Function,default:void 0},searchPlaceholder:{type:String,default:"Search"},label:{type:String,required:!0},showLabel:{type:Boolean,default:!1},name:{type:String,required:!0},by:{type:String,required:!1},disabled:{type:Boolean,default:!1},buttonStyle:{type:String,default:"base"},hideCheckmarks:{type:Boolean,default:!1},allowUnset:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},rules:{type:[String,Object,Function,Array],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnValueUpdate:{type:Boolean,default:!1},useLabelInErrors:{type:Boolean,default:!0},help:{type:String,default:void 0},fixedHeight:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{expose:o}){const n=t,{value:l,errorMessage:r}=H.useField(n.name,n.rules,{validateOnMount:n.validateOnMount,validateOnValueUpdate:n.validateOnValueUpdate,initialValue:n.modelValue}),i=e.ref(null),c=e.ref(""),a=e.ref([]),s=e.ref(!1),u=e.ref(G.nanoid()),g=e.computed(()=>e.unref(n.label)||e.unref(n.name)),m=e.computed(()=>{const p=r.value;return!p||!e.unref(n.useLabelInErrors)?p:p.replace("Value",g.value)}),d=e.computed(()=>m.value||e.unref(n.help)),h=e.computed(()=>!!d.value),x=e.computed(()=>h.value?`${e.unref(n.name)}-${u.value}`:void 0),b=e.computed(()=>r.value?"text-danger":"text-foreground-2"),v=e.computed(()=>n.buttonStyle!=="simple"&&n.clearable&&!n.disabled),k=e.computed(()=>{const p=["relative flex group"];return n.buttonStyle!=="simple"&&(p.push("hover:shadow rounded-md"),p.push("outline outline-2 outline-primary-muted")),n.fixedHeight&&p.push("h-8"),p.join(" ")}),y=e.computed(()=>{const p=[];return n.buttonStyle!=="simple"&&p.push(N.value?"bg-foundation-disabled text-foreground-disabled":""),N.value&&p.push("cursor-not-allowed"),p.join(" ")}),_=e.computed(()=>{const p=["relative z-[1]","flex items-center justify-center text-center shrink-0","rounded-r-md overflow-hidden transition-all","text-foreground",J.value?`w-6 ${y.value}`:"w-0"];return N.value||(p.push("hover:bg-primary hover:text-foreground-on-primary dark:text-foreground-on-primary"),n.buttonStyle==="tinted"?p.push("bg-outline-3"):p.push("bg-primary-muted")),p.join(" ")}),f=e.computed(()=>{const p=["relative z-[2]","normal rounded-md cursor-pointer transition truncate flex-1","flex items-center",y.value];return n.buttonStyle!=="simple"&&(p.push("py-2 px-3"),N.value||(n.buttonStyle==="tinted"?p.push("bg-foundation-page text-foreground"):p.push("bg-foundation text-foreground"))),v.value&&J.value&&p.push("rounded-r-none"),p.join(" ")}),B=e.computed(()=>!!(n.search&&(n.filterPredicate||n.getSearchResults))),w=e.computed(()=>B.value&&n.getSearchResults),N=e.computed(()=>n.disabled||!n.items.length&&!w.value),$=e.computed({get:()=>{const p=l.value;return n.multiple?C.isArray(p)?p:[]:C.isArray(p)?void 0:p},set:p=>{if(n.multiple&&!C.isArray(p)){console.warn("Attempting to set non-array value in selector w/ multiple=true");return}else if(!n.multiple&&C.isArray(p)){console.warn("Attempting to set array value in selector w/ multiple=false");return}if(n.multiple)l.value=p||[];else{const S=l.value,V=n.allowUnset&&S&&p&&U(S)===U(p);l.value=V?void 0:p}}}),J=e.computed(()=>n.multiple?$.value.length!==0:!!$.value),fe=()=>{n.multiple?$.value=[]:$.value=void 0},me=e.computed(()=>{const p=c.value;return!B.value||!(p!=null&&p.length)?a.value:n.filterPredicate?a.value.filter(S=>{var V;return((V=n.filterPredicate)==null?void 0:V.call(n,S,p))||!1}):a.value}),Q=p=>JSON.stringify(p),U=p=>n.by?p[n.by]:p,W=async()=>{if(!(!w.value||!n.getSearchResults)){s.value=!0;try{a.value=await n.getSearchResults(c.value)}finally{s.value=!1}}},pe=C.debounce(W,1e3);return e.watch(()=>n.items,p=>{a.value=p.slice()},{immediate:!0}),e.watch(c,()=>{w.value&&pe()}),e.onMounted(()=>{w.value&&!n.items.length&&W()}),o({triggerSearch:W}),(p,S)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(E.Listbox),{modelValue:e.unref($),"onUpdate:modelValue":S[4]||(S[4]=V=>e.isRef($)?$.value=V:null),name:t.name,multiple:t.multiple,by:t.by,disabled:e.unref(N),as:"div"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ListboxLabel),{class:e.normalizeClass(["block label text-foreground-2 mb-2",{"sr-only":!t.showLabel}])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["class"]),e.createElementVNode("div",{class:e.normalizeClass(e.unref(k))},[e.createVNode(e.unref(E.ListboxButton),{class:e.normalizeClass(e.unref(f))},{default:e.withCtx(({open:V})=>[e.createElementVNode("div",Jt,[e.createElementVNode("div",Qt,[!e.unref($)||e.unref(C.isArray)(e.unref($))&&!e.unref($).length?e.renderSlot(p.$slots,"nothing-selected",{key:0},()=>[e.createTextVNode(e.toDisplayString(t.label),1)]):e.renderSlot(p.$slots,"something-selected",{key:1,value:e.unref($)},()=>[e.createTextVNode(e.toDisplayString(Q(e.unref($))),1)])]),e.createElementVNode("div",Yt,[V?(e.openBlock(),e.createBlock(e.unref(z.ChevronUpIcon),{key:0,class:"h-4 w-4 text-foreground","aria-hidden":"true"})):(e.openBlock(),e.createBlock(e.unref(z.ChevronDownIcon),{key:1,class:"h-4 w-4 text-foreground","aria-hidden":"true"}))])])]),_:3},8,["class"]),e.unref(v)?e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(e.unref(_)),disabled:t.disabled,onClick:S[0]||(S[0]=V=>fe())},[e.createVNode(e.unref(z.XMarkIcon),{class:"w-3 h-3"})],10,Zt)),[[e.unref(he.directive),"Clear"]]):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"leave-active-class":"transition ease-in duration-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.ListboxOptions),{class:"absolute top-[100%] z-10 mt-1 w-full rounded-md bg-foundation-2 py-1 label label--light outline outline-2 outline-primary-muted focus:outline-none shadow",onFocus:S[3]||(S[3]=V=>{var P;return(P=i.value)==null?void 0:P.focus()})},{default:e.withCtx(()=>[e.unref(B)?(e.openBlock(),e.createElementBlock("label",en,[tn,e.createElementVNode("div",nn,[e.createElementVNode("div",on,[e.createVNode(e.unref(z.MagnifyingGlassIcon),{class:"h-5 w-5 text-foreground"})]),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:i,"onUpdate:modelValue":S[1]||(S[1]=V=>c.value=V),type:"text",class:"pl-9 w-full border-0 bg-foundation-page rounded placeholder:font-normal normal placeholder:text-foreground-2 focus:outline-none focus:ring-1 focus:border-outline-1 focus:ring-outline-1",placeholder:t.searchPlaceholder,onKeydown:S[2]||(S[2]=e.withModifiers(()=>{},["stop"]))},null,40,ln),[[e.vModelText,c.value]])])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["overflow-auto simple-scrollbar",[e.unref(B)?"max-h-52":"max-h-60"]])},[e.unref(w)&&s.value?(e.openBlock(),e.createElementBlock("div",rn,[e.createVNode(X,{loading:!0})])):e.unref(w)&&!a.value.length?(e.openBlock(),e.createElementBlock("div",sn,[e.renderSlot(p.$slots,"nothing-found",{},()=>[an])])):e.createCommentVNode("",!0),!e.unref(w)||!s.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(e.unref(me),V=>(e.openBlock(),e.createBlock(e.unref(E.ListboxOption),{key:U(V),value:V},{default:e.withCtx(({active:P,selected:Y})=>[e.createElementVNode("li",{class:e.normalizeClass([P?"text-primary":"text-foreground","relative transition cursor-pointer select-none py-1.5 pl-3",t.hideCheckmarks?"":"pr-9"])},[e.createElementVNode("span",cn,[e.renderSlot(p.$slots,"option",{item:V,active:P,selected:Y},()=>[e.createTextVNode(e.toDisplayString(Q(V)),1)])]),!t.hideCheckmarks&&Y?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([P?"text-primary":"text-foreground","absolute inset-y-0 right-0 flex items-center pr-4"])},[e.createVNode(e.unref(z.CheckIcon),{class:"h-5 w-5","aria-hidden":"true"})],2)):e.createCommentVNode("",!0)],2)]),_:2},1032,["value"]))),128)):e.createCommentVNode("",!0)],2)]),_:3})]),_:3})],2)]),_:3},8,["modelValue","name","multiple","by","disabled"]),e.unref(x)?(e.openBlock(),e.createElementBlock("p",{key:0,id:e.unref(x),class:e.normalizeClass(["mt-2 text-sm",e.unref(b)])},e.toDisplayString(e.unref(d)),11,un)):e.createCommentVNode("",!0)]))}}),ie=e.defineComponent({__name:"SourceAppBadge",props:{sourceApp:null},setup(t){return(o,n)=>(e.openBlock(),e.createBlock(ne,{"color-classes":"text-foreground-on-primary",rounded:"",style:e.normalizeStyle({backgroundColor:t.sourceApp.bgColor})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.sourceApp.short),1)]),_:1},8,["style"]))}}),dn={key:0,class:"text-foreground-2 normal"},fn={key:1,class:"flex items-center"},mn={class:"truncate"},pn={class:"flex items-center"},hn={class:"truncate"},gn=e.defineComponent({__name:"SourceApps",props:{multiple:{type:Boolean,default:!1},modelValue:{type:[Object,Array],default:void 0},search:{type:Boolean,default:!1},searchPlaceholder:{type:String,default:"Search apps"},selectorPlaceholder:{type:String,default:void 0},label:{type:String,required:!0},showLabel:{type:Boolean,default:!1},name:{type:String,default:void 0},items:{type:Array,default:void 0}},emits:["update:modelValue"],setup(t,{emit:o}){const n=t,l=e.ref(null),r=e.ref(null),{selectedValue:i,hiddenSelectedItemCount:c,isMultiItemArrayValue:a,firstItem:s}=se({props:e.toRefs(n),emit:o,dynamicVisibility:{elementToWatchForChanges:l,itemContainer:r}}),u=(g,m)=>g.name.toLocaleLowerCase().includes(m.toLocaleLowerCase());return(g,m)=>(e.openBlock(),e.createBlock(ae,{modelValue:e.unref(i),"onUpdate:modelValue":m[0]||(m[0]=d=>e.isRef(i)?i.value=d:null),multiple:t.multiple,items:t.items??e.unref(M.SourceApps),search:t.search,"search-placeholder":t.searchPlaceholder,label:t.label,"show-label":t.showLabel,name:t.name||"sourceApps","filter-predicate":u,by:"name"},{"nothing-selected":e.withCtx(()=>[t.selectorPlaceholder?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.selectorPlaceholder),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.multiple?"Select apps":"Select an app"),1)],64))]),"something-selected":e.withCtx(({value:d})=>[e.unref(a)(d)?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"elementToWatchForChanges",ref:l,class:"flex items-center space-x-0.5 h-5"},[e.createElementVNode("div",{ref_key:"itemContainer",ref:r,class:"flex flex-wrap overflow-hidden space-x-0.5 h-5"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d,h=>(e.openBlock(),e.createBlock(ie,{key:h.name,"source-app":h},null,8,["source-app"]))),128))],512),e.unref(c)>0?(e.openBlock(),e.createElementBlock("div",dn," +"+e.toDisplayString(e.unref(c)),1)):e.createCommentVNode("",!0)],512)):(e.openBlock(),e.createElementBlock("div",fn,[e.createElementVNode("div",{class:"h-2 w-2 rounded-full mr-2",style:e.normalizeStyle({backgroundColor:e.unref(s)(d).bgColor})},null,4),e.createElementVNode("span",mn,e.toDisplayString(e.unref(s)(d).name),1)]))]),option:e.withCtx(({item:d})=>[e.createElementVNode("div",pn,[e.createElementVNode("div",{class:"h-2 w-2 rounded-full mr-2",style:e.normalizeStyle({backgroundColor:d.bgColor})},null,4),e.createElementVNode("span",hn,e.toDisplayString(d.name),1)])]),_:1},8,["modelValue","multiple","items","search","search-placeholder","label","show-label","name"]))}});var T=(t=>(t.CtrlOrCmd="cmd-or-ctrl",t.AltOrOpt="alt-or-opt",t.Shift="shift",t))(T||{});const R=M.getClientOperatingSystem(),yn={["cmd-or-ctrl"]:R===M.OperatingSystem.Mac?"Cmd":"Ctrl",["alt-or-opt"]:R===M.OperatingSystem.Mac?"Opt":"Alt",shift:"Shift"};function kn(t){const o=n=>Object.values(T).includes(n);return t.map(n=>o(n)?yn[n]:n).join("+")}function vn(t,...o){A.onKeyDown(o[0],n=>{const l=n.getModifierState("Alt"),r=R===M.OperatingSystem.Mac?n.getModifierState("Meta"):n.getModifierState("Control"),i=n.getModifierState("Shift");for(const c of t)switch(c){case T.CtrlOrCmd:if(!r)return;break;case T.AltOrOpt:if(!l)return;break;case T.Shift:if(!i)return;break}o[1](n)},o[2])}const xn=e.createElementVNode("div",{class:"fixed inset-0 bg-neutral-100/70 dark:bg-neutral-900/70 transition-opacity"},null,-1),bn={class:"fixed inset-0 z-10 overflow-y-auto"},Cn={class:"flex min-h-full justify-center p-4 text-center items-center sm:p-0"},Bn={class:"relative"},wn=e.defineComponent({__name:"Dialog",props:{open:{type:Boolean},maxWidth:null,hideCloser:{type:Boolean},preventCloseOnClickOutside:{type:Boolean}},emits:["update:open","fully-closed"],setup(t,{emit:o}){const n=t,l=e.computed({get:()=>n.open,set:a=>o("update:open",a)}),r=e.computed(()=>{switch(n.maxWidth){case"sm":return 0;case"md":return 1;case"lg":return 2;case"xl":return 3;default:return 1e4}}),i=e.computed(()=>{const a=["px-4 pt-4 pb-4 w-full","sm:my-8 sm:w-full sm:max-w-xl sm:p-6"];return r.value>=1&&a.push("md:max-w-2xl"),r.value>=2&&a.push("lg:max-w-4xl"),r.value>=3&&a.push("xl:max-w-6xl"),r.value>=4&&a.push("2xl:max-w-7xl"),a.join(" ")}),c=()=>{n.preventCloseOnClickOutside||(l.value=!1)};return(a,s)=>(e.openBlock(),e.createBlock(e.unref(E.TransitionRoot),{as:"template",show:e.unref(l)},{default:e.withCtx(()=>[e.createVNode(e.unref(E.Dialog),{as:"div",class:"relative z-40",onClose:c},{default:e.withCtx(()=>[e.createVNode(e.unref(E.TransitionChild),{as:"template",enter:"ease-out duration-300","enter-from":"opacity-0","enter-to":"opacity-100",leave:"ease-in duration-200","leave-from":"opacity-100","leave-to":"opacity-0"},{default:e.withCtx(()=>[xn]),_:1}),e.createElementVNode("div",bn,[e.createElementVNode("div",Cn,[e.createVNode(e.unref(E.TransitionChild),{as:"template",enter:"ease-out duration-300","enter-from":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to":"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200","leave-from":"opacity-100 translate-y-0 sm:scale-100","leave-to":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",onAfterLeave:s[1]||(s[1]=u=>a.$emit("fully-closed"))},{default:e.withCtx(()=>[e.createVNode(e.unref(E.DialogPanel),{class:e.normalizeClass(["transform rounded-lg bg-foundation text-left shadow-xl transition-all",e.unref(i)])},{default:e.withCtx(()=>[e.createElementVNode("div",Bn,[e.renderSlot(a.$slots,"default",{},()=>[e.createTextVNode("Put your content here!")]),t.hideCloser?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"absolute top-0 right-0 text-foreground",onClick:s[0]||(s[0]=u=>l.value=!1)},[e.createVNode(e.unref(D.XMarkIcon),{class:"h-6 w-6"})]))])]),_:3},8,["class"])]),_:3})])])]),_:3})]),_:3},8,["show"]))}}),Vn={class:"inline-flex items-center space-x-2"},En={class:"label-light"},Nn=e.defineComponent({__name:"Disclosure",props:{title:null,icon:null,color:{default:"default"}},setup(t){const o=t,n=e.computed(()=>{const r=["pr-3 h-10 w-full flex items-center justify-between border-l-2 px-2 rounded transition","ring-1"];switch(o.color){case"danger":r.push("border-danger text-danger ring-danger-lighter hover:ring-danger");break;case"default":default:r.push("border-primary text-primary ring-primary-muted hover:ring-primary");break}return r.join(" ")}),l=e.computed(()=>{const r=["mt-4 px-3 py-1 border-x "];switch(o.color){case"danger":r.push("border-danger-lighter");break;case"default":default:r.push("border-primary-muted");break}return r.join(" ")});return(r,i)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(E.Disclosure),null,{default:e.withCtx(({open:c})=>[e.createVNode(e.unref(E.DisclosureButton),{class:e.normalizeClass(e.unref(n))},{default:e.withCtx(()=>[e.createElementVNode("div",Vn,[t.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.icon),{key:0,class:"h-4 w-4"})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.title),1)]),e.createVNode(e.unref(z.ChevronUpIcon),{class:e.normalizeClass([c?"":"rotate-180 transform","h-5 w-5"])},null,8,["class"])]),_:2},1032,["class"]),e.createVNode(e.unref(E.DisclosurePanel),{class:e.normalizeClass(e.unref(l))},{default:e.withCtx(()=>[e.createElementVNode("div",En,[e.renderSlot(r.$slots,"default",{},()=>[e.createTextVNode("Panel contents")])])]),_:3},8,["class"])]),_:3})]))}});var L=(t=>(t.Grid="grid",t.List="list",t))(L||{});const Sn=e.defineComponent({__name:"GridListToggle",props:{modelValue:null},emits:["click","update:modelValue"],setup(t,{emit:o}){const n=t,l=e.computed({get:()=>n.modelValue||L.Grid,set:c=>o("update:modelValue",c)}),r=e.computed(()=>l.value===L.Grid?z.Bars3Icon:z.Squares2X2Icon),i=c=>{o("click",c);const a=l.value===L.Grid?L.List:L.Grid;l.value=a};return(c,a)=>(e.openBlock(),e.createElementBlock("button",{class:"flex items-center justify-center rounded bg-foundation h-8 w-8 shadow cursor-pointer text-foreground",onClick:i},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(r)),{class:"h-6 w-6"}))]))}});var ce=(t=>(t[t.Throttle=0]="Throttle",t[t.Debounce=1]="Debounce",t))(ce||{}),q=(t=>(t[t.Left=0]="Left",t[t.Right=1]="Right",t))(q||{});function ue(t,o){if(!A.isClient)return;const{wait:n=100,throttleOrDebounce:l=0}=o||{},r=n?l===0?C.throttle(t,n):C.debounce(t,n):t;e.onMounted(()=>window.addEventListener("resize",r)),e.onBeforeUnmount(()=>window.removeEventListener("resize",r))}function $n(t){e.onMounted(()=>{window.addEventListener("beforeunload",t)}),e.onBeforeUnmount(()=>{window.removeEventListener("beforeunload",t)})}function de(t){const{el:o,defaultDirection:n}=t,l=e.ref(C.isUndefined(n)?1:n),r=e.computed(()=>{const c=e.unref(t.stopUpdatesBelowWidth);if(!C.isUndefined(c))return c;const a=e.unref(o);return a!=null&&a.offsetWidth?a.offsetWidth*2:void 0}),i=()=>{if(!A.isClient)return;const c=e.unref(o);if(!c)return;const a=c.getBoundingClientRect(),s=a.x+a.width>window.innerWidth,u=a.x<0;s&&u||!C.isUndefined(r.value)&&window.innerWidth<r.value||(s?l.value=0:u&&(l.value=1))};return ue(()=>i()),e.watch(()=>e.unref(o),c=>{c&&i()}),{direction:e.computed(()=>l.value),recalculateDirection:i}}const _n=["onClick"],In=e.defineComponent({__name:"Menu",props:{open:{type:Boolean},items:null},emits:["update:open","chosen"],setup(t,{emit:o}){const n=t,l=e.ref(null),{direction:r}=de({el:e.computed(()=>{var d;return((d=l.value)==null?void 0:d.el)||null}),defaultDirection:q.Left,stopUpdatesBelowWidth:300}),i=e.ref(null),c=e.ref(!1),a=e.computed({get:()=>n.open||!1,set:d=>o("update:open",d)}),s=d=>{const{active:h,disabled:x}=d,b=["group flex w-full items-center rounded-md px-2 py-2 text-sm"];return h?b.push("bg-primary text-foreground-on-primary"):x?b.push("text-foreground-disabled"):b.push("text-foreground"),b.join(" ")},u=(d,h)=>{o("chosen",{item:d,event:h})},g=()=>{var d;return(d=i.value)==null?void 0:d.el.click()},m=d=>{const h=!!d;return c.value=h,h};return e.watch(c,(d,h)=>{d!==h&&(a.value=d)}),e.watch(a,d=>{(d&&!c.value||!d&&c.value)&&g()}),(d,h)=>(e.openBlock(),e.createBlock(e.unref(E.Menu),{as:"div",class:"relative inline-block"},{default:e.withCtx(({open:x})=>[e.createElementVNode("div",null,[e.createVNode(e.unref(E.MenuButton),{ref_key:"menuButton",ref:i,class:"hidden",onClick:h[0]||(h[0]=e.withModifiers(()=>{},["stop","prevent"]))},null,512),e.createElementVNode("div",{class:e.normalizeClass(x?"pointer-events-none":"")},[e.renderSlot(d.$slots,"default",{toggle:g,open:m(x)})],2)]),e.createVNode(e.Transition,{"enter-active-class":"transition duration-100 ease-out","enter-from-class":"transform scale-95 opacity-0","enter-to-class":"transform scale-100 opacity-100","leave-active-class":"transition duration-75 ease-in","leave-from-class":"transform scale-100 opacity-100","leave-to-class":"transform scale-95 opacity-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.MenuItems),{ref_key:"menuItems",ref:l,class:e.normalizeClass(["absolute mt-2 w-56 origin-top-right divide-y divide-outline-3 rounded-md bg-foundation shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none z-40",e.unref(r)===e.unref(q).Left?"right-0":""])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(b,v)=>(e.openBlock(),e.createElementBlock("div",{key:v,class:"px-1 py-1"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b,k=>(e.openBlock(),e.createBlock(e.unref(E.MenuItem),{key:k.id,disabled:k.disabled},{default:e.withCtx(({active:y,disabled:_})=>[e.createElementVNode("button",{class:e.normalizeClass(s({active:y,disabled:_})),onClick:f=>u(k,f)},[e.renderSlot(d.$slots,"item",{item:k},()=>[e.createTextVNode(e.toDisplayString(k.title),1)])],10,_n)]),_:2},1032,["disabled"]))),128))]))),128))]),_:3},8,["class"])]),_:3})]),_:3}))}}),zn={class:"flex flex-col space-y-4"},Ln={class:"flex space-x-6"},Dn=e.defineComponent({__name:"Tabs",props:{items:null},setup(t){const o=t,n=e.ref(null),l=e.computed(()=>n.value&&o.items.find(i=>i.id===n.value)||o.items[0]),r=i=>{n.value=i.id};return(i,c)=>(e.openBlock(),e.createElementBlock("div",zn,[e.createElementVNode("div",Ln,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,a=>(e.openBlock(),e.createBlock(F,{key:a.id,link:"",color:e.unref(l).id===a.id?"default":"secondary",onClick:s=>r(a)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.title),1)]),_:2},1032,["color","onClick"]))),128))]),e.renderSlot(i.$slots,"default",{activeItem:e.unref(l)})]))}}),Pn={class:"w-full flex flex-col items-center my-2 space-y-2 mt-4"},jn={class:"inline-flex items-center space-x-1"},On=e.createElementVNode("span",{class:"text-foreground-2"},"That's it, you've loaded everything!",-1),Tn={class:"w-full flex flex-col items-center my-2 space-y-2 mt-4"},Mn={class:"inline-flex items-center space-x-1"},An=e.createElementVNode("span",{class:"text-foreground-2"},"An error occurred while loading",-1),Fn=e.defineComponent({__name:"InfiniteLoading",props:{settings:null,allowRetry:{type:Boolean}},emits:["infinite"],setup(t){const o=e.ref(null),n=e.ref(!1);return A.isClient&&e.onMounted(()=>{const l=setInterval(()=>{var r;(r=o.value)!=null&&r.isConnected&&(n.value=!0,clearInterval(l))},200)}),(l,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapper",ref:o},[n.value?(e.openBlock(),e.createBlock(e.unref(ge),e.mergeProps({key:0},l.$props.settings||{},{onInfinite:r[0]||(r[0]=i=>l.$emit("infinite",i))}),{spinner:e.withCtx(()=>[e.createVNode(X,{loading:!0,class:"my-2"})]),complete:e.withCtx(()=>[e.createElementVNode("div",Pn,[e.createElementVNode("div",jn,[e.createVNode(e.unref(D.CheckIcon),{class:"w-5 h-5 text-success"}),On])])]),error:e.withCtx(({retry:i})=>[e.createElementVNode("div",Tn,[e.createElementVNode("div",Mn,[e.createVNode(e.unref(D.ExclamationTriangleIcon),{class:"w-5 h-5 text-danger"}),An]),t.allowRetry?(e.openBlock(),e.createBlock(F,{key:0,onClick:i},{default:e.withCtx(()=>[e.createTextVNode("Retry")]),_:2},1032,["onClick"])):e.createCommentVNode("",!0)])]),_:1},16)):e.createCommentVNode("",!0)],512))}}),Rn={class:"relative group"},qn={key:0,class:"absolute -inset-1 bg-blue-300 dark:bg-blue-500 opacity-5 dark:opacity-0 rounded-md blur-sm group-hover:opacity-60 dark:group-hover:opacity-30 transition duration-500"},Un=e.defineComponent({__name:"Panel",props:{form:{type:Boolean,default:!1},ring:{type:Boolean,default:!1},fancyGlow:{type:Boolean,default:!1},customPadding:{type:Boolean,default:!1},noShadow:{type:Boolean,default:!1}},emits:["submit"],setup(t,{emit:o}){const n=t,l=e.computed(()=>n.customPadding?"":"px-4 py-4 sm:px-6"),r=e.computed(()=>n.customPadding?"":"px-4 py-4 sm:p-6"),i=e.computed(()=>{const c=["rounded-lg"];return n.noShadow||c.push("shadow"),n.ring&&c.push("ring-outline-2 hover:ring-2"),c.join(" ")});return(c,a)=>(e.openBlock(),e.createElementBlock("div",Rn,[t.fancyGlow?(e.openBlock(),e.createElementBlock("div",qn)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.form?"form":"div"),{class:e.normalizeClass(["relative divide-outline-3 bg-foundation text-foreground flex flex-col divide-y overflow-hidden",e.unref(i)]),onSubmit:a[0]||(a[0]=s=>o("submit",s))},{default:e.withCtx(()=>[c.$slots.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(l))},[e.renderSlot(c.$slots,"header")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["grow",e.unref(r)])},[e.renderSlot(c.$slots,"default")],2),c.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(l))},[e.renderSlot(c.$slots,"footer")],2)):e.createCommentVNode("",!0)]),_:3},40,["class"]))]))}}),Wn={class:"flex-shrink-0"},Hn={key:0,class:"mt-2 text-sm"},Gn=e.createElementVNode("span",{class:"sr-only"},"Dismiss",-1),Kn=e.defineComponent({__name:"Alert",props:{color:{default:"success"},withDismiss:{type:Boolean},actions:null},emits:["dismiss"],setup(t){const o=t,n=e.useSlots(),l=e.computed(()=>!!n.description),r=e.computed(()=>{const s=[];switch(s.push(l.value?"p-4":"p-2"),o.color){case"success":s.push("bg-success-lighter border-l-4 border-success");break;case"info":s.push("bg-info-lighter border-l-4 border-info");break;case"danger":s.push("bg-danger-lighter border-l-4 border-danger");break;case"warning":s.push("bg-warning-lighter border-l-4 border-warning");break}return s.join(" ")}),i=e.computed(()=>{const s=[];switch(o.color){case"success":s.push("text-success-darker");break;case"info":s.push("text-info-darker");break;case"danger":s.push("text-danger-darker");break;case"warning":s.push("text-warning-darker");break}return s.join(" ")}),c=e.computed(()=>{const s=[];switch(o.color){case"success":s.push("text-success");break;case"info":s.push("text-info");break;case"danger":s.push("text-danger");break;case"warning":s.push("text-warning");break}return s.join(" ")}),a=e.computed(()=>{const s=[];switch(o.color){case"success":s.push("bg-success-lighter ring-success");break;case"info":s.push("bg-info-lighter ring-info");break;case"danger":s.push("bg-danger-lighter ring-danger");break;case"warning":s.push("bg-warning-lighter ring-warning");break}return s.join(" ")});return(s,u)=>{var g;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["rounded-md",[e.unref(r),e.unref(i)]])},[e.createElementVNode("div",{class:e.normalizeClass(["flex",[e.unref(l)?"":"items-center space-x-2"]])},[e.createElementVNode("div",Wn,[e.createVNode(e.unref(I.CheckCircleIcon),{class:e.normalizeClass(["h-5 w-5",e.unref(c)]),"aria-hidden":"true"},null,8,["class"])]),e.createElementVNode("div",{class:e.normalizeClass(["ml-3 grow",[e.unref(l)?"":"flex items-center space-x-2"]])},[e.createElementVNode("h3",{class:e.normalizeClass(["text-sm",[e.unref(l)?"font-medium":""]])},[e.renderSlot(s.$slots,"title",{},()=>[e.createTextVNode("Title")])],2),e.unref(l)?(e.openBlock(),e.createElementBlock("div",Hn,[e.renderSlot(s.$slots,"description",{},()=>[e.createTextVNode(" Lorem ipsum dolor sit amet consectetur adipisicing elit. Aliquid pariatur, ipsum similique veniam. ")])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([e.unref(l)?(g=t.actions)!=null&&g.length?"mt-4":"":"grow flex"])},[e.createElementVNode("div",{class:e.normalizeClass(["flex",["space-x-2",e.unref(l)?"":"grow justify-end"]])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.actions||[],(m,d)=>(e.openBlock(),e.createBlock(F,{key:d,color:t.color,size:"sm",to:m.url,external:m.externalUrl||!1,onClick:h=>m.onClick||e.unref(C.noop)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.title),1)]),_:2},1032,["color","to","external","onClick"]))),128))],2)],2)],2),t.withDismiss?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex",[e.unref(l)?"items-start":"items-center"]])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["inline-flex rounded-md focus:outline-none focus:ring-2",e.unref(a)]),onClick:u[0]||(u[0]=m=>s.$emit("dismiss"))},[Gn,e.createVNode(e.unref(I.XMarkIcon),{class:"h-5 w-5","aria-hidden":"true"})],2)],2)):e.createCommentVNode("",!0)],2)],2)}}});exports.CommonAlert=Kn;exports.CommonBadge=ne;exports.CommonLoadingBar=X;exports.CommonStepsBullet=ut;exports.CommonStepsNumber=Je;exports.CommonTextLink=te;exports.FormButton=F;exports.FormCardButton=ft;exports.FormCheckbox=bt;exports.FormSelectBase=ae;exports.FormSelectSourceApps=gn;exports.FormTextArea=St;exports.FormTextInput=Ot;exports.GlobalToastRenderer=_e;exports.GridListToggleValue=L;exports.HorizontalDirection=q;exports.InfiniteLoading=Fn;exports.LayoutDialog=wn;exports.LayoutDisclosure=Nn;exports.LayoutGridListToggle=Sn;exports.LayoutMenu=In;exports.LayoutPanel=Un;exports.LayoutTabs=Dn;exports.ModifierKeys=T;exports.SourceAppBadge=ie;exports.TailwindBreakpoints=O;exports.ThrottleOrDebounce=ce;exports.ToastNotificationType=j;exports.ValidationHelpers=Wt;exports.clientOs=R;exports.getKeyboardShortcutTitle=kn;exports.onKeyboardShortcut=vn;exports.useFormSelectChildInternals=se;exports.useOnBeforeWindowUnload=$n;exports.useResponsiveHorizontalDirectionCalculation=de;exports.useWindowResizeHandler=ue;exports.useWrappingContainerHiddenCount=re;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),C=require("lodash"),z=require("@heroicons/vue/24/solid"),j=require("@heroicons/vue/24/outline"),_=require("@heroicons/vue/20/solid"),G=require("vee-validate"),K=require("nanoid"),F=require("@speckle/shared"),O=require("@vueuse/core"),S=require("@headlessui/vue"),oe=require("vue-tippy"),be=require("v3-infinite-loading");const xe={key:2,style:{margin:"0 !important",width:"0.01px"}},Ce=e.defineComponent({__name:"Button",props:{to:{type:String,required:!1,default:void 0},size:{type:String,default:"base"},fullWidth:{type:Boolean,default:!1},outlined:{type:Boolean,default:!1},rounded:{type:Boolean,default:!1},text:{type:Boolean,default:!1},link:{type:Boolean,default:!1},color:{type:String,default:"default"},external:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},submit:{type:Boolean,default:!1},iconLeft:{type:[Object,Function],default:null},iconRight:{type:[Object,Function],default:null},hideText:{type:Boolean,default:!1},linkComponent:{type:[Object,Function],default:null},loading:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:o}){const n=t,l=e.resolveDynamicComponent("NuxtLink"),a=e.resolveDynamicComponent("RouterLink"),i=e.computed(()=>n.linkComponent?n.linkComponent:n.external?"a":C.isObjectLike(l)?l:C.isObjectLike(a)?a:"a"),c=e.computed(()=>{if(!n.to)return n.submit?"submit":"button"}),s=e.computed(()=>n.disabled||n.loading),r=e.computed(()=>n.loading?z.ArrowPathIcon:n.iconLeft),u=e.computed(()=>{const f=[];if(f.push("border-2"),s.value)f.push(n.outlined?"border-foreground-disabled":"bg-foundation-disabled border-transparent");else switch(n.color){case"invert":f.push(n.outlined?"border-foundation dark:border-foreground":"bg-foundation dark:bg-foreground border-transparent");break;case"card":f.push(n.outlined?"border-foundation-2 shadow":"bg-foundation-2 dark:bg-foundation-2 border-foundation shadow");break;case"danger":f.push(n.outlined?"border-danger":"bg-danger border-danger");break;case"secondary":f.push(n.outlined?"border-foundation":"bg-foundation border-foundation-2");break;case"warning":f.push(n.outlined?"border-warning":"bg-warning border-warning");break;case"info":f.push(n.outlined?"border-info":"bg-info border-info");break;case"success":f.push(n.outlined?"border-success":"bg-success border-success");break;case"default":default:f.push(n.outlined?"border-primary hover:border-primary-focus":"bg-primary hover:bg-primary-focus border-transparent");break}return f.join(" ")}),g=e.computed(()=>{const f=[];if(!n.text&&!n.link)if(s.value)f.push((n.outlined,"text-foreground-disabled"));else switch(n.color){case"invert":f.push(n.outlined?"text-foundation dark:text-foreground":"text-primary");break;case"card":f.push((n.outlined,"text-foreground"));break;case"danger":f.push(n.outlined?"text-danger":"text-foundation dark:text-foreground");break;case"warning":f.push(n.outlined?"text-warning":"text-foundation dark:text-foreground");break;case"info":f.push(n.outlined?"text-info":"text-foundation dark:text-foreground");break;case"success":f.push(n.outlined?"text-success":"text-foundation dark:text-foreground");break;case"secondary":f.push((n.outlined,"text-foreground hover:text-primary"));break;case"default":default:f.push(n.outlined?"text-primary hover:text-primary-focus":"text-foundation dark:text-foreground");break}else s.value?f.push("text-foreground-disabled"):n.color==="invert"?f.push("text-foundation hover:text-foundation-2 dark:text-foreground dark:hover:text-foreground"):n.color==="secondary"?f.push("text-foreground-2 hover:text-primary-focus"):n.color==="success"?f.push("text-success"):n.color==="warning"?f.push("text-warning"):n.color==="info"?f.push("text-info"):n.color==="danger"?f.push("text-danger"):f.push("text-primary hover:text-primary-focus");return f.join(" ")}),m=e.computed(()=>{const f=[];return f.push(n.rounded?"rounded-full":"rounded-md"),f.join(" ")}),d=e.computed(()=>{const f=[];if(!s.value)switch(n.color){case"invert":f.push("hover:ring-4 ring-white/50");break;case"danger":f.push("hover:ring-4 ring-danger-lighter dark:ring-danger-darker");break;case"warning":f.push("hover:ring-4 ring-warning-lighter dark:ring-warning-darker");break;case"info":f.push("hover:ring-4 ring-info-lighter dark:ring-info-darker");break;case"success":f.push("hover:ring-4 ring-success-lighter dark:ring-success-darker");break;case"default":default:f.push("hover:ring-2");break}return f.join(" ")}),p=e.computed(()=>{switch(n.size){case"xs":return"h-5 text-xs font-medium xxx-tracking-wide";case"sm":return"h-6 text-sm font-medium xxx-tracking-wide";case"lg":return"h-10 text-lg font-semibold xxx-tracking-wide";case"xl":return"h-14 text-xl font-bold xxx-tracking-wide";default:case"base":return"h-8 text-base font-medium xxx-tracking-wide"}}),b=e.computed(()=>{switch(n.size){case"xs":return"px-1";case"sm":return"px-2";case"lg":return"px-4";case"xl":return"px-5";default:case"base":return"px-3"}}),x=e.computed(()=>{const f=[];return n.fullWidth&&f.push("w-full"),s.value&&f.push("cursor-not-allowed"),f.join(" ")}),y=e.computed(()=>{const f=[];return!s.value&&!n.link&&!n.text&&f.push("active:scale-[0.97]"),!s.value&&n.link&&f.push("underline decoration-transparent decoration-2 underline-offset-4 hover:decoration-inherit"),f.join(" ")}),k=e.computed(()=>{const f=n.link||n.text;return["transition inline-flex justify-center items-center space-x-2 outline-none select-none",x.value,p.value,g.value,f?"":u.value,f?"":m.value,f?"":d.value,n.link?"":b.value,y.value].join(" ")}),v=e.computed(()=>{const f=[""];switch(n.loading&&f.push("animate-spin"),n.size){case"xs":f.push("h-3 w-3");break;case"sm":f.push("h-4 w-4");break;case"lg":f.push("h-6 w-6");break;case"xl":f.push("h-8 w-8");break;case"base":default:f.push("h-5 w-5");break}return f.join(" ")}),$=f=>{if(s.value){f.preventDefault(),f.stopPropagation(),f.stopImmediatePropagation();return}o("click",f)};return(f,w)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.to?i.value:"button"),{href:t.to,to:t.to,type:c.value,external:t.external,class:e.normalizeClass(k.value),disabled:s.value,role:"button",onClick:$},{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:e.normalizeClass(`${v.value} ${t.hideText?"":"mr-2"}`)},null,8,["class"])):e.createCommentVNode("",!0),t.hideText?(e.openBlock(),e.createElementBlock("div",xe," ")):e.renderSlot(f.$slots,"default",{key:1},()=>[e.createTextVNode("Button")],!0),t.iconRight||!t.loading?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.iconRight),{key:3,class:e.normalizeClass(`${v.value} ${t.hideText?"":"ml-2"}`)},null,8,["class"])):e.createCommentVNode("",!0)]),_:3},8,["href","to","type","external","class","disabled"]))}});const le=(t,o)=>{const n=t.__vccOpts||t;for(const[l,a]of o)n[l]=a;return n},R=le(Ce,[["__scopeId","data-v-38aa371e"]]),ae=e.defineComponent({__name:"Link",props:{to:{type:String,required:!1,default:void 0},external:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1,default:void 0},size:{type:String,default:"base"},foregroundLink:{type:Boolean,default:!1},iconLeft:{type:[Object,Function],default:null},iconRight:{type:[Object,Function],default:null},hideText:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:o}){const n=t,l=a=>{if(n.disabled){a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation();return}o("click",a)};return(a,i)=>(e.openBlock(),e.createBlock(R,{link:"",to:t.to,external:t.external,disabled:t.disabled,size:t.size,"foreground-link":t.foregroundLink,"icon-left":t.iconLeft,"icon-right":t.iconRight,"hide-text":t.hideText,role:"link",onClickCapture:l},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createTextVNode("Link")])]),_:3},8,["to","external","disabled","size","foreground-link","icon-left","icon-right","hide-text"]))}});var T=(t=>(t[t.Success=0]="Success",t[t.Warning=1]="Warning",t[t.Danger=2]="Danger",t[t.Info=3]="Info",t))(T||{});const Be={"aria-live":"assertive",class:"pointer-events-none fixed inset-0 flex items-end px-4 py-6 mt-10 sm:items-start sm:p-6 z-50"},we={class:"flex w-full flex-col items-center space-y-4 sm:items-end"},Ve={key:0,class:"pointer-events-auto w-full max-w-sm overflow-hidden rounded-lg bg-foundation text-foreground shadow-lg ring-1 ring-primary-muted ring-opacity-5"},Ee={class:"p-4"},Se={class:"flex items-start"},Ne={class:"flex-shrink-0"},$e={class:"ml-2 w-0 flex-1 flex flex-col"},Ie={key:0,class:"text-foreground font-bold"},_e={key:1,class:"label label--light text-foreground-2"},ze={key:2,class:"flex justify-start mt-2"},Le=e.createElementVNode("span",{class:"sr-only"},"Close",-1),De=e.defineComponent({__name:"ToastRenderer",props:{notification:null},emits:["update:notification"],setup(t,{emit:o}){const n=t,l=e.computed(()=>{var c,s;return!((c=n.notification)!=null&&c.description)&&!((s=n.notification)!=null&&s.cta)}),a=()=>{o("update:notification",null)},i=c=>{var s,r,u;(u=(r=(s=n.notification)==null?void 0:s.cta)==null?void 0:r.onClick)==null||u.call(r,c),a()};return(c,s)=>(e.openBlock(),e.createElementBlock("div",Be,[e.createElementVNode("div",we,[e.createVNode(e.Transition,{"enter-active-class":"transform ease-out duration-300 transition","enter-from-class":"translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2","enter-to-class":"translate-y-0 opacity-100 sm:translate-x-0","leave-active-class":"transition ease-in duration-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[t.notification?(e.openBlock(),e.createElementBlock("div",Ve,[e.createElementVNode("div",Ee,[e.createElementVNode("div",Se,[e.createElementVNode("div",Ne,[t.notification.type===e.unref(T).Success?(e.openBlock(),e.createBlock(e.unref(j.CheckCircleIcon),{key:0,class:"h-6 w-6 text-success","aria-hidden":"true"})):t.notification.type===e.unref(T).Danger?(e.openBlock(),e.createBlock(e.unref(j.XCircleIcon),{key:1,class:"h-6 w-6 text-danger","aria-hidden":"true"})):t.notification.type===e.unref(T).Warning?(e.openBlock(),e.createBlock(e.unref(j.ExclamationCircleIcon),{key:2,class:"h-6 w-6 text-warning","aria-hidden":"true"})):t.notification.type===e.unref(T).Info?(e.openBlock(),e.createBlock(e.unref(j.InformationCircleIcon),{key:3,class:"h-6 w-6 text-info","aria-hidden":"true"})):e.createCommentVNode("",!0)]),e.createElementVNode("div",$e,[t.notification.title?(e.openBlock(),e.createElementBlock("p",Ie,e.toDisplayString(t.notification.title),1)):e.createCommentVNode("",!0),t.notification.description?(e.openBlock(),e.createElementBlock("p",_e,e.toDisplayString(t.notification.description),1)):e.createCommentVNode("",!0),t.notification.cta?(e.openBlock(),e.createElementBlock("div",ze,[e.createVNode(ae,{to:t.notification.cta.url,class:"label",primary:"",onClick:i},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.notification.cta.title),1)]),_:1},8,["to"])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["ml-4 flex flex-shrink-0",{"self-center":l.value}])},[e.createElementVNode("button",{type:"button",class:"inline-flex rounded-md bg-foundation text-foreground-2 hover:text-foreground focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",onClick:a},[Le,e.createVNode(e.unref(_.XMarkIcon),{class:"h-6 w-6","aria-hidden":"true"})])],2)])])])):e.createCommentVNode("",!0)]),_:1})])]))}}),Pe=e.createElementVNode("circle",{cx:"4",cy:"4",r:"3"},null,-1),je=[Pe],se=e.defineComponent({__name:"Badge",props:{size:null,colorClasses:null,dot:{type:Boolean},dotIconColorClasses:null,iconLeft:null,rounded:{type:Boolean},clickableIcon:{type:Boolean}},emits:["click-icon"],setup(t,{emit:o}){const n=t,l=e.computed(()=>n.colorClasses||"bg-blue-100 text-blue-800"),a=e.computed(()=>n.dotIconColorClasses||"text-blue-400"),i=e.computed(()=>{const u=["inline-flex items-center",l.value,n.size==="lg"?"px-3 py-0.5 label":"px-2.5 py-0.5 caption font-medium"];return n.rounded?(u.push("rounded"),u.push(n.size==="lg"?"px-2 py-0.5 label":"px-2.5 py-0.5 caption font-medium")):(u.push("rounded-full"),u.push(n.size==="lg"?"px-2.5 py-0.5 label":"px-2.5 py-0.5 caption font-medium")),u.join(" ")}),c=e.computed(()=>{const u=["mt-0.5 ml-0.5 inline-flex h-4 w-4 flex-shrink-0 items-center justify-center rounded-full focus:outline-none"];return n.clickableIcon?u.push("cursor-pointer"):u.push("cursor-default"),u.join(" ")}),s=e.computed(()=>["-ml-0.5 mr-1.5 h-2 w-2",a.value].join(" ")),r=u=>{if(!n.clickableIcon){u.stopPropagation(),u.stopImmediatePropagation(),u.preventDefault();return}o("click-icon",u)};return(u,g)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(i.value)},[t.dot?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(s.value),fill:"currentColor",viewBox:"0 0 8 8"},je,2)):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"default",{},()=>[e.createTextVNode("Badge")]),t.iconLeft?(e.openBlock(),e.createElementBlock("button",{key:1,class:e.normalizeClass(c.value),onClick:g[0]||(g[0]=m=>r(m))},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.iconLeft),{class:e.normalizeClass(["h-4 w-4",a.value])},null,8,["class"]))],2)):e.createCommentVNode("",!0)],2))}});let ne=[];function Oe(t){ne=ne?t:t.slice()}var M=(t=>(t[t.sm=640]="sm",t[t.md=746]="md",t[t.lg=1024]="lg",t[t.xl=1280]="xl",t[t["2xl"]=1536]="2xl",t))(M||{});function re(t){const{props:{modelValue:o,steps:n,orientation:l,goVerticalBelow:a,nonInteractive:i,stepsPadding:c},emit:s}=t,r=e.computed(()=>(l==null?void 0:l.value)==="vertical"?"vertical":"horizontal"),u=e.computed({get:()=>C.clamp((o==null?void 0:o.value)||0,-1,n.value.length),set:y=>s("update:modelValue",C.clamp(y,0,n.value.length))}),g=y=>`${y+1}`,m=y=>y===u.value,d=y=>y<u.value,p=(y,k)=>{var $;if(i!=null&&i.value){k==null||k.preventDefault(),k==null||k.stopPropagation(),k==null||k.stopImmediatePropagation();return}u.value=y;const v=n.value[u.value];($=v==null?void 0:v.onClick)==null||$.call(v)},b=e.computed(()=>{const y=["flex"];let k,v;return(c==null?void 0:c.value)==="xs"?(k="space-x-2",v="space-y-1"):(c==null?void 0:c.value)==="sm"?(k="space-x-4",v="space-y-1"):(k="space-x-8",v="space-y-4"),y.push("flex"),r.value==="vertical"||a!=null&&a.value?(y.push(`flex-col ${v} justify-center`),(a==null?void 0:a.value)===M.sm?y.push(`sm:flex-row sm:space-y-0 sm:justify-start sm:${k} sm:items-center`):(a==null?void 0:a.value)===M.md?y.push(`md:flex-row md:space-y-0 md:justify-start md:${k} md:items-center`):(a==null?void 0:a.value)===M.lg?y.push(`lg:flex-row lg:space-y-0 lg:justify-start lg:${k} lg:items-center`):(a==null?void 0:a.value)===M.xl&&y.push(`xl:flex-row xl:space-y-0 xl:justify-start xl:${k} xl:items-center`)):y.push(`flex-row ${k} items-center`),y.join(" ")}),x=e.computed(()=>{const y=["flex items-center"];return i!=null&&i.value||y.push("cursor-pointer"),y.join(" ")});return{value:u,isCurrentStep:m,isFinishedStep:d,switchStep:p,getStepDisplayValue:g,listClasses:b,linkClasses:x,orientation:r}}Oe(["sm:space-x-8","md:space-x-8","lg:space-x-8","xl:space-x-8","sm:space-x-2","md:space-x-2","lg:space-x-2","xl:space-x-2","sm:space-x-4","md:space-x-4","lg:space-x-4","xl:space-x-4"]);const Te=["aria-label"],Me=["href","onClick"],Ae={class:"flex space-x-3 items-center text-primary-focus normal font-medium leading-5"},Fe={class:"shrink-0 h-8 w-8 rounded-full bg-primary-focus text-foreground-on-primary inline-flex items-center justify-center"},Re={class:"flex flex-col"},qe={key:0,class:"label label--light text-foreground"},Ue=["href","onClick"],We={class:"flex space-x-3 items-center text-primary-focus normal font-medium leading-5"},He={class:"shrink-0 h-8 w-8 rounded-full border-2 border-primary-focus inline-flex items-center justify-center"},Ge={class:"flex flex-col"},Ke={key:0,class:"label label--light text-foreground"},Xe=["href","onClick"],Je={class:"flex space-x-3 items-center text-foreground-disabled normal font-medium leading-5"},Qe={class:"shrink-0 h-8 w-8 rounded-full border-2 border-foreground-disabled inline-flex items-center justify-center"},Ye={class:"flex flex-col"},Ze={key:0,class:"label label--light"},et=e.defineComponent({__name:"Number",props:{ariaLabel:null,orientation:null,steps:null,modelValue:null,goVerticalBelow:null,nonInteractive:{type:Boolean},stepsPadding:null},emits:["update:modelValue"],setup(t,{emit:o}){const n=t,{isCurrentStep:l,isFinishedStep:a,switchStep:i,getStepDisplayValue:c,listClasses:s,linkClasses:r}=re({props:e.toRefs(n),emit:o});return(u,g)=>(e.openBlock(),e.createElementBlock("nav",{class:"flex justify-center","aria-label":t.ariaLabel||"Progress steps"},[e.createElementVNode("ol",{class:e.normalizeClass(e.unref(s))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.steps,(m,d)=>(e.openBlock(),e.createElementBlock("li",{key:m.name},[e.unref(a)(d)?(e.openBlock(),e.createElementBlock("a",{key:0,href:m.href,class:e.normalizeClass(e.unref(r)),onClick:p=>e.unref(i)(d,p)},[e.createElementVNode("div",Ae,[e.createElementVNode("div",Fe,[e.createVNode(e.unref(_.CheckIcon),{class:"w-5 h-5"})]),e.createElementVNode("div",Re,[e.createElementVNode("div",null,e.toDisplayString(m.name),1),m.description?(e.openBlock(),e.createElementBlock("div",qe,e.toDisplayString(m.description),1)):e.createCommentVNode("",!0)])])],10,Me)):e.unref(l)(d)?(e.openBlock(),e.createElementBlock("a",{key:1,href:m.href,class:e.normalizeClass(e.unref(r)),"aria-current":"step",onClick:p=>e.unref(i)(d,p)},[e.createElementVNode("div",We,[e.createElementVNode("div",He,e.toDisplayString(e.unref(c)(d)),1),e.createElementVNode("div",Ge,[e.createElementVNode("div",null,e.toDisplayString(m.name),1),m.description?(e.openBlock(),e.createElementBlock("div",Ke,e.toDisplayString(m.description),1)):e.createCommentVNode("",!0)])])],10,Ue)):(e.openBlock(),e.createElementBlock("a",{key:2,href:m.href,class:e.normalizeClass(e.unref(r)),onClick:p=>e.unref(i)(d,p)},[e.createElementVNode("div",Je,[e.createElementVNode("div",Qe,e.toDisplayString(e.unref(c)(d)),1),e.createElementVNode("div",Ye,[e.createElementVNode("div",null,e.toDisplayString(m.name),1),m.description?(e.openBlock(),e.createElementBlock("div",Ze,e.toDisplayString(m.description),1)):e.createCommentVNode("",!0)])])],10,Xe))]))),128))],2)],8,Te))}}),tt=["aria-label"],nt=["href","onClick"],ot={class:"relative flex h-5 w-5 flex-shrink-0 items-center justify-center"},lt={key:0,class:"h-3 w-3 rounded-full bg-foreground-2"},at=["href","onClick"],st={class:"relative flex h-5 w-5 flex-shrink-0 items-center justify-center","aria-hidden":"true"},rt={key:0,class:"h-3 w-3 rounded-full bg-foreground"},it=e.createElementVNode("span",{class:"absolute h-4 w-4 rounded-full bg-outline-2"},null,-1),ct=e.createElementVNode("span",{class:"relative block h-2 w-2 rounded-full bg-primary-focus"},null,-1),ut=["href","onClick"],dt={class:"relative flex h-5 w-5 flex-shrink-0 items-center justify-center","aria-hidden":"true"},ft={key:0,class:"h-3 w-3 rounded-full bg-foreground-2"},mt={key:1,class:"h-4 w-4 rounded-full bg-foreground-disabled"},pt=e.defineComponent({__name:"Bullet",props:{ariaLabel:null,basic:{type:Boolean},orientation:null,steps:null,modelValue:null,goVerticalBelow:null,nonInteractive:{type:Boolean},stepsPadding:null},emits:["update:modelValue"],setup(t,{emit:o}){const n=t,{isCurrentStep:l,isFinishedStep:a,switchStep:i,listClasses:c,linkClasses:s}=re({props:e.toRefs(n),emit:o}),r=e.computed(()=>{const g=["h6 font-medium leading-7"];let m;return n.stepsPadding==="xs"?m="ml-1":n.stepsPadding==="sm"?m="ml-2":m="ml-3",g.push(m),n.basic&&g.push("sr-only"),g.join(" ")}),u=e.computed(()=>{const g=[];return n.basic&&g.push("basic"),g.join(" ")});return(g,m)=>(e.openBlock(),e.createElementBlock("nav",{class:"flex justify-center","aria-label":t.ariaLabel||"Progress steps"},[e.createElementVNode("ol",{class:e.normalizeClass([e.unref(c),u.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.steps,(d,p)=>(e.openBlock(),e.createElementBlock("li",{key:d.name},[e.unref(a)(p)?(e.openBlock(),e.createElementBlock("a",{key:0,href:d.href,class:e.normalizeClass(e.unref(s)),onClick:b=>e.unref(i)(p,b)},[e.createElementVNode("span",ot,[t.basic?(e.openBlock(),e.createElementBlock("span",lt)):(e.openBlock(),e.createBlock(e.unref(_.CheckCircleIcon),{key:1,class:"h-full w-full text-primary","aria-hidden":"true"}))]),e.createElementVNode("span",{class:e.normalizeClass(["text-foreground",r.value])},e.toDisplayString(d.name),3)],10,nt)):e.unref(l)(p)?(e.openBlock(),e.createElementBlock("a",{key:1,href:d.href,class:e.normalizeClass(e.unref(s)),"aria-current":"step",onClick:b=>e.unref(i)(p,b)},[e.createElementVNode("span",st,[t.basic?(e.openBlock(),e.createElementBlock("span",rt)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[it,ct],64))]),e.createElementVNode("span",{class:e.normalizeClass(["text-primary-focus",r.value])},e.toDisplayString(d.name),3)],10,at)):(e.openBlock(),e.createElementBlock("a",{key:2,href:d.href,class:e.normalizeClass(e.unref(s)),onClick:b=>e.unref(i)(p,b)},[e.createElementVNode("div",dt,[t.basic?(e.openBlock(),e.createElementBlock("span",ft)):(e.openBlock(),e.createElementBlock("div",mt))]),e.createElementVNode("p",{class:e.normalizeClass(["text-foreground-disabled",r.value])},e.toDisplayString(d.name),3)],10,ut))]))),128))],2)],8,tt))}}),ht=["disabled"],gt=e.defineComponent({__name:"CardButton",props:{disabled:{type:Boolean},modelValue:{type:Boolean}},emits:["update:modelValue","click"],setup(t,{emit:o}){const n=t,l=e.computed(()=>{const i=["h-20 bg-foundation-2 inline-flex justify-center items-center outline-none","normal px-16 py-5 shadow rounded transition active:scale-95"];return n.disabled?i.push("bg-foundation-disabled text-foreground-2 cursor-not-allowed"):(i.push(n.modelValue?"bg-primary-focus text-foreground-on-primary":"bg-foundation text-foreground"),i.push("ring-outline-2 hover:ring-4")),i.join(" ")}),a=i=>{if(n.disabled){i.preventDefault(),i.stopPropagation(),i.stopImmediatePropagation();return}o("update:modelValue",!n.modelValue),o("click",i)};return(i,c)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(l.value),disabled:t.disabled,onClick:a},[e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode("Text")])],10,ht))}}),vt={class:"relative flex items-start"},yt={class:"flex h-6 items-center"},kt=["id","checked","aria-describedby","name","value","disabled"],bt={class:"ml-2 text-sm",style:{"padding-top":"2px"}},xt=["for"],Ct={key:0,class:"text-danger ml-1"},Bt=["id"],wt=e.defineComponent({inheritAttrs:!1,__name:"Checkbox",props:{name:{type:String,required:!0},disabled:{type:Boolean,default:!1},label:{type:String,default:void 0},description:{type:String,default:void 0},inlineDescription:{type:Boolean,default:!1},rules:{type:[String,Object,Function,Array],default:void 0},validateOnMount:{type:Boolean,default:!1},showRequired:{type:Boolean,default:!1},modelValue:{type:[String,Boolean],default:void 0},value:{type:[String,Boolean],default:!0},id:{type:String,default:void 0},hideLabel:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t){const o=t,n=x=>`${x}-${K.nanoid()}`,l=e.computed(()=>o.value||o.name),{checked:a,errorMessage:i,handleChange:c}=G.useField(o.name,o.rules,{validateOnMount:o.validateOnMount,type:"checkbox",checkedValue:l,initialValue:o.modelValue||void 0}),s=x=>{o.disabled||c(x)},r=e.computed(()=>o.label||o.name),u=e.computed(()=>i.value?"border-danger-lighter":"border-foreground-4 "),g=e.computed(()=>o.description||i.value),m=e.computed(()=>`${o.name}-description`),d=e.computed(()=>{const x=[];return o.inlineDescription?x.push("inline ml-2"):x.push("block"),i.value?x.push("text-danger"):x.push("text-foreground-2"),x.join(" ")}),p=e.ref(n("checkbox")),b=e.computed(()=>o.id||p.value);return(x,y)=>(e.openBlock(),e.createElementBlock("div",vt,[e.createElementVNode("div",yt,[e.createElementVNode("input",e.mergeProps({id:b.value,checked:e.unref(a),"aria-describedby":m.value,name:t.name,value:l.value,disabled:t.disabled,type:"checkbox",class:["h-4 w-4 rounded text-primary focus:ring-primary bg-foundation disabled:cursor-not-allowed disabled:bg-disabled disabled:text-disabled-2",u.value]},x.$attrs,{onChange:s}),null,16,kt)]),e.createElementVNode("div",bt,[e.createElementVNode("label",{for:b.value,class:e.normalizeClass(["font-medium text-foreground",{"sr-only":t.hideLabel}])},[e.createElementVNode("span",null,e.toDisplayString(r.value),1),t.showRequired?(e.openBlock(),e.createElementBlock("span",Ct,"*")):e.createCommentVNode("",!0)],10,xt),g.value?(e.openBlock(),e.createElementBlock("p",{key:0,id:m.value,class:e.normalizeClass(d.value)},e.toDisplayString(g.value),11,Bt)):e.createCommentVNode("",!0)])]))}});function ie(t){const{props:o,inputEl:n,emit:l}=t,{value:a,errorMessage:i}=G.useField(o.name,o.rules,{validateOnMount:e.unref(o.validateOnMount),validateOnValueUpdate:e.unref(o.validateOnValueUpdate),initialValue:e.unref(o.modelValue)||void 0}),c=e.computed(()=>{const v=["block label text-foreground-2 mb-2"];return e.unref(o.showLabel)||v.push("sr-only"),v.join(" ")}),s=e.computed(()=>{const v=["block w-full rounded focus:outline-none text-foreground transition-all","disabled:cursor-not-allowed disabled:bg-foundation-disabled disabled:text-disabled-muted","placeholder:text-foreground-2"];return i.value?v.push("border-2 border-danger text-danger-darker focus:border-danger focus:ring-danger"):v.push("border-0 focus:ring-2 focus:ring-outline-2"),e.unref(o.color)==="foundation"?v.push("bg-foundation shadow-sm hover:shadow"):v.push("bg-foundation-page"),v.join(" ")}),r=e.ref(K.nanoid()),u=e.computed(()=>e.unref(o.label)||e.unref(o.name)),g=e.computed(()=>{const v=i.value;return!v||!e.unref(o.useLabelInErrors)?v:v.replace("Value",u.value)}),m=e.computed(()=>g.value&&e.unref(o.hideErrorMessage)),d=e.computed(()=>g.value||e.unref(o.help)),p=e.computed(()=>!!d.value),b=e.computed(()=>p.value?`${e.unref(o.name)}-${r.value}`:void 0),x=e.computed(()=>{const v=["mt-2 text-sm"];return v.push(i.value?"text-danger":"text-foreground-2"),v.join(" ")}),y=()=>{var v;(v=n.value)==null||v.focus()},k=()=>{a.value="",l("change",{value:""}),l("clear")};return e.onMounted(()=>{e.unref(o.autoFocus)&&y()}),{coreClasses:s,title:u,value:a,helpTipId:b,helpTipClasses:x,helpTip:d,hideHelpTip:m,errorMessage:g,clear:k,focus:y,labelClasses:c}}const Vt=["for"],Et={class:"relative"},St=["id","name","placeholder","disabled","aria-invalid","aria-describedby"],Nt=e.createElementVNode("span",{class:"text-xs sr-only"},"Clear input",-1),$t={key:2,class:"pointer-events-none absolute inset-y-0 mt-3 text-4xl right-0 flex items-center pr-2 text-danger opacity-50"},It=["id"],_t=e.defineComponent({__name:"TextArea",props:{name:null,showLabel:{type:Boolean},help:null,placeholder:null,label:null,disabled:{type:Boolean},rules:null,validateOnMount:{type:Boolean},validateOnValueUpdate:{type:Boolean},useLabelInErrors:{type:Boolean,default:!0},autoFocus:{type:Boolean},modelValue:{default:""},showClear:{type:Boolean},fullWidth:{type:Boolean},showRequired:{type:Boolean},color:{default:"page"}},emits:["update:modelValue","change","input","clear"],setup(t,{expose:o,emit:n}){const l=t,a=e.ref(null),{coreClasses:i,title:c,value:s,helpTipId:r,helpTipClasses:u,helpTip:g,errorMessage:m,labelClasses:d,clear:p,focus:b}=ie({props:e.toRefs(l),emit:n,inputEl:a}),x=e.computed(()=>{const y=["pl-2"];return l.showClear&&m.value?y.push("pr-12"):(l.showClear||m.value)&&y.push("pr-8"),y.join(" ")});return o({focus:b}),(y,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.fullWidth?"w-full":""])},[e.createElementVNode("label",{for:t.name,class:e.normalizeClass(e.unref(d))},[e.createElementVNode("span",null,e.toDisplayString(e.unref(c)),1)],10,Vt),e.createElementVNode("div",Et,[e.withDirectives(e.createElementVNode("textarea",e.mergeProps({id:t.name,ref_key:"inputElement",ref:a,"onUpdate:modelValue":k[0]||(k[0]=v=>e.isRef(s)?s.value=v:null),name:t.name,class:[e.unref(i),x.value,"min-h-[4rem]"],placeholder:t.placeholder,disabled:t.disabled,"aria-invalid":e.unref(m)?"true":"false","aria-describedby":e.unref(r)},y.$attrs,{onChange:k[1]||(k[1]=v=>y.$emit("change",{event:v,value:e.unref(s)})),onInput:k[2]||(k[2]=v=>y.$emit("input",{event:v,value:e.unref(s)}))}),null,16,St),[[e.vModelText,e.unref(s)]]),t.showClear?(e.openBlock(),e.createElementBlock("a",{key:0,title:"Clear input",class:"absolute top-2 right-0 flex items-center pr-2 cursor-pointer",onClick:k[3]||(k[3]=(...v)=>e.unref(p)&&e.unref(p)(...v)),onKeydown:k[4]||(k[4]=(...v)=>e.unref(p)&&e.unref(p)(...v))},[Nt,e.createVNode(e.unref(_.XMarkIcon),{class:"h-5 w-5 text-foreground","aria-hidden":"true"})],32)):e.createCommentVNode("",!0),e.unref(m)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["pointer-events-none absolute inset-y-0 right-0 flex items-center",t.showClear?"pr-8":"pr-2"])},[e.createVNode(e.unref(_.ExclamationCircleIcon),{class:"h-4 w-4 text-danger","aria-hidden":"true"})],2)):e.createCommentVNode("",!0),t.showRequired&&!e.unref(m)?(e.openBlock(),e.createElementBlock("div",$t," * ")):e.createCommentVNode("",!0)]),e.unref(r)?(e.openBlock(),e.createElementBlock("p",{key:0,id:e.unref(r),class:e.normalizeClass(e.unref(u))},e.toDisplayString(e.unref(g)),11,It)):e.createCommentVNode("",!0)],2))}}),zt=["for"],Lt={class:"relative"},Dt={key:0,class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2"},Pt=["id","type","name","placeholder","disabled","aria-invalid","aria-describedby"],jt=e.createElementVNode("span",{class:"text-xs sr-only"},"Clear input",-1),Ot={key:2,class:"pointer-events-none absolute inset-y-0 mt-3 text-4xl right-0 flex items-center pr-2 text-danger opacity-50"},Tt=["id"],Mt=e.defineComponent({inheritAttrs:!1,__name:"TextInput",props:{type:{type:String,default:"text"},name:{type:String,required:!0},showLabel:{type:Boolean,required:!1},help:{type:String,default:void 0},placeholder:{type:String,default:void 0},label:{type:String,default:void 0},showRequired:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},rules:{type:[String,Object,Function,Array],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnValueUpdate:{type:Boolean,default:!1},useLabelInErrors:{type:Boolean,default:!0},customIcon:{type:[Object,Function],default:void 0},autoFocus:{type:Boolean,default:!1},modelValue:{type:String,default:""},size:{type:String,default:"base"},showClear:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1},inputClasses:{type:String,default:null},hideErrorMessage:{type:Boolean,default:!1},wrapperClasses:{type:String,default:()=>""},color:{type:String,default:"page"}},emits:["update:modelValue","change","input","clear","focusin","focusout"],setup(t,{expose:o,emit:n}){const l=t,a=e.useSlots(),i=e.ref(null),{coreClasses:c,title:s,value:r,helpTipId:u,helpTipClasses:g,helpTip:m,hideHelpTip:d,errorMessage:p,clear:b,focus:x,labelClasses:y}=ie({props:e.toRefs(l),emit:n,inputEl:i}),k=e.computed(()=>{const w=["h-5 w-5"];return p.value?w.push("text-danger"):w.push("text-foreground-2"),w.join(" ")}),v=e.computed(()=>["email","password"].includes(l.type)||l.customIcon),$=e.computed(()=>{const w=[];return v.value?w.push("pl-8"):w.push("pl-2"),a["input-right"]||(p.value||l.showClear)&&(p.value&&l.showClear?w.push("pr-12"):w.push("pr-8")),w.join(" ")}),f=e.computed(()=>{switch(l.size){case"sm":return"h-6";case"lg":return"h-10";case"xl":return"h-14";case"base":default:return"h-8"}});return o({focus:x}),(w,V)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([t.fullWidth?"w-full":"",t.wrapperClasses])},[e.createElementVNode("label",{for:t.name,class:e.normalizeClass(e.unref(y))},[e.createElementVNode("span",null,e.toDisplayString(e.unref(s)),1)],10,zt),e.createElementVNode("div",Lt,[v.value?(e.openBlock(),e.createElementBlock("div",Dt,[t.customIcon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.customIcon),{key:0,class:e.normalizeClass(k.value),"aria-hidden":"true"},null,8,["class"])):t.type==="email"?(e.openBlock(),e.createBlock(e.unref(_.EnvelopeIcon),{key:1,class:e.normalizeClass(k.value),"aria-hidden":"true"},null,8,["class"])):t.type==="password"?(e.openBlock(),e.createBlock(e.unref(_.KeyIcon),{key:2,class:e.normalizeClass(k.value),"aria-hidden":"true"},null,8,["class"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:t.name,ref_key:"inputElement",ref:i,"onUpdate:modelValue":V[0]||(V[0]=N=>e.isRef(r)?r.value=N:null),type:t.type,name:t.name,class:[e.unref(c),$.value,f.value,t.inputClasses||""],placeholder:t.placeholder,disabled:t.disabled,"aria-invalid":e.unref(p)?"true":"false","aria-describedby":e.unref(u),role:"textbox"},w.$attrs,{onChange:V[1]||(V[1]=N=>w.$emit("change",{event:N,value:e.unref(r)})),onInput:V[2]||(V[2]=N=>w.$emit("input",{event:N,value:e.unref(r)}))}),null,16,Pt),[[e.vModelDynamic,e.unref(r)]]),e.renderSlot(w.$slots,"input-right",{},()=>[t.showClear?(e.openBlock(),e.createElementBlock("a",{key:0,title:"Clear input",class:"absolute inset-y-0 right-0 flex items-center pr-2 cursor-pointer",onClick:V[3]||(V[3]=(...N)=>e.unref(b)&&e.unref(b)(...N)),onKeydown:V[4]||(V[4]=(...N)=>e.unref(b)&&e.unref(b)(...N))},[jt,e.createVNode(e.unref(_.XMarkIcon),{class:"h-5 w-5 text-foreground","aria-hidden":"true"})],32)):e.createCommentVNode("",!0),e.unref(p)?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["pointer-events-none absolute inset-y-0 right-0 flex items-center",t.showClear?"pr-8":"pr-2"])},[e.createVNode(e.unref(_.ExclamationCircleIcon),{class:"h-4 w-4 text-danger","aria-hidden":"true"})],2)):e.createCommentVNode("",!0),t.showRequired&&!e.unref(p)?(e.openBlock(),e.createElementBlock("div",Ot," * ")):e.createCommentVNode("",!0)])]),e.unref(u)&&!e.unref(d)?(e.openBlock(),e.createElementBlock("p",{key:0,id:e.unref(u),class:e.normalizeClass(e.unref(g))},e.toDisplayString(e.unref(m)),11,Tt)):e.createCommentVNode("",!0)],2))}}),At=/^https?:\/\//,X=/^[\w-_.+]+@[\w-_.+]+$/,Ft=t=>(t||"").match(X)?!0:"Value should be a valid e-mail address",Rt=t=>(t||"").split(",").map(l=>l.trim()).every(l=>l.match(X))||"Value should be one or multiple comma-delimited e-mail addresses",qt=t=>(C.isString(t)&&(t=t.trim()),t?!0:"Value is required"),Ut=(t,o)=>(n,l)=>n===l.form[t]?!0:`Value must be the same as in field '${o||t}'`,Wt=t=>o=>{const{minLength:n,maxLength:l}=t;return o=F.isNullOrUndefined(o)?"":o,C.isString(o)?!C.isUndefined(n)&&o.length<n?`Value needs to be at least ${n} characters long`:!C.isUndefined(l)&&o.length>l?`Value needs to be no more than ${l} characters long`:!0:"Value should be a text string"},Ht=t=>o=>{const{match:n,message:l}=t;return C.isString(o)?n?C.isString(n)?o.includes(n)?!0:l:n.test(o)?!0:l:!0:"Value should be a text string"},Gt=Object.freeze(Object.defineProperty({__proto__:null,VALID_EMAIL:X,VALID_HTTP_URL:At,isEmail:Ft,isOneOrMultipleEmails:Rt,isRequired:qt,isSameAs:Ut,isStringOfLength:Wt,stringContains:Ht},Symbol.toStringTag,{value:"Module"}));function ce(t){const{skipCalculation:o,elementToWatchForChanges:n,itemContainer:l,trackResize:a=!1,trackMutations:i=!0}=t||{},c=e.ref(0),s=()=>{const r=l.value;if(o!=null&&o.value||!r)return;const u=r.children;let g=0,m=0,d;for(const p of u){const b=p.offsetTop;C.isUndefined(d)?(d=b,g+=1):b===d&&(g+=1),m+=1}c.value=m-g};return a&&O.useResizeObserver(n,s),i&&O.useMutationObserver(n,s,{childList:!0,subtree:!0}),{hiddenItemCount:c}}function ue(t){const{props:o,emit:n,dynamicVisibility:l}=t;let a;if(l){const{elementToWatchForChanges:u,itemContainer:g}=l;a=ce({skipCalculation:e.computed(()=>{var d;return!((d=o.multiple)!=null&&d.value)}),elementToWatchForChanges:u,itemContainer:g}).hiddenItemCount}else a=e.ref(0);const i=e.computed({get:()=>{var g,m;const u=(g=o.modelValue)==null?void 0:g.value;return(m=o.multiple)!=null&&m.value?C.isArray(u)?u:[]:C.isArray(u)?void 0:u},set:u=>{var g,m,d;if((g=o.multiple)!=null&&g.value&&!C.isArray(u)){console.warn("Attempting to set non-array value in selector w/ multiple=true");return}else if(!((m=o.multiple)!=null&&m.value)&&C.isArray(u)){console.warn("Attempting to set array value in selector w/ multiple=false");return}n("update:modelValue",(d=o.multiple)!=null&&d.value?u||[]:u)}}),c=u=>C.isArray(u);return{selectedValue:i,hiddenSelectedItemCount:a,isArrayValue:c,isMultiItemArrayValue:u=>C.isArray(u)&&u.length>1,firstItem:u=>c(u)?u[0]:u}}const Kt=t=>(e.pushScopeId("data-v-60cf597b"),t=t(),e.popScopeId(),t),Xt=Kt(()=>e.createElementVNode("div",{class:"swoosher relative top-0 bg-blue-500/50"},null,-1)),Jt=[Xt],Qt=e.defineComponent({__name:"Bar",props:{loading:{type:Boolean}},setup(t){return(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative w-full h-1 bg-blue-500/30 text-xs text-foreground-on-primary overflow-hidden rounded-xl",t.loading?"opacity-100":"opacity-0"])},Jt,2))}});const J=le(Qt,[["__scopeId","data-v-60cf597b"]]),Yt={class:"flex items-center justify-between w-full"},Zt={class:"block truncate grow text-left"},en={class:"pointer-events-none shrink-0 ml-1 flex items-center"},tn=["disabled"],nn={key:0,class:"flex flex-col mx-1 mb-1"},on=e.createElementVNode("span",{class:"sr-only label text-foreground"},"Search",-1),ln={class:"relative"},an={class:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-2"},sn=["placeholder"],rn={key:0,class:"px-1"},cn={key:1},un=e.createElementVNode("div",{class:"text-foreground-2 text-center"},"Nothing found 🤷♂️",-1),dn={class:e.normalizeClass(["block truncate"])},fn=["id"],de=e.defineComponent({__name:"Base",props:{multiple:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},modelValue:{type:[Object,Array,String],default:void 0},search:{type:Boolean,default:!1},filterPredicate:{type:Function,default:void 0},disabledItemPredicate:{type:Function,default:void 0},getSearchResults:{type:Function,default:void 0},searchPlaceholder:{type:String,default:"Search"},label:{type:String,required:!0},showLabel:{type:Boolean,default:!1},name:{type:String,required:!0},by:{type:String,required:!1},disabled:{type:Boolean,default:!1},buttonStyle:{type:String,default:"base"},hideCheckmarks:{type:Boolean,default:!1},allowUnset:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},rules:{type:[String,Object,Function,Array],default:void 0},validateOnMount:{type:Boolean,default:!1},validateOnValueUpdate:{type:Boolean,default:!1},useLabelInErrors:{type:Boolean,default:!0},help:{type:String,default:void 0},fixedHeight:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{expose:o}){const n=t,{value:l,errorMessage:a}=G.useField(n.name,n.rules,{validateOnMount:n.validateOnMount,validateOnValueUpdate:n.validateOnValueUpdate,initialValue:n.modelValue}),i=e.ref(null),c=e.ref(""),s=e.ref([]),r=e.ref(!1),u=e.ref(K.nanoid()),g=e.computed(()=>e.unref(n.label)||e.unref(n.name)),m=e.computed(()=>{const h=a.value;return!h||!e.unref(n.useLabelInErrors)?h:h.replace("Value",g.value)}),d=e.computed(()=>m.value||e.unref(n.help)),p=e.computed(()=>!!d.value),b=e.computed(()=>p.value?`${e.unref(n.name)}-${u.value}`:void 0),x=e.computed(()=>a.value?"text-danger":"text-foreground-2"),y=e.computed(()=>n.buttonStyle!=="simple"&&n.clearable&&!n.disabled),k=e.computed(()=>{const h=["relative flex group"];return n.buttonStyle!=="simple"&&(h.push("hover:shadow rounded-md"),h.push("outline outline-2 outline-primary-muted")),n.fixedHeight&&h.push("h-8"),h.join(" ")}),v=e.computed(()=>{const h=[];return n.buttonStyle!=="simple"&&h.push(N.value?"bg-foundation-disabled text-foreground-disabled":""),N.value&&h.push("cursor-not-allowed"),h.join(" ")}),$=e.computed(()=>{const h=["relative z-[1]","flex items-center justify-center text-center shrink-0","rounded-r-md overflow-hidden transition-all","text-foreground",Q.value?`w-6 ${v.value}`:"w-0"];return N.value||(h.push("hover:bg-primary hover:text-foreground-on-primary dark:text-foreground-on-primary"),n.buttonStyle==="tinted"?h.push("bg-outline-3"):h.push("bg-primary-muted")),h.join(" ")}),f=e.computed(()=>{const h=["relative z-[2]","normal rounded-md cursor-pointer transition truncate flex-1","flex items-center",v.value];return n.buttonStyle!=="simple"&&(h.push("py-2 px-3"),N.value||(n.buttonStyle==="tinted"?h.push("bg-foundation-page text-foreground"):h.push("bg-foundation text-foreground"))),y.value&&Q.value&&h.push("rounded-r-none"),h.join(" ")}),w=e.computed(()=>!!(n.search&&(n.filterPredicate||n.getSearchResults))),V=e.computed(()=>w.value&&n.getSearchResults),N=e.computed(()=>n.disabled||!n.items.length&&!V.value),I=e.computed({get:()=>{const h=l.value;return n.multiple?C.isArray(h)?h:[]:C.isArray(h)?void 0:h},set:h=>{if(n.multiple&&!C.isArray(h)){console.warn("Attempting to set non-array value in selector w/ multiple=true");return}else if(!n.multiple&&C.isArray(h)){console.warn("Attempting to set array value in selector w/ multiple=false");return}if(n.multiple)l.value=h||[];else{const E=l.value,B=n.allowUnset&&E&&h&&W(E)===W(h);l.value=B?void 0:h}}}),Q=e.computed(()=>n.multiple?I.value.length!==0:!!I.value),ge=()=>{n.multiple?I.value=[]:I.value=void 0},ve=e.computed(()=>{const h=c.value;return!w.value||!(h!=null&&h.length)?s.value:n.filterPredicate?s.value.filter(E=>{var B;return((B=n.filterPredicate)==null?void 0:B.call(n,E,h))||!1}):s.value}),Y=h=>JSON.stringify(h),W=h=>n.by?h[n.by]:h,H=async()=>{if(!(!V.value||!n.getSearchResults)){r.value=!0;try{s.value=await n.getSearchResults(c.value)}finally{r.value=!1}}},ye=C.debounce(H,1e3),ke=h=>{const{active:E,disabled:B}=h||{},{hideCheckmarks:L}=n,D=["relative transition cursor-pointer select-none py-1.5 pl-3",L?"":"pr-9"];return B?D.push("opacity-50 cursor-not-allowed"):D.push(E?"text-primary":"text-foreground"),D.join(" ")};return e.watch(()=>n.items,h=>{s.value=h.slice()},{immediate:!0}),e.watch(c,()=>{V.value&&ye()}),e.onMounted(()=>{V.value&&!n.items.length&&H()}),o({triggerSearch:H}),(h,E)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(S.Listbox),{modelValue:I.value,"onUpdate:modelValue":E[4]||(E[4]=B=>I.value=B),name:t.name,multiple:t.multiple,by:t.by,disabled:N.value,as:"div"},{default:e.withCtx(()=>[e.createVNode(e.unref(S.ListboxLabel),{class:e.normalizeClass(["block label text-foreground-2 mb-2",{"sr-only":!t.showLabel}])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["class"]),e.createElementVNode("div",{class:e.normalizeClass(k.value)},[e.createVNode(e.unref(S.ListboxButton),{class:e.normalizeClass(f.value)},{default:e.withCtx(({open:B})=>[e.createElementVNode("div",Yt,[e.createElementVNode("div",Zt,[!I.value||e.unref(C.isArray)(I.value)&&!I.value.length?e.renderSlot(h.$slots,"nothing-selected",{key:0},()=>[e.createTextVNode(e.toDisplayString(t.label),1)]):e.renderSlot(h.$slots,"something-selected",{key:1,value:I.value},()=>[e.createTextVNode(e.toDisplayString(Y(I.value)),1)])]),e.createElementVNode("div",en,[B?(e.openBlock(),e.createBlock(e.unref(z.ChevronUpIcon),{key:0,class:"h-4 w-4 text-foreground","aria-hidden":"true"})):(e.openBlock(),e.createBlock(e.unref(z.ChevronDownIcon),{key:1,class:"h-4 w-4 text-foreground","aria-hidden":"true"}))])])]),_:3},8,["class"]),y.value?e.withDirectives((e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass($.value),disabled:t.disabled,onClick:E[0]||(E[0]=B=>ge())},[e.createVNode(e.unref(z.XMarkIcon),{class:"w-3 h-3"})],10,tn)),[[e.unref(oe.directive),"Clear"]]):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"leave-active-class":"transition ease-in duration-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(S.ListboxOptions),{class:"absolute top-[100%] z-10 mt-1 w-full rounded-md bg-foundation-2 py-1 label label--light outline outline-2 outline-primary-muted focus:outline-none shadow",onFocus:E[3]||(E[3]=B=>{var L;return(L=i.value)==null?void 0:L.focus()})},{default:e.withCtx(()=>[w.value?(e.openBlock(),e.createElementBlock("label",nn,[on,e.createElementVNode("div",ln,[e.createElementVNode("div",an,[e.createVNode(e.unref(z.MagnifyingGlassIcon),{class:"h-5 w-5 text-foreground"})]),e.withDirectives(e.createElementVNode("input",{ref_key:"searchInput",ref:i,"onUpdate:modelValue":E[1]||(E[1]=B=>c.value=B),type:"text",class:"pl-9 w-full border-0 bg-foundation-page rounded placeholder:font-normal normal placeholder:text-foreground-2 focus:outline-none focus:ring-1 focus:border-outline-1 focus:ring-outline-1",placeholder:t.searchPlaceholder,onKeydown:E[2]||(E[2]=e.withModifiers(()=>{},["stop"]))},null,40,sn),[[e.vModelText,c.value]])])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["overflow-auto simple-scrollbar",[w.value?"max-h-52":"max-h-60"]])},[V.value&&r.value?(e.openBlock(),e.createElementBlock("div",rn,[e.createVNode(J,{loading:!0})])):V.value&&!s.value.length?(e.openBlock(),e.createElementBlock("div",cn,[e.renderSlot(h.$slots,"nothing-found",{},()=>[un])])):e.createCommentVNode("",!0),!V.value||!r.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(ve.value,B=>{var L;return e.openBlock(),e.createBlock(e.unref(S.ListboxOption),{key:W(B),value:B,disabled:((L=t.disabledItemPredicate)==null?void 0:L.call(t,B))||!1},{default:e.withCtx(({active:D,selected:Z})=>{var ee,te;return[e.createElementVNode("li",{class:e.normalizeClass(ke({active:D,disabled:((ee=t.disabledItemPredicate)==null?void 0:ee.call(t,B))||!1}))},[e.createElementVNode("span",dn,[e.renderSlot(h.$slots,"option",{item:B,active:D,selected:Z,disabled:((te=t.disabledItemPredicate)==null?void 0:te.call(t,B))||!1},()=>[e.createTextVNode(e.toDisplayString(Y(B)),1)])]),!t.hideCheckmarks&&Z?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([D?"text-primary":"text-foreground","absolute inset-y-0 right-0 flex items-center pr-4"])},[e.createVNode(e.unref(z.CheckIcon),{class:"h-5 w-5","aria-hidden":"true"})],2)):e.createCommentVNode("",!0)],2)]}),_:2},1032,["value","disabled"])}),128)):e.createCommentVNode("",!0)],2)]),_:3})]),_:3})],2)]),_:3},8,["modelValue","name","multiple","by","disabled"]),b.value?(e.openBlock(),e.createElementBlock("p",{key:0,id:b.value,class:e.normalizeClass(["mt-2 text-sm",x.value])},e.toDisplayString(d.value),11,fn)):e.createCommentVNode("",!0)]))}}),fe=e.defineComponent({__name:"SourceAppBadge",props:{sourceApp:null},setup(t){return(o,n)=>(e.openBlock(),e.createBlock(se,{"color-classes":"text-foreground-on-primary",rounded:"",style:e.normalizeStyle({backgroundColor:t.sourceApp.bgColor})},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.sourceApp.short),1)]),_:1},8,["style"]))}}),mn={key:0,class:"text-foreground-2 normal"},pn={key:1,class:"flex items-center"},hn={class:"truncate"},gn={class:"flex items-center"},vn={class:"truncate"},yn=e.defineComponent({__name:"SourceApps",props:{multiple:{type:Boolean,default:!1},modelValue:{type:[Object,Array],default:void 0},search:{type:Boolean,default:!1},searchPlaceholder:{type:String,default:"Search apps"},selectorPlaceholder:{type:String,default:void 0},label:{type:String,required:!0},showLabel:{type:Boolean,default:!1},name:{type:String,default:void 0},items:{type:Array,default:void 0}},emits:["update:modelValue"],setup(t,{emit:o}){const n=t,l=e.ref(null),a=e.ref(null),{selectedValue:i,hiddenSelectedItemCount:c,isMultiItemArrayValue:s,firstItem:r}=ue({props:e.toRefs(n),emit:o,dynamicVisibility:{elementToWatchForChanges:l,itemContainer:a}}),u=(g,m)=>g.name.toLocaleLowerCase().includes(m.toLocaleLowerCase());return(g,m)=>(e.openBlock(),e.createBlock(de,{modelValue:e.unref(i),"onUpdate:modelValue":m[0]||(m[0]=d=>e.isRef(i)?i.value=d:null),multiple:t.multiple,items:t.items??e.unref(F.SourceApps),search:t.search,"search-placeholder":t.searchPlaceholder,label:t.label,"show-label":t.showLabel,name:t.name||"sourceApps","filter-predicate":u,by:"name"},{"nothing-selected":e.withCtx(()=>[t.selectorPlaceholder?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(t.selectorPlaceholder),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.multiple?"Select apps":"Select an app"),1)],64))]),"something-selected":e.withCtx(({value:d})=>[e.unref(s)(d)?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"elementToWatchForChanges",ref:l,class:"flex items-center space-x-0.5 h-5"},[e.createElementVNode("div",{ref_key:"itemContainer",ref:a,class:"flex flex-wrap overflow-hidden space-x-0.5 h-5"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d,p=>(e.openBlock(),e.createBlock(fe,{key:p.name,"source-app":p},null,8,["source-app"]))),128))],512),e.unref(c)>0?(e.openBlock(),e.createElementBlock("div",mn," +"+e.toDisplayString(e.unref(c)),1)):e.createCommentVNode("",!0)],512)):(e.openBlock(),e.createElementBlock("div",pn,[e.createElementVNode("div",{class:"h-2 w-2 rounded-full mr-2",style:e.normalizeStyle({backgroundColor:e.unref(r)(d).bgColor})},null,4),e.createElementVNode("span",hn,e.toDisplayString(e.unref(r)(d).name),1)]))]),option:e.withCtx(({item:d})=>[e.createElementVNode("div",gn,[e.createElementVNode("div",{class:"h-2 w-2 rounded-full mr-2",style:e.normalizeStyle({backgroundColor:d.bgColor})},null,4),e.createElementVNode("span",vn,e.toDisplayString(d.name),1)])]),_:1},8,["modelValue","multiple","items","search","search-placeholder","label","show-label","name"]))}});var A=(t=>(t.CtrlOrCmd="cmd-or-ctrl",t.AltOrOpt="alt-or-opt",t.Shift="shift",t))(A||{});const q=F.getClientOperatingSystem(),kn={["cmd-or-ctrl"]:q===F.OperatingSystem.Mac?"Cmd":"Ctrl",["alt-or-opt"]:q===F.OperatingSystem.Mac?"Opt":"Alt",shift:"Shift"};function bn(t){const o=n=>Object.values(A).includes(n);return t.map(n=>o(n)?kn[n]:n).join("+")}function xn(t,...o){O.onKeyDown(o[0],n=>{const l=n.getModifierState("Alt"),a=q===F.OperatingSystem.Mac?n.getModifierState("Meta"):n.getModifierState("Control"),i=n.getModifierState("Shift");for(const c of t)switch(c){case A.CtrlOrCmd:if(!a)return;break;case A.AltOrOpt:if(!l)return;break;case A.Shift:if(!i)return;break}o[1](n)},o[2])}const Cn=e.createElementVNode("div",{class:"fixed inset-0 bg-neutral-100/70 dark:bg-neutral-900/70 transition-opacity"},null,-1),Bn={class:"fixed inset-0 z-10 overflow-y-auto"},wn={class:"flex min-h-full justify-center p-4 text-center items-center sm:p-0"},Vn={class:"relative"},En=e.defineComponent({__name:"Dialog",props:{open:{type:Boolean},maxWidth:null,hideCloser:{type:Boolean},preventCloseOnClickOutside:{type:Boolean}},emits:["update:open","fully-closed"],setup(t,{emit:o}){const n=t,l=e.computed({get:()=>n.open,set:s=>o("update:open",s)}),a=e.computed(()=>{switch(n.maxWidth){case"sm":return 0;case"md":return 1;case"lg":return 2;case"xl":return 3;default:return 1e4}}),i=e.computed(()=>{const s=["px-4 pt-4 pb-4 w-full","sm:my-8 sm:w-full sm:max-w-xl sm:p-6"];return a.value>=1&&s.push("md:max-w-2xl"),a.value>=2&&s.push("lg:max-w-4xl"),a.value>=3&&s.push("xl:max-w-6xl"),a.value>=4&&s.push("2xl:max-w-7xl"),s.join(" ")}),c=()=>{n.preventCloseOnClickOutside||(l.value=!1)};return(s,r)=>(e.openBlock(),e.createBlock(e.unref(S.TransitionRoot),{as:"template",show:l.value},{default:e.withCtx(()=>[e.createVNode(e.unref(S.Dialog),{as:"div",class:"relative z-40",onClose:c},{default:e.withCtx(()=>[e.createVNode(e.unref(S.TransitionChild),{as:"template",enter:"ease-out duration-300","enter-from":"opacity-0","enter-to":"opacity-100",leave:"ease-in duration-200","leave-from":"opacity-100","leave-to":"opacity-0"},{default:e.withCtx(()=>[Cn]),_:1}),e.createElementVNode("div",Bn,[e.createElementVNode("div",wn,[e.createVNode(e.unref(S.TransitionChild),{as:"template",enter:"ease-out duration-300","enter-from":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to":"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200","leave-from":"opacity-100 translate-y-0 sm:scale-100","leave-to":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",onAfterLeave:r[1]||(r[1]=u=>s.$emit("fully-closed"))},{default:e.withCtx(()=>[e.createVNode(e.unref(S.DialogPanel),{class:e.normalizeClass(["transform rounded-lg bg-foundation text-left shadow-xl transition-all",i.value])},{default:e.withCtx(()=>[e.createElementVNode("div",Vn,[e.renderSlot(s.$slots,"default",{},()=>[e.createTextVNode("Put your content here!")]),t.hideCloser?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"absolute top-0 right-0 text-foreground",onClick:r[0]||(r[0]=u=>l.value=!1)},[e.createVNode(e.unref(j.XMarkIcon),{class:"h-6 w-6"})]))])]),_:3},8,["class"])]),_:3})])])]),_:3})]),_:3},8,["show"]))}}),Sn={class:"inline-flex items-center space-x-2"},Nn={class:"label-light"},$n=e.defineComponent({__name:"Disclosure",props:{title:null,icon:null,color:{default:"default"}},setup(t){const o=t,n=e.computed(()=>{const a=["pr-3 h-10 w-full flex items-center justify-between border-l-2 px-2 rounded transition","ring-1"];switch(o.color){case"danger":a.push("border-danger text-danger ring-danger-lighter hover:ring-danger");break;case"default":default:a.push("border-primary text-primary ring-primary-muted hover:ring-primary");break}return a.join(" ")}),l=e.computed(()=>{const a=["mt-4 px-3 py-1 border-x "];switch(o.color){case"danger":a.push("border-danger-lighter");break;case"default":default:a.push("border-primary-muted");break}return a.join(" ")});return(a,i)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(S.Disclosure),null,{default:e.withCtx(({open:c})=>[e.createVNode(e.unref(S.DisclosureButton),{class:e.normalizeClass(n.value)},{default:e.withCtx(()=>[e.createElementVNode("div",Sn,[t.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.icon),{key:0,class:"h-4 w-4"})):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(t.title),1)]),e.createVNode(e.unref(z.ChevronUpIcon),{class:e.normalizeClass([c?"":"rotate-180 transform","h-5 w-5"])},null,8,["class"])]),_:2},1032,["class"]),e.createVNode(e.unref(S.DisclosurePanel),{class:e.normalizeClass(l.value)},{default:e.withCtx(()=>[e.createElementVNode("div",Nn,[e.renderSlot(a.$slots,"default",{},()=>[e.createTextVNode("Panel contents")])])]),_:3},8,["class"])]),_:3})]))}});var P=(t=>(t.Grid="grid",t.List="list",t))(P||{});const In=e.defineComponent({__name:"GridListToggle",props:{modelValue:null},emits:["click","update:modelValue"],setup(t,{emit:o}){const n=t,l=e.computed({get:()=>n.modelValue||P.Grid,set:c=>o("update:modelValue",c)}),a=e.computed(()=>l.value===P.Grid?z.Bars3Icon:z.Squares2X2Icon),i=c=>{o("click",c);const s=l.value===P.Grid?P.List:P.Grid;l.value=s};return(c,s)=>(e.openBlock(),e.createElementBlock("button",{class:"flex items-center justify-center rounded bg-foundation h-8 w-8 shadow cursor-pointer text-foreground",onClick:i},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value),{class:"h-6 w-6"}))]))}});var me=(t=>(t[t.Throttle=0]="Throttle",t[t.Debounce=1]="Debounce",t))(me||{}),U=(t=>(t[t.Left=0]="Left",t[t.Right=1]="Right",t))(U||{});function pe(t,o){if(!O.isClient)return;const{wait:n=100,throttleOrDebounce:l=0}=o||{},a=n?l===0?C.throttle(t,n):C.debounce(t,n):t;e.onMounted(()=>window.addEventListener("resize",a)),e.onBeforeUnmount(()=>window.removeEventListener("resize",a))}function _n(t){e.onMounted(()=>{window.addEventListener("beforeunload",t)}),e.onBeforeUnmount(()=>{window.removeEventListener("beforeunload",t)})}function he(t){const{el:o,defaultDirection:n}=t,l=e.ref(C.isUndefined(n)?1:n),a=e.computed(()=>{const c=e.unref(t.stopUpdatesBelowWidth);if(!C.isUndefined(c))return c;const s=e.unref(o);return s!=null&&s.offsetWidth?s.offsetWidth*2:void 0}),i=()=>{if(!O.isClient)return;const c=e.unref(o);if(!c)return;const s=c.getBoundingClientRect(),r=s.x+s.width>window.innerWidth,u=s.x<0;r&&u||!C.isUndefined(a.value)&&window.innerWidth<a.value||(r?l.value=0:u&&(l.value=1))};return pe(()=>i()),e.watch(()=>e.unref(o),c=>{c&&i()}),{direction:e.computed(()=>l.value),recalculateDirection:i}}const zn=["disabled","onClick"],Ln=e.defineComponent({__name:"Menu",props:{open:{type:Boolean},items:null},emits:["update:open","chosen"],setup(t,{emit:o}){const n=t,l=e.ref(null),{direction:a}=he({el:e.computed(()=>{var d;return((d=l.value)==null?void 0:d.el)||null}),defaultDirection:U.Left,stopUpdatesBelowWidth:300}),i=e.ref(null),c=e.ref(!1),s=e.computed({get:()=>n.open||!1,set:d=>o("update:open",d)}),r=d=>{const{active:p,disabled:b}=d,x=["group flex w-full items-center rounded-md px-2 py-2 text-sm"];return p?x.push("bg-primary text-foreground-on-primary"):b?x.push("text-foreground-disabled"):x.push("text-foreground"),x.join(" ")},u=(d,p)=>{o("chosen",{item:d,event:p})},g=()=>{var d;return(d=i.value)==null?void 0:d.el.click()},m=d=>{const p=!!d;return c.value=p,p};return e.watch(c,(d,p)=>{d!==p&&(s.value=d)}),e.watch(s,d=>{(d&&!c.value||!d&&c.value)&&g()}),(d,p)=>(e.openBlock(),e.createBlock(e.unref(S.Menu),{as:"div",class:"relative inline-block"},{default:e.withCtx(({open:b})=>[e.createElementVNode("div",null,[e.createVNode(e.unref(S.MenuButton),{ref_key:"menuButton",ref:i,class:"hidden",onClick:p[0]||(p[0]=e.withModifiers(()=>{},["stop","prevent"]))},null,512),e.createElementVNode("div",{class:e.normalizeClass(b?"pointer-events-none":"")},[e.renderSlot(d.$slots,"default",{toggle:g,open:m(b)})],2)]),e.createVNode(e.Transition,{"enter-active-class":"transition duration-100 ease-out","enter-from-class":"transform scale-95 opacity-0","enter-to-class":"transform scale-100 opacity-100","leave-active-class":"transition duration-75 ease-in","leave-from-class":"transform scale-100 opacity-100","leave-to-class":"transform scale-95 opacity-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(S.MenuItems),{ref_key:"menuItems",ref:l,class:e.normalizeClass(["absolute mt-2 w-56 origin-top-right divide-y divide-outline-3 rounded-md bg-foundation shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none z-40",e.unref(a)===e.unref(U).Left?"right-0":""])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(x,y)=>(e.openBlock(),e.createElementBlock("div",{key:y,class:"px-1 py-1"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x,k=>(e.openBlock(),e.createBlock(e.unref(S.MenuItem),{key:k.id,disabled:k.disabled},{default:e.withCtx(({active:v,disabled:$})=>[e.withDirectives((e.openBlock(),e.createElementBlock("span",null,[e.createElementVNode("button",{class:e.normalizeClass(r({active:v,disabled:$})),disabled:$,onClick:f=>u(k,f)},[e.renderSlot(d.$slots,"item",{item:k},()=>[e.createTextVNode(e.toDisplayString(k.title),1)])],10,zn)])),[[e.unref(oe.directive),k.disabled&&k.disabledTooltip]])]),_:2},1032,["disabled"]))),128))]))),128))]),_:3},8,["class"])]),_:3})]),_:3}))}}),Dn={class:"flex flex-col space-y-4"},Pn={class:"flex space-x-6"},jn=e.defineComponent({__name:"Tabs",props:{items:null},setup(t){const o=t,n=e.ref(null),l=e.computed(()=>n.value&&o.items.find(i=>i.id===n.value)||o.items[0]),a=i=>{n.value=i.id};return(i,c)=>(e.openBlock(),e.createElementBlock("div",Dn,[e.createElementVNode("div",Pn,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,s=>(e.openBlock(),e.createBlock(R,{key:s.id,link:"",color:l.value.id===s.id?"default":"secondary",onClick:r=>a(s)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.title),1)]),_:2},1032,["color","onClick"]))),128))]),e.renderSlot(i.$slots,"default",{activeItem:l.value})]))}}),On={class:"w-full flex flex-col items-center my-2 space-y-2 mt-4"},Tn={class:"inline-flex items-center space-x-1"},Mn=e.createElementVNode("span",{class:"text-foreground-2"},"That's it, you've loaded everything!",-1),An={class:"w-full flex flex-col items-center my-2 space-y-2 mt-4"},Fn={class:"inline-flex items-center space-x-1"},Rn=e.createElementVNode("span",{class:"text-foreground-2"},"An error occurred while loading",-1),qn=e.defineComponent({__name:"InfiniteLoading",props:{settings:null,allowRetry:{type:Boolean}},emits:["infinite"],setup(t){const o=e.ref(null),n=e.ref(!1);return O.isClient&&e.onMounted(()=>{const l=setInterval(()=>{var a;(a=o.value)!=null&&a.isConnected&&(n.value=!0,clearInterval(l))},200)}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapper",ref:o},[n.value?(e.openBlock(),e.createBlock(e.unref(be),e.mergeProps({key:0},l.$props.settings||{},{onInfinite:a[0]||(a[0]=i=>l.$emit("infinite",i))}),{spinner:e.withCtx(()=>[e.createVNode(J,{loading:!0,class:"my-2"})]),complete:e.withCtx(()=>[e.createElementVNode("div",On,[e.createElementVNode("div",Tn,[e.createVNode(e.unref(j.CheckIcon),{class:"w-5 h-5 text-success"}),Mn])])]),error:e.withCtx(({retry:i})=>[e.createElementVNode("div",An,[e.createElementVNode("div",Fn,[e.createVNode(e.unref(j.ExclamationTriangleIcon),{class:"w-5 h-5 text-danger"}),Rn]),t.allowRetry?(e.openBlock(),e.createBlock(R,{key:0,onClick:i},{default:e.withCtx(()=>[e.createTextVNode("Retry")]),_:2},1032,["onClick"])):e.createCommentVNode("",!0)])]),_:1},16)):e.createCommentVNode("",!0)],512))}}),Un={class:"relative group"},Wn={key:0,class:"absolute -inset-1 bg-blue-300 dark:bg-blue-500 opacity-5 dark:opacity-0 rounded-md blur-sm group-hover:opacity-60 dark:group-hover:opacity-30 transition duration-500"},Hn=e.defineComponent({__name:"Panel",props:{form:{type:Boolean,default:!1},ring:{type:Boolean,default:!1},fancyGlow:{type:Boolean,default:!1},customPadding:{type:Boolean,default:!1},noShadow:{type:Boolean,default:!1}},emits:["submit"],setup(t,{emit:o}){const n=t,l=e.computed(()=>n.customPadding?"":"px-4 py-4 sm:px-6"),a=e.computed(()=>n.customPadding?"":"px-4 py-4 sm:p-6"),i=e.computed(()=>{const c=["rounded-lg"];return n.noShadow||c.push("shadow"),n.ring&&c.push("ring-outline-2 hover:ring-2"),c.join(" ")});return(c,s)=>(e.openBlock(),e.createElementBlock("div",Un,[t.fancyGlow?(e.openBlock(),e.createElementBlock("div",Wn)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.form?"form":"div"),{class:e.normalizeClass(["relative divide-outline-3 bg-foundation text-foreground flex flex-col divide-y overflow-hidden",i.value]),onSubmit:s[0]||(s[0]=r=>o("submit",r))},{default:e.withCtx(()=>[c.$slots.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(l.value)},[e.renderSlot(c.$slots,"header")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["grow",a.value])},[e.renderSlot(c.$slots,"default")],2),c.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(l.value)},[e.renderSlot(c.$slots,"footer")],2)):e.createCommentVNode("",!0)]),_:3},40,["class"]))]))}}),Gn={class:"flex-shrink-0"},Kn={key:0,class:"mt-2 text-sm"},Xn=e.createElementVNode("span",{class:"sr-only"},"Dismiss",-1),Jn=e.defineComponent({__name:"Alert",props:{color:{default:"success"},withDismiss:{type:Boolean},actions:null},emits:["dismiss"],setup(t){const o=t,n=e.useSlots(),l=e.computed(()=>!!n.description),a=e.computed(()=>{const r=[];switch(r.push(l.value?"p-4":"p-2"),o.color){case"success":r.push("bg-success-lighter border-l-4 border-success");break;case"info":r.push("bg-info-lighter border-l-4 border-info");break;case"danger":r.push("bg-danger-lighter border-l-4 border-danger");break;case"warning":r.push("bg-warning-lighter border-l-4 border-warning");break}return r.join(" ")}),i=e.computed(()=>{const r=[];switch(o.color){case"success":r.push("text-success-darker");break;case"info":r.push("text-info-darker");break;case"danger":r.push("text-danger-darker");break;case"warning":r.push("text-warning-darker");break}return r.join(" ")}),c=e.computed(()=>{const r=[];switch(o.color){case"success":r.push("text-success");break;case"info":r.push("text-info");break;case"danger":r.push("text-danger");break;case"warning":r.push("text-warning");break}return r.join(" ")}),s=e.computed(()=>{const r=[];switch(o.color){case"success":r.push("bg-success-lighter ring-success");break;case"info":r.push("bg-info-lighter ring-info");break;case"danger":r.push("bg-danger-lighter ring-danger");break;case"warning":r.push("bg-warning-lighter ring-warning");break}return r.join(" ")});return(r,u)=>{var g;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["rounded-md",[a.value,i.value]])},[e.createElementVNode("div",{class:e.normalizeClass(["flex",[l.value?"":"items-center space-x-2"]])},[e.createElementVNode("div",Gn,[e.createVNode(e.unref(_.CheckCircleIcon),{class:e.normalizeClass(["h-5 w-5",c.value]),"aria-hidden":"true"},null,8,["class"])]),e.createElementVNode("div",{class:e.normalizeClass(["ml-3 grow",[l.value?"":"flex items-center space-x-2"]])},[e.createElementVNode("h3",{class:e.normalizeClass(["text-sm",[l.value?"font-medium":""]])},[e.renderSlot(r.$slots,"title",{},()=>[e.createTextVNode("Title")])],2),l.value?(e.openBlock(),e.createElementBlock("div",Kn,[e.renderSlot(r.$slots,"description",{},()=>[e.createTextVNode(" Lorem ipsum dolor sit amet consectetur adipisicing elit. Aliquid pariatur, ipsum similique veniam. ")])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([l.value?(g=t.actions)!=null&&g.length?"mt-4":"":"grow flex"])},[e.createElementVNode("div",{class:e.normalizeClass(["flex",["space-x-2",l.value?"":"grow justify-end"]])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.actions||[],(m,d)=>(e.openBlock(),e.createBlock(R,{key:d,color:t.color,size:"sm",to:m.url,external:m.externalUrl||!1,onClick:p=>m.onClick||e.unref(C.noop)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.title),1)]),_:2},1032,["color","to","external","onClick"]))),128))],2)],2)],2),t.withDismiss?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex",[l.value?"items-start":"items-center"]])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["inline-flex rounded-md focus:outline-none focus:ring-2",s.value]),onClick:u[0]||(u[0]=m=>r.$emit("dismiss"))},[Xn,e.createVNode(e.unref(_.XMarkIcon),{class:"h-5 w-5","aria-hidden":"true"})],2)],2)):e.createCommentVNode("",!0)],2)],2)}}});function Qn(t){var b,x;const{get:o,initialState:n,readOptions:l,set:a,asyncRead:i=!0,debugging:c}=t,s=c==null?void 0:c.log,r=()=>(new Error("Trace:").stack||"").substring(7),u=((x=(b=t.debugging)==null?void 0:b.log)==null?void 0:x.logger)||console.debug,g=s&&!s.writesOnly?()=>{const y=o();return u(`debugging: '${s.name}' read`,y,r()),y}:o,m=s&&!s.readsOnly?y=>(u(`debugging: '${s.name}' written to`,y,r()),a(y)):a,d=i?O.computedAsync(g,n,l):e.computed(g),p=e.computed(()=>d.value);return p.update=m,p}exports.CommonAlert=Jn;exports.CommonBadge=se;exports.CommonLoadingBar=J;exports.CommonStepsBullet=pt;exports.CommonStepsNumber=et;exports.CommonTextLink=ae;exports.FormButton=R;exports.FormCardButton=gt;exports.FormCheckbox=wt;exports.FormSelectBase=de;exports.FormSelectSourceApps=yn;exports.FormTextArea=_t;exports.FormTextInput=Mt;exports.GlobalToastRenderer=De;exports.GridListToggleValue=P;exports.HorizontalDirection=U;exports.InfiniteLoading=qn;exports.LayoutDialog=En;exports.LayoutDisclosure=$n;exports.LayoutGridListToggle=In;exports.LayoutMenu=Ln;exports.LayoutPanel=Hn;exports.LayoutTabs=jn;exports.ModifierKeys=A;exports.SourceAppBadge=fe;exports.TailwindBreakpoints=M;exports.ThrottleOrDebounce=me;exports.ToastNotificationType=T;exports.ValidationHelpers=Gt;exports.clientOs=q;exports.getKeyboardShortcutTitle=bn;exports.onKeyboardShortcut=xn;exports.useFormSelectChildInternals=ue;exports.useOnBeforeWindowUnload=_n;exports.useResponsiveHorizontalDirectionCalculation=he;exports.useWindowResizeHandler=pe;exports.useWrappingContainerHiddenCount=ce;exports.writableAsyncComputed=Qn;
|
package/dist/lib.d.ts
CHANGED
|
@@ -32,5 +32,6 @@ import InfiniteLoading from './components/InfiniteLoading.vue';
|
|
|
32
32
|
import { InfiniteLoaderState } from './helpers/global/components';
|
|
33
33
|
import LayoutPanel from './components/layout/Panel.vue';
|
|
34
34
|
import CommonAlert from './components/common/Alert.vue';
|
|
35
|
-
|
|
36
|
-
export
|
|
35
|
+
import { writableAsyncComputed, AsyncWritableComputedOptions, AsyncWritableComputedRef } from './composables/common/async';
|
|
36
|
+
export { GlobalToastRenderer, ToastNotificationType, FormButton, CommonTextLink, CommonBadge, TailwindBreakpoints, CommonStepsBullet, CommonStepsNumber, FormCardButton, FormCheckbox, FormTextArea, FormTextInput, ValidationHelpers, useWrappingContainerHiddenCount, useFormSelectChildInternals, FormSelectBase, FormSelectSourceApps, CommonLoadingBar, SourceAppBadge, onKeyboardShortcut, ModifierKeys, getKeyboardShortcutTitle, clientOs, LayoutDialog, LayoutDisclosure, LayoutGridListToggle, GridListToggleValue, ThrottleOrDebounce, HorizontalDirection, useWindowResizeHandler, useOnBeforeWindowUnload, useResponsiveHorizontalDirectionCalculation, LayoutMenu, LayoutTabs, InfiniteLoading, LayoutPanel, CommonAlert, writableAsyncComputed };
|
|
37
|
+
export type { ToastNotification, BulletStepType, NumberStepType, HorizontalOrVertical, LayoutMenuItem, LayoutTabItem, InfiniteLoaderState, AsyncWritableComputedOptions, AsyncWritableComputedRef };
|