dsp-semactic 0.6.19 → 0.6.20

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"),no=require("vue-i18n"),Jo={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},ea=["value"],ta=["placeholder","value","disabled"],na=["placeholder","value"],la={key:0,class:"dss-datepicker__double-wrap"},oa={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},aa=["onClick"],sa={class:"dss-datepicker__double-calendars"},ra={class:"dss-datepicker__double-calendar"},ia={class:"dss-datepicker__calendar-header"},ca=["aria-label"],ua={class:"dss-datepicker__month-year-row"},da=["aria-label"],ma={class:"dss-datepicker__weekdays"},pa={class:"dss-datepicker__grid"},fa=["disabled","onClick","onMouseenter"],va={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},ga={class:"dss-datepicker__double-calendar"},ha={class:"dss-datepicker__calendar-header"},ya=["aria-label"],Ca={class:"dss-datepicker__month-year-row"},ka=["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"},Va={class:"dss-datepicker__calendar-header"},Na=["aria-label"],Sa={class:"dss-datepicker__month-year-row"},Ba=["aria-label"],Ma={class:"dss-datepicker__weekdays"},_a={class:"dss-datepicker__grid"},$a=["disabled","onClick","onMouseenter"],Ta={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},La={class:"dss-datepicker__calendar-header"},Ha={class:"dss-datepicker__month-year-row"},Aa={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Da={class:"dss-datepicker__months-grid"},Ra=["onClick"],Fa={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},Ia={class:"dss-datepicker__month-year"},za={class:"dss-datepicker__years-grid"},Pa=["data-year","onClick"],qo=27,zo={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:R=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(R)},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}},emits:["update:modelValue"],setup(R,{emit:ke}){const z=R,D=ke,{t:Me,locale:b}=no.useI18n(),Te=e.ref(!1),se=e.ref("days"),pt=new Date,p=e.computed(()=>z.minDate instanceof Date?z.minDate:pt),ue=e.ref(p.value.getMonth()),ve=e.ref(p.value.getFullYear()),de=e.ref(p.value.getMonth()),ee=e.ref(p.value.getFullYear()),S=e.ref(p.value.getMonth()),le=e.ref(p.value.getFullYear()),Le=e.ref("start"),Ae=e.ref(null),Re=e.ref(null);function O(){const A=p.value,X=A.getMonth(),I=A.getFullYear(),ne=X===11?0:X+1,Be=X===11?I+1:I;return{left:{month:X,year:I},right:{month:ne,year:Be}}}const ct=e.ref(null),Ie=e.ref(null),xe=e.ref(null),wt=e.ref(null),_t=e.ref(null),mt=e.ref(null),ze=new Date().getFullYear(),ge=e.computed(()=>["single","singleFromAvailable"].includes(z.mode)),gt=e.computed(()=>["range","rangeFromAvailable"].includes(z.mode)),Et=e.computed(()=>{if(z.mode!=="single"&&z.mode!=="singleFromAvailable")return null;const A=z.modelValue;return A instanceof Date?A:null}),st=e.computed(()=>{if(!gt.value)return{start:null,end:null};const A=z.modelValue;return!A||typeof A!="object"?{start:null,end:null}:{start:A.start instanceof Date?A.start:null,end:A.end instanceof Date?A.end:null}});function St(A){if(!A||!(A instanceof Date))return"";const X=A.getDate(),I=A.getMonth()+1,ne=A.getFullYear(),Be=nt=>String(nt).padStart(2,"0");return`${Be(X)}/${Be(I)}/${ne}`}const Wt=e.computed(()=>St(Et.value)),on=e.computed(()=>{const{start:A,end:X}=st.value;if(!A&&!X)return"";const I=!X||A&&A<=X?A:X,ne=!A||X&&X>=A?X:A;return q(I,ne)?St(I):`${St(I)} - ${St(ne)}`}),xt=e.computed(()=>{if(z.mode!=="readonly")return"—";const A=z.modelValue;if(A instanceof Date)return St(A)||"—";if(A&&typeof A=="object"&&("start"in A||"end"in A)){const X=A.start instanceof Date?A.start:null,I=A.end instanceof Date?A.end:null;if(!X&&!I)return"—";const ne=!I||X&&X<=I?X:I,Be=!X||I&&I>=X?I:X;return q(ne,Be)?St(ne):`${St(ne)} - ${St(Be)}`}return"—"});e.computed(()=>{const A=new Date(ve.value,ue.value,1);return new Intl.DateTimeFormat(b.value,{month:"long",year:"numeric"}).format(A)});const et=e.computed(()=>Re.value==="left"?de.value:Re.value==="right"?S.value:ue.value),Ye=e.computed(()=>Re.value==="left"?ee.value:Re.value==="right"?le.value:ve.value),Ft=e.computed(()=>{const A=new Date(ve.value,ue.value,1);return new Intl.DateTimeFormat(b.value,{month:"long"}).format(A)}),$t=e.computed(()=>{const A=new Date(Ye.value,et.value,1);return new Intl.DateTimeFormat(b.value,{month:"long"}).format(A)}),Bt=e.computed(()=>{const A=new Intl.DateTimeFormat(b.value,{month:"short"});return Array.from({length:12},(X,I)=>A.format(new Date(2024,I,1)))}),Ue=e.computed(()=>{const X=(Re.value?Ye.value:ve.value)-Math.floor(qo/2);return Array.from({length:qo},(I,ne)=>X+ne)}),Yt=e.computed(()=>{const A=Ue.value;return A.length?`${A[0]} – ${A[A.length-1]}`:""}),Ut=e.computed(()=>{const A=new Intl.DateTimeFormat(b.value,{weekday:"short"}),X=new Date(2024,0,1),I=[];for(let ne=0;ne<7;ne++){const Be=new Date(X);Be.setDate(X.getDate()+ne),I.push(A.format(Be).slice(0,2))}return I});function ht(A,X){const I=new Date(A,X,1),ne=new Date(A,X+1,0),Be=I.getDay(),nt=ne.getDate(),rt=[];for(let Oe=0;Oe<Be;Oe++)rt.push(null);for(let Oe=1;Oe<=nt;Oe++)rt.push(new Date(A,X,Oe));return rt}const te=e.computed(()=>ht(ve.value,ue.value)),_e=e.computed(()=>ht(ee.value,de.value)),fe=e.computed(()=>ht(le.value,S.value));e.computed(()=>{const A=new Date(ee.value,de.value,1);return new Intl.DateTimeFormat(b.value,{month:"long",year:"numeric"}).format(A)}),e.computed(()=>{const A=new Date(le.value,S.value,1);return new Intl.DateTimeFormat(b.value,{month:"long",year:"numeric"}).format(A)});const Se=e.computed(()=>{const A=new Date(ee.value,de.value,1);return new Intl.DateTimeFormat(b.value,{month:"long"}).format(A)}),Pe=e.computed(()=>{const A=new Date(le.value,S.value,1);return new Intl.DateTimeFormat(b.value,{month:"long"}).format(A)}),ft=e.computed(()=>z.availableDates&&z.availableDates.length>0),Ze=e.computed(()=>ft.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"}]),ut=e.ref({top:0,left:0});function Ee(){if(!wt.value||!Te.value)return;const A=wt.value.getBoundingClientRect(),X=window.innerWidth||document.documentElement.clientWidth,I=window.innerHeight||document.documentElement.clientHeight;let ne=A.left,Be=A.bottom+4;const nt=_t.value;if(nt){const rt=nt.offsetWidth,Oe=nt.offsetHeight;if(ne+rt>X-8&&(ne=A.right-rt,ne<8&&(ne=8)),Be+Oe>I-8){const ot=A.top-4-Oe;ot>=8?Be=ot:Be=Math.max(8,I-Oe-8)}}ut.value={top:Be,left:ne}}const Qe=e.computed(()=>!wt.value||!Te.value?{}:{position:"fixed",left:`${ut.value.left}px`,top:`${ut.value.top}px`,zIndex:1002});function q(A,X){return!A||!X?!1:A.getFullYear()===X.getFullYear()&&A.getMonth()===X.getMonth()&&A.getDate()===X.getDate()}function U(A){return new Date(A.getFullYear(),A.getMonth(),A.getDate()).getTime()}function K(A){return!z.availableDates||!z.availableDates.length?!0:z.availableDates.some(X=>X instanceof Date&&q(X,A))}function ie(A){const X=U(A);return!(z.minDate instanceof Date&&X<U(z.minDate)||z.maxDate instanceof Date&&X>U(z.maxDate))}function x(A){return!z.exceptDates||!z.exceptDates.length?!1:z.exceptDates.some(X=>X instanceof Date&&q(X,A))}function C(A){return x(A)?!1:["singleFromAvailable","rangeFromAvailable"].includes(z.mode)?K(A):ie(A)}function V(A){const X=Et.value,I=st.value,ne=U(A),Be=gt.value&&I.start&&I.end&&ne>U(I.start)&&ne<U(I.end),nt=gt.value&&I.start&&q(A,I.start),rt=gt.value&&I.end&&q(A,I.end),Oe=nt&&rt,ot=ge.value&&X&&q(A,X)||nt||rt;let sn=!1;if(gt.value&&I.start&&!I.end&&Ae.value){const Nn=U(I.start),nn=U(Ae.value),Hn=Math.min(Nn,nn),Cn=Math.max(Nn,nn);sn=ne>Hn&&ne<Cn}return{"dss-datepicker__day--selected":ot&&!Oe,"dss-datepicker__day--range-start":nt&&!Oe,"dss-datepicker__day--range-end":rt&&!Oe,"dss-datepicker__day--range-single":Oe,"dss-datepicker__day--in-range":Be&&!nt&&!rt,"dss-datepicker__day--in-range-preview":sn&&!nt&&!rt&&!Be,"dss-datepicker__day--disabled":!C(A)}}function P(A){if(!gt.value)return;const X=st.value;if(!X.start||X.end){Ae.value=null;return}if(!C(A)){Ae.value=null;return}Ae.value=new Date(A.getFullYear(),A.getMonth(),A.getDate())}function Y(){Ae.value=null}function Ve(){if(!z.doubleCalendar||!gt.value)return;const A=st.value,{start:X,end:I}=A;if(X&&I){const nt=X<=I?X:I,rt=X<=I?I:X,Oe=nt.getMonth(),ot=nt.getFullYear(),sn=rt.getMonth(),Nn=rt.getFullYear();if(Oe!==sn||ot!==Nn){const nn=de.value===Oe&&ee.value===ot,Hn=S.value===sn&&le.value===Nn;if(nn&&Hn)return;de.value=Oe,ee.value=ot,S.value=sn,le.value=Nn}else{const nn=Oe===0?11:Oe-1,Hn=Oe===0?ot-1:ot;de.value===nn&&ee.value===Hn&&S.value===Oe&&le.value===ot||(de.value=Oe,ee.value=ot,Oe===11?(S.value=0,le.value=ot+1):(S.value=Oe+1,le.value=ot))}return}const ne=X||I;if(ne){const nt=ne.getMonth(),rt=ne.getFullYear(),Oe=de.value===nt&&ee.value===rt,ot=S.value===nt&&le.value===rt;if(Oe||ot)return;de.value=nt,ee.value=rt,nt===11?(S.value=0,le.value=rt+1):(S.value=nt+1,le.value=rt);return}const Be=O();de.value=Be.left.month,ee.value=Be.left.year,S.value=Be.right.month,le.value=Be.right.year}function Je(A="start"){if(z.mode==="readonly")return;Le.value=A;const X=Et.value,I=st.value;if(ge.value&&X)ue.value=X.getMonth(),ve.value=X.getFullYear();else if(gt.value)if(z.doubleCalendar)Ve();else{const ne=A==="start"&&I.start?I.start:I.end||I.start;ne&&(ue.value=ne.getMonth(),ve.value=ne.getFullYear())}wt.value=ge.value?ct.value?.closest(".dss-datepicker__input-wrap"):Ie.value,se.value="days",Re.value=null,Te.value=!0,e.nextTick(()=>{Ee()})}function He(){se.value="days",Re.value=null,Ae.value=null,Te.value=!1}function oe(A,X){Re.value=A,se.value=X}function tt(){se.value="days",Re.value=null}function je(A){const X=new Date,I=X.getFullYear(),ne=X.getMonth(),Be=X.getDate();let nt,rt;if(ft.value){const Oe=[...z.availableDates].filter(ot=>ot instanceof Date).map(ot=>new Date(ot.getFullYear(),ot.getMonth(),ot.getDate()));if(Oe.sort((ot,sn)=>ot.getTime()-sn.getTime()),Oe.length===0)return;if(A==="all")nt=Oe[0],rt=Oe[Oe.length-1];else{const ot=parseInt(A.replace("last",""),10);if(ot<2||ot>5)return;const sn=Oe.slice(-ot);nt=sn[0],rt=sn[sn.length-1]}}else{const Oe=new Date(I,ne,Be);switch(A){case"today":nt=Oe,rt=Oe;break;case"lastWeek":nt=new Date(I,ne,Be-6),rt=Oe;break;case"last15Days":nt=new Date(I,ne,Be-14),rt=Oe;break;case"last30Days":nt=new Date(I,ne,Be-29),rt=Oe;break;case"thisMonth":nt=new Date(I,ne,1),rt=Oe;break;case"last3Months":nt=new Date(I,ne-3,1),rt=new Date(I,ne,0);break;case"last6Months":nt=new Date(I,ne-6,1),rt=new Date(I,ne,0);break;case"last12Months":nt=new Date(I,ne-12,1),rt=new Date(I,ne,0);break;case"lastYear":nt=new Date(I-1,0,1),rt=new Date(I-1,11,31);break;default:return}}D("update:modelValue",{start:nt,end:rt}),Ve()}function Vt(A){Re.value==="left"?de.value=A:Re.value==="right"?S.value=A:ue.value=A,tt()}function vt(A){Re.value==="left"?ee.value=A:Re.value==="right"?le.value=A:ve.value=A,tt()}function Ke(){ue.value===0?(ue.value=11,ve.value--):ue.value--}function Ht(){ue.value===11?(ue.value=0,ve.value++):ue.value++}function $n(){de.value===0?(de.value=11,ee.value--):de.value--}function Tn(){de.value===11?(de.value=0,ee.value++):de.value++}function cn(){S.value===0?(S.value=11,le.value--):S.value--}function yn(){S.value===11?(S.value=0,le.value++):S.value++}function an(A){if(!C(A))return;const X=new Date(A.getFullYear(),A.getMonth(),A.getDate());if(ge.value){D("update:modelValue",X),He();return}const I=st.value;if(!I.start&&!I.end){D("update:modelValue",{start:X,end:null}),Le.value="end";return}if(I.start&&I.end){D("update:modelValue",{start:X,end:null}),Le.value="end";return}if(Le.value==="start"){let ne=X,Be=I.end;ne&&Be&&ne>Be&&([ne,Be]=[Be,ne]),D("update:modelValue",{start:ne||Be,end:Be||ne}),Le.value="end"}else{let ne=I.start,Be=X;ne&&Be&&Be<ne&&([ne,Be]=[Be,ne]),D("update:modelValue",{start:ne||Be,end:Be||ne}),Le.value="start"}}e.watch(st,()=>{z.doubleCalendar&&gt.value&&Te.value&&Ve()},{deep:!0});let un=null,zn=null,Ln=null;function hl(){un&&(document.removeEventListener("keydown",un),un=null),zn&&(window.removeEventListener("resize",zn),zn=null),Ln&&(window.removeEventListener("scroll",Ln,!0),Ln=null)}return e.watch(se,A=>{A==="years"&&e.nextTick(()=>{mt.value?.querySelector(`[data-year="${Ye.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(Te,A=>{hl(),A&&(un=X=>{X.key==="Escape"&&(se.value==="years"||se.value==="months"?tt():He())},zn=()=>{Ee()},Ln=()=>{Ee()},document.addEventListener("keydown",un),window.addEventListener("resize",zn),window.addEventListener("scroll",Ln,!0))}),e.onBeforeUnmount(()=>{hl()}),(A,X)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":R.mode==="readonly"}])},[R.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",Jo,[X[10]||(X[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:xt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,ea)])):ge.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:X[0]||(X[0]=I=>Je("start"))},[X[11]||(X[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:ct,type:"text",class:"dss-datepicker__input",placeholder:e.unref(Me)("datepicker.selectDate"),value:Wt.value,readonly:"",disabled:R.mode==="readonly"},null,8,ta)])):gt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:Ie,onClick:X[1]||(X[1]=I=>Je("start"))},[X[12]||(X[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:xe,type:"text",class:"dss-datepicker__input",placeholder:e.unref(Me)("datepicker.selectRange"),value:on.value,readonly:""},null,8,na)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Te.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(He,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:_t,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":R.doubleCalendar&&gt.value&&se.value==="days","dss-datepicker__dropdown--quick-select":R.doubleCalendar&&gt.value&&se.value==="days"&&R.quickSelect}]),onClick:X[9]||(X[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Qe.value)},[se.value==="days"&&R.doubleCalendar&&gt.value?(e.openBlock(),e.createElementBlock("div",la,[R.quickSelect?(e.openBlock(),e.createElementBlock("nav",oa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,I=>(e.openBlock(),e.createElementBlock("button",{key:I.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:ne=>je(I.id)},e.toDisplayString(e.unref(Me)(I.labelKey)),9,aa))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",sa,[e.createElementVNode("div",ra,[e.createElementVNode("div",ia,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Me)("datepicker.prevMonth"),onClick:$n}," ‹ ",8,ca),e.createElementVNode("div",ua,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:X[2]||(X[2]=I=>oe("left","months"))},e.toDisplayString(Se.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:X[3]||(X[3]=I=>oe("left","years"))},e.toDisplayString(ee.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Me)("datepicker.nextMonth"),onClick:Tn}," › ",8,da)]),e.createElementVNode("div",ma,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,I=>(e.openBlock(),e.createElementBlock("span",{key:I,class:"dss-datepicker__weekday"},e.toDisplayString(I),1))),128))]),e.createElementVNode("div",pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_e.value,(I,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+ne},[I?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(I)]),disabled:!C(I),onClick:Be=>an(I),onMouseenter:Be=>P(I),onMouseleave:Y},e.toDisplayString(I.getDate()),43,fa)):(e.openBlock(),e.createElementBlock("span",va))],64))),128))])]),e.createElementVNode("div",ga,[e.createElementVNode("div",ha,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Me)("datepicker.prevMonth"),onClick:cn}," ‹ ",8,ya),e.createElementVNode("div",Ca,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:X[4]||(X[4]=I=>oe("right","months"))},e.toDisplayString(Pe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:X[5]||(X[5]=I=>oe("right","years"))},e.toDisplayString(le.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Me)("datepicker.nextMonth"),onClick:yn}," › ",8,ka)]),e.createElementVNode("div",ba,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,I=>(e.openBlock(),e.createElementBlock("span",{key:I,class:"dss-datepicker__weekday"},e.toDisplayString(I),1))),128))]),e.createElementVNode("div",wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(I,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+ne},[I?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(I)]),disabled:!C(I),onClick:Be=>an(I),onMouseenter:Be=>P(I),onMouseleave:Y},e.toDisplayString(I.getDate()),43,xa)):(e.openBlock(),e.createElementBlock("span",Ea))],64))),128))])])])])):se.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Va,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Me)("datepicker.prevMonth"),onClick:Ke}," ‹ ",8,Na),e.createElementVNode("div",Sa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:X[6]||(X[6]=I=>se.value="months")},e.toDisplayString(Ft.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:X[7]||(X[7]=I=>se.value="years")},e.toDisplayString(ve.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Me)("datepicker.nextMonth"),onClick:Ht}," › ",8,Ba)]),e.createElementVNode("div",Ma,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,I=>(e.openBlock(),e.createElementBlock("span",{key:I,class:"dss-datepicker__weekday"},e.toDisplayString(I),1))),128))]),e.createElementVNode("div",_a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(I,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ne},[I?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(I)]),disabled:!C(I),onClick:Be=>an(I),onMouseenter:Be=>P(I),onMouseleave:Y},e.toDisplayString(I.getDate()),43,$a)):(e.openBlock(),e.createElementBlock("span",Ta))],64))),128))])],64)):se.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",La,[e.createElementVNode("div",Ha,[e.createElementVNode("span",Aa,e.toDisplayString($t.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:X[8]||(X[8]=I=>se.value="years")},e.toDisplayString(Ye.value),1)])]),e.createElementVNode("div",Da,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bt.value,(I,ne)=>(e.openBlock(),e.createElementBlock("button",{key:ne,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":ne===et.value}]),onClick:Be=>Vt(ne)},e.toDisplayString(I),11,Ra))),128))])],64)):se.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Fa,[e.createElementVNode("span",Ia,e.toDisplayString(Yt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:mt},[e.createElementVNode("div",za,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,I=>(e.openBlock(),e.createElementBlock("button",{key:I,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":I===Ye.value,"dss-datepicker__year-cell--current":I===e.unref(ze)}]),"data-year":I,onClick:ne=>vt(I)},e.toDisplayString(I),11,Pa))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Oa=["data-chart-type"],Za={class:"dss-chart-header-titles"},Wa={key:0,class:"dss-chart-title"},qa={key:1,class:"dss-chart-subtitle"},Ua=["onClick","onMouseenter"],Xa={class:"dss-legend-text"},Ya=["onClick","onMouseenter"],ja={class:"dss-legend-text"},Ka=["title"],Ga=["src"],Qa={class:"dss-chart-area-wrapper"},Ja={key:0,class:"dss-chart-z-axis-label"},es=["width","height","data-smooth","data-animated"],ts={id:"chart-clip"},ns=["y","width","height"],ls=["id"],os=["d"],as=["id"],ss=["d"],rs={key:0},is={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},cs=["x1","x2","y1","y2"],us={class:"dss-axes"},ds=["x1","x2","y1","y2"],ms=["x1","x2","y1","y2"],ps={class:"dss-axis-labels"},fs=["x","y"],vs=["x","y"],gs=["x","y"],hs=["y","transform"],ys={key:1,class:"dss-flag-markers"},Cs={"clip-path":"url(#chart-clip)"},ks=["x1","x2","y1","y2","onMouseover"],bs=["x1","x2","y1","y2","onMouseover"],ws=["x1","x2","y1","y2","onMouseover"],xs=["cx","cy","onMouseover"],Es=["cx","cy","fill","onMouseover"],Vs=["x","y"],Ns={class:"dss-chart-data","clip-path":"url(#chart-clip)"},Ss={key:0},Bs=["d","onMouseover"],Ms=["x","y","width","height","fill","onMouseover"],_s={class:"dss-line-chart"},$s=["d","stroke","stroke-width"],Ts=["d","stroke","stroke-width","opacity"],Ls=["cx","cy","r","fill","onMouseover"],Hs={key:1},As=["d","stroke","stroke-width"],Ds=["d","stroke","stroke-width"],Rs=["d","stroke","stroke-width","opacity"],Fs=["cx","cy","r","fill","onMouseover"],Is={key:2},zs=["id"],Ps=["x","y","width","height"],Os=["d","fill","fill-opacity","mask"],Zs=["d","stroke","stroke-width"],Ws=["d","fill","onMouseover"],qs=["x","y","width","height","onMouseover"],Us={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},Xs=["x1","x2","y1","y2","stroke"],Ys=["cx","cy","r","fill"],js={key:1,class:"dss-bubble-chart"},Ks={key:0,class:"dss-bubble-group"},Gs=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Qs=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Js=["transform"],er=["cx","cy","r"],tr=["data-chart-type","clip-path"],nr=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],lr={key:1,class:"dss-radial-segment-data-labels"},or=["x","y"],ar=["x","y","font-size","fill"],sr=["x1","y1","x2","y2","stroke"],rr=["x1","y1","x2","y2","stroke"],ir=["x","y","text-anchor","font-size"],cr=["transform"],ur={key:0,class:"dss-spider-grid"},dr=["cx","cy","r"],mr={class:"dss-spider-grid-labels"},pr=["x","y"],fr=["x","y"],vr=["x1","x2","y1","y2"],gr={class:"dss-spider-labels"},hr=["x","y","text-anchor","dominant-baseline"],yr=["points","fill","fill-opacity","stroke","stroke-width"],Cr=["cx","cy","r","fill","onMouseover"],kr={class:"dss-chart-logos"},br=["cx","cy","r","fill"],wr=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],xr=["onClick","onMouseenter"],Er=["src"],Vr={class:"dss-marker-tooltip-category"},Nr={key:0,class:"dss-marker-tooltip-description"},Sr={key:0,class:"dss-tooltip-section"},Br={key:0,class:"dss-tooltip-title"},Mr={class:"dss-tooltip-series-name"},_r={class:"dss-tooltip-series-value"},$r={key:1,class:"dss-tooltip-section"},Tr={key:0,class:"dss-tooltip-title"},Lr={class:"dss-bubble-tooltip-data"},Hr={key:2,class:"dss-tooltip-section"},Ar={class:"dss-tooltip-title"},Dr={class:"dss-tooltip-value"},Rr={key:0,class:"dss-tooltip-section"},Fr={class:"dss-tooltip-section-title"},Ir={class:"dss-tooltip-group-header"},zr={class:"dss-tooltip-item-content"},Pr={class:"dss-tooltip-item-text"},Or={key:1,class:"dss-tooltip-section"},Zr={class:"dss-tooltip-section-title"},Wr={class:"dss-tooltip-item-content"},qr={class:"dss-tooltip-item-title"},Ur={key:0,class:"dss-tooltip-item-description"},Xr={class:"dss-tooltip-section"},Yr={class:"dss-tooltip-title"},jr={key:0,class:"dss-bubble-tooltip-data"},Kr={class:"dss-tooltip-series-name"},Gr={class:"dss-tooltip-series-value"},Qr={key:0,class:"dss-tooltip-section"},Jr={class:"dss-tooltip-section-title"},ei={class:"dss-tooltip-group-header"},ti={class:"dss-tooltip-item-content"},ni={class:"dss-tooltip-item-text"},li={key:1,class:"dss-tooltip-section"},oi={class:"dss-tooltip-section-title"},ai={class:"dss-tooltip-item-content"},si={class:"dss-tooltip-item-title"},ri={key:0,class:"dss-tooltip-item-description"},ii={key:1,class:"dss-context-menu-separator"},ci={key:0,class:"dss-context-menu-separator"},ui={key:0,class:"dss-context-menu-separator"},di=["onClick"],mi=["innerHTML"],pi={key:0,class:"dss-context-menu-icon"},fi={class:"dss-marker-modal-header"},vi={class:"dss-marker-modal-body"},gi={class:"dss-form-group"},hi={class:"dss-form-group"},yi={for:"dss-marker-description"},Ci={key:0,class:"dss-form-text-display"},ki=["placeholder"],bi={class:"dss-marker-modal-footer"},wi={class:"modal-footer-left"},xi={class:"dss-modal-footer-right"},Ei=["disabled"],Vi={name:"DSSChart"},Ni=Object.assign(Vi,{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:R=>typeof R=="object"&&R!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(R,{emit:ke}){const{t:z,locale:D}=no.useI18n(),Me=ke,b=e.ref(null),Te=e.ref(null),se=e.ref(null),pt=e.ref(0),p=e.ref(0);let ue=null,ve=null;const de=20,ee=e.computed(()=>{if(p.value,pt.value,!b.value||!Te.value)return 0;try{const t=b.value.getBoundingClientRect();return Te.value.getBoundingClientRect().top-t.top}catch{return 0}}),S=R,le={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 Le(t,s){const n=Object.assign({},t);return Re(t)&&Re(s)&&Object.keys(s).forEach(i=>{Re(s[i])?i in t?n[i]=Le(t[i],s[i]):Object.assign(n,{[i]:s[i]}):Object.assign(n,{[i]:s[i]})}),n}const Ae=()=>{let t=20,s=0,n=0;if(Et.value&&(t+=30),st.value&&(t+=25),Bt.value&&S.series.length>0){const i=S.series.filter((f,g)=>!At.value.has(g)).length;if(Ue.value==="top"||Ue.value==="bottom"){if(Yt.value==="horizontal"){const g=Math.floor(xe.value/100);s=Math.ceil(i/g)*25+10}else s=i*25+10;t+=s}else n=150}return{height:t,legendHeight:s,legendWidth:n}};function Re(t){return t&&typeof t=="object"&&!Array.isArray(t)}const O=e.computed(()=>Le(le,S.options)),ct=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.width==="auto"}),Ie=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.height==="auto"}),xe=e.computed(()=>{const t=O.value;return ct.value?pt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),wt=e.ref(de),_t=e.computed(()=>{if(Ie.value){const t=_t.value;return t??Math.max(0,(p.value||400)-wt.value*5)}}),mt=e.computed(()=>{const t=O.value;if(Ie.value){const s=_t.value;return s??Math.max(0,(p.value||400)-wt.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),ze=e.computed(()=>Ie.value&&ge.value==="semi-radial"&&_t.value!=null?wt.value+mt.value+"px":Ie.value?"100%":pn.value?wt.value+mt.value+"px":mt.value+(Bt.value?20:0)+"px"),ge=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),gt=e.computed(()=>{const t=S.series.map(s=>s.type||ge.value);return new Set(t).size>1}),Et=e.computed(()=>{const t=O.value;return t&&t.title&&t.title.text?t.title.text:""}),st=e.computed(()=>{const t=O.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),St=e.computed(()=>{const t=O.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),Wt=e.computed(()=>{const t=O.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),on=e.computed(()=>{const t=O.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),xt=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return Xn;const s=t.yAxis.min;return typeof s=="number"||s===Xn?s:Xn}),et=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return Xn;const s=t.yAxis.max;return typeof s=="number"||s===Xn?s:Xn}),Ye=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Ft=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),$t=e.computed(()=>{const t=O.value;return t&&t.grid&&t.grid.show!==!1}),Bt=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.show!==!1}),Ue=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Yt=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Ut=e.computed(()=>{const t=O.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),ht=e.computed(()=>{const t=O.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),te=e.computed(()=>{const t=O.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),_e=e.computed(()=>{const t=O.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),fe=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Se=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Pe=e.computed(()=>{const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),ft=e.computed(()=>{if(!pn.value)return 0;const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),Ze=e.computed(()=>{const t=O.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),ut=e.computed(()=>{const{maxX:t}=zt.value;return t===0}),Ee=(t,s)=>ut.value&&s===0?5:s,Qe=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),q=e.computed(()=>{const t=O.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),U=e.computed(()=>{const t=O.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),K=e.computed(()=>{const t=O.value;return q.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),ie=e.computed(()=>{const t=O.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),x=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.enabled!==!1}),C=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),V=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),P=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),Y=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Ve=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),Je=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.onDataChange!==!1}),He=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),oe=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),tt=e.computed(()=>O.value?.spider?.gridSteps||5),je=e.computed(()=>{const t=[],s=tt.value;for(let n=1;n<=s;n++)t.push(at.value/s*n);return t}),Vt=t=>{const s=vt.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const n=je.value[t];return Math.round(n/at.value*100)+"%"},vt=e.computed(()=>O.value?.spider?.gridLabels||null),Ke=e.computed(()=>{const t=O.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Ht=e.computed(()=>{const t=O.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),$n=e.computed(()=>{const t=O.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Tn=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.icon?t.markers.icon:ot.value}),cn=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),yn=e.computed(()=>{const t=O.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),an=e.computed(()=>{const s=O.value?.valueFormat?.extension;return typeof s=="string"?s:""}),un=t=>{const s=an.value;if(t==null)return"";const n=String(t);return s?n+s:n},zn=e.computed(()=>!Z.value.isZooming);e.computed(()=>Tt.value.map(t=>{if(t.categoryIndex!==void 0&&(rn.value||Pt.value)){const s=Zt(t.categoryIndex),n=ee.value+F.value.bottom-yn.value/2;return{...t,x:s,y:n}}return t}));function Ln(t,s){let n;if(t instanceof Date)n=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,E,k]=t.split("-"),L=Number(k?.length===2?`20${k}`:k);n=new Date(L,Number(E)-1,Number(g))}else return 0;let i=0,f=1/0;return s.forEach((g,E)=>{const[k,L,T]=g.split("-"),H=Number(T?.length===2?`20${T}`:T),M=new Date(H,Number(L)-1,Number(k)),G=Math.abs(M-n);G<f&&(f=G,i=E)}),i}const hl=e.computed(()=>{const t=S.markers.map(n=>{const i=Ln(n.marker_date,S.categories),f=Zt(i),g=ee.value+F.value.bottom-yn.value/2;return{...n,x:f,y:g,categoryIndex:i,source:"props"}}),s=Tt.value.map(n=>{if(n.categoryIndex!==void 0&&(rn.value||Pt.value)){const i=Zt(n.categoryIndex),f=ee.value+F.value.bottom-yn.value/2;return{...n,x:i,y:f,source:"internal"}}return{...n,source:"internal"}});return[...t,...s]}),A=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.enabled===!0}),X=e.computed(()=>{const t=O.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),I=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),ne=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),Be=e.computed(()=>{const t={left:F.value.left,top:F.value.top,width:F.value.width,height:F.value.height};let s,n;const i=String(I.value);if(i.includes("%")){const f=parseFloat(i)/100;s=t.width*f,n=s*(96/499)}else{const f=parseFloat(i)||25;s=Math.min(t.width*.25,200)*(f/25),n=s*(96/499)}return{width:s,height:n,area:t}}),nt=e.computed(()=>{const{width:t,height:s}=Be.value,n=ne.value;let i,f;const g=F.value.left,E=F.value.right,k=F.value.top,L=F.value.bottom,T=F.value.width,H=F.value.height;switch(n){case"center":i=g+(T-t)/2,f=k+(H-s)/2;break;case"top-left":i=g+15,f=k+5;break;case"top-right":i=E-t-15,f=k+5;break;case"bottom-left":i=g+15,f=L-s-5;break;case"bottom-right":default:i=E-t-15,f=L-s-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:f+"px",backgroundSize:`${t}px ${s}px`}}),rt=t=>!S.flags||!S.flags.length?[]:S.flags.filter(s=>s.categoryIndex===t),Oe=t=>{const s=rt(t),n=ro(t),i=s.filter(E=>E.manual),f=s.filter(E=>!E.manual),g=[];return i.length>0&&g.push({type:z("chart.tooltip.manualFlags"),color:"#047395",flags:i.map(E=>({text:E.text,color:"#047395"}))}),f.length>0&&g.push({type:z("chart.tooltip.autoFlags"),color:"#0dbf89",flags:f.map(E=>({text:E.text,color:"#0dbf89"}))}),{flagGroups:g,markers:n.map(E=>({title:E.title,description:E.description,type:z("chart.tooltip.markers"),color:E.color||"#FF6B6B"}))}},ot=e.computed(()=>{const t=S.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"),lo=require("vue-i18n"),ea={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},ta=["value"],na=["placeholder","value","disabled"],la=["placeholder","value"],oa={key:0,class:"dss-datepicker__double-wrap"},aa={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},sa=["onClick"],ra={class:"dss-datepicker__double-calendars"},ia={class:"dss-datepicker__double-calendar"},ca={class:"dss-datepicker__calendar-header"},ua=["aria-label"],da={class:"dss-datepicker__month-year-row"},ma=["aria-label"],pa={class:"dss-datepicker__weekdays"},fa={class:"dss-datepicker__grid"},va=["disabled","onClick","onMouseenter"],ga={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},ha={class:"dss-datepicker__double-calendar"},ya={class:"dss-datepicker__calendar-header"},Ca=["aria-label"],ka={class:"dss-datepicker__month-year-row"},ba=["aria-label"],wa={class:"dss-datepicker__weekdays"},xa={class:"dss-datepicker__grid"},Ea=["disabled","onClick","onMouseenter"],Va={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Na={class:"dss-datepicker__calendar-header"},Sa=["aria-label"],Ba={class:"dss-datepicker__month-year-row"},Ma=["aria-label"],_a={class:"dss-datepicker__weekdays"},$a={class:"dss-datepicker__grid"},Ta=["disabled","onClick","onMouseenter"],La={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ha={class:"dss-datepicker__calendar-header"},Aa={class:"dss-datepicker__month-year-row"},Da={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Ra={class:"dss-datepicker__months-grid"},Fa=["onClick"],Ia={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},za={class:"dss-datepicker__month-year"},Pa={class:"dss-datepicker__years-grid"},Oa=["data-year","onClick"],Uo=27,zo={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:F=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(F)},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}},emits:["update:modelValue"],setup(F,{emit:Ce}){const z=F,A=Ce,{t:_e,locale:b}=lo.useI18n(),Le=e.ref(!1),ae=e.ref("days"),pt=new Date,p=e.computed(()=>z.minDate instanceof Date?z.minDate:pt),ue=e.ref(p.value.getMonth()),ve=e.ref(p.value.getFullYear()),de=e.ref(p.value.getMonth()),ee=e.ref(p.value.getFullYear()),S=e.ref(p.value.getMonth()),ne=e.ref(p.value.getFullYear()),He=e.ref("start"),De=e.ref(null),Ie=e.ref(null);function O(){const D=p.value,q=D.getMonth(),R=D.getFullYear(),le=q===11?0:q+1,Be=q===11?R+1:R;return{left:{month:q,year:R},right:{month:le,year:Be}}}const rt=e.ref(null),Oe=e.ref(null),we=e.ref(null),xt=e.ref(null),Tt=e.ref(null),mt=e.ref(null),Ze=new Date().getFullYear(),ge=e.computed(()=>["single","singleFromAvailable"].includes(z.mode)),yt=e.computed(()=>["range","rangeFromAvailable"].includes(z.mode)),Vt=e.computed(()=>{if(z.mode!=="single"&&z.mode!=="singleFromAvailable")return null;const D=z.modelValue;return D instanceof Date?D:null}),at=e.computed(()=>{if(!yt.value)return{start:null,end:null};const D=z.modelValue;return!D||typeof D!="object"?{start:null,end:null}:{start:D.start instanceof Date?D.start:null,end:D.end instanceof Date?D.end:null}});function _t(D){if(!D||!(D instanceof Date))return"";const q=D.getDate(),R=D.getMonth()+1,le=D.getFullYear(),Be=nt=>String(nt).padStart(2,"0");return`${Be(q)}/${Be(R)}/${le}`}const Ot=e.computed(()=>_t(Vt.value)),on=e.computed(()=>{const{start:D,end:q}=at.value;if(!D&&!q)return"";const R=!q||D&&D<=q?D:q,le=!D||q&&q>=D?q:D;return X(R,le)?_t(R):`${_t(R)} - ${_t(le)}`}),Et=e.computed(()=>{if(z.mode!=="readonly")return"—";const D=z.modelValue;if(D instanceof Date)return _t(D)||"—";if(D&&typeof D=="object"&&("start"in D||"end"in D)){const q=D.start instanceof Date?D.start:null,R=D.end instanceof Date?D.end:null;if(!q&&!R)return"—";const le=!R||q&&q<=R?q:R,Be=!q||R&&R>=q?R:q;return X(le,Be)?_t(le):`${_t(le)} - ${_t(Be)}`}return"—"});e.computed(()=>{const D=new Date(ve.value,ue.value,1);return new Intl.DateTimeFormat(b.value,{month:"long",year:"numeric"}).format(D)});const lt=e.computed(()=>Ie.value==="left"?de.value:Ie.value==="right"?S.value:ue.value),je=e.computed(()=>Ie.value==="left"?ee.value:Ie.value==="right"?ne.value:ve.value),Dt=e.computed(()=>{const D=new Date(ve.value,ue.value,1);return new Intl.DateTimeFormat(b.value,{month:"long"}).format(D)}),Lt=e.computed(()=>{const D=new Date(je.value,lt.value,1);return new Intl.DateTimeFormat(b.value,{month:"long"}).format(D)}),$t=e.computed(()=>{const D=new Intl.DateTimeFormat(b.value,{month:"short"});return Array.from({length:12},(q,R)=>D.format(new Date(2024,R,1)))}),Xe=e.computed(()=>{const q=(Ie.value?je.value:ve.value)-Math.floor(Uo/2);return Array.from({length:Uo},(R,le)=>q+le)}),Gt=e.computed(()=>{const D=Xe.value;return D.length?`${D[0]} – ${D[D.length-1]}`:""}),Xt=e.computed(()=>{const D=new Intl.DateTimeFormat(b.value,{weekday:"short"}),q=new Date(2024,0,1),R=[];for(let le=0;le<7;le++){const Be=new Date(q);Be.setDate(q.getDate()+le),R.push(D.format(Be).slice(0,2))}return R});function Ct(D,q){const R=new Date(D,q,1),le=new Date(D,q+1,0),Be=R.getDay(),nt=le.getDate(),st=[];for(let Qe=0;Qe<Be;Qe++)st.push(null);for(let Qe=1;Qe<=nt;Qe++)st.push(new Date(D,q,Qe));return st}const te=e.computed(()=>Ct(ve.value,ue.value)),$e=e.computed(()=>Ct(ee.value,de.value)),fe=e.computed(()=>Ct(ne.value,S.value));e.computed(()=>{const D=new Date(ee.value,de.value,1);return new Intl.DateTimeFormat(b.value,{month:"long",year:"numeric"}).format(D)}),e.computed(()=>{const D=new Date(ne.value,S.value,1);return new Intl.DateTimeFormat(b.value,{month:"long",year:"numeric"}).format(D)});const Ve=e.computed(()=>{const D=new Date(ee.value,de.value,1);return new Intl.DateTimeFormat(b.value,{month:"long"}).format(D)}),We=e.computed(()=>{const D=new Date(ne.value,S.value,1);return new Intl.DateTimeFormat(b.value,{month:"long"}).format(D)}),ft=e.computed(()=>z.availableDates&&z.availableDates.length>0),qe=e.computed(()=>ft.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"}]),ut=e.ref({top:0,left:0});function xe(){if(!xt.value||!Le.value)return;const D=xt.value.getBoundingClientRect(),q=window.innerWidth||document.documentElement.clientWidth,R=window.innerHeight||document.documentElement.clientHeight;let le=D.left,Be=D.bottom+4;const nt=Tt.value;if(nt){const st=nt.offsetWidth,Qe=nt.offsetHeight;if(le+st>q-8&&(le=D.right-st,le<8&&(le=8)),Be+Qe>R-8){const Ke=D.top-4-Qe;Ke>=8?Be=Ke:Be=Math.max(8,R-Qe-8)}}ut.value={top:Be,left:le}}const Ue=e.computed(()=>!xt.value||!Le.value?{}:{position:"fixed",left:`${ut.value.left}px`,top:`${ut.value.top}px`,zIndex:1002});function X(D,q){return!D||!q?!1:D.getFullYear()===q.getFullYear()&&D.getMonth()===q.getMonth()&&D.getDate()===q.getDate()}function Z(D){return new Date(D.getFullYear(),D.getMonth(),D.getDate()).getTime()}function j(D){return!z.availableDates||!z.availableDates.length?!0:z.availableDates.some(q=>q instanceof Date&&X(q,D))}function ie(D){const q=Z(D);return!(z.minDate instanceof Date&&q<Z(z.minDate)||z.maxDate instanceof Date&&q>Z(z.maxDate))}function E(D){return!z.exceptDates||!z.exceptDates.length?!1:z.exceptDates.some(q=>q instanceof Date&&X(q,D))}function C(D){return E(D)?!1:["singleFromAvailable","rangeFromAvailable"].includes(z.mode)?j(D):ie(D)}function V(D){const q=Vt.value,R=at.value,le=Z(D),Be=yt.value&&R.start&&R.end&&le>Z(R.start)&&le<Z(R.end),nt=yt.value&&R.start&&X(D,R.start),st=yt.value&&R.end&&X(D,R.end),Qe=nt&&st,Ke=ge.value&&q&&X(D,q)||nt||st;let dn=!1;if(yt.value&&R.start&&!R.end&&De.value){const Ln=Z(R.start),tn=Z(De.value),Hn=Math.min(Ln,tn),wn=Math.max(Ln,tn);dn=le>Hn&&le<wn}return{"dss-datepicker__day--selected":Ke&&!Qe,"dss-datepicker__day--range-start":nt&&!Qe,"dss-datepicker__day--range-end":st&&!Qe,"dss-datepicker__day--range-single":Qe,"dss-datepicker__day--in-range":Be&&!nt&&!st,"dss-datepicker__day--in-range-preview":dn&&!nt&&!st&&!Be,"dss-datepicker__day--disabled":!C(D)}}function P(D){if(!yt.value)return;const q=at.value;if(!q.start||q.end){De.value=null;return}if(!C(D)){De.value=null;return}De.value=new Date(D.getFullYear(),D.getMonth(),D.getDate())}function U(){De.value=null}function ze(){if(!z.doubleCalendar||!yt.value)return;const D=at.value,{start:q,end:R}=D;if(q&&R){const nt=q<=R?q:R,st=q<=R?R:q,Qe=nt.getMonth(),Ke=nt.getFullYear(),dn=st.getMonth(),Ln=st.getFullYear();if(Qe!==dn||Ke!==Ln){const tn=de.value===Qe&&ee.value===Ke,Hn=S.value===dn&&ne.value===Ln;if(tn&&Hn)return;de.value=Qe,ee.value=Ke,S.value=dn,ne.value=Ln}else{const tn=Qe===0?11:Qe-1,Hn=Qe===0?Ke-1:Ke;de.value===tn&&ee.value===Hn&&S.value===Qe&&ne.value===Ke||(de.value=Qe,ee.value=Ke,Qe===11?(S.value=0,ne.value=Ke+1):(S.value=Qe+1,ne.value=Ke))}return}const le=q||R;if(le){const nt=le.getMonth(),st=le.getFullYear(),Qe=de.value===nt&&ee.value===st,Ke=S.value===nt&&ne.value===st;if(Qe||Ke)return;de.value=nt,ee.value=st,nt===11?(S.value=0,ne.value=st+1):(S.value=nt+1,ne.value=st);return}const Be=O();de.value=Be.left.month,ee.value=Be.left.year,S.value=Be.right.month,ne.value=Be.right.year}function Re(D="start"){if(z.mode==="readonly")return;He.value=D;const q=Vt.value,R=at.value;if(ge.value&&q)ue.value=q.getMonth(),ve.value=q.getFullYear();else if(yt.value)if(z.doubleCalendar)ze();else{const le=D==="start"&&R.start?R.start:R.end||R.start;le&&(ue.value=le.getMonth(),ve.value=le.getFullYear())}xt.value=ge.value?rt.value?.closest(".dss-datepicker__input-wrap"):Oe.value,ae.value="days",Ie.value=null,Le.value=!0,e.nextTick(()=>{xe()})}function Ae(){ae.value="days",Ie.value=null,De.value=null,Le.value=!1}function re(D,q){Ie.value=D,ae.value=q}function Ge(){ae.value="days",Ie.value=null}function tt(D){const q=new Date,R=q.getFullYear(),le=q.getMonth(),Be=q.getDate();let nt,st;if(ft.value){const Qe=[...z.availableDates].filter(Ke=>Ke instanceof Date).map(Ke=>new Date(Ke.getFullYear(),Ke.getMonth(),Ke.getDate()));if(Qe.sort((Ke,dn)=>Ke.getTime()-dn.getTime()),Qe.length===0)return;if(D==="all")nt=Qe[0],st=Qe[Qe.length-1];else{const Ke=parseInt(D.replace("last",""),10);if(Ke<2||Ke>5)return;const dn=Qe.slice(-Ke);nt=dn[0],st=dn[dn.length-1]}}else{const Qe=new Date(R,le,Be);switch(D){case"today":nt=Qe,st=Qe;break;case"lastWeek":nt=new Date(R,le,Be-6),st=Qe;break;case"last15Days":nt=new Date(R,le,Be-14),st=Qe;break;case"last30Days":nt=new Date(R,le,Be-29),st=Qe;break;case"thisMonth":nt=new Date(R,le,1),st=Qe;break;case"last3Months":nt=new Date(R,le-3,1),st=new Date(R,le,0);break;case"last6Months":nt=new Date(R,le-6,1),st=new Date(R,le,0);break;case"last12Months":nt=new Date(R,le-12,1),st=new Date(R,le,0);break;case"lastYear":nt=new Date(R-1,0,1),st=new Date(R-1,11,31);break;default:return}}A("update:modelValue",{start:nt,end:st}),ze()}function wt(D){Ie.value==="left"?de.value=D:Ie.value==="right"?S.value=D:ue.value=D,Ge()}function vt(D){Ie.value==="left"?ee.value=D:Ie.value==="right"?ne.value=D:ve.value=D,Ge()}function Je(){ue.value===0?(ue.value=11,ve.value--):ue.value--}function vn(){ue.value===11?(ue.value=0,ve.value++):ue.value++}function Yt(){de.value===0?(de.value=11,ee.value--):de.value--}function Tn(){de.value===11?(de.value=0,ee.value++):de.value++}function bn(){S.value===0?(S.value=11,ne.value--):S.value--}function Rn(){S.value===11?(S.value=0,ne.value++):S.value++}function Zt(D){if(!C(D))return;const q=new Date(D.getFullYear(),D.getMonth(),D.getDate());if(ge.value){A("update:modelValue",q),Ae();return}const R=at.value;if(!R.start&&!R.end){A("update:modelValue",{start:q,end:null}),He.value="end";return}if(R.start&&R.end){A("update:modelValue",{start:q,end:null}),He.value="end";return}if(He.value==="start"){let le=q,Be=R.end;le&&Be&&le>Be&&([le,Be]=[Be,le]),A("update:modelValue",{start:le||Be,end:Be||le}),He.value="end"}else{let le=R.start,Be=q;le&&Be&&Be<le&&([le,Be]=[Be,le]),A("update:modelValue",{start:le||Be,end:Be||le}),He.value="start"}}e.watch(at,()=>{z.doubleCalendar&&yt.value&&Le.value&&ze()},{deep:!0});let Fn=null,an=null,qn=null;function cl(){Fn&&(document.removeEventListener("keydown",Fn),Fn=null),an&&(window.removeEventListener("resize",an),an=null),qn&&(window.removeEventListener("scroll",qn,!0),qn=null)}return e.watch(ae,D=>{D==="years"&&e.nextTick(()=>{mt.value?.querySelector(`[data-year="${je.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(Le,D=>{cl(),D&&(Fn=q=>{q.key==="Escape"&&(ae.value==="years"||ae.value==="months"?Ge():Ae())},an=()=>{xe()},qn=()=>{xe()},document.addEventListener("keydown",Fn),window.addEventListener("resize",an),window.addEventListener("scroll",qn,!0))}),e.onBeforeUnmount(()=>{cl()}),(D,q)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":F.mode==="readonly"}])},[F.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",ea,[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:Et.value,readonly:"",disabled:"",tabindex:"-1"},null,8,ta)])):ge.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:q[0]||(q[0]=R=>Re("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:rt,type:"text",class:"dss-datepicker__input",placeholder:e.unref(_e)("datepicker.selectDate"),value:Ot.value,readonly:"",disabled:F.mode==="readonly"},null,8,na)])):yt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:Oe,onClick:q[1]||(q[1]=R=>Re("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:we,type:"text",class:"dss-datepicker__input",placeholder:e.unref(_e)("datepicker.selectRange"),value:on.value,readonly:""},null,8,la)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Le.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(Ae,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Tt,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":F.doubleCalendar&&yt.value&&ae.value==="days","dss-datepicker__dropdown--quick-select":F.doubleCalendar&&yt.value&&ae.value==="days"&&F.quickSelect}]),onClick:q[9]||(q[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Ue.value)},[ae.value==="days"&&F.doubleCalendar&&yt.value?(e.openBlock(),e.createElementBlock("div",oa,[F.quickSelect?(e.openBlock(),e.createElementBlock("nav",aa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value,R=>(e.openBlock(),e.createElementBlock("button",{key:R.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:le=>tt(R.id)},e.toDisplayString(e.unref(_e)(R.labelKey)),9,sa))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",ra,[e.createElementVNode("div",ia,[e.createElementVNode("div",ca,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(_e)("datepicker.prevMonth"),onClick:Yt}," ‹ ",8,ua),e.createElementVNode("div",da,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[2]||(q[2]=R=>re("left","months"))},e.toDisplayString(Ve.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[3]||(q[3]=R=>re("left","years"))},e.toDisplayString(ee.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(_e)("datepicker.nextMonth"),onClick:Tn}," › ",8,ma)]),e.createElementVNode("div",pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xt.value,R=>(e.openBlock(),e.createElementBlock("span",{key:R,class:"dss-datepicker__weekday"},e.toDisplayString(R),1))),128))]),e.createElementVNode("div",fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,(R,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+le},[R?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(R)]),disabled:!C(R),onClick:Be=>Zt(R),onMouseenter:Be=>P(R),onMouseleave:U},e.toDisplayString(R.getDate()),43,va)):(e.openBlock(),e.createElementBlock("span",ga))],64))),128))])]),e.createElementVNode("div",ha,[e.createElementVNode("div",ya,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(_e)("datepicker.prevMonth"),onClick:bn}," ‹ ",8,Ca),e.createElementVNode("div",ka,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[4]||(q[4]=R=>re("right","months"))},e.toDisplayString(We.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[5]||(q[5]=R=>re("right","years"))},e.toDisplayString(ne.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(_e)("datepicker.nextMonth"),onClick:Rn}," › ",8,ba)]),e.createElementVNode("div",wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xt.value,R=>(e.openBlock(),e.createElementBlock("span",{key:R,class:"dss-datepicker__weekday"},e.toDisplayString(R),1))),128))]),e.createElementVNode("div",xa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(R,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+le},[R?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(R)]),disabled:!C(R),onClick:Be=>Zt(R),onMouseenter:Be=>P(R),onMouseleave:U},e.toDisplayString(R.getDate()),43,Ea)):(e.openBlock(),e.createElementBlock("span",Va))],64))),128))])])])])):ae.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Na,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(_e)("datepicker.prevMonth"),onClick:Je}," ‹ ",8,Sa),e.createElementVNode("div",Ba,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[6]||(q[6]=R=>ae.value="months")},e.toDisplayString(Dt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[7]||(q[7]=R=>ae.value="years")},e.toDisplayString(ve.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(_e)("datepicker.nextMonth"),onClick:vn}," › ",8,Ma)]),e.createElementVNode("div",_a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xt.value,R=>(e.openBlock(),e.createElementBlock("span",{key:R,class:"dss-datepicker__weekday"},e.toDisplayString(R),1))),128))]),e.createElementVNode("div",$a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(R,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:le},[R?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(R)]),disabled:!C(R),onClick:Be=>Zt(R),onMouseenter:Be=>P(R),onMouseleave:U},e.toDisplayString(R.getDate()),43,Ta)):(e.openBlock(),e.createElementBlock("span",La))],64))),128))])],64)):ae.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Ha,[e.createElementVNode("div",Aa,[e.createElementVNode("span",Da,e.toDisplayString(Lt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[8]||(q[8]=R=>ae.value="years")},e.toDisplayString(je.value),1)])]),e.createElementVNode("div",Ra,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($t.value,(R,le)=>(e.openBlock(),e.createElementBlock("button",{key:le,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":le===lt.value}]),onClick:Be=>wt(le)},e.toDisplayString(R),11,Fa))),128))])],64)):ae.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Ia,[e.createElementVNode("span",za,e.toDisplayString(Gt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:mt},[e.createElementVNode("div",Pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,R=>(e.openBlock(),e.createElementBlock("button",{key:R,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":R===je.value,"dss-datepicker__year-cell--current":R===e.unref(Ze)}]),"data-year":R,onClick:le=>vt(R)},e.toDisplayString(R),11,Oa))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Za=["data-chart-type"],Wa={class:"dss-chart-header-titles"},qa={key:0,class:"dss-chart-title"},Ua={key:1,class:"dss-chart-subtitle"},Xa=["onClick","onMouseenter"],Ya={class:"dss-legend-text"},ja=["onClick","onMouseenter"],Ka={class:"dss-legend-text"},Ga=["title"],Qa=["src"],Ja={class:"dss-chart-area-wrapper"},es={key:0,class:"dss-chart-z-axis-label"},ts=["width","height","data-smooth","data-animated"],ns={id:"chart-clip"},ls=["y","width","height"],os=["id"],as=["d"],ss=["id"],rs=["d"],is={key:0},cs={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},us=["x1","x2","y1","y2"],ds={class:"dss-axes"},ms=["x1","x2","y1","y2"],ps=["x1","x2","y1","y2"],fs={class:"dss-axis-labels"},vs=["x","y"],gs=["x","y"],hs=["x","y"],ys=["y","transform"],Cs={key:1,class:"dss-flag-markers"},ks={"clip-path":"url(#chart-clip)"},bs=["x1","x2","y1","y2","onMouseover"],ws=["x1","x2","y1","y2","onMouseover"],xs=["x1","x2","y1","y2","onMouseover"],Es=["cx","cy","onMouseover"],Vs=["cx","cy","fill","onMouseover"],Ns=["x","y"],Ss={class:"dss-chart-data","clip-path":"url(#chart-clip)"},Bs={key:0},Ms=["d","onMouseover"],_s=["x","y","width","height","fill","onMouseover"],$s={class:"dss-line-chart"},Ts=["d","stroke","stroke-width"],Ls=["d","stroke","stroke-width","opacity"],Hs=["cx","cy","r","fill","onMouseover"],As={key:1},Ds=["d","stroke","stroke-width"],Rs=["d","stroke","stroke-width"],Fs=["d","stroke","stroke-width","opacity"],Is=["cx","cy","r","fill","onMouseover"],zs={key:2},Ps=["id"],Os=["x","y","width","height"],Zs=["d","fill","fill-opacity","mask"],Ws=["d","stroke","stroke-width"],qs=["d","fill","onMouseover"],Us=["x","y","width","height","onMouseover"],Xs={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},Ys=["x1","x2","y1","y2","stroke"],js=["cx","cy","r","fill"],Ks={key:1,class:"dss-bubble-chart"},Gs={key:0,class:"dss-bubble-group"},Qs=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Js=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],er=["transform"],tr=["cx","cy","r"],nr=["data-chart-type","clip-path"],lr=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],or={key:1,class:"dss-radial-segment-data-labels"},ar=["x","y"],sr=["x","y","font-size","fill"],rr=["x1","y1","x2","y2","stroke"],ir=["x1","y1","x2","y2","stroke"],cr=["x","y","text-anchor","font-size"],ur=["transform"],dr={key:0,class:"dss-spider-grid"},mr=["cx","cy","r"],pr={class:"dss-spider-grid-labels"},fr=["x","y"],vr=["x","y"],gr=["x1","x2","y1","y2"],hr={class:"dss-spider-labels"},yr=["x","y","text-anchor","dominant-baseline"],Cr=["points","fill","fill-opacity","stroke","stroke-width"],kr=["cx","cy","r","fill","onMouseover"],br={class:"dss-chart-logos"},wr=["cx","cy","r","fill"],xr=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Er=["onClick","onMouseenter"],Vr=["src"],Nr={class:"dss-marker-tooltip-category"},Sr={key:0,class:"dss-marker-tooltip-description"},Br={key:0,class:"dss-tooltip-section"},Mr={key:0,class:"dss-tooltip-title"},_r={class:"dss-tooltip-series-name"},$r={class:"dss-tooltip-series-value"},Tr={key:1,class:"dss-tooltip-section"},Lr={key:0,class:"dss-tooltip-title"},Hr={class:"dss-bubble-tooltip-data"},Ar={key:2,class:"dss-tooltip-section"},Dr={class:"dss-tooltip-title"},Rr={class:"dss-tooltip-value"},Fr={key:0,class:"dss-tooltip-section"},Ir={class:"dss-tooltip-section-title"},zr={class:"dss-tooltip-group-header"},Pr={class:"dss-tooltip-item-content"},Or={class:"dss-tooltip-item-text"},Zr={key:1,class:"dss-tooltip-section"},Wr={class:"dss-tooltip-section-title"},qr={class:"dss-tooltip-item-content"},Ur={class:"dss-tooltip-item-title"},Xr={key:0,class:"dss-tooltip-item-description"},Yr={class:"dss-tooltip-section"},jr={class:"dss-tooltip-title"},Kr={key:0,class:"dss-bubble-tooltip-data"},Gr={class:"dss-tooltip-series-name"},Qr={class:"dss-tooltip-series-value"},Jr={key:0,class:"dss-tooltip-section"},ei={class:"dss-tooltip-section-title"},ti={class:"dss-tooltip-group-header"},ni={class:"dss-tooltip-item-content"},li={class:"dss-tooltip-item-text"},oi={key:1,class:"dss-tooltip-section"},ai={class:"dss-tooltip-section-title"},si={class:"dss-tooltip-item-content"},ri={class:"dss-tooltip-item-title"},ii={key:0,class:"dss-tooltip-item-description"},ci={key:1,class:"dss-context-menu-separator"},ui={key:0,class:"dss-context-menu-separator"},di={key:0,class:"dss-context-menu-separator"},mi=["onClick"],pi=["innerHTML"],fi={key:0,class:"dss-context-menu-icon"},vi={class:"dss-marker-modal-header"},gi={class:"dss-marker-modal-body"},hi={class:"dss-form-group"},yi={class:"dss-form-group"},Ci={for:"dss-marker-description"},ki={key:0,class:"dss-form-text-display"},bi=["placeholder"],wi={class:"dss-marker-modal-footer"},xi={class:"modal-footer-left"},Ei={class:"dss-modal-footer-right"},Vi=["disabled"],Ni={name:"DSSChart"},Si=Object.assign(Ni,{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:F=>typeof F=="object"&&F!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(F,{emit:Ce}){const{t:z,locale:A}=lo.useI18n(),_e=Ce,b=e.ref(null),Le=e.ref(null),ae=e.ref(null),pt=e.ref(0),p=e.ref(0);let ue=null,ve=null;const de=20,ee=e.computed(()=>{if(p.value,pt.value,!b.value||!Le.value)return 0;try{const t=b.value.getBoundingClientRect();return Le.value.getBoundingClientRect().top-t.top}catch{return 0}}),S=F,ne={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 He(t,s){const n=Object.assign({},t);return Ie(t)&&Ie(s)&&Object.keys(s).forEach(c=>{Ie(s[c])?c in t?n[c]=He(t[c],s[c]):Object.assign(n,{[c]:s[c]}):Object.assign(n,{[c]:s[c]})}),n}const De=()=>{let t=20,s=0,n=0;if(Vt.value&&(t+=30),at.value&&(t+=25),$t.value&&S.series.length>0){const c=S.series.filter((f,g)=>!Nt.value.has(g)).length;if(Xe.value==="top"||Xe.value==="bottom"){if(Gt.value==="horizontal"){const g=Math.floor(we.value/100);s=Math.ceil(c/g)*25+10}else s=c*25+10;t+=s}else n=150}return{height:t,legendHeight:s,legendWidth:n}};function Ie(t){return t&&typeof t=="object"&&!Array.isArray(t)}const O=e.computed(()=>He(ne,S.options)),rt=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.width==="auto"}),Oe=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.height==="auto"}),we=e.computed(()=>{const t=O.value;return rt.value?pt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),xt=e.ref(de),Tt=e.computed(()=>{if(Oe.value){const t=Tt.value;return t??Math.max(0,(p.value||400)-xt.value*5)}}),mt=e.computed(()=>{const t=O.value;if(Oe.value){const s=Tt.value;return s??Math.max(0,(p.value||400)-xt.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Ze=e.computed(()=>Oe.value&&ge.value==="semi-radial"&&Tt.value!=null?xt.value+mt.value+"px":Oe.value?"100%":cn.value?xt.value+mt.value+"px":mt.value+($t.value?20:0)+"px"),ge=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),yt=e.computed(()=>{const t=S.series.map(s=>s.type||ge.value);return new Set(t).size>1}),Vt=e.computed(()=>{const t=O.value;return t&&t.title&&t.title.text?t.title.text:""}),at=e.computed(()=>{const t=O.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),_t=e.computed(()=>{const t=O.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),Ot=e.computed(()=>{const t=O.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),on=e.computed(()=>{const t=O.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),Et=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return Yn;const s=t.yAxis.min;return typeof s=="number"||s===Yn?s:Yn}),lt=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return Yn;const s=t.yAxis.max;return typeof s=="number"||s===Yn?s:Yn}),je=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Dt=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),Lt=e.computed(()=>{const t=O.value;return t&&t.grid&&t.grid.show!==!1}),$t=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.show!==!1}),Xe=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Gt=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Xt=e.computed(()=>{const t=O.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Ct=e.computed(()=>{const t=O.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),te=e.computed(()=>{const t=O.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),$e=e.computed(()=>{const t=O.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),fe=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Ve=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),We=e.computed(()=>{const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),ft=e.computed(()=>{if(!cn.value)return 0;const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),qe=e.computed(()=>{const t=O.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),ut=e.computed(()=>{const{maxX:t}=qt.value;return t===0}),xe=(t,s)=>ut.value&&s===0?5:s,Ue=t=>{const s=Number(t);return!Number.isFinite(s)||s<=0?0:s},X=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),Z=e.computed(()=>{const t=O.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),j=e.computed(()=>{const t=O.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),ie=e.computed(()=>{const t=O.value;return Z.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),E=e.computed(()=>{const t=O.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),C=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.enabled!==!1}),V=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),P=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),U=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),ze=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Re=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),Ae=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.onDataChange!==!1}),re=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Ge=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),tt=e.computed(()=>O.value?.spider?.gridSteps||5),wt=e.computed(()=>{const t=[],s=tt.value;for(let n=1;n<=s;n++)t.push(it.value/s*n);return t}),vt=t=>{const s=Je.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const n=wt.value[t];return Math.round(n/it.value*100)+"%"},Je=e.computed(()=>O.value?.spider?.gridLabels||null),vn=e.computed(()=>{const t=O.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Yt=e.computed(()=>{const t=O.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),Tn=e.computed(()=>{const t=O.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),bn=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.icon?t.markers.icon:dn.value}),Rn=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Zt=e.computed(()=>{const t=O.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Fn=e.computed(()=>{const s=O.value?.valueFormat?.extension;return typeof s=="string"?s:""}),an=t=>{const s=Fn.value;if(t==null)return"";const n=String(t);return s?n+s:n},qn=e.computed(()=>!G.value.isZooming);e.computed(()=>St.value.map(t=>{if(t.categoryIndex!==void 0&&(fn.value||zt.value)){const s=Ft(t.categoryIndex),n=ee.value+I.value.bottom-Zt.value/2;return{...t,x:s,y:n}}return t}));function cl(t,s){let n;if(t instanceof Date)n=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,x,k]=t.split("-"),L=Number(k?.length===2?`20${k}`:k);n=new Date(L,Number(x)-1,Number(g))}else return 0;let c=0,f=1/0;return s.forEach((g,x)=>{const[k,L,T]=g.split("-"),H=Number(T?.length===2?`20${T}`:T),M=new Date(H,Number(L)-1,Number(k)),K=Math.abs(M-n);K<f&&(f=K,c=x)}),c}const D=e.computed(()=>{const t=S.markers.map(n=>{const c=cl(n.marker_date,S.categories),f=Ft(c),g=ee.value+I.value.bottom-Zt.value/2;return{...n,x:f,y:g,categoryIndex:c,source:"props"}}),s=St.value.map(n=>{if(n.categoryIndex!==void 0&&(fn.value||zt.value)){const c=Ft(n.categoryIndex),f=ee.value+I.value.bottom-Zt.value/2;return{...n,x:c,y:f,source:"internal"}}return{...n,source:"internal"}});return[...t,...s]}),q=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.enabled===!0}),R=e.computed(()=>{const t=O.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),le=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),Be=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),nt=e.computed(()=>{const t={left:I.value.left,top:I.value.top,width:I.value.width,height:I.value.height};let s,n;const c=String(le.value);if(c.includes("%")){const f=parseFloat(c)/100;s=t.width*f,n=s*(96/499)}else{const f=parseFloat(c)||25;s=Math.min(t.width*.25,200)*(f/25),n=s*(96/499)}return{width:s,height:n,area:t}}),st=e.computed(()=>{const{width:t,height:s}=nt.value,n=Be.value;let c,f;const g=I.value.left,x=I.value.right,k=I.value.top,L=I.value.bottom,T=I.value.width,H=I.value.height;switch(n){case"center":c=g+(T-t)/2,f=k+(H-s)/2;break;case"top-left":c=g+15,f=k+5;break;case"top-right":c=x-t-15,f=k+5;break;case"bottom-left":c=g+15,f=L-s-5;break;case"bottom-right":default:c=x-t-15,f=L-s-5;break}return{backgroundPositionX:c+"px",backgroundPositionY:f+"px",backgroundSize:`${t}px ${s}px`}}),Qe=t=>!S.flags||!S.flags.length?[]:S.flags.filter(s=>s.categoryIndex===t),Ke=t=>{const s=Qe(t),n=Vn(t),c=s.filter(x=>x.manual),f=s.filter(x=>!x.manual),g=[];return c.length>0&&g.push({type:z("chart.tooltip.manualFlags"),color:"#047395",flags:c.map(x=>({text:x.text,color:"#047395"}))}),f.length>0&&g.push({type:z("chart.tooltip.autoFlags"),color:"#0dbf89",flags:f.map(x=>({text:x.text,color:"#0dbf89"}))}),{flagGroups:g,markers:n.map(x=>({title:x.title,description:x.description,type:z("chart.tooltip.markers"),color:x.color||"#FF6B6B"}))}},dn=e.computed(()=>{const t=S.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"/>
@@ -15,7 +15,7 @@
15
15
  <rect width="57" height="57" fill="white"/>
16
16
  </clipPath>
17
17
  </defs>
18
- </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),sn=e.computed(()=>{const t=S.old?`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
18
+ </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Ln=e.computed(()=>{const t=S.old?`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
19
19
  <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"/>
20
20
  <path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
21
21
  <path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
@@ -41,23 +41,23 @@
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)}`}),Nn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),nn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=O.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const Hn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),Cn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),dn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),fn=e.computed(()=>{const s=O.value?.radialBar?.dataLabels;return s&&(s.show===!0||s.enabled===!0)}),Pn=e.computed(()=>{const s=O.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof s=="number"&&s>=0?s:20}),yl=e.computed(()=>{const s=O.value?.radialBar?.dataCenter;return En.value&&s&&(s.show===!0||s.enabled===!0)}),Xl=e.computed(()=>{if(!yl.value||!ml.value.length)return"";const n=O.value?.radialBar?.dataCenter?.showValueOnly===!0?ml.value[0]?.value??0:ml.value.reduce((i,f)=>i+(f.value??0),0);return un(n)}),Cl=e.computed(()=>{const s=O.value?.radialBar?.dataCenter?.fontSize;return typeof s=="number"&&s>0?s:24}),kl=e.computed(()=>({x:Mt.value,y:Nt.value-Cl.value/2})),kn=e.computed(()=>{const s=O.value?.radialBar?.dataCenter?.color;return typeof s=="string"&&s?s:"#333"}),vn=e.computed(()=>{if(!fn.value||!pn.value||!ml.value.length)return[];const t=Pn.value*Math.PI/180,s=(It.value+at.value)/2;return ml.value.map(n=>{const f=n.endAngle-n.startAngle>=t&&!n.isHidden,g=Mt.value+Math.cos(n.midAngle)*s,E=Nt.value+Math.sin(n.midAngle)*s;return{value:un(n.value),x:g,y:E,show:f,color:n.color,contrastColor:dl(n.color)}})}),Al=e.computed(()=>{if(!S.flags||!S.flags.length)return[];const t=new Map;return S.flags.forEach(s=>{const n=s.categoryIndex;t.has(n)||t.set(n,[]),t.get(n).push(s)}),Array.from(t.entries()).map(([s,n])=>{const i=Zt(s),f=n.filter(E=>E.manual),g=n.filter(E=>!E.manual);return{categoryIndex:parseInt(s),x:i,flags:n,manualCount:f.length,autoCount:g.length,totalCount:n.length,hasManual:f.length>0,hasAuto:g.length>0,texts:n.map(E=>E.text).join(`
45
- `)}})}),ol=e.ref({show:!1,x:0,y:0,content:"",count:0}),An=e.computed(()=>O.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),fl=e.computed(()=>{const t=O.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Vl=e.computed(()=>O.value?.bubbles?.tooltip?.formatters||{}),At=e.ref(new Set),Ce=e.ref(null),Nl=e.ref(!1),Ge=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),jt=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),qe=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),We=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),Z=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Tt=e.ref([]),he=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 cn.value&&t.push(...Object.keys(cn.value)),t}),e.computed(()=>{if(!S.categories||S.categories.length===0){const{maxX:t}=zt.value;return Array.from({length:t+1},(s,n)=>z("chart.fallback.item",{number:n+1}))}return S.categories});const Mn=e.computed(()=>{if(!S.categories||S.categories.length===0)return null;const t=S.categories[0],[s,n,i]=String(t).split("-"),f=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(n)-1;return!g||!n||!f?null:new Date(f,E,g)}),Dl=e.computed(()=>{if(!S.categories||S.categories.length===0)return null;const t=S.categories[S.categories.length-1],[s,n,i]=String(t).split("-"),f=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(n)-1;return!g||!n||!f?null:new Date(f,E,g)}),w=e.computed(()=>he.value.editingMarkerId!==null),y=e.computed(()=>he.value.readonly),B=t=>{At.value.has(t)||(Kn.value=!0,Ce.value=t)},W=()=>{Kn.value=!1,Ce.value=null},re=t=>{if(Hl.value||Ll.value){qe.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,f=t.clientY-n.top,g=Pt.value?i>=F.value.left-50&&i<=F.value.right+50&&f>=F.value.top-50&&f<=F.value.bottom+100:i>=F.value.left&&i<=F.value.right&&f>=F.value.top&&f<=F.value.bottom;if(Nl.value=g,Pt.value){if(!ht.value||!g||Z.value.isDragging||Z.value.isZooming){qe.value.show=!1;return}if(Yn.value.find(J=>!J||J.isHidden?!1:Math.sqrt(Math.pow(J.x-i,2)+Math.pow(J.y-f,2))<=J.radius+3))qe.value.show=!1;else{const J=Yn.value.filter(pe=>!pe||pe.isHidden?!1:Math.sqrt(Math.pow(pe.x-i,2)+Math.pow(pe.y-f,2))<=250);if(J.length>0){let pe=J[0],ye=Math.sqrt(Math.pow(pe.x-i,2)+Math.pow(pe.y-f,2));J.forEach(be=>{const we=Math.sqrt(Math.pow(be.x-i,2)+Math.pow(be.y-f,2));we<ye&&(ye=we,pe=be)});const ae=30,Xe=Yn.value.filter(be=>!be||be.isHidden?!1:Math.abs(be.x-pe.x)<=ae).sort((be,we)=>be.y-we.y);qe.value={show:!0,x:pe.x,categoryIndex:Math.round(pe.originalX),data:(()=>{const be=An.value,we=fl.value,Fe=[];return Xe.forEach(De=>{be.forEach(kt=>{const bt=we[kt]||kt,Vn=u(kt,De);Vn&&Fe.push({seriesName:De.seriesName,label:De.label,value:`${bt}: ${Vn}`,color:De.color,y:De.y})})}),Fe})()}}else qe.value.show=!1}return}if(Z.value.isDragging&&Z.value.scale>1&&rn.value&&_e.value){qe.value.show=!1;const Ne=t.clientX-Z.value.lastMouseX,{minX:J,maxX:pe}=zt.value,ye=pe-J||1,Xe=Ne*.8;Z.value.offsetX+=Xe;const be=ye/Z.value.scale,we=ye-be,Fe=0,De=-we/ye*F.value.width,kt=Fe;Z.value.offsetX=Math.max(De,Math.min(kt,Z.value.offsetX)),Z.value.lastMouseX=t.clientX,Z.value.lastMouseY=t.clientY;return}if(!ht.value||!rn.value||Z.value.isDragging||Z.value.isZooming||!g){qe.value.show=!1;return}const{minX:E,maxX:k}=zt.value,L=k-E||1,T=L/Z.value.scale,H=E-Z.value.offsetX/F.value.width*L,M=(i-F.value.left)/F.value.width,G=H+M*T,ce=Math.round(G);if(ce>=0&&ce<=k){const Ne=Zt(ce),J=Un.value.map((pe,ye)=>{const ae=S.series.findIndex(be=>be===pe),Xe=pe.data[ce];return{seriesName:pe.name,value:Xe!==void 0?Xe:null,color:Lt(ae),y:Xe!==void 0?Qt(Xe):null}}).filter(pe=>pe.value!==null);qe.value={show:!0,x:Ne,categoryIndex:ce,data:J}}},dt=()=>{qe.value.show=!1,Nl.value=!1,Ll.value=!1,Hl.value||(ol.value.show=!1),Z.value.isDragging&&(Z.value.isDragging=!1),Z.value.zoomTimeout&&(clearTimeout(Z.value.zoomTimeout),Z.value.zoomTimeout=null),Z.value.isZooming=!1,setTimeout(()=>{Ce.value=null,Ge.value.show=!1},150)},lt=t=>{if(t.preventDefault(),t.stopPropagation(),!Ke.value)return;const s=t.currentTarget.getBoundingClientRect(),n=t.clientX-s.left,i=t.clientY-s.top;if(pn.value){We.value.show=!1,e.nextTick(()=>{We.value.show=!0,We.value.x=t.clientX,We.value.y=t.clientY,We.value.categoryIndex=null});return}const f=Math.max(0,F.value.left-20),g=F.value.right,E=F.value.top,k=F.value.bottom+80;n>=f&&n<=g&&i>=E&&i<=k&&(We.value.show=!1,e.nextTick(()=>{We.value.show=!0,We.value.x=t.clientX,We.value.y=t.clientY,We.value.categoryIndex=null;const L=Math.max(F.value.left,Math.min(n,F.value.right))-F.value.left,H=F.value.width/Pl.value.length,M=Math.floor(L/H);M>=0&&M<Pl.value.length&&(We.value.categoryIndex=M)}))},yt=t=>{if(!(t&&t.button===2)){if(We.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}We.value.show=!1}},mn=t=>{if(typeof t.template=="function"){const s={series:S.series,categories:S.categories,markers:Tt.value},n={chartX:We.value.chartX,chartY:We.value.chartY,dataX:We.value.mouseDataX,dataY:We.value.mouseDataY,categoryIndex:We.value.categoryIndex};return t.template(s,n)}return t.template||t.label||""},Dt=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},bn=t=>t.style||{},Yl=t=>t.type&&cn.value[t.type]?cn.value[t.type]:t.customIcon?t.customIcon:Tn.value,so=t=>t==null?"":S.categories&&S.categories[t]?S.categories[t]:"",ro=t=>Tt.value.length?Tt.value.filter(s=>s.categoryIndex===t):[],wn=t=>{if(!rn.value&&!Pt.value)return{x:0,y:0};const s=Zt(t),n=ee.value+F.value.bottom-yn.value/2;return{x:s,y:n}},jl=()=>{Tt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(rn.value||Pt.value)){const s=wn(t.categoryIndex);t.x=s.x,t.y=s.y}})},io=()=>{if(he.value.description&&he.value.description.length&&he.value.date){if(w.value){const t=Tt.value.findIndex(s=>s.id===he.value.editingMarkerId);t!==-1?(Tt.value[t].description=he.value.description||"",Tt.value[t].color=he.value.color||"",Tt.value[t].type=he.value.type||"default",Me("update-marker",Tt.value[t])):Me("update-marker",{id:he.value.editingMarkerId,description:he.value.description||"",color:he.value.color||"",type:he.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=Ln(he.value.date,S.categories||[]);if(Pt.value){const{maxX:E}=zt.value;s=Math.max(0,Math.min(s,Math.floor(E)))}else rn.value&&(s=Math.max(0,Math.min(s,zt.value.maxX)));const n=Zt(s),i=ee.value+F.value.bottom-yn.value/2,f=Array.isArray(S.categories)?S.categories[s]:null,g={id:t,title:"",description:he.value.description||"",color:he.value.color||"",type:he.value.type||"default",categoryIndex:s,x:n,y:i,marker_date:f||null};he.value.categoryIndex=s,Tt.value.push(g),Me("add-marker",g)}al(),Kl()}},al=()=>{he.value.show=!1,he.value.title="",he.value.description="",he.value.color="#FF6B6B",he.value.type="default",he.value.editingMarkerId=null,he.value.readonly=!1,he.value.categoryIndex=null,he.value.fromButton=!1,he.value.date=null},co=()=>{w.value&&(uo(he.value.editingMarkerId),al())},uo=t=>{const s=Tt.value.findIndex(n=>n.id===t);s!==-1&&(Tt.value.splice(s,1),Kl()),Me("delete-marker",t)},Sn=t=>{if(he.value.show=!0,he.value.title=t?.title??t?.comment??"",he.value.description=t?.description??t?.comment??"",he.value.color=t?.color??"",he.value.type=t?.type??"default",he.value.editingMarkerId=t?.id??t?.marker_id??null,he.value.readonly=t?.readonly??!1,he.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[s,n,i]=String(t.marker_date).split("-"),f=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(n)-1;g&&n&&f?he.value.date=new Date(f,E,g):he.value.date=null}else he.value.date=null},Kl=()=>{try{const t=`dss-chart-markers-${S.chartId}`;localStorage.setItem(t,JSON.stringify(Tt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},No=()=>{try{const t=`dss-chart-markers-${S.chartId}`,s=localStorage.getItem(t);if(s){const n=JSON.parse(s);Array.isArray(n)&&(Tt.value=n.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Tt.value=[]}},Kt=t=>{const s=Et.value||"Chart",n=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"}-${n}.${t}`},Jn=()=>{const t=qe.value.show,s=Ge.value.show;return qe.value.show=!1,Ge.value.show=!1,{originalCrosshair:t,originalTooltip:s}},_n=t=>{qe.value.show=t.originalCrosshair,Ge.value.show=t.originalTooltip},el=async(t,s=32,n=32)=>new Promise((i,f)=>{if(t.startsWith("data:")){i(t);return}const g=new Image;g.crossOrigin="anonymous";const E=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(E);try{const k=document.createElement("canvas"),L=k.getContext("2d");k.width=s,k.height=n,L.fillStyle="#fafafa",L.fillRect(0,0,s,n),L.drawImage(g,0,0,s,n);const T=k.toDataURL("image/png");i(T)}catch(k){console.warn("Canvas conversion failed:",k),i(t)}},g.onerror=k=>{clearTimeout(E),console.warn("Failed to load image:",t,k),i(t)},g.src=t}),tl=async()=>{try{const t=Jn();setTimeout(async()=>{try{const s=document.querySelector(".dss-chart-svg");if(!s){console.error("Chart SVG element not found"),_n(t);return}const n=Ae(),i=xe.value,f=mt.value+n.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(ae=>ae.remove());const k=g.querySelectorAll("image"),L=Array.from(k).map(async ae=>{const Xe=ae.getAttribute("xlink:href")||ae.getAttribute("href");if(Xe&&!Xe.startsWith("data:"))try{const be=await el(Xe,32,32);ae.setAttribute("xlink:href",be),ae.setAttribute("href",be)}catch(be){console.warn("Failed to convert logo to base64:",be)}});await Promise.all(L);const H=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let M="",G=30;if(Et.value&&(M+=`
46
- <text x="24" y="${G}"
44
+ </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),tn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),Hn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=O.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const wn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),sn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),xn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),In=e.computed(()=>{const s=O.value?.radialBar?.dataLabels;return s&&(s.show===!0||s.enabled===!0)}),Nl=e.computed(()=>{const s=O.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof s=="number"&&s>=0?s:20}),Tl=e.computed(()=>{const s=O.value?.radialBar?.dataCenter;return Nn.value&&s&&(s.show===!0||s.enabled===!0)}),Sl=e.computed(()=>{if(!Tl.value||!sl.value.length)return"";const n=O.value?.radialBar?.dataCenter?.showValueOnly===!0?sl.value[0]?.value??0:sl.value.reduce((c,f)=>c+(f.value??0),0);return an(n)}),gl=e.computed(()=>{const s=O.value?.radialBar?.dataCenter?.fontSize;return typeof s=="number"&&s>0?s:24}),gn=e.computed(()=>({x:Bt.value,y:ht.value-gl.value/2})),hn=e.computed(()=>{const s=O.value?.radialBar?.dataCenter?.color;return typeof s=="string"&&s?s:"#333"}),Zl=e.computed(()=>{if(!In.value||!cn.value||!sl.value.length)return[];const t=Nl.value*Math.PI/180,s=(Rt.value+it.value)/2;return sl.value.map(n=>{const f=n.endAngle-n.startAngle>=t&&!n.isHidden,g=Bt.value+Math.cos(n.midAngle)*s,x=ht.value+Math.sin(n.midAngle)*s;return{value:an(n.value),x:g,y:x,show:f,color:n.color,contrastColor:Ql(n.color)}})}),ul=e.computed(()=>{if(!S.flags||!S.flags.length)return[];const t=new Map;return S.flags.forEach(s=>{const n=s.categoryIndex;t.has(n)||t.set(n,[]),t.get(n).push(s)}),Array.from(t.entries()).map(([s,n])=>{const c=Ft(s),f=n.filter(x=>x.manual),g=n.filter(x=>!x.manual);return{categoryIndex:parseInt(s),x:c,flags:n,manualCount:f.length,autoCount:g.length,totalCount:n.length,hasManual:f.length>0,hasAuto:g.length>0,texts:n.map(x=>x.text).join(`
45
+ `)}})}),An=e.ref({show:!1,x:0,y:0,content:"",count:0}),dl=e.computed(()=>O.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),hl=e.computed(()=>{const t=O.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Ll=e.computed(()=>O.value?.bubbles?.tooltip?.formatters||{}),Nt=e.ref(new Set),Me=e.ref(null),yn=e.ref(!1),et=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),rn=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Ne=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),Se=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),G=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),St=e.ref([]),he=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 Rn.value&&t.push(...Object.keys(Rn.value)),t}),e.computed(()=>{if(!S.categories||S.categories.length===0){const{maxX:t}=qt.value;return Array.from({length:t+1},(s,n)=>z("chart.fallback.item",{number:n+1}))}return S.categories});const Hl=e.computed(()=>{if(!S.categories||S.categories.length===0)return null;const t=S.categories[0],[s,n,c]=String(t).split("-"),f=Number(c?.length===2?`20${c}`:c),g=Number(s),x=Number(n)-1;return!g||!n||!f?null:new Date(f,x,g)}),w=e.computed(()=>{if(!S.categories||S.categories.length===0)return null;const t=S.categories[S.categories.length-1],[s,n,c]=String(t).split("-"),f=Number(c?.length===2?`20${c}`:c),g=Number(s),x=Number(n)-1;return!g||!n||!f?null:new Date(f,x,g)}),y=e.computed(()=>he.value.editingMarkerId!==null),B=e.computed(()=>he.value.readonly),W=t=>{Nt.value.has(t)||(Fl.value=!0,Me.value=t)},se=()=>{Fl.value=!1,Me.value=null},dt=t=>{if(El.value||$l.value){Ne.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),c=t.clientX-n.left,f=t.clientY-n.top,g=zt.value?c>=I.value.left-50&&c<=I.value.right+50&&f>=I.value.top-50&&f<=I.value.bottom+100:c>=I.value.left&&c<=I.value.right&&f>=I.value.top&&f<=I.value.bottom;if(yn.value=g,zt.value){if(!Ct.value||!g||G.value.isDragging||G.value.isZooming){Ne.value.show=!1;return}if(xl.value.find(J=>!J||J.isHidden?!1:Math.sqrt(Math.pow(J.x-c,2)+Math.pow(J.y-f,2))<=J.radius+3))Ne.value.show=!1;else{const J=xl.value.filter(pe=>!pe||pe.isHidden?!1:Math.sqrt(Math.pow(pe.x-c,2)+Math.pow(pe.y-f,2))<=250);if(J.length>0){let pe=J[0],ye=Math.sqrt(Math.pow(pe.x-c,2)+Math.pow(pe.y-f,2));J.forEach(ke=>{const be=Math.sqrt(Math.pow(ke.x-c,2)+Math.pow(ke.y-f,2));be<ye&&(ye=be,pe=ke)});const oe=30,Ye=xl.value.filter(ke=>!ke||ke.isHidden?!1:Math.abs(ke.x-pe.x)<=oe).sort((ke,be)=>ke.y-be.y);Ne.value={show:!0,x:pe.x,categoryIndex:Math.round(pe.originalX),data:(()=>{const ke=dl.value,be=hl.value,Pe=[];return Ye.forEach(Fe=>{ke.forEach(kt=>{const bt=be[kt]||kt,Bn=m(kt,Fe);Bn&&Pe.push({seriesName:Fe.seriesName,label:Fe.label,value:`${bt}: ${Bn}`,color:Fe.color,y:Fe.y})})}),Pe})()}}else Ne.value.show=!1}return}if(G.value.isDragging&&G.value.scale>1&&fn.value&&$e.value){Ne.value.show=!1;const Ee=t.clientX-G.value.lastMouseX,{minX:J,maxX:pe}=qt.value,ye=pe-J||1,Ye=Ee*.8;G.value.offsetX+=Ye;const ke=ye/G.value.scale,be=ye-ke,Pe=0,Fe=-be/ye*I.value.width,kt=Pe;G.value.offsetX=Math.max(Fe,Math.min(kt,G.value.offsetX)),G.value.lastMouseX=t.clientX,G.value.lastMouseY=t.clientY;return}if(!Ct.value||!fn.value||G.value.isDragging||G.value.isZooming||!g){Ne.value.show=!1;return}const{minX:x,maxX:k}=qt.value,L=k-x||1,T=L/G.value.scale,H=x-G.value.offsetX/I.value.width*L,M=(c-I.value.left)/I.value.width,K=H+M*T,ce=Math.round(K);if(ce>=0&&ce<=k){const Ee=Ft(ce),J=Jn.value.map((pe,ye)=>{const oe=S.series.findIndex(ke=>ke===pe),Ye=pe.data[ce];return{seriesName:pe.name,value:Ye!==void 0?Ye:null,color:Mt(oe),y:Ye!==void 0?ln(Ye):null}}).filter(pe=>pe.value!==null);Ne.value={show:!0,x:Ee,categoryIndex:ce,data:J}}},ot=()=>{Ne.value.show=!1,yn.value=!1,$l.value=!1,El.value||(An.value.show=!1),G.value.isDragging&&(G.value.isDragging=!1),G.value.zoomTimeout&&(clearTimeout(G.value.zoomTimeout),G.value.zoomTimeout=null),G.value.isZooming=!1,setTimeout(()=>{Me.value=null,et.value.show=!1},150)},Ht=t=>{if(t.preventDefault(),t.stopPropagation(),!vn.value)return;const s=t.currentTarget.getBoundingClientRect(),n=t.clientX-s.left,c=t.clientY-s.top;if(cn.value){Se.value.show=!1,e.nextTick(()=>{Se.value.show=!0,Se.value.x=t.clientX,Se.value.y=t.clientY,Se.value.categoryIndex=null});return}const f=Math.max(0,I.value.left-20),g=I.value.right,x=I.value.top,k=I.value.bottom+80;n>=f&&n<=g&&c>=x&&c<=k&&(Se.value.show=!1,e.nextTick(()=>{Se.value.show=!0,Se.value.x=t.clientX,Se.value.y=t.clientY,Se.value.categoryIndex=null;const L=Math.max(I.value.left,Math.min(n,I.value.right))-I.value.left,H=I.value.width/Dl.value.length,M=Math.floor(L/H);M>=0&&M<Dl.value.length&&(Se.value.categoryIndex=M)}))},It=t=>{if(!(t&&t.button===2)){if(Se.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}Se.value.show=!1}},At=t=>{if(typeof t.template=="function"){const s={series:S.series,categories:S.categories,markers:St.value},n={chartX:Se.value.chartX,chartY:Se.value.chartY,dataX:Se.value.mouseDataX,dataY:Se.value.mouseDataY,categoryIndex:Se.value.categoryIndex};return t.template(s,n)}return t.template||t.label||""},En=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},Wl=t=>t.style||{},ro=t=>t.type&&Rn.value[t.type]?Rn.value[t.type]:t.customIcon?t.customIcon:bn.value,io=t=>t==null?"":S.categories&&S.categories[t]?S.categories[t]:"",Vn=t=>St.value.length?St.value.filter(s=>s.categoryIndex===t):[],co=t=>{if(!fn.value&&!zt.value)return{x:0,y:0};const s=Ft(t),n=ee.value+I.value.bottom-Zt.value/2;return{x:s,y:n}},ql=()=>{St.value.forEach(t=>{if(t.categoryIndex!==void 0&&(fn.value||zt.value)){const s=co(t.categoryIndex);t.x=s.x,t.y=s.y}})},uo=()=>{if(he.value.description&&he.value.description.length&&he.value.date){if(y.value){const t=St.value.findIndex(s=>s.id===he.value.editingMarkerId);t!==-1?(St.value[t].description=he.value.description||"",St.value[t].color=he.value.color||"",St.value[t].type=he.value.type||"default",_e("update-marker",St.value[t])):_e("update-marker",{id:he.value.editingMarkerId,description:he.value.description||"",color:he.value.color||"",type:he.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=cl(he.value.date,S.categories||[]);if(zt.value){const{maxX:x}=qt.value;s=Math.max(0,Math.min(s,Math.floor(x)))}else fn.value&&(s=Math.max(0,Math.min(s,qt.value.maxX)));const n=Ft(s),c=ee.value+I.value.bottom-Zt.value/2,f=Array.isArray(S.categories)?S.categories[s]:null,g={id:t,title:"",description:he.value.description||"",color:he.value.color||"",type:he.value.type||"default",categoryIndex:s,x:n,y:c,marker_date:f||null};he.value.categoryIndex=s,St.value.push(g),_e("add-marker",g)}el(),fo()}},el=()=>{he.value.show=!1,he.value.title="",he.value.description="",he.value.color="#FF6B6B",he.value.type="default",he.value.editingMarkerId=null,he.value.readonly=!1,he.value.categoryIndex=null,he.value.fromButton=!1,he.value.date=null},mo=()=>{y.value&&(Mn(he.value.editingMarkerId),el())},Mn=t=>{const s=St.value.findIndex(n=>n.id===t);s!==-1&&(St.value.splice(s,1),fo()),_e("delete-marker",t)},po=t=>{if(he.value.show=!0,he.value.title=t?.title??t?.comment??"",he.value.description=t?.description??t?.comment??"",he.value.color=t?.color??"",he.value.type=t?.type??"default",he.value.editingMarkerId=t?.id??t?.marker_id??null,he.value.readonly=t?.readonly??!1,he.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[s,n,c]=String(t.marker_date).split("-"),f=Number(c?.length===2?`20${c}`:c),g=Number(s),x=Number(n)-1;g&&n&&f?he.value.date=new Date(f,x,g):he.value.date=null}else he.value.date=null},fo=()=>{try{const t=`dss-chart-markers-${S.chartId}`;localStorage.setItem(t,JSON.stringify(St.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},mn=()=>{try{const t=`dss-chart-markers-${S.chartId}`,s=localStorage.getItem(t);if(s){const n=JSON.parse(s);Array.isArray(n)&&(St.value=n.map(c=>({...c,originalYOffset:c.originalYOffset!==void 0?c.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),St.value=[]}},zn=t=>{const s=Vt.value||"Chart",n=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"}-${n}.${t}`},ml=()=>{const t=Ne.value.show,s=et.value.show;return Ne.value.show=!1,et.value.show=!1,{originalCrosshair:t,originalTooltip:s}},Cn=t=>{Ne.value.show=t.originalCrosshair,et.value.show=t.originalTooltip},Gn=async(t,s=32,n=32)=>new Promise((c,f)=>{if(t.startsWith("data:")){c(t);return}const g=new Image;g.crossOrigin="anonymous";const x=setTimeout(()=>{console.warn("Image conversion timeout for:",t),c(t)},5e3);g.onload=()=>{clearTimeout(x);try{const k=document.createElement("canvas"),L=k.getContext("2d");k.width=s,k.height=n,L.fillStyle="#fafafa",L.fillRect(0,0,s,n),L.drawImage(g,0,0,s,n);const T=k.toDataURL("image/png");c(T)}catch(k){console.warn("Canvas conversion failed:",k),c(t)}},g.onerror=k=>{clearTimeout(x),console.warn("Failed to load image:",t,k),c(t)},g.src=t}),tl=async()=>{try{const t=ml();setTimeout(async()=>{try{const s=document.querySelector(".dss-chart-svg");if(!s){console.error("Chart SVG element not found"),Cn(t);return}const n=De(),c=we.value,f=mt.value+n.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(oe=>oe.remove());const k=g.querySelectorAll("image"),L=Array.from(k).map(async oe=>{const Ye=oe.getAttribute("xlink:href")||oe.getAttribute("href");if(Ye&&!Ye.startsWith("data:"))try{const ke=await Gn(Ye,32,32);oe.setAttribute("xlink:href",ke),oe.setAttribute("href",ke)}catch(ke){console.warn("Failed to convert logo to base64:",ke)}});await Promise.all(L);const H=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let M="",K=30;if(Vt.value&&(M+=`
46
+ <text x="24" y="${K}"
47
47
  font-family="Arial, sans-serif"
48
48
  font-size="18"
49
49
  font-weight="bold"
50
50
  fill="#333">
51
- ${Et.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
52
- </text>`,G+=30),st.value&&(M+=`
53
- <text x="24" y="${G}"
51
+ ${Vt.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
52
+ </text>`,K+=30),at.value&&(M+=`
53
+ <text x="24" y="${K}"
54
54
  font-family="Arial, sans-serif"
55
55
  font-size="14"
56
56
  fill="#666">
57
- ${st.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
58
- </text>`,G+=25),Bt.value&&S.series.length>0){let ae=i-200,Xe=Et.value||st.value?35:25;const be=Math.floor((i-250)/120);let we=0;S.series.forEach((Fe,De)=>{if(!At.value.has(De)){const kt=Lt(De),bt=Fe.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");M+=`<circle cx="${ae+6}" cy="${Xe-4}" r="6" fill="${kt}"/>`,M+=`<text x="${ae+18}" y="${Xe}" font-family="Arial, sans-serif" font-size="12" fill="#333">${bt}</text>`,we++,we%be===0?(ae=i-200,Xe+=20):ae+=Math.min(120,bt.length*8+35)}})}let ce="";if(A.value)try{const{width:ae,height:Xe}=Be.value,be=ne.value,we=F.value.left,Fe=F.value.right,De=F.value.top,kt=F.value.bottom,bt=F.value.width,Vn=F.value.height;let Xt,pl;switch(be){case"center":Xt=we+(bt-ae)/2,pl=De+(Vn-Xe)/2;break;case"top-left":Xt=we+15,pl=De+5;break;case"top-right":Xt=Fe-ae-5,pl=De+5;break;case"bottom-left":Xt=we+15,pl=kt-Xe-5;break;case"bottom-right":default:Xt=Fe-ae-5,pl=kt-Xe-5;break}ce=`
59
- <g opacity="${X.value}">
60
- <g transform="translate(${Xt}, ${pl}) scale(${ae/499})">
57
+ ${at.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
58
+ </text>`,K+=25),$t.value&&S.series.length>0){let oe=c-200,Ye=Vt.value||at.value?35:25;const ke=Math.floor((c-250)/120);let be=0;S.series.forEach((Pe,Fe)=>{if(!Nt.value.has(Fe)){const kt=Mt(Fe),bt=Pe.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");M+=`<circle cx="${oe+6}" cy="${Ye-4}" r="6" fill="${kt}"/>`,M+=`<text x="${oe+18}" y="${Ye}" font-family="Arial, sans-serif" font-size="12" fill="#333">${bt}</text>`,be++,be%ke===0?(oe=c-200,Ye+=20):oe+=Math.min(120,bt.length*8+35)}})}let ce="";if(q.value)try{const{width:oe,height:Ye}=nt.value,ke=Be.value,be=I.value.left,Pe=I.value.right,Fe=I.value.top,kt=I.value.bottom,bt=I.value.width,Bn=I.value.height;let Kt,il;switch(ke){case"center":Kt=be+(bt-oe)/2,il=Fe+(Bn-Ye)/2;break;case"top-left":Kt=be+15,il=Fe+5;break;case"top-right":Kt=Pe-oe-5,il=Fe+5;break;case"bottom-left":Kt=be+15,il=kt-Ye-5;break;case"bottom-right":default:Kt=Pe-oe-5,il=kt-Ye-5;break}ce=`
59
+ <g opacity="${R.value}">
60
+ <g transform="translate(${Kt}, ${il}) scale(${oe/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"/>
62
62
  <path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
63
63
  <path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
@@ -72,8 +72,8 @@
72
72
  <path d="M47.5201 77.18H66.2501C73.5601 77.18 79.4801 71.26 79.4801 63.95C79.4801 56.64 73.5601 50.72 66.2501 50.72H47.3601C46.3801 50.72 45.5901 51.52 45.6001 52.5L45.7601 75.44C45.7601 76.41 46.5501 77.19 47.5201 77.19V77.18Z" fill="#07ACDD"/>
73
73
  <path d="M28.4201 76.12C35.1082 76.12 40.5301 70.6982 40.5301 64.01C40.5301 57.3218 35.1082 51.9 28.4201 51.9C21.7319 51.9 16.3101 57.3218 16.3101 64.01C16.3101 70.6982 21.7319 76.12 28.4201 76.12Z" fill="#fafafa"/>
74
74
  </g>
75
- </g>`}catch(ae){console.warn("Watermark processing failed, skipping watermark in SVG:",ae),ce=""}const Ne=`<?xml version="1.0" encoding="UTF-8"?>
76
- <svg width="${i}" height="${f}"
75
+ </g>`}catch(oe){console.warn("Watermark processing failed, skipping watermark in SVG:",oe),ce=""}const Ee=`<?xml version="1.0" encoding="UTF-8"?>
76
+ <svg width="${c}" height="${f}"
77
77
  xmlns="http://www.w3.org/2000/svg"
78
78
  xmlns:xlink="http://www.w3.org/1999/xlink">
79
79
  <defs>
@@ -89,29 +89,29 @@
89
89
  ${H}
90
90
  ${ce}
91
91
  </g>
92
- </svg>`,J=new Blob([Ne],{type:"image/svg+xml;charset=utf-8"}),pe=URL.createObjectURL(J),ye=document.createElement("a");ye.href=pe,ye.download=Kt("svg"),document.body.appendChild(ye),ye.click(),document.body.removeChild(ye),URL.revokeObjectURL(pe),_n(t),yt()}catch(s){console.error("Error downloading SVG:",s),_n(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},sl=async()=>{try{const t=Jn();document.querySelector(".dss-custom-chart-container").offsetHeight,await new Promise(ae=>setTimeout(ae,300));const s=Ae(),n=xe.value,i=mt.value+s.height,f=document.createElement("canvas"),g=f.getContext("2d"),E=2;f.width=n*E,f.height=i*E,f.style.width=n+"px",f.style.height=i+"px",g.scale(E,E),g.fillStyle="#fafafa",g.fillRect(0,0,n,i);let k=30;if(Et.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(Et.value,24,k),k+=30),st.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(st.value,24,k),k+=25),Bt.value&&S.series.length>0){let ae=n-200,Xe=Et.value||st.value?35:25;const be=Math.floor((n-250)/120);let we=0;g.font="12px Arial, sans-serif",S.series.forEach((Fe,De)=>{if(!At.value.has(De)){const kt=Lt(De);g.beginPath(),g.arc(ae+6,Xe-4,6,0,2*Math.PI),g.fillStyle=kt,g.fill(),g.fillStyle="#333",g.fillText(Fe.name,ae+18,Xe),we++,we%be===0?(ae=n-200,Xe+=20):ae+=Math.min(120,Fe.name.length*8+35)}})}const T=document.querySelector(".dss-chart-svg").cloneNode(!0),H=T.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),M=T.querySelectorAll(".dss-crosshair"),G=T.querySelectorAll('[class*="tooltip"]');H.forEach(ae=>ae.remove()),M.forEach(ae=>ae.remove()),G.forEach(ae=>ae.remove()),T.querySelectorAll("image").forEach((ae,Xe)=>{const be=ae.getAttribute("xlink:href")||ae.getAttribute("href");if(be&&!be.startsWith("data:")){const we=Rt.value[Xe],Fe=we?Lt(we.seriesIndex):"#3B82F6",De=ae.getAttribute("x")||0,kt=ae.getAttribute("y")||0,bt=ae.getAttribute("width")||32,Vn=ae.getAttribute("height")||32,Xt=document.createElementNS("http://www.w3.org/2000/svg","circle");Xt.setAttribute("cx",parseFloat(De)+parseFloat(bt)/2),Xt.setAttribute("cy",parseFloat(kt)+parseFloat(Vn)/2),Xt.setAttribute("r",Math.min(parseFloat(bt),parseFloat(Vn))/2-1),Xt.setAttribute("fill",Fe),Xt.setAttribute("stroke","#fafafa"),Xt.setAttribute("stroke-width","2"),ae.parentNode.replaceChild(Xt,ae)}});const Ne=new XMLSerializer().serializeToString(T),J=new Blob([Ne],{type:"image/svg+xml;charset=utf-8"}),pe=URL.createObjectURL(J),ye=new Image;return new Promise((ae,Xe)=>{ye.onload=async()=>{try{if(g.drawImage(ye,0,s.height),Rt.value.forEach(be=>{const we=be.x,Fe=be.y+s.height,De=(be.width||32)/2,kt=Lt(be.seriesIndex);g.save(),g.beginPath(),g.arc(we,Fe,De-1,0,2*Math.PI),g.fillStyle=kt,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),A.value){const be=new Image,we=()=>{const{width:De,height:kt}=Be.value,bt=ne.value,Vn=F.value.left,Xt=F.value.right,pl=F.value.top,Wo=F.value.bottom,Go=F.value.width,Qo=F.value.height;let ql,Ul;switch(bt){case"center":ql=Vn+(Go-De)/2,Ul=pl+s.height+(Qo-kt)/2;break;case"top-left":ql=Vn+15,Ul=pl+s.height+10;break;case"top-right":ql=Xt-De-5,Ul=pl+s.height+10;break;case"bottom-left":ql=Vn+15,Ul=Wo+s.height-kt-5;break;case"bottom-right":default:ql=Xt-De-5,Ul=Wo+s.height-kt-5;break}g.globalAlpha=X.value,g.drawImage(be,ql,Ul,De,kt),g.globalAlpha=1,Fe()},Fe=()=>{f.toBlob(De=>{const kt=URL.createObjectURL(De),bt=document.createElement("a");bt.href=kt,bt.download=Kt("png"),document.body.appendChild(bt),bt.click(),document.body.removeChild(bt),URL.revokeObjectURL(kt),URL.revokeObjectURL(pe),_n(t),yt(),ae()},"image/png")};be.onload=we,be.onerror=Fe,be.src=sn.value}else f.toBlob(be=>{const we=URL.createObjectURL(be),Fe=document.createElement("a");Fe.href=we,Fe.download=Kt("png"),document.body.appendChild(Fe),Fe.click(),document.body.removeChild(Fe),URL.revokeObjectURL(we),URL.revokeObjectURL(pe),_n(t),yt(),ae()},"image/png")}catch(be){URL.revokeObjectURL(pe),_n(t),Xe(be)}},ye.onerror=()=>{URL.revokeObjectURL(pe),_n(t),Xe(new Error("Failed to load SVG image"))},ye.src=pe})}catch(t){console.error("Error downloading PNG:",t)}},rl=()=>{try{let t="";Et.value&&(t+=`# ${z("chart.csv.chartTitle")}: ${Et.value}
93
- `),st.value&&(t+=`# ${z("chart.csv.chartSubtitle")}: ${st.value}
92
+ </svg>`,J=new Blob([Ee],{type:"image/svg+xml;charset=utf-8"}),pe=URL.createObjectURL(J),ye=document.createElement("a");ye.href=pe,ye.download=zn("svg"),document.body.appendChild(ye),ye.click(),document.body.removeChild(ye),URL.revokeObjectURL(pe),Cn(t),It()}catch(s){console.error("Error downloading SVG:",s),Cn(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},nl=async()=>{try{const t=ml();document.querySelector(".dss-custom-chart-container").offsetHeight,await new Promise(oe=>setTimeout(oe,300));const s=De(),n=we.value,c=mt.value+s.height,f=document.createElement("canvas"),g=f.getContext("2d"),x=2;f.width=n*x,f.height=c*x,f.style.width=n+"px",f.style.height=c+"px",g.scale(x,x),g.fillStyle="#fafafa",g.fillRect(0,0,n,c);let k=30;if(Vt.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(Vt.value,24,k),k+=30),at.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(at.value,24,k),k+=25),$t.value&&S.series.length>0){let oe=n-200,Ye=Vt.value||at.value?35:25;const ke=Math.floor((n-250)/120);let be=0;g.font="12px Arial, sans-serif",S.series.forEach((Pe,Fe)=>{if(!Nt.value.has(Fe)){const kt=Mt(Fe);g.beginPath(),g.arc(oe+6,Ye-4,6,0,2*Math.PI),g.fillStyle=kt,g.fill(),g.fillStyle="#333",g.fillText(Pe.name,oe+18,Ye),be++,be%ke===0?(oe=n-200,Ye+=20):oe+=Math.min(120,Pe.name.length*8+35)}})}const T=document.querySelector(".dss-chart-svg").cloneNode(!0),H=T.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),M=T.querySelectorAll(".dss-crosshair"),K=T.querySelectorAll('[class*="tooltip"]');H.forEach(oe=>oe.remove()),M.forEach(oe=>oe.remove()),K.forEach(oe=>oe.remove()),T.querySelectorAll("image").forEach((oe,Ye)=>{const ke=oe.getAttribute("xlink:href")||oe.getAttribute("href");if(ke&&!ke.startsWith("data:")){const be=Pt.value[Ye],Pe=be?Mt(be.seriesIndex):"#3B82F6",Fe=oe.getAttribute("x")||0,kt=oe.getAttribute("y")||0,bt=oe.getAttribute("width")||32,Bn=oe.getAttribute("height")||32,Kt=document.createElementNS("http://www.w3.org/2000/svg","circle");Kt.setAttribute("cx",parseFloat(Fe)+parseFloat(bt)/2),Kt.setAttribute("cy",parseFloat(kt)+parseFloat(Bn)/2),Kt.setAttribute("r",Math.min(parseFloat(bt),parseFloat(Bn))/2-1),Kt.setAttribute("fill",Pe),Kt.setAttribute("stroke","#fafafa"),Kt.setAttribute("stroke-width","2"),oe.parentNode.replaceChild(Kt,oe)}});const Ee=new XMLSerializer().serializeToString(T),J=new Blob([Ee],{type:"image/svg+xml;charset=utf-8"}),pe=URL.createObjectURL(J),ye=new Image;return new Promise((oe,Ye)=>{ye.onload=async()=>{try{if(g.drawImage(ye,0,s.height),Pt.value.forEach(ke=>{const be=ke.x,Pe=ke.y+s.height,Fe=(ke.width||32)/2,kt=Mt(ke.seriesIndex);g.save(),g.beginPath(),g.arc(be,Pe,Fe-1,0,2*Math.PI),g.fillStyle=kt,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),q.value){const ke=new Image,be=()=>{const{width:Fe,height:kt}=nt.value,bt=Be.value,Bn=I.value.left,Kt=I.value.right,il=I.value.top,qo=I.value.bottom,Qo=I.value.width,Jo=I.value.height;let Pl,Ol;switch(bt){case"center":Pl=Bn+(Qo-Fe)/2,Ol=il+s.height+(Jo-kt)/2;break;case"top-left":Pl=Bn+15,Ol=il+s.height+10;break;case"top-right":Pl=Kt-Fe-5,Ol=il+s.height+10;break;case"bottom-left":Pl=Bn+15,Ol=qo+s.height-kt-5;break;case"bottom-right":default:Pl=Kt-Fe-5,Ol=qo+s.height-kt-5;break}g.globalAlpha=R.value,g.drawImage(ke,Pl,Ol,Fe,kt),g.globalAlpha=1,Pe()},Pe=()=>{f.toBlob(Fe=>{const kt=URL.createObjectURL(Fe),bt=document.createElement("a");bt.href=kt,bt.download=zn("png"),document.body.appendChild(bt),bt.click(),document.body.removeChild(bt),URL.revokeObjectURL(kt),URL.revokeObjectURL(pe),Cn(t),It(),oe()},"image/png")};ke.onload=be,ke.onerror=Pe,ke.src=Ln.value}else f.toBlob(ke=>{const be=URL.createObjectURL(ke),Pe=document.createElement("a");Pe.href=be,Pe.download=zn("png"),document.body.appendChild(Pe),Pe.click(),document.body.removeChild(Pe),URL.revokeObjectURL(be),URL.revokeObjectURL(pe),Cn(t),It(),oe()},"image/png")}catch(ke){URL.revokeObjectURL(pe),Cn(t),Ye(ke)}},ye.onerror=()=>{URL.revokeObjectURL(pe),Cn(t),Ye(new Error("Failed to load SVG image"))},ye.src=pe})}catch(t){console.error("Error downloading PNG:",t)}},_n=()=>{try{let t="";Vt.value&&(t+=`# ${z("chart.csv.chartTitle")}: ${Vt.value}
93
+ `),at.value&&(t+=`# ${z("chart.csv.chartSubtitle")}: ${at.value}
94
94
  `),t+=`# ${z("chart.csv.generated")}: ${new Date().toLocaleString()}
95
95
 
96
- `,t+="Category",S.series.forEach(g=>{const E=g.name.replace(/"/g,'""');t+=',"'+E+'"'}),t+=`
96
+ `,t+="Category",S.series.forEach(g=>{const x=g.name.replace(/"/g,'""');t+=',"'+x+'"'}),t+=`
97
97
  `;const s=Math.max(...S.series.map(g=>g.data?.length||0));for(let g=0;g<s;g++){let L='"'+(S.categories[g]||z("chart.fallback.item",{number:g+1})).toString().replace(/"/g,'""')+'"';S.series.forEach(T=>{const H=T.data&&T.data[g]!==void 0?T.data[g]:"";L+=","+H}),t+=L+`
98
- `}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(n),f=document.createElement("a");f.href=i,f.download=Kt("csv"),document.body.appendChild(f),f.click(),document.body.removeChild(f),URL.revokeObjectURL(i),yt()}catch(t){console.error("Error downloading CSV:",t)}},Bn=t=>{if(typeof t.action=="function"){const s={series:S.series,categories:S.categories,markers:Tt.value},n={chartX:We.value.chartX,chartY:We.value.chartY,dataX:We.value.mouseDataX,dataY:We.value.mouseDataY,categoryIndex:clampedCategoryIndex||We.value.categoryIndex};t.action(s,n)}yt()},Gl=()=>{al(),he.value.show=!0,he.value.categoryIndex=We.value.categoryIndex,he.value.fromButton=!1,yt()},Sl=()=>{al(),he.value.show=!0,he.value.categoryIndex=0,he.value.fromButton=!0},mo=t=>{if(We.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(We.value.show=!1)}},Rl=t=>{We.value.show&&!t.target.closest(".context-menu")&&(We.value.show=!1)},Ql=t=>{if(!rn.value||!_e.value)return;t.preventDefault(),t.stopPropagation(),Z.value.isZooming=!0,qe.value.show=!1,Z.value.zoomTimeout&&clearTimeout(Z.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,f=t.clientY-n.top;if(i<F.value.left-50||i>F.value.right+50||f<F.value.top-50||f>F.value.bottom+100){Z.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,E=Math.max(Z.value.minScale,Math.min(Z.value.maxScale,Z.value.scale*g));if(E!==Z.value.scale){const{minX:k,maxX:L}=zt.value,T=L-k||1,H=T/Z.value.scale,M=k-Z.value.offsetX/F.value.width*T,G=(i-F.value.left)/F.value.width,ce=M+G*H;Z.value.scale=E;const Ne=T/Z.value.scale,J=ce-G*Ne;Z.value.offsetX=-(J-k)/T*F.value.width,Z.value.scale<=1.01&&(Z.value.scale=1,Z.value.offsetX=0)}Z.value.zoomTimeout=setTimeout(()=>{Z.value.isZooming=!1,Z.value.zoomTimeout=null},300)},So=t=>{if(!rn.value||!_e.value||Z.value.scale<=1)return;qe.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,Z.value.isDragging=!0,Z.value.lastMouseX=t.clientX,Z.value.lastMouseY=t.clientY,t.preventDefault()},Bo=()=>{Z.value.isDragging=!1},Fl=()=>{!rn.value||!_e.value||(Z.value.scale=1,Z.value.offsetX=0,Z.value.isDragging=!1,Z.value.zoomTimeout&&(clearTimeout(Z.value.zoomTimeout),Z.value.zoomTimeout=null),Z.value.isZooming=!1)},Mo=()=>!rn.value||!Nl.value||!_e.value?"default":Z.value.isDragging?"grabbing":Z.value.scale>1?"grab":"dss-crosshair",Jl=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 n=0;n<t.length-1;n++){const i=t[Math.max(n-1,0)],f=t[n],g=t[n+1],E=t[Math.min(n+2,t.length-1)],k=f.x+(g.x-i.x)/6*U.value,L=f.y+(g.y-i.y)/6*U.value,T=g.x-(E.x-f.x)/6*U.value,H=g.y-(E.y-f.y)/6*U.value;s+=` C ${k} ${L} ${T} ${H} ${g.x} ${g.y}`}return s},xn=e.computed(()=>{const s=O.value?.chart?.padding,n=typeof s=="number"?s:null,i=s&&typeof s=="object"?s:null,f=50;let g=f+(Wt.value?30:0)+60;if(On.value){const M={left:f+40,top:f+40,right:f+40,bottom:f+40};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??M.left,top:i.top??M.top,right:i.right??M.right,bottom:i.bottom??M.bottom}:M}if(pn.value){const M=!Bt.value,G=Nn.value,ce=G?Hn.value+Cn.value+Math.max(24,nn.value+16):0,Ne=M?12:f;let J=0;Et.value&&(J+=M?8:15),st.value&&(J+=M?6:10);const pe=Ae();let ye=Ne+(M?4:16)+(G?ce:0),ae=Ne+(G?ce:0);Bt.value&&Ue.value==="left"?ye+=pe.legendWidth||150:Bt.value&&Ue.value==="right"&&(ae+=pe.legendWidth||150);const be=ge.value==="semi-radial"?G?ce:8:G?ce:M?8:f+80,we=G?14:0,Fe=Ne+J+we,De={left:ye,top:Fe,right:ae,bottom:be};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??De.left,top:i.top??De.top,right:i.right??De.right,bottom:i.bottom??De.bottom}:De}let E=0;Et.value&&(E+=15),st.value&&(E+=10);const k=Ae();let L=f+16,T=f;Bt.value&&Ue.value==="left"?L+=k.legendWidth||150:Bt.value&&Ue.value==="right"&&(T+=k.legendWidth||150),Bt.value&&Ue.value==="bottom"&&(g+=k.legendHeight||0);const H={left:L,top:f+E,right:T,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??H.left,top:i.top??H.top,right:i.right??H.right,bottom:i.bottom??H.bottom}:H}),F=e.computed(()=>({left:xn.value.left,top:xn.value.top,right:xe.value-xn.value.right,bottom:mt.value-xn.value.bottom,width:xe.value-(xn.value.left+xn.value.right),height:mt.value-(xn.value.top+xn.value.bottom)})),rn=e.computed(()=>["line","area","bar"].includes(ge.value)||gt.value),Dn=e.computed(()=>gt.value),pn=e.computed(()=>["radial","semi-radial"].includes(ge.value)),On=e.computed(()=>ge.value==="spider"),Pt=e.computed(()=>ge.value==="bubble"),Gt=e.computed(()=>O.value?.chart?.orientation==="horizontal"&&(ge.value==="bar"||Dn.value)),il=t=>{const{minY:s,maxY:n}=zt.value,i=n-s||1;return F.value.left+(t-s)/i*F.value.width},vl=t=>{const{maxX:s}=zt.value,n=s+1,f=F.value.height/n;return F.value.top+(t+.5)*f},Mt=e.computed(()=>pn.value?xn.value.left+(xe.value-xn.value.left-xn.value.right)/2:xe.value/2),Nt=e.computed(()=>On.value?mt.value/2-40:pn.value?xn.value.top+(mt.value-xn.value.top-xn.value.bottom)/2:mt.value/2),at=e.computed(()=>{if(On.value){const t=F.value.width-80,s=F.value.height-80;return Math.min(t,s)/2}return Math.min(F.value.width,F.value.height)/2}),It=e.computed(()=>{const t=O.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof s=="number"&&s>=0&&s<=1?s:.45;return at.value*n}),Il=e.computed(()=>{const t=O.value,s=typeof S.innerSize=="number"?S.innerSize:t?.innerSize;return typeof s!="number"||s<=-100||!(pn.value||On.value)?1:1+s/100}),po=e.computed(()=>{const t=Il.value;if(t===1||t<=0)return;const s=Mt.value,n=Nt.value;return`translate(${s}, ${n}) scale(${t}) translate(${-s}, ${-n})`}),Bl=e.ref(0),zl=e.computed(()=>`semi-radial-fill-clip-${S.chartId}`),En=e.computed(()=>ge.value==="semi-radial"),Zn=e.computed(()=>En.value&&x.value&&!Gn.value),Wn=e.computed(()=>En.value&&x.value&&!Gn.value&&C.value==="fill"),Ml=e.computed(()=>{const t=Zn.value?Bl.value:1,s=Mt.value,n=Nt.value,i=It.value,f=at.value,g=Math.PI,E=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;const k=s+f*Math.cos(g),L=n+f*Math.sin(g),T=s+f*Math.cos(E),H=n+f*Math.sin(E),M=s+i*Math.cos(E),G=n+i*Math.sin(E),ce=s+i*Math.cos(g),Ne=n+i*Math.sin(g),J=t>.5?1:0;return`M ${s} ${n} L ${k} ${L} A ${f} ${f} 0 ${J} 1 ${T} ${H} L ${M} ${G} A ${i} ${i} 0 ${J} 1 ${ce} ${Ne} Z`}),Ot=e.computed(()=>{if(!(!En.value||!Zn.value)&&!Wn.value)return`url(#${zl.value})`}),fo=t=>{if(!(!Wn.value||t!==0))return`url(#${zl.value})`},cl=e.ref(0),ul=e.computed(()=>`radial-reveal-clip-${S.chartId}`),gn=e.computed(()=>ge.value==="radial"),bl=e.computed(()=>{const t=gn.value?cl.value:1,s=Mt.value,n=Nt.value,i=Math.max(at.value*1.5,xe.value,mt.value);if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;if(t>=1){const M=s-i,G=s+i;return`M ${M} ${n} A ${i} ${i} 0 0 1 ${G} ${n} A ${i} ${i} 0 0 1 ${M} ${n} Z`}const f=-Math.PI/2,g=f+t*Math.PI*2,E=s+i*Math.cos(f),k=n+i*Math.sin(f),L=s+i*Math.cos(g),T=n+i*Math.sin(g),H=t>=.5?1:0;return`M ${s} ${n} L ${E} ${k} A ${i} ${i} 0 ${H} 1 ${L} ${T} Z`}),gl=e.computed(()=>{if(Ot.value)return Ot.value;if(gn.value)return`url(#${ul.value})`});let qn=null;const _o=()=>{if(!Zn.value)return;Bl.value=0;const t=V.value,s=performance.now(),n=i=>{const f=i-s,g=Math.min(1,f/t);Bl.value=El(Y.value,g),g<1&&(qn=requestAnimationFrame(n))};qn=requestAnimationFrame(n)},vo=e.computed(()=>O.value?.bubbles?.minSize||8),_l=e.computed(()=>O.value?.bubbles?.maxSize||50),eo=e.computed(()=>O.value?.bubbles?.opacity||.7),wl=(t,s)=>{const n=[15,20,25,18,22],i=n[t%n.length]||20,f=1+Math.sin(s*.5)*.2;return Math.max(5,i*f)},go=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},$o=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},nl=e.computed(()=>S.series),Un=e.computed(()=>S.series.filter((t,s)=>!At.value.has(s))),Xn="auto",zt=e.computed(()=>{if(Pt.value)return To();if(!Un.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,n=0;Un.value.forEach(k=>{k.data&&k.data.length&&(n=Math.max(n,k.data.length-1),k.data.forEach(L=>{typeof L=="number"&&(t=Math.min(t,L),s=Math.max(s,L))}))}),S.categories.length>0&&(n=Math.max(n,S.categories.length-1)),t===1/0&&(t=0,s=100);const i=xt.value,f=et.value;let g,E;if(i===Xn){const k=s-t,L=k>0?k*.1:1;g=Math.max(0,t-L)}else if(typeof i=="number")g=i;else{const k=s-t,L=k>0?k*.1:1;g=Math.max(0,t-L)}if(f===Xn){const k=s-t,L=k>0?k*.1:2;E=s+L}else if(typeof f=="number")E=f;else{const k=s-t,L=k>0?k*.1:2;E=s+L}return{minX:0,maxX:n,minY:g,maxY:E}}),To=()=>{if(!Un.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,s=-1/0,n=1/0,i=-1/0,f=1/0,g=-1/0,E=!1;if(Un.value.forEach((ce,Ne)=>{ce?.data?.length&&ce.data.forEach((J,pe)=>{let ye,ae,Xe;if(typeof J=="object"&&J!==null&&!Array.isArray(J))ye=typeof J.x=="number"?J.x:pe,ae=typeof J.y=="number"?J.y:0,Xe=typeof J.size=="number"?J.size:20;else if(Array.isArray(J)&&J.length>=3)ye=typeof J[0]=="number"?J[0]:pe,ae=typeof J[1]=="number"?J[1]:0,Xe=typeof J[2]=="number"?J[2]:20;else if(typeof J=="number")ye=pe,ae=J,Xe=wl(Ne,pe);else return;isFinite(ye)&&isFinite(ae)&&isFinite(Xe)&&(t=Math.min(t,ye),s=Math.max(s,ye),n=Math.min(n,ae),i=Math.max(i,ae),f=Math.min(f,Xe),g=Math.max(g,Xe),E=!0)})}),!E)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===s&&(t=Math.min(t,0),s=Math.max(s,S.categories?.length-1||8)),n===i&&(n=Math.max(0,n-10),i=n+20);const k=s-t,L=i-n;let T,H,M,G;return Ye.value!==null?T=Ye.value:T=t-k*.1,Ft.value!==null?H=Ft.value:H=s+k*.1,xt.value!==null&&typeof xt.value=="number"?M=xt.value:M=Math.max(0,n-L*.1),et.value!==null&&typeof et.value=="number"?G=et.value:G=i+L*.1,{minX:T,maxX:H,minY:M,maxY:G,minSize:f,maxSize:g}},Zt=t=>{if(Pt.value){const{minX:k,maxX:L}=zt.value,T=L-k||1;return F.value.left+(t-k)/T*F.value.width}const{minX:s,maxX:n}=zt.value,i=n-s;if(n===0||i===0)return F.value.left+F.value.width/2;const f=i/Z.value.scale,g=s-Z.value.offsetX/F.value.width*i,E=(t-g)/f;return F.value.left+E*F.value.width},Qt=t=>{const{minY:s,maxY:n}=zt.value,i=n-s||1;return F.value.bottom-(t-s)/i*F.value.height},ho=t=>{if(!Pt.value)return Ze.value||4;const{maxSize:s}=zt.value,n=Math.max(1,s),i=Math.min(1,Math.max(0,t/n));return vo.value+i*(_l.value-vo.value)},Lo=e.computed(()=>Co.value.map(t=>({y:t.y}))),Pl=e.computed(()=>{if(Pt.value)return yo();if(ge.value==="bar"){if(Gt.value){const be=[],{minY:we,maxY:Fe}=zt.value,De=5,kt=Fe-we||1;for(let bt=0;bt<=De;bt++){const Vn=we+kt*(bt/De),Xt=il(Vn);be.push({x:Xt,y:F.value.bottom+20,text:un(Math.round(Vn))})}return be}const Ne=[],{maxX:J}=zt.value,pe=J+1,ye=5,Xe=(F.value.width-ye*2)/pe;for(let be=0;be<=J;be++){const we=F.value.left+ye+(be+.5)*Xe;Ne.push({x:we,y:F.value.bottom+20,text:S.categories[be]||z("chart.fallback.item",{number:be+1})})}return Ne}const t=[],{minX:s,maxX:n}=zt.value,i=n-s||1,f=i/Z.value.scale,g=s-Z.value.offsetX/F.value.width*i,E=g+f,k=Math.max(0,Math.floor(g-2)),L=Math.min(n,Math.ceil(E+2)),T=L-k,H=F.value.width,G=Math.floor(H/60);let ce=1;T>G&&(ce=Math.ceil(T/G));for(let Ne=k;Ne<=L;Ne+=ce)if(Ne>=0&&Ne<=n){const J=Zt(Ne);J>=F.value.left-100&&J<=F.value.right+100&&t.push({x:J,y:F.value.bottom+20,text:S.categories[Ne]||`Item ${Ne+1}`})}return t}),yo=()=>{const t=[],{minX:s,maxX:n}=zt.value,i=n-s||1,f=Math.min(8,Math.max(4,Math.floor(F.value.width/80)));for(let g=0;g<=f;g++){const E=s+i*g/f,k=Zt(E);if(k>=F.value.left-10&&k<=F.value.right+10){const L=Math.round(E),T=S.categories?.[L];t.push({x:k,y:F.value.bottom+20,text:T||(Number.isInteger(E)?E.toString():E.toFixed(1))})}}return t},Co=e.computed(()=>{if(Gt.value){const f=[],{maxX:g}=zt.value;for(let E=0;E<=g;E++)f.push({x:F.value.left-10,y:vl(E),text:S.categories[E]||`Item ${E+1}`});return f}const t=[],{minY:s,maxY:n}=zt.value,i=5;for(let f=0;f<=i;f++){const g=s+(n-s)*(f/i),E=Math.round(g);t.push({x:F.value.left-10,y:Qt(g),text:un(E)})}return t}),Lt=t=>{const s=ie.value;if(!s||s.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return s[t%s.length]},dl=t=>{if(!t||typeof t!="string")return"#3a3a3a";const s=t.trim();let n=0,i=0,f=0;const g=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)n=Number(g[1])/255,i=Number(g[2])/255,f=Number(g[3])/255;else{const k=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(k)n=Number(k[1])/255,i=Number(k[2])/255,f=Number(k[3])/255;else{const L=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(L){let T=L[1];T.length===3&&(T=T[0]+T[0]+T[1]+T[1]+T[2]+T[2]),n=parseInt(T.slice(0,2),16)/255,i=parseInt(T.slice(2,4),16)/255,f=parseInt(T.slice(4,6),16)/255}else if(typeof document<"u"){const T=document.createElement("span");T.style.color=s,T.style.display="none",document.body.appendChild(T);const H=getComputedStyle(T).color;document.body.removeChild(T);const M=H.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(M)n=Number(M[1])/255,i=Number(M[2])/255,f=Number(M[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*i+.0722*f>.5?"#3a3a3a":"#fafafa"},$l=t=>{if(!t||typeof t!="string")return t;const s=t.trim(),n=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(n){const g=Math.max(0,Math.floor(Number(n[1])*.65)),E=Math.max(0,Math.floor(Number(n[2])*.65)),k=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${E}, ${k})`}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)),E=Math.max(0,Math.floor(Number(i[2])*.65)),k=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${E}, ${k}, ${i[4]})`}const f=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(f){let g=f[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const E=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),k=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),L=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[E,k,L].map(T=>T.toString(16).padStart(2,"0")).join("")}`}return s},Ol=(t,s)=>{const i=O.value?.stroke?.color;return i==null?$l(s):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??$l(s):$l(s)},to=t=>{let s=0;for(let n=1;n<t.length;n++){const i=t[n].x-t[n-1].x,f=t[n].y-t[n-1].y;s+=Math.sqrt(i*i+f*f)}return s},ko=e.computed(()=>ge.value==="line"||Dn.value?(Dn.value?S.series.filter(s=>(s.type||ge.value)==="line"):nl.value).map((s,n)=>{const i=S.series.findIndex(M=>M===s),f=[];let g=[];s.data.forEach((M,G)=>{M==null?g.length>0&&(f.push([...g]),g=[]):g.push({x:Gt.value?il(M):Zt(G),y:Gt.value?vl(G):Qt(M),index:G})}),g.length>0&&f.push(g);let E="";f.forEach(M=>{if(M.length>0){let G="";q.value?G=Jl(M):G=`M ${M[0].x} ${M[0].y}`+M.slice(1).map(ce=>` L ${ce.x} ${ce.y}`).join(""),E+=(E?" ":"")+G}});const k=f.reduce((M,G)=>M+to(G),0),L=At.value.has(i),T=Ce.value===i,H=Ce.value!==null&&Ce.value!==i;return{path:E,color:Lt(i),pathLength:k,seriesIndex:i,animationDelay:n*Ve.value,isHighlighted:T,isDimmed:H,isHidden:L}}):[]),bo=e.computed(()=>{if(!(ge.value==="line"||Dn.value))return[];const t=Dn.value?S.series.filter(n=>(n.type||ge.value)==="line"):nl.value,s=[];return t.forEach((n,i)=>{const f=S.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const E=n.data[g];if(E!=null){let k=-1,L=0;for(let T=g+1;T<n.data.length;T++){const H=n.data[T];if(H==null)L++;else{k=T;break}}if(L>0&&k!==-1){const T=n.data[k],H=Gt.value?il(E):Zt(g),M=Gt.value?vl(g):Qt(E),G=Gt.value?il(T):Zt(k),ce=Gt.value?vl(k):Qt(T),Ne=At.value.has(f),J=Ce.value===f,pe=Ce.value!==null&&Ce.value!==f;s.push({path:`M ${H} ${M} L ${G} ${ce}`,color:Lt(f),seriesIndex:f,animationDelay:i*Ve.value,isHighlighted:J,isDimmed:pe,isHidden:Ne,gapSize:L}),g=k-1}}}}),s}),Zl=e.computed(()=>ge.value==="line"||Dn.value?!x.value||Gn.value||Ct.value.hasAnimated?[]:(Dn.value?S.series.filter(s=>(s.type||ge.value)==="line"):nl.value).map((s,n)=>{const i=S.series.findIndex(L=>L===s);let f="",g=null;s.data.forEach((L,T)=>{if(L!=null){const H={x:Gt.value?il(L):Zt(T),y:Gt.value?vl(T):Qt(L)};g===null?f+=`M ${H.x} ${H.y}`:f+=` L ${H.x} ${H.y}`,g=H}else if(g!==null){const H=s.data.findIndex((M,G)=>G>T&&M!==null&&M!==void 0);if(H!==-1){const M={x:Gt.value?il(s.data[H]):Zt(H),y:Gt.value?vl(H):Qt(s.data[H])};f+=` L ${M.x} ${M.y}`,g=M}}});const E=s.data.map((L,T)=>L==null?null:{x:Gt.value?il(L):Zt(T),y:Gt.value?vl(T):Qt(L)}).filter(L=>L!==null),k=to(E);return{path:f,pathLength:k,color:Lt(i),animationDelay:n*Ve.value,seriesIndex:i}}):[]),Rn=e.computed(()=>{if(ge.value!=="line")return[];const t=[];return nl.value.forEach((s,n)=>{const i=Ce.value===n,f=Ce.value!==null&&Ce.value!==n,g=At.value.has(n);s.data.forEach((E,k)=>{E!=null&&t.push({x:Zt(k),y:Qt(E),color:Lt(n),value:E,label:S.categories[k]||k.toString(),seriesName:s.name,categoryIndex:k,dataIndex:k,animationDelay:(n*s.data.length+k)*(Ve.value/8),isHighlighted:i,isDimmed:f,isHidden:g})})}),t}),Ho=e.computed(()=>{if(!Dn.value)return[];const t=[];return S.series.filter(n=>(n.type||ge.value)==="line").forEach((n,i)=>{const f=S.series.findIndex(L=>L===n),g=Ce.value===f,E=Ce.value!==null&&Ce.value!==f,k=At.value.has(f);n.data.forEach((L,T)=>{L!=null&&t.push({x:Zt(T),y:Qt(L),color:Lt(f),value:L,label:S.categories[T]||T.toString(),seriesName:n.name,categoryIndex:T,dataIndex:T,animationDelay:(i*n.data.length+T)*(Ve.value/8),isHighlighted:g,isDimmed:E,isHidden:k})})}),t}),Yn=e.computed(()=>{if(!Pt.value)return[];const t=[];return nl.value.forEach((s,n)=>{if(!s?.data?.length)return;const i=Ce.value,f=i!==null&&i===n,g=i!==null&&i!==n,E=At.value.has(n);s.data.forEach((k,L)=>{let T,H,M,G,ce;if(typeof k=="object"&&k!==null&&!Array.isArray(k))T=typeof k.x=="number"?k.x:L,H=typeof k.y=="number"?k.y:0,M=typeof k.size=="number"?k.size:20,G=k.label||S.categories?.[L]||`Point ${L+1}`,ce=k.image||k.imageUrl;else if(Array.isArray(k)&&k.length>=3)T=typeof k[0]=="number"?k[0]:L,H=typeof k[1]=="number"?k[1]:0,M=typeof k[2]=="number"?k[2]:20,G=k[3]||S.categories?.[L]||`Point ${L+1}`,ce=k[4];else if(typeof k=="number")T=L,H=k,M=wl(n,L),G=S.categories?.[L]||`Point ${L+1}`;else return;!isFinite(T)||!isFinite(H)||!isFinite(M)||t.push({x:Zt(T),y:Qt(H),radius:ho(M),originalX:T,originalY:H,originalSize:M,color:Lt(n),seriesName:s.name||`Series ${n+1}`,label:G,imageUrl:ce,seriesIndex:n,dataIndex:L,categoryIndex:Math.round(T),isHighlighted:f,isDimmed:g,isHidden:E,opacity:eo.value})})}),t}),Tl=e.computed(()=>ge.value!=="area"?[]:nl.value.map((t,s)=>{const n=[];let i=[];if(t.data.forEach((M,G)=>{M==null?i.length>0&&(n.push([...i]),i=[]):i.push({x:Zt(G),y:Qt(M),index:G})}),i.length>0&&n.push(i),n.length===0)return{linePath:"",areaPath:"",color:Lt(s),isHidden:At.value.has(s)};const f=F.value.bottom+1;let g="",E="";n.forEach((M,G)=>{if(M.length===0)return;let ce=`M ${M[0].x} ${M[0].y}`;q.value&&M.length>1?ce=Jl(M):M.slice(1).forEach(J=>{ce+=` L ${J.x} ${J.y}`}),g+=(g?" ":"")+ce;let Ne=`M ${M[0].x} ${f}`;if(Ne+=` L ${M[0].x} ${M[0].y}`,q.value&&M.length>1){const J=Jl(M),pe=J.substring(J.indexOf("C")||J.indexOf("Q")||J.indexOf("L"));pe?Ne+=" "+pe:M.slice(1).forEach(ye=>{Ne+=` L ${ye.x} ${ye.y}`})}else M.slice(1).forEach(J=>{Ne+=` L ${J.x} ${J.y}`});Ne+=` L ${M[M.length-1].x} ${f} Z`,E+=(E?" ":"")+Ne});const k=Ce.value===s,L=Ce.value!==null&&Ce.value!==s,T=At.value.has(s),H=n.reduce((M,G)=>M+to(G),0);return{linePath:g,areaPath:E,color:Lt(s),pathLength:H,isHighlighted:k,isDimmed:L,isHidden:T}})),wo=e.computed(()=>{if(!(["bar"].includes(ge.value)||Dn.value))return[];const t=[],{maxX:s}=zt.value,n=Dn.value?S.series.filter(f=>(f.type||ge.value)==="bar"):nl.value,i=n.length;if(Gt.value){const f=s+1,E=F.value.height/f,k=E*(2/3),L=Math.min(4,k/i*.15),T=k-(i-1)*L,H=Math.max(4,T/i);n.forEach((M,G)=>{const ce=S.series.findIndex(ye=>ye===M),Ne=Ce.value===ce,J=Ce.value!==null&&Ce.value!==ce,pe=At.value.has(ce);M.data.forEach((ye,ae)=>{if(ye==null||typeof ye!="number"||!isFinite(ye))return;const we=F.value.top+(ae+.5)*E-k/2+G*(H+L),Fe=F.value.left,De=Math.abs(il(ye)-F.value.left);let kt="";if(q.value&&De>0){const bt=Math.min(K.value,H/2,De/2);kt=[`M ${Fe} ${we}`,`L ${Fe+De-bt} ${we}`,`Q ${Fe+De} ${we} ${Fe+De} ${we+bt}`,`L ${Fe+De} ${we+H-bt}`,`Q ${Fe+De} ${we+H} ${Fe+De-bt} ${we+H}`,`L ${Fe} ${we+H}`,"Z"].join(" ")}t.push({x:Fe,y:we,width:De,height:H,color:Lt(i===1?ae:ce),value:ye,label:S.categories[ae]||ae.toString(),seriesName:M.name,animationDelay:(G*n.length+ae)*(Ve.value/4),isHighlighted:Ne,isDimmed:J,isHidden:pe,barPath:kt,isSmooth:q.value&&De>0})})})}else{const f=s+1,E=F.value.width/f,k=E*.8,L=k/i,T=L*.05,H=L-T;n.forEach((M,G)=>{const ce=S.series.findIndex(ye=>ye===M),Ne=Ce.value===ce,J=Ce.value!==null&&Ce.value!==ce,pe=At.value.has(ce);M.data.forEach((ye,ae)=>{if(ye==null||typeof ye!="number"||!isFinite(ye))return;const we=F.value.left+(ae+.5)*E-k/2+G*L+T/2,Fe=Qt(Math.max(0,ye)),De=Math.abs(Qt(0)-Qt(ye));let kt="";if(q.value&&De>0){const bt=Math.min(K.value,H/2,De/2);kt=[`M ${we} ${Fe+De}`,`L ${we} ${Fe+bt}`,`Q ${we} ${Fe} ${we+bt} ${Fe}`,`L ${we+H-bt} ${Fe}`,`Q ${we+H} ${Fe} ${we+H} ${Fe+bt}`,`L ${we+H} ${Fe+De}`,"Z"].join(" ")}t.push({x:we,y:Fe,width:H,height:De,color:Lt(i===1?ae:ce),value:ye,label:S.categories[ae]||ae.toString(),seriesName:M.name,animationDelay:(G*n.length+ae)*(Ve.value/4),isHighlighted:Ne,isDimmed:J,isHidden:pe,barPath:kt,isSmooth:q.value&&De>0})})})}return t}),ml=e.computed(()=>{if(!pn.value)return[];const t=nl.value.map((g,E)=>({series:g,originalIndex:E})).filter(({originalIndex:g})=>!At.value.has(g));if(t.length===0)return[];let s=ge.value==="semi-radial"?Math.PI:-Math.PI/2;const n=ge.value==="semi-radial"?Math.PI:Math.PI*2,i=[];if(t.length===1){const{series:g,originalIndex:E}=t[0],k=g.data[0]||0,L=s,T=s+n-.001,H=L+n/2,M=Mt.value+Math.cos(L)*It.value,G=Nt.value+Math.sin(L)*It.value,ce=Mt.value+Math.cos(T)*It.value,Ne=Nt.value+Math.sin(T)*It.value,J=Mt.value+Math.cos(T)*at.value,pe=Nt.value+Math.sin(T)*at.value,ye=Mt.value+Math.cos(L)*at.value,ae=Nt.value+Math.sin(L)*at.value,Xe=1,be=[`M ${M} ${G}`,`A ${It.value} ${It.value} 0 ${Xe} 1 ${ce} ${Ne}`,`L ${J} ${pe}`,`A ${at.value} ${at.value} 0 ${Xe} 0 ${ye} ${ae}`,"Z"].join(" "),we=Lt(E);return i.push({path:be,color:we,strokeWidth:ft.value,strokeColor:Ol(0,we),value:k,seriesName:g.name,opacity:.8,isHighlighted:Ce.value===E,isDimmed:!1,isHidden:!1,startAngle:L,endAngle:T,midAngle:H}),i}if(Wn.value&&t.length===2){const g=t[0],E=t[1],k=Math.min(100,Math.max(0,g.series.data[0]||0)),L=k/100*n,T=(H,M,G,ce,Ne)=>{const J=H+(M-H)/2,pe=M-H,ye=Mt.value+Math.cos(H)*It.value,ae=Nt.value+Math.sin(H)*It.value,Xe=Mt.value+Math.cos(M)*It.value,be=Nt.value+Math.sin(M)*It.value,we=Mt.value+Math.cos(M)*at.value,Fe=Nt.value+Math.sin(M)*at.value,De=Mt.value+Math.cos(H)*at.value,kt=Nt.value+Math.sin(H)*at.value,bt=pe>Math.PI?1:0,Vn=[`M ${ye} ${ae}`,`A ${It.value} ${It.value} 0 ${bt} 1 ${Xe} ${be}`,`L ${we} ${Fe}`,`A ${at.value} ${at.value} 0 ${bt} 0 ${De} ${kt}`,"Z"].join(" "),Xt=Lt(ce);return{path:Vn,color:Xt,strokeWidth:ft.value,strokeColor:Ol(i.length,Xt),value:Ne,seriesName:G.name,opacity:.8,isHighlighted:Ce.value===ce,isDimmed:Ce.value!==null&&Ce.value!==ce,isHidden:!1,startAngle:H,endAngle:M,midAngle:J}};return i.push(T(s,s+L,g.series,g.originalIndex,k)),i.push(T(s,s+n,E.series,E.originalIndex,100)),i}const f=t.reduce((g,{series:E})=>g+(E.data[0]||0),0);return f===0?[]:(t.forEach(({series:g,originalIndex:E})=>{const k=g.data[0]||0,L=k/f*n,T=s,H=s+L,M=T+L/2,G=Mt.value+Math.cos(T)*It.value,ce=Nt.value+Math.sin(T)*It.value,Ne=Mt.value+Math.cos(H)*It.value,J=Nt.value+Math.sin(H)*It.value,pe=Mt.value+Math.cos(H)*at.value,ye=Nt.value+Math.sin(H)*at.value,ae=Mt.value+Math.cos(T)*at.value,Xe=Nt.value+Math.sin(T)*at.value,be=L>Math.PI?1:0,we=[`M ${G} ${ce}`,`A ${It.value} ${It.value} 0 ${be} 1 ${Ne} ${J}`,`L ${pe} ${ye}`,`A ${at.value} ${at.value} 0 ${be} 0 ${ae} ${Xe}`,"Z"].join(" "),Fe=Lt(E);i.push({path:we,color:Fe,strokeWidth:ft.value,strokeColor:Ol(i.length,Fe),value:k,seriesName:g.name,opacity:.8,isHighlighted:Ce.value===E,isDimmed:Ce.value!==null&&Ce.value!==E,isHidden:!1,startAngle:T,endAngle:H,midAngle:M}),s=H}),i)}),xo=e.computed(()=>{const t=ml.value;return Wn.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((s,n)=>({segment:s,originalIndex:n}))}),o=e.computed(()=>{if(!Nn.value||!pn.value)return[];const t=nn.value,s=Hn.value,n=Cn.value,i=dn.value,f=15,g=t*1.3,E=.55,k=(M,G)=>{const ce=Mt.value+Math.cos(M.midAngle)*at.value,Ne=Nt.value+Math.sin(M.midAngle)*at.value,J=Mt.value+Math.cos(M.midAngle)*(at.value+s),pe=Nt.value+Math.sin(M.midAngle)*(at.value+s),ae=J+n*(G?1:-1),Xe=G?J+f:J-f,be=pe-i,we=`${M.seriesName}: ${un(M.value)}`,Fe=we.length*t*E;return{pointerStartX:ce,pointerStartY:Ne,pointerEndX:J,pointerEndY:pe,horizontalEndX:ae,horizontalEndY:pe,textX:Xe,textY:be,text:we,textWidth:Fe,textAnchor:G?"start":"end",isRightSide:G,pointerLineLength:Math.hypot(J-ce,pe-Ne),horizontalLineLength:Math.hypot(ae-J,0)}},L=(M,G)=>{const ce=Math.abs(M.textY-G.textY)<g,Ne=M.isRightSide?M.textX:M.textX-M.textWidth,J=M.isRightSide?M.textX+M.textWidth:M.textX,pe=G.isRightSide?G.textX:G.textX-G.textWidth,ye=G.isRightSide?G.textX+G.textWidth:G.textX,ae=Ne<ye&&pe<J;return ce&&ae},T=ml.value.filter(M=>!M.isHidden),H=[];for(let M=0;M<T.length;M++){const G=T[M];let ce=Math.cos(G.midAngle)>=0;if(M>0){const J=H[M-1],pe=k(G,ce);L(J,pe)&&(ce=!ce)}const Ne=k(G,ce);H.push({...Ne,color:G.color,isHighlighted:G.isHighlighted,isDimmed:G.isDimmed})}return H}),l=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||eo.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},a=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},r=(t,s)=>{if(t)try{if(Ce.value===t.seriesIndex?Ce.value=null:Ce.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:S.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},c=(t,s)=>{const n=[`dss-bubble-fallback-${s}`];return t.isHighlighted&&n.push("dss-bubble-highlighted"),t.isDimmed&&n.push("dss-bubble-dimmed"),t.isHidden&&n.push("dss-bubble-hidden"),n.push(`dss-bubble-series-${t.seriesIndex}`),n.join(" ")},d=(t,s)=>{if(!t||(s.stopPropagation(),Ll.value=!0,Ce.value=t.seriesIndex,qe.value.show=!1,!Ut.value))return;const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect();let f=s.clientX-i.left+10,g=s.clientY-i.top-10;const E=200,k=120;f+E>xe.value&&(f=s.clientX-i.left-E-10),g+k>i.height&&(g=s.clientY-i.top-k-10),f<0&&(f=10),g<0&&(g=10);const L=An.value,T=fl.value,H=L.map(M=>{const G=T[M]||M,ce=u(M,t);return ce?{seriesName:t.seriesName,label:t.label,value:`${G}: ${ce}`,color:t.color}:null}).filter(Boolean);Ge.value={show:!0,x:f,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:H,categoryIndex:void 0,spiderSeries:[]}},u=(t,s)=>{let n;switch(t){case"x":n=s.originalX;break;case"y":n=s.originalY;break;case"size":n=s.originalSize;break;case"label":n=s.label;break;case"seriesName":n=s.seriesName;break;default:n=s[t]||""}const i=Vl.value[t];if(typeof i=="function")return i(n,s);if(typeof n=="number"){const f=n.toFixed(1);return an.value?f+an.value:f}return n?.toString()||""},m=()=>{if(!Pt.value||!qe.value.data||qe.value.data.length===0)return"Bubbles";const t=[],s=new Set;return qe.value.data.forEach(n=>{if(n.seriesName&&n.label){const i=`${n.seriesName} - ${n.label}`;s.has(i)||(t.push(i),s.add(i))}else n.seriesName&&(s.has(n.seriesName)||(t.push(n.seriesName),s.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},v=(t,s)=>{t&&(Ll.value=!1,Ce.value=null,Ge.value.show=!1,Ge.value.bubbleData=[])},h=(t,s)=>{const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect(),f=so(t.categoryIndex),g=t.description||t.comment||"";let E=s.clientX-i.left+15,k=s.clientY-i.top-10;const L=200,T=g?80:50;E+L>xe.value&&(E=s.clientX-i.left-L-15),k+T>mt.value&&(k=s.clientY-i.top-T-10),E<0&&(E=10),k<0&&(k=10),jt.value={show:!0,x:E,y:k,categoryValue:f,description:g}},_=()=>{jt.value.show=!1},$=e.computed(()=>S.categories.length||Math.max(...Un.value.map(t=>t.data.length))),N=e.computed(()=>{let t=0;return Un.value.forEach(s=>{s.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),Q=e.computed(()=>{const t=[],s=$.value;for(let n=0;n<s;n++){const i=n*2*Math.PI/s-Math.PI/2,f=Mt.value+Math.cos(i)*at.value,g=Nt.value+Math.sin(i)*at.value;t.push({x:f,y:g,angle:i,index:n})}return t}),j=e.computed(()=>{const t=[],s=$.value;return Q.value.forEach((n,i)=>{const f=at.value+15,g=i*2*Math.PI/s-Math.PI/2,E=Mt.value+Math.cos(g)*f,k=Nt.value+Math.sin(g)*f+5;let L="middle",T="middle";Math.abs(Math.cos(g))>.5&&(L=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(T=Math.sin(g)>0?"hanging":"auto"),t.push({x:E,y:k,text:S.categories[i]||`Axis ${i+1}`,anchor:L,baseline:T})}),t}),$e=e.ref(new Set),me=(t,s,n)=>{const i=`current-${n}`,f=$e.value.has(i);return!f&&Ce.value===null?s.fillOpacity||oe.value:s.isHighlighted||f?(s.fillOpacity||oe.value)+.15:s.isDimmed?(s.fillOpacity||oe.value)*.3:s.fillOpacity||oe.value},it=e.computed(()=>{if(!On.value)return[];const t=[],s=$.value;return nl.value.forEach((n,i)=>{const f=[],g=[],E=[],k=Ce.value===i,L=Ce.value!==null&&Ce.value!==i,T=At.value.has(i);for(let H=0;H<s;H++){const M=n.data[H]||0,ce=M/N.value*at.value,Ne=H*2*Math.PI/s-Math.PI/2,J=Mt.value+Math.cos(Ne)*ce,pe=Nt.value+Math.sin(Ne)*ce;f.push(`${J},${pe}`),g.push({x:J,y:pe}),E.push({x:J,y:pe,value:M,label:S.categories[H]||`Axis ${H+1}`,seriesName:n.name})}t.push({points:f.join(" "),polygonPoints:g,dataPoints:E,color:Lt(i),fillOpacity:oe.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:k,isDimmed:L,isHidden:T,seriesIndex:i})}),t}),ln=(t,s)=>{if(!s||s.length<3)return!1;let n=!1;for(let i=0,f=s.length-1;i<s.length;f=i++){const g=s[i].x,E=s[i].y,k=s[f].x,L=s[f].y;E>t.y!=L>t.y&&t.x<(k-g)*(t.y-E)/(L-E)+g&&(n=!n)}return n},Jt=t=>{if(!On.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const n=s.getBoundingClientRect(),i=Te.value?.getBoundingClientRect();if(!i)return;const f=t.clientX-i.left,g=t.clientY-i.top,E=it.value.filter(k=>k.isHidden?!1:ln({x:f,y:g},k.polygonPoints));if(E.length>0){E.length,Ce.value=E[0].seriesIndex;const k=t.clientX-n.left+10,L=t.clientY-n.top-10,T=200,H=50+E.length*25;let M=k,G=L;M+T>xe.value&&(M=t.clientX-n.left-T-10),G+H>mt.value&&(G=t.clientY-n.top-H-10),M<0&&(M=10),G<0&&(G=10);const ce=E.map(Ne=>{let J=Ne.dataPoints[0],pe=1/0;return Ne.dataPoints.forEach(ye=>{const ae=Math.sqrt(Math.pow(ye.x-f,2)+Math.pow(ye.y-g,2));ae<pe&&(pe=ae,J=ye)}),{seriesName:Ne.seriesName,color:Ne.color,value:un(J.value!==void 0?J.value:Ne.value)}});Ge.value={show:!0,x:M,y:G,title:E.length===1?E[0].seriesName:"",value:"",bubbleData:[],spiderSeries:ce}}else Fn()},Rt=e.computed(()=>{const t=O.value;return t.logos.map((s,n)=>{const i=S.series[s.seriesIndex];if(!i||!i.data||i.data.length===0||At.value.has(s.seriesIndex))return null;let f,g;if(rn.value){let k=-1,L=null;for(let H=i.data.length-1;H>=0;H--)if(i.data[H]!==null&&i.data[H]!==void 0){k=H,L=i.data[H];break}if(k===-1||L===null)return null;const T=i.data.map((H,M)=>H==null?null:{x:Zt(M),y:Qt(H),index:M}).filter(H=>H!==null);if(t.animations.enabled&&!Gn.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Ct.value.isAnimating||!Ct.value.hasAnimated))if(Ct.value.isAnimating){const H=Ct.value.currentFrame/Ct.value.totalFrames,M=El(t.animations.easing,Math.min(H,1)),G=Ko(T,M);f=G.x+(s.offsetX||0),g=G.y+(s.offsetY||0)}else f=T[0].x+(s.offsetX||0),g=T[0].y+(s.offsetY||0);else f=Zt(k)+(s.offsetX||0),g=Qt(L)+(s.offsetY||0)}else if(pn.value||On.value){const k=Math.PI*2/t.logos.length*n;f=Mt.value+Math.cos(k)*(at.value+30)+(s.offsetX||0),g=Nt.value+Math.sin(k)*(at.value+30)+(s.offsetY||0)}return{...s,x:f,y:g,seriesIndex:s.seriesIndex}}).filter(Boolean)}),en=t=>{const s=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.opacity="0"),n&&(n.style.opacity="1")},tn=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},qt=t=>{At.value.has(t)?At.value.delete(t):At.value.add(t)},jn=e.computed(()=>{if(!Ge.value.show&&!(ht.value&&qe.value.show&&!Z.value.isZooming))return{display:"none"};let t,s;if(ht.value&&qe.value.show&&!Z.value.isZooming){t=qe.value.x+15,s=F.value.top;const n=Pt.value?200:150;t+n>xe.value&&(t=qe.value.x-n-15),t<0&&(t=10),s<10&&(s=10)}else t=Ge.value.x,s=Ge.value.y;return{left:t+"px",top:s+"px"}}),hn=(t,s)=>{if(!Ut.value||Hl.value)return;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let f=s.clientX-i.left+10,g=s.clientY-i.top-10;const E=200,k=120,L=xe.value,T=mt.value;f+E>L&&(f=s.clientX-i.left-E-10),g+k>T&&(g=s.clientY-i.top-k-10),f<0&&(f=10),g<0&&(g=10);let H;typeof t.categoryIndex=="number"?H=t.categoryIndex:typeof t.dataIndex=="number"?H=t.dataIndex:t.label&&S.categories.includes(t.label)&&(H=S.categories.indexOf(t.label));const M=(Gt.value||ge.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";Ge.value={show:!0,x:f,y:g,title:M,value:un(t.value)||"",categoryIndex:H,spiderSeries:[]}},Kn=e.ref(!1),Ll=e.ref(!1),Fn=()=>{Ge.value.show=!1,Ge.value.spiderSeries=[],Ge.value.bubbleData=[],qe.value.show=!1,Kn.value||(Ce.value=null)},Hl=e.ref(!1),xl=(t,s)=>{Hl.value=!0,Ge.value.show=!1,qe.value.show=!1;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let f=s.clientX-i.left+15,g=s.clientY-i.top-10;const E=250;f+E>xe.value&&(f=s.clientX-i.left-E-15),f<0&&(f=10),g<0&&(g=10),ol.value={show:!0,x:f,y:g,content:t.texts,count:t.totalCount}},Wl=()=>{Hl.value=!1,ol.value.show=!1},Ct=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),El=(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}},Gn=e.computed(()=>He.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Qn=()=>{if(!x.value||Gn.value){Ct.value.hasAnimated=!0,gn.value&&(cl.value=1);return}gn.value&&(cl.value=0),Ct.value.isAnimating=!0,Ct.value.currentFrame=0,Ct.value.totalFrames=Math.ceil(V.value/16.67);const t=()=>{const s=Ct.value.currentFrame/Ct.value.totalFrames,n=El(Y.value,Math.min(s,1));ll(n),gn.value&&(cl.value=n),s<1?(Ct.value.currentFrame++,Ct.value.animationId=requestAnimationFrame(t)):In()};Ct.value.animationId=requestAnimationFrame(t)},ll=t=>{const s=document.querySelector(".dss-custom-chart-container");s&&s.style.setProperty("--dss-animation-progress",t)},In=()=>{Ct.value.isAnimating=!1,Ct.value.hasAnimated=!0,gn.value&&(cl.value=1),Ct.value.animationId&&(cancelAnimationFrame(Ct.value.animationId),Ct.value.animationId=null)},Eo=e.computed(()=>!pn.value||Ct.value.hasAnimated?!0:gn.value?cl.value>=1:En.value?Bl.value>=1:!0),Po=e.computed(()=>Nn.value&&Eo.value),Vo=e.ref(!1);e.watch(Po,t=>{t?(Vo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Vo.value=!0})})):Vo.value=!1},{immediate:!0});const Xo=e.computed(()=>{if(!x.value||Gn.value||Ct.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${V.value}ms`,t["--dss-animation-easing"]=Yo(Y.value),t["--dss-stagger-delay"]=`${Ve.value}ms`,t}),Yo=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",jo=()=>{if(!x.value||Gn.value)return"";const t=["dss-chart-animated"];return Ct.value.hasAnimated||t.push(`dss-animate-${C.value}`),Ct.value.hasAnimated||(pn.value&&ge.value!=="semi-radial"?t.push("dss-animate-fill"):pn.value||t.push(`dss-animate-${C.value}`)),Ct.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>S.series,(t,s)=>{Je.value&&s&&Ct.value.hasAnimated&&(Ct.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Qn(),P.value)}))},{deep:!0}),e.watch(()=>Z.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{jl()},50)}),e.watch(()=>[Z.value.scale,Z.value.offsetX],()=>{!Z.value.isZooming&&!Z.value.isDragging&&jl()},{flush:"post"}),e.watch([fe,Se],([t,s])=>{Z.value.minScale=t,Z.value.maxScale=s,(Z.value.scale<t||Z.value.scale>s)&&Fl()},{immediate:!0}),e.watch(()=>S.locale,t=>{t&&t!==D.value&&(D.value=t)},{immediate:!0}),e.watch(()=>We.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Rl)}):document.removeEventListener("click",Rl)}),e.onMounted(()=>{Ce.value=null,gn.value&&(!x.value||Gn.value)&&(cl.value=1),No(),b.value&&typeof ResizeObserver<"u"&&(ue=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(ve&&cancelAnimationFrame(ve),ve=requestAnimationFrame(()=>{ve=null;const{width:n,height:i}=s.contentRect;pt.value=Math.round(n),p.value=Math.round(i),se.value&&(wt.value=se.value.offsetHeight||de)}))}),ue.observe(b.value)),x.value&&!Gn.value?ge.value==="semi-radial"?setTimeout(()=>_o(),P.value):setTimeout(()=>Qn(),P.value):(Ct.value.hasAnimated=!0,ge.value==="semi-radial"&&(Bl.value=1)),document.addEventListener("mousemove",Oo),document.addEventListener("mouseup",Zo),document.addEventListener("click",mo)}),e.onUnmounted(()=>{ve&&cancelAnimationFrame(ve),ue&&b.value&&(ue.unobserve(b.value),ue.disconnect(),ue=null),Ct.value.animationId&&cancelAnimationFrame(Ct.value.animationId),qn&&(cancelAnimationFrame(qn),qn=null),Z.value.zoomTimeout&&clearTimeout(Z.value.zoomTimeout),document.removeEventListener("mousemove",Oo),document.removeEventListener("mouseup",Zo),document.removeEventListener("click",mo),document.removeEventListener("click",Rl)});const Oo=t=>{if(Z.value.isDragging&&Z.value.scale>1&&rn.value){qe.value.show=!1;const s=t.clientX-Z.value.lastMouseX,{minX:n,maxX:i}=zt.value,f=i-n||1,E=s*.8;Z.value.offsetX+=E;const k=f/Z.value.scale,L=f-k,T=0,H=-L/f*F.value.width,M=T;Z.value.offsetX=Math.max(H,Math.min(M,Z.value.offsetX)),Z.value.lastMouseX=t.clientX,Z.value.lastMouseY=t.clientY}},Zo=()=>{Z.value.isDragging&&(Z.value.isDragging=!1,setTimeout(()=>{!Z.value.isDragging&&Z.value.isZooming},100))},Ko=(t,s)=>{const n=t.filter(k=>k!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||s<=0)return n[0];if(s>=1)return n[n.length-1];let i=0;const f=[];for(let k=1;k<n.length;k++){const L=n[k].x-n[k-1].x,T=n[k].y-n[k-1].y,H=Math.sqrt(L*L+T*T);f.push(H),i+=H}const g=i*s;let E=0;for(let k=0;k<f.length;k++){const L=E+f[k];if(g<=L){const T=(g-E)/f[k],H=n[k],M=n[k+1];return{x:H.x+(M.x-H.x)*T,y:H.y+(M.y-H.y)*T}}E=L}return n[n.length-1]};return(t,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[jo(),{"dss-chart-fill-width":ct.value,"dss-chart-fill-height":Ie.value,"dss-chart-compact":pn.value&&!Bt.value}]]),style:e.normalizeStyle({width:ct.value?"100%":xe.value+"px",height:ze.value,...ct.value||Ie.value?{overflow:"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Xo.value,cursor:Mo()}),"data-chart-type":ge.value,ref_key:"containerEl",ref:b,onWheel:Ql,onMousedown:So,onMousemove:re,onMouseup:Bo,onMouseleave:dt,onDblclick:Fl,onContextmenu:e.withModifiers(lt,["prevent"]),onClick:e.withModifiers(yt,["left"]),onWheelCapture:Ql},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:se},[e.createElementVNode("div",Za,[Et.value?(e.openBlock(),e.createElementBlock("div",Wa,e.toDisplayString(Et.value),1)):e.createCommentVNode("",!0),st.value?(e.openBlock(),e.createElementBlock("div",qa,e.toDisplayString(st.value),1)):e.createCommentVNode("",!0)]),Bt.value&&(Ue.value==="top"||Ue.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Yt.value==="horizontal","dss-legend-vertical":Yt.value==="vertical","dss-legend-top":Ue.value==="top","dss-legend-bottom":Ue.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":At.value.has(i),"dss-legend-hovered":Ce.value===i,"dss-legend-dimmed":Ce.value!==null&&Ce.value!==i}]),onClick:f=>qt(i),onMouseenter:f=>B(i),onMouseleave:W,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Lt(i)})},null,4),e.createElementVNode("span",Xa,e.toDisplayString(n.name),1)],46,Ua))),128))],2)):e.createCommentVNode("",!0),Bt.value&&(Ue.value==="left"||Ue.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Ue.value==="left","dss-legend-right":Ue.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":At.value.has(i),"dss-legend-hovered":Ce.value===i,"dss-legend-dimmed":Ce.value!==null&&Ce.value!==i}]),onClick:f=>qt(i),onMouseenter:f=>B(i),onMouseleave:W,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Lt(i)})},null,4),e.createElementVNode("span",ja,e.toDisplayString(n.name),1)],46,Ya))),128))],2)):e.createCommentVNode("",!0)],512),R.showAddMarkerButton&&Ke.value&&Ht.value.addMarker&&(rn.value||Pt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Sl,title:e.unref(z)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Tn.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,Ga),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,Ka)):e.createCommentVNode("",!0),e.createElementVNode("div",Qa,[Pt.value&&St.value?(e.openBlock(),e.createElementBlock("div",Ja,"Bubble size: "+e.toDisplayString(St.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:xe.value,height:mt.value,class:"dss-chart-svg","data-smooth":q.value,"data-animated":x.value,ref_key:"svgEl",ref:Te},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",ts,[e.createElementVNode("rect",{x:0,y:F.value.top,width:xe.value,height:F.value.height*4},null,8,ns)]),En.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:zl.value},[e.createElementVNode("path",{d:Ml.value},null,8,os)],8,ls)):e.createCommentVNode("",!0),gn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:ul.value},[e.createElementVNode("path",{d:bl.value},null,8,ss)],8,as)):e.createCommentVNode("",!0)]),rn.value||Pt.value?(e.openBlock(),e.createElementBlock("g",rs,[$t.value?(e.openBlock(),e.createElementBlock("g",is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lo.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${i}`,x1:F.value.left,x2:F.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${i*50}ms`})},null,12,cs))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",us,[e.createElementVNode("line",{x1:F.value.left,x2:F.value.right,y1:F.value.bottom,y2:F.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ds),e.createElementVNode("line",{x1:F.value.left,x2:F.value.left,y1:F.value.top,y2:F.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ms)]),e.createElementVNode("g",ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pl.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${i}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},e.toDisplayString(n.text),13,fs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Co.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${i}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(n.text),13,vs))),128)),Wt.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:F.value.left+F.value.width/2,y:F.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(Wt.value),9,gs)):e.createCommentVNode("",!0),on.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:F.value.top+12+F.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${F.value.top+F.value.height/2})`},e.toDisplayString(on.value),9,hs)):e.createCommentVNode("",!0)]),Al.value.length>0?(e.openBlock(),e.createElementBlock("g",ys,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Al.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",Cs,[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:F.value.bottom,y2:F.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>xl(n,i),onMouseleave:Wl},null,40,ks)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:F.value.bottom,y2:F.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>xl(n,i),onMouseleave:Wl},null,40,bs)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:F.value.bottom,y2:F.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>xl(n,i),onMouseleave:Wl},null,40,ws)):e.createCommentVNode("",!0)]),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,F.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>xl(n,i),onMouseleave:Wl},null,40,xs)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,F.value.top-10),r:"14",fill:n.hasManual&&n.hasAuto||n.hasManual?"#047395":"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:i=>xl(n,i),onMouseleave:Wl},null,40,Es),e.createElementVNode("text",{x:n.x,y:Math.max(15,F.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(n.totalCount),9,Vs)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Ns,[Dn.value?(e.openBlock(),e.createElementBlock("g",Ss,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":Gt.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${i}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>hn(n,f),onMouseleave:Fn},null,46,Bs)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>hn(n,f),onMouseleave:Fn},null,46,Ms))],64))),128))],2),e.createElementVNode("g",_s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ko.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Pe.value+2:Pe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,$s))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Pe.value+2:Pe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Ts))),128)),Ze.value>0||ut.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ho.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:n.x,cy:n.y,r:n.isHighlighted?Ee(n,Ze.value)+2:Ee(n,Ze.value),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>hn(n,f),onMouseleave:Fn},null,46,Ls))),128)):e.createCommentVNode("",!0)])])):ge.value==="line"?(e.openBlock(),e.createElementBlock("g",Hs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:n.path,stroke:n.color,"stroke-width":Pe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Ct.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,As))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ko.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Pe.value+2:Pe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Ds))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Pe.value+2:Pe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Rs))),128)),Ze.value>0||ut.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Rn.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:n.x,cy:n.y,r:n.isHighlighted?Ee(n,Ze.value)+2:Ee(n,Ze.value),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>hn(n,f),onMouseleave:Fn},null,46,Fs))),128)):e.createCommentVNode("",!0)])):ge.value==="area"?(e.openBlock(),e.createElementBlock("g",Is,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tl.value,(n,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${R.chartId}`},[e.createElementVNode("rect",{x:F.value.left-10,y:F.value.top-10,width:F.value.width+20,height:F.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${F.value.width+20}px`})},null,12,Ps)],8,zs))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?Qe.value+.2:Qe.value,mask:`url(#area-mask-${i}-${R.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden})},null,10,Os))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?Pe.value+1:Pe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${i*Ve.value}ms`})},null,14,Zs))),128))])):ge.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":Gt.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${i}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>hn(n,f),onMouseleave:Fn},null,46,Ws)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>hn(n,f),onMouseleave:Fn},null,46,qs))],64))),128))],2)):e.createCommentVNode("",!0)]),ht.value&&qe.value.show&&!Z.value.isZooming?(e.openBlock(),e.createElementBlock("g",Us,[e.createElementVNode("line",{x1:qe.value.x,x2:qe.value.x,y1:F.value.top,y2:F.value.bottom,stroke:te.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Xs),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:qe.value.x,cy:n.y,r:Ze.value+2,fill:n.color,stroke:"none",opacity:"0.9"},null,8,Ys))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Pt.value?(e.openBlock(),e.createElementBlock("g",js,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yn.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[n?(e.openBlock(),e.createElementBlock("g",Ks,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:n.radius,fill:n.color,"fill-opacity":l(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(c(n,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:f=>d(n,f),onMouseleave:f=>v(n),onClick:f=>r(n,f)},null,42,Gs),n.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:n.x-n.radius*.65,y:n.y-n.radius*.65,width:n.radius*1.3,height:n.radius*1.3,"xlink:href":n.imageUrl,class:e.normalizeClass(`dss-bubble-image-${i} ${n.isHighlighted?"dss-bubble-highlighted":""} ${n.isDimmed?"dss-bubble-dimmed":""} ${n.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${n.radius*.65}px at ${n.radius*.65}px ${n.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:a(n)}),onLoad:f=>go(i),onError:f=>$o(i),onMouseenter:f=>d(n,f),onMouseleave:f=>v(n),onClick:f=>r(n,f)},null,46,Qs)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),pn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:po.value},[ge.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Mt.value,cy:Nt.value,r:at.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,er)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":ge.value,"clip-path":gl.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${n.originalIndex}-${i}`,d:n.segment.path,fill:n.segment.color,"fill-opacity":n.segment.isHighlighted?(n.segment.opacity||.8)+.2:n.segment.opacity||.8,stroke:n.segment.strokeWidth?n.segment.strokeColor||n.segment.color:"none","stroke-width":n.segment.strokeWidth||0,"clip-path":fo(n.originalIndex),class:e.normalizeClass({"dss-series-highlighted":n.segment.isHighlighted,"dss-series-dimmed":n.segment.isDimmed,"dss-series-hidden":n.segment.isHidden}),onMouseover:f=>hn(n.segment,f),onMouseleave:Fn},null,42,nr))),128))],8,tr),fn.value&&Eo.value?(e.openBlock(),e.createElementBlock("g",lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vn.value,(n,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${i}`,x:n.x,y:n.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label",style:e.normalizeStyle({fill:n.contrastColor})},e.toDisplayString(n.value),13,or)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),yl.value&&(Eo.value||En.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:kl.value.x,y:kl.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Cl.value,fill:kn.value,class:"dss-radial-data-center"},e.toDisplayString(Xl.value),9,ar)):e.createCommentVNode("",!0),Po.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Vo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${i}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${i*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:n.pointerStartX,y1:n.pointerStartY,x2:n.pointerEndX,y2:n.pointerEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.pointerLineLength})},null,12,sr),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:n.pointerEndX,y1:n.pointerEndY,x2:n.horizontalEndX,y2:n.horizontalEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.horizontalLineLength})},null,12,rr),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":nn.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,ir)],6))),128))],2)):e.createCommentVNode("",!0)],8,Js)):e.createCommentVNode("",!0),On.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:po.value},[$t.value?(e.openBlock(),e.createElementBlock("g",ur,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:Mt.value,cy:Nt.value,r:n,fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,dr))),128)),e.createElementVNode("g",mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:Mt.value-16,y:Nt.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,pr),e.createElementVNode("text",{x:Mt.value,y:Nt.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Vt(i)),9,fr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:Mt.value,x2:n.x,y1:Nt.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,vr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",gr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:n.x+Math.cos(i*2*Math.PI/$.value-Math.PI/2)*16,y:n.y+Math.sin(i*2*Math.PI/$.value-Math.PI/2)*16,"text-anchor":n.anchor,"dominant-baseline":n.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${i*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,hr))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Jt,onMouseleave:Fn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(it.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":me("current",n,i),stroke:n.color,"stroke-width":n.isHighlighted?Pe.value+1:Pe.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${i*Ve.value}ms`,transition:"all 0.2s ease"})},null,14,yr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataPoints,(f,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${i}-${g}`,cx:f.x,cy:f.y,r:n.isHighlighted?Ze.value+1:Ze.value>0?Ze.value:0,fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${i*Ve.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:E=>hn(f,E),onMouseleave:Fn},null,46,Cr))),128))]))),128))],32)],8,cr)):e.createCommentVNode("",!0),e.createElementVNode("g",kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:n.x,cy:n.y,r:n.width/2,fill:Lt(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,br))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt.value,(n,i)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${i}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:f=>en(i),onError:f=>tn(i),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${i}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,46,wr))),128))])],8,es))]),A.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:xe.value+"px",height:mt.value+"px",backgroundImage:`url('${sn.value}')`,backgroundRepeat:"no-repeat",...nt.value,opacity:X.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(hl.value,(n,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+n.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:n.x+"px",top:n.y+"px",width:yn.value+"px",height:yn.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(f=>Sn(n),["stop"]),onMouseenter:f=>h(n,f),onMouseleave:_},[e.createElementVNode("img",{src:Yl(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Er)],44,xr)),[[e.vShow,zn.value]])),128)),jt.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:jt.value.x+"px",top:jt.value.y+"px"})},[e.createElementVNode("div",Vr,e.toDisplayString(jt.value.categoryValue),1),jt.value.description?(e.openBlock(),e.createElementBlock("div",Nr,e.toDisplayString(jt.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Ut.value&&(Ge.value.show||ht.value&&qe.value.show&&!Z.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":ht.value&&qe.value.show&&!Z.value.isZooming}]),style:e.normalizeStyle(jn.value)},[!ht.value||!qe.value.show||Z.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[On.value&&Ge.value.spiderSeries&&Ge.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",Sr,[Ge.value.title?(e.openBlock(),e.createElementBlock("div",Br,e.toDisplayString(Ge.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value.spiderSeries,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Mr,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",_r,e.toDisplayString(n.value),1)]))),128))])):Pt.value&&Ge.value.bubbleData&&Ge.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",$r,[Ge.value.title?(e.openBlock(),e.createElementBlock("div",Tr,e.toDisplayString(Ge.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value.bubbleData,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",Hr,[e.createElementVNode("div",Ar,e.toDisplayString(Ge.value.title),1),e.createElementVNode("div",Dr,e.toDisplayString(Ge.value.value),1)])),Ge.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Oe(Ge.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Rr,[s[5]||(s[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Fr,e.toDisplayString(e.unref(z)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe(Ge.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",Ir,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(f,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",zr,[e.createElementVNode("div",Pr,e.toDisplayString(f.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Oe(Ge.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Or,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Zr,e.toDisplayString(e.unref(z)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe(Ge.value.categoryIndex).markers,(n,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:n.color})},null,4),e.createElementVNode("div",Wr,[e.createElementVNode("div",qr,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Ur,e.toDisplayString(n.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",Xr,[e.createElementVNode("div",Yr,e.toDisplayString(Pt.value?m():R.categories[qe.value.categoryIndex]||`Category ${qe.value.categoryIndex+1}`),1),Pt.value?(e.openBlock(),e.createElementBlock("div",jr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(qe.value.data,(n,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:n.color})},null,4),e.createElementVNode("span",Kr,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Gr,e.toDisplayString(un(n.value)),1)]))),128))]),Oe(qe.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Qr,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Jr,e.toDisplayString(e.unref(z)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe(qe.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",ei,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(f,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",ti,[e.createElementVNode("div",ni,e.toDisplayString(f.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Oe(qe.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",li,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",oi,e.toDisplayString(e.unref(z)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe(qe.value.categoryIndex).markers,(n,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:n.color})},null,4),e.createElementVNode("div",ai,[e.createElementVNode("div",si,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",ri,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),rn.value&&_e.value&&Z.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Fl},[s[9]||(s[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(Z.value.scale*100))+"% "+e.toDisplayString(e.unref(z)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Oa),We.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:We.value.x+"px",top:We.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[Ht.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Gl},e.toDisplayString(e.unref(z)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Ht.value.addMarker&&(Ht.value.downloadSvg||Ht.value.downloadPng||Ht.value.downloadCsv||$n.value.length>0)?(e.openBlock(),e.createElementBlock("div",ii)):e.createCommentVNode("",!0),Ht.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:tl},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Ht.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:sl},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Ht.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:rl},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),$n.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Ht.value.downloadSvg||Ht.value.downloadPng||Ht.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",ci)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($n.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[n.separator?(e.openBlock(),e.createElementBlock("div",ui)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Dt(n)),style:e.normalizeStyle(bn(n)),onClick:f=>Bn(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:mn(n),class:"dss-custom-menu-content"},null,8,mi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",pi,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,di)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),he.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-marker-modal-overlay",onClick:al},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[3]||(s[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",fi,[e.createElementVNode("h3",null,e.toDisplayString(y.value?e.unref(z)("chart.modalMarker.viewMarker"):w.value?e.unref(z)("chart.modalMarker.editMarker"):e.unref(z)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:al},"×")]),e.createElementVNode("div",vi,[e.createElementVNode("div",gi,[e.createVNode(zo,{id:"dss-marker-date",mode:"single",modelValue:he.value.date,"onUpdate:modelValue":s[1]||(s[1]=n=>he.value.date=n),"min-date":Mn.value,"max-date":Dl.value,disabled:y.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",hi,[e.createElementVNode("label",yi,e.toDisplayString(e.unref(z)("chart.modalMarker.description")),1),y.value?(e.openBlock(),e.createElementBlock("div",Ci,e.toDisplayString(he.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=n=>he.value.description=n),placeholder:e.unref(z)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,ki)),[[e.vModelText,he.value.description]])])]),e.createElementVNode("div",bi,[e.createElementVNode("div",wi,[w.value&&!y.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:co},e.toDisplayString(e.unref(z)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",xi,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:al},e.toDisplayString(y.value?e.unref(z)("chart.modalMarker.close"):e.unref(z)("chart.modalMarker.cancel")),1),y.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:io,disabled:!(he.value.description&&he.value.description.length)},e.toDisplayString(w.value?e.unref(z)("chart.modalMarker.save"):e.unref(z)("chart.contextMenu.addMarker")),9,Ei))])])])])):e.createCommentVNode("",!0)],64))}}),Si={class:"dss-modal-title"},Bi={class:"dss-modal-actions"},Ao={__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(R,{emit:ke}){const z=R,D=ke,Me=e.ref(null),b=e.ref(null),Te=e.computed(()=>{const S={"max-width":z.width};return z.height!=="auto"&&(S.height=z.height,S["min-height"]="0"),S}),se=e.computed(()=>({}));function pt(){D("close-modal")}function p(){z.backDrop&&!Me.value&&D("close-modal")}function ue(S){S.target.tagName==="INPUT"&&(Me.value=S.target.tagName)}function ve(){setTimeout(()=>{Me.value=null},300)}function de(){const S=document.body,le=document.documentElement;b.value={bodyOverflow:S.style.overflow,bodyPosition:S.style.position,bodyTop:S.style.top,bodyWidth:S.style.width,htmlOverflow:le.style.overflow,scrollY:window.scrollY},S.style.overflow="hidden",S.style.position="fixed",S.style.top=`-${b.value.scrollY}px`,S.style.width="100%",S.style.left="0",le.style.overflow="hidden"}function ee(){if(!b.value)return;const S=document.body,le=document.documentElement,{bodyOverflow:Le,bodyPosition:Ae,bodyTop:Re,bodyWidth:O,htmlOverflow:ct,scrollY:Ie}=b.value;S.style.overflow=Le||"",S.style.position=Ae||"",S.style.top=Re||"",S.style.width=O||"",S.style.left="",le.style.overflow=ct||"",window.scrollTo(0,Ie||0)}return e.watch(()=>z.showModal,S=>{if(S)de(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const le=document.getElementById("dss-modal-backdrop");le&&(le.addEventListener("focusin",ue),le.addEventListener("focusout",ve))},100);else{ee(),document.body.classList.remove("dss-modal-open");const le=document.getElementById("dss-modal-backdrop");le&&(le.removeEventListener("focusin",ue),le.removeEventListener("focusout",ve))}},{immediate:!0}),e.onUnmounted(()=>{z.showModal&&ee()}),(S,le)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[R.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:p},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(Te.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:le[0]||(le[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":R.headerType,"font-size":R.titleSize})},[e.createElementVNode("h1",Si,[e.renderSlot(S.$slots,"title",{},()=>[le[1]||(le[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(S.$slots,"title-data"),R.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:pt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(se.value)},[e.renderSlot(S.$slots,"content",{},()=>[le[2]||(le[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Bi,[e.renderSlot(S.$slots,"actions")])])],4),[[e.vShow,R.showModal]])])):e.createCommentVNode("",!0)]))}},Mi={key:0,class:"dss-table-toolbar"},_i={class:"dss-table-toolbar-left"},$i=["aria-expanded"],Ti={class:"dss-pagination-select-dropdown",role:"listbox"},Li={class:"dss-table-column-visibility-label"},Hi={class:"dss-table-checkbox-wrapper"},Ai=["checked","onChange"],Di={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Ri={class:"dss-table-column-visibility-text"},Fi={class:"dss-table-toolbar-right"},Ii=["placeholder"],zi=["aria-expanded"],Pi={key:1,class:"dss-table-toolbar-extra"},Oi={class:"dss-table-thead"},Zi={key:0,class:"dss-table-th dss-table-selection-column"},Wi={key:0,class:"dss-table-checkbox-wrapper"},qi=["checked","indeterminate"],Ui={key:0,class:"dss-table-checkbox__indeterminate"},Xi={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Yi={key:1,class:"dss-table-th dss-table-expansion-column","aria-label":"Expand row"},ji=["onClick"],Ki={class:"dss-table-th-content"},Gi={class:"dss-table-th-text"},Qi={key:0},Ji={key:1},ec={key:2},tc=["data-filter-column-key","aria-expanded","onClick"],nc={class:"dss-table-tbody"},lc=["onClick"],oc={class:"dss-table-checkbox-wrapper"},ac=["type","name","checked","onChange"],sc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},rc={key:1,class:"dss-table-checkbox__dot"},ic=["onClick"],cc=["aria-expanded","aria-label"],uc={key:0,class:"dss-table-expansion-row"},dc=["colspan"],mc=["colspan"],pc={key:1,class:"dss-table-pagination"},fc={class:"dss-pagination-center"},vc={class:"dss-pagination-controls"},gc=["disabled","title"],hc=["disabled","title"],yc={class:"dss-pagination-pages"},Cc=["onClick"],kc={key:1,class:"dss-pagination-ellipsis"},bc=["disabled","title"],wc=["disabled","title"],xc=["aria-expanded"],Ec={class:"dss-pagination-select-dropdown",role:"listbox"},Vc=["aria-selected","onClick"],Nc={key:0,class:"dss-table-filter-row"},Sc=["value","placeholder"],Bc=["min","max","value"],Mc=["min","max","value"],_c={class:"dss-table-filter-double-range-values"},$c={key:2,class:"dss-table-filter-daterange"},Tc={class:"dss-table-filter-daterange-row"},Lc={class:"dss-table-filter-daterange-label"},Hc=["value"],Ac={class:"dss-table-filter-daterange-row"},Dc={class:"dss-table-filter-daterange-label"},Rc=["value"],Fc=["value","placeholder"],Ic={class:"dss-table-filter-list"},zc=["checked","onChange"],Pc={class:"dss-table-filter-actions"},Oc={name:"DSSTable"},Zc=Object.assign(Oc,{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:R=>typeof R=="object"&&R!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(R,{emit:ke}){const{t:z,locale:D}=no.useI18n(),Me=R,b=ke,Te={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,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]},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:"No data available"};function se(w,y){const B=Object.assign({},w);return pt(w)&&pt(y)&&Object.keys(y).forEach(W=>{pt(y[W])?W in w?B[W]=se(w[W],y[W]):Object.assign(B,{[W]:y[W]}):Object.assign(B,{[W]:y[W]})}),B}function pt(w){return w&&typeof w=="object"&&!Array.isArray(w)}const p=e.computed(()=>se(Te,Me.options)),ue=e.computed(()=>{const w=p.value.table.width;return w==="auto"?null:typeof w=="number"?w:null}),ve=e.computed(()=>p.value.table.height),de=e.computed(()=>p.value.table.rowHeight??"auto"),ee=e.computed(()=>({height:de.value})),S=e.computed(()=>p.value.table.expandable===!0),le=e.computed(()=>p.value.table.truncated===!0),Le=e.computed(()=>p.value.table.striped),Ae=e.computed(()=>p.value.table.bordered),Re=e.computed(()=>p.value.table.hoverable),O=e.computed(()=>p.value.table.size),ct=e.computed(()=>p.value.table.align||"left");e.computed(()=>p.value.title.text),e.computed(()=>p.value.subtitle.text);const Ie=e.computed(()=>p.value.selection.enabled),xe=e.computed(()=>p.value.selection.mode),wt=e.computed(()=>p.value.sorting.enabled),_t=e.computed(()=>p.value.sorting.mode),mt=e.computed(()=>p.value.pagination.enabled),ze=e.computed(()=>p.value.pagination.rows),ge=e.computed(()=>p.value.pagination.rowsPerPageOptions),gt=e.computed(()=>p.value.scrollable),Et=e.computed(()=>p.value.emptyMessage),st=e.computed(()=>p.value.toolbar?.downloads?.pdf!==!1),St=e.computed(()=>p.value.toolbar?.downloads?.excel!==!1),Wt=e.computed(()=>p.value.toolbar?.search!==!1),on=e.computed(()=>st.value||St.value||Wt.value||xt.value),xt=e.computed(()=>p.value.toolbar?.columnVisibility!==!1),et=e.ref(""),Ye=e.ref(!1),Ft=e.ref(null);let $t=null;function Bt(){Ye.value?($t&&(clearTimeout($t),$t=null),Ye.value=!1,et.value="",b("search",""),Ft.value?.blur()):(Ye.value=!0,$t=setTimeout(()=>{$t=null,Ft.value?.focus()},80))}function Ue(){et.value||(Ye.value=!1)}function Yt(){et.value="",b("search",""),Ft.value?.focus()}const Ut=e.computed(()=>({"dss-table-striped":Le.value,"dss-table-bordered":Ae.value,"dss-table-hoverable":Re.value,[`dss-table-${O.value}`]:O.value!=="default","dss-table-truncated":le.value})),ht=(w,y)=>w?.field??w?.key??y,te=e.ref(new Set);function _e(){const w=new Set;Me.columns.forEach((y,B)=>{y?.hidden!==!0&&w.add(ht(y,B))}),te.value=w}const fe=e.computed(()=>Me.columns.filter((w,y)=>te.value.has(ht(w,y)))),Se=w=>{const y=Me.columns.findIndex(B=>B===w);return ht(w,y>=0?y:0)},Pe=(w,y)=>te.value.has(ht(w,y));function ft(w,y){const B=ht(w,y),W=new Set(te.value);W.has(B)?W.delete(B):W.add(B),te.value=W}const Ze=e.ref(null),ut=e.ref(!1);function Ee(w){Ze.value&&!Ze.value.contains(w.target)&&(ut.value=!1)}const Qe=e.computed(()=>fe.value.length+(Ie.value?1:0)+(S.value?1:0)),q=(w,y)=>w?.id??w?.key??y,U=e.ref(new Set),K=e.ref(null),ie=(w,y)=>U.value.has(q(w,y)),x=(w,y,B)=>{B&&B.stopPropagation();const W=q(w,y),re=new Set(U.value);re.has(W)?(re.delete(W),b("row-collapse",{data:w,index:y})):(re.add(W),b("row-expand",{data:w,index:y})),U.value=re},C=(w,y)=>{if(!le.value)return;const B=q(w,y);K.value!==B&&(K.value=B)},V=e.ref(null),P=e.ref(0),Y=e.ref([]),Ve=w=>{if(_t.value==="single")return V.value===w.field?P.value:0;{const y=Y.value.find(B=>B.field===w.field);return y?y.order:0}},Je=w=>{const y=Ve(w);return{"dss-sort-active":y!==0,"dss-sort-asc":y===1,"dss-sort-desc":y===-1}},He=e.ref({}),oe=e.ref(null),tt=e.ref(null),je=220,Vt=e.ref(null),vt=e.computed(()=>fe.value.find(w=>Se(w)===oe.value)??null),Ke=e.computed(()=>{if(!vt.value||vt.value.filter!=="range")return null;const w=vt.value,y=oe.value,{min:B,max:W}=I(w),re=w.filterMin??B,dt=w.filterMax??W,lt=cn(y),yt=lt.min??re,mn=lt.max??dt,Dt=dt-re,bn=Dt===0?0:(yt-re)/Dt*100,Yl=Dt===0?100:(mn-re)/Dt*100;return{rangeMin:re,rangeMax:dt,currentMin:yt,currentMax:mn,minPct:bn,maxPct:Yl}}),Ht=e.ref(null),$n=e.ref("max");function Tn(w){const y=Ht.value,B=Ke.value;if(!y||!B)return;const W=y.getBoundingClientRect(),dt=(w.clientX-W.left)/W.width*100,lt=(B.minPct+B.maxPct)/2;$n.value=dt<lt?"min":"max"}function cn(w){return He.value[w]??{}}function yn(w,y){He.value={...He.value,[w]:y}}function an(w){const y=He.value[w];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 un(w){const y={...He.value};delete y[w],He.value=y,oe.value=null,tt.value=null}function zn(){if(!oe.value){tt.value=null;return}const w=Vt.value;if(!w)return;const y=w.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${oe.value}"]`);if(!y)return;const B=y.getBoundingClientRect();tt.value={top:B.bottom+6,left:Math.max(8,B.right-je)}}const Ln=e.computed(()=>{let w=[...Me.data];const y=(et.value??"").trim().toLowerCase();return y&&(w=w.filter(B=>Me.columns.some(W=>{if(!W||!W.field)return!1;const re=Tt(B,W);return String(re??"").toLowerCase().includes(y)}))),fe.value.forEach(B=>{const W=Se(B),re=He.value[W];if(!re)return;const dt=B.field;if(dt){if(re.type==="string"&&re.value?.trim()){const lt=re.value.trim().toLowerCase();w=w.filter(yt=>{const mn=Tt(yt,B);return String(mn??"").toLowerCase().includes(lt)})}else if(re.type==="range")w=w.filter(lt=>{const yt=he(lt,dt),mn=Number(yt);return!(Number.isNaN(mn)||re.min!=null&&mn<re.min||re.max!=null&&mn>re.max)});else if(re.type==="dateRange"){const lt=re.from?new Date(re.from).getTime():null,yt=re.to?new Date(re.to).getTime():null;w=w.filter(mn=>{const Dt=he(mn,dt),bn=Dt?new Date(Dt).getTime():NaN;return!(Number.isNaN(bn)||lt!=null&&bn<lt||yt!=null&&bn>yt)})}else if(re.type==="list"&&re.selected?.length){const lt=new Set(re.selected);w=w.filter(yt=>{const mn=Tt(yt,B);return lt.has(mn!=null?String(mn):"")})}}}),w});function hl(w){const y=new Set;return Me.data.forEach(B=>{const W=Tt(B,w);y.add(W!=null?String(W):"")}),Array.from(y).sort((B,W)=>String(B).localeCompare(String(W)))}function A(w,y){if(oe.value===w){oe.value=null,tt.value=null;return}if(oe.value=w,y?.currentTarget){const B=y.currentTarget.getBoundingClientRect();tt.value={top:B.bottom+6,left:Math.max(8,B.right-je)}}else zn()}function X(w,y){yn(w,{type:"string",value:y})}function I(w){const y=w.field;if(!y)return{min:0,max:100};let B=1/0,W=-1/0;return Me.data.forEach(re=>{const dt=he(re,y),lt=Number(dt);Number.isNaN(lt)||(B=Math.min(B,lt),W=Math.max(W,lt))}),{min:B===1/0?0:B,max:W===-1/0?100:W}}function ne(w,y,B){const W={...cn(w),type:"range"},re=B===""?null:Number(B),dt=re===null||Number.isNaN(re)?null:re;W[y]=dt,dt!=null&&(y==="min"&&W.max!=null&&dt>W.max&&(W.max=dt),y==="max"&&W.min!=null&&dt<W.min&&(W.min=dt)),yn(w,W)}function Be(w,y,B){const W={...cn(w),type:"dateRange"};W[y]=B||"",yn(w,W)}const nt=e.reactive({});function rt(w,y){nt[w]=y}function Oe(w){const y=Se(w),B=(nt[y]??"").trim().toLowerCase(),W=hl(w);return B?W.filter(re=>String(re).toLowerCase().includes(B)):W}function ot(w,y){return(cn(w).selected??[]).includes(y!=null?String(y):"")}function sn(w,y){const W=[...cn(w).selected??[]],re=y!=null?String(y):"",dt=W.indexOf(re);dt>=0?W.splice(dt,1):W.push(re),yn(w,{type:"list",selected:W})}function Nn(w){oe.value&&!w.target.closest(".dss-table-filter-wrap")&&!w.target.closest(".dss-table-filter-dropdown")&&(oe.value=null,tt.value=null)}function nn(){zn()}const Hn=w=>{if(!(w.sortable===!1||!wt.value))if(_t.value==="single")V.value===w.field?P.value=P.value===1?-1:P.value===-1?0:1:(V.value=w.field,P.value=1),P.value===0&&(V.value=null),b("sort",{field:V.value,order:P.value});else{const y=Y.value.findIndex(B=>B.field===w.field);y>=0?Y.value[y].order===1?Y.value[y].order=-1:Y.value.splice(y,1):Y.value.push({field:w.field,order:1}),b("sort",{multiSortMeta:Y.value})}},Cn=e.computed(()=>{if(!wt.value)return Ln.value;let w=[...Ln.value];return _t.value==="single"&&V.value&&P.value!==0?w.sort((y,B)=>{const W=he(y,V.value),re=he(B,V.value);return W===re?0:W==null?1:re==null?-1:(W<re?-1:W>re?1:0)*P.value}):_t.value==="multiple"&&Y.value.length>0&&w.sort((y,B)=>{for(const W of Y.value){const re=he(y,W.field),dt=he(B,W.field);if(re===dt)continue;if(re==null)return 1;if(dt==null)return-1;const lt=re<dt?-1:re>dt?1:0;if(lt!==0)return lt*W.order}return 0}),w}),dn=e.ref(0),fn=e.ref(ze.value),Pn=e.ref(!1),yl=e.ref(null),Xl=w=>{fn.value=w,Pn.value=!1,dn.value=0,b("page",{page:0,rows:fn.value})};function Cl(w){yl.value&&!yl.value.contains(w.target)&&(Pn.value=!1)}const kl=e.computed(()=>Cn.value.length),kn=e.computed(()=>Math.ceil(kl.value/fn.value)),vn=e.computed(()=>mt.value?dn.value*fn.value:0),Al=e.computed(()=>mt.value?Math.min((dn.value+1)*fn.value,kl.value):kl.value),ol=e.computed(()=>{if(!mt.value)return Cn.value;const w=vn.value,y=Al.value;return Cn.value.slice(w,y)}),An=e.ref(new Set),fl=e.computed(()=>Cn.value.filter((w,y)=>An.value.has(q(w,y)))),Vl=e.computed(()=>{const w=Cn.value.length;return w>0&&An.value.size===w}),At=e.computed(()=>{const w=Cn.value.length,y=An.value.size;return y>0&&y<w}),Ce=(w,y)=>An.value.has(q(w,y)),Nl=()=>{if(Vl.value)An.value=new Set,b("unselect-all");else{const w=new Set;Cn.value.forEach((y,B)=>w.add(q(y,B))),An.value=w,b("select-all",fl.value)}},Ge=(w,y)=>{const B=q(w,y),W=new Set(An.value),re=W.has(B);xe.value==="single"?re?(W.delete(B),b("row-unselect",w)):(W.clear(),W.add(B),b("row-select",w)):re?(W.delete(B),b("row-unselect",w)):(W.add(B),b("row-select",w)),An.value=W},jt=e.computed(()=>{const w=kn.value,y=dn.value+1,B=2,W=[],re=[];let dt;for(let lt=1;lt<=w;lt++)(lt===1||lt===w||lt>=y-B&&lt<=y+B)&&W.push(lt);for(const lt of W)dt&&(lt-dt===2?re.push(dt+1):lt-dt!==1&&re.push("...")),re.push(lt),dt=lt;return re}),qe=w=>{w<0||w>=kn.value||(dn.value=w,b("page",{page:w,rows:fn.value}))},We=(w,y,B)=>{b("row-click",{data:w,index:y,originalEvent:B}),C(w,vn.value+y)},Z=(w,y)=>{const B=vn.value+y;return{"dss-table-row-selected":Ce(w,B),"dss-table-row-even":y%2===0,"dss-table-row-odd":y%2!==0,"dss-table-row-truncated-clickable":le.value,"dss-table-row-truncated-expanded":K.value===q(w,B)}},Tt=(w,y)=>y.field?he(w,y.field):"",he=(w,y)=>y.split(".").reduce((B,W)=>B&&B[W],w),Mn=w=>{const y=w.align??ct.value;return{"dss-table-sortable":w.sortable!==!1&&wt.value,"dss-table-align-left":y==="left","dss-table-align-center":y==="center","dss-table-align-right":y==="right",[w.className]:w.className}},Dl=w=>{const y={};return w.width&&(y.width=typeof w.width=="number"?`${w.width}px`:w.width),w.minWidth&&(y.minWidth=typeof w.minWidth=="number"?`${w.minWidth}px`:w.minWidth),w.maxWidth&&(y.maxWidth=typeof w.maxWidth=="number"?`${w.maxWidth}px`:w.maxWidth),y};return e.watch(()=>Me.locale,w=>{w&&w!==D.value&&(D.value=w)},{immediate:!0}),e.watch(ze,w=>{fn.value=w,dn.value=0}),e.watch(et,w=>{b("search",w??"")}),e.watch(()=>Me.columns,()=>{_e()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Cl),document.addEventListener("click",Ee),document.addEventListener("click",Nn),window.addEventListener("resize",nn),window.addEventListener("scroll",nn,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Cl),document.removeEventListener("click",Ee),document.removeEventListener("click",Nn),window.removeEventListener("resize",nn),window.removeEventListener("scroll",nn,!0)}),(w,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Vt,style:e.normalizeStyle({width:ue.value+"px",height:ve.value?ve.value+"px":"auto"})},[on.value?(e.openBlock(),e.createElementBlock("div",Mi,[e.createElementVNode("div",_i,[st.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:y[0]||(y[0]=B=>b("download-pdf"))},[y[21]||(y[21]=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(z)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),St.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:y[1]||(y[1]=B=>b("download-excel"))},[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_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(z)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),xt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:Ze},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":ut.value}]),onClick:y[2]||(y[2]=B=>ut.value=!ut.value),"aria-expanded":ut.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(z)("table.columnVisibility"))+" ",1),y[23]||(y[23]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,$i),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Ti,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.columns,(B,W)=>(e.openBlock(),e.createElementBlock("li",{key:ht(B,W),role:"option",class:"dss-table-column-visibility-option",onClick:y[3]||(y[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Li,[e.createElementVNode("span",Hi,[e.createElementVNode("input",{type:"checkbox",checked:Pe(B,W),onChange:re=>ft(B,W),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ai),Pe(B,W)?(e.openBlock(),e.createElementBlock("span",Di,[...y[24]||(y[24]=[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",Ri,e.toDisplayString(B.header),1)])]))),128))],512),[[e.vShow,ut.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Fi,[Wt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Ye.value||et.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:Ft,"onUpdate:modelValue":y[4]||(y[4]=B=>et.value=B),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(z)("table.searchPlaceholder"),"aria-label":"Search table",onFocus:y[5]||(y[5]=B=>Ye.value=!0),onBlur:Ue},null,40,Ii),[[e.vModelText,et.value]]),et.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":"Clear search",onClick:Yt},[...y[25]||(y[25]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":"Search","aria-expanded":Ye.value||!!et.value,onMousedown:e.withModifiers(Bt,["prevent"])},[...y[26]||(y[26]=[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,zi)],2)):e.createCommentVNode("",!0),w.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Pi,[e.renderSlot(w.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":gt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Ut.value])},[e.createElementVNode("thead",Oi,[e.createElementVNode("tr",null,[Ie.value?(e.openBlock(),e.createElementBlock("th",Zi,[xe.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Wi,[e.createElementVNode("input",{type:"checkbox",checked:Vl.value,indeterminate:At.value,onChange:Nl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,qi),At.value?(e.openBlock(),e.createElementBlock("span",Ui)):Vl.value?(e.openBlock(),e.createElementBlock("span",Xi,[...y[27]||(y[27]=[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),S.value?(e.openBlock(),e.createElementBlock("th",Yi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(B,W)=>(e.openBlock(),e.createElementBlock("th",{key:Se(B),class:e.normalizeClass(["dss-table-th",Mn(B)]),style:e.normalizeStyle(Dl(B)),onClick:re=>Hn(B)},[e.createElementVNode("div",Ki,[e.createElementVNode("span",Gi,e.toDisplayString(B.header),1),B.sortable!==!1&&wt.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Je(B)])},[Ve(B)===0?(e.openBlock(),e.createElementBlock("span",Qi,[...y[28]||(y[28]=[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)])])):Ve(B)===1?(e.openBlock(),e.createElementBlock("span",Ji,[...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:"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)])])):Ve(B)===-1?(e.openBlock(),e.createElementBlock("span",ec,[...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 -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),B.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":oe.value===Se(B)}]),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":an(Se(B))}]),"data-filter-column-key":Se(B),"aria-expanded":oe.value===Se(B),"aria-label":"Filter column",onClick:re=>A(Se(B),re)},[...y[31]||(y[31]=[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,tc)],2)):e.createCommentVNode("",!0)])],14,ji))),128))])]),e.createElementVNode("tbody",nc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ol.value,(B,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:q(B,vn.value+W)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Z(B,W)]),style:e.normalizeStyle(ee.value),onClick:re=>We(B,W,re)},[Ie.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",oc,[e.createElementVNode("input",{type:xe.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${R.tableId}`,checked:Ce(B,vn.value+W),onChange:re=>Ge(B,vn.value+W),class:e.normalizeClass(["dss-table-checkbox",xe.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,ac),xe.value==="multiple"&&Ce(B,vn.value+W)?(e.openBlock(),e.createElementBlock("span",sc,[...y[32]||(y[32]=[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)])])):xe.value==="single"&&Ce(B,vn.value+W)?(e.openBlock(),e.createElementBlock("span",rc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(re=>x(B,vn.value+W,re),["stop"])},[e.createElementVNode("button",{type:"button",class:"dss-table-expansion-trigger","aria-expanded":ie(B,vn.value+W),"aria-label":ie(B,vn.value+W)?"Collapse row":"Expand row"},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":ie(B,vn.value+W)}]),"aria-hidden":"true"},[...y[33]||(y[33]=[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,cc)],8,ic)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(re,dt)=>(e.openBlock(),e.createElementBlock("td",{key:Se(re),class:e.normalizeClass(["dss-table-td",Mn(re)]),style:e.normalizeStyle(Dl(re))},[e.renderSlot(w.$slots,`cell-${re.field}`,{data:B,column:re,rowIndex:W},()=>[e.createTextVNode(e.toDisplayString(Tt(B,re)),1)])],6))),128))],14,lc),S.value&&ie(B,vn.value+W)?(e.openBlock(),e.createElementBlock("tr",uc,[e.createElementVNode("td",{colspan:Qe.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(w.$slots,"expansion",{data:B,rowIndex:W})],8,dc)])):e.createCommentVNode("",!0)],64))),128)),ol.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(ee.value)},[e.createElementVNode("td",{colspan:Qe.value,class:"dss-table-empty-cell"},[e.renderSlot(w.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(Et.value),1)])],8,mc)],4))])],2)],2),mt.value?(e.openBlock(),e.createElementBlock("div",pc,[e.createElementVNode("div",fc,[e.createElementVNode("div",vc,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dn.value===0,onClick:y[8]||(y[8]=B=>qe(0)),title:e.unref(z)("table.firstPage")},[...y[34]||(y[34]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,gc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dn.value===0,onClick:y[9]||(y[9]=B=>qe(dn.value-1)),title:e.unref(z)("table.previousPage")}," ‹ ",8,hc),e.createElementVNode("span",yc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jt.value,B=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:B},[B!=="..."?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["dss-pagination-page",{"dss-active":B===dn.value+1}]),onClick:W=>qe(B-1)},e.toDisplayString(B),11,Cc)):(e.openBlock(),e.createElementBlock("span",kc,"..."))],64))),128))]),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dn.value>=kn.value-1,onClick:y[10]||(y[10]=B=>qe(dn.value+1)),title:e.unref(z)("table.nextPage")}," › ",8,bc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dn.value>=kn.value-1,onClick:y[11]||(y[11]=B=>qe(kn.value-1)),title:e.unref(z)("table.lastPage")},[...y[35]||(y[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,wc)]),e.createElementVNode("div",{class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:yl},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Pn.value}]),onClick:y[12]||(y[12]=B=>Pn.value=!Pn.value),"aria-expanded":Pn.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(fn.value)+" ",1),y[36]||(y[36]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,xc),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Ec,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B,role:"option","aria-selected":B===fn.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":B===fn.value}]),onClick:W=>Xl(B)},e.toDisplayString(B),11,Vc))),128))],512),[[e.vShow,Pn.value]])]),_:1})],512)])])):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(tt.value?{top:tt.value.top+"px",left:tt.value.left+"px",width:je+"px"}:void 0),onClick:y[20]||(y[20]=e.withModifiers(()=>{},["stop"]))},[vt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[vt.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Nc,[e.createElementVNode("input",{type:"text",value:cn(oe.value).value??"",onInput:y[13]||(y[13]=B=>X(oe.value,B.target.value)),class:"dss-table-filter-input",placeholder:e.unref(z)("table.search")||"Search..."},null,40,Sc)])):vt.value.filter==="range"&&Ke.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Ke.value.minPct+"%","--range-max-pct":Ke.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Ht,class:"dss-table-filter-double-range-track",onMousemove:Tn,onMouseenter:Tn},[e.createElementVNode("input",{type:"range",min:Ke.value.rangeMin,max:Ke.value.rangeMax,value:Ke.value.currentMin,onInput:y[14]||(y[14]=B=>ne(oe.value,"min",B.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:$n.value==="min"?2:1})},null,44,Bc),e.createElementVNode("input",{type:"range",min:Ke.value.rangeMin,max:Ke.value.rangeMax,value:Ke.value.currentMax,onInput:y[15]||(y[15]=B=>ne(oe.value,"max",B.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:$n.value==="max"?2:1})},null,44,Mc)],544),e.createElementVNode("div",_c,e.toDisplayString(Ke.value.currentMin)+" – "+e.toDisplayString(Ke.value.currentMax),1)],4)):vt.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",$c,[e.createElementVNode("div",Tc,[e.createElementVNode("label",Lc,e.toDisplayString(e.unref(z)("table.filterFrom")||"From:"),1),e.createElementVNode("input",{type:"date",value:cn(oe.value).from??"",onInput:y[16]||(y[16]=B=>Be(oe.value,"from",B.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Hc)]),e.createElementVNode("div",Ac,[e.createElementVNode("label",Dc,e.toDisplayString(e.unref(z)("table.filterTo")||"To:"),1),e.createElementVNode("input",{type:"date",value:cn(oe.value).to??"",onInput:y[17]||(y[17]=B=>Be(oe.value,"to",B.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Rc)])])):vt.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:nt[oe.value]??"",onInput:y[18]||(y[18]=B=>rt(oe.value,B.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(z)("table.search")||"Search..."},null,40,Fc),e.createElementVNode("div",Ic,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe(vt.value),B=>(e.openBlock(),e.createElementBlock("label",{key:B,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:ot(oe.value,B),onChange:W=>sn(oe.value,B)},null,40,zc),e.createElementVNode("span",null,e.toDisplayString(B),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Pc,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:y[19]||(y[19]=B=>un(oe.value))},e.toDisplayString(e.unref(z)("table.clearFilter")||"Clear"),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,oe.value&&vt.value&&tt.value]])]),_:1})]))],64))}}),Wc={class:"dss-toolbar-left"},qc=["title"],Uc=["title"],Xc={class:"dss-toolbar-dropdown-wrapper"},Yc=["title"],jc={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Kc={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Gc={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Qc={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Jc={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},eu={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},nu=["title"],lu=["title"],ou=["title"],au=["title"],su=["title"],ru=["title"],iu=["title"],cu=["title"],uu=["title"],du={key:2,class:"dss-toolbar-separator"},mu=["title"],pu={key:4,class:"dss-toolbar-separator"},fu={key:5,class:"dss-toolbar-dropdown-wrapper"},vu=["title"],gu={class:"dss-toolbar-dropdown-ai"},hu={class:"dss-toolbar-right"},yu={key:0,class:"dss-toolbar-custom-group"},Cu={key:1,class:"dss-toolbar-separator"},ku={class:"dss-link-modal-content"},bu={class:"dss-link-modal-field"},wu={class:"dss-link-modal-label"},xu=["placeholder"],Eu={class:"dss-link-modal-field"},Vu={class:"dss-link-modal-label"},Nu=["placeholder"],Su={class:"dss-image-modal-tabs"},Bu={key:0,class:"dss-image-tab-content"},Mu={class:"dss-link-modal-content"},_u={class:"dss-link-modal-field"},$u={key:0,class:"dss-link-modal-label"},Tu=["src"],Lu={class:"dss-link-modal-field"},Hu={class:"dss-link-modal-label"},Au=["placeholder"],Du={class:"dss-link-modal-field"},Ru={class:"dss-link-modal-label"},Fu=["placeholder"],Iu={class:"dss-link-modal-field"},zu={class:"dss-link-modal-label"},Pu=["placeholder"],Ou={key:1,class:"dss-image-tab-content"},Zu={class:"dss-link-modal-content"},Wu={class:"dss-link-modal-field"},qu={class:"dss-link-modal-label"},Uu=["placeholder"],Xu={class:"dss-link-modal-field"},Yu={class:"dss-link-modal-label"},ju=["placeholder"],Ku={class:"dss-link-modal-field"},Gu={class:"dss-link-modal-label"},Qu=["placeholder"],Ju={class:"dss-link-modal-field"},ed={class:"dss-link-modal-label"},td=["placeholder"],nd={class:"dss-text-editor-title-input-container"},ld={key:0,class:"dss-text-editor-title-preview"},od={key:0},ad={key:1,class:"dss-text-editor-preview-placeholder"},sd=["value","placeholder","disabled"],rd={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},id={class:"dss-text-editor-description-input-container"},cd={key:0,class:"dss-text-editor-description-preview"},ud={key:0},dd={key:1,class:"dss-text-editor-preview-placeholder"},md=["value","placeholder","disabled"],pd={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},fd=["data-comment-id","onMouseenter"],vd=["onClick"],gd=["src","alt"],hd={key:1},yd=["onClick"],Cd=["src","alt"],kd={key:1},bd=["data-has-second-user","onClick"],wd={class:"editor-comment-marker-count"},xd={key:4,class:"dss-text-editor-textarea-wrapper"},Ed=["value","placeholder","rows","disabled"],Vd={class:"dss-text-editor-footer"},Nd={class:"dss-text-editor-footer-content"},Sd={class:"dss-text-editor-footer-stat"},Bd={class:"dss-text-editor-footer-stat"},Md={key:5,class:"dss-text-editor-content-wrapper"},_d={key:0,class:"dss-comment-overlay-body"},$d={class:"dss-comment-selection-wrapper"},Td=["innerHTML"],Ld={class:"dss-comment-messages-wrapper"},Hd={key:0,class:"dss-comment-avatar-wrapper"},Ad={class:"dss-comment-avatar"},Dd=["src","alt"],Rd={key:1},Fd={class:"dss-comment-header"},Id={class:"dss-comment-header-text"},zd={class:"dss-comment-author"},Pd={key:0,class:"dss-comment-date"},Od=["onClick","title"],Zd={class:"dss-comment-overlay-inner"},Wd=["placeholder","onKeydown"],qd={class:"dss-text-editor-footer"},Ud={class:"dss-text-editor-footer-content"},Xd={class:"dss-text-editor-footer-stat"},Yd={class:"dss-text-editor-footer-stat"},jd=["title"],Kd=["title"],Gd={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:""},Qd={class:"dss-image-popup-content"},Jd={key:0,class:"dss-image-popup-no-alt-icon"},e1=["title"],t1=["title"],n1={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:""},l1={class:"dss-toolbar-left"},o1=["title"],a1=["title"],s1={class:"dss-toolbar-dropdown-wrapper"},r1=["title"],i1={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c1={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},u1={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d1={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m1={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p1={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},v1=["title"],g1=["title"],h1=["title"],y1=["title"],C1=["title"],k1=["title"],b1=["title"],w1=["title"],x1=["title"],E1=["title"],V1={key:2,class:"dss-toolbar-separator"},N1={key:3,class:"dss-toolbar-dropdown-wrapper"},S1=["title"],B1={class:"dss-toolbar-dropdown-ai"},M1={key:0,class:"dss-toolbar-right"},_1={key:0,class:"dss-toolbar-separator"},$1={key:0,class:"dss-toolbar-custom-group"},T1={key:1,class:"dss-toolbar-separator"},L1={name:"DSSTextEditor"},H1=Object.assign(L1,{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:R=>typeof R=="object"&&R!==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:R=>typeof R=="object"&&R!==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(R,{expose:ke,emit:z}){const{t:D,locale:Me}=no.useI18n(),b=R,Te=z,se=e.useSlots(),pt=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
98
+ `}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),c=URL.createObjectURL(n),f=document.createElement("a");f.href=c,f.download=zn("csv"),document.body.appendChild(f),f.click(),document.body.removeChild(f),URL.revokeObjectURL(c),It()}catch(t){console.error("Error downloading CSV:",t)}},Ul=t=>{if(typeof t.action=="function"){const s={series:S.series,categories:S.categories,markers:St.value},n={chartX:Se.value.chartX,chartY:Se.value.chartY,dataX:Se.value.mouseDataX,dataY:Se.value.mouseDataY,categoryIndex:clampedCategoryIndex||Se.value.categoryIndex};t.action(s,n)}It()},Bl=()=>{el(),he.value.show=!0,he.value.categoryIndex=Se.value.categoryIndex,he.value.fromButton=!1,It()},Eo=()=>{el(),he.value.show=!0,he.value.categoryIndex=0,he.value.fromButton=!0},Xl=t=>{if(Se.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(Se.value.show=!1)}},Al=t=>{Se.value.show&&!t.target.closest(".context-menu")&&(Se.value.show=!1)},vo=t=>{if(!fn.value||!$e.value)return;t.preventDefault(),t.stopPropagation(),G.value.isZooming=!0,Ne.value.show=!1,G.value.zoomTimeout&&clearTimeout(G.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),c=t.clientX-n.left,f=t.clientY-n.top;if(c<I.value.left-50||c>I.value.right+50||f<I.value.top-50||f>I.value.bottom+100){G.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,x=Math.max(G.value.minScale,Math.min(G.value.maxScale,G.value.scale*g));if(x!==G.value.scale){const{minX:k,maxX:L}=qt.value,T=L-k||1,H=T/G.value.scale,M=k-G.value.offsetX/I.value.width*T,K=(c-I.value.left)/I.value.width,ce=M+K*H;G.value.scale=x;const Ee=T/G.value.scale,J=ce-K*Ee;G.value.offsetX=-(J-k)/T*I.value.width,G.value.scale<=1.01&&(G.value.scale=1,G.value.offsetX=0)}G.value.zoomTimeout=setTimeout(()=>{G.value.isZooming=!1,G.value.zoomTimeout=null},300)},Vo=t=>{if(!fn.value||!$e.value||G.value.scale<=1)return;Ne.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,G.value.isDragging=!0,G.value.lastMouseX=t.clientX,G.value.lastMouseY=t.clientY,t.preventDefault()},go=()=>{G.value.isDragging=!1},Yl=()=>{!fn.value||!$e.value||(G.value.scale=1,G.value.offsetX=0,G.value.isDragging=!1,G.value.zoomTimeout&&(clearTimeout(G.value.zoomTimeout),G.value.zoomTimeout=null),G.value.isZooming=!1)},No=()=>!fn.value||!yn.value||!$e.value?"default":G.value.isDragging?"grabbing":G.value.scale>1?"grab":"dss-crosshair",jl=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 n=0;n<t.length-1;n++){const c=t[Math.max(n-1,0)],f=t[n],g=t[n+1],x=t[Math.min(n+2,t.length-1)],k=f.x+(g.x-c.x)/6*j.value,L=f.y+(g.y-c.y)/6*j.value,T=g.x-(x.x-f.x)/6*j.value,H=g.y-(x.y-f.y)/6*j.value;s+=` C ${k} ${L} ${T} ${H} ${g.x} ${g.y}`}return s},pn=e.computed(()=>{const s=O.value?.chart?.padding,n=typeof s=="number"?s:null,c=s&&typeof s=="object"?s:null,f=50;let g=f+(Ot.value?30:0)+60;if(Un.value){const M={left:f+40,top:f+40,right:f+40,bottom:f+40};return n!=null?{left:n,top:n,right:n,bottom:n}:c?{left:c.left??M.left,top:c.top??M.top,right:c.right??M.right,bottom:c.bottom??M.bottom}:M}if(cn.value){const M=!$t.value,K=tn.value,ce=K?wn.value+sn.value+Math.max(24,Hn.value+16):0,Ee=M?12:f;let J=0;Vt.value&&(J+=M?8:15),at.value&&(J+=M?6:10);const pe=De();let ye=Ee+(M?4:16)+(K?ce:0),oe=Ee+(K?ce:0);$t.value&&Xe.value==="left"?ye+=pe.legendWidth||150:$t.value&&Xe.value==="right"&&(oe+=pe.legendWidth||150);const ke=ge.value==="semi-radial"?K?ce:8:K?ce:M?8:f+80,be=K?14:0,Pe=Ee+J+be,Fe={left:ye,top:Pe,right:oe,bottom:ke};return n!=null?{left:n,top:n,right:n,bottom:n}:c?{left:c.left??Fe.left,top:c.top??Fe.top,right:c.right??Fe.right,bottom:c.bottom??Fe.bottom}:Fe}let x=0;Vt.value&&(x+=15),at.value&&(x+=10);const k=De();let L=f+16,T=f;$t.value&&Xe.value==="left"?L+=k.legendWidth||150:$t.value&&Xe.value==="right"&&(T+=k.legendWidth||150),$t.value&&Xe.value==="bottom"&&(g+=k.legendHeight||0);const H={left:L,top:f+x,right:T,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:c?{left:c.left??H.left,top:c.top??H.top,right:c.right??H.right,bottom:c.bottom??H.bottom}:H}),I=e.computed(()=>({left:pn.value.left,top:pn.value.top,right:we.value-pn.value.right,bottom:mt.value-pn.value.bottom,width:we.value-(pn.value.left+pn.value.right),height:mt.value-(pn.value.top+pn.value.bottom)})),fn=e.computed(()=>["line","area","bar"].includes(ge.value)||yt.value),Pn=e.computed(()=>yt.value),cn=e.computed(()=>["radial","semi-radial"].includes(ge.value)),Un=e.computed(()=>ge.value==="spider"),zt=e.computed(()=>ge.value==="bubble"),nn=e.computed(()=>O.value?.chart?.orientation==="horizontal"&&(ge.value==="bar"||Pn.value)),ll=t=>{const{minY:s,maxY:n}=qt.value,c=n-s||1;return I.value.left+(t-s)/c*I.value.width},pl=t=>{const{maxX:s}=qt.value,n=s+1,f=I.value.height/n;return I.value.top+(t+.5)*f},Bt=e.computed(()=>cn.value?pn.value.left+(we.value-pn.value.left-pn.value.right)/2:we.value/2),ht=e.computed(()=>Un.value?mt.value/2-40:cn.value?pn.value.top+(mt.value-pn.value.top-pn.value.bottom)/2:mt.value/2),it=e.computed(()=>{if(Un.value){const t=I.value.width-80,s=I.value.height-80;return Math.min(t,s)/2}return Math.min(I.value.width,I.value.height)/2}),Rt=e.computed(()=>{const t=O.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof s=="number"&&s>=0&&s<=1?s:.45;return it.value*n}),So=e.computed(()=>{const t=O.value,s=typeof S.innerSize=="number"?S.innerSize:t?.innerSize;return typeof s!="number"||s<=-100||!(cn.value||Un.value)?1:1+s/100}),ho=e.computed(()=>{const t=So.value;if(t===1||t<=0)return;const s=Bt.value,n=ht.value;return`translate(${s}, ${n}) scale(${t}) translate(${-s}, ${-n})`}),yl=e.ref(0),Xn=e.computed(()=>`semi-radial-fill-clip-${S.chartId}`),Nn=e.computed(()=>ge.value==="semi-radial"),Qn=e.computed(()=>Nn.value&&C.value&&!un.value),ol=e.computed(()=>Nn.value&&C.value&&!un.value&&V.value==="fill"),Wt=e.computed(()=>{const t=Qn.value?yl.value:1,s=Bt.value,n=ht.value,c=Rt.value,f=it.value,g=Math.PI,x=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;const k=s+f*Math.cos(g),L=n+f*Math.sin(g),T=s+f*Math.cos(x),H=n+f*Math.sin(x),M=s+c*Math.cos(x),K=n+c*Math.sin(x),ce=s+c*Math.cos(g),Ee=n+c*Math.sin(g),J=t>.5?1:0;return`M ${s} ${n} L ${k} ${L} A ${f} ${f} 0 ${J} 1 ${T} ${H} L ${M} ${K} A ${c} ${c} 0 ${J} 1 ${ce} ${Ee} Z`}),Kl=e.computed(()=>{if(!(!Nn.value||!Qn.value)&&!ol.value)return`url(#${Xn.value})`}),yo=t=>{if(!(!ol.value||t!==0))return`url(#${Xn.value})`},$n=e.ref(0),al=e.computed(()=>`radial-reveal-clip-${S.chartId}`),Sn=e.computed(()=>ge.value==="radial"),fl=e.computed(()=>{const t=Sn.value?$n.value:1,s=Bt.value,n=ht.value,c=Math.max(it.value*1.5,we.value,mt.value);if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;if(t>=1){const M=s-c,K=s+c;return`M ${M} ${n} A ${c} ${c} 0 0 1 ${K} ${n} A ${c} ${c} 0 0 1 ${M} ${n} Z`}const f=-Math.PI/2,g=f+t*Math.PI*2,x=s+c*Math.cos(f),k=n+c*Math.sin(f),L=s+c*Math.cos(g),T=n+c*Math.sin(g),H=t>=.5?1:0;return`M ${s} ${n} L ${x} ${k} A ${c} ${c} 0 ${H} 1 ${L} ${T} Z`}),Cl=e.computed(()=>{if(Kl.value)return Kl.value;if(Sn.value)return`url(#${al.value})`});let Ml=null;const Bo=()=>{if(!Qn.value)return;yl.value=0;const t=P.value,s=performance.now(),n=c=>{const f=c-s,g=Math.min(1,f/t);yl.value=zl(ze.value,g),g<1&&(Ml=requestAnimationFrame(n))};Ml=requestAnimationFrame(n)},kl=e.computed(()=>O.value?.bubbles?.minSize||8),Co=e.computed(()=>O.value?.bubbles?.maxSize||50),bl=e.computed(()=>O.value?.bubbles?.opacity||.7),Gl=(t,s)=>{const n=[15,20,25,18,22],c=n[t%n.length]||20,f=1+Math.sin(s*.5)*.2;return Math.max(5,c*f)},Mo=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},_o=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},Dn=e.computed(()=>S.series),Jn=e.computed(()=>S.series.filter((t,s)=>!Nt.value.has(s))),Yn="auto",qt=e.computed(()=>{if(zt.value)return ko();if(!Jn.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,n=0;Jn.value.forEach(k=>{k.data&&k.data.length&&(n=Math.max(n,k.data.length-1),k.data.forEach(L=>{typeof L=="number"&&(t=Math.min(t,L),s=Math.max(s,L))}))}),S.categories.length>0&&(n=Math.max(n,S.categories.length-1)),t===1/0&&(t=0,s=100);const c=Et.value,f=lt.value;let g,x;if(c===Yn){const k=s-t,L=k>0?k*.1:1;g=Math.max(0,t-L)}else if(typeof c=="number")g=c;else{const k=s-t,L=k>0?k*.1:1;g=Math.max(0,t-L)}if(f===Yn){const k=s-t,L=k>0?k*.1:2;x=s+L}else if(typeof f=="number")x=f;else{const k=s-t,L=k>0?k*.1:2;x=s+L}return{minX:0,maxX:n,minY:g,maxY:x}}),ko=()=>{if(!Jn.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,s=-1/0,n=1/0,c=-1/0,f=1/0,g=-1/0,x=!1;if(Jn.value.forEach((ce,Ee)=>{ce?.data?.length&&ce.data.forEach((J,pe)=>{let ye,oe,Ye;if(typeof J=="object"&&J!==null&&!Array.isArray(J))ye=typeof J.x=="number"?J.x:pe,oe=typeof J.y=="number"?J.y:0,Ye=typeof J.size=="number"?J.size:20;else if(Array.isArray(J)&&J.length>=3)ye=typeof J[0]=="number"?J[0]:pe,oe=typeof J[1]=="number"?J[1]:0,Ye=typeof J[2]=="number"?J[2]:20;else if(typeof J=="number")ye=pe,oe=J,Ye=Gl(Ee,pe);else return;isFinite(ye)&&isFinite(oe)&&isFinite(Ye)&&(t=Math.min(t,ye),s=Math.max(s,ye),n=Math.min(n,oe),c=Math.max(c,oe),f=Math.min(f,Ye),g=Math.max(g,Ye),x=!0)})}),!x)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===s&&(t=Math.min(t,0),s=Math.max(s,S.categories?.length-1||8)),n===c&&(n=Math.max(0,n-10),c=n+20);const k=s-t,L=c-n;let T,H,M,K;return je.value!==null?T=je.value:T=t-k*.1,Dt.value!==null?H=Dt.value:H=s+k*.1,Et.value!==null&&typeof Et.value=="number"?M=Et.value:M=Math.max(0,n-L*.1),lt.value!==null&&typeof lt.value=="number"?K=lt.value:K=c+L*.1,{minX:T,maxX:H,minY:M,maxY:K,minSize:f,maxSize:g}},Ft=t=>{if(zt.value){const{minX:k,maxX:L}=qt.value,T=L-k||1;return I.value.left+(t-k)/T*I.value.width}const{minX:s,maxX:n}=qt.value,c=n-s;if(n===0||c===0)return I.value.left+I.value.width/2;const f=c/G.value.scale,g=s-G.value.offsetX/I.value.width*c,x=(t-g)/f;return I.value.left+x*I.value.width},ln=t=>{const{minY:s,maxY:n}=qt.value,c=n-s||1;return I.value.bottom-(t-s)/c*I.value.height},$o=t=>{if(!zt.value)return qe.value||4;const{maxSize:s}=qt.value,n=Math.max(1,s),c=Math.min(1,Math.max(0,t/n));return kl.value+c*(Co.value-kl.value)},bo=e.computed(()=>wl.value.map(t=>({y:t.y}))),Dl=e.computed(()=>{if(zt.value)return To();if(ge.value==="bar"){if(nn.value){const ke=[],{minY:be,maxY:Pe}=qt.value,Fe=5,kt=Pe-be||1;for(let bt=0;bt<=Fe;bt++){const Bn=be+kt*(bt/Fe),Kt=ll(Bn);ke.push({x:Kt,y:I.value.bottom+20,text:an(Math.round(Bn))})}return ke}const Ee=[],{maxX:J}=qt.value,pe=J+1,ye=5,Ye=(I.value.width-ye*2)/pe;for(let ke=0;ke<=J;ke++){const be=I.value.left+ye+(ke+.5)*Ye;Ee.push({x:be,y:I.value.bottom+20,text:S.categories[ke]||z("chart.fallback.item",{number:ke+1})})}return Ee}const t=[],{minX:s,maxX:n}=qt.value,c=n-s||1,f=c/G.value.scale,g=s-G.value.offsetX/I.value.width*c,x=g+f,k=Math.max(0,Math.floor(g-2)),L=Math.min(n,Math.ceil(x+2)),T=L-k,H=I.value.width,K=Math.floor(H/60);let ce=1;T>K&&(ce=Math.ceil(T/K));for(let Ee=k;Ee<=L;Ee+=ce)if(Ee>=0&&Ee<=n){const J=Ft(Ee);J>=I.value.left-100&&J<=I.value.right+100&&t.push({x:J,y:I.value.bottom+20,text:S.categories[Ee]||`Item ${Ee+1}`})}return t}),To=()=>{const t=[],{minX:s,maxX:n}=qt.value,c=n-s||1,f=Math.min(8,Math.max(4,Math.floor(I.value.width/80)));for(let g=0;g<=f;g++){const x=s+c*g/f,k=Ft(x);if(k>=I.value.left-10&&k<=I.value.right+10){const L=Math.round(x),T=S.categories?.[L];t.push({x:k,y:I.value.bottom+20,text:T||(Number.isInteger(x)?x.toString():x.toFixed(1))})}}return t},wl=e.computed(()=>{if(nn.value){const f=[],{maxX:g}=qt.value;for(let x=0;x<=g;x++)f.push({x:I.value.left-10,y:pl(x),text:S.categories[x]||`Item ${x+1}`});return f}const t=[],{minY:s,maxY:n}=qt.value,c=5;for(let f=0;f<=c;f++){const g=s+(n-s)*(f/c),x=Math.round(g);t.push({x:I.value.left-10,y:ln(g),text:an(x)})}return t}),Mt=t=>{const s=E.value;if(!s||s.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return s[t%s.length]},Ql=t=>{if(!t||typeof t!="string")return"#3a3a3a";const s=t.trim();let n=0,c=0,f=0;const g=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)n=Number(g[1])/255,c=Number(g[2])/255,f=Number(g[3])/255;else{const k=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(k)n=Number(k[1])/255,c=Number(k[2])/255,f=Number(k[3])/255;else{const L=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(L){let T=L[1];T.length===3&&(T=T[0]+T[0]+T[1]+T[1]+T[2]+T[2]),n=parseInt(T.slice(0,2),16)/255,c=parseInt(T.slice(2,4),16)/255,f=parseInt(T.slice(4,6),16)/255}else if(typeof document<"u"){const T=document.createElement("span");T.style.color=s,T.style.display="none",document.body.appendChild(T);const H=getComputedStyle(T).color;document.body.removeChild(T);const M=H.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(M)n=Number(M[1])/255,c=Number(M[2])/255,f=Number(M[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*c+.0722*f>.5?"#3a3a3a":"#fafafa"},Rl=t=>{if(!t||typeof t!="string")return t;const s=t.trim(),n=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(n){const g=Math.max(0,Math.floor(Number(n[1])*.65)),x=Math.max(0,Math.floor(Number(n[2])*.65)),k=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${x}, ${k})`}const c=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(c){const g=Math.max(0,Math.floor(Number(c[1])*.65)),x=Math.max(0,Math.floor(Number(c[2])*.65)),k=Math.max(0,Math.floor(Number(c[3])*.65));return`rgba(${g}, ${x}, ${k}, ${c[4]})`}const f=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(f){let g=f[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const x=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),k=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),L=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[x,k,L].map(T=>T.toString(16).padStart(2,"0")).join("")}`}return s},Jl=(t,s)=>{const c=O.value?.stroke?.color;return c==null?Rl(s):typeof c=="string"?c:Array.isArray(c)&&c.length?c[t%c.length]??Rl(s):Rl(s)},eo=t=>{let s=0;for(let n=1;n<t.length;n++){const c=t[n].x-t[n-1].x,f=t[n].y-t[n-1].y;s+=Math.sqrt(c*c+f*f)}return s},wo=e.computed(()=>ge.value==="line"||Pn.value?(Pn.value?S.series.filter(s=>(s.type||ge.value)==="line"):Dn.value).map((s,n)=>{const c=S.series.findIndex(M=>M===s),f=[];let g=[];s.data.forEach((M,K)=>{M==null?g.length>0&&(f.push([...g]),g=[]):g.push({x:nn.value?ll(M):Ft(K),y:nn.value?pl(K):ln(M),index:K})}),g.length>0&&f.push(g);let x="";f.forEach(M=>{if(M.length>0){let K="";Z.value?K=jl(M):K=`M ${M[0].x} ${M[0].y}`+M.slice(1).map(ce=>` L ${ce.x} ${ce.y}`).join(""),x+=(x?" ":"")+K}});const k=f.reduce((M,K)=>M+eo(K),0),L=Nt.value.has(c),T=Me.value===c,H=Me.value!==null&&Me.value!==c;return{path:x,color:Mt(c),pathLength:k,seriesIndex:c,animationDelay:n*Re.value,isHighlighted:T,isDimmed:H,isHidden:L}}):[]),_l=e.computed(()=>{if(!(ge.value==="line"||Pn.value))return[];const t=Pn.value?S.series.filter(n=>(n.type||ge.value)==="line"):Dn.value,s=[];return t.forEach((n,c)=>{const f=S.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const x=n.data[g];if(x!=null){let k=-1,L=0;for(let T=g+1;T<n.data.length;T++){const H=n.data[T];if(H==null)L++;else{k=T;break}}if(L>0&&k!==-1){const T=n.data[k],H=nn.value?ll(x):Ft(g),M=nn.value?pl(g):ln(x),K=nn.value?ll(T):Ft(k),ce=nn.value?pl(k):ln(T),Ee=Nt.value.has(f),J=Me.value===f,pe=Me.value!==null&&Me.value!==f;s.push({path:`M ${H} ${M} L ${K} ${ce}`,color:Mt(f),seriesIndex:f,animationDelay:c*Re.value,isHighlighted:J,isDimmed:pe,isHidden:Ee,gapSize:L}),g=k-1}}}}),s}),On=e.computed(()=>ge.value==="line"||Pn.value?!C.value||un.value||gt.value.hasAnimated?[]:(Pn.value?S.series.filter(s=>(s.type||ge.value)==="line"):Dn.value).map((s,n)=>{const c=S.series.findIndex(L=>L===s);let f="",g=null;s.data.forEach((L,T)=>{if(L!=null){const H={x:nn.value?ll(L):Ft(T),y:nn.value?pl(T):ln(L)};g===null?f+=`M ${H.x} ${H.y}`:f+=` L ${H.x} ${H.y}`,g=H}else if(g!==null){const H=s.data.findIndex((M,K)=>K>T&&M!==null&&M!==void 0);if(H!==-1){const M={x:nn.value?ll(s.data[H]):Ft(H),y:nn.value?pl(H):ln(s.data[H])};f+=` L ${M.x} ${M.y}`,g=M}}});const x=s.data.map((L,T)=>L==null?null:{x:nn.value?ll(L):Ft(T),y:nn.value?pl(T):ln(L)}).filter(L=>L!==null),k=eo(x);return{path:f,pathLength:k,color:Mt(c),animationDelay:n*Re.value,seriesIndex:c}}):[]),Lo=e.computed(()=>{if(ge.value!=="line")return[];const t=[];return Dn.value.forEach((s,n)=>{const c=Me.value===n,f=Me.value!==null&&Me.value!==n,g=Nt.value.has(n);s.data.forEach((x,k)=>{x!=null&&t.push({x:Ft(k),y:ln(x),color:Mt(n),value:x,label:S.categories[k]||k.toString(),seriesName:s.name,categoryIndex:k,dataIndex:k,animationDelay:(n*s.data.length+k)*(Re.value/8),isHighlighted:c,isDimmed:f,isHidden:g})})}),t}),vl=e.computed(()=>{if(!Pn.value)return[];const t=[];return S.series.filter(n=>(n.type||ge.value)==="line").forEach((n,c)=>{const f=S.series.findIndex(L=>L===n),g=Me.value===f,x=Me.value!==null&&Me.value!==f,k=Nt.value.has(f);n.data.forEach((L,T)=>{L!=null&&t.push({x:Ft(T),y:ln(L),color:Mt(f),value:L,label:S.categories[T]||T.toString(),seriesName:n.name,categoryIndex:T,dataIndex:T,animationDelay:(c*n.data.length+T)*(Re.value/8),isHighlighted:g,isDimmed:x,isHidden:k})})}),t}),xl=e.computed(()=>{if(!zt.value)return[];const t=[];return Dn.value.forEach((s,n)=>{if(!s?.data?.length)return;const c=Me.value,f=c!==null&&c===n,g=c!==null&&c!==n,x=Nt.value.has(n);s.data.forEach((k,L)=>{let T,H,M,K,ce;if(typeof k=="object"&&k!==null&&!Array.isArray(k))T=typeof k.x=="number"?k.x:L,H=typeof k.y=="number"?k.y:0,M=typeof k.size=="number"?k.size:20,K=k.label||S.categories?.[L]||`Point ${L+1}`,ce=k.image||k.imageUrl;else if(Array.isArray(k)&&k.length>=3)T=typeof k[0]=="number"?k[0]:L,H=typeof k[1]=="number"?k[1]:0,M=typeof k[2]=="number"?k[2]:20,K=k[3]||S.categories?.[L]||`Point ${L+1}`,ce=k[4];else if(typeof k=="number")T=L,H=k,M=Gl(n,L),K=S.categories?.[L]||`Point ${L+1}`;else return;!isFinite(T)||!isFinite(H)||!isFinite(M)||t.push({x:Ft(T),y:ln(H),radius:$o(M),originalX:T,originalY:H,originalSize:M,color:Mt(n),seriesName:s.name||`Series ${n+1}`,label:K,imageUrl:ce,seriesIndex:n,dataIndex:L,categoryIndex:Math.round(T),isHighlighted:f,isDimmed:g,isHidden:x,opacity:bl.value})})}),t}),to=e.computed(()=>ge.value!=="area"?[]:Dn.value.map((t,s)=>{const n=[];let c=[];if(t.data.forEach((M,K)=>{M==null?c.length>0&&(n.push([...c]),c=[]):c.push({x:Ft(K),y:ln(M),index:K})}),c.length>0&&n.push(c),n.length===0)return{linePath:"",areaPath:"",color:Mt(s),isHidden:Nt.value.has(s)};const f=I.value.bottom+1;let g="",x="";n.forEach((M,K)=>{if(M.length===0)return;let ce=`M ${M[0].x} ${M[0].y}`;Z.value&&M.length>1?ce=jl(M):M.slice(1).forEach(J=>{ce+=` L ${J.x} ${J.y}`}),g+=(g?" ":"")+ce;let Ee=`M ${M[0].x} ${f}`;if(Ee+=` L ${M[0].x} ${M[0].y}`,Z.value&&M.length>1){const J=jl(M),pe=J.substring(J.indexOf("C")||J.indexOf("Q")||J.indexOf("L"));pe?Ee+=" "+pe:M.slice(1).forEach(ye=>{Ee+=` L ${ye.x} ${ye.y}`})}else M.slice(1).forEach(J=>{Ee+=` L ${J.x} ${J.y}`});Ee+=` L ${M[M.length-1].x} ${f} Z`,x+=(x?" ":"")+Ee});const k=Me.value===s,L=Me.value!==null&&Me.value!==s,T=Nt.value.has(s),H=n.reduce((M,K)=>M+eo(K),0);return{linePath:g,areaPath:x,color:Mt(s),pathLength:H,isHighlighted:k,isDimmed:L,isHidden:T}})),no=e.computed(()=>{if(!(["bar"].includes(ge.value)||Pn.value))return[];const t=[],{maxX:s}=qt.value,n=Pn.value?S.series.filter(f=>(f.type||ge.value)==="bar"):Dn.value,c=n.length;if(nn.value){const f=s+1,x=I.value.height/f,k=x*(2/3),L=Math.min(4,k/c*.15),T=k-(c-1)*L,H=Math.max(4,T/c);n.forEach((M,K)=>{const ce=S.series.findIndex(ye=>ye===M),Ee=Me.value===ce,J=Me.value!==null&&Me.value!==ce,pe=Nt.value.has(ce);M.data.forEach((ye,oe)=>{if(ye==null||typeof ye!="number"||!isFinite(ye))return;const be=I.value.top+(oe+.5)*x-k/2+K*(H+L),Pe=I.value.left,Fe=Math.abs(ll(ye)-I.value.left);let kt="";if(Z.value&&Fe>0){const bt=Math.min(ie.value,H/2,Fe/2);kt=[`M ${Pe} ${be}`,`L ${Pe+Fe-bt} ${be}`,`Q ${Pe+Fe} ${be} ${Pe+Fe} ${be+bt}`,`L ${Pe+Fe} ${be+H-bt}`,`Q ${Pe+Fe} ${be+H} ${Pe+Fe-bt} ${be+H}`,`L ${Pe} ${be+H}`,"Z"].join(" ")}t.push({x:Pe,y:be,width:Fe,height:H,color:Mt(c===1?oe:ce),value:ye,label:S.categories[oe]||oe.toString(),seriesName:M.name,animationDelay:(K*n.length+oe)*(Re.value/4),isHighlighted:Ee,isDimmed:J,isHidden:pe,barPath:kt,isSmooth:Z.value&&Fe>0})})})}else{const f=s+1,x=I.value.width/f,k=x*.8,L=k/c,T=L*.05,H=L-T;n.forEach((M,K)=>{const ce=S.series.findIndex(ye=>ye===M),Ee=Me.value===ce,J=Me.value!==null&&Me.value!==ce,pe=Nt.value.has(ce);M.data.forEach((ye,oe)=>{if(ye==null||typeof ye!="number"||!isFinite(ye))return;const be=I.value.left+(oe+.5)*x-k/2+K*L+T/2,Pe=ln(Math.max(0,ye)),Fe=Math.abs(ln(0)-ln(ye));let kt="";if(Z.value&&Fe>0){const bt=Math.min(ie.value,H/2,Fe/2);kt=[`M ${be} ${Pe+Fe}`,`L ${be} ${Pe+bt}`,`Q ${be} ${Pe} ${be+bt} ${Pe}`,`L ${be+H-bt} ${Pe}`,`Q ${be+H} ${Pe} ${be+H} ${Pe+bt}`,`L ${be+H} ${Pe+Fe}`,"Z"].join(" ")}t.push({x:be,y:Pe,width:H,height:Fe,color:Mt(c===1?oe:ce),value:ye,label:S.categories[oe]||oe.toString(),seriesName:M.name,animationDelay:(K*n.length+oe)*(Re.value/4),isHighlighted:Ee,isDimmed:J,isHidden:pe,barPath:kt,isSmooth:Z.value&&Fe>0})})})}return t}),sl=e.computed(()=>{if(!cn.value)return[];const t=Dn.value.map((g,x)=>({series:g,originalIndex:x})).filter(({originalIndex:g})=>!Nt.value.has(g));if(t.length===0)return[];let s=ge.value==="semi-radial"?Math.PI:-Math.PI/2;const n=ge.value==="semi-radial"?Math.PI:Math.PI*2,c=[];if(t.length===1){const{series:g,originalIndex:x}=t[0],k=g.data[0]||0,L=s,T=s+n-.001,H=L+n/2,M=Bt.value+Math.cos(L)*Rt.value,K=ht.value+Math.sin(L)*Rt.value,ce=Bt.value+Math.cos(T)*Rt.value,Ee=ht.value+Math.sin(T)*Rt.value,J=Bt.value+Math.cos(T)*it.value,pe=ht.value+Math.sin(T)*it.value,ye=Bt.value+Math.cos(L)*it.value,oe=ht.value+Math.sin(L)*it.value,Ye=1,ke=[`M ${M} ${K}`,`A ${Rt.value} ${Rt.value} 0 ${Ye} 1 ${ce} ${Ee}`,`L ${J} ${pe}`,`A ${it.value} ${it.value} 0 ${Ye} 0 ${ye} ${oe}`,"Z"].join(" "),be=Mt(x);return c.push({path:ke,color:be,strokeWidth:ft.value,strokeColor:Jl(0,be),value:k,seriesName:g.name,opacity:.8,isHighlighted:Me.value===x,isDimmed:!1,isHidden:!1,startAngle:L,endAngle:T,midAngle:H}),c}if(ol.value&&t.length===2){const g=t[0],x=t[1],k=Math.min(100,Math.max(0,g.series.data[0]||0)),L=k/100*n,T=(H,M,K,ce,Ee)=>{const J=H+(M-H)/2,pe=M-H,ye=Bt.value+Math.cos(H)*Rt.value,oe=ht.value+Math.sin(H)*Rt.value,Ye=Bt.value+Math.cos(M)*Rt.value,ke=ht.value+Math.sin(M)*Rt.value,be=Bt.value+Math.cos(M)*it.value,Pe=ht.value+Math.sin(M)*it.value,Fe=Bt.value+Math.cos(H)*it.value,kt=ht.value+Math.sin(H)*it.value,bt=pe>Math.PI?1:0,Bn=[`M ${ye} ${oe}`,`A ${Rt.value} ${Rt.value} 0 ${bt} 1 ${Ye} ${ke}`,`L ${be} ${Pe}`,`A ${it.value} ${it.value} 0 ${bt} 0 ${Fe} ${kt}`,"Z"].join(" "),Kt=Mt(ce);return{path:Bn,color:Kt,strokeWidth:ft.value,strokeColor:Jl(c.length,Kt),value:Ee,seriesName:K.name,opacity:.8,isHighlighted:Me.value===ce,isDimmed:Me.value!==null&&Me.value!==ce,isHidden:!1,startAngle:H,endAngle:M,midAngle:J}};return c.push(T(s,s+L,g.series,g.originalIndex,k)),c.push(T(s,s+n,x.series,x.originalIndex,100)),c}const f=t.reduce((g,{series:x})=>g+(x.data[0]||0),0);return f===0?[]:(t.forEach(({series:g,originalIndex:x})=>{const k=g.data[0]||0,L=k/f*n,T=s,H=s+L,M=T+L/2,K=Bt.value+Math.cos(T)*Rt.value,ce=ht.value+Math.sin(T)*Rt.value,Ee=Bt.value+Math.cos(H)*Rt.value,J=ht.value+Math.sin(H)*Rt.value,pe=Bt.value+Math.cos(H)*it.value,ye=ht.value+Math.sin(H)*it.value,oe=Bt.value+Math.cos(T)*it.value,Ye=ht.value+Math.sin(T)*it.value,ke=L>Math.PI?1:0,be=[`M ${K} ${ce}`,`A ${Rt.value} ${Rt.value} 0 ${ke} 1 ${Ee} ${J}`,`L ${pe} ${ye}`,`A ${it.value} ${it.value} 0 ${ke} 0 ${oe} ${Ye}`,"Z"].join(" "),Pe=Mt(x);c.push({path:be,color:Pe,strokeWidth:ft.value,strokeColor:Jl(c.length,Pe),value:k,seriesName:g.name,opacity:.8,isHighlighted:Me.value===x,isDimmed:Me.value!==null&&Me.value!==x,isHidden:!1,startAngle:T,endAngle:H,midAngle:M}),s=H}),c)}),o=e.computed(()=>{const t=sl.value;return ol.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((s,n)=>({segment:s,originalIndex:n}))}),l=e.computed(()=>{if(!tn.value||!cn.value)return[];const t=Hn.value,s=wn.value,n=sn.value,c=xn.value,f=15,g=t*1.3,x=.55,k=(M,K)=>{const ce=Bt.value+Math.cos(M.midAngle)*it.value,Ee=ht.value+Math.sin(M.midAngle)*it.value,J=Bt.value+Math.cos(M.midAngle)*(it.value+s),pe=ht.value+Math.sin(M.midAngle)*(it.value+s),oe=J+n*(K?1:-1),Ye=K?J+f:J-f,ke=pe-c,be=`${M.seriesName}: ${an(M.value)}`,Pe=be.length*t*x;return{pointerStartX:ce,pointerStartY:Ee,pointerEndX:J,pointerEndY:pe,horizontalEndX:oe,horizontalEndY:pe,textX:Ye,textY:ke,text:be,textWidth:Pe,textAnchor:K?"start":"end",isRightSide:K,pointerLineLength:Math.hypot(J-ce,pe-Ee),horizontalLineLength:Math.hypot(oe-J,0)}},L=(M,K)=>{const ce=Math.abs(M.textY-K.textY)<g,Ee=M.isRightSide?M.textX:M.textX-M.textWidth,J=M.isRightSide?M.textX+M.textWidth:M.textX,pe=K.isRightSide?K.textX:K.textX-K.textWidth,ye=K.isRightSide?K.textX+K.textWidth:K.textX,oe=Ee<ye&&pe<J;return ce&&oe},T=sl.value.filter(M=>!M.isHidden),H=[];for(let M=0;M<T.length;M++){const K=T[M];let ce=Math.cos(K.midAngle)>=0;if(M>0){const J=H[M-1],pe=k(K,ce);L(J,pe)&&(ce=!ce)}const Ee=k(K,ce);H.push({...Ee,color:K.color,isHighlighted:K.isHighlighted,isDimmed:K.isDimmed})}return H}),a=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||bl.value||.7;return Me.value===null||Me.value===void 0?s:Me.value!==null?t.seriesIndex===Me.value?Math.min(1,s+.1):Math.max(.5,s*.8):s},r=t=>{if(!t||t.isHidden)return 0;const s=t.radius>20?.9:.8;return Me.value!==null?t.seriesIndex===Me.value?Math.min(1,s+.1):s*.7:s},i=(t,s)=>{if(t)try{if(Me.value===t.seriesIndex?Me.value=null:Me.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:S.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},d=(t,s)=>{const n=[`dss-bubble-fallback-${s}`];return t.isHighlighted&&n.push("dss-bubble-highlighted"),t.isDimmed&&n.push("dss-bubble-dimmed"),t.isHidden&&n.push("dss-bubble-hidden"),n.push(`dss-bubble-series-${t.seriesIndex}`),n.join(" ")},u=(t,s)=>{if(!t||(s.stopPropagation(),$l.value=!0,Me.value=t.seriesIndex,Ne.value.show=!1,!Xt.value))return;const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const c=n.getBoundingClientRect();let f=s.clientX-c.left+10,g=s.clientY-c.top-10;const x=200,k=120;f+x>we.value&&(f=s.clientX-c.left-x-10),g+k>c.height&&(g=s.clientY-c.top-k-10),f<0&&(f=10),g<0&&(g=10);const L=dl.value,T=hl.value,H=L.map(M=>{const K=T[M]||M,ce=m(M,t);return ce?{seriesName:t.seriesName,label:t.label,value:`${K}: ${ce}`,color:t.color}:null}).filter(Boolean);et.value={show:!0,x:f,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:H,categoryIndex:void 0,spiderSeries:[]}},m=(t,s)=>{let n;switch(t){case"x":n=s.originalX;break;case"y":n=s.originalY;break;case"size":n=s.originalSize;break;case"label":n=s.label;break;case"seriesName":n=s.seriesName;break;default:n=s[t]||""}const c=Ll.value[t];if(typeof c=="function")return c(n,s);if(typeof n=="number"){const f=n.toFixed(1);return Fn.value?f+Fn.value:f}return n?.toString()||""},v=()=>{if(!zt.value||!Ne.value.data||Ne.value.data.length===0)return"Bubbles";const t=[],s=new Set;return Ne.value.data.forEach(n=>{if(n.seriesName&&n.label){const c=`${n.seriesName} - ${n.label}`;s.has(c)||(t.push(c),s.add(c))}else n.seriesName&&(s.has(n.seriesName)||(t.push(n.seriesName),s.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},h=(t,s)=>{t&&($l.value=!1,Me.value=null,et.value.show=!1,et.value.bubbleData=[])},_=(t,s)=>{const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const c=n.getBoundingClientRect(),f=io(t.categoryIndex),g=t.description||t.comment||"";let x=s.clientX-c.left+15,k=s.clientY-c.top-10;const L=200,T=g?80:50;x+L>we.value&&(x=s.clientX-c.left-L-15),k+T>mt.value&&(k=s.clientY-c.top-T-10),x<0&&(x=10),k<0&&(k=10),rn.value={show:!0,x,y:k,categoryValue:f,description:g}},$=()=>{rn.value.show=!1},N=e.computed(()=>S.categories.length||Math.max(...Jn.value.map(t=>t.data.length))),Q=e.computed(()=>{let t=0;return Jn.value.forEach(s=>{s.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),Y=e.computed(()=>{const t=[],s=N.value;for(let n=0;n<s;n++){const c=n*2*Math.PI/s-Math.PI/2,f=Bt.value+Math.cos(c)*it.value,g=ht.value+Math.sin(c)*it.value;t.push({x:f,y:g,angle:c,index:n})}return t}),Te=e.computed(()=>{const t=[],s=N.value;return Y.value.forEach((n,c)=>{const f=it.value+15,g=c*2*Math.PI/s-Math.PI/2,x=Bt.value+Math.cos(g)*f,k=ht.value+Math.sin(g)*f+5;let L="middle",T="middle";Math.abs(Math.cos(g))>.5&&(L=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(T=Math.sin(g)>0?"hanging":"auto"),t.push({x,y:k,text:S.categories[c]||`Axis ${c+1}`,anchor:L,baseline:T})}),t}),me=e.ref(new Set),ct=(t,s,n)=>{const c=`current-${n}`,f=me.value.has(c);return!f&&Me.value===null?s.fillOpacity||Ge.value:s.isHighlighted||f?(s.fillOpacity||Ge.value)+.15:s.isDimmed?(s.fillOpacity||Ge.value)*.3:s.fillOpacity||Ge.value},Qt=e.computed(()=>{if(!Un.value)return[];const t=[],s=N.value;return Dn.value.forEach((n,c)=>{const f=[],g=[],x=[],k=Me.value===c,L=Me.value!==null&&Me.value!==c,T=Nt.value.has(c);for(let H=0;H<s;H++){const M=n.data[H]||0,ce=M/Q.value*it.value,Ee=H*2*Math.PI/s-Math.PI/2,J=Bt.value+Math.cos(Ee)*ce,pe=ht.value+Math.sin(Ee)*ce;f.push(`${J},${pe}`),g.push({x:J,y:pe}),x.push({x:J,y:pe,value:M,label:S.categories[H]||`Axis ${H+1}`,seriesName:n.name})}t.push({points:f.join(" "),polygonPoints:g,dataPoints:x,color:Mt(c),fillOpacity:Ge.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:k,isDimmed:L,isHidden:T,seriesIndex:c})}),t}),Jt=(t,s)=>{if(!s||s.length<3)return!1;let n=!1;for(let c=0,f=s.length-1;c<s.length;f=c++){const g=s[c].x,x=s[c].y,k=s[f].x,L=s[f].y;x>t.y!=L>t.y&&t.x<(k-g)*(t.y-x)/(L-x)+g&&(n=!n)}return n},Ut=t=>{if(!Un.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const n=s.getBoundingClientRect(),c=Le.value?.getBoundingClientRect();if(!c)return;const f=t.clientX-c.left,g=t.clientY-c.top,x=Qt.value.filter(k=>k.isHidden?!1:Jt({x:f,y:g},k.polygonPoints));if(x.length>0){x.length,Me.value=x[0].seriesIndex;const k=t.clientX-n.left+10,L=t.clientY-n.top-10,T=200,H=50+x.length*25;let M=k,K=L;M+T>we.value&&(M=t.clientX-n.left-T-10),K+H>mt.value&&(K=t.clientY-n.top-H-10),M<0&&(M=10),K<0&&(K=10);const ce=x.map(Ee=>{let J=Ee.dataPoints[0],pe=1/0;return Ee.dataPoints.forEach(ye=>{const oe=Math.sqrt(Math.pow(ye.x-f,2)+Math.pow(ye.y-g,2));oe<pe&&(pe=oe,J=ye)}),{seriesName:Ee.seriesName,color:Ee.color,value:an(J.value!==void 0?J.value:Ee.value)}});et.value={show:!0,x:M,y:K,title:x.length===1?x[0].seriesName:"",value:"",bubbleData:[],spiderSeries:ce}}else jn()},Pt=e.computed(()=>{const t=O.value;return t.logos.map((s,n)=>{const c=S.series[s.seriesIndex];if(!c||!c.data||c.data.length===0||Nt.value.has(s.seriesIndex))return null;let f,g;if(fn.value){let k=-1,L=null;for(let H=c.data.length-1;H>=0;H--)if(c.data[H]!==null&&c.data[H]!==void 0){k=H,L=c.data[H];break}if(k===-1||L===null)return null;const T=c.data.map((H,M)=>H==null?null:{x:Ft(M),y:ln(H),index:M}).filter(H=>H!==null);if(t.animations.enabled&&!un.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(gt.value.isAnimating||!gt.value.hasAnimated))if(gt.value.isAnimating){const H=gt.value.currentFrame/gt.value.totalFrames,M=zl(t.animations.easing,Math.min(H,1)),K=Go(T,M);f=K.x+(s.offsetX||0),g=K.y+(s.offsetY||0)}else f=T[0].x+(s.offsetX||0),g=T[0].y+(s.offsetY||0);else f=Ft(k)+(s.offsetX||0),g=ln(L)+(s.offsetY||0)}else if(cn.value||Un.value){const k=Math.PI*2/t.logos.length*n;f=Bt.value+Math.cos(k)*(it.value+30)+(s.offsetX||0),g=ht.value+Math.sin(k)*(it.value+30)+(s.offsetY||0)}return{...s,x:f,y:g,seriesIndex:s.seriesIndex}}).filter(Boolean)}),en=t=>{const s=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.opacity="0"),n&&(n.style.opacity="1")},jt=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},Zn=t=>{Nt.value.has(t)?Nt.value.delete(t):Nt.value.add(t)},rl=e.computed(()=>{if(!et.value.show&&!(Ct.value&&Ne.value.show&&!G.value.isZooming))return{display:"none"};let t,s;if(Ct.value&&Ne.value.show&&!G.value.isZooming){t=Ne.value.x+15,s=I.value.top;const n=zt.value?200:150;t+n>we.value&&(t=Ne.value.x-n-15),t<0&&(t=10),s<10&&(s=10)}else t=et.value.x,s=et.value.y;return{left:t+"px",top:s+"px"}}),kn=(t,s)=>{if(!Xt.value||El.value)return;const c=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let f=s.clientX-c.left+10,g=s.clientY-c.top-10;const x=200,k=120,L=we.value,T=mt.value;f+x>L&&(f=s.clientX-c.left-x-10),g+k>T&&(g=s.clientY-c.top-k-10),f<0&&(f=10),g<0&&(g=10);let H;typeof t.categoryIndex=="number"?H=t.categoryIndex:typeof t.dataIndex=="number"?H=t.dataIndex:t.label&&S.categories.includes(t.label)&&(H=S.categories.indexOf(t.label));const M=(nn.value||ge.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";et.value={show:!0,x:f,y:g,title:M,value:an(t.value)||"",categoryIndex:H,spiderSeries:[]}},Fl=e.ref(!1),$l=e.ref(!1),jn=()=>{et.value.show=!1,et.value.spiderSeries=[],et.value.bubbleData=[],Ne.value.show=!1,Fl.value||(Me.value=null)},El=e.ref(!1),Il=(t,s)=>{El.value=!0,et.value.show=!1,Ne.value.show=!1;const c=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let f=s.clientX-c.left+15,g=s.clientY-c.top-10;const x=250;f+x>we.value&&(f=s.clientX-c.left-x-15),f<0&&(f=10),g<0&&(g=10),An.value={show:!0,x:f,y:g,content:t.texts,count:t.totalCount}},Vl=()=>{El.value=!1,An.value.show=!1},gt=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}},un=e.computed(()=>re.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Kn=()=>{if(!C.value||un.value){gt.value.hasAnimated=!0,Sn.value&&($n.value=1);return}Sn.value&&($n.value=0),gt.value.isAnimating=!0,gt.value.currentFrame=0,gt.value.totalFrames=Math.ceil(P.value/16.67);const t=()=>{const s=gt.value.currentFrame/gt.value.totalFrames,n=zl(ze.value,Math.min(s,1));Wn(n),Sn.value&&($n.value=n),s<1?(gt.value.currentFrame++,gt.value.animationId=requestAnimationFrame(t)):Po()};gt.value.animationId=requestAnimationFrame(t)},Wn=t=>{const s=document.querySelector(".dss-custom-chart-container");s&&s.style.setProperty("--dss-animation-progress",t)},Po=()=>{gt.value.isAnimating=!1,gt.value.hasAnimated=!0,Sn.value&&($n.value=1),gt.value.animationId&&(cancelAnimationFrame(gt.value.animationId),gt.value.animationId=null)},Ho=e.computed(()=>!cn.value||gt.value.hasAnimated?!0:Sn.value?$n.value>=1:Nn.value?yl.value>=1:!0),Oo=e.computed(()=>tn.value&&Ho.value),xo=e.ref(!1);e.watch(Oo,t=>{t?(xo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{xo.value=!0})})):xo.value=!1},{immediate:!0});const Yo=e.computed(()=>{if(!C.value||un.value||gt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${P.value}ms`,t["--dss-animation-easing"]=jo(ze.value),t["--dss-stagger-delay"]=`${Re.value}ms`,t}),jo=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",Ko=()=>{if(!C.value||un.value)return"";const t=["dss-chart-animated"];return gt.value.hasAnimated||t.push(`dss-animate-${V.value}`),gt.value.hasAnimated||(cn.value&&ge.value!=="semi-radial"?t.push("dss-animate-fill"):cn.value||t.push(`dss-animate-${V.value}`)),gt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>S.series,(t,s)=>{Ae.value&&s&&gt.value.hasAnimated&&(gt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Kn(),U.value)}))},{deep:!0}),e.watch(()=>G.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{ql()},50)}),e.watch(()=>[G.value.scale,G.value.offsetX],()=>{!G.value.isZooming&&!G.value.isDragging&&ql()},{flush:"post"}),e.watch([fe,Ve],([t,s])=>{G.value.minScale=t,G.value.maxScale=s,(G.value.scale<t||G.value.scale>s)&&Yl()},{immediate:!0}),e.watch(()=>S.locale,t=>{t&&t!==A.value&&(A.value=t)},{immediate:!0}),e.watch(()=>Se.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Al)}):document.removeEventListener("click",Al)}),e.onMounted(()=>{Me.value=null,Sn.value&&(!C.value||un.value)&&($n.value=1),mn(),b.value&&typeof ResizeObserver<"u"&&(ue=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(ve&&cancelAnimationFrame(ve),ve=requestAnimationFrame(()=>{ve=null;const{width:n,height:c}=s.contentRect;pt.value=Math.round(n),p.value=Math.round(c),ae.value&&(xt.value=ae.value.offsetHeight||de)}))}),ue.observe(b.value)),C.value&&!un.value?ge.value==="semi-radial"?setTimeout(()=>Bo(),U.value):setTimeout(()=>Kn(),U.value):(gt.value.hasAnimated=!0,ge.value==="semi-radial"&&(yl.value=1)),document.addEventListener("mousemove",Zo),document.addEventListener("mouseup",Wo),document.addEventListener("click",Xl)}),e.onUnmounted(()=>{ve&&cancelAnimationFrame(ve),ue&&b.value&&(ue.unobserve(b.value),ue.disconnect(),ue=null),gt.value.animationId&&cancelAnimationFrame(gt.value.animationId),Ml&&(cancelAnimationFrame(Ml),Ml=null),G.value.zoomTimeout&&clearTimeout(G.value.zoomTimeout),document.removeEventListener("mousemove",Zo),document.removeEventListener("mouseup",Wo),document.removeEventListener("click",Xl),document.removeEventListener("click",Al)});const Zo=t=>{if(G.value.isDragging&&G.value.scale>1&&fn.value){Ne.value.show=!1;const s=t.clientX-G.value.lastMouseX,{minX:n,maxX:c}=qt.value,f=c-n||1,x=s*.8;G.value.offsetX+=x;const k=f/G.value.scale,L=f-k,T=0,H=-L/f*I.value.width,M=T;G.value.offsetX=Math.max(H,Math.min(M,G.value.offsetX)),G.value.lastMouseX=t.clientX,G.value.lastMouseY=t.clientY}},Wo=()=>{G.value.isDragging&&(G.value.isDragging=!1,setTimeout(()=>{!G.value.isDragging&&G.value.isZooming},100))},Go=(t,s)=>{const n=t.filter(k=>k!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||s<=0)return n[0];if(s>=1)return n[n.length-1];let c=0;const f=[];for(let k=1;k<n.length;k++){const L=n[k].x-n[k-1].x,T=n[k].y-n[k-1].y,H=Math.sqrt(L*L+T*T);f.push(H),c+=H}const g=c*s;let x=0;for(let k=0;k<f.length;k++){const L=x+f[k];if(g<=L){const T=(g-x)/f[k],H=n[k],M=n[k+1];return{x:H.x+(M.x-H.x)*T,y:H.y+(M.y-H.y)*T}}x=L}return n[n.length-1]};return(t,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[Ko(),{"dss-chart-fill-width":rt.value,"dss-chart-fill-height":Oe.value,"dss-chart-compact":cn.value&&!$t.value}]]),style:e.normalizeStyle({width:rt.value?"100%":we.value+"px",height:Ze.value,...rt.value||Oe.value?{overflow:"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Yo.value,cursor:No()}),"data-chart-type":ge.value,ref_key:"containerEl",ref:b,onWheel:vo,onMousedown:Vo,onMousemove:dt,onMouseup:go,onMouseleave:ot,onDblclick:Yl,onContextmenu:e.withModifiers(Ht,["prevent"]),onClick:e.withModifiers(It,["left"]),onWheelCapture:vo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:ae},[e.createElementVNode("div",Wa,[Vt.value?(e.openBlock(),e.createElementBlock("div",qa,e.toDisplayString(Vt.value),1)):e.createCommentVNode("",!0),at.value?(e.openBlock(),e.createElementBlock("div",Ua,e.toDisplayString(at.value),1)):e.createCommentVNode("",!0)]),$t.value&&(Xe.value==="top"||Xe.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Gt.value==="horizontal","dss-legend-vertical":Gt.value==="vertical","dss-legend-top":Xe.value==="top","dss-legend-bottom":Xe.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.series,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Nt.value.has(c),"dss-legend-hovered":Me.value===c,"dss-legend-dimmed":Me.value!==null&&Me.value!==c}]),onClick:f=>Zn(c),onMouseenter:f=>W(c),onMouseleave:se,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Mt(c)})},null,4),e.createElementVNode("span",Ya,e.toDisplayString(n.name),1)],46,Xa))),128))],2)):e.createCommentVNode("",!0),$t.value&&(Xe.value==="left"||Xe.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Xe.value==="left","dss-legend-right":Xe.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.series,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${c}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Nt.value.has(c),"dss-legend-hovered":Me.value===c,"dss-legend-dimmed":Me.value!==null&&Me.value!==c}]),onClick:f=>Zn(c),onMouseenter:f=>W(c),onMouseleave:se,style:e.normalizeStyle({animationDelay:`${c*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Mt(c)})},null,4),e.createElementVNode("span",Ka,e.toDisplayString(n.name),1)],46,ja))),128))],2)):e.createCommentVNode("",!0)],512),F.showAddMarkerButton&&vn.value&&Yt.value.addMarker&&(fn.value||zt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Eo,title:e.unref(z)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:bn.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,Qa),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,Ga)):e.createCommentVNode("",!0),e.createElementVNode("div",Ja,[zt.value&&_t.value?(e.openBlock(),e.createElementBlock("div",es,"Bubble size: "+e.toDisplayString(_t.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:we.value,height:mt.value,class:"dss-chart-svg","data-smooth":Z.value,"data-animated":C.value,ref_key:"svgEl",ref:Le},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",ns,[e.createElementVNode("rect",{x:0,y:I.value.top,width:we.value,height:I.value.height*4},null,8,ls)]),Nn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Xn.value},[e.createElementVNode("path",{d:Wt.value},null,8,as)],8,os)):e.createCommentVNode("",!0),Sn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:al.value},[e.createElementVNode("path",{d:fl.value},null,8,rs)],8,ss)):e.createCommentVNode("",!0)]),fn.value||zt.value?(e.openBlock(),e.createElementBlock("g",is,[Lt.value?(e.openBlock(),e.createElementBlock("g",cs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bo.value,(n,c)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${c}`,x1:I.value.left,x2:I.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${c*50}ms`})},null,12,us))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",ds,[e.createElementVNode("line",{x1:I.value.left,x2:I.value.right,y1:I.value.bottom,y2:I.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ms),e.createElementVNode("line",{x1:I.value.left,x2:I.value.left,y1:I.value.top,y2:I.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ps)]),e.createElementVNode("g",fs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dl.value,(n,c)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${c}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},e.toDisplayString(n.text),13,vs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wl.value,(n,c)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${c}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${c*80}ms`})},e.toDisplayString(n.text),13,gs))),128)),Ot.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:I.value.left+I.value.width/2,y:I.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(Ot.value),9,hs)):e.createCommentVNode("",!0),on.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:I.value.top+12+I.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${I.value.top+I.value.height/2})`},e.toDisplayString(on.value),9,ys)):e.createCommentVNode("",!0)]),ul.value.length>0?(e.openBlock(),e.createElementBlock("g",Cs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ul.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",ks,[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:I.value.bottom,y2:I.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>Il(n,c),onMouseleave:Vl},null,40,bs)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:I.value.bottom,y2:I.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>Il(n,c),onMouseleave:Vl},null,40,ws)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:I.value.bottom,y2:I.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:c=>Il(n,c),onMouseleave:Vl},null,40,xs)):e.createCommentVNode("",!0)]),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,I.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:c=>Il(n,c),onMouseleave:Vl},null,40,Es)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,I.value.top-10),r:"14",fill:n.hasManual&&n.hasAuto||n.hasManual?"#047395":"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:c=>Il(n,c),onMouseleave:Vl},null,40,Vs),e.createElementVNode("text",{x:n.x,y:Math.max(15,I.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(n.totalCount),9,Ns)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Ss,[Pn.value?(e.openBlock(),e.createElementBlock("g",Bs,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":nn.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(no.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${c}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>kn(n,f),onMouseleave:jn},null,46,Ms)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>kn(n,f),onMouseleave:jn},null,46,_s))],64))),128))],2),e.createElementVNode("g",$s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Ts))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_l.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Ls))),128)),qe.value>0||ut.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(vl.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${c}`,cx:n.x,cy:n.y,r:Ue(n.isHighlighted?xe(n,qe.value)+2:xe(n,qe.value)),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>kn(n,f),onMouseleave:jn},null,46,Hs))),128)):e.createCommentVNode("",!0)])])):ge.value==="line"?(e.openBlock(),e.createElementBlock("g",As,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(On.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${c}`,d:n.path,stroke:n.color,"stroke-width":We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":gt.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Ds))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Rs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_l.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${c}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?We.value+2:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Fs))),128)),qe.value>0||ut.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Lo.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${c}`,cx:n.x,cy:n.y,r:Ue(n.isHighlighted?xe(n,qe.value)+2:xe(n,qe.value)),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>kn(n,f),onMouseleave:jn},null,46,Is))),128)):e.createCommentVNode("",!0)])):ge.value==="area"?(e.openBlock(),e.createElementBlock("g",zs,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(to.value,(n,c)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${c}`,id:`area-mask-${c}-${F.chartId}`},[e.createElementVNode("rect",{x:I.value.left-10,y:I.value.top-10,width:I.value.width+20,height:I.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${I.value.width+20}px`})},null,12,Os)],8,Ps))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(to.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${c}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?X.value+.2:X.value,mask:`url(#area-mask-${c}-${F.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden})},null,10,Zs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(to.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${c}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?We.value+1:We.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${c*Re.value}ms`})},null,14,Ws))),128))])):ge.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":nn.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(no.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${c}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>kn(n,f),onMouseleave:jn},null,46,qs)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:f=>kn(n,f),onMouseleave:jn},null,46,Us))],64))),128))],2)):e.createCommentVNode("",!0)]),Ct.value&&Ne.value.show&&!G.value.isZooming?(e.openBlock(),e.createElementBlock("g",Xs,[e.createElementVNode("line",{x1:Ne.value.x,x2:Ne.value.x,y1:I.value.top,y2:I.value.bottom,stroke:te.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Ys),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ne.value.data,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${c}`,cx:Ne.value.x,cy:n.y,r:Ue(qe.value+2),fill:n.color,stroke:"none",opacity:"0.9"},null,8,js))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),zt.value?(e.openBlock(),e.createElementBlock("g",Ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xl.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${c}`},[n?(e.openBlock(),e.createElementBlock("g",Gs,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:Ue(n.radius),fill:n.color,"fill-opacity":a(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(d(n,c)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:f=>u(n,f),onMouseleave:f=>h(n),onClick:f=>i(n,f)},null,42,Qs),n.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:n.x-n.radius*.65,y:n.y-n.radius*.65,width:n.radius*1.3,height:n.radius*1.3,"xlink:href":n.imageUrl,class:e.normalizeClass(`dss-bubble-image-${c} ${n.isHighlighted?"dss-bubble-highlighted":""} ${n.isDimmed?"dss-bubble-dimmed":""} ${n.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${n.radius*.65}px at ${n.radius*.65}px ${n.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:r(n)}),onLoad:f=>Mo(c),onError:f=>_o(c),onMouseenter:f=>u(n,f),onMouseleave:f=>h(n),onClick:f=>i(n,f)},null,46,Js)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),cn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:ho.value},[ge.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Bt.value,cy:ht.value,r:it.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,tr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":ge.value,"clip-path":Cl.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(n,c)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${n.originalIndex}-${c}`,d:n.segment.path,fill:n.segment.color,"fill-opacity":n.segment.isHighlighted?(n.segment.opacity||.8)+.2:n.segment.opacity||.8,stroke:n.segment.strokeWidth?n.segment.strokeColor||n.segment.color:"none","stroke-width":n.segment.strokeWidth||0,"clip-path":yo(n.originalIndex),class:e.normalizeClass({"dss-series-highlighted":n.segment.isHighlighted,"dss-series-dimmed":n.segment.isDimmed,"dss-series-hidden":n.segment.isHidden}),onMouseover:f=>kn(n.segment,f),onMouseleave:jn},null,42,lr))),128))],8,nr),In.value&&Ho.value?(e.openBlock(),e.createElementBlock("g",or,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zl.value,(n,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${c}`,x:n.x,y:n.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label",style:e.normalizeStyle({fill:n.contrastColor})},e.toDisplayString(n.value),13,ar)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),Tl.value&&(Ho.value||Nn.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:gn.value.x,y:gn.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":gl.value,fill:hn.value,class:"dss-radial-data-center"},e.toDisplayString(Sl.value),9,sr)):e.createCommentVNode("",!0),Oo.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":xo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${c}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${c*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:n.pointerStartX,y1:n.pointerStartY,x2:n.pointerEndX,y2:n.pointerEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.pointerLineLength})},null,12,rr),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:n.pointerEndX,y1:n.pointerEndY,x2:n.horizontalEndX,y2:n.horizontalEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.horizontalLineLength})},null,12,ir),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":Hn.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,cr)],6))),128))],2)):e.createCommentVNode("",!0)],8,er)):e.createCommentVNode("",!0),Un.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:ho.value},[Lt.value?(e.openBlock(),e.createElementBlock("g",dr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wt.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${c}`,cx:Bt.value,cy:ht.value,r:Ue(n),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*150}ms`})},null,12,mr))),128)),e.createElementVNode("g",pr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wt.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${c}`},[e.createElementVNode("rect",{x:Bt.value-16,y:ht.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,fr),e.createElementVNode("text",{x:Bt.value,y:ht.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(vt(c)),9,vr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.value,(n,c)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${c}`,x1:Bt.value,x2:n.x,y1:ht.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${c*100}ms`})},null,12,gr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",hr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value,(n,c)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${c}`,x:n.x+Math.cos(c*2*Math.PI/N.value-Math.PI/2)*16,y:n.y+Math.sin(c*2*Math.PI/N.value-Math.PI/2)*16,"text-anchor":n.anchor,"dominant-baseline":n.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${c*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,yr))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Ut,onMouseleave:jn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qt.value,(n,c)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${c}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":ct("current",n,c),stroke:n.color,"stroke-width":n.isHighlighted?We.value+1:We.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${c*Re.value}ms`,transition:"all 0.2s ease"})},null,14,Cr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataPoints,(f,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${c}-${g}`,cx:f.x,cy:f.y,r:Ue(n.isHighlighted?qe.value+1:qe.value>0?qe.value:0),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${c*Re.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:x=>kn(f,x),onMouseleave:jn},null,46,kr))),128))]))),128))],32)],8,ur)):e.createCommentVNode("",!0),e.createElementVNode("g",br,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pt.value,(n,c)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${c}`,cx:n.x,cy:n.y,r:Ue(n.width/2),fill:Mt(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${c}`),style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,14,wr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pt.value,(n,c)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${c}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:f=>en(c),onError:f=>jt(c),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${c}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${c*200}ms`})},null,46,xr))),128))])],8,ts))]),q.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:we.value+"px",height:mt.value+"px",backgroundImage:`url('${Ln.value}')`,backgroundRepeat:"no-repeat",...st.value,opacity:R.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,(n,c)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+n.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:n.x+"px",top:n.y+"px",width:Zt.value+"px",height:Zt.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(f=>po(n),["stop"]),onMouseenter:f=>_(n,f),onMouseleave:$},[e.createElementVNode("img",{src:ro(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Vr)],44,Er)),[[e.vShow,qn.value]])),128)),rn.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:rn.value.x+"px",top:rn.value.y+"px"})},[e.createElementVNode("div",Nr,e.toDisplayString(rn.value.categoryValue),1),rn.value.description?(e.openBlock(),e.createElementBlock("div",Sr,e.toDisplayString(rn.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Xt.value&&(et.value.show||Ct.value&&Ne.value.show&&!G.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Ct.value&&Ne.value.show&&!G.value.isZooming}]),style:e.normalizeStyle(rl.value)},[!Ct.value||!Ne.value.show||G.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Un.value&&et.value.spiderSeries&&et.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",Br,[et.value.title?(e.openBlock(),e.createElementBlock("div",Mr,e.toDisplayString(et.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value.spiderSeries,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${c}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",_r,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",$r,e.toDisplayString(n.value),1)]))),128))])):zt.value&&et.value.bubbleData&&et.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Tr,[et.value.title?(e.openBlock(),e.createElementBlock("div",Lr,e.toDisplayString(et.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Hr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value.bubbleData,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",Ar,[e.createElementVNode("div",Dr,e.toDisplayString(et.value.title),1),e.createElementVNode("div",Rr,e.toDisplayString(et.value.value),1)])),et.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Ke(et.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Fr,[s[5]||(s[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ir,e.toDisplayString(e.unref(z)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke(et.value.categoryIndex).flagGroups,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${c}`},[e.createElementVNode("div",zr,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(f,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${c}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Pr,[e.createElementVNode("div",Or,e.toDisplayString(f.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Ke(et.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Zr,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Wr,e.toDisplayString(e.unref(z)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke(et.value.categoryIndex).markers,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${c}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",qr,[e.createElementVNode("div",Ur,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Xr,e.toDisplayString(n.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",Yr,[e.createElementVNode("div",jr,e.toDisplayString(zt.value?v():F.categories[Ne.value.categoryIndex]||`Category ${Ne.value.categoryIndex+1}`),1),zt.value?(e.openBlock(),e.createElementBlock("div",Kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ne.value.data,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Ne.value.data,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${c}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Gr,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Qr,e.toDisplayString(an(n.value)),1)]))),128))]),Ke(Ne.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Jr,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ei,e.toDisplayString(e.unref(z)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke(Ne.value.categoryIndex).flagGroups,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${c}`},[e.createElementVNode("div",ti,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(f,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${c}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",ni,[e.createElementVNode("div",li,e.toDisplayString(f.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Ke(Ne.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",oi,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ai,e.toDisplayString(e.unref(z)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke(Ne.value.categoryIndex).markers,(n,c)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${c}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",si,[e.createElementVNode("div",ri,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",ii,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),fn.value&&$e.value&&G.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Yl},[s[9]||(s[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(G.value.scale*100))+"% "+e.toDisplayString(e.unref(z)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Za),Se.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:Se.value.x+"px",top:Se.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[Yt.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Bl},e.toDisplayString(e.unref(z)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Yt.value.addMarker&&(Yt.value.downloadSvg||Yt.value.downloadPng||Yt.value.downloadCsv||Tn.value.length>0)?(e.openBlock(),e.createElementBlock("div",ci)):e.createCommentVNode("",!0),Yt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:tl},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Yt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:nl},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Yt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:_n},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Tn.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Yt.value.downloadSvg||Yt.value.downloadPng||Yt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",ui)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tn.value,(n,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+c},[n.separator?(e.openBlock(),e.createElementBlock("div",di)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(En(n)),style:e.normalizeStyle(Wl(n)),onClick:f=>Ul(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:At(n),class:"dss-custom-menu-content"},null,8,pi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",fi,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,mi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),he.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-marker-modal-overlay",onClick:el},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[3]||(s[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",vi,[e.createElementVNode("h3",null,e.toDisplayString(B.value?e.unref(z)("chart.modalMarker.viewMarker"):y.value?e.unref(z)("chart.modalMarker.editMarker"):e.unref(z)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:el},"×")]),e.createElementVNode("div",gi,[e.createElementVNode("div",hi,[e.createVNode(zo,{id:"dss-marker-date",mode:"single",modelValue:he.value.date,"onUpdate:modelValue":s[1]||(s[1]=n=>he.value.date=n),"min-date":Hl.value,"max-date":w.value,disabled:B.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",yi,[e.createElementVNode("label",Ci,e.toDisplayString(e.unref(z)("chart.modalMarker.description")),1),B.value?(e.openBlock(),e.createElementBlock("div",ki,e.toDisplayString(he.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=n=>he.value.description=n),placeholder:e.unref(z)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,bi)),[[e.vModelText,he.value.description]])])]),e.createElementVNode("div",wi,[e.createElementVNode("div",xi,[y.value&&!B.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:mo},e.toDisplayString(e.unref(z)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ei,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:el},e.toDisplayString(B.value?e.unref(z)("chart.modalMarker.close"):e.unref(z)("chart.modalMarker.cancel")),1),B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:uo,disabled:!(he.value.description&&he.value.description.length)},e.toDisplayString(y.value?e.unref(z)("chart.modalMarker.save"):e.unref(z)("chart.contextMenu.addMarker")),9,Vi))])])])])):e.createCommentVNode("",!0)],64))}}),Bi={class:"dss-modal-title"},Mi={class:"dss-modal-actions"},Ao={__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(F,{emit:Ce}){const z=F,A=Ce,_e=e.ref(null),b=e.ref(null),Le=e.computed(()=>{const S={"max-width":z.width};return z.height!=="auto"&&(S.height=z.height,S["min-height"]="0"),S}),ae=e.computed(()=>({}));function pt(){A("close-modal")}function p(){z.backDrop&&!_e.value&&A("close-modal")}function ue(S){S.target.tagName==="INPUT"&&(_e.value=S.target.tagName)}function ve(){setTimeout(()=>{_e.value=null},300)}function de(){const S=document.body,ne=document.documentElement;b.value={bodyOverflow:S.style.overflow,bodyPosition:S.style.position,bodyTop:S.style.top,bodyWidth:S.style.width,htmlOverflow:ne.style.overflow,scrollY:window.scrollY},S.style.overflow="hidden",S.style.position="fixed",S.style.top=`-${b.value.scrollY}px`,S.style.width="100%",S.style.left="0",ne.style.overflow="hidden"}function ee(){if(!b.value)return;const S=document.body,ne=document.documentElement,{bodyOverflow:He,bodyPosition:De,bodyTop:Ie,bodyWidth:O,htmlOverflow:rt,scrollY:Oe}=b.value;S.style.overflow=He||"",S.style.position=De||"",S.style.top=Ie||"",S.style.width=O||"",S.style.left="",ne.style.overflow=rt||"",window.scrollTo(0,Oe||0)}return e.watch(()=>z.showModal,S=>{if(S)de(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const ne=document.getElementById("dss-modal-backdrop");ne&&(ne.addEventListener("focusin",ue),ne.addEventListener("focusout",ve))},100);else{ee(),document.body.classList.remove("dss-modal-open");const ne=document.getElementById("dss-modal-backdrop");ne&&(ne.removeEventListener("focusin",ue),ne.removeEventListener("focusout",ve))}},{immediate:!0}),e.onUnmounted(()=>{z.showModal&&ee()}),(S,ne)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[F.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:p},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(Le.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:ne[0]||(ne[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":F.headerType,"font-size":F.titleSize})},[e.createElementVNode("h1",Bi,[e.renderSlot(S.$slots,"title",{},()=>[ne[1]||(ne[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(S.$slots,"title-data"),F.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:pt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(ae.value)},[e.renderSlot(S.$slots,"content",{},()=>[ne[2]||(ne[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Mi,[e.renderSlot(S.$slots,"actions")])])],4),[[e.vShow,F.showModal]])])):e.createCommentVNode("",!0)]))}},_i={key:0,class:"dss-table-toolbar"},$i={class:"dss-table-toolbar-left"},Ti=["aria-expanded"],Li={class:"dss-pagination-select-dropdown",role:"listbox"},Hi={class:"dss-table-column-visibility-label"},Ai={class:"dss-table-checkbox-wrapper"},Di=["checked","onChange"],Ri={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Fi={class:"dss-table-column-visibility-text"},Ii={class:"dss-table-toolbar-right"},zi=["placeholder"],Pi=["aria-expanded"],Oi={key:1,class:"dss-table-toolbar-extra"},Zi={class:"dss-table-thead"},Wi={key:0,class:"dss-table-th dss-table-selection-column"},qi={key:0,class:"dss-table-checkbox-wrapper"},Ui=["checked","indeterminate"],Xi={key:0,class:"dss-table-checkbox__indeterminate"},Yi={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},ji={key:1,class:"dss-table-th dss-table-expansion-column","aria-label":"Expand row"},Ki=["onClick"],Gi={class:"dss-table-th-content"},Qi={class:"dss-table-th-text"},Ji={key:0},ec={key:1},tc={key:2},nc=["data-filter-column-key","aria-expanded","onClick"],lc={class:"dss-table-tbody"},oc=["onClick"],ac={class:"dss-table-checkbox-wrapper"},sc=["type","name","checked","onChange"],rc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},ic={key:1,class:"dss-table-checkbox__dot"},cc=["onClick"],uc=["aria-expanded","aria-label"],dc={key:0,class:"dss-table-expansion-row"},mc=["colspan"],pc=["colspan"],fc={key:1,class:"dss-table-pagination"},vc={class:"dss-pagination-center"},gc={class:"dss-pagination-controls"},hc=["disabled","title"],yc=["disabled","title"],Cc={class:"dss-pagination-pages"},kc=["onClick"],bc={key:1,class:"dss-pagination-ellipsis"},wc=["disabled","title"],xc=["disabled","title"],Ec=["aria-expanded"],Vc={class:"dss-pagination-select-dropdown",role:"listbox"},Nc=["aria-selected","onClick"],Sc={key:0,class:"dss-table-filter-row"},Bc=["value","placeholder"],Mc=["min","max","value"],_c=["min","max","value"],$c={class:"dss-table-filter-double-range-values"},Tc={key:2,class:"dss-table-filter-daterange"},Lc={class:"dss-table-filter-daterange-row"},Hc={class:"dss-table-filter-daterange-label"},Ac=["value"],Dc={class:"dss-table-filter-daterange-row"},Rc={class:"dss-table-filter-daterange-label"},Fc=["value"],Ic=["value","placeholder"],zc={class:"dss-table-filter-list"},Pc=["checked","onChange"],Oc={class:"dss-table-filter-actions"},Zc={name:"DSSTable"},Wc=Object.assign(Zc,{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:F=>typeof F=="object"&&F!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(F,{emit:Ce}){const{t:z,locale:A}=lo.useI18n(),_e=F,b=Ce,Le={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,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]},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:"No data available"};function ae(w,y){const B=Object.assign({},w);return pt(w)&&pt(y)&&Object.keys(y).forEach(W=>{pt(y[W])?W in w?B[W]=ae(w[W],y[W]):Object.assign(B,{[W]:y[W]}):Object.assign(B,{[W]:y[W]})}),B}function pt(w){return w&&typeof w=="object"&&!Array.isArray(w)}const p=e.computed(()=>ae(Le,_e.options)),ue=e.computed(()=>{const w=p.value.table.width;return w==="auto"?null:typeof w=="number"?w:null}),ve=e.computed(()=>p.value.table.height),de=e.computed(()=>p.value.table.rowHeight??"auto"),ee=e.computed(()=>({height:de.value})),S=e.computed(()=>p.value.table.expandable===!0),ne=e.computed(()=>p.value.table.truncated===!0),He=e.computed(()=>p.value.table.striped),De=e.computed(()=>p.value.table.bordered),Ie=e.computed(()=>p.value.table.hoverable),O=e.computed(()=>p.value.table.size),rt=e.computed(()=>p.value.table.align||"left");e.computed(()=>p.value.title.text),e.computed(()=>p.value.subtitle.text);const Oe=e.computed(()=>p.value.selection.enabled),we=e.computed(()=>p.value.selection.mode),xt=e.computed(()=>p.value.sorting.enabled),Tt=e.computed(()=>p.value.sorting.mode),mt=e.computed(()=>p.value.pagination.enabled),Ze=e.computed(()=>p.value.pagination.rows),ge=e.computed(()=>p.value.pagination.rowsPerPageOptions),yt=e.computed(()=>p.value.scrollable),Vt=e.computed(()=>p.value.emptyMessage),at=e.computed(()=>p.value.toolbar?.downloads?.pdf!==!1),_t=e.computed(()=>p.value.toolbar?.downloads?.excel!==!1),Ot=e.computed(()=>p.value.toolbar?.search!==!1),on=e.computed(()=>at.value||_t.value||Ot.value||Et.value),Et=e.computed(()=>p.value.toolbar?.columnVisibility!==!1),lt=e.ref(""),je=e.ref(!1),Dt=e.ref(null);let Lt=null;function $t(){je.value?(Lt&&(clearTimeout(Lt),Lt=null),je.value=!1,lt.value="",b("search",""),Dt.value?.blur()):(je.value=!0,Lt=setTimeout(()=>{Lt=null,Dt.value?.focus()},80))}function Xe(){lt.value||(je.value=!1)}function Gt(){lt.value="",b("search",""),Dt.value?.focus()}const Xt=e.computed(()=>({"dss-table-striped":He.value,"dss-table-bordered":De.value,"dss-table-hoverable":Ie.value,[`dss-table-${O.value}`]:O.value!=="default","dss-table-truncated":ne.value})),Ct=(w,y)=>w?.field??w?.key??y,te=e.ref(new Set);function $e(){const w=new Set;_e.columns.forEach((y,B)=>{y?.hidden!==!0&&w.add(Ct(y,B))}),te.value=w}const fe=e.computed(()=>_e.columns.filter((w,y)=>te.value.has(Ct(w,y)))),Ve=w=>{const y=_e.columns.findIndex(B=>B===w);return Ct(w,y>=0?y:0)},We=(w,y)=>te.value.has(Ct(w,y));function ft(w,y){const B=Ct(w,y),W=new Set(te.value);W.has(B)?W.delete(B):W.add(B),te.value=W}const qe=e.ref(null),ut=e.ref(!1);function xe(w){qe.value&&!qe.value.contains(w.target)&&(ut.value=!1)}const Ue=e.computed(()=>fe.value.length+(Oe.value?1:0)+(S.value?1:0)),X=(w,y)=>w?.id??w?.key??y,Z=e.ref(new Set),j=e.ref(null),ie=(w,y)=>Z.value.has(X(w,y)),E=(w,y,B)=>{B&&B.stopPropagation();const W=X(w,y),se=new Set(Z.value);se.has(W)?(se.delete(W),b("row-collapse",{data:w,index:y})):(se.add(W),b("row-expand",{data:w,index:y})),Z.value=se},C=(w,y)=>{if(!ne.value)return;const B=X(w,y);j.value!==B&&(j.value=B)},V=e.ref(null),P=e.ref(0),U=e.ref([]),ze=w=>{if(Tt.value==="single")return V.value===w.field?P.value:0;{const y=U.value.find(B=>B.field===w.field);return y?y.order:0}},Re=w=>{const y=ze(w);return{"dss-sort-active":y!==0,"dss-sort-asc":y===1,"dss-sort-desc":y===-1}},Ae=e.ref({}),re=e.ref(null),Ge=e.ref(null),tt=220,wt=e.ref(null),vt=e.computed(()=>fe.value.find(w=>Ve(w)===re.value)??null),Je=e.computed(()=>{if(!vt.value||vt.value.filter!=="range")return null;const w=vt.value,y=re.value,{min:B,max:W}=R(w),se=w.filterMin??B,dt=w.filterMax??W,ot=bn(y),Ht=ot.min??se,It=ot.max??dt,At=dt-se,En=At===0?0:(Ht-se)/At*100,Wl=At===0?100:(It-se)/At*100;return{rangeMin:se,rangeMax:dt,currentMin:Ht,currentMax:It,minPct:En,maxPct:Wl}}),vn=e.ref(null),Yt=e.ref("max");function Tn(w){const y=vn.value,B=Je.value;if(!y||!B)return;const W=y.getBoundingClientRect(),dt=(w.clientX-W.left)/W.width*100,ot=(B.minPct+B.maxPct)/2;Yt.value=dt<ot?"min":"max"}function bn(w){return Ae.value[w]??{}}function Rn(w,y){Ae.value={...Ae.value,[w]:y}}function Zt(w){const y=Ae.value[w];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 Fn(w){const y={...Ae.value};delete y[w],Ae.value=y,re.value=null,Ge.value=null}function an(){if(!re.value){Ge.value=null;return}const w=wt.value;if(!w)return;const y=w.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${re.value}"]`);if(!y)return;const B=y.getBoundingClientRect();Ge.value={top:B.bottom+6,left:Math.max(8,B.right-tt)}}const qn=e.computed(()=>{let w=[..._e.data];const y=(lt.value??"").trim().toLowerCase();return y&&(w=w.filter(B=>_e.columns.some(W=>{if(!W||!W.field)return!1;const se=G(B,W);return String(se??"").toLowerCase().includes(y)}))),fe.value.forEach(B=>{const W=Ve(B),se=Ae.value[W];if(!se)return;const dt=B.field;if(dt){if(se.type==="string"&&se.value?.trim()){const ot=se.value.trim().toLowerCase();w=w.filter(Ht=>{const It=G(Ht,B);return String(It??"").toLowerCase().includes(ot)})}else if(se.type==="range")w=w.filter(ot=>{const Ht=St(ot,dt),It=Number(Ht);return!(Number.isNaN(It)||se.min!=null&&It<se.min||se.max!=null&&It>se.max)});else if(se.type==="dateRange"){const ot=se.from?new Date(se.from).getTime():null,Ht=se.to?new Date(se.to).getTime():null;w=w.filter(It=>{const At=St(It,dt),En=At?new Date(At).getTime():NaN;return!(Number.isNaN(En)||ot!=null&&En<ot||Ht!=null&&En>Ht)})}else if(se.type==="list"&&se.selected?.length){const ot=new Set(se.selected);w=w.filter(Ht=>{const It=G(Ht,B);return ot.has(It!=null?String(It):"")})}}}),w});function cl(w){const y=new Set;return _e.data.forEach(B=>{const W=G(B,w);y.add(W!=null?String(W):"")}),Array.from(y).sort((B,W)=>String(B).localeCompare(String(W)))}function D(w,y){if(re.value===w){re.value=null,Ge.value=null;return}if(re.value=w,y?.currentTarget){const B=y.currentTarget.getBoundingClientRect();Ge.value={top:B.bottom+6,left:Math.max(8,B.right-tt)}}else an()}function q(w,y){Rn(w,{type:"string",value:y})}function R(w){const y=w.field;if(!y)return{min:0,max:100};let B=1/0,W=-1/0;return _e.data.forEach(se=>{const dt=St(se,y),ot=Number(dt);Number.isNaN(ot)||(B=Math.min(B,ot),W=Math.max(W,ot))}),{min:B===1/0?0:B,max:W===-1/0?100:W}}function le(w,y,B){const W={...bn(w),type:"range"},se=B===""?null:Number(B),dt=se===null||Number.isNaN(se)?null:se;W[y]=dt,dt!=null&&(y==="min"&&W.max!=null&&dt>W.max&&(W.max=dt),y==="max"&&W.min!=null&&dt<W.min&&(W.min=dt)),Rn(w,W)}function Be(w,y,B){const W={...bn(w),type:"dateRange"};W[y]=B||"",Rn(w,W)}const nt=e.reactive({});function st(w,y){nt[w]=y}function Qe(w){const y=Ve(w),B=(nt[y]??"").trim().toLowerCase(),W=cl(w);return B?W.filter(se=>String(se).toLowerCase().includes(B)):W}function Ke(w,y){return(bn(w).selected??[]).includes(y!=null?String(y):"")}function dn(w,y){const W=[...bn(w).selected??[]],se=y!=null?String(y):"",dt=W.indexOf(se);dt>=0?W.splice(dt,1):W.push(se),Rn(w,{type:"list",selected:W})}function Ln(w){re.value&&!w.target.closest(".dss-table-filter-wrap")&&!w.target.closest(".dss-table-filter-dropdown")&&(re.value=null,Ge.value=null)}function tn(){an()}const Hn=w=>{if(!(w.sortable===!1||!xt.value))if(Tt.value==="single")V.value===w.field?P.value=P.value===1?-1:P.value===-1?0:1:(V.value=w.field,P.value=1),P.value===0&&(V.value=null),b("sort",{field:V.value,order:P.value});else{const y=U.value.findIndex(B=>B.field===w.field);y>=0?U.value[y].order===1?U.value[y].order=-1:U.value.splice(y,1):U.value.push({field:w.field,order:1}),b("sort",{multiSortMeta:U.value})}},wn=e.computed(()=>{if(!xt.value)return qn.value;let w=[...qn.value];return Tt.value==="single"&&V.value&&P.value!==0?w.sort((y,B)=>{const W=St(y,V.value),se=St(B,V.value);return W===se?0:W==null?1:se==null?-1:(W<se?-1:W>se?1:0)*P.value}):Tt.value==="multiple"&&U.value.length>0&&w.sort((y,B)=>{for(const W of U.value){const se=St(y,W.field),dt=St(B,W.field);if(se===dt)continue;if(se==null)return 1;if(dt==null)return-1;const ot=se<dt?-1:se>dt?1:0;if(ot!==0)return ot*W.order}return 0}),w}),sn=e.ref(0),xn=e.ref(Ze.value),In=e.ref(!1),Nl=e.ref(null),Tl=w=>{xn.value=w,In.value=!1,sn.value=0,b("page",{page:0,rows:xn.value})};function Sl(w){Nl.value&&!Nl.value.contains(w.target)&&(In.value=!1)}const gl=e.computed(()=>wn.value.length),gn=e.computed(()=>Math.ceil(gl.value/xn.value)),hn=e.computed(()=>mt.value?sn.value*xn.value:0),Zl=e.computed(()=>mt.value?Math.min((sn.value+1)*xn.value,gl.value):gl.value),ul=e.computed(()=>{if(!mt.value)return wn.value;const w=hn.value,y=Zl.value;return wn.value.slice(w,y)}),An=e.ref(new Set),dl=e.computed(()=>wn.value.filter((w,y)=>An.value.has(X(w,y)))),hl=e.computed(()=>{const w=wn.value.length;return w>0&&An.value.size===w}),Ll=e.computed(()=>{const w=wn.value.length,y=An.value.size;return y>0&&y<w}),Nt=(w,y)=>An.value.has(X(w,y)),Me=()=>{if(hl.value)An.value=new Set,b("unselect-all");else{const w=new Set;wn.value.forEach((y,B)=>w.add(X(y,B))),An.value=w,b("select-all",dl.value)}},yn=(w,y)=>{const B=X(w,y),W=new Set(An.value),se=W.has(B);we.value==="single"?se?(W.delete(B),b("row-unselect",w)):(W.clear(),W.add(B),b("row-select",w)):se?(W.delete(B),b("row-unselect",w)):(W.add(B),b("row-select",w)),An.value=W},et=e.computed(()=>{const w=gn.value,y=sn.value+1,B=2,W=[],se=[];let dt;for(let ot=1;ot<=w;ot++)(ot===1||ot===w||ot>=y-B&&ot<=y+B)&&W.push(ot);for(const ot of W)dt&&(ot-dt===2?se.push(dt+1):ot-dt!==1&&se.push("...")),se.push(ot),dt=ot;return se}),rn=w=>{w<0||w>=gn.value||(sn.value=w,b("page",{page:w,rows:xn.value}))},Ne=(w,y,B)=>{b("row-click",{data:w,index:y,originalEvent:B}),C(w,hn.value+y)},Se=(w,y)=>{const B=hn.value+y;return{"dss-table-row-selected":Nt(w,B),"dss-table-row-even":y%2===0,"dss-table-row-odd":y%2!==0,"dss-table-row-truncated-clickable":ne.value,"dss-table-row-truncated-expanded":j.value===X(w,B)}},G=(w,y)=>y.field?St(w,y.field):"",St=(w,y)=>y.split(".").reduce((B,W)=>B&&B[W],w),he=w=>{const y=w.align??rt.value;return{"dss-table-sortable":w.sortable!==!1&&xt.value,"dss-table-align-left":y==="left","dss-table-align-center":y==="center","dss-table-align-right":y==="right",[w.className]:w.className}},Hl=w=>{const y={};return w.width&&(y.width=typeof w.width=="number"?`${w.width}px`:w.width),w.minWidth&&(y.minWidth=typeof w.minWidth=="number"?`${w.minWidth}px`:w.minWidth),w.maxWidth&&(y.maxWidth=typeof w.maxWidth=="number"?`${w.maxWidth}px`:w.maxWidth),y};return e.watch(()=>_e.locale,w=>{w&&w!==A.value&&(A.value=w)},{immediate:!0}),e.watch(Ze,w=>{xn.value=w,sn.value=0}),e.watch(lt,w=>{b("search",w??"")}),e.watch(()=>_e.columns,()=>{$e()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Sl),document.addEventListener("click",xe),document.addEventListener("click",Ln),window.addEventListener("resize",tn),window.addEventListener("scroll",tn,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Sl),document.removeEventListener("click",xe),document.removeEventListener("click",Ln),window.removeEventListener("resize",tn),window.removeEventListener("scroll",tn,!0)}),(w,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:wt,style:e.normalizeStyle({width:ue.value+"px",height:ve.value?ve.value+"px":"auto"})},[on.value?(e.openBlock(),e.createElementBlock("div",_i,[e.createElementVNode("div",$i,[at.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:y[0]||(y[0]=B=>b("download-pdf"))},[y[21]||(y[21]=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(z)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),_t.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:y[1]||(y[1]=B=>b("download-excel"))},[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_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(z)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Et.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:qe},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":ut.value}]),onClick:y[2]||(y[2]=B=>ut.value=!ut.value),"aria-expanded":ut.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(z)("table.columnVisibility"))+" ",1),y[23]||(y[23]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Ti),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Li,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.columns,(B,W)=>(e.openBlock(),e.createElementBlock("li",{key:Ct(B,W),role:"option",class:"dss-table-column-visibility-option",onClick:y[3]||(y[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Hi,[e.createElementVNode("span",Ai,[e.createElementVNode("input",{type:"checkbox",checked:We(B,W),onChange:se=>ft(B,W),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Di),We(B,W)?(e.openBlock(),e.createElementBlock("span",Ri,[...y[24]||(y[24]=[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",Fi,e.toDisplayString(B.header),1)])]))),128))],512),[[e.vShow,ut.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ii,[Ot.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":je.value||lt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:Dt,"onUpdate:modelValue":y[4]||(y[4]=B=>lt.value=B),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(z)("table.searchPlaceholder"),"aria-label":"Search table",onFocus:y[5]||(y[5]=B=>je.value=!0),onBlur:Xe},null,40,zi),[[e.vModelText,lt.value]]),lt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":"Clear search",onClick:Gt},[...y[25]||(y[25]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":"Search","aria-expanded":je.value||!!lt.value,onMousedown:e.withModifiers($t,["prevent"])},[...y[26]||(y[26]=[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,Pi)],2)):e.createCommentVNode("",!0),w.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Oi,[e.renderSlot(w.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":yt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Xt.value])},[e.createElementVNode("thead",Zi,[e.createElementVNode("tr",null,[Oe.value?(e.openBlock(),e.createElementBlock("th",Wi,[we.value==="multiple"?(e.openBlock(),e.createElementBlock("span",qi,[e.createElementVNode("input",{type:"checkbox",checked:hl.value,indeterminate:Ll.value,onChange:Me,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ui),Ll.value?(e.openBlock(),e.createElementBlock("span",Xi)):hl.value?(e.openBlock(),e.createElementBlock("span",Yi,[...y[27]||(y[27]=[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),S.value?(e.openBlock(),e.createElementBlock("th",ji)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(B,W)=>(e.openBlock(),e.createElementBlock("th",{key:Ve(B),class:e.normalizeClass(["dss-table-th",he(B)]),style:e.normalizeStyle(Hl(B)),onClick:se=>Hn(B)},[e.createElementVNode("div",Gi,[e.createElementVNode("span",Qi,e.toDisplayString(B.header),1),B.sortable!==!1&&xt.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Re(B)])},[ze(B)===0?(e.openBlock(),e.createElementBlock("span",Ji,[...y[28]||(y[28]=[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)])])):ze(B)===1?(e.openBlock(),e.createElementBlock("span",ec,[...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:"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)])])):ze(B)===-1?(e.openBlock(),e.createElementBlock("span",tc,[...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 -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),B.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":re.value===Ve(B)}]),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":Zt(Ve(B))}]),"data-filter-column-key":Ve(B),"aria-expanded":re.value===Ve(B),"aria-label":"Filter column",onClick:se=>D(Ve(B),se)},[...y[31]||(y[31]=[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,nc)],2)):e.createCommentVNode("",!0)])],14,Ki))),128))])]),e.createElementVNode("tbody",lc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ul.value,(B,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:X(B,hn.value+W)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Se(B,W)]),style:e.normalizeStyle(ee.value),onClick:se=>Ne(B,W,se)},[Oe.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",ac,[e.createElementVNode("input",{type:we.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${F.tableId}`,checked:Nt(B,hn.value+W),onChange:se=>yn(B,hn.value+W),class:e.normalizeClass(["dss-table-checkbox",we.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,sc),we.value==="multiple"&&Nt(B,hn.value+W)?(e.openBlock(),e.createElementBlock("span",rc,[...y[32]||(y[32]=[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)])])):we.value==="single"&&Nt(B,hn.value+W)?(e.openBlock(),e.createElementBlock("span",ic)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(se=>E(B,hn.value+W,se),["stop"])},[e.createElementVNode("button",{type:"button",class:"dss-table-expansion-trigger","aria-expanded":ie(B,hn.value+W),"aria-label":ie(B,hn.value+W)?"Collapse row":"Expand row"},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":ie(B,hn.value+W)}]),"aria-hidden":"true"},[...y[33]||(y[33]=[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,uc)],8,cc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(se,dt)=>(e.openBlock(),e.createElementBlock("td",{key:Ve(se),class:e.normalizeClass(["dss-table-td",he(se)]),style:e.normalizeStyle(Hl(se))},[e.renderSlot(w.$slots,`cell-${se.field}`,{data:B,column:se,rowIndex:W},()=>[e.createTextVNode(e.toDisplayString(G(B,se)),1)])],6))),128))],14,oc),S.value&&ie(B,hn.value+W)?(e.openBlock(),e.createElementBlock("tr",dc,[e.createElementVNode("td",{colspan:Ue.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(w.$slots,"expansion",{data:B,rowIndex:W})],8,mc)])):e.createCommentVNode("",!0)],64))),128)),ul.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(ee.value)},[e.createElementVNode("td",{colspan:Ue.value,class:"dss-table-empty-cell"},[e.renderSlot(w.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(Vt.value),1)])],8,pc)],4))])],2)],2),mt.value?(e.openBlock(),e.createElementBlock("div",fc,[e.createElementVNode("div",vc,[e.createElementVNode("div",gc,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:sn.value===0,onClick:y[8]||(y[8]=B=>rn(0)),title:e.unref(z)("table.firstPage")},[...y[34]||(y[34]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,hc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:sn.value===0,onClick:y[9]||(y[9]=B=>rn(sn.value-1)),title:e.unref(z)("table.previousPage")}," ‹ ",8,yc),e.createElementVNode("span",Cc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value,B=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:B},[B!=="..."?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["dss-pagination-page",{"dss-active":B===sn.value+1}]),onClick:W=>rn(B-1)},e.toDisplayString(B),11,kc)):(e.openBlock(),e.createElementBlock("span",bc,"..."))],64))),128))]),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:sn.value>=gn.value-1,onClick:y[10]||(y[10]=B=>rn(sn.value+1)),title:e.unref(z)("table.nextPage")}," › ",8,wc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:sn.value>=gn.value-1,onClick:y[11]||(y[11]=B=>rn(gn.value-1)),title:e.unref(z)("table.lastPage")},[...y[35]||(y[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,xc)]),e.createElementVNode("div",{class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Nl},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":In.value}]),onClick:y[12]||(y[12]=B=>In.value=!In.value),"aria-expanded":In.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(xn.value)+" ",1),y[36]||(y[36]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Ec),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Vc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B,role:"option","aria-selected":B===xn.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":B===xn.value}]),onClick:W=>Tl(B)},e.toDisplayString(B),11,Nc))),128))],512),[[e.vShow,In.value]])]),_:1})],512)])])):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(Ge.value?{top:Ge.value.top+"px",left:Ge.value.left+"px",width:tt+"px"}:void 0),onClick:y[20]||(y[20]=e.withModifiers(()=>{},["stop"]))},[vt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[vt.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Sc,[e.createElementVNode("input",{type:"text",value:bn(re.value).value??"",onInput:y[13]||(y[13]=B=>q(re.value,B.target.value)),class:"dss-table-filter-input",placeholder:e.unref(z)("table.search")||"Search..."},null,40,Bc)])):vt.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:vn,class:"dss-table-filter-double-range-track",onMousemove:Tn,onMouseenter:Tn},[e.createElementVNode("input",{type:"range",min:Je.value.rangeMin,max:Je.value.rangeMax,value:Je.value.currentMin,onInput:y[14]||(y[14]=B=>le(re.value,"min",B.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:Yt.value==="min"?2:1})},null,44,Mc),e.createElementVNode("input",{type:"range",min:Je.value.rangeMin,max:Je.value.rangeMax,value:Je.value.currentMax,onInput:y[15]||(y[15]=B=>le(re.value,"max",B.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:Yt.value==="max"?2:1})},null,44,_c)],544),e.createElementVNode("div",$c,e.toDisplayString(Je.value.currentMin)+" – "+e.toDisplayString(Je.value.currentMax),1)],4)):vt.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Tc,[e.createElementVNode("div",Lc,[e.createElementVNode("label",Hc,e.toDisplayString(e.unref(z)("table.filterFrom")||"From:"),1),e.createElementVNode("input",{type:"date",value:bn(re.value).from??"",onInput:y[16]||(y[16]=B=>Be(re.value,"from",B.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Ac)]),e.createElementVNode("div",Dc,[e.createElementVNode("label",Rc,e.toDisplayString(e.unref(z)("table.filterTo")||"To:"),1),e.createElementVNode("input",{type:"date",value:bn(re.value).to??"",onInput:y[17]||(y[17]=B=>Be(re.value,"to",B.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Fc)])])):vt.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:nt[re.value]??"",onInput:y[18]||(y[18]=B=>st(re.value,B.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(z)("table.search")||"Search..."},null,40,Ic),e.createElementVNode("div",zc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe(vt.value),B=>(e.openBlock(),e.createElementBlock("label",{key:B,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:Ke(re.value,B),onChange:W=>dn(re.value,B)},null,40,Pc),e.createElementVNode("span",null,e.toDisplayString(B),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Oc,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:y[19]||(y[19]=B=>Fn(re.value))},e.toDisplayString(e.unref(z)("table.clearFilter")||"Clear"),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,re.value&&vt.value&&Ge.value]])]),_:1})]))],64))}}),qc={class:"dss-toolbar-left"},Uc=["title"],Xc=["title"],Yc={class:"dss-toolbar-dropdown-wrapper"},jc=["title"],Kc={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Gc={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Qc={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Jc={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},eu={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tu={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},nu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},lu=["title"],ou=["title"],au=["title"],su=["title"],ru=["title"],iu=["title"],cu=["title"],uu=["title"],du=["title"],mu={key:2,class:"dss-toolbar-separator"},pu=["title"],fu={key:4,class:"dss-toolbar-separator"},vu={key:5,class:"dss-toolbar-dropdown-wrapper"},gu=["title"],hu={class:"dss-toolbar-dropdown-ai"},yu={class:"dss-toolbar-right"},Cu={key:0,class:"dss-toolbar-custom-group"},ku={key:1,class:"dss-toolbar-separator"},bu={class:"dss-link-modal-content"},wu={class:"dss-link-modal-field"},xu={class:"dss-link-modal-label"},Eu=["placeholder"],Vu={class:"dss-link-modal-field"},Nu={class:"dss-link-modal-label"},Su=["placeholder"],Bu={class:"dss-image-modal-tabs"},Mu={key:0,class:"dss-image-tab-content"},_u={class:"dss-link-modal-content"},$u={class:"dss-link-modal-field"},Tu={key:0,class:"dss-link-modal-label"},Lu=["src"],Hu={class:"dss-link-modal-field"},Au={class:"dss-link-modal-label"},Du=["placeholder"],Ru={class:"dss-link-modal-field"},Fu={class:"dss-link-modal-label"},Iu=["placeholder"],zu={class:"dss-link-modal-field"},Pu={class:"dss-link-modal-label"},Ou=["placeholder"],Zu={key:1,class:"dss-image-tab-content"},Wu={class:"dss-link-modal-content"},qu={class:"dss-link-modal-field"},Uu={class:"dss-link-modal-label"},Xu=["placeholder"],Yu={class:"dss-link-modal-field"},ju={class:"dss-link-modal-label"},Ku=["placeholder"],Gu={class:"dss-link-modal-field"},Qu={class:"dss-link-modal-label"},Ju=["placeholder"],ed={class:"dss-link-modal-field"},td={class:"dss-link-modal-label"},nd=["placeholder"],ld={class:"dss-text-editor-title-input-container"},od={key:0,class:"dss-text-editor-title-preview"},ad={key:0},sd={key:1,class:"dss-text-editor-preview-placeholder"},rd=["value","placeholder","disabled"],id={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},cd={class:"dss-text-editor-description-input-container"},ud={key:0,class:"dss-text-editor-description-preview"},dd={key:0},md={key:1,class:"dss-text-editor-preview-placeholder"},pd=["value","placeholder","disabled"],fd={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},vd=["data-comment-id","onMouseenter"],gd=["onClick"],hd=["src","alt"],yd={key:1},Cd=["onClick"],kd=["src","alt"],bd={key:1},wd=["data-has-second-user","onClick"],xd={class:"editor-comment-marker-count"},Ed={key:4,class:"dss-text-editor-textarea-wrapper"},Vd=["value","placeholder","rows","disabled"],Nd={class:"dss-text-editor-footer"},Sd={class:"dss-text-editor-footer-content"},Bd={class:"dss-text-editor-footer-stat"},Md={class:"dss-text-editor-footer-stat"},_d={key:5,class:"dss-text-editor-content-wrapper"},$d={key:0,class:"dss-comment-overlay-body"},Td={class:"dss-comment-selection-wrapper"},Ld=["innerHTML"],Hd={class:"dss-comment-messages-wrapper"},Ad={key:0,class:"dss-comment-avatar-wrapper"},Dd={class:"dss-comment-avatar"},Rd=["src","alt"],Fd={key:1},Id={class:"dss-comment-header"},zd={class:"dss-comment-header-text"},Pd={class:"dss-comment-author"},Od={key:0,class:"dss-comment-date"},Zd=["onClick","title"],Wd={class:"dss-comment-overlay-inner"},qd=["placeholder","onKeydown"],Ud={class:"dss-text-editor-footer"},Xd={class:"dss-text-editor-footer-content"},Yd={class:"dss-text-editor-footer-stat"},jd={class:"dss-text-editor-footer-stat"},Kd=["title"],Gd=["title"],Qd={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:""},Jd={class:"dss-image-popup-content"},e1={key:0,class:"dss-image-popup-no-alt-icon"},t1=["title"],n1=["title"],l1={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:""},o1={class:"dss-toolbar-left"},a1=["title"],s1=["title"],r1={class:"dss-toolbar-dropdown-wrapper"},i1=["title"],c1={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},u1={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d1={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},m1={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p1={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f1={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},g1=["title"],h1=["title"],y1=["title"],C1=["title"],k1=["title"],b1=["title"],w1=["title"],x1=["title"],E1=["title"],V1=["title"],N1={key:2,class:"dss-toolbar-separator"},S1={key:3,class:"dss-toolbar-dropdown-wrapper"},B1=["title"],M1={class:"dss-toolbar-dropdown-ai"},_1={key:0,class:"dss-toolbar-right"},$1={key:0,class:"dss-toolbar-separator"},T1={key:0,class:"dss-toolbar-custom-group"},L1={key:1,class:"dss-toolbar-separator"},H1={name:"DSSTextEditor"},A1=Object.assign(H1,{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:F=>typeof F=="object"&&F!==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:F=>typeof F=="object"&&F!==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(F,{expose:Ce,emit:z}){const{t:A,locale:_e}=lo.useI18n(),b=F,Le=z,ae=e.useSlots(),pt=`<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>`,p=e.ref(null),ue=e.ref(null),ve=e.ref(!1),de=e.ref(!1),ee=e.ref(!1),S=e.ref(""),le=e.ref({}),Le=e.ref(!1),Ae=e.ref(!1),Re=e.ref(""),O=e.ref(""),ct=e.ref(null),Ie=e.ref(null),xe=e.ref(null),wt=e.ref(null),_t=e.ref(""),mt=e.ref(!1),ze=e.ref({}),ge=e.ref(!1),gt=e.ref({}),Et=e.ref(null),st=e.ref(null),St=e.ref(!1),Wt=e.ref(""),on=e.ref(null),xt=e.ref(""),et=e.ref(""),Ye=e.ref(""),Ft=e.ref(null),$t=e.ref(null),Bt=e.ref(null),Ue=e.ref(null),Yt=e.ref(null),Ut=e.ref(!1),ht=e.ref(""),te=e.ref({}),_e=e.ref(!1),fe=e.ref("upload"),Se=e.ref(""),Pe=e.ref(null),ft=e.ref(null),Ze=e.ref([]),ut=e.ref([]),Ee=e.ref(null),Qe=e.ref(!1),q=e.ref(""),U=e.ref(""),K=e.ref(""),ie=e.ref(""),x=e.ref(""),C=e.ref(""),V=e.ref(null),P=e.ref(null),Y=e.ref(null),Ve=e.ref(!1),Je=e.ref(null),He=e.ref(!1),oe=e.ref(!1),tt=e.ref(null),je=e.ref("p"),Vt=e.ref(!1),vt=e.ref([]),Ke=e.ref(null),Ht=e.ref(null),$n=e.ref(null),Tn=e.ref(!1),cn=e.ref(0),yn=100,an=e.ref(null),un=e.computed(()=>({"dss-text-editor-no-border":!b.border,"dss-text-editor-rounded":b.rounded,"dss-text-editor-full-height":b.fullHeight,"dss-comment-overlay-open":Kt.value!==null})),zn=e.computed(()=>({})),Ln=e.computed(()=>!b.fixedHeight||b.fullHeight?{}:{height:`${1.6*14*b.rows+24+2}px`,resize:"none",overflowY:"auto"}),hl=e.computed(()=>!b.fixedHeight||b.fullHeight?{}:{height:`${1.6*14*b.rows+32}px`,overflowY:"auto"}),A=e.computed(()=>b.richText&&ut.value.length>0),X=e.computed(()=>{if(!b.modelValue)return"";if(b.richText){let o=b.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 b.modelValue}),I=e.computed(()=>{const o=X.value.trim();return o?o.split(/\s+/).filter(l=>l.length>0).length:0}),ne=e.computed(()=>X.value.length),Be=e.computed(()=>Ue.value!==null&&fe.value==="upload"&&xt.value&&xt.value.startsWith("data:")),nt=e.computed(()=>b.titlePlaceholder||D("textEditor.placeholders.title")),rt=e.computed(()=>b.descriptionPlaceholder||D("textEditor.placeholders.description")),Oe=e.computed(()=>b.placeholder||D("textEditor.placeholders.startTyping")),ot=o=>se&&se[o]!==void 0,sn=o=>{for(let l=o+1;l<b.customToolbarSlots.length;l++)if(ot(b.customToolbarSlots[l]))return!0;return!1},Nn=o=>{for(let l=o+1;l<b.customToolbarSlots.length;l++){const a=b.customToolbarSlots[l];if(ot(a)&&nn(a))return!0}return!1},nn=o=>b.customToolbarFloatingMap.hasOwnProperty(o)?b.customToolbarFloatingMap[o]===!0:!0,Hn=e.computed(()=>b.customToolbarSlots.some(o=>ot(o)&&nn(o))),Cn=e.computed(()=>ot("title-slot")),dn=e.computed(()=>ot("description-slot")),fn=o=>{if(!o||o.trim()==="")return"<html></html>";const l=o.trim();return l.startsWith("<html>")&&l.endsWith("</html>")?o:`<html>${o}</html>`},Pn=o=>{if(!o||o.trim()==="")return"";const l=o.replace(/<!--[\s\S]*?-->/g,""),a=l.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():l},yl=o=>{if(!o)return;const l=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),a=[];let r=l.nextNode();for(;r;)a.push(r),r=l.nextNode();a.forEach(c=>c.remove())},Xl=o=>{try{const l=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`${l} ${r} ${c}`}catch{return""}},Cl=o=>{if(!o||typeof o!="string")return!1;const l=o.trim();if(!l)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(l))return!0;try{const c=D("textEditor.started_conversation");if(c&&l===c)return!0}catch{}const r=l.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},kl=o=>{const l=o.target.value;Te("update:modelValue",l),Te("change",l)},kn=()=>{if(!V.value)return;const o=V.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")},vn=()=>{He.value=!0,kn()},Al=()=>{He.value=!1,ol()},ol=()=>{if(!V.value)return;const o=V.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 l=o.value;o.value="M";const a=o.scrollHeight;o.value=l,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")},An=o=>{const a=o.target.value;He.value&&kn(),Te("update:title",a),Te("title-change",a),Y.value="title",b.richText&&(Qe.value||(U.value=q.value,x.value=K.value,C.value=ie.value),Ee.value&&clearTimeout(Ee.value),Qe.value=!0,Ee.value=setTimeout(()=>{Qe.value=!1,We()},500))},fl=()=>{if(!P.value)return;const o=P.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")},Vl=()=>{oe.value=!0,fl()},At=()=>{oe.value=!1,Ce()},Ce=()=>{if(!P.value)return;const o=P.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 l=o.value;o.value="M";const a=o.scrollHeight;o.value=l,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")},Nl=o=>{const a=o.target.value;oe.value&&fl(),Te("update:description",a),Te("description-change",a),Y.value="description",b.richText&&(Qe.value||(U.value=q.value,x.value=K.value,C.value=ie.value),Ee.value&&clearTimeout(Ee.value),Qe.value=!0,Ee.value=setTimeout(()=>{Qe.value=!1,We()},500))},Ge=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const l=o.getRangeAt(0);if(l.startContainer.nodeType===1)return{type:"element",element:l.startContainer,offset:l.startOffset};const a=l.cloneRange();return a.selectNodeContents(p.value),a.setEnd(l.startContainer,l.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+l.toString().length}},jt=o=>{if(!(!o||!p.value))try{const l=window.getSelection(),a=document.createRange();if(o.type==="element"&&o.element)if(p.value.contains(o.element)){a.setStart(o.element,o.offset),a.collapse(!0),l.removeAllRanges(),l.addRange(a);return}else{p.value.focus();return}let r=0;const c=[p.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])}l.removeAllRanges(),l.addRange(a)}catch{p.value.focus()}},qe=()=>{if(!p.value)return;p.value.focus();const o=window.getSelection(),l=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(p.value);if(r.nodeType===3)l.setStart(r,r.length),l.setEnd(r,r.length);else if(r.childNodes.length>0){const c=a(r);c&&c.nodeType===3?(l.setStart(c,c.length),l.setEnd(c,c.length)):(l.selectNodeContents(r),l.collapse(!1))}else l.setStart(r,0),l.setEnd(r,0);o.removeAllRanges(),o.addRange(l)},We=(o=!1)=>{if(!p.value)return;const l=p.value.innerHTML,a=b.title||"",r=b.description||"";if(!o&&l===q.value&&a===K.value&&r===ie.value)return;const c={content:U.value||q.value,title:x.value!==void 0?x.value:K.value,description:C.value!==void 0?C.value:ie.value},d=Ze.value.length>0?Ze.value[Ze.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&&(Ze.value.push(c),Ze.value.length>50&&Ze.value.shift(),ut.value=[]),q.value=l,K.value=a,ie.value=r,U.value=l,x.value=a,C.value=r},Z=o=>{if(!p.value)return;Tt(),p.value&&yl(p.value);let l=null;p.value&&(p.value.querySelector("p")||(l=Ge(),he()));const a=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");a&&tt.value&&(tt.value=null),de.value=!0;const r=p.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),c=fn(r);Te("update:modelValue",c),Te("change",c),Y.value="editor",Qe.value||(U.value=q.value,x.value=K.value,C.value=ie.value),Ee.value&&clearTimeout(Ee.value),Qe.value=!0,Ee.value=setTimeout(()=>{Qe.value=!1,We(),zt(),Zt()},500),e.nextTick(()=>{l&&jt(l),Tt();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&&tt.value?.command===h){ze.value[h]=tt.value.state;return}if(h==="bold")if(m){const _=m.commonAncestorContainer,$=_.nodeType===3?_.parentElement:_;let N=!1;if($&&(($.tagName==="STRONG"||$.tagName==="B"||$.closest&&$.closest("strong, b"))&&(N=!0),!N&&$.style&&parseInt($.style.fontWeight)>=600&&(N=!0),!N))try{const Q=window.getComputedStyle($);parseInt(Q.fontWeight)>=600&&(N=!0)}catch{}ze.value[h]=N}else ze.value.hasOwnProperty(h)||(ze.value[h]=!1);else if(h==="italic")if(m){const _=m.commonAncestorContainer,$=_.nodeType===3?_.parentElement:_,N=$&&($.tagName==="EM"||$.tagName==="I"||$.closest&&$.closest("em, i"));ze.value[h]=!!N}else{const _=document.queryCommandState(h);ze.value[h]=_}else{const _=document.queryCommandState(h);ze.value[h]=_}}catch{}}),Sn(),Mn(),W(),Ot(),En(),Rn("handleRichTextInput"),a&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const h=o.data||"";h&&h.length===1&&setTimeout(()=>Zt(h),0),(h===" "||h===`
101
- `||/[.,;:!?]/.test(h))&&setTimeout(()=>{zt()},100)}de.value=!1})},Tt=()=>{if(!p.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.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=l.startContainer.nodeType===3?l.startContainer.parentElement:l.startContainer,m=l.endContainer.nodeType===3?l.endContainer.parentElement:l.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)}}}},he=()=>{if(!p.value)return;const o=p.value;if(o.querySelector&&o.querySelector("p"))return;const l=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(l.has(u)){r=null;return}r||(r=document.createElement("p"),o.insertBefore(r,d)),r.appendChild(d)}})},Mn=()=>{if(p.value&&!Ve.value){Ve.value=!0;try{p.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),p.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()}),p.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:.*,/,""),_=c===d||c===h;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||_||_)&&(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=pt,m.appendChild(h)}else if(v&&m.children.length===1){const h=m.parentNode;h.insertBefore(r,m),h.removeChild(m)}})}finally{Ve.value=!1}}},Dl=o=>{zt(),Te("blur",o),Ml()},w=()=>{if(b.disabled||!b.richText||!p.value)return;Dt(),Ee.value&&(clearTimeout(Ee.value),Ee.value=null),Qe.value&&(We(),Qe.value=!1);const o=Y.value==="title",l=Y.value==="description",a=Y.value==="editor";if(Ze.value.length===0){o&&V.value?V.value.focus():l&&P.value?P.value.focus():p.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{Z()});return}const r={content:p.value.innerHTML,title:b.title||"",description:b.description||""};ut.value.push(r);const c=Ze.value.pop();if(c!==void 0){de.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";p.value.innerHTML=d,q.value=d,K.value=u,ie.value=m,U.value=d,x.value=u,C.value=m,e.nextTick(()=>{Sn(),wn(),Zn(),Ot();const v=fn(d);Te("update:modelValue",v),Te("update:title",u),Te("update:description",m),Te("change",v),Te("title-change",u),Te("description-change",m),de.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(V.value){V.value.focus();const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),kn()}}else if(l){if(P.value){P.value.focus();const h=m.length;P.value.setSelectionRange(h,h)}}else if(a)qe();else if(V.value&&document.activeElement===V.value){const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),kn()}else if(P.value&&document.activeElement===P.value){const h=m.length;P.value.setSelectionRange(h,h)}else p.value&&qe()},10)})})}},y=()=>{if(b.disabled||!b.richText||!p.value)return;Dt();const o=Y.value==="title",l=Y.value==="description",a=Y.value==="editor";if(ut.value.length===0){o&&V.value?V.value.focus():l&&P.value?P.value.focus():p.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{Z()});return}const r={content:p.value.innerHTML,title:b.title||"",description:b.description||""};Ze.value.push(r);const c=ut.value.pop();if(c!==void 0){de.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";p.value.innerHTML=d,q.value=d,K.value=u,ie.value=m,U.value=d,x.value=u,C.value=m,e.nextTick(()=>{Sn(),wn(),Zn(),Ot();const v=fn(d);Te("update:modelValue",v),Te("update:title",u),Te("update:description",m),Te("change",v),Te("title-change",u),Te("description-change",m),de.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(V.value){V.value.focus();const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),kn()}}else if(l){if(P.value){P.value.focus();const h=m.length;P.value.setSelectionRange(h,h)}}else if(a)qe();else if(V.value&&document.activeElement===V.value){const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),kn()}else if(P.value&&document.activeElement===P.value){const h=m.length;P.value.setSelectionRange(h,h)}else p.value&&qe()},10)})})}},B=()=>{if(!p.value)return;p.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)}}),p.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)}}),p.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},W=()=>{if(!p.value)return;p.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},re=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let a=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==p.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=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==p.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(()=>{W()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{W()});else try{const r=l.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{W()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{W()})}return!0},dt=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let a=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==p.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=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==p.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(()=>{B()}),!1;if(l.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!==p.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===p.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)}}B()});else try{const r=l.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{B()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{B()})}return!0},lt=(o,l=null)=>{if(b.disabled||!b.richText||!p.value)return;Qe.value?(Ee.value&&(clearTimeout(Ee.value),Ee.value=null),We(),Qe.value=!1):We(),Dt(),p.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&Wn(d)&&(r=Ge())}if(o==="createLink"&&l){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(l);u.insertNode(v),u.selectNodeContents(v)}}}if(o==="bold"){const d=dt();ze.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(tt.value={command:"bold",state:d}),e.nextTick(()=>{r&&(jt(r),e.nextTick(()=>{const m=yt("bold");ze.value.bold=m})),Z(),wn(),Ot()});return}if(o==="italic"){const d=re();ze.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(tt.value={command:"italic",state:d}),e.nextTick(()=>{r&&(jt(r),e.nextTick(()=>{const m=yt("italic");ze.value.italic=m})),Z(),W(),wn(),Ot()});return}let c=!1;try{c=document.execCommand(o,!1,l)}catch{}e.nextTick(()=>{if(r&&jt(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=yt("bold");ze.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=yt("italic");ze.value.italic=u});else{const u=document.queryCommandState(o);ze.value[o]=u}else{const u=document.queryCommandState(o);ze.value[o]=u}}catch{ze.value.hasOwnProperty(o)?ze.value[o]=!ze.value[o]:ze.value[o]=!0}if(o==="createLink"&&l){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",l)}p.value.querySelectorAll("a").forEach(v=>{const h=v.getAttribute("href");(!h||h===""||h==="#")&&v.setAttribute("href",l)})}Z(),wn(),Ot()})},yt=(o,l=null)=>{if(b.disabled||!p.value)return!1;try{if(o==="formatBlock"&&l){const r=document.queryCommandValue("formatBlock");if(l==="<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===l||r.toLowerCase()===l.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 ze.value.hasOwnProperty(o)?ze.value[o]:(ze.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 _;for(;_=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let N=_.parentElement;for(;N&&N!==p.value;){if(N.tagName==="STRONG"||N.tagName==="B"){u=!0;break}if(N.style&&parseInt(N.style.fontWeight)>=600){u=!0;break}N=N.parentElement}}else if(_.nodeType===1){const $=_;if($.tagName==="STRONG"||$.tagName==="B"){u=!0;break}if($.style&&parseInt($.style.fontWeight)>=600){u=!0;break}}if(u)break}}return ze.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 ze.value.hasOwnProperty(o)?ze.value[o]:(ze.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 _;for(;_=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let N=_.parentElement;for(;N&&N!==p.value;){if(N.tagName==="EM"||N.tagName==="I"){u=!0;break}if(N.style&&N.style.fontStyle==="italic"){u=!0;break}N=N.parentElement}}else if(_.nodeType===1){const $=_;if($.tagName==="EM"||$.tagName==="I"){u=!0;break}if($.style&&$.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return ze.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return c.collapsed&&ze.value.hasOwnProperty(o)?ze.value[o]:(ze.value[o]=d,d)}return ze.value.hasOwnProperty(o)?ze.value[o]:!1}catch{return ze.value.hasOwnProperty(o)?ze.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},mn=o=>{b.disabled||!b.richText||(ue.value=ue.value===o?null:o,o==="askAi"&&(st.value=null))},Dt=()=>{ue.value=null,Pe.value=null},bn=o=>{lt("formatBlock",o),Dt()},Yl=o=>{if(!o||!p.value)return o;const l=$e=>{let me=$e.nodeType===Node.TEXT_NODE?$e.parentElement:$e;for(;me&&me!==p.value;){const it=me.tagName;if(it==="P"){const ln=me.parentElement;if(ln===p.value||ln.tagName==="BLOCKQUOTE")return me}if(it==="BLOCKQUOTE")break;me=me.parentElement}return null},a=l(o.startContainer),r=l(o.endContainer);if(!a||!r)return o;const c=[],d=document.createTreeWalker(p.value,NodeFilter.SHOW_ELEMENT,{acceptNode:$e=>{const me=$e.tagName;if(me==="P"){const it=$e.parentElement;if(it===p.value||it.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return me==="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),_=Math.max(m,v),$=c.slice(h,_+1);if($.length===0)return o;const N=$[0],Q=$[$.length-1],j=document.createRange();return j.setStartBefore(N),j.setEndAfter(Q),j},so=()=>{if(b.disabled||!b.richText||!p.value)return;Qe.value?(Ee.value&&(clearTimeout(Ee.value),Ee.value=null),We(),Qe.value=!1):We(),Dt(),p.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let l=o.getRangeAt(0);!l.collapsed&&Wn(l)&&(l=Yl(l),o.removeAllRanges(),o.addRange(l));let a=null;!l.collapsed&&Wn(l)&&(a=Ge());const r=l.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&p.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(l.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=l.extractContents();u.appendChild(m),l.insertNode(u);const v=[],h=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:N=>N.parentNode===u&&N.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let _;for(;_=h.nextNode();)v.push(_);if(v.forEach(N=>{const Q=document.createElement("p");N.parentNode.insertBefore(Q,N),Q.appendChild(N)}),u.querySelectorAll("p, div").forEach(N=>{N.textContent.trim()===""&&!N.querySelector("img")&&(N.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const N=document.createElement("p");N.innerHTML="<br>",u.appendChild(N)}}e.nextTick(()=>{a&&jt(a),Zn(),Z(),Ot()})},ro=()=>{if(!p.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||!p.value.contains(r))return;const c=_=>{if(!_)return!1;const $=_.textContent||"",Q=(_.innerHTML||"").trim();return $.trim()===""||Q===""||Q==="<br>"||Q==="<br/>"||Q==="<p></p>"||Q==="<p><br></p>"||Q==="<p><br/></p>"||Q==="<p> </p>"||Q==="<p><br> </p>"||Q==="<div></div>"||Q==="<div><br></div>"||Q==="<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 _=r.lastChild;if(_.nodeType===1&&_.tagName==="BR")_.remove();else if(_.nodeType===3)if((_.textContent||"").trim()==="")_.remove();else break;else break}if(r.children.length>0)for(let _=r.children.length-1;_>=0;_--){const $=r.children[_];if(($.tagName==="P"||$.tagName==="DIV")&&c($))$.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):p.value&&p.value.appendChild(v);const h=document.createRange();h.selectNodeContents(v),h.collapse(!0),o.removeAllRanges(),o.addRange(h),e.nextTick(()=>{Zn(),Z()})},wn=()=>{if(!p.value){ve.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");ve.value=!!r}else ve.value=!1}catch{ve.value=!1}},jl=()=>{if(!p.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),wt.value=Ge();const l=window.getSelection();let a="";l.rangeCount>0&&(a=l.getRangeAt(0).toString()),Re.value="",O.value=a,_t.value="",xe.value=null,Ae.value=!0,Dt(),e.nextTick(()=>{ct.value&&ct.value.focus()})},io=()=>{if(!p.value)return;Qe.value?(Ee.value&&(clearTimeout(Ee.value),Ee.value=null),We(),Qe.value=!1):We();const o=window.getSelection();let l=null;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;l=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!l&&xe.value&&(l=xe.value),l&&l.parentNode){const a=document.createDocumentFragment();for(;l.firstChild;)a.appendChild(l.firstChild);if(l.parentNode.replaceChild(a,l),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)}xe.value=null}else lt("unlink");ve.value=!1,Dt(),e.nextTick(()=>{Z(),wn()})},al=()=>{b.disabled||!b.richText||p.value&&(Qe.value?(Ee.value&&(clearTimeout(Ee.value),Ee.value=null),We(),Qe.value=!1):We(),Dt(),p.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Sn(),Z(),Ot()}))},co=()=>{b.disabled||!b.richText||p.value&&(Qe.value?(Ee.value&&(clearTimeout(Ee.value),Ee.value=null),We(),Qe.value=!1):We(),Dt(),p.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Sn(),Z(),Ot()}))},uo=o=>{const l=o.parentElement;if(!l||l.tagName!=="OL")return null;let a=0,r=o.previousElementSibling;for(;r;)r.tagName==="LI"&&a++,r=r.previousElementSibling;return a+1},Sn=()=>{if(!p.value)return;p.value.querySelectorAll("li > ol").forEach(l=>{const a=l.parentElement;if(a&&a.tagName==="LI"){const r=uo(a);r!==null&&Array.from(l.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},Kl=()=>{if(b.disabled||!b.richText||!p.value)return;Dt(),p.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{Sn(),Z()});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=uo(c);u.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),Sn();const v=document.createRange();v.selectNodeContents(a),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{Z(),Ot()})}else document.execCommand("indent",!1),e.nextTick(()=>{Sn(),Z(),Ot()})},No=()=>{if(b.disabled||!b.richText||!p.value)return;Dt(),p.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{Sn(),Z()});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(),Sn();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{Z(),Ot()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Sn(),Z(),Ot()})},Kt=e.ref(null),Jn=e.ref(null),_n=e.ref({}),el=e.ref(""),tl=e.ref(null),sl=e.ref("");e.ref("");const rl=e.ref(null);e.ref("");const Bn=e.ref([]),Gl=e.ref(!1),Sl=e.ref(!1),mo=o=>{if(!o)return"";const l=o.cloneRange(),a=document.createElement("div");return a.appendChild(l.cloneContents()),a.innerHTML},Rl=()=>{if(b.disabled||!b.richText||!p.value)return;if(Kt.value!==null){Kt.value=null,el.value="",sl.value="",rl.value=null,Bn.value=[],Yn(!0);return}Dt(),p.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(l.collapsed||!Wn(l))return;sl.value=mo(l)||"",rl.value=Ge();const a=l.getBoundingClientRect(),r=p.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=a.bottom-c.top,m=Math.max(d+8,0);_n.value={top:`${m}px`,bottom:"auto"},Kt.value=Date.now(),e.nextTick(()=>{if(el.value="",tl.value){const h=tl.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 _=r.getBoundingClientRect(),$=v.getBoundingClientRect(),N=h.getBoundingClientRect(),Q=$.bottom-_.top,j=N.top-_.top,$e=8;if(Q>j-$e){const me=N.height;_n.value={bottom:`${me+$e}px`,top:"auto"}}else _n.value={top:`${m}px`,bottom:"auto"}}}})},Ql=()=>{if(!el.value.trim())return;const o=el.value.trim(),l=new Date,a={text:o,selectionText:sl.value,selectionRange:rl.value,commentId:Kt.value,user:b.commentUser||null,createdAt:l.toISOString()};Bn.value=[...Bn.value,a],Te("comment-submitted",a),Jl(a),rl.value&&!Bo(rl.value)&&Mo(Kt.value,rl.value),el.value="",e.nextTick(()=>{if(tl.value){const r=tl.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Rn("sendComment")})},So=(o,l)=>{if(!(!b.commentUser||!o.user||o.user.id!==b.commentUser.id)){if(Bn.value=Bn.value.filter((a,r)=>r!==l),Kt.value!==null&&p.value){const a=String(Kt.value),r=p.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&Bn.value.length>0){const c=[],d=new Set;Bn.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(Bn.value.length))}else r&&Bn.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(Te("comment-deleted",{comment:o,index:l,commentId:Kt.value}),b.comments&&Array.isArray(b.comments)){const a=b.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));Te("update:comments",a)}e.nextTick(()=>{Rn("deleteComment")})}},Bo=o=>{if(!o||!p.value)return!1;try{const l=Fl(o);if(!l)return!1;const a=l.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},Fl=o=>{if(!o||!p.value)return null;try{const l=document.createRange();if(o.type==="element"&&o.element)return p.value.contains(o.element)?(l.setStart(o.element,o.offset),l.collapse(!0),l):null;let a=0;const r=[p.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&&(l.setStart(c,o.start-a),d=!0),d&&o.end>=a&&o.end<=m&&(l.setEnd(c,o.end-a),u=!0),a=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return d?l:null}catch{return null}},Mo=(o,l)=>{if(!(!o||!l||!p.value))try{const a=Fl(l);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,_=a.endOffset,$=m.nodeType===3?m.parentNode:m,N=v.nodeType===3?v.parentNode:v;if($===N&&h===0&&_===(v.nodeType===3?v.length:N.childNodes.length)&&($.tagName==="P"||$.tagName==="DIV"||$.tagName==="H1"||$.tagName==="H2"||$.tagName==="H3"||$.tagName==="H4"||$.tagName==="H5"||$.tagName==="H6")){const j=a.extractContents();d.appendChild(j),a.insertNode(d)}else a.surroundContents(d)}catch{const v=a.extractContents();d.appendChild(v),a.insertNode(d)}const u=p.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{Rn("wrapSelectionWithCommentMarker"),Z()})}catch{}},Jl=o=>{if(!o||!o.commentId)return;const l=Array.isArray(b.comments)?[...b.comments]:[],a=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let r=l.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=l[r];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=o.createdAt,!d.article_id&&l.length>0){const u=l.find(m=>m.article_id);u&&(d.article_id=u.article_id)}}else{const d=o.selectionRange,u=l.length>0&&l.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"};l.push(m)}Gl.value=!0,Te("update:comments",l)},xn=(o,l=[])=>{if(b.disabled||!b.richText||!p.value)return;const a=p.value;let r=null;try{r=a.querySelector(o)}catch{return}if(!r)return;Dt(),a.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),sl.value=r.innerHTML||"",rl.value=Ge();const u=c.getBoundingClientRect(),m=a.parentElement;if(m){const _=m.getBoundingClientRect(),$=u.bottom-_.top,Q=Math.max($+8,0);_n.value={top:`${Q}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let h=[];if(v&&b.comments&&Array.isArray(b.comments)){const _=b.comments.find($=>String($.conversation_id)===String(v));if(_&&_.conversation&&Array.isArray(_.conversation)){const $=_.conversation.map(N=>({id:N.id||N.commentary_id,commentary_id:N.id||N.commentary_id,conversation_id:_.id||_.conversation_id,text:N.text,user:N.user,createdAt:N.created_at||N.createdAt,updated_at:N.updated_at||N.updatedAt}));h.push(...$)}}h.length===0&&Array.isArray(l)&&l.length>0&&(h=l.slice()),h.sort((_,$)=>{const N=$e=>{if(!$e)return 0;const me=new Date($e).getTime();return isNaN(me)?0:me},Q=N(_.createdAt),j=N($.createdAt);return Q===j?0:Q-j}),Bn.value=h,Yn(!0),Kt.value=v||null,r&&(Jn.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(el.value="",tl.value){const _=tl.value;_.style.height="auto",_.style.height=`${_.scrollHeight}px`,_.focus()}if(m){const _=m.querySelector(".dss-comment-overlay");if(_){const $=m.querySelector(".dss-text-editor-footer");if($){const N=m.getBoundingClientRect(),Q=_.getBoundingClientRect(),j=$.getBoundingClientRect(),$e=Q.bottom-N.top,me=j.top-N.top,it=8;if($e>me-it){const ln=j.height;_n.value={bottom:`${ln+it}px`,top:"auto"}}}}}Rn("openCommentOverlayForSelector")})},F=e.ref(null),rn=e.ref(0),Dn=o=>{if(!(b.disabled||!b.richText)){if(o.key==="Escape"){const l=window.getSelection();if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&p.value&&p.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(()=>{ro()},50);return}}}if(o.key.length===1||o.key==="Enter"){const l=window.getSelection();if(l&&l.rangeCount>0){const a=l.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),l.removeAllRanges(),l.addRange(h);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const l=window.getSelection();if(l.rangeCount>0){const a=l.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,$=a.cloneContents().textContent?.trim()||"",N=c.textContent?.trim()||"";(!v||!h||$.length>N.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),l.removeAllRanges(),l.addRange(m),e.nextTick(()=>{Z()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?No():Kl();return}if(o.key==="Enter"){const l=window.getSelection();if(l.rangeCount>0){const a=l.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 _=v.parentElement;return _&&_!==p.value?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!==p.value){o.preventDefault(),o.stopPropagation();let _=null;const $=a.startOffset;$<u.length&&(_=u.splitText($));const N=document.createElement("p");if(_?N.appendChild(_):N.innerHTML="<br>",u.length===0){const j=u.parentElement;j&&(j.removeChild(u),j.childNodes.length===0&&j.appendChild(document.createElement("br")))}h.nextSibling?h.parentNode.insertBefore(N,h.nextSibling):h.parentNode.appendChild(N);const Q=document.createRange();_?Q.setStart(_,0):Q.setStart(N,0),Q.collapse(!0),l.removeAllRanges(),l.addRange(Q),e.nextTick(()=>{Z()});return}}}}const r=a.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&p.value&&p.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=j=>{if(!j)return!1;const $e=j.textContent||"",it=(j.innerHTML||"").trim(),ln=it.replace(/<br\s*\/?>/gi,"").trim();return $e.trim()===""||it===""||ln===""||it==="<br>"||it==="<br/>"||it==="<p></p>"||it==="<p><br></p>"||it==="<p><br/></p>"||it==="<p> </p>"||it==="<p><br> </p>"||it==="<div></div>"||it==="<div><br></div>"||it==="<div><br/></div>"},v=c.lastChild,h=v&&v.nodeType===1&&v.tagName==="BR",_=a.startContainer,$=_.nodeType===3?_.parentElement:_,N=$===c||$&&$.parentElement===c;if(u&&m(u)||h&&N){o.preventDefault(),setTimeout(()=>{ro()},50);return}}}}if(o.key===" "){const l=Date.now(),a=l-rn.value;if(F.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(),Kl();return}}}}F.value=" ",rn.value=l}else F.value=o.key}},pn=o=>{if(b.disabled||!b.richText)return;o.preventDefault();let l=o.clipboardData.getData("text/html"),a=o.clipboardData.getData("text/plain");l&&(l=l.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),We();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=p.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach($=>{if(h>0){const N=v.createElement("p");N.innerHTML=$.innerHTML,$.parentNode.replaceChild(N,$)}else h++}),c){const $=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],N=Array.from(v.body.children).filter(Q=>$.includes(Q.tagName));if(N.length===1){const Q=N[0].tagName,j=c.tagName,$e=c.textContent.trim()===""&&!c.querySelector("img");let me=!1;if(["H1","H2","H3","H4","H5","H6"].includes(j)?me=!0:$e||(Q===j||Q==="P")&&(me=!0),me)return N[0].innerHTML.trim()}}return v.body.innerHTML.trim()};if(l){const u=d(l);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);Z()},On=o=>{if(ue.value){const a=o.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&Dt()}if(ge.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=p.value&&a.closest(".dss-text-editor-content");!r&&!c&&Ml()}if(st.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=a.closest(".dss-toolbar-dropdown");!r&&!c&&cl()}const l=o.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(Pe.value=null),!p.value||!l.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);Vt.value=!r.collapsed&&Wn(r)}else Vt.value=!1}if(Kt.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=l.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!r&&!d&&(Kt.value=null,el.value="",sl.value="",rl.value=null,Bn.value=[],Yn(!0))}},Pt=(o,l)=>{o&&o.stopPropagation&&o.stopPropagation(),ft.value&&(clearTimeout(ft.value),ft.value=null),Pe.value=l},Gt=o=>{const l=o.relatedTarget;if(l){const a=l.closest(".dss-toolbar-dropdown-submenu"),r=l.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||r)return}ft.value&&clearTimeout(ft.value),ft.value=setTimeout(()=>{Pe.value=null,ft.value=null},150)},il=o=>{Pe.value=null};let vl=0;const Mt=o=>{if(!o)return;const l=Array.from(o.children);l.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")}),l.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-${++vl}`;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(_=>{(_.tagName==="BUTTON"||_.tagName==="DIV")&&!_.classList.contains("dss-toolbar-dropdown-item")&&_.classList.add("dss-toolbar-dropdown-item")}))}})},Nt=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{Mt(l),l.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&&Pt(v,h)},m=Gt;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m}}),l.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 _=c.getAttribute("data-submenu-id");_&&Pt(h,_)},m=Gt;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",il)})})})};let at=null;const It=()=>{if(Pe.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Pe.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Pe.value}"]`);o&&l&&xo(o,l)}if(ge.value&&Ot(),b.richText){if(at!==null)return;at=setTimeout(()=>{at=null,Rn("handleWindowResize")},150)}},Il=()=>{if(!b.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(l=>{Array.from(l.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},po=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),l=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",l),a.addEventListener("mousedown",l),a.addEventListener("dragstart",l),a.addEventListener("contextmenu",l),a.addEventListener("click",r=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{He.value?kn():ol(),oe.value?fl():Ce()})}),e.nextTick(()=>{po()}),b.richText&&p.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",On),window.addEventListener("resize",It);let o=null;const l=()=>{o===null&&(o=setTimeout(()=>{o=null,It()},150))};window.addEventListener("scroll",l,!0),p.value._windowScrollHandler=l,p.value._windowScrollTimeout=o,p.value.closest(".editor-with-comments"),p.value.closest(".dss-text-editor-content-wrapper");const a=p.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,It()},150))};a&&(a.addEventListener("scroll",c),p.value._scrollHandlers={wrapper:null,content:a,handler:c}),e.nextTick(()=>{Nt(),Il()}),p.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!b.disabled&&m.preventDefault();const _=v.closest(".dss-image-no-alt-icon"),$=v.closest(".dss-image-wrapper");if(_||$&&v===$){m.preventDefault(),m.stopPropagation();const N=window.getSelection(),Q=document.createRange();Q.setStartAfter($),Q.collapse(!0),N.removeAllRanges(),N.addRange(Q)}else $&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const N=window.getSelection();if(N.rangeCount>0){const j=N.getRangeAt(0).commonAncestorContainer,$e=j.nodeType===3?j.parentElement:j;if($.contains($e)&&$e!==$.querySelector("img")){const me=document.createRange();me.setStartAfter($),me.collapse(!0),N.removeAllRanges(),N.addRange(me)}}else{const Q=document.createRange();Q.setStartAfter($),Q.collapse(!0),N.addRange(Q)}}))},!0),p.value.addEventListener("mousedown",m=>{const v=m.target,h=v.closest(".dss-image-no-alt-icon"),_=v.closest(".dss-image-wrapper");if(h||_&&v.tagName!=="IMG"){m.preventDefault();const $=window.getSelection(),N=document.createRange();_&&(N.setStartAfter(_),N.collapse(!0),$.removeAllRanges(),$.addRange(N))}},!0),p.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!p.value)return;p.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 $=h.getAttribute("alt")||h.alt||"";if($){const N=h.getAttribute("src")||h.src||"",Q=N.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),j=$===N||$===Q;($.startsWith("http://")||$.startsWith("https://")||$.startsWith("data:")||j||j)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),Mn()})}),p.value.addEventListener("dragstart",m=>{const v=m.target,h=v.tagName==="IMG"?v:v.closest("img"),_=h?.closest(".dss-image-wrapper");h&&p.value.contains(h)&&(Je.value=_||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),p.value.addEventListener("dragover",m=>{Je.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),p.value.addEventListener("dragenter",m=>{Je.value&&(m.preventDefault(),m.stopPropagation())}),p.value.addEventListener("drop",m=>{if(!Je.value||!p.value)return;m.preventDefault(),m.stopPropagation();const v=Je.value,h=v.classList?.contains("dss-image-wrapper"),_=h?v.querySelector("img"):v,$=h?v:_?.closest(".dss-image-wrapper");if(!_||!p.value.contains(_)){Je.value=null;return}let N=null;const Q=m.clientX,j=m.clientY;if(document.caretRangeFromPoint)N=document.caretRangeFromPoint(Q,j);else{const Rt=window.getSelection();Rt.rangeCount>0?N=Rt.getRangeAt(0).cloneRange():(N=document.createRange(),N.selectNodeContents(p.value),N.collapse(!1))}if(!N){Je.value=null;return}const $e=N.commonAncestorContainer,me=$e.nodeType===3?$e.parentElement:$e;if(me?.closest(".dss-image-wrapper")===$||$&&$.contains(me)){Je.value=null;return}if($&&(me===$||$.contains(me))){Je.value=null;return}const ln=_.getAttribute("src");let Jt=null;$?Jt=$.cloneNode(!0):Jt=_.cloneNode(!0);try{let Rt=N.startContainer;if(Rt.nodeType===3&&(Rt=Rt.parentElement),$&&(Rt===$||$.contains(Rt))){const qt=document.createRange();qt.setStartAfter($),qt.collapse(!0),N=qt}N.insertNode(Jt);const en=document.createRange();en.setStartAfter(Jt),en.collapse(!0);const tn=window.getSelection();tn.removeAllRanges(),tn.addRange(en)}catch{if(p.value.childNodes.length===0){const en=document.createElement("p");en.appendChild(Jt),p.value.appendChild(en)}else{const en=p.value.lastChild;if(en&&en.nodeType===1)en.appendChild(Jt);else{const tn=document.createElement("p");tn.appendChild(Jt),p.value.appendChild(tn)}}}$?$.remove():_.remove(),Je.value=null,e.nextTick(()=>{const Rt=p.value.querySelectorAll("img");let en=!1;Rt.forEach(tn=>{if(tn.getAttribute("src")===ln)if(!en)en=!0;else{const qt=tn.closest(".dss-image-wrapper");qt?qt.remove():tn.remove()}}),Mn(),Z()})}),p.value.addEventListener("dragend",m=>{Je.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 _=h.querySelectorAll&&h.querySelectorAll("img");_&&_.forEach($=>{$.removeAttribute("alt"),$.removeAttribute("data-alt"),$.setAttribute("alt",""),$.setAttribute("data-alt",""),$.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Mn(),Il(),d=null},100)});if(u.observe(p.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{Il()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),b.modelValue){const m=Pn(b.modelValue);p.value.innerHTML=m,he()}e.nextTick(()=>{const m=p.value.innerHTML||"",v=b.title||"",h=b.description||"";q.value=m,K.value=v,ie.value=h,x.value=v,C.value=h,Sn(),Mn(),W(),En(),ml(),$l()}),wn(),Zn(),p.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",On),window.removeEventListener("resize",It),p.value&&p.value._windowScrollHandler&&window.removeEventListener("scroll",p.value._windowScrollHandler,!0),at!==null&&(clearTimeout(at),at=null),p.value&&p.value._windowScrollTimeout!==null&&clearTimeout(p.value._windowScrollTimeout),Ee.value&&clearTimeout(Ee.value),ft.value&&clearTimeout(ft.value),p.value&&p.value._mutationObserver&&p.value._mutationObserver.disconnect(),Ke.value&&Ke.value.disconnect(),Ht.value!==null&&(cancelAnimationFrame(Ht.value),Ht.value=null),$n.value!==null&&(clearTimeout($n.value),$n.value=null),an.value!==null&&(clearTimeout(an.value),an.value=null),Yn(!0),p.value&&p.value._scrollHandlers){const{wrapper:l,content:a,handler:r}=p.value._scrollHandlers;l&&l.removeEventListener("scroll",r),a&&a.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const Bl=o=>{const l=o.target,a=l.closest("a");if(a&&!b.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(a);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const r=l.closest(".dss-image-wrapper");r&&l.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)}}Mn(),wn(),Zn(),Ot(),En()}):e.nextTick(()=>{Mn(),wn(),Zn(),Ot(),En()})},zl=()=>{Tt();const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0);Vt.value=!a.collapsed&&Wn(a),!a.collapsed&&tt.value&&(tt.value=null)}else Vt.value=!1;if(Mn(),wn(),Zn(),Ot(),En(),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(),Vt.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{}ze.value[a]=m}else{const d=document.queryCommandState(a);ze.value[a]=d}}}catch{}})},En=()=>{if(!b.richText||b.disabled||!p.value){je.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){je.value="p";return}const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!p.value.contains(r)){je.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){je.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?je.value=d:je.value="p"}catch{je.value="p"}},Zn=()=>{if(!p.value){mt.value=!1;return}try{const o=window.getSelection();let l=!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");l=!!(c&&p.value.contains(c))}mt.value=l}catch{mt.value=!1}},Wn=o=>{if(!o||!p.value)return!1;const l=o.commonAncestorContainer;if(!l)return!1;const a=l.nodeType===3?l.parentElement:l;return a?p.value.contains(a):!1},Ml=()=>{ge.value=!1},Ot=()=>{if(!b.floatingToolbar||!b.richText||b.disabled){ge.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){ge.value=!1;return}const l=o.getRangeAt(0);if(l.collapsed||!Wn(l)){ge.value=!1;return}const a=l.getBoundingClientRect();if(!a||a.width===0&&a.height===0){ge.value=!1;return}const r=p.value;if(!r){ge.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){ge.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 _=0;Et.value&&(_=Et.value.getBoundingClientRect().width);const $=(_||320)/2;let N=c.left+$,Q=c.right-$;if(Q<N){const j=c.left+c.width/2;N=j,Q=j}if(h>0){const j=$+u,$e=h-$-u;if(N=Math.max(N,j),Q=Math.min(Q,$e),Q<N){const me=h/2;N=me,Q=me}}v<N?v=N:v>Q&&(v=Q),gt.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},ge.value=!0},fo=o=>{b.disabled||!b.richText||(st.value=st.value===o?null:o,o==="askAi"&&(ue.value=null))},cl=()=>{st.value=null,Pe.value=null},ul=o=>{bn(o),cl()};let gn=null,bl=null,gl=null,qn=null;const _o=o=>{if(b.disabled||!b.richText){_l(),wl();return}const l=o.target,a=l.closest("a"),r=l.closest("img");if(gn&&(clearTimeout(gn),gn=null),gl&&(clearTimeout(gl),gl=null),a&&a!==bl){wl(),bl=a;let c=a.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=a.textContent||""),xe.value=a,S.value=c,ee.value=!0,Le.value=!0,eo(a)}else!a&&bl?(bl=null,gn=setTimeout(()=>{Le.value||_l()},150)):a&&a===bl&&eo(a);if(r&&r!==qn){_l(),qn=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),Ue.value=r,ht.value=c.trim()||D("textEditor.image.noAlt"),Ut.value=!0,_e.value=!0,go(r)}else!r&&qn?(qn=null,gl=setTimeout(()=>{_e.value||wl()},150)):r&&r===qn&&go(r)},vo=o=>{const l=o.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(bl=null,qn=null,gn&&(clearTimeout(gn),gn=null),gl&&(clearTimeout(gl),gl=null),_l(),wl())},_l=()=>{Le.value=!1,setTimeout(()=>{Le.value||(ee.value=!1,S.value="",Ae.value||(xe.value=null))},100)},eo=o=>{if(!o||!p.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;le.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},wl=()=>{_e.value=!1,setTimeout(()=>{_e.value||(Ut.value=!1,ht.value="",St.value||(Ue.value=null))},100)},go=o=>{if(!o||!p.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;te.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},$o=()=>{if(!S.value||!xe.value)return;let l=xe.value.getAttribute("href")||S.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},nl=()=>{if(xe.value){const o=xe.value.textContent||"",l=xe.value.getAttribute("href")||"",a=xe.value;Re.value=l,O.value=o,_t.value=o,Le.value=!1,ee.value=!1,S.value="",xe.value=a,Ae.value=!0}else if(ve.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")||"";Re.value=d,O.value=c,_t.value=c,xe.value=r,Ae.value=!0}}}else{wt.value=Ge();const o=window.getSelection();let l="";o.rangeCount>0&&(l=o.getRangeAt(0).toString()),Re.value="",O.value=l,_t.value="",xe.value=null,Ae.value=!0}e.nextTick(()=>{ct.value&&(ct.value.focus(),ct.value.select())})},Un=()=>{Ae.value=!1,Re.value="",O.value="",_t.value="",xe.value=null,wt.value=null},Xn=()=>{if(!Re.value.trim()){Un();return}if(Qe.value?(Ee.value&&(clearTimeout(Ee.value),Ee.value=null),We(),Qe.value=!1):We(),O.value.trim()||(O.value=Re.value.trim()),xe.value&&p.value&&p.value.contains(xe.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const l=xe.value;if(l.setAttribute("href",Re.value.trim()),O.value.trim()!==_t.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=O.value.trim()}l.style.color="#60afdf",l.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(l),a.collapse(!1),o.removeAllRanges(),o.addRange(a),Z()}else if(p.value){p.value.focus();const o=window.getSelection();o.removeAllRanges(),wt.value&&jt(wt.value);let l=null;if(o.rangeCount>0&&(l=o.getRangeAt(0)),l&&!l.collapsed){l.toString();const a=document.createElement("a");a.href=Re.value.trim(),a.textContent=O.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",l.deleteContents(),l.insertNode(a);const r=document.createTextNode(" ");l.setStartAfter(a),l.insertNode(r),l.setStartAfter(r),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}else{l||(l=document.createRange(),l.selectNodeContents(p.value),l.collapse(!1));const a=l.startContainer,r=a.nodeType===3,c=r&&l.startOffset===a.textContent.length,d=document.createElement("a");if(d.href=Re.value.trim(),d.textContent=O.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=a.parentElement;for(;u&&u!==p.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==p.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(l.startOffset>0){const h=a.textContent.substring(0,l.startOffset),_=h[h.length-1];if(_&&_!==" "&&_!==" "&&_!==`
100
+ </svg>`,p=e.ref(null),ue=e.ref(null),ve=e.ref(!1),de=e.ref(!1),ee=e.ref(!1),S=e.ref(""),ne=e.ref({}),He=e.ref(!1),De=e.ref(!1),Ie=e.ref(""),O=e.ref(""),rt=e.ref(null),Oe=e.ref(null),we=e.ref(null),xt=e.ref(null),Tt=e.ref(""),mt=e.ref(!1),Ze=e.ref({}),ge=e.ref(!1),yt=e.ref({}),Vt=e.ref(null),at=e.ref(null),_t=e.ref(!1),Ot=e.ref(""),on=e.ref(null),Et=e.ref(""),lt=e.ref(""),je=e.ref(""),Dt=e.ref(null),Lt=e.ref(null),$t=e.ref(null),Xe=e.ref(null),Gt=e.ref(null),Xt=e.ref(!1),Ct=e.ref(""),te=e.ref({}),$e=e.ref(!1),fe=e.ref("upload"),Ve=e.ref(""),We=e.ref(null),ft=e.ref(null),qe=e.ref([]),ut=e.ref([]),xe=e.ref(null),Ue=e.ref(!1),X=e.ref(""),Z=e.ref(""),j=e.ref(""),ie=e.ref(""),E=e.ref(""),C=e.ref(""),V=e.ref(null),P=e.ref(null),U=e.ref(null),ze=e.ref(!1),Re=e.ref(null),Ae=e.ref(!1),re=e.ref(!1),Ge=e.ref(null),tt=e.ref("p"),wt=e.ref(!1),vt=e.ref([]),Je=e.ref(null),vn=e.ref(null),Yt=e.ref(null),Tn=e.ref(!1),bn=e.ref(0),Rn=100,Zt=e.ref(null),Fn=e.computed(()=>({"dss-text-editor-no-border":!b.border,"dss-text-editor-rounded":b.rounded,"dss-text-editor-full-height":b.fullHeight,"dss-comment-overlay-open":mn.value!==null})),an=e.computed(()=>({})),qn=e.computed(()=>!b.fixedHeight||b.fullHeight?{}:{height:`${1.6*14*b.rows+24+2}px`,resize:"none",overflowY:"auto"}),cl=e.computed(()=>!b.fixedHeight||b.fullHeight?{}:{height:`${1.6*14*b.rows+32}px`,overflowY:"auto"}),D=e.computed(()=>b.richText&&ut.value.length>0),q=e.computed(()=>{if(!b.modelValue)return"";if(b.richText){let o=b.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 b.modelValue}),R=e.computed(()=>{const o=q.value.trim();return o?o.split(/\s+/).filter(l=>l.length>0).length:0}),le=e.computed(()=>q.value.length),Be=e.computed(()=>Xe.value!==null&&fe.value==="upload"&&Et.value&&Et.value.startsWith("data:")),nt=e.computed(()=>b.titlePlaceholder||A("textEditor.placeholders.title")),st=e.computed(()=>b.descriptionPlaceholder||A("textEditor.placeholders.description")),Qe=e.computed(()=>b.placeholder||A("textEditor.placeholders.startTyping")),Ke=o=>ae&&ae[o]!==void 0,dn=o=>{for(let l=o+1;l<b.customToolbarSlots.length;l++)if(Ke(b.customToolbarSlots[l]))return!0;return!1},Ln=o=>{for(let l=o+1;l<b.customToolbarSlots.length;l++){const a=b.customToolbarSlots[l];if(Ke(a)&&tn(a))return!0}return!1},tn=o=>b.customToolbarFloatingMap.hasOwnProperty(o)?b.customToolbarFloatingMap[o]===!0:!0,Hn=e.computed(()=>b.customToolbarSlots.some(o=>Ke(o)&&tn(o))),wn=e.computed(()=>Ke("title-slot")),sn=e.computed(()=>Ke("description-slot")),xn=o=>{if(!o||o.trim()==="")return"<html></html>";const l=o.trim();return l.startsWith("<html>")&&l.endsWith("</html>")?o:`<html>${o}</html>`},In=o=>{if(!o||o.trim()==="")return"";const l=o.replace(/<!--[\s\S]*?-->/g,""),a=l.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():l},Nl=o=>{if(!o)return;const l=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),a=[];let r=l.nextNode();for(;r;)a.push(r),r=l.nextNode();a.forEach(i=>i.remove())},Tl=o=>{try{const l=String(o.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],i=o.getFullYear();return`${l} ${r} ${i}`}catch{return""}},Sl=o=>{if(!o||typeof o!="string")return!1;const l=o.trim();if(!l)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(l))return!0;try{const i=A("textEditor.started_conversation");if(i&&l===i)return!0}catch{}const r=l.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},gl=o=>{const l=o.target.value;Le("update:modelValue",l),Le("change",l)},gn=()=>{if(!V.value)return;const o=V.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 i=o.scrollHeight;o.value=r,o.style.setProperty("height",`${i}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")},hn=()=>{Ae.value=!0,gn()},Zl=()=>{Ae.value=!1,ul()},ul=()=>{if(!V.value)return;const o=V.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 l=o.value;o.value="M";const a=o.scrollHeight;o.value=l,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")},An=o=>{const a=o.target.value;Ae.value&&gn(),Le("update:title",a),Le("title-change",a),U.value="title",b.richText&&(Ue.value||(Z.value=X.value,E.value=j.value,C.value=ie.value),xe.value&&clearTimeout(xe.value),Ue.value=!0,xe.value=setTimeout(()=>{Ue.value=!1,Ne()},500))},dl=()=>{if(!P.value)return;const o=P.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 i=o.scrollHeight;o.value=r,o.style.setProperty("height",`${i}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")},hl=()=>{re.value=!0,dl()},Ll=()=>{re.value=!1,Nt()},Nt=()=>{if(!P.value)return;const o=P.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 l=o.value;o.value="M";const a=o.scrollHeight;o.value=l,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")},Me=o=>{const a=o.target.value;re.value&&dl(),Le("update:description",a),Le("description-change",a),U.value="description",b.richText&&(Ue.value||(Z.value=X.value,E.value=j.value,C.value=ie.value),xe.value&&clearTimeout(xe.value),Ue.value=!0,xe.value=setTimeout(()=>{Ue.value=!1,Ne()},500))},yn=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const l=o.getRangeAt(0);if(l.startContainer.nodeType===1)return{type:"element",element:l.startContainer,offset:l.startOffset};const a=l.cloneRange();return a.selectNodeContents(p.value),a.setEnd(l.startContainer,l.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+l.toString().length}},et=o=>{if(!(!o||!p.value))try{const l=window.getSelection(),a=document.createRange();if(o.type==="element"&&o.element)if(p.value.contains(o.element)){a.setStart(o.element,o.offset),a.collapse(!0),l.removeAllRanges(),l.addRange(a);return}else{p.value.focus();return}let r=0;const i=[p.value];let d=null,u=!1,m=!1;for(;!m&&(d=i.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--;)i.push(d.childNodes[v])}l.removeAllRanges(),l.addRange(a)}catch{p.value.focus()}},rn=()=>{if(!p.value)return;p.value.focus();const o=window.getSelection(),l=document.createRange(),a=i=>{if(i.nodeType===3||i.childNodes.length===0)return i;for(let d=i.childNodes.length-1;d>=0;d--){const u=i.childNodes[d],m=a(u);if(m)return m}return i},r=a(p.value);if(r.nodeType===3)l.setStart(r,r.length),l.setEnd(r,r.length);else if(r.childNodes.length>0){const i=a(r);i&&i.nodeType===3?(l.setStart(i,i.length),l.setEnd(i,i.length)):(l.selectNodeContents(r),l.collapse(!1))}else l.setStart(r,0),l.setEnd(r,0);o.removeAllRanges(),o.addRange(l)},Ne=(o=!1)=>{if(!p.value)return;const l=p.value.innerHTML,a=b.title||"",r=b.description||"";if(!o&&l===X.value&&a===j.value&&r===ie.value)return;const i={content:Z.value||X.value,title:E.value!==void 0?E.value:j.value,description:C.value!==void 0?C.value:ie.value},d=qe.value.length>0?qe.value[qe.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=i.content!==d:u=i.content!==d.content||i.title!==d.title||i.description!==d.description),u&&(qe.value.push(i),qe.value.length>50&&qe.value.shift(),ut.value=[]),X.value=l,j.value=a,ie.value=r,Z.value=l,E.value=a,C.value=r},Se=o=>{if(!p.value)return;G(),p.value&&Nl(p.value);let l=null;p.value&&(p.value.querySelector("p")||(l=yn(),St()));const a=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");a&&Ge.value&&(Ge.value=null),de.value=!0;const r=p.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),i=xn(r);Le("update:modelValue",i),Le("change",i),U.value="editor",Ue.value||(Z.value=X.value,E.value=j.value,C.value=ie.value),xe.value&&clearTimeout(xe.value),Ue.value=!0,xe.value=setTimeout(()=>{Ue.value=!1,Ne(),Yn(),ko()},500),e.nextTick(()=>{l&&et(l),G();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&&Ge.value?.command===h){Ze.value[h]=Ge.value.state;return}if(h==="bold")if(m){const _=m.commonAncestorContainer,$=_.nodeType===3?_.parentElement:_;let N=!1;if($&&(($.tagName==="STRONG"||$.tagName==="B"||$.closest&&$.closest("strong, b"))&&(N=!0),!N&&$.style&&parseInt($.style.fontWeight)>=600&&(N=!0),!N))try{const Q=window.getComputedStyle($);parseInt(Q.fontWeight)>=600&&(N=!0)}catch{}Ze.value[h]=N}else Ze.value.hasOwnProperty(h)||(Ze.value[h]=!1);else if(h==="italic")if(m){const _=m.commonAncestorContainer,$=_.nodeType===3?_.parentElement:_,N=$&&($.tagName==="EM"||$.tagName==="I"||$.closest&&$.closest("em, i"));Ze.value[h]=!!N}else{const _=document.queryCommandState(h);Ze.value[h]=_}else{const _=document.queryCommandState(h);Ze.value[h]=_}}catch{}}),Mn(),he(),W(),Wt(),Xn(),On("handleRichTextInput"),a&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const h=o.data||"";h&&h.length===1&&setTimeout(()=>ko(h),0),(h===" "||h===`
101
+ `||/[.,;:!?]/.test(h))&&setTimeout(()=>{Yn()},100)}de.value=!1})},G=()=>{if(!p.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r)return;const i=r.closest(".dss-image-wrapper");if(i){const d=i.querySelector("img");if(r!==d&&!d?.contains(r)){const u=l.startContainer.nodeType===3?l.startContainer.parentElement:l.startContainer,m=l.endContainer.nodeType===3?l.endContainer.parentElement:l.endContainer;if(i.contains(u)&&u!==d||i.contains(m)&&m!==d){const v=document.createRange();v.setStartAfter(i),v.collapse(!0),o.removeAllRanges(),o.addRange(v)}}}},St=()=>{if(!p.value)return;const o=p.value;if(o.querySelector&&o.querySelector("p"))return;const l=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(o.childNodes);let r=null;a.forEach(i=>{if(i.nodeType===Node.TEXT_NODE){if((i.textContent||"").trim()===""){i.parentNode===o&&o.removeChild(i);return}r||(r=document.createElement("p"),o.insertBefore(r,i)),r.appendChild(i);return}if(i.nodeType===Node.ELEMENT_NODE){const d=i,u=d.tagName;if(u==="BR"){r=null;return}if(l.has(u)){r=null;return}r||(r=document.createElement("p"),o.insertBefore(r,d)),r.appendChild(d)}})},he=()=>{if(p.value&&!ze.value){ze.value=!0;try{p.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),p.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const i=r.parentElement;!i||!i.classList.contains("dss-image-wrapper")?r.remove():i.querySelector("img")||r.remove()}),p.value.querySelectorAll("img").forEach(r=>{let i=r.getAttribute("alt");i===null&&(i=r.alt||"");const d=r.getAttribute("src")||r.src||"";if(i){const h=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),_=i===d||i===h;(i.startsWith("http://")||i.startsWith("https://")||i.startsWith("data:")||_||_)&&(i="")}r.setAttribute("alt",i),r.setAttribute("data-alt",i);const u=!i||i.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=pt,m.appendChild(h)}else if(v&&m.children.length===1){const h=m.parentNode;h.insertBefore(r,m),h.removeChild(m)}})}finally{ze.value=!1}}},Hl=o=>{Yn(),Le("blur",o),ol()},w=()=>{if(b.disabled||!b.richText||!p.value)return;At(),xe.value&&(clearTimeout(xe.value),xe.value=null),Ue.value&&(Ne(),Ue.value=!1);const o=U.value==="title",l=U.value==="description",a=U.value==="editor";if(qe.value.length===0){o&&V.value?V.value.focus():l&&P.value?P.value.focus():p.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{Se()});return}const r={content:p.value.innerHTML,title:b.title||"",description:b.description||""};ut.value.push(r);const i=qe.value.pop();if(i!==void 0){de.value=!0;const d=typeof i=="string"?i:i.content,u=typeof i=="object"&&i.title||"",m=typeof i=="object"&&i.description||"";p.value.innerHTML=d,X.value=d,j.value=u,ie.value=m,Z.value=d,E.value=u,C.value=m,e.nextTick(()=>{Mn(),Vn(),Nn(),Wt();const v=xn(d);Le("update:modelValue",v),Le("update:title",u),Le("update:description",m),Le("change",v),Le("title-change",u),Le("description-change",m),de.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(V.value){V.value.focus();const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),gn()}}else if(l){if(P.value){P.value.focus();const h=m.length;P.value.setSelectionRange(h,h)}}else if(a)rn();else if(V.value&&document.activeElement===V.value){const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),gn()}else if(P.value&&document.activeElement===P.value){const h=m.length;P.value.setSelectionRange(h,h)}else p.value&&rn()},10)})})}},y=()=>{if(b.disabled||!b.richText||!p.value)return;At();const o=U.value==="title",l=U.value==="description",a=U.value==="editor";if(ut.value.length===0){o&&V.value?V.value.focus():l&&P.value?P.value.focus():p.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{Se()});return}const r={content:p.value.innerHTML,title:b.title||"",description:b.description||""};qe.value.push(r);const i=ut.value.pop();if(i!==void 0){de.value=!0;const d=typeof i=="string"?i:i.content,u=typeof i=="object"&&i.title||"",m=typeof i=="object"&&i.description||"";p.value.innerHTML=d,X.value=d,j.value=u,ie.value=m,Z.value=d,E.value=u,C.value=m,e.nextTick(()=>{Mn(),Vn(),Nn(),Wt();const v=xn(d);Le("update:modelValue",v),Le("update:title",u),Le("update:description",m),Le("change",v),Le("title-change",u),Le("description-change",m),de.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(V.value){V.value.focus();const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),gn()}}else if(l){if(P.value){P.value.focus();const h=m.length;P.value.setSelectionRange(h,h)}}else if(a)rn();else if(V.value&&document.activeElement===V.value){const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),gn()}else if(P.value&&document.activeElement===P.value){const h=m.length;P.value.setSelectionRange(h,h)}else p.value&&rn()},10)})})}},B=()=>{if(!p.value)return;p.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const i=r.style.fontWeight;if(i==="normal"||i==="400"){const d=document.createDocumentFragment();for(;r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),p.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)}}),p.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},W=()=>{if(!p.value)return;p.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},se=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let a=!1;if(l.collapsed){const r=l.startContainer;let i=r.nodeType===3?r.parentElement:r;for(;i&&i!==p.value;){if(i.tagName==="EM"||i.tagName==="I"){a=!0;break}if(i.style&&i.style.fontStyle==="italic"){a=!0;break}i=i.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=i.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==p.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(()=>{W()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{W()});else try{const r=l.extractContents(),i=document.createElement("em");i.style.fontStyle="italic",i.appendChild(r),l.insertNode(i),l.setStartAfter(i),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{W()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{W()})}return!0},dt=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let a=!1;if(l.collapsed){const r=l.startContainer;let i=r.nodeType===3?r.parentElement:r;for(;i&&i!==p.value;){if(i.tagName==="STRONG"||i.tagName==="B"){a=!0;break}if(i.style&&parseInt(i.style.fontWeight)>=600){a=!0;break}i=i.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const i=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=i.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==p.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(()=>{B()}),!1;if(l.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0),d=i.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==p.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),i.setStart(v,0),i.collapse(!0),r.removeAllRanges(),r.addRange(i);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===p.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",i.insertNode(m),i.setStart(m,0),i.collapse(!0),r.removeAllRanges(),r.addRange(i)}}B()});else try{const r=l.extractContents(),i=document.createElement("b");i.style.fontWeight="600",i.appendChild(r),l.insertNode(i),l.setStartAfter(i),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{B()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{B()})}return!0},ot=(o,l=null)=>{if(b.disabled||!b.richText||!p.value)return;Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Ne(),Ue.value=!1):Ne(),At(),p.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&Qn(d)&&(r=yn())}if(o==="createLink"&&l){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(l);u.insertNode(v),u.selectNodeContents(v)}}}if(o==="bold"){const d=dt();Ze.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(Ge.value={command:"bold",state:d}),e.nextTick(()=>{r&&(et(r),e.nextTick(()=>{const m=Ht("bold");Ze.value.bold=m})),Se(),Vn(),Wt()});return}if(o==="italic"){const d=se();Ze.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(Ge.value={command:"italic",state:d}),e.nextTick(()=>{r&&(et(r),e.nextTick(()=>{const m=Ht("italic");Ze.value.italic=m})),Se(),W(),Vn(),Wt()});return}let i=!1;try{i=document.execCommand(o,!1,l)}catch{}e.nextTick(()=>{if(r&&et(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=Ht("bold");Ze.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=Ht("italic");Ze.value.italic=u});else{const u=document.queryCommandState(o);Ze.value[o]=u}else{const u=document.queryCommandState(o);Ze.value[o]=u}}catch{Ze.value.hasOwnProperty(o)?Ze.value[o]=!Ze.value[o]:Ze.value[o]=!0}if(o==="createLink"&&l){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",l)}p.value.querySelectorAll("a").forEach(v=>{const h=v.getAttribute("href");(!h||h===""||h==="#")&&v.setAttribute("href",l)})}Se(),Vn(),Wt()})},Ht=(o,l=null)=>{if(b.disabled||!p.value)return!1;try{if(o==="formatBlock"&&l){const r=document.queryCommandValue("formatBlock");if(l==="<blockquote>"){const i=r.toLowerCase();if(i==="blockquote"||i==="<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===l||r.toLowerCase()===l.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0);if(o==="bold"){let u=!1;if(i.collapsed){const m=i.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 Ze.value.hasOwnProperty(o)?Ze.value[o]:(Ze.value[o]=u,u)}else{const m=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let _;for(;_=h.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let N=_.parentElement;for(;N&&N!==p.value;){if(N.tagName==="STRONG"||N.tagName==="B"){u=!0;break}if(N.style&&parseInt(N.style.fontWeight)>=600){u=!0;break}N=N.parentElement}}else if(_.nodeType===1){const $=_;if($.tagName==="STRONG"||$.tagName==="B"){u=!0;break}if($.style&&parseInt($.style.fontWeight)>=600){u=!0;break}}if(u)break}}return Ze.value[o]=u&&v,u&&v}}if(o==="italic"){let u=!1;if(i.collapsed){const m=i.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 Ze.value.hasOwnProperty(o)?Ze.value[o]:(Ze.value[o]=u,u)}else{const m=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer:i.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let _;for(;_=h.nextNode();)if(!(typeof i.intersectsNode=="function"&&!i.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let N=_.parentElement;for(;N&&N!==p.value;){if(N.tagName==="EM"||N.tagName==="I"){u=!0;break}if(N.style&&N.style.fontStyle==="italic"){u=!0;break}N=N.parentElement}}else if(_.nodeType===1){const $=_;if($.tagName==="EM"||$.tagName==="I"){u=!0;break}if($.style&&$.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return Ze.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return i.collapsed&&Ze.value.hasOwnProperty(o)?Ze.value[o]:(Ze.value[o]=d,d)}return Ze.value.hasOwnProperty(o)?Ze.value[o]:!1}catch{return Ze.value.hasOwnProperty(o)?Ze.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},It=o=>{b.disabled||!b.richText||(ue.value=ue.value===o?null:o,o==="askAi"&&(at.value=null))},At=()=>{ue.value=null,We.value=null},En=o=>{ot("formatBlock",o),At()},Wl=o=>{if(!o||!p.value)return o;const l=Te=>{let me=Te.nodeType===Node.TEXT_NODE?Te.parentElement:Te;for(;me&&me!==p.value;){const ct=me.tagName;if(ct==="P"){const Qt=me.parentElement;if(Qt===p.value||Qt.tagName==="BLOCKQUOTE")return me}if(ct==="BLOCKQUOTE")break;me=me.parentElement}return null},a=l(o.startContainer),r=l(o.endContainer);if(!a||!r)return o;const i=[],d=document.createTreeWalker(p.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Te=>{const me=Te.tagName;if(me==="P"){const ct=Te.parentElement;if(ct===p.value||ct.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return me==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)i.push(u);const m=i.indexOf(a),v=i.indexOf(r);if(m===-1||v===-1)return o;const h=Math.min(m,v),_=Math.max(m,v),$=i.slice(h,_+1);if($.length===0)return o;const N=$[0],Q=$[$.length-1],Y=document.createRange();return Y.setStartBefore(N),Y.setEndAfter(Q),Y},ro=()=>{if(b.disabled||!b.richText||!p.value)return;Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Ne(),Ue.value=!1):Ne(),At(),p.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let l=o.getRangeAt(0);!l.collapsed&&Qn(l)&&(l=Wl(l),o.removeAllRanges(),o.addRange(l));let a=null;!l.collapsed&&Qn(l)&&(a=yn());const r=l.commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&p.value.contains(i))){if(i){const u=i.parentNode;Array.from(i.childNodes).forEach(v=>{if(v.nodeType===Node.ELEMENT_NODE)if(v.tagName==="P"||v.tagName==="DIV")u.insertBefore(v,i);else{const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),u.insertBefore(h,i)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),u.insertBefore(h,i)}}),i.remove()}}else if(l.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=l.extractContents();u.appendChild(m),l.insertNode(u);const v=[],h=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:N=>N.parentNode===u&&N.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let _;for(;_=h.nextNode();)v.push(_);if(v.forEach(N=>{const Q=document.createElement("p");N.parentNode.insertBefore(Q,N),Q.appendChild(N)}),u.querySelectorAll("p, div").forEach(N=>{N.textContent.trim()===""&&!N.querySelector("img")&&(N.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const N=document.createElement("p");N.innerHTML="<br>",u.appendChild(N)}}e.nextTick(()=>{a&&et(a),Nn(),Se(),Wt()})},io=()=>{if(!p.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||!p.value.contains(r))return;const i=_=>{if(!_)return!1;const $=_.textContent||"",Q=(_.innerHTML||"").trim();return $.trim()===""||Q===""||Q==="<br>"||Q==="<br/>"||Q==="<p></p>"||Q==="<p><br></p>"||Q==="<p><br/></p>"||Q==="<p> </p>"||Q==="<p><br> </p>"||Q==="<div></div>"||Q==="<div><br></div>"||Q==="<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)&&i(d)&&d.remove();r.lastChild;){const _=r.lastChild;if(_.nodeType===1&&_.tagName==="BR")_.remove();else if(_.nodeType===3)if((_.textContent||"").trim()==="")_.remove();else break;else break}if(r.children.length>0)for(let _=r.children.length-1;_>=0;_--){const $=r.children[_];if(($.tagName==="P"||$.tagName==="DIV")&&i($))$.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):p.value&&p.value.appendChild(v);const h=document.createRange();h.selectNodeContents(v),h.collapse(!0),o.removeAllRanges(),o.addRange(h),e.nextTick(()=>{Nn(),Se()})},Vn=()=>{if(!p.value){ve.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");ve.value=!!r}else ve.value=!1}catch{ve.value=!1}},co=()=>{if(!p.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),xt.value=yn();const l=window.getSelection();let a="";l.rangeCount>0&&(a=l.getRangeAt(0).toString()),Ie.value="",O.value=a,Tt.value="",we.value=null,De.value=!0,At(),e.nextTick(()=>{rt.value&&rt.value.focus()})},ql=()=>{if(!p.value)return;Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Ne(),Ue.value=!1):Ne();const o=window.getSelection();let l=null;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;l=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!l&&we.value&&(l=we.value),l&&l.parentNode){const a=document.createDocumentFragment();for(;l.firstChild;)a.appendChild(l.firstChild);if(l.parentNode.replaceChild(a,l),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)}we.value=null}else ot("unlink");ve.value=!1,At(),e.nextTick(()=>{Se(),Vn()})},uo=()=>{b.disabled||!b.richText||p.value&&(Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Ne(),Ue.value=!1):Ne(),At(),p.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Mn(),Se(),Wt()}))},el=()=>{b.disabled||!b.richText||p.value&&(Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Ne(),Ue.value=!1):Ne(),At(),p.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Mn(),Se(),Wt()}))},mo=o=>{const l=o.parentElement;if(!l||l.tagName!=="OL")return null;let a=0,r=o.previousElementSibling;for(;r;)r.tagName==="LI"&&a++,r=r.previousElementSibling;return a+1},Mn=()=>{if(!p.value)return;p.value.querySelectorAll("li > ol").forEach(l=>{const a=l.parentElement;if(a&&a.tagName==="LI"){const r=mo(a);r!==null&&Array.from(l.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},po=()=>{if(b.disabled||!b.richText||!p.value)return;At(),p.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{Mn(),Se()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const i=a.previousElementSibling;if(i&&i.tagName==="LI"){const d=r.tagName.toLowerCase();let u=i.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),i.appendChild(u));const m=mo(i);u.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),Mn();const v=document.createRange();v.selectNodeContents(a),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{Se(),Wt()})}else document.execCommand("indent",!1),e.nextTick(()=>{Mn(),Se(),Wt()})},fo=()=>{if(b.disabled||!b.richText||!p.value)return;At(),p.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{Mn(),Se()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const i=r.parentElement;if(i&&i.tagName==="LI"){const d=i.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){r.tagName==="OL"&&a.removeAttribute("data-parent-num"),d.insertBefore(a,i.nextSibling),r.children.length===0&&r.remove(),Mn();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{Se(),Wt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Mn(),Se(),Wt()})},mn=e.ref(null),zn=e.ref(null),ml=e.ref({}),Cn=e.ref(""),Gn=e.ref(null),tl=e.ref("");e.ref("");const nl=e.ref(null);e.ref("");const _n=e.ref([]),Ul=e.ref(!1),Bl=e.ref(!1),Eo=o=>{if(!o)return"";const l=o.cloneRange(),a=document.createElement("div");return a.appendChild(l.cloneContents()),a.innerHTML},Xl=()=>{if(b.disabled||!b.richText||!p.value)return;if(mn.value!==null){mn.value=null,Cn.value="",tl.value="",nl.value=null,_n.value=[],vl(!0);return}At(),p.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(l.collapsed||!Qn(l))return;tl.value=Eo(l)||"",nl.value=yn();const a=l.getBoundingClientRect(),r=p.value.parentElement;if(!r)return;const i=r.getBoundingClientRect(),d=a.bottom-i.top,m=Math.max(d+8,0);ml.value={top:`${m}px`,bottom:"auto"},mn.value=Date.now(),e.nextTick(()=>{if(Cn.value="",Gn.value){const h=Gn.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 _=r.getBoundingClientRect(),$=v.getBoundingClientRect(),N=h.getBoundingClientRect(),Q=$.bottom-_.top,Y=N.top-_.top,Te=8;if(Q>Y-Te){const me=N.height;ml.value={bottom:`${me+Te}px`,top:"auto"}}else ml.value={top:`${m}px`,bottom:"auto"}}}})},Al=()=>{if(!Cn.value.trim())return;const o=Cn.value.trim(),l=new Date,a={text:o,selectionText:tl.value,selectionRange:nl.value,commentId:mn.value,user:b.commentUser||null,createdAt:l.toISOString()};_n.value=[..._n.value,a],Le("comment-submitted",a),No(a),nl.value&&!Vo(nl.value)&&Yl(mn.value,nl.value),Cn.value="",e.nextTick(()=>{if(Gn.value){const r=Gn.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}On("sendComment")})},vo=(o,l)=>{if(!(!b.commentUser||!o.user||o.user.id!==b.commentUser.id)){if(_n.value=_n.value.filter((a,r)=>r!==l),mn.value!==null&&p.value){const a=String(mn.value),r=p.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&_n.value.length>0){const i=[],d=new Set;_n.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),i.push(u.user))}),i.length>0?r.setAttribute("data-comment-user",JSON.stringify(i[0])):r.removeAttribute("data-comment-user"),i.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(i[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(_n.value.length))}else r&&_n.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(Le("comment-deleted",{comment:o,index:l,commentId:mn.value}),b.comments&&Array.isArray(b.comments)){const a=b.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));Le("update:comments",a)}e.nextTick(()=>{On("deleteComment")})}},Vo=o=>{if(!o||!p.value)return!1;try{const l=go(o);if(!l)return!1;const a=l.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},go=o=>{if(!o||!p.value)return null;try{const l=document.createRange();if(o.type==="element"&&o.element)return p.value.contains(o.element)?(l.setStart(o.element,o.offset),l.collapse(!0),l):null;let a=0;const r=[p.value];let i=null,d=!1,u=!1;for(;!u&&(i=r.pop());)if(i.nodeType===3){const m=a+i.length;!d&&o.start>=a&&o.start<=m&&(l.setStart(i,o.start-a),d=!0),d&&o.end>=a&&o.end<=m&&(l.setEnd(i,o.end-a),u=!0),a=m}else{let m=i.childNodes.length;for(;m--;)r.push(i.childNodes[m])}return d?l:null}catch{return null}},Yl=(o,l)=>{if(!(!o||!l||!p.value))try{const a=go(l);if(!a||a.collapsed)return;const r=a.commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i){const m=i.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,_=a.endOffset,$=m.nodeType===3?m.parentNode:m,N=v.nodeType===3?v.parentNode:v;if($===N&&h===0&&_===(v.nodeType===3?v.length:N.childNodes.length)&&($.tagName==="P"||$.tagName==="DIV"||$.tagName==="H1"||$.tagName==="H2"||$.tagName==="H3"||$.tagName==="H4"||$.tagName==="H5"||$.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=p.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{On("wrapSelectionWithCommentMarker"),Se()})}catch{}},No=o=>{if(!o||!o.commentId)return;const l=Array.isArray(b.comments)?[...b.comments]:[],a=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let r=l.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(a)||d.conversation_id===a);const i={text:o.text,user:o.user,createdAt:o.createdAt,created_at:o.createdAt,updated_at:o.createdAt};if(r>=0){const d=l[r];if(d.conversation||(d.conversation=[]),d.conversation.push(i),d.updated_at=o.createdAt,!d.article_id&&l.length>0){const u=l.find(m=>m.article_id);u&&(d.article_id=u.article_id)}}else{const d=o.selectionRange,u=l.length>0&&l.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:[i],created_by_user:o.user,created_at:o.createdAt,updated_at:o.createdAt,status:"active"};l.push(m)}Ul.value=!0,Le("update:comments",l)},jl=(o,l=[])=>{if(b.disabled||!b.richText||!p.value)return;const a=p.value;let r=null;try{r=a.querySelector(o)}catch{return}if(!r)return;At(),a.focus();const i=document.createRange();i.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(i)),tl.value=r.innerHTML||"",nl.value=yn();const u=i.getBoundingClientRect(),m=a.parentElement;if(m){const _=m.getBoundingClientRect(),$=u.bottom-_.top,Q=Math.max($+8,0);ml.value={top:`${Q}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let h=[];if(v&&b.comments&&Array.isArray(b.comments)){const _=b.comments.find($=>String($.conversation_id)===String(v));if(_&&_.conversation&&Array.isArray(_.conversation)){const $=_.conversation.map(N=>({id:N.id||N.commentary_id,commentary_id:N.id||N.commentary_id,conversation_id:_.id||_.conversation_id,text:N.text,user:N.user,createdAt:N.created_at||N.createdAt,updated_at:N.updated_at||N.updatedAt}));h.push(...$)}}h.length===0&&Array.isArray(l)&&l.length>0&&(h=l.slice()),h.sort((_,$)=>{const N=Te=>{if(!Te)return 0;const me=new Date(Te).getTime();return isNaN(me)?0:me},Q=N(_.createdAt),Y=N($.createdAt);return Q===Y?0:Q-Y}),_n.value=h,vl(!0),mn.value=v||null,r&&(zn.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(Cn.value="",Gn.value){const _=Gn.value;_.style.height="auto",_.style.height=`${_.scrollHeight}px`,_.focus()}if(m){const _=m.querySelector(".dss-comment-overlay");if(_){const $=m.querySelector(".dss-text-editor-footer");if($){const N=m.getBoundingClientRect(),Q=_.getBoundingClientRect(),Y=$.getBoundingClientRect(),Te=Q.bottom-N.top,me=Y.top-N.top,ct=8;if(Te>me-ct){const Qt=Y.height;ml.value={bottom:`${Qt+ct}px`,top:"auto"}}}}}On("openCommentOverlayForSelector")})},pn=e.ref(null),I=e.ref(0),fn=o=>{if(!(b.disabled||!b.richText)){if(o.key==="Escape"){const l=window.getSelection();if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&p.value&&p.value.contains(i))){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&&i.contains(u)&&u.nextSibling?i.insertBefore(m,u.nextSibling):i.appendChild(m),setTimeout(()=>{io()},50);return}}}if(o.key.length===1||o.key==="Enter"){const l=window.getSelection();if(l&&l.rangeCount>0){const a=l.getRangeAt(0),r=a.commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i){const d=i.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(i!==u&&!u?.contains(i)){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),l.removeAllRanges(),l.addRange(h);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0);let r=null,i=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")?i=m:m.tagName==="IMG"&&(r=m,i=r.closest(".dss-image-wrapper"))),i||(i=u.closest(".dss-image-wrapper"),i&&(r=i.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")?i=m:m.tagName==="IMG"&&(r=m,i=r.closest(".dss-image-wrapper"))),i||(i=u.closest(".dss-image-wrapper"),i&&(r=i.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,i=r.closest(".dss-image-wrapper")):(r=d.querySelector("img"),r&&(i=r.closest(".dss-image-wrapper"))),i){const v=i.contains(u)||u===i,h=i.contains(m)||m===i,$=a.cloneContents().textContent?.trim()||"",N=i.textContent?.trim()||"";(!v||!h||$.length>N.length)&&(i=null,r=null)}}if(i){o.preventDefault(),o.stopPropagation();const d=i.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,i),i.remove();const m=document.createRange();m.setStartAfter(u),m.collapse(!0),l.removeAllRanges(),l.addRange(m),e.nextTick(()=>{Se()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?fo():po();return}if(o.key==="Enter"){const l=window.getSelection();if(l.rangeCount>0){const a=l.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 _=v.parentElement;return _&&_!==p.value?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!==p.value){o.preventDefault(),o.stopPropagation();let _=null;const $=a.startOffset;$<u.length&&(_=u.splitText($));const N=document.createElement("p");if(_?N.appendChild(_):N.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(N,h.nextSibling):h.parentNode.appendChild(N);const Q=document.createRange();_?Q.setStart(_,0):Q.setStart(N,0),Q.collapse(!0),l.removeAllRanges(),l.addRange(Q),e.nextTick(()=>{Se()});return}}}}const r=a.commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(i&&p.value&&p.value.contains(i))){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 Te=Y.textContent||"",ct=(Y.innerHTML||"").trim(),Qt=ct.replace(/<br\s*\/?>/gi,"").trim();return Te.trim()===""||ct===""||Qt===""||ct==="<br>"||ct==="<br/>"||ct==="<p></p>"||ct==="<p><br></p>"||ct==="<p><br/></p>"||ct==="<p> </p>"||ct==="<p><br> </p>"||ct==="<div></div>"||ct==="<div><br></div>"||ct==="<div><br/></div>"},v=i.lastChild,h=v&&v.nodeType===1&&v.tagName==="BR",_=a.startContainer,$=_.nodeType===3?_.parentElement:_,N=$===i||$&&$.parentElement===i;if(u&&m(u)||h&&N){o.preventDefault(),setTimeout(()=>{io()},50);return}}}}if(o.key===" "){const l=Date.now(),a=l-I.value;if(pn.value===" "&&a<300){const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0),d=i.commonAncestorContainer.nodeType===1?i.commonAncestorContainer.closest("li"):i.commonAncestorContainer.parentElement?.closest("li");if(d){const u=i.startContainer.textContent?.substring(0,i.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){o.preventDefault(),po();return}}}}pn.value=" ",I.value=l}else pn.value=o.key}},Pn=o=>{if(b.disabled||!b.richText)return;o.preventDefault();let l=o.clipboardData.getData("text/html"),a=o.clipboardData.getData("text/plain");l&&(l=l.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),Ne();const r=window.getSelection();let i=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),i=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const v=new DOMParser().parseFromString(u,"text/html");let h=p.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach($=>{if(h>0){const N=v.createElement("p");N.innerHTML=$.innerHTML,$.parentNode.replaceChild(N,$)}else h++}),i){const $=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],N=Array.from(v.body.children).filter(Q=>$.includes(Q.tagName));if(N.length===1){const Q=N[0].tagName,Y=i.tagName,Te=i.textContent.trim()===""&&!i.querySelector("img");let me=!1;if(["H1","H2","H3","H4","H5","H6"].includes(Y)?me=!0:Te||(Q===Y||Q==="P")&&(me=!0),me)return N[0].innerHTML.trim()}}return v.body.innerHTML.trim()};if(l){const u=d(l);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);Se()},cn=o=>{if(ue.value){const a=o.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&At()}if(ge.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),i=p.value&&a.closest(".dss-text-editor-content");!r&&!i&&ol()}if(at.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),i=a.closest(".dss-toolbar-dropdown");!r&&!i&&yo()}const l=o.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(We.value=null),!p.value||!l.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);wt.value=!r.collapsed&&Qn(r)}else wt.value=!1}if(mn.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 i=l.closest(".dss-toolbar-button"),d=i&&i.getAttribute("title")==="Comment";!r&&!d&&(mn.value=null,Cn.value="",tl.value="",nl.value=null,_n.value=[],vl(!0))}},Un=(o,l)=>{o&&o.stopPropagation&&o.stopPropagation(),ft.value&&(clearTimeout(ft.value),ft.value=null),We.value=l},zt=o=>{const l=o.relatedTarget;if(l){const a=l.closest(".dss-toolbar-dropdown-submenu"),r=l.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||r)return}ft.value&&clearTimeout(ft.value),ft.value=setTimeout(()=>{We.value=null,ft.value=null},150)},nn=o=>{We.value=null};let ll=0;const pl=o=>{if(!o)return;const l=Array.from(o.children);l.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")}),l.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 i=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(i||u){const m=`submenu-auto-${++ll}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let v=null;i?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(i,a.nextSibling),i.classList.add("dss-toolbar-dropdown-submenu"),v=i):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),v=d),v&&(v.setAttribute("data-submenu-id",m),v.setAttribute("data-processed","true"),i&&a.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(_=>{(_.tagName==="BUTTON"||_.tagName==="DIV")&&!_.classList.contains("dss-toolbar-dropdown-item")&&_.classList.add("dss-toolbar-dropdown-item")}))}})},Bt=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{pl(l),l.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(i=>{const d=i._subMenuHandlers;d&&(i.removeEventListener("mouseenter",d.enter),i.removeEventListener("mouseleave",d.leave));const u=v=>{const h=i.getAttribute("data-submenu-id");h&&Un(v,h)},m=zt;i.addEventListener("mouseenter",u),i.addEventListener("mouseleave",m),i._subMenuHandlers={enter:u,leave:m}}),l.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(i=>{const d=i._subMenuHandlers;d&&(i.removeEventListener("mouseenter",d.enter),i.removeEventListener("mouseleave",d.leave));const u=h=>{const _=i.getAttribute("data-submenu-id");_&&Un(h,_)},m=zt;i.addEventListener("mouseenter",u),i.addEventListener("mouseleave",m),i._subMenuHandlers={enter:u,leave:m},i.querySelectorAll(".dss-toolbar-dropdown-item").forEach(h=>{h.addEventListener("click",nn)})})})};let ht=null;const it=()=>{if(We.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${We.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${We.value}"]`);o&&l&&sl(o,l)}if(ge.value&&Wt(),b.richText){if(ht!==null)return;ht=setTimeout(()=>{ht=null,On("handleWindowResize")},150)}},Rt=()=>{if(!b.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(l=>{Array.from(l.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},So=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),l=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",l),a.addEventListener("mousedown",l),a.addEventListener("dragstart",l),a.addEventListener("contextmenu",l),a.addEventListener("click",r=>{if(window.getSelection){const i=window.getSelection();i.removeAllRanges&&i.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Ae.value?gn():ul(),re.value?dl():Nt()})}),e.nextTick(()=>{So()}),b.richText&&p.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",cn),window.addEventListener("resize",it);let o=null;const l=()=>{o===null&&(o=setTimeout(()=>{o=null,it()},150))};window.addEventListener("scroll",l,!0),p.value._windowScrollHandler=l,p.value._windowScrollTimeout=o,p.value.closest(".editor-with-comments"),p.value.closest(".dss-text-editor-content-wrapper");const a=p.value.closest(".dss-text-editor-content");let r=null;const i=()=>{r===null&&(r=setTimeout(()=>{r=null,it()},150))};a&&(a.addEventListener("scroll",i),p.value._scrollHandlers={wrapper:null,content:a,handler:i}),e.nextTick(()=>{Bt(),Rt()}),p.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!b.disabled&&m.preventDefault();const _=v.closest(".dss-image-no-alt-icon"),$=v.closest(".dss-image-wrapper");if(_||$&&v===$){m.preventDefault(),m.stopPropagation();const N=window.getSelection(),Q=document.createRange();Q.setStartAfter($),Q.collapse(!0),N.removeAllRanges(),N.addRange(Q)}else $&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const N=window.getSelection();if(N.rangeCount>0){const Y=N.getRangeAt(0).commonAncestorContainer,Te=Y.nodeType===3?Y.parentElement:Y;if($.contains(Te)&&Te!==$.querySelector("img")){const me=document.createRange();me.setStartAfter($),me.collapse(!0),N.removeAllRanges(),N.addRange(me)}}else{const Q=document.createRange();Q.setStartAfter($),Q.collapse(!0),N.addRange(Q)}}))},!0),p.value.addEventListener("mousedown",m=>{const v=m.target,h=v.closest(".dss-image-no-alt-icon"),_=v.closest(".dss-image-wrapper");if(h||_&&v.tagName!=="IMG"){m.preventDefault();const $=window.getSelection(),N=document.createRange();_&&(N.setStartAfter(_),N.collapse(!0),$.removeAllRanges(),$.addRange(N))}},!0),p.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!p.value)return;p.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 $=h.getAttribute("alt")||h.alt||"";if($){const N=h.getAttribute("src")||h.src||"",Q=N.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),Y=$===N||$===Q;($.startsWith("http://")||$.startsWith("https://")||$.startsWith("data:")||Y||Y)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),he()})}),p.value.addEventListener("dragstart",m=>{const v=m.target,h=v.tagName==="IMG"?v:v.closest("img"),_=h?.closest(".dss-image-wrapper");h&&p.value.contains(h)&&(Re.value=_||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),p.value.addEventListener("dragover",m=>{Re.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),p.value.addEventListener("dragenter",m=>{Re.value&&(m.preventDefault(),m.stopPropagation())}),p.value.addEventListener("drop",m=>{if(!Re.value||!p.value)return;m.preventDefault(),m.stopPropagation();const v=Re.value,h=v.classList?.contains("dss-image-wrapper"),_=h?v.querySelector("img"):v,$=h?v:_?.closest(".dss-image-wrapper");if(!_||!p.value.contains(_)){Re.value=null;return}let N=null;const Q=m.clientX,Y=m.clientY;if(document.caretRangeFromPoint)N=document.caretRangeFromPoint(Q,Y);else{const Ut=window.getSelection();Ut.rangeCount>0?N=Ut.getRangeAt(0).cloneRange():(N=document.createRange(),N.selectNodeContents(p.value),N.collapse(!1))}if(!N){Re.value=null;return}const Te=N.commonAncestorContainer,me=Te.nodeType===3?Te.parentElement:Te;if(me?.closest(".dss-image-wrapper")===$||$&&$.contains(me)){Re.value=null;return}if($&&(me===$||$.contains(me))){Re.value=null;return}const Qt=_.getAttribute("src");let Jt=null;$?Jt=$.cloneNode(!0):Jt=_.cloneNode(!0);try{let Ut=N.startContainer;if(Ut.nodeType===3&&(Ut=Ut.parentElement),$&&(Ut===$||$.contains(Ut))){const jt=document.createRange();jt.setStartAfter($),jt.collapse(!0),N=jt}N.insertNode(Jt);const Pt=document.createRange();Pt.setStartAfter(Jt),Pt.collapse(!0);const en=window.getSelection();en.removeAllRanges(),en.addRange(Pt)}catch{if(p.value.childNodes.length===0){const Pt=document.createElement("p");Pt.appendChild(Jt),p.value.appendChild(Pt)}else{const Pt=p.value.lastChild;if(Pt&&Pt.nodeType===1)Pt.appendChild(Jt);else{const en=document.createElement("p");en.appendChild(Jt),p.value.appendChild(en)}}}$?$.remove():_.remove(),Re.value=null,e.nextTick(()=>{const Ut=p.value.querySelectorAll("img");let Pt=!1;Ut.forEach(en=>{if(en.getAttribute("src")===Qt)if(!Pt)Pt=!0;else{const jt=en.closest(".dss-image-wrapper");jt?jt.remove():en.remove()}}),he(),Se()})}),p.value.addEventListener("dragend",m=>{Re.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 _=h.querySelectorAll&&h.querySelectorAll("img");_&&_.forEach($=>{$.removeAttribute("alt"),$.removeAttribute("data-alt"),$.setAttribute("alt",""),$.setAttribute("data-alt",""),$.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{he(),Rt(),d=null},100)});if(u.observe(p.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{Rt()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),b.modelValue){const m=In(b.modelValue);p.value.innerHTML=m,St()}e.nextTick(()=>{const m=p.value.innerHTML||"",v=b.title||"",h=b.description||"";X.value=m,j.value=v,ie.value=h,E.value=v,C.value=h,Mn(),he(),W(),Xn(),no(),Ql()}),Vn(),Nn(),p.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",cn),window.removeEventListener("resize",it),p.value&&p.value._windowScrollHandler&&window.removeEventListener("scroll",p.value._windowScrollHandler,!0),ht!==null&&(clearTimeout(ht),ht=null),p.value&&p.value._windowScrollTimeout!==null&&clearTimeout(p.value._windowScrollTimeout),xe.value&&clearTimeout(xe.value),ft.value&&clearTimeout(ft.value),p.value&&p.value._mutationObserver&&p.value._mutationObserver.disconnect(),Je.value&&Je.value.disconnect(),vn.value!==null&&(cancelAnimationFrame(vn.value),vn.value=null),Yt.value!==null&&(clearTimeout(Yt.value),Yt.value=null),Zt.value!==null&&(clearTimeout(Zt.value),Zt.value=null),vl(!0),p.value&&p.value._scrollHandlers){const{wrapper:l,content:a,handler:r}=p.value._scrollHandlers;l&&l.removeEventListener("scroll",r),a&&a.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const ho=o=>{const l=o.target,a=l.closest("a");if(a&&!b.disabled){o.preventDefault();const i=document.createRange();i.selectNodeContents(a);const d=window.getSelection();d.removeAllRanges(),d.addRange(i)}const r=l.closest(".dss-image-wrapper");r&&l.tagName!=="IMG"?e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const u=i.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),i.removeAllRanges(),i.addRange(v)}}he(),Vn(),Nn(),Wt(),Xn()}):e.nextTick(()=>{he(),Vn(),Nn(),Wt(),Xn()})},yl=()=>{G();const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0);wt.value=!a.collapsed&&Qn(a),!a.collapsed&&Ge.value&&(Ge.value=null)}else wt.value=!1;if(he(),Vn(),Nn(),Wt(),Xn(),o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,i=r.nodeType===3?r.parentElement:r;if(i&&i.closest(".dss-text-editor-footer")){o.removeAllRanges(),wt.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const r=window.getSelection();if(r.rangeCount>0){const i=r.getRangeAt(0);if(!i.collapsed)if(a==="bold"){const d=i.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{}Ze.value[a]=m}else{const d=document.queryCommandState(a);Ze.value[a]=d}}}catch{}})},Xn=()=>{if(!b.richText||b.disabled||!p.value){tt.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){tt.value="p";return}const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!p.value.contains(r)){tt.value="p";return}const i=r.closest("h1, h2, h3, h4, h5, h6, p");if(!i){tt.value="p";return}const d=i.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?tt.value=d:tt.value="p"}catch{tt.value="p"}},Nn=()=>{if(!p.value){mt.value=!1;return}try{const o=window.getSelection();let l=!1;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,i=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");l=!!(i&&p.value.contains(i))}mt.value=l}catch{mt.value=!1}},Qn=o=>{if(!o||!p.value)return!1;const l=o.commonAncestorContainer;if(!l)return!1;const a=l.nodeType===3?l.parentElement:l;return a?p.value.contains(a):!1},ol=()=>{ge.value=!1},Wt=()=>{if(!b.floatingToolbar||!b.richText||b.disabled){ge.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){ge.value=!1;return}const l=o.getRangeAt(0);if(l.collapsed||!Qn(l)){ge.value=!1;return}const a=l.getBoundingClientRect();if(!a||a.width===0&&a.height===0){ge.value=!1;return}const r=p.value;if(!r){ge.value=!1;return}const i=r.getBoundingClientRect();if(!i||i.width===0){ge.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 _=0;Vt.value&&(_=Vt.value.getBoundingClientRect().width);const $=(_||320)/2;let N=i.left+$,Q=i.right-$;if(Q<N){const Y=i.left+i.width/2;N=Y,Q=Y}if(h>0){const Y=$+u,Te=h-$-u;if(N=Math.max(N,Y),Q=Math.min(Q,Te),Q<N){const me=h/2;N=me,Q=me}}v<N?v=N:v>Q&&(v=Q),yt.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},ge.value=!0},Kl=o=>{b.disabled||!b.richText||(at.value=at.value===o?null:o,o==="askAi"&&(ue.value=null))},yo=()=>{at.value=null,We.value=null},$n=o=>{En(o),yo()};let al=null,Sn=null,fl=null,Cl=null;const Ml=o=>{if(b.disabled||!b.richText){kl(),bl();return}const l=o.target,a=l.closest("a"),r=l.closest("img");if(al&&(clearTimeout(al),al=null),fl&&(clearTimeout(fl),fl=null),a&&a!==Sn){bl(),Sn=a;let i=a.getAttribute("href")||"";(!i||i==="#"||i==="")&&(i=a.textContent||""),we.value=a,S.value=i,ee.value=!0,He.value=!0,Co(a)}else!a&&Sn?(Sn=null,al=setTimeout(()=>{He.value||kl()},150)):a&&a===Sn&&Co(a);if(r&&r!==Cl){kl(),Cl=r;let i=r.getAttribute("alt");i===null&&(i=r.alt||"");let d=r.getAttribute("data-alt");d===null&&(d=i),r.hasAttribute("alt")||r.setAttribute("alt",i),r.hasAttribute("data-alt")||r.setAttribute("data-alt",d),Xe.value=r,Ct.value=i.trim()||A("textEditor.image.noAlt"),Xt.value=!0,$e.value=!0,Gl(r)}else!r&&Cl?(Cl=null,fl=setTimeout(()=>{$e.value||bl()},150)):r&&r===Cl&&Gl(r)},Bo=o=>{const l=o.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(Sn=null,Cl=null,al&&(clearTimeout(al),al=null),fl&&(clearTimeout(fl),fl=null),kl(),bl())},kl=()=>{He.value=!1,setTimeout(()=>{He.value||(ee.value=!1,S.value="",De.value||(we.value=null))},100)},Co=o=>{if(!o||!p.value)return;const l=o.getBoundingClientRect(),i=l.top-32-8,d=l.left+l.width/2;ne.value={position:"fixed",top:`${i}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},bl=()=>{$e.value=!1,setTimeout(()=>{$e.value||(Xt.value=!1,Ct.value="",_t.value||(Xe.value=null))},100)},Gl=o=>{if(!o||!p.value)return;const l=o.getBoundingClientRect(),i=l.top-32-8,d=l.left+l.width/2;te.value={position:"fixed",top:`${i}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Mo=()=>{if(!S.value||!we.value)return;let l=we.value.getAttribute("href")||S.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},_o=()=>{if(we.value){const o=we.value.textContent||"",l=we.value.getAttribute("href")||"",a=we.value;Ie.value=l,O.value=o,Tt.value=o,He.value=!1,ee.value=!1,S.value="",we.value=a,De.value=!0}else if(ve.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 i=r.textContent||"",d=r.getAttribute("href")||"";Ie.value=d,O.value=i,Tt.value=i,we.value=r,De.value=!0}}}else{xt.value=yn();const o=window.getSelection();let l="";o.rangeCount>0&&(l=o.getRangeAt(0).toString()),Ie.value="",O.value=l,Tt.value="",we.value=null,De.value=!0}e.nextTick(()=>{rt.value&&(rt.value.focus(),rt.value.select())})},Dn=()=>{De.value=!1,Ie.value="",O.value="",Tt.value="",we.value=null,xt.value=null},Jn=()=>{if(!Ie.value.trim()){Dn();return}if(Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Ne(),Ue.value=!1):Ne(),O.value.trim()||(O.value=Ie.value.trim()),we.value&&p.value&&p.value.contains(we.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const l=we.value;if(l.setAttribute("href",Ie.value.trim()),O.value.trim()!==Tt.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=O.value.trim()}l.style.color="#60afdf",l.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(l),a.collapse(!1),o.removeAllRanges(),o.addRange(a),Se()}else if(p.value){p.value.focus();const o=window.getSelection();o.removeAllRanges(),xt.value&&et(xt.value);let l=null;if(o.rangeCount>0&&(l=o.getRangeAt(0)),l&&!l.collapsed){l.toString();const a=document.createElement("a");a.href=Ie.value.trim(),a.textContent=O.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",l.deleteContents(),l.insertNode(a);const r=document.createTextNode(" ");l.setStartAfter(a),l.insertNode(r),l.setStartAfter(r),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}else{l||(l=document.createRange(),l.selectNodeContents(p.value),l.collapse(!1));const a=l.startContainer,r=a.nodeType===3,i=r&&l.startOffset===a.textContent.length,d=document.createElement("a");if(d.href=Ie.value.trim(),d.textContent=O.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",i){let u=a.parentElement;for(;u&&u!==p.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==p.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(l.startOffset>0){const h=a.textContent.substring(0,l.startOffset),_=h[h.length-1];if(_&&_!==" "&&_!==" "&&_!==`
102
102
  `){const $=document.createTextNode(" ");l.insertNode($),l.setStartAfter($)}}l.insertNode(d);const v=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(v),l.setStartAfter(v),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}}else{if(r&&l.startOffset>0){const m=a.textContent.substring(0,l.startOffset),v=m[m.length-1];if(v&&v!==" "&&v!==" "&&v!==`
103
- `){const h=document.createTextNode(" ");l.insertNode(h),l.setStartAfter(h)}}l.insertNode(d);const u=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(u),l.setStartAfter(u),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}Z()}e.nextTick(()=>{wn(),Un()})},zt=()=>{if(!p.value||de.value)return;const o=window.getSelection();let l=null;o&&o.rangeCount>0&&(l=Ge());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(p.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 _=[...h.matchAll(a)];if(_.length===0)continue;const $=_.filter(j=>{const $e=j[0],me=j.index;if(me>0&&h[me-1]==="@"||me+$e.length<h.length&&h[me+$e.length]==="@")return!1;const it=v.parentElement;return!(it&&it.closest("a"))});if($.length===0)continue;if($.length===1&&$[0][0]===h.trim()){const j=$[0][0],$e=j.startsWith("http://")||j.startsWith("https://")?j:`https://${j}`,me=document.createElement("a");me.href=$e,me.textContent=j,me.style.color="#60afdf",me.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(me,v),u=!0);continue}let N=0;const Q=document.createDocumentFragment();if($.forEach(j=>{const $e=j.index,me=j[0];if($e>N){const Jt=h.substring(N,$e);Jt&&Q.appendChild(document.createTextNode(Jt))}const it=me.startsWith("http://")||me.startsWith("https://")?me:`https://${me}`,ln=document.createElement("a");ln.href=it,ln.textContent=me,ln.style.color="#60afdf",ln.style.textDecoration="underline",Q.appendChild(ln),N=$e+me.length}),N<h.length){const j=h.substring(N);j&&Q.appendChild(document.createTextNode(j))}v.parentNode&&Q.childNodes.length>0&&(v.parentNode.replaceChild(Q,v),u=!0)}u&&l&&e.nextTick(()=>{jt(l),wn()})},To=()=>{if(!p.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,l=document.createTreeWalker(p.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=l.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(_=>{const $=_.index,N=_[0].startsWith("<u>")?"u":"ins",Q=_[1]||_[2]||"";$>v&&h.appendChild(document.createTextNode(u.substring(v,$)));const j=document.createElement(N);j.textContent=Q,h.appendChild(j),v=$+_[0].length}),v<u.length&&h.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&h.childNodes.length>0&&d.parentNode.replaceChild(h,d)}},Zt=o=>{if(!p.value||de.value)return;if(!o){To();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===p.value||!p.value.contains(c))return;const d=()=>{let Jt="",Rt=0,en=!1;const tn=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:jn=>jn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let qt=0;for(;tn.nextNode();){const jn=tn.currentNode,hn=jn.textContent||"",Kn=qt;if(qt+=hn.length,jn===r.startContainer){Jt+=hn.substring(0,r.startOffset),Rt=Kn+r.startOffset,en=!0;break}Jt+=hn}return en||(Rt=Jt.length),{textBeforeCursor:Jt,cursorCharOffset:Rt}},{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[1],$=u.length-h.length,Q=(Jt=>{let Rt=0;const en=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:qt=>qt.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let tn;for(;tn=en.nextNode();){const qt=(tn.textContent||"").length;if(Rt+qt>=Jt)return{node:tn,offset:Jt-Rt};Rt+=qt}return null})($);if(!Q)return;const j=document.createRange();j.setStart(Q.node,Q.offset),j.setEnd(r.endContainer,r.endOffset);const $e=document.createElement(v);$e.textContent=_,j.deleteContents(),j.insertNode($e);const me=window.getSelection(),it=document.createRange();it.setStartAfter($e),it.collapse(!0),me.removeAllRanges(),me.addRange(it);const ln=Ge();e.nextTick(()=>{Z(),ln&&jt(ln)})},Qt=()=>{p.value&&(Yt.value=Ge(),Wt.value="",xt.value="",Se.value="",et.value="",Ye.value="",on.value=null,Ue.value=null,fe.value="upload",St.value=!0,Dt(),e.nextTick(()=>{Ft.value&&Ft.value.focus(),$t.value&&($t.value.value="")}))},ho=o=>{const l=o.target?.files?.[0];if(!l){on.value=null,xt.value="";return}on.value=l;const a=new FileReader;a.onload=r=>{xt.value=r.target?.result||""},a.readAsDataURL(l)},Lo=()=>{$t.value&&$t.value.click()},Pl=()=>{et.value&&(Ye.value="")},yo=()=>{Ye.value&&(et.value="")},Co=()=>{let o=Ue.value;if(!o){const l=window.getSelection();if(l&&l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(o){const l=o.getAttribute("data-alt")||o.getAttribute("alt")||"";Ue.value=o,Wt.value=l.trim()===""||l.trim()==="Image"?"":l;const a=o.getAttribute("src")||o.src||"";a.startsWith("http://")||a.startsWith("https://")?(Se.value=a,xt.value="",fe.value="url"):(xt.value=a,Se.value="",fe.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";et.value=c.endsWith("px")?c.replace("px",""):c,Ye.value=d.endsWith("px")?d.replace("px",""):d,Yt.value=null}else{Qt();return}St.value=!0,_e.value=!1,Ut.value=!1,e.nextTick(()=>{fe.value==="url"&&Bt.value?(Bt.value.focus(),Bt.value.select()):Ft.value&&(Ft.value.focus(),Ft.value.select()),$t.value&&($t.value.value="")})},Lt=()=>{St.value=!1,Wt.value="",xt.value="",Se.value="",et.value="",Ye.value="",on.value=null,Ue.value=null,Yt.value=null,fe.value="upload"},dl=()=>{const o=(Wt.value||"").trim(),l=p.value?._mutationObserver;l&&l.disconnect(),Qe.value?(Ee.value&&(clearTimeout(Ee.value),Ee.value=null),We(),Qe.value=!1):We();const a=fe.value==="url"?Se.value.trim():xt.value;if(Ue.value&&p.value&&p.value.contains(Ue.value)){a&&(Ue.value.src=a),Ue.value.setAttribute("alt",o),Ue.value.setAttribute("data-alt",o),et.value?(Ue.value.style.width=`${et.value}px`,Ue.value.setAttribute("width",et.value)):(Ue.value.style.removeProperty("width"),Ue.value.removeAttribute("width")),Ye.value?(Ue.value.style.height=`${Ye.value}px`,Ue.value.setAttribute("height",Ye.value)):(Ue.value.style.removeProperty("height"),Ue.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(Ue.value),c.collapse(!0),r.addRange(c)}Z()}else{if(!a){l&&p.value&&l.observe(p.value,{childList:!0,subtree:!0}),Lt();return}if(p.value){p.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(Yt.value&&(jt(Yt.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&p.value){if(d=document.createRange(),p.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",p.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(p.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){Lt();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!p.value.contains(m)){if(d=document.createRange(),p.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",p.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(p.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),et.value&&(v.style.width=`${et.value}px`,v.setAttribute("width",et.value)),Ye.value&&(v.style.height=`${Ye.value}px`,v.setAttribute("height",Ye.value));try{d.insertNode(v),d.setStartAfter(v),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(p.value){if(p.value.childNodes.length===0){const $=document.createElement("p");p.value.appendChild($),$.appendChild(v)}else{const $=p.value.lastChild;if($&&$.nodeType===1)$.appendChild(v);else{const N=document.createElement("p");p.value.appendChild(N),N.appendChild(v)}}const _=document.createRange();_.setStartAfter(v),_.collapse(!0),c&&(c.removeAllRanges(),c.addRange(_))}}Ue.value=v,Z()}}e.nextTick(()=>{l&&p.value&&l.observe(p.value,{childList:!0,subtree:!0}),wn(),Ot(),Lt()})};e.watch(()=>b.modelValue,o=>{if(b.richText&&p.value&&!de.value){const l=Pn(o||""),r=p.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=l.replace(/&nbsp;|\u00A0/g," ");if(r!==c){const d=Ge();p.value.innerHTML=l,e.nextTick(()=>{he();const u=p.value.innerHTML||"",m=b.title||"",v=b.description||"";q.value=u,K.value=m,ie.value=v,U.value=u,x.value=m,C.value=v,Ze.value=[],ut.value=[],Ee.value&&(clearTimeout(Ee.value),Ee.value=null),Qe.value=!1,d&&jt(d),Sn(),Mn(),W(),wn(),Ot(),En(),Rn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>b.richText,o=>{o?(Ot(),e.nextTick(()=>{ml()})):(Ml(),vt.value=[],Ke.value&&(Ke.value.disconnect(),Ke.value=null)),En()}),e.watch(()=>b.floatingToolbar,o=>{o?Ot():Ml()}),e.watch(()=>b.disabled,o=>{o&&Ml(),En()}),e.watch(()=>b.description,()=>{e.nextTick(()=>{oe.value?fl():Ce()})}),e.watch(()=>b.title,()=>{e.nextTick(()=>{He.value?kn():ol()})}),e.watch(()=>b.customToolbarSlots,()=>{e.nextTick(()=>{Il()})},{deep:!0}),e.watch(()=>b.comments,(o,l)=>{if(Gl.value){Gl.value=!1;return}Sl.value||b.richText&&p.value&&e.nextTick(()=>{$l()})},{deep:!0,immediate:!1});const $l=()=>{if(!Sl.value&&!(!b.comments||!Array.isArray(b.comments)||b.comments.length===0)&&!(!b.richText||!p.value)){Sl.value=!0;try{const o=new Set,l=b.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),a=p.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;l.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=p.value.querySelector(`[data-comment="${v}"]`);if(h){Zl(h,u),d.add(v);return}try{const _=bo(u.selection_range,u.selection_text);if(_&&!_.collapsed){const $=_.commonAncestorContainer,N=$.nodeType===3?$.parentElement:$;if(N){const $e=N.closest("[data-comment], [data-fake-comment]");if($e){const me=$e.getAttribute("data-comment")||$e.getAttribute("data-fake-comment");if(String(me)===String(m)){$e.setAttribute("data-comment",v),$e.removeAttribute("data-fake-comment"),Zl($e,u),d.add(v);return}else return}}const Q=p.value.querySelector(`[data-comment="${v}"]`);if(Q){Zl(Q,u),d.add(v);return}const j=document.createElement("span");j.setAttribute("data-comment",v),Zl(j,u);try{_.surroundContents(j),c++,d.add(v)}catch{try{const me=document.createRange();me.setStart(_.startContainer,_.startOffset),me.setEnd(_.endContainer,_.endOffset),Ol(me),me.surroundContents(j),c++,d.add(v)}catch{try{const it=_.extractContents();j.appendChild(it),_.insertNode(j),c++,d.add(v)}catch(it){console.warn("Failed to create comment marker:",it)}}}}}catch{}}),e.nextTick(()=>{Rn("restoreCommentsFromModel"),Z(),Sl.value=!1})}catch{Sl.value=!1}}},Ol=o=>{if(!o||!p.value)return o;try{const l=["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&&l.includes(u.tagName)&&(r===0&&!to(a)||o.setStartBefore(u))}else a.nodeType===1&&l.includes(a.tagName)&&r>0&&o.setStartBefore(a);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&l.includes(u.tagName)&&(d===c.length&&!ko(c)||o.setEndAfter(u))}else c.nodeType===1&&l.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},to=o=>{let l=o.previousSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.previousSibling}return!1},ko=o=>{let l=o.nextSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.nextSibling}return!1},bo=(o,l)=>{if(!o||!p.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=[p.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?Ol(a):null}}catch{return null}return null},Zl=(o,l)=>{if(!o||!l)return;const a=l.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")},Rn=(o="unknown")=>{if(!b.richText||!p.value){vt.value=[];return}Date.now()-cn.value<yn&&Ht.value!==null||Ht.value===null&&(Ht.value=requestAnimationFrame(()=>{if(Ht.value=null,cn.value=Date.now(),Tn.value)return;Tn.value=!0;const a={},r=p.value;if(!r){Tn.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){Tn.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(N=>{const Q=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");Q&&N.tagName==="SPAN"&&(m.has(Q)||(u.push(N),m.add(Q)))}),d.forEach(N=>{const Q=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");!Q||m.has(Q)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(N.tagName)?N.querySelector(`span[data-comment="${Q}"], span[data-fake-comment="${Q}"]`)||(u.push(N),m.add(Q)):N.tagName!=="SPAN"&&(u.push(N),m.add(Q)))});const v=c.getBoundingClientRect(),h=r.getBoundingClientRect();u.forEach((N,Q)=>{let j=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");if(!j)return;if(typeof j=="string"&&j.startsWith("comment-")){const Qn=N.textContent?.trim(),ll=b.comments?.find(In=>(typeof In.conversation_id=="string"&&In.conversation_id.startsWith("comment-")?null:In.conversation_id)&&In.selection_text?.trim()===Qn);ll?(j=String(ll.conversation_id),N.setAttribute("data-comment",j),N.removeAttribute("data-fake-comment")):(j=String(Date.now()),N.setAttribute("data-comment",j),N.removeAttribute("data-fake-comment"))}const $e=N.getBoundingClientRect(),me=window.getComputedStyle(N),it=parseFloat(me.lineHeight)||parseFloat(me.fontSize)*1.2,Rt=$e.top-h.top+it/2-15,tn=h.top-v.top+Rt;let qt=null,jn=null,hn=0;const Kn=[],Ll=new Set;if(j&&b.comments){const Qn=b.comments.find(ll=>String(ll.conversation_id||ll.id)===String(j));if(Qn){const ll=Qn.conversation||[];ll.length>0?(ll.forEach(In=>{In.user&&In.user.id&&!Ll.has(In.user.id)&&(Ll.add(In.user.id),Kn.push(In.user))}),hn=ll.length):(hn=0,qt=null,jn=null),Kn.length>0?qt=Kn[0]:qt=null,Kn.length>1?jn=Kn[1]:jn=null}}const Fn=$e.top+it/2-15,Hl=Fn+30,xl=5,Ct=Hl>h.top+xl&&Fn<h.bottom-xl?1:0;vt.value.find(Qn=>Qn.id===j);let El=N;if(!El&&j&&p.value){const Qn=String(j);El=p.value.querySelector(`[data-comment="${Qn}"], [data-fake-comment="${Qn}"]`)}const Gn=Kn.length;a[j]?(a[j].top=tn,a[j].opacity=Ct,a[j].element=El,a[j].firstUser=qt,a[j].secondUser=jn,a[j].totalCount=hn,a[j].uniqueUserCount=Gn):a[j]={id:j,top:tn,opacity:Ct,element:El,firstUser:qt,secondUser:jn,totalCount:hn,uniqueUserCount:Gn}});const _=Object.values(a).map(N=>{const Q=Math.max(0,(N.uniqueUserCount??0)-2);if(!N.element&&N.id&&p.value){const $e=String(N.id);N.element=p.value.querySelector(`[data-comment="${$e}"], [data-fake-comment="${$e}"]`)}return{...N,firstUser:N.firstUser||null,secondUser:N.secondUser||null,totalCount:N.totalCount,additionalCount:Q}});(vt.value.length!==_.length||_.some((N,Q)=>{const j=vt.value[Q];if(!j)return!0;const $e=(j.firstUser?.id||null)!==(N.firstUser?.id||null),me=(j.secondUser?.id||null)!==(N.secondUser?.id||null);return j.id!==N.id||Math.abs(j.top-N.top)>1||j.opacity!==N.opacity||j.totalCount!==N.totalCount||j.additionalCount!==N.additionalCount||$e||me||j.element!==N.element}))&&(vt.value=_),Tn.value=!1}))},Ho=o=>{if(!o)return;let l=o.element;if(!l&&o.id&&p.value){const a=String(o.id);l=p.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}l&&(Yn(),Jn.value=l,l.classList.add("editor-comment-highlighted"))},Yn=(o=!1)=>{!o&&Kt.value!==null&&Jn.value&&(Jn.value.getAttribute("data-comment")||Jn.value.getAttribute("data-fake-comment"))===Kt.value||(p.value&&p.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Jn.value&&(Jn.value.classList.remove("editor-comment-highlighted"),Jn.value=null))},Tl=o=>{if(!o||!o.element)return;Yn(!0);const l=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!l)return;const a=`[data-comment="${l}"], [data-fake-comment="${l}"]`;Te("comment-marker-clicked",{commentId:l,selector:a,element:o.element})},wo=()=>{Yn()},ml=()=>{!b.richText||!p.value||(Ke.value&&Ke.value.disconnect(),an.value!==null&&(clearTimeout(an.value),an.value=null),Ke.value=new MutationObserver(()=>{an.value===null&&(an.value=setTimeout(()=>{an.value=null,e.nextTick(()=>{Rn("MutationObserver")})},200))}),Ke.value.observe(p.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Rn("setupCommentMarkersObserver-initial"))},xo=(o,l)=>{if(!o||!l)return;const a=l.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(()=>Pe.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(()=>{xo(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(()=>[ue.value,st.value],()=>{ue.value==="askAi"||st.value==="askAi"?e.nextTick(()=>{Nt()}):(Pe.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(l=>{if(l.parentNode===document.body){const a=l.getAttribute("data-submenu-id");if(a){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(r)if(l.dataset.originalParentRef==="inside")r.appendChild(l);else{const d=r.closest(".dss-toolbar-dropdown");d&&d.insertBefore(l,r.nextSibling)}}}})}))}),e.watch(()=>b.locale,o=>{o&&o!==Me.value&&(Me.value=o)},{immediate:!0}),ke({openCommentOverlayForSelector:xn,updateCommentMarkers:Rn,restoreCommentsFromModel:$l}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",un.value]),style:e.normalizeStyle(zn.value)},[R.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Wc,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:w,title:e.unref(D)("textEditor.toolbar.undo")},[...l[45]||(l[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,qc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!A.value}]),onClick:y,title:e.unref(D)("textEditor.toolbar.redo")},[...l[46]||(l[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,Uc),l[73]||(l[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Xc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=a=>mn("paragraph")),title:e.unref(D)("textEditor.toolbar.paragraphFormat")},[je.value==="h1"?(e.openBlock(),e.createElementBlock("svg",jc,[...l[47]||(l[47]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):je.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Kc,[...l[48]||(l[48]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):je.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Gc,[...l[49]||(l[49]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):je.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Qc,[...l[50]||(l[50]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):je.value==="h5"?(e.openBlock(),e.createElementBlock("svg",Jc,[...l[51]||(l[51]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):je.value==="h6"?(e.openBlock(),e.createElementBlock("svg",eu,[...l[52]||(l[52]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",tu,[...l[53]||(l[53]=[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)])])),l[54]||(l[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Yc),ue.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[8]||(l[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[1]||(l[1]=a=>bn("<h1>"))},[l[55]||(l[55]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"})],-1)),e.createElementVNode("h1",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[2]||(l[2]=a=>bn("<h2>"))},[l[56]||(l[56]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"})],-1)),e.createElementVNode("h2",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[3]||(l[3]=a=>bn("<h3>"))},[l[57]||(l[57]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"})],-1)),e.createElementVNode("h3",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[4]||(l[4]=a=>bn("<h4>"))},[l[58]||(l[58]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"})],-1)),e.createElementVNode("h4",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[5]||(l[5]=a=>bn("<h5>"))},[l[59]||(l[59]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"})],-1)),e.createElementVNode("h5",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[6]||(l[6]=a=>bn("<h6>"))},[l[60]||(l[60]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"})],-1)),e.createElementVNode("h6",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[7]||(l[7]=a=>bn("<p>"))},[l[61]||(l[61]=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(D)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":yt("bold")}]),onClick:l[9]||(l[9]=a=>lt("bold")),title:e.unref(D)("textEditor.toolbar.bold")},[...l[62]||(l[62]=[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,nu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":yt("italic")}]),onClick:l[10]||(l[10]=a=>lt("italic")),title:e.unref(D)("textEditor.toolbar.italic")},[...l[63]||(l[63]=[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,lu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":yt("underline")}]),onClick:l[11]||(l[11]=a=>lt("underline")),title:e.unref(D)("textEditor.toolbar.underline")},[...l[64]||(l[64]=[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,ou),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":mt.value}]),onClick:so,title:e.unref(D)("textEditor.toolbar.citation")},[...l[65]||(l[65]=[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,au),l[74]||(l[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:io,title:e.unref(D)("textEditor.toolbar.removeLink")},[...l[67]||(l[67]=[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,ru)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:jl,title:e.unref(D)("textEditor.toolbar.insertLink")},[...l[66]||(l[66]=[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,su)),l[75]||(l[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":yt("insertUnorderedList")}]),onClick:al,title:e.unref(D)("textEditor.toolbar.bulletList")},[...l[68]||(l[68]=[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,iu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":yt("insertOrderedList")}]),onClick:co,title:e.unref(D)("textEditor.toolbar.numberList")},[...l[69]||(l[69]=[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,cu),l[76]||(l[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Qt,title:e.unref(D)("textEditor.toolbar.image")},[...l[70]||(l[70]=[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,uu),Vt.value?(e.openBlock(),e.createElementBlock("div",du)):e.createCommentVNode("",!0),Vt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(D)("textEditor.toolbar.comment"),onClick:Rl},[...l[71]||(l[71]=[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,mu)):e.createCommentVNode("",!0),R.askAi?(e.openBlock(),e.createElementBlock("div",pu)):e.createCommentVNode("",!0),R.askAi?(e.openBlock(),e.createElementBlock("div",fu,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=a=>mn("askAi")),title:e.unref(D)("textEditor.toolbar.askAi")},[l[72]||(l[72]=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:"#FFAF54"}),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:"#FFC963"})],-1)),e.createElementVNode("span",gu,e.toDisplayString(e.unref(D)("textEditor.toolbar.askAi")),1)],8,vu),ue.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[13]||(l[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",hu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[ot(a)?(e.openBlock(),e.createElementBlock("div",yu,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),ot(a)&&r<R.customToolbarSlots.length-1&&sn(r)?(e.openBlock(),e.createElementBlock("div",Cu)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(ue.value==="paragraph"||ue.value==="askAi")&&R.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Dt})):e.createCommentVNode("",!0),e.createVNode(Ao,{showModal:Ae.value,width:"500px",height:"55vh",onCloseModal:Un},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(D)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",ku,[e.createElementVNode("div",bu,[e.createElementVNode("label",wu,e.toDisplayString(e.unref(D)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Ie,type:"text","onUpdate:modelValue":l[15]||(l[15]=a=>O.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Xn,["enter"])},null,40,xu),[[e.vModelText,O.value]])]),e.createElementVNode("div",Eu,[e.createElementVNode("label",Vu,e.toDisplayString(e.unref(D)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:ct,type:"text","onUpdate:modelValue":l[16]||(l[16]=a=>Re.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Xn,["enter"])},null,40,Nu),[[e.vModelText,Re.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Un},e.toDisplayString(e.unref(D)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Xn},e.toDisplayString(e.unref(D)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Ao,{showModal:St.value,width:"500px",height:"80vh",onCloseModal:Lt},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Ue.value?e.unref(D)("textEditor.image.editImage"):e.unref(D)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Su,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":fe.value==="upload"}]),onClick:l[17]||(l[17]=a=>fe.value="upload")},e.toDisplayString(e.unref(D)("textEditor.image.upload")),3),l[77]||(l[77]=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":fe.value==="url"}]),onClick:l[18]||(l[18]=a=>fe.value="url")},e.toDisplayString(e.unref(D)("textEditor.image.imageLink")),3)]),fe.value==="upload"?(e.openBlock(),e.createElementBlock("div",Bu,[e.createElementVNode("div",Mu,[e.createElementVNode("div",_u,[Be.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",$u,e.toDisplayString(e.unref(D)("textEditor.image.uploadImage")),1)),Be.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Lo},[e.createElementVNode("img",{src:xt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Tu),l[78]||(l[78]=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:$t,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:ho},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:$t,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:ho},null,544))]),e.createElementVNode("div",Lu,[e.createElementVNode("label",Hu,e.toDisplayString(e.unref(D)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Ft,type:"text","onUpdate:modelValue":l[19]||(l[19]=a=>Wt.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterAltText"),onKeyup:e.withKeys(dl,["enter"])},null,40,Au),[[e.vModelText,Wt.value]])]),e.createElementVNode("div",Du,[e.createElementVNode("label",Ru,e.toDisplayString(e.unref(D)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=a=>et.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(dl,["enter"]),onInput:Pl},null,40,Fu),[[e.vModelText,et.value]])]),e.createElementVNode("div",Iu,[e.createElementVNode("label",zu,e.toDisplayString(e.unref(D)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=a=>Ye.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(dl,["enter"]),onInput:yo},null,40,Pu),[[e.vModelText,Ye.value]])])])])):e.createCommentVNode("",!0),fe.value==="url"?(e.openBlock(),e.createElementBlock("div",Ou,[e.createElementVNode("div",Zu,[e.createElementVNode("div",Wu,[e.createElementVNode("label",qu,e.toDisplayString(e.unref(D)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Bt,type:"text","onUpdate:modelValue":l[22]||(l[22]=a=>Se.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(dl,["enter"])},null,40,Uu),[[e.vModelText,Se.value]])]),e.createElementVNode("div",Xu,[e.createElementVNode("label",Yu,e.toDisplayString(e.unref(D)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=a=>Wt.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterAltText"),onKeyup:e.withKeys(dl,["enter"])},null,40,ju),[[e.vModelText,Wt.value]])]),e.createElementVNode("div",Ku,[e.createElementVNode("label",Gu,e.toDisplayString(e.unref(D)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=a=>et.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(dl,["enter"]),onInput:Pl},null,40,Qu),[[e.vModelText,et.value]])]),e.createElementVNode("div",Ju,[e.createElementVNode("label",ed,e.toDisplayString(e.unref(D)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=a=>Ye.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(dl,["enter"]),onInput:yo},null,40,td),[[e.vModelText,Ye.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Lt},e.toDisplayString(e.unref(D)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:dl},e.toDisplayString(e.unref(D)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Cn.value&&He.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.labels.title")),1),e.createElementVNode("div",nd,[He.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ld,[R.title?(e.openBlock(),e.createElementBlock("span",od,e.toDisplayString(R.title),1)):(e.openBlock(),e.createElementBlock("span",ad,e.toDisplayString(nt.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:V,value:R.title,onInput:An,onFocus:vn,onBlur:Al,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!He.value}]),placeholder:nt.value,disabled:R.disabled,rows:"1"},null,42,sd)])],2),Cn.value&&He.value?(e.openBlock(),e.createElementBlock("div",rd,[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":dn.value&&oe.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.labels.description")),1),e.createElementVNode("div",id,[oe.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",cd,[R.description?(e.openBlock(),e.createElementBlock("span",ud,e.toDisplayString(R.description),1)):(e.openBlock(),e.createElementBlock("span",dd,e.toDisplayString(rt.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:P,value:R.description,onInput:Nl,onFocus:Vl,onBlur:At,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!oe.value}]),placeholder:rt.value,disabled:R.disabled,rows:"1"},null,42,md)])],2),dn.value&&oe.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(vt.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":Kt.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=>Ho(a),onMouseleave:wo},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>Tl(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,gd)):(e.openBlock(),e.createElementBlock("span",hd,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,vd)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>Tl(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Cd)):(e.openBlock(),e.createElementBlock("span",kd,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,yd)):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=>Tl(a),["stop"])},[e.createElementVNode("span",wd,"+"+e.toDisplayString(a.additionalCount),1)],12,bd)):e.createCommentVNode("",!0)],46,fd))),128)),R.richText?(e.openBlock(),e.createElementBlock("div",Md,[e.createElementVNode("div",{ref_key:"editorRef",ref:p,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":R.disabled,"dss-text-editor-fixed-height":R.fixedHeight}]),style:e.normalizeStyle(hl.value),onInput:Z,onBlur:Dl,onClick:Bl,onMouseup:zl,onKeyup:zl,onKeydown:Dn,onPaste:pn,onMousemove:_o,onMouseleave:vo},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[Kt.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(_n.value)},[sl.value||Bn.value.length>0?(e.openBlock(),e.createElementBlock("div",_d,[e.createElementVNode("div",$d,[sl.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:sl.value},null,8,Td)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ld,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bn.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",Hd,[e.createElementVNode("div",Ad,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,Dd)):(e.openBlock(),e.createElementBlock("span",Rd,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Fd,[e.createElementVNode("div",Id,[e.createElementVNode("div",zd,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",Pd,e.toDisplayString(Xl(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":Cl(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),b.commentUser&&a.user&&a.user.id===b.commentUser.id&&!Cl(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>So(a,r),["stop"]),title:e.unref(D)("textEditor.comment.delete")||"Delete comment"},[...l[80]||(l[80]=[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,Od)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Zd,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:tl,"onUpdate:modelValue":l[26]||(l[26]=a=>el.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(D)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Ql,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(tl.value){const a=tl.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,Wd),[[e.vModelText,el.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Ql,["stop"])},[...l[81]||(l[81]=[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",qd,[e.createElementVNode("div",Ud,[e.createElementVNode("span",Xd,e.toDisplayString(I.value)+" "+e.toDisplayString(I.value===1?e.unref(D)("textEditor.footer.word"):e.unref(D)("textEditor.footer.words")),1),l[82]||(l[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Yd,e.toDisplayString(ne.value)+" "+e.toDisplayString(ne.value===1?e.unref(D)("textEditor.footer.character"):e.unref(D)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",xd,[e.createElementVNode("textarea",{value:R.modelValue,onInput:kl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":R.fixedHeight}]),placeholder:Oe.value,rows:R.rows,disabled:R.disabled,style:e.normalizeStyle(Ln.value)},null,46,Ed),e.createElementVNode("div",Vd,[e.createElementVNode("div",Nd,[e.createElementVNode("span",Sd,e.toDisplayString(I.value)+" "+e.toDisplayString(I.value===1?e.unref(D)("textEditor.footer.word"):e.unref(D)("textEditor.footer.words")),1),l[79]||(l[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Bd,e.toDisplayString(ne.value)+" "+e.toDisplayString(ne.value===1?e.unref(D)("textEditor.footer.character"):e.unref(D)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ee.value&&S.value&&p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(le.value),onMouseenter:l[28]||(l[28]=a=>Le.value=!0),onMouseleave:_l},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers($o,["stop"]),title:S.value},e.toDisplayString(S.value),9,jd),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(nl,["stop"]),title:e.unref(D)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Gd,[...l[83]||(l[83]=[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,Kd)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Ut.value&&ht.value&&p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(te.value),onMouseenter:l[29]||(l[29]=a=>_e.value=!0),onMouseleave:wl},[e.createElementVNode("div",Qd,[ht.value===e.unref(D)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Jd,[...l[84]||(l[84]=[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:ht.value},e.toDisplayString(ht.value),9,e1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Co,["stop"]),title:e.unref(D)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",n1,[...l[85]||(l[85]=[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,t1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[R.floatingToolbar&&R.richText&&ge.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Et,class:"dss-floating-toolbar",style:e.normalizeStyle(gt.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",l1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(w,["stop"]),title:e.unref(D)("textEditor.toolbar.undo")},[...l[86]||(l[86]=[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,o1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!A.value}]),onClick:e.withModifiers(y,["stop"]),title:e.unref(D)("textEditor.toolbar.redo")},[...l[87]||(l[87]=[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,a1),l[107]||(l[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",s1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(a=>fo("paragraph"),["stop"])),title:e.unref(D)("textEditor.toolbar.paragraphFormat")},[je.value==="h1"?(e.openBlock(),e.createElementBlock("svg",i1,[...l[88]||(l[88]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):je.value==="h2"?(e.openBlock(),e.createElementBlock("svg",c1,[...l[89]||(l[89]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):je.value==="h3"?(e.openBlock(),e.createElementBlock("svg",u1,[...l[90]||(l[90]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):je.value==="h4"?(e.openBlock(),e.createElementBlock("svg",d1,[...l[91]||(l[91]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):je.value==="h5"?(e.openBlock(),e.createElementBlock("svg",m1,[...l[92]||(l[92]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):je.value==="h6"?(e.openBlock(),e.createElementBlock("svg",p1,[...l[93]||(l[93]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",f1,[...l[94]||(l[94]=[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)])])),l[95]||(l[95]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,r1),st.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[38]||(l[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[31]||(l[31]=a=>ul("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[32]||(l[32]=a=>ul("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[33]||(l[33]=a=>ul("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[34]||(l[34]=a=>ul("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[35]||(l[35]=a=>ul("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[36]||(l[36]=a=>ul("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[37]||(l[37]=a=>ul("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),l[108]||(l[108]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":yt("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(a=>lt("bold"),["stop"])),title:e.unref(D)("textEditor.toolbar.bold")},[...l[96]||(l[96]=[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,v1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":yt("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(a=>lt("italic"),["stop"])),title:e.unref(D)("textEditor.toolbar.italic")},[...l[97]||(l[97]=[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,g1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":yt("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(a=>lt("underline"),["stop"])),title:e.unref(D)("textEditor.toolbar.underline")},[...l[98]||(l[98]=[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,h1),l[109]||(l[109]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":mt.value}]),onClick:e.withModifiers(so,["stop"]),title:e.unref(D)("textEditor.toolbar.citation")},[...l[99]||(l[99]=[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,y1),l[110]||(l[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(io,["stop"]),title:e.unref(D)("textEditor.toolbar.removeLink")},[...l[101]||(l[101]=[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,k1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(jl,["stop"]),title:e.unref(D)("textEditor.toolbar.insertLink")},[...l[100]||(l[100]=[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,C1)),l[111]||(l[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":yt("insertUnorderedList")}]),onClick:e.withModifiers(al,["stop"]),title:e.unref(D)("textEditor.toolbar.bulletList")},[...l[102]||(l[102]=[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,b1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":yt("insertOrderedList")}]),onClick:e.withModifiers(co,["stop"]),title:e.unref(D)("textEditor.toolbar.numberList")},[...l[103]||(l[103]=[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,w1),l[112]||(l[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Qt,["stop"]),title:e.unref(D)("textEditor.toolbar.image")},[...l[104]||(l[104]=[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,x1),l[113]||(l[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(D)("textEditor.toolbar.comment"),onClick:e.withModifiers(Rl,["stop"])},[...l[105]||(l[105]=[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,E1),R.askAi?(e.openBlock(),e.createElementBlock("div",V1)):e.createCommentVNode("",!0),R.askAi?(e.openBlock(),e.createElementBlock("div",N1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(a=>fo("askAi"),["stop"])),title:e.unref(D)("textEditor.toolbar.askAi")},[l[106]||(l[106]=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:"#FFAF54"}),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:"#FFC963"})],-1)),e.createElementVNode("span",B1,e.toDisplayString(e.unref(D)("textEditor.toolbar.askAi")),1)],8,S1),st.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[43]||(l[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Hn.value?(e.openBlock(),e.createElementBlock("div",M1,[R.askAi&&Hn.value?(e.openBlock(),e.createElementBlock("div",_1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[ot(a)&&nn(a)?(e.openBlock(),e.createElementBlock("div",$1,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),ot(a)&&nn(a)&&r<R.customToolbarSlots.length-1&&Nn(r)?(e.openBlock(),e.createElementBlock("div",T1)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),A1={class:"dss-color-picker__section-title"},D1={class:"dss-color-picker__presets-row"},R1=["title","onClick"],F1={key:1,class:"dss-color-picker__section"},I1={class:"dss-color-picker__presets-row"},z1=["title","onClick"],P1={class:"dss-color-picker__section"},O1={class:"dss-color-picker__section-header"},Z1={class:"dss-color-picker__presets-row"},W1=["title","onClick"],q1=["onClick"],U1={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},X1=["title","onClick"],Y1={class:"dss-color-picker__input-row"},j1=["value"],K1={__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(R,{emit:ke}){function z(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 K=parseInt(U[1],16)/255,ie=parseInt(U[2],16)/255,x=parseInt(U[3],16)/255,C=Math.max(K,ie,x),V=Math.min(K,ie,x);let P=0,Y=0;const Ve=(C+V)/2;if(C!==V){const Je=C-V;switch(Y=Ve>.5?Je/(2-C-V):Je/(C+V),C){case K:P=((ie-x)/Je+(ie<x?6:0))/6;break;case ie:P=((x-K)/Je+2)/6;break;case x:P=((K-ie)/Je+4)/6;break}}return{h:P*360,s:Y*100,l:Ve*100}}function D(q,U,K){U/=100,K/=100;const ie=U*Math.min(K,1-K),x=C=>{const V=(C+q/30)%12,P=K-ie*Math.max(Math.min(V-3,9-V,1),-1);return Math.round(255*P).toString(16).padStart(2,"0")};return`#${x(0)}${x(8)}${x(4)}`}function Me(q){const U=q.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!U)return null;let K=U[1];return K.length===3&&(K=K.split("").map(ie=>ie+ie).join("")),"#"+K}function b(q,U,K){U/=100,K/=100;const ie=K+U*Math.min(K,1-K),x=ie===0?0:2-2*K/ie;return{h:q,s:x*100,v:ie*100}}function Te(q,U,K){U/=100,K/=100;const ie=K*(1-U/2),x=ie===0||ie===1?0:(K-ie)/Math.min(ie,1-ie);return{h:q,s:x*100,l:ie*100}}const se=R,pt=ke,p=e.ref(!1),ue=e.ref(!1),ve=e.ref(!1),de=e.ref(-1),ee=e.ref(-1),S=e.ref(null),le=e.ref(null),Le=e.ref(null),Ae=e.ref(null),Re=e.ref({top:0,left:0}),O=e.ref(z(se.modelValue||"#b8a5de")),ct=e.computed(()=>Array.isArray(se.presetGroups)&&se.presetGroups.length>0),Ie=e.computed(()=>ct.value?0:se.initialPresetCount!=null?se.initialPresetCount:ee.value<0?null:ee.value),xe=e.computed(()=>{const q=Ie.value;return q==null?!0:Math.max(0,se.presetColors.length-q)<se.max}),wt=e.computed(()=>!!(ue.value||de.value>=0||!_t.value&&se.presetColors.length===0));e.computed(()=>{const q=Ie.value;return q!=null&&se.presetColors.length>q});const _t=e.computed(()=>ct.value||Ie.value!=null),mt=e.computed(()=>{const q=Ie.value;return q==null?[]:se.presetColors.slice(0,q)}),ze=e.computed(()=>{const q=Ie.value;return q==null?[]:se.presetColors.slice(q)});function ge(q){const U=Ie.value;return U!=null?U+q:-1}function gt(q){const U=Ie.value;return U!=null&&q>=U}function Et(q){gt(q)&&(de.value=q,O.value=z(se.presetColors[q]),ue.value=!0,e.nextTick(()=>Ae.value?.focus()))}function st(q){if(!gt(q))return;const U=se.presetColors.filter((x,C)=>C!==q);pt("update:presetColors",U);const K=Me(se.modelValue),ie=Me(se.presetColors[q]);if(K&&ie&&K.toLowerCase()===ie.toLowerCase()){const x=U[Math.max(0,q-1)]||U[0];x&&pt("update:modelValue",x)}}function St(){ve.value=!ve.value,ve.value||(de.value=-1,ue.value=!1)}function Wt(){if(de.value<0)return;const q=Ye.value,U=Me(q);if(U){const K=[...se.presetColors];K[de.value]=U,pt("update:presetColors",K),pt("update:modelValue",U),de.value=-1,ue.value=!1}}function on(){se.disabled||(de.value=-1,ue.value=!ue.value,ue.value&&(ht(),e.nextTick(()=>Ae.value?.focus())))}function xt(q){const U=Me(q),K=Me(se.modelValue);return U&&K&&U.toLowerCase()===K.toLowerCase()}function et(){if(se.disabled||!xe.value)return;const q=Ye.value,U=Me(q);if(U){const K=[...se.presetColors,U];pt("update:presetColors",K),pt("update:modelValue",U);const ie=Ie.value??ee.value;ie>=0&&K.length-ie>=se.max&&(ue.value=!1)}}const Ye=e.computed(()=>{const{h:q,s:U,l:K}=O.value;return D(q,U,K)}),Ft=e.computed(()=>Ye.value.toLowerCase()),$t=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${O.value.h}, 100%, 50%))`})),Bt=e.computed(()=>{const q=b(O.value.h,O.value.s,O.value.l);return{left:`${q.s}%`,bottom:`${q.v}%`,transform:"translate(-50%, 50%)"}}),Ue=e.computed(()=>({left:`${O.value.h/360*100}%`,transform:"translateX(-50%)"})),Yt=e.computed(()=>({position:"fixed",left:`${Re.value.left}px`,top:`${Re.value.top}px`,zIndex:1002}));function Ut(){if(!S.value||!p.value)return;const q=S.value.getBoundingClientRect(),U=window.innerHeight||document.documentElement.clientHeight;let K=q.bottom+4;const ie=le.value;ie&&K+ie.offsetHeight>U-8&&(K=q.top-4-ie.offsetHeight),Re.value={top:K,left:q.left}}function ht(){const q=se.modelValue||"#b8a5de";Me(q)&&(O.value=z(q))}function te(){pt("update:modelValue",Ye.value)}function _e(){se.disabled||(p.value=!p.value,p.value&&(ht(),e.nextTick(()=>{Ut(),Ae.value?.focus()})))}function fe(){const q=Ye.value,U=Me(q);if(U){if(de.value>=0){const K=[...se.presetColors];K[de.value]=U,pt("update:presetColors",K),pt("update:modelValue",U)}else if((se.presetColors.length>0||ct.value)&&ue.value&&xe.value&&!se.presetColors.some(ie=>Me(ie)?.toLowerCase()===U.toLowerCase())){const ie=[...se.presetColors,U];pt("update:presetColors",ie),pt("update:modelValue",U)}}p.value=!1,ue.value=!1,ve.value=!1,de.value=-1}function Se(q){if(!Le.value)return;const U=Le.value.getBoundingClientRect(),K=ie=>{const x=Math.max(0,Math.min(1,(ie.clientX-U.left)/U.width)),C=Math.max(0,Math.min(1,1-(ie.clientY-U.top)/U.height)),V={h:O.value.h,s:x*100,v:C*100};O.value=Te(V.h,V.s,V.v)};K(q),document.addEventListener("mousemove",K),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",K),te()},{once:!0})}function Pe(q){if(!q.currentTarget)return;const K=q.currentTarget.getBoundingClientRect(),ie=x=>{const C=Math.max(0,Math.min(1,(x.clientX-K.left)/K.width));O.value={...O.value,h:C*360}};ie(q),document.addEventListener("mousemove",ie),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ie),te()},{once:!0})}function ft(q){const U=q.target.value,K=Me(U);K&&(O.value=z(K),pt("update:modelValue",K))}function Ze(q){if(se.disabled)return;const U=Me(q);U&&(O.value=z(U),pt("update:modelValue",U))}let ut=null,Ee=null;function Qe(){ut&&(document.removeEventListener("keydown",ut),ut=null),Ee&&(window.removeEventListener("resize",Ee),Ee=null)}return e.watch(p,q=>{if(Qe(),q){if(!ct.value&&se.initialPresetCount==null){const U=se.presetColors.length;U>0&&(ee.value<0||U<ee.value)&&(ee.value=U)}ut=U=>{U.key==="Escape"&&fe()},Ee=Ut,document.addEventListener("keydown",ut),window.addEventListener("resize",Ee)}}),e.watch(()=>se.modelValue,()=>{p.value&&ht()},{immediate:!1}),e.watch(ze,q=>{q.length===0&&(ve.value=!1,de.value=-1,ue.value=!1)}),e.onBeforeUnmount(Qe),(q,U)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":R.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:S,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":p.value}]),onClick:_e},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:Ye.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"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(fe,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:le,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Yt.value)},[_t.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[ct.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(R.presetGroups,(K,ie)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ie,class:"dss-color-picker__section"},[e.createElementVNode("span",A1,e.toDisplayString(K.title),1),e.createElementVNode("div",D1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.colors,(x,C)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ie+"-"+C,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xt(x)}]),style:e.normalizeStyle({backgroundColor:x}),title:x,onClick:e.withModifiers(V=>Ze(x),["stop"])},null,14,R1))),128))])]))),128)):mt.value.length?(e.openBlock(),e.createElementBlock("div",F1,[U[1]||(U[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",I1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt.value,(K,ie)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ie,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xt(K)}]),style:e.normalizeStyle({backgroundColor:K}),title:K,onClick:e.withModifiers(x=>Ze(K),["stop"])},null,14,z1))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",P1,[e.createElementVNode("div",O1,[U[3]||(U[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),ze.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":ve.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",Z1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,(K,ie)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ie,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":ve.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!ve.value&&xt(K),"dss-color-picker__preset-bubble--editing":ve.value&&de.value===ge(ie)}]),style:e.normalizeStyle({backgroundColor:de.value===ge(ie)?Ye.value:K}),title:de.value===ge(ie)?Ye.value:K,onClick:e.withModifiers(x=>ve.value?Et(ge(ie)):Ze(K),["stop"])},null,14,W1),ve.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(x=>st(ge(ie)),["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,q1)):e.createCommentVNode("",!0)],2))),128)),xe.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ue.value}]),onClick:e.withModifiers(on,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):R.presetColors.length?(e.openBlock(),e.createElementBlock("div",U1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.presetColors,(K,ie)=>(e.openBlock(),e.createElementBlock("button",{key:ie,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xt(K)}]),style:e.normalizeStyle({backgroundColor:K}),title:K,onClick:e.withModifiers(x=>Ze(K),["stop"])},null,14,X1))),128)),xe.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ue.value}]),onClick:e.withModifiers(on,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),wt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:Le,onMousedown:Se},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle($t.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Bt.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Pe},[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(Ue.value)},null,4)],32),e.createElementVNode("div",Y1,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:Ae,type:"text",class:"dss-color-picker__hex-input",value:Ft.value,onInput:ft},null,40,j1)]),_t.value&&(R.presetColors.length||ct.value)&&xe.value&&de.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:et}," Save color ")):e.createCommentVNode("",!0),_t.value&&de.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Wt}," Save color ")):e.createCommentVNode("",!0),_t.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:fe}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},G1={key:0,class:"dss-loader"},Q1={key:0,class:"dss-loader-label"},J1={key:1,class:"dss-loader"},em={key:0,class:"dss-loader-label"},tm={key:2,class:"dss-loader"},nm={key:0,class:"dss-loader-label"},lm={key:3,class:"dss-loader"},om={key:0,class:"dss-loader-label"},am={key:4,class:"dss-loader"},sm={key:0,class:"dss-loader-label"},rm={key:5,class:"dss-loader dss-loader--inline"},im={class:"dss-loader-inline-text"},cm={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"}},setup(R){const ke=R,z=e.computed(()=>ke.size==="small"?"dss-loaders--size-small":ke.size==="large"?"dss-loaders--size-large":ke.size==="medium"||ke.size==null?"dss-loaders--size-medium":null),D=e.computed(()=>ke.size==="small"||ke.size==="medium"||ke.size==="large"||ke.size==null?{}:{"--dss-loader-size":typeof ke.size=="number"?`${ke.size}px`:String(ke.size)});return(Me,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",z.value]),style:e.normalizeStyle(D.value)},[R.type==="spinner"?(e.openBlock(),e.createElementBlock("div",G1,[b[0]||(b[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),R.label?(e.openBlock(),e.createElementBlock("span",Q1,e.toDisplayString(R.label),1)):e.createCommentVNode("",!0)])):R.type==="dots"?(e.openBlock(),e.createElementBlock("div",J1,[b[1]||(b[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)),R.label?(e.openBlock(),e.createElementBlock("span",em,e.toDisplayString(R.label),1)):e.createCommentVNode("",!0)])):R.type==="battery"?(e.openBlock(),e.createElementBlock("div",tm,[b[2]||(b[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),R.label?(e.openBlock(),e.createElementBlock("span",nm,e.toDisplayString(R.label),1)):e.createCommentVNode("",!0)])):R.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",lm,[b[3]||(b[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)),R.label?(e.openBlock(),e.createElementBlock("span",om,e.toDisplayString(R.label),1)):e.createCommentVNode("",!0)])):R.type==="bars"?(e.openBlock(),e.createElementBlock("div",am,[b[4]||(b[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)),R.label?(e.openBlock(),e.createElementBlock("span",sm,e.toDisplayString(R.label),1)):e.createCommentVNode("",!0)])):R.type==="inline"?(e.openBlock(),e.createElementBlock("div",rm,[b[5]||(b[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",im,[e.renderSlot(Me.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(R.label),1)])])])):e.createCommentVNode("",!0)],6))}},Uo="dss-skeleton-item",um={__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:R=>["single","multiple"].includes(R)},targetClass:{type:String,default:Uo},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(R){const ke=R,z=e.computed(()=>{const b={"dss-skeleton--loading":ke.loading,"dss-skeleton--static":!ke.shimmer,"dss-skeleton--multiple":ke.mode==="multiple","dss-skeleton--dark":ke.darkMode};return ke.mode==="multiple"&&ke.targetClass!==Uo&&(b[`dss-skeleton--target-${ke.targetClass}`]=!0),b}),D=e.computed(()=>{const b={};return ke.borderRadius&&(b.borderRadius=ke.borderRadius),b}),Me=e.computed(()=>{const b={};return ke.borderRadius&&(b["--dss-skeleton-border-radius"]=ke.borderRadius),ke.darkMode?(b["--dss-skeleton-bg"]=ke.bgDark||"#322c3f",b["--dss-skeleton-shimmer"]=ke.shimmerDark||"#3e3f41",b):(ke.bgColor&&(b["--dss-skeleton-bg"]=ke.bgColor),ke.shimmerColor&&(b["--dss-skeleton-shimmer"]=ke.shimmerColor),b)});return(b,Te)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",z.value]),style:e.normalizeStyle(Me.value)},[R.loading&&R.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(D.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":R.loading&&R.mode==="single"}])},[e.renderSlot(b.$slots,"default")],2)],6))}},dm={key:0,class:"dss-dnd-column-header"},mm={class:"dss-dnd-column-title"},pm={class:"dss-dnd-column-count"},fm=["data-column"],vm={key:0,class:"dss-dnd-indicator"},gm=["onPointerdown"],hm=["onPointerdown"],ym={class:"dss-dnd-item-content"},Cm={class:"dss-dnd-item-default"},km={key:0,class:"dss-dnd-empty"},bm={name:"DSSDnd"},wm=Object.assign(bm,{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(R,{emit:ke}){const z=R,D=ke,Me=e.useSlots(),b=e.computed(()=>!!Me["delete-zone"]),Te={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1},se=e.computed(()=>({...Te,...z.options})),pt=e.computed(()=>({"--dss-dnd-col-min-w":se.value.columnMinWidth,"--dss-dnd-col-max-w":se.value.columnMaxWidth,"--dss-dnd-col-gap":se.value.columnGap,"--dss-dnd-indicator-color":se.value.indicatorColor,"--dss-dnd-body-max-h":se.value.columnBodyMaxHeight})),p=e.ref(null),ue=e.ref(null),ve=e.ref(!1),de=e.ref(-1),ee=e.ref(null);let S=null,le=null,Le=null,Ae=null,Re=0,O=0,ct="",Ie=null;const xe=5,wt=e.computed(()=>{const te={};for(const _e of z.columns)te[_e.value]=z.items.filter(fe=>fe[z.columnKey]===_e.value).sort((fe,Se)=>(fe[z.positionKey]??0)-(Se[z.positionKey]??0));return te}),_t=e.computed(()=>{const te={},_e=!!p.value,fe=p.value?.[z.itemKey],Se=ue.value,Pe=de.value;for(const ft of z.columns){const Ze=wt.value[ft.value]||[],ut=[],Ee=Se==ft.value;let Qe=0;for(let q=0;q<Ze.length;q++){const U=Ze[q],K=_e&&U[z.itemKey]===fe;!K&&Ee&&Pe===Qe&&ut.push({type:"indicator",key:`ind-${Qe}`}),K||Qe++,ut.push({type:"item",item:U,isDragged:K,key:`item-${U[z.itemKey]}`})}Ee&&Pe>=Qe&&ut.push({type:"indicator",key:"ind-end"}),te[ft.value]=ut}return te});function mt(te,_e){const Se=(wt.value[te]||[]).filter(Ze=>Ze[z.itemKey]!==p.value?.[z.itemKey]);if(Se.length===0)return 1;if(_e<=0){const Ze=Se[0][z.positionKey];return Ze!=null&&Ze>0?Ze/2:.5}if(_e>=Se.length){const Ze=Se[Se.length-1][z.positionKey];return(Ze??0)+1}const Pe=Se[_e-1][z.positionKey]??0,ft=Se[_e][z.positionKey]??0;return(Pe+ft)/2}function ze(te,_e,fe){Le&&Le.remove();const Se=te.getBoundingClientRect(),Pe=te.cloneNode(!0);Pe.classList.add("dss-dnd-ghost"),Pe.style.cssText=`
103
+ `){const h=document.createTextNode(" ");l.insertNode(h),l.setStartAfter(h)}}l.insertNode(d);const u=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(u),l.setStartAfter(u),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}Se()}e.nextTick(()=>{Vn(),Dn()})},Yn=()=>{if(!p.value||de.value)return;const o=window.getSelection();let l=null;o&&o.rangeCount>0&&(l=yn());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(p.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}}),i=[];let d;for(;d=r.nextNode();)i.push(d);let u=!1;for(let m=i.length-1;m>=0;m--){const v=i[m],h=v.textContent;a.lastIndex=0;const _=[...h.matchAll(a)];if(_.length===0)continue;const $=_.filter(Y=>{const Te=Y[0],me=Y.index;if(me>0&&h[me-1]==="@"||me+Te.length<h.length&&h[me+Te.length]==="@")return!1;const ct=v.parentElement;return!(ct&&ct.closest("a"))});if($.length===0)continue;if($.length===1&&$[0][0]===h.trim()){const Y=$[0][0],Te=Y.startsWith("http://")||Y.startsWith("https://")?Y:`https://${Y}`,me=document.createElement("a");me.href=Te,me.textContent=Y,me.style.color="#60afdf",me.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(me,v),u=!0);continue}let N=0;const Q=document.createDocumentFragment();if($.forEach(Y=>{const Te=Y.index,me=Y[0];if(Te>N){const Jt=h.substring(N,Te);Jt&&Q.appendChild(document.createTextNode(Jt))}const ct=me.startsWith("http://")||me.startsWith("https://")?me:`https://${me}`,Qt=document.createElement("a");Qt.href=ct,Qt.textContent=me,Qt.style.color="#60afdf",Qt.style.textDecoration="underline",Q.appendChild(Qt),N=Te+me.length}),N<h.length){const Y=h.substring(N);Y&&Q.appendChild(document.createTextNode(Y))}v.parentNode&&Q.childNodes.length>0&&(v.parentNode.replaceChild(Q,v),u=!0)}u&&l&&e.nextTick(()=>{et(l),Vn()})},qt=()=>{if(!p.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,l=document.createTreeWalker(p.value,NodeFilter.SHOW_TEXT,{acceptNode:i=>{const d=i.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let r;for(;r=l.nextNode();)a.push(r);for(let i=a.length-1;i>=0;i--){const d=a[i],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let v=0;const h=document.createDocumentFragment();m.forEach(_=>{const $=_.index,N=_[0].startsWith("<u>")?"u":"ins",Q=_[1]||_[2]||"";$>v&&h.appendChild(document.createTextNode(u.substring(v,$)));const Y=document.createElement(N);Y.textContent=Q,h.appendChild(Y),v=$+_[0].length}),v<u.length&&h.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&h.childNodes.length>0&&d.parentNode.replaceChild(h,d)}},ko=o=>{if(!p.value||de.value)return;if(!o){qt();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 i=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(!i||i===p.value||!p.value.contains(i))return;const d=()=>{let Jt="",Ut=0,Pt=!1;const en=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:Zn=>Zn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(i,NodeFilter.SHOW_TEXT,null);let jt=0;for(;en.nextNode();){const Zn=en.currentNode,rl=Zn.textContent||"",kn=jt;if(jt+=rl.length,Zn===r.startContainer){Jt+=rl.substring(0,r.startOffset),Ut=kn+r.startOffset,Pt=!0;break}Jt+=rl}return Pt||(Ut=Jt.length),{textBeforeCursor:Jt,cursorCharOffset:Ut}},{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[1],$=u.length-h.length,Q=(Jt=>{let Ut=0;const Pt=document.createTreeWalker(i,NodeFilter.SHOW_TEXT,{acceptNode:jt=>jt.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let en;for(;en=Pt.nextNode();){const jt=(en.textContent||"").length;if(Ut+jt>=Jt)return{node:en,offset:Jt-Ut};Ut+=jt}return null})($);if(!Q)return;const Y=document.createRange();Y.setStart(Q.node,Q.offset),Y.setEnd(r.endContainer,r.endOffset);const Te=document.createElement(v);Te.textContent=_,Y.deleteContents(),Y.insertNode(Te);const me=window.getSelection(),ct=document.createRange();ct.setStartAfter(Te),ct.collapse(!0),me.removeAllRanges(),me.addRange(ct);const Qt=yn();e.nextTick(()=>{Se(),Qt&&et(Qt)})},Ft=()=>{p.value&&(Gt.value=yn(),Ot.value="",Et.value="",Ve.value="",lt.value="",je.value="",on.value=null,Xe.value=null,fe.value="upload",_t.value=!0,At(),e.nextTick(()=>{Dt.value&&Dt.value.focus(),Lt.value&&(Lt.value.value="")}))},ln=o=>{const l=o.target?.files?.[0];if(!l){on.value=null,Et.value="";return}on.value=l;const a=new FileReader;a.onload=r=>{Et.value=r.target?.result||""},a.readAsDataURL(l)},$o=()=>{Lt.value&&Lt.value.click()},bo=()=>{lt.value&&(je.value="")},Dl=()=>{je.value&&(lt.value="")},To=()=>{let o=Xe.value;if(!o){const l=window.getSelection();if(l&&l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(o){const l=o.getAttribute("data-alt")||o.getAttribute("alt")||"";Xe.value=o,Ot.value=l.trim()===""||l.trim()==="Image"?"":l;const a=o.getAttribute("src")||o.src||"";a.startsWith("http://")||a.startsWith("https://")?(Ve.value=a,Et.value="",fe.value="url"):(Et.value=a,Ve.value="",fe.value="upload");const i=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";lt.value=i.endsWith("px")?i.replace("px",""):i,je.value=d.endsWith("px")?d.replace("px",""):d,Gt.value=null}else{Ft();return}_t.value=!0,$e.value=!1,Xt.value=!1,e.nextTick(()=>{fe.value==="url"&&$t.value?($t.value.focus(),$t.value.select()):Dt.value&&(Dt.value.focus(),Dt.value.select()),Lt.value&&(Lt.value.value="")})},wl=()=>{_t.value=!1,Ot.value="",Et.value="",Ve.value="",lt.value="",je.value="",on.value=null,Xe.value=null,Gt.value=null,fe.value="upload"},Mt=()=>{const o=(Ot.value||"").trim(),l=p.value?._mutationObserver;l&&l.disconnect(),Ue.value?(xe.value&&(clearTimeout(xe.value),xe.value=null),Ne(),Ue.value=!1):Ne();const a=fe.value==="url"?Ve.value.trim():Et.value;if(Xe.value&&p.value&&p.value.contains(Xe.value)){a&&(Xe.value.src=a),Xe.value.setAttribute("alt",o),Xe.value.setAttribute("data-alt",o),lt.value?(Xe.value.style.width=`${lt.value}px`,Xe.value.setAttribute("width",lt.value)):(Xe.value.style.removeProperty("width"),Xe.value.removeAttribute("width")),je.value?(Xe.value.style.height=`${je.value}px`,Xe.value.setAttribute("height",je.value)):(Xe.value.style.removeProperty("height"),Xe.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const i=document.createRange();i.setStartAfter(Xe.value),i.collapse(!0),r.addRange(i)}Se()}else{if(!a){l&&p.value&&l.observe(p.value,{childList:!0,subtree:!0}),wl();return}if(p.value){p.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const i=window.getSelection();let d=null;if(Gt.value&&(et(Gt.value),i&&i.rangeCount>0&&(d=i.getRangeAt(0))),!d&&i&&i.rangeCount>0&&(d=i.getRangeAt(0)),!d&&p.value){if(d=document.createRange(),p.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",p.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(p.value),d.collapse(!1);i&&(i.removeAllRanges(),i.addRange(d))}if(!d){wl();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!p.value.contains(m)){if(d=document.createRange(),p.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",p.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(p.value),d.collapse(!1);i&&(i.removeAllRanges(),i.addRange(d))}const v=document.createElement("img");v.src=a,v.setAttribute("alt",o),v.setAttribute("data-alt",o),lt.value&&(v.style.width=`${lt.value}px`,v.setAttribute("width",lt.value)),je.value&&(v.style.height=`${je.value}px`,v.setAttribute("height",je.value));try{d.insertNode(v),d.setStartAfter(v),d.collapse(!0),i&&(i.removeAllRanges(),i.addRange(d))}catch{if(p.value){if(p.value.childNodes.length===0){const $=document.createElement("p");p.value.appendChild($),$.appendChild(v)}else{const $=p.value.lastChild;if($&&$.nodeType===1)$.appendChild(v);else{const N=document.createElement("p");p.value.appendChild(N),N.appendChild(v)}}const _=document.createRange();_.setStartAfter(v),_.collapse(!0),i&&(i.removeAllRanges(),i.addRange(_))}}Xe.value=v,Se()}}e.nextTick(()=>{l&&p.value&&l.observe(p.value,{childList:!0,subtree:!0}),Vn(),Wt(),wl()})};e.watch(()=>b.modelValue,o=>{if(b.richText&&p.value&&!de.value){const l=In(o||""),r=p.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),i=l.replace(/&nbsp;|\u00A0/g," ");if(r!==i){const d=yn();p.value.innerHTML=l,e.nextTick(()=>{St();const u=p.value.innerHTML||"",m=b.title||"",v=b.description||"";X.value=u,j.value=m,ie.value=v,Z.value=u,E.value=m,C.value=v,qe.value=[],ut.value=[],xe.value&&(clearTimeout(xe.value),xe.value=null),Ue.value=!1,d&&et(d),Mn(),he(),W(),Vn(),Wt(),Xn(),On("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>b.richText,o=>{o?(Wt(),e.nextTick(()=>{no()})):(ol(),vt.value=[],Je.value&&(Je.value.disconnect(),Je.value=null)),Xn()}),e.watch(()=>b.floatingToolbar,o=>{o?Wt():ol()}),e.watch(()=>b.disabled,o=>{o&&ol(),Xn()}),e.watch(()=>b.description,()=>{e.nextTick(()=>{re.value?dl():Nt()})}),e.watch(()=>b.title,()=>{e.nextTick(()=>{Ae.value?gn():ul()})}),e.watch(()=>b.customToolbarSlots,()=>{e.nextTick(()=>{Rt()})},{deep:!0}),e.watch(()=>b.comments,(o,l)=>{if(Ul.value){Ul.value=!1;return}Bl.value||b.richText&&p.value&&e.nextTick(()=>{Ql()})},{deep:!0,immediate:!1});const Ql=()=>{if(!Bl.value&&!(!b.comments||!Array.isArray(b.comments)||b.comments.length===0)&&!(!b.richText||!p.value)){Bl.value=!0;try{const o=new Set,l=b.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),a=p.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 i=0;const d=new Set;l.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=p.value.querySelector(`[data-comment="${v}"]`);if(h){_l(h,u),d.add(v);return}try{const _=wo(u.selection_range,u.selection_text);if(_&&!_.collapsed){const $=_.commonAncestorContainer,N=$.nodeType===3?$.parentElement:$;if(N){const Te=N.closest("[data-comment], [data-fake-comment]");if(Te){const me=Te.getAttribute("data-comment")||Te.getAttribute("data-fake-comment");if(String(me)===String(m)){Te.setAttribute("data-comment",v),Te.removeAttribute("data-fake-comment"),_l(Te,u),d.add(v);return}else return}}const Q=p.value.querySelector(`[data-comment="${v}"]`);if(Q){_l(Q,u),d.add(v);return}const Y=document.createElement("span");Y.setAttribute("data-comment",v),_l(Y,u);try{_.surroundContents(Y),i++,d.add(v)}catch{try{const me=document.createRange();me.setStart(_.startContainer,_.startOffset),me.setEnd(_.endContainer,_.endOffset),Rl(me),me.surroundContents(Y),i++,d.add(v)}catch{try{const ct=_.extractContents();Y.appendChild(ct),_.insertNode(Y),i++,d.add(v)}catch(ct){console.warn("Failed to create comment marker:",ct)}}}}}catch{}}),e.nextTick(()=>{On("restoreCommentsFromModel"),Se(),Bl.value=!1})}catch{Bl.value=!1}}},Rl=o=>{if(!o||!p.value)return o;try{const l=["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&&l.includes(u.tagName)&&(r===0&&!Jl(a)||o.setStartBefore(u))}else a.nodeType===1&&l.includes(a.tagName)&&r>0&&o.setStartBefore(a);let i=o.endContainer,d=o.endOffset;if(i.nodeType===3){const u=i.parentElement;u&&l.includes(u.tagName)&&(d===i.length&&!eo(i)||o.setEndAfter(u))}else i.nodeType===1&&l.includes(i.tagName)&&d<i.childNodes.length&&o.setEndAfter(i);return o}catch{return o}},Jl=o=>{let l=o.previousSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.previousSibling}return!1},eo=o=>{let l=o.nextSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.nextSibling}return!1},wo=(o,l)=>{if(!o||!p.value)return null;try{const a=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let r=0;const i=[p.value];let d=null,u=!1,m=!1;for(;!m&&(d=i.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--;)i.push(d.childNodes[v])}return u?Rl(a):null}}catch{return null}return null},_l=(o,l)=>{if(!o||!l)return;const a=l.conversation||[],r=new Set,i=[],d=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),i.push(m))};a.length>0&&a.forEach(m=>{m.user&&d(m.user)}),i.length>0?o.setAttribute("data-comment-user",JSON.stringify(i[0])):o.removeAttribute("data-comment-user"),i.length>1?o.setAttribute("data-comment-user-2",JSON.stringify(i[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")},On=(o="unknown")=>{if(!b.richText||!p.value){vt.value=[];return}Date.now()-bn.value<Rn&&vn.value!==null||vn.value===null&&(vn.value=requestAnimationFrame(()=>{if(vn.value=null,bn.value=Date.now(),Tn.value)return;Tn.value=!0;const a={},r=p.value;if(!r){Tn.value=!1;return}const i=r.closest(".editor-with-comments");if(!i){Tn.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(N=>{const Q=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");Q&&N.tagName==="SPAN"&&(m.has(Q)||(u.push(N),m.add(Q)))}),d.forEach(N=>{const Q=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");!Q||m.has(Q)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(N.tagName)?N.querySelector(`span[data-comment="${Q}"], span[data-fake-comment="${Q}"]`)||(u.push(N),m.add(Q)):N.tagName!=="SPAN"&&(u.push(N),m.add(Q)))});const v=i.getBoundingClientRect(),h=r.getBoundingClientRect();u.forEach((N,Q)=>{let Y=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");if(!Y)return;if(typeof Y=="string"&&Y.startsWith("comment-")){const un=N.textContent?.trim(),Kn=b.comments?.find(Wn=>(typeof Wn.conversation_id=="string"&&Wn.conversation_id.startsWith("comment-")?null:Wn.conversation_id)&&Wn.selection_text?.trim()===un);Kn?(Y=String(Kn.conversation_id),N.setAttribute("data-comment",Y),N.removeAttribute("data-fake-comment")):(Y=String(Date.now()),N.setAttribute("data-comment",Y),N.removeAttribute("data-fake-comment"))}const Te=N.getBoundingClientRect(),me=window.getComputedStyle(N),ct=parseFloat(me.lineHeight)||parseFloat(me.fontSize)*1.2,Ut=Te.top-h.top+ct/2-15,en=h.top-v.top+Ut;let jt=null,Zn=null,rl=0;const kn=[],Fl=new Set;if(Y&&b.comments){const un=b.comments.find(Kn=>String(Kn.conversation_id||Kn.id)===String(Y));if(un){const Kn=un.conversation||[];Kn.length>0?(Kn.forEach(Wn=>{Wn.user&&Wn.user.id&&!Fl.has(Wn.user.id)&&(Fl.add(Wn.user.id),kn.push(Wn.user))}),rl=Kn.length):(rl=0,jt=null,Zn=null),kn.length>0?jt=kn[0]:jt=null,kn.length>1?Zn=kn[1]:Zn=null}}const $l=Te.top+ct/2-15,jn=$l+30,El=5,Vl=jn>h.top+El&&$l<h.bottom-El?1:0;vt.value.find(un=>un.id===Y);let gt=N;if(!gt&&Y&&p.value){const un=String(Y);gt=p.value.querySelector(`[data-comment="${un}"], [data-fake-comment="${un}"]`)}const zl=kn.length;a[Y]?(a[Y].top=en,a[Y].opacity=Vl,a[Y].element=gt,a[Y].firstUser=jt,a[Y].secondUser=Zn,a[Y].totalCount=rl,a[Y].uniqueUserCount=zl):a[Y]={id:Y,top:en,opacity:Vl,element:gt,firstUser:jt,secondUser:Zn,totalCount:rl,uniqueUserCount:zl}});const _=Object.values(a).map(N=>{const Q=Math.max(0,(N.uniqueUserCount??0)-2);if(!N.element&&N.id&&p.value){const Te=String(N.id);N.element=p.value.querySelector(`[data-comment="${Te}"], [data-fake-comment="${Te}"]`)}return{...N,firstUser:N.firstUser||null,secondUser:N.secondUser||null,totalCount:N.totalCount,additionalCount:Q}});(vt.value.length!==_.length||_.some((N,Q)=>{const Y=vt.value[Q];if(!Y)return!0;const Te=(Y.firstUser?.id||null)!==(N.firstUser?.id||null),me=(Y.secondUser?.id||null)!==(N.secondUser?.id||null);return Y.id!==N.id||Math.abs(Y.top-N.top)>1||Y.opacity!==N.opacity||Y.totalCount!==N.totalCount||Y.additionalCount!==N.additionalCount||Te||me||Y.element!==N.element}))&&(vt.value=_),Tn.value=!1}))},Lo=o=>{if(!o)return;let l=o.element;if(!l&&o.id&&p.value){const a=String(o.id);l=p.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}l&&(vl(),zn.value=l,l.classList.add("editor-comment-highlighted"))},vl=(o=!1)=>{!o&&mn.value!==null&&zn.value&&(zn.value.getAttribute("data-comment")||zn.value.getAttribute("data-fake-comment"))===mn.value||(p.value&&p.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),zn.value&&(zn.value.classList.remove("editor-comment-highlighted"),zn.value=null))},xl=o=>{if(!o||!o.element)return;vl(!0);const l=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!l)return;const a=`[data-comment="${l}"], [data-fake-comment="${l}"]`;Le("comment-marker-clicked",{commentId:l,selector:a,element:o.element})},to=()=>{vl()},no=()=>{!b.richText||!p.value||(Je.value&&Je.value.disconnect(),Zt.value!==null&&(clearTimeout(Zt.value),Zt.value=null),Je.value=new MutationObserver(()=>{Zt.value===null&&(Zt.value=setTimeout(()=>{Zt.value=null,e.nextTick(()=>{On("MutationObserver")})},200))}),Je.value.observe(p.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),On("setupCommentMarkersObserver-initial"))},sl=(o,l)=>{if(!o||!l)return;const a=l.getBoundingClientRect();let r=a.top,i=a.right+4;o.style.top=`${r}px`,o.style.left=`${i}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(()=>We.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const r=a.getAttribute("data-submenu-id");if(r===o&&o){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(i){if(a.parentNode!==document.body){const d=a.parentNode;a.dataset.originalParentRef=d===i?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{sl(a,i),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(()=>[ue.value,at.value],()=>{ue.value==="askAi"||at.value==="askAi"?e.nextTick(()=>{Bt()}):(We.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(l=>{if(l.parentNode===document.body){const a=l.getAttribute("data-submenu-id");if(a){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(r)if(l.dataset.originalParentRef==="inside")r.appendChild(l);else{const d=r.closest(".dss-toolbar-dropdown");d&&d.insertBefore(l,r.nextSibling)}}}})}))}),e.watch(()=>b.locale,o=>{o&&o!==_e.value&&(_e.value=o)},{immediate:!0}),Ce({openCommentOverlayForSelector:jl,updateCommentMarkers:On,restoreCommentsFromModel:Ql}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",Fn.value]),style:e.normalizeStyle(an.value)},[F.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",qc,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:w,title:e.unref(A)("textEditor.toolbar.undo")},[...l[45]||(l[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,Uc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!D.value}]),onClick:y,title:e.unref(A)("textEditor.toolbar.redo")},[...l[46]||(l[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,Xc),l[73]||(l[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Yc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=a=>It("paragraph")),title:e.unref(A)("textEditor.toolbar.paragraphFormat")},[tt.value==="h1"?(e.openBlock(),e.createElementBlock("svg",Kc,[...l[47]||(l[47]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):tt.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Gc,[...l[48]||(l[48]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):tt.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Qc,[...l[49]||(l[49]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):tt.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Jc,[...l[50]||(l[50]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):tt.value==="h5"?(e.openBlock(),e.createElementBlock("svg",eu,[...l[51]||(l[51]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):tt.value==="h6"?(e.openBlock(),e.createElementBlock("svg",tu,[...l[52]||(l[52]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",nu,[...l[53]||(l[53]=[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)])])),l[54]||(l[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,jc),ue.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[8]||(l[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[1]||(l[1]=a=>En("<h1>"))},[l[55]||(l[55]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"})],-1)),e.createElementVNode("h1",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[2]||(l[2]=a=>En("<h2>"))},[l[56]||(l[56]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"})],-1)),e.createElementVNode("h2",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[3]||(l[3]=a=>En("<h3>"))},[l[57]||(l[57]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"})],-1)),e.createElementVNode("h3",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[4]||(l[4]=a=>En("<h4>"))},[l[58]||(l[58]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"})],-1)),e.createElementVNode("h4",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[5]||(l[5]=a=>En("<h5>"))},[l[59]||(l[59]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"})],-1)),e.createElementVNode("h5",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[6]||(l[6]=a=>En("<h6>"))},[l[60]||(l[60]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"})],-1)),e.createElementVNode("h6",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[7]||(l[7]=a=>En("<p>"))},[l[61]||(l[61]=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(A)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("bold")}]),onClick:l[9]||(l[9]=a=>ot("bold")),title:e.unref(A)("textEditor.toolbar.bold")},[...l[62]||(l[62]=[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,lu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("italic")}]),onClick:l[10]||(l[10]=a=>ot("italic")),title:e.unref(A)("textEditor.toolbar.italic")},[...l[63]||(l[63]=[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,ou),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("underline")}]),onClick:l[11]||(l[11]=a=>ot("underline")),title:e.unref(A)("textEditor.toolbar.underline")},[...l[64]||(l[64]=[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,au),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":mt.value}]),onClick:ro,title:e.unref(A)("textEditor.toolbar.citation")},[...l[65]||(l[65]=[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,su),l[74]||(l[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:ql,title:e.unref(A)("textEditor.toolbar.removeLink")},[...l[67]||(l[67]=[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,iu)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:co,title:e.unref(A)("textEditor.toolbar.insertLink")},[...l[66]||(l[66]=[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,ru)),l[75]||(l[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("insertUnorderedList")}]),onClick:uo,title:e.unref(A)("textEditor.toolbar.bulletList")},[...l[68]||(l[68]=[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,cu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("insertOrderedList")}]),onClick:el,title:e.unref(A)("textEditor.toolbar.numberList")},[...l[69]||(l[69]=[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,uu),l[76]||(l[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Ft,title:e.unref(A)("textEditor.toolbar.image")},[...l[70]||(l[70]=[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,du),wt.value?(e.openBlock(),e.createElementBlock("div",mu)):e.createCommentVNode("",!0),wt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(A)("textEditor.toolbar.comment"),onClick:Xl},[...l[71]||(l[71]=[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,pu)):e.createCommentVNode("",!0),F.askAi?(e.openBlock(),e.createElementBlock("div",fu)):e.createCommentVNode("",!0),F.askAi?(e.openBlock(),e.createElementBlock("div",vu,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=a=>It("askAi")),title:e.unref(A)("textEditor.toolbar.askAi")},[l[72]||(l[72]=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:"#FFAF54"}),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:"#FFC963"})],-1)),e.createElementVNode("span",hu,e.toDisplayString(e.unref(A)("textEditor.toolbar.askAi")),1)],8,gu),ue.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[13]||(l[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",yu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Ke(a)?(e.openBlock(),e.createElementBlock("div",Cu,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),Ke(a)&&r<F.customToolbarSlots.length-1&&dn(r)?(e.openBlock(),e.createElementBlock("div",ku)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(ue.value==="paragraph"||ue.value==="askAi")&&F.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:At})):e.createCommentVNode("",!0),e.createVNode(Ao,{showModal:De.value,width:"500px",height:"55vh",onCloseModal:Dn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(A)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",bu,[e.createElementVNode("div",wu,[e.createElementVNode("label",xu,e.toDisplayString(e.unref(A)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Oe,type:"text","onUpdate:modelValue":l[15]||(l[15]=a=>O.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Jn,["enter"])},null,40,Eu),[[e.vModelText,O.value]])]),e.createElementVNode("div",Vu,[e.createElementVNode("label",Nu,e.toDisplayString(e.unref(A)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:rt,type:"text","onUpdate:modelValue":l[16]||(l[16]=a=>Ie.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Jn,["enter"])},null,40,Su),[[e.vModelText,Ie.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Dn},e.toDisplayString(e.unref(A)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Jn},e.toDisplayString(e.unref(A)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Ao,{showModal:_t.value,width:"500px",height:"80vh",onCloseModal:wl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Xe.value?e.unref(A)("textEditor.image.editImage"):e.unref(A)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Bu,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":fe.value==="upload"}]),onClick:l[17]||(l[17]=a=>fe.value="upload")},e.toDisplayString(e.unref(A)("textEditor.image.upload")),3),l[77]||(l[77]=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":fe.value==="url"}]),onClick:l[18]||(l[18]=a=>fe.value="url")},e.toDisplayString(e.unref(A)("textEditor.image.imageLink")),3)]),fe.value==="upload"?(e.openBlock(),e.createElementBlock("div",Mu,[e.createElementVNode("div",_u,[e.createElementVNode("div",$u,[Be.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Tu,e.toDisplayString(e.unref(A)("textEditor.image.uploadImage")),1)),Be.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:$o},[e.createElementVNode("img",{src:Et.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Lu),l[78]||(l[78]=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:Lt,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:ln},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Lt,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:ln},null,544))]),e.createElementVNode("div",Hu,[e.createElementVNode("label",Au,e.toDisplayString(e.unref(A)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Dt,type:"text","onUpdate:modelValue":l[19]||(l[19]=a=>Ot.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Mt,["enter"])},null,40,Du),[[e.vModelText,Ot.value]])]),e.createElementVNode("div",Ru,[e.createElementVNode("label",Fu,e.toDisplayString(e.unref(A)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=a=>lt.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(Mt,["enter"]),onInput:bo},null,40,Iu),[[e.vModelText,lt.value]])]),e.createElementVNode("div",zu,[e.createElementVNode("label",Pu,e.toDisplayString(e.unref(A)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=a=>je.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(Mt,["enter"]),onInput:Dl},null,40,Ou),[[e.vModelText,je.value]])])])])):e.createCommentVNode("",!0),fe.value==="url"?(e.openBlock(),e.createElementBlock("div",Zu,[e.createElementVNode("div",Wu,[e.createElementVNode("div",qu,[e.createElementVNode("label",Uu,e.toDisplayString(e.unref(A)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:$t,type:"text","onUpdate:modelValue":l[22]||(l[22]=a=>Ve.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(Mt,["enter"])},null,40,Xu),[[e.vModelText,Ve.value]])]),e.createElementVNode("div",Yu,[e.createElementVNode("label",ju,e.toDisplayString(e.unref(A)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=a=>Ot.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Mt,["enter"])},null,40,Ku),[[e.vModelText,Ot.value]])]),e.createElementVNode("div",Gu,[e.createElementVNode("label",Qu,e.toDisplayString(e.unref(A)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=a=>lt.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(Mt,["enter"]),onInput:bo},null,40,Ju),[[e.vModelText,lt.value]])]),e.createElementVNode("div",ed,[e.createElementVNode("label",td,e.toDisplayString(e.unref(A)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=a=>je.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(Mt,["enter"]),onInput:Dl},null,40,nd),[[e.vModelText,je.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:wl},e.toDisplayString(e.unref(A)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Mt},e.toDisplayString(e.unref(A)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":wn.value&&Ae.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.labels.title")),1),e.createElementVNode("div",ld,[Ae.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",od,[F.title?(e.openBlock(),e.createElementBlock("span",ad,e.toDisplayString(F.title),1)):(e.openBlock(),e.createElementBlock("span",sd,e.toDisplayString(nt.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:V,value:F.title,onInput:An,onFocus:hn,onBlur:Zl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Ae.value}]),placeholder:nt.value,disabled:F.disabled,rows:"1"},null,42,rd)])],2),wn.value&&Ae.value?(e.openBlock(),e.createElementBlock("div",id,[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":sn.value&&re.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.labels.description")),1),e.createElementVNode("div",cd,[re.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ud,[F.description?(e.openBlock(),e.createElementBlock("span",dd,e.toDisplayString(F.description),1)):(e.openBlock(),e.createElementBlock("span",md,e.toDisplayString(st.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:P,value:F.description,onInput:Me,onFocus:hl,onBlur:Ll,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!re.value}]),placeholder:st.value,disabled:F.disabled,rows:"1"},null,42,pd)])],2),sn.value&&re.value?(e.openBlock(),e.createElementBlock("div",fd,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vt.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":mn.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=>Lo(a),onMouseleave:to},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>xl(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,hd)):(e.openBlock(),e.createElementBlock("span",yd,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,gd)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>xl(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,kd)):(e.openBlock(),e.createElementBlock("span",bd,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,Cd)):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=>xl(a),["stop"])},[e.createElementVNode("span",xd,"+"+e.toDisplayString(a.additionalCount),1)],12,wd)):e.createCommentVNode("",!0)],46,vd))),128)),F.richText?(e.openBlock(),e.createElementBlock("div",_d,[e.createElementVNode("div",{ref_key:"editorRef",ref:p,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":F.disabled,"dss-text-editor-fixed-height":F.fixedHeight}]),style:e.normalizeStyle(cl.value),onInput:Se,onBlur:Hl,onClick:ho,onMouseup:yl,onKeyup:yl,onKeydown:fn,onPaste:Pn,onMousemove:Ml,onMouseleave:Bo},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[mn.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(ml.value)},[tl.value||_n.value.length>0?(e.openBlock(),e.createElementBlock("div",$d,[e.createElementVNode("div",Td,[tl.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:tl.value},null,8,Ld)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Hd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_n.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",Ad,[e.createElementVNode("div",Dd,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,Rd)):(e.openBlock(),e.createElementBlock("span",Fd,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Id,[e.createElementVNode("div",zd,[e.createElementVNode("div",Pd,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",Od,e.toDisplayString(Tl(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":Sl(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),b.commentUser&&a.user&&a.user.id===b.commentUser.id&&!Sl(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(i=>vo(a,r),["stop"]),title:e.unref(A)("textEditor.comment.delete")||"Delete comment"},[...l[80]||(l[80]=[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,Zd)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Wd,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:Gn,"onUpdate:modelValue":l[26]||(l[26]=a=>Cn.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(A)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Al,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(Gn.value){const a=Gn.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,qd),[[e.vModelText,Cn.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Al,["stop"])},[...l[81]||(l[81]=[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",Ud,[e.createElementVNode("div",Xd,[e.createElementVNode("span",Yd,e.toDisplayString(R.value)+" "+e.toDisplayString(R.value===1?e.unref(A)("textEditor.footer.word"):e.unref(A)("textEditor.footer.words")),1),l[82]||(l[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",jd,e.toDisplayString(le.value)+" "+e.toDisplayString(le.value===1?e.unref(A)("textEditor.footer.character"):e.unref(A)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Ed,[e.createElementVNode("textarea",{value:F.modelValue,onInput:gl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":F.fixedHeight}]),placeholder:Qe.value,rows:F.rows,disabled:F.disabled,style:e.normalizeStyle(qn.value)},null,46,Vd),e.createElementVNode("div",Nd,[e.createElementVNode("div",Sd,[e.createElementVNode("span",Bd,e.toDisplayString(R.value)+" "+e.toDisplayString(R.value===1?e.unref(A)("textEditor.footer.word"):e.unref(A)("textEditor.footer.words")),1),l[79]||(l[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Md,e.toDisplayString(le.value)+" "+e.toDisplayString(le.value===1?e.unref(A)("textEditor.footer.character"):e.unref(A)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ee.value&&S.value&&p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(ne.value),onMouseenter:l[28]||(l[28]=a=>He.value=!0),onMouseleave:kl},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Mo,["stop"]),title:S.value},e.toDisplayString(S.value),9,Kd),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(_o,["stop"]),title:e.unref(A)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Qd,[...l[83]||(l[83]=[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,Gd)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Xt.value&&Ct.value&&p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(te.value),onMouseenter:l[29]||(l[29]=a=>$e.value=!0),onMouseleave:bl},[e.createElementVNode("div",Jd,[Ct.value===e.unref(A)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",e1,[...l[84]||(l[84]=[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:Ct.value},e.toDisplayString(Ct.value),9,t1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(To,["stop"]),title:e.unref(A)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",l1,[...l[85]||(l[85]=[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,n1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[F.floatingToolbar&&F.richText&&ge.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Vt,class:"dss-floating-toolbar",style:e.normalizeStyle(yt.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",o1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(w,["stop"]),title:e.unref(A)("textEditor.toolbar.undo")},[...l[86]||(l[86]=[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,a1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!D.value}]),onClick:e.withModifiers(y,["stop"]),title:e.unref(A)("textEditor.toolbar.redo")},[...l[87]||(l[87]=[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,s1),l[107]||(l[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",r1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(a=>Kl("paragraph"),["stop"])),title:e.unref(A)("textEditor.toolbar.paragraphFormat")},[tt.value==="h1"?(e.openBlock(),e.createElementBlock("svg",c1,[...l[88]||(l[88]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):tt.value==="h2"?(e.openBlock(),e.createElementBlock("svg",u1,[...l[89]||(l[89]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):tt.value==="h3"?(e.openBlock(),e.createElementBlock("svg",d1,[...l[90]||(l[90]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):tt.value==="h4"?(e.openBlock(),e.createElementBlock("svg",m1,[...l[91]||(l[91]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):tt.value==="h5"?(e.openBlock(),e.createElementBlock("svg",p1,[...l[92]||(l[92]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):tt.value==="h6"?(e.openBlock(),e.createElementBlock("svg",f1,[...l[93]||(l[93]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",v1,[...l[94]||(l[94]=[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)])])),l[95]||(l[95]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,i1),at.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[38]||(l[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[31]||(l[31]=a=>$n("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[32]||(l[32]=a=>$n("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[33]||(l[33]=a=>$n("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[34]||(l[34]=a=>$n("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[35]||(l[35]=a=>$n("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[36]||(l[36]=a=>$n("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[37]||(l[37]=a=>$n("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),l[108]||(l[108]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(a=>ot("bold"),["stop"])),title:e.unref(A)("textEditor.toolbar.bold")},[...l[96]||(l[96]=[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,g1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(a=>ot("italic"),["stop"])),title:e.unref(A)("textEditor.toolbar.italic")},[...l[97]||(l[97]=[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,h1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(a=>ot("underline"),["stop"])),title:e.unref(A)("textEditor.toolbar.underline")},[...l[98]||(l[98]=[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,y1),l[109]||(l[109]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":mt.value}]),onClick:e.withModifiers(ro,["stop"]),title:e.unref(A)("textEditor.toolbar.citation")},[...l[99]||(l[99]=[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,C1),l[110]||(l[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(ql,["stop"]),title:e.unref(A)("textEditor.toolbar.removeLink")},[...l[101]||(l[101]=[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,b1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(co,["stop"]),title:e.unref(A)("textEditor.toolbar.insertLink")},[...l[100]||(l[100]=[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,k1)),l[111]||(l[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("insertUnorderedList")}]),onClick:e.withModifiers(uo,["stop"]),title:e.unref(A)("textEditor.toolbar.bulletList")},[...l[102]||(l[102]=[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,w1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht("insertOrderedList")}]),onClick:e.withModifiers(el,["stop"]),title:e.unref(A)("textEditor.toolbar.numberList")},[...l[103]||(l[103]=[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,x1),l[112]||(l[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Ft,["stop"]),title:e.unref(A)("textEditor.toolbar.image")},[...l[104]||(l[104]=[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,E1),l[113]||(l[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(A)("textEditor.toolbar.comment"),onClick:e.withModifiers(Xl,["stop"])},[...l[105]||(l[105]=[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,V1),F.askAi?(e.openBlock(),e.createElementBlock("div",N1)):e.createCommentVNode("",!0),F.askAi?(e.openBlock(),e.createElementBlock("div",S1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(a=>Kl("askAi"),["stop"])),title:e.unref(A)("textEditor.toolbar.askAi")},[l[106]||(l[106]=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:"#FFAF54"}),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:"#FFC963"})],-1)),e.createElementVNode("span",M1,e.toDisplayString(e.unref(A)("textEditor.toolbar.askAi")),1)],8,B1),at.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[43]||(l[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Hn.value?(e.openBlock(),e.createElementBlock("div",_1,[F.askAi&&Hn.value?(e.openBlock(),e.createElementBlock("div",$1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Ke(a)&&tn(a)?(e.openBlock(),e.createElementBlock("div",T1,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),Ke(a)&&tn(a)&&r<F.customToolbarSlots.length-1&&Ln(r)?(e.openBlock(),e.createElementBlock("div",L1)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),D1={class:"dss-color-picker__section-title"},R1={class:"dss-color-picker__presets-row"},F1=["title","onClick"],I1={key:1,class:"dss-color-picker__section"},z1={class:"dss-color-picker__presets-row"},P1=["title","onClick"],O1={class:"dss-color-picker__section"},Z1={class:"dss-color-picker__section-header"},W1={class:"dss-color-picker__presets-row"},q1=["title","onClick"],U1=["onClick"],X1={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},Y1=["title","onClick"],j1={class:"dss-color-picker__input-row"},K1=["value"],G1={__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(F,{emit:Ce}){function z(X){const Z=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(X);if(!Z)return{h:0,s:0,l:50};const j=parseInt(Z[1],16)/255,ie=parseInt(Z[2],16)/255,E=parseInt(Z[3],16)/255,C=Math.max(j,ie,E),V=Math.min(j,ie,E);let P=0,U=0;const ze=(C+V)/2;if(C!==V){const Re=C-V;switch(U=ze>.5?Re/(2-C-V):Re/(C+V),C){case j:P=((ie-E)/Re+(ie<E?6:0))/6;break;case ie:P=((E-j)/Re+2)/6;break;case E:P=((j-ie)/Re+4)/6;break}}return{h:P*360,s:U*100,l:ze*100}}function A(X,Z,j){Z/=100,j/=100;const ie=Z*Math.min(j,1-j),E=C=>{const V=(C+X/30)%12,P=j-ie*Math.max(Math.min(V-3,9-V,1),-1);return Math.round(255*P).toString(16).padStart(2,"0")};return`#${E(0)}${E(8)}${E(4)}`}function _e(X){const Z=X.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!Z)return null;let j=Z[1];return j.length===3&&(j=j.split("").map(ie=>ie+ie).join("")),"#"+j}function b(X,Z,j){Z/=100,j/=100;const ie=j+Z*Math.min(j,1-j),E=ie===0?0:2-2*j/ie;return{h:X,s:E*100,v:ie*100}}function Le(X,Z,j){Z/=100,j/=100;const ie=j*(1-Z/2),E=ie===0||ie===1?0:(j-ie)/Math.min(ie,1-ie);return{h:X,s:E*100,l:ie*100}}const ae=F,pt=Ce,p=e.ref(!1),ue=e.ref(!1),ve=e.ref(!1),de=e.ref(-1),ee=e.ref(-1),S=e.ref(null),ne=e.ref(null),He=e.ref(null),De=e.ref(null),Ie=e.ref({top:0,left:0}),O=e.ref(z(ae.modelValue||"#b8a5de")),rt=e.computed(()=>Array.isArray(ae.presetGroups)&&ae.presetGroups.length>0),Oe=e.computed(()=>rt.value?0:ae.initialPresetCount!=null?ae.initialPresetCount:ee.value<0?null:ee.value),we=e.computed(()=>{const X=Oe.value;return X==null?!0:Math.max(0,ae.presetColors.length-X)<ae.max}),xt=e.computed(()=>!!(ue.value||de.value>=0||!Tt.value&&ae.presetColors.length===0));e.computed(()=>{const X=Oe.value;return X!=null&&ae.presetColors.length>X});const Tt=e.computed(()=>rt.value||Oe.value!=null),mt=e.computed(()=>{const X=Oe.value;return X==null?[]:ae.presetColors.slice(0,X)}),Ze=e.computed(()=>{const X=Oe.value;return X==null?[]:ae.presetColors.slice(X)});function ge(X){const Z=Oe.value;return Z!=null?Z+X:-1}function yt(X){const Z=Oe.value;return Z!=null&&X>=Z}function Vt(X){yt(X)&&(de.value=X,O.value=z(ae.presetColors[X]),ue.value=!0,e.nextTick(()=>De.value?.focus()))}function at(X){if(!yt(X))return;const Z=ae.presetColors.filter((E,C)=>C!==X);pt("update:presetColors",Z);const j=_e(ae.modelValue),ie=_e(ae.presetColors[X]);if(j&&ie&&j.toLowerCase()===ie.toLowerCase()){const E=Z[Math.max(0,X-1)]||Z[0];E&&pt("update:modelValue",E)}}function _t(){ve.value=!ve.value,ve.value||(de.value=-1,ue.value=!1)}function Ot(){if(de.value<0)return;const X=je.value,Z=_e(X);if(Z){const j=[...ae.presetColors];j[de.value]=Z,pt("update:presetColors",j),pt("update:modelValue",Z),de.value=-1,ue.value=!1}}function on(){ae.disabled||(de.value=-1,ue.value=!ue.value,ue.value&&(Ct(),e.nextTick(()=>De.value?.focus())))}function Et(X){const Z=_e(X),j=_e(ae.modelValue);return Z&&j&&Z.toLowerCase()===j.toLowerCase()}function lt(){if(ae.disabled||!we.value)return;const X=je.value,Z=_e(X);if(Z){const j=[...ae.presetColors,Z];pt("update:presetColors",j),pt("update:modelValue",Z);const ie=Oe.value??ee.value;ie>=0&&j.length-ie>=ae.max&&(ue.value=!1)}}const je=e.computed(()=>{const{h:X,s:Z,l:j}=O.value;return A(X,Z,j)}),Dt=e.computed(()=>je.value.toLowerCase()),Lt=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${O.value.h}, 100%, 50%))`})),$t=e.computed(()=>{const X=b(O.value.h,O.value.s,O.value.l);return{left:`${X.s}%`,bottom:`${X.v}%`,transform:"translate(-50%, 50%)"}}),Xe=e.computed(()=>({left:`${O.value.h/360*100}%`,transform:"translateX(-50%)"})),Gt=e.computed(()=>({position:"fixed",left:`${Ie.value.left}px`,top:`${Ie.value.top}px`,zIndex:1002}));function Xt(){if(!S.value||!p.value)return;const X=S.value.getBoundingClientRect(),Z=window.innerHeight||document.documentElement.clientHeight;let j=X.bottom+4;const ie=ne.value;ie&&j+ie.offsetHeight>Z-8&&(j=X.top-4-ie.offsetHeight),Ie.value={top:j,left:X.left}}function Ct(){const X=ae.modelValue||"#b8a5de";_e(X)&&(O.value=z(X))}function te(){pt("update:modelValue",je.value)}function $e(){ae.disabled||(p.value=!p.value,p.value&&(Ct(),e.nextTick(()=>{Xt(),De.value?.focus()})))}function fe(){const X=je.value,Z=_e(X);if(Z){if(de.value>=0){const j=[...ae.presetColors];j[de.value]=Z,pt("update:presetColors",j),pt("update:modelValue",Z)}else if((ae.presetColors.length>0||rt.value)&&ue.value&&we.value&&!ae.presetColors.some(ie=>_e(ie)?.toLowerCase()===Z.toLowerCase())){const ie=[...ae.presetColors,Z];pt("update:presetColors",ie),pt("update:modelValue",Z)}}p.value=!1,ue.value=!1,ve.value=!1,de.value=-1}function Ve(X){if(!He.value)return;const Z=He.value.getBoundingClientRect(),j=ie=>{const E=Math.max(0,Math.min(1,(ie.clientX-Z.left)/Z.width)),C=Math.max(0,Math.min(1,1-(ie.clientY-Z.top)/Z.height)),V={h:O.value.h,s:E*100,v:C*100};O.value=Le(V.h,V.s,V.v)};j(X),document.addEventListener("mousemove",j),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",j),te()},{once:!0})}function We(X){if(!X.currentTarget)return;const j=X.currentTarget.getBoundingClientRect(),ie=E=>{const C=Math.max(0,Math.min(1,(E.clientX-j.left)/j.width));O.value={...O.value,h:C*360}};ie(X),document.addEventListener("mousemove",ie),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ie),te()},{once:!0})}function ft(X){const Z=X.target.value,j=_e(Z);j&&(O.value=z(j),pt("update:modelValue",j))}function qe(X){if(ae.disabled)return;const Z=_e(X);Z&&(O.value=z(Z),pt("update:modelValue",Z))}let ut=null,xe=null;function Ue(){ut&&(document.removeEventListener("keydown",ut),ut=null),xe&&(window.removeEventListener("resize",xe),xe=null)}return e.watch(p,X=>{if(Ue(),X){if(!rt.value&&ae.initialPresetCount==null){const Z=ae.presetColors.length;Z>0&&(ee.value<0||Z<ee.value)&&(ee.value=Z)}ut=Z=>{Z.key==="Escape"&&fe()},xe=Xt,document.addEventListener("keydown",ut),window.addEventListener("resize",xe)}}),e.watch(()=>ae.modelValue,()=>{p.value&&Ct()},{immediate:!1}),e.watch(Ze,X=>{X.length===0&&(ve.value=!1,de.value=-1,ue.value=!1)}),e.onBeforeUnmount(Ue),(X,Z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":F.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:S,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":p.value}]),onClick:$e},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:je.value})},[...Z[0]||(Z[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"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(fe,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ne,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Gt.value)},[Tt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[rt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(F.presetGroups,(j,ie)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ie,class:"dss-color-picker__section"},[e.createElementVNode("span",D1,e.toDisplayString(j.title),1),e.createElementVNode("div",R1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.colors,(E,C)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ie+"-"+C,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Et(E)}]),style:e.normalizeStyle({backgroundColor:E}),title:E,onClick:e.withModifiers(V=>qe(E),["stop"])},null,14,F1))),128))])]))),128)):mt.value.length?(e.openBlock(),e.createElementBlock("div",I1,[Z[1]||(Z[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",z1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt.value,(j,ie)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ie,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Et(j)}]),style:e.normalizeStyle({backgroundColor:j}),title:j,onClick:e.withModifiers(E=>qe(j),["stop"])},null,14,P1))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",O1,[e.createElementVNode("div",Z1,[Z[3]||(Z[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),Ze.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":ve.value}]),title:"Manage custom colors",onClick:e.withModifiers(_t,["stop"])},[...Z[2]||(Z[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",W1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,(j,ie)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ie,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":ve.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!ve.value&&Et(j),"dss-color-picker__preset-bubble--editing":ve.value&&de.value===ge(ie)}]),style:e.normalizeStyle({backgroundColor:de.value===ge(ie)?je.value:j}),title:de.value===ge(ie)?je.value:j,onClick:e.withModifiers(E=>ve.value?Vt(ge(ie)):qe(j),["stop"])},null,14,q1),ve.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(E=>at(ge(ie)),["stop"])},[...Z[4]||(Z[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,U1)):e.createCommentVNode("",!0)],2))),128)),we.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ue.value}]),onClick:e.withModifiers(on,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):F.presetColors.length?(e.openBlock(),e.createElementBlock("div",X1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.presetColors,(j,ie)=>(e.openBlock(),e.createElementBlock("button",{key:ie,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Et(j)}]),style:e.normalizeStyle({backgroundColor:j}),title:j,onClick:e.withModifiers(E=>qe(j),["stop"])},null,14,Y1))),128)),we.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ue.value}]),onClick:e.withModifiers(on,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),xt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:He,onMousedown:Ve},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(Lt.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle($t.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:We},[Z[5]||(Z[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(Xe.value)},null,4)],32),e.createElementVNode("div",j1,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:De,type:"text",class:"dss-color-picker__hex-input",value:Dt.value,onInput:ft},null,40,K1)]),Tt.value&&(F.presetColors.length||rt.value)&&we.value&&de.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:lt}," Save color ")):e.createCommentVNode("",!0),Tt.value&&de.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Ot}," Save color ")):e.createCommentVNode("",!0),Tt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:fe}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},Q1={key:0,class:"dss-loader"},J1={key:0,class:"dss-loader-label"},em={key:1,class:"dss-loader"},tm={key:0,class:"dss-loader-label"},nm={key:2,class:"dss-loader"},lm={key:0,class:"dss-loader-label"},om={key:3,class:"dss-loader"},am={key:0,class:"dss-loader-label"},sm={key:4,class:"dss-loader"},rm={key:0,class:"dss-loader-label"},im={key:5,class:"dss-loader dss-loader--inline"},cm={class:"dss-loader-inline-text"},um={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"}},setup(F){const Ce=F,z=e.computed(()=>Ce.size==="small"?"dss-loaders--size-small":Ce.size==="large"?"dss-loaders--size-large":Ce.size==="medium"||Ce.size==null?"dss-loaders--size-medium":null),A=e.computed(()=>Ce.size==="small"||Ce.size==="medium"||Ce.size==="large"||Ce.size==null?{}:{"--dss-loader-size":typeof Ce.size=="number"?`${Ce.size}px`:String(Ce.size)});return(_e,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",z.value]),style:e.normalizeStyle(A.value)},[F.type==="spinner"?(e.openBlock(),e.createElementBlock("div",Q1,[b[0]||(b[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),F.label?(e.openBlock(),e.createElementBlock("span",J1,e.toDisplayString(F.label),1)):e.createCommentVNode("",!0)])):F.type==="dots"?(e.openBlock(),e.createElementBlock("div",em,[b[1]||(b[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)),F.label?(e.openBlock(),e.createElementBlock("span",tm,e.toDisplayString(F.label),1)):e.createCommentVNode("",!0)])):F.type==="battery"?(e.openBlock(),e.createElementBlock("div",nm,[b[2]||(b[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),F.label?(e.openBlock(),e.createElementBlock("span",lm,e.toDisplayString(F.label),1)):e.createCommentVNode("",!0)])):F.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",om,[b[3]||(b[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)),F.label?(e.openBlock(),e.createElementBlock("span",am,e.toDisplayString(F.label),1)):e.createCommentVNode("",!0)])):F.type==="bars"?(e.openBlock(),e.createElementBlock("div",sm,[b[4]||(b[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)),F.label?(e.openBlock(),e.createElementBlock("span",rm,e.toDisplayString(F.label),1)):e.createCommentVNode("",!0)])):F.type==="inline"?(e.openBlock(),e.createElementBlock("div",im,[b[5]||(b[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",cm,[e.renderSlot(_e.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(F.label),1)])])])):e.createCommentVNode("",!0)],6))}},Xo="dss-skeleton-item",dm={__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:F=>["single","multiple"].includes(F)},targetClass:{type:String,default:Xo},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(F){const Ce=F,z=e.computed(()=>{const b={"dss-skeleton--loading":Ce.loading,"dss-skeleton--static":!Ce.shimmer,"dss-skeleton--multiple":Ce.mode==="multiple","dss-skeleton--dark":Ce.darkMode};return Ce.mode==="multiple"&&Ce.targetClass!==Xo&&(b[`dss-skeleton--target-${Ce.targetClass}`]=!0),b}),A=e.computed(()=>{const b={};return Ce.borderRadius&&(b.borderRadius=Ce.borderRadius),b}),_e=e.computed(()=>{const b={};return Ce.borderRadius&&(b["--dss-skeleton-border-radius"]=Ce.borderRadius),Ce.darkMode?(b["--dss-skeleton-bg"]=Ce.bgDark||"#322c3f",b["--dss-skeleton-shimmer"]=Ce.shimmerDark||"#3e3f41",b):(Ce.bgColor&&(b["--dss-skeleton-bg"]=Ce.bgColor),Ce.shimmerColor&&(b["--dss-skeleton-shimmer"]=Ce.shimmerColor),b)});return(b,Le)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",z.value]),style:e.normalizeStyle(_e.value)},[F.loading&&F.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(A.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":F.loading&&F.mode==="single"}])},[e.renderSlot(b.$slots,"default")],2)],6))}},mm={key:0,class:"dss-dnd-column-header"},pm={class:"dss-dnd-column-title"},fm={class:"dss-dnd-column-count"},vm=["data-column"],gm={key:0,class:"dss-dnd-indicator"},hm=["onPointerdown"],ym=["onPointerdown"],Cm={class:"dss-dnd-item-content"},km={class:"dss-dnd-item-default"},bm={key:0,class:"dss-dnd-empty"},wm={name:"DSSDnd"},xm=Object.assign(wm,{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(F,{emit:Ce}){const z=F,A=Ce,_e=e.useSlots(),b=e.computed(()=>!!_e["delete-zone"]),Le={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1},ae=e.computed(()=>({...Le,...z.options})),pt=e.computed(()=>({"--dss-dnd-col-min-w":ae.value.columnMinWidth,"--dss-dnd-col-max-w":ae.value.columnMaxWidth,"--dss-dnd-col-gap":ae.value.columnGap,"--dss-dnd-indicator-color":ae.value.indicatorColor,"--dss-dnd-body-max-h":ae.value.columnBodyMaxHeight})),p=e.ref(null),ue=e.ref(null),ve=e.ref(!1),de=e.ref(-1),ee=e.ref(null);let S=null,ne=null,He=null,De=null,Ie=0,O=0,rt="",Oe=null;const we=5,xt=e.computed(()=>{const te={};for(const $e of z.columns)te[$e.value]=z.items.filter(fe=>fe[z.columnKey]===$e.value).sort((fe,Ve)=>(fe[z.positionKey]??0)-(Ve[z.positionKey]??0));return te}),Tt=e.computed(()=>{const te={},$e=!!p.value,fe=p.value?.[z.itemKey],Ve=ue.value,We=de.value;for(const ft of z.columns){const qe=xt.value[ft.value]||[],ut=[],xe=Ve==ft.value;let Ue=0;for(let X=0;X<qe.length;X++){const Z=qe[X],j=$e&&Z[z.itemKey]===fe;!j&&xe&&We===Ue&&ut.push({type:"indicator",key:`ind-${Ue}`}),j||Ue++,ut.push({type:"item",item:Z,isDragged:j,key:`item-${Z[z.itemKey]}`})}xe&&We>=Ue&&ut.push({type:"indicator",key:"ind-end"}),te[ft.value]=ut}return te});function mt(te,$e){const Ve=(xt.value[te]||[]).filter(qe=>qe[z.itemKey]!==p.value?.[z.itemKey]);if(Ve.length===0)return 1;if($e<=0){const qe=Ve[0][z.positionKey];return qe!=null&&qe>0?qe/2:.5}if($e>=Ve.length){const qe=Ve[Ve.length-1][z.positionKey];return(qe??0)+1}const We=Ve[$e-1][z.positionKey]??0,ft=Ve[$e][z.positionKey]??0;return(We+ft)/2}function Ze(te,$e,fe){He&&He.remove();const Ve=te.getBoundingClientRect(),We=te.cloneNode(!0);We.classList.add("dss-dnd-ghost"),We.style.cssText=`
104
104
  position: fixed;
105
- left: ${_e-Re}px;
105
+ left: ${$e-Ie}px;
106
106
  top: ${fe-O}px;
107
- width: ${Se.width}px;
108
- height: ${Se.height}px;
107
+ width: ${Ve.width}px;
108
+ height: ${Ve.height}px;
109
109
  z-index: 9999;
110
110
  pointer-events: none;
111
- opacity: ${se.value.dragGhostOpacity};
111
+ opacity: ${ae.value.dragGhostOpacity};
112
112
  box-sizing: border-box;
113
113
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
114
- background-color: ${se.value.dragSourceBackground};
114
+ background-color: ${ae.value.dragSourceBackground};
115
115
  font-family: 'Work Sans', sans-serif;
116
116
  cursor: grabbing;
117
- `,document.body.appendChild(Pe),Le=Pe}function ge(te,_e){Le&&(Le.style.left=`${te-Re}px`,Le.style.top=`${_e-O}px`)}function gt(te){te.classList.add("dss-dnd-item--dragging"),te.style.background=se.value.dragSourceBackground,te.style.borderColor=se.value.dragSourceBorder,te.style.transform="scale(0.97)"}function Et(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 St(te,_e){return!!document.elementFromPoint(te,_e)?.closest("[data-dss-dnd-delete-zone]")}function Wt(te,_e){if(b.value&&St(te,_e)){ve.value=!0,ue.value=null,de.value=-1;return}ve.value=!1;const fe=st(te,_e),Se=fe?.getAttribute("data-column")??null;if(!Se){ue.value=null,de.value=-1;return}ue.value=Se;const Pe=fe.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let ft=Pe.length;for(let Ze=0;Ze<Pe.length;Ze++){const ut=Pe[Ze].getBoundingClientRect();if(_e<ut.top+ut.height/2){ft=Ze;break}}de.value=ft}function on(te){te.preventDefault(),ge(te.clientX,te.clientY),!S&&(S=requestAnimationFrame(()=>{S=null,Wt(te.clientX,te.clientY)}))}function xt(te){window.removeEventListener("pointermove",on),window.removeEventListener("pointerup",xt),window.removeEventListener("pointercancel",xt),Ae?.releasePointerCapture?.(te.pointerId),Et(Ae),Ae=null;const _e=b.value&&St(te.clientX,te.clientY);if(p.value&&_e)D("delete",{item:p.value});else{const Se=st(te.clientX,te.clientY)?.getAttribute("data-column")??null;if(p.value&&Se){const Pe=p.value[z.columnKey],ft=Se,ut=(wt.value[ft]||[]).filter(U=>U[z.itemKey]!==p.value[z.itemKey]),Ee=Math.max(0,Math.min(de.value,ut.length)),Qe=mt(ft,Ee),q=p.value[z.itemKey];D("move",{item:p.value,from:Pe,to:ft,position:Qe,index:Ee}),le&&clearTimeout(le),ee.value={id:q,from:Pe,to:ft},le=setTimeout(()=>{ee.value=null},3500)}}Le&&(Le.remove(),Le=null),ct!==null&&(document.body.style.cursor=ct,ct=""),ht()}function et(te,_e){te.preventDefault();const fe=te.target.closest(".dss-dnd-item");if(!fe)return;const Se=fe.getBoundingClientRect();Re=te.clientX-Se.left,O=te.clientY-Se.top,ct=document.body.style.cursor,document.body.style.cursor="grabbing",p.value=_e,Ae=fe,ze(fe,te.clientX,te.clientY),requestAnimationFrame(()=>gt(fe)),fe.setPointerCapture?.(te.pointerId),window.addEventListener("pointermove",on),window.addEventListener("pointerup",xt,{once:!0}),window.addEventListener("pointercancel",xt,{once:!0})}function Ye(){Ie&&(window.removeEventListener("pointermove",Ft),window.removeEventListener("pointerup",$t),window.removeEventListener("pointercancel",$t),Ie=null)}function Ft(te){if(!Ie||te.pointerId!==Ie.pointerId)return;const _e=te.clientX-Ie.startX,fe=te.clientY-Ie.startY;if(Math.abs(_e)>=xe||Math.abs(fe)>=xe){const Se=Ie.item;Ye(),et(te,Se)}}function $t(te){!Ie||te.pointerId!==Ie.pointerId||Ye()}function Bt(te,_e){Ye(),Ie={item:_e,startX:te.clientX,startY:te.clientY,pointerId:te.pointerId},window.addEventListener("pointermove",Ft),window.addEventListener("pointerup",$t),window.addEventListener("pointercancel",$t)}function Ue(te,_e){se.value.useHandle||Bt(te,_e)}function Yt(te,_e){Bt(te,_e)}function Ut(){S&&(cancelAnimationFrame(S),S=null)}function ht(){Ut(),p.value=null,ue.value=null,ve.value=!1,de.value=-1}return e.onBeforeUnmount(()=>{Ut(),Ye(),le&&clearTimeout(le),Le&&(Le.remove(),Le=null)}),(te,_e)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":se.value.unstyled}]),style:e.normalizeStyle(pt.value)},[b.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":ve.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(te.$slots,"delete-zone",{isDragging:!!p.value,isOver:ve.value})],2),[[e.vShow,!!p.value||se.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.columns,fe=>(e.openBlock(),e.createElementBlock("div",{key:fe.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":ue.value==fe.value},fe.class||""]])},[se.value.showHeader?(e.openBlock(),e.createElementBlock("div",dm,[e.renderSlot(te.$slots,"column-header",{column:fe,items:wt.value[fe.value]||[]},()=>[e.createElementVNode("span",mm,e.toDisplayString(fe.title||fe.value),1),e.createElementVNode("span",pm,e.toDisplayString((wt.value[fe.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":fe.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_t.value[fe.value],Se=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Se.key},[Se.type==="indicator"?(e.openBlock(),e.createElementBlock("div",vm)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Se.isDragged,"dss-dnd-item--no-handle":!se.value.useHandle}]),onPointerdown:Pe=>Ue(Pe,Se.item)},[se.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Pe=>Yt(Pe,Se.item),["stop"])},[e.renderSlot(te.$slots,"handle",{},()=>[_e[0]||(_e[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,hm)):e.createCommentVNode("",!0),e.createElementVNode("div",ym,[e.renderSlot(te.$slots,"item",{item:Se.item,column:fe,justDropped:ee.value?.id===Se.item[R.itemKey],droppedFrom:ee.value?.id===Se.item[R.itemKey]?ee.value.from:null,droppedTo:ee.value?.id===Se.item[R.itemKey]?ee.value.to:null},()=>[e.createElementVNode("div",Cm,e.toDisplayString(Se.item[R.itemKey]),1)])])],42,gm))],64))),128)),(wt.value[fe.value]||[]).length===0&&ue.value!=fe.value?(e.openBlock(),e.createElementBlock("div",km,[e.renderSlot(te.$slots,"empty",{column:fe},()=>[_e[1]||(_e[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,fm)],2))),128))],6))}}),xm={name:"DSSConfetti"},Em=Object.assign(xm,{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(R){const ke=R,z=e.ref(null),D=e.ref(!1);let Me=[],b=null,Te=null;function se(ee,S){const le=[];for(let Le=0;Le<ke.count;Le++)le.push(pt(ee));return le}function pt(ee,S){return{x:Math.random()*ee,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:ke.colors[Math.floor(Math.random()*ke.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 p(ee,S,le,Le){ee.clearRect(0,0,S,le);for(const Ae of Me)ee.save(),ee.globalAlpha=Ae.opacity*Le,ee.beginPath(),ee.lineWidth=Ae.r,ee.strokeStyle=Ae.color,ee.moveTo(Ae.x+Ae.tilt+Ae.r/2,Ae.y),ee.lineTo(Ae.x+Ae.tilt,Ae.y+Ae.tilt+Ae.r/2),ee.stroke(),ee.restore()}function ue(ee,S,le){const Le=.3+le*.7;for(let Ae=0;Ae<Me.length;Ae++){const Re=Me[Ae];Re.tiltAngle+=Re.tiltInc,Re.y+=Re.speed*Le,Re.x+=Math.sin(Re.d)*.5*Le,Re.tilt=Math.sin(Re.tiltAngle)*15,le>=.99&&Re.y>S+20&&(Me[Ae]=pt(ee))}}function ve(){D.value=!0,e.nextTick(()=>{const ee=z.value;if(!ee)return;const S=ee.getContext("2d"),le=ee.parentElement;if(!le)return;const Le=le.getBoundingClientRect();ee.width=Le.width,ee.height=Le.height,Me=se(ee.width,ee.height);const Ae=Date.now(),Re=Ae+ke.duration,O=()=>{const ct=Date.now(),Ie=ct-Ae;if(ct<Re){let xe=1;Ie>ke.fadeStart&&(xe=1-(Ie-ke.fadeStart)/(ke.duration-ke.fadeStart)),p(S,ee.width,ee.height,xe),ue(ee.width,ee.height,xe),b=requestAnimationFrame(O)}else de()};O()})}function de(){b&&(cancelAnimationFrame(b),b=null),Me=[],D.value=!1}return e.watch(()=>ke.trigger,ee=>{ee&&(Te&&clearTimeout(Te),Te=setTimeout(ve,ke.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{de(),Te&&clearTimeout(Te)}),(ee,S)=>D.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:z,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),Vm={class:"dss-filter-global-inner"},Nm=["value"],Sm=["title"],Bm={key:0,class:"dss-filter-funnel-badge"},Mm={class:"dss-filter-panel"},_m={key:0,class:"dss-filter-empty"},$m={class:"dss-filter-row-prefix"},Tm={class:"dss-filter-cell"},Lm=["onClick"],Hm={class:"dss-filter-trigger-text"},Am={class:"dss-filter-popup-list"},Dm=["onClick"],Rm={key:0,class:"dss-filter-popup-empty"},Fm={key:0,class:"dss-filter-cell"},Im=["onClick"],zm={class:"dss-filter-trigger-text"},Pm={class:"dss-filter-popup-list"},Om=["onClick"],Zm={key:1,class:"dss-filter-cell dss-filter-cell--value"},Wm=["onUpdate:modelValue"],qm={key:1,class:"dss-filter-date-wrap"},Um=["onUpdate:modelValue"],Xm=["value","onInput","step"],Ym={key:4,class:"dss-filter-between"},jm=["value","onInput","step"],Km=["value","onInput","step"],Gm={key:5,class:"dss-filter-multiselect"},Qm=["onClick"],Jm={class:"dss-filter-trigger-text"},e2={class:"dss-filter-popup-list dss-filter-popup-list--check"},t2=["onClick"],n2=["checked"],l2={key:0,class:"dss-filter-popup-empty"},o2=["onClick"],a2={class:"dss-filter-foot"},s2={class:"dss-filter-cell"},r2={class:"dss-filter-popup-list"},i2=["onClick"],c2={key:0,class:"dss-filter-popup-divider"},u2=["onClick"],d2={class:"dss-filter-popup-list"},m2=["onClick"],p2={key:0,class:"dss-filter-popup-empty"},f2={class:"dss-filter-popup-list"},v2=["onClick"],g2={key:0,class:"dss-filter-popup-empty"},h2={name:"DSSFilter"},y2=Object.assign(h2,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(R,{expose:ke,emit:z}){const D=R,Me=z,b={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},Te=e.computed(()=>({...b,...D.options})),se={text:[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"equals",label:"equals"},{value:"not_equals",label:"does not equal"},{value:"starts_with",label:"starts with"},{value:"ends_with",label:"ends with"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],select:[{value:"is_any_of",label:"is any of"},{value:"is_none_of",label:"is none of"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],range:[{value:"eq",label:"="},{value:"neq",label:"≠"},{value:"gt",label:">"},{value:"gte",label:"≥"},{value:"lt",label:"<"},{value:"lte",label:"≤"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],int:[{value:"eq",label:"="},{value:"neq",label:"≠"},{value:"gt",label:">"},{value:"gte",label:"≥"},{value:"lt",label:"<"},{value:"lte",label:"≤"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],arraySelect:[{value:"contains_any",label:"contains any of"},{value:"contains_all",label:"contains all of"},{value:"not_contains_any",label:"does not contain"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],arrayText:[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],date:[{value:"eq",label:"on"},{value:"before",label:"before"},{value:"after",label:"after"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],boolean:[{value:"is_true",label:"is true"},{value:"is_false",label:"is false"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}]},pt=new Set(["is_empty","is_not_empty","is_true","is_false"]),p=["label","name","title","keyword","full_name","value","text"],ue=e.ref(""),ve=e.ref([]),de=e.ref(null),ee=e.ref(!1),S=e.ref(null),le=e.ref(""),Le=e.ref(null);let Ae=1;function Re(x){const C=x.find(V=>V&&typeof V=="object");if(!C)return null;for(const V of p)if(V in C&&typeof C[V]=="string")return V;return Object.keys(C).find(V=>typeof C[V]=="string")||null}function O(x,C){const V=C.filter(P=>P!=null&&P!=="NULL");if(V.length===0)return null;if(V.every(P=>Array.isArray(P))){const P=V.flatMap(Ve=>Ve).filter(Ve=>Ve!=null);return P.length===0?null:typeof P.find(Ve=>Ve!=null)=="object"?"arraySelect":"arrayText"}return V.every(P=>typeof P=="boolean")?"boolean":V.every(P=>typeof P=="number")?new Set(V).size<=Te.value.maxUniqueForEnum?"select":"range":V.every(P=>typeof P=="string")?new Set(V).size<=Te.value.maxUniqueForSelect?"select":"text":V.some(P=>typeof P=="object"&&!Array.isArray(P))?null:"text"}const ct=e.computed(()=>{if(!D.data?.length)return[];const x=new Set;for(const Y of D.data)if(Y&&typeof Y=="object")for(const Ve of Object.keys(Y))x.add(Ve);const C=new Set(D.exclude),V=[];for(const Y of x){if(C.has(Y))continue;const Ve=D.config[Y]||{},Je=D.data.map(Vt=>Vt?.[Y]),He=Ve.type||O(Y,Je);if(!He)continue;const oe=Ve.filterMode||"contain",tt=oe==="date"?"date":oe==="string"?"text":He,je={key:Y,label:Ve.label||K(Y),type:tt,filterMode:oe};if(He==="select"){const Vt=Je.filter(vt=>vt!=null&&vt!=="NULL");je.uniqueValues=[...new Set(Vt)].sort((vt,Ke)=>typeof vt=="number"&&typeof Ke=="number"?vt-Ke:String(vt).localeCompare(String(Ke)))}else if(He==="range"||He==="int"){const Vt=Je.filter(vt=>typeof vt=="number");je.min=Math.min(...Vt),je.max=Math.max(...Vt)}else if(He==="arraySelect"){const Vt=Ve.displayKey||Re(Je.flatMap(Ke=>Array.isArray(Ke)?Ke:[]));je.displayKey=Vt;const vt=Je.flatMap(Ke=>Array.isArray(Ke)?Ke:[]).filter(Ke=>Ke!=null).map(Ke=>Vt&&typeof Ke=="object"?Ke[Vt]:String(Ke)).filter(Ke=>Ke!=null&&Ke!=="");je.uniqueValues=[...new Set(vt)].sort((Ke,Ht)=>String(Ke).localeCompare(String(Ht)))}V.push(je)}const P=D.config._order;return P&&V.sort((Y,Ve)=>{const Je=P.indexOf(Y.key),He=P.indexOf(Ve.key);return Je===-1&&He===-1?0:Je===-1?1:He===-1?-1:Je-He}),V}),Ie=e.computed(()=>{const x={};for(const C of ct.value)x[C.key]=C;return x}),xe=e.computed(()=>Array.isArray(D.config.groups)&&D.config.groups.length>0),wt=e.computed(()=>{if(!xe.value)return[];const x=new Set(ct.value.map(C=>C.key));return D.config.groups.map(C=>({...C,keys:C.keys.filter(V=>x.has(V))})).filter(C=>C.keys.length>0)}),_t=e.computed(()=>{if(!xe.value)return[];const x=new Set(D.config.groups.flatMap(C=>C.keys));return ct.value.filter(C=>!x.has(C.key))}),mt=e.computed(()=>{if(!Le.value)return[];const x=new Set(Le.value.keys),C=ct.value.filter(P=>x.has(P.key));if(!le.value)return C;const V=le.value.toLowerCase();return C.filter(P=>P.label.toLowerCase().includes(V))}),ze=e.computed(()=>{if(!le.value)return ct.value;const x=le.value.toLowerCase();return ct.value.filter(C=>C.label.toLowerCase().includes(x))});function ge(x){de.value===x?gt():(de.value=x,le.value="",Le.value=null)}function gt(){de.value=null,le.value="",Le.value=null}function Et(x){const C=x.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");de.value&&!C&&!x.target.closest(".dss-filter-popup")&&!x.target.closest(".dss-filter-trigger")&&!x.target.closest(".dss-filter-add-btn")&&gt(),ee.value&&S.value&&!S.value.contains(x.target)&&(C||(ee.value=!1))}e.onMounted(()=>document.addEventListener("click",Et)),e.onBeforeUnmount(()=>document.removeEventListener("click",Et));function st(x){return Ie.value[x]?.label||K(x)}function St(x){return Ie.value[x.key]?.filterMode||"contain"}function Wt(x){for(const C of Object.values(se)){const V=C.find(P=>P.value===x);if(V)return V.label}return x}function on(x){const C=Ie.value[x.key];return se[C?.type]||se.text}function xt(x){return pt.has(x)}function et(x){const C=Ie.value[x.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"?x.operator==="between"?"between":"number":"text":"text"}function Ye(x){return se[x]?.[0]?.value||"contains"}function Ft(x,C){return pt.has(C)||x==="date"?null:x==="select"||x==="arraySelect"?[]:(x==="range"||x==="int")&&C==="between"?{min:null,max:null}:x==="range"||x==="int"?null:""}function $t(x){return Ie.value[x.key]?.uniqueValues||[]}function Bt(x){const C=$t(x);if(!le.value)return C;const V=le.value.toLowerCase();return C.filter(P=>String(P).toLowerCase().includes(V))}function Ue(x){const C=x.value;return!C||C.length===0?"Select...":C.length<=2?C.join(", "):`${C.length} selected`}function Yt(x){const C=Ie.value[x],V=C?.filterMode||"contain",P=C?.type||"text",Y=V==="string"?"contains":Ye(P);ve.value.push(e.reactive({id:Ae++,key:x,operator:Y,value:Ft(P,Y)})),gt()}function Ut(x){ve.value=ve.value.filter(C=>C.id!==x)}function ht(x,C){const P=Ie.value[C]?.type||"text";x.key=C,x.operator=Ye(P),x.value=Ft(P,x.operator),gt()}function te(x,C){const V=et(x);x.operator=C;const P=et(x);if(V!==P||pt.has(C)){const Y=Ie.value[x.key];x.value=Ft(Y?.type||"text",C)}gt()}function _e(x,C){const V=C.target.value;x.value=V===""?null:Number(V)}function fe(x,C,V){const P=V.target.value,Y=P===""?null:Number(P);(!x.value||typeof x.value!="object")&&(x.value={min:null,max:null}),x.value={...x.value,[C]:isNaN(Y)?null:Y}}function Se(x,C){const V=x.value||[],P=V.indexOf(C);x.value=P>=0?V.filter(Y=>Y!==C):[...V,C]}function Pe(){ve.value=[],ue.value="",gt()}function ft(x){ue.value=x.target.value}const Ze=e.computed(()=>{if(!D.data)return[];let x=D.data;if(ue.value){const C=ue.value.toLowerCase();x=x.filter(V=>{for(const P of Object.keys(V)){const Y=V[P];if(typeof Y=="string"&&Y.toLowerCase().includes(C)||typeof Y=="number"&&String(Y).includes(C)||Array.isArray(Y)&&Y.some(Ve=>Ve!=null&&(typeof Ve=="string"?Ve.toLowerCase().includes(C):typeof Ve=="object"?Object.values(Ve).some(Je=>typeof Je=="string"&&Je.toLowerCase().includes(C)):!1)))return!0}return!1})}for(const C of ve.value){if(!ut(C))continue;const V=Ie.value[C.key];V&&(x=x.filter(P=>Ee(P,C,V)))}return x});function ut(x){return pt.has(x.operator)?!0:x.value==null||typeof x.value=="string"&&x.value===""||Array.isArray(x.value)&&x.value.length===0?!1:x.value instanceof Date?!isNaN(x.value.getTime()):!(typeof x.value=="object"&&!Array.isArray(x.value)&&x.value.min==null&&x.value.max==null)}function Ee(x,C,V){const P=x?.[C.key],Y=C.value,Ve=C.operator;if(Ve==="is_empty")return U(P);if(Ve==="is_not_empty")return!U(P);const Je=V.type;if(Je==="text"||Je==="arrayText"){const He=Je==="arrayText"&&Array.isArray(P)?P.filter(je=>je!=null).map(String).join(" "):P!=null?String(P):"",oe=String(Y).toLowerCase(),tt=He.toLowerCase();switch(Ve){case"contains":return tt.includes(oe);case"not_contains":return!tt.includes(oe);case"equals":return tt===oe;case"not_equals":return tt!==oe;case"starts_with":return tt.startsWith(oe);case"ends_with":return tt.endsWith(oe);default:return!0}}if(Je==="select")switch(Ve){case"is_any_of":return Y.includes(P);case"is_none_of":return!Y.includes(P);default:return!0}if(Je==="range"||Je==="int"){const He=typeof P=="number"?P:Number(P);if(typeof He!="number"||isNaN(He))return!1;if(Ve==="between"){const tt=Y?.min!=null?Number(Y.min):null,je=Y?.max!=null?Number(Y.max):null,Vt=tt!=null&&!isNaN(tt)?tt:null,vt=je!=null&&!isNaN(je)?je:null;return(Vt==null||He>=Vt)&&(vt==null||He<=vt)}const oe=typeof Y=="number"&&!isNaN(Y)?Y:Number(Y);if(Ve==="contains"||Ve==="not_contains"){const tt=String(He),je=String(Y??"").toLowerCase(),Vt=tt.toLowerCase().includes(je);return Ve==="contains"?Vt:!Vt}if(typeof oe!="number"||isNaN(oe))return!1;switch(Ve){case"eq":return He===oe;case"neq":return He!==oe;case"gt":return He>oe;case"gte":return He>=oe;case"lt":return He<oe;case"lte":return He<=oe;default:return!0}}if(Je==="arraySelect"){if(!Array.isArray(P))return!1;const He=P.filter(oe=>oe!=null).map(oe=>V.displayKey&&typeof oe=="object"?oe[V.displayKey]:String(oe));switch(Ve){case"contains_any":return He.some(oe=>Y.includes(oe));case"contains_all":return Y.every(oe=>He.includes(oe));case"not_contains_any":return!He.some(oe=>Y.includes(oe));default:return!0}}if(Je==="date"){const He=Qe(Y);if(!He||isNaN(He.getTime()))return!1;const oe=Qe(P);if(!oe||isNaN(oe.getTime()))return!1;const tt=q(oe),je=q(He);switch(Ve){case"eq":return tt===je;case"before":return tt<je;case"after":return tt>je;default:return!0}}if(Je==="boolean"){const He=P===!0||P==="true"||P===1,oe=P===!1||P==="false"||P===0;switch(Ve){case"is_true":return He;case"is_false":return oe;default:return!0}}return!0}function Qe(x){if(x==null)return null;if(x instanceof Date)return isNaN(x.getTime())?null:x;if(typeof x=="number")return new Date(x>1e10?x:x*1e3);if(typeof x=="string"){const C=new Date(x);return isNaN(C.getTime())?null:C}return null}function q(x){const C=x.getFullYear(),V=String(x.getMonth()+1).padStart(2,"0"),P=String(x.getDate()).padStart(2,"0");return`${C}-${V}-${P}`}function U(x){return!!(x==null||x===""||x==="NULL"||Array.isArray(x)&&x.length===0||Array.isArray(x)&&x.every(C=>C==null))}e.watch(Ze,x=>Me("update:modelValue",x),{immediate:!0}),e.watch(()=>D.data,()=>{ve.value=[],ue.value="",ee.value=!1,gt()});function K(x){return x.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,C=>C.toUpperCase())}function ie(){const x=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(x);if(typeof C=="object"&&!Array.isArray(C)){const V={};for(const P of Object.keys(C))V[P]=x(C[P]);return V}return C};return{globalSearch:ue.value,rows:ve.value.map(C=>({key:C.key,operator:C.operator,value:x(C.value),defType:Ie.value[C.key]?.type,defFilterMode:Ie.value[C.key]?.filterMode})),filteredCount:Ze.value?.length??0}}return ke({getDebugState:ie}),(x,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":Te.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:S},[e.createElementVNode("div",Vm,[C[15]||(C[15]=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:"Search across all fields...",value:ue.value,onInput:ft},null,40,Nm),ue.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:C[0]||(C[0]=V=>ue.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:ee.value||ve.value.length>0}]),onClick:C[1]||(C[1]=V=>ee.value=!ee.value),type:"button",title:ee.value?"Close advanced filter":"Open advanced filter"},[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)),ve.value.length>0?(e.openBlock(),e.createElementBlock("span",Bm,e.toDisplayString(ve.value.length),1)):e.createCommentVNode("",!0)],10,Sm)]),ee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:C[13]||(C[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Mm,[ve.value.length===0?(e.openBlock(),e.createElementBlock("div",_m," No filter conditions are applied to this view ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,(V,P)=>(e.openBlock(),e.createElementBlock("div",{key:V.id,class:"dss-filter-row"},[e.createElementVNode("span",$m,e.toDisplayString(P===0?"Where":"And"),1),e.createElementVNode("div",Tm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(Y=>ge(`${V.id}:field`),["stop"])},[e.createElementVNode("span",Hm,e.toDisplayString(st(V.key)),1),C[16]||(C[16]=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,Lm),de.value===`${V.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]=Y=>le.value=Y),placeholder:"Search attributes..."},null,512),[[e.vModelText,le.value]]),e.createElementVNode("ul",Am,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,Y=>(e.openBlock(),e.createElementBlock("li",{key:Y.key,class:"dss-filter-popup-item",onClick:Ve=>ht(V,Y.key)},e.toDisplayString(Y.label),9,Dm))),128)),ze.value.length===0?(e.openBlock(),e.createElementBlock("li",Rm,"No match")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),St(V)==="contain"||St(V)==="date"?(e.openBlock(),e.createElementBlock("div",Fm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(Y=>ge(`${V.id}:op`),["stop"])},[e.createElementVNode("span",zm,e.toDisplayString(Wt(V.operator)),1),C[17]||(C[17]=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,Im),de.value===`${V.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[4]||(C[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",Pm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on(V),Y=>(e.openBlock(),e.createElementBlock("li",{key:Y.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:V.operator===Y.value}]),onClick:Ve=>te(V,Y.value)},e.toDisplayString(Y.label),11,Om))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),xt(V.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Zm,[St(V)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:"Enter value...","onUpdate:modelValue":Y=>V.value=Y},null,8,Wm)),[[e.vModelText,V.value]]):St(V)==="date"?(e.openBlock(),e.createElementBlock("div",qm,[e.createVNode(zo,{mode:"single",modelValue:V.value,"onUpdate:modelValue":Y=>V.value=Y},null,8,["modelValue","onUpdate:modelValue"])])):et(V)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:"Enter value...","onUpdate:modelValue":Y=>V.value=Y},null,8,Um)),[[e.vModelText,V.value]]):et(V)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:"Enter value...",value:V.value,onInput:Y=>_e(V,Y),step:Ie.value[V.key]?.type==="int"?1:void 0},null,40,Xm)):et(V)==="between"?(e.openBlock(),e.createElementBlock("div",Ym,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:"Min",value:V.value?.min,onInput:Y=>fe(V,"min",Y),step:Ie.value[V.key]?.type==="int"?1:void 0},null,40,jm),C[18]||(C[18]=e.createElementVNode("span",{class:"dss-filter-between-sep"},"and",-1)),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:"Max",value:V.value?.max,onInput:Y=>fe(V,"max",Y),step:Ie.value[V.key]?.type==="int"?1:void 0},null,40,Km)])):et(V)==="multiselect"?(e.openBlock(),e.createElementBlock("div",Gm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(Y=>ge(`${V.id}:val`),["stop"])},[e.createElementVNode("span",Jm,e.toDisplayString(Ue(V)),1),C[19]||(C[19]=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,Qm),de.value===`${V.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[6]||(C[6]=e.withModifiers(()=>{},["stop"]))},[$t(V).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[5]||(C[5]=Y=>le.value=Y),placeholder:"Search..."},null,512)),[[e.vModelText,le.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",e2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bt(V),Y=>(e.openBlock(),e.createElementBlock("li",{key:Y,class:"dss-filter-popup-item",onClick:Ve=>Se(V,Y)},[e.createElementVNode("input",{type:"checkbox",checked:(V.value||[]).includes(Y),tabindex:"-1"},null,8,n2),e.createElementVNode("span",null,e.toDisplayString(Y),1)],8,t2))),128)),Bt(V).length===0?(e.openBlock(),e.createElementBlock("li",l2," No match ")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:Y=>Ut(V.id)},[...C[20]||(C[20]=[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,o2)]))),128)),e.createElementVNode("div",a2,[e.createElementVNode("div",s2,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:C[7]||(C[7]=e.withModifiers(V=>ge("add"),["stop"]))}," Add filter "),de.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"]))},[xe.value&&!Le.value&&!le.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]=V=>le.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,le.value]]),e.createElementVNode("ul",r2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wt.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:P=>Le.value=V},[e.createElementVNode("span",null,e.toDisplayString(V.label),1),C[21]||(C[21]=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,i2))),128)),_t.value.length>0?(e.openBlock(),e.createElementBlock("li",c2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_t.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Yt(V.key)},e.toDisplayString(V.label),9,u2))),128))])],64)):Le.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:C[9]||(C[9]=V=>Le.value=null)},[C[22]||(C[22]=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(Le.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[10]||(C[10]=V=>le.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,le.value]]),e.createElementVNode("ul",d2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Yt(V.key)},e.toDisplayString(V.label),9,m2))),128)),mt.value.length===0?(e.openBlock(),e.createElementBlock("li",p2,"No match")):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]=V=>le.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,le.value]]),e.createElementVNode("ul",f2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Yt(V.key)},e.toDisplayString(V.label),9,v2))),128)),ze.value.length===0?(e.openBlock(),e.createElementBlock("li",g2,"No match ")):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),ve.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:Pe}," Clear all filters ")):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),C2={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"}},k2={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy"},b2={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"}},w2={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"}},lo={chart:C2,table:k2,datepicker:b2,textEditor:w2},x2={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"}},E2={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa"},V2={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"}},N2={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"}},oo={chart:x2,table:E2,datepicker:V2,textEditor:N2},S2={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"}},B2={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj"},M2={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"}},_2={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"}},ao={chart:S2,table:B2,datepicker:M2,textEditor:_2},Do={en:lo,fr:oo,nl:ao};function $2(R){if(!R||!R.global)return;const ke=R.global.availableLocales||[];Object.keys(Do).forEach(z=>{ke.includes(z)&&R.global.mergeLocaleMessage(z,Do[z])})}const Ro={en:{textEditor:lo.textEditor},fr:{textEditor:oo.textEditor},nl:{textEditor:ao.textEditor}};function T2(R){if(!R||!R.global)return;const ke=R.global.availableLocales||[];Object.keys(Ro).forEach(z=>{ke.includes(z)&&R.global.mergeLocaleMessage(z,Ro[z])})}const Fo={en:{table:lo.table},fr:{table:oo.table},nl:{table:ao.table}};function L2(R){if(!R||!R.global)return;const ke=R.global.availableLocales||[];Object.keys(Fo).forEach(z=>{ke.includes(z)&&R.global.mergeLocaleMessage(z,Fo[z])})}const Io={en:{datepicker:lo.datepicker},fr:{datepicker:oo.datepicker},nl:{datepicker:ao.datepicker}};function H2(R){if(!R||!R.global)return;const ke=R.global.availableLocales||[];Object.keys(Io).forEach(z=>{ke.includes(z)&&R.global.mergeLocaleMessage(z,Io[z])})}const A2={en:{...lo},fr:{...oo},nl:{...ao}};no.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:A2});exports.DSSChart=Ni;exports.DSSChartMessages=Do;exports.DSSColorPicker=K1;exports.DSSConfetti=Em;exports.DSSDatepicker=zo;exports.DSSDatepickerMessages=Io;exports.DSSDnd=wm;exports.DSSFilter=y2;exports.DSSLoader=cm;exports.DSSModal=Ao;exports.DSSSkeleton=um;exports.DSSTable=Zc;exports.DSSTableMessages=Fo;exports.DSSTextEditor=H1;exports.DSSTextEditorMessages=Ro;exports.addDSSChartTranslations=$2;exports.addDSSDatepickerTranslations=H2;exports.addDSSTableTranslations=L2;exports.addDSSTextEditorTranslations=T2;
117
+ `,document.body.appendChild(We),He=We}function ge(te,$e){He&&(He.style.left=`${te-Ie}px`,He.style.top=`${$e-O}px`)}function yt(te){te.classList.add("dss-dnd-item--dragging"),te.style.background=ae.value.dragSourceBackground,te.style.borderColor=ae.value.dragSourceBorder,te.style.transform="scale(0.97)"}function Vt(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 _t(te,$e){return!!document.elementFromPoint(te,$e)?.closest("[data-dss-dnd-delete-zone]")}function Ot(te,$e){if(b.value&&_t(te,$e)){ve.value=!0,ue.value=null,de.value=-1;return}ve.value=!1;const fe=at(te,$e),Ve=fe?.getAttribute("data-column")??null;if(!Ve){ue.value=null,de.value=-1;return}ue.value=Ve;const We=fe.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let ft=We.length;for(let qe=0;qe<We.length;qe++){const ut=We[qe].getBoundingClientRect();if($e<ut.top+ut.height/2){ft=qe;break}}de.value=ft}function on(te){te.preventDefault(),ge(te.clientX,te.clientY),!S&&(S=requestAnimationFrame(()=>{S=null,Ot(te.clientX,te.clientY)}))}function Et(te){window.removeEventListener("pointermove",on),window.removeEventListener("pointerup",Et),window.removeEventListener("pointercancel",Et),De?.releasePointerCapture?.(te.pointerId),Vt(De),De=null;const $e=b.value&&_t(te.clientX,te.clientY);if(p.value&&$e)A("delete",{item:p.value});else{const Ve=at(te.clientX,te.clientY)?.getAttribute("data-column")??null;if(p.value&&Ve){const We=p.value[z.columnKey],ft=Ve,ut=(xt.value[ft]||[]).filter(Z=>Z[z.itemKey]!==p.value[z.itemKey]),xe=Math.max(0,Math.min(de.value,ut.length)),Ue=mt(ft,xe),X=p.value[z.itemKey];A("move",{item:p.value,from:We,to:ft,position:Ue,index:xe}),ne&&clearTimeout(ne),ee.value={id:X,from:We,to:ft},ne=setTimeout(()=>{ee.value=null},3500)}}He&&(He.remove(),He=null),rt!==null&&(document.body.style.cursor=rt,rt=""),Ct()}function lt(te,$e){te.preventDefault();const fe=te.target.closest(".dss-dnd-item");if(!fe)return;const Ve=fe.getBoundingClientRect();Ie=te.clientX-Ve.left,O=te.clientY-Ve.top,rt=document.body.style.cursor,document.body.style.cursor="grabbing",p.value=$e,De=fe,Ze(fe,te.clientX,te.clientY),requestAnimationFrame(()=>yt(fe)),fe.setPointerCapture?.(te.pointerId),window.addEventListener("pointermove",on),window.addEventListener("pointerup",Et,{once:!0}),window.addEventListener("pointercancel",Et,{once:!0})}function je(){Oe&&(window.removeEventListener("pointermove",Dt),window.removeEventListener("pointerup",Lt),window.removeEventListener("pointercancel",Lt),Oe=null)}function Dt(te){if(!Oe||te.pointerId!==Oe.pointerId)return;const $e=te.clientX-Oe.startX,fe=te.clientY-Oe.startY;if(Math.abs($e)>=we||Math.abs(fe)>=we){const Ve=Oe.item;je(),lt(te,Ve)}}function Lt(te){!Oe||te.pointerId!==Oe.pointerId||je()}function $t(te,$e){je(),Oe={item:$e,startX:te.clientX,startY:te.clientY,pointerId:te.pointerId},window.addEventListener("pointermove",Dt),window.addEventListener("pointerup",Lt),window.addEventListener("pointercancel",Lt)}function Xe(te,$e){ae.value.useHandle||$t(te,$e)}function Gt(te,$e){$t(te,$e)}function Xt(){S&&(cancelAnimationFrame(S),S=null)}function Ct(){Xt(),p.value=null,ue.value=null,ve.value=!1,de.value=-1}return e.onBeforeUnmount(()=>{Xt(),je(),ne&&clearTimeout(ne),He&&(He.remove(),He=null)}),(te,$e)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":ae.value.unstyled}]),style:e.normalizeStyle(pt.value)},[b.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":ve.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(te.$slots,"delete-zone",{isDragging:!!p.value,isOver:ve.value})],2),[[e.vShow,!!p.value||ae.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.columns,fe=>(e.openBlock(),e.createElementBlock("div",{key:fe.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":ue.value==fe.value},fe.class||""]])},[ae.value.showHeader?(e.openBlock(),e.createElementBlock("div",mm,[e.renderSlot(te.$slots,"column-header",{column:fe,items:xt.value[fe.value]||[]},()=>[e.createElementVNode("span",pm,e.toDisplayString(fe.title||fe.value),1),e.createElementVNode("span",fm,e.toDisplayString((xt.value[fe.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":fe.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt.value[fe.value],Ve=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Ve.key},[Ve.type==="indicator"?(e.openBlock(),e.createElementBlock("div",gm)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Ve.isDragged,"dss-dnd-item--no-handle":!ae.value.useHandle}]),onPointerdown:We=>Xe(We,Ve.item)},[ae.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(We=>Gt(We,Ve.item),["stop"])},[e.renderSlot(te.$slots,"handle",{},()=>[$e[0]||($e[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,ym)):e.createCommentVNode("",!0),e.createElementVNode("div",Cm,[e.renderSlot(te.$slots,"item",{item:Ve.item,column:fe,justDropped:ee.value?.id===Ve.item[F.itemKey],droppedFrom:ee.value?.id===Ve.item[F.itemKey]?ee.value.from:null,droppedTo:ee.value?.id===Ve.item[F.itemKey]?ee.value.to:null},()=>[e.createElementVNode("div",km,e.toDisplayString(Ve.item[F.itemKey]),1)])])],42,hm))],64))),128)),(xt.value[fe.value]||[]).length===0&&ue.value!=fe.value?(e.openBlock(),e.createElementBlock("div",bm,[e.renderSlot(te.$slots,"empty",{column:fe},()=>[$e[1]||($e[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,vm)],2))),128))],6))}}),Em={name:"DSSConfetti"},Vm=Object.assign(Em,{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(F){const Ce=F,z=e.ref(null),A=e.ref(!1);let _e=[],b=null,Le=null;function ae(ee,S){const ne=[];for(let He=0;He<Ce.count;He++)ne.push(pt(ee));return ne}function pt(ee,S){return{x:Math.random()*ee,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:Ce.colors[Math.floor(Math.random()*Ce.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 p(ee,S,ne,He){ee.clearRect(0,0,S,ne);for(const De of _e)ee.save(),ee.globalAlpha=De.opacity*He,ee.beginPath(),ee.lineWidth=De.r,ee.strokeStyle=De.color,ee.moveTo(De.x+De.tilt+De.r/2,De.y),ee.lineTo(De.x+De.tilt,De.y+De.tilt+De.r/2),ee.stroke(),ee.restore()}function ue(ee,S,ne){const He=.3+ne*.7;for(let De=0;De<_e.length;De++){const Ie=_e[De];Ie.tiltAngle+=Ie.tiltInc,Ie.y+=Ie.speed*He,Ie.x+=Math.sin(Ie.d)*.5*He,Ie.tilt=Math.sin(Ie.tiltAngle)*15,ne>=.99&&Ie.y>S+20&&(_e[De]=pt(ee))}}function ve(){A.value=!0,e.nextTick(()=>{const ee=z.value;if(!ee)return;const S=ee.getContext("2d"),ne=ee.parentElement;if(!ne)return;const He=ne.getBoundingClientRect();ee.width=He.width,ee.height=He.height,_e=ae(ee.width,ee.height);const De=Date.now(),Ie=De+Ce.duration,O=()=>{const rt=Date.now(),Oe=rt-De;if(rt<Ie){let we=1;Oe>Ce.fadeStart&&(we=1-(Oe-Ce.fadeStart)/(Ce.duration-Ce.fadeStart)),p(S,ee.width,ee.height,we),ue(ee.width,ee.height,we),b=requestAnimationFrame(O)}else de()};O()})}function de(){b&&(cancelAnimationFrame(b),b=null),_e=[],A.value=!1}return e.watch(()=>Ce.trigger,ee=>{ee&&(Le&&clearTimeout(Le),Le=setTimeout(ve,Ce.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{de(),Le&&clearTimeout(Le)}),(ee,S)=>A.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:z,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),Nm={class:"dss-filter-global-inner"},Sm=["value"],Bm=["title"],Mm={key:0,class:"dss-filter-funnel-badge"},_m={class:"dss-filter-panel"},$m={key:0,class:"dss-filter-empty"},Tm={class:"dss-filter-row-prefix"},Lm={class:"dss-filter-cell"},Hm=["onClick"],Am={class:"dss-filter-trigger-text"},Dm={class:"dss-filter-popup-list"},Rm=["onClick"],Fm={key:0,class:"dss-filter-popup-empty"},Im={key:0,class:"dss-filter-cell"},zm=["onClick"],Pm={class:"dss-filter-trigger-text"},Om={class:"dss-filter-popup-list"},Zm=["onClick"],Wm={key:1,class:"dss-filter-cell dss-filter-cell--value"},qm=["onUpdate:modelValue"],Um={key:1,class:"dss-filter-date-wrap"},Xm=["onUpdate:modelValue"],Ym=["value","onInput","step"],jm={key:4,class:"dss-filter-between"},Km=["value","onInput","step"],Gm=["value","onInput","step"],Qm={key:5,class:"dss-filter-multiselect"},Jm=["onClick"],e2={class:"dss-filter-trigger-text"},t2={class:"dss-filter-popup-list dss-filter-popup-list--check"},n2=["onClick"],l2=["checked"],o2={key:0,class:"dss-filter-popup-empty"},a2=["onClick"],s2={class:"dss-filter-foot"},r2={class:"dss-filter-cell"},i2={class:"dss-filter-popup-list"},c2=["onClick"],u2={key:0,class:"dss-filter-popup-divider"},d2=["onClick"],m2={class:"dss-filter-popup-list"},p2=["onClick"],f2={key:0,class:"dss-filter-popup-empty"},v2={class:"dss-filter-popup-list"},g2=["onClick"],h2={key:0,class:"dss-filter-popup-empty"},y2={name:"DSSFilter"},C2=Object.assign(y2,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(F,{expose:Ce,emit:z}){const A=F,_e=z,b={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},Le=e.computed(()=>({...b,...A.options})),ae={text:[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"equals",label:"equals"},{value:"not_equals",label:"does not equal"},{value:"starts_with",label:"starts with"},{value:"ends_with",label:"ends with"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],select:[{value:"is_any_of",label:"is any of"},{value:"is_none_of",label:"is none of"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],range:[{value:"eq",label:"="},{value:"neq",label:"≠"},{value:"gt",label:">"},{value:"gte",label:"≥"},{value:"lt",label:"<"},{value:"lte",label:"≤"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],int:[{value:"eq",label:"="},{value:"neq",label:"≠"},{value:"gt",label:">"},{value:"gte",label:"≥"},{value:"lt",label:"<"},{value:"lte",label:"≤"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],arraySelect:[{value:"contains_any",label:"contains any of"},{value:"contains_all",label:"contains all of"},{value:"not_contains_any",label:"does not contain"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],arrayText:[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],date:[{value:"eq",label:"on"},{value:"before",label:"before"},{value:"after",label:"after"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],boolean:[{value:"is_true",label:"is true"},{value:"is_false",label:"is false"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}]},pt=new Set(["is_empty","is_not_empty","is_true","is_false"]),p=["label","name","title","keyword","full_name","value","text"],ue=e.ref(""),ve=e.ref([]),de=e.ref(null),ee=e.ref(!1),S=e.ref(null),ne=e.ref(""),He=e.ref(null);let De=1;function Ie(E){const C=E.find(V=>V&&typeof V=="object");if(!C)return null;for(const V of p)if(V in C&&typeof C[V]=="string")return V;return Object.keys(C).find(V=>typeof C[V]=="string")||null}function O(E,C){const V=C.filter(P=>P!=null&&P!=="NULL");if(V.length===0)return null;if(V.every(P=>Array.isArray(P))){const P=V.flatMap(ze=>ze).filter(ze=>ze!=null);return P.length===0?null:typeof P.find(ze=>ze!=null)=="object"?"arraySelect":"arrayText"}return V.every(P=>typeof P=="boolean")?"boolean":V.every(P=>typeof P=="number")?new Set(V).size<=Le.value.maxUniqueForEnum?"select":"range":V.every(P=>typeof P=="string")?new Set(V).size<=Le.value.maxUniqueForSelect?"select":"text":V.some(P=>typeof P=="object"&&!Array.isArray(P))?null:"text"}const rt=e.computed(()=>{if(!A.data?.length)return[];const E=new Set;for(const U of A.data)if(U&&typeof U=="object")for(const ze of Object.keys(U))E.add(ze);const C=new Set(A.exclude),V=[];for(const U of E){if(C.has(U))continue;const ze=A.config[U]||{},Re=A.data.map(wt=>wt?.[U]),Ae=ze.type||O(U,Re);if(!Ae)continue;const re=ze.filterMode||"contain",Ge=re==="date"?"date":re==="string"?"text":Ae,tt={key:U,label:ze.label||j(U),type:Ge,filterMode:re};if(Ae==="select"){const wt=Re.filter(vt=>vt!=null&&vt!=="NULL");tt.uniqueValues=[...new Set(wt)].sort((vt,Je)=>typeof vt=="number"&&typeof Je=="number"?vt-Je:String(vt).localeCompare(String(Je)))}else if(Ae==="range"||Ae==="int"){const wt=Re.filter(vt=>typeof vt=="number");tt.min=Math.min(...wt),tt.max=Math.max(...wt)}else if(Ae==="arraySelect"){const wt=ze.displayKey||Ie(Re.flatMap(Je=>Array.isArray(Je)?Je:[]));tt.displayKey=wt;const vt=Re.flatMap(Je=>Array.isArray(Je)?Je:[]).filter(Je=>Je!=null).map(Je=>wt&&typeof Je=="object"?Je[wt]:String(Je)).filter(Je=>Je!=null&&Je!=="");tt.uniqueValues=[...new Set(vt)].sort((Je,vn)=>String(Je).localeCompare(String(vn)))}V.push(tt)}const P=A.config._order;return P&&V.sort((U,ze)=>{const Re=P.indexOf(U.key),Ae=P.indexOf(ze.key);return Re===-1&&Ae===-1?0:Re===-1?1:Ae===-1?-1:Re-Ae}),V}),Oe=e.computed(()=>{const E={};for(const C of rt.value)E[C.key]=C;return E}),we=e.computed(()=>Array.isArray(A.config.groups)&&A.config.groups.length>0),xt=e.computed(()=>{if(!we.value)return[];const E=new Set(rt.value.map(C=>C.key));return A.config.groups.map(C=>({...C,keys:C.keys.filter(V=>E.has(V))})).filter(C=>C.keys.length>0)}),Tt=e.computed(()=>{if(!we.value)return[];const E=new Set(A.config.groups.flatMap(C=>C.keys));return rt.value.filter(C=>!E.has(C.key))}),mt=e.computed(()=>{if(!He.value)return[];const E=new Set(He.value.keys),C=rt.value.filter(P=>E.has(P.key));if(!ne.value)return C;const V=ne.value.toLowerCase();return C.filter(P=>P.label.toLowerCase().includes(V))}),Ze=e.computed(()=>{if(!ne.value)return rt.value;const E=ne.value.toLowerCase();return rt.value.filter(C=>C.label.toLowerCase().includes(E))});function ge(E){de.value===E?yt():(de.value=E,ne.value="",He.value=null)}function yt(){de.value=null,ne.value="",He.value=null}function Vt(E){const C=E.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");de.value&&!C&&!E.target.closest(".dss-filter-popup")&&!E.target.closest(".dss-filter-trigger")&&!E.target.closest(".dss-filter-add-btn")&&yt(),ee.value&&S.value&&!S.value.contains(E.target)&&(C||(ee.value=!1))}e.onMounted(()=>document.addEventListener("click",Vt)),e.onBeforeUnmount(()=>document.removeEventListener("click",Vt));function at(E){return Oe.value[E]?.label||j(E)}function _t(E){return Oe.value[E.key]?.filterMode||"contain"}function Ot(E){for(const C of Object.values(ae)){const V=C.find(P=>P.value===E);if(V)return V.label}return E}function on(E){const C=Oe.value[E.key];return ae[C?.type]||ae.text}function Et(E){return pt.has(E)}function lt(E){const C=Oe.value[E.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"?E.operator==="between"?"between":"number":"text":"text"}function je(E){return ae[E]?.[0]?.value||"contains"}function Dt(E,C){return pt.has(C)||E==="date"?null:E==="select"||E==="arraySelect"?[]:(E==="range"||E==="int")&&C==="between"?{min:null,max:null}:E==="range"||E==="int"?null:""}function Lt(E){return Oe.value[E.key]?.uniqueValues||[]}function $t(E){const C=Lt(E);if(!ne.value)return C;const V=ne.value.toLowerCase();return C.filter(P=>String(P).toLowerCase().includes(V))}function Xe(E){const C=E.value;return!C||C.length===0?"Select...":C.length<=2?C.join(", "):`${C.length} selected`}function Gt(E){const C=Oe.value[E],V=C?.filterMode||"contain",P=C?.type||"text",U=V==="string"?"contains":je(P);ve.value.push(e.reactive({id:De++,key:E,operator:U,value:Dt(P,U)})),yt()}function Xt(E){ve.value=ve.value.filter(C=>C.id!==E)}function Ct(E,C){const P=Oe.value[C]?.type||"text";E.key=C,E.operator=je(P),E.value=Dt(P,E.operator),yt()}function te(E,C){const V=lt(E);E.operator=C;const P=lt(E);if(V!==P||pt.has(C)){const U=Oe.value[E.key];E.value=Dt(U?.type||"text",C)}yt()}function $e(E,C){const V=C.target.value;E.value=V===""?null:Number(V)}function fe(E,C,V){const P=V.target.value,U=P===""?null:Number(P);(!E.value||typeof E.value!="object")&&(E.value={min:null,max:null}),E.value={...E.value,[C]:isNaN(U)?null:U}}function Ve(E,C){const V=E.value||[],P=V.indexOf(C);E.value=P>=0?V.filter(U=>U!==C):[...V,C]}function We(){ve.value=[],ue.value="",yt()}function ft(E){ue.value=E.target.value}const qe=e.computed(()=>{if(!A.data)return[];let E=A.data;if(ue.value){const C=ue.value.toLowerCase();E=E.filter(V=>{for(const P of Object.keys(V)){const U=V[P];if(typeof U=="string"&&U.toLowerCase().includes(C)||typeof U=="number"&&String(U).includes(C)||Array.isArray(U)&&U.some(ze=>ze!=null&&(typeof ze=="string"?ze.toLowerCase().includes(C):typeof ze=="object"?Object.values(ze).some(Re=>typeof Re=="string"&&Re.toLowerCase().includes(C)):!1)))return!0}return!1})}for(const C of ve.value){if(!ut(C))continue;const V=Oe.value[C.key];V&&(E=E.filter(P=>xe(P,C,V)))}return E});function ut(E){return pt.has(E.operator)?!0:E.value==null||typeof E.value=="string"&&E.value===""||Array.isArray(E.value)&&E.value.length===0?!1:E.value instanceof Date?!isNaN(E.value.getTime()):!(typeof E.value=="object"&&!Array.isArray(E.value)&&E.value.min==null&&E.value.max==null)}function xe(E,C,V){const P=E?.[C.key],U=C.value,ze=C.operator;if(ze==="is_empty")return Z(P);if(ze==="is_not_empty")return!Z(P);const Re=V.type;if(Re==="text"||Re==="arrayText"){const Ae=Re==="arrayText"&&Array.isArray(P)?P.filter(tt=>tt!=null).map(String).join(" "):P!=null?String(P):"",re=String(U).toLowerCase(),Ge=Ae.toLowerCase();switch(ze){case"contains":return Ge.includes(re);case"not_contains":return!Ge.includes(re);case"equals":return Ge===re;case"not_equals":return Ge!==re;case"starts_with":return Ge.startsWith(re);case"ends_with":return Ge.endsWith(re);default:return!0}}if(Re==="select")switch(ze){case"is_any_of":return U.includes(P);case"is_none_of":return!U.includes(P);default:return!0}if(Re==="range"||Re==="int"){const Ae=typeof P=="number"?P:Number(P);if(typeof Ae!="number"||isNaN(Ae))return!1;if(ze==="between"){const Ge=U?.min!=null?Number(U.min):null,tt=U?.max!=null?Number(U.max):null,wt=Ge!=null&&!isNaN(Ge)?Ge:null,vt=tt!=null&&!isNaN(tt)?tt:null;return(wt==null||Ae>=wt)&&(vt==null||Ae<=vt)}const re=typeof U=="number"&&!isNaN(U)?U:Number(U);if(ze==="contains"||ze==="not_contains"){const Ge=String(Ae),tt=String(U??"").toLowerCase(),wt=Ge.toLowerCase().includes(tt);return ze==="contains"?wt:!wt}if(typeof re!="number"||isNaN(re))return!1;switch(ze){case"eq":return Ae===re;case"neq":return Ae!==re;case"gt":return Ae>re;case"gte":return Ae>=re;case"lt":return Ae<re;case"lte":return Ae<=re;default:return!0}}if(Re==="arraySelect"){if(!Array.isArray(P))return!1;const Ae=P.filter(re=>re!=null).map(re=>V.displayKey&&typeof re=="object"?re[V.displayKey]:String(re));switch(ze){case"contains_any":return Ae.some(re=>U.includes(re));case"contains_all":return U.every(re=>Ae.includes(re));case"not_contains_any":return!Ae.some(re=>U.includes(re));default:return!0}}if(Re==="date"){const Ae=Ue(U);if(!Ae||isNaN(Ae.getTime()))return!1;const re=Ue(P);if(!re||isNaN(re.getTime()))return!1;const Ge=X(re),tt=X(Ae);switch(ze){case"eq":return Ge===tt;case"before":return Ge<tt;case"after":return Ge>tt;default:return!0}}if(Re==="boolean"){const Ae=P===!0||P==="true"||P===1,re=P===!1||P==="false"||P===0;switch(ze){case"is_true":return Ae;case"is_false":return re;default:return!0}}return!0}function Ue(E){if(E==null)return null;if(E instanceof Date)return isNaN(E.getTime())?null:E;if(typeof E=="number")return new Date(E>1e10?E:E*1e3);if(typeof E=="string"){const C=new Date(E);return isNaN(C.getTime())?null:C}return null}function X(E){const C=E.getFullYear(),V=String(E.getMonth()+1).padStart(2,"0"),P=String(E.getDate()).padStart(2,"0");return`${C}-${V}-${P}`}function Z(E){return!!(E==null||E===""||E==="NULL"||Array.isArray(E)&&E.length===0||Array.isArray(E)&&E.every(C=>C==null))}e.watch(qe,E=>_e("update:modelValue",E),{immediate:!0}),e.watch(()=>A.data,()=>{ve.value=[],ue.value="",ee.value=!1,yt()});function j(E){return E.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,C=>C.toUpperCase())}function ie(){const E=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(E);if(typeof C=="object"&&!Array.isArray(C)){const V={};for(const P of Object.keys(C))V[P]=E(C[P]);return V}return C};return{globalSearch:ue.value,rows:ve.value.map(C=>({key:C.key,operator:C.operator,value:E(C.value),defType:Oe.value[C.key]?.type,defFilterMode:Oe.value[C.key]?.filterMode})),filteredCount:qe.value?.length??0}}return Ce({getDebugState:ie}),(E,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":Le.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:S},[e.createElementVNode("div",Nm,[C[15]||(C[15]=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:"Search across all fields...",value:ue.value,onInput:ft},null,40,Sm),ue.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:C[0]||(C[0]=V=>ue.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:ee.value||ve.value.length>0}]),onClick:C[1]||(C[1]=V=>ee.value=!ee.value),type:"button",title:ee.value?"Close advanced filter":"Open advanced filter"},[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)),ve.value.length>0?(e.openBlock(),e.createElementBlock("span",Mm,e.toDisplayString(ve.value.length),1)):e.createCommentVNode("",!0)],10,Bm)]),ee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:C[13]||(C[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",_m,[ve.value.length===0?(e.openBlock(),e.createElementBlock("div",$m," No filter conditions are applied to this view ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,(V,P)=>(e.openBlock(),e.createElementBlock("div",{key:V.id,class:"dss-filter-row"},[e.createElementVNode("span",Tm,e.toDisplayString(P===0?"Where":"And"),1),e.createElementVNode("div",Lm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(U=>ge(`${V.id}:field`),["stop"])},[e.createElementVNode("span",Am,e.toDisplayString(at(V.key)),1),C[16]||(C[16]=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,Hm),de.value===`${V.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]=U=>ne.value=U),placeholder:"Search attributes..."},null,512),[[e.vModelText,ne.value]]),e.createElementVNode("ul",Dm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,U=>(e.openBlock(),e.createElementBlock("li",{key:U.key,class:"dss-filter-popup-item",onClick:ze=>Ct(V,U.key)},e.toDisplayString(U.label),9,Rm))),128)),Ze.value.length===0?(e.openBlock(),e.createElementBlock("li",Fm,"No match")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),_t(V)==="contain"||_t(V)==="date"?(e.openBlock(),e.createElementBlock("div",Im,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(U=>ge(`${V.id}:op`),["stop"])},[e.createElementVNode("span",Pm,e.toDisplayString(Ot(V.operator)),1),C[17]||(C[17]=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,zm),de.value===`${V.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[4]||(C[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",Om,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on(V),U=>(e.openBlock(),e.createElementBlock("li",{key:U.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:V.operator===U.value}]),onClick:ze=>te(V,U.value)},e.toDisplayString(U.label),11,Zm))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Et(V.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Wm,[_t(V)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:"Enter value...","onUpdate:modelValue":U=>V.value=U},null,8,qm)),[[e.vModelText,V.value]]):_t(V)==="date"?(e.openBlock(),e.createElementBlock("div",Um,[e.createVNode(zo,{mode:"single",modelValue:V.value,"onUpdate:modelValue":U=>V.value=U},null,8,["modelValue","onUpdate:modelValue"])])):lt(V)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:"Enter value...","onUpdate:modelValue":U=>V.value=U},null,8,Xm)),[[e.vModelText,V.value]]):lt(V)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:"Enter value...",value:V.value,onInput:U=>$e(V,U),step:Oe.value[V.key]?.type==="int"?1:void 0},null,40,Ym)):lt(V)==="between"?(e.openBlock(),e.createElementBlock("div",jm,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:"Min",value:V.value?.min,onInput:U=>fe(V,"min",U),step:Oe.value[V.key]?.type==="int"?1:void 0},null,40,Km),C[18]||(C[18]=e.createElementVNode("span",{class:"dss-filter-between-sep"},"and",-1)),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:"Max",value:V.value?.max,onInput:U=>fe(V,"max",U),step:Oe.value[V.key]?.type==="int"?1:void 0},null,40,Gm)])):lt(V)==="multiselect"?(e.openBlock(),e.createElementBlock("div",Qm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(U=>ge(`${V.id}:val`),["stop"])},[e.createElementVNode("span",e2,e.toDisplayString(Xe(V)),1),C[19]||(C[19]=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,Jm),de.value===`${V.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[6]||(C[6]=e.withModifiers(()=>{},["stop"]))},[Lt(V).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[5]||(C[5]=U=>ne.value=U),placeholder:"Search..."},null,512)),[[e.vModelText,ne.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",t2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($t(V),U=>(e.openBlock(),e.createElementBlock("li",{key:U,class:"dss-filter-popup-item",onClick:ze=>Ve(V,U)},[e.createElementVNode("input",{type:"checkbox",checked:(V.value||[]).includes(U),tabindex:"-1"},null,8,l2),e.createElementVNode("span",null,e.toDisplayString(U),1)],8,n2))),128)),$t(V).length===0?(e.openBlock(),e.createElementBlock("li",o2," No match ")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:U=>Xt(V.id)},[...C[20]||(C[20]=[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,a2)]))),128)),e.createElementVNode("div",s2,[e.createElementVNode("div",r2,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:C[7]||(C[7]=e.withModifiers(V=>ge("add"),["stop"]))}," Add filter "),de.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"]))},[we.value&&!He.value&&!ne.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]=V=>ne.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,ne.value]]),e.createElementVNode("ul",i2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xt.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:P=>He.value=V},[e.createElementVNode("span",null,e.toDisplayString(V.label),1),C[21]||(C[21]=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,c2))),128)),Tt.value.length>0?(e.openBlock(),e.createElementBlock("li",u2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Gt(V.key)},e.toDisplayString(V.label),9,d2))),128))])],64)):He.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:C[9]||(C[9]=V=>He.value=null)},[C[22]||(C[22]=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(He.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[10]||(C[10]=V=>ne.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,ne.value]]),e.createElementVNode("ul",m2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Gt(V.key)},e.toDisplayString(V.label),9,p2))),128)),mt.value.length===0?(e.openBlock(),e.createElementBlock("li",f2,"No match")):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]=V=>ne.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,ne.value]]),e.createElementVNode("ul",v2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Gt(V.key)},e.toDisplayString(V.label),9,g2))),128)),Ze.value.length===0?(e.openBlock(),e.createElementBlock("li",h2,"No match ")):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),ve.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:We}," Clear all filters ")):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),k2={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"}},b2={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy"},w2={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"}},x2={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"}},oo={chart:k2,table:b2,datepicker:w2,textEditor:x2},E2={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"}},V2={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa"},N2={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"}},S2={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"}},ao={chart:E2,table:V2,datepicker:N2,textEditor:S2},B2={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"}},M2={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj"},_2={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"}},$2={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"}},so={chart:B2,table:M2,datepicker:_2,textEditor:$2},Do={en:oo,fr:ao,nl:so};function T2(F){if(!F||!F.global)return;const Ce=F.global.availableLocales||[];Object.keys(Do).forEach(z=>{Ce.includes(z)&&F.global.mergeLocaleMessage(z,Do[z])})}const Ro={en:{textEditor:oo.textEditor},fr:{textEditor:ao.textEditor},nl:{textEditor:so.textEditor}};function L2(F){if(!F||!F.global)return;const Ce=F.global.availableLocales||[];Object.keys(Ro).forEach(z=>{Ce.includes(z)&&F.global.mergeLocaleMessage(z,Ro[z])})}const Fo={en:{table:oo.table},fr:{table:ao.table},nl:{table:so.table}};function H2(F){if(!F||!F.global)return;const Ce=F.global.availableLocales||[];Object.keys(Fo).forEach(z=>{Ce.includes(z)&&F.global.mergeLocaleMessage(z,Fo[z])})}const Io={en:{datepicker:oo.datepicker},fr:{datepicker:ao.datepicker},nl:{datepicker:so.datepicker}};function A2(F){if(!F||!F.global)return;const Ce=F.global.availableLocales||[];Object.keys(Io).forEach(z=>{Ce.includes(z)&&F.global.mergeLocaleMessage(z,Io[z])})}const D2={en:{...oo},fr:{...ao},nl:{...so}};lo.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:D2});exports.DSSChart=Si;exports.DSSChartMessages=Do;exports.DSSColorPicker=G1;exports.DSSConfetti=Vm;exports.DSSDatepicker=zo;exports.DSSDatepickerMessages=Io;exports.DSSDnd=xm;exports.DSSFilter=C2;exports.DSSLoader=um;exports.DSSModal=Ao;exports.DSSSkeleton=dm;exports.DSSTable=Wc;exports.DSSTableMessages=Fo;exports.DSSTextEditor=A1;exports.DSSTextEditorMessages=Ro;exports.addDSSChartTranslations=T2;exports.addDSSDatepickerTranslations=A2;exports.addDSSTableTranslations=H2;exports.addDSSTextEditorTranslations=L2;