@contentstudio/ui 0.2.12 → 0.2.13
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/index.js +5 -1
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4076,6 +4076,10 @@ const mI = ["id"], vI = ["id", "aria-labelledby"], gI = /* @__PURE__ */ m("span"
|
|
|
4076
4076
|
ignoreEnforceFocusSelector: {
|
|
4077
4077
|
type: String,
|
|
4078
4078
|
default: ""
|
|
4079
|
+
},
|
|
4080
|
+
returnFocusOnClose: {
|
|
4081
|
+
type: Boolean,
|
|
4082
|
+
default: !1
|
|
4079
4083
|
}
|
|
4080
4084
|
},
|
|
4081
4085
|
emits: [
|
|
@@ -4153,7 +4157,7 @@ const mI = ["id"], vI = ["id", "aria-labelledby"], gI = /* @__PURE__ */ m("span"
|
|
|
4153
4157
|
componentId: c.id
|
|
4154
4158
|
});
|
|
4155
4159
|
o("hide", P), !P.defaultPrevented && (s.value = !1, h.value = !1, document.body.classList.remove("cstu-modal-open"), o("update:modelValue", !1), Se(() => {
|
|
4156
|
-
X(l.value), o("hidden", P);
|
|
4160
|
+
c.returnFocusOnClose && X(l.value), o("hidden", P);
|
|
4157
4161
|
}));
|
|
4158
4162
|
}
|
|
4159
4163
|
function q(R) {
|
package/dist/index.umd.cjs
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
opacity: 0 !important;
|
|
10
10
|
transition: opacity 0.15s linear;
|
|
11
11
|
}
|
|
12
|
-
`;document.head.appendChild(Ew);const OL=["id"],UL=["id","aria-labelledby"],ZL=e.createElementVNode("span",{tabindex:"0"},null,-1),WL=["aria-label"],GL=["id"],XL=["aria-label"],_L=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"cstu-size-6"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"})],-1),KL=[_L],QL={key:0},JL=e.createElementVNode("span",{tabindex:"0"},null,-1),YL=e.defineComponent({__name:"Modal",props:{id:{type:String,default:()=>`modal-${Date.now()}`},title:{type:String,default:""},modelValue:{type:Boolean,default:!1},size:{type:String,default:"md"},radius:{type:String,default:""},centered:{type:Boolean,default:!0},scrollable:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},hideHeader:{type:Boolean,default:!1},hideFooter:{type:Boolean,default:!1},hideHeaderClose:{type:Boolean,default:!1},titleSrOnly:{type:Boolean,default:!1},ariaLabel:{type:String,default:""},content:{type:String,default:""},okTitle:{type:String,default:"OK"},okVariant:{type:String,default:"filled"},okColor:{type:String,default:"primary"},okDisabled:{type:Boolean,default:!1},cancelTitle:{type:String,default:"Cancel"},cancelVariant:{type:String,default:"outline"},cancelColor:{type:String,default:"secondary"},cancelDisabled:{type:Boolean,default:!1},modalClass:{type:String,default:""},dialogClass:{type:String,default:""},contentClass:{type:String,default:""},headerClass:{type:String,default:""},bodyClass:{type:String,default:""},footerClass:{type:String,default:""},ariaLabelledby:{type:String,default:""},teleport:{type:Boolean,default:!0},backdrop:{type:Boolean,default:!0},backdropClass:{type:String,default:""},titleClass:{type:String,default:""},showHeaderDivider:{type:Boolean,default:!1},showFooterDivider:{type:Boolean,default:!1},showDividers:{type:Boolean,default:void 0},closeTitle:{type:String,default:"Close"},busy:{type:Boolean,default:!1},noCloseOnBackdrop:{type:Boolean,default:!1},noCloseOnEsc:{type:Boolean,default:!1},static:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},okOnly:{type:Boolean,default:!1},zIndex:{type:Number,default:1050},disableFocusTrap:{type:Boolean,default:!1},ignoreEnforceFocusSelector:{type:String,default:""}},emits:["update:modelValue","show","shown","hide","hidden","ok","cancel","close"],setup(a,{expose:o,emit:n}){const c=a;class r{constructor(S,j={}){Ie(this,"type");Ie(this,"cancelable",!0);Ie(this,"target",null);Ie(this,"vueTarget",null);Ie(this,"defaultPrevented",!1);Ie(this,"componentId","");Ie(this,"trigger","programmatic");this.type=S,Object.assign(this,j)}preventDefault(){this.defaultPrevented=!0}}const l=e.ref(!1),i=e.ref(null),s=e.ref(null),d=e.ref(c.zIndex),h=e.ref(!1),k=e.ref(0),u=e.computed(()=>c.zIndex!==1050?c.zIndex:d.value);function y(){if(c.zIndex!==1050){d.value=c.zIndex;return}const A=document.querySelectorAll(".cstu-modal");let S=1050;A.forEach(j=>{const N=parseInt(window.getComputedStyle(j).zIndex,10);!isNaN(N)&&N>S&&(S=N)}),d.value=S+10}const p=e.computed(()=>c.fullscreen?"":w(c.radius));function w(A){const S={none:"",sm:"cstu-rounded-sm",md:"cstu-rounded-md",lg:"cstu-rounded-lg",xl:"cstu-rounded-xl",full:"cstu-rounded-full"};return S[A||c.size]||S.md}function C(){if(l.value)return;const A=new r("show",{trigger:"programmatic",target:null,vueTarget:null,componentId:c.id});n("show",A),!A.defaultPrevented&&(i.value=document.activeElement,l.value=!0,k.value++,y(),document.body.classList.add("cstu-modal-open"),n("update:modelValue",!0),e.nextTick(()=>{c.disableFocusTrap||q(),n("shown",A)}))}function m(A="programmatic"){if(!l.value)return;const S=new r("hide",{trigger:A,target:null,vueTarget:null,componentId:c.id});n("hide",S),!S.defaultPrevented&&(l.value=!1,h.value=!1,document.body.classList.remove("cstu-modal-open"),n("update:modelValue",!1),e.nextTick(()=>{T(i.value),n("hidden",S)}))}function b(A){A&&(i.value=typeof A=="string"?document.querySelector(A):A),l.value?m():C()}function f(A){A==="ok"?n("ok"):A==="cancel"&&n("cancel"),m(A)}function v(A){const S=A.target,j=S.closest(".cstu-dropdown-menu"),N=S.tagName&&["input","select","textarea","button"].includes(S.tagName.toLowerCase()),W=S.closest(".cstu-modal-content");j||N||W&&S!==A.currentTarget||!c.noCloseOnBackdrop&&S===A.currentTarget&&m("backdrop")}function M(A){A.key==="Escape"&&l.value&&!c.noCloseOnEsc&&!c.busy&&m("esc")}function q(){e.nextTick(()=>{if(!s.value)return;const A=s.value,S=F(A);S.length>0&&S[0].focus()})}function T(A){if(A&&l.value===!1)try{A.focus()}catch{}}function I(A){if(c.disableFocusTrap||!s.value||!l.value)return;const S=A.target,j=s.value;if(c.ignoreEnforceFocusSelector&&c.ignoreEnforceFocusSelector.trim()!==""){const W=c.ignoreEnforceFocusSelector.split(",").map(R=>R.trim()).filter(R=>R.length>0);for(const R of W)if(S.closest(R))return}const N=!!S.closest(".cstu-modal-content");if(j!==S&&!j.contains(S)&&!N){if(h.value)return;h.value=!0;try{const W=F(j);W.length>0?W[0].focus():j.focus()}finally{setTimeout(()=>{h.value=!1},0)}}}function F(A){return Array.from(A.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'))}return e.watch(()=>c.modelValue,A=>{A!==l.value&&(A?C():m())}),e.watch(()=>c.id,()=>{iw(c.id),sw(c.id,{show:C,hide:m,toggle:b})}),e.onMounted(()=>{sw(c.id,{show:C,hide:m,toggle:b}),document.addEventListener("keydown",M),document.addEventListener("focusin",I),c.modelValue&&(C(),l.value&&e.nextTick(()=>{setTimeout(()=>{const A=document.getElementById(c.id);let S=null;A&&A.parentNode&&(S=A.parentNode.querySelector(".cstu-modal-backdrop")),A&&window.getComputedStyle(A).display==="none"&&(A.style.display="block"),S&&window.getComputedStyle(S).display==="none"&&(S.style.display="block")},50)}))}),e.onBeforeUnmount(()=>{iw(c.id),document.removeEventListener("keydown",M),document.removeEventListener("focusin",I),l.value&&(l.value=!1,n("update:modelValue",!1))}),o({hide:m,show:C,close:f,toggle:b}),(A,S)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body",disabled:c.static||c.teleport===!1},[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[l.value&&a.backdrop!==!1?(e.openBlock(),e.createElementBlock("div",{key:0,id:`${c.id}-backdrop`,class:e.normalizeClass(["cstu-modal-backdrop",a.backdropClass]),style:e.normalizeStyle({zIndex:e.unref(u)-10})},null,14,OL)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"modal"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:c.id,class:e.normalizeClass(["cstu-modal",[{"cstu-modal-static":c.static,"cstu-modal-scrollable":c.scrollable},c.modalClass]]),tabindex:"-1",role:"dialog","aria-modal":"true",style:e.normalizeStyle({zIndex:e.unref(u)}),"aria-labelledby":!a.hideHeader&&a.title?`modal-title-${c.id}`:void 0,onClick:v},[e.createElementVNode("div",{class:e.normalizeClass(["cstu-modal-dialog",a.dialogClass,{"cstu-modal-fullscreen":a.fullscreen,"cstu-modal-dialog-centered":a.centered&&!a.fullscreen,"cstu-modal-dialog-scrollable":a.scrollable,[`cstu-modal-${a.size}`]:a.size&&!a.fullscreen}]),onClick:S[4]||(S[4]=j=>j.target===j.currentTarget&&j.stopPropagation())},[ZL,e.createElementVNode("div",{class:e.normalizeClass(["cstu-modal-content",a.contentClass,{"cstu-modal-content-fullscreen":a.fullscreen},e.unref(p)]),tabindex:"-1",ref_key:"modalElement",ref:s,"aria-label":a.ariaLabel,onClick:S[3]||(S[3]=j=>j.target===j.currentTarget&&j.stopPropagation())},[a.hideHeader?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("header",{key:0,class:e.normalizeClass(["cstu-modal-header",a.headerClass,{"show-divider":a.showHeaderDivider||a.showDividers}])},[e.renderSlot(A.$slots,"modal-header",{},()=>[e.renderSlot(A.$slots,"modal-title",{},()=>[e.createElementVNode("h5",{id:`modal-title-${c.id}`,class:e.normalizeClass([c.titleClass||"cstu-modal-title",{"sr-only":a.titleSrOnly}])},e.toDisplayString(a.title),11,GL)]),a.hideHeaderClose?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button","aria-label":a.closeTitle,class:"cstu-close cstu-self-baseline",onClick:S[0]||(S[0]=j=>f("headerClose"))},KL,8,XL))])],2)),e.createElementVNode("div",{class:e.normalizeClass(["cstu-modal-body",a.bodyClass,{"cstu-modal-body-scrollable":a.scrollable}])},[e.renderSlot(A.$slots,"default",{},()=>[a.content?(e.openBlock(),e.createElementBlock("div",QL,e.toDisplayString(a.content),1)):e.createCommentVNode("",!0)])],2),a.hideFooter?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("footer",{key:1,class:e.normalizeClass(["cstu-modal-footer",a.footerClass,{"show-divider":a.showFooterDivider||a.showDividers}])},[e.renderSlot(A.$slots,"modal-footer",{},()=>[a.okOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(_,{key:0,variant:a.cancelVariant,color:a.cancelColor,disabled:a.cancelDisabled||a.busy,onClick:S[1]||(S[1]=j=>f("cancel"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.cancelTitle),1)]),_:1},8,["variant","color","disabled"])),e.createVNode(_,{variant:a.okVariant,color:a.okColor,disabled:a.okDisabled||a.busy,loading:a.busy,onClick:S[2]||(S[2]=j=>f("ok"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.okTitle),1)]),_:1},8,["variant","color","disabled","loading"])])],2))],10,WL),JL],2)],14,UL)):e.createCommentVNode("",!0)]),_:3})],8,["disabled"]))}});const eI={mounted(a,o){const n=typeof o.value=="string"?o.value:Object.keys(o.modifiers)[0];if(!n){console.warn("v-cstu-modal directive requires a modal ID");return}a.addEventListener("click",()=>{lw.show(n)}),a.tagName!=="BUTTON"&&(a.setAttribute("role","button"),a.addEventListener("keydown",c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),lw.show(n))}),a.hasAttribute("tabindex")||a.setAttribute("tabindex","0"))}},tI={install:a=>{a.directive("cstu-modal",eI)}},aI=["primary","secondary","success","warning","info"];function Tw(a,o=aI){if(!a||!o||o.length===0)return"primary";let n=0;for(let r=0;r<a.length;r+=1)n=a.charCodeAt(r)+((n<<5)-n);const c=Math.abs(n)%o.length;return o[c]}function Dw(a){return!a||typeof a!="string"?"":a.trim().split(" ").slice(0,2).map(o=>o.charAt(0).toUpperCase()).join("")}const oI=["src","alt"],cI=["title"],nI={key:1,"data-avatar-placeholder-icon":"true",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rI=e.createElementVNode("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"},null,-1),lI=[rI],Fw=e.defineComponent({__name:"Avatar",props:{size:{default:"md"},radius:{default:"full"},color:{default:"primary"},gradient:null,src:{default:null},alt:null,imageProps:null,children:null,autoContrast:{type:Boolean,default:!0},name:null,allowedInitialsColors:null,variant:{default:"light"},component:{default:"div"},hover:{type:Boolean,default:!1},customClasses:{default:""}},setup(a){const o=a,n=e.ref(!o.src);e.watch(()=>o.src,u=>{n.value=!u},{immediate:!0});const c=u=>u?["primary","secondary","success","warning","danger","info","dark","light","initials"].includes(u):!0,r=e.computed(()=>o.name?Dw(o.name):""),l=e.computed(()=>{const u={sm:"w-5 h-5 text-xs",md:"w-6 h-6 text-xs",lg:"w-[30px] h-[30px] text-sm",xl:"w-[32px] h-[32px] text-sm","2xl":"w-[34px] h-[34px] text-base","3xl":"w-[36px] h-[36px] text-base","4xl":"w-[38px] h-[38px] text-lg","5xl":"w-[52px] h-[52px] text-xl"};return typeof o.size=="string"?u[o.size]||u.md:typeof o.size=="number"?`w-[${o.size}px] h-[${o.size}px]`:u.md}),i=e.computed(()=>re(o.radius)),s=e.computed(()=>{if(o.src&&!n.value||!c(o.color)&&o.color!=="initials")return"";if(o.color==="initials"&&o.name){const w=Tw(o.name,o.allowedInitialsColors||["primary","secondary","success","warning","info"]);return w?O(w,"filled",{}):O("primary","filled",{})}const u=o.variant==="transparent"?"default":o.variant==="gradient"?"filled":o.variant,y=o.color&&o.color!=="initials"?o.color:"primary",p=O(y,u,{});return o.variant==="transparent"?"bg-transparent":p}),d=e.computed(()=>!c(o.color)&&o.color!=="initials"?"":o.variant==="transparent"?"bg-transparent":o.variant==="gradient"&&o.gradient?`bg-gradient-to-r from-${o.gradient.from} to-${o.gradient.to}`:Ex(o.variant)),h=e.computed(()=>{if(o.src&&!n.value||c(o.color)||o.color==="initials")return{};const u={};switch(o.variant){case"filled":u.backgroundColor=o.color,o.autoContrast&&(u.color="white");break;case"light":u.backgroundColor=`${o.color}20`,u.color=o.color;break;case"outline":u.backgroundColor="transparent",u.color=o.color,u.border=`1px solid ${o.color}`;break;case"transparent":u.backgroundColor="transparent",u.color=o.color;break}return u}),k=u=>{var y;if((y=o.imageProps)!=null&&y.onError){o.imageProps.onError(u);return}n.value=!0};return(u,y)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.component||"div"),{class:e.normalizeClass(["avatar",e.unref(l),e.unref(i),!n.value&&a.src?"":e.unref(s),!n.value&&a.src?"":e.unref(d),{"avatar--with-image":!n.value&&a.src},{"hover:opacity-80 transition-opacity":a.hover},a.customClasses]),style:e.normalizeStyle(e.unref(h))},{default:e.withCtx(()=>[!n.value&&a.src?(e.openBlock(),e.createElementBlock("img",e.mergeProps({key:0,class:"avatar__image",src:a.src,alt:a.alt},a.imageProps,{onError:k}),null,16,oI)):(e.openBlock(),e.createElementBlock("span",{key:1,class:"avatar__placeholder",title:a.alt},[e.renderSlot(u.$slots,"default",{},()=>[a.name?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(r)),1)],64)):(e.openBlock(),e.createElementBlock("svg",nI,lI))])],8,cI))]),_:3},8,["class","style"]))}});const $w=e.defineComponent({__name:"AvatarGroup",props:{spacing:{default:"sm"},gap:{default:"none"},outlineWidth:{default:"normal"},outlineColor:{default:"white"},outlineOffset:{default:"small"},customClasses:{default:""},max:null,hover:{type:Boolean,default:!1}},setup(a){const o=a,n=e.computed(()=>{if(typeof o.spacing=="number")return`${o.spacing}px`;const h={xs:"-1rem",sm:"-0.75rem",md:"-0.5rem",lg:"-0.25rem",xl:"0"};return h[o.spacing]||h.sm}),c=e.computed(()=>{if(typeof o.gap=="number")return`${o.gap}px`;if(typeof o.gap=="string"&&!isNaN(parseFloat(o.gap)))return o.gap;const h={none:"0",xs:"0.25rem",sm:"0.5rem",md:"0.75rem",lg:"1rem"};return h[o.gap]||h.none}),r=e.computed(()=>{if(typeof o.outlineWidth=="number")return`${o.outlineWidth}px`;if(typeof o.outlineWidth=="string"&&!isNaN(parseFloat(o.outlineWidth)))return o.outlineWidth;const h={none:"0",thin:"1px",normal:"2px",medium:"3px",thick:"4px"};return h[o.outlineWidth]||h.normal}),l=e.computed(()=>{if(typeof o.outlineOffset=="number")return`${o.outlineOffset}px`;if(typeof o.outlineOffset=="string"&&!isNaN(parseFloat(o.outlineOffset)))return o.outlineOffset;const h={none:"0",inset:"-2px",small:"1px",medium:"2px",large:"3px"};return h[o.outlineOffset]||h.small}),i=e.computed(()=>typeof o.outlineColor=="string"&&["primary","secondary","success","danger","warning","info","dark","light"].includes(o.outlineColor)?`outline-${o.outlineColor}`:""),s=e.computed(()=>typeof o.outlineColor=="string"&&["primary","secondary","success","danger","warning","info","dark","light"].includes(o.outlineColor)?"var(--color-"+o.outlineColor+")":o.outlineColor),d=e.computed(()=>({"--avatar-group-spacing":n.value,"--avatar-group-gap":c.value,"--avatar-group-outline-width":r.value,"--avatar-group-outline-color":s.value,"--avatar-group-outline-offset":l.value}));return(h,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["avatar-group",a.customClasses,e.unref(i),{"avatar-group--hover":a.hover}]),style:e.normalizeStyle(e.unref(d))},[e.renderSlot(h.$slots,"default")],6))}});Fw.Group=$w;const ux=e.defineComponent({__name:"Tabs",props:{value:{type:String,default:void 0},defaultValue:{type:String,default:"first"},orientation:{type:String,default:"horizontal"},placement:{type:String,default:void 0},variant:{type:String,default:"text"}},emits:["change"],setup(a,{emit:o}){const n=a,c=e.computed(()=>n.placement?n.placement:n.orientation==="horizontal"?"top":"left"),r=e.computed(()=>n.orientation),l=e.computed(()=>n.variant),i=e.ref(n.value!==void 0?n.value:n.defaultValue);e.watch(()=>n.value,d=>{d!==void 0&&(i.value=d)});const s=d=>{n.value!==void 0?o("change",d):i.value=d};return e.provide("activeTab",i),e.provide("setActiveTab",s),e.provide("tabsOrientation",r),e.provide("tabsPlacement",c),(d,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cstu-tabs",`cstu-tabs-${e.unref(r)}`,`cstu-tabs-placement-${e.unref(c)}`,`cstu-tabs-variant-${e.unref(l)}`])},[e.renderSlot(d.$slots,"default")],2))}});const Nw=e.defineComponent({__name:"TabsList",props:{justify:{type:String,default:"flex-start"},divider:{type:Boolean,default:!1}},setup(a){const o=a,n=e.inject("tabsOrientation",e.ref("horizontal")),c=e.inject("tabsPlacement",e.ref("top")),r=e.computed(()=>["tabs-list",`tabs-list-${n.value}`,`tabs-list-placement-${c.value}`,o.divider?"tabs-list-with-divider":""]),l=s=>{if(["space-between","space-around","space-evenly"].includes(s))return s;switch(s){case"flex-start":return"flex-start";case"flex-end":return"flex-end";case"center":return"center";default:return"flex-start"}},i=e.computed(()=>n.value==="horizontal"?{justifyContent:o.justify}:{justifyContent:l(o.justify)});return(s,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(r)),style:e.normalizeStyle(e.unref(i))},[e.renderSlot(s.$slots,"default")],6))}});const Rw=e.defineComponent({__name:"TabsTab",props:{value:{type:String,required:!0},color:{type:String,default:"primary"},variant:{type:String,default:"text"},size:{type:String,default:"md"},radius:{type:String,default:"md"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1}},setup(a){const o=a,n=e.inject("activeTab",e.ref("")),c=e.inject("setActiveTab",()=>{}),r=e.inject("tabsOrientation",e.ref("horizontal")),l=e.inject("tabsPlacement",e.ref("top")),i=e.computed(()=>n.value),s=e.computed(()=>r.value),d=e.computed(()=>l.value),h=e.computed(()=>i.value===o.value),k=e.computed(()=>s.value==="vertical"),u=e.computed(()=>o.fullWidth&&s.value==="horizontal"),y=()=>{!o.disabled&&!o.loading&&c(o.value)};return(p,w)=>(e.openBlock(),e.createBlock(e.unref(_),{class:e.normalizeClass(["tabs-tab",e.unref(h)?"tabs-tab-active":"tabs-tab-inactive",`tabs-tab-${o.variant}`,o.color?`tabs-tab-color-${o.color}`:"",`tabs-tab-orientation-${e.unref(s)}`,`tabs-tab-placement-${e.unref(d)}`,{"tabs-tab-full-width":e.unref(u)}]),disabled:o.disabled,loading:o.loading,color:e.unref(h)?o.color:"light",variant:e.unref(h)?o.variant:"subtle",size:o.size,radius:o.variant==="text"?"none":o.radius,"full-width":e.unref(k),onClick:y},e.createSlots({default:e.withCtx(()=>[e.renderSlot(p.$slots,"default")]),_:2},[p.$slots.leftSection?{name:"leftSection",fn:e.withCtx(()=>[e.renderSlot(p.$slots,"leftSection")]),key:"0"}:void 0,p.$slots.rightSection?{name:"rightSection",fn:e.withCtx(()=>[e.renderSlot(p.$slots,"rightSection")]),key:"1"}:void 0]),1032,["class","disabled","loading","color","variant","size","radius","full-width"]))}});const Ow=e.defineComponent({__name:"TabsPanel",props:{value:{type:String,required:!0},KeepAlive:{type:Boolean,default:!1}},setup(a){const o=a,n=e.inject("activeTab",e.ref("")),c=e.inject("tabsOrientation",e.ref("horizontal")),r=e.inject("tabsPlacement",e.ref("top")),l=e.computed(()=>n.value===o.value),i=e.computed(()=>["tabs-panel",l.value?"tabs-panel-active":"tabs-panel-inactive",`tabs-panel-${c.value}`,`tabs-panel-placement-${r.value}`]);return(s,d)=>a.KeepAlive||e.unref(l)?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(i))},[e.renderSlot(s.$slots,"default")],2)),[[e.vShow,e.unref(l)]]):e.createCommentVNode("",!0)}});ux.List=Nw;ux.Tab=Rw;ux.Panel=Ow;const sI=e.createElementVNode("span",{class:"cstu-sr-only"},"First page",-1),iI=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"cstu-h-4 cstu-w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("polyline",{points:"11 17 6 12 11 7"}),e.createElementVNode("polyline",{points:"18 17 13 12 18 7"})],-1),dI=e.createElementVNode("span",{class:"cstu-sr-only"},"Previous page",-1),hI=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"cstu-h-4 cstu-w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1),uI={key:2,class:"cstu-flex cstu-items-center cstu-gap-2"},yI=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"cstu-h-4 cstu-w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"1"}),e.createElementVNode("circle",{cx:"19",cy:"12",r:"1"}),e.createElementVNode("circle",{cx:"5",cy:"12",r:"1"})],-1),pI=[yI],kI=e.createElementVNode("span",{class:"cstu-sr-only"},"Next page",-1),mI=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"cstu-h-4 cstu-w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1),fI=e.createElementVNode("span",{class:"cstu-sr-only"},"Last page",-1),vI=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"cstu-h-4 cstu-w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("polyline",{points:"13 17 18 12 13 7"}),e.createElementVNode("polyline",{points:"6 17 11 12 6 7"})],-1),gI=e.defineComponent({__name:"Pagination",props:{modelValue:{default:1},total:null,siblings:{default:1},boundaries:{default:1},variant:{default:"filled"},color:{default:"primary"},size:{default:"md"},disabled:{type:Boolean,default:!1},withControls:{type:Boolean,default:!0},withEdges:{type:Boolean,default:!1},withPages:{type:Boolean,default:!0},class:null},emits:["update:modelValue"],setup(a,{emit:o}){const n=a,c=e.ref(n.modelValue);e.watch(()=>n.modelValue,y=>{c.value=y});const r=e.computed(()=>c.value===1),l=e.computed(()=>c.value===n.total),i=e.computed(()=>{switch(n.size){case"xs":return"cstu-!h-[30px] cstu-!w-[30px] cstu-min-w-[30px] !cstu-p-0";case"sm":return"cstu-!h-[36px] cstu-!w-[36px] cstu-min-w-[36px] !cstu-p-0";case"md":return"cstu-!h-[40px] cstu-!w-[40px] cstu-min-w-[40px] !cstu-p-0";case"lg":return"cstu-!h-[45px] cstu-!w-[45px] cstu-min-w-[45px] !cstu-p-0";case"xl":return"cstu-!h-[50px] cstu-!w-[50px] cstu-min-w-[50px] !cstu-p-0";default:return"cstu-!h-[40px] cstu-!w-[40px] cstu-min-w-[40px] !cstu-p-0"}}),s=e.computed(()=>["cstu-flex cstu-items-center cstu-justify-center",k(n.size)]),d=e.computed(()=>{const y=[],p=n.total;if(n.siblings*2+3+n.boundaries*2>=p)return Array.from({length:p},(M,q)=>q+1);const C=Math.max(c.value-n.siblings,n.boundaries+1),m=Math.min(c.value+n.siblings,p-n.boundaries),b=C>n.boundaries+2,f=m<p-(n.boundaries+1),v=new Set;for(let M=1;M<=n.boundaries;M++)y.push(M),v.add(M);if(b)y.push("dots");else if(!b&&C>n.boundaries)for(let M=n.boundaries+1;M<C;M++)v.has(M)||(y.push(M),v.add(M));for(let M=C;M<=m;M++)v.has(M)||(y.push(M),v.add(M));if(f)y.push("dots");else if(!f&&m<p-n.boundaries)for(let M=m+1;M<p-n.boundaries+1;M++)v.has(M)||(y.push(M),v.add(M));for(let M=p-n.boundaries+1;M<=p;M++)v.has(M)||(y.push(M),v.add(M));return y}),h=y=>{y<1||y>n.total||n.disabled||(c.value=y,o("update:modelValue",y))};function k(y){const p={xs:"cstu-h-6 cstu-w-6 cstu-text-xs",sm:"cstu-h-7 cstu-w-7 cstu-text-sm",md:"cstu-h-8 cstu-w-8 cstu-text-sm",lg:"cstu-h-9 cstu-w-9 cstu-text-base",xl:"cstu-h-10 cstu-w-10 cstu-text-base"};return p[y]||p.md}const u=e.computed(()=>n.variant==="filled"?"subtle":"bordered-transparent");return(y,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cstu-flex cstu-items-center cstu-gap-2",[n.class]])},[n.withEdges?(e.openBlock(),e.createBlock(_,{key:0,variant:e.unref(u),color:"light",size:n.size,disabled:e.unref(r)||n.disabled,onClick:p[0]||(p[0]=w=>h(1)),"aria-label":"Go to first page",class:e.normalizeClass(e.unref(i))},{default:e.withCtx(()=>[sI,iI]),_:1},8,["variant","size","disabled","class"])):e.createCommentVNode("",!0),n.withControls?(e.openBlock(),e.createBlock(_,{key:1,variant:e.unref(u),color:"light",size:n.size,disabled:e.unref(r)||n.disabled,onClick:p[1]||(p[1]=w=>h(c.value-1)),"aria-label":"Go to previous page",class:e.normalizeClass(e.unref(i))},{default:e.withCtx(()=>[dI,hI]),_:1},8,["variant","size","disabled","class"])):e.createCommentVNode("",!0),n.withPages?(e.openBlock(),e.createElementBlock("div",uI,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),(w,C)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C},[w!=="dots"?(e.openBlock(),e.createBlock(_,{key:0,variant:w===c.value?"filled":e.unref(u),color:w===c.value?n.color:"light",size:n.size,disabled:n.disabled,onClick:m=>h(Number(w)),"aria-current":w===c.value?"page":void 0,"aria-label":`Page ${w}`,class:e.normalizeClass(e.unref(i))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w),1)]),_:2},1032,["variant","color","size","disabled","onClick","aria-current","aria-label","class"])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["pagination-dots",[e.unref(s),e.unref(i)]])},pI,2))],64))),128))])):e.createCommentVNode("",!0),n.withControls?(e.openBlock(),e.createBlock(_,{key:3,variant:e.unref(u),color:"light",size:n.size,disabled:e.unref(l)||n.disabled,onClick:p[2]||(p[2]=w=>h(c.value+1)),"aria-label":"Go to next page",class:e.normalizeClass(e.unref(i))},{default:e.withCtx(()=>[kI,mI]),_:1},8,["variant","size","disabled","class"])):e.createCommentVNode("",!0),n.withEdges?(e.openBlock(),e.createBlock(_,{key:4,variant:e.unref(u),color:"light",size:n.size,disabled:e.unref(l)||n.disabled,onClick:p[3]||(p[3]=w=>h(n.total)),"aria-label":"Go to last page",class:e.normalizeClass(e.unref(i))},{default:e.withCtx(()=>[fI,vI]),_:1},8,["variant","size","disabled","class"])):e.createCommentVNode("",!0)],2))}}),Uw={mounted(a,o){a._clickOutside=n=>{const c=n.target;if(!(a===c||a.contains(c))){const r=n.target,l=r.tagName&&r.tagName.toLowerCase()==="input",i=r.closest(".cstu-dropdown-menu");!l&&!i&&o.value(n)}},document.addEventListener("click",a._clickOutside,!0),document.addEventListener("touchstart",a._clickOutside,!0)},unmounted(a){a._clickOutside&&(document.removeEventListener("click",a._clickOutside,!0),document.removeEventListener("touchstart",a._clickOutside,!0))}},MI=["id","aria-labelledby","aria-modal","onKeydown"],xI={class:"cstu-popover-inner"},wI=["id"],bI=e.defineComponent({__name:"Popover",props:{open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:!1},placement:{default:"bottom"},variant:{default:"shadow"},color:{default:"primary"},size:{default:"md"},radius:{default:"md"},hideHeader:{type:Boolean,default:!1},showCloseIcon:{type:Boolean,default:!0},hideFooter:{type:Boolean,default:!0},closeOnClickOutside:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},closeOnClick:{type:Boolean,default:!1},title:{default:""},content:{default:""},zIndex:{default:1e3},trigger:{default:"click"},backdrop:{type:[Boolean,String],default:!1},offsetDistance:{default:8},disabled:{type:Boolean,default:!1},popoverClass:{default:""},headerClass:{default:""},bodyClass:{default:""},footerClass:{default:""},trapFocus:{type:Boolean,default:!1},id:{default:()=>`popover-${Date.now()}`},shadow:{default:"md"},width:null},emits:["update:open","open","close"],setup(a,{emit:o}){const n=a,c=e.ref(n.defaultOpen),r=e.ref(null),l=e.ref(null),i=e.ref(null),s=e.ref(null),d=e.ref(n.zIndex);n.open!==void 0&&(c.value=n.open);const h=e.computed(()=>{if(n.placement!=="auto")return n.placement}),k=e.computed(()=>{const g=[sx(n.offsetDistance)];return i.value&&g.push(Aw({element:i})),n.placement==="auto"?g.push(Bw({padding:8})):g.push(dx({fallbackPlacements:["top","bottom","left","right"],padding:8})),g.push(ix({padding:8})),g}),{floatingStyles:u,update:y}=hx(r,l,{placement:h,middleware:k,whileElementsMounted:Vw}),p=g=>{n.disabled||(n.trigger==="click"||n.trigger==="manual")&&T()},w=()=>{n.disabled||n.trigger==="hover"&&M()},C=()=>{n.disabled||n.trigger==="hover"&&setTimeout(()=>{q("hover")},100)},m=g=>{n.closeOnClick&&q("popoverClick"),g.stopPropagation()},b=g=>{n.closeOnClickOutside&&c.value&&l.value&&!l.value.contains(g.target)&&r.value&&!r.value.contains(g.target)&&q("clickAway")},f=()=>{n.closeOnClickOutside&&q("backdrop")},v=g=>{n.closeOnEscape&&g.key==="Escape"&&(g.preventDefault(),q("escape"))},M=()=>{n.disabled||c.value||(s.value=document.activeElement,c.value=!0,e.nextTick(()=>{y(),n.trapFocus&&I()}),o("open"),o("update:open",!0))},q=(g="programmatic")=>{c.value&&(c.value=!1,n.trapFocus&&F(s.value),o("close",g),o("update:open",!1))},T=()=>{c.value?q():M()},I=()=>{if(!l.value)return;const g=A(l.value);g.length>0?g[0].focus():l.value.focus()},F=g=>{g&&typeof g.focus=="function"&&g.focus()},A=g=>Array.from(g.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(H=>!H.hasAttribute("disabled")&&!H.getAttribute("aria-hidden")),S=g=>{if(!c.value||!n.trapFocus||!l.value)return;const H=g.target;l.value.contains(H)||(g.preventDefault(),I())};e.watch(()=>n.open,g=>{g!==c.value&&(g?M():q())}),e.watch(r,g=>{g&&y()}),e.onMounted(()=>{document.addEventListener("keydown",v),n.trapFocus&&document.addEventListener("focusin",S)}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",v),n.trapFocus&&document.removeEventListener("focusin",S)});const j=e.computed(()=>[re(n.radius),!n.variant||n.variant==="shadow"?n.shadow?`cstu-shadow-${n.shadow}`:"cstu-shadow-md":"",n.popoverClass]),N=e.computed(()=>{const g=[...j.value.filter(Boolean)];let H=!1;const $=n.color;if($&&te($)&&n.variant==="color"){const G=O($,"filled",{disabled:n.disabled});typeof G=="string"&&G.trim()&&(g.push(...G.split(" ").filter(Boolean)),H=!0)}return H||(g.push("cstu-bg-white"),n.variant==="outline"&&g.push("cstu-border","cstu-border-gray-300"),g.push("cstu-text-gray-700")),g.filter(Boolean).map(G=>typeof G=="string"?G:Object.keys(G).filter(Be=>G[Be]).join(" ")).join(" ")}),W=e.computed(()=>{const g={width:typeof n.width=="number"?`${n.width}px`:n.width},H=n.color;if(H&&!te(H)&&n.variant==="color"){g.backgroundColor=H;const $=R(H);g.color=$>128?"#000000":"#FFFFFF"}return{...u.value,...g}});e.computed(()=>{const g={backgroundColor:"white"},H=n.color;return n.variant==="color"&&H?te(H)?(g.borderWidth="1px",g.borderStyle="solid",g.borderColor=`var(--${H}-500)`):g.backgroundColor=H:n.variant==="outline"&&(g.borderWidth="1px",g.borderStyle="solid",g.borderColor="#e2e8f0"),g});function R(g){if(g.startsWith("#"))try{const H=parseInt(g.substring(1,3),16),$=parseInt(g.substring(3,5),16),G=parseInt(g.substring(5,7),16);return(H*299+$*587+G*114)/1e3}catch{return 128}else if(g.startsWith("rgb"))try{const H=g.match(/\d+/g);if(H&&H.length>=3){const $=parseInt(H[0],10),G=parseInt(H[1],10),Be=parseInt(H[2],10);return($*299+G*587+Be*114)/1e3}}catch{return 128}return 128}const ae=e.computed(()=>{const g=n.color,H=!(g&&te(g)),$=n.variant==="outline";return["cstu-popover-header",{xs:"cstu-px-2 cstu-py-1.5",sm:"cstu-px-2.5 cstu-py-1.5",md:"cstu-px-3 cstu-py-2",lg:"cstu-px-3.5 cstu-py-2.5",xl:"cstu-px-4 cstu-py-3"}[n.size||"md"],m2(n.size||"md"),"cstu-flex cstu-items-center cstu-justify-between",$||H?"cstu-border-b cstu-border-gray-200 dark:cstu-border-gray-700":"",n.headerClass].filter(Boolean).join(" ")}),J=e.computed(()=>["cstu-popover-body",{xs:"cstu-p-2",sm:"cstu-p-2.5",md:"cstu-p-3",lg:"cstu-p-3.5",xl:"cstu-p-4"}[n.size||"md"],m2(n.size||"sm"),n.bodyClass].filter(Boolean).join(" ")),Z=e.computed(()=>{const g=n.color,H=!(g&&te(g)),$=n.variant==="outline";return["cstu-popover-footer",{xs:"cstu-px-2 cstu-py-1.5",sm:"cstu-px-2.5 cstu-py-1.5",md:"cstu-px-3 cstu-py-2",lg:"cstu-px-3.5 cstu-py-2.5",xl:"cstu-px-4 cstu-py-3"}[n.size||"md"],$||H?"cstu-border-t cstu-border-gray-200 dark:cstu-border-gray-700":"","cstu-flex cstu-justify-end cstu-space-x-2",n.footerClass].filter(Boolean).join(" ")});return(g,H)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"triggerRef",ref:r,class:e.normalizeClass(["cstu-inline-block cstu-popover-trigger",{"cstu-cursor-not-allowed cstu-opacity-70":a.disabled}]),onClick:p,onMouseenter:w,onMouseleave:C},[e.renderSlot(g.$slots,"trigger")],34),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"fade",appear:""},{default:e.withCtx(()=>[c.value&&a.backdrop!==!1?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["cstu-popover-backdrop",{"cstu-bg-black/50":a.backdrop===!0,"cstu-bg-transparent":a.backdrop==="transparent"}]),style:e.normalizeStyle({zIndex:a.zIndex-10}),onClick:f},null,6)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{"enter-active-class":"cstu-transition cstu-ease-out cstu-duration-100","enter-from-class":"cstu-transform cstu-opacity-0 cstu-scale-95","enter-to-class":"cstu-transform cstu-opacity-100 cstu-scale-100","leave-active-class":"cstu-transition cstu-ease-in cstu-duration-75","leave-from-class":"cstu-transform cstu-opacity-100 cstu-scale-100","leave-to-class":"cstu-transform cstu-opacity-0 cstu-scale-95"},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cstu-popover-container",style:e.normalizeStyle({zIndex:d.value})},[e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"popoverRef",ref:l,id:n.id,class:e.normalizeClass(e.unref(N)),style:e.normalizeStyle([e.unref(u),e.unref(W)]),role:"dialog","aria-labelledby":n.title?`${n.id}-title`:void 0,"aria-modal":n.trapFocus,tabindex:"-1",onClick:m,onKeydown:e.withKeys(v,["esc"])},[e.createElementVNode("div",xI,[n.hideHeader?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(ae))},[e.renderSlot(g.$slots,"header",{},()=>[e.createElementVNode("h3",{id:`${n.id}-title`,class:e.normalizeClass(["cstu-popover-title cstu-font-medium",e.unref(m2)(n.size||"md")])},e.toDisplayString(n.title),11,wI),n.showCloseIcon?(e.openBlock(),e.createBlock(_,{key:0,icon:"X",variant:"text",size:"xs",color:n.color&&e.unref(te)(n.color)?"white":"gray",class:"cstu-ml-auto","aria-label":"Close popover",onClick:H[0]||(H[0]=e.withModifiers($=>q("headerClose"),["stop"]))},null,8,["color"])):e.createCommentVNode("",!0)])],2)),e.createElementVNode("div",{class:e.normalizeClass(e.unref(J))},[e.renderSlot(g.$slots,"default",{},()=>[a.content?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(m2)(n.size||"sm"))},e.toDisplayString(a.content),3)):e.createCommentVNode("",!0)])],2),n.hideFooter?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(Z))},[e.renderSlot(g.$slots,"footer",{},()=>[e.createVNode(_,{size:"sm",variant:"subtle",onClick:H[1]||(H[1]=$=>q("cancel"))},{default:e.withCtx(()=>[e.createTextVNode(" Close ")]),_:1})])],2))])],46,MI)),[[e.unref(Uw),b]])],4)):e.createCommentVNode("",!0)]),_:3})]))],64))}});const CI=e.defineComponent({__name:"Breadcrumbs",props:{separator:{default:"/"},separatorMargin:{default:"xs"},size:{default:"md"},radius:{default:"md"},color:{default:"primary"},highlightActive:{type:Boolean,default:!0},class:null,separatorClass:null,activeClass:null},setup(a){const o=a,n=e.useSlots(),c=e.computed(()=>!!n.default),r=e.computed(()=>n.default?n.default():[]),l=u=>u===r.value.length-1,i=u=>u?["primary","secondary","success","warning","danger","info","dark","light"].includes(u):!0,s=u=>{if(!l(u)||!o.highlightActive)return"";if(i(o.color)){const y=Ce[o.color];if(y)return`cstu-text-${y.base}-${y.main}`}return""},d=u=>!l(u)||!o.highlightActive?{}:i(o.color)?{}:{color:o.color},h=e.computed(()=>{const u={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg",xl:"text-xl"};return u[o.size]||u.md}),k=e.computed(()=>{const u={xs:"mx-1",sm:"mx-2",md:"mx-3",lg:"mx-4",xl:"mx-5"};return u[o.separatorMargin]||u.xs});return(u,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cstu-breadcrumbs",o.class])},[e.unref(c)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(e.unref(r),(p,w)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:w},[e.createElementVNode("div",{class:e.normalizeClass(["cstu-breadcrumb-item",e.unref(h),l(w)?"cstu-breadcrumb-active":"cstu-breadcrumb-inactive",l(w)?o.activeClass:"",l(w)&&o.highlightActive?s(w):""]),style:e.normalizeStyle(d(w))},[e.renderSlot(u.$slots,`item-${w}`,{isActive:l(w)},()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p)))])],6),l(w)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["cstu-breadcrumb-separator",e.unref(k),o.separatorClass])},[e.renderSlot(u.$slots,"separator",{},()=>[typeof o.separator=="string"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(o.separator),1)],64)):o.separator?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.separator),{key:1})):e.createCommentVNode("",!0)])],2))],64))),128)):e.renderSlot(u.$slots,"default",{key:0})],2))}});const LI={key:0,class:"cstu-flex cstu-justify-between cstu-items-center cstu-mb-1"},II=["for"],SI={key:0,class:"cstu-text-red-500 cstu-ml-1"},zI={key:0,class:"cstu-flex cstu-items-center cstu-justify-center cstu-w-[15px] cstu-h-[15px] cstu-mt-1"},qI=["id","value","placeholder","disabled","required","readonly","rows","maxlength"],VI={key:1,class:"cstu-flex cstu-items-center cstu-justify-center cstu-w-[15px] cstu-h-[15px] cstu-mt-1"},BI=e.defineComponent({__name:"Textarea",props:{id:null,modelValue:null,placeholder:null,disabled:{type:Boolean},readonly:{type:Boolean},label:null,labelProps:null,description:null,descriptionProps:null,error:null,errorProps:null,hasError:{type:Boolean},showBothErrorAndDescription:{type:Boolean},textareaProps:null,size:null,radius:null,variant:null,required:{type:Boolean},withAsterisk:{type:Boolean},rows:null,resize:null,fullWidth:{type:Boolean},color:null,class:null,inputClass:null,maxLength:null},emits:["update:modelValue","focus","blur","change"],setup(a,{expose:o,emit:n}){const c=a,r=`textarea-${Math.random().toString(36).substring(2,11)}`,l=e.ref(null),i=e.computed(()=>c.hasError??!1),s=e.computed(()=>c.disabled??!1),d=e.computed(()=>c.readonly??!1),h=e.computed(()=>c.required??!1),k=e.computed(()=>c.withAsterisk??!1),u=e.computed(()=>c.showBothErrorAndDescription??!1),y=e.computed(()=>c.size??"md"),p=e.computed(()=>c.variant??"default"),w=e.computed(()=>c.radius??"md"),C=e.computed(()=>c.color??"primary"),m=e.computed(()=>c.fullWidth??!1),b=e.computed(()=>c.inputClass??""),f=e.computed(()=>c.rows??3),v=e.computed(()=>c.resize??"none"),M={xs:{inputClass:`cstu-min-h-8 ${m.value?"cstu-w-full":"cstu-max-w-[20.5rem]"}`,labelSize:"cstu-text-xs cstu-font-medium",descriptionSize:"cstu-text-xs"},sm:{inputClass:`cstu-min-h-9 ${m.value?"cstu-w-full":"cstu-max-w-[20.5rem]"}`,labelSize:"cstu-text-sm cstu-font-medium",descriptionSize:"cstu-text-xs"},md:{inputClass:`cstu-min-h-10 ${m.value?"cstu-w-full":"cstu-max-w-[20.5rem]"}`,labelSize:"cstu-text-sm cstu-font-medium",descriptionSize:"cstu-text-sm"},lg:{inputClass:`cstu-min-h-11 ${m.value?"cstu-w-full":"cstu-max-w-[20.5rem]"}`,labelSize:"cstu-text-sm cstu-font-medium",descriptionSize:"cstu-text-sm"},xl:{inputClass:`cstu-min-h-12 ${m.value?"cstu-w-full":"cstu-max-w-[20.5rem]"}`,labelSize:"cstu-text-base cstu-font-medium",descriptionSize:"cstu-text-sm"}},q=e.computed(()=>`${M[y.value].inputClass.split(" ")[0]} cstu-transition-all cstu-duration-300`),T=e.computed(()=>M[y.value].labelSize),I=e.computed(()=>M[y.value].descriptionSize),F=e.computed(()=>{switch(y.value){case"xs":return"cstu-text-xs";case"sm":return"cstu-text-sm";case"md":return"cstu-text-sm";case"lg":return"cstu-text-base";case"xl":return"cstu-text-base";default:return"cstu-text-sm"}}),A=e.computed(()=>re(w.value)),S=e.computed(()=>c.error!==void 0&&c.error!==""||i.value),j=e.computed(()=>p.value==="unstyled"||!te(C.value)&&!S.value?"":S.value?"cstu-border-red-500 hover:cstu-border-red-500 focus-within:cstu-border-red-500 focus-within:cstu-ring-1 focus-within:cstu-ring-red-500":p.value==="default"||p.value==="outline"?`cstu-border-${C.value}-500 hover:cstu-border-${C.value}-600 focus-within:cstu-border-${C.value}-500 focus-within:cstu-ring-1 focus-within:cstu-ring-${C.value}-500`:""),N=e.computed(()=>p.value==="unstyled"?{}:te(C.value)||S.value?{}:p.value==="default"||p.value==="outline"?{"--border-color":C.value,"border-color":"var(--border-color)"}:p.value==="filled"?{"--bg-color":`${C.value}10`,"background-color":"var(--bg-color)"}:p.value==="light"?{"--bg-color":`${C.value}10`,"--text-color":C.value,"background-color":"var(--bg-color)",color:"var(--text-color)"}:p.value==="subtle"?{"--text-color":C.value,color:"var(--text-color)"}:{}),W=e.computed(()=>{const g={default:"cstu-bg-white cstu-border cstu-transition-colors cstu-duration-150 cstu-px-3",filled:"cstu-bg-gray-100 cstu-border cstu-border-transparent cstu-transition-colors cstu-duration-150 cstu-px-3",light:"cstu-border cstu-transition-colors cstu-duration-150 cstu-px-3",outline:"cstu-bg-white cstu-border cstu-transition-colors cstu-duration-150 cstu-px-3",subtle:"cstu-bg-transparent cstu-transition-colors cstu-duration-150 cstu-px-3",unstyled:"cstu-bg-transparent !cstu-border-0"};if(p.value==="unstyled")return[g[p.value]];const H=S.value?"":p.value==="default"||p.value==="outline"?"cstu-border-gray-300/45":"",$=S.value?"cstu-border-red-500":"";return[g[p.value],H,$,S.value?"hover:cstu-border-red-500":"hover:cstu-border-primary-500",S.value?"focus-within:cstu-border-red-500 focus-within:cstu-ring-1 focus-within:cstu-ring-red-500":"focus-within:cstu-border-primary-500 focus-within:cstu-ring-1 focus-within:cstu-ring-primary-500"]}),R=e.ref(!1),ae=g=>{R.value=!0,n("focus",g)},J=g=>{R.value=!1,n("blur",g)},Z=g=>{n("change",g)};return o({textarea:l,focus:()=>{var g;return(g=l.value)==null?void 0:g.focus()},blur:()=>{var g;return(g=l.value)==null?void 0:g.blur()},select:()=>{var g;return(g=l.value)==null?void 0:g.select()},setSelectionRange:(g,H)=>{var $;return($=l.value)==null?void 0:$.setSelectionRange(g,H)},setRangeText:g=>{var H;return(H=l.value)==null?void 0:H.setRangeText(g)},get value(){var g;return(g=l.value)==null?void 0:g.value},set value(g){l.value&&g!==void 0&&(l.value.value=g)}}),(g,H)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cstu-flex cstu-flex-col cstu-transition-all cstu-duration-300",[c.class,e.unref(m)?"cstu-w-full":"cstu-max-w-[20.5rem]"]])},[c.label||g.$slots.label?(e.openBlock(),e.createElementBlock("div",LI,[e.createElementVNode("label",e.mergeProps({for:c.id||r,class:["cstu-flex cstu-items-center",e.unref(T)]},c.labelProps),[e.renderSlot(g.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(c.label)+" ",1),e.unref(k)||e.unref(h)?(e.openBlock(),e.createElementBlock("span",SI,"*")):e.createCommentVNode("",!0)])],16,II),e.renderSlot(g.$slots,"labelIcon")])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.createElementVNode("div",{class:e.normalizeClass(["cstu-flex cstu-items-start cstu-gap-2 cstu-py-2",e.unref(q),e.unref(A),e.unref(W),e.unref(j),{"cstu-opacity-50 cstu-pointer-events-none cstu-cursor-not-allowed":e.unref(s)}]),style:e.normalizeStyle(e.unref(N))},[g.$slots.leftSection?(e.openBlock(),e.createElementBlock("div",zI,[e.renderSlot(g.$slots,"leftSection")])):e.createCommentVNode("",!0),e.createElementVNode("textarea",e.mergeProps({ref_key:"textareaRef",ref:l,id:c.id||r,value:c.modelValue,placeholder:c.placeholder,disabled:e.unref(s),required:e.unref(h),readonly:e.unref(d),rows:e.unref(f),maxlength:c.maxLength,class:["cstu-flex-1 cstu-bg-transparent cstu-outline-none cstu-w-full",e.unref(F),e.unref(b),{"cstu-text-gray-500":c.modelValue,"cstu-text-red-500":e.unref(S)&&!c.modelValue}],style:{resize:e.unref(v)},onInput:H[0]||(H[0]=$=>g.$emit("update:modelValue",$.target.value)),onFocus:ae,onBlur:J,onChange:Z},c.textareaProps),null,16,qI),g.$slots.rightSection?(e.openBlock(),e.createElementBlock("div",VI,[e.renderSlot(g.$slots,"rightSection")])):e.createCommentVNode("",!0)],6)]),c.description&&!e.unref(S)||g.$slots.description&&!e.unref(S)||e.unref(u)&&c.description||e.unref(u)&&g.$slots.description?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:1,class:"cstu-mt-1"},c.descriptionProps),[e.createElementVNode("p",{class:e.normalizeClass(["cstu-text-gray-500",e.unref(I)])},[e.renderSlot(g.$slots,"description",{},()=>[e.createTextVNode(e.toDisplayString(c.description),1)])],2)],16)):e.createCommentVNode("",!0),e.unref(S)&&c.error||e.unref(S)&&g.$slots.error||e.unref(u)&&c.error||e.unref(u)&&g.$slots.error?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:2,class:"cstu-mt-1"},c.errorProps),[e.createElementVNode("p",{class:e.normalizeClass(["cstu-text-red-500",e.unref(I)])},[e.renderSlot(g.$slots,"error",{},()=>[e.createTextVNode(e.toDisplayString(c.error),1)])],2)],16)):e.createCommentVNode("",!0)],2))}});/**
|
|
12
|
+
`;document.head.appendChild(Ew);const OL=["id"],UL=["id","aria-labelledby"],ZL=e.createElementVNode("span",{tabindex:"0"},null,-1),WL=["aria-label"],GL=["id"],XL=["aria-label"],_L=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"cstu-size-6"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"})],-1),KL=[_L],QL={key:0},JL=e.createElementVNode("span",{tabindex:"0"},null,-1),YL=e.defineComponent({__name:"Modal",props:{id:{type:String,default:()=>`modal-${Date.now()}`},title:{type:String,default:""},modelValue:{type:Boolean,default:!1},size:{type:String,default:"md"},radius:{type:String,default:""},centered:{type:Boolean,default:!0},scrollable:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},hideHeader:{type:Boolean,default:!1},hideFooter:{type:Boolean,default:!1},hideHeaderClose:{type:Boolean,default:!1},titleSrOnly:{type:Boolean,default:!1},ariaLabel:{type:String,default:""},content:{type:String,default:""},okTitle:{type:String,default:"OK"},okVariant:{type:String,default:"filled"},okColor:{type:String,default:"primary"},okDisabled:{type:Boolean,default:!1},cancelTitle:{type:String,default:"Cancel"},cancelVariant:{type:String,default:"outline"},cancelColor:{type:String,default:"secondary"},cancelDisabled:{type:Boolean,default:!1},modalClass:{type:String,default:""},dialogClass:{type:String,default:""},contentClass:{type:String,default:""},headerClass:{type:String,default:""},bodyClass:{type:String,default:""},footerClass:{type:String,default:""},ariaLabelledby:{type:String,default:""},teleport:{type:Boolean,default:!0},backdrop:{type:Boolean,default:!0},backdropClass:{type:String,default:""},titleClass:{type:String,default:""},showHeaderDivider:{type:Boolean,default:!1},showFooterDivider:{type:Boolean,default:!1},showDividers:{type:Boolean,default:void 0},closeTitle:{type:String,default:"Close"},busy:{type:Boolean,default:!1},noCloseOnBackdrop:{type:Boolean,default:!1},noCloseOnEsc:{type:Boolean,default:!1},static:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},okOnly:{type:Boolean,default:!1},zIndex:{type:Number,default:1050},disableFocusTrap:{type:Boolean,default:!1},ignoreEnforceFocusSelector:{type:String,default:""},returnFocusOnClose:{type:Boolean,default:!1}},emits:["update:modelValue","show","shown","hide","hidden","ok","cancel","close"],setup(a,{expose:o,emit:n}){const c=a;class r{constructor(S,j={}){Ie(this,"type");Ie(this,"cancelable",!0);Ie(this,"target",null);Ie(this,"vueTarget",null);Ie(this,"defaultPrevented",!1);Ie(this,"componentId","");Ie(this,"trigger","programmatic");this.type=S,Object.assign(this,j)}preventDefault(){this.defaultPrevented=!0}}const l=e.ref(!1),i=e.ref(null),s=e.ref(null),d=e.ref(c.zIndex),h=e.ref(!1),k=e.ref(0),u=e.computed(()=>c.zIndex!==1050?c.zIndex:d.value);function y(){if(c.zIndex!==1050){d.value=c.zIndex;return}const A=document.querySelectorAll(".cstu-modal");let S=1050;A.forEach(j=>{const N=parseInt(window.getComputedStyle(j).zIndex,10);!isNaN(N)&&N>S&&(S=N)}),d.value=S+10}const p=e.computed(()=>c.fullscreen?"":w(c.radius));function w(A){const S={none:"",sm:"cstu-rounded-sm",md:"cstu-rounded-md",lg:"cstu-rounded-lg",xl:"cstu-rounded-xl",full:"cstu-rounded-full"};return S[A||c.size]||S.md}function C(){if(l.value)return;const A=new r("show",{trigger:"programmatic",target:null,vueTarget:null,componentId:c.id});n("show",A),!A.defaultPrevented&&(i.value=document.activeElement,l.value=!0,k.value++,y(),document.body.classList.add("cstu-modal-open"),n("update:modelValue",!0),e.nextTick(()=>{c.disableFocusTrap||q(),n("shown",A)}))}function m(A="programmatic"){if(!l.value)return;const S=new r("hide",{trigger:A,target:null,vueTarget:null,componentId:c.id});n("hide",S),!S.defaultPrevented&&(l.value=!1,h.value=!1,document.body.classList.remove("cstu-modal-open"),n("update:modelValue",!1),e.nextTick(()=>{c.returnFocusOnClose&&T(i.value),n("hidden",S)}))}function b(A){A&&(i.value=typeof A=="string"?document.querySelector(A):A),l.value?m():C()}function f(A){A==="ok"?n("ok"):A==="cancel"&&n("cancel"),m(A)}function v(A){const S=A.target,j=S.closest(".cstu-dropdown-menu"),N=S.tagName&&["input","select","textarea","button"].includes(S.tagName.toLowerCase()),W=S.closest(".cstu-modal-content");j||N||W&&S!==A.currentTarget||!c.noCloseOnBackdrop&&S===A.currentTarget&&m("backdrop")}function M(A){A.key==="Escape"&&l.value&&!c.noCloseOnEsc&&!c.busy&&m("esc")}function q(){e.nextTick(()=>{if(!s.value)return;const A=s.value,S=F(A);S.length>0&&S[0].focus()})}function T(A){if(A&&l.value===!1)try{A.focus()}catch{}}function I(A){if(c.disableFocusTrap||!s.value||!l.value)return;const S=A.target,j=s.value;if(c.ignoreEnforceFocusSelector&&c.ignoreEnforceFocusSelector.trim()!==""){const W=c.ignoreEnforceFocusSelector.split(",").map(R=>R.trim()).filter(R=>R.length>0);for(const R of W)if(S.closest(R))return}const N=!!S.closest(".cstu-modal-content");if(j!==S&&!j.contains(S)&&!N){if(h.value)return;h.value=!0;try{const W=F(j);W.length>0?W[0].focus():j.focus()}finally{setTimeout(()=>{h.value=!1},0)}}}function F(A){return Array.from(A.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'))}return e.watch(()=>c.modelValue,A=>{A!==l.value&&(A?C():m())}),e.watch(()=>c.id,()=>{iw(c.id),sw(c.id,{show:C,hide:m,toggle:b})}),e.onMounted(()=>{sw(c.id,{show:C,hide:m,toggle:b}),document.addEventListener("keydown",M),document.addEventListener("focusin",I),c.modelValue&&(C(),l.value&&e.nextTick(()=>{setTimeout(()=>{const A=document.getElementById(c.id);let S=null;A&&A.parentNode&&(S=A.parentNode.querySelector(".cstu-modal-backdrop")),A&&window.getComputedStyle(A).display==="none"&&(A.style.display="block"),S&&window.getComputedStyle(S).display==="none"&&(S.style.display="block")},50)}))}),e.onBeforeUnmount(()=>{iw(c.id),document.removeEventListener("keydown",M),document.removeEventListener("focusin",I),l.value&&(l.value=!1,n("update:modelValue",!1))}),o({hide:m,show:C,close:f,toggle:b}),(A,S)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body",disabled:c.static||c.teleport===!1},[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[l.value&&a.backdrop!==!1?(e.openBlock(),e.createElementBlock("div",{key:0,id:`${c.id}-backdrop`,class:e.normalizeClass(["cstu-modal-backdrop",a.backdropClass]),style:e.normalizeStyle({zIndex:e.unref(u)-10})},null,14,OL)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"modal"},{default:e.withCtx(()=>[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:c.id,class:e.normalizeClass(["cstu-modal",[{"cstu-modal-static":c.static,"cstu-modal-scrollable":c.scrollable},c.modalClass]]),tabindex:"-1",role:"dialog","aria-modal":"true",style:e.normalizeStyle({zIndex:e.unref(u)}),"aria-labelledby":!a.hideHeader&&a.title?`modal-title-${c.id}`:void 0,onClick:v},[e.createElementVNode("div",{class:e.normalizeClass(["cstu-modal-dialog",a.dialogClass,{"cstu-modal-fullscreen":a.fullscreen,"cstu-modal-dialog-centered":a.centered&&!a.fullscreen,"cstu-modal-dialog-scrollable":a.scrollable,[`cstu-modal-${a.size}`]:a.size&&!a.fullscreen}]),onClick:S[4]||(S[4]=j=>j.target===j.currentTarget&&j.stopPropagation())},[ZL,e.createElementVNode("div",{class:e.normalizeClass(["cstu-modal-content",a.contentClass,{"cstu-modal-content-fullscreen":a.fullscreen},e.unref(p)]),tabindex:"-1",ref_key:"modalElement",ref:s,"aria-label":a.ariaLabel,onClick:S[3]||(S[3]=j=>j.target===j.currentTarget&&j.stopPropagation())},[a.hideHeader?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("header",{key:0,class:e.normalizeClass(["cstu-modal-header",a.headerClass,{"show-divider":a.showHeaderDivider||a.showDividers}])},[e.renderSlot(A.$slots,"modal-header",{},()=>[e.renderSlot(A.$slots,"modal-title",{},()=>[e.createElementVNode("h5",{id:`modal-title-${c.id}`,class:e.normalizeClass([c.titleClass||"cstu-modal-title",{"sr-only":a.titleSrOnly}])},e.toDisplayString(a.title),11,GL)]),a.hideHeaderClose?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button","aria-label":a.closeTitle,class:"cstu-close cstu-self-baseline",onClick:S[0]||(S[0]=j=>f("headerClose"))},KL,8,XL))])],2)),e.createElementVNode("div",{class:e.normalizeClass(["cstu-modal-body",a.bodyClass,{"cstu-modal-body-scrollable":a.scrollable}])},[e.renderSlot(A.$slots,"default",{},()=>[a.content?(e.openBlock(),e.createElementBlock("div",QL,e.toDisplayString(a.content),1)):e.createCommentVNode("",!0)])],2),a.hideFooter?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("footer",{key:1,class:e.normalizeClass(["cstu-modal-footer",a.footerClass,{"show-divider":a.showFooterDivider||a.showDividers}])},[e.renderSlot(A.$slots,"modal-footer",{},()=>[a.okOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(_,{key:0,variant:a.cancelVariant,color:a.cancelColor,disabled:a.cancelDisabled||a.busy,onClick:S[1]||(S[1]=j=>f("cancel"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.cancelTitle),1)]),_:1},8,["variant","color","disabled"])),e.createVNode(_,{variant:a.okVariant,color:a.okColor,disabled:a.okDisabled||a.busy,loading:a.busy,onClick:S[2]||(S[2]=j=>f("ok"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.okTitle),1)]),_:1},8,["variant","color","disabled","loading"])])],2))],10,WL),JL],2)],14,UL)):e.createCommentVNode("",!0)]),_:3})],8,["disabled"]))}});const eI={mounted(a,o){const n=typeof o.value=="string"?o.value:Object.keys(o.modifiers)[0];if(!n){console.warn("v-cstu-modal directive requires a modal ID");return}a.addEventListener("click",()=>{lw.show(n)}),a.tagName!=="BUTTON"&&(a.setAttribute("role","button"),a.addEventListener("keydown",c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),lw.show(n))}),a.hasAttribute("tabindex")||a.setAttribute("tabindex","0"))}},tI={install:a=>{a.directive("cstu-modal",eI)}},aI=["primary","secondary","success","warning","info"];function Tw(a,o=aI){if(!a||!o||o.length===0)return"primary";let n=0;for(let r=0;r<a.length;r+=1)n=a.charCodeAt(r)+((n<<5)-n);const c=Math.abs(n)%o.length;return o[c]}function Dw(a){return!a||typeof a!="string"?"":a.trim().split(" ").slice(0,2).map(o=>o.charAt(0).toUpperCase()).join("")}const oI=["src","alt"],cI=["title"],nI={key:1,"data-avatar-placeholder-icon":"true",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rI=e.createElementVNode("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"},null,-1),lI=[rI],Fw=e.defineComponent({__name:"Avatar",props:{size:{default:"md"},radius:{default:"full"},color:{default:"primary"},gradient:null,src:{default:null},alt:null,imageProps:null,children:null,autoContrast:{type:Boolean,default:!0},name:null,allowedInitialsColors:null,variant:{default:"light"},component:{default:"div"},hover:{type:Boolean,default:!1},customClasses:{default:""}},setup(a){const o=a,n=e.ref(!o.src);e.watch(()=>o.src,u=>{n.value=!u},{immediate:!0});const c=u=>u?["primary","secondary","success","warning","danger","info","dark","light","initials"].includes(u):!0,r=e.computed(()=>o.name?Dw(o.name):""),l=e.computed(()=>{const u={sm:"w-5 h-5 text-xs",md:"w-6 h-6 text-xs",lg:"w-[30px] h-[30px] text-sm",xl:"w-[32px] h-[32px] text-sm","2xl":"w-[34px] h-[34px] text-base","3xl":"w-[36px] h-[36px] text-base","4xl":"w-[38px] h-[38px] text-lg","5xl":"w-[52px] h-[52px] text-xl"};return typeof o.size=="string"?u[o.size]||u.md:typeof o.size=="number"?`w-[${o.size}px] h-[${o.size}px]`:u.md}),i=e.computed(()=>re(o.radius)),s=e.computed(()=>{if(o.src&&!n.value||!c(o.color)&&o.color!=="initials")return"";if(o.color==="initials"&&o.name){const w=Tw(o.name,o.allowedInitialsColors||["primary","secondary","success","warning","info"]);return w?O(w,"filled",{}):O("primary","filled",{})}const u=o.variant==="transparent"?"default":o.variant==="gradient"?"filled":o.variant,y=o.color&&o.color!=="initials"?o.color:"primary",p=O(y,u,{});return o.variant==="transparent"?"bg-transparent":p}),d=e.computed(()=>!c(o.color)&&o.color!=="initials"?"":o.variant==="transparent"?"bg-transparent":o.variant==="gradient"&&o.gradient?`bg-gradient-to-r from-${o.gradient.from} to-${o.gradient.to}`:Ex(o.variant)),h=e.computed(()=>{if(o.src&&!n.value||c(o.color)||o.color==="initials")return{};const u={};switch(o.variant){case"filled":u.backgroundColor=o.color,o.autoContrast&&(u.color="white");break;case"light":u.backgroundColor=`${o.color}20`,u.color=o.color;break;case"outline":u.backgroundColor="transparent",u.color=o.color,u.border=`1px solid ${o.color}`;break;case"transparent":u.backgroundColor="transparent",u.color=o.color;break}return u}),k=u=>{var y;if((y=o.imageProps)!=null&&y.onError){o.imageProps.onError(u);return}n.value=!0};return(u,y)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.component||"div"),{class:e.normalizeClass(["avatar",e.unref(l),e.unref(i),!n.value&&a.src?"":e.unref(s),!n.value&&a.src?"":e.unref(d),{"avatar--with-image":!n.value&&a.src},{"hover:opacity-80 transition-opacity":a.hover},a.customClasses]),style:e.normalizeStyle(e.unref(h))},{default:e.withCtx(()=>[!n.value&&a.src?(e.openBlock(),e.createElementBlock("img",e.mergeProps({key:0,class:"avatar__image",src:a.src,alt:a.alt},a.imageProps,{onError:k}),null,16,oI)):(e.openBlock(),e.createElementBlock("span",{key:1,class:"avatar__placeholder",title:a.alt},[e.renderSlot(u.$slots,"default",{},()=>[a.name?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(r)),1)],64)):(e.openBlock(),e.createElementBlock("svg",nI,lI))])],8,cI))]),_:3},8,["class","style"]))}});const $w=e.defineComponent({__name:"AvatarGroup",props:{spacing:{default:"sm"},gap:{default:"none"},outlineWidth:{default:"normal"},outlineColor:{default:"white"},outlineOffset:{default:"small"},customClasses:{default:""},max:null,hover:{type:Boolean,default:!1}},setup(a){const o=a,n=e.computed(()=>{if(typeof o.spacing=="number")return`${o.spacing}px`;const h={xs:"-1rem",sm:"-0.75rem",md:"-0.5rem",lg:"-0.25rem",xl:"0"};return h[o.spacing]||h.sm}),c=e.computed(()=>{if(typeof o.gap=="number")return`${o.gap}px`;if(typeof o.gap=="string"&&!isNaN(parseFloat(o.gap)))return o.gap;const h={none:"0",xs:"0.25rem",sm:"0.5rem",md:"0.75rem",lg:"1rem"};return h[o.gap]||h.none}),r=e.computed(()=>{if(typeof o.outlineWidth=="number")return`${o.outlineWidth}px`;if(typeof o.outlineWidth=="string"&&!isNaN(parseFloat(o.outlineWidth)))return o.outlineWidth;const h={none:"0",thin:"1px",normal:"2px",medium:"3px",thick:"4px"};return h[o.outlineWidth]||h.normal}),l=e.computed(()=>{if(typeof o.outlineOffset=="number")return`${o.outlineOffset}px`;if(typeof o.outlineOffset=="string"&&!isNaN(parseFloat(o.outlineOffset)))return o.outlineOffset;const h={none:"0",inset:"-2px",small:"1px",medium:"2px",large:"3px"};return h[o.outlineOffset]||h.small}),i=e.computed(()=>typeof o.outlineColor=="string"&&["primary","secondary","success","danger","warning","info","dark","light"].includes(o.outlineColor)?`outline-${o.outlineColor}`:""),s=e.computed(()=>typeof o.outlineColor=="string"&&["primary","secondary","success","danger","warning","info","dark","light"].includes(o.outlineColor)?"var(--color-"+o.outlineColor+")":o.outlineColor),d=e.computed(()=>({"--avatar-group-spacing":n.value,"--avatar-group-gap":c.value,"--avatar-group-outline-width":r.value,"--avatar-group-outline-color":s.value,"--avatar-group-outline-offset":l.value}));return(h,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["avatar-group",a.customClasses,e.unref(i),{"avatar-group--hover":a.hover}]),style:e.normalizeStyle(e.unref(d))},[e.renderSlot(h.$slots,"default")],6))}});Fw.Group=$w;const ux=e.defineComponent({__name:"Tabs",props:{value:{type:String,default:void 0},defaultValue:{type:String,default:"first"},orientation:{type:String,default:"horizontal"},placement:{type:String,default:void 0},variant:{type:String,default:"text"}},emits:["change"],setup(a,{emit:o}){const n=a,c=e.computed(()=>n.placement?n.placement:n.orientation==="horizontal"?"top":"left"),r=e.computed(()=>n.orientation),l=e.computed(()=>n.variant),i=e.ref(n.value!==void 0?n.value:n.defaultValue);e.watch(()=>n.value,d=>{d!==void 0&&(i.value=d)});const s=d=>{n.value!==void 0?o("change",d):i.value=d};return e.provide("activeTab",i),e.provide("setActiveTab",s),e.provide("tabsOrientation",r),e.provide("tabsPlacement",c),(d,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cstu-tabs",`cstu-tabs-${e.unref(r)}`,`cstu-tabs-placement-${e.unref(c)}`,`cstu-tabs-variant-${e.unref(l)}`])},[e.renderSlot(d.$slots,"default")],2))}});const Nw=e.defineComponent({__name:"TabsList",props:{justify:{type:String,default:"flex-start"},divider:{type:Boolean,default:!1}},setup(a){const o=a,n=e.inject("tabsOrientation",e.ref("horizontal")),c=e.inject("tabsPlacement",e.ref("top")),r=e.computed(()=>["tabs-list",`tabs-list-${n.value}`,`tabs-list-placement-${c.value}`,o.divider?"tabs-list-with-divider":""]),l=s=>{if(["space-between","space-around","space-evenly"].includes(s))return s;switch(s){case"flex-start":return"flex-start";case"flex-end":return"flex-end";case"center":return"center";default:return"flex-start"}},i=e.computed(()=>n.value==="horizontal"?{justifyContent:o.justify}:{justifyContent:l(o.justify)});return(s,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(r)),style:e.normalizeStyle(e.unref(i))},[e.renderSlot(s.$slots,"default")],6))}});const Rw=e.defineComponent({__name:"TabsTab",props:{value:{type:String,required:!0},color:{type:String,default:"primary"},variant:{type:String,default:"text"},size:{type:String,default:"md"},radius:{type:String,default:"md"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},fullWidth:{type:Boolean,default:!1}},setup(a){const o=a,n=e.inject("activeTab",e.ref("")),c=e.inject("setActiveTab",()=>{}),r=e.inject("tabsOrientation",e.ref("horizontal")),l=e.inject("tabsPlacement",e.ref("top")),i=e.computed(()=>n.value),s=e.computed(()=>r.value),d=e.computed(()=>l.value),h=e.computed(()=>i.value===o.value),k=e.computed(()=>s.value==="vertical"),u=e.computed(()=>o.fullWidth&&s.value==="horizontal"),y=()=>{!o.disabled&&!o.loading&&c(o.value)};return(p,w)=>(e.openBlock(),e.createBlock(e.unref(_),{class:e.normalizeClass(["tabs-tab",e.unref(h)?"tabs-tab-active":"tabs-tab-inactive",`tabs-tab-${o.variant}`,o.color?`tabs-tab-color-${o.color}`:"",`tabs-tab-orientation-${e.unref(s)}`,`tabs-tab-placement-${e.unref(d)}`,{"tabs-tab-full-width":e.unref(u)}]),disabled:o.disabled,loading:o.loading,color:e.unref(h)?o.color:"light",variant:e.unref(h)?o.variant:"subtle",size:o.size,radius:o.variant==="text"?"none":o.radius,"full-width":e.unref(k),onClick:y},e.createSlots({default:e.withCtx(()=>[e.renderSlot(p.$slots,"default")]),_:2},[p.$slots.leftSection?{name:"leftSection",fn:e.withCtx(()=>[e.renderSlot(p.$slots,"leftSection")]),key:"0"}:void 0,p.$slots.rightSection?{name:"rightSection",fn:e.withCtx(()=>[e.renderSlot(p.$slots,"rightSection")]),key:"1"}:void 0]),1032,["class","disabled","loading","color","variant","size","radius","full-width"]))}});const Ow=e.defineComponent({__name:"TabsPanel",props:{value:{type:String,required:!0},KeepAlive:{type:Boolean,default:!1}},setup(a){const o=a,n=e.inject("activeTab",e.ref("")),c=e.inject("tabsOrientation",e.ref("horizontal")),r=e.inject("tabsPlacement",e.ref("top")),l=e.computed(()=>n.value===o.value),i=e.computed(()=>["tabs-panel",l.value?"tabs-panel-active":"tabs-panel-inactive",`tabs-panel-${c.value}`,`tabs-panel-placement-${r.value}`]);return(s,d)=>a.KeepAlive||e.unref(l)?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(i))},[e.renderSlot(s.$slots,"default")],2)),[[e.vShow,e.unref(l)]]):e.createCommentVNode("",!0)}});ux.List=Nw;ux.Tab=Rw;ux.Panel=Ow;const sI=e.createElementVNode("span",{class:"cstu-sr-only"},"First page",-1),iI=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"cstu-h-4 cstu-w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("polyline",{points:"11 17 6 12 11 7"}),e.createElementVNode("polyline",{points:"18 17 13 12 18 7"})],-1),dI=e.createElementVNode("span",{class:"cstu-sr-only"},"Previous page",-1),hI=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"cstu-h-4 cstu-w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1),uI={key:2,class:"cstu-flex cstu-items-center cstu-gap-2"},yI=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"cstu-h-4 cstu-w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"1"}),e.createElementVNode("circle",{cx:"19",cy:"12",r:"1"}),e.createElementVNode("circle",{cx:"5",cy:"12",r:"1"})],-1),pI=[yI],kI=e.createElementVNode("span",{class:"cstu-sr-only"},"Next page",-1),mI=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"cstu-h-4 cstu-w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1),fI=e.createElementVNode("span",{class:"cstu-sr-only"},"Last page",-1),vI=e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"cstu-h-4 cstu-w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("polyline",{points:"13 17 18 12 13 7"}),e.createElementVNode("polyline",{points:"6 17 11 12 6 7"})],-1),gI=e.defineComponent({__name:"Pagination",props:{modelValue:{default:1},total:null,siblings:{default:1},boundaries:{default:1},variant:{default:"filled"},color:{default:"primary"},size:{default:"md"},disabled:{type:Boolean,default:!1},withControls:{type:Boolean,default:!0},withEdges:{type:Boolean,default:!1},withPages:{type:Boolean,default:!0},class:null},emits:["update:modelValue"],setup(a,{emit:o}){const n=a,c=e.ref(n.modelValue);e.watch(()=>n.modelValue,y=>{c.value=y});const r=e.computed(()=>c.value===1),l=e.computed(()=>c.value===n.total),i=e.computed(()=>{switch(n.size){case"xs":return"cstu-!h-[30px] cstu-!w-[30px] cstu-min-w-[30px] !cstu-p-0";case"sm":return"cstu-!h-[36px] cstu-!w-[36px] cstu-min-w-[36px] !cstu-p-0";case"md":return"cstu-!h-[40px] cstu-!w-[40px] cstu-min-w-[40px] !cstu-p-0";case"lg":return"cstu-!h-[45px] cstu-!w-[45px] cstu-min-w-[45px] !cstu-p-0";case"xl":return"cstu-!h-[50px] cstu-!w-[50px] cstu-min-w-[50px] !cstu-p-0";default:return"cstu-!h-[40px] cstu-!w-[40px] cstu-min-w-[40px] !cstu-p-0"}}),s=e.computed(()=>["cstu-flex cstu-items-center cstu-justify-center",k(n.size)]),d=e.computed(()=>{const y=[],p=n.total;if(n.siblings*2+3+n.boundaries*2>=p)return Array.from({length:p},(M,q)=>q+1);const C=Math.max(c.value-n.siblings,n.boundaries+1),m=Math.min(c.value+n.siblings,p-n.boundaries),b=C>n.boundaries+2,f=m<p-(n.boundaries+1),v=new Set;for(let M=1;M<=n.boundaries;M++)y.push(M),v.add(M);if(b)y.push("dots");else if(!b&&C>n.boundaries)for(let M=n.boundaries+1;M<C;M++)v.has(M)||(y.push(M),v.add(M));for(let M=C;M<=m;M++)v.has(M)||(y.push(M),v.add(M));if(f)y.push("dots");else if(!f&&m<p-n.boundaries)for(let M=m+1;M<p-n.boundaries+1;M++)v.has(M)||(y.push(M),v.add(M));for(let M=p-n.boundaries+1;M<=p;M++)v.has(M)||(y.push(M),v.add(M));return y}),h=y=>{y<1||y>n.total||n.disabled||(c.value=y,o("update:modelValue",y))};function k(y){const p={xs:"cstu-h-6 cstu-w-6 cstu-text-xs",sm:"cstu-h-7 cstu-w-7 cstu-text-sm",md:"cstu-h-8 cstu-w-8 cstu-text-sm",lg:"cstu-h-9 cstu-w-9 cstu-text-base",xl:"cstu-h-10 cstu-w-10 cstu-text-base"};return p[y]||p.md}const u=e.computed(()=>n.variant==="filled"?"subtle":"bordered-transparent");return(y,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cstu-flex cstu-items-center cstu-gap-2",[n.class]])},[n.withEdges?(e.openBlock(),e.createBlock(_,{key:0,variant:e.unref(u),color:"light",size:n.size,disabled:e.unref(r)||n.disabled,onClick:p[0]||(p[0]=w=>h(1)),"aria-label":"Go to first page",class:e.normalizeClass(e.unref(i))},{default:e.withCtx(()=>[sI,iI]),_:1},8,["variant","size","disabled","class"])):e.createCommentVNode("",!0),n.withControls?(e.openBlock(),e.createBlock(_,{key:1,variant:e.unref(u),color:"light",size:n.size,disabled:e.unref(r)||n.disabled,onClick:p[1]||(p[1]=w=>h(c.value-1)),"aria-label":"Go to previous page",class:e.normalizeClass(e.unref(i))},{default:e.withCtx(()=>[dI,hI]),_:1},8,["variant","size","disabled","class"])):e.createCommentVNode("",!0),n.withPages?(e.openBlock(),e.createElementBlock("div",uI,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),(w,C)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C},[w!=="dots"?(e.openBlock(),e.createBlock(_,{key:0,variant:w===c.value?"filled":e.unref(u),color:w===c.value?n.color:"light",size:n.size,disabled:n.disabled,onClick:m=>h(Number(w)),"aria-current":w===c.value?"page":void 0,"aria-label":`Page ${w}`,class:e.normalizeClass(e.unref(i))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w),1)]),_:2},1032,["variant","color","size","disabled","onClick","aria-current","aria-label","class"])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["pagination-dots",[e.unref(s),e.unref(i)]])},pI,2))],64))),128))])):e.createCommentVNode("",!0),n.withControls?(e.openBlock(),e.createBlock(_,{key:3,variant:e.unref(u),color:"light",size:n.size,disabled:e.unref(l)||n.disabled,onClick:p[2]||(p[2]=w=>h(c.value+1)),"aria-label":"Go to next page",class:e.normalizeClass(e.unref(i))},{default:e.withCtx(()=>[kI,mI]),_:1},8,["variant","size","disabled","class"])):e.createCommentVNode("",!0),n.withEdges?(e.openBlock(),e.createBlock(_,{key:4,variant:e.unref(u),color:"light",size:n.size,disabled:e.unref(l)||n.disabled,onClick:p[3]||(p[3]=w=>h(n.total)),"aria-label":"Go to last page",class:e.normalizeClass(e.unref(i))},{default:e.withCtx(()=>[fI,vI]),_:1},8,["variant","size","disabled","class"])):e.createCommentVNode("",!0)],2))}}),Uw={mounted(a,o){a._clickOutside=n=>{const c=n.target;if(!(a===c||a.contains(c))){const r=n.target,l=r.tagName&&r.tagName.toLowerCase()==="input",i=r.closest(".cstu-dropdown-menu");!l&&!i&&o.value(n)}},document.addEventListener("click",a._clickOutside,!0),document.addEventListener("touchstart",a._clickOutside,!0)},unmounted(a){a._clickOutside&&(document.removeEventListener("click",a._clickOutside,!0),document.removeEventListener("touchstart",a._clickOutside,!0))}},MI=["id","aria-labelledby","aria-modal","onKeydown"],xI={class:"cstu-popover-inner"},wI=["id"],bI=e.defineComponent({__name:"Popover",props:{open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:!1},placement:{default:"bottom"},variant:{default:"shadow"},color:{default:"primary"},size:{default:"md"},radius:{default:"md"},hideHeader:{type:Boolean,default:!1},showCloseIcon:{type:Boolean,default:!0},hideFooter:{type:Boolean,default:!0},closeOnClickOutside:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},closeOnClick:{type:Boolean,default:!1},title:{default:""},content:{default:""},zIndex:{default:1e3},trigger:{default:"click"},backdrop:{type:[Boolean,String],default:!1},offsetDistance:{default:8},disabled:{type:Boolean,default:!1},popoverClass:{default:""},headerClass:{default:""},bodyClass:{default:""},footerClass:{default:""},trapFocus:{type:Boolean,default:!1},id:{default:()=>`popover-${Date.now()}`},shadow:{default:"md"},width:null},emits:["update:open","open","close"],setup(a,{emit:o}){const n=a,c=e.ref(n.defaultOpen),r=e.ref(null),l=e.ref(null),i=e.ref(null),s=e.ref(null),d=e.ref(n.zIndex);n.open!==void 0&&(c.value=n.open);const h=e.computed(()=>{if(n.placement!=="auto")return n.placement}),k=e.computed(()=>{const g=[sx(n.offsetDistance)];return i.value&&g.push(Aw({element:i})),n.placement==="auto"?g.push(Bw({padding:8})):g.push(dx({fallbackPlacements:["top","bottom","left","right"],padding:8})),g.push(ix({padding:8})),g}),{floatingStyles:u,update:y}=hx(r,l,{placement:h,middleware:k,whileElementsMounted:Vw}),p=g=>{n.disabled||(n.trigger==="click"||n.trigger==="manual")&&T()},w=()=>{n.disabled||n.trigger==="hover"&&M()},C=()=>{n.disabled||n.trigger==="hover"&&setTimeout(()=>{q("hover")},100)},m=g=>{n.closeOnClick&&q("popoverClick"),g.stopPropagation()},b=g=>{n.closeOnClickOutside&&c.value&&l.value&&!l.value.contains(g.target)&&r.value&&!r.value.contains(g.target)&&q("clickAway")},f=()=>{n.closeOnClickOutside&&q("backdrop")},v=g=>{n.closeOnEscape&&g.key==="Escape"&&(g.preventDefault(),q("escape"))},M=()=>{n.disabled||c.value||(s.value=document.activeElement,c.value=!0,e.nextTick(()=>{y(),n.trapFocus&&I()}),o("open"),o("update:open",!0))},q=(g="programmatic")=>{c.value&&(c.value=!1,n.trapFocus&&F(s.value),o("close",g),o("update:open",!1))},T=()=>{c.value?q():M()},I=()=>{if(!l.value)return;const g=A(l.value);g.length>0?g[0].focus():l.value.focus()},F=g=>{g&&typeof g.focus=="function"&&g.focus()},A=g=>Array.from(g.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(H=>!H.hasAttribute("disabled")&&!H.getAttribute("aria-hidden")),S=g=>{if(!c.value||!n.trapFocus||!l.value)return;const H=g.target;l.value.contains(H)||(g.preventDefault(),I())};e.watch(()=>n.open,g=>{g!==c.value&&(g?M():q())}),e.watch(r,g=>{g&&y()}),e.onMounted(()=>{document.addEventListener("keydown",v),n.trapFocus&&document.addEventListener("focusin",S)}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",v),n.trapFocus&&document.removeEventListener("focusin",S)});const j=e.computed(()=>[re(n.radius),!n.variant||n.variant==="shadow"?n.shadow?`cstu-shadow-${n.shadow}`:"cstu-shadow-md":"",n.popoverClass]),N=e.computed(()=>{const g=[...j.value.filter(Boolean)];let H=!1;const $=n.color;if($&&te($)&&n.variant==="color"){const G=O($,"filled",{disabled:n.disabled});typeof G=="string"&&G.trim()&&(g.push(...G.split(" ").filter(Boolean)),H=!0)}return H||(g.push("cstu-bg-white"),n.variant==="outline"&&g.push("cstu-border","cstu-border-gray-300"),g.push("cstu-text-gray-700")),g.filter(Boolean).map(G=>typeof G=="string"?G:Object.keys(G).filter(Be=>G[Be]).join(" ")).join(" ")}),W=e.computed(()=>{const g={width:typeof n.width=="number"?`${n.width}px`:n.width},H=n.color;if(H&&!te(H)&&n.variant==="color"){g.backgroundColor=H;const $=R(H);g.color=$>128?"#000000":"#FFFFFF"}return{...u.value,...g}});e.computed(()=>{const g={backgroundColor:"white"},H=n.color;return n.variant==="color"&&H?te(H)?(g.borderWidth="1px",g.borderStyle="solid",g.borderColor=`var(--${H}-500)`):g.backgroundColor=H:n.variant==="outline"&&(g.borderWidth="1px",g.borderStyle="solid",g.borderColor="#e2e8f0"),g});function R(g){if(g.startsWith("#"))try{const H=parseInt(g.substring(1,3),16),$=parseInt(g.substring(3,5),16),G=parseInt(g.substring(5,7),16);return(H*299+$*587+G*114)/1e3}catch{return 128}else if(g.startsWith("rgb"))try{const H=g.match(/\d+/g);if(H&&H.length>=3){const $=parseInt(H[0],10),G=parseInt(H[1],10),Be=parseInt(H[2],10);return($*299+G*587+Be*114)/1e3}}catch{return 128}return 128}const ae=e.computed(()=>{const g=n.color,H=!(g&&te(g)),$=n.variant==="outline";return["cstu-popover-header",{xs:"cstu-px-2 cstu-py-1.5",sm:"cstu-px-2.5 cstu-py-1.5",md:"cstu-px-3 cstu-py-2",lg:"cstu-px-3.5 cstu-py-2.5",xl:"cstu-px-4 cstu-py-3"}[n.size||"md"],m2(n.size||"md"),"cstu-flex cstu-items-center cstu-justify-between",$||H?"cstu-border-b cstu-border-gray-200 dark:cstu-border-gray-700":"",n.headerClass].filter(Boolean).join(" ")}),J=e.computed(()=>["cstu-popover-body",{xs:"cstu-p-2",sm:"cstu-p-2.5",md:"cstu-p-3",lg:"cstu-p-3.5",xl:"cstu-p-4"}[n.size||"md"],m2(n.size||"sm"),n.bodyClass].filter(Boolean).join(" ")),Z=e.computed(()=>{const g=n.color,H=!(g&&te(g)),$=n.variant==="outline";return["cstu-popover-footer",{xs:"cstu-px-2 cstu-py-1.5",sm:"cstu-px-2.5 cstu-py-1.5",md:"cstu-px-3 cstu-py-2",lg:"cstu-px-3.5 cstu-py-2.5",xl:"cstu-px-4 cstu-py-3"}[n.size||"md"],$||H?"cstu-border-t cstu-border-gray-200 dark:cstu-border-gray-700":"","cstu-flex cstu-justify-end cstu-space-x-2",n.footerClass].filter(Boolean).join(" ")});return(g,H)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{ref_key:"triggerRef",ref:r,class:e.normalizeClass(["cstu-inline-block cstu-popover-trigger",{"cstu-cursor-not-allowed cstu-opacity-70":a.disabled}]),onClick:p,onMouseenter:w,onMouseleave:C},[e.renderSlot(g.$slots,"trigger")],34),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"fade",appear:""},{default:e.withCtx(()=>[c.value&&a.backdrop!==!1?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["cstu-popover-backdrop",{"cstu-bg-black/50":a.backdrop===!0,"cstu-bg-transparent":a.backdrop==="transparent"}]),style:e.normalizeStyle({zIndex:a.zIndex-10}),onClick:f},null,6)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{"enter-active-class":"cstu-transition cstu-ease-out cstu-duration-100","enter-from-class":"cstu-transform cstu-opacity-0 cstu-scale-95","enter-to-class":"cstu-transform cstu-opacity-100 cstu-scale-100","leave-active-class":"cstu-transition cstu-ease-in cstu-duration-75","leave-from-class":"cstu-transform cstu-opacity-100 cstu-scale-100","leave-to-class":"cstu-transform cstu-opacity-0 cstu-scale-95"},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cstu-popover-container",style:e.normalizeStyle({zIndex:d.value})},[e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"popoverRef",ref:l,id:n.id,class:e.normalizeClass(e.unref(N)),style:e.normalizeStyle([e.unref(u),e.unref(W)]),role:"dialog","aria-labelledby":n.title?`${n.id}-title`:void 0,"aria-modal":n.trapFocus,tabindex:"-1",onClick:m,onKeydown:e.withKeys(v,["esc"])},[e.createElementVNode("div",xI,[n.hideHeader?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(ae))},[e.renderSlot(g.$slots,"header",{},()=>[e.createElementVNode("h3",{id:`${n.id}-title`,class:e.normalizeClass(["cstu-popover-title cstu-font-medium",e.unref(m2)(n.size||"md")])},e.toDisplayString(n.title),11,wI),n.showCloseIcon?(e.openBlock(),e.createBlock(_,{key:0,icon:"X",variant:"text",size:"xs",color:n.color&&e.unref(te)(n.color)?"white":"gray",class:"cstu-ml-auto","aria-label":"Close popover",onClick:H[0]||(H[0]=e.withModifiers($=>q("headerClose"),["stop"]))},null,8,["color"])):e.createCommentVNode("",!0)])],2)),e.createElementVNode("div",{class:e.normalizeClass(e.unref(J))},[e.renderSlot(g.$slots,"default",{},()=>[a.content?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(m2)(n.size||"sm"))},e.toDisplayString(a.content),3)):e.createCommentVNode("",!0)])],2),n.hideFooter?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(Z))},[e.renderSlot(g.$slots,"footer",{},()=>[e.createVNode(_,{size:"sm",variant:"subtle",onClick:H[1]||(H[1]=$=>q("cancel"))},{default:e.withCtx(()=>[e.createTextVNode(" Close ")]),_:1})])],2))])],46,MI)),[[e.unref(Uw),b]])],4)):e.createCommentVNode("",!0)]),_:3})]))],64))}});const CI=e.defineComponent({__name:"Breadcrumbs",props:{separator:{default:"/"},separatorMargin:{default:"xs"},size:{default:"md"},radius:{default:"md"},color:{default:"primary"},highlightActive:{type:Boolean,default:!0},class:null,separatorClass:null,activeClass:null},setup(a){const o=a,n=e.useSlots(),c=e.computed(()=>!!n.default),r=e.computed(()=>n.default?n.default():[]),l=u=>u===r.value.length-1,i=u=>u?["primary","secondary","success","warning","danger","info","dark","light"].includes(u):!0,s=u=>{if(!l(u)||!o.highlightActive)return"";if(i(o.color)){const y=Ce[o.color];if(y)return`cstu-text-${y.base}-${y.main}`}return""},d=u=>!l(u)||!o.highlightActive?{}:i(o.color)?{}:{color:o.color},h=e.computed(()=>{const u={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg",xl:"text-xl"};return u[o.size]||u.md}),k=e.computed(()=>{const u={xs:"mx-1",sm:"mx-2",md:"mx-3",lg:"mx-4",xl:"mx-5"};return u[o.separatorMargin]||u.xs});return(u,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cstu-breadcrumbs",o.class])},[e.unref(c)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(e.unref(r),(p,w)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:w},[e.createElementVNode("div",{class:e.normalizeClass(["cstu-breadcrumb-item",e.unref(h),l(w)?"cstu-breadcrumb-active":"cstu-breadcrumb-inactive",l(w)?o.activeClass:"",l(w)&&o.highlightActive?s(w):""]),style:e.normalizeStyle(d(w))},[e.renderSlot(u.$slots,`item-${w}`,{isActive:l(w)},()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(p)))])],6),l(w)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["cstu-breadcrumb-separator",e.unref(k),o.separatorClass])},[e.renderSlot(u.$slots,"separator",{},()=>[typeof o.separator=="string"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(o.separator),1)],64)):o.separator?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.separator),{key:1})):e.createCommentVNode("",!0)])],2))],64))),128)):e.renderSlot(u.$slots,"default",{key:0})],2))}});const LI={key:0,class:"cstu-flex cstu-justify-between cstu-items-center cstu-mb-1"},II=["for"],SI={key:0,class:"cstu-text-red-500 cstu-ml-1"},zI={key:0,class:"cstu-flex cstu-items-center cstu-justify-center cstu-w-[15px] cstu-h-[15px] cstu-mt-1"},qI=["id","value","placeholder","disabled","required","readonly","rows","maxlength"],VI={key:1,class:"cstu-flex cstu-items-center cstu-justify-center cstu-w-[15px] cstu-h-[15px] cstu-mt-1"},BI=e.defineComponent({__name:"Textarea",props:{id:null,modelValue:null,placeholder:null,disabled:{type:Boolean},readonly:{type:Boolean},label:null,labelProps:null,description:null,descriptionProps:null,error:null,errorProps:null,hasError:{type:Boolean},showBothErrorAndDescription:{type:Boolean},textareaProps:null,size:null,radius:null,variant:null,required:{type:Boolean},withAsterisk:{type:Boolean},rows:null,resize:null,fullWidth:{type:Boolean},color:null,class:null,inputClass:null,maxLength:null},emits:["update:modelValue","focus","blur","change"],setup(a,{expose:o,emit:n}){const c=a,r=`textarea-${Math.random().toString(36).substring(2,11)}`,l=e.ref(null),i=e.computed(()=>c.hasError??!1),s=e.computed(()=>c.disabled??!1),d=e.computed(()=>c.readonly??!1),h=e.computed(()=>c.required??!1),k=e.computed(()=>c.withAsterisk??!1),u=e.computed(()=>c.showBothErrorAndDescription??!1),y=e.computed(()=>c.size??"md"),p=e.computed(()=>c.variant??"default"),w=e.computed(()=>c.radius??"md"),C=e.computed(()=>c.color??"primary"),m=e.computed(()=>c.fullWidth??!1),b=e.computed(()=>c.inputClass??""),f=e.computed(()=>c.rows??3),v=e.computed(()=>c.resize??"none"),M={xs:{inputClass:`cstu-min-h-8 ${m.value?"cstu-w-full":"cstu-max-w-[20.5rem]"}`,labelSize:"cstu-text-xs cstu-font-medium",descriptionSize:"cstu-text-xs"},sm:{inputClass:`cstu-min-h-9 ${m.value?"cstu-w-full":"cstu-max-w-[20.5rem]"}`,labelSize:"cstu-text-sm cstu-font-medium",descriptionSize:"cstu-text-xs"},md:{inputClass:`cstu-min-h-10 ${m.value?"cstu-w-full":"cstu-max-w-[20.5rem]"}`,labelSize:"cstu-text-sm cstu-font-medium",descriptionSize:"cstu-text-sm"},lg:{inputClass:`cstu-min-h-11 ${m.value?"cstu-w-full":"cstu-max-w-[20.5rem]"}`,labelSize:"cstu-text-sm cstu-font-medium",descriptionSize:"cstu-text-sm"},xl:{inputClass:`cstu-min-h-12 ${m.value?"cstu-w-full":"cstu-max-w-[20.5rem]"}`,labelSize:"cstu-text-base cstu-font-medium",descriptionSize:"cstu-text-sm"}},q=e.computed(()=>`${M[y.value].inputClass.split(" ")[0]} cstu-transition-all cstu-duration-300`),T=e.computed(()=>M[y.value].labelSize),I=e.computed(()=>M[y.value].descriptionSize),F=e.computed(()=>{switch(y.value){case"xs":return"cstu-text-xs";case"sm":return"cstu-text-sm";case"md":return"cstu-text-sm";case"lg":return"cstu-text-base";case"xl":return"cstu-text-base";default:return"cstu-text-sm"}}),A=e.computed(()=>re(w.value)),S=e.computed(()=>c.error!==void 0&&c.error!==""||i.value),j=e.computed(()=>p.value==="unstyled"||!te(C.value)&&!S.value?"":S.value?"cstu-border-red-500 hover:cstu-border-red-500 focus-within:cstu-border-red-500 focus-within:cstu-ring-1 focus-within:cstu-ring-red-500":p.value==="default"||p.value==="outline"?`cstu-border-${C.value}-500 hover:cstu-border-${C.value}-600 focus-within:cstu-border-${C.value}-500 focus-within:cstu-ring-1 focus-within:cstu-ring-${C.value}-500`:""),N=e.computed(()=>p.value==="unstyled"?{}:te(C.value)||S.value?{}:p.value==="default"||p.value==="outline"?{"--border-color":C.value,"border-color":"var(--border-color)"}:p.value==="filled"?{"--bg-color":`${C.value}10`,"background-color":"var(--bg-color)"}:p.value==="light"?{"--bg-color":`${C.value}10`,"--text-color":C.value,"background-color":"var(--bg-color)",color:"var(--text-color)"}:p.value==="subtle"?{"--text-color":C.value,color:"var(--text-color)"}:{}),W=e.computed(()=>{const g={default:"cstu-bg-white cstu-border cstu-transition-colors cstu-duration-150 cstu-px-3",filled:"cstu-bg-gray-100 cstu-border cstu-border-transparent cstu-transition-colors cstu-duration-150 cstu-px-3",light:"cstu-border cstu-transition-colors cstu-duration-150 cstu-px-3",outline:"cstu-bg-white cstu-border cstu-transition-colors cstu-duration-150 cstu-px-3",subtle:"cstu-bg-transparent cstu-transition-colors cstu-duration-150 cstu-px-3",unstyled:"cstu-bg-transparent !cstu-border-0"};if(p.value==="unstyled")return[g[p.value]];const H=S.value?"":p.value==="default"||p.value==="outline"?"cstu-border-gray-300/45":"",$=S.value?"cstu-border-red-500":"";return[g[p.value],H,$,S.value?"hover:cstu-border-red-500":"hover:cstu-border-primary-500",S.value?"focus-within:cstu-border-red-500 focus-within:cstu-ring-1 focus-within:cstu-ring-red-500":"focus-within:cstu-border-primary-500 focus-within:cstu-ring-1 focus-within:cstu-ring-primary-500"]}),R=e.ref(!1),ae=g=>{R.value=!0,n("focus",g)},J=g=>{R.value=!1,n("blur",g)},Z=g=>{n("change",g)};return o({textarea:l,focus:()=>{var g;return(g=l.value)==null?void 0:g.focus()},blur:()=>{var g;return(g=l.value)==null?void 0:g.blur()},select:()=>{var g;return(g=l.value)==null?void 0:g.select()},setSelectionRange:(g,H)=>{var $;return($=l.value)==null?void 0:$.setSelectionRange(g,H)},setRangeText:g=>{var H;return(H=l.value)==null?void 0:H.setRangeText(g)},get value(){var g;return(g=l.value)==null?void 0:g.value},set value(g){l.value&&g!==void 0&&(l.value.value=g)}}),(g,H)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cstu-flex cstu-flex-col cstu-transition-all cstu-duration-300",[c.class,e.unref(m)?"cstu-w-full":"cstu-max-w-[20.5rem]"]])},[c.label||g.$slots.label?(e.openBlock(),e.createElementBlock("div",LI,[e.createElementVNode("label",e.mergeProps({for:c.id||r,class:["cstu-flex cstu-items-center",e.unref(T)]},c.labelProps),[e.renderSlot(g.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(c.label)+" ",1),e.unref(k)||e.unref(h)?(e.openBlock(),e.createElementBlock("span",SI,"*")):e.createCommentVNode("",!0)])],16,II),e.renderSlot(g.$slots,"labelIcon")])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.createElementVNode("div",{class:e.normalizeClass(["cstu-flex cstu-items-start cstu-gap-2 cstu-py-2",e.unref(q),e.unref(A),e.unref(W),e.unref(j),{"cstu-opacity-50 cstu-pointer-events-none cstu-cursor-not-allowed":e.unref(s)}]),style:e.normalizeStyle(e.unref(N))},[g.$slots.leftSection?(e.openBlock(),e.createElementBlock("div",zI,[e.renderSlot(g.$slots,"leftSection")])):e.createCommentVNode("",!0),e.createElementVNode("textarea",e.mergeProps({ref_key:"textareaRef",ref:l,id:c.id||r,value:c.modelValue,placeholder:c.placeholder,disabled:e.unref(s),required:e.unref(h),readonly:e.unref(d),rows:e.unref(f),maxlength:c.maxLength,class:["cstu-flex-1 cstu-bg-transparent cstu-outline-none cstu-w-full",e.unref(F),e.unref(b),{"cstu-text-gray-500":c.modelValue,"cstu-text-red-500":e.unref(S)&&!c.modelValue}],style:{resize:e.unref(v)},onInput:H[0]||(H[0]=$=>g.$emit("update:modelValue",$.target.value)),onFocus:ae,onBlur:J,onChange:Z},c.textareaProps),null,16,qI),g.$slots.rightSection?(e.openBlock(),e.createElementBlock("div",VI,[e.renderSlot(g.$slots,"rightSection")])):e.createCommentVNode("",!0)],6)]),c.description&&!e.unref(S)||g.$slots.description&&!e.unref(S)||e.unref(u)&&c.description||e.unref(u)&&g.$slots.description?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:1,class:"cstu-mt-1"},c.descriptionProps),[e.createElementVNode("p",{class:e.normalizeClass(["cstu-text-gray-500",e.unref(I)])},[e.renderSlot(g.$slots,"description",{},()=>[e.createTextVNode(e.toDisplayString(c.description),1)])],2)],16)):e.createCommentVNode("",!0),e.unref(S)&&c.error||e.unref(S)&&g.$slots.error||e.unref(u)&&c.error||e.unref(u)&&g.$slots.error?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:2,class:"cstu-mt-1"},c.errorProps),[e.createElementVNode("p",{class:e.normalizeClass(["cstu-text-red-500",e.unref(I)])},[e.renderSlot(g.$slots,"error",{},()=>[e.createTextVNode(e.toDisplayString(c.error),1)])],2)],16)):e.createCommentVNode("",!0)],2))}});/**
|
|
13
13
|
* @license lucide-vue-next v0.525.0 - ISC
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the ISC license.
|