@skygraph/vue 0.6.2 → 0.6.4

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.cjs CHANGED
@@ -1,9 +1,9 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Oe=require("@skygraph/core");function Lt(t){const n=Oe.createCore(),l=Oe.createForm(n,t),a=new Set(Object.keys((t==null?void 0:t.defaultValues)??{})),o=()=>{const E={...l.getFieldsValue()};for(const z of a)if(!(z in E)){const x=n.get(z);x!==void 0&&(E[z]=x)}return E},s=e.ref(o()),u=e.ref({...l.getFormState()});let c=!1;const i=()=>{s.value=o(),u.value={...l.getFormState()}},r=()=>{c||(c=!0,queueMicrotask(()=>{c=!1,i()}))},d=n.use((E,z)=>{z(E),E.path&&!E.path.startsWith("$")&&a.add(E.path),r()});e.onScopeDispose(()=>{d()});const v=async()=>{u.value={...u.value,isSubmitting:!0};try{await l.submit(async()=>{var E;await((E=t==null?void 0:t.onSubmit)==null?void 0:E.call(t,o()))})}finally{i()}if(!l.getFormState().isValid&&(t!=null&&t.onSubmitInvalid)){const E=await l.validate();t.onSubmitInvalid(E.errors)}},g=E=>{if(l.reset(E),E)for(const[z,x]of Object.entries(E))a.add(z),n.set(z,x);else if(t!=null&&t.defaultValues)for(const[z,x]of Object.entries(t.defaultValues))n.set(z,x);i()},m=(E,z)=>{l.setValue(E,z)},h=E=>{l.setFieldsValue(E)},p=E=>l.getValue(E),b=()=>o(),y=E=>l.validate(E);return{core:n,form:l,values:s,formState:u,isSubmitting:e.computed(()=>u.value.isSubmitting),isValidating:e.computed(()=>u.value.isValidating),isDirty:e.computed(()=>u.value.isDirty),isValid:e.computed(()=>u.value.isValid),submit:v,reset:g,setFieldValue:m,setFieldsValue:h,getFieldValue:p,getFieldsValue:b,validateFields:y}}function zl(t,n,l){const a=e.ref(n.getValue(l)),o=e.ref({...n.getFieldState(l)}),s=e.ref([...o.value.errors]),u=e.ref([...o.value.warnings]),c=e.ref(o.value.touched),i=e.ref(o.value.dirty),r=e.ref(o.value.validating),d=()=>{const h=n.getFieldState(l);o.value={...h},s.value=[...h.errors],u.value=[...h.warnings],c.value=h.touched,i.value=h.dirty,r.value=h.validating},v=[];v.push(t.subscribe(l,h=>{a.value=h}));for(const h of["errors","warnings","touched","dirty","validating"])v.push(t.subscribe(`$meta.${l}.${h}`,()=>{d()}));e.onScopeDispose(()=>{for(const h of v)h()});const g=h=>{n.setValue(l,h)},m=()=>{n.onFieldBlur(l)};return{value:a,errors:s,warnings:u,error:e.computed(()=>s.value[0]??null),touched:c,dirty:i,validating:r,status:e.computed(()=>{if(r.value)return"validating";if(s.value.length>0)return"error";if(u.value.length>0)return"warning"}),onChange:g,onBlur:m,meta:o}}function Ba(t,n){let l=0;const a=()=>`fa_${n}_${++l}`,o=t.getListValue(n),s=e.ref(o.map(()=>a()));return{fields:e.computed(()=>s.value.map((v,g)=>({key:v,index:g}))),append:v=>{t.listAdd(n,v),s.value=[...s.value,a()]},remove:v=>{t.listRemove(n,v),s.value=s.value.filter((g,m)=>m!==v)},move:(v,g)=>{t.listMove(n,v,g);const m=[...s.value],[h]=m.splice(v,1);m.splice(g,0,h),s.value=m},replace:v=>{const g=t.getListValue(n).length;for(let h=g-1;h>=0;h--)t.listRemove(n,h);const m=[];for(const h of v)t.listAdd(n,h),m.push(a());s.value=m}}}function Tl(t,n){const l=e.ref(t.get(n)),a=t.subscribe(n,o=>{l.value=o});return e.onScopeDispose(()=>{a()}),l}function Ca(t,n){return Tl(t,n)}function Ml(t){const n=Oe.createCore(),l=Oe.createTable(n,t),a=t!=null&&t.data?e.isRef(t.data)?t.data.value:t.data:void 0;a&&l.addRows(a);const o=e.ref(l.getVisibleRows()),s=e.ref(l.getTableState()),u=e.ref(l.getPinnedColumns()),c=e.ref(l.getColumnWidths()),i=()=>{o.value=l.getVisibleRows(),s.value=l.getTableState(),u.value=l.getPinnedColumns(),c.value=l.getColumnWidths()};if(t!=null&&t.data&&e.isRef(t.data)){const B=t.data,w=e.watch(B,S=>{l.reset(),S&&l.addRows(S),i()});e.onScopeDispose(()=>w())}return{core:n,table:l,visibleRows:o,tableState:s,pinnedColumns:u,columnWidths:c,setSort:(B,w)=>{l.setSort(B,w),i()},setSorts:B=>{l.setSorts(B),i()},clearSort:()=>{l.clearSort(),i()},addFilter:B=>{l.addFilter(B),i()},removeFilter:B=>{l.removeFilter(B),i()},clearFilters:()=>{l.clearFilters(),i()},setFilterFn:B=>{l.setFilterFn(B),i()},setPage:B=>{l.setPage(B),i()},nextPage:()=>{l.nextPage(),i()},prevPage:()=>{l.prevPage(),i()},pinColumn:(B,w)=>{l.pinColumn(B,w),u.value=l.getPinnedColumns()},clearPinned:()=>{l.clearPinned(),u.value=l.getPinnedColumns()},setColumnWidth:(B,w)=>{l.setColumnWidth(B,w),c.value=l.getColumnWidths()},clearColumnWidths:()=>{l.clearColumnWidths(),c.value=l.getColumnWidths()},refresh:i}}function Ll(t){const n=Oe.createCore(),l=Oe.createTree(n,t);t!=null&&t.data&&l.setData(t.data);const a=e.ref(l.getState()),o=e.ref(l.getFlatNodes()),s=()=>{a.value=l.getState(),o.value=l.getFlatNodes()};return{core:n,tree:l,treeState:a,flatNodes:o,expand:P=>{l.expand(P),s()},collapse:P=>{l.collapse(P),s()},toggleExpand:P=>{l.toggleExpand(P),s()},setExpandedKeys:P=>{l.setExpandedKeys(P),s()},expandAll:()=>{l.expandAll(),s()},collapseAll:()=>{l.collapseAll(),s()},expandToLevel:P=>{l.expandAll();const q=l.getFlatNodes(),_=[];for(const R of q)R.depth<P&&!R.isLeaf&&_.push(R.key);l.setExpandedKeys(_),s()},check:P=>{l.check(P),s()},uncheck:P=>{l.uncheck(P),s()},toggleCheck:P=>{l.toggleCheck(P),s()},setCheckedKeys:P=>{l.setCheckedKeys(P),s()},checkAll:()=>{l.setCheckedKeys(l.getAllKeys()),s()},uncheckAll:()=>{l.setCheckedKeys([]),s()},select:(P,q)=>{l.select(P,q),s()},deselect:P=>{l.deselect(P),s()},setSelectedKeys:P=>{l.setSelectedKeys(P),s()},markLoading:P=>{l.markLoading(P),s()},markLoaded:P=>{l.markLoaded(P),s()},addChildren:(P,q)=>{l.addChildren(P,q),s()},moveNode:(P,q,_)=>{const R=l.moveNode(P,q,_);return s(),R},filterNodes:P=>{l.filterNodes(P),s()},getNodePath:P=>{const q=[];let _=P;for(;_!==null;)q.unshift(_),_=l.getParentKey(_);return q},refresh:s}}function wa(t={}){const{core:n,...l}=t,a=n??Oe.createCore(),o=Oe.createGraph(a,l),s=e.ref(o.getState()),u=o.subscribe(()=>{s.value=o.getState()});return e.onScopeDispose(()=>{u()}),{graph:o,state:s,core:a}}const Sa=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]'].join(", ");function Ea(t){var l,a,o;if(t.hasAttribute("aria-hidden")&&t.getAttribute("aria-hidden")==="true"||t.hasAttribute("hidden"))return!0;let n=t;for(;n;){const s=(o=(a=((l=n.ownerDocument)==null?void 0:l.defaultView)??globalThis).getComputedStyle)==null?void 0:o.call(a,n);if(s&&(s.display==="none"||s.visibility==="hidden"))return!0;n=n.parentElement}return!1}function bl(t){return Array.from(t.querySelectorAll(Sa)).filter(n=>!Ea(n))}function Ft(t){const n=e.ref(null);let l=null,a=null;const o=r=>{if(r.key!=="Tab")return;const d=a;if(!d)return;const v=bl(d);if(v.length===0){r.preventDefault(),d.focus();return}const g=v[0],m=v[v.length-1],h=document.activeElement;r.shiftKey?(h===g||!d.contains(h))&&(r.preventDefault(),m.focus()):(h===m||!d.contains(h))&&(r.preventDefault(),g.focus())},s=()=>{a&&(a.removeEventListener("keydown",o),a=null,l&&typeof l.focus=="function"&&(l.focus(),l=null))},u=r=>{a!==r&&(s(),a=r,l=document.activeElement,r.addEventListener("keydown",o),typeof requestAnimationFrame<"u"&&requestAnimationFrame(()=>{const d=bl(r);d.length>0?d[0].focus():(r.hasAttribute("tabindex")||r.setAttribute("tabindex","-1"),r.focus())}))},c=()=>typeof t=="function"?t():t.value,i=()=>{c()&&n.value?u(n.value):s()};return e.watch([n,()=>c()],i,{flush:"sync"}),e.onMounted(i),e.onScopeDispose(()=>{s()}),n}function xa(t,n={}){const{orientation:l="vertical",loop:a=!0}=n,o=e.ref(0),s=[],u=()=>e.isRef(t)?t.value:t,c=v=>g=>{s[v]=g},i=v=>{var g;o.value=v,(g=s[v])==null||g.focus()},r=v=>{const g=u();let m=o.value;const h=l!=="horizontal"&&v.key==="ArrowDown"||l!=="vertical"&&v.key==="ArrowRight",p=l!=="horizontal"&&v.key==="ArrowUp"||l!=="vertical"&&v.key==="ArrowLeft";if(h)v.preventDefault(),m=o.value+1,m>=g&&(m=a?0:g-1);else if(p)v.preventDefault(),m=o.value-1,m<0&&(m=a?g-1:0);else if(v.key==="Home")v.preventDefault(),m=0;else if(v.key==="End")v.preventDefault(),m=g-1;else return;i(m)};return{activeIndex:o,setActiveIndex:i,getItemProps:v=>({ref:c(v),tabindex:v===o.value?0:-1,onFocus:()=>{o.value=v},onKeydown:r}),handleKeyDown:r}}function $a(t){const{itemCount:n,loop:l=!0,onSelect:a,typeaheadTimeout:o=500}=t,s=e.ref(-1),u=[],c=[];let i="",r;const d=()=>e.isRef(n)?n.value:n,v=p=>b=>{u[p]=b},g=p=>{c.length=0,c.push(...p)},m=p=>{var y;const b=d();p<0||p>=b||(s.value=p,(y=u[p])==null||y.focus())};return{activeIndex:s,setActiveIndex:m,setItemRef:v,setLabels:g,handleKeyDown:p=>{var y;const b=d();switch(p.key){case"ArrowDown":{p.preventDefault();let E=s.value+1;E>=b&&(E=l?0:b-1),m(E);break}case"ArrowUp":{p.preventDefault();let E=s.value-1;E<0&&(E=l?b-1:0),m(E);break}case"Home":{p.preventDefault(),m(0);break}case"End":{p.preventDefault(),m(b-1);break}case"Enter":case" ":{p.preventDefault(),s.value>=0&&(a==null||a(s.value));break}case"Escape":{p.preventDefault(),s.value=-1;break}default:if(p.key.length===1&&!p.ctrlKey&&!p.metaKey){r&&clearTimeout(r),i+=p.key.toLowerCase(),r=setTimeout(()=>{i=""},o);const E=i,z=s.value>=0?s.value+1:0;for(let x=0;x<b;x++){const f=(z+x)%b;if((((y=c[f])==null?void 0:y.toLowerCase())??"").startsWith(E)){m(f);break}}}}}}}function ht(t){return e.isRef(t)?t.value:t}function el(t){const n=ht(t.itemCount),l=ht(t.itemHeight),a=t.overscan!==void 0?ht(t.overscan):void 0,o=Oe.createVirtual({itemCount:n,itemHeight:l,overscan:a}),s=e.ref(null),u=e.ref(o.getRange(0,0)),c=()=>{const m=s.value;if(!m){u.value=o.getRange(0,0);return}u.value=o.getRange(m.scrollTop,m.clientHeight)},i=(m,h="start")=>{const p=s.value;p&&(p.scrollTop=o.scrollToIndex(m,p.clientHeight,h))};e.watch(()=>ht(t.itemCount),m=>{o.setItemCount(m),c()}),e.watch(()=>ht(t.itemHeight),m=>{o.setItemHeight(m),c()});let r=null,d=null,v=null;const g=m=>{v!==m&&(v&&(d&&v.removeEventListener("scroll",d),r==null||r.disconnect(),r=null),v=m,m&&(d=()=>c(),m.addEventListener("scroll",d,{passive:!0}),typeof ResizeObserver<"u"&&(r=new ResizeObserver(()=>c()),r.observe(m)),c()))};return e.watch(s,m=>g(m),{flush:"post"}),e.onMounted(()=>{g(s.value)}),e.onScopeDispose(()=>{g(null)}),{range:u,containerRef:s,scrollToIndex:i,engine:o}}function Na(t,n){const l=Oe.createHistory(t,n),a=e.ref(l.cursor),o=e.ref([...l.entries]),s=()=>{a.value=l.cursor,o.value=[...l.entries]};let u=!1;const c=()=>{u||(u=!0,queueMicrotask(()=>{u=!1,s()}))},i=t.use((m,h)=>{h(m),c()}),r=()=>{l.undo(),s()},d=()=>{l.redo(),s()},v=m=>{l.jumpTo(m),s()},g=()=>{l.clear(),s()};return e.onScopeDispose(()=>{i(),l.destroy()}),{history:l,canUndo:e.computed(()=>a.value>=0),canRedo:e.computed(()=>a.value<o.value.length-1),cursor:e.computed(()=>a.value),entries:o,undo:r,redo:d,jumpTo:v,clear:g}}const kt=Symbol("sg-config"),Fl={},Va=e.computed(()=>Fl);function Ee(){return e.inject(kt,void 0)??Va}function Ye(t,n={}){const l=e.inject(kt,void 0),a=e.computed(()=>t.size??(l==null?void 0:l.value.size)??n.size??"middle"),o=e.computed(()=>t.disabled??(l==null?void 0:l.value.disabled)??n.disabled??!1);return{resolvedSize:a,resolvedDisabled:o}}const Da=e.defineComponent({__name:"ConfigProvider",props:{size:{type:String,default:void 0},disabled:{type:Boolean,default:void 0},bordered:{type:Boolean,default:void 0},locale:{type:Object,default:void 0}},setup(t){const n=t,l=e.inject(kt,void 0),a=e.computed(()=>{const o=(l==null?void 0:l.value)??Fl;return{size:n.size??o.size,disabled:n.disabled??o.disabled,bordered:n.bordered??o.bordered,locale:n.locale?o.locale?{...o.locale,...n.locale}:n.locale:o.locale}});return e.provide(kt,a),(o,s)=>e.renderSlot(o.$slots,"default")}}),za={key:0,class:"sg-input-prefix"},Ta=["id","type","value","placeholder","disabled","readonly","aria-readonly","aria-invalid"],Ma=["aria-label"],La={key:2,class:"sg-spin sg-spin-small","aria-hidden":"true"},Fa={key:3,class:"sg-input-suffix"},zt=e.defineComponent({__name:"Input",props:{modelValue:{default:""},value:{},placeholder:{},type:{default:"text"},size:{default:"middle"},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},id:{},allowClear:{type:Boolean,default:!1},status:{},unstyled:{type:Boolean},loading:{type:Boolean}},emits:["update:modelValue","change","focus","blur","clear"],setup(t,{emit:n}){const l=t,a=n,o=e.computed(()=>l.value??l.modelValue??""),s=e.computed(()=>l.unstyled?"":["sg-input-wrapper",`sg-input-wrapper-${l.size}`,l.loading?"sg-input-wrapper-loading":"",l.readOnly?"sg-input-wrapper-readonly":"",l.status?`sg-input-wrapper-status-${l.status}`:""].filter(Boolean).join(" ")),u=e.computed(()=>l.unstyled?"":["sg-input",`sg-input-${l.size}`,l.readOnly?"sg-input-readonly":"",l.status?`sg-input-status-${l.status}`:""].filter(Boolean).join(" "));function c(y){const E=y.target;a("update:modelValue",E.value),a("change",E.value)}function i(y){a("focus",y)}function r(y){a("blur",y)}function d(){a("update:modelValue",""),a("change",""),a("clear")}const v=e.computed(()=>l.allowClear&&!l.disabled&&!l.readOnly&&!!o.value),g=e.useSlots(),m=e.computed(()=>!!g.prefix),h=e.computed(()=>!!g.suffix),p=Ee(),b=e.computed(()=>{var y,E;return((E=(y=p.value.locale)==null?void 0:y.input)==null?void 0:E.clear)??"Clear"});return(y,E)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(s.value)},[m.value?(e.openBlock(),e.createElementBlock("span",za,[e.renderSlot(y.$slots,"prefix")])):e.createCommentVNode("",!0),e.createElementVNode("input",{id:t.id,type:t.type,class:e.normalizeClass(u.value),value:o.value,placeholder:t.placeholder,disabled:t.disabled||t.loading,readonly:t.readOnly,"aria-readonly":t.readOnly||void 0,"aria-invalid":t.status==="error"||void 0,onInput:c,onFocus:i,onBlur:r},null,42,Ta),v.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"sg-input-clear","aria-label":b.value,onClick:d}," × ",8,Ma)):e.createCommentVNode("",!0),t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",La)):e.createCommentVNode("",!0),h.value?(e.openBlock(),e.createElementBlock("span",Fa,[e.renderSlot(y.$slots,"suffix")])):e.createCommentVNode("",!0)],2))}}),Aa=["aria-checked","checked","disabled"],Pa={key:0,class:"sg-checkbox-box","aria-hidden":"true"},Ra={key:2,class:"sg-spin sg-spin-small","aria-hidden":"true"},rt=e.defineComponent({__name:"Checkbox",props:{modelValue:{type:Boolean,default:void 0},checked:{type:Boolean,default:void 0},defaultChecked:{type:Boolean,default:void 0},indeterminate:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},unstyled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){const l=t,a=n,o=e.ref(l.modelValue??l.checked??l.defaultChecked??!1);e.watch(()=>l.modelValue??l.checked,g=>{g!==void 0&&(o.value=g)});const s=e.computed(()=>l.modelValue??l.checked??o.value),u=e.ref(null);function c(){const g=u.value;if(!g)return;const m=!!s.value;g.checked!==m&&(g.checked=m),g.indeterminate=l.indeterminate??!1}e.onMounted(c),e.watch([()=>s.value,()=>l.indeterminate],()=>c(),{flush:"post"});function i(g){const m=g.target.checked;o.value=m,a("update:modelValue",m),a("change",m)}const r=e.computed(()=>l.unstyled?"":["sg-checkbox",l.disabled||l.loading?"sg-checkbox-disabled":"",l.loading?"sg-checkbox-loading":""].filter(Boolean).join(" ")),d=e.useSlots(),v=e.computed(()=>d.default!==void 0);return(g,m)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(r.value)},[e.createElementVNode("input",{ref_key:"inputRef",ref:u,type:"checkbox",class:e.normalizeClass(t.unstyled?"":"sg-checkbox-input"),"aria-checked":s.value,checked:s.value,disabled:t.disabled||t.loading,onChange:i},null,42,Aa),t.unstyled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Pa)),v.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(t.unstyled?"":"sg-checkbox-label")},[e.renderSlot(g.$slots,"default")],2)):e.createCommentVNode("",!0),t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",Ra)):e.createCommentVNode("",!0)],2))}}),Ia=["multiple","value","disabled"],_a={key:0,value:""},Ka=["value","disabled"],Ha=["aria-expanded","aria-controls","aria-multiselectable","aria-disabled","tabindex"],Oa={key:0,class:"sg-select-placeholder"},ja={key:1,class:"sg-select-tags"},Ya={class:"sg-select-tag-label"},Wa=["aria-label","onClick"],Ua={key:2,class:"sg-spin sg-spin-small","aria-hidden":"true"},qa={key:3,class:"sg-select-arrow"},Xa=["id","aria-multiselectable"],Ga=["aria-selected","onClick"],Ja={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},Al=e.defineComponent({__name:"Select",props:{modelValue:{},value:{},defaultValue:{},options:{},placeholder:{default:"Select..."},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"middle"},unstyled:{type:Boolean}},emits:["update:modelValue","change","blur"],setup(t,{emit:n}){let l=0;function a(){return`sg-select-${++l}`}const o=t,s=a(),u=n,c=e.ref(!1),i=e.ref(null);function r(){return o.modelValue!==void 0?o.modelValue:o.value!==void 0?o.value:o.defaultValue!==void 0?o.defaultValue:o.multiple?[]:""}const d=e.ref(r());e.watch(()=>o.modelValue??o.value,w=>{w!==void 0&&(d.value=w)});const v=e.computed(()=>o.modelValue??o.value??d.value),g=e.computed(()=>o.multiple?void 0:v.value),m=e.computed(()=>o.multiple?v.value??[]:[]),h=e.computed(()=>o.multiple?void 0:o.options.find(w=>w.value===g.value)),p=e.computed(()=>o.multiple?o.options.filter(w=>m.value.includes(w.value)):[]);function b(w){d.value=w,u("update:modelValue",w),u("change",w)}function y(w){if(!(w.disabled||w.loading))if(o.multiple){const L=m.value.includes(w.value)?m.value.filter(T=>T!==w.value):[...m.value,w.value];b(L)}else b(w.value),c.value=!1}function E(w,S){S.stopPropagation(),!(o.disabled||o.loading)&&b(m.value.filter(L=>L!==w))}const z=e.computed(()=>o.disabled||o.loading);function x(w){return o.multiple?m.value.includes(w.value):w.value===g.value}function f(w){i.value&&!i.value.contains(w.target)&&(c.value=!1)}e.onMounted(()=>document.addEventListener("mousedown",f)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",f));const N=e.computed(()=>["sg-select",`sg-select-${o.size}`,o.multiple?"sg-select-multiple":"",c.value?"sg-select-open":"",z.value?"sg-select-disabled":"",o.loading?"sg-select-loading":""].filter(Boolean).join(" "));function B(w){const S=w.target;if(o.multiple){const L=Array.from(S.selectedOptions).map(T=>{const P=T.value,q=Number(P);return o.options.some(_=>_.value===q)?q:P});b(L)}else{const L=S.value,T=Number(L),P=o.options.some(q=>q.value===T)?T:L;b(P)}}return(w,S)=>{var L;return t.unstyled?(e.openBlock(),e.createElementBlock("select",{key:0,multiple:t.multiple,value:t.multiple?m.value:g.value,disabled:z.value,onChange:B,onBlur:S[0]||(S[0]=T=>u("blur"))},[!t.multiple&&!h.value?(e.openBlock(),e.createElementBlock("option",_a,e.toDisplayString(t.placeholder),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,T=>(e.openBlock(),e.createElementBlock("option",{key:T.value,value:T.value,disabled:T.disabled},e.toDisplayString(T.label),9,Ka))),128))],40,Ia)):(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"wrapperRef",ref:i,class:e.normalizeClass(N.value),onBlur:S[2]||(S[2]=T=>u("blur"))},[e.createElementVNode("div",{class:"sg-select-selector",role:"combobox","aria-expanded":c.value,"aria-haspopup":"listbox","aria-controls":e.unref(s),"aria-multiselectable":t.multiple||void 0,"aria-disabled":z.value||void 0,tabindex:z.value?-1:0,onClick:S[1]||(S[1]=T=>!z.value&&(c.value=!c.value))},[t.multiple?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[p.value.length===0?(e.openBlock(),e.createElementBlock("span",Oa,e.toDisplayString(t.placeholder),1)):(e.openBlock(),e.createElementBlock("span",ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,T=>(e.openBlock(),e.createElementBlock("span",{key:T.value,class:"sg-select-tag"},[e.createElementVNode("span",Ya,e.toDisplayString(T.label),1),e.createElementVNode("button",{type:"button",class:"sg-select-tag-remove","aria-label":`Remove ${T.label}`,tabindex:"-1",onClick:P=>E(T.value,P)}," × ",8,Wa)]))),128))]))],64)):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(h.value?"sg-select-selection-item":"sg-select-placeholder")},e.toDisplayString(((L=h.value)==null?void 0:L.label)??t.placeholder),3)),t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",Ua)):(e.openBlock(),e.createElementBlock("span",qa,e.toDisplayString(c.value?"▲":"▼"),1))],8,Ha),c.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:e.unref(s),class:"sg-select-dropdown",role:"listbox","aria-multiselectable":t.multiple||void 0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,T=>(e.openBlock(),e.createElementBlock("div",{key:T.value,role:"option","aria-selected":x(T),class:e.normalizeClass(["sg-select-option",x(T)?"sg-select-option-selected":"",T.disabled||T.loading?"sg-select-option-disabled":"",T.loading?"sg-select-option-loading":""]),onClick:P=>y(T)},[e.createElementVNode("span",null,e.toDisplayString(T.label),1),T.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",Ja)):e.createCommentVNode("",!0)],10,Ga))),128))],8,Xa)):e.createCommentVNode("",!0)],34))}}}),Za=["aria-label"],Qa=["disabled"],en={key:0},tn=["aria-current","onClick"],ln=["disabled"],an=["aria-label"],nn=["disabled"],on={class:"sg-pagination-simple-pager"},sn=["disabled"],rn=["aria-label"],cn={key:0,class:"sg-pagination-total"},un=["disabled"],dn={key:0,class:"sg-pagination-ellipsis"},mn=["aria-current","onClick"],pn=["disabled"],vn=["value","disabled"],gn=["value"],fn={key:2,class:"sg-pagination-quick-jumper"},hn=["value","disabled"],Tt=e.defineComponent({__name:"Pagination",props:{current:{type:Number,required:!0},total:{type:Number,required:!0},pageSize:{type:Number,default:10},showTotal:{type:Boolean,default:!1},disabled:{type:Boolean,default:void 0},simple:{type:Boolean,default:!1},showSizeChanger:{type:Boolean,default:!1},pageSizeOptions:{type:Array,default:()=>[10,20,50,100]},showQuickJumper:{type:Boolean,default:!1},unstyled:{type:Boolean,default:!1}},emits:["change","pageSizeChange"],setup(t,{emit:n}){const l=t,a=n,{resolvedDisabled:o}=Ye({disabled:void 0},{}),s=e.computed(()=>l.disabled??o.value),u=Ee(),c=e.computed(()=>{var x,f;return((f=(x=u.value.locale)==null?void 0:x.pagination)==null?void 0:f.totalPrefix)??"Total"}),i=e.computed(()=>{var x,f;return((f=(x=u.value.locale)==null?void 0:x.pagination)==null?void 0:f.itemsPerPage)??"/ page"}),r=e.computed(()=>{var x,f;return((f=(x=u.value.locale)==null?void 0:x.pagination)==null?void 0:f.jump)??"Go to"}),d=e.computed(()=>{var x,f;return((f=(x=u.value.locale)==null?void 0:x.pagination)==null?void 0:f.ariaLabel)??"Pagination"}),v=e.ref(""),g=e.computed(()=>Math.max(1,Math.ceil(l.total/l.pageSize))),m=e.computed(()=>Math.min(Math.max(1,l.current),g.value));function h(x){s.value||x<1||x>g.value||x===m.value||a("change",x)}function p(){const x=parseInt(v.value,10);Number.isNaN(x)||h(x),v.value=""}function b(x,f){return f<=7?Array.from({length:f},(N,B)=>B+1):x<=4?[1,2,3,4,5,"...",f]:x>=f-3?[1,"...",f-4,f-3,f-2,f-1,f]:[1,"...",x-1,x,x+1,"...",f]}const y=e.computed(()=>b(m.value,g.value)),E=e.computed(()=>["sg-pagination",s.value?"sg-pagination-disabled":""].filter(Boolean).join(" ")),z=e.computed(()=>["sg-pagination","sg-pagination-simple",s.value?"sg-pagination-disabled":""].filter(Boolean).join(" "));return(x,f)=>t.unstyled?(e.openBlock(),e.createElementBlock("nav",{key:0,"aria-label":d.value},[e.createElementVNode("button",{type:"button",disabled:m.value<=1,onClick:f[0]||(f[0]=N=>h(m.value-1))},"‹",8,Qa),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(N,B)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`p${B}-${N}`},[N==="..."?(e.openBlock(),e.createElementBlock("span",en,"…")):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button","aria-current":N===m.value?"page":void 0,onClick:w=>h(N)},e.toDisplayString(N),9,tn))],64))),128)),e.createElementVNode("button",{type:"button",disabled:m.value>=g.value,onClick:f[1]||(f[1]=N=>h(m.value+1))}," › ",8,ln)],8,Za)):t.simple?(e.openBlock(),e.createElementBlock("nav",{key:1,class:e.normalizeClass(z.value),"aria-label":d.value},[e.createElementVNode("button",{type:"button",class:"sg-pagination-item sg-pagination-prev",disabled:m.value<=1,onClick:f[2]||(f[2]=N=>h(m.value-1))}," ‹ ",8,nn),e.createElementVNode("span",on,e.toDisplayString(m.value)+" / "+e.toDisplayString(g.value),1),e.createElementVNode("button",{type:"button",class:"sg-pagination-item sg-pagination-next",disabled:m.value>=g.value,onClick:f[3]||(f[3]=N=>h(m.value+1))}," › ",8,sn)],10,an)):(e.openBlock(),e.createElementBlock("nav",{key:2,class:e.normalizeClass(E.value),"aria-label":d.value},[t.showTotal?(e.openBlock(),e.createElementBlock("span",cn,e.toDisplayString(c.value)+" "+e.toDisplayString(t.total),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"sg-pagination-item sg-pagination-prev",disabled:m.value<=1,onClick:f[4]||(f[4]=N=>h(m.value-1))}," ‹ ",8,un),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(N,B)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`p${B}-${N}`},[N==="..."?(e.openBlock(),e.createElementBlock("span",dn,"…")):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(`sg-pagination-item${N===m.value?" sg-pagination-item-active":""}`),"aria-current":N===m.value?"page":void 0,onClick:w=>h(N)},e.toDisplayString(N),11,mn))],64))),128)),e.createElementVNode("button",{type:"button",class:"sg-pagination-item sg-pagination-next",disabled:m.value>=g.value,onClick:f[5]||(f[5]=N=>h(m.value+1))}," › ",8,pn),t.showSizeChanger?(e.openBlock(),e.createElementBlock("select",{key:1,class:"sg-pagination-size-changer",value:t.pageSize,disabled:s.value,onChange:f[6]||(f[6]=N=>a("pageSizeChange",Number(N.target.value)))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.pageSizeOptions,N=>(e.openBlock(),e.createElementBlock("option",{key:N,value:N},e.toDisplayString(N)+" "+e.toDisplayString(i.value),9,gn))),128))],40,vn)):e.createCommentVNode("",!0),t.showQuickJumper?(e.openBlock(),e.createElementBlock("span",fn,[e.createTextVNode(e.toDisplayString(r.value)+" ",1),e.createElementVNode("input",{type:"text",class:"sg-pagination-jumper-input",value:v.value,disabled:s.value,onInput:f[7]||(f[7]=N=>v.value=N.target.value),onKeydown:e.withKeys(p,["enter"]),onBlur:p},null,40,hn)])):e.createCommentVNode("",!0)],10,rn))}}),yn=["aria-label"],kn=["aria-label"],bn=["aria-label"],Bt=e.defineComponent({__name:"Spin",props:{spinning:{type:Boolean,default:!0},size:{},delay:{},tip:{},fullscreen:{type:Boolean,default:!1},unstyled:{type:Boolean}},setup(t){const n=t,{resolvedSize:l}=Ye({size:void 0},{}),a=e.computed(()=>n.size??l.value),o=Ee(),s=e.computed(()=>{var m,h;return((h=(m=o.value.locale)==null?void 0:m.spin)==null?void 0:h.loading)??"Loading"}),u=e.ref(n.delay?!1:n.spinning);let c;e.watch(()=>[n.spinning,n.delay],([m,h])=>{if(c&&clearTimeout(c),!h){u.value=!!m;return}m?c=setTimeout(()=>{u.value=!0},h):u.value=!1},{immediate:!0}),e.onBeforeUnmount(()=>{c&&clearTimeout(c)});const i=e.computed(()=>a.value==="middle"?"default":a.value),r=e.computed(()=>n.unstyled?"":`sg-spin sg-spin-${i.value}`),d=e.useSlots(),v=e.computed(()=>!!d.default),g=e.computed(()=>!!d.indicator);return(m,h)=>!u.value&&!v.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[],64)):!u.value&&v.value?e.renderSlot(m.$slots,"default",{key:1}):t.fullscreen?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.unstyled?"":"sg-spin-fullscreen")},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-spin-fullscreen-inner")},[g.value?e.renderSlot(m.$slots,"indicator",{key:0}):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(r.value),role:"status","aria-live":"polite","aria-label":s.value},null,10,yn)),t.tip?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.unstyled?"":"sg-spin-tip")},e.toDisplayString(t.tip),3)):e.createCommentVNode("",!0)],2)],2)):v.value?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(t.unstyled?"":"sg-spin-container")},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-spin-overlay")},[g.value?e.renderSlot(m.$slots,"indicator",{key:0}):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(r.value),role:"status","aria-live":"polite","aria-label":s.value},null,10,bn)),t.tip?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.unstyled?"":"sg-spin-tip")},e.toDisplayString(t.tip),3)):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(u.value&&!t.unstyled?"sg-spin-blur":"")},[e.renderSlot(m.$slots,"default")],2)],2)):(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(t.unstyled?"":"sg-spin-standalone")},[g.value?e.renderSlot(m.$slots,"indicator",{key:0}):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(r.value),role:"status","aria-live":"polite","aria-label":s.value},null,10,kn)),t.tip?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.unstyled?"":"sg-spin-tip")},e.toDisplayString(t.tip),3)):e.createCommentVNode("",!0)],2))}}),Pl={emptyText:"No data",filterReset:"Reset",filterConfirm:"OK",filterAll:"All",searchPlaceholder:"Search...",sortAsc:"▲",sortDesc:"▼",filterIcon:"▾",loadingText:"Loading…",totalRows:t=>`${t} rows`,selectedRows:t=>`${t} selected`,expandIcon:"›"},Bn={class:"sg-table-toolbar-right"},Cn=["aria-busy"],wn=["draggable","onDragstart","onDragover","onDragleave","onDrop","onDragend","aria-sort","onClick"],Sn={class:"sg-table-th-content"},En={class:"sg-table-th-title"},xn={key:0,class:"sg-table-sort-arrows"},$n=["aria-label","onClick"],Nn=["onClick"],Vn=["onMousedown"],Dn={key:0,class:"sg-table-row sg-table-row-empty",role:"row",style:{display:"contents"}},zn=["data-sg-virtual-row-index","onClick"],Tn=["aria-expanded","aria-label","onClick"],Mn=["checked","aria-label","onChange"],Ln=["onDblclick"],Fn=["aria-label","onClick"],An={key:2,class:"sg-table-cell-content"},Pn={key:0,class:"sg-table-row sg-table-row-expanded-wrapper",role:"row",style:{display:"contents"}},Rn={key:0,class:"sg-table-td sg-table-footer-cell",role:"cell"},In={key:1,class:"sg-table-td sg-table-footer-cell",role:"cell"},_n={key:0,class:"sg-table-aggregate-value"},Kn={key:0,class:"sg-table-td sg-table-summary-cell",role:"cell"},Hn={key:1,class:"sg-table-td sg-table-summary-cell",role:"cell"},On={key:1,class:"sg-table-loading-mask",role:"status","aria-live":"polite"},jn={class:"sg-table-pagination-total"},Bl=150,Ht=50,Cl=40,wl=48,Yn=e.defineComponent({__name:"Table",props:{columns:{},data:{},pageSize:{},rowSelection:{},expandable:{},tree:{},bordered:{type:Boolean,default:!1},size:{default:"middle"},sticky:{type:Boolean,default:!1},draggable:{type:Boolean},onColumnOrderChange:{},locale:{},rowClassName:{},searchable:{type:Boolean,default:!1},searchValue:{},showPagination:{type:Boolean,default:!0},unstyled:{type:Boolean,default:!1},classNames:{},styles:{},loading:{type:Boolean,default:!1},scroll:{},summary:{},onCellEdit:{},virtual:{type:[Boolean,Object]},footer:{type:Boolean},striped:{type:Boolean},highlightOnHover:{type:Boolean,default:!0}},emits:["rowClick","pageChange","sortChange","cellEdit","expand","columnOrderChange"],setup(t,{expose:n,emit:l}){const a=t,o=l,s=e.useSlots(),u=Ee(),c=e.computed(()=>{var D,j;return((j=(D=u.value.locale)==null?void 0:D.table)==null?void 0:j.selectAll)??"Select all"}),i=e.computed(()=>({...Pl,...a.locale})),r=e.computed(()=>a.classNames??{}),d=e.computed(()=>a.styles??{});function v(D){return!D.children||D.children.length===0?1:1+Math.max(...D.children.map(v))}function g(D){return!D.children||D.children.length===0?D.hidden?0:1:D.children.reduce((j,Z)=>j+g(Z),0)}const m=e.computed(()=>a.columns.some(D=>D.children&&D.children.length>0)),h=e.computed(()=>a.columns.length===0?1:Math.max(...a.columns.map(v))),p=e.ref([]),b=e.ref(null),y=e.ref(null),E=e.computed(()=>{const D=[],j=Z=>{Z.hidden||(!Z.children||Z.children.length===0?D.push(Z):Z.children.forEach(j))};return a.columns.forEach(j),D});e.watch(E,D=>{const j=D.map(ve=>ve.key),Z=new Set(p.value),ue=j.filter(ve=>!Z.has(ve)),W=p.value.filter(ve=>j.includes(ve));p.value=[...W,...ue]},{immediate:!0});const z=e.computed(()=>{const D=E.value;if(m.value||!a.draggable)return D;const j=new Map(D.map(Z=>[Z.key,Z]));return p.value.filter(Z=>j.has(Z)).map(Z=>j.get(Z))}),x=e.computed(()=>{const D=h.value,j=Array.from({length:D},()=>[]);if(!m.value&&a.draggable&&D===1){for(const ue of z.value)j[0].push({col:ue,colSpan:1,rowSpan:1});return j}const Z=(ue,W)=>{if(ue.hidden)return;if(!!(ue.children&&ue.children.length>0)){const _e=g(ue);_e>0&&(j[W].push({col:ue,colSpan:_e,rowSpan:1}),ue.children.forEach(qe=>Z(qe,W+1)))}else j[W].push({col:ue,colSpan:1,rowSpan:D-W})};return a.columns.forEach(ue=>Z(ue,0)),j}),f=e.computed(()=>z.value);function N(D,j){b.value=j,D.dataTransfer&&(D.dataTransfer.effectAllowed="move",D.dataTransfer.setData("text/plain",j))}function B(D,j){D.preventDefault(),D.dataTransfer&&(D.dataTransfer.dropEffect="move"),y.value=j}function w(){y.value=null}function S(D,j){var ve;D.preventDefault();const Z=b.value;if(!Z||Z===j){b.value=null,y.value=null;return}const ue=p.value.filter(_e=>_e!==Z),W=ue.indexOf(j);ue.splice(W<0?ue.length:W,0,Z),p.value=ue,(ve=a.onColumnOrderChange)==null||ve.call(a,ue),o("columnOrderChange",ue),b.value=null,y.value=null}function L(){b.value=null,y.value=null}function T(D){return!!a.draggable&&!m.value&&!D.fixed&&!(D.children&&D.children.length>0)}const{table:P,visibleRows:q,tableState:_,setSort:R,clearSort:U,addFilter:I,clearFilters:X,setPage:ae,setFilterFn:A,refresh:V,columnWidths:C,setColumnWidth:k}=Ml({pageSize:a.pageSize,data:a.data});e.watch(()=>a.pageSize,D=>{D!==void 0&&(P.setPageSize(D),V())}),e.watch(()=>a.data,D=>{P.reset(),D&&P.addRows(D),a.virtual&&a.pageSize===void 0&&D&&P.setPageSize(D.length||1),V()}),e.watch(()=>{var D;return[a.virtual,(D=a.data)==null?void 0:D.length]},()=>{a.virtual&&a.pageSize===void 0&&a.data&&(P.setPageSize(a.data.length||1),V())},{immediate:!0});const $=e.ref(""),M=e.computed({get:()=>a.searchValue!==void 0?a.searchValue:$.value,set:D=>{a.searchValue===void 0&&($.value=D)}}),H=e.computed(()=>_.value.sorts[0]??null);function O(D){if(!D.sortable)return;const j=H.value;let Z="asc";j&&j.column===D.key&&(j.direction==="asc"?Z="desc":j.direction==="desc"&&(Z=null)),Z===null?U():R(D.key,Z),o("sortChange",D.key,Z)}const Q=e.ref([]),re=e.computed(()=>{var D;return((D=a.rowSelection)==null?void 0:D.selectedKeys)??Q.value}),ce=e.computed(()=>new Set(re.value));function ne(D){var ue,W;if(!a.rowSelection)return;let j;a.rowSelection.type==="radio"?j=ce.value.has(D)?[]:[D]:j=ce.value.has(D)?re.value.filter(ve=>ve!==D):[...re.value,D],Q.value=j;const Z=a.data.filter(ve=>j.includes(ve.id)).map(ve=>ve.data);(W=(ue=a.rowSelection).onChange)==null||W.call(ue,j,Z)}const de=e.computed(()=>q.value.length===0?!1:q.value.every(D=>ce.value.has(D.id))),ye=e.computed(()=>!de.value&&q.value.some(D=>ce.value.has(D.id)));function Me(){var ue,W;if(!a.rowSelection)return;const D=q.value.map(ve=>ve.id);let j;if(de.value)j=re.value.filter(ve=>!D.includes(ve));else{const ve=new Set(re.value);for(const _e of D)ve.add(_e);j=Array.from(ve)}Q.value=j;const Z=a.data.filter(ve=>j.includes(ve.id)).map(ve=>ve.data);(W=(ue=a.rowSelection).onChange)==null||W.call(ue,j,Z)}const Ne=e.computed(()=>{var D;return((D=a.tree)==null?void 0:D.childrenColumnName)??"children"}),Ie=e.computed(()=>{var D;return((D=a.tree)==null?void 0:D.indentSize)??16}),ze=e.ref(new Set);function We(D){const j=new Set,Z=ue=>{for(const W of ue){const ve=W.data[Ne.value];ve&&ve.length>0&&(j.add(W.id),Z(ve))}};return Z(D),j}function Ge(){var D;(D=a.tree)!=null&&D.defaultExpandAllRows?ze.value=We(a.data??[]):ze.value=new Set}e.onMounted(Ge),e.watch(()=>{var D;return(D=a.tree)==null?void 0:D.defaultExpandAllRows},Ge),e.watch(()=>a.data,()=>Ge());function G(D){const j=new Set(ze.value);j.has(D)?j.delete(D):j.add(D),ze.value=j}const le=e.computed(()=>{if(!a.tree)return q.value.map(ue=>({id:ue.id,data:ue.data,depth:0,hasChildren:!1}));const D=[],j=Ne.value,Z=(ue,W)=>{for(const ve of ue){const _e=ve.data[j],qe=!!(_e&&_e.length>0);D.push({id:ve.id,data:ve.data,depth:W,hasChildren:qe}),qe&&ze.value.has(ve.id)&&Z(_e,W+1)}};return Z(q.value,0),D}),fe=e.ref(new Set);e.onMounted(()=>{const D=a.expandable;D!=null&&D.defaultExpandedRowKeys&&(fe.value=new Set(D.defaultExpandedRowKeys))});const be=e.computed(()=>{const D=a.expandable;return D!=null&&D.expandedKeys?new Set(D.expandedKeys):fe.value});function Ve(D){var ue;const j=a.expandable;if(!j)return;const Z=be.value.has(D);if(j.expandedKeys===void 0){const W=new Set(fe.value);Z?W.delete(D):W.add(D),fe.value=W}(ue=j.onExpand)==null||ue.call(j,!Z,D),o("expand",!Z,D)}function De(D){const j=a.expandable;return j?j.rowExpandable?j.rowExpandable(D):!0:!1}const xe=e.ref(new Map),Le=e.ref(null);function Te(){const D=f.value.filter(ue=>{var W;return ue.onFilter&&((W=xe.value.get(ue.key))==null?void 0:W.length)}),j=a.searchable&&M.value.length>0;if(D.length===0&&!j){A(null);return}const Z=j?M.value.toLowerCase():"";A(ue=>{for(const W of D){const ve=xe.value.get(W.key),_e=W.onFilter;if(!ve.some(qe=>_e(qe,ue)))return!1}return!(j&&!f.value.some(ve=>{const _e=ue[ve.key];return _e!=null&&String(_e).toLowerCase().includes(Z)}))})}e.watch(M,()=>{Te(),V()},{immediate:!0});function we(D,j){!j||j.length===0?(xe.value.delete(D.key),D.onFilter||P.removeFilter(D.key)):(xe.value.set(D.key,j),D.onFilter||I({column:D.key,value:j[0],operator:"eq"})),xe.value=new Map(xe.value),Te(),V()}function oe(D){Le.value=Le.value===D?null:D}function ge(){Le.value=null}const se=e.ref(new Map);function ke(D,j){j?se.value.set(D,j):se.value.delete(D)}function Ke(D){if(!Le.value)return;const j=se.value.get(Le.value);j&&j.contains(D.target)||ge()}e.onMounted(()=>document.addEventListener("mousedown",Ke)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",Ke));const je=e.ref(null);function te(D,j){j.preventDefault(),j.stopPropagation();const Z=C.value[D.key]??D.width??150;je.value={key:D.key,startX:j.clientX,startW:Z},document.addEventListener("mousemove",ie),document.addEventListener("mouseup",me)}function ie(D){var W;const j=je.value;if(!j)return;const Z=((W=a.columns.find(ve=>ve.key===j.key))==null?void 0:W.minWidth)??50,ue=Math.max(Z,j.startW+(D.clientX-j.startX));k(j.key,ue)}function me(){je.value=null,document.removeEventListener("mousemove",ie),document.removeEventListener("mouseup",me)}const Se=e.ref(null),Be=e.ref("");function Ae(D,j,Z){Se.value={id:D,key:j},Be.value=Z==null?"":String(Z),e.nextTick(()=>{const ue=document.querySelector(".sg-table-edit-input");ue==null||ue.focus(),ue==null||ue.select()})}function Ue(){var Z;if(!Se.value)return;const{id:D,key:j}=Se.value;o("cellEdit",D,j,Be.value),(Z=a.onCellEdit)==null||Z.call(a,D,j,Be.value),Se.value=null}function et(){Se.value=null}function Pe(D){return C.value[D.key]??D.width??Bl}const nt=e.computed(()=>{var D;return((D=a.scroll)==null?void 0:D.x)!=null}),Y=e.computed(()=>f.value.some(D=>!D.fixed&&C.value[D.key]==null&&D.width==null)),ee=e.computed(()=>!nt.value&&!Y.value);function he(D){const j=C.value[D.key]!=null,Z=C.value[D.key]??D.width??Bl;return nt.value?D.fixed||j?`${Z}px`:`${Z}px`:D.fixed||j?`${Z}px`:D.width==null?`minmax(${Ht}px, 1fr)`:ee.value?`minmax(${Ht}px, ${Z}fr)`:`minmax(${Ht}px, ${Z}px)`}const F=e.computed(()=>(a.expandable?1:0)+(a.rowSelection?1:0)),K=e.computed(()=>F.value+f.value.length),J=e.computed(()=>{const D=[];a.expandable&&D.push(`${Cl}px`),a.rowSelection&&D.push(`${wl}px`);for(const j of f.value)D.push(he(j));return D.join(" ")}),pe=e.computed(()=>{const D={},j={};let Z=0;a.expandable&&(Z+=Cl),a.rowSelection&&(Z+=wl);for(const W of f.value)W.fixed==="left"&&(D[W.key]=Z,Z+=Pe(W));let ue=0;for(const W of[...f.value].reverse())W.fixed==="right"&&(j[W.key]=ue,ue+=Pe(W));return{left:D,right:j}});function Ce(D,j=!1){const Z={};return D.align&&(Z.textAlign=D.align),D.fixed==="left"&&(Z.position="sticky",Z.left=`${pe.value.left[D.key]??0}px`,Z.zIndex=j?4:2),D.fixed==="right"&&(Z.position="sticky",Z.right=`${pe.value.right[D.key]??0}px`,Z.zIndex=j?4:2),Z}const $e=e.computed(()=>_.value.totalPages);function Fe(D){D<1||D>$e.value||(ae(D),o("pageChange",D))}const He=e.computed(()=>a.summary?a.summary(q.value):[]);function Qe(D){if(!D.aggregate)return null;const j=q.value.map(ue=>ue.data[D.key]);if(typeof D.aggregate=="function")return D.aggregate(j);const Z=j.map(Number).filter(ue=>!Number.isNaN(ue));if(Z.length===0)return D.aggregate==="count"?j.length:"-";switch(D.aggregate){case"sum":return Math.round(Z.reduce((ue,W)=>ue+W,0)*100)/100;case"avg":return Math.round(Z.reduce((ue,W)=>ue+W,0)/Z.length*100)/100;case"count":return j.length;case"min":return Math.min(...Z);case"max":return Math.max(...Z)}return null}const Re=e.computed(()=>{if(!a.virtual)return null;const D=a.virtual,j=typeof D=="object";return{rowHeight:j?D.rowHeight??40:40,estimateRowHeight:j?D.estimateRowHeight:void 0,overscan:j?D.overscan??5:5,height:j?D.height:void 0}}),Je=e.ref(null),ot=e.ref(null),ct=e.ref(0),ft=e.ref(0),ut=e.ref(0);function dt(D,j,Z){if(typeof D=="number"&&j==null)return D;const ue=typeof D=="number"?D:40,W=j??(typeof D=="function"?D:void 0);return W?ve=>{const _e=Z[ve];if(!_e)return ue;const qe=W(_e.data,_e.id);return Number.isFinite(qe)&&qe>=0?qe:ue}:ue}function da(){if(!Re.value){Je.value=null;return}if(!Je.value){const D=Oe.createVirtual({itemCount:le.value.length,itemHeight:dt(Re.value.rowHeight,Re.value.estimateRowHeight,le.value),overscan:Re.value.overscan});D.subscribe(()=>{ut.value++}),Je.value=D}}e.watch(Re,da,{immediate:!0}),e.watch([le,Re],()=>{const D=Je.value,j=Re.value;if(!(!D||!j)&&(D.setItemCount(le.value.length),D.setItemHeight(dt(j.rowHeight,j.estimateRowHeight,le.value)),typeof j.rowHeight=="function")){const Z=j.rowHeight;for(let ue=0;ue<le.value.length;ue++){const W=le.value[ue];if(!W)continue;const ve=Z(W.data,W.id);Number.isFinite(ve)&&ve>=0&&D.setMeasuredHeight(ue,Math.round(ve))}}},{deep:!1});function ma(){const D=ot.value;D&&(ct.value=D.scrollTop)}function gl(){const D=ot.value;D&&(ft.value=D.clientHeight,ct.value=D.scrollTop)}e.onMounted(()=>{if(!Re.value)return;gl();const D=ot.value;if(!D)return;const j=typeof ResizeObserver<"u"?new ResizeObserver(gl):null;j==null||j.observe(D),e.onBeforeUnmount(()=>j==null?void 0:j.disconnect())});const Ze=e.computed(()=>{ut.value;const D=Je.value;if(!D||!Re.value)return null;const j=D.getRange(ct.value,ft.value||400),Z=le.value.slice(j.startIndex,j.endIndex+1);let ue=0;for(let ve=0;ve<Z.length;ve++)ue+=D.getItemSize(j.startIndex+ve);const W=Math.max(0,j.totalHeight-j.offsetTop-ue);return{startIndex:j.startIndex,endIndex:j.endIndex,visibleRows:Z,topPad:j.offsetTop,bottomPad:W}}),fl=e.computed(()=>Ze.value?Ze.value.visibleRows:le.value),hl=e.computed(()=>Ze.value?Ze.value.startIndex:0);e.watch([()=>Ze.value,()=>ut.value,()=>fl.value],()=>{var W;const D=Je.value,j=Re.value;if(!D||!j)return;const Z=(W=ot.value)==null?void 0:W.querySelector(".sg-table-grid");if(!Z)return;Z.querySelectorAll("[data-sg-virtual-row-index]").forEach(ve=>{const _e=Number(ve.getAttribute("data-sg-virtual-row-index"));if(!Number.isFinite(_e))return;const qe=D.getItemSize(_e);if(!Number.isFinite(qe)||qe<=0)return;const yl=`${qe}px`,kl=ve.children;for(let Kt=0;Kt<kl.length;Kt++){const mt=kl[Kt];mt.style.height!==yl&&(mt.style.height=yl),mt.style.minHeight!=="0px"&&(mt.style.minHeight="0px"),mt.style.overflow!=="hidden"&&(mt.style.overflow="hidden")}})},{flush:"post"});function pa(D,j){const Z=typeof a.rowClassName=="function"?a.rowClassName(D.data,D.id):a.rowClassName??"",ue=ce.value.has(D.id)?"sg-table-row-selected":"",W=a.striped&&j%2===1?"sg-table-row-striped":"";return["sg-table-row","sg-table-row-clickable",ue,W,Z,r.value.row??""].filter(Boolean).join(" ")}function va(D){o("rowClick",D.id,D.data)}const ga=e.computed(()=>a.unstyled?"":["sg-table-wrapper",`sg-table-${a.size}`,a.bordered?"sg-table-bordered":"",a.sticky||Re.value?"sg-table-sticky":"",a.loading?"sg-table-loading":"",a.striped?"sg-table-striped":"",a.highlightOnHover===!1?"":"sg-table-hoverable",r.value.root??""].filter(Boolean).join(" ")),fa=e.computed(()=>{var D;return["sg-table-scroll",(D=a.scroll)!=null&&D.x?"sg-table-scroll-x":"",r.value.scroll].filter(Boolean).join(" ")}),ha=e.computed(()=>{var j,Z,ue;const D={...d.value.scroll??{}};if((j=a.scroll)!=null&&j.x&&(D.overflowX="auto"),Re.value){D.overflowY="auto";const W=Re.value.height??((Z=a.scroll)==null?void 0:Z.y)??400;D.height=typeof W=="number"?`${W}px`:W}else(ue=a.scroll)!=null&&ue.y&&(D.overflowY="auto",D.maxHeight=typeof a.scroll.y=="number"?`${a.scroll.y}px`:a.scroll.y);return D}),_t=e.computed(()=>{const D=Re.value;return D&&typeof D.rowHeight=="number"&&D.estimateRowHeight==null?D.rowHeight:null}),ya=e.computed(()=>["sg-table-grid",_t.value!=null?"sg-table-grid-virtual-fixed":"",r.value.grid].filter(Boolean).join(" ")||void 0),ka=e.computed(()=>{var j;const D={gridTemplateColumns:J.value,...d.value.grid??{}};return(j=a.scroll)!=null&&j.x&&(D.minWidth=typeof a.scroll.x=="number"?`${a.scroll.x}px`:a.scroll.x),_t.value!=null&&(D["--sg-virtual-row-height"]=`${_t.value}px`),D}),ba=e.computed(()=>a.searchable||!!s.toolbar),xt=e.computed(()=>`1 / ${K.value+1}`);return n({table:P,refresh:V,clearAll:()=>{U(),X(),xe.value.clear(),$.value=""}}),(D,j)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(ga.value||void 0),style:e.normalizeStyle(d.value.root)},[ba.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["sg-table-toolbar",r.value.toolbar].filter(Boolean).join(" ")||void 0),style:e.normalizeStyle(d.value.toolbar)},[t.searchable?(e.openBlock(),e.createBlock(zt,{key:0,modelValue:M.value,"onUpdate:modelValue":j[0]||(j[0]=Z=>M.value=Z),size:"small",class:"sg-table-search-input",placeholder:i.value.searchPlaceholder,"aria-label":i.value.searchPlaceholder,"allow-clear":"",style:{maxWidth:"240px"}},null,8,["modelValue","placeholder","aria-label"])):e.createCommentVNode("",!0),e.createElementVNode("div",Bn,[e.renderSlot(D.$slots,"toolbar")])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"scrollEl",ref:ot,class:e.normalizeClass(fa.value||void 0),style:e.normalizeStyle(ha.value),"aria-busy":t.loading||void 0,onScroll:ma},[e.createElementVNode("div",{class:e.normalizeClass(ya.value),style:e.normalizeStyle(ka.value),role:"table"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(Z,ue)=>(e.openBlock(),e.createElementBlock("div",{key:`hdr-${ue}`,class:e.normalizeClass(["sg-table-header-row",r.value.headerRow].filter(Boolean).join(" ")||void 0),role:"row",style:e.normalizeStyle({display:"contents",...d.value.headerRow??{}})},[ue===0&&t.expandable?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-table-th sg-table-cell-expand",role:"columnheader",style:e.normalizeStyle(m.value?{gridRow:`span ${h.value}`}:{})},null,4)):e.createCommentVNode("",!0),ue===0&&t.rowSelection?(e.openBlock(),e.createElementBlock("div",{key:1,class:"sg-table-th sg-table-cell-selection",role:"columnheader",style:e.normalizeStyle(m.value?{gridRow:`span ${h.value}`}:{})},[t.rowSelection.type!=="radio"?(e.openBlock(),e.createBlock(rt,{key:0,checked:de.value,indeterminate:ye.value,"aria-label":c.value,onChange:Me},null,8,["checked","indeterminate","aria-label"])):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z,W=>(e.openBlock(),e.createElementBlock("div",{key:`${ue}-${W.col.key}`,class:e.normalizeClass(["sg-table-th",W.col.children&&W.col.children.length>0?"sg-table-th-group":W.col.sortable?"sg-table-th-sortable":"",W.col.fixed?"sg-table-cell-fixed":"",W.col.fixed?`sg-table-cell-fixed-${W.col.fixed}`:"",T(W.col)&&y.value===W.col.key?"sg-table-th-drag-over":"",r.value.headerCell,W.col.headerClassName].filter(Boolean).join(" ")||void 0),draggable:T(W.col)||void 0,onDragstart:ve=>T(W.col)&&N(ve,W.col.key),onDragover:ve=>T(W.col)&&B(ve,W.col.key),onDragleave:ve=>T(W.col)&&w(),onDrop:ve=>T(W.col)&&S(ve,W.col.key),onDragend:ve=>T(W.col)&&L(),style:e.normalizeStyle({...W.col.children&&W.col.children.length>0?{}:Ce(W.col,!0),...W.colSpan>1?{gridColumn:`span ${W.colSpan}`}:{},...W.rowSpan>1?{gridRow:`span ${W.rowSpan}`}:{},...d.value.headerCell??{}}),role:"columnheader","aria-sort":H.value&&H.value.column===W.col.key?H.value.direction==="asc"?"ascending":"descending":W.col.sortable?"none":void 0,onClick:ve=>!(W.col.children&&W.col.children.length>0)&&O(W.col)},[e.createElementVNode("span",Sn,[e.createElementVNode("span",En,e.toDisplayString(W.col.title),1),W.col.sortable&&!(W.col.children&&W.col.children.length>0)?(e.openBlock(),e.createElementBlock("span",xn,[e.createElementVNode("span",{class:e.normalizeClass(["sg-table-sort-asc",{"sg-table-sort-current":H.value&&H.value.column===W.col.key&&H.value.direction==="asc"}])},e.toDisplayString(i.value.sortAsc),3),e.createElementVNode("span",{class:e.normalizeClass(["sg-table-sort-desc",{"sg-table-sort-current":H.value&&H.value.column===W.col.key&&H.value.direction==="desc"}])},e.toDisplayString(i.value.sortDesc),3)])):e.createCommentVNode("",!0)]),W.col.filters&&W.col.filters.length>0&&!e.unref(s).filterDropdown&&!(W.col.children&&W.col.children.length>0)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["sg-table-filter-trigger",{"sg-table-filter-active":xe.value.get(W.col.key)&&xe.value.get(W.col.key).length>0}]),role:"button","aria-label":`Filter ${W.col.title}`,onClick:e.withModifiers(ve=>oe(W.col.key),["stop"])},"▾",10,$n)):e.createCommentVNode("",!0),W.col.filters&&W.col.filters.length>0&&!e.unref(s).filterDropdown&&!(W.col.children&&W.col.children.length>0)?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:1,ref_for:!0,ref:ve=>ke(W.col.key,ve),class:"sg-table-filter-dropdown",onClick:j[1]||(j[1]=e.withModifiers(()=>{},["stop"]))},[e.createVNode(Al,{size:"small",class:"sg-table-filter-select",placeholder:i.value.filterAll,options:[{label:i.value.filterAll,value:""},...W.col.filters.map(ve=>({label:String(ve.text),value:String(ve.value)}))],"aria-label":`Filter ${W.col.title}`,onChange:ve=>{we(W.col,ve?[ve]:[]),ge()}},null,8,["placeholder","options","aria-label","onChange"])],512)),[[e.vShow,Le.value===W.col.key]]):e.createCommentVNode("",!0),e.unref(s).filterDropdown&&!(W.col.children&&W.col.children.length>0)?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["sg-table-filter-trigger",{"sg-table-filter-active":xe.value.get(W.col.key)&&xe.value.get(W.col.key).length>0}]),onClick:e.withModifiers(ve=>oe(W.col.key),["stop"])},"▾",10,Nn)):e.createCommentVNode("",!0),e.unref(s).filterDropdown&&Le.value===W.col.key?(e.openBlock(),e.createElementBlock("div",{key:3,ref_for:!0,ref:ve=>ke(W.col.key,ve),class:"sg-table-filter-dropdown",onClick:j[2]||(j[2]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(D.$slots,"filterDropdown",{column:W.col,selectedKeys:xe.value.get(W.col.key)??[],setSelectedKeys:ve=>xe.value.set(W.col.key,ve),confirm:()=>{we(W.col,xe.value.get(W.col.key)??[]),ge()},clearFilters:()=>{we(W.col,[]),ge()},close:ge})],512)):e.createCommentVNode("",!0),W.col.resizable&&!(W.col.children&&W.col.children.length>0)?(e.openBlock(),e.createElementBlock("div",{key:4,class:"sg-table-resize-handle",onClick:j[3]||(j[3]=e.withModifiers(()=>{},["stop"])),onMousedown:ve=>te(W.col,ve)},null,40,Vn)):e.createCommentVNode("",!0)],46,wn))),128))],6))),128)),le.value.length===0?(e.openBlock(),e.createElementBlock("div",Dn,[e.createElementVNode("div",{class:e.normalizeClass(["sg-table-td","sg-table-empty",r.value.empty].filter(Boolean).join(" ")||void 0),style:e.normalizeStyle({gridColumn:xt.value,...d.value.empty??{}}),role:"cell"},[e.renderSlot(D.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(i.value.emptyText),1)])],6)])):e.createCommentVNode("",!0),Ze.value&&Ze.value.topPad>0?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle({gridColumn:xt.value,height:`${Ze.value.topPad}px`}),role:"presentation","aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fl.value,(Z,ue)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:String(Z.id)},[e.createElementVNode("div",{class:e.normalizeClass(pa(Z,hl.value+ue)||void 0),role:"row","data-sg-virtual-row-index":Ze.value?hl.value+ue:void 0,style:{display:"contents"},onClick:W=>va(Z)},[t.expandable?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-table-td sg-table-cell-expand",role:"cell",onClick:j[4]||(j[4]=e.withModifiers(()=>{},["stop"]))},[De(Z.data)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["sg-table-expand-btn",{"sg-table-expand-open":be.value.has(Z.id)}]),"aria-expanded":be.value.has(Z.id),"aria-label":be.value.has(Z.id)?"Collapse row":"Expand row",onClick:W=>Ve(Z.id)},e.toDisplayString(i.value.expandIcon),11,Tn)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.rowSelection?(e.openBlock(),e.createElementBlock("div",{key:1,class:"sg-table-td sg-table-cell-selection",role:"cell",onClick:j[5]||(j[5]=e.withModifiers(()=>{},["stop"]))},[t.rowSelection.type!=="radio"?(e.openBlock(),e.createBlock(rt,{key:0,checked:ce.value.has(Z.id),"aria-label":`Select row ${String(Z.id)}`,onChange:()=>ne(Z.id)},null,8,["checked","aria-label","onChange"])):(e.openBlock(),e.createElementBlock("input",{key:1,type:"radio",class:"sg-table-row-radio",checked:ce.value.has(Z.id),name:"sg-table-row-radio","aria-label":`Select row ${String(Z.id)}`,onChange:()=>ne(Z.id)},null,40,Mn))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(W,ve)=>(e.openBlock(),e.createElementBlock("div",{key:W.key,class:e.normalizeClass(["sg-table-td",W.fixed?"sg-table-cell-fixed":"",W.fixed?`sg-table-cell-fixed-${W.fixed}`:"",W.editable?"sg-table-td-editable":"",r.value.bodyCell].filter(Boolean).join(" ")||void 0),style:e.normalizeStyle({...Ce(W),...ve===0&&t.tree&&Z.depth>0?{paddingLeft:`${Z.depth*Ie.value+8}px`}:{},...d.value.bodyCell??{}}),role:"cell",onDblclick:_e=>W.editable&&t.onCellEdit?Ae(Z.id,W.key,Z.data[W.key]):null},[ve===0&&t.tree&&Z.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["sg-table-expand-btn",{"sg-table-expand-open":ze.value.has(Z.id)}]),"aria-label":ze.value.has(Z.id)?"Collapse":"Expand",onClick:e.withModifiers(_e=>G(Z.id),["stop"])},e.toDisplayString(i.value.expandIcon),11,Fn)):e.createCommentVNode("",!0),Se.value&&Se.value.id===Z.id&&Se.value.key===W.key?(e.openBlock(),e.createElementBlock("span",{key:1,class:"sg-table-cell-content",onClick:j[7]||(j[7]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":j[6]||(j[6]=_e=>Be.value=_e),class:"sg-table-edit-input",onKeydown:[e.withKeys(Ue,["enter"]),e.withKeys(et,["esc"])],onBlur:Ue},null,544),[[e.vModelText,Be.value]])])):(e.openBlock(),e.createElementBlock("span",An,[e.renderSlot(D.$slots,"cell",{column:W,row:Z.data,id:Z.id,value:Z.data[W.key]},()=>[e.createTextVNode(e.toDisplayString(Z.data[W.key]),1)])]))],46,Ln))),128))],10,zn),t.expandable&&be.value.has(Z.id)?(e.openBlock(),e.createElementBlock("div",Pn,[e.createElementVNode("div",{class:"sg-table-td sg-table-expanded-row",style:e.normalizeStyle({gridColumn:xt.value}),role:"cell"},[e.renderSlot(D.$slots,"expandedRow",{row:Z.data,id:Z.id},()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.expandable.expandedRowRender(Z.data,Z.id))))])],4)])):e.createCommentVNode("",!0)],64))),128)),Ze.value&&Ze.value.bottomPad>0?(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle({gridColumn:xt.value,height:`${Ze.value.bottomPad}px`}),role:"presentation","aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),t.footer&&e.unref(q).length>0?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["sg-table-footer-row",r.value.footer].filter(Boolean).join(" ")||void 0),role:"row",style:e.normalizeStyle({display:"contents",...d.value.footer??{}})},[t.expandable?(e.openBlock(),e.createElementBlock("div",Rn)):e.createCommentVNode("",!0),t.rowSelection?(e.openBlock(),e.createElementBlock("div",In)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,Z=>(e.openBlock(),e.createElementBlock("div",{key:`f-${Z.key}`,class:"sg-table-td sg-table-footer-cell",role:"cell",style:e.normalizeStyle(Ce(Z))},[Z.aggregate?(e.openBlock(),e.createElementBlock("span",_n,e.toDisplayString(Qe(Z)),1)):e.createCommentVNode("",!0)],4))),128))],6)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He.value,(Z,ue)=>(e.openBlock(),e.createElementBlock("div",{key:`sum-${ue}`,class:"sg-table-summary-row",role:"row",style:{display:"contents"}},[t.expandable?(e.openBlock(),e.createElementBlock("div",Kn)):e.createCommentVNode("",!0),t.rowSelection?(e.openBlock(),e.createElementBlock("div",Hn)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Z,(W,ve)=>(e.openBlock(),e.createElementBlock("div",{key:`sc-${ue}-${ve}`,class:"sg-table-td sg-table-summary-cell",role:"cell",style:e.normalizeStyle({...W.colSpan&&W.colSpan>1?{gridColumn:`span ${W.colSpan}`}:{},...W.align?{textAlign:W.align}:{}})},[W.content&&typeof W.content=="object"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(W.content),{key:0})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(W.content),1)],64))],4))),128))]))),128))],6)],46,Cn),t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("div",On,[e.createVNode(Bt,{size:"large","aria-label":i.value.loadingText},null,8,["aria-label"])])):e.createCommentVNode("",!0),t.showPagination&&$e.value>1&&!Re.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["sg-table-pagination",r.value.pagination].filter(Boolean).join(" ")||void 0),style:e.normalizeStyle(d.value.pagination)},[e.createElementVNode("span",jn,e.toDisplayString(i.value.totalRows(e.unref(_).totalRows)),1),e.createVNode(Tt,{class:"sg-table-pagination-controls",current:e.unref(_).page,total:e.unref(_).totalRows,"page-size":t.pageSize??e.unref(_).totalRows,onChange:Fe},null,8,["current","total","page-size"])],6)):e.createCommentVNode("",!0)],6))}}),Wn=["aria-expanded","aria-selected","aria-checked","aria-level","data-key","draggable"],Un={key:1,class:"sg-spin sg-spin-small","aria-hidden":"true"},qn={key:1,class:"sg-tree-switcher sg-tree-switcher-noop"},Xn=["checked","disabled","data-indeterminate"],Gn={key:3,class:"sg-tree-icon"},Jn={class:"sg-tree-highlight"},Zn=["title","aria-label","disabled","onClick"],Ut=e.defineComponent({__name:"TreeNodeRow",props:{node:{},nodeKey:{},depth:{},isLeaf:{type:Boolean},indentSize:{},expanded:{type:Boolean},checked:{type:Boolean},halfChecked:{type:Boolean},selected:{type:Boolean},loading:{type:Boolean},disabled:{type:Boolean},focused:{type:Boolean},checkable:{type:Boolean},selectable:{type:Boolean},blockNode:{type:Boolean},directory:{type:Boolean},animated:{type:Boolean},draggable:{type:Boolean},dropPosition:{},dragKey:{},searchValue:{},t:{},status:{},actions:{},editable:{type:Boolean},unstyled:{type:Boolean}},emits:["expand","check","select","dragStart","dragOver","dragLeave","dragEnd","drop","rightClick","loadData","focusNode","edit","editCancel"],setup(t,{emit:n}){const l=t,a=n,o=e.ref(null);e.watch(()=>l.focused,async I=>{var X,ae;I&&o.value&&(await e.nextTick(),(ae=(X=o.value).scrollIntoView)==null||ae.call(X,{block:"nearest"}))});function s(I){I.stopPropagation(),!l.isLeaf&&(!l.expanded&&l.loading||(a("expand",l.nodeKey),!l.expanded&&!l.isLeaf&&a("loadData",l.node)))}function u(I){I.stopPropagation(),!(l.disabled||l.node.disableCheckbox)&&a("check",l.nodeKey)}function c(){l.disabled||l.node.selectable===!1||l.selectable&&(a("select",l.nodeKey),l.directory&&!l.isLeaf&&a("expand",l.nodeKey))}function i(){a("focusNode",l.nodeKey),c()}function r(I){I.preventDefault(),a("rightClick",I,l.node)}const d=e.computed(()=>String(l.node.title??l.nodeKey)),v=e.computed(()=>{const I=l.searchValue;if(!I)return null;const X=d.value,ae=X.toLowerCase().indexOf(I.toLowerCase());return ae===-1?null:{before:X.slice(0,ae),match:X.slice(ae,ae+I.length),after:X.slice(ae+I.length)}}),g=e.computed(()=>l.dragKey===l.nodeKey),m=e.ref(!1),h=e.ref(null),p=e.ref(""),b=e.computed(()=>(l.actions??[]).filter(I=>I.visible?I.visible(l.node):!0)),y=e.computed(()=>l.status&&l.status!=="default"?`sg-tree-node-status-${l.status}`:""),E=e.computed(()=>l.unstyled?"":["sg-tree-node",l.selected?"sg-tree-node-selected":"",l.disabled?"sg-tree-node-disabled":"",l.isLeaf?"sg-tree-node-leaf":"",l.expanded?"sg-tree-node-expanded":"",l.draggable?"sg-tree-node-draggable":"",g.value?"sg-tree-node-dragging":"",l.dropPosition===0?"sg-tree-node-drop-inner":"",l.dropPosition===-1?"sg-tree-node-drop-before":"",l.dropPosition===1?"sg-tree-node-drop-after":"",l.blockNode?"sg-tree-node-block":"",l.directory?"sg-tree-node-directory":"",l.focused?"sg-tree-node-focused":"",m.value?"sg-tree-node-editing":"",y.value].filter(Boolean).join(" "));function z(){!l.editable||l.disabled||(p.value=d.value,m.value=!0,e.nextTick(()=>{var I,X;(I=h.value)==null||I.focus(),(X=h.value)==null||X.select()}))}function x(){if(!m.value)return;const I=p.value.trim(),X=d.value;m.value=!1,I&&I!==X&&a("edit",l.nodeKey,I,X)}function f(){m.value&&(m.value=!1,a("editCancel",l.nodeKey))}function N(I){I.key==="Enter"?(I.preventDefault(),x()):I.key==="Escape"&&(I.preventDefault(),f())}function B(I){return typeof I.disabled=="function"?!!I.disabled(l.node):!!I.disabled}function w(I,X){I.stopPropagation(),!B(X)&&X.onClick(l.node,l.nodeKey)}function S(I){l.draggable&&a("dragStart",I,l.nodeKey)}function L(I){l.draggable&&(I.preventDefault(),a("dragOver",I,l.nodeKey))}function T(I){l.draggable&&a("dragLeave",I,l.nodeKey)}function P(I){l.draggable&&a("dragEnd",I,l.nodeKey)}function q(I){l.draggable&&(I.preventDefault(),a("drop",I,l.nodeKey))}const _=e.computed(()=>l.isLeaf?void 0:l.expanded),R=e.computed(()=>l.checkable?l.checked:void 0),U=e.computed(()=>`${l.depth*l.indentSize}px`);return(I,X)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rowEl",ref:o,class:e.normalizeClass(E.value||void 0),style:e.normalizeStyle({paddingLeft:U.value}),role:"treeitem","aria-expanded":_.value,"aria-selected":t.selected,"aria-checked":R.value,"aria-level":t.depth+1,"data-key":t.nodeKey,draggable:t.draggable,onDragstart:S,onDragover:L,onDragleave:T,onDragend:P,onDrop:q,onContextmenu:r,onClick:i},[t.isLeaf?(e.openBlock(),e.createElementBlock("span",qn)):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["sg-tree-switcher",t.expanded?"sg-tree-switcher-open":"sg-tree-switcher-close",t.loading?"sg-tree-switcher-loading":""].filter(Boolean).join(" ")),onClick:s},[t.loading?(e.openBlock(),e.createElementBlock("span",Un)):(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(["sg-tree-switcher-arrow",t.expanded?"sg-tree-switcher-arrow-open":""].filter(Boolean).join(" ")),width:"10",height:"10",viewBox:"0 0 10 10",fill:"none"},[...X[4]||(X[4]=[e.createElementVNode("path",{d:"M3 2L7 5L3 8",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))],2)),t.checkable&&t.node.checkable!==!1?(e.openBlock(),e.createElementBlock("input",{key:2,type:"checkbox",class:"sg-tree-checkbox sg-checkbox-input",checked:t.checked,disabled:t.disabled||t.node.disableCheckbox,"data-indeterminate":t.halfChecked||void 0,onClick:X[0]||(X[0]=e.withModifiers(()=>{},["stop"])),onChange:u},null,40,Xn)):e.createCommentVNode("",!0),t.directory?(e.openBlock(),e.createElementBlock("span",Gn,e.toDisplayString(t.expanded?"📂":"📁"),1)):e.createCommentVNode("",!0),m.value?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:5,ref_key:"editInput",ref:h,"onUpdate:modelValue":X[1]||(X[1]=ae=>p.value=ae),class:"sg-tree-edit-input",type:"text",onClick:X[2]||(X[2]=e.withModifiers(()=>{},["stop"])),onKeydown:e.withModifiers(N,["stop"]),onBlur:x},null,544)),[[e.vModelText,p.value]]):(e.openBlock(),e.createElementBlock("span",{key:4,class:e.normalizeClass(["sg-tree-title",t.selectable?"sg-tree-title-selectable":""].filter(Boolean).join(" ")),onDblclick:z},[v.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(v.value.before),1),e.createElementVNode("span",Jn,e.toDisplayString(v.value.match),1),e.createTextVNode(e.toDisplayString(v.value.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(d.value),1)],64))],34)),b.value.length>0?(e.openBlock(),e.createElementBlock("span",{key:6,class:"sg-tree-actions",onClick:X[3]||(X[3]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,ae=>(e.openBlock(),e.createElementBlock("button",{key:ae.key,type:"button",class:e.normalizeClass(["sg-tree-action-btn",ae.danger?"sg-tree-action-danger":"",B(ae)?"sg-tree-action-disabled":""].filter(Boolean).join(" ")),title:ae.title,"aria-label":ae.title,disabled:B(ae),onClick:A=>w(A,ae)},e.toDisplayString(ae.icon),11,Zn))),128))])):e.createCommentVNode("",!0)],46,Wn))}}),Rl={emptyText:"No data",loadingText:"Loading...",searchPlaceholder:"Search...",expandAllText:"Expand All",collapseAllText:"Collapse All",checkAllText:"Check All",uncheckAllText:"Uncheck All"},Il=24,_l=28,Qn={key:0,class:"sg-tree-search"},eo=["value","placeholder","aria-label"],to=["aria-label"],lo={key:1,class:"sg-tree-toolbar"},ao={class:"sg-tree-toolbar-actions"},no=["title"],oo=["title"],so=["title"],ro=["title"],io={key:2,class:"sg-tree-empty"},Sl=5,qt=e.defineComponent({__name:"Tree",props:{treeData:{},fieldNames:{},checkable:{type:Boolean,default:!1},checkStrictly:{type:Boolean,default:!1},checkedKeys:{},defaultCheckedKeys:{},selectable:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},selectedKeys:{},defaultSelectedKeys:{},expandedKeys:{},defaultExpandedKeys:{},defaultExpandAll:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!1},draggable:{type:[Boolean,Function],default:!1},allowDrop:{},loadData:{},blockNode:{type:Boolean,default:!1},height:{},virtual:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},indentSize:{default:Il},directory:{type:Boolean,default:!1},showSearch:{type:Boolean,default:!1},searchValue:{},defaultSearchValue:{default:""},filterTreeNode:{},highlightSearch:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},showToolbar:{type:Boolean,default:!1},animated:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!1},scrollToKey:{},locale:{},unstyled:{type:Boolean,default:!1},nodeStatus:{},actions:{},editable:{type:[Boolean,Function]},showLine:{type:Boolean}},emits:["check","select","expand","search","dragStart","dragOver","dragLeave","dragEnd","drop","rightClick","focus","update:expandedKeys","update:checkedKeys","update:selectedKeys","update:searchValue","edit","editCancel"],setup(t,{expose:n,emit:l}){const a=t,o=l,s=e.computed(()=>({...Rl,...a.locale})),u=Ee(),c=e.computed(()=>{var oe,ge;return((ge=(oe=u.value.locale)==null?void 0:oe.tree)==null?void 0:ge.clearSearch)??"Clear search"}),{tree:i,treeState:r,flatNodes:d,toggleExpand:v,setExpandedKeys:g,expandAll:m,collapseAll:h,toggleCheck:p,setCheckedKeys:b,select:y,setSelectedKeys:E,markLoading:z,markLoaded:x,moveNode:f,filterNodes:N,refresh:B}=Ll({data:a.treeData,fieldNames:a.fieldNames,checkStrictly:a.checkStrictly,defaultExpandAll:a.defaultExpandAll,defaultExpandedKeys:a.defaultExpandedKeys,defaultCheckedKeys:a.defaultCheckedKeys,defaultSelectedKeys:a.defaultSelectedKeys});e.watch(()=>a.treeData,(oe,ge)=>{oe!==ge&&(i.setData(oe),B())}),e.watch(()=>a.expandedKeys,oe=>{oe!==void 0&&g(oe)}),e.watch(()=>a.checkedKeys,oe=>{oe!==void 0&&b(oe)}),e.watch(()=>a.selectedKeys,oe=>{oe!==void 0&&E(oe)});const w=e.ref(a.defaultSearchValue),S=e.computed(()=>a.searchValue??w.value);function L(oe){if(a.searchValue===void 0&&(w.value=oe),o("search",oe),o("update:searchValue",oe),!oe){N(null);return}const ge=a.filterTreeNode?se=>a.filterTreeNode(se,oe):se=>String(se.title??"").toLowerCase().includes(oe.toLowerCase());if(N(ge),a.autoExpandParent){const se=i.getFilteredKeys();se&&g(se)}}e.watch(()=>a.searchValue,oe=>{oe!==void 0&&oe!==w.value&&L(oe)});const T=e.ref(null),P=e.computed(()=>T.value);function q(oe){T.value=oe,oe!==null&&o("focus",oe)}e.onMounted(()=>{a.autoFocus&&d.value.length>0&&T.value===null&&q(d.value[0].key)});const _=e.ref(null),R=e.ref(null),U=e.ref(0);function I(oe){v(oe);const ge=i.getNode(oe);if(!ge)return;const se=i.getState().expandedKeys;o("expand",se,{expanded:se.includes(oe),node:ge}),o("update:expandedKeys",se)}function X(oe){p(oe);const ge=i.getNode(oe);if(!ge)return;const se=i.getState(),ke=se.checkedKeys.map(Ke=>i.getNode(Ke)).filter(Boolean);o("check",se.checkedKeys,{checked:se.checkedKeys.includes(oe),node:ge,checkedNodes:ke,halfCheckedKeys:se.halfCheckedKeys}),o("update:checkedKeys",se.checkedKeys)}function ae(oe){y(oe,a.multiple);const ge=i.getNode(oe);if(!ge)return;const se=i.getState(),ke=se.selectedKeys.map(Ke=>i.getNode(Ke)).filter(Boolean);o("select",se.selectedKeys,{selected:se.selectedKeys.includes(oe),node:ge,selectedNodes:ke}),o("update:selectedKeys",se.selectedKeys)}function A(oe){if(!a.loadData)return;const ge=oe.key;r.value.loadedKeys.includes(ge)||r.value.loadingKeys.includes(ge)||(z(ge),a.loadData(oe).then(()=>{x(ge)}))}function V(oe,ge){_.value=ge,oe.dataTransfer&&(oe.dataTransfer.effectAllowed="move");const se=i.getNode(ge);se&&o("dragStart",{event:oe,node:se})}function C(oe,ge){oe.preventDefault(),R.value=ge;const ke=oe.currentTarget.getBoundingClientRect(),Ke=oe.clientY-ke.top,je=ke.height;let te=0;Ke<je*.25?te=-1:Ke>je*.75&&(te=1),U.value=te;const ie=i.getNode(ge);ie&&o("dragOver",{event:oe,node:ie})}function k(oe,ge){R.value=null;const se=i.getNode(ge);se&&o("dragLeave",{event:oe,node:se})}function $(oe,ge){_.value=null,R.value=null;const se=i.getNode(ge);se&&o("dragEnd",{event:oe,node:se})}function M(oe,ge){if(oe.preventDefault(),_.value===null||_.value===ge){_.value=null,R.value=null;return}const se=i.getNode(_.value),ke=i.getNode(ge);if(!(!se||!ke)){if(a.allowDrop&&!a.allowDrop({dragNode:se,dropNode:ke,dropPosition:U.value})){_.value=null,R.value=null;return}f(_.value,ge,U.value),o("drop",{event:oe,node:ke,dragNode:se,dropPosition:U.value}),_.value=null,R.value=null}}function H(oe,ge){o("rightClick",{event:oe,node:ge})}function O(oe){return typeof a.draggable=="function"?a.draggable(oe):!!a.draggable}function Q(oe){return typeof a.editable=="function"?a.editable(oe):!!a.editable}function re(oe){return a.nodeStatus?a.nodeStatus(oe):void 0}function ce(oe,ge,se){const ke=i.getNode(oe);ke&&o("edit",{key:oe,node:ke,value:ge,oldValue:se})}function ne(oe){o("editCancel",oe)}const de=e.useTemplateRef("containerEl"),ye=e.useTemplateRef("treeEl"),Me=e.ref(0),Ne=_l;function Ie(oe){const ge=d.value.findIndex(te=>te.key===oe);if(ge===-1)return;const se=de.value??ye.value;if(!se)return;const ke=ge*Ne,{scrollTop:Ke,clientHeight:je}=se;ke<Ke?se.scrollTop=ke:ke+Ne>Ke+je&&(se.scrollTop=ke+Ne-je)}function ze(oe){if(oe>=0&&oe<d.value.length){const ge=d.value[oe].key;q(ge),Ie(ge)}}function We(oe){if(!a.keyboard||a.disabled)return;const ge=d.value,se=ge.findIndex(ke=>ke.key===P.value);if(!(se===-1&&ge.length===0))switch(oe.key){case"ArrowDown":oe.preventDefault(),ze(se===-1?0:Math.min(se+1,ge.length-1));break;case"ArrowUp":oe.preventDefault(),ze(se===-1?0:Math.max(se-1,0));break;case"ArrowRight":{if(oe.preventDefault(),se===-1)break;const ke=ge[se];!ke.isLeaf&&!r.value.expandedKeys.includes(ke.key)?I(ke.key):!ke.isLeaf&&r.value.expandedKeys.includes(ke.key)&&ze(se+1);break}case"ArrowLeft":{if(oe.preventDefault(),se===-1)break;const ke=ge[se];if(!ke.isLeaf&&r.value.expandedKeys.includes(ke.key))I(ke.key);else if(ke.parentKey!==null&&ke.parentKey!==void 0){const Ke=ge.findIndex(je=>je.key===ke.parentKey);Ke!==-1&&ze(Ke)}break}case"Home":oe.preventDefault(),ze(0);break;case"End":oe.preventDefault(),ze(ge.length-1);break;case"Enter":{if(oe.preventDefault(),se===-1)break;const ke=ge[se];a.selectable&&ae(ke.key);break}case" ":{if(oe.preventDefault(),se===-1)break;const ke=ge[se];a.checkable?X(ke.key):ke.isLeaf||I(ke.key);break}case"*":oe.preventDefault(),m();break}}function Ge(){de.value&&(Me.value=de.value.scrollTop)}const G=e.computed(()=>a.virtual&&a.height!==void 0&&d.value.length>50),le=e.computed(()=>{if(!G.value||!a.height)return{nodes:d.value,startIndex:0};const oe=Math.floor(Me.value/Ne),ge=Math.max(0,oe-Sl),se=Math.ceil(a.height/Ne)+Sl*2,ke=Math.min(d.value.length,ge+se);return{nodes:d.value.slice(ge,ke),startIndex:ge}}),fe=e.computed(()=>le.value.startIndex*Ne),be=e.computed(()=>d.value.length*Ne),Ve=e.computed(()=>Math.max(0,be.value-fe.value-le.value.nodes.length*Ne));e.watch(()=>a.scrollToKey,oe=>{if(oe===void 0)return;d.value.findIndex(se=>se.key===oe)!==-1&&(Ie(oe),q(oe))});function De(){m(),o("expand",i.getState().expandedKeys,{expanded:!0,node:a.treeData[0]})}function xe(){h(),o("expand",[],{expanded:!1,node:a.treeData[0]})}function Le(){const oe=i.getAllKeys();b(oe);const ge=oe.map(se=>i.getNode(se)).filter(Boolean);o("check",oe,{checked:!0,node:ge[0],checkedNodes:ge,halfCheckedKeys:[]})}function Te(){b([]),o("check",[],{checked:!1,node:a.treeData[0],checkedNodes:[],halfCheckedKeys:[]})}const we=e.computed(()=>a.unstyled?"":["sg-tree",a.blockNode?"sg-tree-block-node":"",a.directory?"sg-tree-directory":"",a.disabled?"sg-tree-disabled":"",a.animated?"sg-tree-animated":"",a.showLine?"sg-tree-show-line":""].filter(Boolean).join(" "));return n({expandAll:De,collapseAll:xe,checkAll:Le,uncheckAll:Te,scrollToKey:Ie}),(oe,ge)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(we.value||void 0),role:"tree"},[t.showSearch?(e.openBlock(),e.createElementBlock("div",Qn,[e.createElementVNode("input",{class:"sg-tree-search-input",type:"text",value:S.value,placeholder:s.value.searchPlaceholder,"aria-label":s.value.searchPlaceholder,onInput:ge[0]||(ge[0]=se=>L(se.target.value))},null,40,eo),S.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"sg-tree-search-clear","aria-label":c.value,onClick:ge[1]||(ge[1]=se=>L(""))}," × ",8,to)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.showToolbar?(e.openBlock(),e.createElementBlock("div",lo,[e.createElementVNode("div",ao,[e.createElementVNode("button",{type:"button",class:"sg-tree-toolbar-btn",title:s.value.expandAllText,onClick:De}," ⊞ ",8,no),e.createElementVNode("button",{type:"button",class:"sg-tree-toolbar-btn",title:s.value.collapseAllText,onClick:xe}," ⊟ ",8,oo),t.checkable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[ge[2]||(ge[2]=e.createElementVNode("span",{class:"sg-tree-toolbar-divider"},null,-1)),e.createElementVNode("button",{type:"button",class:"sg-tree-toolbar-btn",title:s.value.checkAllText,onClick:Le}," ☑ ",8,so),e.createElementVNode("button",{type:"button",class:"sg-tree-toolbar-btn",title:s.value.uncheckAllText,onClick:Te}," ☐ ",8,ro)],64)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.unref(d).length===0?(e.openBlock(),e.createElementBlock("div",io,e.toDisplayString(s.value.emptyText),1)):G.value&&t.height?(e.openBlock(),e.createElementBlock("div",{key:3,ref:"containerEl",class:"sg-tree-virtual-container",style:e.normalizeStyle({height:`${t.height}px`,overflow:"auto"}),tabindex:"0",role:"tree",onScroll:Ge,onKeydown:We},[e.createElementVNode("div",{style:e.normalizeStyle({paddingTop:`${fe.value}px`,paddingBottom:`${Ve.value}px`,boxSizing:"border-box"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(le.value.nodes,se=>(e.openBlock(),e.createBlock(Ut,{key:se.key,node:se.node,"node-key":se.key,depth:se.depth,"is-leaf":se.isLeaf,"indent-size":t.indentSize,expanded:e.unref(r).expandedKeys.includes(se.key),checked:e.unref(r).checkedKeys.includes(se.key),"half-checked":e.unref(r).halfCheckedKeys.includes(se.key),selected:e.unref(r).selectedKeys.includes(se.key),loading:e.unref(r).loadingKeys.includes(se.key),disabled:t.disabled||!!se.node.disabled,focused:P.value===se.key,checkable:t.checkable,selectable:t.selectable,"block-node":t.blockNode,directory:t.directory,animated:t.animated,draggable:O(se.node),"drop-position":R.value===se.key?U.value:null,"drag-key":_.value,"search-value":t.highlightSearch?S.value:"",t:s.value,status:re(se.node),actions:t.actions,editable:Q(se.node),unstyled:t.unstyled,onExpand:I,onCheck:X,onSelect:ae,onDragStart:V,onDragOver:C,onDragLeave:k,onDragEnd:$,onDrop:M,onRightClick:H,onLoadData:A,onFocusNode:q,onEdit:ce,onEditCancel:ne},null,8,["node","node-key","depth","is-leaf","indent-size","expanded","checked","half-checked","selected","loading","disabled","focused","checkable","selectable","block-node","directory","animated","draggable","drop-position","drag-key","search-value","t","status","actions","editable","unstyled"]))),128))],4)],36)):(e.openBlock(),e.createElementBlock("div",{key:4,ref:"treeEl",tabindex:"0",role:"tree",onKeydown:We},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),se=>(e.openBlock(),e.createBlock(Ut,{key:se.key,node:se.node,"node-key":se.key,depth:se.depth,"is-leaf":se.isLeaf,"indent-size":t.indentSize,expanded:e.unref(r).expandedKeys.includes(se.key),checked:e.unref(r).checkedKeys.includes(se.key),"half-checked":e.unref(r).halfCheckedKeys.includes(se.key),selected:e.unref(r).selectedKeys.includes(se.key),loading:e.unref(r).loadingKeys.includes(se.key),disabled:t.disabled||!!se.node.disabled,focused:P.value===se.key,checkable:t.checkable,selectable:t.selectable,"block-node":t.blockNode,directory:t.directory,animated:t.animated,draggable:O(se.node),"drop-position":R.value===se.key?U.value:null,"drag-key":_.value,"search-value":t.highlightSearch?S.value:"",t:s.value,status:re(se.node),actions:t.actions,editable:Q(se.node),unstyled:t.unstyled,onExpand:I,onCheck:X,onSelect:ae,onDragStart:V,onDragOver:C,onDragLeave:k,onDragEnd:$,onDrop:M,onRightClick:H,onLoadData:A,onFocusNode:q,onEdit:ce,onEditCancel:ne},null,8,["node","node-key","depth","is-leaf","indent-size","expanded","checked","half-checked","selected","loading","disabled","focused","checkable","selectable","block-node","directory","animated","draggable","drop-position","drag-key","search-value","t","status","actions","editable","unstyled"]))),128))],544))],2))}}),co={key:1,class:"sg-list-loading-indicator",role:"status","aria-live":"polite"},uo=["aria-label"],mo=["draggable","onClick","onDragstart","onDragover","onDrop"],po={key:0,class:"sg-list-drag-handle"},vo=["draggable","onClick","onDragstart","onDragover","onDrop"],go={key:0,class:"sg-list-drag-handle"},fo={key:5,class:"sg-list-load-more"},ho=["disabled"],yo={class:"sg-list-pagination-info"},ko=["disabled"],bo=e.defineComponent({__name:"List",props:{dataSource:{},header:{},footer:{},loading:{type:Boolean,default:!1},pagination:{type:[Boolean,Object],default:!1},grid:{},size:{default:"default"},split:{type:Boolean,default:!0},bordered:{type:Boolean,default:!1},locale:{},unstyled:{type:Boolean,default:!1},virtual:{},selectable:{type:Boolean,default:!1},selectedKeys:{},defaultSelectedKeys:{default:()=>[]},multiSelect:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!0},rowClassName:{},classNames:{},styles:{}},emits:["selectionChange","reorder","itemClick","pageChange"],setup(t,{expose:n,emit:l}){const a=t,o=l,s=e.useSlots(),u=Ee(),c=e.computed(()=>{var V,C;return((C=(V=u.value.locale)==null?void 0:V.list)==null?void 0:C.loading)??"Loading"}),i=e.computed(()=>a.classNames??{}),r=e.computed(()=>a.styles??{}),d=e.ref(1),v=e.ref(a.defaultSelectedKeys??[]),g=e.ref(null),m=e.ref(null),h=e.ref(0),p=e.ref(null),b=e.computed(()=>a.selectedKeys??v.value),y=e.computed(()=>a.pagination?a.pagination.pageSize??10:a.dataSource.length),E=e.computed(()=>a.pagination?a.pagination.current??d.value:1),z=e.computed(()=>a.pagination?a.pagination.total??a.dataSource.length:a.dataSource.length),x=e.computed(()=>{if(!a.pagination)return a.dataSource;const V=(E.value-1)*y.value;return a.dataSource.slice(V,V+y.value)}),f=e.computed(()=>Math.max(1,Math.ceil(z.value/y.value)));function N(V){var C,k;V<1||V>f.value||(d.value=V,a.pagination&&((k=(C=a.pagination).onChange)==null||k.call(C,V,y.value)),o("pageChange",V,y.value))}function B(V,C,k){if(o("itemClick",V,C),!a.selectable)return;let $;a.multiSelect&&(k.ctrlKey||k.metaKey)?$=b.value.includes(C)?b.value.filter(M=>M!==C):[...b.value,C]:$=b.value.includes(C)?[]:[C],v.value=$,o("selectionChange",$,$.map(M=>a.dataSource[M]))}function w(V,C){a.draggable&&(g.value=C,V.dataTransfer&&(V.dataTransfer.effectAllowed="move"))}function S(V,C){!a.draggable||g.value===null||(V.preventDefault(),m.value=C)}function L(V,C){if(V.preventDefault(),g.value===null||g.value===C){g.value=null,m.value=null;return}o("reorder",g.value,C),g.value=null,m.value=null}function T(){g.value=null,m.value=null}let P=null;function q(){P==null&&(P=requestAnimationFrame(()=>{P=null,p.value&&(h.value=p.value.scrollTop)}))}const _=e.computed(()=>{var V;return((V=a.locale)==null?void 0:V.emptyText)??"No Data"}),R=e.computed(()=>{if(!a.grid)return;const C={"--sg-list-grid-base-columns":`repeat(${a.grid.column??1}, 1fr)`};return a.grid.gutter!==void 0&&(C.gap=`${a.grid.gutter}px`),C}),U=e.computed(()=>{const V=a.grid;if(!V)return"";const C=[];return V.xs&&C.push(`sg-list-grid-xs-${V.xs}`),V.sm&&C.push(`sg-list-grid-sm-${V.sm}`),V.md&&C.push(`sg-list-grid-md-${V.md}`),V.lg&&C.push(`sg-list-grid-lg-${V.lg}`),C.join(" ")}),I=e.computed(()=>{if(!a.virtual)return null;const{itemHeight:V,height:C,overscan:k=5}=a.virtual,$=x.value.length*V,M=Math.max(0,Math.floor(h.value/V)-k),H=Math.ceil(C/V)+k*2,O=Math.min(x.value.length,M+H),Q=M*V;return{startIndex:M,endIndex:O,offsetTop:Q,totalHeight:$}});function X(V,C){const k=a.selectable&&b.value.includes(C),$=g.value===C,M=m.value===C&&g.value!==C,H=typeof a.rowClassName=="function"?a.rowClassName(V,C):a.rowClassName??"";return["sg-list-item",a.selectable?"sg-list-item-selectable":"",k?"sg-list-item-selected":"",a.hoverable?"sg-list-item-hoverable":"",$?"sg-list-item-dragging":"",M?"sg-list-item-drop-target":"",i.value.item??"",H].filter(Boolean).join(" ")}const ae=e.computed(()=>a.unstyled?"":["sg-list",`sg-list-${a.size}`,a.split?"sg-list-split":"",a.bordered?"sg-list-bordered":"",a.loading?"sg-list-loading":"",a.grid?"sg-list-grid":"",a.selectable?"sg-list-selectable":"",a.draggable?"sg-list-draggable":"",a.virtual?"sg-list-virtual":"",U.value,i.value.root??""].filter(Boolean).join(" ")),A=e.computed(()=>["sg-list-items",i.value.items??""].filter(Boolean).join(" "));return n({selectedKeys:v,changePage:N}),(V,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(ae.value),style:e.normalizeStyle(r.value.root)},[e.unref(s).header||t.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["sg-list-header",i.value.header].filter(Boolean).join(" ")||void 0),style:e.normalizeStyle(r.value.header)},[e.renderSlot(V.$slots,"header",{},()=>[e.createTextVNode(e.toDisplayString(t.header),1)])],6)):e.createCommentVNode("",!0),t.loading?(e.openBlock(),e.createElementBlock("div",co,[t.unstyled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",{key:0,class:"sg-spin sg-spin-default","aria-label":c.value},null,8,uo))])):x.value.length===0?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["sg-list-empty",i.value.empty].filter(Boolean).join(" ")||void 0),style:e.normalizeStyle(r.value.empty)},e.toDisplayString(_.value),7)):t.virtual&&I.value?(e.openBlock(),e.createElementBlock("div",{key:3,ref_key:"virtualEl",ref:p,class:"sg-list-virtual-container",style:e.normalizeStyle({height:`${t.virtual.height}px`,overflow:"auto"}),onScroll:q},[e.createElementVNode("div",{style:e.normalizeStyle({height:`${I.value.totalHeight}px`,position:"relative"})},[e.createElementVNode("div",{style:e.normalizeStyle({position:"absolute",top:`${I.value.offsetTop}px`,left:0,right:0})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value.slice(I.value.startIndex,I.value.endIndex),(k,$)=>(e.openBlock(),e.createElementBlock("div",{key:I.value.startIndex+$,class:e.normalizeClass(X(k,I.value.startIndex+$)||void 0),style:e.normalizeStyle(r.value.item),draggable:t.draggable,onClick:M=>B(k,I.value.startIndex+$,M),onDragstart:M=>w(M,I.value.startIndex+$),onDragover:M=>S(M,I.value.startIndex+$),onDrop:M=>L(M,I.value.startIndex+$),onDragend:T,onDragleave:C[0]||(C[0]=M=>m.value=null)},[t.draggable?(e.openBlock(),e.createElementBlock("span",po,"⠿")):e.createCommentVNode("",!0),e.renderSlot(V.$slots,"default",{item:k,index:I.value.startIndex+$})],46,mo))),128))],4)],4)],36)):(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(t.grid||i.value.items?A.value:void 0),style:e.normalizeStyle(t.grid?{...R.value,...r.value.items}:r.value.items)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(k,$)=>(e.openBlock(),e.createElementBlock("div",{key:$,class:e.normalizeClass(X(k,$)||void 0),style:e.normalizeStyle(r.value.item),draggable:t.draggable,onClick:M=>B(k,$,M),onDragstart:M=>w(M,$),onDragover:M=>S(M,$),onDrop:M=>L(M,$),onDragend:T,onDragleave:C[1]||(C[1]=M=>m.value=null)},[t.draggable?(e.openBlock(),e.createElementBlock("span",go,"⠿")):e.createCommentVNode("",!0),e.renderSlot(V.$slots,"default",{item:k,index:$})],46,vo))),128))],6)),e.unref(s).loadMore?(e.openBlock(),e.createElementBlock("div",fo,[e.renderSlot(V.$slots,"loadMore")])):e.createCommentVNode("",!0),t.pagination?(e.openBlock(),e.createElementBlock("div",{key:6,class:e.normalizeClass(["sg-list-pagination",i.value.pagination].filter(Boolean).join(" ")||void 0),style:e.normalizeStyle(r.value.pagination)},[e.createElementVNode("button",{type:"button",class:"sg-list-pagination-prev",disabled:E.value<=1,onClick:C[2]||(C[2]=k=>N(E.value-1))}," ‹ ",8,ho),e.createElementVNode("span",yo,e.toDisplayString(E.value)+" / "+e.toDisplayString(f.value),1),e.createElementVNode("button",{type:"button",class:"sg-list-pagination-next",disabled:E.value>=f.value,onClick:C[3]||(C[3]=k=>N(E.value+1))}," › ",8,ko)],6)):e.createCommentVNode("",!0),e.unref(s).footer||t.footer?(e.openBlock(),e.createElementBlock("div",{key:7,class:e.normalizeClass(["sg-list-footer",i.value.footer].filter(Boolean).join(" ")||void 0),style:e.normalizeStyle(r.value.footer)},[e.renderSlot(V.$slots,"footer",{},()=>[e.createTextVNode(e.toDisplayString(t.footer),1)])],6)):e.createCommentVNode("",!0)],6))}}),Bo=e.defineComponent({__name:"VirtualList",props:{data:{},itemHeight:{},overscan:{default:void 0},className:{default:void 0},containerStyle:{default:void 0},itemKey:{type:Function,default:void 0}},setup(t,{expose:n}){const l=t,a=e.computed(()=>l.data.length),o=e.computed(()=>l.itemHeight),{range:s,containerRef:u,scrollToIndex:c}=el({itemCount:a,itemHeight:o,overscan:e.computed(()=>l.overscan??5)});n({scrollToIndex:c});const i=e.computed(()=>s.value.visibleItems.map(d=>{const v=l.data[d.index],g=l.itemKey?l.itemKey(v,d.index):d.index,m={position:"absolute",top:`${d.offsetTop}px`,left:"0",right:"0",height:`${d.height}px`};return{vi:d,item:v,key:g,style:m}}));return(r,d)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:u,class:e.normalizeClass(t.className),style:e.normalizeStyle({overflow:"auto",position:"relative",...t.containerStyle})},[e.createElementVNode("div",{style:e.normalizeStyle({height:`${e.unref(s).totalHeight}px`,position:"relative"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,v=>e.renderSlot(r.$slots,"item",{key:v.key,item:v.item,index:v.vi.index,style:e.normalizeStyle(v.style)})),128))],4)],6))}}),Co=["checked","aria-label"],wo=["data-col-index","onClick"],So={key:0,class:"sg-datagrid-header-cell-sort-indicator"},Eo={key:0,class:"sg-datagrid-loading",style:{position:"absolute",inset:0,background:"rgba(255,255,255,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10}},xo={key:1,class:"sg-datagrid-empty",style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"}},$o=["data-row-index","onClick","onDblclick"],No=["checked","aria-label","onChange"],Vo=["data-row-index","data-col-index","data-col-key","onClick","onDblclick"],Do=["value"],zo={key:1},To={key:2,class:"sg-datagrid-summary"},Ot=40,jt=48,Mo=e.defineComponent({__name:"DataGrid",props:{columns:{},data:{},rowKey:{},rowHeight:{default:36},headerHeight:{default:40},width:{default:"100%"},height:{default:400},className:{},selectedRows:{},rowSelection:{type:Boolean,default:!1},showRowNumber:{type:Boolean,default:!1},striped:{type:Boolean,default:!1},highlightOnHover:{type:Boolean,default:!0},sortColumn:{},sortDirection:{},overscan:{default:5},loading:{type:Boolean,default:!1},summaryRows:{},emptyText:{default:"No data"}},emits:["cell-edit","sort","row-click","row-double-click","selected-rows-change"],setup(t,{expose:n,emit:l}){const a=t,o=Ee(),s=e.computed(()=>{var A,V;return((V=(A=o.value.locale)==null?void 0:A.dataGrid)==null?void 0:V.selectAllRows)??"Select all rows"}),u=e.computed(()=>{var A,V;return((V=(A=o.value.locale)==null?void 0:A.dataGrid)==null?void 0:V.selectRow)??"Select row"}),c=l,i=e.computed(()=>{const A=a.columns.filter(k=>k.frozen==="left"),V=a.columns.filter(k=>!k.frozen),C=a.columns.filter(k=>k.frozen==="right");return[...A,...V,...C]}),r=e.computed(()=>a.data.length*a.rowHeight),d=e.computed(()=>a.data.length),v=e.computed(()=>a.rowHeight),g=e.computed(()=>a.overscan??5),{range:m,containerRef:h,scrollToIndex:p}=el({itemCount:d,itemHeight:v,overscan:g}),b=e.ref(null),y=e.ref(null),E=e.ref(null),z=e.ref(new Set(a.selectedRows??[]));e.watch(()=>a.selectedRows,A=>{z.value=new Set(A??[])});const x=e.computed(()=>m.value.visibleItems.map(V=>({row:a.data[V.index],index:V.index,offsetTop:V.offsetTop,height:V.height}))),f=(A,V)=>typeof a.rowKey=="function"?a.rowKey(A,V):A[a.rowKey]??V,N=(A,V)=>V.formula?V.formula(A):A[V.key],B=(A,V,C)=>typeof A.editable=="function"?A.editable(V,C):!!A.editable,w=A=>{if(!A.sortable)return;const V=a.sortColumn===A.key&&a.sortDirection==="asc"?"desc":"asc";c("sort",{column:A.key,direction:V})},S=(A,V)=>{b.value={row:A,col:V}},L=(A,V,C,k)=>{B(C,k,A)&&(y.value={row:A,col:V},E.value=N(k,C))},T=()=>{const A=y.value;if(!A)return;const V=i.value[A.col];c("cell-edit",{rowIndex:A.row,columnKey:V.key,value:E.value}),y.value=null},P=()=>{y.value=null},q=A=>{A.key==="Enter"?T():A.key==="Escape"&&P()},_=(A,V)=>{c("row-click",{row:A,rowIndex:V})},R=(A,V)=>{c("row-double-click",{row:A,rowIndex:V})},U=(A,V)=>{const C=f(A,V),k=new Set(z.value);k.has(C)?k.delete(C):k.add(C),z.value=k,c("selected-rows-change",k)},I=e.computed(()=>a.data.length===0?!1:a.data.every((A,V)=>z.value.has(f(A,V)))),X=()=>{I.value?z.value=new Set:z.value=new Set(a.data.map((A,V)=>f(A,V))),c("selected-rows-change",z.value)},ae=e.computed(()=>a.summaryRows??[]);return n({scrollToRow:p,getActiveCell:()=>b.value,setActiveCell:A=>{b.value=A}}),(A,V)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["sg-datagrid",a.className]),style:e.normalizeStyle({width:typeof a.width=="number"?`${a.width}px`:a.width,height:typeof a.height=="number"?`${a.height}px`:a.height,position:"relative",overflow:"hidden",display:"flex",flexDirection:"column"})},[e.createElementVNode("div",{class:"sg-datagrid-header",style:e.normalizeStyle({height:`${a.headerHeight}px`,display:"flex",flexShrink:0})},[a.rowSelection?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-datagrid-header-cell sg-datagrid-selection-cell",style:e.normalizeStyle({width:`${Ot}px`,flexShrink:0})},[e.createElementVNode("input",{type:"checkbox",checked:I.value,"aria-label":s.value,onChange:X},null,40,Co)],4)):e.createCommentVNode("",!0),a.showRowNumber?(e.openBlock(),e.createElementBlock("div",{key:1,class:"sg-datagrid-header-cell sg-datagrid-row-number-cell",style:e.normalizeStyle({width:`${jt}px`,flexShrink:0})}," # ",4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(C,k)=>(e.openBlock(),e.createElementBlock("div",{key:C.key,class:e.normalizeClass(["sg-datagrid-header-cell",C.headerClassName,C.sortable&&"sg-datagrid-header-cell--sortable",a.sortColumn===C.key&&a.sortDirection==="asc"&&"sg-datagrid-header-cell--asc",a.sortColumn===C.key&&a.sortDirection==="desc"&&"sg-datagrid-header-cell--desc"]),style:e.normalizeStyle({width:C.width?`${C.width}px`:"120px",minWidth:C.minWidth?`${C.minWidth}px`:void 0,maxWidth:C.maxWidth?`${C.maxWidth}px`:void 0,textAlign:C.align??"left"}),"data-col-index":k,onClick:$=>w(C)},[e.createElementVNode("span",null,e.toDisplayString(C.title??C.key),1),C.sortable&&a.sortColumn===C.key?(e.openBlock(),e.createElementBlock("span",So,e.toDisplayString(a.sortDirection==="asc"?"▲":"▼"),1)):e.createCommentVNode("",!0)],14,wo))),128))],4),a.loading?(e.openBlock(),e.createElementBlock("div",Eo,[...V[2]||(V[2]=[e.createElementVNode("span",null,"Loading…",-1)])])):e.createCommentVNode("",!0),!a.loading&&a.data.length===0?(e.openBlock(),e.createElementBlock("div",xo,e.toDisplayString(a.emptyText),1)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{ref_key:"containerRef",ref:h,class:"sg-datagrid-body",style:{flex:1,overflowY:"auto",overflowX:"auto"}},[e.createElementVNode("div",{style:e.normalizeStyle({height:`${r.value}px`,position:"relative"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,C=>(e.openBlock(),e.createElementBlock("div",{key:f(C.row,C.index),class:e.normalizeClass(["sg-datagrid-row",[a.striped&&(C.index%2===0?"sg-datagrid-row--even":"sg-datagrid-row--odd"),a.highlightOnHover&&"sg-datagrid-row--hoverable",z.value.has(f(C.row,C.index))&&"sg-datagrid-row--selected"]]),style:e.normalizeStyle({position:"absolute",top:`${C.offsetTop}px`,left:0,right:0,height:`${C.height}px`,display:"flex"}),"data-row-index":C.index,onClick:k=>_(C.row,C.index),onDblclick:k=>R(C.row,C.index)},[a.rowSelection?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-datagrid-cell sg-datagrid-selection-cell",style:e.normalizeStyle({width:`${Ot}px`,flexShrink:0})},[e.createElementVNode("input",{type:"checkbox",checked:z.value.has(f(C.row,C.index)),"aria-label":u.value,onClick:V[0]||(V[0]=e.withModifiers(()=>{},["stop"])),onChange:k=>U(C.row,C.index)},null,40,No)],4)):e.createCommentVNode("",!0),a.showRowNumber?(e.openBlock(),e.createElementBlock("div",{key:1,class:"sg-datagrid-cell sg-datagrid-row-number-cell",style:e.normalizeStyle({width:`${jt}px`,flexShrink:0})},e.toDisplayString(C.index+1),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(k,$)=>(e.openBlock(),e.createElementBlock("div",{key:k.key,class:e.normalizeClass(["sg-datagrid-cell",k.className,b.value&&b.value.row===C.index&&b.value.col===$&&"sg-datagrid-cell--active",y.value&&y.value.row===C.index&&y.value.col===$&&"sg-datagrid-cell--editing"]),style:e.normalizeStyle({width:k.width?`${k.width}px`:"120px",minWidth:k.minWidth?`${k.minWidth}px`:void 0,maxWidth:k.maxWidth?`${k.maxWidth}px`:void 0,textAlign:k.align??"left"}),"data-row-index":C.index,"data-col-index":$,"data-col-key":k.key,onClick:e.withModifiers(M=>S(C.index,$),["stop"]),onDblclick:e.withModifiers(M=>L(C.index,$,k,C.row),["stop"])},[y.value&&y.value.row===C.index&&y.value.col===$?(e.openBlock(),e.createElementBlock("input",{key:0,value:E.value==null?"":String(E.value),autofocus:"",style:{width:"100%",height:"100%",border:"none",outline:"none",padding:"0 8px",background:"transparent",font:"inherit"},onInput:V[1]||(V[1]=M=>E.value=M.target.value),onBlur:T,onKeydown:q},null,40,Do)):(e.openBlock(),e.createElementBlock("span",zo,e.toDisplayString(N(C.row,k)??""),1))],46,Vo))),128))],46,$o))),128))],4)],512),[[e.vShow,a.data.length>0]]),ae.value.length>0?(e.openBlock(),e.createElementBlock("div",To,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,(C,k)=>(e.openBlock(),e.createElementBlock("div",{key:k,class:e.normalizeClass(["sg-datagrid-summary-row",C.className]),style:{display:"flex"}},[a.rowSelection?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-datagrid-summary-cell",style:e.normalizeStyle({width:`${Ot}px`,flexShrink:0})},null,4)):e.createCommentVNode("",!0),a.showRowNumber?(e.openBlock(),e.createElementBlock("div",{key:1,class:"sg-datagrid-summary-cell",style:e.normalizeStyle({width:`${jt}px`,flexShrink:0})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,$=>(e.openBlock(),e.createElementBlock("div",{key:$.key,class:"sg-datagrid-summary-cell",style:e.normalizeStyle({width:$.width?`${$.width}px`:"120px",textAlign:$.align??"left"})},e.toDisplayString(C.render($.key,a.data)??""),5))),128))],2))),128))])):e.createCommentVNode("",!0)],6))}});function Ct(t,n){const l=e.ref({...n});let a={...n},o=null,s=null;const u=(r,d)=>{if(!Number.isFinite(r)||!Number.isFinite(d)||r<=0||d<=0)return;const v={width:Math.round(r),height:Math.round(d)};a.width===v.width&&a.height===v.height||(a=v,l.value=v)},c=()=>{o&&(o.disconnect(),o=null),s=null},i=r=>{if(s===r||(c(),!r))return;if(s=r,typeof ResizeObserver>"u"){const v=r.getBoundingClientRect();u(v.width,v.height);return}o=new ResizeObserver(v=>{const g=v[0];if(!g)return;const m=g.contentRect;u(m.width,m.height)});const d=r.getBoundingClientRect();u(d.width,d.height),o.observe(r)};return e.watchEffect(()=>{i(t.value)}),e.onScopeDispose(()=>c()),{size:l}}function Kl(t={}){const n=t.orientation??"portrait",l=t.pageSize??"A4",a=t.margins??"1cm";return`@page { size: ${l} ${n}; margin: ${a}; }`}function Hl(t,n={},l=typeof document<"u"?document:null){const a=l===null?"":Array.from(l.querySelectorAll('style, link[rel="stylesheet"]')).map(r=>r.outerHTML).join(`
2
- `),o=Kl(n),s=n.scale&&n.scale!==1?n.scale:null,u=Lo(n.fileName??"SkyGraph print"),c=n.customStyles??"",i=s?`<div class="sg-print-root" style="transform: scale(${s}); transform-origin: 0 0;">`:'<div class="sg-print-root">';return`<!DOCTYPE html>
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),je=require("@skygraph/core");function At(t){const n=je.createCore(),l=je.createForm(n,t),a=new Set(Object.keys((t==null?void 0:t.defaultValues)??{})),o=()=>{const E={...l.getFieldsValue()};for(const N of a)if(!(N in E)){const x=n.get(N);x!==void 0&&(E[N]=x)}return E},s=e.ref(o()),v=e.ref({...l.getFormState()});let c=!1;const r=()=>{s.value=o(),v.value={...l.getFormState()}},i=()=>{c||(c=!0,queueMicrotask(()=>{c=!1,r()}))},d=n.use((E,N)=>{N(E),E.path&&!E.path.startsWith("$")&&a.add(E.path),i()});e.onScopeDispose(()=>{d()});const u=async()=>{v.value={...v.value,isSubmitting:!0};try{await l.submit(async()=>{var E;await((E=t==null?void 0:t.onSubmit)==null?void 0:E.call(t,o()))})}finally{r()}if(!l.getFormState().isValid&&(t!=null&&t.onSubmitInvalid)){const E=await l.validate();t.onSubmitInvalid(E.errors)}},p=E=>{if(l.reset(E),E)for(const[N,x]of Object.entries(E))a.add(N),n.set(N,x);else if(t!=null&&t.defaultValues)for(const[N,x]of Object.entries(t.defaultValues))n.set(N,x);r()},m=(E,N)=>{l.setValue(E,N)},k=E=>{l.setFieldsValue(E)},f=E=>l.getValue(E),w=()=>o(),B=E=>l.validate(E);return{core:n,form:l,values:s,formState:v,isSubmitting:e.computed(()=>v.value.isSubmitting),isValidating:e.computed(()=>v.value.isValidating),isDirty:e.computed(()=>v.value.isDirty),isValid:e.computed(()=>v.value.isValid),submit:u,reset:p,setFieldValue:m,setFieldsValue:k,getFieldValue:f,getFieldsValue:w,validateFields:B}}function Pl(t,n,l){const a=e.ref(n.getValue(l)),o=e.ref({...n.getFieldState(l)}),s=e.ref([...o.value.errors]),v=e.ref([...o.value.warnings]),c=e.ref(o.value.touched),r=e.ref(o.value.dirty),i=e.ref(o.value.validating),d=()=>{const k=n.getFieldState(l);o.value={...k},s.value=[...k.errors],v.value=[...k.warnings],c.value=k.touched,r.value=k.dirty,i.value=k.validating},u=[];u.push(t.subscribe(l,k=>{a.value=k}));for(const k of["errors","warnings","touched","dirty","validating"])u.push(t.subscribe(`$meta.${l}.${k}`,()=>{d()}));e.onScopeDispose(()=>{for(const k of u)k()});const p=k=>{n.setValue(l,k)},m=()=>{n.onFieldBlur(l)};return{value:a,errors:s,warnings:v,error:e.computed(()=>s.value[0]??null),touched:c,dirty:r,validating:i,status:e.computed(()=>{if(i.value)return"validating";if(s.value.length>0)return"error";if(v.value.length>0)return"warning"}),onChange:p,onBlur:m,meta:o}}function $a(t,n){let l=0;const a=()=>`fa_${n}_${++l}`,o=t.getListValue(n),s=e.ref(o.map(()=>a()));return{fields:e.computed(()=>s.value.map((u,p)=>({key:u,index:p}))),append:u=>{t.listAdd(n,u),s.value=[...s.value,a()]},remove:u=>{t.listRemove(n,u),s.value=s.value.filter((p,m)=>m!==u)},move:(u,p)=>{t.listMove(n,u,p);const m=[...s.value],[k]=m.splice(u,1);m.splice(p,0,k),s.value=m},replace:u=>{const p=t.getListValue(n).length;for(let k=p-1;k>=0;k--)t.listRemove(n,k);const m=[];for(const k of u)t.listAdd(n,k),m.push(a());s.value=m}}}function Rl(t,n){const l=e.ref(t.get(n)),a=t.subscribe(n,o=>{l.value=o});return e.onScopeDispose(()=>{a()}),l}function Na(t,n){return Rl(t,n)}function Il(t){const n=je.createCore(),l=je.createTable(n,t),a=t!=null&&t.data?e.isRef(t.data)?t.data.value:t.data:void 0;a&&l.addRows(a);const o=e.ref(l.getVisibleRows()),s=e.ref(l.getTableState()),v=e.ref(l.getPinnedColumns()),c=e.ref(l.getColumnWidths()),r=()=>{o.value=l.getVisibleRows(),s.value=l.getTableState(),v.value=l.getPinnedColumns(),c.value=l.getColumnWidths()};if(t!=null&&t.data&&e.isRef(t.data)){const S=t.data,C=e.watch(S,b=>{l.reset(),b&&l.addRows(b),r()});e.onScopeDispose(()=>C())}return{core:n,table:l,visibleRows:o,tableState:s,pinnedColumns:v,columnWidths:c,setSort:(S,C)=>{l.setSort(S,C),r()},setSorts:S=>{l.setSorts(S),r()},clearSort:()=>{l.clearSort(),r()},addFilter:S=>{l.addFilter(S),r()},removeFilter:S=>{l.removeFilter(S),r()},clearFilters:()=>{l.clearFilters(),r()},setFilterFn:S=>{l.setFilterFn(S),r()},setPage:S=>{l.setPage(S),r()},nextPage:()=>{l.nextPage(),r()},prevPage:()=>{l.prevPage(),r()},pinColumn:(S,C)=>{l.pinColumn(S,C),v.value=l.getPinnedColumns()},clearPinned:()=>{l.clearPinned(),v.value=l.getPinnedColumns()},setColumnWidth:(S,C)=>{l.setColumnWidth(S,C),c.value=l.getColumnWidths()},clearColumnWidths:()=>{l.clearColumnWidths(),c.value=l.getColumnWidths()},refresh:r}}function Kl(t){const n=je.createCore(),l=je.createTree(n,t);t!=null&&t.data&&l.setData(t.data);const a=e.ref(l.getState()),o=e.ref(l.getFlatNodes()),s=()=>{a.value=l.getState(),o.value=l.getFlatNodes()};return{core:n,tree:l,treeState:a,flatNodes:o,expand:z=>{l.expand(z),s()},collapse:z=>{l.collapse(z),s()},toggleExpand:z=>{l.toggleExpand(z),s()},setExpandedKeys:z=>{l.setExpandedKeys(z),s()},expandAll:()=>{l.expandAll(),s()},collapseAll:()=>{l.collapseAll(),s()},expandToLevel:z=>{l.expandAll();const K=l.getFlatNodes(),L=[];for(const I of K)I.depth<z&&!I.isLeaf&&L.push(I.key);l.setExpandedKeys(L),s()},check:z=>{l.check(z),s()},uncheck:z=>{l.uncheck(z),s()},toggleCheck:z=>{l.toggleCheck(z),s()},setCheckedKeys:z=>{l.setCheckedKeys(z),s()},checkAll:()=>{l.setCheckedKeys(l.getAllKeys()),s()},uncheckAll:()=>{l.setCheckedKeys([]),s()},select:(z,K)=>{l.select(z,K),s()},deselect:z=>{l.deselect(z),s()},setSelectedKeys:z=>{l.setSelectedKeys(z),s()},markLoading:z=>{l.markLoading(z),s()},markLoaded:z=>{l.markLoaded(z),s()},addChildren:(z,K)=>{l.addChildren(z,K),s()},moveNode:(z,K,L)=>{const I=l.moveNode(z,K,L);return s(),I},filterNodes:z=>{l.filterNodes(z),s()},getNodePath:z=>{const K=[];let L=z;for(;L!==null;)K.unshift(L),L=l.getParentKey(L);return K},refresh:s}}function Va(t={}){const{core:n,...l}=t,a=n??je.createCore(),o=je.createGraph(a,l),s=e.ref(o.getState()),v=o.subscribe(()=>{s.value=o.getState()});return e.onScopeDispose(()=>{v()}),{graph:o,state:s,core:a}}const Da=["a[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])','[contenteditable="true"]'].join(", ");function za(t){var l,a,o;if(t.hasAttribute("aria-hidden")&&t.getAttribute("aria-hidden")==="true"||t.hasAttribute("hidden"))return!0;let n=t;for(;n;){const s=(o=(a=((l=n.ownerDocument)==null?void 0:l.defaultView)??globalThis).getComputedStyle)==null?void 0:o.call(a,n);if(s&&(s.display==="none"||s.visibility==="hidden"))return!0;n=n.parentElement}return!1}function xl(t){return Array.from(t.querySelectorAll(Da)).filter(n=>!za(n))}function Pt(t){const n=e.ref(null);let l=null,a=null;const o=i=>{if(i.key!=="Tab")return;const d=a;if(!d)return;const u=xl(d);if(u.length===0){i.preventDefault(),d.focus();return}const p=u[0],m=u[u.length-1],k=document.activeElement;i.shiftKey?(k===p||!d.contains(k))&&(i.preventDefault(),m.focus()):(k===m||!d.contains(k))&&(i.preventDefault(),p.focus())},s=()=>{a&&(a.removeEventListener("keydown",o),a=null,l&&typeof l.focus=="function"&&(l.focus(),l=null))},v=i=>{a!==i&&(s(),a=i,l=document.activeElement,i.addEventListener("keydown",o),typeof requestAnimationFrame<"u"&&requestAnimationFrame(()=>{const d=xl(i);d.length>0?d[0].focus():(i.hasAttribute("tabindex")||i.setAttribute("tabindex","-1"),i.focus())}))},c=()=>typeof t=="function"?t():t.value,r=()=>{c()&&n.value?v(n.value):s()};return e.watch([n,()=>c()],r,{flush:"sync"}),e.onMounted(r),e.onScopeDispose(()=>{s()}),n}function Ta(t,n={}){const{orientation:l="vertical",loop:a=!0}=n,o=e.ref(0),s=[],v=()=>e.isRef(t)?t.value:t,c=u=>p=>{s[u]=p},r=u=>{var p;o.value=u,(p=s[u])==null||p.focus()},i=u=>{const p=v();let m=o.value;const k=l!=="horizontal"&&u.key==="ArrowDown"||l!=="vertical"&&u.key==="ArrowRight",f=l!=="horizontal"&&u.key==="ArrowUp"||l!=="vertical"&&u.key==="ArrowLeft";if(k)u.preventDefault(),m=o.value+1,m>=p&&(m=a?0:p-1);else if(f)u.preventDefault(),m=o.value-1,m<0&&(m=a?p-1:0);else if(u.key==="Home")u.preventDefault(),m=0;else if(u.key==="End")u.preventDefault(),m=p-1;else return;r(m)};return{activeIndex:o,setActiveIndex:r,getItemProps:u=>({ref:c(u),tabindex:u===o.value?0:-1,onFocus:()=>{o.value=u},onKeydown:i}),handleKeyDown:i}}function La(t){const{itemCount:n,loop:l=!0,onSelect:a,typeaheadTimeout:o=500}=t,s=e.ref(-1),v=[],c=[];let r="",i;const d=()=>e.isRef(n)?n.value:n,u=f=>w=>{v[f]=w},p=f=>{c.length=0,c.push(...f)},m=f=>{var B;const w=d();f<0||f>=w||(s.value=f,(B=v[f])==null||B.focus())};return{activeIndex:s,setActiveIndex:m,setItemRef:u,setLabels:p,handleKeyDown:f=>{var B;const w=d();switch(f.key){case"ArrowDown":{f.preventDefault();let E=s.value+1;E>=w&&(E=l?0:w-1),m(E);break}case"ArrowUp":{f.preventDefault();let E=s.value-1;E<0&&(E=l?w-1:0),m(E);break}case"Home":{f.preventDefault(),m(0);break}case"End":{f.preventDefault(),m(w-1);break}case"Enter":case" ":{f.preventDefault(),s.value>=0&&(a==null||a(s.value));break}case"Escape":{f.preventDefault(),s.value=-1;break}default:if(f.key.length===1&&!f.ctrlKey&&!f.metaKey){i&&clearTimeout(i),r+=f.key.toLowerCase(),i=setTimeout(()=>{r=""},o);const E=r,N=s.value>=0?s.value+1:0;for(let x=0;x<w;x++){const y=(N+x)%w;if((((B=c[y])==null?void 0:B.toLowerCase())??"").startsWith(E)){m(y);break}}}}}}}function ht(t){return e.isRef(t)?t.value:t}function nl(t){const n=ht(t.itemCount),l=ht(t.itemHeight),a=t.overscan!==void 0?ht(t.overscan):void 0,o=je.createVirtual({itemCount:n,itemHeight:l,overscan:a}),s=e.ref(null),v=e.ref(o.getRange(0,0)),c=()=>{const m=s.value;if(!m){v.value=o.getRange(0,0);return}v.value=o.getRange(m.scrollTop,m.clientHeight)},r=(m,k="start")=>{const f=s.value;f&&(f.scrollTop=o.scrollToIndex(m,f.clientHeight,k))};e.watch(()=>ht(t.itemCount),m=>{o.setItemCount(m),c()}),e.watch(()=>ht(t.itemHeight),m=>{o.setItemHeight(m),c()});let i=null,d=null,u=null;const p=m=>{u!==m&&(u&&(d&&u.removeEventListener("scroll",d),i==null||i.disconnect(),i=null),u=m,m&&(d=()=>c(),m.addEventListener("scroll",d,{passive:!0}),typeof ResizeObserver<"u"&&(i=new ResizeObserver(()=>c()),i.observe(m)),c()))};return e.watch(s,m=>p(m),{flush:"post"}),e.onMounted(()=>{p(s.value)}),e.onScopeDispose(()=>{p(null)}),{range:v,containerRef:s,scrollToIndex:r,engine:o}}function Ma(t,n){const l=je.createHistory(t,n),a=e.ref(l.cursor),o=e.ref([...l.entries]),s=()=>{a.value=l.cursor,o.value=[...l.entries]};let v=!1;const c=()=>{v||(v=!0,queueMicrotask(()=>{v=!1,s()}))},r=t.use((m,k)=>{k(m),c()}),i=()=>{l.undo(),s()},d=()=>{l.redo(),s()},u=m=>{l.jumpTo(m),s()},p=()=>{l.clear(),s()};return e.onScopeDispose(()=>{r(),l.destroy()}),{history:l,canUndo:e.computed(()=>a.value>=0),canRedo:e.computed(()=>a.value<o.value.length-1),cursor:e.computed(()=>a.value),entries:o,undo:i,redo:d,jumpTo:u,clear:p}}const Fa=["dir","data-sg-theme"],kt=Symbol("sg-config"),Ol={},Aa=e.computed(()=>Ol),Pa={colorPrimary:"--sg-color-primary",colorSuccess:"--sg-color-success",colorWarning:"--sg-color-warning",colorError:"--sg-color-error",colorText:"--sg-color-text",colorBg:"--sg-color-bg",colorBorder:"--sg-color-border",borderRadius:"--sg-border-radius",fontSize:"--sg-font-size",fontFamily:"--sg-font-sans"},Ra=new Set(["borderRadius","fontSize"]);function Hl(t){const n={};if(!t)return n;if(t.token)for(const l of Object.keys(t.token)){const a=t.token[l];if(a==null)continue;const o=Pa[l];o&&(n[o]=typeof a=="number"&&Ra.has(l)?`${a}px`:String(a))}if(t.cssVars)for(const[l,a]of Object.entries(t.cssVars))a!=null&&(n[l.startsWith("--")?l:`--${l}`]=String(a));return n}function Ia(t,n){return t?n?{mode:n.mode??t.mode,token:{...t.token,...n.token},cssVars:{...t.cssVars,...n.cssVars}}:t:n}function Ce(){return e.inject(kt,void 0)??Aa}function _e(t,n={}){const l=e.inject(kt,void 0),a=e.computed(()=>t.size??(l==null?void 0:l.value.size)??n.size??"middle"),o=e.computed(()=>t.disabled??(l==null?void 0:l.value.disabled)??n.disabled??!1),s=e.computed(()=>t.direction??(l==null?void 0:l.value.direction)??n.direction??"ltr");return{resolvedSize:a,resolvedDisabled:o,resolvedDirection:s}}const Ka=e.defineComponent({__name:"ConfigProvider",props:{size:{type:String,default:void 0},disabled:{type:Boolean,default:void 0},bordered:{type:Boolean,default:void 0},direction:{type:String,default:void 0},locale:{type:Object,default:void 0},theme:{type:Object,default:void 0},getPopupContainer:{type:Function,default:void 0},getTargetContainer:{type:Function,default:void 0},renderEmpty:{type:Function,default:void 0},csp:{type:Object,default:void 0}},setup(t){const n=t,l=e.inject(kt,void 0),a=e.computed(()=>{const r=(l==null?void 0:l.value)??Ol;return{size:n.size??r.size,disabled:n.disabled??r.disabled,bordered:n.bordered??r.bordered,direction:n.direction??r.direction,locale:n.locale?r.locale?{...r.locale,...n.locale}:n.locale:r.locale,theme:Ia(r.theme,n.theme),getPopupContainer:n.getPopupContainer??r.getPopupContainer,getTargetContainer:n.getTargetContainer??r.getTargetContainer,renderEmpty:n.renderEmpty??r.renderEmpty,csp:n.csp??r.csp}});e.provide(kt,a);const o=e.computed(()=>Hl(n.theme)),s=e.computed(()=>{var r;return(r=n.theme)==null?void 0:r.mode}),v=e.computed(()=>{var r;return!!(n.direction||(r=n.theme)!=null&&r.mode||Object.keys(o.value).length>0)}),c=e.computed(()=>({display:"contents",...o.value}));return(r,i)=>v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-config-provider",style:e.normalizeStyle(c.value),dir:n.direction,"data-sg-theme":s.value},[e.renderSlot(r.$slots,"default")],12,Fa)):e.renderSlot(r.$slots,"default",{key:1})}}),vt=Symbol("sg-form-context"),Oa={key:0,class:"sg-input-prefix"},Ha=["id","type","value","placeholder","disabled","readonly","aria-readonly","aria-invalid","aria-required","aria-describedby"],ja=["aria-label"],_a={key:2,class:"sg-spin sg-spin-small","aria-hidden":"true"},Ya={key:3,class:"sg-input-suffix"},Mt=e.defineComponent({__name:"Input",props:{modelValue:{default:""},value:{},placeholder:{},type:{default:"text"},size:{default:void 0},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},id:{},allowClear:{type:Boolean,default:!1},status:{},unstyled:{type:Boolean},loading:{type:Boolean},ariaInvalid:{},ariaRequired:{},ariaDescribedby:{}},emits:["update:modelValue","change","focus","blur","clear"],setup(t,{emit:n}){const l=t,a=e.inject(vt,null),o=e.computed(()=>l.size??(a==null?void 0:a.size)??"middle"),s=n,v=e.computed(()=>l.value??l.modelValue??""),c=e.computed(()=>l.unstyled?"":["sg-input-wrapper",`sg-input-wrapper-${o.value}`,l.loading?"sg-input-wrapper-loading":"",l.readOnly?"sg-input-wrapper-readonly":"",l.status?`sg-input-wrapper-status-${l.status}`:""].filter(Boolean).join(" ")),r=e.computed(()=>l.unstyled?"":["sg-input",`sg-input-${o.value}`,l.readOnly?"sg-input-readonly":"",l.status?`sg-input-status-${l.status}`:""].filter(Boolean).join(" "));function i(N){const x=N.target;s("update:modelValue",x.value),s("change",x.value)}function d(N){s("focus",N)}function u(N){s("blur",N)}function p(){s("update:modelValue",""),s("change",""),s("clear")}const m=e.computed(()=>l.allowClear&&!l.disabled&&!l.readOnly&&!!v.value),k=e.useSlots(),f=e.computed(()=>!!k.prefix),w=e.computed(()=>!!k.suffix),B=Ce(),E=e.computed(()=>{var N,x;return((x=(N=B.value.locale)==null?void 0:N.input)==null?void 0:x.clear)??"Clear"});return(N,x)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(c.value)},[f.value?(e.openBlock(),e.createElementBlock("span",Oa,[e.renderSlot(N.$slots,"prefix")])):e.createCommentVNode("",!0),e.createElementVNode("input",{id:t.id,type:t.type,class:e.normalizeClass(r.value),value:v.value,placeholder:t.placeholder,disabled:t.disabled||t.loading,readonly:t.readOnly,"aria-readonly":t.readOnly||void 0,"aria-invalid":t.ariaInvalid??(t.status==="error"||void 0),"aria-required":t.ariaRequired,"aria-describedby":t.ariaDescribedby,onInput:i,onFocus:d,onBlur:u},null,42,Ha),m.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"sg-input-clear","aria-label":E.value,onClick:p}," × ",8,ja)):e.createCommentVNode("",!0),t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",_a)):e.createCommentVNode("",!0),w.value?(e.openBlock(),e.createElementBlock("span",Ya,[e.renderSlot(N.$slots,"suffix")])):e.createCommentVNode("",!0)],2))}}),Wa=["aria-checked","checked","disabled"],Ua={key:0,class:"sg-checkbox-box","aria-hidden":"true"},qa={key:2,class:"sg-spin sg-spin-small","aria-hidden":"true"},at=e.defineComponent({__name:"Checkbox",props:{modelValue:{type:Boolean,default:void 0},checked:{type:Boolean,default:void 0},defaultChecked:{type:Boolean,default:void 0},indeterminate:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},unstyled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){const l=t,a=n,o=e.ref(l.modelValue??l.checked??l.defaultChecked??!1);e.watch(()=>l.modelValue??l.checked,p=>{p!==void 0&&(o.value=p)});const s=e.computed(()=>l.modelValue??l.checked??o.value),v=e.ref(null);function c(){const p=v.value;if(!p)return;const m=!!s.value;p.checked!==m&&(p.checked=m),p.indeterminate=l.indeterminate??!1}e.onMounted(c),e.watch([()=>s.value,()=>l.indeterminate],()=>c(),{flush:"post"});function r(p){const m=p.target.checked;o.value=m,a("update:modelValue",m),a("change",m)}const i=e.computed(()=>l.unstyled?"":["sg-checkbox",l.disabled||l.loading?"sg-checkbox-disabled":"",l.loading?"sg-checkbox-loading":""].filter(Boolean).join(" ")),d=e.useSlots(),u=e.computed(()=>d.default!==void 0);return(p,m)=>(e.openBlock(),e.createElementBlock("label",{class:e.normalizeClass(i.value)},[e.createElementVNode("input",{ref_key:"inputRef",ref:v,type:"checkbox",class:e.normalizeClass(t.unstyled?"":"sg-checkbox-input"),"aria-checked":s.value,checked:s.value,disabled:t.disabled||t.loading,onChange:r},null,42,Wa),t.unstyled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Ua)),u.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(t.unstyled?"":"sg-checkbox-label")},[e.renderSlot(p.$slots,"default")],2)):e.createCommentVNode("",!0),t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",qa)):e.createCommentVNode("",!0)],2))}}),Xa=["type","disabled","aria-disabled","aria-busy"],Ga={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},Ye=e.defineComponent({__name:"Button",props:{type:{type:String,default:"default"},size:{type:String,default:void 0},htmlType:{type:String,default:"button"},danger:{type:Boolean,default:!1},block:{type:Boolean,default:!1},disabled:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},unstyled:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:n}){const l=t,a=n,{resolvedSize:o,resolvedDisabled:s}=_e({size:void 0,disabled:void 0},{}),v=e.computed(()=>l.size??o.value),c=e.computed(()=>l.disabled??s.value),r=e.computed(()=>l.unstyled?"":["sg-button",`sg-button-${l.type}`,`sg-button-${v.value}`,l.danger?"sg-button-danger":"",l.block?"sg-button-block":"",l.loading?"sg-button-loading":""].filter(Boolean).join(" ")),i=e.computed(()=>c.value||l.loading);function d(u){if(i.value){u.preventDefault(),u.stopPropagation();return}a("click",u)}return(u,p)=>(e.openBlock(),e.createElementBlock("button",{type:t.htmlType,class:e.normalizeClass(r.value),disabled:i.value,"aria-disabled":i.value,"aria-busy":t.loading||void 0,onClick:d},[t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",Ga)):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"icon"),e.renderSlot(u.$slots,"default")],10,Xa))}}),Ja=["aria-label"],Za=["disabled"],Qa={key:0},en=["aria-current","onClick"],tn=["disabled"],ln=["aria-label"],an=["disabled"],nn={class:"sg-pagination-simple-pager"},on=["disabled"],sn=["aria-label"],rn={key:0,class:"sg-pagination-total"},cn=["disabled"],un={key:0,class:"sg-pagination-ellipsis"},dn=["aria-current","onClick"],mn=["disabled"],pn=["value","disabled"],vn=["value"],gn={key:2,class:"sg-pagination-quick-jumper"},fn=["value","disabled"],bt=e.defineComponent({__name:"Pagination",props:{current:{type:Number,required:!0},total:{type:Number,required:!0},pageSize:{type:Number,default:10},showTotal:{type:[Boolean,Function],default:!1},disabled:{type:Boolean,default:void 0},simple:{type:Boolean,default:!1},showSizeChanger:{type:Boolean,default:!1},pageSizeOptions:{type:Array,default:()=>[10,20,50,100]},showQuickJumper:{type:Boolean,default:!1},unstyled:{type:Boolean,default:!1}},emits:["change","pageSizeChange"],setup(t,{emit:n}){const l=t,a=n,{resolvedDisabled:o}=_e({disabled:void 0},{}),s=e.computed(()=>l.disabled??o.value),v=Ce(),c=e.computed(()=>{var z,K;return((K=(z=v.value.locale)==null?void 0:z.pagination)==null?void 0:K.totalPrefix)??"Total"}),r=e.computed(()=>{var z,K;return((K=(z=v.value.locale)==null?void 0:z.pagination)==null?void 0:K.itemsPerPage)??"/ page"}),i=e.computed(()=>{var z,K;return((K=(z=v.value.locale)==null?void 0:z.pagination)==null?void 0:K.jump)??"Go to"}),d=e.computed(()=>{var z,K;return((K=(z=v.value.locale)==null?void 0:z.pagination)==null?void 0:K.ariaLabel)??"Pagination"}),u=e.ref(""),p=e.computed(()=>Math.max(1,Math.ceil(l.total/l.pageSize))),m=e.computed(()=>Math.min(Math.max(1,l.current),p.value)),k=e.computed(()=>(m.value-1)*l.pageSize+1),f=e.computed(()=>Math.min(m.value*l.pageSize,l.total)),w=e.useSlots(),B=e.computed(()=>!!w.total),E=e.computed(()=>B.value||l.showTotal===!0||typeof l.showTotal=="function"),N=e.computed(()=>typeof l.showTotal=="function"),x={render(){return typeof l.showTotal!="function"?null:l.showTotal(l.total,[k.value,f.value])}};function y(z){s.value||z<1||z>p.value||z===m.value||a("change",z)}function P(){const z=parseInt(u.value,10);Number.isNaN(z)||y(z),u.value=""}function S(z){var L;if(s.value)return;const K=(L=z.target)==null?void 0:L.tagName;if(!(K==="INPUT"||K==="SELECT"))switch(z.key){case"ArrowLeft":z.preventDefault(),y(m.value-1);break;case"ArrowRight":z.preventDefault(),y(m.value+1);break;case"Home":z.preventDefault(),y(1);break;case"End":z.preventDefault(),y(p.value);break}}function C(z,K){return K<=7?Array.from({length:K},(L,I)=>I+1):z<=4?[1,2,3,4,5,"...",K]:z>=K-3?[1,"...",K-4,K-3,K-2,K-1,K]:[1,"...",z-1,z,z+1,"...",K]}const b=e.computed(()=>C(m.value,p.value)),$=e.computed(()=>["sg-pagination",s.value?"sg-pagination-disabled":""].filter(Boolean).join(" ")),T=e.computed(()=>["sg-pagination","sg-pagination-simple",s.value?"sg-pagination-disabled":""].filter(Boolean).join(" "));return(z,K)=>t.unstyled?(e.openBlock(),e.createElementBlock("nav",{key:0,"aria-label":d.value,onKeydown:S},[e.createElementVNode("button",{type:"button",disabled:m.value<=1,onClick:K[0]||(K[0]=L=>y(m.value-1))},"‹",8,Za),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(L,I)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`p${I}-${L}`},[L==="..."?(e.openBlock(),e.createElementBlock("span",Qa,"…")):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button","aria-current":L===m.value?"page":void 0,onClick:U=>y(L)},e.toDisplayString(L),9,en))],64))),128)),e.createElementVNode("button",{type:"button",disabled:m.value>=p.value,onClick:K[1]||(K[1]=L=>y(m.value+1))}," › ",8,tn)],40,Ja)):t.simple?(e.openBlock(),e.createElementBlock("nav",{key:1,class:e.normalizeClass(T.value),"aria-label":d.value,onKeydown:S},[e.createElementVNode("button",{type:"button",class:"sg-pagination-item sg-pagination-prev",disabled:m.value<=1,onClick:K[2]||(K[2]=L=>y(m.value-1))}," ‹ ",8,an),e.createElementVNode("span",nn,e.toDisplayString(m.value)+" / "+e.toDisplayString(p.value),1),e.createElementVNode("button",{type:"button",class:"sg-pagination-item sg-pagination-next",disabled:m.value>=p.value,onClick:K[3]||(K[3]=L=>y(m.value+1))}," › ",8,on)],42,ln)):(e.openBlock(),e.createElementBlock("nav",{key:2,class:e.normalizeClass($.value),"aria-label":d.value,onKeydown:S},[E.value?(e.openBlock(),e.createElementBlock("span",rn,[e.renderSlot(z.$slots,"total",{total:t.total,range:[k.value,f.value]},()=>[N.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(x),{key:0})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(c.value)+" "+e.toDisplayString(t.total),1)],64))])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"sg-pagination-item sg-pagination-prev",disabled:m.value<=1,onClick:K[4]||(K[4]=L=>y(m.value-1))}," ‹ ",8,cn),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(L,I)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`p${I}-${L}`},[L==="..."?(e.openBlock(),e.createElementBlock("span",un,"…")):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(`sg-pagination-item${L===m.value?" sg-pagination-item-active":""}`),"aria-current":L===m.value?"page":void 0,onClick:U=>y(L)},e.toDisplayString(L),11,dn))],64))),128)),e.createElementVNode("button",{type:"button",class:"sg-pagination-item sg-pagination-next",disabled:m.value>=p.value,onClick:K[5]||(K[5]=L=>y(m.value+1))}," › ",8,mn),t.showSizeChanger?(e.openBlock(),e.createElementBlock("select",{key:1,class:"sg-pagination-size-changer",value:t.pageSize,disabled:s.value,onChange:K[6]||(K[6]=L=>a("pageSizeChange",Number(L.target.value)))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.pageSizeOptions,L=>(e.openBlock(),e.createElementBlock("option",{key:L,value:L},e.toDisplayString(L)+" "+e.toDisplayString(r.value),9,vn))),128))],40,pn)):e.createCommentVNode("",!0),t.showQuickJumper?(e.openBlock(),e.createElementBlock("span",gn,[e.createTextVNode(e.toDisplayString(i.value)+" ",1),e.createElementVNode("input",{type:"text",class:"sg-pagination-jumper-input",value:u.value,disabled:s.value,onInput:K[7]||(K[7]=L=>u.value=L.target.value),onKeydown:e.withKeys(P,["enter"]),onBlur:P},null,40,fn)])):e.createCommentVNode("",!0)],42,sn))}}),hn=["aria-label"],yn=["aria-label"],kn=["aria-label"],Ct=e.defineComponent({__name:"Spin",props:{spinning:{type:Boolean,default:!0},size:{},delay:{},tip:{},fullscreen:{type:Boolean,default:!1},unstyled:{type:Boolean}},setup(t){const n=t,{resolvedSize:l}=_e({size:void 0},{}),a=e.computed(()=>n.size??l.value),o=Ce(),s=e.computed(()=>{var m,k;return((k=(m=o.value.locale)==null?void 0:m.spin)==null?void 0:k.loading)??"Loading"}),v=e.ref(n.delay?!1:n.spinning);let c;e.watch(()=>[n.spinning,n.delay],([m,k])=>{if(c&&clearTimeout(c),!k){v.value=!!m;return}m?c=setTimeout(()=>{v.value=!0},k):v.value=!1},{immediate:!0}),e.onBeforeUnmount(()=>{c&&clearTimeout(c)});const r=e.computed(()=>a.value==="middle"?"default":a.value),i=e.computed(()=>n.unstyled?"":`sg-spin sg-spin-${r.value}`),d=e.useSlots(),u=e.computed(()=>!!d.default),p=e.computed(()=>!!d.indicator);return(m,k)=>!v.value&&!u.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[],64)):!v.value&&u.value?e.renderSlot(m.$slots,"default",{key:1}):t.fullscreen?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.unstyled?"":"sg-spin-fullscreen")},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-spin-fullscreen-inner")},[p.value?e.renderSlot(m.$slots,"indicator",{key:0}):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(i.value),role:"status","aria-live":"polite","aria-label":s.value},null,10,hn)),t.tip?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.unstyled?"":"sg-spin-tip")},e.toDisplayString(t.tip),3)):e.createCommentVNode("",!0)],2)],2)):u.value?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(t.unstyled?"":"sg-spin-container")},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-spin-overlay")},[p.value?e.renderSlot(m.$slots,"indicator",{key:0}):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(i.value),role:"status","aria-live":"polite","aria-label":s.value},null,10,kn)),t.tip?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.unstyled?"":"sg-spin-tip")},e.toDisplayString(t.tip),3)):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(v.value&&!t.unstyled?"sg-spin-blur":"")},[e.renderSlot(m.$slots,"default")],2)],2)):(e.openBlock(),e.createElementBlock("span",{key:3,class:e.normalizeClass(t.unstyled?"":"sg-spin-standalone")},[p.value?e.renderSlot(m.$slots,"indicator",{key:0}):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(i.value),role:"status","aria-live":"polite","aria-label":s.value},null,10,yn)),t.tip?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.unstyled?"":"sg-spin-tip")},e.toDisplayString(t.tip),3)):e.createCommentVNode("",!0)],2))}}),jl={emptyText:"No data",filterReset:"Reset",filterConfirm:"OK",filterAll:"All",searchPlaceholder:"Search...",sortAsc:"▲",sortDesc:"▼",filterIcon:"▾",loadingText:"Loading…",totalRows:t=>`${t} rows`,selectedRows:t=>`${t} selected`,expandIcon:"›"},bn={class:"sg-table-toolbar-right"},Bn=["aria-busy"],Cn=["draggable","onDragstart","onDragover","onDragleave","onDrop","onDragend","aria-sort","onClick"],wn={class:"sg-table-th-content"},Sn={class:"sg-table-th-title"},En={key:0,class:"sg-table-sort-arrows"},xn=["aria-label","onClick"],$n={class:"sg-table-filter-list"},Nn=["checked","onChange"],Vn={class:"sg-table-filter-actions"},Dn=["onClick"],zn=["onMousedown"],Tn={key:0,class:"sg-table-row sg-table-row-empty",role:"row",style:{display:"contents"}},Ln=["data-sg-virtual-row-index","onClick"],Mn=["aria-expanded","aria-label","onClick"],Fn=["checked","aria-label","onChange"],An=["onDblclick"],Pn=["aria-label","onClick"],Rn={key:2,class:"sg-table-cell-content"},In={key:0,class:"sg-table-row sg-table-row-expanded-wrapper",role:"row",style:{display:"contents"}},Kn={key:0,class:"sg-table-td sg-table-footer-cell",role:"cell"},On={key:1,class:"sg-table-td sg-table-footer-cell",role:"cell"},Hn={key:0,class:"sg-table-aggregate-value"},jn={key:0,class:"sg-table-td sg-table-summary-cell",role:"cell"},_n={key:1,class:"sg-table-td sg-table-summary-cell",role:"cell"},Yn={key:1,class:"sg-table-loading-mask",role:"status","aria-live":"polite"},Wn={class:"sg-table-pagination-total"},$l=150,Wt=50,Nl=40,Vl=48,Un=e.defineComponent({__name:"Table",props:{columns:{},data:{},pageSize:{},rowSelection:{},expandable:{},tree:{},bordered:{type:Boolean,default:!1},size:{default:"middle"},sticky:{type:Boolean,default:!1},draggable:{type:Boolean},onColumnOrderChange:{},locale:{},rowClassName:{},searchable:{type:Boolean,default:!1},searchValue:{},showPagination:{type:Boolean,default:!0},unstyled:{type:Boolean,default:!1},classNames:{},styles:{},loading:{type:Boolean,default:!1},scroll:{},summary:{},onCellEdit:{},virtual:{type:[Boolean,Object]},footer:{type:Boolean},striped:{type:Boolean},highlightOnHover:{type:Boolean,default:!0}},emits:["rowClick","pageChange","sortChange","cellEdit","expand","columnOrderChange"],setup(t,{expose:n,emit:l}){const a=t,o=l,s=e.useSlots(),v=Ce(),c=e.computed(()=>{var D,j;return((j=(D=v.value.locale)==null?void 0:D.table)==null?void 0:j.selectAll)??"Select all"}),r=e.computed(()=>({...jl,...a.locale})),i=e.computed(()=>a.classNames??{}),d=e.computed(()=>a.styles??{});function u(D){return!D.children||D.children.length===0?1:1+Math.max(...D.children.map(u))}function p(D){return!D.children||D.children.length===0?D.hidden?0:1:D.children.reduce((j,J)=>j+p(J),0)}const m=e.computed(()=>a.columns.some(D=>D.children&&D.children.length>0)),k=e.computed(()=>a.columns.length===0?1:Math.max(...a.columns.map(u))),f=e.ref([]),w=e.ref(null),B=e.ref(null),E=e.computed(()=>{const D=[],j=J=>{J.hidden||(!J.children||J.children.length===0?D.push(J):J.children.forEach(j))};return a.columns.forEach(j),D});e.watch(E,D=>{const j=D.map(pe=>pe.key),J=new Set(f.value),ce=j.filter(pe=>!J.has(pe)),_=f.value.filter(pe=>j.includes(pe));f.value=[..._,...ce]},{immediate:!0});const N=e.computed(()=>{const D=E.value;if(m.value||!a.draggable)return D;const j=new Map(D.map(J=>[J.key,J]));return f.value.filter(J=>j.has(J)).map(J=>j.get(J))}),x=e.computed(()=>{const D=k.value,j=Array.from({length:D},()=>[]);if(!m.value&&a.draggable&&D===1){for(const ce of N.value)j[0].push({col:ce,colSpan:1,rowSpan:1});return j}const J=(ce,_)=>{if(ce.hidden)return;if(!!(ce.children&&ce.children.length>0)){const Re=p(ce);Re>0&&(j[_].push({col:ce,colSpan:Re,rowSpan:1}),ce.children.forEach(Je=>J(Je,_+1)))}else j[_].push({col:ce,colSpan:1,rowSpan:D-_})};return a.columns.forEach(ce=>J(ce,0)),j}),y=e.computed(()=>N.value);function P(D,j){w.value=j,D.dataTransfer&&(D.dataTransfer.effectAllowed="move",D.dataTransfer.setData("text/plain",j))}function S(D,j){D.preventDefault(),D.dataTransfer&&(D.dataTransfer.dropEffect="move"),B.value=j}function C(){B.value=null}function b(D,j){var pe;D.preventDefault();const J=w.value;if(!J||J===j){w.value=null,B.value=null;return}const ce=f.value.filter(Re=>Re!==J),_=ce.indexOf(j);ce.splice(_<0?ce.length:_,0,J),f.value=ce,(pe=a.onColumnOrderChange)==null||pe.call(a,ce),o("columnOrderChange",ce),w.value=null,B.value=null}function $(){w.value=null,B.value=null}function T(D){return!!a.draggable&&!m.value&&!D.fixed&&!(D.children&&D.children.length>0)}const{table:z,visibleRows:K,tableState:L,setSort:I,clearSort:U,addFilter:O,clearFilters:q,setPage:ae,setFilterFn:G,refresh:Y,columnWidths:M,setColumnWidth:g}=Il({pageSize:a.pageSize,data:a.data});e.watch(()=>a.pageSize,D=>{D!==void 0&&(z.setPageSize(D),Y())}),e.watch(()=>a.data,D=>{z.reset(),D&&z.addRows(D),a.virtual&&a.pageSize===void 0&&D&&z.setPageSize(D.length||1),Y()}),e.watch(()=>{var D;return[a.virtual,(D=a.data)==null?void 0:D.length]},()=>{a.virtual&&a.pageSize===void 0&&a.data&&(z.setPageSize(a.data.length||1),Y())},{immediate:!0});const h=e.ref(""),V=e.computed({get:()=>a.searchValue!==void 0?a.searchValue:h.value,set:D=>{a.searchValue===void 0&&(h.value=D)}}),F=e.computed(()=>L.value.sorts[0]??null);function R(D){if(!D.sortable)return;const j=F.value;let J="asc";j&&j.column===D.key&&(j.direction==="asc"?J="desc":j.direction==="desc"&&(J=null)),J===null?U():I(D.key,J),o("sortChange",D.key,J)}const X=e.ref([]),se=e.computed(()=>{var D;return((D=a.rowSelection)==null?void 0:D.selectedKeys)??X.value}),ie=e.computed(()=>new Set(se.value));function ne(D){var ce,_;if(!a.rowSelection)return;let j;a.rowSelection.type==="radio"?j=ie.value.has(D)?[]:[D]:j=ie.value.has(D)?se.value.filter(pe=>pe!==D):[...se.value,D],X.value=j;const J=a.data.filter(pe=>j.includes(pe.id)).map(pe=>pe.data);(_=(ce=a.rowSelection).onChange)==null||_.call(ce,j,J)}const me=e.computed(()=>K.value.length===0?!1:K.value.every(D=>ie.value.has(D.id))),ye=e.computed(()=>!me.value&&K.value.some(D=>ie.value.has(D.id)));function Me(){var ce,_;if(!a.rowSelection)return;const D=K.value.map(pe=>pe.id);let j;if(me.value)j=se.value.filter(pe=>!D.includes(pe));else{const pe=new Set(se.value);for(const Re of D)pe.add(Re);j=Array.from(pe)}X.value=j;const J=a.data.filter(pe=>j.includes(pe.id)).map(pe=>pe.data);(_=(ce=a.rowSelection).onChange)==null||_.call(ce,j,J)}const Ne=e.computed(()=>{var D;return((D=a.tree)==null?void 0:D.childrenColumnName)??"children"}),Pe=e.computed(()=>{var D;return((D=a.tree)==null?void 0:D.indentSize)??16}),Te=e.ref(new Set);function Ue(D){const j=new Set,J=ce=>{for(const _ of ce){const pe=_.data[Ne.value];pe&&pe.length>0&&(j.add(_.id),J(pe))}};return J(D),j}function qe(){var D;(D=a.tree)!=null&&D.defaultExpandAllRows?Te.value=Ue(a.data??[]):Te.value=new Set}e.onMounted(qe),e.watch(()=>{var D;return(D=a.tree)==null?void 0:D.defaultExpandAllRows},qe),e.watch(()=>a.data,()=>qe());function Z(D){const j=new Set(Te.value);j.has(D)?j.delete(D):j.add(D),Te.value=j}const te=e.computed(()=>{if(!a.tree)return K.value.map(ce=>({id:ce.id,data:ce.data,depth:0,hasChildren:!1}));const D=[],j=Ne.value,J=(ce,_)=>{for(const pe of ce){const Re=pe.data[j],Je=!!(Re&&Re.length>0);D.push({id:pe.id,data:pe.data,depth:_,hasChildren:Je}),Je&&Te.value.has(pe.id)&&J(Re,_+1)}};return J(K.value,0),D}),fe=e.ref(new Set);e.onMounted(()=>{const D=a.expandable;D!=null&&D.defaultExpandedRowKeys&&(fe.value=new Set(D.defaultExpandedRowKeys))});const Be=e.computed(()=>{const D=a.expandable;return D!=null&&D.expandedKeys?new Set(D.expandedKeys):fe.value});function Ve(D){var ce;const j=a.expandable;if(!j)return;const J=Be.value.has(D);if(j.expandedKeys===void 0){const _=new Set(fe.value);J?_.delete(D):_.add(D),fe.value=_}(ce=j.onExpand)==null||ce.call(j,!J,D),o("expand",!J,D)}function De(D){const j=a.expandable;return j?j.rowExpandable?j.rowExpandable(D):!0:!1}const Ee=e.ref(new Map),Le=e.ref(null);function Fe(){const D=y.value.filter(ce=>{var _;return ce.onFilter&&((_=Ee.value.get(ce.key))==null?void 0:_.length)}),j=a.searchable&&V.value.length>0;if(D.length===0&&!j){G(null);return}const J=j?V.value.toLowerCase():"";G(ce=>{for(const _ of D){const pe=Ee.value.get(_.key),Re=_.onFilter;if(!pe.some(Je=>Re(Je,ce)))return!1}return!(j&&!y.value.some(pe=>{const Re=ce[pe.key];return Re!=null&&String(Re).toLowerCase().includes(J)}))})}e.watch(V,()=>{Fe(),Y()},{immediate:!0});function we(D,j){!j||j.length===0?(Ee.value.delete(D.key),D.onFilter||z.removeFilter(D.key)):(Ee.value.set(D.key,j),D.onFilter||O({column:D.key,value:j[0],operator:"eq"})),Ee.value=new Map(Ee.value),Fe(),Y()}function re(D){Le.value=Le.value===D?null:D}function ve(){Le.value=null}const oe=e.ref(new Map);function ke(D){if(Le.value===D){ve();return}oe.value.set(D,[...Ee.value.get(D)??[]]),oe.value=new Map(oe.value),Le.value=D}function Ie(D,j){const J=D.filterMultiple!==!1,ce=oe.value.get(D.key)??[];let _;J?_=ce.includes(j)?ce.filter(pe=>pe!==j):[...ce,j]:_=ce.includes(j)?[]:[j],oe.value.set(D.key,_),oe.value=new Map(oe.value)}function Xe(D,j){return(oe.value.get(D.key)??[]).includes(j)}function lt(D){we(D,oe.value.get(D.key)??[]),ve()}function le(D){oe.value.set(D.key,[]),oe.value=new Map(oe.value),we(D,[]),ve()}const ue=e.ref(new Map);function de(D,j){j?ue.value.set(D,j):ue.value.delete(D)}function $e(D){if(!Le.value)return;const j=ue.value.get(Le.value);j&&j.contains(D.target)||ve()}e.onMounted(()=>document.addEventListener("mousedown",$e)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",$e));const be=e.ref(null);function Ke(D,j){j.preventDefault(),j.stopPropagation();const J=j.currentTarget,ce=J==null?void 0:J.closest(".sg-table-th"),pe=(ce==null?void 0:ce.getBoundingClientRect().width)??M.value[D.key]??D.width??150;be.value={key:D.key,startX:j.clientX,startW:pe},document.addEventListener("mousemove",We),document.addEventListener("mouseup",et)}function We(D){var _;const j=be.value;if(!j)return;const J=((_=a.columns.find(pe=>pe.key===j.key))==null?void 0:_.minWidth)??50,ce=Math.max(J,j.startW+(D.clientX-j.startX));g(j.key,ce)}function et(){be.value=null,document.removeEventListener("mousemove",We),document.removeEventListener("mouseup",et)}const ze=e.ref(null),W=e.ref("");function ee(D,j,J){ze.value={id:D,key:j},W.value=J==null?"":String(J),e.nextTick(()=>{const ce=document.querySelector(".sg-table-edit-input");ce==null||ce.focus(),ce==null||ce.select()})}function he(){var J;if(!ze.value)return;const{id:D,key:j}=ze.value;o("cellEdit",D,j,W.value),(J=a.onCellEdit)==null||J.call(a,D,j,W.value),ze.value=null}function A(){ze.value=null}function H(D){return M.value[D.key]??D.width??$l}const Q=e.computed(()=>{var D;return((D=a.scroll)==null?void 0:D.x)!=null}),ge=e.computed(()=>y.value.some(D=>!D.fixed&&M.value[D.key]==null&&D.width==null)),Se=e.computed(()=>!Q.value&&!ge.value);function xe(D){const j=M.value[D.key]!=null,J=M.value[D.key]??D.width??$l;return Q.value?D.fixed||j?`${J}px`:`${J}px`:D.fixed||j?`${J}px`:D.width==null?`minmax(${Wt}px, 1fr)`:Se.value?`minmax(${Wt}px, ${J}fr)`:`minmax(${Wt}px, ${J}px)`}const Ae=e.computed(()=>(a.expandable?1:0)+(a.rowSelection?1:0)),Oe=e.computed(()=>Ae.value+y.value.length),Qe=e.computed(()=>{const D=[];a.expandable&&D.push(`${Nl}px`),a.rowSelection&&D.push(`${Vl}px`);for(const j of y.value)D.push(xe(j));return D.join(" ")}),Ge=e.computed(()=>{const D={},j={};let J=0;a.expandable&&(J+=Nl),a.rowSelection&&(J+=Vl);for(const _ of y.value)_.fixed==="left"&&(D[_.key]=J,J+=H(_));let ce=0;for(const _ of[...y.value].reverse())_.fixed==="right"&&(j[_.key]=ce,ce+=H(_));return{left:D,right:j}});function tt(D,j=!1){const J={};return D.align&&(J.textAlign=D.align),D.fixed==="left"&&(J.position="sticky",J.left=`${Ge.value.left[D.key]??0}px`,J.zIndex=j?4:2),D.fixed==="right"&&(J.position="sticky",J.right=`${Ge.value.right[D.key]??0}px`,J.zIndex=j?4:2),J}const gt=e.computed(()=>L.value.totalPages);function xt(D){D<1||D>gt.value||(ae(D),o("pageChange",D))}const $t=e.computed(()=>a.summary?a.summary(K.value):[]);function Nt(D){if(!D.aggregate)return null;const j=K.value.map(ce=>ce.data[D.key]);if(typeof D.aggregate=="function")return D.aggregate(j);const J=j.map(Number).filter(ce=>!Number.isNaN(ce));if(J.length===0)return D.aggregate==="count"?j.length:"-";switch(D.aggregate){case"sum":return Math.round(J.reduce((ce,_)=>ce+_,0)*100)/100;case"avg":return Math.round(J.reduce((ce,_)=>ce+_,0)/J.length*100)/100;case"count":return j.length;case"min":return Math.min(...J);case"max":return Math.max(...J)}return null}const He=e.computed(()=>{if(!a.virtual)return null;const D=a.virtual,j=typeof D=="object";return{rowHeight:j?D.rowHeight??40:40,estimateRowHeight:j?D.estimateRowHeight:void 0,overscan:j?D.overscan??5:5,height:j?D.height:void 0}}),ct=e.ref(null),ft=e.ref(null),Ht=e.ref(0),kl=e.ref(0),jt=e.ref(0);function bl(D,j,J){if(typeof D=="number"&&j==null)return D;const ce=typeof D=="number"?D:40,_=j??(typeof D=="function"?D:void 0);return _?pe=>{const Re=J[pe];if(!Re)return ce;const Je=_(Re.data,Re.id);return Number.isFinite(Je)&&Je>=0?Je:ce}:ce}function ha(){if(!He.value){ct.value=null;return}if(!ct.value){const D=je.createVirtual({itemCount:te.value.length,itemHeight:bl(He.value.rowHeight,He.value.estimateRowHeight,te.value),overscan:He.value.overscan});D.subscribe(()=>{jt.value++}),ct.value=D}}e.watch(He,ha,{immediate:!0}),e.watch([te,He],()=>{const D=ct.value,j=He.value;if(!(!D||!j)&&(D.setItemCount(te.value.length),D.setItemHeight(bl(j.rowHeight,j.estimateRowHeight,te.value)),typeof j.rowHeight=="function")){const J=j.rowHeight;for(let ce=0;ce<te.value.length;ce++){const _=te.value[ce];if(!_)continue;const pe=J(_.data,_.id);Number.isFinite(pe)&&pe>=0&&D.setMeasuredHeight(ce,Math.round(pe))}}},{deep:!1});function ya(){const D=ft.value;D&&(Ht.value=D.scrollTop)}function Bl(){const D=ft.value;D&&(kl.value=D.clientHeight,Ht.value=D.scrollTop)}e.onMounted(()=>{if(!He.value)return;Bl();const D=ft.value;if(!D)return;const j=typeof ResizeObserver<"u"?new ResizeObserver(Bl):null;j==null||j.observe(D),e.onBeforeUnmount(()=>j==null?void 0:j.disconnect())});const Ze=e.computed(()=>{jt.value;const D=ct.value;if(!D||!He.value)return null;const j=D.getRange(Ht.value,kl.value||400),J=te.value.slice(j.startIndex,j.endIndex+1);let ce=0;for(let pe=0;pe<J.length;pe++)ce+=D.getItemSize(j.startIndex+pe);const _=Math.max(0,j.totalHeight-j.offsetTop-ce);return{startIndex:j.startIndex,endIndex:j.endIndex,visibleRows:J,topPad:j.offsetTop,bottomPad:_}}),Cl=e.computed(()=>Ze.value?Ze.value.visibleRows:te.value),wl=e.computed(()=>Ze.value?Ze.value.startIndex:0);e.watch([()=>Ze.value,()=>jt.value,()=>Cl.value],()=>{var _;const D=ct.value,j=He.value;if(!D||!j)return;const J=(_=ft.value)==null?void 0:_.querySelector(".sg-table-grid");if(!J)return;J.querySelectorAll("[data-sg-virtual-row-index]").forEach(pe=>{const Re=Number(pe.getAttribute("data-sg-virtual-row-index"));if(!Number.isFinite(Re))return;const Je=D.getItemSize(Re);if(!Number.isFinite(Je)||Je<=0)return;const Sl=`${Je}px`,El=pe.children;for(let Yt=0;Yt<El.length;Yt++){const ut=El[Yt];ut.style.height!==Sl&&(ut.style.height=Sl),ut.style.minHeight!=="0px"&&(ut.style.minHeight="0px"),ut.style.overflow!=="hidden"&&(ut.style.overflow="hidden")}})},{flush:"post"});function ka(D,j){const J=typeof a.rowClassName=="function"?a.rowClassName(D.data,D.id):a.rowClassName??"",ce=ie.value.has(D.id)?"sg-table-row-selected":"",_=a.striped&&j%2===1?"sg-table-row-striped":"";return["sg-table-row","sg-table-row-clickable",ce,_,J,i.value.row??""].filter(Boolean).join(" ")}function ba(D){o("rowClick",D.id,D.data)}const Ba=e.computed(()=>a.unstyled?"":["sg-table-wrapper",`sg-table-${a.size}`,a.bordered?"sg-table-bordered":"",a.sticky||He.value?"sg-table-sticky":"",a.loading?"sg-table-loading":"",a.striped?"sg-table-striped":"",a.highlightOnHover===!1?"":"sg-table-hoverable",i.value.root??""].filter(Boolean).join(" ")),Ca=e.computed(()=>{var D;return["sg-table-scroll",(D=a.scroll)!=null&&D.x?"sg-table-scroll-x":"",i.value.scroll].filter(Boolean).join(" ")}),wa=e.computed(()=>{var j,J,ce;const D={...d.value.scroll??{}};if((j=a.scroll)!=null&&j.x&&(D.overflowX="auto"),He.value){D.overflowY="auto";const _=He.value.height??((J=a.scroll)==null?void 0:J.y)??400;D.height=typeof _=="number"?`${_}px`:_}else(ce=a.scroll)!=null&&ce.y&&(D.overflowY="auto",D.maxHeight=typeof a.scroll.y=="number"?`${a.scroll.y}px`:a.scroll.y);return D}),_t=e.computed(()=>{const D=He.value;return D&&typeof D.rowHeight=="number"&&D.estimateRowHeight==null?D.rowHeight:null}),Sa=e.computed(()=>["sg-table-grid",_t.value!=null?"sg-table-grid-virtual-fixed":"",i.value.grid].filter(Boolean).join(" ")||void 0),Ea=e.computed(()=>{var j;const D={gridTemplateColumns:Qe.value,...d.value.grid??{}};return(j=a.scroll)!=null&&j.x&&(D.minWidth=typeof a.scroll.x=="number"?`${a.scroll.x}px`:a.scroll.x),_t.value!=null&&(D["--sg-virtual-row-height"]=`${_t.value}px`),D}),xa=e.computed(()=>a.searchable||!!s.toolbar),Vt=e.computed(()=>`1 / ${Oe.value+1}`);return n({table:z,refresh:Y,clearAll:()=>{U(),q(),Ee.value.clear(),h.value=""}}),(D,j)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(Ba.value||void 0),style:e.normalizeStyle(d.value.root)},[xa.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["sg-table-toolbar",i.value.toolbar].filter(Boolean).join(" ")||void 0),style:e.normalizeStyle(d.value.toolbar)},[t.searchable?(e.openBlock(),e.createBlock(Mt,{key:0,modelValue:V.value,"onUpdate:modelValue":j[0]||(j[0]=J=>V.value=J),size:"small",class:"sg-table-search-input",placeholder:r.value.searchPlaceholder,"aria-label":r.value.searchPlaceholder,"allow-clear":"",style:{maxWidth:"240px"}},null,8,["modelValue","placeholder","aria-label"])):e.createCommentVNode("",!0),e.createElementVNode("div",bn,[e.renderSlot(D.$slots,"toolbar")])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"scrollEl",ref:ft,class:e.normalizeClass(Ca.value||void 0),style:e.normalizeStyle(wa.value),"aria-busy":t.loading||void 0,onScroll:ya},[e.createElementVNode("div",{class:e.normalizeClass(Sa.value),style:e.normalizeStyle(Ea.value),role:"table"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(J,ce)=>(e.openBlock(),e.createElementBlock("div",{key:`hdr-${ce}`,class:e.normalizeClass(["sg-table-header-row",i.value.headerRow].filter(Boolean).join(" ")||void 0),role:"row",style:e.normalizeStyle({display:"contents",...d.value.headerRow??{}})},[ce===0&&t.expandable?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-table-th sg-table-cell-expand",role:"columnheader",style:e.normalizeStyle(m.value?{gridRow:`span ${k.value}`}:{})},null,4)):e.createCommentVNode("",!0),ce===0&&t.rowSelection?(e.openBlock(),e.createElementBlock("div",{key:1,class:"sg-table-th sg-table-cell-selection",role:"columnheader",style:e.normalizeStyle(m.value?{gridRow:`span ${k.value}`}:{})},[t.rowSelection.type!=="radio"?(e.openBlock(),e.createBlock(at,{key:0,checked:me.value,indeterminate:ye.value,"aria-label":c.value,onChange:Me},null,8,["checked","indeterminate","aria-label"])):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J,_=>(e.openBlock(),e.createElementBlock("div",{key:`${ce}-${_.col.key}`,class:e.normalizeClass(["sg-table-th",_.col.children&&_.col.children.length>0?"sg-table-th-group":_.col.sortable?"sg-table-th-sortable":"",_.col.fixed?"sg-table-cell-fixed":"",_.col.fixed?`sg-table-cell-fixed-${_.col.fixed}`:"",T(_.col)&&B.value===_.col.key?"sg-table-th-drag-over":"",i.value.headerCell,_.col.headerClassName].filter(Boolean).join(" ")||void 0),draggable:T(_.col)||void 0,onDragstart:pe=>T(_.col)&&P(pe,_.col.key),onDragover:pe=>T(_.col)&&S(pe,_.col.key),onDragleave:pe=>T(_.col)&&C(),onDrop:pe=>T(_.col)&&b(pe,_.col.key),onDragend:pe=>T(_.col)&&$(),style:e.normalizeStyle({..._.col.children&&_.col.children.length>0?{}:tt(_.col,!0),..._.colSpan>1?{gridColumn:`span ${_.colSpan}`}:{},..._.rowSpan>1?{gridRow:`span ${_.rowSpan}`}:{},...d.value.headerCell??{}}),role:"columnheader","aria-sort":F.value&&F.value.column===_.col.key?F.value.direction==="asc"?"ascending":"descending":_.col.sortable?"none":void 0,onClick:pe=>!(_.col.children&&_.col.children.length>0)&&R(_.col)},[e.createElementVNode("span",wn,[e.createElementVNode("span",Sn,e.toDisplayString(_.col.title),1),_.col.sortable&&!(_.col.children&&_.col.children.length>0)?(e.openBlock(),e.createElementBlock("span",En,[e.createElementVNode("span",{class:e.normalizeClass(["sg-table-sort-asc",{"sg-table-sort-current":F.value&&F.value.column===_.col.key&&F.value.direction==="asc"}])},e.toDisplayString(r.value.sortAsc),3),e.createElementVNode("span",{class:e.normalizeClass(["sg-table-sort-desc",{"sg-table-sort-current":F.value&&F.value.column===_.col.key&&F.value.direction==="desc"}])},e.toDisplayString(r.value.sortDesc),3)])):e.createCommentVNode("",!0)]),_.col.filters&&_.col.filters.length>0&&!e.unref(s).filterDropdown&&!(_.col.children&&_.col.children.length>0)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["sg-table-filter-trigger",{"sg-table-filter-active":Ee.value.get(_.col.key)&&Ee.value.get(_.col.key).length>0}]),role:"button","aria-label":`Filter ${_.col.title}`,onClick:e.withModifiers(pe=>ke(_.col.key),["stop"])},"▾",10,xn)):e.createCommentVNode("",!0),_.col.filters&&_.col.filters.length>0&&!e.unref(s).filterDropdown&&!(_.col.children&&_.col.children.length>0)?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:1,ref_for:!0,ref:pe=>de(_.col.key,pe),class:"sg-table-filter-dropdown",onClick:j[1]||(j[1]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",$n,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.col.filters,pe=>(e.openBlock(),e.createElementBlock("label",{key:String(pe.value),class:"sg-table-filter-item"},[_.col.filterMultiple!==!1?(e.openBlock(),e.createBlock(at,{key:0,checked:Xe(_.col,pe.value),onChange:()=>Ie(_.col,pe.value)},null,8,["checked","onChange"])):(e.openBlock(),e.createElementBlock("input",{key:1,type:"radio",checked:Xe(_.col,pe.value),onChange:()=>Ie(_.col,pe.value)},null,40,Nn)),e.createElementVNode("span",null,e.toDisplayString(pe.text),1)]))),128))]),e.createElementVNode("div",Vn,[e.createVNode(Ye,{size:"small",onClick:()=>le(_.col)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value.filterReset),1)]),_:1},8,["onClick"]),e.createVNode(Ye,{size:"small",type:"primary",onClick:()=>lt(_.col)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value.filterConfirm),1)]),_:1},8,["onClick"])])],512)),[[e.vShow,Le.value===_.col.key]]):e.createCommentVNode("",!0),e.unref(s).filterDropdown&&_.col.onFilter&&!(_.col.children&&_.col.children.length>0)?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["sg-table-filter-trigger",{"sg-table-filter-active":Ee.value.get(_.col.key)&&Ee.value.get(_.col.key).length>0}]),onClick:e.withModifiers(pe=>re(_.col.key),["stop"])},"▾",10,Dn)):e.createCommentVNode("",!0),e.unref(s).filterDropdown&&_.col.onFilter&&Le.value===_.col.key?(e.openBlock(),e.createElementBlock("div",{key:3,ref_for:!0,ref:pe=>de(_.col.key,pe),class:"sg-table-filter-dropdown",onClick:j[2]||(j[2]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(D.$slots,"filterDropdown",{column:_.col,selectedKeys:Ee.value.get(_.col.key)??[],setSelectedKeys:pe=>Ee.value.set(_.col.key,pe),confirm:()=>{we(_.col,Ee.value.get(_.col.key)??[]),ve()},clearFilters:()=>{we(_.col,[]),ve()},close:ve})],512)):e.createCommentVNode("",!0),_.col.resizable&&!(_.col.children&&_.col.children.length>0)?(e.openBlock(),e.createElementBlock("div",{key:4,class:"sg-table-resize-handle",onClick:j[3]||(j[3]=e.withModifiers(()=>{},["stop"])),onMousedown:pe=>Ke(_.col,pe)},null,40,zn)):e.createCommentVNode("",!0)],46,Cn))),128))],6))),128)),te.value.length===0?(e.openBlock(),e.createElementBlock("div",Tn,[e.createElementVNode("div",{class:e.normalizeClass(["sg-table-td","sg-table-empty",i.value.empty].filter(Boolean).join(" ")||void 0),style:e.normalizeStyle({gridColumn:Vt.value,...d.value.empty??{}}),role:"cell"},[e.renderSlot(D.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(r.value.emptyText),1)])],6)])):e.createCommentVNode("",!0),Ze.value&&Ze.value.topPad>0?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle({gridColumn:Vt.value,height:`${Ze.value.topPad}px`}),role:"presentation","aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cl.value,(J,ce)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:String(J.id)},[e.createElementVNode("div",{class:e.normalizeClass(ka(J,wl.value+ce)||void 0),role:"row","data-sg-virtual-row-index":Ze.value?wl.value+ce:void 0,style:{display:"contents"},onClick:_=>ba(J)},[t.expandable?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-table-td sg-table-cell-expand",role:"cell",onClick:j[4]||(j[4]=e.withModifiers(()=>{},["stop"]))},[De(J.data)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["sg-table-expand-btn",{"sg-table-expand-open":Be.value.has(J.id)}]),"aria-expanded":Be.value.has(J.id),"aria-label":Be.value.has(J.id)?"Collapse row":"Expand row",onClick:_=>Ve(J.id)},e.toDisplayString(r.value.expandIcon),11,Mn)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.rowSelection?(e.openBlock(),e.createElementBlock("div",{key:1,class:"sg-table-td sg-table-cell-selection",role:"cell",onClick:j[5]||(j[5]=e.withModifiers(()=>{},["stop"]))},[t.rowSelection.type!=="radio"?(e.openBlock(),e.createBlock(at,{key:0,checked:ie.value.has(J.id),"aria-label":`Select row ${String(J.id)}`,onChange:()=>ne(J.id)},null,8,["checked","aria-label","onChange"])):(e.openBlock(),e.createElementBlock("input",{key:1,type:"radio",class:"sg-table-row-radio",checked:ie.value.has(J.id),name:"sg-table-row-radio","aria-label":`Select row ${String(J.id)}`,onChange:()=>ne(J.id)},null,40,Fn))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(_,pe)=>(e.openBlock(),e.createElementBlock("div",{key:_.key,class:e.normalizeClass(["sg-table-td",_.fixed?"sg-table-cell-fixed":"",_.fixed?`sg-table-cell-fixed-${_.fixed}`:"",_.editable?"sg-table-td-editable":"",i.value.bodyCell].filter(Boolean).join(" ")||void 0),style:e.normalizeStyle({...tt(_),...pe===0&&t.tree&&J.depth>0?{paddingLeft:`${J.depth*Pe.value+8}px`}:{},...d.value.bodyCell??{}}),role:"cell",onDblclick:Re=>_.editable&&t.onCellEdit?ee(J.id,_.key,J.data[_.key]):null},[pe===0&&t.tree&&J.hasChildren?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["sg-table-expand-btn",{"sg-table-expand-open":Te.value.has(J.id)}]),"aria-label":Te.value.has(J.id)?"Collapse":"Expand",onClick:e.withModifiers(Re=>Z(J.id),["stop"])},e.toDisplayString(r.value.expandIcon),11,Pn)):e.createCommentVNode("",!0),ze.value&&ze.value.id===J.id&&ze.value.key===_.key?(e.openBlock(),e.createElementBlock("span",{key:1,class:"sg-table-cell-content",onClick:j[7]||(j[7]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":j[6]||(j[6]=Re=>W.value=Re),class:"sg-table-edit-input",onKeydown:[e.withKeys(he,["enter"]),e.withKeys(A,["esc"])],onBlur:he},null,544),[[e.vModelText,W.value]])])):(e.openBlock(),e.createElementBlock("span",Rn,[e.renderSlot(D.$slots,"cell",{column:_,row:J.data,id:J.id,value:J.data[_.key]},()=>[e.createTextVNode(e.toDisplayString(J.data[_.key]),1)])]))],46,An))),128))],10,Ln),t.expandable&&Be.value.has(J.id)?(e.openBlock(),e.createElementBlock("div",In,[e.createElementVNode("div",{class:"sg-table-td sg-table-expanded-row",style:e.normalizeStyle({gridColumn:Vt.value}),role:"cell"},[e.renderSlot(D.$slots,"expandedRow",{row:J.data,id:J.id},()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.expandable.expandedRowRender(J.data,J.id))))])],4)])):e.createCommentVNode("",!0)],64))),128)),Ze.value&&Ze.value.bottomPad>0?(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle({gridColumn:Vt.value,height:`${Ze.value.bottomPad}px`}),role:"presentation","aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),t.footer&&e.unref(K).length>0?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["sg-table-footer-row",i.value.footer].filter(Boolean).join(" ")||void 0),role:"row",style:e.normalizeStyle({display:"contents",...d.value.footer??{}})},[t.expandable?(e.openBlock(),e.createElementBlock("div",Kn)):e.createCommentVNode("",!0),t.rowSelection?(e.openBlock(),e.createElementBlock("div",On)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,J=>(e.openBlock(),e.createElementBlock("div",{key:`f-${J.key}`,class:"sg-table-td sg-table-footer-cell",role:"cell",style:e.normalizeStyle(tt(J))},[J.aggregate?(e.openBlock(),e.createElementBlock("span",Hn,e.toDisplayString(Nt(J)),1)):e.createCommentVNode("",!0)],4))),128))],6)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($t.value,(J,ce)=>(e.openBlock(),e.createElementBlock("div",{key:`sum-${ce}`,class:"sg-table-summary-row",role:"row",style:{display:"contents"}},[t.expandable?(e.openBlock(),e.createElementBlock("div",jn)):e.createCommentVNode("",!0),t.rowSelection?(e.openBlock(),e.createElementBlock("div",_n)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J,(_,pe)=>(e.openBlock(),e.createElementBlock("div",{key:`sc-${ce}-${pe}`,class:"sg-table-td sg-table-summary-cell",role:"cell",style:e.normalizeStyle({..._.colSpan&&_.colSpan>1?{gridColumn:`span ${_.colSpan}`}:{},..._.align?{textAlign:_.align}:{}})},[_.content&&typeof _.content=="object"?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(_.content),{key:0})):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(_.content),1)],64))],4))),128))]))),128))],6)],46,Bn),t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("div",Yn,[e.createVNode(Ct,{size:"large","aria-label":r.value.loadingText},null,8,["aria-label"])])):e.createCommentVNode("",!0),t.showPagination&&gt.value>1&&!He.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["sg-table-pagination",i.value.pagination].filter(Boolean).join(" ")||void 0),style:e.normalizeStyle(d.value.pagination)},[e.createElementVNode("span",Wn,e.toDisplayString(r.value.totalRows(e.unref(L).totalRows)),1),e.createVNode(bt,{class:"sg-table-pagination-controls",current:e.unref(L).page,total:e.unref(L).totalRows,"page-size":t.pageSize??e.unref(L).totalRows,onChange:xt},null,8,["current","total","page-size"])],6)):e.createCommentVNode("",!0)],6))}}),qn=["aria-expanded","aria-selected","aria-checked","aria-level","data-key","draggable"],Xn={key:1,class:"sg-spin sg-spin-small","aria-hidden":"true"},Gn={key:1,class:"sg-tree-switcher sg-tree-switcher-noop"},Jn={key:3,class:"sg-tree-icon"},Zn={class:"sg-tree-highlight"},Qn=["title","aria-label","disabled","onClick"],Jt=e.defineComponent({__name:"TreeNodeRow",props:{node:{},nodeKey:{},depth:{},isLeaf:{type:Boolean},indentSize:{},expanded:{type:Boolean},checked:{type:Boolean},halfChecked:{type:Boolean},selected:{type:Boolean},loading:{type:Boolean},disabled:{type:Boolean},focused:{type:Boolean},checkable:{type:Boolean},selectable:{type:Boolean},blockNode:{type:Boolean},directory:{type:Boolean},animated:{type:Boolean},draggable:{type:Boolean},dropPosition:{},dragKey:{},searchValue:{},t:{},status:{},actions:{},editable:{type:Boolean},unstyled:{type:Boolean}},emits:["expand","check","select","dragStart","dragOver","dragLeave","dragEnd","drop","rightClick","loadData","focusNode","edit","editCancel"],setup(t,{emit:n}){const l=t,a=n,o=e.ref(null);e.watch(()=>l.focused,async O=>{var q,ae;O&&o.value&&(await e.nextTick(),(ae=(q=o.value).scrollIntoView)==null||ae.call(q,{block:"nearest"}))});function s(O){O.stopPropagation(),!l.isLeaf&&(!l.expanded&&l.loading||(a("expand",l.nodeKey),!l.expanded&&!l.isLeaf&&a("loadData",l.node)))}function v(){l.disabled||l.node.disableCheckbox||a("check",l.nodeKey)}function c(){l.disabled||l.node.selectable===!1||l.selectable&&(a("select",l.nodeKey),l.directory&&!l.isLeaf&&a("expand",l.nodeKey))}function r(){a("focusNode",l.nodeKey),c()}function i(O){O.preventDefault(),a("rightClick",O,l.node)}const d=e.computed(()=>String(l.node.title??l.nodeKey)),u=e.computed(()=>{const O=l.searchValue;if(!O)return null;const q=d.value,ae=q.toLowerCase().indexOf(O.toLowerCase());return ae===-1?null:{before:q.slice(0,ae),match:q.slice(ae,ae+O.length),after:q.slice(ae+O.length)}}),p=e.computed(()=>l.dragKey===l.nodeKey),m=e.ref(!1),k=e.ref(null),f=e.ref(""),w=e.computed(()=>(l.actions??[]).filter(O=>O.visible?O.visible(l.node):!0)),B=e.computed(()=>l.status&&l.status!=="default"?`sg-tree-node-status-${l.status}`:""),E=e.computed(()=>l.unstyled?"":["sg-tree-node",l.selected?"sg-tree-node-selected":"",l.disabled?"sg-tree-node-disabled":"",l.isLeaf?"sg-tree-node-leaf":"",l.expanded?"sg-tree-node-expanded":"",l.draggable?"sg-tree-node-draggable":"",p.value?"sg-tree-node-dragging":"",l.dropPosition===0?"sg-tree-node-drop-inner":"",l.dropPosition===-1?"sg-tree-node-drop-before":"",l.dropPosition===1?"sg-tree-node-drop-after":"",l.blockNode?"sg-tree-node-block":"",l.directory?"sg-tree-node-directory":"",l.focused?"sg-tree-node-focused":"",m.value?"sg-tree-node-editing":"",B.value].filter(Boolean).join(" "));function N(){!l.editable||l.disabled||(f.value=d.value,m.value=!0,e.nextTick(()=>{var O,q;(O=k.value)==null||O.focus(),(q=k.value)==null||q.select()}))}function x(){if(!m.value)return;const O=f.value.trim(),q=d.value;m.value=!1,O&&O!==q&&a("edit",l.nodeKey,O,q)}function y(){m.value&&(m.value=!1,a("editCancel",l.nodeKey))}function P(O){O.key==="Enter"?(O.preventDefault(),x()):O.key==="Escape"&&(O.preventDefault(),y())}function S(O){return typeof O.disabled=="function"?!!O.disabled(l.node):!!O.disabled}function C(O,q){O.stopPropagation(),!S(q)&&q.onClick(l.node,l.nodeKey)}function b(O){l.draggable&&a("dragStart",O,l.nodeKey)}function $(O){if(!l.draggable)return;O.preventDefault();let q=0;const ae=o.value;if(ae){const G=ae.getBoundingClientRect(),Y=O.clientY-G.top,M=G.height;M>0&&(Y<M*.25?q=-1:Y>M*.75&&(q=1))}a("dragOver",O,l.nodeKey,q)}function T(O){l.draggable&&a("dragLeave",O,l.nodeKey)}function z(O){l.draggable&&a("dragEnd",O,l.nodeKey)}function K(O){l.draggable&&(O.preventDefault(),a("drop",O,l.nodeKey))}const L=e.computed(()=>l.isLeaf?void 0:l.expanded),I=e.computed(()=>l.checkable?l.checked:void 0),U=e.computed(()=>`${l.depth*l.indentSize}px`);return(O,q)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rowEl",ref:o,class:e.normalizeClass(E.value||void 0),style:e.normalizeStyle({paddingLeft:U.value}),role:"treeitem","aria-expanded":L.value,"aria-selected":t.selected,"aria-checked":I.value,"aria-level":t.depth+1,"data-key":t.nodeKey,draggable:t.draggable,onDragstart:b,onDragover:$,onDragleave:T,onDragend:z,onDrop:K,onContextmenu:i,onClick:r},[t.isLeaf?(e.openBlock(),e.createElementBlock("span",Gn)):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["sg-tree-switcher",t.expanded?"sg-tree-switcher-open":"sg-tree-switcher-close",t.loading?"sg-tree-switcher-loading":""].filter(Boolean).join(" ")),onClick:s},[t.loading?(e.openBlock(),e.createElementBlock("span",Xn)):(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(["sg-tree-switcher-arrow",t.expanded?"sg-tree-switcher-arrow-open":""].filter(Boolean).join(" ")),width:"10",height:"10",viewBox:"0 0 10 10",fill:"none"},[...q[4]||(q[4]=[e.createElementVNode("path",{d:"M3 2L7 5L3 8",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])],2))],2)),t.checkable&&t.node.checkable!==!1?(e.openBlock(),e.createBlock(at,{key:2,class:"sg-tree-checkbox",checked:t.checked,indeterminate:t.halfChecked,disabled:t.disabled||t.node.disableCheckbox,unstyled:t.unstyled,onClick:q[0]||(q[0]=e.withModifiers(()=>{},["stop"])),onChange:v},null,8,["checked","indeterminate","disabled","unstyled"])):e.createCommentVNode("",!0),t.directory?(e.openBlock(),e.createElementBlock("span",Jn,e.toDisplayString(t.expanded?"📂":"📁"),1)):e.createCommentVNode("",!0),m.value?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:5,ref_key:"editInput",ref:k,"onUpdate:modelValue":q[1]||(q[1]=ae=>f.value=ae),class:"sg-tree-edit-input",type:"text",onClick:q[2]||(q[2]=e.withModifiers(()=>{},["stop"])),onKeydown:e.withModifiers(P,["stop"]),onBlur:x},null,544)),[[e.vModelText,f.value]]):(e.openBlock(),e.createElementBlock("span",{key:4,class:e.normalizeClass(["sg-tree-title",t.selectable?"sg-tree-title-selectable":""].filter(Boolean).join(" ")),onDblclick:N},[u.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(u.value.before),1),e.createElementVNode("span",Zn,e.toDisplayString(u.value.match),1),e.createTextVNode(e.toDisplayString(u.value.after),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(d.value),1)],64))],34)),w.value.length>0?(e.openBlock(),e.createElementBlock("span",{key:6,class:"sg-tree-actions",onClick:q[3]||(q[3]=e.withModifiers(()=>{},["stop"]))},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,ae=>(e.openBlock(),e.createElementBlock("button",{key:ae.key,type:"button",class:e.normalizeClass(["sg-tree-action-btn",ae.danger?"sg-tree-action-danger":"",S(ae)?"sg-tree-action-disabled":""].filter(Boolean).join(" ")),title:ae.title,"aria-label":ae.title,disabled:S(ae),onClick:G=>C(G,ae)},e.toDisplayString(ae.icon),11,Qn))),128))])):e.createCommentVNode("",!0)],46,qn))}}),_l={emptyText:"No data",loadingText:"Loading...",searchPlaceholder:"Search...",expandAllText:"Expand All",collapseAllText:"Collapse All",checkAllText:"Check All",uncheckAllText:"Uncheck All"},Yl=24,Wl=28,eo={key:0,class:"sg-tree-search"},to=["value","placeholder","aria-label"],lo=["aria-label"],ao={key:1,class:"sg-tree-toolbar"},no={class:"sg-tree-toolbar-actions"},oo=["title"],so=["title"],ro=["title"],io=["title"],co={key:2,class:"sg-tree-empty"},Dl=5,Zt=e.defineComponent({__name:"Tree",props:{treeData:{},fieldNames:{},checkable:{type:Boolean,default:!1},checkStrictly:{type:Boolean,default:!1},checkedKeys:{},defaultCheckedKeys:{},selectable:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},selectedKeys:{},defaultSelectedKeys:{},expandedKeys:{},defaultExpandedKeys:{},defaultExpandAll:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!1},draggable:{type:[Boolean,Function],default:!1},allowDrop:{},loadData:{},blockNode:{type:Boolean,default:!1},height:{},virtual:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},indentSize:{default:Yl},directory:{type:Boolean,default:!1},showSearch:{type:Boolean,default:!1},searchValue:{},defaultSearchValue:{default:""},filterTreeNode:{},highlightSearch:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},showToolbar:{type:Boolean,default:!1},animated:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!1},scrollToKey:{},locale:{},unstyled:{type:Boolean,default:!1},nodeStatus:{},actions:{},editable:{type:[Boolean,Function]},showLine:{type:Boolean}},emits:["check","select","expand","search","dragStart","dragOver","dragLeave","dragEnd","drop","rightClick","focus","update:expandedKeys","update:checkedKeys","update:selectedKeys","update:searchValue","edit","editCancel"],setup(t,{expose:n,emit:l}){const a=t,o=l,s=e.computed(()=>({..._l,...a.locale})),v=Ce(),c=e.computed(()=>{var re,ve;return((ve=(re=v.value.locale)==null?void 0:re.tree)==null?void 0:ve.clearSearch)??"Clear search"}),{tree:r,treeState:i,flatNodes:d,toggleExpand:u,setExpandedKeys:p,expandAll:m,collapseAll:k,toggleCheck:f,setCheckedKeys:w,select:B,setSelectedKeys:E,markLoading:N,markLoaded:x,moveNode:y,filterNodes:P,refresh:S}=Kl({data:a.treeData,fieldNames:a.fieldNames,checkStrictly:a.checkStrictly,defaultExpandAll:a.defaultExpandAll,defaultExpandedKeys:a.defaultExpandedKeys,defaultCheckedKeys:a.defaultCheckedKeys,defaultSelectedKeys:a.defaultSelectedKeys});e.watch(()=>a.treeData,(re,ve)=>{re!==ve&&(r.setData(re),S())}),e.watch(()=>a.expandedKeys,re=>{re!==void 0&&p(re)}),e.watch(()=>a.checkedKeys,re=>{re!==void 0&&w(re)}),e.watch(()=>a.selectedKeys,re=>{re!==void 0&&E(re)});const C=e.ref(a.defaultSearchValue),b=e.computed(()=>a.searchValue??C.value);function $(re){if(a.searchValue===void 0&&(C.value=re),o("search",re),o("update:searchValue",re),!re){P(null);return}const ve=a.filterTreeNode?oe=>a.filterTreeNode(oe,re):oe=>String(oe.title??"").toLowerCase().includes(re.toLowerCase());if(P(ve),a.autoExpandParent){const oe=r.getFilteredKeys();oe&&p(oe)}}e.watch(()=>a.searchValue,re=>{re!==void 0&&re!==C.value&&$(re)});const T=e.ref(null),z=e.computed(()=>T.value);function K(re){T.value=re,re!==null&&o("focus",re)}e.onMounted(()=>{a.autoFocus&&d.value.length>0&&T.value===null&&K(d.value[0].key)});const L=e.ref(null),I=e.ref(null),U=e.ref(0);function O(re){u(re);const ve=r.getNode(re);if(!ve)return;const oe=r.getState().expandedKeys;o("expand",oe,{expanded:oe.includes(re),node:ve}),o("update:expandedKeys",oe)}function q(re){f(re);const ve=r.getNode(re);if(!ve)return;const oe=r.getState(),ke=oe.checkedKeys.map(Ie=>r.getNode(Ie)).filter(Boolean);o("check",oe.checkedKeys,{checked:oe.checkedKeys.includes(re),node:ve,checkedNodes:ke,halfCheckedKeys:oe.halfCheckedKeys}),o("update:checkedKeys",oe.checkedKeys)}function ae(re){B(re,a.multiple);const ve=r.getNode(re);if(!ve)return;const oe=r.getState(),ke=oe.selectedKeys.map(Ie=>r.getNode(Ie)).filter(Boolean);o("select",oe.selectedKeys,{selected:oe.selectedKeys.includes(re),node:ve,selectedNodes:ke}),o("update:selectedKeys",oe.selectedKeys)}function G(re){if(!a.loadData)return;const ve=re.key;i.value.loadedKeys.includes(ve)||i.value.loadingKeys.includes(ve)||(N(ve),a.loadData(re).then(()=>{x(ve)}))}function Y(re,ve){if(L.value=ve,re.dataTransfer){re.dataTransfer.effectAllowed="move";try{re.dataTransfer.setData("text/plain",String(ve))}catch{}}const oe=r.getNode(ve);oe&&o("dragStart",{event:re,node:oe})}function M(re,ve,oe){re.preventDefault(),I.value=ve,U.value=oe;const ke=r.getNode(ve);ke&&o("dragOver",{event:re,node:ke})}function g(re,ve){I.value=null;const oe=r.getNode(ve);oe&&o("dragLeave",{event:re,node:oe})}function h(re,ve){L.value=null,I.value=null;const oe=r.getNode(ve);oe&&o("dragEnd",{event:re,node:oe})}function V(re,ve){if(re.preventDefault(),L.value===null||L.value===ve){L.value=null,I.value=null;return}const oe=r.getNode(L.value),ke=r.getNode(ve);if(!(!oe||!ke)){if(a.allowDrop&&!a.allowDrop({dragNode:oe,dropNode:ke,dropPosition:U.value})){L.value=null,I.value=null;return}y(L.value,ve,U.value),o("drop",{event:re,node:ke,dragNode:oe,dropPosition:U.value}),L.value=null,I.value=null}}function F(re,ve){o("rightClick",{event:re,node:ve})}function R(re){return typeof a.draggable=="function"?a.draggable(re):!!a.draggable}function X(re){return typeof a.editable=="function"?a.editable(re):!!a.editable}function se(re){return a.nodeStatus?a.nodeStatus(re):void 0}function ie(re,ve,oe){const ke=r.getNode(re);ke&&o("edit",{key:re,node:ke,value:ve,oldValue:oe})}function ne(re){o("editCancel",re)}const me=e.useTemplateRef("containerEl"),ye=e.useTemplateRef("treeEl"),Me=e.ref(0),Ne=Wl;function Pe(re){const ve=d.value.findIndex(lt=>lt.key===re);if(ve===-1)return;const oe=me.value??ye.value;if(!oe)return;const ke=ve*Ne,{scrollTop:Ie,clientHeight:Xe}=oe;ke<Ie?oe.scrollTop=ke:ke+Ne>Ie+Xe&&(oe.scrollTop=ke+Ne-Xe)}function Te(re){if(re>=0&&re<d.value.length){const ve=d.value[re].key;K(ve),Pe(ve)}}function Ue(re){if(!a.keyboard||a.disabled)return;const ve=d.value,oe=ve.findIndex(ke=>ke.key===z.value);if(!(oe===-1&&ve.length===0))switch(re.key){case"ArrowDown":re.preventDefault(),Te(oe===-1?0:Math.min(oe+1,ve.length-1));break;case"ArrowUp":re.preventDefault(),Te(oe===-1?0:Math.max(oe-1,0));break;case"ArrowRight":{if(re.preventDefault(),oe===-1)break;const ke=ve[oe];!ke.isLeaf&&!i.value.expandedKeys.includes(ke.key)?O(ke.key):!ke.isLeaf&&i.value.expandedKeys.includes(ke.key)&&Te(oe+1);break}case"ArrowLeft":{if(re.preventDefault(),oe===-1)break;const ke=ve[oe];if(!ke.isLeaf&&i.value.expandedKeys.includes(ke.key))O(ke.key);else if(ke.parentKey!==null&&ke.parentKey!==void 0){const Ie=ve.findIndex(Xe=>Xe.key===ke.parentKey);Ie!==-1&&Te(Ie)}break}case"Home":re.preventDefault(),Te(0);break;case"End":re.preventDefault(),Te(ve.length-1);break;case"Enter":{if(re.preventDefault(),oe===-1)break;const ke=ve[oe];a.selectable&&ae(ke.key);break}case" ":{if(re.preventDefault(),oe===-1)break;const ke=ve[oe];a.checkable?q(ke.key):ke.isLeaf||O(ke.key);break}case"*":re.preventDefault(),m();break}}function qe(){me.value&&(Me.value=me.value.scrollTop)}const Z=e.computed(()=>a.virtual&&a.height!==void 0&&d.value.length>50),te=e.computed(()=>{if(!Z.value||!a.height)return{nodes:d.value,startIndex:0};const re=Math.floor(Me.value/Ne),ve=Math.max(0,re-Dl),oe=Math.ceil(a.height/Ne)+Dl*2,ke=Math.min(d.value.length,ve+oe);return{nodes:d.value.slice(ve,ke),startIndex:ve}}),fe=e.computed(()=>te.value.startIndex*Ne),Be=e.computed(()=>d.value.length*Ne),Ve=e.computed(()=>Math.max(0,Be.value-fe.value-te.value.nodes.length*Ne));e.watch(()=>a.scrollToKey,re=>{if(re===void 0)return;d.value.findIndex(oe=>oe.key===re)!==-1&&(Pe(re),K(re))});function De(){m(),o("expand",r.getState().expandedKeys,{expanded:!0,node:a.treeData[0]})}function Ee(){k(),o("expand",[],{expanded:!1,node:a.treeData[0]})}function Le(){const re=r.getAllKeys();w(re);const ve=re.map(oe=>r.getNode(oe)).filter(Boolean);o("check",re,{checked:!0,node:ve[0],checkedNodes:ve,halfCheckedKeys:[]})}function Fe(){w([]),o("check",[],{checked:!1,node:a.treeData[0],checkedNodes:[],halfCheckedKeys:[]})}const we=e.computed(()=>a.unstyled?"":["sg-tree",a.blockNode?"sg-tree-block-node":"",a.directory?"sg-tree-directory":"",a.disabled?"sg-tree-disabled":"",a.animated?"sg-tree-animated":"",a.showLine?"sg-tree-show-line":""].filter(Boolean).join(" "));return n({expandAll:De,collapseAll:Ee,checkAll:Le,uncheckAll:Fe,scrollToKey:Pe}),(re,ve)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(we.value||void 0),role:"tree"},[t.showSearch?(e.openBlock(),e.createElementBlock("div",eo,[e.createElementVNode("input",{class:"sg-tree-search-input",type:"text",value:b.value,placeholder:s.value.searchPlaceholder,"aria-label":s.value.searchPlaceholder,onInput:ve[0]||(ve[0]=oe=>$(oe.target.value))},null,40,to),b.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"sg-tree-search-clear","aria-label":c.value,onClick:ve[1]||(ve[1]=oe=>$(""))}," × ",8,lo)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.showToolbar?(e.openBlock(),e.createElementBlock("div",ao,[e.createElementVNode("div",no,[e.createElementVNode("button",{type:"button",class:"sg-tree-toolbar-btn",title:s.value.expandAllText,onClick:De}," ⊞ ",8,oo),e.createElementVNode("button",{type:"button",class:"sg-tree-toolbar-btn",title:s.value.collapseAllText,onClick:Ee}," ⊟ ",8,so),t.checkable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[ve[2]||(ve[2]=e.createElementVNode("span",{class:"sg-tree-toolbar-divider"},null,-1)),e.createElementVNode("button",{type:"button",class:"sg-tree-toolbar-btn",title:s.value.checkAllText,onClick:Le}," ☑ ",8,ro),e.createElementVNode("button",{type:"button",class:"sg-tree-toolbar-btn",title:s.value.uncheckAllText,onClick:Fe}," ☐ ",8,io)],64)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.unref(d).length===0?(e.openBlock(),e.createElementBlock("div",co,e.toDisplayString(s.value.emptyText),1)):Z.value&&t.height?(e.openBlock(),e.createElementBlock("div",{key:3,ref:"containerEl",class:"sg-tree-virtual-container",style:e.normalizeStyle({height:`${t.height}px`,overflow:"auto"}),tabindex:"0",role:"tree",onScroll:qe,onKeydown:Ue},[e.createElementVNode("div",{style:e.normalizeStyle({paddingTop:`${fe.value}px`,paddingBottom:`${Ve.value}px`,boxSizing:"border-box"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value.nodes,oe=>(e.openBlock(),e.createBlock(Jt,{key:oe.key,node:oe.node,"node-key":oe.key,depth:oe.depth,"is-leaf":oe.isLeaf,"indent-size":t.indentSize,expanded:e.unref(i).expandedKeys.includes(oe.key),checked:e.unref(i).checkedKeys.includes(oe.key),"half-checked":e.unref(i).halfCheckedKeys.includes(oe.key),selected:e.unref(i).selectedKeys.includes(oe.key),loading:e.unref(i).loadingKeys.includes(oe.key),disabled:t.disabled||!!oe.node.disabled,focused:z.value===oe.key,checkable:t.checkable,selectable:t.selectable,"block-node":t.blockNode,directory:t.directory,animated:t.animated,draggable:R(oe.node),"drop-position":I.value===oe.key?U.value:null,"drag-key":L.value,"search-value":t.highlightSearch?b.value:"",t:s.value,status:se(oe.node),actions:t.actions,editable:X(oe.node),unstyled:t.unstyled,onExpand:O,onCheck:q,onSelect:ae,onDragStart:Y,onDragOver:M,onDragLeave:g,onDragEnd:h,onDrop:V,onRightClick:F,onLoadData:G,onFocusNode:K,onEdit:ie,onEditCancel:ne},null,8,["node","node-key","depth","is-leaf","indent-size","expanded","checked","half-checked","selected","loading","disabled","focused","checkable","selectable","block-node","directory","animated","draggable","drop-position","drag-key","search-value","t","status","actions","editable","unstyled"]))),128))],4)],36)):(e.openBlock(),e.createElementBlock("div",{key:4,ref:"treeEl",tabindex:"0",role:"tree",onKeydown:Ue},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),oe=>(e.openBlock(),e.createBlock(Jt,{key:oe.key,node:oe.node,"node-key":oe.key,depth:oe.depth,"is-leaf":oe.isLeaf,"indent-size":t.indentSize,expanded:e.unref(i).expandedKeys.includes(oe.key),checked:e.unref(i).checkedKeys.includes(oe.key),"half-checked":e.unref(i).halfCheckedKeys.includes(oe.key),selected:e.unref(i).selectedKeys.includes(oe.key),loading:e.unref(i).loadingKeys.includes(oe.key),disabled:t.disabled||!!oe.node.disabled,focused:z.value===oe.key,checkable:t.checkable,selectable:t.selectable,"block-node":t.blockNode,directory:t.directory,animated:t.animated,draggable:R(oe.node),"drop-position":I.value===oe.key?U.value:null,"drag-key":L.value,"search-value":t.highlightSearch?b.value:"",t:s.value,status:se(oe.node),actions:t.actions,editable:X(oe.node),unstyled:t.unstyled,onExpand:O,onCheck:q,onSelect:ae,onDragStart:Y,onDragOver:M,onDragLeave:g,onDragEnd:h,onDrop:V,onRightClick:F,onLoadData:G,onFocusNode:K,onEdit:ie,onEditCancel:ne},null,8,["node","node-key","depth","is-leaf","indent-size","expanded","checked","half-checked","selected","loading","disabled","focused","checkable","selectable","block-node","directory","animated","draggable","drop-position","drag-key","search-value","t","status","actions","editable","unstyled"]))),128))],544))],2))}}),uo={key:1,class:"sg-list-loading-indicator",role:"status","aria-live":"polite"},mo=["aria-label"],po=["draggable","onClick","onDragstart","onDragover","onDrop"],vo={key:0,class:"sg-list-drag-handle"},go=["draggable","onClick","onDragstart","onDragover","onDrop"],fo={key:0,class:"sg-list-drag-handle"},ho={key:5,class:"sg-list-load-more"},yo=e.defineComponent({__name:"List",props:{dataSource:{},header:{},footer:{},loading:{type:Boolean,default:!1},pagination:{type:[Boolean,Object],default:!1},grid:{},size:{default:"default"},split:{type:Boolean,default:!0},bordered:{type:Boolean,default:!1},locale:{},unstyled:{type:Boolean,default:!1},virtual:{},selectable:{type:Boolean,default:!1},selectedKeys:{},defaultSelectedKeys:{default:()=>[]},multiSelect:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!0},rowClassName:{},classNames:{},styles:{}},emits:["selectionChange","reorder","itemClick","pageChange"],setup(t,{expose:n,emit:l}){const a=t,o=l,s=e.useSlots(),v=Ce(),c=e.computed(()=>{var g,h;return((h=(g=v.value.locale)==null?void 0:g.list)==null?void 0:h.loading)??"Loading"}),r=e.computed(()=>a.classNames??{}),i=e.computed(()=>a.styles??{}),d=e.ref(1),u=e.ref(a.defaultSelectedKeys??[]),p=e.ref(null),m=e.ref(null),k=e.ref(0),f=e.ref(null),w=e.computed(()=>a.selectedKeys??u.value),B=e.computed(()=>a.pagination?a.pagination.pageSize??10:a.dataSource.length),E=e.computed(()=>a.pagination?a.pagination.current??d.value:1),N=e.computed(()=>a.pagination?a.pagination.total??a.dataSource.length:a.dataSource.length),x=e.computed(()=>{if(!a.pagination)return a.dataSource;const g=(E.value-1)*B.value;return a.dataSource.slice(g,g+B.value)}),y=e.computed(()=>Math.max(1,Math.ceil(N.value/B.value)));function P(g){var h,V;g<1||g>y.value||(d.value=g,a.pagination&&((V=(h=a.pagination).onChange)==null||V.call(h,g,B.value)),o("pageChange",g,B.value))}function S(g,h,V){if(o("itemClick",g,h),!a.selectable)return;let F;a.multiSelect&&(V.ctrlKey||V.metaKey)?F=w.value.includes(h)?w.value.filter(R=>R!==h):[...w.value,h]:F=w.value.includes(h)?[]:[h],u.value=F,o("selectionChange",F,F.map(R=>a.dataSource[R]))}function C(g,h){if(a.draggable&&(p.value=h,g.dataTransfer)){g.dataTransfer.effectAllowed="move";try{g.dataTransfer.setData("text/plain",String(h))}catch{}}}function b(g,h){!a.draggable||p.value===null||(g.preventDefault(),g.dataTransfer&&(g.dataTransfer.dropEffect="move"),m.value=h)}function $(g,h){if(g.preventDefault(),p.value===null||p.value===h){p.value=null,m.value=null;return}o("reorder",p.value,h),p.value=null,m.value=null}function T(){p.value=null,m.value=null}function z(g){const h=g.currentTarget,V=g.relatedTarget;h&&V&&h.contains(V)||(m.value=null)}function K(g){!a.draggable||p.value===null||(g.preventDefault(),g.dataTransfer&&(g.dataTransfer.dropEffect="move"))}let L=null;function I(){L==null&&(L=requestAnimationFrame(()=>{L=null,f.value&&(k.value=f.value.scrollTop)}))}const U=e.computed(()=>{var g;return((g=a.locale)==null?void 0:g.emptyText)??"No Data"}),O=e.computed(()=>{if(!a.grid)return;const h={"--sg-list-grid-base-columns":`repeat(${a.grid.column??1}, 1fr)`};return a.grid.gutter!==void 0&&(h.gap=`${a.grid.gutter}px`),h}),q=e.computed(()=>{const g=a.grid;if(!g)return"";const h=[];return g.xs&&h.push(`sg-list-grid-xs-${g.xs}`),g.sm&&h.push(`sg-list-grid-sm-${g.sm}`),g.md&&h.push(`sg-list-grid-md-${g.md}`),g.lg&&h.push(`sg-list-grid-lg-${g.lg}`),h.join(" ")}),ae=e.computed(()=>{if(!a.virtual)return null;const{itemHeight:g,height:h,overscan:V=5}=a.virtual,F=x.value.length*g,R=Math.max(0,Math.floor(k.value/g)-V),X=Math.ceil(h/g)+V*2,se=Math.min(x.value.length,R+X),ie=R*g;return{startIndex:R,endIndex:se,offsetTop:ie,totalHeight:F}});function G(g,h){const V=a.selectable&&w.value.includes(h),F=p.value===h,R=m.value===h&&p.value!==h,X=typeof a.rowClassName=="function"?a.rowClassName(g,h):a.rowClassName??"";return["sg-list-item",a.selectable?"sg-list-item-selectable":"",V?"sg-list-item-selected":"",a.hoverable?"sg-list-item-hoverable":"",F?"sg-list-item-dragging":"",R?"sg-list-item-drop-target":"",r.value.item??"",X].filter(Boolean).join(" ")}const Y=e.computed(()=>a.unstyled?"":["sg-list",`sg-list-${a.size}`,a.split?"sg-list-split":"",a.bordered?"sg-list-bordered":"",a.loading?"sg-list-loading":"",a.grid?"sg-list-grid":"",a.selectable?"sg-list-selectable":"",a.draggable?"sg-list-draggable":"",a.virtual?"sg-list-virtual":"",q.value,r.value.root??""].filter(Boolean).join(" ")),M=e.computed(()=>["sg-list-items",r.value.items??""].filter(Boolean).join(" "));return n({selectedKeys:u,changePage:P}),(g,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(Y.value),style:e.normalizeStyle(i.value.root)},[e.unref(s).header||t.header?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["sg-list-header",r.value.header].filter(Boolean).join(" ")||void 0),style:e.normalizeStyle(i.value.header)},[e.renderSlot(g.$slots,"header",{},()=>[e.createTextVNode(e.toDisplayString(t.header),1)])],6)):e.createCommentVNode("",!0),t.loading?(e.openBlock(),e.createElementBlock("div",uo,[t.unstyled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",{key:0,class:"sg-spin sg-spin-default","aria-label":c.value},null,8,mo))])):x.value.length===0?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["sg-list-empty",r.value.empty].filter(Boolean).join(" ")||void 0),style:e.normalizeStyle(i.value.empty)},e.toDisplayString(U.value),7)):t.virtual&&ae.value?(e.openBlock(),e.createElementBlock("div",{key:3,ref_key:"virtualEl",ref:f,class:"sg-list-virtual-container",style:e.normalizeStyle({height:`${t.virtual.height}px`,overflow:"auto"}),onScroll:I},[e.createElementVNode("div",{style:e.normalizeStyle({height:`${ae.value.totalHeight}px`,position:"relative"})},[e.createElementVNode("div",{style:e.normalizeStyle({position:"absolute",top:`${ae.value.offsetTop}px`,left:0,right:0})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value.slice(ae.value.startIndex,ae.value.endIndex),(V,F)=>(e.openBlock(),e.createElementBlock("div",{key:ae.value.startIndex+F,class:e.normalizeClass(G(V,ae.value.startIndex+F)||void 0),style:e.normalizeStyle(i.value.item),draggable:t.draggable,onClick:R=>S(V,ae.value.startIndex+F,R),onDragstart:R=>C(R,ae.value.startIndex+F),onDragover:R=>b(R,ae.value.startIndex+F),onDrop:R=>$(R,ae.value.startIndex+F),onDragend:T,onDragleave:z},[t.draggable?(e.openBlock(),e.createElementBlock("span",vo,"⠿")):e.createCommentVNode("",!0),e.renderSlot(g.$slots,"default",{item:V,index:ae.value.startIndex+F})],46,po))),128))],4)],4)],36)):(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(t.grid||r.value.items?M.value:void 0),style:e.normalizeStyle(t.grid?{...O.value,...i.value.items}:i.value.items),onDragover:K},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(V,F)=>(e.openBlock(),e.createElementBlock("div",{key:F,class:e.normalizeClass(G(V,F)||void 0),style:e.normalizeStyle(i.value.item),draggable:t.draggable,onClick:R=>S(V,F,R),onDragstart:R=>C(R,F),onDragover:R=>b(R,F),onDrop:R=>$(R,F),onDragend:T,onDragleave:z},[t.draggable?(e.openBlock(),e.createElementBlock("span",fo,"⠿")):e.createCommentVNode("",!0),e.renderSlot(g.$slots,"default",{item:V,index:F})],46,go))),128))],38)),e.unref(s).loadMore?(e.openBlock(),e.createElementBlock("div",ho,[e.renderSlot(g.$slots,"loadMore")])):e.createCommentVNode("",!0),t.pagination?(e.openBlock(),e.createElementBlock("div",{key:6,class:e.normalizeClass(["sg-list-pagination",r.value.pagination].filter(Boolean).join(" ")||void 0),style:e.normalizeStyle(i.value.pagination)},[e.createVNode(bt,{current:E.value,total:N.value,"page-size":B.value,unstyled:t.unstyled,onChange:P},null,8,["current","total","page-size","unstyled"])],6)):e.createCommentVNode("",!0),e.unref(s).footer||t.footer?(e.openBlock(),e.createElementBlock("div",{key:7,class:e.normalizeClass(["sg-list-footer",r.value.footer].filter(Boolean).join(" ")||void 0),style:e.normalizeStyle(i.value.footer)},[e.renderSlot(g.$slots,"footer",{},()=>[e.createTextVNode(e.toDisplayString(t.footer),1)])],6)):e.createCommentVNode("",!0)],6))}}),ko=e.defineComponent({__name:"VirtualList",props:{data:{},itemHeight:{},overscan:{default:void 0},className:{default:void 0},containerStyle:{default:void 0},itemKey:{type:Function,default:void 0}},setup(t,{expose:n}){const l=t,a=e.computed(()=>l.data.length),o=e.computed(()=>l.itemHeight),{range:s,containerRef:v,scrollToIndex:c}=nl({itemCount:a,itemHeight:o,overscan:e.computed(()=>l.overscan??5)});n({scrollToIndex:c});const r=e.computed(()=>s.value.visibleItems.map(d=>{const u=l.data[d.index],p=l.itemKey?l.itemKey(u,d.index):d.index,m={position:"absolute",top:`${d.offsetTop}px`,left:"0",right:"0",height:`${d.height}px`};return{vi:d,item:u,key:p,style:m}}));return(i,d)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:v,class:e.normalizeClass(t.className),style:e.normalizeStyle({overflow:"auto",position:"relative",...t.containerStyle})},[e.createElementVNode("div",{style:e.normalizeStyle({height:`${e.unref(s).totalHeight}px`,position:"relative"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,u=>e.renderSlot(i.$slots,"item",{key:u.key,item:u.item,index:u.vi.index,style:e.normalizeStyle(u.style)})),128))],4)],6))}}),bo=["checked","aria-label"],Bo=["data-col-index","onClick"],Co={key:0,class:"sg-datagrid-header-cell-sort-indicator"},wo={key:0,class:"sg-datagrid-loading",style:{position:"absolute",inset:0,background:"rgba(255,255,255,0.7)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:10}},So={key:1,class:"sg-datagrid-empty",style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"}},Eo=["data-row-index","onClick","onDblclick"],xo=["checked","aria-label","onChange"],$o=["data-row-index","data-col-index","data-col-key","onClick","onDblclick"],No=["value"],Vo={key:1},Do={key:2,class:"sg-datagrid-summary"},Ut=40,qt=48,zo=e.defineComponent({__name:"DataGrid",props:{columns:{},data:{},rowKey:{},rowHeight:{default:36},headerHeight:{default:40},width:{default:"100%"},height:{default:400},className:{},selectedRows:{},rowSelection:{type:Boolean,default:!1},showRowNumber:{type:Boolean,default:!1},striped:{type:Boolean,default:!1},highlightOnHover:{type:Boolean,default:!0},sortColumn:{},sortDirection:{},overscan:{default:5},loading:{type:Boolean,default:!1},summaryRows:{},emptyText:{default:"No data"}},emits:["cell-edit","sort","row-click","row-double-click","selected-rows-change"],setup(t,{expose:n,emit:l}){const a=t,o=Ce(),s=e.computed(()=>{var G,Y;return((Y=(G=o.value.locale)==null?void 0:G.dataGrid)==null?void 0:Y.selectAllRows)??"Select all rows"}),v=e.computed(()=>{var G,Y;return((Y=(G=o.value.locale)==null?void 0:G.dataGrid)==null?void 0:Y.selectRow)??"Select row"}),c=l,r=e.computed(()=>{const G=a.columns.filter(g=>g.frozen==="left"),Y=a.columns.filter(g=>!g.frozen),M=a.columns.filter(g=>g.frozen==="right");return[...G,...Y,...M]}),i=e.computed(()=>a.data.length*a.rowHeight),d=e.computed(()=>a.data.length),u=e.computed(()=>a.rowHeight),p=e.computed(()=>a.overscan??5),{range:m,containerRef:k,scrollToIndex:f}=nl({itemCount:d,itemHeight:u,overscan:p}),w=e.ref(null),B=e.ref(null),E=e.ref(null),N=e.ref(new Set(a.selectedRows??[]));e.watch(()=>a.selectedRows,G=>{N.value=new Set(G??[])});const x=e.computed(()=>m.value.visibleItems.map(Y=>({row:a.data[Y.index],index:Y.index,offsetTop:Y.offsetTop,height:Y.height}))),y=(G,Y)=>typeof a.rowKey=="function"?a.rowKey(G,Y):G[a.rowKey]??Y,P=(G,Y)=>Y.formula?Y.formula(G):G[Y.key],S=(G,Y,M)=>typeof G.editable=="function"?G.editable(Y,M):!!G.editable,C=G=>{if(!G.sortable)return;const Y=a.sortColumn===G.key&&a.sortDirection==="asc"?"desc":"asc";c("sort",{column:G.key,direction:Y})},b=(G,Y)=>{w.value={row:G,col:Y}},$=(G,Y,M,g)=>{S(M,g,G)&&(B.value={row:G,col:Y},E.value=P(g,M))},T=()=>{const G=B.value;if(!G)return;const Y=r.value[G.col];c("cell-edit",{rowIndex:G.row,columnKey:Y.key,value:E.value}),B.value=null},z=()=>{B.value=null},K=G=>{G.key==="Enter"?T():G.key==="Escape"&&z()},L=(G,Y)=>{c("row-click",{row:G,rowIndex:Y})},I=(G,Y)=>{c("row-double-click",{row:G,rowIndex:Y})},U=(G,Y)=>{const M=y(G,Y),g=new Set(N.value);g.has(M)?g.delete(M):g.add(M),N.value=g,c("selected-rows-change",g)},O=e.computed(()=>a.data.length===0?!1:a.data.every((G,Y)=>N.value.has(y(G,Y)))),q=()=>{O.value?N.value=new Set:N.value=new Set(a.data.map((G,Y)=>y(G,Y))),c("selected-rows-change",N.value)},ae=e.computed(()=>a.summaryRows??[]);return n({scrollToRow:f,getActiveCell:()=>w.value,setActiveCell:G=>{w.value=G}}),(G,Y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["sg-datagrid",a.className]),style:e.normalizeStyle({width:typeof a.width=="number"?`${a.width}px`:a.width,height:typeof a.height=="number"?`${a.height}px`:a.height,position:"relative",overflow:"hidden",display:"flex",flexDirection:"column"})},[e.createElementVNode("div",{class:"sg-datagrid-header",style:e.normalizeStyle({height:`${a.headerHeight}px`,display:"flex",flexShrink:0})},[a.rowSelection?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-datagrid-header-cell sg-datagrid-selection-cell",style:e.normalizeStyle({width:`${Ut}px`,flexShrink:0})},[e.createElementVNode("input",{type:"checkbox",checked:O.value,"aria-label":s.value,onChange:q},null,40,bo)],4)):e.createCommentVNode("",!0),a.showRowNumber?(e.openBlock(),e.createElementBlock("div",{key:1,class:"sg-datagrid-header-cell sg-datagrid-row-number-cell",style:e.normalizeStyle({width:`${qt}px`,flexShrink:0})}," # ",4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(M,g)=>(e.openBlock(),e.createElementBlock("div",{key:M.key,class:e.normalizeClass(["sg-datagrid-header-cell",M.headerClassName,M.sortable&&"sg-datagrid-header-cell--sortable",a.sortColumn===M.key&&a.sortDirection==="asc"&&"sg-datagrid-header-cell--asc",a.sortColumn===M.key&&a.sortDirection==="desc"&&"sg-datagrid-header-cell--desc"]),style:e.normalizeStyle({width:M.width?`${M.width}px`:"120px",minWidth:M.minWidth?`${M.minWidth}px`:void 0,maxWidth:M.maxWidth?`${M.maxWidth}px`:void 0,textAlign:M.align??"left"}),"data-col-index":g,onClick:h=>C(M)},[e.createElementVNode("span",null,e.toDisplayString(M.title??M.key),1),M.sortable&&a.sortColumn===M.key?(e.openBlock(),e.createElementBlock("span",Co,e.toDisplayString(a.sortDirection==="asc"?"▲":"▼"),1)):e.createCommentVNode("",!0)],14,Bo))),128))],4),a.loading?(e.openBlock(),e.createElementBlock("div",wo,[...Y[2]||(Y[2]=[e.createElementVNode("span",null,"Loading…",-1)])])):e.createCommentVNode("",!0),!a.loading&&a.data.length===0?(e.openBlock(),e.createElementBlock("div",So,e.toDisplayString(a.emptyText),1)):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{ref_key:"containerRef",ref:k,class:"sg-datagrid-body",style:{flex:1,overflowY:"auto",overflowX:"auto"}},[e.createElementVNode("div",{style:e.normalizeStyle({height:`${i.value}px`,position:"relative"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,M=>(e.openBlock(),e.createElementBlock("div",{key:y(M.row,M.index),class:e.normalizeClass(["sg-datagrid-row",[a.striped&&(M.index%2===0?"sg-datagrid-row--even":"sg-datagrid-row--odd"),a.highlightOnHover&&"sg-datagrid-row--hoverable",N.value.has(y(M.row,M.index))&&"sg-datagrid-row--selected"]]),style:e.normalizeStyle({position:"absolute",top:`${M.offsetTop}px`,left:0,right:0,height:`${M.height}px`,display:"flex"}),"data-row-index":M.index,onClick:g=>L(M.row,M.index),onDblclick:g=>I(M.row,M.index)},[a.rowSelection?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-datagrid-cell sg-datagrid-selection-cell",style:e.normalizeStyle({width:`${Ut}px`,flexShrink:0})},[e.createElementVNode("input",{type:"checkbox",checked:N.value.has(y(M.row,M.index)),"aria-label":v.value,onClick:Y[0]||(Y[0]=e.withModifiers(()=>{},["stop"])),onChange:g=>U(M.row,M.index)},null,40,xo)],4)):e.createCommentVNode("",!0),a.showRowNumber?(e.openBlock(),e.createElementBlock("div",{key:1,class:"sg-datagrid-cell sg-datagrid-row-number-cell",style:e.normalizeStyle({width:`${qt}px`,flexShrink:0})},e.toDisplayString(M.index+1),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(g,h)=>(e.openBlock(),e.createElementBlock("div",{key:g.key,class:e.normalizeClass(["sg-datagrid-cell",g.className,w.value&&w.value.row===M.index&&w.value.col===h&&"sg-datagrid-cell--active",B.value&&B.value.row===M.index&&B.value.col===h&&"sg-datagrid-cell--editing"]),style:e.normalizeStyle({width:g.width?`${g.width}px`:"120px",minWidth:g.minWidth?`${g.minWidth}px`:void 0,maxWidth:g.maxWidth?`${g.maxWidth}px`:void 0,textAlign:g.align??"left"}),"data-row-index":M.index,"data-col-index":h,"data-col-key":g.key,onClick:e.withModifiers(V=>b(M.index,h),["stop"]),onDblclick:e.withModifiers(V=>$(M.index,h,g,M.row),["stop"])},[B.value&&B.value.row===M.index&&B.value.col===h?(e.openBlock(),e.createElementBlock("input",{key:0,value:E.value==null?"":String(E.value),autofocus:"",style:{width:"100%",height:"100%",border:"none",outline:"none",padding:"0 8px",background:"transparent",font:"inherit"},onInput:Y[1]||(Y[1]=V=>E.value=V.target.value),onBlur:T,onKeydown:K},null,40,No)):(e.openBlock(),e.createElementBlock("span",Vo,e.toDisplayString(P(M.row,g)??""),1))],46,$o))),128))],46,Eo))),128))],4)],512),[[e.vShow,a.data.length>0]]),ae.value.length>0?(e.openBlock(),e.createElementBlock("div",Do,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,(M,g)=>(e.openBlock(),e.createElementBlock("div",{key:g,class:e.normalizeClass(["sg-datagrid-summary-row",M.className]),style:{display:"flex"}},[a.rowSelection?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-datagrid-summary-cell",style:e.normalizeStyle({width:`${Ut}px`,flexShrink:0})},null,4)):e.createCommentVNode("",!0),a.showRowNumber?(e.openBlock(),e.createElementBlock("div",{key:1,class:"sg-datagrid-summary-cell",style:e.normalizeStyle({width:`${qt}px`,flexShrink:0})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,h=>(e.openBlock(),e.createElementBlock("div",{key:h.key,class:"sg-datagrid-summary-cell",style:e.normalizeStyle({width:h.width?`${h.width}px`:"120px",textAlign:h.align??"left"})},e.toDisplayString(M.render(h.key,a.data)??""),5))),128))],2))),128))])):e.createCommentVNode("",!0)],6))}});function wt(t,n){const l=e.ref({...n});let a={...n},o=null,s=null;const v=(i,d)=>{if(!Number.isFinite(i)||!Number.isFinite(d)||i<=0||d<=0)return;const u={width:Math.round(i),height:Math.round(d)};a.width===u.width&&a.height===u.height||(a=u,l.value=u)},c=()=>{o&&(o.disconnect(),o=null),s=null},r=i=>{if(s===i||(c(),!i))return;if(s=i,typeof ResizeObserver>"u"){const u=i.getBoundingClientRect();v(u.width,u.height);return}o=new ResizeObserver(u=>{const p=u[0];if(!p)return;const m=p.contentRect;v(m.width,m.height)});const d=i.getBoundingClientRect();v(d.width,d.height),o.observe(i)};return e.watchEffect(()=>{r(t.value)}),e.onScopeDispose(()=>c()),{size:l}}function Ul(t={}){const n=t.orientation??"portrait",l=t.pageSize??"A4",a=t.margins??"1cm";return`@page { size: ${l} ${n}; margin: ${a}; }`}function ql(t,n={},l=typeof document<"u"?document:null){const a=l===null?"":Array.from(l.querySelectorAll('style, link[rel="stylesheet"]')).map(i=>i.outerHTML).join(`
2
+ `),o=Ul(n),s=n.scale&&n.scale!==1?n.scale:null,v=To(n.fileName??"SkyGraph print"),c=n.customStyles??"",r=s?`<div class="sg-print-root" style="transform: scale(${s}); transform-origin: 0 0;">`:'<div class="sg-print-root">';return`<!DOCTYPE html>
3
3
  <html>
4
4
  <head>
5
5
  <meta charset="utf-8" />
6
- <title>${u}</title>
6
+ <title>${v}</title>
7
7
  ${a}
8
8
  <style>
9
9
  ${o}
@@ -14,10 +14,10 @@ ${a}
14
14
  </style>
15
15
  </head>
16
16
  <body>
17
- ${i}
17
+ ${r}
18
18
  ${t}
19
19
  </div>
20
20
  </body>
21
- </html>`}function Lo(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function at(t,n={}){if(!t||typeof window>"u")return null;const l=window.open("","_blank");if(!l)return null;const a=Hl(t.outerHTML,n);if(l.document.open(),l.document.write(a),l.document.close(),l.focus(),n.skipPrint)return l;const o=()=>{try{l.print()}catch{}if(!n.keepOpen)try{l.close()}catch{}};return l.document.readyState==="complete"?setTimeout(o,0):(l.addEventListener("load",()=>setTimeout(o,0),{once:!0}),setTimeout(o,300)),l}const Xt=600;function wt(t){return t===!1?{enabled:!1,duration:0}:t===void 0||t===!0?{enabled:!0,duration:Xt}:{enabled:!0,duration:t.duration??Xt}}const bt=["var(--sg-color-primary)","var(--sg-color-success)","var(--sg-color-warning)","var(--sg-color-error)","var(--sg-blue-4)","var(--sg-orange-5)","var(--sg-green-5)","var(--sg-red-5)"];function tt(t,n){return t.color??bt[n%bt.length]}function Ol(t){return t===void 0?[16,16,24,44]:typeof t=="number"?[t,t,t,t]:[...t]}function Fo(t){return Number.isInteger(t)?String(t):Math.abs(t)>=1e3?t.toFixed(0):Math.abs(t)>=1?t.toFixed(2).replace(/\.?0+$/,""):t.toFixed(2)}function Ao(t,n,l,a){const o=a??Fo,s=Math.max(2,l??5);let u=0;for(let c=0;c<s;c++){const i=c/(s-1),r=t+i*(n-t),d=o(r);d.length>u&&(u=d.length)}return u*7}function tl(t,n,l,a){const o=Ol(t);if(t!==void 0||!n)return o;const s=Ao(l,a,n.tickCount,n.tickFormatter),u=Math.ceil(s+14);return u>o[3]&&(o[3]=u),n.label&&(o[3]+=16),o}function At(t){let n=1/0,l=-1/0;for(const a of t)for(const o of a)o!=null&&(o<n&&(n=o),o>l&&(l=o));return(!Number.isFinite(n)||!Number.isFinite(l))&&(n=0,l=1),n===l&&(n-=1,l+=1),{min:n,max:l}}const Po=["aria-label"],Ro=["data-series-id"],Io={class:"sg-chart-legend-label"},St=e.defineComponent({__name:"ChartLegend",props:{series:{},unstyled:{type:Boolean,default:!1},className:{}},setup(t){const n=t,l=e.computed(()=>n.series.map((s,u)=>({id:s.id,label:s.label,color:tt(s,u)}))),a=Ee(),o=e.computed(()=>{var s,u;return((u=(s=a.value.locale)==null?void 0:s.charts)==null?void 0:u.legend)??"Chart legend"});return(s,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([!n.unstyled&&"sg-chart-legend",n.className]),role:"list","aria-label":o.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,c=>(e.openBlock(),e.createElementBlock("span",{key:c.id,class:"sg-chart-legend-item",role:"listitem","data-series-id":c.id},[e.createElementVNode("span",{class:"sg-chart-legend-swatch",style:e.normalizeStyle({background:c.color})},null,4),e.createElementVNode("span",Io,e.toDisplayString(c.label),1)],8,Ro))),128))],10,Po))}}),_o={key:0,class:"sg-chart-axis sg-chart-axis-y"},Ko=["x1","y1","x2","y2"],Ho=["x","y"],Oo=["x","y","transform"],jo={key:1,class:"sg-chart-axis sg-chart-axis-x"},Yo=["x","y"],Wo=["x","y"],Pt=e.defineComponent({__name:"ChartAxes",props:{x:{},y:{},plotW:{},plotH:{},categories:{},yMin:{},yMax:{},xAxis:{},yAxis:{},unstyled:{type:Boolean,default:!1}},setup(t){const n=t;function l(c){return Number.isInteger(c)?String(c):Math.abs(c)>=1e3?c.toFixed(0):Math.abs(c)>=1?c.toFixed(2).replace(/\.?0+$/,""):c.toFixed(2)}const a=c=>{var i;return(i=n.yAxis)!=null&&i.tickFormatter?n.yAxis.tickFormatter(c):l(c)},o=(c,i)=>{var r;return(r=n.xAxis)!=null&&r.tickFormatter?n.xAxis.tickFormatter(c,i):String(c)},s=e.computed(()=>{var r;const c=Math.max(2,((r=n.yAxis)==null?void 0:r.tickCount)??5),i=[];for(let d=0;d<c;d++){const v=d/(c-1),g=n.yMin+(n.yMax-n.yMin)*(1-v);i.push({value:g,y:n.y+n.plotH*v})}return i}),u=e.computed(()=>{var r;if(n.categories.length===0)return[];const c=Math.min(n.categories.length,Math.max(2,((r=n.xAxis)==null?void 0:r.tickCount)??n.categories.length)),i=[];for(let d=0;d<c;d++){const v=c===1?0:Math.round(d*(n.categories.length-1)/(c-1)),g=n.categories.length===1?0:v/(n.categories.length-1);i.push({label:o(n.categories[v],v),x:n.x+n.plotW*g})}return i});return(c,i)=>{var r,d;return e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass(!n.unstyled&&"sg-chart-axes")},[n.yAxis?(e.openBlock(),e.createElementBlock("g",_o,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(v,g)=>{var m;return e.withDirectives((e.openBlock(),e.createElementBlock("line",{key:`yg-${g}`,x1:n.x,y1:v.y,x2:n.x+n.plotW,y2:v.y,class:"sg-chart-axis-grid",stroke:"currentColor","stroke-opacity":"0.1","vector-effect":"non-scaling-stroke"},null,8,Ko)),[[e.vShow,(m=n.yAxis)==null?void 0:m.gridLines]])}),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(v,g)=>(e.openBlock(),e.createElementBlock("text",{key:`yt-${g}`,x:n.x-6,y:v.y+4,"text-anchor":"end",class:"sg-chart-axis-label","font-size":"10",fill:"currentColor"},e.toDisplayString(a(v.value)),9,Ho))),128)),(r=n.yAxis)!=null&&r.label?(e.openBlock(),e.createElementBlock("text",{key:0,x:n.x-28,y:n.y+n.plotH/2,transform:`rotate(-90, ${n.x-28}, ${n.y+n.plotH/2})`,"text-anchor":"middle",class:"sg-chart-axis-title","font-size":"11",fill:"currentColor"},e.toDisplayString(n.yAxis.label),9,Oo)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),n.xAxis?(e.openBlock(),e.createElementBlock("g",jo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(v,g)=>(e.openBlock(),e.createElementBlock("text",{key:`xt-${g}`,x:v.x,y:n.y+n.plotH+14,"text-anchor":"middle",class:"sg-chart-axis-label","font-size":"10",fill:"currentColor"},e.toDisplayString(v.label),9,Yo))),128)),(d=n.xAxis)!=null&&d.label?(e.openBlock(),e.createElementBlock("text",{key:0,x:n.x+n.plotW/2,y:n.y+n.plotH+28,"text-anchor":"middle",class:"sg-chart-axis-title","font-size":"11",fill:"currentColor"},e.toDisplayString(n.xAxis.label),9,Wo)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2)}}}),Uo=["x1","x2","y1","y2"],qo=["cx","cy","fill"],Xo=["x","y","height"],Go=["x","y"],Jo=["x","y","fill"],Zo=["x","y"],Qo=["x","y"],$t=140,pt=14,st=6,Yt=10,jl=e.defineComponent({__name:"ChartCrosshair",props:{x:{},plotX:{},plotY:{},plotH:{},plotW:{},category:{},points:{},unstyled:{type:Boolean},valueFormatter:{type:Function}},setup(t){const n=t;function l(c){return Number.isInteger(c)?String(c):Math.abs(c)>=100?c.toFixed(0):c.toFixed(2).replace(/\.?0+$/,"")}const a=e.computed(()=>n.valueFormatter??l),o=c=>n.unstyled?void 0:`sg-chart-crosshair-${c}`,s=e.computed(()=>{const c=pt+2,i=st*2+c+n.points.length*pt,d=n.x+Yt+$t<=n.plotX+n.plotW?n.x+Yt:n.x-Yt-$t,v=Math.max(n.plotY,Math.min(n.plotY+n.plotH-i,n.plotY+4));return{tipX:d,tipY:v,tipHeight:i,headerHeight:c}});function u(c){return s.value.tipY+st+s.value.headerHeight+c*pt}return(c,i)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass(n.unstyled?void 0:"sg-chart-crosshair"),"data-sg-chart-crosshair":"","pointer-events":"none"},[e.createElementVNode("line",{class:e.normalizeClass(o("line")),"data-sg-chart-crosshair-line":"",x1:n.x,x2:n.x,y1:n.plotY,y2:n.plotY+n.plotH,stroke:"var(--sg-color-text-secondary)","stroke-width":1,"stroke-dasharray":"3 3",opacity:.7},null,10,Uo),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.points,(r,d)=>(e.openBlock(),e.createElementBlock("circle",{key:`dot-${d}`,class:e.normalizeClass(o("dot")),"data-sg-chart-crosshair-dot":"",cx:n.x,cy:r.y,r:3.5,fill:r.color,stroke:"var(--sg-color-bg, #fff)","stroke-width":1.5},null,10,qo))),128)),e.createElementVNode("g",{class:e.normalizeClass(o("tooltip")),"data-sg-chart-crosshair-tooltip":""},[e.createElementVNode("rect",{class:e.normalizeClass(o("tooltip-bg")),x:s.value.tipX,y:s.value.tipY,width:$t,height:s.value.tipHeight,rx:4,ry:4,fill:"var(--sg-color-bg, #fff)",stroke:"var(--sg-color-border)","stroke-width":1},null,10,Xo),e.createElementVNode("text",{class:e.normalizeClass(o("tooltip-title")),x:s.value.tipX+st,y:s.value.tipY+st+pt-3,"font-size":11,"font-weight":600,fill:"var(--sg-color-text)"},e.toDisplayString(String(n.category)),11,Go),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.points,(r,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`row-${d}`},[e.createElementVNode("rect",{x:s.value.tipX+st,y:u(d)+2,width:8,height:8,rx:1,fill:r.color},null,8,Jo),e.createElementVNode("text",{class:e.normalizeClass(o("tooltip-label")),x:s.value.tipX+st+12,y:u(d)+pt-3,"font-size":11,fill:"var(--sg-color-text-secondary)"},e.toDisplayString(r.label),11,Zo),e.createElementVNode("text",{class:e.normalizeClass(o("tooltip-value")),x:s.value.tipX+$t-st,y:u(d)+pt-3,"font-size":11,"font-weight":500,fill:"var(--sg-color-text)","text-anchor":"end"},e.toDisplayString(a.value(r.value)),11,Qo)],64))),128))],2)],2))}}),es=["x","y","width","height"],ts=["x","y","width","height","fill","stroke"];function ll(t){return t==null||t===!1?null:t===!0?{}:t}const al=e.defineComponent({__name:"ChartBrush",props:{plotX:{},plotY:{},plotW:{},plotH:{},categoryCount:{},range:{},unstyled:{type:Boolean},fill:{},disabled:{type:Boolean}},emits:["update:range","change"],setup(t,{emit:n}){const l=t,a=n,o="var(--sg-color-primary)",s=e.ref(null),u=e.ref(null),c=B=>l.unstyled?void 0:`sg-chart-brush-${B}`;function i(B,w,S,L){if(L<=0||L===1||!Number.isFinite(B)||!Number.isFinite(S)||S<=0)return 0;const T=S/(L-1);if(T<=0||!Number.isFinite(T))return 0;const P=Math.round((B-w)/T);return Number.isFinite(P)?Math.max(0,Math.min(L-1,P)):0}function r(B,w,S,L){if(L<=1)return w;const T=S/(L-1);return w+B*T}function d(B){var q;const w=u.value,S=w==null?void 0:w.ownerSVGElement;if(!S)return null;const L=S.getBoundingClientRect();if(!L.width||!Number.isFinite(L.width))return null;let T=600;try{const _=(q=S.viewBox)==null?void 0:q.baseVal;if(_&&_.width>0)T=_.width;else{const R=S.getAttribute("viewBox");if(R){const U=R.trim().split(/\s+/),I=Number.parseFloat(U[2]??"");Number.isFinite(I)&&I>0&&(T=I)}}}catch{}const P=(B-L.left)/L.width*T;return i(P,l.plotX,l.plotW,l.categoryCount)}function v(B,w){var S;try{(S=B.setPointerCapture)==null||S.call(B,w)}catch{}}function g(B,w){var S;try{(S=B.releasePointerCapture)==null||S.call(B,w)}catch{}}function m(B){a("update:range",B),a("change",B)}function h(B){if(l.disabled||l.categoryCount===0)return;const w=d(B.clientX);w!==null&&(B.preventDefault(),v(B.currentTarget,B.pointerId),s.value={startIdx:w,endIdx:w})}function p(B){if(!s.value)return;const w=d(B.clientX);w!==null&&(s.value={...s.value,endIdx:w})}function b(B){if(!s.value)return;g(B.currentTarget,B.pointerId);const S=d(B.clientX)??s.value.endIdx,L=Math.min(s.value.startIdx,S),T=Math.max(s.value.startIdx,S);m({from:L,to:T}),s.value=null}function y(B){s.value&&(g(B.currentTarget,B.pointerId),s.value=null)}function E(B){l.disabled||(B.preventDefault(),m(null))}const z=e.computed(()=>{if(s.value){const B=Math.min(s.value.startIdx,s.value.endIdx),w=Math.max(s.value.startIdx,s.value.endIdx);return{from:B,to:w}}if(l.range){const B=Math.min(l.range.from,l.range.to),w=Math.max(l.range.from,l.range.to);return{from:Math.max(0,Math.min(l.categoryCount-1,B)),to:Math.max(0,Math.min(l.categoryCount-1,w))}}return null}),x=e.computed(()=>{const B=z.value;if(!B)return null;const w=r(B.from,l.plotX,l.plotW,l.categoryCount),S=r(B.to,l.plotX,l.plotW,l.categoryCount),L=Math.min(w,S),T=Math.max(w,S),P=Math.max(2,T-L);return{left:L,w:P}}),f=e.computed(()=>l.fill??o),N=e.computed(()=>l.disabled?{cursor:"not-allowed"}:{cursor:"crosshair"});return(B,w)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass(l.unstyled?void 0:"sg-chart-brush"),"data-sg-chart-brush":""},[e.createElementVNode("rect",{ref_key:"overlayRef",ref:u,class:e.normalizeClass(c("overlay")),"data-sg-chart-brush-overlay":"",x:l.plotX,y:l.plotY,width:Math.max(0,l.plotW),height:Math.max(0,l.plotH),fill:"transparent",style:e.normalizeStyle(N.value),onPointerdown:h,onPointermove:p,onPointerup:b,onPointercancel:y,onDblclick:E},null,46,es),x.value?(e.openBlock(),e.createElementBlock("rect",{key:0,class:e.normalizeClass(c("selection")),"data-sg-chart-brush-selection":"",x:x.value.left,y:l.plotY,width:x.value.w,height:Math.max(0,l.plotH),fill:f.value,"fill-opacity":.15,stroke:f.value,"stroke-opacity":.5,"stroke-width":1,"pointer-events":"none"},null,10,ts)):e.createCommentVNode("",!0)],2))}}),ls=["data-animate"],as=["viewBox","width","height","aria-label"],ns={class:"sg-chart-line-paths"},os=["d","stroke","stroke-width","data-series-id"],ss={key:0,class:"sg-chart-line-markers"},rs=["cx","cy","fill"],is=e.defineComponent({__name:"LineChart",props:{markers:{type:Boolean,default:!0},strokeWidth:{default:2},crosshair:{type:[Boolean,Object],default:!1},brush:{type:[Boolean,Object]},categories:{},series:{},width:{default:"100%"},height:{default:200},className:{},style:{},unstyled:{type:Boolean,default:!1},padding:{},legend:{type:Boolean,default:!1},animate:{type:[Boolean,Object]},xAxis:{},yAxis:{},fileName:{default:"chart"}},setup(t,{expose:n}){var A;const l=t,a=e.ref(null),o=e.ref(null),s=Ee(),u=e.computed(()=>{var V,C;return((C=(V=s.value.locale)==null?void 0:V.charts)==null?void 0:C.lineChart)??"Line chart"}),c=e.computed(()=>typeof l.width=="number"&&Number.isFinite(l.width)?l.width:600),i=e.computed(()=>typeof l.height=="number"&&Number.isFinite(l.height)?l.height:200),{size:r}=Ct(o,{width:c.value,height:i.value}),d=e.computed(()=>At(l.series.map(V=>V.values))),v=e.computed(()=>tl(l.padding,l.yAxis,d.value.min,d.value.max)),g=e.computed(()=>r.value.width),m=e.computed(()=>r.value.height),h=e.computed(()=>v.value[3]),p=e.computed(()=>v.value[0]),b=e.computed(()=>Math.max(0,g.value-v.value[3]-v.value[1])),y=e.computed(()=>Math.max(0,m.value-v.value[0]-v.value[2])),E=e.computed(()=>wt(l.animate)),z=V=>{const C=l.categories.length;return C<=1?h.value:h.value+b.value*V/(C-1)},x=V=>{const{min:C,max:k}=d.value;return k===C?p.value+y.value/2:p.value+y.value*(1-(V-C)/(k-C))},f=e.computed(()=>l.series.map((V,C)=>{const k=tt(V,C),$=[];let M=[];return V.values.forEach((H,O)=>{if(H==null)M.length>0&&($.push(M.join(" ")),M=[]);else{const Q=M.length===0?"M":"L";M.push(`${Q}${z(O)},${x(H)}`)}}),M.length>0&&$.push(M.join(" ")),{id:V.id,color:k,label:V.label,segments:$}})),N=e.computed(()=>E.value.enabled?{"--sg-chart-anim-duration":`${E.value.duration}ms`}:void 0);function B(V,C){if(!E.value.enabled)return;const k=E.value.duration;return{strokeDasharray:1,strokeDashoffset:1,animationDelay:`${C/Math.max(1,V)*k}ms`,animationDuration:`${k/Math.max(1,V)}ms`}}const w=e.computed(()=>l.series.flatMap((V,C)=>{const k=tt(V,C);return V.values.map(($,M)=>$==null?null:{id:`${V.id}-${M}`,color:k,x:z(M),y:x($)}).filter(Boolean)})),S=e.computed(()=>l.crosshair!==!1&&l.categories.length>0),L=e.computed(()=>typeof l.crosshair=="object"&&l.crosshair!==null?l.crosshair.valueFormatter:void 0),T=e.ref(null);function P(V){if(!S.value)return;const k=V.currentTarget.getBoundingClientRect();if(k.width===0)return;const $=(V.clientX-k.left)/k.width*g.value,M=l.categories.length;if(M===1){T.value=0;return}const H=b.value/(M-1);if(H<=0){T.value=null;return}const O=Math.round(($-h.value)/H);if(O<0||O>=M){T.value=null;return}T.value=O}function q(){S.value&&(T.value=null)}const _=e.computed(()=>{const V=T.value;if(V===null)return[];const C=[];return l.series.forEach((k,$)=>{const M=k.values[V];M!=null&&C.push({label:k.label,value:M,color:tt(k,$),y:x(M)})}),C}),R=e.computed(()=>ll(l.brush)),U=e.computed(()=>R.value!=null&&"range"in R.value),I=e.ref(((A=R.value)==null?void 0:A.defaultRange)??null),X=e.computed(()=>U.value?R.value.range??null:I.value);function ae(V){var C,k;U.value||(I.value=V),(k=(C=R.value)==null?void 0:C.onRangeChange)==null||k.call(C,V)}return n({print:(V={})=>{const C=a.value;C&&at(C,{fileName:V.fileName??l.fileName??"chart"})},exportSvg:()=>{const V=o.value;return V?new XMLSerializer().serializeToString(V):null}}),(V,C)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:a,class:e.normalizeClass([!l.unstyled&&"sg-chart sg-chart-line",l.className]),style:e.normalizeStyle({width:typeof l.width=="number"?`${l.width}px`:l.width}),"data-animate":E.value.enabled?"on":"off"},[(e.openBlock(),e.createElementBlock("svg",{ref_key:"svgRef",ref:o,viewBox:`0 0 ${g.value} ${m.value}`,width:typeof l.width=="number"?l.width:"100%",height:l.height,role:"img","aria-label":u.value,onMousemove:C[0]||(C[0]=k=>S.value?P(k):void 0),onMouseleave:C[1]||(C[1]=k=>S.value?q():void 0)},[e.createVNode(Pt,{x:h.value,y:p.value,plotW:b.value,plotH:y.value,categories:l.categories,yMin:d.value.min,yMax:d.value.max,xAxis:l.xAxis,yAxis:l.yAxis,unstyled:l.unstyled},null,8,["x","y","plotW","plotH","categories","yMin","yMax","xAxis","yAxis","unstyled"]),e.createElementVNode("g",ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,k=>(e.openBlock(),e.createElementBlock("g",{key:k.id,class:e.normalizeClass([E.value.enabled&&!l.unstyled&&"sg-chart-line-animate"]),style:e.normalizeStyle(N.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.segments,($,M)=>(e.openBlock(),e.createElementBlock("path",{key:`${k.id}-${M}`,class:e.normalizeClass([E.value.enabled&&!l.unstyled&&"sg-chart-line-segment-animate"]),d:$,stroke:k.color,"stroke-width":l.strokeWidth,pathLength:"1",fill:"none","vector-effect":"non-scaling-stroke","data-series-id":k.id,style:e.normalizeStyle(B(k.segments.length,M))},null,14,os))),128))],6))),128))]),l.markers?(e.openBlock(),e.createElementBlock("g",ss,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,k=>(e.openBlock(),e.createElementBlock("circle",{key:k.id,cx:k.x,cy:k.y,r:"3",fill:k.color},null,8,rs))),128))])):e.createCommentVNode("",!0),S.value&&T.value!==null&&_.value.length>0?(e.openBlock(),e.createBlock(jl,{key:1,x:z(T.value),"plot-x":h.value,"plot-y":p.value,"plot-h":y.value,"plot-w":b.value,category:l.categories[T.value],points:_.value,unstyled:l.unstyled,"value-formatter":L.value},null,8,["x","plot-x","plot-y","plot-h","plot-w","category","points","unstyled","value-formatter"])):e.createCommentVNode("",!0),R.value?(e.openBlock(),e.createBlock(al,{key:2,"plot-x":h.value,"plot-y":p.value,"plot-w":b.value,"plot-h":y.value,"category-count":l.categories.length,range:X.value,unstyled:l.unstyled,fill:R.value.fill,disabled:R.value.disabled,onChange:ae},null,8,["plot-x","plot-y","plot-w","plot-h","category-count","range","unstyled","fill","disabled"])):e.createCommentVNode("",!0)],40,as)),l.legend?(e.openBlock(),e.createBlock(St,{key:0,series:l.series,unstyled:l.unstyled},null,8,["series","unstyled"])):e.createCommentVNode("",!0)],14,ls))}}),cs=["data-animate"],us=["viewBox","width","height","aria-label"],ds={class:"sg-chart-bars"},ms=["x","y","width","height","rx","ry","fill","data-series-id"],ps=e.defineComponent({__name:"BarChart",props:{stacked:{type:Boolean,default:!1},cornerRadius:{default:0},categories:{},series:{},width:{default:"100%"},height:{default:200},className:{},style:{},unstyled:{type:Boolean,default:!1},padding:{},legend:{type:Boolean,default:!1},animate:{type:[Boolean,Object]},xAxis:{},yAxis:{},fileName:{default:"chart"}},setup(t,{expose:n}){const l=t,a=e.ref(null),o=e.ref(null),s=Ee(),u=e.computed(()=>{var S,L;return((L=(S=s.value.locale)==null?void 0:S.charts)==null?void 0:L.barChart)??"Bar chart"}),c=e.computed(()=>typeof l.width=="number"&&Number.isFinite(l.width)?l.width:600),i=e.computed(()=>typeof l.height=="number"&&Number.isFinite(l.height)?l.height:200),{size:r}=Ct(o,{width:c.value,height:i.value}),d=e.computed(()=>wt(l.animate)),v=e.computed(()=>l.series.map(S=>S.values)),g=e.computed(()=>l.stacked?l.categories.map((L,T)=>{let P=0;for(const q of v.value){const _=q[T];_!=null&&(P+=_)}return P}):null),m=e.computed(()=>{if(l.stacked&&g.value){const T=Math.max(0,...g.value);return{min:0,max:T===0?1:T}}const{min:S,max:L}=At(v.value);return{min:Math.min(0,S),max:Math.max(0,L)}}),h=e.computed(()=>tl(l.padding,l.yAxis,m.value.min,m.value.max)),p=e.computed(()=>r.value.width),b=e.computed(()=>r.value.height),y=e.computed(()=>h.value[3]),E=e.computed(()=>h.value[0]),z=e.computed(()=>Math.max(0,p.value-h.value[3]-h.value[1])),x=e.computed(()=>Math.max(0,b.value-h.value[0]-h.value[2])),f=S=>{const{min:L,max:T}=m.value;return T===L?E.value+x.value/2:E.value+x.value*(1-(S-L)/(T-L))},N=e.computed(()=>{const S=l.categories.length;if(S===0)return[];const L=z.value/S,P=L*(1-.1),q=(L-P)/2,_=[];if(l.stacked)for(let R=0;R<S;R++){let U=0;for(let I=0;I<l.series.length;I++){const X=l.series[I],ae=X.values[R];if(ae==null)continue;const A=f(U),V=f(U+ae),C=y.value+R*L+q,k=P,$=Math.min(A,V),M=Math.abs(A-V);_.push({seriesId:X.id,label:X.label,color:tt(X,I),x:C,y:$,width:k,height:M,rx:l.cornerRadius,categoryIndex:R,originY:ae>=0?A:V}),U+=ae}}else{const R=Math.max(1,l.series.length),U=P/R,I=f(0);for(let X=0;X<S;X++)for(let ae=0;ae<l.series.length;ae++){const A=l.series[ae],V=A.values[X];if(V==null)continue;const C=y.value+X*L+q+ae*U,k=f(V),$=Math.min(I,k),M=Math.abs(I-k);_.push({seriesId:A.id,label:A.label,color:tt(A,ae),x:C,y:$,width:U*.95,height:M,rx:l.cornerRadius,categoryIndex:X,originY:I})}}return _}),B=e.computed(()=>Math.max(1,l.categories.length));function w(S){if(!d.value.enabled)return;const L=d.value.duration;return{transformOrigin:`${S.x+S.width/2}px ${S.originY}px`,animationDuration:`${L}ms`,animationDelay:`${S.categoryIndex/B.value*(L*.3)}ms`}}return n({print:(S={})=>{const L=a.value;L&&at(L,{fileName:S.fileName??l.fileName??"chart"})},exportSvg:()=>{const S=o.value;return S?new XMLSerializer().serializeToString(S):null}}),(S,L)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:a,class:e.normalizeClass([!l.unstyled&&"sg-chart sg-chart-bar",l.className]),style:e.normalizeStyle({width:typeof l.width=="number"?`${l.width}px`:l.width}),"data-animate":d.value.enabled?"on":"off"},[(e.openBlock(),e.createElementBlock("svg",{ref_key:"svgRef",ref:o,viewBox:`0 0 ${p.value} ${b.value}`,width:typeof l.width=="number"?l.width:"100%",height:l.height,role:"img","aria-label":u.value},[e.createVNode(Pt,{x:y.value,y:E.value,plotW:z.value,plotH:x.value,categories:l.categories,yMin:m.value.min,yMax:m.value.max,xAxis:l.xAxis,yAxis:l.yAxis,unstyled:l.unstyled},null,8,["x","y","plotW","plotH","categories","yMin","yMax","xAxis","yAxis","unstyled"]),e.createElementVNode("g",ds,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(T,P)=>{var q;return e.openBlock(),e.createElementBlock("rect",{key:`${T.seriesId}-${T.categoryIndex}-${P}`,class:e.normalizeClass([d.value.enabled&&!l.unstyled&&"sg-chart-bar-animate"]),x:T.x,y:T.y,width:T.width,height:T.height,rx:T.rx,ry:T.rx,fill:T.color,"data-series-id":T.seriesId,style:e.normalizeStyle(w(T))},[e.createElementVNode("title",null,e.toDisplayString(T.label)+": "+e.toDisplayString((q=l.series[T.seriesId===T.seriesId,0])==null?void 0:q.values[T.categoryIndex]),1)],14,ms)}),128))])],8,us)),l.legend?(e.openBlock(),e.createBlock(St,{key:0,series:l.series,unstyled:l.unstyled},null,8,["series","unstyled"])):e.createCommentVNode("",!0)],14,cs))}}),vs=["data-animate"],gs=["viewBox","width","height","aria-label"],fs={class:"sg-chart-area-paths"},hs=["d","fill","fill-opacity","data-series-id"],ys=["d","stroke","stroke-width"],ks=e.defineComponent({__name:"AreaChart",props:{stacked:{type:Boolean,default:!1},fillOpacity:{default:.3},strokeWidth:{default:2},brush:{type:[Boolean,Object]},categories:{},series:{},width:{default:"100%"},height:{default:200},className:{},style:{},unstyled:{type:Boolean,default:!1},padding:{},legend:{type:Boolean,default:!1},animate:{type:[Boolean,Object]},xAxis:{},yAxis:{},fileName:{default:"chart"}},setup(t,{expose:n}){var _;const l=t,a=e.ref(null),o=e.ref(null),s=Ee(),u=e.computed(()=>{var R,U;return((U=(R=s.value.locale)==null?void 0:R.charts)==null?void 0:U.areaChart)??"Area chart"}),c=e.computed(()=>typeof l.width=="number"&&Number.isFinite(l.width)?l.width:600),i=e.computed(()=>typeof l.height=="number"&&Number.isFinite(l.height)?l.height:200),{size:r}=Ct(o,{width:c.value,height:i.value}),d=e.computed(()=>wt(l.animate)),v=e.computed(()=>{if(!l.stacked)return null;const R=l.series.map(()=>l.categories.map(()=>0));for(let U=0;U<l.categories.length;U++){let I=0;for(let X=0;X<l.series.length;X++){const ae=l.series[X].values[U];ae==null||(I+=ae),R[X][U]=I}}return R}),g=e.computed(()=>{if(l.stacked&&v.value){const I=v.value[v.value.length-1],X=Math.max(0,...I);return{min:0,max:X===0?1:X}}const{min:R,max:U}=At(l.series.map(I=>I.values));return{min:Math.min(0,R),max:Math.max(0,U)}}),m=e.computed(()=>tl(l.padding,l.yAxis,g.value.min,g.value.max)),h=e.computed(()=>r.value.width),p=e.computed(()=>r.value.height),b=e.computed(()=>m.value[3]),y=e.computed(()=>m.value[0]),E=e.computed(()=>Math.max(0,h.value-m.value[3]-m.value[1])),z=e.computed(()=>Math.max(0,p.value-m.value[0]-m.value[2])),x=R=>{const U=l.categories.length;return U<=1?b.value:b.value+E.value*R/(U-1)},f=R=>{const{min:U,max:I}=g.value;return I===U?y.value+z.value/2:y.value+z.value*(1-(R-U)/(I-U))},N=e.computed(()=>f(0)),B=e.computed(()=>l.series.map((R,U)=>{const I=tt(R,U),X=[],ae=[];for(let k=0;k<l.categories.length;k++){let $,M=N.value;if(l.stacked&&v.value){const H=v.value[U][k],O=U>0?v.value[U-1][k]:0;$=H,M=f(O)}else $=R.values[k]??null;$!=null&&(X.push({x:x(k),y:f($)}),ae.push({x:x(k),y:M}))}if(X.length===0)return{id:R.id,color:I,label:R.label,areaPath:"",linePath:""};const A=X.map((k,$)=>`${$===0?"M":"L"}${k.x},${k.y}`).join(" "),V=[...ae].reverse(),C=`${A} ${V.map(k=>`L${k.x},${k.y}`).join(" ")} Z`;return{id:R.id,color:I,label:R.label,areaPath:C,linePath:A}})),w=e.computed(()=>ll(l.brush)),S=e.computed(()=>w.value!=null&&"range"in w.value),L=e.ref(((_=w.value)==null?void 0:_.defaultRange)??null),T=e.computed(()=>S.value?w.value.range??null:L.value);function P(R){var U,I;S.value||(L.value=R),(I=(U=w.value)==null?void 0:U.onRangeChange)==null||I.call(U,R)}const q=e.computed(()=>d.value.enabled?{"--sg-chart-anim-duration":`${d.value.duration}ms`}:void 0);return n({print:(R={})=>{const U=a.value;U&&at(U,{fileName:R.fileName??l.fileName??"chart"})},exportSvg:()=>{const R=o.value;return R?new XMLSerializer().serializeToString(R):null}}),(R,U)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:a,class:e.normalizeClass([!l.unstyled&&"sg-chart sg-chart-area",l.className]),style:e.normalizeStyle({width:typeof l.width=="number"?`${l.width}px`:l.width}),"data-animate":d.value.enabled?"on":"off"},[(e.openBlock(),e.createElementBlock("svg",{ref_key:"svgRef",ref:o,viewBox:`0 0 ${h.value} ${p.value}`,width:typeof l.width=="number"?l.width:"100%",height:l.height,role:"img","aria-label":u.value},[e.createVNode(Pt,{x:b.value,y:y.value,plotW:E.value,plotH:z.value,categories:l.categories,yMin:g.value.min,yMax:g.value.max,xAxis:l.xAxis,yAxis:l.yAxis,unstyled:l.unstyled},null,8,["x","y","plotW","plotH","categories","yMin","yMax","xAxis","yAxis","unstyled"]),e.createElementVNode("g",fs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,I=>(e.openBlock(),e.createElementBlock("path",{key:`${I.id}-area`,class:e.normalizeClass([d.value.enabled&&!l.unstyled&&"sg-chart-area-animate"]),d:I.areaPath,fill:I.color,"fill-opacity":l.fillOpacity,"data-series-id":I.id,style:e.normalizeStyle(q.value)},null,14,hs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,I=>(e.openBlock(),e.createElementBlock("path",{key:`${I.id}-line`,class:e.normalizeClass([d.value.enabled&&!l.unstyled&&"sg-chart-area-animate"]),d:I.linePath,stroke:I.color,"stroke-width":l.strokeWidth,fill:"none","vector-effect":"non-scaling-stroke",style:e.normalizeStyle(q.value)},null,14,ys))),128))]),w.value?(e.openBlock(),e.createBlock(al,{key:0,"plot-x":b.value,"plot-y":y.value,"plot-w":E.value,"plot-h":z.value,"category-count":l.categories.length,range:T.value,unstyled:l.unstyled,fill:w.value.fill,disabled:w.value.disabled,onChange:P},null,8,["plot-x","plot-y","plot-w","plot-h","category-count","range","unstyled","fill","disabled"])):e.createCommentVNode("",!0)],8,gs)),l.legend?(e.openBlock(),e.createBlock(St,{key:0,series:l.series,unstyled:l.unstyled},null,8,["series","unstyled"])):e.createCommentVNode("",!0)],14,vs))}}),bs=["data-animate"],Bs=["viewBox","width","height","aria-label"],Cs={class:"sg-chart-pie-slices"},ws=["d","fill","data-series-id"],Ss={key:0,class:"sg-chart-pie-labels"},Es=["x","y"],xs=e.defineComponent({__name:"PieChart",props:{innerRadius:{default:0},labels:{type:Boolean,default:!1},categories:{},series:{},width:{default:"100%"},height:{default:240},className:{},style:{},unstyled:{type:Boolean,default:!1},legend:{type:Boolean,default:!1},animate:{type:[Boolean,Object]},fileName:{default:"chart"}},setup(t,{expose:n}){const l=t,a=e.ref(null),o=e.ref(null),s=Ee(),u=e.computed(()=>{var B,w;return((w=(B=s.value.locale)==null?void 0:B.charts)==null?void 0:w.pieChart)??"Pie chart"}),c=e.computed(()=>typeof l.width=="number"&&Number.isFinite(l.width)?l.width:320),i=e.computed(()=>typeof l.height=="number"&&Number.isFinite(l.height)?l.height:240),{size:r}=Ct(o,{width:c.value,height:i.value}),d=e.computed(()=>r.value.width),v=e.computed(()=>r.value.height),g=e.computed(()=>d.value/2),m=e.computed(()=>v.value/2),h=e.computed(()=>Math.max(0,Math.min(d.value,v.value)/2-8)),p=e.computed(()=>Math.max(0,Math.min(.95,l.innerRadius))*h.value),b=e.computed(()=>wt(l.animate)),y=e.computed(()=>{const B=l.categories,w=l.series;if(!w.length)return[];const S=w[0];return B.length>0&&w.length===1&&S!=null&&S.values.length===B.length&&S?B.map((T,P)=>({id:`${S.id}-${P}`,label:String(T),color:bt[P%bt.length],value:Math.max(0,Number(S.values[P]??0))})):w.map((T,P)=>({id:T.id,label:T.label,color:tt(T,P),value:Math.max(0,Number(T.values[0]??0))}))}),E=e.computed(()=>{let B=0;for(const w of y.value)w.value>0&&(B+=w.value);return B}),z=e.computed(()=>y.value.map(B=>({id:B.id,label:B.label,color:B.color,values:[B.value]})));function x(B,w){const S=h.value,L=p.value;if(w-B>=Math.PI*2-1e-6)return L<=0?[`M${g.value-S},${m.value}`,`A${S},${S} 0 1 1 ${g.value+S},${m.value}`,`A${S},${S} 0 1 1 ${g.value-S},${m.value}`,"Z"].join(" "):[`M${g.value-S},${m.value}`,`A${S},${S} 0 1 1 ${g.value+S},${m.value}`,`A${S},${S} 0 1 1 ${g.value-S},${m.value}`,`M${g.value-L},${m.value}`,`A${L},${L} 0 1 0 ${g.value+L},${m.value}`,`A${L},${L} 0 1 0 ${g.value-L},${m.value}`,"Z"].join(" ");const P=g.value+Math.cos(B)*S,q=m.value+Math.sin(B)*S,_=g.value+Math.cos(w)*S,R=m.value+Math.sin(w)*S,U=w-B>Math.PI?1:0;if(L<=0)return`M${g.value},${m.value} L${P},${q} A${S},${S} 0 ${U} 1 ${_},${R} Z`;const I=g.value+Math.cos(w)*L,X=m.value+Math.sin(w)*L,ae=g.value+Math.cos(B)*L,A=m.value+Math.sin(B)*L;return[`M${P},${q}`,`A${S},${S} 0 ${U} 1 ${_},${R}`,`L${I},${X}`,`A${L},${L} 0 ${U} 0 ${ae},${A}`,"Z"].join(" ")}const f=e.computed(()=>{const B=E.value;if(B===0)return[];let w=-Math.PI/2;const S=[];for(const L of y.value){if(L.value<=0)continue;const T=L.value/B*Math.PI*2,P=w,q=w+T;S.push({...L,start:P,end:q,midAngle:P+T/2,path:x(P,q)}),w=q}return S});function N(B,w){if(!b.value.enabled)return;const S=b.value.duration;return{transformOrigin:`${g.value}px ${m.value}px`,animationDuration:`${S}ms`,animationDelay:`${B/Math.max(1,w)*(S*.4)}ms`}}return n({print:(B={})=>{const w=a.value;w&&at(w,{fileName:B.fileName??l.fileName??"chart"})},exportSvg:()=>{const B=o.value;return B?new XMLSerializer().serializeToString(B):null}}),(B,w)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:a,class:e.normalizeClass([!l.unstyled&&"sg-chart sg-chart-pie",l.className]),style:e.normalizeStyle({width:typeof l.width=="number"?`${l.width}px`:l.width}),"data-animate":b.value.enabled?"on":"off"},[(e.openBlock(),e.createElementBlock("svg",{ref_key:"svgRef",ref:o,viewBox:`0 0 ${d.value} ${v.value}`,width:typeof l.width=="number"?l.width:"100%",height:l.height,role:"img","aria-label":u.value},[e.createElementVNode("g",Cs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(S,L)=>(e.openBlock(),e.createElementBlock("path",{key:S.id,class:e.normalizeClass([b.value.enabled&&!l.unstyled&&"sg-chart-pie-animate"]),d:S.path,fill:S.color,"data-series-id":S.id,style:e.normalizeStyle(N(L,f.value.length))},[e.createElementVNode("title",null,e.toDisplayString(S.label)+": "+e.toDisplayString(S.value),1)],14,ws))),128))]),l.labels?(e.openBlock(),e.createElementBlock("g",Ss,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,S=>(e.openBlock(),e.createElementBlock("text",{key:`${S.id}-label`,x:g.value+Math.cos(S.midAngle)*(h.value*.7),y:m.value+Math.sin(S.midAngle)*(h.value*.7),"text-anchor":"middle","dominant-baseline":"middle","font-size":"11",fill:"#fff"},e.toDisplayString(Math.round(S.value/E.value*100))+"% ",9,Es))),128))])):e.createCommentVNode("",!0)],8,Bs)),l.legend?(e.openBlock(),e.createBlock(St,{key:0,series:z.value,unstyled:l.unstyled},null,8,["series","unstyled"])):e.createCommentVNode("",!0)],14,bs))}}),$s=["data-sg-toolbar","aria-label","aria-hidden"],Ns=["data-sg-action","aria-label","title","tabindex","onClick"],Vs=e.defineComponent({__name:"ChartHoverToolbar",props:{visible:{type:Boolean},actions:{},fileName:{},getSvg:{type:Function},brushReset:{type:Function},toggleLegend:{type:Function},unstyled:{type:Boolean},style:{}},setup(t){const n=t,l=e.computed(()=>n.actions.filter(u=>!u.hidden)),a=Ee(),o=e.computed(()=>{var u,c;return((c=(u=a.value.locale)==null?void 0:u.charts)==null?void 0:c.actions)??"Chart actions"});function s(u,c){c.stopPropagation();const i=n.getSvg();i&&u.onClick({svg:i,fileName:n.fileName,brushReset:n.brushReset,toggleLegend:n.toggleLegend})}return(u,c)=>l.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(n.unstyled?void 0:"sg-chart-toolbar"),style:e.normalizeStyle(n.style),"data-sg-chart-toolbar":"","data-sg-toolbar":n.visible?"visible":"hidden",role:"toolbar","aria-label":o.value,"aria-hidden":n.visible?void 0:!0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,i=>(e.openBlock(),e.createElementBlock("button",{key:i.id,type:"button",class:e.normalizeClass(n.unstyled?void 0:"sg-chart-toolbar-button"),"data-sg-action":i.id,"aria-label":i.label,title:i.label,tabindex:n.visible?0:-1,onClick:r=>s(i,r)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.icon)))],10,Ns))),128))],14,$s)):e.createCommentVNode("",!0)}}),Ds="http://www.w3.org/2000/svg",zs="http://www.w3.org/1999/xlink";function nl(t,n){const l=t.cloneNode(!0);return l.getAttribute("xmlns")||l.setAttribute("xmlns",Ds),l.getAttribute("xmlns:xlink")||l.setAttribute("xmlns:xlink",zs),n&&(l.setAttribute("width",String(n.width)),l.setAttribute("height",String(n.height))),new XMLSerializer().serializeToString(l)}function ol(t,n){if(typeof document>"u"||typeof URL>"u")return;const l=URL.createObjectURL(t),a=document.createElement("a");a.href=l,a.download=n,a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a),setTimeout(()=>{try{URL.revokeObjectURL(l)}catch{}},100)}function Yl(t,n){return t.endsWith(`.${n}`)?t:`${t}.${n}`}function sl(t){var o,s;const n=(o=t.getBoundingClientRect)==null?void 0:o.call(t);let l=n&&n.width>0?n.width:0,a=n&&n.height>0?n.height:0;if(l<=0||a<=0){const u=(s=t.viewBox)==null?void 0:s.baseVal;if(u&&u.width>0&&u.height>0)l=u.width,a=u.height;else{const c=t.getAttribute("viewBox");if(c){const i=c.trim().split(/\s+/),r=Number.parseFloat(i[2]??""),d=Number.parseFloat(i[3]??"");Number.isFinite(r)&&r>0&&(l=r),Number.isFinite(d)&&d>0&&(a=d)}}}return l>0||(l=600),a>0||(a=400),{width:Math.round(l),height:Math.round(a)}}function Wl(t,n="chart.svg"){const l=sl(t),a=nl(t,l),o=new Blob([a],{type:"image/svg+xml;charset=utf-8"});ol(o,Yl(n,"svg"))}function Ul(t,n="chart.png"){const l=typeof n=="string"?{fileName:n}:n,a=Yl(l.fileName??"chart.png","png"),o=sl(t),s=l.scale??(typeof window<"u"?window.devicePixelRatio||1:2),u=nl(t,o),c=new Blob([u],{type:"image/svg+xml;charset=utf-8"}),i=URL.createObjectURL(c);return new Promise((r,d)=>{const v=new Image;v.decoding="async",v.onload=()=>{try{const g=document.createElement("canvas");g.width=Math.max(1,Math.round(o.width*s)),g.height=Math.max(1,Math.round(o.height*s));const m=g.getContext("2d");if(!m){URL.revokeObjectURL(i),d(new Error("Canvas 2D context unavailable"));return}m.scale(s,s),l.background&&(m.fillStyle=l.background,m.fillRect(0,0,o.width,o.height)),m.drawImage(v,0,0,o.width,o.height),URL.revokeObjectURL(i),g.toBlob(h=>{if(!h){d(new Error("canvas.toBlob produced null"));return}ol(h,a),r()},"image/png")}catch(g){URL.revokeObjectURL(i),d(g instanceof Error?g:new Error(String(g)))}},v.onerror=()=>{URL.revokeObjectURL(i),d(new Error("SVG image decoding failed"))},v.src=i})}function Rt(t,n){const l=[e.h("path",{d:t})];return n&&l.push(n),e.h("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":1.5,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},l)}const Ts=()=>Rt("M4 6V2.5h8V6",[e.h("rect",{x:3,y:6,width:10,height:6,rx:1}),e.h("path",{d:"M4.5 10h7v3.5h-7z"})]),Ms=()=>Rt("M3 8.5v3.25A1.25 1.25 0 0 0 4.25 13h7.5A1.25 1.25 0 0 0 13 11.75V8.5",[e.h("path",{d:"M8 2.5v7"}),e.h("path",{d:"M5 6.5l3 3 3-3"})]),Ls=()=>Rt("M2.5 3.5h11v9h-11z",[e.h("circle",{cx:5.5,cy:6.5,r:.9}),e.h("path",{d:"M2.5 11l3-3 2.5 2.5L10.5 8l3 3"})]),Fs=()=>Rt("M3 8a5 5 0 1 0 1.5-3.5",e.h("path",{d:"M3 3v3h3"}));function ql(t){const n=[{id:"print",label:"Print",icon:Ts(),onClick:({svg:l})=>{at(l,t.fileName?{fileName:t.fileName}:{})}},{id:"downloadSvg",label:"Download SVG",icon:Ms(),onClick:({svg:l,fileName:a})=>{Wl(l,`${a??"chart"}.svg`)}},{id:"downloadPng",label:"Download PNG",icon:Ls(),onClick:({svg:l,fileName:a})=>{Ul(l,`${a??"chart"}.png`).catch(()=>{})}}];return t.brushReset&&n.push({id:"resetBrush",label:"Reset zoom",icon:Fs(),onClick:({brushReset:l})=>l==null?void 0:l()}),n}function As(t,n){return t?t===!0?ql(n):t:null}function Ps(t,n){if(t)return l=>{l.preventDefault(),l.stopPropagation(),t(l,n)}}function Rs(t){if(t)return n=>{var r;n.preventDefault();const l=n.currentTarget;if(!l)return;const a=l.getBoundingClientRect(),o=n.clientX-a.left,s=n.clientY-a.top;let u=o,c=s;const i=(r=l.viewBox)==null?void 0:r.baseVal;i&&i.width>0&&i.height>0&&a.width>0&&a.height>0&&(u=o/a.width*i.width,c=s/a.height*i.height),t(n,{x:o,y:s,plotX:u,plotY:c})}}const Is=["data-selection-mode","data-sg-drop","aria-label"],_s=["data-zoom","data-pan-x","data-pan-y"],Ks=["width","height"],Hs={key:0},Os=["data-edge-id"],js=["d","onContextmenu","onMouseenter"],Ys=["d","data-edge-id","marker-end"],Ws=["d","data-edge-id","marker-end"],Us=["data-node-id","data-selected","data-sg-dragging","onPointerdown","onClick","onContextmenu","onMouseenter"],qs=["data-node-id"],Xs=["data-action-id","aria-label","title","onClick"],Gs=["data-edge-id"],Js=["data-action-id","aria-label","title","onClick"],Zs=8,El=8,xl=.5,$l=200,Nl=150,Qs=e.defineComponent({__name:"Diagram",props:{graph:{},state:{},width:{default:"100%"},height:{default:400},unstyled:{type:Boolean,default:!1},className:{},style:{},draggable:{type:[Boolean,Function],default:!1},zoomable:{type:Boolean,default:!1},panable:{type:Boolean,default:!1},snapToGrid:{},routeAroundNodes:{type:Boolean,default:!1},routingOptions:{},edgeArrows:{type:Boolean,default:!0},selectionMode:{default:"single"},selection:{},selectedNodeIds:{},defaultSelection:{},nodeActions:{},edgeActions:{},dropTypes:{},fileName:{default:"diagram"},draggableNodes:{type:Boolean},panZoom:{type:Boolean}},emits:["node-click","selection-change","selectionChange","drop-node","dropNode","node-context-menu","edge-context-menu","canvas-context-menu"],setup(t,{expose:n,emit:l}){const a=t,o=l,s=e.ref(null),u=e.ref(null),c=e.computed(()=>typeof a.draggable=="function"?a.draggable:!!(a.draggable||a.draggableNodes)),i=e.computed(()=>a.panable||!!a.panZoom),r=e.computed(()=>a.zoomable||!!a.panZoom),d=e.computed(()=>a.selection!==void 0||a.selectedNodeIds!==void 0),v=e.computed(()=>a.selection??a.selectedNodeIds??[]),g=e.ref(a.defaultSelection??[]),m=e.computed(()=>d.value?v.value:g.value),h=e.computed(()=>new Set(m.value));function p(F){if(b(m.value,F))return;const K=Array.isArray(F)?F:Array.from(F);d.value||(g.value=K),o("selection-change",K),o("selectionChange",K)}function b(F,K){if(F===K)return!0;if(F.length!==K.length)return!1;const J=new Set(F);for(const pe of K)if(!J.has(pe))return!1;return!0}e.watch(()=>a.state,F=>{if(d.value)return;const K=g.value.filter(J=>F.nodes.has(J));K.length!==g.value.length&&(g.value=K,o("selection-change",K),o("selectionChange",K))});const y=e.ref({panX:0,panY:0,zoom:1}),E=e.computed(()=>Array.from(a.state.nodes.values())),z=e.computed(()=>Array.from(a.state.edges.values())),x=e.computed(()=>E.value.map(F=>a.graph.boundsOf(F.id))),f=e.computed(()=>{const F=new Map;return E.value.forEach((K,J)=>F.set(K.id,x.value[J])),F});function N(F,K){return{source:Oe.resolveEdgeEndpoint(F,K,El),target:Oe.resolveEdgeEndpoint(K,F,El)}}function B(F,K,J,pe,Ce,$e){var Qe,Re,Je,ot,ct,ft,ut;const Fe=K.point,He=J.point;switch(F.routing){case"orthogonal":{const dt=Oe.routeOrthogonal(Fe,He,{obstacles:pe,gridSize:(Qe=a.routingOptions)==null?void 0:Qe.gridSize,inflate:(Re=a.routingOptions)==null?void 0:Re.inflate,maxNodes:(Je=a.routingOptions)==null?void 0:Je.maxNodes,sourceBounds:Ce,targetBounds:$e,stepPosition:(ot=a.routingOptions)==null?void 0:ot.stepPosition,stubLength:(ct=a.routingOptions)==null?void 0:ct.stubLength});return Oe.pointsToRoundedPath(dt,((ft=a.routingOptions)==null?void 0:ft.cornerRadius)??Zs)}case"bezier":return Oe.getBezierPath({source:Fe,sourceSide:K.side,target:He,targetSide:J.side,curvature:(ut=a.routingOptions)==null?void 0:ut.curvature});case"manual":{const dt=F.waypoints??[];return Oe.pointsToPath([Fe,...dt,He])}case"straight":default:return`M ${Fe[0]} ${Fe[1]} L ${He[0]} ${He[1]}`}}const w=e.computed(()=>{const F=f.value,K=[];for(const J of z.value){const pe=F.get(J.from.node),Ce=F.get(J.to.node);if(!pe||!Ce)continue;const{source:$e,target:Fe}=N(pe,Ce);let He;if(a.routeAroundNodes&&J.routing==="orthogonal"){const Qe=new Set([J.from.node,J.to.node]);He=[];for(const[Re,Je]of F)Qe.has(Re)||He.push(Je)}K.push({id:String(J.id),d:B(J,$e,Fe,He,void 0,void 0),routing:J.routing,mid:{x:($e.point[0]+Fe.point[0])/2,y:($e.point[1]+Fe.point[1])/2},raw:J})}return K});let S=null;const L=e.ref(null);function T(F,K,J){let pe=K,Ce=J;a.snapToGrid&&a.snapToGrid>0&&(pe=Math.round(pe/a.snapToGrid)*a.snapToGrid,Ce=Math.round(Ce/a.snapToGrid)*a.snapToGrid);const $e=c.value;typeof $e=="function"?$e(F,pe,Ce):a.graph.moveNode(F,pe,Ce)}function P(F,K,J){const pe=J.currentTarget;try{pe.setPointerCapture(J.pointerId)}catch{}S={primaryId:F,pointerId:J.pointerId,target:pe,startX:J.clientX,startY:J.clientY,startZoom:y.value.zoom||1,members:K,moved:!1},L.value=F}function q(F){if(!S||S.pointerId!==F.pointerId)return;const K=(F.clientX-S.startX)/S.startZoom,J=(F.clientY-S.startY)/S.startZoom;if(!S.moved&&(Math.abs(K)>xl||Math.abs(J)>xl)&&(S.moved=!0),S.members.length>1)a.graph.transaction(()=>{for(const pe of S.members)T(pe.id,pe.x0+K,pe.y0+J)});else{const pe=S.members[0];T(pe.id,pe.x0+K,pe.y0+J)}}function _(F){if(!(!S||S.pointerId!==F.pointerId)){try{S.target.releasePointerCapture(S.pointerId)}catch{}S=null,L.value=null}}function R(F,K){const J=F.indexOf(K);if(J===-1)return[...F,K];const pe=F.slice();return pe.splice(J,1),pe}function U(F,K){if(F.button!==0)return;const J=a.selectionMode!=="single",pe=F.ctrlKey||F.metaKey;if(J&&pe){F.preventDefault(),F.stopPropagation(),p(R(m.value,K.id));return}if(J&&(h.value.has(K.id)||p([K.id])),!c.value)return;F.preventDefault(),F.stopPropagation();const $e=(J&&h.value.has(K.id)?Array.from(new Set([K.id,...m.value])):[K.id]).map(Fe=>{const He=a.graph.getNode(Fe);return He?{id:Fe,x0:He.transform.x,y0:He.transform.y}:null}).filter(Fe=>Fe!==null);P(K.id,$e,F)}function I(F,K){if(F.stopPropagation(),o("node-click",{id:K.id,node:K,event:F}),a.selectionMode==="single"){p([K.id]);return}if(a.selectionMode==="multi"&&(F.ctrlKey||F.metaKey||F.shiftKey)){p(R(m.value,K.id));return}p([K.id])}function X(F){if(!(!r.value&&!i.value)){if(r.value&&(F.ctrlKey||F.metaKey)){F.preventDefault();const K=F.deltaY<0?1.1:1/1.1;y.value={...y.value,zoom:Math.max(.1,Math.min(10,y.value.zoom*K))};return}i.value&&(F.preventDefault(),y.value={...y.value,panX:y.value.panX-F.deltaX,panY:y.value.panY-F.deltaY})}}const ae=e.ref(null);let A=null;function V(F,K,J,pe){return{x:Math.min(F,J),y:Math.min(K,pe),w:Math.abs(J-F),h:Math.abs(pe-K)}}function C(F){const K=y.value.zoom||1;return{x:(F.x-y.value.panX)/K,y:(F.y-y.value.panY)/K,w:F.w/K,h:F.h/K}}function k(F,K){return!(F.x+F.w<K.x||K.x+K.w<F.x||F.y+F.h<K.y||K.y+K.h<F.y)}function $(F){const K=[];for(const[J,pe]of f.value)k(pe,F)&&K.push(J);return K}let M=null;function H(F){var Ce;const K=(Ce=s.value)==null?void 0:Ce.getBoundingClientRect();if(!K)return;const J=F.clientX-K.left,pe=F.clientY-K.top;F.preventDefault();try{F.currentTarget.setPointerCapture(F.pointerId)}catch{}A={startX:J,startY:pe,initial:m.value,additive:F.shiftKey||F.ctrlKey||F.metaKey},M={kind:"lasso",pointerId:F.pointerId},ae.value={x:J,y:pe,w:0,h:0}}function O(F){F.preventDefault();try{F.currentTarget.setPointerCapture(F.pointerId)}catch{}M={kind:"pan",pointerId:F.pointerId,startX:F.clientX,startY:F.clientY,panX:y.value.panX,panY:y.value.panY}}function Q(F){if(i.value&&F.button===1){O(F);return}if(F.button===0&&!F.target.closest("[data-node-id]")){if(a.selectionMode==="lasso"){H(F);return}a.selectionMode==="multi"&&m.value.length>0&&(F.shiftKey||F.ctrlKey||F.metaKey||p([]))}}function re(F){var Qe;if(!M||M.pointerId!==F.pointerId)return;if(M.kind==="pan"){const Re=M;y.value={...y.value,panX:Re.panX+(F.clientX-Re.startX),panY:Re.panY+(F.clientY-Re.startY)};return}const K=(Qe=s.value)==null?void 0:Qe.getBoundingClientRect();if(!K||!A)return;const J=F.clientX-K.left,pe=F.clientY-K.top,Ce=V(A.startX,A.startY,J,pe);ae.value=Ce;const $e=C(Ce),Fe=$($e),He=A.additive?Array.from(new Set([...A.initial,...Fe])):Fe;p(He)}function ce(F){if(!(!M||M.pointerId!==F.pointerId)){try{F.currentTarget.releasePointerCapture(M.pointerId)}catch{}M.kind==="lasso"&&(A=null,ae.value=null),M=null}}function ne(F){F.target.closest("[data-node-id]")||a.selectionMode==="single"&&m.value.length>0&&p([])}const de=e.getCurrentInstance(),ye=Ee(),Me=e.computed(()=>{var F,K;return((K=(F=ye.value.locale)==null?void 0:F.diagram)==null?void 0:K.ariaLabel)??"Diagram"}),Ne=e.computed(()=>{var K;const F=((K=de==null?void 0:de.vnode)==null?void 0:K.props)??{};return!!(F["onDrop-node"]||F.onDropNode)}),Ie=e.computed(()=>a.dropTypes==="*"||a.dropTypes===null?null:a.dropTypes===void 0?["application/x-sg-node"]:a.dropTypes);function ze(F){var J;if(!Ie.value)return!0;const K=(J=F.dataTransfer)==null?void 0:J.types;if(!K||K.length===0)return!1;for(const pe of Ie.value)for(let Ce=0;Ce<K.length;Ce++)if(K[Ce]===pe)return!0;return!1}function We(F){ze(F)&&(F.preventDefault(),F.dataTransfer&&(F.dataTransfer.dropEffect="copy"))}function Ge(F){var He;if(!ze(F))return;F.preventDefault();const K=(He=s.value)==null?void 0:He.getBoundingClientRect();if(!K)return;const J=F.clientX-K.left,pe=F.clientY-K.top,Ce=(J-y.value.panX)/(y.value.zoom||1),$e=(pe-y.value.panY)/(y.value.zoom||1),Fe={x:Ce,y:$e,screenX:F.clientX,screenY:F.clientY,dataTransfer:F.dataTransfer};o("drop-node",Fe),o("dropNode",Fe)}function G(F){var Fe;if(F.target.closest("[data-node-id]"))return;F.preventDefault();const K=(Fe=s.value)==null?void 0:Fe.getBoundingClientRect();if(!K)return;const J=F.clientX-K.left,pe=F.clientY-K.top,Ce=(J-y.value.panX)/(y.value.zoom||1),$e=(pe-y.value.panY)/(y.value.zoom||1);o("canvas-context-menu",{event:F,point:{x:Ce,y:$e,screenX:F.clientX,screenY:F.clientY}})}function le(F,K){F.stopPropagation(),F.preventDefault(),o("node-context-menu",{event:F,node:K})}function fe(F,K){F.stopPropagation(),F.preventDefault(),o("edge-context-menu",{event:F,edge:K})}const be=e.ref(null),Ve=e.ref(null);let De=null,xe=null,Le=null,Te=null;function we(F){F!=null&&window.clearTimeout(F)}function oe(F){xe!=null&&(we(xe),xe=null),be.value!==F&&(De!=null&&we(De),De=window.setTimeout(()=>{be.value=F,De=null},$l))}function ge(){De!=null&&(we(De),De=null),xe!=null&&we(xe),xe=window.setTimeout(()=>{be.value=null,xe=null},Nl)}function se(F){Te!=null&&(we(Te),Te=null),Ve.value!==F&&(Le!=null&&we(Le),Le=window.setTimeout(()=>{Ve.value=F,Le=null},$l))}function ke(){Le!=null&&(we(Le),Le=null),Te!=null&&we(Te),Te=window.setTimeout(()=>{Ve.value=null,Te=null},Nl)}e.onBeforeUnmount(()=>{if(we(De),we(xe),we(Le),we(Te),S){try{S.target.releasePointerCapture(S.pointerId)}catch{}S=null}M=null});const Ke=e.computed(()=>{var F;return(((F=a.nodeActions)==null?void 0:F.length)??0)>0}),je=e.computed(()=>{var F;return(((F=a.edgeActions)==null?void 0:F.length)??0)>0}),te=e.computed(()=>je.value),ie=e.computed(()=>be.value!=null?a.state.nodes.get(be.value)??null:null),me=e.computed(()=>be.value!=null?f.value.get(be.value)??null:null),Se=e.computed(()=>Ve.value!=null?a.state.edges.get(Ve.value)??null:null),Be=e.computed(()=>{if(!Se.value)return null;const F=f.value.get(Se.value.from.node),K=f.value.get(Se.value.to.node);if(!F||!K)return null;const{source:J,target:pe}=N(F,K);return{x:(J.point[0]+pe.point[0])/2,y:(J.point[1]+pe.point[1])/2}}),Ae=e.computed(()=>{if(x.value.length===0)return{x:0,y:0,w:0,h:0};let F=1/0,K=1/0,J=-1/0,pe=-1/0;for(const Ce of x.value)Ce.x<F&&(F=Ce.x),Ce.y<K&&(K=Ce.y),Ce.x+Ce.w>J&&(J=Ce.x+Ce.w),Ce.y+Ce.h>pe&&(pe=Ce.y+Ce.h);return{x:F,y:K,w:J-F,h:pe-K}}),Ue=e.computed(()=>a.unstyled?[a.className].filter(Boolean):["sg-diagram",a.snapToGrid?"sg-diagram-grid":"",a.className].filter(Boolean)),et=e.computed(()=>{const F={position:"relative",width:typeof a.width=="number"?`${a.width}px`:a.width,height:typeof a.height=="number"?`${a.height}px`:a.height,overflow:"hidden"};return a.snapToGrid&&(F["--sg-grid-size"]=`${a.snapToGrid*y.value.zoom}px`,F.backgroundPosition=`${y.value.panX}px ${y.value.panY}px`),{...F,...a.style??{}}}),Pe=e.computed(()=>({position:"absolute",top:0,left:0,transform:`translate(${y.value.panX}px, ${y.value.panY}px) scale(${y.value.zoom})`,transformOrigin:"0 0",width:"100%",height:"100%"}));function nt(F){if(a.unstyled)return[];const K=h.value.has(F.id),J=L.value===F.id;return["sg-diagram-node",`sg-diagram-node-${F.outline.kind}`,c.value?"sg-diagram-node-draggable":"",K?"sg-diagram-node-selected":"",K?"sg-diagram-node--selected":"",J?"sg-diagram-node-dragging":""].filter(Boolean)}function Y(F){const K=f.value.get(F.id);if(!K)return{};const J=L.value===F.id;return{position:"absolute",left:`${K.x}px`,top:`${K.y}px`,width:`${K.w}px`,height:`${K.h}px`,cursor:c.value?J?"grabbing":"grab":void 0,userSelect:c.value?"none":void 0}}function ee(F){return(a.nodeActions??[]).filter(K=>{var J;return!((J=K.hidden)!=null&&J.call(K,F))})}function he(F){return(a.edgeActions??[]).filter(K=>{var J;return!((J=K.hidden)!=null&&J.call(K,F))})}return n({print:F=>{s.value&&at(s.value,{...F,fileName:(F==null?void 0:F.fileName)??a.fileName??"diagram"})}}),(F,K)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:s,class:e.normalizeClass(Ue.value),style:e.normalizeStyle(et.value),"data-selection-mode":a.selectionMode,"data-sg-drop":Ne.value?"true":void 0,role:"application","aria-label":Me.value,onWheel:K[12]||(K[12]=J=>r.value||i.value?X(J):void 0),onPointerdown:Q,onPointermove:re,onPointerup:ce,onPointercancel:ce,onLostpointercapture:ce,onContextmenu:G,onDragover:K[13]||(K[13]=J=>Ne.value?We(J):void 0),onDrop:K[14]||(K[14]=J=>Ne.value?Ge(J):void 0)},[e.createElementVNode("div",{ref_key:"canvasRef",ref:u,class:e.normalizeClass(a.unstyled?void 0:"sg-diagram-canvas"),style:e.normalizeStyle(Pe.value),"data-zoom":y.value.zoom,"data-pan-x":y.value.panX,"data-pan-y":y.value.panY,onClick:ne},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(a.unstyled?void 0:"sg-diagram-edges"),width:Math.max(Ae.value.w+Ae.value.x,0)||"100%",height:Math.max(Ae.value.h+Ae.value.y,0)||"100%",style:{position:"absolute",inset:0,pointerEvents:"none"},"aria-hidden":"true"},[a.edgeArrows?(e.openBlock(),e.createElementBlock("defs",Hs,[...K[15]||(K[15]=[e.createElementVNode("marker",{id:"sg-diagram-arrow",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:"12",markerHeight:"12",orient:"auto-start-reverse",markerUnits:"strokeWidth"},[e.createElementVNode("path",{d:"M -7 -5 L 0 0 L -7 5",fill:"none",stroke:"context-stroke","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",class:"sg-diagram-arrow-fill"})],-1)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,J=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:J.id},[te.value?(e.openBlock(),e.createElementBlock("g",{key:0,"data-edge-id":J.id},[e.createElementVNode("path",{d:J.d,class:"sg-diagram-edge-hit",fill:"none",stroke:"transparent","stroke-width":16,"data-edge-hit":"true",style:{pointerEvents:"stroke",cursor:"context-menu"},onContextmenu:pe=>fe(pe,J.raw),onMouseenter:pe=>se(J.id),onMouseleave:K[0]||(K[0]=pe=>ke())},null,40,js),e.createElementVNode("path",{d:J.d,class:e.normalizeClass(`sg-diagram-edge sg-diagram-edge-${J.routing}`),fill:"none","data-edge-id":J.id,"marker-end":a.edgeArrows?"url(#sg-diagram-arrow)":void 0,style:{pointerEvents:"none"}},null,10,Ys)],8,Os)):(e.openBlock(),e.createElementBlock("path",{key:1,d:J.d,class:e.normalizeClass(`sg-diagram-edge sg-diagram-edge-${J.routing}`),fill:"none","data-edge-id":J.id,"marker-end":a.edgeArrows?"url(#sg-diagram-arrow)":void 0},null,10,Ws))],64))),128))],10,Ks)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,J=>(e.openBlock(),e.createElementBlock("div",{key:J.id,"data-node-id":J.id,"data-selected":h.value.has(J.id)?"true":void 0,"data-sg-dragging":L.value===J.id?"true":void 0,class:e.normalizeClass(nt(J)),style:e.normalizeStyle(Y(J)),onPointerdown:pe=>U(pe,J),onPointermove:K[1]||(K[1]=pe=>c.value?q(pe):void 0),onPointerup:K[2]||(K[2]=pe=>c.value?_(pe):void 0),onPointercancel:K[3]||(K[3]=pe=>c.value?_(pe):void 0),onLostpointercapture:K[4]||(K[4]=pe=>c.value?_(pe):void 0),onClick:pe=>I(pe,J),onContextmenu:pe=>le(pe,J),onMouseenter:pe=>Ke.value?oe(J.id):void 0,onMouseleave:K[5]||(K[5]=pe=>Ke.value?ge():void 0)},[e.renderSlot(F.$slots,"node",{node:J},()=>[e.createTextVNode(e.toDisplayString(J.id),1)])],46,Us))),128))],14,_s),Ke.value&&ie.value&&me.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(a.unstyled?void 0:"sg-diagram-hover-actions"),"data-node-id":String(ie.value.id),style:e.normalizeStyle({position:"absolute",left:`${y.value.panX+(me.value.x+me.value.w/2)*y.value.zoom}px`,top:`${y.value.panY+me.value.y*y.value.zoom}px`,transform:"translate(-50%, calc(-100% - 8px))",pointerEvents:"auto",zIndex:5}),onMouseenter:K[7]||(K[7]=J=>oe(ie.value.id)),onMouseleave:K[8]||(K[8]=J=>ge())},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee(ie.value),J=>(e.openBlock(),e.createElementBlock("button",{key:J.id,type:"button","data-action-id":J.id,class:e.normalizeClass(a.unstyled?void 0:"sg-diagram-hover-action"),"aria-label":J.label??J.id,title:J.label,onMousedown:K[6]||(K[6]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(pe=>J.onClick(ie.value,pe),["stop"])},[J.icon?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(J.icon),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(J.label??J.id),1)],64))],42,Xs))),128))],46,qs)):e.createCommentVNode("",!0),je.value&&Se.value&&Be.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(a.unstyled?void 0:"sg-diagram-hover-actions"),"data-edge-id":String(Se.value.id),style:e.normalizeStyle({position:"absolute",left:`${y.value.panX+Be.value.x*y.value.zoom}px`,top:`${y.value.panY+Be.value.y*y.value.zoom}px`,transform:"translate(-50%, -50%)",pointerEvents:"auto",zIndex:5}),onMouseenter:K[10]||(K[10]=J=>se(String(Se.value.id))),onMouseleave:K[11]||(K[11]=J=>ke())},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he(Se.value),J=>(e.openBlock(),e.createElementBlock("button",{key:J.id,type:"button","data-action-id":J.id,class:e.normalizeClass(a.unstyled?void 0:"sg-diagram-hover-action"),"aria-label":J.label??J.id,title:J.label,onMousedown:K[9]||(K[9]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(pe=>J.onClick(Se.value,pe),["stop"])},[J.icon?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(J.icon),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(J.label??J.id),1)],64))],42,Js))),128))],46,Gs)):e.createCommentVNode("",!0),ae.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(a.unstyled?void 0:"sg-diagram-lasso"),style:e.normalizeStyle({position:"absolute",left:`${ae.value.x}px`,top:`${ae.value.y}px`,width:`${ae.value.w}px`,height:`${ae.value.h}px`,pointerEvents:"none"})},null,6)):e.createCommentVNode("",!0)],46,Is))}}),er=["aria-label"],tr=["data-widget-id"],lr=e.defineComponent({__name:"Dashboard",props:{widgets:{},columns:{default:12},rowHeight:{default:80},gap:{default:8},className:{},style:{},unstyled:{type:Boolean,default:!1}},setup(t,{expose:n}){const l=t,a=e.ref(null),o=Ee(),s=e.computed(()=>{var i,r;return((r=(i=o.value.locale)==null?void 0:i.dashboard)==null?void 0:r.ariaLabel)??"Dashboard"}),u=e.computed(()=>({display:"grid",gridTemplateColumns:`repeat(${l.columns}, 1fr)`,gridAutoRows:`${l.rowHeight}px`,gap:`${l.gap}px`,...l.style??{}})),c=i=>({gridColumnStart:i.x,gridColumnEnd:`span ${i.w??1}`,gridRowStart:i.y,gridRowEnd:`span ${i.h??1}`,...i.style??{}});return n({print:(i={})=>{a.value&&at(a.value,{fileName:i.fileName??"dashboard"})}}),(i,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:a,class:e.normalizeClass([!l.unstyled&&"sg-dashboard",l.className]),style:e.normalizeStyle(u.value),role:"region","aria-label":s.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.widgets,d=>(e.openBlock(),e.createElementBlock("div",{key:d.id,"data-widget-id":d.id,class:e.normalizeClass([!l.unstyled&&"sg-dashboard-widget",d.className]),style:e.normalizeStyle(c(d))},[d.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(l.unstyled?void 0:"sg-dashboard-widget-header")},e.toDisplayString(d.title),3)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(l.unstyled?void 0:"sg-dashboard-widget-body")},[e.renderSlot(i.$slots,"widget",{widget:d})],2)],14,tr))),128))],14,er))}}),ar=["aria-label"],nr=["data-widget-id"],or=["onPointerdown"],sr=["aria-label","onPointerdown"],rr=e.defineComponent({__name:"DashboardEditor",props:{draggable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},minW:{default:1},minH:{default:1},widgets:{},columns:{default:12},rowHeight:{default:80},gap:{default:8},className:{},style:{},unstyled:{type:Boolean,default:!1}},emits:["layout-change"],setup(t,{expose:n,emit:l}){const a=t,o=l,s=e.ref(null),u=e.ref(a.widgets.map(z=>({...z}))),c=Ee(),i=e.computed(()=>{var z,x;return((x=(z=c.value.locale)==null?void 0:z.dashboard)==null?void 0:x.editorAriaLabel)??"Dashboard editor"}),r=e.computed(()=>{var z,x;return((x=(z=c.value.locale)==null?void 0:z.dashboard)==null?void 0:x.resizeWidget)??"Resize widget"}),d=e.computed(()=>u.value),v=e.computed(()=>({display:"grid",gridTemplateColumns:`repeat(${a.columns}, 1fr)`,gridAutoRows:`${a.rowHeight}px`,gap:`${a.gap}px`,...a.style??{}})),g=z=>({gridColumnStart:z.x,gridColumnEnd:`span ${z.w??1}`,gridRowStart:z.y,gridRowEnd:`span ${z.h??1}`,...z.style??{}});let m=null;const h=()=>{const z=s.value;return z?{cw:(z.clientWidth-a.gap*(a.columns-1))/a.columns+a.gap,ch:a.rowHeight+a.gap}:{cw:0,ch:a.rowHeight+a.gap}},p=(z,x)=>{var f,N;a.draggable&&((N=(f=z.target).setPointerCapture)==null||N.call(f,z.pointerId),m={type:"move",id:x.id,startX:z.clientX,startY:z.clientY,origin:{...x}})},b=(z,x)=>{var f,N;a.resizable&&(z.stopPropagation(),(N=(f=z.target).setPointerCapture)==null||N.call(f,z.pointerId),m={type:"resize",id:x.id,startX:z.clientX,startY:z.clientY,origin:{...x}})},y=z=>{const x=m;if(!x)return;const{cw:f,ch:N}=h();if(f===0)return;const B=Math.round((z.clientX-x.startX)/f),w=Math.round((z.clientY-x.startY)/N);u.value=u.value.map(S=>{if(S.id!==x.id)return S;if(x.type==="move"){const L=Math.max(1,x.origin.x+B),T=Math.max(1,x.origin.y+w);return{...S,x:Math.min(a.columns-(S.w??1)+1,L),y:T}}return{...S,w:Math.max(a.minW,(x.origin.w??1)+B),h:Math.max(a.minH,(x.origin.h??1)+w)}})},E=()=>{m&&o("layout-change",u.value.map(z=>({...z}))),m=null};return n({print:(z={})=>{s.value&&at(s.value,{fileName:z.fileName??"dashboard"})},getLayout:()=>u.value.map(z=>({...z}))}),(z,x)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:s,class:e.normalizeClass([!a.unstyled&&"sg-dashboard sg-dashboard-editor",a.className]),style:e.normalizeStyle(v.value),role:"region","aria-label":i.value,onPointermove:y,onPointerup:E},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,f=>(e.openBlock(),e.createElementBlock("div",{key:f.id,"data-widget-id":f.id,class:e.normalizeClass([!a.unstyled&&"sg-dashboard-widget",f.className]),style:e.normalizeStyle(g(f))},[e.createElementVNode("div",{class:e.normalizeClass(a.unstyled?void 0:"sg-dashboard-widget-header"),style:e.normalizeStyle({cursor:a.draggable?"move":"default"}),onPointerdown:N=>p(N,f)},e.toDisplayString(f.title??f.id),47,or),e.createElementVNode("div",{class:e.normalizeClass(a.unstyled?void 0:"sg-dashboard-widget-body")},[e.renderSlot(z.$slots,"widget",{widget:f})],2),a.resizable?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-dashboard-resize-handle",role:"button","aria-label":r.value,style:{position:"absolute",right:0,bottom:0,width:"12px",height:"12px",cursor:"se-resize"},onPointerdown:N=>b(N,f)},null,40,sr)):e.createCommentVNode("",!0)],14,nr))),128))],46,ar))}}),ir=["aria-label","data-scale"],cr=["data-row-index","data-row-key"],ur=["data-tick-time"],dr=["data-row-index"],mr=["aria-label","data-task-id","data-row-index","onPointerdown"],pr=["data-progress"],vr=["aria-label","onPointerdown"],gr=["width","height"],fr=["d","data-dep-id"],Nt=864e5,hr=14,yr=e.defineComponent({__name:"Gantt",props:{tasks:{},resources:{},scale:{default:"day"},range:{},rowHeight:{default:32},columnWidth:{default:40},sidebarWidth:{default:200},draggable:{type:Boolean,default:!1},resizable:{type:Boolean,default:!1},unstyled:{type:Boolean,default:!1},className:{},style:{}},emits:["task-change"],setup(t,{expose:n,emit:l}){const a=t,o=l,s=Ee(),u=e.computed(()=>{var _,R;return((R=(_=s.value.locale)==null?void 0:_.gantt)==null?void 0:R.ariaLabel)??"Gantt chart"}),c=e.computed(()=>{var _,R;return((R=(_=s.value.locale)==null?void 0:_.gantt)==null?void 0:R.resizeTask)??"Resize task"}),i={day:Nt,week:7*Nt,month:30*Nt,quarter:90*Nt},r=_=>_ instanceof Date?_.getTime():_,d=(_,R)=>Math.floor(_/R)*R,v=(_,R)=>Math.ceil(_/R)*R,g=(_,R,U)=>Math.max(R,Math.min(U,_));function m(_,R,U){const I=new Date(_);switch(R){case"day":{const X=String(I.getUTCDate()).padStart(2,"0");if(U<32){if(I.getUTCDate()===1){const A=String(I.getUTCMonth()+1).padStart(2,"0");return`${X}.${A}`}return X}const ae=String(I.getUTCMonth()+1).padStart(2,"0");return`${X}.${ae}`}case"week":{const X=String(I.getUTCDate()).padStart(2,"0"),ae=String(I.getUTCMonth()+1).padStart(2,"0");return`W ${X}.${ae}`}case"month":return`${String(I.getUTCMonth()+1).padStart(2,"0")}.${I.getUTCFullYear()}`;case"quarter":return`Q${Math.floor(I.getUTCMonth()/3)+1} ${I.getUTCFullYear()}`}}function h(_,R){if(_.length===0){const X=Date.now();return{from:new Date(d(X,R)),to:new Date(v(X+R,R))}}let U=1/0,I=-1/0;for(const X of _){const ae=r(X.start),A=r(X.end);ae<U&&(U=ae),A>I&&(I=A)}return{from:new Date(d(U-R,R)),to:new Date(v(I+R,R))}}const p=e.computed(()=>{const _=i[a.scale],R=a.range??h(a.tasks,_),U=R.from.getTime(),I=R.to.getTime(),X=a.columnWidth/_,ae=(I-U)*X;let A,V;if(a.resources&&a.resources.length>0){const C=a.resources;A=C.map($=>({key:$.id,label:$.name}));const k=new Map(C.map(($,M)=>[$.id,M]));V=$=>$.resourceId?k.get($.resourceId)??0:0}else{A=a.tasks.map(k=>({key:k.id,label:k.name}));const C=new Map(a.tasks.map((k,$)=>[k.id,$]));V=k=>C.get(k.id)??0}return{rangeStart:U,rangeEnd:I,step:_,totalWidth:ae,pxPerMs:X,rows:A,rowOf:V}}),b=e.computed(()=>{const _=[],{rangeStart:R,rangeEnd:U,step:I,pxPerMs:X}=p.value;for(let ae=R;ae<U;ae+=I)_.push({x:(ae-R)*X,label:m(ae,a.scale,a.columnWidth),time:ae});return _}),y=e.computed(()=>{const{rangeStart:_,pxPerMs:R,rowOf:U}=p.value,I=a.rowHeight;return a.tasks.map(X=>{const ae=r(X.start),A=r(X.end),V=(ae-_)*R,C=Math.max(2,(A-ae)*R),k=U(X),$=k*I;return{task:X,x:V,y:$,w:C,h:I,row:k}})}),E=e.computed(()=>{const _=new Map;for(const R of y.value)_.set(R.task.id,R);return _}),z=e.computed(()=>{const _=[];for(const I of y.value){const X=I.task.dependencies;if(!(!X||X.length===0))for(const ae of X){const A=E.value.get(ae);if(!A)continue;const V=A.x+A.w,C=A.y+A.h/2,k=I.x,$=I.y+I.h/2;let M;if(k>=V+8+18){const H=V+8;M=[[V,C],[H,C],[H,$],[k,$]]}else{const H=A.y+A.h;M=[[V,C],[V+8,C],[V+8,H],[k-18,H],[k-18,$],[k,$]]}_.push({id:`${ae}->${I.task.id}`,d:Oe.pointsToPath(M)})}}return _}),x=e.computed(()=>a.rowHeight),f=e.computed(()=>p.value.rows.length*a.rowHeight),N=e.computed(()=>f.value+x.value+hr),B=e.computed(()=>({display:"grid",gridTemplateColumns:`${a.sidebarWidth}px minmax(0, 1fr)`,width:"100%",overflow:"hidden",height:`${N.value}px`,...a.style??{}})),w=e.computed(()=>a.unstyled?a.className:["sg-gantt",a.className].filter(Boolean).join(" ")),S=e.ref(null);function L(_,R,U){var X;if(_.button!==void 0&&_.button!==0||U==="move"&&!a.draggable||U==="resize"&&!a.resizable)return;_.preventDefault(),_.stopPropagation();const I=_.currentTarget;(X=I==null?void 0:I.setPointerCapture)==null||X.call(I,_.pointerId),S.value={kind:U,taskId:R.id,startClientX:_.clientX,origStart:r(R.start),origEnd:r(R.end),lastStart:r(R.start),lastEnd:r(R.end),pointerId:_.pointerId,captureTarget:I}}function T(_){const R=S.value;if(!R)return;const U=a.tasks.find($=>$.id===R.taskId);if(!U)return;const{step:I,pxPerMs:X}=p.value,A=(_.clientX-R.startClientX)/X,V=Math.round(A/I)*I;let C=R.origStart,k=R.origEnd;R.kind==="move"?(C=R.origStart+V,k=R.origEnd+V):k=Math.max(R.origStart+I,R.origEnd+V),!(C===R.lastStart&&k===R.lastEnd)&&(R.lastStart=C,R.lastEnd=k,o("task-change",{...U,start:C,end:k}))}function P(){var R,U;const _=S.value;_&&((U=(R=_.captureTarget)==null?void 0:R.releasePointerCapture)==null||U.call(R,_.pointerId)),S.value=null}e.onBeforeUnmount(()=>{S.value=null});const q=e.ref(null);return n({containerRef:q}),(_,R)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:q,class:e.normalizeClass(w.value),style:e.normalizeStyle(B.value),role:"region","aria-label":u.value,"data-scale":a.scale,onPointermove:T,onPointerup:P,onPointercancel:P},[e.createElementVNode("div",{class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-sidebar"),style:e.normalizeStyle({width:`${a.sidebarWidth}px`})},[e.createElementVNode("div",{class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-sidebar-header"),style:e.normalizeStyle({height:`${x.value}px`})},null,6),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value.rows,(U,I)=>(e.openBlock(),e.createElementBlock("div",{key:U.key,class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-sidebar-row"),style:e.normalizeStyle({height:`${a.rowHeight}px`}),"data-row-index":I,"data-row-key":U.key},e.toDisplayString(U.label),15,cr))),128))],6),e.createElementVNode("div",{class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-main"),style:{position:"relative",overflowX:"auto",overflowY:"hidden",minWidth:0}},[e.createElementVNode("div",{style:e.normalizeStyle({position:"relative",width:`${p.value.totalWidth}px`,minWidth:"100%"})},[e.createElementVNode("div",{class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-header"),style:e.normalizeStyle({position:"relative",height:`${x.value}px`,width:`${p.value.totalWidth}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,U=>(e.openBlock(),e.createElementBlock("div",{key:U.time,class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-tick"),style:e.normalizeStyle({position:"absolute",left:`${U.x}px`,top:0,width:`${a.columnWidth}px`,height:`${x.value}px`}),"data-tick-time":U.time},e.toDisplayString(U.label),15,ur))),128))],6),e.createElementVNode("div",{class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-grid"),style:e.normalizeStyle({position:"relative",width:`${p.value.totalWidth}px`,height:`${f.value}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value.rows,(U,I)=>(e.openBlock(),e.createElementBlock("div",{key:U.key,class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-row"),style:e.normalizeStyle({position:"absolute",left:0,top:`${I*a.rowHeight}px`,width:`${p.value.totalWidth}px`,height:`${a.rowHeight}px`}),"data-row-index":I},null,14,dr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,U=>(e.openBlock(),e.createElementBlock("div",{key:U.task.id,class:e.normalizeClass(a.unstyled?void 0:["sg-gantt-bar",a.draggable?"sg-gantt-bar-draggable":"",a.resizable?"sg-gantt-bar-resizable":""].filter(Boolean).join(" ")),style:e.normalizeStyle({position:"absolute",left:`${U.x}px`,top:`${U.y+4}px`,width:`${U.w}px`,height:`${U.h-8}px`,background:U.task.color,cursor:a.draggable?"grab":void 0,userSelect:a.draggable||a.resizable?"none":void 0}),role:"button",tabindex:"0","aria-label":U.task.name,"data-task-id":U.task.id,"data-row-index":U.row,onPointerdown:I=>L(I,U.task,"move")},[(U.task.progress??0)>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-bar-progress"),style:e.normalizeStyle({position:"absolute",left:0,top:0,bottom:0,width:`${g(U.task.progress??0,0,1)*100}%`}),"data-progress":g(U.task.progress??0,0,1)},null,14,pr)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-bar-label"),style:{position:"relative",zIndex:1}},e.toDisplayString(U.task.name),3),a.resizable?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-bar-resize"),role:"button","aria-label":c.value,tabindex:"-1","data-role":"resize-handle",style:{position:"absolute",right:0,top:0,bottom:0,width:"6px",cursor:"ew-resize"},onPointerdown:I=>L(I,U.task,"resize")},null,42,vr)):e.createCommentVNode("",!0)],46,mr))),128)),z.value.length>0?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-deps"),width:p.value.totalWidth,height:f.value,style:{position:"absolute",inset:0,pointerEvents:"none",overflow:"visible"},"aria-hidden":"true"},[R[0]||(R[0]=e.createElementVNode("defs",null,[e.createElementVNode("marker",{id:"sg-gantt-arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto"},[e.createElementVNode("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"currentColor"})])],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,U=>(e.openBlock(),e.createElementBlock("path",{key:U.id,d:U.d,class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-dep"),fill:"none",stroke:"currentColor","stroke-width":1.5,"marker-end":"url(#sg-gantt-arrow)","data-dep-id":U.id},null,10,fr))),128))],10,gr)):e.createCommentVNode("",!0)],6)],4)],2)],46,ir))}}),kr=["aria-label","data-orientation","data-group-by"],br=["data-group-key"],Br=["data-event-id","data-event-time"],Cr=e.defineComponent({__name:"EventTimeline",props:{events:{},orientation:{default:"vertical"},groupBy:{},unstyled:{type:Boolean,default:!1},className:{},style:{}},setup(t){const n=t;function l(v){return v instanceof Date?v.getTime():v}function a(v,g){const m=new Date(v),h=m.getUTCFullYear(),p=m.getUTCMonth()+1,b=m.getUTCDate();switch(g){case"day":return`${h}-${String(p).padStart(2,"0")}-${String(b).padStart(2,"0")}`;case"month":return`${h}-${String(p).padStart(2,"0")}`;case"year":return`${h}`}}function o(v,g){const m=new Date(v),h=m.getUTCFullYear(),p=String(m.getUTCMonth()+1).padStart(2,"0"),b=String(m.getUTCDate()).padStart(2,"0");switch(g){case"day":return`${b}.${p}.${h}`;case"month":return`${p}.${h}`;case"year":return`${h}`}}const s=e.computed(()=>[...n.events].sort((v,g)=>l(v.date)-l(g.date))),u=e.computed(()=>{if(!n.groupBy)return[{key:"all",label:"",events:s.value}];const v=[];let g=null;for(const m of s.value){const h=a(l(m.date),n.groupBy);(!g||g.key!==h)&&(g={key:h,label:o(l(m.date),n.groupBy),events:[]},v.push(g)),g.events.push(m)}return v}),c=e.computed(()=>n.unstyled?[n.className].filter(Boolean).join(" "):["sg-event-timeline",`sg-event-timeline-${n.orientation}`,n.className].filter(Boolean).join(" ")),i=e.computed(()=>({display:"flex",flexDirection:n.orientation==="horizontal"?"row":"column",...n.style??{}})),r=Ee(),d=e.computed(()=>{var v,g;return((g=(v=r.value.locale)==null?void 0:v.timeline)==null?void 0:g.ariaLabel)??"Timeline"});return(v,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(c.value),style:e.normalizeStyle(i.value),role:"list","aria-label":d.value,"data-orientation":n.orientation,"data-group-by":n.groupBy??"none"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,m=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:m.key},[n.groupBy?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(n.unstyled?void 0:"sg-event-timeline-group"),"data-group-key":m.key},e.toDisplayString(m.label),11,br)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.events,h=>(e.openBlock(),e.createElementBlock("div",{key:h.id,class:e.normalizeClass(n.unstyled?void 0:"sg-event-timeline-item"),role:"listitem","data-event-id":h.id,"data-event-time":h.date instanceof Date?h.date.getTime():h.date},[e.createElementVNode("div",{class:e.normalizeClass(n.unstyled?void 0:"sg-event-timeline-marker")},[e.renderSlot(v.$slots,"marker",{event:h},()=>[e.createElementVNode("span",{class:e.normalizeClass(n.unstyled?void 0:"sg-event-timeline-dot"),style:e.normalizeStyle(h.color?{background:h.color}:void 0),"aria-hidden":"true"},null,6)])],2),e.createElementVNode("div",{class:e.normalizeClass(n.unstyled?void 0:"sg-event-timeline-content")},[e.renderSlot(v.$slots,"event",{event:h},()=>[e.createElementVNode("div",{class:e.normalizeClass(n.unstyled?void 0:"sg-event-timeline-title")},e.toDisplayString(h.title),3),h.description!==void 0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(n.unstyled?void 0:"sg-event-timeline-description")},e.toDisplayString(h.description),3)):e.createCommentVNode("",!0)])],2)],10,Br))),128))],64))),128))],14,kr))}}),wr=["aria-label","data-scale","data-conflict-count"],Sr=["aria-label","data-row-index","data-resource-id"],Er=["aria-label"],xr=["data-tick-time"],$r=["data-conflict-count"],Nr=["data-row-index","data-resource-id"],Vr=["data-slot-time"],Dr=["aria-label","data-assignment-id","data-status","data-resource-id","onPointerdown","onKeydown"],zr=["aria-label","onPointerdown"],Tr=["aria-label","onPointerdown"],Wt=24*60*60*1e3,Mr=e.defineComponent({__name:"ResourceCalendar",props:{resources:{},assignments:{},scale:{default:"week"},range:{},columnWidth:{default:120},rowHeight:{default:56},sidebarWidth:{default:200},draggable:{type:Boolean,default:!1},resizable:{type:Boolean,default:!1},unstyled:{type:Boolean,default:!1},className:{},style:{}},emits:["assignment-change","assignmentChange","conflict"],setup(t,{emit:n}){const l=t,a=n,o=Ee(),s=e.computed(()=>{var A,V;return((V=(A=o.value.locale)==null?void 0:A.resourceCalendar)==null?void 0:V.ariaLabel)??"Resource calendar"}),u=e.computed(()=>{var A,V;return((V=(A=o.value.locale)==null?void 0:A.resourceCalendar)==null?void 0:V.resizeStart)??"Resize start"}),c=e.computed(()=>{var A,V;return((V=(A=o.value.locale)==null?void 0:A.resourceCalendar)==null?void 0:V.resizeEnd)??"Resize end"}),i=A=>{switch(A){case"day":return Wt;case"week":return Wt*7;case"month":return Wt*30}},r=A=>A instanceof Date?A.getTime():A;function d(A,V){return Math.floor(A/V)*V}function v(A,V){return Math.ceil(A/V)*V}const g=e.computed(()=>{const A=i(l.scale);let V=1/0,C=-1/0;for(const k of l.assignments){const $=r(k.start),M=r(k.end);$<V&&(V=$),M>C&&(C=M)}if(l.range){const k=l.range.from.getTime(),$=l.range.to.getTime();return l.assignments.length===0?{from:k,to:$}:{from:d(Math.min(k,V),A),to:v(Math.max($,C),A)}}if(l.assignments.length===0){const k=Date.now();return{from:d(k,A),to:v(k+A*4,A)}}return{from:d(V-A,A),to:v(C+A,A)}}),m=e.computed(()=>g.value.to-g.value.from),h=e.computed(()=>i(l.scale)),p=e.computed(()=>Math.max(1,Math.ceil(m.value/h.value))),b=e.computed(()=>l.columnWidth/h.value),y=e.computed(()=>m.value*b.value),E=e.computed(()=>Math.max(28,Math.round(l.rowHeight*.6))),z=e.computed(()=>l.resources.length*l.rowHeight),x=e.computed(()=>z.value+E.value);function f(A,V){const C=new Date(A);switch(V){case"day":{const k=String(C.getUTCDate()).padStart(2,"0"),$=String(C.getUTCMonth()+1).padStart(2,"0");return`${k}.${$}`}case"week":{const k=String(C.getUTCDate()).padStart(2,"0"),$=String(C.getUTCMonth()+1).padStart(2,"0");return`W ${k}.${$}`}case"month":return`${String(C.getUTCMonth()+1).padStart(2,"0")}.${C.getUTCFullYear()}`}}const N=e.computed(()=>{const A=[],V=h.value;for(let C=0;C<p.value;C++){const k=g.value.from+C*V;A.push({x:C*l.columnWidth,label:f(k,l.scale),time:k})}return A}),B=e.computed(()=>{const A=new Map;return l.resources.forEach((V,C)=>A.set(V.id,C)),A}),w=e.computed(()=>{const A=new Set,V=new Map;for(const C of l.assignments){const k=V.get(C.resourceId)??[];k.push(C),V.set(C.resourceId,k)}for(const C of V.values())for(let k=0;k<C.length;k++)for(let $=k+1;$<C.length;$++){const M=r(C[k].start),H=r(C[k].end),O=r(C[$].start),Q=r(C[$].end);M<Q&&O<H&&(A.add(C[k].id),A.add(C[$].id))}return A}),S=e.computed(()=>l.assignments.map(A=>{const V=B.value.get(A.resourceId);if(V===void 0)return null;const C=r(A.start),k=r(A.end),$=(C-g.value.from)*b.value,M=Math.max(2,(k-C)*b.value),H=V*l.rowHeight;return{assignment:A,x:$,y:H,w:M,h:l.rowHeight,row:V}}).filter(A=>A!==null));function L(A){return w.value.has(A.id)?"conflict":A.status??"tentative"}function T(A){return l.unstyled?"":["sg-rcal-assignment",`sg-rcal-assignment-${L(A)}`,l.draggable?"sg-rcal-assignment-draggable":"",l.resizable?"sg-rcal-assignment-resizable":""].filter(Boolean).join(" ")}function P(A){var V;if(L(A)!=="conflict")return(V=l.resources.find(C=>C.id===A.resourceId))==null?void 0:V.color}const q=e.ref(null);function _(A,V,C){var k,$;A.button===0&&(C==="move"&&!l.draggable||C!=="move"&&!l.resizable||(A.preventDefault(),A.stopPropagation(),($=(k=A.target).setPointerCapture)==null||$.call(k,A.pointerId),q.value={kind:C,id:V.id,startClientX:A.clientX,origStart:r(V.start),origEnd:r(V.end)}))}function R(A){const V=q.value;if(!V)return;const C=l.assignments.find(ce=>ce.id===V.id);if(!C)return;const $=(A.clientX-V.startClientX)/b.value,M=h.value,H=Math.round($/M)*M;let O=V.origStart,Q=V.origEnd;V.kind==="move"?(O=V.origStart+H,Q=V.origEnd+H):V.kind==="resize-end"?Q=Math.max(V.origStart+M,V.origEnd+H):O=Math.min(V.origEnd-M,V.origStart+H);const re={...C,start:O,end:Q};a("assignment-change",re),a("assignmentChange",re)}function U(){q.value=null}function I(A,V){if(!l.draggable&&!l.resizable)return;const C=h.value,k=r(V.start),$=r(V.end);if(A.key==="ArrowLeft"||A.key==="ArrowRight"){const M=A.key==="ArrowLeft"?-1:1;A.preventDefault();let H;if(A.shiftKey&&l.resizable)H={...V,start:k,end:Math.max(k+C,$+M*C)};else if(l.draggable)H={...V,start:k+M*C,end:$+M*C};else return;a("assignment-change",H),a("assignmentChange",H)}}const X=e.computed(()=>l.unstyled?l.className??"":["sg-rcal",l.className].filter(Boolean).join(" ")),ae=e.computed(()=>({display:"grid",gridTemplateColumns:`${l.sidebarWidth}px 1fr`,width:"100%",overflow:"auto",height:`${x.value}px`,...l.style??{}}));return(A,V)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(X.value),style:e.normalizeStyle(ae.value),role:"region","aria-label":s.value,"data-scale":t.scale,"data-conflict-count":w.value.size,onPointermove:R,onPointerup:U},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-sidebar"),style:e.normalizeStyle({width:`${t.sidebarWidth}px`})},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-sidebar-header"),style:e.normalizeStyle({height:`${E.value}px`})},null,6),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.resources,(C,k)=>(e.openBlock(),e.createElementBlock("div",{key:C.id,class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-sidebar-row"),style:e.normalizeStyle({height:`${t.rowHeight}px`}),role:"row","aria-label":`Resource ${C.name}`,"data-row-index":k,"data-resource-id":C.id},[e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-sidebar-marker"),style:e.normalizeStyle(C.color?{background:C.color}:void 0),"data-role":"marker","aria-hidden":"true"},null,6),e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-sidebar-name")},e.toDisplayString(C.name),3),C.capacityPerSlot!==void 0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-sidebar-capacity"),"aria-label":`capacity ${C.capacityPerSlot} per slot`},"×"+e.toDisplayString(C.capacityPerSlot),11,Er)):e.createCommentVNode("",!0)],14,Sr))),128))],6),e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-main"),style:e.normalizeStyle({position:"relative",width:`${y.value}px`,minWidth:"100%"})},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-header"),style:e.normalizeStyle({position:"relative",height:`${E.value}px`,width:`${y.value}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,C=>(e.openBlock(),e.createElementBlock("div",{key:C.time,class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-tick"),style:e.normalizeStyle({position:"absolute",left:`${C.x}px`,top:0,width:`${t.columnWidth}px`,height:`${E.value}px`}),"data-tick-time":C.time},e.toDisplayString(C.label),15,xr))),128))],6),e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-grid"),style:e.normalizeStyle({position:"relative",width:`${y.value}px`,height:`${z.value}px`}),"data-conflict-count":w.value.size},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.resources,(C,k)=>(e.openBlock(),e.createElementBlock("div",{key:C.id,class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-row"),style:e.normalizeStyle({position:"absolute",left:0,top:`${k*t.rowHeight}px`,width:`${y.value}px`,height:`${t.rowHeight}px`}),"data-row-index":k,"data-resource-id":C.id},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,$=>(e.openBlock(),e.createElementBlock("div",{key:$.time,class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-slot"),style:e.normalizeStyle({position:"absolute",left:`${$.x}px`,top:0,width:`${t.columnWidth}px`,height:`${t.rowHeight}px`}),"data-slot-time":$.time},null,14,Vr))),128))],14,Nr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,C=>(e.openBlock(),e.createElementBlock("div",{key:C.assignment.id,class:e.normalizeClass(T(C.assignment)),style:e.normalizeStyle({position:"absolute",left:`${C.x}px`,top:`${C.y+4}px`,width:`${C.w}px`,height:`${C.h-8}px`,background:P(C.assignment),cursor:t.draggable?"grab":void 0,userSelect:t.draggable||t.resizable?"none":void 0}),role:"button",tabindex:"0","aria-label":`${C.assignment.title}${L(C.assignment)==="conflict"?" (conflict)":""}`,"data-assignment-id":C.assignment.id,"data-status":L(C.assignment),"data-resource-id":C.assignment.resourceId,onPointerdown:k=>t.draggable?_(k,C.assignment,"move"):void 0,onKeydown:k=>I(k,C.assignment)},[t.resizable?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-assignment-resize-start"),role:"button","aria-label":u.value,tabindex:"-1","data-role":"resize-handle-start",style:{position:"absolute",left:0,top:0,bottom:0,width:"6px",cursor:"ew-resize"},onPointerdown:k=>_(k,C.assignment,"resize-start")},null,42,zr)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-assignment-title"),style:{position:"relative",zIndex:1}},e.toDisplayString(C.assignment.title),3),t.resizable?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-assignment-resize-end"),role:"button","aria-label":c.value,tabindex:"-1","data-role":"resize-handle-end",style:{position:"absolute",right:0,top:0,bottom:0,width:"6px",cursor:"ew-resize"},onPointerdown:k=>_(k,C.assignment,"resize-end")},null,42,Tr)):e.createCommentVNode("",!0)],46,Dr))),128))],14,$r)],6)],46,wr))}}),Et=Symbol("sg-form-context"),rl=Symbol("sg-form-provider-context"),Lr=["name"],il=e.defineComponent({__name:"Form",props:{form:{},name:{},defaultValues:{},initialValues:{},layout:{default:"vertical"},size:{default:"middle"},disabled:{type:Boolean,default:!1},colon:{type:Boolean},requiredMark:{type:[Boolean,String]},labelCol:{},wrapperCol:{},labelAlign:{},validateOn:{},scrollToFirstError:{type:Boolean},preserve:{type:Boolean}},emits:["submit","finish","finishFailed","valuesChange"],setup(t,{expose:n,emit:l}){const a=t,o=l,s=e.computed(()=>({defaultValues:a.defaultValues??a.initialValues,validateOn:a.validateOn,onValuesChange:(g,m)=>{o("valuesChange",m)}})),c=a.form??Lt(s.value),i=e.ref(null),r=e.computed(()=>["sg-form",`sg-form-${a.layout}`,`sg-form-${a.size}`,a.disabled?"sg-form-disabled":""].filter(Boolean).join(" "));e.provide(Et,{core:c.core,form:c.form,formApi:c,layout:a.layout,size:a.size,disabled:a.disabled,colon:a.colon,requiredMark:a.requiredMark,labelCol:a.labelCol,wrapperCol:a.wrapperCol,labelAlign:a.labelAlign,preserve:a.preserve});const d=e.inject(rl,null);e.onMounted(()=>{d&&a.name&&d.registerForm(a.name,c.form)}),e.onBeforeUnmount(()=>{d&&a.name&&d.unregisterForm(a.name)});async function v(g){var p;g.preventDefault(),await c.submit();const m=await c.validateFields(),h=c.getFieldsValue();if(o("submit",{values:h,valid:m.valid}),m.valid)o("finish",h),d&&a.name&&((p=d.onFormFinish)==null||p.call(d,a.name,{values:h,forms:d.forms}));else if(o("finishFailed",m.errors),a.scrollToFirstError&&i.value){const b=Object.keys(m.errors)[0];if(b){const y=i.value.querySelector(`[data-field-name="${b}"]`)??i.value.querySelector(`[name="${b}"]`);y&&"scrollIntoView"in y&&y.scrollIntoView({behavior:"smooth",block:"center"})}}}return n({formApi:c,submit:()=>c.submit(),reset:g=>c.reset(g),validate:()=>c.validateFields(),getFieldsValue:()=>c.getFieldsValue(),setFieldsValue:g=>c.setFieldsValue(g)}),(g,m)=>(e.openBlock(),e.createElementBlock("form",{ref_key:"formRef",ref:i,name:t.name,class:e.normalizeClass(r.value),novalidate:"",onSubmit:v},[e.renderSlot(g.$slots,"default",{form:e.unref(c)})],42,Lr))}}),Fr=["data-field-name"],Ar={key:0,class:"sg-field-label"},Pr={key:0,class:"sg-field-required"},Rr={class:"sg-field-control"},Ir=["value","disabled"],_r={key:1,class:"sg-field-error",role:"alert"},Kr={key:2,class:"sg-field-warning"},Hr={key:3,class:"sg-field-help"},Or={key:4,class:"sg-field-extra"},cl=e.defineComponent({__name:"Field",props:{name:{},label:{},rules:{default:()=>[]},warningRules:{},required:{type:Boolean,default:!1},dependencies:{},trigger:{},help:{},extra:{},preserve:{type:Boolean},hidden:{type:Boolean,default:!1},disabled:{type:Boolean},validateStatus:{},noStyle:{type:Boolean,default:!1},normalize:{},validateFirst:{type:Boolean},tooltip:{},labelCol:{},wrapperCol:{}},setup(t){const n=t,l=e.inject(Et,null);if(!l)throw new Error("[skygraph/vue] <SgField> must be used inside an <SgForm>");const a=l,o=zl(a.core,a.form,n.name),s=e.computed(()=>n.disabled??a.disabled);let u=o.value.value;const c=p=>{if(n.normalize){const b=n.normalize(p,u);u=b,o.onChange(b)}else u=p,o.onChange(p)};function i(){const p=[...n.rules??[]];n.required&&p.unshift({required:!0}),a.form.register(n.name,{rules:p,warningRules:n.warningRules,dependencies:n.dependencies,validateOn:Array.isArray(n.trigger)?n.trigger[0]:n.trigger,validateFirst:n.validateFirst,label:n.label,preserve:n.preserve??a.preserve})}i(),e.watch(()=>[n.rules,n.required,n.warningRules,n.dependencies],()=>{i()},{deep:!0}),e.onBeforeUnmount(()=>{a.form.unregister(n.name)});const r=e.computed(()=>o.errors.value.length>0),d=e.computed(()=>o.warnings.value.length>0),v=e.computed(()=>n.validateStatus??o.status.value),g=e.computed(()=>["sg-field",a.layout==="horizontal"?"sg-field-horizontal":"",r.value?"sg-field-has-error":"",d.value&&!r.value?"sg-field-has-warning":"",v.value?`sg-field-status-${v.value}`:""].filter(Boolean).join(" ")),m=e.useSlots(),h=e.computed(()=>!!m.label);return(p,b)=>t.hidden?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.noStyle?e.renderSlot(p.$slots,"default",{key:0,value:e.unref(o).value.value,onChange:c,onBlur:e.unref(o).onBlur,errors:e.unref(o).errors.value,error:e.unref(o).error.value,warnings:e.unref(o).warnings.value,touched:e.unref(o).touched.value,dirty:e.unref(o).dirty.value,validating:e.unref(o).validating.value,status:v.value}):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(g.value),"data-field-name":t.name},[t.label||h.value?(e.openBlock(),e.createElementBlock("label",Ar,[e.renderSlot(p.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),t.required?(e.openBlock(),e.createElementBlock("span",Pr,"*")):e.createCommentVNode("",!0),e.unref(a).colon?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(":")],64)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Rr,[e.renderSlot(p.$slots,"default",{value:e.unref(o).value.value,onChange:c,onBlur:e.unref(o).onBlur,errors:e.unref(o).errors.value,error:e.unref(o).error.value,warnings:e.unref(o).warnings.value,touched:e.unref(o).touched.value,dirty:e.unref(o).dirty.value,validating:e.unref(o).validating.value,status:v.value},()=>[e.createElementVNode("input",{class:"sg-input",type:"text",value:e.unref(o).value.value??"",disabled:s.value,onInput:b[0]||(b[0]=y=>c(y.target.value)),onBlur:b[1]||(b[1]=(...y)=>e.unref(o).onBlur&&e.unref(o).onBlur(...y))},null,40,Ir)])]),r.value?(e.openBlock(),e.createElementBlock("div",_r,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).errors.value,(y,E)=>(e.openBlock(),e.createElementBlock("div",{key:E},e.toDisplayString(y),1))),128))])):d.value?(e.openBlock(),e.createElementBlock("div",Kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).warnings.value,(y,E)=>(e.openBlock(),e.createElementBlock("div",{key:E},e.toDisplayString(y),1))),128))])):t.help?(e.openBlock(),e.createElementBlock("div",Hr,e.toDisplayString(t.help),1)):e.createCommentVNode("",!0),t.extra?(e.openBlock(),e.createElementBlock("div",Or,e.toDisplayString(t.extra),1)):e.createCommentVNode("",!0)],10,Fr))],64))}}),jr=e.defineComponent({__name:"FormList",props:{name:{},initialValue:{}},setup(t){let n=0;function l(){return`fl_${++n}`}const a=t,o=e.inject(Et,null);if(!o)throw new Error("[skygraph/vue] <SgFormList> must be used inside an <SgForm>");const s=o;e.onMounted(()=>{a.initialValue&&!Array.isArray(s.core.get(a.name))&&s.core.set(a.name,a.initialValue)});const u=e.ref(Array.isArray(s.core.get(a.name))?s.core.get(a.name):[]),c=e.ref(u.value.map(()=>l())),i=s.core.subscribe(a.name,b=>{const y=Array.isArray(b)?b:[];u.value=y});e.watch(u,b=>{if(b.length>c.value.length){const y=b.length-c.value.length;c.value=[...c.value,...Array.from({length:y},()=>l())]}else b.length<c.value.length&&(c.value=c.value.slice(0,b.length))});const r=e.computed(()=>c.value.slice(0,u.value.length).map((b,y)=>({key:b,index:y}))),h={add:(b,y)=>{s.form.listAdd(a.name,b,y);const E=l();if(y!==void 0&&y>=0&&y<=c.value.length){const z=[...c.value];z.splice(y,0,E),c.value=z}else c.value=[...c.value,E]},remove:b=>{if(s.form.listRemove(a.name,b),Array.isArray(b)){const y=new Set(b);c.value=c.value.filter((E,z)=>!y.has(z))}else c.value=c.value.filter((y,E)=>E!==b)},move:(b,y)=>{s.form.listMove(a.name,b,y);const E=[...c.value],[z]=E.splice(b,1);E.splice(y,0,z),c.value=E},replace:b=>{s.form.listReplace(a.name,b),c.value=b.map(()=>l())}},p=e.computed(()=>({errors:s.form.getFieldErrors(a.name)}));return e.onBeforeUnmount(()=>i()),(b,y)=>e.renderSlot(b.$slots,"default",{fields:r.value,operation:h,meta:p.value})}}),Yr=e.defineComponent({__name:"FormProvider",emits:["formFinish","formChange"],setup(t,{expose:n,emit:l}){const a=l,o={};return e.provide(rl,{registerForm:(s,u)=>{o[s]=u},unregisterForm:s=>{delete o[s]},onFormFinish:(s,u)=>a("formFinish",s,u),onFormChange:(s,u)=>a("formChange",s,u),forms:o}),n({forms:o}),(s,u)=>e.renderSlot(s.$slots,"default")}}),Wr={class:"sg-autofield"},Ur={key:0,style:{"font-weight":"500","font-size":"14px"}},qr={key:1,style:{display:"flex","align-items":"center",gap:"8px",cursor:"pointer"}},Xr=["checked","disabled","role"],Gr=["value","placeholder","disabled","min","max","step","aria-invalid","aria-describedby"],Jr=["value","placeholder","disabled","aria-invalid","aria-describedby"],Zr=["value","disabled","aria-invalid","aria-describedby"],Qr={value:""},ei=["value"],ti=["value","disabled","aria-invalid"],li=["value"],ai={key:6,role:"radiogroup",style:{display:"flex",gap:"12px","flex-wrap":"wrap"}},ni=["name","value","checked","disabled","onChange"],oi=["value","disabled","aria-invalid"],si=["value","disabled","aria-invalid"],ri=["value","placeholder","disabled","aria-invalid"],ii=["value","disabled"],ci={key:11,style:{display:"flex","align-items":"center",gap:"8px"}},ui=["value","min","max","step","disabled"],di={style:{"min-width":"32px","text-align":"right","font-size":"14px"}},mi={key:12,style:{display:"flex",gap:"2px"}},pi=["disabled","aria-label","onClick"],vi=["accept","multiple","disabled"],gi=["type","value","placeholder","disabled","aria-invalid","aria-describedby"],fi=["id"],hi={key:16,style:{color:"var(--sg-warning, #faad14)","font-size":"12px"}},ul=e.defineComponent({__name:"AutoField",props:{name:{},label:{},type:{},options:{},placeholder:{},min:{},max:{},step:{},accept:{},multiple:{type:Boolean},disabled:{type:Boolean}},setup(t){const n=t,l=e.inject(Et,null);if(!l)throw new Error("[skygraph/vue] <SgAutoField> must be used inside an <SgForm>");const a=l,o=e.computed(()=>a.form.getValue(n.name)),s=e.computed(()=>a.form.getFieldState(n.name)),u=e.computed(()=>{if(n.type)return n.type;if(n.options&&n.options.length>0)return"select";const m=o.value;if(typeof m=="boolean")return"boolean";if(typeof m=="number")return"number";if(typeof m=="string"){if(m.includes("@"))return"email";if(m.startsWith("http"))return"url"}return"string"}),c=m=>{a.form.setValue(n.name,m)},i=e.computed(()=>n.disabled??a.disabled),r=e.computed(()=>s.value.errors.length>0),d=e.computed(()=>s.value.warnings.length>0),v=e.computed(()=>`${n.name}-error`),g=e.computed(()=>({"sg-autofield-input-error":r.value,"sg-autofield-input-warning":!r.value&&d.value}));return(m,h)=>(e.openBlock(),e.createElementBlock("div",Wr,[u.value!=="boolean"&&u.value!=="switch"&&t.label?(e.openBlock(),e.createElementBlock("label",Ur,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0),u.value==="boolean"||u.value==="switch"?(e.openBlock(),e.createElementBlock("label",qr,[e.createElementVNode("input",{type:"checkbox",checked:!!o.value,disabled:i.value,role:u.value==="switch"?"switch":void 0,onChange:h[0]||(h[0]=p=>c(p.target.checked))},null,40,Xr),e.createTextVNode(" "+e.toDisplayString(t.label),1)])):u.value==="number"?(e.openBlock(),e.createElementBlock("input",{key:2,type:"number",class:e.normalizeClass(["sg-autofield-input",g.value]),value:o.value==null?"":String(o.value),placeholder:t.placeholder,disabled:i.value,min:t.min,max:t.max,step:t.step,"aria-invalid":r.value||void 0,"aria-describedby":r.value?v.value:void 0,onInput:h[1]||(h[1]=p=>{const b=p.target.value;c(b===""?null:Number(b))}),onBlur:h[2]||(h[2]=p=>e.unref(a).form.onFieldBlur(t.name))},null,42,Gr)):u.value==="textarea"?(e.openBlock(),e.createElementBlock("textarea",{key:3,class:e.normalizeClass(["sg-autofield-input sg-autofield-input-textarea",g.value]),value:o.value==null?"":String(o.value),placeholder:t.placeholder,disabled:i.value,"aria-invalid":r.value||void 0,"aria-describedby":r.value?v.value:void 0,onInput:h[3]||(h[3]=p=>c(p.target.value)),onBlur:h[4]||(h[4]=p=>e.unref(a).form.onFieldBlur(t.name))},null,42,Jr)):u.value==="select"?(e.openBlock(),e.createElementBlock("select",{key:4,class:e.normalizeClass(["sg-autofield-input",g.value]),value:o.value==null?"":String(o.value),disabled:i.value,"aria-invalid":r.value||void 0,"aria-describedby":r.value?v.value:void 0,onChange:h[5]||(h[5]=p=>c(p.target.value))},[e.createElementVNode("option",Qr,e.toDisplayString(t.placeholder??"-- Select --"),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,p=>(e.openBlock(),e.createElementBlock("option",{key:p.value,value:p.value},e.toDisplayString(p.label),9,ei))),128))],42,Zr)):u.value==="multiselect"?(e.openBlock(),e.createElementBlock("select",{key:5,multiple:"",class:e.normalizeClass(["sg-autofield-input",g.value]),value:Array.isArray(o.value)?o.value.map(String):[],disabled:i.value,"aria-invalid":r.value||void 0,onChange:h[6]||(h[6]=p=>{const b=Array.from(p.target.selectedOptions,y=>y.value);c(b)})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,p=>(e.openBlock(),e.createElementBlock("option",{key:p.value,value:p.value},e.toDisplayString(p.label),9,li))),128))],42,ti)):u.value==="radio"?(e.openBlock(),e.createElementBlock("div",ai,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,p=>(e.openBlock(),e.createElementBlock("label",{key:p.value,style:{display:"flex","align-items":"center",gap:"4px",cursor:"pointer"}},[e.createElementVNode("input",{type:"radio",name:t.name,value:p.value,checked:o.value===p.value,disabled:i.value,onChange:b=>c(p.value)},null,40,ni),e.createTextVNode(" "+e.toDisplayString(p.label),1)]))),128))])):u.value==="date"?(e.openBlock(),e.createElementBlock("input",{key:7,type:"date",class:e.normalizeClass(["sg-autofield-input",g.value]),value:o.value==null?"":String(o.value),disabled:i.value,"aria-invalid":r.value||void 0,onInput:h[7]||(h[7]=p=>c(p.target.value))},null,42,oi)):u.value==="time"?(e.openBlock(),e.createElementBlock("input",{key:8,type:"time",class:e.normalizeClass(["sg-autofield-input",g.value]),value:o.value==null?"":String(o.value),disabled:i.value,"aria-invalid":r.value||void 0,onInput:h[8]||(h[8]=p=>c(p.target.value))},null,42,si)):u.value==="password"?(e.openBlock(),e.createElementBlock("input",{key:9,type:"password",class:e.normalizeClass(["sg-autofield-input",g.value]),value:o.value==null?"":String(o.value),placeholder:t.placeholder,disabled:i.value,"aria-invalid":r.value||void 0,onInput:h[9]||(h[9]=p=>c(p.target.value)),onBlur:h[10]||(h[10]=p=>e.unref(a).form.onFieldBlur(t.name))},null,42,ri)):u.value==="color"?(e.openBlock(),e.createElementBlock("input",{key:10,type:"color",class:"sg-autofield-input sg-autofield-input-color",value:o.value==null?"#000000":String(o.value),disabled:i.value,onInput:h[11]||(h[11]=p=>c(p.target.value))},null,40,ii)):u.value==="slider"?(e.openBlock(),e.createElementBlock("div",ci,[e.createElementVNode("input",{type:"range",value:o.value==null?t.min??0:Number(o.value),min:t.min??0,max:t.max??100,step:t.step??1,disabled:i.value,style:{flex:"1"},onInput:h[12]||(h[12]=p=>c(Number(p.target.value)))},null,40,ui),e.createElementVNode("span",di,e.toDisplayString(String(o.value??t.min??0)),1)])):u.value==="rate"?(e.openBlock(),e.createElementBlock("div",mi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.max??5,p=>(e.openBlock(),e.createElementBlock("button",{key:p,type:"button",disabled:i.value,"aria-label":`${p} star${p!==1?"s":""}`,style:e.normalizeStyle({background:"none",border:"none",cursor:i.value?"default":"pointer",fontSize:"20px",color:p<=(typeof o.value=="number"?o.value:0)?"var(--sg-warning, #faad14)":"var(--sg-border, #d9d9d9)",padding:0}),onClick:b=>!i.value&&c(p)}," ★ ",12,pi))),128))])):u.value==="file"?(e.openBlock(),e.createElementBlock("input",{key:13,type:"file",class:e.normalizeClass(["sg-autofield-input",g.value]),accept:t.accept,multiple:t.multiple,disabled:i.value,onChange:h[13]||(h[13]=p=>{const b=p.target.files;b&&c(t.multiple?Array.from(b):b[0]??null)})},null,42,vi)):(e.openBlock(),e.createElementBlock("input",{key:14,type:u.value==="email"?"email":u.value==="url"?"url":"text",class:e.normalizeClass(["sg-autofield-input",g.value]),value:o.value==null?"":String(o.value),placeholder:t.placeholder,disabled:i.value,"aria-invalid":r.value||void 0,"aria-describedby":r.value?v.value:void 0,onInput:h[14]||(h[14]=p=>c(p.target.value)),onBlur:h[15]||(h[15]=p=>e.unref(a).form.onFieldBlur(t.name))},null,42,gi)),r.value?(e.openBlock(),e.createElementBlock("span",{key:15,id:v.value,role:"alert",style:{color:"var(--sg-error, #ff4d4f)","font-size":"12px"}},e.toDisplayString(s.value.errors.join("; ")),9,fi)):d.value?(e.openBlock(),e.createElementBlock("span",hi,e.toDisplayString(s.value.warnings.join("; ")),1)):e.createCommentVNode("",!0)]))}}),yi=["type","disabled","aria-disabled","aria-busy"],ki={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},Xe=e.defineComponent({__name:"Button",props:{type:{type:String,default:"default"},size:{type:String,default:void 0},htmlType:{type:String,default:"button"},danger:{type:Boolean,default:!1},block:{type:Boolean,default:!1},disabled:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},unstyled:{type:Boolean,default:!1}},emits:["click"],setup(t,{emit:n}){const l=t,a=n,{resolvedSize:o,resolvedDisabled:s}=Ye({size:void 0,disabled:void 0},{}),u=e.computed(()=>l.size??o.value),c=e.computed(()=>l.disabled??s.value),i=e.computed(()=>l.unstyled?"":["sg-button",`sg-button-${l.type}`,`sg-button-${u.value}`,l.danger?"sg-button-danger":"",l.block?"sg-button-block":"",l.loading?"sg-button-loading":""].filter(Boolean).join(" ")),r=e.computed(()=>c.value||l.loading);function d(v){if(r.value){v.preventDefault(),v.stopPropagation();return}a("click",v)}return(v,g)=>(e.openBlock(),e.createElementBlock("button",{type:t.htmlType,class:e.normalizeClass(i.value),disabled:r.value,"aria-disabled":r.value,"aria-busy":t.loading||void 0,onClick:d},[t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",ki)):e.createCommentVNode("",!0),e.renderSlot(v.$slots,"icon"),e.renderSlot(v.$slots,"default")],10,yi))}});function bi(t){if(t.enum||t.oneOf)return"select";if(t.format==="email")return"email";if(t.format==="uri"||t.format==="url")return"url";if(t.format==="date")return"date";if(t.format==="time")return"time";if(t.format==="password")return"password";if(t.format==="color")return"color";switch(t.type){case"number":case"integer":return"number";case"boolean":return"boolean";case"array":return"multiselect";default:return t.maxLength&&t.maxLength>200?"textarea":"string"}}function Bi(t){if(t.oneOf)return t.oneOf.map(n=>({value:n.const,label:n.title??String(n.const)}));if(t.enum)return t.enum.map((n,l)=>{var a;return{value:n,label:((a=t.enumNames)==null?void 0:a[l])??String(n)}})}function Xl(t){const n=[],l=t.properties??{};for(const[a,o]of Object.entries(l))n.push({name:a,label:o.title??a,type:bi(o),placeholder:o.description,options:Bi(o),min:o.minimum,max:o.maximum});return n}function dl(t){const n={},l=t.properties??{},a=new Set(t.required??[]);for(const[o,s]of Object.entries(l)){const u=[];a.has(o)&&u.push({required:!0,message:`${s.title??o} is required`}),s.type==="string"&&(s.minLength!==void 0&&u.push({min:s.minLength,message:`Minimum ${s.minLength} characters`}),s.maxLength!==void 0&&u.push({max:s.maxLength,message:`Maximum ${s.maxLength} characters`}),s.pattern&&u.push({pattern:new RegExp(s.pattern),message:"Invalid format"})),(s.type==="number"||s.type==="integer")&&(s.minimum!==void 0&&u.push({min:s.minimum,type:"number"}),s.maximum!==void 0&&u.push({max:s.maximum,type:"number"})),s.format==="email"&&u.push({type:"email"}),(s.format==="uri"||s.format==="url")&&u.push({type:"url"}),u.length>0&&(n[o]=u)}return n}function ml(t){const n={},l=t.properties??{};for(const[a,o]of Object.entries(l))o.default!==void 0&&(n[a]=o.default);return n}const Gl=e.defineComponent({__name:"SchemaForm",props:{schema:{},form:{},layout:{default:"vertical"},size:{default:"middle"},disabled:{type:Boolean,default:!1},labelCol:{},wrapperCol:{},submitText:{default:"Submit"}},emits:["submit"],setup(t,{emit:n}){const l=t,a=n,o=e.computed(()=>Xl(l.schema)),s=e.computed(()=>dl(l.schema)),u=e.computed(()=>ml(l.schema)),c=Lt({defaultValues:u.value,onSubmit:r=>a("submit",r)}),i=e.computed(()=>l.form??c);return(r,d)=>(e.openBlock(),e.createBlock(il,{form:i.value,layout:t.layout,size:t.size,disabled:t.disabled,"label-col":t.labelCol,"wrapper-col":t.wrapperCol},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,v=>(e.openBlock(),e.createBlock(cl,{key:v.name,name:v.name,label:v.label,rules:s.value[v.name]},{default:e.withCtx(()=>[e.createVNode(ul,{name:v.name,type:v.type,options:v.options,placeholder:v.placeholder,min:v.min,max:v.max,disabled:t.disabled},null,8,["name","type","options","placeholder","min","max","disabled"])]),_:2},1032,["name","label","rules"]))),128)),e.renderSlot(r.$slots,"default",{},()=>[e.createVNode(Xe,{type:"primary","html-type":"submit"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.submitText),1)]),_:1})])]),_:3},8,["form","layout","size","disabled","label-col","wrapper-col"]))}}),Ci=e.defineComponent({__name:"SubmitButton",props:{disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},unstyled:{type:Boolean,default:!1}},setup(t){const n=Ee(),l=e.computed(()=>{var a,o;return((o=(a=n.value.locale)==null?void 0:a.form)==null?void 0:o.submitText)??"Submit"});return(a,o)=>(e.openBlock(),e.createBlock(Xe,{type:"primary",htmlType:"submit",disabled:t.disabled,loading:t.loading,unstyled:t.unstyled},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(l.value),1)])]),_:3},8,["disabled","loading","unstyled"]))}}),Jl=[{type:"string",label:"Input",hint:"Single-line text",glyph:"T"},{type:"textarea",label:"Textarea",hint:"Multi-line text",glyph:"¶"},{type:"number",label:"Number",hint:"Numeric input",glyph:"#"},{type:"select",label:"Select",hint:"Dropdown choice",glyph:"▾"},{type:"radio",label:"Radio",hint:"Single choice",glyph:"◉"},{type:"boolean",label:"Checkbox",hint:"Boolean toggle",glyph:"☐"},{type:"switch",label:"Switch",hint:"On / off toggle",glyph:"⌨"},{type:"date",label:"Date",hint:"Calendar picker",glyph:"📅"},{type:"time",label:"Time",hint:"Clock picker",glyph:"🕒"},{type:"slider",label:"Slider",hint:"Numeric range",glyph:"═"},{type:"rate",label:"Rate",hint:"Star rating",glyph:"★"},{type:"color",label:"Color",hint:"Color picker",glyph:"◐"},{type:"email",label:"Email",hint:"Email input",glyph:"@"},{type:"url",label:"URL",hint:"Link input",glyph:"↗"},{type:"password",label:"Password",hint:"Masked input",glyph:"✱"},{type:"file",label:"File",hint:"File upload",glyph:"⇪"}],Mt="application/x-sg-sfe-palette-type",wi={class:"sg-sfe-palette","data-testid":"sfe-palette"},Si={class:"sg-sfe-palette-list"},Ei=["data-palette-type","onDragstart","onClick","onKeydown"],xi={class:"sg-sfe-palette-item-glyph","aria-hidden":"true"},$i={class:"sg-sfe-palette-item-body"},Ni={class:"sg-sfe-palette-item-label"},Vi={key:0,class:"sg-sfe-palette-item-hint"},Zl=e.defineComponent({__name:"SchemaFormEditorPalette",props:{items:{default:()=>Jl}},emits:["itemActivate"],setup(t,{emit:n}){const l=t,a=n;function o(c,i){i.dataTransfer&&(i.dataTransfer.setData(Mt,c),i.dataTransfer.setData("text/plain",c),i.dataTransfer.effectAllowed="copy")}function s(c){a("itemActivate",c)}function u(c,i){(i.key==="Enter"||i.key===" ")&&(i.preventDefault(),a("itemActivate",c))}return(c,i)=>(e.openBlock(),e.createElementBlock("div",wi,[i[0]||(i[0]=e.createElementVNode("div",{class:"sg-sfe-palette-title"},"Fields",-1)),e.createElementVNode("div",Si,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.items,r=>(e.openBlock(),e.createElementBlock("div",{key:r.type,class:"sg-sfe-palette-item","data-palette-type":r.type,draggable:"true",tabindex:"0",role:"button",onDragstart:d=>o(r.type,d),onClick:d=>s(r.type),onKeydown:d=>u(r.type,d)},[e.createElementVNode("span",xi,e.toDisplayString(r.glyph??"·"),1),e.createElementVNode("span",$i,[e.createElementVNode("span",Ni,e.toDisplayString(r.label),1),r.hint?(e.openBlock(),e.createElementBlock("span",Vi,e.toDisplayString(r.hint),1)):e.createCommentVNode("",!0)])],40,Ei))),128))])]))}});let Vl=0;function Ql(t="fld"){return Vl++,`${t}_${Date.now().toString(36)}_${Vl}`}function Di(t){switch(t){case"string":case"textarea":return{type:"string"};case"email":return{type:"string",format:"email"};case"url":return{type:"string",format:"url"};case"date":return{type:"string",format:"date"};case"time":return{type:"string",format:"time"};case"password":return{type:"string",format:"password"};case"color":return{type:"string",format:"color"};case"number":case"slider":case"rate":return{type:"number"};case"boolean":case"switch":return{type:"boolean"};case"select":case"radio":return{type:"string"};case"multiselect":return{type:"array"};case"file":return{type:"string"};default:return{type:"string"}}}function zi(t){if(t.enum||t.oneOf)return"select";if(t.format==="email")return"email";if(t.format==="uri"||t.format==="url")return"url";if(t.format==="date")return"date";if(t.format==="time")return"time";if(t.format==="password")return"password";if(t.format==="color")return"color";switch(t.type){case"number":case"integer":return"number";case"boolean":return"boolean";case"array":return"multiselect";default:return t.maxLength&&t.maxLength>200?"textarea":"string"}}function ea(){return{fields:[]}}function Ti(t){var o,s;const n=t.properties??{},l=new Set(t.required??[]),a=[];for(const[u,c]of Object.entries(n)){const i=zi(c);a.push({id:Ql("imp"),name:u,label:c.title??u,type:i,required:l.has(u),min:c.minimum??c.minLength,max:c.maximum??c.maxLength,pattern:c.pattern,defaultValue:c.default,helpText:c.description,placeholder:void 0,options:((o=c.oneOf)==null?void 0:o.map(r=>({value:r.const,label:r.title??String(r.const)})))??((s=c.enum)==null?void 0:s.map((r,d)=>{var v;return{value:r,label:((v=c.enumNames)==null?void 0:v[d])??String(r)}}))})}return{title:t.title,description:t.description,fields:a}}function Mi(t){const{type:n,format:l}=Di(t.type),a={type:n};return l&&(a.format=l),t.label&&t.label!==t.name&&(a.title=t.label),t.helpText&&(a.description=t.helpText),t.defaultValue!==void 0&&(a.default=t.defaultValue),n==="string"?(t.min!==void 0&&(a.minLength=t.min),t.max!==void 0&&(a.maxLength=t.max),t.pattern&&(a.pattern=t.pattern)):(n==="number"||n==="integer")&&(t.min!==void 0&&(a.minimum=t.min),t.max!==void 0&&(a.maximum=t.max)),t.options&&t.options.length>0&&(a.enum=t.options.map(o=>o.value),a.enumNames=t.options.map(o=>o.label)),t.type==="textarea"&&a.maxLength===void 0&&(a.maxLength=1e3),a}function It(t){const n={},l=[];for(const o of t.fields)n[o.name]=Mi(o),o.required&&l.push(o.name);const a={type:"object",properties:n};return l.length>0&&(a.required=l),t.title&&(a.title=t.title),t.description&&(a.description=t.description),a}function pl(t,n){const l=`field${n.length+1}`;let a=l,o=1;for(;n.includes(a);)o++,a=`${l}_${o}`;const s=t.charAt(0).toUpperCase()+t.slice(1),u={id:Ql("new"),name:a,label:s,type:t};return(t==="select"||t==="radio")&&(u.options=[{value:"option1",label:"Option 1"},{value:"option2",label:"Option 2"}]),(t==="number"||t==="slider")&&(u.min=0,u.max=100),t==="rate"&&(u.max=5),u}const Li=["data-empty"],Fi={key:0,class:"sg-sfe-canvas-drop-indicator","data-testid":"sfe-drop-indicator"},Ai=["data-field-id","data-field-name","onClick","onDragstart","onDragover","onDrop"],Pi=["aria-label","onClick"],Ri=["aria-label","onClick"],Ii=["aria-label","onClick"],_i=["aria-label","onClick"],Ki={class:"sg-sfe-canvas-field-inner"},Hi={key:0,class:"sg-sfe-canvas-field-help"},Oi={key:0,class:"sg-sfe-canvas-drop-indicator","data-testid":"sfe-drop-indicator"},ta=e.defineComponent({__name:"SchemaFormEditorCanvas",props:{store:{},emptyText:{default:"Drop a field here"}},setup(t){const n=t,l=e.computed(()=>n.store.state.value.schema.fields),a=e.computed(()=>l.value.length===0),o=e.computed(()=>It(n.store.state.value.schema)),s=e.computed(()=>dl(o.value)),u=e.computed(()=>ml(o.value)),c=e.ref(null),i=e.ref(null),r=Ee(),d=e.computed(()=>{var B,w;return((w=(B=r.value.locale)==null?void 0:B.schemaFormEditor)==null?void 0:w.moveFieldUp)??"Move field up"}),v=e.computed(()=>{var B,w;return((w=(B=r.value.locale)==null?void 0:B.schemaFormEditor)==null?void 0:w.moveFieldDown)??"Move field down"}),g=e.computed(()=>{var B,w;return((w=(B=r.value.locale)==null?void 0:B.schemaFormEditor)==null?void 0:w.duplicateField)??"Duplicate field"}),m=e.computed(()=>{var B,w;return((w=(B=r.value.locale)==null?void 0:B.schemaFormEditor)==null?void 0:w.deleteField)??"Delete field"}),h=Lt({defaultValues:u.value});function p(B){var w,S;((w=B.dataTransfer)!=null&&w.types.includes(Mt)||(S=B.dataTransfer)!=null&&S.types.includes("text/plain")||i.value!==null)&&(B.preventDefault(),B.dataTransfer&&(B.dataTransfer.dropEffect=i.value?"move":"copy"))}function b(B,w){var q,_;if(B.preventDefault(),B.stopPropagation(),c.value=null,i.value){const R=i.value,U=l.value.findIndex(X=>X.id===R);if(i.value=null,U===-1)return;let I=w;if(I>U&&(I-=1),I===U)return;n.store.moveField(R,I);return}let S=null;const L=(q=B.dataTransfer)==null?void 0:q.getData(Mt);if(L)S=L;else{const R=(_=B.dataTransfer)==null?void 0:_.getData("text/plain");R&&(S=R)}if(!S)return;const T=l.value.map(R=>R.name),P=pl(S,T);n.store.addField(P,w)}function y(){n.store.setSelectedId(null)}function E(B,w){w.stopPropagation(),n.store.setSelectedId(B)}function z(B,w){w.stopPropagation(),w.dataTransfer&&(w.dataTransfer.effectAllowed="move",w.dataTransfer.setData("text/plain",B)),i.value=B}function x(){i.value=null,c.value=null}function f(B,w){w.preventDefault(),w.stopPropagation(),c.value=B}function N(){c.value=null}return(B,w)=>(e.openBlock(),e.createElementBlock("div",{class:"sg-sfe-canvas","data-testid":"sfe-canvas","data-empty":a.value?"true":"false",onDragover:p,onDrop:w[1]||(w[1]=S=>b(S,l.value.length))},[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-sfe-canvas-empty","data-testid":"sfe-canvas-empty",onClick:y},e.toDisplayString(t.emptyText),1)):(e.openBlock(),e.createBlock(il,{key:1,form:e.unref(h),layout:"vertical",class:"sg-sfe-canvas-form"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(S,L)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:S.id},[c.value===L?(e.openBlock(),e.createElementBlock("div",Fi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["sg-sfe-canvas-field",S.id===t.store.state.value.selectedId?"sg-sfe-canvas-field-selected":""]),"data-testid":"sfe-canvas-field","data-field-id":S.id,"data-field-name":S.name,draggable:"true",onClick:T=>E(S.id,T),onDragstart:T=>z(S.id,T),onDragend:x,onDragover:T=>f(L,T),onDragleave:N,onDrop:T=>b(T,L)},[S.id===t.store.state.value.selectedId?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-sfe-canvas-field-toolbar","data-testid":"sfe-field-toolbar",onClick:w[0]||(w[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:"sg-sfe-canvas-field-toolbar-btn","data-testid":"sfe-action-up","aria-label":d.value,onClick:T=>t.store.moveFieldUp(S.id)}," ↑ ",8,Pi),e.createElementVNode("button",{type:"button",class:"sg-sfe-canvas-field-toolbar-btn","data-testid":"sfe-action-down","aria-label":v.value,onClick:T=>t.store.moveFieldDown(S.id)}," ↓ ",8,Ri),e.createElementVNode("button",{type:"button",class:"sg-sfe-canvas-field-toolbar-btn","data-testid":"sfe-action-duplicate","aria-label":g.value,onClick:T=>t.store.duplicateField(S.id)}," ⎘ ",8,Ii),e.createElementVNode("button",{type:"button",class:"sg-sfe-canvas-field-toolbar-btn sg-sfe-canvas-field-toolbar-btn-danger","data-testid":"sfe-action-delete","aria-label":m.value,onClick:T=>t.store.removeField(S.id)}," × ",8,_i)])):e.createCommentVNode("",!0),e.createElementVNode("div",Ki,[e.createVNode(cl,{name:S.name,label:S.label,rules:s.value[S.name]},{default:e.withCtx(()=>[e.createVNode(ul,{name:S.name,type:S.type,options:S.options,placeholder:S.placeholder,min:S.min,max:S.max},null,8,["name","type","options","placeholder","min","max"])]),_:2},1032,["name","label","rules"]),S.helpText?(e.openBlock(),e.createElementBlock("span",Hi,e.toDisplayString(S.helpText),1)):e.createCommentVNode("",!0)])],42,Ai)],64))),128)),c.value===l.value.length?(e.openBlock(),e.createElementBlock("div",Oi)):e.createCommentVNode("",!0)]),_:1},8,["form"]))],40,Li))}}),ji={class:"sg-sfe-inspector","data-testid":"sfe-inspector"},Yi={key:0,class:"sg-sfe-inspector-empty","data-testid":"sfe-inspector-empty"},Wi={class:"sg-sfe-inspector-row","data-testid":"sfe-inspector-row"},Ui={class:"sg-sfe-inspector-row-control"},qi=["value"],Xi={class:"sg-sfe-inspector-row","data-testid":"sfe-inspector-row"},Gi={class:"sg-sfe-inspector-row-control"},Ji=["value"],Zi={class:"sg-sfe-inspector-row","data-testid":"sfe-inspector-row"},Qi={class:"sg-sfe-inspector-row-control"},ec=["value"],tc={class:"sg-sfe-inspector-row","data-testid":"sfe-inspector-row"},lc={class:"sg-sfe-inspector-row-control"},ac={class:"sg-sfe-inspector-checkbox"},nc=["checked"],oc={class:"sg-sfe-inspector-row","data-testid":"sfe-inspector-row"},sc={class:"sg-sfe-inspector-row-control"},rc=["value"],ic={class:"sg-sfe-inspector-row","data-testid":"sfe-inspector-row"},cc={class:"sg-sfe-inspector-row-control"},uc=["value"],dc={class:"sg-sfe-inspector-row","data-testid":"sfe-inspector-row"},mc={class:"sg-sfe-inspector-row-control"},pc=["value"],vc={key:0,class:"sg-sfe-inspector-row","data-testid":"sfe-inspector-row"},gc={class:"sg-sfe-inspector-row-label"},fc={class:"sg-sfe-inspector-row-control"},hc=["value"],yc={key:1,class:"sg-sfe-inspector-row","data-testid":"sfe-inspector-row"},kc={class:"sg-sfe-inspector-row-label"},bc={class:"sg-sfe-inspector-row-control"},Bc=["value"],Cc={key:2,class:"sg-sfe-inspector-row","data-testid":"sfe-inspector-row"},wc={class:"sg-sfe-inspector-row-control"},Sc=["value"],Ec={key:3,class:"sg-sfe-inspector-options","data-testid":"sfe-inspector-options"},xc=["value","placeholder","onInput"],$c=["value","placeholder","onInput"],Nc=["aria-label","onClick"],la=e.defineComponent({__name:"SchemaFormEditorInspector",props:{store:{}},setup(t){const n=t,l=["select","radio","multiselect"],a=["number","slider","rate"],o=["string","textarea","password","email","url"],s=e.computed(()=>{const x=n.store.state.value.selectedId;return x?n.store.state.value.schema.fields.find(f=>f.id===x)??null:null}),u=e.computed(()=>s.value&&l.includes(s.value.type)),c=e.computed(()=>s.value&&a.includes(s.value.type)),i=e.computed(()=>s.value&&o.includes(s.value.type)),r=e.computed(()=>s.value&&(s.value.type==="boolean"||s.value.type==="switch")),d=Ee(),v=e.computed(()=>{var x,f;return((f=(x=d.value.locale)==null?void 0:x.schemaFormEditor)==null?void 0:f.removeOption)??"Remove option"}),g=e.computed(()=>{var x,f;return((f=(x=d.value.locale)==null?void 0:x.schemaFormEditor)==null?void 0:f.optionLabelPlaceholder)??"Label"}),m=e.computed(()=>{var x,f;return((f=(x=d.value.locale)==null?void 0:x.schemaFormEditor)==null?void 0:f.optionValuePlaceholder)??"Value"});function h(x){s.value&&n.store.updateField(s.value.id,x)}function p(){return!s.value||s.value.defaultValue===void 0?"":String(s.value.defaultValue)}function b(x){if(x==="")return h({defaultValue:void 0});if(r.value)return h({defaultValue:x==="true"});if(c.value){const f=Number(x);return h({defaultValue:Number.isFinite(f)?f:x})}h({defaultValue:x})}function y(x,f){if(!s.value)return;const N=(s.value.options??[]).map(B=>({...B}));N[x]={...N[x],...f},h({options:N})}function E(x){if(!s.value)return;const f=(s.value.options??[]).slice();f.splice(x,1),h({options:f})}function z(){if(!s.value)return;const x=s.value.options??[],f={value:`option${x.length+1}`,label:`Option ${x.length+1}`};h({options:[...x,f]})}return(x,f)=>(e.openBlock(),e.createElementBlock("div",ji,[s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[f[19]||(f[19]=e.createElementVNode("div",{class:"sg-sfe-inspector-title"},"Field properties",-1)),e.createElementVNode("div",Wi,[f[9]||(f[9]=e.createElementVNode("label",{class:"sg-sfe-inspector-row-label"},"Name",-1)),e.createElementVNode("div",Ui,[e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-name",value:s.value.name,onInput:f[0]||(f[0]=N=>h({name:N.target.value}))},null,40,qi)])]),e.createElementVNode("div",Xi,[f[10]||(f[10]=e.createElementVNode("label",{class:"sg-sfe-inspector-row-label"},"Label",-1)),e.createElementVNode("div",Gi,[e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-label",value:s.value.label,onInput:f[1]||(f[1]=N=>h({label:N.target.value}))},null,40,Ji)])]),e.createElementVNode("div",Zi,[f[11]||(f[11]=e.createElementVNode("label",{class:"sg-sfe-inspector-row-label"},"Type",-1)),e.createElementVNode("div",Qi,[e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-type",value:s.value.type,readonly:"","aria-readonly":"true"},null,8,ec)])]),e.createElementVNode("div",tc,[f[13]||(f[13]=e.createElementVNode("label",{class:"sg-sfe-inspector-row-label"},"Required",-1)),e.createElementVNode("div",lc,[e.createElementVNode("label",ac,[e.createElementVNode("input",{type:"checkbox","data-testid":"sfe-inspector-required",checked:!!s.value.required,onChange:f[2]||(f[2]=N=>h({required:N.target.checked}))},null,40,nc),f[12]||(f[12]=e.createElementVNode("span",null,"Make this field required",-1))])])]),e.createElementVNode("div",oc,[f[14]||(f[14]=e.createElementVNode("label",{class:"sg-sfe-inspector-row-label"},"Placeholder",-1)),e.createElementVNode("div",sc,[e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-placeholder",value:s.value.placeholder??"",onInput:f[3]||(f[3]=N=>{const B=N.target.value;h({placeholder:B||void 0})})},null,40,rc)])]),e.createElementVNode("div",ic,[f[15]||(f[15]=e.createElementVNode("label",{class:"sg-sfe-inspector-row-label"},"Help text",-1)),e.createElementVNode("div",cc,[e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-help",value:s.value.helpText??"",onInput:f[4]||(f[4]=N=>{const B=N.target.value;h({helpText:B||void 0})})},null,40,uc)])]),e.createElementVNode("div",dc,[f[16]||(f[16]=e.createElementVNode("label",{class:"sg-sfe-inspector-row-label"},"Default",-1)),e.createElementVNode("div",mc,[e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-default",value:p(),onInput:f[5]||(f[5]=N=>b(N.target.value))},null,40,pc)])]),i.value||c.value?(e.openBlock(),e.createElementBlock("div",vc,[e.createElementVNode("label",gc,e.toDisplayString(i.value?"Min length":"Min"),1),e.createElementVNode("div",fc,[e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-min",type:"number",value:s.value.min??"",onInput:f[6]||(f[6]=N=>{const B=N.target.value;h({min:B===""?void 0:Number(B)})})},null,40,hc)])])):e.createCommentVNode("",!0),i.value||c.value?(e.openBlock(),e.createElementBlock("div",yc,[e.createElementVNode("label",kc,e.toDisplayString(i.value?"Max length":"Max"),1),e.createElementVNode("div",bc,[e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-max",type:"number",value:s.value.max??"",onInput:f[7]||(f[7]=N=>{const B=N.target.value;h({max:B===""?void 0:Number(B)})})},null,40,Bc)])])):e.createCommentVNode("",!0),i.value?(e.openBlock(),e.createElementBlock("div",Cc,[f[17]||(f[17]=e.createElementVNode("label",{class:"sg-sfe-inspector-row-label"},"Pattern (RegExp)",-1)),e.createElementVNode("div",wc,[e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-pattern",value:s.value.pattern??"",placeholder:"^[A-Z].*",onInput:f[8]||(f[8]=N=>{const B=N.target.value;h({pattern:B||void 0})})},null,40,Sc)])])):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("div",Ec,[f[18]||(f[18]=e.createElementVNode("div",{class:"sg-sfe-inspector-row-label"},"Options",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value.options??[],(N,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:"sg-sfe-inspector-option"},[e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-option-label",value:N.label,placeholder:g.value,onInput:w=>y(B,{label:w.target.value})},null,40,xc),e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-option-value",value:String(N.value),placeholder:m.value,onInput:w=>y(B,{value:w.target.value})},null,40,$c),e.createElementVNode("button",{type:"button",class:"sg-sfe-inspector-option-remove","aria-label":v.value,onClick:w=>E(B)}," × ",8,Nc)]))),128)),e.createElementVNode("button",{type:"button",class:"sg-sfe-inspector-option-add","data-testid":"sfe-inspector-option-add",onClick:z}," + Add option ")])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("div",Yi," Select a field on the canvas to edit its properties. "))]))}}),Vc=["aria-label"],aa=e.defineComponent({__name:"SchemaFormEditorSchemaView",props:{store:{},mode:{default:"json"}},setup(t){const n=t,l=e.computed(()=>{const s=It(n.store.state.value.schema);return n.mode==="ts"?`const schema = ${JSON.stringify(s,null,2)} as const`:JSON.stringify(s,null,2)}),a=Ee(),o=e.computed(()=>{var s,u;return((u=(s=a.value.locale)==null?void 0:s.schemaFormEditor)==null?void 0:u.schemaView)??"Generated JSON Schema"});return(s,u)=>(e.openBlock(),e.createElementBlock("pre",{class:"sg-sfe-schema-view","data-testid":"sfe-schema-view","aria-label":o.value},[e.createElementVNode("code",null,e.toDisplayString(l.value),1)],8,Vc))}}),vt=100,Vt="$sfe.snapshot";function na(t){return{title:t.title,description:t.description,fields:t.fields.map(n=>({...n,options:n.options?n.options.map(l=>({...l})):void 0}))}}function Dc(t,n,l){return{schema:t.schema,selectedId:t.selectedId,canUndo:n,canRedo:l}}function zc(t,n){switch(n.type){case"add":{const l=t.schema.fields.slice(),a=n.index??l.length;return l.splice(Math.max(0,Math.min(a,l.length)),0,n.field),{...t,schema:{...t.schema,fields:l},selectedId:n.field.id}}case"remove":{const l=t.schema.fields.filter(a=>a.id!==n.id);return l.length===t.schema.fields.length?t:{...t,schema:{...t.schema,fields:l},selectedId:t.selectedId===n.id?null:t.selectedId}}case"update":{const l=t.schema.fields.findIndex(c=>c.id===n.id);if(l===-1)return t;const a=t.schema.fields.slice(),s={...a[l],...n.patch},u=s;for(const c of Object.keys(n.patch))n.patch[c]===void 0&&delete u[c];return a[l]=s,{...t,schema:{...t.schema,fields:a}}}case"move":{const l=t.schema.fields.findIndex(u=>u.id===n.id);if(l===-1)return t;const a=t.schema.fields.slice(),[o]=a.splice(l,1),s=Math.max(0,Math.min(n.toIndex,a.length));return a.splice(s,0,o),{...t,schema:{...t.schema,fields:a}}}case"setSchema":return{...t,schema:na(n.schema),selectedId:null};default:return t}}function oa(t={}){const n=t.core??Oe.createCore(),l={schema:t.initialSchema?na(t.initialSchema):ea(),selectedId:null},a=e.ref(l),o=e.ref([]),s=e.ref([]);n.set(Vt,l.schema);const u=e.computed(()=>Dc(a.value,o.value.length>0,s.value.length>0)),c=(x,f)=>{var N;f&&(o.value=[...o.value,a.value],o.value.length>vt&&(o.value=o.value.slice(-vt)),s.value=[]),a.value=x,n.set(Vt,x.schema),(N=t.onChange)==null||N.call(t,x.schema)},i=x=>{const f=zc(a.value,x);f!==a.value&&c(f,!0)};return{state:u,core:n,apply:i,addField:(x,f)=>i({type:"add",field:x,index:f}),removeField:x=>i({type:"remove",id:x}),updateField:(x,f)=>i({type:"update",id:x,patch:f}),moveField:(x,f)=>i({type:"move",id:x,toIndex:f}),moveFieldUp:x=>{const f=a.value.schema.fields.findIndex(N=>N.id===x);f<=0||i({type:"move",id:x,toIndex:f-1})},moveFieldDown:x=>{const f=a.value.schema.fields,N=f.findIndex(B=>B.id===x);N===-1||N>=f.length-1||i({type:"move",id:x,toIndex:N+1})},duplicateField:x=>{const f=a.value.schema.fields,N=f.findIndex(P=>P.id===x);if(N===-1)return;const B=f[N],w=f.map(P=>P.name);let S=`${B.name}_copy`,L=1;for(;w.includes(S);)L++,S=`${B.name}_copy${L}`;const T={...B,id:`dup_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,6)}`,name:S,options:B.options?B.options.map(P=>({...P})):void 0};i({type:"add",field:T,index:N+1})},setSchema:x=>i({type:"setSchema",schema:x}),setSelectedId:x=>{a.value.selectedId!==x&&c({...a.value,selectedId:x},!1)},undo:()=>{var N;if(o.value.length===0)return;const x=[...o.value],f=x.pop();o.value=x,s.value=[...s.value,a.value],s.value.length>vt&&(s.value=s.value.slice(-vt)),a.value=f,n.set(Vt,f.schema),(N=t.onChange)==null||N.call(t,f.schema)},redo:()=>{var N;if(s.value.length===0)return;const x=[...s.value],f=x.pop();s.value=x,o.value=[...o.value,a.value],o.value.length>vt&&(o.value=o.value.slice(-vt)),a.value=f,n.set(Vt,f.schema),(N=t.onChange)==null||N.call(t,f.schema)}}}const Tc={class:"sg-sfe","data-testid":"schema-form-editor"},Mc={class:"sg-sfe-toolbar","data-testid":"sfe-toolbar"},Lc=["aria-label","disabled"],Fc=["aria-label","disabled"],Ac={class:"sg-sfe-body"},Pc={class:"sg-sfe-center"},Rc={key:0,class:"sg-sfe-bottom","data-testid":"sfe-bottom"},Ic={class:"sg-sfe-tabs"},_c={key:0,class:"sg-sfe-preview-empty","data-testid":"sfe-preview-empty"},Kc={key:1,class:"sg-sfe-preview","data-testid":"sfe-preview"},Hc=e.defineComponent({__name:"SchemaFormEditor",props:{initialSchema:{},store:{},paletteItems:{},emptyText:{},hideSchemaView:{type:Boolean}},emits:["change"],setup(t,{emit:n}){const l=t,a=n,o=oa({initialSchema:l.initialSchema,onChange:p=>a("change",p)}),s=e.computed(()=>l.store??o),u=e.ref("preview"),c=Ee(),i=e.computed(()=>{var p,b;return((b=(p=c.value.locale)==null?void 0:p.schemaFormEditor)==null?void 0:b.undo)??"Undo"}),r=e.computed(()=>{var p,b;return((b=(p=c.value.locale)==null?void 0:p.schemaFormEditor)==null?void 0:b.redo)??"Redo"});function d(p){const b=s.value.state.value.schema.fields.map(y=>y.name);s.value.addField(pl(p,b))}function v(p){const b=p.target;if(b&&(b.tagName==="INPUT"||b.tagName==="TEXTAREA")||!(p.ctrlKey||p.metaKey))return;const E=p.key.toLowerCase();E==="z"&&!p.shiftKey?(p.preventDefault(),s.value.undo()):(E==="z"&&p.shiftKey||E==="y")&&(p.preventDefault(),s.value.redo())}e.onMounted(()=>window.addEventListener("keydown",v)),e.onBeforeUnmount(()=>window.removeEventListener("keydown",v));const g=e.computed(()=>It(s.value.state.value.schema)),m=e.computed(()=>s.value.state.value.schema.fields),h=e.computed(()=>m.value.map(p=>`${p.id}:${p.name}:${p.type}`).join("|"));return(p,b)=>(e.openBlock(),e.createElementBlock("div",Tc,[e.createElementVNode("div",Mc,[b[4]||(b[4]=e.createElementVNode("span",{class:"sg-sfe-toolbar-title"},"Schema Form Editor",-1)),b[5]||(b[5]=e.createElementVNode("span",{style:{flex:"1"}},null,-1)),e.createElementVNode("button",{type:"button",class:"sg-sfe-toolbar-btn","data-testid":"sfe-undo","aria-label":i.value,disabled:!s.value.state.value.canUndo,onClick:b[0]||(b[0]=y=>s.value.undo())},e.toDisplayString(i.value),9,Lc),e.createElementVNode("button",{type:"button",class:"sg-sfe-toolbar-btn","data-testid":"sfe-redo","aria-label":r.value,disabled:!s.value.state.value.canRedo,onClick:b[1]||(b[1]=y=>s.value.redo())},e.toDisplayString(r.value),9,Fc)]),e.createElementVNode("div",Ac,[e.createVNode(Zl,{items:t.paletteItems,onItemActivate:d},null,8,["items"]),e.createElementVNode("div",Pc,[e.createVNode(ta,{store:s.value,"empty-text":t.emptyText},null,8,["store","empty-text"]),t.hideSchemaView?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Rc,[e.createElementVNode("div",Ic,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["sg-sfe-tab",u.value==="preview"?"sg-sfe-tab-active":""]),"data-testid":"sfe-tab-preview",onClick:b[2]||(b[2]=y=>u.value="preview")}," Preview ",2),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["sg-sfe-tab",u.value==="schema"?"sg-sfe-tab-active":""]),"data-testid":"sfe-tab-schema",onClick:b[3]||(b[3]=y=>u.value="schema")}," Schema ",2)]),u.value==="preview"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[m.value.length===0?(e.openBlock(),e.createElementBlock("div",_c," Drop fields onto the canvas to see a live preview. ")):(e.openBlock(),e.createElementBlock("div",Kc,[(e.openBlock(),e.createBlock(Gl,{key:h.value,schema:g.value,layout:"vertical"},{default:e.withCtx(()=>[...b[6]||(b[6]=[e.createElementVNode("span",null,null,-1)])]),_:1},8,["schema"]))]))],64)):(e.openBlock(),e.createBlock(aa,{key:1,store:s.value},null,8,["store"]))]))]),e.createVNode(la,{store:s.value},null,8,["store"])])]))}});function sa(t,n){return a=>{var u;const o=t.safeParse(a);if(o.success)return null;const s=((u=o.error)==null?void 0:u.issues)??[];return s.length===0?(n==null?void 0:n.message)??"Validation failed":(n==null?void 0:n.pick)==="all"?s.map(c=>c.message).join("; "):(n==null?void 0:n.message)??s[0].message}}function Oc(t,n){const l={};for(const[a,o]of Object.entries(t.shape))l[a]=[sa(o,n)];return l}function jc(t){const n={};for(const[l,a]of Object.entries(t.shape))try{const o=a.safeParse(void 0);o.success&&o.data!==void 0&&(n[l]=o.data)}catch{}return n}function Yc(t){var o,s,u;const n={},l=[],a=t.shape??t.shape;if(!a)return{properties:n,required:l};for(const[c,i]of Object.entries(a)){const r={title:c};let d=i._def;switch(d.typeName==="ZodOptional"||d.typeName==="ZodNullable"?d=((o=d.innerType)==null?void 0:o._def)??d:l.push(c),d.typeName==="ZodDefault"&&(r.default=(s=d.defaultValue)==null?void 0:s.call(d),d=((u=d.innerType)==null?void 0:u._def)??d),d.typeName){case"ZodString":r.type="string";for(const v of d.checks??[])v.kind==="min"&&(r.minLength=v.value),v.kind==="max"&&(r.maxLength=v.value),v.kind==="email"&&(r.format="email"),v.kind==="url"&&(r.format="url"),v.kind==="regex"&&v.regex&&(r.pattern=v.regex.source);break;case"ZodNumber":r.type="number";for(const v of d.checks??[])v.kind==="min"&&(r.minimum=v.value),v.kind==="max"&&(r.maximum=v.value);break;case"ZodBoolean":r.type="boolean";break;case"ZodEnum":r.type="string",r.enum=d.values??[];break;case"ZodDate":r.type="string",r.format="date";break;default:r.type="string"}i.description&&(r.description=i.description),n[c]=r}return{properties:n,required:l}}const Wc=["disabled"],Uc=["disabled"],qc=["onClick","onDblclick"],Xc={style:{marginLeft:"auto",fontSize:"10px",opacity:.6}},Gc={style:{opacity:.5}},Jc=e.defineComponent({__name:"HistoryPanel",props:{history:{},style:{}},setup(t){const n=t,l=e.ref(null);function a(c){l.value=l.value===c?null:c}function o(c){return new Date(c).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function s(c){if(c===void 0)return"undefined";if(c===null)return"null";if(typeof c=="string")return`"${c}"`;try{return JSON.stringify(c)}catch{return String(c)}}const u={root:{fontFamily:'ui-monospace, "Cascadia Code", "Fira Code", monospace',fontSize:"12px",border:"1px solid var(--sg-border, #d9d9d9)",borderRadius:"8px",background:"var(--sg-bg-elevated, #fff)",overflow:"hidden"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",borderBottom:"1px solid var(--sg-border, #d9d9d9)",fontWeight:600,fontSize:"13px"},controls:{display:"flex",gap:"4px"},btn:{padding:"2px 8px",border:"1px solid var(--sg-border, #d9d9d9)",borderRadius:"4px",background:"var(--sg-bg, #fafafa)",cursor:"pointer",fontSize:"11px"},btnDisabled:{opacity:.4,cursor:"not-allowed"},list:{maxHeight:"300px",overflowY:"auto",margin:0,padding:0,listStyle:"none"},entry:{display:"flex",alignItems:"center",gap:"8px",padding:"4px 12px",cursor:"pointer",borderBottom:"1px solid var(--sg-border-light, #f0f0f0)",transition:"background 0.15s"},entryActive:{background:"var(--sg-primary-bg, #e6f4ff)",fontWeight:600},entryFuture:{opacity:.5},badge:{display:"inline-block",padding:"1px 6px",borderRadius:"4px",fontSize:"10px",background:"var(--sg-primary-bg, #e6f4ff)",color:"var(--sg-primary, #1677ff)"},patches:{padding:"4px 12px 8px 32px",background:"var(--sg-bg-subtle, #fafafa)",fontSize:"11px",lineHeight:1.6},empty:{padding:"24px 12px",textAlign:"center",color:"var(--sg-text-tertiary, #999)"}};return(c,i)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle({...u.root,...n.style??{}})},[e.createElementVNode("div",{style:e.normalizeStyle(u.header)},[e.createElementVNode("span",null,"Time-Travel ("+e.toDisplayString(n.history.entries.value.length)+")",1),e.createElementVNode("div",{style:e.normalizeStyle(u.controls)},[e.createElementVNode("button",{type:"button",style:e.normalizeStyle({...u.btn,...n.history.canUndo.value?{}:u.btnDisabled}),disabled:!n.history.canUndo.value,onClick:i[0]||(i[0]=r=>n.history.undo())}," Undo ",12,Wc),e.createElementVNode("button",{type:"button",style:e.normalizeStyle({...u.btn,...n.history.canRedo.value?{}:u.btnDisabled}),disabled:!n.history.canRedo.value,onClick:i[1]||(i[1]=r=>n.history.redo())}," Redo ",12,Uc),e.createElementVNode("button",{type:"button",style:e.normalizeStyle(u.btn),onClick:i[2]||(i[2]=r=>n.history.clear())},"Clear",4)],4)],4),n.history.entries.value.length===0?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(u.empty)},"No history yet",4)):(e.openBlock(),e.createElementBlock("ul",{key:1,style:e.normalizeStyle(u.list)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.history.entries.value,(r,d)=>(e.openBlock(),e.createElementBlock("li",{key:d},[e.createElementVNode("div",{style:e.normalizeStyle({...u.entry,...d===n.history.cursor.value?u.entryActive:{},...d>n.history.cursor.value?u.entryFuture:{}}),onClick:v=>n.history.jumpTo(d),onDblclick:v=>a(d)},[e.createElementVNode("span",{style:e.normalizeStyle(u.badge)},e.toDisplayString(d),5),e.createElementVNode("span",null,e.toDisplayString(r.patches.length)+" write"+e.toDisplayString(r.patches.length!==1?"s":""),1),e.createElementVNode("span",Xc,e.toDisplayString(o(r.timestamp)),1)],44,qc),l.value===d?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(u.patches)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.patches,(v,g)=>(e.openBlock(),e.createElementBlock("div",{key:g},[e.createElementVNode("code",null,e.toDisplayString(v.path),1),i[3]||(i[3]=e.createTextVNode(": ",-1)),e.createElementVNode("span",Gc,e.toDisplayString(s(v.oldValue)),1),i[4]||(i[4]=e.createTextVNode(" "+e.toDisplayString(" → ")+" ",-1)),e.createElementVNode("span",null,e.toDisplayString(s(v.value)),1)]))),128))],4)):e.createCommentVNode("",!0)]))),128))],4))],4))}}),Zc=["type","value","placeholder","disabled","aria-invalid","aria-required"],Qc=["aria-label"],eu={key:0,class:"sg-input-password-strength"},tu={class:"sg-input-password-strength-bar"},lu=["type","value","placeholder","disabled"],au=e.defineComponent({__name:"InputPassword",props:{modelValue:{},value:{},defaultValue:{},placeholder:{},visibilityToggle:{type:Boolean,default:!0},showStrength:{type:Boolean,default:!1},strengthLabels:{},size:{},disabled:{type:Boolean},loading:{type:Boolean},unstyled:{type:Boolean},style:{},"aria-invalid":{type:[Boolean,String]},"aria-required":{type:[Boolean,String]}},emits:["update:modelValue","change","focus","blur"],setup(t,{emit:n}){const l=t,a=n,{resolvedSize:o,resolvedDisabled:s}=Ye(l,{}),u=Ee(),c=e.computed(()=>{var z;return{showPassword:"Show password",hidePassword:"Hide password",strengthWeak:"Weak",strengthMedium:"Medium",strengthStrong:"Strong",strengthVeryStrong:"Very strong",...(z=u.value.locale)==null?void 0:z.inputPassword}}),i=e.ref(!1),r=e.ref(l.defaultValue??""),d=e.computed(()=>l.modelValue??l.value??r.value);function v(z){if(!z||z.length<4)return"weak";let x=0;return z.length>=8&&x++,z.length>=12&&x++,/[a-z]/.test(z)&&/[A-Z]/.test(z)&&x++,/\d/.test(z)&&x++,/[^a-zA-Z0-9]/.test(z)&&x++,x<=1?"weak":x<=2?"medium":x<=3?"strong":"very-strong"}const g=e.computed(()=>v(d.value)),m=e.computed(()=>({weak:c.value.strengthWeak,medium:c.value.strengthMedium,strong:c.value.strengthStrong,"very-strong":c.value.strengthVeryStrong,...l.strengthLabels}));function h(z){r.value=z,a("update:modelValue",z),a("change",z)}const p=e.computed(()=>s.value||!!l.loading),b=e.computed(()=>l.unstyled?"":["sg-input-password-wrapper",`sg-input-password-wrapper-${o.value}`,l.loading?"sg-input-wrapper-loading":""].filter(Boolean).join(" ")),y=e.computed(()=>l.unstyled?"":["sg-input","sg-input-password",`sg-input-${o.value}`].join(" ")),E=e.computed(()=>i.value?c.value.hidePassword:c.value.showPassword);return(z,x)=>t.unstyled?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(t.style)},[e.createElementVNode("input",{type:i.value?"text":"password",value:d.value,placeholder:t.placeholder,disabled:p.value,onInput:x[4]||(x[4]=f=>h(f.target.value)),onFocus:x[5]||(x[5]=f=>a("focus",f)),onBlur:x[6]||(x[6]=f=>a("blur",f))},null,40,lu),t.visibilityToggle?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",onClick:x[7]||(x[7]=f=>i.value=!i.value)},e.toDisplayString(i.value?c.value.hidePassword:c.value.showPassword),1)):e.createCommentVNode("",!0)],4)):(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(t.style)},[e.createElementVNode("span",{class:e.normalizeClass(b.value)},[e.createElementVNode("input",{type:i.value?"text":"password",class:e.normalizeClass(y.value),value:d.value,placeholder:t.placeholder,disabled:p.value,"aria-invalid":l["aria-invalid"],"aria-required":l["aria-required"],onInput:x[0]||(x[0]=f=>h(f.target.value)),onFocus:x[1]||(x[1]=f=>a("focus",f)),onBlur:x[2]||(x[2]=f=>a("blur",f))},null,42,Zc),t.loading?(e.openBlock(),e.createBlock(Bt,{key:0,size:"small"})):e.createCommentVNode("",!0),t.visibilityToggle&&!t.loading?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"sg-input-password-toggle",tabindex:"-1","aria-label":E.value,onClick:x[3]||(x[3]=f=>i.value=!i.value)},e.toDisplayString(i.value?"◉":"○"),9,Qc)):e.createCommentVNode("",!0)],2),t.showStrength&&d.value.length>0?(e.openBlock(),e.createElementBlock("div",eu,[e.createElementVNode("div",tu,[e.createElementVNode("span",{class:e.normalizeClass(`sg-input-password-strength-fill sg-input-password-strength-${g.value}`)},null,2)]),e.createElementVNode("span",{class:e.normalizeClass(`sg-input-password-strength-label sg-input-password-strength-${g.value}`)},e.toDisplayString(m.value[g.value]),3)])):e.createCommentVNode("",!0)],4))}}),nu=["value","placeholder","disabled"],ou=["aria-label"],su=["disabled"],ru=["value","placeholder","disabled"],iu=["disabled"],cu=e.defineComponent({__name:"SearchInput",props:{modelValue:{},value:{},defaultValue:{},placeholder:{},allowClear:{type:Boolean,default:!0},enterButton:{type:[Boolean,String]},size:{},disabled:{type:Boolean},loading:{type:Boolean},unstyled:{type:Boolean},style:{}},emits:["update:modelValue","change","search","focus","blur"],setup(t,{emit:n}){const l=t,a=n,{resolvedSize:o,resolvedDisabled:s}=Ye(l,{}),u=Ee(),c=e.computed(()=>{var E;return{placeholder:"Search…",clear:"Clear",search:"Search",...(E=u.value.locale)==null?void 0:E.searchInput}}),i=e.ref(l.defaultValue??""),r=e.ref(null),d=e.computed(()=>l.modelValue??l.value??i.value),v=e.computed(()=>l.placeholder??c.value.placeholder);function g(E){i.value=E,a("update:modelValue",E),a("change",E)}function m(){s.value||l.loading||a("search",d.value)}function h(){var E;g(""),a("search",""),(E=r.value)==null||E.focus()}function p(E){E.key==="Enter"&&m()}const b=e.computed(()=>l.unstyled?"":["sg-search-input",`sg-search-input-${o.value}`,l.enterButton?"sg-search-input-with-button":"",l.loading?"sg-search-input-loading":"",s.value?"sg-search-input-disabled":""].filter(Boolean).join(" ")),y=e.computed(()=>s.value||!!l.loading);return(E,z)=>t.unstyled?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(t.style)},[e.createElementVNode("input",{ref_key:"inputRef",ref:r,type:"search",value:d.value,placeholder:v.value,disabled:y.value,onInput:z[3]||(z[3]=x=>g(x.target.value)),onKeydown:p,onFocus:z[4]||(z[4]=x=>a("focus",x)),onBlur:z[5]||(z[5]=x=>a("blur",x))},null,40,ru),t.enterButton?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:y.value,onClick:m},e.toDisplayString(typeof t.enterButton=="string"?t.enterButton:c.value.search),9,iu)):e.createCommentVNode("",!0)],4)):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(b.value),style:e.normalizeStyle(t.style)},[z[6]||(z[6]=e.createElementVNode("span",{class:"sg-search-input-icon"},"⌕",-1)),e.createElementVNode("input",{ref_key:"inputRef",ref:r,type:"text",class:e.normalizeClass(`sg-input sg-input-${e.unref(o)} sg-search-input-field`),value:d.value,placeholder:v.value,disabled:y.value,onInput:z[0]||(z[0]=x=>g(x.target.value)),onKeydown:p,onFocus:z[1]||(z[1]=x=>a("focus",x)),onBlur:z[2]||(z[2]=x=>a("blur",x))},null,42,nu),t.loading?(e.openBlock(),e.createBlock(Bt,{key:0,size:"small"})):e.createCommentVNode("",!0),t.allowClear&&d.value&&!t.loading?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"sg-search-input-clear",tabindex:"-1","aria-label":c.value.clear,onClick:h}," × ",8,ou)):e.createCommentVNode("",!0),t.enterButton?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"sg-search-input-btn",disabled:y.value,onClick:m},e.toDisplayString(typeof t.enterButton=="string"?t.enterButton:"⌕"),9,su)):e.createCommentVNode("",!0)],6))}}),uu=["aria-label","onClick"],du=["value","placeholder","disabled"],mu={key:0,class:"sg-tag-input-count"},pu=["onClick"],vu=["placeholder","disabled"],gu=e.defineComponent({__name:"TagInput",props:{modelValue:{},value:{},defaultValue:{default:()=>[]},placeholder:{},maxTags:{},allowDuplicates:{type:Boolean,default:!1},removable:{type:Boolean,default:!0},tagColor:{default:"default"},size:{},disabled:{type:Boolean},loading:{type:Boolean},unstyled:{type:Boolean},style:{}},emits:["update:modelValue","change","focus","blur"],setup(t,{emit:n}){const l=t,a=n,{resolvedSize:o,resolvedDisabled:s}=Ye(l,{}),u=Ee(),c=e.computed(()=>{var B;return{placeholder:"Add tag…",removeTag:"Remove",...(B=u.value.locale)==null?void 0:B.tagInput}}),i=e.ref([...l.defaultValue]),r=e.ref(""),d=e.ref(null),v=e.computed(()=>l.modelValue??l.value??i.value),g=e.computed(()=>l.placeholder??c.value.placeholder);function m(B){i.value=B,a("update:modelValue",B),a("change",B)}function h(B){const w=B.trim();w&&(l.maxTags&&v.value.length>=l.maxTags||!l.allowDuplicates&&v.value.includes(w)||(m([...v.value,w]),r.value=""))}function p(B){m(v.value.filter((w,S)=>S!==B))}function b(B){B.key==="Enter"||B.key===","?(B.preventDefault(),h(r.value)):B.key==="Backspace"&&!r.value&&v.value.length>0&&p(v.value.length-1)}function y(B){var T;B.preventDefault();const S=(((T=B.clipboardData)==null?void 0:T.getData("text"))??"").split(/[,;\n]+/).map(P=>P.trim()).filter(Boolean),L=[...v.value];for(const P of S){if(l.maxTags&&L.length>=l.maxTags)break;!l.allowDuplicates&&L.includes(P)||L.push(P)}m(L)}function E(){var B;(B=d.value)==null||B.focus()}function z(B){r.value.trim()&&h(r.value),a("blur",B)}const x=e.computed(()=>l.unstyled?"":["sg-tag-input",`sg-tag-input-${o.value}`,s.value?"sg-tag-input-disabled":""].filter(Boolean).join(" ")),f=e.computed(()=>l.tagColor!=="default"?`sg-tag-${l.tagColor}`:""),N=e.computed(()=>s.value||!!l.loading);return(B,w)=>t.unstyled?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(t.style)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(S,L)=>(e.openBlock(),e.createElementBlock("span",{key:`${S}-${L}`},[e.createTextVNode(e.toDisplayString(S)+" ",1),t.removable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",onClick:T=>p(L)},"×",8,pu)):e.createCommentVNode("",!0)]))),128)),e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:d,"onUpdate:modelValue":w[2]||(w[2]=S=>r.value=S),placeholder:v.value.length===0?g.value:"",disabled:N.value,onKeydown:b,onPaste:y,onFocus:w[3]||(w[3]=S=>a("focus",S)),onBlur:z},null,40,vu),[[e.vModelText,r.value]])],4)):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(x.value),style:e.normalizeStyle(t.style),onClick:E},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(S,L)=>(e.openBlock(),e.createElementBlock("span",{key:`${S}-${L}`,class:e.normalizeClass(["sg-tag",f.value].filter(Boolean).join(" "))},[e.createTextVNode(e.toDisplayString(S)+" ",1),t.removable&&!e.unref(s)?(e.openBlock(),e.createElementBlock("span",{key:0,class:"sg-tag-close",role:"button","aria-label":`${c.value.removeTag} ${S}`,onClick:e.withModifiers(T=>p(L),["stop"])},"×",8,uu)):e.createCommentVNode("",!0)],2))),128)),e.createElementVNode("input",{ref_key:"inputRef",ref:d,class:"sg-tag-input-field",value:r.value,placeholder:v.value.length===0?g.value:"",disabled:N.value,onInput:w[0]||(w[0]=S=>r.value=S.target.value),onKeydown:b,onPaste:y,onFocus:w[1]||(w[1]=S=>a("focus",S)),onBlur:z},null,40,du),t.maxTags?(e.openBlock(),e.createElementBlock("span",mu,e.toDisplayString(v.value.length)+"/"+e.toDisplayString(t.maxTags),1)):e.createCommentVNode("",!0)],6))}}),fu=["aria-label"],hu=["type","inputmode","value","disabled","autofocus","onInput","onKeydown"],yu=["type","inputmode","placeholder","value","disabled","autofocus","onInput","onKeydown"],ku=e.defineComponent({__name:"PinInput",props:{length:{default:6},modelValue:{},value:{},defaultValue:{},mask:{type:Boolean,default:!1},type:{default:"numeric"},placeholder:{default:"○"},autoFocus:{type:Boolean,default:!1},size:{},disabled:{type:Boolean},loading:{type:Boolean},unstyled:{type:Boolean},style:{},"aria-label":{}},emits:["update:modelValue","change","complete"],setup(t,{emit:n}){const l=t,a=n,{resolvedSize:o,resolvedDisabled:s}=Ye(l,{}),u=Ee(),c=e.computed(()=>{var T;return{ariaLabel:"PIN input",...(T=u.value.locale)==null?void 0:T.pinInput}}),i=e.computed(()=>l.length);function r(T){const q=T.replace(/\s/g,"").slice(0,i.value).split("");for(;q.length<i.value;)q.push(" ");return q.join("")}function d(T){const P=T.split("");for(;P.length<i.value;)P.push(" ");return P.slice(0,i.value)}const v=e.computed(()=>l.modelValue!==void 0||l.value!==void 0),g=e.ref(r(l.defaultValue??"")),m=e.computed(()=>v.value?r(String(l.modelValue??l.value??"")):g.value),h=e.computed(()=>l.type==="numeric"?/^\d$/:/^[a-zA-Z0-9]$/),p=[];function b(T,P){p[P]=T??null}function y(T){var P;T>=0&&T<i.value&&((P=p[T])==null||P.focus())}function E(T){const P=d(T).join("");v.value||(g.value=P);const q=P.replace(/\s/g,"");a("update:modelValue",q),a("change",q),q.length===i.value&&a("complete",q)}function z(T,P){if(!h.value.test(P))return;const q=d(m.value);q[T]=P,E(q.join("")),y(T+1)}function x(T,P){if(P.key==="Backspace"){P.preventDefault();const q=d(m.value);q[T]!==" "?(q[T]=" ",E(q.join(""))):y(T-1)}else P.key==="ArrowLeft"?y(T-1):P.key==="ArrowRight"&&y(T+1)}function f(T){var R;T.preventDefault();const P=(((R=T.clipboardData)==null?void 0:R.getData("text"))??"").slice(0,i.value),q=d(m.value);let _=0;for(const U of P)h.value.test(U)&&_<i.value&&(q[_]=U,_++);E(q.join("")),y(Math.min(_,i.value-1))}function N(T){const P=m.value[T];return P===" "||P===void 0?"":P}const B=e.computed(()=>l.unstyled?"":["sg-pin-input",`sg-pin-input-${o.value}`,s.value?"sg-pin-input-disabled":""].filter(Boolean).join(" ")),w=e.computed(()=>s.value||!!l.loading),S=e.computed(()=>l["aria-label"]??c.value.ariaLabel),L=e.computed(()=>Array.from({length:i.value},(T,P)=>P));return(T,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.unstyled?"":B.value),style:e.normalizeStyle(t.style),role:"group","aria-label":S.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,q=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:q},[t.unstyled?(e.openBlock(),e.createElementBlock("input",{key:0,ref_for:!0,ref:_=>b(_,q),type:t.mask?"password":"text",inputmode:t.type==="numeric"?"numeric":"text",maxlength:"1",value:N(q),disabled:w.value,autofocus:t.autoFocus&&q===0,onInput:_=>z(q,_.target.value),onKeydown:_=>x(q,_),onPaste:f,onFocus:P[0]||(P[0]=_=>_.target.select())},null,40,hu)):(e.openBlock(),e.createElementBlock("input",{key:1,ref_for:!0,ref:_=>b(_,q),class:e.normalizeClass(["sg-pin-input-cell",`sg-pin-input-cell-${e.unref(o)}`,N(q)?"sg-pin-input-cell-filled":""].filter(Boolean).join(" ")),type:t.mask?"password":"text",inputmode:t.type==="numeric"?"numeric":"text",maxlength:"1",placeholder:t.placeholder,value:N(q),disabled:w.value,autofocus:t.autoFocus&&q===0,onInput:_=>z(q,_.target.value),onKeydown:_=>x(q,_),onPaste:f,onFocus:P[1]||(P[1]=_=>_.target.select())},null,42,yu))],64))),128))],14,fu))}}),bu=["tabindex"],Bu={key:0,class:"sg-inline-edit-pencil"},Cu=["value"],wu=["value"],Su={key:0,class:"sg-inline-edit-actions"},Eu=["aria-label"],xu=["aria-label"],$u=e.defineComponent({__name:"InlineEdit",props:{modelValue:{},value:{},defaultValue:{default:""},placeholder:{default:""},showButtons:{type:Boolean,default:!0},saveOnBlur:{type:Boolean,default:!0},saveOnEnter:{type:Boolean,default:!0},size:{},disabled:{type:Boolean},loading:{type:Boolean},unstyled:{type:Boolean},style:{}},emits:["update:modelValue","save","cancel"],setup(t,{emit:n}){const l=t,a=n,{resolvedSize:o,resolvedDisabled:s}=Ye(l,{}),u=Ee(),c=e.computed(()=>{var w;return{placeholder:"Click to edit…",save:"Save",cancel:"Cancel",...(w=u.value.locale)==null?void 0:w.inlineEdit}}),i=e.computed(()=>l.placeholder||c.value.placeholder),r=e.ref(!1),d=e.ref(l.defaultValue),v=e.ref(""),g=e.ref(null),m=e.useSlots(),h=e.computed(()=>!!m.view),p=e.computed(()=>l.modelValue??l.value??d.value);e.watch(r,w=>{w&&(v.value=p.value,e.nextTick(()=>{var S;return(S=g.value)==null?void 0:S.focus()}))});function b(){s.value||l.loading||(r.value=!0)}function y(){r.value=!1,d.value=v.value,a("update:modelValue",v.value),a("save",v.value)}function E(){r.value=!1,v.value=p.value,a("cancel")}function z(w){w.key==="Enter"&&l.saveOnEnter?(w.preventDefault(),y()):w.key==="Escape"&&E()}const x=e.computed(()=>["sg-inline-edit-view",`sg-inline-edit-view-${o.value}`,p.value?"":"sg-inline-edit-view-placeholder",s.value?"sg-inline-edit-view-disabled":""].filter(Boolean).join(" "));function f(w){(w.key==="Enter"||w.key===" ")&&b()}function N(){l.saveOnBlur&&y()}function B(){l.saveOnBlur&&!l.showButtons&&y()}return(w,S)=>r.value?t.unstyled?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(t.style)},[e.createElementVNode("input",{ref_key:"inputRef",ref:g,value:v.value,onInput:S[0]||(S[0]=L=>v.value=L.target.value),onKeydown:z,onBlur:N},null,40,Cu),t.showButtons?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("button",{type:"button",onClick:y},"✓"),e.createElementVNode("button",{type:"button",onClick:E},"✕")],64)):e.createCommentVNode("",!0)],4)):(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["sg-inline-edit",`sg-inline-edit-${e.unref(o)}`].filter(Boolean).join(" ")),style:e.normalizeStyle(t.style)},[e.createElementVNode("input",{ref_key:"inputRef",ref:g,class:e.normalizeClass(`sg-input sg-input-${e.unref(o)} sg-inline-edit-input`),value:v.value,onInput:S[1]||(S[1]=L=>v.value=L.target.value),onKeydown:z,onBlur:B},null,42,wu),t.showButtons?(e.openBlock(),e.createElementBlock("span",Su,[e.createElementVNode("button",{type:"button",class:"sg-inline-edit-btn sg-inline-edit-btn-save","aria-label":c.value.save,onClick:y}," ✓ ",8,Eu),e.createElementVNode("button",{type:"button",class:"sg-inline-edit-btn sg-inline-edit-btn-cancel","aria-label":c.value.cancel,onClick:E}," ✕ ",8,xu)])):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[h.value?e.renderSlot(w.$slots,"view",{key:0,value:p.value,startEditing:b}):t.unstyled?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle({...t.style,cursor:e.unref(s)?"default":"pointer"}),onClick:b},e.toDisplayString(p.value||i.value),5)):(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(x.value),style:e.normalizeStyle(t.style),role:"button",tabindex:e.unref(s)?-1:0,onClick:b,onKeydown:f},[e.createTextVNode(e.toDisplayString(p.value||i.value)+" ",1),e.unref(s)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Bu,"✎"))],46,bu))],64))}}),Nu={key:0,class:"sg-input-group-addon"},Vu={key:1,class:"sg-input-group-addon"},Du=e.defineComponent({__name:"InputGroup",props:{compact:{type:Boolean,default:!0},size:{},unstyled:{type:Boolean},style:{}},setup(t){const n=t,{resolvedSize:l}=Ye(n,{}),a=e.useSlots(),o=e.computed(()=>!!a.before),s=e.computed(()=>!!a.after),u=e.computed(()=>n.unstyled?"":["sg-input-group",`sg-input-group-${l.value}`,n.compact?"sg-input-group-compact":""].filter(Boolean).join(" "));return(c,i)=>t.unstyled?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(t.style)},[e.renderSlot(c.$slots,"before"),e.renderSlot(c.$slots,"default"),e.renderSlot(c.$slots,"after")],4)):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(u.value),style:e.normalizeStyle(t.style)},[o.value?(e.openBlock(),e.createElementBlock("span",Nu,[e.renderSlot(c.$slots,"before")])):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"default"),s.value?(e.openBlock(),e.createElementBlock("span",Vu,[e.renderSlot(c.$slots,"after")])):e.createCommentVNode("",!0)],6))}}),zu=["disabled"],Tu=["aria-valuemin","aria-valuemax","aria-valuenow","value","placeholder","disabled"],Mu=["disabled"],Lu={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},Fu=e.defineComponent({__name:"InputNumber",props:{modelValue:{},value:{},defaultValue:{},min:{},max:{},step:{default:1},precision:{},placeholder:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"middle"},unstyled:{type:Boolean}},emits:["update:modelValue","change","blur"],setup(t,{emit:n}){const l=t,a=n,o=l.modelValue??l.value??l.defaultValue??null,s=e.ref(o);e.watch(()=>l.modelValue??l.value,p=>{p!==void 0&&(s.value=p)});const u=e.computed(()=>l.modelValue??l.value??s.value),c=e.computed(()=>l.unstyled?"":["sg-input-number",`sg-input-number-${l.size}`,l.loading?"sg-input-number-loading":""].filter(Boolean).join(" "));function i(p){let b=p;return l.min!==void 0&&b<l.min&&(b=l.min),l.max!==void 0&&b>l.max&&(b=l.max),l.precision!==void 0&&(b=Number(b.toFixed(l.precision))),b}function r(p){const b=p!==null?i(p):null;s.value=b,a("update:modelValue",b),a("change",b)}function d(p){const b=p.target.value;if(b===""||b==="-"){s.value=null,a("update:modelValue",null),a("change",null);return}const y=Number(b);isNaN(y)||r(y)}function v(){l.disabled||l.loading||r((u.value??0)+l.step)}function g(){l.disabled||l.loading||r((u.value??0)-l.step)}const m=e.computed(()=>l.min!==void 0&&(u.value??0)<=l.min),h=e.computed(()=>l.max!==void 0&&(u.value??0)>=l.max);return(p,b)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(c.value)},[e.createElementVNode("button",{class:e.normalizeClass(t.unstyled?"":"sg-input-number-btn sg-input-number-minus"),disabled:t.disabled||t.loading||m.value,tabindex:"-1",onClick:g}," − ",10,zu),e.createElementVNode("input",{type:"text",inputmode:"numeric",role:"spinbutton","aria-valuemin":t.min,"aria-valuemax":t.max,"aria-valuenow":u.value??void 0,class:e.normalizeClass(t.unstyled?"":"sg-input-number-input"),value:u.value??"",placeholder:t.placeholder,disabled:t.disabled||t.loading,onInput:d,onBlur:b[0]||(b[0]=y=>a("blur"))},null,42,Tu),e.createElementVNode("button",{class:e.normalizeClass(t.unstyled?"":"sg-input-number-btn sg-input-number-plus"),disabled:t.disabled||t.loading||h.value,tabindex:"-1",onClick:v}," + ",10,Mu),t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",Lu)):e.createCommentVNode("",!0)],2))}}),Au=["id","value","placeholder","rows","disabled","aria-disabled"],Pu={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},Ru={key:1,class:"sg-textarea-count"},Iu=e.defineComponent({__name:"Textarea",props:{modelValue:{},value:{},defaultValue:{},placeholder:{},rows:{default:4},maxLength:{},showCount:{type:Boolean},id:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"middle"},unstyled:{type:Boolean}},emits:["update:modelValue","change","blur","focus"],setup(t,{emit:n}){const l=t,a=n,o=e.ref(l.modelValue??l.value??l.defaultValue??"");e.watch(()=>l.modelValue??l.value,i=>{i!==void 0&&(o.value=i)});const s=e.computed(()=>l.modelValue??l.value??o.value),u=e.computed(()=>l.unstyled?"":["sg-textarea-wrapper",`sg-textarea-${l.size}`,l.loading?"sg-textarea-wrapper-loading":""].filter(Boolean).join(" "));function c(i){let d=i.target.value;l.maxLength&&d.length>l.maxLength&&(d=d.slice(0,l.maxLength)),o.value=d,a("update:modelValue",d),a("change",d)}return(i,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(u.value)},[e.createElementVNode("textarea",{id:t.id,class:e.normalizeClass(t.unstyled?"":"sg-input sg-textarea"),value:s.value,placeholder:t.placeholder,rows:t.rows,disabled:t.disabled||t.loading,"aria-disabled":t.disabled||t.loading,onInput:c,onBlur:r[0]||(r[0]=d=>a("blur")),onFocus:r[1]||(r[1]=d=>a("focus"))},null,42,Au),t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",Pu)):e.createCommentVNode("",!0),t.showCount&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",Ru,e.toDisplayString(s.value.length)+e.toDisplayString(t.maxLength?` / ${t.maxLength}`:""),1)):e.createCommentVNode("",!0)],2))}}),_u=["aria-checked","checked","disabled","onChange"],Ku={key:0,class:"sg-radio-box","aria-hidden":"true"},Hu={key:1,class:"sg-spin sg-spin-small","aria-hidden":"true"},Ou=e.defineComponent({__name:"Radio",props:{modelValue:{default:void 0},value:{default:void 0},defaultValue:{default:void 0},options:{},direction:{default:"horizontal"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},unstyled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){const l=t,a=n,o=e.ref(l.modelValue??l.value??l.defaultValue);e.watch(()=>l.modelValue??l.value,d=>{d!==void 0&&(o.value=d)});const s=e.computed(()=>l.modelValue??l.value??o.value);function u(d){d.disabled||l.disabled||l.loading||(o.value=d.value,a("update:modelValue",d.value),a("change",d.value))}const c=e.computed(()=>l.unstyled?"":["sg-radio-group",`sg-radio-group-${l.direction}`,l.loading?"sg-radio-group-loading":""].filter(Boolean).join(" ")),i=e.ref(null);function r(){const d=i.value;if(!d)return;d.querySelectorAll('input[type="radio"]').forEach((g,m)=>{const h=l.options[m];if(!h)return;const p=s.value===h.value;g.checked!==p&&(g.checked=p)})}return e.watch([()=>s.value,()=>l.options],()=>r(),{flush:"post"}),e.onMounted(r),(d,v)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:i,class:e.normalizeClass(c.value),role:"radiogroup"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,g=>(e.openBlock(),e.createElementBlock("label",{key:g.value,class:e.normalizeClass(t.unstyled?"":["sg-radio",s.value===g.value?"sg-radio-checked":"",g.disabled||t.disabled||t.loading?"sg-radio-disabled":""].filter(Boolean).join(" "))},[e.createElementVNode("input",{type:"radio",role:"radio",class:e.normalizeClass(t.unstyled?"":"sg-radio-input"),"aria-checked":s.value===g.value,checked:s.value===g.value,disabled:g.disabled||t.disabled||t.loading,onChange:m=>u(g)},null,42,_u),t.unstyled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Ku)),e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?"":"sg-radio-label")},e.toDisplayString(g.label),3),t.loading&&s.value===g.value&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",Hu)):e.createCommentVNode("",!0)],2))),128))],2))}}),ju=["aria-checked","disabled"],Yu={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},Wu={class:"sg-switch-inner"},Uu={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},qu=e.defineComponent({__name:"Switch",props:{modelValue:{type:Boolean},checked:{type:Boolean},defaultChecked:{type:Boolean},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"middle"},unstyled:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:n}){const l=t,a=n,o=e.ref(l.modelValue??l.checked??l.defaultChecked??!1);e.watch(()=>l.modelValue??l.checked,r=>{r!==void 0&&(o.value=r)});const s=e.computed(()=>l.modelValue??l.checked??o.value);function u(){if(l.disabled||l.loading)return;const r=!s.value;o.value=r,a("update:modelValue",r),a("change",r)}const c=e.computed(()=>l.size==="small"?"small":"default"),i=e.computed(()=>["sg-switch",`sg-switch-${c.value}`,s.value?"sg-switch-checked":"",l.disabled||l.loading?"sg-switch-disabled":"",l.loading?"sg-switch-loading":""].filter(Boolean).join(" "));return(r,d)=>(e.openBlock(),e.createElementBlock("button",{role:"switch","aria-checked":s.value,disabled:t.disabled||t.loading,class:e.normalizeClass(t.unstyled?"":i.value),type:"button",onClick:u},[t.unstyled?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.loading?(e.openBlock(),e.createElementBlock("span",Yu)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?e.renderSlot(r.$slots,"checkedChildren",{key:0}):e.renderSlot(r.$slots,"unCheckedChildren",{key:1})],64))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",Wu,[t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",Uu)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?e.renderSlot(r.$slots,"checkedChildren",{key:0}):e.renderSlot(r.$slots,"unCheckedChildren",{key:1})],64))]),d[0]||(d[0]=e.createElementVNode("span",{class:"sg-switch-handle"},null,-1))],64))],10,ju))}}),Xu=["aria-valuemin","aria-valuemax","aria-valuenow","aria-disabled","tabindex"],Gu=e.defineComponent({__name:"Slider",props:{modelValue:{},value:{},defaultValue:{default:0},min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},unstyled:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:n}){const l=t,a=n,o=e.ref(l.modelValue??l.value??l.defaultValue??0);e.watch(()=>l.modelValue??l.value,m=>{m!==void 0&&(o.value=m)});const s=e.computed(()=>l.modelValue??l.value??o.value),u=e.ref(null),c=e.computed(()=>(s.value-l.min)/(l.max-l.min)*100);function i(m){o.value=m,a("update:modelValue",m),a("change",m)}function r(m){if(!u.value||l.disabled)return;const h=u.value.getBoundingClientRect(),p=Math.max(0,Math.min(1,(m-h.left)/h.width)),b=l.min+p*(l.max-l.min),y=Math.round(b/l.step)*l.step;i(Math.max(l.min,Math.min(l.max,y)))}function d(m){if(l.disabled)return;r(m.clientX);const h=b=>r(b.clientX),p=()=>{document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",p)};document.addEventListener("mousemove",h),document.addEventListener("mouseup",p)}function v(m){l.disabled||(m.key==="ArrowRight"||m.key==="ArrowUp"?(m.preventDefault(),i(Math.min(l.max,s.value+l.step))):(m.key==="ArrowLeft"||m.key==="ArrowDown")&&(m.preventDefault(),i(Math.max(l.min,s.value-l.step))))}const g=e.computed(()=>l.unstyled?"":["sg-slider",l.disabled?"sg-slider-disabled":""].filter(Boolean).join(" "));return(m,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(g.value)},[e.createElementVNode("div",{ref_key:"trackRef",ref:u,class:e.normalizeClass(t.unstyled?"":"sg-slider-track"),onMousedown:d},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-slider-fill"),style:e.normalizeStyle({width:`${c.value}%`})},null,6),e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-slider-handle"),style:e.normalizeStyle({left:`${c.value}%`}),role:"slider","aria-valuemin":t.min,"aria-valuemax":t.max,"aria-valuenow":s.value,"aria-disabled":t.disabled,tabindex:t.disabled?-1:0,onKeydown:v},null,46,Xu)],34)],2))}}),Ju=["aria-checked","aria-label","tabindex","onClick","onMousemove","onKeydown"],Zu="Rating",Qu=e.defineComponent({__name:"Rate",props:{modelValue:{},value:{},defaultValue:{default:0},count:{default:5},allowHalf:{type:Boolean,default:!1},character:{default:"★"},disabled:{type:Boolean,default:!1},unstyled:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:n}){const l=t,a=n,o=p=>`${p} star${p>1?"s":""}`,s=e.ref(l.modelValue??l.value??l.defaultValue),u=e.ref(null);e.watch(()=>l.modelValue??l.value,p=>{p!==void 0&&(s.value=p)});const c=e.computed(()=>l.modelValue??l.value??s.value),i=e.computed(()=>u.value??c.value);function r(p){s.value=p,a("update:modelValue",p),a("change",p)}function d(p,b){if(l.disabled)return;if(!l.allowHalf){r(c.value===p?0:p);return}const E=b.currentTarget.getBoundingClientRect(),x=b.clientX-E.left<E.width/2?p-.5:p;r(c.value===x?0:x)}function v(p,b){if(l.disabled)return;if(!l.allowHalf){u.value=p;return}const E=b.currentTarget.getBoundingClientRect(),z=b.clientX-E.left<E.width/2;u.value=z?p-.5:p}function g(p,b){l.disabled||(b.key==="ArrowRight"||b.key==="ArrowUp"?(b.preventDefault(),r(Math.min(l.count,l.allowHalf?c.value+.5:c.value+1))):(b.key==="ArrowLeft"||b.key==="ArrowDown")&&(b.preventDefault(),r(Math.max(0,l.allowHalf?c.value-.5:c.value-1))))}const m=e.computed(()=>l.unstyled?"":["sg-rate",l.disabled?"sg-rate-disabled":""].filter(Boolean).join(" "));function h(p){const b=i.value>=p,y=l.allowHalf&&i.value>=p-.5&&i.value<p;return["sg-rate-star",b?"sg-rate-star-full":"",y?"sg-rate-star-half":""].filter(Boolean).join(" ")}return(p,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(m.value),role:"radiogroup","aria-label":Zu},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.count,y=>(e.openBlock(),e.createElementBlock("span",{key:y,class:e.normalizeClass(t.unstyled?"":h(y)),role:"radio","aria-checked":i.value>=y,"aria-label":o(y),tabindex:t.disabled?-1:0,onClick:E=>d(y,E),onMousemove:E=>v(y,E),onMouseleave:b[0]||(b[0]=E=>!t.disabled&&(u.value=null)),onKeydown:E=>g(y,E)},e.toDisplayString(t.character),43,Ju))),128))],2))}}),ed=["aria-expanded","value","placeholder","disabled"],td={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},ld=["onMousedown"],ad=e.defineComponent({__name:"AutoComplete",props:{modelValue:{},value:{},defaultValue:{},options:{},placeholder:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"middle"},unstyled:{type:Boolean}},emits:["update:modelValue","change","search","select","blur"],setup(t,{emit:n}){const l=t,a=e.computed(()=>l.disabled||l.loading),o=n,s=e.ref(l.modelValue??l.value??l.defaultValue??"");e.watch(()=>l.modelValue??l.value,h=>{h!==void 0&&(s.value=h)});const u=e.computed(()=>l.modelValue??l.value??s.value),c=e.ref(!1),i=e.ref(null),r=e.computed(()=>l.options.filter(h=>(h.label??h.value).toLowerCase().includes((u.value??"").toLowerCase())));function d(h){const p=h.target.value;s.value=p,o("update:modelValue",p),o("change",p),o("search",p),c.value=!0}function v(h){s.value=h.value,o("update:modelValue",h.value),o("change",h.value),o("select",h.value,h),c.value=!1}function g(h){i.value&&!i.value.contains(h.target)&&(c.value=!1)}e.onMounted(()=>document.addEventListener("mousedown",g)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",g));const m=e.computed(()=>l.unstyled?"":["sg-autocomplete",`sg-autocomplete-${l.size}`,l.loading?"sg-autocomplete-loading":""].filter(Boolean).join(" "));return(h,p)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:i,class:e.normalizeClass(m.value)},[e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?"":"sg-input-wrapper")},[e.createElementVNode("input",{type:"text",role:"combobox","aria-autocomplete":"list","aria-expanded":c.value&&r.value.length>0,class:e.normalizeClass(t.unstyled?"":`sg-input sg-input-${t.size}`),value:u.value,placeholder:t.placeholder,disabled:a.value,onInput:d,onFocus:p[0]||(p[0]=b=>c.value=!0),onBlur:p[1]||(p[1]=b=>o("blur"))},null,42,ed),t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",td)):e.createCommentVNode("",!0)],2),c.value&&r.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.unstyled?"":"sg-autocomplete-dropdown")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,b=>(e.openBlock(),e.createElementBlock("div",{key:b.value,class:e.normalizeClass(t.unstyled?"":"sg-autocomplete-option"),onMousedown:y=>v(b)},e.toDisplayString(b.label??b.value),43,ld))),128))],2)):e.createCommentVNode("",!0)],2))}}),nd=["disabled","aria-expanded","aria-label"],od={key:0,class:"sg-colorpicker-text"},sd={class:"sg-colorpicker-input-row"},rd=["value"],id={class:"sg-colorpicker-preset-label"},cd={class:"sg-colorpicker-preset-grid"},ud=["title","onClick"],dd="#1677ff",md=e.defineComponent({__name:"ColorPicker",props:{modelValue:{},value:{},defaultValue:{},presets:{},showText:{type:Boolean},format:{default:"hex"},trigger:{default:"click"},open:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},size:{default:"middle"},unstyled:{type:Boolean}},emits:["update:modelValue","change","openChange"],setup(t,{emit:n}){const l=t,a=n,o=Ee(),s=e.computed(()=>{var O,Q;return((Q=(O=o.value.locale)==null?void 0:O.colorPicker)==null?void 0:Q.pickColor)??"Pick color"});function u(O){const Q=O.replace("#",""),re=Q.length===3?Q[0]+Q[0]+Q[1]+Q[1]+Q[2]+Q[2]:Q,ce=parseInt(re,16);return[ce>>16&255,ce>>8&255,ce&255]}function c(O,Q,re){return"#"+[O,Q,re].map(ce=>Math.round(ce).toString(16).padStart(2,"0")).join("")}function i(O,Q,re){O/=255,Q/=255,re/=255;const ce=Math.max(O,Q,re),ne=Math.min(O,Q,re),de=ce-ne;let ye=0;const Me=ce===0?0:de/ce,Ne=ce;if(de!==0)switch(ce){case O:ye=((Q-re)/de+(Q<re?6:0))/6;break;case Q:ye=((re-O)/de+2)/6;break;case re:ye=((O-Q)/de+4)/6;break}return{h:ye,s:Me,v:Ne}}function r(O,Q,re){let ce=0,ne=0,de=0;const ye=Math.floor(O*6),Me=O*6-ye,Ne=re*(1-Q),Ie=re*(1-Me*Q),ze=re*(1-(1-Me)*Q);switch(ye%6){case 0:ce=re,ne=ze,de=Ne;break;case 1:ce=Ie,ne=re,de=Ne;break;case 2:ce=Ne,ne=re,de=ze;break;case 3:ce=Ne,ne=Ie,de=re;break;case 4:ce=ze,ne=Ne,de=re;break;case 5:ce=re,ne=Ne,de=Ie;break}return[Math.round(ce*255),Math.round(ne*255),Math.round(de*255)]}function d(O,Q,re){const[ce,ne,de]=r(O,Q,re);return c(ce,ne,de)}function v(O,Q){if(Q==="rgb"){const[re,ce,ne]=u(O);return`rgb(${re}, ${ce}, ${ne})`}return O}function g(O){const Q=O.trim();if(/^#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$/.test(Q)){const ce=Q.replace("#","");return(ce.length===3?"#"+ce[0]+ce[0]+ce[1]+ce[1]+ce[2]+ce[2]:Q).toLowerCase()}const re=Q.match(/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i);if(re){const ce=Math.min(255,parseInt(re[1])),ne=Math.min(255,parseInt(re[2])),de=Math.min(255,parseInt(re[3]));return c(ce,ne,de)}return null}const m=e.ref((l.modelValue??l.value??l.defaultValue??dd).toLowerCase());e.watch(()=>l.modelValue??l.value,O=>{O!==void 0&&(m.value=O.toLowerCase())});const h=e.computed(()=>(l.modelValue??l.value??m.value).toLowerCase()),p=e.ref(!1),b=e.computed(()=>l.open??p.value),y=e.ref(null),E=e.ref(null),z=e.ref(null),x=e.ref(v(h.value,l.format)),f=e.ref((()=>{const[O,Q,re]=u(h.value);return i(O,Q,re)})());e.watch(h,O=>{x.value=v(O,l.format);const[Q,re,ce]=u(O);f.value=i(Q,re,ce)}),e.watch(()=>l.format,O=>{x.value=v(h.value,O)});let N;function B(O){p.value=O,a("openChange",O)}function w(O){m.value=O,x.value=v(O,l.format);const Q=v(O,l.format);a("update:modelValue",Q),a("change",Q)}function S(){l.disabled||l.trigger!=="click"||B(!b.value)}function L(){l.disabled||l.trigger!=="hover"||(N&&clearTimeout(N),B(!0))}function T(){l.trigger==="hover"&&(N=setTimeout(()=>B(!1),200))}function P(O){const Q=O.target.value;x.value=Q;const re=g(Q);if(re){const[ce,ne,de]=u(re);f.value=i(ce,ne,de),w(re)}}function q(O){const Q=g(O);if(!Q)return;const[re,ce,ne]=u(Q);f.value=i(re,ce,ne),w(Q)}let _=null;function R(O){if(!E.value)return;const Q=E.value.getBoundingClientRect(),re=Math.max(0,Math.min(1,(O.clientX-Q.left)/Q.width)),ce=Math.max(0,Math.min(1,1-(O.clientY-Q.top)/Q.height)),ne={...f.value,s:re,v:ce};f.value=ne,w(d(ne.h,ne.s,ne.v))}function U(O){if(!z.value)return;const Q=z.value.getBoundingClientRect(),re=Math.max(0,Math.min(1,(O.clientX-Q.left)/Q.width)),ce={...f.value,h:re};f.value=ce,w(d(ce.h,ce.s,ce.v))}function I(O){var Q,re;O.preventDefault(),_="sat",(re=(Q=O.target).setPointerCapture)==null||re.call(Q,O.pointerId),R(O)}function X(O){_==="sat"&&R(O)}function ae(O){var Q,re;O.preventDefault(),_="hue",(re=(Q=O.target).setPointerCapture)==null||re.call(Q,O.pointerId),U(O)}function A(O){_==="hue"&&U(O)}function V(){_=null}function C(O){b.value&&y.value&&!y.value.contains(O.target)&&B(!1)}function k(O){b.value&&O.key==="Escape"&&B(!1)}e.onMounted(()=>{document.addEventListener("mousedown",C),document.addEventListener("keydown",k)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",C),document.removeEventListener("keydown",k),N&&clearTimeout(N)});const $=e.computed(()=>l.unstyled?"":["sg-colorpicker-wrapper",`sg-colorpicker-${l.size}`,l.disabled?"sg-colorpicker-disabled":""].filter(Boolean).join(" ")),M=e.computed(()=>d(f.value.h,1,1)),H=e.computed(()=>`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, ${M.value})`);return(O,Q)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:y,class:e.normalizeClass($.value),onMouseenter:L,onMouseleave:T},[e.createElementVNode("button",{type:"button",class:"sg-colorpicker-trigger",disabled:t.disabled,"aria-haspopup":"dialog","aria-expanded":b.value,"aria-label":s.value,onClick:S},[e.createElementVNode("span",{class:"sg-colorpicker-swatch",style:e.normalizeStyle({background:h.value})},null,4),t.showText?(e.openBlock(),e.createElementBlock("span",od,e.toDisplayString(v(h.value,t.format)),1)):e.createCommentVNode("",!0)],8,nd),b.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-colorpicker-dropdown",onMouseenter:L,onMouseleave:T},[e.createElementVNode("div",{ref_key:"satPanelRef",ref:E,class:"sg-colorpicker-saturation",style:e.normalizeStyle({background:H.value}),onPointerdown:I,onPointermove:X,onPointerup:V},[e.createElementVNode("div",{class:"sg-colorpicker-cursor",style:e.normalizeStyle({left:`${f.value.s*100}%`,top:`${(1-f.value.v)*100}%`,background:h.value})},null,4)],36),e.createElementVNode("div",{ref_key:"hueBarRef",ref:z,class:"sg-colorpicker-hue",onPointerdown:ae,onPointermove:A,onPointerup:V},[e.createElementVNode("div",{class:"sg-colorpicker-hue-cursor",style:e.normalizeStyle({left:`${f.value.h*100}%`})},null,4)],544),e.createElementVNode("div",sd,[e.createElementVNode("span",{class:"sg-colorpicker-preview",style:e.normalizeStyle({background:h.value})},null,4),e.createElementVNode("input",{class:"sg-colorpicker-input",value:x.value,spellcheck:"false",onInput:P},null,40,rd)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.presets??[],re=>(e.openBlock(),e.createElementBlock("div",{key:re.label,class:"sg-colorpicker-preset-group"},[e.createElementVNode("div",id,e.toDisplayString(re.label),1),e.createElementVNode("div",cd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.colors,ce=>(e.openBlock(),e.createElementBlock("button",{key:ce,type:"button",class:"sg-colorpicker-preset-color",style:e.normalizeStyle({background:ce}),title:ce,onClick:ne=>q(ce)},null,12,ud))),128))])]))),128))],32)):e.createCommentVNode("",!0)],34))}}),pd=["aria-expanded","aria-disabled"],vd=["value","placeholder","readonly"],gd={class:"sg-datepicker-suffix"},fd={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},hd=["aria-label"],yd={class:"sg-dp-dropdown-inner"},kd={key:0,class:"sg-dp-presets"},bd=["onClick"],Bd={class:"sg-dp-content"},Cd={key:0,class:"sg-dp-panel"},wd={class:"sg-dp-panel-header"},Sd=["title","aria-label"],Ed=["title","aria-label"],xd={key:1,class:"sg-dp-panel-title"},$d=["title","aria-label"],Nd=["title","aria-label"],Vd={class:"sg-dp-table"},Dd=["onClick"],zd={class:"sg-dp-cell-inner"},Td={key:1,class:"sg-dp-panel"},Md={class:"sg-dp-panel-header"},Ld=["title","aria-label"],Fd={class:"sg-dp-panel-title"},Ad=["title","aria-label"],Pd={class:"sg-dp-month-grid"},Rd=["onClick"],Id={key:2,class:"sg-dp-panel"},_d={class:"sg-dp-panel-header"},Kd=["title","aria-label"],Hd={class:"sg-dp-panel-title"},Od=["title","aria-label"],jd={class:"sg-dp-year-grid"},Yd=["onClick"],Wd={key:3,class:"sg-dp-time-panel"},Ud=["data-active","onClick"],qd=["data-active","onClick"],Xd=["data-active","onClick"],Gd={class:"sg-dp-footer"},Jd={class:"sg-dp-footer-start"},Zd={class:"sg-dp-footer-end"},Qd=e.defineComponent({__name:"DatePicker",props:{modelValue:{},value:{},defaultValue:{},placeholder:{default:"Select date"},format:{},picker:{default:"date"},showTime:{type:[Boolean,Object],default:!1},showToday:{type:Boolean,default:!0},showNow:{type:Boolean,default:!1},allowClear:{type:Boolean,default:!0},disabledDate:{},presets:{},placement:{default:"bottomLeft"},open:{type:Boolean,default:void 0},inputReadOnly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"middle"},unstyled:{type:Boolean}},emits:["update:modelValue","change","openChange","blur","calendarChange"],setup(t,{emit:n}){const l=t,a=n,o=["January","February","March","April","May","June","July","August","September","October","November","December"],s=["Su","Mo","Tu","We","Th","Fr","Sa"],u=Ee(),c=e.computed(()=>{var Y,ee;return((ee=(Y=u.value.locale)==null?void 0:Y.calendar)==null?void 0:ee.monthNames)??o}),i=e.computed(()=>{var Y,ee;return((ee=(Y=u.value.locale)==null?void 0:Y.calendar)==null?void 0:ee.dayNames)??s}),r=e.computed(()=>{var Y,ee;return((ee=(Y=u.value.locale)==null?void 0:Y.calendar)==null?void 0:ee.today)??"Today"}),d=e.computed(()=>{var Y,ee;return((ee=(Y=u.value.locale)==null?void 0:Y.calendar)==null?void 0:ee.now)??"Now"}),v=e.computed(()=>{var Y,ee;return((ee=(Y=u.value.locale)==null?void 0:Y.modal)==null?void 0:ee.okText)??"OK"}),g=e.computed(()=>{var Y,ee;return((ee=(Y=u.value.locale)==null?void 0:Y.datePicker)==null?void 0:ee.prevYear)??"Previous year"}),m=e.computed(()=>{var Y,ee;return((ee=(Y=u.value.locale)==null?void 0:Y.datePicker)==null?void 0:ee.nextYear)??"Next year"}),h=e.computed(()=>{var Y,ee;return((ee=(Y=u.value.locale)==null?void 0:Y.datePicker)==null?void 0:ee.prevMonth)??"Previous month"}),p=e.computed(()=>{var Y,ee;return((ee=(Y=u.value.locale)==null?void 0:Y.datePicker)==null?void 0:ee.nextMonth)??"Next month"}),b=e.computed(()=>{var Y,ee;return((ee=(Y=u.value.locale)==null?void 0:Y.input)==null?void 0:ee.clear)??"Clear"});function y(Y){return String(Y).padStart(2,"0")}function E(Y,ee){return Y.getFullYear()===ee.getFullYear()&&Y.getMonth()===ee.getMonth()&&Y.getDate()===ee.getDate()}function z(Y){return E(Y,new Date)}function x(Y,ee){return new Date(Y,ee+1,0).getDate()}function f(Y){return new Date(Y.getTime())}function N(Y){if(Y==null||Y==="")return null;if(Y instanceof Date)return isNaN(Y.getTime())?null:Y;if(typeof Y=="string"||typeof Y=="number"){const ee=new Date(Y);return isNaN(ee.getTime())?null:ee}return null}function B(Y,ee){return Y?ee.replace("YYYY",String(Y.getFullYear())).replace("MM",y(Y.getMonth()+1)).replace("DD",y(Y.getDate())).replace("HH",y(Y.getHours())).replace("mm",y(Y.getMinutes())).replace("ss",y(Y.getSeconds())):""}function w(Y,ee){if(!Y)return null;const he=ee.indexOf("YYYY"),F=ee.indexOf("MM"),K=ee.indexOf("DD"),J=ee.indexOf("HH"),pe=ee.indexOf("mm"),Ce=ee.indexOf("ss"),$e=he>=0?parseInt(Y.substring(he,he+4),10):new Date().getFullYear(),Fe=F>=0?parseInt(Y.substring(F,F+2),10)-1:0,He=K>=0?parseInt(Y.substring(K,K+2),10):1,Qe=J>=0?parseInt(Y.substring(J,J+2),10):0,Re=pe>=0?parseInt(Y.substring(pe,pe+2),10):0,Je=Ce>=0?parseInt(Y.substring(Ce,Ce+2),10):0;return isNaN($e)||isNaN(Fe)||isNaN(He)?null:new Date($e,Fe,He,Qe,Re,Je)}const S=e.computed(()=>!!l.showTime),L=e.computed(()=>typeof l.showTime=="object"&&l.showTime!==null?l.showTime:{}),T=e.computed(()=>l.format??(S.value?"YYYY-MM-DD HH:mm:ss":l.picker==="month"?"YYYY-MM":l.picker==="year"?"YYYY":"YYYY-MM-DD")),P=N(l.defaultValue),q=l.modelValue!==void 0?N(l.modelValue):l.value!==void 0?N(l.value):P,_=e.ref(q);e.watch(()=>l.modelValue??l.value,Y=>{if(Y!==void 0){const ee=N(Y);_.value=ee,ee&&(X.value=ee.getFullYear(),ae.value=ee.getMonth(),V.value=ee)}});const R=e.computed(()=>{const Y=l.modelValue!==void 0?l.modelValue:l.value;return Y!==void 0?N(Y):_.value}),U=e.ref(!1),I=e.computed(()=>l.open??U.value),X=e.ref((R.value??new Date).getFullYear()),ae=e.ref((R.value??new Date).getMonth()),A=e.ref(l.picker==="year"?"year":l.picker==="month"?"month":"date"),V=e.ref(R.value??L.value.defaultValue??new Date),C=e.ref(""),k=e.ref(!1),$=e.ref(null),M=e.ref(null);function H(Y){U.value=Y,a("openChange",Y),Y||(k.value=!1,a("blur"))}function O(Y){_.value=Y,a("update:modelValue",Y),a("change",Y,Y?B(Y,T.value):"")}function Q(){l.disabled||l.loading||(H(!0),A.value=l.picker==="year"?"year":l.picker==="month"?"month":"date",R.value&&(X.value=R.value.getFullYear(),ae.value=R.value.getMonth(),V.value=R.value))}function re(Y){if(a("calendarChange",Y),S.value){const ee=f(Y);ee.setHours(V.value.getHours(),V.value.getMinutes(),V.value.getSeconds()),V.value=ee,_.value=ee;return}O(Y),H(!1)}function ce(Y){if(l.picker==="month"){const ee=new Date(X.value,Y,1);O(ee),H(!1);return}ae.value=Y,A.value="date"}function ne(Y){if(l.picker==="year"){const ee=new Date(Y,0,1);O(ee),H(!1);return}X.value=Y,A.value=l.picker==="month"?"month":"date"}function de(Y){if(V.value=Y,R.value){const ee=f(R.value);ee.setHours(Y.getHours(),Y.getMinutes(),Y.getSeconds()),_.value=ee}}function ye(){const Y=R.value??V.value;O(Y),H(!1)}function Me(){const Y=new Date;S.value?(X.value=Y.getFullYear(),ae.value=Y.getMonth(),_.value=Y,V.value=Y):(O(Y),H(!1))}function Ne(){O(new Date),H(!1)}function Ie(Y){Y.stopPropagation(),O(null)}function ze(Y){const ee=Array.isArray(Y.value)?Y.value[0]:Y.value;O(ee),H(!1)}function We(Y){C.value=Y.target.value,k.value=!0}function Ge(Y){if(Y.key==="Enter"&&k.value){const ee=w(C.value,T.value);ee&&!isNaN(ee.getTime())&&(O(ee),H(!1))}Y.key==="Escape"&&H(!1)}function G(Y){I.value&&$.value&&!$.value.contains(Y.target)&&H(!1)}function le(Y){I.value&&Y.key==="Escape"&&H(!1)}e.onMounted(()=>{document.addEventListener("mousedown",G),document.addEventListener("keydown",le)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",G),document.removeEventListener("keydown",le)});const fe=e.computed(()=>{const Y=X.value,ee=ae.value,he=x(Y,ee),F=new Date(Y,ee,1).getDay(),K=x(Y,ee-1),J=[];for(let $e=F-1;$e>=0;$e--)J.push({date:new Date(Y,ee-1,K-$e),day:K-$e,inMonth:!1});for(let $e=1;$e<=he;$e++)J.push({date:new Date(Y,ee,$e),day:$e,inMonth:!0});const pe=42-J.length;for(let $e=1;$e<=pe;$e++)J.push({date:new Date(Y,ee+1,$e),day:$e,inMonth:!1});const Ce=[];for(let $e=0;$e<J.length;$e+=7)Ce.push(J.slice($e,$e+7));return Ce}),be=e.computed(()=>`${c.value[ae.value]} ${X.value}`),Ve=e.computed(()=>k.value?C.value:R.value?B(R.value,T.value):""),De=e.computed(()=>Math.floor(X.value/10)*10),xe=e.computed(()=>{const Y=[];for(let ee=De.value-1;ee<=De.value+10;ee++)Y.push(ee);return Y});function Le(Y){const ee=ae.value+Y;ee<0?(ae.value=11,X.value--):ee>11?(ae.value=0,X.value++):ae.value=ee}function Te(Y){X.value+=Y}function we(Y){var K;const ee=R.value?E(Y.date,R.value):!1,he=z(Y.date),F=((K=l.disabledDate)==null?void 0:K.call(l,Y.date))??!1;return["sg-dp-cell",Y.inMonth?"":"sg-dp-cell-outside",ee?"sg-dp-cell-selected":"",he?"sg-dp-cell-today":"",F?"sg-dp-cell-disabled":""].filter(Boolean).join(" ")}const oe=e.computed(()=>l.unstyled?"":["sg-datepicker",`sg-datepicker-${l.size}`,I.value?"sg-datepicker-open":"",l.disabled||l.loading?"sg-datepicker-disabled":"",l.loading?"sg-datepicker-loading":""].filter(Boolean).join(" ")),ge=e.computed(()=>`sg-dp-dropdown sg-dp-dropdown-${l.placement}`),se=e.computed(()=>L.value.hourStep??1),ke=e.computed(()=>L.value.minuteStep??1),Ke=e.computed(()=>L.value.secondStep??1),je=e.computed(()=>(L.value.format??"HH:mm:ss").includes("ss")),te=e.computed(()=>{const Y=[];for(let ee=0;ee<24;ee+=se.value)Y.push(ee);return Y}),ie=e.computed(()=>{const Y=[];for(let ee=0;ee<60;ee+=ke.value)Y.push(ee);return Y}),me=e.computed(()=>{const Y=[];for(let ee=0;ee<60;ee+=Ke.value)Y.push(ee);return Y});function Se(Y){const ee=f(V.value);ee.setHours(Y),de(ee)}function Be(Y){const ee=f(V.value);ee.setMinutes(Y),de(ee)}function Ae(Y){const ee=f(V.value);ee.setSeconds(Y),de(ee)}const Ue=e.ref(null),et=e.ref(null),Pe=e.ref(null);function nt(Y){var he;if(!Y)return;const ee=Y.querySelector('[data-active="true"]');(he=ee==null?void 0:ee.scrollIntoView)==null||he.call(ee,{block:"nearest"})}return e.watch([I,()=>V.value],async()=>{!I.value||!S.value||(await e.nextTick(),nt(Ue.value),nt(et.value),nt(Pe.value))}),(Y,ee)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:$,class:e.normalizeClass(oe.value)},[e.createElementVNode("div",{class:"sg-datepicker-input",role:"combobox","aria-haspopup":"dialog","aria-expanded":I.value,"aria-disabled":t.disabled,onClick:Q},[t.inputReadOnly?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["sg-datepicker-input-text",Ve.value?"":"sg-datepicker-placeholder"].filter(Boolean).join(" "))},e.toDisplayString(Ve.value||t.placeholder),3)):(e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"inputRef",ref:M,class:"sg-datepicker-input-text",value:Ve.value,placeholder:t.placeholder,readonly:t.disabled,onInput:We,onKeydown:Ge,onFocus:Q},null,40,vd)),e.createElementVNode("span",gd,[t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",fd)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.allowClear&&R.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"sg-datepicker-clear",role:"button","aria-label":b.value,onClick:Ie},"×",8,hd)):e.createCommentVNode("",!0),ee[9]||(ee[9]=e.createElementVNode("svg",{class:"sg-datepicker-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{d:"M11 1V0h1v1h2.5A1.5 1.5 0 0116 2.5v12a1.5 1.5 0 01-1.5 1.5h-13A1.5 1.5 0 010 14.5v-12A1.5 1.5 0 011.5 1H4V0h1v1h6zM1.5 2a.5.5 0 00-.5.5V4h14V2.5a.5.5 0 00-.5-.5h-13zM15 5H1v9.5a.5.5 0 00.5.5h13a.5.5 0 00.5-.5V5z"})],-1))],64))])],8,pd),I.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(ge.value)},[e.createElementVNode("div",yd,[t.presets&&t.presets.length>0?(e.openBlock(),e.createElementBlock("div",kd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.presets,he=>(e.openBlock(),e.createElementBlock("div",{key:he.label,class:"sg-dp-preset-item",onClick:F=>ze(he)},e.toDisplayString(he.label),9,bd))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Bd,[A.value==="date"?(e.openBlock(),e.createElementBlock("div",Cd,[e.createElementVNode("div",wd,[e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:g.value,"aria-label":g.value,onClick:ee[0]||(ee[0]=he=>Te(-1))}," « ",8,Sd),e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:h.value,"aria-label":h.value,onClick:ee[1]||(ee[1]=he=>Le(-1))}," ‹ ",8,Ed),t.picker==="date"?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"sg-dp-panel-title sg-dp-panel-title-btn",onClick:ee[2]||(ee[2]=he=>A.value="month")},e.toDisplayString(be.value),1)):(e.openBlock(),e.createElementBlock("span",xd,e.toDisplayString(be.value),1)),e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:p.value,"aria-label":p.value,onClick:ee[3]||(ee[3]=he=>Le(1))}," › ",8,$d),e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:m.value,"aria-label":m.value,onClick:ee[4]||(ee[4]=he=>Te(1))}," » ",8,Nd)]),e.createElementVNode("table",Vd,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,he=>(e.openBlock(),e.createElementBlock("th",{key:he,class:"sg-dp-th"},e.toDisplayString(he),1))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(he,F)=>(e.openBlock(),e.createElementBlock("tr",{key:F},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he,K=>(e.openBlock(),e.createElementBlock("td",{key:K.date.toISOString(),class:e.normalizeClass(we(K)),onClick:J=>{var pe;return!((pe=l.disabledDate)!=null&&pe.call(l,K.date))&&re(K.date)}},[e.createElementVNode("span",zd,e.toDisplayString(K.day),1)],10,Dd))),128))]))),128))])])])):e.createCommentVNode("",!0),A.value==="month"?(e.openBlock(),e.createElementBlock("div",Td,[e.createElementVNode("div",Md,[e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:g.value,"aria-label":g.value,onClick:ee[5]||(ee[5]=he=>Te(-1))}," « ",8,Ld),e.createElementVNode("span",Fd,e.toDisplayString(X.value),1),e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:m.value,"aria-label":m.value,onClick:ee[6]||(ee[6]=he=>Te(1))}," » ",8,Ad)]),e.createElementVNode("div",Pd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(he,F)=>(e.openBlock(),e.createElementBlock("div",{key:F,class:e.normalizeClass(["sg-dp-month-cell",R.value&&R.value.getFullYear()===X.value&&R.value.getMonth()===F?"sg-dp-month-cell-selected":"",new Date().getFullYear()===X.value&&new Date().getMonth()===F?"sg-dp-month-cell-current":""].filter(Boolean).join(" ")),onClick:K=>ce(F)},e.toDisplayString(he.substring(0,3)),11,Rd))),128))])])):e.createCommentVNode("",!0),A.value==="year"?(e.openBlock(),e.createElementBlock("div",Id,[e.createElementVNode("div",_d,[e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:g.value,"aria-label":g.value,onClick:ee[7]||(ee[7]=he=>Te(-10))}," « ",8,Kd),e.createElementVNode("span",Hd,e.toDisplayString(De.value)+" - "+e.toDisplayString(De.value+9),1),e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:m.value,"aria-label":m.value,onClick:ee[8]||(ee[8]=he=>Te(10))}," » ",8,Od)]),e.createElementVNode("div",jd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.value,he=>(e.openBlock(),e.createElementBlock("div",{key:he,class:e.normalizeClass(["sg-dp-year-cell",R.value&&R.value.getFullYear()===he?"sg-dp-year-cell-selected":"",new Date().getFullYear()===he?"sg-dp-year-cell-current":"",he<De.value||he>De.value+9?"sg-dp-year-cell-outside":""].filter(Boolean).join(" ")),onClick:F=>ne(he)},e.toDisplayString(he),11,Yd))),128))])])):e.createCommentVNode("",!0),S.value&&A.value==="date"?(e.openBlock(),e.createElementBlock("div",Wd,[e.createElementVNode("div",{ref_key:"hourColRef",ref:Ue,class:"sg-dp-time-col"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,he=>(e.openBlock(),e.createElementBlock("div",{key:he,"data-active":he===V.value.getHours(),class:e.normalizeClass(["sg-dp-time-cell",he===V.value.getHours()?"sg-dp-time-cell-active":""]),onClick:F=>Se(he)},e.toDisplayString(y(he)),11,Ud))),128))],512),e.createElementVNode("div",{ref_key:"minuteColRef",ref:et,class:"sg-dp-time-col"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ie.value,he=>(e.openBlock(),e.createElementBlock("div",{key:he,"data-active":he===V.value.getMinutes(),class:e.normalizeClass(["sg-dp-time-cell",he===V.value.getMinutes()?"sg-dp-time-cell-active":""]),onClick:F=>Be(he)},e.toDisplayString(y(he)),11,qd))),128))],512),je.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"secondColRef",ref:Pe,class:"sg-dp-time-col"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(me.value,he=>(e.openBlock(),e.createElementBlock("div",{key:he,"data-active":he===V.value.getSeconds(),class:e.normalizeClass(["sg-dp-time-cell",he===V.value.getSeconds()?"sg-dp-time-cell-active":""]),onClick:F=>Ae(he)},e.toDisplayString(y(he)),11,Xd))),128))],512)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",Gd,[e.createElementVNode("div",Jd,[t.showToday&&!S.value&&A.value==="date"?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"sg-dp-footer-btn sg-dp-today-btn",onClick:Me},e.toDisplayString(r.value),1)):e.createCommentVNode("",!0),t.showNow&&S.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"sg-dp-footer-btn sg-dp-now-btn",onClick:Ne},e.toDisplayString(d.value),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Zd,[S.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"sg-dp-footer-btn sg-dp-ok-btn",onClick:ye},e.toDisplayString(v.value),1)):e.createCommentVNode("",!0)])])])])],2)):e.createCommentVNode("",!0)],2))}}),em=["aria-expanded","aria-disabled"],tm={class:"sg-datepicker-separator"},lm={class:"sg-datepicker-suffix"},am={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},nm=["aria-label"],om={class:"sg-dp-dropdown-inner"},sm={key:0,class:"sg-dp-presets"},rm=["onClick"],im={class:"sg-dp-content"},cm={class:"sg-dp-range-panels"},um={class:"sg-dp-panel"},dm={class:"sg-dp-panel-header"},mm=["title","aria-label"],pm=["title","aria-label"],vm={class:"sg-dp-panel-title"},gm={class:"sg-dp-table"},fm=["onClick","onMouseenter"],hm={class:"sg-dp-cell-inner"},ym={class:"sg-dp-panel"},km={class:"sg-dp-panel-header"},bm={class:"sg-dp-panel-title"},Bm=["title","aria-label"],Cm=["title","aria-label"],wm={class:"sg-dp-table"},Sm=["onClick","onMouseenter"],Em={class:"sg-dp-cell-inner"},xm={key:0,class:"sg-dp-range-time"},$m={class:"sg-dp-time-panel"},Nm={class:"sg-dp-time-col"},Vm=["data-active","onClick"],Dm={class:"sg-dp-time-col"},zm=["data-active","onClick"],Tm={key:0,class:"sg-dp-time-col"},Mm=["data-active","onClick"],Lm={class:"sg-dp-time-panel"},Fm={class:"sg-dp-time-col"},Am=["data-active","onClick"],Pm={class:"sg-dp-time-col"},Rm=["data-active","onClick"],Im={key:0,class:"sg-dp-time-col"},_m=["data-active","onClick"],Km={class:"sg-dp-footer"},Hm={class:"sg-dp-footer-end"},Om=e.defineComponent({__name:"RangePicker",props:{modelValue:{},value:{},defaultValue:{},placeholder:{default:()=>["Start date","End date"]},format:{},showTime:{type:[Boolean,Object],default:!1},allowClear:{type:Boolean,default:!0},disabledDate:{},presets:{},separator:{default:"→"},placement:{default:"bottomLeft"},open:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"middle"},unstyled:{type:Boolean}},emits:["update:modelValue","change","openChange"],setup(t,{emit:n}){const l=t,a=n,o=["January","February","March","April","May","June","July","August","September","October","November","December"],s=["Su","Mo","Tu","We","Th","Fr","Sa"],u=Ee(),c=e.computed(()=>{var te,ie;return((ie=(te=u.value.locale)==null?void 0:te.calendar)==null?void 0:ie.monthNames)??o}),i=e.computed(()=>{var te,ie;return((ie=(te=u.value.locale)==null?void 0:te.calendar)==null?void 0:ie.dayNames)??s}),r=e.computed(()=>{var te,ie;return((ie=(te=u.value.locale)==null?void 0:te.modal)==null?void 0:ie.okText)??"OK"}),d=e.computed(()=>{var te,ie;return((ie=(te=u.value.locale)==null?void 0:te.datePicker)==null?void 0:ie.prevYear)??"Previous year"}),v=e.computed(()=>{var te,ie;return((ie=(te=u.value.locale)==null?void 0:te.datePicker)==null?void 0:ie.nextYear)??"Next year"}),g=e.computed(()=>{var te,ie;return((ie=(te=u.value.locale)==null?void 0:te.datePicker)==null?void 0:ie.prevMonth)??"Previous month"}),m=e.computed(()=>{var te,ie;return((ie=(te=u.value.locale)==null?void 0:te.datePicker)==null?void 0:ie.nextMonth)??"Next month"}),h=e.computed(()=>{var te,ie;return((ie=(te=u.value.locale)==null?void 0:te.input)==null?void 0:ie.clear)??"Clear"});function p(te){return String(te).padStart(2,"0")}function b(te,ie){return te.getFullYear()===ie.getFullYear()&&te.getMonth()===ie.getMonth()&&te.getDate()===ie.getDate()}function y(te){return b(te,new Date)}function E(te,ie){return new Date(te,ie+1,0).getDate()}function z(te){return new Date(te.getFullYear(),te.getMonth(),te.getDate())}function x(te){return new Date(te.getTime())}function f(te){if(te==null||te==="")return null;if(te instanceof Date)return isNaN(te.getTime())?null:te;if(typeof te=="string"||typeof te=="number"){const ie=new Date(te);return isNaN(ie.getTime())?null:ie}return null}function N(te,ie){return te?ie.replace("YYYY",String(te.getFullYear())).replace("MM",p(te.getMonth()+1)).replace("DD",p(te.getDate())).replace("HH",p(te.getHours())).replace("mm",p(te.getMinutes())).replace("ss",p(te.getSeconds())):""}function B(te){return[f(te==null?void 0:te[0]),f(te==null?void 0:te[1])]}const w=e.computed(()=>!!l.showTime),S=e.computed(()=>typeof l.showTime=="object"&&l.showTime!==null?l.showTime:{}),L=e.computed(()=>l.format??(w.value?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD")),T=e.computed(()=>{const te=l.modelValue!==void 0?l.modelValue:l.value;return te?B(te):void 0}),P=e.ref(T.value??(l.defaultValue?B(l.defaultValue):[null,null]));e.watch(T,te=>{te&&(P.value=te)});const q=e.computed(()=>T.value??P.value),_=e.ref(!1),R=e.computed(()=>l.open??_.value),U=e.ref(0),I=e.ref(null),X=e.computed(()=>q.value[0]??new Date),ae=e.ref(X.value.getFullYear()),A=e.ref(X.value.getMonth()),V=e.computed(()=>A.value===11?ae.value+1:ae.value),C=e.computed(()=>A.value===11?0:A.value+1),k=e.ref([q.value[0]??new Date,q.value[1]??new Date]),$=e.ref(null);function M(te){_.value=te,a("openChange",te)}function H(te){P.value=te,a("update:modelValue",te),a("change",te,[te[0]?N(te[0],L.value):"",te[1]?N(te[1],L.value):""])}function O(){l.disabled||l.loading||M(!0)}function Q(te){if(U.value===0){P.value=[te,null],U.value=1;return}let ie=q.value[0],me=te;if(ie&&me.getTime()<ie.getTime()&&([ie,me]=[me,ie]),w.value){const Se=x(ie||te);Se.setHours(k.value[0].getHours(),k.value[0].getMinutes(),k.value[0].getSeconds());const Be=x(me);Be.setHours(k.value[1].getHours(),k.value[1].getMinutes(),k.value[1].getSeconds()),P.value=[Se,Be]}else H([ie,me]),M(!1),U.value=0}function re(){H(q.value),M(!1),U.value=0}function ce(te){te.stopPropagation(),H([null,null]),U.value=0}function ne(te){Array.isArray(te.value)?H([te.value[0],te.value[1]]):H([te.value,te.value]),M(!1)}function de(te){const ie=A.value+te;ie<0?(A.value=11,ae.value--):ie>11?(A.value=0,ae.value++):A.value=ie}function ye(te,ie){const me=E(te,ie),Se=new Date(te,ie,1).getDay(),Be=E(te,ie-1),Ae=[];for(let Pe=Se-1;Pe>=0;Pe--)Ae.push({date:new Date(te,ie-1,Be-Pe),day:Be-Pe,inMonth:!1});for(let Pe=1;Pe<=me;Pe++)Ae.push({date:new Date(te,ie,Pe),day:Pe,inMonth:!0});const Ue=42-Ae.length;for(let Pe=1;Pe<=Ue;Pe++)Ae.push({date:new Date(te,ie+1,Pe),day:Pe,inMonth:!1});const et=[];for(let Pe=0;Pe<Ae.length;Pe+=7)et.push(Ae.slice(Pe,Pe+7));return et}const Me=e.computed(()=>ye(ae.value,A.value)),Ne=e.computed(()=>ye(V.value,C.value));function Ie(te){const ie=q.value[0];if(!ie)return!1;const me=q.value[1]??I.value;if(!me)return!1;const Se=z(ie).getTime(),Be=z(me).getTime(),Ae=z(te).getTime();return Ae>Math.min(Se,Be)&&Ae<Math.max(Se,Be)}function ze(te){const ie=q.value[0];if(!ie)return null;if(b(te,ie))return"start";const me=q.value[1]??I.value;return me&&b(te,me)?"end":null}function We(te){var Ae;const ie=((Ae=l.disabledDate)==null?void 0:Ae.call(l,te.date))??!1,me=y(te.date),Se=Ie(te.date),Be=ze(te.date);return["sg-dp-cell",te.inMonth?"":"sg-dp-cell-outside",me?"sg-dp-cell-today":"",ie?"sg-dp-cell-disabled":"",Se?"sg-dp-cell-in-range":"",Be==="start"?"sg-dp-cell-range-start":"",Be==="end"?"sg-dp-cell-range-end":""].filter(Boolean).join(" ")}const Ge=e.computed(()=>q.value[0]?N(q.value[0],L.value):l.placeholder[0]),G=e.computed(()=>q.value[1]?N(q.value[1],L.value):l.placeholder[1]),le=e.computed(()=>l.unstyled?"":["sg-datepicker","sg-datepicker-range",`sg-datepicker-${l.size}`,R.value?"sg-datepicker-open":"",l.disabled||l.loading?"sg-datepicker-disabled":"",l.loading?"sg-datepicker-loading":""].filter(Boolean).join(" ")),fe=e.computed(()=>`sg-dp-dropdown sg-dp-dropdown-range sg-dp-dropdown-${l.placement}`);function be(te){R.value&&$.value&&!$.value.contains(te.target)&&M(!1)}function Ve(te){R.value&&te.key==="Escape"&&M(!1)}e.onMounted(()=>{document.addEventListener("mousedown",be),document.addEventListener("keydown",Ve)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",be),document.removeEventListener("keydown",Ve)});const De=e.computed(()=>S.value.hourStep??1),xe=e.computed(()=>S.value.minuteStep??1),Le=e.computed(()=>S.value.secondStep??1),Te=e.computed(()=>(S.value.format??"HH:mm:ss").includes("ss"));function we(te,ie){const me=[];for(let Se=0;Se<ie;Se+=te)me.push(Se);return me}const oe=e.computed(()=>we(De.value,24)),ge=e.computed(()=>we(xe.value,60)),se=e.computed(()=>we(Le.value,60));function ke(te,ie){const me=[x(k.value[0]),x(k.value[1])];if(ie(me[te]),k.value=me,q.value[0]&&q.value[1]){const Se=[x(q.value[0]),x(q.value[1])];Se[te].setHours(me[te].getHours(),me[te].getMinutes(),me[te].getSeconds()),P.value=Se}}const Ke=e.computed(()=>`${c.value[A.value]} ${ae.value}`),je=e.computed(()=>`${c.value[C.value]} ${V.value}`);return(te,ie)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:$,class:e.normalizeClass(le.value)},[e.createElementVNode("div",{class:"sg-datepicker-input sg-datepicker-range-input",role:"combobox","aria-haspopup":"dialog","aria-expanded":R.value,"aria-disabled":t.disabled,onClick:O},[e.createElementVNode("span",{class:e.normalizeClass(["sg-datepicker-range-part",U.value===0?"sg-datepicker-range-active":"",q.value[0]?"":"sg-datepicker-placeholder"].filter(Boolean).join(" ")),onClick:ie[0]||(ie[0]=e.withModifiers(()=>{U.value=0,O()},["stop"]))},e.toDisplayString(Ge.value),3),e.createElementVNode("span",tm,e.toDisplayString(t.separator),1),e.createElementVNode("span",{class:e.normalizeClass(["sg-datepicker-range-part",U.value===1?"sg-datepicker-range-active":"",q.value[1]?"":"sg-datepicker-placeholder"].filter(Boolean).join(" ")),onClick:ie[1]||(ie[1]=e.withModifiers(()=>{U.value=1,O()},["stop"]))},e.toDisplayString(G.value),3),e.createElementVNode("span",lm,[t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",am)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.allowClear&&(q.value[0]||q.value[1])?(e.openBlock(),e.createElementBlock("span",{key:0,class:"sg-datepicker-clear",role:"button","aria-label":h.value,onClick:ce},"×",8,nm)):e.createCommentVNode("",!0),ie[8]||(ie[8]=e.createElementVNode("svg",{class:"sg-datepicker-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{d:"M11 1V0h1v1h2.5A1.5 1.5 0 0116 2.5v12a1.5 1.5 0 01-1.5 1.5h-13A1.5 1.5 0 010 14.5v-12A1.5 1.5 0 011.5 1H4V0h1v1h6zM1.5 2a.5.5 0 00-.5.5V4h14V2.5a.5.5 0 00-.5-.5h-13zM15 5H1v9.5a.5.5 0 00.5.5h13a.5.5 0 00.5-.5V5z"})],-1))],64))])],8,em),R.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(fe.value)},[e.createElementVNode("div",om,[t.presets&&t.presets.length>0?(e.openBlock(),e.createElementBlock("div",sm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.presets,me=>(e.openBlock(),e.createElementBlock("div",{key:me.label,class:"sg-dp-preset-item",onClick:Se=>ne(me)},e.toDisplayString(me.label),9,rm))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",im,[e.createElementVNode("div",cm,[e.createElementVNode("div",um,[e.createElementVNode("div",dm,[e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:d.value,"aria-label":d.value,onClick:ie[2]||(ie[2]=me=>ae.value--)}," « ",8,mm),e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:g.value,"aria-label":g.value,onClick:ie[3]||(ie[3]=me=>de(-1))}," ‹ ",8,pm),e.createElementVNode("span",vm,e.toDisplayString(Ke.value),1),ie[9]||(ie[9]=e.createElementVNode("span",{style:{flex:"1"}},null,-1))]),e.createElementVNode("table",gm,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,me=>(e.openBlock(),e.createElementBlock("th",{key:me,class:"sg-dp-th"},e.toDisplayString(me),1))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Me.value,(me,Se)=>(e.openBlock(),e.createElementBlock("tr",{key:Se},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(me,Be=>(e.openBlock(),e.createElementBlock("td",{key:Be.date.toISOString(),class:e.normalizeClass(We(Be)),onClick:Ae=>{var Ue;return!((Ue=l.disabledDate)!=null&&Ue.call(l,Be.date))&&Q(Be.date)},onMouseenter:Ae=>I.value=Be.date,onMouseleave:ie[4]||(ie[4]=Ae=>I.value=null)},[e.createElementVNode("span",hm,e.toDisplayString(Be.day),1)],42,fm))),128))]))),128))])])]),e.createElementVNode("div",ym,[e.createElementVNode("div",km,[ie[10]||(ie[10]=e.createElementVNode("span",{style:{flex:"1"}},null,-1)),e.createElementVNode("span",bm,e.toDisplayString(je.value),1),e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:m.value,"aria-label":m.value,onClick:ie[5]||(ie[5]=me=>de(1))}," › ",8,Bm),e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:v.value,"aria-label":v.value,onClick:ie[6]||(ie[6]=me=>ae.value++)}," » ",8,Cm)]),e.createElementVNode("table",wm,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,me=>(e.openBlock(),e.createElementBlock("th",{key:me+"-r",class:"sg-dp-th"},e.toDisplayString(me),1))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ne.value,(me,Se)=>(e.openBlock(),e.createElementBlock("tr",{key:Se},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(me,Be=>(e.openBlock(),e.createElementBlock("td",{key:Be.date.toISOString(),class:e.normalizeClass(We(Be)),onClick:Ae=>{var Ue;return!((Ue=l.disabledDate)!=null&&Ue.call(l,Be.date))&&Q(Be.date)},onMouseenter:Ae=>I.value=Be.date,onMouseleave:ie[7]||(ie[7]=Ae=>I.value=null)},[e.createElementVNode("span",Em,e.toDisplayString(Be.day),1)],42,Sm))),128))]))),128))])])])]),w.value&&q.value[0]&&q.value[1]?(e.openBlock(),e.createElementBlock("div",xm,[e.createElementVNode("div",$m,[e.createElementVNode("div",Nm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,me=>(e.openBlock(),e.createElementBlock("div",{key:me+"-h0","data-active":me===k.value[0].getHours(),class:e.normalizeClass(["sg-dp-time-cell",me===k.value[0].getHours()?"sg-dp-time-cell-active":""]),onClick:Se=>ke(0,Be=>Be.setHours(me))},e.toDisplayString(p(me)),11,Vm))),128))]),e.createElementVNode("div",Dm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,me=>(e.openBlock(),e.createElementBlock("div",{key:me+"-m0","data-active":me===k.value[0].getMinutes(),class:e.normalizeClass(["sg-dp-time-cell",me===k.value[0].getMinutes()?"sg-dp-time-cell-active":""]),onClick:Se=>ke(0,Be=>Be.setMinutes(me))},e.toDisplayString(p(me)),11,zm))),128))]),Te.value?(e.openBlock(),e.createElementBlock("div",Tm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(se.value,me=>(e.openBlock(),e.createElementBlock("div",{key:me+"-s0","data-active":me===k.value[0].getSeconds(),class:e.normalizeClass(["sg-dp-time-cell",me===k.value[0].getSeconds()?"sg-dp-time-cell-active":""]),onClick:Se=>ke(0,Be=>Be.setSeconds(me))},e.toDisplayString(p(me)),11,Mm))),128))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Lm,[e.createElementVNode("div",Fm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,me=>(e.openBlock(),e.createElementBlock("div",{key:me+"-h1","data-active":me===k.value[1].getHours(),class:e.normalizeClass(["sg-dp-time-cell",me===k.value[1].getHours()?"sg-dp-time-cell-active":""]),onClick:Se=>ke(1,Be=>Be.setHours(me))},e.toDisplayString(p(me)),11,Am))),128))]),e.createElementVNode("div",Pm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,me=>(e.openBlock(),e.createElementBlock("div",{key:me+"-m1","data-active":me===k.value[1].getMinutes(),class:e.normalizeClass(["sg-dp-time-cell",me===k.value[1].getMinutes()?"sg-dp-time-cell-active":""]),onClick:Se=>ke(1,Be=>Be.setMinutes(me))},e.toDisplayString(p(me)),11,Rm))),128))]),Te.value?(e.openBlock(),e.createElementBlock("div",Im,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(se.value,me=>(e.openBlock(),e.createElementBlock("div",{key:me+"-s1","data-active":me===k.value[1].getSeconds(),class:e.normalizeClass(["sg-dp-time-cell",me===k.value[1].getSeconds()?"sg-dp-time-cell-active":""]),onClick:Se=>ke(1,Be=>Be.setSeconds(me))},e.toDisplayString(p(me)),11,_m))),128))])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",Km,[e.createElementVNode("div",Hm,[w.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"sg-dp-footer-btn sg-dp-ok-btn",onClick:re},e.toDisplayString(r.value),1)):e.createCommentVNode("",!0)])])])])],2)):e.createCommentVNode("",!0)],2))}}),jm=["aria-expanded","aria-disabled"],Ym={class:"sg-timepicker-suffix"},Wm={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},Um=["aria-label"],qm={key:0,class:"sg-tp-dropdown"},Xm={class:"sg-tp-columns"},Gm=["data-active","data-disabled","aria-disabled","onClick"],Jm=["data-active","data-disabled","aria-disabled","onClick"],Zm=["data-active","data-disabled","aria-disabled","onClick"],Qm={key:1,class:"sg-tp-col sg-tp-col-ampm"},ep={key:0,class:"sg-tp-footer"},Gt=e.defineComponent({__name:"TimePicker",props:{modelValue:{},value:{},defaultValue:{},placeholder:{default:"Select time"},format:{},use12Hours:{type:Boolean,default:!1},hourStep:{default:1},minuteStep:{default:1},secondStep:{default:1},showSecond:{type:Boolean,default:!0},showNow:{type:Boolean,default:!0},allowClear:{type:Boolean,default:!0},open:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"middle"},unstyled:{type:Boolean},disabledHours:{},disabledMinutes:{},disabledSeconds:{}},emits:["update:modelValue","change","openChange"],setup(t,{emit:n}){var Q,re,ce;const l=t,a=n;function o(ne){return String(ne).padStart(2,"0")}function s(ne,de,ye,Me,Ne){if(Ne){const Ie=ne>=12?"PM":"AM",ze=ne%12||12;return Me.replace("hh",o(ze)).replace("mm",o(de)).replace("ss",o(ye)).replace("A",Ie)}return Me.replace("HH",o(ne)).replace("mm",o(de)).replace("ss",o(ye))}function u(ne){if(!ne)return null;const de=ne.toUpperCase(),ye=de.includes("PM"),Ne=de.replace(/(AM|PM)/g,"").trim().split(":").map(Number);if(Ne.some(isNaN))return null;let Ie=Ne[0]??0;const ze=Ne[1]??0,We=Ne[2]??0;return ye&&Ie<12&&(Ie+=12),!ye&&de.includes("AM")&&Ie===12&&(Ie=0),{h:Ie,m:ze,s:We}}const c=Ee(),i=e.computed(()=>{var ne,de;return((de=(ne=c.value.locale)==null?void 0:ne.input)==null?void 0:de.clear)??"Clear"}),r=e.computed(()=>{var ne,de;return((de=(ne=c.value.locale)==null?void 0:ne.calendar)==null?void 0:de.now)??"Now"}),d=e.computed(()=>l.format??(l.use12Hours?"hh:mm:ss A":l.showSecond?"HH:mm:ss":"HH:mm")),v=e.ref(l.modelValue??l.value??l.defaultValue??"");e.watch(()=>l.modelValue??l.value,ne=>{ne!==void 0&&(v.value=ne)});const g=e.computed(()=>l.modelValue??l.value??v.value),m=e.ref(!1),h=e.computed(()=>l.open??m.value),p=e.computed(()=>u(g.value)),b=e.ref(((Q=p.value)==null?void 0:Q.h)??0),y=e.ref(((re=p.value)==null?void 0:re.m)??0),E=e.ref(((ce=p.value)==null?void 0:ce.s)??0);e.watch(g,ne=>{const de=u(ne);de&&(b.value=de.h,y.value=de.m,E.value=de.s)});const z=e.ref(null),x=e.ref(null),f=e.ref(null),N=e.ref(null),B=e.computed(()=>{const ne=[];if(l.use12Hours)for(let de=1;de<=12;de+=l.hourStep)ne.push(de);else for(let de=0;de<24;de+=l.hourStep)ne.push(de);return ne}),w=e.computed(()=>{const ne=[];for(let de=0;de<60;de+=l.minuteStep)ne.push(de);return ne}),S=e.computed(()=>{const ne=[];for(let de=0;de<60;de+=l.secondStep)ne.push(de);return ne}),L=e.computed(()=>{var ne;return new Set(((ne=l.disabledHours)==null?void 0:ne.call(l))??[])}),T=e.computed(()=>{var ne;return new Set(((ne=l.disabledMinutes)==null?void 0:ne.call(l,b.value))??[])}),P=e.computed(()=>{var ne;return new Set(((ne=l.disabledSeconds)==null?void 0:ne.call(l,b.value,y.value))??[])}),q=e.computed(()=>l.use12Hours?b.value%12||12:b.value);function _(ne){m.value=ne,a("openChange",ne)}function R(ne,de,ye){const Me=s(ne,de,ye,d.value,l.use12Hours);v.value=Me,a("update:modelValue",Me),a("change",Me)}function U(ne){if(L.value.has((l.use12Hours,ne)))return;const de=l.use12Hours?ne===12?b.value>=12?12:0:b.value>=12?ne+12:ne:ne;b.value=de,R(de,y.value,E.value)}function I(ne){T.value.has(ne)||(y.value=ne,R(b.value,ne,E.value))}function X(ne){P.value.has(ne)||(E.value=ne,R(b.value,y.value,ne))}function ae(){const ne=new Date;b.value=ne.getHours(),y.value=ne.getMinutes(),E.value=ne.getSeconds(),R(b.value,y.value,E.value),_(!1)}function A(ne){ne.stopPropagation(),v.value="",a("update:modelValue",""),a("change","")}function V(){l.disabled||l.loading||_(!0)}function C(ne){h.value&&z.value&&!z.value.contains(ne.target)&&_(!1)}function k(ne){h.value&&ne.key==="Escape"&&_(!1)}e.onMounted(()=>{document.addEventListener("mousedown",C),document.addEventListener("keydown",k)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",C),document.removeEventListener("keydown",k)});function $(ne){var ye;if(!ne)return;const de=ne.querySelector('[data-active="true"]');(ye=de==null?void 0:de.scrollIntoView)==null||ye.call(de,{block:"nearest"})}e.watch([h,b,y,E],async()=>{h.value&&(await e.nextTick(),$(x.value),$(f.value),$(N.value))});const M=e.computed(()=>l.unstyled?"":["sg-timepicker",`sg-timepicker-${l.size}`,h.value?"sg-timepicker-open":"",l.disabled||l.loading?"sg-timepicker-disabled":"",l.loading?"sg-timepicker-loading":""].filter(Boolean).join(" "));function H(){if(b.value>=12){const ne=b.value-12;b.value=ne,R(ne,y.value,E.value)}}function O(){if(b.value<12){const ne=b.value+12;b.value=ne,R(ne,y.value,E.value)}}return(ne,de)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:z,class:e.normalizeClass(M.value)},[e.createElementVNode("div",{class:"sg-timepicker-input",role:"combobox","aria-haspopup":"dialog","aria-expanded":h.value,"aria-disabled":t.disabled,onClick:V},[e.createElementVNode("span",{class:e.normalizeClass(g.value?"":"sg-timepicker-placeholder")},e.toDisplayString(g.value||t.placeholder),3),e.createElementVNode("span",Ym,[t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",Wm)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.allowClear&&g.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"sg-timepicker-clear",role:"button","aria-label":i.value,onClick:A},"×",8,Um)):e.createCommentVNode("",!0),de[0]||(de[0]=e.createElementVNode("svg",{class:"sg-timepicker-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{d:"M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm0 14.5A6.5 6.5 0 1 1 8 1.5a6.5 6.5 0 0 1 0 13zM8.5 4H7v5l4.25 2.5.75-1.23L8.5 8.25V4z"})],-1))],64))])],8,jm),h.value?(e.openBlock(),e.createElementBlock("div",qm,[e.createElementVNode("div",Xm,[e.createElementVNode("div",{ref_key:"hourColRef",ref:x,class:"sg-tp-col"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,ye=>(e.openBlock(),e.createElementBlock("div",{key:ye,"data-active":ye===q.value,"data-disabled":L.value.has(ye),class:e.normalizeClass(["sg-tp-cell",ye===q.value?"sg-tp-cell-active":"",L.value.has(ye)?"sg-tp-cell-disabled":""]),"aria-disabled":L.value.has(ye),onClick:Me=>U(ye)},e.toDisplayString(o(ye)),11,Gm))),128))],512),e.createElementVNode("div",{ref_key:"minuteColRef",ref:f,class:"sg-tp-col"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,ye=>(e.openBlock(),e.createElementBlock("div",{key:ye,"data-active":ye===y.value,"data-disabled":T.value.has(ye),class:e.normalizeClass(["sg-tp-cell",ye===y.value?"sg-tp-cell-active":"",T.value.has(ye)?"sg-tp-cell-disabled":""]),"aria-disabled":T.value.has(ye),onClick:Me=>I(ye)},e.toDisplayString(o(ye)),11,Jm))),128))],512),t.showSecond?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"secondColRef",ref:N,class:"sg-tp-col"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,ye=>(e.openBlock(),e.createElementBlock("div",{key:ye,"data-active":ye===E.value,"data-disabled":P.value.has(ye),class:e.normalizeClass(["sg-tp-cell",ye===E.value?"sg-tp-cell-active":"",P.value.has(ye)?"sg-tp-cell-disabled":""]),"aria-disabled":P.value.has(ye),onClick:Me=>X(ye)},e.toDisplayString(o(ye)),11,Zm))),128))],512)):e.createCommentVNode("",!0),t.use12Hours?(e.openBlock(),e.createElementBlock("div",Qm,[e.createElementVNode("div",{class:e.normalizeClass(["sg-tp-cell",b.value<12?"sg-tp-cell-active":""]),onClick:H},"AM",2),e.createElementVNode("div",{class:e.normalizeClass(["sg-tp-cell",b.value>=12?"sg-tp-cell-active":""]),onClick:O}," PM ",2)])):e.createCommentVNode("",!0)]),t.showNow?(e.openBlock(),e.createElementBlock("div",ep,[e.createElementVNode("button",{type:"button",class:"sg-tp-now-btn",onClick:ae},e.toDisplayString(r.value),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),tp=["aria-expanded","aria-disabled"],lp=["aria-label"],ap=e.defineComponent({__name:"TimeRangePicker",props:{modelValue:{},value:{},defaultValue:{},placeholder:{default:()=>["Start","End"]},format:{},use12Hours:{type:Boolean,default:!1},hourStep:{default:1},minuteStep:{default:1},secondStep:{default:1},showSecond:{type:Boolean,default:!0},allowClear:{type:Boolean,default:!0},separator:{default:"→"},open:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"middle"},unstyled:{type:Boolean}},emits:["update:modelValue","change","openChange"],setup(t,{emit:n}){const l=t,a=Ee(),o=e.computed(()=>{var f,N;return((N=(f=a.value.locale)==null?void 0:f.input)==null?void 0:N.clear)??"Clear"}),s=n,u=e.computed(()=>l.format??(l.use12Hours?"hh:mm:ss A":l.showSecond?"HH:mm:ss":"HH:mm")),c=e.ref(l.modelValue??l.value??l.defaultValue??["",""]);e.watch(()=>l.modelValue??l.value,f=>{f!==void 0&&(c.value=[...f])});const i=e.computed(()=>l.modelValue??l.value??c.value),r=e.ref(!1),d=e.computed(()=>l.open??r.value),v=e.ref(null);function g(f){r.value=f,s("openChange",f)}function m(f){c.value=f,s("update:modelValue",f),s("change",f)}function h(f){m([f,i.value[1]])}function p(f){m([i.value[0],f])}function b(f){f.stopPropagation(),m(["",""])}function y(){l.disabled||l.loading||g(!0)}function E(f){d.value&&v.value&&!v.value.contains(f.target)&&g(!1)}function z(f){d.value&&f.key==="Escape"&&g(!1)}e.onMounted(()=>{document.addEventListener("mousedown",E),document.addEventListener("keydown",z)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",E),document.removeEventListener("keydown",z)});const x=e.computed(()=>l.unstyled?"":["sg-timepicker","sg-timepicker-range",`sg-timepicker-${l.size}`,d.value?"sg-timepicker-open":"",l.disabled||l.loading?"sg-timepicker-disabled":"",l.loading?"sg-timepicker-loading":""].filter(Boolean).join(" "));return(f,N)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:v,class:e.normalizeClass(x.value)},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-timepicker-input sg-timepicker-range-input"),role:"combobox","aria-haspopup":"dialog","aria-expanded":d.value,"aria-disabled":t.disabled,onClick:y},[e.createElementVNode("span",{class:e.normalizeClass(i.value[0]?"":"sg-timepicker-placeholder")},e.toDisplayString(i.value[0]||t.placeholder[0]),3),e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?"":"sg-timepicker-separator")},e.toDisplayString(t.separator),3),e.createElementVNode("span",{class:e.normalizeClass(i.value[1]?"":"sg-timepicker-placeholder")},e.toDisplayString(i.value[1]||t.placeholder[1]),3),e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?"":"sg-timepicker-suffix")},[t.allowClear&&(i.value[0]||i.value[1])?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(t.unstyled?"":"sg-timepicker-clear"),role:"button","aria-label":o.value,onClick:b},"×",10,lp)):e.createCommentVNode("",!0)],2)],10,tp),d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.unstyled?"":"sg-tp-dropdown sg-tp-dropdown-range")},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-tp-range-panels")},[e.createVNode(Gt,{value:i.value[0],format:u.value,"use12-hours":t.use12Hours,"hour-step":t.hourStep,"minute-step":t.minuteStep,"second-step":t.secondStep,"show-second":t.showSecond,"show-now":!1,open:!0,unstyled:t.unstyled,onChange:h},null,8,["value","format","use12-hours","hour-step","minute-step","second-step","show-second","unstyled"]),e.createVNode(Gt,{value:i.value[1],format:u.value,"use12-hours":t.use12Hours,"hour-step":t.hourStep,"minute-step":t.minuteStep,"second-step":t.secondStep,"show-second":t.showSecond,"show-now":!1,open:!0,unstyled:t.unstyled,onChange:p},null,8,["value","format","use12-hours","hour-step","minute-step","second-step","show-second","unstyled"])],2)],2)):e.createCommentVNode("",!0)],2))}}),np={class:"sg-calendar-header"},op={class:"sg-calendar-header-left"},sp=["title","aria-label"],rp=["title","aria-label"],ip={class:"sg-calendar-header-center"},cp=["aria-label","value"],up=["value"],dp=["aria-label","value"],mp=["value"],pp={class:"sg-calendar-mode-switch"},vp={class:"sg-calendar-header-right"},gp=["title","aria-label"],fp=["title","aria-label"],hp={class:"sg-calendar-body"},yp={key:0,class:"sg-calendar-table"},kp={key:0,class:"sg-calendar-week-header"},bp={key:0,class:"sg-calendar-week-number"},Bp=["onClick"],Cp={class:"sg-calendar-cell-inner"},wp={class:"sg-calendar-cell-date"},Sp={key:0,class:"sg-calendar-cell-events"},Ep=["title"],xp={key:0,class:"sg-calendar-event-more"},$p={key:1,class:"sg-calendar-month-grid"},Np=["onClick"],Vp={class:"sg-calendar-month-cell-inner"},Dp={class:"sg-calendar-month-cell-name"},zp={key:0,class:"sg-calendar-footer"},Tp=e.defineComponent({__name:"Calendar",props:{modelValue:{},value:{},defaultValue:{},mode:{default:"month"},events:{},maxEvents:{default:3},weekStartDay:{default:0},showWeekNumber:{type:Boolean,default:!1},showWeekNumbers:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!0},disabledDate:{},locale:{},rangeSelection:{type:Boolean,default:!1},rangeValue:{},defaultRangeValue:{},multipleSelection:{type:Boolean,default:!1},multipleValue:{},defaultMultipleValue:{},unstyled:{type:Boolean}},emits:["update:modelValue","select","panelChange","modeChange","change","rangeChange","multipleChange"],setup(t,{emit:n}){const l=t,a=n,o=["January","February","March","April","May","June","July","August","September","October","November","December"],s=["Su","Mo","Tu","We","Th","Fr","Sa"],u=Ee(),c=e.computed(()=>{var G,le,fe;return((G=l.locale)==null?void 0:G.monthNames)??((fe=(le=u.value.locale)==null?void 0:le.calendar)==null?void 0:fe.monthNames)??o}),i=e.computed(()=>{var G,le,fe;return((G=l.locale)==null?void 0:G.dayNames)??((fe=(le=u.value.locale)==null?void 0:le.calendar)==null?void 0:fe.dayNames)??s}),r=e.computed(()=>{var G,le,fe;return((G=l.locale)==null?void 0:G.today)??((fe=(le=u.value.locale)==null?void 0:le.calendar)==null?void 0:fe.today)??"Today"}),d=e.computed(()=>{var G,le,fe;return((G=l.locale)==null?void 0:G.week)??((fe=(le=u.value.locale)==null?void 0:le.calendar)==null?void 0:fe.week)??"W"}),v=e.computed(()=>{var G,le;return((le=(G=u.value.locale)==null?void 0:G.calendar)==null?void 0:le.prevYear)??"Previous year"}),g=e.computed(()=>{var G,le;return((le=(G=u.value.locale)==null?void 0:G.calendar)==null?void 0:le.nextYear)??"Next year"}),m=e.computed(()=>{var G,le;return((le=(G=u.value.locale)==null?void 0:G.calendar)==null?void 0:le.prevMonth)??"Previous month"}),h=e.computed(()=>{var G,le;return((le=(G=u.value.locale)==null?void 0:G.calendar)==null?void 0:le.nextMonth)??"Next month"}),p=e.computed(()=>{var G,le;return((le=(G=u.value.locale)==null?void 0:G.calendar)==null?void 0:le.month)??"Month"}),b=e.computed(()=>{var G,le;return((le=(G=u.value.locale)==null?void 0:G.calendar)==null?void 0:le.year)??"Year"}),y=e.ref(l.modelValue??l.value??l.defaultValue??new Date);e.watch(()=>l.modelValue??l.value,G=>{G&&(y.value=G)});const E=e.computed(()=>l.modelValue??l.value??y.value),z=e.ref(l.rangeValue??l.defaultRangeValue??[null,null]);e.watch(()=>l.rangeValue,G=>{G!==void 0&&(z.value=[...G])});const x=e.computed(()=>l.rangeValue??z.value),f=e.ref([...l.multipleValue??l.defaultMultipleValue??[]]);e.watch(()=>l.multipleValue,G=>{G!==void 0&&(f.value=[...G])});const N=e.computed(()=>l.multipleValue??f.value),B=e.ref(l.mode);e.watch(()=>l.mode,G=>{B.value=G});const w=e.computed(()=>B.value);function S(G,le){return G.getFullYear()===le.getFullYear()&&G.getMonth()===le.getMonth()&&G.getDate()===le.getDate()}function L(G,le){return G.getFullYear()===le.getFullYear()&&G.getMonth()===le.getMonth()}function T(G){return S(G,new Date)}function P(G,le){return new Date(G,le+1,0).getDate()}function q(G){const le=new Date(Date.UTC(G.getFullYear(),G.getMonth(),G.getDate())),fe=le.getUTCDay()||7;le.setUTCDate(le.getUTCDate()+4-fe);const be=new Date(Date.UTC(le.getUTCFullYear(),0,1));return Math.ceil(((le.getTime()-be.getTime())/864e5+1)/7)}function _(G,le,fe){const be=G.getTime(),Ve=Math.min(le.getTime(),fe.getTime()),De=Math.max(le.getTime(),fe.getTime());return be>=Ve&&be<=De}function R(G,le,fe){if(!le)return!1;if(!fe)return S(G,le);const be=le.getTime()<=fe.getTime()?le:fe;return S(G,be)}function U(G,le,fe){if(!le||!fe)return!1;const be=le.getTime()<=fe.getTime()?fe:le;return S(G,be)}const I=e.computed(()=>l.showWeekNumber||l.showWeekNumbers),X=e.ref(E.value);e.watch(E,G=>{X.value=G});const ae=e.computed(()=>X.value.getFullYear()),A=e.computed(()=>X.value.getMonth()),V=e.computed(()=>{const G=ae.value,le=A.value,fe=P(G,le),Ve=(new Date(G,le,1).getDay()-l.weekStartDay+7)%7,De=P(G,le-1),xe=[];for(let we=Ve-1;we>=0;we--)xe.push({date:new Date(G,le-1,De-we),day:De-we,inMonth:!1});for(let we=1;we<=fe;we++)xe.push({date:new Date(G,le,we),day:we,inMonth:!0});const Le=42-xe.length;for(let we=1;we<=Le;we++)xe.push({date:new Date(G,le+1,we),day:we,inMonth:!1});const Te=[];for(let we=0;we<xe.length;we+=7)Te.push(xe.slice(we,we+7));return Te}),C=e.computed(()=>{const G=[];for(let le=ae.value-10;le<=ae.value+10;le++)G.push(le);return G});function k(G){return(l.events??[]).filter(le=>S(le.date,G))}function $(G){y.value=G,X.value=G,a("update:modelValue",G),a("select",G),a("change",G)}function M(G){z.value=G,a("rangeChange",G)}function H(G){f.value=G,a("multipleChange",G)}function O(G){var le;if(!((le=l.disabledDate)!=null&&le.call(l,G))){if(l.rangeSelection){const[fe,be]=x.value;M(!fe||fe&&be?[G,null]:[fe,G]);return}if(l.multipleSelection){const be=N.value.some(Ve=>S(Ve,G))?N.value.filter(Ve=>!S(Ve,G)):[...N.value,G];H(be);return}$(G)}}function Q(G){const le=new Date(ae.value,G,1);X.value=le,y.value=le,a("update:modelValue",le),a("select",le),a("change",le),B.value="month",a("modeChange","month"),a("panelChange",le,"month")}function re(G){const le=new Date(ae.value,A.value+G,1);X.value=le,a("panelChange",le,w.value)}function ce(G){const le=new Date(ae.value+G,A.value,1);X.value=le,a("panelChange",le,w.value)}function ne(G){B.value=G,a("modeChange",G),a("panelChange",X.value,G)}function de(){O(new Date)}function ye(G){const le=Number(G.target.value),fe=new Date(ae.value,le,1);X.value=fe,a("panelChange",fe,w.value)}function Me(G){const le=Number(G.target.value),fe=new Date(le,A.value,1);X.value=fe,a("panelChange",fe,w.value)}const Ne=e.computed(()=>{const G=i.value,le=[];for(let fe=0;fe<7;fe++)le.push(G[(l.weekStartDay+fe)%7]);return le}),Ie=e.computed(()=>l.unstyled?"":["sg-calendar",l.fullscreen?"sg-calendar-fullscreen":"sg-calendar-mini",`sg-calendar-${w.value}`].filter(Boolean).join(" "));function ze(G){var we;const[le,fe]=x.value,be=l.rangeSelection,Ve=be&&le&&fe?_(G.date,le,fe):!1,De=be?R(G.date,le,fe):!1,xe=be?U(G.date,le,fe):!1,Le=l.multipleSelection?N.value.some(oe=>S(oe,G.date)):!1,Te=!be&&!l.multipleSelection?S(G.date,E.value):De||xe||Le;return["sg-calendar-cell",G.inMonth?"":"sg-calendar-cell-outside",T(G.date)?"sg-calendar-cell-today":"",Te?"sg-calendar-cell-selected":"",Ve?"sg-calendar-cell-in-range":"",De?"sg-calendar-cell-range-start":"",xe?"sg-calendar-cell-range-end":"",(we=l.disabledDate)!=null&&we.call(l,G.date)?"sg-calendar-cell-disabled":""].filter(Boolean).join(" ")}function We(G){const le=new Date(ae.value,G,1);return["sg-calendar-month-cell",L(le,E.value)?"sg-calendar-month-cell-selected":"",L(le,new Date)?"sg-calendar-month-cell-current":""].filter(Boolean).join(" ")}function Ge(G){X.value=G,a("panelChange",G,w.value)}return(G,le)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(Ie.value)},[e.renderSlot(G.$slots,"header",{value:X.value,type:w.value,onChange:Ge,onTypeChange:ne},()=>[e.createElementVNode("div",np,[e.createElementVNode("div",op,[e.createElementVNode("button",{type:"button",class:"sg-calendar-nav-btn",title:v.value,"aria-label":v.value,onClick:le[0]||(le[0]=fe=>ce(-1))}," « ",8,sp),w.value==="month"?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"sg-calendar-nav-btn",title:m.value,"aria-label":m.value,onClick:le[1]||(le[1]=fe=>re(-1))}," ‹ ",8,rp)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ip,[e.createElementVNode("select",{class:"sg-calendar-month-select","aria-label":p.value,value:A.value,onChange:ye},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(fe,be)=>(e.openBlock(),e.createElementBlock("option",{key:be,value:be},e.toDisplayString(fe),9,up))),128))],40,cp),e.createElementVNode("select",{class:"sg-calendar-year-select","aria-label":b.value,value:ae.value,onChange:Me},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,fe=>(e.openBlock(),e.createElementBlock("option",{key:fe,value:fe},e.toDisplayString(fe),9,mp))),128))],40,dp),e.createElementVNode("div",pp,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["sg-calendar-mode-btn",w.value==="month"?"sg-calendar-mode-btn-active":""]),onClick:le[2]||(le[2]=fe=>ne("month"))},e.toDisplayString(p.value),3),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["sg-calendar-mode-btn",w.value==="year"?"sg-calendar-mode-btn-active":""]),onClick:le[3]||(le[3]=fe=>ne("year"))},e.toDisplayString(b.value),3)])]),e.createElementVNode("div",vp,[w.value==="month"?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"sg-calendar-nav-btn",title:h.value,"aria-label":h.value,onClick:le[4]||(le[4]=fe=>re(1))}," › ",8,gp)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"sg-calendar-nav-btn",title:g.value,"aria-label":g.value,onClick:le[5]||(le[5]=fe=>ce(1))}," » ",8,fp)])])]),e.createElementVNode("div",hp,[w.value==="month"?(e.openBlock(),e.createElementBlock("table",yp,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[I.value?(e.openBlock(),e.createElementBlock("th",kp,e.toDisplayString(d.value),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ne.value,fe=>(e.openBlock(),e.createElementBlock("th",{key:fe,class:"sg-calendar-day-header"},e.toDisplayString(fe),1))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,(fe,be)=>(e.openBlock(),e.createElementBlock("tr",{key:be,class:"sg-calendar-week-row"},[I.value?(e.openBlock(),e.createElementBlock("td",bp,e.toDisplayString(q(fe[0].date)),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe,Ve=>(e.openBlock(),e.createElementBlock("td",{key:Ve.date.toISOString(),class:e.normalizeClass(ze(Ve)),onClick:De=>O(Ve.date)},[e.createElementVNode("div",Cp,[e.createElementVNode("span",wp,e.toDisplayString(Ve.day),1),e.renderSlot(G.$slots,"cell",{date:Ve.date,type:"date"}),k(Ve.date).length>0?(e.openBlock(),e.createElementBlock("div",Sp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k(Ve.date).slice(0,t.maxEvents),(De,xe)=>(e.openBlock(),e.createElementBlock("span",{key:De.key??De.id??xe,class:"sg-calendar-event-dot",style:e.normalizeStyle({backgroundColor:De.color??"var(--sg-primary, #1677ff)"}),title:De.title},null,12,Ep))),128)),k(Ve.date).length>t.maxEvents?(e.openBlock(),e.createElementBlock("span",xp,"+"+e.toDisplayString(k(Ve.date).length-t.maxEvents),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],10,Bp))),128))]))),128))])])):(e.openBlock(),e.createElementBlock("div",$p,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(fe,be)=>(e.openBlock(),e.createElementBlock("div",{key:be,class:e.normalizeClass(We(be)),onClick:Ve=>Q(be)},[e.createElementVNode("div",Vp,[e.createElementVNode("span",Dp,e.toDisplayString(fe),1),e.renderSlot(G.$slots,"cell",{date:new Date(ae.value,be,1),type:"month"})])],10,Np))),128))]))]),t.fullscreen?(e.openBlock(),e.createElementBlock("div",zp,[e.createElementVNode("button",{type:"button",class:"sg-calendar-today-btn",onClick:de},e.toDisplayString(r.value),1)])):e.createCommentVNode("",!0)],2))}}),Mp=["multiple","accept","disabled","aria-label"],Lp=["aria-label","onClick"],Fp=e.defineComponent({__name:"Upload",props:{modelValue:{},fileList:{},defaultFileList:{},multiple:{type:Boolean,default:!1},accept:{},disabled:{type:Boolean,default:!1},drag:{type:Boolean,default:!1},listType:{default:"text"},showUploadList:{type:Boolean,default:!0},maxCount:{},maxSize:{},beforeUpload:{},customRequest:{},unstyled:{type:Boolean}},emits:["update:modelValue","change","remove"],setup(t,{emit:n}){const l=t,a=n,o=e.ref(l.modelValue??l.fileList??l.defaultFileList??[]);e.watch(()=>l.modelValue??l.fileList,w=>{w!==void 0&&(o.value=w)});const s=e.computed(()=>l.modelValue??l.fileList??o.value),u=e.ref(null),c=e.ref(!1);function i(){return`up_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function r(w){o.value=w,a("update:modelValue",w),a("change",w)}async function d(w){if(!w)return;const S=Array.from(w),L=[];for(const P of S)l.maxSize!==void 0&&P.size>l.maxSize||l.beforeUpload&&await l.beforeUpload(P,S)===!1||L.push({uid:i(),name:P.name,status:"uploading",size:P.size,type:P.type,percent:0,raw:P});let T=l.multiple?[...s.value,...L]:L.slice(0,1);l.maxCount!==void 0&&(T=T.slice(0,l.maxCount)),r(T);for(const P of L)l.customRequest&&P.raw?l.customRequest({file:P.raw,onProgress:q=>v(P.uid,{percent:q}),onSuccess:()=>v(P.uid,{status:"done",percent:100}),onError:q=>v(P.uid,{status:"error",error:q})}):v(P.uid,{status:"done",percent:100})}function v(w,S){const L=s.value.map(T=>T.uid===w?{...T,...S}:T);r(L)}function g(w){const S=s.value.filter(L=>L.uid!==w.uid);r(S),a("remove",w)}function m(){var w;l.disabled||(w=u.value)==null||w.click()}function h(w){var S;w.preventDefault(),c.value=!1,!l.disabled&&d(((S=w.dataTransfer)==null?void 0:S.files)??null)}function p(w){w.preventDefault(),!l.disabled&&(c.value=!0)}function b(){c.value=!1}function y(w){const S=w.target;d(S.files),S.value=""}const E=Ee(),z=e.computed(()=>{var w,S;return((S=(w=E.value.locale)==null?void 0:w.upload)==null?void 0:S.uploadAriaLabel)??"Upload file"}),x=e.computed(()=>{var w,S;return((S=(w=E.value.locale)==null?void 0:w.upload)==null?void 0:S.uploadText)??"Upload"}),f=e.computed(()=>{var w,S;return((S=(w=E.value.locale)==null?void 0:w.upload)==null?void 0:S.removeFile)??"Remove file"}),N=e.computed(()=>l.unstyled?"":["sg-upload",`sg-upload-${l.listType}`,l.drag?"sg-upload-drag":"sg-upload-select",l.disabled?"sg-upload-disabled":"",c.value?"sg-upload-dragging":""].filter(Boolean).join(" "));function B(w){return l.unstyled?"":["sg-upload-item",`sg-upload-item-${w.status}`].filter(Boolean).join(" ")}return(w,S)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(N.value)},[e.createElementVNode("input",{ref_key:"inputRef",ref:u,type:"file",class:"sg-upload-input",multiple:t.multiple,accept:t.accept,disabled:t.disabled,"aria-label":z.value,style:{display:"none"},onChange:y},null,40,Mp),t.drag?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-upload-drag-area",role:"button",tabindex:"0",onClick:m,onDrop:h,onDragover:p,onDragleave:b},[e.renderSlot(w.$slots,"drag",{},()=>[S[0]||(S[0]=e.createElementVNode("p",{class:"sg-upload-drag-icon"},"⬆",-1)),S[1]||(S[1]=e.createElementVNode("p",{class:"sg-upload-drag-text"},"Click or drag file to this area to upload",-1))])],32)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"sg-upload-select-trigger",onClick:m},[e.renderSlot(w.$slots,"default",{},()=>[e.createVNode(Xe,{disabled:t.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.value),1)]),_:1},8,["disabled"])])])),t.showUploadList&&s.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.unstyled?"":"sg-upload-list")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,L=>(e.openBlock(),e.createElementBlock("div",{key:L.uid,class:e.normalizeClass(B(L))},[e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?"":"sg-upload-item-name")},[L.status==="uploading"?(e.openBlock(),e.createBlock(Bt,{key:0,size:"small",unstyled:t.unstyled},null,8,["unstyled"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(L.name),1)],2),L.status==="uploading"?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(t.unstyled?"":"sg-upload-item-progress")},e.toDisplayString(L.percent??0)+"%",3)):e.createCommentVNode("",!0),L.status!=="uploading"?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(t.unstyled?"":"sg-upload-item-remove"),"aria-label":`${f.value}: ${L.name}`,onClick:T=>g(L)}," × ",10,Lp)):e.createCommentVNode("",!0)],2))),128))],2)):e.createCommentVNode("",!0)],2))}}),Ap=["aria-expanded","aria-disabled"],Pp={class:"sg-cascader-selection-wrap"},Rp={key:0,class:"sg-cascader-placeholder"},Ip={key:1,class:"sg-cascader-selection-item"},_p={key:2,class:"sg-cascader-placeholder"},Kp={class:"sg-cascader-tag-label"},Hp=["aria-label","onClick"],Op={key:0,class:"sg-cascader-tag sg-cascader-tag-rest"},jp=["placeholder"],Yp={class:"sg-cascader-actions"},Wp=["aria-label"],Up={class:"sg-cascader-arrow"},qp={key:0,class:"sg-cascader-dropdown"},Xp={key:0,class:"sg-cascader-search-list"},Gp=["onClick"],Jp={class:"sg-cascader-search-label"},Zp={key:0,class:"sg-cascader-search-separator"},Qp={key:0,class:"sg-cascader-empty"},ev={key:1,class:"sg-cascader-columns"},tv=["onClick","onMouseenter"],lv={class:"sg-cascader-option-label"},av={key:1,class:"sg-cascader-option-expand sg-cascader-option-spinner","aria-hidden":"true"},nv={key:2,class:"sg-cascader-option-expand sg-cascader-menu-item-expand","aria-hidden":"true"},ov=e.defineComponent({__name:"Cascader",props:{options:{},modelValue:{},value:{},defaultValue:{},placeholder:{default:"Please select"},disabled:{type:Boolean,default:!1},allowClear:{type:Boolean,default:!0},showSearch:{type:[Boolean,Object],default:!1},expandTrigger:{default:"click"},changeOnSelect:{type:Boolean,default:!1},displayRender:{},multiple:{type:Boolean,default:!1},maxTagCount:{},loadData:{},unstyled:{type:Boolean},size:{default:"middle"}},emits:["update:modelValue","change"],setup(t,{emit:n}){const l=t,a=n,o=Ee(),s=e.computed(()=>{var k,$;return(($=(k=o.value.locale)==null?void 0:k.cascader)==null?void 0:$.clear)??"Clear"}),u=e.computed(()=>{var k,$;return(($=(k=o.value.locale)==null?void 0:k.cascader)==null?void 0:$.removeTag)??"Remove"});function c(k,$){return k.length!==$.length?!1:k.every((M,H)=>M===$[H])}function i(k,$){return k.find(M=>M.value===$)}function r(k,$){const M=[];let H=k;for(const O of $){const Q=i(H,O);if(!Q)break;M.push(Q),H=Q.children??[]}return M}function d(k,$){const M=[],H=(O,Q)=>{for(const re of O){if(re.disabled)continue;const ce=[...Q,re],ne=re.isLeaf!==!1&&(!re.children||re.children.length===0);(!$||ne)&&M.push({path:ce,values:ce.map(de=>de.value)}),re.children&&re.children.length>0&&H(re.children,ce)}};return H(k,[]),M}function v(k,$){const M=k.toLowerCase();return $.some(H=>H.label.toLowerCase().includes(M))}const g=e.ref(l.modelValue??l.value??l.defaultValue??[]);e.watch(()=>l.modelValue??l.value,k=>{k!==void 0&&(g.value=k)});const m=e.computed(()=>l.modelValue??l.value??g.value),h=e.ref(l.multiple&&(l.modelValue??l.value??l.defaultValue??[]).length>0?[l.modelValue??l.value??l.defaultValue??[]]:[]),p=e.ref(!1),b=e.ref([l.options]),y=e.ref([]),E=e.ref(""),z=e.ref(new Set),x=e.ref(null),f=e.ref(null);function N(k){const $=[l.options];let M=l.options;const H=[];for(const O of k){const Q=i(M,O);if(!Q)break;if(H.push(O),Q.children&&Q.children.length>0)$.push(Q.children),M=Q.children;else break}b.value=$,y.value=H}e.watch(p,async k=>{var $;k&&(N(m.value),l.showSearch&&(await e.nextTick(),($=f.value)==null||$.focus()))}),e.watch(()=>l.options,()=>{N(y.value)});function B(k){g.value=k,a("update:modelValue",k),a("change",k,r(l.options,k))}function w(k,$){if(k.disabled)return;const M=[...y.value.slice(0,$),k.value];y.value=M;const H=[...b.value.slice(0,$+1)];k.children&&k.children.length>0&&H.push(k.children),b.value=H;const O=k.isLeaf!==!1&&(!k.children||k.children.length===0);if(l.loadData&&k.isLeaf===!1&&(!k.children||k.children.length===0)){const Q=r(l.options,M);z.value=new Set([...z.value,k.value]),l.loadData(Q),setTimeout(()=>{const re=new Set(z.value);re.delete(k.value),z.value=re,N(M)},0)}if(l.multiple){if(O){const Q=r(l.options,M);h.value.some(ce=>c(ce,M))?h.value=h.value.filter(ce=>!c(ce,M)):h.value=[...h.value,M],a("change",M,Q)}return}(O||l.changeOnSelect)&&(B(M),O&&(p.value=!1,E.value=""))}function S(k,$){if(l.expandTrigger!=="hover"||k.disabled)return;const M=[...y.value.slice(0,$),k.value];y.value=M;const H=[...b.value.slice(0,$+1)];k.children&&k.children.length>0&&H.push(k.children),b.value=H}function L(k){k.stopPropagation(),!l.disabled&&(l.multiple&&(h.value=[]),B([]),E.value="")}function T(k,$){$.stopPropagation(),!l.disabled&&(h.value=h.value.filter((M,H)=>H!==k))}function P(){l.disabled||(p.value=!p.value)}function q(k){x.value&&!x.value.contains(k.target)&&(p.value=!1,E.value="")}e.onMounted(()=>document.addEventListener("mousedown",q)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",q));const _=e.computed(()=>l.showSearch?typeof l.showSearch=="object"&&l.showSearch.filter?l.showSearch.filter:v:null),R=e.computed(()=>!E.value||!_.value?null:d(l.options,!l.changeOnSelect).filter(({path:$})=>_.value(E.value,$)));function U(k,$){l.multiple?(h.value.some(H=>c(H,k))?h.value=h.value.filter(H=>!c(H,k)):h.value=[...h.value,k],a("change",k,$)):(B(k),p.value=!1,E.value="")}const I=e.computed(()=>{if(l.multiple||m.value.length===0)return"";const k=r(l.options,m.value);if(k.length===0)return"";const $=k.map(M=>M.label);return l.displayRender?l.displayRender($,k):$.join(" / ")});function X(k){return h.value.some($=>c($,k))}const ae=e.computed(()=>l.maxTagCount!==void 0&&l.multiple?h.value.slice(0,l.maxTagCount):h.value),A=e.computed(()=>l.maxTagCount!==void 0&&l.multiple?Math.max(0,h.value.length-l.maxTagCount):0),V=e.computed(()=>l.unstyled?"":["sg-cascader",`sg-cascader-${l.size}`,p.value?"sg-cascader-open":"",l.disabled?"sg-cascader-disabled":"",l.multiple?"sg-cascader-multiple":""].filter(Boolean).join(" "));function C(k){return r(l.options,k).map($=>$.label).join(" / ")}return(k,$)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:x,class:e.normalizeClass(V.value)},[e.createElementVNode("div",{class:"sg-cascader-selector",role:"combobox","aria-expanded":p.value,"aria-disabled":t.disabled,tabindex:"0",onClick:P},[e.createElementVNode("div",Pp,[!t.multiple&&!I.value&&!E.value?(e.openBlock(),e.createElementBlock("span",Rp,e.toDisplayString(t.placeholder),1)):e.createCommentVNode("",!0),!t.multiple&&I.value&&!E.value?(e.openBlock(),e.createElementBlock("span",Ip,e.toDisplayString(I.value),1)):e.createCommentVNode("",!0),t.multiple&&h.value.length===0&&!E.value?(e.openBlock(),e.createElementBlock("span",_p,e.toDisplayString(t.placeholder),1)):e.createCommentVNode("",!0),t.multiple?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,(M,H)=>(e.openBlock(),e.createElementBlock("span",{key:M.join("-")+H,class:"sg-cascader-tag"},[e.createElementVNode("span",Kp,e.toDisplayString(C(M)),1),e.createElementVNode("span",{class:"sg-cascader-tag-close",role:"button","aria-label":u.value,onClick:O=>T(H,O)},"×",8,Hp)]))),128)),A.value>0?(e.openBlock(),e.createElementBlock("span",Op," +"+e.toDisplayString(A.value)+"... ",1)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.showSearch&&p.value?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:4,ref_key:"searchInputRef",ref:f,"onUpdate:modelValue":$[0]||($[0]=M=>E.value=M),class:"sg-cascader-search-input",placeholder:t.placeholder},null,8,jp)),[[e.vModelText,E.value]]):e.createCommentVNode("",!0)]),e.createElementVNode("div",Yp,[t.allowClear&&(m.value.length>0||h.value.length>0)?(e.openBlock(),e.createElementBlock("span",{key:0,class:"sg-cascader-clear",role:"button","aria-label":s.value,onClick:L},"×",8,Wp)):e.createCommentVNode("",!0),e.createElementVNode("span",Up,e.toDisplayString(p.value?"▲":"▼"),1)])],8,Ap),p.value?(e.openBlock(),e.createElementBlock("div",qp,[R.value?(e.openBlock(),e.createElementBlock("div",Xp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,({path:M,values:H})=>(e.openBlock(),e.createElementBlock("div",{key:H.join("-"),class:e.normalizeClass(["sg-cascader-search-item",t.multiple&&X(H)?"sg-cascader-search-item-checked":""]),onClick:O=>U(H,M)},[t.multiple?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["sg-cascader-search-check",X(H)?"sg-cascader-search-check-active":""])},e.toDisplayString(X(H)?"✓":""),3)):e.createCommentVNode("",!0),e.createElementVNode("span",Jp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M,(O,Q)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:O.value},[Q>0?(e.openBlock(),e.createElementBlock("span",Zp," / ")):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(O.label),1)],64))),128))])],10,Gp))),128)),R.value.length===0?(e.openBlock(),e.createElementBlock("div",Qp,"No matches")):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",ev,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(M,H)=>(e.openBlock(),e.createElementBlock("ul",{key:H,class:"sg-cascader-column sg-cascader-menu"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M,O=>{var Q;return e.openBlock(),e.createElementBlock("li",{key:String(O.value),class:e.normalizeClass(["sg-cascader-option sg-cascader-menu-item",y.value[H]===O.value?"sg-cascader-option-active sg-cascader-menu-item-active":"",O.disabled?"sg-cascader-option-disabled sg-cascader-menu-item-disabled":"",z.value.has(O.value)?"sg-cascader-option-loading":""]),onClick:re=>w(O,H),onMouseenter:re=>S(O,H)},[t.multiple?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["sg-cascader-option-check",h.value.some(re=>re[H]===O.value&&re.length===H+1)?"sg-cascader-option-check-active":""])},e.toDisplayString(h.value.some(re=>re[H]===O.value&&re.length===H+1)?"✓":""),3)):e.createCommentVNode("",!0),e.createElementVNode("span",lv,e.toDisplayString(O.label),1),z.value.has(O.value)?(e.openBlock(),e.createElementBlock("span",av,"⟳")):(Q=O.children)!=null&&Q.length||O.isLeaf===!1?(e.openBlock(),e.createElementBlock("span",nv,"›")):e.createCommentVNode("",!0)],42,tv)}),128))]))),128))]))])):e.createCommentVNode("",!0)],2))}}),sv={key:0},rv={key:1},iv=["onClick"],cv={key:0},uv=["value","placeholder"],dv={class:"sg-treeselect-selection-wrap"},mv={key:0,class:"sg-treeselect-placeholder"},pv={key:1,class:"sg-treeselect-selection-item"},vv={class:"sg-treeselect-tag-label"},gv=["onClick"],fv={key:3,class:"sg-treeselect-tag sg-treeselect-tag-rest"},hv=["value"],yv={class:"sg-treeselect-actions"},kv={class:"sg-treeselect-arrow"},bv={key:0,class:"sg-treeselect-empty"},Bv=e.defineComponent({__name:"TreeSelect",props:{treeData:{},modelValue:{},value:{},defaultValue:{},fieldNames:{},multiple:{type:Boolean,default:!1},treeCheckable:{type:Boolean,default:!1},treeCheckStrictly:{type:Boolean,default:!1},treeDefaultExpandAll:{type:Boolean,default:!1},treeDefaultExpandedKeys:{},defaultExpandedKeys:{},showSearch:{type:Boolean,default:!1},filterTreeNode:{},placeholder:{default:"Please select"},allowClear:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{default:"middle"},maxTagCount:{},dropdownStyle:{},treeLine:{type:Boolean,default:!1},showCheckedStrategy:{default:"SHOW_ALL"},className:{},unstyled:{type:Boolean}},emits:["update:modelValue","change","search"],setup(t,{emit:n}){const l=t,a=n;function o($){return $===void 0||$===""||$===null?[]:Array.isArray($)?$:[$]}function s($,M){for(const H of $){if(H.key===M)return H;if(H.children){const O=s(H.children,M);if(O)return O}}}function u($){return $?typeof $.title=="string"?$.title:String($.key):""}function c($){const M=[],H=O=>{for(const Q of O)M.push(Q.key),Q.children&&H(Q.children)};return H($),M}function i($){const M=[],H=O=>{for(const Q of O)Q.children&&Q.children.length>0&&(M.push(Q.key),H(Q.children))};return H($),M}function r($,M){const H=[];for(const O of $){const Q=O.children?r(O.children,M):[];(M(O)||Q.length>0)&&H.push({...O,children:Q.length>0?Q:void 0})}return H}function d($,M){const H=[],O=(Q,re)=>{for(const ce of Q){if(ce.key===M)return H.push(...re),!0;if(ce.children&&O(ce.children,[...re,ce.key]))return!0}return!1};return O($,[]),H}function v($,M,H){if(H==="SHOW_ALL")return $;const O=new Set($);return H==="SHOW_CHILD"?$.filter(Q=>{const re=s(M,Q);return!(re!=null&&re.children)||re.children.length===0}):H==="SHOW_PARENT"?$.filter(Q=>!d(M,Q).some(ce=>O.has(ce))):$}const g=e.computed(()=>l.multiple||l.treeCheckable),m=e.computed(()=>l.modelValue??l.value),h=e.ref(o(m.value??l.defaultValue));e.watch(m,$=>{$!==void 0&&(h.value=o($))});const p=e.computed(()=>m.value!==void 0?o(m.value):h.value),b=e.ref(!1),y=e.ref(""),E=e.useTemplateRef("wrapperRef"),z=e.useTemplateRef("searchRef"),x=($,M)=>(typeof M.title=="string"?M.title:String(M.key)).toLowerCase().includes($.toLowerCase()),f=e.computed(()=>l.filterTreeNode??x),N=e.computed(()=>y.value?r(l.treeData,$=>f.value(y.value,$)):l.treeData),B=e.computed(()=>y.value?c(N.value):void 0),w=e.computed(()=>{if(l.treeDefaultExpandedKeys&&l.treeDefaultExpandedKeys.length>0)return l.treeDefaultExpandedKeys;if(l.defaultExpandedKeys&&l.defaultExpandedKeys.length>0)return l.defaultExpandedKeys;if(l.treeDefaultExpandAll)return i(l.treeData)}),S=e.computed(()=>l.treeCheckable?p.value:void 0),L=e.computed(()=>l.treeCheckable?void 0:p.value),T=e.computed(()=>g.value?v(p.value,l.treeData,l.showCheckedStrategy):p.value),P=e.computed(()=>l.maxTagCount!==void 0&&g.value?T.value.slice(0,l.maxTagCount):T.value),q=e.computed(()=>l.maxTagCount!==void 0&&g.value?Math.max(0,T.value.length-l.maxTagCount):0);function _($,M){h.value=$;const H=$.map(Q=>u(s(l.treeData,Q))),O=g.value?$:$[0]??"";a("update:modelValue",O),a("change",O,H,{triggerNode:M})}function R($,M){if(l.treeCheckable)return;const H=M.node;if(g.value){const O=M.selected?[...p.value,H.key]:p.value.filter(Q=>Q!==H.key);_(O,H)}else _([H.key],H),b.value=!1,y.value=""}function U($,M){const H=v($,l.treeData,l.showCheckedStrategy);_(H,M.node)}function I($,M){if(M.stopPropagation(),l.disabled)return;const H=s(l.treeData,$)??{key:$},O=p.value.filter(Q=>Q!==$);_(O,H)}function X($){if($.stopPropagation(),l.disabled)return;const M=l.treeData[0]??{key:""};_([],M),y.value=""}function ae($){const M=$.target.value;y.value=M,a("search",M)}function A(){l.disabled||(b.value=!b.value)}function V($){E.value&&(E.value.contains($.target)||(b.value=!1,y.value=""))}e.onMounted(()=>document.addEventListener("mousedown",V)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",V)),e.watch(b,$=>{$&&l.showSearch&&e.nextTick(()=>{var M;return(M=z.value)==null?void 0:M.focus()})});const C=e.computed(()=>l.unstyled?l.className??"":["sg-treeselect",`sg-treeselect-${l.size}`,b.value?"sg-treeselect-open":"",l.disabled?"sg-treeselect-disabled":"",g.value?"sg-treeselect-multiple":"",l.className].filter(Boolean).join(" "));function k($){return u(s(l.treeData,$))}return($,M)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:E,class:e.normalizeClass(C.value)},[t.unstyled?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",{onClick:A},[T.value.length===0?(e.openBlock(),e.createElementBlock("span",sv,e.toDisplayString(t.placeholder),1)):g.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(T.value,H=>(e.openBlock(),e.createElementBlock("span",{key:String(H)},[e.createTextVNode(e.toDisplayString(k(H))+" ",1),e.createElementVNode("span",{onClick:O=>I(H,O)},"×",8,iv)]))),128)):(e.openBlock(),e.createElementBlock("span",rv,e.toDisplayString(k(T.value[0])),1))]),b.value?(e.openBlock(),e.createElementBlock("div",cv,[t.showSearch?(e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"searchRef",ref:z,value:y.value,placeholder:t.placeholder,onInput:ae},null,40,uv)):e.createCommentVNode("",!0),e.createVNode(qt,{"tree-data":N.value,"field-names":t.fieldNames,checkable:t.treeCheckable,"check-strictly":t.treeCheckStrictly,"checked-keys":S.value,"selected-keys":L.value,multiple:g.value,"default-expand-all":t.treeDefaultExpandAll&&!w.value,"default-expanded-keys":w.value,"expanded-keys":B.value,"show-line":t.treeLine,unstyled:"",onSelect:R,onCheck:U},null,8,["tree-data","field-names","checkable","check-strictly","checked-keys","selected-keys","multiple","default-expand-all","default-expanded-keys","expanded-keys","show-line"])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"sg-treeselect-selector",onClick:A},[e.createElementVNode("div",dv,[T.value.length===0&&!y.value?(e.openBlock(),e.createElementBlock("span",mv,e.toDisplayString(t.placeholder),1)):e.createCommentVNode("",!0),!g.value&&T.value.length>0&&!y.value?(e.openBlock(),e.createElementBlock("span",pv,e.toDisplayString(k(T.value[0])),1)):e.createCommentVNode("",!0),g.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(P.value,H=>(e.openBlock(),e.createElementBlock("span",{key:String(H),class:"sg-treeselect-tag"},[e.createElementVNode("span",vv,e.toDisplayString(k(H)),1),e.createElementVNode("span",{class:"sg-treeselect-tag-close",onClick:O=>I(H,O)},"×",8,gv)]))),128)):e.createCommentVNode("",!0),q.value>0?(e.openBlock(),e.createElementBlock("span",fv,"+"+e.toDisplayString(q.value)+"...",1)):e.createCommentVNode("",!0),t.showSearch&&b.value?(e.openBlock(),e.createElementBlock("input",{key:4,ref_key:"searchRef",ref:z,class:"sg-treeselect-search-input",value:y.value,onInput:ae},null,40,hv)):e.createCommentVNode("",!0)]),e.createElementVNode("div",yv,[t.allowClear&&T.value.length>0?(e.openBlock(),e.createElementBlock("span",{key:0,class:"sg-treeselect-clear",onClick:X},"×")):e.createCommentVNode("",!0),e.createElementVNode("span",kv,e.toDisplayString(b.value?"▲":"▼"),1)])]),b.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-treeselect-dropdown",style:e.normalizeStyle(t.dropdownStyle)},[N.value.length===0?(e.openBlock(),e.createElementBlock("div",bv,"No matches")):(e.openBlock(),e.createBlock(qt,{key:1,"tree-data":N.value,"field-names":t.fieldNames,checkable:t.treeCheckable,"check-strictly":t.treeCheckStrictly,"checked-keys":S.value,"selected-keys":L.value,multiple:g.value,"default-expand-all":t.treeDefaultExpandAll&&!w.value,"default-expanded-keys":w.value,"expanded-keys":B.value,"show-line":t.treeLine,onSelect:R,onCheck:U},null,8,["tree-data","field-names","checkable","check-strictly","checked-keys","selected-keys","multiple","default-expand-all","default-expanded-keys","expanded-keys","show-line"]))],4)):e.createCommentVNode("",!0)],64))],2))}}),Cv=["onClick"],wv=["onClick"],Sv=e.defineComponent({__name:"Transfer",props:{dataSource:{},modelValue:{},targetKeys:{},defaultTargetKeys:{},showSearch:{type:Boolean,default:!1},titles:{default:()=>["Source","Target"]},disabled:{type:Boolean,default:!1},oneWay:{type:Boolean,default:!1},showSelectAll:{type:Boolean,default:!0},pagination:{type:[Boolean,Object]},listHeight:{},locale:{},unstyled:{type:Boolean}},emits:["update:modelValue","change","selectChange","search"],setup(t,{emit:n}){const l={itemUnit:"item",itemsUnit:"items",searchPlaceholder:"Search here",notFoundContent:"Not Found",selectAll:"Select all",deselectAll:"Deselect all"},a=t,o=n,s=e.computed(()=>({...l,...a.locale??{}})),u=e.ref(a.modelValue??a.targetKeys??a.defaultTargetKeys??[]);e.watch(()=>a.modelValue??a.targetKeys,C=>{C!==void 0&&(u.value=C)});const c=e.computed(()=>a.modelValue??a.targetKeys??u.value),i=e.ref([]),r=e.ref([]),d=e.ref(""),v=e.ref(""),g=e.ref(1),m=e.ref(1);e.watch(d,()=>{g.value=1}),e.watch(v,()=>{m.value=1});const h=e.computed(()=>a.dataSource.filter(C=>!c.value.includes(C.key))),p=e.computed(()=>a.dataSource.filter(C=>c.value.includes(C.key)));function b(C,k){if(!k)return C;const $=k.toLowerCase();return C.filter(M=>M.title.toLowerCase().includes($))}const y=e.computed(()=>b(h.value,d.value)),E=e.computed(()=>b(p.value,v.value));function z(){return a.pagination?typeof a.pagination=="object"&&a.pagination.pageSize?a.pagination.pageSize:10:1/0}const x=e.computed(()=>z());function f(C,k){if(!a.pagination)return C;const $=Math.max(1,Math.ceil(C.length/x.value)),H=(Math.min(k,$)-1)*x.value;return C.slice(H,H+x.value)}const N=e.computed(()=>f(y.value,g.value)),B=e.computed(()=>f(E.value,m.value));function w(C,k){const $=C.filter(H=>k.includes(H.key)).length,M=C.length===1?s.value.itemUnit:s.value.itemsUnit;return $>0?`${$}/${C.length} ${M}`:`${C.length} ${M}`}function S(C){return C.filter(k=>!k.disabled&&!a.disabled).map(k=>k.key)}function L(C,k){const $=S(C);return $.length>0&&$.every(M=>k.includes(M))}function T(C,k){return S(C).some(H=>k.includes(H))&&!L(C,k)}function P(C,k){if(a.disabled||C.disabled)return;const $=k==="left"?i:r,M=new Set($.value);M.has(C.key)?M.delete(C.key):M.add(C.key),$.value=Array.from(M),o("selectChange",i.value,r.value)}function q(C,k){if(a.disabled)return;const $=C==="left"?y.value:E.value,M=C==="left"?i:r,H=S($);if(k)M.value=Array.from(new Set([...M.value,...H]));else{const O=new Set(H);M.value=M.value.filter(Q=>!O.has(Q))}o("selectChange",i.value,r.value)}function _(){const C=i.value.filter($=>{const M=a.dataSource.find(H=>H.key===$);return M&&!M.disabled});if(C.length===0)return;const k=[...c.value,...C];u.value=k,o("update:modelValue",k),o("change",k,"right",C),i.value=[],o("selectChange",[],r.value)}function R(){if(a.oneWay)return;const C=r.value.filter(M=>{const H=a.dataSource.find(O=>O.key===M);return H&&!H.disabled});if(C.length===0)return;const k=new Set(C),$=c.value.filter(M=>!k.has(M));u.value=$,o("update:modelValue",$),o("change",$,"left",C),r.value=[],o("selectChange",i.value,[])}const U=e.computed(()=>i.value.some(C=>{const k=a.dataSource.find($=>$.key===C);return k&&!k.disabled})),I=e.computed(()=>!a.oneWay&&r.value.some(C=>{const k=a.dataSource.find($=>$.key===C);return k&&!k.disabled}));function X(C){d.value=C,o("search","left",C)}function ae(C){v.value=C,o("search","right",C)}const A=e.computed(()=>a.unstyled?"":["sg-transfer",a.disabled?"sg-transfer-disabled":""].filter(Boolean).join(" "));function V(C,k){return a.unstyled?"":["sg-transfer-list-item",k.includes(C.key)?"sg-transfer-list-item-selected":"",a.disabled||C.disabled?"sg-transfer-list-item-disabled":""].filter(Boolean).join(" ")}return(C,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(A.value)},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-transfer-list")},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-header")},[t.showSelectAll?(e.openBlock(),e.createBlock(rt,{key:0,checked:L(y.value,i.value),indeterminate:T(y.value,i.value),disabled:t.disabled||S(y.value).length===0,onChange:k[0]||(k[0]=$=>q("left",$))},null,8,["checked","indeterminate","disabled"])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-header-count")},e.toDisplayString(w(y.value,i.value)),3),t.titles[0]?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-header-title")},e.toDisplayString(t.titles[0]),3)):e.createCommentVNode("",!0)],2),t.showSearch?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-search")},[e.createVNode(zt,{size:"small","model-value":d.value,placeholder:s.value.searchPlaceholder,"allow-clear":"","onUpdate:modelValue":X},null,8,["model-value","placeholder"])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-body"),style:e.normalizeStyle(t.listHeight?{height:`${t.listHeight}px`,overflow:"auto"}:void 0)},[N.value.length===0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-empty")},e.toDisplayString(s.value.notFoundContent),3)):(e.openBlock(),e.createElementBlock("ul",{key:1,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-content")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,$=>(e.openBlock(),e.createElementBlock("li",{key:$.key,class:e.normalizeClass(V($,i.value)),onClick:M=>P($,"left")},[e.createVNode(rt,{checked:i.value.includes($.key),disabled:t.disabled||$.disabled,onClick:k[1]||(k[1]=e.withModifiers(()=>{},["stop"])),onChange:()=>P($,"left")},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-item-text")},[e.renderSlot(C.$slots,"item",{item:$,side:"left"},()=>[e.createTextVNode(e.toDisplayString($.title),1)])],2)]),_:2},1032,["checked","disabled","onChange"])],10,Cv))),128))],2))],6),t.pagination&&y.value.length>x.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-pagination")},[e.createVNode(Tt,{current:g.value,total:y.value.length,"page-size":x.value,simple:"",onChange:k[2]||(k[2]=$=>g.value=$)},null,8,["current","total","page-size"])],2)):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-transfer-operations")},[e.createVNode(Xe,{type:"primary",size:"small",disabled:t.disabled||!U.value,onClick:_},{default:e.withCtx(()=>[...k[6]||(k[6]=[e.createTextVNode("›",-1)])]),_:1},8,["disabled"]),t.oneWay?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Xe,{key:0,type:"primary",size:"small",disabled:t.disabled||!I.value,onClick:R},{default:e.withCtx(()=>[...k[7]||(k[7]=[e.createTextVNode("‹",-1)])]),_:1},8,["disabled"]))],2),e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-transfer-list")},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-header")},[t.showSelectAll?(e.openBlock(),e.createBlock(rt,{key:0,checked:L(E.value,r.value),indeterminate:T(E.value,r.value),disabled:t.disabled||S(E.value).length===0,onChange:k[3]||(k[3]=$=>q("right",$))},null,8,["checked","indeterminate","disabled"])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-header-count")},e.toDisplayString(w(E.value,r.value)),3),t.titles[1]?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-header-title")},e.toDisplayString(t.titles[1]),3)):e.createCommentVNode("",!0)],2),t.showSearch?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-search")},[e.createVNode(zt,{size:"small","model-value":v.value,placeholder:s.value.searchPlaceholder,"allow-clear":"","onUpdate:modelValue":ae},null,8,["model-value","placeholder"])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-body"),style:e.normalizeStyle(t.listHeight?{height:`${t.listHeight}px`,overflow:"auto"}:void 0)},[B.value.length===0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-empty")},e.toDisplayString(s.value.notFoundContent),3)):(e.openBlock(),e.createElementBlock("ul",{key:1,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-content")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,$=>(e.openBlock(),e.createElementBlock("li",{key:$.key,class:e.normalizeClass(V($,r.value)),onClick:M=>P($,"right")},[e.createVNode(rt,{checked:r.value.includes($.key),disabled:t.disabled||$.disabled,onClick:k[4]||(k[4]=e.withModifiers(()=>{},["stop"])),onChange:()=>P($,"right")},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-item-text")},[e.renderSlot(C.$slots,"item",{item:$,side:"right"},()=>[e.createTextVNode(e.toDisplayString($.title),1)])],2)]),_:2},1032,["checked","disabled","onChange"])],10,wv))),128))],2))],6),t.pagination&&E.value.length>x.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-pagination")},[e.createVNode(Tt,{current:m.value,total:E.value.length,"page-size":x.value,simple:"",onChange:k[5]||(k[5]=$=>m.value=$)},null,8,["current","total","page-size"])],2)):e.createCommentVNode("",!0)],2)],2))}}),Ev=["value","placeholder","rows","disabled"],xv=["aria-selected","onMousedown","onMouseenter"],$v=e.defineComponent({__name:"Mentions",props:{modelValue:{},value:{},defaultValue:{},placeholder:{},prefix:{default:"@"},rows:{default:3},options:{default:()=>[]},placement:{default:"bottom"},disabled:{type:Boolean},size:{},unstyled:{type:Boolean}},emits:["update:modelValue","change","search","select"],setup(t,{emit:n}){const l=t,a=n,{resolvedSize:o,resolvedDisabled:s}=Ye(l,{}),u=e.ref(l.modelValue??l.value??l.defaultValue??"");e.watch(()=>l.modelValue??l.value,N=>{N!==void 0&&(u.value=N)});const c=e.computed(()=>l.modelValue??l.value??u.value),i=e.ref(!1),r=e.ref(""),d=e.ref(""),v=e.ref(0),g=e.ref(0),m=e.ref(null),h=e.ref(null),p=e.computed(()=>Array.isArray(l.prefix)?l.prefix:[l.prefix]);function b(N){const B=N.target,w=B.value;u.value=w,a("update:modelValue",w),a("change",w);const S=B.selectionStart??w.length,L=w.slice(0,S);for(const T of p.value){const P=L.lastIndexOf(T);if(P>=0){const q=P>0?L[P-1]:" ";if(q===" "||q===`
22
- `||P===0){const _=L.slice(P+T.length);if(!_.includes(" ")){d.value=T,r.value=_,v.value=P,i.value=!0,g.value=0,a("search",_,T);return}}}}i.value=!1}const y=e.computed(()=>l.options.filter(N=>!r.value||(N.label??N.value).toLowerCase().includes(r.value.toLowerCase())));function E(N){if(N.disabled)return;const B=c.value,w=B.slice(0,v.value),S=B.slice(v.value+d.value.length+r.value.length),L=`${d.value}${N.value} `,T=w+L+S;u.value=T,a("update:modelValue",T),a("change",T),a("select",N,d.value),i.value=!1,e.nextTick(()=>{if(m.value){const P=w.length+L.length;m.value.focus(),m.value.setSelectionRange(P,P)}})}function z(N){!i.value||y.value.length===0||(N.key==="ArrowDown"?(N.preventDefault(),g.value=(g.value+1)%y.value.length):N.key==="ArrowUp"?(N.preventDefault(),g.value=(g.value-1+y.value.length)%y.value.length):N.key==="Enter"?(N.preventDefault(),E(y.value[g.value])):N.key==="Escape"&&(i.value=!1))}function x(N){h.value&&!h.value.contains(N.target)&&m.value&&!m.value.contains(N.target)&&(i.value=!1)}e.onMounted(()=>{document.addEventListener("mousedown",x)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",x)});const f=e.computed(()=>l.unstyled?"":["sg-mentions",`sg-mentions-${o.value}`,s.value?"sg-mentions-disabled":""].filter(Boolean).join(" "));return(N,B)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(f.value)},[e.createElementVNode("textarea",{ref_key:"textareaRef",ref:m,class:e.normalizeClass(t.unstyled?"":"sg-input sg-textarea"),value:c.value,placeholder:t.placeholder,rows:t.rows,disabled:e.unref(s),onInput:b,onKeydown:z},null,42,Ev),i.value&&y.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:h,class:e.normalizeClass(t.unstyled?"":`sg-mentions-dropdown sg-mentions-dropdown-${t.placement}`),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(w,S)=>(e.openBlock(),e.createElementBlock("div",{key:w.value,class:e.normalizeClass(t.unstyled?"":["sg-mentions-option",S===g.value?"sg-mentions-option-active":"",w.disabled?"sg-mentions-option-disabled":""].filter(Boolean).join(" ")),role:"option","aria-selected":S===g.value,onMousedown:e.withModifiers(L=>E(w),["prevent"]),onMouseenter:L=>g.value=S},e.toDisplayString(w.label??w.value),43,xv))),128))],2)):e.createCommentVNode("",!0)],2))}});function ra(t){for(const n of t)if(!(n.type===e.Comment||n.type===e.Text)){if(n.type===e.Fragment&&Array.isArray(n.children)){const l=ra(n.children);if(l)return l;continue}return n}return null}const lt=e.defineComponent({name:"SgTransition",props:{visible:{type:Boolean,required:!0},name:{type:String,default:"sg-fade"},duration:{type:Number,default:200},enterFrom:{type:String,default:void 0},enterTo:{type:String,default:void 0},leaveFrom:{type:String,default:void 0},leaveTo:{type:String,default:void 0},unmountOnExit:{type:Boolean,default:!0},onAfterEnter:{type:Function,default:void 0},onAfterLeave:{type:Function,default:void 0}},emits:["afterEnter","afterLeave"],setup(t,{slots:n,emit:l}){const a=e.ref(t.visible),o=e.ref("idle");let s;const u=e.computed(()=>t.enterFrom&&t.enterTo?{from:t.enterFrom,active:`${t.name}-enter-active`,to:t.enterTo}:{from:`${t.name}-enter-from`,active:`${t.name}-enter-active`,to:`${t.name}-enter-to`}),c=e.computed(()=>t.leaveFrom&&t.leaveTo?{from:t.leaveFrom,active:`${t.name}-leave-active`,to:t.leaveTo}:{from:`${t.name}-leave-from`,active:`${t.name}-leave-active`,to:`${t.name}-leave-to`});e.watch(()=>t.visible,(r,d)=>{r!==d&&(s&&clearTimeout(s),r?(a.value=!0,o.value="enter",requestAnimationFrame(()=>{requestAnimationFrame(()=>{o.value="enter-active"})}),s=setTimeout(()=>{var v;o.value="idle",l("afterEnter"),(v=t.onAfterEnter)==null||v.call(t)},t.duration)):(o.value="leave",requestAnimationFrame(()=>{requestAnimationFrame(()=>{o.value="leave-active"})}),s=setTimeout(()=>{var v;o.value="idle",t.unmountOnExit&&(a.value=!1),l("afterLeave"),(v=t.onAfterLeave)==null||v.call(t)},t.duration)))}),e.onBeforeUnmount(()=>{s&&clearTimeout(s)});const i=e.computed(()=>{switch(o.value){case"enter":return`${u.value.from} ${u.value.active}`;case"enter-active":return`${u.value.to} ${u.value.active}`;case"leave":return`${c.value.from} ${c.value.active}`;case"leave-active":return`${c.value.to} ${c.value.active}`;default:return""}});return()=>{var g;if(!a.value&&t.unmountOnExit)return null;const r=((g=n.default)==null?void 0:g.call(n))??[],d=ra(r);if(!d)return null;const v=i.value;return v?e.cloneVNode(d,{class:v}):e.cloneVNode(d)}}}),Nv=["aria-labelledby"],Vv={key:1},Dv={key:2},zv=["aria-label"],Tv=["aria-labelledby"],Mv={class:"sg-modal-header"},Lv={key:0,class:"sg-modal-footer"},Fv={key:1,class:"sg-modal-footer"},Av=e.defineComponent({__name:"Modal",props:{open:{type:Boolean},title:{},footer:{},width:{default:520},okHandler:{},okText:{},cancelText:{},okType:{default:"primary"},confirmLoading:{type:Boolean,default:!1},unstyled:{type:Boolean}},emits:["close","ok"],setup(t,{emit:n}){let l=0;function a(){return`sg-modal-${++l}`}const o=t,s=n,u=e.getCurrentInstance(),c=e.computed(()=>{var N;return!!((N=u==null?void 0:u.slots)!=null&&N.footer)}),i=Ee(),r=e.computed(()=>{var N,B;return o.okText??((B=(N=i.value.locale)==null?void 0:N.modal)==null?void 0:B.okText)??"OK"}),d=e.computed(()=>{var N,B;return o.cancelText??((B=(N=i.value.locale)==null?void 0:N.modal)==null?void 0:B.cancelText)??"Cancel"}),v=e.computed(()=>{var N,B;return((B=(N=i.value.locale)==null?void 0:N.modal)==null?void 0:B.closeAriaLabel)??"Close"}),g=a(),m=`${g}-title`,h=`${g}-body`,p=Ft(e.toRef(o,"open")),b=e.computed(()=>({width:typeof o.width=="number"?`${o.width}px`:o.width}));function y(){s("close")}function E(){var N;s("ok"),(N=o.okHandler)==null||N.call(o)}function z(N){N.key==="Escape"&&y()}e.watch(()=>o.open,N=>{N?document.addEventListener("keydown",z):document.removeEventListener("keydown",z)},{immediate:!0}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",z)});const x=e.computed(()=>o.footer!=="none"&&!c.value&&!!o.okHandler),f=e.computed(()=>c.value&&o.footer!=="none");return(N,B)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[t.unstyled?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"trapRef",ref:p,role:"dialog","aria-modal":"true","aria-labelledby":t.title?m:void 0,"aria-describedby":h},[t.title?(e.openBlock(),e.createElementBlock("div",{key:0,id:m},e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{id:h},[e.renderSlot(N.$slots,"default")]),f.value?(e.openBlock(),e.createElementBlock("div",Vv,[e.renderSlot(N.$slots,"footer")])):x.value?(e.openBlock(),e.createElementBlock("div",Dv,[e.createVNode(Xe,{unstyled:!0,onClick:y},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value),1)]),_:1}),e.createVNode(Xe,{unstyled:!0,onClick:E},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button","aria-label":v.value,onClick:y},"x",8,zv)],8,Nv)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createBlock(lt,{key:1,visible:t.open,name:"sg-fade","unmount-on-exit":!0},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"sg-modal-mask",onClick:y},[e.createVNode(lt,{visible:t.open,name:"sg-zoom","unmount-on-exit":!0},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"trapRef",ref:p,class:"sg-modal",style:e.normalizeStyle(b.value),role:"dialog","aria-modal":"true","aria-labelledby":t.title?m:void 0,"aria-describedby":h,onClick:B[0]||(B[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Mv,[t.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-modal-title",id:m},e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createVNode(Xe,{type:"text",class:"sg-modal-close","aria-label":v.value,onClick:y},{default:e.withCtx(()=>[...B[1]||(B[1]=[e.createTextVNode(" × ",-1)])]),_:1},8,["aria-label"])]),e.createElementVNode("div",{class:"sg-modal-body",id:h},[e.renderSlot(N.$slots,"default")]),f.value?(e.openBlock(),e.createElementBlock("div",Lv,[e.renderSlot(N.$slots,"footer")])):x.value?(e.openBlock(),e.createElementBlock("div",Fv,[e.createVNode(Xe,{disabled:t.confirmLoading,onClick:y},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value),1)]),_:1},8,["disabled"]),e.createVNode(Xe,{type:t.okType,loading:t.confirmLoading,onClick:E},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1},8,["type","loading"])])):e.createCommentVNode("",!0)],12,Tv)]),_:3},8,["visible"])])]),_:3},8,["visible"]))]))}}),Pv=["aria-labelledby"],Rv={key:1},Iv=["aria-label"],_v={class:"sg-drawer-root"},Kv=["aria-labelledby"],Hv={key:0,class:"sg-drawer-header"},Ov={key:1,class:"sg-drawer-footer"},jv=e.defineComponent({__name:"Drawer",props:{open:{type:Boolean},title:{},placement:{default:"right"},width:{default:378},height:{default:378},closable:{type:Boolean,default:!0},mask:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},unstyled:{type:Boolean}},emits:["close"],setup(t,{emit:n}){let l=0;function a(){return`sg-drawer-${++l}`}const o=t,s=n,u={left:"sg-slide-left",right:"sg-slide-right",top:"sg-slide-down",bottom:"sg-slide-up"},c=a(),i=`${c}-title`,r=`${c}-body`,d=Ft(e.toRef(o,"open")),v=e.computed(()=>o.placement==="left"||o.placement==="right"),g=e.computed(()=>{const f=typeof o.width=="number"?`${o.width}px`:o.width,N=typeof o.height=="number"?`${o.height}px`:o.height;return v.value?{width:f,height:"100%"}:{width:"100%",height:N}}),m=e.computed(()=>u[o.placement]??"sg-slide-right");function h(){s("close")}function p(f){f.key==="Escape"&&h()}e.watch(()=>o.open,f=>{f?document.addEventListener("keydown",p):document.removeEventListener("keydown",p)},{immediate:!0}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",p)});const b=e.computed(()=>["sg-drawer",`sg-drawer-${o.placement}`].join(" ")),y=e.getCurrentInstance(),E=e.computed(()=>{var f;return!!((f=y==null?void 0:y.slots)!=null&&f.footer)}),z=Ee(),x=e.computed(()=>{var f,N;return((N=(f=z.value.locale)==null?void 0:f.drawer)==null?void 0:N.closeAriaLabel)??"Close"});return(f,N)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[t.unstyled?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"trapRef",ref:d,role:"dialog","aria-modal":"true","aria-labelledby":t.title?i:void 0,"aria-describedby":r},[t.title?(e.openBlock(),e.createElementBlock("div",{key:0,id:i},e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{id:r},[e.renderSlot(f.$slots,"default")]),E.value?(e.openBlock(),e.createElementBlock("div",Rv,[e.renderSlot(f.$slots,"footer")])):e.createCommentVNode("",!0),t.closable?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button","aria-label":x.value,onClick:h}," × ",8,Iv)):e.createCommentVNode("",!0)],8,Pv)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createBlock(lt,{key:1,visible:t.open,name:"sg-fade",duration:300},{default:e.withCtx(()=>[e.createElementVNode("div",_v,[t.mask?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-drawer-mask",onClick:N[0]||(N[0]=B=>t.maskClosable?h():void 0)})):e.createCommentVNode("",!0),e.createVNode(lt,{visible:t.open,name:m.value,duration:300},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"trapRef",ref:d,class:e.normalizeClass(b.value),style:e.normalizeStyle(g.value),role:"dialog","aria-modal":"true","aria-labelledby":t.title?i:void 0,"aria-describedby":r},[t.title||t.closable?(e.openBlock(),e.createElementBlock("div",Hv,[t.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-drawer-title",id:i},e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.closable?(e.openBlock(),e.createBlock(Xe,{key:1,type:"text",class:"sg-drawer-close","aria-label":x.value,onClick:h},{default:e.withCtx(()=>[...N[1]||(N[1]=[e.createTextVNode(" × ",-1)])]),_:1},8,["aria-label"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"sg-drawer-body",id:r},[e.renderSlot(f.$slots,"default")]),E.value?(e.openBlock(),e.createElementBlock("div",Ov,[e.renderSlot(f.$slots,"footer")])):e.createCommentVNode("",!0)],14,Kv)]),_:3},8,["visible","name"])])]),_:3},8,["visible"]))]))}}),Jt=new Set;let it=[],Yv=0;function vl(){const t=[...it];for(const n of[...Jt])n(t)}function yt(t){const n=t.key??`sg-notif-${++Yv}`,l={...t,id:n};it=[...it,l],vl();const a=t.duration??4500;a>0&&setTimeout(()=>ia(n),a)}function ia(t){it=it.filter(n=>n.id!==t),vl()}const ca={open:t=>yt(t),success:(t,n)=>yt({type:"success",message:t,description:n}),error:(t,n)=>yt({type:"error",message:t,description:n}),warning:(t,n)=>yt({type:"warning",message:t,description:n}),info:(t,n)=>yt({type:"info",message:t,description:n}),destroy:()=>{it=[],vl()}};function Wv(){return ca}const Dl={success:"✓",error:"✕",warning:"⚠",info:"ℹ"},Uv=e.defineComponent({name:"SgNotificationContainer",props:{placement:{type:String,default:"topRight"},unstyled:{type:Boolean,default:!1}},setup(t){const n=e.ref([]),l=u=>{n.value=u};e.onMounted(()=>{Jt.add(l),n.value=[...it]}),e.onBeforeUnmount(()=>{Jt.delete(l)});const a=e.computed(()=>n.value.filter(u=>(u.placement??"topRight")===t.placement)),o=e.computed(()=>t.unstyled?void 0:`sg-notification-container sg-notification-${t.placement}`),s=u=>{var c;ia(u.id),(c=u.onClose)==null||c.call(u)};return()=>a.value.length===0?null:e.h("div",{class:o.value},a.value.map(u=>{const c=u.type??"info",i=t.placement.includes("Right")?"sg-slide-right":"sg-slide-left",r=t.unstyled?e.h("div",{role:"alert"},[e.h("span",Dl[c]),e.h("span",u.message),u.description?e.h("div",u.description):null,e.h("button",{type:"button",onClick:()=>s(u)},"×")]):e.h("div",{class:`sg-notification sg-notification-${c}`,role:"alert"},[e.h("div",{class:"sg-notification-icon"},Dl[c]),e.h("div",{class:"sg-notification-content"},[e.h("div",{class:"sg-notification-message"},u.message),u.description?e.h("div",{class:"sg-notification-description"},u.description):null]),e.h("button",{class:"sg-notification-close",type:"button","aria-label":"Close",onClick:()=>s(u)},"×")]);return e.h(lt,{key:u.id,visible:!0,name:i,unmountOnExit:!1},{default:()=>e.h("div",r)})}))}}),qv=["aria-describedby"],Xv=["id"],Gv={key:0},Jv=["id"],Zv={class:"sg-popconfirm-inner"},Qv={class:"sg-popconfirm-title"},eg={key:0,class:"sg-popconfirm-description"},tg={class:"sg-popconfirm-buttons"},lg=e.defineComponent({__name:"Popconfirm",props:{title:{},description:{},okText:{},cancelText:{},placement:{default:"top"},disabled:{type:Boolean,default:!1},unstyled:{type:Boolean}},emits:["confirm","cancel"],setup(t,{emit:n}){let l=0;function a(){return`sg-popconfirm-${++l}`}const o=t,s=n,u=Ee(),c=e.computed(()=>{var E,z;return o.okText??((z=(E=u.value.locale)==null?void 0:E.popconfirm)==null?void 0:z.okText)??"Yes"}),i=e.computed(()=>{var E,z;return o.cancelText??((z=(E=u.value.locale)==null?void 0:E.popconfirm)==null?void 0:z.cancelText)??"No"}),r=e.ref(!1),d=e.ref(null),v=Ft(r),g=a();function m(){o.disabled||(r.value=!r.value)}function h(){r.value=!1,s("confirm")}function p(){r.value=!1,s("cancel")}function b(E){d.value&&!d.value.contains(E.target)&&(r.value=!1)}e.watch(r,E=>{E?document.addEventListener("mousedown",b):document.removeEventListener("mousedown",b)},{immediate:!0}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",b)});const y=e.computed(()=>`sg-popconfirm sg-popconfirm-${o.placement}`);return(E,z)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:d,class:e.normalizeClass(t.unstyled?"":"sg-popconfirm-wrapper"),style:e.normalizeStyle(t.unstyled?{position:"relative",display:"inline-block"}:void 0)},[e.createElementVNode("div",{"aria-describedby":r.value?e.unref(g):void 0,style:{display:"inline-block"},onClick:m},[e.renderSlot(E.$slots,"default")],8,qv),t.unstyled?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[r.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:e.unref(g),role:"alertdialog"},[e.createElementVNode("div",null,e.toDisplayString(t.title),1),t.description?(e.openBlock(),e.createElementBlock("div",Gv,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",onClick:p},e.toDisplayString(i.value),1),e.createElementVNode("button",{type:"button",onClick:h},e.toDisplayString(c.value),1)],8,Xv)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createBlock(lt,{key:1,visible:r.value,name:"sg-fade"},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"trapRef",ref:v,id:e.unref(g),role:"alertdialog",class:e.normalizeClass(y.value)},[z[1]||(z[1]=e.createElementVNode("div",{class:"sg-popconfirm-arrow"},null,-1)),e.createElementVNode("div",Zv,[e.createElementVNode("div",Qv,[z[0]||(z[0]=e.createElementVNode("span",{class:"sg-popconfirm-icon"},"⚠",-1)),e.createTextVNode(" "+e.toDisplayString(t.title),1)]),t.description?(e.openBlock(),e.createElementBlock("div",eg,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0),e.createElementVNode("div",tg,[e.createVNode(Xe,{size:"small",onClick:p},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value),1)]),_:1}),e.createVNode(Xe,{size:"small",type:"primary",onClick:h},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1})])])],10,Jv)]),_:1},8,["visible"]))],6))}}),ag=["aria-describedby"],ng=["id"],og=["aria-describedby"],sg=["id"],rg={class:"sg-tooltip-content"},ig=e.defineComponent({__name:"Tooltip",props:{title:{default:""},placement:{default:"top"},unstyled:{type:Boolean}},setup(t){let n=0;function l(){return`sg-tooltip-${++n}`}const a=e.ref(!1),o=l();function s(){a.value=!0}function u(){a.value=!1}return(c,i)=>t.unstyled?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(void 0),style:{position:"relative",display:"inline-block"},onMouseenter:s,onMouseleave:u},[e.createElementVNode("span",{"aria-describedby":a.value?e.unref(o):void 0,style:{display:"inline-block"},onFocusin:s,onFocusout:u},[e.renderSlot(c.$slots,"default")],40,ag),a.value?(e.openBlock(),e.createElementBlock("span",{key:0,id:e.unref(o),role:"tooltip"},[e.renderSlot(c.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])],8,ng)):e.createCommentVNode("",!0)],32)):(e.openBlock(),e.createElementBlock("span",{key:1,class:"sg-tooltip-wrapper","aria-describedby":a.value?e.unref(o):void 0,onMouseenter:s,onMouseleave:u},[e.createElementVNode("span",{style:{display:"inline-block"},onFocusin:s,onFocusout:u},[e.renderSlot(c.$slots,"default")],32),e.createVNode(lt,{visible:a.value,name:"sg-fade"},{default:e.withCtx(()=>[e.createElementVNode("span",{id:e.unref(o),role:"tooltip",class:e.normalizeClass(`sg-tooltip sg-tooltip-${t.placement}`)},[e.createElementVNode("span",rg,[e.renderSlot(c.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])]),i[0]||(i[0]=e.createElementVNode("span",{class:"sg-tooltip-arrow"},null,-1))],10,sg)]),_:3},8,["visible"])],40,og))}}),cg=["aria-valuenow"],ug={key:1},dg=["aria-valuenow"],mg=["width","height","viewBox"],pg=["cx","cy","r","stroke-width"],vg=["cx","cy","r","stroke-width","stroke-dasharray","stroke-dashoffset","transform"],gg={key:0,class:"sg-progress-circle-text"},fg=["aria-valuenow"],hg={class:"sg-progress-outer"},yg={key:0,class:"sg-progress-text"},kg=e.defineComponent({__name:"Progress",props:{percent:{},type:{default:"line"},status:{default:"normal"},showInfo:{type:Boolean,default:!0},strokeWidth:{},strokeColor:{},size:{},width:{default:120},unstyled:{type:Boolean}},setup(t){const n=t,{resolvedSize:l}=Ye({size:void 0},{}),a=e.computed(()=>n.size??l.value),o=e.computed(()=>a.value==="small"?"small":"default"),s=e.computed(()=>Math.min(100,Math.max(0,n.percent))),u=e.computed(()=>s.value>=100&&n.status==="normal"?"success":n.status),c=e.computed(()=>["sg-progress","sg-progress-line",`sg-progress-${u.value}`,`sg-progress-${o.value}`].join(" ")),i=e.computed(()=>["sg-progress","sg-progress-circle",`sg-progress-${u.value}`].join(" ")),r=e.computed(()=>n.strokeWidth??(o.value==="small"?6:8)),d=e.computed(()=>{const v=n.strokeWidth??6,g=(n.width-v)/2,m=2*Math.PI*g,h=m-s.value/100*m;return{sw:v,radius:g,circumference:m,offset:h}});return(v,g)=>t.unstyled?(e.openBlock(),e.createElementBlock("div",{key:0,role:"progressbar","aria-valuenow":s.value},[t.type==="line"?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({width:"100%",height:`${t.strokeWidth??8}px`,background:"#eee"})},[e.createElementVNode("div",{style:e.normalizeStyle({width:`${s.value}%`,height:"100%",background:t.strokeColor??"#1677ff"})},null,4)],4)):(e.openBlock(),e.createElementBlock("span",ug,e.toDisplayString(s.value)+"%",1))],8,cg)):t.type==="circle"?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(i.value),role:"progressbar","aria-valuenow":s.value},[(e.openBlock(),e.createElementBlock("svg",{width:t.width,height:t.width,viewBox:`0 0 ${t.width} ${t.width}`},[e.createElementVNode("circle",{class:"sg-progress-circle-trail",cx:t.width/2,cy:t.width/2,r:d.value.radius,"stroke-width":d.value.sw,fill:"none"},null,8,pg),e.createElementVNode("circle",{class:"sg-progress-circle-path",cx:t.width/2,cy:t.width/2,r:d.value.radius,"stroke-width":d.value.sw,fill:"none","stroke-dasharray":d.value.circumference,"stroke-dashoffset":d.value.offset,"stroke-linecap":"round",style:e.normalizeStyle(t.strokeColor?{stroke:t.strokeColor}:void 0),transform:`rotate(-90 ${t.width/2} ${t.width/2})`},null,12,vg)],8,mg)),t.showInfo?(e.openBlock(),e.createElementBlock("span",gg,e.toDisplayString(s.value)+"%",1)):e.createCommentVNode("",!0)],10,dg)):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(c.value),role:"progressbar","aria-valuenow":s.value},[e.createElementVNode("div",hg,[e.createElementVNode("div",{class:"sg-progress-inner",style:e.normalizeStyle({height:`${r.value}px`})},[e.createElementVNode("div",{class:"sg-progress-bg",style:e.normalizeStyle({width:`${s.value}%`,...t.strokeColor?{background:t.strokeColor}:{}})},null,4)],4)]),t.showInfo?(e.openBlock(),e.createElementBlock("span",yg,e.toDisplayString(s.value)+"%",1)):e.createCommentVNode("",!0)],10,fg))}}),bg={key:0,role:"status","aria-live":"polite"},Bg={key:0},Cg={key:1},wg={class:"sg-result-title"},Sg={key:0,class:"sg-result-subtitle"},Eg={key:1,class:"sg-result-extra"},xg={key:2,class:"sg-result-content"},$g=e.defineComponent({__name:"Result",props:{status:{},title:{},subTitle:{},unstyled:{type:Boolean}},setup(t){const n=t,l=e.useSlots(),a=e.computed(()=>!!l.icon),o=e.computed(()=>!!l.extra),s=e.computed(()=>!!l.default),u={success:"var(--sg-color-success)",error:"var(--sg-color-error)",info:"var(--sg-color-primary)",warning:"var(--sg-color-warning)",404:"var(--sg-color-text-tertiary)",403:"var(--sg-color-text-tertiary)",500:"var(--sg-color-text-tertiary)"},c=e.computed(()=>u[n.status]),i=e.computed(()=>`sg-result sg-result-${n.status}`),r=e.defineComponent({name:"SgResultDefaultIcon",props:{status:{type:String,required:!0}},setup(d){return()=>{const v=d.status,g={viewBox:"64 64 896 896",width:"72",height:"72",fill:"currentColor"};return v==="success"?e.h("svg",g,[e.h("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"})]):v==="error"?e.h("svg",g,[e.h("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"})]):v==="info"?e.h("svg",g,[e.h("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"})]):v==="warning"?e.h("svg",g,[e.h("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"})]):e.h("svg",{viewBox:"0 0 252 294",width:"252",height:"294",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.h("text",{x:"50%",y:"50%","dominant-baseline":"middle","text-anchor":"middle",fill:"currentColor","font-size":"80","font-weight":"bold",opacity:"0.25"},v)])}}});return(d,v)=>t.unstyled?(e.openBlock(),e.createElementBlock("div",bg,[e.createElementVNode("div",null,[a.value?e.renderSlot(d.$slots,"icon",{key:0}):(e.openBlock(),e.createBlock(e.unref(r),{key:1,status:t.status},null,8,["status"]))]),e.createElementVNode("div",null,e.toDisplayString(t.title),1),t.subTitle?(e.openBlock(),e.createElementBlock("div",Bg,e.toDisplayString(t.subTitle),1)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("div",Cg,[e.renderSlot(d.$slots,"extra")])):e.createCommentVNode("",!0),e.renderSlot(d.$slots,"default")])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(i.value),role:"status","aria-live":"polite"},[e.createElementVNode("div",{class:"sg-result-icon",style:e.normalizeStyle({color:c.value})},[a.value?e.renderSlot(d.$slots,"icon",{key:0}):(e.openBlock(),e.createBlock(e.unref(r),{key:1,status:t.status},null,8,["status"]))],4),e.createElementVNode("div",wg,e.toDisplayString(t.title),1),t.subTitle?(e.openBlock(),e.createElementBlock("div",Sg,e.toDisplayString(t.subTitle),1)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("div",Eg,[e.renderSlot(d.$slots,"extra")])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",xg,[e.renderSlot(d.$slots,"default")])):e.createCommentVNode("",!0)],2))}}),Ng={key:0,role:"status"},Vg={key:0},Dg={key:1,class:"sg-empty",role:"status"},zg={class:"sg-empty-image"},Tg={key:0,class:"sg-empty-description"},Mg={key:1,class:"sg-empty-footer"},Lg=e.defineComponent({__name:"Empty",props:{description:{},unstyled:{type:Boolean}},setup(t){const n=t,l=e.useSlots(),a=Ee(),o=e.computed(()=>{var i,r;return n.description===null?null:n.description!==void 0?n.description:((r=(i=a.value.locale)==null?void 0:i.empty)==null?void 0:r.description)??"No Data"}),s=e.computed(()=>!!l.default),u=e.computed(()=>!!l.image),c=e.defineComponent({name:"SgEmptyDefaultImage",setup(){return()=>e.h("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},[e.h("g",{fill:"none","fill-rule":"evenodd",transform:"translate(0 1)"},[e.h("ellipse",{cx:"32",cy:"33",rx:"32",ry:"7",fill:"currentColor",opacity:"0.08"}),e.h("g",{"fill-rule":"nonzero",stroke:"currentColor","stroke-opacity":"0.25"},[e.h("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),e.h("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35H11.95C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:"currentColor",opacity:"0.08"})])])])}});return(i,r)=>t.unstyled?(e.openBlock(),e.createElementBlock("div",Ng,[e.createElementVNode("div",null,[u.value?e.renderSlot(i.$slots,"image",{key:0}):(e.openBlock(),e.createBlock(e.unref(c),{key:1}))]),o.value!==null?(e.openBlock(),e.createElementBlock("p",Vg,e.toDisplayString(o.value),1)):e.createCommentVNode("",!0),e.renderSlot(i.$slots,"default")])):(e.openBlock(),e.createElementBlock("div",Dg,[e.createElementVNode("div",zg,[u.value?e.renderSlot(i.$slots,"image",{key:0}):(e.openBlock(),e.createBlock(e.unref(c),{key:1}))]),o.value!==null?(e.openBlock(),e.createElementBlock("p",Tg,e.toDisplayString(o.value),1)):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",Mg,[e.renderSlot(i.$slots,"default")])):e.createCommentVNode("",!0)]))}}),Fg=["aria-label"],Ag=["aria-label"],Pg={key:0,class:"sg-skeleton-header"},Rg={class:"sg-skeleton-content"},Ig={key:1,class:"sg-skeleton-paragraph"},_g=e.defineComponent({__name:"Skeleton",props:{active:{type:Boolean,default:!1},avatar:{type:[Boolean,Object]},title:{type:[Boolean,Object],default:!0},paragraph:{type:[Boolean,Object],default:!0},loading:{type:Boolean,default:!0},unstyled:{type:Boolean}},setup(t){const n=t,l=e.computed(()=>typeof n.avatar=="object"?n.avatar.size??40:40),a=e.computed(()=>typeof n.avatar=="object"?n.avatar.shape??"circle":"circle"),o=e.computed(()=>typeof n.title=="object"?n.title.width??"38%":"38%"),s=e.computed(()=>typeof n.paragraph=="object"?n.paragraph.rows??3:3),u=e.computed(()=>typeof n.paragraph=="object"?n.paragraph.width:void 0);function c(g,m){const h=u.value;return h&&h[g]!==void 0?h[g]:g===m-1?"61%":"100%"}function i(g){return typeof g=="number"?`${g}px`:g}const r=Ee(),d=e.computed(()=>{var g,m;return((m=(g=r.value.locale)==null?void 0:g.skeleton)==null?void 0:m.loading)??"Loading"}),v=e.computed(()=>["sg-skeleton",n.active?"sg-skeleton-active":"",n.avatar?"sg-skeleton-with-avatar":""].filter(Boolean).join(" "));return(g,m)=>t.loading?t.unstyled?(e.openBlock(),e.createElementBlock("div",{key:1,"aria-busy":"true","aria-label":d.value},[t.avatar?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({width:`${l.value}px`,height:`${l.value}px`})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",null,[t.title?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({width:i(o.value),height:"16px"})},null,4)):e.createCommentVNode("",!0),t.paragraph?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(s.value,h=>(e.openBlock(),e.createElementBlock("div",{key:h,style:e.normalizeStyle({width:i(c(h-1,s.value)),height:"16px"})},null,4))),128)):e.createCommentVNode("",!0)])],8,Fg)):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(v.value),"aria-busy":"true","aria-label":d.value},[t.avatar?(e.openBlock(),e.createElementBlock("div",Pg,[e.createElementVNode("span",{class:e.normalizeClass(["sg-skeleton-avatar",`sg-skeleton-avatar-${a.value}`]),style:e.normalizeStyle({width:`${l.value}px`,height:`${l.value}px`})},null,6)])):e.createCommentVNode("",!0),e.createElementVNode("div",Rg,[t.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-skeleton-title",style:e.normalizeStyle({width:i(o.value)})},null,4)):e.createCommentVNode("",!0),t.paragraph?(e.openBlock(),e.createElementBlock("ul",Ig,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,h=>(e.openBlock(),e.createElementBlock("li",{key:h,style:e.normalizeStyle({width:i(c(h-1,s.value))})},null,4))),128))])):e.createCommentVNode("",!0)])],10,Ag)):e.renderSlot(g.$slots,"default",{key:0})}}),Kg={key:0},Hg={role:"tablist"},Og=["aria-selected","disabled","onClick"],jg={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},Yg={role:"tabpanel"},Wg={class:"sg-tabs-nav",role:"tablist"},Ug=["aria-selected","tabindex","onClick","onKeydown"],qg={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},Xg={class:"sg-tabs-content",role:"tabpanel"},Gg=e.defineComponent({__name:"Tabs",props:{type:{default:"card"},items:{},activeKey:{},defaultActiveKey:{},size:{},unstyled:{type:Boolean}},emits:["change"],setup(t,{emit:n}){var g;const l=t,a=n,{resolvedSize:o}=Ye({size:void 0},{}),s=e.computed(()=>l.size??o.value),u=e.ref(l.activeKey??l.defaultActiveKey??((g=l.items[0])==null?void 0:g.key)??""),c=e.computed(()=>l.activeKey??u.value),i=e.computed(()=>l.items.find(m=>m.key===c.value));function r(m,h,p){h||p||(u.value=m,a("change",m))}function d(m,h){const p=l.items.filter(y=>!y.disabled&&!y.loading);if(p.length===0)return;const b=p.findIndex(y=>y.key===h.key);if(m.key==="ArrowRight"||m.key==="ArrowDown"){m.preventDefault();const y=p[(b+1)%p.length];y&&r(y.key)}else if(m.key==="ArrowLeft"||m.key==="ArrowUp"){m.preventDefault();const y=p[(b-1+p.length)%p.length];y&&r(y.key)}else m.key==="Home"?(m.preventDefault(),r(p[0].key)):m.key==="End"&&(m.preventDefault(),r(p[p.length-1].key))}const v=e.computed(()=>["sg-tabs",`sg-tabs-${s.value}`,l.type==="line"?"sg-tabs-line":"sg-tabs-card"].join(" "));return(m,h)=>t.unstyled?(e.openBlock(),e.createElementBlock("div",Kg,[e.createElementVNode("div",Hg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,p=>(e.openBlock(),e.createElementBlock("button",{key:p.key,type:"button",role:"tab","aria-selected":p.key===c.value,disabled:p.disabled||p.loading,onClick:b=>r(p.key,p.disabled,p.loading)},[e.renderSlot(m.$slots,"tab",{item:p},()=>[e.createTextVNode(e.toDisplayString(p.label),1)]),p.loading?(e.openBlock(),e.createElementBlock("span",jg)):e.createCommentVNode("",!0)],8,Og))),128))]),e.createElementVNode("div",Yg,[i.value?e.renderSlot(m.$slots,"panel",{key:0,item:i.value},()=>[e.createTextVNode(e.toDisplayString(i.value.content),1)]):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"default",{activeKey:c.value})])])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(v.value)},[e.createElementVNode("div",Wg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,p=>(e.openBlock(),e.createElementBlock("div",{key:p.key,role:"tab","aria-selected":p.key===c.value,class:e.normalizeClass(["sg-tabs-tab",p.key===c.value?"sg-tabs-tab-active":"",p.disabled?"sg-tabs-tab-disabled":"",p.loading?"sg-tabs-tab-loading":""]),tabindex:p.key===c.value?0:-1,onClick:b=>r(p.key,p.disabled,p.loading),onKeydown:b=>d(b,p)},[e.renderSlot(m.$slots,"tab",{item:p},()=>[e.createTextVNode(e.toDisplayString(p.label),1)]),p.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",qg)):e.createCommentVNode("",!0)],42,Ug))),128))]),e.createElementVNode("div",Xg,[i.value?e.renderSlot(m.$slots,"panel",{key:0,item:i.value},()=>[e.createTextVNode(e.toDisplayString(i.value.content),1)]):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"default",{activeKey:c.value})])],2))}});function Zt(t,n,l,a=[]){var o;for(const s of t)if(s.type!=="divider"){if(s.type==="group"){s.children&&Zt(s.children,n,l,a);continue}s.disabled||(a.push(s),l==="inline"&&((o=s.children)!=null&&o.length)&&n.includes(s.key)&&Zt(s.children,n,l,a))}return a}function gt(t,n){for(const l of t){if(l.key===n&&l.type!=="divider"&&l.type!=="group")return l;if(l.children){const a=gt(l.children,n);if(a)return a}}return null}function Qt(t,n,l=null){for(const a of t){if(a.key===n)return l;if(a.children){const o=a.type==="group"?l:a.key,s=Qt(a.children,n,o);if(s!==null)return s}}return null}const Dt=e.defineComponent({name:"SgMenuItemStyled",props:{item:{type:Object,required:!0},mode:{type:String,required:!0},selectedKeys:{type:Array,required:!0},openKeys:{type:Array,required:!0},activeKey:{type:String,required:!0},inlineCollapsed:{type:Boolean,default:!1},depth:{type:Number,required:!0},unstyled:{type:Boolean,default:!1},onSelect:{type:Function,required:!0},onToggleOpen:{type:Function,required:!0},onFocusKey:{type:Function,required:!0}},setup(t){const n=e.ref(!1);let l;e.onBeforeUnmount(()=>l&&clearTimeout(l));const a=e.computed(()=>!!(t.item.children&&t.item.children.length>0)),o=e.computed(()=>t.selectedKeys.includes(t.item.key)),s=e.computed(()=>t.openKeys.includes(t.item.key)),u=e.computed(()=>t.mode!=="inline"&&a.value),c=e.computed(()=>t.mode==="inline"&&a.value),i=e.computed(()=>["sg-menu-item",o.value&&!a.value?"sg-menu-item-selected":"",t.item.disabled?"sg-menu-item-disabled":"",t.item.danger?"sg-menu-item-danger":"",a.value?"sg-menu-submenu":""].filter(Boolean).join(" ")),r=e.computed(()=>[a.value?"sg-menu-submenu-wrapper":"",u.value&&n.value?"sg-menu-submenu-open":""].filter(Boolean).join(" ")),d=e.computed(()=>t.mode==="inline"&&!t.inlineCollapsed?`${24+t.depth*24}px`:void 0);function v(){!u.value||t.item.disabled||(l&&clearTimeout(l),n.value=!0)}function g(){u.value&&(l=setTimeout(()=>n.value=!1,150))}function m(){if(!t.item.disabled){if(c.value){t.onToggleOpen(t.item.key);return}a.value||t.onSelect(t.item.key)}}return()=>{if(t.item.type==="divider")return e.h("li",{class:"sg-menu-divider",role:"separator"});if(t.item.type==="group")return e.h("li",{class:"sg-menu-group",role:"group"},[e.h("div",{class:"sg-menu-group-title"},t.item.label),e.h("ul",{class:"sg-menu-group-list",role:"menu"},(t.item.children??[]).map(p=>e.h(Dt,{key:p.key,item:p,mode:t.mode,selectedKeys:t.selectedKeys,openKeys:t.openKeys,activeKey:t.activeKey,inlineCollapsed:t.inlineCollapsed,depth:t.depth,unstyled:t.unstyled,onSelect:t.onSelect,onToggleOpen:t.onToggleOpen,onFocusKey:t.onFocusKey})))]);const h=[];if(t.item.label!==void 0){const p=e.h("div",{role:"menuitem","data-menu-key":t.item.key,tabindex:t.activeKey===t.item.key?0:-1,"aria-selected":o.value,"aria-disabled":t.item.disabled||void 0,"aria-haspopup":a.value?"menu":void 0,"aria-expanded":a.value?u.value?n.value:s.value:void 0,class:i.value,style:{paddingLeft:d.value},onClick:m,onFocus:()=>t.onFocusKey(t.item.key)},[t.item.icon!=null?e.h("span",{class:"sg-menu-item-icon","aria-hidden":"true"},t.item.icon):null,t.inlineCollapsed&&t.depth===0?null:e.h("span",{class:"sg-menu-item-label"},t.item.label),a.value?e.h("span",{class:["sg-menu-submenu-arrow",(u.value?n.value:s.value)?"sg-menu-submenu-arrow-open":""].filter(Boolean).join(" ")}):null]);h.push(p)}return c.value&&h.push(e.h("ul",{class:["sg-menu-inline-sub",s.value?"sg-menu-inline-sub-open":""].filter(Boolean).join(" "),role:"menu"},(t.item.children??[]).map(p=>e.h(Dt,{key:p.key,item:p,mode:t.mode,selectedKeys:t.selectedKeys,openKeys:t.openKeys,activeKey:t.activeKey,inlineCollapsed:t.inlineCollapsed,depth:t.depth+1,unstyled:t.unstyled,onSelect:t.onSelect,onToggleOpen:t.onToggleOpen,onFocusKey:t.onFocusKey})))),u.value&&n.value&&h.push(e.h("ul",{class:"sg-menu-popup",role:"menu"},(t.item.children??[]).map(p=>e.h(Dt,{key:p.key,item:p,mode:t.mode,selectedKeys:t.selectedKeys,openKeys:t.openKeys,activeKey:t.activeKey,inlineCollapsed:!1,depth:0,unstyled:t.unstyled,onSelect:t.onSelect,onToggleOpen:t.onToggleOpen,onFocusKey:t.onFocusKey})))),e.h("li",{class:r.value,onMouseenter:v,onMouseleave:g},h)}}}),Jg=e.defineComponent({name:"SgMenu",props:{items:{type:Array,required:!0},mode:{type:String,default:"vertical"},selectedKeys:{type:Array,default:void 0},defaultSelectedKeys:{type:Array,default:()=>[]},openKeys:{type:Array,default:void 0},defaultOpenKeys:{type:Array,default:()=>[]},inlineCollapsed:{type:Boolean,default:!1},theme:{type:String,default:"light"},unstyled:{type:Boolean,default:!1}},emits:["select","openChange"],setup(t,{emit:n}){var b;const l=e.ref(t.selectedKeys??t.defaultSelectedKeys),a=e.ref(t.openKeys??t.defaultOpenKeys),o=e.computed(()=>t.selectedKeys??l.value),s=e.computed(()=>t.openKeys??a.value),u=e.computed(()=>Zt(t.items,s.value,t.mode)),c=o.value.find(y=>u.value.some(E=>E.key===y))??((b=u.value[0])==null?void 0:b.key)??"",i=e.ref(c);function r(y){const E=[y];l.value=E,i.value=y,n("select",{key:y,selectedKeys:E})}function d(y){const E=s.value.includes(y)?s.value.filter(z=>z!==y):[...s.value,y];a.value=E,n("openChange",E)}const v=e.ref(null);function g(y){var z;i.value=y;const E=(z=v.value)==null?void 0:z.querySelector(`[data-menu-key="${CSS.escape(y)}"]`);E==null||E.focus()}function m(y){const E=u.value;if(E.length===0)return;const z=E.findIndex(N=>N.key===i.value),f=((z<0?y===1?-1:0:z)+y+E.length)%E.length;g(E[f].key)}function h(y,E){const z=gt(t.items,y);return z!=null&&z.children?z.children.some(x=>x.key===E):!1}function p(y){var N,B,w,S;const E=u.value;if(E.length===0)return;const z=t.mode==="horizontal",x=z?"ArrowRight":"ArrowDown",f=z?"ArrowLeft":"ArrowUp";switch(y.key){case x:y.preventDefault(),m(1);break;case f:y.preventDefault(),m(-1);break;case"Home":y.preventDefault(),g(E[0].key);break;case"End":y.preventDefault(),g(E[E.length-1].key);break;case"Enter":case" ":{const L=gt(t.items,i.value);if(!L||L.disabled)return;y.preventDefault(),(N=L.children)!=null&&N.length?t.mode==="inline"&&d(L.key):r(L.key);break}case"ArrowRight":{if(z)return;const L=gt(t.items,i.value);if(t.mode==="inline"&&((B=L==null?void 0:L.children)!=null&&B.length))if(y.preventDefault(),!s.value.includes(L.key))d(L.key);else{const T=L.children.find(P=>!P.disabled&&P.type!=="divider");T&&g(T.key)}break}case"ArrowLeft":{if(z)return;const L=gt(t.items,i.value);if(!L)return;if(t.mode==="inline"&&((w=L.children)!=null&&w.length)&&s.value.includes(L.key)){y.preventDefault(),d(L.key);return}const T=Qt(t.items,i.value);T&&h(T,i.value)&&t.mode==="inline"&&(y.preventDefault(),g(T));break}case"Escape":{const L=gt(t.items,i.value),T=Qt(t.items,i.value);T&&t.mode==="inline"&&s.value.includes(T)?(y.preventDefault(),d(T),g(T)):(S=L==null?void 0:L.children)!=null&&S.length&&t.mode==="inline"&&s.value.includes(L.key)&&(y.preventDefault(),d(L.key));break}}}return()=>{const y=t.unstyled?void 0:["sg-menu",`sg-menu-${t.mode}`,`sg-menu-${t.theme}`,t.inlineCollapsed?"sg-menu-collapsed":""].filter(Boolean).join(" ");return e.h("ul",{ref:v,role:"menu","aria-orientation":t.mode==="horizontal"?"horizontal":"vertical",class:y,onKeydown:p},t.items.map(E=>e.h(Dt,{key:E.key,item:E,mode:t.mode,selectedKeys:o.value,openKeys:s.value,activeKey:i.value,inlineCollapsed:t.inlineCollapsed,depth:0,unstyled:t.unstyled,onSelect:r,onToggleOpen:d,onFocusKey:z=>i.value=z})))}}}),Zg=["aria-label"],Qg=["href","onClick"],ef={key:1},tf={key:2},lf=["aria-label"],af=["href","onClick"],nf={key:2,class:"sg-breadcrumb-separator"},of=e.defineComponent({__name:"Breadcrumb",props:{items:{},separator:{default:"/"},unstyled:{type:Boolean}},emits:["itemClick"],setup(t,{emit:n}){const l=n,a=Ee(),o=e.computed(()=>{var u,c;return((c=(u=a.value.locale)==null?void 0:u.breadcrumb)==null?void 0:c.ariaLabel)??"Breadcrumb"});function s(u,c,i){u.href||i.preventDefault(),l("itemClick",u,c)}return(u,c)=>t.unstyled?(e.openBlock(),e.createElementBlock("nav",{key:0,"aria-label":o.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(i,r)=>(e.openBlock(),e.createElementBlock("span",{key:r},[i.href?(e.openBlock(),e.createElementBlock("a",{key:0,href:i.href,onClick:d=>s(i,r,d)},[e.renderSlot(u.$slots,"item",{item:i,index:r},()=>[e.createTextVNode(e.toDisplayString(i.title),1)])],8,Qg)):(e.openBlock(),e.createElementBlock("span",ef,[e.renderSlot(u.$slots,"item",{item:i,index:r},()=>[e.createTextVNode(e.toDisplayString(i.title),1)])])),r<t.items.length-1?(e.openBlock(),e.createElementBlock("span",tf,e.toDisplayString(t.separator),1)):e.createCommentVNode("",!0)]))),128))],8,Zg)):(e.openBlock(),e.createElementBlock("nav",{key:1,class:"sg-breadcrumb","aria-label":o.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(i,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[i.href?(e.openBlock(),e.createElementBlock("a",{key:0,class:"sg-breadcrumb-link",href:i.href,onClick:d=>s(i,r,d)},[e.renderSlot(u.$slots,"item",{item:i,index:r},()=>[e.createTextVNode(e.toDisplayString(i.title),1)])],8,af)):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(r===t.items.length-1?"sg-breadcrumb-current":"sg-breadcrumb-link")},[e.renderSlot(u.$slots,"item",{item:i,index:r},()=>[e.createTextVNode(e.toDisplayString(i.title),1)])],2)),r<t.items.length-1?(e.openBlock(),e.createElementBlock("span",nf,e.toDisplayString(t.separator),1)):e.createCommentVNode("",!0)],64))),128))],8,lf))}}),sf={key:0},rf=["onClick"],cf=["aria-expanded","aria-controls","tabindex"],uf=["id"],df={key:0,class:"sg-dropdown-divider",role:"separator"},mf=["onClick"],pf=e.defineComponent({__name:"Dropdown",props:{items:{type:Array,required:!0},trigger:{type:String,default:"hover"},placement:{type:String,default:"bottomLeft"},disabled:{type:Boolean,default:void 0},unstyled:{type:Boolean,default:!1}},emits:["select"],setup(t,{emit:n}){let l=0;function a(){return`sg-dropdown-${++l}`}const o=t,s=n,{resolvedDisabled:u}=Ye({disabled:void 0},{}),c=e.computed(()=>o.disabled??u.value),i=e.ref(!1),r=e.ref(-1),d=e.ref(null);let v;const g=a();function m(f,N){const B=o.items;let w=f;for(let S=0;S<B.length;S++)if(w=(w+N+B.length)%B.length,!B[w].divider&&!B[w].disabled)return w;return f}function h(){o.trigger!=="hover"||c.value||(v&&clearTimeout(v),i.value=!0)}function p(){o.trigger==="hover"&&(v=setTimeout(()=>i.value=!1,100))}function b(){o.trigger!=="click"||c.value||(i.value=!i.value)}function y(f){f.disabled||(i.value=!1,s("select",f.key))}function E(f){if(!c.value)switch(f.key){case"Enter":case" ":f.preventDefault(),i.value&&r.value>=0&&!o.items[r.value].divider?y(o.items[r.value]):i.value=!i.value;break;case"Escape":f.preventDefault(),i.value=!1;break;case"ArrowDown":f.preventDefault(),i.value?r.value=m(r.value,1):(i.value=!0,r.value=m(-1,1));break;case"ArrowUp":f.preventDefault(),i.value?r.value=m(r.value,-1):(i.value=!0,r.value=m(o.items.length,-1));break;case"Home":i.value&&(f.preventDefault(),r.value=m(-1,1));break;case"End":i.value&&(f.preventDefault(),r.value=m(o.items.length,-1));break}}function z(f){d.value&&!d.value.contains(f.target)&&(i.value=!1)}e.watch(i,f=>{f?document.addEventListener("mousedown",z):(r.value=-1,document.removeEventListener("mousedown",z))},{immediate:!0}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",z),v&&clearTimeout(v)});const x=e.computed(()=>`sg-dropdown sg-dropdown-${o.placement}`);return(f,N)=>t.unstyled?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"wrapperRef",ref:d,style:{position:"relative",display:"inline-block"}},[e.createElementVNode("div",{onClick:b,onMouseenter:h,onMouseleave:p},[e.renderSlot(f.$slots,"default")],32),i.value?(e.openBlock(),e.createElementBlock("div",{key:0,onMouseenter:h,onMouseleave:p},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(B,w)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:B.key},[B.divider?(e.openBlock(),e.createElementBlock("hr",sf)):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:S=>y(B)},[e.renderSlot(f.$slots,"item",{item:B,index:w,focused:w===r.value},()=>[e.createTextVNode(e.toDisplayString(B.label),1)])],8,rf))],64))),128))],32)):e.createCommentVNode("",!0)],512)):(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"wrapperRef",ref:d,class:"sg-dropdown-wrapper",onMouseenter:h,onMouseleave:p},[e.createElementVNode("div",{class:"sg-dropdown-trigger","aria-expanded":i.value,"aria-haspopup":"menu","aria-controls":e.unref(g),tabindex:c.value?-1:0,onClick:b,onKeydown:E},[e.renderSlot(f.$slots,"default")],40,cf),e.createVNode(lt,{visible:i.value,name:"sg-slide-up"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(x.value),role:"menu",id:e.unref(g),onMouseenter:h,onMouseleave:p},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(B,w)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:B.key},[B.divider?(e.openBlock(),e.createElementBlock("div",df)):(e.openBlock(),e.createElementBlock("div",{key:1,role:"menuitem",class:e.normalizeClass(["sg-dropdown-item",B.disabled?"sg-dropdown-item-disabled":"",B.danger?"sg-dropdown-item-danger":"",w===r.value?"sg-dropdown-item-focused":""]),onClick:S=>y(B)},[e.renderSlot(f.$slots,"item",{item:B,index:w,focused:w===r.value},()=>[e.createTextVNode(e.toDisplayString(B.label),1)])],10,mf))],64))),128))],42,uf)]),_:3},8,["visible"])],544))}}),vf={key:0},gf=["data-status","onClick"],ff={key:0},hf=["aria-current","onClick"],yf={class:"sg-steps-item-container"},kf={class:"sg-steps-item-icon"},bf={key:0,class:"sg-steps-icon-custom"},Bf={key:1,class:"sg-steps-icon"},Cf={key:0,viewBox:"64 64 896 896",width:"1em",height:"1em",fill:"currentColor"},wf={key:1,viewBox:"64 64 896 896",width:"1em",height:"1em",fill:"currentColor"},Sf={class:"sg-steps-item-content"},Ef={class:"sg-steps-item-title"},xf={key:0,class:"sg-steps-item-tail"},$f={key:0,class:"sg-steps-item-description"},Nf={key:0,class:"sg-steps-item-tail-vertical"},Vf=e.defineComponent({__name:"Steps",props:{current:{},items:{},direction:{default:"horizontal"},size:{},type:{default:"default"},clickable:{type:Boolean,default:void 0},unstyled:{type:Boolean}},emits:["change"],setup(t,{emit:n}){const l=t,a=n,o=e.useSlots(),s=e.computed(()=>!!o.icon),{resolvedSize:u}=Ye({size:void 0},{}),c=e.computed(()=>l.size??u.value),i=e.computed(()=>c.value==="small"?"small":"default"),r=e.getCurrentInstance(),d=e.computed(()=>{var b;if(l.clickable!==void 0)return l.clickable;const p=(b=r==null?void 0:r.vnode)==null?void 0:b.props;return!!(p&&(p.onChange||p.onChange))});function v(p,b){return b||(p<l.current?"finish":p===l.current?"process":"wait")}const g=e.computed(()=>["sg-steps",`sg-steps-${l.direction}`,`sg-steps-${i.value}`,l.type==="navigation"?"sg-steps-navigation":""].filter(Boolean).join(" "));function m(p,b){return["sg-steps-item",`sg-steps-item-${p}`,b?"sg-steps-item-clickable":""].filter(Boolean).join(" ")}function h(p){d.value&&a("change",p)}return(p,b)=>t.unstyled?(e.openBlock(),e.createElementBlock("div",vf,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(y,E)=>(e.openBlock(),e.createElementBlock("div",{key:E,"data-status":v(E,y.status),onClick:z=>h(E)},[e.createElementVNode("span",null,[e.renderSlot(p.$slots,"icon",{item:y,index:E,status:v(E,y.status)},()=>[e.createTextVNode(e.toDisplayString(y.icon??(v(E,y.status)==="finish"?"✓":E+1)),1)])]),e.createElementVNode("span",null,e.toDisplayString(y.title),1),y.description?(e.openBlock(),e.createElementBlock("span",ff,e.toDisplayString(y.description),1)):e.createCommentVNode("",!0)],8,gf))),128))])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(g.value),role:"list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(y,E)=>(e.openBlock(),e.createElementBlock("div",{key:E,class:e.normalizeClass(m(v(E,y.status),d.value)),"aria-current":v(E,y.status)==="process"?"step":void 0,onClick:z=>h(E)},[e.createElementVNode("div",yf,[e.createElementVNode("div",kf,[s.value||y.icon?(e.openBlock(),e.createElementBlock("span",bf,[e.renderSlot(p.$slots,"icon",{item:y,index:E,status:v(E,y.status)},()=>[e.createTextVNode(e.toDisplayString(y.icon),1)])])):(e.openBlock(),e.createElementBlock("span",Bf,[v(E,y.status)==="finish"?(e.openBlock(),e.createElementBlock("svg",Cf,[...b[0]||(b[0]=[e.createElementVNode("path",{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"},null,-1)])])):v(E,y.status)==="error"?(e.openBlock(),e.createElementBlock("svg",wf,[...b[1]||(b[1]=[e.createElementVNode("path",{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L512 449.8 295.9 191.7c-3-3.6-7.5-5.7-12.3-5.7H203.8c-6.8 0-10.5 7.9-6.1 13.1L460.2 512 197.7 824.9A7.95 7.95 0 00203.8 838h79.8c4.7 0 9.2-2.1 12.3-5.7L512 574.1l216.1 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"},null,-1)])])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(E+1),1)],64))]))]),e.createElementVNode("div",Sf,[e.createElementVNode("div",Ef,[e.createTextVNode(e.toDisplayString(y.title)+" ",1),t.direction==="horizontal"&&E<t.items.length-1?(e.openBlock(),e.createElementBlock("span",xf)):e.createCommentVNode("",!0)]),y.description?(e.openBlock(),e.createElementBlock("div",$f,e.toDisplayString(y.description),1)):e.createCommentVNode("",!0)])]),t.direction==="vertical"&&E<t.items.length-1?(e.openBlock(),e.createElementBlock("div",Nf)):e.createCommentVNode("",!0)],10,hf))),128))],2))}}),Df={key:0,role:"radiogroup"},zf=["value","checked","disabled","onChange"],Tf=["aria-checked","onClick"],Mf={key:0,class:"sg-segmented-item-icon"},Lf={class:"sg-segmented-item-label"},Ff=e.defineComponent({__name:"Segmented",props:{options:{type:Array,required:!0},value:{type:String,default:void 0},modelValue:{type:String,default:void 0},defaultValue:{type:String,default:void 0},size:{type:String,default:void 0},disabled:{type:Boolean,default:void 0},block:{type:Boolean,default:!1},unstyled:{type:Boolean,default:!1}},emits:["change","update:value","update:modelValue"],setup(t,{emit:n}){var y;const l=t,a=n,o=e.useSlots(),s=e.computed(()=>!!o.icon),{resolvedSize:u,resolvedDisabled:c}=Ye({size:void 0,disabled:void 0},{}),i=e.computed(()=>l.size??u.value),r=e.computed(()=>l.disabled??c.value);function d(E){return typeof E=="string"?{label:E,value:E}:E}const v=e.computed(()=>l.options.map(d)),g=l.value??l.modelValue??l.defaultValue??((y=d(l.options[0]))==null?void 0:y.value)??"",m=e.ref(g);e.watch(()=>l.value??l.modelValue,E=>{E!==void 0&&(m.value=E)});const h=e.computed(()=>l.value??l.modelValue??m.value);function p(E,z){r.value||z||(m.value=E,a("change",E),a("update:value",E),a("update:modelValue",E))}const b=e.computed(()=>["sg-segmented",`sg-segmented-${i.value}`,l.block?"sg-segmented-block":"",r.value?"sg-segmented-disabled":""].filter(Boolean).join(" "));return(E,z)=>t.unstyled?(e.openBlock(),e.createElementBlock("div",Df,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(x,f)=>(e.openBlock(),e.createElementBlock("label",{key:x.value},[e.createElementVNode("input",{type:"radio",name:"sg-segmented",value:x.value,checked:x.value===h.value,disabled:r.value||x.disabled,onChange:N=>p(x.value,x.disabled)},null,40,zf),s.value||x.icon?e.renderSlot(E.$slots,"icon",{key:0,option:x,index:f},()=>[e.createTextVNode(e.toDisplayString(x.icon),1)]):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(x.label),1)]))),128))])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(b.value),role:"radiogroup"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(x,f)=>(e.openBlock(),e.createElementBlock("div",{key:x.value,role:"radio","aria-checked":x.value===h.value,class:e.normalizeClass(["sg-segmented-item",x.value===h.value?"sg-segmented-item-selected":"",x.disabled?"sg-segmented-item-disabled":""]),onClick:N=>p(x.value,x.disabled)},[s.value||x.icon?(e.openBlock(),e.createElementBlock("span",Mf,[e.renderSlot(E.$slots,"icon",{option:x,index:f},()=>[e.createTextVNode(e.toDisplayString(x.icon),1)])])):e.createCommentVNode("",!0),e.createElementVNode("span",Lf,e.toDisplayString(x.label),1)],10,Tf))),128))],2))}}),Af={key:0,style:{position:"relative",display:"inline-block"}},Pf={key:0},Rf={key:1},If={key:1,class:"sg-badge-status"},_f={key:0,class:"sg-badge-status-text"},Kf=["aria-label"],Hf=e.defineComponent({__name:"Badge",props:{count:{},dot:{type:Boolean},overflowCount:{default:99},showZero:{type:Boolean},color:{},status:{},text:{},offset:{},unstyled:{type:Boolean}},setup(t){const n=t,l=e.useSlots(),a=e.computed(()=>!!l.default),o=e.computed(()=>n.count!==void 0&&(n.count>0||n.showZero)),s=e.computed(()=>o.value?n.count>n.overflowCount?`${n.overflowCount}+`:`${n.count}`:null),u=e.computed(()=>!a.value&&(o.value||!!n.dot)),c=e.computed(()=>n.offset&&!u.value?{right:`${-n.offset[0]}px`,marginTop:`${n.offset[1]}px`}:void 0),i=e.computed(()=>n.color?{background:n.color}:void 0);return(r,d)=>t.unstyled?(e.openBlock(),e.createElementBlock("span",Af,[e.renderSlot(r.$slots,"default"),t.dot||o.value?(e.openBlock(),e.createElementBlock("sup",Pf,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),t.status?(e.openBlock(),e.createElementBlock("span",Rf,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0)])):t.status&&!a.value?(e.openBlock(),e.createElementBlock("span",If,[e.createElementVNode("span",{class:e.normalizeClass(`sg-badge-status-dot sg-badge-status-${t.status}`),style:e.normalizeStyle(i.value)},null,6),t.text?(e.openBlock(),e.createElementBlock("span",_f,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["sg-badge",u.value?"sg-badge-standalone":null])},[e.renderSlot(r.$slots,"default"),t.dot&&!o.value?(e.openBlock(),e.createElementBlock("sup",{key:0,class:"sg-badge-dot",style:e.normalizeStyle({...c.value??{},...i.value??{}})},null,4)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("sup",{key:1,class:"sg-badge-count",style:e.normalizeStyle({...c.value??{},...i.value??{}}),"aria-label":s.value??void 0},e.toDisplayString(s.value),13,Kf)):e.createCommentVNode("",!0)],2))}}),Of={key:0},jf=["aria-label"],Yf=e.defineComponent({__name:"Tag",props:{color:{default:"default"},closable:{type:Boolean},bordered:{type:Boolean,default:!0},unstyled:{type:Boolean}},emits:["close"],setup(t,{emit:n}){const l=t,a=n,o=new Set(["default","success","error","warning","processing"]),s=e.computed(()=>o.has(l.color)),u=e.computed(()=>["sg-tag",s.value?`sg-tag-${l.color}`:"",l.bordered?"":"sg-tag-borderless"].filter(Boolean).join(" ")),c=e.computed(()=>s.value?void 0:{background:l.color,borderColor:l.color,color:"#fff"}),i=Ee(),r=e.computed(()=>{var v,g;return((g=(v=i.value.locale)==null?void 0:v.tag)==null?void 0:g.closeAriaLabel)??"Close"});function d(v){v.stopPropagation(),a("close")}return(v,g)=>t.unstyled?(e.openBlock(),e.createElementBlock("span",Of,[e.renderSlot(v.$slots,"default"),t.closable?(e.openBlock(),e.createElementBlock("span",{key:0,role:"button",onClick:d},"×")):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(u.value),style:e.normalizeStyle(c.value)},[e.renderSlot(v.$slots,"default"),t.closable?(e.openBlock(),e.createElementBlock("span",{key:0,class:"sg-tag-close",role:"button","aria-label":r.value,onClick:d}," × ",8,jf)):e.createCommentVNode("",!0)],6))}}),Wf=["aria-label"],Uf=["src","alt"],qf=["aria-label"],Xf=["src","alt"],Gf={key:1,class:"sg-avatar-icon"},Jf={key:2,class:"sg-avatar-text"},Zf=e.defineComponent({__name:"Avatar",props:{src:{},alt:{},ariaLabel:{},size:{},shape:{default:"circle"},unstyled:{type:Boolean}},setup(t){const n=t,l=Ee(),a={small:24,default:32,large:40},o=e.computed(()=>n.size??l.value.size??"middle"),s=e.computed(()=>{const g=o.value;return typeof g=="number"?g:g==="middle"?"default":g}),u=e.computed(()=>{const g=o.value;return typeof g=="number"?g:a[s.value]}),c=e.computed(()=>Math.round(u.value*.45)),i=e.useSlots(),r=e.computed(()=>!!i.icon),d=e.computed(()=>["sg-avatar",`sg-avatar-${n.shape}`,typeof o.value=="string"?`sg-avatar-${s.value}`:""].filter(Boolean).join(" ")),v=e.computed(()=>({width:`${u.value}px`,height:`${u.value}px`,lineHeight:`${u.value}px`,fontSize:n.src?void 0:`${c.value}px`}));return(g,m)=>t.unstyled?(e.openBlock(),e.createElementBlock("span",{key:0,role:"img","aria-label":t.ariaLabel},[t.src?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.src,alt:t.alt},null,8,Uf)):r.value?e.renderSlot(g.$slots,"icon",{key:1}):e.renderSlot(g.$slots,"default",{key:2})],8,Wf)):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(d.value),style:e.normalizeStyle(v.value),role:"img","aria-label":t.ariaLabel},[t.src?(e.openBlock(),e.createElementBlock("img",{key:0,class:"sg-avatar-image",src:t.src,alt:t.alt},null,8,Xf)):r.value?(e.openBlock(),e.createElementBlock("span",Gf,[e.renderSlot(g.$slots,"icon")])):(e.openBlock(),e.createElementBlock("span",Jf,[e.renderSlot(g.$slots,"default")]))],14,qf))}});function ua(t){const n=[];for(const l of t)if(l.type!==e.Comment&&l.type!==e.Text){if(l.type===e.Fragment&&Array.isArray(l.children)){n.push(...ua(l.children));continue}n.push(l)}return n}const Qf=e.defineComponent({name:"SgCarousel",props:{autoplay:{type:Boolean,default:!1},autoplaySpeed:{type:Number,default:3e3},dots:{type:Boolean,default:!0},dotPosition:{type:String,default:"bottom"},effect:{type:String,default:"slide"},unstyled:{type:Boolean,default:!1}},setup(t,{slots:n}){const l=e.ref(0),a=e.ref(0);let o;function s(i,r){if(r===0){l.value=0;return}l.value=(i%r+r)%r}function u(){o&&clearInterval(o);const i=a.value;!t.autoplay||i<=1||(o=setInterval(()=>s(l.value+1,i),t.autoplaySpeed))}e.watch(()=>[t.autoplay,t.autoplaySpeed,a.value],()=>u()),e.onBeforeUnmount(()=>{o&&clearInterval(o)});const c=e.computed(()=>t.dotPosition==="left"||t.dotPosition==="right");return()=>{var g;const i=((g=n.default)==null?void 0:g.call(n))??[],r=ua(i),d=r.length;if(a.value!==d&&(a.value=d),l.value>=d&&d>0&&(l.value=d-1),t.unstyled)return e.h("div",null,[r[l.value]?e.h("div",null,[r[l.value]]):null,t.dots?e.h("div",null,r.map((m,h)=>e.h("button",{key:h,type:"button","aria-current":h===l.value,onClick:()=>s(h,d)},String(h+1)))):null]);const v=["sg-carousel",`sg-carousel-dots-${t.dotPosition}`,c.value?"sg-carousel-vertical":""].filter(Boolean).join(" ");return e.h("div",{class:v},[e.h("div",{class:"sg-carousel-container"},[e.h("div",{class:"sg-carousel-track"},r.map((m,h)=>e.h("div",{key:h,class:["sg-carousel-slide",h===l.value?"sg-carousel-slide-active":"",`sg-carousel-effect-${t.effect}`],style:t.effect==="slide"?{transform:`translateX(${(h-l.value)*100}%)`}:void 0,"aria-hidden":h!==l.value},[m])))]),t.dots&&d>1?e.h("div",{class:["sg-carousel-dots",c.value?"sg-carousel-dots-vertical":""]},r.map((m,h)=>e.h("button",{key:h,type:"button",class:["sg-carousel-dot",h===l.value?"sg-carousel-dot-active":""],"aria-label":`Slide ${h+1}`,onClick:()=>s(h,d)}))):null])}}}),eh={key:0},th={key:0},lh={key:0,class:"sg-timeline-item-label"},ah={class:"sg-timeline-item-head-wrapper"},nh={key:0,class:"sg-timeline-item-tail"},oh={class:"sg-timeline-item-content"},sh=e.defineComponent({__name:"Timeline",props:{items:{},mode:{default:"left"},pending:{type:[String,Boolean]},reverse:{type:Boolean},unstyled:{type:Boolean}},setup(t){const n=t,l=e.computed(()=>{let c=n.items.map(i=>({...i}));return n.pending&&c.push({content:typeof n.pending=="boolean"?"":n.pending,__pending:!0}),n.reverse&&(c=c.reverse()),c}),a=e.computed(()=>!!n.pending);function o(c,i){return c.position?c.position:n.mode==="alternate"?i%2===0?"left":"right":n.mode}function s(c,i,r){return["sg-timeline-item",`sg-timeline-item-${o(c,i)}`,c.__pending??(a.value&&r)?"sg-timeline-item-pending":""].filter(Boolean).join(" ")}const u=e.computed(()=>`sg-timeline sg-timeline-${n.mode}`);return(c,i)=>t.unstyled?(e.openBlock(),e.createElementBlock("ul",eh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(r,d)=>(e.openBlock(),e.createElementBlock("li",{key:d},[c.$slots.label||r.label!==void 0?(e.openBlock(),e.createElementBlock("span",th,[e.renderSlot(c.$slots,"label",{item:r,index:d},()=>[e.createTextVNode(e.toDisplayString(r.label),1)])])):e.createCommentVNode("",!0),e.createElementVNode("span",null,[e.renderSlot(c.$slots,"dot",{item:r,index:d,isPending:r.__pending??!1},()=>[e.createTextVNode(e.toDisplayString(r.dot??"●"),1)])]),e.createElementVNode("span",null,[e.renderSlot(c.$slots,"content",{item:r,index:d,isPending:r.__pending??!1},()=>[e.createTextVNode(e.toDisplayString(r.content),1)])])]))),128))])):(e.openBlock(),e.createElementBlock("ul",{key:1,class:e.normalizeClass(u.value),role:"list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(r,d)=>(e.openBlock(),e.createElementBlock("li",{key:d,class:e.normalizeClass(s(r,d,d===l.value.length-1)),role:"listitem"},[c.$slots.label||r.label!==void 0?(e.openBlock(),e.createElementBlock("div",lh,[e.renderSlot(c.$slots,"label",{item:r,index:d},()=>[e.createTextVNode(e.toDisplayString(r.label),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",ah,[e.createElementVNode("div",{class:e.normalizeClass(["sg-timeline-item-head",r.dot||c.$slots.dot?"sg-timeline-item-head-custom":""]),style:e.normalizeStyle(r.color&&!r.dot&&!c.$slots.dot?{borderColor:r.color,color:r.color}:void 0)},[e.renderSlot(c.$slots,"dot",{item:r,index:d,isPending:r.__pending??!1},()=>[e.createTextVNode(e.toDisplayString(r.dot??""),1)])],6),d<l.value.length-1?(e.openBlock(),e.createElementBlock("div",nh)):e.createCommentVNode("",!0)]),e.createElementVNode("div",oh,[e.renderSlot(c.$slots,"content",{item:r,index:d,isPending:r.__pending??!1},()=>[e.createTextVNode(e.toDisplayString(r.content),1)])])],2))),128))],2))}}),rh={key:0,role:"list"},ih={key:0},ch=["colspan"],uh={key:0,class:"sg-descriptions-title"},dh={class:"sg-descriptions-table"},mh={class:"sg-descriptions-row"},ph=["colspan"],vh={key:0,class:"sg-descriptions-colon"},gh={class:"sg-descriptions-row"},fh=["colspan"],hh={key:1,class:"sg-descriptions-row"},yh={class:"sg-descriptions-item-label"},kh={key:0,class:"sg-descriptions-colon"},bh=["colspan"],Bh=e.defineComponent({__name:"Descriptions",props:{title:{},items:{},bordered:{type:Boolean,default:!1},column:{default:3},layout:{default:"horizontal"},colon:{type:Boolean,default:!0},size:{},unstyled:{type:Boolean}},setup(t){const n=t,{resolvedSize:l}=Ye({size:void 0},{}),a=e.computed(()=>n.size??l.value),o=e.computed(()=>a.value==="small"?"small":"default");function s(i,r){const d=[];let v=[],g=0;for(const m of i){const h=Math.min(m.span??1,r);g+h>r&&(d.push(v),v=[],g=0),v.push(m),g+=h,g>=r&&(d.push(v),v=[],g=0)}return v.length>0&&d.push(v),d}const u=e.computed(()=>s(n.items,n.column)),c=e.computed(()=>["sg-descriptions",`sg-descriptions-${o.value}`,n.bordered?"sg-descriptions-bordered":""].filter(Boolean).join(" "));return(i,r)=>t.unstyled?(e.openBlock(),e.createElementBlock("div",rh,[t.title?(e.openBlock(),e.createElementBlock("div",ih,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("table",null,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(d,v)=>(e.openBlock(),e.createElementBlock("tr",{key:v},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d,(g,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:g.key??m},[e.createElementVNode("th",null,e.toDisplayString(g.label)+e.toDisplayString(t.colon?":":""),1),e.createElementVNode("td",{colspan:g.span},e.toDisplayString(g.value),9,ch)],64))),128))]))),128))])])])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(c.value),role:"list"},[t.title?(e.openBlock(),e.createElementBlock("div",uh,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("table",dh,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(d,v)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:v},[t.layout==="vertical"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("tr",mh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d,(g,m)=>(e.openBlock(),e.createElementBlock("th",{key:`label-${g.key??m}`,class:"sg-descriptions-item-label",colspan:g.span??1},[e.createTextVNode(e.toDisplayString(g.label)+" ",1),t.colon?(e.openBlock(),e.createElementBlock("span",vh,":")):e.createCommentVNode("",!0)],8,ph))),128))]),e.createElementVNode("tr",gh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d,(g,m)=>(e.openBlock(),e.createElementBlock("td",{key:`value-${g.key??m}`,class:"sg-descriptions-item-content",colspan:g.span??1},e.toDisplayString(g.value),9,fh))),128))])],64)):(e.openBlock(),e.createElementBlock("tr",hh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d,(g,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:g.key??m},[e.createElementVNode("th",yh,[e.createTextVNode(e.toDisplayString(g.label)+" ",1),t.colon?(e.openBlock(),e.createElementBlock("span",kh,":")):e.createCommentVNode("",!0)]),e.createElementVNode("td",{class:"sg-descriptions-item-content",colspan:g.span??1},e.toDisplayString(g.value),9,bh)],64))),128))]))],64))),128))])])],2))}}),Ch={key:0},wh=["disabled","aria-expanded","onClick"],Sh={key:0},Eh={key:0},xh=["tabindex","aria-expanded","onClick","onKeydown"],$h={class:"sg-collapse-header-text"},Nh={key:2,class:"sg-collapse-extra"},Vh=["onTransitionend"],Dh={class:"sg-collapse-content-inner"},zh=e.defineComponent({__name:"Collapse",props:{items:{},activeKey:{},defaultActiveKey:{},accordion:{type:Boolean,default:!1},bordered:{type:Boolean,default:!0},expandIconPosition:{default:"start"},ghost:{type:Boolean,default:!1},size:{},unstyled:{type:Boolean}},emits:["change"],setup(t,{emit:n}){const l=t,a=n,{resolvedSize:o}=Ye({size:void 0},{}),s=e.computed(()=>l.size??o.value);function u(f){return f===void 0?[]:Array.isArray(f)?f:[f]}const c=e.ref(u(l.activeKey??l.defaultActiveKey)),i=e.computed(()=>l.activeKey!==void 0?u(l.activeKey):c.value);function r(f){let N;l.accordion?N=i.value.includes(f)?[]:[f]:N=i.value.includes(f)?i.value.filter(B=>B!==f):[...i.value,f],c.value=N,a("change",N)}const d=e.computed(()=>["sg-collapse",l.bordered?"sg-collapse-bordered":"",l.ghost?"sg-collapse-ghost":"",`sg-collapse-${s.value}`].filter(Boolean).join(" "));function v(f){return["sg-collapse-panel",i.value.includes(f.key)?"sg-collapse-panel-active":"",f.disabled?"sg-collapse-panel-disabled":""].filter(Boolean).join(" ")}function g(f){return["sg-collapse-arrow",i.value.includes(f.key)?"sg-collapse-arrow-open":""].filter(Boolean).join(" ")}function m(f){return i.value.includes(f)}function h(f,N){N.disabled||(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),r(N.key))}const p=e.ref(new Map),b=e.ref(new Map);function y(f,N){N?p.value.set(f,N):p.value.delete(f)}function E(f){const N=b.value.get(f.key),B=m(f.key);let w;return N!=null?w=`${N}px`:B?w="none":w="0px",{"--sg-collapse-content-max-height":w}}function z(f){const N=p.value.get(f.key);N&&(m(f.key)?b.value.set(f.key,N.scrollHeight):(b.value.set(f.key,N.scrollHeight),requestAnimationFrame(()=>{b.value.set(f.key,0),b.value=new Map(b.value)})),b.value=new Map(b.value))}function x(f){m(f.key)&&(b.value.set(f.key,null),b.value=new Map(b.value))}return e.onMounted(()=>{for(const f of l.items)if(m(f.key)){const N=p.value.get(f.key);N&&b.value.set(f.key,N.scrollHeight)}b.value=new Map(b.value)}),e.watch(i,(f,N)=>{const B=new Set(N??[]),w=new Set(f??[]),S=[];for(const L of l.items){const T=B.has(L.key),P=w.has(L.key);T!==P&&S.push(L.key)}S.length!==0&&e.nextTick(()=>{for(const L of S){const T=l.items.find(P=>P.key===L);T&&z(T)}})}),(f,N)=>t.unstyled?(e.openBlock(),e.createElementBlock("div",Ch,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,B=>(e.openBlock(),e.createElementBlock("div",{key:B.key},[e.createElementVNode("button",{type:"button",disabled:B.disabled,"aria-expanded":m(B.key),onClick:w=>!B.disabled&&r(B.key)},[e.createTextVNode(e.toDisplayString(B.label)+" ",1),B.extra?(e.openBlock(),e.createElementBlock("span",Sh,e.toDisplayString(B.extra),1)):e.createCommentVNode("",!0)],8,wh),m(B.key)?(e.openBlock(),e.createElementBlock("div",Eh,[e.renderSlot(f.$slots,"panel",{item:B},()=>[e.createTextVNode(e.toDisplayString(B.content),1)])])):e.createCommentVNode("",!0)]))),128))])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(d.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,B=>(e.openBlock(),e.createElementBlock("div",{key:B.key,class:e.normalizeClass(v(B))},[e.createElementVNode("div",{class:"sg-collapse-header",role:"button",tabindex:B.disabled?-1:0,"aria-expanded":m(B.key),onClick:w=>!B.disabled&&r(B.key),onKeydown:w=>h(w,B)},[t.expandIconPosition==="start"&&B.showArrow!==!1?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(g(B))},null,2)):e.createCommentVNode("",!0),e.createElementVNode("span",$h,e.toDisplayString(B.label),1),t.expandIconPosition==="end"&&B.showArrow!==!1?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(g(B))},null,2)):e.createCommentVNode("",!0),B.extra?(e.openBlock(),e.createElementBlock("span",Nh,e.toDisplayString(B.extra),1)):e.createCommentVNode("",!0)],40,xh),e.createElementVNode("div",{ref_for:!0,ref:w=>y(B.key,w),class:"sg-collapse-content",style:e.normalizeStyle(E(B)),onTransitionend:w=>x(B)},[e.createElementVNode("div",Dh,[e.renderSlot(f.$slots,"panel",{item:B},()=>[e.createTextVNode(e.toDisplayString(B.content),1)])])],44,Vh)],2))),128))],2))}}),Th={modal:{okText:"OK",cancelText:"Cancel",closeAriaLabel:"Close"},popconfirm:{okText:"Yes",cancelText:"No"},empty:{description:"No Data"},pagination:{totalPrefix:"Total",itemsPerPage:"/ page",jump:"Go to",page:"page",ariaLabel:"Pagination"},inputPassword:{showPassword:"Show password",hidePassword:"Hide password",strengthWeak:"Weak",strengthMedium:"Medium",strengthStrong:"Strong",strengthVeryStrong:"Very strong"},searchInput:{placeholder:"Search…",clear:"Clear",search:"Search"},tagInput:{placeholder:"Add tag…",removeTag:"Remove"},pinInput:{ariaLabel:"PIN input"},inlineEdit:{placeholder:"Click to edit…",save:"Save",cancel:"Cancel"},calendar:{monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],dayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],today:"Today",now:"Now",week:"W",prevYear:"Previous year",nextYear:"Next year",prevMonth:"Previous month",nextMonth:"Next month",month:"Month",year:"Year"},datePicker:{prevYear:"Previous year",nextYear:"Next year",prevMonth:"Previous month",nextMonth:"Next month"},form:{required:"*",optional:"(optional)",submitText:"Submit",resetText:"Reset"},upload:{uploadText:"Upload",removeFile:"Remove file",uploadError:"Upload failed",previewFile:"Preview",uploadAriaLabel:"Upload file"},transfer:{titles:["Source","Target"],searchPlaceholder:"Search",itemUnit:"item",itemsUnit:"items",notFoundContent:"Not found",selectAll:"Select all",deselectAll:"Deselect all"},drawer:{closeAriaLabel:"Close"},notification:{closeAriaLabel:"Close"},tag:{closeAriaLabel:"Close"},spin:{loading:"Loading"},skeleton:{loading:"Loading"},breadcrumb:{ariaLabel:"Breadcrumb"},carousel:{slide:t=>`Slide ${t}`},rate:{ariaLabel:"Rating",star:t=>`${t} star${t>1?"s":""}`},charts:{lineChart:"Line chart",barChart:"Bar chart",areaChart:"Area chart",pieChart:"Pie chart",legend:"Chart legend",actions:"Chart actions"},cascader:{searchPlaceholder:"Search...",noMatches:"No matches",clear:"Clear",removeTag:"Remove"},treeSelect:{searchPlaceholder:"Search...",noMatches:"No matches"},tree:{clearSearch:"Clear search"},dashboard:{ariaLabel:"Dashboard",editorAriaLabel:"Dashboard editor",resizeWidget:"Resize widget",widgetActions:"Widget actions"},gantt:{ariaLabel:"Gantt chart",resizeTask:"Resize task"},resourceCalendar:{ariaLabel:"Resource calendar",resource:t=>`Resource ${t}`,capacity:t=>`capacity ${t} per slot`,resizeStart:"Resize start",resizeEnd:"Resize end",conflictSuffix:" (conflict)"},timeline:{ariaLabel:"Timeline"},diagram:{ariaLabel:"Diagram"},dataGrid:{selectAllRows:"Select all rows",selectRow:"Select row"},schemaFormEditor:{undo:"Undo",redo:"Redo",removeOption:"Remove option",schemaView:"Generated JSON Schema",optionLabelPlaceholder:"Label",optionValuePlaceholder:"Value",moveFieldUp:"Move field up",moveFieldDown:"Move field down",duplicateField:"Duplicate field",deleteField:"Delete field"},list:{loading:"Loading"},table:{selectAll:"Select all"},input:{clear:"Clear"},colorPicker:{pickColor:"Pick color"}},Mh={modal:{okText:"ОК",cancelText:"Отмена",closeAriaLabel:"Закрыть"},popconfirm:{okText:"Да",cancelText:"Нет"},empty:{description:"Нет данных"},pagination:{totalPrefix:"Всего",itemsPerPage:" / стр.",jump:"Перейти",page:"стр.",ariaLabel:"Постраничная навигация"},inputPassword:{showPassword:"Показать пароль",hidePassword:"Скрыть пароль",strengthWeak:"Слабый",strengthMedium:"Средний",strengthStrong:"Сильный",strengthVeryStrong:"Очень сильный"},searchInput:{placeholder:"Поиск…",clear:"Очистить",search:"Найти"},tagInput:{placeholder:"Добавить тег…",removeTag:"Удалить"},pinInput:{ariaLabel:"Ввод PIN-кода"},inlineEdit:{placeholder:"Нажмите для редактирования…",save:"Сохранить",cancel:"Отмена"},calendar:{monthNames:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],dayNames:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],today:"Сегодня",now:"Сейчас",week:"Нед",prevYear:"Предыдущий год",nextYear:"Следующий год",prevMonth:"Предыдущий месяц",nextMonth:"Следующий месяц",month:"Месяц",year:"Год"},datePicker:{prevYear:"Предыдущий год",nextYear:"Следующий год",prevMonth:"Предыдущий месяц",nextMonth:"Следующий месяц"},form:{required:"*",optional:"(необязательно)",submitText:"Отправить",resetText:"Сбросить"},upload:{uploadText:"Загрузить",removeFile:"Удалить файл",uploadError:"Ошибка загрузки",previewFile:"Просмотр",uploadAriaLabel:"Загрузить файл"},transfer:{titles:["Источник","Цель"],searchPlaceholder:"Поиск",itemUnit:"элемент",itemsUnit:"элементов",notFoundContent:"Ничего не найдено",selectAll:"Выбрать все",deselectAll:"Снять выделение"},drawer:{closeAriaLabel:"Закрыть"},notification:{closeAriaLabel:"Закрыть"},tag:{closeAriaLabel:"Закрыть"},spin:{loading:"Загрузка"},skeleton:{loading:"Загрузка"},breadcrumb:{ariaLabel:"Хлебные крошки"},carousel:{slide:t=>`Слайд ${t}`},rate:{ariaLabel:"Рейтинг",star:t=>`${t} ${t===1?"звезда":t<5?"звезды":"звёзд"}`},charts:{lineChart:"Линейная диаграмма",barChart:"Столбчатая диаграмма",areaChart:"Диаграмма с областями",pieChart:"Круговая диаграмма",legend:"Легенда",actions:"Действия с диаграммой"},cascader:{searchPlaceholder:"Поиск...",noMatches:"Совпадений не найдено",clear:"Очистить",removeTag:"Удалить"},treeSelect:{searchPlaceholder:"Поиск...",noMatches:"Совпадений не найдено"},tree:{clearSearch:"Очистить поиск"},dashboard:{ariaLabel:"Дашборд",editorAriaLabel:"Редактор дашборда",resizeWidget:"Изменить размер виджета",widgetActions:"Действия виджета"},gantt:{ariaLabel:"Диаграмма Ганта",resizeTask:"Изменить длительность задачи"},resourceCalendar:{ariaLabel:"Календарь ресурсов",resource:t=>`Ресурс ${t}`,capacity:t=>`${t} на слот`,resizeStart:"Изменить начало",resizeEnd:"Изменить конец",conflictSuffix:" (конфликт)"},timeline:{ariaLabel:"Хронология"},diagram:{ariaLabel:"Диаграмма"},dataGrid:{selectAllRows:"Выбрать все строки",selectRow:"Выбрать строку"},schemaFormEditor:{undo:"Отменить",redo:"Повторить",removeOption:"Удалить опцию",schemaView:"Сгенерированная JSON-схема",optionLabelPlaceholder:"Подпись",optionValuePlaceholder:"Значение",moveFieldUp:"Переместить вверх",moveFieldDown:"Переместить вниз",duplicateField:"Дублировать поле",deleteField:"Удалить поле"},list:{loading:"Загрузка"},table:{selectAll:"Выбрать все"},input:{clear:"Очистить"},colorPicker:{pickColor:"Выбрать цвет"}},Lh={modal:{okText:"确定",cancelText:"取消",closeAriaLabel:"关闭"},popconfirm:{okText:"确定",cancelText:"取消"},empty:{description:"暂无数据"},pagination:{totalPrefix:"共",itemsPerPage:" 条/页",jump:"跳至",page:"页",ariaLabel:"分页"},inputPassword:{showPassword:"显示密码",hidePassword:"隐藏密码",strengthWeak:"弱",strengthMedium:"中",strengthStrong:"强",strengthVeryStrong:"非常强"},searchInput:{placeholder:"搜索…",clear:"清除",search:"搜索"},tagInput:{placeholder:"添加标签…",removeTag:"删除"},pinInput:{ariaLabel:"PIN 输入"},inlineEdit:{placeholder:"点击编辑…",save:"保存",cancel:"取消"},calendar:{monthNames:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayNames:["日","一","二","三","四","五","六"],today:"今天",now:"此刻",week:"周",prevYear:"上一年",nextYear:"下一年",prevMonth:"上个月",nextMonth:"下个月",month:"月",year:"年"},datePicker:{prevYear:"上一年",nextYear:"下一年",prevMonth:"上个月",nextMonth:"下个月"},form:{required:"*",optional:"(可选)",submitText:"提交",resetText:"重置"},upload:{uploadText:"上传",removeFile:"删除文件",uploadError:"上传失败",previewFile:"预览",uploadAriaLabel:"上传文件"},transfer:{titles:["源","目标"],searchPlaceholder:"搜索",itemUnit:"项",itemsUnit:"项",notFoundContent:"未找到",selectAll:"全选",deselectAll:"取消全选"},drawer:{closeAriaLabel:"关闭"},notification:{closeAriaLabel:"关闭"},tag:{closeAriaLabel:"关闭"},spin:{loading:"加载中"},skeleton:{loading:"加载中"},breadcrumb:{ariaLabel:"面包屑"},carousel:{slide:t=>`第 ${t} 张`},rate:{ariaLabel:"评分",star:t=>`${t} 星`},charts:{lineChart:"折线图",barChart:"柱状图",areaChart:"面积图",pieChart:"饼图",legend:"图例",actions:"图表操作"},cascader:{searchPlaceholder:"搜索...",noMatches:"无匹配项",clear:"清除",removeTag:"删除"},treeSelect:{searchPlaceholder:"搜索...",noMatches:"无匹配项"},tree:{clearSearch:"清除搜索"},dashboard:{ariaLabel:"仪表板",editorAriaLabel:"仪表板编辑器",resizeWidget:"调整组件大小",widgetActions:"组件操作"},gantt:{ariaLabel:"甘特图",resizeTask:"调整任务时长"},resourceCalendar:{ariaLabel:"资源日历",resource:t=>`资源 ${t}`,capacity:t=>`每槽 ${t}`,resizeStart:"调整开始",resizeEnd:"调整结束",conflictSuffix:"(冲突)"},timeline:{ariaLabel:"时间线"},diagram:{ariaLabel:"图表"},dataGrid:{selectAllRows:"全选",selectRow:"选择行"},schemaFormEditor:{undo:"撤销",redo:"重做",removeOption:"删除选项",schemaView:"生成的 JSON Schema",optionLabelPlaceholder:"标签",optionValuePlaceholder:"值",moveFieldUp:"上移字段",moveFieldDown:"下移字段",duplicateField:"复制字段",deleteField:"删除字段"},list:{loading:"加载中"},table:{selectAll:"全选"},input:{clear:"清除"},colorPicker:{pickColor:"选择颜色"}},Fh={modal:{okText:"OK",cancelText:"Abbrechen",closeAriaLabel:"Schließen"},popconfirm:{okText:"Ja",cancelText:"Nein"},empty:{description:"Keine Daten"},pagination:{totalPrefix:"Gesamt",itemsPerPage:" / Seite",jump:"Gehe zu",page:"Seite",ariaLabel:"Seitennavigation"},inputPassword:{showPassword:"Passwort anzeigen",hidePassword:"Passwort verbergen",strengthWeak:"Schwach",strengthMedium:"Mittel",strengthStrong:"Stark",strengthVeryStrong:"Sehr stark"},searchInput:{placeholder:"Suchen…",clear:"Leeren",search:"Suchen"},tagInput:{placeholder:"Tag hinzufügen…",removeTag:"Entfernen"},pinInput:{ariaLabel:"PIN-Eingabe"},inlineEdit:{placeholder:"Klicken zum Bearbeiten…",save:"Speichern",cancel:"Abbrechen"},calendar:{monthNames:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],dayNames:["So","Mo","Di","Mi","Do","Fr","Sa"],today:"Heute",now:"Jetzt",week:"KW",prevYear:"Vorheriges Jahr",nextYear:"Nächstes Jahr",prevMonth:"Vorheriger Monat",nextMonth:"Nächster Monat",month:"Monat",year:"Jahr"},datePicker:{prevYear:"Vorheriges Jahr",nextYear:"Nächstes Jahr",prevMonth:"Vorheriger Monat",nextMonth:"Nächster Monat"},form:{required:"*",optional:"(optional)",submitText:"Senden",resetText:"Zurücksetzen"},upload:{uploadText:"Hochladen",removeFile:"Datei entfernen",uploadError:"Hochladen fehlgeschlagen",previewFile:"Vorschau",uploadAriaLabel:"Datei hochladen"},transfer:{titles:["Quelle","Ziel"],searchPlaceholder:"Suchen",itemUnit:"Element",itemsUnit:"Elemente",notFoundContent:"Nicht gefunden",selectAll:"Alle auswählen",deselectAll:"Auswahl aufheben"},drawer:{closeAriaLabel:"Schließen"},notification:{closeAriaLabel:"Schließen"},tag:{closeAriaLabel:"Schließen"},spin:{loading:"Wird geladen"},skeleton:{loading:"Wird geladen"},breadcrumb:{ariaLabel:"Brotkrümelnavigation"},carousel:{slide:t=>`Folie ${t}`},rate:{ariaLabel:"Bewertung",star:t=>`${t} ${t===1?"Stern":"Sterne"}`},charts:{lineChart:"Liniendiagramm",barChart:"Balkendiagramm",areaChart:"Flächendiagramm",pieChart:"Tortendiagramm",legend:"Diagrammlegende",actions:"Diagrammaktionen"},cascader:{searchPlaceholder:"Suchen...",noMatches:"Keine Treffer",clear:"Leeren",removeTag:"Entfernen"},treeSelect:{searchPlaceholder:"Suchen...",noMatches:"Keine Treffer"},tree:{clearSearch:"Suche leeren"},dashboard:{ariaLabel:"Dashboard",editorAriaLabel:"Dashboard-Editor",resizeWidget:"Widget-Größe ändern",widgetActions:"Widget-Aktionen"},gantt:{ariaLabel:"Gantt-Diagramm",resizeTask:"Aufgabendauer ändern"},resourceCalendar:{ariaLabel:"Ressourcenkalender",resource:t=>`Ressource ${t}`,capacity:t=>`Kapazität ${t} pro Slot`,resizeStart:"Anfang verschieben",resizeEnd:"Ende verschieben",conflictSuffix:" (Konflikt)"},timeline:{ariaLabel:"Zeitleiste"},diagram:{ariaLabel:"Diagramm"},dataGrid:{selectAllRows:"Alle Zeilen auswählen",selectRow:"Zeile auswählen"},schemaFormEditor:{undo:"Rückgängig",redo:"Wiederholen",removeOption:"Option entfernen",schemaView:"Generiertes JSON-Schema",optionLabelPlaceholder:"Bezeichnung",optionValuePlaceholder:"Wert",moveFieldUp:"Feld nach oben verschieben",moveFieldDown:"Feld nach unten verschieben",duplicateField:"Feld duplizieren",deleteField:"Feld löschen"},list:{loading:"Wird geladen"},table:{selectAll:"Alle auswählen"},input:{clear:"Leeren"},colorPicker:{pickColor:"Farbe auswählen"}},Ah={modal:{okText:"OK",cancelText:"Annuler",closeAriaLabel:"Fermer"},popconfirm:{okText:"Oui",cancelText:"Non"},empty:{description:"Aucune donnée"},pagination:{totalPrefix:"Total",itemsPerPage:" / page",jump:"Aller à",page:"page",ariaLabel:"Pagination"},inputPassword:{showPassword:"Afficher le mot de passe",hidePassword:"Masquer le mot de passe",strengthWeak:"Faible",strengthMedium:"Moyen",strengthStrong:"Fort",strengthVeryStrong:"Très fort"},searchInput:{placeholder:"Rechercher…",clear:"Effacer",search:"Rechercher"},tagInput:{placeholder:"Ajouter un tag…",removeTag:"Supprimer"},pinInput:{ariaLabel:"Saisie PIN"},inlineEdit:{placeholder:"Cliquer pour modifier…",save:"Enregistrer",cancel:"Annuler"},calendar:{monthNames:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],dayNames:["Di","Lu","Ma","Me","Je","Ve","Sa"],today:"Aujourd'hui",now:"Maintenant",week:"Sem",prevYear:"Année précédente",nextYear:"Année suivante",prevMonth:"Mois précédent",nextMonth:"Mois suivant",month:"Mois",year:"Année"},datePicker:{prevYear:"Année précédente",nextYear:"Année suivante",prevMonth:"Mois précédent",nextMonth:"Mois suivant"},form:{required:"*",optional:"(facultatif)",submitText:"Envoyer",resetText:"Réinitialiser"},upload:{uploadText:"Téléverser",removeFile:"Supprimer le fichier",uploadError:"Échec du téléversement",previewFile:"Aperçu",uploadAriaLabel:"Téléverser un fichier"},transfer:{titles:["Source","Cible"],searchPlaceholder:"Rechercher",itemUnit:"élément",itemsUnit:"éléments",notFoundContent:"Introuvable",selectAll:"Tout sélectionner",deselectAll:"Tout désélectionner"},drawer:{closeAriaLabel:"Fermer"},notification:{closeAriaLabel:"Fermer"},tag:{closeAriaLabel:"Fermer"},spin:{loading:"Chargement"},skeleton:{loading:"Chargement"},breadcrumb:{ariaLabel:"Fil d'Ariane"},carousel:{slide:t=>`Diapositive ${t}`},rate:{ariaLabel:"Évaluation",star:t=>`${t} étoile${t>1?"s":""}`},charts:{lineChart:"Graphique en courbes",barChart:"Graphique à barres",areaChart:"Graphique en aires",pieChart:"Graphique en secteurs",legend:"Légende du graphique",actions:"Actions du graphique"},cascader:{searchPlaceholder:"Rechercher...",noMatches:"Aucun résultat",clear:"Effacer",removeTag:"Supprimer"},treeSelect:{searchPlaceholder:"Rechercher...",noMatches:"Aucun résultat"},tree:{clearSearch:"Effacer la recherche"},dashboard:{ariaLabel:"Tableau de bord",editorAriaLabel:"Éditeur du tableau de bord",resizeWidget:"Redimensionner le widget",widgetActions:"Actions du widget"},gantt:{ariaLabel:"Diagramme de Gantt",resizeTask:"Redimensionner la tâche"},resourceCalendar:{ariaLabel:"Calendrier des ressources",resource:t=>`Ressource ${t}`,capacity:t=>`capacité ${t} par créneau`,resizeStart:"Redimensionner le début",resizeEnd:"Redimensionner la fin",conflictSuffix:" (conflit)"},timeline:{ariaLabel:"Chronologie"},diagram:{ariaLabel:"Diagramme"},dataGrid:{selectAllRows:"Sélectionner toutes les lignes",selectRow:"Sélectionner la ligne"},schemaFormEditor:{undo:"Annuler",redo:"Rétablir",removeOption:"Supprimer l'option",schemaView:"Schéma JSON généré",optionLabelPlaceholder:"Libellé",optionValuePlaceholder:"Valeur",moveFieldUp:"Déplacer vers le haut",moveFieldDown:"Déplacer vers le bas",duplicateField:"Dupliquer le champ",deleteField:"Supprimer le champ"},list:{loading:"Chargement"},table:{selectAll:"Tout sélectionner"},input:{clear:"Effacer"},colorPicker:{pickColor:"Choisir une couleur"}},Ph={modal:{okText:"Aceptar",cancelText:"Cancelar",closeAriaLabel:"Cerrar"},popconfirm:{okText:"Sí",cancelText:"No"},empty:{description:"Sin datos"},pagination:{totalPrefix:"Total",itemsPerPage:" / pág.",jump:"Ir a",page:"pág.",ariaLabel:"Paginación"},inputPassword:{showPassword:"Mostrar contraseña",hidePassword:"Ocultar contraseña",strengthWeak:"Débil",strengthMedium:"Medio",strengthStrong:"Fuerte",strengthVeryStrong:"Muy fuerte"},searchInput:{placeholder:"Buscar…",clear:"Limpiar",search:"Buscar"},tagInput:{placeholder:"Añadir etiqueta…",removeTag:"Eliminar"},pinInput:{ariaLabel:"Entrada de PIN"},inlineEdit:{placeholder:"Haga clic para editar…",save:"Guardar",cancel:"Cancelar"},calendar:{monthNames:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],dayNames:["Do","Lu","Ma","Mi","Ju","Vi","Sá"],today:"Hoy",now:"Ahora",week:"Sem",prevYear:"Año anterior",nextYear:"Año siguiente",prevMonth:"Mes anterior",nextMonth:"Mes siguiente",month:"Mes",year:"Año"},datePicker:{prevYear:"Año anterior",nextYear:"Año siguiente",prevMonth:"Mes anterior",nextMonth:"Mes siguiente"},form:{required:"*",optional:"(opcional)",submitText:"Enviar",resetText:"Restablecer"},upload:{uploadText:"Subir",removeFile:"Eliminar archivo",uploadError:"Error al subir",previewFile:"Vista previa",uploadAriaLabel:"Subir archivo"},transfer:{titles:["Origen","Destino"],searchPlaceholder:"Buscar",itemUnit:"elemento",itemsUnit:"elementos",notFoundContent:"No encontrado",selectAll:"Seleccionar todo",deselectAll:"Deseleccionar todo"},drawer:{closeAriaLabel:"Cerrar"},notification:{closeAriaLabel:"Cerrar"},tag:{closeAriaLabel:"Cerrar"},spin:{loading:"Cargando"},skeleton:{loading:"Cargando"},breadcrumb:{ariaLabel:"Ruta de navegación"},carousel:{slide:t=>`Diapositiva ${t}`},rate:{ariaLabel:"Calificación",star:t=>`${t} estrella${t>1?"s":""}`},charts:{lineChart:"Gráfico de líneas",barChart:"Gráfico de barras",areaChart:"Gráfico de áreas",pieChart:"Gráfico circular",legend:"Leyenda del gráfico",actions:"Acciones del gráfico"},cascader:{searchPlaceholder:"Buscar...",noMatches:"Sin coincidencias",clear:"Limpiar",removeTag:"Eliminar"},treeSelect:{searchPlaceholder:"Buscar...",noMatches:"Sin coincidencias"},tree:{clearSearch:"Limpiar búsqueda"},dashboard:{ariaLabel:"Panel",editorAriaLabel:"Editor del panel",resizeWidget:"Cambiar tamaño del widget",widgetActions:"Acciones del widget"},gantt:{ariaLabel:"Diagrama de Gantt",resizeTask:"Cambiar duración de la tarea"},resourceCalendar:{ariaLabel:"Calendario de recursos",resource:t=>`Recurso ${t}`,capacity:t=>`capacidad ${t} por franja`,resizeStart:"Mover el inicio",resizeEnd:"Mover el final",conflictSuffix:" (conflicto)"},timeline:{ariaLabel:"Línea de tiempo"},diagram:{ariaLabel:"Diagrama"},dataGrid:{selectAllRows:"Seleccionar todas las filas",selectRow:"Seleccionar fila"},schemaFormEditor:{undo:"Deshacer",redo:"Rehacer",removeOption:"Eliminar opción",schemaView:"Esquema JSON generado",optionLabelPlaceholder:"Etiqueta",optionValuePlaceholder:"Valor",moveFieldUp:"Mover campo arriba",moveFieldDown:"Mover campo abajo",duplicateField:"Duplicar campo",deleteField:"Eliminar campo"},list:{loading:"Cargando"},table:{selectAll:"Seleccionar todo"},input:{clear:"Limpiar"},colorPicker:{pickColor:"Elegir color"}};exports.DEFAULT_CHART_ANIMATION_MS=Xt;exports.DEFAULT_INDENT=Il;exports.DEFAULT_PALETTE=bt;exports.DEFAULT_PALETTE_ITEMS=Jl;exports.DEFAULT_TABLE_LOCALE=Pl;exports.DEFAULT_TREE_LOCALE=Rl;exports.NODE_HEIGHT=_l;exports.PALETTE_DATA_TYPE=Mt;exports.SgAreaChart=ks;exports.SgAutoComplete=ad;exports.SgAutoField=ul;exports.SgAvatar=Zf;exports.SgBadge=Hf;exports.SgBarChart=ps;exports.SgBreadcrumb=of;exports.SgButton=Xe;exports.SgCalendar=Tp;exports.SgCarousel=Qf;exports.SgCascader=ov;exports.SgChartAxes=Pt;exports.SgChartBrush=al;exports.SgChartCrosshair=jl;exports.SgChartHoverToolbar=Vs;exports.SgChartLegend=St;exports.SgCheckbox=rt;exports.SgCollapse=zh;exports.SgColorPicker=md;exports.SgConfigProvider=Da;exports.SgDashboard=lr;exports.SgDashboardEditor=rr;exports.SgDataGrid=Mo;exports.SgDatePicker=Qd;exports.SgDescriptions=Bh;exports.SgDiagram=Qs;exports.SgDrawer=jv;exports.SgDropdown=pf;exports.SgEmpty=Lg;exports.SgEventTimeline=Cr;exports.SgField=cl;exports.SgForm=il;exports.SgFormList=jr;exports.SgFormProvider=Yr;exports.SgGantt=yr;exports.SgHistoryPanel=Jc;exports.SgInlineEdit=$u;exports.SgInput=zt;exports.SgInputGroup=Du;exports.SgInputNumber=Fu;exports.SgInputPassword=au;exports.SgLineChart=is;exports.SgList=bo;exports.SgMentions=$v;exports.SgMenu=Jg;exports.SgModal=Av;exports.SgNotificationContainer=Uv;exports.SgPagination=Tt;exports.SgPieChart=xs;exports.SgPinInput=ku;exports.SgPopconfirm=lg;exports.SgProgress=kg;exports.SgRadio=Ou;exports.SgRangePicker=Om;exports.SgRate=Qu;exports.SgResourceCalendar=Mr;exports.SgResult=$g;exports.SgSchemaForm=Gl;exports.SgSchemaFormEditor=Hc;exports.SgSchemaFormEditorCanvas=ta;exports.SgSchemaFormEditorInspector=la;exports.SgSchemaFormEditorPalette=Zl;exports.SgSchemaFormEditorSchemaView=aa;exports.SgSearchInput=cu;exports.SgSegmented=Ff;exports.SgSelect=Al;exports.SgSkeleton=_g;exports.SgSlider=Gu;exports.SgSpin=Bt;exports.SgSteps=Vf;exports.SgSubmitButton=Ci;exports.SgSwitch=qu;exports.SgTable=Yn;exports.SgTabs=Gg;exports.SgTag=Yf;exports.SgTagInput=gu;exports.SgTextarea=Iu;exports.SgTimePicker=Gt;exports.SgTimeRangePicker=ap;exports.SgTimeline=sh;exports.SgTooltip=ig;exports.SgTransfer=Sv;exports.SgTransition=lt;exports.SgTree=qt;exports.SgTreeNodeRow=Ut;exports.SgTreeSelect=Bv;exports.SgUpload=Fp;exports.SgVirtualList=Bo;exports.buildPageRule=Kl;exports.buildPrintHtml=Hl;exports.chartBounds=At;exports.colorForSeries=tt;exports.createEmptyEditorSchema=ea;exports.createFieldFromPaletteType=pl;exports.de_DE=Fh;exports.defaultChartActions=ql;exports.downloadSvg=Wl;exports.downloadSvgAsPng=Ul;exports.editorSchemaToJsonSchema=It;exports.en_US=Th;exports.es_ES=Ph;exports.formContextKey=Et;exports.formProviderContextKey=rl;exports.fr_FR=Ah;exports.jsonSchemaToDefaults=ml;exports.jsonSchemaToEditorSchema=Ti;exports.jsonSchemaToFields=Xl;exports.jsonSchemaToRules=dl;exports.makeChartContextMenuHandler=Rs;exports.makeSeriesContextMenuHandler=Ps;exports.measureSvg=sl;exports.normalizePadding=Ol;exports.notification=ca;exports.printElement=at;exports.resolveBrushConfig=ll;exports.resolveChartActions=As;exports.resolveChartAnimation=wt;exports.ru_RU=Mh;exports.serializeSvg=nl;exports.sgConfigKey=kt;exports.triggerDownload=ol;exports.useChartSize=Ct;exports.useComputed=Ca;exports.useConfig=Ee;exports.useConfigWithDefaults=Ye;exports.useField=zl;exports.useFieldArray=Ba;exports.useFocusTrap=Ft;exports.useForm=Lt;exports.useGraph=wa;exports.useHistory=Na;exports.useListNavigation=$a;exports.useNotification=Wv;exports.useRovingTabIndex=xa;exports.useSchemaEditor=oa;exports.useTable=Ml;exports.useTree=Ll;exports.useVirtualScroll=el;exports.useWatch=Tl;exports.zh_CN=Lh;exports.zodDefaults=jc;exports.zodRule=sa;exports.zodRules=Oc;exports.zodToJsonSchema=Yc;
21
+ </html>`}function To(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function st(t,n={}){if(!t||typeof window>"u")return null;const l=window.open("","_blank");if(!l)return null;const a=ql(t.outerHTML,n);if(l.document.open(),l.document.write(a),l.document.close(),l.focus(),n.skipPrint)return l;const o=()=>{try{l.print()}catch{}if(!n.keepOpen)try{l.close()}catch{}};return l.document.readyState==="complete"?setTimeout(o,0):(l.addEventListener("load",()=>setTimeout(o,0),{once:!0}),setTimeout(o,300)),l}const Qt=600;function St(t){return t===!1?{enabled:!1,duration:0}:t===void 0||t===!0?{enabled:!0,duration:Qt}:{enabled:!0,duration:t.duration??Qt}}const Bt=["var(--sg-color-primary)","var(--sg-color-success)","var(--sg-color-warning)","var(--sg-color-error)","var(--sg-blue-4)","var(--sg-orange-5)","var(--sg-green-5)","var(--sg-red-5)"];function nt(t,n){return t.color??Bt[n%Bt.length]}function Xl(t){return t===void 0?[16,16,24,44]:typeof t=="number"?[t,t,t,t]:[...t]}function Lo(t){return Number.isInteger(t)?String(t):Math.abs(t)>=1e3?t.toFixed(0):Math.abs(t)>=1?t.toFixed(2).replace(/\.?0+$/,""):t.toFixed(2)}function Mo(t,n,l,a){const o=a??Lo,s=Math.max(2,l??5);let v=0;for(let c=0;c<s;c++){const r=c/(s-1),i=t+r*(n-t),d=o(i);d.length>v&&(v=d.length)}return v*7}function ol(t,n,l,a){const o=Xl(t);if(t!==void 0||!n)return o;const s=Mo(l,a,n.tickCount,n.tickFormatter),v=Math.ceil(s+14);return v>o[3]&&(o[3]=v),n.label&&(o[3]+=16),o}function Rt(t){let n=1/0,l=-1/0;for(const a of t)for(const o of a)o!=null&&(o<n&&(n=o),o>l&&(l=o));return(!Number.isFinite(n)||!Number.isFinite(l))&&(n=0,l=1),n===l&&(n-=1,l+=1),{min:n,max:l}}const Fo=["aria-label"],Ao=["data-series-id"],Po={class:"sg-chart-legend-label"},Et=e.defineComponent({__name:"ChartLegend",props:{series:{},unstyled:{type:Boolean,default:!1},className:{}},setup(t){const n=t,l=e.computed(()=>n.series.map((s,v)=>({id:s.id,label:s.label,color:nt(s,v)}))),a=Ce(),o=e.computed(()=>{var s,v;return((v=(s=a.value.locale)==null?void 0:s.charts)==null?void 0:v.legend)??"Chart legend"});return(s,v)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([!n.unstyled&&"sg-chart-legend",n.className]),role:"list","aria-label":o.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,c=>(e.openBlock(),e.createElementBlock("span",{key:c.id,class:"sg-chart-legend-item",role:"listitem","data-series-id":c.id},[e.createElementVNode("span",{class:"sg-chart-legend-swatch",style:e.normalizeStyle({background:c.color})},null,4),e.createElementVNode("span",Po,e.toDisplayString(c.label),1)],8,Ao))),128))],10,Fo))}}),Ro={key:0,class:"sg-chart-axis sg-chart-axis-y"},Io=["x1","y1","x2","y2"],Ko=["x","y"],Oo=["x","y","transform"],Ho={key:1,class:"sg-chart-axis sg-chart-axis-x"},jo=["x","y"],_o=["x","y"],It=e.defineComponent({__name:"ChartAxes",props:{x:{},y:{},plotW:{},plotH:{},categories:{},yMin:{},yMax:{},xAxis:{},yAxis:{},unstyled:{type:Boolean,default:!1}},setup(t){const n=t;function l(c){return Number.isInteger(c)?String(c):Math.abs(c)>=1e3?c.toFixed(0):Math.abs(c)>=1?c.toFixed(2).replace(/\.?0+$/,""):c.toFixed(2)}const a=c=>{var r;return(r=n.yAxis)!=null&&r.tickFormatter?n.yAxis.tickFormatter(c):l(c)},o=(c,r)=>{var i;return(i=n.xAxis)!=null&&i.tickFormatter?n.xAxis.tickFormatter(c,r):String(c)},s=e.computed(()=>{var i;const c=Math.max(2,((i=n.yAxis)==null?void 0:i.tickCount)??5),r=[];for(let d=0;d<c;d++){const u=d/(c-1),p=n.yMin+(n.yMax-n.yMin)*(1-u);r.push({value:p,y:n.y+n.plotH*u})}return r}),v=e.computed(()=>{var i;if(n.categories.length===0)return[];const c=Math.min(n.categories.length,Math.max(2,((i=n.xAxis)==null?void 0:i.tickCount)??n.categories.length)),r=[];for(let d=0;d<c;d++){const u=c===1?0:Math.round(d*(n.categories.length-1)/(c-1)),p=n.categories.length===1?0:u/(n.categories.length-1);r.push({label:o(n.categories[u],u),x:n.x+n.plotW*p})}return r});return(c,r)=>{var i,d;return e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass(!n.unstyled&&"sg-chart-axes")},[n.yAxis?(e.openBlock(),e.createElementBlock("g",Ro,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(u,p)=>{var m;return e.withDirectives((e.openBlock(),e.createElementBlock("line",{key:`yg-${p}`,x1:n.x,y1:u.y,x2:n.x+n.plotW,y2:u.y,class:"sg-chart-axis-grid",stroke:"currentColor","stroke-opacity":"0.1","vector-effect":"non-scaling-stroke"},null,8,Io)),[[e.vShow,(m=n.yAxis)==null?void 0:m.gridLines]])}),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(u,p)=>(e.openBlock(),e.createElementBlock("text",{key:`yt-${p}`,x:n.x-6,y:u.y+4,"text-anchor":"end",class:"sg-chart-axis-label","font-size":"10",fill:"currentColor"},e.toDisplayString(a(u.value)),9,Ko))),128)),(i=n.yAxis)!=null&&i.label?(e.openBlock(),e.createElementBlock("text",{key:0,x:n.x-28,y:n.y+n.plotH/2,transform:`rotate(-90, ${n.x-28}, ${n.y+n.plotH/2})`,"text-anchor":"middle",class:"sg-chart-axis-title","font-size":"11",fill:"currentColor"},e.toDisplayString(n.yAxis.label),9,Oo)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),n.xAxis?(e.openBlock(),e.createElementBlock("g",Ho,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(u,p)=>(e.openBlock(),e.createElementBlock("text",{key:`xt-${p}`,x:u.x,y:n.y+n.plotH+14,"text-anchor":"middle",class:"sg-chart-axis-label","font-size":"10",fill:"currentColor"},e.toDisplayString(u.label),9,jo))),128)),(d=n.xAxis)!=null&&d.label?(e.openBlock(),e.createElementBlock("text",{key:0,x:n.x+n.plotW/2,y:n.y+n.plotH+28,"text-anchor":"middle",class:"sg-chart-axis-title","font-size":"11",fill:"currentColor"},e.toDisplayString(n.xAxis.label),9,_o)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2)}}}),Yo=["x1","x2","y1","y2"],Wo=["cx","cy","fill"],Uo=["x","y","height"],qo=["x","y"],Xo=["x","y","fill"],Go=["x","y"],Jo=["x","y"],Dt=140,dt=14,rt=6,Xt=10,Gl=e.defineComponent({__name:"ChartCrosshair",props:{x:{},plotX:{},plotY:{},plotH:{},plotW:{},category:{},points:{},unstyled:{type:Boolean},valueFormatter:{type:Function}},setup(t){const n=t;function l(c){return Number.isInteger(c)?String(c):Math.abs(c)>=100?c.toFixed(0):c.toFixed(2).replace(/\.?0+$/,"")}const a=e.computed(()=>n.valueFormatter??l),o=c=>n.unstyled?void 0:`sg-chart-crosshair-${c}`,s=e.computed(()=>{const c=dt+2,r=rt*2+c+n.points.length*dt,d=n.x+Xt+Dt<=n.plotX+n.plotW?n.x+Xt:n.x-Xt-Dt,u=Math.max(n.plotY,Math.min(n.plotY+n.plotH-r,n.plotY+4));return{tipX:d,tipY:u,tipHeight:r,headerHeight:c}});function v(c){return s.value.tipY+rt+s.value.headerHeight+c*dt}return(c,r)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass(n.unstyled?void 0:"sg-chart-crosshair"),"data-sg-chart-crosshair":"","pointer-events":"none"},[e.createElementVNode("line",{class:e.normalizeClass(o("line")),"data-sg-chart-crosshair-line":"",x1:n.x,x2:n.x,y1:n.plotY,y2:n.plotY+n.plotH,stroke:"var(--sg-color-text-secondary)","stroke-width":1,"stroke-dasharray":"3 3",opacity:.7},null,10,Yo),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.points,(i,d)=>(e.openBlock(),e.createElementBlock("circle",{key:`dot-${d}`,class:e.normalizeClass(o("dot")),"data-sg-chart-crosshair-dot":"",cx:n.x,cy:i.y,r:3.5,fill:i.color,stroke:"var(--sg-color-bg, #fff)","stroke-width":1.5},null,10,Wo))),128)),e.createElementVNode("g",{class:e.normalizeClass(o("tooltip")),"data-sg-chart-crosshair-tooltip":""},[e.createElementVNode("rect",{class:e.normalizeClass(o("tooltip-bg")),x:s.value.tipX,y:s.value.tipY,width:Dt,height:s.value.tipHeight,rx:4,ry:4,fill:"var(--sg-color-bg, #fff)",stroke:"var(--sg-color-border)","stroke-width":1},null,10,Uo),e.createElementVNode("text",{class:e.normalizeClass(o("tooltip-title")),x:s.value.tipX+rt,y:s.value.tipY+rt+dt-3,"font-size":11,"font-weight":600,fill:"var(--sg-color-text)"},e.toDisplayString(String(n.category)),11,qo),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.points,(i,d)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`row-${d}`},[e.createElementVNode("rect",{x:s.value.tipX+rt,y:v(d)+2,width:8,height:8,rx:1,fill:i.color},null,8,Xo),e.createElementVNode("text",{class:e.normalizeClass(o("tooltip-label")),x:s.value.tipX+rt+12,y:v(d)+dt-3,"font-size":11,fill:"var(--sg-color-text-secondary)"},e.toDisplayString(i.label),11,Go),e.createElementVNode("text",{class:e.normalizeClass(o("tooltip-value")),x:s.value.tipX+Dt-rt,y:v(d)+dt-3,"font-size":11,"font-weight":500,fill:"var(--sg-color-text)","text-anchor":"end"},e.toDisplayString(a.value(i.value)),11,Jo)],64))),128))],2)],2))}}),Zo=["x","y","width","height"],Qo=["x","y","width","height","fill","stroke"];function sl(t){return t==null||t===!1?null:t===!0?{}:t}const rl=e.defineComponent({__name:"ChartBrush",props:{plotX:{},plotY:{},plotW:{},plotH:{},categoryCount:{},range:{},unstyled:{type:Boolean},fill:{},disabled:{type:Boolean}},emits:["update:range","change"],setup(t,{emit:n}){const l=t,a=n,o="var(--sg-color-primary)",s=e.ref(null),v=e.ref(null),c=S=>l.unstyled?void 0:`sg-chart-brush-${S}`;function r(S,C,b,$){if($<=0||$===1||!Number.isFinite(S)||!Number.isFinite(b)||b<=0)return 0;const T=b/($-1);if(T<=0||!Number.isFinite(T))return 0;const z=Math.round((S-C)/T);return Number.isFinite(z)?Math.max(0,Math.min($-1,z)):0}function i(S,C,b,$){if($<=1)return C;const T=b/($-1);return C+S*T}function d(S){var K;const C=v.value,b=C==null?void 0:C.ownerSVGElement;if(!b)return null;const $=b.getBoundingClientRect();if(!$.width||!Number.isFinite($.width))return null;let T=600;try{const L=(K=b.viewBox)==null?void 0:K.baseVal;if(L&&L.width>0)T=L.width;else{const I=b.getAttribute("viewBox");if(I){const U=I.trim().split(/\s+/),O=Number.parseFloat(U[2]??"");Number.isFinite(O)&&O>0&&(T=O)}}}catch{}const z=(S-$.left)/$.width*T;return r(z,l.plotX,l.plotW,l.categoryCount)}function u(S,C){var b;try{(b=S.setPointerCapture)==null||b.call(S,C)}catch{}}function p(S,C){var b;try{(b=S.releasePointerCapture)==null||b.call(S,C)}catch{}}function m(S){a("update:range",S),a("change",S)}function k(S){if(l.disabled||l.categoryCount===0)return;const C=d(S.clientX);C!==null&&(S.preventDefault(),u(S.currentTarget,S.pointerId),s.value={startIdx:C,endIdx:C})}function f(S){if(!s.value)return;const C=d(S.clientX);C!==null&&(s.value={...s.value,endIdx:C})}function w(S){if(!s.value)return;p(S.currentTarget,S.pointerId);const b=d(S.clientX)??s.value.endIdx,$=Math.min(s.value.startIdx,b),T=Math.max(s.value.startIdx,b);m({from:$,to:T}),s.value=null}function B(S){s.value&&(p(S.currentTarget,S.pointerId),s.value=null)}function E(S){l.disabled||(S.preventDefault(),m(null))}const N=e.computed(()=>{if(s.value){const S=Math.min(s.value.startIdx,s.value.endIdx),C=Math.max(s.value.startIdx,s.value.endIdx);return{from:S,to:C}}if(l.range){const S=Math.min(l.range.from,l.range.to),C=Math.max(l.range.from,l.range.to);return{from:Math.max(0,Math.min(l.categoryCount-1,S)),to:Math.max(0,Math.min(l.categoryCount-1,C))}}return null}),x=e.computed(()=>{const S=N.value;if(!S)return null;const C=i(S.from,l.plotX,l.plotW,l.categoryCount),b=i(S.to,l.plotX,l.plotW,l.categoryCount),$=Math.min(C,b),T=Math.max(C,b),z=Math.max(2,T-$);return{left:$,w:z}}),y=e.computed(()=>l.fill??o),P=e.computed(()=>l.disabled?{cursor:"not-allowed"}:{cursor:"crosshair"});return(S,C)=>(e.openBlock(),e.createElementBlock("g",{class:e.normalizeClass(l.unstyled?void 0:"sg-chart-brush"),"data-sg-chart-brush":""},[e.createElementVNode("rect",{ref_key:"overlayRef",ref:v,class:e.normalizeClass(c("overlay")),"data-sg-chart-brush-overlay":"",x:l.plotX,y:l.plotY,width:Math.max(0,l.plotW),height:Math.max(0,l.plotH),fill:"transparent",style:e.normalizeStyle(P.value),onPointerdown:k,onPointermove:f,onPointerup:w,onPointercancel:B,onDblclick:E},null,46,Zo),x.value?(e.openBlock(),e.createElementBlock("rect",{key:0,class:e.normalizeClass(c("selection")),"data-sg-chart-brush-selection":"",x:x.value.left,y:l.plotY,width:x.value.w,height:Math.max(0,l.plotH),fill:y.value,"fill-opacity":.15,stroke:y.value,"stroke-opacity":.5,"stroke-width":1,"pointer-events":"none"},null,10,Qo)):e.createCommentVNode("",!0)],2))}}),es=["data-animate"],ts=["viewBox","width","height","aria-label"],ls={class:"sg-chart-line-paths"},as=["d","stroke","stroke-width","data-series-id"],ns={key:0,class:"sg-chart-line-markers"},os=["cx","cy","fill"],ss=e.defineComponent({__name:"LineChart",props:{markers:{type:Boolean,default:!0},strokeWidth:{default:2},crosshair:{type:[Boolean,Object],default:!1},brush:{type:[Boolean,Object]},categories:{},series:{},width:{default:"100%"},height:{default:200},className:{},style:{},unstyled:{type:Boolean,default:!1},padding:{},legend:{type:Boolean,default:!1},animate:{type:[Boolean,Object]},xAxis:{},yAxis:{},fileName:{default:"chart"}},setup(t,{expose:n}){var G;const l=t,a=e.ref(null),o=e.ref(null),s=Ce(),v=e.computed(()=>{var Y,M;return((M=(Y=s.value.locale)==null?void 0:Y.charts)==null?void 0:M.lineChart)??"Line chart"}),c=e.computed(()=>typeof l.width=="number"&&Number.isFinite(l.width)?l.width:600),r=e.computed(()=>typeof l.height=="number"&&Number.isFinite(l.height)?l.height:200),{size:i}=wt(o,{width:c.value,height:r.value}),d=e.computed(()=>Rt(l.series.map(Y=>Y.values))),u=e.computed(()=>ol(l.padding,l.yAxis,d.value.min,d.value.max)),p=e.computed(()=>i.value.width),m=e.computed(()=>i.value.height),k=e.computed(()=>u.value[3]),f=e.computed(()=>u.value[0]),w=e.computed(()=>Math.max(0,p.value-u.value[3]-u.value[1])),B=e.computed(()=>Math.max(0,m.value-u.value[0]-u.value[2])),E=e.computed(()=>St(l.animate)),N=Y=>{const M=l.categories.length;return M<=1?k.value:k.value+w.value*Y/(M-1)},x=Y=>{const{min:M,max:g}=d.value;return g===M?f.value+B.value/2:f.value+B.value*(1-(Y-M)/(g-M))},y=e.computed(()=>l.series.map((Y,M)=>{const g=nt(Y,M),h=[];let V=[];return Y.values.forEach((F,R)=>{if(F==null)V.length>0&&(h.push(V.join(" ")),V=[]);else{const X=V.length===0?"M":"L";V.push(`${X}${N(R)},${x(F)}`)}}),V.length>0&&h.push(V.join(" ")),{id:Y.id,color:g,label:Y.label,segments:h}})),P=e.computed(()=>E.value.enabled?{"--sg-chart-anim-duration":`${E.value.duration}ms`}:void 0);function S(Y,M){if(!E.value.enabled)return;const g=E.value.duration;return{strokeDasharray:1,strokeDashoffset:1,animationDelay:`${M/Math.max(1,Y)*g}ms`,animationDuration:`${g/Math.max(1,Y)}ms`}}const C=e.computed(()=>l.series.flatMap((Y,M)=>{const g=nt(Y,M);return Y.values.map((h,V)=>h==null?null:{id:`${Y.id}-${V}`,color:g,x:N(V),y:x(h)}).filter(Boolean)})),b=e.computed(()=>l.crosshair!==!1&&l.categories.length>0),$=e.computed(()=>typeof l.crosshair=="object"&&l.crosshair!==null?l.crosshair.valueFormatter:void 0),T=e.ref(null);function z(Y){if(!b.value)return;const g=Y.currentTarget.getBoundingClientRect();if(g.width===0)return;const h=(Y.clientX-g.left)/g.width*p.value,V=l.categories.length;if(V===1){T.value=0;return}const F=w.value/(V-1);if(F<=0){T.value=null;return}const R=Math.round((h-k.value)/F);if(R<0||R>=V){T.value=null;return}T.value=R}function K(){b.value&&(T.value=null)}const L=e.computed(()=>{const Y=T.value;if(Y===null)return[];const M=[];return l.series.forEach((g,h)=>{const V=g.values[Y];V!=null&&M.push({label:g.label,value:V,color:nt(g,h),y:x(V)})}),M}),I=e.computed(()=>sl(l.brush)),U=e.computed(()=>I.value!=null&&"range"in I.value),O=e.ref(((G=I.value)==null?void 0:G.defaultRange)??null),q=e.computed(()=>U.value?I.value.range??null:O.value);function ae(Y){var M,g;U.value||(O.value=Y),(g=(M=I.value)==null?void 0:M.onRangeChange)==null||g.call(M,Y)}return n({print:(Y={})=>{const M=a.value;M&&st(M,{fileName:Y.fileName??l.fileName??"chart"})},exportSvg:()=>{const Y=o.value;return Y?new XMLSerializer().serializeToString(Y):null}}),(Y,M)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:a,class:e.normalizeClass([!l.unstyled&&"sg-chart sg-chart-line",l.className]),style:e.normalizeStyle({width:typeof l.width=="number"?`${l.width}px`:l.width}),"data-animate":E.value.enabled?"on":"off"},[(e.openBlock(),e.createElementBlock("svg",{ref_key:"svgRef",ref:o,viewBox:`0 0 ${p.value} ${m.value}`,width:typeof l.width=="number"?l.width:"100%",height:l.height,role:"img","aria-label":v.value,onMousemove:M[0]||(M[0]=g=>b.value?z(g):void 0),onMouseleave:M[1]||(M[1]=g=>b.value?K():void 0)},[e.createVNode(It,{x:k.value,y:f.value,plotW:w.value,plotH:B.value,categories:l.categories,yMin:d.value.min,yMax:d.value.max,xAxis:l.xAxis,yAxis:l.yAxis,unstyled:l.unstyled},null,8,["x","y","plotW","plotH","categories","yMin","yMax","xAxis","yAxis","unstyled"]),e.createElementVNode("g",ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,g=>(e.openBlock(),e.createElementBlock("g",{key:g.id,class:e.normalizeClass([E.value.enabled&&!l.unstyled&&"sg-chart-line-animate"]),style:e.normalizeStyle(P.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.segments,(h,V)=>(e.openBlock(),e.createElementBlock("path",{key:`${g.id}-${V}`,class:e.normalizeClass([E.value.enabled&&!l.unstyled&&"sg-chart-line-segment-animate"]),d:h,stroke:g.color,"stroke-width":l.strokeWidth,pathLength:"1",fill:"none","vector-effect":"non-scaling-stroke","data-series-id":g.id,style:e.normalizeStyle(S(g.segments.length,V))},null,14,as))),128))],6))),128))]),l.markers?(e.openBlock(),e.createElementBlock("g",ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,g=>(e.openBlock(),e.createElementBlock("circle",{key:g.id,cx:g.x,cy:g.y,r:"3",fill:g.color},null,8,os))),128))])):e.createCommentVNode("",!0),b.value&&T.value!==null&&L.value.length>0?(e.openBlock(),e.createBlock(Gl,{key:1,x:N(T.value),"plot-x":k.value,"plot-y":f.value,"plot-h":B.value,"plot-w":w.value,category:l.categories[T.value],points:L.value,unstyled:l.unstyled,"value-formatter":$.value},null,8,["x","plot-x","plot-y","plot-h","plot-w","category","points","unstyled","value-formatter"])):e.createCommentVNode("",!0),I.value?(e.openBlock(),e.createBlock(rl,{key:2,"plot-x":k.value,"plot-y":f.value,"plot-w":w.value,"plot-h":B.value,"category-count":l.categories.length,range:q.value,unstyled:l.unstyled,fill:I.value.fill,disabled:I.value.disabled,onChange:ae},null,8,["plot-x","plot-y","plot-w","plot-h","category-count","range","unstyled","fill","disabled"])):e.createCommentVNode("",!0)],40,ts)),l.legend?(e.openBlock(),e.createBlock(Et,{key:0,series:l.series,unstyled:l.unstyled},null,8,["series","unstyled"])):e.createCommentVNode("",!0)],14,es))}}),rs=["data-animate"],is=["viewBox","width","height","aria-label"],cs={class:"sg-chart-bars"},us=["x","y","width","height","rx","ry","fill","data-series-id"],ds=e.defineComponent({__name:"BarChart",props:{stacked:{type:Boolean,default:!1},cornerRadius:{default:0},categories:{},series:{},width:{default:"100%"},height:{default:200},className:{},style:{},unstyled:{type:Boolean,default:!1},padding:{},legend:{type:Boolean,default:!1},animate:{type:[Boolean,Object]},xAxis:{},yAxis:{},fileName:{default:"chart"}},setup(t,{expose:n}){const l=t,a=e.ref(null),o=e.ref(null),s=Ce(),v=e.computed(()=>{var b,$;return(($=(b=s.value.locale)==null?void 0:b.charts)==null?void 0:$.barChart)??"Bar chart"}),c=e.computed(()=>typeof l.width=="number"&&Number.isFinite(l.width)?l.width:600),r=e.computed(()=>typeof l.height=="number"&&Number.isFinite(l.height)?l.height:200),{size:i}=wt(o,{width:c.value,height:r.value}),d=e.computed(()=>St(l.animate)),u=e.computed(()=>l.series.map(b=>b.values)),p=e.computed(()=>l.stacked?l.categories.map(($,T)=>{let z=0;for(const K of u.value){const L=K[T];L!=null&&(z+=L)}return z}):null),m=e.computed(()=>{if(l.stacked&&p.value){const T=Math.max(0,...p.value);return{min:0,max:T===0?1:T}}const{min:b,max:$}=Rt(u.value);return{min:Math.min(0,b),max:Math.max(0,$)}}),k=e.computed(()=>ol(l.padding,l.yAxis,m.value.min,m.value.max)),f=e.computed(()=>i.value.width),w=e.computed(()=>i.value.height),B=e.computed(()=>k.value[3]),E=e.computed(()=>k.value[0]),N=e.computed(()=>Math.max(0,f.value-k.value[3]-k.value[1])),x=e.computed(()=>Math.max(0,w.value-k.value[0]-k.value[2])),y=b=>{const{min:$,max:T}=m.value;return T===$?E.value+x.value/2:E.value+x.value*(1-(b-$)/(T-$))},P=e.computed(()=>{const b=l.categories.length;if(b===0)return[];const $=N.value/b,z=$*(1-.1),K=($-z)/2,L=[];if(l.stacked)for(let I=0;I<b;I++){let U=0;for(let O=0;O<l.series.length;O++){const q=l.series[O],ae=q.values[I];if(ae==null)continue;const G=y(U),Y=y(U+ae),M=B.value+I*$+K,g=z,h=Math.min(G,Y),V=Math.abs(G-Y);L.push({seriesId:q.id,label:q.label,color:nt(q,O),x:M,y:h,width:g,height:V,rx:l.cornerRadius,categoryIndex:I,originY:ae>=0?G:Y}),U+=ae}}else{const I=Math.max(1,l.series.length),U=z/I,O=y(0);for(let q=0;q<b;q++)for(let ae=0;ae<l.series.length;ae++){const G=l.series[ae],Y=G.values[q];if(Y==null)continue;const M=B.value+q*$+K+ae*U,g=y(Y),h=Math.min(O,g),V=Math.abs(O-g);L.push({seriesId:G.id,label:G.label,color:nt(G,ae),x:M,y:h,width:U*.95,height:V,rx:l.cornerRadius,categoryIndex:q,originY:O})}}return L}),S=e.computed(()=>Math.max(1,l.categories.length));function C(b){if(!d.value.enabled)return;const $=d.value.duration;return{transformOrigin:`${b.x+b.width/2}px ${b.originY}px`,animationDuration:`${$}ms`,animationDelay:`${b.categoryIndex/S.value*($*.3)}ms`}}return n({print:(b={})=>{const $=a.value;$&&st($,{fileName:b.fileName??l.fileName??"chart"})},exportSvg:()=>{const b=o.value;return b?new XMLSerializer().serializeToString(b):null}}),(b,$)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:a,class:e.normalizeClass([!l.unstyled&&"sg-chart sg-chart-bar",l.className]),style:e.normalizeStyle({width:typeof l.width=="number"?`${l.width}px`:l.width}),"data-animate":d.value.enabled?"on":"off"},[(e.openBlock(),e.createElementBlock("svg",{ref_key:"svgRef",ref:o,viewBox:`0 0 ${f.value} ${w.value}`,width:typeof l.width=="number"?l.width:"100%",height:l.height,role:"img","aria-label":v.value},[e.createVNode(It,{x:B.value,y:E.value,plotW:N.value,plotH:x.value,categories:l.categories,yMin:m.value.min,yMax:m.value.max,xAxis:l.xAxis,yAxis:l.yAxis,unstyled:l.unstyled},null,8,["x","y","plotW","plotH","categories","yMin","yMax","xAxis","yAxis","unstyled"]),e.createElementVNode("g",cs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(T,z)=>{var K;return e.openBlock(),e.createElementBlock("rect",{key:`${T.seriesId}-${T.categoryIndex}-${z}`,class:e.normalizeClass([d.value.enabled&&!l.unstyled&&"sg-chart-bar-animate"]),x:T.x,y:T.y,width:T.width,height:T.height,rx:T.rx,ry:T.rx,fill:T.color,"data-series-id":T.seriesId,style:e.normalizeStyle(C(T))},[e.createElementVNode("title",null,e.toDisplayString(T.label)+": "+e.toDisplayString((K=l.series[T.seriesId===T.seriesId,0])==null?void 0:K.values[T.categoryIndex]),1)],14,us)}),128))])],8,is)),l.legend?(e.openBlock(),e.createBlock(Et,{key:0,series:l.series,unstyled:l.unstyled},null,8,["series","unstyled"])):e.createCommentVNode("",!0)],14,rs))}}),ms=["data-animate"],ps=["viewBox","width","height","aria-label"],vs={class:"sg-chart-area-paths"},gs=["d","fill","fill-opacity","data-series-id"],fs=["d","stroke","stroke-width"],hs=e.defineComponent({__name:"AreaChart",props:{stacked:{type:Boolean,default:!1},fillOpacity:{default:.3},strokeWidth:{default:2},brush:{type:[Boolean,Object]},categories:{},series:{},width:{default:"100%"},height:{default:200},className:{},style:{},unstyled:{type:Boolean,default:!1},padding:{},legend:{type:Boolean,default:!1},animate:{type:[Boolean,Object]},xAxis:{},yAxis:{},fileName:{default:"chart"}},setup(t,{expose:n}){var L;const l=t,a=e.ref(null),o=e.ref(null),s=Ce(),v=e.computed(()=>{var I,U;return((U=(I=s.value.locale)==null?void 0:I.charts)==null?void 0:U.areaChart)??"Area chart"}),c=e.computed(()=>typeof l.width=="number"&&Number.isFinite(l.width)?l.width:600),r=e.computed(()=>typeof l.height=="number"&&Number.isFinite(l.height)?l.height:200),{size:i}=wt(o,{width:c.value,height:r.value}),d=e.computed(()=>St(l.animate)),u=e.computed(()=>{if(!l.stacked)return null;const I=l.series.map(()=>l.categories.map(()=>0));for(let U=0;U<l.categories.length;U++){let O=0;for(let q=0;q<l.series.length;q++){const ae=l.series[q].values[U];ae==null||(O+=ae),I[q][U]=O}}return I}),p=e.computed(()=>{if(l.stacked&&u.value){const O=u.value[u.value.length-1],q=Math.max(0,...O);return{min:0,max:q===0?1:q}}const{min:I,max:U}=Rt(l.series.map(O=>O.values));return{min:Math.min(0,I),max:Math.max(0,U)}}),m=e.computed(()=>ol(l.padding,l.yAxis,p.value.min,p.value.max)),k=e.computed(()=>i.value.width),f=e.computed(()=>i.value.height),w=e.computed(()=>m.value[3]),B=e.computed(()=>m.value[0]),E=e.computed(()=>Math.max(0,k.value-m.value[3]-m.value[1])),N=e.computed(()=>Math.max(0,f.value-m.value[0]-m.value[2])),x=I=>{const U=l.categories.length;return U<=1?w.value:w.value+E.value*I/(U-1)},y=I=>{const{min:U,max:O}=p.value;return O===U?B.value+N.value/2:B.value+N.value*(1-(I-U)/(O-U))},P=e.computed(()=>y(0)),S=e.computed(()=>l.series.map((I,U)=>{const O=nt(I,U),q=[],ae=[];for(let g=0;g<l.categories.length;g++){let h,V=P.value;if(l.stacked&&u.value){const F=u.value[U][g],R=U>0?u.value[U-1][g]:0;h=F,V=y(R)}else h=I.values[g]??null;h!=null&&(q.push({x:x(g),y:y(h)}),ae.push({x:x(g),y:V}))}if(q.length===0)return{id:I.id,color:O,label:I.label,areaPath:"",linePath:""};const G=q.map((g,h)=>`${h===0?"M":"L"}${g.x},${g.y}`).join(" "),Y=[...ae].reverse(),M=`${G} ${Y.map(g=>`L${g.x},${g.y}`).join(" ")} Z`;return{id:I.id,color:O,label:I.label,areaPath:M,linePath:G}})),C=e.computed(()=>sl(l.brush)),b=e.computed(()=>C.value!=null&&"range"in C.value),$=e.ref(((L=C.value)==null?void 0:L.defaultRange)??null),T=e.computed(()=>b.value?C.value.range??null:$.value);function z(I){var U,O;b.value||($.value=I),(O=(U=C.value)==null?void 0:U.onRangeChange)==null||O.call(U,I)}const K=e.computed(()=>d.value.enabled?{"--sg-chart-anim-duration":`${d.value.duration}ms`}:void 0);return n({print:(I={})=>{const U=a.value;U&&st(U,{fileName:I.fileName??l.fileName??"chart"})},exportSvg:()=>{const I=o.value;return I?new XMLSerializer().serializeToString(I):null}}),(I,U)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:a,class:e.normalizeClass([!l.unstyled&&"sg-chart sg-chart-area",l.className]),style:e.normalizeStyle({width:typeof l.width=="number"?`${l.width}px`:l.width}),"data-animate":d.value.enabled?"on":"off"},[(e.openBlock(),e.createElementBlock("svg",{ref_key:"svgRef",ref:o,viewBox:`0 0 ${k.value} ${f.value}`,width:typeof l.width=="number"?l.width:"100%",height:l.height,role:"img","aria-label":v.value},[e.createVNode(It,{x:w.value,y:B.value,plotW:E.value,plotH:N.value,categories:l.categories,yMin:p.value.min,yMax:p.value.max,xAxis:l.xAxis,yAxis:l.yAxis,unstyled:l.unstyled},null,8,["x","y","plotW","plotH","categories","yMin","yMax","xAxis","yAxis","unstyled"]),e.createElementVNode("g",vs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,O=>(e.openBlock(),e.createElementBlock("path",{key:`${O.id}-area`,class:e.normalizeClass([d.value.enabled&&!l.unstyled&&"sg-chart-area-animate"]),d:O.areaPath,fill:O.color,"fill-opacity":l.fillOpacity,"data-series-id":O.id,style:e.normalizeStyle(K.value)},null,14,gs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,O=>(e.openBlock(),e.createElementBlock("path",{key:`${O.id}-line`,class:e.normalizeClass([d.value.enabled&&!l.unstyled&&"sg-chart-area-animate"]),d:O.linePath,stroke:O.color,"stroke-width":l.strokeWidth,fill:"none","vector-effect":"non-scaling-stroke",style:e.normalizeStyle(K.value)},null,14,fs))),128))]),C.value?(e.openBlock(),e.createBlock(rl,{key:0,"plot-x":w.value,"plot-y":B.value,"plot-w":E.value,"plot-h":N.value,"category-count":l.categories.length,range:T.value,unstyled:l.unstyled,fill:C.value.fill,disabled:C.value.disabled,onChange:z},null,8,["plot-x","plot-y","plot-w","plot-h","category-count","range","unstyled","fill","disabled"])):e.createCommentVNode("",!0)],8,ps)),l.legend?(e.openBlock(),e.createBlock(Et,{key:0,series:l.series,unstyled:l.unstyled},null,8,["series","unstyled"])):e.createCommentVNode("",!0)],14,ms))}}),ys=["data-animate"],ks=["viewBox","width","height","aria-label"],bs={class:"sg-chart-pie-slices"},Bs=["d","fill","data-series-id"],Cs={key:0,class:"sg-chart-pie-labels"},ws=["x","y"],Ss=e.defineComponent({__name:"PieChart",props:{innerRadius:{default:0},labels:{type:Boolean,default:!1},categories:{},series:{},width:{default:"100%"},height:{default:240},className:{},style:{},unstyled:{type:Boolean,default:!1},legend:{type:Boolean,default:!1},animate:{type:[Boolean,Object]},fileName:{default:"chart"}},setup(t,{expose:n}){const l=t,a=e.ref(null),o=e.ref(null),s=Ce(),v=e.computed(()=>{var S,C;return((C=(S=s.value.locale)==null?void 0:S.charts)==null?void 0:C.pieChart)??"Pie chart"}),c=e.computed(()=>typeof l.width=="number"&&Number.isFinite(l.width)?l.width:320),r=e.computed(()=>typeof l.height=="number"&&Number.isFinite(l.height)?l.height:240),{size:i}=wt(o,{width:c.value,height:r.value}),d=e.computed(()=>i.value.width),u=e.computed(()=>i.value.height),p=e.computed(()=>d.value/2),m=e.computed(()=>u.value/2),k=e.computed(()=>Math.max(0,Math.min(d.value,u.value)/2-8)),f=e.computed(()=>Math.max(0,Math.min(.95,l.innerRadius))*k.value),w=e.computed(()=>St(l.animate)),B=e.computed(()=>{const S=l.categories,C=l.series;if(!C.length)return[];const b=C[0];return S.length>0&&C.length===1&&b!=null&&b.values.length===S.length&&b?S.map((T,z)=>({id:`${b.id}-${z}`,label:String(T),color:Bt[z%Bt.length],value:Math.max(0,Number(b.values[z]??0))})):C.map((T,z)=>({id:T.id,label:T.label,color:nt(T,z),value:Math.max(0,Number(T.values[0]??0))}))}),E=e.computed(()=>{let S=0;for(const C of B.value)C.value>0&&(S+=C.value);return S}),N=e.computed(()=>B.value.map(S=>({id:S.id,label:S.label,color:S.color,values:[S.value]})));function x(S,C){const b=k.value,$=f.value;if(C-S>=Math.PI*2-1e-6)return $<=0?[`M${p.value-b},${m.value}`,`A${b},${b} 0 1 1 ${p.value+b},${m.value}`,`A${b},${b} 0 1 1 ${p.value-b},${m.value}`,"Z"].join(" "):[`M${p.value-b},${m.value}`,`A${b},${b} 0 1 1 ${p.value+b},${m.value}`,`A${b},${b} 0 1 1 ${p.value-b},${m.value}`,`M${p.value-$},${m.value}`,`A${$},${$} 0 1 0 ${p.value+$},${m.value}`,`A${$},${$} 0 1 0 ${p.value-$},${m.value}`,"Z"].join(" ");const z=p.value+Math.cos(S)*b,K=m.value+Math.sin(S)*b,L=p.value+Math.cos(C)*b,I=m.value+Math.sin(C)*b,U=C-S>Math.PI?1:0;if($<=0)return`M${p.value},${m.value} L${z},${K} A${b},${b} 0 ${U} 1 ${L},${I} Z`;const O=p.value+Math.cos(C)*$,q=m.value+Math.sin(C)*$,ae=p.value+Math.cos(S)*$,G=m.value+Math.sin(S)*$;return[`M${z},${K}`,`A${b},${b} 0 ${U} 1 ${L},${I}`,`L${O},${q}`,`A${$},${$} 0 ${U} 0 ${ae},${G}`,"Z"].join(" ")}const y=e.computed(()=>{const S=E.value;if(S===0)return[];let C=-Math.PI/2;const b=[];for(const $ of B.value){if($.value<=0)continue;const T=$.value/S*Math.PI*2,z=C,K=C+T;b.push({...$,start:z,end:K,midAngle:z+T/2,path:x(z,K)}),C=K}return b});function P(S,C){if(!w.value.enabled)return;const b=w.value.duration;return{transformOrigin:`${p.value}px ${m.value}px`,animationDuration:`${b}ms`,animationDelay:`${S/Math.max(1,C)*(b*.4)}ms`}}return n({print:(S={})=>{const C=a.value;C&&st(C,{fileName:S.fileName??l.fileName??"chart"})},exportSvg:()=>{const S=o.value;return S?new XMLSerializer().serializeToString(S):null}}),(S,C)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:a,class:e.normalizeClass([!l.unstyled&&"sg-chart sg-chart-pie",l.className]),style:e.normalizeStyle({width:typeof l.width=="number"?`${l.width}px`:l.width}),"data-animate":w.value.enabled?"on":"off"},[(e.openBlock(),e.createElementBlock("svg",{ref_key:"svgRef",ref:o,viewBox:`0 0 ${d.value} ${u.value}`,width:typeof l.width=="number"?l.width:"100%",height:l.height,role:"img","aria-label":v.value},[e.createElementVNode("g",bs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(b,$)=>(e.openBlock(),e.createElementBlock("path",{key:b.id,class:e.normalizeClass([w.value.enabled&&!l.unstyled&&"sg-chart-pie-animate"]),d:b.path,fill:b.color,"data-series-id":b.id,style:e.normalizeStyle(P($,y.value.length))},[e.createElementVNode("title",null,e.toDisplayString(b.label)+": "+e.toDisplayString(b.value),1)],14,Bs))),128))]),l.labels?(e.openBlock(),e.createElementBlock("g",Cs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,b=>(e.openBlock(),e.createElementBlock("text",{key:`${b.id}-label`,x:p.value+Math.cos(b.midAngle)*(k.value*.7),y:m.value+Math.sin(b.midAngle)*(k.value*.7),"text-anchor":"middle","dominant-baseline":"middle","font-size":"11",fill:"#fff"},e.toDisplayString(Math.round(b.value/E.value*100))+"% ",9,ws))),128))])):e.createCommentVNode("",!0)],8,ks)),l.legend?(e.openBlock(),e.createBlock(Et,{key:0,series:N.value,unstyled:l.unstyled},null,8,["series","unstyled"])):e.createCommentVNode("",!0)],14,ys))}}),Es=["data-sg-toolbar","aria-label","aria-hidden"],xs=["data-sg-action","aria-label","title","tabindex","onClick"],$s=e.defineComponent({__name:"ChartHoverToolbar",props:{visible:{type:Boolean},actions:{},fileName:{},getSvg:{type:Function},brushReset:{type:Function},toggleLegend:{type:Function},unstyled:{type:Boolean},style:{}},setup(t){const n=t,l=e.computed(()=>n.actions.filter(v=>!v.hidden)),a=Ce(),o=e.computed(()=>{var v,c;return((c=(v=a.value.locale)==null?void 0:v.charts)==null?void 0:c.actions)??"Chart actions"});function s(v,c){c.stopPropagation();const r=n.getSvg();r&&v.onClick({svg:r,fileName:n.fileName,brushReset:n.brushReset,toggleLegend:n.toggleLegend})}return(v,c)=>l.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(n.unstyled?void 0:"sg-chart-toolbar"),style:e.normalizeStyle(n.style),"data-sg-chart-toolbar":"","data-sg-toolbar":n.visible?"visible":"hidden",role:"toolbar","aria-label":o.value,"aria-hidden":n.visible?void 0:!0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,r=>(e.openBlock(),e.createElementBlock("button",{key:r.id,type:"button",class:e.normalizeClass(n.unstyled?void 0:"sg-chart-toolbar-button"),"data-sg-action":r.id,"aria-label":r.label,title:r.label,tabindex:n.visible?0:-1,onClick:i=>s(r,i)},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.icon)))],10,xs))),128))],14,Es)):e.createCommentVNode("",!0)}}),Ns="http://www.w3.org/2000/svg",Vs="http://www.w3.org/1999/xlink";function il(t,n){const l=t.cloneNode(!0);return l.getAttribute("xmlns")||l.setAttribute("xmlns",Ns),l.getAttribute("xmlns:xlink")||l.setAttribute("xmlns:xlink",Vs),n&&(l.setAttribute("width",String(n.width)),l.setAttribute("height",String(n.height))),new XMLSerializer().serializeToString(l)}function cl(t,n){if(typeof document>"u"||typeof URL>"u")return;const l=URL.createObjectURL(t),a=document.createElement("a");a.href=l,a.download=n,a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a),setTimeout(()=>{try{URL.revokeObjectURL(l)}catch{}},100)}function Jl(t,n){return t.endsWith(`.${n}`)?t:`${t}.${n}`}function ul(t){var o,s;const n=(o=t.getBoundingClientRect)==null?void 0:o.call(t);let l=n&&n.width>0?n.width:0,a=n&&n.height>0?n.height:0;if(l<=0||a<=0){const v=(s=t.viewBox)==null?void 0:s.baseVal;if(v&&v.width>0&&v.height>0)l=v.width,a=v.height;else{const c=t.getAttribute("viewBox");if(c){const r=c.trim().split(/\s+/),i=Number.parseFloat(r[2]??""),d=Number.parseFloat(r[3]??"");Number.isFinite(i)&&i>0&&(l=i),Number.isFinite(d)&&d>0&&(a=d)}}}return l>0||(l=600),a>0||(a=400),{width:Math.round(l),height:Math.round(a)}}function Zl(t,n="chart.svg"){const l=ul(t),a=il(t,l),o=new Blob([a],{type:"image/svg+xml;charset=utf-8"});cl(o,Jl(n,"svg"))}function Ql(t,n="chart.png"){const l=typeof n=="string"?{fileName:n}:n,a=Jl(l.fileName??"chart.png","png"),o=ul(t),s=l.scale??(typeof window<"u"?window.devicePixelRatio||1:2),v=il(t,o),c=new Blob([v],{type:"image/svg+xml;charset=utf-8"}),r=URL.createObjectURL(c);return new Promise((i,d)=>{const u=new Image;u.decoding="async",u.onload=()=>{try{const p=document.createElement("canvas");p.width=Math.max(1,Math.round(o.width*s)),p.height=Math.max(1,Math.round(o.height*s));const m=p.getContext("2d");if(!m){URL.revokeObjectURL(r),d(new Error("Canvas 2D context unavailable"));return}m.scale(s,s),l.background&&(m.fillStyle=l.background,m.fillRect(0,0,o.width,o.height)),m.drawImage(u,0,0,o.width,o.height),URL.revokeObjectURL(r),p.toBlob(k=>{if(!k){d(new Error("canvas.toBlob produced null"));return}cl(k,a),i()},"image/png")}catch(p){URL.revokeObjectURL(r),d(p instanceof Error?p:new Error(String(p)))}},u.onerror=()=>{URL.revokeObjectURL(r),d(new Error("SVG image decoding failed"))},u.src=r})}function Kt(t,n){const l=[e.h("path",{d:t})];return n&&l.push(n),e.h("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":1.5,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},l)}const Ds=()=>Kt("M4 6V2.5h8V6",[e.h("rect",{x:3,y:6,width:10,height:6,rx:1}),e.h("path",{d:"M4.5 10h7v3.5h-7z"})]),zs=()=>Kt("M3 8.5v3.25A1.25 1.25 0 0 0 4.25 13h7.5A1.25 1.25 0 0 0 13 11.75V8.5",[e.h("path",{d:"M8 2.5v7"}),e.h("path",{d:"M5 6.5l3 3 3-3"})]),Ts=()=>Kt("M2.5 3.5h11v9h-11z",[e.h("circle",{cx:5.5,cy:6.5,r:.9}),e.h("path",{d:"M2.5 11l3-3 2.5 2.5L10.5 8l3 3"})]),Ls=()=>Kt("M3 8a5 5 0 1 0 1.5-3.5",e.h("path",{d:"M3 3v3h3"}));function ea(t){const n=[{id:"print",label:"Print",icon:Ds(),onClick:({svg:l})=>{st(l,t.fileName?{fileName:t.fileName}:{})}},{id:"downloadSvg",label:"Download SVG",icon:zs(),onClick:({svg:l,fileName:a})=>{Zl(l,`${a??"chart"}.svg`)}},{id:"downloadPng",label:"Download PNG",icon:Ts(),onClick:({svg:l,fileName:a})=>{Ql(l,`${a??"chart"}.png`).catch(()=>{})}}];return t.brushReset&&n.push({id:"resetBrush",label:"Reset zoom",icon:Ls(),onClick:({brushReset:l})=>l==null?void 0:l()}),n}function Ms(t,n){return t?t===!0?ea(n):t:null}function Fs(t,n){if(t)return l=>{l.preventDefault(),l.stopPropagation(),t(l,n)}}function As(t){if(t)return n=>{var i;n.preventDefault();const l=n.currentTarget;if(!l)return;const a=l.getBoundingClientRect(),o=n.clientX-a.left,s=n.clientY-a.top;let v=o,c=s;const r=(i=l.viewBox)==null?void 0:i.baseVal;r&&r.width>0&&r.height>0&&a.width>0&&a.height>0&&(v=o/a.width*r.width,c=s/a.height*r.height),t(n,{x:o,y:s,plotX:v,plotY:c})}}const Ps=["data-selection-mode","data-sg-drop","aria-label"],Rs=["data-zoom","data-pan-x","data-pan-y"],Is=["width","height"],Ks={key:0},Os=["data-edge-id"],Hs=["d","onContextmenu","onMouseenter"],js=["d","data-edge-id","marker-end"],_s=["d","data-edge-id","marker-end"],Ys=["data-node-id","data-selected","data-sg-dragging","onPointerdown","onClick","onContextmenu","onMouseenter"],Ws=["data-node-id"],Us=["data-action-id","aria-label","title","onClick"],qs=["data-edge-id"],Xs=["data-action-id","aria-label","title","onClick"],Gs=8,zl=8,Tl=.5,Ll=200,Ml=150,Js=e.defineComponent({__name:"Diagram",props:{graph:{},state:{},width:{default:"100%"},height:{default:400},unstyled:{type:Boolean,default:!1},className:{},style:{},draggable:{type:[Boolean,Function],default:!1},zoomable:{type:Boolean,default:!1},panable:{type:Boolean,default:!1},snapToGrid:{},routeAroundNodes:{type:Boolean,default:!1},routingOptions:{},edgeArrows:{type:Boolean,default:!0},selectionMode:{default:"single"},selection:{},selectedNodeIds:{},defaultSelection:{},nodeActions:{},edgeActions:{},dropTypes:{},fileName:{default:"diagram"},draggableNodes:{type:Boolean},panZoom:{type:Boolean}},emits:["node-click","selection-change","selectionChange","drop-node","dropNode","node-context-menu","edge-context-menu","canvas-context-menu"],setup(t,{expose:n,emit:l}){const a=t,o=l,s=e.ref(null),v=e.ref(null),c=e.computed(()=>typeof a.draggable=="function"?a.draggable:!!(a.draggable||a.draggableNodes)),r=e.computed(()=>a.panable||!!a.panZoom),i=e.computed(()=>a.zoomable||!!a.panZoom),d=e.computed(()=>a.selection!==void 0||a.selectedNodeIds!==void 0),u=e.computed(()=>a.selection??a.selectedNodeIds??[]),p=e.ref(a.defaultSelection??[]),m=e.computed(()=>d.value?u.value:p.value),k=e.computed(()=>new Set(m.value));function f(A){if(w(m.value,A))return;const H=Array.isArray(A)?A:Array.from(A);d.value||(p.value=H),o("selection-change",H),o("selectionChange",H)}function w(A,H){if(A===H)return!0;if(A.length!==H.length)return!1;const Q=new Set(A);for(const ge of H)if(!Q.has(ge))return!1;return!0}e.watch(()=>a.state,A=>{if(d.value)return;const H=p.value.filter(Q=>A.nodes.has(Q));H.length!==p.value.length&&(p.value=H,o("selection-change",H),o("selectionChange",H))});const B=e.ref({panX:0,panY:0,zoom:1}),E=e.computed(()=>Array.from(a.state.nodes.values())),N=e.computed(()=>Array.from(a.state.edges.values())),x=e.computed(()=>E.value.map(A=>a.graph.boundsOf(A.id))),y=e.computed(()=>{const A=new Map;return E.value.forEach((H,Q)=>A.set(H.id,x.value[Q])),A});function P(A,H){return{source:je.resolveEdgeEndpoint(A,H,zl),target:je.resolveEdgeEndpoint(H,A,zl)}}function S(A,H,Q,ge,Se,xe){var Qe,Ge,tt,gt,xt,$t,Nt;const Ae=H.point,Oe=Q.point;switch(A.routing){case"orthogonal":{const He=je.routeOrthogonal(Ae,Oe,{obstacles:ge,gridSize:(Qe=a.routingOptions)==null?void 0:Qe.gridSize,inflate:(Ge=a.routingOptions)==null?void 0:Ge.inflate,maxNodes:(tt=a.routingOptions)==null?void 0:tt.maxNodes,sourceBounds:Se,targetBounds:xe,stepPosition:(gt=a.routingOptions)==null?void 0:gt.stepPosition,stubLength:(xt=a.routingOptions)==null?void 0:xt.stubLength});return je.pointsToRoundedPath(He,(($t=a.routingOptions)==null?void 0:$t.cornerRadius)??Gs)}case"bezier":return je.getBezierPath({source:Ae,sourceSide:H.side,target:Oe,targetSide:Q.side,curvature:(Nt=a.routingOptions)==null?void 0:Nt.curvature});case"manual":{const He=A.waypoints??[];return je.pointsToPath([Ae,...He,Oe])}case"straight":default:return`M ${Ae[0]} ${Ae[1]} L ${Oe[0]} ${Oe[1]}`}}const C=e.computed(()=>{const A=y.value,H=[];for(const Q of N.value){const ge=A.get(Q.from.node),Se=A.get(Q.to.node);if(!ge||!Se)continue;const{source:xe,target:Ae}=P(ge,Se);let Oe;if(a.routeAroundNodes&&Q.routing==="orthogonal"){const Qe=new Set([Q.from.node,Q.to.node]);Oe=[];for(const[Ge,tt]of A)Qe.has(Ge)||Oe.push(tt)}H.push({id:String(Q.id),d:S(Q,xe,Ae,Oe,void 0,void 0),routing:Q.routing,mid:{x:(xe.point[0]+Ae.point[0])/2,y:(xe.point[1]+Ae.point[1])/2},raw:Q})}return H});let b=null;const $=e.ref(null);function T(A,H,Q){let ge=H,Se=Q;a.snapToGrid&&a.snapToGrid>0&&(ge=Math.round(ge/a.snapToGrid)*a.snapToGrid,Se=Math.round(Se/a.snapToGrid)*a.snapToGrid);const xe=c.value;typeof xe=="function"?xe(A,ge,Se):a.graph.moveNode(A,ge,Se)}function z(A,H,Q){const ge=Q.currentTarget;try{ge.setPointerCapture(Q.pointerId)}catch{}b={primaryId:A,pointerId:Q.pointerId,target:ge,startX:Q.clientX,startY:Q.clientY,startZoom:B.value.zoom||1,members:H,moved:!1},$.value=A}function K(A){if(!b||b.pointerId!==A.pointerId)return;const H=(A.clientX-b.startX)/b.startZoom,Q=(A.clientY-b.startY)/b.startZoom;if(!b.moved&&(Math.abs(H)>Tl||Math.abs(Q)>Tl)&&(b.moved=!0),b.members.length>1)a.graph.transaction(()=>{for(const ge of b.members)T(ge.id,ge.x0+H,ge.y0+Q)});else{const ge=b.members[0];T(ge.id,ge.x0+H,ge.y0+Q)}}function L(A){if(!(!b||b.pointerId!==A.pointerId)){try{b.target.releasePointerCapture(b.pointerId)}catch{}b=null,$.value=null}}function I(A,H){const Q=A.indexOf(H);if(Q===-1)return[...A,H];const ge=A.slice();return ge.splice(Q,1),ge}function U(A,H){if(A.button!==0)return;const Q=a.selectionMode!=="single",ge=A.ctrlKey||A.metaKey;if(Q&&ge){A.preventDefault(),A.stopPropagation(),f(I(m.value,H.id));return}if(Q&&(k.value.has(H.id)||f([H.id])),!c.value)return;A.preventDefault(),A.stopPropagation();const xe=(Q&&k.value.has(H.id)?Array.from(new Set([H.id,...m.value])):[H.id]).map(Ae=>{const Oe=a.graph.getNode(Ae);return Oe?{id:Ae,x0:Oe.transform.x,y0:Oe.transform.y}:null}).filter(Ae=>Ae!==null);z(H.id,xe,A)}function O(A,H){if(A.stopPropagation(),o("node-click",{id:H.id,node:H,event:A}),a.selectionMode==="single"){f([H.id]);return}if(a.selectionMode==="multi"&&(A.ctrlKey||A.metaKey||A.shiftKey)){f(I(m.value,H.id));return}f([H.id])}function q(A){if(!(!i.value&&!r.value)){if(i.value&&(A.ctrlKey||A.metaKey)){A.preventDefault();const H=A.deltaY<0?1.1:1/1.1;B.value={...B.value,zoom:Math.max(.1,Math.min(10,B.value.zoom*H))};return}r.value&&(A.preventDefault(),B.value={...B.value,panX:B.value.panX-A.deltaX,panY:B.value.panY-A.deltaY})}}const ae=e.ref(null);let G=null;function Y(A,H,Q,ge){return{x:Math.min(A,Q),y:Math.min(H,ge),w:Math.abs(Q-A),h:Math.abs(ge-H)}}function M(A){const H=B.value.zoom||1;return{x:(A.x-B.value.panX)/H,y:(A.y-B.value.panY)/H,w:A.w/H,h:A.h/H}}function g(A,H){return!(A.x+A.w<H.x||H.x+H.w<A.x||A.y+A.h<H.y||H.y+H.h<A.y)}function h(A){const H=[];for(const[Q,ge]of y.value)g(ge,A)&&H.push(Q);return H}let V=null;function F(A){var Se;const H=(Se=s.value)==null?void 0:Se.getBoundingClientRect();if(!H)return;const Q=A.clientX-H.left,ge=A.clientY-H.top;A.preventDefault();try{A.currentTarget.setPointerCapture(A.pointerId)}catch{}G={startX:Q,startY:ge,initial:m.value,additive:A.shiftKey||A.ctrlKey||A.metaKey},V={kind:"lasso",pointerId:A.pointerId},ae.value={x:Q,y:ge,w:0,h:0}}function R(A){A.preventDefault();try{A.currentTarget.setPointerCapture(A.pointerId)}catch{}V={kind:"pan",pointerId:A.pointerId,startX:A.clientX,startY:A.clientY,panX:B.value.panX,panY:B.value.panY}}function X(A){if(r.value&&A.button===1){R(A);return}if(A.button===0&&!A.target.closest("[data-node-id]")){if(a.selectionMode==="lasso"){F(A);return}a.selectionMode==="multi"&&m.value.length>0&&(A.shiftKey||A.ctrlKey||A.metaKey||f([]))}}function se(A){var Qe;if(!V||V.pointerId!==A.pointerId)return;if(V.kind==="pan"){const Ge=V;B.value={...B.value,panX:Ge.panX+(A.clientX-Ge.startX),panY:Ge.panY+(A.clientY-Ge.startY)};return}const H=(Qe=s.value)==null?void 0:Qe.getBoundingClientRect();if(!H||!G)return;const Q=A.clientX-H.left,ge=A.clientY-H.top,Se=Y(G.startX,G.startY,Q,ge);ae.value=Se;const xe=M(Se),Ae=h(xe),Oe=G.additive?Array.from(new Set([...G.initial,...Ae])):Ae;f(Oe)}function ie(A){if(!(!V||V.pointerId!==A.pointerId)){try{A.currentTarget.releasePointerCapture(V.pointerId)}catch{}V.kind==="lasso"&&(G=null,ae.value=null),V=null}}function ne(A){A.target.closest("[data-node-id]")||a.selectionMode==="single"&&m.value.length>0&&f([])}const me=e.getCurrentInstance(),ye=Ce(),Me=e.computed(()=>{var A,H;return((H=(A=ye.value.locale)==null?void 0:A.diagram)==null?void 0:H.ariaLabel)??"Diagram"}),Ne=e.computed(()=>{var H;const A=((H=me==null?void 0:me.vnode)==null?void 0:H.props)??{};return!!(A["onDrop-node"]||A.onDropNode)}),Pe=e.computed(()=>a.dropTypes==="*"||a.dropTypes===null?null:a.dropTypes===void 0?["application/x-sg-node"]:a.dropTypes);function Te(A){var Q;if(!Pe.value)return!0;const H=(Q=A.dataTransfer)==null?void 0:Q.types;if(!H||H.length===0)return!1;for(const ge of Pe.value)for(let Se=0;Se<H.length;Se++)if(H[Se]===ge)return!0;return!1}function Ue(A){Te(A)&&(A.preventDefault(),A.dataTransfer&&(A.dataTransfer.dropEffect="copy"))}function qe(A){var Oe;if(!Te(A))return;A.preventDefault();const H=(Oe=s.value)==null?void 0:Oe.getBoundingClientRect();if(!H)return;const Q=A.clientX-H.left,ge=A.clientY-H.top,Se=(Q-B.value.panX)/(B.value.zoom||1),xe=(ge-B.value.panY)/(B.value.zoom||1),Ae={x:Se,y:xe,screenX:A.clientX,screenY:A.clientY,dataTransfer:A.dataTransfer};o("drop-node",Ae),o("dropNode",Ae)}function Z(A){var Ae;if(A.target.closest("[data-node-id]"))return;A.preventDefault();const H=(Ae=s.value)==null?void 0:Ae.getBoundingClientRect();if(!H)return;const Q=A.clientX-H.left,ge=A.clientY-H.top,Se=(Q-B.value.panX)/(B.value.zoom||1),xe=(ge-B.value.panY)/(B.value.zoom||1);o("canvas-context-menu",{event:A,point:{x:Se,y:xe,screenX:A.clientX,screenY:A.clientY}})}function te(A,H){A.stopPropagation(),A.preventDefault(),o("node-context-menu",{event:A,node:H})}function fe(A,H){A.stopPropagation(),A.preventDefault(),o("edge-context-menu",{event:A,edge:H})}const Be=e.ref(null),Ve=e.ref(null);let De=null,Ee=null,Le=null,Fe=null;function we(A){A!=null&&window.clearTimeout(A)}function re(A){Ee!=null&&(we(Ee),Ee=null),Be.value!==A&&(De!=null&&we(De),De=window.setTimeout(()=>{Be.value=A,De=null},Ll))}function ve(){De!=null&&(we(De),De=null),Ee!=null&&we(Ee),Ee=window.setTimeout(()=>{Be.value=null,Ee=null},Ml)}function oe(A){Fe!=null&&(we(Fe),Fe=null),Ve.value!==A&&(Le!=null&&we(Le),Le=window.setTimeout(()=>{Ve.value=A,Le=null},Ll))}function ke(){Le!=null&&(we(Le),Le=null),Fe!=null&&we(Fe),Fe=window.setTimeout(()=>{Ve.value=null,Fe=null},Ml)}e.onBeforeUnmount(()=>{if(we(De),we(Ee),we(Le),we(Fe),b){try{b.target.releasePointerCapture(b.pointerId)}catch{}b=null}V=null});const Ie=e.computed(()=>{var A;return(((A=a.nodeActions)==null?void 0:A.length)??0)>0}),Xe=e.computed(()=>{var A;return(((A=a.edgeActions)==null?void 0:A.length)??0)>0}),lt=e.computed(()=>Xe.value),le=e.computed(()=>Be.value!=null?a.state.nodes.get(Be.value)??null:null),ue=e.computed(()=>Be.value!=null?y.value.get(Be.value)??null:null),de=e.computed(()=>Ve.value!=null?a.state.edges.get(Ve.value)??null:null),$e=e.computed(()=>{if(!de.value)return null;const A=y.value.get(de.value.from.node),H=y.value.get(de.value.to.node);if(!A||!H)return null;const{source:Q,target:ge}=P(A,H);return{x:(Q.point[0]+ge.point[0])/2,y:(Q.point[1]+ge.point[1])/2}}),be=e.computed(()=>{if(x.value.length===0)return{x:0,y:0,w:0,h:0};let A=1/0,H=1/0,Q=-1/0,ge=-1/0;for(const Se of x.value)Se.x<A&&(A=Se.x),Se.y<H&&(H=Se.y),Se.x+Se.w>Q&&(Q=Se.x+Se.w),Se.y+Se.h>ge&&(ge=Se.y+Se.h);return{x:A,y:H,w:Q-A,h:ge-H}}),Ke=e.computed(()=>a.unstyled?[a.className].filter(Boolean):["sg-diagram",a.snapToGrid?"sg-diagram-grid":"",a.className].filter(Boolean)),We=e.computed(()=>{const A={position:"relative",width:typeof a.width=="number"?`${a.width}px`:a.width,height:typeof a.height=="number"?`${a.height}px`:a.height,overflow:"hidden"};return a.snapToGrid&&(A["--sg-grid-size"]=`${a.snapToGrid*B.value.zoom}px`,A.backgroundPosition=`${B.value.panX}px ${B.value.panY}px`),{...A,...a.style??{}}}),et=e.computed(()=>({position:"absolute",top:0,left:0,transform:`translate(${B.value.panX}px, ${B.value.panY}px) scale(${B.value.zoom})`,transformOrigin:"0 0",width:"100%",height:"100%"}));function ze(A){if(a.unstyled)return[];const H=k.value.has(A.id),Q=$.value===A.id;return["sg-diagram-node",`sg-diagram-node-${A.outline.kind}`,c.value?"sg-diagram-node-draggable":"",H?"sg-diagram-node-selected":"",H?"sg-diagram-node--selected":"",Q?"sg-diagram-node-dragging":""].filter(Boolean)}function W(A){const H=y.value.get(A.id);if(!H)return{};const Q=$.value===A.id;return{position:"absolute",left:`${H.x}px`,top:`${H.y}px`,width:`${H.w}px`,height:`${H.h}px`,cursor:c.value?Q?"grabbing":"grab":void 0,userSelect:c.value?"none":void 0}}function ee(A){return(a.nodeActions??[]).filter(H=>{var Q;return!((Q=H.hidden)!=null&&Q.call(H,A))})}function he(A){return(a.edgeActions??[]).filter(H=>{var Q;return!((Q=H.hidden)!=null&&Q.call(H,A))})}return n({print:A=>{s.value&&st(s.value,{...A,fileName:(A==null?void 0:A.fileName)??a.fileName??"diagram"})}}),(A,H)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:s,class:e.normalizeClass(Ke.value),style:e.normalizeStyle(We.value),"data-selection-mode":a.selectionMode,"data-sg-drop":Ne.value?"true":void 0,role:"application","aria-label":Me.value,onWheel:H[12]||(H[12]=Q=>i.value||r.value?q(Q):void 0),onPointerdown:X,onPointermove:se,onPointerup:ie,onPointercancel:ie,onLostpointercapture:ie,onContextmenu:Z,onDragover:H[13]||(H[13]=Q=>Ne.value?Ue(Q):void 0),onDrop:H[14]||(H[14]=Q=>Ne.value?qe(Q):void 0)},[e.createElementVNode("div",{ref_key:"canvasRef",ref:v,class:e.normalizeClass(a.unstyled?void 0:"sg-diagram-canvas"),style:e.normalizeStyle(et.value),"data-zoom":B.value.zoom,"data-pan-x":B.value.panX,"data-pan-y":B.value.panY,onClick:ne},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(a.unstyled?void 0:"sg-diagram-edges"),width:Math.max(be.value.w+be.value.x,0)||"100%",height:Math.max(be.value.h+be.value.y,0)||"100%",style:{position:"absolute",inset:0,pointerEvents:"none"},"aria-hidden":"true"},[a.edgeArrows?(e.openBlock(),e.createElementBlock("defs",Ks,[...H[15]||(H[15]=[e.createElementVNode("marker",{id:"sg-diagram-arrow",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:"12",markerHeight:"12",orient:"auto-start-reverse",markerUnits:"strokeWidth"},[e.createElementVNode("path",{d:"M -7 -5 L 0 0 L -7 5",fill:"none",stroke:"context-stroke","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",class:"sg-diagram-arrow-fill"})],-1)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,Q=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Q.id},[lt.value?(e.openBlock(),e.createElementBlock("g",{key:0,"data-edge-id":Q.id},[e.createElementVNode("path",{d:Q.d,class:"sg-diagram-edge-hit",fill:"none",stroke:"transparent","stroke-width":16,"data-edge-hit":"true",style:{pointerEvents:"stroke",cursor:"context-menu"},onContextmenu:ge=>fe(ge,Q.raw),onMouseenter:ge=>oe(Q.id),onMouseleave:H[0]||(H[0]=ge=>ke())},null,40,Hs),e.createElementVNode("path",{d:Q.d,class:e.normalizeClass(`sg-diagram-edge sg-diagram-edge-${Q.routing}`),fill:"none","data-edge-id":Q.id,"marker-end":a.edgeArrows?"url(#sg-diagram-arrow)":void 0,style:{pointerEvents:"none"}},null,10,js)],8,Os)):(e.openBlock(),e.createElementBlock("path",{key:1,d:Q.d,class:e.normalizeClass(`sg-diagram-edge sg-diagram-edge-${Q.routing}`),fill:"none","data-edge-id":Q.id,"marker-end":a.edgeArrows?"url(#sg-diagram-arrow)":void 0},null,10,_s))],64))),128))],10,Is)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,Q=>(e.openBlock(),e.createElementBlock("div",{key:Q.id,"data-node-id":Q.id,"data-selected":k.value.has(Q.id)?"true":void 0,"data-sg-dragging":$.value===Q.id?"true":void 0,class:e.normalizeClass(ze(Q)),style:e.normalizeStyle(W(Q)),onPointerdown:ge=>U(ge,Q),onPointermove:H[1]||(H[1]=ge=>c.value?K(ge):void 0),onPointerup:H[2]||(H[2]=ge=>c.value?L(ge):void 0),onPointercancel:H[3]||(H[3]=ge=>c.value?L(ge):void 0),onLostpointercapture:H[4]||(H[4]=ge=>c.value?L(ge):void 0),onClick:ge=>O(ge,Q),onContextmenu:ge=>te(ge,Q),onMouseenter:ge=>Ie.value?re(Q.id):void 0,onMouseleave:H[5]||(H[5]=ge=>Ie.value?ve():void 0)},[e.renderSlot(A.$slots,"node",{node:Q},()=>[e.createTextVNode(e.toDisplayString(Q.id),1)])],46,Ys))),128))],14,Rs),Ie.value&&le.value&&ue.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(a.unstyled?void 0:"sg-diagram-hover-actions"),"data-node-id":String(le.value.id),style:e.normalizeStyle({position:"absolute",left:`${B.value.panX+(ue.value.x+ue.value.w/2)*B.value.zoom}px`,top:`${B.value.panY+ue.value.y*B.value.zoom}px`,transform:"translate(-50%, calc(-100% - 8px))",pointerEvents:"auto",zIndex:5}),onMouseenter:H[7]||(H[7]=Q=>re(le.value.id)),onMouseleave:H[8]||(H[8]=Q=>ve())},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee(le.value),Q=>(e.openBlock(),e.createElementBlock("button",{key:Q.id,type:"button","data-action-id":Q.id,class:e.normalizeClass(a.unstyled?void 0:"sg-diagram-hover-action"),"aria-label":Q.label??Q.id,title:Q.label,onMousedown:H[6]||(H[6]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ge=>Q.onClick(le.value,ge),["stop"])},[Q.icon?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(Q.icon),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(Q.label??Q.id),1)],64))],42,Us))),128))],46,Ws)):e.createCommentVNode("",!0),Xe.value&&de.value&&$e.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(a.unstyled?void 0:"sg-diagram-hover-actions"),"data-edge-id":String(de.value.id),style:e.normalizeStyle({position:"absolute",left:`${B.value.panX+$e.value.x*B.value.zoom}px`,top:`${B.value.panY+$e.value.y*B.value.zoom}px`,transform:"translate(-50%, -50%)",pointerEvents:"auto",zIndex:5}),onMouseenter:H[10]||(H[10]=Q=>oe(String(de.value.id))),onMouseleave:H[11]||(H[11]=Q=>ke())},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he(de.value),Q=>(e.openBlock(),e.createElementBlock("button",{key:Q.id,type:"button","data-action-id":Q.id,class:e.normalizeClass(a.unstyled?void 0:"sg-diagram-hover-action"),"aria-label":Q.label??Q.id,title:Q.label,onMousedown:H[9]||(H[9]=e.withModifiers(()=>{},["stop"])),onClick:e.withModifiers(ge=>Q.onClick(de.value,ge),["stop"])},[Q.icon?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(Q.icon),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(Q.label??Q.id),1)],64))],42,Xs))),128))],46,qs)):e.createCommentVNode("",!0),ae.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(a.unstyled?void 0:"sg-diagram-lasso"),style:e.normalizeStyle({position:"absolute",left:`${ae.value.x}px`,top:`${ae.value.y}px`,width:`${ae.value.w}px`,height:`${ae.value.h}px`,pointerEvents:"none"})},null,6)):e.createCommentVNode("",!0)],46,Ps))}}),Zs=["aria-label"],Qs=["data-widget-id"],er=e.defineComponent({__name:"Dashboard",props:{widgets:{},columns:{default:12},rowHeight:{default:80},gap:{default:8},className:{},style:{},unstyled:{type:Boolean,default:!1}},setup(t,{expose:n}){const l=t,a=e.ref(null),o=Ce(),s=e.computed(()=>{var r,i;return((i=(r=o.value.locale)==null?void 0:r.dashboard)==null?void 0:i.ariaLabel)??"Dashboard"}),v=e.computed(()=>({display:"grid",gridTemplateColumns:`repeat(${l.columns}, 1fr)`,gridAutoRows:`${l.rowHeight}px`,gap:`${l.gap}px`,...l.style??{}})),c=r=>({gridColumnStart:r.x,gridColumnEnd:`span ${r.w??1}`,gridRowStart:r.y,gridRowEnd:`span ${r.h??1}`,...r.style??{}});return n({print:(r={})=>{a.value&&st(a.value,{fileName:r.fileName??"dashboard"})}}),(r,i)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:a,class:e.normalizeClass([!l.unstyled&&"sg-dashboard",l.className]),style:e.normalizeStyle(v.value),role:"region","aria-label":s.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.widgets,d=>(e.openBlock(),e.createElementBlock("div",{key:d.id,"data-widget-id":d.id,class:e.normalizeClass([!l.unstyled&&"sg-dashboard-widget",d.className]),style:e.normalizeStyle(c(d))},[d.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(l.unstyled?void 0:"sg-dashboard-widget-header")},e.toDisplayString(d.title),3)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(l.unstyled?void 0:"sg-dashboard-widget-body")},[e.renderSlot(r.$slots,"widget",{widget:d})],2)],14,Qs))),128))],14,Zs))}}),tr=["aria-label"],lr=["data-widget-id"],ar=["onPointerdown"],nr=["aria-label","onPointerdown"],or=e.defineComponent({__name:"DashboardEditor",props:{draggable:{type:Boolean,default:!0},resizable:{type:Boolean,default:!0},minW:{default:1},minH:{default:1},widgets:{},columns:{default:12},rowHeight:{default:80},gap:{default:8},className:{},style:{},unstyled:{type:Boolean,default:!1}},emits:["layout-change"],setup(t,{expose:n,emit:l}){const a=t,o=l,s=e.ref(null),v=e.ref(a.widgets.map(N=>({...N}))),c=Ce(),r=e.computed(()=>{var N,x;return((x=(N=c.value.locale)==null?void 0:N.dashboard)==null?void 0:x.editorAriaLabel)??"Dashboard editor"}),i=e.computed(()=>{var N,x;return((x=(N=c.value.locale)==null?void 0:N.dashboard)==null?void 0:x.resizeWidget)??"Resize widget"}),d=e.computed(()=>v.value),u=e.computed(()=>({display:"grid",gridTemplateColumns:`repeat(${a.columns}, 1fr)`,gridAutoRows:`${a.rowHeight}px`,gap:`${a.gap}px`,...a.style??{}})),p=N=>({gridColumnStart:N.x,gridColumnEnd:`span ${N.w??1}`,gridRowStart:N.y,gridRowEnd:`span ${N.h??1}`,...N.style??{}});let m=null;const k=()=>{const N=s.value;return N?{cw:(N.clientWidth-a.gap*(a.columns-1))/a.columns+a.gap,ch:a.rowHeight+a.gap}:{cw:0,ch:a.rowHeight+a.gap}},f=(N,x)=>{var y,P;a.draggable&&((P=(y=N.target).setPointerCapture)==null||P.call(y,N.pointerId),m={type:"move",id:x.id,startX:N.clientX,startY:N.clientY,origin:{...x}})},w=(N,x)=>{var y,P;a.resizable&&(N.stopPropagation(),(P=(y=N.target).setPointerCapture)==null||P.call(y,N.pointerId),m={type:"resize",id:x.id,startX:N.clientX,startY:N.clientY,origin:{...x}})},B=N=>{const x=m;if(!x)return;const{cw:y,ch:P}=k();if(y===0)return;const S=Math.round((N.clientX-x.startX)/y),C=Math.round((N.clientY-x.startY)/P);v.value=v.value.map(b=>{if(b.id!==x.id)return b;if(x.type==="move"){const $=Math.max(1,x.origin.x+S),T=Math.max(1,x.origin.y+C);return{...b,x:Math.min(a.columns-(b.w??1)+1,$),y:T}}return{...b,w:Math.max(a.minW,(x.origin.w??1)+S),h:Math.max(a.minH,(x.origin.h??1)+C)}})},E=()=>{m&&o("layout-change",v.value.map(N=>({...N}))),m=null};return n({print:(N={})=>{s.value&&st(s.value,{fileName:N.fileName??"dashboard"})},getLayout:()=>v.value.map(N=>({...N}))}),(N,x)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootRef",ref:s,class:e.normalizeClass([!a.unstyled&&"sg-dashboard sg-dashboard-editor",a.className]),style:e.normalizeStyle(u.value),role:"region","aria-label":r.value,onPointermove:B,onPointerup:E},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,y=>(e.openBlock(),e.createElementBlock("div",{key:y.id,"data-widget-id":y.id,class:e.normalizeClass([!a.unstyled&&"sg-dashboard-widget",y.className]),style:e.normalizeStyle(p(y))},[e.createElementVNode("div",{class:e.normalizeClass(a.unstyled?void 0:"sg-dashboard-widget-header"),style:e.normalizeStyle({cursor:a.draggable?"move":"default"}),onPointerdown:P=>f(P,y)},e.toDisplayString(y.title??y.id),47,ar),e.createElementVNode("div",{class:e.normalizeClass(a.unstyled?void 0:"sg-dashboard-widget-body")},[e.renderSlot(N.$slots,"widget",{widget:y})],2),a.resizable?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-dashboard-resize-handle",role:"button","aria-label":i.value,style:{position:"absolute",right:0,bottom:0,width:"12px",height:"12px",cursor:"se-resize"},onPointerdown:P=>w(P,y)},null,40,nr)):e.createCommentVNode("",!0)],14,lr))),128))],46,tr))}}),sr=["aria-label","data-scale"],rr=["data-row-index","data-row-key"],ir=["data-tick-time"],cr=["data-row-index"],ur=["aria-label","data-task-id","data-row-index","onPointerdown"],dr=["data-progress"],mr=["aria-label","onPointerdown"],pr=["width","height"],vr=["d","data-dep-id"],zt=864e5,gr=14,fr=e.defineComponent({__name:"Gantt",props:{tasks:{},resources:{},scale:{default:"day"},range:{},rowHeight:{default:32},columnWidth:{default:40},sidebarWidth:{default:200},draggable:{type:Boolean,default:!1},resizable:{type:Boolean,default:!1},unstyled:{type:Boolean,default:!1},className:{},style:{}},emits:["task-change"],setup(t,{expose:n,emit:l}){const a=t,o=l,s=Ce(),v=e.computed(()=>{var L,I;return((I=(L=s.value.locale)==null?void 0:L.gantt)==null?void 0:I.ariaLabel)??"Gantt chart"}),c=e.computed(()=>{var L,I;return((I=(L=s.value.locale)==null?void 0:L.gantt)==null?void 0:I.resizeTask)??"Resize task"}),r={day:zt,week:7*zt,month:30*zt,quarter:90*zt},i=L=>L instanceof Date?L.getTime():L,d=(L,I)=>Math.floor(L/I)*I,u=(L,I)=>Math.ceil(L/I)*I,p=(L,I,U)=>Math.max(I,Math.min(U,L));function m(L,I,U){const O=new Date(L);switch(I){case"day":{const q=String(O.getUTCDate()).padStart(2,"0");if(U<32){if(O.getUTCDate()===1){const G=String(O.getUTCMonth()+1).padStart(2,"0");return`${q}.${G}`}return q}const ae=String(O.getUTCMonth()+1).padStart(2,"0");return`${q}.${ae}`}case"week":{const q=String(O.getUTCDate()).padStart(2,"0"),ae=String(O.getUTCMonth()+1).padStart(2,"0");return`W ${q}.${ae}`}case"month":return`${String(O.getUTCMonth()+1).padStart(2,"0")}.${O.getUTCFullYear()}`;case"quarter":return`Q${Math.floor(O.getUTCMonth()/3)+1} ${O.getUTCFullYear()}`}}function k(L,I){if(L.length===0){const q=Date.now();return{from:new Date(d(q,I)),to:new Date(u(q+I,I))}}let U=1/0,O=-1/0;for(const q of L){const ae=i(q.start),G=i(q.end);ae<U&&(U=ae),G>O&&(O=G)}return{from:new Date(d(U-I,I)),to:new Date(u(O+I,I))}}const f=e.computed(()=>{const L=r[a.scale],I=a.range??k(a.tasks,L),U=I.from.getTime(),O=I.to.getTime(),q=a.columnWidth/L,ae=(O-U)*q;let G,Y;if(a.resources&&a.resources.length>0){const M=a.resources;G=M.map(h=>({key:h.id,label:h.name}));const g=new Map(M.map((h,V)=>[h.id,V]));Y=h=>h.resourceId?g.get(h.resourceId)??0:0}else{G=a.tasks.map(g=>({key:g.id,label:g.name}));const M=new Map(a.tasks.map((g,h)=>[g.id,h]));Y=g=>M.get(g.id)??0}return{rangeStart:U,rangeEnd:O,step:L,totalWidth:ae,pxPerMs:q,rows:G,rowOf:Y}}),w=e.computed(()=>{const L=[],{rangeStart:I,rangeEnd:U,step:O,pxPerMs:q}=f.value;for(let ae=I;ae<U;ae+=O)L.push({x:(ae-I)*q,label:m(ae,a.scale,a.columnWidth),time:ae});return L}),B=e.computed(()=>{const{rangeStart:L,pxPerMs:I,rowOf:U}=f.value,O=a.rowHeight;return a.tasks.map(q=>{const ae=i(q.start),G=i(q.end),Y=(ae-L)*I,M=Math.max(2,(G-ae)*I),g=U(q),h=g*O;return{task:q,x:Y,y:h,w:M,h:O,row:g}})}),E=e.computed(()=>{const L=new Map;for(const I of B.value)L.set(I.task.id,I);return L}),N=e.computed(()=>{const L=[];for(const O of B.value){const q=O.task.dependencies;if(!(!q||q.length===0))for(const ae of q){const G=E.value.get(ae);if(!G)continue;const Y=G.x+G.w,M=G.y+G.h/2,g=O.x,h=O.y+O.h/2;let V;if(g>=Y+8+18){const F=Y+8;V=[[Y,M],[F,M],[F,h],[g,h]]}else{const F=G.y+G.h;V=[[Y,M],[Y+8,M],[Y+8,F],[g-18,F],[g-18,h],[g,h]]}L.push({id:`${ae}->${O.task.id}`,d:je.pointsToPath(V)})}}return L}),x=e.computed(()=>a.rowHeight),y=e.computed(()=>f.value.rows.length*a.rowHeight),P=e.computed(()=>y.value+x.value+gr),S=e.computed(()=>({display:"grid",gridTemplateColumns:`${a.sidebarWidth}px minmax(0, 1fr)`,width:"100%",overflow:"hidden",height:`${P.value}px`,...a.style??{}})),C=e.computed(()=>a.unstyled?a.className:["sg-gantt",a.className].filter(Boolean).join(" ")),b=e.ref(null);function $(L,I,U){var q;if(L.button!==void 0&&L.button!==0||U==="move"&&!a.draggable||U==="resize"&&!a.resizable)return;L.preventDefault(),L.stopPropagation();const O=L.currentTarget;(q=O==null?void 0:O.setPointerCapture)==null||q.call(O,L.pointerId),b.value={kind:U,taskId:I.id,startClientX:L.clientX,origStart:i(I.start),origEnd:i(I.end),lastStart:i(I.start),lastEnd:i(I.end),pointerId:L.pointerId,captureTarget:O}}function T(L){const I=b.value;if(!I)return;const U=a.tasks.find(h=>h.id===I.taskId);if(!U)return;const{step:O,pxPerMs:q}=f.value,G=(L.clientX-I.startClientX)/q,Y=Math.round(G/O)*O;let M=I.origStart,g=I.origEnd;I.kind==="move"?(M=I.origStart+Y,g=I.origEnd+Y):g=Math.max(I.origStart+O,I.origEnd+Y),!(M===I.lastStart&&g===I.lastEnd)&&(I.lastStart=M,I.lastEnd=g,o("task-change",{...U,start:M,end:g}))}function z(){var I,U;const L=b.value;L&&((U=(I=L.captureTarget)==null?void 0:I.releasePointerCapture)==null||U.call(I,L.pointerId)),b.value=null}e.onBeforeUnmount(()=>{b.value=null});const K=e.ref(null);return n({containerRef:K}),(L,I)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:K,class:e.normalizeClass(C.value),style:e.normalizeStyle(S.value),role:"region","aria-label":v.value,"data-scale":a.scale,onPointermove:T,onPointerup:z,onPointercancel:z},[e.createElementVNode("div",{class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-sidebar"),style:e.normalizeStyle({width:`${a.sidebarWidth}px`})},[e.createElementVNode("div",{class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-sidebar-header"),style:e.normalizeStyle({height:`${x.value}px`})},null,6),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.rows,(U,O)=>(e.openBlock(),e.createElementBlock("div",{key:U.key,class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-sidebar-row"),style:e.normalizeStyle({height:`${a.rowHeight}px`}),"data-row-index":O,"data-row-key":U.key},e.toDisplayString(U.label),15,rr))),128))],6),e.createElementVNode("div",{class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-main"),style:{position:"relative",overflowX:"auto",overflowY:"hidden",minWidth:0}},[e.createElementVNode("div",{style:e.normalizeStyle({position:"relative",width:`${f.value.totalWidth}px`,minWidth:"100%"})},[e.createElementVNode("div",{class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-header"),style:e.normalizeStyle({position:"relative",height:`${x.value}px`,width:`${f.value.totalWidth}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,U=>(e.openBlock(),e.createElementBlock("div",{key:U.time,class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-tick"),style:e.normalizeStyle({position:"absolute",left:`${U.x}px`,top:0,width:`${a.columnWidth}px`,height:`${x.value}px`}),"data-tick-time":U.time},e.toDisplayString(U.label),15,ir))),128))],6),e.createElementVNode("div",{class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-grid"),style:e.normalizeStyle({position:"relative",width:`${f.value.totalWidth}px`,height:`${y.value}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value.rows,(U,O)=>(e.openBlock(),e.createElementBlock("div",{key:U.key,class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-row"),style:e.normalizeStyle({position:"absolute",left:0,top:`${O*a.rowHeight}px`,width:`${f.value.totalWidth}px`,height:`${a.rowHeight}px`}),"data-row-index":O},null,14,cr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,U=>(e.openBlock(),e.createElementBlock("div",{key:U.task.id,class:e.normalizeClass(a.unstyled?void 0:["sg-gantt-bar",a.draggable?"sg-gantt-bar-draggable":"",a.resizable?"sg-gantt-bar-resizable":""].filter(Boolean).join(" ")),style:e.normalizeStyle({position:"absolute",left:`${U.x}px`,top:`${U.y+4}px`,width:`${U.w}px`,height:`${U.h-8}px`,background:U.task.color,cursor:a.draggable?"grab":void 0,userSelect:a.draggable||a.resizable?"none":void 0}),role:"button",tabindex:"0","aria-label":U.task.name,"data-task-id":U.task.id,"data-row-index":U.row,onPointerdown:O=>$(O,U.task,"move")},[(U.task.progress??0)>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-bar-progress"),style:e.normalizeStyle({position:"absolute",left:0,top:0,bottom:0,width:`${p(U.task.progress??0,0,1)*100}%`}),"data-progress":p(U.task.progress??0,0,1)},null,14,dr)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-bar-label"),style:{position:"relative",zIndex:1}},e.toDisplayString(U.task.name),3),a.resizable?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-bar-resize"),role:"button","aria-label":c.value,tabindex:"-1","data-role":"resize-handle",style:{position:"absolute",right:0,top:0,bottom:0,width:"6px",cursor:"ew-resize"},onPointerdown:O=>$(O,U.task,"resize")},null,42,mr)):e.createCommentVNode("",!0)],46,ur))),128)),N.value.length>0?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-deps"),width:f.value.totalWidth,height:y.value,style:{position:"absolute",inset:0,pointerEvents:"none",overflow:"visible"},"aria-hidden":"true"},[I[0]||(I[0]=e.createElementVNode("defs",null,[e.createElementVNode("marker",{id:"sg-gantt-arrow",viewBox:"0 0 10 10",refX:"10",refY:"5",markerWidth:"6",markerHeight:"6",orient:"auto"},[e.createElementVNode("path",{d:"M 0 0 L 10 5 L 0 10 z",fill:"currentColor"})])],-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,U=>(e.openBlock(),e.createElementBlock("path",{key:U.id,d:U.d,class:e.normalizeClass(a.unstyled?void 0:"sg-gantt-dep"),fill:"none",stroke:"currentColor","stroke-width":1.5,"marker-end":"url(#sg-gantt-arrow)","data-dep-id":U.id},null,10,vr))),128))],10,pr)):e.createCommentVNode("",!0)],6)],4)],2)],46,sr))}}),hr=["aria-label","data-orientation","data-group-by"],yr=["data-group-key"],kr=["data-event-id","data-event-time"],br=e.defineComponent({__name:"EventTimeline",props:{events:{},orientation:{default:"vertical"},groupBy:{},unstyled:{type:Boolean,default:!1},className:{},style:{}},setup(t){const n=t;function l(u){return u instanceof Date?u.getTime():u}function a(u,p){const m=new Date(u),k=m.getUTCFullYear(),f=m.getUTCMonth()+1,w=m.getUTCDate();switch(p){case"day":return`${k}-${String(f).padStart(2,"0")}-${String(w).padStart(2,"0")}`;case"month":return`${k}-${String(f).padStart(2,"0")}`;case"year":return`${k}`}}function o(u,p){const m=new Date(u),k=m.getUTCFullYear(),f=String(m.getUTCMonth()+1).padStart(2,"0"),w=String(m.getUTCDate()).padStart(2,"0");switch(p){case"day":return`${w}.${f}.${k}`;case"month":return`${f}.${k}`;case"year":return`${k}`}}const s=e.computed(()=>[...n.events].sort((u,p)=>l(u.date)-l(p.date))),v=e.computed(()=>{if(!n.groupBy)return[{key:"all",label:"",events:s.value}];const u=[];let p=null;for(const m of s.value){const k=a(l(m.date),n.groupBy);(!p||p.key!==k)&&(p={key:k,label:o(l(m.date),n.groupBy),events:[]},u.push(p)),p.events.push(m)}return u}),c=e.computed(()=>n.unstyled?[n.className].filter(Boolean).join(" "):["sg-event-timeline",`sg-event-timeline-${n.orientation}`,n.className].filter(Boolean).join(" ")),r=e.computed(()=>({display:"flex",flexDirection:n.orientation==="horizontal"?"row":"column",...n.style??{}})),i=Ce(),d=e.computed(()=>{var u,p;return((p=(u=i.value.locale)==null?void 0:u.timeline)==null?void 0:p.ariaLabel)??"Timeline"});return(u,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(c.value),style:e.normalizeStyle(r.value),role:"list","aria-label":d.value,"data-orientation":n.orientation,"data-group-by":n.groupBy??"none"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,m=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:m.key},[n.groupBy?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(n.unstyled?void 0:"sg-event-timeline-group"),"data-group-key":m.key},e.toDisplayString(m.label),11,yr)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.events,k=>(e.openBlock(),e.createElementBlock("div",{key:k.id,class:e.normalizeClass(n.unstyled?void 0:"sg-event-timeline-item"),role:"listitem","data-event-id":k.id,"data-event-time":k.date instanceof Date?k.date.getTime():k.date},[e.createElementVNode("div",{class:e.normalizeClass(n.unstyled?void 0:"sg-event-timeline-marker")},[e.renderSlot(u.$slots,"marker",{event:k},()=>[e.createElementVNode("span",{class:e.normalizeClass(n.unstyled?void 0:"sg-event-timeline-dot"),style:e.normalizeStyle(k.color?{background:k.color}:void 0),"aria-hidden":"true"},null,6)])],2),e.createElementVNode("div",{class:e.normalizeClass(n.unstyled?void 0:"sg-event-timeline-content")},[e.renderSlot(u.$slots,"event",{event:k},()=>[e.createElementVNode("div",{class:e.normalizeClass(n.unstyled?void 0:"sg-event-timeline-title")},e.toDisplayString(k.title),3),k.description!==void 0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(n.unstyled?void 0:"sg-event-timeline-description")},e.toDisplayString(k.description),3)):e.createCommentVNode("",!0)])],2)],10,kr))),128))],64))),128))],14,hr))}}),Br=["aria-label","data-scale","data-conflict-count"],Cr=["aria-label","data-row-index","data-resource-id"],wr=["aria-label"],Sr=["data-tick-time"],Er=["data-conflict-count"],xr=["data-row-index","data-resource-id"],$r=["data-slot-time"],Nr=["aria-label","data-assignment-id","data-status","data-resource-id","onPointerdown","onKeydown"],Vr=["aria-label","onPointerdown"],Dr=["aria-label","onPointerdown"],Gt=24*60*60*1e3,zr=e.defineComponent({__name:"ResourceCalendar",props:{resources:{},assignments:{},scale:{default:"week"},range:{},columnWidth:{default:120},rowHeight:{default:56},sidebarWidth:{default:200},draggable:{type:Boolean,default:!1},resizable:{type:Boolean,default:!1},unstyled:{type:Boolean,default:!1},className:{},style:{}},emits:["assignment-change","assignmentChange","conflict"],setup(t,{emit:n}){const l=t,a=n,o=Ce(),s=e.computed(()=>{var M,g;return((g=(M=o.value.locale)==null?void 0:M.resourceCalendar)==null?void 0:g.ariaLabel)??"Resource calendar"}),v=e.computed(()=>{var M,g;return((g=(M=o.value.locale)==null?void 0:M.resourceCalendar)==null?void 0:g.resizeStart)??"Resize start"}),c=e.computed(()=>{var M,g;return((g=(M=o.value.locale)==null?void 0:M.resourceCalendar)==null?void 0:g.resizeEnd)??"Resize end"}),r=M=>{switch(M){case"day":return Gt;case"week":return Gt*7;case"month":return Gt*30}},i=M=>M instanceof Date?M.getTime():M;function d(M,g){return Math.floor(M/g)*g}function u(M,g){return Math.ceil(M/g)*g}const p=e.computed(()=>{const M=r(l.scale);let g=1/0,h=-1/0;for(const V of l.assignments){const F=i(V.start),R=i(V.end);F<g&&(g=F),R>h&&(h=R)}if(l.range){const V=l.range.from.getTime(),F=l.range.to.getTime();return l.assignments.length===0?{from:V,to:F}:{from:d(Math.min(V,g),M),to:u(Math.max(F,h),M)}}if(l.assignments.length===0){const V=Date.now();return{from:d(V,M),to:u(V+M*4,M)}}return{from:d(g-M,M),to:u(h+M,M)}}),m=e.computed(()=>p.value.to-p.value.from),k=e.computed(()=>r(l.scale)),f=e.computed(()=>Math.max(1,Math.ceil(m.value/k.value))),w=e.computed(()=>l.columnWidth/k.value),B=e.computed(()=>m.value*w.value),E=e.computed(()=>Math.max(28,Math.round(l.rowHeight*.6))),N=e.computed(()=>l.resources.length*l.rowHeight),x=e.computed(()=>N.value+E.value);function y(M,g){const h=new Date(M);switch(g){case"day":{const V=String(h.getUTCDate()).padStart(2,"0"),F=String(h.getUTCMonth()+1).padStart(2,"0");return`${V}.${F}`}case"week":{const V=String(h.getUTCDate()).padStart(2,"0"),F=String(h.getUTCMonth()+1).padStart(2,"0");return`W ${V}.${F}`}case"month":return`${String(h.getUTCMonth()+1).padStart(2,"0")}.${h.getUTCFullYear()}`}}const P=e.computed(()=>{const M=[],g=k.value;for(let h=0;h<f.value;h++){const V=p.value.from+h*g;M.push({x:h*l.columnWidth,label:y(V,l.scale),time:V})}return M}),S=e.computed(()=>{const M=new Map;return l.resources.forEach((g,h)=>M.set(g.id,h)),M}),C=e.computed(()=>{const M=[],g=new Map;for(const h of l.assignments){const V=g.get(h.resourceId)??[];V.push(h),g.set(h.resourceId,V)}for(const h of g.values())for(let V=0;V<h.length;V++)for(let F=V+1;F<h.length;F++){const R=i(h[V].start),X=i(h[V].end),se=i(h[F].start),ie=i(h[F].end);R<ie&&se<X&&M.push({a:h[V],b:h[F]})}return M}),b=e.computed(()=>{const M=new Set;for(const{a:g,b:h}of C.value)M.add(g.id),M.add(h.id);return M}),$=e.computed(()=>C.value.map(M=>[M.a.id,M.b.id].sort().join("~")).sort().join("|"));e.watch($,()=>{a("conflict",C.value)},{immediate:!0});const T=e.computed(()=>l.assignments.map(M=>{const g=S.value.get(M.resourceId);if(g===void 0)return null;const h=i(M.start),V=i(M.end),F=(h-p.value.from)*w.value,R=Math.max(2,(V-h)*w.value),X=g*l.rowHeight;return{assignment:M,x:F,y:X,w:R,h:l.rowHeight,row:g}}).filter(M=>M!==null));function z(M){return b.value.has(M.id)?"conflict":M.status??"tentative"}function K(M){return l.unstyled?"":["sg-rcal-assignment",`sg-rcal-assignment-${z(M)}`,l.draggable?"sg-rcal-assignment-draggable":"",l.resizable?"sg-rcal-assignment-resizable":""].filter(Boolean).join(" ")}function L(M){var g;if(z(M)!=="conflict")return(g=l.resources.find(h=>h.id===M.resourceId))==null?void 0:g.color}const I=e.ref(null);function U(M,g,h){var V,F;M.button===0&&(h==="move"&&!l.draggable||h!=="move"&&!l.resizable||(M.preventDefault(),M.stopPropagation(),(F=(V=M.target).setPointerCapture)==null||F.call(V,M.pointerId),I.value={kind:h,id:g.id,startClientX:M.clientX,origStart:i(g.start),origEnd:i(g.end)}))}function O(M){const g=I.value;if(!g)return;const h=l.assignments.find(me=>me.id===g.id);if(!h)return;const F=(M.clientX-g.startClientX)/w.value,R=k.value,X=Math.round(F/R)*R;let se=g.origStart,ie=g.origEnd;g.kind==="move"?(se=g.origStart+X,ie=g.origEnd+X):g.kind==="resize-end"?ie=Math.max(g.origStart+R,g.origEnd+X):se=Math.min(g.origEnd-R,g.origStart+X);const ne={...h,start:se,end:ie};a("assignment-change",ne),a("assignmentChange",ne)}function q(){I.value=null}function ae(M,g){if(!l.draggable&&!l.resizable)return;const h=k.value,V=i(g.start),F=i(g.end);if(M.key==="ArrowLeft"||M.key==="ArrowRight"){const R=M.key==="ArrowLeft"?-1:1;M.preventDefault();let X;if(M.shiftKey&&l.resizable)X={...g,start:V,end:Math.max(V+h,F+R*h)};else if(l.draggable)X={...g,start:V+R*h,end:F+R*h};else return;a("assignment-change",X),a("assignmentChange",X)}}const G=e.computed(()=>l.unstyled?l.className??"":["sg-rcal",l.className].filter(Boolean).join(" ")),Y=e.computed(()=>({display:"grid",gridTemplateColumns:`${l.sidebarWidth}px 1fr`,width:"100%",overflow:"auto",height:`${x.value}px`,...l.style??{}}));return(M,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(G.value),style:e.normalizeStyle(Y.value),role:"region","aria-label":s.value,"data-scale":t.scale,"data-conflict-count":b.value.size,onPointermove:O,onPointerup:q},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-sidebar"),style:e.normalizeStyle({width:`${t.sidebarWidth}px`})},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-sidebar-header"),style:e.normalizeStyle({height:`${E.value}px`})},null,6),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.resources,(h,V)=>(e.openBlock(),e.createElementBlock("div",{key:h.id,class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-sidebar-row"),style:e.normalizeStyle({height:`${t.rowHeight}px`}),role:"row","aria-label":`Resource ${h.name}`,"data-row-index":V,"data-resource-id":h.id},[e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-sidebar-marker"),style:e.normalizeStyle(h.color?{background:h.color}:void 0),"data-role":"marker","aria-hidden":"true"},null,6),e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-sidebar-name")},e.toDisplayString(h.name),3),h.capacityPerSlot!==void 0?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-sidebar-capacity"),"aria-label":`capacity ${h.capacityPerSlot} per slot`},"×"+e.toDisplayString(h.capacityPerSlot),11,wr)):e.createCommentVNode("",!0)],14,Cr))),128))],6),e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-main"),style:e.normalizeStyle({position:"relative",width:`${B.value}px`,minWidth:"100%"})},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-header"),style:e.normalizeStyle({position:"relative",height:`${E.value}px`,width:`${B.value}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,h=>(e.openBlock(),e.createElementBlock("div",{key:h.time,class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-tick"),style:e.normalizeStyle({position:"absolute",left:`${h.x}px`,top:0,width:`${t.columnWidth}px`,height:`${E.value}px`}),"data-tick-time":h.time},e.toDisplayString(h.label),15,Sr))),128))],6),e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-grid"),style:e.normalizeStyle({position:"relative",width:`${B.value}px`,height:`${N.value}px`}),"data-conflict-count":b.value.size},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.resources,(h,V)=>(e.openBlock(),e.createElementBlock("div",{key:h.id,class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-row"),style:e.normalizeStyle({position:"absolute",left:0,top:`${V*t.rowHeight}px`,width:`${B.value}px`,height:`${t.rowHeight}px`}),"data-row-index":V,"data-resource-id":h.id},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,F=>(e.openBlock(),e.createElementBlock("div",{key:F.time,class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-slot"),style:e.normalizeStyle({position:"absolute",left:`${F.x}px`,top:0,width:`${t.columnWidth}px`,height:`${t.rowHeight}px`}),"data-slot-time":F.time},null,14,$r))),128))],14,xr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,h=>(e.openBlock(),e.createElementBlock("div",{key:h.assignment.id,class:e.normalizeClass(K(h.assignment)),style:e.normalizeStyle({position:"absolute",left:`${h.x}px`,top:`${h.y+4}px`,width:`${h.w}px`,height:`${h.h-8}px`,background:L(h.assignment),cursor:t.draggable?"grab":void 0,userSelect:t.draggable||t.resizable?"none":void 0}),role:"button",tabindex:"0","aria-label":`${h.assignment.title}${z(h.assignment)==="conflict"?" (conflict)":""}`,"data-assignment-id":h.assignment.id,"data-status":z(h.assignment),"data-resource-id":h.assignment.resourceId,onPointerdown:V=>t.draggable?U(V,h.assignment,"move"):void 0,onKeydown:V=>ae(V,h.assignment)},[t.resizable?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-assignment-resize-start"),role:"button","aria-label":v.value,tabindex:"-1","data-role":"resize-handle-start",style:{position:"absolute",left:0,top:0,bottom:0,width:"6px",cursor:"ew-resize"},onPointerdown:V=>U(V,h.assignment,"resize-start")},null,42,Vr)):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-assignment-title"),style:{position:"relative",zIndex:1}},e.toDisplayString(h.assignment.title),3),t.resizable?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(t.unstyled?void 0:"sg-rcal-assignment-resize-end"),role:"button","aria-label":c.value,tabindex:"-1","data-role":"resize-handle-end",style:{position:"absolute",right:0,top:0,bottom:0,width:"6px",cursor:"ew-resize"},onPointerdown:V=>U(V,h.assignment,"resize-end")},null,42,Dr)):e.createCommentVNode("",!0)],46,Nr))),128))],14,Er)],6)],46,Br))}}),dl=Symbol("sg-form-provider-context"),Tr=["name"],ml=e.defineComponent({__name:"Form",props:{form:{},name:{},defaultValues:{},initialValues:{},layout:{default:"vertical"},size:{default:"middle"},disabled:{type:Boolean,default:!1},colon:{type:Boolean},requiredMark:{type:[Boolean,String]},labelCol:{},wrapperCol:{},labelAlign:{},validateOn:{},scrollToFirstError:{type:Boolean},preserve:{type:Boolean}},emits:["submit","finish","finishFailed","valuesChange"],setup(t,{expose:n,emit:l}){const a=t,o=l,s=e.computed(()=>({defaultValues:a.defaultValues??a.initialValues,validateOn:a.validateOn,onValuesChange:(p,m)=>{o("valuesChange",m)}})),c=a.form??At(s.value),r=e.ref(null),i=e.computed(()=>["sg-form",`sg-form-${a.layout}`,`sg-form-${a.size}`,a.disabled?"sg-form-disabled":""].filter(Boolean).join(" "));e.provide(vt,{core:c.core,form:c.form,formApi:c,layout:a.layout,size:a.size,disabled:a.disabled,colon:a.colon,requiredMark:a.requiredMark,labelCol:a.labelCol,wrapperCol:a.wrapperCol,labelAlign:a.labelAlign,preserve:a.preserve});const d=e.inject(dl,null);e.onMounted(()=>{d&&a.name&&d.registerForm(a.name,c.form)}),e.onBeforeUnmount(()=>{d&&a.name&&d.unregisterForm(a.name)});async function u(p){var f;p.preventDefault(),await c.submit();const m=await c.validateFields(),k=c.getFieldsValue();if(o("submit",{values:k,valid:m.valid}),m.valid)o("finish",k),d&&a.name&&((f=d.onFormFinish)==null||f.call(d,a.name,{values:k,forms:d.forms}));else if(o("finishFailed",m.errors),a.scrollToFirstError&&r.value){const w=Object.keys(m.errors)[0];if(w){const B=r.value.querySelector(`[data-field-name="${w}"]`)??r.value.querySelector(`[name="${w}"]`);B&&"scrollIntoView"in B&&B.scrollIntoView({behavior:"smooth",block:"center"})}}}return n({formApi:c,submit:()=>c.submit(),reset:p=>c.reset(p),validate:()=>c.validateFields(),getFieldsValue:()=>c.getFieldsValue(),setFieldsValue:p=>c.setFieldsValue(p)}),(p,m)=>(e.openBlock(),e.createElementBlock("form",{ref_key:"formRef",ref:r,name:t.name,class:e.normalizeClass(i.value),novalidate:"",onSubmit:u},[e.renderSlot(p.$slots,"default",{form:e.unref(c)})],42,Tr))}}),Lr=["data-field-name"],Mr={key:0,class:"sg-field-required"},Fr={class:"sg-field-control"},Ar=["value","disabled"],Pr={key:0,class:"sg-field-error",role:"alert"},Rr={key:1,class:"sg-field-warning"},Ir={key:2,class:"sg-field-help"},Kr={key:3,class:"sg-field-extra"},Or={key:0,class:"sg-field-label"},Hr={key:0,class:"sg-field-required"},jr={class:"sg-field-control"},_r=["value","disabled"],Yr={key:1,class:"sg-field-error",role:"alert"},Wr={key:2,class:"sg-field-warning"},Ur={key:3,class:"sg-field-help"},qr={key:4,class:"sg-field-extra"},pl=e.defineComponent({__name:"Field",props:{name:{},label:{},rules:{default:()=>[]},warningRules:{},required:{type:Boolean,default:!1},dependencies:{},trigger:{},help:{},extra:{},preserve:{type:Boolean},hidden:{type:Boolean,default:!1},disabled:{type:Boolean},validateStatus:{},noStyle:{type:Boolean,default:!1},normalize:{},validateFirst:{type:Boolean},tooltip:{},labelCol:{},wrapperCol:{}},setup(t){const n=t,l=e.inject(vt,null);if(!l)throw new Error("[skygraph/vue] <SgField> must be used inside an <SgForm>");const a=l,o=Pl(a.core,a.form,n.name),s=e.computed(()=>n.disabled??a.disabled);let v=o.value.value;const c=C=>{if(n.normalize){const b=n.normalize(C,v);v=b,o.onChange(b)}else v=C,o.onChange(C)};function r(){const C=[...n.rules??[]];n.required&&C.unshift({required:!0}),a.form.register(n.name,{rules:C,warningRules:n.warningRules,dependencies:n.dependencies,validateOn:Array.isArray(n.trigger)?n.trigger[0]:n.trigger,validateFirst:n.validateFirst,label:n.label,preserve:n.preserve??a.preserve})}r(),e.watch(()=>[n.rules,n.required,n.warningRules,n.dependencies],()=>{r()},{deep:!0}),e.onBeforeUnmount(()=>{a.form.unregister(n.name)});const i=e.computed(()=>o.errors.value.length>0),d=e.computed(()=>o.warnings.value.length>0),u=e.computed(()=>n.validateStatus??o.status.value),p=e.computed(()=>["sg-field",a.layout==="horizontal"?"sg-field-horizontal":"",i.value?"sg-field-has-error":"",d.value&&!i.value?"sg-field-has-warning":"",u.value?`sg-field-status-${u.value}`:""].filter(Boolean).join(" ")),m=e.useSlots(),k=e.computed(()=>!!m.label),f=e.computed(()=>n.labelCol??a.labelCol),w=e.computed(()=>n.wrapperCol??a.wrapperCol),B=e.computed(()=>a.labelAlign??"right"),E=e.computed(()=>a.layout==="horizontal"&&!!f.value),N=e.computed(()=>{var C;return((C=f.value)==null?void 0:C.span)??6}),x=e.computed(()=>{var C;return((C=w.value)==null?void 0:C.span)??24-N.value}),y=e.computed(()=>`${N.value/24*100}%`),P=e.computed(()=>`${x.value/24*100}%`),S=e.computed(()=>{var C;return a.layout==="horizontal"&&((C=f.value)!=null&&C.offset)?{marginLeft:`${f.value.offset/24*100}%`}:void 0});return(C,b)=>t.hidden?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.noStyle?e.renderSlot(C.$slots,"default",{key:0,value:e.unref(o).value.value,onChange:c,onBlur:e.unref(o).onBlur,errors:e.unref(o).errors.value,error:e.unref(o).error.value,warnings:e.unref(o).warnings.value,touched:e.unref(o).touched.value,dirty:e.unref(o).dirty.value,validating:e.unref(o).validating.value,status:u.value}):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(p.value),"data-field-name":t.name},[E.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",{class:"sg-field-label-wrap",style:e.normalizeStyle({width:y.value,textAlign:B.value})},[t.label||k.value?(e.openBlock(),e.createElementBlock("label",{key:0,class:"sg-field-label",style:e.normalizeStyle(S.value)},[e.renderSlot(C.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),t.required?(e.openBlock(),e.createElementBlock("span",Mr,"*")):e.createCommentVNode("",!0),e.unref(a).colon?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(":")],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"sg-field-control-wrap",style:e.normalizeStyle({width:P.value})},[e.createElementVNode("div",Fr,[e.renderSlot(C.$slots,"default",{value:e.unref(o).value.value,onChange:c,onBlur:e.unref(o).onBlur,errors:e.unref(o).errors.value,error:e.unref(o).error.value,warnings:e.unref(o).warnings.value,touched:e.unref(o).touched.value,dirty:e.unref(o).dirty.value,validating:e.unref(o).validating.value,status:u.value},()=>[e.createElementVNode("input",{class:"sg-input",type:"text",value:e.unref(o).value.value??"",disabled:s.value,onInput:b[0]||(b[0]=$=>c($.target.value)),onBlur:b[1]||(b[1]=(...$)=>e.unref(o).onBlur&&e.unref(o).onBlur(...$))},null,40,Ar)])]),i.value?(e.openBlock(),e.createElementBlock("div",Pr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).errors.value,($,T)=>(e.openBlock(),e.createElementBlock("div",{key:T},e.toDisplayString($),1))),128))])):d.value?(e.openBlock(),e.createElementBlock("div",Rr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).warnings.value,($,T)=>(e.openBlock(),e.createElementBlock("div",{key:T},e.toDisplayString($),1))),128))])):t.help?(e.openBlock(),e.createElementBlock("div",Ir,e.toDisplayString(t.help),1)):e.createCommentVNode("",!0),t.extra?(e.openBlock(),e.createElementBlock("div",Kr,e.toDisplayString(t.extra),1)):e.createCommentVNode("",!0)],4)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label||k.value?(e.openBlock(),e.createElementBlock("label",Or,[e.renderSlot(C.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),t.required?(e.openBlock(),e.createElementBlock("span",Hr,"*")):e.createCommentVNode("",!0),e.unref(a).colon?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(":")],64)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",jr,[e.renderSlot(C.$slots,"default",{value:e.unref(o).value.value,onChange:c,onBlur:e.unref(o).onBlur,errors:e.unref(o).errors.value,error:e.unref(o).error.value,warnings:e.unref(o).warnings.value,touched:e.unref(o).touched.value,dirty:e.unref(o).dirty.value,validating:e.unref(o).validating.value,status:u.value},()=>[e.createElementVNode("input",{class:"sg-input",type:"text",value:e.unref(o).value.value??"",disabled:s.value,onInput:b[2]||(b[2]=$=>c($.target.value)),onBlur:b[3]||(b[3]=(...$)=>e.unref(o).onBlur&&e.unref(o).onBlur(...$))},null,40,_r)])]),i.value?(e.openBlock(),e.createElementBlock("div",Yr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).errors.value,($,T)=>(e.openBlock(),e.createElementBlock("div",{key:T},e.toDisplayString($),1))),128))])):d.value?(e.openBlock(),e.createElementBlock("div",Wr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o).warnings.value,($,T)=>(e.openBlock(),e.createElementBlock("div",{key:T},e.toDisplayString($),1))),128))])):t.help?(e.openBlock(),e.createElementBlock("div",Ur,e.toDisplayString(t.help),1)):e.createCommentVNode("",!0),t.extra?(e.openBlock(),e.createElementBlock("div",qr,e.toDisplayString(t.extra),1)):e.createCommentVNode("",!0)],64))],10,Lr))],64))}}),Xr=e.defineComponent({__name:"FormList",props:{name:{},initialValue:{}},setup(t){let n=0;function l(){return`fl_${++n}`}const a=t,o=e.inject(vt,null);if(!o)throw new Error("[skygraph/vue] <SgFormList> must be used inside an <SgForm>");const s=o;e.onMounted(()=>{a.initialValue&&!Array.isArray(s.core.get(a.name))&&s.core.set(a.name,a.initialValue)});const v=e.ref(Array.isArray(s.core.get(a.name))?s.core.get(a.name):[]),c=e.ref(v.value.map(()=>l())),r=s.core.subscribe(a.name,w=>{const B=Array.isArray(w)?w:[];v.value=B});e.watch(v,w=>{if(w.length>c.value.length){const B=w.length-c.value.length;c.value=[...c.value,...Array.from({length:B},()=>l())]}else w.length<c.value.length&&(c.value=c.value.slice(0,w.length))});const i=e.computed(()=>c.value.slice(0,v.value.length).map((w,B)=>({key:w,index:B}))),k={add:(w,B)=>{s.form.listAdd(a.name,w,B);const E=l();if(B!==void 0&&B>=0&&B<=c.value.length){const N=[...c.value];N.splice(B,0,E),c.value=N}else c.value=[...c.value,E]},remove:w=>{if(s.form.listRemove(a.name,w),Array.isArray(w)){const B=new Set(w);c.value=c.value.filter((E,N)=>!B.has(N))}else c.value=c.value.filter((B,E)=>E!==w)},move:(w,B)=>{s.form.listMove(a.name,w,B);const E=[...c.value],[N]=E.splice(w,1);E.splice(B,0,N),c.value=E},replace:w=>{s.form.listReplace(a.name,w),c.value=w.map(()=>l())}},f=e.computed(()=>({errors:s.form.getFieldErrors(a.name)}));return e.onBeforeUnmount(()=>r()),(w,B)=>e.renderSlot(w.$slots,"default",{fields:i.value,operation:k,meta:f.value})}}),Gr=e.defineComponent({__name:"FormProvider",emits:["formFinish","formChange"],setup(t,{expose:n,emit:l}){const a=l,o={};return e.provide(dl,{registerForm:(s,v)=>{o[s]=v},unregisterForm:s=>{delete o[s]},onFormFinish:(s,v)=>a("formFinish",s,v),onFormChange:(s,v)=>a("formChange",s,v),forms:o}),n({forms:o}),(s,v)=>e.renderSlot(s.$slots,"default")}}),Jr={class:"sg-autofield"},Zr={key:0,class:"sg-autofield-label"},Qr={key:1,style:{display:"flex","align-items":"center",gap:"8px",cursor:"pointer"}},ei=["checked","disabled","role"],ti=["value","placeholder","disabled","min","max","step","aria-invalid","aria-describedby"],li=["value","placeholder","disabled","aria-invalid","aria-describedby"],ai=["value","disabled","aria-invalid","aria-describedby"],ni={value:""},oi=["value"],si=["value","disabled","aria-invalid"],ri=["value"],ii={key:6,role:"radiogroup",style:{display:"flex",gap:"12px","flex-wrap":"wrap"}},ci=["name","value","checked","disabled","onChange"],ui=["value","disabled","aria-invalid"],di=["value","disabled","aria-invalid"],mi=["value","placeholder","disabled","aria-invalid"],pi=["value","disabled"],vi={key:11,style:{display:"flex","align-items":"center",gap:"8px"}},gi=["value","min","max","step","disabled"],fi={style:{"min-width":"32px","text-align":"right","font-size":"14px"}},hi={key:12,style:{display:"flex",gap:"2px"}},yi=["disabled","aria-label","onClick"],ki=["accept","multiple","disabled"],bi=["type","value","placeholder","disabled","aria-invalid","aria-describedby"],Bi=["id"],Ci={key:16,style:{color:"var(--sg-color-warning, #faad14)","font-size":"12px"}},vl=e.defineComponent({__name:"AutoField",props:{name:{},label:{},type:{},options:{},placeholder:{},min:{},max:{},step:{},accept:{},multiple:{type:Boolean},disabled:{type:Boolean}},setup(t){const n=t,l=e.inject(vt,null);if(!l)throw new Error("[skygraph/vue] <SgAutoField> must be used inside an <SgForm>");const a=l,o=e.computed(()=>a.form.getValue(n.name)),s=e.computed(()=>a.form.getFieldState(n.name)),v=e.computed(()=>{if(n.type)return n.type;if(n.options&&n.options.length>0)return"select";const m=o.value;if(typeof m=="boolean")return"boolean";if(typeof m=="number")return"number";if(typeof m=="string"){if(m.includes("@"))return"email";if(m.startsWith("http"))return"url"}return"string"}),c=m=>{a.form.setValue(n.name,m)},r=e.computed(()=>n.disabled??a.disabled),i=e.computed(()=>s.value.errors.length>0),d=e.computed(()=>s.value.warnings.length>0),u=e.computed(()=>`${n.name}-error`),p=e.computed(()=>({"sg-autofield-input-error":i.value,"sg-autofield-input-warning":!i.value&&d.value}));return(m,k)=>(e.openBlock(),e.createElementBlock("div",Jr,[v.value!=="boolean"&&v.value!=="switch"&&t.label?(e.openBlock(),e.createElementBlock("label",Zr,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0),v.value==="boolean"||v.value==="switch"?(e.openBlock(),e.createElementBlock("label",Qr,[e.createElementVNode("input",{type:"checkbox",checked:!!o.value,disabled:r.value,role:v.value==="switch"?"switch":void 0,onChange:k[0]||(k[0]=f=>c(f.target.checked))},null,40,ei),e.createTextVNode(" "+e.toDisplayString(t.label),1)])):v.value==="number"?(e.openBlock(),e.createElementBlock("input",{key:2,type:"number",class:e.normalizeClass(["sg-autofield-input",p.value]),value:o.value==null?"":String(o.value),placeholder:t.placeholder,disabled:r.value,min:t.min,max:t.max,step:t.step,"aria-invalid":i.value||void 0,"aria-describedby":i.value?u.value:void 0,onInput:k[1]||(k[1]=f=>{const w=f.target.value;c(w===""?null:Number(w))}),onBlur:k[2]||(k[2]=f=>e.unref(a).form.onFieldBlur(t.name))},null,42,ti)):v.value==="textarea"?(e.openBlock(),e.createElementBlock("textarea",{key:3,class:e.normalizeClass(["sg-autofield-input sg-autofield-input-textarea",p.value]),value:o.value==null?"":String(o.value),placeholder:t.placeholder,disabled:r.value,"aria-invalid":i.value||void 0,"aria-describedby":i.value?u.value:void 0,onInput:k[3]||(k[3]=f=>c(f.target.value)),onBlur:k[4]||(k[4]=f=>e.unref(a).form.onFieldBlur(t.name))},null,42,li)):v.value==="select"?(e.openBlock(),e.createElementBlock("select",{key:4,class:e.normalizeClass(["sg-autofield-input",p.value]),value:o.value==null?"":String(o.value),disabled:r.value,"aria-invalid":i.value||void 0,"aria-describedby":i.value?u.value:void 0,onChange:k[5]||(k[5]=f=>c(f.target.value))},[e.createElementVNode("option",ni,e.toDisplayString(t.placeholder??"-- Select --"),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,f=>(e.openBlock(),e.createElementBlock("option",{key:f.value,value:f.value},e.toDisplayString(f.label),9,oi))),128))],42,ai)):v.value==="multiselect"?(e.openBlock(),e.createElementBlock("select",{key:5,multiple:"",class:e.normalizeClass(["sg-autofield-input sg-autofield-input-multiple",p.value]),value:Array.isArray(o.value)?o.value.map(String):[],disabled:r.value,"aria-invalid":i.value||void 0,onChange:k[6]||(k[6]=f=>{const w=Array.from(f.target.selectedOptions,B=>B.value);c(w)})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,f=>(e.openBlock(),e.createElementBlock("option",{key:f.value,value:f.value},e.toDisplayString(f.label),9,ri))),128))],42,si)):v.value==="radio"?(e.openBlock(),e.createElementBlock("div",ii,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,f=>(e.openBlock(),e.createElementBlock("label",{key:f.value,style:{display:"flex","align-items":"center",gap:"4px",cursor:"pointer"}},[e.createElementVNode("input",{type:"radio",name:t.name,value:f.value,checked:o.value===f.value,disabled:r.value,onChange:w=>c(f.value)},null,40,ci),e.createTextVNode(" "+e.toDisplayString(f.label),1)]))),128))])):v.value==="date"?(e.openBlock(),e.createElementBlock("input",{key:7,type:"date",class:e.normalizeClass(["sg-autofield-input",p.value]),value:o.value==null?"":String(o.value),disabled:r.value,"aria-invalid":i.value||void 0,onInput:k[7]||(k[7]=f=>c(f.target.value))},null,42,ui)):v.value==="time"?(e.openBlock(),e.createElementBlock("input",{key:8,type:"time",class:e.normalizeClass(["sg-autofield-input",p.value]),value:o.value==null?"":String(o.value),disabled:r.value,"aria-invalid":i.value||void 0,onInput:k[8]||(k[8]=f=>c(f.target.value))},null,42,di)):v.value==="password"?(e.openBlock(),e.createElementBlock("input",{key:9,type:"password",class:e.normalizeClass(["sg-autofield-input",p.value]),value:o.value==null?"":String(o.value),placeholder:t.placeholder,disabled:r.value,"aria-invalid":i.value||void 0,onInput:k[9]||(k[9]=f=>c(f.target.value)),onBlur:k[10]||(k[10]=f=>e.unref(a).form.onFieldBlur(t.name))},null,42,mi)):v.value==="color"?(e.openBlock(),e.createElementBlock("input",{key:10,type:"color",class:"sg-autofield-input sg-autofield-input-color",value:o.value==null?"#000000":String(o.value),disabled:r.value,onInput:k[11]||(k[11]=f=>c(f.target.value))},null,40,pi)):v.value==="slider"?(e.openBlock(),e.createElementBlock("div",vi,[e.createElementVNode("input",{type:"range",value:o.value==null?t.min??0:Number(o.value),min:t.min??0,max:t.max??100,step:t.step??1,disabled:r.value,style:{flex:"1"},onInput:k[12]||(k[12]=f=>c(Number(f.target.value)))},null,40,gi),e.createElementVNode("span",fi,e.toDisplayString(String(o.value??t.min??0)),1)])):v.value==="rate"?(e.openBlock(),e.createElementBlock("div",hi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.max??5,f=>(e.openBlock(),e.createElementBlock("button",{key:f,type:"button",disabled:r.value,"aria-label":`${f} star${f!==1?"s":""}`,style:e.normalizeStyle({background:"none",border:"none",cursor:r.value?"default":"pointer",fontSize:"20px",color:f<=(typeof o.value=="number"?o.value:0)?"var(--sg-color-warning, #faad14)":"var(--sg-color-border, #d9d9d9)",padding:0}),onClick:w=>!r.value&&c(f)}," ★ ",12,yi))),128))])):v.value==="file"?(e.openBlock(),e.createElementBlock("input",{key:13,type:"file",class:e.normalizeClass(["sg-autofield-input",p.value]),accept:t.accept,multiple:t.multiple,disabled:r.value,onChange:k[13]||(k[13]=f=>{const w=f.target.files;w&&c(t.multiple?Array.from(w):w[0]??null)})},null,42,ki)):(e.openBlock(),e.createElementBlock("input",{key:14,type:v.value==="email"?"email":v.value==="url"?"url":"text",class:e.normalizeClass(["sg-autofield-input",p.value]),value:o.value==null?"":String(o.value),placeholder:t.placeholder,disabled:r.value,"aria-invalid":i.value||void 0,"aria-describedby":i.value?u.value:void 0,onInput:k[14]||(k[14]=f=>c(f.target.value)),onBlur:k[15]||(k[15]=f=>e.unref(a).form.onFieldBlur(t.name))},null,42,bi)),i.value?(e.openBlock(),e.createElementBlock("span",{key:15,id:u.value,role:"alert",style:{color:"var(--sg-color-error, #ff4d4f)","font-size":"12px"}},e.toDisplayString(s.value.errors.join("; ")),9,Bi)):d.value?(e.openBlock(),e.createElementBlock("span",Ci,e.toDisplayString(s.value.warnings.join("; ")),1)):e.createCommentVNode("",!0)]))}});function wi(t){if(t.enum||t.oneOf)return"select";if(t.format==="email")return"email";if(t.format==="uri"||t.format==="url")return"url";if(t.format==="date")return"date";if(t.format==="time")return"time";if(t.format==="password")return"password";if(t.format==="color")return"color";switch(t.type){case"number":case"integer":return"number";case"boolean":return"boolean";case"array":return"multiselect";default:return t.maxLength&&t.maxLength>200?"textarea":"string"}}function Si(t){if(t.oneOf)return t.oneOf.map(n=>({value:n.const,label:n.title??String(n.const)}));if(t.enum)return t.enum.map((n,l)=>{var a;return{value:n,label:((a=t.enumNames)==null?void 0:a[l])??String(n)}})}function ta(t){const n=[],l=t.properties??{};for(const[a,o]of Object.entries(l))n.push({name:a,label:o.title??a,type:wi(o),placeholder:o.description,options:Si(o),min:o.minimum,max:o.maximum});return n}function gl(t){const n={},l=t.properties??{},a=new Set(t.required??[]);for(const[o,s]of Object.entries(l)){const v=[];a.has(o)&&v.push({required:!0,message:`${s.title??o} is required`}),s.type==="string"&&(s.minLength!==void 0&&v.push({min:s.minLength,message:`Minimum ${s.minLength} characters`}),s.maxLength!==void 0&&v.push({max:s.maxLength,message:`Maximum ${s.maxLength} characters`}),s.pattern&&v.push({pattern:new RegExp(s.pattern),message:"Invalid format"})),(s.type==="number"||s.type==="integer")&&(s.minimum!==void 0&&v.push({min:s.minimum,type:"number"}),s.maximum!==void 0&&v.push({max:s.maximum,type:"number"})),s.format==="email"&&v.push({type:"email"}),(s.format==="uri"||s.format==="url")&&v.push({type:"url"}),v.length>0&&(n[o]=v)}return n}function fl(t){const n={},l=t.properties??{};for(const[a,o]of Object.entries(l))o.default!==void 0&&(n[a]=o.default);return n}const la=e.defineComponent({__name:"SchemaForm",props:{schema:{},form:{},layout:{default:"vertical"},size:{default:"middle"},disabled:{type:Boolean,default:!1},labelCol:{},wrapperCol:{},submitText:{default:"Submit"}},emits:["submit"],setup(t,{emit:n}){const l=t,a=n,o=e.computed(()=>ta(l.schema)),s=e.computed(()=>gl(l.schema)),v=e.computed(()=>fl(l.schema)),c=At({defaultValues:v.value,onSubmit:i=>a("submit",i)}),r=e.computed(()=>l.form??c);return(i,d)=>(e.openBlock(),e.createBlock(ml,{form:r.value,layout:t.layout,size:t.size,disabled:t.disabled,"label-col":t.labelCol,"wrapper-col":t.wrapperCol},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,u=>(e.openBlock(),e.createBlock(pl,{key:u.name,name:u.name,label:u.label,rules:s.value[u.name]},{default:e.withCtx(()=>[e.createVNode(vl,{name:u.name,type:u.type,options:u.options,placeholder:u.placeholder,min:u.min,max:u.max,disabled:t.disabled},null,8,["name","type","options","placeholder","min","max","disabled"])]),_:2},1032,["name","label","rules"]))),128)),e.renderSlot(i.$slots,"default",{},()=>[e.createVNode(Ye,{type:"primary","html-type":"submit"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.submitText),1)]),_:1})])]),_:3},8,["form","layout","size","disabled","label-col","wrapper-col"]))}}),Ei=e.defineComponent({__name:"SubmitButton",props:{disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},unstyled:{type:Boolean,default:!1}},setup(t){const n=Ce(),l=e.computed(()=>{var a,o;return((o=(a=n.value.locale)==null?void 0:a.form)==null?void 0:o.submitText)??"Submit"});return(a,o)=>(e.openBlock(),e.createBlock(Ye,{type:"primary",htmlType:"submit",disabled:t.disabled,loading:t.loading,unstyled:t.unstyled},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(l.value),1)])]),_:3},8,["disabled","loading","unstyled"]))}}),aa=[{type:"string",label:"Input",hint:"Single-line text",glyph:"T"},{type:"textarea",label:"Textarea",hint:"Multi-line text",glyph:"¶"},{type:"number",label:"Number",hint:"Numeric input",glyph:"#"},{type:"select",label:"Select",hint:"Dropdown choice",glyph:"▾"},{type:"radio",label:"Radio",hint:"Single choice",glyph:"◉"},{type:"boolean",label:"Checkbox",hint:"Boolean toggle",glyph:"☐"},{type:"switch",label:"Switch",hint:"On / off toggle",glyph:"⌨"},{type:"date",label:"Date",hint:"Calendar picker",glyph:"📅"},{type:"time",label:"Time",hint:"Clock picker",glyph:"🕒"},{type:"slider",label:"Slider",hint:"Numeric range",glyph:"═"},{type:"rate",label:"Rate",hint:"Star rating",glyph:"★"},{type:"color",label:"Color",hint:"Color picker",glyph:"◐"},{type:"email",label:"Email",hint:"Email input",glyph:"@"},{type:"url",label:"URL",hint:"Link input",glyph:"↗"},{type:"password",label:"Password",hint:"Masked input",glyph:"✱"},{type:"file",label:"File",hint:"File upload",glyph:"⇪"}],Ft="application/x-sg-sfe-palette-type",xi={class:"sg-sfe-palette","data-testid":"sfe-palette"},$i={class:"sg-sfe-palette-list"},Ni=["data-palette-type","onDragstart","onClick","onKeydown"],Vi={class:"sg-sfe-palette-item-glyph","aria-hidden":"true"},Di={class:"sg-sfe-palette-item-body"},zi={class:"sg-sfe-palette-item-label"},Ti={key:0,class:"sg-sfe-palette-item-hint"},na=e.defineComponent({__name:"SchemaFormEditorPalette",props:{items:{default:()=>aa}},emits:["itemActivate"],setup(t,{emit:n}){const l=t,a=n;function o(c,r){r.dataTransfer&&(r.dataTransfer.setData(Ft,c),r.dataTransfer.setData("text/plain",c),r.dataTransfer.effectAllowed="copy")}function s(c){a("itemActivate",c)}function v(c,r){(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),a("itemActivate",c))}return(c,r)=>(e.openBlock(),e.createElementBlock("div",xi,[r[0]||(r[0]=e.createElementVNode("div",{class:"sg-sfe-palette-title"},"Fields",-1)),e.createElementVNode("div",$i,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.items,i=>(e.openBlock(),e.createElementBlock("div",{key:i.type,class:"sg-sfe-palette-item","data-palette-type":i.type,draggable:"true",tabindex:"0",role:"button",onDragstart:d=>o(i.type,d),onClick:d=>s(i.type),onKeydown:d=>v(i.type,d)},[e.createElementVNode("span",Vi,e.toDisplayString(i.glyph??"·"),1),e.createElementVNode("span",Di,[e.createElementVNode("span",zi,e.toDisplayString(i.label),1),i.hint?(e.openBlock(),e.createElementBlock("span",Ti,e.toDisplayString(i.hint),1)):e.createCommentVNode("",!0)])],40,Ni))),128))])]))}});let Fl=0;function oa(t="fld"){return Fl++,`${t}_${Date.now().toString(36)}_${Fl}`}function Li(t){switch(t){case"string":case"textarea":return{type:"string"};case"email":return{type:"string",format:"email"};case"url":return{type:"string",format:"url"};case"date":return{type:"string",format:"date"};case"time":return{type:"string",format:"time"};case"password":return{type:"string",format:"password"};case"color":return{type:"string",format:"color"};case"number":case"slider":case"rate":return{type:"number"};case"boolean":case"switch":return{type:"boolean"};case"select":case"radio":return{type:"string"};case"multiselect":return{type:"array"};case"file":return{type:"string"};default:return{type:"string"}}}function Mi(t){if(t.enum||t.oneOf)return"select";if(t.format==="email")return"email";if(t.format==="uri"||t.format==="url")return"url";if(t.format==="date")return"date";if(t.format==="time")return"time";if(t.format==="password")return"password";if(t.format==="color")return"color";switch(t.type){case"number":case"integer":return"number";case"boolean":return"boolean";case"array":return"multiselect";default:return t.maxLength&&t.maxLength>200?"textarea":"string"}}function sa(){return{fields:[]}}function Fi(t){var o,s;const n=t.properties??{},l=new Set(t.required??[]),a=[];for(const[v,c]of Object.entries(n)){const r=Mi(c);a.push({id:oa("imp"),name:v,label:c.title??v,type:r,required:l.has(v),min:c.minimum??c.minLength,max:c.maximum??c.maxLength,pattern:c.pattern,defaultValue:c.default,helpText:c.description,placeholder:void 0,options:((o=c.oneOf)==null?void 0:o.map(i=>({value:i.const,label:i.title??String(i.const)})))??((s=c.enum)==null?void 0:s.map((i,d)=>{var u;return{value:i,label:((u=c.enumNames)==null?void 0:u[d])??String(i)}}))})}return{title:t.title,description:t.description,fields:a}}function Ai(t){const{type:n,format:l}=Li(t.type),a={type:n};return l&&(a.format=l),t.label&&t.label!==t.name&&(a.title=t.label),t.helpText&&(a.description=t.helpText),t.defaultValue!==void 0&&(a.default=t.defaultValue),n==="string"?(t.min!==void 0&&(a.minLength=t.min),t.max!==void 0&&(a.maxLength=t.max),t.pattern&&(a.pattern=t.pattern)):(n==="number"||n==="integer")&&(t.min!==void 0&&(a.minimum=t.min),t.max!==void 0&&(a.maximum=t.max)),t.options&&t.options.length>0&&(a.enum=t.options.map(o=>o.value),a.enumNames=t.options.map(o=>o.label)),t.type==="textarea"&&a.maxLength===void 0&&(a.maxLength=1e3),a}function Ot(t){const n={},l=[];for(const o of t.fields)n[o.name]=Ai(o),o.required&&l.push(o.name);const a={type:"object",properties:n};return l.length>0&&(a.required=l),t.title&&(a.title=t.title),t.description&&(a.description=t.description),a}function hl(t,n){const l=`field${n.length+1}`;let a=l,o=1;for(;n.includes(a);)o++,a=`${l}_${o}`;const s=t.charAt(0).toUpperCase()+t.slice(1),v={id:oa("new"),name:a,label:s,type:t};return(t==="select"||t==="radio")&&(v.options=[{value:"option1",label:"Option 1"},{value:"option2",label:"Option 2"}]),(t==="number"||t==="slider")&&(v.min=0,v.max=100),t==="rate"&&(v.max=5),v}const Pi=["data-empty"],Ri={key:0,class:"sg-sfe-canvas-drop-indicator","data-testid":"sfe-drop-indicator"},Ii=["data-field-id","data-field-name","onClick","onDragstart","onDragover","onDrop"],Ki=["aria-label","onClick"],Oi=["aria-label","onClick"],Hi=["aria-label","onClick"],ji=["aria-label","onClick"],_i={class:"sg-sfe-canvas-field-inner"},Yi={key:0,class:"sg-sfe-canvas-field-help"},Wi={key:0,class:"sg-sfe-canvas-drop-indicator","data-testid":"sfe-drop-indicator"},ra=e.defineComponent({__name:"SchemaFormEditorCanvas",props:{store:{},emptyText:{default:"Drop a field here"}},setup(t){const n=t,l=e.computed(()=>n.store.state.value.schema.fields),a=e.computed(()=>l.value.length===0),o=e.computed(()=>Ot(n.store.state.value.schema)),s=e.computed(()=>gl(o.value)),v=e.computed(()=>fl(o.value)),c=e.ref(null),r=e.ref(null),i=Ce(),d=e.computed(()=>{var S,C;return((C=(S=i.value.locale)==null?void 0:S.schemaFormEditor)==null?void 0:C.moveFieldUp)??"Move field up"}),u=e.computed(()=>{var S,C;return((C=(S=i.value.locale)==null?void 0:S.schemaFormEditor)==null?void 0:C.moveFieldDown)??"Move field down"}),p=e.computed(()=>{var S,C;return((C=(S=i.value.locale)==null?void 0:S.schemaFormEditor)==null?void 0:C.duplicateField)??"Duplicate field"}),m=e.computed(()=>{var S,C;return((C=(S=i.value.locale)==null?void 0:S.schemaFormEditor)==null?void 0:C.deleteField)??"Delete field"}),k=At({defaultValues:v.value});function f(S){var C,b;((C=S.dataTransfer)!=null&&C.types.includes(Ft)||(b=S.dataTransfer)!=null&&b.types.includes("text/plain")||r.value!==null)&&(S.preventDefault(),S.dataTransfer&&(S.dataTransfer.dropEffect=r.value?"move":"copy"))}function w(S,C){var K,L;if(S.preventDefault(),S.stopPropagation(),c.value=null,r.value){const I=r.value,U=l.value.findIndex(q=>q.id===I);if(r.value=null,U===-1)return;let O=C;if(O>U&&(O-=1),O===U)return;n.store.moveField(I,O);return}let b=null;const $=(K=S.dataTransfer)==null?void 0:K.getData(Ft);if($)b=$;else{const I=(L=S.dataTransfer)==null?void 0:L.getData("text/plain");I&&(b=I)}if(!b)return;const T=l.value.map(I=>I.name),z=hl(b,T);n.store.addField(z,C)}function B(){n.store.setSelectedId(null)}function E(S,C){C.stopPropagation(),n.store.setSelectedId(S)}function N(S,C){C.stopPropagation(),C.dataTransfer&&(C.dataTransfer.effectAllowed="move",C.dataTransfer.setData("text/plain",S)),r.value=S}function x(){r.value=null,c.value=null}function y(S,C){C.preventDefault(),C.stopPropagation(),c.value=S}function P(){c.value=null}return(S,C)=>(e.openBlock(),e.createElementBlock("div",{class:"sg-sfe-canvas","data-testid":"sfe-canvas","data-empty":a.value?"true":"false",onDragover:f,onDrop:C[1]||(C[1]=b=>w(b,l.value.length))},[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-sfe-canvas-empty","data-testid":"sfe-canvas-empty",onClick:B},e.toDisplayString(t.emptyText),1)):(e.openBlock(),e.createBlock(ml,{key:1,form:e.unref(k),layout:"vertical",class:"sg-sfe-canvas-form"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(b,$)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:b.id},[c.value===$?(e.openBlock(),e.createElementBlock("div",Ri)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["sg-sfe-canvas-field",b.id===t.store.state.value.selectedId?"sg-sfe-canvas-field-selected":""]),"data-testid":"sfe-canvas-field","data-field-id":b.id,"data-field-name":b.name,draggable:"true",onClick:T=>E(b.id,T),onDragstart:T=>N(b.id,T),onDragend:x,onDragover:T=>y($,T),onDragleave:P,onDrop:T=>w(T,$)},[b.id===t.store.state.value.selectedId?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-sfe-canvas-field-toolbar","data-testid":"sfe-field-toolbar",onClick:C[0]||(C[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:"sg-sfe-canvas-field-toolbar-btn","data-testid":"sfe-action-up","aria-label":d.value,onClick:T=>t.store.moveFieldUp(b.id)}," ↑ ",8,Ki),e.createElementVNode("button",{type:"button",class:"sg-sfe-canvas-field-toolbar-btn","data-testid":"sfe-action-down","aria-label":u.value,onClick:T=>t.store.moveFieldDown(b.id)}," ↓ ",8,Oi),e.createElementVNode("button",{type:"button",class:"sg-sfe-canvas-field-toolbar-btn","data-testid":"sfe-action-duplicate","aria-label":p.value,onClick:T=>t.store.duplicateField(b.id)}," ⎘ ",8,Hi),e.createElementVNode("button",{type:"button",class:"sg-sfe-canvas-field-toolbar-btn sg-sfe-canvas-field-toolbar-btn-danger","data-testid":"sfe-action-delete","aria-label":m.value,onClick:T=>t.store.removeField(b.id)}," × ",8,ji)])):e.createCommentVNode("",!0),e.createElementVNode("div",_i,[e.createVNode(pl,{name:b.name,label:b.label,rules:s.value[b.name]},{default:e.withCtx(()=>[e.createVNode(vl,{name:b.name,type:b.type,options:b.options,placeholder:b.placeholder,min:b.min,max:b.max},null,8,["name","type","options","placeholder","min","max"])]),_:2},1032,["name","label","rules"]),b.helpText?(e.openBlock(),e.createElementBlock("span",Yi,e.toDisplayString(b.helpText),1)):e.createCommentVNode("",!0)])],42,Ii)],64))),128)),c.value===l.value.length?(e.openBlock(),e.createElementBlock("div",Wi)):e.createCommentVNode("",!0)]),_:1},8,["form"]))],40,Pi))}}),Ui={class:"sg-sfe-inspector","data-testid":"sfe-inspector"},qi={key:0,class:"sg-sfe-inspector-empty","data-testid":"sfe-inspector-empty"},Xi={class:"sg-sfe-inspector-row","data-testid":"sfe-inspector-row"},Gi={class:"sg-sfe-inspector-row-control"},Ji=["value"],Zi={class:"sg-sfe-inspector-row","data-testid":"sfe-inspector-row"},Qi={class:"sg-sfe-inspector-row-control"},ec=["value"],tc={class:"sg-sfe-inspector-row","data-testid":"sfe-inspector-row"},lc={class:"sg-sfe-inspector-row-control"},ac=["value"],nc={class:"sg-sfe-inspector-row","data-testid":"sfe-inspector-row"},oc={class:"sg-sfe-inspector-row-control"},sc={class:"sg-sfe-inspector-checkbox"},rc=["checked"],ic={class:"sg-sfe-inspector-row","data-testid":"sfe-inspector-row"},cc={class:"sg-sfe-inspector-row-control"},uc=["value"],dc={class:"sg-sfe-inspector-row","data-testid":"sfe-inspector-row"},mc={class:"sg-sfe-inspector-row-control"},pc=["value"],vc={class:"sg-sfe-inspector-row","data-testid":"sfe-inspector-row"},gc={class:"sg-sfe-inspector-row-control"},fc=["value"],hc={key:0,class:"sg-sfe-inspector-row","data-testid":"sfe-inspector-row"},yc={class:"sg-sfe-inspector-row-label"},kc={class:"sg-sfe-inspector-row-control"},bc=["value"],Bc={key:1,class:"sg-sfe-inspector-row","data-testid":"sfe-inspector-row"},Cc={class:"sg-sfe-inspector-row-label"},wc={class:"sg-sfe-inspector-row-control"},Sc=["value"],Ec={key:2,class:"sg-sfe-inspector-row","data-testid":"sfe-inspector-row"},xc={class:"sg-sfe-inspector-row-control"},$c=["value"],Nc={key:3,class:"sg-sfe-inspector-options","data-testid":"sfe-inspector-options"},Vc=["value","placeholder","onInput"],Dc=["value","placeholder","onInput"],zc=["aria-label","onClick"],ia=e.defineComponent({__name:"SchemaFormEditorInspector",props:{store:{}},setup(t){const n=t,l=["select","radio","multiselect"],a=["number","slider","rate"],o=["string","textarea","password","email","url"],s=e.computed(()=>{const x=n.store.state.value.selectedId;return x?n.store.state.value.schema.fields.find(y=>y.id===x)??null:null}),v=e.computed(()=>s.value&&l.includes(s.value.type)),c=e.computed(()=>s.value&&a.includes(s.value.type)),r=e.computed(()=>s.value&&o.includes(s.value.type)),i=e.computed(()=>s.value&&(s.value.type==="boolean"||s.value.type==="switch")),d=Ce(),u=e.computed(()=>{var x,y;return((y=(x=d.value.locale)==null?void 0:x.schemaFormEditor)==null?void 0:y.removeOption)??"Remove option"}),p=e.computed(()=>{var x,y;return((y=(x=d.value.locale)==null?void 0:x.schemaFormEditor)==null?void 0:y.optionLabelPlaceholder)??"Label"}),m=e.computed(()=>{var x,y;return((y=(x=d.value.locale)==null?void 0:x.schemaFormEditor)==null?void 0:y.optionValuePlaceholder)??"Value"});function k(x){s.value&&n.store.updateField(s.value.id,x)}function f(){return!s.value||s.value.defaultValue===void 0?"":String(s.value.defaultValue)}function w(x){if(x==="")return k({defaultValue:void 0});if(i.value)return k({defaultValue:x==="true"});if(c.value){const y=Number(x);return k({defaultValue:Number.isFinite(y)?y:x})}k({defaultValue:x})}function B(x,y){if(!s.value)return;const P=(s.value.options??[]).map(S=>({...S}));P[x]={...P[x],...y},k({options:P})}function E(x){if(!s.value)return;const y=(s.value.options??[]).slice();y.splice(x,1),k({options:y})}function N(){if(!s.value)return;const x=s.value.options??[],y={value:`option${x.length+1}`,label:`Option ${x.length+1}`};k({options:[...x,y]})}return(x,y)=>(e.openBlock(),e.createElementBlock("div",Ui,[s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[y[19]||(y[19]=e.createElementVNode("div",{class:"sg-sfe-inspector-title"},"Field properties",-1)),e.createElementVNode("div",Xi,[y[9]||(y[9]=e.createElementVNode("label",{class:"sg-sfe-inspector-row-label"},"Name",-1)),e.createElementVNode("div",Gi,[e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-name",value:s.value.name,onInput:y[0]||(y[0]=P=>k({name:P.target.value}))},null,40,Ji)])]),e.createElementVNode("div",Zi,[y[10]||(y[10]=e.createElementVNode("label",{class:"sg-sfe-inspector-row-label"},"Label",-1)),e.createElementVNode("div",Qi,[e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-label",value:s.value.label,onInput:y[1]||(y[1]=P=>k({label:P.target.value}))},null,40,ec)])]),e.createElementVNode("div",tc,[y[11]||(y[11]=e.createElementVNode("label",{class:"sg-sfe-inspector-row-label"},"Type",-1)),e.createElementVNode("div",lc,[e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-type",value:s.value.type,readonly:"","aria-readonly":"true"},null,8,ac)])]),e.createElementVNode("div",nc,[y[13]||(y[13]=e.createElementVNode("label",{class:"sg-sfe-inspector-row-label"},"Required",-1)),e.createElementVNode("div",oc,[e.createElementVNode("label",sc,[e.createElementVNode("input",{type:"checkbox","data-testid":"sfe-inspector-required",checked:!!s.value.required,onChange:y[2]||(y[2]=P=>k({required:P.target.checked}))},null,40,rc),y[12]||(y[12]=e.createElementVNode("span",null,"Make this field required",-1))])])]),e.createElementVNode("div",ic,[y[14]||(y[14]=e.createElementVNode("label",{class:"sg-sfe-inspector-row-label"},"Placeholder",-1)),e.createElementVNode("div",cc,[e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-placeholder",value:s.value.placeholder??"",onInput:y[3]||(y[3]=P=>{const S=P.target.value;k({placeholder:S||void 0})})},null,40,uc)])]),e.createElementVNode("div",dc,[y[15]||(y[15]=e.createElementVNode("label",{class:"sg-sfe-inspector-row-label"},"Help text",-1)),e.createElementVNode("div",mc,[e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-help",value:s.value.helpText??"",onInput:y[4]||(y[4]=P=>{const S=P.target.value;k({helpText:S||void 0})})},null,40,pc)])]),e.createElementVNode("div",vc,[y[16]||(y[16]=e.createElementVNode("label",{class:"sg-sfe-inspector-row-label"},"Default",-1)),e.createElementVNode("div",gc,[e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-default",value:f(),onInput:y[5]||(y[5]=P=>w(P.target.value))},null,40,fc)])]),r.value||c.value?(e.openBlock(),e.createElementBlock("div",hc,[e.createElementVNode("label",yc,e.toDisplayString(r.value?"Min length":"Min"),1),e.createElementVNode("div",kc,[e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-min",type:"number",value:s.value.min??"",onInput:y[6]||(y[6]=P=>{const S=P.target.value;k({min:S===""?void 0:Number(S)})})},null,40,bc)])])):e.createCommentVNode("",!0),r.value||c.value?(e.openBlock(),e.createElementBlock("div",Bc,[e.createElementVNode("label",Cc,e.toDisplayString(r.value?"Max length":"Max"),1),e.createElementVNode("div",wc,[e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-max",type:"number",value:s.value.max??"",onInput:y[7]||(y[7]=P=>{const S=P.target.value;k({max:S===""?void 0:Number(S)})})},null,40,Sc)])])):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",Ec,[y[17]||(y[17]=e.createElementVNode("label",{class:"sg-sfe-inspector-row-label"},"Pattern (RegExp)",-1)),e.createElementVNode("div",xc,[e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-pattern",value:s.value.pattern??"",placeholder:"^[A-Z].*",onInput:y[8]||(y[8]=P=>{const S=P.target.value;k({pattern:S||void 0})})},null,40,$c)])])):e.createCommentVNode("",!0),v.value?(e.openBlock(),e.createElementBlock("div",Nc,[y[18]||(y[18]=e.createElementVNode("div",{class:"sg-sfe-inspector-row-label"},"Options",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value.options??[],(P,S)=>(e.openBlock(),e.createElementBlock("div",{key:S,class:"sg-sfe-inspector-option"},[e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-option-label",value:P.label,placeholder:p.value,onInput:C=>B(S,{label:C.target.value})},null,40,Vc),e.createElementVNode("input",{class:"sg-sfe-inspector-input","data-testid":"sfe-inspector-option-value",value:String(P.value),placeholder:m.value,onInput:C=>B(S,{value:C.target.value})},null,40,Dc),e.createElementVNode("button",{type:"button",class:"sg-sfe-inspector-option-remove","aria-label":u.value,onClick:C=>E(S)}," × ",8,zc)]))),128)),e.createElementVNode("button",{type:"button",class:"sg-sfe-inspector-option-add","data-testid":"sfe-inspector-option-add",onClick:N}," + Add option ")])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock("div",qi," Select a field on the canvas to edit its properties. "))]))}}),Tc=["aria-label"],ca=e.defineComponent({__name:"SchemaFormEditorSchemaView",props:{store:{},mode:{default:"json"}},setup(t){const n=t,l=e.computed(()=>{const s=Ot(n.store.state.value.schema);return n.mode==="ts"?`const schema = ${JSON.stringify(s,null,2)} as const`:JSON.stringify(s,null,2)}),a=Ce(),o=e.computed(()=>{var s,v;return((v=(s=a.value.locale)==null?void 0:s.schemaFormEditor)==null?void 0:v.schemaView)??"Generated JSON Schema"});return(s,v)=>(e.openBlock(),e.createElementBlock("pre",{class:"sg-sfe-schema-view","data-testid":"sfe-schema-view","aria-label":o.value},[e.createElementVNode("code",null,e.toDisplayString(l.value),1)],8,Tc))}}),mt=100,Tt="$sfe.snapshot";function ua(t){return{title:t.title,description:t.description,fields:t.fields.map(n=>({...n,options:n.options?n.options.map(l=>({...l})):void 0}))}}function Lc(t,n,l){return{schema:t.schema,selectedId:t.selectedId,canUndo:n,canRedo:l}}function Mc(t,n){switch(n.type){case"add":{const l=t.schema.fields.slice(),a=n.index??l.length;return l.splice(Math.max(0,Math.min(a,l.length)),0,n.field),{...t,schema:{...t.schema,fields:l},selectedId:n.field.id}}case"remove":{const l=t.schema.fields.filter(a=>a.id!==n.id);return l.length===t.schema.fields.length?t:{...t,schema:{...t.schema,fields:l},selectedId:t.selectedId===n.id?null:t.selectedId}}case"update":{const l=t.schema.fields.findIndex(c=>c.id===n.id);if(l===-1)return t;const a=t.schema.fields.slice(),s={...a[l],...n.patch},v=s;for(const c of Object.keys(n.patch))n.patch[c]===void 0&&delete v[c];return a[l]=s,{...t,schema:{...t.schema,fields:a}}}case"move":{const l=t.schema.fields.findIndex(v=>v.id===n.id);if(l===-1)return t;const a=t.schema.fields.slice(),[o]=a.splice(l,1),s=Math.max(0,Math.min(n.toIndex,a.length));return a.splice(s,0,o),{...t,schema:{...t.schema,fields:a}}}case"setSchema":return{...t,schema:ua(n.schema),selectedId:null};default:return t}}function da(t={}){const n=t.core??je.createCore(),l={schema:t.initialSchema?ua(t.initialSchema):sa(),selectedId:null},a=e.ref(l),o=e.ref([]),s=e.ref([]);n.set(Tt,l.schema);const v=e.computed(()=>Lc(a.value,o.value.length>0,s.value.length>0)),c=(x,y)=>{var P;y&&(o.value=[...o.value,a.value],o.value.length>mt&&(o.value=o.value.slice(-mt)),s.value=[]),a.value=x,n.set(Tt,x.schema),(P=t.onChange)==null||P.call(t,x.schema)},r=x=>{const y=Mc(a.value,x);y!==a.value&&c(y,!0)};return{state:v,core:n,apply:r,addField:(x,y)=>r({type:"add",field:x,index:y}),removeField:x=>r({type:"remove",id:x}),updateField:(x,y)=>r({type:"update",id:x,patch:y}),moveField:(x,y)=>r({type:"move",id:x,toIndex:y}),moveFieldUp:x=>{const y=a.value.schema.fields.findIndex(P=>P.id===x);y<=0||r({type:"move",id:x,toIndex:y-1})},moveFieldDown:x=>{const y=a.value.schema.fields,P=y.findIndex(S=>S.id===x);P===-1||P>=y.length-1||r({type:"move",id:x,toIndex:P+1})},duplicateField:x=>{const y=a.value.schema.fields,P=y.findIndex(z=>z.id===x);if(P===-1)return;const S=y[P],C=y.map(z=>z.name);let b=`${S.name}_copy`,$=1;for(;C.includes(b);)$++,b=`${S.name}_copy${$}`;const T={...S,id:`dup_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,6)}`,name:b,options:S.options?S.options.map(z=>({...z})):void 0};r({type:"add",field:T,index:P+1})},setSchema:x=>r({type:"setSchema",schema:x}),setSelectedId:x=>{a.value.selectedId!==x&&c({...a.value,selectedId:x},!1)},undo:()=>{var P;if(o.value.length===0)return;const x=[...o.value],y=x.pop();o.value=x,s.value=[...s.value,a.value],s.value.length>mt&&(s.value=s.value.slice(-mt)),a.value=y,n.set(Tt,y.schema),(P=t.onChange)==null||P.call(t,y.schema)},redo:()=>{var P;if(s.value.length===0)return;const x=[...s.value],y=x.pop();s.value=x,o.value=[...o.value,a.value],o.value.length>mt&&(o.value=o.value.slice(-mt)),a.value=y,n.set(Tt,y.schema),(P=t.onChange)==null||P.call(t,y.schema)}}}const Fc={class:"sg-sfe","data-testid":"schema-form-editor"},Ac={class:"sg-sfe-toolbar","data-testid":"sfe-toolbar"},Pc=["aria-label","disabled"],Rc=["aria-label","disabled"],Ic={class:"sg-sfe-body"},Kc={class:"sg-sfe-center"},Oc={key:0,class:"sg-sfe-bottom","data-testid":"sfe-bottom"},Hc={class:"sg-sfe-tabs"},jc={key:0,class:"sg-sfe-preview-empty","data-testid":"sfe-preview-empty"},_c={key:1,class:"sg-sfe-preview","data-testid":"sfe-preview"},Yc=e.defineComponent({__name:"SchemaFormEditor",props:{initialSchema:{},store:{},paletteItems:{},emptyText:{},hideSchemaView:{type:Boolean}},emits:["change"],setup(t,{emit:n}){const l=t,a=n,o=da({initialSchema:l.initialSchema,onChange:f=>a("change",f)}),s=e.computed(()=>l.store??o),v=e.ref("preview"),c=Ce(),r=e.computed(()=>{var f,w;return((w=(f=c.value.locale)==null?void 0:f.schemaFormEditor)==null?void 0:w.undo)??"Undo"}),i=e.computed(()=>{var f,w;return((w=(f=c.value.locale)==null?void 0:f.schemaFormEditor)==null?void 0:w.redo)??"Redo"});function d(f){const w=s.value.state.value.schema.fields.map(B=>B.name);s.value.addField(hl(f,w))}function u(f){const w=f.target;if(w&&(w.tagName==="INPUT"||w.tagName==="TEXTAREA")||!(f.ctrlKey||f.metaKey))return;const E=f.key.toLowerCase();E==="z"&&!f.shiftKey?(f.preventDefault(),s.value.undo()):(E==="z"&&f.shiftKey||E==="y")&&(f.preventDefault(),s.value.redo())}e.onMounted(()=>window.addEventListener("keydown",u)),e.onBeforeUnmount(()=>window.removeEventListener("keydown",u));const p=e.computed(()=>Ot(s.value.state.value.schema)),m=e.computed(()=>s.value.state.value.schema.fields),k=e.computed(()=>m.value.map(f=>`${f.id}:${f.name}:${f.type}`).join("|"));return(f,w)=>(e.openBlock(),e.createElementBlock("div",Fc,[e.createElementVNode("div",Ac,[w[4]||(w[4]=e.createElementVNode("span",{class:"sg-sfe-toolbar-title"},"Schema Form Editor",-1)),w[5]||(w[5]=e.createElementVNode("span",{style:{flex:"1"}},null,-1)),e.createElementVNode("button",{type:"button",class:"sg-sfe-toolbar-btn","data-testid":"sfe-undo","aria-label":r.value,disabled:!s.value.state.value.canUndo,onClick:w[0]||(w[0]=B=>s.value.undo())},e.toDisplayString(r.value),9,Pc),e.createElementVNode("button",{type:"button",class:"sg-sfe-toolbar-btn","data-testid":"sfe-redo","aria-label":i.value,disabled:!s.value.state.value.canRedo,onClick:w[1]||(w[1]=B=>s.value.redo())},e.toDisplayString(i.value),9,Rc)]),e.createElementVNode("div",Ic,[e.createVNode(na,{items:t.paletteItems,onItemActivate:d},null,8,["items"]),e.createElementVNode("div",Kc,[e.createVNode(ra,{store:s.value,"empty-text":t.emptyText},null,8,["store","empty-text"]),t.hideSchemaView?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Oc,[e.createElementVNode("div",Hc,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["sg-sfe-tab",v.value==="preview"?"sg-sfe-tab-active":""]),"data-testid":"sfe-tab-preview",onClick:w[2]||(w[2]=B=>v.value="preview")}," Preview ",2),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["sg-sfe-tab",v.value==="schema"?"sg-sfe-tab-active":""]),"data-testid":"sfe-tab-schema",onClick:w[3]||(w[3]=B=>v.value="schema")}," Schema ",2)]),v.value==="preview"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[m.value.length===0?(e.openBlock(),e.createElementBlock("div",jc," Drop fields onto the canvas to see a live preview. ")):(e.openBlock(),e.createElementBlock("div",_c,[(e.openBlock(),e.createBlock(la,{key:k.value,schema:p.value,layout:"vertical"},{default:e.withCtx(()=>[...w[6]||(w[6]=[e.createElementVNode("span",null,null,-1)])]),_:1},8,["schema"]))]))],64)):(e.openBlock(),e.createBlock(ca,{key:1,store:s.value},null,8,["store"]))]))]),e.createVNode(ia,{store:s.value},null,8,["store"])])]))}});function ma(t,n){return a=>{var v;const o=t.safeParse(a);if(o.success)return null;const s=((v=o.error)==null?void 0:v.issues)??[];return s.length===0?(n==null?void 0:n.message)??"Validation failed":(n==null?void 0:n.pick)==="all"?s.map(c=>c.message).join("; "):(n==null?void 0:n.message)??s[0].message}}function Wc(t,n){const l={};for(const[a,o]of Object.entries(t.shape))l[a]=[ma(o,n)];return l}function Uc(t){const n={};for(const[l,a]of Object.entries(t.shape))try{const o=a.safeParse(void 0);o.success&&o.data!==void 0&&(n[l]=o.data)}catch{}return n}function qc(t){var o,s,v;const n={},l=[],a=t.shape??t.shape;if(!a)return{properties:n,required:l};for(const[c,r]of Object.entries(a)){const i={title:c};let d=r._def;switch(d.typeName==="ZodOptional"||d.typeName==="ZodNullable"?d=((o=d.innerType)==null?void 0:o._def)??d:l.push(c),d.typeName==="ZodDefault"&&(i.default=(s=d.defaultValue)==null?void 0:s.call(d),d=((v=d.innerType)==null?void 0:v._def)??d),d.typeName){case"ZodString":i.type="string";for(const u of d.checks??[])u.kind==="min"&&(i.minLength=u.value),u.kind==="max"&&(i.maxLength=u.value),u.kind==="email"&&(i.format="email"),u.kind==="url"&&(i.format="url"),u.kind==="regex"&&u.regex&&(i.pattern=u.regex.source);break;case"ZodNumber":i.type="number";for(const u of d.checks??[])u.kind==="min"&&(i.minimum=u.value),u.kind==="max"&&(i.maximum=u.value);break;case"ZodBoolean":i.type="boolean";break;case"ZodEnum":i.type="string",i.enum=d.values??[];break;case"ZodDate":i.type="string",i.format="date";break;default:i.type="string"}r.description&&(i.description=r.description),n[c]=i}return{properties:n,required:l}}const Xc=["disabled"],Gc=["disabled"],Jc=["onClick","onDblclick"],Zc={style:{marginLeft:"auto",fontSize:"10px",opacity:.6}},Qc={style:{opacity:.5}},eu=e.defineComponent({__name:"HistoryPanel",props:{history:{},style:{}},setup(t){const n=t,l=e.ref(null);function a(c){l.value=l.value===c?null:c}function o(c){return new Date(c).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function s(c){if(c===void 0)return"undefined";if(c===null)return"null";if(typeof c=="string")return`"${c}"`;try{return JSON.stringify(c)}catch{return String(c)}}const v={root:{fontFamily:'ui-monospace, "Cascadia Code", "Fira Code", monospace',fontSize:"12px",border:"1px solid var(--sg-color-border, #d9d9d9)",borderRadius:"8px",background:"var(--sg-color-bg-elevated, #fff)",overflow:"hidden"},header:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",borderBottom:"1px solid var(--sg-color-border, #d9d9d9)",fontWeight:600,fontSize:"13px"},controls:{display:"flex",gap:"4px"},btn:{padding:"2px 8px",border:"1px solid var(--sg-color-border, #d9d9d9)",borderRadius:"4px",background:"var(--sg-color-bg-secondary, #fafafa)",cursor:"pointer",fontSize:"11px"},btnDisabled:{opacity:.4,cursor:"not-allowed"},list:{maxHeight:"300px",overflowY:"auto",margin:0,padding:0,listStyle:"none"},entry:{display:"flex",alignItems:"center",gap:"8px",padding:"4px 12px",cursor:"pointer",borderBottom:"1px solid var(--sg-color-border-secondary, #f0f0f0)",transition:"background 0.15s"},entryActive:{background:"var(--sg-color-primary-bg, #e6f4ff)",fontWeight:600},entryFuture:{opacity:.5},badge:{display:"inline-block",padding:"1px 6px",borderRadius:"4px",fontSize:"10px",background:"var(--sg-color-primary-bg, #e6f4ff)",color:"var(--sg-color-primary, #1677ff)"},patches:{padding:"4px 12px 8px 32px",background:"var(--sg-color-bg-secondary, #fafafa)",fontSize:"11px",lineHeight:1.6},empty:{padding:"24px 12px",textAlign:"center",color:"var(--sg-color-text-tertiary, #999)"}};return(c,r)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle({...v.root,...n.style??{}})},[e.createElementVNode("div",{style:e.normalizeStyle(v.header)},[e.createElementVNode("span",null,"Time-Travel ("+e.toDisplayString(n.history.entries.value.length)+")",1),e.createElementVNode("div",{style:e.normalizeStyle(v.controls)},[e.createElementVNode("button",{type:"button",style:e.normalizeStyle({...v.btn,...n.history.canUndo.value?{}:v.btnDisabled}),disabled:!n.history.canUndo.value,onClick:r[0]||(r[0]=i=>n.history.undo())}," Undo ",12,Xc),e.createElementVNode("button",{type:"button",style:e.normalizeStyle({...v.btn,...n.history.canRedo.value?{}:v.btnDisabled}),disabled:!n.history.canRedo.value,onClick:r[1]||(r[1]=i=>n.history.redo())}," Redo ",12,Gc),e.createElementVNode("button",{type:"button",style:e.normalizeStyle(v.btn),onClick:r[2]||(r[2]=i=>n.history.clear())},"Clear",4)],4)],4),n.history.entries.value.length===0?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(v.empty)},"No history yet",4)):(e.openBlock(),e.createElementBlock("ul",{key:1,style:e.normalizeStyle(v.list)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.history.entries.value,(i,d)=>(e.openBlock(),e.createElementBlock("li",{key:d},[e.createElementVNode("div",{style:e.normalizeStyle({...v.entry,...d===n.history.cursor.value?v.entryActive:{},...d>n.history.cursor.value?v.entryFuture:{}}),onClick:u=>n.history.jumpTo(d),onDblclick:u=>a(d)},[e.createElementVNode("span",{style:e.normalizeStyle(v.badge)},e.toDisplayString(d),5),e.createElementVNode("span",null,e.toDisplayString(i.patches.length)+" write"+e.toDisplayString(i.patches.length!==1?"s":""),1),e.createElementVNode("span",Zc,e.toDisplayString(o(i.timestamp)),1)],44,Jc),l.value===d?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(v.patches)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.patches,(u,p)=>(e.openBlock(),e.createElementBlock("div",{key:p},[e.createElementVNode("code",null,e.toDisplayString(u.path),1),r[3]||(r[3]=e.createTextVNode(": ",-1)),e.createElementVNode("span",Qc,e.toDisplayString(s(u.oldValue)),1),r[4]||(r[4]=e.createTextVNode(" "+e.toDisplayString(" → ")+" ",-1)),e.createElementVNode("span",null,e.toDisplayString(s(u.value)),1)]))),128))],4)):e.createCommentVNode("",!0)]))),128))],4))],4))}}),tu=["type","value","placeholder","disabled","aria-invalid","aria-required"],lu=["aria-label"],au={key:0,class:"sg-input-password-strength"},nu={class:"sg-input-password-strength-bar"},ou=["type","value","placeholder","disabled"],su=e.defineComponent({__name:"InputPassword",props:{modelValue:{},value:{},defaultValue:{},placeholder:{},visibilityToggle:{type:Boolean,default:!0},showStrength:{type:Boolean,default:!1},strengthLabels:{},size:{},disabled:{type:Boolean},loading:{type:Boolean},unstyled:{type:Boolean},style:{},"aria-invalid":{type:[Boolean,String]},"aria-required":{type:[Boolean,String]}},emits:["update:modelValue","change","focus","blur"],setup(t,{emit:n}){const l=t,a=n,{resolvedSize:o,resolvedDisabled:s}=_e(l,{}),v=Ce(),c=e.computed(()=>{var N;return{showPassword:"Show password",hidePassword:"Hide password",strengthWeak:"Weak",strengthMedium:"Medium",strengthStrong:"Strong",strengthVeryStrong:"Very strong",...(N=v.value.locale)==null?void 0:N.inputPassword}}),r=e.ref(!1),i=e.ref(l.defaultValue??""),d=e.computed(()=>l.modelValue??l.value??i.value);function u(N){if(!N||N.length<4)return"weak";let x=0;return N.length>=8&&x++,N.length>=12&&x++,/[a-z]/.test(N)&&/[A-Z]/.test(N)&&x++,/\d/.test(N)&&x++,/[^a-zA-Z0-9]/.test(N)&&x++,x<=1?"weak":x<=2?"medium":x<=3?"strong":"very-strong"}const p=e.computed(()=>u(d.value)),m=e.computed(()=>({weak:c.value.strengthWeak,medium:c.value.strengthMedium,strong:c.value.strengthStrong,"very-strong":c.value.strengthVeryStrong,...l.strengthLabels}));function k(N){i.value=N,a("update:modelValue",N),a("change",N)}const f=e.computed(()=>s.value||!!l.loading),w=e.computed(()=>l.unstyled?"":["sg-input-password-wrapper",`sg-input-password-wrapper-${o.value}`,l.loading?"sg-input-wrapper-loading":""].filter(Boolean).join(" ")),B=e.computed(()=>l.unstyled?"":["sg-input","sg-input-password",`sg-input-${o.value}`].join(" ")),E=e.computed(()=>r.value?c.value.hidePassword:c.value.showPassword);return(N,x)=>t.unstyled?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(t.style)},[e.createElementVNode("input",{type:r.value?"text":"password",value:d.value,placeholder:t.placeholder,disabled:f.value,onInput:x[4]||(x[4]=y=>k(y.target.value)),onFocus:x[5]||(x[5]=y=>a("focus",y)),onBlur:x[6]||(x[6]=y=>a("blur",y))},null,40,ou),t.visibilityToggle?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",onClick:x[7]||(x[7]=y=>r.value=!r.value)},e.toDisplayString(r.value?c.value.hidePassword:c.value.showPassword),1)):e.createCommentVNode("",!0)],4)):(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(t.style)},[e.createElementVNode("span",{class:e.normalizeClass(w.value)},[e.createElementVNode("input",{type:r.value?"text":"password",class:e.normalizeClass(B.value),value:d.value,placeholder:t.placeholder,disabled:f.value,"aria-invalid":l["aria-invalid"],"aria-required":l["aria-required"],onInput:x[0]||(x[0]=y=>k(y.target.value)),onFocus:x[1]||(x[1]=y=>a("focus",y)),onBlur:x[2]||(x[2]=y=>a("blur",y))},null,42,tu),t.loading?(e.openBlock(),e.createBlock(Ct,{key:0,size:"small"})):e.createCommentVNode("",!0),t.visibilityToggle&&!t.loading?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"sg-input-password-toggle",tabindex:"-1","aria-label":E.value,onClick:x[3]||(x[3]=y=>r.value=!r.value)},e.toDisplayString(r.value?"◉":"○"),9,lu)):e.createCommentVNode("",!0)],2),t.showStrength&&d.value.length>0?(e.openBlock(),e.createElementBlock("div",au,[e.createElementVNode("div",nu,[e.createElementVNode("span",{class:e.normalizeClass(`sg-input-password-strength-fill sg-input-password-strength-${p.value}`)},null,2)]),e.createElementVNode("span",{class:e.normalizeClass(`sg-input-password-strength-label sg-input-password-strength-${p.value}`)},e.toDisplayString(m.value[p.value]),3)])):e.createCommentVNode("",!0)],4))}}),ru=["value","placeholder","disabled"],iu=["aria-label"],cu=["disabled"],uu=["value","placeholder","disabled"],du=["disabled"],mu=e.defineComponent({__name:"SearchInput",props:{modelValue:{},value:{},defaultValue:{},placeholder:{},allowClear:{type:Boolean,default:!0},enterButton:{type:[Boolean,String]},size:{},disabled:{type:Boolean},loading:{type:Boolean},unstyled:{type:Boolean},style:{}},emits:["update:modelValue","change","search","focus","blur"],setup(t,{emit:n}){const l=t,a=n,{resolvedSize:o,resolvedDisabled:s}=_e(l,{}),v=Ce(),c=e.computed(()=>{var E;return{placeholder:"Search…",clear:"Clear",search:"Search",...(E=v.value.locale)==null?void 0:E.searchInput}}),r=e.ref(l.defaultValue??""),i=e.ref(null),d=e.computed(()=>l.modelValue??l.value??r.value),u=e.computed(()=>l.placeholder??c.value.placeholder);function p(E){r.value=E,a("update:modelValue",E),a("change",E)}function m(){s.value||l.loading||a("search",d.value)}function k(){var E;p(""),a("search",""),(E=i.value)==null||E.focus()}function f(E){E.key==="Enter"&&m()}const w=e.computed(()=>l.unstyled?"":["sg-search-input",`sg-search-input-${o.value}`,l.enterButton?"sg-search-input-with-button":"",l.loading?"sg-search-input-loading":"",s.value?"sg-search-input-disabled":""].filter(Boolean).join(" ")),B=e.computed(()=>s.value||!!l.loading);return(E,N)=>t.unstyled?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(t.style)},[e.createElementVNode("input",{ref_key:"inputRef",ref:i,type:"search",value:d.value,placeholder:u.value,disabled:B.value,onInput:N[3]||(N[3]=x=>p(x.target.value)),onKeydown:f,onFocus:N[4]||(N[4]=x=>a("focus",x)),onBlur:N[5]||(N[5]=x=>a("blur",x))},null,40,uu),t.enterButton?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:B.value,onClick:m},e.toDisplayString(typeof t.enterButton=="string"?t.enterButton:c.value.search),9,du)):e.createCommentVNode("",!0)],4)):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(w.value),style:e.normalizeStyle(t.style)},[N[6]||(N[6]=e.createElementVNode("span",{class:"sg-search-input-icon"},"⌕",-1)),e.createElementVNode("input",{ref_key:"inputRef",ref:i,type:"text",class:e.normalizeClass(`sg-input sg-input-${e.unref(o)} sg-search-input-field`),value:d.value,placeholder:u.value,disabled:B.value,onInput:N[0]||(N[0]=x=>p(x.target.value)),onKeydown:f,onFocus:N[1]||(N[1]=x=>a("focus",x)),onBlur:N[2]||(N[2]=x=>a("blur",x))},null,42,ru),t.loading?(e.openBlock(),e.createBlock(Ct,{key:0,size:"small"})):e.createCommentVNode("",!0),t.allowClear&&d.value&&!t.loading?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"sg-search-input-clear",tabindex:"-1","aria-label":c.value.clear,onClick:k}," × ",8,iu)):e.createCommentVNode("",!0),t.enterButton?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"sg-search-input-btn",disabled:B.value,onClick:m},e.toDisplayString(typeof t.enterButton=="string"?t.enterButton:"⌕"),9,cu)):e.createCommentVNode("",!0)],6))}}),pu=["aria-label","onClick"],vu=["value","placeholder","disabled"],gu={key:0,class:"sg-tag-input-count"},fu=["onClick"],hu=["placeholder","disabled"],yu=e.defineComponent({__name:"TagInput",props:{modelValue:{},value:{},defaultValue:{default:()=>[]},placeholder:{},maxTags:{},allowDuplicates:{type:Boolean,default:!1},removable:{type:Boolean,default:!0},tagColor:{default:"default"},size:{},disabled:{type:Boolean},loading:{type:Boolean},unstyled:{type:Boolean},style:{}},emits:["update:modelValue","change","focus","blur"],setup(t,{emit:n}){const l=t,a=n,{resolvedSize:o,resolvedDisabled:s}=_e(l,{}),v=Ce(),c=e.computed(()=>{var S;return{placeholder:"Add tag…",removeTag:"Remove",...(S=v.value.locale)==null?void 0:S.tagInput}}),r=e.ref([...l.defaultValue]),i=e.ref(""),d=e.ref(null),u=e.computed(()=>l.modelValue??l.value??r.value),p=e.computed(()=>l.placeholder??c.value.placeholder);function m(S){r.value=S,a("update:modelValue",S),a("change",S)}function k(S){const C=S.trim();C&&(l.maxTags&&u.value.length>=l.maxTags||!l.allowDuplicates&&u.value.includes(C)||(m([...u.value,C]),i.value=""))}function f(S){m(u.value.filter((C,b)=>b!==S))}function w(S){S.key==="Enter"||S.key===","?(S.preventDefault(),k(i.value)):S.key==="Backspace"&&!i.value&&u.value.length>0&&f(u.value.length-1)}function B(S){var T;S.preventDefault();const b=(((T=S.clipboardData)==null?void 0:T.getData("text"))??"").split(/[,;\n]+/).map(z=>z.trim()).filter(Boolean),$=[...u.value];for(const z of b){if(l.maxTags&&$.length>=l.maxTags)break;!l.allowDuplicates&&$.includes(z)||$.push(z)}m($)}function E(){var S;(S=d.value)==null||S.focus()}function N(S){i.value.trim()&&k(i.value),a("blur",S)}const x=e.computed(()=>l.unstyled?"":["sg-tag-input",`sg-tag-input-${o.value}`,s.value?"sg-tag-input-disabled":""].filter(Boolean).join(" ")),y=e.computed(()=>l.tagColor!=="default"?`sg-tag-${l.tagColor}`:""),P=e.computed(()=>s.value||!!l.loading);return(S,C)=>t.unstyled?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(t.style)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(b,$)=>(e.openBlock(),e.createElementBlock("span",{key:`${b}-${$}`},[e.createTextVNode(e.toDisplayString(b)+" ",1),t.removable?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",onClick:T=>f($)},"×",8,fu)):e.createCommentVNode("",!0)]))),128)),e.withDirectives(e.createElementVNode("input",{ref_key:"inputRef",ref:d,"onUpdate:modelValue":C[2]||(C[2]=b=>i.value=b),placeholder:u.value.length===0?p.value:"",disabled:P.value,onKeydown:w,onPaste:B,onFocus:C[3]||(C[3]=b=>a("focus",b)),onBlur:N},null,40,hu),[[e.vModelText,i.value]])],4)):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(x.value),style:e.normalizeStyle(t.style),onClick:E},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(b,$)=>(e.openBlock(),e.createElementBlock("span",{key:`${b}-${$}`,class:e.normalizeClass(["sg-tag",y.value].filter(Boolean).join(" "))},[e.createTextVNode(e.toDisplayString(b)+" ",1),t.removable&&!e.unref(s)?(e.openBlock(),e.createElementBlock("span",{key:0,class:"sg-tag-close",role:"button","aria-label":`${c.value.removeTag} ${b}`,onClick:e.withModifiers(T=>f($),["stop"])},"×",8,pu)):e.createCommentVNode("",!0)],2))),128)),e.createElementVNode("input",{ref_key:"inputRef",ref:d,class:"sg-tag-input-field",value:i.value,placeholder:u.value.length===0?p.value:"",disabled:P.value,onInput:C[0]||(C[0]=b=>i.value=b.target.value),onKeydown:w,onPaste:B,onFocus:C[1]||(C[1]=b=>a("focus",b)),onBlur:N},null,40,vu),t.maxTags?(e.openBlock(),e.createElementBlock("span",gu,e.toDisplayString(u.value.length)+"/"+e.toDisplayString(t.maxTags),1)):e.createCommentVNode("",!0)],6))}}),ku=["aria-label"],bu=["type","inputmode","value","disabled","autofocus","onInput","onKeydown"],Bu=["type","inputmode","placeholder","value","disabled","autofocus","onInput","onKeydown"],Cu=e.defineComponent({__name:"PinInput",props:{length:{default:6},modelValue:{},value:{},defaultValue:{},mask:{type:Boolean,default:!1},type:{default:"numeric"},placeholder:{default:"○"},autoFocus:{type:Boolean,default:!1},size:{},disabled:{type:Boolean},loading:{type:Boolean},unstyled:{type:Boolean},style:{},"aria-label":{}},emits:["update:modelValue","change","complete"],setup(t,{emit:n}){const l=t,a=n,{resolvedSize:o,resolvedDisabled:s}=_e(l,{}),v=Ce(),c=e.computed(()=>{var T;return{ariaLabel:"PIN input",...(T=v.value.locale)==null?void 0:T.pinInput}}),r=e.computed(()=>l.length);function i(T){const K=T.replace(/\s/g,"").slice(0,r.value).split("");for(;K.length<r.value;)K.push(" ");return K.join("")}function d(T){const z=T.split("");for(;z.length<r.value;)z.push(" ");return z.slice(0,r.value)}const u=e.computed(()=>l.modelValue!==void 0||l.value!==void 0),p=e.ref(i(l.defaultValue??"")),m=e.computed(()=>u.value?i(String(l.modelValue??l.value??"")):p.value),k=e.computed(()=>l.type==="numeric"?/^\d$/:/^[a-zA-Z0-9]$/),f=[];function w(T,z){f[z]=T??null}function B(T){var z;T>=0&&T<r.value&&((z=f[T])==null||z.focus())}function E(T){const z=d(T).join("");u.value||(p.value=z);const K=z.replace(/\s/g,"");a("update:modelValue",K),a("change",K),K.length===r.value&&a("complete",K)}function N(T,z){if(!k.value.test(z))return;const K=d(m.value);K[T]=z,E(K.join("")),B(T+1)}function x(T,z){if(z.key==="Backspace"){z.preventDefault();const K=d(m.value);K[T]!==" "?(K[T]=" ",E(K.join(""))):B(T-1)}else z.key==="ArrowLeft"?B(T-1):z.key==="ArrowRight"&&B(T+1)}function y(T){var I;T.preventDefault();const z=(((I=T.clipboardData)==null?void 0:I.getData("text"))??"").slice(0,r.value),K=d(m.value);let L=0;for(const U of z)k.value.test(U)&&L<r.value&&(K[L]=U,L++);E(K.join("")),B(Math.min(L,r.value-1))}function P(T){const z=m.value[T];return z===" "||z===void 0?"":z}const S=e.computed(()=>l.unstyled?"":["sg-pin-input",`sg-pin-input-${o.value}`,s.value?"sg-pin-input-disabled":""].filter(Boolean).join(" ")),C=e.computed(()=>s.value||!!l.loading),b=e.computed(()=>l["aria-label"]??c.value.ariaLabel),$=e.computed(()=>Array.from({length:r.value},(T,z)=>z));return(T,z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(t.unstyled?"":S.value),style:e.normalizeStyle(t.style),role:"group","aria-label":b.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,K=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:K},[t.unstyled?(e.openBlock(),e.createElementBlock("input",{key:0,ref_for:!0,ref:L=>w(L,K),type:t.mask?"password":"text",inputmode:t.type==="numeric"?"numeric":"text",maxlength:"1",value:P(K),disabled:C.value,autofocus:t.autoFocus&&K===0,onInput:L=>N(K,L.target.value),onKeydown:L=>x(K,L),onPaste:y,onFocus:z[0]||(z[0]=L=>L.target.select())},null,40,bu)):(e.openBlock(),e.createElementBlock("input",{key:1,ref_for:!0,ref:L=>w(L,K),class:e.normalizeClass(["sg-pin-input-cell",`sg-pin-input-cell-${e.unref(o)}`,P(K)?"sg-pin-input-cell-filled":""].filter(Boolean).join(" ")),type:t.mask?"password":"text",inputmode:t.type==="numeric"?"numeric":"text",maxlength:"1",placeholder:t.placeholder,value:P(K),disabled:C.value,autofocus:t.autoFocus&&K===0,onInput:L=>N(K,L.target.value),onKeydown:L=>x(K,L),onPaste:y,onFocus:z[1]||(z[1]=L=>L.target.select())},null,42,Bu))],64))),128))],14,ku))}}),wu=["tabindex"],Su={key:0,class:"sg-inline-edit-pencil"},Eu=["value"],xu=["value"],$u={key:0,class:"sg-inline-edit-actions"},Nu=["aria-label"],Vu=["aria-label"],Du=e.defineComponent({__name:"InlineEdit",props:{modelValue:{},value:{},defaultValue:{default:""},placeholder:{default:""},showButtons:{type:Boolean,default:!0},saveOnBlur:{type:Boolean,default:!0},saveOnEnter:{type:Boolean,default:!0},size:{},disabled:{type:Boolean},loading:{type:Boolean},unstyled:{type:Boolean},style:{}},emits:["update:modelValue","save","cancel"],setup(t,{emit:n}){const l=t,a=n,{resolvedSize:o,resolvedDisabled:s}=_e(l,{}),v=Ce(),c=e.computed(()=>{var C;return{placeholder:"Click to edit…",save:"Save",cancel:"Cancel",...(C=v.value.locale)==null?void 0:C.inlineEdit}}),r=e.computed(()=>l.placeholder||c.value.placeholder),i=e.ref(!1),d=e.ref(l.defaultValue),u=e.ref(""),p=e.ref(null),m=e.useSlots(),k=e.computed(()=>!!m.view),f=e.computed(()=>l.modelValue??l.value??d.value);e.watch(i,C=>{C&&(u.value=f.value,e.nextTick(()=>{var b;return(b=p.value)==null?void 0:b.focus()}))});function w(){s.value||l.loading||(i.value=!0)}function B(){i.value=!1,d.value=u.value,a("update:modelValue",u.value),a("save",u.value)}function E(){i.value=!1,u.value=f.value,a("cancel")}function N(C){C.key==="Enter"&&l.saveOnEnter?(C.preventDefault(),B()):C.key==="Escape"&&E()}const x=e.computed(()=>["sg-inline-edit-view",`sg-inline-edit-view-${o.value}`,f.value?"":"sg-inline-edit-view-placeholder",s.value?"sg-inline-edit-view-disabled":""].filter(Boolean).join(" "));function y(C){(C.key==="Enter"||C.key===" ")&&w()}function P(){l.saveOnBlur&&B()}function S(){l.saveOnBlur&&!l.showButtons&&B()}return(C,b)=>i.value?t.unstyled?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(t.style)},[e.createElementVNode("input",{ref_key:"inputRef",ref:p,value:u.value,onInput:b[0]||(b[0]=$=>u.value=$.target.value),onKeydown:N,onBlur:P},null,40,Eu),t.showButtons?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("button",{type:"button",onClick:B},"✓"),e.createElementVNode("button",{type:"button",onClick:E},"✕")],64)):e.createCommentVNode("",!0)],4)):(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["sg-inline-edit",`sg-inline-edit-${e.unref(o)}`].filter(Boolean).join(" ")),style:e.normalizeStyle(t.style)},[e.createElementVNode("input",{ref_key:"inputRef",ref:p,class:e.normalizeClass(`sg-input sg-input-${e.unref(o)} sg-inline-edit-input`),value:u.value,onInput:b[1]||(b[1]=$=>u.value=$.target.value),onKeydown:N,onBlur:S},null,42,xu),t.showButtons?(e.openBlock(),e.createElementBlock("span",$u,[e.createElementVNode("button",{type:"button",class:"sg-inline-edit-btn sg-inline-edit-btn-save","aria-label":c.value.save,onClick:B}," ✓ ",8,Nu),e.createElementVNode("button",{type:"button",class:"sg-inline-edit-btn sg-inline-edit-btn-cancel","aria-label":c.value.cancel,onClick:E}," ✕ ",8,Vu)])):e.createCommentVNode("",!0)],6)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[k.value?e.renderSlot(C.$slots,"view",{key:0,value:f.value,startEditing:w}):t.unstyled?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle({...t.style,cursor:e.unref(s)?"default":"pointer"}),onClick:w},e.toDisplayString(f.value||r.value),5)):(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(x.value),style:e.normalizeStyle(t.style),role:"button",tabindex:e.unref(s)?-1:0,onClick:w,onKeydown:y},[e.createTextVNode(e.toDisplayString(f.value||r.value)+" ",1),e.unref(s)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Su,"✎"))],46,wu))],64))}}),zu={key:0,class:"sg-input-group-addon"},Tu={key:1,class:"sg-input-group-addon"},Lu=e.defineComponent({__name:"InputGroup",props:{compact:{type:Boolean,default:!0},size:{},unstyled:{type:Boolean},style:{}},setup(t){const n=t,{resolvedSize:l}=_e(n,{}),a=e.useSlots(),o=e.computed(()=>!!a.before),s=e.computed(()=>!!a.after),v=e.computed(()=>n.unstyled?"":["sg-input-group",`sg-input-group-${l.value}`,n.compact?"sg-input-group-compact":""].filter(Boolean).join(" "));return(c,r)=>t.unstyled?(e.openBlock(),e.createElementBlock("span",{key:1,style:e.normalizeStyle(t.style)},[e.renderSlot(c.$slots,"before"),e.renderSlot(c.$slots,"default"),e.renderSlot(c.$slots,"after")],4)):(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(v.value),style:e.normalizeStyle(t.style)},[o.value?(e.openBlock(),e.createElementBlock("span",zu,[e.renderSlot(c.$slots,"before")])):e.createCommentVNode("",!0),e.renderSlot(c.$slots,"default"),s.value?(e.openBlock(),e.createElementBlock("span",Tu,[e.renderSlot(c.$slots,"after")])):e.createCommentVNode("",!0)],6))}}),Mu=["disabled"],Fu=["aria-valuemin","aria-valuemax","aria-valuenow","value","placeholder","disabled"],Au=["disabled"],Pu={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},Ru=e.defineComponent({__name:"InputNumber",props:{modelValue:{},value:{},defaultValue:{},min:{},max:{},step:{default:1},precision:{},placeholder:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"middle"},unstyled:{type:Boolean}},emits:["update:modelValue","change","blur"],setup(t,{emit:n}){const l=t,a=n,o=l.modelValue??l.value??l.defaultValue??null,s=e.ref(o);e.watch(()=>l.modelValue??l.value,f=>{f!==void 0&&(s.value=f)});const v=e.computed(()=>l.modelValue??l.value??s.value),c=e.computed(()=>l.unstyled?"":["sg-input-number",`sg-input-number-${l.size}`,l.loading?"sg-input-number-loading":""].filter(Boolean).join(" "));function r(f){let w=f;return l.min!==void 0&&w<l.min&&(w=l.min),l.max!==void 0&&w>l.max&&(w=l.max),l.precision!==void 0&&(w=Number(w.toFixed(l.precision))),w}function i(f){const w=f!==null?r(f):null;s.value=w,a("update:modelValue",w),a("change",w)}function d(f){const w=f.target.value;if(w===""||w==="-"){s.value=null,a("update:modelValue",null),a("change",null);return}const B=Number(w);isNaN(B)||i(B)}function u(){l.disabled||l.loading||i((v.value??0)+l.step)}function p(){l.disabled||l.loading||i((v.value??0)-l.step)}const m=e.computed(()=>l.min!==void 0&&(v.value??0)<=l.min),k=e.computed(()=>l.max!==void 0&&(v.value??0)>=l.max);return(f,w)=>(e.openBlock(),e.createElementBlock("span",{class:e.normalizeClass(c.value)},[e.createElementVNode("button",{class:e.normalizeClass(t.unstyled?"":"sg-input-number-btn sg-input-number-minus"),disabled:t.disabled||t.loading||m.value,tabindex:"-1",onClick:p}," − ",10,Mu),e.createElementVNode("input",{type:"text",inputmode:"numeric",role:"spinbutton","aria-valuemin":t.min,"aria-valuemax":t.max,"aria-valuenow":v.value??void 0,class:e.normalizeClass(t.unstyled?"":"sg-input-number-input"),value:v.value??"",placeholder:t.placeholder,disabled:t.disabled||t.loading,onInput:d,onBlur:w[0]||(w[0]=B=>a("blur"))},null,42,Fu),e.createElementVNode("button",{class:e.normalizeClass(t.unstyled?"":"sg-input-number-btn sg-input-number-plus"),disabled:t.disabled||t.loading||k.value,tabindex:"-1",onClick:u}," + ",10,Au),t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",Pu)):e.createCommentVNode("",!0)],2))}}),Iu=["id","value","placeholder","rows","disabled","aria-disabled","aria-invalid","aria-describedby","aria-required"],Ku={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},Ou={key:1,class:"sg-textarea-count"},Hu=e.defineComponent({__name:"Textarea",props:{modelValue:{},value:{},defaultValue:{},placeholder:{},rows:{default:4},maxLength:{},showCount:{type:Boolean},id:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"middle"},unstyled:{type:Boolean},ariaInvalid:{type:[Boolean,String]},ariaDescribedby:{},ariaRequired:{type:[Boolean,String]}},emits:["update:modelValue","change","blur","focus"],setup(t,{emit:n}){const l=t,a=n,o=e.ref(l.modelValue??l.value??l.defaultValue??"");e.watch(()=>l.modelValue??l.value,r=>{r!==void 0&&(o.value=r)});const s=e.computed(()=>l.modelValue??l.value??o.value),v=e.computed(()=>l.unstyled?"":["sg-textarea-wrapper",`sg-textarea-${l.size}`,l.loading?"sg-textarea-wrapper-loading":""].filter(Boolean).join(" "));function c(r){let d=r.target.value;l.maxLength&&d.length>l.maxLength&&(d=d.slice(0,l.maxLength)),o.value=d,a("update:modelValue",d),a("change",d)}return(r,i)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(v.value)},[e.createElementVNode("textarea",{id:t.id,class:e.normalizeClass(t.unstyled?"":"sg-input sg-textarea"),value:s.value,placeholder:t.placeholder,rows:t.rows,disabled:t.disabled||t.loading,"aria-disabled":t.disabled||t.loading,"aria-invalid":t.ariaInvalid,"aria-describedby":t.ariaDescribedby,"aria-required":t.ariaRequired,onInput:c,onBlur:i[0]||(i[0]=d=>a("blur")),onFocus:i[1]||(i[1]=d=>a("focus"))},null,42,Iu),t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",Ku)):e.createCommentVNode("",!0),t.showCount&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",Ou,e.toDisplayString(s.value.length)+e.toDisplayString(t.maxLength?` / ${t.maxLength}`:""),1)):e.createCommentVNode("",!0)],2))}}),ju=["multiple","value","disabled","aria-label","aria-labelledby"],_u={key:0,value:""},Yu=["value","disabled"],Wu=["aria-expanded","aria-controls","aria-multiselectable","aria-disabled","aria-label","aria-labelledby","tabindex"],Uu={key:0,class:"sg-select-placeholder"},qu={key:1,class:"sg-select-tags"},Xu={class:"sg-select-tag-label"},Gu=["aria-label","onClick"],Ju={key:2,class:"sg-spin sg-spin-small","aria-hidden":"true"},Zu={key:3,class:"sg-select-arrow"},Qu=["id","aria-multiselectable"],ed=["aria-selected","onClick"],td={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},ld=e.defineComponent({__name:"Select",props:{modelValue:{},value:{},defaultValue:{},options:{},placeholder:{default:"Select..."},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"middle"},unstyled:{type:Boolean},ariaLabel:{},ariaLabelledby:{}},emits:["update:modelValue","change","blur"],setup(t,{emit:n}){let l=0;function a(){return`sg-select-${++l}`}const o=t,s=a(),v=e.ref(-1),c=n,r=e.ref(!1),i=e.ref(null);function d(){return o.modelValue!==void 0?o.modelValue:o.value!==void 0?o.value:o.defaultValue!==void 0?o.defaultValue:o.multiple?[]:""}const u=e.ref(d());e.watch(()=>o.modelValue??o.value,$=>{$!==void 0&&(u.value=$)});const p=e.computed(()=>o.modelValue??o.value??u.value),m=e.computed(()=>o.multiple?void 0:p.value),k=e.computed(()=>o.multiple?p.value??[]:[]),f=e.computed(()=>o.multiple?void 0:o.options.find($=>$.value===m.value)),w=e.computed(()=>o.multiple?o.options.filter($=>k.value.includes($.value)):[]);function B($){u.value=$,c("update:modelValue",$),c("change",$)}function E($){if(!($.disabled||$.loading))if(o.multiple){const z=k.value.includes($.value)?k.value.filter(K=>K!==$.value):[...k.value,$.value];B(z)}else B($.value),r.value=!1}function N($,T){T.stopPropagation(),!(o.disabled||o.loading)&&B(k.value.filter(z=>z!==$))}const x=e.computed(()=>o.disabled||o.loading);function y($){return o.multiple?k.value.includes($.value):$.value===m.value}function P($){i.value&&!i.value.contains($.target)&&(r.value=!1)}e.onMounted(()=>document.addEventListener("mousedown",P)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",P)),e.watch(r,$=>{$||(v.value=-1)});function S($){if(!x.value)switch($.key){case"Enter":case" ":$.preventDefault(),r.value&&v.value>=0?E(o.options[v.value]):r.value=!r.value;break;case"Escape":$.preventDefault(),r.value=!1;break;case"ArrowDown":$.preventDefault(),r.value?o.options.length>0&&(v.value=(v.value+1)%o.options.length):r.value=!0;break;case"ArrowUp":$.preventDefault(),r.value?o.options.length>0&&(v.value=(v.value-1+o.options.length)%o.options.length):r.value=!0;break;case"Backspace":o.multiple&&k.value.length>0&&B(k.value.slice(0,-1));break}}const C=e.computed(()=>["sg-select",`sg-select-${o.size}`,o.multiple?"sg-select-multiple":"",r.value?"sg-select-open":"",x.value?"sg-select-disabled":"",o.loading?"sg-select-loading":""].filter(Boolean).join(" "));function b($){const T=$.target;if(o.multiple){const z=Array.from(T.selectedOptions).map(K=>{const L=K.value,I=Number(L);return o.options.some(U=>U.value===I)?I:L});B(z)}else{const z=T.value,K=Number(z),L=o.options.some(I=>I.value===K)?K:z;B(L)}}return($,T)=>{var z;return t.unstyled?(e.openBlock(),e.createElementBlock("select",{key:0,multiple:t.multiple,value:t.multiple?k.value:m.value,disabled:x.value,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,onChange:b,onBlur:T[0]||(T[0]=K=>c("blur"))},[!t.multiple&&!f.value?(e.openBlock(),e.createElementBlock("option",_u,e.toDisplayString(t.placeholder),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,K=>(e.openBlock(),e.createElementBlock("option",{key:K.value,value:K.value,disabled:K.disabled},e.toDisplayString(K.label),9,Yu))),128))],40,ju)):(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"wrapperRef",ref:i,class:e.normalizeClass(C.value),onBlur:T[2]||(T[2]=K=>c("blur"))},[e.createElementVNode("div",{class:"sg-select-selector",role:"combobox","aria-expanded":r.value,"aria-haspopup":"listbox","aria-controls":e.unref(s),"aria-multiselectable":t.multiple||void 0,"aria-disabled":x.value||void 0,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,tabindex:x.value?-1:0,onClick:T[1]||(T[1]=K=>!x.value&&(r.value=!r.value)),onKeydown:S},[t.multiple?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[w.value.length===0?(e.openBlock(),e.createElementBlock("span",Uu,e.toDisplayString(t.placeholder),1)):(e.openBlock(),e.createElementBlock("span",qu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,K=>(e.openBlock(),e.createElementBlock("span",{key:K.value,class:"sg-select-tag"},[e.createElementVNode("span",Xu,e.toDisplayString(K.label),1),e.createElementVNode("button",{type:"button",class:"sg-select-tag-remove","aria-label":`Remove ${K.label}`,tabindex:"-1",onClick:L=>N(K.value,L)}," × ",8,Gu)]))),128))]))],64)):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(f.value?"sg-select-selection-item":"sg-select-placeholder")},e.toDisplayString(((z=f.value)==null?void 0:z.label)??t.placeholder),3)),t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",Ju)):(e.openBlock(),e.createElementBlock("span",Zu,e.toDisplayString(r.value?"▲":"▼"),1))],40,Wu),r.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:e.unref(s),class:"sg-select-dropdown",role:"listbox","aria-multiselectable":t.multiple||void 0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,(K,L)=>(e.openBlock(),e.createElementBlock("div",{key:K.value,role:"option","aria-selected":y(K),class:e.normalizeClass(["sg-select-option",y(K)?"sg-select-option-selected":"",L===v.value?"sg-select-option-focused":"",K.disabled||K.loading?"sg-select-option-disabled":"",K.loading?"sg-select-option-loading":""]),onClick:I=>E(K)},[e.createElementVNode("span",null,e.toDisplayString(K.label),1),K.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",td)):e.createCommentVNode("",!0)],10,ed))),128))],8,Qu)):e.createCommentVNode("",!0)],34))}}}),ad=["aria-checked","checked","disabled","onChange"],nd={key:0,class:"sg-radio-box","aria-hidden":"true"},od={key:1,class:"sg-spin sg-spin-small","aria-hidden":"true"},sd=e.defineComponent({__name:"Radio",props:{modelValue:{default:void 0},value:{default:void 0},defaultValue:{default:void 0},options:{},direction:{default:"horizontal"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},unstyled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){const l=t,a=n,o=e.ref(l.modelValue??l.value??l.defaultValue);e.watch(()=>l.modelValue??l.value,d=>{d!==void 0&&(o.value=d)});const s=e.computed(()=>l.modelValue??l.value??o.value);function v(d){d.disabled||l.disabled||l.loading||(o.value=d.value,a("update:modelValue",d.value),a("change",d.value))}const c=e.computed(()=>l.unstyled?"":["sg-radio-group",`sg-radio-group-${l.direction}`,l.loading?"sg-radio-group-loading":""].filter(Boolean).join(" ")),r=e.ref(null);function i(){const d=r.value;if(!d)return;d.querySelectorAll('input[type="radio"]').forEach((p,m)=>{const k=l.options[m];if(!k)return;const f=s.value===k.value;p.checked!==f&&(p.checked=f)})}return e.watch([()=>s.value,()=>l.options],()=>i(),{flush:"post"}),e.onMounted(i),(d,u)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:r,class:e.normalizeClass(c.value),role:"radiogroup"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,p=>(e.openBlock(),e.createElementBlock("label",{key:p.value,class:e.normalizeClass(t.unstyled?"":["sg-radio",s.value===p.value?"sg-radio-checked":"",p.disabled||t.disabled||t.loading?"sg-radio-disabled":""].filter(Boolean).join(" "))},[e.createElementVNode("input",{type:"radio",role:"radio",class:e.normalizeClass(t.unstyled?"":"sg-radio-input"),"aria-checked":s.value===p.value,checked:s.value===p.value,disabled:p.disabled||t.disabled||t.loading,onChange:m=>v(p)},null,42,ad),t.unstyled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",nd)),e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?"":"sg-radio-label")},e.toDisplayString(p.label),3),t.loading&&s.value===p.value&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",od)):e.createCommentVNode("",!0)],2))),128))],2))}}),rd=["aria-checked","disabled"],id={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},cd={class:"sg-switch-inner"},ud={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},dd=e.defineComponent({__name:"Switch",props:{modelValue:{type:Boolean,default:void 0},checked:{type:Boolean,default:void 0},defaultChecked:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"middle"},unstyled:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:n}){const l=t,a=n,o=e.ref(l.modelValue??l.checked??l.defaultChecked??!1);e.watch(()=>l.modelValue??l.checked,i=>{i!==void 0&&(o.value=i)});const s=e.computed(()=>l.modelValue??l.checked??o.value);function v(){if(l.disabled||l.loading)return;const i=!s.value;o.value=i,a("update:modelValue",i),a("change",i)}const c=e.computed(()=>l.size==="small"?"small":"default"),r=e.computed(()=>["sg-switch",`sg-switch-${c.value}`,s.value?"sg-switch-checked":"",l.disabled||l.loading?"sg-switch-disabled":"",l.loading?"sg-switch-loading":""].filter(Boolean).join(" "));return(i,d)=>(e.openBlock(),e.createElementBlock("button",{role:"switch","aria-checked":s.value,disabled:t.disabled||t.loading,class:e.normalizeClass(t.unstyled?"":r.value),type:"button",onClick:v},[t.unstyled?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.loading?(e.openBlock(),e.createElementBlock("span",id)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?e.renderSlot(i.$slots,"checkedChildren",{key:0}):e.renderSlot(i.$slots,"unCheckedChildren",{key:1})],64))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",cd,[t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",ud)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?e.renderSlot(i.$slots,"checkedChildren",{key:0}):e.renderSlot(i.$slots,"unCheckedChildren",{key:1})],64))]),d[0]||(d[0]=e.createElementVNode("span",{class:"sg-switch-handle"},null,-1))],64))],10,rd))}}),md=["aria-valuemin","aria-valuemax","aria-valuenow","aria-disabled","tabindex"],pd=e.defineComponent({__name:"Slider",props:{modelValue:{},value:{},defaultValue:{default:0},min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},unstyled:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:n}){const l=t,a=n,o=e.ref(l.modelValue??l.value??l.defaultValue??0);e.watch(()=>l.modelValue??l.value,m=>{m!==void 0&&(o.value=m)});const s=e.computed(()=>l.modelValue??l.value??o.value),v=e.ref(null),c=e.computed(()=>(s.value-l.min)/(l.max-l.min)*100);function r(m){o.value=m,a("update:modelValue",m),a("change",m)}function i(m){if(!v.value||l.disabled)return;const k=v.value.getBoundingClientRect(),f=Math.max(0,Math.min(1,(m-k.left)/k.width)),w=l.min+f*(l.max-l.min),B=Math.round(w/l.step)*l.step;r(Math.max(l.min,Math.min(l.max,B)))}function d(m){if(l.disabled)return;i(m.clientX);const k=w=>i(w.clientX),f=()=>{document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",f)};document.addEventListener("mousemove",k),document.addEventListener("mouseup",f)}function u(m){l.disabled||(m.key==="ArrowRight"||m.key==="ArrowUp"?(m.preventDefault(),r(Math.min(l.max,s.value+l.step))):(m.key==="ArrowLeft"||m.key==="ArrowDown")&&(m.preventDefault(),r(Math.max(l.min,s.value-l.step))))}const p=e.computed(()=>l.unstyled?"":["sg-slider",l.disabled?"sg-slider-disabled":""].filter(Boolean).join(" "));return(m,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(p.value)},[e.createElementVNode("div",{ref_key:"trackRef",ref:v,class:e.normalizeClass(t.unstyled?"":"sg-slider-track"),onMousedown:d},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-slider-fill"),style:e.normalizeStyle({width:`${c.value}%`})},null,6),e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-slider-handle"),style:e.normalizeStyle({left:`${c.value}%`}),role:"slider","aria-valuemin":t.min,"aria-valuemax":t.max,"aria-valuenow":s.value,"aria-disabled":t.disabled,tabindex:t.disabled?-1:0,onKeydown:u},null,46,md)],34)],2))}}),vd=["aria-label"],gd=["aria-checked","aria-label","tabindex","onClick","onMousemove","onKeydown"],fd=e.defineComponent({__name:"Rate",props:{modelValue:{},value:{},defaultValue:{default:0},count:{default:5},allowHalf:{type:Boolean,default:!1},character:{default:"★"},disabled:{type:Boolean,default:!1},unstyled:{type:Boolean}},emits:["update:modelValue","change"],setup(t,{emit:n}){const l=t,a=n,o=Ce(),s=e.computed(()=>{var E;return(E=o.value.locale)==null?void 0:E.rate}),v=e.computed(()=>{var E;return((E=s.value)==null?void 0:E.ariaLabel)??"Rating"}),c=E=>{var x;const N=(x=s.value)==null?void 0:x.star;return typeof N=="function"?N(E):`${E} star${E>1?"s":""}`},r=e.ref(l.modelValue??l.value??l.defaultValue),i=e.ref(null);e.watch(()=>l.modelValue??l.value,E=>{E!==void 0&&(r.value=E)});const d=e.computed(()=>l.modelValue??l.value??r.value),u=e.computed(()=>i.value??d.value);function p(E){r.value=E,a("update:modelValue",E),a("change",E)}function m(E,N){if(l.disabled)return;if(!l.allowHalf){p(d.value===E?0:E);return}const y=N.currentTarget.getBoundingClientRect(),S=N.clientX-y.left<y.width/2?E-.5:E;p(d.value===S?0:S)}function k(E,N){if(l.disabled)return;if(!l.allowHalf){i.value=E;return}const y=N.currentTarget.getBoundingClientRect(),P=N.clientX-y.left<y.width/2;i.value=P?E-.5:E}function f(E,N){l.disabled||(N.key==="ArrowRight"||N.key==="ArrowUp"?(N.preventDefault(),p(Math.min(l.count,l.allowHalf?d.value+.5:d.value+1))):(N.key==="ArrowLeft"||N.key==="ArrowDown")&&(N.preventDefault(),p(Math.max(0,l.allowHalf?d.value-.5:d.value-1))))}const w=e.computed(()=>l.unstyled?"":["sg-rate",l.disabled?"sg-rate-disabled":""].filter(Boolean).join(" "));function B(E){const N=u.value>=E,x=l.allowHalf&&u.value>=E-.5&&u.value<E;return["sg-rate-star",N?"sg-rate-star-full":"",x?"sg-rate-star-half":""].filter(Boolean).join(" ")}return(E,N)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(w.value),role:"radiogroup","aria-label":v.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.count,x=>(e.openBlock(),e.createElementBlock("span",{key:x,class:e.normalizeClass(t.unstyled?"":B(x)),role:"radio","aria-checked":u.value>=x,"aria-label":c(x),tabindex:t.disabled?-1:0,onClick:y=>m(x,y),onMousemove:y=>k(x,y),onMouseleave:N[0]||(N[0]=y=>!t.disabled&&(i.value=null)),onKeydown:y=>f(x,y)},[e.renderSlot(E.$slots,"character",{index:x,value:u.value},()=>[e.renderSlot(E.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.character),1)])])],42,gd))),128))],10,vd))}}),hd=["aria-expanded","value","placeholder","disabled"],yd={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},kd=["onMousedown"],bd=e.defineComponent({__name:"AutoComplete",props:{modelValue:{},value:{},defaultValue:{},options:{},placeholder:{},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"middle"},unstyled:{type:Boolean}},emits:["update:modelValue","change","search","select","blur"],setup(t,{emit:n}){const l=t,a=e.computed(()=>l.disabled||l.loading),o=n,s=e.ref(l.modelValue??l.value??l.defaultValue??"");e.watch(()=>l.modelValue??l.value,k=>{k!==void 0&&(s.value=k)});const v=e.computed(()=>l.modelValue??l.value??s.value),c=e.ref(!1),r=e.ref(null),i=e.computed(()=>l.options.filter(k=>(k.label??k.value).toLowerCase().includes((v.value??"").toLowerCase())));function d(k){const f=k.target.value;s.value=f,o("update:modelValue",f),o("change",f),o("search",f),c.value=!0}function u(k){s.value=k.value,o("update:modelValue",k.value),o("change",k.value),o("select",k.value,k),c.value=!1}function p(k){r.value&&!r.value.contains(k.target)&&(c.value=!1)}e.onMounted(()=>document.addEventListener("mousedown",p)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",p));const m=e.computed(()=>l.unstyled?"":["sg-autocomplete",`sg-autocomplete-${l.size}`,l.loading?"sg-autocomplete-loading":""].filter(Boolean).join(" "));return(k,f)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:r,class:e.normalizeClass(m.value)},[e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?"":"sg-input-wrapper")},[e.createElementVNode("input",{type:"text",role:"combobox","aria-autocomplete":"list","aria-expanded":c.value&&i.value.length>0,class:e.normalizeClass(t.unstyled?"":`sg-input sg-input-${t.size}`),value:v.value,placeholder:t.placeholder,disabled:a.value,onInput:d,onFocus:f[0]||(f[0]=w=>c.value=!0),onBlur:f[1]||(f[1]=w=>o("blur"))},null,42,hd),t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",yd)):e.createCommentVNode("",!0)],2),c.value&&i.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.unstyled?"":"sg-autocomplete-dropdown")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,w=>(e.openBlock(),e.createElementBlock("div",{key:w.value,class:e.normalizeClass(t.unstyled?"":"sg-autocomplete-option"),onMousedown:B=>u(w)},e.toDisplayString(w.label??w.value),43,kd))),128))],2)):e.createCommentVNode("",!0)],2))}}),Bd=["disabled","aria-expanded","aria-label","aria-labelledby"],Cd=["value"],wd=["title","onClick"],Sd="#1677ff",Ed=e.defineComponent({__name:"ColorPicker",props:{modelValue:{},value:{},defaultValue:{},presets:{},showText:{type:Boolean},format:{default:"hex"},trigger:{default:"click"},open:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},size:{default:"middle"},unstyled:{type:Boolean},ariaLabel:{},ariaLabelledby:{}},emits:["update:modelValue","change","openChange"],setup(t,{emit:n}){const l=t,a=n,o=Ce(),s=e.computed(()=>{var R,X;return((X=(R=o.value.locale)==null?void 0:R.colorPicker)==null?void 0:X.pickColor)??"Pick color"});function v(R){const X=R.replace("#",""),se=X.length===3?X[0]+X[0]+X[1]+X[1]+X[2]+X[2]:X,ie=parseInt(se,16);return[ie>>16&255,ie>>8&255,ie&255]}function c(R,X,se){return"#"+[R,X,se].map(ie=>Math.round(ie).toString(16).padStart(2,"0")).join("")}function r(R,X,se){R/=255,X/=255,se/=255;const ie=Math.max(R,X,se),ne=Math.min(R,X,se),me=ie-ne;let ye=0;const Me=ie===0?0:me/ie,Ne=ie;if(me!==0)switch(ie){case R:ye=((X-se)/me+(X<se?6:0))/6;break;case X:ye=((se-R)/me+2)/6;break;case se:ye=((R-X)/me+4)/6;break}return{h:ye,s:Me,v:Ne}}function i(R,X,se){let ie=0,ne=0,me=0;const ye=Math.floor(R*6),Me=R*6-ye,Ne=se*(1-X),Pe=se*(1-Me*X),Te=se*(1-(1-Me)*X);switch(ye%6){case 0:ie=se,ne=Te,me=Ne;break;case 1:ie=Pe,ne=se,me=Ne;break;case 2:ie=Ne,ne=se,me=Te;break;case 3:ie=Ne,ne=Pe,me=se;break;case 4:ie=Te,ne=Ne,me=se;break;case 5:ie=se,ne=Ne,me=Pe;break}return[Math.round(ie*255),Math.round(ne*255),Math.round(me*255)]}function d(R,X,se){const[ie,ne,me]=i(R,X,se);return c(ie,ne,me)}function u(R,X){if(X==="rgb"){const[se,ie,ne]=v(R);return`rgb(${se}, ${ie}, ${ne})`}return R}function p(R){const X=R.trim();if(/^#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$/.test(X)){const ie=X.replace("#","");return(ie.length===3?"#"+ie[0]+ie[0]+ie[1]+ie[1]+ie[2]+ie[2]:X).toLowerCase()}const se=X.match(/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i);if(se){const ie=Math.min(255,parseInt(se[1])),ne=Math.min(255,parseInt(se[2])),me=Math.min(255,parseInt(se[3]));return c(ie,ne,me)}return null}const m=e.ref((l.modelValue??l.value??l.defaultValue??Sd).toLowerCase());e.watch(()=>l.modelValue??l.value,R=>{R!==void 0&&(m.value=R.toLowerCase())});const k=e.computed(()=>(l.modelValue??l.value??m.value).toLowerCase()),f=e.ref(!1),w=e.computed(()=>l.open??f.value),B=e.ref(null),E=e.ref(null),N=e.ref(null),x=e.ref(u(k.value,l.format)),y=e.ref((()=>{const[R,X,se]=v(k.value);return r(R,X,se)})());e.watch(k,R=>{x.value=u(R,l.format);const[X,se,ie]=v(R);y.value=r(X,se,ie)}),e.watch(()=>l.format,R=>{x.value=u(k.value,R)});let P;function S(R){f.value=R,a("openChange",R)}function C(R){m.value=R,x.value=u(R,l.format);const X=u(R,l.format);a("update:modelValue",X),a("change",X)}function b(){l.disabled||l.trigger!=="click"||S(!w.value)}function $(){l.disabled||l.trigger!=="hover"||(P&&clearTimeout(P),S(!0))}function T(){l.trigger==="hover"&&(P=setTimeout(()=>S(!1),200))}function z(R){const X=R.target.value;x.value=X;const se=p(X);if(se){const[ie,ne,me]=v(se);y.value=r(ie,ne,me),C(se)}}function K(R){const X=p(R);if(!X)return;const[se,ie,ne]=v(X);y.value=r(se,ie,ne),C(X)}let L=null;function I(R){if(!E.value)return;const X=E.value.getBoundingClientRect(),se=Math.max(0,Math.min(1,(R.clientX-X.left)/X.width)),ie=Math.max(0,Math.min(1,1-(R.clientY-X.top)/X.height)),ne={...y.value,s:se,v:ie};y.value=ne,C(d(ne.h,ne.s,ne.v))}function U(R){if(!N.value)return;const X=N.value.getBoundingClientRect(),se=Math.max(0,Math.min(1,(R.clientX-X.left)/X.width)),ie={...y.value,h:se};y.value=ie,C(d(ie.h,ie.s,ie.v))}function O(R){var X,se;R.preventDefault(),L="sat",(se=(X=R.target).setPointerCapture)==null||se.call(X,R.pointerId),I(R)}function q(R){L==="sat"&&I(R)}function ae(R){var X,se;R.preventDefault(),L="hue",(se=(X=R.target).setPointerCapture)==null||se.call(X,R.pointerId),U(R)}function G(R){L==="hue"&&U(R)}function Y(){L=null}function M(R){w.value&&B.value&&!B.value.contains(R.target)&&S(!1)}function g(R){w.value&&R.key==="Escape"&&S(!1)}e.onMounted(()=>{document.addEventListener("mousedown",M),document.addEventListener("keydown",g)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",M),document.removeEventListener("keydown",g),P&&clearTimeout(P)});const h=e.computed(()=>l.unstyled?"":["sg-colorpicker-wrapper",`sg-colorpicker-${l.size}`,l.disabled?"sg-colorpicker-disabled":""].filter(Boolean).join(" ")),V=e.computed(()=>d(y.value.h,1,1)),F=e.computed(()=>`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, ${V.value})`);return(R,X)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:B,class:e.normalizeClass(h.value),style:e.normalizeStyle(t.unstyled?{position:"relative",display:"inline-block"}:void 0),onMouseenter:$,onMouseleave:T},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(t.unstyled?void 0:"sg-colorpicker-trigger"),disabled:t.disabled,"aria-haspopup":"dialog","aria-expanded":w.value,"aria-label":t.ariaLabel??s.value,"aria-labelledby":t.ariaLabelledby,onClick:b},[e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?void 0:"sg-colorpicker-swatch"),style:e.normalizeStyle(t.unstyled?{display:"inline-block",width:"16px",height:"16px",background:k.value}:{background:k.value})},null,6),e.renderSlot(R.$slots,"text",{color:u(k.value,t.format)},()=>[t.showText?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(t.unstyled?void 0:"sg-colorpicker-text")},e.toDisplayString(u(k.value,t.format)),3)):e.createCommentVNode("",!0)])],10,Bd),w.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.unstyled?void 0:"sg-colorpicker-dropdown"),onMouseenter:$,onMouseleave:T},[e.createElementVNode("div",{ref_key:"satPanelRef",ref:E,class:e.normalizeClass(t.unstyled?void 0:"sg-colorpicker-saturation"),style:e.normalizeStyle(t.unstyled?{width:"200px",height:"150px",position:"relative",background:F.value}:{background:F.value}),onPointerdown:O,onPointermove:q,onPointerup:Y},[t.unstyled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-colorpicker-cursor",style:e.normalizeStyle({left:`${y.value.s*100}%`,top:`${(1-y.value.v)*100}%`,background:k.value})},null,4))],38),e.createElementVNode("div",{ref_key:"hueBarRef",ref:N,class:e.normalizeClass(t.unstyled?void 0:"sg-colorpicker-hue"),style:e.normalizeStyle(t.unstyled?{width:"200px",height:"12px",background:"linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)"}:void 0),onPointerdown:ae,onPointermove:G,onPointerup:Y},[t.unstyled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-colorpicker-hue-cursor",style:e.normalizeStyle({left:`${y.value.h*100}%`})},null,4))],38),e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?void 0:"sg-colorpicker-input-row")},[t.unstyled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",{key:0,class:"sg-colorpicker-preview",style:e.normalizeStyle({background:k.value})},null,4)),e.createElementVNode("input",{class:e.normalizeClass(t.unstyled?void 0:"sg-colorpicker-input"),value:x.value,spellcheck:"false",onInput:z},null,42,Cd)],2),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.presets??[],se=>(e.openBlock(),e.createElementBlock("div",{key:se.label,class:e.normalizeClass(t.unstyled?void 0:"sg-colorpicker-preset-group")},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?void 0:"sg-colorpicker-preset-label")},e.toDisplayString(se.label),3),e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?void 0:"sg-colorpicker-preset-grid"),style:e.normalizeStyle(t.unstyled?{display:"flex",flexWrap:"wrap",gap:"4px"}:void 0)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(se.colors,ie=>(e.openBlock(),e.createElementBlock("button",{key:ie,type:"button",class:e.normalizeClass(t.unstyled?void 0:"sg-colorpicker-preset-color"),style:e.normalizeStyle(t.unstyled?{width:"16px",height:"16px",background:ie}:{background:ie}),title:ie,onClick:ne=>K(ie)},null,14,wd))),128))],6)],2))),128))],34)):e.createCommentVNode("",!0)],38))}}),xd=["aria-expanded","aria-disabled"],$d=["value","placeholder","readonly"],Nd={class:"sg-datepicker-suffix"},Vd={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},Dd=["aria-label"],zd={class:"sg-dp-dropdown-inner"},Td={key:0,class:"sg-dp-presets"},Ld=["onClick"],Md={class:"sg-dp-content"},Fd={key:0,class:"sg-dp-panel"},Ad={class:"sg-dp-panel-header"},Pd=["title","aria-label"],Rd=["title","aria-label"],Id={key:1,class:"sg-dp-panel-title"},Kd=["title","aria-label"],Od=["title","aria-label"],Hd={class:"sg-dp-table"},jd=["onClick"],_d={class:"sg-dp-cell-inner"},Yd={key:1,class:"sg-dp-panel"},Wd={class:"sg-dp-panel-header"},Ud=["title","aria-label"],qd={class:"sg-dp-panel-title"},Xd=["title","aria-label"],Gd={class:"sg-dp-month-grid"},Jd=["onClick"],Zd={key:2,class:"sg-dp-panel"},Qd={class:"sg-dp-panel-header"},em=["title","aria-label"],tm={class:"sg-dp-panel-title"},lm=["title","aria-label"],am={class:"sg-dp-year-grid"},nm=["onClick"],om={key:3,class:"sg-dp-time-panel"},sm=["data-active","onClick"],rm=["data-active","onClick"],im=["data-active","onClick"],cm={class:"sg-dp-footer"},um={class:"sg-dp-footer-start"},dm={class:"sg-dp-footer-end"},mm=e.defineComponent({__name:"DatePicker",props:{modelValue:{},value:{},defaultValue:{},placeholder:{default:"Select date"},format:{},picker:{default:"date"},showTime:{type:[Boolean,Object],default:!1},showToday:{type:Boolean,default:!0},showNow:{type:Boolean,default:!1},allowClear:{type:Boolean,default:!0},disabledDate:{},presets:{},placement:{default:"bottomLeft"},open:{type:Boolean,default:void 0},inputReadOnly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"middle"},unstyled:{type:Boolean}},emits:["update:modelValue","change","openChange","blur","calendarChange"],setup(t,{emit:n}){const l=t,a=n,o=["January","February","March","April","May","June","July","August","September","October","November","December"],s=["Su","Mo","Tu","We","Th","Fr","Sa"],v=Ce(),c=e.computed(()=>{var W,ee;return((ee=(W=v.value.locale)==null?void 0:W.calendar)==null?void 0:ee.monthNames)??o}),r=e.computed(()=>{var W,ee;return((ee=(W=v.value.locale)==null?void 0:W.calendar)==null?void 0:ee.dayNames)??s}),i=e.computed(()=>{var W,ee;return((ee=(W=v.value.locale)==null?void 0:W.calendar)==null?void 0:ee.today)??"Today"}),d=e.computed(()=>{var W,ee;return((ee=(W=v.value.locale)==null?void 0:W.calendar)==null?void 0:ee.now)??"Now"}),u=e.computed(()=>{var W,ee;return((ee=(W=v.value.locale)==null?void 0:W.modal)==null?void 0:ee.okText)??"OK"}),p=e.computed(()=>{var W,ee;return((ee=(W=v.value.locale)==null?void 0:W.datePicker)==null?void 0:ee.prevYear)??"Previous year"}),m=e.computed(()=>{var W,ee;return((ee=(W=v.value.locale)==null?void 0:W.datePicker)==null?void 0:ee.nextYear)??"Next year"}),k=e.computed(()=>{var W,ee;return((ee=(W=v.value.locale)==null?void 0:W.datePicker)==null?void 0:ee.prevMonth)??"Previous month"}),f=e.computed(()=>{var W,ee;return((ee=(W=v.value.locale)==null?void 0:W.datePicker)==null?void 0:ee.nextMonth)??"Next month"}),w=e.computed(()=>{var W,ee;return((ee=(W=v.value.locale)==null?void 0:W.input)==null?void 0:ee.clear)??"Clear"});function B(W){return String(W).padStart(2,"0")}function E(W,ee){return W.getFullYear()===ee.getFullYear()&&W.getMonth()===ee.getMonth()&&W.getDate()===ee.getDate()}function N(W){return E(W,new Date)}function x(W,ee){return new Date(W,ee+1,0).getDate()}function y(W){return new Date(W.getTime())}function P(W){if(W==null||W==="")return null;if(W instanceof Date)return isNaN(W.getTime())?null:W;if(typeof W=="string"||typeof W=="number"){const ee=new Date(W);return isNaN(ee.getTime())?null:ee}return null}function S(W,ee){return W?ee.replace("YYYY",String(W.getFullYear())).replace("MM",B(W.getMonth()+1)).replace("DD",B(W.getDate())).replace("HH",B(W.getHours())).replace("mm",B(W.getMinutes())).replace("ss",B(W.getSeconds())):""}function C(W,ee){if(!W)return null;const he=ee.indexOf("YYYY"),A=ee.indexOf("MM"),H=ee.indexOf("DD"),Q=ee.indexOf("HH"),ge=ee.indexOf("mm"),Se=ee.indexOf("ss"),xe=he>=0?parseInt(W.substring(he,he+4),10):new Date().getFullYear(),Ae=A>=0?parseInt(W.substring(A,A+2),10)-1:0,Oe=H>=0?parseInt(W.substring(H,H+2),10):1,Qe=Q>=0?parseInt(W.substring(Q,Q+2),10):0,Ge=ge>=0?parseInt(W.substring(ge,ge+2),10):0,tt=Se>=0?parseInt(W.substring(Se,Se+2),10):0;return isNaN(xe)||isNaN(Ae)||isNaN(Oe)?null:new Date(xe,Ae,Oe,Qe,Ge,tt)}const b=e.computed(()=>!!l.showTime),$=e.computed(()=>typeof l.showTime=="object"&&l.showTime!==null?l.showTime:{}),T=e.computed(()=>l.format??(b.value?"YYYY-MM-DD HH:mm:ss":l.picker==="month"?"YYYY-MM":l.picker==="year"?"YYYY":"YYYY-MM-DD")),z=P(l.defaultValue),K=l.modelValue!==void 0?P(l.modelValue):l.value!==void 0?P(l.value):z,L=e.ref(K);e.watch(()=>l.modelValue??l.value,W=>{if(W!==void 0){const ee=P(W);L.value=ee,ee&&(q.value=ee.getFullYear(),ae.value=ee.getMonth(),Y.value=ee)}});const I=e.computed(()=>{const W=l.modelValue!==void 0?l.modelValue:l.value;return W!==void 0?P(W):L.value}),U=e.ref(!1),O=e.computed(()=>l.open??U.value),q=e.ref((I.value??new Date).getFullYear()),ae=e.ref((I.value??new Date).getMonth()),G=e.ref(l.picker==="year"?"year":l.picker==="month"?"month":"date"),Y=e.ref(I.value??$.value.defaultValue??new Date),M=e.ref(""),g=e.ref(!1),h=e.ref(null),V=e.ref(null);function F(W){U.value=W,a("openChange",W),W||(g.value=!1,a("blur"))}function R(W){L.value=W,a("update:modelValue",W),a("change",W,W?S(W,T.value):"")}function X(){l.disabled||l.loading||(F(!0),G.value=l.picker==="year"?"year":l.picker==="month"?"month":"date",I.value&&(q.value=I.value.getFullYear(),ae.value=I.value.getMonth(),Y.value=I.value))}function se(W){if(a("calendarChange",W),b.value){const ee=y(W);ee.setHours(Y.value.getHours(),Y.value.getMinutes(),Y.value.getSeconds()),Y.value=ee,L.value=ee;return}R(W),F(!1)}function ie(W){if(l.picker==="month"){const ee=new Date(q.value,W,1);R(ee),F(!1);return}ae.value=W,G.value="date"}function ne(W){if(l.picker==="year"){const ee=new Date(W,0,1);R(ee),F(!1);return}q.value=W,G.value=l.picker==="month"?"month":"date"}function me(W){if(Y.value=W,I.value){const ee=y(I.value);ee.setHours(W.getHours(),W.getMinutes(),W.getSeconds()),L.value=ee}}function ye(){const W=I.value??Y.value;R(W),F(!1)}function Me(){const W=new Date;b.value?(q.value=W.getFullYear(),ae.value=W.getMonth(),L.value=W,Y.value=W):(R(W),F(!1))}function Ne(){R(new Date),F(!1)}function Pe(W){W.stopPropagation(),R(null)}function Te(W){const ee=Array.isArray(W.value)?W.value[0]:W.value;R(ee),F(!1)}function Ue(W){M.value=W.target.value,g.value=!0}function qe(W){if(W.key==="Enter"&&g.value){const ee=C(M.value,T.value);ee&&!isNaN(ee.getTime())&&(R(ee),F(!1))}W.key==="Escape"&&F(!1)}function Z(W){O.value&&h.value&&!h.value.contains(W.target)&&F(!1)}function te(W){O.value&&W.key==="Escape"&&F(!1)}e.onMounted(()=>{document.addEventListener("mousedown",Z),document.addEventListener("keydown",te)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Z),document.removeEventListener("keydown",te)});const fe=e.computed(()=>{const W=q.value,ee=ae.value,he=x(W,ee),A=new Date(W,ee,1).getDay(),H=x(W,ee-1),Q=[];for(let xe=A-1;xe>=0;xe--)Q.push({date:new Date(W,ee-1,H-xe),day:H-xe,inMonth:!1});for(let xe=1;xe<=he;xe++)Q.push({date:new Date(W,ee,xe),day:xe,inMonth:!0});const ge=42-Q.length;for(let xe=1;xe<=ge;xe++)Q.push({date:new Date(W,ee+1,xe),day:xe,inMonth:!1});const Se=[];for(let xe=0;xe<Q.length;xe+=7)Se.push(Q.slice(xe,xe+7));return Se}),Be=e.computed(()=>`${c.value[ae.value]} ${q.value}`),Ve=e.computed(()=>g.value?M.value:I.value?S(I.value,T.value):""),De=e.computed(()=>Math.floor(q.value/10)*10),Ee=e.computed(()=>{const W=[];for(let ee=De.value-1;ee<=De.value+10;ee++)W.push(ee);return W});function Le(W){const ee=ae.value+W;ee<0?(ae.value=11,q.value--):ee>11?(ae.value=0,q.value++):ae.value=ee}function Fe(W){q.value+=W}function we(W){var H;const ee=I.value?E(W.date,I.value):!1,he=N(W.date),A=((H=l.disabledDate)==null?void 0:H.call(l,W.date))??!1;return["sg-dp-cell",W.inMonth?"":"sg-dp-cell-outside",ee?"sg-dp-cell-selected":"",he?"sg-dp-cell-today":"",A?"sg-dp-cell-disabled":""].filter(Boolean).join(" ")}const re=e.computed(()=>l.unstyled?"":["sg-datepicker",`sg-datepicker-${l.size}`,O.value?"sg-datepicker-open":"",l.disabled||l.loading?"sg-datepicker-disabled":"",l.loading?"sg-datepicker-loading":""].filter(Boolean).join(" ")),ve=e.computed(()=>`sg-dp-dropdown sg-dp-dropdown-${l.placement}`),oe=e.computed(()=>$.value.hourStep??1),ke=e.computed(()=>$.value.minuteStep??1),Ie=e.computed(()=>$.value.secondStep??1),Xe=e.computed(()=>($.value.format??"HH:mm:ss").includes("ss")),lt=e.computed(()=>{const W=[];for(let ee=0;ee<24;ee+=oe.value)W.push(ee);return W}),le=e.computed(()=>{const W=[];for(let ee=0;ee<60;ee+=ke.value)W.push(ee);return W}),ue=e.computed(()=>{const W=[];for(let ee=0;ee<60;ee+=Ie.value)W.push(ee);return W});function de(W){const ee=y(Y.value);ee.setHours(W),me(ee)}function $e(W){const ee=y(Y.value);ee.setMinutes(W),me(ee)}function be(W){const ee=y(Y.value);ee.setSeconds(W),me(ee)}const Ke=e.ref(null),We=e.ref(null),et=e.ref(null);function ze(W){var he;if(!W)return;const ee=W.querySelector('[data-active="true"]');(he=ee==null?void 0:ee.scrollIntoView)==null||he.call(ee,{block:"nearest"})}return e.watch([O,()=>Y.value],async()=>{!O.value||!b.value||(await e.nextTick(),ze(Ke.value),ze(We.value),ze(et.value))}),(W,ee)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:h,class:e.normalizeClass(re.value)},[e.createElementVNode("div",{class:"sg-datepicker-input",role:"combobox","aria-haspopup":"dialog","aria-expanded":O.value,"aria-disabled":t.disabled,onClick:X},[t.inputReadOnly?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["sg-datepicker-input-text",Ve.value?"":"sg-datepicker-placeholder"].filter(Boolean).join(" "))},e.toDisplayString(Ve.value||t.placeholder),3)):(e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"inputRef",ref:V,class:"sg-datepicker-input-text",value:Ve.value,placeholder:t.placeholder,readonly:t.disabled,onInput:Ue,onKeydown:qe,onFocus:X},null,40,$d)),e.createElementVNode("span",Nd,[t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",Vd)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.allowClear&&I.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"sg-datepicker-clear",role:"button","aria-label":w.value,onClick:Pe},"×",8,Dd)):e.createCommentVNode("",!0),ee[9]||(ee[9]=e.createElementVNode("svg",{class:"sg-datepicker-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{d:"M11 1V0h1v1h2.5A1.5 1.5 0 0116 2.5v12a1.5 1.5 0 01-1.5 1.5h-13A1.5 1.5 0 010 14.5v-12A1.5 1.5 0 011.5 1H4V0h1v1h6zM1.5 2a.5.5 0 00-.5.5V4h14V2.5a.5.5 0 00-.5-.5h-13zM15 5H1v9.5a.5.5 0 00.5.5h13a.5.5 0 00.5-.5V5z"})],-1))],64))])],8,xd),O.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(ve.value)},[e.createElementVNode("div",zd,[t.presets&&t.presets.length>0?(e.openBlock(),e.createElementBlock("div",Td,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.presets,he=>(e.openBlock(),e.createElementBlock("div",{key:he.label,class:"sg-dp-preset-item",onClick:A=>Te(he)},e.toDisplayString(he.label),9,Ld))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Md,[G.value==="date"?(e.openBlock(),e.createElementBlock("div",Fd,[e.createElementVNode("div",Ad,[e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:p.value,"aria-label":p.value,onClick:ee[0]||(ee[0]=he=>Fe(-1))}," « ",8,Pd),e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:k.value,"aria-label":k.value,onClick:ee[1]||(ee[1]=he=>Le(-1))}," ‹ ",8,Rd),t.picker==="date"?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"sg-dp-panel-title sg-dp-panel-title-btn",onClick:ee[2]||(ee[2]=he=>G.value="month")},e.toDisplayString(Be.value),1)):(e.openBlock(),e.createElementBlock("span",Id,e.toDisplayString(Be.value),1)),e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:f.value,"aria-label":f.value,onClick:ee[3]||(ee[3]=he=>Le(1))}," › ",8,Kd),e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:m.value,"aria-label":m.value,onClick:ee[4]||(ee[4]=he=>Fe(1))}," » ",8,Od)]),e.createElementVNode("table",Hd,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,he=>(e.openBlock(),e.createElementBlock("th",{key:he,class:"sg-dp-th"},e.toDisplayString(he),1))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(he,A)=>(e.openBlock(),e.createElementBlock("tr",{key:A},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he,H=>(e.openBlock(),e.createElementBlock("td",{key:H.date.toISOString(),class:e.normalizeClass(we(H)),onClick:Q=>{var ge;return!((ge=l.disabledDate)!=null&&ge.call(l,H.date))&&se(H.date)}},[e.createElementVNode("span",_d,e.toDisplayString(H.day),1)],10,jd))),128))]))),128))])])])):e.createCommentVNode("",!0),G.value==="month"?(e.openBlock(),e.createElementBlock("div",Yd,[e.createElementVNode("div",Wd,[e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:p.value,"aria-label":p.value,onClick:ee[5]||(ee[5]=he=>Fe(-1))}," « ",8,Ud),e.createElementVNode("span",qd,e.toDisplayString(q.value),1),e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:m.value,"aria-label":m.value,onClick:ee[6]||(ee[6]=he=>Fe(1))}," » ",8,Xd)]),e.createElementVNode("div",Gd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(he,A)=>(e.openBlock(),e.createElementBlock("div",{key:A,class:e.normalizeClass(["sg-dp-month-cell",I.value&&I.value.getFullYear()===q.value&&I.value.getMonth()===A?"sg-dp-month-cell-selected":"",new Date().getFullYear()===q.value&&new Date().getMonth()===A?"sg-dp-month-cell-current":""].filter(Boolean).join(" ")),onClick:H=>ie(A)},e.toDisplayString(he.substring(0,3)),11,Jd))),128))])])):e.createCommentVNode("",!0),G.value==="year"?(e.openBlock(),e.createElementBlock("div",Zd,[e.createElementVNode("div",Qd,[e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:p.value,"aria-label":p.value,onClick:ee[7]||(ee[7]=he=>Fe(-10))}," « ",8,em),e.createElementVNode("span",tm,e.toDisplayString(De.value)+" - "+e.toDisplayString(De.value+9),1),e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:m.value,"aria-label":m.value,onClick:ee[8]||(ee[8]=he=>Fe(10))}," » ",8,lm)]),e.createElementVNode("div",am,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ee.value,he=>(e.openBlock(),e.createElementBlock("div",{key:he,class:e.normalizeClass(["sg-dp-year-cell",I.value&&I.value.getFullYear()===he?"sg-dp-year-cell-selected":"",new Date().getFullYear()===he?"sg-dp-year-cell-current":"",he<De.value||he>De.value+9?"sg-dp-year-cell-outside":""].filter(Boolean).join(" ")),onClick:A=>ne(he)},e.toDisplayString(he),11,nm))),128))])])):e.createCommentVNode("",!0),b.value&&G.value==="date"?(e.openBlock(),e.createElementBlock("div",om,[e.createElementVNode("div",{ref_key:"hourColRef",ref:Ke,class:"sg-dp-time-col"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value,he=>(e.openBlock(),e.createElementBlock("div",{key:he,"data-active":he===Y.value.getHours(),class:e.normalizeClass(["sg-dp-time-cell",he===Y.value.getHours()?"sg-dp-time-cell-active":""]),onClick:A=>de(he)},e.toDisplayString(B(he)),11,sm))),128))],512),e.createElementVNode("div",{ref_key:"minuteColRef",ref:We,class:"sg-dp-time-col"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(le.value,he=>(e.openBlock(),e.createElementBlock("div",{key:he,"data-active":he===Y.value.getMinutes(),class:e.normalizeClass(["sg-dp-time-cell",he===Y.value.getMinutes()?"sg-dp-time-cell-active":""]),onClick:A=>$e(he)},e.toDisplayString(B(he)),11,rm))),128))],512),Xe.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"secondColRef",ref:et,class:"sg-dp-time-col"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ue.value,he=>(e.openBlock(),e.createElementBlock("div",{key:he,"data-active":he===Y.value.getSeconds(),class:e.normalizeClass(["sg-dp-time-cell",he===Y.value.getSeconds()?"sg-dp-time-cell-active":""]),onClick:A=>be(he)},e.toDisplayString(B(he)),11,im))),128))],512)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",cm,[e.createElementVNode("div",um,[t.showToday&&!b.value&&G.value==="date"?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"sg-dp-footer-btn sg-dp-today-btn",onClick:Me},e.toDisplayString(i.value),1)):e.createCommentVNode("",!0),t.showNow&&b.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"sg-dp-footer-btn sg-dp-now-btn",onClick:Ne},e.toDisplayString(d.value),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",dm,[b.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"sg-dp-footer-btn sg-dp-ok-btn",onClick:ye},e.toDisplayString(u.value),1)):e.createCommentVNode("",!0)])])])])],2)):e.createCommentVNode("",!0)],2))}}),pm=["aria-expanded","aria-disabled"],vm={class:"sg-datepicker-separator"},gm={class:"sg-datepicker-suffix"},fm={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},hm=["aria-label"],ym={class:"sg-dp-dropdown-inner"},km={key:0,class:"sg-dp-presets"},bm=["onClick"],Bm={class:"sg-dp-content"},Cm={class:"sg-dp-range-panels"},wm={class:"sg-dp-panel"},Sm={class:"sg-dp-panel-header"},Em=["title","aria-label"],xm=["title","aria-label"],$m={class:"sg-dp-panel-title"},Nm={class:"sg-dp-table"},Vm=["onClick","onMouseenter"],Dm={class:"sg-dp-cell-inner"},zm={class:"sg-dp-panel"},Tm={class:"sg-dp-panel-header"},Lm={class:"sg-dp-panel-title"},Mm=["title","aria-label"],Fm=["title","aria-label"],Am={class:"sg-dp-table"},Pm=["onClick","onMouseenter"],Rm={class:"sg-dp-cell-inner"},Im={key:0,class:"sg-dp-range-time"},Km={class:"sg-dp-time-panel"},Om={class:"sg-dp-time-col"},Hm=["data-active","onClick"],jm={class:"sg-dp-time-col"},_m=["data-active","onClick"],Ym={key:0,class:"sg-dp-time-col"},Wm=["data-active","onClick"],Um={class:"sg-dp-time-panel"},qm={class:"sg-dp-time-col"},Xm=["data-active","onClick"],Gm={class:"sg-dp-time-col"},Jm=["data-active","onClick"],Zm={key:0,class:"sg-dp-time-col"},Qm=["data-active","onClick"],ep={class:"sg-dp-footer"},tp={class:"sg-dp-footer-end"},lp=e.defineComponent({__name:"RangePicker",props:{modelValue:{},value:{},defaultValue:{},placeholder:{default:()=>["Start date","End date"]},format:{},showTime:{type:[Boolean,Object],default:!1},allowClear:{type:Boolean,default:!0},disabledDate:{},presets:{},separator:{default:"→"},placement:{default:"bottomLeft"},open:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"middle"},unstyled:{type:Boolean}},emits:["update:modelValue","change","openChange"],setup(t,{emit:n}){const l=t,a=n,o=["January","February","March","April","May","June","July","August","September","October","November","December"],s=["Su","Mo","Tu","We","Th","Fr","Sa"],v=Ce(),c=e.computed(()=>{var le,ue;return((ue=(le=v.value.locale)==null?void 0:le.calendar)==null?void 0:ue.monthNames)??o}),r=e.computed(()=>{var le,ue;return((ue=(le=v.value.locale)==null?void 0:le.calendar)==null?void 0:ue.dayNames)??s}),i=e.computed(()=>{var le,ue;return((ue=(le=v.value.locale)==null?void 0:le.modal)==null?void 0:ue.okText)??"OK"}),d=e.computed(()=>{var le,ue;return((ue=(le=v.value.locale)==null?void 0:le.datePicker)==null?void 0:ue.prevYear)??"Previous year"}),u=e.computed(()=>{var le,ue;return((ue=(le=v.value.locale)==null?void 0:le.datePicker)==null?void 0:ue.nextYear)??"Next year"}),p=e.computed(()=>{var le,ue;return((ue=(le=v.value.locale)==null?void 0:le.datePicker)==null?void 0:ue.prevMonth)??"Previous month"}),m=e.computed(()=>{var le,ue;return((ue=(le=v.value.locale)==null?void 0:le.datePicker)==null?void 0:ue.nextMonth)??"Next month"}),k=e.computed(()=>{var le,ue;return((ue=(le=v.value.locale)==null?void 0:le.input)==null?void 0:ue.clear)??"Clear"});function f(le){return String(le).padStart(2,"0")}function w(le,ue){return le.getFullYear()===ue.getFullYear()&&le.getMonth()===ue.getMonth()&&le.getDate()===ue.getDate()}function B(le){return w(le,new Date)}function E(le,ue){return new Date(le,ue+1,0).getDate()}function N(le){return new Date(le.getFullYear(),le.getMonth(),le.getDate())}function x(le){return new Date(le.getTime())}function y(le){if(le==null||le==="")return null;if(le instanceof Date)return isNaN(le.getTime())?null:le;if(typeof le=="string"||typeof le=="number"){const ue=new Date(le);return isNaN(ue.getTime())?null:ue}return null}function P(le,ue){return le?ue.replace("YYYY",String(le.getFullYear())).replace("MM",f(le.getMonth()+1)).replace("DD",f(le.getDate())).replace("HH",f(le.getHours())).replace("mm",f(le.getMinutes())).replace("ss",f(le.getSeconds())):""}function S(le){return[y(le==null?void 0:le[0]),y(le==null?void 0:le[1])]}const C=e.computed(()=>!!l.showTime),b=e.computed(()=>typeof l.showTime=="object"&&l.showTime!==null?l.showTime:{}),$=e.computed(()=>l.format??(C.value?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD")),T=e.computed(()=>{const le=l.modelValue!==void 0?l.modelValue:l.value;return le?S(le):void 0}),z=e.ref(T.value??(l.defaultValue?S(l.defaultValue):[null,null]));e.watch(T,le=>{le&&(z.value=le)});const K=e.ref(null),L=e.computed(()=>K.value??T.value??z.value),I=e.ref(!1),U=e.computed(()=>l.open??I.value),O=e.ref(0),q=e.ref(null),ae=e.computed(()=>L.value[0]??new Date),G=e.ref(ae.value.getFullYear()),Y=e.ref(ae.value.getMonth()),M=e.computed(()=>Y.value===11?G.value+1:G.value),g=e.computed(()=>Y.value===11?0:Y.value+1),h=e.ref([L.value[0]??new Date,L.value[1]??new Date]),V=e.ref(null);function F(le){I.value=le,a("openChange",le)}function R(le){z.value=le,a("update:modelValue",le),a("change",le,[le[0]?P(le[0],$.value):"",le[1]?P(le[1],$.value):""])}function X(){l.disabled||l.loading||F(!0)}function se(le){if(O.value===0){K.value=[le,null],O.value=1;return}let ue=L.value[0],de=le;if(ue&&de.getTime()<ue.getTime()&&([ue,de]=[de,ue]),C.value){const $e=x(ue||le);$e.setHours(h.value[0].getHours(),h.value[0].getMinutes(),h.value[0].getSeconds());const be=x(de);be.setHours(h.value[1].getHours(),h.value[1].getMinutes(),h.value[1].getSeconds()),K.value=[$e,be]}else R([ue,de]),K.value=null,F(!1),O.value=0}function ie(){R(L.value),K.value=null,F(!1),O.value=0}function ne(le){le.stopPropagation(),R([null,null]),K.value=null,O.value=0}function me(le){Array.isArray(le.value)?R([le.value[0],le.value[1]]):R([le.value,le.value]),K.value=null,O.value=0,F(!1)}function ye(le){const ue=Y.value+le;ue<0?(Y.value=11,G.value--):ue>11?(Y.value=0,G.value++):Y.value=ue}function Me(le,ue){const de=E(le,ue),$e=new Date(le,ue,1).getDay(),be=E(le,ue-1),Ke=[];for(let ze=$e-1;ze>=0;ze--)Ke.push({date:new Date(le,ue-1,be-ze),day:be-ze,inMonth:!1});for(let ze=1;ze<=de;ze++)Ke.push({date:new Date(le,ue,ze),day:ze,inMonth:!0});const We=42-Ke.length;for(let ze=1;ze<=We;ze++)Ke.push({date:new Date(le,ue+1,ze),day:ze,inMonth:!1});const et=[];for(let ze=0;ze<Ke.length;ze+=7)et.push(Ke.slice(ze,ze+7));return et}const Ne=e.computed(()=>Me(G.value,Y.value)),Pe=e.computed(()=>Me(M.value,g.value));function Te(le){const ue=L.value[0];if(!ue)return!1;const de=L.value[1]??q.value;if(!de)return!1;const $e=N(ue).getTime(),be=N(de).getTime(),Ke=N(le).getTime();return Ke>Math.min($e,be)&&Ke<Math.max($e,be)}function Ue(le){const ue=L.value[0];if(!ue)return null;if(w(le,ue))return"start";const de=L.value[1]??q.value;return de&&w(le,de)?"end":null}function qe(le){var Ke;const ue=((Ke=l.disabledDate)==null?void 0:Ke.call(l,le.date))??!1,de=B(le.date),$e=Te(le.date),be=Ue(le.date);return["sg-dp-cell",le.inMonth?"":"sg-dp-cell-outside",de?"sg-dp-cell-today":"",ue?"sg-dp-cell-disabled":"",$e?"sg-dp-cell-in-range":"",be==="start"?"sg-dp-cell-range-start":"",be==="end"?"sg-dp-cell-range-end":""].filter(Boolean).join(" ")}const Z=e.computed(()=>L.value[0]?P(L.value[0],$.value):l.placeholder[0]),te=e.computed(()=>L.value[1]?P(L.value[1],$.value):l.placeholder[1]),fe=e.computed(()=>l.unstyled?"":["sg-datepicker","sg-datepicker-range",`sg-datepicker-${l.size}`,U.value?"sg-datepicker-open":"",l.disabled||l.loading?"sg-datepicker-disabled":"",l.loading?"sg-datepicker-loading":""].filter(Boolean).join(" ")),Be=e.computed(()=>`sg-dp-dropdown sg-dp-dropdown-range sg-dp-dropdown-${l.placement}`);function Ve(le){U.value&&V.value&&!V.value.contains(le.target)&&(F(!1),K.value=null,O.value=0)}function De(le){U.value&&le.key==="Escape"&&F(!1)}e.onMounted(()=>{document.addEventListener("mousedown",Ve),document.addEventListener("keydown",De)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Ve),document.removeEventListener("keydown",De)});const Ee=e.computed(()=>b.value.hourStep??1),Le=e.computed(()=>b.value.minuteStep??1),Fe=e.computed(()=>b.value.secondStep??1),we=e.computed(()=>(b.value.format??"HH:mm:ss").includes("ss"));function re(le,ue){const de=[];for(let $e=0;$e<ue;$e+=le)de.push($e);return de}const ve=e.computed(()=>re(Ee.value,24)),oe=e.computed(()=>re(Le.value,60)),ke=e.computed(()=>re(Fe.value,60));function Ie(le,ue){const de=[x(h.value[0]),x(h.value[1])];ue(de[le]),h.value=de;const $e=L.value;if($e[0]&&$e[1]){const be=[x($e[0]),x($e[1])];be[le].setHours(de[le].getHours(),de[le].getMinutes(),de[le].getSeconds()),K.value?K.value=be:z.value=be}}const Xe=e.computed(()=>`${c.value[Y.value]} ${G.value}`),lt=e.computed(()=>`${c.value[g.value]} ${M.value}`);return(le,ue)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:V,class:e.normalizeClass(fe.value)},[e.createElementVNode("div",{class:"sg-datepicker-input sg-datepicker-range-input",role:"combobox","aria-haspopup":"dialog","aria-expanded":U.value,"aria-disabled":t.disabled,onClick:X},[e.createElementVNode("span",{class:e.normalizeClass(["sg-datepicker-range-part",O.value===0?"sg-datepicker-range-active":"",L.value[0]?"":"sg-datepicker-placeholder"].filter(Boolean).join(" ")),onClick:ue[0]||(ue[0]=e.withModifiers(()=>{O.value=0,X()},["stop"]))},e.toDisplayString(Z.value),3),e.createElementVNode("span",vm,e.toDisplayString(t.separator),1),e.createElementVNode("span",{class:e.normalizeClass(["sg-datepicker-range-part",O.value===1?"sg-datepicker-range-active":"",L.value[1]?"":"sg-datepicker-placeholder"].filter(Boolean).join(" ")),onClick:ue[1]||(ue[1]=e.withModifiers(()=>{O.value=1,X()},["stop"]))},e.toDisplayString(te.value),3),e.createElementVNode("span",gm,[t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",fm)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.allowClear&&(L.value[0]||L.value[1])?(e.openBlock(),e.createElementBlock("span",{key:0,class:"sg-datepicker-clear",role:"button","aria-label":k.value,onClick:ne},"×",8,hm)):e.createCommentVNode("",!0),ue[8]||(ue[8]=e.createElementVNode("svg",{class:"sg-datepicker-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{d:"M11 1V0h1v1h2.5A1.5 1.5 0 0116 2.5v12a1.5 1.5 0 01-1.5 1.5h-13A1.5 1.5 0 010 14.5v-12A1.5 1.5 0 011.5 1H4V0h1v1h6zM1.5 2a.5.5 0 00-.5.5V4h14V2.5a.5.5 0 00-.5-.5h-13zM15 5H1v9.5a.5.5 0 00.5.5h13a.5.5 0 00.5-.5V5z"})],-1))],64))])],8,pm),U.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(Be.value)},[e.createElementVNode("div",ym,[t.presets&&t.presets.length>0?(e.openBlock(),e.createElementBlock("div",km,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.presets,de=>(e.openBlock(),e.createElementBlock("div",{key:de.label,class:"sg-dp-preset-item",onClick:$e=>me(de)},e.toDisplayString(de.label),9,bm))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Bm,[e.createElementVNode("div",Cm,[e.createElementVNode("div",wm,[e.createElementVNode("div",Sm,[e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:d.value,"aria-label":d.value,onClick:ue[2]||(ue[2]=de=>G.value--)}," « ",8,Em),e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:p.value,"aria-label":p.value,onClick:ue[3]||(ue[3]=de=>ye(-1))}," ‹ ",8,xm),e.createElementVNode("span",$m,e.toDisplayString(Xe.value),1),ue[9]||(ue[9]=e.createElementVNode("span",{style:{flex:"1"}},null,-1))]),e.createElementVNode("table",Nm,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,de=>(e.openBlock(),e.createElementBlock("th",{key:de,class:"sg-dp-th"},e.toDisplayString(de),1))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ne.value,(de,$e)=>(e.openBlock(),e.createElementBlock("tr",{key:$e},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de,be=>(e.openBlock(),e.createElementBlock("td",{key:be.date.toISOString(),class:e.normalizeClass(qe(be)),onClick:Ke=>{var We;return!((We=l.disabledDate)!=null&&We.call(l,be.date))&&se(be.date)},onMouseenter:Ke=>q.value=be.date,onMouseleave:ue[4]||(ue[4]=Ke=>q.value=null)},[e.createElementVNode("span",Dm,e.toDisplayString(be.day),1)],42,Vm))),128))]))),128))])])]),e.createElementVNode("div",zm,[e.createElementVNode("div",Tm,[ue[10]||(ue[10]=e.createElementVNode("span",{style:{flex:"1"}},null,-1)),e.createElementVNode("span",Lm,e.toDisplayString(lt.value),1),e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:m.value,"aria-label":m.value,onClick:ue[5]||(ue[5]=de=>ye(1))}," › ",8,Mm),e.createElementVNode("button",{type:"button",class:"sg-dp-nav-btn",title:u.value,"aria-label":u.value,onClick:ue[6]||(ue[6]=de=>G.value++)}," » ",8,Fm)]),e.createElementVNode("table",Am,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,de=>(e.openBlock(),e.createElementBlock("th",{key:de+"-r",class:"sg-dp-th"},e.toDisplayString(de),1))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value,(de,$e)=>(e.openBlock(),e.createElementBlock("tr",{key:$e},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de,be=>(e.openBlock(),e.createElementBlock("td",{key:be.date.toISOString(),class:e.normalizeClass(qe(be)),onClick:Ke=>{var We;return!((We=l.disabledDate)!=null&&We.call(l,be.date))&&se(be.date)},onMouseenter:Ke=>q.value=be.date,onMouseleave:ue[7]||(ue[7]=Ke=>q.value=null)},[e.createElementVNode("span",Rm,e.toDisplayString(be.day),1)],42,Pm))),128))]))),128))])])])]),C.value&&L.value[0]&&L.value[1]?(e.openBlock(),e.createElementBlock("div",Im,[e.createElementVNode("div",Km,[e.createElementVNode("div",Om,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,de=>(e.openBlock(),e.createElementBlock("div",{key:de+"-h0","data-active":de===h.value[0].getHours(),class:e.normalizeClass(["sg-dp-time-cell",de===h.value[0].getHours()?"sg-dp-time-cell-active":""]),onClick:$e=>Ie(0,be=>be.setHours(de))},e.toDisplayString(f(de)),11,Hm))),128))]),e.createElementVNode("div",jm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,de=>(e.openBlock(),e.createElementBlock("div",{key:de+"-m0","data-active":de===h.value[0].getMinutes(),class:e.normalizeClass(["sg-dp-time-cell",de===h.value[0].getMinutes()?"sg-dp-time-cell-active":""]),onClick:$e=>Ie(0,be=>be.setMinutes(de))},e.toDisplayString(f(de)),11,_m))),128))]),we.value?(e.openBlock(),e.createElementBlock("div",Ym,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,de=>(e.openBlock(),e.createElementBlock("div",{key:de+"-s0","data-active":de===h.value[0].getSeconds(),class:e.normalizeClass(["sg-dp-time-cell",de===h.value[0].getSeconds()?"sg-dp-time-cell-active":""]),onClick:$e=>Ie(0,be=>be.setSeconds(de))},e.toDisplayString(f(de)),11,Wm))),128))])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Um,[e.createElementVNode("div",qm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,de=>(e.openBlock(),e.createElementBlock("div",{key:de+"-h1","data-active":de===h.value[1].getHours(),class:e.normalizeClass(["sg-dp-time-cell",de===h.value[1].getHours()?"sg-dp-time-cell-active":""]),onClick:$e=>Ie(1,be=>be.setHours(de))},e.toDisplayString(f(de)),11,Xm))),128))]),e.createElementVNode("div",Gm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,de=>(e.openBlock(),e.createElementBlock("div",{key:de+"-m1","data-active":de===h.value[1].getMinutes(),class:e.normalizeClass(["sg-dp-time-cell",de===h.value[1].getMinutes()?"sg-dp-time-cell-active":""]),onClick:$e=>Ie(1,be=>be.setMinutes(de))},e.toDisplayString(f(de)),11,Jm))),128))]),we.value?(e.openBlock(),e.createElementBlock("div",Zm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,de=>(e.openBlock(),e.createElementBlock("div",{key:de+"-s1","data-active":de===h.value[1].getSeconds(),class:e.normalizeClass(["sg-dp-time-cell",de===h.value[1].getSeconds()?"sg-dp-time-cell-active":""]),onClick:$e=>Ie(1,be=>be.setSeconds(de))},e.toDisplayString(f(de)),11,Qm))),128))])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",ep,[e.createElementVNode("div",tp,[C.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"sg-dp-footer-btn sg-dp-ok-btn",onClick:ie},e.toDisplayString(i.value),1)):e.createCommentVNode("",!0)])])])])],2)):e.createCommentVNode("",!0)],2))}}),ap=["aria-expanded","aria-disabled","aria-label","aria-labelledby"],np={class:"sg-timepicker-suffix"},op={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},sp=["aria-label"],rp={key:0,class:"sg-tp-dropdown"},ip={class:"sg-tp-columns"},cp=["data-active","data-disabled","aria-disabled","onClick"],up=["data-active","data-disabled","aria-disabled","onClick"],dp=["data-active","data-disabled","aria-disabled","onClick"],mp={key:1,class:"sg-tp-col sg-tp-col-ampm"},pp={key:0,class:"sg-tp-footer"},el=e.defineComponent({__name:"TimePicker",props:{modelValue:{},value:{},defaultValue:{},placeholder:{default:"Select time"},format:{},use12Hours:{type:Boolean,default:!1},hourStep:{default:1},minuteStep:{default:1},secondStep:{default:1},showSecond:{type:Boolean,default:!0},showNow:{type:Boolean,default:!0},allowClear:{type:Boolean,default:!0},open:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"middle"},unstyled:{type:Boolean},disabledHours:{},disabledMinutes:{},disabledSeconds:{},inputReadOnly:{type:Boolean},ariaLabel:{},ariaLabelledby:{}},emits:["update:modelValue","change","openChange"],setup(t,{emit:n}){var X,se,ie;const l=t,a=n;function o(ne){return String(ne).padStart(2,"0")}function s(ne,me,ye,Me,Ne){if(Ne){const Pe=ne>=12?"PM":"AM",Te=ne%12||12;return Me.replace("hh",o(Te)).replace("mm",o(me)).replace("ss",o(ye)).replace("A",Pe)}return Me.replace("HH",o(ne)).replace("mm",o(me)).replace("ss",o(ye))}function v(ne){if(!ne)return null;const me=ne.toUpperCase(),ye=me.includes("PM"),Ne=me.replace(/(AM|PM)/g,"").trim().split(":").map(Number);if(Ne.some(isNaN))return null;let Pe=Ne[0]??0;const Te=Ne[1]??0,Ue=Ne[2]??0;return ye&&Pe<12&&(Pe+=12),!ye&&me.includes("AM")&&Pe===12&&(Pe=0),{h:Pe,m:Te,s:Ue}}const c=Ce(),r=e.computed(()=>{var ne,me;return((me=(ne=c.value.locale)==null?void 0:ne.input)==null?void 0:me.clear)??"Clear"}),i=e.computed(()=>{var ne,me;return((me=(ne=c.value.locale)==null?void 0:ne.calendar)==null?void 0:me.now)??"Now"}),d=e.computed(()=>l.format??(l.use12Hours?"hh:mm:ss A":l.showSecond?"HH:mm:ss":"HH:mm")),u=e.ref(l.modelValue??l.value??l.defaultValue??"");e.watch(()=>l.modelValue??l.value,ne=>{ne!==void 0&&(u.value=ne)});const p=e.computed(()=>l.modelValue??l.value??u.value),m=e.ref(!1),k=e.computed(()=>l.open??m.value),f=e.computed(()=>v(p.value)),w=e.ref(((X=f.value)==null?void 0:X.h)??0),B=e.ref(((se=f.value)==null?void 0:se.m)??0),E=e.ref(((ie=f.value)==null?void 0:ie.s)??0);e.watch(p,ne=>{const me=v(ne);me&&(w.value=me.h,B.value=me.m,E.value=me.s)});const N=e.ref(null),x=e.ref(null),y=e.ref(null),P=e.ref(null),S=e.computed(()=>{const ne=[];if(l.use12Hours)for(let me=1;me<=12;me+=l.hourStep)ne.push(me);else for(let me=0;me<24;me+=l.hourStep)ne.push(me);return ne}),C=e.computed(()=>{const ne=[];for(let me=0;me<60;me+=l.minuteStep)ne.push(me);return ne}),b=e.computed(()=>{const ne=[];for(let me=0;me<60;me+=l.secondStep)ne.push(me);return ne}),$=e.computed(()=>{var ne;return new Set(((ne=l.disabledHours)==null?void 0:ne.call(l))??[])}),T=e.computed(()=>{var ne;return new Set(((ne=l.disabledMinutes)==null?void 0:ne.call(l,w.value))??[])}),z=e.computed(()=>{var ne;return new Set(((ne=l.disabledSeconds)==null?void 0:ne.call(l,w.value,B.value))??[])}),K=e.computed(()=>l.use12Hours?w.value%12||12:w.value);function L(ne){m.value=ne,a("openChange",ne)}function I(ne,me,ye){const Me=s(ne,me,ye,d.value,l.use12Hours);u.value=Me,a("update:modelValue",Me),a("change",Me)}function U(ne){if($.value.has((l.use12Hours,ne)))return;const me=l.use12Hours?ne===12?w.value>=12?12:0:w.value>=12?ne+12:ne:ne;w.value=me,I(me,B.value,E.value)}function O(ne){T.value.has(ne)||(B.value=ne,I(w.value,ne,E.value))}function q(ne){z.value.has(ne)||(E.value=ne,I(w.value,B.value,ne))}function ae(){const ne=new Date;w.value=ne.getHours(),B.value=ne.getMinutes(),E.value=ne.getSeconds(),I(w.value,B.value,E.value),L(!1)}function G(ne){ne.stopPropagation(),u.value="",a("update:modelValue",""),a("change","")}function Y(){l.disabled||l.loading||L(!0)}function M(ne){k.value&&N.value&&!N.value.contains(ne.target)&&L(!1)}function g(ne){k.value&&ne.key==="Escape"&&L(!1)}e.onMounted(()=>{document.addEventListener("mousedown",M),document.addEventListener("keydown",g)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",M),document.removeEventListener("keydown",g)});function h(ne){var ye;if(!ne)return;const me=ne.querySelector('[data-active="true"]');(ye=me==null?void 0:me.scrollIntoView)==null||ye.call(me,{block:"nearest"})}e.watch([k,w,B,E],async()=>{k.value&&(await e.nextTick(),h(x.value),h(y.value),h(P.value))});const V=e.computed(()=>l.unstyled?"":["sg-timepicker",`sg-timepicker-${l.size}`,k.value?"sg-timepicker-open":"",l.disabled||l.loading?"sg-timepicker-disabled":"",l.loading?"sg-timepicker-loading":""].filter(Boolean).join(" "));function F(){if(w.value>=12){const ne=w.value-12;w.value=ne,I(ne,B.value,E.value)}}function R(){if(w.value<12){const ne=w.value+12;w.value=ne,I(ne,B.value,E.value)}}return(ne,me)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:N,class:e.normalizeClass(V.value)},[e.createElementVNode("div",{class:"sg-timepicker-input",role:"combobox","aria-haspopup":"dialog","aria-expanded":k.value,"aria-disabled":t.disabled,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,onClick:Y},[e.createElementVNode("span",{class:e.normalizeClass(p.value?"":"sg-timepicker-placeholder")},e.toDisplayString(p.value||t.placeholder),3),e.createElementVNode("span",np,[t.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",op)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.allowClear&&p.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:"sg-timepicker-clear",role:"button","aria-label":r.value,onClick:G},"×",8,sp)):e.createCommentVNode("",!0),me[0]||(me[0]=e.createElementVNode("svg",{class:"sg-timepicker-icon",viewBox:"0 0 16 16",width:"14",height:"14",fill:"currentColor","aria-hidden":"true"},[e.createElementVNode("path",{d:"M8 0a8 8 0 1 0 0 16A8 8 0 0 0 8 0zm0 14.5A6.5 6.5 0 1 1 8 1.5a6.5 6.5 0 0 1 0 13zM8.5 4H7v5l4.25 2.5.75-1.23L8.5 8.25V4z"})],-1))],64))])],8,ap),k.value?(e.openBlock(),e.createElementBlock("div",rp,[e.createElementVNode("div",ip,[e.createElementVNode("div",{ref_key:"hourColRef",ref:x,class:"sg-tp-col"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,ye=>(e.openBlock(),e.createElementBlock("div",{key:ye,"data-active":ye===K.value,"data-disabled":$.value.has(ye),class:e.normalizeClass(["sg-tp-cell",ye===K.value?"sg-tp-cell-active":"",$.value.has(ye)?"sg-tp-cell-disabled":""]),"aria-disabled":$.value.has(ye),onClick:Me=>U(ye)},e.toDisplayString(o(ye)),11,cp))),128))],512),e.createElementVNode("div",{ref_key:"minuteColRef",ref:y,class:"sg-tp-col"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,ye=>(e.openBlock(),e.createElementBlock("div",{key:ye,"data-active":ye===B.value,"data-disabled":T.value.has(ye),class:e.normalizeClass(["sg-tp-cell",ye===B.value?"sg-tp-cell-active":"",T.value.has(ye)?"sg-tp-cell-disabled":""]),"aria-disabled":T.value.has(ye),onClick:Me=>O(ye)},e.toDisplayString(o(ye)),11,up))),128))],512),t.showSecond?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"secondColRef",ref:P,class:"sg-tp-col"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,ye=>(e.openBlock(),e.createElementBlock("div",{key:ye,"data-active":ye===E.value,"data-disabled":z.value.has(ye),class:e.normalizeClass(["sg-tp-cell",ye===E.value?"sg-tp-cell-active":"",z.value.has(ye)?"sg-tp-cell-disabled":""]),"aria-disabled":z.value.has(ye),onClick:Me=>q(ye)},e.toDisplayString(o(ye)),11,dp))),128))],512)):e.createCommentVNode("",!0),t.use12Hours?(e.openBlock(),e.createElementBlock("div",mp,[e.createElementVNode("div",{class:e.normalizeClass(["sg-tp-cell",w.value<12?"sg-tp-cell-active":""]),onClick:F},"AM",2),e.createElementVNode("div",{class:e.normalizeClass(["sg-tp-cell",w.value>=12?"sg-tp-cell-active":""]),onClick:R}," PM ",2)])):e.createCommentVNode("",!0)]),t.showNow?(e.openBlock(),e.createElementBlock("div",pp,[e.createElementVNode("button",{type:"button",class:"sg-tp-now-btn",onClick:ae},e.toDisplayString(i.value),1)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),vp=["aria-expanded","aria-disabled"],gp=["aria-label"],fp=e.defineComponent({__name:"TimeRangePicker",props:{modelValue:{},value:{},defaultValue:{},placeholder:{default:()=>["Start","End"]},format:{},use12Hours:{type:Boolean,default:!1},hourStep:{default:1},minuteStep:{default:1},secondStep:{default:1},showSecond:{type:Boolean,default:!0},allowClear:{type:Boolean,default:!0},separator:{default:"→"},open:{type:Boolean,default:void 0},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},size:{default:"middle"},unstyled:{type:Boolean}},emits:["update:modelValue","change","openChange"],setup(t,{emit:n}){const l=t,a=Ce(),o=e.computed(()=>{var y,P;return((P=(y=a.value.locale)==null?void 0:y.input)==null?void 0:P.clear)??"Clear"}),s=n,v=e.computed(()=>l.format??(l.use12Hours?"hh:mm:ss A":l.showSecond?"HH:mm:ss":"HH:mm")),c=e.ref(l.modelValue??l.value??l.defaultValue??["",""]);e.watch(()=>l.modelValue??l.value,y=>{y!==void 0&&(c.value=[...y])});const r=e.computed(()=>l.modelValue??l.value??c.value),i=e.ref(!1),d=e.computed(()=>l.open??i.value),u=e.ref(null);function p(y){i.value=y,s("openChange",y)}function m(y){c.value=y,s("update:modelValue",y),s("change",y)}function k(y){m([y,r.value[1]])}function f(y){m([r.value[0],y])}function w(y){y.stopPropagation(),m(["",""])}function B(){l.disabled||l.loading||p(!0)}function E(y){d.value&&u.value&&!u.value.contains(y.target)&&p(!1)}function N(y){d.value&&y.key==="Escape"&&p(!1)}e.onMounted(()=>{document.addEventListener("mousedown",E),document.addEventListener("keydown",N)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",E),document.removeEventListener("keydown",N)});const x=e.computed(()=>l.unstyled?"":["sg-timepicker","sg-timepicker-range",`sg-timepicker-${l.size}`,d.value?"sg-timepicker-open":"",l.disabled||l.loading?"sg-timepicker-disabled":"",l.loading?"sg-timepicker-loading":""].filter(Boolean).join(" "));return(y,P)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:u,class:e.normalizeClass(x.value)},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-timepicker-input sg-timepicker-range-input"),role:"combobox","aria-haspopup":"dialog","aria-expanded":d.value,"aria-disabled":t.disabled,onClick:B},[e.createElementVNode("span",{class:e.normalizeClass(r.value[0]?"":"sg-timepicker-placeholder")},e.toDisplayString(r.value[0]||t.placeholder[0]),3),e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?"":"sg-timepicker-separator")},e.toDisplayString(t.separator),3),e.createElementVNode("span",{class:e.normalizeClass(r.value[1]?"":"sg-timepicker-placeholder")},e.toDisplayString(r.value[1]||t.placeholder[1]),3),e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?"":"sg-timepicker-suffix")},[t.allowClear&&(r.value[0]||r.value[1])?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(t.unstyled?"":"sg-timepicker-clear"),role:"button","aria-label":o.value,onClick:w},"×",10,gp)):e.createCommentVNode("",!0)],2)],10,vp),d.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.unstyled?"":"sg-tp-dropdown sg-tp-dropdown-range")},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-tp-range-panels")},[e.createVNode(el,{value:r.value[0],format:v.value,"use12-hours":t.use12Hours,"hour-step":t.hourStep,"minute-step":t.minuteStep,"second-step":t.secondStep,"show-second":t.showSecond,"show-now":!1,open:!0,unstyled:t.unstyled,onChange:k},null,8,["value","format","use12-hours","hour-step","minute-step","second-step","show-second","unstyled"]),e.createVNode(el,{value:r.value[1],format:v.value,"use12-hours":t.use12Hours,"hour-step":t.hourStep,"minute-step":t.minuteStep,"second-step":t.secondStep,"show-second":t.showSecond,"show-now":!1,open:!0,unstyled:t.unstyled,onChange:f},null,8,["value","format","use12-hours","hour-step","minute-step","second-step","show-second","unstyled"])],2)],2)):e.createCommentVNode("",!0)],2))}}),hp={class:"sg-calendar-header"},yp={class:"sg-calendar-header-left"},kp=["title","aria-label"],bp=["title","aria-label"],Bp={class:"sg-calendar-header-center"},Cp=["aria-label","value"],wp=["value"],Sp=["aria-label","value"],Ep=["value"],xp={class:"sg-calendar-mode-switch"},$p={class:"sg-calendar-header-right"},Np=["title","aria-label"],Vp=["title","aria-label"],Dp={class:"sg-calendar-body"},zp={key:0,class:"sg-calendar-table"},Tp={key:0,class:"sg-calendar-week-header"},Lp={key:0,class:"sg-calendar-week-number"},Mp=["onClick"],Fp={class:"sg-calendar-cell-inner"},Ap={class:"sg-calendar-cell-date"},Pp={key:0,class:"sg-calendar-cell-events"},Rp=["title"],Ip={key:0,class:"sg-calendar-event-more"},Kp={key:1,class:"sg-calendar-month-grid"},Op=["onClick"],Hp={class:"sg-calendar-month-cell-inner"},jp={class:"sg-calendar-month-cell-name"},_p={key:0,class:"sg-calendar-footer"},Yp=e.defineComponent({__name:"Calendar",props:{modelValue:{},value:{},defaultValue:{},mode:{default:"month"},events:{},maxEvents:{default:3},weekStartDay:{default:0},showWeekNumber:{type:Boolean,default:!1},showWeekNumbers:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!0},disabledDate:{},locale:{},rangeSelection:{type:Boolean,default:!1},rangeValue:{},defaultRangeValue:{},multipleSelection:{type:Boolean,default:!1},multipleValue:{},defaultMultipleValue:{},unstyled:{type:Boolean}},emits:["update:modelValue","select","panelChange","modeChange","change","rangeChange","multipleChange"],setup(t,{emit:n}){const l=t,a=n,o=["January","February","March","April","May","June","July","August","September","October","November","December"],s=["Su","Mo","Tu","We","Th","Fr","Sa"],v=Ce(),c=e.computed(()=>{var Z,te,fe;return((Z=l.locale)==null?void 0:Z.monthNames)??((fe=(te=v.value.locale)==null?void 0:te.calendar)==null?void 0:fe.monthNames)??o}),r=e.computed(()=>{var Z,te,fe;return((Z=l.locale)==null?void 0:Z.dayNames)??((fe=(te=v.value.locale)==null?void 0:te.calendar)==null?void 0:fe.dayNames)??s}),i=e.computed(()=>{var Z,te,fe;return((Z=l.locale)==null?void 0:Z.today)??((fe=(te=v.value.locale)==null?void 0:te.calendar)==null?void 0:fe.today)??"Today"}),d=e.computed(()=>{var Z,te,fe;return((Z=l.locale)==null?void 0:Z.week)??((fe=(te=v.value.locale)==null?void 0:te.calendar)==null?void 0:fe.week)??"W"}),u=e.computed(()=>{var Z,te;return((te=(Z=v.value.locale)==null?void 0:Z.calendar)==null?void 0:te.prevYear)??"Previous year"}),p=e.computed(()=>{var Z,te;return((te=(Z=v.value.locale)==null?void 0:Z.calendar)==null?void 0:te.nextYear)??"Next year"}),m=e.computed(()=>{var Z,te;return((te=(Z=v.value.locale)==null?void 0:Z.calendar)==null?void 0:te.prevMonth)??"Previous month"}),k=e.computed(()=>{var Z,te;return((te=(Z=v.value.locale)==null?void 0:Z.calendar)==null?void 0:te.nextMonth)??"Next month"}),f=e.computed(()=>{var Z,te;return((te=(Z=v.value.locale)==null?void 0:Z.calendar)==null?void 0:te.month)??"Month"}),w=e.computed(()=>{var Z,te;return((te=(Z=v.value.locale)==null?void 0:Z.calendar)==null?void 0:te.year)??"Year"}),B=e.ref(l.modelValue??l.value??l.defaultValue??new Date);e.watch(()=>l.modelValue??l.value,Z=>{Z&&(B.value=Z)});const E=e.computed(()=>l.modelValue??l.value??B.value),N=e.ref(l.rangeValue??l.defaultRangeValue??[null,null]);e.watch(()=>l.rangeValue,Z=>{Z!==void 0&&(N.value=[...Z])});const x=e.computed(()=>l.rangeValue??N.value),y=e.ref([...l.multipleValue??l.defaultMultipleValue??[]]);e.watch(()=>l.multipleValue,Z=>{Z!==void 0&&(y.value=[...Z])});const P=e.computed(()=>l.multipleValue??y.value),S=e.ref(l.mode);e.watch(()=>l.mode,Z=>{S.value=Z});const C=e.computed(()=>S.value);function b(Z,te){return Z.getFullYear()===te.getFullYear()&&Z.getMonth()===te.getMonth()&&Z.getDate()===te.getDate()}function $(Z,te){return Z.getFullYear()===te.getFullYear()&&Z.getMonth()===te.getMonth()}function T(Z){return b(Z,new Date)}function z(Z,te){return new Date(Z,te+1,0).getDate()}function K(Z){const te=new Date(Date.UTC(Z.getFullYear(),Z.getMonth(),Z.getDate())),fe=te.getUTCDay()||7;te.setUTCDate(te.getUTCDate()+4-fe);const Be=new Date(Date.UTC(te.getUTCFullYear(),0,1));return Math.ceil(((te.getTime()-Be.getTime())/864e5+1)/7)}function L(Z,te,fe){const Be=Z.getTime(),Ve=Math.min(te.getTime(),fe.getTime()),De=Math.max(te.getTime(),fe.getTime());return Be>=Ve&&Be<=De}function I(Z,te,fe){if(!te)return!1;if(!fe)return b(Z,te);const Be=te.getTime()<=fe.getTime()?te:fe;return b(Z,Be)}function U(Z,te,fe){if(!te||!fe)return!1;const Be=te.getTime()<=fe.getTime()?fe:te;return b(Z,Be)}const O=e.computed(()=>l.showWeekNumber||l.showWeekNumbers),q=e.ref(E.value);e.watch(E,Z=>{q.value=Z});const ae=e.computed(()=>q.value.getFullYear()),G=e.computed(()=>q.value.getMonth()),Y=e.computed(()=>{const Z=ae.value,te=G.value,fe=z(Z,te),Ve=(new Date(Z,te,1).getDay()-l.weekStartDay+7)%7,De=z(Z,te-1),Ee=[];for(let we=Ve-1;we>=0;we--)Ee.push({date:new Date(Z,te-1,De-we),day:De-we,inMonth:!1});for(let we=1;we<=fe;we++)Ee.push({date:new Date(Z,te,we),day:we,inMonth:!0});const Le=42-Ee.length;for(let we=1;we<=Le;we++)Ee.push({date:new Date(Z,te+1,we),day:we,inMonth:!1});const Fe=[];for(let we=0;we<Ee.length;we+=7)Fe.push(Ee.slice(we,we+7));return Fe}),M=e.computed(()=>{const Z=[];for(let te=ae.value-10;te<=ae.value+10;te++)Z.push(te);return Z});function g(Z){return(l.events??[]).filter(te=>b(te.date,Z))}function h(Z){B.value=Z,q.value=Z,a("update:modelValue",Z),a("select",Z),a("change",Z)}function V(Z){N.value=Z,a("rangeChange",Z)}function F(Z){y.value=Z,a("multipleChange",Z)}function R(Z){var te;if(!((te=l.disabledDate)!=null&&te.call(l,Z))){if(l.rangeSelection){const[fe,Be]=x.value;V(!fe||fe&&Be?[Z,null]:[fe,Z]);return}if(l.multipleSelection){const Be=P.value.some(Ve=>b(Ve,Z))?P.value.filter(Ve=>!b(Ve,Z)):[...P.value,Z];F(Be);return}h(Z)}}function X(Z){const te=new Date(ae.value,Z,1);q.value=te,B.value=te,a("update:modelValue",te),a("select",te),a("change",te),S.value="month",a("modeChange","month"),a("panelChange",te,"month")}function se(Z){const te=new Date(ae.value,G.value+Z,1);q.value=te,a("panelChange",te,C.value)}function ie(Z){const te=new Date(ae.value+Z,G.value,1);q.value=te,a("panelChange",te,C.value)}function ne(Z){S.value=Z,a("modeChange",Z),a("panelChange",q.value,Z)}function me(){R(new Date)}function ye(Z){const te=Number(Z.target.value),fe=new Date(ae.value,te,1);q.value=fe,a("panelChange",fe,C.value)}function Me(Z){const te=Number(Z.target.value),fe=new Date(te,G.value,1);q.value=fe,a("panelChange",fe,C.value)}const Ne=e.computed(()=>{const Z=r.value,te=[];for(let fe=0;fe<7;fe++)te.push(Z[(l.weekStartDay+fe)%7]);return te}),Pe=e.computed(()=>l.unstyled?"":["sg-calendar",l.fullscreen?"sg-calendar-fullscreen":"sg-calendar-mini",`sg-calendar-${C.value}`].filter(Boolean).join(" "));function Te(Z){var we;const[te,fe]=x.value,Be=l.rangeSelection,Ve=Be&&te&&fe?L(Z.date,te,fe):!1,De=Be?I(Z.date,te,fe):!1,Ee=Be?U(Z.date,te,fe):!1,Le=l.multipleSelection?P.value.some(re=>b(re,Z.date)):!1,Fe=!Be&&!l.multipleSelection?b(Z.date,E.value):De||Ee||Le;return["sg-calendar-cell",Z.inMonth?"":"sg-calendar-cell-outside",T(Z.date)?"sg-calendar-cell-today":"",Fe?"sg-calendar-cell-selected":"",Ve?"sg-calendar-cell-in-range":"",De?"sg-calendar-cell-range-start":"",Ee?"sg-calendar-cell-range-end":"",(we=l.disabledDate)!=null&&we.call(l,Z.date)?"sg-calendar-cell-disabled":""].filter(Boolean).join(" ")}function Ue(Z){const te=new Date(ae.value,Z,1);return["sg-calendar-month-cell",$(te,E.value)?"sg-calendar-month-cell-selected":"",$(te,new Date)?"sg-calendar-month-cell-current":""].filter(Boolean).join(" ")}function qe(Z){q.value=Z,a("panelChange",Z,C.value)}return(Z,te)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(Pe.value)},[e.renderSlot(Z.$slots,"header",{value:q.value,type:C.value,onChange:qe,onTypeChange:ne},()=>[e.createElementVNode("div",hp,[e.createElementVNode("div",yp,[e.createElementVNode("button",{type:"button",class:"sg-calendar-nav-btn",title:u.value,"aria-label":u.value,onClick:te[0]||(te[0]=fe=>ie(-1))}," « ",8,kp),C.value==="month"?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"sg-calendar-nav-btn",title:m.value,"aria-label":m.value,onClick:te[1]||(te[1]=fe=>se(-1))}," ‹ ",8,bp)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Bp,[e.createElementVNode("select",{class:"sg-calendar-month-select","aria-label":f.value,value:G.value,onChange:ye},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(fe,Be)=>(e.openBlock(),e.createElementBlock("option",{key:Be,value:Be},e.toDisplayString(fe),9,wp))),128))],40,Cp),e.createElementVNode("select",{class:"sg-calendar-year-select","aria-label":w.value,value:ae.value,onChange:Me},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,fe=>(e.openBlock(),e.createElementBlock("option",{key:fe,value:fe},e.toDisplayString(fe),9,Ep))),128))],40,Sp),e.createElementVNode("div",xp,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["sg-calendar-mode-btn",C.value==="month"?"sg-calendar-mode-btn-active":""]),onClick:te[2]||(te[2]=fe=>ne("month"))},e.toDisplayString(f.value),3),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["sg-calendar-mode-btn",C.value==="year"?"sg-calendar-mode-btn-active":""]),onClick:te[3]||(te[3]=fe=>ne("year"))},e.toDisplayString(w.value),3)])]),e.createElementVNode("div",$p,[C.value==="month"?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"sg-calendar-nav-btn",title:k.value,"aria-label":k.value,onClick:te[4]||(te[4]=fe=>se(1))}," › ",8,Np)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"sg-calendar-nav-btn",title:p.value,"aria-label":p.value,onClick:te[5]||(te[5]=fe=>ie(1))}," » ",8,Vp)])])]),e.createElementVNode("div",Dp,[C.value==="month"?(e.openBlock(),e.createElementBlock("table",zp,[e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[O.value?(e.openBlock(),e.createElementBlock("th",Tp,e.toDisplayString(d.value),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ne.value,fe=>(e.openBlock(),e.createElementBlock("th",{key:fe,class:"sg-calendar-day-header"},e.toDisplayString(fe),1))),128))])]),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.value,(fe,Be)=>(e.openBlock(),e.createElementBlock("tr",{key:Be,class:"sg-calendar-week-row"},[O.value?(e.openBlock(),e.createElementBlock("td",Lp,e.toDisplayString(K(fe[0].date)),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe,Ve=>(e.openBlock(),e.createElementBlock("td",{key:Ve.date.toISOString(),class:e.normalizeClass(Te(Ve)),onClick:De=>R(Ve.date)},[e.createElementVNode("div",Fp,[e.createElementVNode("span",Ap,e.toDisplayString(Ve.day),1),e.renderSlot(Z.$slots,"cell",{date:Ve.date,type:"date"}),g(Ve.date).length>0?(e.openBlock(),e.createElementBlock("div",Pp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g(Ve.date).slice(0,t.maxEvents),(De,Ee)=>(e.openBlock(),e.createElementBlock("span",{key:De.key??De.id??Ee,class:"sg-calendar-event-dot",style:e.normalizeStyle({backgroundColor:De.color??"var(--sg-color-primary, #1677ff)"}),title:De.title},null,12,Rp))),128)),g(Ve.date).length>t.maxEvents?(e.openBlock(),e.createElementBlock("span",Ip,"+"+e.toDisplayString(g(Ve.date).length-t.maxEvents),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])],10,Mp))),128))]))),128))])])):(e.openBlock(),e.createElementBlock("div",Kp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(fe,Be)=>(e.openBlock(),e.createElementBlock("div",{key:Be,class:e.normalizeClass(Ue(Be)),onClick:Ve=>X(Be)},[e.createElementVNode("div",Hp,[e.createElementVNode("span",jp,e.toDisplayString(fe),1),e.renderSlot(Z.$slots,"cell",{date:new Date(ae.value,Be,1),type:"month"})])],10,Op))),128))]))]),t.fullscreen?(e.openBlock(),e.createElementBlock("div",_p,[e.createElementVNode("button",{type:"button",class:"sg-calendar-today-btn",onClick:me},e.toDisplayString(i.value),1)])):e.createCommentVNode("",!0)],2))}}),Wp=["multiple","accept","disabled","aria-label"],Up=["aria-label","onClick"],qp=e.defineComponent({__name:"Upload",props:{modelValue:{},fileList:{},defaultFileList:{},multiple:{type:Boolean,default:!1},accept:{},disabled:{type:Boolean,default:!1},drag:{type:Boolean,default:!1},listType:{default:"text"},showUploadList:{type:Boolean,default:!0},maxCount:{},maxSize:{},beforeUpload:{},customRequest:{},unstyled:{type:Boolean}},emits:["update:modelValue","change","remove"],setup(t,{emit:n}){const l=t,a=n,o=e.ref(l.modelValue??l.fileList??l.defaultFileList??[]);e.watch(()=>l.modelValue??l.fileList,C=>{C!==void 0&&(o.value=C)});const s=e.computed(()=>l.modelValue??l.fileList??o.value),v=e.ref(null),c=e.ref(!1);function r(){return`up_${Date.now()}_${Math.random().toString(36).slice(2,9)}`}function i(C){o.value=C,a("update:modelValue",C),a("change",C)}async function d(C){if(!C)return;const b=Array.from(C),$=[];for(const z of b)l.maxSize!==void 0&&z.size>l.maxSize||l.beforeUpload&&await l.beforeUpload(z,b)===!1||$.push({uid:r(),name:z.name,status:"uploading",size:z.size,type:z.type,percent:0,raw:z});let T=l.multiple?[...s.value,...$]:$.slice(0,1);l.maxCount!==void 0&&(T=T.slice(0,l.maxCount)),i(T);for(const z of $)l.customRequest&&z.raw?l.customRequest({file:z.raw,onProgress:K=>u(z.uid,{percent:K}),onSuccess:()=>u(z.uid,{status:"done",percent:100}),onError:K=>u(z.uid,{status:"error",error:K})}):u(z.uid,{status:"done",percent:100})}function u(C,b){const $=s.value.map(T=>T.uid===C?{...T,...b}:T);i($)}function p(C){const b=s.value.filter($=>$.uid!==C.uid);i(b),a("remove",C)}function m(){var C;l.disabled||(C=v.value)==null||C.click()}function k(C){var b;C.preventDefault(),c.value=!1,!l.disabled&&d(((b=C.dataTransfer)==null?void 0:b.files)??null)}function f(C){C.preventDefault(),!l.disabled&&(c.value=!0)}function w(){c.value=!1}function B(C){const b=C.target;d(b.files),b.value=""}const E=Ce(),N=e.computed(()=>{var C,b;return((b=(C=E.value.locale)==null?void 0:C.upload)==null?void 0:b.uploadAriaLabel)??"Upload file"}),x=e.computed(()=>{var C,b;return((b=(C=E.value.locale)==null?void 0:C.upload)==null?void 0:b.uploadText)??"Upload"}),y=e.computed(()=>{var C,b;return((b=(C=E.value.locale)==null?void 0:C.upload)==null?void 0:b.removeFile)??"Remove file"}),P=e.computed(()=>l.unstyled?"":["sg-upload",`sg-upload-${l.listType}`,l.drag?"sg-upload-drag":"sg-upload-select",l.disabled?"sg-upload-disabled":"",c.value?"sg-upload-dragging":""].filter(Boolean).join(" "));function S(C){return l.unstyled?"":["sg-upload-item",`sg-upload-item-${C.status}`].filter(Boolean).join(" ")}return(C,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(P.value)},[e.createElementVNode("input",{ref_key:"inputRef",ref:v,type:"file",class:"sg-upload-input",multiple:t.multiple,accept:t.accept,disabled:t.disabled,"aria-label":N.value,style:{display:"none"},onChange:B},null,40,Wp),t.drag?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-upload-drag-area",role:"button",tabindex:"0",onClick:m,onDrop:k,onDragover:f,onDragleave:w},[e.renderSlot(C.$slots,"drag",{},()=>[b[0]||(b[0]=e.createElementVNode("p",{class:"sg-upload-drag-icon"},"⬆",-1)),b[1]||(b[1]=e.createElementVNode("p",{class:"sg-upload-drag-text"},"Click or drag file to this area to upload",-1))])],32)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"sg-upload-select-trigger",onClick:m},[e.renderSlot(C.$slots,"default",{},()=>[e.createVNode(Ye,{disabled:t.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(x.value),1)]),_:1},8,["disabled"])])])),t.showUploadList&&s.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(t.unstyled?"":"sg-upload-list")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,$=>(e.openBlock(),e.createElementBlock("div",{key:$.uid,class:e.normalizeClass(S($))},[e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?"":"sg-upload-item-name")},[$.status==="uploading"?(e.openBlock(),e.createBlock(Ct,{key:0,size:"small",unstyled:t.unstyled},null,8,["unstyled"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString($.name),1)],2),$.status==="uploading"?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(t.unstyled?"":"sg-upload-item-progress")},e.toDisplayString($.percent??0)+"%",3)):e.createCommentVNode("",!0),$.status!=="uploading"?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:e.normalizeClass(t.unstyled?"":"sg-upload-item-remove"),"aria-label":`${y.value}: ${$.name}`,onClick:T=>p($)}," × ",10,Up)):e.createCommentVNode("",!0)],2))),128))],2)):e.createCommentVNode("",!0)],2))}}),Xp=["aria-expanded","aria-disabled"],Gp={class:"sg-cascader-selection-wrap"},Jp={key:0,class:"sg-cascader-placeholder"},Zp={key:1,class:"sg-cascader-selection-item"},Qp={key:2,class:"sg-cascader-placeholder"},ev={class:"sg-cascader-tag-label"},tv=["aria-label","onClick"],lv={key:0,class:"sg-cascader-tag sg-cascader-tag-rest"},av=["placeholder"],nv={class:"sg-cascader-actions"},ov=["aria-label"],sv={class:"sg-cascader-arrow"},rv={key:0,class:"sg-cascader-search-list"},iv=["onClick"],cv={class:"sg-cascader-search-label"},uv={key:0,class:"sg-cascader-search-separator"},dv={key:0,class:"sg-cascader-empty"},mv={key:1,class:"sg-cascader-columns"},pv=["onClick","onMouseenter"],vv={class:"sg-cascader-option-label"},gv={key:1,class:"sg-cascader-option-expand sg-cascader-option-spinner","aria-hidden":"true"},fv={key:2,class:"sg-cascader-option-expand sg-cascader-menu-item-expand","aria-hidden":"true"},hv=e.defineComponent({__name:"Cascader",props:{options:{},modelValue:{},value:{},defaultValue:{},placeholder:{default:"Please select"},disabled:{type:Boolean,default:!1},allowClear:{type:Boolean,default:!0},showSearch:{type:[Boolean,Object],default:!1},expandTrigger:{default:"click"},changeOnSelect:{type:Boolean,default:!1},displayRender:{},multiple:{type:Boolean,default:!1},maxTagCount:{},loadData:{},dropdownStyle:{},unstyled:{type:Boolean},size:{default:"middle"}},emits:["update:modelValue","change"],setup(t,{emit:n}){const l=t,a=n,o=Ce(),s=e.computed(()=>{var g,h;return((h=(g=o.value.locale)==null?void 0:g.cascader)==null?void 0:h.clear)??"Clear"}),v=e.computed(()=>{var g,h;return((h=(g=o.value.locale)==null?void 0:g.cascader)==null?void 0:h.removeTag)??"Remove"});function c(g,h){return g.length!==h.length?!1:g.every((V,F)=>V===h[F])}function r(g,h){return g.find(V=>V.value===h)}function i(g,h){const V=[];let F=g;for(const R of h){const X=r(F,R);if(!X)break;V.push(X),F=X.children??[]}return V}function d(g,h){const V=[],F=(R,X)=>{for(const se of R){if(se.disabled)continue;const ie=[...X,se],ne=se.isLeaf!==!1&&(!se.children||se.children.length===0);(!h||ne)&&V.push({path:ie,values:ie.map(me=>me.value)}),se.children&&se.children.length>0&&F(se.children,ie)}};return F(g,[]),V}function u(g,h){const V=g.toLowerCase();return h.some(F=>F.label.toLowerCase().includes(V))}const p=e.ref(l.modelValue??l.value??l.defaultValue??[]);e.watch(()=>l.modelValue??l.value,g=>{g!==void 0&&(p.value=g)});const m=e.computed(()=>l.modelValue??l.value??p.value),k=e.ref(l.multiple&&(l.modelValue??l.value??l.defaultValue??[]).length>0?[l.modelValue??l.value??l.defaultValue??[]]:[]),f=e.ref(!1),w=e.ref([l.options]),B=e.ref([]),E=e.ref(""),N=e.ref(new Set),x=e.ref(null),y=e.ref(null);function P(g){const h=[l.options];let V=l.options;const F=[];for(const R of g){const X=r(V,R);if(!X)break;if(F.push(R),X.children&&X.children.length>0)h.push(X.children),V=X.children;else break}w.value=h,B.value=F}e.watch(f,async g=>{var h;g&&(P(m.value),l.showSearch&&(await e.nextTick(),(h=y.value)==null||h.focus()))}),e.watch(()=>l.options,()=>{P(B.value)});function S(g){p.value=g,a("update:modelValue",g),a("change",g,i(l.options,g))}function C(g,h){if(g.disabled)return;const V=[...B.value.slice(0,h),g.value];B.value=V;const F=[...w.value.slice(0,h+1)];g.children&&g.children.length>0&&F.push(g.children),w.value=F;const R=g.isLeaf!==!1&&(!g.children||g.children.length===0);if(l.loadData&&g.isLeaf===!1&&(!g.children||g.children.length===0)){const X=i(l.options,V);N.value=new Set([...N.value,g.value]),l.loadData(X),setTimeout(()=>{const se=new Set(N.value);se.delete(g.value),N.value=se,P(V)},0)}if(l.multiple){if(R){const X=i(l.options,V);k.value.some(ie=>c(ie,V))?k.value=k.value.filter(ie=>!c(ie,V)):k.value=[...k.value,V],a("change",V,X)}return}(R||l.changeOnSelect)&&(S(V),R&&(f.value=!1,E.value=""))}function b(g,h){if(l.expandTrigger!=="hover"||g.disabled)return;const V=[...B.value.slice(0,h),g.value];B.value=V;const F=[...w.value.slice(0,h+1)];g.children&&g.children.length>0&&F.push(g.children),w.value=F}function $(g){g.stopPropagation(),!l.disabled&&(l.multiple&&(k.value=[]),S([]),E.value="")}function T(g,h){h.stopPropagation(),!l.disabled&&(k.value=k.value.filter((V,F)=>F!==g))}function z(){l.disabled||(f.value=!f.value)}function K(g){x.value&&!x.value.contains(g.target)&&(f.value=!1,E.value="")}e.onMounted(()=>document.addEventListener("mousedown",K)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",K));const L=e.computed(()=>l.showSearch?typeof l.showSearch=="object"&&l.showSearch.filter?l.showSearch.filter:u:null),I=e.computed(()=>!E.value||!L.value?null:d(l.options,!l.changeOnSelect).filter(({path:h})=>L.value(E.value,h)));function U(g,h){l.multiple?(k.value.some(F=>c(F,g))?k.value=k.value.filter(F=>!c(F,g)):k.value=[...k.value,g],a("change",g,h)):(S(g),f.value=!1,E.value="")}const O=e.computed(()=>{if(l.multiple||m.value.length===0)return"";const g=i(l.options,m.value);if(g.length===0)return"";const h=g.map(V=>V.label);return l.displayRender?l.displayRender(h,g):h.join(" / ")});function q(g){return k.value.some(h=>c(h,g))}const ae=e.computed(()=>l.maxTagCount!==void 0&&l.multiple?k.value.slice(0,l.maxTagCount):k.value),G=e.computed(()=>l.maxTagCount!==void 0&&l.multiple?Math.max(0,k.value.length-l.maxTagCount):0),Y=e.computed(()=>l.unstyled?"":["sg-cascader",`sg-cascader-${l.size}`,f.value?"sg-cascader-open":"",l.disabled?"sg-cascader-disabled":"",l.multiple?"sg-cascader-multiple":""].filter(Boolean).join(" "));function M(g){return i(l.options,g).map(h=>h.label).join(" / ")}return(g,h)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:x,class:e.normalizeClass(Y.value)},[e.createElementVNode("div",{class:"sg-cascader-selector",role:"combobox","aria-expanded":f.value,"aria-disabled":t.disabled,tabindex:"0",onClick:z},[e.createElementVNode("div",Gp,[!t.multiple&&!O.value&&!E.value&&!(t.showSearch&&f.value)?(e.openBlock(),e.createElementBlock("span",Jp,e.toDisplayString(t.placeholder),1)):e.createCommentVNode("",!0),!t.multiple&&O.value&&!E.value?(e.openBlock(),e.createElementBlock("span",Zp,e.toDisplayString(O.value),1)):e.createCommentVNode("",!0),t.multiple&&k.value.length===0&&!E.value&&!(t.showSearch&&f.value)?(e.openBlock(),e.createElementBlock("span",Qp,e.toDisplayString(t.placeholder),1)):e.createCommentVNode("",!0),t.multiple?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,(V,F)=>(e.openBlock(),e.createElementBlock("span",{key:V.join("-")+F,class:"sg-cascader-tag"},[e.createElementVNode("span",ev,e.toDisplayString(M(V)),1),e.createElementVNode("span",{class:"sg-cascader-tag-close",role:"button","aria-label":v.value,onClick:R=>T(F,R)},"×",8,tv)]))),128)),G.value>0?(e.openBlock(),e.createElementBlock("span",lv," +"+e.toDisplayString(G.value)+"... ",1)):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0),t.showSearch&&f.value?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:4,ref_key:"searchInputRef",ref:y,"onUpdate:modelValue":h[0]||(h[0]=V=>E.value=V),class:"sg-cascader-search-input",placeholder:t.placeholder},null,8,av)),[[e.vModelText,E.value]]):e.createCommentVNode("",!0)]),e.createElementVNode("div",nv,[t.allowClear&&(m.value.length>0||k.value.length>0)?(e.openBlock(),e.createElementBlock("span",{key:0,class:"sg-cascader-clear",role:"button","aria-label":s.value,onClick:$},"×",8,ov)):e.createCommentVNode("",!0),e.createElementVNode("span",sv,e.toDisplayString(f.value?"▲":"▼"),1)])],8,Xp),f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-cascader-dropdown",style:e.normalizeStyle(t.dropdownStyle)},[I.value?(e.openBlock(),e.createElementBlock("div",rv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,({path:V,values:F})=>(e.openBlock(),e.createElementBlock("div",{key:F.join("-"),class:e.normalizeClass(["sg-cascader-search-item",t.multiple&&q(F)?"sg-cascader-search-item-checked":""]),onClick:R=>U(F,V)},[t.multiple?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["sg-cascader-search-check",q(F)?"sg-cascader-search-check-active":""])},e.toDisplayString(q(F)?"✓":""),3)):e.createCommentVNode("",!0),e.createElementVNode("span",cv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V,(R,X)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:R.value},[X>0?(e.openBlock(),e.createElementBlock("span",uv," / ")):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(R.label),1)],64))),128))])],10,iv))),128)),I.value.length===0?(e.openBlock(),e.createElementBlock("div",dv,"No matches")):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",mv,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(w.value,(V,F)=>(e.openBlock(),e.createElementBlock("ul",{key:F,class:"sg-cascader-column sg-cascader-menu"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V,R=>{var X;return e.openBlock(),e.createElementBlock("li",{key:String(R.value),class:e.normalizeClass(["sg-cascader-option sg-cascader-menu-item",B.value[F]===R.value?"sg-cascader-option-active sg-cascader-menu-item-active":"",R.disabled?"sg-cascader-option-disabled sg-cascader-menu-item-disabled":"",N.value.has(R.value)?"sg-cascader-option-loading":""]),onClick:se=>C(R,F),onMouseenter:se=>b(R,F)},[t.multiple?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["sg-cascader-option-check",k.value.some(se=>se[F]===R.value&&se.length===F+1)?"sg-cascader-option-check-active":""])},e.toDisplayString(k.value.some(se=>se[F]===R.value&&se.length===F+1)?"✓":""),3)):e.createCommentVNode("",!0),e.createElementVNode("span",vv,e.toDisplayString(R.label),1),N.value.has(R.value)?(e.openBlock(),e.createElementBlock("span",gv,"⟳")):(X=R.children)!=null&&X.length||R.isLeaf===!1?(e.openBlock(),e.createElementBlock("span",fv,"›")):e.createCommentVNode("",!0)],42,pv)}),128))]))),128))]))],4)):e.createCommentVNode("",!0)],2))}}),yv={key:0},kv={key:1},bv=["onClick"],Bv={key:0},Cv=["value","placeholder"],wv={class:"sg-treeselect-selection-wrap"},Sv={key:0,class:"sg-treeselect-placeholder"},Ev={key:1,class:"sg-treeselect-selection-item"},xv={class:"sg-treeselect-tag-label"},$v=["onClick"],Nv={key:3,class:"sg-treeselect-tag sg-treeselect-tag-rest"},Vv=["value","placeholder"],Dv={class:"sg-treeselect-actions"},zv={class:"sg-treeselect-arrow"},Tv={key:0,class:"sg-treeselect-empty"},Lv=e.defineComponent({__name:"TreeSelect",props:{treeData:{},modelValue:{},value:{},defaultValue:{},fieldNames:{},multiple:{type:Boolean,default:!1},treeCheckable:{type:Boolean,default:!1},treeCheckStrictly:{type:Boolean,default:!1},treeDefaultExpandAll:{type:Boolean,default:!1},treeDefaultExpandedKeys:{},defaultExpandedKeys:{},showSearch:{type:Boolean,default:!1},filterTreeNode:{},placeholder:{default:"Please select"},allowClear:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{default:"middle"},maxTagCount:{},dropdownStyle:{},treeLine:{type:Boolean,default:!1},showCheckedStrategy:{default:"SHOW_ALL"},className:{},unstyled:{type:Boolean}},emits:["update:modelValue","change","search"],setup(t,{emit:n}){const l=t,a=n;function o(h){return h===void 0||h===""||h===null?[]:Array.isArray(h)?h:[h]}function s(h,V){for(const F of h){if(F.key===V)return F;if(F.children){const R=s(F.children,V);if(R)return R}}}function v(h){return h?typeof h.title=="string"?h.title:String(h.key):""}function c(h){const V=[],F=R=>{for(const X of R)V.push(X.key),X.children&&F(X.children)};return F(h),V}function r(h){const V=[],F=R=>{for(const X of R)X.children&&X.children.length>0&&(V.push(X.key),F(X.children))};return F(h),V}function i(h,V){const F=[];for(const R of h){const X=R.children?i(R.children,V):[];(V(R)||X.length>0)&&F.push({...R,children:X.length>0?X:void 0})}return F}function d(h,V){const F=[],R=(X,se)=>{for(const ie of X){if(ie.key===V)return F.push(...se),!0;if(ie.children&&R(ie.children,[...se,ie.key]))return!0}return!1};return R(h,[]),F}function u(h,V,F){if(F==="SHOW_ALL")return h;const R=new Set(h);return F==="SHOW_CHILD"?h.filter(X=>{const se=s(V,X);return!(se!=null&&se.children)||se.children.length===0}):F==="SHOW_PARENT"?h.filter(X=>!d(V,X).some(ie=>R.has(ie))):h}const p=e.computed(()=>l.multiple||l.treeCheckable),m=e.computed(()=>l.modelValue??l.value),k=e.ref(o(m.value??l.defaultValue));e.watch(m,h=>{h!==void 0&&(k.value=o(h))});const f=e.computed(()=>m.value!==void 0?o(m.value):k.value),w=e.ref(!1),B=e.ref(""),E=e.useTemplateRef("wrapperRef"),N=e.useTemplateRef("searchRef"),x=(h,V)=>(typeof V.title=="string"?V.title:String(V.key)).toLowerCase().includes(h.toLowerCase()),y=e.computed(()=>l.filterTreeNode??x),P=e.computed(()=>B.value?i(l.treeData,h=>y.value(B.value,h)):l.treeData),S=e.computed(()=>B.value?c(P.value):void 0),C=e.computed(()=>{if(l.treeDefaultExpandedKeys&&l.treeDefaultExpandedKeys.length>0)return l.treeDefaultExpandedKeys;if(l.defaultExpandedKeys&&l.defaultExpandedKeys.length>0)return l.defaultExpandedKeys;if(l.treeDefaultExpandAll)return r(l.treeData)}),b=e.computed(()=>l.treeCheckable?f.value:void 0),$=e.computed(()=>l.treeCheckable?void 0:f.value),T=e.computed(()=>p.value?u(f.value,l.treeData,l.showCheckedStrategy):f.value),z=e.computed(()=>l.maxTagCount!==void 0&&p.value?T.value.slice(0,l.maxTagCount):T.value),K=e.computed(()=>l.maxTagCount!==void 0&&p.value?Math.max(0,T.value.length-l.maxTagCount):0);function L(h,V){k.value=h;const F=h.map(X=>v(s(l.treeData,X))),R=p.value?h:h[0]??"";a("update:modelValue",R),a("change",R,F,{triggerNode:V})}function I(h,V){if(l.treeCheckable)return;const F=V.node;if(p.value){const R=V.selected?[...f.value,F.key]:f.value.filter(X=>X!==F.key);L(R,F)}else L([F.key],F),w.value=!1,B.value=""}function U(h,V){const F=u(h,l.treeData,l.showCheckedStrategy);L(F,V.node)}function O(h,V){if(V.stopPropagation(),l.disabled)return;const F=s(l.treeData,h)??{key:h},R=f.value.filter(X=>X!==h);L(R,F)}function q(h){if(h.stopPropagation(),l.disabled)return;const V=l.treeData[0]??{key:""};L([],V),B.value=""}function ae(h){const V=h.target.value;B.value=V,a("search",V)}function G(){l.disabled||(w.value=!w.value)}function Y(h){E.value&&(E.value.contains(h.target)||(w.value=!1,B.value=""))}e.onMounted(()=>document.addEventListener("mousedown",Y)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",Y)),e.watch(w,h=>{h&&l.showSearch&&e.nextTick(()=>{var V;return(V=N.value)==null?void 0:V.focus()})});const M=e.computed(()=>l.unstyled?l.className??"":["sg-treeselect",`sg-treeselect-${l.size}`,w.value?"sg-treeselect-open":"",l.disabled?"sg-treeselect-disabled":"",p.value?"sg-treeselect-multiple":"",l.className].filter(Boolean).join(" "));function g(h){return v(s(l.treeData,h))}return(h,V)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:E,class:e.normalizeClass(M.value)},[t.unstyled?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",{onClick:G},[T.value.length===0?(e.openBlock(),e.createElementBlock("span",yv,e.toDisplayString(t.placeholder),1)):p.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(T.value,F=>(e.openBlock(),e.createElementBlock("span",{key:String(F)},[e.createTextVNode(e.toDisplayString(g(F))+" ",1),e.createElementVNode("span",{onClick:R=>O(F,R)},"×",8,bv)]))),128)):(e.openBlock(),e.createElementBlock("span",kv,e.toDisplayString(g(T.value[0])),1))]),w.value?(e.openBlock(),e.createElementBlock("div",Bv,[t.showSearch?(e.openBlock(),e.createElementBlock("input",{key:0,ref_key:"searchRef",ref:N,value:B.value,placeholder:t.placeholder,onInput:ae},null,40,Cv)):e.createCommentVNode("",!0),e.createVNode(Zt,{"tree-data":P.value,"field-names":t.fieldNames,checkable:t.treeCheckable,"check-strictly":t.treeCheckStrictly,"checked-keys":b.value,"selected-keys":$.value,multiple:p.value,"default-expand-all":t.treeDefaultExpandAll&&!C.value,"default-expanded-keys":C.value,"expanded-keys":S.value,"show-line":t.treeLine,unstyled:"",onSelect:I,onCheck:U},null,8,["tree-data","field-names","checkable","check-strictly","checked-keys","selected-keys","multiple","default-expand-all","default-expanded-keys","expanded-keys","show-line"])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"sg-treeselect-selector",onClick:G},[e.createElementVNode("div",wv,[T.value.length===0&&!B.value&&!(t.showSearch&&w.value)?(e.openBlock(),e.createElementBlock("span",Sv,e.toDisplayString(t.placeholder),1)):e.createCommentVNode("",!0),!p.value&&T.value.length>0&&!B.value?(e.openBlock(),e.createElementBlock("span",Ev,e.toDisplayString(g(T.value[0])),1)):e.createCommentVNode("",!0),p.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(z.value,F=>(e.openBlock(),e.createElementBlock("span",{key:String(F),class:"sg-treeselect-tag"},[e.createElementVNode("span",xv,e.toDisplayString(g(F)),1),e.createElementVNode("span",{class:"sg-treeselect-tag-close",onClick:R=>O(F,R)},"×",8,$v)]))),128)):e.createCommentVNode("",!0),K.value>0?(e.openBlock(),e.createElementBlock("span",Nv,"+"+e.toDisplayString(K.value)+"...",1)):e.createCommentVNode("",!0),t.showSearch&&w.value?(e.openBlock(),e.createElementBlock("input",{key:4,ref_key:"searchRef",ref:N,class:"sg-treeselect-search-input",value:B.value,placeholder:T.value.length===0?t.placeholder:"",onInput:ae},null,40,Vv)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Dv,[t.allowClear&&T.value.length>0?(e.openBlock(),e.createElementBlock("span",{key:0,class:"sg-treeselect-clear",onClick:q},"×")):e.createCommentVNode("",!0),e.createElementVNode("span",zv,e.toDisplayString(w.value?"▲":"▼"),1)])]),w.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-treeselect-dropdown",style:e.normalizeStyle(t.dropdownStyle)},[P.value.length===0?(e.openBlock(),e.createElementBlock("div",Tv,"No matches")):(e.openBlock(),e.createBlock(Zt,{key:1,"tree-data":P.value,"field-names":t.fieldNames,checkable:t.treeCheckable,"check-strictly":t.treeCheckStrictly,"checked-keys":b.value,"selected-keys":$.value,multiple:p.value,"default-expand-all":t.treeDefaultExpandAll&&!C.value,"default-expanded-keys":C.value,"expanded-keys":S.value,"show-line":t.treeLine,onSelect:I,onCheck:U},null,8,["tree-data","field-names","checkable","check-strictly","checked-keys","selected-keys","multiple","default-expand-all","default-expanded-keys","expanded-keys","show-line"]))],4)):e.createCommentVNode("",!0)],64))],2))}}),Mv=["onClick"],Fv=["onClick"],Av=e.defineComponent({__name:"Transfer",props:{dataSource:{},modelValue:{},targetKeys:{},defaultTargetKeys:{},showSearch:{type:Boolean,default:!1},filterOption:{},searchPlaceholder:{},titles:{default:()=>["Source","Target"]},disabled:{type:Boolean,default:!1},oneWay:{type:Boolean,default:!1},showSelectAll:{type:Boolean,default:!0},showCount:{type:Boolean,default:!0},pagination:{type:[Boolean,Object]},listHeight:{},locale:{},unstyled:{type:Boolean}},emits:["update:modelValue","change","selectChange","search"],setup(t,{emit:n}){const l={itemUnit:"item",itemsUnit:"items",searchPlaceholder:"Search here",notFoundContent:"Not Found",selectAll:"Select all",deselectAll:"Deselect all"},a=t,o=n,s=e.computed(()=>({...l,...a.locale??{}})),v=e.computed(()=>a.searchPlaceholder??s.value.searchPlaceholder),c=e.ref(a.modelValue??a.targetKeys??a.defaultTargetKeys??[]);e.watch(()=>a.modelValue??a.targetKeys,g=>{g!==void 0&&(c.value=g)});const r=e.computed(()=>a.modelValue??a.targetKeys??c.value),i=e.ref([]),d=e.ref([]),u=e.ref(""),p=e.ref(""),m=e.ref(1),k=e.ref(1);e.watch(u,()=>{m.value=1}),e.watch(p,()=>{k.value=1});const f=e.computed(()=>a.dataSource.filter(g=>!r.value.includes(g.key))),w=e.computed(()=>a.dataSource.filter(g=>r.value.includes(g.key)));function B(g,h){if(!h)return g;if(a.filterOption)return g.filter(F=>a.filterOption(h,F));const V=h.toLowerCase();return g.filter(F=>F.title.toLowerCase().includes(V))}const E=e.computed(()=>B(f.value,u.value)),N=e.computed(()=>B(w.value,p.value));function x(){return a.pagination?typeof a.pagination=="object"&&a.pagination.pageSize?a.pagination.pageSize:10:1/0}const y=e.computed(()=>x());function P(g,h){if(!a.pagination)return g;const V=Math.max(1,Math.ceil(g.length/y.value)),R=(Math.min(h,V)-1)*y.value;return g.slice(R,R+y.value)}const S=e.computed(()=>P(E.value,m.value)),C=e.computed(()=>P(N.value,k.value));function b(g,h){const V=g.filter(R=>h.includes(R.key)).length,F=g.length===1?s.value.itemUnit:s.value.itemsUnit;return V>0?`${V}/${g.length} ${F}`:`${g.length} ${F}`}function $(g){return g.filter(h=>!h.disabled&&!a.disabled).map(h=>h.key)}function T(g,h){const V=$(g);return V.length>0&&V.every(F=>h.includes(F))}function z(g,h){return $(g).some(R=>h.includes(R))&&!T(g,h)}function K(g,h){if(a.disabled||g.disabled)return;const V=h==="left"?i:d,F=new Set(V.value);F.has(g.key)?F.delete(g.key):F.add(g.key),V.value=Array.from(F),o("selectChange",i.value,d.value)}function L(g,h){if(a.disabled)return;const V=g==="left"?E.value:N.value,F=g==="left"?i:d,R=$(V);if(h)F.value=Array.from(new Set([...F.value,...R]));else{const X=new Set(R);F.value=F.value.filter(se=>!X.has(se))}o("selectChange",i.value,d.value)}function I(){const g=i.value.filter(V=>{const F=a.dataSource.find(R=>R.key===V);return F&&!F.disabled});if(g.length===0)return;const h=[...r.value,...g];c.value=h,o("update:modelValue",h),o("change",h,"right",g),i.value=[],o("selectChange",[],d.value)}function U(){if(a.oneWay)return;const g=d.value.filter(F=>{const R=a.dataSource.find(X=>X.key===F);return R&&!R.disabled});if(g.length===0)return;const h=new Set(g),V=r.value.filter(F=>!h.has(F));c.value=V,o("update:modelValue",V),o("change",V,"left",g),d.value=[],o("selectChange",i.value,[])}const O=e.computed(()=>i.value.some(g=>{const h=a.dataSource.find(V=>V.key===g);return h&&!h.disabled})),q=e.computed(()=>!a.oneWay&&d.value.some(g=>{const h=a.dataSource.find(V=>V.key===g);return h&&!h.disabled}));function ae(g){u.value=g,o("search","left",g)}function G(g){p.value=g,o("search","right",g)}const Y=e.computed(()=>a.unstyled?"":["sg-transfer",a.disabled?"sg-transfer-disabled":""].filter(Boolean).join(" "));function M(g,h){return a.unstyled?"":["sg-transfer-list-item",h.includes(g.key)?"sg-transfer-list-item-selected":"",a.disabled||g.disabled?"sg-transfer-list-item-disabled":""].filter(Boolean).join(" ")}return(g,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(Y.value)},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-transfer-list")},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-header")},[t.showSelectAll?(e.openBlock(),e.createBlock(at,{key:0,checked:T(E.value,i.value),indeterminate:z(E.value,i.value),disabled:t.disabled||$(E.value).length===0,onChange:h[0]||(h[0]=V=>L("left",V))},null,8,["checked","indeterminate","disabled"])):e.createCommentVNode("",!0),t.showCount?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-header-count")},e.toDisplayString(b(E.value,i.value)),3)):e.createCommentVNode("",!0),t.titles[0]?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-header-title")},e.toDisplayString(t.titles[0]),3)):e.createCommentVNode("",!0)],2),t.showSearch?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-search")},[e.createVNode(Mt,{size:"small","model-value":u.value,placeholder:v.value,"allow-clear":"","onUpdate:modelValue":ae},null,8,["model-value","placeholder"])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-body"),style:e.normalizeStyle(t.listHeight?{height:`${t.listHeight}px`,overflow:"auto"}:void 0)},[S.value.length===0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-empty")},e.toDisplayString(s.value.notFoundContent),3)):(e.openBlock(),e.createElementBlock("ul",{key:1,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-content")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:e.normalizeClass(M(V,i.value)),onClick:F=>K(V,"left")},[e.createVNode(at,{checked:i.value.includes(V.key),disabled:t.disabled||V.disabled,onClick:h[1]||(h[1]=e.withModifiers(()=>{},["stop"])),onChange:()=>K(V,"left")},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-item-text")},[e.renderSlot(g.$slots,"item",{item:V,side:"left"},()=>[e.createTextVNode(e.toDisplayString(V.title),1)])],2)]),_:2},1032,["checked","disabled","onChange"])],10,Mv))),128))],2))],6),t.pagination&&E.value.length>y.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-pagination")},[e.createVNode(bt,{current:m.value,total:E.value.length,"page-size":y.value,simple:"",onChange:h[2]||(h[2]=V=>m.value=V)},null,8,["current","total","page-size"])],2)):e.createCommentVNode("",!0)],2),e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-transfer-operations")},[e.createVNode(Ye,{type:"primary",size:"small",disabled:t.disabled||!O.value,onClick:I},{default:e.withCtx(()=>[...h[6]||(h[6]=[e.createTextVNode("›",-1)])]),_:1},8,["disabled"]),t.oneWay?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ye,{key:0,type:"primary",size:"small",disabled:t.disabled||!q.value,onClick:U},{default:e.withCtx(()=>[...h[7]||(h[7]=[e.createTextVNode("‹",-1)])]),_:1},8,["disabled"]))],2),e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-transfer-list")},[e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-header")},[t.showSelectAll?(e.openBlock(),e.createBlock(at,{key:0,checked:T(N.value,d.value),indeterminate:z(N.value,d.value),disabled:t.disabled||$(N.value).length===0,onChange:h[3]||(h[3]=V=>L("right",V))},null,8,["checked","indeterminate","disabled"])):e.createCommentVNode("",!0),t.showCount?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-header-count")},e.toDisplayString(b(N.value,d.value)),3)):e.createCommentVNode("",!0),t.titles[1]?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-header-title")},e.toDisplayString(t.titles[1]),3)):e.createCommentVNode("",!0)],2),t.showSearch?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-search")},[e.createVNode(Mt,{size:"small","model-value":p.value,placeholder:v.value,"allow-clear":"","onUpdate:modelValue":G},null,8,["model-value","placeholder"])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-body"),style:e.normalizeStyle(t.listHeight?{height:`${t.listHeight}px`,overflow:"auto"}:void 0)},[C.value.length===0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-empty")},e.toDisplayString(s.value.notFoundContent),3)):(e.openBlock(),e.createElementBlock("ul",{key:1,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-content")},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:e.normalizeClass(M(V,d.value)),onClick:F=>K(V,"right")},[e.createVNode(at,{checked:d.value.includes(V.key),disabled:t.disabled||V.disabled,onClick:h[4]||(h[4]=e.withModifiers(()=>{},["stop"])),onChange:()=>K(V,"right")},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-item-text")},[e.renderSlot(g.$slots,"item",{item:V,side:"right"},()=>[e.createTextVNode(e.toDisplayString(V.title),1)])],2)]),_:2},1032,["checked","disabled","onChange"])],10,Fv))),128))],2))],6),t.pagination&&N.value.length>y.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(t.unstyled?"":"sg-transfer-list-pagination")},[e.createVNode(bt,{current:k.value,total:N.value.length,"page-size":y.value,simple:"",onChange:h[5]||(h[5]=V=>k.value=V)},null,8,["current","total","page-size"])],2)):e.createCommentVNode("",!0)],2)],2))}}),Pv=["value","placeholder","rows","disabled"],Rv=["aria-selected","onMousedown","onMouseenter"],Iv=e.defineComponent({__name:"Mentions",props:{modelValue:{},value:{},defaultValue:{},placeholder:{},prefix:{default:"@"},rows:{default:3},options:{default:()=>[]},placement:{default:"bottom"},disabled:{type:Boolean},size:{},unstyled:{type:Boolean}},emits:["update:modelValue","change","search","select"],setup(t,{emit:n}){const l=t,a=n,{resolvedSize:o,resolvedDisabled:s}=_e(l,{}),v=e.ref(l.modelValue??l.value??l.defaultValue??"");e.watch(()=>l.modelValue??l.value,P=>{P!==void 0&&(v.value=P)});const c=e.computed(()=>l.modelValue??l.value??v.value),r=e.ref(!1),i=e.ref(""),d=e.ref(""),u=e.ref(0),p=e.ref(0),m=e.ref(null),k=e.ref(null),f=e.computed(()=>Array.isArray(l.prefix)?l.prefix:[l.prefix]);function w(P){const S=P.target,C=S.value;v.value=C,a("update:modelValue",C),a("change",C);const b=S.selectionStart??C.length,$=C.slice(0,b);for(const T of f.value){const z=$.lastIndexOf(T);if(z>=0){const K=z>0?$[z-1]:" ";if(K===" "||K===`
22
+ `||z===0){const L=$.slice(z+T.length);if(!L.includes(" ")){d.value=T,i.value=L,u.value=z,r.value=!0,p.value=0,a("search",L,T);return}}}}r.value=!1}const B=e.computed(()=>l.options.filter(P=>!i.value||(P.label??P.value).toLowerCase().includes(i.value.toLowerCase())));function E(P){if(P.disabled)return;const S=c.value,C=S.slice(0,u.value),b=S.slice(u.value+d.value.length+i.value.length),$=`${d.value}${P.value} `,T=C+$+b;v.value=T,a("update:modelValue",T),a("change",T),a("select",P,d.value),r.value=!1,e.nextTick(()=>{if(m.value){const z=C.length+$.length;m.value.focus(),m.value.setSelectionRange(z,z)}})}function N(P){!r.value||B.value.length===0||(P.key==="ArrowDown"?(P.preventDefault(),p.value=(p.value+1)%B.value.length):P.key==="ArrowUp"?(P.preventDefault(),p.value=(p.value-1+B.value.length)%B.value.length):P.key==="Enter"?(P.preventDefault(),E(B.value[p.value])):P.key==="Escape"&&(r.value=!1))}function x(P){k.value&&!k.value.contains(P.target)&&m.value&&!m.value.contains(P.target)&&(r.value=!1)}e.onMounted(()=>{document.addEventListener("mousedown",x)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",x)});const y=e.computed(()=>l.unstyled?"":["sg-mentions",`sg-mentions-${o.value}`,s.value?"sg-mentions-disabled":""].filter(Boolean).join(" "));return(P,S)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(y.value)},[e.createElementVNode("textarea",{ref_key:"textareaRef",ref:m,class:e.normalizeClass(t.unstyled?"":"sg-input sg-textarea"),value:c.value,placeholder:t.placeholder,rows:t.rows,disabled:e.unref(s),onInput:w,onKeydown:N},null,42,Pv),r.value&&B.value.length?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:k,class:e.normalizeClass(t.unstyled?"":`sg-mentions-dropdown sg-mentions-dropdown-${t.placement}`),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,(C,b)=>(e.openBlock(),e.createElementBlock("div",{key:C.value,class:e.normalizeClass(t.unstyled?"":["sg-mentions-option",b===p.value?"sg-mentions-option-active":"",C.disabled?"sg-mentions-option-disabled":""].filter(Boolean).join(" ")),role:"option","aria-selected":b===p.value,onMousedown:e.withModifiers($=>E(C),["prevent"]),onMouseenter:$=>p.value=b},e.toDisplayString(C.label??C.value),43,Rv))),128))],2)):e.createCommentVNode("",!0)],2))}});function pa(t){for(const n of t)if(!(n.type===e.Comment||n.type===e.Text)){if(n.type===e.Fragment&&Array.isArray(n.children)){const l=pa(n.children);if(l)return l;continue}return n}return null}const ot=e.defineComponent({name:"SgTransition",props:{visible:{type:Boolean,required:!0},name:{type:String,default:"sg-fade"},duration:{type:Number,default:200},enterFrom:{type:String,default:void 0},enterTo:{type:String,default:void 0},leaveFrom:{type:String,default:void 0},leaveTo:{type:String,default:void 0},unmountOnExit:{type:Boolean,default:!0},onAfterEnter:{type:Function,default:void 0},onAfterLeave:{type:Function,default:void 0}},emits:["afterEnter","afterLeave"],setup(t,{slots:n,emit:l}){const a=e.ref(t.visible),o=e.ref("idle");let s;const v=e.computed(()=>t.enterFrom&&t.enterTo?{from:t.enterFrom,active:`${t.name}-enter-active`,to:t.enterTo}:{from:`${t.name}-enter-from`,active:`${t.name}-enter-active`,to:`${t.name}-enter-to`}),c=e.computed(()=>t.leaveFrom&&t.leaveTo?{from:t.leaveFrom,active:`${t.name}-leave-active`,to:t.leaveTo}:{from:`${t.name}-leave-from`,active:`${t.name}-leave-active`,to:`${t.name}-leave-to`});e.watch(()=>t.visible,(i,d)=>{i!==d&&(s&&clearTimeout(s),i?(a.value=!0,o.value="enter",requestAnimationFrame(()=>{requestAnimationFrame(()=>{o.value="enter-active"})}),s=setTimeout(()=>{var u;o.value="idle",l("afterEnter"),(u=t.onAfterEnter)==null||u.call(t)},t.duration)):(o.value="leave",requestAnimationFrame(()=>{requestAnimationFrame(()=>{o.value="leave-active"})}),s=setTimeout(()=>{var u;o.value="idle",t.unmountOnExit&&(a.value=!1),l("afterLeave"),(u=t.onAfterLeave)==null||u.call(t)},t.duration)))}),e.onBeforeUnmount(()=>{s&&clearTimeout(s)});const r=e.computed(()=>{switch(o.value){case"enter":return`${v.value.from} ${v.value.active}`;case"enter-active":return`${v.value.to} ${v.value.active}`;case"leave":return`${c.value.from} ${c.value.active}`;case"leave-active":return`${c.value.to} ${c.value.active}`;default:return""}});return()=>{var p;if(!a.value&&t.unmountOnExit)return null;const i=((p=n.default)==null?void 0:p.call(n))??[],d=pa(i);if(!d)return null;const u=r.value;return u?e.cloneVNode(d,{class:u}):e.cloneVNode(d)}}}),Kv=["aria-labelledby"],Ov={key:1},Hv={key:2},jv=["aria-label"],_v=["aria-labelledby"],Yv={class:"sg-modal-header"},Wv={key:0,class:"sg-modal-footer"},Uv={key:1,class:"sg-modal-footer"},qv=e.defineComponent({__name:"Modal",props:{open:{type:Boolean},title:{},footer:{},width:{default:520},okHandler:{},okText:{},cancelText:{},okType:{default:"primary"},confirmLoading:{type:Boolean,default:!1},unstyled:{type:Boolean}},emits:["close","ok"],setup(t,{emit:n}){let l=0;function a(){return`sg-modal-${++l}`}const o=t,s=n,v=e.getCurrentInstance(),c=e.computed(()=>{var b;return!!((b=v==null?void 0:v.slots)!=null&&b.footer)}),r=Ce(),i=e.computed(()=>{var b,$;return o.okText??(($=(b=r.value.locale)==null?void 0:b.modal)==null?void 0:$.okText)??"OK"}),d=e.computed(()=>{var b,$;return o.cancelText??(($=(b=r.value.locale)==null?void 0:b.modal)==null?void 0:$.cancelText)??"Cancel"}),u=e.computed(()=>{var b,$;return(($=(b=r.value.locale)==null?void 0:b.modal)==null?void 0:$.closeAriaLabel)??"Close"}),p=a(),m=`${p}-title`,k=`${p}-body`,f=Pt(e.toRef(o,"open")),w=e.ref(null),B=e.ref({});function E(b){if(!b||typeof window>"u")return{};const $=window.getComputedStyle(b),T={};for(let z=0;z<$.length;z+=1){const K=$.item(z);K.startsWith("--sg-")&&(T[K]=$.getPropertyValue(K))}return T}const N=e.computed(()=>({"--sg-modal-width":typeof o.width=="number"?`${o.width}px`:o.width}));function x(){s("close")}function y(){var b;s("ok"),(b=o.okHandler)==null||b.call(o)}function P(b){b.key==="Escape"&&x()}e.watch(()=>o.open,b=>{b?(document.addEventListener("keydown",P),B.value=E(w.value)):document.removeEventListener("keydown",P)},{immediate:!0}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",P)});const S=e.computed(()=>o.footer!=="none"&&!c.value&&!!o.okHandler),C=e.computed(()=>c.value&&o.footer!=="none");return(b,$)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("span",{ref_key:"scopeRef",ref:w,hidden:""},null,512),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[t.unstyled?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"trapRef",ref:f,role:"dialog","aria-modal":"true","aria-labelledby":t.title?m:void 0,"aria-describedby":k},[t.title?(e.openBlock(),e.createElementBlock("div",{key:0,id:m},e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{id:k},[e.renderSlot(b.$slots,"default")]),C.value?(e.openBlock(),e.createElementBlock("div",Ov,[e.renderSlot(b.$slots,"footer")])):S.value?(e.openBlock(),e.createElementBlock("div",Hv,[e.createVNode(Ye,{unstyled:!0,onClick:x},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value),1)]),_:1}),e.createVNode(Ye,{unstyled:!0,onClick:y},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value),1)]),_:1})])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button","aria-label":u.value,onClick:x},"x",8,jv)],8,Kv)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createBlock(ot,{key:1,visible:t.open,name:"sg-fade","unmount-on-exit":!0},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"sg-modal-mask",style:e.normalizeStyle(B.value),onClick:x},[e.createVNode(ot,{visible:t.open,name:"sg-zoom","unmount-on-exit":!0},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"trapRef",ref:f,class:"sg-modal",style:e.normalizeStyle(N.value),role:"dialog","aria-modal":"true","aria-labelledby":t.title?m:void 0,"aria-describedby":k,onClick:$[0]||($[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Yv,[t.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-modal-title",id:m},e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createVNode(Ye,{type:"text",class:"sg-modal-close","aria-label":u.value,onClick:x},{default:e.withCtx(()=>[...$[1]||($[1]=[e.createTextVNode(" × ",-1)])]),_:1},8,["aria-label"])]),e.createElementVNode("div",{class:"sg-modal-body",id:k},[e.renderSlot(b.$slots,"default")]),C.value?(e.openBlock(),e.createElementBlock("div",Wv,[e.renderSlot(b.$slots,"footer")])):S.value?(e.openBlock(),e.createElementBlock("div",Uv,[e.createVNode(Ye,{disabled:t.confirmLoading,onClick:x},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value),1)]),_:1},8,["disabled"]),e.createVNode(Ye,{type:t.okType,loading:t.confirmLoading,onClick:y},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.value),1)]),_:1},8,["type","loading"])])):e.createCommentVNode("",!0)],12,_v)]),_:3},8,["visible"])],4)]),_:3},8,["visible"]))]))],64))}}),Xv=["aria-labelledby"],Gv={key:1},Jv=["aria-label"],Zv=["aria-labelledby"],Qv={key:0,class:"sg-drawer-header"},eg={key:1,class:"sg-drawer-footer"},tg=e.defineComponent({__name:"Drawer",props:{open:{type:Boolean},title:{},placement:{default:"right"},width:{default:378},height:{default:378},closable:{type:Boolean,default:!0},mask:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},unstyled:{type:Boolean}},emits:["close"],setup(t,{emit:n}){let l=0;function a(){return`sg-drawer-${++l}`}const o=t,s=n,v={left:"sg-slide-left",right:"sg-slide-right",top:"sg-slide-down",bottom:"sg-slide-up"},c=a(),r=`${c}-title`,i=`${c}-body`,d=Pt(e.toRef(o,"open")),u=e.ref(null),p=e.ref({});function m(C){if(!C||typeof window>"u")return{};const b=window.getComputedStyle(C),$={};for(let T=0;T<b.length;T+=1){const z=b.item(T);z.startsWith("--sg-")&&($[z]=b.getPropertyValue(z))}return $}const k=e.computed(()=>o.placement==="left"||o.placement==="right"),f=e.computed(()=>{const C=typeof o.width=="number"?`${o.width}px`:o.width,b=typeof o.height=="number"?`${o.height}px`:o.height;return k.value?{width:C,height:"100%"}:{width:"100%",height:b}}),w=e.computed(()=>v[o.placement]??"sg-slide-right");function B(){s("close")}function E(C){C.key==="Escape"&&B()}e.watch(()=>o.open,C=>{C?(document.addEventListener("keydown",E),p.value=m(u.value)):document.removeEventListener("keydown",E)},{immediate:!0}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",E)});const N=e.computed(()=>["sg-drawer",`sg-drawer-${o.placement}`].join(" ")),x=e.getCurrentInstance(),y=e.computed(()=>{var C;return!!((C=x==null?void 0:x.slots)!=null&&C.footer)}),P=Ce(),S=e.computed(()=>{var C,b;return((b=(C=P.value.locale)==null?void 0:C.drawer)==null?void 0:b.closeAriaLabel)??"Close"});return(C,b)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("span",{ref_key:"scopeRef",ref:u,hidden:""},null,512),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[t.unstyled?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.open?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"trapRef",ref:d,role:"dialog","aria-modal":"true","aria-labelledby":t.title?r:void 0,"aria-describedby":i},[t.title?(e.openBlock(),e.createElementBlock("div",{key:0,id:r},e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",{id:i},[e.renderSlot(C.$slots,"default")]),y.value?(e.openBlock(),e.createElementBlock("div",Gv,[e.renderSlot(C.$slots,"footer")])):e.createCommentVNode("",!0),t.closable?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button","aria-label":S.value,onClick:B}," × ",8,Jv)):e.createCommentVNode("",!0)],8,Xv)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createBlock(ot,{key:1,visible:t.open,name:"sg-fade",duration:300},{default:e.withCtx(()=>[e.createElementVNode("div",{class:"sg-drawer-root",style:e.normalizeStyle(p.value)},[t.mask?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-drawer-mask",onClick:b[0]||(b[0]=$=>t.maskClosable?B():void 0)})):e.createCommentVNode("",!0),e.createVNode(ot,{visible:t.open,name:w.value,duration:300},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"trapRef",ref:d,class:e.normalizeClass(N.value),style:e.normalizeStyle(f.value),role:"dialog","aria-modal":"true","aria-labelledby":t.title?r:void 0,"aria-describedby":i},[t.title||t.closable?(e.openBlock(),e.createElementBlock("div",Qv,[t.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-drawer-title",id:r},e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.closable?(e.openBlock(),e.createBlock(Ye,{key:1,type:"text",class:"sg-drawer-close","aria-label":S.value,onClick:B},{default:e.withCtx(()=>[...b[1]||(b[1]=[e.createTextVNode(" × ",-1)])]),_:1},8,["aria-label"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"sg-drawer-body",id:i},[e.renderSlot(C.$slots,"default")]),y.value?(e.openBlock(),e.createElementBlock("div",eg,[e.renderSlot(C.$slots,"footer")])):e.createCommentVNode("",!0)],14,Zv)]),_:3},8,["visible","name"])],4)]),_:3},8,["visible"]))]))],64))}}),tl=new Set;let it=[],lg=0;function yl(){const t=[...it];for(const n of[...tl])n(t)}function yt(t){const n=t.key??`sg-notif-${++lg}`,l={...t,id:n};it=[...it,l],yl();const a=t.duration??4500;a>0&&setTimeout(()=>va(n),a)}function va(t){it=it.filter(n=>n.id!==t),yl()}const ga={open:t=>yt(t),success:(t,n)=>yt({type:"success",message:t,description:n}),error:(t,n)=>yt({type:"error",message:t,description:n}),warning:(t,n)=>yt({type:"warning",message:t,description:n}),info:(t,n)=>yt({type:"info",message:t,description:n}),destroy:()=>{it=[],yl()}};function ag(){return ga}const Al={success:"✓",error:"✕",warning:"⚠",info:"ℹ"},ng=e.defineComponent({name:"SgNotificationContainer",props:{placement:{type:String,default:"topRight"},unstyled:{type:Boolean,default:!1}},setup(t){const n=e.ref([]),l=r=>{n.value=r};e.onMounted(()=>{tl.add(l),n.value=[...it]}),e.onBeforeUnmount(()=>{tl.delete(l)});const a=e.computed(()=>n.value.filter(r=>(r.placement??"topRight")===t.placement)),o=e.computed(()=>t.unstyled?void 0:`sg-notification-container sg-notification-${t.placement}`),s=Ce(),v=e.computed(()=>{var r,i;return((i=(r=s.value.locale)==null?void 0:r.notification)==null?void 0:i.closeAriaLabel)??"Close"}),c=r=>{var i;va(r.id),(i=r.onClose)==null||i.call(r)};return()=>a.value.length===0?null:e.h("div",{class:o.value},a.value.map(r=>{const i=r.type??"info",d=t.placement.includes("Right")?"sg-slide-right":"sg-slide-left",u=t.unstyled?e.h("div",{role:"alert",style:r.style},[e.h("span",Al[i]),e.h("span",r.message),r.description?e.h("div",r.description):null,e.h("button",{type:"button","aria-label":v.value,onClick:()=>c(r)},"×")]):e.h("div",{class:`sg-notification sg-notification-${i}`,role:"alert",style:r.style},[e.h("div",{class:"sg-notification-icon"},Al[i]),e.h("div",{class:"sg-notification-content"},[e.h("div",{class:"sg-notification-message"},r.message),r.description?e.h("div",{class:"sg-notification-description"},r.description):null]),e.h("button",{class:"sg-notification-close",type:"button","aria-label":v.value,onClick:()=>c(r)},"×")]);return e.h(ot,{key:r.id,visible:!0,name:d,unmountOnExit:!1},{default:()=>e.h("div",u)})}))}}),og=["aria-describedby"],sg=["id"],rg={key:0},ig=["id"],cg={class:"sg-popconfirm-inner"},ug={class:"sg-popconfirm-title"},dg={key:0,class:"sg-popconfirm-description"},mg={class:"sg-popconfirm-buttons"},pg=e.defineComponent({__name:"Popconfirm",props:{title:{},description:{},okText:{},cancelText:{},placement:{default:"top"},disabled:{type:Boolean,default:!1},unstyled:{type:Boolean}},emits:["confirm","cancel"],setup(t,{emit:n}){let l=0;function a(){return`sg-popconfirm-${++l}`}const o=t,s=n,v=Ce(),c=e.computed(()=>{var E,N;return o.okText??((N=(E=v.value.locale)==null?void 0:E.popconfirm)==null?void 0:N.okText)??"Yes"}),r=e.computed(()=>{var E,N;return o.cancelText??((N=(E=v.value.locale)==null?void 0:E.popconfirm)==null?void 0:N.cancelText)??"No"}),i=e.ref(!1),d=e.ref(null),u=Pt(i),p=a();function m(){o.disabled||(i.value=!i.value)}function k(){i.value=!1,s("confirm")}function f(){i.value=!1,s("cancel")}function w(E){d.value&&!d.value.contains(E.target)&&(i.value=!1)}e.watch(i,E=>{E?document.addEventListener("mousedown",w):document.removeEventListener("mousedown",w)},{immediate:!0}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",w)});const B=e.computed(()=>`sg-popconfirm sg-popconfirm-${o.placement}`);return(E,N)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"wrapperRef",ref:d,class:e.normalizeClass(t.unstyled?"":"sg-popconfirm-wrapper"),style:e.normalizeStyle(t.unstyled?{position:"relative",display:"inline-block"}:void 0)},[e.createElementVNode("div",{"aria-describedby":i.value?e.unref(p):void 0,style:{display:"inline-block"},onClick:m},[e.renderSlot(E.$slots,"default")],8,og),t.unstyled?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[i.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:e.unref(p),role:"alertdialog"},[e.createElementVNode("div",null,e.toDisplayString(t.title),1),t.description?(e.openBlock(),e.createElementBlock("div",rg,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",onClick:f},e.toDisplayString(r.value),1),e.createElementVNode("button",{type:"button",onClick:k},e.toDisplayString(c.value),1)],8,sg)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createBlock(ot,{key:1,visible:i.value,name:"sg-fade"},{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"trapRef",ref:u,id:e.unref(p),role:"alertdialog",class:e.normalizeClass(B.value)},[N[1]||(N[1]=e.createElementVNode("div",{class:"sg-popconfirm-arrow"},null,-1)),e.createElementVNode("div",cg,[e.createElementVNode("div",ug,[N[0]||(N[0]=e.createElementVNode("span",{class:"sg-popconfirm-icon"},"⚠",-1)),e.createTextVNode(" "+e.toDisplayString(t.title),1)]),t.description?(e.openBlock(),e.createElementBlock("div",dg,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0),e.createElementVNode("div",mg,[e.createVNode(Ye,{size:"small",onClick:f},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value),1)]),_:1}),e.createVNode(Ye,{size:"small",type:"primary",onClick:k},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.value),1)]),_:1})])])],10,ig)]),_:1},8,["visible"]))],6))}}),vg=["aria-describedby"],gg=["id"],fg=["aria-describedby"],hg=["id"],yg={class:"sg-tooltip-content"},kg=e.defineComponent({__name:"Tooltip",props:{title:{default:""},placement:{default:"top"},unstyled:{type:Boolean}},setup(t){let n=0;function l(){return`sg-tooltip-${++n}`}const a=e.ref(!1),o=l();function s(){a.value=!0}function v(){a.value=!1}return(c,r)=>t.unstyled?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(void 0),style:{position:"relative",display:"inline-block"},onMouseenter:s,onMouseleave:v},[e.createElementVNode("span",{"aria-describedby":a.value?e.unref(o):void 0,style:{display:"inline-block"},onFocusin:s,onFocusout:v},[e.renderSlot(c.$slots,"default")],40,vg),a.value?(e.openBlock(),e.createElementBlock("span",{key:0,id:e.unref(o),role:"tooltip"},[e.renderSlot(c.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])],8,gg)):e.createCommentVNode("",!0)],32)):(e.openBlock(),e.createElementBlock("span",{key:1,class:"sg-tooltip-wrapper","aria-describedby":a.value?e.unref(o):void 0,onMouseenter:s,onMouseleave:v},[e.createElementVNode("span",{style:{display:"inline-block"},onFocusin:s,onFocusout:v},[e.renderSlot(c.$slots,"default")],32),e.createVNode(ot,{visible:a.value,name:"sg-fade"},{default:e.withCtx(()=>[e.createElementVNode("span",{id:e.unref(o),role:"tooltip",class:e.normalizeClass(`sg-tooltip sg-tooltip-${t.placement}`)},[e.createElementVNode("span",yg,[e.renderSlot(c.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])]),r[0]||(r[0]=e.createElementVNode("span",{class:"sg-tooltip-arrow"},null,-1))],10,hg)]),_:3},8,["visible"])],40,fg))}}),bg=["aria-valuenow"],Bg={key:1},Cg=["aria-valuenow"],wg=["width","height","viewBox"],Sg=["cx","cy","r","stroke-width"],Eg=["cx","cy","r","stroke-width","stroke-dasharray","stroke-dashoffset","transform"],xg={key:0,class:"sg-progress-circle-text"},$g=["aria-valuenow"],Ng={class:"sg-progress-outer"},Vg={key:0,class:"sg-progress-text"},Dg=e.defineComponent({__name:"Progress",props:{percent:{},type:{default:"line"},status:{default:"normal"},showInfo:{type:Boolean,default:!0},strokeWidth:{},strokeColor:{},size:{},width:{default:120},unstyled:{type:Boolean}},setup(t){const n=t,{resolvedSize:l}=_e({size:void 0},{}),a=e.computed(()=>n.size??l.value),o=e.computed(()=>a.value==="small"?"small":"default"),s=e.computed(()=>Math.min(100,Math.max(0,n.percent))),v=e.computed(()=>s.value>=100&&n.status==="normal"?"success":n.status),c=e.computed(()=>["sg-progress","sg-progress-line",`sg-progress-${v.value}`,`sg-progress-${o.value}`].join(" ")),r=e.computed(()=>["sg-progress","sg-progress-circle",`sg-progress-${v.value}`].join(" ")),i=e.computed(()=>n.strokeWidth??(o.value==="small"?6:8)),d=e.computed(()=>{const u=n.strokeWidth??6,p=(n.width-u)/2,m=2*Math.PI*p,k=m-s.value/100*m;return{sw:u,radius:p,circumference:m,offset:k}});return(u,p)=>t.unstyled?(e.openBlock(),e.createElementBlock("div",{key:0,role:"progressbar","aria-valuenow":s.value},[t.type==="line"?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({width:"100%",height:`${t.strokeWidth??8}px`,background:"#eee"})},[e.createElementVNode("div",{style:e.normalizeStyle({width:`${s.value}%`,height:"100%",background:t.strokeColor??"#1677ff"})},null,4)],4)):(e.openBlock(),e.createElementBlock("span",Bg,e.toDisplayString(s.value)+"%",1))],8,bg)):t.type==="circle"?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(r.value),role:"progressbar","aria-valuenow":s.value},[(e.openBlock(),e.createElementBlock("svg",{width:t.width,height:t.width,viewBox:`0 0 ${t.width} ${t.width}`},[e.createElementVNode("circle",{class:"sg-progress-circle-trail",cx:t.width/2,cy:t.width/2,r:d.value.radius,"stroke-width":d.value.sw,fill:"none"},null,8,Sg),e.createElementVNode("circle",{class:"sg-progress-circle-path",cx:t.width/2,cy:t.width/2,r:d.value.radius,"stroke-width":d.value.sw,fill:"none","stroke-dasharray":d.value.circumference,"stroke-dashoffset":d.value.offset,"stroke-linecap":"round",style:e.normalizeStyle(t.strokeColor?{stroke:t.strokeColor}:void 0),transform:`rotate(-90 ${t.width/2} ${t.width/2})`},null,12,Eg)],8,wg)),t.showInfo?(e.openBlock(),e.createElementBlock("span",xg,e.toDisplayString(s.value)+"%",1)):e.createCommentVNode("",!0)],10,Cg)):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(c.value),role:"progressbar","aria-valuenow":s.value},[e.createElementVNode("div",Ng,[e.createElementVNode("div",{class:"sg-progress-inner",style:e.normalizeStyle({height:`${i.value}px`})},[e.createElementVNode("div",{class:"sg-progress-bg",style:e.normalizeStyle({width:`${s.value}%`,...t.strokeColor?{background:t.strokeColor}:{}})},null,4)],4)]),t.showInfo?(e.openBlock(),e.createElementBlock("span",Vg,e.toDisplayString(s.value)+"%",1)):e.createCommentVNode("",!0)],10,$g))}}),zg={key:0,role:"status","aria-live":"polite"},Tg={key:0},Lg={key:1},Mg={class:"sg-result-title"},Fg={key:0,class:"sg-result-subtitle"},Ag={key:1,class:"sg-result-extra"},Pg={key:2,class:"sg-result-content"},Rg=e.defineComponent({__name:"Result",props:{status:{},title:{},subTitle:{},unstyled:{type:Boolean}},setup(t){const n=t,l=e.useSlots(),a=e.computed(()=>!!l.icon),o=e.computed(()=>!!l.extra),s=e.computed(()=>!!l.default),v=e.computed(()=>!!l.subTitle),c={success:"var(--sg-color-success)",error:"var(--sg-color-error)",info:"var(--sg-color-primary)",warning:"var(--sg-color-warning)",404:"var(--sg-color-text-tertiary)",403:"var(--sg-color-text-tertiary)",500:"var(--sg-color-text-tertiary)"},r=e.computed(()=>c[n.status]),i=e.computed(()=>`sg-result sg-result-${n.status}`),d=e.defineComponent({name:"SgResultDefaultIcon",props:{status:{type:String,required:!0}},setup(u){return()=>{const p=u.status,m={viewBox:"64 64 896 896",width:"72",height:"72",fill:"currentColor"};return p==="success"?e.h("svg",m,[e.h("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z"})]):p==="error"?e.h("svg",m,[e.h("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"})]):p==="info"?e.h("svg",m,[e.h("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 664c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V456c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272zm-32-344a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"})]):p==="warning"?e.h("svg",m,[e.h("path",{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"})]):e.h("svg",{viewBox:"0 0 252 294",width:"252",height:"294",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.h("text",{x:"50%",y:"50%","dominant-baseline":"middle","text-anchor":"middle",fill:"currentColor","font-size":"80","font-weight":"bold",opacity:"0.25"},p)])}}});return(u,p)=>t.unstyled?(e.openBlock(),e.createElementBlock("div",zg,[e.createElementVNode("div",null,[a.value?e.renderSlot(u.$slots,"icon",{key:0}):(e.openBlock(),e.createBlock(e.unref(d),{key:1,status:t.status},null,8,["status"]))]),e.createElementVNode("div",null,[e.renderSlot(u.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])]),v.value||t.subTitle?(e.openBlock(),e.createElementBlock("div",Tg,[e.renderSlot(u.$slots,"subTitle",{},()=>[e.createTextVNode(e.toDisplayString(t.subTitle),1)])])):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("div",Lg,[e.renderSlot(u.$slots,"extra")])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"default")])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(i.value),role:"status","aria-live":"polite"},[e.createElementVNode("div",{class:"sg-result-icon",style:e.normalizeStyle({color:r.value})},[a.value?e.renderSlot(u.$slots,"icon",{key:0}):(e.openBlock(),e.createBlock(e.unref(d),{key:1,status:t.status},null,8,["status"]))],4),e.createElementVNode("div",Mg,[e.renderSlot(u.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)])]),v.value||t.subTitle?(e.openBlock(),e.createElementBlock("div",Fg,[e.renderSlot(u.$slots,"subTitle",{},()=>[e.createTextVNode(e.toDisplayString(t.subTitle),1)])])):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("div",Ag,[e.renderSlot(u.$slots,"extra")])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",Pg,[e.renderSlot(u.$slots,"default")])):e.createCommentVNode("",!0)],2))}}),Ig={key:1,role:"status"},Kg={key:0},Og={key:2,class:"sg-empty",role:"status"},Hg={class:"sg-empty-image"},jg={key:0,class:"sg-empty-description"},_g={key:1,class:"sg-empty-footer"},Yg=e.defineComponent({__name:"Empty",props:{description:{},unstyled:{type:Boolean}},setup(t){const n=t,l=e.useSlots(),a=Ce(),o=e.computed(()=>{var p,m;return n.description===null?null:n.description!==void 0?n.description:((m=(p=a.value.locale)==null?void 0:p.empty)==null?void 0:m.description)??"No Data"}),s=e.computed(()=>!!l.default),v=e.computed(()=>!!l.image),c=e.computed(()=>!!l.description),r=e.computed(()=>c.value||n.description!==null&&o.value!==null),i=e.computed(()=>!!a.value.renderEmpty&&n.description===void 0&&!l.image&&!l.description&&!l.default),d=e.defineComponent({name:"SgEmptyCustom",setup(){return()=>{var p,m;return(m=(p=a.value).renderEmpty)==null?void 0:m.call(p,"Empty")}}}),u=e.defineComponent({name:"SgEmptyDefaultImage",setup(){return()=>e.h("svg",{width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},[e.h("g",{fill:"none","fill-rule":"evenodd",transform:"translate(0 1)"},[e.h("ellipse",{cx:"32",cy:"33",rx:"32",ry:"7",fill:"currentColor",opacity:"0.08"}),e.h("g",{"fill-rule":"nonzero",stroke:"currentColor","stroke-opacity":"0.25"},[e.h("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),e.h("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35H11.95C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",fill:"currentColor",opacity:"0.08"})])])])}});return(p,m)=>i.value?(e.openBlock(),e.createBlock(e.unref(d),{key:0})):t.unstyled?(e.openBlock(),e.createElementBlock("div",Ig,[e.createElementVNode("div",null,[v.value?e.renderSlot(p.$slots,"image",{key:0}):(e.openBlock(),e.createBlock(e.unref(u),{key:1}))]),r.value?(e.openBlock(),e.createElementBlock("p",Kg,[e.renderSlot(p.$slots,"description",{},()=>[e.createTextVNode(e.toDisplayString(o.value),1)])])):e.createCommentVNode("",!0),e.renderSlot(p.$slots,"default")])):(e.openBlock(),e.createElementBlock("div",Og,[e.createElementVNode("div",Hg,[v.value?e.renderSlot(p.$slots,"image",{key:0}):(e.openBlock(),e.createBlock(e.unref(u),{key:1}))]),r.value?(e.openBlock(),e.createElementBlock("p",jg,[e.renderSlot(p.$slots,"description",{},()=>[e.createTextVNode(e.toDisplayString(o.value),1)])])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",_g,[e.renderSlot(p.$slots,"default")])):e.createCommentVNode("",!0)]))}}),Wg=["aria-label"],Ug=["aria-label"],qg={key:0,class:"sg-skeleton-header"},Xg={class:"sg-skeleton-content"},Gg={key:1,class:"sg-skeleton-paragraph"},Jg=e.defineComponent({__name:"Skeleton",props:{active:{type:Boolean,default:!1},avatar:{type:[Boolean,Object]},title:{type:[Boolean,Object],default:!0},paragraph:{type:[Boolean,Object],default:!0},loading:{type:Boolean,default:!0},unstyled:{type:Boolean}},setup(t){const n=t,l=e.computed(()=>typeof n.avatar=="object"?n.avatar.size??40:40),a=e.computed(()=>typeof n.avatar=="object"?n.avatar.shape??"circle":"circle"),o=e.computed(()=>typeof n.title=="object"?n.title.width??"38%":"38%"),s=e.computed(()=>typeof n.paragraph=="object"?n.paragraph.rows??3:3),v=e.computed(()=>typeof n.paragraph=="object"?n.paragraph.width:void 0);function c(p,m){const k=v.value;return k&&k[p]!==void 0?k[p]:p===m-1?"61%":"100%"}function r(p){return typeof p=="number"?`${p}px`:p}const i=Ce(),d=e.computed(()=>{var p,m;return((m=(p=i.value.locale)==null?void 0:p.skeleton)==null?void 0:m.loading)??"Loading"}),u=e.computed(()=>["sg-skeleton",n.active?"sg-skeleton-active":"",n.avatar?"sg-skeleton-with-avatar":""].filter(Boolean).join(" "));return(p,m)=>t.loading?t.unstyled?(e.openBlock(),e.createElementBlock("div",{key:1,"aria-busy":"true","aria-label":d.value},[t.avatar?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({width:`${l.value}px`,height:`${l.value}px`})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",null,[t.title?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({width:r(o.value),height:"16px"})},null,4)):e.createCommentVNode("",!0),t.paragraph?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(s.value,k=>(e.openBlock(),e.createElementBlock("div",{key:k,style:e.normalizeStyle({width:r(c(k-1,s.value)),height:"16px"})},null,4))),128)):e.createCommentVNode("",!0)])],8,Wg)):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(u.value),"aria-busy":"true","aria-label":d.value},[t.avatar?(e.openBlock(),e.createElementBlock("div",qg,[e.createElementVNode("span",{class:e.normalizeClass(["sg-skeleton-avatar",`sg-skeleton-avatar-${a.value}`]),style:e.normalizeStyle({width:`${l.value}px`,height:`${l.value}px`})},null,6)])):e.createCommentVNode("",!0),e.createElementVNode("div",Xg,[t.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sg-skeleton-title",style:e.normalizeStyle({width:r(o.value)})},null,4)):e.createCommentVNode("",!0),t.paragraph?(e.openBlock(),e.createElementBlock("ul",Gg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,k=>(e.openBlock(),e.createElementBlock("li",{key:k,style:e.normalizeStyle({width:r(c(k-1,s.value))})},null,4))),128))])):e.createCommentVNode("",!0)])],10,Ug)):e.renderSlot(p.$slots,"default",{key:0})}}),Zg={key:0},Qg={role:"tablist"},ef=["aria-selected","disabled","onClick"],tf={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},lf={role:"tabpanel"},af={class:"sg-tabs-nav",role:"tablist"},nf=["aria-selected","tabindex","onClick","onKeydown"],of={key:0,class:"sg-spin sg-spin-small","aria-hidden":"true"},sf={class:"sg-tabs-content",role:"tabpanel"},rf=e.defineComponent({__name:"Tabs",props:{type:{default:"card"},items:{},activeKey:{},defaultActiveKey:{},size:{},unstyled:{type:Boolean}},emits:["change"],setup(t,{emit:n}){var p;const l=t,a=n,{resolvedSize:o}=_e({size:void 0},{}),s=e.computed(()=>l.size??o.value),v=e.ref(l.activeKey??l.defaultActiveKey??((p=l.items[0])==null?void 0:p.key)??""),c=e.computed(()=>l.activeKey??v.value),r=e.computed(()=>l.items.find(m=>m.key===c.value));function i(m,k,f){k||f||(v.value=m,a("change",m))}function d(m,k){const f=l.items.filter(B=>!B.disabled&&!B.loading);if(f.length===0)return;const w=f.findIndex(B=>B.key===k.key);if(m.key==="ArrowRight"||m.key==="ArrowDown"){m.preventDefault();const B=f[(w+1)%f.length];B&&i(B.key)}else if(m.key==="ArrowLeft"||m.key==="ArrowUp"){m.preventDefault();const B=f[(w-1+f.length)%f.length];B&&i(B.key)}else m.key==="Home"?(m.preventDefault(),i(f[0].key)):m.key==="End"&&(m.preventDefault(),i(f[f.length-1].key))}const u=e.computed(()=>["sg-tabs",`sg-tabs-${s.value}`,l.type==="line"?"sg-tabs-line":"sg-tabs-card"].join(" "));return(m,k)=>t.unstyled?(e.openBlock(),e.createElementBlock("div",Zg,[e.createElementVNode("div",Qg,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,f=>(e.openBlock(),e.createElementBlock("button",{key:f.key,type:"button",role:"tab","aria-selected":f.key===c.value,disabled:f.disabled||f.loading,onClick:w=>i(f.key,f.disabled,f.loading)},[e.renderSlot(m.$slots,"tab",{item:f},()=>[e.createTextVNode(e.toDisplayString(f.label),1)]),f.loading?(e.openBlock(),e.createElementBlock("span",tf)):e.createCommentVNode("",!0)],8,ef))),128))]),e.createElementVNode("div",lf,[r.value?e.renderSlot(m.$slots,"panel",{key:0,item:r.value},()=>[e.createTextVNode(e.toDisplayString(r.value.content),1)]):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"default",{activeKey:c.value})])])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(u.value)},[e.createElementVNode("div",af,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,f=>(e.openBlock(),e.createElementBlock("div",{key:f.key,role:"tab","aria-selected":f.key===c.value,class:e.normalizeClass(["sg-tabs-tab",f.key===c.value?"sg-tabs-tab-active":"",f.disabled?"sg-tabs-tab-disabled":"",f.loading?"sg-tabs-tab-loading":""]),tabindex:f.key===c.value?0:-1,onClick:w=>i(f.key,f.disabled,f.loading),onKeydown:w=>d(w,f)},[e.renderSlot(m.$slots,"tab",{item:f},()=>[e.createTextVNode(e.toDisplayString(f.label),1)]),f.loading&&!t.unstyled?(e.openBlock(),e.createElementBlock("span",of)):e.createCommentVNode("",!0)],42,nf))),128))]),e.createElementVNode("div",sf,[r.value?e.renderSlot(m.$slots,"panel",{key:0,item:r.value},()=>[e.createTextVNode(e.toDisplayString(r.value.content),1)]):e.createCommentVNode("",!0),e.renderSlot(m.$slots,"default",{activeKey:c.value})])],2))}});function ll(t,n,l,a=[]){var o;for(const s of t)if(s.type!=="divider"){if(s.type==="group"){s.children&&ll(s.children,n,l,a);continue}s.disabled||(a.push(s),l==="inline"&&((o=s.children)!=null&&o.length)&&n.includes(s.key)&&ll(s.children,n,l,a))}return a}function pt(t,n){for(const l of t){if(l.key===n&&l.type!=="divider"&&l.type!=="group")return l;if(l.children){const a=pt(l.children,n);if(a)return a}}return null}function al(t,n,l=null){for(const a of t){if(a.key===n)return l;if(a.children){const o=a.type==="group"?l:a.key,s=al(a.children,n,o);if(s!==null)return s}}return null}const Lt=e.defineComponent({name:"SgMenuItemStyled",props:{item:{type:Object,required:!0},mode:{type:String,required:!0},selectedKeys:{type:Array,required:!0},openKeys:{type:Array,required:!0},activeKey:{type:String,required:!0},inlineCollapsed:{type:Boolean,default:!1},depth:{type:Number,required:!0},unstyled:{type:Boolean,default:!1},onSelect:{type:Function,required:!0},onToggleOpen:{type:Function,required:!0},onFocusKey:{type:Function,required:!0}},setup(t){const n=e.ref(!1);let l;e.onBeforeUnmount(()=>l&&clearTimeout(l));const a=e.computed(()=>!!(t.item.children&&t.item.children.length>0)),o=e.computed(()=>t.selectedKeys.includes(t.item.key)),s=e.computed(()=>t.openKeys.includes(t.item.key)),v=e.computed(()=>t.mode!=="inline"&&a.value),c=e.computed(()=>t.mode==="inline"&&a.value),r=e.computed(()=>["sg-menu-item",o.value&&!a.value?"sg-menu-item-selected":"",t.item.disabled?"sg-menu-item-disabled":"",t.item.danger?"sg-menu-item-danger":"",a.value?"sg-menu-submenu":""].filter(Boolean).join(" ")),i=e.computed(()=>[a.value?"sg-menu-submenu-wrapper":"",v.value&&n.value?"sg-menu-submenu-open":""].filter(Boolean).join(" ")),d=e.computed(()=>t.mode==="inline"&&!t.inlineCollapsed?`${24+t.depth*24}px`:void 0);function u(){!v.value||t.item.disabled||(l&&clearTimeout(l),n.value=!0)}function p(){v.value&&(l=setTimeout(()=>n.value=!1,150))}function m(){if(!t.item.disabled){if(c.value){t.onToggleOpen(t.item.key);return}a.value||t.onSelect(t.item.key)}}return()=>{if(t.item.type==="divider")return e.h("li",{class:"sg-menu-divider",role:"separator"});if(t.item.type==="group")return e.h("li",{class:"sg-menu-group",role:"group"},[e.h("div",{class:"sg-menu-group-title"},t.item.label),e.h("ul",{class:"sg-menu-group-list",role:"menu"},(t.item.children??[]).map(f=>e.h(Lt,{key:f.key,item:f,mode:t.mode,selectedKeys:t.selectedKeys,openKeys:t.openKeys,activeKey:t.activeKey,inlineCollapsed:t.inlineCollapsed,depth:t.depth,unstyled:t.unstyled,onSelect:t.onSelect,onToggleOpen:t.onToggleOpen,onFocusKey:t.onFocusKey})))]);const k=[];if(t.item.label!==void 0){const f=e.h("div",{role:"menuitem","data-menu-key":t.item.key,tabindex:t.activeKey===t.item.key?0:-1,"aria-selected":o.value,"aria-disabled":t.item.disabled||void 0,"aria-haspopup":a.value?"menu":void 0,"aria-expanded":a.value?v.value?n.value:s.value:void 0,class:r.value,style:{paddingLeft:d.value},onClick:m,onFocus:()=>t.onFocusKey(t.item.key)},[t.item.icon!=null?e.h("span",{class:"sg-menu-item-icon","aria-hidden":"true"},t.item.icon):t.inlineCollapsed&&t.depth===0&&typeof t.item.label=="string"?e.h("span",{class:"sg-menu-item-icon sg-menu-item-icon-fallback","aria-hidden":"true"},t.item.label.trim().charAt(0).toUpperCase()):null,t.inlineCollapsed&&t.depth===0?null:e.h("span",{class:"sg-menu-item-label"},t.item.label),a.value?e.h("span",{class:["sg-menu-submenu-arrow",(v.value?n.value:s.value)?"sg-menu-submenu-arrow-open":""].filter(Boolean).join(" ")}):null]);k.push(f)}return c.value&&k.push(e.h("ul",{class:["sg-menu-inline-sub",s.value?"sg-menu-inline-sub-open":""].filter(Boolean).join(" "),role:"menu"},(t.item.children??[]).map(f=>e.h(Lt,{key:f.key,item:f,mode:t.mode,selectedKeys:t.selectedKeys,openKeys:t.openKeys,activeKey:t.activeKey,inlineCollapsed:t.inlineCollapsed,depth:t.depth+1,unstyled:t.unstyled,onSelect:t.onSelect,onToggleOpen:t.onToggleOpen,onFocusKey:t.onFocusKey})))),v.value&&n.value&&k.push(e.h("ul",{class:"sg-menu-popup",role:"menu"},(t.item.children??[]).map(f=>e.h(Lt,{key:f.key,item:f,mode:t.mode,selectedKeys:t.selectedKeys,openKeys:t.openKeys,activeKey:t.activeKey,inlineCollapsed:!1,depth:0,unstyled:t.unstyled,onSelect:t.onSelect,onToggleOpen:t.onToggleOpen,onFocusKey:t.onFocusKey})))),e.h("li",{class:i.value,onMouseenter:u,onMouseleave:p},k)}}}),cf=e.defineComponent({name:"SgMenu",props:{items:{type:Array,required:!0},mode:{type:String,default:"vertical"},selectedKeys:{type:Array,default:void 0},defaultSelectedKeys:{type:Array,default:()=>[]},openKeys:{type:Array,default:void 0},defaultOpenKeys:{type:Array,default:()=>[]},inlineCollapsed:{type:Boolean,default:!1},theme:{type:String,default:"light"},unstyled:{type:Boolean,default:!1}},emits:["select","openChange"],setup(t,{emit:n}){var w;const l=e.ref(t.selectedKeys??t.defaultSelectedKeys),a=e.ref(t.openKeys??t.defaultOpenKeys),o=e.computed(()=>t.selectedKeys??l.value),s=e.computed(()=>t.openKeys??a.value),v=e.computed(()=>ll(t.items,s.value,t.mode)),c=o.value.find(B=>v.value.some(E=>E.key===B))??((w=v.value[0])==null?void 0:w.key)??"",r=e.ref(c);function i(B){const E=[B];l.value=E,r.value=B,n("select",{key:B,selectedKeys:E})}function d(B){const E=s.value.includes(B)?s.value.filter(N=>N!==B):[...s.value,B];a.value=E,n("openChange",E)}const u=e.ref(null);function p(B){var N;r.value=B;const E=(N=u.value)==null?void 0:N.querySelector(`[data-menu-key="${CSS.escape(B)}"]`);E==null||E.focus()}function m(B){const E=v.value;if(E.length===0)return;const N=E.findIndex(P=>P.key===r.value),y=((N<0?B===1?-1:0:N)+B+E.length)%E.length;p(E[y].key)}function k(B,E){const N=pt(t.items,B);return N!=null&&N.children?N.children.some(x=>x.key===E):!1}function f(B){var P,S,C,b;const E=v.value;if(E.length===0)return;const N=t.mode==="horizontal",x=N?"ArrowRight":"ArrowDown",y=N?"ArrowLeft":"ArrowUp";switch(B.key){case x:B.preventDefault(),m(1);break;case y:B.preventDefault(),m(-1);break;case"Home":B.preventDefault(),p(E[0].key);break;case"End":B.preventDefault(),p(E[E.length-1].key);break;case"Enter":case" ":{const $=pt(t.items,r.value);if(!$||$.disabled)return;B.preventDefault(),(P=$.children)!=null&&P.length?t.mode==="inline"&&d($.key):i($.key);break}case"ArrowRight":{if(N)return;const $=pt(t.items,r.value);if(t.mode==="inline"&&((S=$==null?void 0:$.children)!=null&&S.length))if(B.preventDefault(),!s.value.includes($.key))d($.key);else{const T=$.children.find(z=>!z.disabled&&z.type!=="divider");T&&p(T.key)}break}case"ArrowLeft":{if(N)return;const $=pt(t.items,r.value);if(!$)return;if(t.mode==="inline"&&((C=$.children)!=null&&C.length)&&s.value.includes($.key)){B.preventDefault(),d($.key);return}const T=al(t.items,r.value);T&&k(T,r.value)&&t.mode==="inline"&&(B.preventDefault(),p(T));break}case"Escape":{const $=pt(t.items,r.value),T=al(t.items,r.value);T&&t.mode==="inline"&&s.value.includes(T)?(B.preventDefault(),d(T),p(T)):(b=$==null?void 0:$.children)!=null&&b.length&&t.mode==="inline"&&s.value.includes($.key)&&(B.preventDefault(),d($.key));break}}}return()=>{const B=t.unstyled?void 0:["sg-menu",`sg-menu-${t.mode}`,`sg-menu-${t.theme}`,t.inlineCollapsed?"sg-menu-collapsed":""].filter(Boolean).join(" ");return e.h("ul",{ref:u,role:"menu","aria-orientation":t.mode==="horizontal"?"horizontal":"vertical",class:B,onKeydown:f},t.items.map(E=>e.h(Lt,{key:E.key,item:E,mode:t.mode,selectedKeys:o.value,openKeys:s.value,activeKey:r.value,inlineCollapsed:t.inlineCollapsed,depth:0,unstyled:t.unstyled,onSelect:i,onToggleOpen:d,onFocusKey:N=>r.value=N})))}}}),uf=["aria-label"],df=["href","onClick"],mf={key:1},pf={key:2},vf=["aria-label"],gf=["href","onClick"],ff={key:2,class:"sg-breadcrumb-separator"},hf=e.defineComponent({__name:"Breadcrumb",props:{items:{},separator:{default:"/"},unstyled:{type:Boolean}},emits:["itemClick"],setup(t,{emit:n}){const l=n,a=Ce(),o=e.computed(()=>{var v,c;return((c=(v=a.value.locale)==null?void 0:v.breadcrumb)==null?void 0:c.ariaLabel)??"Breadcrumb"});function s(v,c,r){v.href||r.preventDefault(),l("itemClick",v,c)}return(v,c)=>t.unstyled?(e.openBlock(),e.createElementBlock("nav",{key:0,"aria-label":o.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(r,i)=>(e.openBlock(),e.createElementBlock("span",{key:i},[r.href?(e.openBlock(),e.createElementBlock("a",{key:0,href:r.href,onClick:d=>s(r,i,d)},[e.renderSlot(v.$slots,"item",{item:r,index:i},()=>[e.createTextVNode(e.toDisplayString(r.title),1)])],8,df)):(e.openBlock(),e.createElementBlock("span",mf,[e.renderSlot(v.$slots,"item",{item:r,index:i},()=>[e.createTextVNode(e.toDisplayString(r.title),1)])])),i<t.items.length-1?(e.openBlock(),e.createElementBlock("span",pf,e.toDisplayString(t.separator),1)):e.createCommentVNode("",!0)]))),128))],8,uf)):(e.openBlock(),e.createElementBlock("nav",{key:1,class:"sg-breadcrumb","aria-label":o.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(r,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[r.href?(e.openBlock(),e.createElementBlock("a",{key:0,class:"sg-breadcrumb-link",href:r.href,onClick:d=>s(r,i,d)},[e.renderSlot(v.$slots,"item",{item:r,index:i},()=>[e.createTextVNode(e.toDisplayString(r.title),1)])],8,gf)):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(i===t.items.length-1?"sg-breadcrumb-current":"sg-breadcrumb-link")},[e.renderSlot(v.$slots,"item",{item:r,index:i},()=>[e.createTextVNode(e.toDisplayString(r.title),1)])],2)),i<t.items.length-1?(e.openBlock(),e.createElementBlock("span",ff,e.toDisplayString(t.separator),1)):e.createCommentVNode("",!0)],64))),128))],8,vf))}}),yf={key:0},kf=["onClick"],bf=["aria-expanded","aria-controls","tabindex"],Bf=["id"],Cf={key:0,class:"sg-dropdown-divider",role:"separator"},wf=["onClick"],Sf=e.defineComponent({__name:"Dropdown",props:{items:{type:Array,required:!0},trigger:{type:String,default:"hover"},placement:{type:String,default:"bottomLeft"},disabled:{type:Boolean,default:void 0},unstyled:{type:Boolean,default:!1}},emits:["select"],setup(t,{emit:n}){let l=0;function a(){return`sg-dropdown-${++l}`}const o=t,s=n,{resolvedDisabled:v}=_e({disabled:void 0},{}),c=e.computed(()=>o.disabled??v.value),r=e.ref(!1),i=e.ref(-1),d=e.ref(null);let u;const p=a();function m(y,P){const S=o.items;let C=y;for(let b=0;b<S.length;b++)if(C=(C+P+S.length)%S.length,!S[C].divider&&!S[C].disabled)return C;return y}function k(){o.trigger!=="hover"||c.value||(u&&clearTimeout(u),r.value=!0)}function f(){o.trigger==="hover"&&(u=setTimeout(()=>r.value=!1,100))}function w(){o.trigger!=="click"||c.value||(r.value=!r.value)}function B(y){y.disabled||(r.value=!1,s("select",y.key))}function E(y){if(!c.value)switch(y.key){case"Enter":case" ":y.preventDefault(),r.value&&i.value>=0&&!o.items[i.value].divider?B(o.items[i.value]):r.value=!r.value;break;case"Escape":y.preventDefault(),r.value=!1;break;case"ArrowDown":y.preventDefault(),r.value?i.value=m(i.value,1):(r.value=!0,i.value=m(-1,1));break;case"ArrowUp":y.preventDefault(),r.value?i.value=m(i.value,-1):(r.value=!0,i.value=m(o.items.length,-1));break;case"Home":r.value&&(y.preventDefault(),i.value=m(-1,1));break;case"End":r.value&&(y.preventDefault(),i.value=m(o.items.length,-1));break}}function N(y){d.value&&!d.value.contains(y.target)&&(r.value=!1)}e.watch(r,y=>{y?document.addEventListener("mousedown",N):(i.value=-1,document.removeEventListener("mousedown",N))},{immediate:!0}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",N),u&&clearTimeout(u)});const x=e.computed(()=>`sg-dropdown sg-dropdown-${o.placement}`);return(y,P)=>t.unstyled?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"wrapperRef",ref:d,style:{position:"relative",display:"inline-block"}},[e.createElementVNode("div",{onClick:w,onMouseenter:k,onMouseleave:f},[e.renderSlot(y.$slots,"default")],32),r.value?(e.openBlock(),e.createElementBlock("div",{key:0,onMouseenter:k,onMouseleave:f},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(S,C)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:S.key},[S.divider?(e.openBlock(),e.createElementBlock("hr",yf)):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:b=>B(S)},[e.renderSlot(y.$slots,"item",{item:S,index:C,focused:C===i.value},()=>[e.createTextVNode(e.toDisplayString(S.label),1)])],8,kf))],64))),128))],32)):e.createCommentVNode("",!0)],512)):(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"wrapperRef",ref:d,class:"sg-dropdown-wrapper",onMouseenter:k,onMouseleave:f},[e.createElementVNode("div",{class:"sg-dropdown-trigger","aria-expanded":r.value,"aria-haspopup":"menu","aria-controls":e.unref(p),tabindex:c.value?-1:0,onClick:w,onKeydown:E},[e.renderSlot(y.$slots,"default")],40,bf),e.createVNode(ot,{visible:r.value,name:"sg-slide-up"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(x.value),role:"menu",id:e.unref(p),onMouseenter:k,onMouseleave:f},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(S,C)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:S.key},[S.divider?(e.openBlock(),e.createElementBlock("div",Cf)):(e.openBlock(),e.createElementBlock("div",{key:1,role:"menuitem",class:e.normalizeClass(["sg-dropdown-item",S.disabled?"sg-dropdown-item-disabled":"",S.danger?"sg-dropdown-item-danger":"",C===i.value?"sg-dropdown-item-focused":""]),onClick:b=>B(S)},[e.renderSlot(y.$slots,"item",{item:S,index:C,focused:C===i.value},()=>[e.createTextVNode(e.toDisplayString(S.label),1)])],10,wf))],64))),128))],42,Bf)]),_:3},8,["visible"])],544))}}),Ef={key:0},xf=["data-status","onClick"],$f={key:0},Nf=["aria-current","onClick"],Vf={class:"sg-steps-item-container"},Df={class:"sg-steps-item-icon"},zf={key:0,class:"sg-steps-icon-custom"},Tf={key:1,class:"sg-steps-icon"},Lf={key:0,viewBox:"64 64 896 896",width:"1em",height:"1em",fill:"currentColor"},Mf={key:1,viewBox:"64 64 896 896",width:"1em",height:"1em",fill:"currentColor"},Ff={class:"sg-steps-item-content"},Af={class:"sg-steps-item-title"},Pf={key:0,class:"sg-steps-item-tail"},Rf={key:0,class:"sg-steps-item-description"},If={key:0,class:"sg-steps-item-tail-vertical"},Kf=e.defineComponent({__name:"Steps",props:{current:{},items:{},direction:{default:"horizontal"},size:{},type:{default:"default"},clickable:{type:Boolean,default:void 0},unstyled:{type:Boolean}},emits:["change"],setup(t,{emit:n}){const l=t,a=n,o=e.useSlots(),s=e.computed(()=>!!o.icon),{resolvedSize:v}=_e({size:void 0},{}),c=e.computed(()=>l.size??v.value),r=e.computed(()=>c.value==="small"?"small":"default"),i=e.getCurrentInstance(),d=e.computed(()=>{var w;if(l.clickable!==void 0)return l.clickable;const f=(w=i==null?void 0:i.vnode)==null?void 0:w.props;return!!(f&&(f.onChange||f.onChange))});function u(f,w){return w||(f<l.current?"finish":f===l.current?"process":"wait")}const p=e.computed(()=>["sg-steps",`sg-steps-${l.direction}`,`sg-steps-${r.value}`,l.type==="navigation"?"sg-steps-navigation":""].filter(Boolean).join(" "));function m(f,w){return["sg-steps-item",`sg-steps-item-${f}`,w?"sg-steps-item-clickable":""].filter(Boolean).join(" ")}function k(f){d.value&&a("change",f)}return(f,w)=>t.unstyled?(e.openBlock(),e.createElementBlock("div",Ef,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(B,E)=>(e.openBlock(),e.createElementBlock("div",{key:E,"data-status":u(E,B.status),onClick:N=>k(E)},[e.createElementVNode("span",null,[e.renderSlot(f.$slots,"icon",{item:B,index:E,status:u(E,B.status)},()=>[e.createTextVNode(e.toDisplayString(B.icon??(u(E,B.status)==="finish"?"✓":E+1)),1)])]),e.createElementVNode("span",null,e.toDisplayString(B.title),1),B.description?(e.openBlock(),e.createElementBlock("span",$f,e.toDisplayString(B.description),1)):e.createCommentVNode("",!0)],8,xf))),128))])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(p.value),role:"list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(B,E)=>(e.openBlock(),e.createElementBlock("div",{key:E,class:e.normalizeClass(m(u(E,B.status),d.value)),"aria-current":u(E,B.status)==="process"?"step":void 0,onClick:N=>k(E)},[e.createElementVNode("div",Vf,[e.createElementVNode("div",Df,[s.value||B.icon?(e.openBlock(),e.createElementBlock("span",zf,[e.renderSlot(f.$slots,"icon",{item:B,index:E,status:u(E,B.status)},()=>[e.createTextVNode(e.toDisplayString(B.icon),1)])])):(e.openBlock(),e.createElementBlock("span",Tf,[u(E,B.status)==="finish"?(e.openBlock(),e.createElementBlock("svg",Lf,[...w[0]||(w[0]=[e.createElementVNode("path",{d:"M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"},null,-1)])])):u(E,B.status)==="error"?(e.openBlock(),e.createElementBlock("svg",Mf,[...w[1]||(w[1]=[e.createElementVNode("path",{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L512 449.8 295.9 191.7c-3-3.6-7.5-5.7-12.3-5.7H203.8c-6.8 0-10.5 7.9-6.1 13.1L460.2 512 197.7 824.9A7.95 7.95 0 00203.8 838h79.8c4.7 0 9.2-2.1 12.3-5.7L512 574.1l216.1 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"},null,-1)])])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString(E+1),1)],64))]))]),e.createElementVNode("div",Ff,[e.createElementVNode("div",Af,[e.createTextVNode(e.toDisplayString(B.title)+" ",1),t.direction==="horizontal"&&E<t.items.length-1?(e.openBlock(),e.createElementBlock("span",Pf)):e.createCommentVNode("",!0)]),B.description?(e.openBlock(),e.createElementBlock("div",Rf,e.toDisplayString(B.description),1)):e.createCommentVNode("",!0)])]),t.direction==="vertical"&&E<t.items.length-1?(e.openBlock(),e.createElementBlock("div",If)):e.createCommentVNode("",!0)],10,Nf))),128))],2))}}),Of={key:0,role:"radiogroup"},Hf=["value","checked","disabled","onChange"],jf=["aria-checked","onClick"],_f={key:0,class:"sg-segmented-item-icon"},Yf={class:"sg-segmented-item-label"},Wf=e.defineComponent({__name:"Segmented",props:{options:{type:Array,required:!0},value:{type:String,default:void 0},modelValue:{type:String,default:void 0},defaultValue:{type:String,default:void 0},size:{type:String,default:void 0},disabled:{type:Boolean,default:void 0},block:{type:Boolean,default:!1},unstyled:{type:Boolean,default:!1}},emits:["change","update:value","update:modelValue"],setup(t,{emit:n}){var B;const l=t,a=n,o=e.useSlots(),s=e.computed(()=>!!o.icon),{resolvedSize:v,resolvedDisabled:c}=_e({size:void 0,disabled:void 0},{}),r=e.computed(()=>l.size??v.value),i=e.computed(()=>l.disabled??c.value);function d(E){return typeof E=="string"?{label:E,value:E}:E}const u=e.computed(()=>l.options.map(d)),p=l.value??l.modelValue??l.defaultValue??((B=d(l.options[0]))==null?void 0:B.value)??"",m=e.ref(p);e.watch(()=>l.value??l.modelValue,E=>{E!==void 0&&(m.value=E)});const k=e.computed(()=>l.value??l.modelValue??m.value);function f(E,N){i.value||N||(m.value=E,a("change",E),a("update:value",E),a("update:modelValue",E))}const w=e.computed(()=>["sg-segmented",`sg-segmented-${r.value}`,l.block?"sg-segmented-block":"",i.value?"sg-segmented-disabled":""].filter(Boolean).join(" "));return(E,N)=>t.unstyled?(e.openBlock(),e.createElementBlock("div",Of,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(x,y)=>(e.openBlock(),e.createElementBlock("label",{key:x.value},[e.createElementVNode("input",{type:"radio",name:"sg-segmented",value:x.value,checked:x.value===k.value,disabled:i.value||x.disabled,onChange:P=>f(x.value,x.disabled)},null,40,Hf),s.value||x.icon?e.renderSlot(E.$slots,"icon",{key:0,option:x,index:y},()=>[e.createTextVNode(e.toDisplayString(x.icon),1)]):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(x.label),1)]))),128))])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(w.value),role:"radiogroup"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(x,y)=>(e.openBlock(),e.createElementBlock("div",{key:x.value,role:"radio","aria-checked":x.value===k.value,class:e.normalizeClass(["sg-segmented-item",x.value===k.value?"sg-segmented-item-selected":"",x.disabled?"sg-segmented-item-disabled":""]),onClick:P=>f(x.value,x.disabled)},[s.value||x.icon?(e.openBlock(),e.createElementBlock("span",_f,[e.renderSlot(E.$slots,"icon",{option:x,index:y},()=>[e.createTextVNode(e.toDisplayString(x.icon),1)])])):e.createCommentVNode("",!0),e.createElementVNode("span",Yf,e.toDisplayString(x.label),1)],10,jf))),128))],2))}}),Uf={key:0,style:{position:"relative",display:"inline-block"}},qf={key:0},Xf={key:1},Gf={key:1,class:"sg-badge-status"},Jf={key:0,class:"sg-badge-status-text"},Zf=["aria-label"],Qf=e.defineComponent({__name:"Badge",props:{count:{},dot:{type:Boolean},overflowCount:{default:99},showZero:{type:Boolean},color:{},status:{},text:{},offset:{},unstyled:{type:Boolean}},setup(t){const n=t,l=e.useSlots(),a=e.computed(()=>!!l.default),o=e.computed(()=>n.count!==void 0&&(n.count>0||n.showZero)),s=e.computed(()=>o.value?n.count>n.overflowCount?`${n.overflowCount}+`:`${n.count}`:null),v=e.computed(()=>!a.value&&(o.value||!!n.dot)),c=e.computed(()=>n.offset&&!v.value?{right:`${-n.offset[0]}px`,marginTop:`${n.offset[1]}px`}:void 0),r=e.computed(()=>n.color?{background:n.color}:void 0);return(i,d)=>t.unstyled?(e.openBlock(),e.createElementBlock("span",Uf,[e.renderSlot(i.$slots,"default"),t.dot||o.value?(e.openBlock(),e.createElementBlock("sup",qf,e.toDisplayString(s.value),1)):e.createCommentVNode("",!0),t.status?(e.openBlock(),e.createElementBlock("span",Xf,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0)])):t.status&&!a.value?(e.openBlock(),e.createElementBlock("span",Gf,[e.createElementVNode("span",{class:e.normalizeClass(`sg-badge-status-dot sg-badge-status-${t.status}`),style:e.normalizeStyle(r.value)},null,6),t.text?(e.openBlock(),e.createElementBlock("span",Jf,e.toDisplayString(t.text),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(["sg-badge",v.value?"sg-badge-standalone":null])},[e.renderSlot(i.$slots,"default"),t.dot&&!o.value?(e.openBlock(),e.createElementBlock("sup",{key:0,class:"sg-badge-dot",style:e.normalizeStyle({...c.value??{},...r.value??{}})},null,4)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("sup",{key:1,class:"sg-badge-count",style:e.normalizeStyle({...c.value??{},...r.value??{}}),"aria-label":s.value??void 0},e.toDisplayString(s.value),13,Zf)):e.createCommentVNode("",!0)],2))}}),eh={key:0},th=["aria-label"],lh=e.defineComponent({__name:"Tag",props:{color:{default:"default"},closable:{type:Boolean},bordered:{type:Boolean,default:!0},unstyled:{type:Boolean}},emits:["close"],setup(t,{emit:n}){const l=t,a=n,o=new Set(["default","success","error","warning","processing"]),s=e.computed(()=>o.has(l.color)),v=e.computed(()=>["sg-tag",s.value?`sg-tag-${l.color}`:"",l.bordered?"":"sg-tag-borderless"].filter(Boolean).join(" ")),c=e.computed(()=>s.value?void 0:{background:l.color,borderColor:l.color,color:"#fff"}),r=Ce(),i=e.computed(()=>{var u,p;return((p=(u=r.value.locale)==null?void 0:u.tag)==null?void 0:p.closeAriaLabel)??"Close"});function d(u){u.stopPropagation(),a("close")}return(u,p)=>t.unstyled?(e.openBlock(),e.createElementBlock("span",eh,[e.renderSlot(u.$slots,"default"),t.closable?(e.openBlock(),e.createElementBlock("span",{key:0,role:"button",onClick:d},"×")):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(v.value),style:e.normalizeStyle(c.value)},[e.renderSlot(u.$slots,"default"),t.closable?(e.openBlock(),e.createElementBlock("span",{key:0,class:"sg-tag-close",role:"button","aria-label":i.value,onClick:d}," × ",8,th)):e.createCommentVNode("",!0)],6))}}),ah=["aria-label"],nh=["src","alt"],oh=["aria-label"],sh=["src","alt"],rh={key:1,class:"sg-avatar-icon"},ih={key:2,class:"sg-avatar-text"},ch=e.defineComponent({__name:"Avatar",props:{src:{},alt:{},ariaLabel:{},size:{},shape:{default:"circle"},unstyled:{type:Boolean}},setup(t){const n=t,l=Ce(),a={small:24,default:32,large:40},o=e.computed(()=>n.size??l.value.size??"middle"),s=e.computed(()=>{const p=o.value;return typeof p=="number"?p:p==="middle"?"default":p}),v=e.computed(()=>{const p=o.value;return typeof p=="number"?p:a[s.value]}),c=e.computed(()=>Math.round(v.value*.45)),r=e.useSlots(),i=e.computed(()=>!!r.icon),d=e.computed(()=>["sg-avatar",`sg-avatar-${n.shape}`,typeof o.value=="string"?`sg-avatar-${s.value}`:""].filter(Boolean).join(" ")),u=e.computed(()=>({width:`${v.value}px`,height:`${v.value}px`,lineHeight:`${v.value}px`,fontSize:n.src?void 0:`${c.value}px`}));return(p,m)=>t.unstyled?(e.openBlock(),e.createElementBlock("span",{key:0,role:"img","aria-label":t.ariaLabel},[t.src?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.src,alt:t.alt},null,8,nh)):i.value?e.renderSlot(p.$slots,"icon",{key:1}):e.renderSlot(p.$slots,"default",{key:2})],8,ah)):(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(d.value),style:e.normalizeStyle(u.value),role:"img","aria-label":t.ariaLabel},[t.src?(e.openBlock(),e.createElementBlock("img",{key:0,class:"sg-avatar-image",src:t.src,alt:t.alt},null,8,sh)):i.value?(e.openBlock(),e.createElementBlock("span",rh,[e.renderSlot(p.$slots,"icon")])):(e.openBlock(),e.createElementBlock("span",ih,[e.renderSlot(p.$slots,"default")]))],14,oh))}});function fa(t){const n=[];for(const l of t)if(l.type!==e.Comment&&l.type!==e.Text){if(l.type===e.Fragment&&Array.isArray(l.children)){n.push(...fa(l.children));continue}n.push(l)}return n}const uh=e.defineComponent({name:"SgCarousel",props:{autoplay:{type:Boolean,default:!1},autoplaySpeed:{type:Number,default:3e3},dots:{type:Boolean,default:!0},dotPosition:{type:String,default:"bottom"},effect:{type:String,default:"slide"},unstyled:{type:Boolean,default:!1}},setup(t,{slots:n}){const l=e.ref(0),a=e.ref(0);let o;function s(d,u){if(u===0){l.value=0;return}l.value=(d%u+u)%u}function v(){o&&clearInterval(o);const d=a.value;!t.autoplay||d<=1||(o=setInterval(()=>s(l.value+1,d),t.autoplaySpeed))}e.watch(()=>[t.autoplay,t.autoplaySpeed,a.value],()=>v()),e.onBeforeUnmount(()=>{o&&clearInterval(o)});const c=e.computed(()=>t.dotPosition==="left"||t.dotPosition==="right"),r=Ce(),i=e.computed(()=>{var d,u;return((u=(d=r.value.locale)==null?void 0:d.carousel)==null?void 0:u.slide)??(p=>`Slide ${p}`)});return()=>{var k;const d=((k=n.default)==null?void 0:k.call(n))??[],u=fa(d),p=u.length;if(a.value!==p&&(a.value=p),l.value>=p&&p>0&&(l.value=p-1),t.unstyled)return e.h("div",null,[u[l.value]?e.h("div",null,[u[l.value]]):null,t.dots?e.h("div",null,u.map((f,w)=>e.h("button",{key:w,type:"button","aria-current":w===l.value,onClick:()=>s(w,p)},String(w+1)))):null]);const m=["sg-carousel",`sg-carousel-dots-${t.dotPosition}`,c.value?"sg-carousel-vertical":""].filter(Boolean).join(" ");return e.h("div",{class:m},[e.h("div",{class:"sg-carousel-container"},[e.h("div",{class:"sg-carousel-track"},u.map((f,w)=>e.h("div",{key:w,class:["sg-carousel-slide",w===l.value?"sg-carousel-slide-active":"",`sg-carousel-effect-${t.effect}`],style:t.effect==="slide"?{transform:`translateX(${(w-l.value)*100}%)`}:void 0,"aria-hidden":w!==l.value},[f])))]),t.dots&&p>1?e.h("div",{class:["sg-carousel-dots",c.value?"sg-carousel-dots-vertical":""]},u.map((f,w)=>e.h("button",{key:w,type:"button",class:["sg-carousel-dot",w===l.value?"sg-carousel-dot-active":""],"aria-label":i.value(w+1),onClick:()=>s(w,p)}))):null])}}}),dh={key:0},mh={key:0},ph={key:0,class:"sg-timeline-item-label"},vh={class:"sg-timeline-item-head-wrapper"},gh={key:0,class:"sg-timeline-item-tail"},fh={class:"sg-timeline-item-content"},hh=e.defineComponent({__name:"Timeline",props:{items:{},mode:{default:"left"},pending:{type:[String,Boolean]},reverse:{type:Boolean},unstyled:{type:Boolean}},setup(t){const n=t,l=e.computed(()=>{let c=n.items.map(r=>({...r}));return n.pending&&c.push({content:typeof n.pending=="boolean"?"":n.pending,__pending:!0}),n.reverse&&(c=c.reverse()),c}),a=e.computed(()=>!!n.pending);function o(c,r){return c.position?c.position:n.mode==="alternate"?r%2===0?"left":"right":n.mode}function s(c,r,i){return["sg-timeline-item",`sg-timeline-item-${o(c,r)}`,c.__pending??(a.value&&i)?"sg-timeline-item-pending":""].filter(Boolean).join(" ")}const v=e.computed(()=>`sg-timeline sg-timeline-${n.mode}`);return(c,r)=>t.unstyled?(e.openBlock(),e.createElementBlock("ul",dh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(i,d)=>(e.openBlock(),e.createElementBlock("li",{key:d},[c.$slots.label||i.label!==void 0?(e.openBlock(),e.createElementBlock("span",mh,[e.renderSlot(c.$slots,"label",{item:i,index:d},()=>[e.createTextVNode(e.toDisplayString(i.label),1)])])):e.createCommentVNode("",!0),e.createElementVNode("span",null,[e.renderSlot(c.$slots,"dot",{item:i,index:d,isPending:i.__pending??!1},()=>[e.createTextVNode(e.toDisplayString(i.dot??"●"),1)])]),e.createElementVNode("span",null,[e.renderSlot(c.$slots,"content",{item:i,index:d,isPending:i.__pending??!1},()=>[e.createTextVNode(e.toDisplayString(i.content),1)])])]))),128))])):(e.openBlock(),e.createElementBlock("ul",{key:1,class:e.normalizeClass(v.value),role:"list"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(i,d)=>(e.openBlock(),e.createElementBlock("li",{key:d,class:e.normalizeClass(s(i,d,d===l.value.length-1)),role:"listitem"},[c.$slots.label||i.label!==void 0?(e.openBlock(),e.createElementBlock("div",ph,[e.renderSlot(c.$slots,"label",{item:i,index:d},()=>[e.createTextVNode(e.toDisplayString(i.label),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",vh,[e.createElementVNode("div",{class:e.normalizeClass(["sg-timeline-item-head",i.dot||c.$slots.dot?"sg-timeline-item-head-custom":""]),style:e.normalizeStyle(i.color&&!i.dot&&!c.$slots.dot?{borderColor:i.color,color:i.color}:void 0)},[e.renderSlot(c.$slots,"dot",{item:i,index:d,isPending:i.__pending??!1},()=>[e.createTextVNode(e.toDisplayString(i.dot??""),1)])],6),d<l.value.length-1?(e.openBlock(),e.createElementBlock("div",gh)):e.createCommentVNode("",!0)]),e.createElementVNode("div",fh,[e.renderSlot(c.$slots,"content",{item:i,index:d,isPending:i.__pending??!1},()=>[e.createTextVNode(e.toDisplayString(i.content),1)])])],2))),128))],2))}}),yh={key:0,role:"list"},kh={key:0},bh=["colspan"],Bh={key:0,class:"sg-descriptions-title"},Ch={class:"sg-descriptions-table"},wh={class:"sg-descriptions-row"},Sh=["colspan"],Eh={key:0,class:"sg-descriptions-colon"},xh={class:"sg-descriptions-row"},$h=["colspan"],Nh={key:1,class:"sg-descriptions-row"},Vh={class:"sg-descriptions-item-label"},Dh={key:0,class:"sg-descriptions-colon"},zh=["colspan"],Th=e.defineComponent({__name:"Descriptions",props:{title:{},items:{},bordered:{type:Boolean,default:!1},column:{default:3},layout:{default:"horizontal"},colon:{type:Boolean,default:!0},size:{},unstyled:{type:Boolean}},setup(t){const n=t,{resolvedSize:l}=_e({size:void 0},{}),a=e.computed(()=>n.size??l.value),o=e.computed(()=>a.value==="small"?"small":"default");function s(r,i){const d=[];let u=[],p=0;for(const m of r){const k=Math.min(m.span??1,i);p+k>i&&(d.push(u),u=[],p=0),u.push(m),p+=k,p>=i&&(d.push(u),u=[],p=0)}return u.length>0&&d.push(u),d}const v=e.computed(()=>s(n.items,n.column)),c=e.computed(()=>["sg-descriptions",`sg-descriptions-${o.value}`,n.bordered?"sg-descriptions-bordered":""].filter(Boolean).join(" "));return(r,i)=>t.unstyled?(e.openBlock(),e.createElementBlock("div",yh,[t.title?(e.openBlock(),e.createElementBlock("div",kh,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("table",null,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(d,u)=>(e.openBlock(),e.createElementBlock("tr",{key:u},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d,(p,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:p.key??m},[e.createElementVNode("th",null,e.toDisplayString(p.label)+e.toDisplayString(t.colon?":":""),1),e.createElementVNode("td",{colspan:p.span},e.toDisplayString(p.value),9,bh)],64))),128))]))),128))])])])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(c.value),role:"list"},[t.title?(e.openBlock(),e.createElementBlock("div",Bh,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),e.createElementVNode("table",Ch,[e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(d,u)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:u},[t.layout==="vertical"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("tr",wh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d,(p,m)=>(e.openBlock(),e.createElementBlock("th",{key:`label-${p.key??m}`,class:"sg-descriptions-item-label",colspan:p.span??1},[e.createTextVNode(e.toDisplayString(p.label)+" ",1),t.colon?(e.openBlock(),e.createElementBlock("span",Eh,":")):e.createCommentVNode("",!0)],8,Sh))),128))]),e.createElementVNode("tr",xh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d,(p,m)=>(e.openBlock(),e.createElementBlock("td",{key:`value-${p.key??m}`,class:"sg-descriptions-item-content",colspan:p.span??1},e.toDisplayString(p.value),9,$h))),128))])],64)):(e.openBlock(),e.createElementBlock("tr",Nh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d,(p,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:p.key??m},[e.createElementVNode("th",Vh,[e.createTextVNode(e.toDisplayString(p.label)+" ",1),t.colon?(e.openBlock(),e.createElementBlock("span",Dh,":")):e.createCommentVNode("",!0)]),e.createElementVNode("td",{class:"sg-descriptions-item-content",colspan:p.span??1},e.toDisplayString(p.value),9,zh)],64))),128))]))],64))),128))])])],2))}}),Lh={key:0},Mh=["disabled","aria-expanded","onClick"],Fh={key:0},Ah={key:0},Ph=["tabindex","aria-expanded","onClick","onKeydown"],Rh={class:"sg-collapse-header-text"},Ih={key:2,class:"sg-collapse-extra"},Kh=["onTransitionend"],Oh={class:"sg-collapse-content-inner"},Hh=e.defineComponent({__name:"Collapse",props:{items:{},activeKey:{},defaultActiveKey:{},accordion:{type:Boolean,default:!1},bordered:{type:Boolean,default:!0},expandIconPosition:{default:"start"},ghost:{type:Boolean,default:!1},size:{},unstyled:{type:Boolean}},emits:["change"],setup(t,{emit:n}){const l=t,a=n,{resolvedSize:o}=_e({size:void 0},{}),s=e.computed(()=>l.size??o.value);function v(y){return y===void 0?[]:Array.isArray(y)?y:[y]}const c=e.ref(v(l.activeKey??l.defaultActiveKey)),r=e.computed(()=>l.activeKey!==void 0?v(l.activeKey):c.value);function i(y){let P;l.accordion?P=r.value.includes(y)?[]:[y]:P=r.value.includes(y)?r.value.filter(S=>S!==y):[...r.value,y],c.value=P,a("change",P)}const d=e.computed(()=>["sg-collapse",l.bordered?"sg-collapse-bordered":"",l.ghost?"sg-collapse-ghost":"",`sg-collapse-${s.value}`].filter(Boolean).join(" "));function u(y){return["sg-collapse-panel",r.value.includes(y.key)?"sg-collapse-panel-active":"",y.disabled?"sg-collapse-panel-disabled":""].filter(Boolean).join(" ")}function p(y){return["sg-collapse-arrow",r.value.includes(y.key)?"sg-collapse-arrow-open":""].filter(Boolean).join(" ")}function m(y){return r.value.includes(y)}function k(y,P){P.disabled||(y.key==="Enter"||y.key===" ")&&(y.preventDefault(),i(P.key))}const f=e.ref(new Map),w=e.ref(new Map);function B(y,P){P?f.value.set(y,P):f.value.delete(y)}function E(y){const P=w.value.get(y.key),S=m(y.key);let C;return P!=null?C=`${P}px`:S?C="none":C="0px",{"--sg-collapse-content-max-height":C}}function N(y){const P=f.value.get(y.key);P&&(m(y.key)?w.value.set(y.key,P.scrollHeight):(w.value.set(y.key,P.scrollHeight),requestAnimationFrame(()=>{w.value.set(y.key,0),w.value=new Map(w.value)})),w.value=new Map(w.value))}function x(y){m(y.key)&&(w.value.set(y.key,null),w.value=new Map(w.value))}return e.onMounted(()=>{for(const y of l.items)if(m(y.key)){const P=f.value.get(y.key);P&&w.value.set(y.key,P.scrollHeight)}w.value=new Map(w.value)}),e.watch(r,(y,P)=>{const S=new Set(P??[]),C=new Set(y??[]),b=[];for(const $ of l.items){const T=S.has($.key),z=C.has($.key);T!==z&&b.push($.key)}b.length!==0&&e.nextTick(()=>{for(const $ of b){const T=l.items.find(z=>z.key===$);T&&N(T)}})}),(y,P)=>t.unstyled?(e.openBlock(),e.createElementBlock("div",Lh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,S=>(e.openBlock(),e.createElementBlock("div",{key:S.key},[e.createElementVNode("button",{type:"button",disabled:S.disabled,"aria-expanded":m(S.key),onClick:C=>!S.disabled&&i(S.key)},[e.createTextVNode(e.toDisplayString(S.label)+" ",1),S.extra?(e.openBlock(),e.createElementBlock("span",Fh,e.toDisplayString(S.extra),1)):e.createCommentVNode("",!0)],8,Mh),m(S.key)?(e.openBlock(),e.createElementBlock("div",Ah,[e.renderSlot(y.$slots,"panel",{item:S},()=>[e.createTextVNode(e.toDisplayString(S.content),1)])])):e.createCommentVNode("",!0)]))),128))])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(d.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,S=>(e.openBlock(),e.createElementBlock("div",{key:S.key,class:e.normalizeClass(u(S))},[e.createElementVNode("div",{class:"sg-collapse-header",role:"button",tabindex:S.disabled?-1:0,"aria-expanded":m(S.key),onClick:C=>!S.disabled&&i(S.key),onKeydown:C=>k(C,S)},[t.expandIconPosition==="start"&&S.showArrow!==!1?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(p(S))},null,2)):e.createCommentVNode("",!0),e.createElementVNode("span",Rh,e.toDisplayString(S.label),1),t.expandIconPosition==="end"&&S.showArrow!==!1?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(p(S))},null,2)):e.createCommentVNode("",!0),S.extra?(e.openBlock(),e.createElementBlock("span",Ih,e.toDisplayString(S.extra),1)):e.createCommentVNode("",!0)],40,Ph),e.createElementVNode("div",{ref_for:!0,ref:C=>B(S.key,C),class:"sg-collapse-content",style:e.normalizeStyle(E(S)),onTransitionend:C=>x(S)},[e.createElementVNode("div",Oh,[e.renderSlot(y.$slots,"panel",{item:S},()=>[e.createTextVNode(e.toDisplayString(S.content),1)])])],44,Kh)],2))),128))],2))}}),jh={modal:{okText:"OK",cancelText:"Cancel",closeAriaLabel:"Close"},popconfirm:{okText:"Yes",cancelText:"No"},empty:{description:"No Data"},pagination:{totalPrefix:"Total",itemsPerPage:"/ page",jump:"Go to",page:"page",ariaLabel:"Pagination"},inputPassword:{showPassword:"Show password",hidePassword:"Hide password",strengthWeak:"Weak",strengthMedium:"Medium",strengthStrong:"Strong",strengthVeryStrong:"Very strong"},searchInput:{placeholder:"Search…",clear:"Clear",search:"Search"},tagInput:{placeholder:"Add tag…",removeTag:"Remove"},pinInput:{ariaLabel:"PIN input"},inlineEdit:{placeholder:"Click to edit…",save:"Save",cancel:"Cancel"},calendar:{monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],dayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],today:"Today",now:"Now",week:"W",prevYear:"Previous year",nextYear:"Next year",prevMonth:"Previous month",nextMonth:"Next month",month:"Month",year:"Year"},datePicker:{prevYear:"Previous year",nextYear:"Next year",prevMonth:"Previous month",nextMonth:"Next month"},form:{required:"*",optional:"(optional)",submitText:"Submit",resetText:"Reset"},upload:{uploadText:"Upload",removeFile:"Remove file",uploadError:"Upload failed",previewFile:"Preview",uploadAriaLabel:"Upload file"},transfer:{titles:["Source","Target"],searchPlaceholder:"Search",itemUnit:"item",itemsUnit:"items",notFoundContent:"Not found",selectAll:"Select all",deselectAll:"Deselect all"},drawer:{closeAriaLabel:"Close"},notification:{closeAriaLabel:"Close"},tag:{closeAriaLabel:"Close"},spin:{loading:"Loading"},skeleton:{loading:"Loading"},breadcrumb:{ariaLabel:"Breadcrumb"},carousel:{slide:t=>`Slide ${t}`},rate:{ariaLabel:"Rating",star:t=>`${t} star${t>1?"s":""}`},charts:{lineChart:"Line chart",barChart:"Bar chart",areaChart:"Area chart",pieChart:"Pie chart",legend:"Chart legend",actions:"Chart actions"},cascader:{searchPlaceholder:"Search...",noMatches:"No matches",clear:"Clear",removeTag:"Remove"},treeSelect:{searchPlaceholder:"Search...",noMatches:"No matches"},tree:{clearSearch:"Clear search"},dashboard:{ariaLabel:"Dashboard",editorAriaLabel:"Dashboard editor",resizeWidget:"Resize widget",widgetActions:"Widget actions"},gantt:{ariaLabel:"Gantt chart",resizeTask:"Resize task"},resourceCalendar:{ariaLabel:"Resource calendar",resource:t=>`Resource ${t}`,capacity:t=>`capacity ${t} per slot`,resizeStart:"Resize start",resizeEnd:"Resize end",conflictSuffix:" (conflict)"},timeline:{ariaLabel:"Timeline"},diagram:{ariaLabel:"Diagram"},dataGrid:{selectAllRows:"Select all rows",selectRow:"Select row"},schemaFormEditor:{undo:"Undo",redo:"Redo",removeOption:"Remove option",schemaView:"Generated JSON Schema",optionLabelPlaceholder:"Label",optionValuePlaceholder:"Value",moveFieldUp:"Move field up",moveFieldDown:"Move field down",duplicateField:"Duplicate field",deleteField:"Delete field"},list:{loading:"Loading"},table:{selectAll:"Select all"},input:{clear:"Clear"},colorPicker:{pickColor:"Pick color"}},_h={modal:{okText:"ОК",cancelText:"Отмена",closeAriaLabel:"Закрыть"},popconfirm:{okText:"Да",cancelText:"Нет"},empty:{description:"Нет данных"},pagination:{totalPrefix:"Всего",itemsPerPage:" / стр.",jump:"Перейти",page:"стр.",ariaLabel:"Постраничная навигация"},inputPassword:{showPassword:"Показать пароль",hidePassword:"Скрыть пароль",strengthWeak:"Слабый",strengthMedium:"Средний",strengthStrong:"Сильный",strengthVeryStrong:"Очень сильный"},searchInput:{placeholder:"Поиск…",clear:"Очистить",search:"Найти"},tagInput:{placeholder:"Добавить тег…",removeTag:"Удалить"},pinInput:{ariaLabel:"Ввод PIN-кода"},inlineEdit:{placeholder:"Нажмите для редактирования…",save:"Сохранить",cancel:"Отмена"},calendar:{monthNames:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],dayNames:["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],today:"Сегодня",now:"Сейчас",week:"Нед",prevYear:"Предыдущий год",nextYear:"Следующий год",prevMonth:"Предыдущий месяц",nextMonth:"Следующий месяц",month:"Месяц",year:"Год"},datePicker:{prevYear:"Предыдущий год",nextYear:"Следующий год",prevMonth:"Предыдущий месяц",nextMonth:"Следующий месяц"},form:{required:"*",optional:"(необязательно)",submitText:"Отправить",resetText:"Сбросить"},upload:{uploadText:"Загрузить",removeFile:"Удалить файл",uploadError:"Ошибка загрузки",previewFile:"Просмотр",uploadAriaLabel:"Загрузить файл"},transfer:{titles:["Источник","Цель"],searchPlaceholder:"Поиск",itemUnit:"элемент",itemsUnit:"элементов",notFoundContent:"Ничего не найдено",selectAll:"Выбрать все",deselectAll:"Снять выделение"},drawer:{closeAriaLabel:"Закрыть"},notification:{closeAriaLabel:"Закрыть"},tag:{closeAriaLabel:"Закрыть"},spin:{loading:"Загрузка"},skeleton:{loading:"Загрузка"},breadcrumb:{ariaLabel:"Хлебные крошки"},carousel:{slide:t=>`Слайд ${t}`},rate:{ariaLabel:"Рейтинг",star:t=>`${t} ${t===1?"звезда":t<5?"звезды":"звёзд"}`},charts:{lineChart:"Линейная диаграмма",barChart:"Столбчатая диаграмма",areaChart:"Диаграмма с областями",pieChart:"Круговая диаграмма",legend:"Легенда",actions:"Действия с диаграммой"},cascader:{searchPlaceholder:"Поиск...",noMatches:"Совпадений не найдено",clear:"Очистить",removeTag:"Удалить"},treeSelect:{searchPlaceholder:"Поиск...",noMatches:"Совпадений не найдено"},tree:{clearSearch:"Очистить поиск"},dashboard:{ariaLabel:"Дашборд",editorAriaLabel:"Редактор дашборда",resizeWidget:"Изменить размер виджета",widgetActions:"Действия виджета"},gantt:{ariaLabel:"Диаграмма Ганта",resizeTask:"Изменить длительность задачи"},resourceCalendar:{ariaLabel:"Календарь ресурсов",resource:t=>`Ресурс ${t}`,capacity:t=>`${t} на слот`,resizeStart:"Изменить начало",resizeEnd:"Изменить конец",conflictSuffix:" (конфликт)"},timeline:{ariaLabel:"Хронология"},diagram:{ariaLabel:"Диаграмма"},dataGrid:{selectAllRows:"Выбрать все строки",selectRow:"Выбрать строку"},schemaFormEditor:{undo:"Отменить",redo:"Повторить",removeOption:"Удалить опцию",schemaView:"Сгенерированная JSON-схема",optionLabelPlaceholder:"Подпись",optionValuePlaceholder:"Значение",moveFieldUp:"Переместить вверх",moveFieldDown:"Переместить вниз",duplicateField:"Дублировать поле",deleteField:"Удалить поле"},list:{loading:"Загрузка"},table:{selectAll:"Выбрать все"},input:{clear:"Очистить"},colorPicker:{pickColor:"Выбрать цвет"}},Yh={modal:{okText:"确定",cancelText:"取消",closeAriaLabel:"关闭"},popconfirm:{okText:"确定",cancelText:"取消"},empty:{description:"暂无数据"},pagination:{totalPrefix:"共",itemsPerPage:" 条/页",jump:"跳至",page:"页",ariaLabel:"分页"},inputPassword:{showPassword:"显示密码",hidePassword:"隐藏密码",strengthWeak:"弱",strengthMedium:"中",strengthStrong:"强",strengthVeryStrong:"非常强"},searchInput:{placeholder:"搜索…",clear:"清除",search:"搜索"},tagInput:{placeholder:"添加标签…",removeTag:"删除"},pinInput:{ariaLabel:"PIN 输入"},inlineEdit:{placeholder:"点击编辑…",save:"保存",cancel:"取消"},calendar:{monthNames:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],dayNames:["日","一","二","三","四","五","六"],today:"今天",now:"此刻",week:"周",prevYear:"上一年",nextYear:"下一年",prevMonth:"上个月",nextMonth:"下个月",month:"月",year:"年"},datePicker:{prevYear:"上一年",nextYear:"下一年",prevMonth:"上个月",nextMonth:"下个月"},form:{required:"*",optional:"(可选)",submitText:"提交",resetText:"重置"},upload:{uploadText:"上传",removeFile:"删除文件",uploadError:"上传失败",previewFile:"预览",uploadAriaLabel:"上传文件"},transfer:{titles:["源","目标"],searchPlaceholder:"搜索",itemUnit:"项",itemsUnit:"项",notFoundContent:"未找到",selectAll:"全选",deselectAll:"取消全选"},drawer:{closeAriaLabel:"关闭"},notification:{closeAriaLabel:"关闭"},tag:{closeAriaLabel:"关闭"},spin:{loading:"加载中"},skeleton:{loading:"加载中"},breadcrumb:{ariaLabel:"面包屑"},carousel:{slide:t=>`第 ${t} 张`},rate:{ariaLabel:"评分",star:t=>`${t} 星`},charts:{lineChart:"折线图",barChart:"柱状图",areaChart:"面积图",pieChart:"饼图",legend:"图例",actions:"图表操作"},cascader:{searchPlaceholder:"搜索...",noMatches:"无匹配项",clear:"清除",removeTag:"删除"},treeSelect:{searchPlaceholder:"搜索...",noMatches:"无匹配项"},tree:{clearSearch:"清除搜索"},dashboard:{ariaLabel:"仪表板",editorAriaLabel:"仪表板编辑器",resizeWidget:"调整组件大小",widgetActions:"组件操作"},gantt:{ariaLabel:"甘特图",resizeTask:"调整任务时长"},resourceCalendar:{ariaLabel:"资源日历",resource:t=>`资源 ${t}`,capacity:t=>`每槽 ${t}`,resizeStart:"调整开始",resizeEnd:"调整结束",conflictSuffix:"(冲突)"},timeline:{ariaLabel:"时间线"},diagram:{ariaLabel:"图表"},dataGrid:{selectAllRows:"全选",selectRow:"选择行"},schemaFormEditor:{undo:"撤销",redo:"重做",removeOption:"删除选项",schemaView:"生成的 JSON Schema",optionLabelPlaceholder:"标签",optionValuePlaceholder:"值",moveFieldUp:"上移字段",moveFieldDown:"下移字段",duplicateField:"复制字段",deleteField:"删除字段"},list:{loading:"加载中"},table:{selectAll:"全选"},input:{clear:"清除"},colorPicker:{pickColor:"选择颜色"}},Wh={modal:{okText:"OK",cancelText:"Abbrechen",closeAriaLabel:"Schließen"},popconfirm:{okText:"Ja",cancelText:"Nein"},empty:{description:"Keine Daten"},pagination:{totalPrefix:"Gesamt",itemsPerPage:" / Seite",jump:"Gehe zu",page:"Seite",ariaLabel:"Seitennavigation"},inputPassword:{showPassword:"Passwort anzeigen",hidePassword:"Passwort verbergen",strengthWeak:"Schwach",strengthMedium:"Mittel",strengthStrong:"Stark",strengthVeryStrong:"Sehr stark"},searchInput:{placeholder:"Suchen…",clear:"Leeren",search:"Suchen"},tagInput:{placeholder:"Tag hinzufügen…",removeTag:"Entfernen"},pinInput:{ariaLabel:"PIN-Eingabe"},inlineEdit:{placeholder:"Klicken zum Bearbeiten…",save:"Speichern",cancel:"Abbrechen"},calendar:{monthNames:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],dayNames:["So","Mo","Di","Mi","Do","Fr","Sa"],today:"Heute",now:"Jetzt",week:"KW",prevYear:"Vorheriges Jahr",nextYear:"Nächstes Jahr",prevMonth:"Vorheriger Monat",nextMonth:"Nächster Monat",month:"Monat",year:"Jahr"},datePicker:{prevYear:"Vorheriges Jahr",nextYear:"Nächstes Jahr",prevMonth:"Vorheriger Monat",nextMonth:"Nächster Monat"},form:{required:"*",optional:"(optional)",submitText:"Senden",resetText:"Zurücksetzen"},upload:{uploadText:"Hochladen",removeFile:"Datei entfernen",uploadError:"Hochladen fehlgeschlagen",previewFile:"Vorschau",uploadAriaLabel:"Datei hochladen"},transfer:{titles:["Quelle","Ziel"],searchPlaceholder:"Suchen",itemUnit:"Element",itemsUnit:"Elemente",notFoundContent:"Nicht gefunden",selectAll:"Alle auswählen",deselectAll:"Auswahl aufheben"},drawer:{closeAriaLabel:"Schließen"},notification:{closeAriaLabel:"Schließen"},tag:{closeAriaLabel:"Schließen"},spin:{loading:"Wird geladen"},skeleton:{loading:"Wird geladen"},breadcrumb:{ariaLabel:"Brotkrümelnavigation"},carousel:{slide:t=>`Folie ${t}`},rate:{ariaLabel:"Bewertung",star:t=>`${t} ${t===1?"Stern":"Sterne"}`},charts:{lineChart:"Liniendiagramm",barChart:"Balkendiagramm",areaChart:"Flächendiagramm",pieChart:"Tortendiagramm",legend:"Diagrammlegende",actions:"Diagrammaktionen"},cascader:{searchPlaceholder:"Suchen...",noMatches:"Keine Treffer",clear:"Leeren",removeTag:"Entfernen"},treeSelect:{searchPlaceholder:"Suchen...",noMatches:"Keine Treffer"},tree:{clearSearch:"Suche leeren"},dashboard:{ariaLabel:"Dashboard",editorAriaLabel:"Dashboard-Editor",resizeWidget:"Widget-Größe ändern",widgetActions:"Widget-Aktionen"},gantt:{ariaLabel:"Gantt-Diagramm",resizeTask:"Aufgabendauer ändern"},resourceCalendar:{ariaLabel:"Ressourcenkalender",resource:t=>`Ressource ${t}`,capacity:t=>`Kapazität ${t} pro Slot`,resizeStart:"Anfang verschieben",resizeEnd:"Ende verschieben",conflictSuffix:" (Konflikt)"},timeline:{ariaLabel:"Zeitleiste"},diagram:{ariaLabel:"Diagramm"},dataGrid:{selectAllRows:"Alle Zeilen auswählen",selectRow:"Zeile auswählen"},schemaFormEditor:{undo:"Rückgängig",redo:"Wiederholen",removeOption:"Option entfernen",schemaView:"Generiertes JSON-Schema",optionLabelPlaceholder:"Bezeichnung",optionValuePlaceholder:"Wert",moveFieldUp:"Feld nach oben verschieben",moveFieldDown:"Feld nach unten verschieben",duplicateField:"Feld duplizieren",deleteField:"Feld löschen"},list:{loading:"Wird geladen"},table:{selectAll:"Alle auswählen"},input:{clear:"Leeren"},colorPicker:{pickColor:"Farbe auswählen"}},Uh={modal:{okText:"OK",cancelText:"Annuler",closeAriaLabel:"Fermer"},popconfirm:{okText:"Oui",cancelText:"Non"},empty:{description:"Aucune donnée"},pagination:{totalPrefix:"Total",itemsPerPage:" / page",jump:"Aller à",page:"page",ariaLabel:"Pagination"},inputPassword:{showPassword:"Afficher le mot de passe",hidePassword:"Masquer le mot de passe",strengthWeak:"Faible",strengthMedium:"Moyen",strengthStrong:"Fort",strengthVeryStrong:"Très fort"},searchInput:{placeholder:"Rechercher…",clear:"Effacer",search:"Rechercher"},tagInput:{placeholder:"Ajouter un tag…",removeTag:"Supprimer"},pinInput:{ariaLabel:"Saisie PIN"},inlineEdit:{placeholder:"Cliquer pour modifier…",save:"Enregistrer",cancel:"Annuler"},calendar:{monthNames:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],dayNames:["Di","Lu","Ma","Me","Je","Ve","Sa"],today:"Aujourd'hui",now:"Maintenant",week:"Sem",prevYear:"Année précédente",nextYear:"Année suivante",prevMonth:"Mois précédent",nextMonth:"Mois suivant",month:"Mois",year:"Année"},datePicker:{prevYear:"Année précédente",nextYear:"Année suivante",prevMonth:"Mois précédent",nextMonth:"Mois suivant"},form:{required:"*",optional:"(facultatif)",submitText:"Envoyer",resetText:"Réinitialiser"},upload:{uploadText:"Téléverser",removeFile:"Supprimer le fichier",uploadError:"Échec du téléversement",previewFile:"Aperçu",uploadAriaLabel:"Téléverser un fichier"},transfer:{titles:["Source","Cible"],searchPlaceholder:"Rechercher",itemUnit:"élément",itemsUnit:"éléments",notFoundContent:"Introuvable",selectAll:"Tout sélectionner",deselectAll:"Tout désélectionner"},drawer:{closeAriaLabel:"Fermer"},notification:{closeAriaLabel:"Fermer"},tag:{closeAriaLabel:"Fermer"},spin:{loading:"Chargement"},skeleton:{loading:"Chargement"},breadcrumb:{ariaLabel:"Fil d'Ariane"},carousel:{slide:t=>`Diapositive ${t}`},rate:{ariaLabel:"Évaluation",star:t=>`${t} étoile${t>1?"s":""}`},charts:{lineChart:"Graphique en courbes",barChart:"Graphique à barres",areaChart:"Graphique en aires",pieChart:"Graphique en secteurs",legend:"Légende du graphique",actions:"Actions du graphique"},cascader:{searchPlaceholder:"Rechercher...",noMatches:"Aucun résultat",clear:"Effacer",removeTag:"Supprimer"},treeSelect:{searchPlaceholder:"Rechercher...",noMatches:"Aucun résultat"},tree:{clearSearch:"Effacer la recherche"},dashboard:{ariaLabel:"Tableau de bord",editorAriaLabel:"Éditeur du tableau de bord",resizeWidget:"Redimensionner le widget",widgetActions:"Actions du widget"},gantt:{ariaLabel:"Diagramme de Gantt",resizeTask:"Redimensionner la tâche"},resourceCalendar:{ariaLabel:"Calendrier des ressources",resource:t=>`Ressource ${t}`,capacity:t=>`capacité ${t} par créneau`,resizeStart:"Redimensionner le début",resizeEnd:"Redimensionner la fin",conflictSuffix:" (conflit)"},timeline:{ariaLabel:"Chronologie"},diagram:{ariaLabel:"Diagramme"},dataGrid:{selectAllRows:"Sélectionner toutes les lignes",selectRow:"Sélectionner la ligne"},schemaFormEditor:{undo:"Annuler",redo:"Rétablir",removeOption:"Supprimer l'option",schemaView:"Schéma JSON généré",optionLabelPlaceholder:"Libellé",optionValuePlaceholder:"Valeur",moveFieldUp:"Déplacer vers le haut",moveFieldDown:"Déplacer vers le bas",duplicateField:"Dupliquer le champ",deleteField:"Supprimer le champ"},list:{loading:"Chargement"},table:{selectAll:"Tout sélectionner"},input:{clear:"Effacer"},colorPicker:{pickColor:"Choisir une couleur"}},qh={modal:{okText:"Aceptar",cancelText:"Cancelar",closeAriaLabel:"Cerrar"},popconfirm:{okText:"Sí",cancelText:"No"},empty:{description:"Sin datos"},pagination:{totalPrefix:"Total",itemsPerPage:" / pág.",jump:"Ir a",page:"pág.",ariaLabel:"Paginación"},inputPassword:{showPassword:"Mostrar contraseña",hidePassword:"Ocultar contraseña",strengthWeak:"Débil",strengthMedium:"Medio",strengthStrong:"Fuerte",strengthVeryStrong:"Muy fuerte"},searchInput:{placeholder:"Buscar…",clear:"Limpiar",search:"Buscar"},tagInput:{placeholder:"Añadir etiqueta…",removeTag:"Eliminar"},pinInput:{ariaLabel:"Entrada de PIN"},inlineEdit:{placeholder:"Haga clic para editar…",save:"Guardar",cancel:"Cancelar"},calendar:{monthNames:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],dayNames:["Do","Lu","Ma","Mi","Ju","Vi","Sá"],today:"Hoy",now:"Ahora",week:"Sem",prevYear:"Año anterior",nextYear:"Año siguiente",prevMonth:"Mes anterior",nextMonth:"Mes siguiente",month:"Mes",year:"Año"},datePicker:{prevYear:"Año anterior",nextYear:"Año siguiente",prevMonth:"Mes anterior",nextMonth:"Mes siguiente"},form:{required:"*",optional:"(opcional)",submitText:"Enviar",resetText:"Restablecer"},upload:{uploadText:"Subir",removeFile:"Eliminar archivo",uploadError:"Error al subir",previewFile:"Vista previa",uploadAriaLabel:"Subir archivo"},transfer:{titles:["Origen","Destino"],searchPlaceholder:"Buscar",itemUnit:"elemento",itemsUnit:"elementos",notFoundContent:"No encontrado",selectAll:"Seleccionar todo",deselectAll:"Deseleccionar todo"},drawer:{closeAriaLabel:"Cerrar"},notification:{closeAriaLabel:"Cerrar"},tag:{closeAriaLabel:"Cerrar"},spin:{loading:"Cargando"},skeleton:{loading:"Cargando"},breadcrumb:{ariaLabel:"Ruta de navegación"},carousel:{slide:t=>`Diapositiva ${t}`},rate:{ariaLabel:"Calificación",star:t=>`${t} estrella${t>1?"s":""}`},charts:{lineChart:"Gráfico de líneas",barChart:"Gráfico de barras",areaChart:"Gráfico de áreas",pieChart:"Gráfico circular",legend:"Leyenda del gráfico",actions:"Acciones del gráfico"},cascader:{searchPlaceholder:"Buscar...",noMatches:"Sin coincidencias",clear:"Limpiar",removeTag:"Eliminar"},treeSelect:{searchPlaceholder:"Buscar...",noMatches:"Sin coincidencias"},tree:{clearSearch:"Limpiar búsqueda"},dashboard:{ariaLabel:"Panel",editorAriaLabel:"Editor del panel",resizeWidget:"Cambiar tamaño del widget",widgetActions:"Acciones del widget"},gantt:{ariaLabel:"Diagrama de Gantt",resizeTask:"Cambiar duración de la tarea"},resourceCalendar:{ariaLabel:"Calendario de recursos",resource:t=>`Recurso ${t}`,capacity:t=>`capacidad ${t} por franja`,resizeStart:"Mover el inicio",resizeEnd:"Mover el final",conflictSuffix:" (conflicto)"},timeline:{ariaLabel:"Línea de tiempo"},diagram:{ariaLabel:"Diagrama"},dataGrid:{selectAllRows:"Seleccionar todas las filas",selectRow:"Seleccionar fila"},schemaFormEditor:{undo:"Deshacer",redo:"Rehacer",removeOption:"Eliminar opción",schemaView:"Esquema JSON generado",optionLabelPlaceholder:"Etiqueta",optionValuePlaceholder:"Valor",moveFieldUp:"Mover campo arriba",moveFieldDown:"Mover campo abajo",duplicateField:"Duplicar campo",deleteField:"Eliminar campo"},list:{loading:"Cargando"},table:{selectAll:"Seleccionar todo"},input:{clear:"Limpiar"},colorPicker:{pickColor:"Elegir color"}};exports.DEFAULT_CHART_ANIMATION_MS=Qt;exports.DEFAULT_INDENT=Yl;exports.DEFAULT_PALETTE=Bt;exports.DEFAULT_PALETTE_ITEMS=aa;exports.DEFAULT_TABLE_LOCALE=jl;exports.DEFAULT_TREE_LOCALE=_l;exports.NODE_HEIGHT=Wl;exports.PALETTE_DATA_TYPE=Ft;exports.SgAreaChart=hs;exports.SgAutoComplete=bd;exports.SgAutoField=vl;exports.SgAvatar=ch;exports.SgBadge=Qf;exports.SgBarChart=ds;exports.SgBreadcrumb=hf;exports.SgButton=Ye;exports.SgCalendar=Yp;exports.SgCarousel=uh;exports.SgCascader=hv;exports.SgChartAxes=It;exports.SgChartBrush=rl;exports.SgChartCrosshair=Gl;exports.SgChartHoverToolbar=$s;exports.SgChartLegend=Et;exports.SgCheckbox=at;exports.SgCollapse=Hh;exports.SgColorPicker=Ed;exports.SgConfigProvider=Ka;exports.SgDashboard=er;exports.SgDashboardEditor=or;exports.SgDataGrid=zo;exports.SgDatePicker=mm;exports.SgDescriptions=Th;exports.SgDiagram=Js;exports.SgDrawer=tg;exports.SgDropdown=Sf;exports.SgEmpty=Yg;exports.SgEventTimeline=br;exports.SgField=pl;exports.SgForm=ml;exports.SgFormList=Xr;exports.SgFormProvider=Gr;exports.SgGantt=fr;exports.SgHistoryPanel=eu;exports.SgInlineEdit=Du;exports.SgInput=Mt;exports.SgInputGroup=Lu;exports.SgInputNumber=Ru;exports.SgInputPassword=su;exports.SgLineChart=ss;exports.SgList=yo;exports.SgMentions=Iv;exports.SgMenu=cf;exports.SgModal=qv;exports.SgNotificationContainer=ng;exports.SgPagination=bt;exports.SgPieChart=Ss;exports.SgPinInput=Cu;exports.SgPopconfirm=pg;exports.SgProgress=Dg;exports.SgRadio=sd;exports.SgRangePicker=lp;exports.SgRate=fd;exports.SgResourceCalendar=zr;exports.SgResult=Rg;exports.SgSchemaForm=la;exports.SgSchemaFormEditor=Yc;exports.SgSchemaFormEditorCanvas=ra;exports.SgSchemaFormEditorInspector=ia;exports.SgSchemaFormEditorPalette=na;exports.SgSchemaFormEditorSchemaView=ca;exports.SgSearchInput=mu;exports.SgSegmented=Wf;exports.SgSelect=ld;exports.SgSkeleton=Jg;exports.SgSlider=pd;exports.SgSpin=Ct;exports.SgSteps=Kf;exports.SgSubmitButton=Ei;exports.SgSwitch=dd;exports.SgTable=Un;exports.SgTabs=rf;exports.SgTag=lh;exports.SgTagInput=yu;exports.SgTextarea=Hu;exports.SgTimePicker=el;exports.SgTimeRangePicker=fp;exports.SgTimeline=hh;exports.SgTooltip=kg;exports.SgTransfer=Av;exports.SgTransition=ot;exports.SgTree=Zt;exports.SgTreeNodeRow=Jt;exports.SgTreeSelect=Lv;exports.SgUpload=qp;exports.SgVirtualList=ko;exports.buildPageRule=Ul;exports.buildPrintHtml=ql;exports.buildThemeVars=Hl;exports.chartBounds=Rt;exports.colorForSeries=nt;exports.createEmptyEditorSchema=sa;exports.createFieldFromPaletteType=hl;exports.de_DE=Wh;exports.defaultChartActions=ea;exports.downloadSvg=Zl;exports.downloadSvgAsPng=Ql;exports.editorSchemaToJsonSchema=Ot;exports.en_US=jh;exports.es_ES=qh;exports.formContextKey=vt;exports.formProviderContextKey=dl;exports.fr_FR=Uh;exports.jsonSchemaToDefaults=fl;exports.jsonSchemaToEditorSchema=Fi;exports.jsonSchemaToFields=ta;exports.jsonSchemaToRules=gl;exports.makeChartContextMenuHandler=As;exports.makeSeriesContextMenuHandler=Fs;exports.measureSvg=ul;exports.normalizePadding=Xl;exports.notification=ga;exports.printElement=st;exports.resolveBrushConfig=sl;exports.resolveChartActions=Ms;exports.resolveChartAnimation=St;exports.ru_RU=_h;exports.serializeSvg=il;exports.sgConfigKey=kt;exports.triggerDownload=cl;exports.useChartSize=wt;exports.useComputed=Na;exports.useConfig=Ce;exports.useConfigWithDefaults=_e;exports.useField=Pl;exports.useFieldArray=$a;exports.useFocusTrap=Pt;exports.useForm=At;exports.useGraph=Va;exports.useHistory=Ma;exports.useListNavigation=La;exports.useNotification=ag;exports.useRovingTabIndex=Ta;exports.useSchemaEditor=da;exports.useTable=Il;exports.useTree=Kl;exports.useVirtualScroll=nl;exports.useWatch=Rl;exports.zh_CN=Yh;exports.zodDefaults=Uc;exports.zodRule=ma;exports.zodRules=Wc;exports.zodToJsonSchema=qc;
23
23
  //# sourceMappingURL=index.cjs.map