dsp-semactic 0.7.0 → 0.7.1
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/dsp-semactic.css +1 -1
- package/dist/index.cjs.js +20 -20
- package/dist/index.es.js +2773 -2764
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),co=require("vue-i18n"),$a={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},La=["value"],Ta=["placeholder","value","disabled"],Aa=["placeholder","value"],Da=["placeholder","value"],Ha=["aria-selected","onClick"],Ra={class:"dss-datepicker__list-item-label"},Fa={key:0,class:"dss-datepicker__list-item-check",width:"16",height:"16",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},Ia={key:1,class:"dss-datepicker__list-empty"},za={key:1,class:"dss-datepicker__double-wrap"},Pa={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},Oa=["disabled","onClick"],qa={class:"dss-datepicker__double-calendars"},Za={class:"dss-datepicker__double-calendar"},Wa={class:"dss-datepicker__calendar-header"},Ua=["aria-label"],Xa={class:"dss-datepicker__month-year-row"},Ya=["aria-label"],ja={class:"dss-datepicker__weekdays"},Ka={class:"dss-datepicker__grid"},Ga=["disabled","onClick","onMouseenter"],Qa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ja={class:"dss-datepicker__double-calendar"},es={class:"dss-datepicker__calendar-header"},ts=["aria-label"],ns={class:"dss-datepicker__month-year-row"},ls=["aria-label"],os={class:"dss-datepicker__weekdays"},as={class:"dss-datepicker__grid"},ss=["disabled","onClick","onMouseenter"],rs={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},is={class:"dss-datepicker__calendar-header"},cs=["aria-label"],us={class:"dss-datepicker__month-year-row"},ds=["aria-label"],ms={class:"dss-datepicker__weekdays"},ps={class:"dss-datepicker__grid"},fs=["disabled","onClick","onMouseenter"],vs={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},gs={class:"dss-datepicker__calendar-header"},hs={class:"dss-datepicker__month-year-row"},ys={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},ks={class:"dss-datepicker__months-grid"},Cs=["onClick"],bs={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},ws={class:"dss-datepicker__month-year"},xs={class:"dss-datepicker__years-grid"},Es=["data-year","onClick"],ua=27,Zl=8,la={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:L=>["single","range","singleFromAvailable","rangeFromAvailable","listFromAvailable","readonly"].includes(L)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0},placeholder:{type:String,default:""}},emits:["update:modelValue"],setup(L,{emit:ne}){const _=L,D=ne,{t:ce,locale:z}=co.useI18n(),M=e.ref(!1),fe=e.ref("days"),dt=new Date,ee=e.computed(()=>_.minDate instanceof Date?_.minDate:dt),v=e.ref(ee.value.getMonth()),we=e.ref(ee.value.getFullYear()),ke=e.ref(ee.value.getMonth()),J=e.ref(ee.value.getFullYear()),X=e.ref(ee.value.getMonth()),me=e.ref(ee.value.getFullYear()),F=e.ref("start"),Se=e.ref(null),Ae=e.ref(null);function lt(){const T=ee.value,I=T.getMonth(),B=T.getFullYear(),te=I===11?0:I+1,Te=I===11?B+1:B;return{left:{month:I,year:B},right:{month:te,year:Te}}}const ft=e.ref(null),Z=e.ref(null),De=e.ref(null),We=e.ref(null),Ee=e.ref(null),_e=e.ref(null),Xe=e.ref(null),re=e.ref(null),tt=new Date().getFullYear(),Ce=e.computed(()=>["single","singleFromAvailable"].includes(_.mode)),nt=e.computed(()=>["range","rangeFromAvailable"].includes(_.mode)),ot=e.computed(()=>_.mode==="listFromAvailable"),kt=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes(_.mode))return null;const T=_.modelValue;return T instanceof Date?T:null}),Vt=e.computed(()=>{if(!nt.value)return{start:null,end:null};const T=_.modelValue;return!T||typeof T!="object"?{start:null,end:null}:{start:T.start instanceof Date?T.start:null,end:T.end instanceof Date?T.end:null}});function Ht(T){if(!T||!(T instanceof Date))return"";const I=T.getDate(),B=T.getMonth()+1,te=T.getFullYear(),Te=vt=>String(vt).padStart(2,"0");return`${Te(I)}/${Te(B)}/${te}`}const zt=e.computed(()=>Ht(kt.value)),Nt=e.computed(()=>{const{start:T,end:I}=Vt.value;if(!T&&!I)return"";const B=!I||T&&T<=I?T:I,te=!T||I&&I>=T?I:T;return jt(B,te)?Ht(B):`${Ht(B)} - ${Ht(te)}`}),bt=e.computed(()=>{if(_.mode!=="readonly")return"—";const T=_.modelValue;if(T instanceof Date)return Ht(T)||"—";if(T&&typeof T=="object"&&("start"in T||"end"in T)){const I=T.start instanceof Date?T.start:null,B=T.end instanceof Date?T.end:null;if(!I&&!B)return"—";const te=!B||I&&I<=B?I:B,Te=!I||B&&B>=I?B:I;return jt(te,Te)?Ht(te):`${Ht(te)} - ${Ht(Te)}`}return"—"});e.computed(()=>{const T=new Date(we.value,v.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(T)});const Xt=e.computed(()=>Ae.value==="left"?ke.value:Ae.value==="right"?X.value:v.value),mt=e.computed(()=>Ae.value==="left"?J.value:Ae.value==="right"?me.value:we.value),tn=e.computed(()=>{const T=new Date(we.value,v.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(T)}),Y=e.computed(()=>{const T=new Date(mt.value,Xt.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(T)}),ye=e.computed(()=>{const T=new Intl.DateTimeFormat(z.value,{month:"short"});return Array.from({length:12},(I,B)=>T.format(new Date(2024,B,1)))}),xe=e.computed(()=>{const I=(Ae.value?mt.value:we.value)-Math.floor(ua/2);return Array.from({length:ua},(B,te)=>I+te)}),Pe=e.computed(()=>{const T=xe.value;return T.length?`${T[0]} – ${T[T.length-1]}`:""});function j(T){return T===7?0:T}function ge(T){try{const I=new Intl.Locale(T);if(I.weekInfo?.firstDay!=null)return j(I.weekInfo.firstDay)}catch{}return 1}function Be(T){const I=new Date(2024,0,1),B=(I.getDay()-T+7)%7,te=new Date(I);return te.setDate(I.getDate()-B),te}const Fe=e.computed(()=>ge(z.value)),Ye=e.computed(()=>{const T=new Intl.DateTimeFormat(z.value,{weekday:"short"}),I=Be(Fe.value),B=[];for(let te=0;te<7;te++){const Te=new Date(I);Te.setDate(I.getDate()+te),B.push(T.format(Te).slice(0,2))}return B});function wt(T,I,B){const te=new Date(T,I,1),Te=new Date(T,I+1,0),vt=(te.getDay()-B+7)%7,pt=Te.getDate(),rt=[];for(let it=0;it<vt;it++)rt.push(null);for(let it=1;it<=pt;it++)rt.push(new Date(T,I,it));return rt}const et=e.computed(()=>wt(we.value,v.value,Fe.value)),Yt=e.computed(()=>wt(J.value,ke.value,Fe.value)),Ue=e.computed(()=>wt(me.value,X.value,Fe.value));e.computed(()=>{const T=new Date(J.value,ke.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(T)}),e.computed(()=>{const T=new Date(me.value,X.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(T)});const Oe=e.computed(()=>{const T=new Date(J.value,ke.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(T)}),Tt=e.computed(()=>{const T=new Date(me.value,X.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(T)}),Lt=e.computed(()=>_.availableDates&&_.availableDates.length>0),le=e.computed(()=>Lt.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"}]),W=e.ref({top:0,left:0}),U=e.ref("left");let ie=null;function he(){M.value&&e.nextTick(()=>{M.value&&(ie!==null&&window.cancelAnimationFrame(ie),ie=window.requestAnimationFrame(()=>{ie=null,Ge()}))})}function Ge(){if(!Ee.value||!M.value)return;const T=Ee.value.getBoundingClientRect(),I=window.innerWidth||document.documentElement.clientWidth,B=window.innerHeight||document.documentElement.clientHeight;let te=T.left,Te=T.bottom+4;const vt=_e.value;if(vt){const pt=vt.offsetWidth,rt=vt.offsetHeight;U.value==="right"||te+pt>I-Zl?(U.value="right",te=T.right-pt):U.value="left";const vn=Math.max(Zl,I-pt-Zl);if(te=Math.min(Math.max(te,Zl),vn),Te+rt>B-Zl){const bn=T.top-4-rt;bn>=Zl?Te=bn:Te=Math.max(Zl,B-rt-Zl)}}W.value={top:Te,left:te}}const At=e.computed(()=>!Ee.value||!M.value?{}:{position:"fixed",left:`${W.value.left}px`,top:`${W.value.top}px`,zIndex:1002});function jt(T,I){return!T||!I?!1:T.getFullYear()===I.getFullYear()&&T.getMonth()===I.getMonth()&&T.getDate()===I.getDate()}function at(T){return new Date(T.getFullYear(),T.getMonth(),T.getDate()).getTime()}function sn(T){return!_.availableDates||!_.availableDates.length?!0:_.availableDates.some(I=>I instanceof Date&&jt(I,T))}function S(T){const I=at(T);return!(_.minDate instanceof Date&&I<at(_.minDate)||_.maxDate instanceof Date&&I>at(_.maxDate))}function b(T){const I=new Date(T);return new Date(I.getFullYear(),I.getMonth(),I.getDate())}function V(T){return T.filter(I=>S(I))}function K(T,I){if(!(T instanceof Date)||!(I instanceof Date))return null;let B=at(T),te=at(I);if(B>te&&([B,te]=[te,B]),_.minDate instanceof Date){const Te=at(_.minDate);B=Math.max(B,Te),te=Math.max(te,Te)}if(_.maxDate instanceof Date){const Te=at(_.maxDate);B=Math.min(B,Te),te=Math.min(te,Te)}return B>te?null:{start:b(B),end:b(te)}}function oe(T){return!_.exceptDates||!_.exceptDates.length?!1:_.exceptDates.some(I=>I instanceof Date&&jt(I,T))}function He(T){return oe(T)?!1:["singleFromAvailable","rangeFromAvailable"].includes(_.mode)?sn(T):S(T)}function Ct(T){const I=kt.value,B=Vt.value,te=at(T),Te=nt.value&&B.start&&B.end&&te>at(B.start)&&te<at(B.end),vt=nt.value&&B.start&&jt(T,B.start),pt=nt.value&&B.end&&jt(T,B.end),rt=vt&&pt,it=Ce.value&&I&&jt(T,I)||vt||pt;let vn=!1;if(nt.value&&B.start&&!B.end&&Se.value){const bn=at(B.start),qt=at(Se.value),gn=Math.min(bn,qt),Gt=Math.max(bn,qt);vn=te>gn&&te<Gt}return{"dss-datepicker__day--selected":it&&!rt,"dss-datepicker__day--range-start":vt&&!rt,"dss-datepicker__day--range-end":pt&&!rt,"dss-datepicker__day--range-single":rt,"dss-datepicker__day--in-range":Te&&!vt&&!pt,"dss-datepicker__day--in-range-preview":vn&&!vt&&!pt&&!Te,"dss-datepicker__day--disabled":!He(T)}}function st(T){if(!nt.value)return;const I=Vt.value;if(!I.start||I.end){Se.value=null;return}if(!He(T)){Se.value=null;return}Se.value=new Date(T.getFullYear(),T.getMonth(),T.getDate())}function ze(){Se.value=null}function xt(){if(!_.doubleCalendar||!nt.value)return;const T=Vt.value,{start:I,end:B}=T;if(I&&B){const vt=I<=B?I:B,pt=I<=B?B:I,rt=vt.getMonth(),it=vt.getFullYear(),vn=pt.getMonth(),bn=pt.getFullYear();if(rt!==vn||it!==bn){const qt=ke.value===rt&&J.value===it,gn=X.value===vn&&me.value===bn;if(qt&&gn)return;ke.value=rt,J.value=it,X.value=vn,me.value=bn}else{const qt=rt===0?11:rt-1,gn=rt===0?it-1:it;ke.value===qt&&J.value===gn&&X.value===rt&&me.value===it||(ke.value=rt,J.value=it,rt===11?(X.value=0,me.value=it+1):(X.value=rt+1,me.value=it))}return}const te=I||B;if(te){const vt=te.getMonth(),pt=te.getFullYear(),rt=ke.value===vt&&J.value===pt,it=X.value===vt&&me.value===pt;if(rt||it)return;ke.value=vt,J.value=pt,vt===11?(X.value=0,me.value=pt+1):(X.value=vt+1,me.value=pt);return}const Te=lt();ke.value=Te.left.month,J.value=Te.left.year,X.value=Te.right.month,me.value=Te.right.year}const Mt=e.computed(()=>new Intl.DateTimeFormat(z.value,{day:"2-digit",month:"long",year:"numeric"})),Et=e.computed(()=>{if(!ot.value)return[];const T=(_.availableDates||[]).filter(B=>B instanceof Date&&!Number.isNaN(B.getTime())).filter(B=>!oe(B)&&S(B)).map(B=>new Date(B.getFullYear(),B.getMonth(),B.getDate()));T.sort((B,te)=>te.getTime()-B.getTime());const I=kt.value;return T.map(B=>({date:B,ts:B.getTime(),label:Mt.value.format(B),selected:!!(I&&jt(B,I))}))});function ct(){if(M.value){rn();return}Ee.value=We.value?.closest(".dss-datepicker__input-wrap"),U.value="left",M.value=!0,he(),e.nextTick(()=>{re.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function Dt(T){if(!(T instanceof Date))return;const I=new Date(T.getFullYear(),T.getMonth(),T.getDate());D("update:modelValue",I),rn()}function Bt(T="start"){if(_.mode==="readonly")return;F.value=T;const I=kt.value,B=Vt.value;if(Ce.value&&I)v.value=I.getMonth(),we.value=I.getFullYear();else if(nt.value)if(_.doubleCalendar)xt();else{const te=T==="start"&&B.start?B.start:B.end||B.start;te&&(v.value=te.getMonth(),we.value=te.getFullYear())}Ee.value=Ce.value?ft.value?.closest(".dss-datepicker__input-wrap"):Z.value,fe.value="days",Ae.value=null,U.value="left",M.value=!0,he()}function rn(){fe.value="days",Ae.value=null,Se.value=null,M.value=!1}function Vn(T,I){Ae.value=T,fe.value=I}function Wn(){fe.value="days",Ae.value=null}function en(T){const I=new Date,B=I.getFullYear(),te=I.getMonth(),Te=I.getDate();let vt,pt;if(Lt.value){const rt=V([..._.availableDates].filter(it=>it instanceof Date).map(it=>new Date(it.getFullYear(),it.getMonth(),it.getDate()))).sort((it,vn)=>it.getTime()-vn.getTime());if(rt.length===0)return null;if(T==="all")vt=rt[0],pt=rt[rt.length-1];else{const it=parseInt(T.replace("last",""),10);if(it<2||it>5)return null;const vn=rt.slice(-it);if(vn.length===0)return null;vt=vn[0],pt=vn[vn.length-1]}}else{const rt=new Date(B,te,Te);switch(T){case"today":vt=rt,pt=rt;break;case"lastWeek":vt=new Date(B,te,Te-6),pt=rt;break;case"last15Days":vt=new Date(B,te,Te-14),pt=rt;break;case"last30Days":vt=new Date(B,te,Te-29),pt=rt;break;case"thisMonth":vt=new Date(B,te,1),pt=rt;break;case"last3Months":vt=new Date(B,te-3,1),pt=new Date(B,te,0);break;case"last6Months":vt=new Date(B,te-6,1),pt=new Date(B,te,0);break;case"last12Months":vt=new Date(B,te-12,1),pt=new Date(B,te,0);break;case"lastYear":vt=new Date(B-1,0,1),pt=new Date(B-1,11,31);break;default:return null}}return{start:vt,end:pt}}function pn(T){const I=en(T);return I?K(I.start,I.end):null}function ll(T){return pn(T)!==null}function vl(T){const I=pn(T);I&&(D("update:modelValue",I),xt())}function il(T){Ae.value==="left"?ke.value=T:Ae.value==="right"?X.value=T:v.value=T,Wn()}function _n(T){Ae.value==="left"?J.value=T:Ae.value==="right"?me.value=T:we.value=T,Wn()}function gl(){v.value===0?(v.value=11,we.value--):v.value--}function $n(){v.value===11?(v.value=0,we.value++):v.value++}function Vl(){ke.value===0?(ke.value=11,J.value--):ke.value--}function Rl(){ke.value===11?(ke.value=0,J.value++):ke.value++}function hl(){X.value===0?(X.value=11,me.value--):X.value--}function An(){X.value===11?(X.value=0,me.value++):X.value++}function Un(T){if(!He(T))return;const I=new Date(T.getFullYear(),T.getMonth(),T.getDate());if(Ce.value){D("update:modelValue",I),rn();return}const B=Vt.value;if(!B.start&&!B.end){D("update:modelValue",{start:I,end:null}),F.value="end";return}if(B.start&&B.end){D("update:modelValue",{start:I,end:null}),F.value="end";return}if(F.value==="start"){let te=I,Te=B.end;te&&Te&&te>Te&&([te,Te]=[Te,te]),D("update:modelValue",{start:te||Te,end:Te||te}),F.value="end"}else{let te=B.start,Te=I;te&&Te&&Te<te&&([te,Te]=[Te,te]),D("update:modelValue",{start:te||Te,end:Te||te}),F.value="start"}}e.watch(Vt,()=>{_.doubleCalendar&&nt.value&&M.value&&xt()},{deep:!0});let Xn=null,Hn=null,zn=null;function Nl(){Xn&&(document.removeEventListener("keydown",Xn),Xn=null),Hn&&(window.removeEventListener("resize",Hn),Hn=null),zn&&(window.removeEventListener("scroll",zn,!0),zn=null)}return e.watch(fe,T=>{T==="years"&&e.nextTick(()=>{Xe.value?.querySelector(`[data-year="${mt.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[M.value,fe.value,v.value,we.value,ke.value,J.value,X.value,me.value,Ae.value,_.doubleCalendar,_.quickSelect],()=>{he()}),e.watch(M,T=>{Nl(),T&&(Xn=I=>{I.key==="Escape"&&(fe.value==="years"||fe.value==="months"?Wn():rn())},Hn=()=>{Ge()},zn=()=>{Ge()},document.addEventListener("keydown",Xn),window.addEventListener("resize",Hn),window.addEventListener("scroll",zn,!0))}),e.onBeforeUnmount(()=>{ie!==null&&(window.cancelAnimationFrame(ie),ie=null),Nl()}),(T,I)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":L.mode==="readonly"}])},[L.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",$a,[I[10]||(I[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:bt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,La)])):Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:I[0]||(I[0]=B=>Bt("start"))},[I[11]||(I[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:ft,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(ce)("datepicker.selectDate"),value:zt.value,readonly:"",disabled:L.mode==="readonly"},null,8,Ta)])):ot.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-datepicker__input-wrap dss-datepicker__input-wrap--list",{"dss-datepicker__input-wrap--open":M.value}]),onClick:ct},[I[13]||(I[13]=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:"inputListRef",ref:We,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(ce)("datepicker.selectFromList"),value:zt.value,readonly:""},null,8,Aa),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":M.value}]),"aria-hidden":"true"},[...I[12]||(I[12]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"})],-1)])],2)],2)):nt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:Z,onClick:I[1]||(I[1]=B=>Bt("start"))},[I[14]||(I[14]=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:De,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(ce)("datepicker.selectRange"),value:Nt.value,readonly:""},null,8,Da)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[M.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(rn,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:_e,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":L.doubleCalendar&&nt.value&&fe.value==="days","dss-datepicker__dropdown--quick-select":L.doubleCalendar&&nt.value&&fe.value==="days"&&L.quickSelect,"dss-datepicker__dropdown--list":ot.value}]),onClick:I[9]||(I[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(At.value)},[ot.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Et.value.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"dss-datepicker__list",role:"listbox",ref_key:"listRef",ref:re},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Et.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B.ts,role:"option","aria-selected":B.selected,class:e.normalizeClass(["dss-datepicker__list-item",{"dss-datepicker__list-item--selected":B.selected}]),onClick:te=>Dt(B.date)},[e.createElementVNode("span",Ra,e.toDisplayString(B.label),1),B.selected?(e.openBlock(),e.createElementBlock("svg",Fa,[...I[15]||(I[15]=[e.createElementVNode("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"},null,-1)])])):e.createCommentVNode("",!0)],10,Ha))),128))],512)):(e.openBlock(),e.createElementBlock("div",Ia,e.toDisplayString(e.unref(ce)("datepicker.noAvailableDates")),1))],64)):fe.value==="days"&&L.doubleCalendar&&nt.value?(e.openBlock(),e.createElementBlock("div",za,[L.quickSelect?(e.openBlock(),e.createElementBlock("nav",Pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(le.value,B=>(e.openBlock(),e.createElementBlock("button",{key:B.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!ll(B.id),onClick:te=>vl(B.id)},e.toDisplayString(e.unref(ce)(B.labelKey)),9,Oa))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",qa,[e.createElementVNode("div",Za,[e.createElementVNode("div",Wa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:Vl}," ‹ ",8,Ua),e.createElementVNode("div",Xa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[2]||(I[2]=B=>Vn("left","months"))},e.toDisplayString(Oe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[3]||(I[3]=B=>Vn("left","years"))},e.toDisplayString(J.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:Rl}," › ",8,Ya)]),e.createElementVNode("div",ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,B=>(e.openBlock(),e.createElementBlock("span",{key:B,class:"dss-datepicker__weekday"},e.toDisplayString(B),1))),128))]),e.createElementVNode("div",Ka,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt.value,(B,te)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+te},[B?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ct(B)]),disabled:!He(B),onClick:Te=>Un(B),onMouseenter:Te=>st(B),onMouseleave:ze},e.toDisplayString(B.getDate()),43,Ga)):(e.openBlock(),e.createElementBlock("span",Qa))],64))),128))])]),e.createElementVNode("div",Ja,[e.createElementVNode("div",es,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:hl}," ‹ ",8,ts),e.createElementVNode("div",ns,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[4]||(I[4]=B=>Vn("right","months"))},e.toDisplayString(Tt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[5]||(I[5]=B=>Vn("right","years"))},e.toDisplayString(me.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:An}," › ",8,ls)]),e.createElementVNode("div",os,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,B=>(e.openBlock(),e.createElementBlock("span",{key:B,class:"dss-datepicker__weekday"},e.toDisplayString(B),1))),128))]),e.createElementVNode("div",as,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,(B,te)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+te},[B?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ct(B)]),disabled:!He(B),onClick:Te=>Un(B),onMouseenter:Te=>st(B),onMouseleave:ze},e.toDisplayString(B.getDate()),43,ss)):(e.openBlock(),e.createElementBlock("span",rs))],64))),128))])])])])):fe.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",is,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:gl}," ‹ ",8,cs),e.createElementVNode("div",us,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[6]||(I[6]=B=>fe.value="months")},e.toDisplayString(tn.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[7]||(I[7]=B=>fe.value="years")},e.toDisplayString(we.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:$n}," › ",8,ds)]),e.createElementVNode("div",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,B=>(e.openBlock(),e.createElementBlock("span",{key:B,class:"dss-datepicker__weekday"},e.toDisplayString(B),1))),128))]),e.createElementVNode("div",ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value,(B,te)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:te},[B?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ct(B)]),disabled:!He(B),onClick:Te=>Un(B),onMouseenter:Te=>st(B),onMouseleave:ze},e.toDisplayString(B.getDate()),43,fs)):(e.openBlock(),e.createElementBlock("span",vs))],64))),128))])],64)):fe.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",gs,[e.createElementVNode("div",hs,[e.createElementVNode("span",ys,e.toDisplayString(Y.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[8]||(I[8]=B=>fe.value="years")},e.toDisplayString(mt.value),1)])]),e.createElementVNode("div",ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye.value,(B,te)=>(e.openBlock(),e.createElementBlock("button",{key:te,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":te===Xt.value}]),onClick:Te=>il(te)},e.toDisplayString(B),11,Cs))),128))])],64)):fe.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",bs,[e.createElementVNode("span",ws,e.toDisplayString(Pe.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:Xe},[e.createElementVNode("div",xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.value,B=>(e.openBlock(),e.createElementBlock("button",{key:B,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":B===mt.value,"dss-datepicker__year-cell--current":B===e.unref(tt)}]),"data-year":B,onClick:te=>_n(B)},e.toDisplayString(B),11,Es))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Ss=["data-chart-type"],Vs={class:"dss-chart-header-titles"},Ns={key:0,class:"dss-chart-title"},Bs={key:1,class:"dss-chart-subtitle"},Ms=["onClick","onMouseenter"],_s={class:"dss-legend-text"},$s=["onClick","onMouseenter"],Ls={class:"dss-legend-text"},Ts=["title"],As=["src"],Ds={class:"dss-chart-area-wrapper"},Hs={key:0,class:"dss-chart-z-axis-label"},Rs=["width","height","data-smooth","data-animated"],Fs=["id"],Is=["y","width","height"],zs=["id"],Ps=["d"],Os=["id"],qs=["d"],Zs={key:0},Ws=["clip-path"],Us=["x1","x2","y1","y2"],Xs={class:"dss-axes"},Ys=["x1","x2","y1","y2"],js=["x1","x2","y1","y2"],Ks=["x1","x2","y1","y2"],Gs={class:"dss-axis-labels"},Qs=["x","y"],Js=["x","y"],er=["x","y"],tr=["x","y"],nr=["y","transform"],lr=["x","y","transform"],or={key:1,class:"dss-flag-markers"},ar=["clip-path"],sr=["x1","x2","y1","y2","onMouseover"],rr=["x1","x2","y1","y2","onMouseover"],ir=["x1","x2","y1","y2","onMouseover"],cr=["cx","cy","onMouseover"],ur=["cx","cy","fill","onMouseover"],dr=["x","y"],mr=["clip-path"],pr={key:0},fr=["d","onMouseover"],vr=["x","y","width","height","fill","onMouseover"],gr={class:"dss-line-chart"},hr=["d","stroke","stroke-width","stroke-dasharray"],yr=["d","stroke","stroke-width","opacity"],kr=["cx","cy","r","fill","onMouseover"],Cr={key:1},br=["d","stroke","stroke-width","stroke-dasharray"],wr=["d","stroke","stroke-width","stroke-dasharray"],xr=["d","stroke","stroke-width","opacity"],Er=["cx","cy","r","fill","onMouseover"],Sr={key:2},Vr=["id"],Nr=["x","y","width","height"],Br=["d","fill","fill-opacity","mask"],Mr=["d","stroke","stroke-width"],_r=["d","fill","onMouseover"],$r=["x","y","width","height","onMouseover"],Lr=["clip-path"],Tr=["x1","x2","y1","y2","stroke"],Ar=["cx","cy","r","fill"],Dr={key:1,class:"dss-bubble-chart"},Hr={key:0,class:"dss-bubble-group"},Rr=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Fr=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Ir=["transform"],zr=["cx","cy","r"],Pr=["data-chart-type","clip-path"],Or=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],qr={key:1,class:"dss-radial-segment-data-labels"},Zr=["x","y"],Wr=["x","y","font-size","fill"],Ur=["x1","y1","x2","y2","stroke"],Xr=["x1","y1","x2","y2","stroke"],Yr=["x","y","text-anchor","font-size"],jr=["transform"],Kr={key:0,class:"dss-spider-grid"},Gr=["cx","cy","r"],Qr={class:"dss-spider-grid-labels"},Jr=["x","y"],ei=["x","y"],ti=["x1","x2","y1","y2"],ni={class:"dss-spider-labels"},li=["x","y","text-anchor","dominant-baseline"],oi=["points","fill","fill-opacity","stroke","stroke-width","stroke-dasharray"],ai=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],si={class:"dss-chart-logos"},ri=["cx","cy","r","fill"],ii=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],ci=["onClick","onMouseenter"],ui=["src"],di={class:"dss-marker-tooltip-category"},mi={key:0,class:"dss-marker-tooltip-description"},pi={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},fi={class:"dss-tooltip-title dss-spider-tooltip-area-title"},vi={class:"dss-tooltip-series-name"},gi={class:"dss-tooltip-series-value"},hi={key:1,class:"dss-tooltip-section"},yi={key:0,class:"dss-tooltip-title"},ki={class:"dss-bubble-tooltip-data"},Ci={key:2,class:"dss-tooltip-section"},bi={class:"dss-tooltip-title"},wi={class:"dss-tooltip-value"},xi={key:0,class:"dss-tooltip-section"},Ei={class:"dss-tooltip-section-title"},Si={class:"dss-tooltip-group-header"},Vi={class:"dss-tooltip-item-content"},Ni={class:"dss-tooltip-item-text"},Bi={key:1,class:"dss-tooltip-section"},Mi={class:"dss-tooltip-section-title"},_i={class:"dss-tooltip-item-content"},$i={class:"dss-tooltip-item-title"},Li={key:0,class:"dss-tooltip-item-description"},Ti={class:"dss-tooltip-section"},Ai={class:"dss-tooltip-title"},Di={key:0,class:"dss-bubble-tooltip-data"},Hi={class:"dss-tooltip-series-name"},Ri={class:"dss-tooltip-series-value"},Fi={key:0,class:"dss-tooltip-section"},Ii={class:"dss-tooltip-section-title"},zi={class:"dss-tooltip-group-header"},Pi={class:"dss-tooltip-item-content"},Oi={class:"dss-tooltip-item-text"},qi={key:1,class:"dss-tooltip-section"},Zi={class:"dss-tooltip-section-title"},Wi={class:"dss-tooltip-item-content"},Ui={class:"dss-tooltip-item-title"},Xi={key:0,class:"dss-tooltip-item-description"},Yi=["onClick","onMouseenter"],ji={class:"dss-legend-text"},Ki={key:1,class:"dss-context-menu-separator"},Gi={key:0,class:"dss-context-menu-separator"},Qi={key:0,class:"dss-context-menu-separator"},Ji=["onClick"],ec=["innerHTML"],tc={key:0,class:"dss-context-menu-icon"},nc={class:"dss-marker-modal-header"},lc={class:"dss-marker-modal-body"},oc={class:"dss-form-group"},ac={class:"dss-form-group"},sc={for:"dss-marker-description"},rc={key:0,class:"dss-form-text-display"},ic=["placeholder"],cc={class:"dss-marker-modal-footer"},uc={class:"modal-footer-left"},dc={class:"dss-modal-footer-right"},mc=["disabled"],pc={name:"DSSChart"},fc=Object.assign(pc,{props:{series:{type:Array,required:!0,default:()=>[]},categories:{type:Array,default:()=>[]},flags:{type:Array,default:()=>[]},markers:{type:Array,default:()=>[]},showAddMarkerButton:{type:Boolean,default:!0},chartId:{type:String,default:()=>"chart-"+Math.random().toString(36).substring(2,9)},i18n:{type:Object,default:null},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:L=>typeof L=="object"&&L!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(L,{emit:ne}){const{t:_,locale:D}=co.useI18n(),ce=ne,z=e.ref(null),M=e.ref(null),fe=e.ref(null),dt=e.ref(0),ee=e.ref(0);let v=null,we=null;const ke=20,J=e.computed(()=>{if(ee.value,dt.value,!z.value||!M.value)return 0;try{const t=z.value.getBoundingClientRect();return M.value.getBoundingClientRect().top-t.top}catch{return 0}}),X=e.computed(()=>`chart-clip-${F.chartId}`),me=e.computed(()=>`url(#${X.value})`),F=L,Se={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}},miniRadial:{minVisiblePercent:1,trackColor:"#E5E7EB",thresholds:{low:33,medium:66},colors:{low:"#E53E3E",medium:"#ED8936",high:"#38A169"}},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,comparison:{fillOpacity:0,strokeDasharray:"6,4",usePrimaryColor:!0,bubbleSize:0}},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 Ae(t,a){const n=Object.assign({},t);return ft(t)&&ft(a)&&Object.keys(a).forEach(r=>{ft(a[r])?r in t?n[r]=Ae(t[r],a[r]):Object.assign(n,{[r]:a[r]}):Object.assign(n,{[r]:a[r]})}),n}const lt=()=>{let t=20,a=0,n=0;if(ot.value&&(t+=30),kt.value&&(t+=25),j.value&&F.series.length>0){const r=F.series.filter((p,g)=>!Ft.value.has(g)).length;if(ge.value==="top"||ge.value==="bottom"){if(Be.value==="horizontal"){const g=Math.floor(Ee.value/100);a=Math.ceil(r/g)*25+10}else a=r*25+10;t+=a}else n=150}return{height:t,legendHeight:a,legendWidth:n}};function ft(t){return t&&typeof t=="object"&&!Array.isArray(t)}const Z=e.computed(()=>Ae(Se,F.options)),De=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.width==="auto"}),We=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.height==="auto"}),Ee=e.computed(()=>{const t=Z.value;return De.value?dt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),_e=e.ref(ke),Xe=e.computed(()=>{if(We.value){const t=Xe.value;return t??Math.max(0,(ee.value||400)-_e.value*5)}}),re=e.computed(()=>{const t=Z.value;if(Ce.value==="mini-radial")return Ee.value;if(We.value){const a=Xe.value;return a??Math.max(0,(ee.value||400)-_e.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),tt=e.computed(()=>{if(We.value&&Ce.value==="semi-radial"&&Xe.value!=null)return _e.value+re.value+"px";if(We.value)return"100%";if(Sn.value)return _e.value+re.value+"px";if(j.value&&ge.value==="bottom"){const t=lt();return re.value+(t.legendHeight||35)+"px"}return re.value+(j.value?20:0)+"px"}),Ce=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),nt=e.computed(()=>{const t=F.series.map(a=>a.type||Ce.value);return new Set(t).size>1}),ot=e.computed(()=>{const t=Z.value;return t&&t.title&&t.title.text?t.title.text:""}),kt=e.computed(()=>{const t=Z.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),Vt=e.computed(()=>{const t=Z.value;if(!t||!t.zAxis)return"";const a=t.zAxis;return typeof a=="string"?a:a&&typeof a.label=="string"?a.label:""}),Ht=e.computed(()=>{const t=Z.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),zt=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),Nt=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),bt=e.computed(()=>{const t=Nt.value;return t&&t.title&&t.title.text?t.title.text:""}),Xt=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return Dn;const a=t.yAxis.min;return typeof a=="number"||a===Dn?a:Dn}),mt=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return Dn;const a=t.yAxis.max;return typeof a=="number"||a===Dn?a:Dn}),tn=e.computed(()=>{const t=Nt.value;if(!t)return Dn;const a=t.min;return typeof a=="number"||a===Dn?a:Dn}),Y=e.computed(()=>{const t=Nt.value;if(!t)return Dn;const a=t.max;return typeof a=="number"||a===Dn?a:Dn}),ye=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),xe=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),Pe=e.computed(()=>{const t=Z.value;return t&&t.grid&&t.grid.show!==!1}),j=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.show!==!1}),ge=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Be=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Fe=e.computed(()=>{const t=Z.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Ye=e.computed(()=>{const t=Z.value;if(!t||!t.crosshair)return!1;const a=t.crosshair.show;return a===!0||a==="true"}),wt=e.computed(()=>{const t=Z.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),et=e.computed(()=>{const t=Z.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Yt=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Ue=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Oe=e.computed(()=>{const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Tt=e.computed(()=>{if(!Sn.value)return 0;const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),Lt=e.computed(()=>{const t=Z.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),le=e.computed(()=>{const{maxX:t}=St.value;return t===0}),W=(t,a)=>le.value&&a===0?5:a,U=t=>{const a=Number(t);return!Number.isFinite(a)||a<=0?0:a},ie=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),he=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),Ge=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),At=e.computed(()=>{const t=Z.value;return he.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),jt=e.computed(()=>{const t=Z.value,a=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return a.length>0?a:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),at=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.enabled!==!1}),sn=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),S=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),b=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),V=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),K=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),oe=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.onDataChange!==!1}),He=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Ct=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),st=e.computed(()=>Z.value?.spider?.gridSteps||5),ze=e.computed(()=>{const t=[],a=st.value;for(let n=1;n<=a;n++)t.push(ut.value/a*n);return t}),xt=t=>{const a=Mt.value;if(a&&Array.isArray(a)&&a[t]!==void 0)return a[t].toString();const n=ze.value[t];return Math.round(n/ut.value*100)+"%"},Mt=e.computed(()=>Z.value?.spider?.gridLabels||null),Et=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),ct=e.computed(()=>{const t=Z.value,a={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...a,...t.contextMenu.items}:a}),Dt=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Bt=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Un.value}),rn=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Vn=e.computed(()=>{const t=Z.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Wn=e.computed(()=>{const a=Z.value?.valueFormat?.extension;return typeof a=="string"?a:""}),en=t=>{const a=Wn.value;if(t==null)return"";const n=String(t);return a?n+a:n},pn=e.computed(()=>!ae.value.isZooming);e.computed(()=>on.value.map(t=>{if(t.categoryIndex!==void 0&&(En.value||Kt.value)){const a=ln(t.categoryIndex),n=J.value+P.value.bottom-Vn.value/2;return{...t,x:a,y:n}}return t}));function ll(t,a){let n;if(t instanceof Date)n=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,C,w]=t.split("-"),O=Number(w?.length===2?`20${w}`:w);n=new Date(O,Number(C)-1,Number(g))}else return 0;let r=0,p=1/0;return a.forEach((g,C)=>{const[w,O,N]=g.split("-"),H=Number(N?.length===2?`20${N}`:N),$=new Date(H,Number(O)-1,Number(w)),Q=Math.abs($-n);Q<p&&(p=Q,r=C)}),r}const vl=e.computed(()=>{const t=F.markers.map(n=>{const r=ll(n.marker_date,F.categories),p=ln(r),g=J.value+P.value.bottom-Vn.value/2;return{...n,x:p,y:g,categoryIndex:r,source:"props"}}),a=on.value.map(n=>{if(n.categoryIndex!==void 0&&(En.value||Kt.value)){const r=ln(n.categoryIndex),p=J.value+P.value.bottom-Vn.value/2;return{...n,x:r,y:p,source:"internal"}}return{...n,source:"internal"}});return[...t,...a]}),il=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.enabled===!0}),_n=e.computed(()=>{const t=Z.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),gl=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),$n=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),Vl=e.computed(()=>{const t={left:P.value.left,top:P.value.top,width:P.value.width,height:P.value.height};let a,n;const r=String(gl.value);if(r.includes("%")){const p=parseFloat(r)/100;a=t.width*p,n=a*(96/499)}else{const p=parseFloat(r)||25;a=Math.min(t.width*.25,200)*(p/25),n=a*(96/499)}return{width:a,height:n,area:t}}),Rl=e.computed(()=>{const{width:t,height:a}=Vl.value,n=$n.value;let r,p;const g=P.value.left,C=P.value.right,w=P.value.top,O=P.value.bottom,N=P.value.width,H=P.value.height;switch(n){case"center":r=g+(N-t)/2,p=w+(H-a)/2;break;case"top-left":r=g+15,p=w+5;break;case"top-right":r=C-t-15,p=w+5;break;case"bottom-left":r=g+15,p=O-a-5;break;case"bottom-right":default:r=C-t-15,p=O-a-5;break}return{backgroundPositionX:r+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${a}px`}}),hl=t=>!F.flags||!F.flags.length?[]:F.flags.filter(a=>a.categoryIndex===t),An=t=>{const a=hl(t),n=kl(t),r=a.filter(C=>C.manual),p=a.filter(C=>!C.manual),g=[];return r.length>0&&g.push({type:_("chart.tooltip.manualFlags"),color:"#698dbe",flags:r.map(C=>({text:C.text,color:"#698dbe"}))}),p.length>0&&g.push({type:_("chart.tooltip.autoFlags"),color:"#a1d499",flags:p.map(C=>({text:C.text,color:"#a1d499"}))}),{flagGroups:g,markers:n.map(C=>({title:C.title,description:C.description,type:_("chart.tooltip.markers"),color:C.color||"#9784ba"}))}},Un=e.computed(()=>{const t=F.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"),co=require("vue-i18n"),$a={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},La=["value"],Ta=["placeholder","value","disabled"],Aa=["placeholder","value"],Da=["placeholder","value"],Ha=["aria-selected","onClick"],Ra={class:"dss-datepicker__list-item-label"},Fa={key:0,class:"dss-datepicker__list-item-check",width:"16",height:"16",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},Ia={key:1,class:"dss-datepicker__list-empty"},za={key:1,class:"dss-datepicker__double-wrap"},Pa={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},Oa=["disabled","onClick"],qa={class:"dss-datepicker__double-calendars"},Wa={class:"dss-datepicker__double-calendar"},Za={class:"dss-datepicker__calendar-header"},Ua=["aria-label"],Xa={class:"dss-datepicker__month-year-row"},Ya=["aria-label"],ja={class:"dss-datepicker__weekdays"},Ka={class:"dss-datepicker__grid"},Ga=["disabled","onClick","onMouseenter"],Qa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ja={class:"dss-datepicker__double-calendar"},es={class:"dss-datepicker__calendar-header"},ts=["aria-label"],ns={class:"dss-datepicker__month-year-row"},ls=["aria-label"],os={class:"dss-datepicker__weekdays"},as={class:"dss-datepicker__grid"},ss=["disabled","onClick","onMouseenter"],rs={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},is={class:"dss-datepicker__calendar-header"},cs=["aria-label"],us={class:"dss-datepicker__month-year-row"},ds=["aria-label"],ms={class:"dss-datepicker__weekdays"},ps={class:"dss-datepicker__grid"},fs=["disabled","onClick","onMouseenter"],vs={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},gs={class:"dss-datepicker__calendar-header"},hs={class:"dss-datepicker__month-year-row"},ys={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},ks={class:"dss-datepicker__months-grid"},Cs=["onClick"],bs={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},ws={class:"dss-datepicker__month-year"},xs={class:"dss-datepicker__years-grid"},Es=["data-year","onClick"],ua=27,Wl=8,la={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:L=>["single","range","singleFromAvailable","rangeFromAvailable","listFromAvailable","readonly"].includes(L)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0},placeholder:{type:String,default:""}},emits:["update:modelValue"],setup(L,{emit:ne}){const _=L,D=ne,{t:ce,locale:z}=co.useI18n(),M=e.ref(!1),fe=e.ref("days"),mt=new Date,J=e.computed(()=>_.minDate instanceof Date?_.minDate:mt),v=e.ref(J.value.getMonth()),we=e.ref(J.value.getFullYear()),Ce=e.ref(J.value.getMonth()),Q=e.ref(J.value.getFullYear()),Y=e.ref(J.value.getMonth()),me=e.ref(J.value.getFullYear()),F=e.ref("start"),Ee=e.ref(null),Ae=e.ref(null);function tt(){const T=J.value,I=T.getMonth(),B=T.getFullYear(),te=I===11?0:I+1,Te=I===11?B+1:B;return{left:{month:I,year:B},right:{month:te,year:Te}}}const ft=e.ref(null),Z=e.ref(null),De=e.ref(null),We=e.ref(null),xe=e.ref(null),_e=e.ref(null),je=e.ref(null),se=e.ref(null),et=new Date().getFullYear(),ke=e.computed(()=>["single","singleFromAvailable"].includes(_.mode)),nt=e.computed(()=>["range","rangeFromAvailable"].includes(_.mode)),ut=e.computed(()=>_.mode==="listFromAvailable"),st=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes(_.mode))return null;const T=_.modelValue;return T instanceof Date?T:null}),Vt=e.computed(()=>{if(!nt.value)return{start:null,end:null};const T=_.modelValue;return!T||typeof T!="object"?{start:null,end:null}:{start:T.start instanceof Date?T.start:null,end:T.end instanceof Date?T.end:null}});function zt(T){if(!T||!(T instanceof Date))return"";const I=T.getDate(),B=T.getMonth()+1,te=T.getFullYear(),Te=vt=>String(vt).padStart(2,"0");return`${Te(I)}/${Te(B)}/${te}`}const Ht=e.computed(()=>zt(st.value)),Nt=e.computed(()=>{const{start:T,end:I}=Vt.value;if(!T&&!I)return"";const B=!I||T&&T<=I?T:I,te=!T||I&&I>=T?I:T;return Yt(B,te)?zt(B):`${zt(B)} - ${zt(te)}`}),bt=e.computed(()=>{if(_.mode!=="readonly")return"—";const T=_.modelValue;if(T instanceof Date)return zt(T)||"—";if(T&&typeof T=="object"&&("start"in T||"end"in T)){const I=T.start instanceof Date?T.start:null,B=T.end instanceof Date?T.end:null;if(!I&&!B)return"—";const te=!B||I&&I<=B?I:B,Te=!I||B&&B>=I?B:I;return Yt(te,Te)?zt(te):`${zt(te)} - ${zt(Te)}`}return"—"});e.computed(()=>{const T=new Date(we.value,v.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(T)});const Jt=e.computed(()=>Ae.value==="left"?Ce.value:Ae.value==="right"?Y.value:v.value),dt=e.computed(()=>Ae.value==="left"?Q.value:Ae.value==="right"?me.value:we.value),en=e.computed(()=>{const T=new Date(we.value,v.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(T)}),Ct=e.computed(()=>{const T=new Date(dt.value,Jt.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(T)}),ee=e.computed(()=>{const T=new Intl.DateTimeFormat(z.value,{month:"short"});return Array.from({length:12},(I,B)=>T.format(new Date(2024,B,1)))}),ve=e.computed(()=>{const I=(Ae.value?dt.value:we.value)-Math.floor(ua/2);return Array.from({length:ua},(B,te)=>I+te)}),Ne=e.computed(()=>{const T=ve.value;return T.length?`${T[0]} – ${T[T.length-1]}`:""});function q(T){return T===7?0:T}function ge(T){try{const I=new Intl.Locale(T);if(I.weekInfo?.firstDay!=null)return q(I.weekInfo.firstDay)}catch{}return 1}function Be(T){const I=new Date(2024,0,1),B=(I.getDay()-T+7)%7,te=new Date(I);return te.setDate(I.getDate()-B),te}const Fe=e.computed(()=>ge(z.value)),Ue=e.computed(()=>{const T=new Intl.DateTimeFormat(z.value,{weekday:"short"}),I=Be(Fe.value),B=[];for(let te=0;te<7;te++){const Te=new Date(I);Te.setDate(I.getDate()+te),B.push(T.format(Te).slice(0,2))}return B});function wt(T,I,B){const te=new Date(T,I,1),Te=new Date(T,I+1,0),vt=(te.getDay()-B+7)%7,pt=Te.getDate(),at=[];for(let rt=0;rt<vt;rt++)at.push(null);for(let rt=1;rt<=pt;rt++)at.push(new Date(T,I,rt));return at}const Ge=e.computed(()=>wt(we.value,v.value,Fe.value)),Xt=e.computed(()=>wt(Q.value,Ce.value,Fe.value)),Ze=e.computed(()=>wt(me.value,Y.value,Fe.value));e.computed(()=>{const T=new Date(Q.value,Ce.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(T)}),e.computed(()=>{const T=new Date(me.value,Y.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(T)});const Pe=e.computed(()=>{const T=new Date(Q.value,Ce.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(T)}),Tt=e.computed(()=>{const T=new Date(me.value,Y.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(T)}),Lt=e.computed(()=>_.availableDates&&_.availableDates.length>0),le=e.computed(()=>Lt.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"}]),U=e.ref({top:0,left:0}),X=e.ref("left");let ie=null;function ye(){M.value&&e.nextTick(()=>{M.value&&(ie!==null&&window.cancelAnimationFrame(ie),ie=window.requestAnimationFrame(()=>{ie=null,Ke()}))})}function Ke(){if(!xe.value||!M.value)return;const T=xe.value.getBoundingClientRect(),I=window.innerWidth||document.documentElement.clientWidth,B=window.innerHeight||document.documentElement.clientHeight;let te=T.left,Te=T.bottom+4;const vt=_e.value;if(vt){const pt=vt.offsetWidth,at=vt.offsetHeight;X.value==="right"||te+pt>I-Wl?(X.value="right",te=T.right-pt):X.value="left";const vn=Math.max(Wl,I-pt-Wl);if(te=Math.min(Math.max(te,Wl),vn),Te+at>B-Wl){const bn=T.top-4-at;bn>=Wl?Te=bn:Te=Math.max(Wl,B-at-Wl)}}U.value={top:Te,left:te}}const At=e.computed(()=>!xe.value||!M.value?{}:{position:"fixed",left:`${U.value.left}px`,top:`${U.value.top}px`,zIndex:1002});function Yt(T,I){return!T||!I?!1:T.getFullYear()===I.getFullYear()&&T.getMonth()===I.getMonth()&&T.getDate()===I.getDate()}function lt(T){return new Date(T.getFullYear(),T.getMonth(),T.getDate()).getTime()}function sn(T){return!_.availableDates||!_.availableDates.length?!0:_.availableDates.some(I=>I instanceof Date&&Yt(I,T))}function S(T){const I=lt(T);return!(_.minDate instanceof Date&&I<lt(_.minDate)||_.maxDate instanceof Date&&I>lt(_.maxDate))}function b(T){const I=new Date(T);return new Date(I.getFullYear(),I.getMonth(),I.getDate())}function V(T){return T.filter(I=>S(I))}function j(T,I){if(!(T instanceof Date)||!(I instanceof Date))return null;let B=lt(T),te=lt(I);if(B>te&&([B,te]=[te,B]),_.minDate instanceof Date){const Te=lt(_.minDate);B=Math.max(B,Te),te=Math.max(te,Te)}if(_.maxDate instanceof Date){const Te=lt(_.maxDate);B=Math.min(B,Te),te=Math.min(te,Te)}return B>te?null:{start:b(B),end:b(te)}}function oe(T){return!_.exceptDates||!_.exceptDates.length?!1:_.exceptDates.some(I=>I instanceof Date&&Yt(I,T))}function He(T){return oe(T)?!1:["singleFromAvailable","rangeFromAvailable"].includes(_.mode)?sn(T):S(T)}function kt(T){const I=st.value,B=Vt.value,te=lt(T),Te=nt.value&&B.start&&B.end&&te>lt(B.start)&&te<lt(B.end),vt=nt.value&&B.start&&Yt(T,B.start),pt=nt.value&&B.end&&Yt(T,B.end),at=vt&&pt,rt=ke.value&&I&&Yt(T,I)||vt||pt;let vn=!1;if(nt.value&&B.start&&!B.end&&Ee.value){const bn=lt(B.start),qt=lt(Ee.value),gn=Math.min(bn,qt),Kt=Math.max(bn,qt);vn=te>gn&&te<Kt}return{"dss-datepicker__day--selected":rt&&!at,"dss-datepicker__day--range-start":vt&&!at,"dss-datepicker__day--range-end":pt&&!at,"dss-datepicker__day--range-single":at,"dss-datepicker__day--in-range":Te&&!vt&&!pt,"dss-datepicker__day--in-range-preview":vn&&!vt&&!pt&&!Te,"dss-datepicker__day--disabled":!He(T)}}function ot(T){if(!nt.value)return;const I=Vt.value;if(!I.start||I.end){Ee.value=null;return}if(!He(T)){Ee.value=null;return}Ee.value=new Date(T.getFullYear(),T.getMonth(),T.getDate())}function ze(){Ee.value=null}function xt(){if(!_.doubleCalendar||!nt.value)return;const T=Vt.value,{start:I,end:B}=T;if(I&&B){const vt=I<=B?I:B,pt=I<=B?B:I,at=vt.getMonth(),rt=vt.getFullYear(),vn=pt.getMonth(),bn=pt.getFullYear();if(at!==vn||rt!==bn){const qt=Ce.value===at&&Q.value===rt,gn=Y.value===vn&&me.value===bn;if(qt&&gn)return;Ce.value=at,Q.value=rt,Y.value=vn,me.value=bn}else{const qt=at===0?11:at-1,gn=at===0?rt-1:rt;Ce.value===qt&&Q.value===gn&&Y.value===at&&me.value===rt||(Ce.value=at,Q.value=rt,at===11?(Y.value=0,me.value=rt+1):(Y.value=at+1,me.value=rt))}return}const te=I||B;if(te){const vt=te.getMonth(),pt=te.getFullYear(),at=Ce.value===vt&&Q.value===pt,rt=Y.value===vt&&me.value===pt;if(at||rt)return;Ce.value=vt,Q.value=pt,vt===11?(Y.value=0,me.value=pt+1):(Y.value=vt+1,me.value=pt);return}const Te=tt();Ce.value=Te.left.month,Q.value=Te.left.year,Y.value=Te.right.month,me.value=Te.right.year}const Mt=e.computed(()=>new Intl.DateTimeFormat(z.value,{day:"2-digit",month:"long",year:"numeric"})),Et=e.computed(()=>{if(!ut.value)return[];const T=(_.availableDates||[]).filter(B=>B instanceof Date&&!Number.isNaN(B.getTime())).filter(B=>!oe(B)&&S(B)).map(B=>new Date(B.getFullYear(),B.getMonth(),B.getDate()));T.sort((B,te)=>te.getTime()-B.getTime());const I=st.value;return T.map(B=>({date:B,ts:B.getTime(),label:Mt.value.format(B),selected:!!(I&&Yt(B,I))}))});function it(){if(M.value){rn();return}xe.value=We.value?.closest(".dss-datepicker__input-wrap"),X.value="left",M.value=!0,ye(),e.nextTick(()=>{se.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function Dt(T){if(!(T instanceof Date))return;const I=new Date(T.getFullYear(),T.getMonth(),T.getDate());D("update:modelValue",I),rn()}function Bt(T="start"){if(_.mode==="readonly")return;F.value=T;const I=st.value,B=Vt.value;if(ke.value&&I)v.value=I.getMonth(),we.value=I.getFullYear();else if(nt.value)if(_.doubleCalendar)xt();else{const te=T==="start"&&B.start?B.start:B.end||B.start;te&&(v.value=te.getMonth(),we.value=te.getFullYear())}xe.value=ke.value?ft.value?.closest(".dss-datepicker__input-wrap"):Z.value,fe.value="days",Ae.value=null,X.value="left",M.value=!0,ye()}function rn(){fe.value="days",Ae.value=null,Ee.value=null,M.value=!1}function Vn(T,I){Ae.value=T,fe.value=I}function Zn(){fe.value="days",Ae.value=null}function tn(T){const I=new Date,B=I.getFullYear(),te=I.getMonth(),Te=I.getDate();let vt,pt;if(Lt.value){const at=V([..._.availableDates].filter(rt=>rt instanceof Date).map(rt=>new Date(rt.getFullYear(),rt.getMonth(),rt.getDate()))).sort((rt,vn)=>rt.getTime()-vn.getTime());if(at.length===0)return null;if(T==="all")vt=at[0],pt=at[at.length-1];else{const rt=parseInt(T.replace("last",""),10);if(rt<2||rt>5)return null;const vn=at.slice(-rt);if(vn.length===0)return null;vt=vn[0],pt=vn[vn.length-1]}}else{const at=new Date(B,te,Te);switch(T){case"today":vt=at,pt=at;break;case"lastWeek":vt=new Date(B,te,Te-6),pt=at;break;case"last15Days":vt=new Date(B,te,Te-14),pt=at;break;case"last30Days":vt=new Date(B,te,Te-29),pt=at;break;case"thisMonth":vt=new Date(B,te,1),pt=at;break;case"last3Months":vt=new Date(B,te-3,1),pt=new Date(B,te,0);break;case"last6Months":vt=new Date(B,te-6,1),pt=new Date(B,te,0);break;case"last12Months":vt=new Date(B,te-12,1),pt=new Date(B,te,0);break;case"lastYear":vt=new Date(B-1,0,1),pt=new Date(B-1,11,31);break;default:return null}}return{start:vt,end:pt}}function pn(T){const I=tn(T);return I?j(I.start,I.end):null}function ll(T){return pn(T)!==null}function vl(T){const I=pn(T);I&&(D("update:modelValue",I),xt())}function il(T){Ae.value==="left"?Ce.value=T:Ae.value==="right"?Y.value=T:v.value=T,Zn()}function _n(T){Ae.value==="left"?Q.value=T:Ae.value==="right"?me.value=T:we.value=T,Zn()}function gl(){v.value===0?(v.value=11,we.value--):v.value--}function $n(){v.value===11?(v.value=0,we.value++):v.value++}function Vl(){Ce.value===0?(Ce.value=11,Q.value--):Ce.value--}function Rl(){Ce.value===11?(Ce.value=0,Q.value++):Ce.value++}function hl(){Y.value===0?(Y.value=11,me.value--):Y.value--}function An(){Y.value===11?(Y.value=0,me.value++):Y.value++}function Un(T){if(!He(T))return;const I=new Date(T.getFullYear(),T.getMonth(),T.getDate());if(ke.value){D("update:modelValue",I),rn();return}const B=Vt.value;if(!B.start&&!B.end){D("update:modelValue",{start:I,end:null}),F.value="end";return}if(B.start&&B.end){D("update:modelValue",{start:I,end:null}),F.value="end";return}if(F.value==="start"){let te=I,Te=B.end;te&&Te&&te>Te&&([te,Te]=[Te,te]),D("update:modelValue",{start:te||Te,end:Te||te}),F.value="end"}else{let te=B.start,Te=I;te&&Te&&Te<te&&([te,Te]=[Te,te]),D("update:modelValue",{start:te||Te,end:Te||te}),F.value="start"}}e.watch(Vt,()=>{_.doubleCalendar&&nt.value&&M.value&&xt()},{deep:!0});let Xn=null,Hn=null,zn=null;function Nl(){Xn&&(document.removeEventListener("keydown",Xn),Xn=null),Hn&&(window.removeEventListener("resize",Hn),Hn=null),zn&&(window.removeEventListener("scroll",zn,!0),zn=null)}return e.watch(fe,T=>{T==="years"&&e.nextTick(()=>{je.value?.querySelector(`[data-year="${dt.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[M.value,fe.value,v.value,we.value,Ce.value,Q.value,Y.value,me.value,Ae.value,_.doubleCalendar,_.quickSelect],()=>{ye()}),e.watch(M,T=>{Nl(),T&&(Xn=I=>{I.key==="Escape"&&(fe.value==="years"||fe.value==="months"?Zn():rn())},Hn=()=>{Ke()},zn=()=>{Ke()},document.addEventListener("keydown",Xn),window.addEventListener("resize",Hn),window.addEventListener("scroll",zn,!0))}),e.onBeforeUnmount(()=>{ie!==null&&(window.cancelAnimationFrame(ie),ie=null),Nl()}),(T,I)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":L.mode==="readonly"}])},[L.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",$a,[I[10]||(I[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:bt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,La)])):ke.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:I[0]||(I[0]=B=>Bt("start"))},[I[11]||(I[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:ft,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(ce)("datepicker.selectDate"),value:Ht.value,readonly:"",disabled:L.mode==="readonly"},null,8,Ta)])):ut.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-datepicker__input-wrap dss-datepicker__input-wrap--list",{"dss-datepicker__input-wrap--open":M.value}]),onClick:it},[I[13]||(I[13]=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:"inputListRef",ref:We,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(ce)("datepicker.selectFromList"),value:Ht.value,readonly:""},null,8,Aa),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":M.value}]),"aria-hidden":"true"},[...I[12]||(I[12]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"})],-1)])],2)],2)):nt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:Z,onClick:I[1]||(I[1]=B=>Bt("start"))},[I[14]||(I[14]=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:De,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(ce)("datepicker.selectRange"),value:Nt.value,readonly:""},null,8,Da)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[M.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(rn,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:_e,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":L.doubleCalendar&&nt.value&&fe.value==="days","dss-datepicker__dropdown--quick-select":L.doubleCalendar&&nt.value&&fe.value==="days"&&L.quickSelect,"dss-datepicker__dropdown--list":ut.value}]),onClick:I[9]||(I[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(At.value)},[ut.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Et.value.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"dss-datepicker__list",role:"listbox",ref_key:"listRef",ref:se},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Et.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B.ts,role:"option","aria-selected":B.selected,class:e.normalizeClass(["dss-datepicker__list-item",{"dss-datepicker__list-item--selected":B.selected}]),onClick:te=>Dt(B.date)},[e.createElementVNode("span",Ra,e.toDisplayString(B.label),1),B.selected?(e.openBlock(),e.createElementBlock("svg",Fa,[...I[15]||(I[15]=[e.createElementVNode("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"},null,-1)])])):e.createCommentVNode("",!0)],10,Ha))),128))],512)):(e.openBlock(),e.createElementBlock("div",Ia,e.toDisplayString(e.unref(ce)("datepicker.noAvailableDates")),1))],64)):fe.value==="days"&&L.doubleCalendar&&nt.value?(e.openBlock(),e.createElementBlock("div",za,[L.quickSelect?(e.openBlock(),e.createElementBlock("nav",Pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(le.value,B=>(e.openBlock(),e.createElementBlock("button",{key:B.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!ll(B.id),onClick:te=>vl(B.id)},e.toDisplayString(e.unref(ce)(B.labelKey)),9,Oa))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",qa,[e.createElementVNode("div",Wa,[e.createElementVNode("div",Za,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:Vl}," ‹ ",8,Ua),e.createElementVNode("div",Xa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[2]||(I[2]=B=>Vn("left","months"))},e.toDisplayString(Pe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[3]||(I[3]=B=>Vn("left","years"))},e.toDisplayString(Q.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:Rl}," › ",8,Ya)]),e.createElementVNode("div",ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,B=>(e.openBlock(),e.createElementBlock("span",{key:B,class:"dss-datepicker__weekday"},e.toDisplayString(B),1))),128))]),e.createElementVNode("div",Ka,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xt.value,(B,te)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+te},[B?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",kt(B)]),disabled:!He(B),onClick:Te=>Un(B),onMouseenter:Te=>ot(B),onMouseleave:ze},e.toDisplayString(B.getDate()),43,Ga)):(e.openBlock(),e.createElementBlock("span",Qa))],64))),128))])]),e.createElementVNode("div",Ja,[e.createElementVNode("div",es,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:hl}," ‹ ",8,ts),e.createElementVNode("div",ns,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[4]||(I[4]=B=>Vn("right","months"))},e.toDisplayString(Tt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[5]||(I[5]=B=>Vn("right","years"))},e.toDisplayString(me.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:An}," › ",8,ls)]),e.createElementVNode("div",os,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,B=>(e.openBlock(),e.createElementBlock("span",{key:B,class:"dss-datepicker__weekday"},e.toDisplayString(B),1))),128))]),e.createElementVNode("div",as,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,(B,te)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+te},[B?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",kt(B)]),disabled:!He(B),onClick:Te=>Un(B),onMouseenter:Te=>ot(B),onMouseleave:ze},e.toDisplayString(B.getDate()),43,ss)):(e.openBlock(),e.createElementBlock("span",rs))],64))),128))])])])])):fe.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",is,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:gl}," ‹ ",8,cs),e.createElementVNode("div",us,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[6]||(I[6]=B=>fe.value="months")},e.toDisplayString(en.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[7]||(I[7]=B=>fe.value="years")},e.toDisplayString(we.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:$n}," › ",8,ds)]),e.createElementVNode("div",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,B=>(e.openBlock(),e.createElementBlock("span",{key:B,class:"dss-datepicker__weekday"},e.toDisplayString(B),1))),128))]),e.createElementVNode("div",ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,(B,te)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:te},[B?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",kt(B)]),disabled:!He(B),onClick:Te=>Un(B),onMouseenter:Te=>ot(B),onMouseleave:ze},e.toDisplayString(B.getDate()),43,fs)):(e.openBlock(),e.createElementBlock("span",vs))],64))),128))])],64)):fe.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",gs,[e.createElementVNode("div",hs,[e.createElementVNode("span",ys,e.toDisplayString(Ct.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:I[8]||(I[8]=B=>fe.value="years")},e.toDisplayString(dt.value),1)])]),e.createElementVNode("div",ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,(B,te)=>(e.openBlock(),e.createElementBlock("button",{key:te,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":te===Jt.value}]),onClick:Te=>il(te)},e.toDisplayString(B),11,Cs))),128))])],64)):fe.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",bs,[e.createElementVNode("span",ws,e.toDisplayString(Ne.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:je},[e.createElementVNode("div",xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,B=>(e.openBlock(),e.createElementBlock("button",{key:B,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":B===dt.value,"dss-datepicker__year-cell--current":B===e.unref(et)}]),"data-year":B,onClick:te=>_n(B)},e.toDisplayString(B),11,Es))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Ss=["data-chart-type"],Vs={class:"dss-chart-header-titles"},Ns={key:0,class:"dss-chart-title"},Bs={key:1,class:"dss-chart-subtitle"},Ms=["onClick","onMouseenter"],_s={class:"dss-legend-text"},$s=["onClick","onMouseenter"],Ls={class:"dss-legend-text"},Ts=["title"],As=["src"],Ds={class:"dss-chart-area-wrapper"},Hs={key:0,class:"dss-chart-z-axis-label"},Rs=["width","height","data-smooth","data-animated"],Fs=["id"],Is=["y","width","height"],zs=["id"],Ps=["d"],Os=["id"],qs=["d"],Ws={key:0},Zs=["clip-path"],Us=["x1","x2","y1","y2"],Xs={class:"dss-axes"},Ys=["x1","x2","y1","y2"],js=["x1","x2","y1","y2"],Ks=["x1","x2","y1","y2"],Gs={class:"dss-axis-labels"},Qs=["x","y"],Js=["x","y"],er=["x","y"],tr=["x","y"],nr=["y","transform"],lr=["x","y","transform"],or={key:1,class:"dss-flag-markers"},ar=["clip-path"],sr=["x1","x2","y1","y2","onMouseover"],rr=["x1","x2","y1","y2","onMouseover"],ir=["x1","x2","y1","y2","onMouseover"],cr=["cx","cy","onMouseover"],ur=["cx","cy","fill","onMouseover"],dr=["x","y"],mr=["clip-path"],pr={key:0},fr=["d","onMouseover"],vr=["x","y","width","height","fill","onMouseover"],gr={class:"dss-line-chart"},hr=["d","stroke","stroke-width","stroke-dasharray"],yr=["d","stroke","stroke-width","opacity"],kr=["cx","cy","r","fill","onMouseover"],Cr={key:1},br=["d","stroke","stroke-width","stroke-dasharray"],wr=["d","stroke","stroke-width","stroke-dasharray"],xr=["d","stroke","stroke-width","opacity"],Er=["cx","cy","r","fill","onMouseover"],Sr={key:2},Vr=["id"],Nr=["x","y","width","height"],Br=["d","fill","fill-opacity","mask"],Mr=["d","stroke","stroke-width"],_r=["d","fill","onMouseover"],$r=["x","y","width","height","onMouseover"],Lr=["clip-path"],Tr=["x1","x2","y1","y2","stroke"],Ar=["cx","cy","r","fill"],Dr={key:1,class:"dss-bubble-chart"},Hr={key:0,class:"dss-bubble-group"},Rr=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Fr=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Ir=["transform"],zr=["cx","cy","r"],Pr=["data-chart-type","clip-path"],Or=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],qr={key:1,class:"dss-radial-segment-data-labels"},Wr=["x","y"],Zr=["x","y","font-size","fill"],Ur=["x1","y1","x2","y2","stroke"],Xr=["x1","y1","x2","y2","stroke"],Yr=["x","y","text-anchor","font-size"],jr=["transform"],Kr={key:0,class:"dss-spider-grid"},Gr=["cx","cy","r"],Qr={class:"dss-spider-grid-labels"},Jr=["x","y"],ei=["x","y"],ti=["x1","x2","y1","y2"],ni={class:"dss-spider-labels"},li=["x","y","text-anchor","dominant-baseline"],oi=["points","fill","fill-opacity","stroke","stroke-width","stroke-dasharray"],ai=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],si={class:"dss-chart-logos"},ri=["cx","cy","r","fill"],ii=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],ci=["onClick","onMouseenter"],ui=["src"],di={class:"dss-marker-tooltip-category"},mi={key:0,class:"dss-marker-tooltip-description"},pi={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},fi={class:"dss-tooltip-title dss-spider-tooltip-area-title"},vi={class:"dss-tooltip-series-name"},gi={class:"dss-tooltip-series-value"},hi={key:1,class:"dss-tooltip-section"},yi={key:0,class:"dss-tooltip-title"},ki={class:"dss-bubble-tooltip-data"},Ci={key:2,class:"dss-tooltip-section"},bi={class:"dss-tooltip-title"},wi={class:"dss-tooltip-value"},xi={key:0,class:"dss-tooltip-section"},Ei={class:"dss-tooltip-section-title"},Si={class:"dss-tooltip-group-header"},Vi={class:"dss-tooltip-item-content"},Ni={class:"dss-tooltip-item-text"},Bi={key:1,class:"dss-tooltip-section"},Mi={class:"dss-tooltip-section-title"},_i={class:"dss-tooltip-item-content"},$i={class:"dss-tooltip-item-title"},Li={key:0,class:"dss-tooltip-item-description"},Ti={class:"dss-tooltip-section"},Ai={class:"dss-tooltip-title"},Di={key:0,class:"dss-bubble-tooltip-data"},Hi={class:"dss-tooltip-series-name"},Ri={class:"dss-tooltip-series-value"},Fi={key:0,class:"dss-tooltip-section"},Ii={class:"dss-tooltip-section-title"},zi={class:"dss-tooltip-group-header"},Pi={class:"dss-tooltip-item-content"},Oi={class:"dss-tooltip-item-text"},qi={key:1,class:"dss-tooltip-section"},Wi={class:"dss-tooltip-section-title"},Zi={class:"dss-tooltip-item-content"},Ui={class:"dss-tooltip-item-title"},Xi={key:0,class:"dss-tooltip-item-description"},Yi=["onClick","onMouseenter"],ji={class:"dss-legend-text"},Ki={key:1,class:"dss-context-menu-separator"},Gi={key:0,class:"dss-context-menu-separator"},Qi={key:0,class:"dss-context-menu-separator"},Ji=["onClick"],ec=["innerHTML"],tc={key:0,class:"dss-context-menu-icon"},nc={class:"dss-marker-modal-header"},lc={class:"dss-marker-modal-body"},oc={class:"dss-form-group"},ac={class:"dss-form-group"},sc={for:"dss-marker-description"},rc={key:0,class:"dss-form-text-display"},ic=["placeholder"],cc={class:"dss-marker-modal-footer"},uc={class:"modal-footer-left"},dc={class:"dss-modal-footer-right"},mc=["disabled"],pc={name:"DSSChart"},fc=Object.assign(pc,{props:{series:{type:Array,required:!0,default:()=>[]},categories:{type:Array,default:()=>[]},flags:{type:Array,default:()=>[]},markers:{type:Array,default:()=>[]},showAddMarkerButton:{type:Boolean,default:!0},chartId:{type:String,default:()=>"chart-"+Math.random().toString(36).substring(2,9)},i18n:{type:Object,default:null},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:L=>typeof L=="object"&&L!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(L,{emit:ne}){const{t:_,locale:D}=co.useI18n(),ce=ne,z=e.ref(null),M=e.ref(null),fe=e.ref(null),mt=e.ref(0),J=e.ref(0);let v=null,we=null;const Ce=20,Q=e.computed(()=>{if(J.value,mt.value,!z.value||!M.value)return 0;try{const t=z.value.getBoundingClientRect();return M.value.getBoundingClientRect().top-t.top}catch{return 0}}),Y=e.computed(()=>`chart-clip-${F.chartId}`),me=e.computed(()=>`url(#${Y.value})`),F=L,Ee={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}},miniRadial:{minVisiblePercent:1,trackColor:"#E5E7EB",thresholds:{low:33,medium:66},colors:{low:"#E53E3E",medium:"#ED8936",high:"#38A169"}},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,comparison:{fillOpacity:0,strokeDasharray:"6,4",usePrimaryColor:!0,bubbleSize:0}},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 Ae(t,a){const n=Object.assign({},t);return ft(t)&&ft(a)&&Object.keys(a).forEach(r=>{ft(a[r])?r in t?n[r]=Ae(t[r],a[r]):Object.assign(n,{[r]:a[r]}):Object.assign(n,{[r]:a[r]})}),n}const tt=()=>{let t=20,a=0,n=0;if(ut.value&&(t+=30),st.value&&(t+=25),q.value&&F.series.length>0){const r=F.series.filter((p,g)=>!Ft.value.has(g)).length;if(ge.value==="top"||ge.value==="bottom"){if(Be.value==="horizontal"){const g=Math.floor(xe.value/100);a=Math.ceil(r/g)*25+10}else a=r*25+10;t+=a}else n=150}return{height:t,legendHeight:a,legendWidth:n}};function ft(t){return t&&typeof t=="object"&&!Array.isArray(t)}const Z=e.computed(()=>Ae(Ee,F.options)),De=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.width==="auto"}),We=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.height==="auto"}),xe=e.computed(()=>{const t=Z.value;return De.value?mt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),_e=e.ref(Ce),je=e.computed(()=>{if(We.value){const t=je.value;return t??Math.max(0,(J.value||400)-_e.value*5)}}),se=e.computed(()=>{const t=Z.value;if(ke.value==="mini-radial")return xe.value;if(We.value){const a=je.value;return a??Math.max(0,(J.value||400)-_e.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),et=e.computed(()=>{if(We.value&&ke.value==="semi-radial"&&je.value!=null)return _e.value+se.value+"px";if(We.value)return"100%";if(Sn.value)return _e.value+se.value+"px";if(q.value&&ge.value==="bottom"){const t=tt();return se.value+(t.legendHeight||35)+"px"}return se.value+(q.value?20:0)+"px"}),ke=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),nt=e.computed(()=>{const t=F.series.map(a=>a.type||ke.value);return new Set(t).size>1}),ut=e.computed(()=>{const t=Z.value;return t&&t.title&&t.title.text?t.title.text:""}),st=e.computed(()=>{const t=Z.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),Vt=e.computed(()=>{const t=Z.value;if(!t||!t.zAxis)return"";const a=t.zAxis;return typeof a=="string"?a:a&&typeof a.label=="string"?a.label:""}),zt=e.computed(()=>{const t=Z.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),Ht=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),Nt=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),bt=e.computed(()=>{const t=Nt.value;return t&&t.title&&t.title.text?t.title.text:""}),Jt=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return Dn;const a=t.yAxis.min;return typeof a=="number"||a===Dn?a:Dn}),dt=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return Dn;const a=t.yAxis.max;return typeof a=="number"||a===Dn?a:Dn}),en=e.computed(()=>{const t=Nt.value;if(!t)return Dn;const a=t.min;return typeof a=="number"||a===Dn?a:Dn}),Ct=e.computed(()=>{const t=Nt.value;if(!t)return Dn;const a=t.max;return typeof a=="number"||a===Dn?a:Dn}),ee=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),ve=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),Ne=e.computed(()=>{const t=Z.value;return t&&t.grid&&t.grid.show!==!1}),q=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.show!==!1}),ge=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Be=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Fe=e.computed(()=>{const t=Z.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Ue=e.computed(()=>{const t=Z.value;if(!t||!t.crosshair)return!1;const a=t.crosshair.show;return a===!0||a==="true"}),wt=e.computed(()=>{const t=Z.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Ge=e.computed(()=>{const t=Z.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Xt=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Ze=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Pe=e.computed(()=>{const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Tt=e.computed(()=>{if(!Sn.value)return 0;const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),Lt=e.computed(()=>{const t=Z.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),le=e.computed(()=>{const{maxX:t}=St.value;return t===0}),U=(t,a)=>le.value&&a===0?5:a,X=t=>{const a=Number(t);return!Number.isFinite(a)||a<=0?0:a},ie=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),ye=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),Ke=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),At=e.computed(()=>{const t=Z.value;return ye.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),Yt=e.computed(()=>{const t=Z.value,a=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return a.length>0?a:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),lt=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.enabled!==!1}),sn=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),S=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),b=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),V=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),j=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),oe=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.onDataChange!==!1}),He=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),kt=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),ot=e.computed(()=>Z.value?.spider?.gridSteps||5),ze=e.computed(()=>{const t=[],a=ot.value;for(let n=1;n<=a;n++)t.push(ct.value/a*n);return t}),xt=t=>{const a=Mt.value;if(a&&Array.isArray(a)&&a[t]!==void 0)return a[t].toString();const n=ze.value[t];return Math.round(n/ct.value*100)+"%"},Mt=e.computed(()=>Z.value?.spider?.gridLabels||null),Et=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),it=e.computed(()=>{const t=Z.value,a={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...a,...t.contextMenu.items}:a}),Dt=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Bt=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Un.value}),rn=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Vn=e.computed(()=>{const t=Z.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Zn=e.computed(()=>{const a=Z.value?.valueFormat?.extension;return typeof a=="string"?a:""}),tn=t=>{const a=Zn.value;if(t==null)return"";const n=String(t);return a?n+a:n},pn=e.computed(()=>!ae.value.isZooming);e.computed(()=>on.value.map(t=>{if(t.categoryIndex!==void 0&&(En.value||jt.value)){const a=ln(t.categoryIndex),n=Q.value+P.value.bottom-Vn.value/2;return{...t,x:a,y:n}}return t}));function ll(t,a){let n;if(t instanceof Date)n=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,C,w]=t.split("-"),O=Number(w?.length===2?`20${w}`:w);n=new Date(O,Number(C)-1,Number(g))}else return 0;let r=0,p=1/0;return a.forEach((g,C)=>{const[w,O,N]=g.split("-"),H=Number(N?.length===2?`20${N}`:N),$=new Date(H,Number(O)-1,Number(w)),G=Math.abs($-n);G<p&&(p=G,r=C)}),r}const vl=e.computed(()=>{const t=F.markers.map(n=>{const r=ll(n.marker_date,F.categories),p=ln(r),g=Q.value+P.value.bottom-Vn.value/2;return{...n,x:p,y:g,categoryIndex:r,source:"props"}}),a=on.value.map(n=>{if(n.categoryIndex!==void 0&&(En.value||jt.value)){const r=ln(n.categoryIndex),p=Q.value+P.value.bottom-Vn.value/2;return{...n,x:r,y:p,source:"internal"}}return{...n,source:"internal"}});return[...t,...a]}),il=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.enabled===!0}),_n=e.computed(()=>{const t=Z.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),gl=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),$n=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),Vl=e.computed(()=>{const t={left:P.value.left,top:P.value.top,width:P.value.width,height:P.value.height};let a,n;const r=String(gl.value);if(r.includes("%")){const p=parseFloat(r)/100;a=t.width*p,n=a*(96/499)}else{const p=parseFloat(r)||25;a=Math.min(t.width*.25,200)*(p/25),n=a*(96/499)}return{width:a,height:n,area:t}}),Rl=e.computed(()=>{const{width:t,height:a}=Vl.value,n=$n.value;let r,p;const g=P.value.left,C=P.value.right,w=P.value.top,O=P.value.bottom,N=P.value.width,H=P.value.height;switch(n){case"center":r=g+(N-t)/2,p=w+(H-a)/2;break;case"top-left":r=g+15,p=w+5;break;case"top-right":r=C-t-15,p=w+5;break;case"bottom-left":r=g+15,p=O-a-5;break;case"bottom-right":default:r=C-t-15,p=O-a-5;break}return{backgroundPositionX:r+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${a}px`}}),hl=t=>!F.flags||!F.flags.length?[]:F.flags.filter(a=>a.categoryIndex===t),An=t=>{const a=hl(t),n=kl(t),r=a.filter(C=>C.manual),p=a.filter(C=>!C.manual),g=[];return r.length>0&&g.push({type:_("chart.tooltip.manualFlags"),color:"#698dbe",flags:r.map(C=>({text:C.text,color:"#698dbe"}))}),p.length>0&&g.push({type:_("chart.tooltip.autoFlags"),color:"#a1d499",flags:p.map(C=>({text:C.text,color:"#a1d499"}))}),{flagGroups:g,markers:n.map(C=>({title:C.title,description:C.description,type:_("chart.tooltip.markers"),color:C.color||"#9784ba"}))}},Un=e.computed(()=>{const t=F.old?`<svg width="55" height="56" viewBox="0 0 55 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<path d="M55 51.841V4.14647C55 1.86149 53.1797 0.00915527 50.9343 0.00915527L4.06568 0.00915527C1.82027 0.00915527 0 1.86149 0 4.14647V51.841C0 54.126 1.82027 55.9783 4.06568 55.9783H50.9343C53.1797 55.9783 55 54.126 55 51.841Z" fill="#020203"/>
|
|
3
3
|
<path d="M27.7145 10.8883H16.9591C12.7639 10.8883 9.3623 14.3498 9.3623 18.619C9.3623 22.8882 12.7639 26.3497 16.9591 26.3497H27.8036C28.3624 26.3497 28.816 25.8881 28.816 25.3112L28.7188 11.9103C28.7188 11.3416 28.2653 10.8883 27.7064 10.8883H27.7145Z" fill="#FFC230"/>
|
|
4
4
|
<path d="M38.6799 25.649C42.5176 25.649 45.6288 22.483 45.6288 18.5776C45.6288 14.6722 42.5176 11.5063 38.6799 11.5063C34.8421 11.5063 31.731 14.6722 31.731 18.5776C31.731 22.483 34.8421 25.649 38.6799 25.649Z" fill="white"/>
|
|
@@ -41,21 +41,21 @@
|
|
|
41
41
|
<rect width="45" height="45" fill="white" transform="translate(0 1)"/>
|
|
42
42
|
</clipPath>
|
|
43
43
|
</defs>
|
|
44
|
-
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Hn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),zn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const Nl=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),T=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),I=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),B=e.computed(()=>{const a=Z.value?.radialBar?.dataLabels;return a&&(a.show===!0||a.enabled===!0)}),te=e.computed(()=>{const a=Z.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof a=="number"&&a>=0?a:20}),Te=e.computed(()=>{const a=Z.value?.radialBar?.dataCenter;return Xl.value?!0:bl.value&&a&&(a.show===!0||a.enabled===!0)}),vt=e.computed(()=>{if(!Te.value||!Ut.value.length)return"";if(Xl.value){const r=Ut.value[1]??Ut.value[0];return
|
|
45
|
-
`)}})}),qt=e.ref({show:!1,x:0,y:0,content:"",count:0}),gn=e.computed(()=>Z.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),Gt=e.computed(()=>{const t=Z.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Ln=e.computed(()=>Z.value?.bubbles?.tooltip?.formatters||{}),Ft=e.ref(new Set),ve=e.ref(null),_t=e.ref(!1),gt=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),Rn=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),je=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),ht=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),ae=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),on=e.ref([]),Ie=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1,date:null});e.computed(()=>{const t=["default"];return rn.value&&t.push(...Object.keys(rn.value)),t}),e.computed(()=>{if(!F.categories||F.categories.length===0){const{maxX:t}=St.value;return Array.from({length:t+1},(a,n)=>_("chart.fallback.item",{number:n+1}))}return F.categories});const ol=e.computed(()=>{if(!F.categories||F.categories.length===0)return null;const t=F.categories[0],[a,n,r]=String(t).split("-"),p=Number(r?.length===2?`20${r}`:r),g=Number(a),C=Number(n)-1;return!g||!n||!p?null:new Date(p,C,g)}),cn=e.computed(()=>{if(!F.categories||F.categories.length===0)return null;const t=F.categories[F.categories.length-1],[a,n,r]=String(t).split("-"),p=Number(r?.length===2?`20${r}`:r),g=Number(a),C=Number(n)-1;return!g||!n||!p?null:new Date(p,C,g)}),yl=e.computed(()=>Ie.value.editingMarkerId!==null),Nn=e.computed(()=>Ie.value.readonly),Qt=t=>{Ft.value.has(t)||(Jo.value=!0,ve.value=t)},Fl=()=>{Jo.value=!1,ve.value=null},un=t=>{if(xo.value||Fo.value){je.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),r=t.clientX-n.left,p=t.clientY-n.top,g=Kt.value?r>=P.value.left-50&&r<=P.value.right+50&&p>=P.value.top-50&&p<=P.value.bottom+100:r>=P.value.left&&r<=P.value.right&&p>=P.value.top&&p<=P.value.bottom;if(_t.value=g,Kt.value){if(!Ye.value||!g||ae.value.isDragging||ae.value.isZooming){je.value.show=!1;return}if(dn.value.find(de=>!de||de.isHidden?!1:Math.sqrt(Math.pow(de.x-r,2)+Math.pow(de.y-p,2))<=de.radius+3))je.value.show=!1;else{const de=dn.value.filter(be=>!be||be.isHidden?!1:Math.sqrt(Math.pow(be.x-r,2)+Math.pow(be.y-p,2))<=250);if(de.length>0){let be=de[0],Ve=Math.sqrt(Math.pow(be.x-r,2)+Math.pow(be.y-p,2));de.forEach(Ze=>{const Le=Math.sqrt(Math.pow(Ze.x-r,2)+Math.pow(Ze.y-p,2));Le<Ve&&(Ve=Le,be=Ze)});const pe=30,Je=dn.value.filter(Ze=>!Ze||Ze.isHidden?!1:Math.abs(Ze.x-be.x)<=pe).sort((Ze,Le)=>Ze.y-Le.y);je.value={show:!0,x:be.x,categoryIndex:Math.round(be.originalX),data:(()=>{const Ze=gn.value,Le=Gt.value,$e=[];return Je.forEach(Re=>{Ze.forEach($t=>{const Ot=Le[$t]||$t,tl=Ao($t,Re);tl&&$e.push({seriesName:Re.seriesName,label:Re.label,value:`${Ot}: ${tl}`,color:Re.color,y:Re.y})})}),$e})()}}else je.value.show=!1}return}if(ae.value.isDragging&&ae.value.scale>1&&En.value&&et.value){je.value.show=!1;const Ke=t.clientX-ae.value.lastMouseX,{minX:de,maxX:be}=St.value,Ve=be-de||1,Je=Ke*.8;ae.value.offsetX+=Je;const Ze=Ve/ae.value.scale,Le=Ve-Ze,$e=0,Re=-Le/Ve*P.value.width,$t=$e;ae.value.offsetX=Math.max(Re,Math.min($t,ae.value.offsetX)),ae.value.lastMouseX=t.clientX,ae.value.lastMouseY=t.clientY;return}if(!Ye.value||!En.value||ae.value.isDragging||ae.value.isZooming||!g){je.value.show=!1;return}const{minX:C,maxX:w}=St.value,O=w-C||1,N=O/ae.value.scale,H=C-ae.value.offsetX/P.value.width*O,$=(r-P.value.left)/P.value.width,Q=H+$*N,Ne=Math.round(Q);if(Ne>=0&&Ne<=w){const Ke=ln(Ne),de=Jn.value.map((be,Ve)=>{const pe=F.series.findIndex(Ze=>Ze===be),Je=be.data[Ne];return{seriesName:be.name,value:Je!==void 0?Je:null,color:f(pe),y:Je!==void 0?Zn(be,Je):null}}).filter(be=>be.value!==null);je.value={show:!0,x:Ke,categoryIndex:Ne,data:de}}},Pn=()=>{je.value.show=!1,_t.value=!1,Fo.value=!1,xo.value||(qt.value.show=!1),ae.value.isDragging&&(ae.value.isDragging=!1),ae.value.zoomTimeout&&(clearTimeout(ae.value.zoomTimeout),ae.value.zoomTimeout=null),ae.value.isZooming=!1,setTimeout(()=>{ve.value=null,gt.value.show=!1},150)},Wl=t=>{if(t.preventDefault(),t.stopPropagation(),!Et.value)return;const a=t.currentTarget.getBoundingClientRect(),n=t.clientX-a.left,r=t.clientY-a.top;if(Sn.value){ht.value.show=!1,e.nextTick(()=>{ht.value.show=!0,ht.value.x=t.clientX,ht.value.y=t.clientY,ht.value.categoryIndex=null});return}const p=Math.max(0,P.value.left-20),g=P.value.right,C=P.value.top,w=P.value.bottom+80;n>=p&&n<=g&&r>=C&&r<=w&&(ht.value.show=!1,e.nextTick(()=>{ht.value.show=!0,ht.value.x=t.clientX,ht.value.y=t.clientY,ht.value.categoryIndex=null;const O=Math.max(P.value.left,Math.min(n,P.value.right))-P.value.left,H=P.value.width/c.value.length,$=Math.floor(O/H);$>=0&&$<c.value.length&&(ht.value.categoryIndex=$)}))},Yn=t=>{if(!(t&&t.button===2)){if(ht.value.show&&t&&t.type==="click"){const a=document.querySelector(".dss-context-menu");if(a&&a.contains(t.target))return}ht.value.show=!1}},Bl=t=>{if(typeof t.template=="function"){const a={series:F.series,categories:F.categories,markers:on.value},n={chartX:ht.value.chartX,chartY:ht.value.chartY,dataX:ht.value.mouseDataX,dataY:ht.value.mouseDataY,categoryIndex:ht.value.categoryIndex};return t.template(a,n)}return t.template||t.label||""},Bn=t=>{const a=["dss-context-menu-item"];return t.cssClass&&a.push(t.cssClass),a},Gl=t=>t.style||{},cl=t=>t.type&&rn.value[t.type]?rn.value[t.type]:t.customIcon?t.customIcon:Bt.value,Ul=t=>t==null?"":F.categories&&F.categories[t]?F.categories[t]:"",kl=t=>on.value.length?on.value.filter(a=>a.categoryIndex===t):[],Ql=t=>{if(!En.value&&!Kt.value)return{x:0,y:0};const a=ln(t),n=J.value+P.value.bottom-Vn.value/2;return{x:a,y:n}},Mn=()=>{on.value.forEach(t=>{if(t.categoryIndex!==void 0&&(En.value||Kt.value)){const a=Ql(t.categoryIndex);t.x=a.x,t.y=a.y}})},ul=()=>{if(Ie.value.description&&Ie.value.description.length&&Ie.value.date){if(yl.value){const t=on.value.findIndex(a=>a.id===Ie.value.editingMarkerId);t!==-1?(on.value[t].description=Ie.value.description||"",on.value[t].color=Ie.value.color||"",on.value[t].type=Ie.value.type||"default",ce("update-marker",on.value[t])):ce("update-marker",{id:Ie.value.editingMarkerId,description:Ie.value.description||"",color:Ie.value.color||"",type:Ie.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let a=ll(Ie.value.date,F.categories||[]);if(Kt.value){const{maxX:C}=St.value;a=Math.max(0,Math.min(a,Math.floor(C)))}else En.value&&(a=Math.max(0,Math.min(a,St.value.maxX)));const n=ln(a),r=J.value+P.value.bottom-Vn.value/2,p=Array.isArray(F.categories)?F.categories[a]:null,g={id:t,title:"",description:Ie.value.description||"",color:Ie.value.color||"",type:Ie.value.type||"default",categoryIndex:a,x:n,y:r,marker_date:p||null};Ie.value.categoryIndex=a,on.value.push(g),ce("add-marker",g)}xn(),h()}},xn=()=>{Ie.value.show=!1,Ie.value.title="",Ie.value.description="",Ie.value.color="#FF6B6B",Ie.value.type="default",Ie.value.editingMarkerId=null,Ie.value.readonly=!1,Ie.value.categoryIndex=null,Ie.value.fromButton=!1,Ie.value.date=null},hn=()=>{yl.value&&(jn(Ie.value.editingMarkerId),xn())},jn=t=>{const a=on.value.findIndex(n=>n.id===t);a!==-1&&(on.value.splice(a,1),h()),ce("delete-marker",t)},y=t=>{if(Ie.value.show=!0,Ie.value.title=t?.title??t?.comment??"",Ie.value.description=t?.description??t?.comment??"",Ie.value.color=t?.color??"",Ie.value.type=t?.type??"default",Ie.value.editingMarkerId=t?.id??t?.marker_id??null,Ie.value.readonly=t?.readonly??!1,Ie.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[a,n,r]=String(t.marker_date).split("-"),p=Number(r?.length===2?`20${r}`:r),g=Number(a),C=Number(n)-1;g&&n&&p?Ie.value.date=new Date(p,C,g):Ie.value.date=null}else Ie.value.date=null},h=()=>{try{const t=`dss-chart-markers-${F.chartId}`;localStorage.setItem(t,JSON.stringify(on.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},x=()=>{try{const t=`dss-chart-markers-${F.chartId}`,a=localStorage.getItem(t);if(a){const n=JSON.parse(a);Array.isArray(n)&&(on.value=n.map(r=>({...r,originalYOffset:r.originalYOffset!==void 0?r.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),on.value=[]}},q=t=>{const a=ot.value||"Chart",n=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${a.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${n}.${t}`},ue=()=>{const t=je.value.show,a=gt.value.show;return je.value.show=!1,gt.value.show=!1,{originalCrosshair:t,originalTooltip:a}},Qe=t=>{je.value.show=t.originalCrosshair,gt.value.show=t.originalTooltip},Zt=async(t,a=32,n=32)=>new Promise((r,p)=>{if(t.startsWith("data:")){r(t);return}const g=new Image;g.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),r(t)},5e3);g.onload=()=>{clearTimeout(C);try{const w=document.createElement("canvas"),O=w.getContext("2d");w.width=a,w.height=n,O.fillStyle="#fafafa",O.fillRect(0,0,a,n),O.drawImage(g,0,0,a,n);const N=w.toDataURL("image/png");r(N)}catch(w){console.warn("Canvas conversion failed:",w),r(t)}},g.onerror=w=>{clearTimeout(C),console.warn("Failed to load image:",t,w),r(t)},g.src=t}),yn=async()=>{try{const t=ue();setTimeout(async()=>{try{const a=M.value;if(!a){console.error("Chart SVG element not found"),Qe(t);return}const n=lt(),r=Ee.value,p=re.value+n.height,g=a.cloneNode(!0);g.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(pe=>pe.remove());const w=g.querySelectorAll("image"),O=Array.from(w).map(async pe=>{const Je=pe.getAttribute("xlink:href")||pe.getAttribute("href");if(Je&&!Je.startsWith("data:"))try{const Ze=await Zt(Je,32,32);pe.setAttribute("xlink:href",Ze),pe.setAttribute("href",Ze)}catch(Ze){console.warn("Failed to convert logo to base64:",Ze)}});await Promise.all(O);const H=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let $="",Q=30;if(ot.value&&($+=`
|
|
46
|
-
<text x="24" y="${
|
|
44
|
+
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Hn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),zn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const Nl=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),T=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),I=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),B=e.computed(()=>{const a=Z.value?.radialBar?.dataLabels;return a&&(a.show===!0||a.enabled===!0)}),te=e.computed(()=>{const a=Z.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof a=="number"&&a>=0?a:20}),Te=e.computed(()=>{const a=Z.value?.radialBar?.dataCenter;return Xl.value?!0:bl.value&&a&&(a.show===!0||a.enabled===!0)}),vt=e.computed(()=>{if(!Te.value||!Ut.value.length)return"";if(Xl.value){const r=Ut.value[1]??Ut.value[0];return tn(r?.value??0)}const n=Z.value?.radialBar?.dataCenter?.showValueOnly===!0?Ut.value[0]?.value??0:Ut.value.reduce((r,p)=>r+(p.value??0),0);return tn(n)}),pt=e.computed(()=>{const a=Z.value?.radialBar?.dataCenter?.fontSize;return typeof a=="number"&&a>0?a:24}),at=e.computed(()=>({x:Pt.value,y:Xl.value?Rt.value:Rt.value-pt.value/2})),rt=e.computed(()=>{const a=Z.value?.radialBar?.dataCenter?.color;return typeof a=="string"&&a?a:"#333"}),vn=e.computed(()=>{if(!B.value||!Sn.value||!Ut.value.length)return[];const t=te.value*Math.PI/180,a=(Zt.value+ct.value)/2;return Ut.value.map(n=>{const p=n.endAngle-n.startAngle>=t&&!n.isHidden,g=Pt.value+Math.cos(n.midAngle)*a,C=Rt.value+Math.sin(n.midAngle)*a;return{value:tn(n.value),x:g,y:C,show:p,color:n.color,contrastColor:k(n.color)}})}),bn=e.computed(()=>{if(!F.flags||!F.flags.length)return[];const t=new Map;return F.flags.forEach(a=>{const n=a.categoryIndex;t.has(n)||t.set(n,[]),t.get(n).push(a)}),Array.from(t.entries()).map(([a,n])=>{const r=ln(a),p=n.filter(C=>C.manual),g=n.filter(C=>!C.manual);return{categoryIndex:parseInt(a),x:r,flags:n,manualCount:p.length,autoCount:g.length,totalCount:n.length,hasManual:p.length>0,hasAuto:g.length>0,texts:n.map(C=>C.text).join(`
|
|
45
|
+
`)}})}),qt=e.ref({show:!1,x:0,y:0,content:"",count:0}),gn=e.computed(()=>Z.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),Kt=e.computed(()=>{const t=Z.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Ln=e.computed(()=>Z.value?.bubbles?.tooltip?.formatters||{}),Ft=e.ref(new Set),he=e.ref(null),_t=e.ref(!1),gt=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),Rn=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Xe=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),ht=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),ae=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),on=e.ref([]),Ie=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1,date:null});e.computed(()=>{const t=["default"];return rn.value&&t.push(...Object.keys(rn.value)),t}),e.computed(()=>{if(!F.categories||F.categories.length===0){const{maxX:t}=St.value;return Array.from({length:t+1},(a,n)=>_("chart.fallback.item",{number:n+1}))}return F.categories});const ol=e.computed(()=>{if(!F.categories||F.categories.length===0)return null;const t=F.categories[0],[a,n,r]=String(t).split("-"),p=Number(r?.length===2?`20${r}`:r),g=Number(a),C=Number(n)-1;return!g||!n||!p?null:new Date(p,C,g)}),cn=e.computed(()=>{if(!F.categories||F.categories.length===0)return null;const t=F.categories[F.categories.length-1],[a,n,r]=String(t).split("-"),p=Number(r?.length===2?`20${r}`:r),g=Number(a),C=Number(n)-1;return!g||!n||!p?null:new Date(p,C,g)}),yl=e.computed(()=>Ie.value.editingMarkerId!==null),Nn=e.computed(()=>Ie.value.readonly),Gt=t=>{Ft.value.has(t)||(Jo.value=!0,he.value=t)},Fl=()=>{Jo.value=!1,he.value=null},un=t=>{if(xo.value||Fo.value){Xe.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),r=t.clientX-n.left,p=t.clientY-n.top,g=jt.value?r>=P.value.left-50&&r<=P.value.right+50&&p>=P.value.top-50&&p<=P.value.bottom+100:r>=P.value.left&&r<=P.value.right&&p>=P.value.top&&p<=P.value.bottom;if(_t.value=g,jt.value){if(!Ue.value||!g||ae.value.isDragging||ae.value.isZooming){Xe.value.show=!1;return}if(dn.value.find(de=>!de||de.isHidden?!1:Math.sqrt(Math.pow(de.x-r,2)+Math.pow(de.y-p,2))<=de.radius+3))Xe.value.show=!1;else{const de=dn.value.filter(be=>!be||be.isHidden?!1:Math.sqrt(Math.pow(be.x-r,2)+Math.pow(be.y-p,2))<=250);if(de.length>0){let be=de[0],Se=Math.sqrt(Math.pow(be.x-r,2)+Math.pow(be.y-p,2));de.forEach(qe=>{const Le=Math.sqrt(Math.pow(qe.x-r,2)+Math.pow(qe.y-p,2));Le<Se&&(Se=Le,be=qe)});const pe=30,Je=dn.value.filter(qe=>!qe||qe.isHidden?!1:Math.abs(qe.x-be.x)<=pe).sort((qe,Le)=>qe.y-Le.y);Xe.value={show:!0,x:be.x,categoryIndex:Math.round(be.originalX),data:(()=>{const qe=gn.value,Le=Kt.value,$e=[];return Je.forEach(Re=>{qe.forEach($t=>{const Ot=Le[$t]||$t,tl=Ao($t,Re);tl&&$e.push({seriesName:Re.seriesName,label:Re.label,value:`${Ot}: ${tl}`,color:Re.color,y:Re.y})})}),$e})()}}else Xe.value.show=!1}return}if(ae.value.isDragging&&ae.value.scale>1&&En.value&&Ge.value){Xe.value.show=!1;const Ye=t.clientX-ae.value.lastMouseX,{minX:de,maxX:be}=St.value,Se=be-de||1,Je=Ye*.8;ae.value.offsetX+=Je;const qe=Se/ae.value.scale,Le=Se-qe,$e=0,Re=-Le/Se*P.value.width,$t=$e;ae.value.offsetX=Math.max(Re,Math.min($t,ae.value.offsetX)),ae.value.lastMouseX=t.clientX,ae.value.lastMouseY=t.clientY;return}if(!Ue.value||!En.value||ae.value.isDragging||ae.value.isZooming||!g){Xe.value.show=!1;return}const{minX:C,maxX:w}=St.value,O=w-C||1,N=O/ae.value.scale,H=C-ae.value.offsetX/P.value.width*O,$=(r-P.value.left)/P.value.width,G=H+$*N,Ve=Math.round(G);if(Ve>=0&&Ve<=w){const Ye=ln(Ve),de=Jn.value.map((be,Se)=>{const pe=F.series.findIndex(qe=>qe===be),Je=be.data[Ve];return{seriesName:be.name,value:Je!==void 0?Je:null,color:f(pe),y:Je!==void 0?Wn(be,Je):null}}).filter(be=>be.value!==null);Xe.value={show:!0,x:Ye,categoryIndex:Ve,data:de}}},Pn=()=>{Xe.value.show=!1,_t.value=!1,Fo.value=!1,xo.value||(qt.value.show=!1),ae.value.isDragging&&(ae.value.isDragging=!1),ae.value.zoomTimeout&&(clearTimeout(ae.value.zoomTimeout),ae.value.zoomTimeout=null),ae.value.isZooming=!1,setTimeout(()=>{he.value=null,gt.value.show=!1},150)},Zl=t=>{if(t.preventDefault(),t.stopPropagation(),!Et.value)return;const a=t.currentTarget.getBoundingClientRect(),n=t.clientX-a.left,r=t.clientY-a.top;if(Sn.value){ht.value.show=!1,e.nextTick(()=>{ht.value.show=!0,ht.value.x=t.clientX,ht.value.y=t.clientY,ht.value.categoryIndex=null});return}const p=Math.max(0,P.value.left-20),g=P.value.right,C=P.value.top,w=P.value.bottom+80;n>=p&&n<=g&&r>=C&&r<=w&&(ht.value.show=!1,e.nextTick(()=>{ht.value.show=!0,ht.value.x=t.clientX,ht.value.y=t.clientY,ht.value.categoryIndex=null;const O=Math.max(P.value.left,Math.min(n,P.value.right))-P.value.left,H=P.value.width/c.value.length,$=Math.floor(O/H);$>=0&&$<c.value.length&&(ht.value.categoryIndex=$)}))},Yn=t=>{if(!(t&&t.button===2)){if(ht.value.show&&t&&t.type==="click"){const a=document.querySelector(".dss-context-menu");if(a&&a.contains(t.target))return}ht.value.show=!1}},Bl=t=>{if(typeof t.template=="function"){const a={series:F.series,categories:F.categories,markers:on.value},n={chartX:ht.value.chartX,chartY:ht.value.chartY,dataX:ht.value.mouseDataX,dataY:ht.value.mouseDataY,categoryIndex:ht.value.categoryIndex};return t.template(a,n)}return t.template||t.label||""},Bn=t=>{const a=["dss-context-menu-item"];return t.cssClass&&a.push(t.cssClass),a},Gl=t=>t.style||{},cl=t=>t.type&&rn.value[t.type]?rn.value[t.type]:t.customIcon?t.customIcon:Bt.value,Ul=t=>t==null?"":F.categories&&F.categories[t]?F.categories[t]:"",kl=t=>on.value.length?on.value.filter(a=>a.categoryIndex===t):[],Ql=t=>{if(!En.value&&!jt.value)return{x:0,y:0};const a=ln(t),n=Q.value+P.value.bottom-Vn.value/2;return{x:a,y:n}},Mn=()=>{on.value.forEach(t=>{if(t.categoryIndex!==void 0&&(En.value||jt.value)){const a=Ql(t.categoryIndex);t.x=a.x,t.y=a.y}})},ul=()=>{if(Ie.value.description&&Ie.value.description.length&&Ie.value.date){if(yl.value){const t=on.value.findIndex(a=>a.id===Ie.value.editingMarkerId);t!==-1?(on.value[t].description=Ie.value.description||"",on.value[t].color=Ie.value.color||"",on.value[t].type=Ie.value.type||"default",ce("update-marker",on.value[t])):ce("update-marker",{id:Ie.value.editingMarkerId,description:Ie.value.description||"",color:Ie.value.color||"",type:Ie.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let a=ll(Ie.value.date,F.categories||[]);if(jt.value){const{maxX:C}=St.value;a=Math.max(0,Math.min(a,Math.floor(C)))}else En.value&&(a=Math.max(0,Math.min(a,St.value.maxX)));const n=ln(a),r=Q.value+P.value.bottom-Vn.value/2,p=Array.isArray(F.categories)?F.categories[a]:null,g={id:t,title:"",description:Ie.value.description||"",color:Ie.value.color||"",type:Ie.value.type||"default",categoryIndex:a,x:n,y:r,marker_date:p||null};Ie.value.categoryIndex=a,on.value.push(g),ce("add-marker",g)}xn(),h()}},xn=()=>{Ie.value.show=!1,Ie.value.title="",Ie.value.description="",Ie.value.color="#FF6B6B",Ie.value.type="default",Ie.value.editingMarkerId=null,Ie.value.readonly=!1,Ie.value.categoryIndex=null,Ie.value.fromButton=!1,Ie.value.date=null},hn=()=>{yl.value&&(jn(Ie.value.editingMarkerId),xn())},jn=t=>{const a=on.value.findIndex(n=>n.id===t);a!==-1&&(on.value.splice(a,1),h()),ce("delete-marker",t)},y=t=>{if(Ie.value.show=!0,Ie.value.title=t?.title??t?.comment??"",Ie.value.description=t?.description??t?.comment??"",Ie.value.color=t?.color??"",Ie.value.type=t?.type??"default",Ie.value.editingMarkerId=t?.id??t?.marker_id??null,Ie.value.readonly=t?.readonly??!1,Ie.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[a,n,r]=String(t.marker_date).split("-"),p=Number(r?.length===2?`20${r}`:r),g=Number(a),C=Number(n)-1;g&&n&&p?Ie.value.date=new Date(p,C,g):Ie.value.date=null}else Ie.value.date=null},h=()=>{try{const t=`dss-chart-markers-${F.chartId}`;localStorage.setItem(t,JSON.stringify(on.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},x=()=>{try{const t=`dss-chart-markers-${F.chartId}`,a=localStorage.getItem(t);if(a){const n=JSON.parse(a);Array.isArray(n)&&(on.value=n.map(r=>({...r,originalYOffset:r.originalYOffset!==void 0?r.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),on.value=[]}},W=t=>{const a=ut.value||"Chart",n=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${a.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${n}.${t}`},ue=()=>{const t=Xe.value.show,a=gt.value.show;return Xe.value.show=!1,gt.value.show=!1,{originalCrosshair:t,originalTooltip:a}},Qe=t=>{Xe.value.show=t.originalCrosshair,gt.value.show=t.originalTooltip},Wt=async(t,a=32,n=32)=>new Promise((r,p)=>{if(t.startsWith("data:")){r(t);return}const g=new Image;g.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),r(t)},5e3);g.onload=()=>{clearTimeout(C);try{const w=document.createElement("canvas"),O=w.getContext("2d");w.width=a,w.height=n,O.fillStyle="#fafafa",O.fillRect(0,0,a,n),O.drawImage(g,0,0,a,n);const N=w.toDataURL("image/png");r(N)}catch(w){console.warn("Canvas conversion failed:",w),r(t)}},g.onerror=w=>{clearTimeout(C),console.warn("Failed to load image:",t,w),r(t)},g.src=t}),yn=async()=>{try{const t=ue();setTimeout(async()=>{try{const a=M.value;if(!a){console.error("Chart SVG element not found"),Qe(t);return}const n=tt(),r=xe.value,p=se.value+n.height,g=a.cloneNode(!0);g.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(pe=>pe.remove());const w=g.querySelectorAll("image"),O=Array.from(w).map(async pe=>{const Je=pe.getAttribute("xlink:href")||pe.getAttribute("href");if(Je&&!Je.startsWith("data:"))try{const qe=await Wt(Je,32,32);pe.setAttribute("xlink:href",qe),pe.setAttribute("href",qe)}catch(qe){console.warn("Failed to convert logo to base64:",qe)}});await Promise.all(O);const H=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let $="",G=30;if(ut.value&&($+=`
|
|
46
|
+
<text x="24" y="${G}"
|
|
47
47
|
font-family="Arial, sans-serif"
|
|
48
48
|
font-size="18"
|
|
49
49
|
font-weight="bold"
|
|
50
50
|
fill="#333">
|
|
51
|
-
${
|
|
52
|
-
</text>`,
|
|
53
|
-
<text x="24" y="${
|
|
51
|
+
${ut.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
52
|
+
</text>`,G+=30),st.value&&($+=`
|
|
53
|
+
<text x="24" y="${G}"
|
|
54
54
|
font-family="Arial, sans-serif"
|
|
55
55
|
font-size="14"
|
|
56
56
|
fill="#666">
|
|
57
|
-
${
|
|
58
|
-
</text>`,
|
|
57
|
+
${st.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
58
|
+
</text>`,G+=25),q.value&&F.series.length>0){let pe=r-200,Je=ut.value||st.value?35:25;const qe=Math.floor((r-250)/120);let Le=0;F.series.forEach(($e,Re)=>{if(!Ft.value.has(Re)){const $t=f(Re),Ot=$e.name.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");$+=`<circle cx="${pe+6}" cy="${Je-4}" r="6" fill="${$t}"/>`,$+=`<text x="${pe+18}" y="${Je}" font-family="Arial, sans-serif" font-size="12" fill="#333">${Ot}</text>`,Le++,Le%qe===0?(pe=r-200,Je+=20):pe+=Math.min(120,Ot.length*8+35)}})}let Ve="";if(il.value)try{const{width:pe,height:Je}=Vl.value,qe=$n.value,Le=P.value.left,$e=P.value.right,Re=P.value.top,$t=P.value.bottom,Ot=P.value.width,tl=P.value.height;let Cn,nl;switch(qe){case"center":Cn=Le+(Ot-pe)/2,nl=Re+(tl-Je)/2;break;case"top-left":Cn=Le+15,nl=Re+5;break;case"top-right":Cn=$e-pe-5,nl=Re+5;break;case"bottom-left":Cn=Le+15,nl=$t-Je-5;break;case"bottom-right":default:Cn=$e-pe-5,nl=$t-Je-5;break}Ve=`
|
|
59
59
|
<g opacity="${_n.value}">
|
|
60
60
|
<g transform="translate(${Cn}, ${nl}) scale(${pe/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"/>
|
|
@@ -72,7 +72,7 @@
|
|
|
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(pe){console.warn("Watermark processing failed, skipping watermark in SVG:",pe),
|
|
75
|
+
</g>`}catch(pe){console.warn("Watermark processing failed, skipping watermark in SVG:",pe),Ve=""}const Ye=`<?xml version="1.0" encoding="UTF-8"?>
|
|
76
76
|
<svg width="${r}" height="${p}"
|
|
77
77
|
xmlns="http://www.w3.org/2000/svg"
|
|
78
78
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
@@ -87,22 +87,22 @@
|
|
|
87
87
|
${$}
|
|
88
88
|
<g transform="translate(0, ${n.height})">
|
|
89
89
|
${H}
|
|
90
|
-
${
|
|
90
|
+
${Ve}
|
|
91
91
|
</g>
|
|
92
|
-
</svg>`,de=new Blob([
|
|
93
|
-
`),
|
|
92
|
+
</svg>`,de=new Blob([Ye],{type:"image/svg+xml;charset=utf-8"}),be=URL.createObjectURL(de),Se=document.createElement("a");Se.href=be,Se.download=W("svg"),document.body.appendChild(Se),Se.click(),document.body.removeChild(Se),URL.revokeObjectURL(be),Qe(t),Yn()}catch(a){console.error("Error downloading SVG:",a),Qe(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},Fn=async()=>{try{const t=ue();z.value&&z.value.offsetHeight,await new Promise(pe=>setTimeout(pe,300));const a=tt(),n=xe.value,r=se.value+a.height,p=document.createElement("canvas"),g=p.getContext("2d"),C=2;p.width=n*C,p.height=r*C,p.style.width=n+"px",p.style.height=r+"px",g.scale(C,C),g.fillStyle="#fafafa",g.fillRect(0,0,n,r);let w=30;if(ut.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(ut.value,24,w),w+=30),st.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(st.value,24,w),w+=25),q.value&&F.series.length>0){let pe=n-200,Je=ut.value||st.value?35:25;const qe=Math.floor((n-250)/120);let Le=0;g.font="12px Arial, sans-serif",F.series.forEach(($e,Re)=>{if(!Ft.value.has(Re)){const $t=f(Re);g.beginPath(),g.arc(pe+6,Je-4,6,0,2*Math.PI),g.fillStyle=$t,g.fill(),g.fillStyle="#333",g.fillText($e.name,pe+18,Je),Le++,Le%qe===0?(pe=n-200,Je+=20):pe+=Math.min(120,$e.name.length*8+35)}})}const N=M.value.cloneNode(!0),H=N.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),$=N.querySelectorAll(".dss-crosshair"),G=N.querySelectorAll('[class*="tooltip"]');H.forEach(pe=>pe.remove()),$.forEach(pe=>pe.remove()),G.forEach(pe=>pe.remove()),N.querySelectorAll("image").forEach((pe,Je)=>{const qe=pe.getAttribute("xlink:href")||pe.getAttribute("href");if(qe&&!qe.startsWith("data:")){const Le=Ro.value[Je],$e=Le?f(Le.seriesIndex):"#3B82F6",Re=pe.getAttribute("x")||0,$t=pe.getAttribute("y")||0,Ot=pe.getAttribute("width")||32,tl=pe.getAttribute("height")||32,Cn=document.createElementNS("http://www.w3.org/2000/svg","circle");Cn.setAttribute("cx",parseFloat(Re)+parseFloat(Ot)/2),Cn.setAttribute("cy",parseFloat($t)+parseFloat(tl)/2),Cn.setAttribute("r",Math.min(parseFloat(Ot),parseFloat(tl))/2-1),Cn.setAttribute("fill",$e),Cn.setAttribute("stroke","#fafafa"),Cn.setAttribute("stroke-width","2"),pe.parentNode.replaceChild(Cn,pe)}});const Ye=new XMLSerializer().serializeToString(N),de=new Blob([Ye],{type:"image/svg+xml;charset=utf-8"}),be=URL.createObjectURL(de),Se=new Image;return new Promise((pe,Je)=>{Se.onload=async()=>{try{if(g.drawImage(Se,0,a.height),Ro.value.forEach(qe=>{const Le=qe.x,$e=qe.y+a.height,Re=(qe.width||32)/2,$t=f(qe.seriesIndex);g.save(),g.beginPath(),g.arc(Le,$e,Re-1,0,2*Math.PI),g.fillStyle=$t,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),il.value){const qe=new Image,Le=()=>{const{width:Re,height:$t}=Vl.value,Ot=$n.value,tl=P.value.left,Cn=P.value.right,nl=P.value.top,zo=P.value.bottom,Ma=P.value.width,_a=P.value.height;let ro,io;switch(Ot){case"center":ro=tl+(Ma-Re)/2,io=nl+a.height+(_a-$t)/2;break;case"top-left":ro=tl+15,io=nl+a.height+10;break;case"top-right":ro=Cn-Re-5,io=nl+a.height+10;break;case"bottom-left":ro=tl+15,io=zo+a.height-$t-5;break;case"bottom-right":default:ro=Cn-Re-5,io=zo+a.height-$t-5;break}g.globalAlpha=_n.value,g.drawImage(qe,ro,io,Re,$t),g.globalAlpha=1,$e()},$e=()=>{p.toBlob(Re=>{const $t=URL.createObjectURL(Re),Ot=document.createElement("a");Ot.href=$t,Ot.download=W("png"),document.body.appendChild(Ot),Ot.click(),document.body.removeChild(Ot),URL.revokeObjectURL($t),URL.revokeObjectURL(be),Qe(t),Yn(),pe()},"image/png")};qe.onload=Le,qe.onerror=$e,qe.src=Xn.value}else p.toBlob(qe=>{const Le=URL.createObjectURL(qe),$e=document.createElement("a");$e.href=Le,$e.download=W("png"),document.body.appendChild($e),$e.click(),document.body.removeChild($e),URL.revokeObjectURL(Le),URL.revokeObjectURL(be),Qe(t),Yn(),pe()},"image/png")}catch(qe){URL.revokeObjectURL(be),Qe(t),Je(qe)}},Se.onerror=()=>{URL.revokeObjectURL(be),Qe(t),Je(new Error("Failed to load SVG image"))},Se.src=be})}catch(t){console.error("Error downloading PNG:",t)}},On=()=>{try{let t="";ut.value&&(t+=`# ${_("chart.csv.chartTitle")}: ${ut.value}
|
|
93
|
+
`),st.value&&(t+=`# ${_("chart.csv.chartSubtitle")}: ${st.value}
|
|
94
94
|
`),t+=`# ${_("chart.csv.generated")}: ${new Date().toLocaleString()}
|
|
95
95
|
|
|
96
96
|
`,t+="Category",F.series.forEach(g=>{const C=g.name.replace(/"/g,'""');t+=',"'+C+'"'}),t+=`
|
|
97
97
|
`;const a=Math.max(...F.series.map(g=>g.data?.length||0));for(let g=0;g<a;g++){let O='"'+(F.categories[g]||_("chart.fallback.item",{number:g+1})).toString().replace(/"/g,'""')+'"';F.series.forEach(N=>{const H=N.data&&N.data[g]!==void 0?N.data[g]:"";O+=","+H}),t+=O+`
|
|
98
|
-
`}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(n),p=document.createElement("a");p.href=r,p.download=q("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(r),Yn()}catch(t){console.error("Error downloading CSV:",t)}},Cl=t=>{if(typeof t.action=="function"){const a={series:F.series,categories:F.categories,markers:on.value},n={chartX:ht.value.chartX,chartY:ht.value.chartY,dataX:ht.value.mouseDataX,dataY:ht.value.mouseDataY,categoryIndex:clampedCategoryIndex||ht.value.categoryIndex};t.action(a,n)}Yn()},fo=()=>{xn(),Ie.value.show=!0,Ie.value.categoryIndex=ht.value.categoryIndex,Ie.value.fromButton=!1,Yn()},Uo=()=>{xn(),Ie.value.show=!0,Ie.value.categoryIndex=0,Ie.value.fromButton=!0},vo=t=>{if(ht.value.show){const a=document.querySelector(".dss-context-menu");a&&!a.contains(t.target)&&(ht.value.show=!1)}},go=t=>{ht.value.show&&!t.target.closest(".context-menu")&&(ht.value.show=!1)},Vo=t=>{if(!En.value||!et.value)return;t.preventDefault(),t.stopPropagation(),ae.value.isZooming=!0,je.value.show=!1,ae.value.zoomTimeout&&clearTimeout(ae.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),r=t.clientX-n.left,p=t.clientY-n.top;if(r<P.value.left-50||r>P.value.right+50||p<P.value.top-50||p>P.value.bottom+100){ae.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,C=Math.max(ae.value.minScale,Math.min(ae.value.maxScale,ae.value.scale*g));if(C!==ae.value.scale){const{minX:w,maxX:O}=St.value,N=O-w||1,H=N/ae.value.scale,$=w-ae.value.offsetX/P.value.width*N,Q=(r-P.value.left)/P.value.width,Ne=$+Q*H;ae.value.scale=C;const Ke=N/ae.value.scale,de=Ne-Q*Ke;ae.value.offsetX=-(de-w)/N*P.value.width,ae.value.scale<=1.01&&(ae.value.scale=1,ae.value.offsetX=0)}ae.value.zoomTimeout=setTimeout(()=>{ae.value.isZooming=!1,ae.value.zoomTimeout=null},300)},Xo=t=>{if(!En.value||!et.value||ae.value.scale<=1)return;je.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,ae.value.isDragging=!0,ae.value.lastMouseX=t.clientX,ae.value.lastMouseY=t.clientY,t.preventDefault()},ho=()=>{ae.value.isDragging=!1},Jl=()=>{!En.value||!et.value||(ae.value.scale=1,ae.value.offsetX=0,ae.value.isDragging=!1,ae.value.zoomTimeout&&(clearTimeout(ae.value.zoomTimeout),ae.value.zoomTimeout=null),ae.value.isZooming=!1)},Yo=()=>!En.value||!_t.value||!et.value?"default":ae.value.isDragging?"grabbing":ae.value.scale>1?"grab":"dss-crosshair",yo=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 a=`M ${t[0].x} ${t[0].y}`;for(let n=0;n<t.length-1;n++){const r=t[Math.max(n-1,0)],p=t[n],g=t[n+1],C=t[Math.min(n+2,t.length-1)],w=p.x+(g.x-r.x)/6*Ge.value,O=p.y+(g.y-r.y)/6*Ge.value,N=g.x-(C.x-p.x)/6*Ge.value,H=g.y-(C.y-p.y)/6*Ge.value;a+=` C ${w} ${O} ${N} ${H} ${g.x} ${g.y}`}return a},Tn=e.computed(()=>{const a=Z.value?.chart?.padding,n=typeof a=="number"?a:null,r=a&&typeof a=="object"?a:null,p=50;let g=p+(Ht.value?30:0)+60;if(wn.value){const $={left:p+40,top:p+40,right:p+40,bottom:p+40};return n!=null?{left:n,top:n,right:n,bottom:n}:r?{left:r.left??$.left,top:r.top??$.top,right:r.right??$.right,bottom:r.bottom??$.bottom}:$}if(Sn.value){const $=!j.value,Q=Hn.value,Ne=Q?Nl.value+T.value+Math.max(24,zn.value+16):0,Ke=$?12:p;let de=0;ot.value&&(de+=$?8:15),kt.value&&(de+=$?6:10);const be=lt();let Ve=Ke+($?4:16)+(Q?Ne:0),pe=Ke+(Q?Ne:0);j.value&&ge.value==="left"?Ve+=be.legendWidth||150:j.value&&ge.value==="right"&&(pe+=be.legendWidth||150);const Ze=Ce.value==="semi-radial"?Q?Ne:8:Q?Ne:$?8:p+80,Le=Q?14:0,$e=Ke+de+Le,Re={left:Ve,top:$e,right:pe,bottom:Ze};return n!=null?{left:n,top:n,right:n,bottom:n}:r?{left:r.left??Re.left,top:r.top??Re.top,right:r.right??Re.right,bottom:r.bottom??Re.bottom}:Re}let C=0;ot.value&&(C+=15),kt.value&&(C+=10);const w=lt();let O=p+16+(zt.value?30:0),N=p+(bt.value?30:0);j.value&&ge.value==="left"?O+=w.legendWidth||150:j.value&&ge.value==="right"&&(N+=w.legendWidth||150),Ll.value&&(N+=44);const H={left:O,top:p+C,right:N,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:r?{left:r.left??H.left,top:r.top??H.top,right:r.right??H.right,bottom:r.bottom??H.bottom}:H}),P=e.computed(()=>({left:Tn.value.left,top:Tn.value.top,right:Ee.value-Tn.value.right,bottom:re.value-Tn.value.bottom,width:Ee.value-(Tn.value.left+Tn.value.right),height:re.value-(Tn.value.top+Tn.value.bottom)})),En=e.computed(()=>["line","area","bar"].includes(Ce.value)||nt.value),Kn=e.computed(()=>nt.value),Xl=e.computed(()=>Ce.value==="mini-radial"),Sn=e.computed(()=>["radial","semi-radial","mini-radial"].includes(Ce.value)),wn=e.computed(()=>Ce.value==="spider"),Kt=e.computed(()=>Ce.value==="bubble"),nn=e.computed(()=>Z.value?.chart?.orientation==="horizontal"&&(Ce.value==="bar"||Kn.value)),Gn=t=>{const{minY:a,maxY:n}=St.value,r=n-a||1;return P.value.left+(t-a)/r*P.value.width},Ml=t=>{const{maxX:a}=St.value,n=a+1,p=P.value.height/n;return P.value.top+(t+.5)*p},Pt=e.computed(()=>Sn.value?Tn.value.left+(Ee.value-Tn.value.left-Tn.value.right)/2:Ee.value/2),Rt=e.computed(()=>wn.value?re.value/2-40:Sn.value?Tn.value.top+(re.value-Tn.value.top-Tn.value.bottom)/2:re.value/2),ut=e.computed(()=>{if(wn.value){const t=P.value.width-80,a=P.value.height-80;return Math.min(t,a)/2}return Math.min(P.value.width,P.value.height)/2}),Wt=e.computed(()=>{const t=Z.value,a=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof a=="number"&&a>=0&&a<=1?a:.45;return ut.value*n}),_l=e.computed(()=>{const t=Z.value,a=typeof F.innerSize=="number"?F.innerSize:t?.innerSize;return typeof a!="number"||a<=-100||!(Sn.value||wn.value)?1:1+a/100}),Il=e.computed(()=>{const t=_l.value;if(t===1||t<=0)return;const a=Pt.value,n=Rt.value;return`translate(${a}, ${n}) scale(${t}) translate(${-a}, ${-n})`}),Jt=e.ref(0),eo=e.computed(()=>`semi-radial-fill-clip-${F.chartId}`),bl=e.computed(()=>Ce.value==="semi-radial"),dl=e.computed(()=>bl.value&&at.value&&!Hl.value),al=e.computed(()=>bl.value&&at.value&&!Hl.value&&sn.value==="fill"),zl=e.computed(()=>{const t=dl.value?Jt.value:1,a=Pt.value,n=Rt.value,r=Wt.value,p=ut.value,g=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${a} ${n} L ${a} ${n} Z`;const w=a+p*Math.cos(g),O=n+p*Math.sin(g),N=a+p*Math.cos(C),H=n+p*Math.sin(C),$=a+r*Math.cos(C),Q=n+r*Math.sin(C),Ne=a+r*Math.cos(g),Ke=n+r*Math.sin(g),de=t>.5?1:0;return`M ${a} ${n} L ${w} ${O} A ${p} ${p} 0 ${de} 1 ${N} ${H} L ${$} ${Q} A ${r} ${r} 0 ${de} 1 ${Ne} ${Ke} Z`}),wl=e.computed(()=>{if(!(!bl.value||!dl.value)&&!al.value)return`url(#${eo.value})`}),Pl=t=>{if(!(!al.value||t!==0))return`url(#${eo.value})`},$l=e.ref(0),No=e.computed(()=>`radial-reveal-clip-${F.chartId}`),In=e.computed(()=>Ce.value==="radial"),Bo=e.computed(()=>{const t=In.value?$l.value:1,a=Pt.value,n=Rt.value,r=Math.max(ut.value*1.5,Ee.value,re.value);if(t<=0)return`M ${a} ${n} L ${a} ${n} Z`;if(t>=1){const $=a-r,Q=a+r;return`M ${$} ${n} A ${r} ${r} 0 0 1 ${Q} ${n} A ${r} ${r} 0 0 1 ${$} ${n} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,C=a+r*Math.cos(p),w=n+r*Math.sin(p),O=a+r*Math.cos(g),N=n+r*Math.sin(g),H=t>=.5?1:0;return`M ${a} ${n} L ${C} ${w} A ${r} ${r} 0 ${H} 1 ${O} ${N} Z`}),Yl=e.computed(()=>{if(wl.value)return wl.value;if(In.value)return`url(#${No.value})`});let Ol=null;const jo=()=>{if(!dl.value)return;Jt.value=0;const t=S.value,a=performance.now(),n=r=>{const p=r-a,g=Math.min(1,p/t);Jt.value=ea(V.value,g),g<1&&(Ol=requestAnimationFrame(n))};Ol=requestAnimationFrame(n)},Mo=e.computed(()=>Z.value?.bubbles?.minSize||8),to=e.computed(()=>Z.value?.bubbles?.maxSize||50),no=e.computed(()=>Z.value?.bubbles?.opacity||.7),lo=(t,a)=>{const n=[15,20,25,18,22],r=n[t%n.length]||20,p=1+Math.sin(a*.5)*.2;return Math.max(5,r*p)},Ko=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.opacity="1")},_o=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.display="none")},Qn=e.computed(()=>F.series),Jn=e.computed(()=>F.series.filter((t,a)=>!Ft.value.has(a))),ko=t=>{if(!t)return"primary";const a=t.yAxis??t.axis??t.yAxisId;return a==="secondary"||a==="right"||a===1?"secondary":"primary"},oo=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,qn=t=>t?t.old===!0||t.comparison===!0||t.dotted===!0:!1,ao=e.computed(()=>{const a=Z.value?.spider?.comparison||{};return{fillOpacity:typeof a.fillOpacity=="number"?a.fillOpacity:0,strokeDasharray:a.strokeDasharray||"6,4",usePrimaryColor:a.usePrimaryColor!==!1,bubbleSize:typeof a.bubbleSize=="number"?a.bubbleSize:0}}),jl=(t,a)=>typeof t?.bubbles?.size=="number"?t.bubbles.size:typeof t?.bubbleSize=="number"?t.bubbleSize:a?ao.value.bubbleSize:Lt.value,ml=(t,a)=>qn(t)&&ao.value.usePrimaryColor?f(0):f(a),xl=(t,a)=>wn.value&&qn(t)?ml(t,a):f(a),Co=e.computed(()=>Jn.value.filter(t=>ko(t)==="primary")),$o=e.computed(()=>Jn.value.filter(t=>ko(t)==="secondary")),Ll=e.computed(()=>!nn.value&&!!Nt.value&&$o.value.length>0),Dn="auto",Kl=(t,a,n,r=0,p=100)=>{let g=1/0,C=-1/0;if(t.forEach(N=>{N?.data?.length&&N.data.forEach(H=>{typeof H=="number"&&Number.isFinite(H)&&(g=Math.min(g,H),C=Math.max(C,H))})}),g===1/0)return{minY:r,maxY:p};let w;if(a===Dn){const N=C-g,H=N>0?N*.1:1;w=Math.max(0,g-H)}else if(typeof a=="number")w=a;else{const N=C-g,H=N>0?N*.1:1;w=Math.max(0,g-H)}let O;if(n===Dn){const N=C-g,H=N>0?N*.1:2;O=C+H}else if(typeof n=="number")O=n;else{const N=C-g,H=N>0?N*.1:2;O=C+H}return{minY:w,maxY:O}},St=e.computed(()=>{if(Kt.value)return Tl();if(!Jn.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;Jn.value.forEach(n=>{n.data&&n.data.length&&(t=Math.max(t,n.data.length-1))}),F.categories.length>0&&(t=Math.max(t,F.categories.length-1));const a=Kl(Co.value.length?Co.value:Jn.value,Xt.value,mt.value);return{minX:0,maxX:t,minY:a.minY,maxY:a.maxY}}),Lo=e.computed(()=>Ll.value?Kl($o.value,tn.value,Y.value,St.value.minY,St.value.maxY):{minY:St.value.minY,maxY:St.value.maxY}),Tl=()=>{if(!Jn.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,a=-1/0,n=1/0,r=-1/0,p=1/0,g=-1/0,C=!1;if(Jn.value.forEach((Ne,Ke)=>{Ne?.data?.length&&Ne.data.forEach((de,be)=>{let Ve,pe,Je;if(typeof de=="object"&&de!==null&&!Array.isArray(de))Ve=typeof de.x=="number"?de.x:be,pe=typeof de.y=="number"?de.y:0,Je=typeof de.size=="number"?de.size:20;else if(Array.isArray(de)&&de.length>=3)Ve=typeof de[0]=="number"?de[0]:be,pe=typeof de[1]=="number"?de[1]:0,Je=typeof de[2]=="number"?de[2]:20;else if(typeof de=="number")Ve=be,pe=de,Je=lo(Ke,be);else return;isFinite(Ve)&&isFinite(pe)&&isFinite(Je)&&(t=Math.min(t,Ve),a=Math.max(a,Ve),n=Math.min(n,pe),r=Math.max(r,pe),p=Math.min(p,Je),g=Math.max(g,Je),C=!0)})}),!C)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===a&&(t=Math.min(t,0),a=Math.max(a,F.categories?.length-1||8)),n===r&&(n=Math.max(0,n-10),r=n+20);const w=a-t,O=r-n;let N,H,$,Q;return ye.value!==null?N=ye.value:N=t-w*.1,xe.value!==null?H=xe.value:H=a+w*.1,Xt.value!==null&&typeof Xt.value=="number"?$=Xt.value:$=Math.max(0,n-O*.1),mt.value!==null&&typeof mt.value=="number"?Q=mt.value:Q=r+O*.1,{minX:N,maxX:H,minY:$,maxY:Q,minSize:p,maxSize:g}},ln=t=>{if(Kt.value){const{minX:w,maxX:O}=St.value,N=O-w||1;return P.value.left+(t-w)/N*P.value.width}const{minX:a,maxX:n}=St.value,r=n-a;if(n===0||r===0)return P.value.left+P.value.width/2;const p=r/ae.value.scale,g=a-ae.value.offsetX/P.value.width*r,C=(t-g)/p;return P.value.left+C*P.value.width},Al=t=>{const{minY:a,maxY:n}=St.value,r=n-a||1;return P.value.bottom-(t-a)/r*P.value.height},bo=t=>{const{minY:a,maxY:n}=Lo.value,r=n-a||1;return P.value.bottom-(t-a)/r*P.value.height},Zn=(t,a)=>Ll.value&&ko(t)==="secondary"?bo(a):Al(a),o=t=>{if(!Kt.value)return Lt.value||4;const{maxSize:a}=St.value,n=Math.max(1,a),r=Math.min(1,Math.max(0,t/n));return Mo.value+r*(to.value-Mo.value)},l=(t,a=12,n="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(a*.62);l.canvas||(l.canvas=document.createElement("canvas"));const r=l.canvas.getContext("2d");return r?(r.font=`${a}px ${n}`,r.measureText(t).width):t.length*(a*.62)},s=(t,a,n=12)=>{if(typeof t!="string"||typeof a!="number"||a<=0||l(t,n)<=a)return t;const r="..";if(l(r,n)>=a)return r;let g=t.length;for(;g>0;){const C=`${t.slice(0,g)}${r}`;if(l(C,n)<=a)return C;g-=1}return r},i=e.computed(()=>u.value.map(t=>({y:t.y}))),c=e.computed(()=>{if(Kt.value)return d();if(Ce.value==="bar"){if(nn.value){const $e=[],{minY:Re,maxY:$t}=St.value,Ot=5,tl=$t-Re||1;for(let Cn=0;Cn<=Ot;Cn++){const nl=Re+tl*(Cn/Ot),zo=Gn(nl);$e.push({x:zo,y:P.value.bottom+20,text:en(Math.round(nl))})}return $e}const be=[],{maxX:Ve}=St.value,pe=Ve+1,Je=5,Le=(P.value.width-Je*2)/pe;for(let $e=0;$e<=Ve;$e++){const Re=P.value.left+Je+($e+.5)*Le;be.push({x:Re,y:P.value.bottom+20,text:s(F.categories[$e]||_("chart.fallback.item",{number:$e+1}),Math.max(Le-8,24))})}return be}const t=[],{minX:a,maxX:n}=St.value,r=ye.value!==null?ye.value:a,p=xe.value!==null?xe.value:n,g=p-r||1,C=g/ae.value.scale,w=r-ae.value.offsetX/P.value.width*g,O=w+C,N=Math.max(0,Math.floor(w-2)),H=Math.min(p,Math.ceil(O+2)),$=H-N,Q=P.value.width,Ke=Math.floor(Q/60);let de=1;$>Ke&&(de=Math.ceil($/Ke));for(let be=N;be<=H;be+=de)if(be>=0&&be<=p){const Ve=ln(be);Ve>=P.value.left-100&&Ve<=P.value.right+100&&t.push({x:Ve,y:P.value.bottom+20,text:F.categories[be]||`Item ${be+1}`})}return t}),d=()=>{const t=[],{minX:a,maxX:n}=St.value,r=n-a||1,p=Math.min(8,Math.max(4,Math.floor(P.value.width/80)));for(let g=0;g<=p;g++){const C=a+r*g/p,w=ln(C);if(w>=P.value.left-10&&w<=P.value.right+10){const O=Math.round(C),N=F.categories?.[O];t.push({x:w,y:P.value.bottom+20,text:N||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},u=e.computed(()=>{if(nn.value){const p=[],{maxX:g}=St.value;for(let C=0;C<=g;C++)p.push({x:P.value.left-10,y:Ml(C),text:s(F.categories[C]||`Item ${C+1}`,Math.max(P.value.left-28,40))});return p}const t=[],{minY:a,maxY:n}=St.value,r=5;for(let p=0;p<=r;p++){const g=a+(n-a)*(p/r),C=Math.round(g);t.push({x:P.value.left-10,y:Al(g),text:en(C)})}return t}),m=e.computed(()=>{if(!Ll.value||nn.value)return[];const t=[],{minY:a,maxY:n}=Lo.value,r=5;for(let p=0;p<=r;p++){const g=a+(n-a)*(p/r),C=Math.round(g);t.push({x:P.value.right+10,y:bo(g),text:en(C)})}return t}),f=t=>{const a=jt.value;if(!a||a.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return a[t%a.length]},k=t=>{if(!t||typeof t!="string")return"#3a3a3a";const a=t.trim();let n=0,r=0,p=0;const g=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)n=Number(g[1])/255,r=Number(g[2])/255,p=Number(g[3])/255;else{const w=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(w)n=Number(w[1])/255,r=Number(w[2])/255,p=Number(w[3])/255;else{const O=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(O){let N=O[1];N.length===3&&(N=N[0]+N[0]+N[1]+N[1]+N[2]+N[2]),n=parseInt(N.slice(0,2),16)/255,r=parseInt(N.slice(2,4),16)/255,p=parseInt(N.slice(4,6),16)/255}else if(typeof document<"u"){const N=document.createElement("span");N.style.color=a,N.style.display="none",document.body.appendChild(N);const H=getComputedStyle(N).color;document.body.removeChild(N);const $=H.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if($)n=Number($[1])/255,r=Number($[2])/255,p=Number($[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*r+.0722*p>.5?"#3a3a3a":"#fafafa"},A=t=>{if(!t||typeof t!="string")return t;const a=t.trim(),n=a.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)),C=Math.max(0,Math.floor(Number(n[2])*.65)),w=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${C}, ${w})`}const r=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(r){const g=Math.max(0,Math.floor(Number(r[1])*.65)),C=Math.max(0,Math.floor(Number(r[2])*.65)),w=Math.max(0,Math.floor(Number(r[3])*.65));return`rgba(${g}, ${C}, ${w}, ${r[4]})`}const p=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(p){let g=p[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const C=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),w=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),O=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[C,w,O].map(N=>N.toString(16).padStart(2,"0")).join("")}`}return a},R=(t,a)=>{const r=Z.value?.stroke?.color;return r==null?A(a):typeof r=="string"?r:Array.isArray(r)&&r.length?r[t%r.length]??A(a):A(a)},E=t=>{let a=0;for(let n=1;n<t.length;n++){const r=t[n].x-t[n-1].x,p=t[n].y-t[n-1].y;a+=Math.sqrt(r*r+p*p)}return a},se=e.computed(()=>Ce.value==="line"||Kn.value?(Kn.value?F.series.filter(a=>(a.type||Ce.value)==="line"):Qn.value).map((a,n)=>{const r=F.series.findIndex($=>$===a),p=[];let g=[];a.data.forEach(($,Q)=>{$==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:nn.value?Gn($):ln(Q),y:nn.value?Ml(Q):Zn(a,$),index:Q})}),g.length>0&&p.push(g);let C="";p.forEach($=>{if($.length>0){let Q="";he.value?Q=yo($):Q=`M ${$[0].x} ${$[0].y}`+$.slice(1).map(Ne=>` L ${Ne.x} ${Ne.y}`).join(""),C+=(C?" ":"")+Q}});const w=p.reduce(($,Q)=>$+E(Q),0),O=Ft.value.has(r),N=ve.value===r,H=ve.value!==null&&ve.value!==r;return{path:C,color:f(r),strokeDasharray:oo(a),pathLength:w,seriesIndex:r,animationDelay:n*K.value,isHighlighted:N,isDimmed:H,isHidden:O}}):[]),G=e.computed(()=>{if(!(Ce.value==="line"||Kn.value))return[];const t=Kn.value?F.series.filter(n=>(n.type||Ce.value)==="line"):Qn.value,a=[];return t.forEach((n,r)=>{const p=F.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const C=n.data[g];if(C!=null){let w=-1,O=0;for(let N=g+1;N<n.data.length;N++){const H=n.data[N];if(H==null)O++;else{w=N;break}}if(O>0&&w!==-1){const N=n.data[w],H=nn.value?Gn(C):ln(g),$=nn.value?Ml(g):Zn(n,C),Q=nn.value?Gn(N):ln(w),Ne=nn.value?Ml(w):Zn(n,N),Ke=Ft.value.has(p),de=ve.value===p,be=ve.value!==null&&ve.value!==p;a.push({path:`M ${H} ${$} L ${Q} ${Ne}`,color:f(p),seriesIndex:p,animationDelay:r*K.value,isHighlighted:de,isDimmed:be,isHidden:Ke,gapSize:O}),g=w-1}}}}),a}),qe=e.computed(()=>Ce.value==="line"||Kn.value?!at.value||Hl.value||It.value.hasAnimated?[]:(Kn.value?F.series.filter(a=>(a.type||Ce.value)==="line"):Qn.value).map((a,n)=>{const r=F.series.findIndex(O=>O===a);let p="",g=null;a.data.forEach((O,N)=>{if(O!=null){const H={x:nn.value?Gn(O):ln(N),y:nn.value?Ml(N):Zn(a,O)};g===null?p+=`M ${H.x} ${H.y}`:p+=` L ${H.x} ${H.y}`,g=H}else if(g!==null){const H=a.data.findIndex(($,Q)=>Q>N&&$!==null&&$!==void 0);if(H!==-1){const $={x:nn.value?Gn(a.data[H]):ln(H),y:nn.value?Ml(H):Zn(a,a.data[H])};p+=` L ${$.x} ${$.y}`,g=$}}});const C=a.data.map((O,N)=>O==null?null:{x:nn.value?Gn(O):ln(N),y:nn.value?Ml(N):Zn(a,O)}).filter(O=>O!==null),w=E(C);return{path:p,pathLength:w,color:f(r),strokeDasharray:oo(a),animationDelay:n*K.value,seriesIndex:r}}):[]),Me=e.computed(()=>{if(Ce.value!=="line")return[];const t=[];return Qn.value.forEach((a,n)=>{const r=ve.value===n,p=ve.value!==null&&ve.value!==n,g=Ft.value.has(n);a.data.forEach((C,w)=>{C!=null&&t.push({x:ln(w),y:Zn(a,C),color:f(n),value:C,label:F.categories[w]||w.toString(),seriesName:a.name,categoryIndex:w,dataIndex:w,animationDelay:(n*a.data.length+w)*(K.value/8),isHighlighted:r,isDimmed:p,isHidden:g})})}),t}),yt=e.computed(()=>{if(!Kn.value)return[];const t=[];return F.series.filter(n=>(n.type||Ce.value)==="line").forEach((n,r)=>{const p=F.series.findIndex(O=>O===n),g=ve.value===p,C=ve.value!==null&&ve.value!==p,w=Ft.value.has(p);n.data.forEach((O,N)=>{O!=null&&t.push({x:ln(N),y:Zn(n,O),color:f(p),value:O,label:F.categories[N]||N.toString(),seriesName:n.name,categoryIndex:N,dataIndex:N,animationDelay:(r*n.data.length+N)*(K.value/8),isHighlighted:g,isDimmed:C,isHidden:w})})}),t}),dn=e.computed(()=>{if(!Kt.value)return[];const t=[];return Qn.value.forEach((a,n)=>{if(!a?.data?.length)return;const r=ve.value,p=r!==null&&r===n,g=r!==null&&r!==n,C=Ft.value.has(n);a.data.forEach((w,O)=>{let N,H,$,Q,Ne;if(typeof w=="object"&&w!==null&&!Array.isArray(w))N=typeof w.x=="number"?w.x:O,H=typeof w.y=="number"?w.y:0,$=typeof w.size=="number"?w.size:20,Q=w.label||F.categories?.[O]||`Point ${O+1}`,Ne=w.image||w.imageUrl;else if(Array.isArray(w)&&w.length>=3)N=typeof w[0]=="number"?w[0]:O,H=typeof w[1]=="number"?w[1]:0,$=typeof w[2]=="number"?w[2]:20,Q=w[3]||F.categories?.[O]||`Point ${O+1}`,Ne=w[4];else if(typeof w=="number")N=O,H=w,$=lo(n,O),Q=F.categories?.[O]||`Point ${O+1}`;else return;!isFinite(N)||!isFinite(H)||!isFinite($)||t.push({x:ln(N),y:Al(H),radius:o($),originalX:N,originalY:H,originalSize:$,color:f(n),seriesName:a.name||`Series ${n+1}`,label:Q,imageUrl:Ne,seriesIndex:n,dataIndex:O,categoryIndex:Math.round(N),isHighlighted:p,isDimmed:g,isHidden:C,opacity:no.value})})}),t}),mn=e.computed(()=>Ce.value!=="area"?[]:Qn.value.map((t,a)=>{const n=[];let r=[];if(t.data.forEach(($,Q)=>{$==null?r.length>0&&(n.push([...r]),r=[]):r.push({x:ln(Q),y:Zn(t,$),index:Q})}),r.length>0&&n.push(r),n.length===0)return{linePath:"",areaPath:"",color:f(a),isHidden:Ft.value.has(a)};const p=P.value.bottom+1;let g="",C="";n.forEach(($,Q)=>{if($.length===0)return;let Ne=`M ${$[0].x} ${$[0].y}`;he.value&&$.length>1?Ne=yo($):$.slice(1).forEach(de=>{Ne+=` L ${de.x} ${de.y}`}),g+=(g?" ":"")+Ne;let Ke=`M ${$[0].x} ${p}`;if(Ke+=` L ${$[0].x} ${$[0].y}`,he.value&&$.length>1){const de=yo($),be=de.substring(de.indexOf("C")||de.indexOf("Q")||de.indexOf("L"));be?Ke+=" "+be:$.slice(1).forEach(Ve=>{Ke+=` L ${Ve.x} ${Ve.y}`})}else $.slice(1).forEach(de=>{Ke+=` L ${de.x} ${de.y}`});Ke+=` L ${$[$.length-1].x} ${p} Z`,C+=(C?" ":"")+Ke});const w=ve.value===a,O=ve.value!==null&&ve.value!==a,N=Ft.value.has(a),H=n.reduce(($,Q)=>$+E(Q),0);return{linePath:g,areaPath:C,color:f(a),pathLength:H,isHighlighted:w,isDimmed:O,isHidden:N}})),an=e.computed(()=>{if(!(["bar"].includes(Ce.value)||Kn.value))return[];const t=[],{maxX:a}=St.value,n=Kn.value?F.series.filter(p=>(p.type||Ce.value)==="bar"):Qn.value,r=n.length;if(nn.value){const p=a+1,C=P.value.height/p,w=C*(2/3),O=Math.min(4,w/r*.15),N=w-(r-1)*O,H=Math.max(4,N/r);n.forEach(($,Q)=>{const Ne=F.series.findIndex(Ve=>Ve===$),Ke=ve.value===Ne,de=ve.value!==null&&ve.value!==Ne,be=Ft.value.has(Ne);$.data.forEach((Ve,pe)=>{if(Ve==null||typeof Ve!="number"||!isFinite(Ve))return;const Le=P.value.top+(pe+.5)*C-w/2+Q*(H+O),$e=P.value.left,Re=Math.abs(Gn(Ve)-P.value.left);let $t="";if(he.value&&Re>0){const Ot=Math.min(At.value,H/2,Re/2);$t=[`M ${$e} ${Le}`,`L ${$e+Re-Ot} ${Le}`,`Q ${$e+Re} ${Le} ${$e+Re} ${Le+Ot}`,`L ${$e+Re} ${Le+H-Ot}`,`Q ${$e+Re} ${Le+H} ${$e+Re-Ot} ${Le+H}`,`L ${$e} ${Le+H}`,"Z"].join(" ")}t.push({x:$e,y:Le,width:Re,height:H,color:f(r===1?pe:Ne),value:Ve,label:F.categories[pe]||pe.toString(),seriesName:$.name,animationDelay:(Q*n.length+pe)*(K.value/4),isHighlighted:Ke,isDimmed:de,isHidden:be,barPath:$t,isSmooth:he.value&&Re>0})})})}else{const p=a+1,C=P.value.width/p,w=C*.8,O=w/r,N=O*.05,H=O-N;n.forEach(($,Q)=>{const Ne=F.series.findIndex(Ve=>Ve===$),Ke=ve.value===Ne,de=ve.value!==null&&ve.value!==Ne,be=Ft.value.has(Ne);$.data.forEach((Ve,pe)=>{if(Ve==null||typeof Ve!="number"||!isFinite(Ve))return;const Le=P.value.left+(pe+.5)*C-w/2+Q*O+N/2,$e=Al(Math.max(0,Ve)),Re=Math.abs(Al(0)-Al(Ve));let $t="";if(he.value&&Re>0){const Ot=Math.min(At.value,H/2,Re/2);$t=[`M ${Le} ${$e+Re}`,`L ${Le} ${$e+Ot}`,`Q ${Le} ${$e} ${Le+Ot} ${$e}`,`L ${Le+H-Ot} ${$e}`,`Q ${Le+H} ${$e} ${Le+H} ${$e+Ot}`,`L ${Le+H} ${$e+Re}`,"Z"].join(" ")}t.push({x:Le,y:$e,width:H,height:Re,color:f(r===1?pe:Ne),value:Ve,label:F.categories[pe]||pe.toString(),seriesName:$.name,animationDelay:(Q*n.length+pe)*(K.value/4),isHighlighted:Ke,isDimmed:de,isHidden:be,barPath:$t,isSmooth:he.value&&Re>0})})})}return t}),Ut=e.computed(()=>{if(!Sn.value)return[];const t=Qn.value.map((C,w)=>({series:C,originalIndex:w})).filter(({originalIndex:C})=>!Ft.value.has(C));if(t.length===0)return[];let a=Ce.value==="semi-radial"?Math.PI:-Math.PI/2;const n=Ce.value==="semi-radial"?Math.PI:Math.PI*2,r=[],p=(C,w,O,N,H,$)=>{const Q=C+(w-C)/2,Ne=w-C,Ke=Pt.value+Math.cos(C)*Wt.value,de=Rt.value+Math.sin(C)*Wt.value,be=Pt.value+Math.cos(w)*Wt.value,Ve=Rt.value+Math.sin(w)*Wt.value,pe=Pt.value+Math.cos(w)*ut.value,Je=Rt.value+Math.sin(w)*ut.value,Ze=Pt.value+Math.cos(C)*ut.value,Le=Rt.value+Math.sin(C)*ut.value,$e=Ne>Math.PI?1:0,Re=[`M ${Ke} ${de}`,`A ${Wt.value} ${Wt.value} 0 ${$e} 1 ${be} ${Ve}`,`L ${pe} ${Je}`,`A ${ut.value} ${ut.value} 0 ${$e} 0 ${Ze} ${Le}`,"Z"].join(" "),$t=$||f(O);return{path:Re,color:$t,strokeWidth:Tt.value,strokeColor:R(r.length,$t),value:H,seriesName:N,opacity:.8,isHighlighted:ve.value===O,isDimmed:ve.value!==null&&ve.value!==O,isHidden:!1,startAngle:C,endAngle:w,midAngle:Q}};if(Xl.value){const{series:C,originalIndex:w}=t[0],O=Number(C?.data?.[0]??0),N=Number.isFinite(O)?Math.min(Math.max(O,0),100):0,H=Z.value,$=Math.min(Math.max(Number(H?.miniRadial?.minVisiblePercent??1),0),100),Ne=(N<=0?$:N)/100*n,Ke=Number(H?.miniRadial?.thresholds?.low??33),de=Number(H?.miniRadial?.thresholds?.medium??66),be=H?.miniRadial?.colors?.low||"#E53E3E",Ve=H?.miniRadial?.colors?.medium||"#ED8936",pe=H?.miniRadial?.colors?.high||"#38A169",Je=N<=Ke?be:N<=de?Ve:pe,Ze=H?.miniRadial?.trackColor||"#E5E7EB",Le=C?.name||"Score";return r.push(p(a,a+n-.001,w+1,"Track",100,Ze)),r.push(p(a,a+Ne,w,Le,N,Je)),r}if(t.length===1){const{series:C,originalIndex:w}=t[0],O=C.data[0]||0,N=a,H=a+n-.001,$=N+n/2,Q=Pt.value+Math.cos(N)*Wt.value,Ne=Rt.value+Math.sin(N)*Wt.value,Ke=Pt.value+Math.cos(H)*Wt.value,de=Rt.value+Math.sin(H)*Wt.value,be=Pt.value+Math.cos(H)*ut.value,Ve=Rt.value+Math.sin(H)*ut.value,pe=Pt.value+Math.cos(N)*ut.value,Je=Rt.value+Math.sin(N)*ut.value,Ze=1,Le=[`M ${Q} ${Ne}`,`A ${Wt.value} ${Wt.value} 0 ${Ze} 1 ${Ke} ${de}`,`L ${be} ${Ve}`,`A ${ut.value} ${ut.value} 0 ${Ze} 0 ${pe} ${Je}`,"Z"].join(" "),$e=f(w);return r.push({path:Le,color:$e,strokeWidth:Tt.value,strokeColor:R(0,$e),value:O,seriesName:C.name,opacity:.8,isHighlighted:ve.value===w,isDimmed:!1,isHidden:!1,startAngle:N,endAngle:H,midAngle:$}),r}if(al.value&&t.length===2){const C=t[0],w=t[1],O=Math.min(100,Math.max(0,C.series.data[0]||0)),N=O/100*n;return r.push(p(a,a+N,C.originalIndex,C.series.name,O)),r.push(p(a,a+n,w.originalIndex,w.series.name,100)),r}const g=t.reduce((C,{series:w})=>C+(w.data[0]||0),0);return g===0?[]:(t.forEach(({series:C,originalIndex:w})=>{const O=C.data[0]||0,N=O/g*n,H=a,$=a+N,Q=H+N/2,Ne=Pt.value+Math.cos(H)*Wt.value,Ke=Rt.value+Math.sin(H)*Wt.value,de=Pt.value+Math.cos($)*Wt.value,be=Rt.value+Math.sin($)*Wt.value,Ve=Pt.value+Math.cos($)*ut.value,pe=Rt.value+Math.sin($)*ut.value,Je=Pt.value+Math.cos(H)*ut.value,Ze=Rt.value+Math.sin(H)*ut.value,Le=N>Math.PI?1:0,$e=[`M ${Ne} ${Ke}`,`A ${Wt.value} ${Wt.value} 0 ${Le} 1 ${de} ${be}`,`L ${Ve} ${pe}`,`A ${ut.value} ${ut.value} 0 ${Le} 0 ${Je} ${Ze}`,"Z"].join(" "),Re=f(w);r.push({path:$e,color:Re,strokeWidth:Tt.value,strokeColor:R(r.length,Re),value:O,seriesName:C.name,opacity:.8,isHighlighted:ve.value===w,isDimmed:ve.value!==null&&ve.value!==w,isHidden:!1,startAngle:H,endAngle:$,midAngle:Q}),a=$}),r)}),kn=e.computed(()=>{const t=Ut.value;return al.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((a,n)=>({segment:a,originalIndex:n}))}),fn=e.computed(()=>{if(!Hn.value||!Sn.value)return[];const t=zn.value,a=Nl.value,n=T.value,r=I.value,p=15,g=t*1.3,C=.55,w=($,Q)=>{const Ne=Pt.value+Math.cos($.midAngle)*ut.value,Ke=Rt.value+Math.sin($.midAngle)*ut.value,de=Pt.value+Math.cos($.midAngle)*(ut.value+a),be=Rt.value+Math.sin($.midAngle)*(ut.value+a),pe=de+n*(Q?1:-1),Je=Q?de+p:de-p,Ze=be-r,Le=`${$.seriesName}: ${en($.value)}`,$e=Le.length*t*C;return{pointerStartX:Ne,pointerStartY:Ke,pointerEndX:de,pointerEndY:be,horizontalEndX:pe,horizontalEndY:be,textX:Je,textY:Ze,text:Le,textWidth:$e,textAnchor:Q?"start":"end",isRightSide:Q,pointerLineLength:Math.hypot(de-Ne,be-Ke),horizontalLineLength:Math.hypot(pe-de,0)}},O=($,Q)=>{const Ne=Math.abs($.textY-Q.textY)<g,Ke=$.isRightSide?$.textX:$.textX-$.textWidth,de=$.isRightSide?$.textX+$.textWidth:$.textX,be=Q.isRightSide?Q.textX:Q.textX-Q.textWidth,Ve=Q.isRightSide?Q.textX+Q.textWidth:Q.textX,pe=Ke<Ve&&be<de;return Ne&&pe},N=Ut.value.filter($=>!$.isHidden),H=[];for(let $=0;$<N.length;$++){const Q=N[$];let Ne=Math.cos(Q.midAngle)>=0;if($>0){const de=H[$-1],be=w(Q,Ne);O(de,be)&&(Ne=!Ne)}const Ke=w(Q,Ne);H.push({...Ke,color:Q.color,isHighlighted:Q.isHighlighted,isDimmed:Q.isDimmed})}return H}),sl=t=>{if(!t||t.isHidden)return 0;const a=t.opacity||no.value||.7;return ve.value===null||ve.value===void 0?a:ve.value!==null?t.seriesIndex===ve.value?Math.min(1,a+.1):Math.max(.5,a*.8):a},El=t=>{if(!t||t.isHidden)return 0;const a=t.radius>20?.9:.8;return ve.value!==null?t.seriesIndex===ve.value?Math.min(1,a+.1):a*.7:a},pl=(t,a)=>{if(t)try{if(ve.value===t.seriesIndex?ve.value=null:ve.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:a,chartId:F.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},To=(t,a)=>{const n=[`dss-bubble-fallback-${a}`];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(" ")},wo=(t,a)=>{if(!t||(a.stopPropagation(),Fo.value=!0,ve.value=t.seriesIndex,je.value.show=!1,!Fe.value))return;const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const r=n.getBoundingClientRect();let p=a.clientX-r.left+10,g=a.clientY-r.top-10;const C=200,w=120;p+C>Ee.value&&(p=a.clientX-r.left-C-10),g+w>r.height&&(g=a.clientY-r.top-w-10),p<0&&(p=10),g<0&&(g=10);const O=gn.value,N=Gt.value,H=O.map($=>{const Q=N[$]||$,Ne=Ao($,t);return Ne?{seriesName:t.seriesName,label:t.label,value:`${Q}: ${Ne}`,color:t.color}:null}).filter(Boolean);gt.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:H,categoryIndex:void 0,spiderAreas:[]}},Ao=(t,a)=>{let n;switch(t){case"x":n=a.originalX;break;case"y":n=a.originalY;break;case"size":n=a.originalSize;break;case"label":n=a.label;break;case"seriesName":n=a.seriesName;break;default:n=a[t]||""}const r=Ln.value[t];if(typeof r=="function")return r(n,a);if(typeof n=="number"){const p=n.toFixed(1);return Wn.value?p+Wn.value:p}return n?.toString()||""},Do=()=>{if(!Kt.value||!je.value.data||je.value.data.length===0)return"Bubbles";const t=[],a=new Set;return je.value.data.forEach(n=>{if(n.seriesName&&n.label){const r=`${n.seriesName} - ${n.label}`;a.has(r)||(t.push(r),a.add(r))}else n.seriesName&&(a.has(n.seriesName)||(t.push(n.seriesName),a.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},Go=(t,a)=>{t&&(Fo.value=!1,ve.value=null,gt.value.show=!1,gt.value.bubbleData=[])},Ho=(t,a)=>{const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const r=n.getBoundingClientRect(),p=Ul(t.categoryIndex),g=t.description||t.comment||"";let C=a.clientX-r.left+15,w=a.clientY-r.top-10;const O=200,N=g?80:50;C+O>Ee.value&&(C=a.clientX-r.left-O-15),w+N>re.value&&(w=a.clientY-r.top-N-10),C<0&&(C=10),w<0&&(w=10),Rn.value={show:!0,x:C,y:w,categoryValue:p,description:g}},so=()=>{Rn.value.show=!1},Dl=e.computed(()=>F.categories.length||Math.max(...Jn.value.map(t=>t.data.length))),fl=e.computed(()=>{let t=0;return Jn.value.forEach(a=>{a.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),rl=e.computed(()=>{const t=[],a=Dl.value;for(let n=0;n<a;n++){const r=n*2*Math.PI/a-Math.PI/2,p=Pt.value+Math.cos(r)*ut.value,g=Rt.value+Math.sin(r)*ut.value;t.push({x:p,y:g,angle:r,index:n})}return t}),el=e.computed(()=>{const t=[],a=Dl.value;return rl.value.forEach((n,r)=>{const p=ut.value+15,g=r*2*Math.PI/a-Math.PI/2,C=Pt.value+Math.cos(g)*p,w=Rt.value+Math.sin(g)*p+5;let O="middle",N="middle";Math.abs(Math.cos(g))>.5&&(O=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(N=Math.sin(g)>0?"hanging":"auto"),t.push({x:C,y:w,text:F.categories[r]||`Axis ${r+1}`,anchor:O,baseline:N})}),t}),oa=e.ref(new Set),ha=(t,a,n)=>{const r=`current-${n}`,p=oa.value.has(r),g=a.fillOpacity??Ct.value;return!p&&ve.value===null?g:a.isHighlighted||p?a.isComparison?g:g+.15:a.isDimmed?g*.3:g},aa=e.computed(()=>{if(!wn.value)return[];const t=[],a=Dl.value;return Qn.value.map((r,p)=>({series:r,seriesIndex:p})).sort((r,p)=>{const g=qn(r.series)?0:1,C=qn(p.series)?0:1;return g-C}).forEach(({series:r,seriesIndex:p})=>{const g=qn(r),C=[],w=[],O=[],N=ve.value===p,H=ve.value!==null&&ve.value!==p,$=Ft.value.has(p);for(let Q=0;Q<a;Q++){const Ne=r.data[Q]||0,de=Ne/fl.value*ut.value,be=Q*2*Math.PI/a-Math.PI/2,Ve=Pt.value+Math.cos(be)*de,pe=Rt.value+Math.sin(be)*de;C.push(`${Ve},${pe}`),w.push({x:Ve,y:pe}),O.push({x:Ve,y:pe,value:Ne,label:F.categories[Q]||`Axis ${Q+1}`,seriesName:r.name})}t.push({points:C.join(" "),polygonPoints:w,dataPoints:O,color:ml(r,p),fillOpacity:g?ao.value.fillOpacity:Ct.value,strokeDasharray:g?oo(r)||ao.value.strokeDasharray:null,pointRadius:jl(r,g),seriesName:r.name,value:`${r.name}: ${r.data.join(", ")}`,isHighlighted:N,isDimmed:H,isHidden:$,isComparison:g,seriesIndex:p})}),t}),ya=(t,a)=>{if(!a||a.length<3)return!1;let n=!1;for(let r=0,p=a.length-1;r<a.length;p=r++){const g=a[r].x,C=a[r].y,w=a[p].x,O=a[p].y;C>t.y!=O>t.y&&t.x<(w-g)*(t.y-C)/(O-C)+g&&(n=!n)}return n},ka=t=>{if(!wn.value)return;const a=t.currentTarget.closest(".dss-custom-chart-container");if(!a)return;const n=a.getBoundingClientRect(),r=M.value?.getBoundingClientRect();if(!r)return;const p=t.clientX-r.left,g=t.clientY-r.top,C=aa.value.filter(w=>w.isHidden?!1:ya({x:p,y:g},w.polygonPoints));if(C.length>0){C.length,ve.value=C[0].seriesIndex;const w=t.clientX-n.left+10,O=t.clientY-n.top-10,N=C.length>1?460:260,H=70+Dl.value*20;let $=w,Q=O;$+N>Ee.value&&($=t.clientX-n.left-N-10),Q+H>re.value&&(Q=t.clientY-n.top-H-10),$<0&&($=10),Q<0&&(Q=10);const Ne=C.map(Ke=>({seriesName:Ke.seriesName,color:Ke.color,points:Ke.dataPoints.map(de=>({label:de.label,value:en(de.value)}))}));gt.value={show:!0,x:$,y:Q,title:"",value:"",bubbleData:[],spiderAreas:Ne}}else Sl()},Ro=e.computed(()=>{const t=Z.value;return t.logos.map((a,n)=>{const r=F.series[a.seriesIndex];if(!r||!r.data||r.data.length===0||Ft.value.has(a.seriesIndex))return null;let p,g;if(En.value){let w=-1,O=null;for(let H=r.data.length-1;H>=0;H--)if(r.data[H]!==null&&r.data[H]!==void 0){w=H,O=r.data[H];break}if(w===-1||O===null)return null;const N=r.data.map((H,$)=>H==null?null:{x:ln($),y:Zn(r,H),index:$}).filter(H=>H!==null);if(t.animations.enabled&&!Hl.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(It.value.isAnimating||!It.value.hasAnimated))if(It.value.isAnimating){const H=It.value.currentFrame/It.value.totalFrames,$=ea(t.animations.easing,Math.min(H,1)),Q=Ba(N,$);p=Q.x+(a.offsetX||0),g=Q.y+(a.offsetY||0)}else p=N[0].x+(a.offsetX||0),g=N[0].y+(a.offsetY||0);else p=ln(w)+(a.offsetX||0),g=Al(O)+(a.offsetY||0)}else if(Sn.value||wn.value){const w=Math.PI*2/t.logos.length*n;p=Pt.value+Math.cos(w)*(ut.value+30)+(a.offsetX||0),g=Rt.value+Math.sin(w)*(ut.value+30)+(a.offsetY||0)}return{...a,x:p,y:g,seriesIndex:a.seriesIndex}}).filter(Boolean)}),Ca=t=>{const a=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.opacity="0"),n&&(n.style.opacity="1")},ba=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const a=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.display="none")},Qo=t=>{Ft.value.has(t)?Ft.value.delete(t):Ft.value.add(t)},wa=e.computed(()=>{if(!gt.value.show&&!(Ye.value&&je.value.show&&!ae.value.isZooming))return{display:"none"};let t,a;if(Ye.value&&je.value.show&&!ae.value.isZooming){t=je.value.x+15,a=P.value.top;const n=Kt.value?200:150;t+n>Ee.value&&(t=je.value.x-n-15),t<0&&(t=10),a<10&&(a=10)}else t=gt.value.x,a=gt.value.y;return{left:t+"px",top:a+"px"}}),ql=(t,a)=>{if(!Fe.value||xo.value)return;const r=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-r.left+10,g=a.clientY-r.top-10;const C=200,w=120,O=Ee.value,N=re.value;p+C>O&&(p=a.clientX-r.left-C-10),g+w>N&&(g=a.clientY-r.top-w-10),p<0&&(p=10),g<0&&(g=10);let H;typeof t.categoryIndex=="number"?H=t.categoryIndex:typeof t.dataIndex=="number"?H=t.dataIndex:t.label&&F.categories.includes(t.label)&&(H=F.categories.indexOf(t.label));const $=(nn.value||Ce.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";gt.value={show:!0,x:p,y:g,title:$,value:en(t.value)||"",categoryIndex:H,spiderAreas:[]}},Jo=e.ref(!1),Fo=e.ref(!1),Sl=()=>{gt.value.show=!1,gt.value.spiderAreas=[],gt.value.bubbleData=[],je.value.show=!1,Jo.value||(ve.value=null)},xo=e.ref(!1),Eo=(t,a)=>{xo.value=!0,gt.value.show=!1,je.value.show=!1;const r=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-r.left+15,g=a.clientY-r.top-10;const C=250;p+C>Ee.value&&(p=a.clientX-r.left-C-15),p<0&&(p=10),g<0&&(g=10),qt.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},So=()=>{xo.value=!1,qt.value.show=!1},It=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),ea=(t,a)=>{switch(t){case"linear":return a;case"ease":return a<.5?2*a*a:-1+(4-2*a)*a;case"ease-in":return a*a;case"ease-out":return a*(2-a);case"ease-in-out":return a<.5?2*a*a:-1+(4-2*a)*a;default:return a}},Hl=e.computed(()=>He.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),sa=()=>{if(!at.value||Hl.value){It.value.hasAnimated=!0,In.value&&($l.value=1);return}In.value&&($l.value=0),It.value.isAnimating=!0,It.value.currentFrame=0,It.value.totalFrames=Math.ceil(S.value/16.67);const t=()=>{const a=It.value.currentFrame/It.value.totalFrames,n=ea(V.value,Math.min(a,1));xa(n),In.value&&($l.value=n),a<1?(It.value.currentFrame++,It.value.animationId=requestAnimationFrame(t)):Ea()};It.value.animationId=requestAnimationFrame(t)},xa=t=>{const a=z.value;a&&a.style.setProperty("--dss-animation-progress",t)},Ea=()=>{It.value.isAnimating=!1,It.value.hasAnimated=!0,In.value&&($l.value=1),It.value.animationId&&(cancelAnimationFrame(It.value.animationId),It.value.animationId=null)},ta=e.computed(()=>!Sn.value||It.value.hasAnimated?!0:In.value?$l.value>=1:bl.value?Jt.value>=1:!0),ra=e.computed(()=>Hn.value&&ta.value),Io=e.ref(!1);e.watch(ra,t=>{t?(Io.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Io.value=!0})})):Io.value=!1},{immediate:!0});const Sa=e.computed(()=>{if(!at.value||Hl.value||It.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${S.value}ms`,t["--dss-animation-easing"]=Va(V.value),t["--dss-stagger-delay"]=`${K.value}ms`,t}),Va=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",Na=()=>{if(!at.value||Hl.value)return"";const t=["dss-chart-animated"];return It.value.hasAnimated||t.push(`dss-animate-${sn.value}`),It.value.hasAnimated||(Sn.value&&Ce.value!=="semi-radial"?t.push("dss-animate-fill"):Sn.value||t.push(`dss-animate-${sn.value}`)),It.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>F.series,(t,a)=>{oe.value&&a&&It.value.hasAnimated&&(It.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>sa(),b.value)}))},{deep:!0}),e.watch(()=>ae.value.isZooming,(t,a)=>{a&&!t&&setTimeout(()=>{Mn()},50)}),e.watch(()=>[ae.value.scale,ae.value.offsetX],()=>{!ae.value.isZooming&&!ae.value.isDragging&&Mn()},{flush:"post"}),e.watch([Yt,Ue],([t,a])=>{ae.value.minScale=t,ae.value.maxScale=a,(ae.value.scale<t||ae.value.scale>a)&&Jl()},{immediate:!0}),e.watch(()=>F.locale,t=>{t&&t!==D.value&&(D.value=t)},{immediate:!0}),e.watch(()=>ht.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",go)}):document.removeEventListener("click",go)}),e.onMounted(()=>{ve.value=null,In.value&&(!at.value||Hl.value)&&($l.value=1),x(),z.value&&typeof ResizeObserver<"u"&&(v=new ResizeObserver(t=>{const a=t[0];!a||!a.contentRect||(we&&cancelAnimationFrame(we),we=requestAnimationFrame(()=>{we=null;const{width:n,height:r}=a.contentRect;dt.value=Math.round(n),ee.value=Math.round(r),fe.value&&(_e.value=fe.value.offsetHeight||ke)}))}),v.observe(z.value)),at.value&&!Hl.value?Ce.value==="semi-radial"?setTimeout(()=>jo(),b.value):setTimeout(()=>sa(),b.value):(It.value.hasAnimated=!0,Ce.value==="semi-radial"&&(Jt.value=1)),document.addEventListener("mousemove",ia),document.addEventListener("mouseup",ca),document.addEventListener("click",vo)}),e.onUnmounted(()=>{we&&cancelAnimationFrame(we),v&&z.value&&(v.unobserve(z.value),v.disconnect(),v=null),It.value.animationId&&cancelAnimationFrame(It.value.animationId),Ol&&(cancelAnimationFrame(Ol),Ol=null),ae.value.zoomTimeout&&clearTimeout(ae.value.zoomTimeout),document.removeEventListener("mousemove",ia),document.removeEventListener("mouseup",ca),document.removeEventListener("click",vo),document.removeEventListener("click",go)});const ia=t=>{if(ae.value.isDragging&&ae.value.scale>1&&En.value){je.value.show=!1;const a=t.clientX-ae.value.lastMouseX,{minX:n,maxX:r}=St.value,p=r-n||1,C=a*.8;ae.value.offsetX+=C;const w=p/ae.value.scale,O=p-w,N=0,H=-O/p*P.value.width,$=N;ae.value.offsetX=Math.max(H,Math.min($,ae.value.offsetX)),ae.value.lastMouseX=t.clientX,ae.value.lastMouseY=t.clientY}},ca=()=>{ae.value.isDragging&&(ae.value.isDragging=!1,setTimeout(()=>{!ae.value.isDragging&&ae.value.isZooming},100))},Ba=(t,a)=>{const n=t.filter(w=>w!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||a<=0)return n[0];if(a>=1)return n[n.length-1];let r=0;const p=[];for(let w=1;w<n.length;w++){const O=n[w].x-n[w-1].x,N=n[w].y-n[w-1].y,H=Math.sqrt(O*O+N*N);p.push(H),r+=H}const g=r*a;let C=0;for(let w=0;w<p.length;w++){const O=C+p[w];if(g<=O){const N=(g-C)/p[w],H=n[w],$=n[w+1];return{x:H.x+($.x-H.x)*N,y:H.y+($.y-H.y)*N}}C=O}return n[n.length-1]};return(t,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[Na(),{"dss-chart-fill-width":De.value,"dss-chart-fill-height":We.value,"dss-chart-compact":Sn.value&&!j.value}]]),style:e.normalizeStyle({width:De.value?"100%":Ee.value+"px",height:tt.value,...De.value||We.value?{overflow:Sn.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Sa.value,cursor:Yo()}),"data-chart-type":Ce.value,ref_key:"containerEl",ref:z,onWheel:Vo,onMousedown:Xo,onMousemove:un,onMouseup:ho,onMouseleave:Pn,onDblclick:Jl,onContextmenu:e.withModifiers(Wl,["prevent"]),onClick:e.withModifiers(Yn,["left"]),onWheelCapture:Vo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:fe},[e.createElementVNode("div",Vs,[ot.value?(e.openBlock(),e.createElementBlock("div",Ns,e.toDisplayString(ot.value),1)):e.createCommentVNode("",!0),kt.value?(e.openBlock(),e.createElementBlock("div",Bs,e.toDisplayString(kt.value),1)):e.createCommentVNode("",!0)]),j.value&&ge.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Be.value==="horizontal","dss-legend-vertical":Be.value==="vertical","dss-legend-top":ge.value==="top","dss-legend-bottom":ge.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ft.value.has(r),"dss-legend-hovered":ve.value===r,"dss-legend-dimmed":ve.value!==null&&ve.value!==r}]),onClick:p=>Qo(r),onMouseenter:p=>Qt(r),onMouseleave:Fl,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":wn.value&&qn(n)}]),style:e.normalizeStyle({backgroundColor:wn.value&&qn(n)?"transparent":xl(n,r),borderColor:xl(n,r)})},null,6),e.createElementVNode("span",_s,e.toDisplayString(n.name),1)],46,Ms))),128))],2)):e.createCommentVNode("",!0),j.value&&(ge.value==="left"||ge.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":ge.value==="left","dss-legend-right":ge.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ft.value.has(r),"dss-legend-hovered":ve.value===r,"dss-legend-dimmed":ve.value!==null&&ve.value!==r}]),onClick:p=>Qo(r),onMouseenter:p=>Qt(r),onMouseleave:Fl,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":wn.value&&qn(n)}]),style:e.normalizeStyle({backgroundColor:wn.value&&qn(n)?"transparent":xl(n,r),borderColor:xl(n,r)})},null,6),e.createElementVNode("span",Ls,e.toDisplayString(n.name),1)],46,$s))),128))],2)):e.createCommentVNode("",!0)],512),L.showAddMarkerButton&&Et.value&&ct.value.addMarker&&(En.value||Kt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Uo,title:e.unref(_)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Bt.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,As),a[4]||(a[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,Ts)):e.createCommentVNode("",!0),e.createElementVNode("div",Ds,[Kt.value&&Vt.value?(e.openBlock(),e.createElementBlock("div",Hs,"Bubble size: "+e.toDisplayString(Vt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Ee.value,height:re.value,class:"dss-chart-svg","data-smooth":he.value,"data-animated":at.value,ref_key:"svgEl",ref:M},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:X.value},[e.createElementVNode("rect",{x:0,y:P.value.top,width:Ee.value,height:P.value.height*4},null,8,Is)],8,Fs),bl.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:eo.value},[e.createElementVNode("path",{d:zl.value},null,8,Ps)],8,zs)):e.createCommentVNode("",!0),In.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:No.value},[e.createElementVNode("path",{d:Bo.value},null,8,qs)],8,Os)):e.createCommentVNode("",!0)]),En.value||Kt.value?(e.openBlock(),e.createElementBlock("g",Zs,[Pe.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":me.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(n,r)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${r}`,x1:P.value.left,x2:P.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${r*50}ms`})},null,12,Us))),128))],8,Ws)):e.createCommentVNode("",!0),e.createElementVNode("g",Xs,[e.createElementVNode("line",{x1:P.value.left,x2:P.value.right,y1:P.value.bottom,y2:P.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Ys),e.createElementVNode("line",{x1:P.value.left,x2:P.value.left,y1:P.value.top,y2:P.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,js),Ll.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:P.value.right,x2:P.value.right,y1:P.value.top,y2:P.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Ks)):e.createCommentVNode("",!0)]),e.createElementVNode("g",Gs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(n,r)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${r}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},e.toDisplayString(n.text),13,Qs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(n,r)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${r}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${r*80}ms`})},e.toDisplayString(n.text),13,Js))),128)),Ll.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(m.value,(n,r)=>(e.openBlock(),e.createElementBlock("text",{key:`y-secondary-${r}`,x:n.x,y:n.y,"text-anchor":"start","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${r*80}ms`})},e.toDisplayString(n.text),13,er))),128)):e.createCommentVNode("",!0),Ht.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:P.value.left+P.value.width/2,y:P.value.bottom+45,"text-anchor":"middle","font-size":"14",fill:"#666"},e.toDisplayString(Ht.value),9,tr)):e.createCommentVNode("",!0),zt.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:15,y:P.value.top+12+P.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(-90, 15, ${P.value.top+P.value.height/2})`},e.toDisplayString(zt.value),9,nr)):e.createCommentVNode("",!0),Ll.value&&bt.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:Ee.value-15,y:P.value.top+12+P.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(90, ${Ee.value-15}, ${P.value.top+P.value.height/2})`},e.toDisplayString(bt.value),9,lr)):e.createCommentVNode("",!0)]),bn.value.length>0?(e.openBlock(),e.createElementBlock("g",or,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",{"clip-path":me.value},[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:P.value.bottom,y2:P.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Eo(n,r),onMouseleave:So},null,40,sr)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:P.value.bottom,y2:P.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Eo(n,r),onMouseleave:So},null,40,rr)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:P.value.bottom,y2:P.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Eo(n,r),onMouseleave:So},null,40,ir)):e.createCommentVNode("",!0)],8,ar),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,P.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:r=>Eo(n,r),onMouseleave:So},null,40,cr)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,P.value.top-10),r:"14",fill:n.hasManual&&n.hasAuto||n.hasManual?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:r=>Eo(n,r),onMouseleave:So},null,40,ur),e.createElementVNode("text",{x:n.x,y:Math.max(15,P.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,dr)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":me.value},[Kn.value?(e.openBlock(),e.createElementBlock("g",pr,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":nn.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(an.value,(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${r}`},[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:p=>ql(n,p),onMouseleave:Sl},null,46,fr)):(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:p=>ql(n,p),onMouseleave:Sl},null,46,vr))],64))),128))],2),e.createElementVNode("g",gr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(se.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${r}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Oe.value+2:Oe.value,"stroke-dasharray":n.strokeDasharray,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,hr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${r}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Oe.value+2:Oe.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,yr))),128)),Lt.value>0||le.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(yt.value,(n,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${r}`,cx:n.x,cy:n.y,r:U(n.isHighlighted?W(n,Lt.value)+2:W(n,Lt.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:p=>ql(n,p),onMouseleave:Sl},null,46,kr))),128)):e.createCommentVNode("",!0)])])):Ce.value==="line"?(e.openBlock(),e.createElementBlock("g",Cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${r}`,d:n.path,stroke:n.color,"stroke-width":Oe.value,"stroke-dasharray":n.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":It.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,br))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(se.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${r}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Oe.value+2:Oe.value,"stroke-dasharray":n.strokeDasharray,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,wr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${r}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Oe.value+2:Oe.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,xr))),128)),Lt.value>0||le.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Me.value,(n,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${r}`,cx:n.x,cy:n.y,r:U(n.isHighlighted?W(n,Lt.value)+2:W(n,Lt.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:p=>ql(n,p),onMouseleave:Sl},null,46,Er))),128)):e.createCommentVNode("",!0)])):Ce.value==="area"?(e.openBlock(),e.createElementBlock("g",Sr,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(n,r)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${r}`,id:`area-mask-${r}-${L.chartId}`},[e.createElementVNode("rect",{x:P.value.left-10,y:P.value.top-10,width:P.value.width+20,height:P.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${P.value.width+20}px`})},null,12,Nr)],8,Vr))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${r}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?ie.value+.2:ie.value,mask:`url(#area-mask-${r}-${L.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,Br))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${r}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?Oe.value+1:Oe.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:`${r*K.value}ms`})},null,14,Mr))),128))])):Ce.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(an.value,(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${r}`},[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:p=>ql(n,p),onMouseleave:Sl},null,46,_r)):(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:p=>ql(n,p),onMouseleave:Sl},null,46,$r))],64))),128))],2)):e.createCommentVNode("",!0)],8,mr),Ye.value&&je.value.show&&!ae.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":me.value},[e.createElementVNode("line",{x1:je.value.x,x2:je.value.x,y1:P.value.top,y2:P.value.bottom,stroke:wt.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Tr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.value.data,(n,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${r}`,cx:je.value.x,cy:n.y,r:U(Lt.value+2),fill:n.color,stroke:"none",opacity:"0.9"},null,8,Ar))),128))],8,Lr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Kt.value?(e.openBlock(),e.createElementBlock("g",Dr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dn.value,(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${r}`},[n?(e.openBlock(),e.createElementBlock("g",Hr,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:U(n.radius),fill:n.color,"fill-opacity":sl(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(To(n,r)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>wo(n,p),onMouseleave:p=>Go(n),onClick:p=>pl(n,p)},null,42,Rr),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-${r} ${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:El(n)}),onLoad:p=>Ko(r),onError:p=>_o(r),onMouseenter:p=>wo(n,p),onMouseleave:p=>Go(n),onClick:p=>pl(n,p)},null,46,Fr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),Sn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:Il.value},[Ce.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Pt.value,cy:Rt.value,r:ut.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,zr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":Ce.value,"clip-path":Yl.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kn.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${n.originalIndex}-${r}`,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":Pl(n.originalIndex),class:e.normalizeClass({"dss-series-highlighted":n.segment.isHighlighted,"dss-series-dimmed":n.segment.isDimmed,"dss-series-hidden":n.segment.isHidden}),onMouseover:p=>ql(n.segment,p),onMouseleave:Sl},null,42,Or))),128))],8,Pr),B.value&&ta.value?(e.openBlock(),e.createElementBlock("g",qr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vn.value,(n,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${r}`,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,Zr)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),Te.value&&(ta.value||bl.value||Xl.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:rt.value.x,y:rt.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":pt.value,fill:it.value,class:"dss-radial-data-center"},e.toDisplayString(vt.value),9,Wr)):e.createCommentVNode("",!0),ra.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Io.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fn.value,(n,r)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${r}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${r*.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,Ur),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,Xr),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":zn.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,Yr)],6))),128))],2)):e.createCommentVNode("",!0)],8,Ir)):e.createCommentVNode("",!0),wn.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:Il.value},[Pe.value?(e.openBlock(),e.createElementBlock("g",Kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,(n,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${r}`,cx:Pt.value,cy:Rt.value,r:U(n),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*150}ms`})},null,12,Gr))),128)),e.createElementVNode("g",Qr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,(n,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${r}`},[e.createElementVNode("rect",{x:Pt.value-16,y:Rt.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Jr),e.createElementVNode("text",{x:Pt.value,y:Rt.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(xt(r)),9,ei)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rl.value,(n,r)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${r}`,x1:Pt.value,x2:n.x,y1:Rt.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},null,12,ti))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",ni,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(el.value,(n,r)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${r}`,x:n.x+Math.cos(r*2*Math.PI/Dl.value-Math.PI/2)*16,y:n.y+Math.sin(r*2*Math.PI/Dl.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:`${r*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,li))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:ka,onMouseleave:Sl},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(aa.value,(n,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${r}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":ha("current",n,r),stroke:n.color,"stroke-width":n.isHighlighted?Oe.value+1:Oe.value,"stroke-dasharray":n.strokeDasharray||void 0,"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:`${r*K.value}ms`,transition:"all 0.2s ease"})},null,14,oi),n.pointRadius>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.dataPoints,(p,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${r}-${g}`,cx:p.x,cy:p.y,r:U(n.isHighlighted?n.pointRadius+1:n.pointRadius),fill:n.isComparison?"none":n.color,stroke:n.isComparison?n.color:"none","stroke-width":n.isComparison?2:0,class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${r*K.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>ql(p,C),onMouseleave:Sl},null,46,ai))),128)):e.createCommentVNode("",!0)]))),128))],32)],8,jr)):e.createCommentVNode("",!0),e.createElementVNode("g",si,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ro.value,(n,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${r}`,cx:n.x,cy:n.y,r:U(n.width/2),fill:f(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${r}`),style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,14,ri))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ro.value,(n,r)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${r}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:p=>Ca(r),onError:p=>ba(r),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${r}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,46,ii))),128))])],8,Rs))]),il.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Ee.value+"px",height:re.value+"px",backgroundImage:`url('${Xn.value}')`,backgroundRepeat:"no-repeat",...Rl.value,opacity:_n.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vl.value,(n,r)=>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:Vn.value+"px",height:Vn.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>y(n),["stop"]),onMouseenter:p=>Ho(n,p),onMouseleave:so},[e.createElementVNode("img",{src:cl(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,ui)],44,ci)),[[e.vShow,pn.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",di,e.toDisplayString(Rn.value.categoryValue),1),Rn.value.description?(e.openBlock(),e.createElementBlock("div",mi,e.toDisplayString(Rn.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Fe.value&&(gt.value.show||Ye.value&&je.value.show&&!ae.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Ye.value&&je.value.show&&!ae.value.isZooming,"dss-spider-tooltip":wn.value&>.value.spiderAreas&>.value.spiderAreas.length>0}]),style:e.normalizeStyle(wa.value)},[!Ye.value||!je.value.show||ae.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[wn.value&>.value.spiderAreas&>.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",pi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value.spiderAreas,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${r}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",fi,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createTextVNode(" "+e.toDisplayString(n.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.points,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${r}-${g}`,class:"dss-tooltip-series"},[e.createElementVNode("span",vi,e.toDisplayString(p.label),1),e.createElementVNode("span",gi,e.toDisplayString(p.value),1)]))),128))]))),128))])):Kt.value&>.value.bubbleData&>.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",hi,[gt.value.title?(e.openBlock(),e.createElementBlock("div",yi,e.toDisplayString(gt.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ki,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value.bubbleData,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${r}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",Ci,[e.createElementVNode("div",bi,e.toDisplayString(gt.value.title),1),e.createElementVNode("div",wi,e.toDisplayString(gt.value.value),1)])),gt.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[An(gt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",xi,[a[5]||(a[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ei,e.toDisplayString(e.unref(_)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An(gt.value.categoryIndex).flagGroups,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${r}`},[e.createElementVNode("div",Si,[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,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${r}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Vi,[e.createElementVNode("div",Ni,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),An(gt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Bi,[a[6]||(a[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Mi,e.toDisplayString(e.unref(_)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An(gt.value.categoryIndex).markers,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${r}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",_i,[e.createElementVNode("div",$i,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Li,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",Ti,[e.createElementVNode("div",Ai,e.toDisplayString(Kt.value?Do():L.categories[je.value.categoryIndex]||`Category ${je.value.categoryIndex+1}`),1),Kt.value?(e.openBlock(),e.createElementBlock("div",Di,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.value.data,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${r}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(je.value.data,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${r}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Hi,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Ri,e.toDisplayString(en(n.value)),1)]))),128))]),An(je.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Fi,[a[7]||(a[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ii,e.toDisplayString(e.unref(_)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An(je.value.categoryIndex).flagGroups,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${r}`},[e.createElementVNode("div",zi,[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,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${r}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Pi,[e.createElementVNode("div",Oi,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),An(je.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",qi,[a[8]||(a[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Zi,e.toDisplayString(e.unref(_)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An(je.value.categoryIndex).markers,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${r}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",Wi,[e.createElementVNode("div",Ui,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Xi,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),En.value&&et.value&&ae.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Jl},[a[9]||(a[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(ae.value.scale*100))+"% "+e.toDisplayString(e.unref(_)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Ss),j.value&&ge.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Be.value==="horizontal","dss-legend-vertical":Be.value==="vertical","dss-legend-bottom":!0}]),style:{display:"flex","flex-wrap":"wrap","justify-content":"center",padding:"6px 8px 0"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ft.value.has(r),"dss-legend-hovered":ve.value===r,"dss-legend-dimmed":ve.value!==null&&ve.value!==r}]),onClick:p=>Qo(r),onMouseenter:p=>Qt(r),onMouseleave:Fl,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":wn.value&&qn(n)}]),style:e.normalizeStyle({backgroundColor:wn.value&&qn(n)?"transparent":xl(n,r),borderColor:xl(n,r)})},null,6),e.createElementVNode("span",ji,e.toDisplayString(n.name),1)],46,Yi))),128))],2)):e.createCommentVNode("",!0),ht.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:ht.value.x+"px",top:ht.value.y+"px"}),onClick:a[0]||(a[0]=e.withModifiers(()=>{},["stop"]))},[ct.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:fo},e.toDisplayString(e.unref(_)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),ct.value.addMarker&&(ct.value.downloadSvg||ct.value.downloadPng||ct.value.downloadCsv||Dt.value.length>0)?(e.openBlock(),e.createElementBlock("div",Ki)):e.createCommentVNode("",!0),ct.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:yn},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),ct.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Fn},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),ct.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:On},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Dt.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[ct.value.downloadSvg||ct.value.downloadPng||ct.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Gi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt.value,(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+r},[n.separator?(e.openBlock(),e.createElementBlock("div",Qi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Bn(n)),style:e.normalizeStyle(Gl(n)),onClick:p=>Cl(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Bl(n),class:"dss-custom-menu-content"},null,8,ec)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",tc,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,Ji)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Ie.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:xn},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",nc,[e.createElementVNode("h3",null,e.toDisplayString(Nn.value?e.unref(_)("chart.modalMarker.viewMarker"):yl.value?e.unref(_)("chart.modalMarker.editMarker"):e.unref(_)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:xn},"×")]),e.createElementVNode("div",lc,[e.createElementVNode("div",oc,[e.createVNode(la,{id:"dss-marker-date",mode:"single",modelValue:Ie.value.date,"onUpdate:modelValue":a[1]||(a[1]=n=>Ie.value.date=n),"min-date":ol.value,"max-date":cn.value,disabled:Nn.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",ac,[e.createElementVNode("label",sc,e.toDisplayString(e.unref(_)("chart.modalMarker.description")),1),Nn.value?(e.openBlock(),e.createElementBlock("div",rc,e.toDisplayString(Ie.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":a[2]||(a[2]=n=>Ie.value.description=n),placeholder:e.unref(_)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,ic)),[[e.vModelText,Ie.value.description]])])]),e.createElementVNode("div",cc,[e.createElementVNode("div",uc,[yl.value&&!Nn.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:hn},e.toDisplayString(e.unref(_)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",dc,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:xn},e.toDisplayString(Nn.value?e.unref(_)("chart.modalMarker.close"):e.unref(_)("chart.modalMarker.cancel")),1),Nn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:ul,disabled:!(Ie.value.description&&Ie.value.description.length)},e.toDisplayString(yl.value?e.unref(_)("chart.modalMarker.save"):e.unref(_)("chart.contextMenu.addMarker")),9,mc))])])])])):e.createCommentVNode("",!0)],64))}}),vc={class:"dss-modal-title"},gc={class:"dss-modal-actions"},na={__name:"DSSModal",props:{showModal:{type:Boolean,required:!0},backDrop:{type:Boolean,default:!0},width:{type:String,default:"800px"},height:{type:String,default:"auto"},showCloseBtn:{type:Boolean,default:!0},headerType:{type:String,default:"space-between"},titleSize:{type:String,default:"24px"}},emits:["close-modal"],setup(L,{emit:ne}){const _=L,D=ne,ce=e.ref(null),z=e.ref(null),M=e.computed(()=>{const X={"max-width":_.width};return _.height!=="auto"&&(X.height=_.height,X["min-height"]="0"),X}),fe=e.computed(()=>({}));function dt(){D("close-modal")}function ee(){_.backDrop&&!ce.value&&D("close-modal")}function v(X){X.target.tagName==="INPUT"&&(ce.value=X.target.tagName)}function we(){setTimeout(()=>{ce.value=null},300)}function ke(){const X=document.body,me=document.documentElement;z.value={bodyOverflow:X.style.overflow,bodyPosition:X.style.position,bodyTop:X.style.top,bodyWidth:X.style.width,htmlOverflow:me.style.overflow,scrollY:window.scrollY},X.style.overflow="hidden",X.style.position="fixed",X.style.top=`-${z.value.scrollY}px`,X.style.width="100%",X.style.left="0",me.style.overflow="hidden"}function J(){if(!z.value)return;const X=document.body,me=document.documentElement,{bodyOverflow:F,bodyPosition:Se,bodyTop:Ae,bodyWidth:lt,htmlOverflow:ft,scrollY:Z}=z.value;X.style.overflow=F||"",X.style.position=Se||"",X.style.top=Ae||"",X.style.width=lt||"",X.style.left="",me.style.overflow=ft||"",window.scrollTo(0,Z||0)}return e.watch(()=>_.showModal,X=>{if(X)ke(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const me=document.getElementById("dss-modal-backdrop");me&&(me.addEventListener("focusin",v),me.addEventListener("focusout",we))},100);else{J(),document.body.classList.remove("dss-modal-open");const me=document.getElementById("dss-modal-backdrop");me&&(me.removeEventListener("focusin",v),me.removeEventListener("focusout",we))}},{immediate:!0}),e.onUnmounted(()=>{_.showModal&&J()}),(X,me)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:ee},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(M.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:me[0]||(me[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":L.headerType,"font-size":L.titleSize})},[e.createElementVNode("h1",vc,[e.renderSlot(X.$slots,"title",{},()=>[me[1]||(me[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(X.$slots,"title-data"),L.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:dt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(fe.value)},[e.renderSlot(X.$slots,"content",{},()=>[me[2]||(me[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",gc,[e.renderSlot(X.$slots,"actions")])])],4),[[e.vShow,L.showModal]])])):e.createCommentVNode("",!0)]))}},hc={key:0,class:"dss-table-toolbar"},yc={class:"dss-table-toolbar-left"},kc=["aria-expanded"],Cc={class:"dss-pagination-select-dropdown",role:"listbox"},bc={class:"dss-table-column-visibility-label"},wc={class:"dss-table-checkbox-wrapper"},xc=["checked","onChange"],Ec={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Sc={class:"dss-table-column-visibility-text"},Vc={class:"dss-table-toolbar-right"},Nc=["placeholder","aria-label"],Bc=["aria-label"],Mc=["aria-label","aria-expanded"],_c={key:1,class:"dss-table-toolbar-extra"},$c={class:"dss-table-thead"},Lc={key:0,class:"dss-table-th dss-table-selection-column"},Tc={key:0,class:"dss-table-checkbox-wrapper"},Ac=["checked","indeterminate"],Dc={key:0,class:"dss-table-checkbox__indeterminate"},Hc={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Rc=["aria-label"],Fc=["onClick"],Ic={class:"dss-table-th-content"},zc={class:"dss-table-th-text"},Pc={key:0},Oc={key:1},qc={key:2},Zc=["data-filter-column-key","aria-expanded","aria-label","onClick"],Wc={class:"dss-table-tbody"},Uc=["onClick"],Xc={class:"dss-table-checkbox-wrapper"},Yc=["type","name","checked","disabled","onChange"],jc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Kc={key:1,class:"dss-table-checkbox__dot"},Gc=["onClick"],Qc=["aria-expanded","aria-label"],Jc={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},eu={key:0,class:"dss-table-expansion-row"},tu=["colspan"],nu=["colspan"],lu={key:1,class:"dss-table-pagination"},ou={class:"dss-table-pagination-left"},au={key:0},su={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},ru={class:"dss-table-pagination-center"},iu={key:0,class:"dss-pagination-controls"},cu=["disabled","title"],uu=["disabled","title"],du=["aria-label","onKeydown"],mu={class:"dss-pagination-of"},pu=["disabled","title"],fu=["disabled","title"],vu={class:"dss-table-pagination-right"},gu={class:"dss-pagination-rows-label"},hu=["aria-expanded"],yu=["aria-selected","onClick"],ku={key:0,class:"dss-table-filter-row"},Cu=["value","placeholder"],bu=["min","max","value"],wu=["min","max","value"],xu={class:"dss-table-filter-double-range-values"},Eu={key:2,class:"dss-table-filter-daterange"},Su={class:"dss-table-filter-daterange-row"},Vu={class:"dss-table-filter-daterange-label"},Nu=["value"],Bu={class:"dss-table-filter-daterange-row"},Mu={class:"dss-table-filter-daterange-label"},_u=["value"],$u=["value","placeholder"],Lu={class:"dss-table-filter-list"},Tu=["checked","onChange"],Au={class:"dss-table-filter-actions"},Du={name:"DSSTable"},Hu=Object.assign(Du,{props:{data:{type:Array,required:!0,default:()=>[]},columns:{type:Array,required:!0,default:()=>[]},tableId:{type:String,default:()=>"table-"+Math.random().toString(36).substring(2,9)},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:L=>typeof L=="object"&&L!==null},columnVisibility:{type:Array,default:null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search","update:columnVisibility"],setup(L,{emit:ne}){const{t:_,locale:D}=co.useI18n(),ce=L,z=ne,M={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,expandableRowData:null,expandableRowCondition:null,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single",rowCondition:null},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100],showCounter:!0,showControlsGroup:!0,showControls:!0,showRowsPerPage:!0},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:null};function fe(y,h){const x=Object.assign({},y);return dt(y)&&dt(h)&&Object.keys(h).forEach(q=>{dt(h[q])?q in y?x[q]=fe(y[q],h[q]):Object.assign(x,{[q]:h[q]}):Object.assign(x,{[q]:h[q]})}),x}function dt(y){return y&&typeof y=="object"&&!Array.isArray(y)}const ee=e.computed(()=>fe(M,ce.options)),v=e.computed(()=>{const y=ee.value.table.width;return y==="auto"?null:typeof y=="number"?y:null}),we=e.computed(()=>ee.value.table.height),ke=e.computed(()=>ee.value.table.rowHeight??"auto"),J=e.computed(()=>({height:ke.value})),X=e.computed(()=>ee.value.table.expandable===!0),me=e.computed(()=>ee.value.table.expandableRowData??null),F=e.computed(()=>ee.value.table.expandableRowCondition??null),Se=e.computed(()=>ee.value.table.truncated===!0),Ae=e.computed(()=>ee.value.table.striped),lt=e.computed(()=>ee.value.table.bordered),ft=e.computed(()=>ee.value.table.hoverable),Z=e.computed(()=>ee.value.table.size),De=e.computed(()=>ee.value.table.align||"left");e.computed(()=>ee.value.title.text),e.computed(()=>ee.value.subtitle.text);const We=e.computed(()=>ee.value.selection.enabled),Ee=e.computed(()=>ee.value.selection.mode),_e=e.computed(()=>ee.value.selection.rowCondition??null),Xe=e.computed(()=>ee.value.sorting.enabled),re=e.computed(()=>ee.value.sorting.mode),tt=e.computed(()=>ee.value.pagination.enabled),Ce=e.computed(()=>ee.value.pagination.rows),nt=e.computed(()=>ee.value.pagination.rowsPerPageOptions),ot=e.computed(()=>ee.value.pagination.showCounter!==!1),kt=e.computed(()=>ee.value.pagination.showControlsGroup),Vt=e.computed(()=>kt.value===!1?!1:ee.value.pagination.showControls!==!1),Ht=e.computed(()=>kt.value===!1?!1:ee.value.pagination.showRowsPerPage!==!1),zt=e.computed(()=>tt.value&&(ot.value||Vt.value||Ht.value)),Nt=e.computed(()=>ee.value.scrollable),bt=e.computed(()=>ee.value.emptyMessage||_("table.emptyMessage")),Xt=e.computed(()=>ee.value.toolbar?.downloads?.pdf!==!1),mt=e.computed(()=>ee.value.toolbar?.downloads?.excel!==!1),tn=e.computed(()=>ee.value.toolbar?.search!==!1),Y=e.computed(()=>Xt.value||mt.value||tn.value||ye.value),ye=e.computed(()=>ee.value.toolbar?.columnVisibility!==!1),xe=e.ref(""),Pe=e.ref(!1),j=e.ref(null);let ge=null;function Be(){Pe.value?(ge&&(clearTimeout(ge),ge=null),Pe.value=!1,xe.value="",z("search",""),j.value?.blur()):(Pe.value=!0,ge=setTimeout(()=>{ge=null,j.value?.focus()},80))}function Fe(){xe.value||(Pe.value=!1)}function Ye(){xe.value="",z("search",""),j.value?.focus()}const wt=e.computed(()=>({"dss-table-striped":Ae.value,"dss-table-bordered":lt.value,"dss-table-hoverable":ft.value,[`dss-table-${Z.value}`]:Z.value!=="default","dss-table-truncated":Se.value})),et=(y,h)=>y?.field??y?.key??h,Yt=e.ref(new Set);function Ue(){const y=new Set;return ce.columns.forEach((h,x)=>{h?.hidden!==!0&&y.add(et(h,x))}),y}function Oe(){const y=new Set;return ce.columns.forEach((h,x)=>{y.add(et(h,x))}),y}function Tt(y){if(!Array.isArray(y))return null;const h=Oe(),x=[];return y.forEach(q=>{h.has(q)&&x.push(q)}),x}function Lt(){Yt.value=Ue()}const le=e.computed(()=>{const y=Tt(ce.columnVisibility);return y===null?null:new Set(y)}),W=e.computed(()=>le.value??Yt.value),U=e.computed(()=>ce.columns.filter((y,h)=>W.value.has(et(y,h)))),ie=y=>{const h=ce.columns.findIndex(x=>x===y);return et(y,h>=0?h:0)},he=(y,h)=>W.value.has(et(y,h));function Ge(y){z("update:columnVisibility",Array.from(y))}function At(y,h){const x=et(y,h),q=new Set(W.value);q.has(x)?q.delete(x):q.add(x),le.value===null&&(Yt.value=q),Ge(q)}const jt=e.ref(null),at=e.ref(!1);function sn(y){jt.value&&!jt.value.contains(y.target)&&(at.value=!1)}const S=e.computed(()=>U.value.length+(We.value?1:0)+(X.value?1:0)),b=(y,h)=>y?.id??y?.key??h,V=e.ref(new Set),K=e.ref(null),oe=(y,h)=>V.value.has(b(y,h)),He=(y,h)=>{if(!X.value)return!1;if(typeof F.value=="function")return!!F.value(y,h);if(typeof me.value=="string"&&me.value.trim()){const x=xn(y,me.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},Ct=(y,h,x)=>{if(x&&x.stopPropagation(),!He(y,h))return;const q=b(y,h),ue=new Set(V.value);ue.has(q)?(ue.delete(q),z("row-collapse",{data:y,index:h})):(ue.add(q),z("row-expand",{data:y,index:h})),V.value=ue},st=(y,h)=>{if(!Se.value)return;const x=b(y,h);K.value!==x&&(K.value=x)},ze=e.ref(null),xt=e.ref(0),Mt=e.ref([]),Et=y=>{if(re.value==="single")return ze.value===y.field?xt.value:0;{const h=Mt.value.find(x=>x.field===y.field);return h?h.order:0}},ct=y=>{const h=Et(y);return{"dss-sort-active":h!==0,"dss-sort-asc":h===1,"dss-sort-desc":h===-1}},Dt=e.ref({}),Bt=e.ref(null),rn=e.ref(null),Vn=220,Wn=e.ref(null),en=e.computed(()=>U.value.find(y=>ie(y)===Bt.value)??null),pn=e.computed(()=>{if(!en.value||en.value.filter!=="range")return null;const y=en.value,h=Bt.value,{min:x,max:q}=Nl(y),ue=y.filterMin??x,Qe=y.filterMax??q,Zt=_n(h),yn=Zt.min??ue,Fn=Zt.max??Qe,On=Qe-ue,Cl=On===0?0:(yn-ue)/On*100,fo=On===0?100:(Fn-ue)/On*100;return{rangeMin:ue,rangeMax:Qe,currentMin:yn,currentMax:Fn,minPct:Cl,maxPct:fo}}),ll=e.ref(null),vl=e.ref("max");function il(y){const h=ll.value,x=pn.value;if(!h||!x)return;const q=h.getBoundingClientRect(),Qe=(y.clientX-q.left)/q.width*100,Zt=(x.minPct+x.maxPct)/2;vl.value=Qe<Zt?"min":"max"}function _n(y){return Dt.value[y]??{}}function gl(y,h){Dt.value={...Dt.value,[y]:h}}function $n(y){const h=Dt.value[y];return h?h.type==="string"?!!h.value?.trim():h.type==="range"?h.min!=null||h.max!=null:h.type==="dateRange"?!!(h.from||h.to):h.type==="list"?h.selected?.length>0:!1:!1}function Vl(y){const h={...Dt.value};delete h[y],Dt.value=h,Bt.value=null,rn.value=null}function Rl(){if(!Bt.value){rn.value=null;return}const y=Wn.value;if(!y)return;const h=y.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Bt.value}"]`);if(!h)return;const x=h.getBoundingClientRect();rn.value={top:x.bottom+6,left:Math.max(8,x.right-Vn)}}const hl=e.computed(()=>{const y=String(xe.value??"").trim().toLowerCase();return y?ce.data.filter(h=>U.value.some(x=>Un(ul(h,x)).some(ue=>String(ue).toLowerCase().includes(y)))):ce.data}),An=e.computed(()=>{let y=[...hl.value];const h=(xe.value??"").trim().toLowerCase();return h&&(y=y.filter(x=>ce.columns.some(q=>{if(!q||!q.field)return!1;const ue=ul(x,q);return String(ue??"").toLowerCase().includes(h)}))),U.value.forEach(x=>{const q=ie(x),ue=Dt.value[q];if(!ue)return;const Qe=x.field;if(Qe){if(ue.type==="string"&&ue.value?.trim()){const Zt=ue.value.trim().toLowerCase();y=y.filter(yn=>{const Fn=ul(yn,x);return String(Fn??"").toLowerCase().includes(Zt)})}else if(ue.type==="range")y=y.filter(Zt=>{const yn=xn(Zt,Qe),Fn=Number(yn);return!(Number.isNaN(Fn)||ue.min!=null&&Fn<ue.min||ue.max!=null&&Fn>ue.max)});else if(ue.type==="dateRange"){const Zt=ue.from?new Date(ue.from).getTime():null,yn=ue.to?new Date(ue.to).getTime():null;y=y.filter(Fn=>{const On=xn(Fn,Qe),Cl=On?new Date(On).getTime():NaN;return!(Number.isNaN(Cl)||Zt!=null&&Cl<Zt||yn!=null&&Cl>yn)})}else if(ue.type==="list"&&ue.selected?.length){const Zt=new Set(ue.selected);y=y.filter(yn=>Un(ul(yn,x)).some(On=>Zt.has(On)))}}}),y});function Un(y){if(y==null)return[""];if(Array.isArray(y))return y.flatMap(Un);if(typeof y=="object"){const h=y?.label??y?.name??y?.value??y?.title;return[h!=null?String(h):String(y)]}return[String(y)]}function Xn(y){const h=new Set;return ce.data.forEach(x=>{Un(ul(x,y)).forEach(ue=>h.add(ue))}),Array.from(h).sort((x,q)=>String(x).localeCompare(String(q)))}function Hn(y,h){if(Bt.value===y){Bt.value=null,rn.value=null;return}if(Bt.value=y,h?.currentTarget){const x=h.currentTarget.getBoundingClientRect();rn.value={top:x.bottom+6,left:Math.max(8,x.right-Vn)}}else Rl()}function zn(y,h){gl(y,{type:"string",value:h})}function Nl(y){const h=y.field;if(!h)return{min:0,max:100};let x=1/0,q=-1/0;return ce.data.forEach(ue=>{const Qe=xn(ue,h),Zt=Number(Qe);Number.isNaN(Zt)||(x=Math.min(x,Zt),q=Math.max(q,Zt))}),{min:x===1/0?0:x,max:q===-1/0?100:q}}function T(y,h,x){const q={..._n(y),type:"range"},ue=x===""?null:Number(x),Qe=ue===null||Number.isNaN(ue)?null:ue;q[h]=Qe,Qe!=null&&(h==="min"&&q.max!=null&&Qe>q.max&&(q.max=Qe),h==="max"&&q.min!=null&&Qe<q.min&&(q.min=Qe)),gl(y,q)}function I(y,h,x){const q={..._n(y),type:"dateRange"};q[h]=x||"",gl(y,q)}const B=e.reactive({});function te(y,h){B[y]=h}function Te(y){const h=ie(y),x=(B[h]??"").trim().toLowerCase(),q=Xn(y);return x?q.filter(ue=>String(ue).toLowerCase().includes(x)):q}function vt(y,h){return(_n(y).selected??[]).includes(h!=null?String(h):"")}function pt(y,h){const q=[..._n(y).selected??[]],ue=h!=null?String(h):"",Qe=q.indexOf(ue);Qe>=0?q.splice(Qe,1):q.push(ue),gl(y,{type:"list",selected:q})}function rt(y){Bt.value&&!y.target.closest(".dss-table-filter-wrap")&&!y.target.closest(".dss-table-filter-dropdown")&&(Bt.value=null,rn.value=null)}function it(){Rl(),Gt.value&&je()}const vn=y=>{if(!(y.sortable===!1||!Xe.value))if(re.value==="single")ze.value===y.field?xt.value=xt.value===1?-1:xt.value===-1?0:1:(ze.value=y.field,xt.value=1),xt.value===0&&(ze.value=null),z("sort",{field:ze.value,order:xt.value});else{const h=Mt.value.findIndex(x=>x.field===y.field);h>=0?Mt.value[h].order===1?Mt.value[h].order=-1:Mt.value.splice(h,1):Mt.value.push({field:y.field,order:1}),z("sort",{multiSortMeta:Mt.value})}},bn=e.computed(()=>{if(!Xe.value)return An.value;let y=[...An.value];return re.value==="single"&&ze.value&&xt.value!==0?y.sort((h,x)=>{const q=xn(h,ze.value),ue=xn(x,ze.value);return q===ue?0:q==null?1:ue==null?-1:(q<ue?-1:q>ue?1:0)*xt.value}):re.value==="multiple"&&Mt.value.length>0&&y.sort((h,x)=>{for(const q of Mt.value){const ue=xn(h,q.field),Qe=xn(x,q.field);if(ue===Qe)continue;if(ue==null)return 1;if(Qe==null)return-1;const Zt=ue<Qe?-1:ue>Qe?1:0;if(Zt!==0)return Zt*q.order}return 0}),y}),qt=e.ref(0),gn=e.ref(Ce.value),Gt=e.ref(!1),Ln=e.ref(null),Ft=e.ref(null),ve=e.ref("bottom"),_t=e.ref(null),gt=y=>{gn.value=y,Gt.value=!1,qt.value=0,z("page",{page:0,rows:gn.value})};function Rn(y){Ln.value&&!Ln.value.contains(y.target)&&(Gt.value=!1)}function je(){const y=Ln.value,h=Ft.value;if(!y||!h)return;const x=y.querySelector(".dss-pagination-select-dropdown");if(!x)return;const q=h.getBoundingClientRect(),ue=x.offsetHeight||0,Zt=(window.innerHeight||document.documentElement.clientHeight)-q.bottom,yn=q.top;ve.value=Zt<ue+8&&yn>Zt?"top":"bottom",_t.value={width:`${Math.ceil(q.width)}px`,left:`${Math.max(0,Math.round(h.offsetLeft))}px`}}const ht=e.computed(()=>bn.value.length),ae=e.computed(()=>Math.ceil(ht.value/gn.value)),on=e.computed(()=>Math.max(ae.value,1)),Ie=e.computed(()=>ht.value===0?0:cn.value+1),ol=e.computed(()=>yl.value),cn=e.computed(()=>tt.value?qt.value*gn.value:0),yl=e.computed(()=>tt.value?Math.min((qt.value+1)*gn.value,ht.value):ht.value),Nn=e.computed(()=>{if(!tt.value)return bn.value;const y=cn.value,h=yl.value;return bn.value.slice(y,h)}),Qt=e.ref(new Set),Fl=e.computed(()=>bn.value.filter((y,h)=>Qt.value.has(b(y,h)))),un=(y,h)=>{const x=_e.value;return typeof x!="function"?!0:!!x(y,h)},Pn=e.computed(()=>bn.value.map((y,h)=>({row:y,index:h})).filter(({row:y,index:h})=>un(y,h))),Wl=e.computed(()=>{const y=Pn.value;return y.length===0?!1:y.every(({row:h,index:x})=>Qt.value.has(b(h,x)))}),Yn=e.computed(()=>{const y=Pn.value;if(y.length===0)return!1;const h=y.filter(({row:x,index:q})=>Qt.value.has(b(x,q))).length;return h>0&&h<y.length}),Bl=(y,h)=>Qt.value.has(b(y,h)),Bn=()=>{if(Wl.value)Qt.value=new Set,z("unselect-all");else{const y=new Set;Pn.value.forEach(({row:h,index:x})=>y.add(b(h,x))),Qt.value=y,z("select-all",Fl.value)}},Gl=(y,h)=>{if(!un(y,h))return;const x=b(y,h),q=new Set(Qt.value),ue=q.has(x);Ee.value==="single"?ue?(q.delete(x),z("row-unselect",y)):(q.clear(),q.add(x),z("row-select",y)):ue?(q.delete(x),z("row-unselect",y)):(q.add(x),z("row-select",y)),Qt.value=q},cl=e.ref("1"),Ul=()=>{const y=Number.parseInt(String(cl.value),10);if(!Number.isFinite(y)){cl.value=String(qt.value+1);return}const h=Math.min(on.value,Math.max(1,y));h!==qt.value+1?kl(h-1):cl.value=String(h)},kl=y=>{y<0||y>=ae.value||(qt.value=y,z("page",{page:y,rows:gn.value}))},Ql=(y,h,x)=>{z("row-click",{data:y,index:h,originalEvent:x}),st(y,cn.value+h)},Mn=(y,h)=>{const x=cn.value+h;return{"dss-table-row-selected":Bl(y,x),"dss-table-row-even":h%2===0,"dss-table-row-odd":h%2!==0,"dss-table-row-truncated-clickable":Se.value,"dss-table-row-truncated-expanded":K.value===b(y,x)}},ul=(y,h)=>h.field?xn(y,h.field):"",xn=(y,h)=>h.split(".").reduce((x,q)=>x&&x[q],y),hn=y=>{const h=y.align??De.value;return{"dss-table-sortable":y.sortable!==!1&&Xe.value,"dss-table-align-left":h==="left","dss-table-align-center":h==="center","dss-table-align-right":h==="right",[y.className]:y.className}},jn=y=>{const h={};return y.width&&(h.width=typeof y.width=="number"?`${y.width}px`:y.width),y.minWidth&&(h.minWidth=typeof y.minWidth=="number"?`${y.minWidth}px`:y.minWidth),y.maxWidth&&(h.maxWidth=typeof y.maxWidth=="number"?`${y.maxWidth}px`:y.maxWidth),h};return e.watch(()=>ce.locale,y=>{y&&y!==D.value&&(D.value=y)},{immediate:!0}),e.watch(Ce,y=>{gn.value=y,qt.value=0}),e.watch(Gt,async y=>{y&&(await e.nextTick(),je())}),e.watch(qt,y=>{cl.value=String(y+1)},{immediate:!0}),e.watch(xe,y=>{z("search",y??"")}),e.watch(()=>ce.columns,()=>{if(le.value===null){Lt();return}const y=Tt(ce.columnVisibility)??[];y.length!==ce.columnVisibility.length&&z("update:columnVisibility",y)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Rn),document.addEventListener("click",sn),document.addEventListener("click",rt),window.addEventListener("resize",it),window.addEventListener("scroll",it,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Rn),document.removeEventListener("click",sn),document.removeEventListener("click",rt),window.removeEventListener("resize",it),window.removeEventListener("scroll",it,!0)}),(y,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Wn,style:e.normalizeStyle({width:v.value+"px",height:we.value?we.value+"px":"auto"})},[Y.value?(e.openBlock(),e.createElementBlock("div",hc,[e.createElementVNode("div",yc,[Xt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:h[0]||(h[0]=x=>z("download-pdf"))},[h[22]||(h[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(_)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),mt.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:h[1]||(h[1]=x=>z("download-excel"))},[h[23]||(h[23]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(_)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),ye.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:jt},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":at.value}]),onClick:h[2]||(h[2]=x=>at.value=!at.value),"aria-expanded":at.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(_)("table.columnVisibility"))+" ",1),h[24]||(h[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,kc),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Cc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.columns,(x,q)=>(e.openBlock(),e.createElementBlock("li",{key:et(x,q),role:"option",class:"dss-table-column-visibility-option",onClick:h[3]||(h[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",bc,[e.createElementVNode("span",wc,[e.createElementVNode("input",{type:"checkbox",checked:he(x,q),onChange:ue=>At(x,q),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,xc),he(x,q)?(e.openBlock(),e.createElementBlock("span",Ec,[...h[25]||(h[25]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",Sc,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,at.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(y.$slots,"header")]),e.createElementVNode("div",Vc,[tn.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Pe.value||xe.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:j,"onUpdate:modelValue":h[4]||(h[4]=x=>xe.value=x),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(_)("table.searchPlaceholder"),"aria-label":e.unref(_)("table.searchTableAriaLabel"),onFocus:h[5]||(h[5]=x=>Pe.value=!0),onBlur:Fe},null,40,Nc),[[e.vModelText,xe.value]]),xe.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(_)("table.clearSearchAriaLabel"),onClick:Ye},[...h[26]||(h[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,Bc)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(_)("table.searchAriaLabel"),"aria-expanded":Pe.value||!!xe.value,onMousedown:e.withModifiers(Be,["prevent"])},[...h[27]||(h[27]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,Mc)],2)):e.createCommentVNode("",!0),y.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",_c,[e.renderSlot(y.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":Nt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",wt.value])},[e.createElementVNode("thead",$c,[e.createElementVNode("tr",null,[We.value?(e.openBlock(),e.createElementBlock("th",Lc,[Ee.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Tc,[e.createElementVNode("input",{type:"checkbox",checked:Wl.value,indeterminate:Yn.value,onChange:Bn,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ac),Yn.value?(e.openBlock(),e.createElementBlock("span",Dc)):Wl.value?(e.openBlock(),e.createElementBlock("span",Hc,[...h[28]||(h[28]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(_)("table.expandRowAriaLabel")},null,8,Rc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(x,q)=>(e.openBlock(),e.createElementBlock("th",{key:ie(x),class:e.normalizeClass(["dss-table-th",hn(x)]),style:e.normalizeStyle(jn(x)),onClick:ue=>vn(x)},[e.createElementVNode("div",Ic,[e.createElementVNode("span",zc,e.toDisplayString(x.header),1),x.sortable!==!1&&Xe.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",ct(x)])},[Et(x)===0?(e.openBlock(),e.createElementBlock("span",Pc,[...h[29]||(h[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):Et(x)===1?(e.openBlock(),e.createElementBlock("span",Oc,[...h[30]||(h[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):Et(x)===-1?(e.openBlock(),e.createElementBlock("span",qc,[...h[31]||(h[31]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),x.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Bt.value===ie(x)}]),onClick:h[6]||(h[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":$n(ie(x))}]),"data-filter-column-key":ie(x),"aria-expanded":Bt.value===ie(x),"aria-label":e.unref(_)("table.filterColumnAriaLabel"),onClick:ue=>Hn(ie(x),ue)},[...h[32]||(h[32]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,Zc)],2)):e.createCommentVNode("",!0)])],14,Fc))),128))])]),e.createElementVNode("tbody",Wc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nn.value,(x,q)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:b(x,cn.value+q)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Mn(x,q)]),style:e.normalizeStyle(J.value),onClick:ue=>Ql(x,q,ue)},[We.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:h[7]||(h[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",Xc,[e.createElementVNode("input",{type:Ee.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${L.tableId}`,checked:Bl(x,cn.value+q),disabled:!un(x,cn.value+q),onChange:ue=>Gl(x,cn.value+q),class:e.normalizeClass(["dss-table-checkbox",Ee.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!un(x,cn.value+q)}])},null,42,Yc),Ee.value==="multiple"&&Bl(x,cn.value+q)?(e.openBlock(),e.createElementBlock("span",jc,[...h[33]||(h[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):Ee.value==="single"&&Bl(x,cn.value+q)?(e.openBlock(),e.createElementBlock("span",Kc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(ue=>Ct(x,cn.value+q,ue),["stop"])},[He(x,cn.value+q)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":oe(x,cn.value+q),"aria-label":oe(x,cn.value+q)?e.unref(_)("table.collapseRowAriaLabel"):e.unref(_)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":oe(x,cn.value+q)}]),"aria-hidden":"true"},[...h[34]||(h[34]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,Qc)):(e.openBlock(),e.createElementBlock("span",Jc))],8,Gc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(ue,Qe)=>(e.openBlock(),e.createElementBlock("td",{key:ie(ue),class:e.normalizeClass(["dss-table-td",hn(ue)]),style:e.normalizeStyle(jn(ue))},[e.renderSlot(y.$slots,`cell-${ue.field}`,{data:x,column:ue,rowIndex:q,isExpanded:K.value===b(x,cn.value+q)},()=>[e.createTextVNode(e.toDisplayString(ul(x,ue)),1)])],6))),128))],14,Uc),X.value&&He(x,cn.value+q)&&oe(x,cn.value+q)?(e.openBlock(),e.createElementBlock("tr",eu,[e.createElementVNode("td",{colspan:S.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(y.$slots,"expansion",{data:x,rowIndex:q})],8,tu)])):e.createCommentVNode("",!0)],64))),128)),Nn.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(J.value)},[e.createElementVNode("td",{colspan:S.value,class:"dss-table-empty-cell"},[e.renderSlot(y.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(bt.value),1)])],8,nu)],4))])],2)],2),zt.value?(e.openBlock(),e.createElementBlock("div",lu,[e.createElementVNode("div",ou,[ot.value?(e.openBlock(),e.createElementBlock("span",au,e.toDisplayString(e.unref(_)("table.showingRange",{start:Ie.value,end:ol.value,total:ht.value})),1)):(e.openBlock(),e.createElementBlock("span",su," "))]),e.createElementVNode("div",ru,[Vt.value?(e.openBlock(),e.createElementBlock("div",iu,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:qt.value===0,onClick:h[8]||(h[8]=x=>kl(0)),title:e.unref(_)("table.firstPage")},[...h[35]||(h[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,cu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:qt.value===0,onClick:h[9]||(h[9]=x=>kl(qt.value-1)),title:e.unref(_)("table.previousPage")}," ‹ ",8,uu),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[10]||(h[10]=x=>cl.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(_)("table.currentPageAriaLabel"),onBlur:Ul,onKeydown:e.withKeys(e.withModifiers(Ul,["prevent"]),["enter"])},null,40,du),[[e.vModelText,cl.value]]),e.createElementVNode("span",mu,e.toDisplayString(e.unref(_)("table.ofPages",{total:on.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:qt.value>=ae.value-1,onClick:h[11]||(h[11]=x=>kl(qt.value+1)),title:e.unref(_)("table.nextPage")}," › ",8,pu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:qt.value>=ae.value-1,onClick:h[12]||(h[12]=x=>kl(ae.value-1)),title:e.unref(_)("table.lastPage")},[...h[36]||(h[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,fu)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",vu,[Ht.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Ln},[e.createElementVNode("span",gu,e.toDisplayString(e.unref(_)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Gt.value}]),onClick:h[13]||(h[13]=x=>Gt.value=!Gt.value),"aria-expanded":Gt.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:Ft},[e.createTextVNode(e.toDisplayString(gn.value)+" ",1),h[37]||(h[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,hu),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",{class:e.normalizeClass(["dss-pagination-select-dropdown",{"dss-pagination-select-dropdown--top":ve.value==="top"}]),style:e.normalizeStyle(_t.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nt.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===gn.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===gn.value}]),onClick:q=>gt(x)},e.toDisplayString(x),11,yu))),128))],6),[[e.vShow,Gt.value]])]),_:1})],512)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],4),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"dss-table-filter-dropdown dss-table-filter-dropdown--teleport",style:e.normalizeStyle(rn.value?{top:rn.value.top+"px",left:rn.value.left+"px",width:Vn+"px"}:void 0),onClick:h[21]||(h[21]=e.withModifiers(()=>{},["stop"]))},[en.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[en.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",ku,[e.createElementVNode("input",{type:"text",value:_n(Bt.value).value??"",onInput:h[14]||(h[14]=x=>zn(Bt.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(_)("table.search")},null,40,Cu)])):en.value.filter==="range"&&pn.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":pn.value.minPct+"%","--range-max-pct":pn.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:ll,class:"dss-table-filter-double-range-track",onMousemove:il,onMouseenter:il},[e.createElementVNode("input",{type:"range",min:pn.value.rangeMin,max:pn.value.rangeMax,value:pn.value.currentMin,onInput:h[15]||(h[15]=x=>T(Bt.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:vl.value==="min"?2:1})},null,44,bu),e.createElementVNode("input",{type:"range",min:pn.value.rangeMin,max:pn.value.rangeMax,value:pn.value.currentMax,onInput:h[16]||(h[16]=x=>T(Bt.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:vl.value==="max"?2:1})},null,44,wu)],544),e.createElementVNode("div",xu,e.toDisplayString(pn.value.currentMin)+" – "+e.toDisplayString(pn.value.currentMax),1)],4)):en.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Eu,[e.createElementVNode("div",Su,[e.createElementVNode("label",Vu,e.toDisplayString(e.unref(_)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:_n(Bt.value).from??"",onInput:h[17]||(h[17]=x=>I(Bt.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Nu)]),e.createElementVNode("div",Bu,[e.createElementVNode("label",Mu,e.toDisplayString(e.unref(_)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:_n(Bt.value).to??"",onInput:h[18]||(h[18]=x=>I(Bt.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,_u)])])):en.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:B[Bt.value]??"",onInput:h[19]||(h[19]=x=>te(Bt.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(_)("table.search")},null,40,$u),e.createElementVNode("div",Lu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te(en.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:vt(Bt.value,x),onChange:q=>pt(Bt.value,x)},null,40,Tu),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Au,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:h[20]||(h[20]=x=>Vl(Bt.value))},e.toDisplayString(e.unref(_)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Bt.value&&en.value&&rn.value]])]),_:1})]))],64))}}),Ru="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M6.008%2014V12.68H8.288V6.572L5.996%208.276V6.692L8.012%205.24H9.788V12.68H11.624V14H6.008Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Fu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M5.948%2014V12.548L8.684%209.8C9.068%209.408%209.352%209.056%209.536%208.744C9.72%208.424%209.812%208.096%209.812%207.76C9.812%207.352%209.7%207.036%209.476%206.812C9.252%206.58%208.948%206.464%208.564%206.464C8.14%206.464%207.808%206.588%207.568%206.836C7.328%207.076%207.208%207.412%207.208%207.844H5.708C5.716%207.284%205.836%206.804%206.068%206.404C6.308%205.996%206.644%205.68%207.076%205.456C7.508%205.232%208.012%205.12%208.588%205.12C9.14%205.12%209.62%205.224%2010.028%205.432C10.436%205.64%2010.752%205.932%2010.976%206.308C11.2%206.684%2011.312%207.132%2011.312%207.652C11.312%208.188%2011.172%208.712%2010.892%209.224C10.62%209.728%2010.18%2010.272%209.572%2010.856L7.748%2012.644H11.42V14H5.948Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Iu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.516%2014.12C7.948%2014.12%207.452%2014.016%207.028%2013.808C6.612%2013.6%206.288%2013.308%206.056%2012.932C5.824%2012.556%205.708%2012.112%205.708%2011.6H7.22C7.22%2011.992%207.332%2012.3%207.556%2012.524C7.788%2012.74%208.112%2012.848%208.528%2012.848C8.944%2012.848%209.264%2012.736%209.488%2012.512C9.712%2012.288%209.824%2011.984%209.824%2011.6V10.916C9.824%2010.524%209.712%2010.22%209.488%2010.004C9.264%209.78%208.944%209.668%208.528%209.668H7.544V8.312L9.476%206.524H6.104V5.24H11V6.596L8.528%208.864V8.384C9.392%208.384%2010.076%208.612%2010.58%209.068C11.084%209.524%2011.336%2010.14%2011.336%2010.916V11.6C11.336%2012.112%2011.22%2012.556%2010.988%2012.932C10.756%2013.308%2010.428%2013.6%2010.004%2013.808C9.58%2014.016%209.084%2014.12%208.516%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",zu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M9.68%2014V12.26H5.78V10.088L9.152%205.24H10.832L7.22%2010.484V10.94H9.68V8.96H11.18V14H9.68Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Pu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.588%2014.12C7.78%2014.12%207.132%2013.92%206.644%2013.52C6.156%2013.112%205.888%2012.56%205.84%2011.864H7.34C7.372%2012.168%207.492%2012.404%207.7%2012.572C7.916%2012.732%208.212%2012.812%208.588%2012.812C9.004%2012.812%209.32%2012.704%209.536%2012.488C9.752%2012.264%209.86%2011.956%209.86%2011.564V10.712C9.86%2010.312%209.752%2010.008%209.536%209.8C9.32%209.584%209.004%209.476%208.588%209.476C8.332%209.476%208.112%209.528%207.928%209.632C7.744%209.736%207.604%209.88%207.508%2010.064H6.044L6.104%205.24H11.036V6.596H7.52L7.496%209.14H7.844L7.484%209.44C7.484%209.072%207.628%208.784%207.916%208.576C8.212%208.36%208.608%208.252%209.104%208.252C9.816%208.244%2010.368%208.46%2010.76%208.9C11.16%209.332%2011.36%209.936%2011.36%2010.712V11.564C11.36%2012.356%2011.112%2012.98%2010.616%2013.436C10.128%2013.892%209.452%2014.12%208.588%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Ou="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.6%2014.12C8.016%2014.12%207.5%2014%207.052%2013.76C6.612%2013.512%206.268%2013.168%206.02%2012.728C5.78%2012.28%205.66%2011.764%205.66%2011.18C5.66%2010.764%205.728%2010.328%205.864%209.872C6.008%209.416%206.204%208.988%206.452%208.588L8.516%205.24H10.184L7.592%209.32L7.664%209.368C7.824%209.12%208.04%208.932%208.312%208.804C8.584%208.676%208.888%208.612%209.224%208.612C9.696%208.612%2010.104%208.724%2010.448%208.948C10.792%209.172%2011.06%209.484%2011.252%209.884C11.444%2010.284%2011.54%2010.752%2011.54%2011.288C11.54%2011.856%2011.416%2012.352%2011.168%2012.776C10.928%2013.2%2010.588%2013.532%2010.148%2013.772C9.716%2014.004%209.2%2014.12%208.6%2014.12ZM8.6%2012.848C9.04%2012.848%209.396%2012.708%209.668%2012.428C9.94%2012.14%2010.076%2011.768%2010.076%2011.312C10.076%2010.84%209.94%2010.464%209.668%2010.184C9.396%209.896%209.04%209.752%208.6%209.752C8.16%209.752%207.804%209.896%207.532%2010.184C7.26%2010.464%207.124%2010.84%207.124%2011.312C7.124%2011.768%207.26%2012.14%207.532%2012.428C7.804%2012.708%208.16%2012.848%208.6%2012.848Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",qu={class:"dss-toolbar-left"},Zu=["title"],Wu=["title"],Uu={class:"dss-toolbar-dropdown-wrapper"},Xu=["title"],Yu=["src"],ju=["src"],Ku=["src"],Gu=["src"],Qu=["src"],Ju=["src"],ed={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},td=["src"],nd=["src"],ld=["src"],od=["src"],ad=["src"],sd=["src"],rd=["title"],id=["title"],cd=["title"],ud=["title"],dd=["title"],md=["title"],pd=["title"],fd=["title"],vd=["title"],gd={key:2,class:"dss-toolbar-separator"},hd=["title"],yd={key:4,class:"dss-toolbar-separator"},kd={key:5,class:"dss-toolbar-dropdown-wrapper"},Cd=["title"],bd={class:"dss-toolbar-dropdown-ai"},wd={class:"dss-toolbar-right"},xd={key:0,class:"dss-toolbar-custom-group"},Ed={key:1,class:"dss-toolbar-separator"},Sd={class:"dss-link-modal-content"},Vd={class:"dss-link-modal-field"},Nd={class:"dss-link-modal-label"},Bd=["placeholder"],Md={class:"dss-link-modal-field"},_d={class:"dss-link-modal-label"},$d=["placeholder"],Ld={class:"dss-image-modal-tabs"},Td={key:0,class:"dss-image-tab-content"},Ad={class:"dss-link-modal-content"},Dd={class:"dss-link-modal-field"},Hd={key:0,class:"dss-link-modal-label"},Rd=["src"],Fd={class:"dss-link-modal-field"},Id={class:"dss-link-modal-label"},zd=["placeholder"],Pd={class:"dss-link-modal-field"},Od={class:"dss-link-modal-label"},qd=["placeholder"],Zd={class:"dss-link-modal-field"},Wd={class:"dss-link-modal-label"},Ud=["placeholder"],Xd={key:1,class:"dss-image-tab-content"},Yd={class:"dss-link-modal-content"},jd={class:"dss-link-modal-field"},Kd={class:"dss-link-modal-label"},Gd=["placeholder"],Qd={class:"dss-link-modal-field"},Jd={class:"dss-link-modal-label"},e1=["placeholder"],t1={class:"dss-link-modal-field"},n1={class:"dss-link-modal-label"},l1=["placeholder"],o1={class:"dss-link-modal-field"},a1={class:"dss-link-modal-label"},s1=["placeholder"],r1={class:"dss-text-editor-title-input-container"},i1={key:0,class:"dss-text-editor-title-preview"},c1={key:0},u1={key:1,class:"dss-text-editor-preview-placeholder"},d1=["value","placeholder","disabled"],m1={key:3,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},p1={class:"dss-text-editor-description-input-container"},f1={key:0,class:"dss-text-editor-description-preview"},v1={key:0},g1={key:1,class:"dss-text-editor-preview-placeholder"},h1=["value","placeholder","disabled"],y1={key:5,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},k1=["data-comment-id","onMouseenter"],C1=["onClick"],b1=["src","alt"],w1={key:1},x1=["onClick"],E1=["src","alt"],S1={key:1},V1=["data-has-second-user","onClick"],N1={class:"editor-comment-marker-count"},B1={key:7,class:"dss-text-editor-textarea-wrapper"},M1=["value","placeholder","rows","disabled"],_1={class:"dss-text-editor-footer"},$1={class:"dss-text-editor-footer-content"},L1={class:"dss-text-editor-footer-stat"},T1={class:"dss-text-editor-footer-stat"},A1={key:8,class:"dss-text-editor-content-wrapper"},D1={key:0,class:"dss-comment-overlay-body"},H1={class:"dss-comment-selection-wrapper"},R1=["innerHTML"],F1={class:"dss-comment-messages-wrapper"},I1={key:0,class:"dss-comment-avatar-wrapper"},z1={class:"dss-comment-avatar"},P1=["src","alt"],O1={key:1},q1={class:"dss-comment-header"},Z1={class:"dss-comment-header-text"},W1={class:"dss-comment-author"},U1={key:0,class:"dss-comment-date"},X1=["onClick","title"],Y1={class:"dss-comment-overlay-inner"},j1=["placeholder","onKeydown"],K1={class:"dss-text-editor-footer"},G1={class:"dss-text-editor-footer-content"},Q1={class:"dss-text-editor-footer-stat"},J1={class:"dss-text-editor-footer-stat"},em=["title"],tm=["title"],nm={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:""},lm={class:"dss-image-popup-content"},om={key:0,class:"dss-image-popup-no-alt-icon"},am=["title"],sm=["title"],rm={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:""},im={class:"dss-toolbar-left"},cm=["title"],um=["title"],dm={class:"dss-toolbar-dropdown-wrapper"},mm=["title"],pm=["src"],fm=["src"],vm=["src"],gm=["src"],hm=["src"],ym=["src"],km={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Cm=["title"],bm=["title"],wm=["title"],xm=["title"],Em=["title"],Sm=["title"],Vm=["title"],Nm=["title"],Bm=["title"],Mm={key:2,class:"dss-toolbar-separator"},_m=["title"],$m={key:4,class:"dss-toolbar-separator"},Lm={key:5,class:"dss-toolbar-dropdown-wrapper"},Tm=["title"],Am={class:"dss-toolbar-dropdown-ai"},Dm={key:0,class:"dss-toolbar-right"},Hm={key:0,class:"dss-toolbar-separator"},Rm={key:0,class:"dss-toolbar-custom-group"},Fm={key:1,class:"dss-toolbar-separator"},Im={name:"DSSTextEditor"},zm=Object.assign(Im,{props:{modelValue:{type:String,default:""},title:{type:String,default:""},description:{type:String,default:""},titlePlaceholder:{type:String,default:null},descriptionPlaceholder:{type:String,default:null},placeholder:{type:String,default:null},rows:{type:Number,default:10},fullHeight:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},richText:{type:Boolean,default:!1},border:{type:Boolean,default:!0},rounded:{type:Boolean,default:!1},fixedHeight:{type:Boolean,default:!1},options:{type:Object,default:()=>({}),validator:L=>typeof L=="object"&&L!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},showTitle:{type:Boolean,default:!0},showDescription:{type:Boolean,default:!0},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:L=>typeof L=="object"&&L!==null},locale:{type:String,default:null},comments:{type:Array,default:()=>[]}},emits:["update:modelValue","update:title","update:description","update:comments","change","blur","title-change","description-change","comment-submitted","comment-marker-clicked","comment-deleted"],setup(L,{expose:ne,emit:_}){const{t:D,locale:ce}=co.useI18n(),z={h1:Ru,h2:Fu,h3:Iu,h4:zu,h5:Pu,h6:Ou},M=L,fe=_,dt=e.useSlots(),ee=`<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;"}),r=URL.createObjectURL(n),p=document.createElement("a");p.href=r,p.download=W("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(r),Yn()}catch(t){console.error("Error downloading CSV:",t)}},Cl=t=>{if(typeof t.action=="function"){const a={series:F.series,categories:F.categories,markers:on.value},n={chartX:ht.value.chartX,chartY:ht.value.chartY,dataX:ht.value.mouseDataX,dataY:ht.value.mouseDataY,categoryIndex:clampedCategoryIndex||ht.value.categoryIndex};t.action(a,n)}Yn()},fo=()=>{xn(),Ie.value.show=!0,Ie.value.categoryIndex=ht.value.categoryIndex,Ie.value.fromButton=!1,Yn()},Uo=()=>{xn(),Ie.value.show=!0,Ie.value.categoryIndex=0,Ie.value.fromButton=!0},vo=t=>{if(ht.value.show){const a=document.querySelector(".dss-context-menu");a&&!a.contains(t.target)&&(ht.value.show=!1)}},go=t=>{ht.value.show&&!t.target.closest(".context-menu")&&(ht.value.show=!1)},Vo=t=>{if(!En.value||!Ge.value)return;t.preventDefault(),t.stopPropagation(),ae.value.isZooming=!0,Xe.value.show=!1,ae.value.zoomTimeout&&clearTimeout(ae.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),r=t.clientX-n.left,p=t.clientY-n.top;if(r<P.value.left-50||r>P.value.right+50||p<P.value.top-50||p>P.value.bottom+100){ae.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,C=Math.max(ae.value.minScale,Math.min(ae.value.maxScale,ae.value.scale*g));if(C!==ae.value.scale){const{minX:w,maxX:O}=St.value,N=O-w||1,H=N/ae.value.scale,$=w-ae.value.offsetX/P.value.width*N,G=(r-P.value.left)/P.value.width,Ve=$+G*H;ae.value.scale=C;const Ye=N/ae.value.scale,de=Ve-G*Ye;ae.value.offsetX=-(de-w)/N*P.value.width,ae.value.scale<=1.01&&(ae.value.scale=1,ae.value.offsetX=0)}ae.value.zoomTimeout=setTimeout(()=>{ae.value.isZooming=!1,ae.value.zoomTimeout=null},300)},Xo=t=>{if(!En.value||!Ge.value||ae.value.scale<=1)return;Xe.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,ae.value.isDragging=!0,ae.value.lastMouseX=t.clientX,ae.value.lastMouseY=t.clientY,t.preventDefault()},ho=()=>{ae.value.isDragging=!1},Jl=()=>{!En.value||!Ge.value||(ae.value.scale=1,ae.value.offsetX=0,ae.value.isDragging=!1,ae.value.zoomTimeout&&(clearTimeout(ae.value.zoomTimeout),ae.value.zoomTimeout=null),ae.value.isZooming=!1)},Yo=()=>!En.value||!_t.value||!Ge.value?"default":ae.value.isDragging?"grabbing":ae.value.scale>1?"grab":"dss-crosshair",yo=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 a=`M ${t[0].x} ${t[0].y}`;for(let n=0;n<t.length-1;n++){const r=t[Math.max(n-1,0)],p=t[n],g=t[n+1],C=t[Math.min(n+2,t.length-1)],w=p.x+(g.x-r.x)/6*Ke.value,O=p.y+(g.y-r.y)/6*Ke.value,N=g.x-(C.x-p.x)/6*Ke.value,H=g.y-(C.y-p.y)/6*Ke.value;a+=` C ${w} ${O} ${N} ${H} ${g.x} ${g.y}`}return a},Tn=e.computed(()=>{const a=Z.value?.chart?.padding,n=typeof a=="number"?a:null,r=a&&typeof a=="object"?a:null,p=50;let g=p+(zt.value?30:0)+60;if(wn.value){const $={left:p+40,top:p+40,right:p+40,bottom:p+40};return n!=null?{left:n,top:n,right:n,bottom:n}:r?{left:r.left??$.left,top:r.top??$.top,right:r.right??$.right,bottom:r.bottom??$.bottom}:$}if(Sn.value){const $=!q.value,G=Hn.value,Ve=G?Nl.value+T.value+Math.max(24,zn.value+16):0,Ye=$?12:p;let de=0;ut.value&&(de+=$?8:15),st.value&&(de+=$?6:10);const be=tt();let Se=Ye+($?4:16)+(G?Ve:0),pe=Ye+(G?Ve:0);q.value&&ge.value==="left"?Se+=be.legendWidth||150:q.value&&ge.value==="right"&&(pe+=be.legendWidth||150);const qe=ke.value==="semi-radial"?G?Ve:8:G?Ve:$?8:p+80,Le=G?14:0,$e=Ye+de+Le,Re={left:Se,top:$e,right:pe,bottom:qe};return n!=null?{left:n,top:n,right:n,bottom:n}:r?{left:r.left??Re.left,top:r.top??Re.top,right:r.right??Re.right,bottom:r.bottom??Re.bottom}:Re}let C=0;ut.value&&(C+=15),st.value&&(C+=10);const w=tt();let O=p+16+(Ht.value?30:0),N=p+(bt.value?30:0);q.value&&ge.value==="left"?O+=w.legendWidth||150:q.value&&ge.value==="right"&&(N+=w.legendWidth||150),Ll.value&&(N+=44);const H={left:O,top:p+C,right:N,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:r?{left:r.left??H.left,top:r.top??H.top,right:r.right??H.right,bottom:r.bottom??H.bottom}:H}),P=e.computed(()=>({left:Tn.value.left,top:Tn.value.top,right:xe.value-Tn.value.right,bottom:se.value-Tn.value.bottom,width:xe.value-(Tn.value.left+Tn.value.right),height:se.value-(Tn.value.top+Tn.value.bottom)})),En=e.computed(()=>["line","area","bar"].includes(ke.value)||nt.value),Kn=e.computed(()=>nt.value),Xl=e.computed(()=>ke.value==="mini-radial"),Sn=e.computed(()=>["radial","semi-radial","mini-radial"].includes(ke.value)),wn=e.computed(()=>ke.value==="spider"),jt=e.computed(()=>ke.value==="bubble"),nn=e.computed(()=>Z.value?.chart?.orientation==="horizontal"&&(ke.value==="bar"||Kn.value)),Gn=t=>{const{minY:a,maxY:n}=St.value,r=n-a||1;return P.value.left+(t-a)/r*P.value.width},Ml=t=>{const{maxX:a}=St.value,n=a+1,p=P.value.height/n;return P.value.top+(t+.5)*p},Pt=e.computed(()=>Sn.value?Tn.value.left+(xe.value-Tn.value.left-Tn.value.right)/2:xe.value/2),Rt=e.computed(()=>wn.value?se.value/2-40:Sn.value?Tn.value.top+(se.value-Tn.value.top-Tn.value.bottom)/2:se.value/2),ct=e.computed(()=>{if(wn.value){const t=P.value.width-80,a=P.value.height-80;return Math.min(t,a)/2}return Math.min(P.value.width,P.value.height)/2}),Zt=e.computed(()=>{const t=Z.value,a=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof a=="number"&&a>=0&&a<=1?a:.45;return ct.value*n}),_l=e.computed(()=>{const t=Z.value,a=typeof F.innerSize=="number"?F.innerSize:t?.innerSize;return typeof a!="number"||a<=-100||!(Sn.value||wn.value)?1:1+a/100}),Il=e.computed(()=>{const t=_l.value;if(t===1||t<=0)return;const a=Pt.value,n=Rt.value;return`translate(${a}, ${n}) scale(${t}) translate(${-a}, ${-n})`}),Qt=e.ref(0),eo=e.computed(()=>`semi-radial-fill-clip-${F.chartId}`),bl=e.computed(()=>ke.value==="semi-radial"),dl=e.computed(()=>bl.value&<.value&&!Hl.value),al=e.computed(()=>bl.value&<.value&&!Hl.value&&sn.value==="fill"),zl=e.computed(()=>{const t=dl.value?Qt.value:1,a=Pt.value,n=Rt.value,r=Zt.value,p=ct.value,g=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${a} ${n} L ${a} ${n} Z`;const w=a+p*Math.cos(g),O=n+p*Math.sin(g),N=a+p*Math.cos(C),H=n+p*Math.sin(C),$=a+r*Math.cos(C),G=n+r*Math.sin(C),Ve=a+r*Math.cos(g),Ye=n+r*Math.sin(g),de=t>.5?1:0;return`M ${a} ${n} L ${w} ${O} A ${p} ${p} 0 ${de} 1 ${N} ${H} L ${$} ${G} A ${r} ${r} 0 ${de} 1 ${Ve} ${Ye} Z`}),wl=e.computed(()=>{if(!(!bl.value||!dl.value)&&!al.value)return`url(#${eo.value})`}),Pl=t=>{if(!(!al.value||t!==0))return`url(#${eo.value})`},$l=e.ref(0),No=e.computed(()=>`radial-reveal-clip-${F.chartId}`),In=e.computed(()=>ke.value==="radial"),Bo=e.computed(()=>{const t=In.value?$l.value:1,a=Pt.value,n=Rt.value,r=Math.max(ct.value*1.5,xe.value,se.value);if(t<=0)return`M ${a} ${n} L ${a} ${n} Z`;if(t>=1){const $=a-r,G=a+r;return`M ${$} ${n} A ${r} ${r} 0 0 1 ${G} ${n} A ${r} ${r} 0 0 1 ${$} ${n} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,C=a+r*Math.cos(p),w=n+r*Math.sin(p),O=a+r*Math.cos(g),N=n+r*Math.sin(g),H=t>=.5?1:0;return`M ${a} ${n} L ${C} ${w} A ${r} ${r} 0 ${H} 1 ${O} ${N} Z`}),Yl=e.computed(()=>{if(wl.value)return wl.value;if(In.value)return`url(#${No.value})`});let Ol=null;const jo=()=>{if(!dl.value)return;Qt.value=0;const t=S.value,a=performance.now(),n=r=>{const p=r-a,g=Math.min(1,p/t);Qt.value=ea(V.value,g),g<1&&(Ol=requestAnimationFrame(n))};Ol=requestAnimationFrame(n)},Mo=e.computed(()=>Z.value?.bubbles?.minSize||8),to=e.computed(()=>Z.value?.bubbles?.maxSize||50),no=e.computed(()=>Z.value?.bubbles?.opacity||.7),lo=(t,a)=>{const n=[15,20,25,18,22],r=n[t%n.length]||20,p=1+Math.sin(a*.5)*.2;return Math.max(5,r*p)},Ko=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.opacity="1")},_o=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.display="none")},Qn=e.computed(()=>F.series),Jn=e.computed(()=>F.series.filter((t,a)=>!Ft.value.has(a))),ko=t=>{if(!t)return"primary";const a=t.yAxis??t.axis??t.yAxisId;return a==="secondary"||a==="right"||a===1?"secondary":"primary"},oo=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,qn=t=>t?t.old===!0||t.comparison===!0||t.dotted===!0:!1,ao=e.computed(()=>{const a=Z.value?.spider?.comparison||{};return{fillOpacity:typeof a.fillOpacity=="number"?a.fillOpacity:0,strokeDasharray:a.strokeDasharray||"6,4",usePrimaryColor:a.usePrimaryColor!==!1,bubbleSize:typeof a.bubbleSize=="number"?a.bubbleSize:0}}),jl=(t,a)=>typeof t?.bubbles?.size=="number"?t.bubbles.size:typeof t?.bubbleSize=="number"?t.bubbleSize:a?ao.value.bubbleSize:Lt.value,ml=(t,a)=>qn(t)&&ao.value.usePrimaryColor?f(0):f(a),xl=(t,a)=>wn.value&&qn(t)?ml(t,a):f(a),Co=e.computed(()=>Jn.value.filter(t=>ko(t)==="primary")),$o=e.computed(()=>Jn.value.filter(t=>ko(t)==="secondary")),Ll=e.computed(()=>!nn.value&&!!Nt.value&&$o.value.length>0),Dn="auto",Kl=(t,a,n,r=0,p=100)=>{let g=1/0,C=-1/0;if(t.forEach(N=>{N?.data?.length&&N.data.forEach(H=>{typeof H=="number"&&Number.isFinite(H)&&(g=Math.min(g,H),C=Math.max(C,H))})}),g===1/0)return{minY:r,maxY:p};let w;if(a===Dn){const N=C-g,H=N>0?N*.1:1;w=Math.max(0,g-H)}else if(typeof a=="number")w=a;else{const N=C-g,H=N>0?N*.1:1;w=Math.max(0,g-H)}let O;if(n===Dn){const N=C-g,H=N>0?N*.1:2;O=C+H}else if(typeof n=="number")O=n;else{const N=C-g,H=N>0?N*.1:2;O=C+H}return{minY:w,maxY:O}},St=e.computed(()=>{if(jt.value)return Tl();if(!Jn.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;Jn.value.forEach(n=>{n.data&&n.data.length&&(t=Math.max(t,n.data.length-1))}),F.categories.length>0&&(t=Math.max(t,F.categories.length-1));const a=Kl(Co.value.length?Co.value:Jn.value,Jt.value,dt.value);return{minX:0,maxX:t,minY:a.minY,maxY:a.maxY}}),Lo=e.computed(()=>Ll.value?Kl($o.value,en.value,Ct.value,St.value.minY,St.value.maxY):{minY:St.value.minY,maxY:St.value.maxY}),Tl=()=>{if(!Jn.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,a=-1/0,n=1/0,r=-1/0,p=1/0,g=-1/0,C=!1;if(Jn.value.forEach((Ve,Ye)=>{Ve?.data?.length&&Ve.data.forEach((de,be)=>{let Se,pe,Je;if(typeof de=="object"&&de!==null&&!Array.isArray(de))Se=typeof de.x=="number"?de.x:be,pe=typeof de.y=="number"?de.y:0,Je=typeof de.size=="number"?de.size:20;else if(Array.isArray(de)&&de.length>=3)Se=typeof de[0]=="number"?de[0]:be,pe=typeof de[1]=="number"?de[1]:0,Je=typeof de[2]=="number"?de[2]:20;else if(typeof de=="number")Se=be,pe=de,Je=lo(Ye,be);else return;isFinite(Se)&&isFinite(pe)&&isFinite(Je)&&(t=Math.min(t,Se),a=Math.max(a,Se),n=Math.min(n,pe),r=Math.max(r,pe),p=Math.min(p,Je),g=Math.max(g,Je),C=!0)})}),!C)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===a&&(t=Math.min(t,0),a=Math.max(a,F.categories?.length-1||8)),n===r&&(n=Math.max(0,n-10),r=n+20);const w=a-t,O=r-n;let N,H,$,G;return ee.value!==null?N=ee.value:N=t-w*.1,ve.value!==null?H=ve.value:H=a+w*.1,Jt.value!==null&&typeof Jt.value=="number"?$=Jt.value:$=Math.max(0,n-O*.1),dt.value!==null&&typeof dt.value=="number"?G=dt.value:G=r+O*.1,{minX:N,maxX:H,minY:$,maxY:G,minSize:p,maxSize:g}},ln=t=>{if(jt.value){const{minX:w,maxX:O}=St.value,N=O-w||1;return P.value.left+(t-w)/N*P.value.width}const{minX:a,maxX:n}=St.value,r=n-a;if(n===0||r===0)return P.value.left+P.value.width/2;const p=r/ae.value.scale,g=a-ae.value.offsetX/P.value.width*r,C=(t-g)/p;return P.value.left+C*P.value.width},Al=t=>{const{minY:a,maxY:n}=St.value,r=n-a||1;return P.value.bottom-(t-a)/r*P.value.height},bo=t=>{const{minY:a,maxY:n}=Lo.value,r=n-a||1;return P.value.bottom-(t-a)/r*P.value.height},Wn=(t,a)=>Ll.value&&ko(t)==="secondary"?bo(a):Al(a),o=t=>{if(!jt.value)return Lt.value||4;const{maxSize:a}=St.value,n=Math.max(1,a),r=Math.min(1,Math.max(0,t/n));return Mo.value+r*(to.value-Mo.value)},l=(t,a=12,n="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(a*.62);l.canvas||(l.canvas=document.createElement("canvas"));const r=l.canvas.getContext("2d");return r?(r.font=`${a}px ${n}`,r.measureText(t).width):t.length*(a*.62)},s=(t,a,n=12)=>{if(typeof t!="string"||typeof a!="number"||a<=0||l(t,n)<=a)return t;const r="..";if(l(r,n)>=a)return r;let g=t.length;for(;g>0;){const C=`${t.slice(0,g)}${r}`;if(l(C,n)<=a)return C;g-=1}return r},i=e.computed(()=>u.value.map(t=>({y:t.y}))),c=e.computed(()=>{if(jt.value)return d();if(ke.value==="bar"){if(nn.value){const $e=[],{minY:Re,maxY:$t}=St.value,Ot=5,tl=$t-Re||1;for(let Cn=0;Cn<=Ot;Cn++){const nl=Re+tl*(Cn/Ot),zo=Gn(nl);$e.push({x:zo,y:P.value.bottom+20,text:tn(Math.round(nl))})}return $e}const be=[],{maxX:Se}=St.value,pe=Se+1,Je=5,Le=(P.value.width-Je*2)/pe;for(let $e=0;$e<=Se;$e++){const Re=P.value.left+Je+($e+.5)*Le;be.push({x:Re,y:P.value.bottom+20,text:s(F.categories[$e]||_("chart.fallback.item",{number:$e+1}),Math.max(Le-8,24))})}return be}const t=[],{minX:a,maxX:n}=St.value,r=ee.value!==null?ee.value:a,p=ve.value!==null?ve.value:n,g=p-r||1,C=g/ae.value.scale,w=r-ae.value.offsetX/P.value.width*g,O=w+C,N=Math.max(0,Math.floor(w-2)),H=Math.min(p,Math.ceil(O+2)),$=H-N,G=P.value.width,Ye=Math.floor(G/60);let de=1;$>Ye&&(de=Math.ceil($/Ye));for(let be=N;be<=H;be+=de)if(be>=0&&be<=p){const Se=ln(be);Se>=P.value.left-100&&Se<=P.value.right+100&&t.push({x:Se,y:P.value.bottom+20,text:F.categories[be]||`Item ${be+1}`})}return t}),d=()=>{const t=[],{minX:a,maxX:n}=St.value,r=n-a||1,p=Math.min(8,Math.max(4,Math.floor(P.value.width/80)));for(let g=0;g<=p;g++){const C=a+r*g/p,w=ln(C);if(w>=P.value.left-10&&w<=P.value.right+10){const O=Math.round(C),N=F.categories?.[O];t.push({x:w,y:P.value.bottom+20,text:N||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},u=e.computed(()=>{if(nn.value){const p=[],{maxX:g}=St.value;for(let C=0;C<=g;C++)p.push({x:P.value.left-10,y:Ml(C),text:s(F.categories[C]||`Item ${C+1}`,Math.max(P.value.left-28,40))});return p}const t=[],{minY:a,maxY:n}=St.value,r=5;for(let p=0;p<=r;p++){const g=a+(n-a)*(p/r),C=Math.round(g);t.push({x:P.value.left-10,y:Al(g),text:tn(C)})}return t}),m=e.computed(()=>{if(!Ll.value||nn.value)return[];const t=[],{minY:a,maxY:n}=Lo.value,r=5;for(let p=0;p<=r;p++){const g=a+(n-a)*(p/r),C=Math.round(g);t.push({x:P.value.right+10,y:bo(g),text:tn(C)})}return t}),f=t=>{const a=Yt.value;if(!a||a.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return a[t%a.length]},k=t=>{if(!t||typeof t!="string")return"#3a3a3a";const a=t.trim();let n=0,r=0,p=0;const g=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)n=Number(g[1])/255,r=Number(g[2])/255,p=Number(g[3])/255;else{const w=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(w)n=Number(w[1])/255,r=Number(w[2])/255,p=Number(w[3])/255;else{const O=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(O){let N=O[1];N.length===3&&(N=N[0]+N[0]+N[1]+N[1]+N[2]+N[2]),n=parseInt(N.slice(0,2),16)/255,r=parseInt(N.slice(2,4),16)/255,p=parseInt(N.slice(4,6),16)/255}else if(typeof document<"u"){const N=document.createElement("span");N.style.color=a,N.style.display="none",document.body.appendChild(N);const H=getComputedStyle(N).color;document.body.removeChild(N);const $=H.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if($)n=Number($[1])/255,r=Number($[2])/255,p=Number($[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*r+.0722*p>.5?"#3a3a3a":"#fafafa"},A=t=>{if(!t||typeof t!="string")return t;const a=t.trim(),n=a.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)),C=Math.max(0,Math.floor(Number(n[2])*.65)),w=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${C}, ${w})`}const r=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(r){const g=Math.max(0,Math.floor(Number(r[1])*.65)),C=Math.max(0,Math.floor(Number(r[2])*.65)),w=Math.max(0,Math.floor(Number(r[3])*.65));return`rgba(${g}, ${C}, ${w}, ${r[4]})`}const p=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(p){let g=p[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const C=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),w=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),O=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[C,w,O].map(N=>N.toString(16).padStart(2,"0")).join("")}`}return a},R=(t,a)=>{const r=Z.value?.stroke?.color;return r==null?A(a):typeof r=="string"?r:Array.isArray(r)&&r.length?r[t%r.length]??A(a):A(a)},E=t=>{let a=0;for(let n=1;n<t.length;n++){const r=t[n].x-t[n-1].x,p=t[n].y-t[n-1].y;a+=Math.sqrt(r*r+p*p)}return a},re=e.computed(()=>ke.value==="line"||Kn.value?(Kn.value?F.series.filter(a=>(a.type||ke.value)==="line"):Qn.value).map((a,n)=>{const r=F.series.findIndex($=>$===a),p=[];let g=[];a.data.forEach(($,G)=>{$==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:nn.value?Gn($):ln(G),y:nn.value?Ml(G):Wn(a,$),index:G})}),g.length>0&&p.push(g);let C="";p.forEach($=>{if($.length>0){let G="";ye.value?G=yo($):G=`M ${$[0].x} ${$[0].y}`+$.slice(1).map(Ve=>` L ${Ve.x} ${Ve.y}`).join(""),C+=(C?" ":"")+G}});const w=p.reduce(($,G)=>$+E(G),0),O=Ft.value.has(r),N=he.value===r,H=he.value!==null&&he.value!==r;return{path:C,color:f(r),strokeDasharray:oo(a),pathLength:w,seriesIndex:r,animationDelay:n*j.value,isHighlighted:N,isDimmed:H,isHidden:O}}):[]),K=e.computed(()=>{if(!(ke.value==="line"||Kn.value))return[];const t=Kn.value?F.series.filter(n=>(n.type||ke.value)==="line"):Qn.value,a=[];return t.forEach((n,r)=>{const p=F.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const C=n.data[g];if(C!=null){let w=-1,O=0;for(let N=g+1;N<n.data.length;N++){const H=n.data[N];if(H==null)O++;else{w=N;break}}if(O>0&&w!==-1){const N=n.data[w],H=nn.value?Gn(C):ln(g),$=nn.value?Ml(g):Wn(n,C),G=nn.value?Gn(N):ln(w),Ve=nn.value?Ml(w):Wn(n,N),Ye=Ft.value.has(p),de=he.value===p,be=he.value!==null&&he.value!==p;a.push({path:`M ${H} ${$} L ${G} ${Ve}`,color:f(p),seriesIndex:p,animationDelay:r*j.value,isHighlighted:de,isDimmed:be,isHidden:Ye,gapSize:O}),g=w-1}}}}),a}),Oe=e.computed(()=>ke.value==="line"||Kn.value?!lt.value||Hl.value||It.value.hasAnimated?[]:(Kn.value?F.series.filter(a=>(a.type||ke.value)==="line"):Qn.value).map((a,n)=>{const r=F.series.findIndex(O=>O===a);let p="",g=null;a.data.forEach((O,N)=>{if(O!=null){const H={x:nn.value?Gn(O):ln(N),y:nn.value?Ml(N):Wn(a,O)};g===null?p+=`M ${H.x} ${H.y}`:p+=` L ${H.x} ${H.y}`,g=H}else if(g!==null){const H=a.data.findIndex(($,G)=>G>N&&$!==null&&$!==void 0);if(H!==-1){const $={x:nn.value?Gn(a.data[H]):ln(H),y:nn.value?Ml(H):Wn(a,a.data[H])};p+=` L ${$.x} ${$.y}`,g=$}}});const C=a.data.map((O,N)=>O==null?null:{x:nn.value?Gn(O):ln(N),y:nn.value?Ml(N):Wn(a,O)}).filter(O=>O!==null),w=E(C);return{path:p,pathLength:w,color:f(r),strokeDasharray:oo(a),animationDelay:n*j.value,seriesIndex:r}}):[]),Me=e.computed(()=>{if(ke.value!=="line")return[];const t=[];return Qn.value.forEach((a,n)=>{const r=he.value===n,p=he.value!==null&&he.value!==n,g=Ft.value.has(n);a.data.forEach((C,w)=>{C!=null&&t.push({x:ln(w),y:Wn(a,C),color:f(n),value:C,label:F.categories[w]||w.toString(),seriesName:a.name,categoryIndex:w,dataIndex:w,animationDelay:(n*a.data.length+w)*(j.value/8),isHighlighted:r,isDimmed:p,isHidden:g})})}),t}),yt=e.computed(()=>{if(!Kn.value)return[];const t=[];return F.series.filter(n=>(n.type||ke.value)==="line").forEach((n,r)=>{const p=F.series.findIndex(O=>O===n),g=he.value===p,C=he.value!==null&&he.value!==p,w=Ft.value.has(p);n.data.forEach((O,N)=>{O!=null&&t.push({x:ln(N),y:Wn(n,O),color:f(p),value:O,label:F.categories[N]||N.toString(),seriesName:n.name,categoryIndex:N,dataIndex:N,animationDelay:(r*n.data.length+N)*(j.value/8),isHighlighted:g,isDimmed:C,isHidden:w})})}),t}),dn=e.computed(()=>{if(!jt.value)return[];const t=[];return Qn.value.forEach((a,n)=>{if(!a?.data?.length)return;const r=he.value,p=r!==null&&r===n,g=r!==null&&r!==n,C=Ft.value.has(n);a.data.forEach((w,O)=>{let N,H,$,G,Ve;if(typeof w=="object"&&w!==null&&!Array.isArray(w))N=typeof w.x=="number"?w.x:O,H=typeof w.y=="number"?w.y:0,$=typeof w.size=="number"?w.size:20,G=w.label||F.categories?.[O]||`Point ${O+1}`,Ve=w.image||w.imageUrl;else if(Array.isArray(w)&&w.length>=3)N=typeof w[0]=="number"?w[0]:O,H=typeof w[1]=="number"?w[1]:0,$=typeof w[2]=="number"?w[2]:20,G=w[3]||F.categories?.[O]||`Point ${O+1}`,Ve=w[4];else if(typeof w=="number")N=O,H=w,$=lo(n,O),G=F.categories?.[O]||`Point ${O+1}`;else return;!isFinite(N)||!isFinite(H)||!isFinite($)||t.push({x:ln(N),y:Al(H),radius:o($),originalX:N,originalY:H,originalSize:$,color:f(n),seriesName:a.name||`Series ${n+1}`,label:G,imageUrl:Ve,seriesIndex:n,dataIndex:O,categoryIndex:Math.round(N),isHighlighted:p,isDimmed:g,isHidden:C,opacity:no.value})})}),t}),mn=e.computed(()=>ke.value!=="area"?[]:Qn.value.map((t,a)=>{const n=[];let r=[];if(t.data.forEach(($,G)=>{$==null?r.length>0&&(n.push([...r]),r=[]):r.push({x:ln(G),y:Wn(t,$),index:G})}),r.length>0&&n.push(r),n.length===0)return{linePath:"",areaPath:"",color:f(a),isHidden:Ft.value.has(a)};const p=P.value.bottom+1;let g="",C="";n.forEach(($,G)=>{if($.length===0)return;let Ve=`M ${$[0].x} ${$[0].y}`;ye.value&&$.length>1?Ve=yo($):$.slice(1).forEach(de=>{Ve+=` L ${de.x} ${de.y}`}),g+=(g?" ":"")+Ve;let Ye=`M ${$[0].x} ${p}`;if(Ye+=` L ${$[0].x} ${$[0].y}`,ye.value&&$.length>1){const de=yo($),be=de.substring(de.indexOf("C")||de.indexOf("Q")||de.indexOf("L"));be?Ye+=" "+be:$.slice(1).forEach(Se=>{Ye+=` L ${Se.x} ${Se.y}`})}else $.slice(1).forEach(de=>{Ye+=` L ${de.x} ${de.y}`});Ye+=` L ${$[$.length-1].x} ${p} Z`,C+=(C?" ":"")+Ye});const w=he.value===a,O=he.value!==null&&he.value!==a,N=Ft.value.has(a),H=n.reduce(($,G)=>$+E(G),0);return{linePath:g,areaPath:C,color:f(a),pathLength:H,isHighlighted:w,isDimmed:O,isHidden:N}})),an=e.computed(()=>{if(!(["bar"].includes(ke.value)||Kn.value))return[];const t=[],{maxX:a}=St.value,n=Kn.value?F.series.filter(p=>(p.type||ke.value)==="bar"):Qn.value,r=n.length;if(nn.value){const p=a+1,C=P.value.height/p,w=C*(2/3),O=Math.min(4,w/r*.15),N=w-(r-1)*O,H=Math.max(4,N/r);n.forEach(($,G)=>{const Ve=F.series.findIndex(Se=>Se===$),Ye=he.value===Ve,de=he.value!==null&&he.value!==Ve,be=Ft.value.has(Ve);$.data.forEach((Se,pe)=>{if(Se==null||typeof Se!="number"||!isFinite(Se))return;const Le=P.value.top+(pe+.5)*C-w/2+G*(H+O),$e=P.value.left,Re=Math.abs(Gn(Se)-P.value.left);let $t="";if(ye.value&&Re>0){const Ot=Math.min(At.value,H/2,Re/2);$t=[`M ${$e} ${Le}`,`L ${$e+Re-Ot} ${Le}`,`Q ${$e+Re} ${Le} ${$e+Re} ${Le+Ot}`,`L ${$e+Re} ${Le+H-Ot}`,`Q ${$e+Re} ${Le+H} ${$e+Re-Ot} ${Le+H}`,`L ${$e} ${Le+H}`,"Z"].join(" ")}t.push({x:$e,y:Le,width:Re,height:H,color:f(r===1?pe:Ve),value:Se,label:F.categories[pe]||pe.toString(),seriesName:$.name,animationDelay:(G*n.length+pe)*(j.value/4),isHighlighted:Ye,isDimmed:de,isHidden:be,barPath:$t,isSmooth:ye.value&&Re>0})})})}else{const p=a+1,C=P.value.width/p,w=C*.8,O=w/r,N=O*.05,H=O-N;n.forEach(($,G)=>{const Ve=F.series.findIndex(Se=>Se===$),Ye=he.value===Ve,de=he.value!==null&&he.value!==Ve,be=Ft.value.has(Ve);$.data.forEach((Se,pe)=>{if(Se==null||typeof Se!="number"||!isFinite(Se))return;const Le=P.value.left+(pe+.5)*C-w/2+G*O+N/2,$e=Al(Math.max(0,Se)),Re=Math.abs(Al(0)-Al(Se));let $t="";if(ye.value&&Re>0){const Ot=Math.min(At.value,H/2,Re/2);$t=[`M ${Le} ${$e+Re}`,`L ${Le} ${$e+Ot}`,`Q ${Le} ${$e} ${Le+Ot} ${$e}`,`L ${Le+H-Ot} ${$e}`,`Q ${Le+H} ${$e} ${Le+H} ${$e+Ot}`,`L ${Le+H} ${$e+Re}`,"Z"].join(" ")}t.push({x:Le,y:$e,width:H,height:Re,color:f(r===1?pe:Ve),value:Se,label:F.categories[pe]||pe.toString(),seriesName:$.name,animationDelay:(G*n.length+pe)*(j.value/4),isHighlighted:Ye,isDimmed:de,isHidden:be,barPath:$t,isSmooth:ye.value&&Re>0})})})}return t}),Ut=e.computed(()=>{if(!Sn.value)return[];const t=Qn.value.map((C,w)=>({series:C,originalIndex:w})).filter(({originalIndex:C})=>!Ft.value.has(C));if(t.length===0)return[];let a=ke.value==="semi-radial"?Math.PI:-Math.PI/2;const n=ke.value==="semi-radial"?Math.PI:Math.PI*2,r=[],p=(C,w,O,N,H,$)=>{const G=C+(w-C)/2,Ve=w-C,Ye=Pt.value+Math.cos(C)*Zt.value,de=Rt.value+Math.sin(C)*Zt.value,be=Pt.value+Math.cos(w)*Zt.value,Se=Rt.value+Math.sin(w)*Zt.value,pe=Pt.value+Math.cos(w)*ct.value,Je=Rt.value+Math.sin(w)*ct.value,qe=Pt.value+Math.cos(C)*ct.value,Le=Rt.value+Math.sin(C)*ct.value,$e=Ve>Math.PI?1:0,Re=[`M ${Ye} ${de}`,`A ${Zt.value} ${Zt.value} 0 ${$e} 1 ${be} ${Se}`,`L ${pe} ${Je}`,`A ${ct.value} ${ct.value} 0 ${$e} 0 ${qe} ${Le}`,"Z"].join(" "),$t=$||f(O);return{path:Re,color:$t,strokeWidth:Tt.value,strokeColor:R(r.length,$t),value:H,seriesName:N,opacity:.8,isHighlighted:he.value===O,isDimmed:he.value!==null&&he.value!==O,isHidden:!1,startAngle:C,endAngle:w,midAngle:G}};if(Xl.value){const{series:C,originalIndex:w}=t[0],O=Number(C?.data?.[0]??0),N=Number.isFinite(O)?Math.min(Math.max(O,0),100):0,H=Z.value,$=Math.min(Math.max(Number(H?.miniRadial?.minVisiblePercent??1),0),100),Ve=(N<=0?$:N)/100*n,Ye=Number(H?.miniRadial?.thresholds?.low??33),de=Number(H?.miniRadial?.thresholds?.medium??66),be=H?.miniRadial?.colors?.low||"#E53E3E",Se=H?.miniRadial?.colors?.medium||"#ED8936",pe=H?.miniRadial?.colors?.high||"#38A169",Je=N<=Ye?be:N<=de?Se:pe,qe=H?.miniRadial?.trackColor||"#E5E7EB",Le=C?.name||"Score";return r.push(p(a,a+n-.001,w+1,"Track",100,qe)),r.push(p(a,a+Ve,w,Le,N,Je)),r}if(t.length===1){const{series:C,originalIndex:w}=t[0],O=C.data[0]||0,N=a,H=a+n-.001,$=N+n/2,G=Pt.value+Math.cos(N)*Zt.value,Ve=Rt.value+Math.sin(N)*Zt.value,Ye=Pt.value+Math.cos(H)*Zt.value,de=Rt.value+Math.sin(H)*Zt.value,be=Pt.value+Math.cos(H)*ct.value,Se=Rt.value+Math.sin(H)*ct.value,pe=Pt.value+Math.cos(N)*ct.value,Je=Rt.value+Math.sin(N)*ct.value,qe=1,Le=[`M ${G} ${Ve}`,`A ${Zt.value} ${Zt.value} 0 ${qe} 1 ${Ye} ${de}`,`L ${be} ${Se}`,`A ${ct.value} ${ct.value} 0 ${qe} 0 ${pe} ${Je}`,"Z"].join(" "),$e=f(w);return r.push({path:Le,color:$e,strokeWidth:Tt.value,strokeColor:R(0,$e),value:O,seriesName:C.name,opacity:.8,isHighlighted:he.value===w,isDimmed:!1,isHidden:!1,startAngle:N,endAngle:H,midAngle:$}),r}if(al.value&&t.length===2){const C=t[0],w=t[1],O=Math.min(100,Math.max(0,C.series.data[0]||0)),N=O/100*n;return r.push(p(a,a+N,C.originalIndex,C.series.name,O)),r.push(p(a,a+n,w.originalIndex,w.series.name,100)),r}const g=t.reduce((C,{series:w})=>C+(w.data[0]||0),0);return g===0?[]:(t.forEach(({series:C,originalIndex:w})=>{const O=C.data[0]||0,N=O/g*n,H=a,$=a+N,G=H+N/2,Ve=Pt.value+Math.cos(H)*Zt.value,Ye=Rt.value+Math.sin(H)*Zt.value,de=Pt.value+Math.cos($)*Zt.value,be=Rt.value+Math.sin($)*Zt.value,Se=Pt.value+Math.cos($)*ct.value,pe=Rt.value+Math.sin($)*ct.value,Je=Pt.value+Math.cos(H)*ct.value,qe=Rt.value+Math.sin(H)*ct.value,Le=N>Math.PI?1:0,$e=[`M ${Ve} ${Ye}`,`A ${Zt.value} ${Zt.value} 0 ${Le} 1 ${de} ${be}`,`L ${Se} ${pe}`,`A ${ct.value} ${ct.value} 0 ${Le} 0 ${Je} ${qe}`,"Z"].join(" "),Re=f(w);r.push({path:$e,color:Re,strokeWidth:Tt.value,strokeColor:R(r.length,Re),value:O,seriesName:C.name,opacity:.8,isHighlighted:he.value===w,isDimmed:he.value!==null&&he.value!==w,isHidden:!1,startAngle:H,endAngle:$,midAngle:G}),a=$}),r)}),kn=e.computed(()=>{const t=Ut.value;return al.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((a,n)=>({segment:a,originalIndex:n}))}),fn=e.computed(()=>{if(!Hn.value||!Sn.value)return[];const t=zn.value,a=Nl.value,n=T.value,r=I.value,p=15,g=t*1.3,C=.55,w=($,G)=>{const Ve=Pt.value+Math.cos($.midAngle)*ct.value,Ye=Rt.value+Math.sin($.midAngle)*ct.value,de=Pt.value+Math.cos($.midAngle)*(ct.value+a),be=Rt.value+Math.sin($.midAngle)*(ct.value+a),pe=de+n*(G?1:-1),Je=G?de+p:de-p,qe=be-r,Le=`${$.seriesName}: ${tn($.value)}`,$e=Le.length*t*C;return{pointerStartX:Ve,pointerStartY:Ye,pointerEndX:de,pointerEndY:be,horizontalEndX:pe,horizontalEndY:be,textX:Je,textY:qe,text:Le,textWidth:$e,textAnchor:G?"start":"end",isRightSide:G,pointerLineLength:Math.hypot(de-Ve,be-Ye),horizontalLineLength:Math.hypot(pe-de,0)}},O=($,G)=>{const Ve=Math.abs($.textY-G.textY)<g,Ye=$.isRightSide?$.textX:$.textX-$.textWidth,de=$.isRightSide?$.textX+$.textWidth:$.textX,be=G.isRightSide?G.textX:G.textX-G.textWidth,Se=G.isRightSide?G.textX+G.textWidth:G.textX,pe=Ye<Se&&be<de;return Ve&&pe},N=Ut.value.filter($=>!$.isHidden),H=[];for(let $=0;$<N.length;$++){const G=N[$];let Ve=Math.cos(G.midAngle)>=0;if($>0){const de=H[$-1],be=w(G,Ve);O(de,be)&&(Ve=!Ve)}const Ye=w(G,Ve);H.push({...Ye,color:G.color,isHighlighted:G.isHighlighted,isDimmed:G.isDimmed})}return H}),sl=t=>{if(!t||t.isHidden)return 0;const a=t.opacity||no.value||.7;return he.value===null||he.value===void 0?a:he.value!==null?t.seriesIndex===he.value?Math.min(1,a+.1):Math.max(.5,a*.8):a},El=t=>{if(!t||t.isHidden)return 0;const a=t.radius>20?.9:.8;return he.value!==null?t.seriesIndex===he.value?Math.min(1,a+.1):a*.7:a},pl=(t,a)=>{if(t)try{if(he.value===t.seriesIndex?he.value=null:he.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:a,chartId:F.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},To=(t,a)=>{const n=[`dss-bubble-fallback-${a}`];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(" ")},wo=(t,a)=>{if(!t||(a.stopPropagation(),Fo.value=!0,he.value=t.seriesIndex,Xe.value.show=!1,!Fe.value))return;const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const r=n.getBoundingClientRect();let p=a.clientX-r.left+10,g=a.clientY-r.top-10;const C=200,w=120;p+C>xe.value&&(p=a.clientX-r.left-C-10),g+w>r.height&&(g=a.clientY-r.top-w-10),p<0&&(p=10),g<0&&(g=10);const O=gn.value,N=Kt.value,H=O.map($=>{const G=N[$]||$,Ve=Ao($,t);return Ve?{seriesName:t.seriesName,label:t.label,value:`${G}: ${Ve}`,color:t.color}:null}).filter(Boolean);gt.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:H,categoryIndex:void 0,spiderAreas:[]}},Ao=(t,a)=>{let n;switch(t){case"x":n=a.originalX;break;case"y":n=a.originalY;break;case"size":n=a.originalSize;break;case"label":n=a.label;break;case"seriesName":n=a.seriesName;break;default:n=a[t]||""}const r=Ln.value[t];if(typeof r=="function")return r(n,a);if(typeof n=="number"){const p=n.toFixed(1);return Zn.value?p+Zn.value:p}return n?.toString()||""},Do=()=>{if(!jt.value||!Xe.value.data||Xe.value.data.length===0)return"Bubbles";const t=[],a=new Set;return Xe.value.data.forEach(n=>{if(n.seriesName&&n.label){const r=`${n.seriesName} - ${n.label}`;a.has(r)||(t.push(r),a.add(r))}else n.seriesName&&(a.has(n.seriesName)||(t.push(n.seriesName),a.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},Go=(t,a)=>{t&&(Fo.value=!1,he.value=null,gt.value.show=!1,gt.value.bubbleData=[])},Ho=(t,a)=>{const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const r=n.getBoundingClientRect(),p=Ul(t.categoryIndex),g=t.description||t.comment||"";let C=a.clientX-r.left+15,w=a.clientY-r.top-10;const O=200,N=g?80:50;C+O>xe.value&&(C=a.clientX-r.left-O-15),w+N>se.value&&(w=a.clientY-r.top-N-10),C<0&&(C=10),w<0&&(w=10),Rn.value={show:!0,x:C,y:w,categoryValue:p,description:g}},so=()=>{Rn.value.show=!1},Dl=e.computed(()=>F.categories.length||Math.max(...Jn.value.map(t=>t.data.length))),fl=e.computed(()=>{let t=0;return Jn.value.forEach(a=>{a.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),rl=e.computed(()=>{const t=[],a=Dl.value;for(let n=0;n<a;n++){const r=n*2*Math.PI/a-Math.PI/2,p=Pt.value+Math.cos(r)*ct.value,g=Rt.value+Math.sin(r)*ct.value;t.push({x:p,y:g,angle:r,index:n})}return t}),el=e.computed(()=>{const t=[],a=Dl.value;return rl.value.forEach((n,r)=>{const p=ct.value+15,g=r*2*Math.PI/a-Math.PI/2,C=Pt.value+Math.cos(g)*p,w=Rt.value+Math.sin(g)*p+5;let O="middle",N="middle";Math.abs(Math.cos(g))>.5&&(O=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(N=Math.sin(g)>0?"hanging":"auto"),t.push({x:C,y:w,text:F.categories[r]||`Axis ${r+1}`,anchor:O,baseline:N})}),t}),oa=e.ref(new Set),ha=(t,a,n)=>{const r=`current-${n}`,p=oa.value.has(r),g=a.fillOpacity??kt.value;return!p&&he.value===null?g:a.isHighlighted||p?a.isComparison?g:g+.15:a.isDimmed?g*.3:g},aa=e.computed(()=>{if(!wn.value)return[];const t=[],a=Dl.value;return Qn.value.map((r,p)=>({series:r,seriesIndex:p})).sort((r,p)=>{const g=qn(r.series)?0:1,C=qn(p.series)?0:1;return g-C}).forEach(({series:r,seriesIndex:p})=>{const g=qn(r),C=[],w=[],O=[],N=he.value===p,H=he.value!==null&&he.value!==p,$=Ft.value.has(p);for(let G=0;G<a;G++){const Ve=r.data[G]||0,de=Ve/fl.value*ct.value,be=G*2*Math.PI/a-Math.PI/2,Se=Pt.value+Math.cos(be)*de,pe=Rt.value+Math.sin(be)*de;C.push(`${Se},${pe}`),w.push({x:Se,y:pe}),O.push({x:Se,y:pe,value:Ve,label:F.categories[G]||`Axis ${G+1}`,seriesName:r.name})}t.push({points:C.join(" "),polygonPoints:w,dataPoints:O,color:ml(r,p),fillOpacity:g?ao.value.fillOpacity:kt.value,strokeDasharray:g?oo(r)||ao.value.strokeDasharray:null,pointRadius:jl(r,g),seriesName:r.name,value:`${r.name}: ${r.data.join(", ")}`,isHighlighted:N,isDimmed:H,isHidden:$,isComparison:g,seriesIndex:p})}),t}),ya=(t,a)=>{if(!a||a.length<3)return!1;let n=!1;for(let r=0,p=a.length-1;r<a.length;p=r++){const g=a[r].x,C=a[r].y,w=a[p].x,O=a[p].y;C>t.y!=O>t.y&&t.x<(w-g)*(t.y-C)/(O-C)+g&&(n=!n)}return n},ka=t=>{if(!wn.value)return;const a=t.currentTarget.closest(".dss-custom-chart-container");if(!a)return;const n=a.getBoundingClientRect(),r=M.value?.getBoundingClientRect();if(!r)return;const p=t.clientX-r.left,g=t.clientY-r.top,C=aa.value.filter(w=>w.isHidden?!1:ya({x:p,y:g},w.polygonPoints));if(C.length>0){C.length,he.value=C[0].seriesIndex;const w=t.clientX-n.left+10,O=t.clientY-n.top-10,N=C.length>1?460:260,H=70+Dl.value*20;let $=w,G=O;$+N>xe.value&&($=t.clientX-n.left-N-10),G+H>se.value&&(G=t.clientY-n.top-H-10),$<0&&($=10),G<0&&(G=10);const Ve=C.map(Ye=>({seriesName:Ye.seriesName,color:Ye.color,points:Ye.dataPoints.map(de=>({label:de.label,value:tn(de.value)}))}));gt.value={show:!0,x:$,y:G,title:"",value:"",bubbleData:[],spiderAreas:Ve}}else Sl()},Ro=e.computed(()=>{const t=Z.value;return t.logos.map((a,n)=>{const r=F.series[a.seriesIndex];if(!r||!r.data||r.data.length===0||Ft.value.has(a.seriesIndex))return null;let p,g;if(En.value){let w=-1,O=null;for(let H=r.data.length-1;H>=0;H--)if(r.data[H]!==null&&r.data[H]!==void 0){w=H,O=r.data[H];break}if(w===-1||O===null)return null;const N=r.data.map((H,$)=>H==null?null:{x:ln($),y:Wn(r,H),index:$}).filter(H=>H!==null);if(t.animations.enabled&&!Hl.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(It.value.isAnimating||!It.value.hasAnimated))if(It.value.isAnimating){const H=It.value.currentFrame/It.value.totalFrames,$=ea(t.animations.easing,Math.min(H,1)),G=Ba(N,$);p=G.x+(a.offsetX||0),g=G.y+(a.offsetY||0)}else p=N[0].x+(a.offsetX||0),g=N[0].y+(a.offsetY||0);else p=ln(w)+(a.offsetX||0),g=Al(O)+(a.offsetY||0)}else if(Sn.value||wn.value){const w=Math.PI*2/t.logos.length*n;p=Pt.value+Math.cos(w)*(ct.value+30)+(a.offsetX||0),g=Rt.value+Math.sin(w)*(ct.value+30)+(a.offsetY||0)}return{...a,x:p,y:g,seriesIndex:a.seriesIndex}}).filter(Boolean)}),Ca=t=>{const a=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.opacity="0"),n&&(n.style.opacity="1")},ba=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const a=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.display="none")},Qo=t=>{Ft.value.has(t)?Ft.value.delete(t):Ft.value.add(t)},wa=e.computed(()=>{if(!gt.value.show&&!(Ue.value&&Xe.value.show&&!ae.value.isZooming))return{display:"none"};let t,a;if(Ue.value&&Xe.value.show&&!ae.value.isZooming){t=Xe.value.x+15,a=P.value.top;const n=jt.value?200:150;t+n>xe.value&&(t=Xe.value.x-n-15),t<0&&(t=10),a<10&&(a=10)}else t=gt.value.x,a=gt.value.y;return{left:t+"px",top:a+"px"}}),ql=(t,a)=>{if(!Fe.value||xo.value)return;const r=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-r.left+10,g=a.clientY-r.top-10;const C=200,w=120,O=xe.value,N=se.value;p+C>O&&(p=a.clientX-r.left-C-10),g+w>N&&(g=a.clientY-r.top-w-10),p<0&&(p=10),g<0&&(g=10);let H;typeof t.categoryIndex=="number"?H=t.categoryIndex:typeof t.dataIndex=="number"?H=t.dataIndex:t.label&&F.categories.includes(t.label)&&(H=F.categories.indexOf(t.label));const $=(nn.value||ke.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";gt.value={show:!0,x:p,y:g,title:$,value:tn(t.value)||"",categoryIndex:H,spiderAreas:[]}},Jo=e.ref(!1),Fo=e.ref(!1),Sl=()=>{gt.value.show=!1,gt.value.spiderAreas=[],gt.value.bubbleData=[],Xe.value.show=!1,Jo.value||(he.value=null)},xo=e.ref(!1),Eo=(t,a)=>{xo.value=!0,gt.value.show=!1,Xe.value.show=!1;const r=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-r.left+15,g=a.clientY-r.top-10;const C=250;p+C>xe.value&&(p=a.clientX-r.left-C-15),p<0&&(p=10),g<0&&(g=10),qt.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},So=()=>{xo.value=!1,qt.value.show=!1},It=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),ea=(t,a)=>{switch(t){case"linear":return a;case"ease":return a<.5?2*a*a:-1+(4-2*a)*a;case"ease-in":return a*a;case"ease-out":return a*(2-a);case"ease-in-out":return a<.5?2*a*a:-1+(4-2*a)*a;default:return a}},Hl=e.computed(()=>He.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),sa=()=>{if(!lt.value||Hl.value){It.value.hasAnimated=!0,In.value&&($l.value=1);return}In.value&&($l.value=0),It.value.isAnimating=!0,It.value.currentFrame=0,It.value.totalFrames=Math.ceil(S.value/16.67);const t=()=>{const a=It.value.currentFrame/It.value.totalFrames,n=ea(V.value,Math.min(a,1));xa(n),In.value&&($l.value=n),a<1?(It.value.currentFrame++,It.value.animationId=requestAnimationFrame(t)):Ea()};It.value.animationId=requestAnimationFrame(t)},xa=t=>{const a=z.value;a&&a.style.setProperty("--dss-animation-progress",t)},Ea=()=>{It.value.isAnimating=!1,It.value.hasAnimated=!0,In.value&&($l.value=1),It.value.animationId&&(cancelAnimationFrame(It.value.animationId),It.value.animationId=null)},ta=e.computed(()=>!Sn.value||It.value.hasAnimated?!0:In.value?$l.value>=1:bl.value?Qt.value>=1:!0),ra=e.computed(()=>Hn.value&&ta.value),Io=e.ref(!1);e.watch(ra,t=>{t?(Io.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Io.value=!0})})):Io.value=!1},{immediate:!0});const Sa=e.computed(()=>{if(!lt.value||Hl.value||It.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${S.value}ms`,t["--dss-animation-easing"]=Va(V.value),t["--dss-stagger-delay"]=`${j.value}ms`,t}),Va=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",Na=()=>{if(!lt.value||Hl.value)return"";const t=["dss-chart-animated"];return It.value.hasAnimated||t.push(`dss-animate-${sn.value}`),It.value.hasAnimated||(Sn.value&&ke.value!=="semi-radial"?t.push("dss-animate-fill"):Sn.value||t.push(`dss-animate-${sn.value}`)),It.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>F.series,(t,a)=>{oe.value&&a&&It.value.hasAnimated&&(It.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>sa(),b.value)}))},{deep:!0}),e.watch(()=>ae.value.isZooming,(t,a)=>{a&&!t&&setTimeout(()=>{Mn()},50)}),e.watch(()=>[ae.value.scale,ae.value.offsetX],()=>{!ae.value.isZooming&&!ae.value.isDragging&&Mn()},{flush:"post"}),e.watch([Xt,Ze],([t,a])=>{ae.value.minScale=t,ae.value.maxScale=a,(ae.value.scale<t||ae.value.scale>a)&&Jl()},{immediate:!0}),e.watch(()=>F.locale,t=>{t&&t!==D.value&&(D.value=t)},{immediate:!0}),e.watch(()=>ht.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",go)}):document.removeEventListener("click",go)}),e.onMounted(()=>{he.value=null,In.value&&(!lt.value||Hl.value)&&($l.value=1),x(),z.value&&typeof ResizeObserver<"u"&&(v=new ResizeObserver(t=>{const a=t[0];!a||!a.contentRect||(we&&cancelAnimationFrame(we),we=requestAnimationFrame(()=>{we=null;const{width:n,height:r}=a.contentRect;mt.value=Math.round(n),J.value=Math.round(r),fe.value&&(_e.value=fe.value.offsetHeight||Ce)}))}),v.observe(z.value)),lt.value&&!Hl.value?ke.value==="semi-radial"?setTimeout(()=>jo(),b.value):setTimeout(()=>sa(),b.value):(It.value.hasAnimated=!0,ke.value==="semi-radial"&&(Qt.value=1)),document.addEventListener("mousemove",ia),document.addEventListener("mouseup",ca),document.addEventListener("click",vo)}),e.onUnmounted(()=>{we&&cancelAnimationFrame(we),v&&z.value&&(v.unobserve(z.value),v.disconnect(),v=null),It.value.animationId&&cancelAnimationFrame(It.value.animationId),Ol&&(cancelAnimationFrame(Ol),Ol=null),ae.value.zoomTimeout&&clearTimeout(ae.value.zoomTimeout),document.removeEventListener("mousemove",ia),document.removeEventListener("mouseup",ca),document.removeEventListener("click",vo),document.removeEventListener("click",go)});const ia=t=>{if(ae.value.isDragging&&ae.value.scale>1&&En.value){Xe.value.show=!1;const a=t.clientX-ae.value.lastMouseX,{minX:n,maxX:r}=St.value,p=r-n||1,C=a*.8;ae.value.offsetX+=C;const w=p/ae.value.scale,O=p-w,N=0,H=-O/p*P.value.width,$=N;ae.value.offsetX=Math.max(H,Math.min($,ae.value.offsetX)),ae.value.lastMouseX=t.clientX,ae.value.lastMouseY=t.clientY}},ca=()=>{ae.value.isDragging&&(ae.value.isDragging=!1,setTimeout(()=>{!ae.value.isDragging&&ae.value.isZooming},100))},Ba=(t,a)=>{const n=t.filter(w=>w!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||a<=0)return n[0];if(a>=1)return n[n.length-1];let r=0;const p=[];for(let w=1;w<n.length;w++){const O=n[w].x-n[w-1].x,N=n[w].y-n[w-1].y,H=Math.sqrt(O*O+N*N);p.push(H),r+=H}const g=r*a;let C=0;for(let w=0;w<p.length;w++){const O=C+p[w];if(g<=O){const N=(g-C)/p[w],H=n[w],$=n[w+1];return{x:H.x+($.x-H.x)*N,y:H.y+($.y-H.y)*N}}C=O}return n[n.length-1]};return(t,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[Na(),{"dss-chart-fill-width":De.value,"dss-chart-fill-height":We.value,"dss-chart-compact":Sn.value&&!q.value}]]),style:e.normalizeStyle({width:De.value?"100%":xe.value+"px",height:et.value,...De.value||We.value?{overflow:Sn.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Sa.value,cursor:Yo()}),"data-chart-type":ke.value,ref_key:"containerEl",ref:z,onWheel:Vo,onMousedown:Xo,onMousemove:un,onMouseup:ho,onMouseleave:Pn,onDblclick:Jl,onContextmenu:e.withModifiers(Zl,["prevent"]),onClick:e.withModifiers(Yn,["left"]),onWheelCapture:Vo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:fe},[e.createElementVNode("div",Vs,[ut.value?(e.openBlock(),e.createElementBlock("div",Ns,e.toDisplayString(ut.value),1)):e.createCommentVNode("",!0),st.value?(e.openBlock(),e.createElementBlock("div",Bs,e.toDisplayString(st.value),1)):e.createCommentVNode("",!0)]),q.value&&ge.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Be.value==="horizontal","dss-legend-vertical":Be.value==="vertical","dss-legend-top":ge.value==="top","dss-legend-bottom":ge.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ft.value.has(r),"dss-legend-hovered":he.value===r,"dss-legend-dimmed":he.value!==null&&he.value!==r}]),onClick:p=>Qo(r),onMouseenter:p=>Gt(r),onMouseleave:Fl,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":wn.value&&qn(n)}]),style:e.normalizeStyle({backgroundColor:wn.value&&qn(n)?"transparent":xl(n,r),borderColor:xl(n,r)})},null,6),e.createElementVNode("span",_s,e.toDisplayString(n.name),1)],46,Ms))),128))],2)):e.createCommentVNode("",!0),q.value&&(ge.value==="left"||ge.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":ge.value==="left","dss-legend-right":ge.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ft.value.has(r),"dss-legend-hovered":he.value===r,"dss-legend-dimmed":he.value!==null&&he.value!==r}]),onClick:p=>Qo(r),onMouseenter:p=>Gt(r),onMouseleave:Fl,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":wn.value&&qn(n)}]),style:e.normalizeStyle({backgroundColor:wn.value&&qn(n)?"transparent":xl(n,r),borderColor:xl(n,r)})},null,6),e.createElementVNode("span",Ls,e.toDisplayString(n.name),1)],46,$s))),128))],2)):e.createCommentVNode("",!0)],512),L.showAddMarkerButton&&Et.value&&it.value.addMarker&&(En.value||jt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Uo,title:e.unref(_)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Bt.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,As),a[4]||(a[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,Ts)):e.createCommentVNode("",!0),e.createElementVNode("div",Ds,[jt.value&&Vt.value?(e.openBlock(),e.createElementBlock("div",Hs,"Bubble size: "+e.toDisplayString(Vt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:xe.value,height:se.value,class:"dss-chart-svg","data-smooth":ye.value,"data-animated":lt.value,ref_key:"svgEl",ref:M},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:Y.value},[e.createElementVNode("rect",{x:0,y:P.value.top,width:xe.value,height:P.value.height*4},null,8,Is)],8,Fs),bl.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:eo.value},[e.createElementVNode("path",{d:zl.value},null,8,Ps)],8,zs)):e.createCommentVNode("",!0),In.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:No.value},[e.createElementVNode("path",{d:Bo.value},null,8,qs)],8,Os)):e.createCommentVNode("",!0)]),En.value||jt.value?(e.openBlock(),e.createElementBlock("g",Ws,[Ne.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":me.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(n,r)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${r}`,x1:P.value.left,x2:P.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${r*50}ms`})},null,12,Us))),128))],8,Zs)):e.createCommentVNode("",!0),e.createElementVNode("g",Xs,[e.createElementVNode("line",{x1:P.value.left,x2:P.value.right,y1:P.value.bottom,y2:P.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Ys),e.createElementVNode("line",{x1:P.value.left,x2:P.value.left,y1:P.value.top,y2:P.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,js),Ll.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:P.value.right,x2:P.value.right,y1:P.value.top,y2:P.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Ks)):e.createCommentVNode("",!0)]),e.createElementVNode("g",Gs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(n,r)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${r}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},e.toDisplayString(n.text),13,Qs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(n,r)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${r}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${r*80}ms`})},e.toDisplayString(n.text),13,Js))),128)),Ll.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(m.value,(n,r)=>(e.openBlock(),e.createElementBlock("text",{key:`y-secondary-${r}`,x:n.x,y:n.y,"text-anchor":"start","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${r*80}ms`})},e.toDisplayString(n.text),13,er))),128)):e.createCommentVNode("",!0),zt.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:P.value.left+P.value.width/2,y:P.value.bottom+45,"text-anchor":"middle","font-size":"14",fill:"#666"},e.toDisplayString(zt.value),9,tr)):e.createCommentVNode("",!0),Ht.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:15,y:P.value.top+12+P.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(-90, 15, ${P.value.top+P.value.height/2})`},e.toDisplayString(Ht.value),9,nr)):e.createCommentVNode("",!0),Ll.value&&bt.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:xe.value-15,y:P.value.top+12+P.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(90, ${xe.value-15}, ${P.value.top+P.value.height/2})`},e.toDisplayString(bt.value),9,lr)):e.createCommentVNode("",!0)]),bn.value.length>0?(e.openBlock(),e.createElementBlock("g",or,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",{"clip-path":me.value},[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:P.value.bottom,y2:P.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Eo(n,r),onMouseleave:So},null,40,sr)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:P.value.bottom,y2:P.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Eo(n,r),onMouseleave:So},null,40,rr)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:P.value.bottom,y2:P.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>Eo(n,r),onMouseleave:So},null,40,ir)):e.createCommentVNode("",!0)],8,ar),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,P.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:r=>Eo(n,r),onMouseleave:So},null,40,cr)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,P.value.top-10),r:"14",fill:n.hasManual&&n.hasAuto||n.hasManual?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:r=>Eo(n,r),onMouseleave:So},null,40,ur),e.createElementVNode("text",{x:n.x,y:Math.max(15,P.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,dr)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":me.value},[Kn.value?(e.openBlock(),e.createElementBlock("g",pr,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":nn.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(an.value,(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${r}`},[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:p=>ql(n,p),onMouseleave:Sl},null,46,fr)):(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:p=>ql(n,p),onMouseleave:Sl},null,46,vr))],64))),128))],2),e.createElementVNode("g",gr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${r}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Pe.value+2:Pe.value,"stroke-dasharray":n.strokeDasharray,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,hr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${r}`,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,yr))),128)),Lt.value>0||le.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(yt.value,(n,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${r}`,cx:n.x,cy:n.y,r:X(n.isHighlighted?U(n,Lt.value)+2:U(n,Lt.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:p=>ql(n,p),onMouseleave:Sl},null,46,kr))),128)):e.createCommentVNode("",!0)])])):ke.value==="line"?(e.openBlock(),e.createElementBlock("g",Cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${r}`,d:n.path,stroke:n.color,"stroke-width":Pe.value,"stroke-dasharray":n.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":It.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,br))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${r}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Pe.value+2:Pe.value,"stroke-dasharray":n.strokeDasharray,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,wr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${r}`,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,xr))),128)),Lt.value>0||le.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Me.value,(n,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${r}`,cx:n.x,cy:n.y,r:X(n.isHighlighted?U(n,Lt.value)+2:U(n,Lt.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:p=>ql(n,p),onMouseleave:Sl},null,46,Er))),128)):e.createCommentVNode("",!0)])):ke.value==="area"?(e.openBlock(),e.createElementBlock("g",Sr,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(n,r)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${r}`,id:`area-mask-${r}-${L.chartId}`},[e.createElementVNode("rect",{x:P.value.left-10,y:P.value.top-10,width:P.value.width+20,height:P.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${P.value.width+20}px`})},null,12,Nr)],8,Vr))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${r}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?ie.value+.2:ie.value,mask:`url(#area-mask-${r}-${L.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,Br))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${r}`,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:`${r*j.value}ms`})},null,14,Mr))),128))])):ke.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(an.value,(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${r}`},[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:p=>ql(n,p),onMouseleave:Sl},null,46,_r)):(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:p=>ql(n,p),onMouseleave:Sl},null,46,$r))],64))),128))],2)):e.createCommentVNode("",!0)],8,mr),Ue.value&&Xe.value.show&&!ae.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":me.value},[e.createElementVNode("line",{x1:Xe.value.x,x2:Xe.value.x,y1:P.value.top,y2:P.value.bottom,stroke:wt.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Tr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value.data,(n,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${r}`,cx:Xe.value.x,cy:n.y,r:X(Lt.value+2),fill:n.color,stroke:"none",opacity:"0.9"},null,8,Ar))),128))],8,Lr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),jt.value?(e.openBlock(),e.createElementBlock("g",Dr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dn.value,(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${r}`},[n?(e.openBlock(),e.createElementBlock("g",Hr,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:X(n.radius),fill:n.color,"fill-opacity":sl(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(To(n,r)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>wo(n,p),onMouseleave:p=>Go(n),onClick:p=>pl(n,p)},null,42,Rr),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-${r} ${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:El(n)}),onLoad:p=>Ko(r),onError:p=>_o(r),onMouseenter:p=>wo(n,p),onMouseleave:p=>Go(n),onClick:p=>pl(n,p)},null,46,Fr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),Sn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:Il.value},[ke.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Pt.value,cy:Rt.value,r:ct.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,zr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":ke.value,"clip-path":Yl.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kn.value,(n,r)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${n.originalIndex}-${r}`,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":Pl(n.originalIndex),class:e.normalizeClass({"dss-series-highlighted":n.segment.isHighlighted,"dss-series-dimmed":n.segment.isDimmed,"dss-series-hidden":n.segment.isHidden}),onMouseover:p=>ql(n.segment,p),onMouseleave:Sl},null,42,Or))),128))],8,Pr),B.value&&ta.value?(e.openBlock(),e.createElementBlock("g",qr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vn.value,(n,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${r}`,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,Wr)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),Te.value&&(ta.value||bl.value||Xl.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:at.value.x,y:at.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":pt.value,fill:rt.value,class:"dss-radial-data-center"},e.toDisplayString(vt.value),9,Zr)):e.createCommentVNode("",!0),ra.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Io.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fn.value,(n,r)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${r}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${r*.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,Ur),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,Xr),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":zn.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,Yr)],6))),128))],2)):e.createCommentVNode("",!0)],8,Ir)):e.createCommentVNode("",!0),wn.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:Il.value},[Ne.value?(e.openBlock(),e.createElementBlock("g",Kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,(n,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${r}`,cx:Pt.value,cy:Rt.value,r:X(n),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*150}ms`})},null,12,Gr))),128)),e.createElementVNode("g",Qr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,(n,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${r}`},[e.createElementVNode("rect",{x:Pt.value-16,y:Rt.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Jr),e.createElementVNode("text",{x:Pt.value,y:Rt.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(xt(r)),9,ei)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rl.value,(n,r)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${r}`,x1:Pt.value,x2:n.x,y1:Rt.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},null,12,ti))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",ni,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(el.value,(n,r)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${r}`,x:n.x+Math.cos(r*2*Math.PI/Dl.value-Math.PI/2)*16,y:n.y+Math.sin(r*2*Math.PI/Dl.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:`${r*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,li))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:ka,onMouseleave:Sl},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(aa.value,(n,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${r}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":ha("current",n,r),stroke:n.color,"stroke-width":n.isHighlighted?Pe.value+1:Pe.value,"stroke-dasharray":n.strokeDasharray||void 0,"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:`${r*j.value}ms`,transition:"all 0.2s ease"})},null,14,oi),n.pointRadius>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.dataPoints,(p,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${r}-${g}`,cx:p.x,cy:p.y,r:X(n.isHighlighted?n.pointRadius+1:n.pointRadius),fill:n.isComparison?"none":n.color,stroke:n.isComparison?n.color:"none","stroke-width":n.isComparison?2:0,class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${r*j.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>ql(p,C),onMouseleave:Sl},null,46,ai))),128)):e.createCommentVNode("",!0)]))),128))],32)],8,jr)):e.createCommentVNode("",!0),e.createElementVNode("g",si,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ro.value,(n,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${r}`,cx:n.x,cy:n.y,r:X(n.width/2),fill:f(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${r}`),style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,14,ri))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ro.value,(n,r)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${r}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:p=>Ca(r),onError:p=>ba(r),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${r}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,46,ii))),128))])],8,Rs))]),il.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:se.value+"px",backgroundImage:`url('${Xn.value}')`,backgroundRepeat:"no-repeat",...Rl.value,opacity:_n.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vl.value,(n,r)=>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:Vn.value+"px",height:Vn.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>y(n),["stop"]),onMouseenter:p=>Ho(n,p),onMouseleave:so},[e.createElementVNode("img",{src:cl(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,ui)],44,ci)),[[e.vShow,pn.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",di,e.toDisplayString(Rn.value.categoryValue),1),Rn.value.description?(e.openBlock(),e.createElementBlock("div",mi,e.toDisplayString(Rn.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Fe.value&&(gt.value.show||Ue.value&&Xe.value.show&&!ae.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Ue.value&&Xe.value.show&&!ae.value.isZooming,"dss-spider-tooltip":wn.value&>.value.spiderAreas&>.value.spiderAreas.length>0}]),style:e.normalizeStyle(wa.value)},[!Ue.value||!Xe.value.show||ae.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[wn.value&>.value.spiderAreas&>.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",pi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value.spiderAreas,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${r}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",fi,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createTextVNode(" "+e.toDisplayString(n.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.points,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${r}-${g}`,class:"dss-tooltip-series"},[e.createElementVNode("span",vi,e.toDisplayString(p.label),1),e.createElementVNode("span",gi,e.toDisplayString(p.value),1)]))),128))]))),128))])):jt.value&>.value.bubbleData&>.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",hi,[gt.value.title?(e.openBlock(),e.createElementBlock("div",yi,e.toDisplayString(gt.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ki,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value.bubbleData,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${r}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",Ci,[e.createElementVNode("div",bi,e.toDisplayString(gt.value.title),1),e.createElementVNode("div",wi,e.toDisplayString(gt.value.value),1)])),gt.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[An(gt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",xi,[a[5]||(a[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ei,e.toDisplayString(e.unref(_)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An(gt.value.categoryIndex).flagGroups,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${r}`},[e.createElementVNode("div",Si,[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,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${r}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Vi,[e.createElementVNode("div",Ni,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),An(gt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Bi,[a[6]||(a[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Mi,e.toDisplayString(e.unref(_)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An(gt.value.categoryIndex).markers,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${r}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",_i,[e.createElementVNode("div",$i,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Li,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",Ti,[e.createElementVNode("div",Ai,e.toDisplayString(jt.value?Do():L.categories[Xe.value.categoryIndex]||`Category ${Xe.value.categoryIndex+1}`),1),jt.value?(e.openBlock(),e.createElementBlock("div",Di,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value.data,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${r}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Xe.value.data,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${r}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Hi,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Ri,e.toDisplayString(tn(n.value)),1)]))),128))]),An(Xe.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Fi,[a[7]||(a[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ii,e.toDisplayString(e.unref(_)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An(Xe.value.categoryIndex).flagGroups,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${r}`},[e.createElementVNode("div",zi,[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,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${r}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Pi,[e.createElementVNode("div",Oi,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),An(Xe.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",qi,[a[8]||(a[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Wi,e.toDisplayString(e.unref(_)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An(Xe.value.categoryIndex).markers,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${r}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",Zi,[e.createElementVNode("div",Ui,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Xi,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),En.value&&Ge.value&&ae.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Jl},[a[9]||(a[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(ae.value.scale*100))+"% "+e.toDisplayString(e.unref(_)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Ss),q.value&&ge.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Be.value==="horizontal","dss-legend-vertical":Be.value==="vertical","dss-legend-bottom":!0}]),style:{display:"flex","flex-wrap":"wrap","justify-content":"center",padding:"6px 8px 0"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ft.value.has(r),"dss-legend-hovered":he.value===r,"dss-legend-dimmed":he.value!==null&&he.value!==r}]),onClick:p=>Qo(r),onMouseenter:p=>Gt(r),onMouseleave:Fl,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":wn.value&&qn(n)}]),style:e.normalizeStyle({backgroundColor:wn.value&&qn(n)?"transparent":xl(n,r),borderColor:xl(n,r)})},null,6),e.createElementVNode("span",ji,e.toDisplayString(n.name),1)],46,Yi))),128))],2)):e.createCommentVNode("",!0),ht.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:ht.value.x+"px",top:ht.value.y+"px"}),onClick:a[0]||(a[0]=e.withModifiers(()=>{},["stop"]))},[it.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:fo},e.toDisplayString(e.unref(_)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),it.value.addMarker&&(it.value.downloadSvg||it.value.downloadPng||it.value.downloadCsv||Dt.value.length>0)?(e.openBlock(),e.createElementBlock("div",Ki)):e.createCommentVNode("",!0),it.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:yn},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),it.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Fn},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),it.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:On},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Dt.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[it.value.downloadSvg||it.value.downloadPng||it.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Gi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt.value,(n,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+r},[n.separator?(e.openBlock(),e.createElementBlock("div",Qi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Bn(n)),style:e.normalizeStyle(Gl(n)),onClick:p=>Cl(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Bl(n),class:"dss-custom-menu-content"},null,8,ec)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",tc,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,Ji)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Ie.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:xn},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",nc,[e.createElementVNode("h3",null,e.toDisplayString(Nn.value?e.unref(_)("chart.modalMarker.viewMarker"):yl.value?e.unref(_)("chart.modalMarker.editMarker"):e.unref(_)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:xn},"×")]),e.createElementVNode("div",lc,[e.createElementVNode("div",oc,[e.createVNode(la,{id:"dss-marker-date",mode:"single",modelValue:Ie.value.date,"onUpdate:modelValue":a[1]||(a[1]=n=>Ie.value.date=n),"min-date":ol.value,"max-date":cn.value,disabled:Nn.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",ac,[e.createElementVNode("label",sc,e.toDisplayString(e.unref(_)("chart.modalMarker.description")),1),Nn.value?(e.openBlock(),e.createElementBlock("div",rc,e.toDisplayString(Ie.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":a[2]||(a[2]=n=>Ie.value.description=n),placeholder:e.unref(_)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,ic)),[[e.vModelText,Ie.value.description]])])]),e.createElementVNode("div",cc,[e.createElementVNode("div",uc,[yl.value&&!Nn.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:hn},e.toDisplayString(e.unref(_)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",dc,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:xn},e.toDisplayString(Nn.value?e.unref(_)("chart.modalMarker.close"):e.unref(_)("chart.modalMarker.cancel")),1),Nn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:ul,disabled:!(Ie.value.description&&Ie.value.description.length)},e.toDisplayString(yl.value?e.unref(_)("chart.modalMarker.save"):e.unref(_)("chart.contextMenu.addMarker")),9,mc))])])])])):e.createCommentVNode("",!0)],64))}}),vc={class:"dss-modal-title"},gc={class:"dss-modal-actions"},na={__name:"DSSModal",props:{showModal:{type:Boolean,required:!0},backDrop:{type:Boolean,default:!0},width:{type:String,default:"800px"},height:{type:String,default:"auto"},showCloseBtn:{type:Boolean,default:!0},headerType:{type:String,default:"space-between"},titleSize:{type:String,default:"24px"}},emits:["close-modal"],setup(L,{emit:ne}){const _=L,D=ne,ce=e.ref(null),z=e.ref(null),M=e.computed(()=>{const Y={"max-width":_.width};return _.height!=="auto"&&(Y.height=_.height,Y["min-height"]="0"),Y}),fe=e.computed(()=>({}));function mt(){D("close-modal")}function J(){_.backDrop&&!ce.value&&D("close-modal")}function v(Y){Y.target.tagName==="INPUT"&&(ce.value=Y.target.tagName)}function we(){setTimeout(()=>{ce.value=null},300)}function Ce(){const Y=document.body,me=document.documentElement;z.value={bodyOverflow:Y.style.overflow,bodyPosition:Y.style.position,bodyTop:Y.style.top,bodyWidth:Y.style.width,htmlOverflow:me.style.overflow,scrollY:window.scrollY},Y.style.overflow="hidden",Y.style.position="fixed",Y.style.top=`-${z.value.scrollY}px`,Y.style.width="100%",Y.style.left="0",me.style.overflow="hidden"}function Q(){if(!z.value)return;const Y=document.body,me=document.documentElement,{bodyOverflow:F,bodyPosition:Ee,bodyTop:Ae,bodyWidth:tt,htmlOverflow:ft,scrollY:Z}=z.value;Y.style.overflow=F||"",Y.style.position=Ee||"",Y.style.top=Ae||"",Y.style.width=tt||"",Y.style.left="",me.style.overflow=ft||"",window.scrollTo(0,Z||0)}return e.watch(()=>_.showModal,Y=>{if(Y)Ce(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const me=document.getElementById("dss-modal-backdrop");me&&(me.addEventListener("focusin",v),me.addEventListener("focusout",we))},100);else{Q(),document.body.classList.remove("dss-modal-open");const me=document.getElementById("dss-modal-backdrop");me&&(me.removeEventListener("focusin",v),me.removeEventListener("focusout",we))}},{immediate:!0}),e.onUnmounted(()=>{_.showModal&&Q()}),(Y,me)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:J},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(M.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:me[0]||(me[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":L.headerType,"font-size":L.titleSize})},[e.createElementVNode("h1",vc,[e.renderSlot(Y.$slots,"title",{},()=>[me[1]||(me[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(Y.$slots,"title-data"),L.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:mt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(fe.value)},[e.renderSlot(Y.$slots,"content",{},()=>[me[2]||(me[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",gc,[e.renderSlot(Y.$slots,"actions")])])],4),[[e.vShow,L.showModal]])])):e.createCommentVNode("",!0)]))}},hc={key:0,class:"dss-table-toolbar"},yc={class:"dss-table-toolbar-left"},kc=["aria-expanded"],Cc={class:"dss-pagination-select-dropdown",role:"listbox"},bc={class:"dss-table-column-visibility-label"},wc={class:"dss-table-checkbox-wrapper"},xc=["checked","onChange"],Ec={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Sc={class:"dss-table-column-visibility-text"},Vc={class:"dss-table-toolbar-right"},Nc=["placeholder","aria-label"],Bc=["aria-label"],Mc=["aria-label","aria-expanded"],_c={key:1,class:"dss-table-toolbar-extra"},$c={class:"dss-table-thead"},Lc={key:0,class:"dss-table-th dss-table-selection-column"},Tc={key:0,class:"dss-table-checkbox-wrapper"},Ac=["checked","indeterminate"],Dc={key:0,class:"dss-table-checkbox__indeterminate"},Hc={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Rc=["aria-label"],Fc=["onClick"],Ic={class:"dss-table-th-content"},zc={class:"dss-table-th-text"},Pc={key:0},Oc={key:1},qc={key:2},Wc=["data-filter-column-key","aria-expanded","aria-label","onClick"],Zc={class:"dss-table-tbody"},Uc=["onClick"],Xc={class:"dss-table-checkbox-wrapper"},Yc=["type","name","checked","disabled","onChange"],jc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Kc={key:1,class:"dss-table-checkbox__dot"},Gc=["onClick"],Qc=["aria-expanded","aria-label"],Jc={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},eu={key:0,class:"dss-table-expansion-row"},tu=["colspan"],nu=["colspan"],lu={key:1,class:"dss-table-pagination"},ou={class:"dss-table-pagination-left"},au={key:0},su={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},ru={class:"dss-table-pagination-center"},iu={key:0,class:"dss-pagination-controls"},cu=["disabled","title"],uu=["disabled","title"],du=["aria-label","onKeydown"],mu={class:"dss-pagination-of"},pu=["disabled","title"],fu=["disabled","title"],vu={class:"dss-table-pagination-right"},gu={class:"dss-pagination-rows-label"},hu=["aria-expanded"],yu=["aria-selected","onClick"],ku={key:0,class:"dss-table-filter-row"},Cu=["value","placeholder"],bu=["min","max","value"],wu=["min","max","value"],xu={class:"dss-table-filter-double-range-values"},Eu={key:2,class:"dss-table-filter-daterange"},Su={class:"dss-table-filter-daterange-row"},Vu={class:"dss-table-filter-daterange-label"},Nu=["value"],Bu={class:"dss-table-filter-daterange-row"},Mu={class:"dss-table-filter-daterange-label"},_u=["value"],$u=["value","placeholder"],Lu={class:"dss-table-filter-list"},Tu=["checked","onChange"],Au={class:"dss-table-filter-actions"},Du={name:"DSSTable"},Hu=Object.assign(Du,{props:{data:{type:Array,required:!0,default:()=>[]},columns:{type:Array,required:!0,default:()=>[]},tableId:{type:String,default:()=>"table-"+Math.random().toString(36).substring(2,9)},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:L=>typeof L=="object"&&L!==null},columnVisibility:{type:Array,default:null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search","update:columnVisibility"],setup(L,{emit:ne}){const{t:_,locale:D}=co.useI18n(),ce=L,z=ne,M={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,expandableRowData:null,expandableRowCondition:null,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single",rowCondition:null},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100],showCounter:!0,showControlsGroup:!0,showControls:!0,showRowsPerPage:!0},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:null};function fe(y,h){const x=Object.assign({},y);return mt(y)&&mt(h)&&Object.keys(h).forEach(W=>{mt(h[W])?W in y?x[W]=fe(y[W],h[W]):Object.assign(x,{[W]:h[W]}):Object.assign(x,{[W]:h[W]})}),x}function mt(y){return y&&typeof y=="object"&&!Array.isArray(y)}const J=e.computed(()=>fe(M,ce.options)),v=e.computed(()=>{const y=J.value.table.width;return y==="auto"?null:typeof y=="number"?y:null}),we=e.computed(()=>J.value.table.height),Ce=e.computed(()=>J.value.table.rowHeight??"auto"),Q=e.computed(()=>({height:Ce.value})),Y=e.computed(()=>J.value.table.expandable===!0),me=e.computed(()=>J.value.table.expandableRowData??null),F=e.computed(()=>J.value.table.expandableRowCondition??null),Ee=e.computed(()=>J.value.table.truncated===!0),Ae=e.computed(()=>J.value.table.striped),tt=e.computed(()=>J.value.table.bordered),ft=e.computed(()=>J.value.table.hoverable),Z=e.computed(()=>J.value.table.size),De=e.computed(()=>J.value.table.align||"left");e.computed(()=>J.value.title.text),e.computed(()=>J.value.subtitle.text);const We=e.computed(()=>J.value.selection.enabled),xe=e.computed(()=>J.value.selection.mode),_e=e.computed(()=>J.value.selection.rowCondition??null),je=e.computed(()=>J.value.sorting.enabled),se=e.computed(()=>J.value.sorting.mode),et=e.computed(()=>J.value.pagination.enabled),ke=e.computed(()=>J.value.pagination.rows),nt=e.computed(()=>J.value.pagination.rowsPerPageOptions),ut=e.computed(()=>J.value.pagination.showCounter!==!1),st=e.computed(()=>J.value.pagination.showControlsGroup),Vt=e.computed(()=>st.value===!1?!1:J.value.pagination.showControls!==!1),zt=e.computed(()=>st.value===!1?!1:J.value.pagination.showRowsPerPage!==!1),Ht=e.computed(()=>et.value&&(ut.value||Vt.value||zt.value)),Nt=e.computed(()=>J.value.scrollable),bt=e.computed(()=>J.value.emptyMessage||_("table.emptyMessage")),Jt=e.computed(()=>J.value.toolbar?.downloads?.pdf!==!1),dt=e.computed(()=>J.value.toolbar?.downloads?.excel!==!1),en=e.computed(()=>J.value.toolbar?.search!==!1),Ct=e.computed(()=>Jt.value||dt.value||en.value||ee.value),ee=e.computed(()=>J.value.toolbar?.columnVisibility!==!1),ve=e.ref(""),Ne=e.ref(!1),q=e.ref(null);let ge=null;function Be(){Ne.value?(ge&&(clearTimeout(ge),ge=null),Ne.value=!1,ve.value="",z("search",""),q.value?.blur()):(Ne.value=!0,ge=setTimeout(()=>{ge=null,q.value?.focus()},80))}function Fe(){ve.value||(Ne.value=!1)}function Ue(){ve.value="",z("search",""),q.value?.focus()}const wt=e.computed(()=>({"dss-table-striped":Ae.value,"dss-table-bordered":tt.value,"dss-table-hoverable":ft.value,[`dss-table-${Z.value}`]:Z.value!=="default","dss-table-truncated":Ee.value})),Ge=(y,h)=>y?.field??y?.key??h,Xt=e.ref(new Set);function Ze(){const y=new Set;return ce.columns.forEach((h,x)=>{h?.hidden!==!0&&y.add(Ge(h,x))}),y}function Pe(){const y=new Set;return ce.columns.forEach((h,x)=>{y.add(Ge(h,x))}),y}function Tt(y){if(!Array.isArray(y))return null;const h=Pe(),x=[];return y.forEach(W=>{h.has(W)&&x.push(W)}),x}function Lt(){Xt.value=Ze()}const le=e.computed(()=>{const y=Tt(ce.columnVisibility);return y===null?null:new Set(y)}),U=e.computed(()=>le.value??Xt.value),X=e.computed(()=>ce.columns.filter((y,h)=>U.value.has(Ge(y,h)))),ie=y=>{const h=ce.columns.findIndex(x=>x===y);return Ge(y,h>=0?h:0)},ye=(y,h)=>U.value.has(Ge(y,h));function Ke(y){z("update:columnVisibility",Array.from(y))}function At(y,h){const x=Ge(y,h),W=new Set(U.value);W.has(x)?W.delete(x):W.add(x),le.value===null&&(Xt.value=W),Ke(W)}const Yt=e.ref(null),lt=e.ref(!1);function sn(y){Yt.value&&!Yt.value.contains(y.target)&&(lt.value=!1)}const S=e.computed(()=>X.value.length+(We.value?1:0)+(Y.value?1:0)),b=(y,h)=>y?.id??y?.key??h,V=e.ref(new Set),j=e.ref(null),oe=(y,h)=>V.value.has(b(y,h)),He=(y,h)=>{if(!Y.value)return!1;if(typeof F.value=="function")return!!F.value(y,h);if(typeof me.value=="string"&&me.value.trim()){const x=xn(y,me.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},kt=(y,h,x)=>{if(x&&x.stopPropagation(),!He(y,h))return;const W=b(y,h),ue=new Set(V.value);ue.has(W)?(ue.delete(W),z("row-collapse",{data:y,index:h})):(ue.add(W),z("row-expand",{data:y,index:h})),V.value=ue},ot=(y,h)=>{if(!Ee.value)return;const x=b(y,h);j.value!==x&&(j.value=x)},ze=e.ref(null),xt=e.ref(0),Mt=e.ref([]),Et=y=>{if(se.value==="single")return ze.value===y.field?xt.value:0;{const h=Mt.value.find(x=>x.field===y.field);return h?h.order:0}},it=y=>{const h=Et(y);return{"dss-sort-active":h!==0,"dss-sort-asc":h===1,"dss-sort-desc":h===-1}},Dt=e.ref({}),Bt=e.ref(null),rn=e.ref(null),Vn=220,Zn=e.ref(null),tn=e.computed(()=>X.value.find(y=>ie(y)===Bt.value)??null),pn=e.computed(()=>{if(!tn.value||tn.value.filter!=="range")return null;const y=tn.value,h=Bt.value,{min:x,max:W}=Nl(y),ue=y.filterMin??x,Qe=y.filterMax??W,Wt=_n(h),yn=Wt.min??ue,Fn=Wt.max??Qe,On=Qe-ue,Cl=On===0?0:(yn-ue)/On*100,fo=On===0?100:(Fn-ue)/On*100;return{rangeMin:ue,rangeMax:Qe,currentMin:yn,currentMax:Fn,minPct:Cl,maxPct:fo}}),ll=e.ref(null),vl=e.ref("max");function il(y){const h=ll.value,x=pn.value;if(!h||!x)return;const W=h.getBoundingClientRect(),Qe=(y.clientX-W.left)/W.width*100,Wt=(x.minPct+x.maxPct)/2;vl.value=Qe<Wt?"min":"max"}function _n(y){return Dt.value[y]??{}}function gl(y,h){Dt.value={...Dt.value,[y]:h}}function $n(y){const h=Dt.value[y];return h?h.type==="string"?!!h.value?.trim():h.type==="range"?h.min!=null||h.max!=null:h.type==="dateRange"?!!(h.from||h.to):h.type==="list"?h.selected?.length>0:!1:!1}function Vl(y){const h={...Dt.value};delete h[y],Dt.value=h,Bt.value=null,rn.value=null}function Rl(){if(!Bt.value){rn.value=null;return}const y=Zn.value;if(!y)return;const h=y.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Bt.value}"]`);if(!h)return;const x=h.getBoundingClientRect();rn.value={top:x.bottom+6,left:Math.max(8,x.right-Vn)}}const hl=e.computed(()=>{const y=String(ve.value??"").trim().toLowerCase();return y?ce.data.filter(h=>X.value.some(x=>Un(ul(h,x)).some(ue=>String(ue).toLowerCase().includes(y)))):ce.data}),An=e.computed(()=>{let y=[...hl.value];const h=(ve.value??"").trim().toLowerCase();return h&&(y=y.filter(x=>ce.columns.some(W=>{if(!W||!W.field)return!1;const ue=ul(x,W);return String(ue??"").toLowerCase().includes(h)}))),X.value.forEach(x=>{const W=ie(x),ue=Dt.value[W];if(!ue)return;const Qe=x.field;if(Qe){if(ue.type==="string"&&ue.value?.trim()){const Wt=ue.value.trim().toLowerCase();y=y.filter(yn=>{const Fn=ul(yn,x);return String(Fn??"").toLowerCase().includes(Wt)})}else if(ue.type==="range")y=y.filter(Wt=>{const yn=xn(Wt,Qe),Fn=Number(yn);return!(Number.isNaN(Fn)||ue.min!=null&&Fn<ue.min||ue.max!=null&&Fn>ue.max)});else if(ue.type==="dateRange"){const Wt=ue.from?new Date(ue.from).getTime():null,yn=ue.to?new Date(ue.to).getTime():null;y=y.filter(Fn=>{const On=xn(Fn,Qe),Cl=On?new Date(On).getTime():NaN;return!(Number.isNaN(Cl)||Wt!=null&&Cl<Wt||yn!=null&&Cl>yn)})}else if(ue.type==="list"&&ue.selected?.length){const Wt=new Set(ue.selected);y=y.filter(yn=>Un(ul(yn,x)).some(On=>Wt.has(On)))}}}),y});function Un(y){if(y==null)return[""];if(Array.isArray(y))return y.flatMap(Un);if(typeof y=="object"){const h=y?.label??y?.name??y?.value??y?.title;return[h!=null?String(h):String(y)]}return[String(y)]}function Xn(y){const h=new Set;return ce.data.forEach(x=>{Un(ul(x,y)).forEach(ue=>h.add(ue))}),Array.from(h).sort((x,W)=>String(x).localeCompare(String(W)))}function Hn(y,h){if(Bt.value===y){Bt.value=null,rn.value=null;return}if(Bt.value=y,h?.currentTarget){const x=h.currentTarget.getBoundingClientRect();rn.value={top:x.bottom+6,left:Math.max(8,x.right-Vn)}}else Rl()}function zn(y,h){gl(y,{type:"string",value:h})}function Nl(y){const h=y.field;if(!h)return{min:0,max:100};let x=1/0,W=-1/0;return ce.data.forEach(ue=>{const Qe=xn(ue,h),Wt=Number(Qe);Number.isNaN(Wt)||(x=Math.min(x,Wt),W=Math.max(W,Wt))}),{min:x===1/0?0:x,max:W===-1/0?100:W}}function T(y,h,x){const W={..._n(y),type:"range"},ue=x===""?null:Number(x),Qe=ue===null||Number.isNaN(ue)?null:ue;W[h]=Qe,Qe!=null&&(h==="min"&&W.max!=null&&Qe>W.max&&(W.max=Qe),h==="max"&&W.min!=null&&Qe<W.min&&(W.min=Qe)),gl(y,W)}function I(y,h,x){const W={..._n(y),type:"dateRange"};W[h]=x||"",gl(y,W)}const B=e.reactive({});function te(y,h){B[y]=h}function Te(y){const h=ie(y),x=(B[h]??"").trim().toLowerCase(),W=Xn(y);return x?W.filter(ue=>String(ue).toLowerCase().includes(x)):W}function vt(y,h){return(_n(y).selected??[]).includes(h!=null?String(h):"")}function pt(y,h){const W=[..._n(y).selected??[]],ue=h!=null?String(h):"",Qe=W.indexOf(ue);Qe>=0?W.splice(Qe,1):W.push(ue),gl(y,{type:"list",selected:W})}function at(y){Bt.value&&!y.target.closest(".dss-table-filter-wrap")&&!y.target.closest(".dss-table-filter-dropdown")&&(Bt.value=null,rn.value=null)}function rt(){Rl(),Kt.value&&Xe()}const vn=y=>{if(!(y.sortable===!1||!je.value))if(se.value==="single")ze.value===y.field?xt.value=xt.value===1?-1:xt.value===-1?0:1:(ze.value=y.field,xt.value=1),xt.value===0&&(ze.value=null),z("sort",{field:ze.value,order:xt.value});else{const h=Mt.value.findIndex(x=>x.field===y.field);h>=0?Mt.value[h].order===1?Mt.value[h].order=-1:Mt.value.splice(h,1):Mt.value.push({field:y.field,order:1}),z("sort",{multiSortMeta:Mt.value})}},bn=e.computed(()=>{if(!je.value)return An.value;let y=[...An.value];return se.value==="single"&&ze.value&&xt.value!==0?y.sort((h,x)=>{const W=xn(h,ze.value),ue=xn(x,ze.value);return W===ue?0:W==null?1:ue==null?-1:(W<ue?-1:W>ue?1:0)*xt.value}):se.value==="multiple"&&Mt.value.length>0&&y.sort((h,x)=>{for(const W of Mt.value){const ue=xn(h,W.field),Qe=xn(x,W.field);if(ue===Qe)continue;if(ue==null)return 1;if(Qe==null)return-1;const Wt=ue<Qe?-1:ue>Qe?1:0;if(Wt!==0)return Wt*W.order}return 0}),y}),qt=e.ref(0),gn=e.ref(ke.value),Kt=e.ref(!1),Ln=e.ref(null),Ft=e.ref(null),he=e.ref("bottom"),_t=e.ref(null),gt=y=>{gn.value=y,Kt.value=!1,qt.value=0,z("page",{page:0,rows:gn.value})};function Rn(y){Ln.value&&!Ln.value.contains(y.target)&&(Kt.value=!1)}function Xe(){const y=Ln.value,h=Ft.value;if(!y||!h)return;const x=y.querySelector(".dss-pagination-select-dropdown");if(!x)return;const W=h.getBoundingClientRect(),ue=x.offsetHeight||0,Wt=(window.innerHeight||document.documentElement.clientHeight)-W.bottom,yn=W.top;he.value=Wt<ue+8&&yn>Wt?"top":"bottom",_t.value={width:`${Math.ceil(W.width)}px`,left:`${Math.max(0,Math.round(h.offsetLeft))}px`}}const ht=e.computed(()=>bn.value.length),ae=e.computed(()=>Math.ceil(ht.value/gn.value)),on=e.computed(()=>Math.max(ae.value,1)),Ie=e.computed(()=>ht.value===0?0:cn.value+1),ol=e.computed(()=>yl.value),cn=e.computed(()=>et.value?qt.value*gn.value:0),yl=e.computed(()=>et.value?Math.min((qt.value+1)*gn.value,ht.value):ht.value),Nn=e.computed(()=>{if(!et.value)return bn.value;const y=cn.value,h=yl.value;return bn.value.slice(y,h)}),Gt=e.ref(new Set),Fl=e.computed(()=>bn.value.filter((y,h)=>Gt.value.has(b(y,h)))),un=(y,h)=>{const x=_e.value;return typeof x!="function"?!0:!!x(y,h)},Pn=e.computed(()=>bn.value.map((y,h)=>({row:y,index:h})).filter(({row:y,index:h})=>un(y,h))),Zl=e.computed(()=>{const y=Pn.value;return y.length===0?!1:y.every(({row:h,index:x})=>Gt.value.has(b(h,x)))}),Yn=e.computed(()=>{const y=Pn.value;if(y.length===0)return!1;const h=y.filter(({row:x,index:W})=>Gt.value.has(b(x,W))).length;return h>0&&h<y.length}),Bl=(y,h)=>Gt.value.has(b(y,h)),Bn=()=>{if(Zl.value)Gt.value=new Set,z("unselect-all");else{const y=new Set;Pn.value.forEach(({row:h,index:x})=>y.add(b(h,x))),Gt.value=y,z("select-all",Fl.value)}},Gl=(y,h)=>{if(!un(y,h))return;const x=b(y,h),W=new Set(Gt.value),ue=W.has(x);xe.value==="single"?ue?(W.delete(x),z("row-unselect",y)):(W.clear(),W.add(x),z("row-select",y)):ue?(W.delete(x),z("row-unselect",y)):(W.add(x),z("row-select",y)),Gt.value=W},cl=e.ref("1"),Ul=()=>{const y=Number.parseInt(String(cl.value),10);if(!Number.isFinite(y)){cl.value=String(qt.value+1);return}const h=Math.min(on.value,Math.max(1,y));h!==qt.value+1?kl(h-1):cl.value=String(h)},kl=y=>{y<0||y>=ae.value||(qt.value=y,z("page",{page:y,rows:gn.value}))},Ql=(y,h,x)=>{z("row-click",{data:y,index:h,originalEvent:x}),ot(y,cn.value+h)},Mn=(y,h)=>{const x=cn.value+h;return{"dss-table-row-selected":Bl(y,x),"dss-table-row-even":h%2===0,"dss-table-row-odd":h%2!==0,"dss-table-row-truncated-clickable":Ee.value,"dss-table-row-truncated-expanded":j.value===b(y,x)}},ul=(y,h)=>h.field?xn(y,h.field):"",xn=(y,h)=>h.split(".").reduce((x,W)=>x&&x[W],y),hn=y=>{const h=y.align??De.value;return{"dss-table-sortable":y.sortable!==!1&&je.value,"dss-table-align-left":h==="left","dss-table-align-center":h==="center","dss-table-align-right":h==="right",[y.className]:y.className}},jn=y=>{const h={};return y.width&&(h.width=typeof y.width=="number"?`${y.width}px`:y.width),y.minWidth&&(h.minWidth=typeof y.minWidth=="number"?`${y.minWidth}px`:y.minWidth),y.maxWidth&&(h.maxWidth=typeof y.maxWidth=="number"?`${y.maxWidth}px`:y.maxWidth),h};return e.watch(()=>ce.locale,y=>{y&&y!==D.value&&(D.value=y)},{immediate:!0}),e.watch(ke,y=>{gn.value=y,qt.value=0}),e.watch(Kt,async y=>{y&&(await e.nextTick(),Xe())}),e.watch(qt,y=>{cl.value=String(y+1)},{immediate:!0}),e.watch(ve,y=>{z("search",y??"")}),e.watch(()=>ce.columns,()=>{if(le.value===null){Lt();return}const y=Tt(ce.columnVisibility)??[];y.length!==ce.columnVisibility.length&&z("update:columnVisibility",y)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Rn),document.addEventListener("click",sn),document.addEventListener("click",at),window.addEventListener("resize",rt),window.addEventListener("scroll",rt,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Rn),document.removeEventListener("click",sn),document.removeEventListener("click",at),window.removeEventListener("resize",rt),window.removeEventListener("scroll",rt,!0)}),(y,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Zn,style:e.normalizeStyle({width:v.value+"px",height:we.value?we.value+"px":"auto"})},[Ct.value?(e.openBlock(),e.createElementBlock("div",hc,[e.createElementVNode("div",yc,[Jt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:h[0]||(h[0]=x=>z("download-pdf"))},[h[22]||(h[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(_)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),dt.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:h[1]||(h[1]=x=>z("download-excel"))},[h[23]||(h[23]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(_)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),ee.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:Yt},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":lt.value}]),onClick:h[2]||(h[2]=x=>lt.value=!lt.value),"aria-expanded":lt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(_)("table.columnVisibility"))+" ",1),h[24]||(h[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,kc),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Cc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.columns,(x,W)=>(e.openBlock(),e.createElementBlock("li",{key:Ge(x,W),role:"option",class:"dss-table-column-visibility-option",onClick:h[3]||(h[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",bc,[e.createElementVNode("span",wc,[e.createElementVNode("input",{type:"checkbox",checked:ye(x,W),onChange:ue=>At(x,W),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,xc),ye(x,W)?(e.openBlock(),e.createElementBlock("span",Ec,[...h[25]||(h[25]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",Sc,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,lt.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(y.$slots,"header")]),e.createElementVNode("div",Vc,[en.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Ne.value||ve.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:q,"onUpdate:modelValue":h[4]||(h[4]=x=>ve.value=x),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(_)("table.searchPlaceholder"),"aria-label":e.unref(_)("table.searchTableAriaLabel"),onFocus:h[5]||(h[5]=x=>Ne.value=!0),onBlur:Fe},null,40,Nc),[[e.vModelText,ve.value]]),ve.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(_)("table.clearSearchAriaLabel"),onClick:Ue},[...h[26]||(h[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,Bc)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(_)("table.searchAriaLabel"),"aria-expanded":Ne.value||!!ve.value,onMousedown:e.withModifiers(Be,["prevent"])},[...h[27]||(h[27]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,Mc)],2)):e.createCommentVNode("",!0),y.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",_c,[e.renderSlot(y.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":Nt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",wt.value])},[e.createElementVNode("thead",$c,[e.createElementVNode("tr",null,[We.value?(e.openBlock(),e.createElementBlock("th",Lc,[xe.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Tc,[e.createElementVNode("input",{type:"checkbox",checked:Zl.value,indeterminate:Yn.value,onChange:Bn,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ac),Yn.value?(e.openBlock(),e.createElementBlock("span",Dc)):Zl.value?(e.openBlock(),e.createElementBlock("span",Hc,[...h[28]||(h[28]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Y.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(_)("table.expandRowAriaLabel")},null,8,Rc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,(x,W)=>(e.openBlock(),e.createElementBlock("th",{key:ie(x),class:e.normalizeClass(["dss-table-th",hn(x)]),style:e.normalizeStyle(jn(x)),onClick:ue=>vn(x)},[e.createElementVNode("div",Ic,[e.createElementVNode("span",zc,e.toDisplayString(x.header),1),x.sortable!==!1&&je.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",it(x)])},[Et(x)===0?(e.openBlock(),e.createElementBlock("span",Pc,[...h[29]||(h[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):Et(x)===1?(e.openBlock(),e.createElementBlock("span",Oc,[...h[30]||(h[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):Et(x)===-1?(e.openBlock(),e.createElementBlock("span",qc,[...h[31]||(h[31]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),x.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Bt.value===ie(x)}]),onClick:h[6]||(h[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":$n(ie(x))}]),"data-filter-column-key":ie(x),"aria-expanded":Bt.value===ie(x),"aria-label":e.unref(_)("table.filterColumnAriaLabel"),onClick:ue=>Hn(ie(x),ue)},[...h[32]||(h[32]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,Wc)],2)):e.createCommentVNode("",!0)])],14,Fc))),128))])]),e.createElementVNode("tbody",Zc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nn.value,(x,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:b(x,cn.value+W)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Mn(x,W)]),style:e.normalizeStyle(Q.value),onClick:ue=>Ql(x,W,ue)},[We.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:h[7]||(h[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",Xc,[e.createElementVNode("input",{type:xe.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${L.tableId}`,checked:Bl(x,cn.value+W),disabled:!un(x,cn.value+W),onChange:ue=>Gl(x,cn.value+W),class:e.normalizeClass(["dss-table-checkbox",xe.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!un(x,cn.value+W)}])},null,42,Yc),xe.value==="multiple"&&Bl(x,cn.value+W)?(e.openBlock(),e.createElementBlock("span",jc,[...h[33]||(h[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):xe.value==="single"&&Bl(x,cn.value+W)?(e.openBlock(),e.createElementBlock("span",Kc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),Y.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(ue=>kt(x,cn.value+W,ue),["stop"])},[He(x,cn.value+W)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":oe(x,cn.value+W),"aria-label":oe(x,cn.value+W)?e.unref(_)("table.collapseRowAriaLabel"):e.unref(_)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":oe(x,cn.value+W)}]),"aria-hidden":"true"},[...h[34]||(h[34]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,Qc)):(e.openBlock(),e.createElementBlock("span",Jc))],8,Gc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,(ue,Qe)=>(e.openBlock(),e.createElementBlock("td",{key:ie(ue),class:e.normalizeClass(["dss-table-td",hn(ue)]),style:e.normalizeStyle(jn(ue))},[e.renderSlot(y.$slots,`cell-${ue.field}`,{data:x,column:ue,rowIndex:W,isExpanded:j.value===b(x,cn.value+W)},()=>[e.createTextVNode(e.toDisplayString(ul(x,ue)),1)])],6))),128))],14,Uc),Y.value&&He(x,cn.value+W)&&oe(x,cn.value+W)?(e.openBlock(),e.createElementBlock("tr",eu,[e.createElementVNode("td",{colspan:S.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(y.$slots,"expansion",{data:x,rowIndex:W})],8,tu)])):e.createCommentVNode("",!0)],64))),128)),Nn.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(Q.value)},[e.createElementVNode("td",{colspan:S.value,class:"dss-table-empty-cell"},[e.renderSlot(y.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(bt.value),1)])],8,nu)],4))])],2)],2),Ht.value?(e.openBlock(),e.createElementBlock("div",lu,[e.createElementVNode("div",ou,[ut.value?(e.openBlock(),e.createElementBlock("span",au,e.toDisplayString(e.unref(_)("table.showingRange",{start:Ie.value,end:ol.value,total:ht.value})),1)):(e.openBlock(),e.createElementBlock("span",su," "))]),e.createElementVNode("div",ru,[Vt.value?(e.openBlock(),e.createElementBlock("div",iu,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:qt.value===0,onClick:h[8]||(h[8]=x=>kl(0)),title:e.unref(_)("table.firstPage")},[...h[35]||(h[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,cu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:qt.value===0,onClick:h[9]||(h[9]=x=>kl(qt.value-1)),title:e.unref(_)("table.previousPage")}," ‹ ",8,uu),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[10]||(h[10]=x=>cl.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(_)("table.currentPageAriaLabel"),onBlur:Ul,onKeydown:e.withKeys(e.withModifiers(Ul,["prevent"]),["enter"])},null,40,du),[[e.vModelText,cl.value]]),e.createElementVNode("span",mu,e.toDisplayString(e.unref(_)("table.ofPages",{total:on.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:qt.value>=ae.value-1,onClick:h[11]||(h[11]=x=>kl(qt.value+1)),title:e.unref(_)("table.nextPage")}," › ",8,pu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:qt.value>=ae.value-1,onClick:h[12]||(h[12]=x=>kl(ae.value-1)),title:e.unref(_)("table.lastPage")},[...h[36]||(h[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,fu)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",vu,[zt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Ln},[e.createElementVNode("span",gu,e.toDisplayString(e.unref(_)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Kt.value}]),onClick:h[13]||(h[13]=x=>Kt.value=!Kt.value),"aria-expanded":Kt.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:Ft},[e.createTextVNode(e.toDisplayString(gn.value)+" ",1),h[37]||(h[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,hu),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",{class:e.normalizeClass(["dss-pagination-select-dropdown",{"dss-pagination-select-dropdown--top":he.value==="top"}]),style:e.normalizeStyle(_t.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nt.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===gn.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===gn.value}]),onClick:W=>gt(x)},e.toDisplayString(x),11,yu))),128))],6),[[e.vShow,Kt.value]])]),_:1})],512)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],4),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"dss-table-filter-dropdown dss-table-filter-dropdown--teleport",style:e.normalizeStyle(rn.value?{top:rn.value.top+"px",left:rn.value.left+"px",width:Vn+"px"}:void 0),onClick:h[21]||(h[21]=e.withModifiers(()=>{},["stop"]))},[tn.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[tn.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",ku,[e.createElementVNode("input",{type:"text",value:_n(Bt.value).value??"",onInput:h[14]||(h[14]=x=>zn(Bt.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(_)("table.search")},null,40,Cu)])):tn.value.filter==="range"&&pn.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":pn.value.minPct+"%","--range-max-pct":pn.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:ll,class:"dss-table-filter-double-range-track",onMousemove:il,onMouseenter:il},[e.createElementVNode("input",{type:"range",min:pn.value.rangeMin,max:pn.value.rangeMax,value:pn.value.currentMin,onInput:h[15]||(h[15]=x=>T(Bt.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:vl.value==="min"?2:1})},null,44,bu),e.createElementVNode("input",{type:"range",min:pn.value.rangeMin,max:pn.value.rangeMax,value:pn.value.currentMax,onInput:h[16]||(h[16]=x=>T(Bt.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:vl.value==="max"?2:1})},null,44,wu)],544),e.createElementVNode("div",xu,e.toDisplayString(pn.value.currentMin)+" – "+e.toDisplayString(pn.value.currentMax),1)],4)):tn.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Eu,[e.createElementVNode("div",Su,[e.createElementVNode("label",Vu,e.toDisplayString(e.unref(_)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:_n(Bt.value).from??"",onInput:h[17]||(h[17]=x=>I(Bt.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Nu)]),e.createElementVNode("div",Bu,[e.createElementVNode("label",Mu,e.toDisplayString(e.unref(_)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:_n(Bt.value).to??"",onInput:h[18]||(h[18]=x=>I(Bt.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,_u)])])):tn.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:B[Bt.value]??"",onInput:h[19]||(h[19]=x=>te(Bt.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(_)("table.search")},null,40,$u),e.createElementVNode("div",Lu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te(tn.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:vt(Bt.value,x),onChange:W=>pt(Bt.value,x)},null,40,Tu),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Au,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:h[20]||(h[20]=x=>Vl(Bt.value))},e.toDisplayString(e.unref(_)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Bt.value&&tn.value&&rn.value]])]),_:1})]))],64))}}),Ru="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M6.008%2014V12.68H8.288V6.572L5.996%208.276V6.692L8.012%205.24H9.788V12.68H11.624V14H6.008Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Fu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M5.948%2014V12.548L8.684%209.8C9.068%209.408%209.352%209.056%209.536%208.744C9.72%208.424%209.812%208.096%209.812%207.76C9.812%207.352%209.7%207.036%209.476%206.812C9.252%206.58%208.948%206.464%208.564%206.464C8.14%206.464%207.808%206.588%207.568%206.836C7.328%207.076%207.208%207.412%207.208%207.844H5.708C5.716%207.284%205.836%206.804%206.068%206.404C6.308%205.996%206.644%205.68%207.076%205.456C7.508%205.232%208.012%205.12%208.588%205.12C9.14%205.12%209.62%205.224%2010.028%205.432C10.436%205.64%2010.752%205.932%2010.976%206.308C11.2%206.684%2011.312%207.132%2011.312%207.652C11.312%208.188%2011.172%208.712%2010.892%209.224C10.62%209.728%2010.18%2010.272%209.572%2010.856L7.748%2012.644H11.42V14H5.948Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Iu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.516%2014.12C7.948%2014.12%207.452%2014.016%207.028%2013.808C6.612%2013.6%206.288%2013.308%206.056%2012.932C5.824%2012.556%205.708%2012.112%205.708%2011.6H7.22C7.22%2011.992%207.332%2012.3%207.556%2012.524C7.788%2012.74%208.112%2012.848%208.528%2012.848C8.944%2012.848%209.264%2012.736%209.488%2012.512C9.712%2012.288%209.824%2011.984%209.824%2011.6V10.916C9.824%2010.524%209.712%2010.22%209.488%2010.004C9.264%209.78%208.944%209.668%208.528%209.668H7.544V8.312L9.476%206.524H6.104V5.24H11V6.596L8.528%208.864V8.384C9.392%208.384%2010.076%208.612%2010.58%209.068C11.084%209.524%2011.336%2010.14%2011.336%2010.916V11.6C11.336%2012.112%2011.22%2012.556%2010.988%2012.932C10.756%2013.308%2010.428%2013.6%2010.004%2013.808C9.58%2014.016%209.084%2014.12%208.516%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",zu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M9.68%2014V12.26H5.78V10.088L9.152%205.24H10.832L7.22%2010.484V10.94H9.68V8.96H11.18V14H9.68Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Pu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.588%2014.12C7.78%2014.12%207.132%2013.92%206.644%2013.52C6.156%2013.112%205.888%2012.56%205.84%2011.864H7.34C7.372%2012.168%207.492%2012.404%207.7%2012.572C7.916%2012.732%208.212%2012.812%208.588%2012.812C9.004%2012.812%209.32%2012.704%209.536%2012.488C9.752%2012.264%209.86%2011.956%209.86%2011.564V10.712C9.86%2010.312%209.752%2010.008%209.536%209.8C9.32%209.584%209.004%209.476%208.588%209.476C8.332%209.476%208.112%209.528%207.928%209.632C7.744%209.736%207.604%209.88%207.508%2010.064H6.044L6.104%205.24H11.036V6.596H7.52L7.496%209.14H7.844L7.484%209.44C7.484%209.072%207.628%208.784%207.916%208.576C8.212%208.36%208.608%208.252%209.104%208.252C9.816%208.244%2010.368%208.46%2010.76%208.9C11.16%209.332%2011.36%209.936%2011.36%2010.712V11.564C11.36%2012.356%2011.112%2012.98%2010.616%2013.436C10.128%2013.892%209.452%2014.12%208.588%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Ou="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.6%2014.12C8.016%2014.12%207.5%2014%207.052%2013.76C6.612%2013.512%206.268%2013.168%206.02%2012.728C5.78%2012.28%205.66%2011.764%205.66%2011.18C5.66%2010.764%205.728%2010.328%205.864%209.872C6.008%209.416%206.204%208.988%206.452%208.588L8.516%205.24H10.184L7.592%209.32L7.664%209.368C7.824%209.12%208.04%208.932%208.312%208.804C8.584%208.676%208.888%208.612%209.224%208.612C9.696%208.612%2010.104%208.724%2010.448%208.948C10.792%209.172%2011.06%209.484%2011.252%209.884C11.444%2010.284%2011.54%2010.752%2011.54%2011.288C11.54%2011.856%2011.416%2012.352%2011.168%2012.776C10.928%2013.2%2010.588%2013.532%2010.148%2013.772C9.716%2014.004%209.2%2014.12%208.6%2014.12ZM8.6%2012.848C9.04%2012.848%209.396%2012.708%209.668%2012.428C9.94%2012.14%2010.076%2011.768%2010.076%2011.312C10.076%2010.84%209.94%2010.464%209.668%2010.184C9.396%209.896%209.04%209.752%208.6%209.752C8.16%209.752%207.804%209.896%207.532%2010.184C7.26%2010.464%207.124%2010.84%207.124%2011.312C7.124%2011.768%207.26%2012.14%207.532%2012.428C7.804%2012.708%208.16%2012.848%208.6%2012.848Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",qu={class:"dss-toolbar-left"},Wu=["title"],Zu=["title"],Uu={class:"dss-toolbar-dropdown-wrapper"},Xu=["title"],Yu=["src"],ju=["src"],Ku=["src"],Gu=["src"],Qu=["src"],Ju=["src"],ed={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},td=["src"],nd=["src"],ld=["src"],od=["src"],ad=["src"],sd=["src"],rd=["title"],id=["title"],cd=["title"],ud=["title"],dd=["title"],md=["title"],pd=["title"],fd=["title"],vd=["title"],gd={key:2,class:"dss-toolbar-separator"},hd=["title"],yd={key:4,class:"dss-toolbar-separator"},kd={key:5,class:"dss-toolbar-dropdown-wrapper"},Cd=["title"],bd={class:"dss-toolbar-dropdown-ai"},wd={class:"dss-toolbar-right"},xd={key:0,class:"dss-toolbar-custom-group"},Ed={key:1,class:"dss-toolbar-separator"},Sd={class:"dss-link-modal-content"},Vd={class:"dss-link-modal-field"},Nd={class:"dss-link-modal-label"},Bd=["placeholder"],Md={class:"dss-link-modal-field"},_d={class:"dss-link-modal-label"},$d=["placeholder"],Ld={class:"dss-image-modal-tabs"},Td={key:0,class:"dss-image-tab-content"},Ad={class:"dss-link-modal-content"},Dd={class:"dss-link-modal-field"},Hd={key:0,class:"dss-link-modal-label"},Rd=["src"],Fd={class:"dss-link-modal-field"},Id={class:"dss-link-modal-label"},zd=["placeholder"],Pd={class:"dss-link-modal-field"},Od={class:"dss-link-modal-label"},qd=["placeholder"],Wd={class:"dss-link-modal-field"},Zd={class:"dss-link-modal-label"},Ud=["placeholder"],Xd={key:1,class:"dss-image-tab-content"},Yd={class:"dss-link-modal-content"},jd={class:"dss-link-modal-field"},Kd={class:"dss-link-modal-label"},Gd=["placeholder"],Qd={class:"dss-link-modal-field"},Jd={class:"dss-link-modal-label"},e1=["placeholder"],t1={class:"dss-link-modal-field"},n1={class:"dss-link-modal-label"},l1=["placeholder"],o1={class:"dss-link-modal-field"},a1={class:"dss-link-modal-label"},s1=["placeholder"],r1={class:"dss-text-editor-title-input-container"},i1={key:0,class:"dss-text-editor-title-preview"},c1={key:0},u1={key:1,class:"dss-text-editor-preview-placeholder"},d1=["value","placeholder","disabled"],m1={key:3,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},p1={class:"dss-text-editor-description-input-container"},f1={key:0,class:"dss-text-editor-description-preview"},v1={key:0},g1={key:1,class:"dss-text-editor-preview-placeholder"},h1=["value","placeholder","disabled"],y1={key:5,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},k1=["data-comment-id","onMouseenter"],C1=["onClick"],b1=["src","alt"],w1={key:1},x1=["onClick"],E1=["src","alt"],S1={key:1},V1=["data-has-second-user","onClick"],N1={class:"editor-comment-marker-count"},B1={key:7,class:"dss-text-editor-textarea-wrapper"},M1=["value","placeholder","rows","disabled"],_1={class:"dss-text-editor-footer"},$1={class:"dss-text-editor-footer-content"},L1={class:"dss-text-editor-footer-stat"},T1={class:"dss-text-editor-footer-stat"},A1={key:8,class:"dss-text-editor-content-wrapper"},D1={key:0,class:"dss-comment-overlay-body"},H1={class:"dss-comment-selection-wrapper"},R1=["innerHTML"],F1={class:"dss-comment-messages-wrapper"},I1={key:0,class:"dss-comment-avatar-wrapper"},z1={class:"dss-comment-avatar"},P1=["src","alt"],O1={key:1},q1={class:"dss-comment-header"},W1={class:"dss-comment-header-text"},Z1={class:"dss-comment-author"},U1={key:0,class:"dss-comment-date"},X1=["onClick","title"],Y1={class:"dss-comment-overlay-inner"},j1=["placeholder","onKeydown"],K1={class:"dss-text-editor-footer"},G1={class:"dss-text-editor-footer-content"},Q1={class:"dss-text-editor-footer-stat"},J1={class:"dss-text-editor-footer-stat"},em=["title"],tm=["title"],nm={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:""},lm={class:"dss-image-popup-content"},om={key:0,class:"dss-image-popup-no-alt-icon"},am=["title"],sm=["title"],rm={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:""},im={class:"dss-toolbar-left"},cm=["title"],um=["title"],dm={class:"dss-toolbar-dropdown-wrapper"},mm=["title"],pm=["src"],fm=["src"],vm=["src"],gm=["src"],hm=["src"],ym=["src"],km={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Cm=["title"],bm=["title"],wm=["title"],xm=["title"],Em=["title"],Sm=["title"],Vm=["title"],Nm=["title"],Bm=["title"],Mm={key:2,class:"dss-toolbar-separator"},_m=["title"],$m={key:4,class:"dss-toolbar-separator"},Lm={key:5,class:"dss-toolbar-dropdown-wrapper"},Tm=["title"],Am={class:"dss-toolbar-dropdown-ai"},Dm={key:0,class:"dss-toolbar-right"},Hm={key:0,class:"dss-toolbar-separator"},Rm={key:0,class:"dss-toolbar-custom-group"},Fm={key:1,class:"dss-toolbar-separator"},Im={name:"DSSTextEditor"},zm=Object.assign(Im,{props:{modelValue:{type:String,default:""},title:{type:String,default:""},description:{type:String,default:""},titlePlaceholder:{type:String,default:null},descriptionPlaceholder:{type:String,default:null},placeholder:{type:String,default:null},rows:{type:Number,default:10},fullHeight:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},richText:{type:Boolean,default:!1},border:{type:Boolean,default:!0},rounded:{type:Boolean,default:!1},fixedHeight:{type:Boolean,default:!1},options:{type:Object,default:()=>({}),validator:L=>typeof L=="object"&&L!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},showTitle:{type:Boolean,default:!0},showDescription:{type:Boolean,default:!0},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:L=>typeof L=="object"&&L!==null},locale:{type:String,default:null},comments:{type:Array,default:()=>[]}},emits:["update:modelValue","update:title","update:description","update:comments","change","blur","title-change","description-change","comment-submitted","comment-marker-clicked","comment-deleted"],setup(L,{expose:ne,emit:_}){const{t:D,locale:ce}=co.useI18n(),z={h1:Ru,h2:Fu,h3:Iu,h4:zu,h5:Pu,h6:Ou},M=L,fe=_,mt=e.useSlots(),J=`<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>`,v=e.ref(null),we=e.ref(null),ke=e.ref(!1),J=e.ref(!1),X=e.ref(!1),me=e.ref(""),F=e.ref({}),Se=e.ref(!1),Ae=e.ref(!1),lt=e.ref(""),ft=e.ref(""),Z=e.ref(null),De=e.ref(null),We=e.ref(null),Ee=e.ref(null),_e=e.ref(""),Xe=e.ref(!1),re=e.ref({}),tt=e.ref(!1),Ce=e.ref({}),nt=e.ref(null),ot=e.ref(null),kt=e.ref(!1),Vt=e.ref(""),Ht=e.ref(null),zt=e.ref(""),Nt=e.ref(""),bt=e.ref(""),Xt=e.ref(null),mt=e.ref(null),tn=e.ref(null),Y=e.ref(null),ye=e.ref(null),xe=e.ref(!1),Pe=e.ref(""),j=e.ref({}),ge=e.ref(!1),Be=e.ref("upload"),Fe=e.ref(""),Ye=e.ref(null),wt=e.ref(null),et=e.ref([]),Yt=e.ref([]),Ue=e.ref(null),Oe=e.ref(!1),Tt=e.ref(""),Lt=e.ref(""),le=e.ref(""),W=e.ref(""),U=e.ref(""),ie=e.ref(""),he=e.ref(null),Ge=e.ref(null),At=e.ref(null),jt=e.ref(!1),at=e.ref(null),sn=e.ref(!1),S=e.ref(!1),b=e.ref(null),V=e.ref("p"),K=e.ref(!1),oe=e.ref([]),He=e.ref(null),Ct=e.ref(null),st=e.ref(null),ze=e.ref(!1),xt=e.ref(0),Mt=100,Et=e.ref(null),ct=e.computed(()=>!!M.commentUser),Dt=e.computed(()=>({"dss-text-editor-no-border":!M.border,"dss-text-editor-rounded":M.rounded,"dss-text-editor-full-height":M.fullHeight,"dss-comment-overlay-open":ct.value&&hn.value!==null})),Bt=e.computed(()=>({})),rn=e.computed(()=>!M.fixedHeight||M.fullHeight?{}:{height:`${1.6*14*M.rows+24+2}px`,resize:"none",overflowY:"auto"}),Vn=e.computed(()=>!M.fixedHeight||M.fullHeight?{}:{height:`${1.6*14*M.rows+32}px`,overflowY:"auto"}),Wn=e.computed(()=>M.richText&&Yt.value.length>0),en=e.computed(()=>{if(!M.modelValue)return"";if(M.richText){let o=M.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/ /g," "),o=o.replace(/&/g,"&"),o=o.replace(/</g,"<"),o=o.replace(/>/g,">"),o=o.replace(/"/g,'"'),o=o.replace(/'/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return M.modelValue}),pn=e.computed(()=>{const o=en.value.trim();return o?o.split(/\s+/).filter(l=>l.length>0).length:0}),ll=e.computed(()=>en.value.length),vl=e.computed(()=>Y.value!==null&&Be.value==="upload"&&zt.value&&zt.value.startsWith("data:")),il=e.computed(()=>M.titlePlaceholder||D("textEditor.placeholders.title")),_n=e.computed(()=>M.descriptionPlaceholder||D("textEditor.placeholders.description")),gl=e.computed(()=>M.placeholder||D("textEditor.placeholders.startTyping")),$n=o=>dt&&dt[o]!==void 0,Vl=o=>{for(let l=o+1;l<M.customToolbarSlots.length;l++)if($n(M.customToolbarSlots[l]))return!0;return!1},Rl=o=>{for(let l=o+1;l<M.customToolbarSlots.length;l++){const s=M.customToolbarSlots[l];if($n(s)&&hl(s))return!0}return!1},hl=o=>M.customToolbarFloatingMap.hasOwnProperty(o)?M.customToolbarFloatingMap[o]===!0:!0,An=e.computed(()=>M.customToolbarSlots.some(o=>$n(o)&&hl(o))),Un=e.computed(()=>$n("title-slot")),Xn=e.computed(()=>$n("description-slot")),Hn=o=>{if(!o||o.trim()==="")return"<html></html>";const l=o.trim();return l.startsWith("<html>")&&l.endsWith("</html>")?o:`<html>${o}</html>`},zn=o=>{if(!o||o.trim()==="")return"";const l=o.replace(/<!--[\s\S]*?-->/g,""),s=l.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():l},Nl=o=>{if(!o)return;const l=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),s=[];let i=l.nextNode();for(;i;)s.push(i),i=l.nextNode();s.forEach(c=>c.remove())},T=o=>{try{const l=String(o.getDate()).padStart(2,"0"),i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],c=o.getFullYear();return`${l} ${i} ${c}`}catch{return""}},I=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 i=l.toLowerCase();return i.includes("started conversation")||i.includes("démarré la conversation")||i==="started conversation"||i==="a démarré la conversation"},B=o=>{const l=o.target.value;fe("update:modelValue",l),fe("change",l)},te=()=>{if(!he.value)return;const o=he.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 i=o.value;o.value="M";const c=o.scrollHeight;o.value=i,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},Te=()=>{sn.value=!0,te()},vt=()=>{sn.value=!1,pt()},pt=()=>{if(!he.value)return;const o=he.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 s=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${s}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")},rt=o=>{const s=o.target.value;sn.value&&te(),fe("update:title",s),fe("title-change",s),At.value="title",M.richText&&(Oe.value||(Lt.value=Tt.value,U.value=le.value,ie.value=W.value),Ue.value&&clearTimeout(Ue.value),Oe.value=!0,Ue.value=setTimeout(()=>{Oe.value=!1,ve()},500))},it=()=>{if(!Ge.value)return;const o=Ge.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 i=o.value;o.value="M";const c=o.scrollHeight;o.value=i,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},vn=()=>{S.value=!0,it()},bn=()=>{S.value=!1,qt()},qt=()=>{if(!Ge.value)return;const o=Ge.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 s=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${s}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")},gn=o=>{const s=o.target.value;S.value&&it(),fe("update:description",s),fe("description-change",s),At.value="description",M.richText&&(Oe.value||(Lt.value=Tt.value,U.value=le.value,ie.value=W.value),Ue.value&&clearTimeout(Ue.value),Oe.value=!0,Ue.value=setTimeout(()=>{Oe.value=!1,ve()},500))},Gt=()=>{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 s=l.cloneRange();return s.selectNodeContents(v.value),s.setEnd(l.startContainer,l.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+l.toString().length}},Ln=o=>{if(!(!o||!v.value))try{const l=window.getSelection(),s=document.createRange();if(o.type==="element"&&o.element)if(v.value.contains(o.element)){s.setStart(o.element,o.offset),s.collapse(!0),l.removeAllRanges(),l.addRange(s);return}else{v.value.focus();return}let i=0;const c=[v.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const f=i+d.length;!u&&o.start>=i&&o.start<=f&&(s.setStart(d,o.start-i),u=!0),u&&o.end>=i&&o.end<=f&&(s.setEnd(d,o.end-i),m=!0),i=f}else{let f=d.childNodes.length;for(;f--;)c.push(d.childNodes[f])}l.removeAllRanges(),l.addRange(s)}catch{v.value.focus()}},Ft=()=>{if(!v.value)return;v.value.focus();const o=window.getSelection(),l=document.createRange(),s=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=s(u);if(m)return m}return c},i=s(v.value);if(i.nodeType===3)l.setStart(i,i.length),l.setEnd(i,i.length);else if(i.childNodes.length>0){const c=s(i);c&&c.nodeType===3?(l.setStart(c,c.length),l.setEnd(c,c.length)):(l.selectNodeContents(i),l.collapse(!1))}else l.setStart(i,0),l.setEnd(i,0);o.removeAllRanges(),o.addRange(l)},ve=(o=!1)=>{if(!v.value)return;const l=v.value.innerHTML,s=M.title||"",i=M.description||"";if(!o&&l===Tt.value&&s===le.value&&i===W.value)return;const c={content:Lt.value||Tt.value,title:U.value!==void 0?U.value:le.value,description:ie.value!==void 0?ie.value:W.value},d=et.value.length>0?et.value[et.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&&(et.value.push(c),et.value.length>50&&et.value.shift(),Yt.value=[]),Tt.value=l,le.value=s,W.value=i,Lt.value=l,U.value=s,ie.value=i},_t=o=>{if(!v.value)return;gt(),v.value&&Nl(v.value);let l=null;v.value&&(v.value.querySelector("p")||(l=Gt(),Rn()));const s=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");s&&b.value&&(b.value=null),J.value=!0;const i=v.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=Hn(i);fe("update:modelValue",c),fe("change",c),At.value="editor",Oe.value||(Lt.value=Tt.value,U.value=le.value,ie.value=W.value),Ue.value&&clearTimeout(Ue.value),Oe.value=!0,Ue.value=setTimeout(()=>{Oe.value=!1,ve(),lo(),_o()},500),e.nextTick(()=>{l&&Ln(l),gt();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,f=m&&m.collapsed;if(d.forEach(k=>{try{if(f&&b.value?.command===k){re.value[k]=b.value.state;return}if(k==="bold")if(m){const A=m.commonAncestorContainer,R=A.nodeType===3?A.parentElement:A;let E=!1;if(R&&((R.tagName==="STRONG"||R.tagName==="B"||R.closest&&R.closest("strong, b"))&&(E=!0),!E&&R.style&&parseInt(R.style.fontWeight)>=600&&(E=!0),!E))try{const se=window.getComputedStyle(R);parseInt(se.fontWeight)>=600&&(E=!0)}catch{}re.value[k]=E}else re.value.hasOwnProperty(k)||(re.value[k]=!1);else if(k==="italic")if(m){const A=m.commonAncestorContainer,R=A.nodeType===3?A.parentElement:A,E=R&&(R.tagName==="EM"||R.tagName==="I"||R.closest&&R.closest("em, i"));re.value[k]=!!E}else{const A=document.queryCommandState(k);re.value[k]=A}else{const A=document.queryCommandState(k);re.value[k]=A}}catch{}}),Mn(),je(),ol(),Jt(),ut(),St("handleRichTextInput"),s&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const k=o.data||"";k&&k.length===1&&setTimeout(()=>_o(k),0),(k===" "||k===`
|
|
101
|
-
`||/[.,;:!?]/.test(k))&&setTimeout(()=>{lo()},100)}J.value=!1})},gt=()=>{if(!v.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i)return;const c=i.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(i!==d&&!d?.contains(i)){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 f=document.createRange();f.setStartAfter(c),f.collapse(!0),o.removeAllRanges(),o.addRange(f)}}}},Rn=()=>{if(!v.value)return;const o=v.value;if(o.querySelector&&o.querySelector("p"))return;const l=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),s=Array.from(o.childNodes);let i=null;s.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}i||(i=document.createElement("p"),o.insertBefore(i,c)),i.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){i=null;return}if(l.has(u)){i=null;return}i||(i=document.createElement("p"),o.insertBefore(i,d)),i.appendChild(d)}})},je=()=>{if(v.value&&!jt.value){jt.value=!0;try{v.value.querySelectorAll(".dss-image-wrapper").forEach(i=>{i.querySelector("img")||i.remove()}),v.value.querySelectorAll(".dss-image-no-alt-icon").forEach(i=>{const c=i.parentElement;!c||!c.classList.contains("dss-image-wrapper")?i.remove():c.querySelector("img")||i.remove()}),v.value.querySelectorAll("img").forEach(i=>{let c=i.getAttribute("alt");c===null&&(c=i.alt||"");const d=i.getAttribute("src")||i.src||"";if(c){const k=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),A=c===d||c===k;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||A||A)&&(c="")}i.setAttribute("alt",c),i.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=i.parentElement;const f=m&&m.classList.contains("dss-image-wrapper");if(f){const k=m.querySelector(".dss-image-no-alt-icon");k&&k.remove()}else{const k=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;k&&k.remove()}if(u){f?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),i.parentNode.insertBefore(m,i),m.appendChild(i));const k=document.createElement("div");k.className="dss-image-no-alt-icon",k.setAttribute("contenteditable","false"),k.innerHTML=ee,m.appendChild(k)}else if(f&&m.children.length===1){const k=m.parentNode;k.insertBefore(i,m),k.removeChild(m)}})}finally{jt.value=!1}}},ht=o=>{lo(),fe("blur",o),Il()},ae=()=>{if(M.disabled||!M.richText||!v.value)return;un(),Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Oe.value&&(ve(),Oe.value=!1);const o=At.value==="title",l=At.value==="description",s=At.value==="editor";if(et.value.length===0){o&&he.value?he.value.focus():l&&Ge.value?Ge.value.focus():v.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{_t()});return}const i={content:v.value.innerHTML,title:M.title||"",description:M.description||""};Yt.value.push(i);const c=et.value.pop();if(c!==void 0){J.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";v.value.innerHTML=d,Tt.value=d,le.value=u,W.value=m,Lt.value=d,U.value=u,ie.value=m,e.nextTick(()=>{Mn(),Bn(),Wt(),Jt();const f=Hn(d);fe("update:modelValue",f),fe("update:title",u),fe("update:description",m),fe("change",f),fe("title-change",u),fe("description-change",m),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(he.value){he.value.focus();const k=u.length;he.value.setSelectionRange&&he.value.setSelectionRange(k,k),te()}}else if(l){if(Ge.value){Ge.value.focus();const k=m.length;Ge.value.setSelectionRange(k,k)}}else if(s)Ft();else if(he.value&&document.activeElement===he.value){const k=u.length;he.value.setSelectionRange&&he.value.setSelectionRange(k,k),te()}else if(Ge.value&&document.activeElement===Ge.value){const k=m.length;Ge.value.setSelectionRange(k,k)}else v.value&&Ft()},10)})})}},on=()=>{if(M.disabled||!M.richText||!v.value)return;un();const o=At.value==="title",l=At.value==="description",s=At.value==="editor";if(Yt.value.length===0){o&&he.value?he.value.focus():l&&Ge.value?Ge.value.focus():v.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{_t()});return}const i={content:v.value.innerHTML,title:M.title||"",description:M.description||""};et.value.push(i);const c=Yt.value.pop();if(c!==void 0){J.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";v.value.innerHTML=d,Tt.value=d,le.value=u,W.value=m,Lt.value=d,U.value=u,ie.value=m,e.nextTick(()=>{Mn(),Bn(),Wt(),Jt();const f=Hn(d);fe("update:modelValue",f),fe("update:title",u),fe("update:description",m),fe("change",f),fe("title-change",u),fe("description-change",m),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(he.value){he.value.focus();const k=u.length;he.value.setSelectionRange&&he.value.setSelectionRange(k,k),te()}}else if(l){if(Ge.value){Ge.value.focus();const k=m.length;Ge.value.setSelectionRange(k,k)}}else if(s)Ft();else if(he.value&&document.activeElement===he.value){const k=u.length;he.value.setSelectionRange&&he.value.setSelectionRange(k,k),te()}else if(Ge.value&&document.activeElement===Ge.value){const k=m.length;Ge.value.setSelectionRange(k,k)}else v.value&&Ft()},10)})})}},Ie=()=>{if(!v.value)return;v.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{const c=i.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),v.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{if(parseInt(i.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),v.value.querySelectorAll("b, strong").forEach(i=>{i.style.fontWeight="600"})},ol=()=>{if(!v.value)return;v.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},cn=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let s=!1;if(l.collapsed){const i=l.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==v.value;){if(c.tagName==="EM"||c.tagName==="I"){s=!0;break}if(c.style&&c.style.fontStyle==="italic"){s=!0;break}c=c.parentElement}}else{const i=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,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!==v.value;){if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}}if(s)break}}}if(s)return document.execCommand("italic",!1),e.nextTick(()=>{ol()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{ol()});else try{const i=l.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(i),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{ol()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{ol()})}return!0},yl=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let s=!1;if(l.collapsed){const i=l.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==v.value;){if(c.tagName==="STRONG"||c.tagName==="B"){s=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){s=!0;break}c=c.parentElement}}else{const i=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,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!==v.value;){if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}}if(s)break}}}if(s)return document.execCommand("bold",!1),e.nextTick(()=>{Ie()}),!1;if(l.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==v.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const f=document.createElement("b");f.style.fontWeight="600";const k=document.createDocumentFragment();for(;u.firstChild;)k.appendChild(u.firstChild);f.appendChild(k),u.parentNode&&u.parentNode.replaceChild(f,u),c.setStart(f,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===v.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c)}}Ie()});else try{const i=l.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(i),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{Ie()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Ie()})}return!0},Nn=(o,l=null)=>{if(M.disabled||!M.richText||!v.value)return;Oe.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),ve(),Oe.value=!1):ve(),un(),v.value.focus();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&_l(d)&&(i=Gt())}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 f=document.createTextNode(l);u.insertNode(f),u.selectNodeContents(f)}}}if(o==="bold"){const d=yl();re.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(b.value={command:"bold",state:d}),e.nextTick(()=>{i&&(Ln(i),e.nextTick(()=>{const m=Qt("bold");re.value.bold=m})),_t(),Bn(),Jt()});return}if(o==="italic"){const d=cn();re.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(b.value={command:"italic",state:d}),e.nextTick(()=>{i&&(Ln(i),e.nextTick(()=>{const m=Qt("italic");re.value.italic=m})),_t(),ol(),Bn(),Jt()});return}let c=!1;try{c=document.execCommand(o,!1,l)}catch{}e.nextTick(()=>{if(i&&Ln(i),["bold","italic","underline"].includes(o))try{if(o==="bold")i&&e.nextTick(()=>{const u=Qt("bold");re.value.bold=u});else if(o==="italic")if(i)e.nextTick(()=>{const u=Qt("italic");re.value.italic=u});else{const u=document.queryCommandState(o);re.value[o]=u}else{const u=document.queryCommandState(o);re.value[o]=u}}catch{re.value.hasOwnProperty(o)?re.value[o]=!re.value[o]:re.value[o]=!0}if(o==="createLink"&&l){const u=window.getSelection();if(u.rangeCount>0){const f=u.getRangeAt(0),k=f.commonAncestorContainer.nodeType===1?f.commonAncestorContainer.closest("a"):f.commonAncestorContainer.parentElement?.closest("a");k&&(!k.getAttribute("href")||k.getAttribute("href")==="")&&k.setAttribute("href",l)}v.value.querySelectorAll("a").forEach(f=>{const k=f.getAttribute("href");(!k||k===""||k==="#")&&f.setAttribute("href",l)})}_t(),Bn(),Jt()})},Qt=(o,l=null)=>{if(M.disabled||!v.value)return!1;try{if(o==="formatBlock"&&l){const i=document.queryCommandValue("formatBlock");if(l==="<blockquote>"){const c=i.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 i===l||i.toLowerCase()===l.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,f=m.nodeType===3?m.parentElement:m;if(f&&((f.tagName==="STRONG"||f.tagName==="B"||f.closest&&f.closest("strong, b"))&&(u=!0),!u&&f.style&&parseInt(f.style.fontWeight)>=600&&(u=!0),!u))try{const k=window.getComputedStyle(f);parseInt(k.fontWeight)>=600&&(u=!0)}catch{}return re.value.hasOwnProperty(o)?re.value[o]:(re.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let f=!1;if(m){const k=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let A;for(;A=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(A))){if(A.nodeType===3){if(!(A.textContent||"").trim())continue;f=!0;let E=A.parentElement;for(;E&&E!==v.value;){if(E.tagName==="STRONG"||E.tagName==="B"){u=!0;break}if(E.style&&parseInt(E.style.fontWeight)>=600){u=!0;break}E=E.parentElement}}else if(A.nodeType===1){const R=A;if(R.tagName==="STRONG"||R.tagName==="B"){u=!0;break}if(R.style&&parseInt(R.style.fontWeight)>=600){u=!0;break}}if(u)break}}return re.value[o]=u&&f,u&&f}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,f=m.nodeType===3?m.parentElement:m;if(f&&((f.tagName==="EM"||f.tagName==="I"||f.closest&&f.closest("em, i"))&&(u=!0),!u&&f.style&&f.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(f).fontStyle==="italic"&&(u=!0)}catch{}return re.value.hasOwnProperty(o)?re.value[o]:(re.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let f=!1;if(m){const k=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let A;for(;A=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(A))){if(A.nodeType===3){if(!(A.textContent||"").trim())continue;f=!0;let E=A.parentElement;for(;E&&E!==v.value;){if(E.tagName==="EM"||E.tagName==="I"){u=!0;break}if(E.style&&E.style.fontStyle==="italic"){u=!0;break}E=E.parentElement}}else if(A.nodeType===1){const R=A;if(R.tagName==="EM"||R.tagName==="I"){u=!0;break}if(R.style&&R.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return re.value[o]=u&&f,u&&f}}const d=document.queryCommandState(o);return c.collapsed&&re.value.hasOwnProperty(o)?re.value[o]:(re.value[o]=d,d)}return re.value.hasOwnProperty(o)?re.value[o]:!1}catch{return re.value.hasOwnProperty(o)?re.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},Fl=o=>{M.disabled||!M.richText||(we.value=we.value===o?null:o,o==="askAi"&&(ot.value=null))},un=()=>{we.value=null,Ye.value=null},Pn=o=>{Nn("formatBlock",o),un()},Wl=o=>{if(!o||!v.value)return o;const l=qe=>{let Me=qe.nodeType===Node.TEXT_NODE?qe.parentElement:qe;for(;Me&&Me!==v.value;){const yt=Me.tagName;if(yt==="P"){const dn=Me.parentElement;if(dn===v.value||dn.tagName==="BLOCKQUOTE")return Me}if(yt==="BLOCKQUOTE")break;Me=Me.parentElement}return null},s=l(o.startContainer),i=l(o.endContainer);if(!s||!i)return o;const c=[],d=document.createTreeWalker(v.value,NodeFilter.SHOW_ELEMENT,{acceptNode:qe=>{const Me=qe.tagName;if(Me==="P"){const yt=qe.parentElement;if(yt===v.value||yt.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(s),f=c.indexOf(i);if(m===-1||f===-1)return o;const k=Math.min(m,f),A=Math.max(m,f),R=c.slice(k,A+1);if(R.length===0)return o;const E=R[0],se=R[R.length-1],G=document.createRange();return G.setStartBefore(E),G.setEndAfter(se),G},Yn=()=>{if(M.disabled||!M.richText||!v.value)return;Oe.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),ve(),Oe.value=!1):ve(),un(),v.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let l=o.getRangeAt(0);!l.collapsed&&_l(l)&&(l=Wl(l),o.removeAllRanges(),o.addRange(l));let s=null;!l.collapsed&&_l(l)&&(s=Gt());const i=l.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(f=>{if(f.nodeType===Node.ELEMENT_NODE)if(f.tagName==="P"||f.tagName==="DIV")u.insertBefore(f,c);else{const k=document.createElement("p");k.appendChild(f.cloneNode(!0)),u.insertBefore(k,c)}else if(f.nodeType===Node.TEXT_NODE&&f.textContent.trim()){const k=document.createElement("p");k.appendChild(f.cloneNode(!0)),u.insertBefore(k,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 f=[],k=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:E=>E.parentNode===u&&E.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let A;for(;A=k.nextNode();)f.push(A);if(f.forEach(E=>{const se=document.createElement("p");E.parentNode.insertBefore(se,E),se.appendChild(E)}),u.querySelectorAll("p, div").forEach(E=>{E.textContent.trim()===""&&!E.querySelector("img")&&(E.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const E=document.createElement("p");E.innerHTML="<br>",u.appendChild(E)}}e.nextTick(()=>{s&&Ln(s),Wt(),_t(),Jt()})},Bl=()=>{if(!v.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!i||!v.value.contains(i))return;const c=A=>{if(!A)return!1;const R=A.textContent||"",se=(A.innerHTML||"").trim();return R.trim()===""||se===""||se==="<br>"||se==="<br/>"||se==="<p></p>"||se==="<p><br></p>"||se==="<p><br/></p>"||se==="<p> </p>"||se==="<p><br> </p>"||se==="<div></div>"||se==="<div><br></div>"||se==="<div><br/></div>"};let d=null;for(s.nodeType===3?d=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?d=s:d=s.closest("p, div"),d&&i.contains(d)&&c(d)&&d.remove();i.lastChild;){const A=i.lastChild;if(A.nodeType===1&&A.tagName==="BR")A.remove();else if(A.nodeType===3)if((A.textContent||"").trim()==="")A.remove();else break;else break}if(i.children.length>0)for(let A=i.children.length-1;A>=0;A--){const R=i.children[A];if((R.tagName==="P"||R.tagName==="DIV")&&c(R))R.remove();else break}let u=i.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(i.innerHTML=u);const f=document.createElement("p");f.innerHTML="<br>",i.parentNode?i.nextSibling?i.parentNode.insertBefore(f,i.nextSibling):i.parentNode.appendChild(f):v.value&&v.value.appendChild(f);const k=document.createRange();k.selectNodeContents(f),k.collapse(!0),o.removeAllRanges(),o.addRange(k),e.nextTick(()=>{Wt(),_t()})},Bn=()=>{if(!v.value){ke.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");ke.value=!!i}else ke.value=!1}catch{ke.value=!1}},Gl=()=>{if(!v.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),Ee.value=Gt();const l=window.getSelection();let s="";l.rangeCount>0&&(s=l.getRangeAt(0).toString()),lt.value="",ft.value=s,_e.value="",We.value=null,Ae.value=!0,un(),e.nextTick(()=>{Z.value&&Z.value.focus()})},cl=()=>{if(!v.value)return;Oe.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),ve(),Oe.value=!1):ve();const o=window.getSelection();let l=null;if(o.rangeCount>0){const i=o.getRangeAt(0).commonAncestorContainer;l=i.nodeType===1?i.closest("a"):i.parentElement?.closest("a")}if(!l&&We.value&&(l=We.value),l&&l.parentNode){const s=document.createDocumentFragment();for(;l.firstChild;)s.appendChild(l.firstChild);if(l.parentNode.replaceChild(s,l),s.firstChild){const i=document.createRange();i.setStartBefore(s.firstChild),i.setEndAfter(s.lastChild||s.firstChild),o.removeAllRanges(),o.addRange(i),document.execCommand("removeFormat",!1),i.collapse(!1),o.removeAllRanges(),o.addRange(i)}We.value=null}else Nn("unlink");ke.value=!1,un(),e.nextTick(()=>{_t(),Bn()})},Ul=()=>{M.disabled||!M.richText||v.value&&(Oe.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),ve(),Oe.value=!1):ve(),un(),v.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Mn(),_t(),Jt()}))},kl=()=>{M.disabled||!M.richText||v.value&&(Oe.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),ve(),Oe.value=!1):ve(),un(),v.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Mn(),_t(),Jt()}))},Ql=o=>{const l=o.parentElement;if(!l||l.tagName!=="OL")return null;let s=0,i=o.previousElementSibling;for(;i;)i.tagName==="LI"&&s++,i=i.previousElementSibling;return s+1},Mn=()=>{if(!v.value)return;v.value.querySelectorAll("li > ol").forEach(l=>{const s=l.parentElement;if(s&&s.tagName==="LI"){const i=Ql(s);i!==null&&Array.from(l.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(i))})}})},ul=()=>{if(M.disabled||!M.richText||!v.value)return;un(),v.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{Mn(),_t()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=s.previousElementSibling;if(c&&c.tagName==="LI"){const d=i.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const m=Ql(c);u.appendChild(s),m!==null&&i.tagName==="OL"&&s.setAttribute("data-parent-num",String(m)),Mn();const f=document.createRange();f.selectNodeContents(s),f.collapse(!1),o.removeAllRanges(),o.addRange(f),e.nextTick(()=>{_t(),Jt()})}else document.execCommand("indent",!1),e.nextTick(()=>{Mn(),_t(),Jt()})},xn=()=>{if(M.disabled||!M.richText||!v.value)return;un(),v.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{Mn(),_t()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=i.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){i.tagName==="OL"&&s.removeAttribute("data-parent-num"),d.insertBefore(s,c.nextSibling),i.children.length===0&&i.remove(),Mn();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{_t(),Jt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Mn(),_t(),Jt()})},hn=e.ref(null),jn=e.ref(null),y=e.ref({}),h=e.ref(""),x=e.ref(null),q=e.ref("");e.ref("");const ue=e.ref(null);e.ref("");const Qe=e.ref([]),Zt=e.ref(!1),yn=e.ref(!1),Fn=o=>{if(!o)return"";const l=o.cloneRange(),s=document.createElement("div");return s.appendChild(l.cloneContents()),s.innerHTML},On=()=>{if(!M.commentUser||M.disabled||!M.richText||!v.value)return;if(hn.value!==null){hn.value=null,h.value="",q.value="",ue.value=null,Qe.value=[],Tl(!0);return}un(),v.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(l.collapsed||!_l(l))return;q.value=Fn(l)||"",ue.value=Gt();const s=l.getBoundingClientRect(),i=v.value.parentElement;if(!i)return;const c=i.getBoundingClientRect(),d=s.bottom-c.top,m=Math.max(d+8,0);y.value={top:`${m}px`,bottom:"auto"},hn.value=Date.now(),e.nextTick(()=>{if(h.value="",x.value){const k=x.value;k.style.height="auto",k.style.height=`${k.scrollHeight}px`,k.focus()}const f=i.querySelector(".dss-comment-overlay");if(f&&i){const k=i.querySelector(".dss-text-editor-footer");if(k){const A=i.getBoundingClientRect(),R=f.getBoundingClientRect(),E=k.getBoundingClientRect(),se=R.bottom-A.top,G=E.top-A.top,qe=8;if(se>G-qe){const Me=E.height;y.value={bottom:`${Me+qe}px`,top:"auto"}}else y.value={top:`${m}px`,bottom:"auto"}}}})},Cl=()=>{if(!h.value.trim())return;const o=h.value.trim(),l=new Date,s={text:o,selectionText:q.value,selectionRange:ue.value,commentId:hn.value,user:M.commentUser||null,createdAt:l.toISOString()};Qe.value=[...Qe.value,s],fe("comment-submitted",s),Vo(s),ue.value&&!Uo(ue.value)&&go(hn.value,ue.value),h.value="",e.nextTick(()=>{if(x.value){const i=x.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}St("sendComment")})},fo=(o,l)=>{if(!(!M.commentUser||!o.user||o.user.id!==M.commentUser.id)){if(Qe.value=Qe.value.filter((s,i)=>i!==l),hn.value!==null&&v.value){const s=String(hn.value),i=v.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(i&&Qe.value.length>0){const c=[],d=new Set;Qe.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?i.setAttribute("data-comment-user",JSON.stringify(c[0])):i.removeAttribute("data-comment-user"),c.length>1?i.setAttribute("data-comment-user-2",JSON.stringify(c[1])):i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count",String(Qe.value.length))}else i&&Qe.value.length===0&&(i.removeAttribute("data-comment-user"),i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count","0"))}if(fe("comment-deleted",{comment:o,index:l,commentId:hn.value}),M.comments&&Array.isArray(M.comments)){const s=M.comments.filter(i=>!(i.commentId===o.commentId&&i.text===o.text&&i.user?.id===o.user?.id));fe("update:comments",s)}e.nextTick(()=>{St("deleteComment")})}},Uo=o=>{if(!o||!v.value)return!1;try{const l=vo(o);if(!l)return!1;const s=l.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i)return!!i.closest("[data-comment], [data-fake-comment]")}catch{}return!1},vo=o=>{if(!o||!v.value)return null;try{const l=document.createRange();if(o.type==="element"&&o.element)return v.value.contains(o.element)?(l.setStart(o.element,o.offset),l.collapse(!0),l):null;let s=0;const i=[v.value];let c=null,d=!1,u=!1;for(;!u&&(c=i.pop());)if(c.nodeType===3){const m=s+c.length;!d&&o.start>=s&&o.start<=m&&(l.setStart(c,o.start-s),d=!0),d&&o.end>=s&&o.end<=m&&(l.setEnd(c,o.end-s),u=!0),s=m}else{let m=c.childNodes.length;for(;m--;)i.push(c.childNodes[m])}return d?l:null}catch{return null}},go=(o,l)=>{if(!(!o||!l||!v.value))try{const s=vo(l);if(!s||s.collapsed)return;const i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;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=s.startContainer,f=s.endContainer,k=s.startOffset,A=s.endOffset,R=m.nodeType===3?m.parentNode:m,E=f.nodeType===3?f.parentNode:f;if(R===E&&k===0&&A===(f.nodeType===3?f.length:E.childNodes.length)&&(R.tagName==="P"||R.tagName==="DIV"||R.tagName==="H1"||R.tagName==="H2"||R.tagName==="H3"||R.tagName==="H4"||R.tagName==="H5"||R.tagName==="H6")){const G=s.extractContents();d.appendChild(G),s.insertNode(d)}else s.surroundContents(d)}catch{const f=s.extractContents();d.appendChild(f),s.insertNode(d)}const u=v.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{St("wrapSelectionWithCommentMarker"),_t()})}catch{}},Vo=o=>{if(!o||!o.commentId)return;const l=Array.isArray(M.comments)?[...M.comments]:[],s=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let i=l.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(s)||d.conversation_id===s);const c={text:o.text,user:o.user,createdAt:o.createdAt,created_at:o.createdAt,updated_at:o.createdAt};if(i>=0){const d=l[i];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(f=>f.article_id)?.article_id||null,m={conversation_id:s,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)}Zt.value=!0,fe("update:comments",l)},Xo=(o,l=[])=>{if(!M.commentUser||M.disabled||!M.richText||!v.value)return;const s=v.value;let i=null;try{i=s.querySelector(o)}catch{return}if(!i)return;un(),s.focus();const c=document.createRange();c.selectNodeContents(i);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),q.value=i.innerHTML||"",ue.value=Gt();const u=c.getBoundingClientRect(),m=s.parentElement;if(m){const A=m.getBoundingClientRect(),R=u.bottom-A.top,se=Math.max(R+8,0);y.value={top:`${se}px`,bottom:"auto"}}const f=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");let k=[];if(f&&M.comments&&Array.isArray(M.comments)){const A=M.comments.find(R=>String(R.conversation_id)===String(f));if(A&&A.conversation&&Array.isArray(A.conversation)){const R=A.conversation.map(E=>({id:E.id||E.commentary_id,commentary_id:E.id||E.commentary_id,conversation_id:A.id||A.conversation_id,text:E.text,user:E.user,createdAt:E.created_at||E.createdAt,updated_at:E.updated_at||E.updatedAt}));k.push(...R)}}k.length===0&&Array.isArray(l)&&l.length>0&&(k=l.slice()),k.sort((A,R)=>{const E=qe=>{if(!qe)return 0;const Me=new Date(qe).getTime();return isNaN(Me)?0:Me},se=E(A.createdAt),G=E(R.createdAt);return se===G?0:se-G}),Qe.value=k,Tl(!0),hn.value=f||null,i&&(jn.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(h.value="",x.value){const A=x.value;A.style.height="auto",A.style.height=`${A.scrollHeight}px`,A.focus()}if(m){const A=m.querySelector(".dss-comment-overlay");if(A){const R=m.querySelector(".dss-text-editor-footer");if(R){const E=m.getBoundingClientRect(),se=A.getBoundingClientRect(),G=R.getBoundingClientRect(),qe=se.bottom-E.top,Me=G.top-E.top,yt=8;if(qe>Me-yt){const dn=G.height;y.value={bottom:`${dn+yt}px`,top:"auto"}}}}}St("openCommentOverlayForSelector")})},ho=e.ref(null),Jl=e.ref(0),Yo=o=>{if(!(M.disabled||!M.richText)){if(o.key==="Escape"){const l=window.getSelection();if(l.rangeCount>0){const i=l.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value&&v.value.contains(c))){o.preventDefault();let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.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(()=>{Bl()},50);return}}}if(o.key.length===1||o.key==="Enter"){const l=window.getSelection();if(l&&l.rangeCount>0){const s=l.getRangeAt(0),i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const m=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,f=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(m)&&m!==u||d.contains(f)&&f!==u){o.preventDefault();const k=document.createRange();k.setStartAfter(d),k.collapse(!0),l.removeAllRanges(),l.addRange(k);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const l=window.getSelection();if(l.rangeCount>0){const s=l.getRangeAt(0);let i=null,c=null;if(s.collapsed)if(o.key==="Backspace"){const d=s.startContainer;let u=d;d.nodeType===3&&(s.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"&&(i=m,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const d=s.startContainer;let u=d;d.nodeType===3&&(s.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"&&(i=m,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const d=s.commonAncestorContainer,u=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,m=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(i=d,c=i.closest(".dss-image-wrapper")):(i=d.querySelector("img"),i&&(c=i.closest(".dss-image-wrapper"))),c){const f=c.contains(u)||u===c,k=c.contains(m)||m===c,R=s.cloneContents().textContent?.trim()||"",E=c.textContent?.trim()||"";(!f||!k||R.length>E.length)&&(c=null,i=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(()=>{_t()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?xn():ul();return}if(o.key==="Enter"){const l=window.getSelection();if(l.rangeCount>0){const s=l.getRangeAt(0);if(s.collapsed){const u=s.startContainer,m=f=>{if(!f)return!1;let k=f.previousSibling;for(;k;){if(k.classList&&k.classList.contains("dss-image-wrapper")||k.tagName==="IMG"||k.querySelector&&k.querySelector(".dss-image-wrapper")||k.querySelector&&k.querySelector("img"))return!0;k=k.previousSibling}const A=f.parentElement;return A&&A!==v.value?m(A):!1};if(u.nodeType===3){const f=u.parentElement;if(f&&(m(f)||m(u))){const k=f.closest("p, div");if(k&&k!==v.value){o.preventDefault(),o.stopPropagation();let A=null;const R=s.startOffset;R<u.length&&(A=u.splitText(R));const E=document.createElement("p");if(A?E.appendChild(A):E.innerHTML="<br>",u.length===0){const G=u.parentElement;G&&(G.removeChild(u),G.childNodes.length===0&&G.appendChild(document.createElement("br")))}k.nextSibling?k.parentNode.insertBefore(E,k.nextSibling):k.parentNode.appendChild(E);const se=document.createRange();A?se.setStart(A,0):se.setStart(E,0),se.collapse(!0),l.removeAllRanges(),l.addRange(se),e.nextTick(()=>{_t()});return}}}}const i=s.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value&&v.value.contains(c))){let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const m=G=>{if(!G)return!1;const qe=G.textContent||"",yt=(G.innerHTML||"").trim(),dn=yt.replace(/<br\s*\/?>/gi,"").trim();return qe.trim()===""||yt===""||dn===""||yt==="<br>"||yt==="<br/>"||yt==="<p></p>"||yt==="<p><br></p>"||yt==="<p><br/></p>"||yt==="<p> </p>"||yt==="<p><br> </p>"||yt==="<div></div>"||yt==="<div><br></div>"||yt==="<div><br/></div>"},f=c.lastChild,k=f&&f.nodeType===1&&f.tagName==="BR",A=s.startContainer,R=A.nodeType===3?A.parentElement:A,E=R===c||R&&R.parentElement===c;if(u&&m(u)||k&&E){o.preventDefault(),setTimeout(()=>{Bl()},50);return}}}}if(o.key===" "){const l=Date.now(),s=l-Jl.value;if(ho.value===" "&&s<300){const i=window.getSelection();if(i.rangeCount>0){const c=i.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(),ul();return}}}}ho.value=" ",Jl.value=l}else ho.value=o.key}},yo=o=>{if(M.disabled||!M.richText)return;o.preventDefault();let l=o.clipboardData.getData("text/html"),s=o.clipboardData.getData("text/plain");l&&(l=l.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),ve();const i=window.getSelection();let c=null;if(i&&i.rangeCount>0){let m=i.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 f=new DOMParser().parseFromString(u,"text/html");let k=v.value.querySelector("h1")?1:0;if(f.querySelectorAll("h1").forEach(R=>{if(k>0){const E=f.createElement("p");E.innerHTML=R.innerHTML,R.parentNode.replaceChild(E,R)}else k++}),c){const R=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],E=Array.from(f.body.children).filter(se=>R.includes(se.tagName));if(E.length===1){const se=E[0].tagName,G=c.tagName,qe=c.textContent.trim()===""&&!c.querySelector("img");let Me=!1;if(["H1","H2","H3","H4","H5","H6"].includes(G)?Me=!0:qe||(se===G||se==="P")&&(Me=!0),Me)return E[0].innerHTML.trim()}}return f.body.innerHTML.trim()};if(l){const u=d(l);document.execCommand("insertHTML",!1,u)}else if(s)if(/<[a-z][\s\S]*>/i.test(s)){const m=d(s);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,s);_t()},Tn=o=>{if(we.value){const s=o.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&un()}if(tt.value){const s=o.target,i=s.closest(".dss-floating-toolbar"),c=v.value&&s.closest(".dss-text-editor-content");!i&&!c&&Il()}if(ot.value){const s=o.target,i=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!i&&!c&&bl()}const l=o.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(Ye.value=null),!v.value||!l.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const i=s.getRangeAt(0);K.value=!i.collapsed&&_l(i)}else K.value=!1}if(hn.value!==null){const s=document.querySelector(".dss-comment-overlay");let i=!1;if(s){const u=s.getBoundingClientRect(),m=o.clientX,f=o.clientY;i=m>=u.left&&m<=u.right&&f>=u.top&&f<=u.bottom}const c=l.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!i&&!d&&(hn.value=null,h.value="",q.value="",ue.value=null,Qe.value=[],Tl(!0))}},P=(o,l)=>{o&&o.stopPropagation&&o.stopPropagation(),wt.value&&(clearTimeout(wt.value),wt.value=null),Ye.value=l},En=o=>{const l=o.relatedTarget;if(l){const s=l.closest(".dss-toolbar-dropdown-submenu"),i=l.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||i)return}wt.value&&clearTimeout(wt.value),wt.value=setTimeout(()=>{Ye.value=null,wt.value=null},150)},Kn=o=>{Ye.value=null};let Xl=0;const Sn=o=>{if(!o)return;const l=Array.from(o.children);l.forEach(s=>{s.classList.contains("dss-toolbar-dropdown-submenu")||s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(s.tagName==="BUTTON"||s.tagName==="DIV")&&!s.classList.contains("dss-toolbar-dropdown-item")&&s.classList.add("dss-toolbar-dropdown-item")}),l.forEach((s,i)=>{if(s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||s.classList.contains("dss-toolbar-dropdown-submenu")||!s.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(s.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(k=>k.tagName==="BUTTON"||k.tagName==="DIV").length>0:!1),d=s.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-${++Xl}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",m);let f=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),f=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),f=d),f&&(f.setAttribute("data-submenu-id",m),f.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?f.dataset.originalParentRef="inside":f.dataset.originalParentRef="sibling",Array.from(f.children).forEach(A=>{(A.tagName==="BUTTON"||A.tagName==="DIV")&&!A.classList.contains("dss-toolbar-dropdown-item")&&A.classList.add("dss-toolbar-dropdown-item")}))}})},wn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{Sn(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=f=>{const k=c.getAttribute("data-submenu-id");k&&P(f,k)},m=En;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=k=>{const A=c.getAttribute("data-submenu-id");A&&P(k,A)},m=En;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(k=>{k.addEventListener("click",Kn)})})})};let Kt=null;const nn=()=>{if(Ye.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Ye.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Ye.value}"]`);o&&l&&Zn(o,l)}if(tt.value&&Jt(),M.richText){if(Kt!==null)return;Kt=setTimeout(()=>{Kt=null,St("handleWindowResize")},150)}},Gn=()=>{if(!M.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(l=>{Array.from(l.children).filter(i=>i.tagName==="DIV"&&!i.classList.contains("dss-toolbar-button")).forEach(i=>{i.classList.add("dss-toolbar-button")})})},Ml=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),l=s=>{if(s.preventDefault(),s.stopPropagation(),window.getSelection){const i=window.getSelection();i.removeAllRanges?i.removeAllRanges():i.empty&&i.empty()}return!1};o.forEach(s=>{s.addEventListener("selectstart",l),s.addEventListener("mousedown",l),s.addEventListener("dragstart",l),s.addEventListener("contextmenu",l),s.addEventListener("click",i=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{sn.value?te():pt(),S.value?it():qt()})}),e.nextTick(()=>{Ml()}),M.richText&&v.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Tn),window.addEventListener("resize",nn);let o=null;const l=()=>{o===null&&(o=setTimeout(()=>{o=null,nn()},150))};window.addEventListener("scroll",l,!0),v.value._windowScrollHandler=l,v.value._windowScrollTimeout=o,v.value.closest(".editor-with-comments"),v.value.closest(".dss-text-editor-content-wrapper");const s=v.value.closest(".dss-text-editor-content");let i=null;const c=()=>{i===null&&(i=setTimeout(()=>{i=null,nn()},150))};s&&(s.addEventListener("scroll",c),v.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{wn(),Gn()}),v.value.addEventListener("click",m=>{const f=m.target;f.closest("a")&&!M.disabled&&m.preventDefault();const A=f.closest(".dss-image-no-alt-icon"),R=f.closest(".dss-image-wrapper");if(A||R&&f===R){m.preventDefault(),m.stopPropagation();const E=window.getSelection(),se=document.createRange();se.setStartAfter(R),se.collapse(!0),E.removeAllRanges(),E.addRange(se)}else R&&f.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const E=window.getSelection();if(E.rangeCount>0){const G=E.getRangeAt(0).commonAncestorContainer,qe=G.nodeType===3?G.parentElement:G;if(R.contains(qe)&&qe!==R.querySelector("img")){const Me=document.createRange();Me.setStartAfter(R),Me.collapse(!0),E.removeAllRanges(),E.addRange(Me)}}else{const se=document.createRange();se.setStartAfter(R),se.collapse(!0),E.addRange(se)}}))},!0),v.value.addEventListener("mousedown",m=>{const f=m.target,k=f.closest(".dss-image-no-alt-icon"),A=f.closest(".dss-image-wrapper");if(k||A&&f.tagName!=="IMG"){m.preventDefault();const R=window.getSelection(),E=document.createRange();A&&(E.setStartAfter(A),E.collapse(!0),R.removeAllRanges(),R.addRange(E))}},!0),v.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!v.value)return;v.value.querySelectorAll("img").forEach(k=>{if(!k.closest(".dss-image-wrapper"))k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="";else{const R=k.getAttribute("alt")||k.alt||"";if(R){const E=k.getAttribute("src")||k.src||"",se=E.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),G=R===E||R===se;(R.startsWith("http://")||R.startsWith("https://")||R.startsWith("data:")||G||G)&&(k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="")}}}),je()})}),v.value.addEventListener("dragstart",m=>{const f=m.target,k=f.tagName==="IMG"?f:f.closest("img"),A=k?.closest(".dss-image-wrapper");k&&v.value.contains(k)&&(at.value=A||k,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),v.value.addEventListener("dragover",m=>{at.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),v.value.addEventListener("dragenter",m=>{at.value&&(m.preventDefault(),m.stopPropagation())}),v.value.addEventListener("drop",m=>{if(!at.value||!v.value)return;m.preventDefault(),m.stopPropagation();const f=at.value,k=f.classList?.contains("dss-image-wrapper"),A=k?f.querySelector("img"):f,R=k?f:A?.closest(".dss-image-wrapper");if(!A||!v.value.contains(A)){at.value=null;return}let E=null;const se=m.clientX,G=m.clientY;if(document.caretRangeFromPoint)E=document.caretRangeFromPoint(se,G);else{const an=window.getSelection();an.rangeCount>0?E=an.getRangeAt(0).cloneRange():(E=document.createRange(),E.selectNodeContents(v.value),E.collapse(!1))}if(!E){at.value=null;return}const qe=E.commonAncestorContainer,Me=qe.nodeType===3?qe.parentElement:qe;if(Me?.closest(".dss-image-wrapper")===R||R&&R.contains(Me)){at.value=null;return}if(R&&(Me===R||R.contains(Me))){at.value=null;return}const dn=A.getAttribute("src");let mn=null;R?mn=R.cloneNode(!0):mn=A.cloneNode(!0);try{let an=E.startContainer;if(an.nodeType===3&&(an=an.parentElement),R&&(an===R||R.contains(an))){const fn=document.createRange();fn.setStartAfter(R),fn.collapse(!0),E=fn}E.insertNode(mn);const Ut=document.createRange();Ut.setStartAfter(mn),Ut.collapse(!0);const kn=window.getSelection();kn.removeAllRanges(),kn.addRange(Ut)}catch{if(v.value.childNodes.length===0){const Ut=document.createElement("p");Ut.appendChild(mn),v.value.appendChild(Ut)}else{const Ut=v.value.lastChild;if(Ut&&Ut.nodeType===1)Ut.appendChild(mn);else{const kn=document.createElement("p");kn.appendChild(mn),v.value.appendChild(kn)}}}R?R.remove():A.remove(),at.value=null,e.nextTick(()=>{const an=v.value.querySelectorAll("img");let Ut=!1;an.forEach(kn=>{if(kn.getAttribute("src")===dn)if(!Ut)Ut=!0;else{const fn=kn.closest(".dss-image-wrapper");fn?fn.remove():kn.remove()}}),je(),_t()})}),v.value.addEventListener("dragend",m=>{at.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(f=>{f.addedNodes.forEach(k=>{if(k.nodeType===1){k.tagName==="IMG"&&(k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="");const A=k.querySelectorAll&&k.querySelectorAll("img");A&&A.forEach(R=>{R.removeAttribute("alt"),R.removeAttribute("data-alt"),R.setAttribute("alt",""),R.setAttribute("data-alt",""),R.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{je(),Gn(),d=null},100)});if(u.observe(v.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const f=new MutationObserver(()=>{e.nextTick(()=>{Gn()})});f.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=f}}),M.modelValue){const m=zn(M.modelValue);v.value.innerHTML=m,Rn()}e.nextTick(()=>{const m=v.value.innerHTML||"",f=M.title||"",k=M.description||"";Tt.value=m,le.value=f,W.value=k,U.value=f,ie.value=k,Mn(),je(),ol(),ut(),bo(),xl()}),Bn(),Wt(),v.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Tn),window.removeEventListener("resize",nn),v.value&&v.value._windowScrollHandler&&window.removeEventListener("scroll",v.value._windowScrollHandler,!0),Kt!==null&&(clearTimeout(Kt),Kt=null),v.value&&v.value._windowScrollTimeout!==null&&clearTimeout(v.value._windowScrollTimeout),Ue.value&&clearTimeout(Ue.value),wt.value&&clearTimeout(wt.value),v.value&&v.value._mutationObserver&&v.value._mutationObserver.disconnect(),He.value&&He.value.disconnect(),Ct.value!==null&&(cancelAnimationFrame(Ct.value),Ct.value=null),st.value!==null&&(clearTimeout(st.value),st.value=null),Et.value!==null&&(clearTimeout(Et.value),Et.value=null),Tl(!0),v.value&&v.value._scrollHandlers){const{wrapper:l,content:s,handler:i}=v.value._scrollHandlers;l&&l.removeEventListener("scroll",i),s&&s.removeEventListener("scroll",i)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const Pt=o=>{const l=o.target,s=l.closest("a");if(s&&!M.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(s);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const i=l.closest(".dss-image-wrapper");i&&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(i.contains(m)&&m!==i.querySelector("img")){const f=document.createRange();f.setStartAfter(i),f.collapse(!0),c.removeAllRanges(),c.addRange(f)}}je(),Bn(),Wt(),Jt(),ut()}):e.nextTick(()=>{je(),Bn(),Wt(),Jt(),ut()})},Rt=()=>{gt();const o=window.getSelection();if(o&&o.rangeCount>0){const s=o.getRangeAt(0);K.value=!s.collapsed&&_l(s),!s.collapsed&&b.value&&(b.value=null)}else K.value=!1;if(je(),Bn(),Wt(),Jt(),ut(),o&&o.rangeCount>0){const i=o.getRangeAt(0).commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c&&c.closest(".dss-text-editor-footer")){o.removeAllRanges(),K.value=!1;return}}["bold","italic","underline"].forEach(s=>{try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(!c.collapsed)if(s==="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 f=window.getComputedStyle(u);parseInt(f.fontWeight)>=600&&(m=!0)}catch{}re.value[s]=m}else{const d=document.queryCommandState(s);re.value[s]=d}}}catch{}})},ut=()=>{if(!M.richText||M.disabled||!v.value){V.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){V.value="p";return}const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i||!v.value.contains(i)){V.value="p";return}const c=i.closest("h1, h2, h3, h4, h5, h6, p");if(!c){V.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?V.value=d:V.value="p"}catch{V.value="p"}},Wt=()=>{if(!v.value){Xe.value=!1;return}try{const o=window.getSelection();let l=!1;if(o.rangeCount>0){const i=o.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");l=!!(c&&v.value.contains(c))}Xe.value=l}catch{Xe.value=!1}},_l=o=>{if(!o||!v.value)return!1;const l=o.commonAncestorContainer;if(!l)return!1;const s=l.nodeType===3?l.parentElement:l;return s?v.value.contains(s):!1},Il=()=>{tt.value=!1},Jt=()=>{if(!M.floatingToolbar||!M.richText||M.disabled){tt.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){tt.value=!1;return}const l=o.getRangeAt(0);if(l.collapsed||!_l(l)){tt.value=!1;return}const s=l.getBoundingClientRect();if(!s||s.width===0&&s.height===0){tt.value=!1;return}const i=v.value;if(!i){tt.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){tt.value=!1;return}const d=40,u=8,m=s.top-d/2+15;let f=s.left+s.width/2;const k=window.innerWidth||document.documentElement.clientWidth||0;let A=0;nt.value&&(A=nt.value.getBoundingClientRect().width);const R=(A||320)/2;let E=c.left+R,se=c.right-R;if(se<E){const G=c.left+c.width/2;E=G,se=G}if(k>0){const G=R+u,qe=k-R-u;if(E=Math.max(E,G),se=Math.min(se,qe),se<E){const Me=k/2;E=Me,se=Me}}f<E?f=E:f>se&&(f=se),Ce.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${f}px`,transform:"translate(-50%, -100%)",zIndex:10003},tt.value=!0},eo=o=>{M.disabled||!M.richText||(ot.value=ot.value===o?null:o,o==="askAi"&&(we.value=null))},bl=()=>{ot.value=null,Ye.value=null},dl=o=>{Pn(o),bl()};let al=null,zl=null,wl=null,Pl=null;const $l=o=>{if(M.disabled||!M.richText){In(),Yl();return}const l=o.target,s=l.closest("a"),i=l.closest("img");if(al&&(clearTimeout(al),al=null),wl&&(clearTimeout(wl),wl=null),s&&s!==zl){Yl(),zl=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),We.value=s,me.value=c,X.value=!0,Se.value=!0,Bo(s)}else!s&&zl?(zl=null,al=setTimeout(()=>{Se.value||In()},150)):s&&s===zl&&Bo(s);if(i&&i!==Pl){In(),Pl=i;let c=i.getAttribute("alt");c===null&&(c=i.alt||"");let d=i.getAttribute("data-alt");d===null&&(d=c),i.hasAttribute("alt")||i.setAttribute("alt",c),i.hasAttribute("data-alt")||i.setAttribute("data-alt",d),Y.value=i,Pe.value=c.trim()||D("textEditor.image.noAlt"),xe.value=!0,ge.value=!0,Ol(i)}else!i&&Pl?(Pl=null,wl=setTimeout(()=>{ge.value||Yl()},150)):i&&i===Pl&&Ol(i)},No=o=>{const l=o.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(zl=null,Pl=null,al&&(clearTimeout(al),al=null),wl&&(clearTimeout(wl),wl=null),In(),Yl())},In=()=>{Se.value=!1,setTimeout(()=>{Se.value||(X.value=!1,me.value="",Ae.value||(We.value=null))},100)},Bo=o=>{if(!o||!v.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;F.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Yl=()=>{ge.value=!1,setTimeout(()=>{ge.value||(xe.value=!1,Pe.value="",kt.value||(Y.value=null))},100)},Ol=o=>{if(!o||!v.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;j.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},jo=()=>{if(!me.value||!We.value)return;let l=We.value.getAttribute("href")||me.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},Mo=()=>{if(We.value){const o=We.value.textContent||"",l=We.value.getAttribute("href")||"",s=We.value;lt.value=l,ft.value=o,_e.value=o,Se.value=!1,X.value=!1,me.value="",We.value=s,Ae.value=!0}else if(ke.value){const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(i){const c=i.textContent||"",d=i.getAttribute("href")||"";lt.value=d,ft.value=c,_e.value=c,We.value=i,Ae.value=!0}}}else{Ee.value=Gt();const o=window.getSelection();let l="";o.rangeCount>0&&(l=o.getRangeAt(0).toString()),lt.value="",ft.value=l,_e.value="",We.value=null,Ae.value=!0}e.nextTick(()=>{Z.value&&(Z.value.focus(),Z.value.select())})},to=()=>{Ae.value=!1,lt.value="",ft.value="",_e.value="",We.value=null,Ee.value=null},no=()=>{if(!lt.value.trim()){to();return}if(Oe.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),ve(),Oe.value=!1):ve(),ft.value.trim()||(ft.value=lt.value.trim()),We.value&&v.value&&v.value.contains(We.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const l=We.value;if(l.setAttribute("href",lt.value.trim()),ft.value.trim()!==_e.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=ft.value.trim()}l.style.color="#60afdf",l.style.textDecoration="underline";const s=document.createRange();s.selectNodeContents(l),s.collapse(!1),o.removeAllRanges(),o.addRange(s),_t()}else if(v.value){v.value.focus();const o=window.getSelection();o.removeAllRanges(),Ee.value&&Ln(Ee.value);let l=null;if(o.rangeCount>0&&(l=o.getRangeAt(0)),l&&!l.collapsed){l.toString();const s=document.createElement("a");s.href=lt.value.trim(),s.textContent=ft.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",l.deleteContents(),l.insertNode(s);const i=document.createTextNode(" ");l.setStartAfter(s),l.insertNode(i),l.setStartAfter(i),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}else{l||(l=document.createRange(),l.selectNodeContents(v.value),l.collapse(!1));const s=l.startContainer,i=s.nodeType===3,c=i&&l.startOffset===s.textContent.length,d=document.createElement("a");if(d.href=lt.value.trim(),d.textContent=ft.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=s.parentElement;for(;u&&u!==v.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==v.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const f=document.createTextNode(" ");m.appendChild(f);const k=document.createRange();k.setStartAfter(d),k.collapse(!0),o.removeAllRanges(),o.addRange(k)}else{if(l.startOffset>0){const k=s.textContent.substring(0,l.startOffset),A=k[k.length-1];if(A&&A!==" "&&A!==" "&&A!==`
|
|
100
|
+
</svg>`,v=e.ref(null),we=e.ref(null),Ce=e.ref(!1),Q=e.ref(!1),Y=e.ref(!1),me=e.ref(""),F=e.ref({}),Ee=e.ref(!1),Ae=e.ref(!1),tt=e.ref(""),ft=e.ref(""),Z=e.ref(null),De=e.ref(null),We=e.ref(null),xe=e.ref(null),_e=e.ref(""),je=e.ref(!1),se=e.ref({}),et=e.ref(!1),ke=e.ref({}),nt=e.ref(null),ut=e.ref(null),st=e.ref(!1),Vt=e.ref(""),zt=e.ref(null),Ht=e.ref(""),Nt=e.ref(""),bt=e.ref(""),Jt=e.ref(null),dt=e.ref(null),en=e.ref(null),Ct=e.ref(null),ee=e.ref(null),ve=e.ref(!1),Ne=e.ref(""),q=e.ref({}),ge=e.ref(!1),Be=e.ref("upload"),Fe=e.ref(""),Ue=e.ref(null),wt=e.ref(null),Ge=e.ref([]),Xt=e.ref([]),Ze=e.ref(null),Pe=e.ref(!1),Tt=e.ref(""),Lt=e.ref(""),le=e.ref(""),U=e.ref(""),X=e.ref(""),ie=e.ref(""),ye=e.ref(null),Ke=e.ref(null),At=e.ref(null),Yt=e.ref(!1),lt=e.ref(null),sn=e.ref(!1),S=e.ref(!1),b=e.ref(null),V=e.ref("p"),j=e.ref(!1),oe=e.ref([]),He=e.ref(null),kt=e.ref(null),ot=e.ref(null),ze=e.ref(!1),xt=e.ref(0),Mt=100,Et=e.ref(null),it=e.computed(()=>!!M.commentUser),Dt=e.computed(()=>({"dss-text-editor-no-border":!M.border,"dss-text-editor-rounded":M.rounded,"dss-text-editor-full-height":M.fullHeight,"dss-comment-overlay-open":it.value&&hn.value!==null})),Bt=e.computed(()=>({})),rn=e.computed(()=>!M.fixedHeight||M.fullHeight?{}:{height:`${1.6*14*M.rows+24+2}px`,resize:"none",overflowY:"auto"}),Vn=e.computed(()=>!M.fixedHeight||M.fullHeight?{}:{height:`${1.6*14*M.rows+32}px`,overflowY:"auto"}),Zn=e.computed(()=>M.richText&&Xt.value.length>0),tn=e.computed(()=>{if(!M.modelValue)return"";if(M.richText){let o=M.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/ /g," "),o=o.replace(/&/g,"&"),o=o.replace(/</g,"<"),o=o.replace(/>/g,">"),o=o.replace(/"/g,'"'),o=o.replace(/'/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return M.modelValue}),pn=e.computed(()=>{const o=tn.value.trim();return o?o.split(/\s+/).filter(l=>l.length>0).length:0}),ll=e.computed(()=>tn.value.length),vl=e.computed(()=>Ct.value!==null&&Be.value==="upload"&&Ht.value&&Ht.value.startsWith("data:")),il=e.computed(()=>M.titlePlaceholder||D("textEditor.placeholders.title")),_n=e.computed(()=>M.descriptionPlaceholder||D("textEditor.placeholders.description")),gl=e.computed(()=>M.placeholder||D("textEditor.placeholders.startTyping")),$n=o=>mt&&mt[o]!==void 0,Vl=o=>{for(let l=o+1;l<M.customToolbarSlots.length;l++)if($n(M.customToolbarSlots[l]))return!0;return!1},Rl=o=>{for(let l=o+1;l<M.customToolbarSlots.length;l++){const s=M.customToolbarSlots[l];if($n(s)&&hl(s))return!0}return!1},hl=o=>M.customToolbarFloatingMap.hasOwnProperty(o)?M.customToolbarFloatingMap[o]===!0:!0,An=e.computed(()=>M.customToolbarSlots.some(o=>$n(o)&&hl(o))),Un=e.computed(()=>$n("title-slot")),Xn=e.computed(()=>$n("description-slot")),Hn=o=>{if(!o||o.trim()==="")return"<html></html>";const l=o.trim();return l.startsWith("<html>")&&l.endsWith("</html>")?o:`<html>${o}</html>`},zn=o=>{if(!o||o.trim()==="")return"";const l=o.replace(/<!--[\s\S]*?-->/g,""),s=l.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():l},Nl=o=>{if(!o)return;const l=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),s=[];let i=l.nextNode();for(;i;)s.push(i),i=l.nextNode();s.forEach(c=>c.remove())},T=o=>{try{const l=String(o.getDate()).padStart(2,"0"),i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],c=o.getFullYear();return`${l} ${i} ${c}`}catch{return""}},I=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 i=l.toLowerCase();return i.includes("started conversation")||i.includes("démarré la conversation")||i==="started conversation"||i==="a démarré la conversation"},B=o=>{const l=o.target.value;fe("update:modelValue",l),fe("change",l)},te=()=>{if(!ye.value)return;const o=ye.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 i=o.value;o.value="M";const c=o.scrollHeight;o.value=i,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},Te=()=>{sn.value=!0,te()},vt=()=>{sn.value=!1,pt()},pt=()=>{if(!ye.value)return;const o=ye.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 s=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${s}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")},at=o=>{const s=o.target.value;sn.value&&te(),fe("update:title",s),fe("title-change",s),At.value="title",M.richText&&(Pe.value||(Lt.value=Tt.value,X.value=le.value,ie.value=U.value),Ze.value&&clearTimeout(Ze.value),Pe.value=!0,Ze.value=setTimeout(()=>{Pe.value=!1,he()},500))},rt=()=>{if(!Ke.value)return;const o=Ke.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 i=o.value;o.value="M";const c=o.scrollHeight;o.value=i,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},vn=()=>{S.value=!0,rt()},bn=()=>{S.value=!1,qt()},qt=()=>{if(!Ke.value)return;const o=Ke.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 s=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${s}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")},gn=o=>{const s=o.target.value;S.value&&rt(),fe("update:description",s),fe("description-change",s),At.value="description",M.richText&&(Pe.value||(Lt.value=Tt.value,X.value=le.value,ie.value=U.value),Ze.value&&clearTimeout(Ze.value),Pe.value=!0,Ze.value=setTimeout(()=>{Pe.value=!1,he()},500))},Kt=()=>{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 s=l.cloneRange();return s.selectNodeContents(v.value),s.setEnd(l.startContainer,l.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+l.toString().length}},Ln=o=>{if(!(!o||!v.value))try{const l=window.getSelection(),s=document.createRange();if(o.type==="element"&&o.element)if(v.value.contains(o.element)){s.setStart(o.element,o.offset),s.collapse(!0),l.removeAllRanges(),l.addRange(s);return}else{v.value.focus();return}let i=0;const c=[v.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const f=i+d.length;!u&&o.start>=i&&o.start<=f&&(s.setStart(d,o.start-i),u=!0),u&&o.end>=i&&o.end<=f&&(s.setEnd(d,o.end-i),m=!0),i=f}else{let f=d.childNodes.length;for(;f--;)c.push(d.childNodes[f])}l.removeAllRanges(),l.addRange(s)}catch{v.value.focus()}},Ft=()=>{if(!v.value)return;v.value.focus();const o=window.getSelection(),l=document.createRange(),s=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=s(u);if(m)return m}return c},i=s(v.value);if(i.nodeType===3)l.setStart(i,i.length),l.setEnd(i,i.length);else if(i.childNodes.length>0){const c=s(i);c&&c.nodeType===3?(l.setStart(c,c.length),l.setEnd(c,c.length)):(l.selectNodeContents(i),l.collapse(!1))}else l.setStart(i,0),l.setEnd(i,0);o.removeAllRanges(),o.addRange(l)},he=(o=!1)=>{if(!v.value)return;const l=v.value.innerHTML,s=M.title||"",i=M.description||"";if(!o&&l===Tt.value&&s===le.value&&i===U.value)return;const c={content:Lt.value||Tt.value,title:X.value!==void 0?X.value:le.value,description:ie.value!==void 0?ie.value:U.value},d=Ge.value.length>0?Ge.value[Ge.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&&(Ge.value.push(c),Ge.value.length>50&&Ge.value.shift(),Xt.value=[]),Tt.value=l,le.value=s,U.value=i,Lt.value=l,X.value=s,ie.value=i},_t=o=>{if(!v.value)return;gt(),v.value&&Nl(v.value);let l=null;v.value&&(v.value.querySelector("p")||(l=Kt(),Rn()));const s=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");s&&b.value&&(b.value=null),Q.value=!0;const i=v.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=Hn(i);fe("update:modelValue",c),fe("change",c),At.value="editor",Pe.value||(Lt.value=Tt.value,X.value=le.value,ie.value=U.value),Ze.value&&clearTimeout(Ze.value),Pe.value=!0,Ze.value=setTimeout(()=>{Pe.value=!1,he(),lo(),_o()},500),e.nextTick(()=>{l&&Ln(l),gt();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,f=m&&m.collapsed;if(d.forEach(k=>{try{if(f&&b.value?.command===k){se.value[k]=b.value.state;return}if(k==="bold")if(m){const A=m.commonAncestorContainer,R=A.nodeType===3?A.parentElement:A;let E=!1;if(R&&((R.tagName==="STRONG"||R.tagName==="B"||R.closest&&R.closest("strong, b"))&&(E=!0),!E&&R.style&&parseInt(R.style.fontWeight)>=600&&(E=!0),!E))try{const re=window.getComputedStyle(R);parseInt(re.fontWeight)>=600&&(E=!0)}catch{}se.value[k]=E}else se.value.hasOwnProperty(k)||(se.value[k]=!1);else if(k==="italic")if(m){const A=m.commonAncestorContainer,R=A.nodeType===3?A.parentElement:A,E=R&&(R.tagName==="EM"||R.tagName==="I"||R.closest&&R.closest("em, i"));se.value[k]=!!E}else{const A=document.queryCommandState(k);se.value[k]=A}else{const A=document.queryCommandState(k);se.value[k]=A}}catch{}}),Mn(),Xe(),ol(),Qt(),ct(),St("handleRichTextInput"),s&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const k=o.data||"";k&&k.length===1&&setTimeout(()=>_o(k),0),(k===" "||k===`
|
|
101
|
+
`||/[.,;:!?]/.test(k))&&setTimeout(()=>{lo()},100)}Q.value=!1})},gt=()=>{if(!v.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i)return;const c=i.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(i!==d&&!d?.contains(i)){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 f=document.createRange();f.setStartAfter(c),f.collapse(!0),o.removeAllRanges(),o.addRange(f)}}}},Rn=()=>{if(!v.value)return;const o=v.value;if(o.querySelector&&o.querySelector("p"))return;const l=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),s=Array.from(o.childNodes);let i=null;s.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}i||(i=document.createElement("p"),o.insertBefore(i,c)),i.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){i=null;return}if(l.has(u)){i=null;return}i||(i=document.createElement("p"),o.insertBefore(i,d)),i.appendChild(d)}})},Xe=()=>{if(v.value&&!Yt.value){Yt.value=!0;try{v.value.querySelectorAll(".dss-image-wrapper").forEach(i=>{i.querySelector("img")||i.remove()}),v.value.querySelectorAll(".dss-image-no-alt-icon").forEach(i=>{const c=i.parentElement;!c||!c.classList.contains("dss-image-wrapper")?i.remove():c.querySelector("img")||i.remove()}),v.value.querySelectorAll("img").forEach(i=>{let c=i.getAttribute("alt");c===null&&(c=i.alt||"");const d=i.getAttribute("src")||i.src||"";if(c){const k=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),A=c===d||c===k;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||A||A)&&(c="")}i.setAttribute("alt",c),i.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=i.parentElement;const f=m&&m.classList.contains("dss-image-wrapper");if(f){const k=m.querySelector(".dss-image-no-alt-icon");k&&k.remove()}else{const k=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;k&&k.remove()}if(u){f?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),i.parentNode.insertBefore(m,i),m.appendChild(i));const k=document.createElement("div");k.className="dss-image-no-alt-icon",k.setAttribute("contenteditable","false"),k.innerHTML=J,m.appendChild(k)}else if(f&&m.children.length===1){const k=m.parentNode;k.insertBefore(i,m),k.removeChild(m)}})}finally{Yt.value=!1}}},ht=o=>{lo(),fe("blur",o),Il()},ae=()=>{if(M.disabled||!M.richText||!v.value)return;un(),Ze.value&&(clearTimeout(Ze.value),Ze.value=null),Pe.value&&(he(),Pe.value=!1);const o=At.value==="title",l=At.value==="description",s=At.value==="editor";if(Ge.value.length===0){o&&ye.value?ye.value.focus():l&&Ke.value?Ke.value.focus():v.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{_t()});return}const i={content:v.value.innerHTML,title:M.title||"",description:M.description||""};Xt.value.push(i);const c=Ge.value.pop();if(c!==void 0){Q.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";v.value.innerHTML=d,Tt.value=d,le.value=u,U.value=m,Lt.value=d,X.value=u,ie.value=m,e.nextTick(()=>{Mn(),Bn(),Zt(),Qt();const f=Hn(d);fe("update:modelValue",f),fe("update:title",u),fe("update:description",m),fe("change",f),fe("title-change",u),fe("description-change",m),Q.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(ye.value){ye.value.focus();const k=u.length;ye.value.setSelectionRange&&ye.value.setSelectionRange(k,k),te()}}else if(l){if(Ke.value){Ke.value.focus();const k=m.length;Ke.value.setSelectionRange(k,k)}}else if(s)Ft();else if(ye.value&&document.activeElement===ye.value){const k=u.length;ye.value.setSelectionRange&&ye.value.setSelectionRange(k,k),te()}else if(Ke.value&&document.activeElement===Ke.value){const k=m.length;Ke.value.setSelectionRange(k,k)}else v.value&&Ft()},10)})})}},on=()=>{if(M.disabled||!M.richText||!v.value)return;un();const o=At.value==="title",l=At.value==="description",s=At.value==="editor";if(Xt.value.length===0){o&&ye.value?ye.value.focus():l&&Ke.value?Ke.value.focus():v.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{_t()});return}const i={content:v.value.innerHTML,title:M.title||"",description:M.description||""};Ge.value.push(i);const c=Xt.value.pop();if(c!==void 0){Q.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";v.value.innerHTML=d,Tt.value=d,le.value=u,U.value=m,Lt.value=d,X.value=u,ie.value=m,e.nextTick(()=>{Mn(),Bn(),Zt(),Qt();const f=Hn(d);fe("update:modelValue",f),fe("update:title",u),fe("update:description",m),fe("change",f),fe("title-change",u),fe("description-change",m),Q.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(ye.value){ye.value.focus();const k=u.length;ye.value.setSelectionRange&&ye.value.setSelectionRange(k,k),te()}}else if(l){if(Ke.value){Ke.value.focus();const k=m.length;Ke.value.setSelectionRange(k,k)}}else if(s)Ft();else if(ye.value&&document.activeElement===ye.value){const k=u.length;ye.value.setSelectionRange&&ye.value.setSelectionRange(k,k),te()}else if(Ke.value&&document.activeElement===Ke.value){const k=m.length;Ke.value.setSelectionRange(k,k)}else v.value&&Ft()},10)})})}},Ie=()=>{if(!v.value)return;v.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{const c=i.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),v.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{if(parseInt(i.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),v.value.querySelectorAll("b, strong").forEach(i=>{i.style.fontWeight="600"})},ol=()=>{if(!v.value)return;v.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},cn=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let s=!1;if(l.collapsed){const i=l.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==v.value;){if(c.tagName==="EM"||c.tagName==="I"){s=!0;break}if(c.style&&c.style.fontStyle==="italic"){s=!0;break}c=c.parentElement}}else{const i=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,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!==v.value;){if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}}if(s)break}}}if(s)return document.execCommand("italic",!1),e.nextTick(()=>{ol()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{ol()});else try{const i=l.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(i),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{ol()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{ol()})}return!0},yl=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let s=!1;if(l.collapsed){const i=l.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==v.value;){if(c.tagName==="STRONG"||c.tagName==="B"){s=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){s=!0;break}c=c.parentElement}}else{const i=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,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!==v.value;){if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}}if(s)break}}}if(s)return document.execCommand("bold",!1),e.nextTick(()=>{Ie()}),!1;if(l.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==v.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const f=document.createElement("b");f.style.fontWeight="600";const k=document.createDocumentFragment();for(;u.firstChild;)k.appendChild(u.firstChild);f.appendChild(k),u.parentNode&&u.parentNode.replaceChild(f,u),c.setStart(f,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===v.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c)}}Ie()});else try{const i=l.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(i),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{Ie()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Ie()})}return!0},Nn=(o,l=null)=>{if(M.disabled||!M.richText||!v.value)return;Pe.value?(Ze.value&&(clearTimeout(Ze.value),Ze.value=null),he(),Pe.value=!1):he(),un(),v.value.focus();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&_l(d)&&(i=Kt())}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 f=document.createTextNode(l);u.insertNode(f),u.selectNodeContents(f)}}}if(o==="bold"){const d=yl();se.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(b.value={command:"bold",state:d}),e.nextTick(()=>{i&&(Ln(i),e.nextTick(()=>{const m=Gt("bold");se.value.bold=m})),_t(),Bn(),Qt()});return}if(o==="italic"){const d=cn();se.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(b.value={command:"italic",state:d}),e.nextTick(()=>{i&&(Ln(i),e.nextTick(()=>{const m=Gt("italic");se.value.italic=m})),_t(),ol(),Bn(),Qt()});return}let c=!1;try{c=document.execCommand(o,!1,l)}catch{}e.nextTick(()=>{if(i&&Ln(i),["bold","italic","underline"].includes(o))try{if(o==="bold")i&&e.nextTick(()=>{const u=Gt("bold");se.value.bold=u});else if(o==="italic")if(i)e.nextTick(()=>{const u=Gt("italic");se.value.italic=u});else{const u=document.queryCommandState(o);se.value[o]=u}else{const u=document.queryCommandState(o);se.value[o]=u}}catch{se.value.hasOwnProperty(o)?se.value[o]=!se.value[o]:se.value[o]=!0}if(o==="createLink"&&l){const u=window.getSelection();if(u.rangeCount>0){const f=u.getRangeAt(0),k=f.commonAncestorContainer.nodeType===1?f.commonAncestorContainer.closest("a"):f.commonAncestorContainer.parentElement?.closest("a");k&&(!k.getAttribute("href")||k.getAttribute("href")==="")&&k.setAttribute("href",l)}v.value.querySelectorAll("a").forEach(f=>{const k=f.getAttribute("href");(!k||k===""||k==="#")&&f.setAttribute("href",l)})}_t(),Bn(),Qt()})},Gt=(o,l=null)=>{if(M.disabled||!v.value)return!1;try{if(o==="formatBlock"&&l){const i=document.queryCommandValue("formatBlock");if(l==="<blockquote>"){const c=i.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 i===l||i.toLowerCase()===l.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,f=m.nodeType===3?m.parentElement:m;if(f&&((f.tagName==="STRONG"||f.tagName==="B"||f.closest&&f.closest("strong, b"))&&(u=!0),!u&&f.style&&parseInt(f.style.fontWeight)>=600&&(u=!0),!u))try{const k=window.getComputedStyle(f);parseInt(k.fontWeight)>=600&&(u=!0)}catch{}return se.value.hasOwnProperty(o)?se.value[o]:(se.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let f=!1;if(m){const k=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let A;for(;A=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(A))){if(A.nodeType===3){if(!(A.textContent||"").trim())continue;f=!0;let E=A.parentElement;for(;E&&E!==v.value;){if(E.tagName==="STRONG"||E.tagName==="B"){u=!0;break}if(E.style&&parseInt(E.style.fontWeight)>=600){u=!0;break}E=E.parentElement}}else if(A.nodeType===1){const R=A;if(R.tagName==="STRONG"||R.tagName==="B"){u=!0;break}if(R.style&&parseInt(R.style.fontWeight)>=600){u=!0;break}}if(u)break}}return se.value[o]=u&&f,u&&f}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,f=m.nodeType===3?m.parentElement:m;if(f&&((f.tagName==="EM"||f.tagName==="I"||f.closest&&f.closest("em, i"))&&(u=!0),!u&&f.style&&f.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(f).fontStyle==="italic"&&(u=!0)}catch{}return se.value.hasOwnProperty(o)?se.value[o]:(se.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let f=!1;if(m){const k=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let A;for(;A=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(A))){if(A.nodeType===3){if(!(A.textContent||"").trim())continue;f=!0;let E=A.parentElement;for(;E&&E!==v.value;){if(E.tagName==="EM"||E.tagName==="I"){u=!0;break}if(E.style&&E.style.fontStyle==="italic"){u=!0;break}E=E.parentElement}}else if(A.nodeType===1){const R=A;if(R.tagName==="EM"||R.tagName==="I"){u=!0;break}if(R.style&&R.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return se.value[o]=u&&f,u&&f}}const d=document.queryCommandState(o);return c.collapsed&&se.value.hasOwnProperty(o)?se.value[o]:(se.value[o]=d,d)}return se.value.hasOwnProperty(o)?se.value[o]:!1}catch{return se.value.hasOwnProperty(o)?se.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},Fl=o=>{M.disabled||!M.richText||(we.value=we.value===o?null:o,o==="askAi"&&(ut.value=null))},un=()=>{we.value=null,Ue.value=null},Pn=o=>{Nn("formatBlock",o),un()},Zl=o=>{if(!o||!v.value)return o;const l=Oe=>{let Me=Oe.nodeType===Node.TEXT_NODE?Oe.parentElement:Oe;for(;Me&&Me!==v.value;){const yt=Me.tagName;if(yt==="P"){const dn=Me.parentElement;if(dn===v.value||dn.tagName==="BLOCKQUOTE")return Me}if(yt==="BLOCKQUOTE")break;Me=Me.parentElement}return null},s=l(o.startContainer),i=l(o.endContainer);if(!s||!i)return o;const c=[],d=document.createTreeWalker(v.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Oe=>{const Me=Oe.tagName;if(Me==="P"){const yt=Oe.parentElement;if(yt===v.value||yt.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(s),f=c.indexOf(i);if(m===-1||f===-1)return o;const k=Math.min(m,f),A=Math.max(m,f),R=c.slice(k,A+1);if(R.length===0)return o;const E=R[0],re=R[R.length-1],K=document.createRange();return K.setStartBefore(E),K.setEndAfter(re),K},Yn=()=>{if(M.disabled||!M.richText||!v.value)return;Pe.value?(Ze.value&&(clearTimeout(Ze.value),Ze.value=null),he(),Pe.value=!1):he(),un(),v.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let l=o.getRangeAt(0);!l.collapsed&&_l(l)&&(l=Zl(l),o.removeAllRanges(),o.addRange(l));let s=null;!l.collapsed&&_l(l)&&(s=Kt());const i=l.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(f=>{if(f.nodeType===Node.ELEMENT_NODE)if(f.tagName==="P"||f.tagName==="DIV")u.insertBefore(f,c);else{const k=document.createElement("p");k.appendChild(f.cloneNode(!0)),u.insertBefore(k,c)}else if(f.nodeType===Node.TEXT_NODE&&f.textContent.trim()){const k=document.createElement("p");k.appendChild(f.cloneNode(!0)),u.insertBefore(k,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 f=[],k=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:E=>E.parentNode===u&&E.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let A;for(;A=k.nextNode();)f.push(A);if(f.forEach(E=>{const re=document.createElement("p");E.parentNode.insertBefore(re,E),re.appendChild(E)}),u.querySelectorAll("p, div").forEach(E=>{E.textContent.trim()===""&&!E.querySelector("img")&&(E.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const E=document.createElement("p");E.innerHTML="<br>",u.appendChild(E)}}e.nextTick(()=>{s&&Ln(s),Zt(),_t(),Qt()})},Bl=()=>{if(!v.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!i||!v.value.contains(i))return;const c=A=>{if(!A)return!1;const R=A.textContent||"",re=(A.innerHTML||"").trim();return R.trim()===""||re===""||re==="<br>"||re==="<br/>"||re==="<p></p>"||re==="<p><br></p>"||re==="<p><br/></p>"||re==="<p> </p>"||re==="<p><br> </p>"||re==="<div></div>"||re==="<div><br></div>"||re==="<div><br/></div>"};let d=null;for(s.nodeType===3?d=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?d=s:d=s.closest("p, div"),d&&i.contains(d)&&c(d)&&d.remove();i.lastChild;){const A=i.lastChild;if(A.nodeType===1&&A.tagName==="BR")A.remove();else if(A.nodeType===3)if((A.textContent||"").trim()==="")A.remove();else break;else break}if(i.children.length>0)for(let A=i.children.length-1;A>=0;A--){const R=i.children[A];if((R.tagName==="P"||R.tagName==="DIV")&&c(R))R.remove();else break}let u=i.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(i.innerHTML=u);const f=document.createElement("p");f.innerHTML="<br>",i.parentNode?i.nextSibling?i.parentNode.insertBefore(f,i.nextSibling):i.parentNode.appendChild(f):v.value&&v.value.appendChild(f);const k=document.createRange();k.selectNodeContents(f),k.collapse(!0),o.removeAllRanges(),o.addRange(k),e.nextTick(()=>{Zt(),_t()})},Bn=()=>{if(!v.value){Ce.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");Ce.value=!!i}else Ce.value=!1}catch{Ce.value=!1}},Gl=()=>{if(!v.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),xe.value=Kt();const l=window.getSelection();let s="";l.rangeCount>0&&(s=l.getRangeAt(0).toString()),tt.value="",ft.value=s,_e.value="",We.value=null,Ae.value=!0,un(),e.nextTick(()=>{Z.value&&Z.value.focus()})},cl=()=>{if(!v.value)return;Pe.value?(Ze.value&&(clearTimeout(Ze.value),Ze.value=null),he(),Pe.value=!1):he();const o=window.getSelection();let l=null;if(o.rangeCount>0){const i=o.getRangeAt(0).commonAncestorContainer;l=i.nodeType===1?i.closest("a"):i.parentElement?.closest("a")}if(!l&&We.value&&(l=We.value),l&&l.parentNode){const s=document.createDocumentFragment();for(;l.firstChild;)s.appendChild(l.firstChild);if(l.parentNode.replaceChild(s,l),s.firstChild){const i=document.createRange();i.setStartBefore(s.firstChild),i.setEndAfter(s.lastChild||s.firstChild),o.removeAllRanges(),o.addRange(i),document.execCommand("removeFormat",!1),i.collapse(!1),o.removeAllRanges(),o.addRange(i)}We.value=null}else Nn("unlink");Ce.value=!1,un(),e.nextTick(()=>{_t(),Bn()})},Ul=()=>{M.disabled||!M.richText||v.value&&(Pe.value?(Ze.value&&(clearTimeout(Ze.value),Ze.value=null),he(),Pe.value=!1):he(),un(),v.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Mn(),_t(),Qt()}))},kl=()=>{M.disabled||!M.richText||v.value&&(Pe.value?(Ze.value&&(clearTimeout(Ze.value),Ze.value=null),he(),Pe.value=!1):he(),un(),v.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Mn(),_t(),Qt()}))},Ql=o=>{const l=o.parentElement;if(!l||l.tagName!=="OL")return null;let s=0,i=o.previousElementSibling;for(;i;)i.tagName==="LI"&&s++,i=i.previousElementSibling;return s+1},Mn=()=>{if(!v.value)return;v.value.querySelectorAll("li > ol").forEach(l=>{const s=l.parentElement;if(s&&s.tagName==="LI"){const i=Ql(s);i!==null&&Array.from(l.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(i))})}})},ul=()=>{if(M.disabled||!M.richText||!v.value)return;un(),v.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{Mn(),_t()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=s.previousElementSibling;if(c&&c.tagName==="LI"){const d=i.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const m=Ql(c);u.appendChild(s),m!==null&&i.tagName==="OL"&&s.setAttribute("data-parent-num",String(m)),Mn();const f=document.createRange();f.selectNodeContents(s),f.collapse(!1),o.removeAllRanges(),o.addRange(f),e.nextTick(()=>{_t(),Qt()})}else document.execCommand("indent",!1),e.nextTick(()=>{Mn(),_t(),Qt()})},xn=()=>{if(M.disabled||!M.richText||!v.value)return;un(),v.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{Mn(),_t()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=i.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){i.tagName==="OL"&&s.removeAttribute("data-parent-num"),d.insertBefore(s,c.nextSibling),i.children.length===0&&i.remove(),Mn();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{_t(),Qt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Mn(),_t(),Qt()})},hn=e.ref(null),jn=e.ref(null),y=e.ref({}),h=e.ref(""),x=e.ref(null),W=e.ref("");e.ref("");const ue=e.ref(null);e.ref("");const Qe=e.ref([]),Wt=e.ref(!1),yn=e.ref(!1),Fn=o=>{if(!o)return"";const l=o.cloneRange(),s=document.createElement("div");return s.appendChild(l.cloneContents()),s.innerHTML},On=()=>{if(!M.commentUser||M.disabled||!M.richText||!v.value)return;if(hn.value!==null){hn.value=null,h.value="",W.value="",ue.value=null,Qe.value=[],Tl(!0);return}un(),v.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(l.collapsed||!_l(l))return;W.value=Fn(l)||"",ue.value=Kt();const s=l.getBoundingClientRect(),i=v.value.parentElement;if(!i)return;const c=i.getBoundingClientRect(),d=s.bottom-c.top,m=Math.max(d+8,0);y.value={top:`${m}px`,bottom:"auto"},hn.value=Date.now(),e.nextTick(()=>{if(h.value="",x.value){const k=x.value;k.style.height="auto",k.style.height=`${k.scrollHeight}px`,k.focus()}const f=i.querySelector(".dss-comment-overlay");if(f&&i){const k=i.querySelector(".dss-text-editor-footer");if(k){const A=i.getBoundingClientRect(),R=f.getBoundingClientRect(),E=k.getBoundingClientRect(),re=R.bottom-A.top,K=E.top-A.top,Oe=8;if(re>K-Oe){const Me=E.height;y.value={bottom:`${Me+Oe}px`,top:"auto"}}else y.value={top:`${m}px`,bottom:"auto"}}}})},Cl=()=>{if(!h.value.trim())return;const o=h.value.trim(),l=new Date,s={text:o,selectionText:W.value,selectionRange:ue.value,commentId:hn.value,user:M.commentUser||null,createdAt:l.toISOString()};Qe.value=[...Qe.value,s],fe("comment-submitted",s),Vo(s),ue.value&&!Uo(ue.value)&&go(hn.value,ue.value),h.value="",e.nextTick(()=>{if(x.value){const i=x.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}St("sendComment")})},fo=(o,l)=>{if(!(!M.commentUser||!o.user||o.user.id!==M.commentUser.id)){if(Qe.value=Qe.value.filter((s,i)=>i!==l),hn.value!==null&&v.value){const s=String(hn.value),i=v.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(i&&Qe.value.length>0){const c=[],d=new Set;Qe.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?i.setAttribute("data-comment-user",JSON.stringify(c[0])):i.removeAttribute("data-comment-user"),c.length>1?i.setAttribute("data-comment-user-2",JSON.stringify(c[1])):i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count",String(Qe.value.length))}else i&&Qe.value.length===0&&(i.removeAttribute("data-comment-user"),i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count","0"))}if(fe("comment-deleted",{comment:o,index:l,commentId:hn.value}),M.comments&&Array.isArray(M.comments)){const s=M.comments.filter(i=>!(i.commentId===o.commentId&&i.text===o.text&&i.user?.id===o.user?.id));fe("update:comments",s)}e.nextTick(()=>{St("deleteComment")})}},Uo=o=>{if(!o||!v.value)return!1;try{const l=vo(o);if(!l)return!1;const s=l.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i)return!!i.closest("[data-comment], [data-fake-comment]")}catch{}return!1},vo=o=>{if(!o||!v.value)return null;try{const l=document.createRange();if(o.type==="element"&&o.element)return v.value.contains(o.element)?(l.setStart(o.element,o.offset),l.collapse(!0),l):null;let s=0;const i=[v.value];let c=null,d=!1,u=!1;for(;!u&&(c=i.pop());)if(c.nodeType===3){const m=s+c.length;!d&&o.start>=s&&o.start<=m&&(l.setStart(c,o.start-s),d=!0),d&&o.end>=s&&o.end<=m&&(l.setEnd(c,o.end-s),u=!0),s=m}else{let m=c.childNodes.length;for(;m--;)i.push(c.childNodes[m])}return d?l:null}catch{return null}},go=(o,l)=>{if(!(!o||!l||!v.value))try{const s=vo(l);if(!s||s.collapsed)return;const i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;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=s.startContainer,f=s.endContainer,k=s.startOffset,A=s.endOffset,R=m.nodeType===3?m.parentNode:m,E=f.nodeType===3?f.parentNode:f;if(R===E&&k===0&&A===(f.nodeType===3?f.length:E.childNodes.length)&&(R.tagName==="P"||R.tagName==="DIV"||R.tagName==="H1"||R.tagName==="H2"||R.tagName==="H3"||R.tagName==="H4"||R.tagName==="H5"||R.tagName==="H6")){const K=s.extractContents();d.appendChild(K),s.insertNode(d)}else s.surroundContents(d)}catch{const f=s.extractContents();d.appendChild(f),s.insertNode(d)}const u=v.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{St("wrapSelectionWithCommentMarker"),_t()})}catch{}},Vo=o=>{if(!o||!o.commentId)return;const l=Array.isArray(M.comments)?[...M.comments]:[],s=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let i=l.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(s)||d.conversation_id===s);const c={text:o.text,user:o.user,createdAt:o.createdAt,created_at:o.createdAt,updated_at:o.createdAt};if(i>=0){const d=l[i];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(f=>f.article_id)?.article_id||null,m={conversation_id:s,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)}Wt.value=!0,fe("update:comments",l)},Xo=(o,l=[])=>{if(!M.commentUser||M.disabled||!M.richText||!v.value)return;const s=v.value;let i=null;try{i=s.querySelector(o)}catch{return}if(!i)return;un(),s.focus();const c=document.createRange();c.selectNodeContents(i);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),W.value=i.innerHTML||"",ue.value=Kt();const u=c.getBoundingClientRect(),m=s.parentElement;if(m){const A=m.getBoundingClientRect(),R=u.bottom-A.top,re=Math.max(R+8,0);y.value={top:`${re}px`,bottom:"auto"}}const f=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");let k=[];if(f&&M.comments&&Array.isArray(M.comments)){const A=M.comments.find(R=>String(R.conversation_id)===String(f));if(A&&A.conversation&&Array.isArray(A.conversation)){const R=A.conversation.map(E=>({id:E.id||E.commentary_id,commentary_id:E.id||E.commentary_id,conversation_id:A.id||A.conversation_id,text:E.text,user:E.user,createdAt:E.created_at||E.createdAt,updated_at:E.updated_at||E.updatedAt}));k.push(...R)}}k.length===0&&Array.isArray(l)&&l.length>0&&(k=l.slice()),k.sort((A,R)=>{const E=Oe=>{if(!Oe)return 0;const Me=new Date(Oe).getTime();return isNaN(Me)?0:Me},re=E(A.createdAt),K=E(R.createdAt);return re===K?0:re-K}),Qe.value=k,Tl(!0),hn.value=f||null,i&&(jn.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(h.value="",x.value){const A=x.value;A.style.height="auto",A.style.height=`${A.scrollHeight}px`,A.focus()}if(m){const A=m.querySelector(".dss-comment-overlay");if(A){const R=m.querySelector(".dss-text-editor-footer");if(R){const E=m.getBoundingClientRect(),re=A.getBoundingClientRect(),K=R.getBoundingClientRect(),Oe=re.bottom-E.top,Me=K.top-E.top,yt=8;if(Oe>Me-yt){const dn=K.height;y.value={bottom:`${dn+yt}px`,top:"auto"}}}}}St("openCommentOverlayForSelector")})},ho=e.ref(null),Jl=e.ref(0),Yo=o=>{if(!(M.disabled||!M.richText)){if(o.key==="Escape"){const l=window.getSelection();if(l.rangeCount>0){const i=l.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value&&v.value.contains(c))){o.preventDefault();let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.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(()=>{Bl()},50);return}}}if(o.key.length===1||o.key==="Enter"){const l=window.getSelection();if(l&&l.rangeCount>0){const s=l.getRangeAt(0),i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const m=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,f=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(m)&&m!==u||d.contains(f)&&f!==u){o.preventDefault();const k=document.createRange();k.setStartAfter(d),k.collapse(!0),l.removeAllRanges(),l.addRange(k);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const l=window.getSelection();if(l.rangeCount>0){const s=l.getRangeAt(0);let i=null,c=null;if(s.collapsed)if(o.key==="Backspace"){const d=s.startContainer;let u=d;d.nodeType===3&&(s.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"&&(i=m,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const d=s.startContainer;let u=d;d.nodeType===3&&(s.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"&&(i=m,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const d=s.commonAncestorContainer,u=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,m=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(i=d,c=i.closest(".dss-image-wrapper")):(i=d.querySelector("img"),i&&(c=i.closest(".dss-image-wrapper"))),c){const f=c.contains(u)||u===c,k=c.contains(m)||m===c,R=s.cloneContents().textContent?.trim()||"",E=c.textContent?.trim()||"";(!f||!k||R.length>E.length)&&(c=null,i=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(()=>{_t()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?xn():ul();return}if(o.key==="Enter"){const l=window.getSelection();if(l.rangeCount>0){const s=l.getRangeAt(0);if(s.collapsed){const u=s.startContainer,m=f=>{if(!f)return!1;let k=f.previousSibling;for(;k;){if(k.classList&&k.classList.contains("dss-image-wrapper")||k.tagName==="IMG"||k.querySelector&&k.querySelector(".dss-image-wrapper")||k.querySelector&&k.querySelector("img"))return!0;k=k.previousSibling}const A=f.parentElement;return A&&A!==v.value?m(A):!1};if(u.nodeType===3){const f=u.parentElement;if(f&&(m(f)||m(u))){const k=f.closest("p, div");if(k&&k!==v.value){o.preventDefault(),o.stopPropagation();let A=null;const R=s.startOffset;R<u.length&&(A=u.splitText(R));const E=document.createElement("p");if(A?E.appendChild(A):E.innerHTML="<br>",u.length===0){const K=u.parentElement;K&&(K.removeChild(u),K.childNodes.length===0&&K.appendChild(document.createElement("br")))}k.nextSibling?k.parentNode.insertBefore(E,k.nextSibling):k.parentNode.appendChild(E);const re=document.createRange();A?re.setStart(A,0):re.setStart(E,0),re.collapse(!0),l.removeAllRanges(),l.addRange(re),e.nextTick(()=>{_t()});return}}}}const i=s.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value&&v.value.contains(c))){let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const m=K=>{if(!K)return!1;const Oe=K.textContent||"",yt=(K.innerHTML||"").trim(),dn=yt.replace(/<br\s*\/?>/gi,"").trim();return Oe.trim()===""||yt===""||dn===""||yt==="<br>"||yt==="<br/>"||yt==="<p></p>"||yt==="<p><br></p>"||yt==="<p><br/></p>"||yt==="<p> </p>"||yt==="<p><br> </p>"||yt==="<div></div>"||yt==="<div><br></div>"||yt==="<div><br/></div>"},f=c.lastChild,k=f&&f.nodeType===1&&f.tagName==="BR",A=s.startContainer,R=A.nodeType===3?A.parentElement:A,E=R===c||R&&R.parentElement===c;if(u&&m(u)||k&&E){o.preventDefault(),setTimeout(()=>{Bl()},50);return}}}}if(o.key===" "){const l=Date.now(),s=l-Jl.value;if(ho.value===" "&&s<300){const i=window.getSelection();if(i.rangeCount>0){const c=i.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(),ul();return}}}}ho.value=" ",Jl.value=l}else ho.value=o.key}},yo=o=>{if(M.disabled||!M.richText)return;o.preventDefault();let l=o.clipboardData.getData("text/html"),s=o.clipboardData.getData("text/plain");l&&(l=l.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),he();const i=window.getSelection();let c=null;if(i&&i.rangeCount>0){let m=i.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 f=new DOMParser().parseFromString(u,"text/html");let k=v.value.querySelector("h1")?1:0;if(f.querySelectorAll("h1").forEach(R=>{if(k>0){const E=f.createElement("p");E.innerHTML=R.innerHTML,R.parentNode.replaceChild(E,R)}else k++}),c){const R=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],E=Array.from(f.body.children).filter(re=>R.includes(re.tagName));if(E.length===1){const re=E[0].tagName,K=c.tagName,Oe=c.textContent.trim()===""&&!c.querySelector("img");let Me=!1;if(["H1","H2","H3","H4","H5","H6"].includes(K)?Me=!0:Oe||(re===K||re==="P")&&(Me=!0),Me)return E[0].innerHTML.trim()}}return f.body.innerHTML.trim()};if(l){const u=d(l);document.execCommand("insertHTML",!1,u)}else if(s)if(/<[a-z][\s\S]*>/i.test(s)){const m=d(s);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,s);_t()},Tn=o=>{if(we.value){const s=o.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&un()}if(et.value){const s=o.target,i=s.closest(".dss-floating-toolbar"),c=v.value&&s.closest(".dss-text-editor-content");!i&&!c&&Il()}if(ut.value){const s=o.target,i=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!i&&!c&&bl()}const l=o.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(Ue.value=null),!v.value||!l.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const i=s.getRangeAt(0);j.value=!i.collapsed&&_l(i)}else j.value=!1}if(hn.value!==null){const s=document.querySelector(".dss-comment-overlay");let i=!1;if(s){const u=s.getBoundingClientRect(),m=o.clientX,f=o.clientY;i=m>=u.left&&m<=u.right&&f>=u.top&&f<=u.bottom}const c=l.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!i&&!d&&(hn.value=null,h.value="",W.value="",ue.value=null,Qe.value=[],Tl(!0))}},P=(o,l)=>{o&&o.stopPropagation&&o.stopPropagation(),wt.value&&(clearTimeout(wt.value),wt.value=null),Ue.value=l},En=o=>{const l=o.relatedTarget;if(l){const s=l.closest(".dss-toolbar-dropdown-submenu"),i=l.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||i)return}wt.value&&clearTimeout(wt.value),wt.value=setTimeout(()=>{Ue.value=null,wt.value=null},150)},Kn=o=>{Ue.value=null};let Xl=0;const Sn=o=>{if(!o)return;const l=Array.from(o.children);l.forEach(s=>{s.classList.contains("dss-toolbar-dropdown-submenu")||s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(s.tagName==="BUTTON"||s.tagName==="DIV")&&!s.classList.contains("dss-toolbar-dropdown-item")&&s.classList.add("dss-toolbar-dropdown-item")}),l.forEach((s,i)=>{if(s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||s.classList.contains("dss-toolbar-dropdown-submenu")||!s.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(s.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(k=>k.tagName==="BUTTON"||k.tagName==="DIV").length>0:!1),d=s.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-${++Xl}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",m);let f=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),f=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),f=d),f&&(f.setAttribute("data-submenu-id",m),f.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?f.dataset.originalParentRef="inside":f.dataset.originalParentRef="sibling",Array.from(f.children).forEach(A=>{(A.tagName==="BUTTON"||A.tagName==="DIV")&&!A.classList.contains("dss-toolbar-dropdown-item")&&A.classList.add("dss-toolbar-dropdown-item")}))}})},wn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{Sn(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=f=>{const k=c.getAttribute("data-submenu-id");k&&P(f,k)},m=En;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=k=>{const A=c.getAttribute("data-submenu-id");A&&P(k,A)},m=En;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(k=>{k.addEventListener("click",Kn)})})})};let jt=null;const nn=()=>{if(Ue.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Ue.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Ue.value}"]`);o&&l&&Wn(o,l)}if(et.value&&Qt(),M.richText){if(jt!==null)return;jt=setTimeout(()=>{jt=null,St("handleWindowResize")},150)}},Gn=()=>{if(!M.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(l=>{Array.from(l.children).filter(i=>i.tagName==="DIV"&&!i.classList.contains("dss-toolbar-button")).forEach(i=>{i.classList.add("dss-toolbar-button")})})},Ml=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),l=s=>{if(s.preventDefault(),s.stopPropagation(),window.getSelection){const i=window.getSelection();i.removeAllRanges?i.removeAllRanges():i.empty&&i.empty()}return!1};o.forEach(s=>{s.addEventListener("selectstart",l),s.addEventListener("mousedown",l),s.addEventListener("dragstart",l),s.addEventListener("contextmenu",l),s.addEventListener("click",i=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{sn.value?te():pt(),S.value?rt():qt()})}),e.nextTick(()=>{Ml()}),M.richText&&v.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Tn),window.addEventListener("resize",nn);let o=null;const l=()=>{o===null&&(o=setTimeout(()=>{o=null,nn()},150))};window.addEventListener("scroll",l,!0),v.value._windowScrollHandler=l,v.value._windowScrollTimeout=o,v.value.closest(".editor-with-comments"),v.value.closest(".dss-text-editor-content-wrapper");const s=v.value.closest(".dss-text-editor-content");let i=null;const c=()=>{i===null&&(i=setTimeout(()=>{i=null,nn()},150))};s&&(s.addEventListener("scroll",c),v.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{wn(),Gn()}),v.value.addEventListener("click",m=>{const f=m.target;f.closest("a")&&!M.disabled&&m.preventDefault();const A=f.closest(".dss-image-no-alt-icon"),R=f.closest(".dss-image-wrapper");if(A||R&&f===R){m.preventDefault(),m.stopPropagation();const E=window.getSelection(),re=document.createRange();re.setStartAfter(R),re.collapse(!0),E.removeAllRanges(),E.addRange(re)}else R&&f.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const E=window.getSelection();if(E.rangeCount>0){const K=E.getRangeAt(0).commonAncestorContainer,Oe=K.nodeType===3?K.parentElement:K;if(R.contains(Oe)&&Oe!==R.querySelector("img")){const Me=document.createRange();Me.setStartAfter(R),Me.collapse(!0),E.removeAllRanges(),E.addRange(Me)}}else{const re=document.createRange();re.setStartAfter(R),re.collapse(!0),E.addRange(re)}}))},!0),v.value.addEventListener("mousedown",m=>{const f=m.target,k=f.closest(".dss-image-no-alt-icon"),A=f.closest(".dss-image-wrapper");if(k||A&&f.tagName!=="IMG"){m.preventDefault();const R=window.getSelection(),E=document.createRange();A&&(E.setStartAfter(A),E.collapse(!0),R.removeAllRanges(),R.addRange(E))}},!0),v.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!v.value)return;v.value.querySelectorAll("img").forEach(k=>{if(!k.closest(".dss-image-wrapper"))k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="";else{const R=k.getAttribute("alt")||k.alt||"";if(R){const E=k.getAttribute("src")||k.src||"",re=E.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),K=R===E||R===re;(R.startsWith("http://")||R.startsWith("https://")||R.startsWith("data:")||K||K)&&(k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="")}}}),Xe()})}),v.value.addEventListener("dragstart",m=>{const f=m.target,k=f.tagName==="IMG"?f:f.closest("img"),A=k?.closest(".dss-image-wrapper");k&&v.value.contains(k)&&(lt.value=A||k,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),v.value.addEventListener("dragover",m=>{lt.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),v.value.addEventListener("dragenter",m=>{lt.value&&(m.preventDefault(),m.stopPropagation())}),v.value.addEventListener("drop",m=>{if(!lt.value||!v.value)return;m.preventDefault(),m.stopPropagation();const f=lt.value,k=f.classList?.contains("dss-image-wrapper"),A=k?f.querySelector("img"):f,R=k?f:A?.closest(".dss-image-wrapper");if(!A||!v.value.contains(A)){lt.value=null;return}let E=null;const re=m.clientX,K=m.clientY;if(document.caretRangeFromPoint)E=document.caretRangeFromPoint(re,K);else{const an=window.getSelection();an.rangeCount>0?E=an.getRangeAt(0).cloneRange():(E=document.createRange(),E.selectNodeContents(v.value),E.collapse(!1))}if(!E){lt.value=null;return}const Oe=E.commonAncestorContainer,Me=Oe.nodeType===3?Oe.parentElement:Oe;if(Me?.closest(".dss-image-wrapper")===R||R&&R.contains(Me)){lt.value=null;return}if(R&&(Me===R||R.contains(Me))){lt.value=null;return}const dn=A.getAttribute("src");let mn=null;R?mn=R.cloneNode(!0):mn=A.cloneNode(!0);try{let an=E.startContainer;if(an.nodeType===3&&(an=an.parentElement),R&&(an===R||R.contains(an))){const fn=document.createRange();fn.setStartAfter(R),fn.collapse(!0),E=fn}E.insertNode(mn);const Ut=document.createRange();Ut.setStartAfter(mn),Ut.collapse(!0);const kn=window.getSelection();kn.removeAllRanges(),kn.addRange(Ut)}catch{if(v.value.childNodes.length===0){const Ut=document.createElement("p");Ut.appendChild(mn),v.value.appendChild(Ut)}else{const Ut=v.value.lastChild;if(Ut&&Ut.nodeType===1)Ut.appendChild(mn);else{const kn=document.createElement("p");kn.appendChild(mn),v.value.appendChild(kn)}}}R?R.remove():A.remove(),lt.value=null,e.nextTick(()=>{const an=v.value.querySelectorAll("img");let Ut=!1;an.forEach(kn=>{if(kn.getAttribute("src")===dn)if(!Ut)Ut=!0;else{const fn=kn.closest(".dss-image-wrapper");fn?fn.remove():kn.remove()}}),Xe(),_t()})}),v.value.addEventListener("dragend",m=>{lt.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(f=>{f.addedNodes.forEach(k=>{if(k.nodeType===1){k.tagName==="IMG"&&(k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="");const A=k.querySelectorAll&&k.querySelectorAll("img");A&&A.forEach(R=>{R.removeAttribute("alt"),R.removeAttribute("data-alt"),R.setAttribute("alt",""),R.setAttribute("data-alt",""),R.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Xe(),Gn(),d=null},100)});if(u.observe(v.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const f=new MutationObserver(()=>{e.nextTick(()=>{Gn()})});f.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=f}}),M.modelValue){const m=zn(M.modelValue);v.value.innerHTML=m,Rn()}e.nextTick(()=>{const m=v.value.innerHTML||"",f=M.title||"",k=M.description||"";Tt.value=m,le.value=f,U.value=k,X.value=f,ie.value=k,Mn(),Xe(),ol(),ct(),bo(),xl()}),Bn(),Zt(),v.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Tn),window.removeEventListener("resize",nn),v.value&&v.value._windowScrollHandler&&window.removeEventListener("scroll",v.value._windowScrollHandler,!0),jt!==null&&(clearTimeout(jt),jt=null),v.value&&v.value._windowScrollTimeout!==null&&clearTimeout(v.value._windowScrollTimeout),Ze.value&&clearTimeout(Ze.value),wt.value&&clearTimeout(wt.value),v.value&&v.value._mutationObserver&&v.value._mutationObserver.disconnect(),He.value&&He.value.disconnect(),kt.value!==null&&(cancelAnimationFrame(kt.value),kt.value=null),ot.value!==null&&(clearTimeout(ot.value),ot.value=null),Et.value!==null&&(clearTimeout(Et.value),Et.value=null),Tl(!0),v.value&&v.value._scrollHandlers){const{wrapper:l,content:s,handler:i}=v.value._scrollHandlers;l&&l.removeEventListener("scroll",i),s&&s.removeEventListener("scroll",i)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const Pt=o=>{const l=o.target,s=l.closest("a");if(s&&!M.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(s);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const i=l.closest(".dss-image-wrapper");i&&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(i.contains(m)&&m!==i.querySelector("img")){const f=document.createRange();f.setStartAfter(i),f.collapse(!0),c.removeAllRanges(),c.addRange(f)}}Xe(),Bn(),Zt(),Qt(),ct()}):e.nextTick(()=>{Xe(),Bn(),Zt(),Qt(),ct()})},Rt=()=>{gt();const o=window.getSelection();if(o&&o.rangeCount>0){const s=o.getRangeAt(0);j.value=!s.collapsed&&_l(s),!s.collapsed&&b.value&&(b.value=null)}else j.value=!1;if(Xe(),Bn(),Zt(),Qt(),ct(),o&&o.rangeCount>0){const i=o.getRangeAt(0).commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c&&c.closest(".dss-text-editor-footer")){o.removeAllRanges(),j.value=!1;return}}["bold","italic","underline"].forEach(s=>{try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(!c.collapsed)if(s==="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 f=window.getComputedStyle(u);parseInt(f.fontWeight)>=600&&(m=!0)}catch{}se.value[s]=m}else{const d=document.queryCommandState(s);se.value[s]=d}}}catch{}})},ct=()=>{if(!M.richText||M.disabled||!v.value){V.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){V.value="p";return}const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i||!v.value.contains(i)){V.value="p";return}const c=i.closest("h1, h2, h3, h4, h5, h6, p");if(!c){V.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?V.value=d:V.value="p"}catch{V.value="p"}},Zt=()=>{if(!v.value){je.value=!1;return}try{const o=window.getSelection();let l=!1;if(o.rangeCount>0){const i=o.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");l=!!(c&&v.value.contains(c))}je.value=l}catch{je.value=!1}},_l=o=>{if(!o||!v.value)return!1;const l=o.commonAncestorContainer;if(!l)return!1;const s=l.nodeType===3?l.parentElement:l;return s?v.value.contains(s):!1},Il=()=>{et.value=!1},Qt=()=>{if(!M.floatingToolbar||!M.richText||M.disabled){et.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){et.value=!1;return}const l=o.getRangeAt(0);if(l.collapsed||!_l(l)){et.value=!1;return}const s=l.getBoundingClientRect();if(!s||s.width===0&&s.height===0){et.value=!1;return}const i=v.value;if(!i){et.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){et.value=!1;return}const d=40,u=8,m=s.top-d/2+15;let f=s.left+s.width/2;const k=window.innerWidth||document.documentElement.clientWidth||0;let A=0;nt.value&&(A=nt.value.getBoundingClientRect().width);const R=(A||320)/2;let E=c.left+R,re=c.right-R;if(re<E){const K=c.left+c.width/2;E=K,re=K}if(k>0){const K=R+u,Oe=k-R-u;if(E=Math.max(E,K),re=Math.min(re,Oe),re<E){const Me=k/2;E=Me,re=Me}}f<E?f=E:f>re&&(f=re),ke.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${f}px`,transform:"translate(-50%, -100%)",zIndex:10003},et.value=!0},eo=o=>{M.disabled||!M.richText||(ut.value=ut.value===o?null:o,o==="askAi"&&(we.value=null))},bl=()=>{ut.value=null,Ue.value=null},dl=o=>{Pn(o),bl()};let al=null,zl=null,wl=null,Pl=null;const $l=o=>{if(M.disabled||!M.richText){In(),Yl();return}const l=o.target,s=l.closest("a"),i=l.closest("img");if(al&&(clearTimeout(al),al=null),wl&&(clearTimeout(wl),wl=null),s&&s!==zl){Yl(),zl=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),We.value=s,me.value=c,Y.value=!0,Ee.value=!0,Bo(s)}else!s&&zl?(zl=null,al=setTimeout(()=>{Ee.value||In()},150)):s&&s===zl&&Bo(s);if(i&&i!==Pl){In(),Pl=i;let c=i.getAttribute("alt");c===null&&(c=i.alt||"");let d=i.getAttribute("data-alt");d===null&&(d=c),i.hasAttribute("alt")||i.setAttribute("alt",c),i.hasAttribute("data-alt")||i.setAttribute("data-alt",d),Ct.value=i,Ne.value=c.trim()||D("textEditor.image.noAlt"),ve.value=!0,ge.value=!0,Ol(i)}else!i&&Pl?(Pl=null,wl=setTimeout(()=>{ge.value||Yl()},150)):i&&i===Pl&&Ol(i)},No=o=>{const l=o.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(zl=null,Pl=null,al&&(clearTimeout(al),al=null),wl&&(clearTimeout(wl),wl=null),In(),Yl())},In=()=>{Ee.value=!1,setTimeout(()=>{Ee.value||(Y.value=!1,me.value="",Ae.value||(We.value=null))},100)},Bo=o=>{if(!o||!v.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;F.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Yl=()=>{ge.value=!1,setTimeout(()=>{ge.value||(ve.value=!1,Ne.value="",st.value||(Ct.value=null))},100)},Ol=o=>{if(!o||!v.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;q.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},jo=()=>{if(!me.value||!We.value)return;let l=We.value.getAttribute("href")||me.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},Mo=()=>{if(We.value){const o=We.value.textContent||"",l=We.value.getAttribute("href")||"",s=We.value;tt.value=l,ft.value=o,_e.value=o,Ee.value=!1,Y.value=!1,me.value="",We.value=s,Ae.value=!0}else if(Ce.value){const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(i){const c=i.textContent||"",d=i.getAttribute("href")||"";tt.value=d,ft.value=c,_e.value=c,We.value=i,Ae.value=!0}}}else{xe.value=Kt();const o=window.getSelection();let l="";o.rangeCount>0&&(l=o.getRangeAt(0).toString()),tt.value="",ft.value=l,_e.value="",We.value=null,Ae.value=!0}e.nextTick(()=>{Z.value&&(Z.value.focus(),Z.value.select())})},to=()=>{Ae.value=!1,tt.value="",ft.value="",_e.value="",We.value=null,xe.value=null},no=()=>{if(!tt.value.trim()){to();return}if(Pe.value?(Ze.value&&(clearTimeout(Ze.value),Ze.value=null),he(),Pe.value=!1):he(),ft.value.trim()||(ft.value=tt.value.trim()),We.value&&v.value&&v.value.contains(We.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const l=We.value;if(l.setAttribute("href",tt.value.trim()),ft.value.trim()!==_e.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=ft.value.trim()}l.style.color="#60afdf",l.style.textDecoration="underline";const s=document.createRange();s.selectNodeContents(l),s.collapse(!1),o.removeAllRanges(),o.addRange(s),_t()}else if(v.value){v.value.focus();const o=window.getSelection();o.removeAllRanges(),xe.value&&Ln(xe.value);let l=null;if(o.rangeCount>0&&(l=o.getRangeAt(0)),l&&!l.collapsed){l.toString();const s=document.createElement("a");s.href=tt.value.trim(),s.textContent=ft.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",l.deleteContents(),l.insertNode(s);const i=document.createTextNode(" ");l.setStartAfter(s),l.insertNode(i),l.setStartAfter(i),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}else{l||(l=document.createRange(),l.selectNodeContents(v.value),l.collapse(!1));const s=l.startContainer,i=s.nodeType===3,c=i&&l.startOffset===s.textContent.length,d=document.createElement("a");if(d.href=tt.value.trim(),d.textContent=ft.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=s.parentElement;for(;u&&u!==v.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==v.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const f=document.createTextNode(" ");m.appendChild(f);const k=document.createRange();k.setStartAfter(d),k.collapse(!0),o.removeAllRanges(),o.addRange(k)}else{if(l.startOffset>0){const k=s.textContent.substring(0,l.startOffset),A=k[k.length-1];if(A&&A!==" "&&A!==" "&&A!==`
|
|
102
102
|
`){const R=document.createTextNode(" ");l.insertNode(R),l.setStartAfter(R)}}l.insertNode(d);const f=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(f),l.setStartAfter(f),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}}else{if(i&&l.startOffset>0){const m=s.textContent.substring(0,l.startOffset),f=m[m.length-1];if(f&&f!==" "&&f!==" "&&f!==`
|
|
103
|
-
`){const k=document.createTextNode(" ");l.insertNode(k),l.setStartAfter(k)}}l.insertNode(d);const u=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(u),l.setStartAfter(u),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}_t()}e.nextTick(()=>{Bn(),to()})},lo=()=>{if(!v.value||J.value)return;const o=window.getSelection();let l=null;o&&o.rangeCount>0&&(l=Gt());const s=/(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,i=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const f=m.parentElement;return!f||f.closest("a")||f.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=i.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const f=c[m],k=f.textContent;s.lastIndex=0;const A=[...k.matchAll(s)];if(A.length===0)continue;const R=A.filter(G=>{const qe=G[0],Me=G.index;if(Me>0&&k[Me-1]==="@"||Me+qe.length<k.length&&k[Me+qe.length]==="@")return!1;const yt=f.parentElement;return!(yt&&yt.closest("a"))});if(R.length===0)continue;if(R.length===1&&R[0][0]===k.trim()){const G=R[0][0],qe=G.startsWith("http://")||G.startsWith("https://")?G:`https://${G}`,Me=document.createElement("a");Me.href=qe,Me.textContent=G,Me.style.color="#60afdf",Me.style.textDecoration="underline",f.parentNode&&(f.parentNode.replaceChild(Me,f),u=!0);continue}let E=0;const se=document.createDocumentFragment();if(R.forEach(G=>{const qe=G.index,Me=G[0];if(qe>E){const mn=k.substring(E,qe);mn&&se.appendChild(document.createTextNode(mn))}const yt=Me.startsWith("http://")||Me.startsWith("https://")?Me:`https://${Me}`,dn=document.createElement("a");dn.href=yt,dn.textContent=Me,dn.style.color="#60afdf",dn.style.textDecoration="underline",se.appendChild(dn),E=qe+Me.length}),E<k.length){const G=k.substring(E);G&&se.appendChild(document.createTextNode(G))}f.parentNode&&se.childNodes.length>0&&(f.parentNode.replaceChild(se,f),u=!0)}u&&l&&e.nextTick(()=>{Ln(l),Bn()})},Ko=()=>{if(!v.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,l=document.createTreeWalker(v.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}}),s=[];let i;for(;i=l.nextNode();)s.push(i);for(let c=s.length-1;c>=0;c--){const d=s[c],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let f=0;const k=document.createDocumentFragment();m.forEach(A=>{const R=A.index,E=A[0].startsWith("<u>")?"u":"ins",se=A[1]||A[2]||"";R>f&&k.appendChild(document.createTextNode(u.substring(f,R)));const G=document.createElement(E);G.textContent=se,k.appendChild(G),f=R+A[0].length}),f<u.length&&k.appendChild(document.createTextNode(u.substring(f))),d.parentNode&&k.childNodes.length>0&&d.parentNode.replaceChild(k,d)}},_o=o=>{if(!v.value||J.value)return;if(!o){Ko();return}if(!["*","_",">"].includes(o))return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const i=s.getRangeAt(0);if(!i.collapsed)return;const c=i.startContainer.nodeType===Node.TEXT_NODE?i.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):i.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===v.value||!v.value.contains(c))return;const d=()=>{let mn="",an=0,Ut=!1;const kn=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:sl=>sl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let fn=0;for(;kn.nextNode();){const sl=kn.currentNode,El=sl.textContent||"",pl=fn;if(fn+=El.length,sl===i.startContainer){mn+=El.substring(0,i.startOffset),an=pl+i.startOffset,Ut=!0;break}mn+=El}return Ut||(an=mn.length),{textBeforeCursor:mn,cursorCharOffset:an}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,f=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?f="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?f="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(f=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const k=m[0],A=m[1],R=u.length-k.length,se=(mn=>{let an=0;const Ut=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:fn=>fn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let kn;for(;kn=Ut.nextNode();){const fn=(kn.textContent||"").length;if(an+fn>=mn)return{node:kn,offset:mn-an};an+=fn}return null})(R);if(!se)return;const G=document.createRange();G.setStart(se.node,se.offset),G.setEnd(i.endContainer,i.endOffset);const qe=document.createElement(f);qe.textContent=A,G.deleteContents(),G.insertNode(qe);const Me=window.getSelection(),yt=document.createRange();yt.setStartAfter(qe),yt.collapse(!0),Me.removeAllRanges(),Me.addRange(yt);const dn=Gt();e.nextTick(()=>{_t(),dn&&Ln(dn)})},Qn=()=>{v.value&&(ye.value=Gt(),Vt.value="",zt.value="",Fe.value="",Nt.value="",bt.value="",Ht.value=null,Y.value=null,Be.value="upload",kt.value=!0,un(),e.nextTick(()=>{Xt.value&&Xt.value.focus(),mt.value&&(mt.value.value="")}))},Jn=o=>{const l=o.target?.files?.[0];if(!l){Ht.value=null,zt.value="";return}Ht.value=l;const s=new FileReader;s.onload=i=>{zt.value=i.target?.result||""},s.readAsDataURL(l)},ko=()=>{mt.value&&mt.value.click()},oo=()=>{Nt.value&&(bt.value="")},qn=()=>{bt.value&&(Nt.value="")},ao=()=>{let o=Y.value;if(!o){const l=window.getSelection();if(l&&l.rangeCount>0){const i=l.getRangeAt(0).commonAncestorContainer;o=i.nodeType===1?i.closest("img"):i.parentElement?.closest("img")}}if(o){const l=o.getAttribute("data-alt")||o.getAttribute("alt")||"";Y.value=o,Vt.value=l.trim()===""||l.trim()==="Image"?"":l;const s=o.getAttribute("src")||o.src||"";s.startsWith("http://")||s.startsWith("https://")?(Fe.value=s,zt.value="",Be.value="url"):(zt.value=s,Fe.value="",Be.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";Nt.value=c.endsWith("px")?c.replace("px",""):c,bt.value=d.endsWith("px")?d.replace("px",""):d,ye.value=null}else{Qn();return}kt.value=!0,ge.value=!1,xe.value=!1,e.nextTick(()=>{Be.value==="url"&&tn.value?(tn.value.focus(),tn.value.select()):Xt.value&&(Xt.value.focus(),Xt.value.select()),mt.value&&(mt.value.value="")})},jl=()=>{kt.value=!1,Vt.value="",zt.value="",Fe.value="",Nt.value="",bt.value="",Ht.value=null,Y.value=null,ye.value=null,Be.value="upload"},ml=()=>{const o=(Vt.value||"").trim(),l=v.value?._mutationObserver;l&&l.disconnect(),Oe.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),ve(),Oe.value=!1):ve();const s=Be.value==="url"?Fe.value.trim():zt.value;if(Y.value&&v.value&&v.value.contains(Y.value)){s&&(Y.value.src=s),Y.value.setAttribute("alt",o),Y.value.setAttribute("data-alt",o),Nt.value?(Y.value.style.width=`${Nt.value}px`,Y.value.setAttribute("width",Nt.value)):(Y.value.style.removeProperty("width"),Y.value.removeAttribute("width")),bt.value?(Y.value.style.height=`${bt.value}px`,Y.value.setAttribute("height",bt.value)):(Y.value.style.removeProperty("height"),Y.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(Y.value),c.collapse(!0),i.addRange(c)}_t()}else{if(!s){l&&v.value&&l.observe(v.value,{childList:!0,subtree:!0}),jl();return}if(v.value){v.value.focus();const i=window.getSelection();i&&i.rangeCount>0&&i.removeAllRanges();const c=window.getSelection();let d=null;if(ye.value&&(Ln(ye.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&v.value){if(d=document.createRange(),v.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",v.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(v.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){jl();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!v.value.contains(m)){if(d=document.createRange(),v.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",v.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(v.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const f=document.createElement("img");f.src=s,f.setAttribute("alt",o),f.setAttribute("data-alt",o),Nt.value&&(f.style.width=`${Nt.value}px`,f.setAttribute("width",Nt.value)),bt.value&&(f.style.height=`${bt.value}px`,f.setAttribute("height",bt.value));try{d.insertNode(f),d.setStartAfter(f),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(v.value){if(v.value.childNodes.length===0){const R=document.createElement("p");v.value.appendChild(R),R.appendChild(f)}else{const R=v.value.lastChild;if(R&&R.nodeType===1)R.appendChild(f);else{const E=document.createElement("p");v.value.appendChild(E),E.appendChild(f)}}const A=document.createRange();A.setStartAfter(f),A.collapse(!0),c&&(c.removeAllRanges(),c.addRange(A))}}Y.value=f,_t()}}e.nextTick(()=>{l&&v.value&&l.observe(v.value,{childList:!0,subtree:!0}),Bn(),Jt(),jl()})};e.watch(()=>M.modelValue,o=>{if(M.richText&&v.value&&!J.value){const l=zn(o||""),i=v.value.innerHTML.replace(/ |\u00A0/g," "),c=l.replace(/ |\u00A0/g," ");if(i!==c){const d=Gt();v.value.innerHTML=l,e.nextTick(()=>{Rn();const u=v.value.innerHTML||"",m=M.title||"",f=M.description||"";Tt.value=u,le.value=m,W.value=f,Lt.value=u,U.value=m,ie.value=f,et.value=[],Yt.value=[],Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Oe.value=!1,d&&Ln(d),Mn(),je(),ol(),Bn(),Jt(),ut(),St("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>M.richText,o=>{o?(Jt(),e.nextTick(()=>{bo()})):(Il(),oe.value=[],He.value&&(He.value.disconnect(),He.value=null)),ut()}),e.watch(()=>M.floatingToolbar,o=>{o?Jt():Il()}),e.watch(()=>M.disabled,o=>{o&&Il(),ut()}),e.watch(()=>M.description,()=>{e.nextTick(()=>{S.value?it():qt()})}),e.watch(()=>M.title,()=>{e.nextTick(()=>{sn.value?te():pt()})}),e.watch(()=>M.customToolbarSlots,()=>{e.nextTick(()=>{Gn()})},{deep:!0}),e.watch(()=>M.comments,(o,l)=>{if(M.commentUser){if(Zt.value){Zt.value=!1;return}yn.value||M.richText&&v.value&&e.nextTick(()=>{xl()})}},{deep:!0,immediate:!1});const xl=()=>{if(M.commentUser&&!yn.value&&!(!M.comments||!Array.isArray(M.comments)||M.comments.length===0)&&!(!M.richText||!v.value)){yn.value=!0;try{const o=new Set,l=M.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),s=v.value.querySelectorAll("[data-comment], [data-fake-comment]"),i=s.length;s.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 f=String(m);if(d.has(f))return;const k=v.value.querySelector(`[data-comment="${f}"]`);if(k){Kl(k,u),d.add(f);return}try{const A=Dn(u.selection_range,u.selection_text);if(A&&!A.collapsed){const R=A.commonAncestorContainer,E=R.nodeType===3?R.parentElement:R;if(E){const qe=E.closest("[data-comment], [data-fake-comment]");if(qe){const Me=qe.getAttribute("data-comment")||qe.getAttribute("data-fake-comment");if(String(Me)===String(m)){qe.setAttribute("data-comment",f),qe.removeAttribute("data-fake-comment"),Kl(qe,u),d.add(f);return}else return}}const se=v.value.querySelector(`[data-comment="${f}"]`);if(se){Kl(se,u),d.add(f);return}const G=document.createElement("span");G.setAttribute("data-comment",f),Kl(G,u);try{A.surroundContents(G),c++,d.add(f)}catch{try{const Me=document.createRange();Me.setStart(A.startContainer,A.startOffset),Me.setEnd(A.endContainer,A.endOffset),Co(Me),Me.surroundContents(G),c++,d.add(f)}catch{try{const yt=A.extractContents();G.appendChild(yt),A.insertNode(G),c++,d.add(f)}catch(yt){console.warn("Failed to create comment marker:",yt)}}}}}catch{}}),e.nextTick(()=>{St("restoreCommentsFromModel"),_t(),yn.value=!1})}catch{yn.value=!1}}},Co=o=>{if(!o||!v.value)return o;try{const l=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let s=o.startContainer,i=o.startOffset;if(s.nodeType===3){const u=s.parentElement;u&&l.includes(u.tagName)&&(i===0&&!$o(s)||o.setStartBefore(u))}else s.nodeType===1&&l.includes(s.tagName)&&i>0&&o.setStartBefore(s);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&l.includes(u.tagName)&&(d===c.length&&!Ll(c)||o.setEndAfter(u))}else c.nodeType===1&&l.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},$o=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},Ll=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},Dn=(o,l)=>{if(!o||!v.value)return null;try{const s=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let i=0;const c=[v.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const f=i+d.length;!u&&o.start>=i&&o.start<=f&&(s.setStart(d,o.start-i),u=!0),u&&o.end>=i&&o.end<=f&&(s.setEnd(d,o.end-i),m=!0),i=f}else{let f=d.childNodes.length;for(;f--;)c.push(d.childNodes[f])}return u?Co(s):null}}catch{return null}return null},Kl=(o,l)=>{if(!o||!l)return;const s=l.conversation||[],i=new Set,c=[],d=m=>{m&&m.id&&!i.has(m.id)&&(i.add(m.id),c.push(m))};s.length>0&&s.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=s.length;u>0?o.setAttribute("data-comment-count",String(u)):o.removeAttribute("data-comment-count")},St=(o="unknown")=>{if(!M.commentUser||!M.richText||!v.value){oe.value=[];return}Date.now()-xt.value<Mt&&Ct.value!==null||Ct.value===null&&(Ct.value=requestAnimationFrame(()=>{if(Ct.value=null,xt.value=Date.now(),ze.value)return;ze.value=!0;const s={},i=v.value;if(!i){ze.value=!1;return}const c=i.closest(".editor-with-comments");if(!c){ze.value=!1;return}const d=i.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(E=>{const se=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");se&&E.tagName==="SPAN"&&(m.has(se)||(u.push(E),m.add(se)))}),d.forEach(E=>{const se=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");!se||m.has(se)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(E.tagName)?E.querySelector(`span[data-comment="${se}"], span[data-fake-comment="${se}"]`)||(u.push(E),m.add(se)):E.tagName!=="SPAN"&&(u.push(E),m.add(se)))});const f=c.getBoundingClientRect(),k=i.getBoundingClientRect();u.forEach((E,se)=>{let G=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");if(!G)return;if(typeof G=="string"&&G.startsWith("comment-")){const fl=E.textContent?.trim(),rl=M.comments?.find(el=>(typeof el.conversation_id=="string"&&el.conversation_id.startsWith("comment-")?null:el.conversation_id)&&el.selection_text?.trim()===fl);rl?(G=String(rl.conversation_id),E.setAttribute("data-comment",G),E.removeAttribute("data-fake-comment")):(G=String(Date.now()),E.setAttribute("data-comment",G),E.removeAttribute("data-fake-comment"))}const qe=E.getBoundingClientRect(),Me=window.getComputedStyle(E),yt=parseFloat(Me.lineHeight)||parseFloat(Me.fontSize)*1.2,an=qe.top-k.top+yt/2-15,kn=k.top-f.top+an;let fn=null,sl=null,El=0;const pl=[],To=new Set;if(G&&M.comments){const fl=M.comments.find(rl=>String(rl.conversation_id||rl.id)===String(G));if(fl){const rl=fl.conversation||[];rl.length>0?(rl.forEach(el=>{el.user&&el.user.id&&!To.has(el.user.id)&&(To.add(el.user.id),pl.push(el.user))}),El=rl.length):(El=0,fn=null,sl=null),pl.length>0?fn=pl[0]:fn=null,pl.length>1?sl=pl[1]:sl=null}}const wo=qe.top+yt/2-15,Ao=wo+30,Do=5,Ho=Ao>k.top+Do&&wo<k.bottom-Do?1:0;oe.value.find(fl=>fl.id===G);let so=E;if(!so&&G&&v.value){const fl=String(G);so=v.value.querySelector(`[data-comment="${fl}"], [data-fake-comment="${fl}"]`)}const Dl=pl.length;s[G]?(s[G].top=kn,s[G].opacity=Ho,s[G].element=so,s[G].firstUser=fn,s[G].secondUser=sl,s[G].totalCount=El,s[G].uniqueUserCount=Dl):s[G]={id:G,top:kn,opacity:Ho,element:so,firstUser:fn,secondUser:sl,totalCount:El,uniqueUserCount:Dl}});const A=Object.values(s).map(E=>{const se=Math.max(0,(E.uniqueUserCount??0)-2);if(!E.element&&E.id&&v.value){const qe=String(E.id);E.element=v.value.querySelector(`[data-comment="${qe}"], [data-fake-comment="${qe}"]`)}return{...E,firstUser:E.firstUser||null,secondUser:E.secondUser||null,totalCount:E.totalCount,additionalCount:se}});(oe.value.length!==A.length||A.some((E,se)=>{const G=oe.value[se];if(!G)return!0;const qe=(G.firstUser?.id||null)!==(E.firstUser?.id||null),Me=(G.secondUser?.id||null)!==(E.secondUser?.id||null);return G.id!==E.id||Math.abs(G.top-E.top)>1||G.opacity!==E.opacity||G.totalCount!==E.totalCount||G.additionalCount!==E.additionalCount||qe||Me||G.element!==E.element}))&&(oe.value=A),ze.value=!1}))},Lo=o=>{if(!o)return;let l=o.element;if(!l&&o.id&&v.value){const s=String(o.id);l=v.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}l&&(Tl(),jn.value=l,l.classList.add("editor-comment-highlighted"))},Tl=(o=!1)=>{!o&&hn.value!==null&&jn.value&&(jn.value.getAttribute("data-comment")||jn.value.getAttribute("data-fake-comment"))===hn.value||(v.value&&v.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),jn.value&&(jn.value.classList.remove("editor-comment-highlighted"),jn.value=null))},ln=o=>{if(!o||!o.element)return;Tl(!0);const l=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!l)return;const s=`[data-comment="${l}"], [data-fake-comment="${l}"]`;fe("comment-marker-clicked",{commentId:l,selector:s,element:o.element})},Al=()=>{Tl()},bo=()=>{!M.richText||!v.value||(He.value&&He.value.disconnect(),Et.value!==null&&(clearTimeout(Et.value),Et.value=null),He.value=new MutationObserver(()=>{Et.value===null&&(Et.value=setTimeout(()=>{Et.value=null,e.nextTick(()=>{St("MutationObserver")})},200))}),He.value.observe(v.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),St("setupCommentMarkersObserver-initial"))},Zn=(o,l)=>{if(!o||!l)return;const s=l.getBoundingClientRect();let i=s.top,c=s.right+4;o.style.top=`${i}px`,o.style.left=`${c}px`,o.offsetHeight;const d=o.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const f=s.left-d.width-4;o.style.left=`${f}px`}if(d.bottom>m){const f=Math.max(8,m-d.height-8);o.style.top=`${f}px`}d.top<0&&(o.style.top="8px")};return e.watch(()=>Ye.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const i=s.getAttribute("data-submenu-id");if(i===o&&o){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${i}"]`);if(c){if(s.parentNode!==document.body){const d=s.parentNode;s.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(s)}s.style.display="block",s.style.visibility="hidden",s.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{Zn(s,c),s.offsetHeight,s.setAttribute("data-active","true"),s.style.visibility="visible",s.style.opacity="1"})})}else s.setAttribute("data-active","true")}else s.setAttribute("data-active","false"),s.style.display="none",s.style.top="",s.style.left="",s.style.visibility="",s.style.opacity=""})})}),e.watch(()=>[we.value,ot.value],()=>{we.value==="askAi"||ot.value==="askAi"?e.nextTick(()=>{wn()}):(Ye.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(l=>{if(l.parentNode===document.body){const s=l.getAttribute("data-submenu-id");if(s){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(i)if(l.dataset.originalParentRef==="inside")i.appendChild(l);else{const d=i.closest(".dss-toolbar-dropdown");d&&d.insertBefore(l,i.nextSibling)}}}})}))}),e.watch(()=>M.locale,o=>{o&&o!==ce.value&&(ce.value=o)},{immediate:!0}),ne({openCommentOverlayForSelector:Xo,updateCommentMarkers:St,restoreCommentsFromModel:xl}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container",[{"editor-with-comments":ct.value},Dt.value]]),style:e.normalizeStyle(Bt.value)},[L.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",qu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:ae,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,Zu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Wn.value}]),onClick:on,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,Wu),l[61]||(l[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Uu,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=s=>Fl("paragraph")),title:e.unref(D)("textEditor.toolbar.paragraphFormat")},[V.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Yu)):V.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,ju)):V.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Ku)):V.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Gu)):V.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Qu)):V.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Ju)):(e.openBlock(),e.createElementBlock("svg",ed,[...l[47]||(l[47]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[48]||(l[48]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Xu),we.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]=s=>Pn("<h1>"))},[e.createElementVNode("img",{src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,td),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]=s=>Pn("<h2>"))},[e.createElementVNode("img",{src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,nd),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]=s=>Pn("<h3>"))},[e.createElementVNode("img",{src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,ld),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]=s=>Pn("<h4>"))},[e.createElementVNode("img",{src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,od),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]=s=>Pn("<h5>"))},[e.createElementVNode("img",{src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,ad),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]=s=>Pn("<h6>"))},[e.createElementVNode("img",{src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,sd),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]=s=>Pn("<p>"))},[l[49]||(l[49]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("bold")}]),onClick:l[9]||(l[9]=s=>Nn("bold")),title:e.unref(D)("textEditor.toolbar.bold")},[...l[50]||(l[50]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,rd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("italic")}]),onClick:l[10]||(l[10]=s=>Nn("italic")),title:e.unref(D)("textEditor.toolbar.italic")},[...l[51]||(l[51]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,id),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("underline")}]),onClick:l[11]||(l[11]=s=>Nn("underline")),title:e.unref(D)("textEditor.toolbar.underline")},[...l[52]||(l[52]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,cd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xe.value}]),onClick:Yn,title:e.unref(D)("textEditor.toolbar.citation")},[...l[53]||(l[53]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,ud),l[62]||(l[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ke.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:cl,title:e.unref(D)("textEditor.toolbar.removeLink")},[...l[55]||(l[55]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,md)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Gl,title:e.unref(D)("textEditor.toolbar.insertLink")},[...l[54]||(l[54]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,dd)),l[63]||(l[63]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("insertUnorderedList")}]),onClick:Ul,title:e.unref(D)("textEditor.toolbar.bulletList")},[...l[56]||(l[56]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,pd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("insertOrderedList")}]),onClick:kl,title:e.unref(D)("textEditor.toolbar.numberList")},[...l[57]||(l[57]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,fd),l[64]||(l[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Qn,title:e.unref(D)("textEditor.toolbar.image")},[...l[58]||(l[58]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,vd),ct.value&&K.value?(e.openBlock(),e.createElementBlock("div",gd)):e.createCommentVNode("",!0),ct.value&&K.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(D)("textEditor.toolbar.comment"),onClick:On},[...l[59]||(l[59]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,hd)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",yd)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",kd,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=s=>Fl("askAi")),title:e.unref(D)("textEditor.toolbar.askAi")},[l[60]||(l[60]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",bd,e.toDisplayString(e.unref(D)("textEditor.toolbar.askAi")),1)],8,Cd),we.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",wd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[$n(s)?(e.openBlock(),e.createElementBlock("div",xd,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),$n(s)&&i<L.customToolbarSlots.length-1&&Vl(i)?(e.openBlock(),e.createElementBlock("div",Ed)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(we.value==="paragraph"||we.value==="askAi")&&L.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:un})):e.createCommentVNode("",!0),e.createVNode(na,{showModal:Ae.value,width:"500px",height:"55vh",onCloseModal:to},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(D)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Sd,[e.createElementVNode("div",Vd,[e.createElementVNode("label",Nd,e.toDisplayString(e.unref(D)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:De,type:"text","onUpdate:modelValue":l[15]||(l[15]=s=>ft.value=s),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.link.enterAltText"),onKeyup:e.withKeys(no,["enter"])},null,40,Bd),[[e.vModelText,ft.value]])]),e.createElementVNode("div",Md,[e.createElementVNode("label",_d,e.toDisplayString(e.unref(D)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Z,type:"text","onUpdate:modelValue":l[16]||(l[16]=s=>lt.value=s),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.link.enterUrl"),onKeyup:e.withKeys(no,["enter"])},null,40,$d),[[e.vModelText,lt.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:to},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:no},e.toDisplayString(e.unref(D)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(na,{showModal:kt.value,width:"500px",height:"80vh",onCloseModal:jl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Y.value?e.unref(D)("textEditor.image.editImage"):e.unref(D)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Ld,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Be.value==="upload"}]),onClick:l[17]||(l[17]=s=>Be.value="upload")},e.toDisplayString(e.unref(D)("textEditor.image.upload")),3),l[65]||(l[65]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Be.value==="url"}]),onClick:l[18]||(l[18]=s=>Be.value="url")},e.toDisplayString(e.unref(D)("textEditor.image.imageLink")),3)]),Be.value==="upload"?(e.openBlock(),e.createElementBlock("div",Td,[e.createElementVNode("div",Ad,[e.createElementVNode("div",Dd,[vl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Hd,e.toDisplayString(e.unref(D)("textEditor.image.uploadImage")),1)),vl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:ko},[e.createElementVNode("img",{src:zt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Rd),l[66]||(l[66]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:mt,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Jn},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:mt,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Jn},null,544))]),e.createElementVNode("div",Fd,[e.createElementVNode("label",Id,e.toDisplayString(e.unref(D)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Xt,type:"text","onUpdate:modelValue":l[19]||(l[19]=s=>Vt.value=s),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterAltText"),onKeyup:e.withKeys(ml,["enter"])},null,40,zd),[[e.vModelText,Vt.value]])]),e.createElementVNode("div",Pd,[e.createElementVNode("label",Od,e.toDisplayString(e.unref(D)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=s=>Nt.value=s),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(ml,["enter"]),onInput:oo},null,40,qd),[[e.vModelText,Nt.value]])]),e.createElementVNode("div",Zd,[e.createElementVNode("label",Wd,e.toDisplayString(e.unref(D)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=s=>bt.value=s),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(ml,["enter"]),onInput:qn},null,40,Ud),[[e.vModelText,bt.value]])])])])):e.createCommentVNode("",!0),Be.value==="url"?(e.openBlock(),e.createElementBlock("div",Xd,[e.createElementVNode("div",Yd,[e.createElementVNode("div",jd,[e.createElementVNode("label",Kd,e.toDisplayString(e.unref(D)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:tn,type:"text","onUpdate:modelValue":l[22]||(l[22]=s=>Fe.value=s),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(ml,["enter"])},null,40,Gd),[[e.vModelText,Fe.value]])]),e.createElementVNode("div",Qd,[e.createElementVNode("label",Jd,e.toDisplayString(e.unref(D)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=s=>Vt.value=s),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterAltText"),onKeyup:e.withKeys(ml,["enter"])},null,40,e1),[[e.vModelText,Vt.value]])]),e.createElementVNode("div",t1,[e.createElementVNode("label",n1,e.toDisplayString(e.unref(D)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=s=>Nt.value=s),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(ml,["enter"]),onInput:oo},null,40,l1),[[e.vModelText,Nt.value]])]),e.createElementVNode("div",o1,[e.createElementVNode("label",a1,e.toDisplayString(e.unref(D)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=s=>bt.value=s),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(ml,["enter"]),onInput:qn},null,40,s1),[[e.vModelText,bt.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:jl},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:ml},e.toDisplayString(e.unref(D)("textEditor.image.save")),1)]),_:1},8,["showModal"]),L.showTitle?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Un.value&&sn.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.labels.title")),1),e.createElementVNode("div",r1,[sn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",i1,[L.title?(e.openBlock(),e.createElementBlock("span",c1,e.toDisplayString(L.title),1)):(e.openBlock(),e.createElementBlock("span",u1,e.toDisplayString(il.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:he,value:L.title,onInput:rt,onFocus:Te,onBlur:vt,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!sn.value}]),placeholder:il.value,disabled:L.disabled,rows:"1"},null,42,d1)])],2)):e.createCommentVNode("",!0),L.showTitle&&Un.value&&sn.value?(e.openBlock(),e.createElementBlock("div",m1,[e.renderSlot(o.$slots,"title-slot")])):e.createCommentVNode("",!0),L.showDescription?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":Xn.value&&S.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.labels.description")),1),e.createElementVNode("div",p1,[S.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",f1,[L.description?(e.openBlock(),e.createElementBlock("span",v1,e.toDisplayString(L.description),1)):(e.openBlock(),e.createElementBlock("span",g1,e.toDisplayString(_n.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Ge,value:L.description,onInput:gn,onFocus:vn,onBlur:bn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!S.value}]),placeholder:_n.value,disabled:L.disabled,rows:"1"},null,42,h1)])],2)):e.createCommentVNode("",!0),L.showDescription&&Xn.value&&S.value?(e.openBlock(),e.createElementBlock("div",y1,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),ct.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:6},e.renderList(oe.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":hn.value===s.id,"editor-comment-marker-group-out-of-view":s.opacity===0}]),"data-comment-id":s.id,style:e.normalizeStyle({top:s.top+"px"}),onMouseenter:i=>Lo(s),onMouseleave:Al},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>ln(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,b1)):(e.openBlock(),e.createElementBlock("span",w1,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,C1)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>ln(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,E1)):(e.openBlock(),e.createElementBlock("span",S1,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,x1)):e.createCommentVNode("",!0),s.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:s.secondUser?"30px":"15px"}),"data-has-second-user":s.secondUser?"true":"false",onClick:e.withModifiers(i=>ln(s),["stop"])},[e.createElementVNode("span",N1,"+"+e.toDisplayString(s.additionalCount),1)],12,V1)):e.createCommentVNode("",!0)],46,k1))),128)):e.createCommentVNode("",!0),L.richText?(e.openBlock(),e.createElementBlock("div",A1,[e.createElementVNode("div",{ref_key:"editorRef",ref:v,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":L.disabled,"dss-text-editor-fixed-height":L.fixedHeight}]),style:e.normalizeStyle(Vn.value),onInput:_t,onBlur:ht,onClick:Pt,onMouseup:Rt,onKeyup:Rt,onKeydown:Yo,onPaste:yo,onMousemove:$l,onMouseleave:No},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[ct.value&&hn.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(y.value)},[q.value||Qe.value.length>0?(e.openBlock(),e.createElementBlock("div",D1,[e.createElementVNode("div",H1,[q.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:q.value},null,8,R1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",F1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe.value,(s,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:"dss-comment-message"},[s.user&&(s.user.avatar||s.user.initials||s.user.name)?(e.openBlock(),e.createElementBlock("div",I1,[e.createElementVNode("div",z1,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,P1)):(e.openBlock(),e.createElementBlock("span",O1,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",q1,[e.createElementVNode("div",Z1,[e.createElementVNode("div",W1,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",U1,e.toDisplayString(T(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":I(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),M.commentUser&&s.user&&s.user.id===M.commentUser.id&&!I(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>fo(s,i),["stop"]),title:e.unref(D)("textEditor.comment.delete")||"Delete comment"},[...l[68]||(l[68]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,X1)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Y1,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:x,"onUpdate:modelValue":l[26]||(l[26]=s=>h.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(D)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Cl,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(x.value){const s=x.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,j1),[[e.vModelText,h.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Cl,["stop"])},[...l[69]||(l[69]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",K1,[e.createElementVNode("div",G1,[e.createElementVNode("span",Q1,e.toDisplayString(pn.value)+" "+e.toDisplayString(pn.value===1?e.unref(D)("textEditor.footer.word"):e.unref(D)("textEditor.footer.words")),1),l[70]||(l[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",J1,e.toDisplayString(ll.value)+" "+e.toDisplayString(ll.value===1?e.unref(D)("textEditor.footer.character"):e.unref(D)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",B1,[e.createElementVNode("textarea",{value:L.modelValue,onInput:B,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":L.fixedHeight}]),placeholder:gl.value,rows:L.rows,disabled:L.disabled,style:e.normalizeStyle(rn.value)},null,46,M1),e.createElementVNode("div",_1,[e.createElementVNode("div",$1,[e.createElementVNode("span",L1,e.toDisplayString(pn.value)+" "+e.toDisplayString(pn.value===1?e.unref(D)("textEditor.footer.word"):e.unref(D)("textEditor.footer.words")),1),l[67]||(l[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",T1,e.toDisplayString(ll.value)+" "+e.toDisplayString(ll.value===1?e.unref(D)("textEditor.footer.character"):e.unref(D)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[X.value&&me.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(F.value),onMouseenter:l[28]||(l[28]=s=>Se.value=!0),onMouseleave:In},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(jo,["stop"]),title:me.value},e.toDisplayString(me.value),9,em),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Mo,["stop"]),title:e.unref(D)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",nm,[...l[71]||(l[71]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,tm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[xe.value&&Pe.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(j.value),onMouseenter:l[29]||(l[29]=s=>ge.value=!0),onMouseleave:Yl},[e.createElementVNode("div",lm,[Pe.value===e.unref(D)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",om,[...l[72]||(l[72]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:Pe.value},e.toDisplayString(Pe.value),9,am)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(ao,["stop"]),title:e.unref(D)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",rm,[...l[73]||(l[73]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,sm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.floatingToolbar&&L.richText&&tt.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:nt,class:"dss-floating-toolbar",style:e.normalizeStyle(Ce.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",im,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(ae,["stop"]),title:e.unref(D)("textEditor.toolbar.undo")},[...l[74]||(l[74]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,cm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Wn.value}]),onClick:e.withModifiers(on,["stop"]),title:e.unref(D)("textEditor.toolbar.redo")},[...l[75]||(l[75]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,um),l[89]||(l[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",dm,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(s=>eo("paragraph"),["stop"])),title:e.unref(D)("textEditor.toolbar.paragraphFormat")},[V.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,pm)):V.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,fm)):V.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,vm)):V.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,gm)):V.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,hm)):V.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,ym)):(e.openBlock(),e.createElementBlock("svg",km,[...l[76]||(l[76]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[77]||(l[77]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,mm),ot.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]=s=>dl("<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]=s=>dl("<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]=s=>dl("<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]=s=>dl("<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]=s=>dl("<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]=s=>dl("<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]=s=>dl("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),l[90]||(l[90]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(s=>Nn("bold"),["stop"])),title:e.unref(D)("textEditor.toolbar.bold")},[...l[78]||(l[78]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,Cm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(s=>Nn("italic"),["stop"])),title:e.unref(D)("textEditor.toolbar.italic")},[...l[79]||(l[79]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,bm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(s=>Nn("underline"),["stop"])),title:e.unref(D)("textEditor.toolbar.underline")},[...l[80]||(l[80]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,wm),l[91]||(l[91]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xe.value}]),onClick:e.withModifiers(Yn,["stop"]),title:e.unref(D)("textEditor.toolbar.citation")},[...l[81]||(l[81]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,xm),l[92]||(l[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ke.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(cl,["stop"]),title:e.unref(D)("textEditor.toolbar.removeLink")},[...l[83]||(l[83]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,Sm)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Gl,["stop"]),title:e.unref(D)("textEditor.toolbar.insertLink")},[...l[82]||(l[82]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,Em)),l[93]||(l[93]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("insertUnorderedList")}]),onClick:e.withModifiers(Ul,["stop"]),title:e.unref(D)("textEditor.toolbar.bulletList")},[...l[84]||(l[84]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,Vm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Qt("insertOrderedList")}]),onClick:e.withModifiers(kl,["stop"]),title:e.unref(D)("textEditor.toolbar.numberList")},[...l[85]||(l[85]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,Nm),l[94]||(l[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Qn,["stop"]),title:e.unref(D)("textEditor.toolbar.image")},[...l[86]||(l[86]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,Bm),ct.value?(e.openBlock(),e.createElementBlock("div",Mm)):e.createCommentVNode("",!0),ct.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(D)("textEditor.toolbar.comment"),onClick:e.withModifiers(On,["stop"])},[...l[87]||(l[87]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,_m)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",$m)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",Lm,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(s=>eo("askAi"),["stop"])),title:e.unref(D)("textEditor.toolbar.askAi")},[l[88]||(l[88]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",Am,e.toDisplayString(e.unref(D)("textEditor.toolbar.askAi")),1)],8,Tm),ot.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)]),An.value?(e.openBlock(),e.createElementBlock("div",Dm,[L.askAi&&An.value?(e.openBlock(),e.createElementBlock("div",Hm)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[$n(s)&&hl(s)?(e.openBlock(),e.createElementBlock("div",Rm,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),$n(s)&&hl(s)&&i<L.customToolbarSlots.length-1&&Rl(i)?(e.openBlock(),e.createElementBlock("div",Fm)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Pm={class:"dss-color-picker__section-title"},Om={class:"dss-color-picker__presets-row"},qm=["title","onClick"],Zm={key:1,class:"dss-color-picker__section"},Wm={class:"dss-color-picker__presets-row"},Um=["title","onClick"],Xm={key:2,class:"dss-color-picker__section"},Ym={class:"dss-color-picker__section-header"},jm={class:"dss-color-picker__presets-row"},Km=["title","onClick"],Gm=["onClick"],Qm={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},Jm=["title","onClick"],e2={class:"dss-color-picker__input-row"},t2=["value"],n2={__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},disableCustomColors:{type:Boolean,default:!1}},emits:["update:modelValue","update:presetColors"],setup(L,{emit:ne}){function _(le){const W=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(le);if(!W)return{h:0,s:0,l:50};const U=parseInt(W[1],16)/255,ie=parseInt(W[2],16)/255,he=parseInt(W[3],16)/255,Ge=Math.max(U,ie,he),At=Math.min(U,ie,he);let jt=0,at=0;const sn=(Ge+At)/2;if(Ge!==At){const S=Ge-At;switch(at=sn>.5?S/(2-Ge-At):S/(Ge+At),Ge){case U:jt=((ie-he)/S+(ie<he?6:0))/6;break;case ie:jt=((he-U)/S+2)/6;break;case he:jt=((U-ie)/S+4)/6;break}}return{h:jt*360,s:at*100,l:sn*100}}function D(le,W,U){W/=100,U/=100;const ie=W*Math.min(U,1-U),he=Ge=>{const At=(Ge+le/30)%12,jt=U-ie*Math.max(Math.min(At-3,9-At,1),-1);return Math.round(255*jt).toString(16).padStart(2,"0")};return`#${he(0)}${he(8)}${he(4)}`}function ce(le){const W=le.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!W)return null;let U=W[1];return U.length===3&&(U=U.split("").map(ie=>ie+ie).join("")),"#"+U}function z(le){const W=le.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!W)return null;const U=Math.max(0,Math.min(255,Number.parseInt(W[1],10))),ie=Math.max(0,Math.min(255,Number.parseInt(W[2],10))),he=Math.max(0,Math.min(255,Number.parseInt(W[3],10)));return`#${U.toString(16).padStart(2,"0")}${ie.toString(16).padStart(2,"0")}${he.toString(16).padStart(2,"0")}`}function M(le){if(typeof le!="string")return null;const W=le.trim();return ce(W)||z(W)}function fe(le,W,U){W/=100,U/=100;const ie=U+W*Math.min(U,1-U),he=ie===0?0:2-2*U/ie;return{h:le,s:he*100,v:ie*100}}function dt(le,W,U){W/=100,U/=100;const ie=U*(1-W/2),he=ie===0||ie===1?0:(U-ie)/Math.min(ie,1-ie);return{h:le,s:he*100,l:ie*100}}const ee=L,v=ne,we=e.ref(!1),ke=e.ref(!1),J=e.ref(!1),X=e.ref(-1),me=e.ref(-1),F=e.ref(null),Se=e.ref(null),Ae=e.ref(null),lt=e.ref(null),ft=e.ref({top:0,left:0}),Z=e.ref(_(ee.modelValue||"#b8a5de")),De=e.computed(()=>Array.isArray(ee.presetGroups)&&ee.presetGroups.length>0),We=e.computed(()=>!ee.disableCustomColors),Ee=e.computed(()=>De.value?0:ee.initialPresetCount!=null?ee.initialPresetCount:me.value<0?null:me.value),_e=e.computed(()=>{const le=Ee.value;return le==null?!0:Math.max(0,ee.presetColors.length-le)<ee.max}),Xe=e.computed(()=>!!(ke.value||X.value>=0||!re.value&&ee.presetColors.length===0));e.computed(()=>{const le=Ee.value;return le!=null&&ee.presetColors.length>le});const re=e.computed(()=>De.value||Ee.value!=null),tt=e.computed(()=>{const le=Ee.value;return le==null?[]:ee.presetColors.slice(0,le)}),Ce=e.computed(()=>{const le=Ee.value;return le==null?[]:ee.presetColors.slice(le)});function nt(le){const W=Ee.value;return W!=null?W+le:-1}function ot(le){const W=Ee.value;return W!=null&&le>=W}function kt(le){ot(le)&&(X.value=le,Z.value=_(ee.presetColors[le]),ke.value=!0,e.nextTick(()=>lt.value?.focus()))}function Vt(le){if(!ot(le))return;const W=ee.presetColors.filter((he,Ge)=>Ge!==le);v("update:presetColors",W);const U=ce(ee.modelValue),ie=ce(ee.presetColors[le]);if(U&&ie&&U.toLowerCase()===ie.toLowerCase()){const he=W[Math.max(0,le-1)]||W[0];he&&v("update:modelValue",he)}}function Ht(){J.value=!J.value,J.value||(X.value=-1,ke.value=!1)}function zt(){if(!We.value||X.value<0)return;const le=mt.value,W=ce(le);if(W){const U=[...ee.presetColors];U[X.value]=W,v("update:presetColors",U),v("update:modelValue",W),X.value=-1,ke.value=!1}}function Nt(){ee.disabled||!We.value||(X.value=-1,ke.value=!ke.value,ke.value&&(ge(),e.nextTick(()=>lt.value?.focus())))}function bt(le){const W=M(le),U=M(ee.modelValue);return W&&U&&W.toLowerCase()===U.toLowerCase()}function Xt(){if(ee.disabled||!We.value||!_e.value)return;const le=mt.value,W=ce(le);if(W){const U=[...ee.presetColors,W];v("update:presetColors",U),v("update:modelValue",W);const ie=Ee.value??me.value;ie>=0&&U.length-ie>=ee.max&&(ke.value=!1)}}const mt=e.computed(()=>{const{h:le,s:W,l:U}=Z.value;return D(le,W,U)}),tn=e.computed(()=>mt.value.toLowerCase()),Y=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${Z.value.h}, 100%, 50%))`})),ye=e.computed(()=>{const le=fe(Z.value.h,Z.value.s,Z.value.l);return{left:`${le.s}%`,bottom:`${le.v}%`,transform:"translate(-50%, 50%)"}}),xe=e.computed(()=>({left:`${Z.value.h/360*100}%`,transform:"translateX(-50%)"})),Pe=e.computed(()=>({position:"fixed",left:`${ft.value.left}px`,top:`${ft.value.top}px`,zIndex:1002}));function j(){if(!F.value||!we.value)return;const le=F.value.getBoundingClientRect(),W=window.innerHeight||document.documentElement.clientHeight;let U=le.bottom+4;const ie=Se.value;ie&&U+ie.offsetHeight>W-8&&(U=le.top-4-ie.offsetHeight),ft.value={top:U,left:le.left}}function ge(){const le=ee.modelValue||"#b8a5de",W=M(le);W&&(Z.value=_(W))}function Be(){v("update:modelValue",mt.value)}function Fe(){ee.disabled||(we.value=!we.value,we.value&&(ge(),e.nextTick(()=>{j(),lt.value?.focus()})))}function Ye(){const le=mt.value,W=ce(le);if(W){if(X.value>=0){const U=[...ee.presetColors];U[X.value]=W,v("update:presetColors",U),v("update:modelValue",W)}else if(We.value&&(ee.presetColors.length>0||De.value)&&ke.value&&_e.value&&!ee.presetColors.some(ie=>ce(ie)?.toLowerCase()===W.toLowerCase())){const ie=[...ee.presetColors,W];v("update:presetColors",ie),v("update:modelValue",W)}}we.value=!1,ke.value=!1,J.value=!1,X.value=-1}function wt(le){if(!Ae.value)return;const W=Ae.value.getBoundingClientRect(),U=ie=>{const he=Math.max(0,Math.min(1,(ie.clientX-W.left)/W.width)),Ge=Math.max(0,Math.min(1,1-(ie.clientY-W.top)/W.height)),At={h:Z.value.h,s:he*100,v:Ge*100};Z.value=dt(At.h,At.s,At.v)};U(le),document.addEventListener("mousemove",U),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",U),Be()},{once:!0})}function et(le){if(!le.currentTarget)return;const U=le.currentTarget.getBoundingClientRect(),ie=he=>{const Ge=Math.max(0,Math.min(1,(he.clientX-U.left)/U.width));Z.value={...Z.value,h:Ge*360}};ie(le),document.addEventListener("mousemove",ie),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ie),Be()},{once:!0})}function Yt(le){const W=le.target.value,U=M(W);U&&(Z.value=_(U),v("update:modelValue",U))}function Ue(le){if(ee.disabled)return;const W=M(le);W&&(Z.value=_(W),v("update:modelValue",W))}let Oe=null,Tt=null;function Lt(){Oe&&(document.removeEventListener("keydown",Oe),Oe=null),Tt&&(window.removeEventListener("resize",Tt),Tt=null)}return e.watch(we,le=>{if(Lt(),le){if(!De.value&&ee.initialPresetCount==null){const W=ee.presetColors.length;W>0&&(me.value<0||W<me.value)&&(me.value=W)}Oe=W=>{W.key==="Escape"&&Ye()},Tt=j,document.addEventListener("keydown",Oe),window.addEventListener("resize",Tt)}}),e.watch(()=>ee.modelValue,()=>{we.value&&ge()},{immediate:!1}),e.watch(Ce,le=>{le.length===0&&(J.value=!1,X.value=-1,ke.value=!1)}),e.onBeforeUnmount(Lt),(le,W)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":L.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:F,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":we.value}]),onClick:Fe},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:mt.value})},[...W[0]||(W[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"},[we.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Ye,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Se,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Pe.value)},[re.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[De.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(L.presetGroups,(U,ie)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ie,class:"dss-color-picker__section"},[e.createElementVNode("span",Pm,e.toDisplayString(U.title),1),e.createElementVNode("div",Om,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.colors,(he,Ge)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ie+"-"+Ge,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":bt(he)}]),style:e.normalizeStyle({backgroundColor:he,"--dss-preset-color":he}),title:he,onClick:e.withModifiers(At=>Ue(he),["stop"])},null,14,qm))),128))])]))),128)):tt.value.length?(e.openBlock(),e.createElementBlock("div",Zm,[W[1]||(W[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",Wm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tt.value,(U,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":bt(U)}]),style:e.normalizeStyle({backgroundColor:U,"--dss-preset-color":U}),title:U,onClick:e.withModifiers(he=>Ue(U),["stop"])},null,14,Um))),128))])])):e.createCommentVNode("",!0),We.value?(e.openBlock(),e.createElementBlock("div",Xm,[e.createElementVNode("div",Ym,[W[3]||(W[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),Ce.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":J.value}]),title:"Manage custom colors",onClick:e.withModifiers(Ht,["stop"])},[...W[2]||(W[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",jm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(U,ie)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ie,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":J.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!J.value&&bt(U),"dss-color-picker__preset-bubble--editing":J.value&&X.value===nt(ie)}]),style:e.normalizeStyle({backgroundColor:X.value===nt(ie)?mt.value:U,"--dss-preset-color":X.value===nt(ie)?mt.value:U}),title:X.value===nt(ie)?mt.value:U,onClick:e.withModifiers(he=>J.value?kt(nt(ie)):Ue(U),["stop"])},null,14,Km),J.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__preset-action dss-color-picker__preset-action--delete",title:"Delete",onClick:e.withModifiers(he=>Vt(nt(ie)),["stop"])},[...W[4]||(W[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,Gm)):e.createCommentVNode("",!0)],2))),128)),_e.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ke.value}]),onClick:e.withModifiers(Nt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):L.presetColors.length?(e.openBlock(),e.createElementBlock("div",Qm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.presetColors,(U,ie)=>(e.openBlock(),e.createElementBlock("button",{key:ie,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":bt(U)}]),style:e.normalizeStyle({backgroundColor:U,"--dss-preset-color":U}),title:U,onClick:e.withModifiers(he=>Ue(U),["stop"])},null,14,Jm))),128)),We.value&&_e.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ke.value}]),onClick:e.withModifiers(Nt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Xe.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:Ae,onMousedown:wt},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(Y.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(ye.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:et},[W[5]||(W[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",e2,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:lt,type:"text",class:"dss-color-picker__hex-input",value:tn.value,onInput:Yt},null,40,t2)]),We.value&&re.value&&(L.presetColors.length||De.value)&&_e.value&&X.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Xt}," Save color ")):e.createCommentVNode("",!0),We.value&&re.value&&X.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:zt}," Save color ")):e.createCommentVNode("",!0),re.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Ye}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},l2={key:0,class:"dss-loader"},o2={key:0,class:"dss-loader-label"},a2={key:1,class:"dss-loader"},s2={key:0,class:"dss-loader-label"},r2={key:2,class:"dss-loader"},i2={key:0,class:"dss-loader-label"},c2={key:3,class:"dss-loader"},u2={key:0,class:"dss-loader-label"},d2={key:4,class:"dss-loader"},m2={key:0,class:"dss-loader-label"},p2={key:5,class:"dss-loader dss-loader--inline"},f2={class:"dss-loader-inline-text"},v2={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(L){const ne=L,_=e.computed(()=>ne.size==="small"?"dss-loaders--size-small":ne.size==="large"?"dss-loaders--size-large":ne.size==="medium"||ne.size==null?"dss-loaders--size-medium":null),D=e.computed(()=>{const ce={};if(!(ne.size==="small"||ne.size==="medium"||ne.size==="large"||ne.size==null)){const z=typeof ne.size=="number"?`${ne.size}px`:String(ne.size);ce["--dss-loader-size"]=z}return ne.color&&(ce["--dss-loader-accent"]=ne.color,ce["--dss-loader-accent-soft"]=`color-mix(in srgb, ${ne.color} 30%, white)`),ce});return(ce,z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",_.value]),style:e.normalizeStyle(D.value)},[L.type==="spinner"?(e.openBlock(),e.createElementBlock("div",l2,[z[0]||(z[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),L.label?(e.openBlock(),e.createElementBlock("span",o2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="dots"?(e.openBlock(),e.createElementBlock("div",a2,[z[1]||(z[1]=e.createElementVNode("span",{class:"dss-loader-dots","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"})],-1)),L.label?(e.openBlock(),e.createElementBlock("span",s2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="battery"?(e.openBlock(),e.createElementBlock("div",r2,[z[2]||(z[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),L.label?(e.openBlock(),e.createElementBlock("span",i2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",c2,[z[3]||(z[3]=e.createElementVNode("span",{class:"dss-loader-double-circle","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-double-circle-outer"}),e.createElementVNode("span",{class:"dss-loader-double-circle-inner"})],-1)),L.label?(e.openBlock(),e.createElementBlock("span",u2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="bars"?(e.openBlock(),e.createElementBlock("div",d2,[z[4]||(z[4]=e.createElementVNode("span",{class:"dss-loader-bars","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"})],-1)),L.label?(e.openBlock(),e.createElementBlock("span",m2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="inline"?(e.openBlock(),e.createElementBlock("div",p2,[z[5]||(z[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",f2,[e.renderSlot(ce.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(L.label),1)])])])):e.createCommentVNode("",!0)],6))}},da="dss-skeleton-item",g2={__name:"DSSSkeleton",props:{loading:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},borderRadius:{type:String,default:"16px"},shimmer:{type:Boolean,default:!0},mode:{type:String,default:"single",validator:L=>["single","multiple"].includes(L)},targetClass:{type:String,default:da},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(L){const ne=L,_=e.computed(()=>{const z={"dss-skeleton--loading":ne.loading,"dss-skeleton--static":!ne.shimmer,"dss-skeleton--multiple":ne.mode==="multiple","dss-skeleton--dark":ne.darkMode};return ne.mode==="multiple"&&ne.targetClass!==da&&(z[`dss-skeleton--target-${ne.targetClass}`]=!0),z}),D=e.computed(()=>{const z={};return ne.borderRadius&&(z.borderRadius=ne.borderRadius),z}),ce=e.computed(()=>{const z={};return ne.borderRadius&&(z["--dss-skeleton-border-radius"]=ne.borderRadius),ne.darkMode?(z["--dss-skeleton-bg"]=ne.bgDark||"#322c3f",z["--dss-skeleton-shimmer"]=ne.shimmerDark||"#3e3f41",z):(ne.bgColor&&(z["--dss-skeleton-bg"]=ne.bgColor),ne.shimmerColor&&(z["--dss-skeleton-shimmer"]=ne.shimmerColor),z)});return(z,M)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",_.value]),style:e.normalizeStyle(ce.value)},[L.loading&&L.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":L.loading&&L.mode==="single"}])},[e.renderSlot(z.$slots,"default")],2)],6))}},h2={key:0,class:"dss-dnd-column-header"},y2={class:"dss-dnd-column-title"},k2={class:"dss-dnd-column-count"},C2=["data-column"],b2={key:0,class:"dss-dnd-indicator"},w2=["onPointerdown"],x2=["onPointerdown"],E2={class:"dss-dnd-item-content"},S2={class:"dss-dnd-item-default"},V2={key:0,class:"dss-dnd-empty"},N2={name:"DSSDnd"},B2=Object.assign(N2,{props:{items:{type:Array,required:!0},columns:{type:Array,required:!0},columnKey:{type:String,default:"status"},positionKey:{type:String,default:"position"},itemKey:{type:String,default:"id"},options:{type:Object,default:()=>({})}},emits:["move","delete"],setup(L,{emit:ne}){const _=L,D=ne,ce=e.useSlots(),z=e.computed(()=>!!ce["delete-zone"]),M={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1,ColColor:!1},fe=e.computed(()=>({...M,..._.options})),dt=e.computed(()=>({"--dss-dnd-col-min-w":fe.value.columnMinWidth,"--dss-dnd-col-max-w":fe.value.columnMaxWidth,"--dss-dnd-col-gap":fe.value.columnGap,"--dss-dnd-indicator-color":fe.value.indicatorColor,"--dss-dnd-body-max-h":fe.value.columnBodyMaxHeight}));function ee(j){if(!fe.value.ColColor||!j)return{};const ge=j.background||j.color;return ge?{background:ge}:{}}const v=e.ref(null),we=e.ref(null),ke=e.ref(!1),J=e.ref(-1),X=e.ref(null);let me=null,F=null,Se=null,Ae=null,lt=0,ft=0,Z="",De=null;const We=5,Ee=e.computed(()=>{const j={};for(const ge of _.columns)j[ge.value]=_.items.filter(Be=>Be[_.columnKey]===ge.value).sort((Be,Fe)=>(Be[_.positionKey]??0)-(Fe[_.positionKey]??0));return j}),_e=e.computed(()=>{const j={},ge=!!v.value,Be=v.value?.[_.itemKey],Fe=we.value,Ye=J.value;for(const wt of _.columns){const et=Ee.value[wt.value]||[],Yt=[],Ue=Fe==wt.value;let Oe=0;for(let Tt=0;Tt<et.length;Tt++){const Lt=et[Tt],le=ge&&Lt[_.itemKey]===Be;!le&&Ue&&Ye===Oe&&Yt.push({type:"indicator",key:`ind-${Oe}`}),le||Oe++,Yt.push({type:"item",item:Lt,isDragged:le,key:`item-${Lt[_.itemKey]}`})}Ue&&Ye>=Oe&&Yt.push({type:"indicator",key:"ind-end"}),j[wt.value]=Yt}return j});function Xe(j,ge){const Fe=(Ee.value[j]||[]).filter(et=>et[_.itemKey]!==v.value?.[_.itemKey]);if(Fe.length===0)return 1;if(ge<=0){const et=Fe[0][_.positionKey];return et!=null&&et>0?et/2:.5}if(ge>=Fe.length){const et=Fe[Fe.length-1][_.positionKey];return(et??0)+1}const Ye=Fe[ge-1][_.positionKey]??0,wt=Fe[ge][_.positionKey]??0;return(Ye+wt)/2}function re(j,ge,Be){Se&&Se.remove();const Fe=j.getBoundingClientRect(),Ye=j.cloneNode(!0);Ye.classList.add("dss-dnd-ghost"),Ye.style.cssText=`
|
|
103
|
+
`){const k=document.createTextNode(" ");l.insertNode(k),l.setStartAfter(k)}}l.insertNode(d);const u=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(u),l.setStartAfter(u),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}_t()}e.nextTick(()=>{Bn(),to()})},lo=()=>{if(!v.value||Q.value)return;const o=window.getSelection();let l=null;o&&o.rangeCount>0&&(l=Kt());const s=/(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,i=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const f=m.parentElement;return!f||f.closest("a")||f.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=i.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const f=c[m],k=f.textContent;s.lastIndex=0;const A=[...k.matchAll(s)];if(A.length===0)continue;const R=A.filter(K=>{const Oe=K[0],Me=K.index;if(Me>0&&k[Me-1]==="@"||Me+Oe.length<k.length&&k[Me+Oe.length]==="@")return!1;const yt=f.parentElement;return!(yt&&yt.closest("a"))});if(R.length===0)continue;if(R.length===1&&R[0][0]===k.trim()){const K=R[0][0],Oe=K.startsWith("http://")||K.startsWith("https://")?K:`https://${K}`,Me=document.createElement("a");Me.href=Oe,Me.textContent=K,Me.style.color="#60afdf",Me.style.textDecoration="underline",f.parentNode&&(f.parentNode.replaceChild(Me,f),u=!0);continue}let E=0;const re=document.createDocumentFragment();if(R.forEach(K=>{const Oe=K.index,Me=K[0];if(Oe>E){const mn=k.substring(E,Oe);mn&&re.appendChild(document.createTextNode(mn))}const yt=Me.startsWith("http://")||Me.startsWith("https://")?Me:`https://${Me}`,dn=document.createElement("a");dn.href=yt,dn.textContent=Me,dn.style.color="#60afdf",dn.style.textDecoration="underline",re.appendChild(dn),E=Oe+Me.length}),E<k.length){const K=k.substring(E);K&&re.appendChild(document.createTextNode(K))}f.parentNode&&re.childNodes.length>0&&(f.parentNode.replaceChild(re,f),u=!0)}u&&l&&e.nextTick(()=>{Ln(l),Bn()})},Ko=()=>{if(!v.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,l=document.createTreeWalker(v.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}}),s=[];let i;for(;i=l.nextNode();)s.push(i);for(let c=s.length-1;c>=0;c--){const d=s[c],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let f=0;const k=document.createDocumentFragment();m.forEach(A=>{const R=A.index,E=A[0].startsWith("<u>")?"u":"ins",re=A[1]||A[2]||"";R>f&&k.appendChild(document.createTextNode(u.substring(f,R)));const K=document.createElement(E);K.textContent=re,k.appendChild(K),f=R+A[0].length}),f<u.length&&k.appendChild(document.createTextNode(u.substring(f))),d.parentNode&&k.childNodes.length>0&&d.parentNode.replaceChild(k,d)}},_o=o=>{if(!v.value||Q.value)return;if(!o){Ko();return}if(!["*","_",">"].includes(o))return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const i=s.getRangeAt(0);if(!i.collapsed)return;const c=i.startContainer.nodeType===Node.TEXT_NODE?i.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):i.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===v.value||!v.value.contains(c))return;const d=()=>{let mn="",an=0,Ut=!1;const kn=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:sl=>sl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let fn=0;for(;kn.nextNode();){const sl=kn.currentNode,El=sl.textContent||"",pl=fn;if(fn+=El.length,sl===i.startContainer){mn+=El.substring(0,i.startOffset),an=pl+i.startOffset,Ut=!0;break}mn+=El}return Ut||(an=mn.length),{textBeforeCursor:mn,cursorCharOffset:an}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,f=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?f="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?f="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(f=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const k=m[0],A=m[1],R=u.length-k.length,re=(mn=>{let an=0;const Ut=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:fn=>fn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let kn;for(;kn=Ut.nextNode();){const fn=(kn.textContent||"").length;if(an+fn>=mn)return{node:kn,offset:mn-an};an+=fn}return null})(R);if(!re)return;const K=document.createRange();K.setStart(re.node,re.offset),K.setEnd(i.endContainer,i.endOffset);const Oe=document.createElement(f);Oe.textContent=A,K.deleteContents(),K.insertNode(Oe);const Me=window.getSelection(),yt=document.createRange();yt.setStartAfter(Oe),yt.collapse(!0),Me.removeAllRanges(),Me.addRange(yt);const dn=Kt();e.nextTick(()=>{_t(),dn&&Ln(dn)})},Qn=()=>{v.value&&(ee.value=Kt(),Vt.value="",Ht.value="",Fe.value="",Nt.value="",bt.value="",zt.value=null,Ct.value=null,Be.value="upload",st.value=!0,un(),e.nextTick(()=>{Jt.value&&Jt.value.focus(),dt.value&&(dt.value.value="")}))},Jn=o=>{const l=o.target?.files?.[0];if(!l){zt.value=null,Ht.value="";return}zt.value=l;const s=new FileReader;s.onload=i=>{Ht.value=i.target?.result||""},s.readAsDataURL(l)},ko=()=>{dt.value&&dt.value.click()},oo=()=>{Nt.value&&(bt.value="")},qn=()=>{bt.value&&(Nt.value="")},ao=()=>{let o=Ct.value;if(!o){const l=window.getSelection();if(l&&l.rangeCount>0){const i=l.getRangeAt(0).commonAncestorContainer;o=i.nodeType===1?i.closest("img"):i.parentElement?.closest("img")}}if(o){const l=o.getAttribute("data-alt")||o.getAttribute("alt")||"";Ct.value=o,Vt.value=l.trim()===""||l.trim()==="Image"?"":l;const s=o.getAttribute("src")||o.src||"";s.startsWith("http://")||s.startsWith("https://")?(Fe.value=s,Ht.value="",Be.value="url"):(Ht.value=s,Fe.value="",Be.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";Nt.value=c.endsWith("px")?c.replace("px",""):c,bt.value=d.endsWith("px")?d.replace("px",""):d,ee.value=null}else{Qn();return}st.value=!0,ge.value=!1,ve.value=!1,e.nextTick(()=>{Be.value==="url"&&en.value?(en.value.focus(),en.value.select()):Jt.value&&(Jt.value.focus(),Jt.value.select()),dt.value&&(dt.value.value="")})},jl=()=>{st.value=!1,Vt.value="",Ht.value="",Fe.value="",Nt.value="",bt.value="",zt.value=null,Ct.value=null,ee.value=null,Be.value="upload"},ml=()=>{const o=(Vt.value||"").trim(),l=v.value?._mutationObserver;l&&l.disconnect(),Pe.value?(Ze.value&&(clearTimeout(Ze.value),Ze.value=null),he(),Pe.value=!1):he();const s=Be.value==="url"?Fe.value.trim():Ht.value;if(Ct.value&&v.value&&v.value.contains(Ct.value)){s&&(Ct.value.src=s),Ct.value.setAttribute("alt",o),Ct.value.setAttribute("data-alt",o),Nt.value?(Ct.value.style.width=`${Nt.value}px`,Ct.value.setAttribute("width",Nt.value)):(Ct.value.style.removeProperty("width"),Ct.value.removeAttribute("width")),bt.value?(Ct.value.style.height=`${bt.value}px`,Ct.value.setAttribute("height",bt.value)):(Ct.value.style.removeProperty("height"),Ct.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(Ct.value),c.collapse(!0),i.addRange(c)}_t()}else{if(!s){l&&v.value&&l.observe(v.value,{childList:!0,subtree:!0}),jl();return}if(v.value){v.value.focus();const i=window.getSelection();i&&i.rangeCount>0&&i.removeAllRanges();const c=window.getSelection();let d=null;if(ee.value&&(Ln(ee.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&v.value){if(d=document.createRange(),v.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",v.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(v.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){jl();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!v.value.contains(m)){if(d=document.createRange(),v.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",v.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(v.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const f=document.createElement("img");f.src=s,f.setAttribute("alt",o),f.setAttribute("data-alt",o),Nt.value&&(f.style.width=`${Nt.value}px`,f.setAttribute("width",Nt.value)),bt.value&&(f.style.height=`${bt.value}px`,f.setAttribute("height",bt.value));try{d.insertNode(f),d.setStartAfter(f),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(v.value){if(v.value.childNodes.length===0){const R=document.createElement("p");v.value.appendChild(R),R.appendChild(f)}else{const R=v.value.lastChild;if(R&&R.nodeType===1)R.appendChild(f);else{const E=document.createElement("p");v.value.appendChild(E),E.appendChild(f)}}const A=document.createRange();A.setStartAfter(f),A.collapse(!0),c&&(c.removeAllRanges(),c.addRange(A))}}Ct.value=f,_t()}}e.nextTick(()=>{l&&v.value&&l.observe(v.value,{childList:!0,subtree:!0}),Bn(),Qt(),jl()})};e.watch(()=>M.modelValue,o=>{if(M.richText&&v.value&&!Q.value){const l=zn(o||""),i=v.value.innerHTML.replace(/ |\u00A0/g," "),c=l.replace(/ |\u00A0/g," ");if(i!==c){const d=Kt();v.value.innerHTML=l,e.nextTick(()=>{Rn();const u=v.value.innerHTML||"",m=M.title||"",f=M.description||"";Tt.value=u,le.value=m,U.value=f,Lt.value=u,X.value=m,ie.value=f,Ge.value=[],Xt.value=[],Ze.value&&(clearTimeout(Ze.value),Ze.value=null),Pe.value=!1,d&&Ln(d),Mn(),Xe(),ol(),Bn(),Qt(),ct(),St("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>M.richText,o=>{o?(Qt(),e.nextTick(()=>{bo()})):(Il(),oe.value=[],He.value&&(He.value.disconnect(),He.value=null)),ct()}),e.watch(()=>M.floatingToolbar,o=>{o?Qt():Il()}),e.watch(()=>M.disabled,o=>{o&&Il(),ct()}),e.watch(()=>M.description,()=>{e.nextTick(()=>{S.value?rt():qt()})}),e.watch(()=>M.title,()=>{e.nextTick(()=>{sn.value?te():pt()})}),e.watch(()=>M.customToolbarSlots,()=>{e.nextTick(()=>{Gn()})},{deep:!0}),e.watch(()=>M.comments,(o,l)=>{if(M.commentUser){if(Wt.value){Wt.value=!1;return}yn.value||M.richText&&v.value&&e.nextTick(()=>{xl()})}},{deep:!0,immediate:!1});const xl=()=>{if(M.commentUser&&!yn.value&&!(!M.comments||!Array.isArray(M.comments)||M.comments.length===0)&&!(!M.richText||!v.value)){yn.value=!0;try{const o=new Set,l=M.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),s=v.value.querySelectorAll("[data-comment], [data-fake-comment]"),i=s.length;s.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 f=String(m);if(d.has(f))return;const k=v.value.querySelector(`[data-comment="${f}"]`);if(k){Kl(k,u),d.add(f);return}try{const A=Dn(u.selection_range,u.selection_text);if(A&&!A.collapsed){const R=A.commonAncestorContainer,E=R.nodeType===3?R.parentElement:R;if(E){const Oe=E.closest("[data-comment], [data-fake-comment]");if(Oe){const Me=Oe.getAttribute("data-comment")||Oe.getAttribute("data-fake-comment");if(String(Me)===String(m)){Oe.setAttribute("data-comment",f),Oe.removeAttribute("data-fake-comment"),Kl(Oe,u),d.add(f);return}else return}}const re=v.value.querySelector(`[data-comment="${f}"]`);if(re){Kl(re,u),d.add(f);return}const K=document.createElement("span");K.setAttribute("data-comment",f),Kl(K,u);try{A.surroundContents(K),c++,d.add(f)}catch{try{const Me=document.createRange();Me.setStart(A.startContainer,A.startOffset),Me.setEnd(A.endContainer,A.endOffset),Co(Me),Me.surroundContents(K),c++,d.add(f)}catch{try{const yt=A.extractContents();K.appendChild(yt),A.insertNode(K),c++,d.add(f)}catch(yt){console.warn("Failed to create comment marker:",yt)}}}}}catch{}}),e.nextTick(()=>{St("restoreCommentsFromModel"),_t(),yn.value=!1})}catch{yn.value=!1}}},Co=o=>{if(!o||!v.value)return o;try{const l=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let s=o.startContainer,i=o.startOffset;if(s.nodeType===3){const u=s.parentElement;u&&l.includes(u.tagName)&&(i===0&&!$o(s)||o.setStartBefore(u))}else s.nodeType===1&&l.includes(s.tagName)&&i>0&&o.setStartBefore(s);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&l.includes(u.tagName)&&(d===c.length&&!Ll(c)||o.setEndAfter(u))}else c.nodeType===1&&l.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},$o=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},Ll=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},Dn=(o,l)=>{if(!o||!v.value)return null;try{const s=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let i=0;const c=[v.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const f=i+d.length;!u&&o.start>=i&&o.start<=f&&(s.setStart(d,o.start-i),u=!0),u&&o.end>=i&&o.end<=f&&(s.setEnd(d,o.end-i),m=!0),i=f}else{let f=d.childNodes.length;for(;f--;)c.push(d.childNodes[f])}return u?Co(s):null}}catch{return null}return null},Kl=(o,l)=>{if(!o||!l)return;const s=l.conversation||[],i=new Set,c=[],d=m=>{m&&m.id&&!i.has(m.id)&&(i.add(m.id),c.push(m))};s.length>0&&s.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=s.length;u>0?o.setAttribute("data-comment-count",String(u)):o.removeAttribute("data-comment-count")},St=(o="unknown")=>{if(!M.commentUser||!M.richText||!v.value){oe.value=[];return}Date.now()-xt.value<Mt&&kt.value!==null||kt.value===null&&(kt.value=requestAnimationFrame(()=>{if(kt.value=null,xt.value=Date.now(),ze.value)return;ze.value=!0;const s={},i=v.value;if(!i){ze.value=!1;return}const c=i.closest(".editor-with-comments");if(!c){ze.value=!1;return}const d=i.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(E=>{const re=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");re&&E.tagName==="SPAN"&&(m.has(re)||(u.push(E),m.add(re)))}),d.forEach(E=>{const re=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");!re||m.has(re)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(E.tagName)?E.querySelector(`span[data-comment="${re}"], span[data-fake-comment="${re}"]`)||(u.push(E),m.add(re)):E.tagName!=="SPAN"&&(u.push(E),m.add(re)))});const f=c.getBoundingClientRect(),k=i.getBoundingClientRect();u.forEach((E,re)=>{let K=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");if(!K)return;if(typeof K=="string"&&K.startsWith("comment-")){const fl=E.textContent?.trim(),rl=M.comments?.find(el=>(typeof el.conversation_id=="string"&&el.conversation_id.startsWith("comment-")?null:el.conversation_id)&&el.selection_text?.trim()===fl);rl?(K=String(rl.conversation_id),E.setAttribute("data-comment",K),E.removeAttribute("data-fake-comment")):(K=String(Date.now()),E.setAttribute("data-comment",K),E.removeAttribute("data-fake-comment"))}const Oe=E.getBoundingClientRect(),Me=window.getComputedStyle(E),yt=parseFloat(Me.lineHeight)||parseFloat(Me.fontSize)*1.2,an=Oe.top-k.top+yt/2-15,kn=k.top-f.top+an;let fn=null,sl=null,El=0;const pl=[],To=new Set;if(K&&M.comments){const fl=M.comments.find(rl=>String(rl.conversation_id||rl.id)===String(K));if(fl){const rl=fl.conversation||[];rl.length>0?(rl.forEach(el=>{el.user&&el.user.id&&!To.has(el.user.id)&&(To.add(el.user.id),pl.push(el.user))}),El=rl.length):(El=0,fn=null,sl=null),pl.length>0?fn=pl[0]:fn=null,pl.length>1?sl=pl[1]:sl=null}}const wo=Oe.top+yt/2-15,Ao=wo+30,Do=5,Ho=Ao>k.top+Do&&wo<k.bottom-Do?1:0;oe.value.find(fl=>fl.id===K);let so=E;if(!so&&K&&v.value){const fl=String(K);so=v.value.querySelector(`[data-comment="${fl}"], [data-fake-comment="${fl}"]`)}const Dl=pl.length;s[K]?(s[K].top=kn,s[K].opacity=Ho,s[K].element=so,s[K].firstUser=fn,s[K].secondUser=sl,s[K].totalCount=El,s[K].uniqueUserCount=Dl):s[K]={id:K,top:kn,opacity:Ho,element:so,firstUser:fn,secondUser:sl,totalCount:El,uniqueUserCount:Dl}});const A=Object.values(s).map(E=>{const re=Math.max(0,(E.uniqueUserCount??0)-2);if(!E.element&&E.id&&v.value){const Oe=String(E.id);E.element=v.value.querySelector(`[data-comment="${Oe}"], [data-fake-comment="${Oe}"]`)}return{...E,firstUser:E.firstUser||null,secondUser:E.secondUser||null,totalCount:E.totalCount,additionalCount:re}});(oe.value.length!==A.length||A.some((E,re)=>{const K=oe.value[re];if(!K)return!0;const Oe=(K.firstUser?.id||null)!==(E.firstUser?.id||null),Me=(K.secondUser?.id||null)!==(E.secondUser?.id||null);return K.id!==E.id||Math.abs(K.top-E.top)>1||K.opacity!==E.opacity||K.totalCount!==E.totalCount||K.additionalCount!==E.additionalCount||Oe||Me||K.element!==E.element}))&&(oe.value=A),ze.value=!1}))},Lo=o=>{if(!o)return;let l=o.element;if(!l&&o.id&&v.value){const s=String(o.id);l=v.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}l&&(Tl(),jn.value=l,l.classList.add("editor-comment-highlighted"))},Tl=(o=!1)=>{!o&&hn.value!==null&&jn.value&&(jn.value.getAttribute("data-comment")||jn.value.getAttribute("data-fake-comment"))===hn.value||(v.value&&v.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),jn.value&&(jn.value.classList.remove("editor-comment-highlighted"),jn.value=null))},ln=o=>{if(!o||!o.element)return;Tl(!0);const l=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!l)return;const s=`[data-comment="${l}"], [data-fake-comment="${l}"]`;fe("comment-marker-clicked",{commentId:l,selector:s,element:o.element})},Al=()=>{Tl()},bo=()=>{!M.richText||!v.value||(He.value&&He.value.disconnect(),Et.value!==null&&(clearTimeout(Et.value),Et.value=null),He.value=new MutationObserver(()=>{Et.value===null&&(Et.value=setTimeout(()=>{Et.value=null,e.nextTick(()=>{St("MutationObserver")})},200))}),He.value.observe(v.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),St("setupCommentMarkersObserver-initial"))},Wn=(o,l)=>{if(!o||!l)return;const s=l.getBoundingClientRect();let i=s.top,c=s.right+4;o.style.top=`${i}px`,o.style.left=`${c}px`,o.offsetHeight;const d=o.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const f=s.left-d.width-4;o.style.left=`${f}px`}if(d.bottom>m){const f=Math.max(8,m-d.height-8);o.style.top=`${f}px`}d.top<0&&(o.style.top="8px")};return e.watch(()=>Ue.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const i=s.getAttribute("data-submenu-id");if(i===o&&o){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${i}"]`);if(c){if(s.parentNode!==document.body){const d=s.parentNode;s.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(s)}s.style.display="block",s.style.visibility="hidden",s.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{Wn(s,c),s.offsetHeight,s.setAttribute("data-active","true"),s.style.visibility="visible",s.style.opacity="1"})})}else s.setAttribute("data-active","true")}else s.setAttribute("data-active","false"),s.style.display="none",s.style.top="",s.style.left="",s.style.visibility="",s.style.opacity=""})})}),e.watch(()=>[we.value,ut.value],()=>{we.value==="askAi"||ut.value==="askAi"?e.nextTick(()=>{wn()}):(Ue.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(l=>{if(l.parentNode===document.body){const s=l.getAttribute("data-submenu-id");if(s){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(i)if(l.dataset.originalParentRef==="inside")i.appendChild(l);else{const d=i.closest(".dss-toolbar-dropdown");d&&d.insertBefore(l,i.nextSibling)}}}})}))}),e.watch(()=>M.locale,o=>{o&&o!==ce.value&&(ce.value=o)},{immediate:!0}),ne({openCommentOverlayForSelector:Xo,updateCommentMarkers:St,restoreCommentsFromModel:xl}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container",[{"editor-with-comments":it.value},Dt.value]]),style:e.normalizeStyle(Bt.value)},[L.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",qu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:ae,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,Wu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Zn.value}]),onClick:on,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,Zu),l[61]||(l[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Uu,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=s=>Fl("paragraph")),title:e.unref(D)("textEditor.toolbar.paragraphFormat")},[V.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Yu)):V.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,ju)):V.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Ku)):V.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Gu)):V.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Qu)):V.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Ju)):(e.openBlock(),e.createElementBlock("svg",ed,[...l[47]||(l[47]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[48]||(l[48]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Xu),we.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]=s=>Pn("<h1>"))},[e.createElementVNode("img",{src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,td),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]=s=>Pn("<h2>"))},[e.createElementVNode("img",{src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,nd),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]=s=>Pn("<h3>"))},[e.createElementVNode("img",{src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,ld),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]=s=>Pn("<h4>"))},[e.createElementVNode("img",{src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,od),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]=s=>Pn("<h5>"))},[e.createElementVNode("img",{src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,ad),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]=s=>Pn("<h6>"))},[e.createElementVNode("img",{src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,sd),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]=s=>Pn("<p>"))},[l[49]||(l[49]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("bold")}]),onClick:l[9]||(l[9]=s=>Nn("bold")),title:e.unref(D)("textEditor.toolbar.bold")},[...l[50]||(l[50]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,rd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("italic")}]),onClick:l[10]||(l[10]=s=>Nn("italic")),title:e.unref(D)("textEditor.toolbar.italic")},[...l[51]||(l[51]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,id),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("underline")}]),onClick:l[11]||(l[11]=s=>Nn("underline")),title:e.unref(D)("textEditor.toolbar.underline")},[...l[52]||(l[52]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,cd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":je.value}]),onClick:Yn,title:e.unref(D)("textEditor.toolbar.citation")},[...l[53]||(l[53]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,ud),l[62]||(l[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:cl,title:e.unref(D)("textEditor.toolbar.removeLink")},[...l[55]||(l[55]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,md)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Gl,title:e.unref(D)("textEditor.toolbar.insertLink")},[...l[54]||(l[54]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,dd)),l[63]||(l[63]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("insertUnorderedList")}]),onClick:Ul,title:e.unref(D)("textEditor.toolbar.bulletList")},[...l[56]||(l[56]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,pd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("insertOrderedList")}]),onClick:kl,title:e.unref(D)("textEditor.toolbar.numberList")},[...l[57]||(l[57]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,fd),l[64]||(l[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Qn,title:e.unref(D)("textEditor.toolbar.image")},[...l[58]||(l[58]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,vd),it.value&&j.value?(e.openBlock(),e.createElementBlock("div",gd)):e.createCommentVNode("",!0),it.value&&j.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(D)("textEditor.toolbar.comment"),onClick:On},[...l[59]||(l[59]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,hd)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",yd)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",kd,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=s=>Fl("askAi")),title:e.unref(D)("textEditor.toolbar.askAi")},[l[60]||(l[60]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",bd,e.toDisplayString(e.unref(D)("textEditor.toolbar.askAi")),1)],8,Cd),we.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",wd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[$n(s)?(e.openBlock(),e.createElementBlock("div",xd,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),$n(s)&&i<L.customToolbarSlots.length-1&&Vl(i)?(e.openBlock(),e.createElementBlock("div",Ed)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(we.value==="paragraph"||we.value==="askAi")&&L.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:un})):e.createCommentVNode("",!0),e.createVNode(na,{showModal:Ae.value,width:"500px",height:"55vh",onCloseModal:to},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(D)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Sd,[e.createElementVNode("div",Vd,[e.createElementVNode("label",Nd,e.toDisplayString(e.unref(D)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:De,type:"text","onUpdate:modelValue":l[15]||(l[15]=s=>ft.value=s),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.link.enterAltText"),onKeyup:e.withKeys(no,["enter"])},null,40,Bd),[[e.vModelText,ft.value]])]),e.createElementVNode("div",Md,[e.createElementVNode("label",_d,e.toDisplayString(e.unref(D)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Z,type:"text","onUpdate:modelValue":l[16]||(l[16]=s=>tt.value=s),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.link.enterUrl"),onKeyup:e.withKeys(no,["enter"])},null,40,$d),[[e.vModelText,tt.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:to},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:no},e.toDisplayString(e.unref(D)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(na,{showModal:st.value,width:"500px",height:"80vh",onCloseModal:jl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Ct.value?e.unref(D)("textEditor.image.editImage"):e.unref(D)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Ld,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Be.value==="upload"}]),onClick:l[17]||(l[17]=s=>Be.value="upload")},e.toDisplayString(e.unref(D)("textEditor.image.upload")),3),l[65]||(l[65]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Be.value==="url"}]),onClick:l[18]||(l[18]=s=>Be.value="url")},e.toDisplayString(e.unref(D)("textEditor.image.imageLink")),3)]),Be.value==="upload"?(e.openBlock(),e.createElementBlock("div",Td,[e.createElementVNode("div",Ad,[e.createElementVNode("div",Dd,[vl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Hd,e.toDisplayString(e.unref(D)("textEditor.image.uploadImage")),1)),vl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:ko},[e.createElementVNode("img",{src:Ht.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Rd),l[66]||(l[66]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:dt,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Jn},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:dt,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Jn},null,544))]),e.createElementVNode("div",Fd,[e.createElementVNode("label",Id,e.toDisplayString(e.unref(D)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Jt,type:"text","onUpdate:modelValue":l[19]||(l[19]=s=>Vt.value=s),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterAltText"),onKeyup:e.withKeys(ml,["enter"])},null,40,zd),[[e.vModelText,Vt.value]])]),e.createElementVNode("div",Pd,[e.createElementVNode("label",Od,e.toDisplayString(e.unref(D)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=s=>Nt.value=s),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(ml,["enter"]),onInput:oo},null,40,qd),[[e.vModelText,Nt.value]])]),e.createElementVNode("div",Wd,[e.createElementVNode("label",Zd,e.toDisplayString(e.unref(D)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=s=>bt.value=s),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(ml,["enter"]),onInput:qn},null,40,Ud),[[e.vModelText,bt.value]])])])])):e.createCommentVNode("",!0),Be.value==="url"?(e.openBlock(),e.createElementBlock("div",Xd,[e.createElementVNode("div",Yd,[e.createElementVNode("div",jd,[e.createElementVNode("label",Kd,e.toDisplayString(e.unref(D)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:en,type:"text","onUpdate:modelValue":l[22]||(l[22]=s=>Fe.value=s),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(ml,["enter"])},null,40,Gd),[[e.vModelText,Fe.value]])]),e.createElementVNode("div",Qd,[e.createElementVNode("label",Jd,e.toDisplayString(e.unref(D)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=s=>Vt.value=s),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterAltText"),onKeyup:e.withKeys(ml,["enter"])},null,40,e1),[[e.vModelText,Vt.value]])]),e.createElementVNode("div",t1,[e.createElementVNode("label",n1,e.toDisplayString(e.unref(D)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=s=>Nt.value=s),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(ml,["enter"]),onInput:oo},null,40,l1),[[e.vModelText,Nt.value]])]),e.createElementVNode("div",o1,[e.createElementVNode("label",a1,e.toDisplayString(e.unref(D)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=s=>bt.value=s),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(ml,["enter"]),onInput:qn},null,40,s1),[[e.vModelText,bt.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:jl},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:ml},e.toDisplayString(e.unref(D)("textEditor.image.save")),1)]),_:1},8,["showModal"]),L.showTitle?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Un.value&&sn.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.labels.title")),1),e.createElementVNode("div",r1,[sn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",i1,[L.title?(e.openBlock(),e.createElementBlock("span",c1,e.toDisplayString(L.title),1)):(e.openBlock(),e.createElementBlock("span",u1,e.toDisplayString(il.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:ye,value:L.title,onInput:at,onFocus:Te,onBlur:vt,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!sn.value}]),placeholder:il.value,disabled:L.disabled,rows:"1"},null,42,d1)])],2)):e.createCommentVNode("",!0),L.showTitle&&Un.value&&sn.value?(e.openBlock(),e.createElementBlock("div",m1,[e.renderSlot(o.$slots,"title-slot")])):e.createCommentVNode("",!0),L.showDescription?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":Xn.value&&S.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.labels.description")),1),e.createElementVNode("div",p1,[S.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",f1,[L.description?(e.openBlock(),e.createElementBlock("span",v1,e.toDisplayString(L.description),1)):(e.openBlock(),e.createElementBlock("span",g1,e.toDisplayString(_n.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Ke,value:L.description,onInput:gn,onFocus:vn,onBlur:bn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!S.value}]),placeholder:_n.value,disabled:L.disabled,rows:"1"},null,42,h1)])],2)):e.createCommentVNode("",!0),L.showDescription&&Xn.value&&S.value?(e.openBlock(),e.createElementBlock("div",y1,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),it.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:6},e.renderList(oe.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":hn.value===s.id,"editor-comment-marker-group-out-of-view":s.opacity===0}]),"data-comment-id":s.id,style:e.normalizeStyle({top:s.top+"px"}),onMouseenter:i=>Lo(s),onMouseleave:Al},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>ln(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,b1)):(e.openBlock(),e.createElementBlock("span",w1,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,C1)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>ln(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,E1)):(e.openBlock(),e.createElementBlock("span",S1,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,x1)):e.createCommentVNode("",!0),s.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:s.secondUser?"30px":"15px"}),"data-has-second-user":s.secondUser?"true":"false",onClick:e.withModifiers(i=>ln(s),["stop"])},[e.createElementVNode("span",N1,"+"+e.toDisplayString(s.additionalCount),1)],12,V1)):e.createCommentVNode("",!0)],46,k1))),128)):e.createCommentVNode("",!0),L.richText?(e.openBlock(),e.createElementBlock("div",A1,[e.createElementVNode("div",{ref_key:"editorRef",ref:v,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":L.disabled,"dss-text-editor-fixed-height":L.fixedHeight}]),style:e.normalizeStyle(Vn.value),onInput:_t,onBlur:ht,onClick:Pt,onMouseup:Rt,onKeyup:Rt,onKeydown:Yo,onPaste:yo,onMousemove:$l,onMouseleave:No},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[it.value&&hn.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(y.value)},[W.value||Qe.value.length>0?(e.openBlock(),e.createElementBlock("div",D1,[e.createElementVNode("div",H1,[W.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:W.value},null,8,R1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",F1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe.value,(s,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:"dss-comment-message"},[s.user&&(s.user.avatar||s.user.initials||s.user.name)?(e.openBlock(),e.createElementBlock("div",I1,[e.createElementVNode("div",z1,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,P1)):(e.openBlock(),e.createElementBlock("span",O1,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",q1,[e.createElementVNode("div",W1,[e.createElementVNode("div",Z1,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",U1,e.toDisplayString(T(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":I(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),M.commentUser&&s.user&&s.user.id===M.commentUser.id&&!I(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>fo(s,i),["stop"]),title:e.unref(D)("textEditor.comment.delete")||"Delete comment"},[...l[68]||(l[68]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,X1)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Y1,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:x,"onUpdate:modelValue":l[26]||(l[26]=s=>h.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(D)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Cl,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(x.value){const s=x.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,j1),[[e.vModelText,h.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Cl,["stop"])},[...l[69]||(l[69]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",K1,[e.createElementVNode("div",G1,[e.createElementVNode("span",Q1,e.toDisplayString(pn.value)+" "+e.toDisplayString(pn.value===1?e.unref(D)("textEditor.footer.word"):e.unref(D)("textEditor.footer.words")),1),l[70]||(l[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",J1,e.toDisplayString(ll.value)+" "+e.toDisplayString(ll.value===1?e.unref(D)("textEditor.footer.character"):e.unref(D)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",B1,[e.createElementVNode("textarea",{value:L.modelValue,onInput:B,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":L.fixedHeight}]),placeholder:gl.value,rows:L.rows,disabled:L.disabled,style:e.normalizeStyle(rn.value)},null,46,M1),e.createElementVNode("div",_1,[e.createElementVNode("div",$1,[e.createElementVNode("span",L1,e.toDisplayString(pn.value)+" "+e.toDisplayString(pn.value===1?e.unref(D)("textEditor.footer.word"):e.unref(D)("textEditor.footer.words")),1),l[67]||(l[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",T1,e.toDisplayString(ll.value)+" "+e.toDisplayString(ll.value===1?e.unref(D)("textEditor.footer.character"):e.unref(D)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Y.value&&me.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(F.value),onMouseenter:l[28]||(l[28]=s=>Ee.value=!0),onMouseleave:In},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(jo,["stop"]),title:me.value},e.toDisplayString(me.value),9,em),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Mo,["stop"]),title:e.unref(D)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",nm,[...l[71]||(l[71]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,tm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ve.value&&Ne.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(q.value),onMouseenter:l[29]||(l[29]=s=>ge.value=!0),onMouseleave:Yl},[e.createElementVNode("div",lm,[Ne.value===e.unref(D)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",om,[...l[72]||(l[72]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:Ne.value},e.toDisplayString(Ne.value),9,am)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(ao,["stop"]),title:e.unref(D)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",rm,[...l[73]||(l[73]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,sm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.floatingToolbar&&L.richText&&et.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:nt,class:"dss-floating-toolbar",style:e.normalizeStyle(ke.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",im,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(ae,["stop"]),title:e.unref(D)("textEditor.toolbar.undo")},[...l[74]||(l[74]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,cm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Zn.value}]),onClick:e.withModifiers(on,["stop"]),title:e.unref(D)("textEditor.toolbar.redo")},[...l[75]||(l[75]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,um),l[89]||(l[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",dm,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(s=>eo("paragraph"),["stop"])),title:e.unref(D)("textEditor.toolbar.paragraphFormat")},[V.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,pm)):V.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,fm)):V.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,vm)):V.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,gm)):V.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,hm)):V.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,ym)):(e.openBlock(),e.createElementBlock("svg",km,[...l[76]||(l[76]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[77]||(l[77]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,mm),ut.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]=s=>dl("<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]=s=>dl("<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]=s=>dl("<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]=s=>dl("<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]=s=>dl("<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]=s=>dl("<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]=s=>dl("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),l[90]||(l[90]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(s=>Nn("bold"),["stop"])),title:e.unref(D)("textEditor.toolbar.bold")},[...l[78]||(l[78]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,Cm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(s=>Nn("italic"),["stop"])),title:e.unref(D)("textEditor.toolbar.italic")},[...l[79]||(l[79]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,bm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(s=>Nn("underline"),["stop"])),title:e.unref(D)("textEditor.toolbar.underline")},[...l[80]||(l[80]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,wm),l[91]||(l[91]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":je.value}]),onClick:e.withModifiers(Yn,["stop"]),title:e.unref(D)("textEditor.toolbar.citation")},[...l[81]||(l[81]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,xm),l[92]||(l[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(cl,["stop"]),title:e.unref(D)("textEditor.toolbar.removeLink")},[...l[83]||(l[83]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,Sm)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Gl,["stop"]),title:e.unref(D)("textEditor.toolbar.insertLink")},[...l[82]||(l[82]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,Em)),l[93]||(l[93]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("insertUnorderedList")}]),onClick:e.withModifiers(Ul,["stop"]),title:e.unref(D)("textEditor.toolbar.bulletList")},[...l[84]||(l[84]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,Vm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Gt("insertOrderedList")}]),onClick:e.withModifiers(kl,["stop"]),title:e.unref(D)("textEditor.toolbar.numberList")},[...l[85]||(l[85]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,Nm),l[94]||(l[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Qn,["stop"]),title:e.unref(D)("textEditor.toolbar.image")},[...l[86]||(l[86]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,Bm),it.value?(e.openBlock(),e.createElementBlock("div",Mm)):e.createCommentVNode("",!0),it.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(D)("textEditor.toolbar.comment"),onClick:e.withModifiers(On,["stop"])},[...l[87]||(l[87]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,_m)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",$m)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",Lm,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(s=>eo("askAi"),["stop"])),title:e.unref(D)("textEditor.toolbar.askAi")},[l[88]||(l[88]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",Am,e.toDisplayString(e.unref(D)("textEditor.toolbar.askAi")),1)],8,Tm),ut.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)]),An.value?(e.openBlock(),e.createElementBlock("div",Dm,[L.askAi&&An.value?(e.openBlock(),e.createElementBlock("div",Hm)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[$n(s)&&hl(s)?(e.openBlock(),e.createElementBlock("div",Rm,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),$n(s)&&hl(s)&&i<L.customToolbarSlots.length-1&&Rl(i)?(e.openBlock(),e.createElementBlock("div",Fm)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Pm={class:"dss-color-picker__section-title"},Om={class:"dss-color-picker__presets-row"},qm=["title","onClick"],Wm={key:1,class:"dss-color-picker__section"},Zm={class:"dss-color-picker__presets-row"},Um=["title","onClick"],Xm={key:2,class:"dss-color-picker__section"},Ym={class:"dss-color-picker__section-header"},jm={class:"dss-color-picker__presets-row"},Km=["title","onClick"],Gm=["onClick"],Qm={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},Jm=["title","onClick"],e2={class:"dss-color-picker__input-row"},t2=["value"],n2={__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},disableCustomColors:{type:Boolean,default:!1}},emits:["update:modelValue","update:presetColors"],setup(L,{emit:ne}){function _(le){const U=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(le);if(!U)return{h:0,s:0,l:50};const X=parseInt(U[1],16)/255,ie=parseInt(U[2],16)/255,ye=parseInt(U[3],16)/255,Ke=Math.max(X,ie,ye),At=Math.min(X,ie,ye);let Yt=0,lt=0;const sn=(Ke+At)/2;if(Ke!==At){const S=Ke-At;switch(lt=sn>.5?S/(2-Ke-At):S/(Ke+At),Ke){case X:Yt=((ie-ye)/S+(ie<ye?6:0))/6;break;case ie:Yt=((ye-X)/S+2)/6;break;case ye:Yt=((X-ie)/S+4)/6;break}}return{h:Yt*360,s:lt*100,l:sn*100}}function D(le,U,X){U/=100,X/=100;const ie=U*Math.min(X,1-X),ye=Ke=>{const At=(Ke+le/30)%12,Yt=X-ie*Math.max(Math.min(At-3,9-At,1),-1);return Math.round(255*Yt).toString(16).padStart(2,"0")};return`#${ye(0)}${ye(8)}${ye(4)}`}function ce(le){const U=le.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!U)return null;let X=U[1];return X.length===3&&(X=X.split("").map(ie=>ie+ie).join("")),"#"+X}function z(le){const U=le.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!U)return null;const X=Math.max(0,Math.min(255,Number.parseInt(U[1],10))),ie=Math.max(0,Math.min(255,Number.parseInt(U[2],10))),ye=Math.max(0,Math.min(255,Number.parseInt(U[3],10)));return`#${X.toString(16).padStart(2,"0")}${ie.toString(16).padStart(2,"0")}${ye.toString(16).padStart(2,"0")}`}function M(le){if(typeof le!="string")return null;const U=le.trim();return ce(U)||z(U)}function fe(le,U,X){U/=100,X/=100;const ie=X+U*Math.min(X,1-X),ye=ie===0?0:2-2*X/ie;return{h:le,s:ye*100,v:ie*100}}function mt(le,U,X){U/=100,X/=100;const ie=X*(1-U/2),ye=ie===0||ie===1?0:(X-ie)/Math.min(ie,1-ie);return{h:le,s:ye*100,l:ie*100}}const J=L,v=ne,we=e.ref(!1),Ce=e.ref(!1),Q=e.ref(!1),Y=e.ref(-1),me=e.ref(-1),F=e.ref(null),Ee=e.ref(null),Ae=e.ref(null),tt=e.ref(null),ft=e.ref({top:0,left:0}),Z=e.ref(_(J.modelValue||"#b8a5de")),De=e.computed(()=>Array.isArray(J.presetGroups)&&J.presetGroups.length>0),We=e.computed(()=>!J.disableCustomColors),xe=e.computed(()=>De.value?0:J.initialPresetCount!=null?J.initialPresetCount:me.value<0?null:me.value),_e=e.computed(()=>{const le=xe.value;return le==null?!0:Math.max(0,J.presetColors.length-le)<J.max}),je=e.computed(()=>!!(Ce.value||Y.value>=0||!se.value&&J.presetColors.length===0));e.computed(()=>{const le=xe.value;return le!=null&&J.presetColors.length>le});const se=e.computed(()=>De.value||xe.value!=null),et=e.computed(()=>{const le=xe.value;return le==null?[]:J.presetColors.slice(0,le)}),ke=e.computed(()=>{const le=xe.value;return le==null?[]:J.presetColors.slice(le)});function nt(le){const U=xe.value;return U!=null?U+le:-1}function ut(le){const U=xe.value;return U!=null&&le>=U}function st(le){ut(le)&&(Y.value=le,Z.value=_(J.presetColors[le]),Ce.value=!0,e.nextTick(()=>tt.value?.focus()))}function Vt(le){if(!ut(le))return;const U=J.presetColors.filter((ye,Ke)=>Ke!==le);v("update:presetColors",U);const X=ce(J.modelValue),ie=ce(J.presetColors[le]);if(X&&ie&&X.toLowerCase()===ie.toLowerCase()){const ye=U[Math.max(0,le-1)]||U[0];ye&&v("update:modelValue",ye)}}function zt(){Q.value=!Q.value,Q.value||(Y.value=-1,Ce.value=!1)}function Ht(){if(!We.value||Y.value<0)return;const le=dt.value,U=ce(le);if(U){const X=[...J.presetColors];X[Y.value]=U,v("update:presetColors",X),v("update:modelValue",U),Y.value=-1,Ce.value=!1}}function Nt(){J.disabled||!We.value||(Y.value=-1,Ce.value=!Ce.value,Ce.value&&(ge(),e.nextTick(()=>tt.value?.focus())))}function bt(le){const U=M(le),X=M(J.modelValue);return U&&X&&U.toLowerCase()===X.toLowerCase()}function Jt(){if(J.disabled||!We.value||!_e.value)return;const le=dt.value,U=ce(le);if(U){const X=[...J.presetColors,U];v("update:presetColors",X),v("update:modelValue",U);const ie=xe.value??me.value;ie>=0&&X.length-ie>=J.max&&(Ce.value=!1)}}const dt=e.computed(()=>{const{h:le,s:U,l:X}=Z.value;return D(le,U,X)}),en=e.computed(()=>dt.value.toLowerCase()),Ct=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${Z.value.h}, 100%, 50%))`})),ee=e.computed(()=>{const le=fe(Z.value.h,Z.value.s,Z.value.l);return{left:`${le.s}%`,bottom:`${le.v}%`,transform:"translate(-50%, 50%)"}}),ve=e.computed(()=>({left:`${Z.value.h/360*100}%`,transform:"translateX(-50%)"})),Ne=e.computed(()=>({position:"fixed",left:`${ft.value.left}px`,top:`${ft.value.top}px`,zIndex:1002}));function q(){if(!F.value||!we.value)return;const le=F.value.getBoundingClientRect(),U=window.innerHeight||document.documentElement.clientHeight;let X=le.bottom+4;const ie=Ee.value;ie&&X+ie.offsetHeight>U-8&&(X=le.top-4-ie.offsetHeight),ft.value={top:X,left:le.left}}function ge(){const le=J.modelValue||"#b8a5de",U=M(le);U&&(Z.value=_(U))}function Be(){v("update:modelValue",dt.value)}function Fe(){J.disabled||(we.value=!we.value,we.value&&(ge(),e.nextTick(()=>{q(),tt.value?.focus()})))}function Ue(){const le=dt.value,U=ce(le);if(U){if(Y.value>=0){const X=[...J.presetColors];X[Y.value]=U,v("update:presetColors",X),v("update:modelValue",U)}else if(We.value&&(J.presetColors.length>0||De.value)&&Ce.value&&_e.value&&!J.presetColors.some(ie=>ce(ie)?.toLowerCase()===U.toLowerCase())){const ie=[...J.presetColors,U];v("update:presetColors",ie),v("update:modelValue",U)}}we.value=!1,Ce.value=!1,Q.value=!1,Y.value=-1}function wt(le){if(!Ae.value)return;const U=Ae.value.getBoundingClientRect(),X=ie=>{const ye=Math.max(0,Math.min(1,(ie.clientX-U.left)/U.width)),Ke=Math.max(0,Math.min(1,1-(ie.clientY-U.top)/U.height)),At={h:Z.value.h,s:ye*100,v:Ke*100};Z.value=mt(At.h,At.s,At.v)};X(le),document.addEventListener("mousemove",X),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",X),Be()},{once:!0})}function Ge(le){if(!le.currentTarget)return;const X=le.currentTarget.getBoundingClientRect(),ie=ye=>{const Ke=Math.max(0,Math.min(1,(ye.clientX-X.left)/X.width));Z.value={...Z.value,h:Ke*360}};ie(le),document.addEventListener("mousemove",ie),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ie),Be()},{once:!0})}function Xt(le){const U=le.target.value,X=M(U);X&&(Z.value=_(X),v("update:modelValue",X))}function Ze(le){if(J.disabled)return;const U=M(le);U&&(Z.value=_(U),v("update:modelValue",U))}let Pe=null,Tt=null;function Lt(){Pe&&(document.removeEventListener("keydown",Pe),Pe=null),Tt&&(window.removeEventListener("resize",Tt),Tt=null)}return e.watch(we,le=>{if(Lt(),le){if(!De.value&&J.initialPresetCount==null){const U=J.presetColors.length;U>0&&(me.value<0||U<me.value)&&(me.value=U)}Pe=U=>{U.key==="Escape"&&Ue()},Tt=q,document.addEventListener("keydown",Pe),window.addEventListener("resize",Tt)}}),e.watch(()=>J.modelValue,()=>{we.value&&ge()},{immediate:!1}),e.watch(ke,le=>{le.length===0&&(Q.value=!1,Y.value=-1,Ce.value=!1)}),e.onBeforeUnmount(Lt),(le,U)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":L.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:F,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":we.value}]),onClick:Fe},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:dt.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"},[we.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Ue,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Ee,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Ne.value)},[se.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[De.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(L.presetGroups,(X,ie)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ie,class:"dss-color-picker__section"},[e.createElementVNode("span",Pm,e.toDisplayString(X.title),1),e.createElementVNode("div",Om,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.colors,(ye,Ke)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ie+"-"+Ke,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":bt(ye)}]),style:e.normalizeStyle({backgroundColor:ye,"--dss-preset-color":ye}),title:ye,onClick:e.withModifiers(At=>Ze(ye),["stop"])},null,14,qm))),128))])]))),128)):et.value.length?(e.openBlock(),e.createElementBlock("div",Wm,[U[1]||(U[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",Zm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value,(X,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":bt(X)}]),style:e.normalizeStyle({backgroundColor:X,"--dss-preset-color":X}),title:X,onClick:e.withModifiers(ye=>Ze(X),["stop"])},null,14,Um))),128))])])):e.createCommentVNode("",!0),We.value?(e.openBlock(),e.createElementBlock("div",Xm,[e.createElementVNode("div",Ym,[U[3]||(U[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),ke.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":Q.value}]),title:"Manage custom colors",onClick:e.withModifiers(zt,["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",jm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,(X,ie)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ie,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":Q.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!Q.value&&bt(X),"dss-color-picker__preset-bubble--editing":Q.value&&Y.value===nt(ie)}]),style:e.normalizeStyle({backgroundColor:Y.value===nt(ie)?dt.value:X,"--dss-preset-color":Y.value===nt(ie)?dt.value:X}),title:Y.value===nt(ie)?dt.value:X,onClick:e.withModifiers(ye=>Q.value?st(nt(ie)):Ze(X),["stop"])},null,14,Km),Q.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(ye=>Vt(nt(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,Gm)):e.createCommentVNode("",!0)],2))),128)),_e.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":Ce.value}]),onClick:e.withModifiers(Nt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):L.presetColors.length?(e.openBlock(),e.createElementBlock("div",Qm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.presetColors,(X,ie)=>(e.openBlock(),e.createElementBlock("button",{key:ie,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":bt(X)}]),style:e.normalizeStyle({backgroundColor:X,"--dss-preset-color":X}),title:X,onClick:e.withModifiers(ye=>Ze(X),["stop"])},null,14,Jm))),128)),We.value&&_e.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":Ce.value}]),onClick:e.withModifiers(Nt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),je.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:Ae,onMousedown:wt},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(Ct.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(ee.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ge},[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(ve.value)},null,4)],32),e.createElementVNode("div",e2,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:tt,type:"text",class:"dss-color-picker__hex-input",value:en.value,onInput:Xt},null,40,t2)]),We.value&&se.value&&(L.presetColors.length||De.value)&&_e.value&&Y.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Jt}," Save color ")):e.createCommentVNode("",!0),We.value&&se.value&&Y.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Ht}," Save color ")):e.createCommentVNode("",!0),se.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Ue}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},l2={key:0,class:"dss-loader"},o2={key:0,class:"dss-loader-label"},a2={key:1,class:"dss-loader"},s2={key:0,class:"dss-loader-label"},r2={key:2,class:"dss-loader"},i2={key:0,class:"dss-loader-label"},c2={key:3,class:"dss-loader"},u2={key:0,class:"dss-loader-label"},d2={key:4,class:"dss-loader"},m2={key:0,class:"dss-loader-label"},p2={key:5,class:"dss-loader dss-loader--inline"},f2={class:"dss-loader-inline-text"},v2={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(L){const ne=L,_=e.computed(()=>ne.size==="small"?"dss-loaders--size-small":ne.size==="large"?"dss-loaders--size-large":ne.size==="medium"||ne.size==null?"dss-loaders--size-medium":null),D=e.computed(()=>{const ce={};if(!(ne.size==="small"||ne.size==="medium"||ne.size==="large"||ne.size==null)){const z=typeof ne.size=="number"?`${ne.size}px`:String(ne.size);ce["--dss-loader-size"]=z}return ne.color&&(ce["--dss-loader-accent"]=ne.color,ce["--dss-loader-accent-soft"]=`color-mix(in srgb, ${ne.color} 30%, white)`),ce});return(ce,z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",_.value]),style:e.normalizeStyle(D.value)},[L.type==="spinner"?(e.openBlock(),e.createElementBlock("div",l2,[z[0]||(z[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),L.label?(e.openBlock(),e.createElementBlock("span",o2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="dots"?(e.openBlock(),e.createElementBlock("div",a2,[z[1]||(z[1]=e.createElementVNode("span",{class:"dss-loader-dots","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"})],-1)),L.label?(e.openBlock(),e.createElementBlock("span",s2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="battery"?(e.openBlock(),e.createElementBlock("div",r2,[z[2]||(z[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),L.label?(e.openBlock(),e.createElementBlock("span",i2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",c2,[z[3]||(z[3]=e.createElementVNode("span",{class:"dss-loader-double-circle","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-double-circle-outer"}),e.createElementVNode("span",{class:"dss-loader-double-circle-inner"})],-1)),L.label?(e.openBlock(),e.createElementBlock("span",u2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="bars"?(e.openBlock(),e.createElementBlock("div",d2,[z[4]||(z[4]=e.createElementVNode("span",{class:"dss-loader-bars","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"})],-1)),L.label?(e.openBlock(),e.createElementBlock("span",m2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="inline"?(e.openBlock(),e.createElementBlock("div",p2,[z[5]||(z[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",f2,[e.renderSlot(ce.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(L.label),1)])])])):e.createCommentVNode("",!0)],6))}},da="dss-skeleton-item",g2={__name:"DSSSkeleton",props:{loading:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},borderRadius:{type:String,default:"16px"},shimmer:{type:Boolean,default:!0},mode:{type:String,default:"single",validator:L=>["single","multiple"].includes(L)},targetClass:{type:String,default:da},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(L){const ne=L,_=e.computed(()=>{const z={"dss-skeleton--loading":ne.loading,"dss-skeleton--static":!ne.shimmer,"dss-skeleton--multiple":ne.mode==="multiple","dss-skeleton--dark":ne.darkMode};return ne.mode==="multiple"&&ne.targetClass!==da&&(z[`dss-skeleton--target-${ne.targetClass}`]=!0),z}),D=e.computed(()=>{const z={};return ne.borderRadius&&(z.borderRadius=ne.borderRadius),z}),ce=e.computed(()=>{const z={};return ne.borderRadius&&(z["--dss-skeleton-border-radius"]=ne.borderRadius),ne.darkMode?(z["--dss-skeleton-bg"]=ne.bgDark||"#322c3f",z["--dss-skeleton-shimmer"]=ne.shimmerDark||"#3e3f41",z):(ne.bgColor&&(z["--dss-skeleton-bg"]=ne.bgColor),ne.shimmerColor&&(z["--dss-skeleton-shimmer"]=ne.shimmerColor),z)});return(z,M)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",_.value]),style:e.normalizeStyle(ce.value)},[L.loading&&L.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":L.loading&&L.mode==="single"}])},[e.renderSlot(z.$slots,"default")],2)],6))}},h2={key:0,class:"dss-dnd-column-header"},y2={class:"dss-dnd-column-title"},k2={class:"dss-dnd-column-count"},C2=["data-column"],b2={key:0,class:"dss-dnd-indicator"},w2=["onPointerdown"],x2=["onPointerdown"],E2={class:"dss-dnd-item-content"},S2={class:"dss-dnd-item-default"},V2={key:0,class:"dss-dnd-empty"},N2={name:"DSSDnd"},B2=Object.assign(N2,{props:{items:{type:Array,required:!0},columns:{type:Array,required:!0},columnKey:{type:String,default:"status"},positionKey:{type:String,default:"position"},itemKey:{type:String,default:"id"},options:{type:Object,default:()=>({})}},emits:["move","delete"],setup(L,{emit:ne}){const _=L,D=ne,ce=e.useSlots(),z=e.computed(()=>!!ce["delete-zone"]),M={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1,ColColor:!1},fe=e.computed(()=>({...M,..._.options})),mt=e.computed(()=>({"--dss-dnd-col-min-w":fe.value.columnMinWidth,"--dss-dnd-col-max-w":fe.value.columnMaxWidth,"--dss-dnd-col-gap":fe.value.columnGap,"--dss-dnd-indicator-color":fe.value.indicatorColor,"--dss-dnd-body-max-h":fe.value.columnBodyMaxHeight}));function J(q){if(!fe.value.ColColor||!q)return{};const ge=q.background||q.color;return ge?{background:ge}:{}}const v=e.ref(null),we=e.ref(null),Ce=e.ref(!1),Q=e.ref(-1),Y=e.ref(null);let me=null,F=null,Ee=null,Ae=null,tt=0,ft=0,Z="",De=null;const We=5,xe=e.computed(()=>{const q={};for(const ge of _.columns)q[ge.value]=_.items.filter(Be=>Be[_.columnKey]===ge.value).sort((Be,Fe)=>(Be[_.positionKey]??0)-(Fe[_.positionKey]??0));return q}),_e=e.computed(()=>{const q={},ge=!!v.value,Be=v.value?.[_.itemKey],Fe=we.value,Ue=Q.value;for(const wt of _.columns){const Ge=xe.value[wt.value]||[],Xt=[],Ze=Fe==wt.value;let Pe=0;for(let Tt=0;Tt<Ge.length;Tt++){const Lt=Ge[Tt],le=ge&&Lt[_.itemKey]===Be;!le&&Ze&&Ue===Pe&&Xt.push({type:"indicator",key:`ind-${Pe}`}),le||Pe++,Xt.push({type:"item",item:Lt,isDragged:le,key:`item-${Lt[_.itemKey]}`})}Ze&&Ue>=Pe&&Xt.push({type:"indicator",key:"ind-end"}),q[wt.value]=Xt}return q});function je(q,ge){const Fe=(xe.value[q]||[]).filter(Ge=>Ge[_.itemKey]!==v.value?.[_.itemKey]);if(Fe.length===0)return 1;if(ge<=0){const Ge=Fe[0][_.positionKey];return Ge!=null&&Ge>0?Ge/2:.5}if(ge>=Fe.length){const Ge=Fe[Fe.length-1][_.positionKey];return(Ge??0)+1}const Ue=Fe[ge-1][_.positionKey]??0,wt=Fe[ge][_.positionKey]??0;return(Ue+wt)/2}function se(q,ge,Be){Ee&&Ee.remove();const Fe=q.getBoundingClientRect(),Ue=q.cloneNode(!0);Ue.classList.add("dss-dnd-ghost"),Ue.style.cssText=`
|
|
104
104
|
position: fixed;
|
|
105
|
-
left: ${ge-
|
|
105
|
+
left: ${ge-tt}px;
|
|
106
106
|
top: ${Be-ft}px;
|
|
107
107
|
width: ${Fe.width}px;
|
|
108
108
|
height: ${Fe.height}px;
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
background-color: ${fe.value.dragSourceBackground};
|
|
115
115
|
font-family: 'Work Sans', sans-serif;
|
|
116
116
|
cursor: grabbing;
|
|
117
|
-
`,document.body.appendChild(Ye),Se=Ye}function tt(j,ge){Se&&(Se.style.left=`${j-lt}px`,Se.style.top=`${ge-ft}px`)}function Ce(j){j.classList.add("dss-dnd-item--dragging"),j.style.background=fe.value.dragSourceBackground,j.style.borderColor=fe.value.dragSourceBorder,j.style.transform="scale(0.97)"}function nt(j){j.classList.remove("dss-dnd-item--dragging"),j.style.background="",j.style.borderColor="",j.style.transform=""}function ot(j,ge){return document.elementFromPoint(j,ge)?.closest(".dss-dnd-column-body")??null}function kt(j,ge){return!!document.elementFromPoint(j,ge)?.closest("[data-dss-dnd-delete-zone]")}function Vt(j,ge){if(z.value&&kt(j,ge)){ke.value=!0,we.value=null,J.value=-1;return}ke.value=!1;const Be=ot(j,ge),Fe=Be?.getAttribute("data-column")??null;if(!Fe){we.value=null,J.value=-1;return}we.value=Fe;const Ye=Be.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let wt=Ye.length;for(let et=0;et<Ye.length;et++){const Yt=Ye[et].getBoundingClientRect();if(ge<Yt.top+Yt.height/2){wt=et;break}}J.value=wt}function Ht(j){j.preventDefault(),tt(j.clientX,j.clientY),!me&&(me=requestAnimationFrame(()=>{me=null,Vt(j.clientX,j.clientY)}))}function zt(j){window.removeEventListener("pointermove",Ht),window.removeEventListener("pointerup",zt),window.removeEventListener("pointercancel",zt),Ae?.releasePointerCapture?.(j.pointerId),nt(Ae),Ae=null;const ge=z.value&&kt(j.clientX,j.clientY);if(v.value&&ge)D("delete",{item:v.value});else{const Fe=ot(j.clientX,j.clientY)?.getAttribute("data-column")??null;if(v.value&&Fe){const Ye=v.value[_.columnKey],wt=Fe,Yt=(Ee.value[wt]||[]).filter(Lt=>Lt[_.itemKey]!==v.value[_.itemKey]),Ue=Math.max(0,Math.min(J.value,Yt.length)),Oe=Xe(wt,Ue),Tt=v.value[_.itemKey];D("move",{item:v.value,from:Ye,to:wt,position:Oe,index:Ue}),F&&clearTimeout(F),X.value={id:Tt,from:Ye,to:wt},F=setTimeout(()=>{X.value=null},3500)}}Se&&(Se.remove(),Se=null),Z!==null&&(document.body.style.cursor=Z,Z=""),Pe()}function Nt(j,ge){j.preventDefault();const Be=j.target.closest(".dss-dnd-item");if(!Be)return;const Fe=Be.getBoundingClientRect();lt=j.clientX-Fe.left,ft=j.clientY-Fe.top,Z=document.body.style.cursor,document.body.style.cursor="grabbing",v.value=ge,Ae=Be,re(Be,j.clientX,j.clientY),requestAnimationFrame(()=>Ce(Be)),Be.setPointerCapture?.(j.pointerId),window.addEventListener("pointermove",Ht),window.addEventListener("pointerup",zt,{once:!0}),window.addEventListener("pointercancel",zt,{once:!0})}function bt(){De&&(window.removeEventListener("pointermove",Xt),window.removeEventListener("pointerup",mt),window.removeEventListener("pointercancel",mt),De=null)}function Xt(j){if(!De||j.pointerId!==De.pointerId)return;const ge=j.clientX-De.startX,Be=j.clientY-De.startY;if(Math.abs(ge)>=We||Math.abs(Be)>=We){const Fe=De.item;bt(),Nt(j,Fe)}}function mt(j){!De||j.pointerId!==De.pointerId||bt()}function tn(j,ge){bt(),De={item:ge,startX:j.clientX,startY:j.clientY,pointerId:j.pointerId},window.addEventListener("pointermove",Xt),window.addEventListener("pointerup",mt),window.addEventListener("pointercancel",mt)}function Y(j,ge){fe.value.useHandle||tn(j,ge)}function ye(j,ge){tn(j,ge)}function xe(){me&&(cancelAnimationFrame(me),me=null)}function Pe(){xe(),v.value=null,we.value=null,ke.value=!1,J.value=-1}return e.onBeforeUnmount(()=>{xe(),bt(),F&&clearTimeout(F),Se&&(Se.remove(),Se=null)}),(j,ge)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":fe.value.unstyled}]),style:e.normalizeStyle(dt.value)},[z.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":ke.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(j.$slots,"delete-zone",{isDragging:!!v.value,isOver:ke.value})],2),[[e.vShow,!!v.value||fe.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.columns,Be=>(e.openBlock(),e.createElementBlock("div",{key:Be.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":we.value==Be.value},Be.class||""]]),style:e.normalizeStyle(ee(Be))},[fe.value.showHeader?(e.openBlock(),e.createElementBlock("div",h2,[e.renderSlot(j.$slots,"column-header",{column:Be,items:Ee.value[Be.value]||[]},()=>[e.createElementVNode("span",y2,e.toDisplayString(Be.title||Be.value),1),e.createElementVNode("span",k2,e.toDisplayString((Ee.value[Be.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Be.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_e.value[Be.value],Fe=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Fe.key},[Fe.type==="indicator"?(e.openBlock(),e.createElementBlock("div",b2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Fe.isDragged,"dss-dnd-item--no-handle":!fe.value.useHandle}]),onPointerdown:Ye=>Y(Ye,Fe.item)},[fe.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Ye=>ye(Ye,Fe.item),["stop"])},[e.renderSlot(j.$slots,"handle",{},()=>[ge[0]||(ge[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,x2)):e.createCommentVNode("",!0),e.createElementVNode("div",E2,[e.renderSlot(j.$slots,"item",{item:Fe.item,column:Be,justDropped:X.value?.id===Fe.item[L.itemKey],droppedFrom:X.value?.id===Fe.item[L.itemKey]?X.value.from:null,droppedTo:X.value?.id===Fe.item[L.itemKey]?X.value.to:null},()=>[e.createElementVNode("div",S2,e.toDisplayString(Fe.item[L.itemKey]),1)])])],42,w2))],64))),128)),(Ee.value[Be.value]||[]).length===0&&we.value!=Be.value?(e.openBlock(),e.createElementBlock("div",V2,[e.renderSlot(j.$slots,"empty",{column:Be},()=>[ge[1]||(ge[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,C2)],6))),128))],6))}}),M2={name:"DSSConfetti"},_2=Object.assign(M2,{props:{trigger:{type:Boolean,default:!1},duration:{type:Number,default:3e3},fadeStart:{type:Number,default:2e3},count:{type:Number,default:90},colors:{type:Array,default:()=>["#047395","#ffc230","#0897c1","#fe3b59","#11e1a2","#b3b2fb","#fadb8d","#ffa25b","#feaab1"]},delay:{type:Number,default:300}},setup(L){const ne=L,_=e.ref(null),D=e.ref(!1);let ce=[],z=null,M=null;function fe(J,X){const me=[];for(let F=0;F<ne.count;F++)me.push(dt(J));return me}function dt(J,X){return{x:Math.random()*J,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:ne.colors[Math.floor(Math.random()*ne.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 ee(J,X,me,F){J.clearRect(0,0,X,me);for(const Se of ce)J.save(),J.globalAlpha=Se.opacity*F,J.beginPath(),J.lineWidth=Se.r,J.strokeStyle=Se.color,J.moveTo(Se.x+Se.tilt+Se.r/2,Se.y),J.lineTo(Se.x+Se.tilt,Se.y+Se.tilt+Se.r/2),J.stroke(),J.restore()}function v(J,X,me){const F=.3+me*.7;for(let Se=0;Se<ce.length;Se++){const Ae=ce[Se];Ae.tiltAngle+=Ae.tiltInc,Ae.y+=Ae.speed*F,Ae.x+=Math.sin(Ae.d)*.5*F,Ae.tilt=Math.sin(Ae.tiltAngle)*15,me>=.99&&Ae.y>X+20&&(ce[Se]=dt(J))}}function we(){D.value=!0,e.nextTick(()=>{const J=_.value;if(!J)return;const X=J.getContext("2d"),me=J.parentElement;if(!me)return;const F=me.getBoundingClientRect();J.width=F.width,J.height=F.height,ce=fe(J.width,J.height);const Se=Date.now(),Ae=Se+ne.duration,lt=()=>{const ft=Date.now(),Z=ft-Se;if(ft<Ae){let De=1;Z>ne.fadeStart&&(De=1-(Z-ne.fadeStart)/(ne.duration-ne.fadeStart)),ee(X,J.width,J.height,De),v(J.width,J.height,De),z=requestAnimationFrame(lt)}else ke()};lt()})}function ke(){z&&(cancelAnimationFrame(z),z=null),ce=[],D.value=!1}return e.watch(()=>ne.trigger,J=>{J&&(M&&clearTimeout(M),M=setTimeout(we,ne.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{ke(),M&&clearTimeout(M)}),(J,X)=>D.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:_,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),$2={class:"dss-filter-global-inner"},L2=["placeholder","value"],T2=["title"],A2={key:0,class:"dss-filter-funnel-badge"},D2={key:1,class:"dss-filter-sortby"},H2=["value"],R2=["value"],F2=["disabled","title"],I2={key:0,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},z2={key:1,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},P2={key:2,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},O2={class:"dss-filter-panel"},q2={key:0,class:"dss-filter-empty"},Z2={class:"dss-filter-row-prefix"},W2={class:"dss-filter-cell"},U2=["onClick"],X2={class:"dss-filter-trigger-text"},Y2=["placeholder"],j2={class:"dss-filter-popup-list"},K2=["onClick"],G2={key:0,class:"dss-filter-popup-empty"},Q2={key:0,class:"dss-filter-cell"},J2=["onClick"],e0={class:"dss-filter-trigger-text"},t0={class:"dss-filter-popup-list"},n0=["onClick"],l0={key:1,class:"dss-filter-cell dss-filter-cell--value"},o0=["placeholder","onUpdate:modelValue"],a0={key:1,class:"dss-filter-date-wrap"},s0=["placeholder","onUpdate:modelValue"],r0=["placeholder","value","onInput","step"],i0={key:4,class:"dss-filter-between"},c0=["placeholder","value","onInput","step"],u0={class:"dss-filter-between-sep"},d0=["placeholder","value","onInput","step"],m0={key:5,class:"dss-filter-multiselect"},p0=["onClick"],f0={class:"dss-filter-trigger-text"},v0=["placeholder"],g0={class:"dss-filter-popup-list dss-filter-popup-list--check"},h0=["onClick"],y0=["checked"],k0={key:0,class:"dss-filter-popup-empty"},C0=["onClick"],b0={class:"dss-filter-foot"},w0={class:"dss-filter-cell"},x0=["placeholder"],E0={class:"dss-filter-popup-list"},S0=["onClick"],V0={key:0,class:"dss-filter-popup-divider"},N0=["onClick"],B0=["placeholder"],M0={class:"dss-filter-popup-list"},_0=["onClick"],$0={key:0,class:"dss-filter-popup-empty"},L0=["placeholder"],T0={class:"dss-filter-popup-list"},A0=["onClick"],D0={key:0,class:"dss-filter-popup-empty"},H0={name:"DSSFilter"},R0=Object.assign(H0,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},showSortBy:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(L,{expose:ne,emit:_}){const{t:D}=co.useI18n(),ce=L,z=_,M={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},fe=e.computed(()=>({...M,...ce.options})),dt={text:[{value:"contains"},{value:"not_contains"},{value:"equals"},{value:"not_equals"},{value:"starts_with"},{value:"ends_with"},{value:"is_empty"},{value:"is_not_empty"}],select:[{value:"is_any_of"},{value:"is_none_of"},{value:"is_empty"},{value:"is_not_empty"}],range:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],int:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],arraySelect:[{value:"contains_any"},{value:"contains_all"},{value:"not_contains_any"},{value:"is_empty"},{value:"is_not_empty"}],arrayText:[{value:"contains"},{value:"not_contains"},{value:"is_empty"},{value:"is_not_empty"}],date:[{value:"eq"},{value:"before"},{value:"after"},{value:"is_empty"},{value:"is_not_empty"}],boolean:[{value:"is_true"},{value:"is_false"},{value:"is_empty"},{value:"is_not_empty"}]},ee=new Set(["is_empty","is_not_empty","is_true","is_false"]),v=["label","name","title","keyword","full_name","value","text"],we=e.ref(""),ke=e.ref([]),J=e.ref(null),X=e.ref(!1),me=e.ref(null),F=e.ref(""),Se=e.ref(null),Ae=e.ref(""),lt=e.ref("asc");let ft=1;function Z(S){const b=S.find(V=>V&&typeof V=="object");if(!b)return null;for(const V of v)if(V in b&&typeof b[V]=="string")return V;return Object.keys(b).find(V=>typeof b[V]=="string")||null}function De(S,b){const V=b.filter(K=>K!=null&&K!=="NULL");if(V.length===0)return null;if(V.every(K=>Array.isArray(K))){const K=V.flatMap(He=>He).filter(He=>He!=null);return K.length===0?null:typeof K.find(He=>He!=null)=="object"?"arraySelect":"arrayText"}return V.every(K=>typeof K=="boolean")?"boolean":V.every(K=>typeof K=="number")?new Set(V).size<=fe.value.maxUniqueForEnum?"select":"range":V.every(K=>typeof K=="string")?new Set(V).size<=fe.value.maxUniqueForSelect?"select":"text":V.some(K=>typeof K=="object"&&!Array.isArray(K))?null:"text"}const We=e.computed(()=>{if(!ce.data?.length)return[];const S=new Set;for(const oe of ce.data)if(oe&&typeof oe=="object")for(const He of Object.keys(oe))S.add(He);const b=new Set(ce.exclude),V=[];for(const oe of S){if(b.has(oe))continue;const He=ce.config[oe]||{},Ct=ce.data.map(Et=>Et?.[oe]),st=He.type||De(oe,Ct);if(!st)continue;const ze=He.filterMode||"contain",xt=ze==="date"?"date":ze==="string"?"text":st,Mt={key:oe,label:He.label||at(oe),type:xt,filterMode:ze};if(st==="select"){const Et=Ct.filter(ct=>ct!=null&&ct!=="NULL");Mt.uniqueValues=[...new Set(Et)].sort((ct,Dt)=>typeof ct=="number"&&typeof Dt=="number"?ct-Dt:String(ct).localeCompare(String(Dt)))}else if(st==="range"||st==="int"){const Et=Ct.filter(ct=>typeof ct=="number");Mt.min=Math.min(...Et),Mt.max=Math.max(...Et)}else if(st==="arraySelect"){const Et=He.displayKey||Z(Ct.flatMap(ct=>Array.isArray(ct)?ct:[]));if(Mt.displayKey=Et,Array.isArray(He.uniqueValues)&&He.uniqueValues.length>0)Mt.uniqueValues=He.uniqueValues.map(ct=>String(ct));else{const ct=Ct.flatMap(Dt=>Array.isArray(Dt)?Dt:[]).filter(Dt=>Dt!=null).map(Dt=>Et&&typeof Dt=="object"?Dt[Et]:String(Dt)).filter(Dt=>Dt!=null&&Dt!=="");Mt.uniqueValues=[...new Set(ct)].sort((Dt,Bt)=>String(Dt).localeCompare(String(Bt)))}}V.push(Mt)}const K=ce.config._order;return K&&V.sort((oe,He)=>{const Ct=K.indexOf(oe.key),st=K.indexOf(He.key);return Ct===-1&&st===-1?0:Ct===-1?1:st===-1?-1:Ct-st}),V}),Ee=e.computed(()=>{const S={};for(const b of We.value)S[b.key]=b;return S}),_e=e.computed(()=>Array.isArray(ce.config.groups)&&ce.config.groups.length>0),Xe=e.computed(()=>{if(!_e.value)return[];const S=new Set(We.value.map(b=>b.key));return ce.config.groups.map(b=>({...b,keys:b.keys.filter(V=>S.has(V))})).filter(b=>b.keys.length>0)}),re=e.computed(()=>{if(!_e.value)return[];const S=new Set(ce.config.groups.flatMap(b=>b.keys));return We.value.filter(b=>!S.has(b.key))}),tt=e.computed(()=>{if(!Se.value)return[];const S=new Set(Se.value.keys),b=We.value.filter(K=>S.has(K.key));if(!F.value)return b;const V=F.value.toLowerCase();return b.filter(K=>K.label.toLowerCase().includes(V))}),Ce=e.computed(()=>{if(!F.value)return We.value;const S=F.value.toLowerCase();return We.value.filter(b=>b.label.toLowerCase().includes(S))}),nt=e.computed(()=>We.value.filter(S=>!["arraySelect","arrayText"].includes(S.type))),ot=e.computed(()=>Ae.value?lt.value==="asc"?"Ascending":"Descending":"No sort selected");function kt(S){J.value===S?Vt():(J.value=S,F.value="",Se.value=null)}function Vt(){J.value=null,F.value="",Se.value=null}function Ht(S){const b=S.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");J.value&&!b&&!S.target.closest(".dss-filter-popup")&&!S.target.closest(".dss-filter-trigger")&&!S.target.closest(".dss-filter-add-btn")&&Vt(),X.value&&me.value&&!me.value.contains(S.target)&&(b||(X.value=!1))}e.onMounted(()=>document.addEventListener("click",Ht)),e.onBeforeUnmount(()=>document.removeEventListener("click",Ht));function zt(S){return Ee.value[S]?.label||at(S)}function Nt(S){return Ee.value[S.key]?.filterMode||"contain"}function bt(S){return D(`filter.operators.${S}`)}function Xt(S){const b=Ee.value[S.key];return(dt[b?.type]||dt.text).map(V=>({...V,label:D(`filter.operators.${V.value}`)}))}function mt(S){return ee.has(S)}function tn(S){const b=Ee.value[S.key];return b?b.type==="date"?"date":b.type==="boolean"?"boolean":b.type==="text"||b.type==="arrayText"?"text":b.type==="select"||b.type==="arraySelect"?"multiselect":b.type==="range"||b.type==="int"?S.operator==="between"?"between":"number":"text":"text"}function Y(S){return dt[S]?.[0]?.value||"contains"}function ye(S,b){return ee.has(b)||S==="date"?null:S==="select"||S==="arraySelect"?[]:(S==="range"||S==="int")&&b==="between"?{min:null,max:null}:S==="range"||S==="int"?null:""}function xe(S){return Ee.value[S.key]?.uniqueValues||[]}function Pe(S){const b=xe(S);if(!F.value)return b;const V=F.value.toLowerCase();return b.filter(K=>String(K).toLowerCase().includes(V))}function j(S){const b=S.value;return!b||b.length===0?D("filter.select"):b.length<=2?b.join(", "):D("filter.selectedCount",{count:b.length})}function ge(S){const b=Ee.value[S],V=b?.filterMode||"contain",K=b?.type||"text",oe=V==="string"?"contains":Y(K);ke.value.push(e.reactive({id:ft++,key:S,operator:oe,value:ye(K,oe)})),Vt()}function Be(S){ke.value=ke.value.filter(b=>b.id!==S)}function Fe(S,b){const K=Ee.value[b]?.type||"text";S.key=b,S.operator=Y(K),S.value=ye(K,S.operator),Vt()}function Ye(S,b){const V=tn(S);S.operator=b;const K=tn(S);if(V!==K||ee.has(b)){const oe=Ee.value[S.key];S.value=ye(oe?.type||"text",b)}Vt()}function wt(S,b){const V=b.target.value;S.value=V===""?null:Number(V)}function et(S,b,V){const K=V.target.value,oe=K===""?null:Number(K);(!S.value||typeof S.value!="object")&&(S.value={min:null,max:null}),S.value={...S.value,[b]:isNaN(oe)?null:oe}}function Yt(S,b){const V=S.value||[],K=V.indexOf(b);S.value=K>=0?V.filter(oe=>oe!==b):[...V,b]}function Ue(){ke.value=[],we.value="",Vt()}function Oe(S){we.value=S.target.value}function Tt(S){Ae.value=S.target.value}function Lt(){lt.value=lt.value==="asc"?"desc":"asc"}const le=e.computed(()=>{if(!ce.data)return[];let S=ce.data;if(we.value){const b=we.value.toLowerCase();S=S.filter(V=>{for(const K of Object.keys(V)){const oe=V[K];if(typeof oe=="string"&&oe.toLowerCase().includes(b)||typeof oe=="number"&&String(oe).includes(b)||Array.isArray(oe)&&oe.some(He=>He!=null&&(typeof He=="string"?He.toLowerCase().includes(b):typeof He=="object"?Object.values(He).some(Ct=>typeof Ct=="string"&&Ct.toLowerCase().includes(b)):!1)))return!0}return!1})}for(const b of ke.value){if(!ie(b))continue;const V=Ee.value[b.key];V&&(S=S.filter(K=>he(K,b,V)))}if(ce.showSortBy&&Ae.value){const b=Ae.value,V=lt.value==="asc"?1:-1;S=[...S].sort((K,oe)=>W(K?.[b],oe?.[b])*V)}return S});function W(S,b){const V=U(S),K=U(b);return V==null&&K==null?0:V==null?1:K==null?-1:typeof V=="number"&&typeof K=="number"?V-K:String(V).localeCompare(String(K),void 0,{numeric:!0,sensitivity:"base"})}function U(S){return S==null||S==="NULL"?null:typeof S=="string"||typeof S=="number"||typeof S=="boolean"?S:S instanceof Date?S.getTime():null}function ie(S){return ee.has(S.operator)?!0:S.value==null||typeof S.value=="string"&&S.value===""||Array.isArray(S.value)&&S.value.length===0?!1:S.value instanceof Date?!isNaN(S.value.getTime()):!(typeof S.value=="object"&&!Array.isArray(S.value)&&S.value.min==null&&S.value.max==null)}function he(S,b,V){const K=S?.[b.key],oe=b.value,He=b.operator;if(He==="is_empty")return jt(K);if(He==="is_not_empty")return!jt(K);const Ct=V.type;if(Ct==="text"||Ct==="arrayText"){const st=Ct==="arrayText"&&Array.isArray(K)?K.filter(Mt=>Mt!=null).map(String).join(" "):K!=null?String(K):"",ze=String(oe).toLowerCase(),xt=st.toLowerCase();switch(He){case"contains":return xt.includes(ze);case"not_contains":return!xt.includes(ze);case"equals":return xt===ze;case"not_equals":return xt!==ze;case"starts_with":return xt.startsWith(ze);case"ends_with":return xt.endsWith(ze);default:return!0}}if(Ct==="select")switch(He){case"is_any_of":return oe.includes(K);case"is_none_of":return!oe.includes(K);default:return!0}if(Ct==="range"||Ct==="int"){const st=typeof K=="number"?K:Number(K);if(typeof st!="number"||isNaN(st))return!1;if(He==="between"){const xt=oe?.min!=null?Number(oe.min):null,Mt=oe?.max!=null?Number(oe.max):null,Et=xt!=null&&!isNaN(xt)?xt:null,ct=Mt!=null&&!isNaN(Mt)?Mt:null;return(Et==null||st>=Et)&&(ct==null||st<=ct)}const ze=typeof oe=="number"&&!isNaN(oe)?oe:Number(oe);if(He==="contains"||He==="not_contains"){const xt=String(st),Mt=String(oe??"").toLowerCase(),Et=xt.toLowerCase().includes(Mt);return He==="contains"?Et:!Et}if(typeof ze!="number"||isNaN(ze))return!1;switch(He){case"eq":return st===ze;case"neq":return st!==ze;case"gt":return st>ze;case"gte":return st>=ze;case"lt":return st<ze;case"lte":return st<=ze;default:return!0}}if(Ct==="arraySelect"){if(!Array.isArray(K))return!1;const st=K.filter(ze=>ze!=null).map(ze=>V.displayKey&&typeof ze=="object"?ze[V.displayKey]:String(ze));switch(He){case"contains_any":return st.some(ze=>oe.includes(ze));case"contains_all":return oe.every(ze=>st.includes(ze));case"not_contains_any":return!st.some(ze=>oe.includes(ze));default:return!0}}if(Ct==="date"){const st=Ge(oe);if(!st||isNaN(st.getTime()))return!1;const ze=Ge(K);if(!ze||isNaN(ze.getTime()))return!1;const xt=At(ze),Mt=At(st);switch(He){case"eq":return xt===Mt;case"before":return xt<Mt;case"after":return xt>Mt;default:return!0}}if(Ct==="boolean"){const st=K===!0||K==="true"||K===1,ze=K===!1||K==="false"||K===0;switch(He){case"is_true":return st;case"is_false":return ze;default:return!0}}return!0}function Ge(S){if(S==null)return null;if(S instanceof Date)return isNaN(S.getTime())?null:S;if(typeof S=="number")return new Date(S>1e10?S:S*1e3);if(typeof S=="string"){const b=new Date(S);return isNaN(b.getTime())?null:b}return null}function At(S){const b=S.getFullYear(),V=String(S.getMonth()+1).padStart(2,"0"),K=String(S.getDate()).padStart(2,"0");return`${b}-${V}-${K}`}function jt(S){return!!(S==null||S===""||S==="NULL"||Array.isArray(S)&&S.length===0||Array.isArray(S)&&S.every(b=>b==null))}e.watch(le,S=>z("update:modelValue",S),{immediate:!0}),e.watch(()=>ce.data,()=>{ke.value=[],we.value="",X.value=!1,Ae.value="",lt.value="asc",Vt()});function at(S){return S.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,b=>b.toUpperCase())}function sn(){const S=b=>{if(b==null)return b;if(b instanceof Date)return{_type:"Date",value:b.toISOString(),local:b.toLocaleDateString()};if(Array.isArray(b))return b.map(S);if(typeof b=="object"&&!Array.isArray(b)){const V={};for(const K of Object.keys(b))V[K]=S(b[K]);return V}return b};return{globalSearch:we.value,rows:ke.value.map(b=>({key:b.key,operator:b.operator,value:S(b.value),defType:Ee.value[b.key]?.type,defFilterMode:Ee.value[b.key]?.filterMode})),filteredCount:le.value?.length??0}}return ne({getDebugState:sn}),(S,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":fe.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:me},[e.createElementVNode("div",$2,[b[20]||(b[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref(D)("filter.searchAcrossFields"),value:we.value,onInput:Oe},null,40,L2),we.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:b[0]||(b[0]=V=>we.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:X.value||ke.value.length>0,"dss-filter-funnel-btn--with-sort":ce.showSortBy}]),onClick:b[1]||(b[1]=V=>X.value=!X.value),type:"button",title:X.value?e.unref(D)("filter.closeAdvancedFilter"):e.unref(D)("filter.openAdvancedFilter")},[b[14]||(b[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)),ke.value.length>0?(e.openBlock(),e.createElementBlock("span",A2,e.toDisplayString(ke.value.length),1)):e.createCommentVNode("",!0)],10,T2),ce.showSortBy?(e.openBlock(),e.createElementBlock("div",D2,[b[19]||(b[19]=e.createElementVNode("label",{class:"dss-filter-sortby-label",for:"dss-filter-sort-select"},"Sort by",-1)),e.createElementVNode("select",{id:"dss-filter-sort-select",class:"dss-filter-sortby-select",value:Ae.value,onChange:Tt},[b[15]||(b[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nt.value,V=>(e.openBlock(),e.createElementBlock("option",{key:V.key,value:V.key},e.toDisplayString(V.label),9,R2))),128))],40,H2),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:Lt,disabled:!Ae.value,title:ot.value},[Ae.value?lt.value==="asc"?(e.openBlock(),e.createElementBlock("svg",z2,[...b[17]||(b[17]=[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",P2,[...b[18]||(b[18]=[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",I2,[...b[16]||(b[16]=[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"currentColor"},null,-1)])]))],8,F2)])):e.createCommentVNode("",!0)]),X.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:b[13]||(b[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",O2,[ke.value.length===0?(e.openBlock(),e.createElementBlock("div",q2,e.toDisplayString(e.unref(D)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,(V,K)=>(e.openBlock(),e.createElementBlock("div",{key:V.id,class:"dss-filter-row"},[e.createElementVNode("span",Z2,e.toDisplayString(K===0?e.unref(D)("filter.where"):e.unref(D)("filter.and")),1),e.createElementVNode("div",W2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(oe=>kt(`${V.id}:field`),["stop"])},[e.createElementVNode("span",X2,e.toDisplayString(zt(V.key)),1),b[21]||(b[21]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,U2),J.value===`${V.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[3]||(b[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[2]||(b[2]=oe=>F.value=oe),placeholder:e.unref(D)("filter.searchAttributes")},null,8,Y2),[[e.vModelText,F.value]]),e.createElementVNode("ul",j2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,oe=>(e.openBlock(),e.createElementBlock("li",{key:oe.key,class:"dss-filter-popup-item",onClick:He=>Fe(V,oe.key)},e.toDisplayString(oe.label),9,K2))),128)),Ce.value.length===0?(e.openBlock(),e.createElementBlock("li",G2,e.toDisplayString(e.unref(D)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),Nt(V)==="contain"||Nt(V)==="date"?(e.openBlock(),e.createElementBlock("div",Q2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(oe=>kt(`${V.id}:op`),["stop"])},[e.createElementVNode("span",e0,e.toDisplayString(bt(V.operator)),1),b[22]||(b[22]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,J2),J.value===`${V.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[4]||(b[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",t0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xt(V),oe=>(e.openBlock(),e.createElementBlock("li",{key:oe.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:V.operator===oe.value}]),onClick:He=>Ye(V,oe.value)},e.toDisplayString(oe.label),11,n0))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),mt(V.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",l0,[Nt(V)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(D)("filter.enterValue"),"onUpdate:modelValue":oe=>V.value=oe},null,8,o0)),[[e.vModelText,V.value]]):Nt(V)==="date"?(e.openBlock(),e.createElementBlock("div",a0,[e.createVNode(la,{mode:"single",modelValue:V.value,"onUpdate:modelValue":oe=>V.value=oe},null,8,["modelValue","onUpdate:modelValue"])])):tn(V)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(D)("filter.enterValue"),"onUpdate:modelValue":oe=>V.value=oe},null,8,s0)),[[e.vModelText,V.value]]):tn(V)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(D)("filter.enterValue"),value:V.value,onInput:oe=>wt(V,oe),step:Ee.value[V.key]?.type==="int"?1:void 0},null,40,r0)):tn(V)==="between"?(e.openBlock(),e.createElementBlock("div",i0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(D)("filter.min"),value:V.value?.min,onInput:oe=>et(V,"min",oe),step:Ee.value[V.key]?.type==="int"?1:void 0},null,40,c0),e.createElementVNode("span",u0,e.toDisplayString(e.unref(D)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(D)("filter.max"),value:V.value?.max,onInput:oe=>et(V,"max",oe),step:Ee.value[V.key]?.type==="int"?1:void 0},null,40,d0)])):tn(V)==="multiselect"?(e.openBlock(),e.createElementBlock("div",m0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(oe=>kt(`${V.id}:val`),["stop"])},[e.createElementVNode("span",f0,e.toDisplayString(j(V)),1),b[23]||(b[23]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,p0),J.value===`${V.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[6]||(b[6]=e.withModifiers(()=>{},["stop"]))},[xe(V).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[5]||(b[5]=oe=>F.value=oe),placeholder:e.unref(D)("filter.search")},null,8,v0)),[[e.vModelText,F.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",g0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe(V),oe=>(e.openBlock(),e.createElementBlock("li",{key:oe,class:"dss-filter-popup-item",onClick:He=>Yt(V,oe)},[e.createElementVNode("input",{type:"checkbox",checked:(V.value||[]).includes(oe),tabindex:"-1"},null,8,y0),e.createElementVNode("span",null,e.toDisplayString(oe),1)],8,h0))),128)),Pe(V).length===0?(e.openBlock(),e.createElementBlock("li",k0,e.toDisplayString(e.unref(D)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:oe=>Be(V.id)},[...b[24]||(b[24]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,C0)]))),128)),e.createElementVNode("div",b0,[e.createElementVNode("div",w0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:b[7]||(b[7]=e.withModifiers(V=>kt("add"),["stop"]))},e.toDisplayString(e.unref(D)("filter.addFilter")),1),J.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:b[12]||(b[12]=e.withModifiers(()=>{},["stop"]))},[_e.value&&!Se.value&&!F.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[8]||(b[8]=V=>F.value=V),placeholder:e.unref(D)("filter.searchAttributes")},null,8,x0),[[e.vModelText,F.value]]),e.createElementVNode("ul",E0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:K=>Se.value=V},[e.createElementVNode("span",null,e.toDisplayString(V.label),1),b[25]||(b[25]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,S0))),128)),re.value.length>0?(e.openBlock(),e.createElementBlock("li",V0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:K=>ge(V.key)},e.toDisplayString(V.label),9,N0))),128))])],64)):Se.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:b[9]||(b[9]=V=>Se.value=null)},[b[26]||(b[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(Se.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[10]||(b[10]=V=>F.value=V),placeholder:e.unref(D)("filter.searchAttributes")},null,8,B0),[[e.vModelText,F.value]]),e.createElementVNode("ul",M0,[(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:K=>ge(V.key)},e.toDisplayString(V.label),9,_0))),128)),tt.value.length===0?(e.openBlock(),e.createElementBlock("li",$0,e.toDisplayString(e.unref(D)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[11]||(b[11]=V=>F.value=V),placeholder:e.unref(D)("filter.searchAttributes")},null,8,L0),[[e.vModelText,F.value]]),e.createElementVNode("ul",T0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:K=>ge(V.key)},e.toDisplayString(V.label),9,A0))),128)),Ce.value.length===0?(e.openBlock(),e.createElementBlock("li",D0,e.toDisplayString(e.unref(D)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),ke.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:Ue},e.toDisplayString(e.unref(D)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),F0={class:"dss-pill-field__pills"},I0=["data-value"],z0=["disabled"],P0={class:"dss-pill-field__pill-text"},O0={key:0,class:"dss-pill-field__pill-actions"},q0=["onClick"],Z0=["onClick"],W0=["placeholder","disabled"],U0=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(L,{emit:ne}){const _=L,D=ne,ce=e.ref(""),z=e.ref([..._.modelValue]),M=e.ref(null);let fe=null;const dt=e.ref(null),ee=e.ref(""),v=e.ref(null),we=e.ref(null),ke=e.computed(()=>{if(!we.value)return;const{width:_e,height:Xe}=we.value;return{minWidth:`${_e}px`,height:`${Xe}px`}});function J(_e,Xe){dt.value===Xe&&(v.value=_e)}function X(){dt.value=null,ee.value="",we.value=null,v.value=null}const me=e.computed(()=>new Set(z.value.map(_e=>_e.trim()).filter(Boolean)));function F(_e){M.value=_e,fe&&clearTimeout(fe),fe=setTimeout(()=>{M.value=null,fe=null},900)}function Se(_e){const Xe=_e.trim();return Xe?me.value.has(Xe)?(F(Xe),!1):(z.value=[...z.value,Xe],D("update:modelValue",[...z.value]),!0):!1}function Ae(_e){const Xe=_e.split(/\r?\n/g).map(nt=>nt.trim()).filter(Boolean);if(!Xe.length)return;const re=new Set(z.value.map(nt=>nt.trim()).filter(Boolean)),tt=[...z.value];let Ce=null;for(const nt of Xe){if(re.has(nt)){Ce??=nt;continue}re.add(nt),tt.push(nt)}tt.length!==z.value.length&&(z.value=tt,D("update:modelValue",[...z.value])),Ce&&F(Ce)}function lt(_e){_.disabled||(dt.value===_e&&X(),z.value=z.value.filter((Xe,re)=>re!==_e),D("update:modelValue",[...z.value]))}async function ft(_e,Xe){if(_.disabled)return;const re=Xe.currentTarget.closest(".dss-pill-field__pill");re&&(we.value={width:re.offsetWidth,height:re.offsetHeight}),dt.value=_e,ee.value=z.value[_e]??"",await e.nextTick();const tt=v.value;if(!tt)return;tt.focus();const Ce=tt.value.length;tt.setSelectionRange(Ce,Ce)}function Z(){X()}function De(){if(_.disabled||dt.value===null)return;const _e=dt.value,Xe=z.value[_e]??"",re=ee.value.trim();if(X(),re!==Xe&&me.value.has(re)){F(re);return}if(!re){z.value=z.value.filter((Ce,nt)=>nt!==_e),D("update:modelValue",[...z.value]);return}const tt=z.value.map((Ce,nt)=>nt===_e?re:Ce);z.value=tt,D("update:modelValue",[...z.value])}function We(_e){_e.preventDefault(),!_.disabled&&(Se(ce.value),ce.value="")}function Ee(_e){if(_.disabled)return;const Xe=_e.clipboardData?.getData("text")??"";!Xe.includes(`
|
|
118
|
-
`)&&!Xe.includes("\r")||(_e.preventDefault(),Ae(Xe),ce.value="")}return e.watch(()=>_.modelValue,_e=>{z.value=Array.isArray(_e)?[..._e]:[]},{deep:!0}),e.onBeforeUnmount(()=>{fe&&clearTimeout(fe)}),(_e,Xe)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":_e.disabled}])},[e.createElementVNode("div",F0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,(re,tt)=>(e.openBlock(),e.createElementBlock("span",{key:re,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":M.value===re,"dss-pill-field__pill--editing":dt.value===tt}]),style:e.normalizeStyle(dt.value===tt&&we.value?ke.value:void 0)},[dt.value===tt?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-pill-field__pill-edit-wrap","data-value":ee.value||" "},[e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:Ce=>J(Ce,tt),"onUpdate:modelValue":Xe[0]||(Xe[0]=Ce=>ee.value=Ce),class:"dss-pill-field__pill-edit",type:"text",disabled:_e.disabled,onKeydown:[e.withKeys(De,["enter"]),e.withKeys(Z,["esc"])],onBlur:De},null,40,z0),[[e.vModelText,ee.value]])],8,I0)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",P0,e.toDisplayString(re),1),_e.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",O0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:Ce=>ft(tt,Ce)},[...Xe[2]||(Xe[2]=[e.createElementVNode("svg",{class:"dss-pill-field__pill-action-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})],-1)])],8,q0),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:Ce=>lt(tt)}," × ",8,Z0)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Xe[1]||(Xe[1]=re=>ce.value=re),class:"dss-pill-field__input",type:"text",placeholder:z.value.length?"":_e.placeholder,disabled:_e.disabled,onPaste:Ee,onKeydown:e.withKeys(We,["enter"])},null,40,W0),[[e.vModelText,ce.value]])])],2))}}),X0={class:"dss-step-bar__layout"},Y0={class:"dss-step-bar__header"},j0={class:"dss-step-bar__label"},K0={key:0,class:"dss-step-bar__counter"},G0={class:"dss-step-bar__track-wrapper"},Q0=["aria-valuemax","aria-valuenow","aria-label"],J0=["onMouseenter"],ep={__name:"DSSStepBar",props:{label:{type:String,default:"Progress"},steps:{type:Number,default:5},currentStep:{type:Number,default:0},segments:{type:Array,default:()=>[]},segmentOrder:{type:String,default:"input",validator:L=>["input","desc","asc"].includes(L)},orientation:{type:String,default:"horizontal",validator:L=>["horizontal","vertical"].includes(L)},barHeight:{type:[Number,String],default:200},labelPosition:{type:String,default:"up",validator:L=>["up","down","left","right"].includes(L)},totalValue:{type:Number,default:null},activeColor:{type:String,default:"#34c759"},labelColor:{type:String,default:null},counterColor:{type:String,default:null},valueLabel:{type:String,default:""},counterAsPercentage:{type:Boolean,default:!1},showCounter:{type:Boolean,default:!0},inactiveColor:{type:String,default:"#e5e7eb"},remainderLabel:{type:String,default:"Unused"},remainderTooltipSummary:{type:Boolean,default:!1},options:{type:Object,default:()=>({})}},setup(L){const ne=L,_={segmentMarker:{color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"},maxSegment:{marker:{enabled:!1,color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"}}},D=Y=>Y&&typeof Y=="object"&&!Array.isArray(Y),ce=(Y,ye)=>{const xe=Object.assign({},Y);return!D(Y)||!D(ye)||Object.keys(ye).forEach(Pe=>{if(D(ye[Pe])){Pe in Y?xe[Pe]=ce(Y[Pe],ye[Pe]):Object.assign(xe,{[Pe]:ye[Pe]});return}Object.assign(xe,{[Pe]:ye[Pe]})}),xe},z=e.computed(()=>ce(_,ne.options)),M=e.computed(()=>Math.max(1,Number(ne.steps)||1)),fe=e.computed(()=>Math.min(M.value,Math.max(0,Number(ne.currentStep)||0))),dt=e.computed(()=>Array.isArray(ne.segments)&&ne.segments.length>0),ee=e.computed(()=>{if(!dt.value)return[];const Y=ne.segments.map((ye,xe)=>{const Pe=Number(ye?.value);return{label:ye?.label||`Step ${xe+1}`,value:Number.isFinite(Pe)&&Pe>0?Pe:0,color:ye?.color||ne.activeColor,marker:ye?.marker}});return ne.segmentOrder==="desc"?[...Y].sort((ye,xe)=>xe.value-ye.value):ne.segmentOrder==="asc"?[...Y].sort((ye,xe)=>ye.value-xe.value):Y}),v=e.computed(()=>dt.value?ee.value.reduce((Y,ye)=>Y+ye.value,0):fe.value),we=e.computed(()=>dt.value?Number.isFinite(Number(ne.totalValue))&&Number(ne.totalValue)>0?Number(ne.totalValue):Math.max(1,v.value):M.value),ke=e.computed(()=>dt.value&&Number.isFinite(Number(ne.totalValue))&&Number(ne.totalValue)>0),J=e.computed(()=>ke.value?Math.max(0,Number(ne.totalValue)-v.value):0),X=e.computed(()=>typeof ne.remainderLabel=="string"&&ne.remainderLabel.trim().length>0),me=e.computed(()=>J.value>0),F=e.computed(()=>ee.value.reduce((Y,ye)=>Math.max(Y,Number(ye.value)||0),0)),Se=e.computed(()=>ee.value.filter(Y=>Y.value>0).map(Y=>`${Y.label}: ${Ht(Y.value)}`).join(" | ")),Ae=e.computed(()=>dt.value?ke.value?ee.value.filter(Y=>Y.value>0):ee.value:[]),lt=e.computed(()=>{if(!ne.counterAsPercentage)return`${v.value} / ${we.value}`;const Y=Number(we.value);if(!Number.isFinite(Y)||Y<=0)return"0%";const ye=Math.round(Number(v.value)/Y*100);return`${Math.min(Math.max(ye,0),100)}%`}),ft=e.computed(()=>v.value),Z=e.computed(()=>we.value),De=e.reactive({visible:!1,x:0,y:0,content:""}),We=e.computed(()=>ne.orientation==="vertical"),Ee=e.computed(()=>{const Y=ne.barHeight;return Y==null||Y===""?"200px":typeof Y=="number"?`${Y}px`:String(Y)}),_e=e.computed(()=>({left:`${De.x}px`,top:`${De.y}px`,transform:"translate(-50%, calc(-100% - 8px))"})),Xe=Y=>We.value?{flex:`${Y} 0 0`,minHeight:Y>0?"6px":"0",minWidth:"0"}:{flex:`${Y} 0 0`,minWidth:Y>0?"6px":"0"},re=Y=>{const ye=Y?.parentElement;if(!ye)return{x:0,y:0};const xe=ye.getBoundingClientRect();return{x:xe.left+xe.width/2,y:xe.top}},tt=Y=>{const ye=Y.getBoundingClientRect();return{x:ye.left+ye.width/2,y:ye.top}},Ce=Y=>{if(ke.value){const Pe=Math.max(0,Number(Y.value)||0);return{...Xe(Pe),backgroundColor:Y.color}}const ye=v.value,xe=Y.value>0?Y.value:ye>0?1e-4:1;return{...Xe(xe),backgroundColor:Y.color}},nt=Y=>Number(Y?.value||0)>0&&Number(Y?.value||0)===F.value,ot=Y=>{const ye=D(Y?.marker)?Y.marker:{},xe=Y?.marker===!0||ye.enabled===!0,Pe=nt(Y)&&z.value.maxSegment?.marker?.enabled===!0;if(!(xe||Pe))return{enabled:!1};const ge=ye.backgroundColor??(Pe?z.value.maxSegment?.marker?.backgroundColor:z.value.segmentMarker?.backgroundColor),Be=ye.borderColor??(Pe?z.value.maxSegment?.marker?.borderColor:z.value.segmentMarker?.borderColor),Fe=ye.color??(Pe?z.value.maxSegment?.marker?.color:z.value.segmentMarker?.color),Ye=ye.width??(Pe?z.value.maxSegment?.marker?.width:z.value.segmentMarker?.width),wt=ye.height??(Pe?z.value.maxSegment?.marker?.height:z.value.segmentMarker?.height);return{enabled:!0,backgroundColor:ge,borderColor:Be,color:Fe,width:Ye,height:wt,icon:ye.icon??null,...ye}},kt=Y=>{const ye=ot(Y);return{backgroundColor:ye.backgroundColor??void 0,borderColor:ye.borderColor??void 0,color:ye.color??void 0}},Vt=Y=>{const ye=ot(Y);return{width:ye.width??void 0,height:ye.height??void 0}},Ht=Y=>`${Y}${ne.valueLabel}`,zt=e.computed(()=>({...Xe(J.value),backgroundColor:ne.inactiveColor})),Nt=(Y,ye)=>{if(!Y||!ye?.currentTarget)return;const xe=ye.currentTarget;if(ne.remainderTooltipSummary){const j=re(xe);De.x=j.x,De.y=j.y,De.content=Se.value,De.visible=!!De.content;return}const Pe=tt(xe);De.x=Pe.x,De.y=Pe.y,De.content=`${Y.label}: ${Ht(Y.value)}`,De.visible=!0},bt=Y=>{if(!J.value||!Y?.currentTarget)return;const ye=Y.currentTarget;if(ne.remainderTooltipSummary){const Pe=re(ye);De.x=Pe.x,De.y=Pe.y,De.content=Se.value,De.visible=!!De.content;return}const xe=tt(ye);De.x=xe.x,De.y=xe.y,X.value&&(De.content=`${ne.remainderLabel}: ${Ht(J.value)}`,De.visible=!0)},Xt=()=>{De.visible=!1},mt=()=>{De.visible&&Xt()};e.onMounted(()=>{window.addEventListener("scroll",mt,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",mt,!0)});const tn=e.computed(()=>({"--dss-step-bar-label-color":ne.labelColor??void 0,"--dss-step-bar-counter-color":ne.counterColor??void 0,"--dss-step-bar-active-color":ne.activeColor,"--dss-step-bar-inactive-color":ne.inactiveColor,"--dss-step-bar-bar-height":We.value?Ee.value:void 0}));return(Y,ye)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-step-bar",[`dss-step-bar--${L.orientation}`,`dss-step-bar--label-${L.labelPosition}`]]),style:e.normalizeStyle(tn.value)},[e.createElementVNode("div",X0,[e.createElementVNode("div",Y0,[e.createElementVNode("span",j0,[e.renderSlot(Y.$slots,"label",{label:L.label},()=>[e.createTextVNode(e.toDisplayString(L.label),1)])]),L.showCounter?(e.openBlock(),e.createElementBlock("span",K0,[e.renderSlot(Y.$slots,"counter",{counterDisplay:lt.value},()=>[e.createTextVNode(e.toDisplayString(lt.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",G0,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":Z.value,"aria-valuenow":ft.value,"aria-label":L.label},[dt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value,(xe,Pe)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${Pe}-${xe.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":nt(xe),"dss-step-bar__segment--marker-enabled":ot(xe).enabled}]),style:e.normalizeStyle(Ce(xe)),onMouseenter:j=>Nt(xe,j),onMouseleave:Xt},[ot(xe).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(kt(xe)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(Vt(xe))},[e.renderSlot(Y.$slots,"segment-marker-icon",{segment:xe,index:Pe,marker:ot(xe)},()=>[e.renderSlot(Y.$slots,"max-segment-icon",{segment:xe,index:Pe,marker:ot(xe)},()=>[e.createTextVNode(e.toDisplayString(ot(xe).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,J0))),128)),me.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(zt.value),onMouseenter:ye[0]||(ye[0]=xe=>bt(xe)),onMouseleave:Xt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(M.value,xe=>(e.openBlock(),e.createElementBlock("div",{key:xe,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":xe<=fe.value}])},null,2))),128))],8,Q0)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[De.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip dss-step-bar__tooltip--teleported",style:e.normalizeStyle(_e.value)},e.toDisplayString(De.content),5)):e.createCommentVNode("",!0)]))],6))}},tp={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"}},np={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",currentPageAriaLabel:"Current page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",searchAriaLabel:"Search",searchTableAriaLabel:"Search table",clearSearchAriaLabel:"Clear search",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",expandRowAriaLabel:"Expand row",collapseRowAriaLabel:"Collapse row",filterColumnAriaLabel:"Filter column",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy",showingRange:"Showing {start}-{end} from {total}",ofPages:"of {total}",emptyMessage:"No data available"},lp={searchAcrossFields:"Search across all fields...",openAdvancedFilter:"Open advanced filter",closeAdvancedFilter:"Close advanced filter",noConditionsApplied:"No filter conditions are applied to this view",where:"Where",and:"And",searchAttributes:"Search attributes...",noMatch:"No match",enterValue:"Enter value...",min:"Min",max:"Max",search:"Search...",addFilter:"Add filter",clearAllFilters:"Clear all filters",select:"Select...",selectedCount:"{count} selected",operators:{contains:"contains",not_contains:"does not contain",equals:"equals",not_equals:"does not equal",starts_with:"starts with",ends_with:"ends with",is_empty:"is empty",is_not_empty:"is not empty",is_any_of:"is any of",is_none_of:"is none of",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"between",contains_any:"contains any of",contains_all:"contains all of",not_contains_any:"does not contain",before:"before",after:"after",is_true:"is true",is_false:"is false"}},op={selectDate:"Select Date",selectRange:"Select range",selectFromList:"Select a date",noAvailableDates:"No dates available",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"}},ap={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"}},uo={chart:tp,table:np,filter:lp,datepicker:op,textEditor:ap},sp={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"}},rp={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",currentPageAriaLabel:"Page actuelle",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",searchAriaLabel:"Rechercher",searchTableAriaLabel:"Rechercher dans le tableau",clearSearchAriaLabel:"Effacer la recherche",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",expandRowAriaLabel:"Développer la ligne",collapseRowAriaLabel:"Réduire la ligne",filterColumnAriaLabel:"Filtrer la colonne",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa",showingRange:"Affichage de {start}-{end} sur {total}",ofPages:"sur {total}",emptyMessage:"Aucune donnée disponible"},ip={searchAcrossFields:"Rechercher dans tous les champs...",openAdvancedFilter:"Ouvrir le filtre avancé",closeAdvancedFilter:"Fermer le filtre avancé",noConditionsApplied:"Aucune condition de filtre n'est appliquée à cette vue",where:"Où",and:"Et",searchAttributes:"Rechercher des attributs...",noMatch:"Aucun résultat",enterValue:"Saisir une valeur...",min:"Min",max:"Max",search:"Rechercher...",addFilter:"Ajouter un filtre",clearAllFilters:"Effacer tous les filtres",select:"Sélectionner...",selectedCount:"{count} sélectionnés",operators:{contains:"contient",not_contains:"ne contient pas",equals:"est égal à",not_equals:"est différent de",starts_with:"commence par",ends_with:"se termine par",is_empty:"est vide",is_not_empty:"n'est pas vide",is_any_of:"est l'un de",is_none_of:"n'est aucun de",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"entre",contains_any:"contient l'un de",contains_all:"contient tous",not_contains_any:"ne contient pas",before:"avant",after:"après",is_true:"est vrai",is_false:"est faux"}},cp={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",selectFromList:"Sélectionner une date",noAvailableDates:"Aucune date disponible",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"}},up={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"}},mo={chart:sp,table:rp,filter:ip,datepicker:cp,textEditor:up},dp={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"}},mp={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",currentPageAriaLabel:"Huidige pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",searchAriaLabel:"Zoeken",searchTableAriaLabel:"Zoeken in tabel",clearSearchAriaLabel:"Zoekopdracht wissen",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",expandRowAriaLabel:"Rij uitklappen",collapseRowAriaLabel:"Rij inklappen",filterColumnAriaLabel:"Kolom filteren",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj",showingRange:"{start}-{end} van {total} weergegeven",ofPages:"van {total}",emptyMessage:"Geen gegevens beschikbaar"},pp={searchAcrossFields:"Zoeken in alle velden...",openAdvancedFilter:"Geavanceerde filter openen",closeAdvancedFilter:"Geavanceerde filter sluiten",noConditionsApplied:"Er zijn geen filtervoorwaarden toegepast op deze weergave",where:"Waar",and:"En",searchAttributes:"Zoek attributen...",noMatch:"Geen overeenkomst",enterValue:"Voer waarde in...",min:"Min",max:"Max",search:"Zoeken...",addFilter:"Filter toevoegen",clearAllFilters:"Alle filters wissen",select:"Selecteren...",selectedCount:"{count} geselecteerd",operators:{contains:"bevat",not_contains:"bevat niet",equals:"is gelijk aan",not_equals:"is niet gelijk aan",starts_with:"begint met",ends_with:"eindigt op",is_empty:"is leeg",is_not_empty:"is niet leeg",is_any_of:"is een van",is_none_of:"is geen van",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"tussen",contains_any:"bevat een van",contains_all:"bevat alle",not_contains_any:"bevat niet",before:"voor",after:"na",is_true:"is waar",is_false:"is onwaar"}},fp={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",selectFromList:"Selecteer een datum",noAvailableDates:"Geen datums beschikbaar",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"}},vp={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"}},po={chart:dp,table:mp,filter:pp,datepicker:fp,textEditor:vp},Po={en:uo,fr:mo,nl:po};function ma(L){if(!L||!L.global)return;const ne=L.global.availableLocales||[];Object.keys(Po).forEach(_=>{ne.includes(_)&&L.global.mergeLocaleMessage(_,Po[_])})}const Oo={en:{textEditor:uo.textEditor},fr:{textEditor:mo.textEditor},nl:{textEditor:po.textEditor}};function pa(L){if(!L||!L.global)return;const ne=L.global.availableLocales||[];Object.keys(Oo).forEach(_=>{ne.includes(_)&&L.global.mergeLocaleMessage(_,Oo[_])})}const qo={en:{table:uo.table},fr:{table:mo.table},nl:{table:po.table}};function fa(L){if(!L||!L.global)return;const ne=L.global.availableLocales||[];Object.keys(qo).forEach(_=>{ne.includes(_)&&L.global.mergeLocaleMessage(_,qo[_])})}const Zo={en:{datepicker:uo.datepicker},fr:{datepicker:mo.datepicker},nl:{datepicker:po.datepicker}};function va(L){if(!L||!L.global)return;const ne=L.global.availableLocales||[];Object.keys(Zo).forEach(_=>{ne.includes(_)&&L.global.mergeLocaleMessage(_,Zo[_])})}const Wo={en:{filter:uo.filter},fr:{filter:mo.filter},nl:{filter:po.filter}};function ga(L){if(!L||!L.global)return;const ne=L.global.availableLocales||[];Object.keys(Wo).forEach(_=>{ne.includes(_)&&L.global.mergeLocaleMessage(_,Wo[_])})}const gp={chart:Po,textEditor:Oo,table:qo,datepicker:Zo,filter:Wo};function hp(L){!L||!L.global||(ma(L),pa(L),fa(L),va(L),ga(L))}const yp={en:{...uo},fr:{...mo},nl:{...po}};co.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:yp});exports.DSSChart=fc;exports.DSSChartMessages=Po;exports.DSSColorPicker=n2;exports.DSSConfetti=_2;exports.DSSDatepicker=la;exports.DSSDatepickerMessages=Zo;exports.DSSDnd=B2;exports.DSSFilter=R0;exports.DSSFilterMessages=Wo;exports.DSSLoader=v2;exports.DSSMessages=gp;exports.DSSModal=na;exports.DSSPillField=U0;exports.DSSSkeleton=g2;exports.DSSStepBar=ep;exports.DSSTable=Hu;exports.DSSTableMessages=qo;exports.DSSTextEditor=zm;exports.DSSTextEditorMessages=Oo;exports.addDSSChartTranslations=ma;exports.addDSSDatepickerTranslations=va;exports.addDSSFilterTranslations=ga;exports.addDSSTableTranslations=fa;exports.addDSSTextEditorTranslations=pa;exports.addDSSTranslations=hp;
|
|
117
|
+
`,document.body.appendChild(Ue),Ee=Ue}function et(q,ge){Ee&&(Ee.style.left=`${q-tt}px`,Ee.style.top=`${ge-ft}px`)}function ke(q){q.classList.add("dss-dnd-item--dragging"),q.style.background=fe.value.dragSourceBackground,q.style.borderColor=fe.value.dragSourceBorder,q.style.transform="scale(0.97)"}function nt(q){q.classList.remove("dss-dnd-item--dragging"),q.style.background="",q.style.borderColor="",q.style.transform=""}function ut(q,ge){return document.elementFromPoint(q,ge)?.closest(".dss-dnd-column-body")??null}function st(q,ge){return!!document.elementFromPoint(q,ge)?.closest("[data-dss-dnd-delete-zone]")}function Vt(q,ge){if(z.value&&st(q,ge)){Ce.value=!0,we.value=null,Q.value=-1;return}Ce.value=!1;const Be=ut(q,ge),Fe=Be?.getAttribute("data-column")??null;if(!Fe){we.value=null,Q.value=-1;return}we.value=Fe;const Ue=Be.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let wt=Ue.length;for(let Ge=0;Ge<Ue.length;Ge++){const Xt=Ue[Ge].getBoundingClientRect();if(ge<Xt.top+Xt.height/2){wt=Ge;break}}Q.value=wt}function zt(q){q.preventDefault(),et(q.clientX,q.clientY),!me&&(me=requestAnimationFrame(()=>{me=null,Vt(q.clientX,q.clientY)}))}function Ht(q){window.removeEventListener("pointermove",zt),window.removeEventListener("pointerup",Ht),window.removeEventListener("pointercancel",Ht),Ae?.releasePointerCapture?.(q.pointerId),nt(Ae),Ae=null;const ge=z.value&&st(q.clientX,q.clientY);if(v.value&&ge)D("delete",{item:v.value});else{const Fe=ut(q.clientX,q.clientY)?.getAttribute("data-column")??null;if(v.value&&Fe){const Ue=v.value[_.columnKey],wt=Fe,Xt=(xe.value[wt]||[]).filter(Lt=>Lt[_.itemKey]!==v.value[_.itemKey]),Ze=Math.max(0,Math.min(Q.value,Xt.length)),Pe=je(wt,Ze),Tt=v.value[_.itemKey];D("move",{item:v.value,from:Ue,to:wt,position:Pe,index:Ze}),F&&clearTimeout(F),Y.value={id:Tt,from:Ue,to:wt},F=setTimeout(()=>{Y.value=null},3500)}}Ee&&(Ee.remove(),Ee=null),Z!==null&&(document.body.style.cursor=Z,Z=""),Ne()}function Nt(q,ge){q.preventDefault();const Be=q.target.closest(".dss-dnd-item");if(!Be)return;const Fe=Be.getBoundingClientRect();tt=q.clientX-Fe.left,ft=q.clientY-Fe.top,Z=document.body.style.cursor,document.body.style.cursor="grabbing",v.value=ge,Ae=Be,se(Be,q.clientX,q.clientY),requestAnimationFrame(()=>ke(Be)),Be.setPointerCapture?.(q.pointerId),window.addEventListener("pointermove",zt),window.addEventListener("pointerup",Ht,{once:!0}),window.addEventListener("pointercancel",Ht,{once:!0})}function bt(){De&&(window.removeEventListener("pointermove",Jt),window.removeEventListener("pointerup",dt),window.removeEventListener("pointercancel",dt),De=null)}function Jt(q){if(!De||q.pointerId!==De.pointerId)return;const ge=q.clientX-De.startX,Be=q.clientY-De.startY;if(Math.abs(ge)>=We||Math.abs(Be)>=We){const Fe=De.item;bt(),Nt(q,Fe)}}function dt(q){!De||q.pointerId!==De.pointerId||bt()}function en(q,ge){bt(),De={item:ge,startX:q.clientX,startY:q.clientY,pointerId:q.pointerId},window.addEventListener("pointermove",Jt),window.addEventListener("pointerup",dt),window.addEventListener("pointercancel",dt)}function Ct(q,ge){fe.value.useHandle||en(q,ge)}function ee(q,ge){en(q,ge)}function ve(){me&&(cancelAnimationFrame(me),me=null)}function Ne(){ve(),v.value=null,we.value=null,Ce.value=!1,Q.value=-1}return e.onBeforeUnmount(()=>{ve(),bt(),F&&clearTimeout(F),Ee&&(Ee.remove(),Ee=null)}),(q,ge)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":fe.value.unstyled}]),style:e.normalizeStyle(mt.value)},[z.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":Ce.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(q.$slots,"delete-zone",{isDragging:!!v.value,isOver:Ce.value})],2),[[e.vShow,!!v.value||fe.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.columns,Be=>(e.openBlock(),e.createElementBlock("div",{key:Be.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":we.value==Be.value},Be.class||""]]),style:e.normalizeStyle(J(Be))},[fe.value.showHeader?(e.openBlock(),e.createElementBlock("div",h2,[e.renderSlot(q.$slots,"column-header",{column:Be,items:xe.value[Be.value]||[]},()=>[e.createElementVNode("span",y2,e.toDisplayString(Be.title||Be.value),1),e.createElementVNode("span",k2,e.toDisplayString((xe.value[Be.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Be.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_e.value[Be.value],Fe=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Fe.key},[Fe.type==="indicator"?(e.openBlock(),e.createElementBlock("div",b2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Fe.isDragged,"dss-dnd-item--no-handle":!fe.value.useHandle}]),onPointerdown:Ue=>Ct(Ue,Fe.item)},[fe.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Ue=>ee(Ue,Fe.item),["stop"])},[e.renderSlot(q.$slots,"handle",{},()=>[ge[0]||(ge[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,x2)):e.createCommentVNode("",!0),e.createElementVNode("div",E2,[e.renderSlot(q.$slots,"item",{item:Fe.item,column:Be,justDropped:Y.value?.id===Fe.item[L.itemKey],droppedFrom:Y.value?.id===Fe.item[L.itemKey]?Y.value.from:null,droppedTo:Y.value?.id===Fe.item[L.itemKey]?Y.value.to:null},()=>[e.createElementVNode("div",S2,e.toDisplayString(Fe.item[L.itemKey]),1)])])],42,w2))],64))),128)),(xe.value[Be.value]||[]).length===0&&we.value!=Be.value?(e.openBlock(),e.createElementBlock("div",V2,[e.renderSlot(q.$slots,"empty",{column:Be},()=>[ge[1]||(ge[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,C2)],6))),128))],6))}}),M2={name:"DSSConfetti"},_2=Object.assign(M2,{props:{trigger:{type:Boolean,default:!1},duration:{type:Number,default:3e3},fadeStart:{type:Number,default:2e3},count:{type:Number,default:90},colors:{type:Array,default:()=>["#047395","#ffc230","#0897c1","#fe3b59","#11e1a2","#b3b2fb","#fadb8d","#ffa25b","#feaab1"]},delay:{type:Number,default:300}},setup(L){const ne=L,_=e.ref(null),D=e.ref(!1);let ce=[],z=null,M=null;function fe(Q,Y){const me=[];for(let F=0;F<ne.count;F++)me.push(mt(Q));return me}function mt(Q,Y){return{x:Math.random()*Q,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:ne.colors[Math.floor(Math.random()*ne.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 J(Q,Y,me,F){Q.clearRect(0,0,Y,me);for(const Ee of ce)Q.save(),Q.globalAlpha=Ee.opacity*F,Q.beginPath(),Q.lineWidth=Ee.r,Q.strokeStyle=Ee.color,Q.moveTo(Ee.x+Ee.tilt+Ee.r/2,Ee.y),Q.lineTo(Ee.x+Ee.tilt,Ee.y+Ee.tilt+Ee.r/2),Q.stroke(),Q.restore()}function v(Q,Y,me){const F=.3+me*.7;for(let Ee=0;Ee<ce.length;Ee++){const Ae=ce[Ee];Ae.tiltAngle+=Ae.tiltInc,Ae.y+=Ae.speed*F,Ae.x+=Math.sin(Ae.d)*.5*F,Ae.tilt=Math.sin(Ae.tiltAngle)*15,me>=.99&&Ae.y>Y+20&&(ce[Ee]=mt(Q))}}function we(){D.value=!0,e.nextTick(()=>{const Q=_.value;if(!Q)return;const Y=Q.getContext("2d"),me=Q.parentElement;if(!me)return;const F=me.getBoundingClientRect();Q.width=F.width,Q.height=F.height,ce=fe(Q.width,Q.height);const Ee=Date.now(),Ae=Ee+ne.duration,tt=()=>{const ft=Date.now(),Z=ft-Ee;if(ft<Ae){let De=1;Z>ne.fadeStart&&(De=1-(Z-ne.fadeStart)/(ne.duration-ne.fadeStart)),J(Y,Q.width,Q.height,De),v(Q.width,Q.height,De),z=requestAnimationFrame(tt)}else Ce()};tt()})}function Ce(){z&&(cancelAnimationFrame(z),z=null),ce=[],D.value=!1}return e.watch(()=>ne.trigger,Q=>{Q&&(M&&clearTimeout(M),M=setTimeout(we,ne.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{Ce(),M&&clearTimeout(M)}),(Q,Y)=>D.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:_,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),$2={class:"dss-filter-global-inner"},L2=["placeholder","value"],T2=["title"],A2={key:0,class:"dss-filter-funnel-badge"},D2={key:1,class:"dss-filter-sortby"},H2=["value"],R2=["value"],F2=["disabled","title"],I2={key:0,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},z2={key:1,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},P2={key:2,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},O2={class:"dss-filter-panel"},q2={key:0,class:"dss-filter-empty"},W2={class:"dss-filter-row-prefix"},Z2={class:"dss-filter-cell"},U2=["onClick"],X2={class:"dss-filter-trigger-text"},Y2=["placeholder"],j2={class:"dss-filter-popup-list"},K2=["onClick"],G2={key:0,class:"dss-filter-popup-empty"},Q2={key:0,class:"dss-filter-cell"},J2=["onClick"],e0={class:"dss-filter-trigger-text"},t0={class:"dss-filter-popup-list"},n0=["onClick"],l0={key:1,class:"dss-filter-cell dss-filter-cell--value"},o0=["placeholder","onUpdate:modelValue"],a0={key:1,class:"dss-filter-date-wrap"},s0=["placeholder","onUpdate:modelValue"],r0=["placeholder","value","onInput","step"],i0={key:4,class:"dss-filter-between"},c0=["placeholder","value","onInput","step"],u0={class:"dss-filter-between-sep"},d0=["placeholder","value","onInput","step"],m0={key:5,class:"dss-filter-multiselect"},p0=["onClick"],f0={class:"dss-filter-trigger-text"},v0=["placeholder"],g0={class:"dss-filter-popup-list dss-filter-popup-list--check"},h0=["onClick"],y0=["checked"],k0={key:0,class:"dss-filter-popup-empty"},C0=["onClick"],b0={class:"dss-filter-foot"},w0={class:"dss-filter-cell"},x0=["placeholder"],E0={class:"dss-filter-popup-list"},S0=["onClick"],V0={key:0,class:"dss-filter-popup-divider"},N0=["onClick"],B0=["placeholder"],M0={class:"dss-filter-popup-list"},_0=["onClick"],$0={key:0,class:"dss-filter-popup-empty"},L0=["placeholder"],T0={class:"dss-filter-popup-list"},A0=["onClick"],D0={key:0,class:"dss-filter-popup-empty"},H0={name:"DSSFilter"},R0=Object.assign(H0,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},showSortBy:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(L,{expose:ne,emit:_}){const{t:D}=co.useI18n(),ce=L,z=_,M={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},fe=e.computed(()=>({...M,...ce.options})),mt={text:[{value:"contains"},{value:"not_contains"},{value:"equals"},{value:"not_equals"},{value:"starts_with"},{value:"ends_with"},{value:"is_empty"},{value:"is_not_empty"}],select:[{value:"is_any_of"},{value:"is_none_of"},{value:"is_empty"},{value:"is_not_empty"}],range:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],int:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],arraySelect:[{value:"contains_any"},{value:"contains_all"},{value:"not_contains_any"},{value:"is_empty"},{value:"is_not_empty"}],arrayText:[{value:"contains"},{value:"not_contains"},{value:"is_empty"},{value:"is_not_empty"}],date:[{value:"eq"},{value:"before"},{value:"after"},{value:"is_empty"},{value:"is_not_empty"}],boolean:[{value:"is_true"},{value:"is_false"},{value:"is_empty"},{value:"is_not_empty"}]},J=new Set(["is_empty","is_not_empty","is_true","is_false"]),v=["label","name","title","keyword","full_name","value","text"],we=e.ref(""),Ce=e.ref([]),Q=e.ref(null),Y=e.ref(!1),me=e.ref(null),F=e.ref(""),Ee=e.ref(null),Ae=e.ref(""),tt=e.ref("asc");let ft=1;function Z(S){const b=S.find(V=>V&&typeof V=="object");if(!b)return null;for(const V of v)if(V in b&&typeof b[V]=="string")return V;return Object.keys(b).find(V=>typeof b[V]=="string")||null}function De(S,b){const V=b.filter(j=>j!=null&&j!=="NULL");if(V.length===0)return null;if(V.every(j=>Array.isArray(j))){const j=V.flatMap(He=>He).filter(He=>He!=null);return j.length===0?null:typeof j.find(He=>He!=null)=="object"?"arraySelect":"arrayText"}return V.every(j=>typeof j=="boolean")?"boolean":V.every(j=>typeof j=="number")?new Set(V).size<=fe.value.maxUniqueForEnum?"select":"range":V.every(j=>typeof j=="string")?new Set(V).size<=fe.value.maxUniqueForSelect?"select":"text":V.some(j=>typeof j=="object"&&!Array.isArray(j))?null:"text"}const We=e.computed(()=>{if(!ce.data?.length)return[];const S=new Set;for(const oe of ce.data)if(oe&&typeof oe=="object")for(const He of Object.keys(oe))S.add(He);const b=new Set(ce.exclude),V=[];for(const oe of S){if(b.has(oe))continue;const He=ce.config[oe]||{},kt=ce.data.map(Et=>Et?.[oe]),ot=He.type||De(oe,kt);if(!ot)continue;const ze=He.filterMode||"contain",xt=ze==="date"?"date":ze==="string"?"text":ot,Mt={key:oe,label:He.label||lt(oe),type:xt,filterMode:ze};if(ot==="select"){const Et=kt.filter(it=>it!=null&&it!=="NULL");Mt.uniqueValues=[...new Set(Et)].sort((it,Dt)=>typeof it=="number"&&typeof Dt=="number"?it-Dt:String(it).localeCompare(String(Dt)))}else if(ot==="range"||ot==="int"){const Et=kt.filter(it=>typeof it=="number");Mt.min=Math.min(...Et),Mt.max=Math.max(...Et)}else if(ot==="arraySelect"){const Et=He.displayKey||Z(kt.flatMap(it=>Array.isArray(it)?it:[]));if(Mt.displayKey=Et,Array.isArray(He.uniqueValues)&&He.uniqueValues.length>0)Mt.uniqueValues=He.uniqueValues.map(it=>String(it));else{const it=kt.flatMap(Dt=>Array.isArray(Dt)?Dt:[]).filter(Dt=>Dt!=null).map(Dt=>Et&&typeof Dt=="object"?Dt[Et]:String(Dt)).filter(Dt=>Dt!=null&&Dt!=="");Mt.uniqueValues=[...new Set(it)].sort((Dt,Bt)=>String(Dt).localeCompare(String(Bt)))}}V.push(Mt)}const j=ce.config._order;return j&&V.sort((oe,He)=>{const kt=j.indexOf(oe.key),ot=j.indexOf(He.key);return kt===-1&&ot===-1?0:kt===-1?1:ot===-1?-1:kt-ot}),V}),xe=e.computed(()=>{const S={};for(const b of We.value)S[b.key]=b;return S}),_e=e.computed(()=>Array.isArray(ce.config.groups)&&ce.config.groups.length>0),je=e.computed(()=>{if(!_e.value)return[];const S=new Set(We.value.map(b=>b.key));return ce.config.groups.map(b=>({...b,keys:b.keys.filter(V=>S.has(V))})).filter(b=>b.keys.length>0)}),se=e.computed(()=>{if(!_e.value)return[];const S=new Set(ce.config.groups.flatMap(b=>b.keys));return We.value.filter(b=>!S.has(b.key))}),et=e.computed(()=>{if(!Ee.value)return[];const S=new Set(Ee.value.keys),b=We.value.filter(j=>S.has(j.key));if(!F.value)return b;const V=F.value.toLowerCase();return b.filter(j=>j.label.toLowerCase().includes(V))}),ke=e.computed(()=>{if(!F.value)return We.value;const S=F.value.toLowerCase();return We.value.filter(b=>b.label.toLowerCase().includes(S))}),nt=e.computed(()=>We.value.filter(S=>!["arraySelect","arrayText"].includes(S.type))),ut=e.computed(()=>Ae.value?tt.value==="asc"?"Ascending":"Descending":"No sort selected");function st(S){Q.value===S?Vt():(Q.value=S,F.value="",Ee.value=null)}function Vt(){Q.value=null,F.value="",Ee.value=null}function zt(S){const b=S.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");Q.value&&!b&&!S.target.closest(".dss-filter-popup")&&!S.target.closest(".dss-filter-trigger")&&!S.target.closest(".dss-filter-add-btn")&&Vt(),Y.value&&me.value&&!me.value.contains(S.target)&&(b||(Y.value=!1))}e.onMounted(()=>document.addEventListener("click",zt)),e.onBeforeUnmount(()=>document.removeEventListener("click",zt));function Ht(S){return xe.value[S]?.label||lt(S)}function Nt(S){return xe.value[S.key]?.filterMode||"contain"}function bt(S){return D(`filter.operators.${S}`)}function Jt(S){const b=xe.value[S.key];return(mt[b?.type]||mt.text).map(V=>({...V,label:D(`filter.operators.${V.value}`)}))}function dt(S){return J.has(S)}function en(S){const b=xe.value[S.key];return b?b.type==="date"?"date":b.type==="boolean"?"boolean":b.type==="text"||b.type==="arrayText"?"text":b.type==="select"||b.type==="arraySelect"?"multiselect":b.type==="range"||b.type==="int"?S.operator==="between"?"between":"number":"text":"text"}function Ct(S){return mt[S]?.[0]?.value||"contains"}function ee(S,b){return J.has(b)||S==="date"?null:S==="select"||S==="arraySelect"?[]:(S==="range"||S==="int")&&b==="between"?{min:null,max:null}:S==="range"||S==="int"?null:""}function ve(S){return xe.value[S.key]?.uniqueValues||[]}function Ne(S){const b=ve(S);if(!F.value)return b;const V=F.value.toLowerCase();return b.filter(j=>String(j).toLowerCase().includes(V))}function q(S){const b=S.value;return!b||b.length===0?D("filter.select"):b.length<=2?b.join(", "):D("filter.selectedCount",{count:b.length})}function ge(S){const b=xe.value[S],V=b?.filterMode||"contain",j=b?.type||"text",oe=V==="string"?"contains":Ct(j);Ce.value.push(e.reactive({id:ft++,key:S,operator:oe,value:ee(j,oe)})),Vt()}function Be(S){Ce.value=Ce.value.filter(b=>b.id!==S)}function Fe(S,b){const j=xe.value[b]?.type||"text";S.key=b,S.operator=Ct(j),S.value=ee(j,S.operator),Vt()}function Ue(S,b){const V=en(S);S.operator=b;const j=en(S);if(V!==j||J.has(b)){const oe=xe.value[S.key];S.value=ee(oe?.type||"text",b)}Vt()}function wt(S,b){const V=b.target.value;S.value=V===""?null:Number(V)}function Ge(S,b,V){const j=V.target.value,oe=j===""?null:Number(j);(!S.value||typeof S.value!="object")&&(S.value={min:null,max:null}),S.value={...S.value,[b]:isNaN(oe)?null:oe}}function Xt(S,b){const V=S.value||[],j=V.indexOf(b);S.value=j>=0?V.filter(oe=>oe!==b):[...V,b]}function Ze(){Ce.value=[],we.value="",Vt()}function Pe(S){we.value=S.target.value}function Tt(S){Ae.value=S.target.value}function Lt(){tt.value=tt.value==="asc"?"desc":"asc"}const le=e.computed(()=>{if(!ce.data)return[];let S=ce.data;if(we.value){const b=we.value.toLowerCase();S=S.filter(V=>{for(const j of Object.keys(V)){const oe=V[j];if(typeof oe=="string"&&oe.toLowerCase().includes(b)||typeof oe=="number"&&String(oe).includes(b)||Array.isArray(oe)&&oe.some(He=>He!=null&&(typeof He=="string"?He.toLowerCase().includes(b):typeof He=="object"?Object.values(He).some(kt=>typeof kt=="string"&&kt.toLowerCase().includes(b)):!1)))return!0}return!1})}for(const b of Ce.value){if(!ie(b))continue;const V=xe.value[b.key];V&&(S=S.filter(j=>ye(j,b,V)))}if(ce.showSortBy&&Ae.value){const b=Ae.value,V=tt.value==="asc"?1:-1;S=[...S].sort((j,oe)=>U(j?.[b],oe?.[b])*V)}return S});function U(S,b){const V=X(S),j=X(b);return V==null&&j==null?0:V==null?1:j==null?-1:typeof V=="number"&&typeof j=="number"?V-j:String(V).localeCompare(String(j),void 0,{numeric:!0,sensitivity:"base"})}function X(S){return S==null||S==="NULL"?null:typeof S=="string"||typeof S=="number"||typeof S=="boolean"?S:S instanceof Date?S.getTime():null}function ie(S){return J.has(S.operator)?!0:S.value==null||typeof S.value=="string"&&S.value===""||Array.isArray(S.value)&&S.value.length===0?!1:S.value instanceof Date?!isNaN(S.value.getTime()):!(typeof S.value=="object"&&!Array.isArray(S.value)&&S.value.min==null&&S.value.max==null)}function ye(S,b,V){const j=S?.[b.key],oe=b.value,He=b.operator;if(He==="is_empty")return Yt(j);if(He==="is_not_empty")return!Yt(j);const kt=V.type;if(kt==="text"||kt==="arrayText"){const ot=kt==="arrayText"&&Array.isArray(j)?j.filter(Mt=>Mt!=null).map(String).join(" "):j!=null?String(j):"",ze=String(oe).toLowerCase(),xt=ot.toLowerCase();switch(He){case"contains":return xt.includes(ze);case"not_contains":return!xt.includes(ze);case"equals":return xt===ze;case"not_equals":return xt!==ze;case"starts_with":return xt.startsWith(ze);case"ends_with":return xt.endsWith(ze);default:return!0}}if(kt==="select")switch(He){case"is_any_of":return oe.includes(j);case"is_none_of":return!oe.includes(j);default:return!0}if(kt==="range"||kt==="int"){const ot=typeof j=="number"?j:Number(j);if(typeof ot!="number"||isNaN(ot))return!1;if(He==="between"){const xt=oe?.min!=null?Number(oe.min):null,Mt=oe?.max!=null?Number(oe.max):null,Et=xt!=null&&!isNaN(xt)?xt:null,it=Mt!=null&&!isNaN(Mt)?Mt:null;return(Et==null||ot>=Et)&&(it==null||ot<=it)}const ze=typeof oe=="number"&&!isNaN(oe)?oe:Number(oe);if(He==="contains"||He==="not_contains"){const xt=String(ot),Mt=String(oe??"").toLowerCase(),Et=xt.toLowerCase().includes(Mt);return He==="contains"?Et:!Et}if(typeof ze!="number"||isNaN(ze))return!1;switch(He){case"eq":return ot===ze;case"neq":return ot!==ze;case"gt":return ot>ze;case"gte":return ot>=ze;case"lt":return ot<ze;case"lte":return ot<=ze;default:return!0}}if(kt==="arraySelect"){if(!Array.isArray(j))return!1;const ot=j.filter(ze=>ze!=null).map(ze=>V.displayKey&&typeof ze=="object"?ze[V.displayKey]:String(ze));switch(He){case"contains_any":return ot.some(ze=>oe.includes(ze));case"contains_all":return oe.every(ze=>ot.includes(ze));case"not_contains_any":return!ot.some(ze=>oe.includes(ze));default:return!0}}if(kt==="date"){const ot=Ke(oe);if(!ot||isNaN(ot.getTime()))return!1;const ze=Ke(j);if(!ze||isNaN(ze.getTime()))return!1;const xt=At(ze),Mt=At(ot);switch(He){case"eq":return xt===Mt;case"before":return xt<Mt;case"after":return xt>Mt;default:return!0}}if(kt==="boolean"){const ot=j===!0||j==="true"||j===1,ze=j===!1||j==="false"||j===0;switch(He){case"is_true":return ot;case"is_false":return ze;default:return!0}}return!0}function Ke(S){if(S==null)return null;if(S instanceof Date)return isNaN(S.getTime())?null:S;if(typeof S=="number")return new Date(S>1e10?S:S*1e3);if(typeof S=="string"){const b=new Date(S);return isNaN(b.getTime())?null:b}return null}function At(S){const b=S.getFullYear(),V=String(S.getMonth()+1).padStart(2,"0"),j=String(S.getDate()).padStart(2,"0");return`${b}-${V}-${j}`}function Yt(S){return!!(S==null||S===""||S==="NULL"||Array.isArray(S)&&S.length===0||Array.isArray(S)&&S.every(b=>b==null))}e.watch(le,S=>z("update:modelValue",S),{immediate:!0}),e.watch(()=>ce.data,()=>{Ce.value=[],we.value="",Y.value=!1,Ae.value="",tt.value="asc",Vt()});function lt(S){return S.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,b=>b.toUpperCase())}function sn(){const S=b=>{if(b==null)return b;if(b instanceof Date)return{_type:"Date",value:b.toISOString(),local:b.toLocaleDateString()};if(Array.isArray(b))return b.map(S);if(typeof b=="object"&&!Array.isArray(b)){const V={};for(const j of Object.keys(b))V[j]=S(b[j]);return V}return b};return{globalSearch:we.value,rows:Ce.value.map(b=>({key:b.key,operator:b.operator,value:S(b.value),defType:xe.value[b.key]?.type,defFilterMode:xe.value[b.key]?.filterMode})),filteredCount:le.value?.length??0}}return ne({getDebugState:sn}),(S,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":fe.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:me},[e.createElementVNode("div",$2,[b[20]||(b[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref(D)("filter.searchAcrossFields"),value:we.value,onInput:Pe},null,40,L2),we.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:b[0]||(b[0]=V=>we.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:Y.value||Ce.value.length>0,"dss-filter-funnel-btn--with-sort":ce.showSortBy}]),onClick:b[1]||(b[1]=V=>Y.value=!Y.value),type:"button",title:Y.value?e.unref(D)("filter.closeAdvancedFilter"):e.unref(D)("filter.openAdvancedFilter")},[b[14]||(b[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)),Ce.value.length>0?(e.openBlock(),e.createElementBlock("span",A2,e.toDisplayString(Ce.value.length),1)):e.createCommentVNode("",!0)],10,T2),ce.showSortBy?(e.openBlock(),e.createElementBlock("div",D2,[b[19]||(b[19]=e.createElementVNode("label",{class:"dss-filter-sortby-label",for:"dss-filter-sort-select"},"Sort by",-1)),e.createElementVNode("select",{id:"dss-filter-sort-select",class:"dss-filter-sortby-select",value:Ae.value,onChange:Tt},[b[15]||(b[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nt.value,V=>(e.openBlock(),e.createElementBlock("option",{key:V.key,value:V.key},e.toDisplayString(V.label),9,R2))),128))],40,H2),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:Lt,disabled:!Ae.value,title:ut.value},[Ae.value?tt.value==="asc"?(e.openBlock(),e.createElementBlock("svg",z2,[...b[17]||(b[17]=[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",P2,[...b[18]||(b[18]=[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",I2,[...b[16]||(b[16]=[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"currentColor"},null,-1)])]))],8,F2)])):e.createCommentVNode("",!0)]),Y.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:b[13]||(b[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",O2,[Ce.value.length===0?(e.openBlock(),e.createElementBlock("div",q2,e.toDisplayString(e.unref(D)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(V,j)=>(e.openBlock(),e.createElementBlock("div",{key:V.id,class:"dss-filter-row"},[e.createElementVNode("span",W2,e.toDisplayString(j===0?e.unref(D)("filter.where"):e.unref(D)("filter.and")),1),e.createElementVNode("div",Z2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(oe=>st(`${V.id}:field`),["stop"])},[e.createElementVNode("span",X2,e.toDisplayString(Ht(V.key)),1),b[21]||(b[21]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,U2),Q.value===`${V.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[3]||(b[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[2]||(b[2]=oe=>F.value=oe),placeholder:e.unref(D)("filter.searchAttributes")},null,8,Y2),[[e.vModelText,F.value]]),e.createElementVNode("ul",j2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,oe=>(e.openBlock(),e.createElementBlock("li",{key:oe.key,class:"dss-filter-popup-item",onClick:He=>Fe(V,oe.key)},e.toDisplayString(oe.label),9,K2))),128)),ke.value.length===0?(e.openBlock(),e.createElementBlock("li",G2,e.toDisplayString(e.unref(D)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),Nt(V)==="contain"||Nt(V)==="date"?(e.openBlock(),e.createElementBlock("div",Q2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(oe=>st(`${V.id}:op`),["stop"])},[e.createElementVNode("span",e0,e.toDisplayString(bt(V.operator)),1),b[22]||(b[22]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,J2),Q.value===`${V.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[4]||(b[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",t0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jt(V),oe=>(e.openBlock(),e.createElementBlock("li",{key:oe.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:V.operator===oe.value}]),onClick:He=>Ue(V,oe.value)},e.toDisplayString(oe.label),11,n0))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),dt(V.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",l0,[Nt(V)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(D)("filter.enterValue"),"onUpdate:modelValue":oe=>V.value=oe},null,8,o0)),[[e.vModelText,V.value]]):Nt(V)==="date"?(e.openBlock(),e.createElementBlock("div",a0,[e.createVNode(la,{mode:"single",modelValue:V.value,"onUpdate:modelValue":oe=>V.value=oe},null,8,["modelValue","onUpdate:modelValue"])])):en(V)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(D)("filter.enterValue"),"onUpdate:modelValue":oe=>V.value=oe},null,8,s0)),[[e.vModelText,V.value]]):en(V)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(D)("filter.enterValue"),value:V.value,onInput:oe=>wt(V,oe),step:xe.value[V.key]?.type==="int"?1:void 0},null,40,r0)):en(V)==="between"?(e.openBlock(),e.createElementBlock("div",i0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(D)("filter.min"),value:V.value?.min,onInput:oe=>Ge(V,"min",oe),step:xe.value[V.key]?.type==="int"?1:void 0},null,40,c0),e.createElementVNode("span",u0,e.toDisplayString(e.unref(D)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(D)("filter.max"),value:V.value?.max,onInput:oe=>Ge(V,"max",oe),step:xe.value[V.key]?.type==="int"?1:void 0},null,40,d0)])):en(V)==="multiselect"?(e.openBlock(),e.createElementBlock("div",m0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(oe=>st(`${V.id}:val`),["stop"])},[e.createElementVNode("span",f0,e.toDisplayString(q(V)),1),b[23]||(b[23]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,p0),Q.value===`${V.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[6]||(b[6]=e.withModifiers(()=>{},["stop"]))},[ve(V).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[5]||(b[5]=oe=>F.value=oe),placeholder:e.unref(D)("filter.search")},null,8,v0)),[[e.vModelText,F.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",g0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ne(V),oe=>(e.openBlock(),e.createElementBlock("li",{key:oe,class:"dss-filter-popup-item",onClick:He=>Xt(V,oe)},[e.createElementVNode("input",{type:"checkbox",checked:(V.value||[]).includes(oe),tabindex:"-1"},null,8,y0),e.createElementVNode("span",null,e.toDisplayString(oe),1)],8,h0))),128)),Ne(V).length===0?(e.openBlock(),e.createElementBlock("li",k0,e.toDisplayString(e.unref(D)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:oe=>Be(V.id)},[...b[24]||(b[24]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,C0)]))),128)),e.createElementVNode("div",b0,[e.createElementVNode("div",w0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:b[7]||(b[7]=e.withModifiers(V=>st("add"),["stop"]))},e.toDisplayString(e.unref(D)("filter.addFilter")),1),Q.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:b[12]||(b[12]=e.withModifiers(()=>{},["stop"]))},[_e.value&&!Ee.value&&!F.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[8]||(b[8]=V=>F.value=V),placeholder:e.unref(D)("filter.searchAttributes")},null,8,x0),[[e.vModelText,F.value]]),e.createElementVNode("ul",E0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:j=>Ee.value=V},[e.createElementVNode("span",null,e.toDisplayString(V.label),1),b[25]||(b[25]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,S0))),128)),se.value.length>0?(e.openBlock(),e.createElementBlock("li",V0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(se.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:j=>ge(V.key)},e.toDisplayString(V.label),9,N0))),128))])],64)):Ee.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:b[9]||(b[9]=V=>Ee.value=null)},[b[26]||(b[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(Ee.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[10]||(b[10]=V=>F.value=V),placeholder:e.unref(D)("filter.searchAttributes")},null,8,B0),[[e.vModelText,F.value]]),e.createElementVNode("ul",M0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:j=>ge(V.key)},e.toDisplayString(V.label),9,_0))),128)),et.value.length===0?(e.openBlock(),e.createElementBlock("li",$0,e.toDisplayString(e.unref(D)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[11]||(b[11]=V=>F.value=V),placeholder:e.unref(D)("filter.searchAttributes")},null,8,L0),[[e.vModelText,F.value]]),e.createElementVNode("ul",T0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:j=>ge(V.key)},e.toDisplayString(V.label),9,A0))),128)),ke.value.length===0?(e.openBlock(),e.createElementBlock("li",D0,e.toDisplayString(e.unref(D)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),Ce.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:Ze},e.toDisplayString(e.unref(D)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),F0={class:"dss-pill-field__pills"},I0=["data-value"],z0=["disabled"],P0={class:"dss-pill-field__pill-text"},O0={key:0,class:"dss-pill-field__pill-actions"},q0=["onClick"],W0=["onClick"],Z0=["placeholder","disabled"],U0=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(L,{emit:ne}){const _=L,D=ne,ce=e.ref(""),z=e.ref([..._.modelValue]),M=e.ref(null);let fe=null;const mt=e.ref(null),J=e.ref(""),v=e.ref(null),we=e.ref(null),Ce=e.computed(()=>{if(!we.value)return;const{width:_e,height:je}=we.value;return{minWidth:`${_e}px`,height:`${je}px`}});function Q(_e,je){mt.value===je&&(v.value=_e)}function Y(){mt.value=null,J.value="",we.value=null,v.value=null}const me=e.computed(()=>new Set(z.value.map(_e=>_e.trim()).filter(Boolean)));function F(_e){M.value=_e,fe&&clearTimeout(fe),fe=setTimeout(()=>{M.value=null,fe=null},900)}function Ee(_e){const je=_e.trim();return je?me.value.has(je)?(F(je),!1):(z.value=[...z.value,je],D("update:modelValue",[...z.value]),!0):!1}function Ae(_e){const je=_e.split(/\r?\n/g).map(nt=>nt.trim()).filter(Boolean);if(!je.length)return;const se=new Set(z.value.map(nt=>nt.trim()).filter(Boolean)),et=[...z.value];let ke=null;for(const nt of je){if(se.has(nt)){ke??=nt;continue}se.add(nt),et.push(nt)}et.length!==z.value.length&&(z.value=et,D("update:modelValue",[...z.value])),ke&&F(ke)}function tt(_e){_.disabled||(mt.value===_e&&Y(),z.value=z.value.filter((je,se)=>se!==_e),D("update:modelValue",[...z.value]))}async function ft(_e,je){if(_.disabled)return;const se=je.currentTarget.closest(".dss-pill-field__pill");se&&(we.value={width:se.offsetWidth,height:se.offsetHeight}),mt.value=_e,J.value=z.value[_e]??"",await e.nextTick();const et=v.value;if(!et)return;et.focus();const ke=et.value.length;et.setSelectionRange(ke,ke)}function Z(){Y()}function De(){if(_.disabled||mt.value===null)return;const _e=mt.value,je=z.value[_e]??"",se=J.value.trim();if(Y(),se!==je&&me.value.has(se)){F(se);return}if(!se){z.value=z.value.filter((ke,nt)=>nt!==_e),D("update:modelValue",[...z.value]);return}const et=z.value.map((ke,nt)=>nt===_e?se:ke);z.value=et,D("update:modelValue",[...z.value])}function We(_e){_e.preventDefault(),!_.disabled&&(Ee(ce.value),ce.value="")}function xe(_e){if(_.disabled)return;const je=_e.clipboardData?.getData("text")??"";!je.includes(`
|
|
118
|
+
`)&&!je.includes("\r")||(_e.preventDefault(),Ae(je),ce.value="")}return e.watch(()=>_.modelValue,_e=>{z.value=Array.isArray(_e)?[..._e]:[]},{deep:!0}),e.onBeforeUnmount(()=>{fe&&clearTimeout(fe)}),(_e,je)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":_e.disabled}])},[e.createElementVNode("div",F0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,(se,et)=>(e.openBlock(),e.createElementBlock("span",{key:se,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":M.value===se,"dss-pill-field__pill--editing":mt.value===et}]),style:e.normalizeStyle(mt.value===et&&we.value?Ce.value:void 0)},[mt.value===et?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-pill-field__pill-edit-wrap","data-value":J.value||" "},[e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:ke=>Q(ke,et),"onUpdate:modelValue":je[0]||(je[0]=ke=>J.value=ke),class:"dss-pill-field__pill-edit",type:"text",disabled:_e.disabled,onKeydown:[e.withKeys(De,["enter"]),e.withKeys(Z,["esc"])],onBlur:De},null,40,z0),[[e.vModelText,J.value]])],8,I0)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",P0,e.toDisplayString(se),1),_e.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",O0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:ke=>ft(et,ke)},[...je[2]||(je[2]=[e.createElementVNode("svg",{class:"dss-pill-field__pill-action-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})],-1)])],8,q0),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:ke=>tt(et)}," × ",8,W0)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":je[1]||(je[1]=se=>ce.value=se),class:"dss-pill-field__input",type:"text",placeholder:z.value.length?"":_e.placeholder,disabled:_e.disabled,onPaste:xe,onKeydown:e.withKeys(We,["enter"])},null,40,Z0),[[e.vModelText,ce.value]])])],2))}}),X0={class:"dss-step-bar__layout"},Y0={class:"dss-step-bar__header"},j0={class:"dss-step-bar__label"},K0={key:0,class:"dss-step-bar__counter"},G0={class:"dss-step-bar__track-wrapper"},Q0=["aria-valuemax","aria-valuenow","aria-label"],J0=["onMouseenter"],ep={__name:"DSSStepBar",props:{label:{type:String,default:"Progress"},steps:{type:Number,default:5},currentStep:{type:Number,default:0},segments:{type:Array,default:()=>[]},segmentOrder:{type:String,default:"input",validator:L=>["input","desc","asc"].includes(L)},orientation:{type:String,default:"horizontal",validator:L=>["horizontal","vertical"].includes(L)},barHeight:{type:[Number,String],default:200},labelPosition:{type:String,default:"up",validator:L=>["up","down","left","right"].includes(L)},sideLabelMaxWidth:{type:[Number,String],default:null},totalValue:{type:Number,default:null},activeColor:{type:String,default:"#34c759"},labelColor:{type:String,default:null},counterColor:{type:String,default:null},valueLabel:{type:String,default:""},counterAsPercentage:{type:Boolean,default:!1},showCounter:{type:Boolean,default:!0},inactiveColor:{type:String,default:"#e5e7eb"},remainderLabel:{type:String,default:"Unused"},remainderTooltipSummary:{type:Boolean,default:!1},options:{type:Object,default:()=>({})}},setup(L){const ne=L,_={segmentMarker:{color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"},maxSegment:{marker:{enabled:!1,color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"}}},D=ee=>ee&&typeof ee=="object"&&!Array.isArray(ee),ce=(ee,ve)=>{const Ne=Object.assign({},ee);return!D(ee)||!D(ve)||Object.keys(ve).forEach(q=>{if(D(ve[q])){q in ee?Ne[q]=ce(ee[q],ve[q]):Object.assign(Ne,{[q]:ve[q]});return}Object.assign(Ne,{[q]:ve[q]})}),Ne},z=e.computed(()=>ce(_,ne.options)),M=e.computed(()=>Math.max(1,Number(ne.steps)||1)),fe=e.computed(()=>Math.min(M.value,Math.max(0,Number(ne.currentStep)||0))),mt=e.computed(()=>Array.isArray(ne.segments)&&ne.segments.length>0),J=e.computed(()=>{if(!mt.value)return[];const ee=ne.segments.map((ve,Ne)=>{const q=Number(ve?.value);return{label:ve?.label||`Step ${Ne+1}`,value:Number.isFinite(q)&&q>0?q:0,color:ve?.color||ne.activeColor,marker:ve?.marker}});return ne.segmentOrder==="desc"?[...ee].sort((ve,Ne)=>Ne.value-ve.value):ne.segmentOrder==="asc"?[...ee].sort((ve,Ne)=>ve.value-Ne.value):ee}),v=e.computed(()=>mt.value?J.value.reduce((ee,ve)=>ee+ve.value,0):fe.value),we=e.computed(()=>mt.value?Number.isFinite(Number(ne.totalValue))&&Number(ne.totalValue)>0?Number(ne.totalValue):Math.max(1,v.value):M.value),Ce=e.computed(()=>mt.value&&Number.isFinite(Number(ne.totalValue))&&Number(ne.totalValue)>0),Q=e.computed(()=>Ce.value?Math.max(0,Number(ne.totalValue)-v.value):0),Y=e.computed(()=>typeof ne.remainderLabel=="string"&&ne.remainderLabel.trim().length>0),me=e.computed(()=>Q.value>0),F=e.computed(()=>J.value.reduce((ee,ve)=>Math.max(ee,Number(ve.value)||0),0)),Ee=e.computed(()=>J.value.filter(ee=>ee.value>0).map(ee=>`${ee.label}: ${Ht(ee.value)}`).join(" | ")),Ae=e.computed(()=>mt.value?Ce.value?J.value.filter(ee=>ee.value>0):J.value:[]),tt=e.computed(()=>{if(!ne.counterAsPercentage)return`${v.value} / ${we.value}`;const ee=Number(we.value);if(!Number.isFinite(ee)||ee<=0)return"0%";const ve=Math.round(Number(v.value)/ee*100);return`${Math.min(Math.max(ve,0),100)}%`}),ft=e.computed(()=>v.value),Z=e.computed(()=>we.value),De=e.reactive({visible:!1,x:0,y:0,content:""}),We=e.computed(()=>ne.orientation==="vertical"),xe=e.computed(()=>{const ee=ne.barHeight;return ee==null||ee===""?"200px":typeof ee=="number"?`${ee}px`:String(ee)}),_e=e.computed(()=>{const ee=ne.sideLabelMaxWidth;if(!(ee==null||ee===""))return typeof ee=="number"?`${ee}px`:String(ee)}),je=e.computed(()=>({left:`${De.x}px`,top:`${De.y}px`,transform:"translate(-50%, calc(-100% - 8px))"})),se=ee=>We.value?{flex:`${ee} 0 0`,minHeight:ee>0?"6px":"0",minWidth:"0"}:{flex:`${ee} 0 0`,minWidth:ee>0?"6px":"0"},et=ee=>{const ve=ee?.parentElement;if(!ve)return{x:0,y:0};const Ne=ve.getBoundingClientRect();return{x:Ne.left+Ne.width/2,y:Ne.top}},ke=ee=>{const ve=ee.getBoundingClientRect();return{x:ve.left+ve.width/2,y:ve.top}},nt=ee=>{if(Ce.value){const q=Math.max(0,Number(ee.value)||0);return{...se(q),backgroundColor:ee.color}}const ve=v.value,Ne=ee.value>0?ee.value:ve>0?1e-4:1;return{...se(Ne),backgroundColor:ee.color}},ut=ee=>Number(ee?.value||0)>0&&Number(ee?.value||0)===F.value,st=ee=>{const ve=D(ee?.marker)?ee.marker:{},Ne=ee?.marker===!0||ve.enabled===!0,q=ut(ee)&&z.value.maxSegment?.marker?.enabled===!0;if(!(Ne||q))return{enabled:!1};const Be=ve.backgroundColor??(q?z.value.maxSegment?.marker?.backgroundColor:z.value.segmentMarker?.backgroundColor),Fe=ve.borderColor??(q?z.value.maxSegment?.marker?.borderColor:z.value.segmentMarker?.borderColor),Ue=ve.color??(q?z.value.maxSegment?.marker?.color:z.value.segmentMarker?.color),wt=ve.width??(q?z.value.maxSegment?.marker?.width:z.value.segmentMarker?.width),Ge=ve.height??(q?z.value.maxSegment?.marker?.height:z.value.segmentMarker?.height);return{enabled:!0,backgroundColor:Be,borderColor:Fe,color:Ue,width:wt,height:Ge,icon:ve.icon??null,...ve}},Vt=ee=>{const ve=st(ee);return{backgroundColor:ve.backgroundColor??void 0,borderColor:ve.borderColor??void 0,color:ve.color??void 0}},zt=ee=>{const ve=st(ee);return{width:ve.width??void 0,height:ve.height??void 0}},Ht=ee=>`${ee}${ne.valueLabel}`,Nt=e.computed(()=>({...se(Q.value),backgroundColor:ne.inactiveColor})),bt=(ee,ve)=>{if(!ee||!ve?.currentTarget)return;const Ne=ve.currentTarget;if(ne.remainderTooltipSummary){const ge=et(Ne);De.x=ge.x,De.y=ge.y,De.content=Ee.value,De.visible=!!De.content;return}const q=ke(Ne);De.x=q.x,De.y=q.y,De.content=`${ee.label}: ${Ht(ee.value)}`,De.visible=!0},Jt=ee=>{if(!Q.value||!ee?.currentTarget)return;const ve=ee.currentTarget;if(ne.remainderTooltipSummary){const q=et(ve);De.x=q.x,De.y=q.y,De.content=Ee.value,De.visible=!!De.content;return}const Ne=ke(ve);De.x=Ne.x,De.y=Ne.y,Y.value&&(De.content=`${ne.remainderLabel}: ${Ht(Q.value)}`,De.visible=!0)},dt=()=>{De.visible=!1},en=()=>{De.visible&&dt()};e.onMounted(()=>{window.addEventListener("scroll",en,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",en,!0)});const Ct=e.computed(()=>({"--dss-step-bar-label-color":ne.labelColor??void 0,"--dss-step-bar-counter-color":ne.counterColor??void 0,"--dss-step-bar-active-color":ne.activeColor,"--dss-step-bar-inactive-color":ne.inactiveColor,"--dss-step-bar-bar-height":We.value?xe.value:void 0,"--dss-step-bar-side-label-max-width":_e.value}));return(ee,ve)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-step-bar",[`dss-step-bar--${L.orientation}`,`dss-step-bar--label-${L.labelPosition}`]]),style:e.normalizeStyle(Ct.value)},[e.createElementVNode("div",X0,[e.createElementVNode("div",Y0,[e.createElementVNode("span",j0,[e.renderSlot(ee.$slots,"label",{label:L.label},()=>[e.createTextVNode(e.toDisplayString(L.label),1)])]),L.showCounter?(e.openBlock(),e.createElementBlock("span",K0,[e.renderSlot(ee.$slots,"counter",{counterDisplay:tt.value},()=>[e.createTextVNode(e.toDisplayString(tt.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",G0,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":Z.value,"aria-valuenow":ft.value,"aria-label":L.label},[mt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value,(Ne,q)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${q}-${Ne.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":ut(Ne),"dss-step-bar__segment--marker-enabled":st(Ne).enabled}]),style:e.normalizeStyle(nt(Ne)),onMouseenter:ge=>bt(Ne,ge),onMouseleave:dt},[st(Ne).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(Vt(Ne)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(zt(Ne))},[e.renderSlot(ee.$slots,"segment-marker-icon",{segment:Ne,index:q,marker:st(Ne)},()=>[e.renderSlot(ee.$slots,"max-segment-icon",{segment:Ne,index:q,marker:st(Ne)},()=>[e.createTextVNode(e.toDisplayString(st(Ne).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,J0))),128)),me.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(Nt.value),onMouseenter:ve[0]||(ve[0]=Ne=>Jt(Ne)),onMouseleave:dt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(M.value,Ne=>(e.openBlock(),e.createElementBlock("div",{key:Ne,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":Ne<=fe.value}])},null,2))),128))],8,Q0)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[De.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip dss-step-bar__tooltip--teleported",style:e.normalizeStyle(je.value)},e.toDisplayString(De.content),5)):e.createCommentVNode("",!0)]))],6))}},tp={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"}},np={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",currentPageAriaLabel:"Current page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",searchAriaLabel:"Search",searchTableAriaLabel:"Search table",clearSearchAriaLabel:"Clear search",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",expandRowAriaLabel:"Expand row",collapseRowAriaLabel:"Collapse row",filterColumnAriaLabel:"Filter column",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy",showingRange:"Showing {start}-{end} from {total}",ofPages:"of {total}",emptyMessage:"No data available"},lp={searchAcrossFields:"Search across all fields...",openAdvancedFilter:"Open advanced filter",closeAdvancedFilter:"Close advanced filter",noConditionsApplied:"No filter conditions are applied to this view",where:"Where",and:"And",searchAttributes:"Search attributes...",noMatch:"No match",enterValue:"Enter value...",min:"Min",max:"Max",search:"Search...",addFilter:"Add filter",clearAllFilters:"Clear all filters",select:"Select...",selectedCount:"{count} selected",operators:{contains:"contains",not_contains:"does not contain",equals:"equals",not_equals:"does not equal",starts_with:"starts with",ends_with:"ends with",is_empty:"is empty",is_not_empty:"is not empty",is_any_of:"is any of",is_none_of:"is none of",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"between",contains_any:"contains any of",contains_all:"contains all of",not_contains_any:"does not contain",before:"before",after:"after",is_true:"is true",is_false:"is false"}},op={selectDate:"Select Date",selectRange:"Select range",selectFromList:"Select a date",noAvailableDates:"No dates available",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"}},ap={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"}},uo={chart:tp,table:np,filter:lp,datepicker:op,textEditor:ap},sp={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"}},rp={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",currentPageAriaLabel:"Page actuelle",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",searchAriaLabel:"Rechercher",searchTableAriaLabel:"Rechercher dans le tableau",clearSearchAriaLabel:"Effacer la recherche",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",expandRowAriaLabel:"Développer la ligne",collapseRowAriaLabel:"Réduire la ligne",filterColumnAriaLabel:"Filtrer la colonne",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa",showingRange:"Affichage de {start}-{end} sur {total}",ofPages:"sur {total}",emptyMessage:"Aucune donnée disponible"},ip={searchAcrossFields:"Rechercher dans tous les champs...",openAdvancedFilter:"Ouvrir le filtre avancé",closeAdvancedFilter:"Fermer le filtre avancé",noConditionsApplied:"Aucune condition de filtre n'est appliquée à cette vue",where:"Où",and:"Et",searchAttributes:"Rechercher des attributs...",noMatch:"Aucun résultat",enterValue:"Saisir une valeur...",min:"Min",max:"Max",search:"Rechercher...",addFilter:"Ajouter un filtre",clearAllFilters:"Effacer tous les filtres",select:"Sélectionner...",selectedCount:"{count} sélectionnés",operators:{contains:"contient",not_contains:"ne contient pas",equals:"est égal à",not_equals:"est différent de",starts_with:"commence par",ends_with:"se termine par",is_empty:"est vide",is_not_empty:"n'est pas vide",is_any_of:"est l'un de",is_none_of:"n'est aucun de",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"entre",contains_any:"contient l'un de",contains_all:"contient tous",not_contains_any:"ne contient pas",before:"avant",after:"après",is_true:"est vrai",is_false:"est faux"}},cp={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",selectFromList:"Sélectionner une date",noAvailableDates:"Aucune date disponible",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"}},up={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"}},mo={chart:sp,table:rp,filter:ip,datepicker:cp,textEditor:up},dp={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"}},mp={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",currentPageAriaLabel:"Huidige pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",searchAriaLabel:"Zoeken",searchTableAriaLabel:"Zoeken in tabel",clearSearchAriaLabel:"Zoekopdracht wissen",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",expandRowAriaLabel:"Rij uitklappen",collapseRowAriaLabel:"Rij inklappen",filterColumnAriaLabel:"Kolom filteren",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj",showingRange:"{start}-{end} van {total} weergegeven",ofPages:"van {total}",emptyMessage:"Geen gegevens beschikbaar"},pp={searchAcrossFields:"Zoeken in alle velden...",openAdvancedFilter:"Geavanceerde filter openen",closeAdvancedFilter:"Geavanceerde filter sluiten",noConditionsApplied:"Er zijn geen filtervoorwaarden toegepast op deze weergave",where:"Waar",and:"En",searchAttributes:"Zoek attributen...",noMatch:"Geen overeenkomst",enterValue:"Voer waarde in...",min:"Min",max:"Max",search:"Zoeken...",addFilter:"Filter toevoegen",clearAllFilters:"Alle filters wissen",select:"Selecteren...",selectedCount:"{count} geselecteerd",operators:{contains:"bevat",not_contains:"bevat niet",equals:"is gelijk aan",not_equals:"is niet gelijk aan",starts_with:"begint met",ends_with:"eindigt op",is_empty:"is leeg",is_not_empty:"is niet leeg",is_any_of:"is een van",is_none_of:"is geen van",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"tussen",contains_any:"bevat een van",contains_all:"bevat alle",not_contains_any:"bevat niet",before:"voor",after:"na",is_true:"is waar",is_false:"is onwaar"}},fp={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",selectFromList:"Selecteer een datum",noAvailableDates:"Geen datums beschikbaar",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"}},vp={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"}},po={chart:dp,table:mp,filter:pp,datepicker:fp,textEditor:vp},Po={en:uo,fr:mo,nl:po};function ma(L){if(!L||!L.global)return;const ne=L.global.availableLocales||[];Object.keys(Po).forEach(_=>{ne.includes(_)&&L.global.mergeLocaleMessage(_,Po[_])})}const Oo={en:{textEditor:uo.textEditor},fr:{textEditor:mo.textEditor},nl:{textEditor:po.textEditor}};function pa(L){if(!L||!L.global)return;const ne=L.global.availableLocales||[];Object.keys(Oo).forEach(_=>{ne.includes(_)&&L.global.mergeLocaleMessage(_,Oo[_])})}const qo={en:{table:uo.table},fr:{table:mo.table},nl:{table:po.table}};function fa(L){if(!L||!L.global)return;const ne=L.global.availableLocales||[];Object.keys(qo).forEach(_=>{ne.includes(_)&&L.global.mergeLocaleMessage(_,qo[_])})}const Wo={en:{datepicker:uo.datepicker},fr:{datepicker:mo.datepicker},nl:{datepicker:po.datepicker}};function va(L){if(!L||!L.global)return;const ne=L.global.availableLocales||[];Object.keys(Wo).forEach(_=>{ne.includes(_)&&L.global.mergeLocaleMessage(_,Wo[_])})}const Zo={en:{filter:uo.filter},fr:{filter:mo.filter},nl:{filter:po.filter}};function ga(L){if(!L||!L.global)return;const ne=L.global.availableLocales||[];Object.keys(Zo).forEach(_=>{ne.includes(_)&&L.global.mergeLocaleMessage(_,Zo[_])})}const gp={chart:Po,textEditor:Oo,table:qo,datepicker:Wo,filter:Zo};function hp(L){!L||!L.global||(ma(L),pa(L),fa(L),va(L),ga(L))}const yp={en:{...uo},fr:{...mo},nl:{...po}};co.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:yp});exports.DSSChart=fc;exports.DSSChartMessages=Po;exports.DSSColorPicker=n2;exports.DSSConfetti=_2;exports.DSSDatepicker=la;exports.DSSDatepickerMessages=Wo;exports.DSSDnd=B2;exports.DSSFilter=R0;exports.DSSFilterMessages=Zo;exports.DSSLoader=v2;exports.DSSMessages=gp;exports.DSSModal=na;exports.DSSPillField=U0;exports.DSSSkeleton=g2;exports.DSSStepBar=ep;exports.DSSTable=Hu;exports.DSSTableMessages=qo;exports.DSSTextEditor=zm;exports.DSSTextEditorMessages=Oo;exports.addDSSChartTranslations=ma;exports.addDSSDatepickerTranslations=va;exports.addDSSFilterTranslations=ga;exports.addDSSTableTranslations=fa;exports.addDSSTextEditorTranslations=pa;exports.addDSSTranslations=hp;
|