@contentstudio/ui 0.1.50 → 0.1.51
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 +1 -1
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4100,7 +4100,7 @@ const qC = ["id"], AC = ["id", "aria-labelledby"], HC = /* @__PURE__ */ f("span"
|
|
|
4100
4100
|
componentId: c.id
|
|
4101
4101
|
});
|
|
4102
4102
|
o("show", B), !B.defaultPrevented && (d.value = document.activeElement, i.value = !0, g.value++, k(), document.body.classList.add("cstu-modal-open"), o("update:modelValue", !0), Me(() => {
|
|
4103
|
-
H(), o("shown", B);
|
|
4103
|
+
c.disableFocusTrap || H(), o("shown", B);
|
|
4104
4104
|
}));
|
|
4105
4105
|
}
|
|
4106
4106
|
function C(B = "programmatic") {
|
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(Wx);const EC=["id"],RC=["id","aria-labelledby"],OC=e.createElementVNode("span",{tabindex:"0"},null,-1),NC=["aria-label"],$C=["id"],UC=["aria-label"],ZC=[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)],WC={key:0},GC=e.createElementVNode("span",{tabindex:"0"},null,-1),XC=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:c}){const n=a;class r{constructor(v,H={}){Me(this,"type");Me(this,"cancelable",!0);Me(this,"target",null);Me(this,"vueTarget",null);Me(this,"defaultPrevented",!1);Me(this,"componentId","");Me(this,"trigger","programmatic");this.type=v,Object.assign(this,H)}preventDefault(){this.defaultPrevented=!0}}const i=e.ref(!1),d=e.ref(null),l=e.ref(null),h=e.ref(n.zIndex),s=e.ref(!1),u=e.ref(0),y=e.computed(()=>n.zIndex!==1050?n.zIndex:h.value);function p(){if(n.zIndex!==1050){h.value=n.zIndex;return}const b=document.querySelectorAll(".cstu-modal");let v=1050;b.forEach(H=>{const O=parseInt(window.getComputedStyle(H).zIndex,10);!isNaN(O)&&O>v&&(v=O)}),h.value=v+10}const k=e.computed(()=>n.fullscreen?"":x(n.radius));function x(b){const v={none:"",sm:"cstu-rounded-sm",md:"cstu-rounded-md",lg:"cstu-rounded-lg",xl:"cstu-rounded-xl",full:"cstu-rounded-full"};return v[b||n.size]||v.md}function w(){if(i.value)return;const b=new r("show",{trigger:"programmatic",target:null,vueTarget:null,componentId:n.id});c("show",b),!b.defaultPrevented&&(d.value=document.activeElement,i.value=!0,u.value++,p(),document.body.classList.add("cstu-modal-open"),c("update:modelValue",!0),e.nextTick(()=>{L(),c("shown",b)}))}function g(b="programmatic"){if(!i.value)return;const v=new r("hide",{trigger:b,target:null,vueTarget:null,componentId:n.id});c("hide",v),!v.defaultPrevented&&(i.value=!1,s.value=!1,document.body.classList.remove("cstu-modal-open"),c("update:modelValue",!1),e.nextTick(()=>{z(d.value),c("hidden",v)}))}function I(b){b&&(d.value=typeof b=="string"?document.querySelector(b):b),i.value?g():w()}function M(b){b==="ok"?c("ok"):b==="cancel"&&c("cancel"),g(b)}function m(b){const v=b.target,H=v.closest(".cstu-dropdown-menu"),O=v.tagName&&["input","select","textarea","button"].includes(v.tagName.toLowerCase()),N=v.closest(".cstu-modal-content");H||O||N&&v!==b.currentTarget||!n.noCloseOnBackdrop&&v===b.currentTarget&&g("backdrop")}function f(b){b.key==="Escape"&&i.value&&!n.noCloseOnEsc&&!n.busy&&g("esc")}function L(){e.nextTick(()=>{if(!l.value)return;const b=l.value,v=D(b);v.length>0&&v[0].focus()})}function z(b){if(b&&i.value===!1)try{b.focus()}catch{}}function V(b){if(n.disableFocusTrap||!l.value||!i.value)return;const v=b.target,H=l.value;if(n.ignoreEnforceFocusSelector&&n.ignoreEnforceFocusSelector.trim()!==""){const N=n.ignoreEnforceFocusSelector.split(",").map(P=>P.trim()).filter(P=>P.length>0);for(const P of N)if(v.closest(P))return}const O=!!v.closest(".cstu-modal-content");if(H!==v&&!H.contains(v)&&!O){if(s.value)return;s.value=!0;try{const N=D(H);N.length>0?N[0].focus():H.focus()}finally{setTimeout(()=>{s.value=!1},0)}}}function D(b){return Array.from(b.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'))}return e.watch(()=>n.modelValue,b=>{b!==i.value&&(b?w():g())}),e.watch(()=>n.id,()=>{Zx(n.id),Ux(n.id,{show:w,hide:g,toggle:I})}),e.onMounted(()=>{Ux(n.id,{show:w,hide:g,toggle:I}),document.addEventListener("keydown",f),document.addEventListener("focusin",V),n.modelValue&&(w(),i.value&&e.nextTick(()=>{setTimeout(()=>{const b=document.getElementById(n.id);let v=null;b&&b.parentNode&&(v=b.parentNode.querySelector(".cstu-modal-backdrop")),b&&window.getComputedStyle(b).display==="none"&&(b.style.display="block"),v&&window.getComputedStyle(v).display==="none"&&(v.style.display="block")},50)}))}),e.onBeforeUnmount(()=>{Zx(n.id),document.removeEventListener("keydown",f),document.removeEventListener("focusin",V),i.value&&(i.value=!1,c("update:modelValue",!1))}),o({hide:g,show:w,close:M,toggle:I}),(b,v)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body",disabled:n.static||n.teleport===!1},[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[i.value&&a.backdrop!==!1?(e.openBlock(),e.createElementBlock("div",{key:0,id:`${n.id}-backdrop`,class:e.normalizeClass(["cstu-modal-backdrop",a.backdropClass]),style:e.normalizeStyle({zIndex:e.unref(y)-10})},null,14,EC)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"modal"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:n.id,class:e.normalizeClass(["cstu-modal",[{"cstu-modal-static":n.static,"cstu-modal-scrollable":n.scrollable},n.modalClass]]),tabindex:"-1",role:"dialog","aria-modal":"true",style:e.normalizeStyle({zIndex:e.unref(y)}),"aria-labelledby":!a.hideHeader&&a.title?`modal-title-${n.id}`:void 0,onClick:m,onMousedown:v[5]||(v[5]=e.withModifiers(()=>{},["stop"]))},[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:v[4]||(v[4]=e.withModifiers(H=>H.target===H.currentTarget&&H.stopPropagation(),["stop"]))},[OC,e.createElementVNode("div",{class:e.normalizeClass(["cstu-modal-content",a.contentClass,{"cstu-modal-content-fullscreen":a.fullscreen},e.unref(k)]),tabindex:"-1",ref_key:"modalElement",ref:l,"aria-label":a.ariaLabel,onClick:v[3]||(v[3]=H=>H.target===H.currentTarget&&H.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(b.$slots,"modal-header",{},()=>[e.renderSlot(b.$slots,"modal-title",{},()=>[e.createElementVNode("h5",{id:`modal-title-${n.id}`,class:e.normalizeClass([n.titleClass||"cstu-modal-title",{"sr-only":a.titleSrOnly}])},e.toDisplayString(a.title),11,$C)]),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:v[0]||(v[0]=H=>M("headerClose"))},ZC,8,UC))])],2)),e.createElementVNode("div",{class:e.normalizeClass(["cstu-modal-body",a.bodyClass,{"cstu-modal-body-scrollable":a.scrollable}])},[e.renderSlot(b.$slots,"default",{},()=>[a.content?(e.openBlock(),e.createElementBlock("div",WC,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(b.$slots,"modal-footer",{},()=>[a.okOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(E,{key:0,variant:a.cancelVariant,color:a.cancelColor,disabled:a.cancelDisabled||a.busy,onClick:v[1]||(v[1]=H=>M("cancel"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.cancelTitle),1)]),_:1},8,["variant","color","disabled"])),e.createVNode(E,{variant:a.okVariant,color:a.okColor,disabled:a.okDisabled||a.busy,loading:a.busy,onClick:v[2]||(v[2]=H=>M("ok"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.okTitle),1)]),_:1},8,["variant","color","disabled","loading"])])],2))],10,NC),GC],2)],46,RC)):e.createCommentVNode("",!0)]),_:3})],8,["disabled"]))}}),hS="",KC={mounted(a,o){const c=typeof o.value=="string"?o.value:Object.keys(o.modifiers)[0];if(!c){console.warn("v-cstu-modal directive requires a modal ID");return}a.addEventListener("click",()=>{$x.show(c)}),a.tagName!=="BUTTON"&&(a.setAttribute("role","button"),a.addEventListener("keydown",n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),$x.show(c))}),a.hasAttribute("tabindex")||a.setAttribute("tabindex","0"))}},JC={install:a=>{a.directive("cstu-modal",KC)}},QC=["primary","secondary","success","warning","info"];function Gx(a,o=QC){if(!a||!o||o.length===0)return"primary";let c=0;for(let r=0;r<a.length;r+=1)c=a.charCodeAt(r)+((c<<5)-c);const n=Math.abs(c)%o.length;return o[n]}function Xx(a){return!a||typeof a!="string"?"":a.trim().split(" ").slice(0,2).map(o=>o.charAt(0).toUpperCase()).join("")}const YC=["src","alt"],_C=["title"],eL={key:1,"data-avatar-placeholder-icon":"true",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tL=[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)],Kx=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,c=e.ref(!o.src);e.watch(()=>o.src,y=>{c.value=!y},{immediate:!0});const n=y=>y?["primary","secondary","success","warning","danger","info","dark","light","initials"].includes(y):!0,r=e.computed(()=>o.name?Xx(o.name):""),i=e.computed(()=>{const y={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"?y[o.size]||y.md:typeof o.size=="number"?`w-[${o.size}px] h-[${o.size}px]`:y.md}),d=e.computed(()=>oe(o.radius)),l=e.computed(()=>{if(o.src&&!c.value||!n(o.color)&&o.color!=="initials")return"";if(o.color==="initials"&&o.name){const x=Gx(o.name,o.allowedInitialsColors||["primary","secondary","success","warning","info"]);return x?T(x,"filled",{}):T("primary","filled",{})}const y=o.variant==="transparent"?"default":o.variant==="gradient"?"filled":o.variant,p=o.color&&o.color!=="initials"?o.color:"primary",k=T(p,y,{});return o.variant==="transparent"?"bg-transparent":k}),h=e.computed(()=>!n(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}`:Og(o.variant)),s=e.computed(()=>{if(o.src&&!c.value||n(o.color)||o.color==="initials")return{};const y={};switch(o.variant){case"filled":y.backgroundColor=o.color,o.autoContrast&&(y.color="white");break;case"light":y.backgroundColor=`${o.color}20`,y.color=o.color;break;case"outline":y.backgroundColor="transparent",y.color=o.color,y.border=`1px solid ${o.color}`;break;case"transparent":y.backgroundColor="transparent",y.color=o.color;break}return y}),u=y=>{var p;c.value=!0,(p=o.imageProps)!=null&&p.onError&&o.imageProps.onError(y)};return(y,p)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.component||"div"),{class:e.normalizeClass(["avatar",e.unref(i),e.unref(d),!c.value&&a.src?"":e.unref(l),!c.value&&a.src?"":e.unref(h),{"avatar--with-image":!c.value&&a.src},{"hover:opacity-80 transition-opacity":a.hover},a.customClasses]),style:e.normalizeStyle(e.unref(s))},{default:e.withCtx(()=>[!c.value&&a.src?(e.openBlock(),e.createElementBlock("img",e.mergeProps({key:0,class:"avatar__image",src:a.src,alt:a.alt},a.imageProps,{onError:u}),null,16,YC)):(e.openBlock(),e.createElementBlock("span",{key:1,class:"avatar__placeholder",title:a.alt},[e.renderSlot(y.$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",eL,tL))])],8,_C))]),_:3},8,["class","style"]))}}),pS="",Jx=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,c=e.computed(()=>{if(typeof o.spacing=="number")return`${o.spacing}px`;const s={xs:"-1rem",sm:"-0.75rem",md:"-0.5rem",lg:"-0.25rem",xl:"0"};return s[o.spacing]||s.sm}),n=e.computed(()=>{if(typeof o.gap=="number")return`${o.gap}px`;if(typeof o.gap=="string"&&!isNaN(parseFloat(o.gap)))return o.gap;const s={none:"0",xs:"0.25rem",sm:"0.5rem",md:"0.75rem",lg:"1rem"};return s[o.gap]||s.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 s={none:"0",thin:"1px",normal:"2px",medium:"3px",thick:"4px"};return s[o.outlineWidth]||s.normal}),i=e.computed(()=>{if(typeof o.outlineOffset=="number")return`${o.outlineOffset}px`;if(typeof o.outlineOffset=="string"&&!isNaN(parseFloat(o.outlineOffset)))return o.outlineOffset;const s={none:"0",inset:"-2px",small:"1px",medium:"2px",large:"3px"};return s[o.outlineOffset]||s.small}),d=e.computed(()=>typeof o.outlineColor=="string"&&["primary","secondary","success","danger","warning","info","dark","light"].includes(o.outlineColor)?`outline-${o.outlineColor}`:""),l=e.computed(()=>typeof o.outlineColor=="string"&&["primary","secondary","success","danger","warning","info","dark","light"].includes(o.outlineColor)?"var(--color-"+o.outlineColor+")":o.outlineColor),h=e.computed(()=>({"--avatar-group-spacing":c.value,"--avatar-group-gap":n.value,"--avatar-group-outline-width":r.value,"--avatar-group-outline-color":l.value,"--avatar-group-outline-offset":i.value}));return(s,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["avatar-group",a.customClasses,e.unref(d),{"avatar-group--hover":a.hover}]),style:e.normalizeStyle(e.unref(h))},[e.renderSlot(s.$slots,"default")],6))}}),uS="";Kx.Group=Jx;const A2=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 c=a,n=e.computed(()=>c.placement?c.placement:c.orientation==="horizontal"?"top":"left"),r=e.computed(()=>c.orientation),i=e.computed(()=>c.variant),d=e.ref(c.value!==void 0?c.value:c.defaultValue);e.watch(()=>c.value,h=>{h!==void 0&&(d.value=h)});const l=h=>{c.value!==void 0?o("change",h):d.value=h};return e.provide("activeTab",d),e.provide("setActiveTab",l),e.provide("tabsOrientation",r),e.provide("tabsPlacement",n),(h,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cstu-tabs",`cstu-tabs-${e.unref(r)}`,`cstu-tabs-placement-${e.unref(n)}`,`cstu-tabs-variant-${e.unref(i)}`])},[e.renderSlot(h.$slots,"default")],2))}}),kS="",Qx=e.defineComponent({__name:"TabsList",props:{justify:{type:String,default:"flex-start"},divider:{type:Boolean,default:!1}},setup(a){const o=a,c=e.inject("tabsOrientation",e.ref("horizontal")),n=e.inject("tabsPlacement",e.ref("top")),r=e.computed(()=>["tabs-list",`tabs-list-${c.value}`,`tabs-list-placement-${n.value}`,o.divider?"tabs-list-with-divider":""]),i=l=>{if(["space-between","space-around","space-evenly"].includes(l))return l;switch(l){case"flex-start":return"flex-start";case"flex-end":return"flex-end";case"center":return"center";default:return"flex-start"}},d=e.computed(()=>c.value==="horizontal"?{justifyContent:o.justify}:{justifyContent:i(o.justify)});return(l,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(r)),style:e.normalizeStyle(e.unref(d))},[e.renderSlot(l.$slots,"default")],6))}}),mS="",Yx=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,c=e.inject("activeTab",e.ref("")),n=e.inject("setActiveTab",()=>{}),r=e.inject("tabsOrientation",e.ref("horizontal")),i=e.inject("tabsPlacement",e.ref("top")),d=e.computed(()=>c.value),l=e.computed(()=>r.value),h=e.computed(()=>i.value),s=e.computed(()=>d.value===o.value),u=e.computed(()=>l.value==="vertical"),y=e.computed(()=>o.fullWidth&&l.value==="horizontal"),p=()=>{!o.disabled&&!o.loading&&n(o.value)};return(k,x)=>(e.openBlock(),e.createBlock(e.unref(E),{class:e.normalizeClass(["tabs-tab",e.unref(s)?"tabs-tab-active":"tabs-tab-inactive",`tabs-tab-${o.variant}`,o.color?`tabs-tab-color-${o.color}`:"",`tabs-tab-orientation-${e.unref(l)}`,`tabs-tab-placement-${e.unref(h)}`,{"tabs-tab-full-width":e.unref(y)}]),disabled:o.disabled,loading:o.loading,color:e.unref(s)?o.color:"secondary",variant:e.unref(s)?o.variant:"subtle",size:o.size,radius:o.variant==="text"?"none":o.radius,"full-width":e.unref(u),onClick:p},e.createSlots({default:e.withCtx(()=>[e.renderSlot(k.$slots,"default")]),_:2},[k.$slots.leftSection?{name:"leftSection",fn:e.withCtx(()=>[e.renderSlot(k.$slots,"leftSection")]),key:"0"}:void 0,k.$slots.rightSection?{name:"rightSection",fn:e.withCtx(()=>[e.renderSlot(k.$slots,"rightSection")]),key:"1"}:void 0]),1032,["class","disabled","loading","color","variant","size","radius","full-width"]))}}),fS="",_x=e.defineComponent({__name:"TabsPanel",props:{value:{type:String,required:!0},KeepAlive:{type:Boolean,default:!1}},setup(a){const o=a,c=e.inject("activeTab",e.ref("")),n=e.inject("tabsOrientation",e.ref("horizontal")),r=e.inject("tabsPlacement",e.ref("top")),i=e.computed(()=>c.value===o.value),d=e.computed(()=>["tabs-panel",i.value?"tabs-panel-active":"tabs-panel-inactive",`tabs-panel-${n.value}`,`tabs-panel-placement-${r.value}`]);return(l,h)=>a.KeepAlive||e.unref(i)?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(d))},[e.renderSlot(l.$slots,"default")],2)),[[e.vShow,e.unref(i)]]):e.createCommentVNode("",!0)}}),MS="";A2.List=Qx,A2.Tab=Yx,A2.Panel=_x;const aL=e.createElementVNode("span",{class:"cstu-sr-only"},"First page",-1),oL=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),cL=e.createElementVNode("span",{class:"cstu-sr-only"},"Previous page",-1),nL=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),rL={key:2,class:"cstu-flex cstu-items-center cstu-gap-2"},iL=[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)],lL=e.createElementVNode("span",{class:"cstu-sr-only"},"Next page",-1),dL=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),sL=e.createElementVNode("span",{class:"cstu-sr-only"},"Last page",-1),hL=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),yL=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 c=a,n=e.ref(c.modelValue);e.watch(()=>c.modelValue,p=>{n.value=p});const r=e.computed(()=>n.value===1),i=e.computed(()=>n.value===c.total),d=e.computed(()=>{switch(c.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"}}),l=e.computed(()=>["cstu-flex cstu-items-center cstu-justify-center",u(c.size)]),h=e.computed(()=>{const p=[],k=c.total;if(c.siblings*2+3+c.boundaries*2>=k)return Array.from({length:k},(f,L)=>L+1);const w=Math.max(n.value-c.siblings,c.boundaries+1),g=Math.min(n.value+c.siblings,k-c.boundaries),I=w>c.boundaries+2,M=g<k-(c.boundaries+1),m=new Set;for(let f=1;f<=c.boundaries;f++)p.push(f),m.add(f);if(I)p.push("dots");else if(!I&&w>c.boundaries)for(let f=c.boundaries+1;f<w;f++)m.has(f)||(p.push(f),m.add(f));for(let f=w;f<=g;f++)m.has(f)||(p.push(f),m.add(f));if(M)p.push("dots");else if(!M&&g<k-c.boundaries)for(let f=g+1;f<k-c.boundaries+1;f++)m.has(f)||(p.push(f),m.add(f));for(let f=k-c.boundaries+1;f<=k;f++)m.has(f)||(p.push(f),m.add(f));return p}),s=p=>{p<1||p>c.total||c.disabled||(n.value=p,o("update:modelValue",p))};function u(p){const k={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 k[p]||k.md}const y=e.computed(()=>c.variant==="filled"?"subtle":"bordered-transparent");return(p,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cstu-flex cstu-items-center cstu-gap-2",[c.class]])},[c.withEdges?(e.openBlock(),e.createBlock(E,{key:0,variant:e.unref(y),color:"light",size:c.size,disabled:e.unref(r)||c.disabled,onClick:k[0]||(k[0]=x=>s(1)),"aria-label":"Go to first page",class:e.normalizeClass(e.unref(d))},{default:e.withCtx(()=>[aL,oL]),_:1},8,["variant","size","disabled","class"])):e.createCommentVNode("",!0),c.withControls?(e.openBlock(),e.createBlock(E,{key:1,variant:e.unref(y),color:"light",size:c.size,disabled:e.unref(r)||c.disabled,onClick:k[1]||(k[1]=x=>s(n.value-1)),"aria-label":"Go to previous page",class:e.normalizeClass(e.unref(d))},{default:e.withCtx(()=>[cL,nL]),_:1},8,["variant","size","disabled","class"])):e.createCommentVNode("",!0),c.withPages?(e.openBlock(),e.createElementBlock("div",rL,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),(x,w)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:w},[x!=="dots"?(e.openBlock(),e.createBlock(E,{key:0,variant:x===n.value?"filled":e.unref(y),color:x===n.value?c.color:"light",size:c.size,disabled:c.disabled,onClick:g=>s(Number(x)),"aria-current":x===n.value?"page":void 0,"aria-label":`Page ${x}`,class:e.normalizeClass(e.unref(d))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x),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(l),e.unref(d)]])},iL,2))],64))),128))])):e.createCommentVNode("",!0),c.withControls?(e.openBlock(),e.createBlock(E,{key:3,variant:e.unref(y),color:"light",size:c.size,disabled:e.unref(i)||c.disabled,onClick:k[2]||(k[2]=x=>s(n.value+1)),"aria-label":"Go to next page",class:e.normalizeClass(e.unref(d))},{default:e.withCtx(()=>[lL,dL]),_:1},8,["variant","size","disabled","class"])):e.createCommentVNode("",!0),c.withEdges?(e.openBlock(),e.createBlock(E,{key:4,variant:e.unref(y),color:"light",size:c.size,disabled:e.unref(i)||c.disabled,onClick:k[3]||(k[3]=x=>s(c.total)),"aria-label":"Go to last page",class:e.normalizeClass(e.unref(d))},{default:e.withCtx(()=>[sL,hL]),_:1},8,["variant","size","disabled","class"])):e.createCommentVNode("",!0)],2))}}),eI={mounted(a,o){a._clickOutside=c=>{const n=c.target;if(!(a===n||a.contains(n))){const r=c.target,i=r.tagName&&r.tagName.toLowerCase()==="input",d=r.closest(".cstu-dropdown-menu");!i&&!d&&o.value(c)}},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))}},pL=["id","aria-labelledby","aria-modal","onKeydown"],uL={class:"cstu-popover-inner"},kL=["id"],mL=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 c=a,n=e.ref(c.defaultOpen),r=e.ref(null),i=e.ref(null),d=e.ref(null),l=e.ref(null),h=e.ref(c.zIndex);c.open!==void 0&&(n.value=c.open);const s=e.computed(()=>{if(c.placement!=="auto")return c.placement}),u=e.computed(()=>{const C=[b2(c.offsetDistance)];return d.value&&C.push(Dx({element:d})),c.placement==="auto"?C.push(jx({padding:8})):C.push(z2({fallbackPlacements:["top","bottom","left","right"],padding:8})),C.push(S2({padding:8})),C}),{floatingStyles:y,update:p}=q2(r,i,{placement:s,middleware:u,whileElementsMounted:Fx}),k=C=>{c.disabled||(c.trigger==="click"||c.trigger==="manual")&&z()},x=()=>{c.disabled||c.trigger==="hover"&&f()},w=()=>{c.disabled||c.trigger==="hover"&&setTimeout(()=>{L("hover")},100)},g=C=>{c.closeOnClick&&L("popoverClick"),C.stopPropagation()},I=C=>{c.closeOnClickOutside&&n.value&&i.value&&!i.value.contains(C.target)&&r.value&&!r.value.contains(C.target)&&L("clickAway")},M=()=>{c.closeOnClickOutside&&L("backdrop")},m=C=>{c.closeOnEscape&&C.key==="Escape"&&(C.preventDefault(),L("escape"))},f=()=>{c.disabled||n.value||(l.value=document.activeElement,n.value=!0,e.nextTick(()=>{p(),c.trapFocus&&V()}),o("open"),o("update:open",!0))},L=(C="programmatic")=>{n.value&&(n.value=!1,c.trapFocus&&D(l.value),o("close",C),o("update:open",!1))},z=()=>{n.value?L():f()},V=()=>{if(!i.value)return;const C=b(i.value);C.length>0?C[0].focus():i.value.focus()},D=C=>{C&&typeof C.focus=="function"&&C.focus()},b=C=>Array.from(C.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(B=>!B.hasAttribute("disabled")&&!B.getAttribute("aria-hidden")),v=C=>{if(!n.value||!c.trapFocus||!i.value)return;const B=C.target;i.value.contains(B)||(C.preventDefault(),V())};e.watch(()=>c.open,C=>{C!==n.value&&(C?f():L())}),e.watch(r,C=>{C&&p()}),e.onMounted(()=>{document.addEventListener("keydown",m),c.trapFocus&&document.addEventListener("focusin",v)}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",m),c.trapFocus&&document.removeEventListener("focusin",v)});const H=e.computed(()=>[oe(c.radius),!c.variant||c.variant==="shadow"?c.shadow?`cstu-shadow-${c.shadow}`:"cstu-shadow-md":"",c.popoverClass]),O=e.computed(()=>{const C=[...H.value.filter(Boolean)];let B=!1;const $=c.color;if($&&G($)&&c.variant==="color"){const F=T($,"filled",{disabled:c.disabled});typeof F=="string"&&F.trim()&&(C.push(...F.split(" ").filter(Boolean)),B=!0)}return B||(C.push("cstu-bg-white"),c.variant==="outline"&&C.push("cstu-border","cstu-border-gray-300"),C.push("cstu-text-gray-700")),C.filter(Boolean).map(F=>typeof F=="string"?F:Object.keys(F).filter(f2=>F[f2]).join(" ")).join(" ")}),N=e.computed(()=>{const C={width:typeof c.width=="number"?`${c.width}px`:c.width},B=c.color;if(B&&!G(B)&&c.variant==="color"){C.backgroundColor=B;const $=P(B);C.color=$>128?"#000000":"#FFFFFF"}return{...y.value,...C}});e.computed(()=>{const C={backgroundColor:"white"},B=c.color;return c.variant==="color"&&B?G(B)?(C.borderWidth="1px",C.borderStyle="solid",C.borderColor=`var(--${B}-500)`):C.backgroundColor=B:c.variant==="outline"&&(C.borderWidth="1px",C.borderStyle="solid",C.borderColor="#e2e8f0"),C});function P(C){if(C.startsWith("#"))try{const B=parseInt(C.substring(1,3),16),$=parseInt(C.substring(3,5),16),F=parseInt(C.substring(5,7),16);return(B*299+$*587+F*114)/1e3}catch{return 128}else if(C.startsWith("rgb"))try{const B=C.match(/\d+/g);if(B&&B.length>=3){const $=parseInt(B[0],10),F=parseInt(B[1],10),f2=parseInt(B[2],10);return($*299+F*587+f2*114)/1e3}}catch{return 128}return 128}const _=e.computed(()=>{const C=c.color,B=!(C&&G(C)),$=c.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"}[c.size||"md"],ge(c.size||"md"),"cstu-flex cstu-items-center cstu-justify-between",$||B?"cstu-border-b cstu-border-gray-200 dark:cstu-border-gray-700":"",c.headerClass].filter(Boolean).join(" ")}),Q=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"}[c.size||"md"],ge(c.size||"sm"),c.bodyClass].filter(Boolean).join(" ")),X=e.computed(()=>{const C=c.color,B=!(C&&G(C)),$=c.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"}[c.size||"md"],$||B?"cstu-border-t cstu-border-gray-200 dark:cstu-border-gray-700":"","cstu-flex cstu-justify-end cstu-space-x-2",c.footerClass].filter(Boolean).join(" ")});return(C,B)=>(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:k,onMouseenter:x,onMouseleave:w},[e.renderSlot(C.$slots,"trigger")],34),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"fade",appear:""},{default:e.withCtx(()=>[n.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:M},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(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cstu-popover-container",style:e.normalizeStyle({zIndex:h.value})},[e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"popoverRef",ref:i,id:c.id,class:e.normalizeClass(e.unref(O)),style:e.normalizeStyle([e.unref(y),e.unref(N)]),role:"dialog","aria-labelledby":c.title?`${c.id}-title`:void 0,"aria-modal":c.trapFocus,tabindex:"-1",onClick:g,onKeydown:e.withKeys(m,["esc"])},[e.createElementVNode("div",uL,[c.hideHeader?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(_))},[e.renderSlot(C.$slots,"header",{},()=>[e.createElementVNode("h3",{id:`${c.id}-title`,class:e.normalizeClass(["cstu-popover-title cstu-font-medium",e.unref(ge)(c.size||"md")])},e.toDisplayString(c.title),11,kL),c.showCloseIcon?(e.openBlock(),e.createBlock(E,{key:0,icon:"X",variant:"text",size:"xs",color:c.color&&e.unref(G)(c.color)?"white":"gray",class:"cstu-ml-auto","aria-label":"Close popover",onClick:B[0]||(B[0]=e.withModifiers($=>L("headerClose"),["stop"]))},null,8,["color"])):e.createCommentVNode("",!0)])],2)),e.createElementVNode("div",{class:e.normalizeClass(e.unref(Q))},[e.renderSlot(C.$slots,"default",{},()=>[a.content?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(ge)(c.size||"sm"))},e.toDisplayString(a.content),3)):e.createCommentVNode("",!0)])],2),c.hideFooter?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(X))},[e.renderSlot(C.$slots,"footer",{},()=>[e.createVNode(E,{size:"sm",variant:"subtle",onClick:B[1]||(B[1]=$=>L("cancel"))},{default:e.withCtx(()=>[e.createTextVNode(" Close ")]),_:1})])],2))])],46,pL)),[[e.unref(eI),I]])],4)):e.createCommentVNode("",!0)]),_:3})]))],64))}}),xS="",fL=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,c=e.useSlots(),n=e.computed(()=>!!c.default),r=e.computed(()=>c.default?c.default():[]),i=y=>y===r.value.length-1,d=y=>y?["primary","secondary","success","warning","danger","info","dark","light"].includes(y):!0,l=y=>{if(!i(y)||!o.highlightActive)return"";if(d(o.color)){const p=W[o.color];if(p)return`cstu-text-${p.base}-${p.main}`}return""},h=y=>!i(y)||!o.highlightActive?{}:d(o.color)?{}:{color:o.color},s=e.computed(()=>{const y={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg",xl:"text-xl"};return y[o.size]||y.md}),u=e.computed(()=>{const y={xs:"mx-1",sm:"mx-2",md:"mx-3",lg:"mx-4",xl:"mx-5"};return y[o.separatorMargin]||y.xs});return(y,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cstu-breadcrumbs",o.class])},[e.unref(n)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(e.unref(r),(k,x)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:x},[e.createElementVNode("div",{class:e.normalizeClass(["cstu-breadcrumb-item",e.unref(s),i(x)?"cstu-breadcrumb-active":"cstu-breadcrumb-inactive",i(x)?o.activeClass:"",i(x)&&o.highlightActive?l(x):""]),style:e.normalizeStyle(h(x))},[e.renderSlot(y.$slots,`item-${x}`,{isActive:i(x)},()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(k)))])],6),i(x)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["cstu-breadcrumb-separator",e.unref(u),o.separatorClass])},[e.renderSlot(y.$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(y.$slots,"default",{key:0})],2))}}),IS="",ML={key:0,class:"cstu-flex cstu-justify-between cstu-items-center cstu-mb-1"},gL=["for"],xL={key:0,class:"cstu-text-red-500 cstu-ml-1"},IL={key:0,class:"cstu-flex cstu-items-center cstu-justify-center cstu-w-[15px] cstu-h-[15px] cstu-mt-1"},wL=["id","value","placeholder","disabled","required","readonly","rows","maxlength"],CL={key:1,class:"cstu-flex cstu-items-center cstu-justify-center cstu-w-[15px] cstu-h-[15px] cstu-mt-1"},LL=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:c}){const{id:n,modelValue:r,placeholder:i,label:d,description:l,error:h,hasError:s=!1,disabled:u=!1,readonly:y=!1,required:p=!1,withAsterisk:k=!1,showBothErrorAndDescription:x=!1,textareaProps:w,labelProps:g,descriptionProps:I,errorProps:M,size:m="md",variant:f="default",radius:L="md",color:z="primary",class:V,fullWidth:D=!1,inputClass:b="",rows:v=3,resize:H="none",maxLength:O=void 0}=a,N=`textarea-${Math.random().toString(36).substring(2,11)}`,P=e.ref(null),_={xs:{inputClass:`cstu-min-h-8 ${D?"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 ${D?"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 ${D?"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 ${D?"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 ${D?"cstu-w-full":"cstu-max-w-[20.5rem]"}`,labelSize:"cstu-text-base cstu-font-medium",descriptionSize:"cstu-text-sm"}},Q=e.computed(()=>`${_[m].inputClass.split(" ")[0]} cstu-transition-all cstu-duration-300`),X=e.computed(()=>_[m].labelSize),C=e.computed(()=>_[m].descriptionSize),B=e.computed(()=>{switch(m){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"}}),$=e.computed(()=>oe(L)),F=e.computed(()=>h!==void 0&&h!==""||s),f2=e.computed(()=>f==="unstyled"||!G(z)&&!F.value?"":F.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":f==="default"||f==="outline"?`cstu-border-${z}-500 hover:cstu-border-${z}-600 focus-within:cstu-border-${z}-500 focus-within:cstu-ring-1 focus-within:cstu-ring-${z}-500`:f==="filled"?`cstu-bg-${z}-50 hover:cstu-bg-${z}-100`:f==="light"?`cstu-bg-${z}-50 cstu-text-${z}-500 hover:cstu-bg-${z}-100`:f==="subtle"?`cstu-text-${z}-500 hover:cstu-bg-${z}-50`:""),Nb=e.computed(()=>f==="unstyled"?{}:G(z)||F.value?{}:f==="default"||f==="outline"?{"--border-color":z,"border-color":"var(--border-color)"}:f==="filled"?{"--bg-color":`${z}10`,"background-color":"var(--bg-color)"}:f==="light"?{"--bg-color":`${z}10`,"--text-color":z,"background-color":"var(--bg-color)",color:"var(--text-color)"}:f==="subtle"?{"--text-color":z,color:"var(--text-color)"}:{}),$b=e.computed(()=>{const A={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(f==="unstyled")return[A[f]];const he=F.value?"":f==="default"||f==="outline"?"cstu-border-gray-300/45":"",l2=F.value?"cstu-border-red-500":"";return[A[f],he,l2,F.value?"hover:cstu-border-red-500":"hover:cstu-border-blue-450",F.value?"focus-within:cstu-border-red-500 focus-within:cstu-ring-1 focus-within:cstu-ring-red-500":"focus-within:cstu-border-blue-450 focus-within:cstu-ring-1 focus-within:cstu-ring-blue-450"]}),xI=e.ref(!1),Ub=A=>{xI.value=!0,c("focus",A)},Zb=A=>{xI.value=!1,c("blur",A)},Wb=A=>{c("change",A)};return o({textarea:P,focus:()=>{var A;return(A=P.value)==null?void 0:A.focus()},blur:()=>{var A;return(A=P.value)==null?void 0:A.blur()},select:()=>{var A;return(A=P.value)==null?void 0:A.select()},setSelectionRange:(A,he)=>{var l2;return(l2=P.value)==null?void 0:l2.setSelectionRange(A,he)},setRangeText:A=>{var he;return(he=P.value)==null?void 0:he.setRangeText(A)},get value(){var A;return(A=P.value)==null?void 0:A.value},set value(A){P.value&&A!==void 0&&(P.value.value=A)}}),(A,he)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cstu-flex cstu-flex-col cstu-transition-all cstu-duration-300",[A.customClass,a.fullWidth?"cstu-w-full":"cstu-max-w-[20.5rem]"]])},[a.label||A.$slots.label?(e.openBlock(),e.createElementBlock("div",ML,[e.createElementVNode("label",e.mergeProps({for:a.id||N,class:["cstu-flex cstu-items-center",e.unref(X)]},a.labelProps),[e.renderSlot(A.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(a.label)+" ",1),a.withAsterisk||a.required?(e.openBlock(),e.createElementBlock("span",xL,"*")):e.createCommentVNode("",!0)])],16,gL),e.renderSlot(A.$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($),e.unref($b),e.unref(f2),{"cstu-opacity-50 cstu-pointer-events-none cstu-cursor-not-allowed":a.disabled}]),style:e.normalizeStyle(e.unref(Nb))},[A.$slots.leftSection?(e.openBlock(),e.createElementBlock("div",IL,[e.renderSlot(A.$slots,"leftSection")])):e.createCommentVNode("",!0),e.createElementVNode("textarea",e.mergeProps({ref_key:"textareaRef",ref:P,id:a.id||N,value:a.modelValue,placeholder:a.placeholder,disabled:a.disabled,required:a.required,readonly:a.readonly,rows:a.rows,maxlength:a.maxLength,class:["cstu-flex-1 cstu-bg-transparent cstu-outline-none cstu-w-full",e.unref(B),a.inputClass,{"cstu-text-gray-500":a.modelValue,"cstu-text-red-500":e.unref(F)&&!a.modelValue}],style:{resize:a.resize},onInput:he[0]||(he[0]=l2=>A.$emit("update:modelValue",l2.target.value)),onFocus:Ub,onBlur:Zb,onChange:Wb},a.textareaProps),null,16,wL),A.$slots.rightSection?(e.openBlock(),e.createElementBlock("div",CL,[e.renderSlot(A.$slots,"rightSection")])):e.createCommentVNode("",!0)],6)]),a.description&&!e.unref(F)||A.$slots.description&&!e.unref(F)||a.showBothErrorAndDescription&&a.description||a.showBothErrorAndDescription&&A.$slots.description?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:1,class:"cstu-mt-1"},a.descriptionProps),[e.createElementVNode("p",{class:e.normalizeClass(["cstu-text-gray-500",e.unref(C)])},[e.renderSlot(A.$slots,"description",{},()=>[e.createTextVNode(e.toDisplayString(a.description),1)])],2)],16)):e.createCommentVNode("",!0),e.unref(F)&&a.error||e.unref(F)&&A.$slots.error||a.showBothErrorAndDescription&&a.error||a.showBothErrorAndDescription&&A.$slots.error?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:2,class:"cstu-mt-1"},a.errorProps),[e.createElementVNode("p",{class:e.normalizeClass(["cstu-text-red-500",e.unref(C)])},[e.renderSlot(A.$slots,"error",{},()=>[e.createTextVNode(e.toDisplayString(a.error),1)])],2)],16)):e.createCommentVNode("",!0)],2))}});/**
|
|
12
|
+
`,document.head.appendChild(Wx);const EC=["id"],RC=["id","aria-labelledby"],OC=e.createElementVNode("span",{tabindex:"0"},null,-1),NC=["aria-label"],$C=["id"],UC=["aria-label"],ZC=[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)],WC={key:0},GC=e.createElementVNode("span",{tabindex:"0"},null,-1),XC=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:c}){const n=a;class r{constructor(v,H={}){Me(this,"type");Me(this,"cancelable",!0);Me(this,"target",null);Me(this,"vueTarget",null);Me(this,"defaultPrevented",!1);Me(this,"componentId","");Me(this,"trigger","programmatic");this.type=v,Object.assign(this,H)}preventDefault(){this.defaultPrevented=!0}}const i=e.ref(!1),d=e.ref(null),l=e.ref(null),h=e.ref(n.zIndex),s=e.ref(!1),u=e.ref(0),y=e.computed(()=>n.zIndex!==1050?n.zIndex:h.value);function p(){if(n.zIndex!==1050){h.value=n.zIndex;return}const b=document.querySelectorAll(".cstu-modal");let v=1050;b.forEach(H=>{const O=parseInt(window.getComputedStyle(H).zIndex,10);!isNaN(O)&&O>v&&(v=O)}),h.value=v+10}const k=e.computed(()=>n.fullscreen?"":x(n.radius));function x(b){const v={none:"",sm:"cstu-rounded-sm",md:"cstu-rounded-md",lg:"cstu-rounded-lg",xl:"cstu-rounded-xl",full:"cstu-rounded-full"};return v[b||n.size]||v.md}function w(){if(i.value)return;const b=new r("show",{trigger:"programmatic",target:null,vueTarget:null,componentId:n.id});c("show",b),!b.defaultPrevented&&(d.value=document.activeElement,i.value=!0,u.value++,p(),document.body.classList.add("cstu-modal-open"),c("update:modelValue",!0),e.nextTick(()=>{n.disableFocusTrap||L(),c("shown",b)}))}function g(b="programmatic"){if(!i.value)return;const v=new r("hide",{trigger:b,target:null,vueTarget:null,componentId:n.id});c("hide",v),!v.defaultPrevented&&(i.value=!1,s.value=!1,document.body.classList.remove("cstu-modal-open"),c("update:modelValue",!1),e.nextTick(()=>{z(d.value),c("hidden",v)}))}function I(b){b&&(d.value=typeof b=="string"?document.querySelector(b):b),i.value?g():w()}function M(b){b==="ok"?c("ok"):b==="cancel"&&c("cancel"),g(b)}function m(b){const v=b.target,H=v.closest(".cstu-dropdown-menu"),O=v.tagName&&["input","select","textarea","button"].includes(v.tagName.toLowerCase()),N=v.closest(".cstu-modal-content");H||O||N&&v!==b.currentTarget||!n.noCloseOnBackdrop&&v===b.currentTarget&&g("backdrop")}function f(b){b.key==="Escape"&&i.value&&!n.noCloseOnEsc&&!n.busy&&g("esc")}function L(){e.nextTick(()=>{if(!l.value)return;const b=l.value,v=D(b);v.length>0&&v[0].focus()})}function z(b){if(b&&i.value===!1)try{b.focus()}catch{}}function V(b){if(n.disableFocusTrap||!l.value||!i.value)return;const v=b.target,H=l.value;if(n.ignoreEnforceFocusSelector&&n.ignoreEnforceFocusSelector.trim()!==""){const N=n.ignoreEnforceFocusSelector.split(",").map(P=>P.trim()).filter(P=>P.length>0);for(const P of N)if(v.closest(P))return}const O=!!v.closest(".cstu-modal-content");if(H!==v&&!H.contains(v)&&!O){if(s.value)return;s.value=!0;try{const N=D(H);N.length>0?N[0].focus():H.focus()}finally{setTimeout(()=>{s.value=!1},0)}}}function D(b){return Array.from(b.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'))}return e.watch(()=>n.modelValue,b=>{b!==i.value&&(b?w():g())}),e.watch(()=>n.id,()=>{Zx(n.id),Ux(n.id,{show:w,hide:g,toggle:I})}),e.onMounted(()=>{Ux(n.id,{show:w,hide:g,toggle:I}),document.addEventListener("keydown",f),document.addEventListener("focusin",V),n.modelValue&&(w(),i.value&&e.nextTick(()=>{setTimeout(()=>{const b=document.getElementById(n.id);let v=null;b&&b.parentNode&&(v=b.parentNode.querySelector(".cstu-modal-backdrop")),b&&window.getComputedStyle(b).display==="none"&&(b.style.display="block"),v&&window.getComputedStyle(v).display==="none"&&(v.style.display="block")},50)}))}),e.onBeforeUnmount(()=>{Zx(n.id),document.removeEventListener("keydown",f),document.removeEventListener("focusin",V),i.value&&(i.value=!1,c("update:modelValue",!1))}),o({hide:g,show:w,close:M,toggle:I}),(b,v)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body",disabled:n.static||n.teleport===!1},[e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[i.value&&a.backdrop!==!1?(e.openBlock(),e.createElementBlock("div",{key:0,id:`${n.id}-backdrop`,class:e.normalizeClass(["cstu-modal-backdrop",a.backdropClass]),style:e.normalizeStyle({zIndex:e.unref(y)-10})},null,14,EC)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"modal"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:n.id,class:e.normalizeClass(["cstu-modal",[{"cstu-modal-static":n.static,"cstu-modal-scrollable":n.scrollable},n.modalClass]]),tabindex:"-1",role:"dialog","aria-modal":"true",style:e.normalizeStyle({zIndex:e.unref(y)}),"aria-labelledby":!a.hideHeader&&a.title?`modal-title-${n.id}`:void 0,onClick:m,onMousedown:v[5]||(v[5]=e.withModifiers(()=>{},["stop"]))},[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:v[4]||(v[4]=e.withModifiers(H=>H.target===H.currentTarget&&H.stopPropagation(),["stop"]))},[OC,e.createElementVNode("div",{class:e.normalizeClass(["cstu-modal-content",a.contentClass,{"cstu-modal-content-fullscreen":a.fullscreen},e.unref(k)]),tabindex:"-1",ref_key:"modalElement",ref:l,"aria-label":a.ariaLabel,onClick:v[3]||(v[3]=H=>H.target===H.currentTarget&&H.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(b.$slots,"modal-header",{},()=>[e.renderSlot(b.$slots,"modal-title",{},()=>[e.createElementVNode("h5",{id:`modal-title-${n.id}`,class:e.normalizeClass([n.titleClass||"cstu-modal-title",{"sr-only":a.titleSrOnly}])},e.toDisplayString(a.title),11,$C)]),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:v[0]||(v[0]=H=>M("headerClose"))},ZC,8,UC))])],2)),e.createElementVNode("div",{class:e.normalizeClass(["cstu-modal-body",a.bodyClass,{"cstu-modal-body-scrollable":a.scrollable}])},[e.renderSlot(b.$slots,"default",{},()=>[a.content?(e.openBlock(),e.createElementBlock("div",WC,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(b.$slots,"modal-footer",{},()=>[a.okOnly?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(E,{key:0,variant:a.cancelVariant,color:a.cancelColor,disabled:a.cancelDisabled||a.busy,onClick:v[1]||(v[1]=H=>M("cancel"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.cancelTitle),1)]),_:1},8,["variant","color","disabled"])),e.createVNode(E,{variant:a.okVariant,color:a.okColor,disabled:a.okDisabled||a.busy,loading:a.busy,onClick:v[2]||(v[2]=H=>M("ok"))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.okTitle),1)]),_:1},8,["variant","color","disabled","loading"])])],2))],10,NC),GC],2)],46,RC)):e.createCommentVNode("",!0)]),_:3})],8,["disabled"]))}}),hS="",KC={mounted(a,o){const c=typeof o.value=="string"?o.value:Object.keys(o.modifiers)[0];if(!c){console.warn("v-cstu-modal directive requires a modal ID");return}a.addEventListener("click",()=>{$x.show(c)}),a.tagName!=="BUTTON"&&(a.setAttribute("role","button"),a.addEventListener("keydown",n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),$x.show(c))}),a.hasAttribute("tabindex")||a.setAttribute("tabindex","0"))}},JC={install:a=>{a.directive("cstu-modal",KC)}},QC=["primary","secondary","success","warning","info"];function Gx(a,o=QC){if(!a||!o||o.length===0)return"primary";let c=0;for(let r=0;r<a.length;r+=1)c=a.charCodeAt(r)+((c<<5)-c);const n=Math.abs(c)%o.length;return o[n]}function Xx(a){return!a||typeof a!="string"?"":a.trim().split(" ").slice(0,2).map(o=>o.charAt(0).toUpperCase()).join("")}const YC=["src","alt"],_C=["title"],eL={key:1,"data-avatar-placeholder-icon":"true",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tL=[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)],Kx=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,c=e.ref(!o.src);e.watch(()=>o.src,y=>{c.value=!y},{immediate:!0});const n=y=>y?["primary","secondary","success","warning","danger","info","dark","light","initials"].includes(y):!0,r=e.computed(()=>o.name?Xx(o.name):""),i=e.computed(()=>{const y={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"?y[o.size]||y.md:typeof o.size=="number"?`w-[${o.size}px] h-[${o.size}px]`:y.md}),d=e.computed(()=>oe(o.radius)),l=e.computed(()=>{if(o.src&&!c.value||!n(o.color)&&o.color!=="initials")return"";if(o.color==="initials"&&o.name){const x=Gx(o.name,o.allowedInitialsColors||["primary","secondary","success","warning","info"]);return x?T(x,"filled",{}):T("primary","filled",{})}const y=o.variant==="transparent"?"default":o.variant==="gradient"?"filled":o.variant,p=o.color&&o.color!=="initials"?o.color:"primary",k=T(p,y,{});return o.variant==="transparent"?"bg-transparent":k}),h=e.computed(()=>!n(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}`:Og(o.variant)),s=e.computed(()=>{if(o.src&&!c.value||n(o.color)||o.color==="initials")return{};const y={};switch(o.variant){case"filled":y.backgroundColor=o.color,o.autoContrast&&(y.color="white");break;case"light":y.backgroundColor=`${o.color}20`,y.color=o.color;break;case"outline":y.backgroundColor="transparent",y.color=o.color,y.border=`1px solid ${o.color}`;break;case"transparent":y.backgroundColor="transparent",y.color=o.color;break}return y}),u=y=>{var p;c.value=!0,(p=o.imageProps)!=null&&p.onError&&o.imageProps.onError(y)};return(y,p)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.component||"div"),{class:e.normalizeClass(["avatar",e.unref(i),e.unref(d),!c.value&&a.src?"":e.unref(l),!c.value&&a.src?"":e.unref(h),{"avatar--with-image":!c.value&&a.src},{"hover:opacity-80 transition-opacity":a.hover},a.customClasses]),style:e.normalizeStyle(e.unref(s))},{default:e.withCtx(()=>[!c.value&&a.src?(e.openBlock(),e.createElementBlock("img",e.mergeProps({key:0,class:"avatar__image",src:a.src,alt:a.alt},a.imageProps,{onError:u}),null,16,YC)):(e.openBlock(),e.createElementBlock("span",{key:1,class:"avatar__placeholder",title:a.alt},[e.renderSlot(y.$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",eL,tL))])],8,_C))]),_:3},8,["class","style"]))}}),pS="",Jx=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,c=e.computed(()=>{if(typeof o.spacing=="number")return`${o.spacing}px`;const s={xs:"-1rem",sm:"-0.75rem",md:"-0.5rem",lg:"-0.25rem",xl:"0"};return s[o.spacing]||s.sm}),n=e.computed(()=>{if(typeof o.gap=="number")return`${o.gap}px`;if(typeof o.gap=="string"&&!isNaN(parseFloat(o.gap)))return o.gap;const s={none:"0",xs:"0.25rem",sm:"0.5rem",md:"0.75rem",lg:"1rem"};return s[o.gap]||s.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 s={none:"0",thin:"1px",normal:"2px",medium:"3px",thick:"4px"};return s[o.outlineWidth]||s.normal}),i=e.computed(()=>{if(typeof o.outlineOffset=="number")return`${o.outlineOffset}px`;if(typeof o.outlineOffset=="string"&&!isNaN(parseFloat(o.outlineOffset)))return o.outlineOffset;const s={none:"0",inset:"-2px",small:"1px",medium:"2px",large:"3px"};return s[o.outlineOffset]||s.small}),d=e.computed(()=>typeof o.outlineColor=="string"&&["primary","secondary","success","danger","warning","info","dark","light"].includes(o.outlineColor)?`outline-${o.outlineColor}`:""),l=e.computed(()=>typeof o.outlineColor=="string"&&["primary","secondary","success","danger","warning","info","dark","light"].includes(o.outlineColor)?"var(--color-"+o.outlineColor+")":o.outlineColor),h=e.computed(()=>({"--avatar-group-spacing":c.value,"--avatar-group-gap":n.value,"--avatar-group-outline-width":r.value,"--avatar-group-outline-color":l.value,"--avatar-group-outline-offset":i.value}));return(s,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["avatar-group",a.customClasses,e.unref(d),{"avatar-group--hover":a.hover}]),style:e.normalizeStyle(e.unref(h))},[e.renderSlot(s.$slots,"default")],6))}}),uS="";Kx.Group=Jx;const A2=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 c=a,n=e.computed(()=>c.placement?c.placement:c.orientation==="horizontal"?"top":"left"),r=e.computed(()=>c.orientation),i=e.computed(()=>c.variant),d=e.ref(c.value!==void 0?c.value:c.defaultValue);e.watch(()=>c.value,h=>{h!==void 0&&(d.value=h)});const l=h=>{c.value!==void 0?o("change",h):d.value=h};return e.provide("activeTab",d),e.provide("setActiveTab",l),e.provide("tabsOrientation",r),e.provide("tabsPlacement",n),(h,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cstu-tabs",`cstu-tabs-${e.unref(r)}`,`cstu-tabs-placement-${e.unref(n)}`,`cstu-tabs-variant-${e.unref(i)}`])},[e.renderSlot(h.$slots,"default")],2))}}),kS="",Qx=e.defineComponent({__name:"TabsList",props:{justify:{type:String,default:"flex-start"},divider:{type:Boolean,default:!1}},setup(a){const o=a,c=e.inject("tabsOrientation",e.ref("horizontal")),n=e.inject("tabsPlacement",e.ref("top")),r=e.computed(()=>["tabs-list",`tabs-list-${c.value}`,`tabs-list-placement-${n.value}`,o.divider?"tabs-list-with-divider":""]),i=l=>{if(["space-between","space-around","space-evenly"].includes(l))return l;switch(l){case"flex-start":return"flex-start";case"flex-end":return"flex-end";case"center":return"center";default:return"flex-start"}},d=e.computed(()=>c.value==="horizontal"?{justifyContent:o.justify}:{justifyContent:i(o.justify)});return(l,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(r)),style:e.normalizeStyle(e.unref(d))},[e.renderSlot(l.$slots,"default")],6))}}),mS="",Yx=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,c=e.inject("activeTab",e.ref("")),n=e.inject("setActiveTab",()=>{}),r=e.inject("tabsOrientation",e.ref("horizontal")),i=e.inject("tabsPlacement",e.ref("top")),d=e.computed(()=>c.value),l=e.computed(()=>r.value),h=e.computed(()=>i.value),s=e.computed(()=>d.value===o.value),u=e.computed(()=>l.value==="vertical"),y=e.computed(()=>o.fullWidth&&l.value==="horizontal"),p=()=>{!o.disabled&&!o.loading&&n(o.value)};return(k,x)=>(e.openBlock(),e.createBlock(e.unref(E),{class:e.normalizeClass(["tabs-tab",e.unref(s)?"tabs-tab-active":"tabs-tab-inactive",`tabs-tab-${o.variant}`,o.color?`tabs-tab-color-${o.color}`:"",`tabs-tab-orientation-${e.unref(l)}`,`tabs-tab-placement-${e.unref(h)}`,{"tabs-tab-full-width":e.unref(y)}]),disabled:o.disabled,loading:o.loading,color:e.unref(s)?o.color:"secondary",variant:e.unref(s)?o.variant:"subtle",size:o.size,radius:o.variant==="text"?"none":o.radius,"full-width":e.unref(u),onClick:p},e.createSlots({default:e.withCtx(()=>[e.renderSlot(k.$slots,"default")]),_:2},[k.$slots.leftSection?{name:"leftSection",fn:e.withCtx(()=>[e.renderSlot(k.$slots,"leftSection")]),key:"0"}:void 0,k.$slots.rightSection?{name:"rightSection",fn:e.withCtx(()=>[e.renderSlot(k.$slots,"rightSection")]),key:"1"}:void 0]),1032,["class","disabled","loading","color","variant","size","radius","full-width"]))}}),fS="",_x=e.defineComponent({__name:"TabsPanel",props:{value:{type:String,required:!0},KeepAlive:{type:Boolean,default:!1}},setup(a){const o=a,c=e.inject("activeTab",e.ref("")),n=e.inject("tabsOrientation",e.ref("horizontal")),r=e.inject("tabsPlacement",e.ref("top")),i=e.computed(()=>c.value===o.value),d=e.computed(()=>["tabs-panel",i.value?"tabs-panel-active":"tabs-panel-inactive",`tabs-panel-${n.value}`,`tabs-panel-placement-${r.value}`]);return(l,h)=>a.KeepAlive||e.unref(i)?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(d))},[e.renderSlot(l.$slots,"default")],2)),[[e.vShow,e.unref(i)]]):e.createCommentVNode("",!0)}}),MS="";A2.List=Qx,A2.Tab=Yx,A2.Panel=_x;const aL=e.createElementVNode("span",{class:"cstu-sr-only"},"First page",-1),oL=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),cL=e.createElementVNode("span",{class:"cstu-sr-only"},"Previous page",-1),nL=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),rL={key:2,class:"cstu-flex cstu-items-center cstu-gap-2"},iL=[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)],lL=e.createElementVNode("span",{class:"cstu-sr-only"},"Next page",-1),dL=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),sL=e.createElementVNode("span",{class:"cstu-sr-only"},"Last page",-1),hL=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),yL=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 c=a,n=e.ref(c.modelValue);e.watch(()=>c.modelValue,p=>{n.value=p});const r=e.computed(()=>n.value===1),i=e.computed(()=>n.value===c.total),d=e.computed(()=>{switch(c.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"}}),l=e.computed(()=>["cstu-flex cstu-items-center cstu-justify-center",u(c.size)]),h=e.computed(()=>{const p=[],k=c.total;if(c.siblings*2+3+c.boundaries*2>=k)return Array.from({length:k},(f,L)=>L+1);const w=Math.max(n.value-c.siblings,c.boundaries+1),g=Math.min(n.value+c.siblings,k-c.boundaries),I=w>c.boundaries+2,M=g<k-(c.boundaries+1),m=new Set;for(let f=1;f<=c.boundaries;f++)p.push(f),m.add(f);if(I)p.push("dots");else if(!I&&w>c.boundaries)for(let f=c.boundaries+1;f<w;f++)m.has(f)||(p.push(f),m.add(f));for(let f=w;f<=g;f++)m.has(f)||(p.push(f),m.add(f));if(M)p.push("dots");else if(!M&&g<k-c.boundaries)for(let f=g+1;f<k-c.boundaries+1;f++)m.has(f)||(p.push(f),m.add(f));for(let f=k-c.boundaries+1;f<=k;f++)m.has(f)||(p.push(f),m.add(f));return p}),s=p=>{p<1||p>c.total||c.disabled||(n.value=p,o("update:modelValue",p))};function u(p){const k={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 k[p]||k.md}const y=e.computed(()=>c.variant==="filled"?"subtle":"bordered-transparent");return(p,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cstu-flex cstu-items-center cstu-gap-2",[c.class]])},[c.withEdges?(e.openBlock(),e.createBlock(E,{key:0,variant:e.unref(y),color:"light",size:c.size,disabled:e.unref(r)||c.disabled,onClick:k[0]||(k[0]=x=>s(1)),"aria-label":"Go to first page",class:e.normalizeClass(e.unref(d))},{default:e.withCtx(()=>[aL,oL]),_:1},8,["variant","size","disabled","class"])):e.createCommentVNode("",!0),c.withControls?(e.openBlock(),e.createBlock(E,{key:1,variant:e.unref(y),color:"light",size:c.size,disabled:e.unref(r)||c.disabled,onClick:k[1]||(k[1]=x=>s(n.value-1)),"aria-label":"Go to previous page",class:e.normalizeClass(e.unref(d))},{default:e.withCtx(()=>[cL,nL]),_:1},8,["variant","size","disabled","class"])):e.createCommentVNode("",!0),c.withPages?(e.openBlock(),e.createElementBlock("div",rL,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(h),(x,w)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:w},[x!=="dots"?(e.openBlock(),e.createBlock(E,{key:0,variant:x===n.value?"filled":e.unref(y),color:x===n.value?c.color:"light",size:c.size,disabled:c.disabled,onClick:g=>s(Number(x)),"aria-current":x===n.value?"page":void 0,"aria-label":`Page ${x}`,class:e.normalizeClass(e.unref(d))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x),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(l),e.unref(d)]])},iL,2))],64))),128))])):e.createCommentVNode("",!0),c.withControls?(e.openBlock(),e.createBlock(E,{key:3,variant:e.unref(y),color:"light",size:c.size,disabled:e.unref(i)||c.disabled,onClick:k[2]||(k[2]=x=>s(n.value+1)),"aria-label":"Go to next page",class:e.normalizeClass(e.unref(d))},{default:e.withCtx(()=>[lL,dL]),_:1},8,["variant","size","disabled","class"])):e.createCommentVNode("",!0),c.withEdges?(e.openBlock(),e.createBlock(E,{key:4,variant:e.unref(y),color:"light",size:c.size,disabled:e.unref(i)||c.disabled,onClick:k[3]||(k[3]=x=>s(c.total)),"aria-label":"Go to last page",class:e.normalizeClass(e.unref(d))},{default:e.withCtx(()=>[sL,hL]),_:1},8,["variant","size","disabled","class"])):e.createCommentVNode("",!0)],2))}}),eI={mounted(a,o){a._clickOutside=c=>{const n=c.target;if(!(a===n||a.contains(n))){const r=c.target,i=r.tagName&&r.tagName.toLowerCase()==="input",d=r.closest(".cstu-dropdown-menu");!i&&!d&&o.value(c)}},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))}},pL=["id","aria-labelledby","aria-modal","onKeydown"],uL={class:"cstu-popover-inner"},kL=["id"],mL=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 c=a,n=e.ref(c.defaultOpen),r=e.ref(null),i=e.ref(null),d=e.ref(null),l=e.ref(null),h=e.ref(c.zIndex);c.open!==void 0&&(n.value=c.open);const s=e.computed(()=>{if(c.placement!=="auto")return c.placement}),u=e.computed(()=>{const C=[b2(c.offsetDistance)];return d.value&&C.push(Dx({element:d})),c.placement==="auto"?C.push(jx({padding:8})):C.push(z2({fallbackPlacements:["top","bottom","left","right"],padding:8})),C.push(S2({padding:8})),C}),{floatingStyles:y,update:p}=q2(r,i,{placement:s,middleware:u,whileElementsMounted:Fx}),k=C=>{c.disabled||(c.trigger==="click"||c.trigger==="manual")&&z()},x=()=>{c.disabled||c.trigger==="hover"&&f()},w=()=>{c.disabled||c.trigger==="hover"&&setTimeout(()=>{L("hover")},100)},g=C=>{c.closeOnClick&&L("popoverClick"),C.stopPropagation()},I=C=>{c.closeOnClickOutside&&n.value&&i.value&&!i.value.contains(C.target)&&r.value&&!r.value.contains(C.target)&&L("clickAway")},M=()=>{c.closeOnClickOutside&&L("backdrop")},m=C=>{c.closeOnEscape&&C.key==="Escape"&&(C.preventDefault(),L("escape"))},f=()=>{c.disabled||n.value||(l.value=document.activeElement,n.value=!0,e.nextTick(()=>{p(),c.trapFocus&&V()}),o("open"),o("update:open",!0))},L=(C="programmatic")=>{n.value&&(n.value=!1,c.trapFocus&&D(l.value),o("close",C),o("update:open",!1))},z=()=>{n.value?L():f()},V=()=>{if(!i.value)return;const C=b(i.value);C.length>0?C[0].focus():i.value.focus()},D=C=>{C&&typeof C.focus=="function"&&C.focus()},b=C=>Array.from(C.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(B=>!B.hasAttribute("disabled")&&!B.getAttribute("aria-hidden")),v=C=>{if(!n.value||!c.trapFocus||!i.value)return;const B=C.target;i.value.contains(B)||(C.preventDefault(),V())};e.watch(()=>c.open,C=>{C!==n.value&&(C?f():L())}),e.watch(r,C=>{C&&p()}),e.onMounted(()=>{document.addEventListener("keydown",m),c.trapFocus&&document.addEventListener("focusin",v)}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",m),c.trapFocus&&document.removeEventListener("focusin",v)});const H=e.computed(()=>[oe(c.radius),!c.variant||c.variant==="shadow"?c.shadow?`cstu-shadow-${c.shadow}`:"cstu-shadow-md":"",c.popoverClass]),O=e.computed(()=>{const C=[...H.value.filter(Boolean)];let B=!1;const $=c.color;if($&&G($)&&c.variant==="color"){const F=T($,"filled",{disabled:c.disabled});typeof F=="string"&&F.trim()&&(C.push(...F.split(" ").filter(Boolean)),B=!0)}return B||(C.push("cstu-bg-white"),c.variant==="outline"&&C.push("cstu-border","cstu-border-gray-300"),C.push("cstu-text-gray-700")),C.filter(Boolean).map(F=>typeof F=="string"?F:Object.keys(F).filter(f2=>F[f2]).join(" ")).join(" ")}),N=e.computed(()=>{const C={width:typeof c.width=="number"?`${c.width}px`:c.width},B=c.color;if(B&&!G(B)&&c.variant==="color"){C.backgroundColor=B;const $=P(B);C.color=$>128?"#000000":"#FFFFFF"}return{...y.value,...C}});e.computed(()=>{const C={backgroundColor:"white"},B=c.color;return c.variant==="color"&&B?G(B)?(C.borderWidth="1px",C.borderStyle="solid",C.borderColor=`var(--${B}-500)`):C.backgroundColor=B:c.variant==="outline"&&(C.borderWidth="1px",C.borderStyle="solid",C.borderColor="#e2e8f0"),C});function P(C){if(C.startsWith("#"))try{const B=parseInt(C.substring(1,3),16),$=parseInt(C.substring(3,5),16),F=parseInt(C.substring(5,7),16);return(B*299+$*587+F*114)/1e3}catch{return 128}else if(C.startsWith("rgb"))try{const B=C.match(/\d+/g);if(B&&B.length>=3){const $=parseInt(B[0],10),F=parseInt(B[1],10),f2=parseInt(B[2],10);return($*299+F*587+f2*114)/1e3}}catch{return 128}return 128}const _=e.computed(()=>{const C=c.color,B=!(C&&G(C)),$=c.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"}[c.size||"md"],ge(c.size||"md"),"cstu-flex cstu-items-center cstu-justify-between",$||B?"cstu-border-b cstu-border-gray-200 dark:cstu-border-gray-700":"",c.headerClass].filter(Boolean).join(" ")}),Q=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"}[c.size||"md"],ge(c.size||"sm"),c.bodyClass].filter(Boolean).join(" ")),X=e.computed(()=>{const C=c.color,B=!(C&&G(C)),$=c.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"}[c.size||"md"],$||B?"cstu-border-t cstu-border-gray-200 dark:cstu-border-gray-700":"","cstu-flex cstu-justify-end cstu-space-x-2",c.footerClass].filter(Boolean).join(" ")});return(C,B)=>(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:k,onMouseenter:x,onMouseleave:w},[e.renderSlot(C.$slots,"trigger")],34),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"fade",appear:""},{default:e.withCtx(()=>[n.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:M},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(()=>[n.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"cstu-popover-container",style:e.normalizeStyle({zIndex:h.value})},[e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"popoverRef",ref:i,id:c.id,class:e.normalizeClass(e.unref(O)),style:e.normalizeStyle([e.unref(y),e.unref(N)]),role:"dialog","aria-labelledby":c.title?`${c.id}-title`:void 0,"aria-modal":c.trapFocus,tabindex:"-1",onClick:g,onKeydown:e.withKeys(m,["esc"])},[e.createElementVNode("div",uL,[c.hideHeader?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(_))},[e.renderSlot(C.$slots,"header",{},()=>[e.createElementVNode("h3",{id:`${c.id}-title`,class:e.normalizeClass(["cstu-popover-title cstu-font-medium",e.unref(ge)(c.size||"md")])},e.toDisplayString(c.title),11,kL),c.showCloseIcon?(e.openBlock(),e.createBlock(E,{key:0,icon:"X",variant:"text",size:"xs",color:c.color&&e.unref(G)(c.color)?"white":"gray",class:"cstu-ml-auto","aria-label":"Close popover",onClick:B[0]||(B[0]=e.withModifiers($=>L("headerClose"),["stop"]))},null,8,["color"])):e.createCommentVNode("",!0)])],2)),e.createElementVNode("div",{class:e.normalizeClass(e.unref(Q))},[e.renderSlot(C.$slots,"default",{},()=>[a.content?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(ge)(c.size||"sm"))},e.toDisplayString(a.content),3)):e.createCommentVNode("",!0)])],2),c.hideFooter?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(X))},[e.renderSlot(C.$slots,"footer",{},()=>[e.createVNode(E,{size:"sm",variant:"subtle",onClick:B[1]||(B[1]=$=>L("cancel"))},{default:e.withCtx(()=>[e.createTextVNode(" Close ")]),_:1})])],2))])],46,pL)),[[e.unref(eI),I]])],4)):e.createCommentVNode("",!0)]),_:3})]))],64))}}),xS="",fL=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,c=e.useSlots(),n=e.computed(()=>!!c.default),r=e.computed(()=>c.default?c.default():[]),i=y=>y===r.value.length-1,d=y=>y?["primary","secondary","success","warning","danger","info","dark","light"].includes(y):!0,l=y=>{if(!i(y)||!o.highlightActive)return"";if(d(o.color)){const p=W[o.color];if(p)return`cstu-text-${p.base}-${p.main}`}return""},h=y=>!i(y)||!o.highlightActive?{}:d(o.color)?{}:{color:o.color},s=e.computed(()=>{const y={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg",xl:"text-xl"};return y[o.size]||y.md}),u=e.computed(()=>{const y={xs:"mx-1",sm:"mx-2",md:"mx-3",lg:"mx-4",xl:"mx-5"};return y[o.separatorMargin]||y.xs});return(y,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cstu-breadcrumbs",o.class])},[e.unref(n)?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(e.unref(r),(k,x)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:x},[e.createElementVNode("div",{class:e.normalizeClass(["cstu-breadcrumb-item",e.unref(s),i(x)?"cstu-breadcrumb-active":"cstu-breadcrumb-inactive",i(x)?o.activeClass:"",i(x)&&o.highlightActive?l(x):""]),style:e.normalizeStyle(h(x))},[e.renderSlot(y.$slots,`item-${x}`,{isActive:i(x)},()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(k)))])],6),i(x)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["cstu-breadcrumb-separator",e.unref(u),o.separatorClass])},[e.renderSlot(y.$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(y.$slots,"default",{key:0})],2))}}),IS="",ML={key:0,class:"cstu-flex cstu-justify-between cstu-items-center cstu-mb-1"},gL=["for"],xL={key:0,class:"cstu-text-red-500 cstu-ml-1"},IL={key:0,class:"cstu-flex cstu-items-center cstu-justify-center cstu-w-[15px] cstu-h-[15px] cstu-mt-1"},wL=["id","value","placeholder","disabled","required","readonly","rows","maxlength"],CL={key:1,class:"cstu-flex cstu-items-center cstu-justify-center cstu-w-[15px] cstu-h-[15px] cstu-mt-1"},LL=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:c}){const{id:n,modelValue:r,placeholder:i,label:d,description:l,error:h,hasError:s=!1,disabled:u=!1,readonly:y=!1,required:p=!1,withAsterisk:k=!1,showBothErrorAndDescription:x=!1,textareaProps:w,labelProps:g,descriptionProps:I,errorProps:M,size:m="md",variant:f="default",radius:L="md",color:z="primary",class:V,fullWidth:D=!1,inputClass:b="",rows:v=3,resize:H="none",maxLength:O=void 0}=a,N=`textarea-${Math.random().toString(36).substring(2,11)}`,P=e.ref(null),_={xs:{inputClass:`cstu-min-h-8 ${D?"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 ${D?"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 ${D?"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 ${D?"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 ${D?"cstu-w-full":"cstu-max-w-[20.5rem]"}`,labelSize:"cstu-text-base cstu-font-medium",descriptionSize:"cstu-text-sm"}},Q=e.computed(()=>`${_[m].inputClass.split(" ")[0]} cstu-transition-all cstu-duration-300`),X=e.computed(()=>_[m].labelSize),C=e.computed(()=>_[m].descriptionSize),B=e.computed(()=>{switch(m){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"}}),$=e.computed(()=>oe(L)),F=e.computed(()=>h!==void 0&&h!==""||s),f2=e.computed(()=>f==="unstyled"||!G(z)&&!F.value?"":F.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":f==="default"||f==="outline"?`cstu-border-${z}-500 hover:cstu-border-${z}-600 focus-within:cstu-border-${z}-500 focus-within:cstu-ring-1 focus-within:cstu-ring-${z}-500`:f==="filled"?`cstu-bg-${z}-50 hover:cstu-bg-${z}-100`:f==="light"?`cstu-bg-${z}-50 cstu-text-${z}-500 hover:cstu-bg-${z}-100`:f==="subtle"?`cstu-text-${z}-500 hover:cstu-bg-${z}-50`:""),Nb=e.computed(()=>f==="unstyled"?{}:G(z)||F.value?{}:f==="default"||f==="outline"?{"--border-color":z,"border-color":"var(--border-color)"}:f==="filled"?{"--bg-color":`${z}10`,"background-color":"var(--bg-color)"}:f==="light"?{"--bg-color":`${z}10`,"--text-color":z,"background-color":"var(--bg-color)",color:"var(--text-color)"}:f==="subtle"?{"--text-color":z,color:"var(--text-color)"}:{}),$b=e.computed(()=>{const A={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(f==="unstyled")return[A[f]];const he=F.value?"":f==="default"||f==="outline"?"cstu-border-gray-300/45":"",l2=F.value?"cstu-border-red-500":"";return[A[f],he,l2,F.value?"hover:cstu-border-red-500":"hover:cstu-border-blue-450",F.value?"focus-within:cstu-border-red-500 focus-within:cstu-ring-1 focus-within:cstu-ring-red-500":"focus-within:cstu-border-blue-450 focus-within:cstu-ring-1 focus-within:cstu-ring-blue-450"]}),xI=e.ref(!1),Ub=A=>{xI.value=!0,c("focus",A)},Zb=A=>{xI.value=!1,c("blur",A)},Wb=A=>{c("change",A)};return o({textarea:P,focus:()=>{var A;return(A=P.value)==null?void 0:A.focus()},blur:()=>{var A;return(A=P.value)==null?void 0:A.blur()},select:()=>{var A;return(A=P.value)==null?void 0:A.select()},setSelectionRange:(A,he)=>{var l2;return(l2=P.value)==null?void 0:l2.setSelectionRange(A,he)},setRangeText:A=>{var he;return(he=P.value)==null?void 0:he.setRangeText(A)},get value(){var A;return(A=P.value)==null?void 0:A.value},set value(A){P.value&&A!==void 0&&(P.value.value=A)}}),(A,he)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["cstu-flex cstu-flex-col cstu-transition-all cstu-duration-300",[A.customClass,a.fullWidth?"cstu-w-full":"cstu-max-w-[20.5rem]"]])},[a.label||A.$slots.label?(e.openBlock(),e.createElementBlock("div",ML,[e.createElementVNode("label",e.mergeProps({for:a.id||N,class:["cstu-flex cstu-items-center",e.unref(X)]},a.labelProps),[e.renderSlot(A.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(a.label)+" ",1),a.withAsterisk||a.required?(e.openBlock(),e.createElementBlock("span",xL,"*")):e.createCommentVNode("",!0)])],16,gL),e.renderSlot(A.$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($),e.unref($b),e.unref(f2),{"cstu-opacity-50 cstu-pointer-events-none cstu-cursor-not-allowed":a.disabled}]),style:e.normalizeStyle(e.unref(Nb))},[A.$slots.leftSection?(e.openBlock(),e.createElementBlock("div",IL,[e.renderSlot(A.$slots,"leftSection")])):e.createCommentVNode("",!0),e.createElementVNode("textarea",e.mergeProps({ref_key:"textareaRef",ref:P,id:a.id||N,value:a.modelValue,placeholder:a.placeholder,disabled:a.disabled,required:a.required,readonly:a.readonly,rows:a.rows,maxlength:a.maxLength,class:["cstu-flex-1 cstu-bg-transparent cstu-outline-none cstu-w-full",e.unref(B),a.inputClass,{"cstu-text-gray-500":a.modelValue,"cstu-text-red-500":e.unref(F)&&!a.modelValue}],style:{resize:a.resize},onInput:he[0]||(he[0]=l2=>A.$emit("update:modelValue",l2.target.value)),onFocus:Ub,onBlur:Zb,onChange:Wb},a.textareaProps),null,16,wL),A.$slots.rightSection?(e.openBlock(),e.createElementBlock("div",CL,[e.renderSlot(A.$slots,"rightSection")])):e.createCommentVNode("",!0)],6)]),a.description&&!e.unref(F)||A.$slots.description&&!e.unref(F)||a.showBothErrorAndDescription&&a.description||a.showBothErrorAndDescription&&A.$slots.description?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:1,class:"cstu-mt-1"},a.descriptionProps),[e.createElementVNode("p",{class:e.normalizeClass(["cstu-text-gray-500",e.unref(C)])},[e.renderSlot(A.$slots,"description",{},()=>[e.createTextVNode(e.toDisplayString(a.description),1)])],2)],16)):e.createCommentVNode("",!0),e.unref(F)&&a.error||e.unref(F)&&A.$slots.error||a.showBothErrorAndDescription&&a.error||a.showBothErrorAndDescription&&A.$slots.error?(e.openBlock(),e.createElementBlock("div",e.mergeProps({key:2,class:"cstu-mt-1"},a.errorProps),[e.createElementVNode("p",{class:e.normalizeClass(["cstu-text-red-500",e.unref(C)])},[e.renderSlot(A.$slots,"error",{},()=>[e.createTextVNode(e.toDisplayString(a.error),1)])],2)],16)):e.createCommentVNode("",!0)],2))}});/**
|
|
13
13
|
* @license lucide-vue-next v0.468.0 - ISC
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the ISC license.
|