dsp-semactic 0.6.37 → 0.6.39

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.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Gn=require("vue-i18n"),ia={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},ca=["value"],ua=["placeholder","value","disabled"],da=["placeholder","value"],ma={key:0,class:"dss-datepicker__double-wrap"},pa={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},fa=["onClick"],va={class:"dss-datepicker__double-calendars"},ga={class:"dss-datepicker__double-calendar"},ha={class:"dss-datepicker__calendar-header"},ya=["aria-label"],ka={class:"dss-datepicker__month-year-row"},Ca=["aria-label"],ba={class:"dss-datepicker__weekdays"},wa={class:"dss-datepicker__grid"},xa=["disabled","onClick","onMouseenter"],Ea={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Sa={class:"dss-datepicker__double-calendar"},Va={class:"dss-datepicker__calendar-header"},Na=["aria-label"],Ba={class:"dss-datepicker__month-year-row"},Ma=["aria-label"],_a={class:"dss-datepicker__weekdays"},$a={class:"dss-datepicker__grid"},La=["disabled","onClick","onMouseenter"],Ta={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Aa={class:"dss-datepicker__calendar-header"},Da=["aria-label"],Ha={class:"dss-datepicker__month-year-row"},Ra=["aria-label"],Ia={class:"dss-datepicker__weekdays"},Fa={class:"dss-datepicker__grid"},za=["disabled","onClick","onMouseenter"],Pa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Oa={class:"dss-datepicker__calendar-header"},Wa={class:"dss-datepicker__month-year-row"},Za={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},qa={class:"dss-datepicker__months-grid"},Ua=["onClick"],Xa={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},Ya={class:"dss-datepicker__month-year"},ja={class:"dss-datepicker__years-grid"},Ka=["data-year","onClick"],Yo=27,Wo={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:L=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(L)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0},placeholder:{type:String,default:""}},emits:["update:modelValue"],setup(L,{emit:ae}){const B=L,_=ae,{t:oe,locale:z}=Gn.useI18n(),$=e.ref(!1),X=e.ref("days"),Ke=new Date,pe=e.computed(()=>B.minDate instanceof Date?B.minDate:Ke),f=e.ref(pe.value.getMonth()),be=e.ref(pe.value.getFullYear()),fe=e.ref(pe.value.getMonth()),ne=e.ref(pe.value.getFullYear()),j=e.ref(pe.value.getMonth()),ue=e.ref(pe.value.getFullYear()),H=e.ref("start"),ke=e.ref(null),Me=e.ref(null);function ze(){const F=pe.value,q=F.getMonth(),P=F.getFullYear(),ce=q===11?0:q+1,Te=q===11?P+1:P;return{left:{month:q,year:P},right:{month:ce,year:Te}}}const tt=e.ref(null),R=e.ref(null),ge=e.ref(null),ve=e.ref(null),ie=e.ref(null),lt=e.ref(null),gt=new Date().getFullYear(),he=e.computed(()=>["single","singleFromAvailable"].includes(B.mode)),yt=e.computed(()=>["range","rangeFromAvailable"].includes(B.mode)),qe=e.computed(()=>{if(B.mode!=="single"&&B.mode!=="singleFromAvailable")return null;const F=B.modelValue;return F instanceof Date?F:null}),tl=e.computed(()=>{if(!yt.value)return{start:null,end:null};const F=B.modelValue;return!F||typeof F!="object"?{start:null,end:null}:{start:F.start instanceof Date?F.start:null,end:F.end instanceof Date?F.end:null}});function at(F){if(!F||!(F instanceof Date))return"";const q=F.getDate(),P=F.getMonth()+1,ce=F.getFullYear(),Te=it=>String(it).padStart(2,"0");return`${Te(q)}/${Te(P)}/${ce}`}const Et=e.computed(()=>at(qe.value)),Ht=e.computed(()=>{const{start:F,end:q}=tl.value;if(!F&&!q)return"";const P=!q||F&&F<=q?F:q,ce=!F||q&&q>=F?q:F;return W(P,ce)?at(P):`${at(P)} - ${at(ce)}`}),ll=e.computed(()=>{if(B.mode!=="readonly")return"—";const F=B.modelValue;if(F instanceof Date)return at(F)||"—";if(F&&typeof F=="object"&&("start"in F||"end"in F)){const q=F.start instanceof Date?F.start:null,P=F.end instanceof Date?F.end:null;if(!q&&!P)return"—";const ce=!P||q&&q<=P?q:P,Te=!q||P&&P>=q?P:q;return W(ce,Te)?at(ce):`${at(ce)} - ${at(Te)}`}return"—"});e.computed(()=>{const F=new Date(be.value,f.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(F)});const It=e.computed(()=>Me.value==="left"?fe.value:Me.value==="right"?j.value:f.value),ot=e.computed(()=>Me.value==="left"?ne.value:Me.value==="right"?ue.value:be.value),St=e.computed(()=>{const F=new Date(be.value,f.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(F)}),nl=e.computed(()=>{const F=new Date(ot.value,It.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(F)}),Ft=e.computed(()=>{const F=new Intl.DateTimeFormat(z.value,{month:"short"});return Array.from({length:12},(q,P)=>F.format(new Date(2024,P,1)))}),Yt=e.computed(()=>{const q=(Me.value?ot.value:be.value)-Math.floor(Yo/2);return Array.from({length:Yo},(P,ce)=>q+ce)}),Ge=e.computed(()=>{const F=Yt.value;return F.length?`${F[0]} – ${F[F.length-1]}`:""}),Je=e.computed(()=>{const F=new Intl.DateTimeFormat(z.value,{weekday:"short"}),q=new Date(2024,0,1),P=[];for(let ce=0;ce<7;ce++){const Te=new Date(q);Te.setDate(q.getDate()+ce),P.push(F.format(Te).slice(0,2))}return P});function Lt(F,q){const P=new Date(F,q,1),ce=new Date(F,q+1,0),Te=P.getDay(),it=ce.getDate(),ct=[];for(let Xe=0;Xe<Te;Xe++)ct.push(null);for(let Xe=1;Xe<=it;Xe++)ct.push(new Date(F,q,Xe));return ct}const Xt=e.computed(()=>Lt(be.value,f.value)),te=e.computed(()=>Lt(ne.value,fe.value)),$e=e.computed(()=>Lt(ue.value,j.value));e.computed(()=>{const F=new Date(ne.value,fe.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(F)}),e.computed(()=>{const F=new Date(ue.value,j.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(F)});const Ne=e.computed(()=>{const F=new Date(ne.value,fe.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(F)}),Oe=e.computed(()=>{const F=new Date(ue.value,j.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(F)}),st=e.computed(()=>B.availableDates&&B.availableDates.length>0),Ze=e.computed(()=>st.value?[{id:"all",labelKey:"datepicker.quickSelect.allDates"},{id:"last2",labelKey:"datepicker.quickSelect.last2Dates"},{id:"last3",labelKey:"datepicker.quickSelect.last3Dates"},{id:"last4",labelKey:"datepicker.quickSelect.last4Dates"},{id:"last5",labelKey:"datepicker.quickSelect.last5Dates"}]:[{id:"today",labelKey:"datepicker.quickSelect.today"},{id:"lastWeek",labelKey:"datepicker.quickSelect.lastWeek"},{id:"last15Days",labelKey:"datepicker.quickSelect.last15Days"},{id:"last30Days",labelKey:"datepicker.quickSelect.last30Days"},{id:"thisMonth",labelKey:"datepicker.quickSelect.thisMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),Ye=e.ref({top:0,left:0});function dt(){if(!ve.value||!$.value)return;const F=ve.value.getBoundingClientRect(),q=window.innerWidth||document.documentElement.clientWidth,P=window.innerHeight||document.documentElement.clientHeight;let ce=F.left,Te=F.bottom+4;const it=ie.value;if(it){const ct=it.offsetWidth,Xe=it.offsetHeight;if(ce+ct>q-8&&(ce=F.right-ct,ce<8&&(ce=8)),Te+Xe>P-8){const Ct=F.top-4-Xe;Ct>=8?Te=Ct:Te=Math.max(8,P-Xe-8)}}Ye.value={top:Te,left:ce}}const Le=e.computed(()=>!ve.value||!$.value?{}:{position:"fixed",left:`${Ye.value.left}px`,top:`${Ye.value.top}px`,zIndex:1002});function W(F,q){return!F||!q?!1:F.getFullYear()===q.getFullYear()&&F.getMonth()===q.getMonth()&&F.getDate()===q.getDate()}function U(F){return new Date(F.getFullYear(),F.getMonth(),F.getDate()).getTime()}function ee(F){return!B.availableDates||!B.availableDates.length?!0:B.availableDates.some(q=>q instanceof Date&&W(q,F))}function se(F){const q=U(F);return!(B.minDate instanceof Date&&q<U(B.minDate)||B.maxDate instanceof Date&&q>U(B.maxDate))}function He(F){return!B.exceptDates||!B.exceptDates.length?!1:B.exceptDates.some(q=>q instanceof Date&&W(q,F))}function rt(F){return He(F)?!1:["singleFromAvailable","rangeFromAvailable"].includes(B.mode)?ee(F):se(F)}function bt(F){const q=qe.value,P=tl.value,ce=U(F),Te=yt.value&&P.start&&P.end&&ce>U(P.start)&&ce<U(P.end),it=yt.value&&P.start&&W(F,P.start),ct=yt.value&&P.end&&W(F,P.end),Xe=it&&ct,Ct=he.value&&q&&W(F,q)||it||ct;let Zt=!1;if(yt.value&&P.start&&!P.end&&ke.value){const hl=U(P.start),Xl=U(ke.value),Ml=Math.min(hl,Xl),Yl=Math.max(hl,Xl);Zt=ce>Ml&&ce<Yl}return{"dss-datepicker__day--selected":Ct&&!Xe,"dss-datepicker__day--range-start":it&&!Xe,"dss-datepicker__day--range-end":ct&&!Xe,"dss-datepicker__day--range-single":Xe,"dss-datepicker__day--in-range":Te&&!it&&!ct,"dss-datepicker__day--in-range-preview":Zt&&!it&&!ct&&!Te,"dss-datepicker__day--disabled":!rt(F)}}function Re(F){if(!yt.value)return;const q=tl.value;if(!q.start||q.end){ke.value=null;return}if(!rt(F)){ke.value=null;return}ke.value=new Date(F.getFullYear(),F.getMonth(),F.getDate())}function ht(){ke.value=null}function Rt(){if(!B.doubleCalendar||!yt.value)return;const F=tl.value,{start:q,end:P}=F;if(q&&P){const it=q<=P?q:P,ct=q<=P?P:q,Xe=it.getMonth(),Ct=it.getFullYear(),Zt=ct.getMonth(),hl=ct.getFullYear();if(Xe!==Zt||Ct!==hl){const Xl=fe.value===Xe&&ne.value===Ct,Ml=j.value===Zt&&ue.value===hl;if(Xl&&Ml)return;fe.value=Xe,ne.value=Ct,j.value=Zt,ue.value=hl}else{const Xl=Xe===0?11:Xe-1,Ml=Xe===0?Ct-1:Ct;fe.value===Xl&&ne.value===Ml&&j.value===Xe&&ue.value===Ct||(fe.value=Xe,ne.value=Ct,Xe===11?(j.value=0,ue.value=Ct+1):(j.value=Xe+1,ue.value=Ct))}return}const ce=q||P;if(ce){const it=ce.getMonth(),ct=ce.getFullYear(),Xe=fe.value===it&&ne.value===ct,Ct=j.value===it&&ue.value===ct;if(Xe||Ct)return;fe.value=it,ne.value=ct,it===11?(j.value=0,ue.value=ct+1):(j.value=it+1,ue.value=ct);return}const Te=ze();fe.value=Te.left.month,ne.value=Te.left.year,j.value=Te.right.month,ue.value=Te.right.year}function jt(F="start"){if(B.mode==="readonly")return;H.value=F;const q=qe.value,P=tl.value;if(he.value&&q)f.value=q.getMonth(),be.value=q.getFullYear();else if(yt.value)if(B.doubleCalendar)Rt();else{const ce=F==="start"&&P.start?P.start:P.end||P.start;ce&&(f.value=ce.getMonth(),be.value=ce.getFullYear())}ve.value=he.value?tt.value?.closest(".dss-datepicker__input-wrap"):R.value,X.value="days",Me.value=null,$.value=!0,e.nextTick(()=>{dt()})}function Wt(){X.value="days",Me.value=null,ke.value=null,$.value=!1}function At(F,q){Me.value=F,X.value=q}function V(){X.value="days",Me.value=null}function C(F){const q=new Date,P=q.getFullYear(),ce=q.getMonth(),Te=q.getDate();let it,ct;if(st.value){const Xe=[...B.availableDates].filter(Ct=>Ct instanceof Date).map(Ct=>new Date(Ct.getFullYear(),Ct.getMonth(),Ct.getDate()));if(Xe.sort((Ct,Zt)=>Ct.getTime()-Zt.getTime()),Xe.length===0)return;if(F==="all")it=Xe[0],ct=Xe[Xe.length-1];else{const Ct=parseInt(F.replace("last",""),10);if(Ct<2||Ct>5)return;const Zt=Xe.slice(-Ct);it=Zt[0],ct=Zt[Zt.length-1]}}else{const Xe=new Date(P,ce,Te);switch(F){case"today":it=Xe,ct=Xe;break;case"lastWeek":it=new Date(P,ce,Te-6),ct=Xe;break;case"last15Days":it=new Date(P,ce,Te-14),ct=Xe;break;case"last30Days":it=new Date(P,ce,Te-29),ct=Xe;break;case"thisMonth":it=new Date(P,ce,1),ct=Xe;break;case"last3Months":it=new Date(P,ce-3,1),ct=new Date(P,ce,0);break;case"last6Months":it=new Date(P,ce-6,1),ct=new Date(P,ce,0);break;case"last12Months":it=new Date(P,ce-12,1),ct=new Date(P,ce,0);break;case"lastYear":it=new Date(P-1,0,1),ct=new Date(P-1,11,31);break;default:return}}_("update:modelValue",{start:it,end:ct}),Rt()}function S(F){Me.value==="left"?fe.value=F:Me.value==="right"?j.value=F:f.value=F,V()}function K(F){Me.value==="left"?ne.value=F:Me.value==="right"?ue.value=F:be.value=F,V()}function Q(){f.value===0?(f.value=11,be.value--):f.value--}function Ue(){f.value===11?(f.value=0,be.value++):f.value++}function mt(){fe.value===0?(fe.value=11,ne.value--):fe.value--}function Ee(){fe.value===11?(fe.value=0,ne.value++):fe.value++}function Ve(){j.value===0?(j.value=11,ue.value--):j.value--}function Tt(){j.value===11?(j.value=0,ue.value++):j.value++}function Dt(F){if(!rt(F))return;const q=new Date(F.getFullYear(),F.getMonth(),F.getDate());if(he.value){_("update:modelValue",q),Wt();return}const P=tl.value;if(!P.start&&!P.end){_("update:modelValue",{start:q,end:null}),H.value="end";return}if(P.start&&P.end){_("update:modelValue",{start:q,end:null}),H.value="end";return}if(H.value==="start"){let ce=q,Te=P.end;ce&&Te&&ce>Te&&([ce,Te]=[Te,ce]),_("update:modelValue",{start:ce||Te,end:Te||ce}),H.value="end"}else{let ce=P.start,Te=q;ce&&Te&&Te<ce&&([ce,Te]=[Te,ce]),_("update:modelValue",{start:ce||Te,end:Te||ce}),H.value="start"}}e.watch(tl,()=>{B.doubleCalendar&&yt.value&&$.value&&Rt()},{deep:!0});let Qe=null,pt=null,wt=null;function gl(){Qe&&(document.removeEventListener("keydown",Qe),Qe=null),pt&&(window.removeEventListener("resize",pt),pt=null),wt&&(window.removeEventListener("scroll",wt,!0),wt=null)}return e.watch(X,F=>{F==="years"&&e.nextTick(()=>{lt.value?.querySelector(`[data-year="${ot.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch($,F=>{gl(),F&&(Qe=q=>{q.key==="Escape"&&(X.value==="years"||X.value==="months"?V():Wt())},pt=()=>{dt()},wt=()=>{dt()},document.addEventListener("keydown",Qe),window.addEventListener("resize",pt),window.addEventListener("scroll",wt,!0))}),e.onBeforeUnmount(()=>{gl()}),(F,q)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":L.mode==="readonly"}])},[L.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",ia,[q[10]||(q[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:ll.value,readonly:"",disabled:"",tabindex:"-1"},null,8,ca)])):he.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:q[0]||(q[0]=P=>jt("start"))},[q[11]||(q[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:tt,type:"text",class:"dss-datepicker__input",placeholder:B.placeholder||e.unref(oe)("datepicker.selectDate"),value:Et.value,readonly:"",disabled:L.mode==="readonly"},null,8,ua)])):yt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:R,onClick:q[1]||(q[1]=P=>jt("start"))},[q[12]||(q[12]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputRangeRef",ref:ge,type:"text",class:"dss-datepicker__input",placeholder:B.placeholder||e.unref(oe)("datepicker.selectRange"),value:Ht.value,readonly:""},null,8,da)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[$.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(Wt,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ie,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":L.doubleCalendar&&yt.value&&X.value==="days","dss-datepicker__dropdown--quick-select":L.doubleCalendar&&yt.value&&X.value==="days"&&L.quickSelect}]),onClick:q[9]||(q[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Le.value)},[X.value==="days"&&L.doubleCalendar&&yt.value?(e.openBlock(),e.createElementBlock("div",ma,[L.quickSelect?(e.openBlock(),e.createElementBlock("nav",pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,P=>(e.openBlock(),e.createElementBlock("button",{key:P.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:ce=>C(P.id)},e.toDisplayString(e.unref(oe)(P.labelKey)),9,fa))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",va,[e.createElementVNode("div",ga,[e.createElementVNode("div",ha,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.prevMonth"),onClick:mt}," ‹ ",8,ya),e.createElementVNode("div",ka,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[2]||(q[2]=P=>At("left","months"))},e.toDisplayString(Ne.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[3]||(q[3]=P=>At("left","years"))},e.toDisplayString(ne.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.nextMonth"),onClick:Ee}," › ",8,Ca)]),e.createElementVNode("div",ba,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,P=>(e.openBlock(),e.createElementBlock("span",{key:P,class:"dss-datepicker__weekday"},e.toDisplayString(P),1))),128))]),e.createElementVNode("div",wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(P,ce)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+ce},[P?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",bt(P)]),disabled:!rt(P),onClick:Te=>Dt(P),onMouseenter:Te=>Re(P),onMouseleave:ht},e.toDisplayString(P.getDate()),43,xa)):(e.openBlock(),e.createElementBlock("span",Ea))],64))),128))])]),e.createElementVNode("div",Sa,[e.createElementVNode("div",Va,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.prevMonth"),onClick:Ve}," ‹ ",8,Na),e.createElementVNode("div",Ba,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[4]||(q[4]=P=>At("right","months"))},e.toDisplayString(Oe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[5]||(q[5]=P=>At("right","years"))},e.toDisplayString(ue.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.nextMonth"),onClick:Tt}," › ",8,Ma)]),e.createElementVNode("div",_a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,P=>(e.openBlock(),e.createElementBlock("span",{key:P,class:"dss-datepicker__weekday"},e.toDisplayString(P),1))),128))]),e.createElementVNode("div",$a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,(P,ce)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+ce},[P?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",bt(P)]),disabled:!rt(P),onClick:Te=>Dt(P),onMouseenter:Te=>Re(P),onMouseleave:ht},e.toDisplayString(P.getDate()),43,La)):(e.openBlock(),e.createElementBlock("span",Ta))],64))),128))])])])])):X.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Aa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.prevMonth"),onClick:Q}," ‹ ",8,Da),e.createElementVNode("div",Ha,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[6]||(q[6]=P=>X.value="months")},e.toDisplayString(St.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[7]||(q[7]=P=>X.value="years")},e.toDisplayString(be.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.nextMonth"),onClick:Ue}," › ",8,Ra)]),e.createElementVNode("div",Ia,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,P=>(e.openBlock(),e.createElementBlock("span",{key:P,class:"dss-datepicker__weekday"},e.toDisplayString(P),1))),128))]),e.createElementVNode("div",Fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xt.value,(P,ce)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ce},[P?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",bt(P)]),disabled:!rt(P),onClick:Te=>Dt(P),onMouseenter:Te=>Re(P),onMouseleave:ht},e.toDisplayString(P.getDate()),43,za)):(e.openBlock(),e.createElementBlock("span",Pa))],64))),128))])],64)):X.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Oa,[e.createElementVNode("div",Wa,[e.createElementVNode("span",Za,e.toDisplayString(nl.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[8]||(q[8]=P=>X.value="years")},e.toDisplayString(ot.value),1)])]),e.createElementVNode("div",qa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ft.value,(P,ce)=>(e.openBlock(),e.createElementBlock("button",{key:ce,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":ce===It.value}]),onClick:Te=>S(ce)},e.toDisplayString(P),11,Ua))),128))])],64)):X.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Xa,[e.createElementVNode("span",Ya,e.toDisplayString(Ge.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:lt},[e.createElementVNode("div",ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt.value,P=>(e.openBlock(),e.createElementBlock("button",{key:P,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":P===ot.value,"dss-datepicker__year-cell--current":P===e.unref(gt)}]),"data-year":P,onClick:ce=>K(P)},e.toDisplayString(P),11,Ka))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Ga=["data-chart-type"],Qa={class:"dss-chart-header-titles"},Ja={key:0,class:"dss-chart-title"},es={key:1,class:"dss-chart-subtitle"},ts=["onClick","onMouseenter"],ls={class:"dss-legend-text"},ns=["onClick","onMouseenter"],os={class:"dss-legend-text"},as=["title"],ss=["src"],rs={class:"dss-chart-area-wrapper"},is={key:0,class:"dss-chart-z-axis-label"},cs=["width","height","data-smooth","data-animated"],us=["id"],ds=["y","width","height"],ms=["id"],ps=["d"],fs=["id"],vs=["d"],gs={key:0},hs=["clip-path"],ys=["x1","x2","y1","y2"],ks={class:"dss-axes"},Cs=["x1","x2","y1","y2"],bs=["x1","x2","y1","y2"],ws={class:"dss-axis-labels"},xs=["x","y"],Es=["x","y"],Ss=["x","y"],Vs=["y","transform"],Ns={key:1,class:"dss-flag-markers"},Bs=["clip-path"],Ms=["x1","x2","y1","y2","onMouseover"],_s=["x1","x2","y1","y2","onMouseover"],$s=["x1","x2","y1","y2","onMouseover"],Ls=["cx","cy","onMouseover"],Ts=["cx","cy","fill","onMouseover"],As=["x","y"],Ds=["clip-path"],Hs={key:0},Rs=["d","onMouseover"],Is=["x","y","width","height","fill","onMouseover"],Fs={class:"dss-line-chart"},zs=["d","stroke","stroke-width"],Ps=["d","stroke","stroke-width","opacity"],Os=["cx","cy","r","fill","onMouseover"],Ws={key:1},Zs=["d","stroke","stroke-width"],qs=["d","stroke","stroke-width"],Us=["d","stroke","stroke-width","opacity"],Xs=["cx","cy","r","fill","onMouseover"],Ys={key:2},js=["id"],Ks=["x","y","width","height"],Gs=["d","fill","fill-opacity","mask"],Qs=["d","stroke","stroke-width"],Js=["d","fill","onMouseover"],er=["x","y","width","height","onMouseover"],tr=["clip-path"],lr=["x1","x2","y1","y2","stroke"],nr=["cx","cy","r","fill"],or={key:1,class:"dss-bubble-chart"},ar={key:0,class:"dss-bubble-group"},sr=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],rr=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],ir=["transform"],cr=["cx","cy","r"],ur=["data-chart-type","clip-path"],dr=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],mr={key:1,class:"dss-radial-segment-data-labels"},pr=["x","y"],fr=["x","y","font-size","fill"],vr=["x1","y1","x2","y2","stroke"],gr=["x1","y1","x2","y2","stroke"],hr=["x","y","text-anchor","font-size"],yr=["transform"],kr={key:0,class:"dss-spider-grid"},Cr=["cx","cy","r"],br={class:"dss-spider-grid-labels"},wr=["x","y"],xr=["x","y"],Er=["x1","x2","y1","y2"],Sr={class:"dss-spider-labels"},Vr=["x","y","text-anchor","dominant-baseline"],Nr=["points","fill","fill-opacity","stroke","stroke-width"],Br=["cx","cy","r","fill","onMouseover"],Mr={class:"dss-chart-logos"},_r=["cx","cy","r","fill"],$r=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Lr=["onClick","onMouseenter"],Tr=["src"],Ar={class:"dss-marker-tooltip-category"},Dr={key:0,class:"dss-marker-tooltip-description"},Hr={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},Rr={class:"dss-tooltip-title dss-spider-tooltip-area-title"},Ir={class:"dss-tooltip-series-name"},Fr={class:"dss-tooltip-series-value"},zr={key:1,class:"dss-tooltip-section"},Pr={key:0,class:"dss-tooltip-title"},Or={class:"dss-bubble-tooltip-data"},Wr={key:2,class:"dss-tooltip-section"},Zr={class:"dss-tooltip-title"},qr={class:"dss-tooltip-value"},Ur={key:0,class:"dss-tooltip-section"},Xr={class:"dss-tooltip-section-title"},Yr={class:"dss-tooltip-group-header"},jr={class:"dss-tooltip-item-content"},Kr={class:"dss-tooltip-item-text"},Gr={key:1,class:"dss-tooltip-section"},Qr={class:"dss-tooltip-section-title"},Jr={class:"dss-tooltip-item-content"},ei={class:"dss-tooltip-item-title"},ti={key:0,class:"dss-tooltip-item-description"},li={class:"dss-tooltip-section"},ni={class:"dss-tooltip-title"},oi={key:0,class:"dss-bubble-tooltip-data"},ai={class:"dss-tooltip-series-name"},si={class:"dss-tooltip-series-value"},ri={key:0,class:"dss-tooltip-section"},ii={class:"dss-tooltip-section-title"},ci={class:"dss-tooltip-group-header"},ui={class:"dss-tooltip-item-content"},di={class:"dss-tooltip-item-text"},mi={key:1,class:"dss-tooltip-section"},pi={class:"dss-tooltip-section-title"},fi={class:"dss-tooltip-item-content"},vi={class:"dss-tooltip-item-title"},gi={key:0,class:"dss-tooltip-item-description"},hi=["onClick","onMouseenter"],yi={class:"dss-legend-text"},ki={key:1,class:"dss-context-menu-separator"},Ci={key:0,class:"dss-context-menu-separator"},bi={key:0,class:"dss-context-menu-separator"},wi=["onClick"],xi=["innerHTML"],Ei={key:0,class:"dss-context-menu-icon"},Si={class:"dss-marker-modal-header"},Vi={class:"dss-marker-modal-body"},Ni={class:"dss-form-group"},Bi={class:"dss-form-group"},Mi={for:"dss-marker-description"},_i={key:0,class:"dss-form-text-display"},$i=["placeholder"],Li={class:"dss-marker-modal-footer"},Ti={class:"modal-footer-left"},Ai={class:"dss-modal-footer-right"},Di=["disabled"],Hi={name:"DSSChart"},Ri=Object.assign(Hi,{props:{series:{type:Array,required:!0,default:()=>[]},categories:{type:Array,default:()=>[]},flags:{type:Array,default:()=>[]},markers:{type:Array,default:()=>[]},showAddMarkerButton:{type:Boolean,default:!0},chartId:{type:String,default:()=>"chart-"+Math.random().toString(36).substring(2,9)},i18n:{type:Object,default:null},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:L=>typeof L=="object"&&L!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(L,{emit:ae}){const{t:B,locale:_}=Gn.useI18n(),oe=ae,z=e.ref(null),$=e.ref(null),X=e.ref(null),Ke=e.ref(0),pe=e.ref(0);let f=null,be=null;const fe=20,ne=e.computed(()=>{if(pe.value,Ke.value,!z.value||!$.value)return 0;try{const t=z.value.getBoundingClientRect();return $.value.getBoundingClientRect().top-t.top}catch{return 0}}),j=e.computed(()=>`chart-clip-${H.chartId}`),ue=e.computed(()=>`url(#${j.value})`),H=L,ke={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5},zoom:{enabled:!1,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function Me(t,s){const l=Object.assign({},t);return tt(t)&&tt(s)&&Object.keys(s).forEach(i=>{tt(s[i])?i in t?l[i]=Me(t[i],s[i]):Object.assign(l,{[i]:s[i]}):Object.assign(l,{[i]:s[i]})}),l}const ze=()=>{let t=20,s=0,l=0;if(at.value&&(t+=30),Et.value&&(t+=25),Ge.value&&H.series.length>0){const i=H.series.filter((p,g)=>!zt.value.has(g)).length;if(Je.value==="top"||Je.value==="bottom"){if(Lt.value==="horizontal"){const g=Math.floor(ie.value/100);s=Math.ceil(i/g)*25+10}else s=i*25+10;t+=s}else l=150}return{height:t,legendHeight:s,legendWidth:l}};function tt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const R=e.computed(()=>Me(ke,H.options)),ge=e.computed(()=>{const t=R.value;return t&&t.chart&&t.chart.width==="auto"}),ve=e.computed(()=>{const t=R.value;return t&&t.chart&&t.chart.height==="auto"}),ie=e.computed(()=>{const t=R.value;return ge.value?Ke.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),lt=e.ref(fe),gt=e.computed(()=>{if(ve.value){const t=gt.value;return t??Math.max(0,(pe.value||400)-lt.value*5)}}),he=e.computed(()=>{const t=R.value;if(ve.value){const s=gt.value;return s??Math.max(0,(pe.value||400)-lt.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),yt=e.computed(()=>{if(ve.value&&qe.value==="semi-radial"&&gt.value!=null)return lt.value+he.value+"px";if(ve.value)return"100%";if(pl.value)return lt.value+he.value+"px";if(Ge.value&&Je.value==="bottom"){const t=ze();return he.value+(t.legendHeight||35)+"px"}return he.value+(Ge.value?20:0)+"px"}),qe=e.computed(()=>{const t=R.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),tl=e.computed(()=>{const t=H.series.map(s=>s.type||qe.value);return new Set(t).size>1}),at=e.computed(()=>{const t=R.value;return t&&t.title&&t.title.text?t.title.text:""}),Et=e.computed(()=>{const t=R.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),Ht=e.computed(()=>{const t=R.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),ll=e.computed(()=>{const t=R.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),It=e.computed(()=>{const t=R.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),ot=e.computed(()=>{const t=R.value;if(!t||!t.yAxis)return mn;const s=t.yAxis.min;return typeof s=="number"||s===mn?s:mn}),St=e.computed(()=>{const t=R.value;if(!t||!t.yAxis)return mn;const s=t.yAxis.max;return typeof s=="number"||s===mn?s:mn}),nl=e.computed(()=>{const t=R.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Ft=e.computed(()=>{const t=R.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),Yt=e.computed(()=>{const t=R.value;return t&&t.grid&&t.grid.show!==!1}),Ge=e.computed(()=>{const t=R.value;return t&&t.legend&&t.legend.show!==!1}),Je=e.computed(()=>{const t=R.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Lt=e.computed(()=>{const t=R.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Xt=e.computed(()=>{const t=R.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),te=e.computed(()=>{const t=R.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),$e=e.computed(()=>{const t=R.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Ne=e.computed(()=>{const t=R.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Oe=e.computed(()=>{const t=R.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),st=e.computed(()=>{const t=R.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Ze=e.computed(()=>{const t=R.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Ye=e.computed(()=>{if(!pl.value)return 0;const t=R.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),dt=e.computed(()=>{const t=R.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),Le=e.computed(()=>{const{maxX:t}=Gt.value;return t===0}),W=(t,s)=>Le.value&&s===0?5:s,U=t=>{const s=Number(t);return!Number.isFinite(s)||s<=0?0:s},ee=e.computed(()=>{const t=R.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),se=e.computed(()=>{const t=R.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),He=e.computed(()=>{const t=R.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),rt=e.computed(()=>{const t=R.value;return se.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),bt=e.computed(()=>{const t=R.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),Re=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.enabled!==!1}),ht=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),Rt=e.computed(()=>{const t=R.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),jt=e.computed(()=>{const t=R.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),Wt=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),At=e.computed(()=>{const t=R.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),V=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.onDataChange!==!1}),C=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),S=e.computed(()=>{const t=R.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),K=e.computed(()=>R.value?.spider?.gridSteps||5),Q=e.computed(()=>{const t=[],s=K.value;for(let l=1;l<=s;l++)t.push(ft.value/s*l);return t}),Ue=t=>{const s=mt.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const l=Q.value[t];return Math.round(l/ft.value*100)+"%"},mt=e.computed(()=>R.value?.spider?.gridLabels||null),Ee=e.computed(()=>{const t=R.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Ve=e.computed(()=>{const t=R.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),Tt=e.computed(()=>{const t=R.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Dt=e.computed(()=>{const t=R.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Xl.value}),Qe=e.computed(()=>{const t=R.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),pt=e.computed(()=>{const t=R.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),wt=e.computed(()=>{const s=R.value?.valueFormat?.extension;return typeof s=="string"?s:""}),gl=t=>{const s=wt.value;if(t==null)return"";const l=String(t);return s?l+s:l},F=e.computed(()=>!le.value.isZooming);e.computed(()=>et.value.map(t=>{if(t.categoryIndex!==void 0&&(xl.value||sl.value)){const s=Qt(t.categoryIndex),l=ne.value+O.value.bottom-pt.value/2;return{...t,x:s,y:l}}return t}));function q(t,s){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,w,b]=t.split("-"),D=Number(b?.length===2?`20${b}`:b);l=new Date(D,Number(w)-1,Number(g))}else return 0;let i=0,p=1/0;return s.forEach((g,w)=>{const[b,D,A]=g.split("-"),I=Number(A?.length===2?`20${A}`:A),N=new Date(I,Number(D)-1,Number(b)),J=Math.abs(N-l);J<p&&(p=J,i=w)}),i}const P=e.computed(()=>{const t=H.markers.map(l=>{const i=q(l.marker_date,H.categories),p=Qt(i),g=ne.value+O.value.bottom-pt.value/2;return{...l,x:p,y:g,categoryIndex:i,source:"props"}}),s=et.value.map(l=>{if(l.categoryIndex!==void 0&&(xl.value||sl.value)){const i=Qt(l.categoryIndex),p=ne.value+O.value.bottom-pt.value/2;return{...l,x:i,y:p,source:"internal"}}return{...l,source:"internal"}});return[...t,...s]}),ce=e.computed(()=>{const t=R.value;return t&&t.watermark&&t.watermark.enabled===!0}),Te=e.computed(()=>{const t=R.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),it=e.computed(()=>{const t=R.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),ct=e.computed(()=>{const t=R.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),Xe=e.computed(()=>{const t={left:O.value.left,top:O.value.top,width:O.value.width,height:O.value.height};let s,l;const i=String(it.value);if(i.includes("%")){const p=parseFloat(i)/100;s=t.width*p,l=s*(96/499)}else{const p=parseFloat(i)||25;s=Math.min(t.width*.25,200)*(p/25),l=s*(96/499)}return{width:s,height:l,area:t}}),Ct=e.computed(()=>{const{width:t,height:s}=Xe.value,l=ct.value;let i,p;const g=O.value.left,w=O.value.right,b=O.value.top,D=O.value.bottom,A=O.value.width,I=O.value.height;switch(l){case"center":i=g+(A-t)/2,p=b+(I-s)/2;break;case"top-left":i=g+15,p=b+5;break;case"top-right":i=w-t-15,p=b+5;break;case"bottom-left":i=g+15,p=D-s-5;break;case"bottom-right":default:i=w-t-15,p=D-s-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${s}px`}}),Zt=t=>!H.flags||!H.flags.length?[]:H.flags.filter(s=>s.categoryIndex===t),hl=t=>{const s=Zt(t),l=$n(t),i=s.filter(w=>w.manual),p=s.filter(w=>!w.manual),g=[];return i.length>0&&g.push({type:B("chart.tooltip.manualFlags"),color:"#698dbe",flags:i.map(w=>({text:w.text,color:"#698dbe"}))}),p.length>0&&g.push({type:B("chart.tooltip.autoFlags"),color:"#a1d499",flags:p.map(w=>({text:w.text,color:"#a1d499"}))}),{flagGroups:g,markers:l.map(w=>({title:w.title,description:w.description,type:B("chart.tooltip.markers"),color:w.color||"#9784ba"}))}},Xl=e.computed(()=>{const t=H.old?`<svg width="55" height="56" viewBox="0 0 55 56" fill="none" xmlns="http://www.w3.org/2000/svg">
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Gn=require("vue-i18n"),ia={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},ca=["value"],ua=["placeholder","value","disabled"],da=["placeholder","value"],ma={key:0,class:"dss-datepicker__double-wrap"},pa={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},fa=["onClick"],va={class:"dss-datepicker__double-calendars"},ga={class:"dss-datepicker__double-calendar"},ha={class:"dss-datepicker__calendar-header"},ya=["aria-label"],ka={class:"dss-datepicker__month-year-row"},Ca=["aria-label"],ba={class:"dss-datepicker__weekdays"},wa={class:"dss-datepicker__grid"},xa=["disabled","onClick","onMouseenter"],Ea={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Sa={class:"dss-datepicker__double-calendar"},Va={class:"dss-datepicker__calendar-header"},Na=["aria-label"],Ba={class:"dss-datepicker__month-year-row"},Ma=["aria-label"],_a={class:"dss-datepicker__weekdays"},$a={class:"dss-datepicker__grid"},La=["disabled","onClick","onMouseenter"],Ta={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Aa={class:"dss-datepicker__calendar-header"},Da=["aria-label"],Ha={class:"dss-datepicker__month-year-row"},Ra=["aria-label"],Ia={class:"dss-datepicker__weekdays"},Fa={class:"dss-datepicker__grid"},za=["disabled","onClick","onMouseenter"],Pa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Oa={class:"dss-datepicker__calendar-header"},qa={class:"dss-datepicker__month-year-row"},Wa={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Za={class:"dss-datepicker__months-grid"},Ua=["onClick"],Xa={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},Ya={class:"dss-datepicker__month-year"},ja={class:"dss-datepicker__years-grid"},Ka=["data-year","onClick"],Yo=27,qo={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:L=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(L)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0},placeholder:{type:String,default:""}},emits:["update:modelValue"],setup(L,{emit:ae}){const B=L,_=ae,{t:oe,locale:z}=Gn.useI18n(),$=e.ref(!1),X=e.ref("days"),Ke=new Date,ve=e.computed(()=>B.minDate instanceof Date?B.minDate:Ke),f=e.ref(ve.value.getMonth()),be=e.ref(ve.value.getFullYear()),ge=e.ref(ve.value.getMonth()),ne=e.ref(ve.value.getFullYear()),j=e.ref(ve.value.getMonth()),ue=e.ref(ve.value.getFullYear()),H=e.ref("start"),ke=e.ref(null),Me=e.ref(null);function ze(){const F=ve.value,Z=F.getMonth(),P=F.getFullYear(),ce=Z===11?0:Z+1,Te=Z===11?P+1:P;return{left:{month:Z,year:P},right:{month:ce,year:Te}}}const lt=e.ref(null),R=e.ref(null),pe=e.ref(null),fe=e.ref(null),ie=e.ref(null),nt=e.ref(null),gt=new Date().getFullYear(),he=e.computed(()=>["single","singleFromAvailable"].includes(B.mode)),yt=e.computed(()=>["range","rangeFromAvailable"].includes(B.mode)),Ue=e.computed(()=>{if(B.mode!=="single"&&B.mode!=="singleFromAvailable")return null;const F=B.modelValue;return F instanceof Date?F:null}),tl=e.computed(()=>{if(!yt.value)return{start:null,end:null};const F=B.modelValue;return!F||typeof F!="object"?{start:null,end:null}:{start:F.start instanceof Date?F.start:null,end:F.end instanceof Date?F.end:null}});function st(F){if(!F||!(F instanceof Date))return"";const Z=F.getDate(),P=F.getMonth()+1,ce=F.getFullYear(),Te=ct=>String(ct).padStart(2,"0");return`${Te(Z)}/${Te(P)}/${ce}`}const xt=e.computed(()=>st(Ue.value)),Ht=e.computed(()=>{const{start:F,end:Z}=tl.value;if(!F&&!Z)return"";const P=!Z||F&&F<=Z?F:Z,ce=!F||Z&&Z>=F?Z:F;return q(P,ce)?st(P):`${st(P)} - ${st(ce)}`}),ll=e.computed(()=>{if(B.mode!=="readonly")return"—";const F=B.modelValue;if(F instanceof Date)return st(F)||"—";if(F&&typeof F=="object"&&("start"in F||"end"in F)){const Z=F.start instanceof Date?F.start:null,P=F.end instanceof Date?F.end:null;if(!Z&&!P)return"—";const ce=!P||Z&&Z<=P?Z:P,Te=!Z||P&&P>=Z?P:Z;return q(ce,Te)?st(ce):`${st(ce)} - ${st(Te)}`}return"—"});e.computed(()=>{const F=new Date(be.value,f.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(F)});const It=e.computed(()=>Me.value==="left"?ge.value:Me.value==="right"?j.value:f.value),at=e.computed(()=>Me.value==="left"?ne.value:Me.value==="right"?ue.value:be.value),Et=e.computed(()=>{const F=new Date(be.value,f.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(F)}),nl=e.computed(()=>{const F=new Date(at.value,It.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(F)}),Ft=e.computed(()=>{const F=new Intl.DateTimeFormat(z.value,{month:"short"});return Array.from({length:12},(Z,P)=>F.format(new Date(2024,P,1)))}),Yt=e.computed(()=>{const Z=(Me.value?at.value:be.value)-Math.floor(Yo/2);return Array.from({length:Yo},(P,ce)=>Z+ce)}),Ge=e.computed(()=>{const F=Yt.value;return F.length?`${F[0]} – ${F[F.length-1]}`:""}),et=e.computed(()=>{const F=new Intl.DateTimeFormat(z.value,{weekday:"short"}),Z=new Date(2024,0,1),P=[];for(let ce=0;ce<7;ce++){const Te=new Date(Z);Te.setDate(Z.getDate()+ce),P.push(F.format(Te).slice(0,2))}return P});function $t(F,Z){const P=new Date(F,Z,1),ce=new Date(F,Z+1,0),Te=P.getDay(),ct=ce.getDate(),ut=[];for(let Xe=0;Xe<Te;Xe++)ut.push(null);for(let Xe=1;Xe<=ct;Xe++)ut.push(new Date(F,Z,Xe));return ut}const Xt=e.computed(()=>$t(be.value,f.value)),te=e.computed(()=>$t(ne.value,ge.value)),$e=e.computed(()=>$t(ue.value,j.value));e.computed(()=>{const F=new Date(ne.value,ge.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(F)}),e.computed(()=>{const F=new Date(ue.value,j.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(F)});const Ne=e.computed(()=>{const F=new Date(ne.value,ge.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(F)}),qe=e.computed(()=>{const F=new Date(ue.value,j.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(F)}),rt=e.computed(()=>B.availableDates&&B.availableDates.length>0),Ze=e.computed(()=>rt.value?[{id:"all",labelKey:"datepicker.quickSelect.allDates"},{id:"last2",labelKey:"datepicker.quickSelect.last2Dates"},{id:"last3",labelKey:"datepicker.quickSelect.last3Dates"},{id:"last4",labelKey:"datepicker.quickSelect.last4Dates"},{id:"last5",labelKey:"datepicker.quickSelect.last5Dates"}]:[{id:"today",labelKey:"datepicker.quickSelect.today"},{id:"lastWeek",labelKey:"datepicker.quickSelect.lastWeek"},{id:"last15Days",labelKey:"datepicker.quickSelect.last15Days"},{id:"last30Days",labelKey:"datepicker.quickSelect.last30Days"},{id:"thisMonth",labelKey:"datepicker.quickSelect.thisMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),Ye=e.ref({top:0,left:0});function mt(){if(!fe.value||!$.value)return;const F=fe.value.getBoundingClientRect(),Z=window.innerWidth||document.documentElement.clientWidth,P=window.innerHeight||document.documentElement.clientHeight;let ce=F.left,Te=F.bottom+4;const ct=ie.value;if(ct){const ut=ct.offsetWidth,Xe=ct.offsetHeight;if(ce+ut>Z-8&&(ce=F.right-ut,ce<8&&(ce=8)),Te+Xe>P-8){const Ct=F.top-4-Xe;Ct>=8?Te=Ct:Te=Math.max(8,P-Xe-8)}}Ye.value={top:Te,left:ce}}const Le=e.computed(()=>!fe.value||!$.value?{}:{position:"fixed",left:`${Ye.value.left}px`,top:`${Ye.value.top}px`,zIndex:1002});function q(F,Z){return!F||!Z?!1:F.getFullYear()===Z.getFullYear()&&F.getMonth()===Z.getMonth()&&F.getDate()===Z.getDate()}function U(F){return new Date(F.getFullYear(),F.getMonth(),F.getDate()).getTime()}function ee(F){return!B.availableDates||!B.availableDates.length?!0:B.availableDates.some(Z=>Z instanceof Date&&q(Z,F))}function se(F){const Z=U(F);return!(B.minDate instanceof Date&&Z<U(B.minDate)||B.maxDate instanceof Date&&Z>U(B.maxDate))}function He(F){return!B.exceptDates||!B.exceptDates.length?!1:B.exceptDates.some(Z=>Z instanceof Date&&q(Z,F))}function it(F){return He(F)?!1:["singleFromAvailable","rangeFromAvailable"].includes(B.mode)?ee(F):se(F)}function bt(F){const Z=Ue.value,P=tl.value,ce=U(F),Te=yt.value&&P.start&&P.end&&ce>U(P.start)&&ce<U(P.end),ct=yt.value&&P.start&&q(F,P.start),ut=yt.value&&P.end&&q(F,P.end),Xe=ct&&ut,Ct=he.value&&Z&&q(F,Z)||ct||ut;let Wt=!1;if(yt.value&&P.start&&!P.end&&ke.value){const hl=U(P.start),Xl=U(ke.value),Ml=Math.min(hl,Xl),Yl=Math.max(hl,Xl);Wt=ce>Ml&&ce<Yl}return{"dss-datepicker__day--selected":Ct&&!Xe,"dss-datepicker__day--range-start":ct&&!Xe,"dss-datepicker__day--range-end":ut&&!Xe,"dss-datepicker__day--range-single":Xe,"dss-datepicker__day--in-range":Te&&!ct&&!ut,"dss-datepicker__day--in-range-preview":Wt&&!ct&&!ut&&!Te,"dss-datepicker__day--disabled":!it(F)}}function Re(F){if(!yt.value)return;const Z=tl.value;if(!Z.start||Z.end){ke.value=null;return}if(!it(F)){ke.value=null;return}ke.value=new Date(F.getFullYear(),F.getMonth(),F.getDate())}function ht(){ke.value=null}function Rt(){if(!B.doubleCalendar||!yt.value)return;const F=tl.value,{start:Z,end:P}=F;if(Z&&P){const ct=Z<=P?Z:P,ut=Z<=P?P:Z,Xe=ct.getMonth(),Ct=ct.getFullYear(),Wt=ut.getMonth(),hl=ut.getFullYear();if(Xe!==Wt||Ct!==hl){const Xl=ge.value===Xe&&ne.value===Ct,Ml=j.value===Wt&&ue.value===hl;if(Xl&&Ml)return;ge.value=Xe,ne.value=Ct,j.value=Wt,ue.value=hl}else{const Xl=Xe===0?11:Xe-1,Ml=Xe===0?Ct-1:Ct;ge.value===Xl&&ne.value===Ml&&j.value===Xe&&ue.value===Ct||(ge.value=Xe,ne.value=Ct,Xe===11?(j.value=0,ue.value=Ct+1):(j.value=Xe+1,ue.value=Ct))}return}const ce=Z||P;if(ce){const ct=ce.getMonth(),ut=ce.getFullYear(),Xe=ge.value===ct&&ne.value===ut,Ct=j.value===ct&&ue.value===ut;if(Xe||Ct)return;ge.value=ct,ne.value=ut,ct===11?(j.value=0,ue.value=ut+1):(j.value=ct+1,ue.value=ut);return}const Te=ze();ge.value=Te.left.month,ne.value=Te.left.year,j.value=Te.right.month,ue.value=Te.right.year}function jt(F="start"){if(B.mode==="readonly")return;H.value=F;const Z=Ue.value,P=tl.value;if(he.value&&Z)f.value=Z.getMonth(),be.value=Z.getFullYear();else if(yt.value)if(B.doubleCalendar)Rt();else{const ce=F==="start"&&P.start?P.start:P.end||P.start;ce&&(f.value=ce.getMonth(),be.value=ce.getFullYear())}fe.value=he.value?lt.value?.closest(".dss-datepicker__input-wrap"):R.value,X.value="days",Me.value=null,$.value=!0,e.nextTick(()=>{mt()})}function qt(){X.value="days",Me.value=null,ke.value=null,$.value=!1}function Dt(F,Z){Me.value=F,X.value=Z}function V(){X.value="days",Me.value=null}function C(F){const Z=new Date,P=Z.getFullYear(),ce=Z.getMonth(),Te=Z.getDate();let ct,ut;if(rt.value){const Xe=[...B.availableDates].filter(Ct=>Ct instanceof Date).map(Ct=>new Date(Ct.getFullYear(),Ct.getMonth(),Ct.getDate()));if(Xe.sort((Ct,Wt)=>Ct.getTime()-Wt.getTime()),Xe.length===0)return;if(F==="all")ct=Xe[0],ut=Xe[Xe.length-1];else{const Ct=parseInt(F.replace("last",""),10);if(Ct<2||Ct>5)return;const Wt=Xe.slice(-Ct);ct=Wt[0],ut=Wt[Wt.length-1]}}else{const Xe=new Date(P,ce,Te);switch(F){case"today":ct=Xe,ut=Xe;break;case"lastWeek":ct=new Date(P,ce,Te-6),ut=Xe;break;case"last15Days":ct=new Date(P,ce,Te-14),ut=Xe;break;case"last30Days":ct=new Date(P,ce,Te-29),ut=Xe;break;case"thisMonth":ct=new Date(P,ce,1),ut=Xe;break;case"last3Months":ct=new Date(P,ce-3,1),ut=new Date(P,ce,0);break;case"last6Months":ct=new Date(P,ce-6,1),ut=new Date(P,ce,0);break;case"last12Months":ct=new Date(P,ce-12,1),ut=new Date(P,ce,0);break;case"lastYear":ct=new Date(P-1,0,1),ut=new Date(P-1,11,31);break;default:return}}_("update:modelValue",{start:ct,end:ut}),Rt()}function S(F){Me.value==="left"?ge.value=F:Me.value==="right"?j.value=F:f.value=F,V()}function K(F){Me.value==="left"?ne.value=F:Me.value==="right"?ue.value=F:be.value=F,V()}function Q(){f.value===0?(f.value=11,be.value--):f.value--}function Oe(){f.value===11?(f.value=0,be.value++):f.value++}function pt(){ge.value===0?(ge.value=11,ne.value--):ge.value--}function Ee(){ge.value===11?(ge.value=0,ne.value++):ge.value++}function Ve(){j.value===0?(j.value=11,ue.value--):j.value--}function Tt(){j.value===11?(j.value=0,ue.value++):j.value++}function At(F){if(!it(F))return;const Z=new Date(F.getFullYear(),F.getMonth(),F.getDate());if(he.value){_("update:modelValue",Z),qt();return}const P=tl.value;if(!P.start&&!P.end){_("update:modelValue",{start:Z,end:null}),H.value="end";return}if(P.start&&P.end){_("update:modelValue",{start:Z,end:null}),H.value="end";return}if(H.value==="start"){let ce=Z,Te=P.end;ce&&Te&&ce>Te&&([ce,Te]=[Te,ce]),_("update:modelValue",{start:ce||Te,end:Te||ce}),H.value="end"}else{let ce=P.start,Te=Z;ce&&Te&&Te<ce&&([ce,Te]=[Te,ce]),_("update:modelValue",{start:ce||Te,end:Te||ce}),H.value="start"}}e.watch(tl,()=>{B.doubleCalendar&&yt.value&&$.value&&Rt()},{deep:!0});let Qe=null,Je=null,Lt=null;function gl(){Qe&&(document.removeEventListener("keydown",Qe),Qe=null),Je&&(window.removeEventListener("resize",Je),Je=null),Lt&&(window.removeEventListener("scroll",Lt,!0),Lt=null)}return e.watch(X,F=>{F==="years"&&e.nextTick(()=>{nt.value?.querySelector(`[data-year="${at.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch($,F=>{gl(),F&&(Qe=Z=>{Z.key==="Escape"&&(X.value==="years"||X.value==="months"?V():qt())},Je=()=>{mt()},Lt=()=>{mt()},document.addEventListener("keydown",Qe),window.addEventListener("resize",Je),window.addEventListener("scroll",Lt,!0))}),e.onBeforeUnmount(()=>{gl()}),(F,Z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":L.mode==="readonly"}])},[L.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",ia,[Z[10]||(Z[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:ll.value,readonly:"",disabled:"",tabindex:"-1"},null,8,ca)])):he.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:Z[0]||(Z[0]=P=>jt("start"))},[Z[11]||(Z[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:lt,type:"text",class:"dss-datepicker__input",placeholder:B.placeholder||e.unref(oe)("datepicker.selectDate"),value:xt.value,readonly:"",disabled:L.mode==="readonly"},null,8,ua)])):yt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:R,onClick:Z[1]||(Z[1]=P=>jt("start"))},[Z[12]||(Z[12]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputRangeRef",ref:pe,type:"text",class:"dss-datepicker__input",placeholder:B.placeholder||e.unref(oe)("datepicker.selectRange"),value:Ht.value,readonly:""},null,8,da)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[$.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(qt,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ie,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":L.doubleCalendar&&yt.value&&X.value==="days","dss-datepicker__dropdown--quick-select":L.doubleCalendar&&yt.value&&X.value==="days"&&L.quickSelect}]),onClick:Z[9]||(Z[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Le.value)},[X.value==="days"&&L.doubleCalendar&&yt.value?(e.openBlock(),e.createElementBlock("div",ma,[L.quickSelect?(e.openBlock(),e.createElementBlock("nav",pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,P=>(e.openBlock(),e.createElementBlock("button",{key:P.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:ce=>C(P.id)},e.toDisplayString(e.unref(oe)(P.labelKey)),9,fa))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",va,[e.createElementVNode("div",ga,[e.createElementVNode("div",ha,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.prevMonth"),onClick:pt}," ‹ ",8,ya),e.createElementVNode("div",ka,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[2]||(Z[2]=P=>Dt("left","months"))},e.toDisplayString(Ne.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[3]||(Z[3]=P=>Dt("left","years"))},e.toDisplayString(ne.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.nextMonth"),onClick:Ee}," › ",8,Ca)]),e.createElementVNode("div",ba,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value,P=>(e.openBlock(),e.createElementBlock("span",{key:P,class:"dss-datepicker__weekday"},e.toDisplayString(P),1))),128))]),e.createElementVNode("div",wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(P,ce)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+ce},[P?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",bt(P)]),disabled:!it(P),onClick:Te=>At(P),onMouseenter:Te=>Re(P),onMouseleave:ht},e.toDisplayString(P.getDate()),43,xa)):(e.openBlock(),e.createElementBlock("span",Ea))],64))),128))])]),e.createElementVNode("div",Sa,[e.createElementVNode("div",Va,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.prevMonth"),onClick:Ve}," ‹ ",8,Na),e.createElementVNode("div",Ba,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[4]||(Z[4]=P=>Dt("right","months"))},e.toDisplayString(qe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[5]||(Z[5]=P=>Dt("right","years"))},e.toDisplayString(ue.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.nextMonth"),onClick:Tt}," › ",8,Ma)]),e.createElementVNode("div",_a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value,P=>(e.openBlock(),e.createElementBlock("span",{key:P,class:"dss-datepicker__weekday"},e.toDisplayString(P),1))),128))]),e.createElementVNode("div",$a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,(P,ce)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+ce},[P?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",bt(P)]),disabled:!it(P),onClick:Te=>At(P),onMouseenter:Te=>Re(P),onMouseleave:ht},e.toDisplayString(P.getDate()),43,La)):(e.openBlock(),e.createElementBlock("span",Ta))],64))),128))])])])])):X.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Aa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.prevMonth"),onClick:Q}," ‹ ",8,Da),e.createElementVNode("div",Ha,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[6]||(Z[6]=P=>X.value="months")},e.toDisplayString(Et.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[7]||(Z[7]=P=>X.value="years")},e.toDisplayString(be.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(oe)("datepicker.nextMonth"),onClick:Oe}," › ",8,Ra)]),e.createElementVNode("div",Ia,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value,P=>(e.openBlock(),e.createElementBlock("span",{key:P,class:"dss-datepicker__weekday"},e.toDisplayString(P),1))),128))]),e.createElementVNode("div",Fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xt.value,(P,ce)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ce},[P?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",bt(P)]),disabled:!it(P),onClick:Te=>At(P),onMouseenter:Te=>Re(P),onMouseleave:ht},e.toDisplayString(P.getDate()),43,za)):(e.openBlock(),e.createElementBlock("span",Pa))],64))),128))])],64)):X.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Oa,[e.createElementVNode("div",qa,[e.createElementVNode("span",Wa,e.toDisplayString(nl.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[8]||(Z[8]=P=>X.value="years")},e.toDisplayString(at.value),1)])]),e.createElementVNode("div",Za,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ft.value,(P,ce)=>(e.openBlock(),e.createElementBlock("button",{key:ce,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":ce===It.value}]),onClick:Te=>S(ce)},e.toDisplayString(P),11,Ua))),128))])],64)):X.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Xa,[e.createElementVNode("span",Ya,e.toDisplayString(Ge.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:nt},[e.createElementVNode("div",ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt.value,P=>(e.openBlock(),e.createElementBlock("button",{key:P,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":P===at.value,"dss-datepicker__year-cell--current":P===e.unref(gt)}]),"data-year":P,onClick:ce=>K(P)},e.toDisplayString(P),11,Ka))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Ga=["data-chart-type"],Qa={class:"dss-chart-header-titles"},Ja={key:0,class:"dss-chart-title"},es={key:1,class:"dss-chart-subtitle"},ts=["onClick","onMouseenter"],ls={class:"dss-legend-text"},ns=["onClick","onMouseenter"],os={class:"dss-legend-text"},as=["title"],ss=["src"],rs={class:"dss-chart-area-wrapper"},is={key:0,class:"dss-chart-z-axis-label"},cs=["width","height","data-smooth","data-animated"],us=["id"],ds=["y","width","height"],ms=["id"],ps=["d"],fs=["id"],vs=["d"],gs={key:0},hs=["clip-path"],ys=["x1","x2","y1","y2"],ks={class:"dss-axes"},Cs=["x1","x2","y1","y2"],bs=["x1","x2","y1","y2"],ws={class:"dss-axis-labels"},xs=["x","y"],Es=["x","y"],Ss=["x","y"],Vs=["y","transform"],Ns={key:1,class:"dss-flag-markers"},Bs=["clip-path"],Ms=["x1","x2","y1","y2","onMouseover"],_s=["x1","x2","y1","y2","onMouseover"],$s=["x1","x2","y1","y2","onMouseover"],Ls=["cx","cy","onMouseover"],Ts=["cx","cy","fill","onMouseover"],As=["x","y"],Ds=["clip-path"],Hs={key:0},Rs=["d","onMouseover"],Is=["x","y","width","height","fill","onMouseover"],Fs={class:"dss-line-chart"},zs=["d","stroke","stroke-width"],Ps=["d","stroke","stroke-width","opacity"],Os=["cx","cy","r","fill","onMouseover"],qs={key:1},Ws=["d","stroke","stroke-width"],Zs=["d","stroke","stroke-width"],Us=["d","stroke","stroke-width","opacity"],Xs=["cx","cy","r","fill","onMouseover"],Ys={key:2},js=["id"],Ks=["x","y","width","height"],Gs=["d","fill","fill-opacity","mask"],Qs=["d","stroke","stroke-width"],Js=["d","fill","onMouseover"],er=["x","y","width","height","onMouseover"],tr=["clip-path"],lr=["x1","x2","y1","y2","stroke"],nr=["cx","cy","r","fill"],or={key:1,class:"dss-bubble-chart"},ar={key:0,class:"dss-bubble-group"},sr=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],rr=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],ir=["transform"],cr=["cx","cy","r"],ur=["data-chart-type","clip-path"],dr=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],mr={key:1,class:"dss-radial-segment-data-labels"},pr=["x","y"],fr=["x","y","font-size","fill"],vr=["x1","y1","x2","y2","stroke"],gr=["x1","y1","x2","y2","stroke"],hr=["x","y","text-anchor","font-size"],yr=["transform"],kr={key:0,class:"dss-spider-grid"},Cr=["cx","cy","r"],br={class:"dss-spider-grid-labels"},wr=["x","y"],xr=["x","y"],Er=["x1","x2","y1","y2"],Sr={class:"dss-spider-labels"},Vr=["x","y","text-anchor","dominant-baseline"],Nr=["points","fill","fill-opacity","stroke","stroke-width"],Br=["cx","cy","r","fill","onMouseover"],Mr={class:"dss-chart-logos"},_r=["cx","cy","r","fill"],$r=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Lr=["onClick","onMouseenter"],Tr=["src"],Ar={class:"dss-marker-tooltip-category"},Dr={key:0,class:"dss-marker-tooltip-description"},Hr={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},Rr={class:"dss-tooltip-title dss-spider-tooltip-area-title"},Ir={class:"dss-tooltip-series-name"},Fr={class:"dss-tooltip-series-value"},zr={key:1,class:"dss-tooltip-section"},Pr={key:0,class:"dss-tooltip-title"},Or={class:"dss-bubble-tooltip-data"},qr={key:2,class:"dss-tooltip-section"},Wr={class:"dss-tooltip-title"},Zr={class:"dss-tooltip-value"},Ur={key:0,class:"dss-tooltip-section"},Xr={class:"dss-tooltip-section-title"},Yr={class:"dss-tooltip-group-header"},jr={class:"dss-tooltip-item-content"},Kr={class:"dss-tooltip-item-text"},Gr={key:1,class:"dss-tooltip-section"},Qr={class:"dss-tooltip-section-title"},Jr={class:"dss-tooltip-item-content"},ei={class:"dss-tooltip-item-title"},ti={key:0,class:"dss-tooltip-item-description"},li={class:"dss-tooltip-section"},ni={class:"dss-tooltip-title"},oi={key:0,class:"dss-bubble-tooltip-data"},ai={class:"dss-tooltip-series-name"},si={class:"dss-tooltip-series-value"},ri={key:0,class:"dss-tooltip-section"},ii={class:"dss-tooltip-section-title"},ci={class:"dss-tooltip-group-header"},ui={class:"dss-tooltip-item-content"},di={class:"dss-tooltip-item-text"},mi={key:1,class:"dss-tooltip-section"},pi={class:"dss-tooltip-section-title"},fi={class:"dss-tooltip-item-content"},vi={class:"dss-tooltip-item-title"},gi={key:0,class:"dss-tooltip-item-description"},hi=["onClick","onMouseenter"],yi={class:"dss-legend-text"},ki={key:1,class:"dss-context-menu-separator"},Ci={key:0,class:"dss-context-menu-separator"},bi={key:0,class:"dss-context-menu-separator"},wi=["onClick"],xi=["innerHTML"],Ei={key:0,class:"dss-context-menu-icon"},Si={class:"dss-marker-modal-header"},Vi={class:"dss-marker-modal-body"},Ni={class:"dss-form-group"},Bi={class:"dss-form-group"},Mi={for:"dss-marker-description"},_i={key:0,class:"dss-form-text-display"},$i=["placeholder"],Li={class:"dss-marker-modal-footer"},Ti={class:"modal-footer-left"},Ai={class:"dss-modal-footer-right"},Di=["disabled"],Hi={name:"DSSChart"},Ri=Object.assign(Hi,{props:{series:{type:Array,required:!0,default:()=>[]},categories:{type:Array,default:()=>[]},flags:{type:Array,default:()=>[]},markers:{type:Array,default:()=>[]},showAddMarkerButton:{type:Boolean,default:!0},chartId:{type:String,default:()=>"chart-"+Math.random().toString(36).substring(2,9)},i18n:{type:Object,default:null},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:L=>typeof L=="object"&&L!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(L,{emit:ae}){const{t:B,locale:_}=Gn.useI18n(),oe=ae,z=e.ref(null),$=e.ref(null),X=e.ref(null),Ke=e.ref(0),ve=e.ref(0);let f=null,be=null;const ge=20,ne=e.computed(()=>{if(ve.value,Ke.value,!z.value||!$.value)return 0;try{const t=z.value.getBoundingClientRect();return $.value.getBoundingClientRect().top-t.top}catch{return 0}}),j=e.computed(()=>`chart-clip-${H.chartId}`),ue=e.computed(()=>`url(#${j.value})`),H=L,ke={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5},zoom:{enabled:!1,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function Me(t,s){const l=Object.assign({},t);return lt(t)&&lt(s)&&Object.keys(s).forEach(i=>{lt(s[i])?i in t?l[i]=Me(t[i],s[i]):Object.assign(l,{[i]:s[i]}):Object.assign(l,{[i]:s[i]})}),l}const ze=()=>{let t=20,s=0,l=0;if(st.value&&(t+=30),xt.value&&(t+=25),Ge.value&&H.series.length>0){const i=H.series.filter((p,g)=>!zt.value.has(g)).length;if(et.value==="top"||et.value==="bottom"){if($t.value==="horizontal"){const g=Math.floor(ie.value/100);s=Math.ceil(i/g)*25+10}else s=i*25+10;t+=s}else l=150}return{height:t,legendHeight:s,legendWidth:l}};function lt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const R=e.computed(()=>Me(ke,H.options)),pe=e.computed(()=>{const t=R.value;return t&&t.chart&&t.chart.width==="auto"}),fe=e.computed(()=>{const t=R.value;return t&&t.chart&&t.chart.height==="auto"}),ie=e.computed(()=>{const t=R.value;return pe.value?Ke.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),nt=e.ref(ge),gt=e.computed(()=>{if(fe.value){const t=gt.value;return t??Math.max(0,(ve.value||400)-nt.value*5)}}),he=e.computed(()=>{const t=R.value;if(fe.value){const s=gt.value;return s??Math.max(0,(ve.value||400)-nt.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),yt=e.computed(()=>{if(fe.value&&Ue.value==="semi-radial"&&gt.value!=null)return nt.value+he.value+"px";if(fe.value)return"100%";if(pl.value)return nt.value+he.value+"px";if(Ge.value&&et.value==="bottom"){const t=ze();return he.value+(t.legendHeight||35)+"px"}return he.value+(Ge.value?20:0)+"px"}),Ue=e.computed(()=>{const t=R.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),tl=e.computed(()=>{const t=H.series.map(s=>s.type||Ue.value);return new Set(t).size>1}),st=e.computed(()=>{const t=R.value;return t&&t.title&&t.title.text?t.title.text:""}),xt=e.computed(()=>{const t=R.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),Ht=e.computed(()=>{const t=R.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),ll=e.computed(()=>{const t=R.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),It=e.computed(()=>{const t=R.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),at=e.computed(()=>{const t=R.value;if(!t||!t.yAxis)return mn;const s=t.yAxis.min;return typeof s=="number"||s===mn?s:mn}),Et=e.computed(()=>{const t=R.value;if(!t||!t.yAxis)return mn;const s=t.yAxis.max;return typeof s=="number"||s===mn?s:mn}),nl=e.computed(()=>{const t=R.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Ft=e.computed(()=>{const t=R.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),Yt=e.computed(()=>{const t=R.value;return t&&t.grid&&t.grid.show!==!1}),Ge=e.computed(()=>{const t=R.value;return t&&t.legend&&t.legend.show!==!1}),et=e.computed(()=>{const t=R.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),$t=e.computed(()=>{const t=R.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Xt=e.computed(()=>{const t=R.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),te=e.computed(()=>{const t=R.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),$e=e.computed(()=>{const t=R.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Ne=e.computed(()=>{const t=R.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),qe=e.computed(()=>{const t=R.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),rt=e.computed(()=>{const t=R.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Ze=e.computed(()=>{const t=R.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Ye=e.computed(()=>{if(!pl.value)return 0;const t=R.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),mt=e.computed(()=>{const t=R.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),Le=e.computed(()=>{const{maxX:t}=Gt.value;return t===0}),q=(t,s)=>Le.value&&s===0?5:s,U=t=>{const s=Number(t);return!Number.isFinite(s)||s<=0?0:s},ee=e.computed(()=>{const t=R.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),se=e.computed(()=>{const t=R.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),He=e.computed(()=>{const t=R.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),it=e.computed(()=>{const t=R.value;return se.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),bt=e.computed(()=>{const t=R.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),Re=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.enabled!==!1}),ht=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),Rt=e.computed(()=>{const t=R.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),jt=e.computed(()=>{const t=R.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),qt=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Dt=e.computed(()=>{const t=R.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),V=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.onDataChange!==!1}),C=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),S=e.computed(()=>{const t=R.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),K=e.computed(()=>R.value?.spider?.gridSteps||5),Q=e.computed(()=>{const t=[],s=K.value;for(let l=1;l<=s;l++)t.push(ft.value/s*l);return t}),Oe=t=>{const s=pt.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const l=Q.value[t];return Math.round(l/ft.value*100)+"%"},pt=e.computed(()=>R.value?.spider?.gridLabels||null),Ee=e.computed(()=>{const t=R.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Ve=e.computed(()=>{const t=R.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),Tt=e.computed(()=>{const t=R.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),At=e.computed(()=>{const t=R.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Xl.value}),Qe=e.computed(()=>{const t=R.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Je=e.computed(()=>{const t=R.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Lt=e.computed(()=>{const s=R.value?.valueFormat?.extension;return typeof s=="string"?s:""}),gl=t=>{const s=Lt.value;if(t==null)return"";const l=String(t);return s?l+s:l},F=e.computed(()=>!le.value.isZooming);e.computed(()=>tt.value.map(t=>{if(t.categoryIndex!==void 0&&(xl.value||sl.value)){const s=Qt(t.categoryIndex),l=ne.value+O.value.bottom-Je.value/2;return{...t,x:s,y:l}}return t}));function Z(t,s){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,w,b]=t.split("-"),D=Number(b?.length===2?`20${b}`:b);l=new Date(D,Number(w)-1,Number(g))}else return 0;let i=0,p=1/0;return s.forEach((g,w)=>{const[b,D,A]=g.split("-"),I=Number(A?.length===2?`20${A}`:A),N=new Date(I,Number(D)-1,Number(b)),J=Math.abs(N-l);J<p&&(p=J,i=w)}),i}const P=e.computed(()=>{const t=H.markers.map(l=>{const i=Z(l.marker_date,H.categories),p=Qt(i),g=ne.value+O.value.bottom-Je.value/2;return{...l,x:p,y:g,categoryIndex:i,source:"props"}}),s=tt.value.map(l=>{if(l.categoryIndex!==void 0&&(xl.value||sl.value)){const i=Qt(l.categoryIndex),p=ne.value+O.value.bottom-Je.value/2;return{...l,x:i,y:p,source:"internal"}}return{...l,source:"internal"}});return[...t,...s]}),ce=e.computed(()=>{const t=R.value;return t&&t.watermark&&t.watermark.enabled===!0}),Te=e.computed(()=>{const t=R.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),ct=e.computed(()=>{const t=R.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),ut=e.computed(()=>{const t=R.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),Xe=e.computed(()=>{const t={left:O.value.left,top:O.value.top,width:O.value.width,height:O.value.height};let s,l;const i=String(ct.value);if(i.includes("%")){const p=parseFloat(i)/100;s=t.width*p,l=s*(96/499)}else{const p=parseFloat(i)||25;s=Math.min(t.width*.25,200)*(p/25),l=s*(96/499)}return{width:s,height:l,area:t}}),Ct=e.computed(()=>{const{width:t,height:s}=Xe.value,l=ut.value;let i,p;const g=O.value.left,w=O.value.right,b=O.value.top,D=O.value.bottom,A=O.value.width,I=O.value.height;switch(l){case"center":i=g+(A-t)/2,p=b+(I-s)/2;break;case"top-left":i=g+15,p=b+5;break;case"top-right":i=w-t-15,p=b+5;break;case"bottom-left":i=g+15,p=D-s-5;break;case"bottom-right":default:i=w-t-15,p=D-s-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${s}px`}}),Wt=t=>!H.flags||!H.flags.length?[]:H.flags.filter(s=>s.categoryIndex===t),hl=t=>{const s=Wt(t),l=$n(t),i=s.filter(w=>w.manual),p=s.filter(w=>!w.manual),g=[];return i.length>0&&g.push({type:B("chart.tooltip.manualFlags"),color:"#698dbe",flags:i.map(w=>({text:w.text,color:"#698dbe"}))}),p.length>0&&g.push({type:B("chart.tooltip.autoFlags"),color:"#a1d499",flags:p.map(w=>({text:w.text,color:"#a1d499"}))}),{flagGroups:g,markers:l.map(w=>({title:w.title,description:w.description,type:B("chart.tooltip.markers"),color:w.color||"#9784ba"}))}},Xl=e.computed(()=>{const t=H.old?`<svg width="55" height="56" viewBox="0 0 55 56" fill="none" xmlns="http://www.w3.org/2000/svg">
2
2
  <path d="M55 51.841V4.14647C55 1.86149 53.1797 0.00915527 50.9343 0.00915527L4.06568 0.00915527C1.82027 0.00915527 0 1.86149 0 4.14647V51.841C0 54.126 1.82027 55.9783 4.06568 55.9783H50.9343C53.1797 55.9783 55 54.126 55 51.841Z" fill="#020203"/>
3
3
  <path d="M27.7145 10.8883H16.9591C12.7639 10.8883 9.3623 14.3498 9.3623 18.619C9.3623 22.8882 12.7639 26.3497 16.9591 26.3497H27.8036C28.3624 26.3497 28.816 25.8881 28.816 25.3112L28.7188 11.9103C28.7188 11.3416 28.2653 10.8883 27.7064 10.8883H27.7145Z" fill="#FFC230"/>
4
4
  <path d="M38.6799 25.649C42.5176 25.649 45.6288 22.483 45.6288 18.5776C45.6288 14.6722 42.5176 11.5063 38.6799 11.5063C34.8421 11.5063 31.731 14.6722 31.731 18.5776C31.731 22.483 34.8421 25.649 38.6799 25.649Z" fill="white"/>
@@ -41,21 +41,21 @@
41
41
  <rect width="45" height="45" fill="white" transform="translate(0 1)"/>
42
42
  </clipPath>
43
43
  </defs>
44
- </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Yl=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),vn=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=R.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const gn=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),bn=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),zn=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Pn=e.computed(()=>{const s=R.value?.radialBar?.dataLabels;return s&&(s.show===!0||s.enabled===!0)}),to=e.computed(()=>{const s=R.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof s=="number"&&s>=0?s:20}),wn=e.computed(()=>{const s=R.value?.radialBar?.dataCenter;return $l.value&&s&&(s.show===!0||s.enabled===!0)}),xn=e.computed(()=>{if(!wn.value||!o.value.length)return"";const l=R.value?.radialBar?.dataCenter?.showValueOnly===!0?o.value[0]?.value??0:o.value.reduce((i,p)=>i+(p.value??0),0);return gl(l)}),Fl=e.computed(()=>{const s=R.value?.radialBar?.dataCenter?.fontSize;return typeof s=="number"&&s>0?s:24}),jl=e.computed(()=>({x:xt.value,y:_t.value-Fl.value/2})),bl=e.computed(()=>{const s=R.value?.radialBar?.dataCenter?.color;return typeof s=="string"&&s?s:"#333"}),Nl=e.computed(()=>{if(!Pn.value||!pl.value||!o.value.length)return[];const t=to.value*Math.PI/180,s=(cl.value+ft.value)/2;return o.value.map(l=>{const p=l.endAngle-l.startAngle>=t&&!l.isHidden,g=xt.value+Math.cos(l.midAngle)*s,w=_t.value+Math.sin(l.midAngle)*s;return{value:gl(l.value),x:g,y:w,show:p,color:l.color,contrastColor:Vo(l.color)}})}),Al=e.computed(()=>{if(!H.flags||!H.flags.length)return[];const t=new Map;return H.flags.forEach(s=>{const l=s.categoryIndex;t.has(l)||t.set(l,[]),t.get(l).push(s)}),Array.from(t.entries()).map(([s,l])=>{const i=Qt(s),p=l.filter(w=>w.manual),g=l.filter(w=>!w.manual);return{categoryIndex:parseInt(s),x:i,flags:l,manualCount:p.length,autoCount:g.length,totalCount:l.length,hasManual:p.length>0,hasAuto:g.length>0,texts:l.map(w=>w.text).join(`
45
- `)}})}),zl=e.ref({show:!1,x:0,y:0,content:"",count:0}),Bn=e.computed(()=>R.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),Mn=e.computed(()=>{const t=R.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),En=e.computed(()=>R.value?.bubbles?.tooltip?.formatters||{}),zt=e.ref(new Set),Ce=e.ref(null),El=e.ref(!1),nt=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),Vt=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),we=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),kt=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),le=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),et=e.ref([]),Ie=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1,date:null});e.computed(()=>{const t=["default"];return Qe.value&&t.push(...Object.keys(Qe.value)),t}),e.computed(()=>{if(!H.categories||H.categories.length===0){const{maxX:t}=Gt.value;return Array.from({length:t+1},(s,l)=>B("chart.fallback.item",{number:l+1}))}return H.categories});const _n=e.computed(()=>{if(!H.categories||H.categories.length===0)return null;const t=H.categories[0],[s,l,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),w=Number(l)-1;return!g||!l||!p?null:new Date(p,w,g)}),Pl=e.computed(()=>{if(!H.categories||H.categories.length===0)return null;const t=H.categories[H.categories.length-1],[s,l,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),w=Number(l)-1;return!g||!l||!p?null:new Date(p,w,g)}),Kl=e.computed(()=>Ie.value.editingMarkerId!==null),yl=e.computed(()=>Ie.value.readonly),Sn=t=>{zt.value.has(t)||(Un.value=!0,Ce.value=t)},rn=()=>{Un.value=!1,Ce.value=null},Gl=t=>{if(Yn.value||Xn.value){we.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),i=t.clientX-l.left,p=t.clientY-l.top,g=sl.value?i>=O.value.left-50&&i<=O.value.right+50&&p>=O.value.top-50&&p<=O.value.bottom+100:i>=O.value.left&&i<=O.value.right&&p>=O.value.top&&p<=O.value.bottom;if(El.value=g,sl.value){if(!te.value||!g||le.value.isDragging||le.value.isZooming){we.value.show=!1;return}if(Zn.value.find(re=>!re||re.isHidden?!1:Math.sqrt(Math.pow(re.x-i,2)+Math.pow(re.y-p,2))<=re.radius+3))we.value.show=!1;else{const re=Zn.value.filter(ye=>!ye||ye.isHidden?!1:Math.sqrt(Math.pow(ye.x-i,2)+Math.pow(ye.y-p,2))<=250);if(re.length>0){let ye=re[0],Be=Math.sqrt(Math.pow(ye.x-i,2)+Math.pow(ye.y-p,2));re.forEach(Pe=>{const Ae=Math.sqrt(Math.pow(Pe.x-i,2)+Math.pow(Pe.y-p,2));Ae<Be&&(Be=Ae,ye=Pe)});const me=30,je=Zn.value.filter(Pe=>!Pe||Pe.isHidden?!1:Math.abs(Pe.x-ye.x)<=me).sort((Pe,Ae)=>Pe.y-Ae.y);we.value={show:!0,x:ye.x,categoryIndex:Math.round(ye.originalX),data:(()=>{const Pe=Bn.value,Ae=Mn.value,_e=[];return je.forEach(Fe=>{Pe.forEach(Mt=>{const $t=Ae[Mt]||Mt,Tl=v(Mt,Fe);Tl&&_e.push({seriesName:Fe.seriesName,label:Fe.label,value:`${$t}: ${Tl}`,color:Fe.color,y:Fe.y})})}),_e})()}}else we.value.show=!1}return}if(le.value.isDragging&&le.value.scale>1&&xl.value&&Ne.value){we.value.show=!1;const We=t.clientX-le.value.lastMouseX,{minX:re,maxX:ye}=Gt.value,Be=ye-re||1,je=We*.8;le.value.offsetX+=je;const Pe=Be/le.value.scale,Ae=Be-Pe,_e=0,Fe=-Ae/Be*O.value.width,Mt=_e;le.value.offsetX=Math.max(Fe,Math.min(Mt,le.value.offsetX)),le.value.lastMouseX=t.clientX,le.value.lastMouseY=t.clientY;return}if(!te.value||!xl.value||le.value.isDragging||le.value.isZooming||!g){we.value.show=!1;return}const{minX:w,maxX:b}=Gt.value,D=b-w||1,A=D/le.value.scale,I=w-le.value.offsetX/O.value.width*D,N=(i-O.value.left)/O.value.width,J=I+N*A,xe=Math.round(J);if(xe>=0&&xe<=b){const We=Qt(xe),re=on.value.map((ye,Be)=>{const me=H.series.findIndex(Pe=>Pe===ye),je=ye.data[xe];return{seriesName:ye.name,value:je!==void 0?je:null,color:Ot(me),y:je!==void 0?kl(je):null}}).filter(ye=>ye.value!==null);we.value={show:!0,x:We,categoryIndex:xe,data:re}}},wl=()=>{we.value.show=!1,El.value=!1,Xn.value=!1,Yn.value||(zl.value.show=!1),le.value.isDragging&&(le.value.isDragging=!1),le.value.zoomTimeout&&(clearTimeout(le.value.zoomTimeout),le.value.zoomTimeout=null),le.value.isZooming=!1,setTimeout(()=>{Ce.value=null,nt.value.show=!1},150)},ln=t=>{if(t.preventDefault(),t.stopPropagation(),!Ee.value)return;const s=t.currentTarget.getBoundingClientRect(),l=t.clientX-s.left,i=t.clientY-s.top;if(pl.value){kt.value.show=!1,e.nextTick(()=>{kt.value.show=!0,kt.value.x=t.clientX,kt.value.y=t.clientY,kt.value.categoryIndex=null});return}const p=Math.max(0,O.value.left-20),g=O.value.right,w=O.value.top,b=O.value.bottom+80;l>=p&&l<=g&&i>=w&&i<=b&&(kt.value.show=!1,e.nextTick(()=>{kt.value.show=!0,kt.value.x=t.clientX,kt.value.y=t.clientY,kt.value.categoryIndex=null;const D=Math.max(O.value.left,Math.min(l,O.value.right))-O.value.left,I=O.value.width/po.value.length,N=Math.floor(D/I);N>=0&&N<po.value.length&&(kt.value.categoryIndex=N)}))},Pt=t=>{if(!(t&&t.button===2)){if(kt.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}kt.value.show=!1}},Bl=t=>{if(typeof t.template=="function"){const s={series:H.series,categories:H.categories,markers:et.value},l={chartX:kt.value.chartX,chartY:kt.value.chartY,dataX:kt.value.mouseDataX,dataY:kt.value.mouseDataY,categoryIndex:kt.value.categoryIndex};return t.template(s,l)}return t.template||t.label||""},lo=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},On=t=>t.style||{},nn=t=>t.type&&Qe.value[t.type]?Qe.value[t.type]:t.customIcon?t.customIcon:Dt.value,qt=t=>t==null?"":H.categories&&H.categories[t]?H.categories[t]:"",$n=t=>et.value.length?et.value.filter(s=>s.categoryIndex===t):[],Ln=t=>{if(!xl.value&&!sl.value)return{x:0,y:0};const s=Qt(t),l=ne.value+O.value.bottom-pt.value/2;return{x:s,y:l}},k=()=>{et.value.forEach(t=>{if(t.categoryIndex!==void 0&&(xl.value||sl.value)){const s=Ln(t.categoryIndex);t.x=s.x,t.y=s.y}})},y=()=>{if(Ie.value.description&&Ie.value.description.length&&Ie.value.date){if(Kl.value){const t=et.value.findIndex(s=>s.id===Ie.value.editingMarkerId);t!==-1?(et.value[t].description=Ie.value.description||"",et.value[t].color=Ie.value.color||"",et.value[t].type=Ie.value.type||"default",oe("update-marker",et.value[t])):oe("update-marker",{id:Ie.value.editingMarkerId,description:Ie.value.description||"",color:Ie.value.color||"",type:Ie.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=q(Ie.value.date,H.categories||[]);if(sl.value){const{maxX:w}=Gt.value;s=Math.max(0,Math.min(s,Math.floor(w)))}else xl.value&&(s=Math.max(0,Math.min(s,Gt.value.maxX)));const l=Qt(s),i=ne.value+O.value.bottom-pt.value/2,p=Array.isArray(H.categories)?H.categories[s]:null,g={id:t,title:"",description:Ie.value.description||"",color:Ie.value.color||"",type:Ie.value.type||"default",categoryIndex:s,x:l,y:i,marker_date:p||null};Ie.value.categoryIndex=s,et.value.push(g),oe("add-marker",g)}x(),ut()}},x=()=>{Ie.value.show=!1,Ie.value.title="",Ie.value.description="",Ie.value.color="#FF6B6B",Ie.value.type="default",Ie.value.editingMarkerId=null,Ie.value.readonly=!1,Ie.value.categoryIndex=null,Ie.value.fromButton=!1,Ie.value.date=null},Z=()=>{Kl.value&&(de(Ie.value.editingMarkerId),x())},de=t=>{const s=et.value.findIndex(l=>l.id===t);s!==-1&&(et.value.splice(s,1),ut()),oe("delete-marker",t)},Nt=t=>{if(Ie.value.show=!0,Ie.value.title=t?.title??t?.comment??"",Ie.value.description=t?.description??t?.comment??"",Ie.value.color=t?.color??"",Ie.value.type=t?.type??"default",Ie.value.editingMarkerId=t?.id??t?.marker_id??null,Ie.value.readonly=t?.readonly??!1,Ie.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[s,l,i]=String(t.marker_date).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),w=Number(l)-1;g&&l&&p?Ie.value.date=new Date(p,w,g):Ie.value.date=null}else Ie.value.date=null},ut=()=>{try{const t=`dss-chart-markers-${H.chartId}`;localStorage.setItem(t,JSON.stringify(et.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},Kt=()=>{try{const t=`dss-chart-markers-${H.chartId}`,s=localStorage.getItem(t);if(s){const l=JSON.parse(s);Array.isArray(l)&&(et.value=l.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),et.value=[]}},ol=t=>{const s=at.value||"Chart",l=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${s.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${l}.${t}`},il=()=>{const t=we.value.show,s=nt.value.show;return we.value.show=!1,nt.value.show=!1,{originalCrosshair:t,originalTooltip:s}},al=t=>{we.value.show=t.originalCrosshair,nt.value.show=t.originalTooltip},Ql=async(t,s=32,l=32)=>new Promise((i,p)=>{if(t.startsWith("data:")){i(t);return}const g=new Image;g.crossOrigin="anonymous";const w=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(w);try{const b=document.createElement("canvas"),D=b.getContext("2d");b.width=s,b.height=l,D.fillStyle="#fafafa",D.fillRect(0,0,s,l),D.drawImage(g,0,0,s,l);const A=b.toDataURL("image/png");i(A)}catch(b){console.warn("Canvas conversion failed:",b),i(t)}},g.onerror=b=>{clearTimeout(w),console.warn("Failed to load image:",t,b),i(t)},g.src=t}),cn=async()=>{try{const t=il();setTimeout(async()=>{try{const s=$.value;if(!s){console.error("Chart SVG element not found"),al(t);return}const l=ze(),i=ie.value,p=he.value+l.height,g=s.cloneNode(!0);g.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(me=>me.remove());const b=g.querySelectorAll("image"),D=Array.from(b).map(async me=>{const je=me.getAttribute("xlink:href")||me.getAttribute("href");if(je&&!je.startsWith("data:"))try{const Pe=await Ql(je,32,32);me.setAttribute("xlink:href",Pe),me.setAttribute("href",Pe)}catch(Pe){console.warn("Failed to convert logo to base64:",Pe)}});await Promise.all(D);const I=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let N="",J=30;if(at.value&&(N+=`
44
+ </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Yl=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),vn=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=R.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const gn=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),bn=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),zn=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Pn=e.computed(()=>{const s=R.value?.radialBar?.dataLabels;return s&&(s.show===!0||s.enabled===!0)}),to=e.computed(()=>{const s=R.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof s=="number"&&s>=0?s:20}),wn=e.computed(()=>{const s=R.value?.radialBar?.dataCenter;return $l.value&&s&&(s.show===!0||s.enabled===!0)}),xn=e.computed(()=>{if(!wn.value||!o.value.length)return"";const l=R.value?.radialBar?.dataCenter?.showValueOnly===!0?o.value[0]?.value??0:o.value.reduce((i,p)=>i+(p.value??0),0);return gl(l)}),Fl=e.computed(()=>{const s=R.value?.radialBar?.dataCenter?.fontSize;return typeof s=="number"&&s>0?s:24}),jl=e.computed(()=>({x:wt.value,y:Mt.value-Fl.value/2})),bl=e.computed(()=>{const s=R.value?.radialBar?.dataCenter?.color;return typeof s=="string"&&s?s:"#333"}),Nl=e.computed(()=>{if(!Pn.value||!pl.value||!o.value.length)return[];const t=to.value*Math.PI/180,s=(cl.value+ft.value)/2;return o.value.map(l=>{const p=l.endAngle-l.startAngle>=t&&!l.isHidden,g=wt.value+Math.cos(l.midAngle)*s,w=Mt.value+Math.sin(l.midAngle)*s;return{value:gl(l.value),x:g,y:w,show:p,color:l.color,contrastColor:Vo(l.color)}})}),Al=e.computed(()=>{if(!H.flags||!H.flags.length)return[];const t=new Map;return H.flags.forEach(s=>{const l=s.categoryIndex;t.has(l)||t.set(l,[]),t.get(l).push(s)}),Array.from(t.entries()).map(([s,l])=>{const i=Qt(s),p=l.filter(w=>w.manual),g=l.filter(w=>!w.manual);return{categoryIndex:parseInt(s),x:i,flags:l,manualCount:p.length,autoCount:g.length,totalCount:l.length,hasManual:p.length>0,hasAuto:g.length>0,texts:l.map(w=>w.text).join(`
45
+ `)}})}),zl=e.ref({show:!1,x:0,y:0,content:"",count:0}),Bn=e.computed(()=>R.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),Mn=e.computed(()=>{const t=R.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),En=e.computed(()=>R.value?.bubbles?.tooltip?.formatters||{}),zt=e.ref(new Set),Ce=e.ref(null),El=e.ref(!1),ot=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),St=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),we=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),kt=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),le=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),tt=e.ref([]),Ie=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1,date:null});e.computed(()=>{const t=["default"];return Qe.value&&t.push(...Object.keys(Qe.value)),t}),e.computed(()=>{if(!H.categories||H.categories.length===0){const{maxX:t}=Gt.value;return Array.from({length:t+1},(s,l)=>B("chart.fallback.item",{number:l+1}))}return H.categories});const _n=e.computed(()=>{if(!H.categories||H.categories.length===0)return null;const t=H.categories[0],[s,l,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),w=Number(l)-1;return!g||!l||!p?null:new Date(p,w,g)}),Pl=e.computed(()=>{if(!H.categories||H.categories.length===0)return null;const t=H.categories[H.categories.length-1],[s,l,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),w=Number(l)-1;return!g||!l||!p?null:new Date(p,w,g)}),Kl=e.computed(()=>Ie.value.editingMarkerId!==null),yl=e.computed(()=>Ie.value.readonly),Sn=t=>{zt.value.has(t)||(Un.value=!0,Ce.value=t)},rn=()=>{Un.value=!1,Ce.value=null},Gl=t=>{if(Yn.value||Xn.value){we.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),i=t.clientX-l.left,p=t.clientY-l.top,g=sl.value?i>=O.value.left-50&&i<=O.value.right+50&&p>=O.value.top-50&&p<=O.value.bottom+100:i>=O.value.left&&i<=O.value.right&&p>=O.value.top&&p<=O.value.bottom;if(El.value=g,sl.value){if(!te.value||!g||le.value.isDragging||le.value.isZooming){we.value.show=!1;return}if(Wn.value.find(re=>!re||re.isHidden?!1:Math.sqrt(Math.pow(re.x-i,2)+Math.pow(re.y-p,2))<=re.radius+3))we.value.show=!1;else{const re=Wn.value.filter(ye=>!ye||ye.isHidden?!1:Math.sqrt(Math.pow(ye.x-i,2)+Math.pow(ye.y-p,2))<=250);if(re.length>0){let ye=re[0],Be=Math.sqrt(Math.pow(ye.x-i,2)+Math.pow(ye.y-p,2));re.forEach(Pe=>{const Ae=Math.sqrt(Math.pow(Pe.x-i,2)+Math.pow(Pe.y-p,2));Ae<Be&&(Be=Ae,ye=Pe)});const me=30,je=Wn.value.filter(Pe=>!Pe||Pe.isHidden?!1:Math.abs(Pe.x-ye.x)<=me).sort((Pe,Ae)=>Pe.y-Ae.y);we.value={show:!0,x:ye.x,categoryIndex:Math.round(ye.originalX),data:(()=>{const Pe=Bn.value,Ae=Mn.value,_e=[];return je.forEach(Fe=>{Pe.forEach(Bt=>{const _t=Ae[Bt]||Bt,Tl=v(Bt,Fe);Tl&&_e.push({seriesName:Fe.seriesName,label:Fe.label,value:`${_t}: ${Tl}`,color:Fe.color,y:Fe.y})})}),_e})()}}else we.value.show=!1}return}if(le.value.isDragging&&le.value.scale>1&&xl.value&&Ne.value){we.value.show=!1;const We=t.clientX-le.value.lastMouseX,{minX:re,maxX:ye}=Gt.value,Be=ye-re||1,je=We*.8;le.value.offsetX+=je;const Pe=Be/le.value.scale,Ae=Be-Pe,_e=0,Fe=-Ae/Be*O.value.width,Bt=_e;le.value.offsetX=Math.max(Fe,Math.min(Bt,le.value.offsetX)),le.value.lastMouseX=t.clientX,le.value.lastMouseY=t.clientY;return}if(!te.value||!xl.value||le.value.isDragging||le.value.isZooming||!g){we.value.show=!1;return}const{minX:w,maxX:b}=Gt.value,D=b-w||1,A=D/le.value.scale,I=w-le.value.offsetX/O.value.width*D,N=(i-O.value.left)/O.value.width,J=I+N*A,xe=Math.round(J);if(xe>=0&&xe<=b){const We=Qt(xe),re=on.value.map((ye,Be)=>{const me=H.series.findIndex(Pe=>Pe===ye),je=ye.data[xe];return{seriesName:ye.name,value:je!==void 0?je:null,color:Ot(me),y:je!==void 0?kl(je):null}}).filter(ye=>ye.value!==null);we.value={show:!0,x:We,categoryIndex:xe,data:re}}},wl=()=>{we.value.show=!1,El.value=!1,Xn.value=!1,Yn.value||(zl.value.show=!1),le.value.isDragging&&(le.value.isDragging=!1),le.value.zoomTimeout&&(clearTimeout(le.value.zoomTimeout),le.value.zoomTimeout=null),le.value.isZooming=!1,setTimeout(()=>{Ce.value=null,ot.value.show=!1},150)},ln=t=>{if(t.preventDefault(),t.stopPropagation(),!Ee.value)return;const s=t.currentTarget.getBoundingClientRect(),l=t.clientX-s.left,i=t.clientY-s.top;if(pl.value){kt.value.show=!1,e.nextTick(()=>{kt.value.show=!0,kt.value.x=t.clientX,kt.value.y=t.clientY,kt.value.categoryIndex=null});return}const p=Math.max(0,O.value.left-20),g=O.value.right,w=O.value.top,b=O.value.bottom+80;l>=p&&l<=g&&i>=w&&i<=b&&(kt.value.show=!1,e.nextTick(()=>{kt.value.show=!0,kt.value.x=t.clientX,kt.value.y=t.clientY,kt.value.categoryIndex=null;const D=Math.max(O.value.left,Math.min(l,O.value.right))-O.value.left,I=O.value.width/po.value.length,N=Math.floor(D/I);N>=0&&N<po.value.length&&(kt.value.categoryIndex=N)}))},Pt=t=>{if(!(t&&t.button===2)){if(kt.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}kt.value.show=!1}},Bl=t=>{if(typeof t.template=="function"){const s={series:H.series,categories:H.categories,markers:tt.value},l={chartX:kt.value.chartX,chartY:kt.value.chartY,dataX:kt.value.mouseDataX,dataY:kt.value.mouseDataY,categoryIndex:kt.value.categoryIndex};return t.template(s,l)}return t.template||t.label||""},lo=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},On=t=>t.style||{},nn=t=>t.type&&Qe.value[t.type]?Qe.value[t.type]:t.customIcon?t.customIcon:At.value,Zt=t=>t==null?"":H.categories&&H.categories[t]?H.categories[t]:"",$n=t=>tt.value.length?tt.value.filter(s=>s.categoryIndex===t):[],Ln=t=>{if(!xl.value&&!sl.value)return{x:0,y:0};const s=Qt(t),l=ne.value+O.value.bottom-Je.value/2;return{x:s,y:l}},k=()=>{tt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(xl.value||sl.value)){const s=Ln(t.categoryIndex);t.x=s.x,t.y=s.y}})},y=()=>{if(Ie.value.description&&Ie.value.description.length&&Ie.value.date){if(Kl.value){const t=tt.value.findIndex(s=>s.id===Ie.value.editingMarkerId);t!==-1?(tt.value[t].description=Ie.value.description||"",tt.value[t].color=Ie.value.color||"",tt.value[t].type=Ie.value.type||"default",oe("update-marker",tt.value[t])):oe("update-marker",{id:Ie.value.editingMarkerId,description:Ie.value.description||"",color:Ie.value.color||"",type:Ie.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=Z(Ie.value.date,H.categories||[]);if(sl.value){const{maxX:w}=Gt.value;s=Math.max(0,Math.min(s,Math.floor(w)))}else xl.value&&(s=Math.max(0,Math.min(s,Gt.value.maxX)));const l=Qt(s),i=ne.value+O.value.bottom-Je.value/2,p=Array.isArray(H.categories)?H.categories[s]:null,g={id:t,title:"",description:Ie.value.description||"",color:Ie.value.color||"",type:Ie.value.type||"default",categoryIndex:s,x:l,y:i,marker_date:p||null};Ie.value.categoryIndex=s,tt.value.push(g),oe("add-marker",g)}x(),dt()}},x=()=>{Ie.value.show=!1,Ie.value.title="",Ie.value.description="",Ie.value.color="#FF6B6B",Ie.value.type="default",Ie.value.editingMarkerId=null,Ie.value.readonly=!1,Ie.value.categoryIndex=null,Ie.value.fromButton=!1,Ie.value.date=null},W=()=>{Kl.value&&(de(Ie.value.editingMarkerId),x())},de=t=>{const s=tt.value.findIndex(l=>l.id===t);s!==-1&&(tt.value.splice(s,1),dt()),oe("delete-marker",t)},Vt=t=>{if(Ie.value.show=!0,Ie.value.title=t?.title??t?.comment??"",Ie.value.description=t?.description??t?.comment??"",Ie.value.color=t?.color??"",Ie.value.type=t?.type??"default",Ie.value.editingMarkerId=t?.id??t?.marker_id??null,Ie.value.readonly=t?.readonly??!1,Ie.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[s,l,i]=String(t.marker_date).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),w=Number(l)-1;g&&l&&p?Ie.value.date=new Date(p,w,g):Ie.value.date=null}else Ie.value.date=null},dt=()=>{try{const t=`dss-chart-markers-${H.chartId}`;localStorage.setItem(t,JSON.stringify(tt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},Kt=()=>{try{const t=`dss-chart-markers-${H.chartId}`,s=localStorage.getItem(t);if(s){const l=JSON.parse(s);Array.isArray(l)&&(tt.value=l.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),tt.value=[]}},ol=t=>{const s=st.value||"Chart",l=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${s.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${l}.${t}`},il=()=>{const t=we.value.show,s=ot.value.show;return we.value.show=!1,ot.value.show=!1,{originalCrosshair:t,originalTooltip:s}},al=t=>{we.value.show=t.originalCrosshair,ot.value.show=t.originalTooltip},Ql=async(t,s=32,l=32)=>new Promise((i,p)=>{if(t.startsWith("data:")){i(t);return}const g=new Image;g.crossOrigin="anonymous";const w=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(w);try{const b=document.createElement("canvas"),D=b.getContext("2d");b.width=s,b.height=l,D.fillStyle="#fafafa",D.fillRect(0,0,s,l),D.drawImage(g,0,0,s,l);const A=b.toDataURL("image/png");i(A)}catch(b){console.warn("Canvas conversion failed:",b),i(t)}},g.onerror=b=>{clearTimeout(w),console.warn("Failed to load image:",t,b),i(t)},g.src=t}),cn=async()=>{try{const t=il();setTimeout(async()=>{try{const s=$.value;if(!s){console.error("Chart SVG element not found"),al(t);return}const l=ze(),i=ie.value,p=he.value+l.height,g=s.cloneNode(!0);g.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(me=>me.remove());const b=g.querySelectorAll("image"),D=Array.from(b).map(async me=>{const je=me.getAttribute("xlink:href")||me.getAttribute("href");if(je&&!je.startsWith("data:"))try{const Pe=await Ql(je,32,32);me.setAttribute("xlink:href",Pe),me.setAttribute("href",Pe)}catch(Pe){console.warn("Failed to convert logo to base64:",Pe)}});await Promise.all(D);const I=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let N="",J=30;if(st.value&&(N+=`
46
46
  <text x="24" y="${J}"
47
47
  font-family="Arial, sans-serif"
48
48
  font-size="18"
49
49
  font-weight="bold"
50
50
  fill="#333">
51
- ${at.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
52
- </text>`,J+=30),Et.value&&(N+=`
51
+ ${st.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
52
+ </text>`,J+=30),xt.value&&(N+=`
53
53
  <text x="24" y="${J}"
54
54
  font-family="Arial, sans-serif"
55
55
  font-size="14"
56
56
  fill="#666">
57
- ${Et.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
58
- </text>`,J+=25),Ge.value&&H.series.length>0){let me=i-200,je=at.value||Et.value?35:25;const Pe=Math.floor((i-250)/120);let Ae=0;H.series.forEach((_e,Fe)=>{if(!zt.value.has(Fe)){const Mt=Ot(Fe),$t=_e.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");N+=`<circle cx="${me+6}" cy="${je-4}" r="6" fill="${Mt}"/>`,N+=`<text x="${me+18}" y="${je}" font-family="Arial, sans-serif" font-size="12" fill="#333">${$t}</text>`,Ae++,Ae%Pe===0?(me=i-200,je+=20):me+=Math.min(120,$t.length*8+35)}})}let xe="";if(ce.value)try{const{width:me,height:je}=Xe.value,Pe=ct.value,Ae=O.value.left,_e=O.value.right,Fe=O.value.top,Mt=O.value.bottom,$t=O.value.width,Tl=O.value.height;let el,Ul;switch(Pe){case"center":el=Ae+($t-me)/2,Ul=Fe+(Tl-je)/2;break;case"top-left":el=Ae+15,Ul=Fe+5;break;case"top-right":el=_e-me-5,Ul=Fe+5;break;case"bottom-left":el=Ae+15,Ul=Mt-je-5;break;case"bottom-right":default:el=_e-me-5,Ul=Mt-je-5;break}xe=`
57
+ ${xt.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
58
+ </text>`,J+=25),Ge.value&&H.series.length>0){let me=i-200,je=st.value||xt.value?35:25;const Pe=Math.floor((i-250)/120);let Ae=0;H.series.forEach((_e,Fe)=>{if(!zt.value.has(Fe)){const Bt=Ot(Fe),_t=_e.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");N+=`<circle cx="${me+6}" cy="${je-4}" r="6" fill="${Bt}"/>`,N+=`<text x="${me+18}" y="${je}" font-family="Arial, sans-serif" font-size="12" fill="#333">${_t}</text>`,Ae++,Ae%Pe===0?(me=i-200,je+=20):me+=Math.min(120,_t.length*8+35)}})}let xe="";if(ce.value)try{const{width:me,height:je}=Xe.value,Pe=ut.value,Ae=O.value.left,_e=O.value.right,Fe=O.value.top,Bt=O.value.bottom,_t=O.value.width,Tl=O.value.height;let el,Ul;switch(Pe){case"center":el=Ae+(_t-me)/2,Ul=Fe+(Tl-je)/2;break;case"top-left":el=Ae+15,Ul=Fe+5;break;case"top-right":el=_e-me-5,Ul=Fe+5;break;case"bottom-left":el=Ae+15,Ul=Bt-je-5;break;case"bottom-right":default:el=_e-me-5,Ul=Bt-je-5;break}xe=`
59
59
  <g opacity="${Te.value}">
60
60
  <g transform="translate(${el}, ${Ul}) scale(${me/499})">
61
61
  <path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
@@ -89,23 +89,23 @@
89
89
  ${I}
90
90
  ${xe}
91
91
  </g>
92
- </svg>`,re=new Blob([We],{type:"image/svg+xml;charset=utf-8"}),ye=URL.createObjectURL(re),Be=document.createElement("a");Be.href=ye,Be.download=ol("svg"),document.body.appendChild(Be),Be.click(),document.body.removeChild(Be),URL.revokeObjectURL(ye),al(t),Pt()}catch(s){console.error("Error downloading SVG:",s),al(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},_l=async()=>{try{const t=il();z.value&&z.value.offsetHeight,await new Promise(me=>setTimeout(me,300));const s=ze(),l=ie.value,i=he.value+s.height,p=document.createElement("canvas"),g=p.getContext("2d"),w=2;p.width=l*w,p.height=i*w,p.style.width=l+"px",p.style.height=i+"px",g.scale(w,w),g.fillStyle="#fafafa",g.fillRect(0,0,l,i);let b=30;if(at.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(at.value,24,b),b+=30),Et.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(Et.value,24,b),b+=25),Ge.value&&H.series.length>0){let me=l-200,je=at.value||Et.value?35:25;const Pe=Math.floor((l-250)/120);let Ae=0;g.font="12px Arial, sans-serif",H.series.forEach((_e,Fe)=>{if(!zt.value.has(Fe)){const Mt=Ot(Fe);g.beginPath(),g.arc(me+6,je-4,6,0,2*Math.PI),g.fillStyle=Mt,g.fill(),g.fillStyle="#333",g.fillText(_e.name,me+18,je),Ae++,Ae%Pe===0?(me=l-200,je+=20):me+=Math.min(120,_e.name.length*8+35)}})}const A=$.value.cloneNode(!0),I=A.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),N=A.querySelectorAll(".dss-crosshair"),J=A.querySelectorAll('[class*="tooltip"]');I.forEach(me=>me.remove()),N.forEach(me=>me.remove()),J.forEach(me=>me.remove()),A.querySelectorAll("image").forEach((me,je)=>{const Pe=me.getAttribute("xlink:href")||me.getAttribute("href");if(Pe&&!Pe.startsWith("data:")){const Ae=Jt.value[je],_e=Ae?Ot(Ae.seriesIndex):"#3B82F6",Fe=me.getAttribute("x")||0,Mt=me.getAttribute("y")||0,$t=me.getAttribute("width")||32,Tl=me.getAttribute("height")||32,el=document.createElementNS("http://www.w3.org/2000/svg","circle");el.setAttribute("cx",parseFloat(Fe)+parseFloat($t)/2),el.setAttribute("cy",parseFloat(Mt)+parseFloat(Tl)/2),el.setAttribute("r",Math.min(parseFloat($t),parseFloat(Tl))/2-1),el.setAttribute("fill",_e),el.setAttribute("stroke","#fafafa"),el.setAttribute("stroke-width","2"),me.parentNode.replaceChild(el,me)}});const We=new XMLSerializer().serializeToString(A),re=new Blob([We],{type:"image/svg+xml;charset=utf-8"}),ye=URL.createObjectURL(re),Be=new Image;return new Promise((me,je)=>{Be.onload=async()=>{try{if(g.drawImage(Be,0,s.height),Jt.value.forEach(Pe=>{const Ae=Pe.x,_e=Pe.y+s.height,Fe=(Pe.width||32)/2,Mt=Ot(Pe.seriesIndex);g.save(),g.beginPath(),g.arc(Ae,_e,Fe-1,0,2*Math.PI),g.fillStyle=Mt,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),ce.value){const Pe=new Image,Ae=()=>{const{width:Fe,height:Mt}=Xe.value,$t=ct.value,Tl=O.value.left,el=O.value.right,Ul=O.value.top,Bo=O.value.bottom,sa=O.value.width,ra=O.value.height;let jn,Kn;switch($t){case"center":jn=Tl+(sa-Fe)/2,Kn=Ul+s.height+(ra-Mt)/2;break;case"top-left":jn=Tl+15,Kn=Ul+s.height+10;break;case"top-right":jn=el-Fe-5,Kn=Ul+s.height+10;break;case"bottom-left":jn=Tl+15,Kn=Bo+s.height-Mt-5;break;case"bottom-right":default:jn=el-Fe-5,Kn=Bo+s.height-Mt-5;break}g.globalAlpha=Te.value,g.drawImage(Pe,jn,Kn,Fe,Mt),g.globalAlpha=1,_e()},_e=()=>{p.toBlob(Fe=>{const Mt=URL.createObjectURL(Fe),$t=document.createElement("a");$t.href=Mt,$t.download=ol("png"),document.body.appendChild($t),$t.click(),document.body.removeChild($t),URL.revokeObjectURL(Mt),URL.revokeObjectURL(ye),al(t),Pt(),me()},"image/png")};Pe.onload=Ae,Pe.onerror=_e,Pe.src=Ml.value}else p.toBlob(Pe=>{const Ae=URL.createObjectURL(Pe),_e=document.createElement("a");_e.href=Ae,_e.download=ol("png"),document.body.appendChild(_e),_e.click(),document.body.removeChild(_e),URL.revokeObjectURL(Ae),URL.revokeObjectURL(ye),al(t),Pt(),me()},"image/png")}catch(Pe){URL.revokeObjectURL(ye),al(t),je(Pe)}},Be.onerror=()=>{URL.revokeObjectURL(ye),al(t),je(new Error("Failed to load SVG image"))},Be.src=ye})}catch(t){console.error("Error downloading PNG:",t)}},no=()=>{try{let t="";at.value&&(t+=`# ${B("chart.csv.chartTitle")}: ${at.value}
93
- `),Et.value&&(t+=`# ${B("chart.csv.chartSubtitle")}: ${Et.value}
92
+ </svg>`,re=new Blob([We],{type:"image/svg+xml;charset=utf-8"}),ye=URL.createObjectURL(re),Be=document.createElement("a");Be.href=ye,Be.download=ol("svg"),document.body.appendChild(Be),Be.click(),document.body.removeChild(Be),URL.revokeObjectURL(ye),al(t),Pt()}catch(s){console.error("Error downloading SVG:",s),al(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},_l=async()=>{try{const t=il();z.value&&z.value.offsetHeight,await new Promise(me=>setTimeout(me,300));const s=ze(),l=ie.value,i=he.value+s.height,p=document.createElement("canvas"),g=p.getContext("2d"),w=2;p.width=l*w,p.height=i*w,p.style.width=l+"px",p.style.height=i+"px",g.scale(w,w),g.fillStyle="#fafafa",g.fillRect(0,0,l,i);let b=30;if(st.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(st.value,24,b),b+=30),xt.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(xt.value,24,b),b+=25),Ge.value&&H.series.length>0){let me=l-200,je=st.value||xt.value?35:25;const Pe=Math.floor((l-250)/120);let Ae=0;g.font="12px Arial, sans-serif",H.series.forEach((_e,Fe)=>{if(!zt.value.has(Fe)){const Bt=Ot(Fe);g.beginPath(),g.arc(me+6,je-4,6,0,2*Math.PI),g.fillStyle=Bt,g.fill(),g.fillStyle="#333",g.fillText(_e.name,me+18,je),Ae++,Ae%Pe===0?(me=l-200,je+=20):me+=Math.min(120,_e.name.length*8+35)}})}const A=$.value.cloneNode(!0),I=A.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),N=A.querySelectorAll(".dss-crosshair"),J=A.querySelectorAll('[class*="tooltip"]');I.forEach(me=>me.remove()),N.forEach(me=>me.remove()),J.forEach(me=>me.remove()),A.querySelectorAll("image").forEach((me,je)=>{const Pe=me.getAttribute("xlink:href")||me.getAttribute("href");if(Pe&&!Pe.startsWith("data:")){const Ae=Jt.value[je],_e=Ae?Ot(Ae.seriesIndex):"#3B82F6",Fe=me.getAttribute("x")||0,Bt=me.getAttribute("y")||0,_t=me.getAttribute("width")||32,Tl=me.getAttribute("height")||32,el=document.createElementNS("http://www.w3.org/2000/svg","circle");el.setAttribute("cx",parseFloat(Fe)+parseFloat(_t)/2),el.setAttribute("cy",parseFloat(Bt)+parseFloat(Tl)/2),el.setAttribute("r",Math.min(parseFloat(_t),parseFloat(Tl))/2-1),el.setAttribute("fill",_e),el.setAttribute("stroke","#fafafa"),el.setAttribute("stroke-width","2"),me.parentNode.replaceChild(el,me)}});const We=new XMLSerializer().serializeToString(A),re=new Blob([We],{type:"image/svg+xml;charset=utf-8"}),ye=URL.createObjectURL(re),Be=new Image;return new Promise((me,je)=>{Be.onload=async()=>{try{if(g.drawImage(Be,0,s.height),Jt.value.forEach(Pe=>{const Ae=Pe.x,_e=Pe.y+s.height,Fe=(Pe.width||32)/2,Bt=Ot(Pe.seriesIndex);g.save(),g.beginPath(),g.arc(Ae,_e,Fe-1,0,2*Math.PI),g.fillStyle=Bt,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),ce.value){const Pe=new Image,Ae=()=>{const{width:Fe,height:Bt}=Xe.value,_t=ut.value,Tl=O.value.left,el=O.value.right,Ul=O.value.top,Bo=O.value.bottom,sa=O.value.width,ra=O.value.height;let jn,Kn;switch(_t){case"center":jn=Tl+(sa-Fe)/2,Kn=Ul+s.height+(ra-Bt)/2;break;case"top-left":jn=Tl+15,Kn=Ul+s.height+10;break;case"top-right":jn=el-Fe-5,Kn=Ul+s.height+10;break;case"bottom-left":jn=Tl+15,Kn=Bo+s.height-Bt-5;break;case"bottom-right":default:jn=el-Fe-5,Kn=Bo+s.height-Bt-5;break}g.globalAlpha=Te.value,g.drawImage(Pe,jn,Kn,Fe,Bt),g.globalAlpha=1,_e()},_e=()=>{p.toBlob(Fe=>{const Bt=URL.createObjectURL(Fe),_t=document.createElement("a");_t.href=Bt,_t.download=ol("png"),document.body.appendChild(_t),_t.click(),document.body.removeChild(_t),URL.revokeObjectURL(Bt),URL.revokeObjectURL(ye),al(t),Pt(),me()},"image/png")};Pe.onload=Ae,Pe.onerror=_e,Pe.src=Ml.value}else p.toBlob(Pe=>{const Ae=URL.createObjectURL(Pe),_e=document.createElement("a");_e.href=Ae,_e.download=ol("png"),document.body.appendChild(_e),_e.click(),document.body.removeChild(_e),URL.revokeObjectURL(Ae),URL.revokeObjectURL(ye),al(t),Pt(),me()},"image/png")}catch(Pe){URL.revokeObjectURL(ye),al(t),je(Pe)}},Be.onerror=()=>{URL.revokeObjectURL(ye),al(t),je(new Error("Failed to load SVG image"))},Be.src=ye})}catch(t){console.error("Error downloading PNG:",t)}},no=()=>{try{let t="";st.value&&(t+=`# ${B("chart.csv.chartTitle")}: ${st.value}
93
+ `),xt.value&&(t+=`# ${B("chart.csv.chartSubtitle")}: ${xt.value}
94
94
  `),t+=`# ${B("chart.csv.generated")}: ${new Date().toLocaleString()}
95
95
 
96
96
  `,t+="Category",H.series.forEach(g=>{const w=g.name.replace(/"/g,'""');t+=',"'+w+'"'}),t+=`
97
97
  `;const s=Math.max(...H.series.map(g=>g.data?.length||0));for(let g=0;g<s;g++){let D='"'+(H.categories[g]||B("chart.fallback.item",{number:g+1})).toString().replace(/"/g,'""')+'"';H.series.forEach(A=>{const I=A.data&&A.data[g]!==void 0?A.data[g]:"";D+=","+I}),t+=D+`
98
- `}const l=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(l),p=document.createElement("a");p.href=i,p.download=ol("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(i),Pt()}catch(t){console.error("Error downloading CSV:",t)}},Tn=t=>{if(typeof t.action=="function"){const s={series:H.series,categories:H.categories,markers:et.value},l={chartX:kt.value.chartX,chartY:kt.value.chartY,dataX:kt.value.mouseDataX,dataY:kt.value.mouseDataY,categoryIndex:clampedCategoryIndex||kt.value.categoryIndex};t.action(s,l)}Pt()},Ao=()=>{x(),Ie.value.show=!0,Ie.value.categoryIndex=kt.value.categoryIndex,Ie.value.fromButton=!1,Pt()},ko=()=>{x(),Ie.value.show=!0,Ie.value.categoryIndex=0,Ie.value.fromButton=!0},oo=t=>{if(kt.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(kt.value.show=!1)}},ao=t=>{kt.value.show&&!t.target.closest(".context-menu")&&(kt.value.show=!1)},Co=t=>{if(!xl.value||!Ne.value)return;t.preventDefault(),t.stopPropagation(),le.value.isZooming=!0,we.value.show=!1,le.value.zoomTimeout&&clearTimeout(le.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),i=t.clientX-l.left,p=t.clientY-l.top;if(i<O.value.left-50||i>O.value.right+50||p<O.value.top-50||p>O.value.bottom+100){le.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,w=Math.max(le.value.minScale,Math.min(le.value.maxScale,le.value.scale*g));if(w!==le.value.scale){const{minX:b,maxX:D}=Gt.value,A=D-b||1,I=A/le.value.scale,N=b-le.value.offsetX/O.value.width*A,J=(i-O.value.left)/O.value.width,xe=N+J*I;le.value.scale=w;const We=A/le.value.scale,re=xe-J*We;le.value.offsetX=-(re-b)/A*O.value.width,le.value.scale<=1.01&&(le.value.scale=1,le.value.offsetX=0)}le.value.zoomTimeout=setTimeout(()=>{le.value.isZooming=!1,le.value.zoomTimeout=null},300)},bo=t=>{if(!xl.value||!Ne.value||le.value.scale<=1)return;we.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,le.value.isDragging=!0,le.value.lastMouseX=t.clientX,le.value.lastMouseY=t.clientY,t.preventDefault()},Do=()=>{le.value.isDragging=!1},so=()=>{!xl.value||!Ne.value||(le.value.scale=1,le.value.offsetX=0,le.value.isDragging=!1,le.value.zoomTimeout&&(clearTimeout(le.value.zoomTimeout),le.value.zoomTimeout=null),le.value.isZooming=!1)},Ho=()=>!xl.value||!El.value||!Ne.value?"default":le.value.isDragging?"grabbing":le.value.scale>1?"grab":"dss-crosshair",An=t=>{if(t.length<2)return"";if(t.length===2)return`M ${t[0].x} ${t[0].y} L ${t[1].x} ${t[1].y}`;let s=`M ${t[0].x} ${t[0].y}`;for(let l=0;l<t.length-1;l++){const i=t[Math.max(l-1,0)],p=t[l],g=t[l+1],w=t[Math.min(l+2,t.length-1)],b=p.x+(g.x-i.x)/6*He.value,D=p.y+(g.y-i.y)/6*He.value,A=g.x-(w.x-p.x)/6*He.value,I=g.y-(w.y-p.y)/6*He.value;s+=` C ${b} ${D} ${A} ${I} ${g.x} ${g.y}`}return s},Sl=e.computed(()=>{const s=R.value?.chart?.padding,l=typeof s=="number"?s:null,i=s&&typeof s=="object"?s:null,p=50;let g=p+(ll.value?30:0)+60;if(Ol.value){const N={left:p+40,top:p+40,right:p+40,bottom:p+40};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??N.left,top:i.top??N.top,right:i.right??N.right,bottom:i.bottom??N.bottom}:N}if(pl.value){const N=!Ge.value,J=Yl.value,xe=J?gn.value+bn.value+Math.max(24,vn.value+16):0,We=N?12:p;let re=0;at.value&&(re+=N?8:15),Et.value&&(re+=N?6:10);const ye=ze();let Be=We+(N?4:16)+(J?xe:0),me=We+(J?xe:0);Ge.value&&Je.value==="left"?Be+=ye.legendWidth||150:Ge.value&&Je.value==="right"&&(me+=ye.legendWidth||150);const Pe=qe.value==="semi-radial"?J?xe:8:J?xe:N?8:p+80,Ae=J?14:0,_e=We+re+Ae,Fe={left:Be,top:_e,right:me,bottom:Pe};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??Fe.left,top:i.top??Fe.top,right:i.right??Fe.right,bottom:i.bottom??Fe.bottom}:Fe}let w=0;at.value&&(w+=15),Et.value&&(w+=10);const b=ze();let D=p+16,A=p;Ge.value&&Je.value==="left"?D+=b.legendWidth||150:Ge.value&&Je.value==="right"&&(A+=b.legendWidth||150);const I={left:D,top:p+w,right:A,bottom:g};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??I.left,top:i.top??I.top,right:i.right??I.right,bottom:i.bottom??I.bottom}:I}),O=e.computed(()=>({left:Sl.value.left,top:Sl.value.top,right:ie.value-Sl.value.right,bottom:he.value-Sl.value.bottom,width:ie.value-(Sl.value.left+Sl.value.right),height:he.value-(Sl.value.top+Sl.value.bottom)})),xl=e.computed(()=>["line","area","bar"].includes(qe.value)||tl.value),Dl=e.computed(()=>tl.value),pl=e.computed(()=>["radial","semi-radial"].includes(qe.value)),Ol=e.computed(()=>qe.value==="spider"),sl=e.computed(()=>qe.value==="bubble"),fl=e.computed(()=>R.value?.chart?.orientation==="horizontal"&&(qe.value==="bar"||Dl.value)),un=t=>{const{minY:s,maxY:l}=Gt.value,i=l-s||1;return O.value.left+(t-s)/i*O.value.width},dn=t=>{const{maxX:s}=Gt.value,l=s+1,p=O.value.height/l;return O.value.top+(t+.5)*p},xt=e.computed(()=>pl.value?Sl.value.left+(ie.value-Sl.value.left-Sl.value.right)/2:ie.value/2),_t=e.computed(()=>Ol.value?he.value/2-40:pl.value?Sl.value.top+(he.value-Sl.value.top-Sl.value.bottom)/2:he.value/2),ft=e.computed(()=>{if(Ol.value){const t=O.value.width-80,s=O.value.height-80;return Math.min(t,s)/2}return Math.min(O.value.width,O.value.height)/2}),cl=e.computed(()=>{const t=R.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof s=="number"&&s>=0&&s<=1?s:.45;return ft.value*l}),Ro=e.computed(()=>{const t=R.value,s=typeof H.innerSize=="number"?H.innerSize:t?.innerSize;return typeof s!="number"||s<=-100||!(pl.value||Ol.value)?1:1+s/100}),ro=e.computed(()=>{const t=Ro.value;if(t===1||t<=0)return;const s=xt.value,l=_t.value;return`translate(${s}, ${l}) scale(${t}) translate(${-s}, ${-l})`}),Hl=e.ref(0),Jl=e.computed(()=>`semi-radial-fill-clip-${H.chartId}`),$l=e.computed(()=>qe.value==="semi-radial"),hn=e.computed(()=>$l.value&&Re.value&&!Cl.value),Ut=e.computed(()=>$l.value&&Re.value&&!Cl.value&&ht.value==="fill"),wo=e.computed(()=>{const t=hn.value?Hl.value:1,s=xt.value,l=_t.value,i=cl.value,p=ft.value,g=Math.PI,w=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${l} L ${s} ${l} Z`;const b=s+p*Math.cos(g),D=l+p*Math.sin(g),A=s+p*Math.cos(w),I=l+p*Math.sin(w),N=s+i*Math.cos(w),J=l+i*Math.sin(w),xe=s+i*Math.cos(g),We=l+i*Math.sin(g),re=t>.5?1:0;return`M ${s} ${l} L ${b} ${D} A ${p} ${p} 0 ${re} 1 ${A} ${I} L ${N} ${J} A ${i} ${i} 0 ${re} 1 ${xe} ${We} Z`}),io=e.computed(()=>{if(!(!$l.value||!hn.value)&&!Ut.value)return`url(#${Jl.value})`}),yn=t=>{if(!(!Ut.value||t!==0))return`url(#${Jl.value})`},Ll=e.ref(0),kn=e.computed(()=>`radial-reveal-clip-${H.chartId}`),Vl=e.computed(()=>qe.value==="radial"),Vn=e.computed(()=>{const t=Vl.value?Ll.value:1,s=xt.value,l=_t.value,i=Math.max(ft.value*1.5,ie.value,he.value);if(t<=0)return`M ${s} ${l} L ${s} ${l} Z`;if(t>=1){const N=s-i,J=s+i;return`M ${N} ${l} A ${i} ${i} 0 0 1 ${J} ${l} A ${i} ${i} 0 0 1 ${N} ${l} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,w=s+i*Math.cos(p),b=l+i*Math.sin(p),D=s+i*Math.cos(g),A=l+i*Math.sin(g),I=t>=.5?1:0;return`M ${s} ${l} L ${w} ${b} A ${i} ${i} 0 ${I} 1 ${D} ${A} Z`}),Io=e.computed(()=>{if(io.value)return io.value;if(Vl.value)return`url(#${kn.value})`});let Dn=null;const Hn=()=>{if(!hn.value)return;Hl.value=0;const t=Rt.value,s=performance.now(),l=i=>{const p=i-s,g=Math.min(1,p/t);Hl.value=ql(Wt.value,g),g<1&&(Dn=requestAnimationFrame(l))};Dn=requestAnimationFrame(l)},co=e.computed(()=>R.value?.bubbles?.minSize||8),Rn=e.computed(()=>R.value?.bubbles?.maxSize||50),uo=e.computed(()=>R.value?.bubbles?.opacity||.7),xo=(t,s)=>{const l=[15,20,25,18,22],i=l[t%l.length]||20,p=1+Math.sin(s*.5)*.2;return Math.max(5,i*p)},Fo=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},Wn=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},Wl=e.computed(()=>H.series),on=e.computed(()=>H.series.filter((t,s)=>!zt.value.has(s))),mn="auto",Gt=e.computed(()=>{if(sl.value)return mo();if(!on.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,l=0;on.value.forEach(b=>{b.data&&b.data.length&&(l=Math.max(l,b.data.length-1),b.data.forEach(D=>{typeof D=="number"&&(t=Math.min(t,D),s=Math.max(s,D))}))}),H.categories.length>0&&(l=Math.max(l,H.categories.length-1)),t===1/0&&(t=0,s=100);const i=ot.value,p=St.value;let g,w;if(i===mn){const b=s-t,D=b>0?b*.1:1;g=Math.max(0,t-D)}else if(typeof i=="number")g=i;else{const b=s-t,D=b>0?b*.1:1;g=Math.max(0,t-D)}if(p===mn){const b=s-t,D=b>0?b*.1:2;w=s+D}else if(typeof p=="number")w=p;else{const b=s-t,D=b>0?b*.1:2;w=s+D}return{minX:0,maxX:l,minY:g,maxY:w}}),mo=()=>{if(!on.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,s=-1/0,l=1/0,i=-1/0,p=1/0,g=-1/0,w=!1;if(on.value.forEach((xe,We)=>{xe?.data?.length&&xe.data.forEach((re,ye)=>{let Be,me,je;if(typeof re=="object"&&re!==null&&!Array.isArray(re))Be=typeof re.x=="number"?re.x:ye,me=typeof re.y=="number"?re.y:0,je=typeof re.size=="number"?re.size:20;else if(Array.isArray(re)&&re.length>=3)Be=typeof re[0]=="number"?re[0]:ye,me=typeof re[1]=="number"?re[1]:0,je=typeof re[2]=="number"?re[2]:20;else if(typeof re=="number")Be=ye,me=re,je=xo(We,ye);else return;isFinite(Be)&&isFinite(me)&&isFinite(je)&&(t=Math.min(t,Be),s=Math.max(s,Be),l=Math.min(l,me),i=Math.max(i,me),p=Math.min(p,je),g=Math.max(g,je),w=!0)})}),!w)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===s&&(t=Math.min(t,0),s=Math.max(s,H.categories?.length-1||8)),l===i&&(l=Math.max(0,l-10),i=l+20);const b=s-t,D=i-l;let A,I,N,J;return nl.value!==null?A=nl.value:A=t-b*.1,Ft.value!==null?I=Ft.value:I=s+b*.1,ot.value!==null&&typeof ot.value=="number"?N=ot.value:N=Math.max(0,l-D*.1),St.value!==null&&typeof St.value=="number"?J=St.value:J=i+D*.1,{minX:A,maxX:I,minY:N,maxY:J,minSize:p,maxSize:g}},Qt=t=>{if(sl.value){const{minX:b,maxX:D}=Gt.value,A=D-b||1;return O.value.left+(t-b)/A*O.value.width}const{minX:s,maxX:l}=Gt.value,i=l-s;if(l===0||i===0)return O.value.left+O.value.width/2;const p=i/le.value.scale,g=s-le.value.offsetX/O.value.width*i,w=(t-g)/p;return O.value.left+w*O.value.width},kl=t=>{const{minY:s,maxY:l}=Gt.value,i=l-s||1;return O.value.bottom-(t-s)/i*O.value.height},Eo=t=>{if(!sl.value)return dt.value||4;const{maxSize:s}=Gt.value,l=Math.max(1,s),i=Math.min(1,Math.max(0,t/l));return co.value+i*(Rn.value-co.value)},So=e.computed(()=>an.value.map(t=>({y:t.y}))),po=e.computed(()=>{if(sl.value)return In();if(qe.value==="bar"){if(fl.value){const _e=[],{minY:Fe,maxY:Mt}=Gt.value,$t=5,Tl=Mt-Fe||1;for(let el=0;el<=$t;el++){const Ul=Fe+Tl*(el/$t),Bo=un(Ul);_e.push({x:Bo,y:O.value.bottom+20,text:gl(Math.round(Ul))})}return _e}const ye=[],{maxX:Be}=Gt.value,me=Be+1,je=5,Ae=(O.value.width-je*2)/me;for(let _e=0;_e<=Be;_e++){const Fe=O.value.left+je+(_e+.5)*Ae;ye.push({x:Fe,y:O.value.bottom+20,text:H.categories[_e]||B("chart.fallback.item",{number:_e+1})})}return ye}const t=[],{minX:s,maxX:l}=Gt.value,i=nl.value!==null?nl.value:s,p=Ft.value!==null?Ft.value:l,g=p-i||1,w=g/le.value.scale,b=i-le.value.offsetX/O.value.width*g,D=b+w,A=Math.max(0,Math.floor(b-2)),I=Math.min(p,Math.ceil(D+2)),N=I-A,J=O.value.width,We=Math.floor(J/60);let re=1;N>We&&(re=Math.ceil(N/We));for(let ye=A;ye<=I;ye+=re)if(ye>=0&&ye<=p){const Be=Qt(ye);Be>=O.value.left-100&&Be<=O.value.right+100&&t.push({x:Be,y:O.value.bottom+20,text:H.categories[ye]||`Item ${ye+1}`})}return t}),In=()=>{const t=[],{minX:s,maxX:l}=Gt.value,i=l-s||1,p=Math.min(8,Math.max(4,Math.floor(O.value.width/80)));for(let g=0;g<=p;g++){const w=s+i*g/p,b=Qt(w);if(b>=O.value.left-10&&b<=O.value.right+10){const D=Math.round(w),A=H.categories?.[D];t.push({x:b,y:O.value.bottom+20,text:A||(Number.isInteger(w)?w.toString():w.toFixed(1))})}}return t},an=e.computed(()=>{if(fl.value){const p=[],{maxX:g}=Gt.value;for(let w=0;w<=g;w++)p.push({x:O.value.left-10,y:dn(w),text:H.categories[w]||`Item ${w+1}`});return p}const t=[],{minY:s,maxY:l}=Gt.value,i=5;for(let p=0;p<=i;p++){const g=s+(l-s)*(p/i),w=Math.round(g);t.push({x:O.value.left-10,y:kl(g),text:gl(w)})}return t}),Ot=t=>{const s=bt.value;if(!s||s.length===0){const l=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return l[t%l.length]}return s[t%s.length]},Vo=t=>{if(!t||typeof t!="string")return"#3a3a3a";const s=t.trim();let l=0,i=0,p=0;const g=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)l=Number(g[1])/255,i=Number(g[2])/255,p=Number(g[3])/255;else{const b=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(b)l=Number(b[1])/255,i=Number(b[2])/255,p=Number(b[3])/255;else{const D=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(D){let A=D[1];A.length===3&&(A=A[0]+A[0]+A[1]+A[1]+A[2]+A[2]),l=parseInt(A.slice(0,2),16)/255,i=parseInt(A.slice(2,4),16)/255,p=parseInt(A.slice(4,6),16)/255}else if(typeof document<"u"){const A=document.createElement("span");A.style.color=s,A.style.display="none",document.body.appendChild(A);const I=getComputedStyle(A).color;document.body.removeChild(A);const N=I.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(N)l=Number(N[1])/255,i=Number(N[2])/255,p=Number(N[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*i+.0722*p>.5?"#3a3a3a":"#fafafa"},fo=t=>{if(!t||typeof t!="string")return t;const s=t.trim(),l=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(l){const g=Math.max(0,Math.floor(Number(l[1])*.65)),w=Math.max(0,Math.floor(Number(l[2])*.65)),b=Math.max(0,Math.floor(Number(l[3])*.65));return`rgb(${g}, ${w}, ${b})`}const i=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(i){const g=Math.max(0,Math.floor(Number(i[1])*.65)),w=Math.max(0,Math.floor(Number(i[2])*.65)),b=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${w}, ${b}, ${i[4]})`}const p=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(p){let g=p[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const w=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),b=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),D=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[w,b,D].map(A=>A.toString(16).padStart(2,"0")).join("")}`}return s},vo=(t,s)=>{const i=R.value?.stroke?.color;return i==null?fo(s):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??fo(s):fo(s)},go=t=>{let s=0;for(let l=1;l<t.length;l++){const i=t[l].x-t[l-1].x,p=t[l].y-t[l-1].y;s+=Math.sqrt(i*i+p*p)}return s},Fn=e.computed(()=>qe.value==="line"||Dl.value?(Dl.value?H.series.filter(s=>(s.type||qe.value)==="line"):Wl.value).map((s,l)=>{const i=H.series.findIndex(N=>N===s),p=[];let g=[];s.data.forEach((N,J)=>{N==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:fl.value?un(N):Qt(J),y:fl.value?dn(J):kl(N),index:J})}),g.length>0&&p.push(g);let w="";p.forEach(N=>{if(N.length>0){let J="";se.value?J=An(N):J=`M ${N[0].x} ${N[0].y}`+N.slice(1).map(xe=>` L ${xe.x} ${xe.y}`).join(""),w+=(w?" ":"")+J}});const b=p.reduce((N,J)=>N+go(J),0),D=zt.value.has(i),A=Ce.value===i,I=Ce.value!==null&&Ce.value!==i;return{path:w,color:Ot(i),pathLength:b,seriesIndex:i,animationDelay:l*At.value,isHighlighted:A,isDimmed:I,isHidden:D}}):[]),Rl=e.computed(()=>{if(!(qe.value==="line"||Dl.value))return[];const t=Dl.value?H.series.filter(l=>(l.type||qe.value)==="line"):Wl.value,s=[];return t.forEach((l,i)=>{const p=H.series.findIndex(g=>g===l);for(let g=0;g<l.data.length-1;g++){const w=l.data[g];if(w!=null){let b=-1,D=0;for(let A=g+1;A<l.data.length;A++){const I=l.data[A];if(I==null)D++;else{b=A;break}}if(D>0&&b!==-1){const A=l.data[b],I=fl.value?un(w):Qt(g),N=fl.value?dn(g):kl(w),J=fl.value?un(A):Qt(b),xe=fl.value?dn(b):kl(A),We=zt.value.has(p),re=Ce.value===p,ye=Ce.value!==null&&Ce.value!==p;s.push({path:`M ${I} ${N} L ${J} ${xe}`,color:Ot(p),seriesIndex:p,animationDelay:i*At.value,isHighlighted:re,isDimmed:ye,isHidden:We,gapSize:D}),g=b-1}}}}),s}),zo=e.computed(()=>qe.value==="line"||Dl.value?!Re.value||Cl.value||Bt.value.hasAnimated?[]:(Dl.value?H.series.filter(s=>(s.type||qe.value)==="line"):Wl.value).map((s,l)=>{const i=H.series.findIndex(D=>D===s);let p="",g=null;s.data.forEach((D,A)=>{if(D!=null){const I={x:fl.value?un(D):Qt(A),y:fl.value?dn(A):kl(D)};g===null?p+=`M ${I.x} ${I.y}`:p+=` L ${I.x} ${I.y}`,g=I}else if(g!==null){const I=s.data.findIndex((N,J)=>J>A&&N!==null&&N!==void 0);if(I!==-1){const N={x:fl.value?un(s.data[I]):Qt(I),y:fl.value?dn(I):kl(s.data[I])};p+=` L ${N.x} ${N.y}`,g=N}}});const w=s.data.map((D,A)=>D==null?null:{x:fl.value?un(D):Qt(A),y:fl.value?dn(A):kl(D)}).filter(D=>D!==null),b=go(w);return{path:p,pathLength:b,color:Ot(i),animationDelay:l*At.value,seriesIndex:i}}):[]),Cn=e.computed(()=>{if(qe.value!=="line")return[];const t=[];return Wl.value.forEach((s,l)=>{const i=Ce.value===l,p=Ce.value!==null&&Ce.value!==l,g=zt.value.has(l);s.data.forEach((w,b)=>{w!=null&&t.push({x:Qt(b),y:kl(w),color:Ot(l),value:w,label:H.categories[b]||b.toString(),seriesName:s.name,categoryIndex:b,dataIndex:b,animationDelay:(l*s.data.length+b)*(At.value/8),isHighlighted:i,isDimmed:p,isHidden:g})})}),t}),ho=e.computed(()=>{if(!Dl.value)return[];const t=[];return H.series.filter(l=>(l.type||qe.value)==="line").forEach((l,i)=>{const p=H.series.findIndex(D=>D===l),g=Ce.value===p,w=Ce.value!==null&&Ce.value!==p,b=zt.value.has(p);l.data.forEach((D,A)=>{D!=null&&t.push({x:Qt(A),y:kl(D),color:Ot(p),value:D,label:H.categories[A]||A.toString(),seriesName:l.name,categoryIndex:A,dataIndex:A,animationDelay:(i*l.data.length+A)*(At.value/8),isHighlighted:g,isDimmed:w,isHidden:b})})}),t}),Zn=e.computed(()=>{if(!sl.value)return[];const t=[];return Wl.value.forEach((s,l)=>{if(!s?.data?.length)return;const i=Ce.value,p=i!==null&&i===l,g=i!==null&&i!==l,w=zt.value.has(l);s.data.forEach((b,D)=>{let A,I,N,J,xe;if(typeof b=="object"&&b!==null&&!Array.isArray(b))A=typeof b.x=="number"?b.x:D,I=typeof b.y=="number"?b.y:0,N=typeof b.size=="number"?b.size:20,J=b.label||H.categories?.[D]||`Point ${D+1}`,xe=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)A=typeof b[0]=="number"?b[0]:D,I=typeof b[1]=="number"?b[1]:0,N=typeof b[2]=="number"?b[2]:20,J=b[3]||H.categories?.[D]||`Point ${D+1}`,xe=b[4];else if(typeof b=="number")A=D,I=b,N=xo(l,D),J=H.categories?.[D]||`Point ${D+1}`;else return;!isFinite(A)||!isFinite(I)||!isFinite(N)||t.push({x:Qt(A),y:kl(I),radius:Eo(N),originalX:A,originalY:I,originalSize:N,color:Ot(l),seriesName:s.name||`Series ${l+1}`,label:J,imageUrl:xe,seriesIndex:l,dataIndex:D,categoryIndex:Math.round(A),isHighlighted:p,isDimmed:g,isHidden:w,opacity:uo.value})})}),t}),qn=e.computed(()=>qe.value!=="area"?[]:Wl.value.map((t,s)=>{const l=[];let i=[];if(t.data.forEach((N,J)=>{N==null?i.length>0&&(l.push([...i]),i=[]):i.push({x:Qt(J),y:kl(N),index:J})}),i.length>0&&l.push(i),l.length===0)return{linePath:"",areaPath:"",color:Ot(s),isHidden:zt.value.has(s)};const p=O.value.bottom+1;let g="",w="";l.forEach((N,J)=>{if(N.length===0)return;let xe=`M ${N[0].x} ${N[0].y}`;se.value&&N.length>1?xe=An(N):N.slice(1).forEach(re=>{xe+=` L ${re.x} ${re.y}`}),g+=(g?" ":"")+xe;let We=`M ${N[0].x} ${p}`;if(We+=` L ${N[0].x} ${N[0].y}`,se.value&&N.length>1){const re=An(N),ye=re.substring(re.indexOf("C")||re.indexOf("Q")||re.indexOf("L"));ye?We+=" "+ye:N.slice(1).forEach(Be=>{We+=` L ${Be.x} ${Be.y}`})}else N.slice(1).forEach(re=>{We+=` L ${re.x} ${re.y}`});We+=` L ${N[N.length-1].x} ${p} Z`,w+=(w?" ":"")+We});const b=Ce.value===s,D=Ce.value!==null&&Ce.value!==s,A=zt.value.has(s),I=l.reduce((N,J)=>N+go(J),0);return{linePath:g,areaPath:w,color:Ot(s),pathLength:I,isHighlighted:b,isDimmed:D,isHidden:A}})),yo=e.computed(()=>{if(!(["bar"].includes(qe.value)||Dl.value))return[];const t=[],{maxX:s}=Gt.value,l=Dl.value?H.series.filter(p=>(p.type||qe.value)==="bar"):Wl.value,i=l.length;if(fl.value){const p=s+1,w=O.value.height/p,b=w*(2/3),D=Math.min(4,b/i*.15),A=b-(i-1)*D,I=Math.max(4,A/i);l.forEach((N,J)=>{const xe=H.series.findIndex(Be=>Be===N),We=Ce.value===xe,re=Ce.value!==null&&Ce.value!==xe,ye=zt.value.has(xe);N.data.forEach((Be,me)=>{if(Be==null||typeof Be!="number"||!isFinite(Be))return;const Ae=O.value.top+(me+.5)*w-b/2+J*(I+D),_e=O.value.left,Fe=Math.abs(un(Be)-O.value.left);let Mt="";if(se.value&&Fe>0){const $t=Math.min(rt.value,I/2,Fe/2);Mt=[`M ${_e} ${Ae}`,`L ${_e+Fe-$t} ${Ae}`,`Q ${_e+Fe} ${Ae} ${_e+Fe} ${Ae+$t}`,`L ${_e+Fe} ${Ae+I-$t}`,`Q ${_e+Fe} ${Ae+I} ${_e+Fe-$t} ${Ae+I}`,`L ${_e} ${Ae+I}`,"Z"].join(" ")}t.push({x:_e,y:Ae,width:Fe,height:I,color:Ot(i===1?me:xe),value:Be,label:H.categories[me]||me.toString(),seriesName:N.name,animationDelay:(J*l.length+me)*(At.value/4),isHighlighted:We,isDimmed:re,isHidden:ye,barPath:Mt,isSmooth:se.value&&Fe>0})})})}else{const p=s+1,w=O.value.width/p,b=w*.8,D=b/i,A=D*.05,I=D-A;l.forEach((N,J)=>{const xe=H.series.findIndex(Be=>Be===N),We=Ce.value===xe,re=Ce.value!==null&&Ce.value!==xe,ye=zt.value.has(xe);N.data.forEach((Be,me)=>{if(Be==null||typeof Be!="number"||!isFinite(Be))return;const Ae=O.value.left+(me+.5)*w-b/2+J*D+A/2,_e=kl(Math.max(0,Be)),Fe=Math.abs(kl(0)-kl(Be));let Mt="";if(se.value&&Fe>0){const $t=Math.min(rt.value,I/2,Fe/2);Mt=[`M ${Ae} ${_e+Fe}`,`L ${Ae} ${_e+$t}`,`Q ${Ae} ${_e} ${Ae+$t} ${_e}`,`L ${Ae+I-$t} ${_e}`,`Q ${Ae+I} ${_e} ${Ae+I} ${_e+$t}`,`L ${Ae+I} ${_e+Fe}`,"Z"].join(" ")}t.push({x:Ae,y:_e,width:I,height:Fe,color:Ot(i===1?me:xe),value:Be,label:H.categories[me]||me.toString(),seriesName:N.name,animationDelay:(J*l.length+me)*(At.value/4),isHighlighted:We,isDimmed:re,isHidden:ye,barPath:Mt,isSmooth:se.value&&Fe>0})})})}return t}),o=e.computed(()=>{if(!pl.value)return[];const t=Wl.value.map((g,w)=>({series:g,originalIndex:w})).filter(({originalIndex:g})=>!zt.value.has(g));if(t.length===0)return[];let s=qe.value==="semi-radial"?Math.PI:-Math.PI/2;const l=qe.value==="semi-radial"?Math.PI:Math.PI*2,i=[];if(t.length===1){const{series:g,originalIndex:w}=t[0],b=g.data[0]||0,D=s,A=s+l-.001,I=D+l/2,N=xt.value+Math.cos(D)*cl.value,J=_t.value+Math.sin(D)*cl.value,xe=xt.value+Math.cos(A)*cl.value,We=_t.value+Math.sin(A)*cl.value,re=xt.value+Math.cos(A)*ft.value,ye=_t.value+Math.sin(A)*ft.value,Be=xt.value+Math.cos(D)*ft.value,me=_t.value+Math.sin(D)*ft.value,je=1,Pe=[`M ${N} ${J}`,`A ${cl.value} ${cl.value} 0 ${je} 1 ${xe} ${We}`,`L ${re} ${ye}`,`A ${ft.value} ${ft.value} 0 ${je} 0 ${Be} ${me}`,"Z"].join(" "),Ae=Ot(w);return i.push({path:Pe,color:Ae,strokeWidth:Ye.value,strokeColor:vo(0,Ae),value:b,seriesName:g.name,opacity:.8,isHighlighted:Ce.value===w,isDimmed:!1,isHidden:!1,startAngle:D,endAngle:A,midAngle:I}),i}if(Ut.value&&t.length===2){const g=t[0],w=t[1],b=Math.min(100,Math.max(0,g.series.data[0]||0)),D=b/100*l,A=(I,N,J,xe,We)=>{const re=I+(N-I)/2,ye=N-I,Be=xt.value+Math.cos(I)*cl.value,me=_t.value+Math.sin(I)*cl.value,je=xt.value+Math.cos(N)*cl.value,Pe=_t.value+Math.sin(N)*cl.value,Ae=xt.value+Math.cos(N)*ft.value,_e=_t.value+Math.sin(N)*ft.value,Fe=xt.value+Math.cos(I)*ft.value,Mt=_t.value+Math.sin(I)*ft.value,$t=ye>Math.PI?1:0,Tl=[`M ${Be} ${me}`,`A ${cl.value} ${cl.value} 0 ${$t} 1 ${je} ${Pe}`,`L ${Ae} ${_e}`,`A ${ft.value} ${ft.value} 0 ${$t} 0 ${Fe} ${Mt}`,"Z"].join(" "),el=Ot(xe);return{path:Tl,color:el,strokeWidth:Ye.value,strokeColor:vo(i.length,el),value:We,seriesName:J.name,opacity:.8,isHighlighted:Ce.value===xe,isDimmed:Ce.value!==null&&Ce.value!==xe,isHidden:!1,startAngle:I,endAngle:N,midAngle:re}};return i.push(A(s,s+D,g.series,g.originalIndex,b)),i.push(A(s,s+l,w.series,w.originalIndex,100)),i}const p=t.reduce((g,{series:w})=>g+(w.data[0]||0),0);return p===0?[]:(t.forEach(({series:g,originalIndex:w})=>{const b=g.data[0]||0,D=b/p*l,A=s,I=s+D,N=A+D/2,J=xt.value+Math.cos(A)*cl.value,xe=_t.value+Math.sin(A)*cl.value,We=xt.value+Math.cos(I)*cl.value,re=_t.value+Math.sin(I)*cl.value,ye=xt.value+Math.cos(I)*ft.value,Be=_t.value+Math.sin(I)*ft.value,me=xt.value+Math.cos(A)*ft.value,je=_t.value+Math.sin(A)*ft.value,Pe=D>Math.PI?1:0,Ae=[`M ${J} ${xe}`,`A ${cl.value} ${cl.value} 0 ${Pe} 1 ${We} ${re}`,`L ${ye} ${Be}`,`A ${ft.value} ${ft.value} 0 ${Pe} 0 ${me} ${je}`,"Z"].join(" "),_e=Ot(w);i.push({path:Ae,color:_e,strokeWidth:Ye.value,strokeColor:vo(i.length,_e),value:b,seriesName:g.name,opacity:.8,isHighlighted:Ce.value===w,isDimmed:Ce.value!==null&&Ce.value!==w,isHidden:!1,startAngle:A,endAngle:I,midAngle:N}),s=I}),i)}),n=e.computed(()=>{const t=o.value;return Ut.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((s,l)=>({segment:s,originalIndex:l}))}),a=e.computed(()=>{if(!Yl.value||!pl.value)return[];const t=vn.value,s=gn.value,l=bn.value,i=zn.value,p=15,g=t*1.3,w=.55,b=(N,J)=>{const xe=xt.value+Math.cos(N.midAngle)*ft.value,We=_t.value+Math.sin(N.midAngle)*ft.value,re=xt.value+Math.cos(N.midAngle)*(ft.value+s),ye=_t.value+Math.sin(N.midAngle)*(ft.value+s),me=re+l*(J?1:-1),je=J?re+p:re-p,Pe=ye-i,Ae=`${N.seriesName}: ${gl(N.value)}`,_e=Ae.length*t*w;return{pointerStartX:xe,pointerStartY:We,pointerEndX:re,pointerEndY:ye,horizontalEndX:me,horizontalEndY:ye,textX:je,textY:Pe,text:Ae,textWidth:_e,textAnchor:J?"start":"end",isRightSide:J,pointerLineLength:Math.hypot(re-xe,ye-We),horizontalLineLength:Math.hypot(me-re,0)}},D=(N,J)=>{const xe=Math.abs(N.textY-J.textY)<g,We=N.isRightSide?N.textX:N.textX-N.textWidth,re=N.isRightSide?N.textX+N.textWidth:N.textX,ye=J.isRightSide?J.textX:J.textX-J.textWidth,Be=J.isRightSide?J.textX+J.textWidth:J.textX,me=We<Be&&ye<re;return xe&&me},A=o.value.filter(N=>!N.isHidden),I=[];for(let N=0;N<A.length;N++){const J=A[N];let xe=Math.cos(J.midAngle)>=0;if(N>0){const re=I[N-1],ye=b(J,xe);D(re,ye)&&(xe=!xe)}const We=b(J,xe);I.push({...We,color:J.color,isHighlighted:J.isHighlighted,isDimmed:J.isDimmed})}return I}),r=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||uo.value||.7;return Ce.value===null||Ce.value===void 0?s:Ce.value!==null?t.seriesIndex===Ce.value?Math.min(1,s+.1):Math.max(.5,s*.8):s},c=t=>{if(!t||t.isHidden)return 0;const s=t.radius>20?.9:.8;return Ce.value!==null?t.seriesIndex===Ce.value?Math.min(1,s+.1):s*.7:s},d=(t,s)=>{if(t)try{if(Ce.value===t.seriesIndex?Ce.value=null:Ce.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:H.chartId}});window.dispatchEvent(l)}}catch(l){console.error("Error in onBubbleClick:",l)}},u=(t,s)=>{const l=[`dss-bubble-fallback-${s}`];return t.isHighlighted&&l.push("dss-bubble-highlighted"),t.isDimmed&&l.push("dss-bubble-dimmed"),t.isHidden&&l.push("dss-bubble-hidden"),l.push(`dss-bubble-series-${t.seriesIndex}`),l.join(" ")},m=(t,s)=>{if(!t||(s.stopPropagation(),Xn.value=!0,Ce.value=t.seriesIndex,we.value.show=!1,!Xt.value))return;const l=s.target.closest(".dss-custom-chart-container");if(!l)return;const i=l.getBoundingClientRect();let p=s.clientX-i.left+10,g=s.clientY-i.top-10;const w=200,b=120;p+w>ie.value&&(p=s.clientX-i.left-w-10),g+b>i.height&&(g=s.clientY-i.top-b-10),p<0&&(p=10),g<0&&(g=10);const D=Bn.value,A=Mn.value,I=D.map(N=>{const J=A[N]||N,xe=v(N,t);return xe?{seriesName:t.seriesName,label:t.label,value:`${J}: ${xe}`,color:t.color}:null}).filter(Boolean);nt.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:I,categoryIndex:void 0,spiderAreas:[]}},v=(t,s)=>{let l;switch(t){case"x":l=s.originalX;break;case"y":l=s.originalY;break;case"size":l=s.originalSize;break;case"label":l=s.label;break;case"seriesName":l=s.seriesName;break;default:l=s[t]||""}const i=En.value[t];if(typeof i=="function")return i(l,s);if(typeof l=="number"){const p=l.toFixed(1);return wt.value?p+wt.value:p}return l?.toString()||""},h=()=>{if(!sl.value||!we.value.data||we.value.data.length===0)return"Bubbles";const t=[],s=new Set;return we.value.data.forEach(l=>{if(l.seriesName&&l.label){const i=`${l.seriesName} - ${l.label}`;s.has(i)||(t.push(i),s.add(i))}else l.seriesName&&(s.has(l.seriesName)||(t.push(l.seriesName),s.add(l.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},M=(t,s)=>{t&&(Xn.value=!1,Ce.value=null,nt.value.show=!1,nt.value.bubbleData=[])},T=(t,s)=>{const l=s.target.closest(".dss-custom-chart-container");if(!l)return;const i=l.getBoundingClientRect(),p=qt(t.categoryIndex),g=t.description||t.comment||"";let w=s.clientX-i.left+15,b=s.clientY-i.top-10;const D=200,A=g?80:50;w+D>ie.value&&(w=s.clientX-i.left-D-15),b+A>he.value&&(b=s.clientY-i.top-A-10),w<0&&(w=10),b<0&&(b=10),Vt.value={show:!0,x:w,y:b,categoryValue:p,description:g}},E=()=>{Vt.value.show=!1},G=e.computed(()=>H.categories.length||Math.max(...on.value.map(t=>t.data.length))),Y=e.computed(()=>{let t=0;return on.value.forEach(s=>{s.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),De=e.computed(()=>{const t=[],s=G.value;for(let l=0;l<s;l++){const i=l*2*Math.PI/s-Math.PI/2,p=xt.value+Math.cos(i)*ft.value,g=_t.value+Math.sin(i)*ft.value;t.push({x:p,y:g,angle:i,index:l})}return t}),Se=e.computed(()=>{const t=[],s=G.value;return De.value.forEach((l,i)=>{const p=ft.value+15,g=i*2*Math.PI/s-Math.PI/2,w=xt.value+Math.cos(g)*p,b=_t.value+Math.sin(g)*p+5;let D="middle",A="middle";Math.abs(Math.cos(g))>.5&&(D=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(A=Math.sin(g)>0?"hanging":"auto"),t.push({x:w,y:b,text:H.categories[i]||`Axis ${i+1}`,anchor:D,baseline:A})}),t}),vt=e.ref(new Set),vl=(t,s,l)=>{const i=`current-${l}`,p=vt.value.has(i);return!p&&Ce.value===null?s.fillOpacity||S.value:s.isHighlighted||p?(s.fillOpacity||S.value)+.15:s.isDimmed?(s.fillOpacity||S.value)*.3:s.fillOpacity||S.value},ul=e.computed(()=>{if(!Ol.value)return[];const t=[],s=G.value;return Wl.value.forEach((l,i)=>{const p=[],g=[],w=[],b=Ce.value===i,D=Ce.value!==null&&Ce.value!==i,A=zt.value.has(i);for(let I=0;I<s;I++){const N=l.data[I]||0,xe=N/Y.value*ft.value,We=I*2*Math.PI/s-Math.PI/2,re=xt.value+Math.cos(We)*xe,ye=_t.value+Math.sin(We)*xe;p.push(`${re},${ye}`),g.push({x:re,y:ye}),w.push({x:re,y:ye,value:N,label:H.categories[I]||`Axis ${I+1}`,seriesName:l.name})}t.push({points:p.join(" "),polygonPoints:g,dataPoints:w,color:Ot(i),fillOpacity:S.value,seriesName:l.name,value:`${l.name}: ${l.data.join(", ")}`,isHighlighted:b,isDimmed:D,isHidden:A,seriesIndex:i})}),t}),rl=(t,s)=>{if(!s||s.length<3)return!1;let l=!1;for(let i=0,p=s.length-1;i<s.length;p=i++){const g=s[i].x,w=s[i].y,b=s[p].x,D=s[p].y;w>t.y!=D>t.y&&t.x<(b-g)*(t.y-w)/(D-w)+g&&(l=!l)}return l},ml=t=>{if(!Ol.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const l=s.getBoundingClientRect(),i=$.value?.getBoundingClientRect();if(!i)return;const p=t.clientX-i.left,g=t.clientY-i.top,w=ul.value.filter(b=>b.isHidden?!1:rl({x:p,y:g},b.polygonPoints));if(w.length>0){w.length,Ce.value=w[0].seriesIndex;const b=t.clientX-l.left+10,D=t.clientY-l.top-10,A=w.length>1?460:260,I=70+G.value*20;let N=b,J=D;N+A>ie.value&&(N=t.clientX-l.left-A-10),J+I>he.value&&(J=t.clientY-l.top-I-10),N<0&&(N=10),J<0&&(J=10);const xe=w.map(We=>({seriesName:We.seriesName,color:We.color,points:We.dataPoints.map(re=>({label:re.label,value:gl(re.value)}))}));nt.value={show:!0,x:N,y:J,title:"",value:"",bubbleData:[],spiderAreas:xe}}else Zl()},Jt=e.computed(()=>{const t=R.value;return t.logos.map((s,l)=>{const i=H.series[s.seriesIndex];if(!i||!i.data||i.data.length===0||zt.value.has(s.seriesIndex))return null;let p,g;if(xl.value){let b=-1,D=null;for(let I=i.data.length-1;I>=0;I--)if(i.data[I]!==null&&i.data[I]!==void 0){b=I,D=i.data[I];break}if(b===-1||D===null)return null;const A=i.data.map((I,N)=>I==null?null:{x:Qt(N),y:kl(I),index:N}).filter(I=>I!==null);if(t.animations.enabled&&!Cl.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Bt.value.isAnimating||!Bt.value.hasAnimated))if(Bt.value.isAnimating){const I=Bt.value.currentFrame/Bt.value.totalFrames,N=ql(t.animations.easing,Math.min(I,1)),J=aa(A,N);p=J.x+(s.offsetX||0),g=J.y+(s.offsetY||0)}else p=A[0].x+(s.offsetX||0),g=A[0].y+(s.offsetY||0);else p=Qt(b)+(s.offsetX||0),g=kl(D)+(s.offsetY||0)}else if(pl.value||Ol.value){const b=Math.PI*2/t.logos.length*l;p=xt.value+Math.cos(b)*(ft.value+30)+(s.offsetX||0),g=_t.value+Math.sin(b)*(ft.value+30)+(s.offsetY||0)}return{...s,x:p,y:g,seriesIndex:s.seriesIndex}}).filter(Boolean)}),dl=t=>{const s=document.querySelector(`.dss-logo-fallback-${t}`),l=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.opacity="0"),l&&(l.style.opacity="1")},en=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},tn=t=>{zt.value.has(t)?zt.value.delete(t):zt.value.add(t)},pn=e.computed(()=>{if(!nt.value.show&&!(te.value&&we.value.show&&!le.value.isZooming))return{display:"none"};let t,s;if(te.value&&we.value.show&&!le.value.isZooming){t=we.value.x+15,s=O.value.top;const l=sl.value?200:150;t+l>ie.value&&(t=we.value.x-l-15),t<0&&(t=10),s<10&&(s=10)}else t=nt.value.x,s=nt.value.y;return{left:t+"px",top:s+"px"}}),sn=(t,s)=>{if(!Xt.value||Yn.value)return;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=s.clientX-i.left+10,g=s.clientY-i.top-10;const w=200,b=120,D=ie.value,A=he.value;p+w>D&&(p=s.clientX-i.left-w-10),g+b>A&&(g=s.clientY-i.top-b-10),p<0&&(p=10),g<0&&(g=10);let I;typeof t.categoryIndex=="number"?I=t.categoryIndex:typeof t.dataIndex=="number"?I=t.dataIndex:t.label&&H.categories.includes(t.label)&&(I=H.categories.indexOf(t.label));const N=(fl.value||qe.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";nt.value={show:!0,x:p,y:g,title:N,value:gl(t.value)||"",categoryIndex:I,spiderAreas:[]}},Un=e.ref(!1),Xn=e.ref(!1),Zl=()=>{nt.value.show=!1,nt.value.spiderAreas=[],nt.value.bubbleData=[],we.value.show=!1,Un.value||(Ce.value=null)},Yn=e.ref(!1),Nn=(t,s)=>{Yn.value=!0,nt.value.show=!1,we.value.show=!1;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=s.clientX-i.left+15,g=s.clientY-i.top-10;const w=250;p+w>ie.value&&(p=s.clientX-i.left-w-15),p<0&&(p=10),g<0&&(g=10),zl.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},fn=()=>{Yn.value=!1,zl.value.show=!1},Bt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),ql=(t,s)=>{switch(t){case"linear":return s;case"ease":return s<.5?2*s*s:-1+(4-2*s)*s;case"ease-in":return s*s;case"ease-out":return s*(2-s);case"ease-in-out":return s<.5?2*s*s:-1+(4-2*s)*s;default:return s}},Cl=e.computed(()=>C.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Il=()=>{if(!Re.value||Cl.value){Bt.value.hasAnimated=!0,Vl.value&&(Ll.value=1);return}Vl.value&&(Ll.value=0),Bt.value.isAnimating=!0,Bt.value.currentFrame=0,Bt.value.totalFrames=Math.ceil(Rt.value/16.67);const t=()=>{const s=Bt.value.currentFrame/Bt.value.totalFrames,l=ql(Wt.value,Math.min(s,1));Zo(l),Vl.value&&(Ll.value=l),s<1?(Bt.value.currentFrame++,Bt.value.animationId=requestAnimationFrame(t)):ta()};Bt.value.animationId=requestAnimationFrame(t)},Zo=t=>{const s=z.value;s&&s.style.setProperty("--dss-animation-progress",t)},ta=()=>{Bt.value.isAnimating=!1,Bt.value.hasAnimated=!0,Vl.value&&(Ll.value=1),Bt.value.animationId&&(cancelAnimationFrame(Bt.value.animationId),Bt.value.animationId=null)},Po=e.computed(()=>!pl.value||Bt.value.hasAnimated?!0:Vl.value?Ll.value>=1:$l.value?Hl.value>=1:!0),qo=e.computed(()=>Yl.value&&Po.value),No=e.ref(!1);e.watch(qo,t=>{t?(No.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{No.value=!0})})):No.value=!1},{immediate:!0});const la=e.computed(()=>{if(!Re.value||Cl.value||Bt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${Rt.value}ms`,t["--dss-animation-easing"]=na(Wt.value),t["--dss-stagger-delay"]=`${At.value}ms`,t}),na=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",oa=()=>{if(!Re.value||Cl.value)return"";const t=["dss-chart-animated"];return Bt.value.hasAnimated||t.push(`dss-animate-${ht.value}`),Bt.value.hasAnimated||(pl.value&&qe.value!=="semi-radial"?t.push("dss-animate-fill"):pl.value||t.push(`dss-animate-${ht.value}`)),Bt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>H.series,(t,s)=>{V.value&&s&&Bt.value.hasAnimated&&(Bt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Il(),jt.value)}))},{deep:!0}),e.watch(()=>le.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{k()},50)}),e.watch(()=>[le.value.scale,le.value.offsetX],()=>{!le.value.isZooming&&!le.value.isDragging&&k()},{flush:"post"}),e.watch([Oe,st],([t,s])=>{le.value.minScale=t,le.value.maxScale=s,(le.value.scale<t||le.value.scale>s)&&so()},{immediate:!0}),e.watch(()=>H.locale,t=>{t&&t!==_.value&&(_.value=t)},{immediate:!0}),e.watch(()=>kt.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",ao)}):document.removeEventListener("click",ao)}),e.onMounted(()=>{Ce.value=null,Vl.value&&(!Re.value||Cl.value)&&(Ll.value=1),Kt(),z.value&&typeof ResizeObserver<"u"&&(f=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(be&&cancelAnimationFrame(be),be=requestAnimationFrame(()=>{be=null;const{width:l,height:i}=s.contentRect;Ke.value=Math.round(l),pe.value=Math.round(i),X.value&&(lt.value=X.value.offsetHeight||fe)}))}),f.observe(z.value)),Re.value&&!Cl.value?qe.value==="semi-radial"?setTimeout(()=>Hn(),jt.value):setTimeout(()=>Il(),jt.value):(Bt.value.hasAnimated=!0,qe.value==="semi-radial"&&(Hl.value=1)),document.addEventListener("mousemove",Uo),document.addEventListener("mouseup",Xo),document.addEventListener("click",oo)}),e.onUnmounted(()=>{be&&cancelAnimationFrame(be),f&&z.value&&(f.unobserve(z.value),f.disconnect(),f=null),Bt.value.animationId&&cancelAnimationFrame(Bt.value.animationId),Dn&&(cancelAnimationFrame(Dn),Dn=null),le.value.zoomTimeout&&clearTimeout(le.value.zoomTimeout),document.removeEventListener("mousemove",Uo),document.removeEventListener("mouseup",Xo),document.removeEventListener("click",oo),document.removeEventListener("click",ao)});const Uo=t=>{if(le.value.isDragging&&le.value.scale>1&&xl.value){we.value.show=!1;const s=t.clientX-le.value.lastMouseX,{minX:l,maxX:i}=Gt.value,p=i-l||1,w=s*.8;le.value.offsetX+=w;const b=p/le.value.scale,D=p-b,A=0,I=-D/p*O.value.width,N=A;le.value.offsetX=Math.max(I,Math.min(N,le.value.offsetX)),le.value.lastMouseX=t.clientX,le.value.lastMouseY=t.clientY}},Xo=()=>{le.value.isDragging&&(le.value.isDragging=!1,setTimeout(()=>{!le.value.isDragging&&le.value.isZooming},100))},aa=(t,s)=>{const l=t.filter(b=>b!=null);if(!l||l.length===0)return{x:0,y:0};if(l.length===1||s<=0)return l[0];if(s>=1)return l[l.length-1];let i=0;const p=[];for(let b=1;b<l.length;b++){const D=l[b].x-l[b-1].x,A=l[b].y-l[b-1].y,I=Math.sqrt(D*D+A*A);p.push(I),i+=I}const g=i*s;let w=0;for(let b=0;b<p.length;b++){const D=w+p[b];if(g<=D){const A=(g-w)/p[b],I=l[b],N=l[b+1];return{x:I.x+(N.x-I.x)*A,y:I.y+(N.y-I.y)*A}}w=D}return l[l.length-1]};return(t,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[oa(),{"dss-chart-fill-width":ge.value,"dss-chart-fill-height":ve.value,"dss-chart-compact":pl.value&&!Ge.value}]]),style:e.normalizeStyle({width:ge.value?"100%":ie.value+"px",height:yt.value,...ge.value||ve.value?{overflow:pl.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...la.value,cursor:Ho()}),"data-chart-type":qe.value,ref_key:"containerEl",ref:z,onWheel:Co,onMousedown:bo,onMousemove:Gl,onMouseup:Do,onMouseleave:wl,onDblclick:so,onContextmenu:e.withModifiers(ln,["prevent"]),onClick:e.withModifiers(Pt,["left"]),onWheelCapture:Co},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:X},[e.createElementVNode("div",Qa,[at.value?(e.openBlock(),e.createElementBlock("div",Ja,e.toDisplayString(at.value),1)):e.createCommentVNode("",!0),Et.value?(e.openBlock(),e.createElementBlock("div",es,e.toDisplayString(Et.value),1)):e.createCommentVNode("",!0)]),Ge.value&&Je.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Lt.value==="horizontal","dss-legend-vertical":Lt.value==="vertical","dss-legend-top":Je.value==="top","dss-legend-bottom":Je.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":zt.value.has(i),"dss-legend-hovered":Ce.value===i,"dss-legend-dimmed":Ce.value!==null&&Ce.value!==i}]),onClick:p=>tn(i),onMouseenter:p=>Sn(i),onMouseleave:rn,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Ot(i)})},null,4),e.createElementVNode("span",ls,e.toDisplayString(l.name),1)],46,ts))),128))],2)):e.createCommentVNode("",!0),Ge.value&&(Je.value==="left"||Je.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Je.value==="left","dss-legend-right":Je.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":zt.value.has(i),"dss-legend-hovered":Ce.value===i,"dss-legend-dimmed":Ce.value!==null&&Ce.value!==i}]),onClick:p=>tn(i),onMouseenter:p=>Sn(i),onMouseleave:rn,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Ot(i)})},null,4),e.createElementVNode("span",os,e.toDisplayString(l.name),1)],46,ns))),128))],2)):e.createCommentVNode("",!0)],512),L.showAddMarkerButton&&Ee.value&&Ve.value.addMarker&&(xl.value||sl.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:ko,title:e.unref(B)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Dt.value,class:"dss-add-marker-button-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,ss),s[4]||(s[4]=e.createElementVNode("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 4V16M4 10H16",stroke:"hsl(60, 2%, 47%)","stroke-width":"2","stroke-linecap":"round"})],-1))],8,as)):e.createCommentVNode("",!0),e.createElementVNode("div",rs,[sl.value&&Ht.value?(e.openBlock(),e.createElementBlock("div",is,"Bubble size: "+e.toDisplayString(Ht.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:ie.value,height:he.value,class:"dss-chart-svg","data-smooth":se.value,"data-animated":Re.value,ref_key:"svgEl",ref:$},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:j.value},[e.createElementVNode("rect",{x:0,y:O.value.top,width:ie.value,height:O.value.height*4},null,8,ds)],8,us),$l.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Jl.value},[e.createElementVNode("path",{d:wo.value},null,8,ps)],8,ms)):e.createCommentVNode("",!0),Vl.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:kn.value},[e.createElementVNode("path",{d:Vn.value},null,8,vs)],8,fs)):e.createCommentVNode("",!0)]),xl.value||sl.value?(e.openBlock(),e.createElementBlock("g",gs,[Yt.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":ue.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(So.value,(l,i)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${i}`,x1:O.value.left,x2:O.value.right,y1:l.y,y2:l.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${i*50}ms`})},null,12,ys))),128))],8,hs)):e.createCommentVNode("",!0),e.createElementVNode("g",ks,[e.createElementVNode("line",{x1:O.value.left,x2:O.value.right,y1:O.value.bottom,y2:O.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Cs),e.createElementVNode("line",{x1:O.value.left,x2:O.value.left,y1:O.value.top,y2:O.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,bs)]),e.createElementVNode("g",ws,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(po.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${i}`,x:l.x,y:l.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},e.toDisplayString(l.text),13,xs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(an.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${i}`,x:l.x,y:l.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(l.text),13,Es))),128)),ll.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:O.value.left+O.value.width/2,y:O.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(ll.value),9,Ss)):e.createCommentVNode("",!0),It.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:O.value.top+12+O.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${O.value.top+O.value.height/2})`},e.toDisplayString(It.value),9,Vs)):e.createCommentVNode("",!0)]),Al.value.length>0?(e.openBlock(),e.createElementBlock("g",Ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Al.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":ue.value},[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.x,y1:O.value.bottom,y2:O.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>Nn(l,i),onMouseleave:fn},null,40,Ms)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:O.value.bottom,y2:O.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>Nn(l,i),onMouseleave:fn},null,40,_s)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:O.value.bottom,y2:O.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>Nn(l,i),onMouseleave:fn},null,40,$s)):e.createCommentVNode("",!0)],8,Bs),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,O.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>Nn(l,i),onMouseleave:fn},null,40,Ls)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,O.value.top-10),r:"14",fill:l.hasManual&&l.hasAuto||l.hasManual?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:i=>Nn(l,i),onMouseleave:fn},null,40,Ts),e.createElementVNode("text",{x:l.x,y:Math.max(15,O.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(l.totalCount),9,As)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":ue.value},[Dl.value?(e.openBlock(),e.createElementBlock("g",Hs,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":fl.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yo.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${i}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>sn(l,p),onMouseleave:Zl},null,46,Rs)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>sn(l,p),onMouseleave:Zl},null,46,Is))],64))),128))],2),e.createElementVNode("g",Fs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+2:Ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,zs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rl.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+2:Ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:l.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Ps))),128)),dt.value>0||Le.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ho.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:l.x,cy:l.y,r:U(l.isHighlighted?W(l,dt.value)+2:W(l,dt.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>sn(l,p),onMouseleave:Zl},null,46,Os))),128)):e.createCommentVNode("",!0)])])):qe.value==="line"?(e.openBlock(),e.createElementBlock("g",Ws,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zo.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:l.path,stroke:l.color,"stroke-width":Ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Bt.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Zs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+2:Ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,qs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rl.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+2:Ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:l.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Us))),128)),dt.value>0||Le.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Cn.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:l.x,cy:l.y,r:U(l.isHighlighted?W(l,dt.value)+2:W(l,dt.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>sn(l,p),onMouseleave:Zl},null,46,Xs))),128)):e.createCommentVNode("",!0)])):qe.value==="area"?(e.openBlock(),e.createElementBlock("g",Ys,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qn.value,(l,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${L.chartId}`},[e.createElementVNode("rect",{x:O.value.left-10,y:O.value.top-10,width:O.value.width+20,height:O.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${O.value.width+20}px`})},null,12,Ks)],8,js))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?ee.value+.2:ee.value,mask:`url(#area-mask-${i}-${L.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden})},null,10,Gs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+1:Ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${i*At.value}ms`})},null,14,Qs))),128))])):qe.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":fl.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yo.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${i}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>sn(l,p),onMouseleave:Zl},null,46,Js)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>sn(l,p),onMouseleave:Zl},null,46,er))],64))),128))],2)):e.createCommentVNode("",!0)],8,Ds),te.value&&we.value.show&&!le.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":ue.value},[e.createElementVNode("line",{x1:we.value.x,x2:we.value.x,y1:O.value.top,y2:O.value.bottom,stroke:$e.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,lr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value.data,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:we.value.x,cy:l.y,r:U(dt.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,nr))),128))],8,tr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),sl.value?(e.openBlock(),e.createElementBlock("g",or,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zn.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[l?(e.openBlock(),e.createElementBlock("g",ar,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:U(l.radius),fill:l.color,"fill-opacity":r(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(u(l,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>m(l,p),onMouseleave:p=>M(l),onClick:p=>d(l,p)},null,42,sr),l.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:l.x-l.radius*.65,y:l.y-l.radius*.65,width:l.radius*1.3,height:l.radius*1.3,"xlink:href":l.imageUrl,class:e.normalizeClass(`dss-bubble-image-${i} ${l.isHighlighted?"dss-bubble-highlighted":""} ${l.isDimmed?"dss-bubble-dimmed":""} ${l.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${l.radius*.65}px at ${l.radius*.65}px ${l.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:c(l)}),onLoad:p=>Fo(i),onError:p=>Wn(i),onMouseenter:p=>m(l,p),onMouseleave:p=>M(l),onClick:p=>d(l,p)},null,46,rr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),pl.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:ro.value},[qe.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:xt.value,cy:_t.value,r:ft.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,cr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":qe.value,"clip-path":Io.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${l.originalIndex}-${i}`,d:l.segment.path,fill:l.segment.color,"fill-opacity":l.segment.isHighlighted?(l.segment.opacity||.8)+.2:l.segment.opacity||.8,stroke:l.segment.strokeWidth?l.segment.strokeColor||l.segment.color:"none","stroke-width":l.segment.strokeWidth||0,"clip-path":yn(l.originalIndex),class:e.normalizeClass({"dss-series-highlighted":l.segment.isHighlighted,"dss-series-dimmed":l.segment.isDimmed,"dss-series-hidden":l.segment.isHidden}),onMouseover:p=>sn(l.segment,p),onMouseleave:Zl},null,42,dr))),128))],8,ur),Pn.value&&Po.value?(e.openBlock(),e.createElementBlock("g",mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nl.value,(l,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${i}`,x:l.x,y:l.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label",style:e.normalizeStyle({fill:l.contrastColor})},e.toDisplayString(l.value),13,pr)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),wn.value&&(Po.value||$l.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:jl.value.x,y:jl.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Fl.value,fill:bl.value,class:"dss-radial-data-center"},e.toDisplayString(xn.value),9,fr)):e.createCommentVNode("",!0),qo.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":No.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${i}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":l.isHighlighted,"dss-label-dimmed":l.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${i*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:l.pointerStartX,y1:l.pointerStartY,x2:l.pointerEndX,y2:l.pointerEndY,stroke:l.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":l.pointerLineLength})},null,12,vr),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:l.pointerEndX,y1:l.pointerEndY,x2:l.horizontalEndX,y2:l.horizontalEndY,stroke:l.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":l.horizontalLineLength})},null,12,gr),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":vn.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,hr)],6))),128))],2)):e.createCommentVNode("",!0)],8,ir)):e.createCommentVNode("",!0),Ol.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:ro.value},[Yt.value?(e.openBlock(),e.createElementBlock("g",kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:xt.value,cy:_t.value,r:U(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,Cr))),128)),e.createElementVNode("g",br,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:xt.value-16,y:_t.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,wr),e.createElementVNode("text",{x:xt.value,y:_t.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Ue(i)),9,xr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(De.value,(l,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:xt.value,x2:l.x,y1:_t.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,Er))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Sr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Se.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:l.x+Math.cos(i*2*Math.PI/G.value-Math.PI/2)*16,y:l.y+Math.sin(i*2*Math.PI/G.value-Math.PI/2)*16,"text-anchor":l.anchor,"dominant-baseline":l.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${i*120}ms`})},e.toDisplayString(l.text.charAt(0).toUpperCase()+l.text.slice(1)),13,Vr))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:ml,onMouseleave:Zl},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ul.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":vl("current",l,i),stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+1:Ze.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${i*At.value}ms`,transition:"all 0.2s ease"})},null,14,Nr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.dataPoints,(p,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${i}-${g}`,cx:p.x,cy:p.y,r:U(l.isHighlighted?dt.value+1:dt.value>0?dt.value:0),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${i*At.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:w=>sn(p,w),onMouseleave:Zl},null,46,Br))),128))]))),128))],32)],8,yr)):e.createCommentVNode("",!0),e.createElementVNode("g",Mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jt.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:l.x,cy:l.y,r:U(l.width/2),fill:Ot(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,_r))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jt.value,(l,i)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${i}`,x:l.x-l.width/2,y:l.y-l.height/2,width:l.width,height:l.height,"xlink:href":l.url,onLoad:p=>dl(i),onError:p=>en(i),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${i}`),"clip-path":`circle(${l.width/2}px at ${l.width/2}px ${l.height/2}px)`,style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,46,$r))),128))])],8,cs))]),ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:ie.value+"px",height:he.value+"px",backgroundImage:`url('${Ml.value}')`,backgroundRepeat:"no-repeat",...Ct.value,opacity:Te.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(l,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+l.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:l.x+"px",top:l.y+"px",width:pt.value+"px",height:pt.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>Nt(l),["stop"]),onMouseenter:p=>T(l,p),onMouseleave:E},[e.createElementVNode("img",{src:nn(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Tr)],44,Lr)),[[e.vShow,F.value]])),128)),Vt.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Vt.value.x+"px",top:Vt.value.y+"px"})},[e.createElementVNode("div",Ar,e.toDisplayString(Vt.value.categoryValue),1),Vt.value.description?(e.openBlock(),e.createElementBlock("div",Dr,e.toDisplayString(Vt.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Xt.value&&(nt.value.show||te.value&&we.value.show&&!le.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":te.value&&we.value.show&&!le.value.isZooming,"dss-spider-tooltip":Ol.value&&nt.value.spiderAreas&&nt.value.spiderAreas.length>0}]),style:e.normalizeStyle(pn.value)},[!te.value||!we.value.show||le.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Ol.value&&nt.value.spiderAreas&&nt.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",Hr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nt.value.spiderAreas,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${i}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",Rr,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createTextVNode(" "+e.toDisplayString(l.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.points,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${i}-${g}`,class:"dss-tooltip-series"},[e.createElementVNode("span",Ir,e.toDisplayString(p.label),1),e.createElementVNode("span",Fr,e.toDisplayString(p.value),1)]))),128))]))),128))])):sl.value&&nt.value.bubbleData&&nt.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",zr,[nt.value.title?(e.openBlock(),e.createElementBlock("div",Pr,e.toDisplayString(nt.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Or,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nt.value.bubbleData,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",Wr,[e.createElementVNode("div",Zr,e.toDisplayString(nt.value.title),1),e.createElementVNode("div",qr,e.toDisplayString(nt.value.value),1)])),nt.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[hl(nt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Ur,[s[5]||(s[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Xr,e.toDisplayString(e.unref(B)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(hl(nt.value.categoryIndex).flagGroups,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",Yr,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",jr,[e.createElementVNode("div",Kr,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),hl(nt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Gr,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Qr,e.toDisplayString(e.unref(B)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(hl(nt.value.categoryIndex).markers,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",Jr,[e.createElementVNode("div",ei,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",ti,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",li,[e.createElementVNode("div",ni,e.toDisplayString(sl.value?h():L.categories[we.value.categoryIndex]||`Category ${we.value.categoryIndex+1}`),1),sl.value?(e.openBlock(),e.createElementBlock("div",oi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value.data,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(we.value.data,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",ai,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",si,e.toDisplayString(gl(l.value)),1)]))),128))]),hl(we.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",ri,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ii,e.toDisplayString(e.unref(B)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(hl(we.value.categoryIndex).flagGroups,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",ci,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",ui,[e.createElementVNode("div",di,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),hl(we.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",mi,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",pi,e.toDisplayString(e.unref(B)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(hl(we.value.categoryIndex).markers,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",fi,[e.createElementVNode("div",vi,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",gi,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),xl.value&&Ne.value&&le.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:so},[s[9]||(s[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(le.value.scale*100))+"% "+e.toDisplayString(e.unref(B)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Ga),Ge.value&&Je.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Lt.value==="horizontal","dss-legend-vertical":Lt.value==="vertical","dss-legend-bottom":!0}]),style:{display:"flex","flex-wrap":"wrap","justify-content":"center",padding:"6px 8px 0"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":zt.value.has(i),"dss-legend-hovered":Ce.value===i,"dss-legend-dimmed":Ce.value!==null&&Ce.value!==i}]),onClick:p=>tn(i),onMouseenter:p=>Sn(i),onMouseleave:rn,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Ot(i)})},null,4),e.createElementVNode("span",yi,e.toDisplayString(l.name),1)],46,hi))),128))],2)):e.createCommentVNode("",!0),kt.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:kt.value.x+"px",top:kt.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[Ve.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Ao},e.toDisplayString(e.unref(B)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Ve.value.addMarker&&(Ve.value.downloadSvg||Ve.value.downloadPng||Ve.value.downloadCsv||Tt.value.length>0)?(e.openBlock(),e.createElementBlock("div",ki)):e.createCommentVNode("",!0),Ve.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:cn},e.toDisplayString(e.unref(B)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Ve.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:_l},e.toDisplayString(e.unref(B)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Ve.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:no},e.toDisplayString(e.unref(B)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Tt.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Ve.value.downloadSvg||Ve.value.downloadPng||Ve.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Ci)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[l.separator?(e.openBlock(),e.createElementBlock("div",bi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(lo(l)),style:e.normalizeStyle(On(l)),onClick:p=>Tn(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Bl(l),class:"dss-custom-menu-content"},null,8,xi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",Ei,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,wi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Ie.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:x},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[3]||(s[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Si,[e.createElementVNode("h3",null,e.toDisplayString(yl.value?e.unref(B)("chart.modalMarker.viewMarker"):Kl.value?e.unref(B)("chart.modalMarker.editMarker"):e.unref(B)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:x},"×")]),e.createElementVNode("div",Vi,[e.createElementVNode("div",Ni,[e.createVNode(Wo,{id:"dss-marker-date",mode:"single",modelValue:Ie.value.date,"onUpdate:modelValue":s[1]||(s[1]=l=>Ie.value.date=l),"min-date":_n.value,"max-date":Pl.value,disabled:yl.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",Bi,[e.createElementVNode("label",Mi,e.toDisplayString(e.unref(B)("chart.modalMarker.description")),1),yl.value?(e.openBlock(),e.createElementBlock("div",_i,e.toDisplayString(Ie.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=l=>Ie.value.description=l),placeholder:e.unref(B)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,$i)),[[e.vModelText,Ie.value.description]])])]),e.createElementVNode("div",Li,[e.createElementVNode("div",Ti,[Kl.value&&!yl.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:Z},e.toDisplayString(e.unref(B)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ai,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:x},e.toDisplayString(yl.value?e.unref(B)("chart.modalMarker.close"):e.unref(B)("chart.modalMarker.cancel")),1),yl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:y,disabled:!(Ie.value.description&&Ie.value.description.length)},e.toDisplayString(Kl.value?e.unref(B)("chart.modalMarker.save"):e.unref(B)("chart.contextMenu.addMarker")),9,Di))])])])])):e.createCommentVNode("",!0)],64))}}),Ii={class:"dss-modal-title"},Fi={class:"dss-modal-actions"},Oo={__name:"DSSModal",props:{showModal:{type:Boolean,required:!0},backDrop:{type:Boolean,default:!0},width:{type:String,default:"800px"},height:{type:String,default:"auto"},showCloseBtn:{type:Boolean,default:!0},headerType:{type:String,default:"space-between"},titleSize:{type:String,default:"24px"}},emits:["close-modal"],setup(L,{emit:ae}){const B=L,_=ae,oe=e.ref(null),z=e.ref(null),$=e.computed(()=>{const j={"max-width":B.width};return B.height!=="auto"&&(j.height=B.height,j["min-height"]="0"),j}),X=e.computed(()=>({}));function Ke(){_("close-modal")}function pe(){B.backDrop&&!oe.value&&_("close-modal")}function f(j){j.target.tagName==="INPUT"&&(oe.value=j.target.tagName)}function be(){setTimeout(()=>{oe.value=null},300)}function fe(){const j=document.body,ue=document.documentElement;z.value={bodyOverflow:j.style.overflow,bodyPosition:j.style.position,bodyTop:j.style.top,bodyWidth:j.style.width,htmlOverflow:ue.style.overflow,scrollY:window.scrollY},j.style.overflow="hidden",j.style.position="fixed",j.style.top=`-${z.value.scrollY}px`,j.style.width="100%",j.style.left="0",ue.style.overflow="hidden"}function ne(){if(!z.value)return;const j=document.body,ue=document.documentElement,{bodyOverflow:H,bodyPosition:ke,bodyTop:Me,bodyWidth:ze,htmlOverflow:tt,scrollY:R}=z.value;j.style.overflow=H||"",j.style.position=ke||"",j.style.top=Me||"",j.style.width=ze||"",j.style.left="",ue.style.overflow=tt||"",window.scrollTo(0,R||0)}return e.watch(()=>B.showModal,j=>{if(j)fe(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const ue=document.getElementById("dss-modal-backdrop");ue&&(ue.addEventListener("focusin",f),ue.addEventListener("focusout",be))},100);else{ne(),document.body.classList.remove("dss-modal-open");const ue=document.getElementById("dss-modal-backdrop");ue&&(ue.removeEventListener("focusin",f),ue.removeEventListener("focusout",be))}},{immediate:!0}),e.onUnmounted(()=>{B.showModal&&ne()}),(j,ue)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:pe},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle($.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:ue[0]||(ue[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":L.headerType,"font-size":L.titleSize})},[e.createElementVNode("h1",Ii,[e.renderSlot(j.$slots,"title",{},()=>[ue[1]||(ue[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(j.$slots,"title-data"),L.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:Ke,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(X.value)},[e.renderSlot(j.$slots,"content",{},()=>[ue[2]||(ue[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Fi,[e.renderSlot(j.$slots,"actions")])])],4),[[e.vShow,L.showModal]])])):e.createCommentVNode("",!0)]))}},zi={key:0,class:"dss-table-toolbar"},Pi={class:"dss-table-toolbar-left"},Oi=["aria-expanded"],Wi={class:"dss-pagination-select-dropdown",role:"listbox"},Zi={class:"dss-table-column-visibility-label"},qi={class:"dss-table-checkbox-wrapper"},Ui=["checked","onChange"],Xi={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Yi={class:"dss-table-column-visibility-text"},ji={class:"dss-table-toolbar-right"},Ki=["placeholder","aria-label"],Gi=["aria-label"],Qi=["aria-label","aria-expanded"],Ji={key:1,class:"dss-table-toolbar-extra"},ec={class:"dss-table-thead"},tc={key:0,class:"dss-table-th dss-table-selection-column"},lc={key:0,class:"dss-table-checkbox-wrapper"},nc=["checked","indeterminate"],oc={key:0,class:"dss-table-checkbox__indeterminate"},ac={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},sc=["aria-label"],rc=["onClick"],ic={class:"dss-table-th-content"},cc={class:"dss-table-th-text"},uc={key:0},dc={key:1},mc={key:2},pc=["data-filter-column-key","aria-expanded","aria-label","onClick"],fc={class:"dss-table-tbody"},vc=["onClick"],gc={class:"dss-table-checkbox-wrapper"},hc=["type","name","checked","onChange"],yc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},kc={key:1,class:"dss-table-checkbox__dot"},Cc=["onClick"],bc=["aria-expanded","aria-label"],wc={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},xc={key:0,class:"dss-table-expansion-row"},Ec=["colspan"],Sc=["colspan"],Vc={key:1,class:"dss-table-pagination"},Nc={class:"dss-table-pagination-left"},Bc={key:0},Mc={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},_c={class:"dss-table-pagination-center"},$c={key:0,class:"dss-pagination-controls"},Lc=["disabled","title"],Tc=["disabled","title"],Ac=["aria-label","onKeydown"],Dc={class:"dss-pagination-of"},Hc=["disabled","title"],Rc=["disabled","title"],Ic={class:"dss-table-pagination-right"},Fc={class:"dss-pagination-rows-label"},zc=["aria-expanded"],Pc=["aria-selected","onClick"],Oc={key:0,class:"dss-table-filter-row"},Wc=["value","placeholder"],Zc=["min","max","value"],qc=["min","max","value"],Uc={class:"dss-table-filter-double-range-values"},Xc={key:2,class:"dss-table-filter-daterange"},Yc={class:"dss-table-filter-daterange-row"},jc={class:"dss-table-filter-daterange-label"},Kc=["value"],Gc={class:"dss-table-filter-daterange-row"},Qc={class:"dss-table-filter-daterange-label"},Jc=["value"],eu=["value","placeholder"],tu={class:"dss-table-filter-list"},lu=["checked","onChange"],nu={class:"dss-table-filter-actions"},ou={name:"DSSTable"},au=Object.assign(ou,{props:{data:{type:Array,required:!0,default:()=>[]},columns:{type:Array,required:!0,default:()=>[]},tableId:{type:String,default:()=>"table-"+Math.random().toString(36).substring(2,9)},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:L=>typeof L=="object"&&L!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(L,{emit:ae}){const{t:B,locale:_}=Gn.useI18n(),oe=L,z=ae,$={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,expandableRowData:null,expandableRowCondition:null,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single"},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100],showCounter:!0,showControlsGroup:!0,showControls:!0,showRowsPerPage:!0},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:null};function X(k,y){const x=Object.assign({},k);return Ke(k)&&Ke(y)&&Object.keys(y).forEach(Z=>{Ke(y[Z])?Z in k?x[Z]=X(k[Z],y[Z]):Object.assign(x,{[Z]:y[Z]}):Object.assign(x,{[Z]:y[Z]})}),x}function Ke(k){return k&&typeof k=="object"&&!Array.isArray(k)}const pe=e.computed(()=>X($,oe.options)),f=e.computed(()=>{const k=pe.value.table.width;return k==="auto"?null:typeof k=="number"?k:null}),be=e.computed(()=>pe.value.table.height),fe=e.computed(()=>pe.value.table.rowHeight??"auto"),ne=e.computed(()=>({height:fe.value})),j=e.computed(()=>pe.value.table.expandable===!0),ue=e.computed(()=>pe.value.table.expandableRowData??null),H=e.computed(()=>pe.value.table.expandableRowCondition??null),ke=e.computed(()=>pe.value.table.truncated===!0),Me=e.computed(()=>pe.value.table.striped),ze=e.computed(()=>pe.value.table.bordered),tt=e.computed(()=>pe.value.table.hoverable),R=e.computed(()=>pe.value.table.size),ge=e.computed(()=>pe.value.table.align||"left");e.computed(()=>pe.value.title.text),e.computed(()=>pe.value.subtitle.text);const ve=e.computed(()=>pe.value.selection.enabled),ie=e.computed(()=>pe.value.selection.mode),lt=e.computed(()=>pe.value.sorting.enabled),gt=e.computed(()=>pe.value.sorting.mode),he=e.computed(()=>pe.value.pagination.enabled),yt=e.computed(()=>pe.value.pagination.rows),qe=e.computed(()=>pe.value.pagination.rowsPerPageOptions),tl=e.computed(()=>pe.value.pagination.showCounter!==!1),at=e.computed(()=>pe.value.pagination.showControlsGroup),Et=e.computed(()=>at.value===!1?!1:pe.value.pagination.showControls!==!1),Ht=e.computed(()=>at.value===!1?!1:pe.value.pagination.showRowsPerPage!==!1),ll=e.computed(()=>he.value&&(tl.value||Et.value||Ht.value)),It=e.computed(()=>pe.value.scrollable),ot=e.computed(()=>pe.value.emptyMessage||B("table.emptyMessage")),St=e.computed(()=>pe.value.toolbar?.downloads?.pdf!==!1),nl=e.computed(()=>pe.value.toolbar?.downloads?.excel!==!1),Ft=e.computed(()=>pe.value.toolbar?.search!==!1),Yt=e.computed(()=>St.value||nl.value||Ft.value||Ge.value),Ge=e.computed(()=>pe.value.toolbar?.columnVisibility!==!1),Je=e.ref(""),Lt=e.ref(!1),Xt=e.ref(null);let te=null;function $e(){Lt.value?(te&&(clearTimeout(te),te=null),Lt.value=!1,Je.value="",z("search",""),Xt.value?.blur()):(Lt.value=!0,te=setTimeout(()=>{te=null,Xt.value?.focus()},80))}function Ne(){Je.value||(Lt.value=!1)}function Oe(){Je.value="",z("search",""),Xt.value?.focus()}const st=e.computed(()=>({"dss-table-striped":Me.value,"dss-table-bordered":ze.value,"dss-table-hoverable":tt.value,[`dss-table-${R.value}`]:R.value!=="default","dss-table-truncated":ke.value})),Ze=(k,y)=>k?.field??k?.key??y,Ye=e.ref(new Set);function dt(){const k=new Set;oe.columns.forEach((y,x)=>{y?.hidden!==!0&&k.add(Ze(y,x))}),Ye.value=k}const Le=e.computed(()=>oe.columns.filter((k,y)=>Ye.value.has(Ze(k,y)))),W=k=>{const y=oe.columns.findIndex(x=>x===k);return Ze(k,y>=0?y:0)},U=(k,y)=>Ye.value.has(Ze(k,y));function ee(k,y){const x=Ze(k,y),Z=new Set(Ye.value);Z.has(x)?Z.delete(x):Z.add(x),Ye.value=Z}const se=e.ref(null),He=e.ref(!1);function rt(k){se.value&&!se.value.contains(k.target)&&(He.value=!1)}const bt=e.computed(()=>Le.value.length+(ve.value?1:0)+(j.value?1:0)),Re=(k,y)=>k?.id??k?.key??y,ht=e.ref(new Set),Rt=e.ref(null),jt=(k,y)=>ht.value.has(Re(k,y)),Wt=(k,y)=>{if(!j.value)return!1;if(typeof H.value=="function")return!!H.value(k,y);if(typeof ue.value=="string"&&ue.value.trim()){const x=qt(k,ue.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},At=(k,y,x)=>{if(x&&x.stopPropagation(),!Wt(k,y))return;const Z=Re(k,y),de=new Set(ht.value);de.has(Z)?(de.delete(Z),z("row-collapse",{data:k,index:y})):(de.add(Z),z("row-expand",{data:k,index:y})),ht.value=de},V=(k,y)=>{if(!ke.value)return;const x=Re(k,y);Rt.value!==x&&(Rt.value=x)},C=e.ref(null),S=e.ref(0),K=e.ref([]),Q=k=>{if(gt.value==="single")return C.value===k.field?S.value:0;{const y=K.value.find(x=>x.field===k.field);return y?y.order:0}},Ue=k=>{const y=Q(k);return{"dss-sort-active":y!==0,"dss-sort-asc":y===1,"dss-sort-desc":y===-1}},mt=e.ref({}),Ee=e.ref(null),Ve=e.ref(null),Tt=220,Dt=e.ref(null),Qe=e.computed(()=>Le.value.find(k=>W(k)===Ee.value)??null),pt=e.computed(()=>{if(!Qe.value||Qe.value.filter!=="range")return null;const k=Qe.value,y=Ee.value,{min:x,max:Z}=Ml(k),de=k.filterMin??x,Nt=k.filterMax??Z,ut=q(y),Kt=ut.min??de,ol=ut.max??Nt,il=Nt-de,al=il===0?0:(Kt-de)/il*100,Ql=il===0?100:(ol-de)/il*100;return{rangeMin:de,rangeMax:Nt,currentMin:Kt,currentMax:ol,minPct:al,maxPct:Ql}}),wt=e.ref(null),gl=e.ref("max");function F(k){const y=wt.value,x=pt.value;if(!y||!x)return;const Z=y.getBoundingClientRect(),Nt=(k.clientX-Z.left)/Z.width*100,ut=(x.minPct+x.maxPct)/2;gl.value=Nt<ut?"min":"max"}function q(k){return mt.value[k]??{}}function P(k,y){mt.value={...mt.value,[k]:y}}function ce(k){const y=mt.value[k];return y?y.type==="string"?!!y.value?.trim():y.type==="range"?y.min!=null||y.max!=null:y.type==="dateRange"?!!(y.from||y.to):y.type==="list"?y.selected?.length>0:!1:!1}function Te(k){const y={...mt.value};delete y[k],mt.value=y,Ee.value=null,Ve.value=null}function it(){if(!Ee.value){Ve.value=null;return}const k=Dt.value;if(!k)return;const y=k.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Ee.value}"]`);if(!y)return;const x=y.getBoundingClientRect();Ve.value={top:x.bottom+6,left:Math.max(8,x.right-Tt)}}const ct=e.computed(()=>{const k=String(Je.value??"").trim().toLowerCase();return k?oe.data.filter(y=>Le.value.some(x=>Ct(nn(y,x)).some(de=>String(de).toLowerCase().includes(k)))):oe.data}),Xe=e.computed(()=>{let k=[...ct.value];const y=(Je.value??"").trim().toLowerCase();return y&&(k=k.filter(x=>oe.columns.some(Z=>{if(!Z||!Z.field)return!1;const de=nn(x,Z);return String(de??"").toLowerCase().includes(y)}))),Le.value.forEach(x=>{const Z=W(x),de=mt.value[Z];if(!de)return;const Nt=x.field;if(Nt){if(de.type==="string"&&de.value?.trim()){const ut=de.value.trim().toLowerCase();k=k.filter(Kt=>{const ol=nn(Kt,x);return String(ol??"").toLowerCase().includes(ut)})}else if(de.type==="range")k=k.filter(ut=>{const Kt=qt(ut,Nt),ol=Number(Kt);return!(Number.isNaN(ol)||de.min!=null&&ol<de.min||de.max!=null&&ol>de.max)});else if(de.type==="dateRange"){const ut=de.from?new Date(de.from).getTime():null,Kt=de.to?new Date(de.to).getTime():null;k=k.filter(ol=>{const il=qt(ol,Nt),al=il?new Date(il).getTime():NaN;return!(Number.isNaN(al)||ut!=null&&al<ut||Kt!=null&&al>Kt)})}else if(de.type==="list"&&de.selected?.length){const ut=new Set(de.selected);k=k.filter(Kt=>Ct(nn(Kt,x)).some(il=>ut.has(il)))}}}),k});function Ct(k){if(k==null)return[""];if(Array.isArray(k))return k.flatMap(Ct);if(typeof k=="object"){const y=k?.label??k?.name??k?.value??k?.title;return[y!=null?String(y):String(k)]}return[String(k)]}function Zt(k){const y=new Set;return oe.data.forEach(x=>{Ct(nn(x,k)).forEach(de=>y.add(de))}),Array.from(y).sort((x,Z)=>String(x).localeCompare(String(Z)))}function hl(k,y){if(Ee.value===k){Ee.value=null,Ve.value=null;return}if(Ee.value=k,y?.currentTarget){const x=y.currentTarget.getBoundingClientRect();Ve.value={top:x.bottom+6,left:Math.max(8,x.right-Tt)}}else it()}function Xl(k,y){P(k,{type:"string",value:y})}function Ml(k){const y=k.field;if(!y)return{min:0,max:100};let x=1/0,Z=-1/0;return oe.data.forEach(de=>{const Nt=qt(de,y),ut=Number(Nt);Number.isNaN(ut)||(x=Math.min(x,ut),Z=Math.max(Z,ut))}),{min:x===1/0?0:x,max:Z===-1/0?100:Z}}function Yl(k,y,x){const Z={...q(k),type:"range"},de=x===""?null:Number(x),Nt=de===null||Number.isNaN(de)?null:de;Z[y]=Nt,Nt!=null&&(y==="min"&&Z.max!=null&&Nt>Z.max&&(Z.max=Nt),y==="max"&&Z.min!=null&&Nt<Z.min&&(Z.min=Nt)),P(k,Z)}function vn(k,y,x){const Z={...q(k),type:"dateRange"};Z[y]=x||"",P(k,Z)}const gn=e.reactive({});function bn(k,y){gn[k]=y}function zn(k){const y=W(k),x=(gn[y]??"").trim().toLowerCase(),Z=Zt(k);return x?Z.filter(de=>String(de).toLowerCase().includes(x)):Z}function Pn(k,y){return(q(k).selected??[]).includes(y!=null?String(y):"")}function to(k,y){const Z=[...q(k).selected??[]],de=y!=null?String(y):"",Nt=Z.indexOf(de);Nt>=0?Z.splice(Nt,1):Z.push(de),P(k,{type:"list",selected:Z})}function wn(k){Ee.value&&!k.target.closest(".dss-table-filter-wrap")&&!k.target.closest(".dss-table-filter-dropdown")&&(Ee.value=null,Ve.value=null)}function xn(){it(),Al.value&&El()}const Fl=k=>{if(!(k.sortable===!1||!lt.value))if(gt.value==="single")C.value===k.field?S.value=S.value===1?-1:S.value===-1?0:1:(C.value=k.field,S.value=1),S.value===0&&(C.value=null),z("sort",{field:C.value,order:S.value});else{const y=K.value.findIndex(x=>x.field===k.field);y>=0?K.value[y].order===1?K.value[y].order=-1:K.value.splice(y,1):K.value.push({field:k.field,order:1}),z("sort",{multiSortMeta:K.value})}},jl=e.computed(()=>{if(!lt.value)return Xe.value;let k=[...Xe.value];return gt.value==="single"&&C.value&&S.value!==0?k.sort((y,x)=>{const Z=qt(y,C.value),de=qt(x,C.value);return Z===de?0:Z==null?1:de==null?-1:(Z<de?-1:Z>de?1:0)*S.value}):gt.value==="multiple"&&K.value.length>0&&k.sort((y,x)=>{for(const Z of K.value){const de=qt(y,Z.field),Nt=qt(x,Z.field);if(de===Nt)continue;if(de==null)return 1;if(Nt==null)return-1;const ut=de<Nt?-1:de>Nt?1:0;if(ut!==0)return ut*Z.order}return 0}),k}),bl=e.ref(0),Nl=e.ref(yt.value),Al=e.ref(!1),zl=e.ref(null),Bn=e.ref(null),Mn=e.ref("bottom"),En=e.ref(null),zt=k=>{Nl.value=k,Al.value=!1,bl.value=0,z("page",{page:0,rows:Nl.value})};function Ce(k){zl.value&&!zl.value.contains(k.target)&&(Al.value=!1)}function El(){const k=zl.value,y=Bn.value;if(!k||!y)return;const x=k.querySelector(".dss-pagination-select-dropdown");if(!x)return;const Z=y.getBoundingClientRect(),de=x.offsetHeight||0,ut=(window.innerHeight||document.documentElement.clientHeight)-Z.bottom,Kt=Z.top;Mn.value=ut<de+8&&Kt>ut?"top":"bottom",En.value={width:`${Math.ceil(Z.width)}px`,left:`${Math.max(0,Math.round(y.offsetLeft))}px`}}const nt=e.computed(()=>jl.value.length),Vt=e.computed(()=>Math.ceil(nt.value/Nl.value)),we=e.computed(()=>Math.max(Vt.value,1)),kt=e.computed(()=>nt.value===0?0:et.value+1),le=e.computed(()=>Ie.value),et=e.computed(()=>he.value?bl.value*Nl.value:0),Ie=e.computed(()=>he.value?Math.min((bl.value+1)*Nl.value,nt.value):nt.value),_n=e.computed(()=>{if(!he.value)return jl.value;const k=et.value,y=Ie.value;return jl.value.slice(k,y)}),Pl=e.ref(new Set),Kl=e.computed(()=>jl.value.filter((k,y)=>Pl.value.has(Re(k,y)))),yl=e.computed(()=>{const k=jl.value.length;return k>0&&Pl.value.size===k}),Sn=e.computed(()=>{const k=jl.value.length,y=Pl.value.size;return y>0&&y<k}),rn=(k,y)=>Pl.value.has(Re(k,y)),Gl=()=>{if(yl.value)Pl.value=new Set,z("unselect-all");else{const k=new Set;jl.value.forEach((y,x)=>k.add(Re(y,x))),Pl.value=k,z("select-all",Kl.value)}},wl=(k,y)=>{const x=Re(k,y),Z=new Set(Pl.value),de=Z.has(x);ie.value==="single"?de?(Z.delete(x),z("row-unselect",k)):(Z.clear(),Z.add(x),z("row-select",k)):de?(Z.delete(x),z("row-unselect",k)):(Z.add(x),z("row-select",k)),Pl.value=Z},ln=e.ref("1"),Pt=()=>{const k=Number.parseInt(String(ln.value),10);if(!Number.isFinite(k)){ln.value=String(bl.value+1);return}const y=Math.min(we.value,Math.max(1,k));y!==bl.value+1?Bl(y-1):ln.value=String(y)},Bl=k=>{k<0||k>=Vt.value||(bl.value=k,z("page",{page:k,rows:Nl.value}))},lo=(k,y,x)=>{z("row-click",{data:k,index:y,originalEvent:x}),V(k,et.value+y)},On=(k,y)=>{const x=et.value+y;return{"dss-table-row-selected":rn(k,x),"dss-table-row-even":y%2===0,"dss-table-row-odd":y%2!==0,"dss-table-row-truncated-clickable":ke.value,"dss-table-row-truncated-expanded":Rt.value===Re(k,x)}},nn=(k,y)=>y.field?qt(k,y.field):"",qt=(k,y)=>y.split(".").reduce((x,Z)=>x&&x[Z],k),$n=k=>{const y=k.align??ge.value;return{"dss-table-sortable":k.sortable!==!1&&lt.value,"dss-table-align-left":y==="left","dss-table-align-center":y==="center","dss-table-align-right":y==="right",[k.className]:k.className}},Ln=k=>{const y={};return k.width&&(y.width=typeof k.width=="number"?`${k.width}px`:k.width),k.minWidth&&(y.minWidth=typeof k.minWidth=="number"?`${k.minWidth}px`:k.minWidth),k.maxWidth&&(y.maxWidth=typeof k.maxWidth=="number"?`${k.maxWidth}px`:k.maxWidth),y};return e.watch(()=>oe.locale,k=>{k&&k!==_.value&&(_.value=k)},{immediate:!0}),e.watch(yt,k=>{Nl.value=k,bl.value=0}),e.watch(Al,async k=>{k&&(await e.nextTick(),El())}),e.watch(bl,k=>{ln.value=String(k+1)},{immediate:!0}),e.watch(Je,k=>{z("search",k??"")}),e.watch(()=>oe.columns,()=>{dt()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Ce),document.addEventListener("click",rt),document.addEventListener("click",wn),window.addEventListener("resize",xn),window.addEventListener("scroll",xn,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Ce),document.removeEventListener("click",rt),document.removeEventListener("click",wn),window.removeEventListener("resize",xn),window.removeEventListener("scroll",xn,!0)}),(k,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Dt,style:e.normalizeStyle({width:f.value+"px",height:be.value?be.value+"px":"auto"})},[Yt.value?(e.openBlock(),e.createElementBlock("div",zi,[e.createElementVNode("div",Pi,[St.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:y[0]||(y[0]=x=>z("download-pdf"))},[y[22]||(y[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(B)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),nl.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:y[1]||(y[1]=x=>z("download-excel"))},[y[23]||(y[23]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(B)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Ge.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:se},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":He.value}]),onClick:y[2]||(y[2]=x=>He.value=!He.value),"aria-expanded":He.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(B)("table.columnVisibility"))+" ",1),y[24]||(y[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Oi),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Wi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.columns,(x,Z)=>(e.openBlock(),e.createElementBlock("li",{key:Ze(x,Z),role:"option",class:"dss-table-column-visibility-option",onClick:y[3]||(y[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Zi,[e.createElementVNode("span",qi,[e.createElementVNode("input",{type:"checkbox",checked:U(x,Z),onChange:de=>ee(x,Z),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ui),U(x,Z)?(e.openBlock(),e.createElementBlock("span",Xi,[...y[25]||(y[25]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",Yi,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,He.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ji,[Ft.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Lt.value||Je.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:Xt,"onUpdate:modelValue":y[4]||(y[4]=x=>Je.value=x),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(B)("table.searchPlaceholder"),"aria-label":e.unref(B)("table.searchTableAriaLabel"),onFocus:y[5]||(y[5]=x=>Lt.value=!0),onBlur:Ne},null,40,Ki),[[e.vModelText,Je.value]]),Je.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(B)("table.clearSearchAriaLabel"),onClick:Oe},[...y[26]||(y[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,Gi)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(B)("table.searchAriaLabel"),"aria-expanded":Lt.value||!!Je.value,onMousedown:e.withModifiers($e,["prevent"])},[...y[27]||(y[27]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,Qi)],2)):e.createCommentVNode("",!0),k.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Ji,[e.renderSlot(k.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":It.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",st.value])},[e.createElementVNode("thead",ec,[e.createElementVNode("tr",null,[ve.value?(e.openBlock(),e.createElementBlock("th",tc,[ie.value==="multiple"?(e.openBlock(),e.createElementBlock("span",lc,[e.createElementVNode("input",{type:"checkbox",checked:yl.value,indeterminate:Sn.value,onChange:Gl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,nc),Sn.value?(e.openBlock(),e.createElementBlock("span",oc)):yl.value?(e.openBlock(),e.createElementBlock("span",ac,[...y[28]||(y[28]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),j.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(B)("table.expandRowAriaLabel")},null,8,sc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value,(x,Z)=>(e.openBlock(),e.createElementBlock("th",{key:W(x),class:e.normalizeClass(["dss-table-th",$n(x)]),style:e.normalizeStyle(Ln(x)),onClick:de=>Fl(x)},[e.createElementVNode("div",ic,[e.createElementVNode("span",cc,e.toDisplayString(x.header),1),x.sortable!==!1&&lt.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Ue(x)])},[Q(x)===0?(e.openBlock(),e.createElementBlock("span",uc,[...y[29]||(y[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):Q(x)===1?(e.openBlock(),e.createElementBlock("span",dc,[...y[30]||(y[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):Q(x)===-1?(e.openBlock(),e.createElementBlock("span",mc,[...y[31]||(y[31]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),x.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Ee.value===W(x)}]),onClick:y[6]||(y[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":ce(W(x))}]),"data-filter-column-key":W(x),"aria-expanded":Ee.value===W(x),"aria-label":e.unref(B)("table.filterColumnAriaLabel"),onClick:de=>hl(W(x),de)},[...y[32]||(y[32]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,pc)],2)):e.createCommentVNode("",!0)])],14,rc))),128))])]),e.createElementVNode("tbody",fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_n.value,(x,Z)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Re(x,et.value+Z)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",On(x,Z)]),style:e.normalizeStyle(ne.value),onClick:de=>lo(x,Z,de)},[ve.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:y[7]||(y[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",gc,[e.createElementVNode("input",{type:ie.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${L.tableId}`,checked:rn(x,et.value+Z),onChange:de=>wl(x,et.value+Z),class:e.normalizeClass(["dss-table-checkbox",ie.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,hc),ie.value==="multiple"&&rn(x,et.value+Z)?(e.openBlock(),e.createElementBlock("span",yc,[...y[33]||(y[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):ie.value==="single"&&rn(x,et.value+Z)?(e.openBlock(),e.createElementBlock("span",kc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),j.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(de=>At(x,et.value+Z,de),["stop"])},[Wt(x,et.value+Z)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":jt(x,et.value+Z),"aria-label":jt(x,et.value+Z)?e.unref(B)("table.collapseRowAriaLabel"):e.unref(B)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":jt(x,et.value+Z)}]),"aria-hidden":"true"},[...y[34]||(y[34]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,bc)):(e.openBlock(),e.createElementBlock("span",wc))],8,Cc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value,(de,Nt)=>(e.openBlock(),e.createElementBlock("td",{key:W(de),class:e.normalizeClass(["dss-table-td",$n(de)]),style:e.normalizeStyle(Ln(de))},[e.renderSlot(k.$slots,`cell-${de.field}`,{data:x,column:de,rowIndex:Z,isExpanded:Rt.value===Re(x,et.value+Z)},()=>[e.createTextVNode(e.toDisplayString(nn(x,de)),1)])],6))),128))],14,vc),j.value&&Wt(x,et.value+Z)&&jt(x,et.value+Z)?(e.openBlock(),e.createElementBlock("tr",xc,[e.createElementVNode("td",{colspan:bt.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(k.$slots,"expansion",{data:x,rowIndex:Z})],8,Ec)])):e.createCommentVNode("",!0)],64))),128)),_n.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(ne.value)},[e.createElementVNode("td",{colspan:bt.value,class:"dss-table-empty-cell"},[e.renderSlot(k.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(ot.value),1)])],8,Sc)],4))])],2)],2),ll.value?(e.openBlock(),e.createElementBlock("div",Vc,[e.createElementVNode("div",Nc,[tl.value?(e.openBlock(),e.createElementBlock("span",Bc,e.toDisplayString(e.unref(B)("table.showingRange",{start:kt.value,end:le.value,total:nt.value})),1)):(e.openBlock(),e.createElementBlock("span",Mc," "))]),e.createElementVNode("div",_c,[Et.value?(e.openBlock(),e.createElementBlock("div",$c,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:bl.value===0,onClick:y[8]||(y[8]=x=>Bl(0)),title:e.unref(B)("table.firstPage")},[...y[35]||(y[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Lc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:bl.value===0,onClick:y[9]||(y[9]=x=>Bl(bl.value-1)),title:e.unref(B)("table.previousPage")}," ‹ ",8,Tc),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[10]||(y[10]=x=>ln.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(B)("table.currentPageAriaLabel"),onBlur:Pt,onKeydown:e.withKeys(e.withModifiers(Pt,["prevent"]),["enter"])},null,40,Ac),[[e.vModelText,ln.value]]),e.createElementVNode("span",Dc,e.toDisplayString(e.unref(B)("table.ofPages",{total:we.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:bl.value>=Vt.value-1,onClick:y[11]||(y[11]=x=>Bl(bl.value+1)),title:e.unref(B)("table.nextPage")}," › ",8,Hc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:bl.value>=Vt.value-1,onClick:y[12]||(y[12]=x=>Bl(Vt.value-1)),title:e.unref(B)("table.lastPage")},[...y[36]||(y[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Rc)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ic,[Ht.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:zl},[e.createElementVNode("span",Fc,e.toDisplayString(e.unref(B)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Al.value}]),onClick:y[13]||(y[13]=x=>Al.value=!Al.value),"aria-expanded":Al.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:Bn},[e.createTextVNode(e.toDisplayString(Nl.value)+" ",1),y[37]||(y[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,zc),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",{class:e.normalizeClass(["dss-pagination-select-dropdown",{"dss-pagination-select-dropdown--top":Mn.value==="top"}]),style:e.normalizeStyle(En.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===Nl.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===Nl.value}]),onClick:Z=>zt(x)},e.toDisplayString(x),11,Pc))),128))],6),[[e.vShow,Al.value]])]),_:1})],512)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],4),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"dss-table-filter-dropdown dss-table-filter-dropdown--teleport",style:e.normalizeStyle(Ve.value?{top:Ve.value.top+"px",left:Ve.value.left+"px",width:Tt+"px"}:void 0),onClick:y[21]||(y[21]=e.withModifiers(()=>{},["stop"]))},[Qe.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Qe.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Oc,[e.createElementVNode("input",{type:"text",value:q(Ee.value).value??"",onInput:y[14]||(y[14]=x=>Xl(Ee.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(B)("table.search")},null,40,Wc)])):Qe.value.filter==="range"&&pt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":pt.value.minPct+"%","--range-max-pct":pt.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:wt,class:"dss-table-filter-double-range-track",onMousemove:F,onMouseenter:F},[e.createElementVNode("input",{type:"range",min:pt.value.rangeMin,max:pt.value.rangeMax,value:pt.value.currentMin,onInput:y[15]||(y[15]=x=>Yl(Ee.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:gl.value==="min"?2:1})},null,44,Zc),e.createElementVNode("input",{type:"range",min:pt.value.rangeMin,max:pt.value.rangeMax,value:pt.value.currentMax,onInput:y[16]||(y[16]=x=>Yl(Ee.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:gl.value==="max"?2:1})},null,44,qc)],544),e.createElementVNode("div",Uc,e.toDisplayString(pt.value.currentMin)+" – "+e.toDisplayString(pt.value.currentMax),1)],4)):Qe.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Xc,[e.createElementVNode("div",Yc,[e.createElementVNode("label",jc,e.toDisplayString(e.unref(B)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:q(Ee.value).from??"",onInput:y[17]||(y[17]=x=>vn(Ee.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Kc)]),e.createElementVNode("div",Gc,[e.createElementVNode("label",Qc,e.toDisplayString(e.unref(B)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:q(Ee.value).to??"",onInput:y[18]||(y[18]=x=>vn(Ee.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Jc)])])):Qe.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:gn[Ee.value]??"",onInput:y[19]||(y[19]=x=>bn(Ee.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(B)("table.search")},null,40,eu),e.createElementVNode("div",tu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zn(Qe.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:Pn(Ee.value,x),onChange:Z=>to(Ee.value,x)},null,40,lu),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",nu,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:y[20]||(y[20]=x=>Te(Ee.value))},e.toDisplayString(e.unref(B)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Ee.value&&Qe.value&&Ve.value]])]),_:1})]))],64))}}),su="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M6.008%2014V12.68H8.288V6.572L5.996%208.276V6.692L8.012%205.24H9.788V12.68H11.624V14H6.008Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",ru="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M5.948%2014V12.548L8.684%209.8C9.068%209.408%209.352%209.056%209.536%208.744C9.72%208.424%209.812%208.096%209.812%207.76C9.812%207.352%209.7%207.036%209.476%206.812C9.252%206.58%208.948%206.464%208.564%206.464C8.14%206.464%207.808%206.588%207.568%206.836C7.328%207.076%207.208%207.412%207.208%207.844H5.708C5.716%207.284%205.836%206.804%206.068%206.404C6.308%205.996%206.644%205.68%207.076%205.456C7.508%205.232%208.012%205.12%208.588%205.12C9.14%205.12%209.62%205.224%2010.028%205.432C10.436%205.64%2010.752%205.932%2010.976%206.308C11.2%206.684%2011.312%207.132%2011.312%207.652C11.312%208.188%2011.172%208.712%2010.892%209.224C10.62%209.728%2010.18%2010.272%209.572%2010.856L7.748%2012.644H11.42V14H5.948Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",iu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.516%2014.12C7.948%2014.12%207.452%2014.016%207.028%2013.808C6.612%2013.6%206.288%2013.308%206.056%2012.932C5.824%2012.556%205.708%2012.112%205.708%2011.6H7.22C7.22%2011.992%207.332%2012.3%207.556%2012.524C7.788%2012.74%208.112%2012.848%208.528%2012.848C8.944%2012.848%209.264%2012.736%209.488%2012.512C9.712%2012.288%209.824%2011.984%209.824%2011.6V10.916C9.824%2010.524%209.712%2010.22%209.488%2010.004C9.264%209.78%208.944%209.668%208.528%209.668H7.544V8.312L9.476%206.524H6.104V5.24H11V6.596L8.528%208.864V8.384C9.392%208.384%2010.076%208.612%2010.58%209.068C11.084%209.524%2011.336%2010.14%2011.336%2010.916V11.6C11.336%2012.112%2011.22%2012.556%2010.988%2012.932C10.756%2013.308%2010.428%2013.6%2010.004%2013.808C9.58%2014.016%209.084%2014.12%208.516%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",cu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M9.68%2014V12.26H5.78V10.088L9.152%205.24H10.832L7.22%2010.484V10.94H9.68V8.96H11.18V14H9.68Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",uu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.588%2014.12C7.78%2014.12%207.132%2013.92%206.644%2013.52C6.156%2013.112%205.888%2012.56%205.84%2011.864H7.34C7.372%2012.168%207.492%2012.404%207.7%2012.572C7.916%2012.732%208.212%2012.812%208.588%2012.812C9.004%2012.812%209.32%2012.704%209.536%2012.488C9.752%2012.264%209.86%2011.956%209.86%2011.564V10.712C9.86%2010.312%209.752%2010.008%209.536%209.8C9.32%209.584%209.004%209.476%208.588%209.476C8.332%209.476%208.112%209.528%207.928%209.632C7.744%209.736%207.604%209.88%207.508%2010.064H6.044L6.104%205.24H11.036V6.596H7.52L7.496%209.14H7.844L7.484%209.44C7.484%209.072%207.628%208.784%207.916%208.576C8.212%208.36%208.608%208.252%209.104%208.252C9.816%208.244%2010.368%208.46%2010.76%208.9C11.16%209.332%2011.36%209.936%2011.36%2010.712V11.564C11.36%2012.356%2011.112%2012.98%2010.616%2013.436C10.128%2013.892%209.452%2014.12%208.588%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",du="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.6%2014.12C8.016%2014.12%207.5%2014%207.052%2013.76C6.612%2013.512%206.268%2013.168%206.02%2012.728C5.78%2012.28%205.66%2011.764%205.66%2011.18C5.66%2010.764%205.728%2010.328%205.864%209.872C6.008%209.416%206.204%208.988%206.452%208.588L8.516%205.24H10.184L7.592%209.32L7.664%209.368C7.824%209.12%208.04%208.932%208.312%208.804C8.584%208.676%208.888%208.612%209.224%208.612C9.696%208.612%2010.104%208.724%2010.448%208.948C10.792%209.172%2011.06%209.484%2011.252%209.884C11.444%2010.284%2011.54%2010.752%2011.54%2011.288C11.54%2011.856%2011.416%2012.352%2011.168%2012.776C10.928%2013.2%2010.588%2013.532%2010.148%2013.772C9.716%2014.004%209.2%2014.12%208.6%2014.12ZM8.6%2012.848C9.04%2012.848%209.396%2012.708%209.668%2012.428C9.94%2012.14%2010.076%2011.768%2010.076%2011.312C10.076%2010.84%209.94%2010.464%209.668%2010.184C9.396%209.896%209.04%209.752%208.6%209.752C8.16%209.752%207.804%209.896%207.532%2010.184C7.26%2010.464%207.124%2010.84%207.124%2011.312C7.124%2011.768%207.26%2012.14%207.532%2012.428C7.804%2012.708%208.16%2012.848%208.6%2012.848Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",mu={class:"dss-toolbar-left"},pu=["title"],fu=["title"],vu={class:"dss-toolbar-dropdown-wrapper"},gu=["title"],hu=["src"],yu=["src"],ku=["src"],Cu=["src"],bu=["src"],wu=["src"],xu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Eu=["src"],Su=["src"],Vu=["src"],Nu=["src"],Bu=["src"],Mu=["src"],_u=["title"],$u=["title"],Lu=["title"],Tu=["title"],Au=["title"],Du=["title"],Hu=["title"],Ru=["title"],Iu=["title"],Fu={key:2,class:"dss-toolbar-separator"},zu=["title"],Pu={key:4,class:"dss-toolbar-separator"},Ou={key:5,class:"dss-toolbar-dropdown-wrapper"},Wu=["title"],Zu={class:"dss-toolbar-dropdown-ai"},qu={class:"dss-toolbar-right"},Uu={key:0,class:"dss-toolbar-custom-group"},Xu={key:1,class:"dss-toolbar-separator"},Yu={class:"dss-link-modal-content"},ju={class:"dss-link-modal-field"},Ku={class:"dss-link-modal-label"},Gu=["placeholder"],Qu={class:"dss-link-modal-field"},Ju={class:"dss-link-modal-label"},ed=["placeholder"],td={class:"dss-image-modal-tabs"},ld={key:0,class:"dss-image-tab-content"},nd={class:"dss-link-modal-content"},od={class:"dss-link-modal-field"},ad={key:0,class:"dss-link-modal-label"},sd=["src"],rd={class:"dss-link-modal-field"},id={class:"dss-link-modal-label"},cd=["placeholder"],ud={class:"dss-link-modal-field"},dd={class:"dss-link-modal-label"},md=["placeholder"],pd={class:"dss-link-modal-field"},fd={class:"dss-link-modal-label"},vd=["placeholder"],gd={key:1,class:"dss-image-tab-content"},hd={class:"dss-link-modal-content"},yd={class:"dss-link-modal-field"},kd={class:"dss-link-modal-label"},Cd=["placeholder"],bd={class:"dss-link-modal-field"},wd={class:"dss-link-modal-label"},xd=["placeholder"],Ed={class:"dss-link-modal-field"},Sd={class:"dss-link-modal-label"},Vd=["placeholder"],Nd={class:"dss-link-modal-field"},Bd={class:"dss-link-modal-label"},Md=["placeholder"],_d={class:"dss-text-editor-title-input-container"},$d={key:0,class:"dss-text-editor-title-preview"},Ld={key:0},Td={key:1,class:"dss-text-editor-preview-placeholder"},Ad=["value","placeholder","disabled"],Dd={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},Hd={class:"dss-text-editor-description-input-container"},Rd={key:0,class:"dss-text-editor-description-preview"},Id={key:0},Fd={key:1,class:"dss-text-editor-preview-placeholder"},zd=["value","placeholder","disabled"],Pd={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},Od=["data-comment-id","onMouseenter"],Wd=["onClick"],Zd=["src","alt"],qd={key:1},Ud=["onClick"],Xd=["src","alt"],Yd={key:1},jd=["data-has-second-user","onClick"],Kd={class:"editor-comment-marker-count"},Gd={key:4,class:"dss-text-editor-textarea-wrapper"},Qd=["value","placeholder","rows","disabled"],Jd={class:"dss-text-editor-footer"},e1={class:"dss-text-editor-footer-content"},t1={class:"dss-text-editor-footer-stat"},l1={class:"dss-text-editor-footer-stat"},n1={key:5,class:"dss-text-editor-content-wrapper"},o1={key:0,class:"dss-comment-overlay-body"},a1={class:"dss-comment-selection-wrapper"},s1=["innerHTML"],r1={class:"dss-comment-messages-wrapper"},i1={key:0,class:"dss-comment-avatar-wrapper"},c1={class:"dss-comment-avatar"},u1=["src","alt"],d1={key:1},m1={class:"dss-comment-header"},p1={class:"dss-comment-header-text"},f1={class:"dss-comment-author"},v1={key:0,class:"dss-comment-date"},g1=["onClick","title"],h1={class:"dss-comment-overlay-inner"},y1=["placeholder","onKeydown"],k1={class:"dss-text-editor-footer"},C1={class:"dss-text-editor-footer-content"},b1={class:"dss-text-editor-footer-stat"},w1={class:"dss-text-editor-footer-stat"},x1=["title"],E1=["title"],S1={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},V1={class:"dss-image-popup-content"},N1={key:0,class:"dss-image-popup-no-alt-icon"},B1=["title"],M1=["title"],_1={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},$1={class:"dss-toolbar-left"},L1=["title"],T1=["title"],A1={class:"dss-toolbar-dropdown-wrapper"},D1=["title"],H1=["src"],R1=["src"],I1=["src"],F1=["src"],z1=["src"],P1=["src"],O1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},W1=["title"],Z1=["title"],q1=["title"],U1=["title"],X1=["title"],Y1=["title"],j1=["title"],K1=["title"],G1=["title"],Q1=["title"],J1={key:2,class:"dss-toolbar-separator"},e2={key:3,class:"dss-toolbar-dropdown-wrapper"},t2=["title"],l2={class:"dss-toolbar-dropdown-ai"},n2={key:0,class:"dss-toolbar-right"},o2={key:0,class:"dss-toolbar-separator"},a2={key:0,class:"dss-toolbar-custom-group"},s2={key:1,class:"dss-toolbar-separator"},r2={name:"DSSTextEditor"},i2=Object.assign(r2,{props:{modelValue:{type:String,default:""},title:{type:String,default:""},description:{type:String,default:""},titlePlaceholder:{type:String,default:null},descriptionPlaceholder:{type:String,default:null},placeholder:{type:String,default:null},rows:{type:Number,default:10},fullHeight:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},richText:{type:Boolean,default:!1},border:{type:Boolean,default:!0},rounded:{type:Boolean,default:!1},fixedHeight:{type:Boolean,default:!1},options:{type:Object,default:()=>({}),validator:L=>typeof L=="object"&&L!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:L=>typeof L=="object"&&L!==null},locale:{type:String,default:null},comments:{type:Array,default:()=>[]}},emits:["update:modelValue","update:title","update:description","update:comments","change","blur","title-change","description-change","comment-submitted","comment-marker-clicked","comment-deleted"],setup(L,{expose:ae,emit:B}){const{t:_,locale:oe}=Gn.useI18n(),z={h1:su,h2:ru,h3:iu,h4:cu,h5:uu,h6:du},$=L,X=B,Ke=e.useSlots(),pe=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
98
+ `}const l=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(l),p=document.createElement("a");p.href=i,p.download=ol("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(i),Pt()}catch(t){console.error("Error downloading CSV:",t)}},Tn=t=>{if(typeof t.action=="function"){const s={series:H.series,categories:H.categories,markers:tt.value},l={chartX:kt.value.chartX,chartY:kt.value.chartY,dataX:kt.value.mouseDataX,dataY:kt.value.mouseDataY,categoryIndex:clampedCategoryIndex||kt.value.categoryIndex};t.action(s,l)}Pt()},Ao=()=>{x(),Ie.value.show=!0,Ie.value.categoryIndex=kt.value.categoryIndex,Ie.value.fromButton=!1,Pt()},ko=()=>{x(),Ie.value.show=!0,Ie.value.categoryIndex=0,Ie.value.fromButton=!0},oo=t=>{if(kt.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(kt.value.show=!1)}},ao=t=>{kt.value.show&&!t.target.closest(".context-menu")&&(kt.value.show=!1)},Co=t=>{if(!xl.value||!Ne.value)return;t.preventDefault(),t.stopPropagation(),le.value.isZooming=!0,we.value.show=!1,le.value.zoomTimeout&&clearTimeout(le.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),i=t.clientX-l.left,p=t.clientY-l.top;if(i<O.value.left-50||i>O.value.right+50||p<O.value.top-50||p>O.value.bottom+100){le.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,w=Math.max(le.value.minScale,Math.min(le.value.maxScale,le.value.scale*g));if(w!==le.value.scale){const{minX:b,maxX:D}=Gt.value,A=D-b||1,I=A/le.value.scale,N=b-le.value.offsetX/O.value.width*A,J=(i-O.value.left)/O.value.width,xe=N+J*I;le.value.scale=w;const We=A/le.value.scale,re=xe-J*We;le.value.offsetX=-(re-b)/A*O.value.width,le.value.scale<=1.01&&(le.value.scale=1,le.value.offsetX=0)}le.value.zoomTimeout=setTimeout(()=>{le.value.isZooming=!1,le.value.zoomTimeout=null},300)},bo=t=>{if(!xl.value||!Ne.value||le.value.scale<=1)return;we.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,le.value.isDragging=!0,le.value.lastMouseX=t.clientX,le.value.lastMouseY=t.clientY,t.preventDefault()},Do=()=>{le.value.isDragging=!1},so=()=>{!xl.value||!Ne.value||(le.value.scale=1,le.value.offsetX=0,le.value.isDragging=!1,le.value.zoomTimeout&&(clearTimeout(le.value.zoomTimeout),le.value.zoomTimeout=null),le.value.isZooming=!1)},Ho=()=>!xl.value||!El.value||!Ne.value?"default":le.value.isDragging?"grabbing":le.value.scale>1?"grab":"dss-crosshair",An=t=>{if(t.length<2)return"";if(t.length===2)return`M ${t[0].x} ${t[0].y} L ${t[1].x} ${t[1].y}`;let s=`M ${t[0].x} ${t[0].y}`;for(let l=0;l<t.length-1;l++){const i=t[Math.max(l-1,0)],p=t[l],g=t[l+1],w=t[Math.min(l+2,t.length-1)],b=p.x+(g.x-i.x)/6*He.value,D=p.y+(g.y-i.y)/6*He.value,A=g.x-(w.x-p.x)/6*He.value,I=g.y-(w.y-p.y)/6*He.value;s+=` C ${b} ${D} ${A} ${I} ${g.x} ${g.y}`}return s},Sl=e.computed(()=>{const s=R.value?.chart?.padding,l=typeof s=="number"?s:null,i=s&&typeof s=="object"?s:null,p=50;let g=p+(ll.value?30:0)+60;if(Ol.value){const N={left:p+40,top:p+40,right:p+40,bottom:p+40};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??N.left,top:i.top??N.top,right:i.right??N.right,bottom:i.bottom??N.bottom}:N}if(pl.value){const N=!Ge.value,J=Yl.value,xe=J?gn.value+bn.value+Math.max(24,vn.value+16):0,We=N?12:p;let re=0;st.value&&(re+=N?8:15),xt.value&&(re+=N?6:10);const ye=ze();let Be=We+(N?4:16)+(J?xe:0),me=We+(J?xe:0);Ge.value&&et.value==="left"?Be+=ye.legendWidth||150:Ge.value&&et.value==="right"&&(me+=ye.legendWidth||150);const Pe=Ue.value==="semi-radial"?J?xe:8:J?xe:N?8:p+80,Ae=J?14:0,_e=We+re+Ae,Fe={left:Be,top:_e,right:me,bottom:Pe};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??Fe.left,top:i.top??Fe.top,right:i.right??Fe.right,bottom:i.bottom??Fe.bottom}:Fe}let w=0;st.value&&(w+=15),xt.value&&(w+=10);const b=ze();let D=p+16,A=p;Ge.value&&et.value==="left"?D+=b.legendWidth||150:Ge.value&&et.value==="right"&&(A+=b.legendWidth||150);const I={left:D,top:p+w,right:A,bottom:g};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??I.left,top:i.top??I.top,right:i.right??I.right,bottom:i.bottom??I.bottom}:I}),O=e.computed(()=>({left:Sl.value.left,top:Sl.value.top,right:ie.value-Sl.value.right,bottom:he.value-Sl.value.bottom,width:ie.value-(Sl.value.left+Sl.value.right),height:he.value-(Sl.value.top+Sl.value.bottom)})),xl=e.computed(()=>["line","area","bar"].includes(Ue.value)||tl.value),Dl=e.computed(()=>tl.value),pl=e.computed(()=>["radial","semi-radial"].includes(Ue.value)),Ol=e.computed(()=>Ue.value==="spider"),sl=e.computed(()=>Ue.value==="bubble"),fl=e.computed(()=>R.value?.chart?.orientation==="horizontal"&&(Ue.value==="bar"||Dl.value)),un=t=>{const{minY:s,maxY:l}=Gt.value,i=l-s||1;return O.value.left+(t-s)/i*O.value.width},dn=t=>{const{maxX:s}=Gt.value,l=s+1,p=O.value.height/l;return O.value.top+(t+.5)*p},wt=e.computed(()=>pl.value?Sl.value.left+(ie.value-Sl.value.left-Sl.value.right)/2:ie.value/2),Mt=e.computed(()=>Ol.value?he.value/2-40:pl.value?Sl.value.top+(he.value-Sl.value.top-Sl.value.bottom)/2:he.value/2),ft=e.computed(()=>{if(Ol.value){const t=O.value.width-80,s=O.value.height-80;return Math.min(t,s)/2}return Math.min(O.value.width,O.value.height)/2}),cl=e.computed(()=>{const t=R.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof s=="number"&&s>=0&&s<=1?s:.45;return ft.value*l}),Ro=e.computed(()=>{const t=R.value,s=typeof H.innerSize=="number"?H.innerSize:t?.innerSize;return typeof s!="number"||s<=-100||!(pl.value||Ol.value)?1:1+s/100}),ro=e.computed(()=>{const t=Ro.value;if(t===1||t<=0)return;const s=wt.value,l=Mt.value;return`translate(${s}, ${l}) scale(${t}) translate(${-s}, ${-l})`}),Hl=e.ref(0),Jl=e.computed(()=>`semi-radial-fill-clip-${H.chartId}`),$l=e.computed(()=>Ue.value==="semi-radial"),hn=e.computed(()=>$l.value&&Re.value&&!Cl.value),Ut=e.computed(()=>$l.value&&Re.value&&!Cl.value&&ht.value==="fill"),wo=e.computed(()=>{const t=hn.value?Hl.value:1,s=wt.value,l=Mt.value,i=cl.value,p=ft.value,g=Math.PI,w=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${l} L ${s} ${l} Z`;const b=s+p*Math.cos(g),D=l+p*Math.sin(g),A=s+p*Math.cos(w),I=l+p*Math.sin(w),N=s+i*Math.cos(w),J=l+i*Math.sin(w),xe=s+i*Math.cos(g),We=l+i*Math.sin(g),re=t>.5?1:0;return`M ${s} ${l} L ${b} ${D} A ${p} ${p} 0 ${re} 1 ${A} ${I} L ${N} ${J} A ${i} ${i} 0 ${re} 1 ${xe} ${We} Z`}),io=e.computed(()=>{if(!(!$l.value||!hn.value)&&!Ut.value)return`url(#${Jl.value})`}),yn=t=>{if(!(!Ut.value||t!==0))return`url(#${Jl.value})`},Ll=e.ref(0),kn=e.computed(()=>`radial-reveal-clip-${H.chartId}`),Vl=e.computed(()=>Ue.value==="radial"),Vn=e.computed(()=>{const t=Vl.value?Ll.value:1,s=wt.value,l=Mt.value,i=Math.max(ft.value*1.5,ie.value,he.value);if(t<=0)return`M ${s} ${l} L ${s} ${l} Z`;if(t>=1){const N=s-i,J=s+i;return`M ${N} ${l} A ${i} ${i} 0 0 1 ${J} ${l} A ${i} ${i} 0 0 1 ${N} ${l} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,w=s+i*Math.cos(p),b=l+i*Math.sin(p),D=s+i*Math.cos(g),A=l+i*Math.sin(g),I=t>=.5?1:0;return`M ${s} ${l} L ${w} ${b} A ${i} ${i} 0 ${I} 1 ${D} ${A} Z`}),Io=e.computed(()=>{if(io.value)return io.value;if(Vl.value)return`url(#${kn.value})`});let Dn=null;const Hn=()=>{if(!hn.value)return;Hl.value=0;const t=Rt.value,s=performance.now(),l=i=>{const p=i-s,g=Math.min(1,p/t);Hl.value=Zl(qt.value,g),g<1&&(Dn=requestAnimationFrame(l))};Dn=requestAnimationFrame(l)},co=e.computed(()=>R.value?.bubbles?.minSize||8),Rn=e.computed(()=>R.value?.bubbles?.maxSize||50),uo=e.computed(()=>R.value?.bubbles?.opacity||.7),xo=(t,s)=>{const l=[15,20,25,18,22],i=l[t%l.length]||20,p=1+Math.sin(s*.5)*.2;return Math.max(5,i*p)},Fo=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},qn=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},ql=e.computed(()=>H.series),on=e.computed(()=>H.series.filter((t,s)=>!zt.value.has(s))),mn="auto",Gt=e.computed(()=>{if(sl.value)return mo();if(!on.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,l=0;on.value.forEach(b=>{b.data&&b.data.length&&(l=Math.max(l,b.data.length-1),b.data.forEach(D=>{typeof D=="number"&&(t=Math.min(t,D),s=Math.max(s,D))}))}),H.categories.length>0&&(l=Math.max(l,H.categories.length-1)),t===1/0&&(t=0,s=100);const i=at.value,p=Et.value;let g,w;if(i===mn){const b=s-t,D=b>0?b*.1:1;g=Math.max(0,t-D)}else if(typeof i=="number")g=i;else{const b=s-t,D=b>0?b*.1:1;g=Math.max(0,t-D)}if(p===mn){const b=s-t,D=b>0?b*.1:2;w=s+D}else if(typeof p=="number")w=p;else{const b=s-t,D=b>0?b*.1:2;w=s+D}return{minX:0,maxX:l,minY:g,maxY:w}}),mo=()=>{if(!on.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,s=-1/0,l=1/0,i=-1/0,p=1/0,g=-1/0,w=!1;if(on.value.forEach((xe,We)=>{xe?.data?.length&&xe.data.forEach((re,ye)=>{let Be,me,je;if(typeof re=="object"&&re!==null&&!Array.isArray(re))Be=typeof re.x=="number"?re.x:ye,me=typeof re.y=="number"?re.y:0,je=typeof re.size=="number"?re.size:20;else if(Array.isArray(re)&&re.length>=3)Be=typeof re[0]=="number"?re[0]:ye,me=typeof re[1]=="number"?re[1]:0,je=typeof re[2]=="number"?re[2]:20;else if(typeof re=="number")Be=ye,me=re,je=xo(We,ye);else return;isFinite(Be)&&isFinite(me)&&isFinite(je)&&(t=Math.min(t,Be),s=Math.max(s,Be),l=Math.min(l,me),i=Math.max(i,me),p=Math.min(p,je),g=Math.max(g,je),w=!0)})}),!w)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===s&&(t=Math.min(t,0),s=Math.max(s,H.categories?.length-1||8)),l===i&&(l=Math.max(0,l-10),i=l+20);const b=s-t,D=i-l;let A,I,N,J;return nl.value!==null?A=nl.value:A=t-b*.1,Ft.value!==null?I=Ft.value:I=s+b*.1,at.value!==null&&typeof at.value=="number"?N=at.value:N=Math.max(0,l-D*.1),Et.value!==null&&typeof Et.value=="number"?J=Et.value:J=i+D*.1,{minX:A,maxX:I,minY:N,maxY:J,minSize:p,maxSize:g}},Qt=t=>{if(sl.value){const{minX:b,maxX:D}=Gt.value,A=D-b||1;return O.value.left+(t-b)/A*O.value.width}const{minX:s,maxX:l}=Gt.value,i=l-s;if(l===0||i===0)return O.value.left+O.value.width/2;const p=i/le.value.scale,g=s-le.value.offsetX/O.value.width*i,w=(t-g)/p;return O.value.left+w*O.value.width},kl=t=>{const{minY:s,maxY:l}=Gt.value,i=l-s||1;return O.value.bottom-(t-s)/i*O.value.height},Eo=t=>{if(!sl.value)return mt.value||4;const{maxSize:s}=Gt.value,l=Math.max(1,s),i=Math.min(1,Math.max(0,t/l));return co.value+i*(Rn.value-co.value)},So=e.computed(()=>an.value.map(t=>({y:t.y}))),po=e.computed(()=>{if(sl.value)return In();if(Ue.value==="bar"){if(fl.value){const _e=[],{minY:Fe,maxY:Bt}=Gt.value,_t=5,Tl=Bt-Fe||1;for(let el=0;el<=_t;el++){const Ul=Fe+Tl*(el/_t),Bo=un(Ul);_e.push({x:Bo,y:O.value.bottom+20,text:gl(Math.round(Ul))})}return _e}const ye=[],{maxX:Be}=Gt.value,me=Be+1,je=5,Ae=(O.value.width-je*2)/me;for(let _e=0;_e<=Be;_e++){const Fe=O.value.left+je+(_e+.5)*Ae;ye.push({x:Fe,y:O.value.bottom+20,text:H.categories[_e]||B("chart.fallback.item",{number:_e+1})})}return ye}const t=[],{minX:s,maxX:l}=Gt.value,i=nl.value!==null?nl.value:s,p=Ft.value!==null?Ft.value:l,g=p-i||1,w=g/le.value.scale,b=i-le.value.offsetX/O.value.width*g,D=b+w,A=Math.max(0,Math.floor(b-2)),I=Math.min(p,Math.ceil(D+2)),N=I-A,J=O.value.width,We=Math.floor(J/60);let re=1;N>We&&(re=Math.ceil(N/We));for(let ye=A;ye<=I;ye+=re)if(ye>=0&&ye<=p){const Be=Qt(ye);Be>=O.value.left-100&&Be<=O.value.right+100&&t.push({x:Be,y:O.value.bottom+20,text:H.categories[ye]||`Item ${ye+1}`})}return t}),In=()=>{const t=[],{minX:s,maxX:l}=Gt.value,i=l-s||1,p=Math.min(8,Math.max(4,Math.floor(O.value.width/80)));for(let g=0;g<=p;g++){const w=s+i*g/p,b=Qt(w);if(b>=O.value.left-10&&b<=O.value.right+10){const D=Math.round(w),A=H.categories?.[D];t.push({x:b,y:O.value.bottom+20,text:A||(Number.isInteger(w)?w.toString():w.toFixed(1))})}}return t},an=e.computed(()=>{if(fl.value){const p=[],{maxX:g}=Gt.value;for(let w=0;w<=g;w++)p.push({x:O.value.left-10,y:dn(w),text:H.categories[w]||`Item ${w+1}`});return p}const t=[],{minY:s,maxY:l}=Gt.value,i=5;for(let p=0;p<=i;p++){const g=s+(l-s)*(p/i),w=Math.round(g);t.push({x:O.value.left-10,y:kl(g),text:gl(w)})}return t}),Ot=t=>{const s=bt.value;if(!s||s.length===0){const l=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return l[t%l.length]}return s[t%s.length]},Vo=t=>{if(!t||typeof t!="string")return"#3a3a3a";const s=t.trim();let l=0,i=0,p=0;const g=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)l=Number(g[1])/255,i=Number(g[2])/255,p=Number(g[3])/255;else{const b=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(b)l=Number(b[1])/255,i=Number(b[2])/255,p=Number(b[3])/255;else{const D=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(D){let A=D[1];A.length===3&&(A=A[0]+A[0]+A[1]+A[1]+A[2]+A[2]),l=parseInt(A.slice(0,2),16)/255,i=parseInt(A.slice(2,4),16)/255,p=parseInt(A.slice(4,6),16)/255}else if(typeof document<"u"){const A=document.createElement("span");A.style.color=s,A.style.display="none",document.body.appendChild(A);const I=getComputedStyle(A).color;document.body.removeChild(A);const N=I.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(N)l=Number(N[1])/255,i=Number(N[2])/255,p=Number(N[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*i+.0722*p>.5?"#3a3a3a":"#fafafa"},fo=t=>{if(!t||typeof t!="string")return t;const s=t.trim(),l=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(l){const g=Math.max(0,Math.floor(Number(l[1])*.65)),w=Math.max(0,Math.floor(Number(l[2])*.65)),b=Math.max(0,Math.floor(Number(l[3])*.65));return`rgb(${g}, ${w}, ${b})`}const i=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(i){const g=Math.max(0,Math.floor(Number(i[1])*.65)),w=Math.max(0,Math.floor(Number(i[2])*.65)),b=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${w}, ${b}, ${i[4]})`}const p=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(p){let g=p[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const w=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),b=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),D=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[w,b,D].map(A=>A.toString(16).padStart(2,"0")).join("")}`}return s},vo=(t,s)=>{const i=R.value?.stroke?.color;return i==null?fo(s):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??fo(s):fo(s)},go=t=>{let s=0;for(let l=1;l<t.length;l++){const i=t[l].x-t[l-1].x,p=t[l].y-t[l-1].y;s+=Math.sqrt(i*i+p*p)}return s},Fn=e.computed(()=>Ue.value==="line"||Dl.value?(Dl.value?H.series.filter(s=>(s.type||Ue.value)==="line"):ql.value).map((s,l)=>{const i=H.series.findIndex(N=>N===s),p=[];let g=[];s.data.forEach((N,J)=>{N==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:fl.value?un(N):Qt(J),y:fl.value?dn(J):kl(N),index:J})}),g.length>0&&p.push(g);let w="";p.forEach(N=>{if(N.length>0){let J="";se.value?J=An(N):J=`M ${N[0].x} ${N[0].y}`+N.slice(1).map(xe=>` L ${xe.x} ${xe.y}`).join(""),w+=(w?" ":"")+J}});const b=p.reduce((N,J)=>N+go(J),0),D=zt.value.has(i),A=Ce.value===i,I=Ce.value!==null&&Ce.value!==i;return{path:w,color:Ot(i),pathLength:b,seriesIndex:i,animationDelay:l*Dt.value,isHighlighted:A,isDimmed:I,isHidden:D}}):[]),Rl=e.computed(()=>{if(!(Ue.value==="line"||Dl.value))return[];const t=Dl.value?H.series.filter(l=>(l.type||Ue.value)==="line"):ql.value,s=[];return t.forEach((l,i)=>{const p=H.series.findIndex(g=>g===l);for(let g=0;g<l.data.length-1;g++){const w=l.data[g];if(w!=null){let b=-1,D=0;for(let A=g+1;A<l.data.length;A++){const I=l.data[A];if(I==null)D++;else{b=A;break}}if(D>0&&b!==-1){const A=l.data[b],I=fl.value?un(w):Qt(g),N=fl.value?dn(g):kl(w),J=fl.value?un(A):Qt(b),xe=fl.value?dn(b):kl(A),We=zt.value.has(p),re=Ce.value===p,ye=Ce.value!==null&&Ce.value!==p;s.push({path:`M ${I} ${N} L ${J} ${xe}`,color:Ot(p),seriesIndex:p,animationDelay:i*Dt.value,isHighlighted:re,isDimmed:ye,isHidden:We,gapSize:D}),g=b-1}}}}),s}),zo=e.computed(()=>Ue.value==="line"||Dl.value?!Re.value||Cl.value||Nt.value.hasAnimated?[]:(Dl.value?H.series.filter(s=>(s.type||Ue.value)==="line"):ql.value).map((s,l)=>{const i=H.series.findIndex(D=>D===s);let p="",g=null;s.data.forEach((D,A)=>{if(D!=null){const I={x:fl.value?un(D):Qt(A),y:fl.value?dn(A):kl(D)};g===null?p+=`M ${I.x} ${I.y}`:p+=` L ${I.x} ${I.y}`,g=I}else if(g!==null){const I=s.data.findIndex((N,J)=>J>A&&N!==null&&N!==void 0);if(I!==-1){const N={x:fl.value?un(s.data[I]):Qt(I),y:fl.value?dn(I):kl(s.data[I])};p+=` L ${N.x} ${N.y}`,g=N}}});const w=s.data.map((D,A)=>D==null?null:{x:fl.value?un(D):Qt(A),y:fl.value?dn(A):kl(D)}).filter(D=>D!==null),b=go(w);return{path:p,pathLength:b,color:Ot(i),animationDelay:l*Dt.value,seriesIndex:i}}):[]),Cn=e.computed(()=>{if(Ue.value!=="line")return[];const t=[];return ql.value.forEach((s,l)=>{const i=Ce.value===l,p=Ce.value!==null&&Ce.value!==l,g=zt.value.has(l);s.data.forEach((w,b)=>{w!=null&&t.push({x:Qt(b),y:kl(w),color:Ot(l),value:w,label:H.categories[b]||b.toString(),seriesName:s.name,categoryIndex:b,dataIndex:b,animationDelay:(l*s.data.length+b)*(Dt.value/8),isHighlighted:i,isDimmed:p,isHidden:g})})}),t}),ho=e.computed(()=>{if(!Dl.value)return[];const t=[];return H.series.filter(l=>(l.type||Ue.value)==="line").forEach((l,i)=>{const p=H.series.findIndex(D=>D===l),g=Ce.value===p,w=Ce.value!==null&&Ce.value!==p,b=zt.value.has(p);l.data.forEach((D,A)=>{D!=null&&t.push({x:Qt(A),y:kl(D),color:Ot(p),value:D,label:H.categories[A]||A.toString(),seriesName:l.name,categoryIndex:A,dataIndex:A,animationDelay:(i*l.data.length+A)*(Dt.value/8),isHighlighted:g,isDimmed:w,isHidden:b})})}),t}),Wn=e.computed(()=>{if(!sl.value)return[];const t=[];return ql.value.forEach((s,l)=>{if(!s?.data?.length)return;const i=Ce.value,p=i!==null&&i===l,g=i!==null&&i!==l,w=zt.value.has(l);s.data.forEach((b,D)=>{let A,I,N,J,xe;if(typeof b=="object"&&b!==null&&!Array.isArray(b))A=typeof b.x=="number"?b.x:D,I=typeof b.y=="number"?b.y:0,N=typeof b.size=="number"?b.size:20,J=b.label||H.categories?.[D]||`Point ${D+1}`,xe=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)A=typeof b[0]=="number"?b[0]:D,I=typeof b[1]=="number"?b[1]:0,N=typeof b[2]=="number"?b[2]:20,J=b[3]||H.categories?.[D]||`Point ${D+1}`,xe=b[4];else if(typeof b=="number")A=D,I=b,N=xo(l,D),J=H.categories?.[D]||`Point ${D+1}`;else return;!isFinite(A)||!isFinite(I)||!isFinite(N)||t.push({x:Qt(A),y:kl(I),radius:Eo(N),originalX:A,originalY:I,originalSize:N,color:Ot(l),seriesName:s.name||`Series ${l+1}`,label:J,imageUrl:xe,seriesIndex:l,dataIndex:D,categoryIndex:Math.round(A),isHighlighted:p,isDimmed:g,isHidden:w,opacity:uo.value})})}),t}),Zn=e.computed(()=>Ue.value!=="area"?[]:ql.value.map((t,s)=>{const l=[];let i=[];if(t.data.forEach((N,J)=>{N==null?i.length>0&&(l.push([...i]),i=[]):i.push({x:Qt(J),y:kl(N),index:J})}),i.length>0&&l.push(i),l.length===0)return{linePath:"",areaPath:"",color:Ot(s),isHidden:zt.value.has(s)};const p=O.value.bottom+1;let g="",w="";l.forEach((N,J)=>{if(N.length===0)return;let xe=`M ${N[0].x} ${N[0].y}`;se.value&&N.length>1?xe=An(N):N.slice(1).forEach(re=>{xe+=` L ${re.x} ${re.y}`}),g+=(g?" ":"")+xe;let We=`M ${N[0].x} ${p}`;if(We+=` L ${N[0].x} ${N[0].y}`,se.value&&N.length>1){const re=An(N),ye=re.substring(re.indexOf("C")||re.indexOf("Q")||re.indexOf("L"));ye?We+=" "+ye:N.slice(1).forEach(Be=>{We+=` L ${Be.x} ${Be.y}`})}else N.slice(1).forEach(re=>{We+=` L ${re.x} ${re.y}`});We+=` L ${N[N.length-1].x} ${p} Z`,w+=(w?" ":"")+We});const b=Ce.value===s,D=Ce.value!==null&&Ce.value!==s,A=zt.value.has(s),I=l.reduce((N,J)=>N+go(J),0);return{linePath:g,areaPath:w,color:Ot(s),pathLength:I,isHighlighted:b,isDimmed:D,isHidden:A}})),yo=e.computed(()=>{if(!(["bar"].includes(Ue.value)||Dl.value))return[];const t=[],{maxX:s}=Gt.value,l=Dl.value?H.series.filter(p=>(p.type||Ue.value)==="bar"):ql.value,i=l.length;if(fl.value){const p=s+1,w=O.value.height/p,b=w*(2/3),D=Math.min(4,b/i*.15),A=b-(i-1)*D,I=Math.max(4,A/i);l.forEach((N,J)=>{const xe=H.series.findIndex(Be=>Be===N),We=Ce.value===xe,re=Ce.value!==null&&Ce.value!==xe,ye=zt.value.has(xe);N.data.forEach((Be,me)=>{if(Be==null||typeof Be!="number"||!isFinite(Be))return;const Ae=O.value.top+(me+.5)*w-b/2+J*(I+D),_e=O.value.left,Fe=Math.abs(un(Be)-O.value.left);let Bt="";if(se.value&&Fe>0){const _t=Math.min(it.value,I/2,Fe/2);Bt=[`M ${_e} ${Ae}`,`L ${_e+Fe-_t} ${Ae}`,`Q ${_e+Fe} ${Ae} ${_e+Fe} ${Ae+_t}`,`L ${_e+Fe} ${Ae+I-_t}`,`Q ${_e+Fe} ${Ae+I} ${_e+Fe-_t} ${Ae+I}`,`L ${_e} ${Ae+I}`,"Z"].join(" ")}t.push({x:_e,y:Ae,width:Fe,height:I,color:Ot(i===1?me:xe),value:Be,label:H.categories[me]||me.toString(),seriesName:N.name,animationDelay:(J*l.length+me)*(Dt.value/4),isHighlighted:We,isDimmed:re,isHidden:ye,barPath:Bt,isSmooth:se.value&&Fe>0})})})}else{const p=s+1,w=O.value.width/p,b=w*.8,D=b/i,A=D*.05,I=D-A;l.forEach((N,J)=>{const xe=H.series.findIndex(Be=>Be===N),We=Ce.value===xe,re=Ce.value!==null&&Ce.value!==xe,ye=zt.value.has(xe);N.data.forEach((Be,me)=>{if(Be==null||typeof Be!="number"||!isFinite(Be))return;const Ae=O.value.left+(me+.5)*w-b/2+J*D+A/2,_e=kl(Math.max(0,Be)),Fe=Math.abs(kl(0)-kl(Be));let Bt="";if(se.value&&Fe>0){const _t=Math.min(it.value,I/2,Fe/2);Bt=[`M ${Ae} ${_e+Fe}`,`L ${Ae} ${_e+_t}`,`Q ${Ae} ${_e} ${Ae+_t} ${_e}`,`L ${Ae+I-_t} ${_e}`,`Q ${Ae+I} ${_e} ${Ae+I} ${_e+_t}`,`L ${Ae+I} ${_e+Fe}`,"Z"].join(" ")}t.push({x:Ae,y:_e,width:I,height:Fe,color:Ot(i===1?me:xe),value:Be,label:H.categories[me]||me.toString(),seriesName:N.name,animationDelay:(J*l.length+me)*(Dt.value/4),isHighlighted:We,isDimmed:re,isHidden:ye,barPath:Bt,isSmooth:se.value&&Fe>0})})})}return t}),o=e.computed(()=>{if(!pl.value)return[];const t=ql.value.map((g,w)=>({series:g,originalIndex:w})).filter(({originalIndex:g})=>!zt.value.has(g));if(t.length===0)return[];let s=Ue.value==="semi-radial"?Math.PI:-Math.PI/2;const l=Ue.value==="semi-radial"?Math.PI:Math.PI*2,i=[];if(t.length===1){const{series:g,originalIndex:w}=t[0],b=g.data[0]||0,D=s,A=s+l-.001,I=D+l/2,N=wt.value+Math.cos(D)*cl.value,J=Mt.value+Math.sin(D)*cl.value,xe=wt.value+Math.cos(A)*cl.value,We=Mt.value+Math.sin(A)*cl.value,re=wt.value+Math.cos(A)*ft.value,ye=Mt.value+Math.sin(A)*ft.value,Be=wt.value+Math.cos(D)*ft.value,me=Mt.value+Math.sin(D)*ft.value,je=1,Pe=[`M ${N} ${J}`,`A ${cl.value} ${cl.value} 0 ${je} 1 ${xe} ${We}`,`L ${re} ${ye}`,`A ${ft.value} ${ft.value} 0 ${je} 0 ${Be} ${me}`,"Z"].join(" "),Ae=Ot(w);return i.push({path:Pe,color:Ae,strokeWidth:Ye.value,strokeColor:vo(0,Ae),value:b,seriesName:g.name,opacity:.8,isHighlighted:Ce.value===w,isDimmed:!1,isHidden:!1,startAngle:D,endAngle:A,midAngle:I}),i}if(Ut.value&&t.length===2){const g=t[0],w=t[1],b=Math.min(100,Math.max(0,g.series.data[0]||0)),D=b/100*l,A=(I,N,J,xe,We)=>{const re=I+(N-I)/2,ye=N-I,Be=wt.value+Math.cos(I)*cl.value,me=Mt.value+Math.sin(I)*cl.value,je=wt.value+Math.cos(N)*cl.value,Pe=Mt.value+Math.sin(N)*cl.value,Ae=wt.value+Math.cos(N)*ft.value,_e=Mt.value+Math.sin(N)*ft.value,Fe=wt.value+Math.cos(I)*ft.value,Bt=Mt.value+Math.sin(I)*ft.value,_t=ye>Math.PI?1:0,Tl=[`M ${Be} ${me}`,`A ${cl.value} ${cl.value} 0 ${_t} 1 ${je} ${Pe}`,`L ${Ae} ${_e}`,`A ${ft.value} ${ft.value} 0 ${_t} 0 ${Fe} ${Bt}`,"Z"].join(" "),el=Ot(xe);return{path:Tl,color:el,strokeWidth:Ye.value,strokeColor:vo(i.length,el),value:We,seriesName:J.name,opacity:.8,isHighlighted:Ce.value===xe,isDimmed:Ce.value!==null&&Ce.value!==xe,isHidden:!1,startAngle:I,endAngle:N,midAngle:re}};return i.push(A(s,s+D,g.series,g.originalIndex,b)),i.push(A(s,s+l,w.series,w.originalIndex,100)),i}const p=t.reduce((g,{series:w})=>g+(w.data[0]||0),0);return p===0?[]:(t.forEach(({series:g,originalIndex:w})=>{const b=g.data[0]||0,D=b/p*l,A=s,I=s+D,N=A+D/2,J=wt.value+Math.cos(A)*cl.value,xe=Mt.value+Math.sin(A)*cl.value,We=wt.value+Math.cos(I)*cl.value,re=Mt.value+Math.sin(I)*cl.value,ye=wt.value+Math.cos(I)*ft.value,Be=Mt.value+Math.sin(I)*ft.value,me=wt.value+Math.cos(A)*ft.value,je=Mt.value+Math.sin(A)*ft.value,Pe=D>Math.PI?1:0,Ae=[`M ${J} ${xe}`,`A ${cl.value} ${cl.value} 0 ${Pe} 1 ${We} ${re}`,`L ${ye} ${Be}`,`A ${ft.value} ${ft.value} 0 ${Pe} 0 ${me} ${je}`,"Z"].join(" "),_e=Ot(w);i.push({path:Ae,color:_e,strokeWidth:Ye.value,strokeColor:vo(i.length,_e),value:b,seriesName:g.name,opacity:.8,isHighlighted:Ce.value===w,isDimmed:Ce.value!==null&&Ce.value!==w,isHidden:!1,startAngle:A,endAngle:I,midAngle:N}),s=I}),i)}),n=e.computed(()=>{const t=o.value;return Ut.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((s,l)=>({segment:s,originalIndex:l}))}),a=e.computed(()=>{if(!Yl.value||!pl.value)return[];const t=vn.value,s=gn.value,l=bn.value,i=zn.value,p=15,g=t*1.3,w=.55,b=(N,J)=>{const xe=wt.value+Math.cos(N.midAngle)*ft.value,We=Mt.value+Math.sin(N.midAngle)*ft.value,re=wt.value+Math.cos(N.midAngle)*(ft.value+s),ye=Mt.value+Math.sin(N.midAngle)*(ft.value+s),me=re+l*(J?1:-1),je=J?re+p:re-p,Pe=ye-i,Ae=`${N.seriesName}: ${gl(N.value)}`,_e=Ae.length*t*w;return{pointerStartX:xe,pointerStartY:We,pointerEndX:re,pointerEndY:ye,horizontalEndX:me,horizontalEndY:ye,textX:je,textY:Pe,text:Ae,textWidth:_e,textAnchor:J?"start":"end",isRightSide:J,pointerLineLength:Math.hypot(re-xe,ye-We),horizontalLineLength:Math.hypot(me-re,0)}},D=(N,J)=>{const xe=Math.abs(N.textY-J.textY)<g,We=N.isRightSide?N.textX:N.textX-N.textWidth,re=N.isRightSide?N.textX+N.textWidth:N.textX,ye=J.isRightSide?J.textX:J.textX-J.textWidth,Be=J.isRightSide?J.textX+J.textWidth:J.textX,me=We<Be&&ye<re;return xe&&me},A=o.value.filter(N=>!N.isHidden),I=[];for(let N=0;N<A.length;N++){const J=A[N];let xe=Math.cos(J.midAngle)>=0;if(N>0){const re=I[N-1],ye=b(J,xe);D(re,ye)&&(xe=!xe)}const We=b(J,xe);I.push({...We,color:J.color,isHighlighted:J.isHighlighted,isDimmed:J.isDimmed})}return I}),r=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||uo.value||.7;return Ce.value===null||Ce.value===void 0?s:Ce.value!==null?t.seriesIndex===Ce.value?Math.min(1,s+.1):Math.max(.5,s*.8):s},c=t=>{if(!t||t.isHidden)return 0;const s=t.radius>20?.9:.8;return Ce.value!==null?t.seriesIndex===Ce.value?Math.min(1,s+.1):s*.7:s},d=(t,s)=>{if(t)try{if(Ce.value===t.seriesIndex?Ce.value=null:Ce.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:H.chartId}});window.dispatchEvent(l)}}catch(l){console.error("Error in onBubbleClick:",l)}},u=(t,s)=>{const l=[`dss-bubble-fallback-${s}`];return t.isHighlighted&&l.push("dss-bubble-highlighted"),t.isDimmed&&l.push("dss-bubble-dimmed"),t.isHidden&&l.push("dss-bubble-hidden"),l.push(`dss-bubble-series-${t.seriesIndex}`),l.join(" ")},m=(t,s)=>{if(!t||(s.stopPropagation(),Xn.value=!0,Ce.value=t.seriesIndex,we.value.show=!1,!Xt.value))return;const l=s.target.closest(".dss-custom-chart-container");if(!l)return;const i=l.getBoundingClientRect();let p=s.clientX-i.left+10,g=s.clientY-i.top-10;const w=200,b=120;p+w>ie.value&&(p=s.clientX-i.left-w-10),g+b>i.height&&(g=s.clientY-i.top-b-10),p<0&&(p=10),g<0&&(g=10);const D=Bn.value,A=Mn.value,I=D.map(N=>{const J=A[N]||N,xe=v(N,t);return xe?{seriesName:t.seriesName,label:t.label,value:`${J}: ${xe}`,color:t.color}:null}).filter(Boolean);ot.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:I,categoryIndex:void 0,spiderAreas:[]}},v=(t,s)=>{let l;switch(t){case"x":l=s.originalX;break;case"y":l=s.originalY;break;case"size":l=s.originalSize;break;case"label":l=s.label;break;case"seriesName":l=s.seriesName;break;default:l=s[t]||""}const i=En.value[t];if(typeof i=="function")return i(l,s);if(typeof l=="number"){const p=l.toFixed(1);return Lt.value?p+Lt.value:p}return l?.toString()||""},h=()=>{if(!sl.value||!we.value.data||we.value.data.length===0)return"Bubbles";const t=[],s=new Set;return we.value.data.forEach(l=>{if(l.seriesName&&l.label){const i=`${l.seriesName} - ${l.label}`;s.has(i)||(t.push(i),s.add(i))}else l.seriesName&&(s.has(l.seriesName)||(t.push(l.seriesName),s.add(l.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},M=(t,s)=>{t&&(Xn.value=!1,Ce.value=null,ot.value.show=!1,ot.value.bubbleData=[])},T=(t,s)=>{const l=s.target.closest(".dss-custom-chart-container");if(!l)return;const i=l.getBoundingClientRect(),p=Zt(t.categoryIndex),g=t.description||t.comment||"";let w=s.clientX-i.left+15,b=s.clientY-i.top-10;const D=200,A=g?80:50;w+D>ie.value&&(w=s.clientX-i.left-D-15),b+A>he.value&&(b=s.clientY-i.top-A-10),w<0&&(w=10),b<0&&(b=10),St.value={show:!0,x:w,y:b,categoryValue:p,description:g}},E=()=>{St.value.show=!1},G=e.computed(()=>H.categories.length||Math.max(...on.value.map(t=>t.data.length))),Y=e.computed(()=>{let t=0;return on.value.forEach(s=>{s.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),De=e.computed(()=>{const t=[],s=G.value;for(let l=0;l<s;l++){const i=l*2*Math.PI/s-Math.PI/2,p=wt.value+Math.cos(i)*ft.value,g=Mt.value+Math.sin(i)*ft.value;t.push({x:p,y:g,angle:i,index:l})}return t}),Se=e.computed(()=>{const t=[],s=G.value;return De.value.forEach((l,i)=>{const p=ft.value+15,g=i*2*Math.PI/s-Math.PI/2,w=wt.value+Math.cos(g)*p,b=Mt.value+Math.sin(g)*p+5;let D="middle",A="middle";Math.abs(Math.cos(g))>.5&&(D=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(A=Math.sin(g)>0?"hanging":"auto"),t.push({x:w,y:b,text:H.categories[i]||`Axis ${i+1}`,anchor:D,baseline:A})}),t}),vt=e.ref(new Set),vl=(t,s,l)=>{const i=`current-${l}`,p=vt.value.has(i);return!p&&Ce.value===null?s.fillOpacity||S.value:s.isHighlighted||p?(s.fillOpacity||S.value)+.15:s.isDimmed?(s.fillOpacity||S.value)*.3:s.fillOpacity||S.value},ul=e.computed(()=>{if(!Ol.value)return[];const t=[],s=G.value;return ql.value.forEach((l,i)=>{const p=[],g=[],w=[],b=Ce.value===i,D=Ce.value!==null&&Ce.value!==i,A=zt.value.has(i);for(let I=0;I<s;I++){const N=l.data[I]||0,xe=N/Y.value*ft.value,We=I*2*Math.PI/s-Math.PI/2,re=wt.value+Math.cos(We)*xe,ye=Mt.value+Math.sin(We)*xe;p.push(`${re},${ye}`),g.push({x:re,y:ye}),w.push({x:re,y:ye,value:N,label:H.categories[I]||`Axis ${I+1}`,seriesName:l.name})}t.push({points:p.join(" "),polygonPoints:g,dataPoints:w,color:Ot(i),fillOpacity:S.value,seriesName:l.name,value:`${l.name}: ${l.data.join(", ")}`,isHighlighted:b,isDimmed:D,isHidden:A,seriesIndex:i})}),t}),rl=(t,s)=>{if(!s||s.length<3)return!1;let l=!1;for(let i=0,p=s.length-1;i<s.length;p=i++){const g=s[i].x,w=s[i].y,b=s[p].x,D=s[p].y;w>t.y!=D>t.y&&t.x<(b-g)*(t.y-w)/(D-w)+g&&(l=!l)}return l},ml=t=>{if(!Ol.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const l=s.getBoundingClientRect(),i=$.value?.getBoundingClientRect();if(!i)return;const p=t.clientX-i.left,g=t.clientY-i.top,w=ul.value.filter(b=>b.isHidden?!1:rl({x:p,y:g},b.polygonPoints));if(w.length>0){w.length,Ce.value=w[0].seriesIndex;const b=t.clientX-l.left+10,D=t.clientY-l.top-10,A=w.length>1?460:260,I=70+G.value*20;let N=b,J=D;N+A>ie.value&&(N=t.clientX-l.left-A-10),J+I>he.value&&(J=t.clientY-l.top-I-10),N<0&&(N=10),J<0&&(J=10);const xe=w.map(We=>({seriesName:We.seriesName,color:We.color,points:We.dataPoints.map(re=>({label:re.label,value:gl(re.value)}))}));ot.value={show:!0,x:N,y:J,title:"",value:"",bubbleData:[],spiderAreas:xe}}else Wl()},Jt=e.computed(()=>{const t=R.value;return t.logos.map((s,l)=>{const i=H.series[s.seriesIndex];if(!i||!i.data||i.data.length===0||zt.value.has(s.seriesIndex))return null;let p,g;if(xl.value){let b=-1,D=null;for(let I=i.data.length-1;I>=0;I--)if(i.data[I]!==null&&i.data[I]!==void 0){b=I,D=i.data[I];break}if(b===-1||D===null)return null;const A=i.data.map((I,N)=>I==null?null:{x:Qt(N),y:kl(I),index:N}).filter(I=>I!==null);if(t.animations.enabled&&!Cl.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Nt.value.isAnimating||!Nt.value.hasAnimated))if(Nt.value.isAnimating){const I=Nt.value.currentFrame/Nt.value.totalFrames,N=Zl(t.animations.easing,Math.min(I,1)),J=aa(A,N);p=J.x+(s.offsetX||0),g=J.y+(s.offsetY||0)}else p=A[0].x+(s.offsetX||0),g=A[0].y+(s.offsetY||0);else p=Qt(b)+(s.offsetX||0),g=kl(D)+(s.offsetY||0)}else if(pl.value||Ol.value){const b=Math.PI*2/t.logos.length*l;p=wt.value+Math.cos(b)*(ft.value+30)+(s.offsetX||0),g=Mt.value+Math.sin(b)*(ft.value+30)+(s.offsetY||0)}return{...s,x:p,y:g,seriesIndex:s.seriesIndex}}).filter(Boolean)}),dl=t=>{const s=document.querySelector(`.dss-logo-fallback-${t}`),l=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.opacity="0"),l&&(l.style.opacity="1")},en=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},tn=t=>{zt.value.has(t)?zt.value.delete(t):zt.value.add(t)},pn=e.computed(()=>{if(!ot.value.show&&!(te.value&&we.value.show&&!le.value.isZooming))return{display:"none"};let t,s;if(te.value&&we.value.show&&!le.value.isZooming){t=we.value.x+15,s=O.value.top;const l=sl.value?200:150;t+l>ie.value&&(t=we.value.x-l-15),t<0&&(t=10),s<10&&(s=10)}else t=ot.value.x,s=ot.value.y;return{left:t+"px",top:s+"px"}}),sn=(t,s)=>{if(!Xt.value||Yn.value)return;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=s.clientX-i.left+10,g=s.clientY-i.top-10;const w=200,b=120,D=ie.value,A=he.value;p+w>D&&(p=s.clientX-i.left-w-10),g+b>A&&(g=s.clientY-i.top-b-10),p<0&&(p=10),g<0&&(g=10);let I;typeof t.categoryIndex=="number"?I=t.categoryIndex:typeof t.dataIndex=="number"?I=t.dataIndex:t.label&&H.categories.includes(t.label)&&(I=H.categories.indexOf(t.label));const N=(fl.value||Ue.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";ot.value={show:!0,x:p,y:g,title:N,value:gl(t.value)||"",categoryIndex:I,spiderAreas:[]}},Un=e.ref(!1),Xn=e.ref(!1),Wl=()=>{ot.value.show=!1,ot.value.spiderAreas=[],ot.value.bubbleData=[],we.value.show=!1,Un.value||(Ce.value=null)},Yn=e.ref(!1),Nn=(t,s)=>{Yn.value=!0,ot.value.show=!1,we.value.show=!1;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=s.clientX-i.left+15,g=s.clientY-i.top-10;const w=250;p+w>ie.value&&(p=s.clientX-i.left-w-15),p<0&&(p=10),g<0&&(g=10),zl.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},fn=()=>{Yn.value=!1,zl.value.show=!1},Nt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),Zl=(t,s)=>{switch(t){case"linear":return s;case"ease":return s<.5?2*s*s:-1+(4-2*s)*s;case"ease-in":return s*s;case"ease-out":return s*(2-s);case"ease-in-out":return s<.5?2*s*s:-1+(4-2*s)*s;default:return s}},Cl=e.computed(()=>C.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Il=()=>{if(!Re.value||Cl.value){Nt.value.hasAnimated=!0,Vl.value&&(Ll.value=1);return}Vl.value&&(Ll.value=0),Nt.value.isAnimating=!0,Nt.value.currentFrame=0,Nt.value.totalFrames=Math.ceil(Rt.value/16.67);const t=()=>{const s=Nt.value.currentFrame/Nt.value.totalFrames,l=Zl(qt.value,Math.min(s,1));Wo(l),Vl.value&&(Ll.value=l),s<1?(Nt.value.currentFrame++,Nt.value.animationId=requestAnimationFrame(t)):ta()};Nt.value.animationId=requestAnimationFrame(t)},Wo=t=>{const s=z.value;s&&s.style.setProperty("--dss-animation-progress",t)},ta=()=>{Nt.value.isAnimating=!1,Nt.value.hasAnimated=!0,Vl.value&&(Ll.value=1),Nt.value.animationId&&(cancelAnimationFrame(Nt.value.animationId),Nt.value.animationId=null)},Po=e.computed(()=>!pl.value||Nt.value.hasAnimated?!0:Vl.value?Ll.value>=1:$l.value?Hl.value>=1:!0),Zo=e.computed(()=>Yl.value&&Po.value),No=e.ref(!1);e.watch(Zo,t=>{t?(No.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{No.value=!0})})):No.value=!1},{immediate:!0});const la=e.computed(()=>{if(!Re.value||Cl.value||Nt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${Rt.value}ms`,t["--dss-animation-easing"]=na(qt.value),t["--dss-stagger-delay"]=`${Dt.value}ms`,t}),na=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",oa=()=>{if(!Re.value||Cl.value)return"";const t=["dss-chart-animated"];return Nt.value.hasAnimated||t.push(`dss-animate-${ht.value}`),Nt.value.hasAnimated||(pl.value&&Ue.value!=="semi-radial"?t.push("dss-animate-fill"):pl.value||t.push(`dss-animate-${ht.value}`)),Nt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>H.series,(t,s)=>{V.value&&s&&Nt.value.hasAnimated&&(Nt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Il(),jt.value)}))},{deep:!0}),e.watch(()=>le.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{k()},50)}),e.watch(()=>[le.value.scale,le.value.offsetX],()=>{!le.value.isZooming&&!le.value.isDragging&&k()},{flush:"post"}),e.watch([qe,rt],([t,s])=>{le.value.minScale=t,le.value.maxScale=s,(le.value.scale<t||le.value.scale>s)&&so()},{immediate:!0}),e.watch(()=>H.locale,t=>{t&&t!==_.value&&(_.value=t)},{immediate:!0}),e.watch(()=>kt.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",ao)}):document.removeEventListener("click",ao)}),e.onMounted(()=>{Ce.value=null,Vl.value&&(!Re.value||Cl.value)&&(Ll.value=1),Kt(),z.value&&typeof ResizeObserver<"u"&&(f=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(be&&cancelAnimationFrame(be),be=requestAnimationFrame(()=>{be=null;const{width:l,height:i}=s.contentRect;Ke.value=Math.round(l),ve.value=Math.round(i),X.value&&(nt.value=X.value.offsetHeight||ge)}))}),f.observe(z.value)),Re.value&&!Cl.value?Ue.value==="semi-radial"?setTimeout(()=>Hn(),jt.value):setTimeout(()=>Il(),jt.value):(Nt.value.hasAnimated=!0,Ue.value==="semi-radial"&&(Hl.value=1)),document.addEventListener("mousemove",Uo),document.addEventListener("mouseup",Xo),document.addEventListener("click",oo)}),e.onUnmounted(()=>{be&&cancelAnimationFrame(be),f&&z.value&&(f.unobserve(z.value),f.disconnect(),f=null),Nt.value.animationId&&cancelAnimationFrame(Nt.value.animationId),Dn&&(cancelAnimationFrame(Dn),Dn=null),le.value.zoomTimeout&&clearTimeout(le.value.zoomTimeout),document.removeEventListener("mousemove",Uo),document.removeEventListener("mouseup",Xo),document.removeEventListener("click",oo),document.removeEventListener("click",ao)});const Uo=t=>{if(le.value.isDragging&&le.value.scale>1&&xl.value){we.value.show=!1;const s=t.clientX-le.value.lastMouseX,{minX:l,maxX:i}=Gt.value,p=i-l||1,w=s*.8;le.value.offsetX+=w;const b=p/le.value.scale,D=p-b,A=0,I=-D/p*O.value.width,N=A;le.value.offsetX=Math.max(I,Math.min(N,le.value.offsetX)),le.value.lastMouseX=t.clientX,le.value.lastMouseY=t.clientY}},Xo=()=>{le.value.isDragging&&(le.value.isDragging=!1,setTimeout(()=>{!le.value.isDragging&&le.value.isZooming},100))},aa=(t,s)=>{const l=t.filter(b=>b!=null);if(!l||l.length===0)return{x:0,y:0};if(l.length===1||s<=0)return l[0];if(s>=1)return l[l.length-1];let i=0;const p=[];for(let b=1;b<l.length;b++){const D=l[b].x-l[b-1].x,A=l[b].y-l[b-1].y,I=Math.sqrt(D*D+A*A);p.push(I),i+=I}const g=i*s;let w=0;for(let b=0;b<p.length;b++){const D=w+p[b];if(g<=D){const A=(g-w)/p[b],I=l[b],N=l[b+1];return{x:I.x+(N.x-I.x)*A,y:I.y+(N.y-I.y)*A}}w=D}return l[l.length-1]};return(t,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[oa(),{"dss-chart-fill-width":pe.value,"dss-chart-fill-height":fe.value,"dss-chart-compact":pl.value&&!Ge.value}]]),style:e.normalizeStyle({width:pe.value?"100%":ie.value+"px",height:yt.value,...pe.value||fe.value?{overflow:pl.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...la.value,cursor:Ho()}),"data-chart-type":Ue.value,ref_key:"containerEl",ref:z,onWheel:Co,onMousedown:bo,onMousemove:Gl,onMouseup:Do,onMouseleave:wl,onDblclick:so,onContextmenu:e.withModifiers(ln,["prevent"]),onClick:e.withModifiers(Pt,["left"]),onWheelCapture:Co},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:X},[e.createElementVNode("div",Qa,[st.value?(e.openBlock(),e.createElementBlock("div",Ja,e.toDisplayString(st.value),1)):e.createCommentVNode("",!0),xt.value?(e.openBlock(),e.createElementBlock("div",es,e.toDisplayString(xt.value),1)):e.createCommentVNode("",!0)]),Ge.value&&et.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":$t.value==="horizontal","dss-legend-vertical":$t.value==="vertical","dss-legend-top":et.value==="top","dss-legend-bottom":et.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":zt.value.has(i),"dss-legend-hovered":Ce.value===i,"dss-legend-dimmed":Ce.value!==null&&Ce.value!==i}]),onClick:p=>tn(i),onMouseenter:p=>Sn(i),onMouseleave:rn,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Ot(i)})},null,4),e.createElementVNode("span",ls,e.toDisplayString(l.name),1)],46,ts))),128))],2)):e.createCommentVNode("",!0),Ge.value&&(et.value==="left"||et.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":et.value==="left","dss-legend-right":et.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":zt.value.has(i),"dss-legend-hovered":Ce.value===i,"dss-legend-dimmed":Ce.value!==null&&Ce.value!==i}]),onClick:p=>tn(i),onMouseenter:p=>Sn(i),onMouseleave:rn,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Ot(i)})},null,4),e.createElementVNode("span",os,e.toDisplayString(l.name),1)],46,ns))),128))],2)):e.createCommentVNode("",!0)],512),L.showAddMarkerButton&&Ee.value&&Ve.value.addMarker&&(xl.value||sl.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:ko,title:e.unref(B)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:At.value,class:"dss-add-marker-button-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,ss),s[4]||(s[4]=e.createElementVNode("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 4V16M4 10H16",stroke:"hsl(60, 2%, 47%)","stroke-width":"2","stroke-linecap":"round"})],-1))],8,as)):e.createCommentVNode("",!0),e.createElementVNode("div",rs,[sl.value&&Ht.value?(e.openBlock(),e.createElementBlock("div",is,"Bubble size: "+e.toDisplayString(Ht.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:ie.value,height:he.value,class:"dss-chart-svg","data-smooth":se.value,"data-animated":Re.value,ref_key:"svgEl",ref:$},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:j.value},[e.createElementVNode("rect",{x:0,y:O.value.top,width:ie.value,height:O.value.height*4},null,8,ds)],8,us),$l.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Jl.value},[e.createElementVNode("path",{d:wo.value},null,8,ps)],8,ms)):e.createCommentVNode("",!0),Vl.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:kn.value},[e.createElementVNode("path",{d:Vn.value},null,8,vs)],8,fs)):e.createCommentVNode("",!0)]),xl.value||sl.value?(e.openBlock(),e.createElementBlock("g",gs,[Yt.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":ue.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(So.value,(l,i)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${i}`,x1:O.value.left,x2:O.value.right,y1:l.y,y2:l.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${i*50}ms`})},null,12,ys))),128))],8,hs)):e.createCommentVNode("",!0),e.createElementVNode("g",ks,[e.createElementVNode("line",{x1:O.value.left,x2:O.value.right,y1:O.value.bottom,y2:O.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Cs),e.createElementVNode("line",{x1:O.value.left,x2:O.value.left,y1:O.value.top,y2:O.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,bs)]),e.createElementVNode("g",ws,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(po.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${i}`,x:l.x,y:l.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},e.toDisplayString(l.text),13,xs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(an.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${i}`,x:l.x,y:l.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(l.text),13,Es))),128)),ll.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:O.value.left+O.value.width/2,y:O.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(ll.value),9,Ss)):e.createCommentVNode("",!0),It.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:O.value.top+12+O.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${O.value.top+O.value.height/2})`},e.toDisplayString(It.value),9,Vs)):e.createCommentVNode("",!0)]),Al.value.length>0?(e.openBlock(),e.createElementBlock("g",Ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Al.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":ue.value},[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.x,y1:O.value.bottom,y2:O.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>Nn(l,i),onMouseleave:fn},null,40,Ms)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:O.value.bottom,y2:O.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>Nn(l,i),onMouseleave:fn},null,40,_s)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:O.value.bottom,y2:O.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>Nn(l,i),onMouseleave:fn},null,40,$s)):e.createCommentVNode("",!0)],8,Bs),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,O.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>Nn(l,i),onMouseleave:fn},null,40,Ls)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,O.value.top-10),r:"14",fill:l.hasManual&&l.hasAuto||l.hasManual?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:i=>Nn(l,i),onMouseleave:fn},null,40,Ts),e.createElementVNode("text",{x:l.x,y:Math.max(15,O.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(l.totalCount),9,As)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":ue.value},[Dl.value?(e.openBlock(),e.createElementBlock("g",Hs,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":fl.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yo.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${i}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>sn(l,p),onMouseleave:Wl},null,46,Rs)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>sn(l,p),onMouseleave:Wl},null,46,Is))],64))),128))],2),e.createElementVNode("g",Fs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+2:Ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,zs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rl.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+2:Ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:l.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Ps))),128)),mt.value>0||Le.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ho.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:l.x,cy:l.y,r:U(l.isHighlighted?q(l,mt.value)+2:q(l,mt.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>sn(l,p),onMouseleave:Wl},null,46,Os))),128)):e.createCommentVNode("",!0)])])):Ue.value==="line"?(e.openBlock(),e.createElementBlock("g",qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zo.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:l.path,stroke:l.color,"stroke-width":Ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Nt.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Ws))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+2:Ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Zs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rl.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+2:Ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:l.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Us))),128)),mt.value>0||Le.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Cn.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:l.x,cy:l.y,r:U(l.isHighlighted?q(l,mt.value)+2:q(l,mt.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>sn(l,p),onMouseleave:Wl},null,46,Xs))),128)):e.createCommentVNode("",!0)])):Ue.value==="area"?(e.openBlock(),e.createElementBlock("g",Ys,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zn.value,(l,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${L.chartId}`},[e.createElementVNode("rect",{x:O.value.left-10,y:O.value.top-10,width:O.value.width+20,height:O.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${O.value.width+20}px`})},null,12,Ks)],8,js))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?ee.value+.2:ee.value,mask:`url(#area-mask-${i}-${L.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden})},null,10,Gs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+1:Ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${i*Dt.value}ms`})},null,14,Qs))),128))])):Ue.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":fl.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yo.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${i}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>sn(l,p),onMouseleave:Wl},null,46,Js)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>sn(l,p),onMouseleave:Wl},null,46,er))],64))),128))],2)):e.createCommentVNode("",!0)],8,Ds),te.value&&we.value.show&&!le.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":ue.value},[e.createElementVNode("line",{x1:we.value.x,x2:we.value.x,y1:O.value.top,y2:O.value.bottom,stroke:$e.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,lr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value.data,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:we.value.x,cy:l.y,r:U(mt.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,nr))),128))],8,tr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),sl.value?(e.openBlock(),e.createElementBlock("g",or,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wn.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[l?(e.openBlock(),e.createElementBlock("g",ar,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:U(l.radius),fill:l.color,"fill-opacity":r(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(u(l,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>m(l,p),onMouseleave:p=>M(l),onClick:p=>d(l,p)},null,42,sr),l.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:l.x-l.radius*.65,y:l.y-l.radius*.65,width:l.radius*1.3,height:l.radius*1.3,"xlink:href":l.imageUrl,class:e.normalizeClass(`dss-bubble-image-${i} ${l.isHighlighted?"dss-bubble-highlighted":""} ${l.isDimmed?"dss-bubble-dimmed":""} ${l.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${l.radius*.65}px at ${l.radius*.65}px ${l.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:c(l)}),onLoad:p=>Fo(i),onError:p=>qn(i),onMouseenter:p=>m(l,p),onMouseleave:p=>M(l),onClick:p=>d(l,p)},null,46,rr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),pl.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:ro.value},[Ue.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:wt.value,cy:Mt.value,r:ft.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,cr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":Ue.value,"clip-path":Io.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${l.originalIndex}-${i}`,d:l.segment.path,fill:l.segment.color,"fill-opacity":l.segment.isHighlighted?(l.segment.opacity||.8)+.2:l.segment.opacity||.8,stroke:l.segment.strokeWidth?l.segment.strokeColor||l.segment.color:"none","stroke-width":l.segment.strokeWidth||0,"clip-path":yn(l.originalIndex),class:e.normalizeClass({"dss-series-highlighted":l.segment.isHighlighted,"dss-series-dimmed":l.segment.isDimmed,"dss-series-hidden":l.segment.isHidden}),onMouseover:p=>sn(l.segment,p),onMouseleave:Wl},null,42,dr))),128))],8,ur),Pn.value&&Po.value?(e.openBlock(),e.createElementBlock("g",mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nl.value,(l,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${i}`,x:l.x,y:l.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label",style:e.normalizeStyle({fill:l.contrastColor})},e.toDisplayString(l.value),13,pr)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),wn.value&&(Po.value||$l.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:jl.value.x,y:jl.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Fl.value,fill:bl.value,class:"dss-radial-data-center"},e.toDisplayString(xn.value),9,fr)):e.createCommentVNode("",!0),Zo.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":No.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${i}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":l.isHighlighted,"dss-label-dimmed":l.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${i*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:l.pointerStartX,y1:l.pointerStartY,x2:l.pointerEndX,y2:l.pointerEndY,stroke:l.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":l.pointerLineLength})},null,12,vr),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:l.pointerEndX,y1:l.pointerEndY,x2:l.horizontalEndX,y2:l.horizontalEndY,stroke:l.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":l.horizontalLineLength})},null,12,gr),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":vn.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,hr)],6))),128))],2)):e.createCommentVNode("",!0)],8,ir)):e.createCommentVNode("",!0),Ol.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:ro.value},[Yt.value?(e.openBlock(),e.createElementBlock("g",kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:wt.value,cy:Mt.value,r:U(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,Cr))),128)),e.createElementVNode("g",br,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:wt.value-16,y:Mt.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,wr),e.createElementVNode("text",{x:wt.value,y:Mt.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Oe(i)),9,xr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(De.value,(l,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:wt.value,x2:l.x,y1:Mt.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,Er))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Sr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Se.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:l.x+Math.cos(i*2*Math.PI/G.value-Math.PI/2)*16,y:l.y+Math.sin(i*2*Math.PI/G.value-Math.PI/2)*16,"text-anchor":l.anchor,"dominant-baseline":l.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${i*120}ms`})},e.toDisplayString(l.text.charAt(0).toUpperCase()+l.text.slice(1)),13,Vr))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:ml,onMouseleave:Wl},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ul.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":vl("current",l,i),stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+1:Ze.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${i*Dt.value}ms`,transition:"all 0.2s ease"})},null,14,Nr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.dataPoints,(p,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${i}-${g}`,cx:p.x,cy:p.y,r:U(l.isHighlighted?mt.value+1:mt.value>0?mt.value:0),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${i*Dt.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:w=>sn(p,w),onMouseleave:Wl},null,46,Br))),128))]))),128))],32)],8,yr)):e.createCommentVNode("",!0),e.createElementVNode("g",Mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jt.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:l.x,cy:l.y,r:U(l.width/2),fill:Ot(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,_r))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jt.value,(l,i)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${i}`,x:l.x-l.width/2,y:l.y-l.height/2,width:l.width,height:l.height,"xlink:href":l.url,onLoad:p=>dl(i),onError:p=>en(i),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${i}`),"clip-path":`circle(${l.width/2}px at ${l.width/2}px ${l.height/2}px)`,style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,46,$r))),128))])],8,cs))]),ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:ie.value+"px",height:he.value+"px",backgroundImage:`url('${Ml.value}')`,backgroundRepeat:"no-repeat",...Ct.value,opacity:Te.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(l,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+l.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:l.x+"px",top:l.y+"px",width:Je.value+"px",height:Je.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>Vt(l),["stop"]),onMouseenter:p=>T(l,p),onMouseleave:E},[e.createElementVNode("img",{src:nn(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Tr)],44,Lr)),[[e.vShow,F.value]])),128)),St.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:St.value.x+"px",top:St.value.y+"px"})},[e.createElementVNode("div",Ar,e.toDisplayString(St.value.categoryValue),1),St.value.description?(e.openBlock(),e.createElementBlock("div",Dr,e.toDisplayString(St.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Xt.value&&(ot.value.show||te.value&&we.value.show&&!le.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":te.value&&we.value.show&&!le.value.isZooming,"dss-spider-tooltip":Ol.value&&ot.value.spiderAreas&&ot.value.spiderAreas.length>0}]),style:e.normalizeStyle(pn.value)},[!te.value||!we.value.show||le.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Ol.value&&ot.value.spiderAreas&&ot.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",Hr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value.spiderAreas,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${i}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",Rr,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createTextVNode(" "+e.toDisplayString(l.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.points,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${i}-${g}`,class:"dss-tooltip-series"},[e.createElementVNode("span",Ir,e.toDisplayString(p.label),1),e.createElementVNode("span",Fr,e.toDisplayString(p.value),1)]))),128))]))),128))])):sl.value&&ot.value.bubbleData&&ot.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",zr,[ot.value.title?(e.openBlock(),e.createElementBlock("div",Pr,e.toDisplayString(ot.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Or,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value.bubbleData,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",qr,[e.createElementVNode("div",Wr,e.toDisplayString(ot.value.title),1),e.createElementVNode("div",Zr,e.toDisplayString(ot.value.value),1)])),ot.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[hl(ot.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Ur,[s[5]||(s[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Xr,e.toDisplayString(e.unref(B)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(hl(ot.value.categoryIndex).flagGroups,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",Yr,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",jr,[e.createElementVNode("div",Kr,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),hl(ot.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Gr,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Qr,e.toDisplayString(e.unref(B)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(hl(ot.value.categoryIndex).markers,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",Jr,[e.createElementVNode("div",ei,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",ti,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",li,[e.createElementVNode("div",ni,e.toDisplayString(sl.value?h():L.categories[we.value.categoryIndex]||`Category ${we.value.categoryIndex+1}`),1),sl.value?(e.openBlock(),e.createElementBlock("div",oi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value.data,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(we.value.data,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",ai,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",si,e.toDisplayString(gl(l.value)),1)]))),128))]),hl(we.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",ri,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ii,e.toDisplayString(e.unref(B)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(hl(we.value.categoryIndex).flagGroups,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",ci,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",ui,[e.createElementVNode("div",di,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),hl(we.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",mi,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",pi,e.toDisplayString(e.unref(B)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(hl(we.value.categoryIndex).markers,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",fi,[e.createElementVNode("div",vi,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",gi,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),xl.value&&Ne.value&&le.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:so},[s[9]||(s[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(le.value.scale*100))+"% "+e.toDisplayString(e.unref(B)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Ga),Ge.value&&et.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":$t.value==="horizontal","dss-legend-vertical":$t.value==="vertical","dss-legend-bottom":!0}]),style:{display:"flex","flex-wrap":"wrap","justify-content":"center",padding:"6px 8px 0"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":zt.value.has(i),"dss-legend-hovered":Ce.value===i,"dss-legend-dimmed":Ce.value!==null&&Ce.value!==i}]),onClick:p=>tn(i),onMouseenter:p=>Sn(i),onMouseleave:rn,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Ot(i)})},null,4),e.createElementVNode("span",yi,e.toDisplayString(l.name),1)],46,hi))),128))],2)):e.createCommentVNode("",!0),kt.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:kt.value.x+"px",top:kt.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[Ve.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Ao},e.toDisplayString(e.unref(B)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Ve.value.addMarker&&(Ve.value.downloadSvg||Ve.value.downloadPng||Ve.value.downloadCsv||Tt.value.length>0)?(e.openBlock(),e.createElementBlock("div",ki)):e.createCommentVNode("",!0),Ve.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:cn},e.toDisplayString(e.unref(B)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Ve.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:_l},e.toDisplayString(e.unref(B)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Ve.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:no},e.toDisplayString(e.unref(B)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Tt.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Ve.value.downloadSvg||Ve.value.downloadPng||Ve.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Ci)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[l.separator?(e.openBlock(),e.createElementBlock("div",bi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(lo(l)),style:e.normalizeStyle(On(l)),onClick:p=>Tn(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Bl(l),class:"dss-custom-menu-content"},null,8,xi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",Ei,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,wi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Ie.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:x},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[3]||(s[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Si,[e.createElementVNode("h3",null,e.toDisplayString(yl.value?e.unref(B)("chart.modalMarker.viewMarker"):Kl.value?e.unref(B)("chart.modalMarker.editMarker"):e.unref(B)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:x},"×")]),e.createElementVNode("div",Vi,[e.createElementVNode("div",Ni,[e.createVNode(qo,{id:"dss-marker-date",mode:"single",modelValue:Ie.value.date,"onUpdate:modelValue":s[1]||(s[1]=l=>Ie.value.date=l),"min-date":_n.value,"max-date":Pl.value,disabled:yl.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",Bi,[e.createElementVNode("label",Mi,e.toDisplayString(e.unref(B)("chart.modalMarker.description")),1),yl.value?(e.openBlock(),e.createElementBlock("div",_i,e.toDisplayString(Ie.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=l=>Ie.value.description=l),placeholder:e.unref(B)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,$i)),[[e.vModelText,Ie.value.description]])])]),e.createElementVNode("div",Li,[e.createElementVNode("div",Ti,[Kl.value&&!yl.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:W},e.toDisplayString(e.unref(B)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ai,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:x},e.toDisplayString(yl.value?e.unref(B)("chart.modalMarker.close"):e.unref(B)("chart.modalMarker.cancel")),1),yl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:y,disabled:!(Ie.value.description&&Ie.value.description.length)},e.toDisplayString(Kl.value?e.unref(B)("chart.modalMarker.save"):e.unref(B)("chart.contextMenu.addMarker")),9,Di))])])])])):e.createCommentVNode("",!0)],64))}}),Ii={class:"dss-modal-title"},Fi={class:"dss-modal-actions"},Oo={__name:"DSSModal",props:{showModal:{type:Boolean,required:!0},backDrop:{type:Boolean,default:!0},width:{type:String,default:"800px"},height:{type:String,default:"auto"},showCloseBtn:{type:Boolean,default:!0},headerType:{type:String,default:"space-between"},titleSize:{type:String,default:"24px"}},emits:["close-modal"],setup(L,{emit:ae}){const B=L,_=ae,oe=e.ref(null),z=e.ref(null),$=e.computed(()=>{const j={"max-width":B.width};return B.height!=="auto"&&(j.height=B.height,j["min-height"]="0"),j}),X=e.computed(()=>({}));function Ke(){_("close-modal")}function ve(){B.backDrop&&!oe.value&&_("close-modal")}function f(j){j.target.tagName==="INPUT"&&(oe.value=j.target.tagName)}function be(){setTimeout(()=>{oe.value=null},300)}function ge(){const j=document.body,ue=document.documentElement;z.value={bodyOverflow:j.style.overflow,bodyPosition:j.style.position,bodyTop:j.style.top,bodyWidth:j.style.width,htmlOverflow:ue.style.overflow,scrollY:window.scrollY},j.style.overflow="hidden",j.style.position="fixed",j.style.top=`-${z.value.scrollY}px`,j.style.width="100%",j.style.left="0",ue.style.overflow="hidden"}function ne(){if(!z.value)return;const j=document.body,ue=document.documentElement,{bodyOverflow:H,bodyPosition:ke,bodyTop:Me,bodyWidth:ze,htmlOverflow:lt,scrollY:R}=z.value;j.style.overflow=H||"",j.style.position=ke||"",j.style.top=Me||"",j.style.width=ze||"",j.style.left="",ue.style.overflow=lt||"",window.scrollTo(0,R||0)}return e.watch(()=>B.showModal,j=>{if(j)ge(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const ue=document.getElementById("dss-modal-backdrop");ue&&(ue.addEventListener("focusin",f),ue.addEventListener("focusout",be))},100);else{ne(),document.body.classList.remove("dss-modal-open");const ue=document.getElementById("dss-modal-backdrop");ue&&(ue.removeEventListener("focusin",f),ue.removeEventListener("focusout",be))}},{immediate:!0}),e.onUnmounted(()=>{B.showModal&&ne()}),(j,ue)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:ve},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle($.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:ue[0]||(ue[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":L.headerType,"font-size":L.titleSize})},[e.createElementVNode("h1",Ii,[e.renderSlot(j.$slots,"title",{},()=>[ue[1]||(ue[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(j.$slots,"title-data"),L.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:Ke,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(X.value)},[e.renderSlot(j.$slots,"content",{},()=>[ue[2]||(ue[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Fi,[e.renderSlot(j.$slots,"actions")])])],4),[[e.vShow,L.showModal]])])):e.createCommentVNode("",!0)]))}},zi={key:0,class:"dss-table-toolbar"},Pi={class:"dss-table-toolbar-left"},Oi=["aria-expanded"],qi={class:"dss-pagination-select-dropdown",role:"listbox"},Wi={class:"dss-table-column-visibility-label"},Zi={class:"dss-table-checkbox-wrapper"},Ui=["checked","onChange"],Xi={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Yi={class:"dss-table-column-visibility-text"},ji={class:"dss-table-toolbar-right"},Ki=["placeholder","aria-label"],Gi=["aria-label"],Qi=["aria-label","aria-expanded"],Ji={key:1,class:"dss-table-toolbar-extra"},ec={class:"dss-table-thead"},tc={key:0,class:"dss-table-th dss-table-selection-column"},lc={key:0,class:"dss-table-checkbox-wrapper"},nc=["checked","indeterminate"],oc={key:0,class:"dss-table-checkbox__indeterminate"},ac={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},sc=["aria-label"],rc=["onClick"],ic={class:"dss-table-th-content"},cc={class:"dss-table-th-text"},uc={key:0},dc={key:1},mc={key:2},pc=["data-filter-column-key","aria-expanded","aria-label","onClick"],fc={class:"dss-table-tbody"},vc=["onClick"],gc={class:"dss-table-checkbox-wrapper"},hc=["type","name","checked","onChange"],yc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},kc={key:1,class:"dss-table-checkbox__dot"},Cc=["onClick"],bc=["aria-expanded","aria-label"],wc={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},xc={key:0,class:"dss-table-expansion-row"},Ec=["colspan"],Sc=["colspan"],Vc={key:1,class:"dss-table-pagination"},Nc={class:"dss-table-pagination-left"},Bc={key:0},Mc={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},_c={class:"dss-table-pagination-center"},$c={key:0,class:"dss-pagination-controls"},Lc=["disabled","title"],Tc=["disabled","title"],Ac=["aria-label","onKeydown"],Dc={class:"dss-pagination-of"},Hc=["disabled","title"],Rc=["disabled","title"],Ic={class:"dss-table-pagination-right"},Fc={class:"dss-pagination-rows-label"},zc=["aria-expanded"],Pc=["aria-selected","onClick"],Oc={key:0,class:"dss-table-filter-row"},qc=["value","placeholder"],Wc=["min","max","value"],Zc=["min","max","value"],Uc={class:"dss-table-filter-double-range-values"},Xc={key:2,class:"dss-table-filter-daterange"},Yc={class:"dss-table-filter-daterange-row"},jc={class:"dss-table-filter-daterange-label"},Kc=["value"],Gc={class:"dss-table-filter-daterange-row"},Qc={class:"dss-table-filter-daterange-label"},Jc=["value"],eu=["value","placeholder"],tu={class:"dss-table-filter-list"},lu=["checked","onChange"],nu={class:"dss-table-filter-actions"},ou={name:"DSSTable"},au=Object.assign(ou,{props:{data:{type:Array,required:!0,default:()=>[]},columns:{type:Array,required:!0,default:()=>[]},tableId:{type:String,default:()=>"table-"+Math.random().toString(36).substring(2,9)},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:L=>typeof L=="object"&&L!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(L,{emit:ae}){const{t:B,locale:_}=Gn.useI18n(),oe=L,z=ae,$={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,expandableRowData:null,expandableRowCondition:null,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single"},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100],showCounter:!0,showControlsGroup:!0,showControls:!0,showRowsPerPage:!0},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:null};function X(k,y){const x=Object.assign({},k);return Ke(k)&&Ke(y)&&Object.keys(y).forEach(W=>{Ke(y[W])?W in k?x[W]=X(k[W],y[W]):Object.assign(x,{[W]:y[W]}):Object.assign(x,{[W]:y[W]})}),x}function Ke(k){return k&&typeof k=="object"&&!Array.isArray(k)}const ve=e.computed(()=>X($,oe.options)),f=e.computed(()=>{const k=ve.value.table.width;return k==="auto"?null:typeof k=="number"?k:null}),be=e.computed(()=>ve.value.table.height),ge=e.computed(()=>ve.value.table.rowHeight??"auto"),ne=e.computed(()=>({height:ge.value})),j=e.computed(()=>ve.value.table.expandable===!0),ue=e.computed(()=>ve.value.table.expandableRowData??null),H=e.computed(()=>ve.value.table.expandableRowCondition??null),ke=e.computed(()=>ve.value.table.truncated===!0),Me=e.computed(()=>ve.value.table.striped),ze=e.computed(()=>ve.value.table.bordered),lt=e.computed(()=>ve.value.table.hoverable),R=e.computed(()=>ve.value.table.size),pe=e.computed(()=>ve.value.table.align||"left");e.computed(()=>ve.value.title.text),e.computed(()=>ve.value.subtitle.text);const fe=e.computed(()=>ve.value.selection.enabled),ie=e.computed(()=>ve.value.selection.mode),nt=e.computed(()=>ve.value.sorting.enabled),gt=e.computed(()=>ve.value.sorting.mode),he=e.computed(()=>ve.value.pagination.enabled),yt=e.computed(()=>ve.value.pagination.rows),Ue=e.computed(()=>ve.value.pagination.rowsPerPageOptions),tl=e.computed(()=>ve.value.pagination.showCounter!==!1),st=e.computed(()=>ve.value.pagination.showControlsGroup),xt=e.computed(()=>st.value===!1?!1:ve.value.pagination.showControls!==!1),Ht=e.computed(()=>st.value===!1?!1:ve.value.pagination.showRowsPerPage!==!1),ll=e.computed(()=>he.value&&(tl.value||xt.value||Ht.value)),It=e.computed(()=>ve.value.scrollable),at=e.computed(()=>ve.value.emptyMessage||B("table.emptyMessage")),Et=e.computed(()=>ve.value.toolbar?.downloads?.pdf!==!1),nl=e.computed(()=>ve.value.toolbar?.downloads?.excel!==!1),Ft=e.computed(()=>ve.value.toolbar?.search!==!1),Yt=e.computed(()=>Et.value||nl.value||Ft.value||Ge.value),Ge=e.computed(()=>ve.value.toolbar?.columnVisibility!==!1),et=e.ref(""),$t=e.ref(!1),Xt=e.ref(null);let te=null;function $e(){$t.value?(te&&(clearTimeout(te),te=null),$t.value=!1,et.value="",z("search",""),Xt.value?.blur()):($t.value=!0,te=setTimeout(()=>{te=null,Xt.value?.focus()},80))}function Ne(){et.value||($t.value=!1)}function qe(){et.value="",z("search",""),Xt.value?.focus()}const rt=e.computed(()=>({"dss-table-striped":Me.value,"dss-table-bordered":ze.value,"dss-table-hoverable":lt.value,[`dss-table-${R.value}`]:R.value!=="default","dss-table-truncated":ke.value})),Ze=(k,y)=>k?.field??k?.key??y,Ye=e.ref(new Set);function mt(){const k=new Set;oe.columns.forEach((y,x)=>{y?.hidden!==!0&&k.add(Ze(y,x))}),Ye.value=k}const Le=e.computed(()=>oe.columns.filter((k,y)=>Ye.value.has(Ze(k,y)))),q=k=>{const y=oe.columns.findIndex(x=>x===k);return Ze(k,y>=0?y:0)},U=(k,y)=>Ye.value.has(Ze(k,y));function ee(k,y){const x=Ze(k,y),W=new Set(Ye.value);W.has(x)?W.delete(x):W.add(x),Ye.value=W}const se=e.ref(null),He=e.ref(!1);function it(k){se.value&&!se.value.contains(k.target)&&(He.value=!1)}const bt=e.computed(()=>Le.value.length+(fe.value?1:0)+(j.value?1:0)),Re=(k,y)=>k?.id??k?.key??y,ht=e.ref(new Set),Rt=e.ref(null),jt=(k,y)=>ht.value.has(Re(k,y)),qt=(k,y)=>{if(!j.value)return!1;if(typeof H.value=="function")return!!H.value(k,y);if(typeof ue.value=="string"&&ue.value.trim()){const x=Zt(k,ue.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},Dt=(k,y,x)=>{if(x&&x.stopPropagation(),!qt(k,y))return;const W=Re(k,y),de=new Set(ht.value);de.has(W)?(de.delete(W),z("row-collapse",{data:k,index:y})):(de.add(W),z("row-expand",{data:k,index:y})),ht.value=de},V=(k,y)=>{if(!ke.value)return;const x=Re(k,y);Rt.value!==x&&(Rt.value=x)},C=e.ref(null),S=e.ref(0),K=e.ref([]),Q=k=>{if(gt.value==="single")return C.value===k.field?S.value:0;{const y=K.value.find(x=>x.field===k.field);return y?y.order:0}},Oe=k=>{const y=Q(k);return{"dss-sort-active":y!==0,"dss-sort-asc":y===1,"dss-sort-desc":y===-1}},pt=e.ref({}),Ee=e.ref(null),Ve=e.ref(null),Tt=220,At=e.ref(null),Qe=e.computed(()=>Le.value.find(k=>q(k)===Ee.value)??null),Je=e.computed(()=>{if(!Qe.value||Qe.value.filter!=="range")return null;const k=Qe.value,y=Ee.value,{min:x,max:W}=Ml(k),de=k.filterMin??x,Vt=k.filterMax??W,dt=Z(y),Kt=dt.min??de,ol=dt.max??Vt,il=Vt-de,al=il===0?0:(Kt-de)/il*100,Ql=il===0?100:(ol-de)/il*100;return{rangeMin:de,rangeMax:Vt,currentMin:Kt,currentMax:ol,minPct:al,maxPct:Ql}}),Lt=e.ref(null),gl=e.ref("max");function F(k){const y=Lt.value,x=Je.value;if(!y||!x)return;const W=y.getBoundingClientRect(),Vt=(k.clientX-W.left)/W.width*100,dt=(x.minPct+x.maxPct)/2;gl.value=Vt<dt?"min":"max"}function Z(k){return pt.value[k]??{}}function P(k,y){pt.value={...pt.value,[k]:y}}function ce(k){const y=pt.value[k];return y?y.type==="string"?!!y.value?.trim():y.type==="range"?y.min!=null||y.max!=null:y.type==="dateRange"?!!(y.from||y.to):y.type==="list"?y.selected?.length>0:!1:!1}function Te(k){const y={...pt.value};delete y[k],pt.value=y,Ee.value=null,Ve.value=null}function ct(){if(!Ee.value){Ve.value=null;return}const k=At.value;if(!k)return;const y=k.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Ee.value}"]`);if(!y)return;const x=y.getBoundingClientRect();Ve.value={top:x.bottom+6,left:Math.max(8,x.right-Tt)}}const ut=e.computed(()=>{const k=String(et.value??"").trim().toLowerCase();return k?oe.data.filter(y=>Le.value.some(x=>Ct(nn(y,x)).some(de=>String(de).toLowerCase().includes(k)))):oe.data}),Xe=e.computed(()=>{let k=[...ut.value];const y=(et.value??"").trim().toLowerCase();return y&&(k=k.filter(x=>oe.columns.some(W=>{if(!W||!W.field)return!1;const de=nn(x,W);return String(de??"").toLowerCase().includes(y)}))),Le.value.forEach(x=>{const W=q(x),de=pt.value[W];if(!de)return;const Vt=x.field;if(Vt){if(de.type==="string"&&de.value?.trim()){const dt=de.value.trim().toLowerCase();k=k.filter(Kt=>{const ol=nn(Kt,x);return String(ol??"").toLowerCase().includes(dt)})}else if(de.type==="range")k=k.filter(dt=>{const Kt=Zt(dt,Vt),ol=Number(Kt);return!(Number.isNaN(ol)||de.min!=null&&ol<de.min||de.max!=null&&ol>de.max)});else if(de.type==="dateRange"){const dt=de.from?new Date(de.from).getTime():null,Kt=de.to?new Date(de.to).getTime():null;k=k.filter(ol=>{const il=Zt(ol,Vt),al=il?new Date(il).getTime():NaN;return!(Number.isNaN(al)||dt!=null&&al<dt||Kt!=null&&al>Kt)})}else if(de.type==="list"&&de.selected?.length){const dt=new Set(de.selected);k=k.filter(Kt=>Ct(nn(Kt,x)).some(il=>dt.has(il)))}}}),k});function Ct(k){if(k==null)return[""];if(Array.isArray(k))return k.flatMap(Ct);if(typeof k=="object"){const y=k?.label??k?.name??k?.value??k?.title;return[y!=null?String(y):String(k)]}return[String(k)]}function Wt(k){const y=new Set;return oe.data.forEach(x=>{Ct(nn(x,k)).forEach(de=>y.add(de))}),Array.from(y).sort((x,W)=>String(x).localeCompare(String(W)))}function hl(k,y){if(Ee.value===k){Ee.value=null,Ve.value=null;return}if(Ee.value=k,y?.currentTarget){const x=y.currentTarget.getBoundingClientRect();Ve.value={top:x.bottom+6,left:Math.max(8,x.right-Tt)}}else ct()}function Xl(k,y){P(k,{type:"string",value:y})}function Ml(k){const y=k.field;if(!y)return{min:0,max:100};let x=1/0,W=-1/0;return oe.data.forEach(de=>{const Vt=Zt(de,y),dt=Number(Vt);Number.isNaN(dt)||(x=Math.min(x,dt),W=Math.max(W,dt))}),{min:x===1/0?0:x,max:W===-1/0?100:W}}function Yl(k,y,x){const W={...Z(k),type:"range"},de=x===""?null:Number(x),Vt=de===null||Number.isNaN(de)?null:de;W[y]=Vt,Vt!=null&&(y==="min"&&W.max!=null&&Vt>W.max&&(W.max=Vt),y==="max"&&W.min!=null&&Vt<W.min&&(W.min=Vt)),P(k,W)}function vn(k,y,x){const W={...Z(k),type:"dateRange"};W[y]=x||"",P(k,W)}const gn=e.reactive({});function bn(k,y){gn[k]=y}function zn(k){const y=q(k),x=(gn[y]??"").trim().toLowerCase(),W=Wt(k);return x?W.filter(de=>String(de).toLowerCase().includes(x)):W}function Pn(k,y){return(Z(k).selected??[]).includes(y!=null?String(y):"")}function to(k,y){const W=[...Z(k).selected??[]],de=y!=null?String(y):"",Vt=W.indexOf(de);Vt>=0?W.splice(Vt,1):W.push(de),P(k,{type:"list",selected:W})}function wn(k){Ee.value&&!k.target.closest(".dss-table-filter-wrap")&&!k.target.closest(".dss-table-filter-dropdown")&&(Ee.value=null,Ve.value=null)}function xn(){ct(),Al.value&&El()}const Fl=k=>{if(!(k.sortable===!1||!nt.value))if(gt.value==="single")C.value===k.field?S.value=S.value===1?-1:S.value===-1?0:1:(C.value=k.field,S.value=1),S.value===0&&(C.value=null),z("sort",{field:C.value,order:S.value});else{const y=K.value.findIndex(x=>x.field===k.field);y>=0?K.value[y].order===1?K.value[y].order=-1:K.value.splice(y,1):K.value.push({field:k.field,order:1}),z("sort",{multiSortMeta:K.value})}},jl=e.computed(()=>{if(!nt.value)return Xe.value;let k=[...Xe.value];return gt.value==="single"&&C.value&&S.value!==0?k.sort((y,x)=>{const W=Zt(y,C.value),de=Zt(x,C.value);return W===de?0:W==null?1:de==null?-1:(W<de?-1:W>de?1:0)*S.value}):gt.value==="multiple"&&K.value.length>0&&k.sort((y,x)=>{for(const W of K.value){const de=Zt(y,W.field),Vt=Zt(x,W.field);if(de===Vt)continue;if(de==null)return 1;if(Vt==null)return-1;const dt=de<Vt?-1:de>Vt?1:0;if(dt!==0)return dt*W.order}return 0}),k}),bl=e.ref(0),Nl=e.ref(yt.value),Al=e.ref(!1),zl=e.ref(null),Bn=e.ref(null),Mn=e.ref("bottom"),En=e.ref(null),zt=k=>{Nl.value=k,Al.value=!1,bl.value=0,z("page",{page:0,rows:Nl.value})};function Ce(k){zl.value&&!zl.value.contains(k.target)&&(Al.value=!1)}function El(){const k=zl.value,y=Bn.value;if(!k||!y)return;const x=k.querySelector(".dss-pagination-select-dropdown");if(!x)return;const W=y.getBoundingClientRect(),de=x.offsetHeight||0,dt=(window.innerHeight||document.documentElement.clientHeight)-W.bottom,Kt=W.top;Mn.value=dt<de+8&&Kt>dt?"top":"bottom",En.value={width:`${Math.ceil(W.width)}px`,left:`${Math.max(0,Math.round(y.offsetLeft))}px`}}const ot=e.computed(()=>jl.value.length),St=e.computed(()=>Math.ceil(ot.value/Nl.value)),we=e.computed(()=>Math.max(St.value,1)),kt=e.computed(()=>ot.value===0?0:tt.value+1),le=e.computed(()=>Ie.value),tt=e.computed(()=>he.value?bl.value*Nl.value:0),Ie=e.computed(()=>he.value?Math.min((bl.value+1)*Nl.value,ot.value):ot.value),_n=e.computed(()=>{if(!he.value)return jl.value;const k=tt.value,y=Ie.value;return jl.value.slice(k,y)}),Pl=e.ref(new Set),Kl=e.computed(()=>jl.value.filter((k,y)=>Pl.value.has(Re(k,y)))),yl=e.computed(()=>{const k=jl.value.length;return k>0&&Pl.value.size===k}),Sn=e.computed(()=>{const k=jl.value.length,y=Pl.value.size;return y>0&&y<k}),rn=(k,y)=>Pl.value.has(Re(k,y)),Gl=()=>{if(yl.value)Pl.value=new Set,z("unselect-all");else{const k=new Set;jl.value.forEach((y,x)=>k.add(Re(y,x))),Pl.value=k,z("select-all",Kl.value)}},wl=(k,y)=>{const x=Re(k,y),W=new Set(Pl.value),de=W.has(x);ie.value==="single"?de?(W.delete(x),z("row-unselect",k)):(W.clear(),W.add(x),z("row-select",k)):de?(W.delete(x),z("row-unselect",k)):(W.add(x),z("row-select",k)),Pl.value=W},ln=e.ref("1"),Pt=()=>{const k=Number.parseInt(String(ln.value),10);if(!Number.isFinite(k)){ln.value=String(bl.value+1);return}const y=Math.min(we.value,Math.max(1,k));y!==bl.value+1?Bl(y-1):ln.value=String(y)},Bl=k=>{k<0||k>=St.value||(bl.value=k,z("page",{page:k,rows:Nl.value}))},lo=(k,y,x)=>{z("row-click",{data:k,index:y,originalEvent:x}),V(k,tt.value+y)},On=(k,y)=>{const x=tt.value+y;return{"dss-table-row-selected":rn(k,x),"dss-table-row-even":y%2===0,"dss-table-row-odd":y%2!==0,"dss-table-row-truncated-clickable":ke.value,"dss-table-row-truncated-expanded":Rt.value===Re(k,x)}},nn=(k,y)=>y.field?Zt(k,y.field):"",Zt=(k,y)=>y.split(".").reduce((x,W)=>x&&x[W],k),$n=k=>{const y=k.align??pe.value;return{"dss-table-sortable":k.sortable!==!1&&nt.value,"dss-table-align-left":y==="left","dss-table-align-center":y==="center","dss-table-align-right":y==="right",[k.className]:k.className}},Ln=k=>{const y={};return k.width&&(y.width=typeof k.width=="number"?`${k.width}px`:k.width),k.minWidth&&(y.minWidth=typeof k.minWidth=="number"?`${k.minWidth}px`:k.minWidth),k.maxWidth&&(y.maxWidth=typeof k.maxWidth=="number"?`${k.maxWidth}px`:k.maxWidth),y};return e.watch(()=>oe.locale,k=>{k&&k!==_.value&&(_.value=k)},{immediate:!0}),e.watch(yt,k=>{Nl.value=k,bl.value=0}),e.watch(Al,async k=>{k&&(await e.nextTick(),El())}),e.watch(bl,k=>{ln.value=String(k+1)},{immediate:!0}),e.watch(et,k=>{z("search",k??"")}),e.watch(()=>oe.columns,()=>{mt()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Ce),document.addEventListener("click",it),document.addEventListener("click",wn),window.addEventListener("resize",xn),window.addEventListener("scroll",xn,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Ce),document.removeEventListener("click",it),document.removeEventListener("click",wn),window.removeEventListener("resize",xn),window.removeEventListener("scroll",xn,!0)}),(k,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:At,style:e.normalizeStyle({width:f.value+"px",height:be.value?be.value+"px":"auto"})},[Yt.value?(e.openBlock(),e.createElementBlock("div",zi,[e.createElementVNode("div",Pi,[Et.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:y[0]||(y[0]=x=>z("download-pdf"))},[y[22]||(y[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(B)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),nl.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:y[1]||(y[1]=x=>z("download-excel"))},[y[23]||(y[23]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(B)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Ge.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:se},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":He.value}]),onClick:y[2]||(y[2]=x=>He.value=!He.value),"aria-expanded":He.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(B)("table.columnVisibility"))+" ",1),y[24]||(y[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Oi),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",qi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.columns,(x,W)=>(e.openBlock(),e.createElementBlock("li",{key:Ze(x,W),role:"option",class:"dss-table-column-visibility-option",onClick:y[3]||(y[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Wi,[e.createElementVNode("span",Zi,[e.createElementVNode("input",{type:"checkbox",checked:U(x,W),onChange:de=>ee(x,W),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ui),U(x,W)?(e.openBlock(),e.createElementBlock("span",Xi,[...y[25]||(y[25]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",Yi,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,He.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ji,[Ft.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":$t.value||et.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:Xt,"onUpdate:modelValue":y[4]||(y[4]=x=>et.value=x),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(B)("table.searchPlaceholder"),"aria-label":e.unref(B)("table.searchTableAriaLabel"),onFocus:y[5]||(y[5]=x=>$t.value=!0),onBlur:Ne},null,40,Ki),[[e.vModelText,et.value]]),et.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(B)("table.clearSearchAriaLabel"),onClick:qe},[...y[26]||(y[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,Gi)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(B)("table.searchAriaLabel"),"aria-expanded":$t.value||!!et.value,onMousedown:e.withModifiers($e,["prevent"])},[...y[27]||(y[27]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,Qi)],2)):e.createCommentVNode("",!0),k.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Ji,[e.renderSlot(k.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":It.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",rt.value])},[e.createElementVNode("thead",ec,[e.createElementVNode("tr",null,[fe.value?(e.openBlock(),e.createElementBlock("th",tc,[ie.value==="multiple"?(e.openBlock(),e.createElementBlock("span",lc,[e.createElementVNode("input",{type:"checkbox",checked:yl.value,indeterminate:Sn.value,onChange:Gl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,nc),Sn.value?(e.openBlock(),e.createElementBlock("span",oc)):yl.value?(e.openBlock(),e.createElementBlock("span",ac,[...y[28]||(y[28]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),j.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(B)("table.expandRowAriaLabel")},null,8,sc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value,(x,W)=>(e.openBlock(),e.createElementBlock("th",{key:q(x),class:e.normalizeClass(["dss-table-th",$n(x)]),style:e.normalizeStyle(Ln(x)),onClick:de=>Fl(x)},[e.createElementVNode("div",ic,[e.createElementVNode("span",cc,e.toDisplayString(x.header),1),x.sortable!==!1&&nt.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Oe(x)])},[Q(x)===0?(e.openBlock(),e.createElementBlock("span",uc,[...y[29]||(y[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):Q(x)===1?(e.openBlock(),e.createElementBlock("span",dc,[...y[30]||(y[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):Q(x)===-1?(e.openBlock(),e.createElementBlock("span",mc,[...y[31]||(y[31]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),x.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Ee.value===q(x)}]),onClick:y[6]||(y[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":ce(q(x))}]),"data-filter-column-key":q(x),"aria-expanded":Ee.value===q(x),"aria-label":e.unref(B)("table.filterColumnAriaLabel"),onClick:de=>hl(q(x),de)},[...y[32]||(y[32]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,pc)],2)):e.createCommentVNode("",!0)])],14,rc))),128))])]),e.createElementVNode("tbody",fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_n.value,(x,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Re(x,tt.value+W)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",On(x,W)]),style:e.normalizeStyle(ne.value),onClick:de=>lo(x,W,de)},[fe.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:y[7]||(y[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",gc,[e.createElementVNode("input",{type:ie.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${L.tableId}`,checked:rn(x,tt.value+W),onChange:de=>wl(x,tt.value+W),class:e.normalizeClass(["dss-table-checkbox",ie.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,hc),ie.value==="multiple"&&rn(x,tt.value+W)?(e.openBlock(),e.createElementBlock("span",yc,[...y[33]||(y[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):ie.value==="single"&&rn(x,tt.value+W)?(e.openBlock(),e.createElementBlock("span",kc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),j.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(de=>Dt(x,tt.value+W,de),["stop"])},[qt(x,tt.value+W)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":jt(x,tt.value+W),"aria-label":jt(x,tt.value+W)?e.unref(B)("table.collapseRowAriaLabel"):e.unref(B)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":jt(x,tt.value+W)}]),"aria-hidden":"true"},[...y[34]||(y[34]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,bc)):(e.openBlock(),e.createElementBlock("span",wc))],8,Cc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value,(de,Vt)=>(e.openBlock(),e.createElementBlock("td",{key:q(de),class:e.normalizeClass(["dss-table-td",$n(de)]),style:e.normalizeStyle(Ln(de))},[e.renderSlot(k.$slots,`cell-${de.field}`,{data:x,column:de,rowIndex:W,isExpanded:Rt.value===Re(x,tt.value+W)},()=>[e.createTextVNode(e.toDisplayString(nn(x,de)),1)])],6))),128))],14,vc),j.value&&qt(x,tt.value+W)&&jt(x,tt.value+W)?(e.openBlock(),e.createElementBlock("tr",xc,[e.createElementVNode("td",{colspan:bt.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(k.$slots,"expansion",{data:x,rowIndex:W})],8,Ec)])):e.createCommentVNode("",!0)],64))),128)),_n.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(ne.value)},[e.createElementVNode("td",{colspan:bt.value,class:"dss-table-empty-cell"},[e.renderSlot(k.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(at.value),1)])],8,Sc)],4))])],2)],2),ll.value?(e.openBlock(),e.createElementBlock("div",Vc,[e.createElementVNode("div",Nc,[tl.value?(e.openBlock(),e.createElementBlock("span",Bc,e.toDisplayString(e.unref(B)("table.showingRange",{start:kt.value,end:le.value,total:ot.value})),1)):(e.openBlock(),e.createElementBlock("span",Mc," "))]),e.createElementVNode("div",_c,[xt.value?(e.openBlock(),e.createElementBlock("div",$c,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:bl.value===0,onClick:y[8]||(y[8]=x=>Bl(0)),title:e.unref(B)("table.firstPage")},[...y[35]||(y[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Lc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:bl.value===0,onClick:y[9]||(y[9]=x=>Bl(bl.value-1)),title:e.unref(B)("table.previousPage")}," ‹ ",8,Tc),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[10]||(y[10]=x=>ln.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(B)("table.currentPageAriaLabel"),onBlur:Pt,onKeydown:e.withKeys(e.withModifiers(Pt,["prevent"]),["enter"])},null,40,Ac),[[e.vModelText,ln.value]]),e.createElementVNode("span",Dc,e.toDisplayString(e.unref(B)("table.ofPages",{total:we.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:bl.value>=St.value-1,onClick:y[11]||(y[11]=x=>Bl(bl.value+1)),title:e.unref(B)("table.nextPage")}," › ",8,Hc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:bl.value>=St.value-1,onClick:y[12]||(y[12]=x=>Bl(St.value-1)),title:e.unref(B)("table.lastPage")},[...y[36]||(y[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Rc)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ic,[Ht.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:zl},[e.createElementVNode("span",Fc,e.toDisplayString(e.unref(B)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Al.value}]),onClick:y[13]||(y[13]=x=>Al.value=!Al.value),"aria-expanded":Al.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:Bn},[e.createTextVNode(e.toDisplayString(Nl.value)+" ",1),y[37]||(y[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,zc),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",{class:e.normalizeClass(["dss-pagination-select-dropdown",{"dss-pagination-select-dropdown--top":Mn.value==="top"}]),style:e.normalizeStyle(En.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===Nl.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===Nl.value}]),onClick:W=>zt(x)},e.toDisplayString(x),11,Pc))),128))],6),[[e.vShow,Al.value]])]),_:1})],512)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],4),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"dss-table-filter-dropdown dss-table-filter-dropdown--teleport",style:e.normalizeStyle(Ve.value?{top:Ve.value.top+"px",left:Ve.value.left+"px",width:Tt+"px"}:void 0),onClick:y[21]||(y[21]=e.withModifiers(()=>{},["stop"]))},[Qe.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Qe.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Oc,[e.createElementVNode("input",{type:"text",value:Z(Ee.value).value??"",onInput:y[14]||(y[14]=x=>Xl(Ee.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(B)("table.search")},null,40,qc)])):Qe.value.filter==="range"&&Je.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Je.value.minPct+"%","--range-max-pct":Je.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Lt,class:"dss-table-filter-double-range-track",onMousemove:F,onMouseenter:F},[e.createElementVNode("input",{type:"range",min:Je.value.rangeMin,max:Je.value.rangeMax,value:Je.value.currentMin,onInput:y[15]||(y[15]=x=>Yl(Ee.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:gl.value==="min"?2:1})},null,44,Wc),e.createElementVNode("input",{type:"range",min:Je.value.rangeMin,max:Je.value.rangeMax,value:Je.value.currentMax,onInput:y[16]||(y[16]=x=>Yl(Ee.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:gl.value==="max"?2:1})},null,44,Zc)],544),e.createElementVNode("div",Uc,e.toDisplayString(Je.value.currentMin)+" – "+e.toDisplayString(Je.value.currentMax),1)],4)):Qe.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Xc,[e.createElementVNode("div",Yc,[e.createElementVNode("label",jc,e.toDisplayString(e.unref(B)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:Z(Ee.value).from??"",onInput:y[17]||(y[17]=x=>vn(Ee.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Kc)]),e.createElementVNode("div",Gc,[e.createElementVNode("label",Qc,e.toDisplayString(e.unref(B)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:Z(Ee.value).to??"",onInput:y[18]||(y[18]=x=>vn(Ee.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Jc)])])):Qe.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:gn[Ee.value]??"",onInput:y[19]||(y[19]=x=>bn(Ee.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(B)("table.search")},null,40,eu),e.createElementVNode("div",tu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zn(Qe.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:Pn(Ee.value,x),onChange:W=>to(Ee.value,x)},null,40,lu),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",nu,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:y[20]||(y[20]=x=>Te(Ee.value))},e.toDisplayString(e.unref(B)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Ee.value&&Qe.value&&Ve.value]])]),_:1})]))],64))}}),su="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M6.008%2014V12.68H8.288V6.572L5.996%208.276V6.692L8.012%205.24H9.788V12.68H11.624V14H6.008Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",ru="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M5.948%2014V12.548L8.684%209.8C9.068%209.408%209.352%209.056%209.536%208.744C9.72%208.424%209.812%208.096%209.812%207.76C9.812%207.352%209.7%207.036%209.476%206.812C9.252%206.58%208.948%206.464%208.564%206.464C8.14%206.464%207.808%206.588%207.568%206.836C7.328%207.076%207.208%207.412%207.208%207.844H5.708C5.716%207.284%205.836%206.804%206.068%206.404C6.308%205.996%206.644%205.68%207.076%205.456C7.508%205.232%208.012%205.12%208.588%205.12C9.14%205.12%209.62%205.224%2010.028%205.432C10.436%205.64%2010.752%205.932%2010.976%206.308C11.2%206.684%2011.312%207.132%2011.312%207.652C11.312%208.188%2011.172%208.712%2010.892%209.224C10.62%209.728%2010.18%2010.272%209.572%2010.856L7.748%2012.644H11.42V14H5.948Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",iu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.516%2014.12C7.948%2014.12%207.452%2014.016%207.028%2013.808C6.612%2013.6%206.288%2013.308%206.056%2012.932C5.824%2012.556%205.708%2012.112%205.708%2011.6H7.22C7.22%2011.992%207.332%2012.3%207.556%2012.524C7.788%2012.74%208.112%2012.848%208.528%2012.848C8.944%2012.848%209.264%2012.736%209.488%2012.512C9.712%2012.288%209.824%2011.984%209.824%2011.6V10.916C9.824%2010.524%209.712%2010.22%209.488%2010.004C9.264%209.78%208.944%209.668%208.528%209.668H7.544V8.312L9.476%206.524H6.104V5.24H11V6.596L8.528%208.864V8.384C9.392%208.384%2010.076%208.612%2010.58%209.068C11.084%209.524%2011.336%2010.14%2011.336%2010.916V11.6C11.336%2012.112%2011.22%2012.556%2010.988%2012.932C10.756%2013.308%2010.428%2013.6%2010.004%2013.808C9.58%2014.016%209.084%2014.12%208.516%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",cu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M9.68%2014V12.26H5.78V10.088L9.152%205.24H10.832L7.22%2010.484V10.94H9.68V8.96H11.18V14H9.68Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",uu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.588%2014.12C7.78%2014.12%207.132%2013.92%206.644%2013.52C6.156%2013.112%205.888%2012.56%205.84%2011.864H7.34C7.372%2012.168%207.492%2012.404%207.7%2012.572C7.916%2012.732%208.212%2012.812%208.588%2012.812C9.004%2012.812%209.32%2012.704%209.536%2012.488C9.752%2012.264%209.86%2011.956%209.86%2011.564V10.712C9.86%2010.312%209.752%2010.008%209.536%209.8C9.32%209.584%209.004%209.476%208.588%209.476C8.332%209.476%208.112%209.528%207.928%209.632C7.744%209.736%207.604%209.88%207.508%2010.064H6.044L6.104%205.24H11.036V6.596H7.52L7.496%209.14H7.844L7.484%209.44C7.484%209.072%207.628%208.784%207.916%208.576C8.212%208.36%208.608%208.252%209.104%208.252C9.816%208.244%2010.368%208.46%2010.76%208.9C11.16%209.332%2011.36%209.936%2011.36%2010.712V11.564C11.36%2012.356%2011.112%2012.98%2010.616%2013.436C10.128%2013.892%209.452%2014.12%208.588%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",du="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.6%2014.12C8.016%2014.12%207.5%2014%207.052%2013.76C6.612%2013.512%206.268%2013.168%206.02%2012.728C5.78%2012.28%205.66%2011.764%205.66%2011.18C5.66%2010.764%205.728%2010.328%205.864%209.872C6.008%209.416%206.204%208.988%206.452%208.588L8.516%205.24H10.184L7.592%209.32L7.664%209.368C7.824%209.12%208.04%208.932%208.312%208.804C8.584%208.676%208.888%208.612%209.224%208.612C9.696%208.612%2010.104%208.724%2010.448%208.948C10.792%209.172%2011.06%209.484%2011.252%209.884C11.444%2010.284%2011.54%2010.752%2011.54%2011.288C11.54%2011.856%2011.416%2012.352%2011.168%2012.776C10.928%2013.2%2010.588%2013.532%2010.148%2013.772C9.716%2014.004%209.2%2014.12%208.6%2014.12ZM8.6%2012.848C9.04%2012.848%209.396%2012.708%209.668%2012.428C9.94%2012.14%2010.076%2011.768%2010.076%2011.312C10.076%2010.84%209.94%2010.464%209.668%2010.184C9.396%209.896%209.04%209.752%208.6%209.752C8.16%209.752%207.804%209.896%207.532%2010.184C7.26%2010.464%207.124%2010.84%207.124%2011.312C7.124%2011.768%207.26%2012.14%207.532%2012.428C7.804%2012.708%208.16%2012.848%208.6%2012.848Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",mu={class:"dss-toolbar-left"},pu=["title"],fu=["title"],vu={class:"dss-toolbar-dropdown-wrapper"},gu=["title"],hu=["src"],yu=["src"],ku=["src"],Cu=["src"],bu=["src"],wu=["src"],xu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Eu=["src"],Su=["src"],Vu=["src"],Nu=["src"],Bu=["src"],Mu=["src"],_u=["title"],$u=["title"],Lu=["title"],Tu=["title"],Au=["title"],Du=["title"],Hu=["title"],Ru=["title"],Iu=["title"],Fu={key:2,class:"dss-toolbar-separator"},zu=["title"],Pu={key:4,class:"dss-toolbar-separator"},Ou={key:5,class:"dss-toolbar-dropdown-wrapper"},qu=["title"],Wu={class:"dss-toolbar-dropdown-ai"},Zu={class:"dss-toolbar-right"},Uu={key:0,class:"dss-toolbar-custom-group"},Xu={key:1,class:"dss-toolbar-separator"},Yu={class:"dss-link-modal-content"},ju={class:"dss-link-modal-field"},Ku={class:"dss-link-modal-label"},Gu=["placeholder"],Qu={class:"dss-link-modal-field"},Ju={class:"dss-link-modal-label"},ed=["placeholder"],td={class:"dss-image-modal-tabs"},ld={key:0,class:"dss-image-tab-content"},nd={class:"dss-link-modal-content"},od={class:"dss-link-modal-field"},ad={key:0,class:"dss-link-modal-label"},sd=["src"],rd={class:"dss-link-modal-field"},id={class:"dss-link-modal-label"},cd=["placeholder"],ud={class:"dss-link-modal-field"},dd={class:"dss-link-modal-label"},md=["placeholder"],pd={class:"dss-link-modal-field"},fd={class:"dss-link-modal-label"},vd=["placeholder"],gd={key:1,class:"dss-image-tab-content"},hd={class:"dss-link-modal-content"},yd={class:"dss-link-modal-field"},kd={class:"dss-link-modal-label"},Cd=["placeholder"],bd={class:"dss-link-modal-field"},wd={class:"dss-link-modal-label"},xd=["placeholder"],Ed={class:"dss-link-modal-field"},Sd={class:"dss-link-modal-label"},Vd=["placeholder"],Nd={class:"dss-link-modal-field"},Bd={class:"dss-link-modal-label"},Md=["placeholder"],_d={class:"dss-text-editor-title-input-container"},$d={key:0,class:"dss-text-editor-title-preview"},Ld={key:0},Td={key:1,class:"dss-text-editor-preview-placeholder"},Ad=["value","placeholder","disabled"],Dd={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},Hd={class:"dss-text-editor-description-input-container"},Rd={key:0,class:"dss-text-editor-description-preview"},Id={key:0},Fd={key:1,class:"dss-text-editor-preview-placeholder"},zd=["value","placeholder","disabled"],Pd={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},Od=["data-comment-id","onMouseenter"],qd=["onClick"],Wd=["src","alt"],Zd={key:1},Ud=["onClick"],Xd=["src","alt"],Yd={key:1},jd=["data-has-second-user","onClick"],Kd={class:"editor-comment-marker-count"},Gd={key:4,class:"dss-text-editor-textarea-wrapper"},Qd=["value","placeholder","rows","disabled"],Jd={class:"dss-text-editor-footer"},e1={class:"dss-text-editor-footer-content"},t1={class:"dss-text-editor-footer-stat"},l1={class:"dss-text-editor-footer-stat"},n1={key:5,class:"dss-text-editor-content-wrapper"},o1={key:0,class:"dss-comment-overlay-body"},a1={class:"dss-comment-selection-wrapper"},s1=["innerHTML"],r1={class:"dss-comment-messages-wrapper"},i1={key:0,class:"dss-comment-avatar-wrapper"},c1={class:"dss-comment-avatar"},u1=["src","alt"],d1={key:1},m1={class:"dss-comment-header"},p1={class:"dss-comment-header-text"},f1={class:"dss-comment-author"},v1={key:0,class:"dss-comment-date"},g1=["onClick","title"],h1={class:"dss-comment-overlay-inner"},y1=["placeholder","onKeydown"],k1={class:"dss-text-editor-footer"},C1={class:"dss-text-editor-footer-content"},b1={class:"dss-text-editor-footer-stat"},w1={class:"dss-text-editor-footer-stat"},x1=["title"],E1=["title"],S1={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},V1={class:"dss-image-popup-content"},N1={key:0,class:"dss-image-popup-no-alt-icon"},B1=["title"],M1=["title"],_1={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},$1={class:"dss-toolbar-left"},L1=["title"],T1=["title"],A1={class:"dss-toolbar-dropdown-wrapper"},D1=["title"],H1=["src"],R1=["src"],I1=["src"],F1=["src"],z1=["src"],P1=["src"],O1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},q1=["title"],W1=["title"],Z1=["title"],U1=["title"],X1=["title"],Y1=["title"],j1=["title"],K1=["title"],G1=["title"],Q1=["title"],J1={key:2,class:"dss-toolbar-separator"},e2={key:3,class:"dss-toolbar-dropdown-wrapper"},t2=["title"],l2={class:"dss-toolbar-dropdown-ai"},n2={key:0,class:"dss-toolbar-right"},o2={key:0,class:"dss-toolbar-separator"},a2={key:0,class:"dss-toolbar-custom-group"},s2={key:1,class:"dss-toolbar-separator"},r2={name:"DSSTextEditor"},i2=Object.assign(r2,{props:{modelValue:{type:String,default:""},title:{type:String,default:""},description:{type:String,default:""},titlePlaceholder:{type:String,default:null},descriptionPlaceholder:{type:String,default:null},placeholder:{type:String,default:null},rows:{type:Number,default:10},fullHeight:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},richText:{type:Boolean,default:!1},border:{type:Boolean,default:!0},rounded:{type:Boolean,default:!1},fixedHeight:{type:Boolean,default:!1},options:{type:Object,default:()=>({}),validator:L=>typeof L=="object"&&L!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:L=>typeof L=="object"&&L!==null},locale:{type:String,default:null},comments:{type:Array,default:()=>[]}},emits:["update:modelValue","update:title","update:description","update:comments","change","blur","title-change","description-change","comment-submitted","comment-marker-clicked","comment-deleted"],setup(L,{expose:ae,emit:B}){const{t:_,locale:oe}=Gn.useI18n(),z={h1:su,h2:ru,h3:iu,h4:cu,h5:uu,h6:du},$=L,X=B,Ke=e.useSlots(),ve=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
99
99
  <path d="M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z" fill="#c13340"/>
100
- </svg>`,f=e.ref(null),be=e.ref(null),fe=e.ref(!1),ne=e.ref(!1),j=e.ref(!1),ue=e.ref(""),H=e.ref({}),ke=e.ref(!1),Me=e.ref(!1),ze=e.ref(""),tt=e.ref(""),R=e.ref(null),ge=e.ref(null),ve=e.ref(null),ie=e.ref(null),lt=e.ref(""),gt=e.ref(!1),he=e.ref({}),yt=e.ref(!1),qe=e.ref({}),tl=e.ref(null),at=e.ref(null),Et=e.ref(!1),Ht=e.ref(""),ll=e.ref(null),It=e.ref(""),ot=e.ref(""),St=e.ref(""),nl=e.ref(null),Ft=e.ref(null),Yt=e.ref(null),Ge=e.ref(null),Je=e.ref(null),Lt=e.ref(!1),Xt=e.ref(""),te=e.ref({}),$e=e.ref(!1),Ne=e.ref("upload"),Oe=e.ref(""),st=e.ref(null),Ze=e.ref(null),Ye=e.ref([]),dt=e.ref([]),Le=e.ref(null),W=e.ref(!1),U=e.ref(""),ee=e.ref(""),se=e.ref(""),He=e.ref(""),rt=e.ref(""),bt=e.ref(""),Re=e.ref(null),ht=e.ref(null),Rt=e.ref(null),jt=e.ref(!1),Wt=e.ref(null),At=e.ref(!1),V=e.ref(!1),C=e.ref(null),S=e.ref("p"),K=e.ref(!1),Q=e.ref([]),Ue=e.ref(null),mt=e.ref(null),Ee=e.ref(null),Ve=e.ref(!1),Tt=e.ref(0),Dt=100,Qe=e.ref(null),pt=e.computed(()=>({"dss-text-editor-no-border":!$.border,"dss-text-editor-rounded":$.rounded,"dss-text-editor-full-height":$.fullHeight,"dss-comment-overlay-open":ut.value!==null})),wt=e.computed(()=>({})),gl=e.computed(()=>!$.fixedHeight||$.fullHeight?{}:{height:`${1.6*14*$.rows+24+2}px`,resize:"none",overflowY:"auto"}),F=e.computed(()=>!$.fixedHeight||$.fullHeight?{}:{height:`${1.6*14*$.rows+32}px`,overflowY:"auto"}),q=e.computed(()=>$.richText&&dt.value.length>0),P=e.computed(()=>{if(!$.modelValue)return"";if($.richText){let o=$.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/&nbsp;/g," "),o=o.replace(/&amp;/g,"&"),o=o.replace(/&lt;/g,"<"),o=o.replace(/&gt;/g,">"),o=o.replace(/&quot;/g,'"'),o=o.replace(/&#39;/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return $.modelValue}),ce=e.computed(()=>{const o=P.value.trim();return o?o.split(/\s+/).filter(n=>n.length>0).length:0}),Te=e.computed(()=>P.value.length),it=e.computed(()=>Ge.value!==null&&Ne.value==="upload"&&It.value&&It.value.startsWith("data:")),ct=e.computed(()=>$.titlePlaceholder||_("textEditor.placeholders.title")),Xe=e.computed(()=>$.descriptionPlaceholder||_("textEditor.placeholders.description")),Ct=e.computed(()=>$.placeholder||_("textEditor.placeholders.startTyping")),Zt=o=>Ke&&Ke[o]!==void 0,hl=o=>{for(let n=o+1;n<$.customToolbarSlots.length;n++)if(Zt($.customToolbarSlots[n]))return!0;return!1},Xl=o=>{for(let n=o+1;n<$.customToolbarSlots.length;n++){const a=$.customToolbarSlots[n];if(Zt(a)&&Ml(a))return!0}return!1},Ml=o=>$.customToolbarFloatingMap.hasOwnProperty(o)?$.customToolbarFloatingMap[o]===!0:!0,Yl=e.computed(()=>$.customToolbarSlots.some(o=>Zt(o)&&Ml(o))),vn=e.computed(()=>Zt("title-slot")),gn=e.computed(()=>Zt("description-slot")),bn=o=>{if(!o||o.trim()==="")return"<html></html>";const n=o.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?o:`<html>${o}</html>`},zn=o=>{if(!o||o.trim()==="")return"";const n=o.replace(/<!--[\s\S]*?-->/g,""),a=n.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():n},Pn=o=>{if(!o)return;const n=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),a=[];let r=n.nextNode();for(;r;)a.push(r),r=n.nextNode();a.forEach(c=>c.remove())},to=o=>{try{const n=String(o.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],c=o.getFullYear();return`${n} ${r} ${c}`}catch{return""}},wn=o=>{if(!o||typeof o!="string")return!1;const n=o.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const c=_("textEditor.started_conversation");if(c&&n===c)return!0}catch{}const r=n.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},xn=o=>{const n=o.target.value;X("update:modelValue",n),X("change",n)},Fl=()=>{if(!Re.value)return;const o=Re.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const a=o.scrollHeight;o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},jl=()=>{At.value=!0,Fl()},bl=()=>{At.value=!1,Nl()},Nl=()=>{if(!Re.value)return;const o=Re.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const n=o.value;o.value="M";const a=o.scrollHeight;o.value=n,o.offsetHeight,o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},Al=o=>{const a=o.target.value;At.value&&Fl(),X("update:title",a),X("title-change",a),Rt.value="title",$.richText&&(W.value||(ee.value=U.value,rt.value=se.value,bt.value=He.value),Le.value&&clearTimeout(Le.value),W.value=!0,Le.value=setTimeout(()=>{W.value=!1,Vt()},500))},zl=()=>{if(!ht.value)return;const o=ht.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const a=o.scrollHeight;o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},Bn=()=>{V.value=!0,zl()},Mn=()=>{V.value=!1,En()},En=()=>{if(!ht.value)return;const o=ht.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const n=o.value;o.value="M";const a=o.scrollHeight;o.value=n,o.offsetHeight,o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},zt=o=>{const a=o.target.value;V.value&&zl(),X("update:description",a),X("description-change",a),Rt.value="description",$.richText&&(W.value||(ee.value=U.value,rt.value=se.value,bt.value=He.value),Le.value&&clearTimeout(Le.value),W.value=!0,Le.value=setTimeout(()=>{W.value=!1,Vt()},500))},Ce=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const n=o.getRangeAt(0);if(n.startContainer.nodeType===1)return{type:"element",element:n.startContainer,offset:n.startOffset};const a=n.cloneRange();return a.selectNodeContents(f.value),a.setEnd(n.startContainer,n.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+n.toString().length}},El=o=>{if(!(!o||!f.value))try{const n=window.getSelection(),a=document.createRange();if(o.type==="element"&&o.element)if(f.value.contains(o.element)){a.setStart(o.element,o.offset),a.collapse(!0),n.removeAllRanges(),n.addRange(a);return}else{f.value.focus();return}let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(a.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}n.removeAllRanges(),n.addRange(a)}catch{f.value.focus()}},nt=()=>{if(!f.value)return;f.value.focus();const o=window.getSelection(),n=document.createRange(),a=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let d=c.childNodes.length-1;d>=0;d--){const u=c.childNodes[d],m=a(u);if(m)return m}return c},r=a(f.value);if(r.nodeType===3)n.setStart(r,r.length),n.setEnd(r,r.length);else if(r.childNodes.length>0){const c=a(r);c&&c.nodeType===3?(n.setStart(c,c.length),n.setEnd(c,c.length)):(n.selectNodeContents(r),n.collapse(!1))}else n.setStart(r,0),n.setEnd(r,0);o.removeAllRanges(),o.addRange(n)},Vt=(o=!1)=>{if(!f.value)return;const n=f.value.innerHTML,a=$.title||"",r=$.description||"";if(!o&&n===U.value&&a===se.value&&r===He.value)return;const c={content:ee.value||U.value,title:rt.value!==void 0?rt.value:se.value,description:bt.value!==void 0?bt.value:He.value},d=Ye.value.length>0?Ye.value[Ye.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=c.content!==d:u=c.content!==d.content||c.title!==d.title||c.description!==d.description),u&&(Ye.value.push(c),Ye.value.length>50&&Ye.value.shift(),dt.value=[]),U.value=n,se.value=a,He.value=r,ee.value=n,rt.value=a,bt.value=r},we=o=>{if(!f.value)return;kt(),f.value&&Pn(f.value);let n=null;f.value&&(f.value.querySelector("p")||(n=Ce(),le()));const a=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");a&&C.value&&(C.value=null),ne.value=!0;const r=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),c=bn(r);X("update:modelValue",c),X("change",c),Rt.value="editor",W.value||(ee.value=U.value,rt.value=se.value,bt.value=He.value),Le.value&&clearTimeout(Le.value),W.value=!0,Le.value=setTimeout(()=>{W.value=!1,Vt(),on(),Gt()},500),e.nextTick(()=>{n&&El(n),kt();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,v=m&&m.collapsed;if(d.forEach(h=>{try{if(v&&C.value?.command===h){he.value[h]=C.value.state;return}if(h==="bold")if(m){const M=m.commonAncestorContainer,T=M.nodeType===3?M.parentElement:M;let E=!1;if(T&&((T.tagName==="STRONG"||T.tagName==="B"||T.closest&&T.closest("strong, b"))&&(E=!0),!E&&T.style&&parseInt(T.style.fontWeight)>=600&&(E=!0),!E))try{const G=window.getComputedStyle(T);parseInt(G.fontWeight)>=600&&(E=!0)}catch{}he.value[h]=E}else he.value.hasOwnProperty(h)||(he.value[h]=!1);else if(h==="italic")if(m){const M=m.commonAncestorContainer,T=M.nodeType===3?M.parentElement:M,E=T&&(T.tagName==="EM"||T.tagName==="I"||T.closest&&T.closest("em, i"));he.value[h]=!!E}else{const M=document.queryCommandState(h);he.value[h]=M}else{const M=document.queryCommandState(h);he.value[h]=M}}catch{}}),Z(),et(),yl(),Ut(),Hl(),Rl("handleRichTextInput"),a&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const h=o.data||"";h&&h.length===1&&setTimeout(()=>Gt(h),0),(h===" "||h===`
101
- `||/[.,;:!?]/.test(h))&&setTimeout(()=>{on()},100)}ne.value=!1})},kt=()=>{if(!f.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0),a=n.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r)return;const c=r.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(r!==d&&!d?.contains(r)){const u=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,m=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.contains(u)&&u!==d||c.contains(m)&&m!==d){const v=document.createRange();v.setStartAfter(c),v.collapse(!0),o.removeAllRanges(),o.addRange(v)}}}},le=()=>{if(!f.value)return;const o=f.value;if(o.querySelector&&o.querySelector("p"))return;const n=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(o.childNodes);let r=null;a.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}r||(r=document.createElement("p"),o.insertBefore(r,c)),r.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){r=null;return}if(n.has(u)){r=null;return}r||(r=document.createElement("p"),o.insertBefore(r,d)),r.appendChild(d)}})},et=()=>{if(f.value&&!jt.value){jt.value=!0;try{f.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),f.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const c=r.parentElement;!c||!c.classList.contains("dss-image-wrapper")?r.remove():c.querySelector("img")||r.remove()}),f.value.querySelectorAll("img").forEach(r=>{let c=r.getAttribute("alt");c===null&&(c=r.alt||"");const d=r.getAttribute("src")||r.src||"";if(c){const h=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),M=c===d||c===h;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||M||M)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=r.parentElement;const v=m&&m.classList.contains("dss-image-wrapper");if(v){const h=m.querySelector(".dss-image-no-alt-icon");h&&h.remove()}else{const h=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;h&&h.remove()}if(u){v?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const h=document.createElement("div");h.className="dss-image-no-alt-icon",h.setAttribute("contenteditable","false"),h.innerHTML=pe,m.appendChild(h)}else if(v&&m.children.length===1){const h=m.parentNode;h.insertBefore(r,m),h.removeChild(m)}})}finally{jt.value=!1}}},Ie=o=>{on(),X("blur",o),hn()},_n=()=>{if($.disabled||!$.richText||!f.value)return;Pt(),Le.value&&(clearTimeout(Le.value),Le.value=null),W.value&&(Vt(),W.value=!1);const o=Rt.value==="title",n=Rt.value==="description",a=Rt.value==="editor";if(Ye.value.length===0){o&&Re.value?Re.value.focus():n&&ht.value?ht.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{we()});return}const r={content:f.value.innerHTML,title:$.title||"",description:$.description||""};dt.value.push(r);const c=Ye.value.pop();if(c!==void 0){ne.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,U.value=d,se.value=u,He.value=m,ee.value=d,rt.value=u,bt.value=m,e.nextTick(()=>{Z(),qt(),Jl(),Ut();const v=bn(d);X("update:modelValue",v),X("update:title",u),X("update:description",m),X("change",v),X("title-change",u),X("description-change",m),ne.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(Re.value){Re.value.focus();const h=u.length;Re.value.setSelectionRange&&Re.value.setSelectionRange(h,h),Fl()}}else if(n){if(ht.value){ht.value.focus();const h=m.length;ht.value.setSelectionRange(h,h)}}else if(a)nt();else if(Re.value&&document.activeElement===Re.value){const h=u.length;Re.value.setSelectionRange&&Re.value.setSelectionRange(h,h),Fl()}else if(ht.value&&document.activeElement===ht.value){const h=m.length;ht.value.setSelectionRange(h,h)}else f.value&&nt()},10)})})}},Pl=()=>{if($.disabled||!$.richText||!f.value)return;Pt();const o=Rt.value==="title",n=Rt.value==="description",a=Rt.value==="editor";if(dt.value.length===0){o&&Re.value?Re.value.focus():n&&ht.value?ht.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{we()});return}const r={content:f.value.innerHTML,title:$.title||"",description:$.description||""};Ye.value.push(r);const c=dt.value.pop();if(c!==void 0){ne.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,U.value=d,se.value=u,He.value=m,ee.value=d,rt.value=u,bt.value=m,e.nextTick(()=>{Z(),qt(),Jl(),Ut();const v=bn(d);X("update:modelValue",v),X("update:title",u),X("update:description",m),X("change",v),X("title-change",u),X("description-change",m),ne.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(Re.value){Re.value.focus();const h=u.length;Re.value.setSelectionRange&&Re.value.setSelectionRange(h,h),Fl()}}else if(n){if(ht.value){ht.value.focus();const h=m.length;ht.value.setSelectionRange(h,h)}}else if(a)nt();else if(Re.value&&document.activeElement===Re.value){const h=u.length;Re.value.setSelectionRange&&Re.value.setSelectionRange(h,h),Fl()}else if(ht.value&&document.activeElement===ht.value){const h=m.length;ht.value.setSelectionRange(h,h)}else f.value&&nt()},10)})})}},Kl=()=>{if(!f.value)return;f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const c=r.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},yl=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},Sn=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);let a=!1;if(n.collapsed){const r=n.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="EM"||c.tagName==="I"){a=!0;break}if(c.style&&c.style.fontStyle==="italic"){a=!0;break}c=c.parentElement}}else{const r=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{yl()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{yl()});else try{const r=n.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(r),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),o.removeAllRanges(),o.addRange(n),e.nextTick(()=>{yl()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{yl()})}return!0},rn=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);let a=!1;if(n.collapsed){const r=n.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="STRONG"||c.tagName==="B"){a=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){a=!0;break}c=c.parentElement}}else{const r=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{Kl()}),!1;if(n.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==f.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const v=document.createElement("b");v.style.fontWeight="600";const h=document.createDocumentFragment();for(;u.firstChild;)h.appendChild(u.firstChild);v.appendChild(h),u.parentNode&&u.parentNode.replaceChild(v,u),c.setStart(v,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===f.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c)}}Kl()});else try{const r=n.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(r),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),o.removeAllRanges(),o.addRange(n),e.nextTick(()=>{Kl()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Kl()})}return!0},Gl=(o,n=null)=>{if($.disabled||!$.richText||!f.value)return;W.value?(Le.value&&(clearTimeout(Le.value),Le.value=null),Vt(),W.value=!1):Vt(),Pt(),f.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&$l(d)&&(r=Ce())}if(o==="createLink"&&n){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const v=document.createTextNode(n);u.insertNode(v),u.selectNodeContents(v)}}}if(o==="bold"){const d=rn();he.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(C.value={command:"bold",state:d}),e.nextTick(()=>{r&&(El(r),e.nextTick(()=>{const m=wl("bold");he.value.bold=m})),we(),qt(),Ut()});return}if(o==="italic"){const d=Sn();he.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(C.value={command:"italic",state:d}),e.nextTick(()=>{r&&(El(r),e.nextTick(()=>{const m=wl("italic");he.value.italic=m})),we(),yl(),qt(),Ut()});return}let c=!1;try{c=document.execCommand(o,!1,n)}catch{}e.nextTick(()=>{if(r&&El(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=wl("bold");he.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=wl("italic");he.value.italic=u});else{const u=document.queryCommandState(o);he.value[o]=u}else{const u=document.queryCommandState(o);he.value[o]=u}}catch{he.value.hasOwnProperty(o)?he.value[o]=!he.value[o]:he.value[o]=!0}if(o==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const v=u.getRangeAt(0),h=v.commonAncestorContainer.nodeType===1?v.commonAncestorContainer.closest("a"):v.commonAncestorContainer.parentElement?.closest("a");h&&(!h.getAttribute("href")||h.getAttribute("href")==="")&&h.setAttribute("href",n)}f.value.querySelectorAll("a").forEach(v=>{const h=v.getAttribute("href");(!h||h===""||h==="#")&&v.setAttribute("href",n)})}we(),qt(),Ut()})},wl=(o,n=null)=>{if($.disabled||!f.value)return!1;try{if(o==="formatBlock"&&n){const r=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const c=r.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const m=d.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===n||r.toLowerCase()===n.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="STRONG"||v.tagName==="B"||v.closest&&v.closest("strong, b"))&&(u=!0),!u&&v.style&&parseInt(v.style.fontWeight)>=600&&(u=!0),!u))try{const h=window.getComputedStyle(v);parseInt(h.fontWeight)>=600&&(u=!0)}catch{}return he.value.hasOwnProperty(o)?he.value[o]:(he.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;v=!0;let E=M.parentElement;for(;E&&E!==f.value;){if(E.tagName==="STRONG"||E.tagName==="B"){u=!0;break}if(E.style&&parseInt(E.style.fontWeight)>=600){u=!0;break}E=E.parentElement}}else if(M.nodeType===1){const T=M;if(T.tagName==="STRONG"||T.tagName==="B"){u=!0;break}if(T.style&&parseInt(T.style.fontWeight)>=600){u=!0;break}}if(u)break}}return he.value[o]=u&&v,u&&v}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="EM"||v.tagName==="I"||v.closest&&v.closest("em, i"))&&(u=!0),!u&&v.style&&v.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(v).fontStyle==="italic"&&(u=!0)}catch{}return he.value.hasOwnProperty(o)?he.value[o]:(he.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;v=!0;let E=M.parentElement;for(;E&&E!==f.value;){if(E.tagName==="EM"||E.tagName==="I"){u=!0;break}if(E.style&&E.style.fontStyle==="italic"){u=!0;break}E=E.parentElement}}else if(M.nodeType===1){const T=M;if(T.tagName==="EM"||T.tagName==="I"){u=!0;break}if(T.style&&T.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return he.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return c.collapsed&&he.value.hasOwnProperty(o)?he.value[o]:(he.value[o]=d,d)}return he.value.hasOwnProperty(o)?he.value[o]:!1}catch{return he.value.hasOwnProperty(o)?he.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},ln=o=>{$.disabled||!$.richText||(be.value=be.value===o?null:o,o==="askAi"&&(at.value=null))},Pt=()=>{be.value=null,st.value=null},Bl=o=>{Gl("formatBlock",o),Pt()},lo=o=>{if(!o||!f.value)return o;const n=De=>{let Se=De.nodeType===Node.TEXT_NODE?De.parentElement:De;for(;Se&&Se!==f.value;){const vt=Se.tagName;if(vt==="P"){const vl=Se.parentElement;if(vl===f.value||vl.tagName==="BLOCKQUOTE")return Se}if(vt==="BLOCKQUOTE")break;Se=Se.parentElement}return null},a=n(o.startContainer),r=n(o.endContainer);if(!a||!r)return o;const c=[],d=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:De=>{const Se=De.tagName;if(Se==="P"){const vt=De.parentElement;if(vt===f.value||vt.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Se==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(a),v=c.indexOf(r);if(m===-1||v===-1)return o;const h=Math.min(m,v),M=Math.max(m,v),T=c.slice(h,M+1);if(T.length===0)return o;const E=T[0],G=T[T.length-1],Y=document.createRange();return Y.setStartBefore(E),Y.setEndAfter(G),Y},On=()=>{if($.disabled||!$.richText||!f.value)return;W.value?(Le.value&&(clearTimeout(Le.value),Le.value=null),Vt(),W.value=!1):Vt(),Pt(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let n=o.getRangeAt(0);!n.collapsed&&$l(n)&&(n=lo(n),o.removeAllRanges(),o.addRange(n));let a=null;!n.collapsed&&$l(n)&&(a=Ce());const r=n.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(v=>{if(v.nodeType===Node.ELEMENT_NODE)if(v.tagName==="P"||v.tagName==="DIV")u.insertBefore(v,c);else{const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),u.insertBefore(h,c)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),u.insertBefore(h,c)}}),c.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=n.extractContents();u.appendChild(m),n.insertNode(u);const v=[],h=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:E=>E.parentNode===u&&E.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let M;for(;M=h.nextNode();)v.push(M);if(v.forEach(E=>{const G=document.createElement("p");E.parentNode.insertBefore(G,E),G.appendChild(E)}),u.querySelectorAll("p, div").forEach(E=>{E.textContent.trim()===""&&!E.querySelector("img")&&(E.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const E=document.createElement("p");E.innerHTML="<br>",u.appendChild(E)}}e.nextTick(()=>{a&&El(a),Jl(),we(),Ut()})},nn=()=>{if(!f.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!r||!f.value.contains(r))return;const c=M=>{if(!M)return!1;const T=M.textContent||"",G=(M.innerHTML||"").trim();return T.trim()===""||G===""||G==="<br>"||G==="<br/>"||G==="<p></p>"||G==="<p><br></p>"||G==="<p><br/></p>"||G==="<p> </p>"||G==="<p><br> </p>"||G==="<div></div>"||G==="<div><br></div>"||G==="<div><br/></div>"};let d=null;for(a.nodeType===3?d=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?d=a:d=a.closest("p, div"),d&&r.contains(d)&&c(d)&&d.remove();r.lastChild;){const M=r.lastChild;if(M.nodeType===1&&M.tagName==="BR")M.remove();else if(M.nodeType===3)if((M.textContent||"").trim()==="")M.remove();else break;else break}if(r.children.length>0)for(let M=r.children.length-1;M>=0;M--){const T=r.children[M];if((T.tagName==="P"||T.tagName==="DIV")&&c(T))T.remove();else break}let u=r.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(r.innerHTML=u);const v=document.createElement("p");v.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(v,r.nextSibling):r.parentNode.appendChild(v):f.value&&f.value.appendChild(v);const h=document.createRange();h.selectNodeContents(v),h.collapse(!0),o.removeAllRanges(),o.addRange(h),e.nextTick(()=>{Jl(),we()})},qt=()=>{if(!f.value){fe.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");fe.value=!!r}else fe.value=!1}catch{fe.value=!1}},$n=()=>{if(!f.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),ie.value=Ce();const n=window.getSelection();let a="";n.rangeCount>0&&(a=n.getRangeAt(0).toString()),ze.value="",tt.value=a,lt.value="",ve.value=null,Me.value=!0,Pt(),e.nextTick(()=>{R.value&&R.value.focus()})},Ln=()=>{if(!f.value)return;W.value?(Le.value&&(clearTimeout(Le.value),Le.value=null),Vt(),W.value=!1):Vt();const o=window.getSelection();let n=null;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;n=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!n&&ve.value&&(n=ve.value),n&&n.parentNode){const a=document.createDocumentFragment();for(;n.firstChild;)a.appendChild(n.firstChild);if(n.parentNode.replaceChild(a,n),a.firstChild){const r=document.createRange();r.setStartBefore(a.firstChild),r.setEndAfter(a.lastChild||a.firstChild),o.removeAllRanges(),o.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),o.removeAllRanges(),o.addRange(r)}ve.value=null}else Gl("unlink");fe.value=!1,Pt(),e.nextTick(()=>{we(),qt()})},k=()=>{$.disabled||!$.richText||f.value&&(W.value?(Le.value&&(clearTimeout(Le.value),Le.value=null),Vt(),W.value=!1):Vt(),Pt(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Z(),we(),Ut()}))},y=()=>{$.disabled||!$.richText||f.value&&(W.value?(Le.value&&(clearTimeout(Le.value),Le.value=null),Vt(),W.value=!1):Vt(),Pt(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Z(),we(),Ut()}))},x=o=>{const n=o.parentElement;if(!n||n.tagName!=="OL")return null;let a=0,r=o.previousElementSibling;for(;r;)r.tagName==="LI"&&a++,r=r.previousElementSibling;return a+1},Z=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(n=>{const a=n.parentElement;if(a&&a.tagName==="LI"){const r=x(a);r!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},de=()=>{if($.disabled||!$.richText||!f.value)return;Pt(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const n=o.getRangeAt(0),a=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{Z(),we()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=a.previousElementSibling;if(c&&c.tagName==="LI"){const d=r.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const m=x(c);u.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),Z();const v=document.createRange();v.selectNodeContents(a),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{we(),Ut()})}else document.execCommand("indent",!1),e.nextTick(()=>{Z(),we(),Ut()})},Nt=()=>{if($.disabled||!$.richText||!f.value)return;Pt(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const n=o.getRangeAt(0),a=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{Z(),we()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=r.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){r.tagName==="OL"&&a.removeAttribute("data-parent-num"),d.insertBefore(a,c.nextSibling),r.children.length===0&&r.remove(),Z();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{we(),Ut()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Z(),we(),Ut()})},ut=e.ref(null),Kt=e.ref(null),ol=e.ref({}),il=e.ref(""),al=e.ref(null),Ql=e.ref("");e.ref("");const cn=e.ref(null);e.ref("");const _l=e.ref([]),no=e.ref(!1),Tn=e.ref(!1),Ao=o=>{if(!o)return"";const n=o.cloneRange(),a=document.createElement("div");return a.appendChild(n.cloneContents()),a.innerHTML},ko=()=>{if($.disabled||!$.richText||!f.value)return;if(ut.value!==null){ut.value=null,il.value="",Ql.value="",cn.value=null,_l.value=[],Cn(!0);return}Pt(),f.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0);if(n.collapsed||!$l(n))return;Ql.value=Ao(n)||"",cn.value=Ce();const a=n.getBoundingClientRect(),r=f.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=a.bottom-c.top,m=Math.max(d+8,0);ol.value={top:`${m}px`,bottom:"auto"},ut.value=Date.now(),e.nextTick(()=>{if(il.value="",al.value){const h=al.value;h.style.height="auto",h.style.height=`${h.scrollHeight}px`,h.focus()}const v=r.querySelector(".dss-comment-overlay");if(v&&r){const h=r.querySelector(".dss-text-editor-footer");if(h){const M=r.getBoundingClientRect(),T=v.getBoundingClientRect(),E=h.getBoundingClientRect(),G=T.bottom-M.top,Y=E.top-M.top,De=8;if(G>Y-De){const Se=E.height;ol.value={bottom:`${Se+De}px`,top:"auto"}}else ol.value={top:`${m}px`,bottom:"auto"}}}})},oo=()=>{if(!il.value.trim())return;const o=il.value.trim(),n=new Date,a={text:o,selectionText:Ql.value,selectionRange:cn.value,commentId:ut.value,user:$.commentUser||null,createdAt:n.toISOString()};_l.value=[..._l.value,a],X("comment-submitted",a),so(a),cn.value&&!Co(cn.value)&&Do(ut.value,cn.value),il.value="",e.nextTick(()=>{if(al.value){const r=al.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Rl("sendComment")})},ao=(o,n)=>{if(!(!$.commentUser||!o.user||o.user.id!==$.commentUser.id)){if(_l.value=_l.value.filter((a,r)=>r!==n),ut.value!==null&&f.value){const a=String(ut.value),r=f.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&_l.value.length>0){const c=[],d=new Set;_l.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),c.push(u.user))}),c.length>0?r.setAttribute("data-comment-user",JSON.stringify(c[0])):r.removeAttribute("data-comment-user"),c.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(c[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(_l.value.length))}else r&&_l.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(X("comment-deleted",{comment:o,index:n,commentId:ut.value}),$.comments&&Array.isArray($.comments)){const a=$.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));X("update:comments",a)}e.nextTick(()=>{Rl("deleteComment")})}},Co=o=>{if(!o||!f.value)return!1;try{const n=bo(o);if(!n)return!1;const a=n.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},bo=o=>{if(!o||!f.value)return null;try{const n=document.createRange();if(o.type==="element"&&o.element)return f.value.contains(o.element)?(n.setStart(o.element,o.offset),n.collapse(!0),n):null;let a=0;const r=[f.value];let c=null,d=!1,u=!1;for(;!u&&(c=r.pop());)if(c.nodeType===3){const m=a+c.length;!d&&o.start>=a&&o.start<=m&&(n.setStart(c,o.start-a),d=!0),d&&o.end>=a&&o.end<=m&&(n.setEnd(c,o.end-a),u=!0),a=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return d?n:null}catch{return null}},Do=(o,n)=>{if(!(!o||!n||!f.value))try{const a=bo(n);if(!a||a.collapsed)return;const r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const m=c.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(o)&&m.getAttribute("data-fake-comment")!==String(o)&&m.setAttribute("data-comment",String(o));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(o));try{const m=a.startContainer,v=a.endContainer,h=a.startOffset,M=a.endOffset,T=m.nodeType===3?m.parentNode:m,E=v.nodeType===3?v.parentNode:v;if(T===E&&h===0&&M===(v.nodeType===3?v.length:E.childNodes.length)&&(T.tagName==="P"||T.tagName==="DIV"||T.tagName==="H1"||T.tagName==="H2"||T.tagName==="H3"||T.tagName==="H4"||T.tagName==="H5"||T.tagName==="H6")){const Y=a.extractContents();d.appendChild(Y),a.insertNode(d)}else a.surroundContents(d)}catch{const v=a.extractContents();d.appendChild(v),a.insertNode(d)}const u=f.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{Rl("wrapSelectionWithCommentMarker"),we()})}catch{}},so=o=>{if(!o||!o.commentId)return;const n=Array.isArray($.comments)?[...$.comments]:[],a=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let r=n.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(a)||d.conversation_id===a);const c={text:o.text,user:o.user,createdAt:o.createdAt,created_at:o.createdAt,updated_at:o.createdAt};if(r>=0){const d=n[r];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=o.createdAt,!d.article_id&&n.length>0){const u=n.find(m=>m.article_id);u&&(d.article_id=u.article_id)}}else{const d=o.selectionRange,u=n.length>0&&n.find(v=>v.article_id)?.article_id||null,m={conversation_id:a,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:o.selectionText||"",conversation:[c],created_by_user:o.user,created_at:o.createdAt,updated_at:o.createdAt,status:"active"};n.push(m)}no.value=!0,X("update:comments",n)},Ho=(o,n=[])=>{if($.disabled||!$.richText||!f.value)return;const a=f.value;let r=null;try{r=a.querySelector(o)}catch{return}if(!r)return;Pt(),a.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),Ql.value=r.innerHTML||"",cn.value=Ce();const u=c.getBoundingClientRect(),m=a.parentElement;if(m){const M=m.getBoundingClientRect(),T=u.bottom-M.top,G=Math.max(T+8,0);ol.value={top:`${G}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let h=[];if(v&&$.comments&&Array.isArray($.comments)){const M=$.comments.find(T=>String(T.conversation_id)===String(v));if(M&&M.conversation&&Array.isArray(M.conversation)){const T=M.conversation.map(E=>({id:E.id||E.commentary_id,commentary_id:E.id||E.commentary_id,conversation_id:M.id||M.conversation_id,text:E.text,user:E.user,createdAt:E.created_at||E.createdAt,updated_at:E.updated_at||E.updatedAt}));h.push(...T)}}h.length===0&&Array.isArray(n)&&n.length>0&&(h=n.slice()),h.sort((M,T)=>{const E=De=>{if(!De)return 0;const Se=new Date(De).getTime();return isNaN(Se)?0:Se},G=E(M.createdAt),Y=E(T.createdAt);return G===Y?0:G-Y}),_l.value=h,Cn(!0),ut.value=v||null,r&&(Kt.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(il.value="",al.value){const M=al.value;M.style.height="auto",M.style.height=`${M.scrollHeight}px`,M.focus()}if(m){const M=m.querySelector(".dss-comment-overlay");if(M){const T=m.querySelector(".dss-text-editor-footer");if(T){const E=m.getBoundingClientRect(),G=M.getBoundingClientRect(),Y=T.getBoundingClientRect(),De=G.bottom-E.top,Se=Y.top-E.top,vt=8;if(De>Se-vt){const vl=Y.height;ol.value={bottom:`${vl+vt}px`,top:"auto"}}}}}Rl("openCommentOverlayForSelector")})},An=e.ref(null),Sl=e.ref(0),O=o=>{if(!($.disabled||!$.richText)){if(o.key==="Escape"){const n=window.getSelection();if(n.rangeCount>0){const r=n.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){o.preventDefault();let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(m,u.nextSibling):c.appendChild(m),setTimeout(()=>{nn()},50);return}}}if(o.key.length===1||o.key==="Enter"){const n=window.getSelection();if(n&&n.rangeCount>0){const a=n.getRangeAt(0),r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,v=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.contains(m)&&m!==u||d.contains(v)&&v!==u){o.preventDefault();const h=document.createRange();h.setStartAfter(d),h.collapse(!0),n.removeAllRanges(),n.addRange(h);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0);let r=null,c=null;if(a.collapsed)if(o.key==="Backspace"){const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const m=u.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const m=u.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.commonAncestorContainer,u=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(r=d,c=r.closest(".dss-image-wrapper")):(r=d.querySelector("img"),r&&(c=r.closest(".dss-image-wrapper"))),c){const v=c.contains(u)||u===c,h=c.contains(m)||m===c,T=a.cloneContents().textContent?.trim()||"",E=c.textContent?.trim()||"";(!v||!h||T.length>E.length)&&(c=null,r=null)}}if(c){o.preventDefault(),o.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const m=document.createRange();m.setStartAfter(u),m.collapse(!0),n.removeAllRanges(),n.addRange(m),e.nextTick(()=>{we()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?Nt():de();return}if(o.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0);if(a.collapsed){const u=a.startContainer,m=v=>{if(!v)return!1;let h=v.previousSibling;for(;h;){if(h.classList&&h.classList.contains("dss-image-wrapper")||h.tagName==="IMG"||h.querySelector&&h.querySelector(".dss-image-wrapper")||h.querySelector&&h.querySelector("img"))return!0;h=h.previousSibling}const M=v.parentElement;return M&&M!==f.value?m(M):!1};if(u.nodeType===3){const v=u.parentElement;if(v&&(m(v)||m(u))){const h=v.closest("p, div");if(h&&h!==f.value){o.preventDefault(),o.stopPropagation();let M=null;const T=a.startOffset;T<u.length&&(M=u.splitText(T));const E=document.createElement("p");if(M?E.appendChild(M):E.innerHTML="<br>",u.length===0){const Y=u.parentElement;Y&&(Y.removeChild(u),Y.childNodes.length===0&&Y.appendChild(document.createElement("br")))}h.nextSibling?h.parentNode.insertBefore(E,h.nextSibling):h.parentNode.appendChild(E);const G=document.createRange();M?G.setStart(M,0):G.setStart(E,0),G.collapse(!0),n.removeAllRanges(),n.addRange(G),e.nextTick(()=>{we()});return}}}}const r=a.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=Y=>{if(!Y)return!1;const De=Y.textContent||"",vt=(Y.innerHTML||"").trim(),vl=vt.replace(/<br\s*\/?>/gi,"").trim();return De.trim()===""||vt===""||vl===""||vt==="<br>"||vt==="<br/>"||vt==="<p></p>"||vt==="<p><br></p>"||vt==="<p><br/></p>"||vt==="<p> </p>"||vt==="<p><br> </p>"||vt==="<div></div>"||vt==="<div><br></div>"||vt==="<div><br/></div>"},v=c.lastChild,h=v&&v.nodeType===1&&v.tagName==="BR",M=a.startContainer,T=M.nodeType===3?M.parentElement:M,E=T===c||T&&T.parentElement===c;if(u&&m(u)||h&&E){o.preventDefault(),setTimeout(()=>{nn()},50);return}}}}if(o.key===" "){const n=Date.now(),a=n-Sl.value;if(An.value===" "&&a<300){const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(d){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){o.preventDefault(),de();return}}}}An.value=" ",Sl.value=n}else An.value=o.key}},xl=o=>{if($.disabled||!$.richText)return;o.preventDefault();let n=o.clipboardData.getData("text/html"),a=o.clipboardData.getData("text/plain");n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),Vt();const r=window.getSelection();let c=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),c=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const v=new DOMParser().parseFromString(u,"text/html");let h=f.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach(T=>{if(h>0){const E=v.createElement("p");E.innerHTML=T.innerHTML,T.parentNode.replaceChild(E,T)}else h++}),c){const T=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],E=Array.from(v.body.children).filter(G=>T.includes(G.tagName));if(E.length===1){const G=E[0].tagName,Y=c.tagName,De=c.textContent.trim()===""&&!c.querySelector("img");let Se=!1;if(["H1","H2","H3","H4","H5","H6"].includes(Y)?Se=!0:De||(G===Y||G==="P")&&(Se=!0),Se)return E[0].innerHTML.trim()}}return v.body.innerHTML.trim()};if(n){const u=d(n);document.execCommand("insertHTML",!1,u)}else if(a)if(/<[a-z][\s\S]*>/i.test(a)){const m=d(a);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,a);we()},Dl=o=>{if(be.value){const a=o.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&Pt()}if(yt.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=f.value&&a.closest(".dss-text-editor-content");!r&&!c&&hn()}if(at.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=a.closest(".dss-toolbar-dropdown");!r&&!c&&io()}const n=o.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(st.value=null),!f.value||!n.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);K.value=!r.collapsed&&$l(r)}else K.value=!1}if(ut.value!==null){const a=document.querySelector(".dss-comment-overlay");let r=!1;if(a){const u=a.getBoundingClientRect(),m=o.clientX,v=o.clientY;r=m>=u.left&&m<=u.right&&v>=u.top&&v<=u.bottom}const c=n.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!r&&!d&&(ut.value=null,il.value="",Ql.value="",cn.value=null,_l.value=[],Cn(!0))}},pl=(o,n)=>{o&&o.stopPropagation&&o.stopPropagation(),Ze.value&&(clearTimeout(Ze.value),Ze.value=null),st.value=n},Ol=o=>{const n=o.relatedTarget;if(n){const a=n.closest(".dss-toolbar-dropdown-submenu"),r=n.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||r)return}Ze.value&&clearTimeout(Ze.value),Ze.value=setTimeout(()=>{st.value=null,Ze.value=null},150)},sl=o=>{st.value=null};let fl=0;const un=o=>{if(!o)return;const n=Array.from(o.children);n.forEach(a=>{a.classList.contains("dss-toolbar-dropdown-submenu")||a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(a.tagName==="BUTTON"||a.tagName==="DIV")&&!a.classList.contains("dss-toolbar-dropdown-item")&&a.classList.add("dss-toolbar-dropdown-item")}),n.forEach((a,r)=>{if(a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||a.classList.contains("dss-toolbar-dropdown-submenu")||!a.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(a.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(h=>h.tagName==="BUTTON"||h.tagName==="DIV").length>0:!1),d=a.nextElementSibling,u=d&&!d.classList.contains("dss-toolbar-dropdown-submenu")&&!d.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&d.tagName==="DIV"&&!d.classList.contains("dss-toolbar-dropdown-item")&&Array.from(d.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(c||u){const m=`submenu-auto-${++fl}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let v=null;c?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(c,a.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),v=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),v=d),v&&(v.setAttribute("data-submenu-id",m),v.setAttribute("data-processed","true"),c&&a.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(M=>{(M.tagName==="BUTTON"||M.tagName==="DIV")&&!M.classList.contains("dss-toolbar-dropdown-item")&&M.classList.add("dss-toolbar-dropdown-item")}))}})},dn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{un(n),n.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=v=>{const h=c.getAttribute("data-submenu-id");h&&pl(v,h)},m=Ol;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m}}),n.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=h=>{const M=c.getAttribute("data-submenu-id");M&&pl(h,M)},m=Ol;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(h=>{h.addEventListener("click",sl)})})})};let xt=null;const _t=()=>{if(st.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${st.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${st.value}"]`);o&&n&&yo(o,n)}if(yt.value&&Ut(),$.richText){if(xt!==null)return;xt=setTimeout(()=>{xt=null,Rl("handleWindowResize")},150)}},ft=()=>{if(!$.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(n=>{Array.from(n.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},cl=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),n=a=>{if(a.preventDefault(),a.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};o.forEach(a=>{a.addEventListener("selectstart",n),a.addEventListener("mousedown",n),a.addEventListener("dragstart",n),a.addEventListener("contextmenu",n),a.addEventListener("click",r=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{At.value?Fl():Nl(),V.value?zl():En()})}),e.nextTick(()=>{cl()}),$.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Dl),window.addEventListener("resize",_t);let o=null;const n=()=>{o===null&&(o=setTimeout(()=>{o=null,_t()},150))};window.addEventListener("scroll",n,!0),f.value._windowScrollHandler=n,f.value._windowScrollTimeout=o,f.value.closest(".editor-with-comments"),f.value.closest(".dss-text-editor-content-wrapper");const a=f.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,_t()},150))};a&&(a.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:a,handler:c}),e.nextTick(()=>{dn(),ft()}),f.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!$.disabled&&m.preventDefault();const M=v.closest(".dss-image-no-alt-icon"),T=v.closest(".dss-image-wrapper");if(M||T&&v===T){m.preventDefault(),m.stopPropagation();const E=window.getSelection(),G=document.createRange();G.setStartAfter(T),G.collapse(!0),E.removeAllRanges(),E.addRange(G)}else T&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const E=window.getSelection();if(E.rangeCount>0){const Y=E.getRangeAt(0).commonAncestorContainer,De=Y.nodeType===3?Y.parentElement:Y;if(T.contains(De)&&De!==T.querySelector("img")){const Se=document.createRange();Se.setStartAfter(T),Se.collapse(!0),E.removeAllRanges(),E.addRange(Se)}}else{const G=document.createRange();G.setStartAfter(T),G.collapse(!0),E.addRange(G)}}))},!0),f.value.addEventListener("mousedown",m=>{const v=m.target,h=v.closest(".dss-image-no-alt-icon"),M=v.closest(".dss-image-wrapper");if(h||M&&v.tagName!=="IMG"){m.preventDefault();const T=window.getSelection(),E=document.createRange();M&&(E.setStartAfter(M),E.collapse(!0),T.removeAllRanges(),T.addRange(E))}},!0),f.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!f.value)return;f.value.querySelectorAll("img").forEach(h=>{if(!h.closest(".dss-image-wrapper"))h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="";else{const T=h.getAttribute("alt")||h.alt||"";if(T){const E=h.getAttribute("src")||h.src||"",G=E.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),Y=T===E||T===G;(T.startsWith("http://")||T.startsWith("https://")||T.startsWith("data:")||Y||Y)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),et()})}),f.value.addEventListener("dragstart",m=>{const v=m.target,h=v.tagName==="IMG"?v:v.closest("img"),M=h?.closest(".dss-image-wrapper");h&&f.value.contains(h)&&(Wt.value=M||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",m=>{Wt.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",m=>{Wt.value&&(m.preventDefault(),m.stopPropagation())}),f.value.addEventListener("drop",m=>{if(!Wt.value||!f.value)return;m.preventDefault(),m.stopPropagation();const v=Wt.value,h=v.classList?.contains("dss-image-wrapper"),M=h?v.querySelector("img"):v,T=h?v:M?.closest(".dss-image-wrapper");if(!M||!f.value.contains(M)){Wt.value=null;return}let E=null;const G=m.clientX,Y=m.clientY;if(document.caretRangeFromPoint)E=document.caretRangeFromPoint(G,Y);else{const rl=window.getSelection();rl.rangeCount>0?E=rl.getRangeAt(0).cloneRange():(E=document.createRange(),E.selectNodeContents(f.value),E.collapse(!1))}if(!E){Wt.value=null;return}const De=E.commonAncestorContainer,Se=De.nodeType===3?De.parentElement:De;if(Se?.closest(".dss-image-wrapper")===T||T&&T.contains(Se)){Wt.value=null;return}if(T&&(Se===T||T.contains(Se))){Wt.value=null;return}const vl=M.getAttribute("src");let ul=null;T?ul=T.cloneNode(!0):ul=M.cloneNode(!0);try{let rl=E.startContainer;if(rl.nodeType===3&&(rl=rl.parentElement),T&&(rl===T||T.contains(rl))){const dl=document.createRange();dl.setStartAfter(T),dl.collapse(!0),E=dl}E.insertNode(ul);const ml=document.createRange();ml.setStartAfter(ul),ml.collapse(!0);const Jt=window.getSelection();Jt.removeAllRanges(),Jt.addRange(ml)}catch{if(f.value.childNodes.length===0){const ml=document.createElement("p");ml.appendChild(ul),f.value.appendChild(ml)}else{const ml=f.value.lastChild;if(ml&&ml.nodeType===1)ml.appendChild(ul);else{const Jt=document.createElement("p");Jt.appendChild(ul),f.value.appendChild(Jt)}}}T?T.remove():M.remove(),Wt.value=null,e.nextTick(()=>{const rl=f.value.querySelectorAll("img");let ml=!1;rl.forEach(Jt=>{if(Jt.getAttribute("src")===vl)if(!ml)ml=!0;else{const dl=Jt.closest(".dss-image-wrapper");dl?dl.remove():Jt.remove()}}),et(),we()})}),f.value.addEventListener("dragend",m=>{Wt.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(v=>{v.addedNodes.forEach(h=>{if(h.nodeType===1){h.tagName==="IMG"&&(h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="");const M=h.querySelectorAll&&h.querySelectorAll("img");M&&M.forEach(T=>{T.removeAttribute("alt"),T.removeAttribute("data-alt"),T.setAttribute("alt",""),T.setAttribute("data-alt",""),T.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{et(),ft(),d=null},100)});if(u.observe(f.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{ft()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),$.modelValue){const m=zn($.modelValue);f.value.innerHTML=m,le()}e.nextTick(()=>{const m=f.value.innerHTML||"",v=$.title||"",h=$.description||"";U.value=m,se.value=v,He.value=h,rt.value=v,bt.value=h,Z(),et(),yl(),Hl(),qn(),Ot()}),qt(),Jl(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Dl),window.removeEventListener("resize",_t),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),xt!==null&&(clearTimeout(xt),xt=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),Le.value&&clearTimeout(Le.value),Ze.value&&clearTimeout(Ze.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),Ue.value&&Ue.value.disconnect(),mt.value!==null&&(cancelAnimationFrame(mt.value),mt.value=null),Ee.value!==null&&(clearTimeout(Ee.value),Ee.value=null),Qe.value!==null&&(clearTimeout(Qe.value),Qe.value=null),Cn(!0),f.value&&f.value._scrollHandlers){const{wrapper:n,content:a,handler:r}=f.value._scrollHandlers;n&&n.removeEventListener("scroll",r),a&&a.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const Ro=o=>{const n=o.target,a=n.closest("a");if(a&&!$.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(a);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const r=n.closest(".dss-image-wrapper");r&&n.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(r.contains(m)&&m!==r.querySelector("img")){const v=document.createRange();v.setStartAfter(r),v.collapse(!0),c.removeAllRanges(),c.addRange(v)}}et(),qt(),Jl(),Ut(),Hl()}):e.nextTick(()=>{et(),qt(),Jl(),Ut(),Hl()})},ro=()=>{kt();const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0);K.value=!a.collapsed&&$l(a),!a.collapsed&&C.value&&(C.value=null)}else K.value=!1;if(et(),qt(),Jl(),Ut(),Hl(),o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c&&c.closest(".dss-text-editor-footer")){o.removeAllRanges(),K.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(!c.collapsed)if(a==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let m=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(m=!0),!m&&u.style&&parseInt(u.style.fontWeight)>=600&&(m=!0),!m))try{const v=window.getComputedStyle(u);parseInt(v.fontWeight)>=600&&(m=!0)}catch{}he.value[a]=m}else{const d=document.queryCommandState(a);he.value[a]=d}}}catch{}})},Hl=()=>{if(!$.richText||$.disabled||!f.value){S.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){S.value="p";return}const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!f.value.contains(r)){S.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){S.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?S.value=d:S.value="p"}catch{S.value="p"}},Jl=()=>{if(!f.value){gt.value=!1;return}try{const o=window.getSelection();let n=!1;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");n=!!(c&&f.value.contains(c))}gt.value=n}catch{gt.value=!1}},$l=o=>{if(!o||!f.value)return!1;const n=o.commonAncestorContainer;if(!n)return!1;const a=n.nodeType===3?n.parentElement:n;return a?f.value.contains(a):!1},hn=()=>{yt.value=!1},Ut=()=>{if(!$.floatingToolbar||!$.richText||$.disabled){yt.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){yt.value=!1;return}const n=o.getRangeAt(0);if(n.collapsed||!$l(n)){yt.value=!1;return}const a=n.getBoundingClientRect();if(!a||a.width===0&&a.height===0){yt.value=!1;return}const r=f.value;if(!r){yt.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){yt.value=!1;return}const d=40,u=8,m=a.top-d/2+15;let v=a.left+a.width/2;const h=window.innerWidth||document.documentElement.clientWidth||0;let M=0;tl.value&&(M=tl.value.getBoundingClientRect().width);const T=(M||320)/2;let E=c.left+T,G=c.right-T;if(G<E){const Y=c.left+c.width/2;E=Y,G=Y}if(h>0){const Y=T+u,De=h-T-u;if(E=Math.max(E,Y),G=Math.min(G,De),G<E){const Se=h/2;E=Se,G=Se}}v<E?v=E:v>G&&(v=G),qe.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},yt.value=!0},wo=o=>{$.disabled||!$.richText||(at.value=at.value===o?null:o,o==="askAi"&&(be.value=null))},io=()=>{at.value=null,st.value=null},yn=o=>{Bl(o),io()};let Ll=null,kn=null,Vl=null,Vn=null;const Io=o=>{if($.disabled||!$.richText){Hn(),Rn();return}const n=o.target,a=n.closest("a"),r=n.closest("img");if(Ll&&(clearTimeout(Ll),Ll=null),Vl&&(clearTimeout(Vl),Vl=null),a&&a!==kn){Rn(),kn=a;let c=a.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=a.textContent||""),ve.value=a,ue.value=c,j.value=!0,ke.value=!0,co(a)}else!a&&kn?(kn=null,Ll=setTimeout(()=>{ke.value||Hn()},150)):a&&a===kn&&co(a);if(r&&r!==Vn){Hn(),Vn=r;let c=r.getAttribute("alt");c===null&&(c=r.alt||"");let d=r.getAttribute("data-alt");d===null&&(d=c),r.hasAttribute("alt")||r.setAttribute("alt",c),r.hasAttribute("data-alt")||r.setAttribute("data-alt",d),Ge.value=r,Xt.value=c.trim()||_("textEditor.image.noAlt"),Lt.value=!0,$e.value=!0,uo(r)}else!r&&Vn?(Vn=null,Vl=setTimeout(()=>{$e.value||Rn()},150)):r&&r===Vn&&uo(r)},Dn=o=>{const n=o.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(kn=null,Vn=null,Ll&&(clearTimeout(Ll),Ll=null),Vl&&(clearTimeout(Vl),Vl=null),Hn(),Rn())},Hn=()=>{ke.value=!1,setTimeout(()=>{ke.value||(j.value=!1,ue.value="",Me.value||(ve.value=null))},100)},co=o=>{if(!o||!f.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;H.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Rn=()=>{$e.value=!1,setTimeout(()=>{$e.value||(Lt.value=!1,Xt.value="",Et.value||(Ge.value=null))},100)},uo=o=>{if(!o||!f.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;te.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},xo=()=>{if(!ue.value||!ve.value)return;let n=ve.value.getAttribute("href")||ue.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},Fo=()=>{if(ve.value){const o=ve.value.textContent||"",n=ve.value.getAttribute("href")||"",a=ve.value;ze.value=n,tt.value=o,lt.value=o,ke.value=!1,j.value=!1,ue.value="",ve.value=a,Me.value=!0}else if(fe.value){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(r){const c=r.textContent||"",d=r.getAttribute("href")||"";ze.value=d,tt.value=c,lt.value=c,ve.value=r,Me.value=!0}}}else{ie.value=Ce();const o=window.getSelection();let n="";o.rangeCount>0&&(n=o.getRangeAt(0).toString()),ze.value="",tt.value=n,lt.value="",ve.value=null,Me.value=!0}e.nextTick(()=>{R.value&&(R.value.focus(),R.value.select())})},Wn=()=>{Me.value=!1,ze.value="",tt.value="",lt.value="",ve.value=null,ie.value=null},Wl=()=>{if(!ze.value.trim()){Wn();return}if(W.value?(Le.value&&(clearTimeout(Le.value),Le.value=null),Vt(),W.value=!1):Vt(),tt.value.trim()||(tt.value=ze.value.trim()),ve.value&&f.value&&f.value.contains(ve.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const n=ve.value;if(n.setAttribute("href",ze.value.trim()),tt.value.trim()!==lt.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=tt.value.trim()}n.style.color="#60afdf",n.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(n),a.collapse(!1),o.removeAllRanges(),o.addRange(a),we()}else if(f.value){f.value.focus();const o=window.getSelection();o.removeAllRanges(),ie.value&&El(ie.value);let n=null;if(o.rangeCount>0&&(n=o.getRangeAt(0)),n&&!n.collapsed){n.toString();const a=document.createElement("a");a.href=ze.value.trim(),a.textContent=tt.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",n.deleteContents(),n.insertNode(a);const r=document.createTextNode(" ");n.setStartAfter(a),n.insertNode(r),n.setStartAfter(r),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(f.value),n.collapse(!1));const a=n.startContainer,r=a.nodeType===3,c=r&&n.startOffset===a.textContent.length,d=document.createElement("a");if(d.href=ze.value.trim(),d.textContent=tt.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=a.parentElement;for(;u&&u!==f.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==f.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const v=document.createTextNode(" ");m.appendChild(v);const h=document.createRange();h.setStartAfter(d),h.collapse(!0),o.removeAllRanges(),o.addRange(h)}else{if(n.startOffset>0){const h=a.textContent.substring(0,n.startOffset),M=h[h.length-1];if(M&&M!==" "&&M!==" "&&M!==`
100
+ </svg>`,f=e.ref(null),be=e.ref(null),ge=e.ref(!1),ne=e.ref(!1),j=e.ref(!1),ue=e.ref(""),H=e.ref({}),ke=e.ref(!1),Me=e.ref(!1),ze=e.ref(""),lt=e.ref(""),R=e.ref(null),pe=e.ref(null),fe=e.ref(null),ie=e.ref(null),nt=e.ref(""),gt=e.ref(!1),he=e.ref({}),yt=e.ref(!1),Ue=e.ref({}),tl=e.ref(null),st=e.ref(null),xt=e.ref(!1),Ht=e.ref(""),ll=e.ref(null),It=e.ref(""),at=e.ref(""),Et=e.ref(""),nl=e.ref(null),Ft=e.ref(null),Yt=e.ref(null),Ge=e.ref(null),et=e.ref(null),$t=e.ref(!1),Xt=e.ref(""),te=e.ref({}),$e=e.ref(!1),Ne=e.ref("upload"),qe=e.ref(""),rt=e.ref(null),Ze=e.ref(null),Ye=e.ref([]),mt=e.ref([]),Le=e.ref(null),q=e.ref(!1),U=e.ref(""),ee=e.ref(""),se=e.ref(""),He=e.ref(""),it=e.ref(""),bt=e.ref(""),Re=e.ref(null),ht=e.ref(null),Rt=e.ref(null),jt=e.ref(!1),qt=e.ref(null),Dt=e.ref(!1),V=e.ref(!1),C=e.ref(null),S=e.ref("p"),K=e.ref(!1),Q=e.ref([]),Oe=e.ref(null),pt=e.ref(null),Ee=e.ref(null),Ve=e.ref(!1),Tt=e.ref(0),At=100,Qe=e.ref(null),Je=e.computed(()=>({"dss-text-editor-no-border":!$.border,"dss-text-editor-rounded":$.rounded,"dss-text-editor-full-height":$.fullHeight,"dss-comment-overlay-open":dt.value!==null})),Lt=e.computed(()=>({})),gl=e.computed(()=>!$.fixedHeight||$.fullHeight?{}:{height:`${1.6*14*$.rows+24+2}px`,resize:"none",overflowY:"auto"}),F=e.computed(()=>!$.fixedHeight||$.fullHeight?{}:{height:`${1.6*14*$.rows+32}px`,overflowY:"auto"}),Z=e.computed(()=>$.richText&&mt.value.length>0),P=e.computed(()=>{if(!$.modelValue)return"";if($.richText){let o=$.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/&nbsp;/g," "),o=o.replace(/&amp;/g,"&"),o=o.replace(/&lt;/g,"<"),o=o.replace(/&gt;/g,">"),o=o.replace(/&quot;/g,'"'),o=o.replace(/&#39;/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return $.modelValue}),ce=e.computed(()=>{const o=P.value.trim();return o?o.split(/\s+/).filter(n=>n.length>0).length:0}),Te=e.computed(()=>P.value.length),ct=e.computed(()=>Ge.value!==null&&Ne.value==="upload"&&It.value&&It.value.startsWith("data:")),ut=e.computed(()=>$.titlePlaceholder||_("textEditor.placeholders.title")),Xe=e.computed(()=>$.descriptionPlaceholder||_("textEditor.placeholders.description")),Ct=e.computed(()=>$.placeholder||_("textEditor.placeholders.startTyping")),Wt=o=>Ke&&Ke[o]!==void 0,hl=o=>{for(let n=o+1;n<$.customToolbarSlots.length;n++)if(Wt($.customToolbarSlots[n]))return!0;return!1},Xl=o=>{for(let n=o+1;n<$.customToolbarSlots.length;n++){const a=$.customToolbarSlots[n];if(Wt(a)&&Ml(a))return!0}return!1},Ml=o=>$.customToolbarFloatingMap.hasOwnProperty(o)?$.customToolbarFloatingMap[o]===!0:!0,Yl=e.computed(()=>$.customToolbarSlots.some(o=>Wt(o)&&Ml(o))),vn=e.computed(()=>Wt("title-slot")),gn=e.computed(()=>Wt("description-slot")),bn=o=>{if(!o||o.trim()==="")return"<html></html>";const n=o.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?o:`<html>${o}</html>`},zn=o=>{if(!o||o.trim()==="")return"";const n=o.replace(/<!--[\s\S]*?-->/g,""),a=n.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():n},Pn=o=>{if(!o)return;const n=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),a=[];let r=n.nextNode();for(;r;)a.push(r),r=n.nextNode();a.forEach(c=>c.remove())},to=o=>{try{const n=String(o.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],c=o.getFullYear();return`${n} ${r} ${c}`}catch{return""}},wn=o=>{if(!o||typeof o!="string")return!1;const n=o.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const c=_("textEditor.started_conversation");if(c&&n===c)return!0}catch{}const r=n.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},xn=o=>{const n=o.target.value;X("update:modelValue",n),X("change",n)},Fl=()=>{if(!Re.value)return;const o=Re.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const a=o.scrollHeight;o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},jl=()=>{Dt.value=!0,Fl()},bl=()=>{Dt.value=!1,Nl()},Nl=()=>{if(!Re.value)return;const o=Re.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const n=o.value;o.value="M";const a=o.scrollHeight;o.value=n,o.offsetHeight,o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},Al=o=>{const a=o.target.value;Dt.value&&Fl(),X("update:title",a),X("title-change",a),Rt.value="title",$.richText&&(q.value||(ee.value=U.value,it.value=se.value,bt.value=He.value),Le.value&&clearTimeout(Le.value),q.value=!0,Le.value=setTimeout(()=>{q.value=!1,St()},500))},zl=()=>{if(!ht.value)return;const o=ht.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const a=o.scrollHeight;o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},Bn=()=>{V.value=!0,zl()},Mn=()=>{V.value=!1,En()},En=()=>{if(!ht.value)return;const o=ht.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const n=o.value;o.value="M";const a=o.scrollHeight;o.value=n,o.offsetHeight,o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},zt=o=>{const a=o.target.value;V.value&&zl(),X("update:description",a),X("description-change",a),Rt.value="description",$.richText&&(q.value||(ee.value=U.value,it.value=se.value,bt.value=He.value),Le.value&&clearTimeout(Le.value),q.value=!0,Le.value=setTimeout(()=>{q.value=!1,St()},500))},Ce=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const n=o.getRangeAt(0);if(n.startContainer.nodeType===1)return{type:"element",element:n.startContainer,offset:n.startOffset};const a=n.cloneRange();return a.selectNodeContents(f.value),a.setEnd(n.startContainer,n.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+n.toString().length}},El=o=>{if(!(!o||!f.value))try{const n=window.getSelection(),a=document.createRange();if(o.type==="element"&&o.element)if(f.value.contains(o.element)){a.setStart(o.element,o.offset),a.collapse(!0),n.removeAllRanges(),n.addRange(a);return}else{f.value.focus();return}let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(a.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}n.removeAllRanges(),n.addRange(a)}catch{f.value.focus()}},ot=()=>{if(!f.value)return;f.value.focus();const o=window.getSelection(),n=document.createRange(),a=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let d=c.childNodes.length-1;d>=0;d--){const u=c.childNodes[d],m=a(u);if(m)return m}return c},r=a(f.value);if(r.nodeType===3)n.setStart(r,r.length),n.setEnd(r,r.length);else if(r.childNodes.length>0){const c=a(r);c&&c.nodeType===3?(n.setStart(c,c.length),n.setEnd(c,c.length)):(n.selectNodeContents(r),n.collapse(!1))}else n.setStart(r,0),n.setEnd(r,0);o.removeAllRanges(),o.addRange(n)},St=(o=!1)=>{if(!f.value)return;const n=f.value.innerHTML,a=$.title||"",r=$.description||"";if(!o&&n===U.value&&a===se.value&&r===He.value)return;const c={content:ee.value||U.value,title:it.value!==void 0?it.value:se.value,description:bt.value!==void 0?bt.value:He.value},d=Ye.value.length>0?Ye.value[Ye.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=c.content!==d:u=c.content!==d.content||c.title!==d.title||c.description!==d.description),u&&(Ye.value.push(c),Ye.value.length>50&&Ye.value.shift(),mt.value=[]),U.value=n,se.value=a,He.value=r,ee.value=n,it.value=a,bt.value=r},we=o=>{if(!f.value)return;kt(),f.value&&Pn(f.value);let n=null;f.value&&(f.value.querySelector("p")||(n=Ce(),le()));const a=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");a&&C.value&&(C.value=null),ne.value=!0;const r=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),c=bn(r);X("update:modelValue",c),X("change",c),Rt.value="editor",q.value||(ee.value=U.value,it.value=se.value,bt.value=He.value),Le.value&&clearTimeout(Le.value),q.value=!0,Le.value=setTimeout(()=>{q.value=!1,St(),on(),Gt()},500),e.nextTick(()=>{n&&El(n),kt();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,v=m&&m.collapsed;if(d.forEach(h=>{try{if(v&&C.value?.command===h){he.value[h]=C.value.state;return}if(h==="bold")if(m){const M=m.commonAncestorContainer,T=M.nodeType===3?M.parentElement:M;let E=!1;if(T&&((T.tagName==="STRONG"||T.tagName==="B"||T.closest&&T.closest("strong, b"))&&(E=!0),!E&&T.style&&parseInt(T.style.fontWeight)>=600&&(E=!0),!E))try{const G=window.getComputedStyle(T);parseInt(G.fontWeight)>=600&&(E=!0)}catch{}he.value[h]=E}else he.value.hasOwnProperty(h)||(he.value[h]=!1);else if(h==="italic")if(m){const M=m.commonAncestorContainer,T=M.nodeType===3?M.parentElement:M,E=T&&(T.tagName==="EM"||T.tagName==="I"||T.closest&&T.closest("em, i"));he.value[h]=!!E}else{const M=document.queryCommandState(h);he.value[h]=M}else{const M=document.queryCommandState(h);he.value[h]=M}}catch{}}),W(),tt(),yl(),Ut(),Hl(),Rl("handleRichTextInput"),a&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const h=o.data||"";h&&h.length===1&&setTimeout(()=>Gt(h),0),(h===" "||h===`
101
+ `||/[.,;:!?]/.test(h))&&setTimeout(()=>{on()},100)}ne.value=!1})},kt=()=>{if(!f.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0),a=n.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r)return;const c=r.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(r!==d&&!d?.contains(r)){const u=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,m=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.contains(u)&&u!==d||c.contains(m)&&m!==d){const v=document.createRange();v.setStartAfter(c),v.collapse(!0),o.removeAllRanges(),o.addRange(v)}}}},le=()=>{if(!f.value)return;const o=f.value;if(o.querySelector&&o.querySelector("p"))return;const n=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(o.childNodes);let r=null;a.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}r||(r=document.createElement("p"),o.insertBefore(r,c)),r.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){r=null;return}if(n.has(u)){r=null;return}r||(r=document.createElement("p"),o.insertBefore(r,d)),r.appendChild(d)}})},tt=()=>{if(f.value&&!jt.value){jt.value=!0;try{f.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),f.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const c=r.parentElement;!c||!c.classList.contains("dss-image-wrapper")?r.remove():c.querySelector("img")||r.remove()}),f.value.querySelectorAll("img").forEach(r=>{let c=r.getAttribute("alt");c===null&&(c=r.alt||"");const d=r.getAttribute("src")||r.src||"";if(c){const h=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),M=c===d||c===h;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||M||M)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=r.parentElement;const v=m&&m.classList.contains("dss-image-wrapper");if(v){const h=m.querySelector(".dss-image-no-alt-icon");h&&h.remove()}else{const h=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;h&&h.remove()}if(u){v?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const h=document.createElement("div");h.className="dss-image-no-alt-icon",h.setAttribute("contenteditable","false"),h.innerHTML=ve,m.appendChild(h)}else if(v&&m.children.length===1){const h=m.parentNode;h.insertBefore(r,m),h.removeChild(m)}})}finally{jt.value=!1}}},Ie=o=>{on(),X("blur",o),hn()},_n=()=>{if($.disabled||!$.richText||!f.value)return;Pt(),Le.value&&(clearTimeout(Le.value),Le.value=null),q.value&&(St(),q.value=!1);const o=Rt.value==="title",n=Rt.value==="description",a=Rt.value==="editor";if(Ye.value.length===0){o&&Re.value?Re.value.focus():n&&ht.value?ht.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{we()});return}const r={content:f.value.innerHTML,title:$.title||"",description:$.description||""};mt.value.push(r);const c=Ye.value.pop();if(c!==void 0){ne.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,U.value=d,se.value=u,He.value=m,ee.value=d,it.value=u,bt.value=m,e.nextTick(()=>{W(),Zt(),Jl(),Ut();const v=bn(d);X("update:modelValue",v),X("update:title",u),X("update:description",m),X("change",v),X("title-change",u),X("description-change",m),ne.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(Re.value){Re.value.focus();const h=u.length;Re.value.setSelectionRange&&Re.value.setSelectionRange(h,h),Fl()}}else if(n){if(ht.value){ht.value.focus();const h=m.length;ht.value.setSelectionRange(h,h)}}else if(a)ot();else if(Re.value&&document.activeElement===Re.value){const h=u.length;Re.value.setSelectionRange&&Re.value.setSelectionRange(h,h),Fl()}else if(ht.value&&document.activeElement===ht.value){const h=m.length;ht.value.setSelectionRange(h,h)}else f.value&&ot()},10)})})}},Pl=()=>{if($.disabled||!$.richText||!f.value)return;Pt();const o=Rt.value==="title",n=Rt.value==="description",a=Rt.value==="editor";if(mt.value.length===0){o&&Re.value?Re.value.focus():n&&ht.value?ht.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{we()});return}const r={content:f.value.innerHTML,title:$.title||"",description:$.description||""};Ye.value.push(r);const c=mt.value.pop();if(c!==void 0){ne.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,U.value=d,se.value=u,He.value=m,ee.value=d,it.value=u,bt.value=m,e.nextTick(()=>{W(),Zt(),Jl(),Ut();const v=bn(d);X("update:modelValue",v),X("update:title",u),X("update:description",m),X("change",v),X("title-change",u),X("description-change",m),ne.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(Re.value){Re.value.focus();const h=u.length;Re.value.setSelectionRange&&Re.value.setSelectionRange(h,h),Fl()}}else if(n){if(ht.value){ht.value.focus();const h=m.length;ht.value.setSelectionRange(h,h)}}else if(a)ot();else if(Re.value&&document.activeElement===Re.value){const h=u.length;Re.value.setSelectionRange&&Re.value.setSelectionRange(h,h),Fl()}else if(ht.value&&document.activeElement===ht.value){const h=m.length;ht.value.setSelectionRange(h,h)}else f.value&&ot()},10)})})}},Kl=()=>{if(!f.value)return;f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const c=r.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},yl=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},Sn=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);let a=!1;if(n.collapsed){const r=n.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="EM"||c.tagName==="I"){a=!0;break}if(c.style&&c.style.fontStyle==="italic"){a=!0;break}c=c.parentElement}}else{const r=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{yl()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{yl()});else try{const r=n.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(r),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),o.removeAllRanges(),o.addRange(n),e.nextTick(()=>{yl()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{yl()})}return!0},rn=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);let a=!1;if(n.collapsed){const r=n.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="STRONG"||c.tagName==="B"){a=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){a=!0;break}c=c.parentElement}}else{const r=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{Kl()}),!1;if(n.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==f.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const v=document.createElement("b");v.style.fontWeight="600";const h=document.createDocumentFragment();for(;u.firstChild;)h.appendChild(u.firstChild);v.appendChild(h),u.parentNode&&u.parentNode.replaceChild(v,u),c.setStart(v,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===f.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c)}}Kl()});else try{const r=n.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(r),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),o.removeAllRanges(),o.addRange(n),e.nextTick(()=>{Kl()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Kl()})}return!0},Gl=(o,n=null)=>{if($.disabled||!$.richText||!f.value)return;q.value?(Le.value&&(clearTimeout(Le.value),Le.value=null),St(),q.value=!1):St(),Pt(),f.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&$l(d)&&(r=Ce())}if(o==="createLink"&&n){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const v=document.createTextNode(n);u.insertNode(v),u.selectNodeContents(v)}}}if(o==="bold"){const d=rn();he.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(C.value={command:"bold",state:d}),e.nextTick(()=>{r&&(El(r),e.nextTick(()=>{const m=wl("bold");he.value.bold=m})),we(),Zt(),Ut()});return}if(o==="italic"){const d=Sn();he.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(C.value={command:"italic",state:d}),e.nextTick(()=>{r&&(El(r),e.nextTick(()=>{const m=wl("italic");he.value.italic=m})),we(),yl(),Zt(),Ut()});return}let c=!1;try{c=document.execCommand(o,!1,n)}catch{}e.nextTick(()=>{if(r&&El(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=wl("bold");he.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=wl("italic");he.value.italic=u});else{const u=document.queryCommandState(o);he.value[o]=u}else{const u=document.queryCommandState(o);he.value[o]=u}}catch{he.value.hasOwnProperty(o)?he.value[o]=!he.value[o]:he.value[o]=!0}if(o==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const v=u.getRangeAt(0),h=v.commonAncestorContainer.nodeType===1?v.commonAncestorContainer.closest("a"):v.commonAncestorContainer.parentElement?.closest("a");h&&(!h.getAttribute("href")||h.getAttribute("href")==="")&&h.setAttribute("href",n)}f.value.querySelectorAll("a").forEach(v=>{const h=v.getAttribute("href");(!h||h===""||h==="#")&&v.setAttribute("href",n)})}we(),Zt(),Ut()})},wl=(o,n=null)=>{if($.disabled||!f.value)return!1;try{if(o==="formatBlock"&&n){const r=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const c=r.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const m=d.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===n||r.toLowerCase()===n.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="STRONG"||v.tagName==="B"||v.closest&&v.closest("strong, b"))&&(u=!0),!u&&v.style&&parseInt(v.style.fontWeight)>=600&&(u=!0),!u))try{const h=window.getComputedStyle(v);parseInt(h.fontWeight)>=600&&(u=!0)}catch{}return he.value.hasOwnProperty(o)?he.value[o]:(he.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;v=!0;let E=M.parentElement;for(;E&&E!==f.value;){if(E.tagName==="STRONG"||E.tagName==="B"){u=!0;break}if(E.style&&parseInt(E.style.fontWeight)>=600){u=!0;break}E=E.parentElement}}else if(M.nodeType===1){const T=M;if(T.tagName==="STRONG"||T.tagName==="B"){u=!0;break}if(T.style&&parseInt(T.style.fontWeight)>=600){u=!0;break}}if(u)break}}return he.value[o]=u&&v,u&&v}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="EM"||v.tagName==="I"||v.closest&&v.closest("em, i"))&&(u=!0),!u&&v.style&&v.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(v).fontStyle==="italic"&&(u=!0)}catch{}return he.value.hasOwnProperty(o)?he.value[o]:(he.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;v=!0;let E=M.parentElement;for(;E&&E!==f.value;){if(E.tagName==="EM"||E.tagName==="I"){u=!0;break}if(E.style&&E.style.fontStyle==="italic"){u=!0;break}E=E.parentElement}}else if(M.nodeType===1){const T=M;if(T.tagName==="EM"||T.tagName==="I"){u=!0;break}if(T.style&&T.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return he.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return c.collapsed&&he.value.hasOwnProperty(o)?he.value[o]:(he.value[o]=d,d)}return he.value.hasOwnProperty(o)?he.value[o]:!1}catch{return he.value.hasOwnProperty(o)?he.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},ln=o=>{$.disabled||!$.richText||(be.value=be.value===o?null:o,o==="askAi"&&(st.value=null))},Pt=()=>{be.value=null,rt.value=null},Bl=o=>{Gl("formatBlock",o),Pt()},lo=o=>{if(!o||!f.value)return o;const n=De=>{let Se=De.nodeType===Node.TEXT_NODE?De.parentElement:De;for(;Se&&Se!==f.value;){const vt=Se.tagName;if(vt==="P"){const vl=Se.parentElement;if(vl===f.value||vl.tagName==="BLOCKQUOTE")return Se}if(vt==="BLOCKQUOTE")break;Se=Se.parentElement}return null},a=n(o.startContainer),r=n(o.endContainer);if(!a||!r)return o;const c=[],d=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:De=>{const Se=De.tagName;if(Se==="P"){const vt=De.parentElement;if(vt===f.value||vt.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Se==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(a),v=c.indexOf(r);if(m===-1||v===-1)return o;const h=Math.min(m,v),M=Math.max(m,v),T=c.slice(h,M+1);if(T.length===0)return o;const E=T[0],G=T[T.length-1],Y=document.createRange();return Y.setStartBefore(E),Y.setEndAfter(G),Y},On=()=>{if($.disabled||!$.richText||!f.value)return;q.value?(Le.value&&(clearTimeout(Le.value),Le.value=null),St(),q.value=!1):St(),Pt(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let n=o.getRangeAt(0);!n.collapsed&&$l(n)&&(n=lo(n),o.removeAllRanges(),o.addRange(n));let a=null;!n.collapsed&&$l(n)&&(a=Ce());const r=n.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(v=>{if(v.nodeType===Node.ELEMENT_NODE)if(v.tagName==="P"||v.tagName==="DIV")u.insertBefore(v,c);else{const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),u.insertBefore(h,c)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),u.insertBefore(h,c)}}),c.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=n.extractContents();u.appendChild(m),n.insertNode(u);const v=[],h=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:E=>E.parentNode===u&&E.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let M;for(;M=h.nextNode();)v.push(M);if(v.forEach(E=>{const G=document.createElement("p");E.parentNode.insertBefore(G,E),G.appendChild(E)}),u.querySelectorAll("p, div").forEach(E=>{E.textContent.trim()===""&&!E.querySelector("img")&&(E.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const E=document.createElement("p");E.innerHTML="<br>",u.appendChild(E)}}e.nextTick(()=>{a&&El(a),Jl(),we(),Ut()})},nn=()=>{if(!f.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!r||!f.value.contains(r))return;const c=M=>{if(!M)return!1;const T=M.textContent||"",G=(M.innerHTML||"").trim();return T.trim()===""||G===""||G==="<br>"||G==="<br/>"||G==="<p></p>"||G==="<p><br></p>"||G==="<p><br/></p>"||G==="<p> </p>"||G==="<p><br> </p>"||G==="<div></div>"||G==="<div><br></div>"||G==="<div><br/></div>"};let d=null;for(a.nodeType===3?d=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?d=a:d=a.closest("p, div"),d&&r.contains(d)&&c(d)&&d.remove();r.lastChild;){const M=r.lastChild;if(M.nodeType===1&&M.tagName==="BR")M.remove();else if(M.nodeType===3)if((M.textContent||"").trim()==="")M.remove();else break;else break}if(r.children.length>0)for(let M=r.children.length-1;M>=0;M--){const T=r.children[M];if((T.tagName==="P"||T.tagName==="DIV")&&c(T))T.remove();else break}let u=r.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(r.innerHTML=u);const v=document.createElement("p");v.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(v,r.nextSibling):r.parentNode.appendChild(v):f.value&&f.value.appendChild(v);const h=document.createRange();h.selectNodeContents(v),h.collapse(!0),o.removeAllRanges(),o.addRange(h),e.nextTick(()=>{Jl(),we()})},Zt=()=>{if(!f.value){ge.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");ge.value=!!r}else ge.value=!1}catch{ge.value=!1}},$n=()=>{if(!f.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),ie.value=Ce();const n=window.getSelection();let a="";n.rangeCount>0&&(a=n.getRangeAt(0).toString()),ze.value="",lt.value=a,nt.value="",fe.value=null,Me.value=!0,Pt(),e.nextTick(()=>{R.value&&R.value.focus()})},Ln=()=>{if(!f.value)return;q.value?(Le.value&&(clearTimeout(Le.value),Le.value=null),St(),q.value=!1):St();const o=window.getSelection();let n=null;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;n=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!n&&fe.value&&(n=fe.value),n&&n.parentNode){const a=document.createDocumentFragment();for(;n.firstChild;)a.appendChild(n.firstChild);if(n.parentNode.replaceChild(a,n),a.firstChild){const r=document.createRange();r.setStartBefore(a.firstChild),r.setEndAfter(a.lastChild||a.firstChild),o.removeAllRanges(),o.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),o.removeAllRanges(),o.addRange(r)}fe.value=null}else Gl("unlink");ge.value=!1,Pt(),e.nextTick(()=>{we(),Zt()})},k=()=>{$.disabled||!$.richText||f.value&&(q.value?(Le.value&&(clearTimeout(Le.value),Le.value=null),St(),q.value=!1):St(),Pt(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{W(),we(),Ut()}))},y=()=>{$.disabled||!$.richText||f.value&&(q.value?(Le.value&&(clearTimeout(Le.value),Le.value=null),St(),q.value=!1):St(),Pt(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{W(),we(),Ut()}))},x=o=>{const n=o.parentElement;if(!n||n.tagName!=="OL")return null;let a=0,r=o.previousElementSibling;for(;r;)r.tagName==="LI"&&a++,r=r.previousElementSibling;return a+1},W=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(n=>{const a=n.parentElement;if(a&&a.tagName==="LI"){const r=x(a);r!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},de=()=>{if($.disabled||!$.richText||!f.value)return;Pt(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const n=o.getRangeAt(0),a=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{W(),we()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=a.previousElementSibling;if(c&&c.tagName==="LI"){const d=r.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const m=x(c);u.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),W();const v=document.createRange();v.selectNodeContents(a),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{we(),Ut()})}else document.execCommand("indent",!1),e.nextTick(()=>{W(),we(),Ut()})},Vt=()=>{if($.disabled||!$.richText||!f.value)return;Pt(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const n=o.getRangeAt(0),a=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{W(),we()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=r.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){r.tagName==="OL"&&a.removeAttribute("data-parent-num"),d.insertBefore(a,c.nextSibling),r.children.length===0&&r.remove(),W();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{we(),Ut()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{W(),we(),Ut()})},dt=e.ref(null),Kt=e.ref(null),ol=e.ref({}),il=e.ref(""),al=e.ref(null),Ql=e.ref("");e.ref("");const cn=e.ref(null);e.ref("");const _l=e.ref([]),no=e.ref(!1),Tn=e.ref(!1),Ao=o=>{if(!o)return"";const n=o.cloneRange(),a=document.createElement("div");return a.appendChild(n.cloneContents()),a.innerHTML},ko=()=>{if($.disabled||!$.richText||!f.value)return;if(dt.value!==null){dt.value=null,il.value="",Ql.value="",cn.value=null,_l.value=[],Cn(!0);return}Pt(),f.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0);if(n.collapsed||!$l(n))return;Ql.value=Ao(n)||"",cn.value=Ce();const a=n.getBoundingClientRect(),r=f.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=a.bottom-c.top,m=Math.max(d+8,0);ol.value={top:`${m}px`,bottom:"auto"},dt.value=Date.now(),e.nextTick(()=>{if(il.value="",al.value){const h=al.value;h.style.height="auto",h.style.height=`${h.scrollHeight}px`,h.focus()}const v=r.querySelector(".dss-comment-overlay");if(v&&r){const h=r.querySelector(".dss-text-editor-footer");if(h){const M=r.getBoundingClientRect(),T=v.getBoundingClientRect(),E=h.getBoundingClientRect(),G=T.bottom-M.top,Y=E.top-M.top,De=8;if(G>Y-De){const Se=E.height;ol.value={bottom:`${Se+De}px`,top:"auto"}}else ol.value={top:`${m}px`,bottom:"auto"}}}})},oo=()=>{if(!il.value.trim())return;const o=il.value.trim(),n=new Date,a={text:o,selectionText:Ql.value,selectionRange:cn.value,commentId:dt.value,user:$.commentUser||null,createdAt:n.toISOString()};_l.value=[..._l.value,a],X("comment-submitted",a),so(a),cn.value&&!Co(cn.value)&&Do(dt.value,cn.value),il.value="",e.nextTick(()=>{if(al.value){const r=al.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Rl("sendComment")})},ao=(o,n)=>{if(!(!$.commentUser||!o.user||o.user.id!==$.commentUser.id)){if(_l.value=_l.value.filter((a,r)=>r!==n),dt.value!==null&&f.value){const a=String(dt.value),r=f.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&_l.value.length>0){const c=[],d=new Set;_l.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),c.push(u.user))}),c.length>0?r.setAttribute("data-comment-user",JSON.stringify(c[0])):r.removeAttribute("data-comment-user"),c.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(c[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(_l.value.length))}else r&&_l.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(X("comment-deleted",{comment:o,index:n,commentId:dt.value}),$.comments&&Array.isArray($.comments)){const a=$.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));X("update:comments",a)}e.nextTick(()=>{Rl("deleteComment")})}},Co=o=>{if(!o||!f.value)return!1;try{const n=bo(o);if(!n)return!1;const a=n.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},bo=o=>{if(!o||!f.value)return null;try{const n=document.createRange();if(o.type==="element"&&o.element)return f.value.contains(o.element)?(n.setStart(o.element,o.offset),n.collapse(!0),n):null;let a=0;const r=[f.value];let c=null,d=!1,u=!1;for(;!u&&(c=r.pop());)if(c.nodeType===3){const m=a+c.length;!d&&o.start>=a&&o.start<=m&&(n.setStart(c,o.start-a),d=!0),d&&o.end>=a&&o.end<=m&&(n.setEnd(c,o.end-a),u=!0),a=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return d?n:null}catch{return null}},Do=(o,n)=>{if(!(!o||!n||!f.value))try{const a=bo(n);if(!a||a.collapsed)return;const r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const m=c.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(o)&&m.getAttribute("data-fake-comment")!==String(o)&&m.setAttribute("data-comment",String(o));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(o));try{const m=a.startContainer,v=a.endContainer,h=a.startOffset,M=a.endOffset,T=m.nodeType===3?m.parentNode:m,E=v.nodeType===3?v.parentNode:v;if(T===E&&h===0&&M===(v.nodeType===3?v.length:E.childNodes.length)&&(T.tagName==="P"||T.tagName==="DIV"||T.tagName==="H1"||T.tagName==="H2"||T.tagName==="H3"||T.tagName==="H4"||T.tagName==="H5"||T.tagName==="H6")){const Y=a.extractContents();d.appendChild(Y),a.insertNode(d)}else a.surroundContents(d)}catch{const v=a.extractContents();d.appendChild(v),a.insertNode(d)}const u=f.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{Rl("wrapSelectionWithCommentMarker"),we()})}catch{}},so=o=>{if(!o||!o.commentId)return;const n=Array.isArray($.comments)?[...$.comments]:[],a=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let r=n.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(a)||d.conversation_id===a);const c={text:o.text,user:o.user,createdAt:o.createdAt,created_at:o.createdAt,updated_at:o.createdAt};if(r>=0){const d=n[r];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=o.createdAt,!d.article_id&&n.length>0){const u=n.find(m=>m.article_id);u&&(d.article_id=u.article_id)}}else{const d=o.selectionRange,u=n.length>0&&n.find(v=>v.article_id)?.article_id||null,m={conversation_id:a,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:o.selectionText||"",conversation:[c],created_by_user:o.user,created_at:o.createdAt,updated_at:o.createdAt,status:"active"};n.push(m)}no.value=!0,X("update:comments",n)},Ho=(o,n=[])=>{if($.disabled||!$.richText||!f.value)return;const a=f.value;let r=null;try{r=a.querySelector(o)}catch{return}if(!r)return;Pt(),a.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),Ql.value=r.innerHTML||"",cn.value=Ce();const u=c.getBoundingClientRect(),m=a.parentElement;if(m){const M=m.getBoundingClientRect(),T=u.bottom-M.top,G=Math.max(T+8,0);ol.value={top:`${G}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let h=[];if(v&&$.comments&&Array.isArray($.comments)){const M=$.comments.find(T=>String(T.conversation_id)===String(v));if(M&&M.conversation&&Array.isArray(M.conversation)){const T=M.conversation.map(E=>({id:E.id||E.commentary_id,commentary_id:E.id||E.commentary_id,conversation_id:M.id||M.conversation_id,text:E.text,user:E.user,createdAt:E.created_at||E.createdAt,updated_at:E.updated_at||E.updatedAt}));h.push(...T)}}h.length===0&&Array.isArray(n)&&n.length>0&&(h=n.slice()),h.sort((M,T)=>{const E=De=>{if(!De)return 0;const Se=new Date(De).getTime();return isNaN(Se)?0:Se},G=E(M.createdAt),Y=E(T.createdAt);return G===Y?0:G-Y}),_l.value=h,Cn(!0),dt.value=v||null,r&&(Kt.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(il.value="",al.value){const M=al.value;M.style.height="auto",M.style.height=`${M.scrollHeight}px`,M.focus()}if(m){const M=m.querySelector(".dss-comment-overlay");if(M){const T=m.querySelector(".dss-text-editor-footer");if(T){const E=m.getBoundingClientRect(),G=M.getBoundingClientRect(),Y=T.getBoundingClientRect(),De=G.bottom-E.top,Se=Y.top-E.top,vt=8;if(De>Se-vt){const vl=Y.height;ol.value={bottom:`${vl+vt}px`,top:"auto"}}}}}Rl("openCommentOverlayForSelector")})},An=e.ref(null),Sl=e.ref(0),O=o=>{if(!($.disabled||!$.richText)){if(o.key==="Escape"){const n=window.getSelection();if(n.rangeCount>0){const r=n.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){o.preventDefault();let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(m,u.nextSibling):c.appendChild(m),setTimeout(()=>{nn()},50);return}}}if(o.key.length===1||o.key==="Enter"){const n=window.getSelection();if(n&&n.rangeCount>0){const a=n.getRangeAt(0),r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,v=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.contains(m)&&m!==u||d.contains(v)&&v!==u){o.preventDefault();const h=document.createRange();h.setStartAfter(d),h.collapse(!0),n.removeAllRanges(),n.addRange(h);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0);let r=null,c=null;if(a.collapsed)if(o.key==="Backspace"){const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const m=u.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const m=u.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.commonAncestorContainer,u=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(r=d,c=r.closest(".dss-image-wrapper")):(r=d.querySelector("img"),r&&(c=r.closest(".dss-image-wrapper"))),c){const v=c.contains(u)||u===c,h=c.contains(m)||m===c,T=a.cloneContents().textContent?.trim()||"",E=c.textContent?.trim()||"";(!v||!h||T.length>E.length)&&(c=null,r=null)}}if(c){o.preventDefault(),o.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const m=document.createRange();m.setStartAfter(u),m.collapse(!0),n.removeAllRanges(),n.addRange(m),e.nextTick(()=>{we()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?Vt():de();return}if(o.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0);if(a.collapsed){const u=a.startContainer,m=v=>{if(!v)return!1;let h=v.previousSibling;for(;h;){if(h.classList&&h.classList.contains("dss-image-wrapper")||h.tagName==="IMG"||h.querySelector&&h.querySelector(".dss-image-wrapper")||h.querySelector&&h.querySelector("img"))return!0;h=h.previousSibling}const M=v.parentElement;return M&&M!==f.value?m(M):!1};if(u.nodeType===3){const v=u.parentElement;if(v&&(m(v)||m(u))){const h=v.closest("p, div");if(h&&h!==f.value){o.preventDefault(),o.stopPropagation();let M=null;const T=a.startOffset;T<u.length&&(M=u.splitText(T));const E=document.createElement("p");if(M?E.appendChild(M):E.innerHTML="<br>",u.length===0){const Y=u.parentElement;Y&&(Y.removeChild(u),Y.childNodes.length===0&&Y.appendChild(document.createElement("br")))}h.nextSibling?h.parentNode.insertBefore(E,h.nextSibling):h.parentNode.appendChild(E);const G=document.createRange();M?G.setStart(M,0):G.setStart(E,0),G.collapse(!0),n.removeAllRanges(),n.addRange(G),e.nextTick(()=>{we()});return}}}}const r=a.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=Y=>{if(!Y)return!1;const De=Y.textContent||"",vt=(Y.innerHTML||"").trim(),vl=vt.replace(/<br\s*\/?>/gi,"").trim();return De.trim()===""||vt===""||vl===""||vt==="<br>"||vt==="<br/>"||vt==="<p></p>"||vt==="<p><br></p>"||vt==="<p><br/></p>"||vt==="<p> </p>"||vt==="<p><br> </p>"||vt==="<div></div>"||vt==="<div><br></div>"||vt==="<div><br/></div>"},v=c.lastChild,h=v&&v.nodeType===1&&v.tagName==="BR",M=a.startContainer,T=M.nodeType===3?M.parentElement:M,E=T===c||T&&T.parentElement===c;if(u&&m(u)||h&&E){o.preventDefault(),setTimeout(()=>{nn()},50);return}}}}if(o.key===" "){const n=Date.now(),a=n-Sl.value;if(An.value===" "&&a<300){const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(d){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){o.preventDefault(),de();return}}}}An.value=" ",Sl.value=n}else An.value=o.key}},xl=o=>{if($.disabled||!$.richText)return;o.preventDefault();let n=o.clipboardData.getData("text/html"),a=o.clipboardData.getData("text/plain");n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),St();const r=window.getSelection();let c=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),c=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const v=new DOMParser().parseFromString(u,"text/html");let h=f.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach(T=>{if(h>0){const E=v.createElement("p");E.innerHTML=T.innerHTML,T.parentNode.replaceChild(E,T)}else h++}),c){const T=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],E=Array.from(v.body.children).filter(G=>T.includes(G.tagName));if(E.length===1){const G=E[0].tagName,Y=c.tagName,De=c.textContent.trim()===""&&!c.querySelector("img");let Se=!1;if(["H1","H2","H3","H4","H5","H6"].includes(Y)?Se=!0:De||(G===Y||G==="P")&&(Se=!0),Se)return E[0].innerHTML.trim()}}return v.body.innerHTML.trim()};if(n){const u=d(n);document.execCommand("insertHTML",!1,u)}else if(a)if(/<[a-z][\s\S]*>/i.test(a)){const m=d(a);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,a);we()},Dl=o=>{if(be.value){const a=o.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&Pt()}if(yt.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=f.value&&a.closest(".dss-text-editor-content");!r&&!c&&hn()}if(st.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=a.closest(".dss-toolbar-dropdown");!r&&!c&&io()}const n=o.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(rt.value=null),!f.value||!n.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);K.value=!r.collapsed&&$l(r)}else K.value=!1}if(dt.value!==null){const a=document.querySelector(".dss-comment-overlay");let r=!1;if(a){const u=a.getBoundingClientRect(),m=o.clientX,v=o.clientY;r=m>=u.left&&m<=u.right&&v>=u.top&&v<=u.bottom}const c=n.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!r&&!d&&(dt.value=null,il.value="",Ql.value="",cn.value=null,_l.value=[],Cn(!0))}},pl=(o,n)=>{o&&o.stopPropagation&&o.stopPropagation(),Ze.value&&(clearTimeout(Ze.value),Ze.value=null),rt.value=n},Ol=o=>{const n=o.relatedTarget;if(n){const a=n.closest(".dss-toolbar-dropdown-submenu"),r=n.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||r)return}Ze.value&&clearTimeout(Ze.value),Ze.value=setTimeout(()=>{rt.value=null,Ze.value=null},150)},sl=o=>{rt.value=null};let fl=0;const un=o=>{if(!o)return;const n=Array.from(o.children);n.forEach(a=>{a.classList.contains("dss-toolbar-dropdown-submenu")||a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(a.tagName==="BUTTON"||a.tagName==="DIV")&&!a.classList.contains("dss-toolbar-dropdown-item")&&a.classList.add("dss-toolbar-dropdown-item")}),n.forEach((a,r)=>{if(a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||a.classList.contains("dss-toolbar-dropdown-submenu")||!a.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(a.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(h=>h.tagName==="BUTTON"||h.tagName==="DIV").length>0:!1),d=a.nextElementSibling,u=d&&!d.classList.contains("dss-toolbar-dropdown-submenu")&&!d.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&d.tagName==="DIV"&&!d.classList.contains("dss-toolbar-dropdown-item")&&Array.from(d.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(c||u){const m=`submenu-auto-${++fl}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let v=null;c?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(c,a.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),v=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),v=d),v&&(v.setAttribute("data-submenu-id",m),v.setAttribute("data-processed","true"),c&&a.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(M=>{(M.tagName==="BUTTON"||M.tagName==="DIV")&&!M.classList.contains("dss-toolbar-dropdown-item")&&M.classList.add("dss-toolbar-dropdown-item")}))}})},dn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{un(n),n.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=v=>{const h=c.getAttribute("data-submenu-id");h&&pl(v,h)},m=Ol;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m}}),n.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=h=>{const M=c.getAttribute("data-submenu-id");M&&pl(h,M)},m=Ol;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(h=>{h.addEventListener("click",sl)})})})};let wt=null;const Mt=()=>{if(rt.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${rt.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${rt.value}"]`);o&&n&&yo(o,n)}if(yt.value&&Ut(),$.richText){if(wt!==null)return;wt=setTimeout(()=>{wt=null,Rl("handleWindowResize")},150)}},ft=()=>{if(!$.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(n=>{Array.from(n.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},cl=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),n=a=>{if(a.preventDefault(),a.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};o.forEach(a=>{a.addEventListener("selectstart",n),a.addEventListener("mousedown",n),a.addEventListener("dragstart",n),a.addEventListener("contextmenu",n),a.addEventListener("click",r=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Dt.value?Fl():Nl(),V.value?zl():En()})}),e.nextTick(()=>{cl()}),$.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Dl),window.addEventListener("resize",Mt);let o=null;const n=()=>{o===null&&(o=setTimeout(()=>{o=null,Mt()},150))};window.addEventListener("scroll",n,!0),f.value._windowScrollHandler=n,f.value._windowScrollTimeout=o,f.value.closest(".editor-with-comments"),f.value.closest(".dss-text-editor-content-wrapper");const a=f.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,Mt()},150))};a&&(a.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:a,handler:c}),e.nextTick(()=>{dn(),ft()}),f.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!$.disabled&&m.preventDefault();const M=v.closest(".dss-image-no-alt-icon"),T=v.closest(".dss-image-wrapper");if(M||T&&v===T){m.preventDefault(),m.stopPropagation();const E=window.getSelection(),G=document.createRange();G.setStartAfter(T),G.collapse(!0),E.removeAllRanges(),E.addRange(G)}else T&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const E=window.getSelection();if(E.rangeCount>0){const Y=E.getRangeAt(0).commonAncestorContainer,De=Y.nodeType===3?Y.parentElement:Y;if(T.contains(De)&&De!==T.querySelector("img")){const Se=document.createRange();Se.setStartAfter(T),Se.collapse(!0),E.removeAllRanges(),E.addRange(Se)}}else{const G=document.createRange();G.setStartAfter(T),G.collapse(!0),E.addRange(G)}}))},!0),f.value.addEventListener("mousedown",m=>{const v=m.target,h=v.closest(".dss-image-no-alt-icon"),M=v.closest(".dss-image-wrapper");if(h||M&&v.tagName!=="IMG"){m.preventDefault();const T=window.getSelection(),E=document.createRange();M&&(E.setStartAfter(M),E.collapse(!0),T.removeAllRanges(),T.addRange(E))}},!0),f.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!f.value)return;f.value.querySelectorAll("img").forEach(h=>{if(!h.closest(".dss-image-wrapper"))h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="";else{const T=h.getAttribute("alt")||h.alt||"";if(T){const E=h.getAttribute("src")||h.src||"",G=E.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),Y=T===E||T===G;(T.startsWith("http://")||T.startsWith("https://")||T.startsWith("data:")||Y||Y)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),tt()})}),f.value.addEventListener("dragstart",m=>{const v=m.target,h=v.tagName==="IMG"?v:v.closest("img"),M=h?.closest(".dss-image-wrapper");h&&f.value.contains(h)&&(qt.value=M||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",m=>{qt.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",m=>{qt.value&&(m.preventDefault(),m.stopPropagation())}),f.value.addEventListener("drop",m=>{if(!qt.value||!f.value)return;m.preventDefault(),m.stopPropagation();const v=qt.value,h=v.classList?.contains("dss-image-wrapper"),M=h?v.querySelector("img"):v,T=h?v:M?.closest(".dss-image-wrapper");if(!M||!f.value.contains(M)){qt.value=null;return}let E=null;const G=m.clientX,Y=m.clientY;if(document.caretRangeFromPoint)E=document.caretRangeFromPoint(G,Y);else{const rl=window.getSelection();rl.rangeCount>0?E=rl.getRangeAt(0).cloneRange():(E=document.createRange(),E.selectNodeContents(f.value),E.collapse(!1))}if(!E){qt.value=null;return}const De=E.commonAncestorContainer,Se=De.nodeType===3?De.parentElement:De;if(Se?.closest(".dss-image-wrapper")===T||T&&T.contains(Se)){qt.value=null;return}if(T&&(Se===T||T.contains(Se))){qt.value=null;return}const vl=M.getAttribute("src");let ul=null;T?ul=T.cloneNode(!0):ul=M.cloneNode(!0);try{let rl=E.startContainer;if(rl.nodeType===3&&(rl=rl.parentElement),T&&(rl===T||T.contains(rl))){const dl=document.createRange();dl.setStartAfter(T),dl.collapse(!0),E=dl}E.insertNode(ul);const ml=document.createRange();ml.setStartAfter(ul),ml.collapse(!0);const Jt=window.getSelection();Jt.removeAllRanges(),Jt.addRange(ml)}catch{if(f.value.childNodes.length===0){const ml=document.createElement("p");ml.appendChild(ul),f.value.appendChild(ml)}else{const ml=f.value.lastChild;if(ml&&ml.nodeType===1)ml.appendChild(ul);else{const Jt=document.createElement("p");Jt.appendChild(ul),f.value.appendChild(Jt)}}}T?T.remove():M.remove(),qt.value=null,e.nextTick(()=>{const rl=f.value.querySelectorAll("img");let ml=!1;rl.forEach(Jt=>{if(Jt.getAttribute("src")===vl)if(!ml)ml=!0;else{const dl=Jt.closest(".dss-image-wrapper");dl?dl.remove():Jt.remove()}}),tt(),we()})}),f.value.addEventListener("dragend",m=>{qt.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(v=>{v.addedNodes.forEach(h=>{if(h.nodeType===1){h.tagName==="IMG"&&(h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="");const M=h.querySelectorAll&&h.querySelectorAll("img");M&&M.forEach(T=>{T.removeAttribute("alt"),T.removeAttribute("data-alt"),T.setAttribute("alt",""),T.setAttribute("data-alt",""),T.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{tt(),ft(),d=null},100)});if(u.observe(f.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{ft()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),$.modelValue){const m=zn($.modelValue);f.value.innerHTML=m,le()}e.nextTick(()=>{const m=f.value.innerHTML||"",v=$.title||"",h=$.description||"";U.value=m,se.value=v,He.value=h,it.value=v,bt.value=h,W(),tt(),yl(),Hl(),Zn(),Ot()}),Zt(),Jl(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Dl),window.removeEventListener("resize",Mt),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),wt!==null&&(clearTimeout(wt),wt=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),Le.value&&clearTimeout(Le.value),Ze.value&&clearTimeout(Ze.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),Oe.value&&Oe.value.disconnect(),pt.value!==null&&(cancelAnimationFrame(pt.value),pt.value=null),Ee.value!==null&&(clearTimeout(Ee.value),Ee.value=null),Qe.value!==null&&(clearTimeout(Qe.value),Qe.value=null),Cn(!0),f.value&&f.value._scrollHandlers){const{wrapper:n,content:a,handler:r}=f.value._scrollHandlers;n&&n.removeEventListener("scroll",r),a&&a.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const Ro=o=>{const n=o.target,a=n.closest("a");if(a&&!$.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(a);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const r=n.closest(".dss-image-wrapper");r&&n.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(r.contains(m)&&m!==r.querySelector("img")){const v=document.createRange();v.setStartAfter(r),v.collapse(!0),c.removeAllRanges(),c.addRange(v)}}tt(),Zt(),Jl(),Ut(),Hl()}):e.nextTick(()=>{tt(),Zt(),Jl(),Ut(),Hl()})},ro=()=>{kt();const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0);K.value=!a.collapsed&&$l(a),!a.collapsed&&C.value&&(C.value=null)}else K.value=!1;if(tt(),Zt(),Jl(),Ut(),Hl(),o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c&&c.closest(".dss-text-editor-footer")){o.removeAllRanges(),K.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(!c.collapsed)if(a==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let m=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(m=!0),!m&&u.style&&parseInt(u.style.fontWeight)>=600&&(m=!0),!m))try{const v=window.getComputedStyle(u);parseInt(v.fontWeight)>=600&&(m=!0)}catch{}he.value[a]=m}else{const d=document.queryCommandState(a);he.value[a]=d}}}catch{}})},Hl=()=>{if(!$.richText||$.disabled||!f.value){S.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){S.value="p";return}const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!f.value.contains(r)){S.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){S.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?S.value=d:S.value="p"}catch{S.value="p"}},Jl=()=>{if(!f.value){gt.value=!1;return}try{const o=window.getSelection();let n=!1;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");n=!!(c&&f.value.contains(c))}gt.value=n}catch{gt.value=!1}},$l=o=>{if(!o||!f.value)return!1;const n=o.commonAncestorContainer;if(!n)return!1;const a=n.nodeType===3?n.parentElement:n;return a?f.value.contains(a):!1},hn=()=>{yt.value=!1},Ut=()=>{if(!$.floatingToolbar||!$.richText||$.disabled){yt.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){yt.value=!1;return}const n=o.getRangeAt(0);if(n.collapsed||!$l(n)){yt.value=!1;return}const a=n.getBoundingClientRect();if(!a||a.width===0&&a.height===0){yt.value=!1;return}const r=f.value;if(!r){yt.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){yt.value=!1;return}const d=40,u=8,m=a.top-d/2+15;let v=a.left+a.width/2;const h=window.innerWidth||document.documentElement.clientWidth||0;let M=0;tl.value&&(M=tl.value.getBoundingClientRect().width);const T=(M||320)/2;let E=c.left+T,G=c.right-T;if(G<E){const Y=c.left+c.width/2;E=Y,G=Y}if(h>0){const Y=T+u,De=h-T-u;if(E=Math.max(E,Y),G=Math.min(G,De),G<E){const Se=h/2;E=Se,G=Se}}v<E?v=E:v>G&&(v=G),Ue.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},yt.value=!0},wo=o=>{$.disabled||!$.richText||(st.value=st.value===o?null:o,o==="askAi"&&(be.value=null))},io=()=>{st.value=null,rt.value=null},yn=o=>{Bl(o),io()};let Ll=null,kn=null,Vl=null,Vn=null;const Io=o=>{if($.disabled||!$.richText){Hn(),Rn();return}const n=o.target,a=n.closest("a"),r=n.closest("img");if(Ll&&(clearTimeout(Ll),Ll=null),Vl&&(clearTimeout(Vl),Vl=null),a&&a!==kn){Rn(),kn=a;let c=a.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=a.textContent||""),fe.value=a,ue.value=c,j.value=!0,ke.value=!0,co(a)}else!a&&kn?(kn=null,Ll=setTimeout(()=>{ke.value||Hn()},150)):a&&a===kn&&co(a);if(r&&r!==Vn){Hn(),Vn=r;let c=r.getAttribute("alt");c===null&&(c=r.alt||"");let d=r.getAttribute("data-alt");d===null&&(d=c),r.hasAttribute("alt")||r.setAttribute("alt",c),r.hasAttribute("data-alt")||r.setAttribute("data-alt",d),Ge.value=r,Xt.value=c.trim()||_("textEditor.image.noAlt"),$t.value=!0,$e.value=!0,uo(r)}else!r&&Vn?(Vn=null,Vl=setTimeout(()=>{$e.value||Rn()},150)):r&&r===Vn&&uo(r)},Dn=o=>{const n=o.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(kn=null,Vn=null,Ll&&(clearTimeout(Ll),Ll=null),Vl&&(clearTimeout(Vl),Vl=null),Hn(),Rn())},Hn=()=>{ke.value=!1,setTimeout(()=>{ke.value||(j.value=!1,ue.value="",Me.value||(fe.value=null))},100)},co=o=>{if(!o||!f.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;H.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Rn=()=>{$e.value=!1,setTimeout(()=>{$e.value||($t.value=!1,Xt.value="",xt.value||(Ge.value=null))},100)},uo=o=>{if(!o||!f.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;te.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},xo=()=>{if(!ue.value||!fe.value)return;let n=fe.value.getAttribute("href")||ue.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},Fo=()=>{if(fe.value){const o=fe.value.textContent||"",n=fe.value.getAttribute("href")||"",a=fe.value;ze.value=n,lt.value=o,nt.value=o,ke.value=!1,j.value=!1,ue.value="",fe.value=a,Me.value=!0}else if(ge.value){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(r){const c=r.textContent||"",d=r.getAttribute("href")||"";ze.value=d,lt.value=c,nt.value=c,fe.value=r,Me.value=!0}}}else{ie.value=Ce();const o=window.getSelection();let n="";o.rangeCount>0&&(n=o.getRangeAt(0).toString()),ze.value="",lt.value=n,nt.value="",fe.value=null,Me.value=!0}e.nextTick(()=>{R.value&&(R.value.focus(),R.value.select())})},qn=()=>{Me.value=!1,ze.value="",lt.value="",nt.value="",fe.value=null,ie.value=null},ql=()=>{if(!ze.value.trim()){qn();return}if(q.value?(Le.value&&(clearTimeout(Le.value),Le.value=null),St(),q.value=!1):St(),lt.value.trim()||(lt.value=ze.value.trim()),fe.value&&f.value&&f.value.contains(fe.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const n=fe.value;if(n.setAttribute("href",ze.value.trim()),lt.value.trim()!==nt.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=lt.value.trim()}n.style.color="#60afdf",n.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(n),a.collapse(!1),o.removeAllRanges(),o.addRange(a),we()}else if(f.value){f.value.focus();const o=window.getSelection();o.removeAllRanges(),ie.value&&El(ie.value);let n=null;if(o.rangeCount>0&&(n=o.getRangeAt(0)),n&&!n.collapsed){n.toString();const a=document.createElement("a");a.href=ze.value.trim(),a.textContent=lt.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",n.deleteContents(),n.insertNode(a);const r=document.createTextNode(" ");n.setStartAfter(a),n.insertNode(r),n.setStartAfter(r),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(f.value),n.collapse(!1));const a=n.startContainer,r=a.nodeType===3,c=r&&n.startOffset===a.textContent.length,d=document.createElement("a");if(d.href=ze.value.trim(),d.textContent=lt.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=a.parentElement;for(;u&&u!==f.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==f.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const v=document.createTextNode(" ");m.appendChild(v);const h=document.createRange();h.setStartAfter(d),h.collapse(!0),o.removeAllRanges(),o.addRange(h)}else{if(n.startOffset>0){const h=a.textContent.substring(0,n.startOffset),M=h[h.length-1];if(M&&M!==" "&&M!==" "&&M!==`
102
102
  `){const T=document.createTextNode(" ");n.insertNode(T),n.setStartAfter(T)}}n.insertNode(d);const v=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(v),n.setStartAfter(v),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}}}else{if(r&&n.startOffset>0){const m=a.textContent.substring(0,n.startOffset),v=m[m.length-1];if(v&&v!==" "&&v!==" "&&v!==`
103
- `){const h=document.createTextNode(" ");n.insertNode(h),n.setStartAfter(h)}}n.insertNode(d);const u=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(u),n.setStartAfter(u),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}}we()}e.nextTick(()=>{qt(),Wn()})},on=()=>{if(!f.value||ne.value)return;const o=window.getSelection();let n=null;o&&o.rangeCount>0&&(n=Ce());const a=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,r=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const v=m.parentElement;return!v||v.closest("a")||v.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=r.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const v=c[m],h=v.textContent;a.lastIndex=0;const M=[...h.matchAll(a)];if(M.length===0)continue;const T=M.filter(Y=>{const De=Y[0],Se=Y.index;if(Se>0&&h[Se-1]==="@"||Se+De.length<h.length&&h[Se+De.length]==="@")return!1;const vt=v.parentElement;return!(vt&&vt.closest("a"))});if(T.length===0)continue;if(T.length===1&&T[0][0]===h.trim()){const Y=T[0][0],De=Y.startsWith("http://")||Y.startsWith("https://")?Y:`https://${Y}`,Se=document.createElement("a");Se.href=De,Se.textContent=Y,Se.style.color="#60afdf",Se.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(Se,v),u=!0);continue}let E=0;const G=document.createDocumentFragment();if(T.forEach(Y=>{const De=Y.index,Se=Y[0];if(De>E){const ul=h.substring(E,De);ul&&G.appendChild(document.createTextNode(ul))}const vt=Se.startsWith("http://")||Se.startsWith("https://")?Se:`https://${Se}`,vl=document.createElement("a");vl.href=vt,vl.textContent=Se,vl.style.color="#60afdf",vl.style.textDecoration="underline",G.appendChild(vl),E=De+Se.length}),E<h.length){const Y=h.substring(E);Y&&G.appendChild(document.createTextNode(Y))}v.parentNode&&G.childNodes.length>0&&(v.parentNode.replaceChild(G,v),u=!0)}u&&n&&e.nextTick(()=>{El(n),qt()})},mn=()=>{if(!f.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let r;for(;r=n.nextNode();)a.push(r);for(let c=a.length-1;c>=0;c--){const d=a[c],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let v=0;const h=document.createDocumentFragment();m.forEach(M=>{const T=M.index,E=M[0].startsWith("<u>")?"u":"ins",G=M[1]||M[2]||"";T>v&&h.appendChild(document.createTextNode(u.substring(v,T)));const Y=document.createElement(E);Y.textContent=G,h.appendChild(Y),v=T+M[0].length}),v<u.length&&h.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&h.childNodes.length>0&&d.parentNode.replaceChild(h,d)}},Gt=o=>{if(!f.value||ne.value)return;if(!o){mn();return}if(!["*","_",">"].includes(o))return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);if(!r.collapsed)return;const c=r.startContainer.nodeType===Node.TEXT_NODE?r.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):r.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===f.value||!f.value.contains(c))return;const d=()=>{let ul="",rl=0,ml=!1;const Jt=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:en=>en.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let dl=0;for(;Jt.nextNode();){const en=Jt.currentNode,tn=en.textContent||"",pn=dl;if(dl+=tn.length,en===r.startContainer){ul+=tn.substring(0,r.startOffset),rl=pn+r.startOffset,ml=!0;break}ul+=tn}return ml||(rl=ul.length),{textBeforeCursor:ul,cursorCharOffset:rl}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,v=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?v="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?v="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(v=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const h=m[0],M=m[1],T=u.length-h.length,G=(ul=>{let rl=0;const ml=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:dl=>dl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let Jt;for(;Jt=ml.nextNode();){const dl=(Jt.textContent||"").length;if(rl+dl>=ul)return{node:Jt,offset:ul-rl};rl+=dl}return null})(T);if(!G)return;const Y=document.createRange();Y.setStart(G.node,G.offset),Y.setEnd(r.endContainer,r.endOffset);const De=document.createElement(v);De.textContent=M,Y.deleteContents(),Y.insertNode(De);const Se=window.getSelection(),vt=document.createRange();vt.setStartAfter(De),vt.collapse(!0),Se.removeAllRanges(),Se.addRange(vt);const vl=Ce();e.nextTick(()=>{we(),vl&&El(vl)})},mo=()=>{f.value&&(Je.value=Ce(),Ht.value="",It.value="",Oe.value="",ot.value="",St.value="",ll.value=null,Ge.value=null,Ne.value="upload",Et.value=!0,Pt(),e.nextTick(()=>{nl.value&&nl.value.focus(),Ft.value&&(Ft.value.value="")}))},Qt=o=>{const n=o.target?.files?.[0];if(!n){ll.value=null,It.value="";return}ll.value=n;const a=new FileReader;a.onload=r=>{It.value=r.target?.result||""},a.readAsDataURL(n)},kl=()=>{Ft.value&&Ft.value.click()},Eo=()=>{ot.value&&(St.value="")},So=()=>{St.value&&(ot.value="")},po=()=>{let o=Ge.value;if(!o){const n=window.getSelection();if(n&&n.rangeCount>0){const r=n.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(o){const n=o.getAttribute("data-alt")||o.getAttribute("alt")||"";Ge.value=o,Ht.value=n.trim()===""||n.trim()==="Image"?"":n;const a=o.getAttribute("src")||o.src||"";a.startsWith("http://")||a.startsWith("https://")?(Oe.value=a,It.value="",Ne.value="url"):(It.value=a,Oe.value="",Ne.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";ot.value=c.endsWith("px")?c.replace("px",""):c,St.value=d.endsWith("px")?d.replace("px",""):d,Je.value=null}else{mo();return}Et.value=!0,$e.value=!1,Lt.value=!1,e.nextTick(()=>{Ne.value==="url"&&Yt.value?(Yt.value.focus(),Yt.value.select()):nl.value&&(nl.value.focus(),nl.value.select()),Ft.value&&(Ft.value.value="")})},In=()=>{Et.value=!1,Ht.value="",It.value="",Oe.value="",ot.value="",St.value="",ll.value=null,Ge.value=null,Je.value=null,Ne.value="upload"},an=()=>{const o=(Ht.value||"").trim(),n=f.value?._mutationObserver;n&&n.disconnect(),W.value?(Le.value&&(clearTimeout(Le.value),Le.value=null),Vt(),W.value=!1):Vt();const a=Ne.value==="url"?Oe.value.trim():It.value;if(Ge.value&&f.value&&f.value.contains(Ge.value)){a&&(Ge.value.src=a),Ge.value.setAttribute("alt",o),Ge.value.setAttribute("data-alt",o),ot.value?(Ge.value.style.width=`${ot.value}px`,Ge.value.setAttribute("width",ot.value)):(Ge.value.style.removeProperty("width"),Ge.value.removeAttribute("width")),St.value?(Ge.value.style.height=`${St.value}px`,Ge.value.setAttribute("height",St.value)):(Ge.value.style.removeProperty("height"),Ge.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(Ge.value),c.collapse(!0),r.addRange(c)}we()}else{if(!a){n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),In();return}if(f.value){f.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(Je.value&&(El(Je.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&f.value){if(d=document.createRange(),f.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",f.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){In();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!f.value.contains(m)){if(d=document.createRange(),f.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",f.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const v=document.createElement("img");v.src=a,v.setAttribute("alt",o),v.setAttribute("data-alt",o),ot.value&&(v.style.width=`${ot.value}px`,v.setAttribute("width",ot.value)),St.value&&(v.style.height=`${St.value}px`,v.setAttribute("height",St.value));try{d.insertNode(v),d.setStartAfter(v),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(f.value){if(f.value.childNodes.length===0){const T=document.createElement("p");f.value.appendChild(T),T.appendChild(v)}else{const T=f.value.lastChild;if(T&&T.nodeType===1)T.appendChild(v);else{const E=document.createElement("p");f.value.appendChild(E),E.appendChild(v)}}const M=document.createRange();M.setStartAfter(v),M.collapse(!0),c&&(c.removeAllRanges(),c.addRange(M))}}Ge.value=v,we()}}e.nextTick(()=>{n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),qt(),Ut(),In()})};e.watch(()=>$.modelValue,o=>{if($.richText&&f.value&&!ne.value){const n=zn(o||""),r=f.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=n.replace(/&nbsp;|\u00A0/g," ");if(r!==c){const d=Ce();f.value.innerHTML=n,e.nextTick(()=>{le();const u=f.value.innerHTML||"",m=$.title||"",v=$.description||"";U.value=u,se.value=m,He.value=v,ee.value=u,rt.value=m,bt.value=v,Ye.value=[],dt.value=[],Le.value&&(clearTimeout(Le.value),Le.value=null),W.value=!1,d&&El(d),Z(),et(),yl(),qt(),Ut(),Hl(),Rl("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>$.richText,o=>{o?(Ut(),e.nextTick(()=>{qn()})):(hn(),Q.value=[],Ue.value&&(Ue.value.disconnect(),Ue.value=null)),Hl()}),e.watch(()=>$.floatingToolbar,o=>{o?Ut():hn()}),e.watch(()=>$.disabled,o=>{o&&hn(),Hl()}),e.watch(()=>$.description,()=>{e.nextTick(()=>{V.value?zl():En()})}),e.watch(()=>$.title,()=>{e.nextTick(()=>{At.value?Fl():Nl()})}),e.watch(()=>$.customToolbarSlots,()=>{e.nextTick(()=>{ft()})},{deep:!0}),e.watch(()=>$.comments,(o,n)=>{if(no.value){no.value=!1;return}Tn.value||$.richText&&f.value&&e.nextTick(()=>{Ot()})},{deep:!0,immediate:!1});const Ot=()=>{if(!Tn.value&&!(!$.comments||!Array.isArray($.comments)||$.comments.length===0)&&!(!$.richText||!f.value)){Tn.value=!0;try{const o=new Set,n=$.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),a=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=a.length;a.forEach(u=>{const m=u.parentNode;if(m){for(;u.firstChild;)m.insertBefore(u.firstChild,u);m.removeChild(u)}});let c=0;const d=new Set;n.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const m=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!m)return;const v=String(m);if(d.has(v))return;const h=f.value.querySelector(`[data-comment="${v}"]`);if(h){Fn(h,u),d.add(v);return}try{const M=go(u.selection_range,u.selection_text);if(M&&!M.collapsed){const T=M.commonAncestorContainer,E=T.nodeType===3?T.parentElement:T;if(E){const De=E.closest("[data-comment], [data-fake-comment]");if(De){const Se=De.getAttribute("data-comment")||De.getAttribute("data-fake-comment");if(String(Se)===String(m)){De.setAttribute("data-comment",v),De.removeAttribute("data-fake-comment"),Fn(De,u),d.add(v);return}else return}}const G=f.value.querySelector(`[data-comment="${v}"]`);if(G){Fn(G,u),d.add(v);return}const Y=document.createElement("span");Y.setAttribute("data-comment",v),Fn(Y,u);try{M.surroundContents(Y),c++,d.add(v)}catch{try{const Se=document.createRange();Se.setStart(M.startContainer,M.startOffset),Se.setEnd(M.endContainer,M.endOffset),Vo(Se),Se.surroundContents(Y),c++,d.add(v)}catch{try{const vt=M.extractContents();Y.appendChild(vt),M.insertNode(Y),c++,d.add(v)}catch(vt){console.warn("Failed to create comment marker:",vt)}}}}}catch{}}),e.nextTick(()=>{Rl("restoreCommentsFromModel"),we(),Tn.value=!1})}catch{Tn.value=!1}}},Vo=o=>{if(!o||!f.value)return o;try{const n=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=o.startContainer,r=o.startOffset;if(a.nodeType===3){const u=a.parentElement;u&&n.includes(u.tagName)&&(r===0&&!fo(a)||o.setStartBefore(u))}else a.nodeType===1&&n.includes(a.tagName)&&r>0&&o.setStartBefore(a);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&n.includes(u.tagName)&&(d===c.length&&!vo(c)||o.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},fo=o=>{let n=o.previousSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.previousSibling}return!1},vo=o=>{let n=o.nextSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.nextSibling}return!1},go=(o,n)=>{if(!o||!f.value)return null;try{const a=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(a.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}return u?Vo(a):null}}catch{return null}return null},Fn=(o,n)=>{if(!o||!n)return;const a=n.conversation||[],r=new Set,c=[],d=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),c.push(m))};a.length>0&&a.forEach(m=>{m.user&&d(m.user)}),c.length>0?o.setAttribute("data-comment-user",JSON.stringify(c[0])):o.removeAttribute("data-comment-user"),c.length>1?o.setAttribute("data-comment-user-2",JSON.stringify(c[1])):o.removeAttribute("data-comment-user-2");const u=a.length;u>0?o.setAttribute("data-comment-count",String(u)):o.removeAttribute("data-comment-count")},Rl=(o="unknown")=>{if(!$.richText||!f.value){Q.value=[];return}Date.now()-Tt.value<Dt&&mt.value!==null||mt.value===null&&(mt.value=requestAnimationFrame(()=>{if(mt.value=null,Tt.value=Date.now(),Ve.value)return;Ve.value=!0;const a={},r=f.value;if(!r){Ve.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){Ve.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(E=>{const G=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");G&&E.tagName==="SPAN"&&(m.has(G)||(u.push(E),m.add(G)))}),d.forEach(E=>{const G=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");!G||m.has(G)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(E.tagName)?E.querySelector(`span[data-comment="${G}"], span[data-fake-comment="${G}"]`)||(u.push(E),m.add(G)):E.tagName!=="SPAN"&&(u.push(E),m.add(G)))});const v=c.getBoundingClientRect(),h=r.getBoundingClientRect();u.forEach((E,G)=>{let Y=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");if(!Y)return;if(typeof Y=="string"&&Y.startsWith("comment-")){const ql=E.textContent?.trim(),Cl=$.comments?.find(Il=>(typeof Il.conversation_id=="string"&&Il.conversation_id.startsWith("comment-")?null:Il.conversation_id)&&Il.selection_text?.trim()===ql);Cl?(Y=String(Cl.conversation_id),E.setAttribute("data-comment",Y),E.removeAttribute("data-fake-comment")):(Y=String(Date.now()),E.setAttribute("data-comment",Y),E.removeAttribute("data-fake-comment"))}const De=E.getBoundingClientRect(),Se=window.getComputedStyle(E),vt=parseFloat(Se.lineHeight)||parseFloat(Se.fontSize)*1.2,rl=De.top-h.top+vt/2-15,Jt=h.top-v.top+rl;let dl=null,en=null,tn=0;const pn=[],sn=new Set;if(Y&&$.comments){const ql=$.comments.find(Cl=>String(Cl.conversation_id||Cl.id)===String(Y));if(ql){const Cl=ql.conversation||[];Cl.length>0?(Cl.forEach(Il=>{Il.user&&Il.user.id&&!sn.has(Il.user.id)&&(sn.add(Il.user.id),pn.push(Il.user))}),tn=Cl.length):(tn=0,dl=null,en=null),pn.length>0?dl=pn[0]:dl=null,pn.length>1?en=pn[1]:en=null}}const Un=De.top+vt/2-15,Xn=Un+30,Zl=5,Nn=Xn>h.top+Zl&&Un<h.bottom-Zl?1:0;Q.value.find(ql=>ql.id===Y);let fn=E;if(!fn&&Y&&f.value){const ql=String(Y);fn=f.value.querySelector(`[data-comment="${ql}"], [data-fake-comment="${ql}"]`)}const Bt=pn.length;a[Y]?(a[Y].top=Jt,a[Y].opacity=Nn,a[Y].element=fn,a[Y].firstUser=dl,a[Y].secondUser=en,a[Y].totalCount=tn,a[Y].uniqueUserCount=Bt):a[Y]={id:Y,top:Jt,opacity:Nn,element:fn,firstUser:dl,secondUser:en,totalCount:tn,uniqueUserCount:Bt}});const M=Object.values(a).map(E=>{const G=Math.max(0,(E.uniqueUserCount??0)-2);if(!E.element&&E.id&&f.value){const De=String(E.id);E.element=f.value.querySelector(`[data-comment="${De}"], [data-fake-comment="${De}"]`)}return{...E,firstUser:E.firstUser||null,secondUser:E.secondUser||null,totalCount:E.totalCount,additionalCount:G}});(Q.value.length!==M.length||M.some((E,G)=>{const Y=Q.value[G];if(!Y)return!0;const De=(Y.firstUser?.id||null)!==(E.firstUser?.id||null),Se=(Y.secondUser?.id||null)!==(E.secondUser?.id||null);return Y.id!==E.id||Math.abs(Y.top-E.top)>1||Y.opacity!==E.opacity||Y.totalCount!==E.totalCount||Y.additionalCount!==E.additionalCount||De||Se||Y.element!==E.element}))&&(Q.value=M),Ve.value=!1}))},zo=o=>{if(!o)return;let n=o.element;if(!n&&o.id&&f.value){const a=String(o.id);n=f.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}n&&(Cn(),Kt.value=n,n.classList.add("editor-comment-highlighted"))},Cn=(o=!1)=>{!o&&ut.value!==null&&Kt.value&&(Kt.value.getAttribute("data-comment")||Kt.value.getAttribute("data-fake-comment"))===ut.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Kt.value&&(Kt.value.classList.remove("editor-comment-highlighted"),Kt.value=null))},ho=o=>{if(!o||!o.element)return;Cn(!0);const n=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!n)return;const a=`[data-comment="${n}"], [data-fake-comment="${n}"]`;X("comment-marker-clicked",{commentId:n,selector:a,element:o.element})},Zn=()=>{Cn()},qn=()=>{!$.richText||!f.value||(Ue.value&&Ue.value.disconnect(),Qe.value!==null&&(clearTimeout(Qe.value),Qe.value=null),Ue.value=new MutationObserver(()=>{Qe.value===null&&(Qe.value=setTimeout(()=>{Qe.value=null,e.nextTick(()=>{Rl("MutationObserver")})},200))}),Ue.value.observe(f.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Rl("setupCommentMarkersObserver-initial"))},yo=(o,n)=>{if(!o||!n)return;const a=n.getBoundingClientRect();let r=a.top,c=a.right+4;o.style.top=`${r}px`,o.style.left=`${c}px`,o.offsetHeight;const d=o.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const v=a.left-d.width-4;o.style.left=`${v}px`}if(d.bottom>m){const v=Math.max(8,m-d.height-8);o.style.top=`${v}px`}d.top<0&&(o.style.top="8px")};return e.watch(()=>st.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const r=a.getAttribute("data-submenu-id");if(r===o&&o){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(c){if(a.parentNode!==document.body){const d=a.parentNode;a.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{yo(a,c),a.offsetHeight,a.setAttribute("data-active","true"),a.style.visibility="visible",a.style.opacity="1"})})}else a.setAttribute("data-active","true")}else a.setAttribute("data-active","false"),a.style.display="none",a.style.top="",a.style.left="",a.style.visibility="",a.style.opacity=""})})}),e.watch(()=>[be.value,at.value],()=>{be.value==="askAi"||at.value==="askAi"?e.nextTick(()=>{dn()}):(st.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(n=>{if(n.parentNode===document.body){const a=n.getAttribute("data-submenu-id");if(a){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(r)if(n.dataset.originalParentRef==="inside")r.appendChild(n);else{const d=r.closest(".dss-toolbar-dropdown");d&&d.insertBefore(n,r.nextSibling)}}}})}))}),e.watch(()=>$.locale,o=>{o&&o!==oe.value&&(oe.value=o)},{immediate:!0}),ae({openCommentOverlayForSelector:Ho,updateCommentMarkers:Rl,restoreCommentsFromModel:Ot}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",pt.value]),style:e.normalizeStyle(wt.value)},[L.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",mu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:_n,title:e.unref(_)("textEditor.toolbar.undo")},[...n[45]||(n[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,pu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!q.value}]),onClick:Pl,title:e.unref(_)("textEditor.toolbar.redo")},[...n[46]||(n[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,fu),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",vu,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=a=>ln("paragraph")),title:e.unref(_)("textEditor.toolbar.paragraphFormat")},[S.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,hu)):S.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,yu)):S.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,ku)):S.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Cu)):S.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,bu)):S.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,wu)):(e.openBlock(),e.createElementBlock("svg",xu,[...n[47]||(n[47]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[48]||(n[48]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,gu),be.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[8]||(n[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[1]||(n[1]=a=>Bl("<h1>"))},[e.createElementVNode("img",{src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Eu),e.createElementVNode("h1",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=a=>Bl("<h2>"))},[e.createElementVNode("img",{src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Su),e.createElementVNode("h2",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=a=>Bl("<h3>"))},[e.createElementVNode("img",{src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Vu),e.createElementVNode("h3",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=a=>Bl("<h4>"))},[e.createElementVNode("img",{src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Nu),e.createElementVNode("h4",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=a=>Bl("<h5>"))},[e.createElementVNode("img",{src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Bu),e.createElementVNode("h5",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=a=>Bl("<h6>"))},[e.createElementVNode("img",{src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Mu),e.createElementVNode("h6",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=a=>Bl("<p>"))},[n[49]||(n[49]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("bold")}]),onClick:n[9]||(n[9]=a=>Gl("bold")),title:e.unref(_)("textEditor.toolbar.bold")},[...n[50]||(n[50]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,_u),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("italic")}]),onClick:n[10]||(n[10]=a=>Gl("italic")),title:e.unref(_)("textEditor.toolbar.italic")},[...n[51]||(n[51]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,$u),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("underline")}]),onClick:n[11]||(n[11]=a=>Gl("underline")),title:e.unref(_)("textEditor.toolbar.underline")},[...n[52]||(n[52]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Lu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":gt.value}]),onClick:On,title:e.unref(_)("textEditor.toolbar.citation")},[...n[53]||(n[53]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,Tu),n[62]||(n[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),fe.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:Ln,title:e.unref(_)("textEditor.toolbar.removeLink")},[...n[55]||(n[55]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,Du)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:$n,title:e.unref(_)("textEditor.toolbar.insertLink")},[...n[54]||(n[54]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,Au)),n[63]||(n[63]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("insertUnorderedList")}]),onClick:k,title:e.unref(_)("textEditor.toolbar.bulletList")},[...n[56]||(n[56]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,Hu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("insertOrderedList")}]),onClick:y,title:e.unref(_)("textEditor.toolbar.numberList")},[...n[57]||(n[57]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,Ru),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:mo,title:e.unref(_)("textEditor.toolbar.image")},[...n[58]||(n[58]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,Iu),K.value?(e.openBlock(),e.createElementBlock("div",Fu)):e.createCommentVNode("",!0),K.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(_)("textEditor.toolbar.comment"),onClick:ko},[...n[59]||(n[59]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,zu)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",Pu)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",Ou,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=a=>ln("askAi")),title:e.unref(_)("textEditor.toolbar.askAi")},[n[60]||(n[60]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",Zu,e.toDisplayString(e.unref(_)("textEditor.toolbar.askAi")),1)],8,Wu),be.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",qu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Zt(a)?(e.openBlock(),e.createElementBlock("div",Uu,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),Zt(a)&&r<L.customToolbarSlots.length-1&&hl(r)?(e.openBlock(),e.createElementBlock("div",Xu)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(be.value==="paragraph"||be.value==="askAi")&&L.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Pt})):e.createCommentVNode("",!0),e.createVNode(Oo,{showModal:Me.value,width:"500px",height:"55vh",onCloseModal:Wn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(_)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Yu,[e.createElementVNode("div",ju,[e.createElementVNode("label",Ku,e.toDisplayString(e.unref(_)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:ge,type:"text","onUpdate:modelValue":n[15]||(n[15]=a=>tt.value=a),class:"dss-link-modal-input",placeholder:e.unref(_)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Wl,["enter"])},null,40,Gu),[[e.vModelText,tt.value]])]),e.createElementVNode("div",Qu,[e.createElementVNode("label",Ju,e.toDisplayString(e.unref(_)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:R,type:"text","onUpdate:modelValue":n[16]||(n[16]=a=>ze.value=a),class:"dss-link-modal-input",placeholder:e.unref(_)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Wl,["enter"])},null,40,ed),[[e.vModelText,ze.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Wn},e.toDisplayString(e.unref(_)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Wl},e.toDisplayString(e.unref(_)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Oo,{showModal:Et.value,width:"500px",height:"80vh",onCloseModal:In},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Ge.value?e.unref(_)("textEditor.image.editImage"):e.unref(_)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",td,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Ne.value==="upload"}]),onClick:n[17]||(n[17]=a=>Ne.value="upload")},e.toDisplayString(e.unref(_)("textEditor.image.upload")),3),n[65]||(n[65]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Ne.value==="url"}]),onClick:n[18]||(n[18]=a=>Ne.value="url")},e.toDisplayString(e.unref(_)("textEditor.image.imageLink")),3)]),Ne.value==="upload"?(e.openBlock(),e.createElementBlock("div",ld,[e.createElementVNode("div",nd,[e.createElementVNode("div",od,[it.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",ad,e.toDisplayString(e.unref(_)("textEditor.image.uploadImage")),1)),it.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:kl},[e.createElementVNode("img",{src:It.value,alt:"Preview",class:"dss-image-preview-image"},null,8,sd),n[66]||(n[66]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:Ft,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Qt},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Ft,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Qt},null,544))]),e.createElementVNode("div",rd,[e.createElementVNode("label",id,e.toDisplayString(e.unref(_)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:nl,type:"text","onUpdate:modelValue":n[19]||(n[19]=a=>Ht.value=a),class:"dss-link-modal-input",placeholder:e.unref(_)("textEditor.image.enterAltText"),onKeyup:e.withKeys(an,["enter"])},null,40,cd),[[e.vModelText,Ht.value]])]),e.createElementVNode("div",ud,[e.createElementVNode("label",dd,e.toDisplayString(e.unref(_)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=a=>ot.value=a),class:"dss-link-modal-input",placeholder:e.unref(_)("textEditor.image.auto"),onKeyup:e.withKeys(an,["enter"]),onInput:Eo},null,40,md),[[e.vModelText,ot.value]])]),e.createElementVNode("div",pd,[e.createElementVNode("label",fd,e.toDisplayString(e.unref(_)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=a=>St.value=a),class:"dss-link-modal-input",placeholder:e.unref(_)("textEditor.image.auto"),onKeyup:e.withKeys(an,["enter"]),onInput:So},null,40,vd),[[e.vModelText,St.value]])])])])):e.createCommentVNode("",!0),Ne.value==="url"?(e.openBlock(),e.createElementBlock("div",gd,[e.createElementVNode("div",hd,[e.createElementVNode("div",yd,[e.createElementVNode("label",kd,e.toDisplayString(e.unref(_)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Yt,type:"text","onUpdate:modelValue":n[22]||(n[22]=a=>Oe.value=a),class:"dss-link-modal-input",placeholder:e.unref(_)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(an,["enter"])},null,40,Cd),[[e.vModelText,Oe.value]])]),e.createElementVNode("div",bd,[e.createElementVNode("label",wd,e.toDisplayString(e.unref(_)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=a=>Ht.value=a),class:"dss-link-modal-input",placeholder:e.unref(_)("textEditor.image.enterAltText"),onKeyup:e.withKeys(an,["enter"])},null,40,xd),[[e.vModelText,Ht.value]])]),e.createElementVNode("div",Ed,[e.createElementVNode("label",Sd,e.toDisplayString(e.unref(_)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=a=>ot.value=a),class:"dss-link-modal-input",placeholder:e.unref(_)("textEditor.image.auto"),onKeyup:e.withKeys(an,["enter"]),onInput:Eo},null,40,Vd),[[e.vModelText,ot.value]])]),e.createElementVNode("div",Nd,[e.createElementVNode("label",Bd,e.toDisplayString(e.unref(_)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=a=>St.value=a),class:"dss-link-modal-input",placeholder:e.unref(_)("textEditor.image.auto"),onKeyup:e.withKeys(an,["enter"]),onInput:So},null,40,Md),[[e.vModelText,St.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:In},e.toDisplayString(e.unref(_)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:an},e.toDisplayString(e.unref(_)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":vn.value&&At.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(_)("textEditor.labels.title")),1),e.createElementVNode("div",_d,[At.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",$d,[L.title?(e.openBlock(),e.createElementBlock("span",Ld,e.toDisplayString(L.title),1)):(e.openBlock(),e.createElementBlock("span",Td,e.toDisplayString(ct.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Re,value:L.title,onInput:Al,onFocus:jl,onBlur:bl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!At.value}]),placeholder:ct.value,disabled:L.disabled,rows:"1"},null,42,Ad)])],2),vn.value&&At.value?(e.openBlock(),e.createElementBlock("div",Dd,[e.renderSlot(o.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":gn.value&&V.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(_)("textEditor.labels.description")),1),e.createElementVNode("div",Hd,[V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Rd,[L.description?(e.openBlock(),e.createElementBlock("span",Id,e.toDisplayString(L.description),1)):(e.openBlock(),e.createElementBlock("span",Fd,e.toDisplayString(Xe.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:ht,value:L.description,onInput:zt,onFocus:Bn,onBlur:Mn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!V.value}]),placeholder:Xe.value,disabled:L.disabled,rows:"1"},null,42,zd)])],2),gn.value&&V.value?(e.openBlock(),e.createElementBlock("div",Pd,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":ut.value===a.id,"editor-comment-marker-group-out-of-view":a.opacity===0}]),"data-comment-id":a.id,style:e.normalizeStyle({top:a.top+"px"}),onMouseenter:r=>zo(a),onMouseleave:Zn},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>ho(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,Zd)):(e.openBlock(),e.createElementBlock("span",qd,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,Wd)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>ho(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Xd)):(e.openBlock(),e.createElementBlock("span",Yd,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,Ud)):e.createCommentVNode("",!0),a.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:a.secondUser?"30px":"15px"}),"data-has-second-user":a.secondUser?"true":"false",onClick:e.withModifiers(r=>ho(a),["stop"])},[e.createElementVNode("span",Kd,"+"+e.toDisplayString(a.additionalCount),1)],12,jd)):e.createCommentVNode("",!0)],46,Od))),128)),L.richText?(e.openBlock(),e.createElementBlock("div",n1,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":L.disabled,"dss-text-editor-fixed-height":L.fixedHeight}]),style:e.normalizeStyle(F.value),onInput:we,onBlur:Ie,onClick:Ro,onMouseup:ro,onKeyup:ro,onKeydown:O,onPaste:xl,onMousemove:Io,onMouseleave:Dn},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[ut.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(ol.value)},[Ql.value||_l.value.length>0?(e.openBlock(),e.createElementBlock("div",o1,[e.createElementVNode("div",a1,[Ql.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:Ql.value},null,8,s1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",r1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_l.value,(a,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:"dss-comment-message"},[a.user&&(a.user.avatar||a.user.initials||a.user.name)?(e.openBlock(),e.createElementBlock("div",i1,[e.createElementVNode("div",c1,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,u1)):(e.openBlock(),e.createElementBlock("span",d1,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",m1,[e.createElementVNode("div",p1,[e.createElementVNode("div",f1,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",v1,e.toDisplayString(to(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":wn(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),$.commentUser&&a.user&&a.user.id===$.commentUser.id&&!wn(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>ao(a,r),["stop"]),title:e.unref(_)("textEditor.comment.delete")||"Delete comment"},[...n[68]||(n[68]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,g1)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",h1,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:al,"onUpdate:modelValue":n[26]||(n[26]=a=>il.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(_)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(oo,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(al.value){const a=al.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,y1),[[e.vModelText,il.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(oo,["stop"])},[...n[69]||(n[69]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",k1,[e.createElementVNode("div",C1,[e.createElementVNode("span",b1,e.toDisplayString(ce.value)+" "+e.toDisplayString(ce.value===1?e.unref(_)("textEditor.footer.word"):e.unref(_)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",w1,e.toDisplayString(Te.value)+" "+e.toDisplayString(Te.value===1?e.unref(_)("textEditor.footer.character"):e.unref(_)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Gd,[e.createElementVNode("textarea",{value:L.modelValue,onInput:xn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":L.fixedHeight}]),placeholder:Ct.value,rows:L.rows,disabled:L.disabled,style:e.normalizeStyle(gl.value)},null,46,Qd),e.createElementVNode("div",Jd,[e.createElementVNode("div",e1,[e.createElementVNode("span",t1,e.toDisplayString(ce.value)+" "+e.toDisplayString(ce.value===1?e.unref(_)("textEditor.footer.word"):e.unref(_)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",l1,e.toDisplayString(Te.value)+" "+e.toDisplayString(Te.value===1?e.unref(_)("textEditor.footer.character"):e.unref(_)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[j.value&&ue.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(H.value),onMouseenter:n[28]||(n[28]=a=>ke.value=!0),onMouseleave:Hn},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(xo,["stop"]),title:ue.value},e.toDisplayString(ue.value),9,x1),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Fo,["stop"]),title:e.unref(_)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",S1,[...n[71]||(n[71]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,E1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Lt.value&&Xt.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(te.value),onMouseenter:n[29]||(n[29]=a=>$e.value=!0),onMouseleave:Rn},[e.createElementVNode("div",V1,[Xt.value===e.unref(_)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",N1,[...n[72]||(n[72]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:Xt.value},e.toDisplayString(Xt.value),9,B1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(po,["stop"]),title:e.unref(_)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",_1,[...n[73]||(n[73]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,M1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.floatingToolbar&&L.richText&&yt.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:tl,class:"dss-floating-toolbar",style:e.normalizeStyle(qe.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",$1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(_n,["stop"]),title:e.unref(_)("textEditor.toolbar.undo")},[...n[74]||(n[74]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,L1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!q.value}]),onClick:e.withModifiers(Pl,["stop"]),title:e.unref(_)("textEditor.toolbar.redo")},[...n[75]||(n[75]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,T1),n[89]||(n[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",A1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(a=>wo("paragraph"),["stop"])),title:e.unref(_)("textEditor.toolbar.paragraphFormat")},[S.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,H1)):S.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,R1)):S.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,I1)):S.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,F1)):S.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,z1)):S.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,P1)):(e.openBlock(),e.createElementBlock("svg",O1,[...n[76]||(n[76]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[77]||(n[77]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,D1),at.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[38]||(n[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[31]||(n[31]=a=>yn("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=a=>yn("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=a=>yn("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=a=>yn("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=a=>yn("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=a=>yn("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=a=>yn("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),n[90]||(n[90]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(a=>Gl("bold"),["stop"])),title:e.unref(_)("textEditor.toolbar.bold")},[...n[78]||(n[78]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,W1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(a=>Gl("italic"),["stop"])),title:e.unref(_)("textEditor.toolbar.italic")},[...n[79]||(n[79]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,Z1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(a=>Gl("underline"),["stop"])),title:e.unref(_)("textEditor.toolbar.underline")},[...n[80]||(n[80]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,q1),n[91]||(n[91]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":gt.value}]),onClick:e.withModifiers(On,["stop"]),title:e.unref(_)("textEditor.toolbar.citation")},[...n[81]||(n[81]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,U1),n[92]||(n[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),fe.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(Ln,["stop"]),title:e.unref(_)("textEditor.toolbar.removeLink")},[...n[83]||(n[83]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,Y1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers($n,["stop"]),title:e.unref(_)("textEditor.toolbar.insertLink")},[...n[82]||(n[82]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,X1)),n[93]||(n[93]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("insertUnorderedList")}]),onClick:e.withModifiers(k,["stop"]),title:e.unref(_)("textEditor.toolbar.bulletList")},[...n[84]||(n[84]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,j1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("insertOrderedList")}]),onClick:e.withModifiers(y,["stop"]),title:e.unref(_)("textEditor.toolbar.numberList")},[...n[85]||(n[85]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,K1),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(mo,["stop"]),title:e.unref(_)("textEditor.toolbar.image")},[...n[86]||(n[86]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,G1),n[95]||(n[95]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(_)("textEditor.toolbar.comment"),onClick:e.withModifiers(ko,["stop"])},[...n[87]||(n[87]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,Q1),L.askAi?(e.openBlock(),e.createElementBlock("div",J1)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",e2,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(a=>wo("askAi"),["stop"])),title:e.unref(_)("textEditor.toolbar.askAi")},[n[88]||(n[88]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",l2,e.toDisplayString(e.unref(_)("textEditor.toolbar.askAi")),1)],8,t2),at.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[43]||(n[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Yl.value?(e.openBlock(),e.createElementBlock("div",n2,[L.askAi&&Yl.value?(e.openBlock(),e.createElementBlock("div",o2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Zt(a)&&Ml(a)?(e.openBlock(),e.createElementBlock("div",a2,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),Zt(a)&&Ml(a)&&r<L.customToolbarSlots.length-1&&Xl(r)?(e.openBlock(),e.createElementBlock("div",s2)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),c2={class:"dss-color-picker__section-title"},u2={class:"dss-color-picker__presets-row"},d2=["title","onClick"],m2={key:1,class:"dss-color-picker__section"},p2={class:"dss-color-picker__presets-row"},f2=["title","onClick"],v2={class:"dss-color-picker__section"},g2={class:"dss-color-picker__section-header"},h2={class:"dss-color-picker__presets-row"},y2=["title","onClick"],k2=["onClick"],C2={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},b2=["title","onClick"],w2={class:"dss-color-picker__input-row"},x2=["value"],E2={__name:"DSSColorPicker",props:{modelValue:{type:String,default:"#b8a5de"},disabled:{type:Boolean,default:!1},presetColors:{type:Array,default:()=>[]},presetGroups:{type:Array,default:null},max:{type:Number,default:12},initialPresetCount:{type:Number,default:null}},emits:["update:modelValue","update:presetColors"],setup(L,{emit:ae}){function B(W){const U=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(W);if(!U)return{h:0,s:0,l:50};const ee=parseInt(U[1],16)/255,se=parseInt(U[2],16)/255,He=parseInt(U[3],16)/255,rt=Math.max(ee,se,He),bt=Math.min(ee,se,He);let Re=0,ht=0;const Rt=(rt+bt)/2;if(rt!==bt){const jt=rt-bt;switch(ht=Rt>.5?jt/(2-rt-bt):jt/(rt+bt),rt){case ee:Re=((se-He)/jt+(se<He?6:0))/6;break;case se:Re=((He-ee)/jt+2)/6;break;case He:Re=((ee-se)/jt+4)/6;break}}return{h:Re*360,s:ht*100,l:Rt*100}}function _(W,U,ee){U/=100,ee/=100;const se=U*Math.min(ee,1-ee),He=rt=>{const bt=(rt+W/30)%12,Re=ee-se*Math.max(Math.min(bt-3,9-bt,1),-1);return Math.round(255*Re).toString(16).padStart(2,"0")};return`#${He(0)}${He(8)}${He(4)}`}function oe(W){const U=W.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!U)return null;let ee=U[1];return ee.length===3&&(ee=ee.split("").map(se=>se+se).join("")),"#"+ee}function z(W,U,ee){U/=100,ee/=100;const se=ee+U*Math.min(ee,1-ee),He=se===0?0:2-2*ee/se;return{h:W,s:He*100,v:se*100}}function $(W,U,ee){U/=100,ee/=100;const se=ee*(1-U/2),He=se===0||se===1?0:(ee-se)/Math.min(se,1-se);return{h:W,s:He*100,l:se*100}}const X=L,Ke=ae,pe=e.ref(!1),f=e.ref(!1),be=e.ref(!1),fe=e.ref(-1),ne=e.ref(-1),j=e.ref(null),ue=e.ref(null),H=e.ref(null),ke=e.ref(null),Me=e.ref({top:0,left:0}),ze=e.ref(B(X.modelValue||"#b8a5de")),tt=e.computed(()=>Array.isArray(X.presetGroups)&&X.presetGroups.length>0),R=e.computed(()=>tt.value?0:X.initialPresetCount!=null?X.initialPresetCount:ne.value<0?null:ne.value),ge=e.computed(()=>{const W=R.value;return W==null?!0:Math.max(0,X.presetColors.length-W)<X.max}),ve=e.computed(()=>!!(f.value||fe.value>=0||!ie.value&&X.presetColors.length===0));e.computed(()=>{const W=R.value;return W!=null&&X.presetColors.length>W});const ie=e.computed(()=>tt.value||R.value!=null),lt=e.computed(()=>{const W=R.value;return W==null?[]:X.presetColors.slice(0,W)}),gt=e.computed(()=>{const W=R.value;return W==null?[]:X.presetColors.slice(W)});function he(W){const U=R.value;return U!=null?U+W:-1}function yt(W){const U=R.value;return U!=null&&W>=U}function qe(W){yt(W)&&(fe.value=W,ze.value=B(X.presetColors[W]),f.value=!0,e.nextTick(()=>ke.value?.focus()))}function tl(W){if(!yt(W))return;const U=X.presetColors.filter((He,rt)=>rt!==W);Ke("update:presetColors",U);const ee=oe(X.modelValue),se=oe(X.presetColors[W]);if(ee&&se&&ee.toLowerCase()===se.toLowerCase()){const He=U[Math.max(0,W-1)]||U[0];He&&Ke("update:modelValue",He)}}function at(){be.value=!be.value,be.value||(fe.value=-1,f.value=!1)}function Et(){if(fe.value<0)return;const W=ot.value,U=oe(W);if(U){const ee=[...X.presetColors];ee[fe.value]=U,Ke("update:presetColors",ee),Ke("update:modelValue",U),fe.value=-1,f.value=!1}}function Ht(){X.disabled||(fe.value=-1,f.value=!f.value,f.value&&(Lt(),e.nextTick(()=>ke.value?.focus())))}function ll(W){const U=oe(W),ee=oe(X.modelValue);return U&&ee&&U.toLowerCase()===ee.toLowerCase()}function It(){if(X.disabled||!ge.value)return;const W=ot.value,U=oe(W);if(U){const ee=[...X.presetColors,U];Ke("update:presetColors",ee),Ke("update:modelValue",U);const se=R.value??ne.value;se>=0&&ee.length-se>=X.max&&(f.value=!1)}}const ot=e.computed(()=>{const{h:W,s:U,l:ee}=ze.value;return _(W,U,ee)}),St=e.computed(()=>ot.value.toLowerCase()),nl=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${ze.value.h}, 100%, 50%))`})),Ft=e.computed(()=>{const W=z(ze.value.h,ze.value.s,ze.value.l);return{left:`${W.s}%`,bottom:`${W.v}%`,transform:"translate(-50%, 50%)"}}),Yt=e.computed(()=>({left:`${ze.value.h/360*100}%`,transform:"translateX(-50%)"})),Ge=e.computed(()=>({position:"fixed",left:`${Me.value.left}px`,top:`${Me.value.top}px`,zIndex:1002}));function Je(){if(!j.value||!pe.value)return;const W=j.value.getBoundingClientRect(),U=window.innerHeight||document.documentElement.clientHeight;let ee=W.bottom+4;const se=ue.value;se&&ee+se.offsetHeight>U-8&&(ee=W.top-4-se.offsetHeight),Me.value={top:ee,left:W.left}}function Lt(){const W=X.modelValue||"#b8a5de";oe(W)&&(ze.value=B(W))}function Xt(){Ke("update:modelValue",ot.value)}function te(){X.disabled||(pe.value=!pe.value,pe.value&&(Lt(),e.nextTick(()=>{Je(),ke.value?.focus()})))}function $e(){const W=ot.value,U=oe(W);if(U){if(fe.value>=0){const ee=[...X.presetColors];ee[fe.value]=U,Ke("update:presetColors",ee),Ke("update:modelValue",U)}else if((X.presetColors.length>0||tt.value)&&f.value&&ge.value&&!X.presetColors.some(se=>oe(se)?.toLowerCase()===U.toLowerCase())){const se=[...X.presetColors,U];Ke("update:presetColors",se),Ke("update:modelValue",U)}}pe.value=!1,f.value=!1,be.value=!1,fe.value=-1}function Ne(W){if(!H.value)return;const U=H.value.getBoundingClientRect(),ee=se=>{const He=Math.max(0,Math.min(1,(se.clientX-U.left)/U.width)),rt=Math.max(0,Math.min(1,1-(se.clientY-U.top)/U.height)),bt={h:ze.value.h,s:He*100,v:rt*100};ze.value=$(bt.h,bt.s,bt.v)};ee(W),document.addEventListener("mousemove",ee),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ee),Xt()},{once:!0})}function Oe(W){if(!W.currentTarget)return;const ee=W.currentTarget.getBoundingClientRect(),se=He=>{const rt=Math.max(0,Math.min(1,(He.clientX-ee.left)/ee.width));ze.value={...ze.value,h:rt*360}};se(W),document.addEventListener("mousemove",se),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",se),Xt()},{once:!0})}function st(W){const U=W.target.value,ee=oe(U);ee&&(ze.value=B(ee),Ke("update:modelValue",ee))}function Ze(W){if(X.disabled)return;const U=oe(W);U&&(ze.value=B(U),Ke("update:modelValue",U))}let Ye=null,dt=null;function Le(){Ye&&(document.removeEventListener("keydown",Ye),Ye=null),dt&&(window.removeEventListener("resize",dt),dt=null)}return e.watch(pe,W=>{if(Le(),W){if(!tt.value&&X.initialPresetCount==null){const U=X.presetColors.length;U>0&&(ne.value<0||U<ne.value)&&(ne.value=U)}Ye=U=>{U.key==="Escape"&&$e()},dt=Je,document.addEventListener("keydown",Ye),window.addEventListener("resize",dt)}}),e.watch(()=>X.modelValue,()=>{pe.value&&Lt()},{immediate:!1}),e.watch(gt,W=>{W.length===0&&(be.value=!1,fe.value=-1,f.value=!1)}),e.onBeforeUnmount(Le),(W,U)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":L.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:j,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":pe.value}]),onClick:te},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:ot.value})},[...U[0]||(U[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[pe.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers($e,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ue,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Ge.value)},[ie.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[tt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(L.presetGroups,(ee,se)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+se,class:"dss-color-picker__section"},[e.createElementVNode("span",c2,e.toDisplayString(ee.title),1),e.createElementVNode("div",u2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.colors,(He,rt)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+se+"-"+rt,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":ll(He)}]),style:e.normalizeStyle({backgroundColor:He}),title:He,onClick:e.withModifiers(bt=>Ze(He),["stop"])},null,14,d2))),128))])]))),128)):lt.value.length?(e.openBlock(),e.createElementBlock("div",m2,[U[1]||(U[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",p2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value,(ee,se)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+se,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":ll(ee)}]),style:e.normalizeStyle({backgroundColor:ee}),title:ee,onClick:e.withModifiers(He=>Ze(ee),["stop"])},null,14,f2))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",v2,[e.createElementVNode("div",g2,[U[3]||(U[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),gt.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__manage-icon",{"dss-color-picker__manage-icon--active":be.value}]),title:"Manage custom colors",onClick:e.withModifiers(at,["stop"])},[...U[2]||(U[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",h2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value,(ee,se)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+se,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":be.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!be.value&&ll(ee),"dss-color-picker__preset-bubble--editing":be.value&&fe.value===he(se)}]),style:e.normalizeStyle({backgroundColor:fe.value===he(se)?ot.value:ee}),title:fe.value===he(se)?ot.value:ee,onClick:e.withModifiers(He=>be.value?qe(he(se)):Ze(ee),["stop"])},null,14,y2),be.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__preset-action dss-color-picker__preset-action--delete",title:"Delete",onClick:e.withModifiers(He=>tl(he(se)),["stop"])},[...U[4]||(U[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,k2)):e.createCommentVNode("",!0)],2))),128)),ge.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":f.value}]),onClick:e.withModifiers(Ht,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):L.presetColors.length?(e.openBlock(),e.createElementBlock("div",C2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.presetColors,(ee,se)=>(e.openBlock(),e.createElementBlock("button",{key:se,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":ll(ee)}]),style:e.normalizeStyle({backgroundColor:ee}),title:ee,onClick:e.withModifiers(He=>Ze(ee),["stop"])},null,14,b2))),128)),ge.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":f.value}]),onClick:e.withModifiers(Ht,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),ve.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:H,onMousedown:Ne},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(nl.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Ft.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Oe},[U[5]||(U[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(Yt.value)},null,4)],32),e.createElementVNode("div",w2,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:ke,type:"text",class:"dss-color-picker__hex-input",value:St.value,onInput:st},null,40,x2)]),ie.value&&(L.presetColors.length||tt.value)&&ge.value&&fe.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:It}," Save color ")):e.createCommentVNode("",!0),ie.value&&fe.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Et}," Save color ")):e.createCommentVNode("",!0),ie.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:$e}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},S2={key:0,class:"dss-loader"},V2={key:0,class:"dss-loader-label"},N2={key:1,class:"dss-loader"},B2={key:0,class:"dss-loader-label"},M2={key:2,class:"dss-loader"},_2={key:0,class:"dss-loader-label"},$2={key:3,class:"dss-loader"},L2={key:0,class:"dss-loader-label"},T2={key:4,class:"dss-loader"},A2={key:0,class:"dss-loader-label"},D2={key:5,class:"dss-loader dss-loader--inline"},H2={class:"dss-loader-inline-text"},R2={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(L){const ae=L,B=e.computed(()=>ae.size==="small"?"dss-loaders--size-small":ae.size==="large"?"dss-loaders--size-large":ae.size==="medium"||ae.size==null?"dss-loaders--size-medium":null),_=e.computed(()=>{const oe={};if(!(ae.size==="small"||ae.size==="medium"||ae.size==="large"||ae.size==null)){const z=typeof ae.size=="number"?`${ae.size}px`:String(ae.size);oe["--dss-loader-size"]=z}return ae.color&&(oe["--dss-loader-accent"]=ae.color,oe["--dss-loader-accent-soft"]=`color-mix(in srgb, ${ae.color} 30%, white)`),oe});return(oe,z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",B.value]),style:e.normalizeStyle(_.value)},[L.type==="spinner"?(e.openBlock(),e.createElementBlock("div",S2,[z[0]||(z[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),L.label?(e.openBlock(),e.createElementBlock("span",V2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="dots"?(e.openBlock(),e.createElementBlock("div",N2,[z[1]||(z[1]=e.createElementVNode("span",{class:"dss-loader-dots","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"})],-1)),L.label?(e.openBlock(),e.createElementBlock("span",B2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="battery"?(e.openBlock(),e.createElementBlock("div",M2,[z[2]||(z[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),L.label?(e.openBlock(),e.createElementBlock("span",_2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",$2,[z[3]||(z[3]=e.createElementVNode("span",{class:"dss-loader-double-circle","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-double-circle-outer"}),e.createElementVNode("span",{class:"dss-loader-double-circle-inner"})],-1)),L.label?(e.openBlock(),e.createElementBlock("span",L2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="bars"?(e.openBlock(),e.createElementBlock("div",T2,[z[4]||(z[4]=e.createElementVNode("span",{class:"dss-loader-bars","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"})],-1)),L.label?(e.openBlock(),e.createElementBlock("span",A2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="inline"?(e.openBlock(),e.createElementBlock("div",D2,[z[5]||(z[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",H2,[e.renderSlot(oe.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(L.label),1)])])])):e.createCommentVNode("",!0)],6))}},jo="dss-skeleton-item",I2={__name:"DSSSkeleton",props:{loading:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},borderRadius:{type:String,default:"16px"},shimmer:{type:Boolean,default:!0},mode:{type:String,default:"single",validator:L=>["single","multiple"].includes(L)},targetClass:{type:String,default:jo},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(L){const ae=L,B=e.computed(()=>{const z={"dss-skeleton--loading":ae.loading,"dss-skeleton--static":!ae.shimmer,"dss-skeleton--multiple":ae.mode==="multiple","dss-skeleton--dark":ae.darkMode};return ae.mode==="multiple"&&ae.targetClass!==jo&&(z[`dss-skeleton--target-${ae.targetClass}`]=!0),z}),_=e.computed(()=>{const z={};return ae.borderRadius&&(z.borderRadius=ae.borderRadius),z}),oe=e.computed(()=>{const z={};return ae.borderRadius&&(z["--dss-skeleton-border-radius"]=ae.borderRadius),ae.darkMode?(z["--dss-skeleton-bg"]=ae.bgDark||"#322c3f",z["--dss-skeleton-shimmer"]=ae.shimmerDark||"#3e3f41",z):(ae.bgColor&&(z["--dss-skeleton-bg"]=ae.bgColor),ae.shimmerColor&&(z["--dss-skeleton-shimmer"]=ae.shimmerColor),z)});return(z,$)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",B.value]),style:e.normalizeStyle(oe.value)},[L.loading&&L.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(_.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":L.loading&&L.mode==="single"}])},[e.renderSlot(z.$slots,"default")],2)],6))}},F2={key:0,class:"dss-dnd-column-header"},z2={class:"dss-dnd-column-title"},P2={class:"dss-dnd-column-count"},O2=["data-column"],W2={key:0,class:"dss-dnd-indicator"},Z2=["onPointerdown"],q2=["onPointerdown"],U2={class:"dss-dnd-item-content"},X2={class:"dss-dnd-item-default"},Y2={key:0,class:"dss-dnd-empty"},j2={name:"DSSDnd"},K2=Object.assign(j2,{props:{items:{type:Array,required:!0},columns:{type:Array,required:!0},columnKey:{type:String,default:"status"},positionKey:{type:String,default:"position"},itemKey:{type:String,default:"id"},options:{type:Object,default:()=>({})}},emits:["move","delete"],setup(L,{emit:ae}){const B=L,_=ae,oe=e.useSlots(),z=e.computed(()=>!!oe["delete-zone"]),$={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1,ColColor:!1},X=e.computed(()=>({...$,...B.options})),Ke=e.computed(()=>({"--dss-dnd-col-min-w":X.value.columnMinWidth,"--dss-dnd-col-max-w":X.value.columnMaxWidth,"--dss-dnd-col-gap":X.value.columnGap,"--dss-dnd-indicator-color":X.value.indicatorColor,"--dss-dnd-body-max-h":X.value.columnBodyMaxHeight}));function pe(te){if(!X.value.ColColor||!te)return{};const $e=te.background||te.color;return $e?{background:$e}:{}}const f=e.ref(null),be=e.ref(null),fe=e.ref(!1),ne=e.ref(-1),j=e.ref(null);let ue=null,H=null,ke=null,Me=null,ze=0,tt=0,R="",ge=null;const ve=5,ie=e.computed(()=>{const te={};for(const $e of B.columns)te[$e.value]=B.items.filter(Ne=>Ne[B.columnKey]===$e.value).sort((Ne,Oe)=>(Ne[B.positionKey]??0)-(Oe[B.positionKey]??0));return te}),lt=e.computed(()=>{const te={},$e=!!f.value,Ne=f.value?.[B.itemKey],Oe=be.value,st=ne.value;for(const Ze of B.columns){const Ye=ie.value[Ze.value]||[],dt=[],Le=Oe==Ze.value;let W=0;for(let U=0;U<Ye.length;U++){const ee=Ye[U],se=$e&&ee[B.itemKey]===Ne;!se&&Le&&st===W&&dt.push({type:"indicator",key:`ind-${W}`}),se||W++,dt.push({type:"item",item:ee,isDragged:se,key:`item-${ee[B.itemKey]}`})}Le&&st>=W&&dt.push({type:"indicator",key:"ind-end"}),te[Ze.value]=dt}return te});function gt(te,$e){const Oe=(ie.value[te]||[]).filter(Ye=>Ye[B.itemKey]!==f.value?.[B.itemKey]);if(Oe.length===0)return 1;if($e<=0){const Ye=Oe[0][B.positionKey];return Ye!=null&&Ye>0?Ye/2:.5}if($e>=Oe.length){const Ye=Oe[Oe.length-1][B.positionKey];return(Ye??0)+1}const st=Oe[$e-1][B.positionKey]??0,Ze=Oe[$e][B.positionKey]??0;return(st+Ze)/2}function he(te,$e,Ne){ke&&ke.remove();const Oe=te.getBoundingClientRect(),st=te.cloneNode(!0);st.classList.add("dss-dnd-ghost"),st.style.cssText=`
103
+ `){const h=document.createTextNode(" ");n.insertNode(h),n.setStartAfter(h)}}n.insertNode(d);const u=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(u),n.setStartAfter(u),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}}we()}e.nextTick(()=>{Zt(),qn()})},on=()=>{if(!f.value||ne.value)return;const o=window.getSelection();let n=null;o&&o.rangeCount>0&&(n=Ce());const a=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,r=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const v=m.parentElement;return!v||v.closest("a")||v.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=r.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const v=c[m],h=v.textContent;a.lastIndex=0;const M=[...h.matchAll(a)];if(M.length===0)continue;const T=M.filter(Y=>{const De=Y[0],Se=Y.index;if(Se>0&&h[Se-1]==="@"||Se+De.length<h.length&&h[Se+De.length]==="@")return!1;const vt=v.parentElement;return!(vt&&vt.closest("a"))});if(T.length===0)continue;if(T.length===1&&T[0][0]===h.trim()){const Y=T[0][0],De=Y.startsWith("http://")||Y.startsWith("https://")?Y:`https://${Y}`,Se=document.createElement("a");Se.href=De,Se.textContent=Y,Se.style.color="#60afdf",Se.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(Se,v),u=!0);continue}let E=0;const G=document.createDocumentFragment();if(T.forEach(Y=>{const De=Y.index,Se=Y[0];if(De>E){const ul=h.substring(E,De);ul&&G.appendChild(document.createTextNode(ul))}const vt=Se.startsWith("http://")||Se.startsWith("https://")?Se:`https://${Se}`,vl=document.createElement("a");vl.href=vt,vl.textContent=Se,vl.style.color="#60afdf",vl.style.textDecoration="underline",G.appendChild(vl),E=De+Se.length}),E<h.length){const Y=h.substring(E);Y&&G.appendChild(document.createTextNode(Y))}v.parentNode&&G.childNodes.length>0&&(v.parentNode.replaceChild(G,v),u=!0)}u&&n&&e.nextTick(()=>{El(n),Zt()})},mn=()=>{if(!f.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let r;for(;r=n.nextNode();)a.push(r);for(let c=a.length-1;c>=0;c--){const d=a[c],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let v=0;const h=document.createDocumentFragment();m.forEach(M=>{const T=M.index,E=M[0].startsWith("<u>")?"u":"ins",G=M[1]||M[2]||"";T>v&&h.appendChild(document.createTextNode(u.substring(v,T)));const Y=document.createElement(E);Y.textContent=G,h.appendChild(Y),v=T+M[0].length}),v<u.length&&h.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&h.childNodes.length>0&&d.parentNode.replaceChild(h,d)}},Gt=o=>{if(!f.value||ne.value)return;if(!o){mn();return}if(!["*","_",">"].includes(o))return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);if(!r.collapsed)return;const c=r.startContainer.nodeType===Node.TEXT_NODE?r.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):r.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===f.value||!f.value.contains(c))return;const d=()=>{let ul="",rl=0,ml=!1;const Jt=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:en=>en.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let dl=0;for(;Jt.nextNode();){const en=Jt.currentNode,tn=en.textContent||"",pn=dl;if(dl+=tn.length,en===r.startContainer){ul+=tn.substring(0,r.startOffset),rl=pn+r.startOffset,ml=!0;break}ul+=tn}return ml||(rl=ul.length),{textBeforeCursor:ul,cursorCharOffset:rl}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,v=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?v="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?v="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(v=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const h=m[0],M=m[1],T=u.length-h.length,G=(ul=>{let rl=0;const ml=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:dl=>dl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let Jt;for(;Jt=ml.nextNode();){const dl=(Jt.textContent||"").length;if(rl+dl>=ul)return{node:Jt,offset:ul-rl};rl+=dl}return null})(T);if(!G)return;const Y=document.createRange();Y.setStart(G.node,G.offset),Y.setEnd(r.endContainer,r.endOffset);const De=document.createElement(v);De.textContent=M,Y.deleteContents(),Y.insertNode(De);const Se=window.getSelection(),vt=document.createRange();vt.setStartAfter(De),vt.collapse(!0),Se.removeAllRanges(),Se.addRange(vt);const vl=Ce();e.nextTick(()=>{we(),vl&&El(vl)})},mo=()=>{f.value&&(et.value=Ce(),Ht.value="",It.value="",qe.value="",at.value="",Et.value="",ll.value=null,Ge.value=null,Ne.value="upload",xt.value=!0,Pt(),e.nextTick(()=>{nl.value&&nl.value.focus(),Ft.value&&(Ft.value.value="")}))},Qt=o=>{const n=o.target?.files?.[0];if(!n){ll.value=null,It.value="";return}ll.value=n;const a=new FileReader;a.onload=r=>{It.value=r.target?.result||""},a.readAsDataURL(n)},kl=()=>{Ft.value&&Ft.value.click()},Eo=()=>{at.value&&(Et.value="")},So=()=>{Et.value&&(at.value="")},po=()=>{let o=Ge.value;if(!o){const n=window.getSelection();if(n&&n.rangeCount>0){const r=n.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(o){const n=o.getAttribute("data-alt")||o.getAttribute("alt")||"";Ge.value=o,Ht.value=n.trim()===""||n.trim()==="Image"?"":n;const a=o.getAttribute("src")||o.src||"";a.startsWith("http://")||a.startsWith("https://")?(qe.value=a,It.value="",Ne.value="url"):(It.value=a,qe.value="",Ne.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";at.value=c.endsWith("px")?c.replace("px",""):c,Et.value=d.endsWith("px")?d.replace("px",""):d,et.value=null}else{mo();return}xt.value=!0,$e.value=!1,$t.value=!1,e.nextTick(()=>{Ne.value==="url"&&Yt.value?(Yt.value.focus(),Yt.value.select()):nl.value&&(nl.value.focus(),nl.value.select()),Ft.value&&(Ft.value.value="")})},In=()=>{xt.value=!1,Ht.value="",It.value="",qe.value="",at.value="",Et.value="",ll.value=null,Ge.value=null,et.value=null,Ne.value="upload"},an=()=>{const o=(Ht.value||"").trim(),n=f.value?._mutationObserver;n&&n.disconnect(),q.value?(Le.value&&(clearTimeout(Le.value),Le.value=null),St(),q.value=!1):St();const a=Ne.value==="url"?qe.value.trim():It.value;if(Ge.value&&f.value&&f.value.contains(Ge.value)){a&&(Ge.value.src=a),Ge.value.setAttribute("alt",o),Ge.value.setAttribute("data-alt",o),at.value?(Ge.value.style.width=`${at.value}px`,Ge.value.setAttribute("width",at.value)):(Ge.value.style.removeProperty("width"),Ge.value.removeAttribute("width")),Et.value?(Ge.value.style.height=`${Et.value}px`,Ge.value.setAttribute("height",Et.value)):(Ge.value.style.removeProperty("height"),Ge.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(Ge.value),c.collapse(!0),r.addRange(c)}we()}else{if(!a){n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),In();return}if(f.value){f.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(et.value&&(El(et.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&f.value){if(d=document.createRange(),f.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",f.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){In();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!f.value.contains(m)){if(d=document.createRange(),f.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",f.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const v=document.createElement("img");v.src=a,v.setAttribute("alt",o),v.setAttribute("data-alt",o),at.value&&(v.style.width=`${at.value}px`,v.setAttribute("width",at.value)),Et.value&&(v.style.height=`${Et.value}px`,v.setAttribute("height",Et.value));try{d.insertNode(v),d.setStartAfter(v),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(f.value){if(f.value.childNodes.length===0){const T=document.createElement("p");f.value.appendChild(T),T.appendChild(v)}else{const T=f.value.lastChild;if(T&&T.nodeType===1)T.appendChild(v);else{const E=document.createElement("p");f.value.appendChild(E),E.appendChild(v)}}const M=document.createRange();M.setStartAfter(v),M.collapse(!0),c&&(c.removeAllRanges(),c.addRange(M))}}Ge.value=v,we()}}e.nextTick(()=>{n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),Zt(),Ut(),In()})};e.watch(()=>$.modelValue,o=>{if($.richText&&f.value&&!ne.value){const n=zn(o||""),r=f.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=n.replace(/&nbsp;|\u00A0/g," ");if(r!==c){const d=Ce();f.value.innerHTML=n,e.nextTick(()=>{le();const u=f.value.innerHTML||"",m=$.title||"",v=$.description||"";U.value=u,se.value=m,He.value=v,ee.value=u,it.value=m,bt.value=v,Ye.value=[],mt.value=[],Le.value&&(clearTimeout(Le.value),Le.value=null),q.value=!1,d&&El(d),W(),tt(),yl(),Zt(),Ut(),Hl(),Rl("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>$.richText,o=>{o?(Ut(),e.nextTick(()=>{Zn()})):(hn(),Q.value=[],Oe.value&&(Oe.value.disconnect(),Oe.value=null)),Hl()}),e.watch(()=>$.floatingToolbar,o=>{o?Ut():hn()}),e.watch(()=>$.disabled,o=>{o&&hn(),Hl()}),e.watch(()=>$.description,()=>{e.nextTick(()=>{V.value?zl():En()})}),e.watch(()=>$.title,()=>{e.nextTick(()=>{Dt.value?Fl():Nl()})}),e.watch(()=>$.customToolbarSlots,()=>{e.nextTick(()=>{ft()})},{deep:!0}),e.watch(()=>$.comments,(o,n)=>{if(no.value){no.value=!1;return}Tn.value||$.richText&&f.value&&e.nextTick(()=>{Ot()})},{deep:!0,immediate:!1});const Ot=()=>{if(!Tn.value&&!(!$.comments||!Array.isArray($.comments)||$.comments.length===0)&&!(!$.richText||!f.value)){Tn.value=!0;try{const o=new Set,n=$.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),a=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=a.length;a.forEach(u=>{const m=u.parentNode;if(m){for(;u.firstChild;)m.insertBefore(u.firstChild,u);m.removeChild(u)}});let c=0;const d=new Set;n.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const m=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!m)return;const v=String(m);if(d.has(v))return;const h=f.value.querySelector(`[data-comment="${v}"]`);if(h){Fn(h,u),d.add(v);return}try{const M=go(u.selection_range,u.selection_text);if(M&&!M.collapsed){const T=M.commonAncestorContainer,E=T.nodeType===3?T.parentElement:T;if(E){const De=E.closest("[data-comment], [data-fake-comment]");if(De){const Se=De.getAttribute("data-comment")||De.getAttribute("data-fake-comment");if(String(Se)===String(m)){De.setAttribute("data-comment",v),De.removeAttribute("data-fake-comment"),Fn(De,u),d.add(v);return}else return}}const G=f.value.querySelector(`[data-comment="${v}"]`);if(G){Fn(G,u),d.add(v);return}const Y=document.createElement("span");Y.setAttribute("data-comment",v),Fn(Y,u);try{M.surroundContents(Y),c++,d.add(v)}catch{try{const Se=document.createRange();Se.setStart(M.startContainer,M.startOffset),Se.setEnd(M.endContainer,M.endOffset),Vo(Se),Se.surroundContents(Y),c++,d.add(v)}catch{try{const vt=M.extractContents();Y.appendChild(vt),M.insertNode(Y),c++,d.add(v)}catch(vt){console.warn("Failed to create comment marker:",vt)}}}}}catch{}}),e.nextTick(()=>{Rl("restoreCommentsFromModel"),we(),Tn.value=!1})}catch{Tn.value=!1}}},Vo=o=>{if(!o||!f.value)return o;try{const n=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=o.startContainer,r=o.startOffset;if(a.nodeType===3){const u=a.parentElement;u&&n.includes(u.tagName)&&(r===0&&!fo(a)||o.setStartBefore(u))}else a.nodeType===1&&n.includes(a.tagName)&&r>0&&o.setStartBefore(a);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&n.includes(u.tagName)&&(d===c.length&&!vo(c)||o.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},fo=o=>{let n=o.previousSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.previousSibling}return!1},vo=o=>{let n=o.nextSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.nextSibling}return!1},go=(o,n)=>{if(!o||!f.value)return null;try{const a=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(a.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}return u?Vo(a):null}}catch{return null}return null},Fn=(o,n)=>{if(!o||!n)return;const a=n.conversation||[],r=new Set,c=[],d=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),c.push(m))};a.length>0&&a.forEach(m=>{m.user&&d(m.user)}),c.length>0?o.setAttribute("data-comment-user",JSON.stringify(c[0])):o.removeAttribute("data-comment-user"),c.length>1?o.setAttribute("data-comment-user-2",JSON.stringify(c[1])):o.removeAttribute("data-comment-user-2");const u=a.length;u>0?o.setAttribute("data-comment-count",String(u)):o.removeAttribute("data-comment-count")},Rl=(o="unknown")=>{if(!$.richText||!f.value){Q.value=[];return}Date.now()-Tt.value<At&&pt.value!==null||pt.value===null&&(pt.value=requestAnimationFrame(()=>{if(pt.value=null,Tt.value=Date.now(),Ve.value)return;Ve.value=!0;const a={},r=f.value;if(!r){Ve.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){Ve.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(E=>{const G=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");G&&E.tagName==="SPAN"&&(m.has(G)||(u.push(E),m.add(G)))}),d.forEach(E=>{const G=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");!G||m.has(G)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(E.tagName)?E.querySelector(`span[data-comment="${G}"], span[data-fake-comment="${G}"]`)||(u.push(E),m.add(G)):E.tagName!=="SPAN"&&(u.push(E),m.add(G)))});const v=c.getBoundingClientRect(),h=r.getBoundingClientRect();u.forEach((E,G)=>{let Y=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");if(!Y)return;if(typeof Y=="string"&&Y.startsWith("comment-")){const Zl=E.textContent?.trim(),Cl=$.comments?.find(Il=>(typeof Il.conversation_id=="string"&&Il.conversation_id.startsWith("comment-")?null:Il.conversation_id)&&Il.selection_text?.trim()===Zl);Cl?(Y=String(Cl.conversation_id),E.setAttribute("data-comment",Y),E.removeAttribute("data-fake-comment")):(Y=String(Date.now()),E.setAttribute("data-comment",Y),E.removeAttribute("data-fake-comment"))}const De=E.getBoundingClientRect(),Se=window.getComputedStyle(E),vt=parseFloat(Se.lineHeight)||parseFloat(Se.fontSize)*1.2,rl=De.top-h.top+vt/2-15,Jt=h.top-v.top+rl;let dl=null,en=null,tn=0;const pn=[],sn=new Set;if(Y&&$.comments){const Zl=$.comments.find(Cl=>String(Cl.conversation_id||Cl.id)===String(Y));if(Zl){const Cl=Zl.conversation||[];Cl.length>0?(Cl.forEach(Il=>{Il.user&&Il.user.id&&!sn.has(Il.user.id)&&(sn.add(Il.user.id),pn.push(Il.user))}),tn=Cl.length):(tn=0,dl=null,en=null),pn.length>0?dl=pn[0]:dl=null,pn.length>1?en=pn[1]:en=null}}const Un=De.top+vt/2-15,Xn=Un+30,Wl=5,Nn=Xn>h.top+Wl&&Un<h.bottom-Wl?1:0;Q.value.find(Zl=>Zl.id===Y);let fn=E;if(!fn&&Y&&f.value){const Zl=String(Y);fn=f.value.querySelector(`[data-comment="${Zl}"], [data-fake-comment="${Zl}"]`)}const Nt=pn.length;a[Y]?(a[Y].top=Jt,a[Y].opacity=Nn,a[Y].element=fn,a[Y].firstUser=dl,a[Y].secondUser=en,a[Y].totalCount=tn,a[Y].uniqueUserCount=Nt):a[Y]={id:Y,top:Jt,opacity:Nn,element:fn,firstUser:dl,secondUser:en,totalCount:tn,uniqueUserCount:Nt}});const M=Object.values(a).map(E=>{const G=Math.max(0,(E.uniqueUserCount??0)-2);if(!E.element&&E.id&&f.value){const De=String(E.id);E.element=f.value.querySelector(`[data-comment="${De}"], [data-fake-comment="${De}"]`)}return{...E,firstUser:E.firstUser||null,secondUser:E.secondUser||null,totalCount:E.totalCount,additionalCount:G}});(Q.value.length!==M.length||M.some((E,G)=>{const Y=Q.value[G];if(!Y)return!0;const De=(Y.firstUser?.id||null)!==(E.firstUser?.id||null),Se=(Y.secondUser?.id||null)!==(E.secondUser?.id||null);return Y.id!==E.id||Math.abs(Y.top-E.top)>1||Y.opacity!==E.opacity||Y.totalCount!==E.totalCount||Y.additionalCount!==E.additionalCount||De||Se||Y.element!==E.element}))&&(Q.value=M),Ve.value=!1}))},zo=o=>{if(!o)return;let n=o.element;if(!n&&o.id&&f.value){const a=String(o.id);n=f.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}n&&(Cn(),Kt.value=n,n.classList.add("editor-comment-highlighted"))},Cn=(o=!1)=>{!o&&dt.value!==null&&Kt.value&&(Kt.value.getAttribute("data-comment")||Kt.value.getAttribute("data-fake-comment"))===dt.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Kt.value&&(Kt.value.classList.remove("editor-comment-highlighted"),Kt.value=null))},ho=o=>{if(!o||!o.element)return;Cn(!0);const n=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!n)return;const a=`[data-comment="${n}"], [data-fake-comment="${n}"]`;X("comment-marker-clicked",{commentId:n,selector:a,element:o.element})},Wn=()=>{Cn()},Zn=()=>{!$.richText||!f.value||(Oe.value&&Oe.value.disconnect(),Qe.value!==null&&(clearTimeout(Qe.value),Qe.value=null),Oe.value=new MutationObserver(()=>{Qe.value===null&&(Qe.value=setTimeout(()=>{Qe.value=null,e.nextTick(()=>{Rl("MutationObserver")})},200))}),Oe.value.observe(f.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Rl("setupCommentMarkersObserver-initial"))},yo=(o,n)=>{if(!o||!n)return;const a=n.getBoundingClientRect();let r=a.top,c=a.right+4;o.style.top=`${r}px`,o.style.left=`${c}px`,o.offsetHeight;const d=o.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const v=a.left-d.width-4;o.style.left=`${v}px`}if(d.bottom>m){const v=Math.max(8,m-d.height-8);o.style.top=`${v}px`}d.top<0&&(o.style.top="8px")};return e.watch(()=>rt.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const r=a.getAttribute("data-submenu-id");if(r===o&&o){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(c){if(a.parentNode!==document.body){const d=a.parentNode;a.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{yo(a,c),a.offsetHeight,a.setAttribute("data-active","true"),a.style.visibility="visible",a.style.opacity="1"})})}else a.setAttribute("data-active","true")}else a.setAttribute("data-active","false"),a.style.display="none",a.style.top="",a.style.left="",a.style.visibility="",a.style.opacity=""})})}),e.watch(()=>[be.value,st.value],()=>{be.value==="askAi"||st.value==="askAi"?e.nextTick(()=>{dn()}):(rt.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(n=>{if(n.parentNode===document.body){const a=n.getAttribute("data-submenu-id");if(a){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(r)if(n.dataset.originalParentRef==="inside")r.appendChild(n);else{const d=r.closest(".dss-toolbar-dropdown");d&&d.insertBefore(n,r.nextSibling)}}}})}))}),e.watch(()=>$.locale,o=>{o&&o!==oe.value&&(oe.value=o)},{immediate:!0}),ae({openCommentOverlayForSelector:Ho,updateCommentMarkers:Rl,restoreCommentsFromModel:Ot}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",Je.value]),style:e.normalizeStyle(Lt.value)},[L.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",mu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:_n,title:e.unref(_)("textEditor.toolbar.undo")},[...n[45]||(n[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,pu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Z.value}]),onClick:Pl,title:e.unref(_)("textEditor.toolbar.redo")},[...n[46]||(n[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,fu),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",vu,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=a=>ln("paragraph")),title:e.unref(_)("textEditor.toolbar.paragraphFormat")},[S.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,hu)):S.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,yu)):S.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,ku)):S.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Cu)):S.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,bu)):S.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,wu)):(e.openBlock(),e.createElementBlock("svg",xu,[...n[47]||(n[47]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[48]||(n[48]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,gu),be.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[8]||(n[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[1]||(n[1]=a=>Bl("<h1>"))},[e.createElementVNode("img",{src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Eu),e.createElementVNode("h1",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=a=>Bl("<h2>"))},[e.createElementVNode("img",{src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Su),e.createElementVNode("h2",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=a=>Bl("<h3>"))},[e.createElementVNode("img",{src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Vu),e.createElementVNode("h3",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=a=>Bl("<h4>"))},[e.createElementVNode("img",{src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Nu),e.createElementVNode("h4",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=a=>Bl("<h5>"))},[e.createElementVNode("img",{src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Bu),e.createElementVNode("h5",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=a=>Bl("<h6>"))},[e.createElementVNode("img",{src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Mu),e.createElementVNode("h6",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=a=>Bl("<p>"))},[n[49]||(n[49]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("bold")}]),onClick:n[9]||(n[9]=a=>Gl("bold")),title:e.unref(_)("textEditor.toolbar.bold")},[...n[50]||(n[50]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,_u),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("italic")}]),onClick:n[10]||(n[10]=a=>Gl("italic")),title:e.unref(_)("textEditor.toolbar.italic")},[...n[51]||(n[51]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,$u),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("underline")}]),onClick:n[11]||(n[11]=a=>Gl("underline")),title:e.unref(_)("textEditor.toolbar.underline")},[...n[52]||(n[52]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Lu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":gt.value}]),onClick:On,title:e.unref(_)("textEditor.toolbar.citation")},[...n[53]||(n[53]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,Tu),n[62]||(n[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ge.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:Ln,title:e.unref(_)("textEditor.toolbar.removeLink")},[...n[55]||(n[55]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,Du)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:$n,title:e.unref(_)("textEditor.toolbar.insertLink")},[...n[54]||(n[54]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,Au)),n[63]||(n[63]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("insertUnorderedList")}]),onClick:k,title:e.unref(_)("textEditor.toolbar.bulletList")},[...n[56]||(n[56]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,Hu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("insertOrderedList")}]),onClick:y,title:e.unref(_)("textEditor.toolbar.numberList")},[...n[57]||(n[57]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,Ru),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:mo,title:e.unref(_)("textEditor.toolbar.image")},[...n[58]||(n[58]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,Iu),K.value?(e.openBlock(),e.createElementBlock("div",Fu)):e.createCommentVNode("",!0),K.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(_)("textEditor.toolbar.comment"),onClick:ko},[...n[59]||(n[59]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,zu)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",Pu)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",Ou,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=a=>ln("askAi")),title:e.unref(_)("textEditor.toolbar.askAi")},[n[60]||(n[60]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",Wu,e.toDisplayString(e.unref(_)("textEditor.toolbar.askAi")),1)],8,qu),be.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Zu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Wt(a)?(e.openBlock(),e.createElementBlock("div",Uu,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),Wt(a)&&r<L.customToolbarSlots.length-1&&hl(r)?(e.openBlock(),e.createElementBlock("div",Xu)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(be.value==="paragraph"||be.value==="askAi")&&L.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Pt})):e.createCommentVNode("",!0),e.createVNode(Oo,{showModal:Me.value,width:"500px",height:"55vh",onCloseModal:qn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(_)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Yu,[e.createElementVNode("div",ju,[e.createElementVNode("label",Ku,e.toDisplayString(e.unref(_)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:pe,type:"text","onUpdate:modelValue":n[15]||(n[15]=a=>lt.value=a),class:"dss-link-modal-input",placeholder:e.unref(_)("textEditor.link.enterAltText"),onKeyup:e.withKeys(ql,["enter"])},null,40,Gu),[[e.vModelText,lt.value]])]),e.createElementVNode("div",Qu,[e.createElementVNode("label",Ju,e.toDisplayString(e.unref(_)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:R,type:"text","onUpdate:modelValue":n[16]||(n[16]=a=>ze.value=a),class:"dss-link-modal-input",placeholder:e.unref(_)("textEditor.link.enterUrl"),onKeyup:e.withKeys(ql,["enter"])},null,40,ed),[[e.vModelText,ze.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:qn},e.toDisplayString(e.unref(_)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:ql},e.toDisplayString(e.unref(_)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Oo,{showModal:xt.value,width:"500px",height:"80vh",onCloseModal:In},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Ge.value?e.unref(_)("textEditor.image.editImage"):e.unref(_)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",td,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Ne.value==="upload"}]),onClick:n[17]||(n[17]=a=>Ne.value="upload")},e.toDisplayString(e.unref(_)("textEditor.image.upload")),3),n[65]||(n[65]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Ne.value==="url"}]),onClick:n[18]||(n[18]=a=>Ne.value="url")},e.toDisplayString(e.unref(_)("textEditor.image.imageLink")),3)]),Ne.value==="upload"?(e.openBlock(),e.createElementBlock("div",ld,[e.createElementVNode("div",nd,[e.createElementVNode("div",od,[ct.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",ad,e.toDisplayString(e.unref(_)("textEditor.image.uploadImage")),1)),ct.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:kl},[e.createElementVNode("img",{src:It.value,alt:"Preview",class:"dss-image-preview-image"},null,8,sd),n[66]||(n[66]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:Ft,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Qt},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Ft,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Qt},null,544))]),e.createElementVNode("div",rd,[e.createElementVNode("label",id,e.toDisplayString(e.unref(_)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:nl,type:"text","onUpdate:modelValue":n[19]||(n[19]=a=>Ht.value=a),class:"dss-link-modal-input",placeholder:e.unref(_)("textEditor.image.enterAltText"),onKeyup:e.withKeys(an,["enter"])},null,40,cd),[[e.vModelText,Ht.value]])]),e.createElementVNode("div",ud,[e.createElementVNode("label",dd,e.toDisplayString(e.unref(_)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=a=>at.value=a),class:"dss-link-modal-input",placeholder:e.unref(_)("textEditor.image.auto"),onKeyup:e.withKeys(an,["enter"]),onInput:Eo},null,40,md),[[e.vModelText,at.value]])]),e.createElementVNode("div",pd,[e.createElementVNode("label",fd,e.toDisplayString(e.unref(_)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=a=>Et.value=a),class:"dss-link-modal-input",placeholder:e.unref(_)("textEditor.image.auto"),onKeyup:e.withKeys(an,["enter"]),onInput:So},null,40,vd),[[e.vModelText,Et.value]])])])])):e.createCommentVNode("",!0),Ne.value==="url"?(e.openBlock(),e.createElementBlock("div",gd,[e.createElementVNode("div",hd,[e.createElementVNode("div",yd,[e.createElementVNode("label",kd,e.toDisplayString(e.unref(_)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Yt,type:"text","onUpdate:modelValue":n[22]||(n[22]=a=>qe.value=a),class:"dss-link-modal-input",placeholder:e.unref(_)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(an,["enter"])},null,40,Cd),[[e.vModelText,qe.value]])]),e.createElementVNode("div",bd,[e.createElementVNode("label",wd,e.toDisplayString(e.unref(_)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=a=>Ht.value=a),class:"dss-link-modal-input",placeholder:e.unref(_)("textEditor.image.enterAltText"),onKeyup:e.withKeys(an,["enter"])},null,40,xd),[[e.vModelText,Ht.value]])]),e.createElementVNode("div",Ed,[e.createElementVNode("label",Sd,e.toDisplayString(e.unref(_)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=a=>at.value=a),class:"dss-link-modal-input",placeholder:e.unref(_)("textEditor.image.auto"),onKeyup:e.withKeys(an,["enter"]),onInput:Eo},null,40,Vd),[[e.vModelText,at.value]])]),e.createElementVNode("div",Nd,[e.createElementVNode("label",Bd,e.toDisplayString(e.unref(_)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=a=>Et.value=a),class:"dss-link-modal-input",placeholder:e.unref(_)("textEditor.image.auto"),onKeyup:e.withKeys(an,["enter"]),onInput:So},null,40,Md),[[e.vModelText,Et.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:In},e.toDisplayString(e.unref(_)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:an},e.toDisplayString(e.unref(_)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":vn.value&&Dt.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(_)("textEditor.labels.title")),1),e.createElementVNode("div",_d,[Dt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",$d,[L.title?(e.openBlock(),e.createElementBlock("span",Ld,e.toDisplayString(L.title),1)):(e.openBlock(),e.createElementBlock("span",Td,e.toDisplayString(ut.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Re,value:L.title,onInput:Al,onFocus:jl,onBlur:bl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Dt.value}]),placeholder:ut.value,disabled:L.disabled,rows:"1"},null,42,Ad)])],2),vn.value&&Dt.value?(e.openBlock(),e.createElementBlock("div",Dd,[e.renderSlot(o.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":gn.value&&V.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(_)("textEditor.labels.description")),1),e.createElementVNode("div",Hd,[V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Rd,[L.description?(e.openBlock(),e.createElementBlock("span",Id,e.toDisplayString(L.description),1)):(e.openBlock(),e.createElementBlock("span",Fd,e.toDisplayString(Xe.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:ht,value:L.description,onInput:zt,onFocus:Bn,onBlur:Mn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!V.value}]),placeholder:Xe.value,disabled:L.disabled,rows:"1"},null,42,zd)])],2),gn.value&&V.value?(e.openBlock(),e.createElementBlock("div",Pd,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":dt.value===a.id,"editor-comment-marker-group-out-of-view":a.opacity===0}]),"data-comment-id":a.id,style:e.normalizeStyle({top:a.top+"px"}),onMouseenter:r=>zo(a),onMouseleave:Wn},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>ho(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,Wd)):(e.openBlock(),e.createElementBlock("span",Zd,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,qd)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>ho(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Xd)):(e.openBlock(),e.createElementBlock("span",Yd,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,Ud)):e.createCommentVNode("",!0),a.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:a.secondUser?"30px":"15px"}),"data-has-second-user":a.secondUser?"true":"false",onClick:e.withModifiers(r=>ho(a),["stop"])},[e.createElementVNode("span",Kd,"+"+e.toDisplayString(a.additionalCount),1)],12,jd)):e.createCommentVNode("",!0)],46,Od))),128)),L.richText?(e.openBlock(),e.createElementBlock("div",n1,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":L.disabled,"dss-text-editor-fixed-height":L.fixedHeight}]),style:e.normalizeStyle(F.value),onInput:we,onBlur:Ie,onClick:Ro,onMouseup:ro,onKeyup:ro,onKeydown:O,onPaste:xl,onMousemove:Io,onMouseleave:Dn},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[dt.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(ol.value)},[Ql.value||_l.value.length>0?(e.openBlock(),e.createElementBlock("div",o1,[e.createElementVNode("div",a1,[Ql.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:Ql.value},null,8,s1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",r1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_l.value,(a,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:"dss-comment-message"},[a.user&&(a.user.avatar||a.user.initials||a.user.name)?(e.openBlock(),e.createElementBlock("div",i1,[e.createElementVNode("div",c1,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,u1)):(e.openBlock(),e.createElementBlock("span",d1,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",m1,[e.createElementVNode("div",p1,[e.createElementVNode("div",f1,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",v1,e.toDisplayString(to(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":wn(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),$.commentUser&&a.user&&a.user.id===$.commentUser.id&&!wn(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>ao(a,r),["stop"]),title:e.unref(_)("textEditor.comment.delete")||"Delete comment"},[...n[68]||(n[68]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,g1)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",h1,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:al,"onUpdate:modelValue":n[26]||(n[26]=a=>il.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(_)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(oo,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(al.value){const a=al.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,y1),[[e.vModelText,il.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(oo,["stop"])},[...n[69]||(n[69]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",k1,[e.createElementVNode("div",C1,[e.createElementVNode("span",b1,e.toDisplayString(ce.value)+" "+e.toDisplayString(ce.value===1?e.unref(_)("textEditor.footer.word"):e.unref(_)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",w1,e.toDisplayString(Te.value)+" "+e.toDisplayString(Te.value===1?e.unref(_)("textEditor.footer.character"):e.unref(_)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Gd,[e.createElementVNode("textarea",{value:L.modelValue,onInput:xn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":L.fixedHeight}]),placeholder:Ct.value,rows:L.rows,disabled:L.disabled,style:e.normalizeStyle(gl.value)},null,46,Qd),e.createElementVNode("div",Jd,[e.createElementVNode("div",e1,[e.createElementVNode("span",t1,e.toDisplayString(ce.value)+" "+e.toDisplayString(ce.value===1?e.unref(_)("textEditor.footer.word"):e.unref(_)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",l1,e.toDisplayString(Te.value)+" "+e.toDisplayString(Te.value===1?e.unref(_)("textEditor.footer.character"):e.unref(_)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[j.value&&ue.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(H.value),onMouseenter:n[28]||(n[28]=a=>ke.value=!0),onMouseleave:Hn},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(xo,["stop"]),title:ue.value},e.toDisplayString(ue.value),9,x1),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Fo,["stop"]),title:e.unref(_)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",S1,[...n[71]||(n[71]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,E1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[$t.value&&Xt.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(te.value),onMouseenter:n[29]||(n[29]=a=>$e.value=!0),onMouseleave:Rn},[e.createElementVNode("div",V1,[Xt.value===e.unref(_)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",N1,[...n[72]||(n[72]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:Xt.value},e.toDisplayString(Xt.value),9,B1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(po,["stop"]),title:e.unref(_)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",_1,[...n[73]||(n[73]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,M1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.floatingToolbar&&L.richText&&yt.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:tl,class:"dss-floating-toolbar",style:e.normalizeStyle(Ue.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",$1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(_n,["stop"]),title:e.unref(_)("textEditor.toolbar.undo")},[...n[74]||(n[74]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,L1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Z.value}]),onClick:e.withModifiers(Pl,["stop"]),title:e.unref(_)("textEditor.toolbar.redo")},[...n[75]||(n[75]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,T1),n[89]||(n[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",A1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(a=>wo("paragraph"),["stop"])),title:e.unref(_)("textEditor.toolbar.paragraphFormat")},[S.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,H1)):S.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,R1)):S.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,I1)):S.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,F1)):S.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,z1)):S.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,P1)):(e.openBlock(),e.createElementBlock("svg",O1,[...n[76]||(n[76]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[77]||(n[77]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,D1),st.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[38]||(n[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[31]||(n[31]=a=>yn("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=a=>yn("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=a=>yn("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=a=>yn("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=a=>yn("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=a=>yn("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=a=>yn("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(_)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),n[90]||(n[90]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(a=>Gl("bold"),["stop"])),title:e.unref(_)("textEditor.toolbar.bold")},[...n[78]||(n[78]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,q1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(a=>Gl("italic"),["stop"])),title:e.unref(_)("textEditor.toolbar.italic")},[...n[79]||(n[79]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,W1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(a=>Gl("underline"),["stop"])),title:e.unref(_)("textEditor.toolbar.underline")},[...n[80]||(n[80]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Z1),n[91]||(n[91]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":gt.value}]),onClick:e.withModifiers(On,["stop"]),title:e.unref(_)("textEditor.toolbar.citation")},[...n[81]||(n[81]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,U1),n[92]||(n[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ge.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(Ln,["stop"]),title:e.unref(_)("textEditor.toolbar.removeLink")},[...n[83]||(n[83]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,Y1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers($n,["stop"]),title:e.unref(_)("textEditor.toolbar.insertLink")},[...n[82]||(n[82]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,X1)),n[93]||(n[93]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("insertUnorderedList")}]),onClick:e.withModifiers(k,["stop"]),title:e.unref(_)("textEditor.toolbar.bulletList")},[...n[84]||(n[84]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,j1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("insertOrderedList")}]),onClick:e.withModifiers(y,["stop"]),title:e.unref(_)("textEditor.toolbar.numberList")},[...n[85]||(n[85]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,K1),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(mo,["stop"]),title:e.unref(_)("textEditor.toolbar.image")},[...n[86]||(n[86]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,G1),n[95]||(n[95]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(_)("textEditor.toolbar.comment"),onClick:e.withModifiers(ko,["stop"])},[...n[87]||(n[87]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,Q1),L.askAi?(e.openBlock(),e.createElementBlock("div",J1)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",e2,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(a=>wo("askAi"),["stop"])),title:e.unref(_)("textEditor.toolbar.askAi")},[n[88]||(n[88]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",l2,e.toDisplayString(e.unref(_)("textEditor.toolbar.askAi")),1)],8,t2),st.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[43]||(n[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Yl.value?(e.openBlock(),e.createElementBlock("div",n2,[L.askAi&&Yl.value?(e.openBlock(),e.createElementBlock("div",o2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Wt(a)&&Ml(a)?(e.openBlock(),e.createElementBlock("div",a2,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),Wt(a)&&Ml(a)&&r<L.customToolbarSlots.length-1&&Xl(r)?(e.openBlock(),e.createElementBlock("div",s2)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),c2={class:"dss-color-picker__section-title"},u2={class:"dss-color-picker__presets-row"},d2=["title","onClick"],m2={key:1,class:"dss-color-picker__section"},p2={class:"dss-color-picker__presets-row"},f2=["title","onClick"],v2={class:"dss-color-picker__section"},g2={class:"dss-color-picker__section-header"},h2={class:"dss-color-picker__presets-row"},y2=["title","onClick"],k2=["onClick"],C2={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},b2=["title","onClick"],w2={class:"dss-color-picker__input-row"},x2=["value"],E2={__name:"DSSColorPicker",props:{modelValue:{type:String,default:"#b8a5de"},disabled:{type:Boolean,default:!1},presetColors:{type:Array,default:()=>[]},presetGroups:{type:Array,default:null},max:{type:Number,default:12},initialPresetCount:{type:Number,default:null}},emits:["update:modelValue","update:presetColors"],setup(L,{emit:ae}){function B(q){const U=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(q);if(!U)return{h:0,s:0,l:50};const ee=parseInt(U[1],16)/255,se=parseInt(U[2],16)/255,He=parseInt(U[3],16)/255,it=Math.max(ee,se,He),bt=Math.min(ee,se,He);let Re=0,ht=0;const Rt=(it+bt)/2;if(it!==bt){const jt=it-bt;switch(ht=Rt>.5?jt/(2-it-bt):jt/(it+bt),it){case ee:Re=((se-He)/jt+(se<He?6:0))/6;break;case se:Re=((He-ee)/jt+2)/6;break;case He:Re=((ee-se)/jt+4)/6;break}}return{h:Re*360,s:ht*100,l:Rt*100}}function _(q,U,ee){U/=100,ee/=100;const se=U*Math.min(ee,1-ee),He=it=>{const bt=(it+q/30)%12,Re=ee-se*Math.max(Math.min(bt-3,9-bt,1),-1);return Math.round(255*Re).toString(16).padStart(2,"0")};return`#${He(0)}${He(8)}${He(4)}`}function oe(q){const U=q.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!U)return null;let ee=U[1];return ee.length===3&&(ee=ee.split("").map(se=>se+se).join("")),"#"+ee}function z(q,U,ee){U/=100,ee/=100;const se=ee+U*Math.min(ee,1-ee),He=se===0?0:2-2*ee/se;return{h:q,s:He*100,v:se*100}}function $(q,U,ee){U/=100,ee/=100;const se=ee*(1-U/2),He=se===0||se===1?0:(ee-se)/Math.min(se,1-se);return{h:q,s:He*100,l:se*100}}const X=L,Ke=ae,ve=e.ref(!1),f=e.ref(!1),be=e.ref(!1),ge=e.ref(-1),ne=e.ref(-1),j=e.ref(null),ue=e.ref(null),H=e.ref(null),ke=e.ref(null),Me=e.ref({top:0,left:0}),ze=e.ref(B(X.modelValue||"#b8a5de")),lt=e.computed(()=>Array.isArray(X.presetGroups)&&X.presetGroups.length>0),R=e.computed(()=>lt.value?0:X.initialPresetCount!=null?X.initialPresetCount:ne.value<0?null:ne.value),pe=e.computed(()=>{const q=R.value;return q==null?!0:Math.max(0,X.presetColors.length-q)<X.max}),fe=e.computed(()=>!!(f.value||ge.value>=0||!ie.value&&X.presetColors.length===0));e.computed(()=>{const q=R.value;return q!=null&&X.presetColors.length>q});const ie=e.computed(()=>lt.value||R.value!=null),nt=e.computed(()=>{const q=R.value;return q==null?[]:X.presetColors.slice(0,q)}),gt=e.computed(()=>{const q=R.value;return q==null?[]:X.presetColors.slice(q)});function he(q){const U=R.value;return U!=null?U+q:-1}function yt(q){const U=R.value;return U!=null&&q>=U}function Ue(q){yt(q)&&(ge.value=q,ze.value=B(X.presetColors[q]),f.value=!0,e.nextTick(()=>ke.value?.focus()))}function tl(q){if(!yt(q))return;const U=X.presetColors.filter((He,it)=>it!==q);Ke("update:presetColors",U);const ee=oe(X.modelValue),se=oe(X.presetColors[q]);if(ee&&se&&ee.toLowerCase()===se.toLowerCase()){const He=U[Math.max(0,q-1)]||U[0];He&&Ke("update:modelValue",He)}}function st(){be.value=!be.value,be.value||(ge.value=-1,f.value=!1)}function xt(){if(ge.value<0)return;const q=at.value,U=oe(q);if(U){const ee=[...X.presetColors];ee[ge.value]=U,Ke("update:presetColors",ee),Ke("update:modelValue",U),ge.value=-1,f.value=!1}}function Ht(){X.disabled||(ge.value=-1,f.value=!f.value,f.value&&($t(),e.nextTick(()=>ke.value?.focus())))}function ll(q){const U=oe(q),ee=oe(X.modelValue);return U&&ee&&U.toLowerCase()===ee.toLowerCase()}function It(){if(X.disabled||!pe.value)return;const q=at.value,U=oe(q);if(U){const ee=[...X.presetColors,U];Ke("update:presetColors",ee),Ke("update:modelValue",U);const se=R.value??ne.value;se>=0&&ee.length-se>=X.max&&(f.value=!1)}}const at=e.computed(()=>{const{h:q,s:U,l:ee}=ze.value;return _(q,U,ee)}),Et=e.computed(()=>at.value.toLowerCase()),nl=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${ze.value.h}, 100%, 50%))`})),Ft=e.computed(()=>{const q=z(ze.value.h,ze.value.s,ze.value.l);return{left:`${q.s}%`,bottom:`${q.v}%`,transform:"translate(-50%, 50%)"}}),Yt=e.computed(()=>({left:`${ze.value.h/360*100}%`,transform:"translateX(-50%)"})),Ge=e.computed(()=>({position:"fixed",left:`${Me.value.left}px`,top:`${Me.value.top}px`,zIndex:1002}));function et(){if(!j.value||!ve.value)return;const q=j.value.getBoundingClientRect(),U=window.innerHeight||document.documentElement.clientHeight;let ee=q.bottom+4;const se=ue.value;se&&ee+se.offsetHeight>U-8&&(ee=q.top-4-se.offsetHeight),Me.value={top:ee,left:q.left}}function $t(){const q=X.modelValue||"#b8a5de";oe(q)&&(ze.value=B(q))}function Xt(){Ke("update:modelValue",at.value)}function te(){X.disabled||(ve.value=!ve.value,ve.value&&($t(),e.nextTick(()=>{et(),ke.value?.focus()})))}function $e(){const q=at.value,U=oe(q);if(U){if(ge.value>=0){const ee=[...X.presetColors];ee[ge.value]=U,Ke("update:presetColors",ee),Ke("update:modelValue",U)}else if((X.presetColors.length>0||lt.value)&&f.value&&pe.value&&!X.presetColors.some(se=>oe(se)?.toLowerCase()===U.toLowerCase())){const se=[...X.presetColors,U];Ke("update:presetColors",se),Ke("update:modelValue",U)}}ve.value=!1,f.value=!1,be.value=!1,ge.value=-1}function Ne(q){if(!H.value)return;const U=H.value.getBoundingClientRect(),ee=se=>{const He=Math.max(0,Math.min(1,(se.clientX-U.left)/U.width)),it=Math.max(0,Math.min(1,1-(se.clientY-U.top)/U.height)),bt={h:ze.value.h,s:He*100,v:it*100};ze.value=$(bt.h,bt.s,bt.v)};ee(q),document.addEventListener("mousemove",ee),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ee),Xt()},{once:!0})}function qe(q){if(!q.currentTarget)return;const ee=q.currentTarget.getBoundingClientRect(),se=He=>{const it=Math.max(0,Math.min(1,(He.clientX-ee.left)/ee.width));ze.value={...ze.value,h:it*360}};se(q),document.addEventListener("mousemove",se),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",se),Xt()},{once:!0})}function rt(q){const U=q.target.value,ee=oe(U);ee&&(ze.value=B(ee),Ke("update:modelValue",ee))}function Ze(q){if(X.disabled)return;const U=oe(q);U&&(ze.value=B(U),Ke("update:modelValue",U))}let Ye=null,mt=null;function Le(){Ye&&(document.removeEventListener("keydown",Ye),Ye=null),mt&&(window.removeEventListener("resize",mt),mt=null)}return e.watch(ve,q=>{if(Le(),q){if(!lt.value&&X.initialPresetCount==null){const U=X.presetColors.length;U>0&&(ne.value<0||U<ne.value)&&(ne.value=U)}Ye=U=>{U.key==="Escape"&&$e()},mt=et,document.addEventListener("keydown",Ye),window.addEventListener("resize",mt)}}),e.watch(()=>X.modelValue,()=>{ve.value&&$t()},{immediate:!1}),e.watch(gt,q=>{q.length===0&&(be.value=!1,ge.value=-1,f.value=!1)}),e.onBeforeUnmount(Le),(q,U)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":L.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:j,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":ve.value}]),onClick:te},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:at.value})},[...U[0]||(U[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ve.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers($e,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ue,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Ge.value)},[ie.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[lt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(L.presetGroups,(ee,se)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+se,class:"dss-color-picker__section"},[e.createElementVNode("span",c2,e.toDisplayString(ee.title),1),e.createElementVNode("div",u2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.colors,(He,it)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+se+"-"+it,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":ll(He)}]),style:e.normalizeStyle({backgroundColor:He}),title:He,onClick:e.withModifiers(bt=>Ze(He),["stop"])},null,14,d2))),128))])]))),128)):nt.value.length?(e.openBlock(),e.createElementBlock("div",m2,[U[1]||(U[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",p2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nt.value,(ee,se)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+se,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":ll(ee)}]),style:e.normalizeStyle({backgroundColor:ee}),title:ee,onClick:e.withModifiers(He=>Ze(ee),["stop"])},null,14,f2))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",v2,[e.createElementVNode("div",g2,[U[3]||(U[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),gt.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__manage-icon",{"dss-color-picker__manage-icon--active":be.value}]),title:"Manage custom colors",onClick:e.withModifiers(st,["stop"])},[...U[2]||(U[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",h2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value,(ee,se)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+se,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":be.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!be.value&&ll(ee),"dss-color-picker__preset-bubble--editing":be.value&&ge.value===he(se)}]),style:e.normalizeStyle({backgroundColor:ge.value===he(se)?at.value:ee}),title:ge.value===he(se)?at.value:ee,onClick:e.withModifiers(He=>be.value?Ue(he(se)):Ze(ee),["stop"])},null,14,y2),be.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__preset-action dss-color-picker__preset-action--delete",title:"Delete",onClick:e.withModifiers(He=>tl(he(se)),["stop"])},[...U[4]||(U[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,k2)):e.createCommentVNode("",!0)],2))),128)),pe.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":f.value}]),onClick:e.withModifiers(Ht,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):L.presetColors.length?(e.openBlock(),e.createElementBlock("div",C2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.presetColors,(ee,se)=>(e.openBlock(),e.createElementBlock("button",{key:se,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":ll(ee)}]),style:e.normalizeStyle({backgroundColor:ee}),title:ee,onClick:e.withModifiers(He=>Ze(ee),["stop"])},null,14,b2))),128)),pe.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":f.value}]),onClick:e.withModifiers(Ht,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),fe.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:H,onMousedown:Ne},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(nl.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Ft.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:qe},[U[5]||(U[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(Yt.value)},null,4)],32),e.createElementVNode("div",w2,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:ke,type:"text",class:"dss-color-picker__hex-input",value:Et.value,onInput:rt},null,40,x2)]),ie.value&&(L.presetColors.length||lt.value)&&pe.value&&ge.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:It}," Save color ")):e.createCommentVNode("",!0),ie.value&&ge.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:xt}," Save color ")):e.createCommentVNode("",!0),ie.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:$e}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},S2={key:0,class:"dss-loader"},V2={key:0,class:"dss-loader-label"},N2={key:1,class:"dss-loader"},B2={key:0,class:"dss-loader-label"},M2={key:2,class:"dss-loader"},_2={key:0,class:"dss-loader-label"},$2={key:3,class:"dss-loader"},L2={key:0,class:"dss-loader-label"},T2={key:4,class:"dss-loader"},A2={key:0,class:"dss-loader-label"},D2={key:5,class:"dss-loader dss-loader--inline"},H2={class:"dss-loader-inline-text"},R2={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(L){const ae=L,B=e.computed(()=>ae.size==="small"?"dss-loaders--size-small":ae.size==="large"?"dss-loaders--size-large":ae.size==="medium"||ae.size==null?"dss-loaders--size-medium":null),_=e.computed(()=>{const oe={};if(!(ae.size==="small"||ae.size==="medium"||ae.size==="large"||ae.size==null)){const z=typeof ae.size=="number"?`${ae.size}px`:String(ae.size);oe["--dss-loader-size"]=z}return ae.color&&(oe["--dss-loader-accent"]=ae.color,oe["--dss-loader-accent-soft"]=`color-mix(in srgb, ${ae.color} 30%, white)`),oe});return(oe,z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",B.value]),style:e.normalizeStyle(_.value)},[L.type==="spinner"?(e.openBlock(),e.createElementBlock("div",S2,[z[0]||(z[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),L.label?(e.openBlock(),e.createElementBlock("span",V2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="dots"?(e.openBlock(),e.createElementBlock("div",N2,[z[1]||(z[1]=e.createElementVNode("span",{class:"dss-loader-dots","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"})],-1)),L.label?(e.openBlock(),e.createElementBlock("span",B2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="battery"?(e.openBlock(),e.createElementBlock("div",M2,[z[2]||(z[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),L.label?(e.openBlock(),e.createElementBlock("span",_2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",$2,[z[3]||(z[3]=e.createElementVNode("span",{class:"dss-loader-double-circle","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-double-circle-outer"}),e.createElementVNode("span",{class:"dss-loader-double-circle-inner"})],-1)),L.label?(e.openBlock(),e.createElementBlock("span",L2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="bars"?(e.openBlock(),e.createElementBlock("div",T2,[z[4]||(z[4]=e.createElementVNode("span",{class:"dss-loader-bars","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"})],-1)),L.label?(e.openBlock(),e.createElementBlock("span",A2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="inline"?(e.openBlock(),e.createElementBlock("div",D2,[z[5]||(z[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",H2,[e.renderSlot(oe.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(L.label),1)])])])):e.createCommentVNode("",!0)],6))}},jo="dss-skeleton-item",I2={__name:"DSSSkeleton",props:{loading:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},borderRadius:{type:String,default:"16px"},shimmer:{type:Boolean,default:!0},mode:{type:String,default:"single",validator:L=>["single","multiple"].includes(L)},targetClass:{type:String,default:jo},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(L){const ae=L,B=e.computed(()=>{const z={"dss-skeleton--loading":ae.loading,"dss-skeleton--static":!ae.shimmer,"dss-skeleton--multiple":ae.mode==="multiple","dss-skeleton--dark":ae.darkMode};return ae.mode==="multiple"&&ae.targetClass!==jo&&(z[`dss-skeleton--target-${ae.targetClass}`]=!0),z}),_=e.computed(()=>{const z={};return ae.borderRadius&&(z.borderRadius=ae.borderRadius),z}),oe=e.computed(()=>{const z={};return ae.borderRadius&&(z["--dss-skeleton-border-radius"]=ae.borderRadius),ae.darkMode?(z["--dss-skeleton-bg"]=ae.bgDark||"#322c3f",z["--dss-skeleton-shimmer"]=ae.shimmerDark||"#3e3f41",z):(ae.bgColor&&(z["--dss-skeleton-bg"]=ae.bgColor),ae.shimmerColor&&(z["--dss-skeleton-shimmer"]=ae.shimmerColor),z)});return(z,$)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",B.value]),style:e.normalizeStyle(oe.value)},[L.loading&&L.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(_.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":L.loading&&L.mode==="single"}])},[e.renderSlot(z.$slots,"default")],2)],6))}},F2={key:0,class:"dss-dnd-column-header"},z2={class:"dss-dnd-column-title"},P2={class:"dss-dnd-column-count"},O2=["data-column"],q2={key:0,class:"dss-dnd-indicator"},W2=["onPointerdown"],Z2=["onPointerdown"],U2={class:"dss-dnd-item-content"},X2={class:"dss-dnd-item-default"},Y2={key:0,class:"dss-dnd-empty"},j2={name:"DSSDnd"},K2=Object.assign(j2,{props:{items:{type:Array,required:!0},columns:{type:Array,required:!0},columnKey:{type:String,default:"status"},positionKey:{type:String,default:"position"},itemKey:{type:String,default:"id"},options:{type:Object,default:()=>({})}},emits:["move","delete"],setup(L,{emit:ae}){const B=L,_=ae,oe=e.useSlots(),z=e.computed(()=>!!oe["delete-zone"]),$={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1,ColColor:!1},X=e.computed(()=>({...$,...B.options})),Ke=e.computed(()=>({"--dss-dnd-col-min-w":X.value.columnMinWidth,"--dss-dnd-col-max-w":X.value.columnMaxWidth,"--dss-dnd-col-gap":X.value.columnGap,"--dss-dnd-indicator-color":X.value.indicatorColor,"--dss-dnd-body-max-h":X.value.columnBodyMaxHeight}));function ve(te){if(!X.value.ColColor||!te)return{};const $e=te.background||te.color;return $e?{background:$e}:{}}const f=e.ref(null),be=e.ref(null),ge=e.ref(!1),ne=e.ref(-1),j=e.ref(null);let ue=null,H=null,ke=null,Me=null,ze=0,lt=0,R="",pe=null;const fe=5,ie=e.computed(()=>{const te={};for(const $e of B.columns)te[$e.value]=B.items.filter(Ne=>Ne[B.columnKey]===$e.value).sort((Ne,qe)=>(Ne[B.positionKey]??0)-(qe[B.positionKey]??0));return te}),nt=e.computed(()=>{const te={},$e=!!f.value,Ne=f.value?.[B.itemKey],qe=be.value,rt=ne.value;for(const Ze of B.columns){const Ye=ie.value[Ze.value]||[],mt=[],Le=qe==Ze.value;let q=0;for(let U=0;U<Ye.length;U++){const ee=Ye[U],se=$e&&ee[B.itemKey]===Ne;!se&&Le&&rt===q&&mt.push({type:"indicator",key:`ind-${q}`}),se||q++,mt.push({type:"item",item:ee,isDragged:se,key:`item-${ee[B.itemKey]}`})}Le&&rt>=q&&mt.push({type:"indicator",key:"ind-end"}),te[Ze.value]=mt}return te});function gt(te,$e){const qe=(ie.value[te]||[]).filter(Ye=>Ye[B.itemKey]!==f.value?.[B.itemKey]);if(qe.length===0)return 1;if($e<=0){const Ye=qe[0][B.positionKey];return Ye!=null&&Ye>0?Ye/2:.5}if($e>=qe.length){const Ye=qe[qe.length-1][B.positionKey];return(Ye??0)+1}const rt=qe[$e-1][B.positionKey]??0,Ze=qe[$e][B.positionKey]??0;return(rt+Ze)/2}function he(te,$e,Ne){ke&&ke.remove();const qe=te.getBoundingClientRect(),rt=te.cloneNode(!0);rt.classList.add("dss-dnd-ghost"),rt.style.cssText=`
104
104
  position: fixed;
105
105
  left: ${$e-ze}px;
106
- top: ${Ne-tt}px;
107
- width: ${Oe.width}px;
108
- height: ${Oe.height}px;
106
+ top: ${Ne-lt}px;
107
+ width: ${qe.width}px;
108
+ height: ${qe.height}px;
109
109
  z-index: 9999;
110
110
  pointer-events: none;
111
111
  opacity: ${X.value.dragGhostOpacity};
@@ -114,5 +114,5 @@
114
114
  background-color: ${X.value.dragSourceBackground};
115
115
  font-family: 'Work Sans', sans-serif;
116
116
  cursor: grabbing;
117
- `,document.body.appendChild(st),ke=st}function yt(te,$e){ke&&(ke.style.left=`${te-ze}px`,ke.style.top=`${$e-tt}px`)}function qe(te){te.classList.add("dss-dnd-item--dragging"),te.style.background=X.value.dragSourceBackground,te.style.borderColor=X.value.dragSourceBorder,te.style.transform="scale(0.97)"}function tl(te){te.classList.remove("dss-dnd-item--dragging"),te.style.background="",te.style.borderColor="",te.style.transform=""}function at(te,$e){return document.elementFromPoint(te,$e)?.closest(".dss-dnd-column-body")??null}function Et(te,$e){return!!document.elementFromPoint(te,$e)?.closest("[data-dss-dnd-delete-zone]")}function Ht(te,$e){if(z.value&&Et(te,$e)){fe.value=!0,be.value=null,ne.value=-1;return}fe.value=!1;const Ne=at(te,$e),Oe=Ne?.getAttribute("data-column")??null;if(!Oe){be.value=null,ne.value=-1;return}be.value=Oe;const st=Ne.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Ze=st.length;for(let Ye=0;Ye<st.length;Ye++){const dt=st[Ye].getBoundingClientRect();if($e<dt.top+dt.height/2){Ze=Ye;break}}ne.value=Ze}function ll(te){te.preventDefault(),yt(te.clientX,te.clientY),!ue&&(ue=requestAnimationFrame(()=>{ue=null,Ht(te.clientX,te.clientY)}))}function It(te){window.removeEventListener("pointermove",ll),window.removeEventListener("pointerup",It),window.removeEventListener("pointercancel",It),Me?.releasePointerCapture?.(te.pointerId),tl(Me),Me=null;const $e=z.value&&Et(te.clientX,te.clientY);if(f.value&&$e)_("delete",{item:f.value});else{const Oe=at(te.clientX,te.clientY)?.getAttribute("data-column")??null;if(f.value&&Oe){const st=f.value[B.columnKey],Ze=Oe,dt=(ie.value[Ze]||[]).filter(ee=>ee[B.itemKey]!==f.value[B.itemKey]),Le=Math.max(0,Math.min(ne.value,dt.length)),W=gt(Ze,Le),U=f.value[B.itemKey];_("move",{item:f.value,from:st,to:Ze,position:W,index:Le}),H&&clearTimeout(H),j.value={id:U,from:st,to:Ze},H=setTimeout(()=>{j.value=null},3500)}}ke&&(ke.remove(),ke=null),R!==null&&(document.body.style.cursor=R,R=""),Xt()}function ot(te,$e){te.preventDefault();const Ne=te.target.closest(".dss-dnd-item");if(!Ne)return;const Oe=Ne.getBoundingClientRect();ze=te.clientX-Oe.left,tt=te.clientY-Oe.top,R=document.body.style.cursor,document.body.style.cursor="grabbing",f.value=$e,Me=Ne,he(Ne,te.clientX,te.clientY),requestAnimationFrame(()=>qe(Ne)),Ne.setPointerCapture?.(te.pointerId),window.addEventListener("pointermove",ll),window.addEventListener("pointerup",It,{once:!0}),window.addEventListener("pointercancel",It,{once:!0})}function St(){ge&&(window.removeEventListener("pointermove",nl),window.removeEventListener("pointerup",Ft),window.removeEventListener("pointercancel",Ft),ge=null)}function nl(te){if(!ge||te.pointerId!==ge.pointerId)return;const $e=te.clientX-ge.startX,Ne=te.clientY-ge.startY;if(Math.abs($e)>=ve||Math.abs(Ne)>=ve){const Oe=ge.item;St(),ot(te,Oe)}}function Ft(te){!ge||te.pointerId!==ge.pointerId||St()}function Yt(te,$e){St(),ge={item:$e,startX:te.clientX,startY:te.clientY,pointerId:te.pointerId},window.addEventListener("pointermove",nl),window.addEventListener("pointerup",Ft),window.addEventListener("pointercancel",Ft)}function Ge(te,$e){X.value.useHandle||Yt(te,$e)}function Je(te,$e){Yt(te,$e)}function Lt(){ue&&(cancelAnimationFrame(ue),ue=null)}function Xt(){Lt(),f.value=null,be.value=null,fe.value=!1,ne.value=-1}return e.onBeforeUnmount(()=>{Lt(),St(),H&&clearTimeout(H),ke&&(ke.remove(),ke=null)}),(te,$e)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":X.value.unstyled}]),style:e.normalizeStyle(Ke.value)},[z.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":fe.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(te.$slots,"delete-zone",{isDragging:!!f.value,isOver:fe.value})],2),[[e.vShow,!!f.value||X.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.columns,Ne=>(e.openBlock(),e.createElementBlock("div",{key:Ne.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":be.value==Ne.value},Ne.class||""]]),style:e.normalizeStyle(pe(Ne))},[X.value.showHeader?(e.openBlock(),e.createElementBlock("div",F2,[e.renderSlot(te.$slots,"column-header",{column:Ne,items:ie.value[Ne.value]||[]},()=>[e.createElementVNode("span",z2,e.toDisplayString(Ne.title||Ne.value),1),e.createElementVNode("span",P2,e.toDisplayString((ie.value[Ne.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Ne.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value[Ne.value],Oe=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Oe.key},[Oe.type==="indicator"?(e.openBlock(),e.createElementBlock("div",W2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Oe.isDragged,"dss-dnd-item--no-handle":!X.value.useHandle}]),onPointerdown:st=>Ge(st,Oe.item)},[X.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(st=>Je(st,Oe.item),["stop"])},[e.renderSlot(te.$slots,"handle",{},()=>[$e[0]||($e[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,q2)):e.createCommentVNode("",!0),e.createElementVNode("div",U2,[e.renderSlot(te.$slots,"item",{item:Oe.item,column:Ne,justDropped:j.value?.id===Oe.item[L.itemKey],droppedFrom:j.value?.id===Oe.item[L.itemKey]?j.value.from:null,droppedTo:j.value?.id===Oe.item[L.itemKey]?j.value.to:null},()=>[e.createElementVNode("div",X2,e.toDisplayString(Oe.item[L.itemKey]),1)])])],42,Z2))],64))),128)),(ie.value[Ne.value]||[]).length===0&&be.value!=Ne.value?(e.openBlock(),e.createElementBlock("div",Y2,[e.renderSlot(te.$slots,"empty",{column:Ne},()=>[$e[1]||($e[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,O2)],6))),128))],6))}}),G2={name:"DSSConfetti"},Q2=Object.assign(G2,{props:{trigger:{type:Boolean,default:!1},duration:{type:Number,default:3e3},fadeStart:{type:Number,default:2e3},count:{type:Number,default:90},colors:{type:Array,default:()=>["#047395","#ffc230","#0897c1","#fe3b59","#11e1a2","#b3b2fb","#fadb8d","#ffa25b","#feaab1"]},delay:{type:Number,default:300}},setup(L){const ae=L,B=e.ref(null),_=e.ref(!1);let oe=[],z=null,$=null;function X(ne,j){const ue=[];for(let H=0;H<ae.count;H++)ue.push(Ke(ne));return ue}function Ke(ne,j){return{x:Math.random()*ne,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:ae.colors[Math.floor(Math.random()*ae.colors.length)],tilt:Math.floor(Math.random()*10)-10,tiltInc:Math.random()*.08+.04,tiltAngle:0,opacity:Math.random()*.7+.3,speed:Math.random()*4+1.5}}function pe(ne,j,ue,H){ne.clearRect(0,0,j,ue);for(const ke of oe)ne.save(),ne.globalAlpha=ke.opacity*H,ne.beginPath(),ne.lineWidth=ke.r,ne.strokeStyle=ke.color,ne.moveTo(ke.x+ke.tilt+ke.r/2,ke.y),ne.lineTo(ke.x+ke.tilt,ke.y+ke.tilt+ke.r/2),ne.stroke(),ne.restore()}function f(ne,j,ue){const H=.3+ue*.7;for(let ke=0;ke<oe.length;ke++){const Me=oe[ke];Me.tiltAngle+=Me.tiltInc,Me.y+=Me.speed*H,Me.x+=Math.sin(Me.d)*.5*H,Me.tilt=Math.sin(Me.tiltAngle)*15,ue>=.99&&Me.y>j+20&&(oe[ke]=Ke(ne))}}function be(){_.value=!0,e.nextTick(()=>{const ne=B.value;if(!ne)return;const j=ne.getContext("2d"),ue=ne.parentElement;if(!ue)return;const H=ue.getBoundingClientRect();ne.width=H.width,ne.height=H.height,oe=X(ne.width,ne.height);const ke=Date.now(),Me=ke+ae.duration,ze=()=>{const tt=Date.now(),R=tt-ke;if(tt<Me){let ge=1;R>ae.fadeStart&&(ge=1-(R-ae.fadeStart)/(ae.duration-ae.fadeStart)),pe(j,ne.width,ne.height,ge),f(ne.width,ne.height,ge),z=requestAnimationFrame(ze)}else fe()};ze()})}function fe(){z&&(cancelAnimationFrame(z),z=null),oe=[],_.value=!1}return e.watch(()=>ae.trigger,ne=>{ne&&($&&clearTimeout($),$=setTimeout(be,ae.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{fe(),$&&clearTimeout($)}),(ne,j)=>_.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:B,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),J2={class:"dss-filter-global-inner"},em=["placeholder","value"],tm=["title"],lm={key:0,class:"dss-filter-funnel-badge"},nm={key:1,class:"dss-filter-sortby"},om=["value"],am=["value"],sm=["disabled","title"],rm={key:0,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},im={key:1,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cm={key:2,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},um={class:"dss-filter-panel"},dm={key:0,class:"dss-filter-empty"},mm={class:"dss-filter-row-prefix"},pm={class:"dss-filter-cell"},fm=["onClick"],vm={class:"dss-filter-trigger-text"},gm=["placeholder"],hm={class:"dss-filter-popup-list"},ym=["onClick"],km={key:0,class:"dss-filter-popup-empty"},Cm={key:0,class:"dss-filter-cell"},bm=["onClick"],wm={class:"dss-filter-trigger-text"},xm={class:"dss-filter-popup-list"},Em=["onClick"],Sm={key:1,class:"dss-filter-cell dss-filter-cell--value"},Vm=["placeholder","onUpdate:modelValue"],Nm={key:1,class:"dss-filter-date-wrap"},Bm=["placeholder","onUpdate:modelValue"],Mm=["placeholder","value","onInput","step"],_m={key:4,class:"dss-filter-between"},$m=["placeholder","value","onInput","step"],Lm={class:"dss-filter-between-sep"},Tm=["placeholder","value","onInput","step"],Am={key:5,class:"dss-filter-multiselect"},Dm=["onClick"],Hm={class:"dss-filter-trigger-text"},Rm=["placeholder"],Im={class:"dss-filter-popup-list dss-filter-popup-list--check"},Fm=["onClick"],zm=["checked"],Pm={key:0,class:"dss-filter-popup-empty"},Om=["onClick"],Wm={class:"dss-filter-foot"},Zm={class:"dss-filter-cell"},qm=["placeholder"],Um={class:"dss-filter-popup-list"},Xm=["onClick"],Ym={key:0,class:"dss-filter-popup-divider"},jm=["onClick"],Km=["placeholder"],Gm={class:"dss-filter-popup-list"},Qm=["onClick"],Jm={key:0,class:"dss-filter-popup-empty"},e0=["placeholder"],t0={class:"dss-filter-popup-list"},l0=["onClick"],n0={key:0,class:"dss-filter-popup-empty"},o0={name:"DSSFilter"},a0=Object.assign(o0,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},showSortBy:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(L,{expose:ae,emit:B}){const{t:_}=Gn.useI18n(),oe=L,z=B,$={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},X=e.computed(()=>({...$,...oe.options})),Ke={text:[{value:"contains"},{value:"not_contains"},{value:"equals"},{value:"not_equals"},{value:"starts_with"},{value:"ends_with"},{value:"is_empty"},{value:"is_not_empty"}],select:[{value:"is_any_of"},{value:"is_none_of"},{value:"is_empty"},{value:"is_not_empty"}],range:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],int:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],arraySelect:[{value:"contains_any"},{value:"contains_all"},{value:"not_contains_any"},{value:"is_empty"},{value:"is_not_empty"}],arrayText:[{value:"contains"},{value:"not_contains"},{value:"is_empty"},{value:"is_not_empty"}],date:[{value:"eq"},{value:"before"},{value:"after"},{value:"is_empty"},{value:"is_not_empty"}],boolean:[{value:"is_true"},{value:"is_false"},{value:"is_empty"},{value:"is_not_empty"}]},pe=new Set(["is_empty","is_not_empty","is_true","is_false"]),f=["label","name","title","keyword","full_name","value","text"],be=e.ref(""),fe=e.ref([]),ne=e.ref(null),j=e.ref(!1),ue=e.ref(null),H=e.ref(""),ke=e.ref(null),Me=e.ref(""),ze=e.ref("asc");let tt=1;function R(V){const C=V.find(S=>S&&typeof S=="object");if(!C)return null;for(const S of f)if(S in C&&typeof C[S]=="string")return S;return Object.keys(C).find(S=>typeof C[S]=="string")||null}function ge(V,C){const S=C.filter(K=>K!=null&&K!=="NULL");if(S.length===0)return null;if(S.every(K=>Array.isArray(K))){const K=S.flatMap(Ue=>Ue).filter(Ue=>Ue!=null);return K.length===0?null:typeof K.find(Ue=>Ue!=null)=="object"?"arraySelect":"arrayText"}return S.every(K=>typeof K=="boolean")?"boolean":S.every(K=>typeof K=="number")?new Set(S).size<=X.value.maxUniqueForEnum?"select":"range":S.every(K=>typeof K=="string")?new Set(S).size<=X.value.maxUniqueForSelect?"select":"text":S.some(K=>typeof K=="object"&&!Array.isArray(K))?null:"text"}const ve=e.computed(()=>{if(!oe.data?.length)return[];const V=new Set;for(const Q of oe.data)if(Q&&typeof Q=="object")for(const Ue of Object.keys(Q))V.add(Ue);const C=new Set(oe.exclude),S=[];for(const Q of V){if(C.has(Q))continue;const Ue=oe.config[Q]||{},mt=oe.data.map(Qe=>Qe?.[Q]),Ee=Ue.type||ge(Q,mt);if(!Ee)continue;const Ve=Ue.filterMode||"contain",Tt=Ve==="date"?"date":Ve==="string"?"text":Ee,Dt={key:Q,label:Ue.label||Wt(Q),type:Tt,filterMode:Ve};if(Ee==="select"){const Qe=mt.filter(pt=>pt!=null&&pt!=="NULL");Dt.uniqueValues=[...new Set(Qe)].sort((pt,wt)=>typeof pt=="number"&&typeof wt=="number"?pt-wt:String(pt).localeCompare(String(wt)))}else if(Ee==="range"||Ee==="int"){const Qe=mt.filter(pt=>typeof pt=="number");Dt.min=Math.min(...Qe),Dt.max=Math.max(...Qe)}else if(Ee==="arraySelect"){const Qe=Ue.displayKey||R(mt.flatMap(wt=>Array.isArray(wt)?wt:[]));Dt.displayKey=Qe;const pt=mt.flatMap(wt=>Array.isArray(wt)?wt:[]).filter(wt=>wt!=null).map(wt=>Qe&&typeof wt=="object"?wt[Qe]:String(wt)).filter(wt=>wt!=null&&wt!=="");Dt.uniqueValues=[...new Set(pt)].sort((wt,gl)=>String(wt).localeCompare(String(gl)))}S.push(Dt)}const K=oe.config._order;return K&&S.sort((Q,Ue)=>{const mt=K.indexOf(Q.key),Ee=K.indexOf(Ue.key);return mt===-1&&Ee===-1?0:mt===-1?1:Ee===-1?-1:mt-Ee}),S}),ie=e.computed(()=>{const V={};for(const C of ve.value)V[C.key]=C;return V}),lt=e.computed(()=>Array.isArray(oe.config.groups)&&oe.config.groups.length>0),gt=e.computed(()=>{if(!lt.value)return[];const V=new Set(ve.value.map(C=>C.key));return oe.config.groups.map(C=>({...C,keys:C.keys.filter(S=>V.has(S))})).filter(C=>C.keys.length>0)}),he=e.computed(()=>{if(!lt.value)return[];const V=new Set(oe.config.groups.flatMap(C=>C.keys));return ve.value.filter(C=>!V.has(C.key))}),yt=e.computed(()=>{if(!ke.value)return[];const V=new Set(ke.value.keys),C=ve.value.filter(K=>V.has(K.key));if(!H.value)return C;const S=H.value.toLowerCase();return C.filter(K=>K.label.toLowerCase().includes(S))}),qe=e.computed(()=>{if(!H.value)return ve.value;const V=H.value.toLowerCase();return ve.value.filter(C=>C.label.toLowerCase().includes(V))}),tl=e.computed(()=>ve.value.filter(V=>!["arraySelect","arrayText"].includes(V.type))),at=e.computed(()=>Me.value?ze.value==="asc"?"Ascending":"Descending":"No sort selected");function Et(V){ne.value===V?Ht():(ne.value=V,H.value="",ke.value=null)}function Ht(){ne.value=null,H.value="",ke.value=null}function ll(V){const C=V.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");ne.value&&!C&&!V.target.closest(".dss-filter-popup")&&!V.target.closest(".dss-filter-trigger")&&!V.target.closest(".dss-filter-add-btn")&&Ht(),j.value&&ue.value&&!ue.value.contains(V.target)&&(C||(j.value=!1))}e.onMounted(()=>document.addEventListener("click",ll)),e.onBeforeUnmount(()=>document.removeEventListener("click",ll));function It(V){return ie.value[V]?.label||Wt(V)}function ot(V){return ie.value[V.key]?.filterMode||"contain"}function St(V){return _(`filter.operators.${V}`)}function nl(V){const C=ie.value[V.key];return(Ke[C?.type]||Ke.text).map(S=>({...S,label:_(`filter.operators.${S.value}`)}))}function Ft(V){return pe.has(V)}function Yt(V){const C=ie.value[V.key];return C?C.type==="date"?"date":C.type==="boolean"?"boolean":C.type==="text"||C.type==="arrayText"?"text":C.type==="select"||C.type==="arraySelect"?"multiselect":C.type==="range"||C.type==="int"?V.operator==="between"?"between":"number":"text":"text"}function Ge(V){return Ke[V]?.[0]?.value||"contains"}function Je(V,C){return pe.has(C)||V==="date"?null:V==="select"||V==="arraySelect"?[]:(V==="range"||V==="int")&&C==="between"?{min:null,max:null}:V==="range"||V==="int"?null:""}function Lt(V){return ie.value[V.key]?.uniqueValues||[]}function Xt(V){const C=Lt(V);if(!H.value)return C;const S=H.value.toLowerCase();return C.filter(K=>String(K).toLowerCase().includes(S))}function te(V){const C=V.value;return!C||C.length===0?_("filter.select"):C.length<=2?C.join(", "):_("filter.selectedCount",{count:C.length})}function $e(V){const C=ie.value[V],S=C?.filterMode||"contain",K=C?.type||"text",Q=S==="string"?"contains":Ge(K);fe.value.push(e.reactive({id:tt++,key:V,operator:Q,value:Je(K,Q)})),Ht()}function Ne(V){fe.value=fe.value.filter(C=>C.id!==V)}function Oe(V,C){const K=ie.value[C]?.type||"text";V.key=C,V.operator=Ge(K),V.value=Je(K,V.operator),Ht()}function st(V,C){const S=Yt(V);V.operator=C;const K=Yt(V);if(S!==K||pe.has(C)){const Q=ie.value[V.key];V.value=Je(Q?.type||"text",C)}Ht()}function Ze(V,C){const S=C.target.value;V.value=S===""?null:Number(S)}function Ye(V,C,S){const K=S.target.value,Q=K===""?null:Number(K);(!V.value||typeof V.value!="object")&&(V.value={min:null,max:null}),V.value={...V.value,[C]:isNaN(Q)?null:Q}}function dt(V,C){const S=V.value||[],K=S.indexOf(C);V.value=K>=0?S.filter(Q=>Q!==C):[...S,C]}function Le(){fe.value=[],be.value="",Ht()}function W(V){be.value=V.target.value}function U(V){Me.value=V.target.value}function ee(){ze.value=ze.value==="asc"?"desc":"asc"}const se=e.computed(()=>{if(!oe.data)return[];let V=oe.data;if(be.value){const C=be.value.toLowerCase();V=V.filter(S=>{for(const K of Object.keys(S)){const Q=S[K];if(typeof Q=="string"&&Q.toLowerCase().includes(C)||typeof Q=="number"&&String(Q).includes(C)||Array.isArray(Q)&&Q.some(Ue=>Ue!=null&&(typeof Ue=="string"?Ue.toLowerCase().includes(C):typeof Ue=="object"?Object.values(Ue).some(mt=>typeof mt=="string"&&mt.toLowerCase().includes(C)):!1)))return!0}return!1})}for(const C of fe.value){if(!bt(C))continue;const S=ie.value[C.key];S&&(V=V.filter(K=>Re(K,C,S)))}if(oe.showSortBy&&Me.value){const C=Me.value,S=ze.value==="asc"?1:-1;V=[...V].sort((K,Q)=>He(K?.[C],Q?.[C])*S)}return V});function He(V,C){const S=rt(V),K=rt(C);return S==null&&K==null?0:S==null?1:K==null?-1:typeof S=="number"&&typeof K=="number"?S-K:String(S).localeCompare(String(K),void 0,{numeric:!0,sensitivity:"base"})}function rt(V){return V==null||V==="NULL"?null:typeof V=="string"||typeof V=="number"||typeof V=="boolean"?V:V instanceof Date?V.getTime():null}function bt(V){return pe.has(V.operator)?!0:V.value==null||typeof V.value=="string"&&V.value===""||Array.isArray(V.value)&&V.value.length===0?!1:V.value instanceof Date?!isNaN(V.value.getTime()):!(typeof V.value=="object"&&!Array.isArray(V.value)&&V.value.min==null&&V.value.max==null)}function Re(V,C,S){const K=V?.[C.key],Q=C.value,Ue=C.operator;if(Ue==="is_empty")return jt(K);if(Ue==="is_not_empty")return!jt(K);const mt=S.type;if(mt==="text"||mt==="arrayText"){const Ee=mt==="arrayText"&&Array.isArray(K)?K.filter(Dt=>Dt!=null).map(String).join(" "):K!=null?String(K):"",Ve=String(Q).toLowerCase(),Tt=Ee.toLowerCase();switch(Ue){case"contains":return Tt.includes(Ve);case"not_contains":return!Tt.includes(Ve);case"equals":return Tt===Ve;case"not_equals":return Tt!==Ve;case"starts_with":return Tt.startsWith(Ve);case"ends_with":return Tt.endsWith(Ve);default:return!0}}if(mt==="select")switch(Ue){case"is_any_of":return Q.includes(K);case"is_none_of":return!Q.includes(K);default:return!0}if(mt==="range"||mt==="int"){const Ee=typeof K=="number"?K:Number(K);if(typeof Ee!="number"||isNaN(Ee))return!1;if(Ue==="between"){const Tt=Q?.min!=null?Number(Q.min):null,Dt=Q?.max!=null?Number(Q.max):null,Qe=Tt!=null&&!isNaN(Tt)?Tt:null,pt=Dt!=null&&!isNaN(Dt)?Dt:null;return(Qe==null||Ee>=Qe)&&(pt==null||Ee<=pt)}const Ve=typeof Q=="number"&&!isNaN(Q)?Q:Number(Q);if(Ue==="contains"||Ue==="not_contains"){const Tt=String(Ee),Dt=String(Q??"").toLowerCase(),Qe=Tt.toLowerCase().includes(Dt);return Ue==="contains"?Qe:!Qe}if(typeof Ve!="number"||isNaN(Ve))return!1;switch(Ue){case"eq":return Ee===Ve;case"neq":return Ee!==Ve;case"gt":return Ee>Ve;case"gte":return Ee>=Ve;case"lt":return Ee<Ve;case"lte":return Ee<=Ve;default:return!0}}if(mt==="arraySelect"){if(!Array.isArray(K))return!1;const Ee=K.filter(Ve=>Ve!=null).map(Ve=>S.displayKey&&typeof Ve=="object"?Ve[S.displayKey]:String(Ve));switch(Ue){case"contains_any":return Ee.some(Ve=>Q.includes(Ve));case"contains_all":return Q.every(Ve=>Ee.includes(Ve));case"not_contains_any":return!Ee.some(Ve=>Q.includes(Ve));default:return!0}}if(mt==="date"){const Ee=ht(Q);if(!Ee||isNaN(Ee.getTime()))return!1;const Ve=ht(K);if(!Ve||isNaN(Ve.getTime()))return!1;const Tt=Rt(Ve),Dt=Rt(Ee);switch(Ue){case"eq":return Tt===Dt;case"before":return Tt<Dt;case"after":return Tt>Dt;default:return!0}}if(mt==="boolean"){const Ee=K===!0||K==="true"||K===1,Ve=K===!1||K==="false"||K===0;switch(Ue){case"is_true":return Ee;case"is_false":return Ve;default:return!0}}return!0}function ht(V){if(V==null)return null;if(V instanceof Date)return isNaN(V.getTime())?null:V;if(typeof V=="number")return new Date(V>1e10?V:V*1e3);if(typeof V=="string"){const C=new Date(V);return isNaN(C.getTime())?null:C}return null}function Rt(V){const C=V.getFullYear(),S=String(V.getMonth()+1).padStart(2,"0"),K=String(V.getDate()).padStart(2,"0");return`${C}-${S}-${K}`}function jt(V){return!!(V==null||V===""||V==="NULL"||Array.isArray(V)&&V.length===0||Array.isArray(V)&&V.every(C=>C==null))}e.watch(se,V=>z("update:modelValue",V),{immediate:!0}),e.watch(()=>oe.data,()=>{fe.value=[],be.value="",j.value=!1,Me.value="",ze.value="asc",Ht()});function Wt(V){return V.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,C=>C.toUpperCase())}function At(){const V=C=>{if(C==null)return C;if(C instanceof Date)return{_type:"Date",value:C.toISOString(),local:C.toLocaleDateString()};if(Array.isArray(C))return C.map(V);if(typeof C=="object"&&!Array.isArray(C)){const S={};for(const K of Object.keys(C))S[K]=V(C[K]);return S}return C};return{globalSearch:be.value,rows:fe.value.map(C=>({key:C.key,operator:C.operator,value:V(C.value),defType:ie.value[C.key]?.type,defFilterMode:ie.value[C.key]?.filterMode})),filteredCount:se.value?.length??0}}return ae({getDebugState:At}),(V,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":X.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:ue},[e.createElementVNode("div",J2,[C[20]||(C[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref(_)("filter.searchAcrossFields"),value:be.value,onInput:W},null,40,em),be.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:C[0]||(C[0]=S=>be.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:j.value||fe.value.length>0,"dss-filter-funnel-btn--with-sort":oe.showSortBy}]),onClick:C[1]||(C[1]=S=>j.value=!j.value),type:"button",title:j.value?e.unref(_)("filter.closeAdvancedFilter"):e.unref(_)("filter.openAdvancedFilter")},[C[14]||(C[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),fe.value.length>0?(e.openBlock(),e.createElementBlock("span",lm,e.toDisplayString(fe.value.length),1)):e.createCommentVNode("",!0)],10,tm),oe.showSortBy?(e.openBlock(),e.createElementBlock("div",nm,[C[19]||(C[19]=e.createElementVNode("label",{class:"dss-filter-sortby-label",for:"dss-filter-sort-select"},"Sort by",-1)),e.createElementVNode("select",{id:"dss-filter-sort-select",class:"dss-filter-sortby-select",value:Me.value,onChange:U},[C[15]||(C[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tl.value,S=>(e.openBlock(),e.createElementBlock("option",{key:S.key,value:S.key},e.toDisplayString(S.label),9,am))),128))],40,om),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:ee,disabled:!Me.value,title:at.value},[Me.value?ze.value==="asc"?(e.openBlock(),e.createElementBlock("svg",im,[...C[17]||(C[17]=[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",cm,[...C[18]||(C[18]=[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",rm,[...C[16]||(C[16]=[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"currentColor"},null,-1)])]))],8,sm)])):e.createCommentVNode("",!0)]),j.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:C[13]||(C[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",um,[fe.value.length===0?(e.openBlock(),e.createElementBlock("div",dm,e.toDisplayString(e.unref(_)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(S,K)=>(e.openBlock(),e.createElementBlock("div",{key:S.id,class:"dss-filter-row"},[e.createElementVNode("span",mm,e.toDisplayString(K===0?e.unref(_)("filter.where"):e.unref(_)("filter.and")),1),e.createElementVNode("div",pm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(Q=>Et(`${S.id}:field`),["stop"])},[e.createElementVNode("span",vm,e.toDisplayString(It(S.key)),1),C[21]||(C[21]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,fm),ne.value===`${S.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[3]||(C[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[2]||(C[2]=Q=>H.value=Q),placeholder:e.unref(_)("filter.searchAttributes")},null,8,gm),[[e.vModelText,H.value]]),e.createElementVNode("ul",hm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value,Q=>(e.openBlock(),e.createElementBlock("li",{key:Q.key,class:"dss-filter-popup-item",onClick:Ue=>Oe(S,Q.key)},e.toDisplayString(Q.label),9,ym))),128)),qe.value.length===0?(e.openBlock(),e.createElementBlock("li",km,e.toDisplayString(e.unref(_)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),ot(S)==="contain"||ot(S)==="date"?(e.openBlock(),e.createElementBlock("div",Cm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(Q=>Et(`${S.id}:op`),["stop"])},[e.createElementVNode("span",wm,e.toDisplayString(St(S.operator)),1),C[22]||(C[22]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,bm),ne.value===`${S.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[4]||(C[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",xm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nl(S),Q=>(e.openBlock(),e.createElementBlock("li",{key:Q.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:S.operator===Q.value}]),onClick:Ue=>st(S,Q.value)},e.toDisplayString(Q.label),11,Em))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ft(S.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Sm,[ot(S)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(_)("filter.enterValue"),"onUpdate:modelValue":Q=>S.value=Q},null,8,Vm)),[[e.vModelText,S.value]]):ot(S)==="date"?(e.openBlock(),e.createElementBlock("div",Nm,[e.createVNode(Wo,{mode:"single",modelValue:S.value,"onUpdate:modelValue":Q=>S.value=Q},null,8,["modelValue","onUpdate:modelValue"])])):Yt(S)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(_)("filter.enterValue"),"onUpdate:modelValue":Q=>S.value=Q},null,8,Bm)),[[e.vModelText,S.value]]):Yt(S)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(_)("filter.enterValue"),value:S.value,onInput:Q=>Ze(S,Q),step:ie.value[S.key]?.type==="int"?1:void 0},null,40,Mm)):Yt(S)==="between"?(e.openBlock(),e.createElementBlock("div",_m,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(_)("filter.min"),value:S.value?.min,onInput:Q=>Ye(S,"min",Q),step:ie.value[S.key]?.type==="int"?1:void 0},null,40,$m),e.createElementVNode("span",Lm,e.toDisplayString(e.unref(_)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(_)("filter.max"),value:S.value?.max,onInput:Q=>Ye(S,"max",Q),step:ie.value[S.key]?.type==="int"?1:void 0},null,40,Tm)])):Yt(S)==="multiselect"?(e.openBlock(),e.createElementBlock("div",Am,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(Q=>Et(`${S.id}:val`),["stop"])},[e.createElementVNode("span",Hm,e.toDisplayString(te(S)),1),C[23]||(C[23]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,Dm),ne.value===`${S.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[6]||(C[6]=e.withModifiers(()=>{},["stop"]))},[Lt(S).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[5]||(C[5]=Q=>H.value=Q),placeholder:e.unref(_)("filter.search")},null,8,Rm)),[[e.vModelText,H.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",Im,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xt(S),Q=>(e.openBlock(),e.createElementBlock("li",{key:Q,class:"dss-filter-popup-item",onClick:Ue=>dt(S,Q)},[e.createElementVNode("input",{type:"checkbox",checked:(S.value||[]).includes(Q),tabindex:"-1"},null,8,zm),e.createElementVNode("span",null,e.toDisplayString(Q),1)],8,Fm))),128)),Xt(S).length===0?(e.openBlock(),e.createElementBlock("li",Pm,e.toDisplayString(e.unref(_)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:Q=>Ne(S.id)},[...C[24]||(C[24]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,Om)]))),128)),e.createElementVNode("div",Wm,[e.createElementVNode("div",Zm,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:C[7]||(C[7]=e.withModifiers(S=>Et("add"),["stop"]))},e.toDisplayString(e.unref(_)("filter.addFilter")),1),ne.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:C[12]||(C[12]=e.withModifiers(()=>{},["stop"]))},[lt.value&&!ke.value&&!H.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[8]||(C[8]=S=>H.value=S),placeholder:e.unref(_)("filter.searchAttributes")},null,8,qm),[[e.vModelText,H.value]]),e.createElementVNode("ul",Um,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:K=>ke.value=S},[e.createElementVNode("span",null,e.toDisplayString(S.label),1),C[25]||(C[25]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,Xm))),128)),he.value.length>0?(e.openBlock(),e.createElementBlock("li",Ym)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:K=>$e(S.key)},e.toDisplayString(S.label),9,jm))),128))])],64)):ke.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:C[9]||(C[9]=S=>ke.value=null)},[C[26]||(C[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(ke.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[10]||(C[10]=S=>H.value=S),placeholder:e.unref(_)("filter.searchAttributes")},null,8,Km),[[e.vModelText,H.value]]),e.createElementVNode("ul",Gm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yt.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:K=>$e(S.key)},e.toDisplayString(S.label),9,Qm))),128)),yt.value.length===0?(e.openBlock(),e.createElementBlock("li",Jm,e.toDisplayString(e.unref(_)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[11]||(C[11]=S=>H.value=S),placeholder:e.unref(_)("filter.searchAttributes")},null,8,e0),[[e.vModelText,H.value]]),e.createElementVNode("ul",t0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:K=>$e(S.key)},e.toDisplayString(S.label),9,l0))),128)),qe.value.length===0?(e.openBlock(),e.createElementBlock("li",n0,e.toDisplayString(e.unref(_)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),fe.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:Le},e.toDisplayString(e.unref(_)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),s0={class:"dss-pill-field__pills"},r0=["disabled"],i0={class:"dss-pill-field__pill-text"},c0={key:0,class:"dss-pill-field__pill-actions"},u0=["onClick"],d0=["onClick"],m0=["placeholder","disabled"],p0=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(L,{emit:ae}){const B=L,_=ae,oe=e.ref(""),z=e.ref([...B.modelValue]),$=e.ref(null);let X=null;const Ke=e.ref(null),pe=e.ref(""),f=e.ref(null),be=e.computed(()=>new Set(z.value.map(R=>R.trim()).filter(Boolean)));function fe(R){$.value=R,X&&clearTimeout(X),X=setTimeout(()=>{$.value=null,X=null},900)}function ne(R){const ge=R.trim();return ge?be.value.has(ge)?(fe(ge),!1):(z.value=[...z.value,ge],_("update:modelValue",[...z.value]),!0):!1}function j(R){const ge=R.split(/\r?\n/g).map(gt=>gt.trim()).filter(Boolean);if(!ge.length)return;const ve=new Set(z.value.map(gt=>gt.trim()).filter(Boolean)),ie=[...z.value];let lt=null;for(const gt of ge){if(ve.has(gt)){lt??=gt;continue}ve.add(gt),ie.push(gt)}ie.length!==z.value.length&&(z.value=ie,_("update:modelValue",[...z.value])),lt&&fe(lt)}function ue(R){B.disabled||(Ke.value===R&&(Ke.value=null,pe.value=""),z.value=z.value.filter((ge,ve)=>ve!==R),_("update:modelValue",[...z.value]))}async function H(R){B.disabled||(Ke.value=R,pe.value=z.value[R]??"",await e.nextTick(),f.value?.focus(),f.value?.select())}function ke(){Ke.value=null,pe.value=""}function Me(){if(B.disabled||Ke.value===null)return;const R=Ke.value,ge=z.value[R]??"",ve=pe.value.trim();if(Ke.value=null,pe.value="",ve!==ge&&be.value.has(ve)){fe(ve);return}if(!ve){z.value=z.value.filter((lt,gt)=>gt!==R),_("update:modelValue",[...z.value]);return}const ie=z.value.map((lt,gt)=>gt===R?ve:lt);z.value=ie,_("update:modelValue",[...z.value])}function ze(R){R.preventDefault(),!B.disabled&&(ne(oe.value),oe.value="")}function tt(R){if(B.disabled)return;const ge=R.clipboardData?.getData("text")??"";!ge.includes(`
118
- `)&&!ge.includes("\r")||(R.preventDefault(),j(ge),oe.value="")}return e.watch(()=>B.modelValue,R=>{z.value=Array.isArray(R)?[...R]:[]},{deep:!0}),e.onBeforeUnmount(()=>{X&&clearTimeout(X)}),(R,ge)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":R.disabled}])},[e.createElementVNode("div",s0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,(ve,ie)=>(e.openBlock(),e.createElementBlock("span",{key:ve,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":$.value===ve}])},[Ke.value===ie?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_for:!0,ref_key:"editInputEl",ref:f,"onUpdate:modelValue":ge[0]||(ge[0]=lt=>pe.value=lt),class:"dss-pill-field__pill-edit",type:"text",disabled:R.disabled,onKeydown:[e.withKeys(Me,["enter"]),e.withKeys(ke,["esc"])],onBlur:Me},null,40,r0)),[[e.vModelText,pe.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",i0,e.toDisplayString(ve),1),R.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",c0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:lt=>H(ie)},[...ge[2]||(ge[2]=[e.createElementVNode("svg",{class:"dss-pill-field__pill-action-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})],-1)])],8,u0),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:lt=>ue(ie)}," × ",8,d0)]))],64))],2))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":ge[1]||(ge[1]=ve=>oe.value=ve),class:"dss-pill-field__input",type:"text",placeholder:z.value.length?"":R.placeholder,disabled:R.disabled,onPaste:tt,onKeydown:e.withKeys(ze,["enter"])},null,40,m0),[[e.vModelText,oe.value]])])],2))}}),f0={class:"dss-step-bar__header"},v0={class:"dss-step-bar__label"},g0={class:"dss-step-bar__counter"},h0={class:"dss-step-bar__track-wrapper"},y0=["aria-valuemax","aria-valuenow","aria-label"],k0=["onMouseenter"],C0={__name:"DSSStepBar",props:{label:{type:String,default:"Progress"},steps:{type:Number,default:5},currentStep:{type:Number,default:0},segments:{type:Array,default:()=>[]},totalValue:{type:Number,default:null},activeColor:{type:String,default:"#34c759"},labelColor:{type:String,default:null},counterColor:{type:String,default:null},inactiveColor:{type:String,default:"#e5e7eb"},remainderLabel:{type:String,default:"Unused"}},setup(L){const ae=L,B=e.computed(()=>Math.max(1,Number(ae.steps)||1)),_=e.computed(()=>Math.min(B.value,Math.max(0,Number(ae.currentStep)||0))),oe=e.computed(()=>Array.isArray(ae.segments)&&ae.segments.length>0),z=e.computed(()=>oe.value?ae.segments.map((ge,ve)=>{const ie=Number(ge?.value);return{label:ge?.label||`Step ${ve+1}`,value:Number.isFinite(ie)&&ie>0?ie:0,color:ge?.color||ae.activeColor}}):[]),$=e.computed(()=>oe.value?z.value.reduce((ge,ve)=>ge+ve.value,0):_.value),X=e.computed(()=>oe.value?Number.isFinite(Number(ae.totalValue))&&Number(ae.totalValue)>0?Number(ae.totalValue):Math.max(1,$.value):B.value),Ke=e.computed(()=>oe.value&&Number.isFinite(Number(ae.totalValue))&&Number(ae.totalValue)>0),pe=e.computed(()=>Ke.value?Math.max(0,Number(ae.totalValue)-$.value):0),f=e.computed(()=>oe.value?Ke.value?z.value.filter(ge=>ge.value>0):z.value:[]),be=e.computed(()=>`${$.value} / ${X.value}`),fe=e.computed(()=>$.value),ne=e.computed(()=>X.value),j=e.reactive({visible:!1,x:0,content:""}),ue=e.computed(()=>({left:`${j.x}px`})),H=ge=>{if(Ke.value){const lt=Math.max(0,Number(ge.value)||0);return{flex:`${lt} 0 0`,minWidth:lt>0?"6px":"0",backgroundColor:ge.color}}const ve=$.value;return{flex:`${ge.value>0?ge.value:ve>0?1e-4:1} 0 0`,minWidth:"6px",backgroundColor:ge.color}},ke=e.computed(()=>({flex:`${pe.value} 0 0`,minWidth:pe.value>0?"6px":"0",backgroundColor:ae.inactiveColor})),Me=(ge,ve)=>{if(!ge||!ve?.currentTarget)return;const ie=ve.currentTarget;j.x=ie.offsetLeft+ie.offsetWidth/2,j.content=`${ge.label}: ${ge.value}`,j.visible=!0},ze=ge=>{if(!pe.value||!ge?.currentTarget)return;const ve=ge.currentTarget;j.x=ve.offsetLeft+ve.offsetWidth/2,j.content=`${ae.remainderLabel}: ${pe.value}`,j.visible=!0},tt=()=>{j.visible=!1},R=e.computed(()=>({"--dss-step-bar-label-color":ae.labelColor??void 0,"--dss-step-bar-counter-color":ae.counterColor??void 0,"--dss-step-bar-active-color":ae.activeColor,"--dss-step-bar-inactive-color":ae.inactiveColor}));return(ge,ve)=>(e.openBlock(),e.createElementBlock("div",{class:"dss-step-bar",style:e.normalizeStyle(R.value)},[e.createElementVNode("div",f0,[e.createElementVNode("span",v0,e.toDisplayString(L.label),1),e.createElementVNode("span",g0,e.toDisplayString(be.value),1)]),e.createElementVNode("div",h0,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":ne.value,"aria-valuenow":fe.value,"aria-label":L.label},[oe.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(ie,lt)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${lt}-${ie.label}`,class:"dss-step-bar__segment dss-step-bar__segment--interactive",style:e.normalizeStyle(H(ie)),onMouseenter:gt=>Me(ie,gt),onMouseleave:tt},null,44,k0))),128)),pe.value>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(ke.value),onMouseenter:ve[0]||(ve[0]=ie=>ze(ie)),onMouseleave:tt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(B.value,ie=>(e.openBlock(),e.createElementBlock("div",{key:ie,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":ie<=_.value}])},null,2))),128))],8,y0),j.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip",style:e.normalizeStyle(ue.value)},e.toDisplayString(j.content),5)):e.createCommentVNode("",!0)])],4))}},b0={contextMenu:{addMarker:"Add Marker",clearAllMarkers:"Clear All Markers",downloadSvg:"Download SVG",downloadPng:"Download PNG",downloadCsv:"Download CSV"},modalMarker:{editMarker:"Edit Marker",viewMarker:"View Marker",title:"Title",description:"Description",iconType:"Icon Type",defaultIcon:"Default Logo",iconPreview:"Icon Preview",deleteMarker:"Delete Marker",cancel:"Cancel",close:"Close",save:"Save",placeholderTitle:"Enter marker title",placeholderDescription:"Enter marker description (required)"},zoom:{doubleClickToReset:"(Double-click to reset)"},csv:{chartTitle:"Chart Title",chartSubtitle:"Chart Subtitle",generated:"Generated"},fallback:{item:"Item",axis:"Axis"},tooltip:{flags:"Flags",markers:"Markers",manualFlags:"Manual Flags",autoFlags:"Auto Flags"}},w0={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",currentPageAriaLabel:"Current page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",searchAriaLabel:"Search",searchTableAriaLabel:"Search table",clearSearchAriaLabel:"Clear search",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",expandRowAriaLabel:"Expand row",collapseRowAriaLabel:"Collapse row",filterColumnAriaLabel:"Filter column",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy",showingRange:"Showing {start}-{end} from {total}",ofPages:"of {total}",emptyMessage:"No data available"},x0={searchAcrossFields:"Search across all fields...",openAdvancedFilter:"Open advanced filter",closeAdvancedFilter:"Close advanced filter",noConditionsApplied:"No filter conditions are applied to this view",where:"Where",and:"And",searchAttributes:"Search attributes...",noMatch:"No match",enterValue:"Enter value...",min:"Min",max:"Max",search:"Search...",addFilter:"Add filter",clearAllFilters:"Clear all filters",select:"Select...",selectedCount:"{count} selected",operators:{contains:"contains",not_contains:"does not contain",equals:"equals",not_equals:"does not equal",starts_with:"starts with",ends_with:"ends with",is_empty:"is empty",is_not_empty:"is not empty",is_any_of:"is any of",is_none_of:"is none of",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"between",contains_any:"contains any of",contains_all:"contains all of",not_contains_any:"does not contain",before:"before",after:"after",is_true:"is true",is_false:"is false"}},E0={selectDate:"Select Date",selectRange:"Select range",startDate:"Start date",endDate:"End date",prevMonth:"Previous month",nextMonth:"Next month",quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",last3Months:"Last 3 months",last6Months:"Last 6 months",last12Months:"Last 12 months",lastYear:"Last year",allDates:"All dates",last2Dates:"Last 2 dates",last3Dates:"Last 3 dates",last4Dates:"Last 4 dates",last5Dates:"Last 5 dates"}},S0={toolbar:{undo:"Undo",redo:"Redo",paragraphFormat:"Paragraph Format",bold:"Bold",italic:"Italic",underline:"Underline",citation:"Citation",insertLink:"Insert Link",removeLink:"Remove Link",bulletList:"Bullet List",numberList:"Number List",image:"Image",comment:"Comment",askAi:"Ask AI"},paragraph:{heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",paragraph:"Paragraph"},link:{editLink:"Edit Link",altText:"Alt text:",url:"URL:",enterAltText:"Enter alt text...",enterUrl:"Enter URL...",cancel:"Cancel",save:"Save"},image:{addImage:"Add Image",editImage:"Edit Image",upload:"Upload",imageLink:"Image Link",uploadImage:"Upload image:",imageUrl:"Image URL:",altText:"Alt text:",width:"Width (px):",height:"Height (px):",enterAltText:"Enter alt text...",enterImageUrl:"https://example.com/image.jpg",auto:"Auto",noAlt:"No alt",cancel:"Cancel",save:"Save"},comment:{placeholder:"Add a comment",send:"Send",delete:"Delete comment"},started_conversation:"Started conversation",labels:{title:"Title",description:"Description"},placeholders:{title:"Enter title...",description:"Enter description...",startTyping:"Start typing..."},footer:{word:"word",words:"words",character:"character",characters:"characters"}},Qn={chart:b0,table:w0,filter:x0,datepicker:E0,textEditor:S0},V0={contextMenu:{addMarker:"Ajouter un marqueur",clearAllMarkers:"Effacer tous les marqueurs",downloadSvg:"Télécharger SVG",downloadPng:"Télécharger PNG",downloadCsv:"Télécharger CSV"},modalMarker:{editMarker:"Modifier le marqueur",viewMarker:"Voir le marqueur",title:"Titre",description:"Description",iconType:"Type d'icône",defaultIcon:"Logo par défaut",iconPreview:"Aperçu de l'icône",deleteMarker:"Supprimer le marqueur",cancel:"Annuler",close:"Fermer",save:"Enregistrer",placeholderTitle:"Entrez le titre du marqueur",placeholderDescription:"Entrez la description du marqueur (requise)"},zoom:{doubleClickToReset:"(Double-cliquez pour réinitialiser)"},csv:{chartTitle:"Titre du graphique",chartSubtitle:"Sous-titre du graphique",generated:"Généré"},fallback:{item:"Élément",axis:"Axe"},tooltip:{flags:"Drapeaux",markers:"Marqueurs",manualFlags:"Drapeaux manuels",autoFlags:"Drapeaux automatiques"}},N0={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",currentPageAriaLabel:"Page actuelle",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",searchAriaLabel:"Rechercher",searchTableAriaLabel:"Rechercher dans le tableau",clearSearchAriaLabel:"Effacer la recherche",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",expandRowAriaLabel:"Développer la ligne",collapseRowAriaLabel:"Réduire la ligne",filterColumnAriaLabel:"Filtrer la colonne",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa",showingRange:"Affichage de {start}-{end} sur {total}",ofPages:"sur {total}",emptyMessage:"Aucune donnée disponible"},B0={searchAcrossFields:"Rechercher dans tous les champs...",openAdvancedFilter:"Ouvrir le filtre avancé",closeAdvancedFilter:"Fermer le filtre avancé",noConditionsApplied:"Aucune condition de filtre n'est appliquée à cette vue",where:"Où",and:"Et",searchAttributes:"Rechercher des attributs...",noMatch:"Aucun résultat",enterValue:"Saisir une valeur...",min:"Min",max:"Max",search:"Rechercher...",addFilter:"Ajouter un filtre",clearAllFilters:"Effacer tous les filtres",select:"Sélectionner...",selectedCount:"{count} sélectionnés",operators:{contains:"contient",not_contains:"ne contient pas",equals:"est égal à",not_equals:"est différent de",starts_with:"commence par",ends_with:"se termine par",is_empty:"est vide",is_not_empty:"n'est pas vide",is_any_of:"est l'un de",is_none_of:"n'est aucun de",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"entre",contains_any:"contient l'un de",contains_all:"contient tous",not_contains_any:"ne contient pas",before:"avant",after:"après",is_true:"est vrai",is_false:"est faux"}},M0={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",startDate:"Date de début",endDate:"Date de fin",prevMonth:"Mois précédent",nextMonth:"Mois suivant",quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",last3Months:"3 derniers mois",last6Months:"6 derniers mois",last12Months:"12 derniers mois",lastYear:"Dernière année",allDates:"Toutes les dates",last2Dates:"2 dernières dates",last3Dates:"3 dernières dates",last4Dates:"4 dernières dates",last5Dates:"5 dernières dates"}},_0={toolbar:{undo:"Annuler",redo:"Rétablir",paragraphFormat:"Format de paragraphe",bold:"Gras",italic:"Italique",underline:"Souligné",citation:"Citation",insertLink:"Insérer un lien",removeLink:"Supprimer le lien",bulletList:"Liste à puces",numberList:"Liste numérotée",image:"Image",comment:"Commentaire",askAi:"Demander à l'IA"},paragraph:{heading1:"En-tête 1",heading2:"En-tête 2",heading3:"En-tête 3",heading4:"En-tête 4",heading5:"En-tête 5",heading6:"En-tête 6",paragraph:"Paragraphe"},link:{editLink:"Modifier le lien",altText:"Texte alternatif :",url:"URL :",enterAltText:"Entrez le texte alternatif...",enterUrl:"Entrez l'URL...",cancel:"Annuler",save:"Enregistrer"},image:{addImage:"Ajouter une image",editImage:"Modifier l'image",upload:"Télécharger",imageLink:"Lien de l'image",uploadImage:"Télécharger l'image :",imageUrl:"URL de l'image :",altText:"Texte alternatif :",width:"Largeur (px) :",height:"Hauteur (px) :",enterAltText:"Entrez le texte alternatif...",enterImageUrl:"https://exemple.com/image.jpg",auto:"Auto",noAlt:"Pas de texte alternatif",cancel:"Annuler",save:"Enregistrer"},comment:{placeholder:"Ajouter un commentaire",send:"Envoyer",delete:"Supprimer le commentaire"},started_conversation:"A démarré la conversation",labels:{title:"Titre",description:"Description"},placeholders:{title:"Entrez le titre...",description:"Entrez la description...",startTyping:"Commencez à taper..."},footer:{word:"mot",words:"mots",character:"caractère",characters:"caractères"}},Jn={chart:V0,table:N0,filter:B0,datepicker:M0,textEditor:_0},$0={contextMenu:{addMarker:"Markering toevoegen",clearAllMarkers:"Alle markeringen wissen",downloadSvg:"SVG downloaden",downloadPng:"PNG downloaden",downloadCsv:"CSV downloaden"},modalMarker:{editMarker:"Markering bewerken",viewMarker:"Markering bekijken",title:"Titel",description:"Beschrijving",iconType:"Pictogramtype",defaultIcon:"Standaard logo",iconPreview:"Pictogramvoorbeeld",deleteMarker:"Markering verwijderen",cancel:"Annuleren",close:"Sluiten",save:"Opslaan",placeholderTitle:"Voer markeringstitel in",placeholderDescription:"Voer markeringsbeschrijving in (optioneel)"},zoom:{doubleClickToReset:"(Dubbelklik om te resetten)"},csv:{chartTitle:"Grafiek titel",chartSubtitle:"Grafiek ondertitel",generated:"Gegenereerd"},fallback:{item:"Item",axis:"As"},tooltip:{flags:"Vlaggen",markers:"Markeringen",manualFlags:"Handmatige vlaggen",autoFlags:"Automatische vlaggen"}},L0={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",currentPageAriaLabel:"Huidige pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",searchAriaLabel:"Zoeken",searchTableAriaLabel:"Zoeken in tabel",clearSearchAriaLabel:"Zoekopdracht wissen",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",expandRowAriaLabel:"Rij uitklappen",collapseRowAriaLabel:"Rij inklappen",filterColumnAriaLabel:"Kolom filteren",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj",showingRange:"{start}-{end} van {total} weergegeven",ofPages:"van {total}",emptyMessage:"Geen gegevens beschikbaar"},T0={searchAcrossFields:"Zoeken in alle velden...",openAdvancedFilter:"Geavanceerde filter openen",closeAdvancedFilter:"Geavanceerde filter sluiten",noConditionsApplied:"Er zijn geen filtervoorwaarden toegepast op deze weergave",where:"Waar",and:"En",searchAttributes:"Zoek attributen...",noMatch:"Geen overeenkomst",enterValue:"Voer waarde in...",min:"Min",max:"Max",search:"Zoeken...",addFilter:"Filter toevoegen",clearAllFilters:"Alle filters wissen",select:"Selecteren...",selectedCount:"{count} geselecteerd",operators:{contains:"bevat",not_contains:"bevat niet",equals:"is gelijk aan",not_equals:"is niet gelijk aan",starts_with:"begint met",ends_with:"eindigt op",is_empty:"is leeg",is_not_empty:"is niet leeg",is_any_of:"is een van",is_none_of:"is geen van",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"tussen",contains_any:"bevat een van",contains_all:"bevat alle",not_contains_any:"bevat niet",before:"voor",after:"na",is_true:"is waar",is_false:"is onwaar"}},A0={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",last3Months:"Laatste 3 maanden",last6Months:"Laatste 6 maanden",last12Months:"Laatste 12 maanden",lastYear:"Afgelopen jaar",allDates:"Alle datums",last2Dates:"Laatste 2 datums",last3Dates:"Laatste 3 datums",last4Dates:"Laatste 4 datums",last5Dates:"Laatste 5 datums"}},D0={toolbar:{undo:"Ongedaan maken",redo:"Opnieuw",paragraphFormat:"Alineaopmaak",bold:"Vet",italic:"Cursief",underline:"Onderstreept",citation:"Citaat",insertLink:"Link invoegen",removeLink:"Link verwijderen",bulletList:"Lijst met opsommingstekens",numberList:"Genummerde lijst",image:"Afbeelding",comment:"Commentaar",askAi:"Vraag AI"},paragraph:{heading1:"Kop 1",heading2:"Kop 2",heading3:"Kop 3",heading4:"Kop 4",heading5:"Kop 5",heading6:"Kop 6",paragraph:"Alinea"},link:{editLink:"Link bewerken",altText:"Alt-tekst:",url:"URL:",enterAltText:"Voer alt-tekst in...",enterUrl:"Voer URL in...",cancel:"Annuleren",save:"Opslaan"},image:{addImage:"Afbeelding toevoegen",editImage:"Afbeelding bewerken",upload:"Uploaden",imageLink:"Afbeeldingslink",uploadImage:"Afbeelding uploaden:",imageUrl:"Afbeeldings-URL:",altText:"Alt-tekst:",width:"Breedte (px):",height:"Hoogte (px):",enterAltText:"Voer alt-tekst in...",enterImageUrl:"https://voorbeeld.com/afbeelding.jpg",auto:"Auto",noAlt:"Geen alt-tekst",cancel:"Annuleren",save:"Opslaan"},comment:{placeholder:"Voeg een opmerking toe",send:"Verzenden",delete:"Opmerking verwijderen"},started_conversation:"Gesprek gestart",labels:{title:"Titel",description:"Beschrijving"},placeholders:{title:"Voer titel in...",description:"Voer beschrijving in...",startTyping:"Begin met typen..."},footer:{word:"woord",words:"woorden",character:"teken",characters:"tekens"}},eo={chart:$0,table:L0,filter:T0,datepicker:A0,textEditor:D0},Mo={en:Qn,fr:Jn,nl:eo};function Ko(L){if(!L||!L.global)return;const ae=L.global.availableLocales||[];Object.keys(Mo).forEach(B=>{ae.includes(B)&&L.global.mergeLocaleMessage(B,Mo[B])})}const _o={en:{textEditor:Qn.textEditor},fr:{textEditor:Jn.textEditor},nl:{textEditor:eo.textEditor}};function Go(L){if(!L||!L.global)return;const ae=L.global.availableLocales||[];Object.keys(_o).forEach(B=>{ae.includes(B)&&L.global.mergeLocaleMessage(B,_o[B])})}const $o={en:{table:Qn.table},fr:{table:Jn.table},nl:{table:eo.table}};function Qo(L){if(!L||!L.global)return;const ae=L.global.availableLocales||[];Object.keys($o).forEach(B=>{ae.includes(B)&&L.global.mergeLocaleMessage(B,$o[B])})}const Lo={en:{datepicker:Qn.datepicker},fr:{datepicker:Jn.datepicker},nl:{datepicker:eo.datepicker}};function Jo(L){if(!L||!L.global)return;const ae=L.global.availableLocales||[];Object.keys(Lo).forEach(B=>{ae.includes(B)&&L.global.mergeLocaleMessage(B,Lo[B])})}const To={en:{filter:Qn.filter},fr:{filter:Jn.filter},nl:{filter:eo.filter}};function ea(L){if(!L||!L.global)return;const ae=L.global.availableLocales||[];Object.keys(To).forEach(B=>{ae.includes(B)&&L.global.mergeLocaleMessage(B,To[B])})}const H0={chart:Mo,textEditor:_o,table:$o,datepicker:Lo,filter:To};function R0(L){!L||!L.global||(Ko(L),Go(L),Qo(L),Jo(L),ea(L))}const I0={en:{...Qn},fr:{...Jn},nl:{...eo}};Gn.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:I0});exports.DSSChart=Ri;exports.DSSChartMessages=Mo;exports.DSSColorPicker=E2;exports.DSSConfetti=Q2;exports.DSSDatepicker=Wo;exports.DSSDatepickerMessages=Lo;exports.DSSDnd=K2;exports.DSSFilter=a0;exports.DSSFilterMessages=To;exports.DSSLoader=R2;exports.DSSMessages=H0;exports.DSSModal=Oo;exports.DSSPillField=p0;exports.DSSSkeleton=I2;exports.DSSStepBar=C0;exports.DSSTable=au;exports.DSSTableMessages=$o;exports.DSSTextEditor=i2;exports.DSSTextEditorMessages=_o;exports.addDSSChartTranslations=Ko;exports.addDSSDatepickerTranslations=Jo;exports.addDSSFilterTranslations=ea;exports.addDSSTableTranslations=Qo;exports.addDSSTextEditorTranslations=Go;exports.addDSSTranslations=R0;
117
+ `,document.body.appendChild(rt),ke=rt}function yt(te,$e){ke&&(ke.style.left=`${te-ze}px`,ke.style.top=`${$e-lt}px`)}function Ue(te){te.classList.add("dss-dnd-item--dragging"),te.style.background=X.value.dragSourceBackground,te.style.borderColor=X.value.dragSourceBorder,te.style.transform="scale(0.97)"}function tl(te){te.classList.remove("dss-dnd-item--dragging"),te.style.background="",te.style.borderColor="",te.style.transform=""}function st(te,$e){return document.elementFromPoint(te,$e)?.closest(".dss-dnd-column-body")??null}function xt(te,$e){return!!document.elementFromPoint(te,$e)?.closest("[data-dss-dnd-delete-zone]")}function Ht(te,$e){if(z.value&&xt(te,$e)){ge.value=!0,be.value=null,ne.value=-1;return}ge.value=!1;const Ne=st(te,$e),qe=Ne?.getAttribute("data-column")??null;if(!qe){be.value=null,ne.value=-1;return}be.value=qe;const rt=Ne.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Ze=rt.length;for(let Ye=0;Ye<rt.length;Ye++){const mt=rt[Ye].getBoundingClientRect();if($e<mt.top+mt.height/2){Ze=Ye;break}}ne.value=Ze}function ll(te){te.preventDefault(),yt(te.clientX,te.clientY),!ue&&(ue=requestAnimationFrame(()=>{ue=null,Ht(te.clientX,te.clientY)}))}function It(te){window.removeEventListener("pointermove",ll),window.removeEventListener("pointerup",It),window.removeEventListener("pointercancel",It),Me?.releasePointerCapture?.(te.pointerId),tl(Me),Me=null;const $e=z.value&&xt(te.clientX,te.clientY);if(f.value&&$e)_("delete",{item:f.value});else{const qe=st(te.clientX,te.clientY)?.getAttribute("data-column")??null;if(f.value&&qe){const rt=f.value[B.columnKey],Ze=qe,mt=(ie.value[Ze]||[]).filter(ee=>ee[B.itemKey]!==f.value[B.itemKey]),Le=Math.max(0,Math.min(ne.value,mt.length)),q=gt(Ze,Le),U=f.value[B.itemKey];_("move",{item:f.value,from:rt,to:Ze,position:q,index:Le}),H&&clearTimeout(H),j.value={id:U,from:rt,to:Ze},H=setTimeout(()=>{j.value=null},3500)}}ke&&(ke.remove(),ke=null),R!==null&&(document.body.style.cursor=R,R=""),Xt()}function at(te,$e){te.preventDefault();const Ne=te.target.closest(".dss-dnd-item");if(!Ne)return;const qe=Ne.getBoundingClientRect();ze=te.clientX-qe.left,lt=te.clientY-qe.top,R=document.body.style.cursor,document.body.style.cursor="grabbing",f.value=$e,Me=Ne,he(Ne,te.clientX,te.clientY),requestAnimationFrame(()=>Ue(Ne)),Ne.setPointerCapture?.(te.pointerId),window.addEventListener("pointermove",ll),window.addEventListener("pointerup",It,{once:!0}),window.addEventListener("pointercancel",It,{once:!0})}function Et(){pe&&(window.removeEventListener("pointermove",nl),window.removeEventListener("pointerup",Ft),window.removeEventListener("pointercancel",Ft),pe=null)}function nl(te){if(!pe||te.pointerId!==pe.pointerId)return;const $e=te.clientX-pe.startX,Ne=te.clientY-pe.startY;if(Math.abs($e)>=fe||Math.abs(Ne)>=fe){const qe=pe.item;Et(),at(te,qe)}}function Ft(te){!pe||te.pointerId!==pe.pointerId||Et()}function Yt(te,$e){Et(),pe={item:$e,startX:te.clientX,startY:te.clientY,pointerId:te.pointerId},window.addEventListener("pointermove",nl),window.addEventListener("pointerup",Ft),window.addEventListener("pointercancel",Ft)}function Ge(te,$e){X.value.useHandle||Yt(te,$e)}function et(te,$e){Yt(te,$e)}function $t(){ue&&(cancelAnimationFrame(ue),ue=null)}function Xt(){$t(),f.value=null,be.value=null,ge.value=!1,ne.value=-1}return e.onBeforeUnmount(()=>{$t(),Et(),H&&clearTimeout(H),ke&&(ke.remove(),ke=null)}),(te,$e)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":X.value.unstyled}]),style:e.normalizeStyle(Ke.value)},[z.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":ge.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(te.$slots,"delete-zone",{isDragging:!!f.value,isOver:ge.value})],2),[[e.vShow,!!f.value||X.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.columns,Ne=>(e.openBlock(),e.createElementBlock("div",{key:Ne.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":be.value==Ne.value},Ne.class||""]]),style:e.normalizeStyle(ve(Ne))},[X.value.showHeader?(e.openBlock(),e.createElementBlock("div",F2,[e.renderSlot(te.$slots,"column-header",{column:Ne,items:ie.value[Ne.value]||[]},()=>[e.createElementVNode("span",z2,e.toDisplayString(Ne.title||Ne.value),1),e.createElementVNode("span",P2,e.toDisplayString((ie.value[Ne.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Ne.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nt.value[Ne.value],qe=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:qe.key},[qe.type==="indicator"?(e.openBlock(),e.createElementBlock("div",q2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":qe.isDragged,"dss-dnd-item--no-handle":!X.value.useHandle}]),onPointerdown:rt=>Ge(rt,qe.item)},[X.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(rt=>et(rt,qe.item),["stop"])},[e.renderSlot(te.$slots,"handle",{},()=>[$e[0]||($e[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,Z2)):e.createCommentVNode("",!0),e.createElementVNode("div",U2,[e.renderSlot(te.$slots,"item",{item:qe.item,column:Ne,justDropped:j.value?.id===qe.item[L.itemKey],droppedFrom:j.value?.id===qe.item[L.itemKey]?j.value.from:null,droppedTo:j.value?.id===qe.item[L.itemKey]?j.value.to:null},()=>[e.createElementVNode("div",X2,e.toDisplayString(qe.item[L.itemKey]),1)])])],42,W2))],64))),128)),(ie.value[Ne.value]||[]).length===0&&be.value!=Ne.value?(e.openBlock(),e.createElementBlock("div",Y2,[e.renderSlot(te.$slots,"empty",{column:Ne},()=>[$e[1]||($e[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,O2)],6))),128))],6))}}),G2={name:"DSSConfetti"},Q2=Object.assign(G2,{props:{trigger:{type:Boolean,default:!1},duration:{type:Number,default:3e3},fadeStart:{type:Number,default:2e3},count:{type:Number,default:90},colors:{type:Array,default:()=>["#047395","#ffc230","#0897c1","#fe3b59","#11e1a2","#b3b2fb","#fadb8d","#ffa25b","#feaab1"]},delay:{type:Number,default:300}},setup(L){const ae=L,B=e.ref(null),_=e.ref(!1);let oe=[],z=null,$=null;function X(ne,j){const ue=[];for(let H=0;H<ae.count;H++)ue.push(Ke(ne));return ue}function Ke(ne,j){return{x:Math.random()*ne,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:ae.colors[Math.floor(Math.random()*ae.colors.length)],tilt:Math.floor(Math.random()*10)-10,tiltInc:Math.random()*.08+.04,tiltAngle:0,opacity:Math.random()*.7+.3,speed:Math.random()*4+1.5}}function ve(ne,j,ue,H){ne.clearRect(0,0,j,ue);for(const ke of oe)ne.save(),ne.globalAlpha=ke.opacity*H,ne.beginPath(),ne.lineWidth=ke.r,ne.strokeStyle=ke.color,ne.moveTo(ke.x+ke.tilt+ke.r/2,ke.y),ne.lineTo(ke.x+ke.tilt,ke.y+ke.tilt+ke.r/2),ne.stroke(),ne.restore()}function f(ne,j,ue){const H=.3+ue*.7;for(let ke=0;ke<oe.length;ke++){const Me=oe[ke];Me.tiltAngle+=Me.tiltInc,Me.y+=Me.speed*H,Me.x+=Math.sin(Me.d)*.5*H,Me.tilt=Math.sin(Me.tiltAngle)*15,ue>=.99&&Me.y>j+20&&(oe[ke]=Ke(ne))}}function be(){_.value=!0,e.nextTick(()=>{const ne=B.value;if(!ne)return;const j=ne.getContext("2d"),ue=ne.parentElement;if(!ue)return;const H=ue.getBoundingClientRect();ne.width=H.width,ne.height=H.height,oe=X(ne.width,ne.height);const ke=Date.now(),Me=ke+ae.duration,ze=()=>{const lt=Date.now(),R=lt-ke;if(lt<Me){let pe=1;R>ae.fadeStart&&(pe=1-(R-ae.fadeStart)/(ae.duration-ae.fadeStart)),ve(j,ne.width,ne.height,pe),f(ne.width,ne.height,pe),z=requestAnimationFrame(ze)}else ge()};ze()})}function ge(){z&&(cancelAnimationFrame(z),z=null),oe=[],_.value=!1}return e.watch(()=>ae.trigger,ne=>{ne&&($&&clearTimeout($),$=setTimeout(be,ae.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{ge(),$&&clearTimeout($)}),(ne,j)=>_.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:B,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),J2={class:"dss-filter-global-inner"},em=["placeholder","value"],tm=["title"],lm={key:0,class:"dss-filter-funnel-badge"},nm={key:1,class:"dss-filter-sortby"},om=["value"],am=["value"],sm=["disabled","title"],rm={key:0,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},im={key:1,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cm={key:2,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},um={class:"dss-filter-panel"},dm={key:0,class:"dss-filter-empty"},mm={class:"dss-filter-row-prefix"},pm={class:"dss-filter-cell"},fm=["onClick"],vm={class:"dss-filter-trigger-text"},gm=["placeholder"],hm={class:"dss-filter-popup-list"},ym=["onClick"],km={key:0,class:"dss-filter-popup-empty"},Cm={key:0,class:"dss-filter-cell"},bm=["onClick"],wm={class:"dss-filter-trigger-text"},xm={class:"dss-filter-popup-list"},Em=["onClick"],Sm={key:1,class:"dss-filter-cell dss-filter-cell--value"},Vm=["placeholder","onUpdate:modelValue"],Nm={key:1,class:"dss-filter-date-wrap"},Bm=["placeholder","onUpdate:modelValue"],Mm=["placeholder","value","onInput","step"],_m={key:4,class:"dss-filter-between"},$m=["placeholder","value","onInput","step"],Lm={class:"dss-filter-between-sep"},Tm=["placeholder","value","onInput","step"],Am={key:5,class:"dss-filter-multiselect"},Dm=["onClick"],Hm={class:"dss-filter-trigger-text"},Rm=["placeholder"],Im={class:"dss-filter-popup-list dss-filter-popup-list--check"},Fm=["onClick"],zm=["checked"],Pm={key:0,class:"dss-filter-popup-empty"},Om=["onClick"],qm={class:"dss-filter-foot"},Wm={class:"dss-filter-cell"},Zm=["placeholder"],Um={class:"dss-filter-popup-list"},Xm=["onClick"],Ym={key:0,class:"dss-filter-popup-divider"},jm=["onClick"],Km=["placeholder"],Gm={class:"dss-filter-popup-list"},Qm=["onClick"],Jm={key:0,class:"dss-filter-popup-empty"},e0=["placeholder"],t0={class:"dss-filter-popup-list"},l0=["onClick"],n0={key:0,class:"dss-filter-popup-empty"},o0={name:"DSSFilter"},a0=Object.assign(o0,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},showSortBy:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(L,{expose:ae,emit:B}){const{t:_}=Gn.useI18n(),oe=L,z=B,$={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},X=e.computed(()=>({...$,...oe.options})),Ke={text:[{value:"contains"},{value:"not_contains"},{value:"equals"},{value:"not_equals"},{value:"starts_with"},{value:"ends_with"},{value:"is_empty"},{value:"is_not_empty"}],select:[{value:"is_any_of"},{value:"is_none_of"},{value:"is_empty"},{value:"is_not_empty"}],range:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],int:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],arraySelect:[{value:"contains_any"},{value:"contains_all"},{value:"not_contains_any"},{value:"is_empty"},{value:"is_not_empty"}],arrayText:[{value:"contains"},{value:"not_contains"},{value:"is_empty"},{value:"is_not_empty"}],date:[{value:"eq"},{value:"before"},{value:"after"},{value:"is_empty"},{value:"is_not_empty"}],boolean:[{value:"is_true"},{value:"is_false"},{value:"is_empty"},{value:"is_not_empty"}]},ve=new Set(["is_empty","is_not_empty","is_true","is_false"]),f=["label","name","title","keyword","full_name","value","text"],be=e.ref(""),ge=e.ref([]),ne=e.ref(null),j=e.ref(!1),ue=e.ref(null),H=e.ref(""),ke=e.ref(null),Me=e.ref(""),ze=e.ref("asc");let lt=1;function R(V){const C=V.find(S=>S&&typeof S=="object");if(!C)return null;for(const S of f)if(S in C&&typeof C[S]=="string")return S;return Object.keys(C).find(S=>typeof C[S]=="string")||null}function pe(V,C){const S=C.filter(K=>K!=null&&K!=="NULL");if(S.length===0)return null;if(S.every(K=>Array.isArray(K))){const K=S.flatMap(Oe=>Oe).filter(Oe=>Oe!=null);return K.length===0?null:typeof K.find(Oe=>Oe!=null)=="object"?"arraySelect":"arrayText"}return S.every(K=>typeof K=="boolean")?"boolean":S.every(K=>typeof K=="number")?new Set(S).size<=X.value.maxUniqueForEnum?"select":"range":S.every(K=>typeof K=="string")?new Set(S).size<=X.value.maxUniqueForSelect?"select":"text":S.some(K=>typeof K=="object"&&!Array.isArray(K))?null:"text"}const fe=e.computed(()=>{if(!oe.data?.length)return[];const V=new Set;for(const Q of oe.data)if(Q&&typeof Q=="object")for(const Oe of Object.keys(Q))V.add(Oe);const C=new Set(oe.exclude),S=[];for(const Q of V){if(C.has(Q))continue;const Oe=oe.config[Q]||{},pt=oe.data.map(Qe=>Qe?.[Q]),Ee=Oe.type||pe(Q,pt);if(!Ee)continue;const Ve=Oe.filterMode||"contain",Tt=Ve==="date"?"date":Ve==="string"?"text":Ee,At={key:Q,label:Oe.label||qt(Q),type:Tt,filterMode:Ve};if(Ee==="select"){const Qe=pt.filter(Je=>Je!=null&&Je!=="NULL");At.uniqueValues=[...new Set(Qe)].sort((Je,Lt)=>typeof Je=="number"&&typeof Lt=="number"?Je-Lt:String(Je).localeCompare(String(Lt)))}else if(Ee==="range"||Ee==="int"){const Qe=pt.filter(Je=>typeof Je=="number");At.min=Math.min(...Qe),At.max=Math.max(...Qe)}else if(Ee==="arraySelect"){const Qe=Oe.displayKey||R(pt.flatMap(Je=>Array.isArray(Je)?Je:[]));if(At.displayKey=Qe,Array.isArray(Oe.uniqueValues)&&Oe.uniqueValues.length>0)At.uniqueValues=Oe.uniqueValues.map(Je=>String(Je));else{const Je=pt.flatMap(Lt=>Array.isArray(Lt)?Lt:[]).filter(Lt=>Lt!=null).map(Lt=>Qe&&typeof Lt=="object"?Lt[Qe]:String(Lt)).filter(Lt=>Lt!=null&&Lt!=="");At.uniqueValues=[...new Set(Je)].sort((Lt,gl)=>String(Lt).localeCompare(String(gl)))}}S.push(At)}const K=oe.config._order;return K&&S.sort((Q,Oe)=>{const pt=K.indexOf(Q.key),Ee=K.indexOf(Oe.key);return pt===-1&&Ee===-1?0:pt===-1?1:Ee===-1?-1:pt-Ee}),S}),ie=e.computed(()=>{const V={};for(const C of fe.value)V[C.key]=C;return V}),nt=e.computed(()=>Array.isArray(oe.config.groups)&&oe.config.groups.length>0),gt=e.computed(()=>{if(!nt.value)return[];const V=new Set(fe.value.map(C=>C.key));return oe.config.groups.map(C=>({...C,keys:C.keys.filter(S=>V.has(S))})).filter(C=>C.keys.length>0)}),he=e.computed(()=>{if(!nt.value)return[];const V=new Set(oe.config.groups.flatMap(C=>C.keys));return fe.value.filter(C=>!V.has(C.key))}),yt=e.computed(()=>{if(!ke.value)return[];const V=new Set(ke.value.keys),C=fe.value.filter(K=>V.has(K.key));if(!H.value)return C;const S=H.value.toLowerCase();return C.filter(K=>K.label.toLowerCase().includes(S))}),Ue=e.computed(()=>{if(!H.value)return fe.value;const V=H.value.toLowerCase();return fe.value.filter(C=>C.label.toLowerCase().includes(V))}),tl=e.computed(()=>fe.value.filter(V=>!["arraySelect","arrayText"].includes(V.type))),st=e.computed(()=>Me.value?ze.value==="asc"?"Ascending":"Descending":"No sort selected");function xt(V){ne.value===V?Ht():(ne.value=V,H.value="",ke.value=null)}function Ht(){ne.value=null,H.value="",ke.value=null}function ll(V){const C=V.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");ne.value&&!C&&!V.target.closest(".dss-filter-popup")&&!V.target.closest(".dss-filter-trigger")&&!V.target.closest(".dss-filter-add-btn")&&Ht(),j.value&&ue.value&&!ue.value.contains(V.target)&&(C||(j.value=!1))}e.onMounted(()=>document.addEventListener("click",ll)),e.onBeforeUnmount(()=>document.removeEventListener("click",ll));function It(V){return ie.value[V]?.label||qt(V)}function at(V){return ie.value[V.key]?.filterMode||"contain"}function Et(V){return _(`filter.operators.${V}`)}function nl(V){const C=ie.value[V.key];return(Ke[C?.type]||Ke.text).map(S=>({...S,label:_(`filter.operators.${S.value}`)}))}function Ft(V){return ve.has(V)}function Yt(V){const C=ie.value[V.key];return C?C.type==="date"?"date":C.type==="boolean"?"boolean":C.type==="text"||C.type==="arrayText"?"text":C.type==="select"||C.type==="arraySelect"?"multiselect":C.type==="range"||C.type==="int"?V.operator==="between"?"between":"number":"text":"text"}function Ge(V){return Ke[V]?.[0]?.value||"contains"}function et(V,C){return ve.has(C)||V==="date"?null:V==="select"||V==="arraySelect"?[]:(V==="range"||V==="int")&&C==="between"?{min:null,max:null}:V==="range"||V==="int"?null:""}function $t(V){return ie.value[V.key]?.uniqueValues||[]}function Xt(V){const C=$t(V);if(!H.value)return C;const S=H.value.toLowerCase();return C.filter(K=>String(K).toLowerCase().includes(S))}function te(V){const C=V.value;return!C||C.length===0?_("filter.select"):C.length<=2?C.join(", "):_("filter.selectedCount",{count:C.length})}function $e(V){const C=ie.value[V],S=C?.filterMode||"contain",K=C?.type||"text",Q=S==="string"?"contains":Ge(K);ge.value.push(e.reactive({id:lt++,key:V,operator:Q,value:et(K,Q)})),Ht()}function Ne(V){ge.value=ge.value.filter(C=>C.id!==V)}function qe(V,C){const K=ie.value[C]?.type||"text";V.key=C,V.operator=Ge(K),V.value=et(K,V.operator),Ht()}function rt(V,C){const S=Yt(V);V.operator=C;const K=Yt(V);if(S!==K||ve.has(C)){const Q=ie.value[V.key];V.value=et(Q?.type||"text",C)}Ht()}function Ze(V,C){const S=C.target.value;V.value=S===""?null:Number(S)}function Ye(V,C,S){const K=S.target.value,Q=K===""?null:Number(K);(!V.value||typeof V.value!="object")&&(V.value={min:null,max:null}),V.value={...V.value,[C]:isNaN(Q)?null:Q}}function mt(V,C){const S=V.value||[],K=S.indexOf(C);V.value=K>=0?S.filter(Q=>Q!==C):[...S,C]}function Le(){ge.value=[],be.value="",Ht()}function q(V){be.value=V.target.value}function U(V){Me.value=V.target.value}function ee(){ze.value=ze.value==="asc"?"desc":"asc"}const se=e.computed(()=>{if(!oe.data)return[];let V=oe.data;if(be.value){const C=be.value.toLowerCase();V=V.filter(S=>{for(const K of Object.keys(S)){const Q=S[K];if(typeof Q=="string"&&Q.toLowerCase().includes(C)||typeof Q=="number"&&String(Q).includes(C)||Array.isArray(Q)&&Q.some(Oe=>Oe!=null&&(typeof Oe=="string"?Oe.toLowerCase().includes(C):typeof Oe=="object"?Object.values(Oe).some(pt=>typeof pt=="string"&&pt.toLowerCase().includes(C)):!1)))return!0}return!1})}for(const C of ge.value){if(!bt(C))continue;const S=ie.value[C.key];S&&(V=V.filter(K=>Re(K,C,S)))}if(oe.showSortBy&&Me.value){const C=Me.value,S=ze.value==="asc"?1:-1;V=[...V].sort((K,Q)=>He(K?.[C],Q?.[C])*S)}return V});function He(V,C){const S=it(V),K=it(C);return S==null&&K==null?0:S==null?1:K==null?-1:typeof S=="number"&&typeof K=="number"?S-K:String(S).localeCompare(String(K),void 0,{numeric:!0,sensitivity:"base"})}function it(V){return V==null||V==="NULL"?null:typeof V=="string"||typeof V=="number"||typeof V=="boolean"?V:V instanceof Date?V.getTime():null}function bt(V){return ve.has(V.operator)?!0:V.value==null||typeof V.value=="string"&&V.value===""||Array.isArray(V.value)&&V.value.length===0?!1:V.value instanceof Date?!isNaN(V.value.getTime()):!(typeof V.value=="object"&&!Array.isArray(V.value)&&V.value.min==null&&V.value.max==null)}function Re(V,C,S){const K=V?.[C.key],Q=C.value,Oe=C.operator;if(Oe==="is_empty")return jt(K);if(Oe==="is_not_empty")return!jt(K);const pt=S.type;if(pt==="text"||pt==="arrayText"){const Ee=pt==="arrayText"&&Array.isArray(K)?K.filter(At=>At!=null).map(String).join(" "):K!=null?String(K):"",Ve=String(Q).toLowerCase(),Tt=Ee.toLowerCase();switch(Oe){case"contains":return Tt.includes(Ve);case"not_contains":return!Tt.includes(Ve);case"equals":return Tt===Ve;case"not_equals":return Tt!==Ve;case"starts_with":return Tt.startsWith(Ve);case"ends_with":return Tt.endsWith(Ve);default:return!0}}if(pt==="select")switch(Oe){case"is_any_of":return Q.includes(K);case"is_none_of":return!Q.includes(K);default:return!0}if(pt==="range"||pt==="int"){const Ee=typeof K=="number"?K:Number(K);if(typeof Ee!="number"||isNaN(Ee))return!1;if(Oe==="between"){const Tt=Q?.min!=null?Number(Q.min):null,At=Q?.max!=null?Number(Q.max):null,Qe=Tt!=null&&!isNaN(Tt)?Tt:null,Je=At!=null&&!isNaN(At)?At:null;return(Qe==null||Ee>=Qe)&&(Je==null||Ee<=Je)}const Ve=typeof Q=="number"&&!isNaN(Q)?Q:Number(Q);if(Oe==="contains"||Oe==="not_contains"){const Tt=String(Ee),At=String(Q??"").toLowerCase(),Qe=Tt.toLowerCase().includes(At);return Oe==="contains"?Qe:!Qe}if(typeof Ve!="number"||isNaN(Ve))return!1;switch(Oe){case"eq":return Ee===Ve;case"neq":return Ee!==Ve;case"gt":return Ee>Ve;case"gte":return Ee>=Ve;case"lt":return Ee<Ve;case"lte":return Ee<=Ve;default:return!0}}if(pt==="arraySelect"){if(!Array.isArray(K))return!1;const Ee=K.filter(Ve=>Ve!=null).map(Ve=>S.displayKey&&typeof Ve=="object"?Ve[S.displayKey]:String(Ve));switch(Oe){case"contains_any":return Ee.some(Ve=>Q.includes(Ve));case"contains_all":return Q.every(Ve=>Ee.includes(Ve));case"not_contains_any":return!Ee.some(Ve=>Q.includes(Ve));default:return!0}}if(pt==="date"){const Ee=ht(Q);if(!Ee||isNaN(Ee.getTime()))return!1;const Ve=ht(K);if(!Ve||isNaN(Ve.getTime()))return!1;const Tt=Rt(Ve),At=Rt(Ee);switch(Oe){case"eq":return Tt===At;case"before":return Tt<At;case"after":return Tt>At;default:return!0}}if(pt==="boolean"){const Ee=K===!0||K==="true"||K===1,Ve=K===!1||K==="false"||K===0;switch(Oe){case"is_true":return Ee;case"is_false":return Ve;default:return!0}}return!0}function ht(V){if(V==null)return null;if(V instanceof Date)return isNaN(V.getTime())?null:V;if(typeof V=="number")return new Date(V>1e10?V:V*1e3);if(typeof V=="string"){const C=new Date(V);return isNaN(C.getTime())?null:C}return null}function Rt(V){const C=V.getFullYear(),S=String(V.getMonth()+1).padStart(2,"0"),K=String(V.getDate()).padStart(2,"0");return`${C}-${S}-${K}`}function jt(V){return!!(V==null||V===""||V==="NULL"||Array.isArray(V)&&V.length===0||Array.isArray(V)&&V.every(C=>C==null))}e.watch(se,V=>z("update:modelValue",V),{immediate:!0}),e.watch(()=>oe.data,()=>{ge.value=[],be.value="",j.value=!1,Me.value="",ze.value="asc",Ht()});function qt(V){return V.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,C=>C.toUpperCase())}function Dt(){const V=C=>{if(C==null)return C;if(C instanceof Date)return{_type:"Date",value:C.toISOString(),local:C.toLocaleDateString()};if(Array.isArray(C))return C.map(V);if(typeof C=="object"&&!Array.isArray(C)){const S={};for(const K of Object.keys(C))S[K]=V(C[K]);return S}return C};return{globalSearch:be.value,rows:ge.value.map(C=>({key:C.key,operator:C.operator,value:V(C.value),defType:ie.value[C.key]?.type,defFilterMode:ie.value[C.key]?.filterMode})),filteredCount:se.value?.length??0}}return ae({getDebugState:Dt}),(V,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":X.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:ue},[e.createElementVNode("div",J2,[C[20]||(C[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref(_)("filter.searchAcrossFields"),value:be.value,onInput:q},null,40,em),be.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:C[0]||(C[0]=S=>be.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:j.value||ge.value.length>0,"dss-filter-funnel-btn--with-sort":oe.showSortBy}]),onClick:C[1]||(C[1]=S=>j.value=!j.value),type:"button",title:j.value?e.unref(_)("filter.closeAdvancedFilter"):e.unref(_)("filter.openAdvancedFilter")},[C[14]||(C[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),ge.value.length>0?(e.openBlock(),e.createElementBlock("span",lm,e.toDisplayString(ge.value.length),1)):e.createCommentVNode("",!0)],10,tm),oe.showSortBy?(e.openBlock(),e.createElementBlock("div",nm,[C[19]||(C[19]=e.createElementVNode("label",{class:"dss-filter-sortby-label",for:"dss-filter-sort-select"},"Sort by",-1)),e.createElementVNode("select",{id:"dss-filter-sort-select",class:"dss-filter-sortby-select",value:Me.value,onChange:U},[C[15]||(C[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tl.value,S=>(e.openBlock(),e.createElementBlock("option",{key:S.key,value:S.key},e.toDisplayString(S.label),9,am))),128))],40,om),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:ee,disabled:!Me.value,title:st.value},[Me.value?ze.value==="asc"?(e.openBlock(),e.createElementBlock("svg",im,[...C[17]||(C[17]=[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",cm,[...C[18]||(C[18]=[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",rm,[...C[16]||(C[16]=[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"currentColor"},null,-1)])]))],8,sm)])):e.createCommentVNode("",!0)]),j.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:C[13]||(C[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",um,[ge.value.length===0?(e.openBlock(),e.createElementBlock("div",dm,e.toDisplayString(e.unref(_)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,(S,K)=>(e.openBlock(),e.createElementBlock("div",{key:S.id,class:"dss-filter-row"},[e.createElementVNode("span",mm,e.toDisplayString(K===0?e.unref(_)("filter.where"):e.unref(_)("filter.and")),1),e.createElementVNode("div",pm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(Q=>xt(`${S.id}:field`),["stop"])},[e.createElementVNode("span",vm,e.toDisplayString(It(S.key)),1),C[21]||(C[21]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,fm),ne.value===`${S.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[3]||(C[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[2]||(C[2]=Q=>H.value=Q),placeholder:e.unref(_)("filter.searchAttributes")},null,8,gm),[[e.vModelText,H.value]]),e.createElementVNode("ul",hm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,Q=>(e.openBlock(),e.createElementBlock("li",{key:Q.key,class:"dss-filter-popup-item",onClick:Oe=>qe(S,Q.key)},e.toDisplayString(Q.label),9,ym))),128)),Ue.value.length===0?(e.openBlock(),e.createElementBlock("li",km,e.toDisplayString(e.unref(_)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),at(S)==="contain"||at(S)==="date"?(e.openBlock(),e.createElementBlock("div",Cm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(Q=>xt(`${S.id}:op`),["stop"])},[e.createElementVNode("span",wm,e.toDisplayString(Et(S.operator)),1),C[22]||(C[22]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,bm),ne.value===`${S.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[4]||(C[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",xm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nl(S),Q=>(e.openBlock(),e.createElementBlock("li",{key:Q.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:S.operator===Q.value}]),onClick:Oe=>rt(S,Q.value)},e.toDisplayString(Q.label),11,Em))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ft(S.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Sm,[at(S)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(_)("filter.enterValue"),"onUpdate:modelValue":Q=>S.value=Q},null,8,Vm)),[[e.vModelText,S.value]]):at(S)==="date"?(e.openBlock(),e.createElementBlock("div",Nm,[e.createVNode(qo,{mode:"single",modelValue:S.value,"onUpdate:modelValue":Q=>S.value=Q},null,8,["modelValue","onUpdate:modelValue"])])):Yt(S)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(_)("filter.enterValue"),"onUpdate:modelValue":Q=>S.value=Q},null,8,Bm)),[[e.vModelText,S.value]]):Yt(S)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(_)("filter.enterValue"),value:S.value,onInput:Q=>Ze(S,Q),step:ie.value[S.key]?.type==="int"?1:void 0},null,40,Mm)):Yt(S)==="between"?(e.openBlock(),e.createElementBlock("div",_m,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(_)("filter.min"),value:S.value?.min,onInput:Q=>Ye(S,"min",Q),step:ie.value[S.key]?.type==="int"?1:void 0},null,40,$m),e.createElementVNode("span",Lm,e.toDisplayString(e.unref(_)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(_)("filter.max"),value:S.value?.max,onInput:Q=>Ye(S,"max",Q),step:ie.value[S.key]?.type==="int"?1:void 0},null,40,Tm)])):Yt(S)==="multiselect"?(e.openBlock(),e.createElementBlock("div",Am,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(Q=>xt(`${S.id}:val`),["stop"])},[e.createElementVNode("span",Hm,e.toDisplayString(te(S)),1),C[23]||(C[23]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,Dm),ne.value===`${S.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[6]||(C[6]=e.withModifiers(()=>{},["stop"]))},[$t(S).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[5]||(C[5]=Q=>H.value=Q),placeholder:e.unref(_)("filter.search")},null,8,Rm)),[[e.vModelText,H.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",Im,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xt(S),Q=>(e.openBlock(),e.createElementBlock("li",{key:Q,class:"dss-filter-popup-item",onClick:Oe=>mt(S,Q)},[e.createElementVNode("input",{type:"checkbox",checked:(S.value||[]).includes(Q),tabindex:"-1"},null,8,zm),e.createElementVNode("span",null,e.toDisplayString(Q),1)],8,Fm))),128)),Xt(S).length===0?(e.openBlock(),e.createElementBlock("li",Pm,e.toDisplayString(e.unref(_)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:Q=>Ne(S.id)},[...C[24]||(C[24]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,Om)]))),128)),e.createElementVNode("div",qm,[e.createElementVNode("div",Wm,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:C[7]||(C[7]=e.withModifiers(S=>xt("add"),["stop"]))},e.toDisplayString(e.unref(_)("filter.addFilter")),1),ne.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:C[12]||(C[12]=e.withModifiers(()=>{},["stop"]))},[nt.value&&!ke.value&&!H.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[8]||(C[8]=S=>H.value=S),placeholder:e.unref(_)("filter.searchAttributes")},null,8,Zm),[[e.vModelText,H.value]]),e.createElementVNode("ul",Um,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:K=>ke.value=S},[e.createElementVNode("span",null,e.toDisplayString(S.label),1),C[25]||(C[25]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,Xm))),128)),he.value.length>0?(e.openBlock(),e.createElementBlock("li",Ym)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:K=>$e(S.key)},e.toDisplayString(S.label),9,jm))),128))])],64)):ke.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:C[9]||(C[9]=S=>ke.value=null)},[C[26]||(C[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(ke.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[10]||(C[10]=S=>H.value=S),placeholder:e.unref(_)("filter.searchAttributes")},null,8,Km),[[e.vModelText,H.value]]),e.createElementVNode("ul",Gm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yt.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:K=>$e(S.key)},e.toDisplayString(S.label),9,Qm))),128)),yt.value.length===0?(e.openBlock(),e.createElementBlock("li",Jm,e.toDisplayString(e.unref(_)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[11]||(C[11]=S=>H.value=S),placeholder:e.unref(_)("filter.searchAttributes")},null,8,e0),[[e.vModelText,H.value]]),e.createElementVNode("ul",t0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:K=>$e(S.key)},e.toDisplayString(S.label),9,l0))),128)),Ue.value.length===0?(e.openBlock(),e.createElementBlock("li",n0,e.toDisplayString(e.unref(_)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),ge.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:Le},e.toDisplayString(e.unref(_)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),s0={class:"dss-pill-field__pills"},r0=["disabled"],i0={class:"dss-pill-field__pill-text"},c0={key:0,class:"dss-pill-field__pill-actions"},u0=["onClick"],d0=["onClick"],m0=["placeholder","disabled"],p0=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(L,{emit:ae}){const B=L,_=ae,oe=e.ref(""),z=e.ref([...B.modelValue]),$=e.ref(null);let X=null;const Ke=e.ref(null),ve=e.ref(""),f=e.ref(null),be=e.computed(()=>new Set(z.value.map(R=>R.trim()).filter(Boolean)));function ge(R){$.value=R,X&&clearTimeout(X),X=setTimeout(()=>{$.value=null,X=null},900)}function ne(R){const pe=R.trim();return pe?be.value.has(pe)?(ge(pe),!1):(z.value=[...z.value,pe],_("update:modelValue",[...z.value]),!0):!1}function j(R){const pe=R.split(/\r?\n/g).map(gt=>gt.trim()).filter(Boolean);if(!pe.length)return;const fe=new Set(z.value.map(gt=>gt.trim()).filter(Boolean)),ie=[...z.value];let nt=null;for(const gt of pe){if(fe.has(gt)){nt??=gt;continue}fe.add(gt),ie.push(gt)}ie.length!==z.value.length&&(z.value=ie,_("update:modelValue",[...z.value])),nt&&ge(nt)}function ue(R){B.disabled||(Ke.value===R&&(Ke.value=null,ve.value=""),z.value=z.value.filter((pe,fe)=>fe!==R),_("update:modelValue",[...z.value]))}async function H(R){B.disabled||(Ke.value=R,ve.value=z.value[R]??"",await e.nextTick(),f.value?.focus(),f.value?.select())}function ke(){Ke.value=null,ve.value=""}function Me(){if(B.disabled||Ke.value===null)return;const R=Ke.value,pe=z.value[R]??"",fe=ve.value.trim();if(Ke.value=null,ve.value="",fe!==pe&&be.value.has(fe)){ge(fe);return}if(!fe){z.value=z.value.filter((nt,gt)=>gt!==R),_("update:modelValue",[...z.value]);return}const ie=z.value.map((nt,gt)=>gt===R?fe:nt);z.value=ie,_("update:modelValue",[...z.value])}function ze(R){R.preventDefault(),!B.disabled&&(ne(oe.value),oe.value="")}function lt(R){if(B.disabled)return;const pe=R.clipboardData?.getData("text")??"";!pe.includes(`
118
+ `)&&!pe.includes("\r")||(R.preventDefault(),j(pe),oe.value="")}return e.watch(()=>B.modelValue,R=>{z.value=Array.isArray(R)?[...R]:[]},{deep:!0}),e.onBeforeUnmount(()=>{X&&clearTimeout(X)}),(R,pe)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":R.disabled}])},[e.createElementVNode("div",s0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,(fe,ie)=>(e.openBlock(),e.createElementBlock("span",{key:fe,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":$.value===fe}])},[Ke.value===ie?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_for:!0,ref_key:"editInputEl",ref:f,"onUpdate:modelValue":pe[0]||(pe[0]=nt=>ve.value=nt),class:"dss-pill-field__pill-edit",type:"text",disabled:R.disabled,onKeydown:[e.withKeys(Me,["enter"]),e.withKeys(ke,["esc"])],onBlur:Me},null,40,r0)),[[e.vModelText,ve.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",i0,e.toDisplayString(fe),1),R.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",c0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:nt=>H(ie)},[...pe[2]||(pe[2]=[e.createElementVNode("svg",{class:"dss-pill-field__pill-action-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})],-1)])],8,u0),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:nt=>ue(ie)}," × ",8,d0)]))],64))],2))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":pe[1]||(pe[1]=fe=>oe.value=fe),class:"dss-pill-field__input",type:"text",placeholder:z.value.length?"":R.placeholder,disabled:R.disabled,onPaste:lt,onKeydown:e.withKeys(ze,["enter"])},null,40,m0),[[e.vModelText,oe.value]])])],2))}}),f0={class:"dss-step-bar__header"},v0={class:"dss-step-bar__label"},g0={class:"dss-step-bar__counter"},h0={class:"dss-step-bar__track-wrapper"},y0=["aria-valuemax","aria-valuenow","aria-label"],k0=["onMouseenter"],C0={__name:"DSSStepBar",props:{label:{type:String,default:"Progress"},steps:{type:Number,default:5},currentStep:{type:Number,default:0},segments:{type:Array,default:()=>[]},totalValue:{type:Number,default:null},activeColor:{type:String,default:"#34c759"},labelColor:{type:String,default:null},counterColor:{type:String,default:null},counterAsPercentage:{type:Boolean,default:!1},inactiveColor:{type:String,default:"#e5e7eb"},remainderLabel:{type:String,default:"Unused"}},setup(L){const ae=L,B=e.computed(()=>Math.max(1,Number(ae.steps)||1)),_=e.computed(()=>Math.min(B.value,Math.max(0,Number(ae.currentStep)||0))),oe=e.computed(()=>Array.isArray(ae.segments)&&ae.segments.length>0),z=e.computed(()=>oe.value?ae.segments.map((pe,fe)=>{const ie=Number(pe?.value);return{label:pe?.label||`Step ${fe+1}`,value:Number.isFinite(ie)&&ie>0?ie:0,color:pe?.color||ae.activeColor}}):[]),$=e.computed(()=>oe.value?z.value.reduce((pe,fe)=>pe+fe.value,0):_.value),X=e.computed(()=>oe.value?Number.isFinite(Number(ae.totalValue))&&Number(ae.totalValue)>0?Number(ae.totalValue):Math.max(1,$.value):B.value),Ke=e.computed(()=>oe.value&&Number.isFinite(Number(ae.totalValue))&&Number(ae.totalValue)>0),ve=e.computed(()=>Ke.value?Math.max(0,Number(ae.totalValue)-$.value):0),f=e.computed(()=>oe.value?Ke.value?z.value.filter(pe=>pe.value>0):z.value:[]),be=e.computed(()=>{if(!ae.counterAsPercentage)return`${$.value} / ${X.value}`;const pe=Number(X.value);if(!Number.isFinite(pe)||pe<=0)return"0%";const fe=Math.round(Number($.value)/pe*100);return`${Math.min(Math.max(fe,0),100)}%`}),ge=e.computed(()=>$.value),ne=e.computed(()=>X.value),j=e.reactive({visible:!1,x:0,content:""}),ue=e.computed(()=>({left:`${j.x}px`})),H=pe=>{if(Ke.value){const nt=Math.max(0,Number(pe.value)||0);return{flex:`${nt} 0 0`,minWidth:nt>0?"6px":"0",backgroundColor:pe.color}}const fe=$.value;return{flex:`${pe.value>0?pe.value:fe>0?1e-4:1} 0 0`,minWidth:"6px",backgroundColor:pe.color}},ke=e.computed(()=>({flex:`${ve.value} 0 0`,minWidth:ve.value>0?"6px":"0",backgroundColor:ae.inactiveColor})),Me=(pe,fe)=>{if(!pe||!fe?.currentTarget)return;const ie=fe.currentTarget;j.x=ie.offsetLeft+ie.offsetWidth/2,j.content=`${pe.label}: ${pe.value}`,j.visible=!0},ze=pe=>{if(!ve.value||!pe?.currentTarget)return;const fe=pe.currentTarget;j.x=fe.offsetLeft+fe.offsetWidth/2,j.content=`${ae.remainderLabel}: ${ve.value}`,j.visible=!0},lt=()=>{j.visible=!1},R=e.computed(()=>({"--dss-step-bar-label-color":ae.labelColor??void 0,"--dss-step-bar-counter-color":ae.counterColor??void 0,"--dss-step-bar-active-color":ae.activeColor,"--dss-step-bar-inactive-color":ae.inactiveColor}));return(pe,fe)=>(e.openBlock(),e.createElementBlock("div",{class:"dss-step-bar",style:e.normalizeStyle(R.value)},[e.createElementVNode("div",f0,[e.createElementVNode("span",v0,[e.renderSlot(pe.$slots,"label",{label:L.label},()=>[e.createTextVNode(e.toDisplayString(L.label),1)])]),e.createElementVNode("span",g0,e.toDisplayString(be.value),1)]),e.createElementVNode("div",h0,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":ne.value,"aria-valuenow":ge.value,"aria-label":L.label},[oe.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(ie,nt)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${nt}-${ie.label}`,class:"dss-step-bar__segment dss-step-bar__segment--interactive",style:e.normalizeStyle(H(ie)),onMouseenter:gt=>Me(ie,gt),onMouseleave:lt},null,44,k0))),128)),ve.value>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(ke.value),onMouseenter:fe[0]||(fe[0]=ie=>ze(ie)),onMouseleave:lt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(B.value,ie=>(e.openBlock(),e.createElementBlock("div",{key:ie,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":ie<=_.value}])},null,2))),128))],8,y0),j.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip",style:e.normalizeStyle(ue.value)},e.toDisplayString(j.content),5)):e.createCommentVNode("",!0)])],4))}},b0={contextMenu:{addMarker:"Add Marker",clearAllMarkers:"Clear All Markers",downloadSvg:"Download SVG",downloadPng:"Download PNG",downloadCsv:"Download CSV"},modalMarker:{editMarker:"Edit Marker",viewMarker:"View Marker",title:"Title",description:"Description",iconType:"Icon Type",defaultIcon:"Default Logo",iconPreview:"Icon Preview",deleteMarker:"Delete Marker",cancel:"Cancel",close:"Close",save:"Save",placeholderTitle:"Enter marker title",placeholderDescription:"Enter marker description (required)"},zoom:{doubleClickToReset:"(Double-click to reset)"},csv:{chartTitle:"Chart Title",chartSubtitle:"Chart Subtitle",generated:"Generated"},fallback:{item:"Item",axis:"Axis"},tooltip:{flags:"Flags",markers:"Markers",manualFlags:"Manual Flags",autoFlags:"Auto Flags"}},w0={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",currentPageAriaLabel:"Current page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",searchAriaLabel:"Search",searchTableAriaLabel:"Search table",clearSearchAriaLabel:"Clear search",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",expandRowAriaLabel:"Expand row",collapseRowAriaLabel:"Collapse row",filterColumnAriaLabel:"Filter column",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy",showingRange:"Showing {start}-{end} from {total}",ofPages:"of {total}",emptyMessage:"No data available"},x0={searchAcrossFields:"Search across all fields...",openAdvancedFilter:"Open advanced filter",closeAdvancedFilter:"Close advanced filter",noConditionsApplied:"No filter conditions are applied to this view",where:"Where",and:"And",searchAttributes:"Search attributes...",noMatch:"No match",enterValue:"Enter value...",min:"Min",max:"Max",search:"Search...",addFilter:"Add filter",clearAllFilters:"Clear all filters",select:"Select...",selectedCount:"{count} selected",operators:{contains:"contains",not_contains:"does not contain",equals:"equals",not_equals:"does not equal",starts_with:"starts with",ends_with:"ends with",is_empty:"is empty",is_not_empty:"is not empty",is_any_of:"is any of",is_none_of:"is none of",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"between",contains_any:"contains any of",contains_all:"contains all of",not_contains_any:"does not contain",before:"before",after:"after",is_true:"is true",is_false:"is false"}},E0={selectDate:"Select Date",selectRange:"Select range",startDate:"Start date",endDate:"End date",prevMonth:"Previous month",nextMonth:"Next month",quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",last3Months:"Last 3 months",last6Months:"Last 6 months",last12Months:"Last 12 months",lastYear:"Last year",allDates:"All dates",last2Dates:"Last 2 dates",last3Dates:"Last 3 dates",last4Dates:"Last 4 dates",last5Dates:"Last 5 dates"}},S0={toolbar:{undo:"Undo",redo:"Redo",paragraphFormat:"Paragraph Format",bold:"Bold",italic:"Italic",underline:"Underline",citation:"Citation",insertLink:"Insert Link",removeLink:"Remove Link",bulletList:"Bullet List",numberList:"Number List",image:"Image",comment:"Comment",askAi:"Ask AI"},paragraph:{heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",paragraph:"Paragraph"},link:{editLink:"Edit Link",altText:"Alt text:",url:"URL:",enterAltText:"Enter alt text...",enterUrl:"Enter URL...",cancel:"Cancel",save:"Save"},image:{addImage:"Add Image",editImage:"Edit Image",upload:"Upload",imageLink:"Image Link",uploadImage:"Upload image:",imageUrl:"Image URL:",altText:"Alt text:",width:"Width (px):",height:"Height (px):",enterAltText:"Enter alt text...",enterImageUrl:"https://example.com/image.jpg",auto:"Auto",noAlt:"No alt",cancel:"Cancel",save:"Save"},comment:{placeholder:"Add a comment",send:"Send",delete:"Delete comment"},started_conversation:"Started conversation",labels:{title:"Title",description:"Description"},placeholders:{title:"Enter title...",description:"Enter description...",startTyping:"Start typing..."},footer:{word:"word",words:"words",character:"character",characters:"characters"}},Qn={chart:b0,table:w0,filter:x0,datepicker:E0,textEditor:S0},V0={contextMenu:{addMarker:"Ajouter un marqueur",clearAllMarkers:"Effacer tous les marqueurs",downloadSvg:"Télécharger SVG",downloadPng:"Télécharger PNG",downloadCsv:"Télécharger CSV"},modalMarker:{editMarker:"Modifier le marqueur",viewMarker:"Voir le marqueur",title:"Titre",description:"Description",iconType:"Type d'icône",defaultIcon:"Logo par défaut",iconPreview:"Aperçu de l'icône",deleteMarker:"Supprimer le marqueur",cancel:"Annuler",close:"Fermer",save:"Enregistrer",placeholderTitle:"Entrez le titre du marqueur",placeholderDescription:"Entrez la description du marqueur (requise)"},zoom:{doubleClickToReset:"(Double-cliquez pour réinitialiser)"},csv:{chartTitle:"Titre du graphique",chartSubtitle:"Sous-titre du graphique",generated:"Généré"},fallback:{item:"Élément",axis:"Axe"},tooltip:{flags:"Drapeaux",markers:"Marqueurs",manualFlags:"Drapeaux manuels",autoFlags:"Drapeaux automatiques"}},N0={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",currentPageAriaLabel:"Page actuelle",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",searchAriaLabel:"Rechercher",searchTableAriaLabel:"Rechercher dans le tableau",clearSearchAriaLabel:"Effacer la recherche",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",expandRowAriaLabel:"Développer la ligne",collapseRowAriaLabel:"Réduire la ligne",filterColumnAriaLabel:"Filtrer la colonne",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa",showingRange:"Affichage de {start}-{end} sur {total}",ofPages:"sur {total}",emptyMessage:"Aucune donnée disponible"},B0={searchAcrossFields:"Rechercher dans tous les champs...",openAdvancedFilter:"Ouvrir le filtre avancé",closeAdvancedFilter:"Fermer le filtre avancé",noConditionsApplied:"Aucune condition de filtre n'est appliquée à cette vue",where:"Où",and:"Et",searchAttributes:"Rechercher des attributs...",noMatch:"Aucun résultat",enterValue:"Saisir une valeur...",min:"Min",max:"Max",search:"Rechercher...",addFilter:"Ajouter un filtre",clearAllFilters:"Effacer tous les filtres",select:"Sélectionner...",selectedCount:"{count} sélectionnés",operators:{contains:"contient",not_contains:"ne contient pas",equals:"est égal à",not_equals:"est différent de",starts_with:"commence par",ends_with:"se termine par",is_empty:"est vide",is_not_empty:"n'est pas vide",is_any_of:"est l'un de",is_none_of:"n'est aucun de",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"entre",contains_any:"contient l'un de",contains_all:"contient tous",not_contains_any:"ne contient pas",before:"avant",after:"après",is_true:"est vrai",is_false:"est faux"}},M0={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",startDate:"Date de début",endDate:"Date de fin",prevMonth:"Mois précédent",nextMonth:"Mois suivant",quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",last3Months:"3 derniers mois",last6Months:"6 derniers mois",last12Months:"12 derniers mois",lastYear:"Dernière année",allDates:"Toutes les dates",last2Dates:"2 dernières dates",last3Dates:"3 dernières dates",last4Dates:"4 dernières dates",last5Dates:"5 dernières dates"}},_0={toolbar:{undo:"Annuler",redo:"Rétablir",paragraphFormat:"Format de paragraphe",bold:"Gras",italic:"Italique",underline:"Souligné",citation:"Citation",insertLink:"Insérer un lien",removeLink:"Supprimer le lien",bulletList:"Liste à puces",numberList:"Liste numérotée",image:"Image",comment:"Commentaire",askAi:"Demander à l'IA"},paragraph:{heading1:"En-tête 1",heading2:"En-tête 2",heading3:"En-tête 3",heading4:"En-tête 4",heading5:"En-tête 5",heading6:"En-tête 6",paragraph:"Paragraphe"},link:{editLink:"Modifier le lien",altText:"Texte alternatif :",url:"URL :",enterAltText:"Entrez le texte alternatif...",enterUrl:"Entrez l'URL...",cancel:"Annuler",save:"Enregistrer"},image:{addImage:"Ajouter une image",editImage:"Modifier l'image",upload:"Télécharger",imageLink:"Lien de l'image",uploadImage:"Télécharger l'image :",imageUrl:"URL de l'image :",altText:"Texte alternatif :",width:"Largeur (px) :",height:"Hauteur (px) :",enterAltText:"Entrez le texte alternatif...",enterImageUrl:"https://exemple.com/image.jpg",auto:"Auto",noAlt:"Pas de texte alternatif",cancel:"Annuler",save:"Enregistrer"},comment:{placeholder:"Ajouter un commentaire",send:"Envoyer",delete:"Supprimer le commentaire"},started_conversation:"A démarré la conversation",labels:{title:"Titre",description:"Description"},placeholders:{title:"Entrez le titre...",description:"Entrez la description...",startTyping:"Commencez à taper..."},footer:{word:"mot",words:"mots",character:"caractère",characters:"caractères"}},Jn={chart:V0,table:N0,filter:B0,datepicker:M0,textEditor:_0},$0={contextMenu:{addMarker:"Markering toevoegen",clearAllMarkers:"Alle markeringen wissen",downloadSvg:"SVG downloaden",downloadPng:"PNG downloaden",downloadCsv:"CSV downloaden"},modalMarker:{editMarker:"Markering bewerken",viewMarker:"Markering bekijken",title:"Titel",description:"Beschrijving",iconType:"Pictogramtype",defaultIcon:"Standaard logo",iconPreview:"Pictogramvoorbeeld",deleteMarker:"Markering verwijderen",cancel:"Annuleren",close:"Sluiten",save:"Opslaan",placeholderTitle:"Voer markeringstitel in",placeholderDescription:"Voer markeringsbeschrijving in (optioneel)"},zoom:{doubleClickToReset:"(Dubbelklik om te resetten)"},csv:{chartTitle:"Grafiek titel",chartSubtitle:"Grafiek ondertitel",generated:"Gegenereerd"},fallback:{item:"Item",axis:"As"},tooltip:{flags:"Vlaggen",markers:"Markeringen",manualFlags:"Handmatige vlaggen",autoFlags:"Automatische vlaggen"}},L0={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",currentPageAriaLabel:"Huidige pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",searchAriaLabel:"Zoeken",searchTableAriaLabel:"Zoeken in tabel",clearSearchAriaLabel:"Zoekopdracht wissen",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",expandRowAriaLabel:"Rij uitklappen",collapseRowAriaLabel:"Rij inklappen",filterColumnAriaLabel:"Kolom filteren",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj",showingRange:"{start}-{end} van {total} weergegeven",ofPages:"van {total}",emptyMessage:"Geen gegevens beschikbaar"},T0={searchAcrossFields:"Zoeken in alle velden...",openAdvancedFilter:"Geavanceerde filter openen",closeAdvancedFilter:"Geavanceerde filter sluiten",noConditionsApplied:"Er zijn geen filtervoorwaarden toegepast op deze weergave",where:"Waar",and:"En",searchAttributes:"Zoek attributen...",noMatch:"Geen overeenkomst",enterValue:"Voer waarde in...",min:"Min",max:"Max",search:"Zoeken...",addFilter:"Filter toevoegen",clearAllFilters:"Alle filters wissen",select:"Selecteren...",selectedCount:"{count} geselecteerd",operators:{contains:"bevat",not_contains:"bevat niet",equals:"is gelijk aan",not_equals:"is niet gelijk aan",starts_with:"begint met",ends_with:"eindigt op",is_empty:"is leeg",is_not_empty:"is niet leeg",is_any_of:"is een van",is_none_of:"is geen van",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"tussen",contains_any:"bevat een van",contains_all:"bevat alle",not_contains_any:"bevat niet",before:"voor",after:"na",is_true:"is waar",is_false:"is onwaar"}},A0={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",last3Months:"Laatste 3 maanden",last6Months:"Laatste 6 maanden",last12Months:"Laatste 12 maanden",lastYear:"Afgelopen jaar",allDates:"Alle datums",last2Dates:"Laatste 2 datums",last3Dates:"Laatste 3 datums",last4Dates:"Laatste 4 datums",last5Dates:"Laatste 5 datums"}},D0={toolbar:{undo:"Ongedaan maken",redo:"Opnieuw",paragraphFormat:"Alineaopmaak",bold:"Vet",italic:"Cursief",underline:"Onderstreept",citation:"Citaat",insertLink:"Link invoegen",removeLink:"Link verwijderen",bulletList:"Lijst met opsommingstekens",numberList:"Genummerde lijst",image:"Afbeelding",comment:"Commentaar",askAi:"Vraag AI"},paragraph:{heading1:"Kop 1",heading2:"Kop 2",heading3:"Kop 3",heading4:"Kop 4",heading5:"Kop 5",heading6:"Kop 6",paragraph:"Alinea"},link:{editLink:"Link bewerken",altText:"Alt-tekst:",url:"URL:",enterAltText:"Voer alt-tekst in...",enterUrl:"Voer URL in...",cancel:"Annuleren",save:"Opslaan"},image:{addImage:"Afbeelding toevoegen",editImage:"Afbeelding bewerken",upload:"Uploaden",imageLink:"Afbeeldingslink",uploadImage:"Afbeelding uploaden:",imageUrl:"Afbeeldings-URL:",altText:"Alt-tekst:",width:"Breedte (px):",height:"Hoogte (px):",enterAltText:"Voer alt-tekst in...",enterImageUrl:"https://voorbeeld.com/afbeelding.jpg",auto:"Auto",noAlt:"Geen alt-tekst",cancel:"Annuleren",save:"Opslaan"},comment:{placeholder:"Voeg een opmerking toe",send:"Verzenden",delete:"Opmerking verwijderen"},started_conversation:"Gesprek gestart",labels:{title:"Titel",description:"Beschrijving"},placeholders:{title:"Voer titel in...",description:"Voer beschrijving in...",startTyping:"Begin met typen..."},footer:{word:"woord",words:"woorden",character:"teken",characters:"tekens"}},eo={chart:$0,table:L0,filter:T0,datepicker:A0,textEditor:D0},Mo={en:Qn,fr:Jn,nl:eo};function Ko(L){if(!L||!L.global)return;const ae=L.global.availableLocales||[];Object.keys(Mo).forEach(B=>{ae.includes(B)&&L.global.mergeLocaleMessage(B,Mo[B])})}const _o={en:{textEditor:Qn.textEditor},fr:{textEditor:Jn.textEditor},nl:{textEditor:eo.textEditor}};function Go(L){if(!L||!L.global)return;const ae=L.global.availableLocales||[];Object.keys(_o).forEach(B=>{ae.includes(B)&&L.global.mergeLocaleMessage(B,_o[B])})}const $o={en:{table:Qn.table},fr:{table:Jn.table},nl:{table:eo.table}};function Qo(L){if(!L||!L.global)return;const ae=L.global.availableLocales||[];Object.keys($o).forEach(B=>{ae.includes(B)&&L.global.mergeLocaleMessage(B,$o[B])})}const Lo={en:{datepicker:Qn.datepicker},fr:{datepicker:Jn.datepicker},nl:{datepicker:eo.datepicker}};function Jo(L){if(!L||!L.global)return;const ae=L.global.availableLocales||[];Object.keys(Lo).forEach(B=>{ae.includes(B)&&L.global.mergeLocaleMessage(B,Lo[B])})}const To={en:{filter:Qn.filter},fr:{filter:Jn.filter},nl:{filter:eo.filter}};function ea(L){if(!L||!L.global)return;const ae=L.global.availableLocales||[];Object.keys(To).forEach(B=>{ae.includes(B)&&L.global.mergeLocaleMessage(B,To[B])})}const H0={chart:Mo,textEditor:_o,table:$o,datepicker:Lo,filter:To};function R0(L){!L||!L.global||(Ko(L),Go(L),Qo(L),Jo(L),ea(L))}const I0={en:{...Qn},fr:{...Jn},nl:{...eo}};Gn.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:I0});exports.DSSChart=Ri;exports.DSSChartMessages=Mo;exports.DSSColorPicker=E2;exports.DSSConfetti=Q2;exports.DSSDatepicker=qo;exports.DSSDatepickerMessages=Lo;exports.DSSDnd=K2;exports.DSSFilter=a0;exports.DSSFilterMessages=To;exports.DSSLoader=R2;exports.DSSMessages=H0;exports.DSSModal=Oo;exports.DSSPillField=p0;exports.DSSSkeleton=I2;exports.DSSStepBar=C0;exports.DSSTable=au;exports.DSSTableMessages=$o;exports.DSSTextEditor=i2;exports.DSSTextEditorMessages=_o;exports.addDSSChartTranslations=Ko;exports.addDSSDatepickerTranslations=Jo;exports.addDSSFilterTranslations=ea;exports.addDSSTableTranslations=Qo;exports.addDSSTextEditorTranslations=Go;exports.addDSSTranslations=R0;