dsp-semactic 0.6.60 → 0.6.64

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),lo=require("vue-i18n"),Va={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},Na=["value"],Ba=["placeholder","value","disabled"],Ma=["placeholder","value"],_a=["placeholder","value"],$a=["aria-selected","onClick"],La={class:"dss-datepicker__list-item-label"},Aa={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"},Ta={key:1,class:"dss-datepicker__list-empty"},Da={key:1,class:"dss-datepicker__double-wrap"},Ha={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},Ra=["disabled","onClick"],Fa={class:"dss-datepicker__double-calendars"},Ia={class:"dss-datepicker__double-calendar"},za={class:"dss-datepicker__calendar-header"},Pa=["aria-label"],Oa={class:"dss-datepicker__month-year-row"},qa=["aria-label"],Wa={class:"dss-datepicker__weekdays"},Za={class:"dss-datepicker__grid"},Ua=["disabled","onClick","onMouseenter"],Xa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ya={class:"dss-datepicker__double-calendar"},ja={class:"dss-datepicker__calendar-header"},Ka=["aria-label"],Ga={class:"dss-datepicker__month-year-row"},Qa=["aria-label"],Ja={class:"dss-datepicker__weekdays"},es={class:"dss-datepicker__grid"},ts=["disabled","onClick","onMouseenter"],ls={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},ns={class:"dss-datepicker__calendar-header"},os=["aria-label"],as={class:"dss-datepicker__month-year-row"},ss=["aria-label"],rs={class:"dss-datepicker__weekdays"},is={class:"dss-datepicker__grid"},cs=["disabled","onClick","onMouseenter"],us={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},ds={class:"dss-datepicker__calendar-header"},ms={class:"dss-datepicker__month-year-row"},ps={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},fs={class:"dss-datepicker__months-grid"},vs=["onClick"],gs={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},hs={class:"dss-datepicker__month-year"},ys={class:"dss-datepicker__years-grid"},ks=["data-year","onClick"],ia=27,Fn=8,ta={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:H=>["single","range","singleFromAvailable","rangeFromAvailable","listFromAvailable","readonly"].includes(H)},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(H,{emit:ne}){const M=H,A=ne,{t:ue,locale:I}=lo.useI18n(),$=e.ref(!1),ve=e.ref("days"),ct=new Date,Q=e.computed(()=>M.minDate instanceof Date?M.minDate:ct),f=e.ref(Q.value.getMonth()),we=e.ref(Q.value.getFullYear()),Ce=e.ref(Q.value.getMonth()),G=e.ref(Q.value.getFullYear()),U=e.ref(Q.value.getMonth()),pe=e.ref(Q.value.getFullYear()),F=e.ref("start"),Ee=e.ref(null),De=e.ref(null);function tt(){const D=Q.value,O=D.getMonth(),_=D.getFullYear(),ce=O===11?0:O+1,$e=O===11?_+1:_;return{left:{month:O,year:_},right:{month:ce,year:$e}}}const pt=e.ref(null),W=e.ref(null),Ze=e.ref(null),qe=e.ref(null),xe=e.ref(null),Me=e.ref(null),Ye=e.ref(null),ee=e.ref(null),lt=new Date().getFullYear(),be=e.computed(()=>["single","singleFromAvailable"].includes(M.mode)),Je=e.computed(()=>["range","rangeFromAvailable"].includes(M.mode)),ut=e.computed(()=>M.mode==="listFromAvailable"),Ct=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes(M.mode))return null;const D=M.modelValue;return D instanceof Date?D:null}),Et=e.computed(()=>{if(!Je.value)return{start:null,end:null};const D=M.modelValue;return!D||typeof D!="object"?{start:null,end:null}:{start:D.start instanceof Date?D.start:null,end:D.end instanceof Date?D.end:null}});function Ht(D){if(!D||!(D instanceof Date))return"";const O=D.getDate(),_=D.getMonth()+1,ce=D.getFullYear(),$e=dt=>String(dt).padStart(2,"0");return`${$e(O)}/${$e(_)}/${ce}`}const Pt=e.computed(()=>Ht(Ct.value)),se=e.computed(()=>{const{start:D,end:O}=Et.value;if(!D&&!O)return"";const _=!O||D&&D<=O?D:O,ce=!D||O&&O>=D?O:D;return re(_,ce)?Ht(_):`${Ht(_)} - ${Ht(ce)}`}),ge=e.computed(()=>{if(M.mode!=="readonly")return"—";const D=M.modelValue;if(D instanceof Date)return Ht(D)||"—";if(D&&typeof D=="object"&&("start"in D||"end"in D)){const O=D.start instanceof Date?D.start:null,_=D.end instanceof Date?D.end:null;if(!O&&!_)return"—";const ce=!_||O&&O<=_?O:_,$e=!O||_&&_>=O?_:O;return re(ce,$e)?Ht(ce):`${Ht(ce)} - ${Ht($e)}`}return"—"});e.computed(()=>{const D=new Date(we.value,f.value,1);return new Intl.DateTimeFormat(I.value,{month:"long",year:"numeric"}).format(D)});const He=e.computed(()=>De.value==="left"?Ce.value:De.value==="right"?U.value:f.value),_e=e.computed(()=>De.value==="left"?G.value:De.value==="right"?pe.value:we.value),Xt=e.computed(()=>{const D=new Date(we.value,f.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(D)}),bt=e.computed(()=>{const D=new Date(_e.value,He.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(D)}),Gt=e.computed(()=>{const D=new Intl.DateTimeFormat(I.value,{month:"short"});return Array.from({length:12},(O,_)=>D.format(new Date(2024,_,1)))}),Lt=e.computed(()=>{const O=(De.value?_e.value:we.value)-Math.floor(ia/2);return Array.from({length:ia},(_,ce)=>O+ce)}),qt=e.computed(()=>{const D=Lt.value;return D.length?`${D[0]} – ${D[D.length-1]}`:""}),K=e.computed(()=>{const D=new Intl.DateTimeFormat(I.value,{weekday:"short"}),O=new Date(2024,0,1),_=[];for(let ce=0;ce<7;ce++){const $e=new Date(O);$e.setDate(O.getDate()+ce),_.push(D.format($e).slice(0,2))}return _});function ye(D,O){const _=new Date(D,O,1),ce=new Date(D,O+1,0),$e=_.getDay(),dt=ce.getDate(),Qe=[];for(let ot=0;ot<$e;ot++)Qe.push(null);for(let ot=1;ot<=dt;ot++)Qe.push(new Date(D,O,ot));return Qe}const Be=e.computed(()=>ye(we.value,f.value)),Ue=e.computed(()=>ye(G.value,Ce.value)),Ke=e.computed(()=>ye(pe.value,U.value));e.computed(()=>{const D=new Date(G.value,Ce.value,1);return new Intl.DateTimeFormat(I.value,{month:"long",year:"numeric"}).format(D)}),e.computed(()=>{const D=new Date(pe.value,U.value,1);return new Intl.DateTimeFormat(I.value,{month:"long",year:"numeric"}).format(D)});const Tt=e.computed(()=>{const D=new Date(G.value,Ce.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(D)}),et=e.computed(()=>{const D=new Date(pe.value,U.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(D)}),Ot=e.computed(()=>M.availableDates&&M.availableDates.length>0),We=e.computed(()=>Ot.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"}]),Fe=e.ref({top:0,left:0}),xt=e.ref("left");let ft=null;function J(){$.value&&e.nextTick(()=>{$.value&&(ft!==null&&window.cancelAnimationFrame(ft),ft=window.requestAnimationFrame(()=>{ft=null,Z()}))})}function Z(){if(!xe.value||!$.value)return;const D=xe.value.getBoundingClientRect(),O=window.innerWidth||document.documentElement.clientWidth,_=window.innerHeight||document.documentElement.clientHeight;let ce=D.left,$e=D.bottom+4;const dt=Me.value;if(dt){const Qe=dt.offsetWidth,ot=dt.offsetHeight;xt.value==="right"||ce+Qe>O-Fn?(xt.value="right",ce=D.right-Qe):xt.value="left";const nl=Math.max(Fn,O-Qe-Fn);if(ce=Math.min(Math.max(ce,Fn),nl),$e+ot>_-Fn){const Dl=D.top-4-ot;Dl>=Fn?$e=Dl:$e=Math.max(Fn,_-ot-Fn)}}Fe.value={top:$e,left:ce}}const X=e.computed(()=>!xe.value||!$.value?{}:{position:"fixed",left:`${Fe.value.left}px`,top:`${Fe.value.top}px`,zIndex:1002});function re(D,O){return!D||!O?!1:D.getFullYear()===O.getFullYear()&&D.getMonth()===O.getMonth()&&D.getDate()===O.getDate()}function fe(D){return new Date(D.getFullYear(),D.getMonth(),D.getDate()).getTime()}function Ge(D){return!M.availableDates||!M.availableDates.length?!0:M.availableDates.some(O=>O instanceof Date&&re(O,D))}function Nt(D){const O=fe(D);return!(M.minDate instanceof Date&&O<fe(M.minDate)||M.maxDate instanceof Date&&O>fe(M.maxDate))}function rl(D){const O=new Date(D);return new Date(O.getFullYear(),O.getMonth(),O.getDate())}function St(D){return D.filter(O=>Nt(O))}function ll(D,O){if(!(D instanceof Date)||!(O instanceof Date))return null;let _=fe(D),ce=fe(O);if(_>ce&&([_,ce]=[ce,_]),M.minDate instanceof Date){const $e=fe(M.minDate);_=Math.max(_,$e),ce=Math.max(ce,$e)}if(M.maxDate instanceof Date){const $e=fe(M.maxDate);_=Math.min(_,$e),ce=Math.min(ce,$e)}return _>ce?null:{start:rl(_),end:rl(ce)}}function S(D){return!M.exceptDates||!M.exceptDates.length?!1:M.exceptDates.some(O=>O instanceof Date&&re(O,D))}function C(D){return S(D)?!1:["singleFromAvailable","rangeFromAvailable"].includes(M.mode)?Ge(D):Nt(D)}function V(D){const O=Ct.value,_=Et.value,ce=fe(D),$e=Je.value&&_.start&&_.end&&ce>fe(_.start)&&ce<fe(_.end),dt=Je.value&&_.start&&re(D,_.start),Qe=Je.value&&_.end&&re(D,_.end),ot=dt&&Qe,Dt=be.value&&O&&re(D,O)||dt||Qe;let nl=!1;if(Je.value&&_.start&&!_.end&&Ee.value){const Dl=fe(_.start),Nl=fe(Ee.value),Ol=Math.min(Dl,Nl),$n=Math.max(Dl,Nl);nl=ce>Ol&&ce<$n}return{"dss-datepicker__day--selected":Dt&&!ot,"dss-datepicker__day--range-start":dt&&!ot,"dss-datepicker__day--range-end":Qe&&!ot,"dss-datepicker__day--range-single":ot,"dss-datepicker__day--in-range":$e&&!dt&&!Qe,"dss-datepicker__day--in-range-preview":nl&&!dt&&!Qe&&!$e,"dss-datepicker__day--disabled":!C(D)}}function Y(D){if(!Je.value)return;const O=Et.value;if(!O.start||O.end){Ee.value=null;return}if(!C(D)){Ee.value=null;return}Ee.value=new Date(D.getFullYear(),D.getMonth(),D.getDate())}function le(){Ee.value=null}function ze(){if(!M.doubleCalendar||!Je.value)return;const D=Et.value,{start:O,end:_}=D;if(O&&_){const dt=O<=_?O:_,Qe=O<=_?_:O,ot=dt.getMonth(),Dt=dt.getFullYear(),nl=Qe.getMonth(),Dl=Qe.getFullYear();if(ot!==nl||Dt!==Dl){const Nl=Ce.value===ot&&G.value===Dt,Ol=U.value===nl&&pe.value===Dl;if(Nl&&Ol)return;Ce.value=ot,G.value=Dt,U.value=nl,pe.value=Dl}else{const Nl=ot===0?11:ot-1,Ol=ot===0?Dt-1:Dt;Ce.value===Nl&&G.value===Ol&&U.value===ot&&pe.value===Dt||(Ce.value=ot,G.value=Dt,ot===11?(U.value=0,pe.value=Dt+1):(U.value=ot+1,pe.value=Dt))}return}const ce=O||_;if(ce){const dt=ce.getMonth(),Qe=ce.getFullYear(),ot=Ce.value===dt&&G.value===Qe,Dt=U.value===dt&&pe.value===Qe;if(ot||Dt)return;Ce.value=dt,G.value=Qe,dt===11?(U.value=0,pe.value=Qe+1):(U.value=dt+1,pe.value=Qe);return}const $e=tt();Ce.value=$e.left.month,G.value=$e.left.year,U.value=$e.right.month,pe.value=$e.right.year}const gt=e.computed(()=>new Intl.DateTimeFormat(I.value,{day:"2-digit",month:"long",year:"numeric"})),rt=e.computed(()=>{if(!ut.value)return[];const D=(M.availableDates||[]).filter(_=>_ instanceof Date&&!Number.isNaN(_.getTime())).filter(_=>!S(_)&&Nt(_)).map(_=>new Date(_.getFullYear(),_.getMonth(),_.getDate()));D.sort((_,ce)=>ce.getTime()-_.getTime());const O=Ct.value;return D.map(_=>({date:_,ts:_.getTime(),label:gt.value.format(_),selected:!!(O&&re(_,O))}))});function Oe(){if($.value){ht();return}xe.value=qe.value?.closest(".dss-datepicker__input-wrap"),xt.value="left",$.value=!0,J(),e.nextTick(()=>{ee.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function Bt(D){if(!(D instanceof Date))return;const O=new Date(D.getFullYear(),D.getMonth(),D.getDate());A("update:modelValue",O),ht()}function Vt(D="start"){if(M.mode==="readonly")return;F.value=D;const O=Ct.value,_=Et.value;if(be.value&&O)f.value=O.getMonth(),we.value=O.getFullYear();else if(Je.value)if(M.doubleCalendar)ze();else{const ce=D==="start"&&_.start?_.start:_.end||_.start;ce&&(f.value=ce.getMonth(),we.value=ce.getFullYear())}xe.value=be.value?pt.value?.closest(".dss-datepicker__input-wrap"):W.value,ve.value="days",De.value=null,xt.value="left",$.value=!0,J()}function ht(){ve.value="days",De.value=null,Ee.value=null,$.value=!1}function yt(D,O){De.value=D,ve.value=O}function Mt(){ve.value="days",De.value=null}function _t(D){const O=new Date,_=O.getFullYear(),ce=O.getMonth(),$e=O.getDate();let dt,Qe;if(Ot.value){const ot=St([...M.availableDates].filter(Dt=>Dt instanceof Date).map(Dt=>new Date(Dt.getFullYear(),Dt.getMonth(),Dt.getDate()))).sort((Dt,nl)=>Dt.getTime()-nl.getTime());if(ot.length===0)return null;if(D==="all")dt=ot[0],Qe=ot[ot.length-1];else{const Dt=parseInt(D.replace("last",""),10);if(Dt<2||Dt>5)return null;const nl=ot.slice(-Dt);if(nl.length===0)return null;dt=nl[0],Qe=nl[nl.length-1]}}else{const ot=new Date(_,ce,$e);switch(D){case"today":dt=ot,Qe=ot;break;case"lastWeek":dt=new Date(_,ce,$e-6),Qe=ot;break;case"last15Days":dt=new Date(_,ce,$e-14),Qe=ot;break;case"last30Days":dt=new Date(_,ce,$e-29),Qe=ot;break;case"thisMonth":dt=new Date(_,ce,1),Qe=ot;break;case"last3Months":dt=new Date(_,ce-3,1),Qe=new Date(_,ce,0);break;case"last6Months":dt=new Date(_,ce-6,1),Qe=new Date(_,ce,0);break;case"last12Months":dt=new Date(_,ce-12,1),Qe=new Date(_,ce,0);break;case"lastYear":dt=new Date(_-1,0,1),Qe=new Date(_-1,11,31);break;default:return null}}return{start:dt,end:Qe}}function hl(D){const O=_t(D);return O?ll(O.start,O.end):null}function Al(D){return hl(D)!==null}function on(D){const O=hl(D);O&&(A("update:modelValue",O),ze())}function Wt(D){De.value==="left"?Ce.value=D:De.value==="right"?U.value=D:f.value=D,Mt()}function dl(D){De.value==="left"?G.value=D:De.value==="right"?pe.value=D:we.value=D,Mt()}function vn(){f.value===0?(f.value=11,we.value--):f.value--}function gn(){f.value===11?(f.value=0,we.value++):f.value++}function an(){Ce.value===0?(Ce.value=11,G.value--):Ce.value--}function Tl(){Ce.value===11?(Ce.value=0,G.value++):Ce.value++}function El(){U.value===0?(U.value=11,pe.value--):U.value--}function xn(){U.value===11?(U.value=0,pe.value++):U.value++}function sn(D){if(!C(D))return;const O=new Date(D.getFullYear(),D.getMonth(),D.getDate());if(be.value){A("update:modelValue",O),ht();return}const _=Et.value;if(!_.start&&!_.end){A("update:modelValue",{start:O,end:null}),F.value="end";return}if(_.start&&_.end){A("update:modelValue",{start:O,end:null}),F.value="end";return}if(F.value==="start"){let ce=O,$e=_.end;ce&&$e&&ce>$e&&([ce,$e]=[$e,ce]),A("update:modelValue",{start:ce||$e,end:$e||ce}),F.value="end"}else{let ce=_.start,$e=O;ce&&$e&&$e<ce&&([ce,$e]=[$e,ce]),A("update:modelValue",{start:ce||$e,end:$e||ce}),F.value="start"}}e.watch(Et,()=>{M.doubleCalendar&&Je.value&&$.value&&ze()},{deep:!0});let Fl=null,Gl=null,yl=null;function Ql(){Fl&&(document.removeEventListener("keydown",Fl),Fl=null),Gl&&(window.removeEventListener("resize",Gl),Gl=null),yl&&(window.removeEventListener("scroll",yl,!0),yl=null)}return e.watch(ve,D=>{D==="years"&&e.nextTick(()=>{Ye.value?.querySelector(`[data-year="${_e.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[$.value,ve.value,f.value,we.value,Ce.value,G.value,U.value,pe.value,De.value,M.doubleCalendar,M.quickSelect],()=>{J()}),e.watch($,D=>{Ql(),D&&(Fl=O=>{O.key==="Escape"&&(ve.value==="years"||ve.value==="months"?Mt():ht())},Gl=()=>{Z()},yl=()=>{Z()},document.addEventListener("keydown",Fl),window.addEventListener("resize",Gl),window.addEventListener("scroll",yl,!0))}),e.onBeforeUnmount(()=>{ft!==null&&(window.cancelAnimationFrame(ft),ft=null),Ql()}),(D,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":H.mode==="readonly"}])},[H.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",Va,[O[10]||(O[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:ge.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Na)])):be.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:O[0]||(O[0]=_=>Vt("start"))},[O[11]||(O[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:pt,type:"text",class:"dss-datepicker__input",placeholder:M.placeholder||e.unref(ue)("datepicker.selectDate"),value:Pt.value,readonly:"",disabled:H.mode==="readonly"},null,8,Ba)])):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":$.value}]),onClick:Oe},[O[13]||(O[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:qe,type:"text",class:"dss-datepicker__input",placeholder:M.placeholder||e.unref(ue)("datepicker.selectFromList"),value:Pt.value,readonly:""},null,8,Ma),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":$.value}]),"aria-hidden":"true"},[...O[12]||(O[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)):Je.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:W,onClick:O[1]||(O[1]=_=>Vt("start"))},[O[14]||(O[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:Ze,type:"text",class:"dss-datepicker__input",placeholder:M.placeholder||e.unref(ue)("datepicker.selectRange"),value:se.value,readonly:""},null,8,_a)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[$.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(ht,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Me,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":H.doubleCalendar&&Je.value&&ve.value==="days","dss-datepicker__dropdown--quick-select":H.doubleCalendar&&Je.value&&ve.value==="days"&&H.quickSelect,"dss-datepicker__dropdown--list":ut.value}]),onClick:O[9]||(O[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(X.value)},[ut.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[rt.value.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"dss-datepicker__list",role:"listbox",ref_key:"listRef",ref:ee},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rt.value,_=>(e.openBlock(),e.createElementBlock("li",{key:_.ts,role:"option","aria-selected":_.selected,class:e.normalizeClass(["dss-datepicker__list-item",{"dss-datepicker__list-item--selected":_.selected}]),onClick:ce=>Bt(_.date)},[e.createElementVNode("span",La,e.toDisplayString(_.label),1),_.selected?(e.openBlock(),e.createElementBlock("svg",Aa,[...O[15]||(O[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,$a))),128))],512)):(e.openBlock(),e.createElementBlock("div",Ta,e.toDisplayString(e.unref(ue)("datepicker.noAvailableDates")),1))],64)):ve.value==="days"&&H.doubleCalendar&&Je.value?(e.openBlock(),e.createElementBlock("div",Da,[H.quickSelect?(e.openBlock(),e.createElementBlock("nav",Ha,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We.value,_=>(e.openBlock(),e.createElementBlock("button",{key:_.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!Al(_.id),onClick:ce=>on(_.id)},e.toDisplayString(e.unref(ue)(_.labelKey)),9,Ra))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Fa,[e.createElementVNode("div",Ia,[e.createElementVNode("div",za,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.prevMonth"),onClick:an}," ‹ ",8,Pa),e.createElementVNode("div",Oa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[2]||(O[2]=_=>yt("left","months"))},e.toDisplayString(Tt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[3]||(O[3]=_=>yt("left","years"))},e.toDisplayString(G.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.nextMonth"),onClick:Tl}," › ",8,qa)]),e.createElementVNode("div",Wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,_=>(e.openBlock(),e.createElementBlock("span",{key:_,class:"dss-datepicker__weekday"},e.toDisplayString(_),1))),128))]),e.createElementVNode("div",Za,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,(_,ce)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+ce},[_?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(_)]),disabled:!C(_),onClick:$e=>sn(_),onMouseenter:$e=>Y(_),onMouseleave:le},e.toDisplayString(_.getDate()),43,Ua)):(e.openBlock(),e.createElementBlock("span",Xa))],64))),128))])]),e.createElementVNode("div",Ya,[e.createElementVNode("div",ja,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.prevMonth"),onClick:El}," ‹ ",8,Ka),e.createElementVNode("div",Ga,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[4]||(O[4]=_=>yt("right","months"))},e.toDisplayString(et.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[5]||(O[5]=_=>yt("right","years"))},e.toDisplayString(pe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.nextMonth"),onClick:xn}," › ",8,Qa)]),e.createElementVNode("div",Ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,_=>(e.openBlock(),e.createElementBlock("span",{key:_,class:"dss-datepicker__weekday"},e.toDisplayString(_),1))),128))]),e.createElementVNode("div",es,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,(_,ce)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+ce},[_?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(_)]),disabled:!C(_),onClick:$e=>sn(_),onMouseenter:$e=>Y(_),onMouseleave:le},e.toDisplayString(_.getDate()),43,ts)):(e.openBlock(),e.createElementBlock("span",ls))],64))),128))])])])])):ve.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",ns,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.prevMonth"),onClick:vn}," ‹ ",8,os),e.createElementVNode("div",as,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[6]||(O[6]=_=>ve.value="months")},e.toDisplayString(Xt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[7]||(O[7]=_=>ve.value="years")},e.toDisplayString(we.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.nextMonth"),onClick:gn}," › ",8,ss)]),e.createElementVNode("div",rs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,_=>(e.openBlock(),e.createElementBlock("span",{key:_,class:"dss-datepicker__weekday"},e.toDisplayString(_),1))),128))]),e.createElementVNode("div",is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be.value,(_,ce)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ce},[_?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(_)]),disabled:!C(_),onClick:$e=>sn(_),onMouseenter:$e=>Y(_),onMouseleave:le},e.toDisplayString(_.getDate()),43,cs)):(e.openBlock(),e.createElementBlock("span",us))],64))),128))])],64)):ve.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",ds,[e.createElementVNode("div",ms,[e.createElementVNode("span",ps,e.toDisplayString(bt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[8]||(O[8]=_=>ve.value="years")},e.toDisplayString(_e.value),1)])]),e.createElementVNode("div",fs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Gt.value,(_,ce)=>(e.openBlock(),e.createElementBlock("button",{key:ce,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":ce===He.value}]),onClick:$e=>Wt(ce)},e.toDisplayString(_),11,vs))),128))])],64)):ve.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",gs,[e.createElementVNode("span",hs,e.toDisplayString(qt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:Ye},[e.createElementVNode("div",ys,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lt.value,_=>(e.openBlock(),e.createElementBlock("button",{key:_,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":_===_e.value,"dss-datepicker__year-cell--current":_===e.unref(lt)}]),"data-year":_,onClick:ce=>dl(_)},e.toDisplayString(_),11,ks))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Cs=["data-chart-type"],bs={class:"dss-chart-header-titles"},ws={key:0,class:"dss-chart-title"},xs={key:1,class:"dss-chart-subtitle"},Es=["onClick","onMouseenter"],Ss={class:"dss-legend-text"},Vs=["onClick","onMouseenter"],Ns={class:"dss-legend-text"},Bs=["title"],Ms=["src"],_s={class:"dss-chart-area-wrapper"},$s={key:0,class:"dss-chart-z-axis-label"},Ls=["width","height","data-smooth","data-animated"],As=["id"],Ts=["y","width","height"],Ds=["id"],Hs=["d"],Rs=["id"],Fs=["d"],Is={key:0},zs=["clip-path"],Ps=["x1","x2","y1","y2"],Os={class:"dss-axes"},qs=["x1","x2","y1","y2"],Ws=["x1","x2","y1","y2"],Zs=["x1","x2","y1","y2"],Us={class:"dss-axis-labels"},Xs=["x","y"],Ys=["x","y"],js=["x","y"],Ks=["x","y"],Gs=["y","transform"],Qs=["x","y","transform"],Js={key:1,class:"dss-flag-markers"},er=["clip-path"],tr=["x1","x2","y1","y2","onMouseover"],lr=["x1","x2","y1","y2","onMouseover"],nr=["x1","x2","y1","y2","onMouseover"],or=["cx","cy","onMouseover"],ar=["cx","cy","fill","onMouseover"],sr=["x","y"],rr=["clip-path"],ir={key:0},cr=["d","onMouseover"],ur=["x","y","width","height","fill","onMouseover"],dr={class:"dss-line-chart"},mr=["d","stroke","stroke-width","stroke-dasharray"],pr=["d","stroke","stroke-width","opacity"],fr=["cx","cy","r","fill","onMouseover"],vr={key:1},gr=["d","stroke","stroke-width","stroke-dasharray"],hr=["d","stroke","stroke-width","stroke-dasharray"],yr=["d","stroke","stroke-width","opacity"],kr=["cx","cy","r","fill","onMouseover"],Cr={key:2},br=["id"],wr=["x","y","width","height"],xr=["d","fill","fill-opacity","mask"],Er=["d","stroke","stroke-width"],Sr=["d","fill","onMouseover"],Vr=["x","y","width","height","onMouseover"],Nr=["clip-path"],Br=["x1","x2","y1","y2","stroke"],Mr=["cx","cy","r","fill"],_r={key:1,class:"dss-bubble-chart"},$r={key:0,class:"dss-bubble-group"},Lr=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Ar=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Tr=["transform"],Dr=["cx","cy","r"],Hr=["data-chart-type","clip-path"],Rr=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],Fr={key:1,class:"dss-radial-segment-data-labels"},Ir=["x","y"],zr=["x","y","font-size","fill"],Pr=["x1","y1","x2","y2","stroke"],Or=["x1","y1","x2","y2","stroke"],qr=["x","y","text-anchor","font-size"],Wr=["transform"],Zr={key:0,class:"dss-spider-grid"},Ur=["cx","cy","r"],Xr={class:"dss-spider-grid-labels"},Yr=["x","y"],jr=["x","y"],Kr=["x1","x2","y1","y2"],Gr={class:"dss-spider-labels"},Qr=["x","y","text-anchor","dominant-baseline"],Jr=["points","fill","fill-opacity","stroke","stroke-width"],ei=["cx","cy","r","fill","onMouseover"],ti={class:"dss-chart-logos"},li=["cx","cy","r","fill"],ni=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],oi=["onClick","onMouseenter"],ai=["src"],si={class:"dss-marker-tooltip-category"},ri={key:0,class:"dss-marker-tooltip-description"},ii={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},ci={class:"dss-tooltip-title dss-spider-tooltip-area-title"},ui={class:"dss-tooltip-series-name"},di={class:"dss-tooltip-series-value"},mi={key:1,class:"dss-tooltip-section"},pi={key:0,class:"dss-tooltip-title"},fi={class:"dss-bubble-tooltip-data"},vi={key:2,class:"dss-tooltip-section"},gi={class:"dss-tooltip-title"},hi={class:"dss-tooltip-value"},yi={key:0,class:"dss-tooltip-section"},ki={class:"dss-tooltip-section-title"},Ci={class:"dss-tooltip-group-header"},bi={class:"dss-tooltip-item-content"},wi={class:"dss-tooltip-item-text"},xi={key:1,class:"dss-tooltip-section"},Ei={class:"dss-tooltip-section-title"},Si={class:"dss-tooltip-item-content"},Vi={class:"dss-tooltip-item-title"},Ni={key:0,class:"dss-tooltip-item-description"},Bi={class:"dss-tooltip-section"},Mi={class:"dss-tooltip-title"},_i={key:0,class:"dss-bubble-tooltip-data"},$i={class:"dss-tooltip-series-name"},Li={class:"dss-tooltip-series-value"},Ai={key:0,class:"dss-tooltip-section"},Ti={class:"dss-tooltip-section-title"},Di={class:"dss-tooltip-group-header"},Hi={class:"dss-tooltip-item-content"},Ri={class:"dss-tooltip-item-text"},Fi={key:1,class:"dss-tooltip-section"},Ii={class:"dss-tooltip-section-title"},zi={class:"dss-tooltip-item-content"},Pi={class:"dss-tooltip-item-title"},Oi={key:0,class:"dss-tooltip-item-description"},qi=["onClick","onMouseenter"],Wi={class:"dss-legend-text"},Zi={key:1,class:"dss-context-menu-separator"},Ui={key:0,class:"dss-context-menu-separator"},Xi={key:0,class:"dss-context-menu-separator"},Yi=["onClick"],ji=["innerHTML"],Ki={key:0,class:"dss-context-menu-icon"},Gi={class:"dss-marker-modal-header"},Qi={class:"dss-marker-modal-body"},Ji={class:"dss-form-group"},ec={class:"dss-form-group"},tc={for:"dss-marker-description"},lc={key:0,class:"dss-form-text-display"},nc=["placeholder"],oc={class:"dss-marker-modal-footer"},ac={class:"modal-footer-left"},sc={class:"dss-modal-footer-right"},rc=["disabled"],ic={name:"DSSChart"},cc=Object.assign(ic,{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:H=>typeof H=="object"&&H!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(H,{emit:ne}){const{t:M,locale:A}=lo.useI18n(),ue=ne,I=e.ref(null),$=e.ref(null),ve=e.ref(null),ct=e.ref(0),Q=e.ref(0);let f=null,we=null;const Ce=20,G=e.computed(()=>{if(Q.value,ct.value,!I.value||!$.value)return 0;try{const t=I.value.getBoundingClientRect();return $.value.getBoundingClientRect().top-t.top}catch{return 0}}),U=e.computed(()=>`chart-clip-${F.chartId}`),pe=e.computed(()=>`url(#${U.value})`),F=H,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},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 De(t,a){const l=Object.assign({},t);return pt(t)&&pt(a)&&Object.keys(a).forEach(i=>{pt(a[i])?i in t?l[i]=De(t[i],a[i]):Object.assign(l,{[i]:a[i]}):Object.assign(l,{[i]:a[i]})}),l}const tt=()=>{let t=20,a=0,l=0;if(ut.value&&(t+=30),Ct.value&&(t+=25),K.value&&F.series.length>0){const i=F.series.filter((p,g)=>!at.value.has(g)).length;if(ye.value==="top"||ye.value==="bottom"){if(Be.value==="horizontal"){const g=Math.floor(xe.value/100);a=Math.ceil(i/g)*25+10}else a=i*25+10;t+=a}else l=150}return{height:t,legendHeight:a,legendWidth:l}};function pt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const W=e.computed(()=>De(Ee,F.options)),Ze=e.computed(()=>{const t=W.value;return t&&t.chart&&t.chart.width==="auto"}),qe=e.computed(()=>{const t=W.value;return t&&t.chart&&t.chart.height==="auto"}),xe=e.computed(()=>{const t=W.value;return Ze.value?ct.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Me=e.ref(Ce),Ye=e.computed(()=>{if(qe.value){const t=Ye.value;return t??Math.max(0,(Q.value||400)-Me.value*5)}}),ee=e.computed(()=>{const t=W.value;if(be.value==="mini-radial")return xe.value;if(qe.value){const a=Ye.value;return a??Math.max(0,(Q.value||400)-Me.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),lt=e.computed(()=>{if(qe.value&&be.value==="semi-radial"&&Ye.value!=null)return Me.value+ee.value+"px";if(qe.value)return"100%";if(Cl.value)return Me.value+ee.value+"px";if(K.value&&ye.value==="bottom"){const t=tt();return ee.value+(t.legendHeight||35)+"px"}return ee.value+(K.value?20:0)+"px"}),be=e.computed(()=>{const t=W.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Je=e.computed(()=>{const t=F.series.map(a=>a.type||be.value);return new Set(t).size>1}),ut=e.computed(()=>{const t=W.value;return t&&t.title&&t.title.text?t.title.text:""}),Ct=e.computed(()=>{const t=W.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),Et=e.computed(()=>{const t=W.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=W.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),Pt=e.computed(()=>{const t=W.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),se=e.computed(()=>{const t=W.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),ge=e.computed(()=>{const t=se.value;return t&&t.title&&t.title.text?t.title.text:""}),He=e.computed(()=>{const t=W.value;if(!t||!t.yAxis)return Vl;const a=t.yAxis.min;return typeof a=="number"||a===Vl?a:Vl}),_e=e.computed(()=>{const t=W.value;if(!t||!t.yAxis)return Vl;const a=t.yAxis.max;return typeof a=="number"||a===Vl?a:Vl}),Xt=e.computed(()=>{const t=se.value;if(!t)return Vl;const a=t.min;return typeof a=="number"||a===Vl?a:Vl}),bt=e.computed(()=>{const t=se.value;if(!t)return Vl;const a=t.max;return typeof a=="number"||a===Vl?a:Vl}),Gt=e.computed(()=>{const t=W.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Lt=e.computed(()=>{const t=W.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),qt=e.computed(()=>{const t=W.value;return t&&t.grid&&t.grid.show!==!1}),K=e.computed(()=>{const t=W.value;return t&&t.legend&&t.legend.show!==!1}),ye=e.computed(()=>{const t=W.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Be=e.computed(()=>{const t=W.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Ue=e.computed(()=>{const t=W.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Ke=e.computed(()=>{const t=W.value;if(!t||!t.crosshair)return!1;const a=t.crosshair.show;return a===!0||a==="true"}),Tt=e.computed(()=>{const t=W.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),et=e.computed(()=>{const t=W.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Ot=e.computed(()=>{const t=W.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),We=e.computed(()=>{const t=W.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Fe=e.computed(()=>{const t=W.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),xt=e.computed(()=>{if(!Cl.value)return 0;const t=W.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),ft=e.computed(()=>{const t=W.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),J=e.computed(()=>{const{maxX:t}=Ut.value;return t===0}),Z=(t,a)=>J.value&&a===0?5:a,X=t=>{const a=Number(t);return!Number.isFinite(a)||a<=0?0:a},re=e.computed(()=>{const t=W.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),fe=e.computed(()=>{const t=W.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),Ge=e.computed(()=>{const t=W.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),Nt=e.computed(()=>{const t=W.value;return fe.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),rl=e.computed(()=>{const t=W.value,a=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return a.length>0?a:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),St=e.computed(()=>{const t=W.value;return t&&t.animations&&t.animations.enabled!==!1}),ll=e.computed(()=>{const t=W.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),S=e.computed(()=>{const t=W.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),C=e.computed(()=>{const t=W.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),V=e.computed(()=>{const t=W.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Y=e.computed(()=>{const t=W.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),le=e.computed(()=>{const t=W.value;return t&&t.animations&&t.animations.onDataChange!==!1}),ze=e.computed(()=>{const t=W.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),gt=e.computed(()=>{const t=W.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),rt=e.computed(()=>W.value?.spider?.gridSteps||5),Oe=e.computed(()=>{const t=[],a=rt.value;for(let l=1;l<=a;l++)t.push(it.value/a*l);return t}),Bt=t=>{const a=Vt.value;if(a&&Array.isArray(a)&&a[t]!==void 0)return a[t].toString();const l=Oe.value[t];return Math.round(l/it.value*100)+"%"},Vt=e.computed(()=>W.value?.spider?.gridLabels||null),ht=e.computed(()=>{const t=W.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),yt=e.computed(()=>{const t=W.value,a={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...a,...t.contextMenu.items}:a}),Mt=e.computed(()=>{const t=W.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),_t=e.computed(()=>{const t=W.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Ql.value}),hl=e.computed(()=>{const t=W.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Al=e.computed(()=>{const t=W.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),on=e.computed(()=>{const a=W.value?.valueFormat?.extension;return typeof a=="string"?a:""}),Wt=t=>{const a=on.value;if(t==null)return"";const l=String(t);return a?l+a:l},dl=e.computed(()=>!oe.value.isZooming);e.computed(()=>Yt.value.map(t=>{if(t.categoryIndex!==void 0&&(Sl.value||jt.value)){const a=Kt(t.categoryIndex),l=G.value+z.value.bottom-Al.value/2;return{...t,x:a,y:l}}return t}));function vn(t,a){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,b,w]=t.split("-"),P=Number(w?.length===2?`20${w}`:w);l=new Date(P,Number(b)-1,Number(g))}else return 0;let i=0,p=1/0;return a.forEach((g,b)=>{const[w,P,N]=g.split("-"),T=Number(N?.length===2?`20${N}`:N),B=new Date(T,Number(P)-1,Number(w)),te=Math.abs(B-l);te<p&&(p=te,i=b)}),i}const gn=e.computed(()=>{const t=F.markers.map(l=>{const i=vn(l.marker_date,F.categories),p=Kt(i),g=G.value+z.value.bottom-Al.value/2;return{...l,x:p,y:g,categoryIndex:i,source:"props"}}),a=Yt.value.map(l=>{if(l.categoryIndex!==void 0&&(Sl.value||jt.value)){const i=Kt(l.categoryIndex),p=G.value+z.value.bottom-Al.value/2;return{...l,x:i,y:p,source:"internal"}}return{...l,source:"internal"}});return[...t,...a]}),an=e.computed(()=>{const t=W.value;return t&&t.watermark&&t.watermark.enabled===!0}),Tl=e.computed(()=>{const t=W.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),El=e.computed(()=>{const t=W.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),xn=e.computed(()=>{const t=W.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),sn=e.computed(()=>{const t={left:z.value.left,top:z.value.top,width:z.value.width,height:z.value.height};let a,l;const i=String(El.value);if(i.includes("%")){const p=parseFloat(i)/100;a=t.width*p,l=a*(96/499)}else{const p=parseFloat(i)||25;a=Math.min(t.width*.25,200)*(p/25),l=a*(96/499)}return{width:a,height:l,area:t}}),Fl=e.computed(()=>{const{width:t,height:a}=sn.value,l=xn.value;let i,p;const g=z.value.left,b=z.value.right,w=z.value.top,P=z.value.bottom,N=z.value.width,T=z.value.height;switch(l){case"center":i=g+(N-t)/2,p=w+(T-a)/2;break;case"top-left":i=g+15,p=w+5;break;case"top-right":i=b-t-15,p=w+5;break;case"bottom-left":i=g+15,p=P-a-5;break;case"bottom-right":default:i=b-t-15,p=P-a-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${a}px`}}),Gl=t=>!F.flags||!F.flags.length?[]:F.flags.filter(a=>a.categoryIndex===t),yl=t=>{const a=Gl(t),l=yn(t),i=a.filter(b=>b.manual),p=a.filter(b=>!b.manual),g=[];return i.length>0&&g.push({type:M("chart.tooltip.manualFlags"),color:"#698dbe",flags:i.map(b=>({text:b.text,color:"#698dbe"}))}),p.length>0&&g.push({type:M("chart.tooltip.autoFlags"),color:"#a1d499",flags:p.map(b=>({text:b.text,color:"#a1d499"}))}),{flagGroups:g,markers:l.map(b=>({title:b.title,description:b.description,type:M("chart.tooltip.markers"),color:b.color||"#9784ba"}))}},Ql=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"),so=require("vue-i18n"),Va={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},Na=["value"],Ba=["placeholder","value","disabled"],Ma=["placeholder","value"],_a=["placeholder","value"],$a=["aria-selected","onClick"],La={class:"dss-datepicker__list-item-label"},Aa={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"},Ta={key:1,class:"dss-datepicker__list-empty"},Da={key:1,class:"dss-datepicker__double-wrap"},Ha={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},Ra=["disabled","onClick"],Fa={class:"dss-datepicker__double-calendars"},Ia={class:"dss-datepicker__double-calendar"},za={class:"dss-datepicker__calendar-header"},Pa=["aria-label"],Oa={class:"dss-datepicker__month-year-row"},qa=["aria-label"],Wa={class:"dss-datepicker__weekdays"},Za={class:"dss-datepicker__grid"},Ua=["disabled","onClick","onMouseenter"],Xa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ya={class:"dss-datepicker__double-calendar"},ja={class:"dss-datepicker__calendar-header"},Ka=["aria-label"],Ga={class:"dss-datepicker__month-year-row"},Qa=["aria-label"],Ja={class:"dss-datepicker__weekdays"},es={class:"dss-datepicker__grid"},ts=["disabled","onClick","onMouseenter"],ls={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},ns={class:"dss-datepicker__calendar-header"},os=["aria-label"],as={class:"dss-datepicker__month-year-row"},ss=["aria-label"],rs={class:"dss-datepicker__weekdays"},is={class:"dss-datepicker__grid"},cs=["disabled","onClick","onMouseenter"],us={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},ds={class:"dss-datepicker__calendar-header"},ms={class:"dss-datepicker__month-year-row"},ps={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},fs={class:"dss-datepicker__months-grid"},vs=["onClick"],gs={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},hs={class:"dss-datepicker__month-year"},ys={class:"dss-datepicker__years-grid"},ks=["data-year","onClick"],ia=27,qn=8,na={__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:oe}){const _=L,A=oe,{t:ce,locale:I}=so.useI18n(),B=e.ref(!1),ve=e.ref("days"),ut=new Date,Q=e.computed(()=>_.minDate instanceof Date?_.minDate:ut),f=e.ref(Q.value.getMonth()),xe=e.ref(Q.value.getFullYear()),Ce=e.ref(Q.value.getMonth()),G=e.ref(Q.value.getFullYear()),U=e.ref(Q.value.getMonth()),me=e.ref(Q.value.getFullYear()),F=e.ref("start"),Se=e.ref(null),Te=e.ref(null);function nt(){const H=Q.value,P=H.getMonth(),$=H.getFullYear(),ie=P===11?0:P+1,Le=P===11?$+1:$;return{left:{month:P,year:$},right:{month:ie,year:Le}}}const mt=e.ref(null),W=e.ref(null),Ze=e.ref(null),qe=e.ref(null),Ee=e.ref(null),Me=e.ref(null),Ye=e.ref(null),ee=e.ref(null),ot=new Date().getFullYear(),be=e.computed(()=>["single","singleFromAvailable"].includes(_.mode)),tt=e.computed(()=>["range","rangeFromAvailable"].includes(_.mode)),dt=e.computed(()=>_.mode==="listFromAvailable"),kt=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes(_.mode))return null;const H=_.modelValue;return H instanceof Date?H:null}),wt=e.computed(()=>{if(!tt.value)return{start:null,end:null};const H=_.modelValue;return!H||typeof H!="object"?{start:null,end:null}:{start:H.start instanceof Date?H.start:null,end:H.end instanceof Date?H.end:null}});function Dt(H){if(!H||!(H instanceof Date))return"";const P=H.getDate(),$=H.getMonth()+1,ie=H.getFullYear(),Le=ct=>String(ct).padStart(2,"0");return`${Le(P)}/${Le($)}/${ie}`}const Ft=e.computed(()=>Dt(kt.value)),se=e.computed(()=>{const{start:H,end:P}=wt.value;if(!H&&!P)return"";const $=!P||H&&H<=P?H:P,ie=!H||P&&P>=H?P:H;return re($,ie)?Dt($):`${Dt($)} - ${Dt(ie)}`}),pe=e.computed(()=>{if(_.mode!=="readonly")return"—";const H=_.modelValue;if(H instanceof Date)return Dt(H)||"—";if(H&&typeof H=="object"&&("start"in H||"end"in H)){const P=H.start instanceof Date?H.start:null,$=H.end instanceof Date?H.end:null;if(!P&&!$)return"—";const ie=!$||P&&P<=$?P:$,Le=!P||$&&$>=P?$:P;return re(ie,Le)?Dt(ie):`${Dt(ie)} - ${Dt(Le)}`}return"—"});e.computed(()=>{const H=new Date(xe.value,f.value,1);return new Intl.DateTimeFormat(I.value,{month:"long",year:"numeric"}).format(H)});const De=e.computed(()=>Te.value==="left"?Ce.value:Te.value==="right"?U.value:f.value),_e=e.computed(()=>Te.value==="left"?G.value:Te.value==="right"?me.value:xe.value),jt=e.computed(()=>{const H=new Date(xe.value,f.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(H)}),Ct=e.computed(()=>{const H=new Date(_e.value,De.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(H)}),Gt=e.computed(()=>{const H=new Intl.DateTimeFormat(I.value,{month:"short"});return Array.from({length:12},(P,$)=>H.format(new Date(2024,$,1)))}),$t=e.computed(()=>{const P=(Te.value?_e.value:xe.value)-Math.floor(ia/2);return Array.from({length:ia},($,ie)=>P+ie)}),Wt=e.computed(()=>{const H=$t.value;return H.length?`${H[0]} – ${H[H.length-1]}`:""}),K=e.computed(()=>{const H=new Intl.DateTimeFormat(I.value,{weekday:"short"}),P=new Date(2024,0,1),$=[];for(let ie=0;ie<7;ie++){const Le=new Date(P);Le.setDate(P.getDate()+ie),$.push(H.format(Le).slice(0,2))}return $});function ye(H,P){const $=new Date(H,P,1),ie=new Date(H,P+1,0),Le=$.getDay(),ct=ie.getDate(),rt=[];for(let je=0;je<Le;je++)rt.push(null);for(let je=1;je<=ct;je++)rt.push(new Date(H,P,je));return rt}const Be=e.computed(()=>ye(xe.value,f.value)),Ue=e.computed(()=>ye(G.value,Ce.value)),Je=e.computed(()=>ye(me.value,U.value));e.computed(()=>{const H=new Date(G.value,Ce.value,1);return new Intl.DateTimeFormat(I.value,{month:"long",year:"numeric"}).format(H)}),e.computed(()=>{const H=new Date(me.value,U.value,1);return new Intl.DateTimeFormat(I.value,{month:"long",year:"numeric"}).format(H)});const Lt=e.computed(()=>{const H=new Date(G.value,Ce.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(H)}),lt=e.computed(()=>{const H=new Date(me.value,U.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(H)}),Pt=e.computed(()=>_.availableDates&&_.availableDates.length>0),We=e.computed(()=>Pt.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"}]),Re=e.ref({top:0,left:0}),bt=e.ref("left");let pt=null;function J(){B.value&&e.nextTick(()=>{B.value&&(pt!==null&&window.cancelAnimationFrame(pt),pt=window.requestAnimationFrame(()=>{pt=null,Z()}))})}function Z(){if(!Ee.value||!B.value)return;const H=Ee.value.getBoundingClientRect(),P=window.innerWidth||document.documentElement.clientWidth,$=window.innerHeight||document.documentElement.clientHeight;let ie=H.left,Le=H.bottom+4;const ct=Me.value;if(ct){const rt=ct.offsetWidth,je=ct.offsetHeight;bt.value==="right"||ie+rt>P-qn?(bt.value="right",ie=H.right-rt):bt.value="left";const ml=Math.max(qn,P-rt-qn);if(ie=Math.min(Math.max(ie,qn),ml),Le+je>$-qn){const El=H.top-4-je;El>=qn?Le=El:Le=Math.max(qn,$-je-qn)}}Re.value={top:Le,left:ie}}const X=e.computed(()=>!Ee.value||!B.value?{}:{position:"fixed",left:`${Re.value.left}px`,top:`${Re.value.top}px`,zIndex:1002});function re(H,P){return!H||!P?!1:H.getFullYear()===P.getFullYear()&&H.getMonth()===P.getMonth()&&H.getDate()===P.getDate()}function fe(H){return new Date(H.getFullYear(),H.getMonth(),H.getDate()).getTime()}function et(H){return!_.availableDates||!_.availableDates.length?!0:_.availableDates.some(P=>P instanceof Date&&re(P,H))}function St(H){const P=fe(H);return!(_.minDate instanceof Date&&P<fe(_.minDate)||_.maxDate instanceof Date&&P>fe(_.maxDate))}function il(H){const P=new Date(H);return new Date(P.getFullYear(),P.getMonth(),P.getDate())}function xt(H){return H.filter(P=>St(P))}function tl(H,P){if(!(H instanceof Date)||!(P instanceof Date))return null;let $=fe(H),ie=fe(P);if($>ie&&([$,ie]=[ie,$]),_.minDate instanceof Date){const Le=fe(_.minDate);$=Math.max($,Le),ie=Math.max(ie,Le)}if(_.maxDate instanceof Date){const Le=fe(_.maxDate);$=Math.min($,Le),ie=Math.min(ie,Le)}return $>ie?null:{start:il($),end:il(ie)}}function S(H){return!_.exceptDates||!_.exceptDates.length?!1:_.exceptDates.some(P=>P instanceof Date&&re(P,H))}function C(H){return S(H)?!1:["singleFromAvailable","rangeFromAvailable"].includes(_.mode)?et(H):St(H)}function V(H){const P=kt.value,$=wt.value,ie=fe(H),Le=tt.value&&$.start&&$.end&&ie>fe($.start)&&ie<fe($.end),ct=tt.value&&$.start&&re(H,$.start),rt=tt.value&&$.end&&re(H,$.end),je=ct&&rt,At=be.value&&P&&re(H,P)||ct||rt;let ml=!1;if(tt.value&&$.start&&!$.end&&Se.value){const El=fe($.start),Il=fe(Se.value),_l=Math.min(El,Il),Dn=Math.max(El,Il);ml=ie>_l&&ie<Dn}return{"dss-datepicker__day--selected":At&&!je,"dss-datepicker__day--range-start":ct&&!je,"dss-datepicker__day--range-end":rt&&!je,"dss-datepicker__day--range-single":je,"dss-datepicker__day--in-range":Le&&!ct&&!rt,"dss-datepicker__day--in-range-preview":ml&&!ct&&!rt&&!Le,"dss-datepicker__day--disabled":!C(H)}}function Y(H){if(!tt.value)return;const P=wt.value;if(!P.start||P.end){Se.value=null;return}if(!C(H)){Se.value=null;return}Se.value=new Date(H.getFullYear(),H.getMonth(),H.getDate())}function le(){Se.value=null}function ze(){if(!_.doubleCalendar||!tt.value)return;const H=wt.value,{start:P,end:$}=H;if(P&&$){const ct=P<=$?P:$,rt=P<=$?$:P,je=ct.getMonth(),At=ct.getFullYear(),ml=rt.getMonth(),El=rt.getFullYear();if(je!==ml||At!==El){const Il=Ce.value===je&&G.value===At,_l=U.value===ml&&me.value===El;if(Il&&_l)return;Ce.value=je,G.value=At,U.value=ml,me.value=El}else{const Il=je===0?11:je-1,_l=je===0?At-1:At;Ce.value===Il&&G.value===_l&&U.value===je&&me.value===At||(Ce.value=je,G.value=At,je===11?(U.value=0,me.value=At+1):(U.value=je+1,me.value=At))}return}const ie=P||$;if(ie){const ct=ie.getMonth(),rt=ie.getFullYear(),je=Ce.value===ct&&G.value===rt,At=U.value===ct&&me.value===rt;if(je||At)return;Ce.value=ct,G.value=rt,ct===11?(U.value=0,me.value=rt+1):(U.value=ct+1,me.value=rt);return}const Le=nt();Ce.value=Le.left.month,G.value=Le.left.year,U.value=Le.right.month,me.value=Le.right.year}const ft=e.computed(()=>new Intl.DateTimeFormat(I.value,{day:"2-digit",month:"long",year:"numeric"})),st=e.computed(()=>{if(!dt.value)return[];const H=(_.availableDates||[]).filter($=>$ instanceof Date&&!Number.isNaN($.getTime())).filter($=>!S($)&&St($)).map($=>new Date($.getFullYear(),$.getMonth(),$.getDate()));H.sort(($,ie)=>ie.getTime()-$.getTime());const P=kt.value;return H.map($=>({date:$,ts:$.getTime(),label:ft.value.format($),selected:!!(P&&re($,P))}))});function Oe(){if(B.value){vt();return}Ee.value=qe.value?.closest(".dss-datepicker__input-wrap"),bt.value="left",B.value=!0,J(),e.nextTick(()=>{ee.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function Vt(H){if(!(H instanceof Date))return;const P=new Date(H.getFullYear(),H.getMonth(),H.getDate());A("update:modelValue",P),vt()}function Et(H="start"){if(_.mode==="readonly")return;F.value=H;const P=kt.value,$=wt.value;if(be.value&&P)f.value=P.getMonth(),xe.value=P.getFullYear();else if(tt.value)if(_.doubleCalendar)ze();else{const ie=H==="start"&&$.start?$.start:$.end||$.start;ie&&(f.value=ie.getMonth(),xe.value=ie.getFullYear())}Ee.value=be.value?mt.value?.closest(".dss-datepicker__input-wrap"):W.value,ve.value="days",Te.value=null,bt.value="left",B.value=!0,J()}function vt(){ve.value="days",Te.value=null,Se.value=null,B.value=!1}function at(H,P){Te.value=H,ve.value=P}function Nt(){ve.value="days",Te.value=null}function Bt(H){const P=new Date,$=P.getFullYear(),ie=P.getMonth(),Le=P.getDate();let ct,rt;if(Pt.value){const je=xt([..._.availableDates].filter(At=>At instanceof Date).map(At=>new Date(At.getFullYear(),At.getMonth(),At.getDate()))).sort((At,ml)=>At.getTime()-ml.getTime());if(je.length===0)return null;if(H==="all")ct=je[0],rt=je[je.length-1];else{const At=parseInt(H.replace("last",""),10);if(At<2||At>5)return null;const ml=je.slice(-At);if(ml.length===0)return null;ct=ml[0],rt=ml[ml.length-1]}}else{const je=new Date($,ie,Le);switch(H){case"today":ct=je,rt=je;break;case"lastWeek":ct=new Date($,ie,Le-6),rt=je;break;case"last15Days":ct=new Date($,ie,Le-14),rt=je;break;case"last30Days":ct=new Date($,ie,Le-29),rt=je;break;case"thisMonth":ct=new Date($,ie,1),rt=je;break;case"last3Months":ct=new Date($,ie-3,1),rt=new Date($,ie,0);break;case"last6Months":ct=new Date($,ie-6,1),rt=new Date($,ie,0);break;case"last12Months":ct=new Date($,ie-12,1),rt=new Date($,ie,0);break;case"lastYear":ct=new Date($-1,0,1),rt=new Date($-1,11,31);break;default:return null}}return{start:ct,end:rt}}function yl(H){const P=Bt(H);return P?tl(P.start,P.end):null}function Al(H){return yl(H)!==null}function un(H){const P=yl(H);P&&(A("update:modelValue",P),ze())}function Kt(H){Te.value==="left"?Ce.value=H:Te.value==="right"?U.value=H:f.value=H,Nt()}function dl(H){Te.value==="left"?G.value=H:Te.value==="right"?me.value=H:xe.value=H,Nt()}function ln(){f.value===0?(f.value=11,xe.value--):f.value--}function yn(){f.value===11?(f.value=0,xe.value++):f.value++}function dn(){Ce.value===0?(Ce.value=11,G.value--):Ce.value--}function Bl(){Ce.value===11?(Ce.value=0,G.value++):Ce.value++}function kn(){U.value===0?(U.value=11,me.value--):U.value--}function Ml(){U.value===11?(U.value=0,me.value++):U.value++}function mn(H){if(!C(H))return;const P=new Date(H.getFullYear(),H.getMonth(),H.getDate());if(be.value){A("update:modelValue",P),vt();return}const $=wt.value;if(!$.start&&!$.end){A("update:modelValue",{start:P,end:null}),F.value="end";return}if($.start&&$.end){A("update:modelValue",{start:P,end:null}),F.value="end";return}if(F.value==="start"){let ie=P,Le=$.end;ie&&Le&&ie>Le&&([ie,Le]=[Le,ie]),A("update:modelValue",{start:ie||Le,end:Le||ie}),F.value="end"}else{let ie=$.start,Le=P;ie&&Le&&Le<ie&&([ie,Le]=[Le,ie]),A("update:modelValue",{start:ie||Le,end:Le||ie}),F.value="start"}}e.watch(wt,()=>{_.doubleCalendar&&tt.value&&B.value&&ze()},{deep:!0});let nn=null,Fl=null,kl=null;function on(){nn&&(document.removeEventListener("keydown",nn),nn=null),Fl&&(window.removeEventListener("resize",Fl),Fl=null),kl&&(window.removeEventListener("scroll",kl,!0),kl=null)}return e.watch(ve,H=>{H==="years"&&e.nextTick(()=>{Ye.value?.querySelector(`[data-year="${_e.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[B.value,ve.value,f.value,xe.value,Ce.value,G.value,U.value,me.value,Te.value,_.doubleCalendar,_.quickSelect],()=>{J()}),e.watch(B,H=>{on(),H&&(nn=P=>{P.key==="Escape"&&(ve.value==="years"||ve.value==="months"?Nt():vt())},Fl=()=>{Z()},kl=()=>{Z()},document.addEventListener("keydown",nn),window.addEventListener("resize",Fl),window.addEventListener("scroll",kl,!0))}),e.onBeforeUnmount(()=>{pt!==null&&(window.cancelAnimationFrame(pt),pt=null),on()}),(H,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":L.mode==="readonly"}])},[L.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",Va,[P[10]||(P[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:pe.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Na)])):be.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:P[0]||(P[0]=$=>Et("start"))},[P[11]||(P[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:mt,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(ce)("datepicker.selectDate"),value:Ft.value,readonly:"",disabled:L.mode==="readonly"},null,8,Ba)])):dt.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":B.value}]),onClick:Oe},[P[13]||(P[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:qe,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(ce)("datepicker.selectFromList"),value:Ft.value,readonly:""},null,8,Ma),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":B.value}]),"aria-hidden":"true"},[...P[12]||(P[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)):tt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:W,onClick:P[1]||(P[1]=$=>Et("start"))},[P[14]||(P[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:Ze,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(ce)("datepicker.selectRange"),value:se.value,readonly:""},null,8,_a)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[B.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(vt,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Me,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":L.doubleCalendar&&tt.value&&ve.value==="days","dss-datepicker__dropdown--quick-select":L.doubleCalendar&&tt.value&&ve.value==="days"&&L.quickSelect,"dss-datepicker__dropdown--list":dt.value}]),onClick:P[9]||(P[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(X.value)},[dt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[st.value.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"dss-datepicker__list",role:"listbox",ref_key:"listRef",ref:ee},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(st.value,$=>(e.openBlock(),e.createElementBlock("li",{key:$.ts,role:"option","aria-selected":$.selected,class:e.normalizeClass(["dss-datepicker__list-item",{"dss-datepicker__list-item--selected":$.selected}]),onClick:ie=>Vt($.date)},[e.createElementVNode("span",La,e.toDisplayString($.label),1),$.selected?(e.openBlock(),e.createElementBlock("svg",Aa,[...P[15]||(P[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,$a))),128))],512)):(e.openBlock(),e.createElementBlock("div",Ta,e.toDisplayString(e.unref(ce)("datepicker.noAvailableDates")),1))],64)):ve.value==="days"&&L.doubleCalendar&&tt.value?(e.openBlock(),e.createElementBlock("div",Da,[L.quickSelect?(e.openBlock(),e.createElementBlock("nav",Ha,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We.value,$=>(e.openBlock(),e.createElementBlock("button",{key:$.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!Al($.id),onClick:ie=>un($.id)},e.toDisplayString(e.unref(ce)($.labelKey)),9,Ra))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Fa,[e.createElementVNode("div",Ia,[e.createElementVNode("div",za,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:dn}," ‹ ",8,Pa),e.createElementVNode("div",Oa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[2]||(P[2]=$=>at("left","months"))},e.toDisplayString(Lt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[3]||(P[3]=$=>at("left","years"))},e.toDisplayString(G.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:Bl}," › ",8,qa)]),e.createElementVNode("div",Wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,$=>(e.openBlock(),e.createElementBlock("span",{key:$,class:"dss-datepicker__weekday"},e.toDisplayString($),1))),128))]),e.createElementVNode("div",Za,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,($,ie)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+ie},[$?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V($)]),disabled:!C($),onClick:Le=>mn($),onMouseenter:Le=>Y($),onMouseleave:le},e.toDisplayString($.getDate()),43,Ua)):(e.openBlock(),e.createElementBlock("span",Xa))],64))),128))])]),e.createElementVNode("div",Ya,[e.createElementVNode("div",ja,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:kn}," ‹ ",8,Ka),e.createElementVNode("div",Ga,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[4]||(P[4]=$=>at("right","months"))},e.toDisplayString(lt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[5]||(P[5]=$=>at("right","years"))},e.toDisplayString(me.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:Ml}," › ",8,Qa)]),e.createElementVNode("div",Ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,$=>(e.openBlock(),e.createElementBlock("span",{key:$,class:"dss-datepicker__weekday"},e.toDisplayString($),1))),128))]),e.createElementVNode("div",es,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,($,ie)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+ie},[$?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V($)]),disabled:!C($),onClick:Le=>mn($),onMouseenter:Le=>Y($),onMouseleave:le},e.toDisplayString($.getDate()),43,ts)):(e.openBlock(),e.createElementBlock("span",ls))],64))),128))])])])])):ve.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",ns,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:ln}," ‹ ",8,os),e.createElementVNode("div",as,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[6]||(P[6]=$=>ve.value="months")},e.toDisplayString(jt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[7]||(P[7]=$=>ve.value="years")},e.toDisplayString(xe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:yn}," › ",8,ss)]),e.createElementVNode("div",rs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,$=>(e.openBlock(),e.createElementBlock("span",{key:$,class:"dss-datepicker__weekday"},e.toDisplayString($),1))),128))]),e.createElementVNode("div",is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be.value,($,ie)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ie},[$?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V($)]),disabled:!C($),onClick:Le=>mn($),onMouseenter:Le=>Y($),onMouseleave:le},e.toDisplayString($.getDate()),43,cs)):(e.openBlock(),e.createElementBlock("span",us))],64))),128))])],64)):ve.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",ds,[e.createElementVNode("div",ms,[e.createElementVNode("span",ps,e.toDisplayString(Ct.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[8]||(P[8]=$=>ve.value="years")},e.toDisplayString(_e.value),1)])]),e.createElementVNode("div",fs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Gt.value,($,ie)=>(e.openBlock(),e.createElementBlock("button",{key:ie,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":ie===De.value}]),onClick:Le=>Kt(ie)},e.toDisplayString($),11,vs))),128))])],64)):ve.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",gs,[e.createElementVNode("span",hs,e.toDisplayString(Wt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:Ye},[e.createElementVNode("div",ys,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($t.value,$=>(e.openBlock(),e.createElementBlock("button",{key:$,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":$===_e.value,"dss-datepicker__year-cell--current":$===e.unref(ot)}]),"data-year":$,onClick:ie=>dl($)},e.toDisplayString($),11,ks))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Cs=["data-chart-type"],bs={class:"dss-chart-header-titles"},ws={key:0,class:"dss-chart-title"},xs={key:1,class:"dss-chart-subtitle"},Es=["onClick","onMouseenter"],Ss={class:"dss-legend-text"},Vs=["onClick","onMouseenter"],Ns={class:"dss-legend-text"},Bs=["title"],Ms=["src"],_s={class:"dss-chart-area-wrapper"},$s={key:0,class:"dss-chart-z-axis-label"},Ls=["width","height","data-smooth","data-animated"],As=["id"],Ts=["y","width","height"],Ds=["id"],Hs=["d"],Rs=["id"],Fs=["d"],Is={key:0},zs=["clip-path"],Ps=["x1","x2","y1","y2"],Os={class:"dss-axes"},qs=["x1","x2","y1","y2"],Ws=["x1","x2","y1","y2"],Zs=["x1","x2","y1","y2"],Us={class:"dss-axis-labels"},Xs=["x","y"],Ys=["x","y"],js=["x","y"],Ks=["x","y"],Gs=["y","transform"],Qs=["x","y","transform"],Js={key:1,class:"dss-flag-markers"},er=["clip-path"],tr=["x1","x2","y1","y2","onMouseover"],lr=["x1","x2","y1","y2","onMouseover"],nr=["x1","x2","y1","y2","onMouseover"],or=["cx","cy","onMouseover"],ar=["cx","cy","fill","onMouseover"],sr=["x","y"],rr=["clip-path"],ir={key:0},cr=["d","onMouseover"],ur=["x","y","width","height","fill","onMouseover"],dr={class:"dss-line-chart"},mr=["d","stroke","stroke-width","stroke-dasharray"],pr=["d","stroke","stroke-width","opacity"],fr=["cx","cy","r","fill","onMouseover"],vr={key:1},gr=["d","stroke","stroke-width","stroke-dasharray"],hr=["d","stroke","stroke-width","stroke-dasharray"],yr=["d","stroke","stroke-width","opacity"],kr=["cx","cy","r","fill","onMouseover"],Cr={key:2},br=["id"],wr=["x","y","width","height"],xr=["d","fill","fill-opacity","mask"],Er=["d","stroke","stroke-width"],Sr=["d","fill","onMouseover"],Vr=["x","y","width","height","onMouseover"],Nr=["clip-path"],Br=["x1","x2","y1","y2","stroke"],Mr=["cx","cy","r","fill"],_r={key:1,class:"dss-bubble-chart"},$r={key:0,class:"dss-bubble-group"},Lr=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Ar=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Tr=["transform"],Dr=["cx","cy","r"],Hr=["data-chart-type","clip-path"],Rr=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],Fr={key:1,class:"dss-radial-segment-data-labels"},Ir=["x","y"],zr=["x","y","font-size","fill"],Pr=["x1","y1","x2","y2","stroke"],Or=["x1","y1","x2","y2","stroke"],qr=["x","y","text-anchor","font-size"],Wr=["transform"],Zr={key:0,class:"dss-spider-grid"},Ur=["cx","cy","r"],Xr={class:"dss-spider-grid-labels"},Yr=["x","y"],jr=["x","y"],Kr=["x1","x2","y1","y2"],Gr={class:"dss-spider-labels"},Qr=["x","y","text-anchor","dominant-baseline"],Jr=["points","fill","fill-opacity","stroke","stroke-width"],ei=["cx","cy","r","fill","onMouseover"],ti={class:"dss-chart-logos"},li=["cx","cy","r","fill"],ni=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],oi=["onClick","onMouseenter"],ai=["src"],si={class:"dss-marker-tooltip-category"},ri={key:0,class:"dss-marker-tooltip-description"},ii={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},ci={class:"dss-tooltip-title dss-spider-tooltip-area-title"},ui={class:"dss-tooltip-series-name"},di={class:"dss-tooltip-series-value"},mi={key:1,class:"dss-tooltip-section"},pi={key:0,class:"dss-tooltip-title"},fi={class:"dss-bubble-tooltip-data"},vi={key:2,class:"dss-tooltip-section"},gi={class:"dss-tooltip-title"},hi={class:"dss-tooltip-value"},yi={key:0,class:"dss-tooltip-section"},ki={class:"dss-tooltip-section-title"},Ci={class:"dss-tooltip-group-header"},bi={class:"dss-tooltip-item-content"},wi={class:"dss-tooltip-item-text"},xi={key:1,class:"dss-tooltip-section"},Ei={class:"dss-tooltip-section-title"},Si={class:"dss-tooltip-item-content"},Vi={class:"dss-tooltip-item-title"},Ni={key:0,class:"dss-tooltip-item-description"},Bi={class:"dss-tooltip-section"},Mi={class:"dss-tooltip-title"},_i={key:0,class:"dss-bubble-tooltip-data"},$i={class:"dss-tooltip-series-name"},Li={class:"dss-tooltip-series-value"},Ai={key:0,class:"dss-tooltip-section"},Ti={class:"dss-tooltip-section-title"},Di={class:"dss-tooltip-group-header"},Hi={class:"dss-tooltip-item-content"},Ri={class:"dss-tooltip-item-text"},Fi={key:1,class:"dss-tooltip-section"},Ii={class:"dss-tooltip-section-title"},zi={class:"dss-tooltip-item-content"},Pi={class:"dss-tooltip-item-title"},Oi={key:0,class:"dss-tooltip-item-description"},qi=["onClick","onMouseenter"],Wi={class:"dss-legend-text"},Zi={key:1,class:"dss-context-menu-separator"},Ui={key:0,class:"dss-context-menu-separator"},Xi={key:0,class:"dss-context-menu-separator"},Yi=["onClick"],ji=["innerHTML"],Ki={key:0,class:"dss-context-menu-icon"},Gi={class:"dss-marker-modal-header"},Qi={class:"dss-marker-modal-body"},Ji={class:"dss-form-group"},ec={class:"dss-form-group"},tc={for:"dss-marker-description"},lc={key:0,class:"dss-form-text-display"},nc=["placeholder"],oc={class:"dss-marker-modal-footer"},ac={class:"modal-footer-left"},sc={class:"dss-modal-footer-right"},rc=["disabled"],ic={name:"DSSChart"},cc=Object.assign(ic,{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:oe}){const{t:_,locale:A}=so.useI18n(),ce=oe,I=e.ref(null),B=e.ref(null),ve=e.ref(null),ut=e.ref(0),Q=e.ref(0);let f=null,xe=null;const Ce=20,G=e.computed(()=>{if(Q.value,ut.value,!I.value||!B.value)return 0;try{const t=I.value.getBoundingClientRect();return B.value.getBoundingClientRect().top-t.top}catch{return 0}}),U=e.computed(()=>`chart-clip-${F.chartId}`),me=e.computed(()=>`url(#${U.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},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 Te(t,a){const l=Object.assign({},t);return mt(t)&&mt(a)&&Object.keys(a).forEach(i=>{mt(a[i])?i in t?l[i]=Te(t[i],a[i]):Object.assign(l,{[i]:a[i]}):Object.assign(l,{[i]:a[i]})}),l}const nt=()=>{let t=20,a=0,l=0;if(dt.value&&(t+=30),kt.value&&(t+=25),K.value&&F.series.length>0){const i=F.series.filter((p,g)=>!Ht.value.has(g)).length;if(ye.value==="top"||ye.value==="bottom"){if(Be.value==="horizontal"){const g=Math.floor(Ee.value/100);a=Math.ceil(i/g)*25+10}else a=i*25+10;t+=a}else l=150}return{height:t,legendHeight:a,legendWidth:l}};function mt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const W=e.computed(()=>Te(Se,F.options)),Ze=e.computed(()=>{const t=W.value;return t&&t.chart&&t.chart.width==="auto"}),qe=e.computed(()=>{const t=W.value;return t&&t.chart&&t.chart.height==="auto"}),Ee=e.computed(()=>{const t=W.value;return Ze.value?ut.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Me=e.ref(Ce),Ye=e.computed(()=>{if(qe.value){const t=Ye.value;return t??Math.max(0,(Q.value||400)-Me.value*5)}}),ee=e.computed(()=>{const t=W.value;if(be.value==="mini-radial")return Ee.value;if(qe.value){const a=Ye.value;return a??Math.max(0,(Q.value||400)-Me.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),ot=e.computed(()=>{if(qe.value&&be.value==="semi-radial"&&Ye.value!=null)return Me.value+ee.value+"px";if(qe.value)return"100%";if(xl.value)return Me.value+ee.value+"px";if(K.value&&ye.value==="bottom"){const t=nt();return ee.value+(t.legendHeight||35)+"px"}return ee.value+(K.value?20:0)+"px"}),be=e.computed(()=>{const t=W.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),tt=e.computed(()=>{const t=F.series.map(a=>a.type||be.value);return new Set(t).size>1}),dt=e.computed(()=>{const t=W.value;return t&&t.title&&t.title.text?t.title.text:""}),kt=e.computed(()=>{const t=W.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),wt=e.computed(()=>{const t=W.value;if(!t||!t.zAxis)return"";const a=t.zAxis;return typeof a=="string"?a:a&&typeof a.label=="string"?a.label:""}),Dt=e.computed(()=>{const t=W.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),Ft=e.computed(()=>{const t=W.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),se=e.computed(()=>{const t=W.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),pe=e.computed(()=>{const t=se.value;return t&&t.title&&t.title.text?t.title.text:""}),De=e.computed(()=>{const t=W.value;if(!t||!t.yAxis)return ol;const a=t.yAxis.min;return typeof a=="number"||a===ol?a:ol}),_e=e.computed(()=>{const t=W.value;if(!t||!t.yAxis)return ol;const a=t.yAxis.max;return typeof a=="number"||a===ol?a:ol}),jt=e.computed(()=>{const t=se.value;if(!t)return ol;const a=t.min;return typeof a=="number"||a===ol?a:ol}),Ct=e.computed(()=>{const t=se.value;if(!t)return ol;const a=t.max;return typeof a=="number"||a===ol?a:ol}),Gt=e.computed(()=>{const t=W.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),$t=e.computed(()=>{const t=W.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),Wt=e.computed(()=>{const t=W.value;return t&&t.grid&&t.grid.show!==!1}),K=e.computed(()=>{const t=W.value;return t&&t.legend&&t.legend.show!==!1}),ye=e.computed(()=>{const t=W.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Be=e.computed(()=>{const t=W.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Ue=e.computed(()=>{const t=W.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Je=e.computed(()=>{const t=W.value;if(!t||!t.crosshair)return!1;const a=t.crosshair.show;return a===!0||a==="true"}),Lt=e.computed(()=>{const t=W.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),lt=e.computed(()=>{const t=W.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Pt=e.computed(()=>{const t=W.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),We=e.computed(()=>{const t=W.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Re=e.computed(()=>{const t=W.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),bt=e.computed(()=>{if(!xl.value)return 0;const t=W.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),pt=e.computed(()=>{const t=W.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),J=e.computed(()=>{const{maxX:t}=Ut.value;return t===0}),Z=(t,a)=>J.value&&a===0?5:a,X=t=>{const a=Number(t);return!Number.isFinite(a)||a<=0?0:a},re=e.computed(()=>{const t=W.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),fe=e.computed(()=>{const t=W.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),et=e.computed(()=>{const t=W.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),St=e.computed(()=>{const t=W.value;return fe.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),il=e.computed(()=>{const t=W.value,a=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return a.length>0?a:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),xt=e.computed(()=>{const t=W.value;return t&&t.animations&&t.animations.enabled!==!1}),tl=e.computed(()=>{const t=W.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),S=e.computed(()=>{const t=W.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),C=e.computed(()=>{const t=W.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),V=e.computed(()=>{const t=W.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Y=e.computed(()=>{const t=W.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),le=e.computed(()=>{const t=W.value;return t&&t.animations&&t.animations.onDataChange!==!1}),ze=e.computed(()=>{const t=W.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),ft=e.computed(()=>{const t=W.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),st=e.computed(()=>W.value?.spider?.gridSteps||5),Oe=e.computed(()=>{const t=[],a=st.value;for(let l=1;l<=a;l++)t.push(it.value/a*l);return t}),Vt=t=>{const a=Et.value;if(a&&Array.isArray(a)&&a[t]!==void 0)return a[t].toString();const l=Oe.value[t];return Math.round(l/it.value*100)+"%"},Et=e.computed(()=>W.value?.spider?.gridLabels||null),vt=e.computed(()=>{const t=W.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),at=e.computed(()=>{const t=W.value,a={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...a,...t.contextMenu.items}:a}),Nt=e.computed(()=>{const t=W.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Bt=e.computed(()=>{const t=W.value;return t&&t.markers&&t.markers.icon?t.markers.icon:on.value}),yl=e.computed(()=>{const t=W.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Al=e.computed(()=>{const t=W.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),un=e.computed(()=>{const a=W.value?.valueFormat?.extension;return typeof a=="string"?a:""}),Kt=t=>{const a=un.value;if(t==null)return"";const l=String(t);return a?l+a:l},dl=e.computed(()=>!ae.value.isZooming);e.computed(()=>el.value.map(t=>{if(t.categoryIndex!==void 0&&(wl.value||Zt.value)){const a=al(t.categoryIndex),l=G.value+z.value.bottom-Al.value/2;return{...t,x:a,y:l}}return t}));function ln(t,a){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,b,w]=t.split("-"),O=Number(w?.length===2?`20${w}`:w);l=new Date(O,Number(b)-1,Number(g))}else return 0;let i=0,p=1/0;return a.forEach((g,b)=>{const[w,O,N]=g.split("-"),D=Number(N?.length===2?`20${N}`:N),M=new Date(D,Number(O)-1,Number(w)),te=Math.abs(M-l);te<p&&(p=te,i=b)}),i}const yn=e.computed(()=>{const t=F.markers.map(l=>{const i=ln(l.marker_date,F.categories),p=al(i),g=G.value+z.value.bottom-Al.value/2;return{...l,x:p,y:g,categoryIndex:i,source:"props"}}),a=el.value.map(l=>{if(l.categoryIndex!==void 0&&(wl.value||Zt.value)){const i=al(l.categoryIndex),p=G.value+z.value.bottom-Al.value/2;return{...l,x:i,y:p,source:"internal"}}return{...l,source:"internal"}});return[...t,...a]}),dn=e.computed(()=>{const t=W.value;return t&&t.watermark&&t.watermark.enabled===!0}),Bl=e.computed(()=>{const t=W.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),kn=e.computed(()=>{const t=W.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),Ml=e.computed(()=>{const t=W.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),mn=e.computed(()=>{const t={left:z.value.left,top:z.value.top,width:z.value.width,height:z.value.height};let a,l;const i=String(kn.value);if(i.includes("%")){const p=parseFloat(i)/100;a=t.width*p,l=a*(96/499)}else{const p=parseFloat(i)||25;a=Math.min(t.width*.25,200)*(p/25),l=a*(96/499)}return{width:a,height:l,area:t}}),nn=e.computed(()=>{const{width:t,height:a}=mn.value,l=Ml.value;let i,p;const g=z.value.left,b=z.value.right,w=z.value.top,O=z.value.bottom,N=z.value.width,D=z.value.height;switch(l){case"center":i=g+(N-t)/2,p=w+(D-a)/2;break;case"top-left":i=g+15,p=w+5;break;case"top-right":i=b-t-15,p=w+5;break;case"bottom-left":i=g+15,p=O-a-5;break;case"bottom-right":default:i=b-t-15,p=O-a-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${a}px`}}),Fl=t=>!F.flags||!F.flags.length?[]:F.flags.filter(a=>a.categoryIndex===t),kl=t=>{const a=Fl(t),l=wn(t),i=a.filter(b=>b.manual),p=a.filter(b=>!b.manual),g=[];return i.length>0&&g.push({type:_("chart.tooltip.manualFlags"),color:"#698dbe",flags:i.map(b=>({text:b.text,color:"#698dbe"}))}),p.length>0&&g.push({type:_("chart.tooltip.autoFlags"),color:"#a1d499",flags:p.map(b=>({text:b.text,color:"#a1d499"}))}),{flagGroups:g,markers:l.map(b=>({title:b.title,description:b.description,type:_("chart.tooltip.markers"),color:b.color||"#9784ba"}))}},on=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"/>
@@ -15,7 +15,7 @@
15
15
  <rect width="57" height="57" fill="white"/>
16
16
  </clipPath>
17
17
  </defs>
18
- </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),D=e.computed(()=>{const t=F.old?`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
18
+ </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),H=e.computed(()=>{const t=F.old?`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
19
19
  <path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
20
20
  <path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
21
21
  <path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
@@ -41,23 +41,23 @@
41
41
  <rect width="45" height="45" fill="white" transform="translate(0 1)"/>
42
42
  </clipPath>
43
43
  </defs>
44
- </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),O=e.computed(()=>{const t=W.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),_=e.computed(()=>{const t=W.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=W.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const ce=e.computed(()=>{const t=W.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),$e=e.computed(()=>{const t=W.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),dt=e.computed(()=>{const t=W.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Qe=e.computed(()=>{const a=W.value?.radialBar?.dataLabels;return a&&(a.show===!0||a.enabled===!0)}),ot=e.computed(()=>{const a=W.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof a=="number"&&a>=0?a:20}),Dt=e.computed(()=>{const a=W.value?.radialBar?.dataCenter;return On.value?!0:Pl.value&&a&&(a.show===!0||a.enabled===!0)}),nl=e.computed(()=>{if(!Dt.value||!nt.value.length)return"";if(On.value){const i=nt.value[1]??nt.value[0];return Wt(i?.value??0)}const l=W.value?.radialBar?.dataCenter?.showValueOnly===!0?nt.value[0]?.value??0:nt.value.reduce((i,p)=>i+(p.value??0),0);return Wt(l)}),Dl=e.computed(()=>{const a=W.value?.radialBar?.dataCenter?.fontSize;return typeof a=="number"&&a>0?a:24}),Nl=e.computed(()=>({x:Ft.value,y:On.value?wt.value:wt.value-Dl.value/2})),Ol=e.computed(()=>{const a=W.value?.radialBar?.dataCenter?.color;return typeof a=="string"&&a?a:"#333"}),$n=e.computed(()=>{if(!Qe.value||!Cl.value||!nt.value.length)return[];const t=ot.value*Math.PI/180,a=(Zt.value+it.value)/2;return nt.value.map(l=>{const p=l.endAngle-l.startAngle>=t&&!l.isHidden,g=Ft.value+Math.cos(l.midAngle)*a,b=wt.value+Math.sin(l.midAngle)*a;return{value:Wt(l.value),x:g,y:b,show:p,color:l.color,contrastColor:d(l.color)}})}),Jl=e.computed(()=>{if(!F.flags||!F.flags.length)return[];const t=new Map;return F.flags.forEach(a=>{const l=a.categoryIndex;t.has(l)||t.set(l,[]),t.get(l).push(a)}),Array.from(t.entries()).map(([a,l])=>{const i=Kt(a),p=l.filter(b=>b.manual),g=l.filter(b=>!b.manual);return{categoryIndex:parseInt(a),x:i,flags:l,manualCount:p.length,autoCount:g.length,totalCount:l.length,hasManual:p.length>0,hasAuto:g.length>0,texts:l.map(b=>b.text).join(`
45
- `)}})}),kl=e.ref({show:!1,x:0,y:0,content:"",count:0}),Qt=e.computed(()=>W.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),ol=e.computed(()=>{const t=W.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),rn=e.computed(()=>W.value?.bubbles?.tooltip?.formatters||{}),at=e.ref(new Set),de=e.ref(null),hn=e.ref(!1),kt=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),ml=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),st=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),vt=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),oe=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Yt=e.ref([]),Ae=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 hl.value&&t.push(...Object.keys(hl.value)),t}),e.computed(()=>{if(!F.categories||F.categories.length===0){const{maxX:t}=Ut.value;return Array.from({length:t+1},(a,l)=>M("chart.fallback.item",{number:l+1}))}return F.categories});const so=e.computed(()=>{if(!F.categories||F.categories.length===0)return null;const t=F.categories[0],[a,l,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),b=Number(l)-1;return!g||!l||!p?null:new Date(p,b,g)}),al=e.computed(()=>{if(!F.categories||F.categories.length===0)return null;const t=F.categories[F.categories.length-1],[a,l,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),b=Number(l)-1;return!g||!l||!p?null:new Date(p,b,g)}),Bl=e.computed(()=>Ae.value.editingMarkerId!==null),el=e.computed(()=>Ae.value.readonly),Il=t=>{at.value.has(t)||(Go.value=!0,de.value=t)},il=()=>{Go.value=!1,de.value=null},zl=t=>{if(Co.value||Ro.value){st.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),i=t.clientX-l.left,p=t.clientY-l.top,g=jt.value?i>=z.value.left-50&&i<=z.value.right+50&&p>=z.value.top-50&&p<=z.value.bottom+100:i>=z.value.left&&i<=z.value.right&&p>=z.value.top&&p<=z.value.bottom;if(hn.value=g,jt.value){if(!Ke.value||!g||oe.value.isDragging||oe.value.isZooming){st.value.show=!1;return}if(j.value.find(me=>!me||me.isHidden?!1:Math.sqrt(Math.pow(me.x-i,2)+Math.pow(me.y-p,2))<=me.radius+3))st.value.show=!1;else{const me=j.value.filter(ke=>!ke||ke.isHidden?!1:Math.sqrt(Math.pow(ke.x-i,2)+Math.pow(ke.y-p,2))<=250);if(me.length>0){let ke=me[0],Ne=Math.sqrt(Math.pow(ke.x-i,2)+Math.pow(ke.y-p,2));me.forEach(Pe=>{const Te=Math.sqrt(Math.pow(Pe.x-i,2)+Math.pow(Pe.y-p,2));Te<Ne&&(Ne=Te,ke=Pe)});const he=30,je=j.value.filter(Pe=>!Pe||Pe.isHidden?!1:Math.abs(Pe.x-ke.x)<=he).sort((Pe,Te)=>Pe.y-Te.y);st.value={show:!0,x:ke.x,categoryIndex:Math.round(ke.originalX),data:(()=>{const Pe=Qt.value,Te=ol.value,Le=[];return je.forEach(Re=>{Pe.forEach($t=>{const zt=Te[$t]||$t,jl=pn($t,Re);jl&&Le.push({seriesName:Re.seriesName,label:Re.label,value:`${zt}: ${jl}`,color:Re.color,y:Re.y})})}),Le})()}}else st.value.show=!1}return}if(oe.value.isDragging&&oe.value.scale>1&&Sl.value&&et.value){st.value.show=!1;const Xe=t.clientX-oe.value.lastMouseX,{minX:me,maxX:ke}=Ut.value,Ne=ke-me||1,je=Xe*.8;oe.value.offsetX+=je;const Pe=Ne/oe.value.scale,Te=Ne-Pe,Le=0,Re=-Te/Ne*z.value.width,$t=Le;oe.value.offsetX=Math.max(Re,Math.min($t,oe.value.offsetX)),oe.value.lastMouseX=t.clientX,oe.value.lastMouseY=t.clientY;return}if(!Ke.value||!Sl.value||oe.value.isDragging||oe.value.isZooming||!g){st.value.show=!1;return}const{minX:b,maxX:w}=Ut.value,P=w-b||1,N=P/oe.value.scale,T=b-oe.value.offsetX/z.value.width*P,B=(i-z.value.left)/z.value.width,te=T+B*N,Se=Math.round(te);if(Se>=0&&Se<=w){const Xe=Kt(Se),me=ln.value.map((ke,Ne)=>{const he=F.series.findIndex(Pe=>Pe===ke),je=ke.data[Se];return{seriesName:ke.name,value:je!==void 0?je:null,color:c(he),y:je!==void 0?xl(ke,je):null}}).filter(ke=>ke.value!==null);st.value={show:!0,x:Xe,categoryIndex:Se,data:me}}},In=()=>{st.value.show=!1,hn.value=!1,Ro.value=!1,Co.value||(kl.value.show=!1),oe.value.isDragging&&(oe.value.isDragging=!1),oe.value.zoomTimeout&&(clearTimeout(oe.value.zoomTimeout),oe.value.zoomTimeout=null),oe.value.isZooming=!1,setTimeout(()=>{de.value=null,kt.value.show=!1},150)},Ln=t=>{if(t.preventDefault(),t.stopPropagation(),!ht.value)return;const a=t.currentTarget.getBoundingClientRect(),l=t.clientX-a.left,i=t.clientY-a.top;if(Cl.value){vt.value.show=!1,e.nextTick(()=>{vt.value.show=!0,vt.value.x=t.clientX,vt.value.y=t.clientY,vt.value.categoryIndex=null});return}const p=Math.max(0,z.value.left-20),g=z.value.right,b=z.value.top,w=z.value.bottom+80;l>=p&&l<=g&&i>=b&&i<=w&&(vt.value.show=!1,e.nextTick(()=>{vt.value.show=!0,vt.value.x=t.clientX,vt.value.y=t.clientY,vt.value.categoryIndex=null;const P=Math.max(z.value.left,Math.min(l,z.value.right))-z.value.left,T=z.value.width/o.value.length,B=Math.floor(P/T);B>=0&&B<o.value.length&&(vt.value.categoryIndex=B)}))},Wl=t=>{if(!(t&&t.button===2)){if(vt.value.show&&t&&t.type==="click"){const a=document.querySelector(".dss-context-menu");if(a&&a.contains(t.target))return}vt.value.show=!1}},pl=t=>{if(typeof t.template=="function"){const a={series:F.series,categories:F.categories,markers:Yt.value},l={chartX:vt.value.chartX,chartY:vt.value.chartY,dataX:vt.value.mouseDataX,dataY:vt.value.mouseDataY,categoryIndex:vt.value.categoryIndex};return t.template(a,l)}return t.template||t.label||""},Xn=t=>{const a=["dss-context-menu-item"];return t.cssClass&&a.push(t.cssClass),a},Yn=t=>t.style||{},cn=t=>t.type&&hl.value[t.type]?hl.value[t.type]:t.customIcon?t.customIcon:_t.value,zn=t=>t==null?"":F.categories&&F.categories[t]?F.categories[t]:"",yn=t=>Yt.value.length?Yt.value.filter(a=>a.categoryIndex===t):[],Ml=t=>{if(!Sl.value&&!jt.value)return{x:0,y:0};const a=Kt(t),l=G.value+z.value.bottom-Al.value/2;return{x:a,y:l}},Pn=()=>{Yt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(Sl.value||jt.value)){const a=Ml(t.categoryIndex);t.x=a.x,t.y=a.y}})},kn=()=>{if(Ae.value.description&&Ae.value.description.length&&Ae.value.date){if(Bl.value){const t=Yt.value.findIndex(a=>a.id===Ae.value.editingMarkerId);t!==-1?(Yt.value[t].description=Ae.value.description||"",Yt.value[t].color=Ae.value.color||"",Yt.value[t].type=Ae.value.type||"default",ue("update-marker",Yt.value[t])):ue("update-marker",{id:Ae.value.editingMarkerId,description:Ae.value.description||"",color:Ae.value.color||"",type:Ae.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let a=vn(Ae.value.date,F.categories||[]);if(jt.value){const{maxX:b}=Ut.value;a=Math.max(0,Math.min(a,Math.floor(b)))}else Sl.value&&(a=Math.max(0,Math.min(a,Ut.value.maxX)));const l=Kt(a),i=G.value+z.value.bottom-Al.value/2,p=Array.isArray(F.categories)?F.categories[a]:null,g={id:t,title:"",description:Ae.value.description||"",color:Ae.value.color||"",type:Ae.value.type||"default",categoryIndex:a,x:l,y:i,marker_date:p||null};Ae.value.categoryIndex=a,Yt.value.push(g),ue("add-marker",g)}At(),h()}},At=()=>{Ae.value.show=!1,Ae.value.title="",Ae.value.description="",Ae.value.color="#FF6B6B",Ae.value.type="default",Ae.value.editingMarkerId=null,Ae.value.readonly=!1,Ae.value.categoryIndex=null,Ae.value.fromButton=!1,Ae.value.date=null},Zl=()=>{Bl.value&&(un(Ae.value.editingMarkerId),At())},un=t=>{const a=Yt.value.findIndex(l=>l.id===t);a!==-1&&(Yt.value.splice(a,1),h()),ue("delete-marker",t)},y=t=>{if(Ae.value.show=!0,Ae.value.title=t?.title??t?.comment??"",Ae.value.description=t?.description??t?.comment??"",Ae.value.color=t?.color??"",Ae.value.type=t?.type??"default",Ae.value.editingMarkerId=t?.id??t?.marker_id??null,Ae.value.readonly=t?.readonly??!1,Ae.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[a,l,i]=String(t.marker_date).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),b=Number(l)-1;g&&l&&p?Ae.value.date=new Date(p,b,g):Ae.value.date=null}else Ae.value.date=null},h=()=>{try{const t=`dss-chart-markers-${F.chartId}`;localStorage.setItem(t,JSON.stringify(Yt.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 l=JSON.parse(a);Array.isArray(l)&&(Yt.value=l.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Yt.value=[]}},q=t=>{const a=ut.value||"Chart",l=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"}-${l}.${t}`},ie=()=>{const t=st.value.show,a=kt.value.show;return st.value.show=!1,kt.value.show=!1,{originalCrosshair:t,originalTooltip:a}},mt=t=>{st.value.show=t.originalCrosshair,kt.value.show=t.originalTooltip},Rt=async(t,a=32,l=32)=>new Promise((i,p)=>{if(t.startsWith("data:")){i(t);return}const g=new Image;g.crossOrigin="anonymous";const b=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(b);try{const w=document.createElement("canvas"),P=w.getContext("2d");w.width=a,w.height=l,P.fillStyle="#fafafa",P.fillRect(0,0,a,l),P.drawImage(g,0,0,a,l);const N=w.toDataURL("image/png");i(N)}catch(w){console.warn("Canvas conversion failed:",w),i(t)}},g.onerror=w=>{clearTimeout(b),console.warn("Failed to load image:",t,w),i(t)},g.src=t}),_l=async()=>{try{const t=ie();setTimeout(async()=>{try{const a=$.value;if(!a){console.error("Chart SVG element not found"),mt(t);return}const l=tt(),i=xe.value,p=ee.value+l.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(he=>he.remove());const w=g.querySelectorAll("image"),P=Array.from(w).map(async he=>{const je=he.getAttribute("xlink:href")||he.getAttribute("href");if(je&&!je.startsWith("data:"))try{const Pe=await Rt(je,32,32);he.setAttribute("xlink:href",Pe),he.setAttribute("href",Pe)}catch(Pe){console.warn("Failed to convert logo to base64:",Pe)}});await Promise.all(P);const T=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let B="",te=30;if(ut.value&&(B+=`
44
+ </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),P=e.computed(()=>{const t=W.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),$=e.computed(()=>{const t=W.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=W.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const ie=e.computed(()=>{const t=W.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),Le=e.computed(()=>{const t=W.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),ct=e.computed(()=>{const t=W.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),rt=e.computed(()=>{const a=W.value?.radialBar?.dataLabels;return a&&(a.show===!0||a.enabled===!0)}),je=e.computed(()=>{const a=W.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof a=="number"&&a>=0?a:20}),At=e.computed(()=>{const a=W.value?.radialBar?.dataCenter;return Un.value?!0:En.value&&a&&(a.show===!0||a.enabled===!0)}),ml=e.computed(()=>{if(!At.value||!we.value.length)return"";if(Un.value){const i=we.value[1]??we.value[0];return Kt(i?.value??0)}const l=W.value?.radialBar?.dataCenter?.showValueOnly===!0?we.value[0]?.value??0:we.value.reduce((i,p)=>i+(p.value??0),0);return Kt(l)}),El=e.computed(()=>{const a=W.value?.radialBar?.dataCenter?.fontSize;return typeof a=="number"&&a>0?a:24}),Il=e.computed(()=>({x:It.value,y:Un.value?Tt.value:Tt.value-El.value/2})),_l=e.computed(()=>{const a=W.value?.radialBar?.dataCenter?.color;return typeof a=="string"&&a?a:"#333"}),Dn=e.computed(()=>{if(!rt.value||!xl.value||!we.value.length)return[];const t=je.value*Math.PI/180,a=(qt.value+it.value)/2;return we.value.map(l=>{const p=l.endAngle-l.startAngle>=t&&!l.isHidden,g=It.value+Math.cos(l.midAngle)*a,b=Tt.value+Math.sin(l.midAngle)*a;return{value:Kt(l.value),x:g,y:b,show:p,color:l.color,contrastColor:c(l.color)}})}),Cn=e.computed(()=>{if(!F.flags||!F.flags.length)return[];const t=new Map;return F.flags.forEach(a=>{const l=a.categoryIndex;t.has(l)||t.set(l,[]),t.get(l).push(a)}),Array.from(t.entries()).map(([a,l])=>{const i=al(a),p=l.filter(b=>b.manual),g=l.filter(b=>!b.manual);return{categoryIndex:parseInt(a),x:i,flags:l,manualCount:p.length,autoCount:g.length,totalCount:l.length,hasManual:p.length>0,hasAuto:g.length>0,texts:l.map(b=>b.text).join(`
45
+ `)}})}),cl=e.ref({show:!1,x:0,y:0,content:"",count:0}),Tl=e.computed(()=>W.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),Jt=e.computed(()=>{const t=W.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),$l=e.computed(()=>W.value?.bubbles?.tooltip?.formatters||{}),Ht=e.ref(new Set),he=e.ref(null),Mt=e.ref(!1),gt=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),Dl=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Ke=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}),el=e.ref([]),Fe=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 yl.value&&t.push(...Object.keys(yl.value)),t}),e.computed(()=>{if(!F.categories||F.categories.length===0){const{maxX:t}=Ut.value;return Array.from({length:t+1},(a,l)=>_("chart.fallback.item",{number:l+1}))}return F.categories});const an=e.computed(()=>{if(!F.categories||F.categories.length===0)return null;const t=F.categories[0],[a,l,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),b=Number(l)-1;return!g||!l||!p?null:new Date(p,b,g)}),ll=e.computed(()=>{if(!F.categories||F.categories.length===0)return null;const t=F.categories[F.categories.length-1],[a,l,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),b=Number(l)-1;return!g||!l||!p?null:new Date(p,b,g)}),bn=e.computed(()=>Fe.value.editingMarkerId!==null),Sl=e.computed(()=>Fe.value.readonly),Xt=t=>{Ht.value.has(t)||(Jo.value=!0,he.value=t)},Hn=()=>{Jo.value=!1,he.value=null},nl=t=>{if(Co.value||Ro.value){Ke.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),i=t.clientX-l.left,p=t.clientY-l.top,g=Zt.value?i>=z.value.left-50&&i<=z.value.right+50&&p>=z.value.top-50&&p<=z.value.bottom+100:i>=z.value.left&&i<=z.value.right&&p>=z.value.top&&p<=z.value.bottom;if(Mt.value=g,Zt.value){if(!Je.value||!g||ae.value.isDragging||ae.value.isZooming){Ke.value.show=!1;return}if(ne.value.find(ue=>!ue||ue.isHidden?!1:Math.sqrt(Math.pow(ue.x-i,2)+Math.pow(ue.y-p,2))<=ue.radius+3))Ke.value.show=!1;else{const ue=ne.value.filter(ke=>!ke||ke.isHidden?!1:Math.sqrt(Math.pow(ke.x-i,2)+Math.pow(ke.y-p,2))<=250);if(ue.length>0){let ke=ue[0],Ne=Math.sqrt(Math.pow(ke.x-i,2)+Math.pow(ke.y-p,2));ue.forEach(Pe=>{const Ae=Math.sqrt(Math.pow(Pe.x-i,2)+Math.pow(Pe.y-p,2));Ae<Ne&&(Ne=Ae,ke=Pe)});const ge=30,Qe=ne.value.filter(Pe=>!Pe||Pe.isHidden?!1:Math.abs(Pe.x-ke.x)<=ge).sort((Pe,Ae)=>Pe.y-Ae.y);Ke.value={show:!0,x:ke.x,categoryIndex:Math.round(ke.originalX),data:(()=>{const Pe=Tl.value,Ae=Jt.value,$e=[];return Qe.forEach(He=>{Pe.forEach(_t=>{const zt=Ae[_t]||_t,en=Ql(_t,He);en&&$e.push({seriesName:He.seriesName,label:He.label,value:`${zt}: ${en}`,color:He.color,y:He.y})})}),$e})()}}else Ke.value.show=!1}return}if(ae.value.isDragging&&ae.value.scale>1&&wl.value&&lt.value){Ke.value.show=!1;const Xe=t.clientX-ae.value.lastMouseX,{minX:ue,maxX:ke}=Ut.value,Ne=ke-ue||1,Qe=Xe*.8;ae.value.offsetX+=Qe;const Pe=Ne/ae.value.scale,Ae=Ne-Pe,$e=0,He=-Ae/Ne*z.value.width,_t=$e;ae.value.offsetX=Math.max(He,Math.min(_t,ae.value.offsetX)),ae.value.lastMouseX=t.clientX,ae.value.lastMouseY=t.clientY;return}if(!Je.value||!wl.value||ae.value.isDragging||ae.value.isZooming||!g){Ke.value.show=!1;return}const{minX:b,maxX:w}=Ut.value,O=w-b||1,N=O/ae.value.scale,D=b-ae.value.offsetX/z.value.width*O,M=(i-z.value.left)/z.value.width,te=D+M*N,Ve=Math.round(te);if(Ve>=0&&Ve<=w){const Xe=al(Ve),ue=jl.value.map((ke,Ne)=>{const ge=F.series.findIndex(Pe=>Pe===ke),Qe=ke.data[Ve];return{seriesName:ke.name,value:Qe!==void 0?Qe:null,color:r(ge),y:Qe!==void 0?Gl(ke,Qe):null}}).filter(ke=>ke.value!==null);Ke.value={show:!0,x:Xe,categoryIndex:Ve,data:ue}}},zl=()=>{Ke.value.show=!1,Mt.value=!1,Ro.value=!1,Co.value||(cl.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)},Wn=t=>{if(t.preventDefault(),t.stopPropagation(),!vt.value)return;const a=t.currentTarget.getBoundingClientRect(),l=t.clientX-a.left,i=t.clientY-a.top;if(xl.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,z.value.left-20),g=z.value.right,b=z.value.top,w=z.value.bottom+80;l>=p&&l<=g&&i>=b&&i<=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(z.value.left,Math.min(l,z.value.right))-z.value.left,D=z.value.width/lo.value.length,M=Math.floor(O/D);M>=0&&M<lo.value.length&&(ht.value.categoryIndex=M)}))},ql=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}},Mn=t=>{if(typeof t.template=="function"){const a={series:F.series,categories:F.categories,markers:el.value},l={chartX:ht.value.chartX,chartY:ht.value.chartY,dataX:ht.value.mouseDataX,dataY:ht.value.mouseDataY,categoryIndex:ht.value.categoryIndex};return t.template(a,l)}return t.template||t.label||""},Vl=t=>{const a=["dss-context-menu-item"];return t.cssClass&&a.push(t.cssClass),a},Yn=t=>t.style||{},pn=t=>t.type&&yl.value[t.type]?yl.value[t.type]:t.customIcon?t.customIcon:Bt.value,Zn=t=>t==null?"":F.categories&&F.categories[t]?F.categories[t]:"",wn=t=>el.value.length?el.value.filter(a=>a.categoryIndex===t):[],jn=t=>{if(!wl.value&&!Zt.value)return{x:0,y:0};const a=al(t),l=G.value+z.value.bottom-Al.value/2;return{x:a,y:l}},Nl=()=>{el.value.forEach(t=>{if(t.categoryIndex!==void 0&&(wl.value||Zt.value)){const a=jn(t.categoryIndex);t.x=a.x,t.y=a.y}})},fn=()=>{if(Fe.value.description&&Fe.value.description.length&&Fe.value.date){if(bn.value){const t=el.value.findIndex(a=>a.id===Fe.value.editingMarkerId);t!==-1?(el.value[t].description=Fe.value.description||"",el.value[t].color=Fe.value.color||"",el.value[t].type=Fe.value.type||"default",ce("update-marker",el.value[t])):ce("update-marker",{id:Fe.value.editingMarkerId,description:Fe.value.description||"",color:Fe.value.color||"",type:Fe.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let a=ln(Fe.value.date,F.categories||[]);if(Zt.value){const{maxX:b}=Ut.value;a=Math.max(0,Math.min(a,Math.floor(b)))}else wl.value&&(a=Math.max(0,Math.min(a,Ut.value.maxX)));const l=al(a),i=G.value+z.value.bottom-Al.value/2,p=Array.isArray(F.categories)?F.categories[a]:null,g={id:t,title:"",description:Fe.value.description||"",color:Fe.value.color||"",type:Fe.value.type||"default",categoryIndex:a,x:l,y:i,marker_date:p||null};Fe.value.categoryIndex=a,el.value.push(g),ce("add-marker",g)}bl(),h()}},bl=()=>{Fe.value.show=!1,Fe.value.title="",Fe.value.description="",Fe.value.color="#FF6B6B",Fe.value.type="default",Fe.value.editingMarkerId=null,Fe.value.readonly=!1,Fe.value.categoryIndex=null,Fe.value.fromButton=!1,Fe.value.date=null},pl=()=>{bn.value&&(Wl(Fe.value.editingMarkerId),bl())},Wl=t=>{const a=el.value.findIndex(l=>l.id===t);a!==-1&&(el.value.splice(a,1),h()),ce("delete-marker",t)},y=t=>{if(Fe.value.show=!0,Fe.value.title=t?.title??t?.comment??"",Fe.value.description=t?.description??t?.comment??"",Fe.value.color=t?.color??"",Fe.value.type=t?.type??"default",Fe.value.editingMarkerId=t?.id??t?.marker_id??null,Fe.value.readonly=t?.readonly??!1,Fe.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[a,l,i]=String(t.marker_date).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),b=Number(l)-1;g&&l&&p?Fe.value.date=new Date(p,b,g):Fe.value.date=null}else Fe.value.date=null},h=()=>{try{const t=`dss-chart-markers-${F.chartId}`;localStorage.setItem(t,JSON.stringify(el.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 l=JSON.parse(a);Array.isArray(l)&&(el.value=l.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),el.value=[]}},q=t=>{const a=dt.value||"Chart",l=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"}-${l}.${t}`},de=()=>{const t=Ke.value.show,a=gt.value.show;return Ke.value.show=!1,gt.value.show=!1,{originalCrosshair:t,originalTooltip:a}},Ge=t=>{Ke.value.show=t.originalCrosshair,gt.value.show=t.originalTooltip},Ot=async(t,a=32,l=32)=>new Promise((i,p)=>{if(t.startsWith("data:")){i(t);return}const g=new Image;g.crossOrigin="anonymous";const b=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(b);try{const w=document.createElement("canvas"),O=w.getContext("2d");w.width=a,w.height=l,O.fillStyle="#fafafa",O.fillRect(0,0,a,l),O.drawImage(g,0,0,a,l);const N=w.toDataURL("image/png");i(N)}catch(w){console.warn("Canvas conversion failed:",w),i(t)}},g.onerror=w=>{clearTimeout(b),console.warn("Failed to load image:",t,w),i(t)},g.src=t}),fl=async()=>{try{const t=de();setTimeout(async()=>{try{const a=B.value;if(!a){console.error("Chart SVG element not found"),Ge(t);return}const l=nt(),i=Ee.value,p=ee.value+l.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(ge=>ge.remove());const w=g.querySelectorAll("image"),O=Array.from(w).map(async ge=>{const Qe=ge.getAttribute("xlink:href")||ge.getAttribute("href");if(Qe&&!Qe.startsWith("data:"))try{const Pe=await Ot(Qe,32,32);ge.setAttribute("xlink:href",Pe),ge.setAttribute("href",Pe)}catch(Pe){console.warn("Failed to convert logo to base64:",Pe)}});await Promise.all(O);const D=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let M="",te=30;if(dt.value&&(M+=`
46
46
  <text x="24" y="${te}"
47
47
  font-family="Arial, sans-serif"
48
48
  font-size="18"
49
49
  font-weight="bold"
50
50
  fill="#333">
51
- ${ut.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
52
- </text>`,te+=30),Ct.value&&(B+=`
51
+ ${dt.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
52
+ </text>`,te+=30),kt.value&&(M+=`
53
53
  <text x="24" y="${te}"
54
54
  font-family="Arial, sans-serif"
55
55
  font-size="14"
56
56
  fill="#666">
57
- ${Ct.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
58
- </text>`,te+=25),K.value&&F.series.length>0){let he=i-200,je=ut.value||Ct.value?35:25;const Pe=Math.floor((i-250)/120);let Te=0;F.series.forEach((Le,Re)=>{if(!at.value.has(Re)){const $t=c(Re),zt=Le.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");B+=`<circle cx="${he+6}" cy="${je-4}" r="6" fill="${$t}"/>`,B+=`<text x="${he+18}" y="${je}" font-family="Arial, sans-serif" font-size="12" fill="#333">${zt}</text>`,Te++,Te%Pe===0?(he=i-200,je+=20):he+=Math.min(120,zt.length*8+35)}})}let Se="";if(an.value)try{const{width:he,height:je}=sn.value,Pe=xn.value,Te=z.value.left,Le=z.value.right,Re=z.value.top,$t=z.value.bottom,zt=z.value.width,jl=z.value.height;let gl,Kl;switch(Pe){case"center":gl=Te+(zt-he)/2,Kl=Re+(jl-je)/2;break;case"top-left":gl=Te+15,Kl=Re+5;break;case"top-right":gl=Le-he-5,Kl=Re+5;break;case"bottom-left":gl=Te+15,Kl=$t-je-5;break;case"bottom-right":default:gl=Le-he-5,Kl=$t-je-5;break}Se=`
59
- <g opacity="${Tl.value}">
60
- <g transform="translate(${gl}, ${Kl}) scale(${he/499})">
57
+ ${kt.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
58
+ </text>`,te+=25),K.value&&F.series.length>0){let ge=i-200,Qe=dt.value||kt.value?35:25;const Pe=Math.floor((i-250)/120);let Ae=0;F.series.forEach(($e,He)=>{if(!Ht.value.has(He)){const _t=r(He),zt=$e.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");M+=`<circle cx="${ge+6}" cy="${Qe-4}" r="6" fill="${_t}"/>`,M+=`<text x="${ge+18}" y="${Qe}" font-family="Arial, sans-serif" font-size="12" fill="#333">${zt}</text>`,Ae++,Ae%Pe===0?(ge=i-200,Qe+=20):ge+=Math.min(120,zt.length*8+35)}})}let Ve="";if(dn.value)try{const{width:ge,height:Qe}=mn.value,Pe=Ml.value,Ae=z.value.left,$e=z.value.right,He=z.value.top,_t=z.value.bottom,zt=z.value.width,en=z.value.height;let hl,tn;switch(Pe){case"center":hl=Ae+(zt-ge)/2,tn=He+(en-Qe)/2;break;case"top-left":hl=Ae+15,tn=He+5;break;case"top-right":hl=$e-ge-5,tn=He+5;break;case"bottom-left":hl=Ae+15,tn=_t-Qe-5;break;case"bottom-right":default:hl=$e-ge-5,tn=_t-Qe-5;break}Ve=`
59
+ <g opacity="${Bl.value}">
60
+ <g transform="translate(${hl}, ${tn}) scale(${ge/499})">
61
61
  <path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
62
62
  <path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
63
63
  <path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
@@ -72,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(he){console.warn("Watermark processing failed, skipping watermark in SVG:",he),Se=""}const Xe=`<?xml version="1.0" encoding="UTF-8"?>
75
+ </g>`}catch(ge){console.warn("Watermark processing failed, skipping watermark in SVG:",ge),Ve=""}const Xe=`<?xml version="1.0" encoding="UTF-8"?>
76
76
  <svg width="${i}" height="${p}"
77
77
  xmlns="http://www.w3.org/2000/svg"
78
78
  xmlns:xlink="http://www.w3.org/1999/xlink">
@@ -84,26 +84,26 @@
84
84
  </style>
85
85
  </defs>
86
86
  <rect width="100%" height="100%" fill="#fafafa"/>
87
- ${B}
87
+ ${M}
88
88
  <g transform="translate(0, ${l.height})">
89
- ${T}
90
- ${Se}
89
+ ${D}
90
+ ${Ve}
91
91
  </g>
92
- </svg>`,me=new Blob([Xe],{type:"image/svg+xml;charset=utf-8"}),ke=URL.createObjectURL(me),Ne=document.createElement("a");Ne.href=ke,Ne.download=q("svg"),document.body.appendChild(Ne),Ne.click(),document.body.removeChild(Ne),URL.revokeObjectURL(ke),mt(t),Wl()}catch(a){console.error("Error downloading SVG:",a),mt(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},Hl=async()=>{try{const t=ie();I.value&&I.value.offsetHeight,await new Promise(he=>setTimeout(he,300));const a=tt(),l=xe.value,i=ee.value+a.height,p=document.createElement("canvas"),g=p.getContext("2d"),b=2;p.width=l*b,p.height=i*b,p.style.width=l+"px",p.style.height=i+"px",g.scale(b,b),g.fillStyle="#fafafa",g.fillRect(0,0,l,i);let w=30;if(ut.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(ut.value,24,w),w+=30),Ct.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(Ct.value,24,w),w+=25),K.value&&F.series.length>0){let he=l-200,je=ut.value||Ct.value?35:25;const Pe=Math.floor((l-250)/120);let Te=0;g.font="12px Arial, sans-serif",F.series.forEach((Le,Re)=>{if(!at.value.has(Re)){const $t=c(Re);g.beginPath(),g.arc(he+6,je-4,6,0,2*Math.PI),g.fillStyle=$t,g.fill(),g.fillStyle="#333",g.fillText(Le.name,he+18,je),Te++,Te%Pe===0?(he=l-200,je+=20):he+=Math.min(120,Le.name.length*8+35)}})}const N=$.value.cloneNode(!0),T=N.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),B=N.querySelectorAll(".dss-crosshair"),te=N.querySelectorAll('[class*="tooltip"]');T.forEach(he=>he.remove()),B.forEach(he=>he.remove()),te.forEach(he=>he.remove()),N.querySelectorAll("image").forEach((he,je)=>{const Pe=he.getAttribute("xlink:href")||he.getAttribute("href");if(Pe&&!Pe.startsWith("data:")){const Te=Ho.value[je],Le=Te?c(Te.seriesIndex):"#3B82F6",Re=he.getAttribute("x")||0,$t=he.getAttribute("y")||0,zt=he.getAttribute("width")||32,jl=he.getAttribute("height")||32,gl=document.createElementNS("http://www.w3.org/2000/svg","circle");gl.setAttribute("cx",parseFloat(Re)+parseFloat(zt)/2),gl.setAttribute("cy",parseFloat($t)+parseFloat(jl)/2),gl.setAttribute("r",Math.min(parseFloat(zt),parseFloat(jl))/2-1),gl.setAttribute("fill",Le),gl.setAttribute("stroke","#fafafa"),gl.setAttribute("stroke-width","2"),he.parentNode.replaceChild(gl,he)}});const Xe=new XMLSerializer().serializeToString(N),me=new Blob([Xe],{type:"image/svg+xml;charset=utf-8"}),ke=URL.createObjectURL(me),Ne=new Image;return new Promise((he,je)=>{Ne.onload=async()=>{try{if(g.drawImage(Ne,0,a.height),Ho.value.forEach(Pe=>{const Te=Pe.x,Le=Pe.y+a.height,Re=(Pe.width||32)/2,$t=c(Pe.seriesIndex);g.save(),g.beginPath(),g.arc(Te,Le,Re-1,0,2*Math.PI),g.fillStyle=$t,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),an.value){const Pe=new Image,Te=()=>{const{width:Re,height:$t}=sn.value,zt=xn.value,jl=z.value.left,gl=z.value.right,Kl=z.value.top,Io=z.value.bottom,Ea=z.value.width,Sa=z.value.height;let eo,to;switch(zt){case"center":eo=jl+(Ea-Re)/2,to=Kl+a.height+(Sa-$t)/2;break;case"top-left":eo=jl+15,to=Kl+a.height+10;break;case"top-right":eo=gl-Re-5,to=Kl+a.height+10;break;case"bottom-left":eo=jl+15,to=Io+a.height-$t-5;break;case"bottom-right":default:eo=gl-Re-5,to=Io+a.height-$t-5;break}g.globalAlpha=Tl.value,g.drawImage(Pe,eo,to,Re,$t),g.globalAlpha=1,Le()},Le=()=>{p.toBlob(Re=>{const $t=URL.createObjectURL(Re),zt=document.createElement("a");zt.href=$t,zt.download=q("png"),document.body.appendChild(zt),zt.click(),document.body.removeChild(zt),URL.revokeObjectURL($t),URL.revokeObjectURL(ke),mt(t),Wl(),he()},"image/png")};Pe.onload=Te,Pe.onerror=Le,Pe.src=D.value}else p.toBlob(Pe=>{const Te=URL.createObjectURL(Pe),Le=document.createElement("a");Le.href=Te,Le.download=q("png"),document.body.appendChild(Le),Le.click(),document.body.removeChild(Le),URL.revokeObjectURL(Te),URL.revokeObjectURL(ke),mt(t),Wl(),he()},"image/png")}catch(Pe){URL.revokeObjectURL(ke),mt(t),je(Pe)}},Ne.onerror=()=>{URL.revokeObjectURL(ke),mt(t),je(new Error("Failed to load SVG image"))},Ne.src=ke})}catch(t){console.error("Error downloading PNG:",t)}},ql=()=>{try{let t="";ut.value&&(t+=`# ${M("chart.csv.chartTitle")}: ${ut.value}
93
- `),Ct.value&&(t+=`# ${M("chart.csv.chartSubtitle")}: ${Ct.value}
94
- `),t+=`# ${M("chart.csv.generated")}: ${new Date().toLocaleString()}
92
+ </svg>`,ue=new Blob([Xe],{type:"image/svg+xml;charset=utf-8"}),ke=URL.createObjectURL(ue),Ne=document.createElement("a");Ne.href=ke,Ne.download=q("svg"),document.body.appendChild(Ne),Ne.click(),document.body.removeChild(Ne),URL.revokeObjectURL(ke),Ge(t),ql()}catch(a){console.error("Error downloading SVG:",a),Ge(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},Hl=async()=>{try{const t=de();I.value&&I.value.offsetHeight,await new Promise(ge=>setTimeout(ge,300));const a=nt(),l=Ee.value,i=ee.value+a.height,p=document.createElement("canvas"),g=p.getContext("2d"),b=2;p.width=l*b,p.height=i*b,p.style.width=l+"px",p.style.height=i+"px",g.scale(b,b),g.fillStyle="#fafafa",g.fillRect(0,0,l,i);let w=30;if(dt.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(dt.value,24,w),w+=30),kt.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(kt.value,24,w),w+=25),K.value&&F.series.length>0){let ge=l-200,Qe=dt.value||kt.value?35:25;const Pe=Math.floor((l-250)/120);let Ae=0;g.font="12px Arial, sans-serif",F.series.forEach(($e,He)=>{if(!Ht.value.has(He)){const _t=r(He);g.beginPath(),g.arc(ge+6,Qe-4,6,0,2*Math.PI),g.fillStyle=_t,g.fill(),g.fillStyle="#333",g.fillText($e.name,ge+18,Qe),Ae++,Ae%Pe===0?(ge=l-200,Qe+=20):ge+=Math.min(120,$e.name.length*8+35)}})}const N=B.value.cloneNode(!0),D=N.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),M=N.querySelectorAll(".dss-crosshair"),te=N.querySelectorAll('[class*="tooltip"]');D.forEach(ge=>ge.remove()),M.forEach(ge=>ge.remove()),te.forEach(ge=>ge.remove()),N.querySelectorAll("image").forEach((ge,Qe)=>{const Pe=ge.getAttribute("xlink:href")||ge.getAttribute("href");if(Pe&&!Pe.startsWith("data:")){const Ae=ko.value[Qe],$e=Ae?r(Ae.seriesIndex):"#3B82F6",He=ge.getAttribute("x")||0,_t=ge.getAttribute("y")||0,zt=ge.getAttribute("width")||32,en=ge.getAttribute("height")||32,hl=document.createElementNS("http://www.w3.org/2000/svg","circle");hl.setAttribute("cx",parseFloat(He)+parseFloat(zt)/2),hl.setAttribute("cy",parseFloat(_t)+parseFloat(en)/2),hl.setAttribute("r",Math.min(parseFloat(zt),parseFloat(en))/2-1),hl.setAttribute("fill",$e),hl.setAttribute("stroke","#fafafa"),hl.setAttribute("stroke-width","2"),ge.parentNode.replaceChild(hl,ge)}});const Xe=new XMLSerializer().serializeToString(N),ue=new Blob([Xe],{type:"image/svg+xml;charset=utf-8"}),ke=URL.createObjectURL(ue),Ne=new Image;return new Promise((ge,Qe)=>{Ne.onload=async()=>{try{if(g.drawImage(Ne,0,a.height),ko.value.forEach(Pe=>{const Ae=Pe.x,$e=Pe.y+a.height,He=(Pe.width||32)/2,_t=r(Pe.seriesIndex);g.save(),g.beginPath(),g.arc(Ae,$e,He-1,0,2*Math.PI),g.fillStyle=_t,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),dn.value){const Pe=new Image,Ae=()=>{const{width:He,height:_t}=mn.value,zt=Ml.value,en=z.value.left,hl=z.value.right,tn=z.value.top,Io=z.value.bottom,Ea=z.value.width,Sa=z.value.height;let oo,ao;switch(zt){case"center":oo=en+(Ea-He)/2,ao=tn+a.height+(Sa-_t)/2;break;case"top-left":oo=en+15,ao=tn+a.height+10;break;case"top-right":oo=hl-He-5,ao=tn+a.height+10;break;case"bottom-left":oo=en+15,ao=Io+a.height-_t-5;break;case"bottom-right":default:oo=hl-He-5,ao=Io+a.height-_t-5;break}g.globalAlpha=Bl.value,g.drawImage(Pe,oo,ao,He,_t),g.globalAlpha=1,$e()},$e=()=>{p.toBlob(He=>{const _t=URL.createObjectURL(He),zt=document.createElement("a");zt.href=_t,zt.download=q("png"),document.body.appendChild(zt),zt.click(),document.body.removeChild(zt),URL.revokeObjectURL(_t),URL.revokeObjectURL(ke),Ge(t),ql(),ge()},"image/png")};Pe.onload=Ae,Pe.onerror=$e,Pe.src=H.value}else p.toBlob(Pe=>{const Ae=URL.createObjectURL(Pe),$e=document.createElement("a");$e.href=Ae,$e.download=q("png"),document.body.appendChild($e),$e.click(),document.body.removeChild($e),URL.revokeObjectURL(Ae),URL.revokeObjectURL(ke),Ge(t),ql(),ge()},"image/png")}catch(Pe){URL.revokeObjectURL(ke),Ge(t),Qe(Pe)}},Ne.onerror=()=>{URL.revokeObjectURL(ke),Ge(t),Qe(new Error("Failed to load SVG image"))},Ne.src=ke})}catch(t){console.error("Error downloading PNG:",t)}},Pl=()=>{try{let t="";dt.value&&(t+=`# ${_("chart.csv.chartTitle")}: ${dt.value}
93
+ `),kt.value&&(t+=`# ${_("chart.csv.chartSubtitle")}: ${kt.value}
94
+ `),t+=`# ${_("chart.csv.generated")}: ${new Date().toLocaleString()}
95
95
 
96
96
  `,t+="Category",F.series.forEach(g=>{const b=g.name.replace(/"/g,'""');t+=',"'+b+'"'}),t+=`
97
- `;const a=Math.max(...F.series.map(g=>g.data?.length||0));for(let g=0;g<a;g++){let P='"'+(F.categories[g]||M("chart.fallback.item",{number:g+1})).toString().replace(/"/g,'""')+'"';F.series.forEach(N=>{const T=N.data&&N.data[g]!==void 0?N.data[g]:"";P+=","+T}),t+=P+`
98
- `}const l=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(l),p=document.createElement("a");p.href=i,p.download=q("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(i),Wl()}catch(t){console.error("Error downloading CSV:",t)}},En=t=>{if(typeof t.action=="function"){const a={series:F.series,categories:F.categories,markers:Yt.value},l={chartX:vt.value.chartX,chartY:vt.value.chartY,dataX:vt.value.mouseDataX,dataY:vt.value.mouseDataY,categoryIndex:clampedCategoryIndex||vt.value.categoryIndex};t.action(a,l)}Wl()},ro=()=>{At(),Ae.value.show=!0,Ae.value.categoryIndex=vt.value.categoryIndex,Ae.value.fromButton=!1,Wl()},xo=()=>{At(),Ae.value.show=!0,Ae.value.categoryIndex=0,Ae.value.fromButton=!0},Eo=t=>{if(vt.value.show){const a=document.querySelector(".dss-context-menu");a&&!a.contains(t.target)&&(vt.value.show=!1)}},io=t=>{vt.value.show&&!t.target.closest(".context-menu")&&(vt.value.show=!1)},So=t=>{if(!Sl.value||!et.value)return;t.preventDefault(),t.stopPropagation(),oe.value.isZooming=!0,st.value.show=!1,oe.value.zoomTimeout&&clearTimeout(oe.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),i=t.clientX-l.left,p=t.clientY-l.top;if(i<z.value.left-50||i>z.value.right+50||p<z.value.top-50||p>z.value.bottom+100){oe.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,b=Math.max(oe.value.minScale,Math.min(oe.value.maxScale,oe.value.scale*g));if(b!==oe.value.scale){const{minX:w,maxX:P}=Ut.value,N=P-w||1,T=N/oe.value.scale,B=w-oe.value.offsetX/z.value.width*N,te=(i-z.value.left)/z.value.width,Se=B+te*T;oe.value.scale=b;const Xe=N/oe.value.scale,me=Se-te*Xe;oe.value.offsetX=-(me-w)/N*z.value.width,oe.value.scale<=1.01&&(oe.value.scale=1,oe.value.offsetX=0)}oe.value.zoomTimeout=setTimeout(()=>{oe.value.isZooming=!1,oe.value.zoomTimeout=null},300)},co=t=>{if(!Sl.value||!et.value||oe.value.scale<=1)return;st.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,oe.value.isDragging=!0,oe.value.lastMouseX=t.clientX,oe.value.lastMouseY=t.clientY,t.preventDefault()},Vo=()=>{oe.value.isDragging=!1},uo=()=>{!Sl.value||!et.value||(oe.value.scale=1,oe.value.offsetX=0,oe.value.isDragging=!1,oe.value.zoomTimeout&&(clearTimeout(oe.value.zoomTimeout),oe.value.zoomTimeout=null),oe.value.isZooming=!1)},Zo=()=>!Sl.value||!hn.value||!et.value?"default":oe.value.isDragging?"grabbing":oe.value.scale>1?"grab":"dss-crosshair",jn=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 l=0;l<t.length-1;l++){const i=t[Math.max(l-1,0)],p=t[l],g=t[l+1],b=t[Math.min(l+2,t.length-1)],w=p.x+(g.x-i.x)/6*Ge.value,P=p.y+(g.y-i.y)/6*Ge.value,N=g.x-(b.x-p.x)/6*Ge.value,T=g.y-(b.y-p.y)/6*Ge.value;a+=` C ${w} ${P} ${N} ${T} ${g.x} ${g.y}`}return a},$l=e.computed(()=>{const a=W.value?.chart?.padding,l=typeof a=="number"?a:null,i=a&&typeof a=="object"?a:null,p=50;let g=p+(Ht.value?30:0)+60;if(Ll.value){const B={left:p+40,top:p+40,right:p+40,bottom:p+40};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??B.left,top:i.top??B.top,right:i.right??B.right,bottom:i.bottom??B.bottom}:B}if(Cl.value){const B=!K.value,te=O.value,Se=te?ce.value+$e.value+Math.max(24,_.value+16):0,Xe=B?12:p;let me=0;ut.value&&(me+=B?8:15),Ct.value&&(me+=B?6:10);const ke=tt();let Ne=Xe+(B?4:16)+(te?Se:0),he=Xe+(te?Se:0);K.value&&ye.value==="left"?Ne+=ke.legendWidth||150:K.value&&ye.value==="right"&&(he+=ke.legendWidth||150);const Pe=be.value==="semi-radial"?te?Se:8:te?Se:B?8:p+80,Te=te?14:0,Le=Xe+me+Te,Re={left:Ne,top:Le,right:he,bottom:Pe};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??Re.left,top:i.top??Re.top,right:i.right??Re.right,bottom:i.bottom??Re.bottom}:Re}let b=0;ut.value&&(b+=15),Ct.value&&(b+=10);const w=tt();let P=p+16,N=p;K.value&&ye.value==="left"?P+=w.legendWidth||150:K.value&&ye.value==="right"&&(N+=w.legendWidth||150),Rl.value&&(N+=44);const T={left:P,top:p+b,right:N,bottom:g};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??T.left,top:i.top??T.top,right:i.right??T.right,bottom:i.bottom??T.bottom}:T}),z=e.computed(()=>({left:$l.value.left,top:$l.value.top,right:xe.value-$l.value.right,bottom:ee.value-$l.value.bottom,width:xe.value-($l.value.left+$l.value.right),height:ee.value-($l.value.top+$l.value.bottom)})),Sl=e.computed(()=>["line","area","bar"].includes(be.value)||Je.value),Ul=e.computed(()=>Je.value),On=e.computed(()=>be.value==="mini-radial"),Cl=e.computed(()=>["radial","semi-radial","mini-radial"].includes(be.value)),Ll=e.computed(()=>be.value==="spider"),jt=e.computed(()=>be.value==="bubble"),Jt=e.computed(()=>W.value?.chart?.orientation==="horizontal"&&(be.value==="bar"||Ul.value)),Cn=t=>{const{minY:a,maxY:l}=Ut.value,i=l-a||1;return z.value.left+(t-a)/i*z.value.width},Sn=t=>{const{maxX:a}=Ut.value,l=a+1,p=z.value.height/l;return z.value.top+(t+.5)*p},Ft=e.computed(()=>Cl.value?$l.value.left+(xe.value-$l.value.left-$l.value.right)/2:xe.value/2),wt=e.computed(()=>Ll.value?ee.value/2-40:Cl.value?$l.value.top+(ee.value-$l.value.top-$l.value.bottom)/2:ee.value/2),it=e.computed(()=>{if(Ll.value){const t=z.value.width-80,a=z.value.height-80;return Math.min(t,a)/2}return Math.min(z.value.width,z.value.height)/2}),Zt=e.computed(()=>{const t=W.value,a=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof a=="number"&&a>=0&&a<=1?a:.45;return it.value*l}),qn=e.computed(()=>{const t=W.value,a=typeof F.innerSize=="number"?F.innerSize:t?.innerSize;return typeof a!="number"||a<=-100||!(Cl.value||Ll.value)?1:1+a/100}),tl=e.computed(()=>{const t=qn.value;if(t===1||t<=0)return;const a=Ft.value,l=wt.value;return`translate(${a}, ${l}) scale(${t}) translate(${-a}, ${-l})`}),An=e.ref(0),Kn=e.computed(()=>`semi-radial-fill-clip-${F.chartId}`),Pl=e.computed(()=>be.value==="semi-radial"),dn=e.computed(()=>Pl.value&&St.value&&!_n.value),mn=e.computed(()=>Pl.value&&St.value&&!_n.value&&ll.value==="fill"),Vn=e.computed(()=>{const t=dn.value?An.value:1,a=Ft.value,l=wt.value,i=Zt.value,p=it.value,g=Math.PI,b=Math.PI+t*Math.PI;if(t<=0)return`M ${a} ${l} L ${a} ${l} Z`;const w=a+p*Math.cos(g),P=l+p*Math.sin(g),N=a+p*Math.cos(b),T=l+p*Math.sin(b),B=a+i*Math.cos(b),te=l+i*Math.sin(b),Se=a+i*Math.cos(g),Xe=l+i*Math.sin(g),me=t>.5?1:0;return`M ${a} ${l} L ${w} ${P} A ${p} ${p} 0 ${me} 1 ${N} ${T} L ${B} ${te} A ${i} ${i} 0 ${me} 1 ${Se} ${Xe} Z`}),Nn=e.computed(()=>{if(!(!Pl.value||!dn.value)&&!mn.value)return`url(#${Kn.value})`}),Uo=t=>{if(!(!mn.value||t!==0))return`url(#${Kn.value})`},Bn=e.ref(0),Tn=e.computed(()=>`radial-reveal-clip-${F.chartId}`),en=e.computed(()=>be.value==="radial"),Wn=e.computed(()=>{const t=en.value?Bn.value:1,a=Ft.value,l=wt.value,i=Math.max(it.value*1.5,xe.value,ee.value);if(t<=0)return`M ${a} ${l} L ${a} ${l} Z`;if(t>=1){const B=a-i,te=a+i;return`M ${B} ${l} A ${i} ${i} 0 0 1 ${te} ${l} A ${i} ${i} 0 0 1 ${B} ${l} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,b=a+i*Math.cos(p),w=l+i*Math.sin(p),P=a+i*Math.cos(g),N=l+i*Math.sin(g),T=t>=.5?1:0;return`M ${a} ${l} L ${b} ${w} A ${i} ${i} 0 ${T} 1 ${P} ${N} Z`}),No=e.computed(()=>{if(Nn.value)return Nn.value;if(en.value)return`url(#${Tn.value})`});let Zn=null;const Xo=()=>{if(!dn.value)return;An.value=0;const t=S.value,a=performance.now(),l=i=>{const p=i-a,g=Math.min(1,p/t);An.value=Qo(V.value,g),g<1&&(Zn=requestAnimationFrame(l))};Zn=requestAnimationFrame(l)},Un=e.computed(()=>W.value?.bubbles?.minSize||8),mo=e.computed(()=>W.value?.bubbles?.maxSize||50),Gn=e.computed(()=>W.value?.bubbles?.opacity||.7),Bo=(t,a)=>{const l=[15,20,25,18,22],i=l[t%l.length]||20,p=1+Math.sin(a*.5)*.2;return Math.max(5,i*p)},Mo=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.opacity="1")},po=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.display="none")},tn=e.computed(()=>F.series),ln=e.computed(()=>F.series.filter((t,a)=>!at.value.has(a))),Qn=t=>{if(!t)return"primary";const a=t.yAxis??t.axis??t.yAxisId;return a==="secondary"||a==="right"||a===1?"secondary":"primary"},fo=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,_o=e.computed(()=>ln.value.filter(t=>Qn(t)==="primary")),Dn=e.computed(()=>ln.value.filter(t=>Qn(t)==="secondary")),Rl=e.computed(()=>!Jt.value&&!!se.value&&Dn.value.length>0),Vl="auto",vo=(t,a,l,i=0,p=100)=>{let g=1/0,b=-1/0;if(t.forEach(N=>{N?.data?.length&&N.data.forEach(T=>{typeof T=="number"&&Number.isFinite(T)&&(g=Math.min(g,T),b=Math.max(b,T))})}),g===1/0)return{minY:i,maxY:p};let w;if(a===Vl){const N=b-g,T=N>0?N*.1:1;w=Math.max(0,g-T)}else if(typeof a=="number")w=a;else{const N=b-g,T=N>0?N*.1:1;w=Math.max(0,g-T)}let P;if(l===Vl){const N=b-g,T=N>0?N*.1:2;P=b+T}else if(typeof l=="number")P=l;else{const N=b-g,T=N>0?N*.1:2;P=b+T}return{minY:w,maxY:P}},Ut=e.computed(()=>{if(jt.value)return Yo();if(!ln.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;ln.value.forEach(l=>{l.data&&l.data.length&&(t=Math.max(t,l.data.length-1))}),F.categories.length>0&&(t=Math.max(t,F.categories.length-1));const a=vo(_o.value.length?_o.value:ln.value,He.value,_e.value);return{minX:0,maxX:t,minY:a.minY,maxY:a.maxY}}),$o=e.computed(()=>Rl.value?vo(Dn.value,Xt.value,bt.value,Ut.value.minY,Ut.value.maxY):{minY:Ut.value.minY,maxY:Ut.value.maxY}),Yo=()=>{if(!ln.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,a=-1/0,l=1/0,i=-1/0,p=1/0,g=-1/0,b=!1;if(ln.value.forEach((Se,Xe)=>{Se?.data?.length&&Se.data.forEach((me,ke)=>{let Ne,he,je;if(typeof me=="object"&&me!==null&&!Array.isArray(me))Ne=typeof me.x=="number"?me.x:ke,he=typeof me.y=="number"?me.y:0,je=typeof me.size=="number"?me.size:20;else if(Array.isArray(me)&&me.length>=3)Ne=typeof me[0]=="number"?me[0]:ke,he=typeof me[1]=="number"?me[1]:0,je=typeof me[2]=="number"?me[2]:20;else if(typeof me=="number")Ne=ke,he=me,je=Bo(Xe,ke);else return;isFinite(Ne)&&isFinite(he)&&isFinite(je)&&(t=Math.min(t,Ne),a=Math.max(a,Ne),l=Math.min(l,he),i=Math.max(i,he),p=Math.min(p,je),g=Math.max(g,je),b=!0)})}),!b)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)),l===i&&(l=Math.max(0,l-10),i=l+20);const w=a-t,P=i-l;let N,T,B,te;return Gt.value!==null?N=Gt.value:N=t-w*.1,Lt.value!==null?T=Lt.value:T=a+w*.1,He.value!==null&&typeof He.value=="number"?B=He.value:B=Math.max(0,l-P*.1),_e.value!==null&&typeof _e.value=="number"?te=_e.value:te=i+P*.1,{minX:N,maxX:T,minY:B,maxY:te,minSize:p,maxSize:g}},Kt=t=>{if(jt.value){const{minX:w,maxX:P}=Ut.value,N=P-w||1;return z.value.left+(t-w)/N*z.value.width}const{minX:a,maxX:l}=Ut.value,i=l-a;if(l===0||i===0)return z.value.left+z.value.width/2;const p=i/oe.value.scale,g=a-oe.value.offsetX/z.value.width*i,b=(t-g)/p;return z.value.left+b*z.value.width},wl=t=>{const{minY:a,maxY:l}=Ut.value,i=l-a||1;return z.value.bottom-(t-a)/i*z.value.height},Lo=t=>{const{minY:a,maxY:l}=$o.value,i=l-a||1;return z.value.bottom-(t-a)/i*z.value.height},xl=(t,a)=>Rl.value&&Qn(t)==="secondary"?Lo(a):wl(a),go=t=>{if(!jt.value)return ft.value||4;const{maxSize:a}=Ut.value,l=Math.max(1,a),i=Math.min(1,Math.max(0,t/l));return Un.value+i*(mo.value-Un.value)},Hn=(t,a=12,l="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(a*.62);Hn.canvas||(Hn.canvas=document.createElement("canvas"));const i=Hn.canvas.getContext("2d");return i?(i.font=`${a}px ${l}`,i.measureText(t).width):t.length*(a*.62)},ho=(t,a,l=12)=>{if(typeof t!="string"||typeof a!="number"||a<=0||Hn(t,l)<=a)return t;const i="..";if(Hn(i,l)>=a)return i;let g=t.length;for(;g>0;){const b=`${t.slice(0,g)}${i}`;if(Hn(b,l)<=a)return b;g-=1}return i},Ao=e.computed(()=>s.value.map(t=>({y:t.y}))),o=e.computed(()=>{if(jt.value)return n();if(be.value==="bar"){if(Jt.value){const Le=[],{minY:Re,maxY:$t}=Ut.value,zt=5,jl=$t-Re||1;for(let gl=0;gl<=zt;gl++){const Kl=Re+jl*(gl/zt),Io=Cn(Kl);Le.push({x:Io,y:z.value.bottom+20,text:Wt(Math.round(Kl))})}return Le}const ke=[],{maxX:Ne}=Ut.value,he=Ne+1,je=5,Te=(z.value.width-je*2)/he;for(let Le=0;Le<=Ne;Le++){const Re=z.value.left+je+(Le+.5)*Te;ke.push({x:Re,y:z.value.bottom+20,text:ho(F.categories[Le]||M("chart.fallback.item",{number:Le+1}),Math.max(Te-8,24))})}return ke}const t=[],{minX:a,maxX:l}=Ut.value,i=Gt.value!==null?Gt.value:a,p=Lt.value!==null?Lt.value:l,g=p-i||1,b=g/oe.value.scale,w=i-oe.value.offsetX/z.value.width*g,P=w+b,N=Math.max(0,Math.floor(w-2)),T=Math.min(p,Math.ceil(P+2)),B=T-N,te=z.value.width,Xe=Math.floor(te/60);let me=1;B>Xe&&(me=Math.ceil(B/Xe));for(let ke=N;ke<=T;ke+=me)if(ke>=0&&ke<=p){const Ne=Kt(ke);Ne>=z.value.left-100&&Ne<=z.value.right+100&&t.push({x:Ne,y:z.value.bottom+20,text:F.categories[ke]||`Item ${ke+1}`})}return t}),n=()=>{const t=[],{minX:a,maxX:l}=Ut.value,i=l-a||1,p=Math.min(8,Math.max(4,Math.floor(z.value.width/80)));for(let g=0;g<=p;g++){const b=a+i*g/p,w=Kt(b);if(w>=z.value.left-10&&w<=z.value.right+10){const P=Math.round(b),N=F.categories?.[P];t.push({x:w,y:z.value.bottom+20,text:N||(Number.isInteger(b)?b.toString():b.toFixed(1))})}}return t},s=e.computed(()=>{if(Jt.value){const p=[],{maxX:g}=Ut.value;for(let b=0;b<=g;b++)p.push({x:z.value.left-10,y:Sn(b),text:ho(F.categories[b]||`Item ${b+1}`,Math.max(z.value.left-28,40))});return p}const t=[],{minY:a,maxY:l}=Ut.value,i=5;for(let p=0;p<=i;p++){const g=a+(l-a)*(p/i),b=Math.round(g);t.push({x:z.value.left-10,y:wl(g),text:Wt(b)})}return t}),r=e.computed(()=>{if(!Rl.value||Jt.value)return[];const t=[],{minY:a,maxY:l}=$o.value,i=5;for(let p=0;p<=i;p++){const g=a+(l-a)*(p/i),b=Math.round(g);t.push({x:z.value.right+10,y:Lo(g),text:Wt(b)})}return t}),c=t=>{const a=rl.value;if(!a||a.length===0){const l=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return l[t%l.length]}return a[t%a.length]},d=t=>{if(!t||typeof t!="string")return"#3a3a3a";const a=t.trim();let l=0,i=0,p=0;const g=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)l=Number(g[1])/255,i=Number(g[2])/255,p=Number(g[3])/255;else{const w=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(w)l=Number(w[1])/255,i=Number(w[2])/255,p=Number(w[3])/255;else{const P=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(P){let N=P[1];N.length===3&&(N=N[0]+N[0]+N[1]+N[1]+N[2]+N[2]),l=parseInt(N.slice(0,2),16)/255,i=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 T=getComputedStyle(N).color;document.body.removeChild(N);const B=T.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(B)l=Number(B[1])/255,i=Number(B[2])/255,p=Number(B[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*i+.0722*p>.5?"#3a3a3a":"#fafafa"},u=t=>{if(!t||typeof t!="string")return t;const a=t.trim(),l=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(l){const g=Math.max(0,Math.floor(Number(l[1])*.65)),b=Math.max(0,Math.floor(Number(l[2])*.65)),w=Math.max(0,Math.floor(Number(l[3])*.65));return`rgb(${g}, ${b}, ${w})`}const i=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(i){const g=Math.max(0,Math.floor(Number(i[1])*.65)),b=Math.max(0,Math.floor(Number(i[2])*.65)),w=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${b}, ${w}, ${i[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 b=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))),P=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[b,w,P].map(N=>N.toString(16).padStart(2,"0")).join("")}`}return a},m=(t,a)=>{const i=W.value?.stroke?.color;return i==null?u(a):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??u(a):u(a)},v=t=>{let a=0;for(let l=1;l<t.length;l++){const i=t[l].x-t[l-1].x,p=t[l].y-t[l-1].y;a+=Math.sqrt(i*i+p*p)}return a},k=e.computed(()=>be.value==="line"||Ul.value?(Ul.value?F.series.filter(a=>(a.type||be.value)==="line"):tn.value).map((a,l)=>{const i=F.series.findIndex(B=>B===a),p=[];let g=[];a.data.forEach((B,te)=>{B==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:Jt.value?Cn(B):Kt(te),y:Jt.value?Sn(te):xl(a,B),index:te})}),g.length>0&&p.push(g);let b="";p.forEach(B=>{if(B.length>0){let te="";fe.value?te=jn(B):te=`M ${B[0].x} ${B[0].y}`+B.slice(1).map(Se=>` L ${Se.x} ${Se.y}`).join(""),b+=(b?" ":"")+te}});const w=p.reduce((B,te)=>B+v(te),0),P=at.value.has(i),N=de.value===i,T=de.value!==null&&de.value!==i;return{path:b,color:c(i),strokeDasharray:fo(a),pathLength:w,seriesIndex:i,animationDelay:l*Y.value,isHighlighted:N,isDimmed:T,isHidden:P}}):[]),L=e.computed(()=>{if(!(be.value==="line"||Ul.value))return[];const t=Ul.value?F.series.filter(l=>(l.type||be.value)==="line"):tn.value,a=[];return t.forEach((l,i)=>{const p=F.series.findIndex(g=>g===l);for(let g=0;g<l.data.length-1;g++){const b=l.data[g];if(b!=null){let w=-1,P=0;for(let N=g+1;N<l.data.length;N++){const T=l.data[N];if(T==null)P++;else{w=N;break}}if(P>0&&w!==-1){const N=l.data[w],T=Jt.value?Cn(b):Kt(g),B=Jt.value?Sn(g):xl(l,b),te=Jt.value?Cn(N):Kt(w),Se=Jt.value?Sn(w):xl(l,N),Xe=at.value.has(p),me=de.value===p,ke=de.value!==null&&de.value!==p;a.push({path:`M ${T} ${B} L ${te} ${Se}`,color:c(p),seriesIndex:p,animationDelay:i*Y.value,isHighlighted:me,isDimmed:ke,isHidden:Xe,gapSize:P}),g=w-1}}}}),a}),R=e.computed(()=>be.value==="line"||Ul.value?!St.value||_n.value||It.value.hasAnimated?[]:(Ul.value?F.series.filter(a=>(a.type||be.value)==="line"):tn.value).map((a,l)=>{const i=F.series.findIndex(P=>P===a);let p="",g=null;a.data.forEach((P,N)=>{if(P!=null){const T={x:Jt.value?Cn(P):Kt(N),y:Jt.value?Sn(N):xl(a,P)};g===null?p+=`M ${T.x} ${T.y}`:p+=` L ${T.x} ${T.y}`,g=T}else if(g!==null){const T=a.data.findIndex((B,te)=>te>N&&B!==null&&B!==void 0);if(T!==-1){const B={x:Jt.value?Cn(a.data[T]):Kt(T),y:Jt.value?Sn(T):xl(a,a.data[T])};p+=` L ${B.x} ${B.y}`,g=B}}});const b=a.data.map((P,N)=>P==null?null:{x:Jt.value?Cn(P):Kt(N),y:Jt.value?Sn(N):xl(a,P)}).filter(P=>P!==null),w=v(b);return{path:p,pathLength:w,color:c(i),strokeDasharray:fo(a),animationDelay:l*Y.value,seriesIndex:i}}):[]),E=e.computed(()=>{if(be.value!=="line")return[];const t=[];return tn.value.forEach((a,l)=>{const i=de.value===l,p=de.value!==null&&de.value!==l,g=at.value.has(l);a.data.forEach((b,w)=>{b!=null&&t.push({x:Kt(w),y:xl(a,b),color:c(l),value:b,label:F.categories[w]||w.toString(),seriesName:a.name,categoryIndex:w,dataIndex:w,animationDelay:(l*a.data.length+w)*(Y.value/8),isHighlighted:i,isDimmed:p,isHidden:g})})}),t}),ae=e.computed(()=>{if(!Ul.value)return[];const t=[];return F.series.filter(l=>(l.type||be.value)==="line").forEach((l,i)=>{const p=F.series.findIndex(P=>P===l),g=de.value===p,b=de.value!==null&&de.value!==p,w=at.value.has(p);l.data.forEach((P,N)=>{P!=null&&t.push({x:Kt(N),y:xl(l,P),color:c(p),value:P,label:F.categories[N]||N.toString(),seriesName:l.name,categoryIndex:N,dataIndex:N,animationDelay:(i*l.data.length+N)*(Y.value/8),isHighlighted:g,isDimmed:b,isHidden:w})})}),t}),j=e.computed(()=>{if(!jt.value)return[];const t=[];return tn.value.forEach((a,l)=>{if(!a?.data?.length)return;const i=de.value,p=i!==null&&i===l,g=i!==null&&i!==l,b=at.value.has(l);a.data.forEach((w,P)=>{let N,T,B,te,Se;if(typeof w=="object"&&w!==null&&!Array.isArray(w))N=typeof w.x=="number"?w.x:P,T=typeof w.y=="number"?w.y:0,B=typeof w.size=="number"?w.size:20,te=w.label||F.categories?.[P]||`Point ${P+1}`,Se=w.image||w.imageUrl;else if(Array.isArray(w)&&w.length>=3)N=typeof w[0]=="number"?w[0]:P,T=typeof w[1]=="number"?w[1]:0,B=typeof w[2]=="number"?w[2]:20,te=w[3]||F.categories?.[P]||`Point ${P+1}`,Se=w[4];else if(typeof w=="number")N=P,T=w,B=Bo(l,P),te=F.categories?.[P]||`Point ${P+1}`;else return;!isFinite(N)||!isFinite(T)||!isFinite(B)||t.push({x:Kt(N),y:wl(T),radius:go(B),originalX:N,originalY:T,originalSize:B,color:c(l),seriesName:a.name||`Series ${l+1}`,label:te,imageUrl:Se,seriesIndex:l,dataIndex:P,categoryIndex:Math.round(N),isHighlighted:p,isDimmed:g,isHidden:b,opacity:Gn.value})})}),t}),Ie=e.computed(()=>be.value!=="area"?[]:tn.value.map((t,a)=>{const l=[];let i=[];if(t.data.forEach((B,te)=>{B==null?i.length>0&&(l.push([...i]),i=[]):i.push({x:Kt(te),y:xl(t,B),index:te})}),i.length>0&&l.push(i),l.length===0)return{linePath:"",areaPath:"",color:c(a),isHidden:at.value.has(a)};const p=z.value.bottom+1;let g="",b="";l.forEach((B,te)=>{if(B.length===0)return;let Se=`M ${B[0].x} ${B[0].y}`;fe.value&&B.length>1?Se=jn(B):B.slice(1).forEach(me=>{Se+=` L ${me.x} ${me.y}`}),g+=(g?" ":"")+Se;let Xe=`M ${B[0].x} ${p}`;if(Xe+=` L ${B[0].x} ${B[0].y}`,fe.value&&B.length>1){const me=jn(B),ke=me.substring(me.indexOf("C")||me.indexOf("Q")||me.indexOf("L"));ke?Xe+=" "+ke:B.slice(1).forEach(Ne=>{Xe+=` L ${Ne.x} ${Ne.y}`})}else B.slice(1).forEach(me=>{Xe+=` L ${me.x} ${me.y}`});Xe+=` L ${B[B.length-1].x} ${p} Z`,b+=(b?" ":"")+Xe});const w=de.value===a,P=de.value!==null&&de.value!==a,N=at.value.has(a),T=l.reduce((B,te)=>B+v(te),0);return{linePath:g,areaPath:b,color:c(a),pathLength:T,isHighlighted:w,isDimmed:P,isHidden:N}})),Ve=e.computed(()=>{if(!(["bar"].includes(be.value)||Ul.value))return[];const t=[],{maxX:a}=Ut.value,l=Ul.value?F.series.filter(p=>(p.type||be.value)==="bar"):tn.value,i=l.length;if(Jt.value){const p=a+1,b=z.value.height/p,w=b*(2/3),P=Math.min(4,w/i*.15),N=w-(i-1)*P,T=Math.max(4,N/i);l.forEach((B,te)=>{const Se=F.series.findIndex(Ne=>Ne===B),Xe=de.value===Se,me=de.value!==null&&de.value!==Se,ke=at.value.has(Se);B.data.forEach((Ne,he)=>{if(Ne==null||typeof Ne!="number"||!isFinite(Ne))return;const Te=z.value.top+(he+.5)*b-w/2+te*(T+P),Le=z.value.left,Re=Math.abs(Cn(Ne)-z.value.left);let $t="";if(fe.value&&Re>0){const zt=Math.min(Nt.value,T/2,Re/2);$t=[`M ${Le} ${Te}`,`L ${Le+Re-zt} ${Te}`,`Q ${Le+Re} ${Te} ${Le+Re} ${Te+zt}`,`L ${Le+Re} ${Te+T-zt}`,`Q ${Le+Re} ${Te+T} ${Le+Re-zt} ${Te+T}`,`L ${Le} ${Te+T}`,"Z"].join(" ")}t.push({x:Le,y:Te,width:Re,height:T,color:c(i===1?he:Se),value:Ne,label:F.categories[he]||he.toString(),seriesName:B.name,animationDelay:(te*l.length+he)*(Y.value/4),isHighlighted:Xe,isDimmed:me,isHidden:ke,barPath:$t,isSmooth:fe.value&&Re>0})})})}else{const p=a+1,b=z.value.width/p,w=b*.8,P=w/i,N=P*.05,T=P-N;l.forEach((B,te)=>{const Se=F.series.findIndex(Ne=>Ne===B),Xe=de.value===Se,me=de.value!==null&&de.value!==Se,ke=at.value.has(Se);B.data.forEach((Ne,he)=>{if(Ne==null||typeof Ne!="number"||!isFinite(Ne))return;const Te=z.value.left+(he+.5)*b-w/2+te*P+N/2,Le=wl(Math.max(0,Ne)),Re=Math.abs(wl(0)-wl(Ne));let $t="";if(fe.value&&Re>0){const zt=Math.min(Nt.value,T/2,Re/2);$t=[`M ${Te} ${Le+Re}`,`L ${Te} ${Le+zt}`,`Q ${Te} ${Le} ${Te+zt} ${Le}`,`L ${Te+T-zt} ${Le}`,`Q ${Te+T} ${Le} ${Te+T} ${Le+zt}`,`L ${Te+T} ${Le+Re}`,"Z"].join(" ")}t.push({x:Te,y:Le,width:T,height:Re,color:c(i===1?he:Se),value:Ne,label:F.categories[he]||he.toString(),seriesName:B.name,animationDelay:(te*l.length+he)*(Y.value/4),isHighlighted:Xe,isDimmed:me,isHidden:ke,barPath:$t,isSmooth:fe.value&&Re>0})})})}return t}),nt=e.computed(()=>{if(!Cl.value)return[];const t=tn.value.map((b,w)=>({series:b,originalIndex:w})).filter(({originalIndex:b})=>!at.value.has(b));if(t.length===0)return[];let a=be.value==="semi-radial"?Math.PI:-Math.PI/2;const l=be.value==="semi-radial"?Math.PI:Math.PI*2,i=[],p=(b,w,P,N,T,B)=>{const te=b+(w-b)/2,Se=w-b,Xe=Ft.value+Math.cos(b)*Zt.value,me=wt.value+Math.sin(b)*Zt.value,ke=Ft.value+Math.cos(w)*Zt.value,Ne=wt.value+Math.sin(w)*Zt.value,he=Ft.value+Math.cos(w)*it.value,je=wt.value+Math.sin(w)*it.value,Pe=Ft.value+Math.cos(b)*it.value,Te=wt.value+Math.sin(b)*it.value,Le=Se>Math.PI?1:0,Re=[`M ${Xe} ${me}`,`A ${Zt.value} ${Zt.value} 0 ${Le} 1 ${ke} ${Ne}`,`L ${he} ${je}`,`A ${it.value} ${it.value} 0 ${Le} 0 ${Pe} ${Te}`,"Z"].join(" "),$t=B||c(P);return{path:Re,color:$t,strokeWidth:xt.value,strokeColor:m(i.length,$t),value:T,seriesName:N,opacity:.8,isHighlighted:de.value===P,isDimmed:de.value!==null&&de.value!==P,isHidden:!1,startAngle:b,endAngle:w,midAngle:te}};if(On.value){const{series:b,originalIndex:w}=t[0],P=Number(b?.data?.[0]??0),N=Number.isFinite(P)?Math.min(Math.max(P,0),100):0,T=W.value,B=Math.min(Math.max(Number(T?.miniRadial?.minVisiblePercent??1),0),100),Se=(N<=0?B:N)/100*l,Xe=Number(T?.miniRadial?.thresholds?.low??33),me=Number(T?.miniRadial?.thresholds?.medium??66),ke=T?.miniRadial?.colors?.low||"#E53E3E",Ne=T?.miniRadial?.colors?.medium||"#ED8936",he=T?.miniRadial?.colors?.high||"#38A169",je=N<=Xe?ke:N<=me?Ne:he,Pe=T?.miniRadial?.trackColor||"#E5E7EB",Te=b?.name||"Score";return i.push(p(a,a+l-.001,w+1,"Track",100,Pe)),i.push(p(a,a+Se,w,Te,N,je)),i}if(t.length===1){const{series:b,originalIndex:w}=t[0],P=b.data[0]||0,N=a,T=a+l-.001,B=N+l/2,te=Ft.value+Math.cos(N)*Zt.value,Se=wt.value+Math.sin(N)*Zt.value,Xe=Ft.value+Math.cos(T)*Zt.value,me=wt.value+Math.sin(T)*Zt.value,ke=Ft.value+Math.cos(T)*it.value,Ne=wt.value+Math.sin(T)*it.value,he=Ft.value+Math.cos(N)*it.value,je=wt.value+Math.sin(N)*it.value,Pe=1,Te=[`M ${te} ${Se}`,`A ${Zt.value} ${Zt.value} 0 ${Pe} 1 ${Xe} ${me}`,`L ${ke} ${Ne}`,`A ${it.value} ${it.value} 0 ${Pe} 0 ${he} ${je}`,"Z"].join(" "),Le=c(w);return i.push({path:Te,color:Le,strokeWidth:xt.value,strokeColor:m(0,Le),value:P,seriesName:b.name,opacity:.8,isHighlighted:de.value===w,isDimmed:!1,isHidden:!1,startAngle:N,endAngle:T,midAngle:B}),i}if(mn.value&&t.length===2){const b=t[0],w=t[1],P=Math.min(100,Math.max(0,b.series.data[0]||0)),N=P/100*l;return i.push(p(a,a+N,b.originalIndex,b.series.name,P)),i.push(p(a,a+l,w.originalIndex,w.series.name,100)),i}const g=t.reduce((b,{series:w})=>b+(w.data[0]||0),0);return g===0?[]:(t.forEach(({series:b,originalIndex:w})=>{const P=b.data[0]||0,N=P/g*l,T=a,B=a+N,te=T+N/2,Se=Ft.value+Math.cos(T)*Zt.value,Xe=wt.value+Math.sin(T)*Zt.value,me=Ft.value+Math.cos(B)*Zt.value,ke=wt.value+Math.sin(B)*Zt.value,Ne=Ft.value+Math.cos(B)*it.value,he=wt.value+Math.sin(B)*it.value,je=Ft.value+Math.cos(T)*it.value,Pe=wt.value+Math.sin(T)*it.value,Te=N>Math.PI?1:0,Le=[`M ${Se} ${Xe}`,`A ${Zt.value} ${Zt.value} 0 ${Te} 1 ${me} ${ke}`,`L ${Ne} ${he}`,`A ${it.value} ${it.value} 0 ${Te} 0 ${je} ${Pe}`,"Z"].join(" "),Re=c(w);i.push({path:Le,color:Re,strokeWidth:xt.value,strokeColor:m(i.length,Re),value:P,seriesName:b.name,opacity:.8,isHighlighted:de.value===w,isDimmed:de.value!==null&&de.value!==w,isHidden:!1,startAngle:T,endAngle:B,midAngle:te}),a=B}),i)}),bl=e.computed(()=>{const t=nt.value;return mn.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((a,l)=>({segment:a,originalIndex:l}))}),fl=e.computed(()=>{if(!O.value||!Cl.value)return[];const t=_.value,a=ce.value,l=$e.value,i=dt.value,p=15,g=t*1.3,b=.55,w=(B,te)=>{const Se=Ft.value+Math.cos(B.midAngle)*it.value,Xe=wt.value+Math.sin(B.midAngle)*it.value,me=Ft.value+Math.cos(B.midAngle)*(it.value+a),ke=wt.value+Math.sin(B.midAngle)*(it.value+a),he=me+l*(te?1:-1),je=te?me+p:me-p,Pe=ke-i,Te=`${B.seriesName}: ${Wt(B.value)}`,Le=Te.length*t*b;return{pointerStartX:Se,pointerStartY:Xe,pointerEndX:me,pointerEndY:ke,horizontalEndX:he,horizontalEndY:ke,textX:je,textY:Pe,text:Te,textWidth:Le,textAnchor:te?"start":"end",isRightSide:te,pointerLineLength:Math.hypot(me-Se,ke-Xe),horizontalLineLength:Math.hypot(he-me,0)}},P=(B,te)=>{const Se=Math.abs(B.textY-te.textY)<g,Xe=B.isRightSide?B.textX:B.textX-B.textWidth,me=B.isRightSide?B.textX+B.textWidth:B.textX,ke=te.isRightSide?te.textX:te.textX-te.textWidth,Ne=te.isRightSide?te.textX+te.textWidth:te.textX,he=Xe<Ne&&ke<me;return Se&&he},N=nt.value.filter(B=>!B.isHidden),T=[];for(let B=0;B<N.length;B++){const te=N[B];let Se=Math.cos(te.midAngle)>=0;if(B>0){const me=T[B-1],ke=w(te,Se);P(me,ke)&&(Se=!Se)}const Xe=w(te,Se);T.push({...Xe,color:te.color,isHighlighted:te.isHighlighted,isDimmed:te.isDimmed})}return T}),sl=t=>{if(!t||t.isHidden)return 0;const a=t.opacity||Gn.value||.7;return de.value===null||de.value===void 0?a:de.value!==null?t.seriesIndex===de.value?Math.min(1,a+.1):Math.max(.5,a*.8):a},vl=t=>{if(!t||t.isHidden)return 0;const a=t.radius>20?.9:.8;return de.value!==null?t.seriesIndex===de.value?Math.min(1,a+.1):a*.7:a},cl=(t,a)=>{if(t)try{if(de.value===t.seriesIndex?de.value=null:de.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:a,chartId:F.chartId}});window.dispatchEvent(l)}}catch(l){console.error("Error in onBubbleClick:",l)}},ul=(t,a)=>{const l=[`dss-bubble-fallback-${a}`];return t.isHighlighted&&l.push("dss-bubble-highlighted"),t.isDimmed&&l.push("dss-bubble-dimmed"),t.isHidden&&l.push("dss-bubble-hidden"),l.push(`dss-bubble-series-${t.seriesIndex}`),l.join(" ")},Xl=(t,a)=>{if(!t||(a.stopPropagation(),Ro.value=!0,de.value=t.seriesIndex,st.value.show=!1,!Ue.value))return;const l=a.target.closest(".dss-custom-chart-container");if(!l)return;const i=l.getBoundingClientRect();let p=a.clientX-i.left+10,g=a.clientY-i.top-10;const b=200,w=120;p+b>xe.value&&(p=a.clientX-i.left-b-10),g+w>i.height&&(g=a.clientY-i.top-w-10),p<0&&(p=10),g<0&&(g=10);const P=Qt.value,N=ol.value,T=P.map(B=>{const te=N[B]||B,Se=pn(B,t);return Se?{seriesName:t.seriesName,label:t.label,value:`${te}: ${Se}`,color:t.color}:null}).filter(Boolean);kt.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:T,categoryIndex:void 0,spiderAreas:[]}},pn=(t,a)=>{let l;switch(t){case"x":l=a.originalX;break;case"y":l=a.originalY;break;case"size":l=a.originalSize;break;case"label":l=a.label;break;case"seriesName":l=a.seriesName;break;default:l=a[t]||""}const i=rn.value[t];if(typeof i=="function")return i(l,a);if(typeof l=="number"){const p=l.toFixed(1);return on.value?p+on.value:p}return l?.toString()||""},bn=()=>{if(!jt.value||!st.value.data||st.value.data.length===0)return"Bubbles";const t=[],a=new Set;return st.value.data.forEach(l=>{if(l.seriesName&&l.label){const i=`${l.seriesName} - ${l.label}`;a.has(i)||(t.push(i),a.add(i))}else l.seriesName&&(a.has(l.seriesName)||(t.push(l.seriesName),a.add(l.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},yo=(t,a)=>{t&&(Ro.value=!1,de.value=null,kt.value.show=!1,kt.value.bubbleData=[])},To=(t,a)=>{const l=a.target.closest(".dss-custom-chart-container");if(!l)return;const i=l.getBoundingClientRect(),p=zn(t.categoryIndex),g=t.description||t.comment||"";let b=a.clientX-i.left+15,w=a.clientY-i.top-10;const P=200,N=g?80:50;b+P>xe.value&&(b=a.clientX-i.left-P-15),w+N>ee.value&&(w=a.clientY-i.top-N-10),b<0&&(b=10),w<0&&(w=10),ml.value={show:!0,x:b,y:w,categoryValue:p,description:g}},jo=()=>{ml.value.show=!1},Mn=e.computed(()=>F.categories.length||Math.max(...ln.value.map(t=>t.data.length))),la=e.computed(()=>{let t=0;return ln.value.forEach(a=>{a.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),ko=e.computed(()=>{const t=[],a=Mn.value;for(let l=0;l<a;l++){const i=l*2*Math.PI/a-Math.PI/2,p=Ft.value+Math.cos(i)*it.value,g=wt.value+Math.sin(i)*it.value;t.push({x:p,y:g,angle:i,index:l})}return t}),Jn=e.computed(()=>{const t=[],a=Mn.value;return ko.value.forEach((l,i)=>{const p=it.value+15,g=i*2*Math.PI/a-Math.PI/2,b=Ft.value+Math.cos(g)*p,w=wt.value+Math.sin(g)*p+5;let P="middle",N="middle";Math.abs(Math.cos(g))>.5&&(P=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(N=Math.sin(g)>0?"hanging":"auto"),t.push({x:b,y:w,text:F.categories[i]||`Axis ${i+1}`,anchor:P,baseline:N})}),t}),Do=e.ref(new Set),fn=(t,a,l)=>{const i=`current-${l}`,p=Do.value.has(i);return!p&&de.value===null?a.fillOpacity||gt.value:a.isHighlighted||p?(a.fillOpacity||gt.value)+.15:a.isDimmed?(a.fillOpacity||gt.value)*.3:a.fillOpacity||gt.value},nn=e.computed(()=>{if(!Ll.value)return[];const t=[],a=Mn.value;return tn.value.forEach((l,i)=>{const p=[],g=[],b=[],w=de.value===i,P=de.value!==null&&de.value!==i,N=at.value.has(i);for(let T=0;T<a;T++){const B=l.data[T]||0,Se=B/la.value*it.value,Xe=T*2*Math.PI/a-Math.PI/2,me=Ft.value+Math.cos(Xe)*Se,ke=wt.value+Math.sin(Xe)*Se;p.push(`${me},${ke}`),g.push({x:me,y:ke}),b.push({x:me,y:ke,value:B,label:F.categories[T]||`Axis ${T+1}`,seriesName:l.name})}t.push({points:p.join(" "),polygonPoints:g,dataPoints:b,color:c(i),fillOpacity:gt.value,seriesName:l.name,value:`${l.name}: ${l.data.join(", ")}`,isHighlighted:w,isDimmed:P,isHidden:N,seriesIndex:i})}),t}),Yl=(t,a)=>{if(!a||a.length<3)return!1;let l=!1;for(let i=0,p=a.length-1;i<a.length;p=i++){const g=a[i].x,b=a[i].y,w=a[p].x,P=a[p].y;b>t.y!=P>t.y&&t.x<(w-g)*(t.y-b)/(P-b)+g&&(l=!l)}return l},na=t=>{if(!Ll.value)return;const a=t.currentTarget.closest(".dss-custom-chart-container");if(!a)return;const l=a.getBoundingClientRect(),i=$.value?.getBoundingClientRect();if(!i)return;const p=t.clientX-i.left,g=t.clientY-i.top,b=nn.value.filter(w=>w.isHidden?!1:Yl({x:p,y:g},w.polygonPoints));if(b.length>0){b.length,de.value=b[0].seriesIndex;const w=t.clientX-l.left+10,P=t.clientY-l.top-10,N=b.length>1?460:260,T=70+Mn.value*20;let B=w,te=P;B+N>xe.value&&(B=t.clientX-l.left-N-10),te+T>ee.value&&(te=t.clientY-l.top-T-10),B<0&&(B=10),te<0&&(te=10);const Se=b.map(Xe=>({seriesName:Xe.seriesName,color:Xe.color,points:Xe.dataPoints.map(me=>({label:me.label,value:Wt(me.value)}))}));kt.value={show:!0,x:B,y:te,title:"",value:"",bubbleData:[],spiderAreas:Se}}else wn()},Ho=e.computed(()=>{const t=W.value;return t.logos.map((a,l)=>{const i=F.series[a.seriesIndex];if(!i||!i.data||i.data.length===0||at.value.has(a.seriesIndex))return null;let p,g;if(Sl.value){let w=-1,P=null;for(let T=i.data.length-1;T>=0;T--)if(i.data[T]!==null&&i.data[T]!==void 0){w=T,P=i.data[T];break}if(w===-1||P===null)return null;const N=i.data.map((T,B)=>T==null?null:{x:Kt(B),y:xl(i,T),index:B}).filter(T=>T!==null);if(t.animations.enabled&&!_n.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(It.value.isAnimating||!It.value.hasAnimated))if(It.value.isAnimating){const T=It.value.currentFrame/It.value.totalFrames,B=Qo(t.animations.easing,Math.min(T,1)),te=xa(N,B);p=te.x+(a.offsetX||0),g=te.y+(a.offsetY||0)}else p=N[0].x+(a.offsetX||0),g=N[0].y+(a.offsetY||0);else p=Kt(w)+(a.offsetX||0),g=wl(P)+(a.offsetY||0)}else if(Cl.value||Ll.value){const w=Math.PI*2/t.logos.length*l;p=Ft.value+Math.cos(w)*(it.value+30)+(a.offsetX||0),g=wt.value+Math.sin(w)*(it.value+30)+(a.offsetY||0)}return{...a,x:p,y:g,seriesIndex:a.seriesIndex}}).filter(Boolean)}),va=t=>{const a=document.querySelector(`.dss-logo-fallback-${t}`),l=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.opacity="0"),l&&(l.style.opacity="1")},ga=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const a=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.display="none")},Ko=t=>{at.value.has(t)?at.value.delete(t):at.value.add(t)},ha=e.computed(()=>{if(!kt.value.show&&!(Ke.value&&st.value.show&&!oe.value.isZooming))return{display:"none"};let t,a;if(Ke.value&&st.value.show&&!oe.value.isZooming){t=st.value.x+15,a=z.value.top;const l=jt.value?200:150;t+l>xe.value&&(t=st.value.x-l-15),t<0&&(t=10),a<10&&(a=10)}else t=kt.value.x,a=kt.value.y;return{left:t+"px",top:a+"px"}}),Rn=(t,a)=>{if(!Ue.value||Co.value)return;const i=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-i.left+10,g=a.clientY-i.top-10;const b=200,w=120,P=xe.value,N=ee.value;p+b>P&&(p=a.clientX-i.left-b-10),g+w>N&&(g=a.clientY-i.top-w-10),p<0&&(p=10),g<0&&(g=10);let T;typeof t.categoryIndex=="number"?T=t.categoryIndex:typeof t.dataIndex=="number"?T=t.dataIndex:t.label&&F.categories.includes(t.label)&&(T=F.categories.indexOf(t.label));const B=(Jt.value||be.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";kt.value={show:!0,x:p,y:g,title:B,value:Wt(t.value)||"",categoryIndex:T,spiderAreas:[]}},Go=e.ref(!1),Ro=e.ref(!1),wn=()=>{kt.value.show=!1,kt.value.spiderAreas=[],kt.value.bubbleData=[],st.value.show=!1,Go.value||(de.value=null)},Co=e.ref(!1),bo=(t,a)=>{Co.value=!0,kt.value.show=!1,st.value.show=!1;const i=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-i.left+15,g=a.clientY-i.top-10;const b=250;p+b>xe.value&&(p=a.clientX-i.left-b-15),p<0&&(p=10),g<0&&(g=10),kl.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},wo=()=>{Co.value=!1,kl.value.show=!1},It=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),Qo=(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}},_n=e.computed(()=>ze.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),oa=()=>{if(!St.value||_n.value){It.value.hasAnimated=!0,en.value&&(Bn.value=1);return}en.value&&(Bn.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,l=Qo(V.value,Math.min(a,1));ya(l),en.value&&(Bn.value=l),a<1?(It.value.currentFrame++,It.value.animationId=requestAnimationFrame(t)):ka()};It.value.animationId=requestAnimationFrame(t)},ya=t=>{const a=I.value;a&&a.style.setProperty("--dss-animation-progress",t)},ka=()=>{It.value.isAnimating=!1,It.value.hasAnimated=!0,en.value&&(Bn.value=1),It.value.animationId&&(cancelAnimationFrame(It.value.animationId),It.value.animationId=null)},Jo=e.computed(()=>!Cl.value||It.value.hasAnimated?!0:en.value?Bn.value>=1:Pl.value?An.value>=1:!0),aa=e.computed(()=>O.value&&Jo.value),Fo=e.ref(!1);e.watch(aa,t=>{t?(Fo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Fo.value=!0})})):Fo.value=!1},{immediate:!0});const Ca=e.computed(()=>{if(!St.value||_n.value||It.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${S.value}ms`,t["--dss-animation-easing"]=ba(V.value),t["--dss-stagger-delay"]=`${Y.value}ms`,t}),ba=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",wa=()=>{if(!St.value||_n.value)return"";const t=["dss-chart-animated"];return It.value.hasAnimated||t.push(`dss-animate-${ll.value}`),It.value.hasAnimated||(Cl.value&&be.value!=="semi-radial"?t.push("dss-animate-fill"):Cl.value||t.push(`dss-animate-${ll.value}`)),It.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>F.series,(t,a)=>{le.value&&a&&It.value.hasAnimated&&(It.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>oa(),C.value)}))},{deep:!0}),e.watch(()=>oe.value.isZooming,(t,a)=>{a&&!t&&setTimeout(()=>{Pn()},50)}),e.watch(()=>[oe.value.scale,oe.value.offsetX],()=>{!oe.value.isZooming&&!oe.value.isDragging&&Pn()},{flush:"post"}),e.watch([Ot,We],([t,a])=>{oe.value.minScale=t,oe.value.maxScale=a,(oe.value.scale<t||oe.value.scale>a)&&uo()},{immediate:!0}),e.watch(()=>F.locale,t=>{t&&t!==A.value&&(A.value=t)},{immediate:!0}),e.watch(()=>vt.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",io)}):document.removeEventListener("click",io)}),e.onMounted(()=>{de.value=null,en.value&&(!St.value||_n.value)&&(Bn.value=1),x(),I.value&&typeof ResizeObserver<"u"&&(f=new ResizeObserver(t=>{const a=t[0];!a||!a.contentRect||(we&&cancelAnimationFrame(we),we=requestAnimationFrame(()=>{we=null;const{width:l,height:i}=a.contentRect;ct.value=Math.round(l),Q.value=Math.round(i),ve.value&&(Me.value=ve.value.offsetHeight||Ce)}))}),f.observe(I.value)),St.value&&!_n.value?be.value==="semi-radial"?setTimeout(()=>Xo(),C.value):setTimeout(()=>oa(),C.value):(It.value.hasAnimated=!0,be.value==="semi-radial"&&(An.value=1)),document.addEventListener("mousemove",sa),document.addEventListener("mouseup",ra),document.addEventListener("click",Eo)}),e.onUnmounted(()=>{we&&cancelAnimationFrame(we),f&&I.value&&(f.unobserve(I.value),f.disconnect(),f=null),It.value.animationId&&cancelAnimationFrame(It.value.animationId),Zn&&(cancelAnimationFrame(Zn),Zn=null),oe.value.zoomTimeout&&clearTimeout(oe.value.zoomTimeout),document.removeEventListener("mousemove",sa),document.removeEventListener("mouseup",ra),document.removeEventListener("click",Eo),document.removeEventListener("click",io)});const sa=t=>{if(oe.value.isDragging&&oe.value.scale>1&&Sl.value){st.value.show=!1;const a=t.clientX-oe.value.lastMouseX,{minX:l,maxX:i}=Ut.value,p=i-l||1,b=a*.8;oe.value.offsetX+=b;const w=p/oe.value.scale,P=p-w,N=0,T=-P/p*z.value.width,B=N;oe.value.offsetX=Math.max(T,Math.min(B,oe.value.offsetX)),oe.value.lastMouseX=t.clientX,oe.value.lastMouseY=t.clientY}},ra=()=>{oe.value.isDragging&&(oe.value.isDragging=!1,setTimeout(()=>{!oe.value.isDragging&&oe.value.isZooming},100))},xa=(t,a)=>{const l=t.filter(w=>w!=null);if(!l||l.length===0)return{x:0,y:0};if(l.length===1||a<=0)return l[0];if(a>=1)return l[l.length-1];let i=0;const p=[];for(let w=1;w<l.length;w++){const P=l[w].x-l[w-1].x,N=l[w].y-l[w-1].y,T=Math.sqrt(P*P+N*N);p.push(T),i+=T}const g=i*a;let b=0;for(let w=0;w<p.length;w++){const P=b+p[w];if(g<=P){const N=(g-b)/p[w],T=l[w],B=l[w+1];return{x:T.x+(B.x-T.x)*N,y:T.y+(B.y-T.y)*N}}b=P}return l[l.length-1]};return(t,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[wa(),{"dss-chart-fill-width":Ze.value,"dss-chart-fill-height":qe.value,"dss-chart-compact":Cl.value&&!K.value}]]),style:e.normalizeStyle({width:Ze.value?"100%":xe.value+"px",height:lt.value,...Ze.value||qe.value?{overflow:Cl.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Ca.value,cursor:Zo()}),"data-chart-type":be.value,ref_key:"containerEl",ref:I,onWheel:So,onMousedown:co,onMousemove:zl,onMouseup:Vo,onMouseleave:In,onDblclick:uo,onContextmenu:e.withModifiers(Ln,["prevent"]),onClick:e.withModifiers(Wl,["left"]),onWheelCapture:So},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:ve},[e.createElementVNode("div",bs,[ut.value?(e.openBlock(),e.createElementBlock("div",ws,e.toDisplayString(ut.value),1)):e.createCommentVNode("",!0),Ct.value?(e.openBlock(),e.createElementBlock("div",xs,e.toDisplayString(Ct.value),1)):e.createCommentVNode("",!0)]),K.value&&ye.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":ye.value==="top","dss-legend-bottom":ye.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":at.value.has(i),"dss-legend-hovered":de.value===i,"dss-legend-dimmed":de.value!==null&&de.value!==i}]),onClick:p=>Ko(i),onMouseenter:p=>Il(i),onMouseleave:il,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",Ss,e.toDisplayString(l.name),1)],46,Es))),128))],2)):e.createCommentVNode("",!0),K.value&&(ye.value==="left"||ye.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":ye.value==="left","dss-legend-right":ye.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":at.value.has(i),"dss-legend-hovered":de.value===i,"dss-legend-dimmed":de.value!==null&&de.value!==i}]),onClick:p=>Ko(i),onMouseenter:p=>Il(i),onMouseleave:il,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",Ns,e.toDisplayString(l.name),1)],46,Vs))),128))],2)):e.createCommentVNode("",!0)],512),H.showAddMarkerButton&&ht.value&&yt.value.addMarker&&(Sl.value||jt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:xo,title:e.unref(M)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:_t.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,Ms),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,Bs)):e.createCommentVNode("",!0),e.createElementVNode("div",_s,[jt.value&&Et.value?(e.openBlock(),e.createElementBlock("div",$s,"Bubble size: "+e.toDisplayString(Et.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:xe.value,height:ee.value,class:"dss-chart-svg","data-smooth":fe.value,"data-animated":St.value,ref_key:"svgEl",ref:$},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:U.value},[e.createElementVNode("rect",{x:0,y:z.value.top,width:xe.value,height:z.value.height*4},null,8,Ts)],8,As),Pl.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Kn.value},[e.createElementVNode("path",{d:Vn.value},null,8,Hs)],8,Ds)):e.createCommentVNode("",!0),en.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:Tn.value},[e.createElementVNode("path",{d:Wn.value},null,8,Fs)],8,Rs)):e.createCommentVNode("",!0)]),Sl.value||jt.value?(e.openBlock(),e.createElementBlock("g",Is,[qt.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":pe.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ao.value,(l,i)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${i}`,x1:z.value.left,x2:z.value.right,y1:l.y,y2:l.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${i*50}ms`})},null,12,Ps))),128))],8,zs)):e.createCommentVNode("",!0),e.createElementVNode("g",Os,[e.createElementVNode("line",{x1:z.value.left,x2:z.value.right,y1:z.value.bottom,y2:z.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,qs),e.createElementVNode("line",{x1:z.value.left,x2:z.value.left,y1:z.value.top,y2:z.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Ws),Rl.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:z.value.right,x2:z.value.right,y1:z.value.top,y2:z.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Zs)):e.createCommentVNode("",!0)]),e.createElementVNode("g",Us,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${i}`,x:l.x,y:l.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},e.toDisplayString(l.text),13,Xs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${i}`,x:l.x,y:l.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(l.text),13,Ys))),128)),Rl.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(r.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-secondary-${i}`,x:l.x,y:l.y,"text-anchor":"start","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(l.text),13,js))),128)):e.createCommentVNode("",!0),Ht.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:z.value.left+z.value.width/2,y:z.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(Ht.value),9,Ks)):e.createCommentVNode("",!0),Pt.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:15,y:z.value.top+12+z.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${z.value.top+z.value.height/2})`},e.toDisplayString(Pt.value),9,Gs)):e.createCommentVNode("",!0),Rl.value&&ge.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:xe.value-15,y:z.value.top+12+z.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(90, ${xe.value-15}, ${z.value.top+z.value.height/2})`},e.toDisplayString(ge.value),9,Qs)):e.createCommentVNode("",!0)]),Jl.value.length>0?(e.openBlock(),e.createElementBlock("g",Js,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jl.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":pe.value},[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.x,y1:z.value.bottom,y2:z.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>bo(l,i),onMouseleave:wo},null,40,tr)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:z.value.bottom,y2:z.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>bo(l,i),onMouseleave:wo},null,40,lr)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:z.value.bottom,y2:z.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>bo(l,i),onMouseleave:wo},null,40,nr)):e.createCommentVNode("",!0)],8,er),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,z.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>bo(l,i),onMouseleave:wo},null,40,or)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,z.value.top-10),r:"14",fill:l.hasManual&&l.hasAuto||l.hasManual?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:i=>bo(l,i),onMouseleave:wo},null,40,ar),e.createElementVNode("text",{x:l.x,y:Math.max(15,z.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(l.totalCount),9,sr)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":pe.value},[Ul.value?(e.openBlock(),e.createElementBlock("g",ir,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":Jt.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ve.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${i}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>Rn(l,p),onMouseleave:wn},null,46,cr)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>Rn(l,p),onMouseleave:wn},null,46,ur))],64))),128))],2),e.createElementVNode("g",dr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Fe.value+2:Fe.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,mr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Fe.value+2:Fe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:l.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,pr))),128)),ft.value>0||J.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ae.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:l.x,cy:l.y,r:X(l.isHighlighted?Z(l,ft.value)+2:Z(l,ft.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>Rn(l,p),onMouseleave:wn},null,46,fr))),128)):e.createCommentVNode("",!0)])])):be.value==="line"?(e.openBlock(),e.createElementBlock("g",vr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:l.path,stroke:l.color,"stroke-width":Fe.value,"stroke-dasharray":l.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":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,gr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Fe.value+2:Fe.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,hr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Fe.value+2:Fe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:l.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,yr))),128)),ft.value>0||J.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(E.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:l.x,cy:l.y,r:X(l.isHighlighted?Z(l,ft.value)+2:Z(l,ft.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>Rn(l,p),onMouseleave:wn},null,46,kr))),128)):e.createCommentVNode("",!0)])):be.value==="area"?(e.openBlock(),e.createElementBlock("g",Cr,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie.value,(l,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${H.chartId}`},[e.createElementVNode("rect",{x:z.value.left-10,y:z.value.top-10,width:z.value.width+20,height:z.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${z.value.width+20}px`})},null,12,wr)],8,br))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?re.value+.2:re.value,mask:`url(#area-mask-${i}-${H.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden})},null,10,xr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?Fe.value+1:Fe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${i*Y.value}ms`})},null,14,Er))),128))])):be.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":Jt.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ve.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${i}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>Rn(l,p),onMouseleave:wn},null,46,Sr)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>Rn(l,p),onMouseleave:wn},null,46,Vr))],64))),128))],2)):e.createCommentVNode("",!0)],8,rr),Ke.value&&st.value.show&&!oe.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":pe.value},[e.createElementVNode("line",{x1:st.value.x,x2:st.value.x,y1:z.value.top,y2:z.value.bottom,stroke:Tt.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Br),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(st.value.data,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:st.value.x,cy:l.y,r:X(ft.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,Mr))),128))],8,Nr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),jt.value?(e.openBlock(),e.createElementBlock("g",_r,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[l?(e.openBlock(),e.createElementBlock("g",$r,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:X(l.radius),fill:l.color,"fill-opacity":sl(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(ul(l,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>Xl(l,p),onMouseleave:p=>yo(l),onClick:p=>cl(l,p)},null,42,Lr),l.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:l.x-l.radius*.65,y:l.y-l.radius*.65,width:l.radius*1.3,height:l.radius*1.3,"xlink:href":l.imageUrl,class:e.normalizeClass(`dss-bubble-image-${i} ${l.isHighlighted?"dss-bubble-highlighted":""} ${l.isDimmed?"dss-bubble-dimmed":""} ${l.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${l.radius*.65}px at ${l.radius*.65}px ${l.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:vl(l)}),onLoad:p=>Mo(i),onError:p=>po(i),onMouseenter:p=>Xl(l,p),onMouseleave:p=>yo(l),onClick:p=>cl(l,p)},null,46,Ar)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),Cl.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:tl.value},[be.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Ft.value,cy:wt.value,r:it.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,Dr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":be.value,"clip-path":No.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bl.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${l.originalIndex}-${i}`,d:l.segment.path,fill:l.segment.color,"fill-opacity":l.segment.isHighlighted?(l.segment.opacity||.8)+.2:l.segment.opacity||.8,stroke:l.segment.strokeWidth?l.segment.strokeColor||l.segment.color:"none","stroke-width":l.segment.strokeWidth||0,"clip-path":Uo(l.originalIndex),class:e.normalizeClass({"dss-series-highlighted":l.segment.isHighlighted,"dss-series-dimmed":l.segment.isDimmed,"dss-series-hidden":l.segment.isHidden}),onMouseover:p=>Rn(l.segment,p),onMouseleave:wn},null,42,Rr))),128))],8,Hr),Qe.value&&Jo.value?(e.openBlock(),e.createElementBlock("g",Fr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($n.value,(l,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${i}`,x:l.x,y:l.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label",style:e.normalizeStyle({fill:l.contrastColor})},e.toDisplayString(l.value),13,Ir)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),Dt.value&&(Jo.value||Pl.value||On.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:Nl.value.x,y:Nl.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Dl.value,fill:Ol.value,class:"dss-radial-data-center"},e.toDisplayString(nl.value),9,zr)):e.createCommentVNode("",!0),aa.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Fo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fl.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${i}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":l.isHighlighted,"dss-label-dimmed":l.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${i*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:l.pointerStartX,y1:l.pointerStartY,x2:l.pointerEndX,y2:l.pointerEndY,stroke:l.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":l.pointerLineLength})},null,12,Pr),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:l.pointerEndX,y1:l.pointerEndY,x2:l.horizontalEndX,y2:l.horizontalEndY,stroke:l.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":l.horizontalLineLength})},null,12,Or),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":_.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,qr)],6))),128))],2)):e.createCommentVNode("",!0)],8,Tr)):e.createCommentVNode("",!0),Ll.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:tl.value},[qt.value?(e.openBlock(),e.createElementBlock("g",Zr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:Ft.value,cy:wt.value,r:X(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,Ur))),128)),e.createElementVNode("g",Xr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:Ft.value-16,y:wt.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Yr),e.createElementVNode("text",{x:Ft.value,y:wt.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Bt(i)),9,jr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ko.value,(l,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:Ft.value,x2:l.x,y1:wt.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,Kr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Gr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jn.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:l.x+Math.cos(i*2*Math.PI/Mn.value-Math.PI/2)*16,y:l.y+Math.sin(i*2*Math.PI/Mn.value-Math.PI/2)*16,"text-anchor":l.anchor,"dominant-baseline":l.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${i*120}ms`})},e.toDisplayString(l.text.charAt(0).toUpperCase()+l.text.slice(1)),13,Qr))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:na,onMouseleave:wn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nn.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":fn("current",l,i),stroke:l.color,"stroke-width":l.isHighlighted?Fe.value+1:Fe.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${i*Y.value}ms`,transition:"all 0.2s ease"})},null,14,Jr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.dataPoints,(p,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${i}-${g}`,cx:p.x,cy:p.y,r:X(l.isHighlighted?ft.value+1:ft.value>0?ft.value:0),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${i*Y.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:b=>Rn(p,b),onMouseleave:wn},null,46,ei))),128))]))),128))],32)],8,Wr)):e.createCommentVNode("",!0),e.createElementVNode("g",ti,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ho.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:l.x,cy:l.y,r:X(l.width/2),fill:c(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,li))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ho.value,(l,i)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${i}`,x:l.x-l.width/2,y:l.y-l.height/2,width:l.width,height:l.height,"xlink:href":l.url,onLoad:p=>va(i),onError:p=>ga(i),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${i}`),"clip-path":`circle(${l.width/2}px at ${l.width/2}px ${l.height/2}px)`,style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,46,ni))),128))])],8,Ls))]),an.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:ee.value+"px",backgroundImage:`url('${D.value}')`,backgroundRepeat:"no-repeat",...Fl.value,opacity:Tl.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gn.value,(l,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+l.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:l.x+"px",top:l.y+"px",width:Al.value+"px",height:Al.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>y(l),["stop"]),onMouseenter:p=>To(l,p),onMouseleave:jo},[e.createElementVNode("img",{src:cn(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,ai)],44,oi)),[[e.vShow,dl.value]])),128)),ml.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:ml.value.x+"px",top:ml.value.y+"px"})},[e.createElementVNode("div",si,e.toDisplayString(ml.value.categoryValue),1),ml.value.description?(e.openBlock(),e.createElementBlock("div",ri,e.toDisplayString(ml.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Ue.value&&(kt.value.show||Ke.value&&st.value.show&&!oe.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Ke.value&&st.value.show&&!oe.value.isZooming,"dss-spider-tooltip":Ll.value&&kt.value.spiderAreas&&kt.value.spiderAreas.length>0}]),style:e.normalizeStyle(ha.value)},[!Ke.value||!st.value.show||oe.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Ll.value&&kt.value.spiderAreas&&kt.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",ii,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kt.value.spiderAreas,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${i}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",ci,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createTextVNode(" "+e.toDisplayString(l.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.points,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${i}-${g}`,class:"dss-tooltip-series"},[e.createElementVNode("span",ui,e.toDisplayString(p.label),1),e.createElementVNode("span",di,e.toDisplayString(p.value),1)]))),128))]))),128))])):jt.value&&kt.value.bubbleData&&kt.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",mi,[kt.value.title?(e.openBlock(),e.createElementBlock("div",pi,e.toDisplayString(kt.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",fi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kt.value.bubbleData,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",vi,[e.createElementVNode("div",gi,e.toDisplayString(kt.value.title),1),e.createElementVNode("div",hi,e.toDisplayString(kt.value.value),1)])),kt.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[yl(kt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",yi,[a[5]||(a[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ki,e.toDisplayString(e.unref(M)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yl(kt.value.categoryIndex).flagGroups,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",Ci,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",bi,[e.createElementVNode("div",wi,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),yl(kt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",xi,[a[6]||(a[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ei,e.toDisplayString(e.unref(M)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yl(kt.value.categoryIndex).markers,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",Si,[e.createElementVNode("div",Vi,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",Ni,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Bi,[e.createElementVNode("div",Mi,e.toDisplayString(jt.value?bn():H.categories[st.value.categoryIndex]||`Category ${st.value.categoryIndex+1}`),1),jt.value?(e.openBlock(),e.createElementBlock("div",_i,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(st.value.data,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(st.value.data,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",$i,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",Li,e.toDisplayString(Wt(l.value)),1)]))),128))]),yl(st.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Ai,[a[7]||(a[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ti,e.toDisplayString(e.unref(M)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yl(st.value.categoryIndex).flagGroups,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",Di,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Hi,[e.createElementVNode("div",Ri,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),yl(st.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Fi,[a[8]||(a[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ii,e.toDisplayString(e.unref(M)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yl(st.value.categoryIndex).markers,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",zi,[e.createElementVNode("div",Pi,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",Oi,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Sl.value&&et.value&&oe.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:uo},[a[9]||(a[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(oe.value.scale*100))+"% "+e.toDisplayString(e.unref(M)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Cs),K.value&&ye.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,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":at.value.has(i),"dss-legend-hovered":de.value===i,"dss-legend-dimmed":de.value!==null&&de.value!==i}]),onClick:p=>Ko(i),onMouseenter:p=>Il(i),onMouseleave:il,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",Wi,e.toDisplayString(l.name),1)],46,qi))),128))],2)):e.createCommentVNode("",!0),vt.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:vt.value.x+"px",top:vt.value.y+"px"}),onClick:a[0]||(a[0]=e.withModifiers(()=>{},["stop"]))},[yt.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:ro},e.toDisplayString(e.unref(M)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),yt.value.addMarker&&(yt.value.downloadSvg||yt.value.downloadPng||yt.value.downloadCsv||Mt.value.length>0)?(e.openBlock(),e.createElementBlock("div",Zi)):e.createCommentVNode("",!0),yt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:_l},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),yt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Hl},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),yt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:ql},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Mt.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[yt.value.downloadSvg||yt.value.downloadPng||yt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Ui)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Mt.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[l.separator?(e.openBlock(),e.createElementBlock("div",Xi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Xn(l)),style:e.normalizeStyle(Yn(l)),onClick:p=>En(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:pl(l),class:"dss-custom-menu-content"},null,8,ji)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",Ki,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,Yi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Ae.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:At},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Gi,[e.createElementVNode("h3",null,e.toDisplayString(el.value?e.unref(M)("chart.modalMarker.viewMarker"):Bl.value?e.unref(M)("chart.modalMarker.editMarker"):e.unref(M)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:At},"×")]),e.createElementVNode("div",Qi,[e.createElementVNode("div",Ji,[e.createVNode(ta,{id:"dss-marker-date",mode:"single",modelValue:Ae.value.date,"onUpdate:modelValue":a[1]||(a[1]=l=>Ae.value.date=l),"min-date":so.value,"max-date":al.value,disabled:el.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",ec,[e.createElementVNode("label",tc,e.toDisplayString(e.unref(M)("chart.modalMarker.description")),1),el.value?(e.openBlock(),e.createElementBlock("div",lc,e.toDisplayString(Ae.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":a[2]||(a[2]=l=>Ae.value.description=l),placeholder:e.unref(M)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,nc)),[[e.vModelText,Ae.value.description]])])]),e.createElementVNode("div",oc,[e.createElementVNode("div",ac,[Bl.value&&!el.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:Zl},e.toDisplayString(e.unref(M)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",sc,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:At},e.toDisplayString(el.value?e.unref(M)("chart.modalMarker.close"):e.unref(M)("chart.modalMarker.cancel")),1),el.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:kn,disabled:!(Ae.value.description&&Ae.value.description.length)},e.toDisplayString(Bl.value?e.unref(M)("chart.modalMarker.save"):e.unref(M)("chart.contextMenu.addMarker")),9,rc))])])])])):e.createCommentVNode("",!0)],64))}}),uc={class:"dss-modal-title"},dc={class:"dss-modal-actions"},ea={__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(H,{emit:ne}){const M=H,A=ne,ue=e.ref(null),I=e.ref(null),$=e.computed(()=>{const U={"max-width":M.width};return M.height!=="auto"&&(U.height=M.height,U["min-height"]="0"),U}),ve=e.computed(()=>({}));function ct(){A("close-modal")}function Q(){M.backDrop&&!ue.value&&A("close-modal")}function f(U){U.target.tagName==="INPUT"&&(ue.value=U.target.tagName)}function we(){setTimeout(()=>{ue.value=null},300)}function Ce(){const U=document.body,pe=document.documentElement;I.value={bodyOverflow:U.style.overflow,bodyPosition:U.style.position,bodyTop:U.style.top,bodyWidth:U.style.width,htmlOverflow:pe.style.overflow,scrollY:window.scrollY},U.style.overflow="hidden",U.style.position="fixed",U.style.top=`-${I.value.scrollY}px`,U.style.width="100%",U.style.left="0",pe.style.overflow="hidden"}function G(){if(!I.value)return;const U=document.body,pe=document.documentElement,{bodyOverflow:F,bodyPosition:Ee,bodyTop:De,bodyWidth:tt,htmlOverflow:pt,scrollY:W}=I.value;U.style.overflow=F||"",U.style.position=Ee||"",U.style.top=De||"",U.style.width=tt||"",U.style.left="",pe.style.overflow=pt||"",window.scrollTo(0,W||0)}return e.watch(()=>M.showModal,U=>{if(U)Ce(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const pe=document.getElementById("dss-modal-backdrop");pe&&(pe.addEventListener("focusin",f),pe.addEventListener("focusout",we))},100);else{G(),document.body.classList.remove("dss-modal-open");const pe=document.getElementById("dss-modal-backdrop");pe&&(pe.removeEventListener("focusin",f),pe.removeEventListener("focusout",we))}},{immediate:!0}),e.onUnmounted(()=>{M.showModal&&G()}),(U,pe)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[H.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:Q},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle($.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:pe[0]||(pe[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":H.headerType,"font-size":H.titleSize})},[e.createElementVNode("h1",uc,[e.renderSlot(U.$slots,"title",{},()=>[pe[1]||(pe[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(U.$slots,"title-data"),H.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:ct,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(ve.value)},[e.renderSlot(U.$slots,"content",{},()=>[pe[2]||(pe[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",dc,[e.renderSlot(U.$slots,"actions")])])],4),[[e.vShow,H.showModal]])])):e.createCommentVNode("",!0)]))}},mc={key:0,class:"dss-table-toolbar"},pc={class:"dss-table-toolbar-left"},fc=["aria-expanded"],vc={class:"dss-pagination-select-dropdown",role:"listbox"},gc={class:"dss-table-column-visibility-label"},hc={class:"dss-table-checkbox-wrapper"},yc=["checked","onChange"],kc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Cc={class:"dss-table-column-visibility-text"},bc={class:"dss-table-toolbar-right"},wc=["placeholder","aria-label"],xc=["aria-label"],Ec=["aria-label","aria-expanded"],Sc={key:1,class:"dss-table-toolbar-extra"},Vc={class:"dss-table-thead"},Nc={key:0,class:"dss-table-th dss-table-selection-column"},Bc={key:0,class:"dss-table-checkbox-wrapper"},Mc=["checked","indeterminate"],_c={key:0,class:"dss-table-checkbox__indeterminate"},$c={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Lc=["aria-label"],Ac=["onClick"],Tc={class:"dss-table-th-content"},Dc={class:"dss-table-th-text"},Hc={key:0},Rc={key:1},Fc={key:2},Ic=["data-filter-column-key","aria-expanded","aria-label","onClick"],zc={class:"dss-table-tbody"},Pc=["onClick"],Oc={class:"dss-table-checkbox-wrapper"},qc=["type","name","checked","disabled","onChange"],Wc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Zc={key:1,class:"dss-table-checkbox__dot"},Uc=["onClick"],Xc=["aria-expanded","aria-label"],Yc={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},jc={key:0,class:"dss-table-expansion-row"},Kc=["colspan"],Gc=["colspan"],Qc={key:1,class:"dss-table-pagination"},Jc={class:"dss-table-pagination-left"},eu={key:0},tu={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},lu={class:"dss-table-pagination-center"},nu={key:0,class:"dss-pagination-controls"},ou=["disabled","title"],au=["disabled","title"],su=["aria-label","onKeydown"],ru={class:"dss-pagination-of"},iu=["disabled","title"],cu=["disabled","title"],uu={class:"dss-table-pagination-right"},du={class:"dss-pagination-rows-label"},mu=["aria-expanded"],pu=["aria-selected","onClick"],fu={key:0,class:"dss-table-filter-row"},vu=["value","placeholder"],gu=["min","max","value"],hu=["min","max","value"],yu={class:"dss-table-filter-double-range-values"},ku={key:2,class:"dss-table-filter-daterange"},Cu={class:"dss-table-filter-daterange-row"},bu={class:"dss-table-filter-daterange-label"},wu=["value"],xu={class:"dss-table-filter-daterange-row"},Eu={class:"dss-table-filter-daterange-label"},Su=["value"],Vu=["value","placeholder"],Nu={class:"dss-table-filter-list"},Bu=["checked","onChange"],Mu={class:"dss-table-filter-actions"},_u={name:"DSSTable"},$u=Object.assign(_u,{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:H=>typeof H=="object"&&H!==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(H,{emit:ne}){const{t:M,locale:A}=lo.useI18n(),ue=H,I=ne,$={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 ve(y,h){const x=Object.assign({},y);return ct(y)&&ct(h)&&Object.keys(h).forEach(q=>{ct(h[q])?q in y?x[q]=ve(y[q],h[q]):Object.assign(x,{[q]:h[q]}):Object.assign(x,{[q]:h[q]})}),x}function ct(y){return y&&typeof y=="object"&&!Array.isArray(y)}const Q=e.computed(()=>ve($,ue.options)),f=e.computed(()=>{const y=Q.value.table.width;return y==="auto"?null:typeof y=="number"?y:null}),we=e.computed(()=>Q.value.table.height),Ce=e.computed(()=>Q.value.table.rowHeight??"auto"),G=e.computed(()=>({height:Ce.value})),U=e.computed(()=>Q.value.table.expandable===!0),pe=e.computed(()=>Q.value.table.expandableRowData??null),F=e.computed(()=>Q.value.table.expandableRowCondition??null),Ee=e.computed(()=>Q.value.table.truncated===!0),De=e.computed(()=>Q.value.table.striped),tt=e.computed(()=>Q.value.table.bordered),pt=e.computed(()=>Q.value.table.hoverable),W=e.computed(()=>Q.value.table.size),Ze=e.computed(()=>Q.value.table.align||"left");e.computed(()=>Q.value.title.text),e.computed(()=>Q.value.subtitle.text);const qe=e.computed(()=>Q.value.selection.enabled),xe=e.computed(()=>Q.value.selection.mode),Me=e.computed(()=>Q.value.selection.rowCondition??null),Ye=e.computed(()=>Q.value.sorting.enabled),ee=e.computed(()=>Q.value.sorting.mode),lt=e.computed(()=>Q.value.pagination.enabled),be=e.computed(()=>Q.value.pagination.rows),Je=e.computed(()=>Q.value.pagination.rowsPerPageOptions),ut=e.computed(()=>Q.value.pagination.showCounter!==!1),Ct=e.computed(()=>Q.value.pagination.showControlsGroup),Et=e.computed(()=>Ct.value===!1?!1:Q.value.pagination.showControls!==!1),Ht=e.computed(()=>Ct.value===!1?!1:Q.value.pagination.showRowsPerPage!==!1),Pt=e.computed(()=>lt.value&&(ut.value||Et.value||Ht.value)),se=e.computed(()=>Q.value.scrollable),ge=e.computed(()=>Q.value.emptyMessage||M("table.emptyMessage")),He=e.computed(()=>Q.value.toolbar?.downloads?.pdf!==!1),_e=e.computed(()=>Q.value.toolbar?.downloads?.excel!==!1),Xt=e.computed(()=>Q.value.toolbar?.search!==!1),bt=e.computed(()=>He.value||_e.value||Xt.value||Gt.value),Gt=e.computed(()=>Q.value.toolbar?.columnVisibility!==!1),Lt=e.ref(""),qt=e.ref(!1),K=e.ref(null);let ye=null;function Be(){qt.value?(ye&&(clearTimeout(ye),ye=null),qt.value=!1,Lt.value="",I("search",""),K.value?.blur()):(qt.value=!0,ye=setTimeout(()=>{ye=null,K.value?.focus()},80))}function Ue(){Lt.value||(qt.value=!1)}function Ke(){Lt.value="",I("search",""),K.value?.focus()}const Tt=e.computed(()=>({"dss-table-striped":De.value,"dss-table-bordered":tt.value,"dss-table-hoverable":pt.value,[`dss-table-${W.value}`]:W.value!=="default","dss-table-truncated":Ee.value})),et=(y,h)=>y?.field??y?.key??h,Ot=e.ref(new Set);function We(){const y=new Set;return ue.columns.forEach((h,x)=>{h?.hidden!==!0&&y.add(et(h,x))}),y}function Fe(){const y=new Set;return ue.columns.forEach((h,x)=>{y.add(et(h,x))}),y}function xt(y){if(!Array.isArray(y))return null;const h=Fe(),x=[];return y.forEach(q=>{h.has(q)&&x.push(q)}),x}function ft(){Ot.value=We()}const J=e.computed(()=>{const y=xt(ue.columnVisibility);return y===null?null:new Set(y)}),Z=e.computed(()=>J.value??Ot.value),X=e.computed(()=>ue.columns.filter((y,h)=>Z.value.has(et(y,h)))),re=y=>{const h=ue.columns.findIndex(x=>x===y);return et(y,h>=0?h:0)},fe=(y,h)=>Z.value.has(et(y,h));function Ge(y){I("update:columnVisibility",Array.from(y))}function Nt(y,h){const x=et(y,h),q=new Set(Z.value);q.has(x)?q.delete(x):q.add(x),J.value===null&&(Ot.value=q),Ge(q)}const rl=e.ref(null),St=e.ref(!1);function ll(y){rl.value&&!rl.value.contains(y.target)&&(St.value=!1)}const S=e.computed(()=>X.value.length+(qe.value?1:0)+(U.value?1:0)),C=(y,h)=>y?.id??y?.key??h,V=e.ref(new Set),Y=e.ref(null),le=(y,h)=>V.value.has(C(y,h)),ze=(y,h)=>{if(!U.value)return!1;if(typeof F.value=="function")return!!F.value(y,h);if(typeof pe.value=="string"&&pe.value.trim()){const x=At(y,pe.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},gt=(y,h,x)=>{if(x&&x.stopPropagation(),!ze(y,h))return;const q=C(y,h),ie=new Set(V.value);ie.has(q)?(ie.delete(q),I("row-collapse",{data:y,index:h})):(ie.add(q),I("row-expand",{data:y,index:h})),V.value=ie},rt=(y,h)=>{if(!Ee.value)return;const x=C(y,h);Y.value!==x&&(Y.value=x)},Oe=e.ref(null),Bt=e.ref(0),Vt=e.ref([]),ht=y=>{if(ee.value==="single")return Oe.value===y.field?Bt.value:0;{const h=Vt.value.find(x=>x.field===y.field);return h?h.order:0}},yt=y=>{const h=ht(y);return{"dss-sort-active":h!==0,"dss-sort-asc":h===1,"dss-sort-desc":h===-1}},Mt=e.ref({}),_t=e.ref(null),hl=e.ref(null),Al=220,on=e.ref(null),Wt=e.computed(()=>X.value.find(y=>re(y)===_t.value)??null),dl=e.computed(()=>{if(!Wt.value||Wt.value.filter!=="range")return null;const y=Wt.value,h=_t.value,{min:x,max:q}=ce(y),ie=y.filterMin??x,mt=y.filterMax??q,Rt=Tl(h),_l=Rt.min??ie,Hl=Rt.max??mt,ql=mt-ie,En=ql===0?0:(_l-ie)/ql*100,ro=ql===0?100:(Hl-ie)/ql*100;return{rangeMin:ie,rangeMax:mt,currentMin:_l,currentMax:Hl,minPct:En,maxPct:ro}}),vn=e.ref(null),gn=e.ref("max");function an(y){const h=vn.value,x=dl.value;if(!h||!x)return;const q=h.getBoundingClientRect(),mt=(y.clientX-q.left)/q.width*100,Rt=(x.minPct+x.maxPct)/2;gn.value=mt<Rt?"min":"max"}function Tl(y){return Mt.value[y]??{}}function El(y,h){Mt.value={...Mt.value,[y]:h}}function xn(y){const h=Mt.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 sn(y){const h={...Mt.value};delete h[y],Mt.value=h,_t.value=null,hl.value=null}function Fl(){if(!_t.value){hl.value=null;return}const y=on.value;if(!y)return;const h=y.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${_t.value}"]`);if(!h)return;const x=h.getBoundingClientRect();hl.value={top:x.bottom+6,left:Math.max(8,x.right-Al)}}const Gl=e.computed(()=>{const y=String(Lt.value??"").trim().toLowerCase();return y?ue.data.filter(h=>X.value.some(x=>Ql(kn(h,x)).some(ie=>String(ie).toLowerCase().includes(y)))):ue.data}),yl=e.computed(()=>{let y=[...Gl.value];const h=(Lt.value??"").trim().toLowerCase();return h&&(y=y.filter(x=>ue.columns.some(q=>{if(!q||!q.field)return!1;const ie=kn(x,q);return String(ie??"").toLowerCase().includes(h)}))),X.value.forEach(x=>{const q=re(x),ie=Mt.value[q];if(!ie)return;const mt=x.field;if(mt){if(ie.type==="string"&&ie.value?.trim()){const Rt=ie.value.trim().toLowerCase();y=y.filter(_l=>{const Hl=kn(_l,x);return String(Hl??"").toLowerCase().includes(Rt)})}else if(ie.type==="range")y=y.filter(Rt=>{const _l=At(Rt,mt),Hl=Number(_l);return!(Number.isNaN(Hl)||ie.min!=null&&Hl<ie.min||ie.max!=null&&Hl>ie.max)});else if(ie.type==="dateRange"){const Rt=ie.from?new Date(ie.from).getTime():null,_l=ie.to?new Date(ie.to).getTime():null;y=y.filter(Hl=>{const ql=At(Hl,mt),En=ql?new Date(ql).getTime():NaN;return!(Number.isNaN(En)||Rt!=null&&En<Rt||_l!=null&&En>_l)})}else if(ie.type==="list"&&ie.selected?.length){const Rt=new Set(ie.selected);y=y.filter(_l=>Ql(kn(_l,x)).some(ql=>Rt.has(ql)))}}}),y});function Ql(y){if(y==null)return[""];if(Array.isArray(y))return y.flatMap(Ql);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 D(y){const h=new Set;return ue.data.forEach(x=>{Ql(kn(x,y)).forEach(ie=>h.add(ie))}),Array.from(h).sort((x,q)=>String(x).localeCompare(String(q)))}function O(y,h){if(_t.value===y){_t.value=null,hl.value=null;return}if(_t.value=y,h?.currentTarget){const x=h.currentTarget.getBoundingClientRect();hl.value={top:x.bottom+6,left:Math.max(8,x.right-Al)}}else Fl()}function _(y,h){El(y,{type:"string",value:h})}function ce(y){const h=y.field;if(!h)return{min:0,max:100};let x=1/0,q=-1/0;return ue.data.forEach(ie=>{const mt=At(ie,h),Rt=Number(mt);Number.isNaN(Rt)||(x=Math.min(x,Rt),q=Math.max(q,Rt))}),{min:x===1/0?0:x,max:q===-1/0?100:q}}function $e(y,h,x){const q={...Tl(y),type:"range"},ie=x===""?null:Number(x),mt=ie===null||Number.isNaN(ie)?null:ie;q[h]=mt,mt!=null&&(h==="min"&&q.max!=null&&mt>q.max&&(q.max=mt),h==="max"&&q.min!=null&&mt<q.min&&(q.min=mt)),El(y,q)}function dt(y,h,x){const q={...Tl(y),type:"dateRange"};q[h]=x||"",El(y,q)}const Qe=e.reactive({});function ot(y,h){Qe[y]=h}function Dt(y){const h=re(y),x=(Qe[h]??"").trim().toLowerCase(),q=D(y);return x?q.filter(ie=>String(ie).toLowerCase().includes(x)):q}function nl(y,h){return(Tl(y).selected??[]).includes(h!=null?String(h):"")}function Dl(y,h){const q=[...Tl(y).selected??[]],ie=h!=null?String(h):"",mt=q.indexOf(ie);mt>=0?q.splice(mt,1):q.push(ie),El(y,{type:"list",selected:q})}function Nl(y){_t.value&&!y.target.closest(".dss-table-filter-wrap")&&!y.target.closest(".dss-table-filter-dropdown")&&(_t.value=null,hl.value=null)}function Ol(){Fl(),ol.value&&st()}const $n=y=>{if(!(y.sortable===!1||!Ye.value))if(ee.value==="single")Oe.value===y.field?Bt.value=Bt.value===1?-1:Bt.value===-1?0:1:(Oe.value=y.field,Bt.value=1),Bt.value===0&&(Oe.value=null),I("sort",{field:Oe.value,order:Bt.value});else{const h=Vt.value.findIndex(x=>x.field===y.field);h>=0?Vt.value[h].order===1?Vt.value[h].order=-1:Vt.value.splice(h,1):Vt.value.push({field:y.field,order:1}),I("sort",{multiSortMeta:Vt.value})}},Jl=e.computed(()=>{if(!Ye.value)return yl.value;let y=[...yl.value];return ee.value==="single"&&Oe.value&&Bt.value!==0?y.sort((h,x)=>{const q=At(h,Oe.value),ie=At(x,Oe.value);return q===ie?0:q==null?1:ie==null?-1:(q<ie?-1:q>ie?1:0)*Bt.value}):ee.value==="multiple"&&Vt.value.length>0&&y.sort((h,x)=>{for(const q of Vt.value){const ie=At(h,q.field),mt=At(x,q.field);if(ie===mt)continue;if(ie==null)return 1;if(mt==null)return-1;const Rt=ie<mt?-1:ie>mt?1:0;if(Rt!==0)return Rt*q.order}return 0}),y}),kl=e.ref(0),Qt=e.ref(be.value),ol=e.ref(!1),rn=e.ref(null),at=e.ref(null),de=e.ref("bottom"),hn=e.ref(null),kt=y=>{Qt.value=y,ol.value=!1,kl.value=0,I("page",{page:0,rows:Qt.value})};function ml(y){rn.value&&!rn.value.contains(y.target)&&(ol.value=!1)}function st(){const y=rn.value,h=at.value;if(!y||!h)return;const x=y.querySelector(".dss-pagination-select-dropdown");if(!x)return;const q=h.getBoundingClientRect(),ie=x.offsetHeight||0,Rt=(window.innerHeight||document.documentElement.clientHeight)-q.bottom,_l=q.top;de.value=Rt<ie+8&&_l>Rt?"top":"bottom",hn.value={width:`${Math.ceil(q.width)}px`,left:`${Math.max(0,Math.round(h.offsetLeft))}px`}}const vt=e.computed(()=>Jl.value.length),oe=e.computed(()=>Math.ceil(vt.value/Qt.value)),Yt=e.computed(()=>Math.max(oe.value,1)),Ae=e.computed(()=>vt.value===0?0:al.value+1),so=e.computed(()=>Bl.value),al=e.computed(()=>lt.value?kl.value*Qt.value:0),Bl=e.computed(()=>lt.value?Math.min((kl.value+1)*Qt.value,vt.value):vt.value),el=e.computed(()=>{if(!lt.value)return Jl.value;const y=al.value,h=Bl.value;return Jl.value.slice(y,h)}),Il=e.ref(new Set),il=e.computed(()=>Jl.value.filter((y,h)=>Il.value.has(C(y,h)))),zl=(y,h)=>{const x=Me.value;return typeof x!="function"?!0:!!x(y,h)},In=e.computed(()=>Jl.value.map((y,h)=>({row:y,index:h})).filter(({row:y,index:h})=>zl(y,h))),Ln=e.computed(()=>{const y=In.value;return y.length===0?!1:y.every(({row:h,index:x})=>Il.value.has(C(h,x)))}),Wl=e.computed(()=>{const y=In.value;if(y.length===0)return!1;const h=y.filter(({row:x,index:q})=>Il.value.has(C(x,q))).length;return h>0&&h<y.length}),pl=(y,h)=>Il.value.has(C(y,h)),Xn=()=>{if(Ln.value)Il.value=new Set,I("unselect-all");else{const y=new Set;In.value.forEach(({row:h,index:x})=>y.add(C(h,x))),Il.value=y,I("select-all",il.value)}},Yn=(y,h)=>{if(!zl(y,h))return;const x=C(y,h),q=new Set(Il.value),ie=q.has(x);xe.value==="single"?ie?(q.delete(x),I("row-unselect",y)):(q.clear(),q.add(x),I("row-select",y)):ie?(q.delete(x),I("row-unselect",y)):(q.add(x),I("row-select",y)),Il.value=q},cn=e.ref("1"),zn=()=>{const y=Number.parseInt(String(cn.value),10);if(!Number.isFinite(y)){cn.value=String(kl.value+1);return}const h=Math.min(Yt.value,Math.max(1,y));h!==kl.value+1?yn(h-1):cn.value=String(h)},yn=y=>{y<0||y>=oe.value||(kl.value=y,I("page",{page:y,rows:Qt.value}))},Ml=(y,h,x)=>{I("row-click",{data:y,index:h,originalEvent:x}),rt(y,al.value+h)},Pn=(y,h)=>{const x=al.value+h;return{"dss-table-row-selected":pl(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":Y.value===C(y,x)}},kn=(y,h)=>h.field?At(y,h.field):"",At=(y,h)=>h.split(".").reduce((x,q)=>x&&x[q],y),Zl=y=>{const h=y.align??Ze.value;return{"dss-table-sortable":y.sortable!==!1&&Ye.value,"dss-table-align-left":h==="left","dss-table-align-center":h==="center","dss-table-align-right":h==="right",[y.className]:y.className}},un=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(()=>ue.locale,y=>{y&&y!==A.value&&(A.value=y)},{immediate:!0}),e.watch(be,y=>{Qt.value=y,kl.value=0}),e.watch(ol,async y=>{y&&(await e.nextTick(),st())}),e.watch(kl,y=>{cn.value=String(y+1)},{immediate:!0}),e.watch(Lt,y=>{I("search",y??"")}),e.watch(()=>ue.columns,()=>{if(J.value===null){ft();return}const y=xt(ue.columnVisibility)??[];y.length!==ue.columnVisibility.length&&I("update:columnVisibility",y)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",ml),document.addEventListener("click",ll),document.addEventListener("click",Nl),window.addEventListener("resize",Ol),window.addEventListener("scroll",Ol,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",ml),document.removeEventListener("click",ll),document.removeEventListener("click",Nl),window.removeEventListener("resize",Ol),window.removeEventListener("scroll",Ol,!0)}),(y,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:on,style:e.normalizeStyle({width:f.value+"px",height:we.value?we.value+"px":"auto"})},[bt.value?(e.openBlock(),e.createElementBlock("div",mc,[e.createElementVNode("div",pc,[He.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:h[0]||(h[0]=x=>I("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(M)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),_e.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:h[1]||(h[1]=x=>I("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(M)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Gt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:rl},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":St.value}]),onClick:h[2]||(h[2]=x=>St.value=!St.value),"aria-expanded":St.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(M)("table.columnVisibility"))+" ",1),h[24]||(h[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,fc),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",vc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.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",gc,[e.createElementVNode("span",hc,[e.createElementVNode("input",{type:"checkbox",checked:fe(x,q),onChange:ie=>Nt(x,q),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,yc),fe(x,q)?(e.openBlock(),e.createElementBlock("span",kc,[...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",Cc,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,St.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(y.$slots,"header")]),e.createElementVNode("div",bc,[Xt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":qt.value||Lt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:K,"onUpdate:modelValue":h[4]||(h[4]=x=>Lt.value=x),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(M)("table.searchPlaceholder"),"aria-label":e.unref(M)("table.searchTableAriaLabel"),onFocus:h[5]||(h[5]=x=>qt.value=!0),onBlur:Ue},null,40,wc),[[e.vModelText,Lt.value]]),Lt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(M)("table.clearSearchAriaLabel"),onClick:Ke},[...h[26]||(h[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,xc)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(M)("table.searchAriaLabel"),"aria-expanded":qt.value||!!Lt.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,Ec)],2)):e.createCommentVNode("",!0),y.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Sc,[e.renderSlot(y.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":se.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Tt.value])},[e.createElementVNode("thead",Vc,[e.createElementVNode("tr",null,[qe.value?(e.openBlock(),e.createElementBlock("th",Nc,[xe.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Bc,[e.createElementVNode("input",{type:"checkbox",checked:Ln.value,indeterminate:Wl.value,onChange:Xn,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Mc),Wl.value?(e.openBlock(),e.createElementBlock("span",_c)):Ln.value?(e.openBlock(),e.createElementBlock("span",$c,[...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),U.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(M)("table.expandRowAriaLabel")},null,8,Lc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,(x,q)=>(e.openBlock(),e.createElementBlock("th",{key:re(x),class:e.normalizeClass(["dss-table-th",Zl(x)]),style:e.normalizeStyle(un(x)),onClick:ie=>$n(x)},[e.createElementVNode("div",Tc,[e.createElementVNode("span",Dc,e.toDisplayString(x.header),1),x.sortable!==!1&&Ye.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",yt(x)])},[ht(x)===0?(e.openBlock(),e.createElementBlock("span",Hc,[...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)])])):ht(x)===1?(e.openBlock(),e.createElementBlock("span",Rc,[...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)])])):ht(x)===-1?(e.openBlock(),e.createElementBlock("span",Fc,[...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":_t.value===re(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":xn(re(x))}]),"data-filter-column-key":re(x),"aria-expanded":_t.value===re(x),"aria-label":e.unref(M)("table.filterColumnAriaLabel"),onClick:ie=>O(re(x),ie)},[...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,Ic)],2)):e.createCommentVNode("",!0)])],14,Ac))),128))])]),e.createElementVNode("tbody",zc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(el.value,(x,q)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C(x,al.value+q)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Pn(x,q)]),style:e.normalizeStyle(G.value),onClick:ie=>Ml(x,q,ie)},[qe.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",Oc,[e.createElementVNode("input",{type:xe.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${H.tableId}`,checked:pl(x,al.value+q),disabled:!zl(x,al.value+q),onChange:ie=>Yn(x,al.value+q),class:e.normalizeClass(["dss-table-checkbox",xe.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!zl(x,al.value+q)}])},null,42,qc),xe.value==="multiple"&&pl(x,al.value+q)?(e.openBlock(),e.createElementBlock("span",Wc,[...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"&&pl(x,al.value+q)?(e.openBlock(),e.createElementBlock("span",Zc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),U.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(ie=>gt(x,al.value+q,ie),["stop"])},[ze(x,al.value+q)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":le(x,al.value+q),"aria-label":le(x,al.value+q)?e.unref(M)("table.collapseRowAriaLabel"):e.unref(M)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":le(x,al.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,Xc)):(e.openBlock(),e.createElementBlock("span",Yc))],8,Uc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,(ie,mt)=>(e.openBlock(),e.createElementBlock("td",{key:re(ie),class:e.normalizeClass(["dss-table-td",Zl(ie)]),style:e.normalizeStyle(un(ie))},[e.renderSlot(y.$slots,`cell-${ie.field}`,{data:x,column:ie,rowIndex:q,isExpanded:Y.value===C(x,al.value+q)},()=>[e.createTextVNode(e.toDisplayString(kn(x,ie)),1)])],6))),128))],14,Pc),U.value&&ze(x,al.value+q)&&le(x,al.value+q)?(e.openBlock(),e.createElementBlock("tr",jc,[e.createElementVNode("td",{colspan:S.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(y.$slots,"expansion",{data:x,rowIndex:q})],8,Kc)])):e.createCommentVNode("",!0)],64))),128)),el.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(G.value)},[e.createElementVNode("td",{colspan:S.value,class:"dss-table-empty-cell"},[e.renderSlot(y.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(ge.value),1)])],8,Gc)],4))])],2)],2),Pt.value?(e.openBlock(),e.createElementBlock("div",Qc,[e.createElementVNode("div",Jc,[ut.value?(e.openBlock(),e.createElementBlock("span",eu,e.toDisplayString(e.unref(M)("table.showingRange",{start:Ae.value,end:so.value,total:vt.value})),1)):(e.openBlock(),e.createElementBlock("span",tu," "))]),e.createElementVNode("div",lu,[Et.value?(e.openBlock(),e.createElementBlock("div",nu,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:kl.value===0,onClick:h[8]||(h[8]=x=>yn(0)),title:e.unref(M)("table.firstPage")},[...h[35]||(h[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,ou),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:kl.value===0,onClick:h[9]||(h[9]=x=>yn(kl.value-1)),title:e.unref(M)("table.previousPage")}," ‹ ",8,au),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[10]||(h[10]=x=>cn.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(M)("table.currentPageAriaLabel"),onBlur:zn,onKeydown:e.withKeys(e.withModifiers(zn,["prevent"]),["enter"])},null,40,su),[[e.vModelText,cn.value]]),e.createElementVNode("span",ru,e.toDisplayString(e.unref(M)("table.ofPages",{total:Yt.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:kl.value>=oe.value-1,onClick:h[11]||(h[11]=x=>yn(kl.value+1)),title:e.unref(M)("table.nextPage")}," › ",8,iu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:kl.value>=oe.value-1,onClick:h[12]||(h[12]=x=>yn(oe.value-1)),title:e.unref(M)("table.lastPage")},[...h[36]||(h[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,cu)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",uu,[Ht.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:rn},[e.createElementVNode("span",du,e.toDisplayString(e.unref(M)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":ol.value}]),onClick:h[13]||(h[13]=x=>ol.value=!ol.value),"aria-expanded":ol.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:at},[e.createTextVNode(e.toDisplayString(Qt.value)+" ",1),h[37]||(h[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,mu),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":de.value==="top"}]),style:e.normalizeStyle(hn.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===Qt.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===Qt.value}]),onClick:q=>kt(x)},e.toDisplayString(x),11,pu))),128))],6),[[e.vShow,ol.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(hl.value?{top:hl.value.top+"px",left:hl.value.left+"px",width:Al+"px"}:void 0),onClick:h[21]||(h[21]=e.withModifiers(()=>{},["stop"]))},[Wt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Wt.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",fu,[e.createElementVNode("input",{type:"text",value:Tl(_t.value).value??"",onInput:h[14]||(h[14]=x=>_(_t.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(M)("table.search")},null,40,vu)])):Wt.value.filter==="range"&&dl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":dl.value.minPct+"%","--range-max-pct":dl.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:vn,class:"dss-table-filter-double-range-track",onMousemove:an,onMouseenter:an},[e.createElementVNode("input",{type:"range",min:dl.value.rangeMin,max:dl.value.rangeMax,value:dl.value.currentMin,onInput:h[15]||(h[15]=x=>$e(_t.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:gn.value==="min"?2:1})},null,44,gu),e.createElementVNode("input",{type:"range",min:dl.value.rangeMin,max:dl.value.rangeMax,value:dl.value.currentMax,onInput:h[16]||(h[16]=x=>$e(_t.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:gn.value==="max"?2:1})},null,44,hu)],544),e.createElementVNode("div",yu,e.toDisplayString(dl.value.currentMin)+" – "+e.toDisplayString(dl.value.currentMax),1)],4)):Wt.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",ku,[e.createElementVNode("div",Cu,[e.createElementVNode("label",bu,e.toDisplayString(e.unref(M)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:Tl(_t.value).from??"",onInput:h[17]||(h[17]=x=>dt(_t.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,wu)]),e.createElementVNode("div",xu,[e.createElementVNode("label",Eu,e.toDisplayString(e.unref(M)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:Tl(_t.value).to??"",onInput:h[18]||(h[18]=x=>dt(_t.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Su)])])):Wt.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:Qe[_t.value]??"",onInput:h[19]||(h[19]=x=>ot(_t.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(M)("table.search")},null,40,Vu),e.createElementVNode("div",Nu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt(Wt.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:nl(_t.value,x),onChange:q=>Dl(_t.value,x)},null,40,Bu),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Mu,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:h[20]||(h[20]=x=>sn(_t.value))},e.toDisplayString(e.unref(M)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,_t.value&&Wt.value&&hl.value]])]),_:1})]))],64))}}),Lu="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",Au="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",Tu="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",Du="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M9.68%2014V12.26H5.78V10.088L9.152%205.24H10.832L7.22%2010.484V10.94H9.68V8.96H11.18V14H9.68Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Hu="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",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='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",Fu={class:"dss-toolbar-left"},Iu=["title"],zu=["title"],Pu={class:"dss-toolbar-dropdown-wrapper"},Ou=["title"],qu=["src"],Wu=["src"],Zu=["src"],Uu=["src"],Xu=["src"],Yu=["src"],ju={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Ku=["src"],Gu=["src"],Qu=["src"],Ju=["src"],ed=["src"],td=["src"],ld=["title"],nd=["title"],od=["title"],ad=["title"],sd=["title"],rd=["title"],id=["title"],cd=["title"],ud=["title"],dd={key:2,class:"dss-toolbar-separator"},md=["title"],pd={key:4,class:"dss-toolbar-separator"},fd={key:5,class:"dss-toolbar-dropdown-wrapper"},vd=["title"],gd={class:"dss-toolbar-dropdown-ai"},hd={class:"dss-toolbar-right"},yd={key:0,class:"dss-toolbar-custom-group"},kd={key:1,class:"dss-toolbar-separator"},Cd={class:"dss-link-modal-content"},bd={class:"dss-link-modal-field"},wd={class:"dss-link-modal-label"},xd=["placeholder"],Ed={class:"dss-link-modal-field"},Sd={class:"dss-link-modal-label"},Vd=["placeholder"],Nd={class:"dss-image-modal-tabs"},Bd={key:0,class:"dss-image-tab-content"},Md={class:"dss-link-modal-content"},_d={class:"dss-link-modal-field"},$d={key:0,class:"dss-link-modal-label"},Ld=["src"],Ad={class:"dss-link-modal-field"},Td={class:"dss-link-modal-label"},Dd=["placeholder"],Hd={class:"dss-link-modal-field"},Rd={class:"dss-link-modal-label"},Fd=["placeholder"],Id={class:"dss-link-modal-field"},zd={class:"dss-link-modal-label"},Pd=["placeholder"],Od={key:1,class:"dss-image-tab-content"},qd={class:"dss-link-modal-content"},Wd={class:"dss-link-modal-field"},Zd={class:"dss-link-modal-label"},Ud=["placeholder"],Xd={class:"dss-link-modal-field"},Yd={class:"dss-link-modal-label"},jd=["placeholder"],Kd={class:"dss-link-modal-field"},Gd={class:"dss-link-modal-label"},Qd=["placeholder"],Jd={class:"dss-link-modal-field"},e1={class:"dss-link-modal-label"},t1=["placeholder"],l1={class:"dss-text-editor-title-input-container"},n1={key:0,class:"dss-text-editor-title-preview"},o1={key:0},a1={key:1,class:"dss-text-editor-preview-placeholder"},s1=["value","placeholder","disabled"],r1={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},i1={class:"dss-text-editor-description-input-container"},c1={key:0,class:"dss-text-editor-description-preview"},u1={key:0},d1={key:1,class:"dss-text-editor-preview-placeholder"},m1=["value","placeholder","disabled"],p1={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},f1=["data-comment-id","onMouseenter"],v1=["onClick"],g1=["src","alt"],h1={key:1},y1=["onClick"],k1=["src","alt"],C1={key:1},b1=["data-has-second-user","onClick"],w1={class:"editor-comment-marker-count"},x1={key:4,class:"dss-text-editor-textarea-wrapper"},E1=["value","placeholder","rows","disabled"],S1={class:"dss-text-editor-footer"},V1={class:"dss-text-editor-footer-content"},N1={class:"dss-text-editor-footer-stat"},B1={class:"dss-text-editor-footer-stat"},M1={key:5,class:"dss-text-editor-content-wrapper"},_1={key:0,class:"dss-comment-overlay-body"},$1={class:"dss-comment-selection-wrapper"},L1=["innerHTML"],A1={class:"dss-comment-messages-wrapper"},T1={key:0,class:"dss-comment-avatar-wrapper"},D1={class:"dss-comment-avatar"},H1=["src","alt"],R1={key:1},F1={class:"dss-comment-header"},I1={class:"dss-comment-header-text"},z1={class:"dss-comment-author"},P1={key:0,class:"dss-comment-date"},O1=["onClick","title"],q1={class:"dss-comment-overlay-inner"},W1=["placeholder","onKeydown"],Z1={class:"dss-text-editor-footer"},U1={class:"dss-text-editor-footer-content"},X1={class:"dss-text-editor-footer-stat"},Y1={class:"dss-text-editor-footer-stat"},j1=["title"],K1=["title"],G1={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:""},Q1={class:"dss-image-popup-content"},J1={key:0,class:"dss-image-popup-no-alt-icon"},em=["title"],tm=["title"],lm={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:""},nm={class:"dss-toolbar-left"},om=["title"],am=["title"],sm={class:"dss-toolbar-dropdown-wrapper"},rm=["title"],im=["src"],cm=["src"],um=["src"],dm=["src"],mm=["src"],pm=["src"],fm={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},vm=["title"],gm=["title"],hm=["title"],ym=["title"],km=["title"],Cm=["title"],bm=["title"],wm=["title"],xm=["title"],Em=["title"],Sm={key:2,class:"dss-toolbar-separator"},Vm={key:3,class:"dss-toolbar-dropdown-wrapper"},Nm=["title"],Bm={class:"dss-toolbar-dropdown-ai"},Mm={key:0,class:"dss-toolbar-right"},_m={key:0,class:"dss-toolbar-separator"},$m={key:0,class:"dss-toolbar-custom-group"},Lm={key:1,class:"dss-toolbar-separator"},Am={name:"DSSTextEditor"},Tm=Object.assign(Am,{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:H=>typeof H=="object"&&H!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:H=>typeof H=="object"&&H!==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(H,{expose:ne,emit:M}){const{t:A,locale:ue}=lo.useI18n(),I={h1:Lu,h2:Au,h3:Tu,h4:Du,h5:Hu,h6:Ru},$=H,ve=M,ct=e.useSlots(),Q=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
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 D=N.data&&N.data[g]!==void 0?N.data[g]:"";O+=","+D}),t+=O+`
98
+ `}const l=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(l),p=document.createElement("a");p.href=i,p.download=q("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(i),ql()}catch(t){console.error("Error downloading CSV:",t)}},xn=t=>{if(typeof t.action=="function"){const a={series:F.series,categories:F.categories,markers:el.value},l={chartX:ht.value.chartX,chartY:ht.value.chartY,dataX:ht.value.mouseDataX,dataY:ht.value.mouseDataY,categoryIndex:clampedCategoryIndex||ht.value.categoryIndex};t.action(a,l)}ql()},uo=()=>{bl(),Fe.value.show=!0,Fe.value.categoryIndex=ht.value.categoryIndex,Fe.value.fromButton=!1,ql()},Zo=()=>{bl(),Fe.value.show=!0,Fe.value.categoryIndex=0,Fe.value.fromButton=!0},mo=t=>{if(ht.value.show){const a=document.querySelector(".dss-context-menu");a&&!a.contains(t.target)&&(ht.value.show=!1)}},po=t=>{ht.value.show&&!t.target.closest(".context-menu")&&(ht.value.show=!1)},xo=t=>{if(!wl.value||!lt.value)return;t.preventDefault(),t.stopPropagation(),ae.value.isZooming=!0,Ke.value.show=!1,ae.value.zoomTimeout&&clearTimeout(ae.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),i=t.clientX-l.left,p=t.clientY-l.top;if(i<z.value.left-50||i>z.value.right+50||p<z.value.top-50||p>z.value.bottom+100){ae.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,b=Math.max(ae.value.minScale,Math.min(ae.value.maxScale,ae.value.scale*g));if(b!==ae.value.scale){const{minX:w,maxX:O}=Ut.value,N=O-w||1,D=N/ae.value.scale,M=w-ae.value.offsetX/z.value.width*N,te=(i-z.value.left)/z.value.width,Ve=M+te*D;ae.value.scale=b;const Xe=N/ae.value.scale,ue=Ve-te*Xe;ae.value.offsetX=-(ue-w)/N*z.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)},Uo=t=>{if(!wl.value||!lt.value||ae.value.scale<=1)return;Ke.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,ae.value.isDragging=!0,ae.value.lastMouseX=t.clientX,ae.value.lastMouseY=t.clientY,t.preventDefault()},fo=()=>{ae.value.isDragging=!1},Kn=()=>{!wl.value||!lt.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)},Xo=()=>!wl.value||!Mt.value||!lt.value?"default":ae.value.isDragging?"grabbing":ae.value.scale>1?"grab":"dss-crosshair",vo=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 l=0;l<t.length-1;l++){const i=t[Math.max(l-1,0)],p=t[l],g=t[l+1],b=t[Math.min(l+2,t.length-1)],w=p.x+(g.x-i.x)/6*et.value,O=p.y+(g.y-i.y)/6*et.value,N=g.x-(b.x-p.x)/6*et.value,D=g.y-(b.y-p.y)/6*et.value;a+=` C ${w} ${O} ${N} ${D} ${g.x} ${g.y}`}return a},Ll=e.computed(()=>{const a=W.value?.chart?.padding,l=typeof a=="number"?a:null,i=a&&typeof a=="object"?a:null,p=50;let g=p+(Dt.value?30:0)+60;if(Ul.value){const M={left:p+40,top:p+40,right:p+40,bottom:p+40};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??M.left,top:i.top??M.top,right:i.right??M.right,bottom:i.bottom??M.bottom}:M}if(xl.value){const M=!K.value,te=P.value,Ve=te?ie.value+Le.value+Math.max(24,$.value+16):0,Xe=M?12:p;let ue=0;dt.value&&(ue+=M?8:15),kt.value&&(ue+=M?6:10);const ke=nt();let Ne=Xe+(M?4:16)+(te?Ve:0),ge=Xe+(te?Ve:0);K.value&&ye.value==="left"?Ne+=ke.legendWidth||150:K.value&&ye.value==="right"&&(ge+=ke.legendWidth||150);const Pe=be.value==="semi-radial"?te?Ve:8:te?Ve:M?8:p+80,Ae=te?14:0,$e=Xe+ue+Ae,He={left:Ne,top:$e,right:ge,bottom:Pe};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??He.left,top:i.top??He.top,right:i.right??He.right,bottom:i.bottom??He.bottom}:He}let b=0;dt.value&&(b+=15),kt.value&&(b+=10);const w=nt();let O=p+16+(Ft.value?30:0),N=p+(pe.value?30:0);K.value&&ye.value==="left"?O+=w.legendWidth||150:K.value&&ye.value==="right"&&(N+=w.legendWidth||150),Kl.value&&(N+=44);const D={left:O,top:p+b,right:N,bottom:g};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??D.left,top:i.top??D.top,right:i.right??D.right,bottom:i.bottom??D.bottom}:D}),z=e.computed(()=>({left:Ll.value.left,top:Ll.value.top,right:Ee.value-Ll.value.right,bottom:ee.value-Ll.value.bottom,width:Ee.value-(Ll.value.left+Ll.value.right),height:ee.value-(Ll.value.top+Ll.value.bottom)})),wl=e.computed(()=>["line","area","bar"].includes(be.value)||tt.value),Zl=e.computed(()=>tt.value),Un=e.computed(()=>be.value==="mini-radial"),xl=e.computed(()=>["radial","semi-radial","mini-radial"].includes(be.value)),Ul=e.computed(()=>be.value==="spider"),Zt=e.computed(()=>be.value==="bubble"),Qt=e.computed(()=>W.value?.chart?.orientation==="horizontal"&&(be.value==="bar"||Zl.value)),Xl=t=>{const{minY:a,maxY:l}=Ut.value,i=l-a||1;return z.value.left+(t-a)/i*z.value.width},_n=t=>{const{maxX:a}=Ut.value,l=a+1,p=z.value.height/l;return z.value.top+(t+.5)*p},It=e.computed(()=>xl.value?Ll.value.left+(Ee.value-Ll.value.left-Ll.value.right)/2:Ee.value/2),Tt=e.computed(()=>Ul.value?ee.value/2-40:xl.value?Ll.value.top+(ee.value-Ll.value.top-Ll.value.bottom)/2:ee.value/2),it=e.computed(()=>{if(Ul.value){const t=z.value.width-80,a=z.value.height-80;return Math.min(t,a)/2}return Math.min(z.value.width,z.value.height)/2}),qt=e.computed(()=>{const t=W.value,a=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof a=="number"&&a>=0&&a<=1?a:.45;return it.value*l}),$n=e.computed(()=>{const t=W.value,a=typeof F.innerSize=="number"?F.innerSize:t?.innerSize;return typeof a!="number"||a<=-100||!(xl.value||Ul.value)?1:1+a/100}),Rn=e.computed(()=>{const t=$n.value;if(t===1||t<=0)return;const a=It.value,l=Tt.value;return`translate(${a}, ${l}) scale(${t}) translate(${-a}, ${-l})`}),Yt=e.ref(0),Gn=e.computed(()=>`semi-radial-fill-clip-${F.chartId}`),En=e.computed(()=>be.value==="semi-radial"),vn=e.computed(()=>En.value&&xt.value&&!Tn.value),sn=e.computed(()=>En.value&&xt.value&&!Tn.value&&tl.value==="fill"),Fn=e.computed(()=>{const t=vn.value?Yt.value:1,a=It.value,l=Tt.value,i=qt.value,p=it.value,g=Math.PI,b=Math.PI+t*Math.PI;if(t<=0)return`M ${a} ${l} L ${a} ${l} Z`;const w=a+p*Math.cos(g),O=l+p*Math.sin(g),N=a+p*Math.cos(b),D=l+p*Math.sin(b),M=a+i*Math.cos(b),te=l+i*Math.sin(b),Ve=a+i*Math.cos(g),Xe=l+i*Math.sin(g),ue=t>.5?1:0;return`M ${a} ${l} L ${w} ${O} A ${p} ${p} 0 ${ue} 1 ${N} ${D} L ${M} ${te} A ${i} ${i} 0 ${ue} 1 ${Ve} ${Xe} Z`}),Sn=e.computed(()=>{if(!(!En.value||!vn.value)&&!sn.value)return`url(#${Gn.value})`}),In=t=>{if(!(!sn.value||t!==0))return`url(#${Gn.value})`},Ln=e.ref(0),Eo=e.computed(()=>`radial-reveal-clip-${F.chartId}`),Rl=e.computed(()=>be.value==="radial"),So=e.computed(()=>{const t=Rl.value?Ln.value:1,a=It.value,l=Tt.value,i=Math.max(it.value*1.5,Ee.value,ee.value);if(t<=0)return`M ${a} ${l} L ${a} ${l} Z`;if(t>=1){const M=a-i,te=a+i;return`M ${M} ${l} A ${i} ${i} 0 0 1 ${te} ${l} A ${i} ${i} 0 0 1 ${M} ${l} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,b=a+i*Math.cos(p),w=l+i*Math.sin(p),O=a+i*Math.cos(g),N=l+i*Math.sin(g),D=t>=.5?1:0;return`M ${a} ${l} L ${b} ${w} A ${i} ${i} 0 ${D} 1 ${O} ${N} Z`}),Xn=e.computed(()=>{if(Sn.value)return Sn.value;if(Rl.value)return`url(#${Eo.value})`});let zn=null;const Yo=()=>{if(!vn.value)return;Yt.value=0;const t=S.value,a=performance.now(),l=i=>{const p=i-a,g=Math.min(1,p/t);Yt.value=ea(V.value,g),g<1&&(zn=requestAnimationFrame(l))};zn=requestAnimationFrame(l)},Vo=e.computed(()=>W.value?.bubbles?.minSize||8),Qn=e.computed(()=>W.value?.bubbles?.maxSize||50),Jn=e.computed(()=>W.value?.bubbles?.opacity||.7),eo=(t,a)=>{const l=[15,20,25,18,22],i=l[t%l.length]||20,p=1+Math.sin(a*.5)*.2;return Math.max(5,i*p)},jo=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.opacity="1")},No=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.display="none")},Yl=e.computed(()=>F.series),jl=e.computed(()=>F.series.filter((t,a)=>!Ht.value.has(a))),go=t=>{if(!t)return"primary";const a=t.yAxis??t.axis??t.yAxisId;return a==="secondary"||a==="right"||a===1?"secondary":"primary"},ho=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,yo=e.computed(()=>jl.value.filter(t=>go(t)==="primary")),Bo=e.computed(()=>jl.value.filter(t=>go(t)==="secondary")),Kl=e.computed(()=>!Qt.value&&!!se.value&&Bo.value.length>0),ol="auto",to=(t,a,l,i=0,p=100)=>{let g=1/0,b=-1/0;if(t.forEach(N=>{N?.data?.length&&N.data.forEach(D=>{typeof D=="number"&&Number.isFinite(D)&&(g=Math.min(g,D),b=Math.max(b,D))})}),g===1/0)return{minY:i,maxY:p};let w;if(a===ol){const N=b-g,D=N>0?N*.1:1;w=Math.max(0,g-D)}else if(typeof a=="number")w=a;else{const N=b-g,D=N>0?N*.1:1;w=Math.max(0,g-D)}let O;if(l===ol){const N=b-g,D=N>0?N*.1:2;O=b+D}else if(typeof l=="number")O=l;else{const N=b-g,D=N>0?N*.1:2;O=b+D}return{minY:w,maxY:O}},Ut=e.computed(()=>{if(Zt.value)return Ko();if(!jl.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;jl.value.forEach(l=>{l.data&&l.data.length&&(t=Math.max(t,l.data.length-1))}),F.categories.length>0&&(t=Math.max(t,F.categories.length-1));const a=to(yo.value.length?yo.value:jl.value,De.value,_e.value);return{minX:0,maxX:t,minY:a.minY,maxY:a.maxY}}),Mo=e.computed(()=>Kl.value?to(Bo.value,jt.value,Ct.value,Ut.value.minY,Ut.value.maxY):{minY:Ut.value.minY,maxY:Ut.value.maxY}),Ko=()=>{if(!jl.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,a=-1/0,l=1/0,i=-1/0,p=1/0,g=-1/0,b=!1;if(jl.value.forEach((Ve,Xe)=>{Ve?.data?.length&&Ve.data.forEach((ue,ke)=>{let Ne,ge,Qe;if(typeof ue=="object"&&ue!==null&&!Array.isArray(ue))Ne=typeof ue.x=="number"?ue.x:ke,ge=typeof ue.y=="number"?ue.y:0,Qe=typeof ue.size=="number"?ue.size:20;else if(Array.isArray(ue)&&ue.length>=3)Ne=typeof ue[0]=="number"?ue[0]:ke,ge=typeof ue[1]=="number"?ue[1]:0,Qe=typeof ue[2]=="number"?ue[2]:20;else if(typeof ue=="number")Ne=ke,ge=ue,Qe=eo(Xe,ke);else return;isFinite(Ne)&&isFinite(ge)&&isFinite(Qe)&&(t=Math.min(t,Ne),a=Math.max(a,Ne),l=Math.min(l,ge),i=Math.max(i,ge),p=Math.min(p,Qe),g=Math.max(g,Qe),b=!0)})}),!b)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)),l===i&&(l=Math.max(0,l-10),i=l+20);const w=a-t,O=i-l;let N,D,M,te;return Gt.value!==null?N=Gt.value:N=t-w*.1,$t.value!==null?D=$t.value:D=a+w*.1,De.value!==null&&typeof De.value=="number"?M=De.value:M=Math.max(0,l-O*.1),_e.value!==null&&typeof _e.value=="number"?te=_e.value:te=i+O*.1,{minX:N,maxX:D,minY:M,maxY:te,minSize:p,maxSize:g}},al=t=>{if(Zt.value){const{minX:w,maxX:O}=Ut.value,N=O-w||1;return z.value.left+(t-w)/N*z.value.width}const{minX:a,maxX:l}=Ut.value,i=l-a;if(l===0||i===0)return z.value.left+z.value.width/2;const p=i/ae.value.scale,g=a-ae.value.offsetX/z.value.width*i,b=(t-g)/p;return z.value.left+b*z.value.width},rn=t=>{const{minY:a,maxY:l}=Ut.value,i=l-a||1;return z.value.bottom-(t-a)/i*z.value.height},Ol=t=>{const{minY:a,maxY:l}=Mo.value,i=l-a||1;return z.value.bottom-(t-a)/i*z.value.height},Gl=(t,a)=>Kl.value&&go(t)==="secondary"?Ol(a):rn(a),An=t=>{if(!Zt.value)return pt.value||4;const{maxSize:a}=Ut.value,l=Math.max(1,a),i=Math.min(1,Math.max(0,t/l));return Vo.value+i*(Qn.value-Vo.value)},Vn=(t,a=12,l="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(a*.62);Vn.canvas||(Vn.canvas=document.createElement("canvas"));const i=Vn.canvas.getContext("2d");return i?(i.font=`${a}px ${l}`,i.measureText(t).width):t.length*(a*.62)},_o=(t,a,l=12)=>{if(typeof t!="string"||typeof a!="number"||a<=0||Vn(t,l)<=a)return t;const i="..";if(Vn(i,l)>=a)return i;let g=t.length;for(;g>0;){const b=`${t.slice(0,g)}${i}`;if(Vn(b,l)<=a)return b;g-=1}return i},$o=e.computed(()=>n.value.map(t=>({y:t.y}))),lo=e.computed(()=>{if(Zt.value)return o();if(be.value==="bar"){if(Qt.value){const $e=[],{minY:He,maxY:_t}=Ut.value,zt=5,en=_t-He||1;for(let hl=0;hl<=zt;hl++){const tn=He+en*(hl/zt),Io=Xl(tn);$e.push({x:Io,y:z.value.bottom+20,text:Kt(Math.round(tn))})}return $e}const ke=[],{maxX:Ne}=Ut.value,ge=Ne+1,Qe=5,Ae=(z.value.width-Qe*2)/ge;for(let $e=0;$e<=Ne;$e++){const He=z.value.left+Qe+($e+.5)*Ae;ke.push({x:He,y:z.value.bottom+20,text:_o(F.categories[$e]||_("chart.fallback.item",{number:$e+1}),Math.max(Ae-8,24))})}return ke}const t=[],{minX:a,maxX:l}=Ut.value,i=Gt.value!==null?Gt.value:a,p=$t.value!==null?$t.value:l,g=p-i||1,b=g/ae.value.scale,w=i-ae.value.offsetX/z.value.width*g,O=w+b,N=Math.max(0,Math.floor(w-2)),D=Math.min(p,Math.ceil(O+2)),M=D-N,te=z.value.width,Xe=Math.floor(te/60);let ue=1;M>Xe&&(ue=Math.ceil(M/Xe));for(let ke=N;ke<=D;ke+=ue)if(ke>=0&&ke<=p){const Ne=al(ke);Ne>=z.value.left-100&&Ne<=z.value.right+100&&t.push({x:Ne,y:z.value.bottom+20,text:F.categories[ke]||`Item ${ke+1}`})}return t}),o=()=>{const t=[],{minX:a,maxX:l}=Ut.value,i=l-a||1,p=Math.min(8,Math.max(4,Math.floor(z.value.width/80)));for(let g=0;g<=p;g++){const b=a+i*g/p,w=al(b);if(w>=z.value.left-10&&w<=z.value.right+10){const O=Math.round(b),N=F.categories?.[O];t.push({x:w,y:z.value.bottom+20,text:N||(Number.isInteger(b)?b.toString():b.toFixed(1))})}}return t},n=e.computed(()=>{if(Qt.value){const p=[],{maxX:g}=Ut.value;for(let b=0;b<=g;b++)p.push({x:z.value.left-10,y:_n(b),text:_o(F.categories[b]||`Item ${b+1}`,Math.max(z.value.left-28,40))});return p}const t=[],{minY:a,maxY:l}=Ut.value,i=5;for(let p=0;p<=i;p++){const g=a+(l-a)*(p/i),b=Math.round(g);t.push({x:z.value.left-10,y:rn(g),text:Kt(b)})}return t}),s=e.computed(()=>{if(!Kl.value||Qt.value)return[];const t=[],{minY:a,maxY:l}=Mo.value,i=5;for(let p=0;p<=i;p++){const g=a+(l-a)*(p/i),b=Math.round(g);t.push({x:z.value.right+10,y:Ol(g),text:Kt(b)})}return t}),r=t=>{const a=il.value;if(!a||a.length===0){const l=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return l[t%l.length]}return a[t%a.length]},c=t=>{if(!t||typeof t!="string")return"#3a3a3a";const a=t.trim();let l=0,i=0,p=0;const g=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)l=Number(g[1])/255,i=Number(g[2])/255,p=Number(g[3])/255;else{const w=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(w)l=Number(w[1])/255,i=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]),l=parseInt(N.slice(0,2),16)/255,i=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 D=getComputedStyle(N).color;document.body.removeChild(N);const M=D.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(M)l=Number(M[1])/255,i=Number(M[2])/255,p=Number(M[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*i+.0722*p>.5?"#3a3a3a":"#fafafa"},d=t=>{if(!t||typeof t!="string")return t;const a=t.trim(),l=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(l){const g=Math.max(0,Math.floor(Number(l[1])*.65)),b=Math.max(0,Math.floor(Number(l[2])*.65)),w=Math.max(0,Math.floor(Number(l[3])*.65));return`rgb(${g}, ${b}, ${w})`}const i=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(i){const g=Math.max(0,Math.floor(Number(i[1])*.65)),b=Math.max(0,Math.floor(Number(i[2])*.65)),w=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${b}, ${w}, ${i[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 b=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`#${[b,w,O].map(N=>N.toString(16).padStart(2,"0")).join("")}`}return a},u=(t,a)=>{const i=W.value?.stroke?.color;return i==null?d(a):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??d(a):d(a)},m=t=>{let a=0;for(let l=1;l<t.length;l++){const i=t[l].x-t[l-1].x,p=t[l].y-t[l-1].y;a+=Math.sqrt(i*i+p*p)}return a},v=e.computed(()=>be.value==="line"||Zl.value?(Zl.value?F.series.filter(a=>(a.type||be.value)==="line"):Yl.value).map((a,l)=>{const i=F.series.findIndex(M=>M===a),p=[];let g=[];a.data.forEach((M,te)=>{M==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:Qt.value?Xl(M):al(te),y:Qt.value?_n(te):Gl(a,M),index:te})}),g.length>0&&p.push(g);let b="";p.forEach(M=>{if(M.length>0){let te="";fe.value?te=vo(M):te=`M ${M[0].x} ${M[0].y}`+M.slice(1).map(Ve=>` L ${Ve.x} ${Ve.y}`).join(""),b+=(b?" ":"")+te}});const w=p.reduce((M,te)=>M+m(te),0),O=Ht.value.has(i),N=he.value===i,D=he.value!==null&&he.value!==i;return{path:b,color:r(i),strokeDasharray:ho(a),pathLength:w,seriesIndex:i,animationDelay:l*Y.value,isHighlighted:N,isDimmed:D,isHidden:O}}):[]),k=e.computed(()=>{if(!(be.value==="line"||Zl.value))return[];const t=Zl.value?F.series.filter(l=>(l.type||be.value)==="line"):Yl.value,a=[];return t.forEach((l,i)=>{const p=F.series.findIndex(g=>g===l);for(let g=0;g<l.data.length-1;g++){const b=l.data[g];if(b!=null){let w=-1,O=0;for(let N=g+1;N<l.data.length;N++){const D=l.data[N];if(D==null)O++;else{w=N;break}}if(O>0&&w!==-1){const N=l.data[w],D=Qt.value?Xl(b):al(g),M=Qt.value?_n(g):Gl(l,b),te=Qt.value?Xl(N):al(w),Ve=Qt.value?_n(w):Gl(l,N),Xe=Ht.value.has(p),ue=he.value===p,ke=he.value!==null&&he.value!==p;a.push({path:`M ${D} ${M} L ${te} ${Ve}`,color:r(p),seriesIndex:p,animationDelay:i*Y.value,isHighlighted:ue,isDimmed:ke,isHidden:Xe,gapSize:O}),g=w-1}}}}),a}),T=e.computed(()=>be.value==="line"||Zl.value?!xt.value||Tn.value||Rt.value.hasAnimated?[]:(Zl.value?F.series.filter(a=>(a.type||be.value)==="line"):Yl.value).map((a,l)=>{const i=F.series.findIndex(O=>O===a);let p="",g=null;a.data.forEach((O,N)=>{if(O!=null){const D={x:Qt.value?Xl(O):al(N),y:Qt.value?_n(N):Gl(a,O)};g===null?p+=`M ${D.x} ${D.y}`:p+=` L ${D.x} ${D.y}`,g=D}else if(g!==null){const D=a.data.findIndex((M,te)=>te>N&&M!==null&&M!==void 0);if(D!==-1){const M={x:Qt.value?Xl(a.data[D]):al(D),y:Qt.value?_n(D):Gl(a,a.data[D])};p+=` L ${M.x} ${M.y}`,g=M}}});const b=a.data.map((O,N)=>O==null?null:{x:Qt.value?Xl(O):al(N),y:Qt.value?_n(N):Gl(a,O)}).filter(O=>O!==null),w=m(b);return{path:p,pathLength:w,color:r(i),strokeDasharray:ho(a),animationDelay:l*Y.value,seriesIndex:i}}):[]),R=e.computed(()=>{if(be.value!=="line")return[];const t=[];return Yl.value.forEach((a,l)=>{const i=he.value===l,p=he.value!==null&&he.value!==l,g=Ht.value.has(l);a.data.forEach((b,w)=>{b!=null&&t.push({x:al(w),y:Gl(a,b),color:r(l),value:b,label:F.categories[w]||w.toString(),seriesName:a.name,categoryIndex:w,dataIndex:w,animationDelay:(l*a.data.length+w)*(Y.value/8),isHighlighted:i,isDimmed:p,isHidden:g})})}),t}),E=e.computed(()=>{if(!Zl.value)return[];const t=[];return F.series.filter(l=>(l.type||be.value)==="line").forEach((l,i)=>{const p=F.series.findIndex(O=>O===l),g=he.value===p,b=he.value!==null&&he.value!==p,w=Ht.value.has(p);l.data.forEach((O,N)=>{O!=null&&t.push({x:al(N),y:Gl(l,O),color:r(p),value:O,label:F.categories[N]||N.toString(),seriesName:l.name,categoryIndex:N,dataIndex:N,animationDelay:(i*l.data.length+N)*(Y.value/8),isHighlighted:g,isDimmed:b,isHidden:w})})}),t}),ne=e.computed(()=>{if(!Zt.value)return[];const t=[];return Yl.value.forEach((a,l)=>{if(!a?.data?.length)return;const i=he.value,p=i!==null&&i===l,g=i!==null&&i!==l,b=Ht.value.has(l);a.data.forEach((w,O)=>{let N,D,M,te,Ve;if(typeof w=="object"&&w!==null&&!Array.isArray(w))N=typeof w.x=="number"?w.x:O,D=typeof w.y=="number"?w.y:0,M=typeof w.size=="number"?w.size:20,te=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,D=typeof w[1]=="number"?w[1]:0,M=typeof w[2]=="number"?w[2]:20,te=w[3]||F.categories?.[O]||`Point ${O+1}`,Ve=w[4];else if(typeof w=="number")N=O,D=w,M=eo(l,O),te=F.categories?.[O]||`Point ${O+1}`;else return;!isFinite(N)||!isFinite(D)||!isFinite(M)||t.push({x:al(N),y:rn(D),radius:An(M),originalX:N,originalY:D,originalSize:M,color:r(l),seriesName:a.name||`Series ${l+1}`,label:te,imageUrl:Ve,seriesIndex:l,dataIndex:O,categoryIndex:Math.round(N),isHighlighted:p,isDimmed:g,isHidden:b,opacity:Jn.value})})}),t}),j=e.computed(()=>be.value!=="area"?[]:Yl.value.map((t,a)=>{const l=[];let i=[];if(t.data.forEach((M,te)=>{M==null?i.length>0&&(l.push([...i]),i=[]):i.push({x:al(te),y:Gl(t,M),index:te})}),i.length>0&&l.push(i),l.length===0)return{linePath:"",areaPath:"",color:r(a),isHidden:Ht.value.has(a)};const p=z.value.bottom+1;let g="",b="";l.forEach((M,te)=>{if(M.length===0)return;let Ve=`M ${M[0].x} ${M[0].y}`;fe.value&&M.length>1?Ve=vo(M):M.slice(1).forEach(ue=>{Ve+=` L ${ue.x} ${ue.y}`}),g+=(g?" ":"")+Ve;let Xe=`M ${M[0].x} ${p}`;if(Xe+=` L ${M[0].x} ${M[0].y}`,fe.value&&M.length>1){const ue=vo(M),ke=ue.substring(ue.indexOf("C")||ue.indexOf("Q")||ue.indexOf("L"));ke?Xe+=" "+ke:M.slice(1).forEach(Ne=>{Xe+=` L ${Ne.x} ${Ne.y}`})}else M.slice(1).forEach(ue=>{Xe+=` L ${ue.x} ${ue.y}`});Xe+=` L ${M[M.length-1].x} ${p} Z`,b+=(b?" ":"")+Xe});const w=he.value===a,O=he.value!==null&&he.value!==a,N=Ht.value.has(a),D=l.reduce((M,te)=>M+m(te),0);return{linePath:g,areaPath:b,color:r(a),pathLength:D,isHighlighted:w,isDimmed:O,isHidden:N}})),Ie=e.computed(()=>{if(!(["bar"].includes(be.value)||Zl.value))return[];const t=[],{maxX:a}=Ut.value,l=Zl.value?F.series.filter(p=>(p.type||be.value)==="bar"):Yl.value,i=l.length;if(Qt.value){const p=a+1,b=z.value.height/p,w=b*(2/3),O=Math.min(4,w/i*.15),N=w-(i-1)*O,D=Math.max(4,N/i);l.forEach((M,te)=>{const Ve=F.series.findIndex(Ne=>Ne===M),Xe=he.value===Ve,ue=he.value!==null&&he.value!==Ve,ke=Ht.value.has(Ve);M.data.forEach((Ne,ge)=>{if(Ne==null||typeof Ne!="number"||!isFinite(Ne))return;const Ae=z.value.top+(ge+.5)*b-w/2+te*(D+O),$e=z.value.left,He=Math.abs(Xl(Ne)-z.value.left);let _t="";if(fe.value&&He>0){const zt=Math.min(St.value,D/2,He/2);_t=[`M ${$e} ${Ae}`,`L ${$e+He-zt} ${Ae}`,`Q ${$e+He} ${Ae} ${$e+He} ${Ae+zt}`,`L ${$e+He} ${Ae+D-zt}`,`Q ${$e+He} ${Ae+D} ${$e+He-zt} ${Ae+D}`,`L ${$e} ${Ae+D}`,"Z"].join(" ")}t.push({x:$e,y:Ae,width:He,height:D,color:r(i===1?ge:Ve),value:Ne,label:F.categories[ge]||ge.toString(),seriesName:M.name,animationDelay:(te*l.length+ge)*(Y.value/4),isHighlighted:Xe,isDimmed:ue,isHidden:ke,barPath:_t,isSmooth:fe.value&&He>0})})})}else{const p=a+1,b=z.value.width/p,w=b*.8,O=w/i,N=O*.05,D=O-N;l.forEach((M,te)=>{const Ve=F.series.findIndex(Ne=>Ne===M),Xe=he.value===Ve,ue=he.value!==null&&he.value!==Ve,ke=Ht.value.has(Ve);M.data.forEach((Ne,ge)=>{if(Ne==null||typeof Ne!="number"||!isFinite(Ne))return;const Ae=z.value.left+(ge+.5)*b-w/2+te*O+N/2,$e=rn(Math.max(0,Ne)),He=Math.abs(rn(0)-rn(Ne));let _t="";if(fe.value&&He>0){const zt=Math.min(St.value,D/2,He/2);_t=[`M ${Ae} ${$e+He}`,`L ${Ae} ${$e+zt}`,`Q ${Ae} ${$e} ${Ae+zt} ${$e}`,`L ${Ae+D-zt} ${$e}`,`Q ${Ae+D} ${$e} ${Ae+D} ${$e+zt}`,`L ${Ae+D} ${$e+He}`,"Z"].join(" ")}t.push({x:Ae,y:$e,width:D,height:He,color:r(i===1?ge:Ve),value:Ne,label:F.categories[ge]||ge.toString(),seriesName:M.name,animationDelay:(te*l.length+ge)*(Y.value/4),isHighlighted:Xe,isDimmed:ue,isHidden:ke,barPath:_t,isSmooth:fe.value&&He>0})})})}return t}),we=e.computed(()=>{if(!xl.value)return[];const t=Yl.value.map((b,w)=>({series:b,originalIndex:w})).filter(({originalIndex:b})=>!Ht.value.has(b));if(t.length===0)return[];let a=be.value==="semi-radial"?Math.PI:-Math.PI/2;const l=be.value==="semi-radial"?Math.PI:Math.PI*2,i=[],p=(b,w,O,N,D,M)=>{const te=b+(w-b)/2,Ve=w-b,Xe=It.value+Math.cos(b)*qt.value,ue=Tt.value+Math.sin(b)*qt.value,ke=It.value+Math.cos(w)*qt.value,Ne=Tt.value+Math.sin(w)*qt.value,ge=It.value+Math.cos(w)*it.value,Qe=Tt.value+Math.sin(w)*it.value,Pe=It.value+Math.cos(b)*it.value,Ae=Tt.value+Math.sin(b)*it.value,$e=Ve>Math.PI?1:0,He=[`M ${Xe} ${ue}`,`A ${qt.value} ${qt.value} 0 ${$e} 1 ${ke} ${Ne}`,`L ${ge} ${Qe}`,`A ${it.value} ${it.value} 0 ${$e} 0 ${Pe} ${Ae}`,"Z"].join(" "),_t=M||r(O);return{path:He,color:_t,strokeWidth:bt.value,strokeColor:u(i.length,_t),value:D,seriesName:N,opacity:.8,isHighlighted:he.value===O,isDimmed:he.value!==null&&he.value!==O,isHidden:!1,startAngle:b,endAngle:w,midAngle:te}};if(Un.value){const{series:b,originalIndex:w}=t[0],O=Number(b?.data?.[0]??0),N=Number.isFinite(O)?Math.min(Math.max(O,0),100):0,D=W.value,M=Math.min(Math.max(Number(D?.miniRadial?.minVisiblePercent??1),0),100),Ve=(N<=0?M:N)/100*l,Xe=Number(D?.miniRadial?.thresholds?.low??33),ue=Number(D?.miniRadial?.thresholds?.medium??66),ke=D?.miniRadial?.colors?.low||"#E53E3E",Ne=D?.miniRadial?.colors?.medium||"#ED8936",ge=D?.miniRadial?.colors?.high||"#38A169",Qe=N<=Xe?ke:N<=ue?Ne:ge,Pe=D?.miniRadial?.trackColor||"#E5E7EB",Ae=b?.name||"Score";return i.push(p(a,a+l-.001,w+1,"Track",100,Pe)),i.push(p(a,a+Ve,w,Ae,N,Qe)),i}if(t.length===1){const{series:b,originalIndex:w}=t[0],O=b.data[0]||0,N=a,D=a+l-.001,M=N+l/2,te=It.value+Math.cos(N)*qt.value,Ve=Tt.value+Math.sin(N)*qt.value,Xe=It.value+Math.cos(D)*qt.value,ue=Tt.value+Math.sin(D)*qt.value,ke=It.value+Math.cos(D)*it.value,Ne=Tt.value+Math.sin(D)*it.value,ge=It.value+Math.cos(N)*it.value,Qe=Tt.value+Math.sin(N)*it.value,Pe=1,Ae=[`M ${te} ${Ve}`,`A ${qt.value} ${qt.value} 0 ${Pe} 1 ${Xe} ${ue}`,`L ${ke} ${Ne}`,`A ${it.value} ${it.value} 0 ${Pe} 0 ${ge} ${Qe}`,"Z"].join(" "),$e=r(w);return i.push({path:Ae,color:$e,strokeWidth:bt.value,strokeColor:u(0,$e),value:O,seriesName:b.name,opacity:.8,isHighlighted:he.value===w,isDimmed:!1,isHidden:!1,startAngle:N,endAngle:D,midAngle:M}),i}if(sn.value&&t.length===2){const b=t[0],w=t[1],O=Math.min(100,Math.max(0,b.series.data[0]||0)),N=O/100*l;return i.push(p(a,a+N,b.originalIndex,b.series.name,O)),i.push(p(a,a+l,w.originalIndex,w.series.name,100)),i}const g=t.reduce((b,{series:w})=>b+(w.data[0]||0),0);return g===0?[]:(t.forEach(({series:b,originalIndex:w})=>{const O=b.data[0]||0,N=O/g*l,D=a,M=a+N,te=D+N/2,Ve=It.value+Math.cos(D)*qt.value,Xe=Tt.value+Math.sin(D)*qt.value,ue=It.value+Math.cos(M)*qt.value,ke=Tt.value+Math.sin(M)*qt.value,Ne=It.value+Math.cos(M)*it.value,ge=Tt.value+Math.sin(M)*it.value,Qe=It.value+Math.cos(D)*it.value,Pe=Tt.value+Math.sin(D)*it.value,Ae=N>Math.PI?1:0,$e=[`M ${Ve} ${Xe}`,`A ${qt.value} ${qt.value} 0 ${Ae} 1 ${ue} ${ke}`,`L ${Ne} ${ge}`,`A ${it.value} ${it.value} 0 ${Ae} 0 ${Qe} ${Pe}`,"Z"].join(" "),He=r(w);i.push({path:$e,color:He,strokeWidth:bt.value,strokeColor:u(i.length,He),value:O,seriesName:b.name,opacity:.8,isHighlighted:he.value===w,isDimmed:he.value!==null&&he.value!==w,isHidden:!1,startAngle:D,endAngle:M,midAngle:te}),a=M}),i)}),yt=e.computed(()=>{const t=we.value;return sn.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((a,l)=>({segment:a,originalIndex:l}))}),Cl=e.computed(()=>{if(!P.value||!xl.value)return[];const t=$.value,a=ie.value,l=Le.value,i=ct.value,p=15,g=t*1.3,b=.55,w=(M,te)=>{const Ve=It.value+Math.cos(M.midAngle)*it.value,Xe=Tt.value+Math.sin(M.midAngle)*it.value,ue=It.value+Math.cos(M.midAngle)*(it.value+a),ke=Tt.value+Math.sin(M.midAngle)*(it.value+a),ge=ue+l*(te?1:-1),Qe=te?ue+p:ue-p,Pe=ke-i,Ae=`${M.seriesName}: ${Kt(M.value)}`,$e=Ae.length*t*b;return{pointerStartX:Ve,pointerStartY:Xe,pointerEndX:ue,pointerEndY:ke,horizontalEndX:ge,horizontalEndY:ke,textX:Qe,textY:Pe,text:Ae,textWidth:$e,textAnchor:te?"start":"end",isRightSide:te,pointerLineLength:Math.hypot(ue-Ve,ke-Xe),horizontalLineLength:Math.hypot(ge-ue,0)}},O=(M,te)=>{const Ve=Math.abs(M.textY-te.textY)<g,Xe=M.isRightSide?M.textX:M.textX-M.textWidth,ue=M.isRightSide?M.textX+M.textWidth:M.textX,ke=te.isRightSide?te.textX:te.textX-te.textWidth,Ne=te.isRightSide?te.textX+te.textWidth:te.textX,ge=Xe<Ne&&ke<ue;return Ve&&ge},N=we.value.filter(M=>!M.isHidden),D=[];for(let M=0;M<N.length;M++){const te=N[M];let Ve=Math.cos(te.midAngle)>=0;if(M>0){const ue=D[M-1],ke=w(te,Ve);O(ue,ke)&&(Ve=!Ve)}const Xe=w(te,Ve);D.push({...Xe,color:te.color,isHighlighted:te.isHighlighted,isDimmed:te.isDimmed})}return D}),vl=t=>{if(!t||t.isHidden)return 0;const a=t.opacity||Jn.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},sl=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},ul=(t,a)=>{if(t)try{if(he.value===t.seriesIndex?he.value=null:he.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:a,chartId:F.chartId}});window.dispatchEvent(l)}}catch(l){console.error("Error in onBubbleClick:",l)}},gl=(t,a)=>{const l=[`dss-bubble-fallback-${a}`];return t.isHighlighted&&l.push("dss-bubble-highlighted"),t.isDimmed&&l.push("dss-bubble-dimmed"),t.isHidden&&l.push("dss-bubble-hidden"),l.push(`dss-bubble-series-${t.seriesIndex}`),l.join(" ")},rl=(t,a)=>{if(!t||(a.stopPropagation(),Ro.value=!0,he.value=t.seriesIndex,Ke.value.show=!1,!Ue.value))return;const l=a.target.closest(".dss-custom-chart-container");if(!l)return;const i=l.getBoundingClientRect();let p=a.clientX-i.left+10,g=a.clientY-i.top-10;const b=200,w=120;p+b>Ee.value&&(p=a.clientX-i.left-b-10),g+w>i.height&&(g=a.clientY-i.top-w-10),p<0&&(p=10),g<0&&(g=10);const O=Tl.value,N=Jt.value,D=O.map(M=>{const te=N[M]||M,Ve=Ql(M,t);return Ve?{seriesName:t.seriesName,label:t.label,value:`${te}: ${Ve}`,color:t.color}:null}).filter(Boolean);gt.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:D,categoryIndex:void 0,spiderAreas:[]}},Ql=(t,a)=>{let l;switch(t){case"x":l=a.originalX;break;case"y":l=a.originalY;break;case"size":l=a.originalSize;break;case"label":l=a.label;break;case"seriesName":l=a.seriesName;break;default:l=a[t]||""}const i=$l.value[t];if(typeof i=="function")return i(l,a);if(typeof l=="number"){const p=l.toFixed(1);return un.value?p+un.value:p}return l?.toString()||""},Nn=()=>{if(!Zt.value||!Ke.value.data||Ke.value.data.length===0)return"Bubbles";const t=[],a=new Set;return Ke.value.data.forEach(l=>{if(l.seriesName&&l.label){const i=`${l.seriesName} - ${l.label}`;a.has(i)||(t.push(i),a.add(i))}else l.seriesName&&(a.has(l.seriesName)||(t.push(l.seriesName),a.add(l.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},gn=(t,a)=>{t&&(Ro.value=!1,he.value=null,gt.value.show=!1,gt.value.bubbleData=[])},Lo=(t,a)=>{const l=a.target.closest(".dss-custom-chart-container");if(!l)return;const i=l.getBoundingClientRect(),p=Zn(t.categoryIndex),g=t.description||t.comment||"";let b=a.clientX-i.left+15,w=a.clientY-i.top-10;const O=200,N=g?80:50;b+O>Ee.value&&(b=a.clientX-i.left-O-15),w+N>ee.value&&(w=a.clientY-i.top-N-10),b<0&&(b=10),w<0&&(w=10),Dl.value={show:!0,x:b,y:w,categoryValue:p,description:g}},Ao=()=>{Dl.value.show=!1},Pn=e.computed(()=>F.categories.length||Math.max(...jl.value.map(t=>t.data.length))),To=e.computed(()=>{let t=0;return jl.value.forEach(a=>{a.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),Go=e.computed(()=>{const t=[],a=Pn.value;for(let l=0;l<a;l++){const i=l*2*Math.PI/a-Math.PI/2,p=It.value+Math.cos(i)*it.value,g=Tt.value+Math.sin(i)*it.value;t.push({x:p,y:g,angle:i,index:l})}return t}),Do=e.computed(()=>{const t=[],a=Pn.value;return Go.value.forEach((l,i)=>{const p=it.value+15,g=i*2*Math.PI/a-Math.PI/2,b=It.value+Math.cos(g)*p,w=Tt.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:b,y:w,text:F.categories[i]||`Axis ${i+1}`,anchor:O,baseline:N})}),t}),no=e.ref(new Set),Ho=(t,a,l)=>{const i=`current-${l}`,p=no.value.has(i);return!p&&he.value===null?a.fillOpacity||ft.value:a.isHighlighted||p?(a.fillOpacity||ft.value)+.15:a.isDimmed?(a.fillOpacity||ft.value)*.3:a.fillOpacity||ft.value},cn=e.computed(()=>{if(!Ul.value)return[];const t=[],a=Pn.value;return Yl.value.forEach((l,i)=>{const p=[],g=[],b=[],w=he.value===i,O=he.value!==null&&he.value!==i,N=Ht.value.has(i);for(let D=0;D<a;D++){const M=l.data[D]||0,Ve=M/To.value*it.value,Xe=D*2*Math.PI/a-Math.PI/2,ue=It.value+Math.cos(Xe)*Ve,ke=Tt.value+Math.sin(Xe)*Ve;p.push(`${ue},${ke}`),g.push({x:ue,y:ke}),b.push({x:ue,y:ke,value:M,label:F.categories[D]||`Axis ${D+1}`,seriesName:l.name})}t.push({points:p.join(" "),polygonPoints:g,dataPoints:b,color:r(i),fillOpacity:ft.value,seriesName:l.name,value:`${l.name}: ${l.data.join(", ")}`,isHighlighted:w,isDimmed:O,isHidden:N,seriesIndex:i})}),t}),hn=(t,a)=>{if(!a||a.length<3)return!1;let l=!1;for(let i=0,p=a.length-1;i<a.length;p=i++){const g=a[i].x,b=a[i].y,w=a[p].x,O=a[p].y;b>t.y!=O>t.y&&t.x<(w-g)*(t.y-b)/(O-b)+g&&(l=!l)}return l},Jl=t=>{if(!Ul.value)return;const a=t.currentTarget.closest(".dss-custom-chart-container");if(!a)return;const l=a.getBoundingClientRect(),i=B.value?.getBoundingClientRect();if(!i)return;const p=t.clientX-i.left,g=t.clientY-i.top,b=cn.value.filter(w=>w.isHidden?!1:hn({x:p,y:g},w.polygonPoints));if(b.length>0){b.length,he.value=b[0].seriesIndex;const w=t.clientX-l.left+10,O=t.clientY-l.top-10,N=b.length>1?460:260,D=70+Pn.value*20;let M=w,te=O;M+N>Ee.value&&(M=t.clientX-l.left-N-10),te+D>ee.value&&(te=t.clientY-l.top-D-10),M<0&&(M=10),te<0&&(te=10);const Ve=b.map(Xe=>({seriesName:Xe.seriesName,color:Xe.color,points:Xe.dataPoints.map(ue=>({label:ue.label,value:Kt(ue.value)}))}));gt.value={show:!0,x:M,y:te,title:"",value:"",bubbleData:[],spiderAreas:Ve}}else Bn()},ko=e.computed(()=>{const t=W.value;return t.logos.map((a,l)=>{const i=F.series[a.seriesIndex];if(!i||!i.data||i.data.length===0||Ht.value.has(a.seriesIndex))return null;let p,g;if(wl.value){let w=-1,O=null;for(let D=i.data.length-1;D>=0;D--)if(i.data[D]!==null&&i.data[D]!==void 0){w=D,O=i.data[D];break}if(w===-1||O===null)return null;const N=i.data.map((D,M)=>D==null?null:{x:al(M),y:Gl(i,D),index:M}).filter(D=>D!==null);if(t.animations.enabled&&!Tn.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Rt.value.isAnimating||!Rt.value.hasAnimated))if(Rt.value.isAnimating){const D=Rt.value.currentFrame/Rt.value.totalFrames,M=ea(t.animations.easing,Math.min(D,1)),te=xa(N,M);p=te.x+(a.offsetX||0),g=te.y+(a.offsetY||0)}else p=N[0].x+(a.offsetX||0),g=N[0].y+(a.offsetY||0);else p=al(w)+(a.offsetX||0),g=rn(O)+(a.offsetY||0)}else if(xl.value||Ul.value){const w=Math.PI*2/t.logos.length*l;p=It.value+Math.cos(w)*(it.value+30)+(a.offsetX||0),g=Tt.value+Math.sin(w)*(it.value+30)+(a.offsetY||0)}return{...a,x:p,y:g,seriesIndex:a.seriesIndex}}).filter(Boolean)}),va=t=>{const a=document.querySelector(`.dss-logo-fallback-${t}`),l=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.opacity="0"),l&&(l.style.opacity="1")},ga=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=>{Ht.value.has(t)?Ht.value.delete(t):Ht.value.add(t)},ha=e.computed(()=>{if(!gt.value.show&&!(Je.value&&Ke.value.show&&!ae.value.isZooming))return{display:"none"};let t,a;if(Je.value&&Ke.value.show&&!ae.value.isZooming){t=Ke.value.x+15,a=z.value.top;const l=Zt.value?200:150;t+l>Ee.value&&(t=Ke.value.x-l-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"}}),On=(t,a)=>{if(!Ue.value||Co.value)return;const i=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-i.left+10,g=a.clientY-i.top-10;const b=200,w=120,O=Ee.value,N=ee.value;p+b>O&&(p=a.clientX-i.left-b-10),g+w>N&&(g=a.clientY-i.top-w-10),p<0&&(p=10),g<0&&(g=10);let D;typeof t.categoryIndex=="number"?D=t.categoryIndex:typeof t.dataIndex=="number"?D=t.dataIndex:t.label&&F.categories.includes(t.label)&&(D=F.categories.indexOf(t.label));const M=(Qt.value||be.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";gt.value={show:!0,x:p,y:g,title:M,value:Kt(t.value)||"",categoryIndex:D,spiderAreas:[]}},Jo=e.ref(!1),Ro=e.ref(!1),Bn=()=>{gt.value.show=!1,gt.value.spiderAreas=[],gt.value.bubbleData=[],Ke.value.show=!1,Jo.value||(he.value=null)},Co=e.ref(!1),bo=(t,a)=>{Co.value=!0,gt.value.show=!1,Ke.value.show=!1;const i=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-i.left+15,g=a.clientY-i.top-10;const b=250;p+b>Ee.value&&(p=a.clientX-i.left-b-15),p<0&&(p=10),g<0&&(g=10),cl.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},wo=()=>{Co.value=!1,cl.value.show=!1},Rt=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}},Tn=e.computed(()=>ze.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),oa=()=>{if(!xt.value||Tn.value){Rt.value.hasAnimated=!0,Rl.value&&(Ln.value=1);return}Rl.value&&(Ln.value=0),Rt.value.isAnimating=!0,Rt.value.currentFrame=0,Rt.value.totalFrames=Math.ceil(S.value/16.67);const t=()=>{const a=Rt.value.currentFrame/Rt.value.totalFrames,l=ea(V.value,Math.min(a,1));ya(l),Rl.value&&(Ln.value=l),a<1?(Rt.value.currentFrame++,Rt.value.animationId=requestAnimationFrame(t)):ka()};Rt.value.animationId=requestAnimationFrame(t)},ya=t=>{const a=I.value;a&&a.style.setProperty("--dss-animation-progress",t)},ka=()=>{Rt.value.isAnimating=!1,Rt.value.hasAnimated=!0,Rl.value&&(Ln.value=1),Rt.value.animationId&&(cancelAnimationFrame(Rt.value.animationId),Rt.value.animationId=null)},ta=e.computed(()=>!xl.value||Rt.value.hasAnimated?!0:Rl.value?Ln.value>=1:En.value?Yt.value>=1:!0),aa=e.computed(()=>P.value&&ta.value),Fo=e.ref(!1);e.watch(aa,t=>{t?(Fo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Fo.value=!0})})):Fo.value=!1},{immediate:!0});const Ca=e.computed(()=>{if(!xt.value||Tn.value||Rt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${S.value}ms`,t["--dss-animation-easing"]=ba(V.value),t["--dss-stagger-delay"]=`${Y.value}ms`,t}),ba=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",wa=()=>{if(!xt.value||Tn.value)return"";const t=["dss-chart-animated"];return Rt.value.hasAnimated||t.push(`dss-animate-${tl.value}`),Rt.value.hasAnimated||(xl.value&&be.value!=="semi-radial"?t.push("dss-animate-fill"):xl.value||t.push(`dss-animate-${tl.value}`)),Rt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>F.series,(t,a)=>{le.value&&a&&Rt.value.hasAnimated&&(Rt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>oa(),C.value)}))},{deep:!0}),e.watch(()=>ae.value.isZooming,(t,a)=>{a&&!t&&setTimeout(()=>{Nl()},50)}),e.watch(()=>[ae.value.scale,ae.value.offsetX],()=>{!ae.value.isZooming&&!ae.value.isDragging&&Nl()},{flush:"post"}),e.watch([Pt,We],([t,a])=>{ae.value.minScale=t,ae.value.maxScale=a,(ae.value.scale<t||ae.value.scale>a)&&Kn()},{immediate:!0}),e.watch(()=>F.locale,t=>{t&&t!==A.value&&(A.value=t)},{immediate:!0}),e.watch(()=>ht.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",po)}):document.removeEventListener("click",po)}),e.onMounted(()=>{he.value=null,Rl.value&&(!xt.value||Tn.value)&&(Ln.value=1),x(),I.value&&typeof ResizeObserver<"u"&&(f=new ResizeObserver(t=>{const a=t[0];!a||!a.contentRect||(xe&&cancelAnimationFrame(xe),xe=requestAnimationFrame(()=>{xe=null;const{width:l,height:i}=a.contentRect;ut.value=Math.round(l),Q.value=Math.round(i),ve.value&&(Me.value=ve.value.offsetHeight||Ce)}))}),f.observe(I.value)),xt.value&&!Tn.value?be.value==="semi-radial"?setTimeout(()=>Yo(),C.value):setTimeout(()=>oa(),C.value):(Rt.value.hasAnimated=!0,be.value==="semi-radial"&&(Yt.value=1)),document.addEventListener("mousemove",sa),document.addEventListener("mouseup",ra),document.addEventListener("click",mo)}),e.onUnmounted(()=>{xe&&cancelAnimationFrame(xe),f&&I.value&&(f.unobserve(I.value),f.disconnect(),f=null),Rt.value.animationId&&cancelAnimationFrame(Rt.value.animationId),zn&&(cancelAnimationFrame(zn),zn=null),ae.value.zoomTimeout&&clearTimeout(ae.value.zoomTimeout),document.removeEventListener("mousemove",sa),document.removeEventListener("mouseup",ra),document.removeEventListener("click",mo),document.removeEventListener("click",po)});const sa=t=>{if(ae.value.isDragging&&ae.value.scale>1&&wl.value){Ke.value.show=!1;const a=t.clientX-ae.value.lastMouseX,{minX:l,maxX:i}=Ut.value,p=i-l||1,b=a*.8;ae.value.offsetX+=b;const w=p/ae.value.scale,O=p-w,N=0,D=-O/p*z.value.width,M=N;ae.value.offsetX=Math.max(D,Math.min(M,ae.value.offsetX)),ae.value.lastMouseX=t.clientX,ae.value.lastMouseY=t.clientY}},ra=()=>{ae.value.isDragging&&(ae.value.isDragging=!1,setTimeout(()=>{!ae.value.isDragging&&ae.value.isZooming},100))},xa=(t,a)=>{const l=t.filter(w=>w!=null);if(!l||l.length===0)return{x:0,y:0};if(l.length===1||a<=0)return l[0];if(a>=1)return l[l.length-1];let i=0;const p=[];for(let w=1;w<l.length;w++){const O=l[w].x-l[w-1].x,N=l[w].y-l[w-1].y,D=Math.sqrt(O*O+N*N);p.push(D),i+=D}const g=i*a;let b=0;for(let w=0;w<p.length;w++){const O=b+p[w];if(g<=O){const N=(g-b)/p[w],D=l[w],M=l[w+1];return{x:D.x+(M.x-D.x)*N,y:D.y+(M.y-D.y)*N}}b=O}return l[l.length-1]};return(t,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[wa(),{"dss-chart-fill-width":Ze.value,"dss-chart-fill-height":qe.value,"dss-chart-compact":xl.value&&!K.value}]]),style:e.normalizeStyle({width:Ze.value?"100%":Ee.value+"px",height:ot.value,...Ze.value||qe.value?{overflow:xl.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Ca.value,cursor:Xo()}),"data-chart-type":be.value,ref_key:"containerEl",ref:I,onWheel:xo,onMousedown:Uo,onMousemove:nl,onMouseup:fo,onMouseleave:zl,onDblclick:Kn,onContextmenu:e.withModifiers(Wn,["prevent"]),onClick:e.withModifiers(ql,["left"]),onWheelCapture:xo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:ve},[e.createElementVNode("div",bs,[dt.value?(e.openBlock(),e.createElementBlock("div",ws,e.toDisplayString(dt.value),1)):e.createCommentVNode("",!0),kt.value?(e.openBlock(),e.createElementBlock("div",xs,e.toDisplayString(kt.value),1)):e.createCommentVNode("",!0)]),K.value&&ye.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":ye.value==="top","dss-legend-bottom":ye.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ht.value.has(i),"dss-legend-hovered":he.value===i,"dss-legend-dimmed":he.value!==null&&he.value!==i}]),onClick:p=>Qo(i),onMouseenter:p=>Xt(i),onMouseleave:Hn,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:r(i)})},null,4),e.createElementVNode("span",Ss,e.toDisplayString(l.name),1)],46,Es))),128))],2)):e.createCommentVNode("",!0),K.value&&(ye.value==="left"||ye.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":ye.value==="left","dss-legend-right":ye.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ht.value.has(i),"dss-legend-hovered":he.value===i,"dss-legend-dimmed":he.value!==null&&he.value!==i}]),onClick:p=>Qo(i),onMouseenter:p=>Xt(i),onMouseleave:Hn,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:r(i)})},null,4),e.createElementVNode("span",Ns,e.toDisplayString(l.name),1)],46,Vs))),128))],2)):e.createCommentVNode("",!0)],512),L.showAddMarkerButton&&vt.value&&at.value.addMarker&&(wl.value||Zt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Zo,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,Ms),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,Bs)):e.createCommentVNode("",!0),e.createElementVNode("div",_s,[Zt.value&&wt.value?(e.openBlock(),e.createElementBlock("div",$s,"Bubble size: "+e.toDisplayString(wt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Ee.value,height:ee.value,class:"dss-chart-svg","data-smooth":fe.value,"data-animated":xt.value,ref_key:"svgEl",ref:B},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:U.value},[e.createElementVNode("rect",{x:0,y:z.value.top,width:Ee.value,height:z.value.height*4},null,8,Ts)],8,As),En.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Gn.value},[e.createElementVNode("path",{d:Fn.value},null,8,Hs)],8,Ds)):e.createCommentVNode("",!0),Rl.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:Eo.value},[e.createElementVNode("path",{d:So.value},null,8,Fs)],8,Rs)):e.createCommentVNode("",!0)]),wl.value||Zt.value?(e.openBlock(),e.createElementBlock("g",Is,[Wt.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($o.value,(l,i)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${i}`,x1:z.value.left,x2:z.value.right,y1:l.y,y2:l.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${i*50}ms`})},null,12,Ps))),128))],8,zs)):e.createCommentVNode("",!0),e.createElementVNode("g",Os,[e.createElementVNode("line",{x1:z.value.left,x2:z.value.right,y1:z.value.bottom,y2:z.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,qs),e.createElementVNode("line",{x1:z.value.left,x2:z.value.left,y1:z.value.top,y2:z.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Ws),Kl.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:z.value.right,x2:z.value.right,y1:z.value.top,y2:z.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Zs)):e.createCommentVNode("",!0)]),e.createElementVNode("g",Us,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lo.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${i}`,x:l.x,y:l.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},e.toDisplayString(l.text),13,Xs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${i}`,x:l.x,y:l.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(l.text),13,Ys))),128)),Kl.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(s.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-secondary-${i}`,x:l.x,y:l.y,"text-anchor":"start","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(l.text),13,js))),128)):e.createCommentVNode("",!0),Dt.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:z.value.left+z.value.width/2,y:z.value.bottom+45,"text-anchor":"middle","font-size":"14",fill:"#666"},e.toDisplayString(Dt.value),9,Ks)):e.createCommentVNode("",!0),Ft.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:15,y:z.value.top+12+z.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(-90, 15, ${z.value.top+z.value.height/2})`},e.toDisplayString(Ft.value),9,Gs)):e.createCommentVNode("",!0),Kl.value&&pe.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:Ee.value-15,y:z.value.top+12+z.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(90, ${Ee.value-15}, ${z.value.top+z.value.height/2})`},e.toDisplayString(pe.value),9,Qs)):e.createCommentVNode("",!0)]),Cn.value.length>0?(e.openBlock(),e.createElementBlock("g",Js,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cn.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":me.value},[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.x,y1:z.value.bottom,y2:z.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>bo(l,i),onMouseleave:wo},null,40,tr)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:z.value.bottom,y2:z.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>bo(l,i),onMouseleave:wo},null,40,lr)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:z.value.bottom,y2:z.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>bo(l,i),onMouseleave:wo},null,40,nr)):e.createCommentVNode("",!0)],8,er),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,z.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>bo(l,i),onMouseleave:wo},null,40,or)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,z.value.top-10),r:"14",fill:l.hasManual&&l.hasAuto||l.hasManual?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:i=>bo(l,i),onMouseleave:wo},null,40,ar),e.createElementVNode("text",{x:l.x,y:Math.max(15,z.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(l.totalCount),9,sr)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":me.value},[Zl.value?(e.openBlock(),e.createElementBlock("g",ir,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":Qt.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${i}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>On(l,p),onMouseleave:Bn},null,46,cr)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>On(l,p),onMouseleave:Bn},null,46,ur))],64))),128))],2),e.createElementVNode("g",dr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Re.value+2:Re.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,mr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Re.value+2:Re.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:l.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,pr))),128)),pt.value>0||J.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(E.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:l.x,cy:l.y,r:X(l.isHighlighted?Z(l,pt.value)+2:Z(l,pt.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>On(l,p),onMouseleave:Bn},null,46,fr))),128)):e.createCommentVNode("",!0)])])):be.value==="line"?(e.openBlock(),e.createElementBlock("g",vr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:l.path,stroke:l.color,"stroke-width":Re.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Rt.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,gr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Re.value+2:Re.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,hr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Re.value+2:Re.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:l.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,yr))),128)),pt.value>0||J.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(R.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:l.x,cy:l.y,r:X(l.isHighlighted?Z(l,pt.value)+2:Z(l,pt.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>On(l,p),onMouseleave:Bn},null,46,kr))),128)):e.createCommentVNode("",!0)])):be.value==="area"?(e.openBlock(),e.createElementBlock("g",Cr,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(l,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${L.chartId}`},[e.createElementVNode("rect",{x:z.value.left-10,y:z.value.top-10,width:z.value.width+20,height:z.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${z.value.width+20}px`})},null,12,wr)],8,br))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?re.value+.2:re.value,mask:`url(#area-mask-${i}-${L.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden})},null,10,xr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?Re.value+1:Re.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${i*Y.value}ms`})},null,14,Er))),128))])):be.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":Qt.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${i}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>On(l,p),onMouseleave:Bn},null,46,Sr)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>On(l,p),onMouseleave:Bn},null,46,Vr))],64))),128))],2)):e.createCommentVNode("",!0)],8,rr),Je.value&&Ke.value.show&&!ae.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":me.value},[e.createElementVNode("line",{x1:Ke.value.x,x2:Ke.value.x,y1:z.value.top,y2:z.value.bottom,stroke:Lt.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Br),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value.data,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:Ke.value.x,cy:l.y,r:X(pt.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,Mr))),128))],8,Nr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Zt.value?(e.openBlock(),e.createElementBlock("g",_r,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ne.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[l?(e.openBlock(),e.createElementBlock("g",$r,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:X(l.radius),fill:l.color,"fill-opacity":vl(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(gl(l,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>rl(l,p),onMouseleave:p=>gn(l),onClick:p=>ul(l,p)},null,42,Lr),l.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:l.x-l.radius*.65,y:l.y-l.radius*.65,width:l.radius*1.3,height:l.radius*1.3,"xlink:href":l.imageUrl,class:e.normalizeClass(`dss-bubble-image-${i} ${l.isHighlighted?"dss-bubble-highlighted":""} ${l.isDimmed?"dss-bubble-dimmed":""} ${l.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${l.radius*.65}px at ${l.radius*.65}px ${l.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:sl(l)}),onLoad:p=>jo(i),onError:p=>No(i),onMouseenter:p=>rl(l,p),onMouseleave:p=>gn(l),onClick:p=>ul(l,p)},null,46,Ar)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),xl.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:Rn.value},[be.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:It.value,cy:Tt.value,r:it.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,Dr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":be.value,"clip-path":Xn.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yt.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${l.originalIndex}-${i}`,d:l.segment.path,fill:l.segment.color,"fill-opacity":l.segment.isHighlighted?(l.segment.opacity||.8)+.2:l.segment.opacity||.8,stroke:l.segment.strokeWidth?l.segment.strokeColor||l.segment.color:"none","stroke-width":l.segment.strokeWidth||0,"clip-path":In(l.originalIndex),class:e.normalizeClass({"dss-series-highlighted":l.segment.isHighlighted,"dss-series-dimmed":l.segment.isDimmed,"dss-series-hidden":l.segment.isHidden}),onMouseover:p=>On(l.segment,p),onMouseleave:Bn},null,42,Rr))),128))],8,Hr),rt.value&&ta.value?(e.openBlock(),e.createElementBlock("g",Fr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dn.value,(l,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${i}`,x:l.x,y:l.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label",style:e.normalizeStyle({fill:l.contrastColor})},e.toDisplayString(l.value),13,Ir)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),At.value&&(ta.value||En.value||Un.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:Il.value.x,y:Il.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":El.value,fill:_l.value,class:"dss-radial-data-center"},e.toDisplayString(ml.value),9,zr)):e.createCommentVNode("",!0),aa.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Fo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cl.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${i}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":l.isHighlighted,"dss-label-dimmed":l.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${i*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:l.pointerStartX,y1:l.pointerStartY,x2:l.pointerEndX,y2:l.pointerEndY,stroke:l.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":l.pointerLineLength})},null,12,Pr),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:l.pointerEndX,y1:l.pointerEndY,x2:l.horizontalEndX,y2:l.horizontalEndY,stroke:l.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":l.horizontalLineLength})},null,12,Or),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":$.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,qr)],6))),128))],2)):e.createCommentVNode("",!0)],8,Tr)):e.createCommentVNode("",!0),Ul.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:Rn.value},[Wt.value?(e.openBlock(),e.createElementBlock("g",Zr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:It.value,cy:Tt.value,r:X(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,Ur))),128)),e.createElementVNode("g",Xr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:It.value-16,y:Tt.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Yr),e.createElementVNode("text",{x:It.value,y:Tt.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Vt(i)),9,jr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Go.value,(l,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:It.value,x2:l.x,y1:Tt.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,Kr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Gr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Do.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:l.x+Math.cos(i*2*Math.PI/Pn.value-Math.PI/2)*16,y:l.y+Math.sin(i*2*Math.PI/Pn.value-Math.PI/2)*16,"text-anchor":l.anchor,"dominant-baseline":l.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${i*120}ms`})},e.toDisplayString(l.text.charAt(0).toUpperCase()+l.text.slice(1)),13,Qr))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Jl,onMouseleave:Bn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(cn.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":Ho("current",l,i),stroke:l.color,"stroke-width":l.isHighlighted?Re.value+1:Re.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${i*Y.value}ms`,transition:"all 0.2s ease"})},null,14,Jr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.dataPoints,(p,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${i}-${g}`,cx:p.x,cy:p.y,r:X(l.isHighlighted?pt.value+1:pt.value>0?pt.value:0),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${i*Y.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:b=>On(p,b),onMouseleave:Bn},null,46,ei))),128))]))),128))],32)],8,Wr)):e.createCommentVNode("",!0),e.createElementVNode("g",ti,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ko.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:l.x,cy:l.y,r:X(l.width/2),fill:r(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,li))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ko.value,(l,i)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${i}`,x:l.x-l.width/2,y:l.y-l.height/2,width:l.width,height:l.height,"xlink:href":l.url,onLoad:p=>va(i),onError:p=>ga(i),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${i}`),"clip-path":`circle(${l.width/2}px at ${l.width/2}px ${l.height/2}px)`,style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,46,ni))),128))])],8,Ls))]),dn.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:ee.value+"px",backgroundImage:`url('${H.value}')`,backgroundRepeat:"no-repeat",...nn.value,opacity:Bl.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yn.value,(l,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+l.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:l.x+"px",top:l.y+"px",width:Al.value+"px",height:Al.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>y(l),["stop"]),onMouseenter:p=>Lo(l,p),onMouseleave:Ao},[e.createElementVNode("img",{src:pn(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,ai)],44,oi)),[[e.vShow,dl.value]])),128)),Dl.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Dl.value.x+"px",top:Dl.value.y+"px"})},[e.createElementVNode("div",si,e.toDisplayString(Dl.value.categoryValue),1),Dl.value.description?(e.openBlock(),e.createElementBlock("div",ri,e.toDisplayString(Dl.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Ue.value&&(gt.value.show||Je.value&&Ke.value.show&&!ae.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Je.value&&Ke.value.show&&!ae.value.isZooming,"dss-spider-tooltip":Ul.value&&gt.value.spiderAreas&&gt.value.spiderAreas.length>0}]),style:e.normalizeStyle(ha.value)},[!Je.value||!Ke.value.show||ae.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Ul.value&&gt.value.spiderAreas&&gt.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",ii,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value.spiderAreas,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${i}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",ci,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createTextVNode(" "+e.toDisplayString(l.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.points,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${i}-${g}`,class:"dss-tooltip-series"},[e.createElementVNode("span",ui,e.toDisplayString(p.label),1),e.createElementVNode("span",di,e.toDisplayString(p.value),1)]))),128))]))),128))])):Zt.value&&gt.value.bubbleData&&gt.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",mi,[gt.value.title?(e.openBlock(),e.createElementBlock("div",pi,e.toDisplayString(gt.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",fi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value.bubbleData,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",vi,[e.createElementVNode("div",gi,e.toDisplayString(gt.value.title),1),e.createElementVNode("div",hi,e.toDisplayString(gt.value.value),1)])),gt.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[kl(gt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",yi,[a[5]||(a[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ki,e.toDisplayString(e.unref(_)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kl(gt.value.categoryIndex).flagGroups,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",Ci,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",bi,[e.createElementVNode("div",wi,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),kl(gt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",xi,[a[6]||(a[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ei,e.toDisplayString(e.unref(_)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kl(gt.value.categoryIndex).markers,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",Si,[e.createElementVNode("div",Vi,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",Ni,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Bi,[e.createElementVNode("div",Mi,e.toDisplayString(Zt.value?Nn():L.categories[Ke.value.categoryIndex]||`Category ${Ke.value.categoryIndex+1}`),1),Zt.value?(e.openBlock(),e.createElementBlock("div",_i,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value.data,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Ke.value.data,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",$i,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",Li,e.toDisplayString(Kt(l.value)),1)]))),128))]),kl(Ke.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Ai,[a[7]||(a[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ti,e.toDisplayString(e.unref(_)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kl(Ke.value.categoryIndex).flagGroups,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",Di,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Hi,[e.createElementVNode("div",Ri,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),kl(Ke.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Fi,[a[8]||(a[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ii,e.toDisplayString(e.unref(_)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kl(Ke.value.categoryIndex).markers,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",zi,[e.createElementVNode("div",Pi,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",Oi,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),wl.value&&lt.value&&ae.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Kn},[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,Cs),K.value&&ye.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,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Ht.value.has(i),"dss-legend-hovered":he.value===i,"dss-legend-dimmed":he.value!==null&&he.value!==i}]),onClick:p=>Qo(i),onMouseenter:p=>Xt(i),onMouseleave:Hn,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:r(i)})},null,4),e.createElementVNode("span",Wi,e.toDisplayString(l.name),1)],46,qi))),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"]))},[at.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:uo},e.toDisplayString(e.unref(_)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),at.value.addMarker&&(at.value.downloadSvg||at.value.downloadPng||at.value.downloadCsv||Nt.value.length>0)?(e.openBlock(),e.createElementBlock("div",Zi)):e.createCommentVNode("",!0),at.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:fl},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),at.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Hl},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),at.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Pl},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Nt.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[at.value.downloadSvg||at.value.downloadPng||at.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Ui)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nt.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[l.separator?(e.openBlock(),e.createElementBlock("div",Xi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Vl(l)),style:e.normalizeStyle(Yn(l)),onClick:p=>xn(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Mn(l),class:"dss-custom-menu-content"},null,8,ji)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",Ki,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,Yi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Fe.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:bl},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Gi,[e.createElementVNode("h3",null,e.toDisplayString(Sl.value?e.unref(_)("chart.modalMarker.viewMarker"):bn.value?e.unref(_)("chart.modalMarker.editMarker"):e.unref(_)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:bl},"×")]),e.createElementVNode("div",Qi,[e.createElementVNode("div",Ji,[e.createVNode(na,{id:"dss-marker-date",mode:"single",modelValue:Fe.value.date,"onUpdate:modelValue":a[1]||(a[1]=l=>Fe.value.date=l),"min-date":an.value,"max-date":ll.value,disabled:Sl.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",ec,[e.createElementVNode("label",tc,e.toDisplayString(e.unref(_)("chart.modalMarker.description")),1),Sl.value?(e.openBlock(),e.createElementBlock("div",lc,e.toDisplayString(Fe.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":a[2]||(a[2]=l=>Fe.value.description=l),placeholder:e.unref(_)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,nc)),[[e.vModelText,Fe.value.description]])])]),e.createElementVNode("div",oc,[e.createElementVNode("div",ac,[bn.value&&!Sl.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:pl},e.toDisplayString(e.unref(_)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",sc,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:bl},e.toDisplayString(Sl.value?e.unref(_)("chart.modalMarker.close"):e.unref(_)("chart.modalMarker.cancel")),1),Sl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:fn,disabled:!(Fe.value.description&&Fe.value.description.length)},e.toDisplayString(bn.value?e.unref(_)("chart.modalMarker.save"):e.unref(_)("chart.contextMenu.addMarker")),9,rc))])])])])):e.createCommentVNode("",!0)],64))}}),uc={class:"dss-modal-title"},dc={class:"dss-modal-actions"},la={__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:oe}){const _=L,A=oe,ce=e.ref(null),I=e.ref(null),B=e.computed(()=>{const U={"max-width":_.width};return _.height!=="auto"&&(U.height=_.height,U["min-height"]="0"),U}),ve=e.computed(()=>({}));function ut(){A("close-modal")}function Q(){_.backDrop&&!ce.value&&A("close-modal")}function f(U){U.target.tagName==="INPUT"&&(ce.value=U.target.tagName)}function xe(){setTimeout(()=>{ce.value=null},300)}function Ce(){const U=document.body,me=document.documentElement;I.value={bodyOverflow:U.style.overflow,bodyPosition:U.style.position,bodyTop:U.style.top,bodyWidth:U.style.width,htmlOverflow:me.style.overflow,scrollY:window.scrollY},U.style.overflow="hidden",U.style.position="fixed",U.style.top=`-${I.value.scrollY}px`,U.style.width="100%",U.style.left="0",me.style.overflow="hidden"}function G(){if(!I.value)return;const U=document.body,me=document.documentElement,{bodyOverflow:F,bodyPosition:Se,bodyTop:Te,bodyWidth:nt,htmlOverflow:mt,scrollY:W}=I.value;U.style.overflow=F||"",U.style.position=Se||"",U.style.top=Te||"",U.style.width=nt||"",U.style.left="",me.style.overflow=mt||"",window.scrollTo(0,W||0)}return e.watch(()=>_.showModal,U=>{if(U)Ce(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const me=document.getElementById("dss-modal-backdrop");me&&(me.addEventListener("focusin",f),me.addEventListener("focusout",xe))},100);else{G(),document.body.classList.remove("dss-modal-open");const me=document.getElementById("dss-modal-backdrop");me&&(me.removeEventListener("focusin",f),me.removeEventListener("focusout",xe))}},{immediate:!0}),e.onUnmounted(()=>{_.showModal&&G()}),(U,me)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:Q},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(B.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",uc,[e.renderSlot(U.$slots,"title",{},()=>[me[1]||(me[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(U.$slots,"title-data"),L.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:ut,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(ve.value)},[e.renderSlot(U.$slots,"content",{},()=>[me[2]||(me[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",dc,[e.renderSlot(U.$slots,"actions")])])],4),[[e.vShow,L.showModal]])])):e.createCommentVNode("",!0)]))}},mc={key:0,class:"dss-table-toolbar"},pc={class:"dss-table-toolbar-left"},fc=["aria-expanded"],vc={class:"dss-pagination-select-dropdown",role:"listbox"},gc={class:"dss-table-column-visibility-label"},hc={class:"dss-table-checkbox-wrapper"},yc=["checked","onChange"],kc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Cc={class:"dss-table-column-visibility-text"},bc={class:"dss-table-toolbar-right"},wc=["placeholder","aria-label"],xc=["aria-label"],Ec=["aria-label","aria-expanded"],Sc={key:1,class:"dss-table-toolbar-extra"},Vc={class:"dss-table-thead"},Nc={key:0,class:"dss-table-th dss-table-selection-column"},Bc={key:0,class:"dss-table-checkbox-wrapper"},Mc=["checked","indeterminate"],_c={key:0,class:"dss-table-checkbox__indeterminate"},$c={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Lc=["aria-label"],Ac=["onClick"],Tc={class:"dss-table-th-content"},Dc={class:"dss-table-th-text"},Hc={key:0},Rc={key:1},Fc={key:2},Ic=["data-filter-column-key","aria-expanded","aria-label","onClick"],zc={class:"dss-table-tbody"},Pc=["onClick"],Oc={class:"dss-table-checkbox-wrapper"},qc=["type","name","checked","disabled","onChange"],Wc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Zc={key:1,class:"dss-table-checkbox__dot"},Uc=["onClick"],Xc=["aria-expanded","aria-label"],Yc={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},jc={key:0,class:"dss-table-expansion-row"},Kc=["colspan"],Gc=["colspan"],Qc={key:1,class:"dss-table-pagination"},Jc={class:"dss-table-pagination-left"},eu={key:0},tu={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},lu={class:"dss-table-pagination-center"},nu={key:0,class:"dss-pagination-controls"},ou=["disabled","title"],au=["disabled","title"],su=["aria-label","onKeydown"],ru={class:"dss-pagination-of"},iu=["disabled","title"],cu=["disabled","title"],uu={class:"dss-table-pagination-right"},du={class:"dss-pagination-rows-label"},mu=["aria-expanded"],pu=["aria-selected","onClick"],fu={key:0,class:"dss-table-filter-row"},vu=["value","placeholder"],gu=["min","max","value"],hu=["min","max","value"],yu={class:"dss-table-filter-double-range-values"},ku={key:2,class:"dss-table-filter-daterange"},Cu={class:"dss-table-filter-daterange-row"},bu={class:"dss-table-filter-daterange-label"},wu=["value"],xu={class:"dss-table-filter-daterange-row"},Eu={class:"dss-table-filter-daterange-label"},Su=["value"],Vu=["value","placeholder"],Nu={class:"dss-table-filter-list"},Bu=["checked","onChange"],Mu={class:"dss-table-filter-actions"},_u={name:"DSSTable"},$u=Object.assign(_u,{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:oe}){const{t:_,locale:A}=so.useI18n(),ce=L,I=oe,B={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 ve(y,h){const x=Object.assign({},y);return ut(y)&&ut(h)&&Object.keys(h).forEach(q=>{ut(h[q])?q in y?x[q]=ve(y[q],h[q]):Object.assign(x,{[q]:h[q]}):Object.assign(x,{[q]:h[q]})}),x}function ut(y){return y&&typeof y=="object"&&!Array.isArray(y)}const Q=e.computed(()=>ve(B,ce.options)),f=e.computed(()=>{const y=Q.value.table.width;return y==="auto"?null:typeof y=="number"?y:null}),xe=e.computed(()=>Q.value.table.height),Ce=e.computed(()=>Q.value.table.rowHeight??"auto"),G=e.computed(()=>({height:Ce.value})),U=e.computed(()=>Q.value.table.expandable===!0),me=e.computed(()=>Q.value.table.expandableRowData??null),F=e.computed(()=>Q.value.table.expandableRowCondition??null),Se=e.computed(()=>Q.value.table.truncated===!0),Te=e.computed(()=>Q.value.table.striped),nt=e.computed(()=>Q.value.table.bordered),mt=e.computed(()=>Q.value.table.hoverable),W=e.computed(()=>Q.value.table.size),Ze=e.computed(()=>Q.value.table.align||"left");e.computed(()=>Q.value.title.text),e.computed(()=>Q.value.subtitle.text);const qe=e.computed(()=>Q.value.selection.enabled),Ee=e.computed(()=>Q.value.selection.mode),Me=e.computed(()=>Q.value.selection.rowCondition??null),Ye=e.computed(()=>Q.value.sorting.enabled),ee=e.computed(()=>Q.value.sorting.mode),ot=e.computed(()=>Q.value.pagination.enabled),be=e.computed(()=>Q.value.pagination.rows),tt=e.computed(()=>Q.value.pagination.rowsPerPageOptions),dt=e.computed(()=>Q.value.pagination.showCounter!==!1),kt=e.computed(()=>Q.value.pagination.showControlsGroup),wt=e.computed(()=>kt.value===!1?!1:Q.value.pagination.showControls!==!1),Dt=e.computed(()=>kt.value===!1?!1:Q.value.pagination.showRowsPerPage!==!1),Ft=e.computed(()=>ot.value&&(dt.value||wt.value||Dt.value)),se=e.computed(()=>Q.value.scrollable),pe=e.computed(()=>Q.value.emptyMessage||_("table.emptyMessage")),De=e.computed(()=>Q.value.toolbar?.downloads?.pdf!==!1),_e=e.computed(()=>Q.value.toolbar?.downloads?.excel!==!1),jt=e.computed(()=>Q.value.toolbar?.search!==!1),Ct=e.computed(()=>De.value||_e.value||jt.value||Gt.value),Gt=e.computed(()=>Q.value.toolbar?.columnVisibility!==!1),$t=e.ref(""),Wt=e.ref(!1),K=e.ref(null);let ye=null;function Be(){Wt.value?(ye&&(clearTimeout(ye),ye=null),Wt.value=!1,$t.value="",I("search",""),K.value?.blur()):(Wt.value=!0,ye=setTimeout(()=>{ye=null,K.value?.focus()},80))}function Ue(){$t.value||(Wt.value=!1)}function Je(){$t.value="",I("search",""),K.value?.focus()}const Lt=e.computed(()=>({"dss-table-striped":Te.value,"dss-table-bordered":nt.value,"dss-table-hoverable":mt.value,[`dss-table-${W.value}`]:W.value!=="default","dss-table-truncated":Se.value})),lt=(y,h)=>y?.field??y?.key??h,Pt=e.ref(new Set);function We(){const y=new Set;return ce.columns.forEach((h,x)=>{h?.hidden!==!0&&y.add(lt(h,x))}),y}function Re(){const y=new Set;return ce.columns.forEach((h,x)=>{y.add(lt(h,x))}),y}function bt(y){if(!Array.isArray(y))return null;const h=Re(),x=[];return y.forEach(q=>{h.has(q)&&x.push(q)}),x}function pt(){Pt.value=We()}const J=e.computed(()=>{const y=bt(ce.columnVisibility);return y===null?null:new Set(y)}),Z=e.computed(()=>J.value??Pt.value),X=e.computed(()=>ce.columns.filter((y,h)=>Z.value.has(lt(y,h)))),re=y=>{const h=ce.columns.findIndex(x=>x===y);return lt(y,h>=0?h:0)},fe=(y,h)=>Z.value.has(lt(y,h));function et(y){I("update:columnVisibility",Array.from(y))}function St(y,h){const x=lt(y,h),q=new Set(Z.value);q.has(x)?q.delete(x):q.add(x),J.value===null&&(Pt.value=q),et(q)}const il=e.ref(null),xt=e.ref(!1);function tl(y){il.value&&!il.value.contains(y.target)&&(xt.value=!1)}const S=e.computed(()=>X.value.length+(qe.value?1:0)+(U.value?1:0)),C=(y,h)=>y?.id??y?.key??h,V=e.ref(new Set),Y=e.ref(null),le=(y,h)=>V.value.has(C(y,h)),ze=(y,h)=>{if(!U.value)return!1;if(typeof F.value=="function")return!!F.value(y,h);if(typeof me.value=="string"&&me.value.trim()){const x=bl(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},ft=(y,h,x)=>{if(x&&x.stopPropagation(),!ze(y,h))return;const q=C(y,h),de=new Set(V.value);de.has(q)?(de.delete(q),I("row-collapse",{data:y,index:h})):(de.add(q),I("row-expand",{data:y,index:h})),V.value=de},st=(y,h)=>{if(!Se.value)return;const x=C(y,h);Y.value!==x&&(Y.value=x)},Oe=e.ref(null),Vt=e.ref(0),Et=e.ref([]),vt=y=>{if(ee.value==="single")return Oe.value===y.field?Vt.value:0;{const h=Et.value.find(x=>x.field===y.field);return h?h.order:0}},at=y=>{const h=vt(y);return{"dss-sort-active":h!==0,"dss-sort-asc":h===1,"dss-sort-desc":h===-1}},Nt=e.ref({}),Bt=e.ref(null),yl=e.ref(null),Al=220,un=e.ref(null),Kt=e.computed(()=>X.value.find(y=>re(y)===Bt.value)??null),dl=e.computed(()=>{if(!Kt.value||Kt.value.filter!=="range")return null;const y=Kt.value,h=Bt.value,{min:x,max:q}=ie(y),de=y.filterMin??x,Ge=y.filterMax??q,Ot=Bl(h),fl=Ot.min??de,Hl=Ot.max??Ge,Pl=Ge-de,xn=Pl===0?0:(fl-de)/Pl*100,uo=Pl===0?100:(Hl-de)/Pl*100;return{rangeMin:de,rangeMax:Ge,currentMin:fl,currentMax:Hl,minPct:xn,maxPct:uo}}),ln=e.ref(null),yn=e.ref("max");function dn(y){const h=ln.value,x=dl.value;if(!h||!x)return;const q=h.getBoundingClientRect(),Ge=(y.clientX-q.left)/q.width*100,Ot=(x.minPct+x.maxPct)/2;yn.value=Ge<Ot?"min":"max"}function Bl(y){return Nt.value[y]??{}}function kn(y,h){Nt.value={...Nt.value,[y]:h}}function Ml(y){const h=Nt.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 mn(y){const h={...Nt.value};delete h[y],Nt.value=h,Bt.value=null,yl.value=null}function nn(){if(!Bt.value){yl.value=null;return}const y=un.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();yl.value={top:x.bottom+6,left:Math.max(8,x.right-Al)}}const Fl=e.computed(()=>{const y=String($t.value??"").trim().toLowerCase();return y?ce.data.filter(h=>X.value.some(x=>on(fn(h,x)).some(de=>String(de).toLowerCase().includes(y)))):ce.data}),kl=e.computed(()=>{let y=[...Fl.value];const h=($t.value??"").trim().toLowerCase();return h&&(y=y.filter(x=>ce.columns.some(q=>{if(!q||!q.field)return!1;const de=fn(x,q);return String(de??"").toLowerCase().includes(h)}))),X.value.forEach(x=>{const q=re(x),de=Nt.value[q];if(!de)return;const Ge=x.field;if(Ge){if(de.type==="string"&&de.value?.trim()){const Ot=de.value.trim().toLowerCase();y=y.filter(fl=>{const Hl=fn(fl,x);return String(Hl??"").toLowerCase().includes(Ot)})}else if(de.type==="range")y=y.filter(Ot=>{const fl=bl(Ot,Ge),Hl=Number(fl);return!(Number.isNaN(Hl)||de.min!=null&&Hl<de.min||de.max!=null&&Hl>de.max)});else if(de.type==="dateRange"){const Ot=de.from?new Date(de.from).getTime():null,fl=de.to?new Date(de.to).getTime():null;y=y.filter(Hl=>{const Pl=bl(Hl,Ge),xn=Pl?new Date(Pl).getTime():NaN;return!(Number.isNaN(xn)||Ot!=null&&xn<Ot||fl!=null&&xn>fl)})}else if(de.type==="list"&&de.selected?.length){const Ot=new Set(de.selected);y=y.filter(fl=>on(fn(fl,x)).some(Pl=>Ot.has(Pl)))}}}),y});function on(y){if(y==null)return[""];if(Array.isArray(y))return y.flatMap(on);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 H(y){const h=new Set;return ce.data.forEach(x=>{on(fn(x,y)).forEach(de=>h.add(de))}),Array.from(h).sort((x,q)=>String(x).localeCompare(String(q)))}function P(y,h){if(Bt.value===y){Bt.value=null,yl.value=null;return}if(Bt.value=y,h?.currentTarget){const x=h.currentTarget.getBoundingClientRect();yl.value={top:x.bottom+6,left:Math.max(8,x.right-Al)}}else nn()}function $(y,h){kn(y,{type:"string",value:h})}function ie(y){const h=y.field;if(!h)return{min:0,max:100};let x=1/0,q=-1/0;return ce.data.forEach(de=>{const Ge=bl(de,h),Ot=Number(Ge);Number.isNaN(Ot)||(x=Math.min(x,Ot),q=Math.max(q,Ot))}),{min:x===1/0?0:x,max:q===-1/0?100:q}}function Le(y,h,x){const q={...Bl(y),type:"range"},de=x===""?null:Number(x),Ge=de===null||Number.isNaN(de)?null:de;q[h]=Ge,Ge!=null&&(h==="min"&&q.max!=null&&Ge>q.max&&(q.max=Ge),h==="max"&&q.min!=null&&Ge<q.min&&(q.min=Ge)),kn(y,q)}function ct(y,h,x){const q={...Bl(y),type:"dateRange"};q[h]=x||"",kn(y,q)}const rt=e.reactive({});function je(y,h){rt[y]=h}function At(y){const h=re(y),x=(rt[h]??"").trim().toLowerCase(),q=H(y);return x?q.filter(de=>String(de).toLowerCase().includes(x)):q}function ml(y,h){return(Bl(y).selected??[]).includes(h!=null?String(h):"")}function El(y,h){const q=[...Bl(y).selected??[]],de=h!=null?String(h):"",Ge=q.indexOf(de);Ge>=0?q.splice(Ge,1):q.push(de),kn(y,{type:"list",selected:q})}function Il(y){Bt.value&&!y.target.closest(".dss-table-filter-wrap")&&!y.target.closest(".dss-table-filter-dropdown")&&(Bt.value=null,yl.value=null)}function _l(){nn(),Jt.value&&Ke()}const Dn=y=>{if(!(y.sortable===!1||!Ye.value))if(ee.value==="single")Oe.value===y.field?Vt.value=Vt.value===1?-1:Vt.value===-1?0:1:(Oe.value=y.field,Vt.value=1),Vt.value===0&&(Oe.value=null),I("sort",{field:Oe.value,order:Vt.value});else{const h=Et.value.findIndex(x=>x.field===y.field);h>=0?Et.value[h].order===1?Et.value[h].order=-1:Et.value.splice(h,1):Et.value.push({field:y.field,order:1}),I("sort",{multiSortMeta:Et.value})}},Cn=e.computed(()=>{if(!Ye.value)return kl.value;let y=[...kl.value];return ee.value==="single"&&Oe.value&&Vt.value!==0?y.sort((h,x)=>{const q=bl(h,Oe.value),de=bl(x,Oe.value);return q===de?0:q==null?1:de==null?-1:(q<de?-1:q>de?1:0)*Vt.value}):ee.value==="multiple"&&Et.value.length>0&&y.sort((h,x)=>{for(const q of Et.value){const de=bl(h,q.field),Ge=bl(x,q.field);if(de===Ge)continue;if(de==null)return 1;if(Ge==null)return-1;const Ot=de<Ge?-1:de>Ge?1:0;if(Ot!==0)return Ot*q.order}return 0}),y}),cl=e.ref(0),Tl=e.ref(be.value),Jt=e.ref(!1),$l=e.ref(null),Ht=e.ref(null),he=e.ref("bottom"),Mt=e.ref(null),gt=y=>{Tl.value=y,Jt.value=!1,cl.value=0,I("page",{page:0,rows:Tl.value})};function Dl(y){$l.value&&!$l.value.contains(y.target)&&(Jt.value=!1)}function Ke(){const y=$l.value,h=Ht.value;if(!y||!h)return;const x=y.querySelector(".dss-pagination-select-dropdown");if(!x)return;const q=h.getBoundingClientRect(),de=x.offsetHeight||0,Ot=(window.innerHeight||document.documentElement.clientHeight)-q.bottom,fl=q.top;he.value=Ot<de+8&&fl>Ot?"top":"bottom",Mt.value={width:`${Math.ceil(q.width)}px`,left:`${Math.max(0,Math.round(h.offsetLeft))}px`}}const ht=e.computed(()=>Cn.value.length),ae=e.computed(()=>Math.ceil(ht.value/Tl.value)),el=e.computed(()=>Math.max(ae.value,1)),Fe=e.computed(()=>ht.value===0?0:ll.value+1),an=e.computed(()=>bn.value),ll=e.computed(()=>ot.value?cl.value*Tl.value:0),bn=e.computed(()=>ot.value?Math.min((cl.value+1)*Tl.value,ht.value):ht.value),Sl=e.computed(()=>{if(!ot.value)return Cn.value;const y=ll.value,h=bn.value;return Cn.value.slice(y,h)}),Xt=e.ref(new Set),Hn=e.computed(()=>Cn.value.filter((y,h)=>Xt.value.has(C(y,h)))),nl=(y,h)=>{const x=Me.value;return typeof x!="function"?!0:!!x(y,h)},zl=e.computed(()=>Cn.value.map((y,h)=>({row:y,index:h})).filter(({row:y,index:h})=>nl(y,h))),Wn=e.computed(()=>{const y=zl.value;return y.length===0?!1:y.every(({row:h,index:x})=>Xt.value.has(C(h,x)))}),ql=e.computed(()=>{const y=zl.value;if(y.length===0)return!1;const h=y.filter(({row:x,index:q})=>Xt.value.has(C(x,q))).length;return h>0&&h<y.length}),Mn=(y,h)=>Xt.value.has(C(y,h)),Vl=()=>{if(Wn.value)Xt.value=new Set,I("unselect-all");else{const y=new Set;zl.value.forEach(({row:h,index:x})=>y.add(C(h,x))),Xt.value=y,I("select-all",Hn.value)}},Yn=(y,h)=>{if(!nl(y,h))return;const x=C(y,h),q=new Set(Xt.value),de=q.has(x);Ee.value==="single"?de?(q.delete(x),I("row-unselect",y)):(q.clear(),q.add(x),I("row-select",y)):de?(q.delete(x),I("row-unselect",y)):(q.add(x),I("row-select",y)),Xt.value=q},pn=e.ref("1"),Zn=()=>{const y=Number.parseInt(String(pn.value),10);if(!Number.isFinite(y)){pn.value=String(cl.value+1);return}const h=Math.min(el.value,Math.max(1,y));h!==cl.value+1?wn(h-1):pn.value=String(h)},wn=y=>{y<0||y>=ae.value||(cl.value=y,I("page",{page:y,rows:Tl.value}))},jn=(y,h,x)=>{I("row-click",{data:y,index:h,originalEvent:x}),st(y,ll.value+h)},Nl=(y,h)=>{const x=ll.value+h;return{"dss-table-row-selected":Mn(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":Y.value===C(y,x)}},fn=(y,h)=>h.field?bl(y,h.field):"",bl=(y,h)=>h.split(".").reduce((x,q)=>x&&x[q],y),pl=y=>{const h=y.align??Ze.value;return{"dss-table-sortable":y.sortable!==!1&&Ye.value,"dss-table-align-left":h==="left","dss-table-align-center":h==="center","dss-table-align-right":h==="right",[y.className]:y.className}},Wl=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!==A.value&&(A.value=y)},{immediate:!0}),e.watch(be,y=>{Tl.value=y,cl.value=0}),e.watch(Jt,async y=>{y&&(await e.nextTick(),Ke())}),e.watch(cl,y=>{pn.value=String(y+1)},{immediate:!0}),e.watch($t,y=>{I("search",y??"")}),e.watch(()=>ce.columns,()=>{if(J.value===null){pt();return}const y=bt(ce.columnVisibility)??[];y.length!==ce.columnVisibility.length&&I("update:columnVisibility",y)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Dl),document.addEventListener("click",tl),document.addEventListener("click",Il),window.addEventListener("resize",_l),window.addEventListener("scroll",_l,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Dl),document.removeEventListener("click",tl),document.removeEventListener("click",Il),window.removeEventListener("resize",_l),window.removeEventListener("scroll",_l,!0)}),(y,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:un,style:e.normalizeStyle({width:f.value+"px",height:xe.value?xe.value+"px":"auto"})},[Ct.value?(e.openBlock(),e.createElementBlock("div",mc,[e.createElementVNode("div",pc,[De.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:h[0]||(h[0]=x=>I("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),_e.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:h[1]||(h[1]=x=>I("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),Gt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:il},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":xt.value}]),onClick:h[2]||(h[2]=x=>xt.value=!xt.value),"aria-expanded":xt.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,fc),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",vc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.columns,(x,q)=>(e.openBlock(),e.createElementBlock("li",{key:lt(x,q),role:"option",class:"dss-table-column-visibility-option",onClick:h[3]||(h[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",gc,[e.createElementVNode("span",hc,[e.createElementVNode("input",{type:"checkbox",checked:fe(x,q),onChange:de=>St(x,q),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,yc),fe(x,q)?(e.openBlock(),e.createElementBlock("span",kc,[...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",Cc,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,xt.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(y.$slots,"header")]),e.createElementVNode("div",bc,[jt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Wt.value||$t.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:K,"onUpdate:modelValue":h[4]||(h[4]=x=>$t.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=>Wt.value=!0),onBlur:Ue},null,40,wc),[[e.vModelText,$t.value]]),$t.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(_)("table.clearSearchAriaLabel"),onClick:Je},[...h[26]||(h[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,xc)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(_)("table.searchAriaLabel"),"aria-expanded":Wt.value||!!$t.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,Ec)],2)):e.createCommentVNode("",!0),y.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Sc,[e.renderSlot(y.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":se.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Lt.value])},[e.createElementVNode("thead",Vc,[e.createElementVNode("tr",null,[qe.value?(e.openBlock(),e.createElementBlock("th",Nc,[Ee.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Bc,[e.createElementVNode("input",{type:"checkbox",checked:Wn.value,indeterminate:ql.value,onChange:Vl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Mc),ql.value?(e.openBlock(),e.createElementBlock("span",_c)):Wn.value?(e.openBlock(),e.createElementBlock("span",$c,[...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),U.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(_)("table.expandRowAriaLabel")},null,8,Lc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,(x,q)=>(e.openBlock(),e.createElementBlock("th",{key:re(x),class:e.normalizeClass(["dss-table-th",pl(x)]),style:e.normalizeStyle(Wl(x)),onClick:de=>Dn(x)},[e.createElementVNode("div",Tc,[e.createElementVNode("span",Dc,e.toDisplayString(x.header),1),x.sortable!==!1&&Ye.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",at(x)])},[vt(x)===0?(e.openBlock(),e.createElementBlock("span",Hc,[...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)])])):vt(x)===1?(e.openBlock(),e.createElementBlock("span",Rc,[...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)])])):vt(x)===-1?(e.openBlock(),e.createElementBlock("span",Fc,[...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===re(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":Ml(re(x))}]),"data-filter-column-key":re(x),"aria-expanded":Bt.value===re(x),"aria-label":e.unref(_)("table.filterColumnAriaLabel"),onClick:de=>P(re(x),de)},[...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,Ic)],2)):e.createCommentVNode("",!0)])],14,Ac))),128))])]),e.createElementVNode("tbody",zc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Sl.value,(x,q)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C(x,ll.value+q)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Nl(x,q)]),style:e.normalizeStyle(G.value),onClick:de=>jn(x,q,de)},[qe.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",Oc,[e.createElementVNode("input",{type:Ee.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${L.tableId}`,checked:Mn(x,ll.value+q),disabled:!nl(x,ll.value+q),onChange:de=>Yn(x,ll.value+q),class:e.normalizeClass(["dss-table-checkbox",Ee.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!nl(x,ll.value+q)}])},null,42,qc),Ee.value==="multiple"&&Mn(x,ll.value+q)?(e.openBlock(),e.createElementBlock("span",Wc,[...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"&&Mn(x,ll.value+q)?(e.openBlock(),e.createElementBlock("span",Zc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),U.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(de=>ft(x,ll.value+q,de),["stop"])},[ze(x,ll.value+q)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":le(x,ll.value+q),"aria-label":le(x,ll.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":le(x,ll.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,Xc)):(e.openBlock(),e.createElementBlock("span",Yc))],8,Uc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,(de,Ge)=>(e.openBlock(),e.createElementBlock("td",{key:re(de),class:e.normalizeClass(["dss-table-td",pl(de)]),style:e.normalizeStyle(Wl(de))},[e.renderSlot(y.$slots,`cell-${de.field}`,{data:x,column:de,rowIndex:q,isExpanded:Y.value===C(x,ll.value+q)},()=>[e.createTextVNode(e.toDisplayString(fn(x,de)),1)])],6))),128))],14,Pc),U.value&&ze(x,ll.value+q)&&le(x,ll.value+q)?(e.openBlock(),e.createElementBlock("tr",jc,[e.createElementVNode("td",{colspan:S.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(y.$slots,"expansion",{data:x,rowIndex:q})],8,Kc)])):e.createCommentVNode("",!0)],64))),128)),Sl.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(G.value)},[e.createElementVNode("td",{colspan:S.value,class:"dss-table-empty-cell"},[e.renderSlot(y.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(pe.value),1)])],8,Gc)],4))])],2)],2),Ft.value?(e.openBlock(),e.createElementBlock("div",Qc,[e.createElementVNode("div",Jc,[dt.value?(e.openBlock(),e.createElementBlock("span",eu,e.toDisplayString(e.unref(_)("table.showingRange",{start:Fe.value,end:an.value,total:ht.value})),1)):(e.openBlock(),e.createElementBlock("span",tu," "))]),e.createElementVNode("div",lu,[wt.value?(e.openBlock(),e.createElementBlock("div",nu,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:cl.value===0,onClick:h[8]||(h[8]=x=>wn(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,ou),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:cl.value===0,onClick:h[9]||(h[9]=x=>wn(cl.value-1)),title:e.unref(_)("table.previousPage")}," ‹ ",8,au),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[10]||(h[10]=x=>pn.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(_)("table.currentPageAriaLabel"),onBlur:Zn,onKeydown:e.withKeys(e.withModifiers(Zn,["prevent"]),["enter"])},null,40,su),[[e.vModelText,pn.value]]),e.createElementVNode("span",ru,e.toDisplayString(e.unref(_)("table.ofPages",{total:el.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:cl.value>=ae.value-1,onClick:h[11]||(h[11]=x=>wn(cl.value+1)),title:e.unref(_)("table.nextPage")}," › ",8,iu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:cl.value>=ae.value-1,onClick:h[12]||(h[12]=x=>wn(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,cu)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",uu,[Dt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:$l},[e.createElementVNode("span",du,e.toDisplayString(e.unref(_)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Jt.value}]),onClick:h[13]||(h[13]=x=>Jt.value=!Jt.value),"aria-expanded":Jt.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:Ht},[e.createTextVNode(e.toDisplayString(Tl.value)+" ",1),h[37]||(h[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,mu),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(Mt.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tt.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===Tl.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===Tl.value}]),onClick:q=>gt(x)},e.toDisplayString(x),11,pu))),128))],6),[[e.vShow,Jt.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(yl.value?{top:yl.value.top+"px",left:yl.value.left+"px",width:Al+"px"}:void 0),onClick:h[21]||(h[21]=e.withModifiers(()=>{},["stop"]))},[Kt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Kt.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",fu,[e.createElementVNode("input",{type:"text",value:Bl(Bt.value).value??"",onInput:h[14]||(h[14]=x=>$(Bt.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(_)("table.search")},null,40,vu)])):Kt.value.filter==="range"&&dl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":dl.value.minPct+"%","--range-max-pct":dl.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:ln,class:"dss-table-filter-double-range-track",onMousemove:dn,onMouseenter:dn},[e.createElementVNode("input",{type:"range",min:dl.value.rangeMin,max:dl.value.rangeMax,value:dl.value.currentMin,onInput:h[15]||(h[15]=x=>Le(Bt.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:yn.value==="min"?2:1})},null,44,gu),e.createElementVNode("input",{type:"range",min:dl.value.rangeMin,max:dl.value.rangeMax,value:dl.value.currentMax,onInput:h[16]||(h[16]=x=>Le(Bt.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:yn.value==="max"?2:1})},null,44,hu)],544),e.createElementVNode("div",yu,e.toDisplayString(dl.value.currentMin)+" – "+e.toDisplayString(dl.value.currentMax),1)],4)):Kt.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",ku,[e.createElementVNode("div",Cu,[e.createElementVNode("label",bu,e.toDisplayString(e.unref(_)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:Bl(Bt.value).from??"",onInput:h[17]||(h[17]=x=>ct(Bt.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,wu)]),e.createElementVNode("div",xu,[e.createElementVNode("label",Eu,e.toDisplayString(e.unref(_)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:Bl(Bt.value).to??"",onInput:h[18]||(h[18]=x=>ct(Bt.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Su)])])):Kt.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:rt[Bt.value]??"",onInput:h[19]||(h[19]=x=>je(Bt.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(_)("table.search")},null,40,Vu),e.createElementVNode("div",Nu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(At(Kt.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:ml(Bt.value,x),onChange:q=>El(Bt.value,x)},null,40,Bu),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Mu,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:h[20]||(h[20]=x=>mn(Bt.value))},e.toDisplayString(e.unref(_)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Bt.value&&Kt.value&&yl.value]])]),_:1})]))],64))}}),Lu="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",Au="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",Tu="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",Du="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M9.68%2014V12.26H5.78V10.088L9.152%205.24H10.832L7.22%2010.484V10.94H9.68V8.96H11.18V14H9.68Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Hu="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",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='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",Fu={class:"dss-toolbar-left"},Iu=["title"],zu=["title"],Pu={class:"dss-toolbar-dropdown-wrapper"},Ou=["title"],qu=["src"],Wu=["src"],Zu=["src"],Uu=["src"],Xu=["src"],Yu=["src"],ju={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Ku=["src"],Gu=["src"],Qu=["src"],Ju=["src"],ed=["src"],td=["src"],ld=["title"],nd=["title"],od=["title"],ad=["title"],sd=["title"],rd=["title"],id=["title"],cd=["title"],ud=["title"],dd={key:2,class:"dss-toolbar-separator"},md=["title"],pd={key:4,class:"dss-toolbar-separator"},fd={key:5,class:"dss-toolbar-dropdown-wrapper"},vd=["title"],gd={class:"dss-toolbar-dropdown-ai"},hd={class:"dss-toolbar-right"},yd={key:0,class:"dss-toolbar-custom-group"},kd={key:1,class:"dss-toolbar-separator"},Cd={class:"dss-link-modal-content"},bd={class:"dss-link-modal-field"},wd={class:"dss-link-modal-label"},xd=["placeholder"],Ed={class:"dss-link-modal-field"},Sd={class:"dss-link-modal-label"},Vd=["placeholder"],Nd={class:"dss-image-modal-tabs"},Bd={key:0,class:"dss-image-tab-content"},Md={class:"dss-link-modal-content"},_d={class:"dss-link-modal-field"},$d={key:0,class:"dss-link-modal-label"},Ld=["src"],Ad={class:"dss-link-modal-field"},Td={class:"dss-link-modal-label"},Dd=["placeholder"],Hd={class:"dss-link-modal-field"},Rd={class:"dss-link-modal-label"},Fd=["placeholder"],Id={class:"dss-link-modal-field"},zd={class:"dss-link-modal-label"},Pd=["placeholder"],Od={key:1,class:"dss-image-tab-content"},qd={class:"dss-link-modal-content"},Wd={class:"dss-link-modal-field"},Zd={class:"dss-link-modal-label"},Ud=["placeholder"],Xd={class:"dss-link-modal-field"},Yd={class:"dss-link-modal-label"},jd=["placeholder"],Kd={class:"dss-link-modal-field"},Gd={class:"dss-link-modal-label"},Qd=["placeholder"],Jd={class:"dss-link-modal-field"},e1={class:"dss-link-modal-label"},t1=["placeholder"],l1={class:"dss-text-editor-title-input-container"},n1={key:0,class:"dss-text-editor-title-preview"},o1={key:0},a1={key:1,class:"dss-text-editor-preview-placeholder"},s1=["value","placeholder","disabled"],r1={key:3,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},i1={class:"dss-text-editor-description-input-container"},c1={key:0,class:"dss-text-editor-description-preview"},u1={key:0},d1={key:1,class:"dss-text-editor-preview-placeholder"},m1=["value","placeholder","disabled"],p1={key:5,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},f1=["data-comment-id","onMouseenter"],v1=["onClick"],g1=["src","alt"],h1={key:1},y1=["onClick"],k1=["src","alt"],C1={key:1},b1=["data-has-second-user","onClick"],w1={class:"editor-comment-marker-count"},x1={key:7,class:"dss-text-editor-textarea-wrapper"},E1=["value","placeholder","rows","disabled"],S1={class:"dss-text-editor-footer"},V1={class:"dss-text-editor-footer-content"},N1={class:"dss-text-editor-footer-stat"},B1={class:"dss-text-editor-footer-stat"},M1={key:8,class:"dss-text-editor-content-wrapper"},_1={key:0,class:"dss-comment-overlay-body"},$1={class:"dss-comment-selection-wrapper"},L1=["innerHTML"],A1={class:"dss-comment-messages-wrapper"},T1={key:0,class:"dss-comment-avatar-wrapper"},D1={class:"dss-comment-avatar"},H1=["src","alt"],R1={key:1},F1={class:"dss-comment-header"},I1={class:"dss-comment-header-text"},z1={class:"dss-comment-author"},P1={key:0,class:"dss-comment-date"},O1=["onClick","title"],q1={class:"dss-comment-overlay-inner"},W1=["placeholder","onKeydown"],Z1={class:"dss-text-editor-footer"},U1={class:"dss-text-editor-footer-content"},X1={class:"dss-text-editor-footer-stat"},Y1={class:"dss-text-editor-footer-stat"},j1=["title"],K1=["title"],G1={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:""},Q1={class:"dss-image-popup-content"},J1={key:0,class:"dss-image-popup-no-alt-icon"},em=["title"],tm=["title"],lm={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:""},nm={class:"dss-toolbar-left"},om=["title"],am=["title"],sm={class:"dss-toolbar-dropdown-wrapper"},rm=["title"],im=["src"],cm=["src"],um=["src"],dm=["src"],mm=["src"],pm=["src"],fm={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},vm=["title"],gm=["title"],hm=["title"],ym=["title"],km=["title"],Cm=["title"],bm=["title"],wm=["title"],xm=["title"],Em={key:2,class:"dss-toolbar-separator"},Sm=["title"],Vm={key:4,class:"dss-toolbar-separator"},Nm={key:5,class:"dss-toolbar-dropdown-wrapper"},Bm=["title"],Mm={class:"dss-toolbar-dropdown-ai"},_m={key:0,class:"dss-toolbar-right"},$m={key:0,class:"dss-toolbar-separator"},Lm={key:0,class:"dss-toolbar-custom-group"},Am={key:1,class:"dss-toolbar-separator"},Tm={name:"DSSTextEditor"},Dm=Object.assign(Tm,{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:oe,emit:_}){const{t:A,locale:ce}=so.useI18n(),I={h1:Lu,h2:Au,h3:Tu,h4:Du,h5:Hu,h6:Ru},B=L,ve=_,ut=e.useSlots(),Q=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
99
99
  <path d="M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z" fill="#c13340"/>
100
- </svg>`,f=e.ref(null),we=e.ref(null),Ce=e.ref(!1),G=e.ref(!1),U=e.ref(!1),pe=e.ref(""),F=e.ref({}),Ee=e.ref(!1),De=e.ref(!1),tt=e.ref(""),pt=e.ref(""),W=e.ref(null),Ze=e.ref(null),qe=e.ref(null),xe=e.ref(null),Me=e.ref(""),Ye=e.ref(!1),ee=e.ref({}),lt=e.ref(!1),be=e.ref({}),Je=e.ref(null),ut=e.ref(null),Ct=e.ref(!1),Et=e.ref(""),Ht=e.ref(null),Pt=e.ref(""),se=e.ref(""),ge=e.ref(""),He=e.ref(null),_e=e.ref(null),Xt=e.ref(null),bt=e.ref(null),Gt=e.ref(null),Lt=e.ref(!1),qt=e.ref(""),K=e.ref({}),ye=e.ref(!1),Be=e.ref("upload"),Ue=e.ref(""),Ke=e.ref(null),Tt=e.ref(null),et=e.ref([]),Ot=e.ref([]),We=e.ref(null),Fe=e.ref(!1),xt=e.ref(""),ft=e.ref(""),J=e.ref(""),Z=e.ref(""),X=e.ref(""),re=e.ref(""),fe=e.ref(null),Ge=e.ref(null),Nt=e.ref(null),rl=e.ref(!1),St=e.ref(null),ll=e.ref(!1),S=e.ref(!1),C=e.ref(null),V=e.ref("p"),Y=e.ref(!1),le=e.ref([]),ze=e.ref(null),gt=e.ref(null),rt=e.ref(null),Oe=e.ref(!1),Bt=e.ref(0),Vt=100,ht=e.ref(null),yt=e.computed(()=>({"dss-text-editor-no-border":!$.border,"dss-text-editor-rounded":$.rounded,"dss-text-editor-full-height":$.fullHeight,"dss-comment-overlay-open":At.value!==null})),Mt=e.computed(()=>({})),_t=e.computed(()=>!$.fixedHeight||$.fullHeight?{}:{height:`${1.6*14*$.rows+24+2}px`,resize:"none",overflowY:"auto"}),hl=e.computed(()=>!$.fixedHeight||$.fullHeight?{}:{height:`${1.6*14*$.rows+32}px`,overflowY:"auto"}),Al=e.computed(()=>$.richText&&Ot.value.length>0),on=e.computed(()=>{if(!$.modelValue)return"";if($.richText){let o=$.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/&nbsp;/g," "),o=o.replace(/&amp;/g,"&"),o=o.replace(/&lt;/g,"<"),o=o.replace(/&gt;/g,">"),o=o.replace(/&quot;/g,'"'),o=o.replace(/&#39;/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return $.modelValue}),Wt=e.computed(()=>{const o=on.value.trim();return o?o.split(/\s+/).filter(n=>n.length>0).length:0}),dl=e.computed(()=>on.value.length),vn=e.computed(()=>bt.value!==null&&Be.value==="upload"&&Pt.value&&Pt.value.startsWith("data:")),gn=e.computed(()=>$.titlePlaceholder||A("textEditor.placeholders.title")),an=e.computed(()=>$.descriptionPlaceholder||A("textEditor.placeholders.description")),Tl=e.computed(()=>$.placeholder||A("textEditor.placeholders.startTyping")),El=o=>ct&&ct[o]!==void 0,xn=o=>{for(let n=o+1;n<$.customToolbarSlots.length;n++)if(El($.customToolbarSlots[n]))return!0;return!1},sn=o=>{for(let n=o+1;n<$.customToolbarSlots.length;n++){const s=$.customToolbarSlots[n];if(El(s)&&Fl(s))return!0}return!1},Fl=o=>$.customToolbarFloatingMap.hasOwnProperty(o)?$.customToolbarFloatingMap[o]===!0:!0,Gl=e.computed(()=>$.customToolbarSlots.some(o=>El(o)&&Fl(o))),yl=e.computed(()=>El("title-slot")),Ql=e.computed(()=>El("description-slot")),D=o=>{if(!o||o.trim()==="")return"<html></html>";const n=o.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?o:`<html>${o}</html>`},O=o=>{if(!o||o.trim()==="")return"";const n=o.replace(/<!--[\s\S]*?-->/g,""),s=n.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():n},_=o=>{if(!o)return;const n=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),s=[];let r=n.nextNode();for(;r;)s.push(r),r=n.nextNode();s.forEach(c=>c.remove())},ce=o=>{try{const n=String(o.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],c=o.getFullYear();return`${n} ${r} ${c}`}catch{return""}},$e=o=>{if(!o||typeof o!="string")return!1;const n=o.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const c=A("textEditor.started_conversation");if(c&&n===c)return!0}catch{}const r=n.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},dt=o=>{const n=o.target.value;ve("update:modelValue",n),ve("change",n)},Qe=()=>{if(!fe.value)return;const o=fe.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},ot=()=>{ll.value=!0,Qe()},Dt=()=>{ll.value=!1,nl()},nl=()=>{if(!fe.value)return;const o=fe.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const n=o.value;o.value="M";const s=o.scrollHeight;o.value=n,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")},Dl=o=>{const s=o.target.value;ll.value&&Qe(),ve("update:title",s),ve("title-change",s),Nt.value="title",$.richText&&(Fe.value||(ft.value=xt.value,X.value=J.value,re.value=Z.value),We.value&&clearTimeout(We.value),Fe.value=!0,We.value=setTimeout(()=>{Fe.value=!1,at()},500))},Nl=()=>{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 r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},Ol=()=>{S.value=!0,Nl()},$n=()=>{S.value=!1,Jl()},Jl=()=>{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 n=o.value;o.value="M";const s=o.scrollHeight;o.value=n,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")},kl=o=>{const s=o.target.value;S.value&&Nl(),ve("update:description",s),ve("description-change",s),Nt.value="description",$.richText&&(Fe.value||(ft.value=xt.value,X.value=J.value,re.value=Z.value),We.value&&clearTimeout(We.value),Fe.value=!0,We.value=setTimeout(()=>{Fe.value=!1,at()},500))},Qt=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const n=o.getRangeAt(0);if(n.startContainer.nodeType===1)return{type:"element",element:n.startContainer,offset:n.startOffset};const s=n.cloneRange();return s.selectNodeContents(f.value),s.setEnd(n.startContainer,n.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+n.toString().length}},ol=o=>{if(!(!o||!f.value))try{const n=window.getSelection(),s=document.createRange();if(o.type==="element"&&o.element)if(f.value.contains(o.element)){s.setStart(o.element,o.offset),s.collapse(!0),n.removeAllRanges(),n.addRange(s);return}else{f.value.focus();return}let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(s.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(s.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}n.removeAllRanges(),n.addRange(s)}catch{f.value.focus()}},rn=()=>{if(!f.value)return;f.value.focus();const o=window.getSelection(),n=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},r=s(f.value);if(r.nodeType===3)n.setStart(r,r.length),n.setEnd(r,r.length);else if(r.childNodes.length>0){const c=s(r);c&&c.nodeType===3?(n.setStart(c,c.length),n.setEnd(c,c.length)):(n.selectNodeContents(r),n.collapse(!1))}else n.setStart(r,0),n.setEnd(r,0);o.removeAllRanges(),o.addRange(n)},at=(o=!1)=>{if(!f.value)return;const n=f.value.innerHTML,s=$.title||"",r=$.description||"";if(!o&&n===xt.value&&s===J.value&&r===Z.value)return;const c={content:ft.value||xt.value,title:X.value!==void 0?X.value:J.value,description:re.value!==void 0?re.value:Z.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(),Ot.value=[]),xt.value=n,J.value=s,Z.value=r,ft.value=n,X.value=s,re.value=r},de=o=>{if(!f.value)return;hn(),f.value&&_(f.value);let n=null;f.value&&(f.value.querySelector("p")||(n=Qt(),kt()));const s=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");s&&C.value&&(C.value=null),G.value=!0;const r=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),c=D(r);ve("update:modelValue",c),ve("change",c),Nt.value="editor",Fe.value||(ft.value=xt.value,X.value=J.value,re.value=Z.value),We.value&&clearTimeout(We.value),Fe.value=!0,We.value=setTimeout(()=>{Fe.value=!1,at(),Gn(),Mo()},500),e.nextTick(()=>{n&&ol(n),hn();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,v=m&&m.collapsed;if(d.forEach(k=>{try{if(v&&C.value?.command===k){ee.value[k]=C.value.state;return}if(k==="bold")if(m){const L=m.commonAncestorContainer,R=L.nodeType===3?L.parentElement:L;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 ae=window.getComputedStyle(R);parseInt(ae.fontWeight)>=600&&(E=!0)}catch{}ee.value[k]=E}else ee.value.hasOwnProperty(k)||(ee.value[k]=!1);else if(k==="italic")if(m){const L=m.commonAncestorContainer,R=L.nodeType===3?L.parentElement:L,E=R&&(R.tagName==="EM"||R.tagName==="I"||R.closest&&R.closest("em, i"));ee.value[k]=!!E}else{const L=document.queryCommandState(k);ee.value[k]=L}else{const L=document.queryCommandState(k);ee.value[k]=L}}catch{}}),Ml(),ml(),Ae(),tl(),wt(),wl("handleRichTextInput"),s&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const k=o.data||"";k&&k.length===1&&setTimeout(()=>Mo(k),0),(k===" "||k===`
101
- `||/[.,;:!?]/.test(k))&&setTimeout(()=>{Gn()},100)}G.value=!1})},hn=()=>{if(!f.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0),s=n.commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(!r)return;const c=r.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(r!==d&&!d?.contains(r)){const u=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,m=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.contains(u)&&u!==d||c.contains(m)&&m!==d){const v=document.createRange();v.setStartAfter(c),v.collapse(!0),o.removeAllRanges(),o.addRange(v)}}}},kt=()=>{if(!f.value)return;const o=f.value;if(o.querySelector&&o.querySelector("p"))return;const n=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),s=Array.from(o.childNodes);let r=null;s.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}r||(r=document.createElement("p"),o.insertBefore(r,c)),r.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){r=null;return}if(n.has(u)){r=null;return}r||(r=document.createElement("p"),o.insertBefore(r,d)),r.appendChild(d)}})},ml=()=>{if(f.value&&!rl.value){rl.value=!0;try{f.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),f.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const c=r.parentElement;!c||!c.classList.contains("dss-image-wrapper")?r.remove():c.querySelector("img")||r.remove()}),f.value.querySelectorAll("img").forEach(r=>{let c=r.getAttribute("alt");c===null&&(c=r.alt||"");const d=r.getAttribute("src")||r.src||"";if(c){const k=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),L=c===d||c===k;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||L||L)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=r.parentElement;const v=m&&m.classList.contains("dss-image-wrapper");if(v){const k=m.querySelector(".dss-image-no-alt-icon");k&&k.remove()}else{const k=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;k&&k.remove()}if(u){v?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const k=document.createElement("div");k.className="dss-image-no-alt-icon",k.setAttribute("contenteditable","false"),k.innerHTML=Q,m.appendChild(k)}else if(v&&m.children.length===1){const k=m.parentNode;k.insertBefore(r,m),k.removeChild(m)}})}finally{rl.value=!1}}},st=o=>{Gn(),ve("blur",o),qn()},vt=()=>{if($.disabled||!$.richText||!f.value)return;il(),We.value&&(clearTimeout(We.value),We.value=null),Fe.value&&(at(),Fe.value=!1);const o=Nt.value==="title",n=Nt.value==="description",s=Nt.value==="editor";if(et.value.length===0){o&&fe.value?fe.value.focus():n&&Ge.value?Ge.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{de()});return}const r={content:f.value.innerHTML,title:$.title||"",description:$.description||""};Ot.value.push(r);const c=et.value.pop();if(c!==void 0){G.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,xt.value=d,J.value=u,Z.value=m,ft.value=d,X.value=u,re.value=m,e.nextTick(()=>{Ml(),pl(),it(),tl();const v=D(d);ve("update:modelValue",v),ve("update:title",u),ve("update:description",m),ve("change",v),ve("title-change",u),ve("description-change",m),G.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(fe.value){fe.value.focus();const k=u.length;fe.value.setSelectionRange&&fe.value.setSelectionRange(k,k),Qe()}}else if(n){if(Ge.value){Ge.value.focus();const k=m.length;Ge.value.setSelectionRange(k,k)}}else if(s)rn();else if(fe.value&&document.activeElement===fe.value){const k=u.length;fe.value.setSelectionRange&&fe.value.setSelectionRange(k,k),Qe()}else if(Ge.value&&document.activeElement===Ge.value){const k=m.length;Ge.value.setSelectionRange(k,k)}else f.value&&rn()},10)})})}},oe=()=>{if($.disabled||!$.richText||!f.value)return;il();const o=Nt.value==="title",n=Nt.value==="description",s=Nt.value==="editor";if(Ot.value.length===0){o&&fe.value?fe.value.focus():n&&Ge.value?Ge.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{de()});return}const r={content:f.value.innerHTML,title:$.title||"",description:$.description||""};et.value.push(r);const c=Ot.value.pop();if(c!==void 0){G.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,xt.value=d,J.value=u,Z.value=m,ft.value=d,X.value=u,re.value=m,e.nextTick(()=>{Ml(),pl(),it(),tl();const v=D(d);ve("update:modelValue",v),ve("update:title",u),ve("update:description",m),ve("change",v),ve("title-change",u),ve("description-change",m),G.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(fe.value){fe.value.focus();const k=u.length;fe.value.setSelectionRange&&fe.value.setSelectionRange(k,k),Qe()}}else if(n){if(Ge.value){Ge.value.focus();const k=m.length;Ge.value.setSelectionRange(k,k)}}else if(s)rn();else if(fe.value&&document.activeElement===fe.value){const k=u.length;fe.value.setSelectionRange&&fe.value.setSelectionRange(k,k),Qe()}else if(Ge.value&&document.activeElement===Ge.value){const k=m.length;Ge.value.setSelectionRange(k,k)}else f.value&&rn()},10)})})}},Yt=()=>{if(!f.value)return;f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const c=r.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},Ae=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},so=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);let s=!1;if(n.collapsed){const r=n.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="EM"||c.tagName==="I"){s=!0;break}if(c.style&&c.style.fontStyle==="italic"){s=!0;break}c=c.parentElement}}else{const r=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="EM"||u.tagName==="I"){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(()=>{Ae()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{Ae()});else try{const r=n.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(r),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),o.removeAllRanges(),o.addRange(n),e.nextTick(()=>{Ae()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{Ae()})}return!0},al=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);let s=!1;if(n.collapsed){const r=n.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="STRONG"||c.tagName==="B"){s=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){s=!0;break}c=c.parentElement}}else{const r=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="STRONG"||u.tagName==="B"){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(()=>{Yt()}),!1;if(n.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==f.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const v=document.createElement("b");v.style.fontWeight="600";const k=document.createDocumentFragment();for(;u.firstChild;)k.appendChild(u.firstChild);v.appendChild(k),u.parentNode&&u.parentNode.replaceChild(v,u),c.setStart(v,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===f.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c)}}Yt()});else try{const r=n.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(r),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),o.removeAllRanges(),o.addRange(n),e.nextTick(()=>{Yt()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Yt()})}return!0},Bl=(o,n=null)=>{if($.disabled||!$.richText||!f.value)return;Fe.value?(We.value&&(clearTimeout(We.value),We.value=null),at(),Fe.value=!1):at(),il(),f.value.focus();const s=window.getSelection();let r=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&Zt(d)&&(r=Qt())}if(o==="createLink"&&n){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const v=document.createTextNode(n);u.insertNode(v),u.selectNodeContents(v)}}}if(o==="bold"){const d=al();ee.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(C.value={command:"bold",state:d}),e.nextTick(()=>{r&&(ol(r),e.nextTick(()=>{const m=el("bold");ee.value.bold=m})),de(),pl(),tl()});return}if(o==="italic"){const d=so();ee.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(C.value={command:"italic",state:d}),e.nextTick(()=>{r&&(ol(r),e.nextTick(()=>{const m=el("italic");ee.value.italic=m})),de(),Ae(),pl(),tl()});return}let c=!1;try{c=document.execCommand(o,!1,n)}catch{}e.nextTick(()=>{if(r&&ol(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=el("bold");ee.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=el("italic");ee.value.italic=u});else{const u=document.queryCommandState(o);ee.value[o]=u}else{const u=document.queryCommandState(o);ee.value[o]=u}}catch{ee.value.hasOwnProperty(o)?ee.value[o]=!ee.value[o]:ee.value[o]=!0}if(o==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const v=u.getRangeAt(0),k=v.commonAncestorContainer.nodeType===1?v.commonAncestorContainer.closest("a"):v.commonAncestorContainer.parentElement?.closest("a");k&&(!k.getAttribute("href")||k.getAttribute("href")==="")&&k.setAttribute("href",n)}f.value.querySelectorAll("a").forEach(v=>{const k=v.getAttribute("href");(!k||k===""||k==="#")&&v.setAttribute("href",n)})}de(),pl(),tl()})},el=(o,n=null)=>{if($.disabled||!f.value)return!1;try{if(o==="formatBlock"&&n){const r=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const c=r.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const m=d.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===n||r.toLowerCase()===n.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="STRONG"||v.tagName==="B"||v.closest&&v.closest("strong, b"))&&(u=!0),!u&&v.style&&parseInt(v.style.fontWeight)>=600&&(u=!0),!u))try{const k=window.getComputedStyle(v);parseInt(k.fontWeight)>=600&&(u=!0)}catch{}return ee.value.hasOwnProperty(o)?ee.value[o]:(ee.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const k=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let L;for(;L=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(L))){if(L.nodeType===3){if(!(L.textContent||"").trim())continue;v=!0;let E=L.parentElement;for(;E&&E!==f.value;){if(E.tagName==="STRONG"||E.tagName==="B"){u=!0;break}if(E.style&&parseInt(E.style.fontWeight)>=600){u=!0;break}E=E.parentElement}}else if(L.nodeType===1){const R=L;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 ee.value[o]=u&&v,u&&v}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="EM"||v.tagName==="I"||v.closest&&v.closest("em, i"))&&(u=!0),!u&&v.style&&v.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(v).fontStyle==="italic"&&(u=!0)}catch{}return ee.value.hasOwnProperty(o)?ee.value[o]:(ee.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const k=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let L;for(;L=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(L))){if(L.nodeType===3){if(!(L.textContent||"").trim())continue;v=!0;let E=L.parentElement;for(;E&&E!==f.value;){if(E.tagName==="EM"||E.tagName==="I"){u=!0;break}if(E.style&&E.style.fontStyle==="italic"){u=!0;break}E=E.parentElement}}else if(L.nodeType===1){const R=L;if(R.tagName==="EM"||R.tagName==="I"){u=!0;break}if(R.style&&R.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return ee.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return c.collapsed&&ee.value.hasOwnProperty(o)?ee.value[o]:(ee.value[o]=d,d)}return ee.value.hasOwnProperty(o)?ee.value[o]:!1}catch{return ee.value.hasOwnProperty(o)?ee.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},Il=o=>{$.disabled||!$.richText||(we.value=we.value===o?null:o,o==="askAi"&&(ut.value=null))},il=()=>{we.value=null,Ke.value=null},zl=o=>{Bl("formatBlock",o),il()},In=o=>{if(!o||!f.value)return o;const n=Ie=>{let Ve=Ie.nodeType===Node.TEXT_NODE?Ie.parentElement:Ie;for(;Ve&&Ve!==f.value;){const nt=Ve.tagName;if(nt==="P"){const bl=Ve.parentElement;if(bl===f.value||bl.tagName==="BLOCKQUOTE")return Ve}if(nt==="BLOCKQUOTE")break;Ve=Ve.parentElement}return null},s=n(o.startContainer),r=n(o.endContainer);if(!s||!r)return o;const c=[],d=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Ie=>{const Ve=Ie.tagName;if(Ve==="P"){const nt=Ie.parentElement;if(nt===f.value||nt.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Ve==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(s),v=c.indexOf(r);if(m===-1||v===-1)return o;const k=Math.min(m,v),L=Math.max(m,v),R=c.slice(k,L+1);if(R.length===0)return o;const E=R[0],ae=R[R.length-1],j=document.createRange();return j.setStartBefore(E),j.setEndAfter(ae),j},Ln=()=>{if($.disabled||!$.richText||!f.value)return;Fe.value?(We.value&&(clearTimeout(We.value),We.value=null),at(),Fe.value=!1):at(),il(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let n=o.getRangeAt(0);!n.collapsed&&Zt(n)&&(n=In(n),o.removeAllRanges(),o.addRange(n));let s=null;!n.collapsed&&Zt(n)&&(s=Qt());const r=n.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(v=>{if(v.nodeType===Node.ELEMENT_NODE)if(v.tagName==="P"||v.tagName==="DIV")u.insertBefore(v,c);else{const k=document.createElement("p");k.appendChild(v.cloneNode(!0)),u.insertBefore(k,c)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const k=document.createElement("p");k.appendChild(v.cloneNode(!0)),u.insertBefore(k,c)}}),c.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=n.extractContents();u.appendChild(m),n.insertNode(u);const v=[],k=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:E=>E.parentNode===u&&E.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let L;for(;L=k.nextNode();)v.push(L);if(v.forEach(E=>{const ae=document.createElement("p");E.parentNode.insertBefore(ae,E),ae.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&&ol(s),it(),de(),tl()})},Wl=()=>{if(!f.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!r||!f.value.contains(r))return;const c=L=>{if(!L)return!1;const R=L.textContent||"",ae=(L.innerHTML||"").trim();return R.trim()===""||ae===""||ae==="<br>"||ae==="<br/>"||ae==="<p></p>"||ae==="<p><br></p>"||ae==="<p><br/></p>"||ae==="<p> </p>"||ae==="<p><br> </p>"||ae==="<div></div>"||ae==="<div><br></div>"||ae==="<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&&r.contains(d)&&c(d)&&d.remove();r.lastChild;){const L=r.lastChild;if(L.nodeType===1&&L.tagName==="BR")L.remove();else if(L.nodeType===3)if((L.textContent||"").trim()==="")L.remove();else break;else break}if(r.children.length>0)for(let L=r.children.length-1;L>=0;L--){const R=r.children[L];if((R.tagName==="P"||R.tagName==="DIV")&&c(R))R.remove();else break}let u=r.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(r.innerHTML=u);const v=document.createElement("p");v.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(v,r.nextSibling):r.parentNode.appendChild(v):f.value&&f.value.appendChild(v);const k=document.createRange();k.selectNodeContents(v),k.collapse(!0),o.removeAllRanges(),o.addRange(k),e.nextTick(()=>{it(),de()})},pl=()=>{if(!f.value){Ce.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");Ce.value=!!r}else Ce.value=!1}catch{Ce.value=!1}},Xn=()=>{if(!f.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),xe.value=Qt();const n=window.getSelection();let s="";n.rangeCount>0&&(s=n.getRangeAt(0).toString()),tt.value="",pt.value=s,Me.value="",qe.value=null,De.value=!0,il(),e.nextTick(()=>{W.value&&W.value.focus()})},Yn=()=>{if(!f.value)return;Fe.value?(We.value&&(clearTimeout(We.value),We.value=null),at(),Fe.value=!1):at();const o=window.getSelection();let n=null;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;n=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!n&&qe.value&&(n=qe.value),n&&n.parentNode){const s=document.createDocumentFragment();for(;n.firstChild;)s.appendChild(n.firstChild);if(n.parentNode.replaceChild(s,n),s.firstChild){const r=document.createRange();r.setStartBefore(s.firstChild),r.setEndAfter(s.lastChild||s.firstChild),o.removeAllRanges(),o.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),o.removeAllRanges(),o.addRange(r)}qe.value=null}else Bl("unlink");Ce.value=!1,il(),e.nextTick(()=>{de(),pl()})},cn=()=>{$.disabled||!$.richText||f.value&&(Fe.value?(We.value&&(clearTimeout(We.value),We.value=null),at(),Fe.value=!1):at(),il(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Ml(),de(),tl()}))},zn=()=>{$.disabled||!$.richText||f.value&&(Fe.value?(We.value&&(clearTimeout(We.value),We.value=null),at(),Fe.value=!1):at(),il(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Ml(),de(),tl()}))},yn=o=>{const n=o.parentElement;if(!n||n.tagName!=="OL")return null;let s=0,r=o.previousElementSibling;for(;r;)r.tagName==="LI"&&s++,r=r.previousElementSibling;return s+1},Ml=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(n=>{const s=n.parentElement;if(s&&s.tagName==="LI"){const r=yn(s);r!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},Pn=()=>{if($.disabled||!$.richText||!f.value)return;il(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const n=o.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{Ml(),de()});return}const r=s.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=s.previousElementSibling;if(c&&c.tagName==="LI"){const d=r.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const m=yn(c);u.appendChild(s),m!==null&&r.tagName==="OL"&&s.setAttribute("data-parent-num",String(m)),Ml();const v=document.createRange();v.selectNodeContents(s),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{de(),tl()})}else document.execCommand("indent",!1),e.nextTick(()=>{Ml(),de(),tl()})},kn=()=>{if($.disabled||!$.richText||!f.value)return;il(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const n=o.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{Ml(),de()});return}const r=s.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=r.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){r.tagName==="OL"&&s.removeAttribute("data-parent-num"),d.insertBefore(s,c.nextSibling),r.children.length===0&&r.remove(),Ml();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{de(),tl()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Ml(),de(),tl()})},At=e.ref(null),Zl=e.ref(null),un=e.ref({}),y=e.ref(""),h=e.ref(null),x=e.ref("");e.ref("");const q=e.ref(null);e.ref("");const ie=e.ref([]),mt=e.ref(!1),Rt=e.ref(!1),_l=o=>{if(!o)return"";const n=o.cloneRange(),s=document.createElement("div");return s.appendChild(n.cloneContents()),s.innerHTML},Hl=()=>{if($.disabled||!$.richText||!f.value)return;if(At.value!==null){At.value=null,y.value="",x.value="",q.value=null,ie.value=[],xl(!0);return}il(),f.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0);if(n.collapsed||!Zt(n))return;x.value=_l(n)||"",q.value=Qt();const s=n.getBoundingClientRect(),r=f.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=s.bottom-c.top,m=Math.max(d+8,0);un.value={top:`${m}px`,bottom:"auto"},At.value=Date.now(),e.nextTick(()=>{if(y.value="",h.value){const k=h.value;k.style.height="auto",k.style.height=`${k.scrollHeight}px`,k.focus()}const v=r.querySelector(".dss-comment-overlay");if(v&&r){const k=r.querySelector(".dss-text-editor-footer");if(k){const L=r.getBoundingClientRect(),R=v.getBoundingClientRect(),E=k.getBoundingClientRect(),ae=R.bottom-L.top,j=E.top-L.top,Ie=8;if(ae>j-Ie){const Ve=E.height;un.value={bottom:`${Ve+Ie}px`,top:"auto"}}else un.value={top:`${m}px`,bottom:"auto"}}}})},ql=()=>{if(!y.value.trim())return;const o=y.value.trim(),n=new Date,s={text:o,selectionText:x.value,selectionRange:q.value,commentId:At.value,user:$.commentUser||null,createdAt:n.toISOString()};ie.value=[...ie.value,s],ve("comment-submitted",s),io(s),q.value&&!ro(q.value)&&Eo(At.value,q.value),y.value="",e.nextTick(()=>{if(h.value){const r=h.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}wl("sendComment")})},En=(o,n)=>{if(!(!$.commentUser||!o.user||o.user.id!==$.commentUser.id)){if(ie.value=ie.value.filter((s,r)=>r!==n),At.value!==null&&f.value){const s=String(At.value),r=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(r&&ie.value.length>0){const c=[],d=new Set;ie.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),c.push(u.user))}),c.length>0?r.setAttribute("data-comment-user",JSON.stringify(c[0])):r.removeAttribute("data-comment-user"),c.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(c[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(ie.value.length))}else r&&ie.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(ve("comment-deleted",{comment:o,index:n,commentId:At.value}),$.comments&&Array.isArray($.comments)){const s=$.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));ve("update:comments",s)}e.nextTick(()=>{wl("deleteComment")})}},ro=o=>{if(!o||!f.value)return!1;try{const n=xo(o);if(!n)return!1;const s=n.commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},xo=o=>{if(!o||!f.value)return null;try{const n=document.createRange();if(o.type==="element"&&o.element)return f.value.contains(o.element)?(n.setStart(o.element,o.offset),n.collapse(!0),n):null;let s=0;const r=[f.value];let c=null,d=!1,u=!1;for(;!u&&(c=r.pop());)if(c.nodeType===3){const m=s+c.length;!d&&o.start>=s&&o.start<=m&&(n.setStart(c,o.start-s),d=!0),d&&o.end>=s&&o.end<=m&&(n.setEnd(c,o.end-s),u=!0),s=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return d?n:null}catch{return null}},Eo=(o,n)=>{if(!(!o||!n||!f.value))try{const s=xo(n);if(!s||s.collapsed)return;const r=s.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const m=c.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(o)&&m.getAttribute("data-fake-comment")!==String(o)&&m.setAttribute("data-comment",String(o));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(o));try{const m=s.startContainer,v=s.endContainer,k=s.startOffset,L=s.endOffset,R=m.nodeType===3?m.parentNode:m,E=v.nodeType===3?v.parentNode:v;if(R===E&&k===0&&L===(v.nodeType===3?v.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 j=s.extractContents();d.appendChild(j),s.insertNode(d)}else s.surroundContents(d)}catch{const v=s.extractContents();d.appendChild(v),s.insertNode(d)}const u=f.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{wl("wrapSelectionWithCommentMarker"),de()})}catch{}},io=o=>{if(!o||!o.commentId)return;const n=Array.isArray($.comments)?[...$.comments]:[],s=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let r=n.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(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(r>=0){const d=n[r];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=o.createdAt,!d.article_id&&n.length>0){const u=n.find(m=>m.article_id);u&&(d.article_id=u.article_id)}}else{const d=o.selectionRange,u=n.length>0&&n.find(v=>v.article_id)?.article_id||null,m={conversation_id: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"};n.push(m)}mt.value=!0,ve("update:comments",n)},So=(o,n=[])=>{if($.disabled||!$.richText||!f.value)return;const s=f.value;let r=null;try{r=s.querySelector(o)}catch{return}if(!r)return;il(),s.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),x.value=r.innerHTML||"",q.value=Qt();const u=c.getBoundingClientRect(),m=s.parentElement;if(m){const L=m.getBoundingClientRect(),R=u.bottom-L.top,ae=Math.max(R+8,0);un.value={top:`${ae}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let k=[];if(v&&$.comments&&Array.isArray($.comments)){const L=$.comments.find(R=>String(R.conversation_id)===String(v));if(L&&L.conversation&&Array.isArray(L.conversation)){const R=L.conversation.map(E=>({id:E.id||E.commentary_id,commentary_id:E.id||E.commentary_id,conversation_id:L.id||L.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(n)&&n.length>0&&(k=n.slice()),k.sort((L,R)=>{const E=Ie=>{if(!Ie)return 0;const Ve=new Date(Ie).getTime();return isNaN(Ve)?0:Ve},ae=E(L.createdAt),j=E(R.createdAt);return ae===j?0:ae-j}),ie.value=k,xl(!0),At.value=v||null,r&&(Zl.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(y.value="",h.value){const L=h.value;L.style.height="auto",L.style.height=`${L.scrollHeight}px`,L.focus()}if(m){const L=m.querySelector(".dss-comment-overlay");if(L){const R=m.querySelector(".dss-text-editor-footer");if(R){const E=m.getBoundingClientRect(),ae=L.getBoundingClientRect(),j=R.getBoundingClientRect(),Ie=ae.bottom-E.top,Ve=j.top-E.top,nt=8;if(Ie>Ve-nt){const bl=j.height;un.value={bottom:`${bl+nt}px`,top:"auto"}}}}}wl("openCommentOverlayForSelector")})},co=e.ref(null),Vo=e.ref(0),uo=o=>{if(!($.disabled||!$.richText)){if(o.key==="Escape"){const n=window.getSelection();if(n.rangeCount>0){const r=n.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){o.preventDefault();let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(m,u.nextSibling):c.appendChild(m),setTimeout(()=>{Wl()},50);return}}}if(o.key.length===1||o.key==="Enter"){const n=window.getSelection();if(n&&n.rangeCount>0){const s=n.getRangeAt(0),r=s.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const m=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,v=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(m)&&m!==u||d.contains(v)&&v!==u){o.preventDefault();const k=document.createRange();k.setStartAfter(d),k.collapse(!0),n.removeAllRanges(),n.addRange(k);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);let r=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"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=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"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=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"?(r=d,c=r.closest(".dss-image-wrapper")):(r=d.querySelector("img"),r&&(c=r.closest(".dss-image-wrapper"))),c){const v=c.contains(u)||u===c,k=c.contains(m)||m===c,R=s.cloneContents().textContent?.trim()||"",E=c.textContent?.trim()||"";(!v||!k||R.length>E.length)&&(c=null,r=null)}}if(c){o.preventDefault(),o.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const m=document.createRange();m.setStartAfter(u),m.collapse(!0),n.removeAllRanges(),n.addRange(m),e.nextTick(()=>{de()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?kn():Pn();return}if(o.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);if(s.collapsed){const u=s.startContainer,m=v=>{if(!v)return!1;let k=v.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 L=v.parentElement;return L&&L!==f.value?m(L):!1};if(u.nodeType===3){const v=u.parentElement;if(v&&(m(v)||m(u))){const k=v.closest("p, div");if(k&&k!==f.value){o.preventDefault(),o.stopPropagation();let L=null;const R=s.startOffset;R<u.length&&(L=u.splitText(R));const E=document.createElement("p");if(L?E.appendChild(L):E.innerHTML="<br>",u.length===0){const j=u.parentElement;j&&(j.removeChild(u),j.childNodes.length===0&&j.appendChild(document.createElement("br")))}k.nextSibling?k.parentNode.insertBefore(E,k.nextSibling):k.parentNode.appendChild(E);const ae=document.createRange();L?ae.setStart(L,0):ae.setStart(E,0),ae.collapse(!0),n.removeAllRanges(),n.addRange(ae),e.nextTick(()=>{de()});return}}}}const r=s.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=j=>{if(!j)return!1;const Ie=j.textContent||"",nt=(j.innerHTML||"").trim(),bl=nt.replace(/<br\s*\/?>/gi,"").trim();return Ie.trim()===""||nt===""||bl===""||nt==="<br>"||nt==="<br/>"||nt==="<p></p>"||nt==="<p><br></p>"||nt==="<p><br/></p>"||nt==="<p> </p>"||nt==="<p><br> </p>"||nt==="<div></div>"||nt==="<div><br></div>"||nt==="<div><br/></div>"},v=c.lastChild,k=v&&v.nodeType===1&&v.tagName==="BR",L=s.startContainer,R=L.nodeType===3?L.parentElement:L,E=R===c||R&&R.parentElement===c;if(u&&m(u)||k&&E){o.preventDefault(),setTimeout(()=>{Wl()},50);return}}}}if(o.key===" "){const n=Date.now(),s=n-Vo.value;if(co.value===" "&&s<300){const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(d){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){o.preventDefault(),Pn();return}}}}co.value=" ",Vo.value=n}else co.value=o.key}},Zo=o=>{if($.disabled||!$.richText)return;o.preventDefault();let n=o.clipboardData.getData("text/html"),s=o.clipboardData.getData("text/plain");n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),at();const r=window.getSelection();let c=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),c=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const v=new DOMParser().parseFromString(u,"text/html");let k=f.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach(R=>{if(k>0){const E=v.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(v.body.children).filter(ae=>R.includes(ae.tagName));if(E.length===1){const ae=E[0].tagName,j=c.tagName,Ie=c.textContent.trim()===""&&!c.querySelector("img");let Ve=!1;if(["H1","H2","H3","H4","H5","H6"].includes(j)?Ve=!0:Ie||(ae===j||ae==="P")&&(Ve=!0),Ve)return E[0].innerHTML.trim()}}return v.body.innerHTML.trim()};if(n){const u=d(n);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);de()},jn=o=>{if(we.value){const s=o.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&il()}if(lt.value){const s=o.target,r=s.closest(".dss-floating-toolbar"),c=f.value&&s.closest(".dss-text-editor-content");!r&&!c&&qn()}if(ut.value){const s=o.target,r=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!r&&!c&&Kn()}const n=o.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(Ke.value=null),!f.value||!n.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const r=s.getRangeAt(0);Y.value=!r.collapsed&&Zt(r)}else Y.value=!1}if(At.value!==null){const s=document.querySelector(".dss-comment-overlay");let r=!1;if(s){const u=s.getBoundingClientRect(),m=o.clientX,v=o.clientY;r=m>=u.left&&m<=u.right&&v>=u.top&&v<=u.bottom}const c=n.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!r&&!d&&(At.value=null,y.value="",x.value="",q.value=null,ie.value=[],xl(!0))}},$l=(o,n)=>{o&&o.stopPropagation&&o.stopPropagation(),Tt.value&&(clearTimeout(Tt.value),Tt.value=null),Ke.value=n},z=o=>{const n=o.relatedTarget;if(n){const s=n.closest(".dss-toolbar-dropdown-submenu"),r=n.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||r)return}Tt.value&&clearTimeout(Tt.value),Tt.value=setTimeout(()=>{Ke.value=null,Tt.value=null},150)},Sl=o=>{Ke.value=null};let Ul=0;const On=o=>{if(!o)return;const n=Array.from(o.children);n.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")}),n.forEach((s,r)=>{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-${++Ul}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",m);let v=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),v=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),v=d),v&&(v.setAttribute("data-submenu-id",m),v.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(L=>{(L.tagName==="BUTTON"||L.tagName==="DIV")&&!L.classList.contains("dss-toolbar-dropdown-item")&&L.classList.add("dss-toolbar-dropdown-item")}))}})},Cl=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{On(n),n.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=v=>{const k=c.getAttribute("data-submenu-id");k&&$l(v,k)},m=z;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m}}),n.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=k=>{const L=c.getAttribute("data-submenu-id");L&&$l(k,L)},m=z;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",Sl)})})})};let Ll=null;const jt=()=>{if(Ke.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Ke.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Ke.value}"]`);o&&n&&Ao(o,n)}if(lt.value&&tl(),$.richText){if(Ll!==null)return;Ll=setTimeout(()=>{Ll=null,wl("handleWindowResize")},150)}},Jt=()=>{if(!$.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(n=>{Array.from(n.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},Cn=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),n=s=>{if(s.preventDefault(),s.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};o.forEach(s=>{s.addEventListener("selectstart",n),s.addEventListener("mousedown",n),s.addEventListener("dragstart",n),s.addEventListener("contextmenu",n),s.addEventListener("click",r=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{ll.value?Qe():nl(),S.value?Nl():Jl()})}),e.nextTick(()=>{Cn()}),$.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",jn),window.addEventListener("resize",jt);let o=null;const n=()=>{o===null&&(o=setTimeout(()=>{o=null,jt()},150))};window.addEventListener("scroll",n,!0),f.value._windowScrollHandler=n,f.value._windowScrollTimeout=o,f.value.closest(".editor-with-comments"),f.value.closest(".dss-text-editor-content-wrapper");const s=f.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,jt()},150))};s&&(s.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{Cl(),Jt()}),f.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!$.disabled&&m.preventDefault();const L=v.closest(".dss-image-no-alt-icon"),R=v.closest(".dss-image-wrapper");if(L||R&&v===R){m.preventDefault(),m.stopPropagation();const E=window.getSelection(),ae=document.createRange();ae.setStartAfter(R),ae.collapse(!0),E.removeAllRanges(),E.addRange(ae)}else R&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const E=window.getSelection();if(E.rangeCount>0){const j=E.getRangeAt(0).commonAncestorContainer,Ie=j.nodeType===3?j.parentElement:j;if(R.contains(Ie)&&Ie!==R.querySelector("img")){const Ve=document.createRange();Ve.setStartAfter(R),Ve.collapse(!0),E.removeAllRanges(),E.addRange(Ve)}}else{const ae=document.createRange();ae.setStartAfter(R),ae.collapse(!0),E.addRange(ae)}}))},!0),f.value.addEventListener("mousedown",m=>{const v=m.target,k=v.closest(".dss-image-no-alt-icon"),L=v.closest(".dss-image-wrapper");if(k||L&&v.tagName!=="IMG"){m.preventDefault();const R=window.getSelection(),E=document.createRange();L&&(E.setStartAfter(L),E.collapse(!0),R.removeAllRanges(),R.addRange(E))}},!0),f.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!f.value)return;f.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||"",ae=E.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),j=R===E||R===ae;(R.startsWith("http://")||R.startsWith("https://")||R.startsWith("data:")||j||j)&&(k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="")}}}),ml()})}),f.value.addEventListener("dragstart",m=>{const v=m.target,k=v.tagName==="IMG"?v:v.closest("img"),L=k?.closest(".dss-image-wrapper");k&&f.value.contains(k)&&(St.value=L||k,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",m=>{St.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",m=>{St.value&&(m.preventDefault(),m.stopPropagation())}),f.value.addEventListener("drop",m=>{if(!St.value||!f.value)return;m.preventDefault(),m.stopPropagation();const v=St.value,k=v.classList?.contains("dss-image-wrapper"),L=k?v.querySelector("img"):v,R=k?v:L?.closest(".dss-image-wrapper");if(!L||!f.value.contains(L)){St.value=null;return}let E=null;const ae=m.clientX,j=m.clientY;if(document.caretRangeFromPoint)E=document.caretRangeFromPoint(ae,j);else{const sl=window.getSelection();sl.rangeCount>0?E=sl.getRangeAt(0).cloneRange():(E=document.createRange(),E.selectNodeContents(f.value),E.collapse(!1))}if(!E){St.value=null;return}const Ie=E.commonAncestorContainer,Ve=Ie.nodeType===3?Ie.parentElement:Ie;if(Ve?.closest(".dss-image-wrapper")===R||R&&R.contains(Ve)){St.value=null;return}if(R&&(Ve===R||R.contains(Ve))){St.value=null;return}const bl=L.getAttribute("src");let fl=null;R?fl=R.cloneNode(!0):fl=L.cloneNode(!0);try{let sl=E.startContainer;if(sl.nodeType===3&&(sl=sl.parentElement),R&&(sl===R||R.contains(sl))){const ul=document.createRange();ul.setStartAfter(R),ul.collapse(!0),E=ul}E.insertNode(fl);const vl=document.createRange();vl.setStartAfter(fl),vl.collapse(!0);const cl=window.getSelection();cl.removeAllRanges(),cl.addRange(vl)}catch{if(f.value.childNodes.length===0){const vl=document.createElement("p");vl.appendChild(fl),f.value.appendChild(vl)}else{const vl=f.value.lastChild;if(vl&&vl.nodeType===1)vl.appendChild(fl);else{const cl=document.createElement("p");cl.appendChild(fl),f.value.appendChild(cl)}}}R?R.remove():L.remove(),St.value=null,e.nextTick(()=>{const sl=f.value.querySelectorAll("img");let vl=!1;sl.forEach(cl=>{if(cl.getAttribute("src")===bl)if(!vl)vl=!0;else{const ul=cl.closest(".dss-image-wrapper");ul?ul.remove():cl.remove()}}),ml(),de()})}),f.value.addEventListener("dragend",m=>{St.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(v=>{v.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 L=k.querySelectorAll&&k.querySelectorAll("img");L&&L.forEach(R=>{R.removeAttribute("alt"),R.removeAttribute("data-alt"),R.setAttribute("alt",""),R.setAttribute("data-alt",""),R.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{ml(),Jt(),d=null},100)});if(u.observe(f.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{Jt()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),$.modelValue){const m=O($.modelValue);f.value.innerHTML=m,kt()}e.nextTick(()=>{const m=f.value.innerHTML||"",v=$.title||"",k=$.description||"";xt.value=m,J.value=v,Z.value=k,X.value=v,re.value=k,Ml(),ml(),Ae(),wt(),ho(),Vl()}),pl(),it(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",jn),window.removeEventListener("resize",jt),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),Ll!==null&&(clearTimeout(Ll),Ll=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),We.value&&clearTimeout(We.value),Tt.value&&clearTimeout(Tt.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),ze.value&&ze.value.disconnect(),gt.value!==null&&(cancelAnimationFrame(gt.value),gt.value=null),rt.value!==null&&(clearTimeout(rt.value),rt.value=null),ht.value!==null&&(clearTimeout(ht.value),ht.value=null),xl(!0),f.value&&f.value._scrollHandlers){const{wrapper:n,content:s,handler:r}=f.value._scrollHandlers;n&&n.removeEventListener("scroll",r),s&&s.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const Sn=o=>{const n=o.target,s=n.closest("a");if(s&&!$.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(s);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const r=n.closest(".dss-image-wrapper");r&&n.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(r.contains(m)&&m!==r.querySelector("img")){const v=document.createRange();v.setStartAfter(r),v.collapse(!0),c.removeAllRanges(),c.addRange(v)}}ml(),pl(),it(),tl(),wt()}):e.nextTick(()=>{ml(),pl(),it(),tl(),wt()})},Ft=()=>{hn();const o=window.getSelection();if(o&&o.rangeCount>0){const s=o.getRangeAt(0);Y.value=!s.collapsed&&Zt(s),!s.collapsed&&C.value&&(C.value=null)}else Y.value=!1;if(ml(),pl(),it(),tl(),wt(),o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c&&c.closest(".dss-text-editor-footer")){o.removeAllRanges(),Y.value=!1;return}}["bold","italic","underline"].forEach(s=>{try{const r=window.getSelection();if(r.rangeCount>0){const c=r.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 v=window.getComputedStyle(u);parseInt(v.fontWeight)>=600&&(m=!0)}catch{}ee.value[s]=m}else{const d=document.queryCommandState(s);ee.value[s]=d}}}catch{}})},wt=()=>{if(!$.richText||$.disabled||!f.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,r=s.nodeType===3?s.parentElement:s;if(!r||!f.value.contains(r)){V.value="p";return}const c=r.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"}},it=()=>{if(!f.value){Ye.value=!1;return}try{const o=window.getSelection();let n=!1;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");n=!!(c&&f.value.contains(c))}Ye.value=n}catch{Ye.value=!1}},Zt=o=>{if(!o||!f.value)return!1;const n=o.commonAncestorContainer;if(!n)return!1;const s=n.nodeType===3?n.parentElement:n;return s?f.value.contains(s):!1},qn=()=>{lt.value=!1},tl=()=>{if(!$.floatingToolbar||!$.richText||$.disabled){lt.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){lt.value=!1;return}const n=o.getRangeAt(0);if(n.collapsed||!Zt(n)){lt.value=!1;return}const s=n.getBoundingClientRect();if(!s||s.width===0&&s.height===0){lt.value=!1;return}const r=f.value;if(!r){lt.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){lt.value=!1;return}const d=40,u=8,m=s.top-d/2+15;let v=s.left+s.width/2;const k=window.innerWidth||document.documentElement.clientWidth||0;let L=0;Je.value&&(L=Je.value.getBoundingClientRect().width);const R=(L||320)/2;let E=c.left+R,ae=c.right-R;if(ae<E){const j=c.left+c.width/2;E=j,ae=j}if(k>0){const j=R+u,Ie=k-R-u;if(E=Math.max(E,j),ae=Math.min(ae,Ie),ae<E){const Ve=k/2;E=Ve,ae=Ve}}v<E?v=E:v>ae&&(v=ae),be.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},lt.value=!0},An=o=>{$.disabled||!$.richText||(ut.value=ut.value===o?null:o,o==="askAi"&&(we.value=null))},Kn=()=>{ut.value=null,Ke.value=null},Pl=o=>{zl(o),Kn()};let dn=null,mn=null,Vn=null,Nn=null;const Uo=o=>{if($.disabled||!$.richText){Tn(),Wn();return}const n=o.target,s=n.closest("a"),r=n.closest("img");if(dn&&(clearTimeout(dn),dn=null),Vn&&(clearTimeout(Vn),Vn=null),s&&s!==mn){Wn(),mn=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),qe.value=s,pe.value=c,U.value=!0,Ee.value=!0,en(s)}else!s&&mn?(mn=null,dn=setTimeout(()=>{Ee.value||Tn()},150)):s&&s===mn&&en(s);if(r&&r!==Nn){Tn(),Nn=r;let c=r.getAttribute("alt");c===null&&(c=r.alt||"");let d=r.getAttribute("data-alt");d===null&&(d=c),r.hasAttribute("alt")||r.setAttribute("alt",c),r.hasAttribute("data-alt")||r.setAttribute("data-alt",d),bt.value=r,qt.value=c.trim()||A("textEditor.image.noAlt"),Lt.value=!0,ye.value=!0,No(r)}else!r&&Nn?(Nn=null,Vn=setTimeout(()=>{ye.value||Wn()},150)):r&&r===Nn&&No(r)},Bn=o=>{const n=o.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(mn=null,Nn=null,dn&&(clearTimeout(dn),dn=null),Vn&&(clearTimeout(Vn),Vn=null),Tn(),Wn())},Tn=()=>{Ee.value=!1,setTimeout(()=>{Ee.value||(U.value=!1,pe.value="",De.value||(qe.value=null))},100)},en=o=>{if(!o||!f.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;F.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Wn=()=>{ye.value=!1,setTimeout(()=>{ye.value||(Lt.value=!1,qt.value="",Ct.value||(bt.value=null))},100)},No=o=>{if(!o||!f.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;K.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Zn=()=>{if(!pe.value||!qe.value)return;let n=qe.value.getAttribute("href")||pe.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},Xo=()=>{if(qe.value){const o=qe.value.textContent||"",n=qe.value.getAttribute("href")||"",s=qe.value;tt.value=n,pt.value=o,Me.value=o,Ee.value=!1,U.value=!1,pe.value="",qe.value=s,De.value=!0}else if(Ce.value){const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(r){const c=r.textContent||"",d=r.getAttribute("href")||"";tt.value=d,pt.value=c,Me.value=c,qe.value=r,De.value=!0}}}else{xe.value=Qt();const o=window.getSelection();let n="";o.rangeCount>0&&(n=o.getRangeAt(0).toString()),tt.value="",pt.value=n,Me.value="",qe.value=null,De.value=!0}e.nextTick(()=>{W.value&&(W.value.focus(),W.value.select())})},Un=()=>{De.value=!1,tt.value="",pt.value="",Me.value="",qe.value=null,xe.value=null},mo=()=>{if(!tt.value.trim()){Un();return}if(Fe.value?(We.value&&(clearTimeout(We.value),We.value=null),at(),Fe.value=!1):at(),pt.value.trim()||(pt.value=tt.value.trim()),qe.value&&f.value&&f.value.contains(qe.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const n=qe.value;if(n.setAttribute("href",tt.value.trim()),pt.value.trim()!==Me.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=pt.value.trim()}n.style.color="#60afdf",n.style.textDecoration="underline";const s=document.createRange();s.selectNodeContents(n),s.collapse(!1),o.removeAllRanges(),o.addRange(s),de()}else if(f.value){f.value.focus();const o=window.getSelection();o.removeAllRanges(),xe.value&&ol(xe.value);let n=null;if(o.rangeCount>0&&(n=o.getRangeAt(0)),n&&!n.collapsed){n.toString();const s=document.createElement("a");s.href=tt.value.trim(),s.textContent=pt.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",n.deleteContents(),n.insertNode(s);const r=document.createTextNode(" ");n.setStartAfter(s),n.insertNode(r),n.setStartAfter(r),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(f.value),n.collapse(!1));const s=n.startContainer,r=s.nodeType===3,c=r&&n.startOffset===s.textContent.length,d=document.createElement("a");if(d.href=tt.value.trim(),d.textContent=pt.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=s.parentElement;for(;u&&u!==f.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==f.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const v=document.createTextNode(" ");m.appendChild(v);const k=document.createRange();k.setStartAfter(d),k.collapse(!0),o.removeAllRanges(),o.addRange(k)}else{if(n.startOffset>0){const k=s.textContent.substring(0,n.startOffset),L=k[k.length-1];if(L&&L!==" "&&L!==" "&&L!==`
100
+ </svg>`,f=e.ref(null),xe=e.ref(null),Ce=e.ref(!1),G=e.ref(!1),U=e.ref(!1),me=e.ref(""),F=e.ref({}),Se=e.ref(!1),Te=e.ref(!1),nt=e.ref(""),mt=e.ref(""),W=e.ref(null),Ze=e.ref(null),qe=e.ref(null),Ee=e.ref(null),Me=e.ref(""),Ye=e.ref(!1),ee=e.ref({}),ot=e.ref(!1),be=e.ref({}),tt=e.ref(null),dt=e.ref(null),kt=e.ref(!1),wt=e.ref(""),Dt=e.ref(null),Ft=e.ref(""),se=e.ref(""),pe=e.ref(""),De=e.ref(null),_e=e.ref(null),jt=e.ref(null),Ct=e.ref(null),Gt=e.ref(null),$t=e.ref(!1),Wt=e.ref(""),K=e.ref({}),ye=e.ref(!1),Be=e.ref("upload"),Ue=e.ref(""),Je=e.ref(null),Lt=e.ref(null),lt=e.ref([]),Pt=e.ref([]),We=e.ref(null),Re=e.ref(!1),bt=e.ref(""),pt=e.ref(""),J=e.ref(""),Z=e.ref(""),X=e.ref(""),re=e.ref(""),fe=e.ref(null),et=e.ref(null),St=e.ref(null),il=e.ref(!1),xt=e.ref(null),tl=e.ref(!1),S=e.ref(!1),C=e.ref(null),V=e.ref("p"),Y=e.ref(!1),le=e.ref([]),ze=e.ref(null),ft=e.ref(null),st=e.ref(null),Oe=e.ref(!1),Vt=e.ref(0),Et=100,vt=e.ref(null),at=e.computed(()=>!!B.commentUser),Nt=e.computed(()=>({"dss-text-editor-no-border":!B.border,"dss-text-editor-rounded":B.rounded,"dss-text-editor-full-height":B.fullHeight,"dss-comment-overlay-open":at.value&&pl.value!==null})),Bt=e.computed(()=>({})),yl=e.computed(()=>!B.fixedHeight||B.fullHeight?{}:{height:`${1.6*14*B.rows+24+2}px`,resize:"none",overflowY:"auto"}),Al=e.computed(()=>!B.fixedHeight||B.fullHeight?{}:{height:`${1.6*14*B.rows+32}px`,overflowY:"auto"}),un=e.computed(()=>B.richText&&Pt.value.length>0),Kt=e.computed(()=>{if(!B.modelValue)return"";if(B.richText){let o=B.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/&nbsp;/g," "),o=o.replace(/&amp;/g,"&"),o=o.replace(/&lt;/g,"<"),o=o.replace(/&gt;/g,">"),o=o.replace(/&quot;/g,'"'),o=o.replace(/&#39;/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return B.modelValue}),dl=e.computed(()=>{const o=Kt.value.trim();return o?o.split(/\s+/).filter(n=>n.length>0).length:0}),ln=e.computed(()=>Kt.value.length),yn=e.computed(()=>Ct.value!==null&&Be.value==="upload"&&Ft.value&&Ft.value.startsWith("data:")),dn=e.computed(()=>B.titlePlaceholder||A("textEditor.placeholders.title")),Bl=e.computed(()=>B.descriptionPlaceholder||A("textEditor.placeholders.description")),kn=e.computed(()=>B.placeholder||A("textEditor.placeholders.startTyping")),Ml=o=>ut&&ut[o]!==void 0,mn=o=>{for(let n=o+1;n<B.customToolbarSlots.length;n++)if(Ml(B.customToolbarSlots[n]))return!0;return!1},nn=o=>{for(let n=o+1;n<B.customToolbarSlots.length;n++){const s=B.customToolbarSlots[n];if(Ml(s)&&Fl(s))return!0}return!1},Fl=o=>B.customToolbarFloatingMap.hasOwnProperty(o)?B.customToolbarFloatingMap[o]===!0:!0,kl=e.computed(()=>B.customToolbarSlots.some(o=>Ml(o)&&Fl(o))),on=e.computed(()=>Ml("title-slot")),H=e.computed(()=>Ml("description-slot")),P=o=>{if(!o||o.trim()==="")return"<html></html>";const n=o.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?o:`<html>${o}</html>`},$=o=>{if(!o||o.trim()==="")return"";const n=o.replace(/<!--[\s\S]*?-->/g,""),s=n.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():n},ie=o=>{if(!o)return;const n=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),s=[];let r=n.nextNode();for(;r;)s.push(r),r=n.nextNode();s.forEach(c=>c.remove())},Le=o=>{try{const n=String(o.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],c=o.getFullYear();return`${n} ${r} ${c}`}catch{return""}},ct=o=>{if(!o||typeof o!="string")return!1;const n=o.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const c=A("textEditor.started_conversation");if(c&&n===c)return!0}catch{}const r=n.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},rt=o=>{const n=o.target.value;ve("update:modelValue",n),ve("change",n)},je=()=>{if(!fe.value)return;const o=fe.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},At=()=>{tl.value=!0,je()},ml=()=>{tl.value=!1,El()},El=()=>{if(!fe.value)return;const o=fe.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const n=o.value;o.value="M";const s=o.scrollHeight;o.value=n,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")},Il=o=>{const s=o.target.value;tl.value&&je(),ve("update:title",s),ve("title-change",s),St.value="title",B.richText&&(Re.value||(pt.value=bt.value,X.value=J.value,re.value=Z.value),We.value&&clearTimeout(We.value),Re.value=!0,We.value=setTimeout(()=>{Re.value=!1,he()},500))},_l=()=>{if(!et.value)return;const o=et.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},Dn=()=>{S.value=!0,_l()},Cn=()=>{S.value=!1,cl()},cl=()=>{if(!et.value)return;const o=et.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const n=o.value;o.value="M";const s=o.scrollHeight;o.value=n,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")},Tl=o=>{const s=o.target.value;S.value&&_l(),ve("update:description",s),ve("description-change",s),St.value="description",B.richText&&(Re.value||(pt.value=bt.value,X.value=J.value,re.value=Z.value),We.value&&clearTimeout(We.value),Re.value=!0,We.value=setTimeout(()=>{Re.value=!1,he()},500))},Jt=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const n=o.getRangeAt(0);if(n.startContainer.nodeType===1)return{type:"element",element:n.startContainer,offset:n.startOffset};const s=n.cloneRange();return s.selectNodeContents(f.value),s.setEnd(n.startContainer,n.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+n.toString().length}},$l=o=>{if(!(!o||!f.value))try{const n=window.getSelection(),s=document.createRange();if(o.type==="element"&&o.element)if(f.value.contains(o.element)){s.setStart(o.element,o.offset),s.collapse(!0),n.removeAllRanges(),n.addRange(s);return}else{f.value.focus();return}let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(s.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(s.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}n.removeAllRanges(),n.addRange(s)}catch{f.value.focus()}},Ht=()=>{if(!f.value)return;f.value.focus();const o=window.getSelection(),n=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},r=s(f.value);if(r.nodeType===3)n.setStart(r,r.length),n.setEnd(r,r.length);else if(r.childNodes.length>0){const c=s(r);c&&c.nodeType===3?(n.setStart(c,c.length),n.setEnd(c,c.length)):(n.selectNodeContents(r),n.collapse(!1))}else n.setStart(r,0),n.setEnd(r,0);o.removeAllRanges(),o.addRange(n)},he=(o=!1)=>{if(!f.value)return;const n=f.value.innerHTML,s=B.title||"",r=B.description||"";if(!o&&n===bt.value&&s===J.value&&r===Z.value)return;const c={content:pt.value||bt.value,title:X.value!==void 0?X.value:J.value,description:re.value!==void 0?re.value:Z.value},d=lt.value.length>0?lt.value[lt.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&&(lt.value.push(c),lt.value.length>50&&lt.value.shift(),Pt.value=[]),bt.value=n,J.value=s,Z.value=r,pt.value=n,X.value=s,re.value=r},Mt=o=>{if(!f.value)return;gt(),f.value&&ie(f.value);let n=null;f.value&&(f.value.querySelector("p")||(n=Jt(),Dl()));const s=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");s&&C.value&&(C.value=null),G.value=!0;const r=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),c=P(r);ve("update:modelValue",c),ve("change",c),St.value="editor",Re.value||(pt.value=bt.value,X.value=J.value,re.value=Z.value),We.value&&clearTimeout(We.value),Re.value=!0,We.value=setTimeout(()=>{Re.value=!1,he(),eo(),No()},500),e.nextTick(()=>{n&&$l(n),gt();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,v=m&&m.collapsed;if(d.forEach(k=>{try{if(v&&C.value?.command===k){ee.value[k]=C.value.state;return}if(k==="bold")if(m){const T=m.commonAncestorContainer,R=T.nodeType===3?T.parentElement:T;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 ne=window.getComputedStyle(R);parseInt(ne.fontWeight)>=600&&(E=!0)}catch{}ee.value[k]=E}else ee.value.hasOwnProperty(k)||(ee.value[k]=!1);else if(k==="italic")if(m){const T=m.commonAncestorContainer,R=T.nodeType===3?T.parentElement:T,E=R&&(R.tagName==="EM"||R.tagName==="I"||R.closest&&R.closest("em, i"));ee.value[k]=!!E}else{const T=document.queryCommandState(k);ee.value[k]=T}else{const T=document.queryCommandState(k);ee.value[k]=T}}catch{}}),Nl(),Ke(),an(),Yt(),it(),Ol("handleRichTextInput"),s&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const k=o.data||"";k&&k.length===1&&setTimeout(()=>No(k),0),(k===" "||k===`
101
+ `||/[.,;:!?]/.test(k))&&setTimeout(()=>{eo()},100)}G.value=!1})},gt=()=>{if(!f.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0),s=n.commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(!r)return;const c=r.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(r!==d&&!d?.contains(r)){const u=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,m=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.contains(u)&&u!==d||c.contains(m)&&m!==d){const v=document.createRange();v.setStartAfter(c),v.collapse(!0),o.removeAllRanges(),o.addRange(v)}}}},Dl=()=>{if(!f.value)return;const o=f.value;if(o.querySelector&&o.querySelector("p"))return;const n=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),s=Array.from(o.childNodes);let r=null;s.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}r||(r=document.createElement("p"),o.insertBefore(r,c)),r.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){r=null;return}if(n.has(u)){r=null;return}r||(r=document.createElement("p"),o.insertBefore(r,d)),r.appendChild(d)}})},Ke=()=>{if(f.value&&!il.value){il.value=!0;try{f.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),f.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const c=r.parentElement;!c||!c.classList.contains("dss-image-wrapper")?r.remove():c.querySelector("img")||r.remove()}),f.value.querySelectorAll("img").forEach(r=>{let c=r.getAttribute("alt");c===null&&(c=r.alt||"");const d=r.getAttribute("src")||r.src||"";if(c){const k=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),T=c===d||c===k;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||T||T)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=r.parentElement;const v=m&&m.classList.contains("dss-image-wrapper");if(v){const k=m.querySelector(".dss-image-no-alt-icon");k&&k.remove()}else{const k=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;k&&k.remove()}if(u){v?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const k=document.createElement("div");k.className="dss-image-no-alt-icon",k.setAttribute("contenteditable","false"),k.innerHTML=Q,m.appendChild(k)}else if(v&&m.children.length===1){const k=m.parentNode;k.insertBefore(r,m),k.removeChild(m)}})}finally{il.value=!1}}},ht=o=>{eo(),ve("blur",o),Rn()},ae=()=>{if(B.disabled||!B.richText||!f.value)return;nl(),We.value&&(clearTimeout(We.value),We.value=null),Re.value&&(he(),Re.value=!1);const o=St.value==="title",n=St.value==="description",s=St.value==="editor";if(lt.value.length===0){o&&fe.value?fe.value.focus():n&&et.value?et.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{Mt()});return}const r={content:f.value.innerHTML,title:B.title||"",description:B.description||""};Pt.value.push(r);const c=lt.value.pop();if(c!==void 0){G.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,bt.value=d,J.value=u,Z.value=m,pt.value=d,X.value=u,re.value=m,e.nextTick(()=>{Nl(),Vl(),qt(),Yt();const v=P(d);ve("update:modelValue",v),ve("update:title",u),ve("update:description",m),ve("change",v),ve("title-change",u),ve("description-change",m),G.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(fe.value){fe.value.focus();const k=u.length;fe.value.setSelectionRange&&fe.value.setSelectionRange(k,k),je()}}else if(n){if(et.value){et.value.focus();const k=m.length;et.value.setSelectionRange(k,k)}}else if(s)Ht();else if(fe.value&&document.activeElement===fe.value){const k=u.length;fe.value.setSelectionRange&&fe.value.setSelectionRange(k,k),je()}else if(et.value&&document.activeElement===et.value){const k=m.length;et.value.setSelectionRange(k,k)}else f.value&&Ht()},10)})})}},el=()=>{if(B.disabled||!B.richText||!f.value)return;nl();const o=St.value==="title",n=St.value==="description",s=St.value==="editor";if(Pt.value.length===0){o&&fe.value?fe.value.focus():n&&et.value?et.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{Mt()});return}const r={content:f.value.innerHTML,title:B.title||"",description:B.description||""};lt.value.push(r);const c=Pt.value.pop();if(c!==void 0){G.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,bt.value=d,J.value=u,Z.value=m,pt.value=d,X.value=u,re.value=m,e.nextTick(()=>{Nl(),Vl(),qt(),Yt();const v=P(d);ve("update:modelValue",v),ve("update:title",u),ve("update:description",m),ve("change",v),ve("title-change",u),ve("description-change",m),G.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(fe.value){fe.value.focus();const k=u.length;fe.value.setSelectionRange&&fe.value.setSelectionRange(k,k),je()}}else if(n){if(et.value){et.value.focus();const k=m.length;et.value.setSelectionRange(k,k)}}else if(s)Ht();else if(fe.value&&document.activeElement===fe.value){const k=u.length;fe.value.setSelectionRange&&fe.value.setSelectionRange(k,k),je()}else if(et.value&&document.activeElement===et.value){const k=m.length;et.value.setSelectionRange(k,k)}else f.value&&Ht()},10)})})}},Fe=()=>{if(!f.value)return;f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const c=r.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},an=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},ll=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);let s=!1;if(n.collapsed){const r=n.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="EM"||c.tagName==="I"){s=!0;break}if(c.style&&c.style.fontStyle==="italic"){s=!0;break}c=c.parentElement}}else{const r=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="EM"||u.tagName==="I"){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(()=>{an()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{an()});else try{const r=n.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(r),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),o.removeAllRanges(),o.addRange(n),e.nextTick(()=>{an()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{an()})}return!0},bn=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);let s=!1;if(n.collapsed){const r=n.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="STRONG"||c.tagName==="B"){s=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){s=!0;break}c=c.parentElement}}else{const r=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="STRONG"||u.tagName==="B"){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(()=>{Fe()}),!1;if(n.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==f.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const v=document.createElement("b");v.style.fontWeight="600";const k=document.createDocumentFragment();for(;u.firstChild;)k.appendChild(u.firstChild);v.appendChild(k),u.parentNode&&u.parentNode.replaceChild(v,u),c.setStart(v,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===f.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c)}}Fe()});else try{const r=n.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(r),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),o.removeAllRanges(),o.addRange(n),e.nextTick(()=>{Fe()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Fe()})}return!0},Sl=(o,n=null)=>{if(B.disabled||!B.richText||!f.value)return;Re.value?(We.value&&(clearTimeout(We.value),We.value=null),he(),Re.value=!1):he(),nl(),f.value.focus();const s=window.getSelection();let r=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&$n(d)&&(r=Jt())}if(o==="createLink"&&n){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const v=document.createTextNode(n);u.insertNode(v),u.selectNodeContents(v)}}}if(o==="bold"){const d=bn();ee.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(C.value={command:"bold",state:d}),e.nextTick(()=>{r&&($l(r),e.nextTick(()=>{const m=Xt("bold");ee.value.bold=m})),Mt(),Vl(),Yt()});return}if(o==="italic"){const d=ll();ee.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(C.value={command:"italic",state:d}),e.nextTick(()=>{r&&($l(r),e.nextTick(()=>{const m=Xt("italic");ee.value.italic=m})),Mt(),an(),Vl(),Yt()});return}let c=!1;try{c=document.execCommand(o,!1,n)}catch{}e.nextTick(()=>{if(r&&$l(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=Xt("bold");ee.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=Xt("italic");ee.value.italic=u});else{const u=document.queryCommandState(o);ee.value[o]=u}else{const u=document.queryCommandState(o);ee.value[o]=u}}catch{ee.value.hasOwnProperty(o)?ee.value[o]=!ee.value[o]:ee.value[o]=!0}if(o==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const v=u.getRangeAt(0),k=v.commonAncestorContainer.nodeType===1?v.commonAncestorContainer.closest("a"):v.commonAncestorContainer.parentElement?.closest("a");k&&(!k.getAttribute("href")||k.getAttribute("href")==="")&&k.setAttribute("href",n)}f.value.querySelectorAll("a").forEach(v=>{const k=v.getAttribute("href");(!k||k===""||k==="#")&&v.setAttribute("href",n)})}Mt(),Vl(),Yt()})},Xt=(o,n=null)=>{if(B.disabled||!f.value)return!1;try{if(o==="formatBlock"&&n){const r=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const c=r.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const m=d.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===n||r.toLowerCase()===n.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="STRONG"||v.tagName==="B"||v.closest&&v.closest("strong, b"))&&(u=!0),!u&&v.style&&parseInt(v.style.fontWeight)>=600&&(u=!0),!u))try{const k=window.getComputedStyle(v);parseInt(k.fontWeight)>=600&&(u=!0)}catch{}return ee.value.hasOwnProperty(o)?ee.value[o]:(ee.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const k=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let T;for(;T=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(T))){if(T.nodeType===3){if(!(T.textContent||"").trim())continue;v=!0;let E=T.parentElement;for(;E&&E!==f.value;){if(E.tagName==="STRONG"||E.tagName==="B"){u=!0;break}if(E.style&&parseInt(E.style.fontWeight)>=600){u=!0;break}E=E.parentElement}}else if(T.nodeType===1){const R=T;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 ee.value[o]=u&&v,u&&v}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="EM"||v.tagName==="I"||v.closest&&v.closest("em, i"))&&(u=!0),!u&&v.style&&v.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(v).fontStyle==="italic"&&(u=!0)}catch{}return ee.value.hasOwnProperty(o)?ee.value[o]:(ee.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const k=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let T;for(;T=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(T))){if(T.nodeType===3){if(!(T.textContent||"").trim())continue;v=!0;let E=T.parentElement;for(;E&&E!==f.value;){if(E.tagName==="EM"||E.tagName==="I"){u=!0;break}if(E.style&&E.style.fontStyle==="italic"){u=!0;break}E=E.parentElement}}else if(T.nodeType===1){const R=T;if(R.tagName==="EM"||R.tagName==="I"){u=!0;break}if(R.style&&R.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return ee.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return c.collapsed&&ee.value.hasOwnProperty(o)?ee.value[o]:(ee.value[o]=d,d)}return ee.value.hasOwnProperty(o)?ee.value[o]:!1}catch{return ee.value.hasOwnProperty(o)?ee.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},Hn=o=>{B.disabled||!B.richText||(xe.value=xe.value===o?null:o,o==="askAi"&&(dt.value=null))},nl=()=>{xe.value=null,Je.value=null},zl=o=>{Sl("formatBlock",o),nl()},Wn=o=>{if(!o||!f.value)return o;const n=Ie=>{let we=Ie.nodeType===Node.TEXT_NODE?Ie.parentElement:Ie;for(;we&&we!==f.value;){const yt=we.tagName;if(yt==="P"){const Cl=we.parentElement;if(Cl===f.value||Cl.tagName==="BLOCKQUOTE")return we}if(yt==="BLOCKQUOTE")break;we=we.parentElement}return null},s=n(o.startContainer),r=n(o.endContainer);if(!s||!r)return o;const c=[],d=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Ie=>{const we=Ie.tagName;if(we==="P"){const yt=Ie.parentElement;if(yt===f.value||yt.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return we==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(s),v=c.indexOf(r);if(m===-1||v===-1)return o;const k=Math.min(m,v),T=Math.max(m,v),R=c.slice(k,T+1);if(R.length===0)return o;const E=R[0],ne=R[R.length-1],j=document.createRange();return j.setStartBefore(E),j.setEndAfter(ne),j},ql=()=>{if(B.disabled||!B.richText||!f.value)return;Re.value?(We.value&&(clearTimeout(We.value),We.value=null),he(),Re.value=!1):he(),nl(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let n=o.getRangeAt(0);!n.collapsed&&$n(n)&&(n=Wn(n),o.removeAllRanges(),o.addRange(n));let s=null;!n.collapsed&&$n(n)&&(s=Jt());const r=n.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(v=>{if(v.nodeType===Node.ELEMENT_NODE)if(v.tagName==="P"||v.tagName==="DIV")u.insertBefore(v,c);else{const k=document.createElement("p");k.appendChild(v.cloneNode(!0)),u.insertBefore(k,c)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const k=document.createElement("p");k.appendChild(v.cloneNode(!0)),u.insertBefore(k,c)}}),c.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=n.extractContents();u.appendChild(m),n.insertNode(u);const v=[],k=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:E=>E.parentNode===u&&E.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let T;for(;T=k.nextNode();)v.push(T);if(v.forEach(E=>{const ne=document.createElement("p");E.parentNode.insertBefore(ne,E),ne.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&&$l(s),qt(),Mt(),Yt()})},Mn=()=>{if(!f.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!r||!f.value.contains(r))return;const c=T=>{if(!T)return!1;const R=T.textContent||"",ne=(T.innerHTML||"").trim();return R.trim()===""||ne===""||ne==="<br>"||ne==="<br/>"||ne==="<p></p>"||ne==="<p><br></p>"||ne==="<p><br/></p>"||ne==="<p> </p>"||ne==="<p><br> </p>"||ne==="<div></div>"||ne==="<div><br></div>"||ne==="<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&&r.contains(d)&&c(d)&&d.remove();r.lastChild;){const T=r.lastChild;if(T.nodeType===1&&T.tagName==="BR")T.remove();else if(T.nodeType===3)if((T.textContent||"").trim()==="")T.remove();else break;else break}if(r.children.length>0)for(let T=r.children.length-1;T>=0;T--){const R=r.children[T];if((R.tagName==="P"||R.tagName==="DIV")&&c(R))R.remove();else break}let u=r.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(r.innerHTML=u);const v=document.createElement("p");v.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(v,r.nextSibling):r.parentNode.appendChild(v):f.value&&f.value.appendChild(v);const k=document.createRange();k.selectNodeContents(v),k.collapse(!0),o.removeAllRanges(),o.addRange(k),e.nextTick(()=>{qt(),Mt()})},Vl=()=>{if(!f.value){Ce.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");Ce.value=!!r}else Ce.value=!1}catch{Ce.value=!1}},Yn=()=>{if(!f.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),Ee.value=Jt();const n=window.getSelection();let s="";n.rangeCount>0&&(s=n.getRangeAt(0).toString()),nt.value="",mt.value=s,Me.value="",qe.value=null,Te.value=!0,nl(),e.nextTick(()=>{W.value&&W.value.focus()})},pn=()=>{if(!f.value)return;Re.value?(We.value&&(clearTimeout(We.value),We.value=null),he(),Re.value=!1):he();const o=window.getSelection();let n=null;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;n=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!n&&qe.value&&(n=qe.value),n&&n.parentNode){const s=document.createDocumentFragment();for(;n.firstChild;)s.appendChild(n.firstChild);if(n.parentNode.replaceChild(s,n),s.firstChild){const r=document.createRange();r.setStartBefore(s.firstChild),r.setEndAfter(s.lastChild||s.firstChild),o.removeAllRanges(),o.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),o.removeAllRanges(),o.addRange(r)}qe.value=null}else Sl("unlink");Ce.value=!1,nl(),e.nextTick(()=>{Mt(),Vl()})},Zn=()=>{B.disabled||!B.richText||f.value&&(Re.value?(We.value&&(clearTimeout(We.value),We.value=null),he(),Re.value=!1):he(),nl(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Nl(),Mt(),Yt()}))},wn=()=>{B.disabled||!B.richText||f.value&&(Re.value?(We.value&&(clearTimeout(We.value),We.value=null),he(),Re.value=!1):he(),nl(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Nl(),Mt(),Yt()}))},jn=o=>{const n=o.parentElement;if(!n||n.tagName!=="OL")return null;let s=0,r=o.previousElementSibling;for(;r;)r.tagName==="LI"&&s++,r=r.previousElementSibling;return s+1},Nl=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(n=>{const s=n.parentElement;if(s&&s.tagName==="LI"){const r=jn(s);r!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},fn=()=>{if(B.disabled||!B.richText||!f.value)return;nl(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const n=o.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{Nl(),Mt()});return}const r=s.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=s.previousElementSibling;if(c&&c.tagName==="LI"){const d=r.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const m=jn(c);u.appendChild(s),m!==null&&r.tagName==="OL"&&s.setAttribute("data-parent-num",String(m)),Nl();const v=document.createRange();v.selectNodeContents(s),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{Mt(),Yt()})}else document.execCommand("indent",!1),e.nextTick(()=>{Nl(),Mt(),Yt()})},bl=()=>{if(B.disabled||!B.richText||!f.value)return;nl(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const n=o.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{Nl(),Mt()});return}const r=s.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=r.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){r.tagName==="OL"&&s.removeAttribute("data-parent-num"),d.insertBefore(s,c.nextSibling),r.children.length===0&&r.remove(),Nl();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{Mt(),Yt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Nl(),Mt(),Yt()})},pl=e.ref(null),Wl=e.ref(null),y=e.ref({}),h=e.ref(""),x=e.ref(null),q=e.ref("");e.ref("");const de=e.ref(null);e.ref("");const Ge=e.ref([]),Ot=e.ref(!1),fl=e.ref(!1),Hl=o=>{if(!o)return"";const n=o.cloneRange(),s=document.createElement("div");return s.appendChild(n.cloneContents()),s.innerHTML},Pl=()=>{if(!B.commentUser||B.disabled||!B.richText||!f.value)return;if(pl.value!==null){pl.value=null,h.value="",q.value="",de.value=null,Ge.value=[],An(!0);return}nl(),f.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0);if(n.collapsed||!$n(n))return;q.value=Hl(n)||"",de.value=Jt();const s=n.getBoundingClientRect(),r=f.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=s.bottom-c.top,m=Math.max(d+8,0);y.value={top:`${m}px`,bottom:"auto"},pl.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 v=r.querySelector(".dss-comment-overlay");if(v&&r){const k=r.querySelector(".dss-text-editor-footer");if(k){const T=r.getBoundingClientRect(),R=v.getBoundingClientRect(),E=k.getBoundingClientRect(),ne=R.bottom-T.top,j=E.top-T.top,Ie=8;if(ne>j-Ie){const we=E.height;y.value={bottom:`${we+Ie}px`,top:"auto"}}else y.value={top:`${m}px`,bottom:"auto"}}}})},xn=()=>{if(!h.value.trim())return;const o=h.value.trim(),n=new Date,s={text:o,selectionText:q.value,selectionRange:de.value,commentId:pl.value,user:B.commentUser||null,createdAt:n.toISOString()};Ge.value=[...Ge.value,s],ve("comment-submitted",s),xo(s),de.value&&!Zo(de.value)&&po(pl.value,de.value),h.value="",e.nextTick(()=>{if(x.value){const r=x.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Ol("sendComment")})},uo=(o,n)=>{if(!(!B.commentUser||!o.user||o.user.id!==B.commentUser.id)){if(Ge.value=Ge.value.filter((s,r)=>r!==n),pl.value!==null&&f.value){const s=String(pl.value),r=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(r&&Ge.value.length>0){const c=[],d=new Set;Ge.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),c.push(u.user))}),c.length>0?r.setAttribute("data-comment-user",JSON.stringify(c[0])):r.removeAttribute("data-comment-user"),c.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(c[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(Ge.value.length))}else r&&Ge.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(ve("comment-deleted",{comment:o,index:n,commentId:pl.value}),B.comments&&Array.isArray(B.comments)){const s=B.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));ve("update:comments",s)}e.nextTick(()=>{Ol("deleteComment")})}},Zo=o=>{if(!o||!f.value)return!1;try{const n=mo(o);if(!n)return!1;const s=n.commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},mo=o=>{if(!o||!f.value)return null;try{const n=document.createRange();if(o.type==="element"&&o.element)return f.value.contains(o.element)?(n.setStart(o.element,o.offset),n.collapse(!0),n):null;let s=0;const r=[f.value];let c=null,d=!1,u=!1;for(;!u&&(c=r.pop());)if(c.nodeType===3){const m=s+c.length;!d&&o.start>=s&&o.start<=m&&(n.setStart(c,o.start-s),d=!0),d&&o.end>=s&&o.end<=m&&(n.setEnd(c,o.end-s),u=!0),s=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return d?n:null}catch{return null}},po=(o,n)=>{if(!(!o||!n||!f.value))try{const s=mo(n);if(!s||s.collapsed)return;const r=s.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const m=c.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(o)&&m.getAttribute("data-fake-comment")!==String(o)&&m.setAttribute("data-comment",String(o));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(o));try{const m=s.startContainer,v=s.endContainer,k=s.startOffset,T=s.endOffset,R=m.nodeType===3?m.parentNode:m,E=v.nodeType===3?v.parentNode:v;if(R===E&&k===0&&T===(v.nodeType===3?v.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 j=s.extractContents();d.appendChild(j),s.insertNode(d)}else s.surroundContents(d)}catch{const v=s.extractContents();d.appendChild(v),s.insertNode(d)}const u=f.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{Ol("wrapSelectionWithCommentMarker"),Mt()})}catch{}},xo=o=>{if(!o||!o.commentId)return;const n=Array.isArray(B.comments)?[...B.comments]:[],s=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let r=n.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(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(r>=0){const d=n[r];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=o.createdAt,!d.article_id&&n.length>0){const u=n.find(m=>m.article_id);u&&(d.article_id=u.article_id)}}else{const d=o.selectionRange,u=n.length>0&&n.find(v=>v.article_id)?.article_id||null,m={conversation_id: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"};n.push(m)}Ot.value=!0,ve("update:comments",n)},Uo=(o,n=[])=>{if(!B.commentUser||B.disabled||!B.richText||!f.value)return;const s=f.value;let r=null;try{r=s.querySelector(o)}catch{return}if(!r)return;nl(),s.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),q.value=r.innerHTML||"",de.value=Jt();const u=c.getBoundingClientRect(),m=s.parentElement;if(m){const T=m.getBoundingClientRect(),R=u.bottom-T.top,ne=Math.max(R+8,0);y.value={top:`${ne}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let k=[];if(v&&B.comments&&Array.isArray(B.comments)){const T=B.comments.find(R=>String(R.conversation_id)===String(v));if(T&&T.conversation&&Array.isArray(T.conversation)){const R=T.conversation.map(E=>({id:E.id||E.commentary_id,commentary_id:E.id||E.commentary_id,conversation_id:T.id||T.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(n)&&n.length>0&&(k=n.slice()),k.sort((T,R)=>{const E=Ie=>{if(!Ie)return 0;const we=new Date(Ie).getTime();return isNaN(we)?0:we},ne=E(T.createdAt),j=E(R.createdAt);return ne===j?0:ne-j}),Ge.value=k,An(!0),pl.value=v||null,r&&(Wl.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(h.value="",x.value){const T=x.value;T.style.height="auto",T.style.height=`${T.scrollHeight}px`,T.focus()}if(m){const T=m.querySelector(".dss-comment-overlay");if(T){const R=m.querySelector(".dss-text-editor-footer");if(R){const E=m.getBoundingClientRect(),ne=T.getBoundingClientRect(),j=R.getBoundingClientRect(),Ie=ne.bottom-E.top,we=j.top-E.top,yt=8;if(Ie>we-yt){const Cl=j.height;y.value={bottom:`${Cl+yt}px`,top:"auto"}}}}}Ol("openCommentOverlayForSelector")})},fo=e.ref(null),Kn=e.ref(0),Xo=o=>{if(!(B.disabled||!B.richText)){if(o.key==="Escape"){const n=window.getSelection();if(n.rangeCount>0){const r=n.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){o.preventDefault();let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(m,u.nextSibling):c.appendChild(m),setTimeout(()=>{Mn()},50);return}}}if(o.key.length===1||o.key==="Enter"){const n=window.getSelection();if(n&&n.rangeCount>0){const s=n.getRangeAt(0),r=s.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const m=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,v=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(m)&&m!==u||d.contains(v)&&v!==u){o.preventDefault();const k=document.createRange();k.setStartAfter(d),k.collapse(!0),n.removeAllRanges(),n.addRange(k);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);let r=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"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=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"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=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"?(r=d,c=r.closest(".dss-image-wrapper")):(r=d.querySelector("img"),r&&(c=r.closest(".dss-image-wrapper"))),c){const v=c.contains(u)||u===c,k=c.contains(m)||m===c,R=s.cloneContents().textContent?.trim()||"",E=c.textContent?.trim()||"";(!v||!k||R.length>E.length)&&(c=null,r=null)}}if(c){o.preventDefault(),o.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const m=document.createRange();m.setStartAfter(u),m.collapse(!0),n.removeAllRanges(),n.addRange(m),e.nextTick(()=>{Mt()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?bl():fn();return}if(o.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);if(s.collapsed){const u=s.startContainer,m=v=>{if(!v)return!1;let k=v.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 T=v.parentElement;return T&&T!==f.value?m(T):!1};if(u.nodeType===3){const v=u.parentElement;if(v&&(m(v)||m(u))){const k=v.closest("p, div");if(k&&k!==f.value){o.preventDefault(),o.stopPropagation();let T=null;const R=s.startOffset;R<u.length&&(T=u.splitText(R));const E=document.createElement("p");if(T?E.appendChild(T):E.innerHTML="<br>",u.length===0){const j=u.parentElement;j&&(j.removeChild(u),j.childNodes.length===0&&j.appendChild(document.createElement("br")))}k.nextSibling?k.parentNode.insertBefore(E,k.nextSibling):k.parentNode.appendChild(E);const ne=document.createRange();T?ne.setStart(T,0):ne.setStart(E,0),ne.collapse(!0),n.removeAllRanges(),n.addRange(ne),e.nextTick(()=>{Mt()});return}}}}const r=s.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=j=>{if(!j)return!1;const Ie=j.textContent||"",yt=(j.innerHTML||"").trim(),Cl=yt.replace(/<br\s*\/?>/gi,"").trim();return Ie.trim()===""||yt===""||Cl===""||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>"},v=c.lastChild,k=v&&v.nodeType===1&&v.tagName==="BR",T=s.startContainer,R=T.nodeType===3?T.parentElement:T,E=R===c||R&&R.parentElement===c;if(u&&m(u)||k&&E){o.preventDefault(),setTimeout(()=>{Mn()},50);return}}}}if(o.key===" "){const n=Date.now(),s=n-Kn.value;if(fo.value===" "&&s<300){const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(d){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){o.preventDefault(),fn();return}}}}fo.value=" ",Kn.value=n}else fo.value=o.key}},vo=o=>{if(B.disabled||!B.richText)return;o.preventDefault();let n=o.clipboardData.getData("text/html"),s=o.clipboardData.getData("text/plain");n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),he();const r=window.getSelection();let c=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),c=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const v=new DOMParser().parseFromString(u,"text/html");let k=f.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach(R=>{if(k>0){const E=v.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(v.body.children).filter(ne=>R.includes(ne.tagName));if(E.length===1){const ne=E[0].tagName,j=c.tagName,Ie=c.textContent.trim()===""&&!c.querySelector("img");let we=!1;if(["H1","H2","H3","H4","H5","H6"].includes(j)?we=!0:Ie||(ne===j||ne==="P")&&(we=!0),we)return E[0].innerHTML.trim()}}return v.body.innerHTML.trim()};if(n){const u=d(n);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);Mt()},Ll=o=>{if(xe.value){const s=o.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&nl()}if(ot.value){const s=o.target,r=s.closest(".dss-floating-toolbar"),c=f.value&&s.closest(".dss-text-editor-content");!r&&!c&&Rn()}if(dt.value){const s=o.target,r=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!r&&!c&&En()}const n=o.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(Je.value=null),!f.value||!n.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const r=s.getRangeAt(0);Y.value=!r.collapsed&&$n(r)}else Y.value=!1}if(pl.value!==null){const s=document.querySelector(".dss-comment-overlay");let r=!1;if(s){const u=s.getBoundingClientRect(),m=o.clientX,v=o.clientY;r=m>=u.left&&m<=u.right&&v>=u.top&&v<=u.bottom}const c=n.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!r&&!d&&(pl.value=null,h.value="",q.value="",de.value=null,Ge.value=[],An(!0))}},z=(o,n)=>{o&&o.stopPropagation&&o.stopPropagation(),Lt.value&&(clearTimeout(Lt.value),Lt.value=null),Je.value=n},wl=o=>{const n=o.relatedTarget;if(n){const s=n.closest(".dss-toolbar-dropdown-submenu"),r=n.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||r)return}Lt.value&&clearTimeout(Lt.value),Lt.value=setTimeout(()=>{Je.value=null,Lt.value=null},150)},Zl=o=>{Je.value=null};let Un=0;const xl=o=>{if(!o)return;const n=Array.from(o.children);n.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")}),n.forEach((s,r)=>{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-${++Un}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",m);let v=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),v=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),v=d),v&&(v.setAttribute("data-submenu-id",m),v.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(T=>{(T.tagName==="BUTTON"||T.tagName==="DIV")&&!T.classList.contains("dss-toolbar-dropdown-item")&&T.classList.add("dss-toolbar-dropdown-item")}))}})},Ul=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{xl(n),n.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=v=>{const k=c.getAttribute("data-submenu-id");k&&z(v,k)},m=wl;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m}}),n.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=k=>{const T=c.getAttribute("data-submenu-id");T&&z(k,T)},m=wl;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",Zl)})})})};let Zt=null;const Qt=()=>{if(Je.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Je.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Je.value}"]`);o&&n&&lo(o,n)}if(ot.value&&Yt(),B.richText){if(Zt!==null)return;Zt=setTimeout(()=>{Zt=null,Ol("handleWindowResize")},150)}},Xl=()=>{if(!B.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(n=>{Array.from(n.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},_n=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),n=s=>{if(s.preventDefault(),s.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};o.forEach(s=>{s.addEventListener("selectstart",n),s.addEventListener("mousedown",n),s.addEventListener("dragstart",n),s.addEventListener("contextmenu",n),s.addEventListener("click",r=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{tl.value?je():El(),S.value?_l():cl()})}),e.nextTick(()=>{_n()}),B.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Ll),window.addEventListener("resize",Qt);let o=null;const n=()=>{o===null&&(o=setTimeout(()=>{o=null,Qt()},150))};window.addEventListener("scroll",n,!0),f.value._windowScrollHandler=n,f.value._windowScrollTimeout=o,f.value.closest(".editor-with-comments"),f.value.closest(".dss-text-editor-content-wrapper");const s=f.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,Qt()},150))};s&&(s.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{Ul(),Xl()}),f.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!B.disabled&&m.preventDefault();const T=v.closest(".dss-image-no-alt-icon"),R=v.closest(".dss-image-wrapper");if(T||R&&v===R){m.preventDefault(),m.stopPropagation();const E=window.getSelection(),ne=document.createRange();ne.setStartAfter(R),ne.collapse(!0),E.removeAllRanges(),E.addRange(ne)}else R&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const E=window.getSelection();if(E.rangeCount>0){const j=E.getRangeAt(0).commonAncestorContainer,Ie=j.nodeType===3?j.parentElement:j;if(R.contains(Ie)&&Ie!==R.querySelector("img")){const we=document.createRange();we.setStartAfter(R),we.collapse(!0),E.removeAllRanges(),E.addRange(we)}}else{const ne=document.createRange();ne.setStartAfter(R),ne.collapse(!0),E.addRange(ne)}}))},!0),f.value.addEventListener("mousedown",m=>{const v=m.target,k=v.closest(".dss-image-no-alt-icon"),T=v.closest(".dss-image-wrapper");if(k||T&&v.tagName!=="IMG"){m.preventDefault();const R=window.getSelection(),E=document.createRange();T&&(E.setStartAfter(T),E.collapse(!0),R.removeAllRanges(),R.addRange(E))}},!0),f.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!f.value)return;f.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||"",ne=E.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),j=R===E||R===ne;(R.startsWith("http://")||R.startsWith("https://")||R.startsWith("data:")||j||j)&&(k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="")}}}),Ke()})}),f.value.addEventListener("dragstart",m=>{const v=m.target,k=v.tagName==="IMG"?v:v.closest("img"),T=k?.closest(".dss-image-wrapper");k&&f.value.contains(k)&&(xt.value=T||k,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",m=>{xt.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",m=>{xt.value&&(m.preventDefault(),m.stopPropagation())}),f.value.addEventListener("drop",m=>{if(!xt.value||!f.value)return;m.preventDefault(),m.stopPropagation();const v=xt.value,k=v.classList?.contains("dss-image-wrapper"),T=k?v.querySelector("img"):v,R=k?v:T?.closest(".dss-image-wrapper");if(!T||!f.value.contains(T)){xt.value=null;return}let E=null;const ne=m.clientX,j=m.clientY;if(document.caretRangeFromPoint)E=document.caretRangeFromPoint(ne,j);else{const sl=window.getSelection();sl.rangeCount>0?E=sl.getRangeAt(0).cloneRange():(E=document.createRange(),E.selectNodeContents(f.value),E.collapse(!1))}if(!E){xt.value=null;return}const Ie=E.commonAncestorContainer,we=Ie.nodeType===3?Ie.parentElement:Ie;if(we?.closest(".dss-image-wrapper")===R||R&&R.contains(we)){xt.value=null;return}if(R&&(we===R||R.contains(we))){xt.value=null;return}const Cl=T.getAttribute("src");let vl=null;R?vl=R.cloneNode(!0):vl=T.cloneNode(!0);try{let sl=E.startContainer;if(sl.nodeType===3&&(sl=sl.parentElement),R&&(sl===R||R.contains(sl))){const rl=document.createRange();rl.setStartAfter(R),rl.collapse(!0),E=rl}E.insertNode(vl);const ul=document.createRange();ul.setStartAfter(vl),ul.collapse(!0);const gl=window.getSelection();gl.removeAllRanges(),gl.addRange(ul)}catch{if(f.value.childNodes.length===0){const ul=document.createElement("p");ul.appendChild(vl),f.value.appendChild(ul)}else{const ul=f.value.lastChild;if(ul&&ul.nodeType===1)ul.appendChild(vl);else{const gl=document.createElement("p");gl.appendChild(vl),f.value.appendChild(gl)}}}R?R.remove():T.remove(),xt.value=null,e.nextTick(()=>{const sl=f.value.querySelectorAll("img");let ul=!1;sl.forEach(gl=>{if(gl.getAttribute("src")===Cl)if(!ul)ul=!0;else{const rl=gl.closest(".dss-image-wrapper");rl?rl.remove():gl.remove()}}),Ke(),Mt()})}),f.value.addEventListener("dragend",m=>{xt.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(v=>{v.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 T=k.querySelectorAll&&k.querySelectorAll("img");T&&T.forEach(R=>{R.removeAttribute("alt"),R.removeAttribute("data-alt"),R.setAttribute("alt",""),R.setAttribute("data-alt",""),R.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Ke(),Xl(),d=null},100)});if(u.observe(f.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{Xl()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),B.modelValue){const m=$(B.modelValue);f.value.innerHTML=m,Dl()}e.nextTick(()=>{const m=f.value.innerHTML||"",v=B.title||"",k=B.description||"";bt.value=m,J.value=v,Z.value=k,X.value=v,re.value=k,Nl(),Ke(),an(),it(),$o(),to()}),Vl(),qt(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Ll),window.removeEventListener("resize",Qt),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),Zt!==null&&(clearTimeout(Zt),Zt=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),We.value&&clearTimeout(We.value),Lt.value&&clearTimeout(Lt.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),ze.value&&ze.value.disconnect(),ft.value!==null&&(cancelAnimationFrame(ft.value),ft.value=null),st.value!==null&&(clearTimeout(st.value),st.value=null),vt.value!==null&&(clearTimeout(vt.value),vt.value=null),An(!0),f.value&&f.value._scrollHandlers){const{wrapper:n,content:s,handler:r}=f.value._scrollHandlers;n&&n.removeEventListener("scroll",r),s&&s.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const It=o=>{const n=o.target,s=n.closest("a");if(s&&!B.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(s);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const r=n.closest(".dss-image-wrapper");r&&n.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(r.contains(m)&&m!==r.querySelector("img")){const v=document.createRange();v.setStartAfter(r),v.collapse(!0),c.removeAllRanges(),c.addRange(v)}}Ke(),Vl(),qt(),Yt(),it()}):e.nextTick(()=>{Ke(),Vl(),qt(),Yt(),it()})},Tt=()=>{gt();const o=window.getSelection();if(o&&o.rangeCount>0){const s=o.getRangeAt(0);Y.value=!s.collapsed&&$n(s),!s.collapsed&&C.value&&(C.value=null)}else Y.value=!1;if(Ke(),Vl(),qt(),Yt(),it(),o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c&&c.closest(".dss-text-editor-footer")){o.removeAllRanges(),Y.value=!1;return}}["bold","italic","underline"].forEach(s=>{try{const r=window.getSelection();if(r.rangeCount>0){const c=r.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 v=window.getComputedStyle(u);parseInt(v.fontWeight)>=600&&(m=!0)}catch{}ee.value[s]=m}else{const d=document.queryCommandState(s);ee.value[s]=d}}}catch{}})},it=()=>{if(!B.richText||B.disabled||!f.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,r=s.nodeType===3?s.parentElement:s;if(!r||!f.value.contains(r)){V.value="p";return}const c=r.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"}},qt=()=>{if(!f.value){Ye.value=!1;return}try{const o=window.getSelection();let n=!1;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");n=!!(c&&f.value.contains(c))}Ye.value=n}catch{Ye.value=!1}},$n=o=>{if(!o||!f.value)return!1;const n=o.commonAncestorContainer;if(!n)return!1;const s=n.nodeType===3?n.parentElement:n;return s?f.value.contains(s):!1},Rn=()=>{ot.value=!1},Yt=()=>{if(!B.floatingToolbar||!B.richText||B.disabled){ot.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){ot.value=!1;return}const n=o.getRangeAt(0);if(n.collapsed||!$n(n)){ot.value=!1;return}const s=n.getBoundingClientRect();if(!s||s.width===0&&s.height===0){ot.value=!1;return}const r=f.value;if(!r){ot.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){ot.value=!1;return}const d=40,u=8,m=s.top-d/2+15;let v=s.left+s.width/2;const k=window.innerWidth||document.documentElement.clientWidth||0;let T=0;tt.value&&(T=tt.value.getBoundingClientRect().width);const R=(T||320)/2;let E=c.left+R,ne=c.right-R;if(ne<E){const j=c.left+c.width/2;E=j,ne=j}if(k>0){const j=R+u,Ie=k-R-u;if(E=Math.max(E,j),ne=Math.min(ne,Ie),ne<E){const we=k/2;E=we,ne=we}}v<E?v=E:v>ne&&(v=ne),be.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},ot.value=!0},Gn=o=>{B.disabled||!B.richText||(dt.value=dt.value===o?null:o,o==="askAi"&&(xe.value=null))},En=()=>{dt.value=null,Je.value=null},vn=o=>{zl(o),En()};let sn=null,Fn=null,Sn=null,In=null;const Ln=o=>{if(B.disabled||!B.richText){Rl(),Xn();return}const n=o.target,s=n.closest("a"),r=n.closest("img");if(sn&&(clearTimeout(sn),sn=null),Sn&&(clearTimeout(Sn),Sn=null),s&&s!==Fn){Xn(),Fn=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),qe.value=s,me.value=c,U.value=!0,Se.value=!0,So(s)}else!s&&Fn?(Fn=null,sn=setTimeout(()=>{Se.value||Rl()},150)):s&&s===Fn&&So(s);if(r&&r!==In){Rl(),In=r;let c=r.getAttribute("alt");c===null&&(c=r.alt||"");let d=r.getAttribute("data-alt");d===null&&(d=c),r.hasAttribute("alt")||r.setAttribute("alt",c),r.hasAttribute("data-alt")||r.setAttribute("data-alt",d),Ct.value=r,Wt.value=c.trim()||A("textEditor.image.noAlt"),$t.value=!0,ye.value=!0,zn(r)}else!r&&In?(In=null,Sn=setTimeout(()=>{ye.value||Xn()},150)):r&&r===In&&zn(r)},Eo=o=>{const n=o.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(Fn=null,In=null,sn&&(clearTimeout(sn),sn=null),Sn&&(clearTimeout(Sn),Sn=null),Rl(),Xn())},Rl=()=>{Se.value=!1,setTimeout(()=>{Se.value||(U.value=!1,me.value="",Te.value||(qe.value=null))},100)},So=o=>{if(!o||!f.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;F.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Xn=()=>{ye.value=!1,setTimeout(()=>{ye.value||($t.value=!1,Wt.value="",kt.value||(Ct.value=null))},100)},zn=o=>{if(!o||!f.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;K.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Yo=()=>{if(!me.value||!qe.value)return;let n=qe.value.getAttribute("href")||me.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},Vo=()=>{if(qe.value){const o=qe.value.textContent||"",n=qe.value.getAttribute("href")||"",s=qe.value;nt.value=n,mt.value=o,Me.value=o,Se.value=!1,U.value=!1,me.value="",qe.value=s,Te.value=!0}else if(Ce.value){const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(r){const c=r.textContent||"",d=r.getAttribute("href")||"";nt.value=d,mt.value=c,Me.value=c,qe.value=r,Te.value=!0}}}else{Ee.value=Jt();const o=window.getSelection();let n="";o.rangeCount>0&&(n=o.getRangeAt(0).toString()),nt.value="",mt.value=n,Me.value="",qe.value=null,Te.value=!0}e.nextTick(()=>{W.value&&(W.value.focus(),W.value.select())})},Qn=()=>{Te.value=!1,nt.value="",mt.value="",Me.value="",qe.value=null,Ee.value=null},Jn=()=>{if(!nt.value.trim()){Qn();return}if(Re.value?(We.value&&(clearTimeout(We.value),We.value=null),he(),Re.value=!1):he(),mt.value.trim()||(mt.value=nt.value.trim()),qe.value&&f.value&&f.value.contains(qe.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const n=qe.value;if(n.setAttribute("href",nt.value.trim()),mt.value.trim()!==Me.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=mt.value.trim()}n.style.color="#60afdf",n.style.textDecoration="underline";const s=document.createRange();s.selectNodeContents(n),s.collapse(!1),o.removeAllRanges(),o.addRange(s),Mt()}else if(f.value){f.value.focus();const o=window.getSelection();o.removeAllRanges(),Ee.value&&$l(Ee.value);let n=null;if(o.rangeCount>0&&(n=o.getRangeAt(0)),n&&!n.collapsed){n.toString();const s=document.createElement("a");s.href=nt.value.trim(),s.textContent=mt.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",n.deleteContents(),n.insertNode(s);const r=document.createTextNode(" ");n.setStartAfter(s),n.insertNode(r),n.setStartAfter(r),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(f.value),n.collapse(!1));const s=n.startContainer,r=s.nodeType===3,c=r&&n.startOffset===s.textContent.length,d=document.createElement("a");if(d.href=nt.value.trim(),d.textContent=mt.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=s.parentElement;for(;u&&u!==f.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==f.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const v=document.createTextNode(" ");m.appendChild(v);const k=document.createRange();k.setStartAfter(d),k.collapse(!0),o.removeAllRanges(),o.addRange(k)}else{if(n.startOffset>0){const k=s.textContent.substring(0,n.startOffset),T=k[k.length-1];if(T&&T!==" "&&T!==" "&&T!==`
102
102
  `){const R=document.createTextNode(" ");n.insertNode(R),n.setStartAfter(R)}}n.insertNode(d);const v=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(v),n.setStartAfter(v),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}}}else{if(r&&n.startOffset>0){const m=s.textContent.substring(0,n.startOffset),v=m[m.length-1];if(v&&v!==" "&&v!==" "&&v!==`
103
- `){const k=document.createTextNode(" ");n.insertNode(k),n.setStartAfter(k)}}n.insertNode(d);const u=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(u),n.setStartAfter(u),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}}de()}e.nextTick(()=>{pl(),Un()})},Gn=()=>{if(!f.value||G.value)return;const o=window.getSelection();let n=null;o&&o.rangeCount>0&&(n=Qt());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,r=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const v=m.parentElement;return!v||v.closest("a")||v.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=r.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const v=c[m],k=v.textContent;s.lastIndex=0;const L=[...k.matchAll(s)];if(L.length===0)continue;const R=L.filter(j=>{const Ie=j[0],Ve=j.index;if(Ve>0&&k[Ve-1]==="@"||Ve+Ie.length<k.length&&k[Ve+Ie.length]==="@")return!1;const nt=v.parentElement;return!(nt&&nt.closest("a"))});if(R.length===0)continue;if(R.length===1&&R[0][0]===k.trim()){const j=R[0][0],Ie=j.startsWith("http://")||j.startsWith("https://")?j:`https://${j}`,Ve=document.createElement("a");Ve.href=Ie,Ve.textContent=j,Ve.style.color="#60afdf",Ve.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(Ve,v),u=!0);continue}let E=0;const ae=document.createDocumentFragment();if(R.forEach(j=>{const Ie=j.index,Ve=j[0];if(Ie>E){const fl=k.substring(E,Ie);fl&&ae.appendChild(document.createTextNode(fl))}const nt=Ve.startsWith("http://")||Ve.startsWith("https://")?Ve:`https://${Ve}`,bl=document.createElement("a");bl.href=nt,bl.textContent=Ve,bl.style.color="#60afdf",bl.style.textDecoration="underline",ae.appendChild(bl),E=Ie+Ve.length}),E<k.length){const j=k.substring(E);j&&ae.appendChild(document.createTextNode(j))}v.parentNode&&ae.childNodes.length>0&&(v.parentNode.replaceChild(ae,v),u=!0)}u&&n&&e.nextTick(()=>{ol(n),pl()})},Bo=()=>{if(!f.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),s=[];let r;for(;r=n.nextNode();)s.push(r);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 v=0;const k=document.createDocumentFragment();m.forEach(L=>{const R=L.index,E=L[0].startsWith("<u>")?"u":"ins",ae=L[1]||L[2]||"";R>v&&k.appendChild(document.createTextNode(u.substring(v,R)));const j=document.createElement(E);j.textContent=ae,k.appendChild(j),v=R+L[0].length}),v<u.length&&k.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&k.childNodes.length>0&&d.parentNode.replaceChild(k,d)}},Mo=o=>{if(!f.value||G.value)return;if(!o){Bo();return}if(!["*","_",">"].includes(o))return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const r=s.getRangeAt(0);if(!r.collapsed)return;const c=r.startContainer.nodeType===Node.TEXT_NODE?r.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):r.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===f.value||!f.value.contains(c))return;const d=()=>{let fl="",sl=0,vl=!1;const cl=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Xl=>Xl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let ul=0;for(;cl.nextNode();){const Xl=cl.currentNode,pn=Xl.textContent||"",bn=ul;if(ul+=pn.length,Xl===r.startContainer){fl+=pn.substring(0,r.startOffset),sl=bn+r.startOffset,vl=!0;break}fl+=pn}return vl||(sl=fl.length),{textBeforeCursor:fl,cursorCharOffset:sl}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,v=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?v="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?v="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(v=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const k=m[0],L=m[1],R=u.length-k.length,ae=(fl=>{let sl=0;const vl=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:ul=>ul.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let cl;for(;cl=vl.nextNode();){const ul=(cl.textContent||"").length;if(sl+ul>=fl)return{node:cl,offset:fl-sl};sl+=ul}return null})(R);if(!ae)return;const j=document.createRange();j.setStart(ae.node,ae.offset),j.setEnd(r.endContainer,r.endOffset);const Ie=document.createElement(v);Ie.textContent=L,j.deleteContents(),j.insertNode(Ie);const Ve=window.getSelection(),nt=document.createRange();nt.setStartAfter(Ie),nt.collapse(!0),Ve.removeAllRanges(),Ve.addRange(nt);const bl=Qt();e.nextTick(()=>{de(),bl&&ol(bl)})},po=()=>{f.value&&(Gt.value=Qt(),Et.value="",Pt.value="",Ue.value="",se.value="",ge.value="",Ht.value=null,bt.value=null,Be.value="upload",Ct.value=!0,il(),e.nextTick(()=>{He.value&&He.value.focus(),_e.value&&(_e.value.value="")}))},tn=o=>{const n=o.target?.files?.[0];if(!n){Ht.value=null,Pt.value="";return}Ht.value=n;const s=new FileReader;s.onload=r=>{Pt.value=r.target?.result||""},s.readAsDataURL(n)},ln=()=>{_e.value&&_e.value.click()},Qn=()=>{se.value&&(ge.value="")},fo=()=>{ge.value&&(se.value="")},_o=()=>{let o=bt.value;if(!o){const n=window.getSelection();if(n&&n.rangeCount>0){const r=n.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(o){const n=o.getAttribute("data-alt")||o.getAttribute("alt")||"";bt.value=o,Et.value=n.trim()===""||n.trim()==="Image"?"":n;const s=o.getAttribute("src")||o.src||"";s.startsWith("http://")||s.startsWith("https://")?(Ue.value=s,Pt.value="",Be.value="url"):(Pt.value=s,Ue.value="",Be.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";se.value=c.endsWith("px")?c.replace("px",""):c,ge.value=d.endsWith("px")?d.replace("px",""):d,Gt.value=null}else{po();return}Ct.value=!0,ye.value=!1,Lt.value=!1,e.nextTick(()=>{Be.value==="url"&&Xt.value?(Xt.value.focus(),Xt.value.select()):He.value&&(He.value.focus(),He.value.select()),_e.value&&(_e.value.value="")})},Dn=()=>{Ct.value=!1,Et.value="",Pt.value="",Ue.value="",se.value="",ge.value="",Ht.value=null,bt.value=null,Gt.value=null,Be.value="upload"},Rl=()=>{const o=(Et.value||"").trim(),n=f.value?._mutationObserver;n&&n.disconnect(),Fe.value?(We.value&&(clearTimeout(We.value),We.value=null),at(),Fe.value=!1):at();const s=Be.value==="url"?Ue.value.trim():Pt.value;if(bt.value&&f.value&&f.value.contains(bt.value)){s&&(bt.value.src=s),bt.value.setAttribute("alt",o),bt.value.setAttribute("data-alt",o),se.value?(bt.value.style.width=`${se.value}px`,bt.value.setAttribute("width",se.value)):(bt.value.style.removeProperty("width"),bt.value.removeAttribute("width")),ge.value?(bt.value.style.height=`${ge.value}px`,bt.value.setAttribute("height",ge.value)):(bt.value.style.removeProperty("height"),bt.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(bt.value),c.collapse(!0),r.addRange(c)}de()}else{if(!s){n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),Dn();return}if(f.value){f.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(Gt.value&&(ol(Gt.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&f.value){if(d=document.createRange(),f.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",f.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){Dn();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!f.value.contains(m)){if(d=document.createRange(),f.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",f.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const v=document.createElement("img");v.src=s,v.setAttribute("alt",o),v.setAttribute("data-alt",o),se.value&&(v.style.width=`${se.value}px`,v.setAttribute("width",se.value)),ge.value&&(v.style.height=`${ge.value}px`,v.setAttribute("height",ge.value));try{d.insertNode(v),d.setStartAfter(v),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(f.value){if(f.value.childNodes.length===0){const R=document.createElement("p");f.value.appendChild(R),R.appendChild(v)}else{const R=f.value.lastChild;if(R&&R.nodeType===1)R.appendChild(v);else{const E=document.createElement("p");f.value.appendChild(E),E.appendChild(v)}}const L=document.createRange();L.setStartAfter(v),L.collapse(!0),c&&(c.removeAllRanges(),c.addRange(L))}}bt.value=v,de()}}e.nextTick(()=>{n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),pl(),tl(),Dn()})};e.watch(()=>$.modelValue,o=>{if($.richText&&f.value&&!G.value){const n=O(o||""),r=f.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=n.replace(/&nbsp;|\u00A0/g," ");if(r!==c){const d=Qt();f.value.innerHTML=n,e.nextTick(()=>{kt();const u=f.value.innerHTML||"",m=$.title||"",v=$.description||"";xt.value=u,J.value=m,Z.value=v,ft.value=u,X.value=m,re.value=v,et.value=[],Ot.value=[],We.value&&(clearTimeout(We.value),We.value=null),Fe.value=!1,d&&ol(d),Ml(),ml(),Ae(),pl(),tl(),wt(),wl("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>$.richText,o=>{o?(tl(),e.nextTick(()=>{ho()})):(qn(),le.value=[],ze.value&&(ze.value.disconnect(),ze.value=null)),wt()}),e.watch(()=>$.floatingToolbar,o=>{o?tl():qn()}),e.watch(()=>$.disabled,o=>{o&&qn(),wt()}),e.watch(()=>$.description,()=>{e.nextTick(()=>{S.value?Nl():Jl()})}),e.watch(()=>$.title,()=>{e.nextTick(()=>{ll.value?Qe():nl()})}),e.watch(()=>$.customToolbarSlots,()=>{e.nextTick(()=>{Jt()})},{deep:!0}),e.watch(()=>$.comments,(o,n)=>{if(mt.value){mt.value=!1;return}Rt.value||$.richText&&f.value&&e.nextTick(()=>{Vl()})},{deep:!0,immediate:!1});const Vl=()=>{if(!Rt.value&&!(!$.comments||!Array.isArray($.comments)||$.comments.length===0)&&!(!$.richText||!f.value)){Rt.value=!0;try{const o=new Set,n=$.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),s=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=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;n.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const m=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!m)return;const v=String(m);if(d.has(v))return;const k=f.value.querySelector(`[data-comment="${v}"]`);if(k){Kt(k,u),d.add(v);return}try{const L=Yo(u.selection_range,u.selection_text);if(L&&!L.collapsed){const R=L.commonAncestorContainer,E=R.nodeType===3?R.parentElement:R;if(E){const Ie=E.closest("[data-comment], [data-fake-comment]");if(Ie){const Ve=Ie.getAttribute("data-comment")||Ie.getAttribute("data-fake-comment");if(String(Ve)===String(m)){Ie.setAttribute("data-comment",v),Ie.removeAttribute("data-fake-comment"),Kt(Ie,u),d.add(v);return}else return}}const ae=f.value.querySelector(`[data-comment="${v}"]`);if(ae){Kt(ae,u),d.add(v);return}const j=document.createElement("span");j.setAttribute("data-comment",v),Kt(j,u);try{L.surroundContents(j),c++,d.add(v)}catch{try{const Ve=document.createRange();Ve.setStart(L.startContainer,L.startOffset),Ve.setEnd(L.endContainer,L.endOffset),vo(Ve),Ve.surroundContents(j),c++,d.add(v)}catch{try{const nt=L.extractContents();j.appendChild(nt),L.insertNode(j),c++,d.add(v)}catch(nt){console.warn("Failed to create comment marker:",nt)}}}}}catch{}}),e.nextTick(()=>{wl("restoreCommentsFromModel"),de(),Rt.value=!1})}catch{Rt.value=!1}}},vo=o=>{if(!o||!f.value)return o;try{const n=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let s=o.startContainer,r=o.startOffset;if(s.nodeType===3){const u=s.parentElement;u&&n.includes(u.tagName)&&(r===0&&!Ut(s)||o.setStartBefore(u))}else s.nodeType===1&&n.includes(s.tagName)&&r>0&&o.setStartBefore(s);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&n.includes(u.tagName)&&(d===c.length&&!$o(c)||o.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},Ut=o=>{let n=o.previousSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.previousSibling}return!1},$o=o=>{let n=o.nextSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.nextSibling}return!1},Yo=(o,n)=>{if(!o||!f.value)return null;try{const s=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(s.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(s.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}return u?vo(s):null}}catch{return null}return null},Kt=(o,n)=>{if(!o||!n)return;const s=n.conversation||[],r=new Set,c=[],d=m=>{m&&m.id&&!r.has(m.id)&&(r.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")},wl=(o="unknown")=>{if(!$.richText||!f.value){le.value=[];return}Date.now()-Bt.value<Vt&&gt.value!==null||gt.value===null&&(gt.value=requestAnimationFrame(()=>{if(gt.value=null,Bt.value=Date.now(),Oe.value)return;Oe.value=!0;const s={},r=f.value;if(!r){Oe.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){Oe.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(E=>{const ae=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");ae&&E.tagName==="SPAN"&&(m.has(ae)||(u.push(E),m.add(ae)))}),d.forEach(E=>{const ae=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");!ae||m.has(ae)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(E.tagName)?E.querySelector(`span[data-comment="${ae}"], span[data-fake-comment="${ae}"]`)||(u.push(E),m.add(ae)):E.tagName!=="SPAN"&&(u.push(E),m.add(ae)))});const v=c.getBoundingClientRect(),k=r.getBoundingClientRect();u.forEach((E,ae)=>{let j=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");if(!j)return;if(typeof j=="string"&&j.startsWith("comment-")){const fn=E.textContent?.trim(),nn=$.comments?.find(Yl=>(typeof Yl.conversation_id=="string"&&Yl.conversation_id.startsWith("comment-")?null:Yl.conversation_id)&&Yl.selection_text?.trim()===fn);nn?(j=String(nn.conversation_id),E.setAttribute("data-comment",j),E.removeAttribute("data-fake-comment")):(j=String(Date.now()),E.setAttribute("data-comment",j),E.removeAttribute("data-fake-comment"))}const Ie=E.getBoundingClientRect(),Ve=window.getComputedStyle(E),nt=parseFloat(Ve.lineHeight)||parseFloat(Ve.fontSize)*1.2,sl=Ie.top-k.top+nt/2-15,cl=k.top-v.top+sl;let ul=null,Xl=null,pn=0;const bn=[],yo=new Set;if(j&&$.comments){const fn=$.comments.find(nn=>String(nn.conversation_id||nn.id)===String(j));if(fn){const nn=fn.conversation||[];nn.length>0?(nn.forEach(Yl=>{Yl.user&&Yl.user.id&&!yo.has(Yl.user.id)&&(yo.add(Yl.user.id),bn.push(Yl.user))}),pn=nn.length):(pn=0,ul=null,Xl=null),bn.length>0?ul=bn[0]:ul=null,bn.length>1?Xl=bn[1]:Xl=null}}const To=Ie.top+nt/2-15,jo=To+30,Mn=5,ko=jo>k.top+Mn&&To<k.bottom-Mn?1:0;le.value.find(fn=>fn.id===j);let Jn=E;if(!Jn&&j&&f.value){const fn=String(j);Jn=f.value.querySelector(`[data-comment="${fn}"], [data-fake-comment="${fn}"]`)}const Do=bn.length;s[j]?(s[j].top=cl,s[j].opacity=ko,s[j].element=Jn,s[j].firstUser=ul,s[j].secondUser=Xl,s[j].totalCount=pn,s[j].uniqueUserCount=Do):s[j]={id:j,top:cl,opacity:ko,element:Jn,firstUser:ul,secondUser:Xl,totalCount:pn,uniqueUserCount:Do}});const L=Object.values(s).map(E=>{const ae=Math.max(0,(E.uniqueUserCount??0)-2);if(!E.element&&E.id&&f.value){const Ie=String(E.id);E.element=f.value.querySelector(`[data-comment="${Ie}"], [data-fake-comment="${Ie}"]`)}return{...E,firstUser:E.firstUser||null,secondUser:E.secondUser||null,totalCount:E.totalCount,additionalCount:ae}});(le.value.length!==L.length||L.some((E,ae)=>{const j=le.value[ae];if(!j)return!0;const Ie=(j.firstUser?.id||null)!==(E.firstUser?.id||null),Ve=(j.secondUser?.id||null)!==(E.secondUser?.id||null);return j.id!==E.id||Math.abs(j.top-E.top)>1||j.opacity!==E.opacity||j.totalCount!==E.totalCount||j.additionalCount!==E.additionalCount||Ie||Ve||j.element!==E.element}))&&(le.value=L),Oe.value=!1}))},Lo=o=>{if(!o)return;let n=o.element;if(!n&&o.id&&f.value){const s=String(o.id);n=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}n&&(xl(),Zl.value=n,n.classList.add("editor-comment-highlighted"))},xl=(o=!1)=>{!o&&At.value!==null&&Zl.value&&(Zl.value.getAttribute("data-comment")||Zl.value.getAttribute("data-fake-comment"))===At.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),Zl.value&&(Zl.value.classList.remove("editor-comment-highlighted"),Zl.value=null))},go=o=>{if(!o||!o.element)return;xl(!0);const n=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!n)return;const s=`[data-comment="${n}"], [data-fake-comment="${n}"]`;ve("comment-marker-clicked",{commentId:n,selector:s,element:o.element})},Hn=()=>{xl()},ho=()=>{!$.richText||!f.value||(ze.value&&ze.value.disconnect(),ht.value!==null&&(clearTimeout(ht.value),ht.value=null),ze.value=new MutationObserver(()=>{ht.value===null&&(ht.value=setTimeout(()=>{ht.value=null,e.nextTick(()=>{wl("MutationObserver")})},200))}),ze.value.observe(f.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),wl("setupCommentMarkersObserver-initial"))},Ao=(o,n)=>{if(!o||!n)return;const s=n.getBoundingClientRect();let r=s.top,c=s.right+4;o.style.top=`${r}px`,o.style.left=`${c}px`,o.offsetHeight;const d=o.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const v=s.left-d.width-4;o.style.left=`${v}px`}if(d.bottom>m){const v=Math.max(8,m-d.height-8);o.style.top=`${v}px`}d.top<0&&(o.style.top="8px")};return e.watch(()=>Ke.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const r=s.getAttribute("data-submenu-id");if(r===o&&o){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(c){if(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(()=>{Ao(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(()=>{Cl()}):(Ke.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(n=>{if(n.parentNode===document.body){const s=n.getAttribute("data-submenu-id");if(s){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(r)if(n.dataset.originalParentRef==="inside")r.appendChild(n);else{const d=r.closest(".dss-toolbar-dropdown");d&&d.insertBefore(n,r.nextSibling)}}}})}))}),e.watch(()=>$.locale,o=>{o&&o!==ue.value&&(ue.value=o)},{immediate:!0}),ne({openCommentOverlayForSelector:So,updateCommentMarkers:wl,restoreCommentsFromModel:Vl}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",yt.value]),style:e.normalizeStyle(Mt.value)},[H.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Fu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:vt,title:e.unref(A)("textEditor.toolbar.undo")},[...n[45]||(n[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Iu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Al.value}]),onClick:oe,title:e.unref(A)("textEditor.toolbar.redo")},[...n[46]||(n[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,zu),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Pu,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=s=>Il("paragraph")),title:e.unref(A)("textEditor.toolbar.paragraphFormat")},[V.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:I.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,qu)):V.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:I.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Wu)):V.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:I.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Zu)):V.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:I.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Uu)):V.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:I.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Xu)):V.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:I.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Yu)):(e.openBlock(),e.createElementBlock("svg",ju,[...n[47]||(n[47]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[48]||(n[48]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Ou),we.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[8]||(n[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[1]||(n[1]=s=>zl("<h1>"))},[e.createElementVNode("img",{src:I.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Ku),e.createElementVNode("h1",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=s=>zl("<h2>"))},[e.createElementVNode("img",{src:I.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Gu),e.createElementVNode("h2",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=s=>zl("<h3>"))},[e.createElementVNode("img",{src:I.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Qu),e.createElementVNode("h3",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=s=>zl("<h4>"))},[e.createElementVNode("img",{src:I.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Ju),e.createElementVNode("h4",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=s=>zl("<h5>"))},[e.createElementVNode("img",{src:I.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,ed),e.createElementVNode("h5",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=s=>zl("<h6>"))},[e.createElementVNode("img",{src:I.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,td),e.createElementVNode("h6",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=s=>zl("<p>"))},[n[49]||(n[49]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":el("bold")}]),onClick:n[9]||(n[9]=s=>Bl("bold")),title:e.unref(A)("textEditor.toolbar.bold")},[...n[50]||(n[50]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,ld),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":el("italic")}]),onClick:n[10]||(n[10]=s=>Bl("italic")),title:e.unref(A)("textEditor.toolbar.italic")},[...n[51]||(n[51]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,nd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":el("underline")}]),onClick:n[11]||(n[11]=s=>Bl("underline")),title:e.unref(A)("textEditor.toolbar.underline")},[...n[52]||(n[52]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,od),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ye.value}]),onClick:Ln,title:e.unref(A)("textEditor.toolbar.citation")},[...n[53]||(n[53]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,ad),n[62]||(n[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:Yn,title:e.unref(A)("textEditor.toolbar.removeLink")},[...n[55]||(n[55]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,rd)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Xn,title:e.unref(A)("textEditor.toolbar.insertLink")},[...n[54]||(n[54]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,sd)),n[63]||(n[63]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":el("insertUnorderedList")}]),onClick:cn,title:e.unref(A)("textEditor.toolbar.bulletList")},[...n[56]||(n[56]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,id),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":el("insertOrderedList")}]),onClick:zn,title:e.unref(A)("textEditor.toolbar.numberList")},[...n[57]||(n[57]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,cd),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:po,title:e.unref(A)("textEditor.toolbar.image")},[...n[58]||(n[58]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,ud),Y.value?(e.openBlock(),e.createElementBlock("div",dd)):e.createCommentVNode("",!0),Y.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(A)("textEditor.toolbar.comment"),onClick:Hl},[...n[59]||(n[59]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,md)):e.createCommentVNode("",!0),H.askAi?(e.openBlock(),e.createElementBlock("div",pd)):e.createCommentVNode("",!0),H.askAi?(e.openBlock(),e.createElementBlock("div",fd,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=s=>Il("askAi")),title:e.unref(A)("textEditor.toolbar.askAi")},[n[60]||(n[60]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",gd,e.toDisplayString(e.unref(A)("textEditor.toolbar.askAi")),1)],8,vd),we.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",hd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.customToolbarSlots,(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[El(s)?(e.openBlock(),e.createElementBlock("div",yd,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),El(s)&&r<H.customToolbarSlots.length-1&&xn(r)?(e.openBlock(),e.createElementBlock("div",kd)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(we.value==="paragraph"||we.value==="askAi")&&H.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:il})):e.createCommentVNode("",!0),e.createVNode(ea,{showModal:De.value,width:"500px",height:"55vh",onCloseModal:Un},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(A)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Cd,[e.createElementVNode("div",bd,[e.createElementVNode("label",wd,e.toDisplayString(e.unref(A)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Ze,type:"text","onUpdate:modelValue":n[15]||(n[15]=s=>pt.value=s),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.link.enterAltText"),onKeyup:e.withKeys(mo,["enter"])},null,40,xd),[[e.vModelText,pt.value]])]),e.createElementVNode("div",Ed,[e.createElementVNode("label",Sd,e.toDisplayString(e.unref(A)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:W,type:"text","onUpdate:modelValue":n[16]||(n[16]=s=>tt.value=s),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.link.enterUrl"),onKeyup:e.withKeys(mo,["enter"])},null,40,Vd),[[e.vModelText,tt.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Un},e.toDisplayString(e.unref(A)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:mo},e.toDisplayString(e.unref(A)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(ea,{showModal:Ct.value,width:"500px",height:"80vh",onCloseModal:Dn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(bt.value?e.unref(A)("textEditor.image.editImage"):e.unref(A)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Nd,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Be.value==="upload"}]),onClick:n[17]||(n[17]=s=>Be.value="upload")},e.toDisplayString(e.unref(A)("textEditor.image.upload")),3),n[65]||(n[65]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Be.value==="url"}]),onClick:n[18]||(n[18]=s=>Be.value="url")},e.toDisplayString(e.unref(A)("textEditor.image.imageLink")),3)]),Be.value==="upload"?(e.openBlock(),e.createElementBlock("div",Bd,[e.createElementVNode("div",Md,[e.createElementVNode("div",_d,[vn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",$d,e.toDisplayString(e.unref(A)("textEditor.image.uploadImage")),1)),vn.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:ln},[e.createElementVNode("img",{src:Pt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Ld),n[66]||(n[66]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:_e,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:tn},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:_e,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:tn},null,544))]),e.createElementVNode("div",Ad,[e.createElementVNode("label",Td,e.toDisplayString(e.unref(A)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:He,type:"text","onUpdate:modelValue":n[19]||(n[19]=s=>Et.value=s),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Rl,["enter"])},null,40,Dd),[[e.vModelText,Et.value]])]),e.createElementVNode("div",Hd,[e.createElementVNode("label",Rd,e.toDisplayString(e.unref(A)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=s=>se.value=s),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(Rl,["enter"]),onInput:Qn},null,40,Fd),[[e.vModelText,se.value]])]),e.createElementVNode("div",Id,[e.createElementVNode("label",zd,e.toDisplayString(e.unref(A)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=s=>ge.value=s),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(Rl,["enter"]),onInput:fo},null,40,Pd),[[e.vModelText,ge.value]])])])])):e.createCommentVNode("",!0),Be.value==="url"?(e.openBlock(),e.createElementBlock("div",Od,[e.createElementVNode("div",qd,[e.createElementVNode("div",Wd,[e.createElementVNode("label",Zd,e.toDisplayString(e.unref(A)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Xt,type:"text","onUpdate:modelValue":n[22]||(n[22]=s=>Ue.value=s),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(Rl,["enter"])},null,40,Ud),[[e.vModelText,Ue.value]])]),e.createElementVNode("div",Xd,[e.createElementVNode("label",Yd,e.toDisplayString(e.unref(A)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=s=>Et.value=s),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Rl,["enter"])},null,40,jd),[[e.vModelText,Et.value]])]),e.createElementVNode("div",Kd,[e.createElementVNode("label",Gd,e.toDisplayString(e.unref(A)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=s=>se.value=s),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(Rl,["enter"]),onInput:Qn},null,40,Qd),[[e.vModelText,se.value]])]),e.createElementVNode("div",Jd,[e.createElementVNode("label",e1,e.toDisplayString(e.unref(A)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=s=>ge.value=s),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(Rl,["enter"]),onInput:fo},null,40,t1),[[e.vModelText,ge.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Dn},e.toDisplayString(e.unref(A)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Rl},e.toDisplayString(e.unref(A)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":yl.value&&ll.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.labels.title")),1),e.createElementVNode("div",l1,[ll.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",n1,[H.title?(e.openBlock(),e.createElementBlock("span",o1,e.toDisplayString(H.title),1)):(e.openBlock(),e.createElementBlock("span",a1,e.toDisplayString(gn.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:fe,value:H.title,onInput:Dl,onFocus:ot,onBlur:Dt,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!ll.value}]),placeholder:gn.value,disabled:H.disabled,rows:"1"},null,42,s1)])],2),yl.value&&ll.value?(e.openBlock(),e.createElementBlock("div",r1,[e.renderSlot(o.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":Ql.value&&S.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.labels.description")),1),e.createElementVNode("div",i1,[S.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",c1,[H.description?(e.openBlock(),e.createElementBlock("span",u1,e.toDisplayString(H.description),1)):(e.openBlock(),e.createElementBlock("span",d1,e.toDisplayString(an.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Ge,value:H.description,onInput:kl,onFocus:Ol,onBlur:$n,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!S.value}]),placeholder:an.value,disabled:H.disabled,rows:"1"},null,42,m1)])],2),Ql.value&&S.value?(e.openBlock(),e.createElementBlock("div",p1,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(le.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":At.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:r=>Lo(s),onMouseleave:Hn},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>go(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,g1)):(e.openBlock(),e.createElementBlock("span",h1,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,v1)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>go(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,k1)):(e.openBlock(),e.createElementBlock("span",C1,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,y1)):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(r=>go(s),["stop"])},[e.createElementVNode("span",w1,"+"+e.toDisplayString(s.additionalCount),1)],12,b1)):e.createCommentVNode("",!0)],46,f1))),128)),H.richText?(e.openBlock(),e.createElementBlock("div",M1,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":H.disabled,"dss-text-editor-fixed-height":H.fixedHeight}]),style:e.normalizeStyle(hl.value),onInput:de,onBlur:st,onClick:Sn,onMouseup:Ft,onKeyup:Ft,onKeydown:uo,onPaste:Zo,onMousemove:Uo,onMouseleave:Bn},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[At.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(un.value)},[x.value||ie.value.length>0?(e.openBlock(),e.createElementBlock("div",_1,[e.createElementVNode("div",$1,[x.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:x.value},null,8,L1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",A1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ie.value,(s,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:"dss-comment-message"},[s.user&&(s.user.avatar||s.user.initials||s.user.name)?(e.openBlock(),e.createElementBlock("div",T1,[e.createElementVNode("div",D1,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,H1)):(e.openBlock(),e.createElementBlock("span",R1,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",F1,[e.createElementVNode("div",I1,[e.createElementVNode("div",z1,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",P1,e.toDisplayString(ce(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":$e(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),$.commentUser&&s.user&&s.user.id===$.commentUser.id&&!$e(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>En(s,r),["stop"]),title:e.unref(A)("textEditor.comment.delete")||"Delete comment"},[...n[68]||(n[68]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,O1)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",q1,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:h,"onUpdate:modelValue":n[26]||(n[26]=s=>y.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(A)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(ql,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(h.value){const s=h.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,W1),[[e.vModelText,y.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(ql,["stop"])},[...n[69]||(n[69]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",Z1,[e.createElementVNode("div",U1,[e.createElementVNode("span",X1,e.toDisplayString(Wt.value)+" "+e.toDisplayString(Wt.value===1?e.unref(A)("textEditor.footer.word"):e.unref(A)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Y1,e.toDisplayString(dl.value)+" "+e.toDisplayString(dl.value===1?e.unref(A)("textEditor.footer.character"):e.unref(A)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",x1,[e.createElementVNode("textarea",{value:H.modelValue,onInput:dt,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":H.fixedHeight}]),placeholder:Tl.value,rows:H.rows,disabled:H.disabled,style:e.normalizeStyle(_t.value)},null,46,E1),e.createElementVNode("div",S1,[e.createElementVNode("div",V1,[e.createElementVNode("span",N1,e.toDisplayString(Wt.value)+" "+e.toDisplayString(Wt.value===1?e.unref(A)("textEditor.footer.word"):e.unref(A)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",B1,e.toDisplayString(dl.value)+" "+e.toDisplayString(dl.value===1?e.unref(A)("textEditor.footer.character"):e.unref(A)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[U.value&&pe.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(F.value),onMouseenter:n[28]||(n[28]=s=>Ee.value=!0),onMouseleave:Tn},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Zn,["stop"]),title:pe.value},e.toDisplayString(pe.value),9,j1),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Xo,["stop"]),title:e.unref(A)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",G1,[...n[71]||(n[71]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,K1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Lt.value&&qt.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(K.value),onMouseenter:n[29]||(n[29]=s=>ye.value=!0),onMouseleave:Wn},[e.createElementVNode("div",Q1,[qt.value===e.unref(A)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",J1,[...n[72]||(n[72]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:qt.value},e.toDisplayString(qt.value),9,em)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(_o,["stop"]),title:e.unref(A)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",lm,[...n[73]||(n[73]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,tm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[H.floatingToolbar&&H.richText&&lt.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Je,class:"dss-floating-toolbar",style:e.normalizeStyle(be.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",nm,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(vt,["stop"]),title:e.unref(A)("textEditor.toolbar.undo")},[...n[74]||(n[74]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,om),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Al.value}]),onClick:e.withModifiers(oe,["stop"]),title:e.unref(A)("textEditor.toolbar.redo")},[...n[75]||(n[75]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,am),n[89]||(n[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",sm,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(s=>An("paragraph"),["stop"])),title:e.unref(A)("textEditor.toolbar.paragraphFormat")},[V.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:I.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,im)):V.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:I.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,cm)):V.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:I.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,um)):V.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:I.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,dm)):V.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:I.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,mm)):V.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:I.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,pm)):(e.openBlock(),e.createElementBlock("svg",fm,[...n[76]||(n[76]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[77]||(n[77]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,rm),ut.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[38]||(n[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[31]||(n[31]=s=>Pl("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=s=>Pl("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=s=>Pl("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=s=>Pl("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=s=>Pl("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=s=>Pl("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=s=>Pl("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),n[90]||(n[90]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":el("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(s=>Bl("bold"),["stop"])),title:e.unref(A)("textEditor.toolbar.bold")},[...n[78]||(n[78]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,vm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":el("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(s=>Bl("italic"),["stop"])),title:e.unref(A)("textEditor.toolbar.italic")},[...n[79]||(n[79]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,gm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":el("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(s=>Bl("underline"),["stop"])),title:e.unref(A)("textEditor.toolbar.underline")},[...n[80]||(n[80]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,hm),n[91]||(n[91]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ye.value}]),onClick:e.withModifiers(Ln,["stop"]),title:e.unref(A)("textEditor.toolbar.citation")},[...n[81]||(n[81]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,ym),n[92]||(n[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(Yn,["stop"]),title:e.unref(A)("textEditor.toolbar.removeLink")},[...n[83]||(n[83]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,Cm)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Xn,["stop"]),title:e.unref(A)("textEditor.toolbar.insertLink")},[...n[82]||(n[82]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,km)),n[93]||(n[93]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":el("insertUnorderedList")}]),onClick:e.withModifiers(cn,["stop"]),title:e.unref(A)("textEditor.toolbar.bulletList")},[...n[84]||(n[84]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,bm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":el("insertOrderedList")}]),onClick:e.withModifiers(zn,["stop"]),title:e.unref(A)("textEditor.toolbar.numberList")},[...n[85]||(n[85]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,wm),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(po,["stop"]),title:e.unref(A)("textEditor.toolbar.image")},[...n[86]||(n[86]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,xm),n[95]||(n[95]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(A)("textEditor.toolbar.comment"),onClick:e.withModifiers(Hl,["stop"])},[...n[87]||(n[87]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,Em),H.askAi?(e.openBlock(),e.createElementBlock("div",Sm)):e.createCommentVNode("",!0),H.askAi?(e.openBlock(),e.createElementBlock("div",Vm,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(s=>An("askAi"),["stop"])),title:e.unref(A)("textEditor.toolbar.askAi")},[n[88]||(n[88]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",Bm,e.toDisplayString(e.unref(A)("textEditor.toolbar.askAi")),1)],8,Nm),ut.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[43]||(n[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Gl.value?(e.openBlock(),e.createElementBlock("div",Mm,[H.askAi&&Gl.value?(e.openBlock(),e.createElementBlock("div",_m)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.customToolbarSlots,(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[El(s)&&Fl(s)?(e.openBlock(),e.createElementBlock("div",$m,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),El(s)&&Fl(s)&&r<H.customToolbarSlots.length-1&&sn(r)?(e.openBlock(),e.createElementBlock("div",Lm)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Dm={class:"dss-color-picker__section-title"},Hm={class:"dss-color-picker__presets-row"},Rm=["title","onClick"],Fm={key:1,class:"dss-color-picker__section"},Im={class:"dss-color-picker__presets-row"},zm=["title","onClick"],Pm={key:2,class:"dss-color-picker__section"},Om={class:"dss-color-picker__section-header"},qm={class:"dss-color-picker__presets-row"},Wm=["title","onClick"],Zm=["onClick"],Um={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},Xm=["title","onClick"],Ym={class:"dss-color-picker__input-row"},jm=["value"],Km={__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(H,{emit:ne}){function M(J){const Z=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(J);if(!Z)return{h:0,s:0,l:50};const X=parseInt(Z[1],16)/255,re=parseInt(Z[2],16)/255,fe=parseInt(Z[3],16)/255,Ge=Math.max(X,re,fe),Nt=Math.min(X,re,fe);let rl=0,St=0;const ll=(Ge+Nt)/2;if(Ge!==Nt){const S=Ge-Nt;switch(St=ll>.5?S/(2-Ge-Nt):S/(Ge+Nt),Ge){case X:rl=((re-fe)/S+(re<fe?6:0))/6;break;case re:rl=((fe-X)/S+2)/6;break;case fe:rl=((X-re)/S+4)/6;break}}return{h:rl*360,s:St*100,l:ll*100}}function A(J,Z,X){Z/=100,X/=100;const re=Z*Math.min(X,1-X),fe=Ge=>{const Nt=(Ge+J/30)%12,rl=X-re*Math.max(Math.min(Nt-3,9-Nt,1),-1);return Math.round(255*rl).toString(16).padStart(2,"0")};return`#${fe(0)}${fe(8)}${fe(4)}`}function ue(J){const Z=J.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!Z)return null;let X=Z[1];return X.length===3&&(X=X.split("").map(re=>re+re).join("")),"#"+X}function I(J){const Z=J.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!Z)return null;const X=Math.max(0,Math.min(255,Number.parseInt(Z[1],10))),re=Math.max(0,Math.min(255,Number.parseInt(Z[2],10))),fe=Math.max(0,Math.min(255,Number.parseInt(Z[3],10)));return`#${X.toString(16).padStart(2,"0")}${re.toString(16).padStart(2,"0")}${fe.toString(16).padStart(2,"0")}`}function $(J){if(typeof J!="string")return null;const Z=J.trim();return ue(Z)||I(Z)}function ve(J,Z,X){Z/=100,X/=100;const re=X+Z*Math.min(X,1-X),fe=re===0?0:2-2*X/re;return{h:J,s:fe*100,v:re*100}}function ct(J,Z,X){Z/=100,X/=100;const re=X*(1-Z/2),fe=re===0||re===1?0:(X-re)/Math.min(re,1-re);return{h:J,s:fe*100,l:re*100}}const Q=H,f=ne,we=e.ref(!1),Ce=e.ref(!1),G=e.ref(!1),U=e.ref(-1),pe=e.ref(-1),F=e.ref(null),Ee=e.ref(null),De=e.ref(null),tt=e.ref(null),pt=e.ref({top:0,left:0}),W=e.ref(M(Q.modelValue||"#b8a5de")),Ze=e.computed(()=>Array.isArray(Q.presetGroups)&&Q.presetGroups.length>0),qe=e.computed(()=>!Q.disableCustomColors),xe=e.computed(()=>Ze.value?0:Q.initialPresetCount!=null?Q.initialPresetCount:pe.value<0?null:pe.value),Me=e.computed(()=>{const J=xe.value;return J==null?!0:Math.max(0,Q.presetColors.length-J)<Q.max}),Ye=e.computed(()=>!!(Ce.value||U.value>=0||!ee.value&&Q.presetColors.length===0));e.computed(()=>{const J=xe.value;return J!=null&&Q.presetColors.length>J});const ee=e.computed(()=>Ze.value||xe.value!=null),lt=e.computed(()=>{const J=xe.value;return J==null?[]:Q.presetColors.slice(0,J)}),be=e.computed(()=>{const J=xe.value;return J==null?[]:Q.presetColors.slice(J)});function Je(J){const Z=xe.value;return Z!=null?Z+J:-1}function ut(J){const Z=xe.value;return Z!=null&&J>=Z}function Ct(J){ut(J)&&(U.value=J,W.value=M(Q.presetColors[J]),Ce.value=!0,e.nextTick(()=>tt.value?.focus()))}function Et(J){if(!ut(J))return;const Z=Q.presetColors.filter((fe,Ge)=>Ge!==J);f("update:presetColors",Z);const X=ue(Q.modelValue),re=ue(Q.presetColors[J]);if(X&&re&&X.toLowerCase()===re.toLowerCase()){const fe=Z[Math.max(0,J-1)]||Z[0];fe&&f("update:modelValue",fe)}}function Ht(){G.value=!G.value,G.value||(U.value=-1,Ce.value=!1)}function Pt(){if(!qe.value||U.value<0)return;const J=_e.value,Z=ue(J);if(Z){const X=[...Q.presetColors];X[U.value]=Z,f("update:presetColors",X),f("update:modelValue",Z),U.value=-1,Ce.value=!1}}function se(){Q.disabled||!qe.value||(U.value=-1,Ce.value=!Ce.value,Ce.value&&(ye(),e.nextTick(()=>tt.value?.focus())))}function ge(J){const Z=$(J),X=$(Q.modelValue);return Z&&X&&Z.toLowerCase()===X.toLowerCase()}function He(){if(Q.disabled||!qe.value||!Me.value)return;const J=_e.value,Z=ue(J);if(Z){const X=[...Q.presetColors,Z];f("update:presetColors",X),f("update:modelValue",Z);const re=xe.value??pe.value;re>=0&&X.length-re>=Q.max&&(Ce.value=!1)}}const _e=e.computed(()=>{const{h:J,s:Z,l:X}=W.value;return A(J,Z,X)}),Xt=e.computed(()=>_e.value.toLowerCase()),bt=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${W.value.h}, 100%, 50%))`})),Gt=e.computed(()=>{const J=ve(W.value.h,W.value.s,W.value.l);return{left:`${J.s}%`,bottom:`${J.v}%`,transform:"translate(-50%, 50%)"}}),Lt=e.computed(()=>({left:`${W.value.h/360*100}%`,transform:"translateX(-50%)"})),qt=e.computed(()=>({position:"fixed",left:`${pt.value.left}px`,top:`${pt.value.top}px`,zIndex:1002}));function K(){if(!F.value||!we.value)return;const J=F.value.getBoundingClientRect(),Z=window.innerHeight||document.documentElement.clientHeight;let X=J.bottom+4;const re=Ee.value;re&&X+re.offsetHeight>Z-8&&(X=J.top-4-re.offsetHeight),pt.value={top:X,left:J.left}}function ye(){const J=Q.modelValue||"#b8a5de",Z=$(J);Z&&(W.value=M(Z))}function Be(){f("update:modelValue",_e.value)}function Ue(){Q.disabled||(we.value=!we.value,we.value&&(ye(),e.nextTick(()=>{K(),tt.value?.focus()})))}function Ke(){const J=_e.value,Z=ue(J);if(Z){if(U.value>=0){const X=[...Q.presetColors];X[U.value]=Z,f("update:presetColors",X),f("update:modelValue",Z)}else if(qe.value&&(Q.presetColors.length>0||Ze.value)&&Ce.value&&Me.value&&!Q.presetColors.some(re=>ue(re)?.toLowerCase()===Z.toLowerCase())){const re=[...Q.presetColors,Z];f("update:presetColors",re),f("update:modelValue",Z)}}we.value=!1,Ce.value=!1,G.value=!1,U.value=-1}function Tt(J){if(!De.value)return;const Z=De.value.getBoundingClientRect(),X=re=>{const fe=Math.max(0,Math.min(1,(re.clientX-Z.left)/Z.width)),Ge=Math.max(0,Math.min(1,1-(re.clientY-Z.top)/Z.height)),Nt={h:W.value.h,s:fe*100,v:Ge*100};W.value=ct(Nt.h,Nt.s,Nt.v)};X(J),document.addEventListener("mousemove",X),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",X),Be()},{once:!0})}function et(J){if(!J.currentTarget)return;const X=J.currentTarget.getBoundingClientRect(),re=fe=>{const Ge=Math.max(0,Math.min(1,(fe.clientX-X.left)/X.width));W.value={...W.value,h:Ge*360}};re(J),document.addEventListener("mousemove",re),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",re),Be()},{once:!0})}function Ot(J){const Z=J.target.value,X=$(Z);X&&(W.value=M(X),f("update:modelValue",X))}function We(J){if(Q.disabled)return;const Z=$(J);Z&&(W.value=M(Z),f("update:modelValue",Z))}let Fe=null,xt=null;function ft(){Fe&&(document.removeEventListener("keydown",Fe),Fe=null),xt&&(window.removeEventListener("resize",xt),xt=null)}return e.watch(we,J=>{if(ft(),J){if(!Ze.value&&Q.initialPresetCount==null){const Z=Q.presetColors.length;Z>0&&(pe.value<0||Z<pe.value)&&(pe.value=Z)}Fe=Z=>{Z.key==="Escape"&&Ke()},xt=K,document.addEventListener("keydown",Fe),window.addEventListener("resize",xt)}}),e.watch(()=>Q.modelValue,()=>{we.value&&ye()},{immediate:!1}),e.watch(be,J=>{J.length===0&&(G.value=!1,U.value=-1,Ce.value=!1)}),e.onBeforeUnmount(ft),(J,Z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":H.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:F,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":we.value}]),onClick:Ue},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:_e.value})},[...Z[0]||(Z[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[we.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Ke,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Ee,class:"dss-color-picker__dropdown",style:e.normalizeStyle(qt.value)},[ee.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Ze.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(H.presetGroups,(X,re)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+re,class:"dss-color-picker__section"},[e.createElementVNode("span",Dm,e.toDisplayString(X.title),1),e.createElementVNode("div",Hm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.colors,(fe,Ge)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+re+"-"+Ge,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":ge(fe)}]),style:e.normalizeStyle({backgroundColor:fe,"--dss-preset-color":fe}),title:fe,onClick:e.withModifiers(Nt=>We(fe),["stop"])},null,14,Rm))),128))])]))),128)):lt.value.length?(e.openBlock(),e.createElementBlock("div",Fm,[Z[1]||(Z[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",Im,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value,(X,re)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+re,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":ge(X)}]),style:e.normalizeStyle({backgroundColor:X,"--dss-preset-color":X}),title:X,onClick:e.withModifiers(fe=>We(X),["stop"])},null,14,zm))),128))])])):e.createCommentVNode("",!0),qe.value?(e.openBlock(),e.createElementBlock("div",Pm,[e.createElementVNode("div",Om,[Z[3]||(Z[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),be.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":G.value}]),title:"Manage custom colors",onClick:e.withModifiers(Ht,["stop"])},[...Z[2]||(Z[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",qm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.value,(X,re)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+re,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":G.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!G.value&&ge(X),"dss-color-picker__preset-bubble--editing":G.value&&U.value===Je(re)}]),style:e.normalizeStyle({backgroundColor:U.value===Je(re)?_e.value:X,"--dss-preset-color":U.value===Je(re)?_e.value:X}),title:U.value===Je(re)?_e.value:X,onClick:e.withModifiers(fe=>G.value?Ct(Je(re)):We(X),["stop"])},null,14,Wm),G.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(fe=>Et(Je(re)),["stop"])},[...Z[4]||(Z[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,Zm)):e.createCommentVNode("",!0)],2))),128)),Me.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(se,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):H.presetColors.length?(e.openBlock(),e.createElementBlock("div",Um,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.presetColors,(X,re)=>(e.openBlock(),e.createElementBlock("button",{key:re,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":ge(X)}]),style:e.normalizeStyle({backgroundColor:X,"--dss-preset-color":X}),title:X,onClick:e.withModifiers(fe=>We(X),["stop"])},null,14,Xm))),128)),qe.value&&Me.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(se,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ye.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:De,onMousedown:Tt},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(bt.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Gt.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:et},[Z[5]||(Z[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(Lt.value)},null,4)],32),e.createElementVNode("div",Ym,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:tt,type:"text",class:"dss-color-picker__hex-input",value:Xt.value,onInput:Ot},null,40,jm)]),qe.value&&ee.value&&(H.presetColors.length||Ze.value)&&Me.value&&U.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:He}," Save color ")):e.createCommentVNode("",!0),qe.value&&ee.value&&U.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Pt}," Save color ")):e.createCommentVNode("",!0),ee.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Ke}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},Gm={key:0,class:"dss-loader"},Qm={key:0,class:"dss-loader-label"},Jm={key:1,class:"dss-loader"},e2={key:0,class:"dss-loader-label"},t2={key:2,class:"dss-loader"},l2={key:0,class:"dss-loader-label"},n2={key:3,class:"dss-loader"},o2={key:0,class:"dss-loader-label"},a2={key:4,class:"dss-loader"},s2={key:0,class:"dss-loader-label"},r2={key:5,class:"dss-loader dss-loader--inline"},i2={class:"dss-loader-inline-text"},c2={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(H){const ne=H,M=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),A=e.computed(()=>{const ue={};if(!(ne.size==="small"||ne.size==="medium"||ne.size==="large"||ne.size==null)){const I=typeof ne.size=="number"?`${ne.size}px`:String(ne.size);ue["--dss-loader-size"]=I}return ne.color&&(ue["--dss-loader-accent"]=ne.color,ue["--dss-loader-accent-soft"]=`color-mix(in srgb, ${ne.color} 30%, white)`),ue});return(ue,I)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",M.value]),style:e.normalizeStyle(A.value)},[H.type==="spinner"?(e.openBlock(),e.createElementBlock("div",Gm,[I[0]||(I[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),H.label?(e.openBlock(),e.createElementBlock("span",Qm,e.toDisplayString(H.label),1)):e.createCommentVNode("",!0)])):H.type==="dots"?(e.openBlock(),e.createElementBlock("div",Jm,[I[1]||(I[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)),H.label?(e.openBlock(),e.createElementBlock("span",e2,e.toDisplayString(H.label),1)):e.createCommentVNode("",!0)])):H.type==="battery"?(e.openBlock(),e.createElementBlock("div",t2,[I[2]||(I[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),H.label?(e.openBlock(),e.createElementBlock("span",l2,e.toDisplayString(H.label),1)):e.createCommentVNode("",!0)])):H.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",n2,[I[3]||(I[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)),H.label?(e.openBlock(),e.createElementBlock("span",o2,e.toDisplayString(H.label),1)):e.createCommentVNode("",!0)])):H.type==="bars"?(e.openBlock(),e.createElementBlock("div",a2,[I[4]||(I[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)),H.label?(e.openBlock(),e.createElementBlock("span",s2,e.toDisplayString(H.label),1)):e.createCommentVNode("",!0)])):H.type==="inline"?(e.openBlock(),e.createElementBlock("div",r2,[I[5]||(I[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",i2,[e.renderSlot(ue.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(H.label),1)])])])):e.createCommentVNode("",!0)],6))}},ca="dss-skeleton-item",u2={__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:H=>["single","multiple"].includes(H)},targetClass:{type:String,default:ca},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(H){const ne=H,M=e.computed(()=>{const I={"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!==ca&&(I[`dss-skeleton--target-${ne.targetClass}`]=!0),I}),A=e.computed(()=>{const I={};return ne.borderRadius&&(I.borderRadius=ne.borderRadius),I}),ue=e.computed(()=>{const I={};return ne.borderRadius&&(I["--dss-skeleton-border-radius"]=ne.borderRadius),ne.darkMode?(I["--dss-skeleton-bg"]=ne.bgDark||"#322c3f",I["--dss-skeleton-shimmer"]=ne.shimmerDark||"#3e3f41",I):(ne.bgColor&&(I["--dss-skeleton-bg"]=ne.bgColor),ne.shimmerColor&&(I["--dss-skeleton-shimmer"]=ne.shimmerColor),I)});return(I,$)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",M.value]),style:e.normalizeStyle(ue.value)},[H.loading&&H.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(A.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":H.loading&&H.mode==="single"}])},[e.renderSlot(I.$slots,"default")],2)],6))}},d2={key:0,class:"dss-dnd-column-header"},m2={class:"dss-dnd-column-title"},p2={class:"dss-dnd-column-count"},f2=["data-column"],v2={key:0,class:"dss-dnd-indicator"},g2=["onPointerdown"],h2=["onPointerdown"],y2={class:"dss-dnd-item-content"},k2={class:"dss-dnd-item-default"},C2={key:0,class:"dss-dnd-empty"},b2={name:"DSSDnd"},w2=Object.assign(b2,{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(H,{emit:ne}){const M=H,A=ne,ue=e.useSlots(),I=e.computed(()=>!!ue["delete-zone"]),$={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1,ColColor:!1},ve=e.computed(()=>({...$,...M.options})),ct=e.computed(()=>({"--dss-dnd-col-min-w":ve.value.columnMinWidth,"--dss-dnd-col-max-w":ve.value.columnMaxWidth,"--dss-dnd-col-gap":ve.value.columnGap,"--dss-dnd-indicator-color":ve.value.indicatorColor,"--dss-dnd-body-max-h":ve.value.columnBodyMaxHeight}));function Q(K){if(!ve.value.ColColor||!K)return{};const ye=K.background||K.color;return ye?{background:ye}:{}}const f=e.ref(null),we=e.ref(null),Ce=e.ref(!1),G=e.ref(-1),U=e.ref(null);let pe=null,F=null,Ee=null,De=null,tt=0,pt=0,W="",Ze=null;const qe=5,xe=e.computed(()=>{const K={};for(const ye of M.columns)K[ye.value]=M.items.filter(Be=>Be[M.columnKey]===ye.value).sort((Be,Ue)=>(Be[M.positionKey]??0)-(Ue[M.positionKey]??0));return K}),Me=e.computed(()=>{const K={},ye=!!f.value,Be=f.value?.[M.itemKey],Ue=we.value,Ke=G.value;for(const Tt of M.columns){const et=xe.value[Tt.value]||[],Ot=[],We=Ue==Tt.value;let Fe=0;for(let xt=0;xt<et.length;xt++){const ft=et[xt],J=ye&&ft[M.itemKey]===Be;!J&&We&&Ke===Fe&&Ot.push({type:"indicator",key:`ind-${Fe}`}),J||Fe++,Ot.push({type:"item",item:ft,isDragged:J,key:`item-${ft[M.itemKey]}`})}We&&Ke>=Fe&&Ot.push({type:"indicator",key:"ind-end"}),K[Tt.value]=Ot}return K});function Ye(K,ye){const Ue=(xe.value[K]||[]).filter(et=>et[M.itemKey]!==f.value?.[M.itemKey]);if(Ue.length===0)return 1;if(ye<=0){const et=Ue[0][M.positionKey];return et!=null&&et>0?et/2:.5}if(ye>=Ue.length){const et=Ue[Ue.length-1][M.positionKey];return(et??0)+1}const Ke=Ue[ye-1][M.positionKey]??0,Tt=Ue[ye][M.positionKey]??0;return(Ke+Tt)/2}function ee(K,ye,Be){Ee&&Ee.remove();const Ue=K.getBoundingClientRect(),Ke=K.cloneNode(!0);Ke.classList.add("dss-dnd-ghost"),Ke.style.cssText=`
103
+ `){const k=document.createTextNode(" ");n.insertNode(k),n.setStartAfter(k)}}n.insertNode(d);const u=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(u),n.setStartAfter(u),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}}Mt()}e.nextTick(()=>{Vl(),Qn()})},eo=()=>{if(!f.value||G.value)return;const o=window.getSelection();let n=null;o&&o.rangeCount>0&&(n=Jt());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,r=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const v=m.parentElement;return!v||v.closest("a")||v.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=r.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const v=c[m],k=v.textContent;s.lastIndex=0;const T=[...k.matchAll(s)];if(T.length===0)continue;const R=T.filter(j=>{const Ie=j[0],we=j.index;if(we>0&&k[we-1]==="@"||we+Ie.length<k.length&&k[we+Ie.length]==="@")return!1;const yt=v.parentElement;return!(yt&&yt.closest("a"))});if(R.length===0)continue;if(R.length===1&&R[0][0]===k.trim()){const j=R[0][0],Ie=j.startsWith("http://")||j.startsWith("https://")?j:`https://${j}`,we=document.createElement("a");we.href=Ie,we.textContent=j,we.style.color="#60afdf",we.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(we,v),u=!0);continue}let E=0;const ne=document.createDocumentFragment();if(R.forEach(j=>{const Ie=j.index,we=j[0];if(Ie>E){const vl=k.substring(E,Ie);vl&&ne.appendChild(document.createTextNode(vl))}const yt=we.startsWith("http://")||we.startsWith("https://")?we:`https://${we}`,Cl=document.createElement("a");Cl.href=yt,Cl.textContent=we,Cl.style.color="#60afdf",Cl.style.textDecoration="underline",ne.appendChild(Cl),E=Ie+we.length}),E<k.length){const j=k.substring(E);j&&ne.appendChild(document.createTextNode(j))}v.parentNode&&ne.childNodes.length>0&&(v.parentNode.replaceChild(ne,v),u=!0)}u&&n&&e.nextTick(()=>{$l(n),Vl()})},jo=()=>{if(!f.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),s=[];let r;for(;r=n.nextNode();)s.push(r);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 v=0;const k=document.createDocumentFragment();m.forEach(T=>{const R=T.index,E=T[0].startsWith("<u>")?"u":"ins",ne=T[1]||T[2]||"";R>v&&k.appendChild(document.createTextNode(u.substring(v,R)));const j=document.createElement(E);j.textContent=ne,k.appendChild(j),v=R+T[0].length}),v<u.length&&k.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&k.childNodes.length>0&&d.parentNode.replaceChild(k,d)}},No=o=>{if(!f.value||G.value)return;if(!o){jo();return}if(!["*","_",">"].includes(o))return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const r=s.getRangeAt(0);if(!r.collapsed)return;const c=r.startContainer.nodeType===Node.TEXT_NODE?r.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):r.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===f.value||!f.value.contains(c))return;const d=()=>{let vl="",sl=0,ul=!1;const gl=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Ql=>Ql.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let rl=0;for(;gl.nextNode();){const Ql=gl.currentNode,Nn=Ql.textContent||"",gn=rl;if(rl+=Nn.length,Ql===r.startContainer){vl+=Nn.substring(0,r.startOffset),sl=gn+r.startOffset,ul=!0;break}vl+=Nn}return ul||(sl=vl.length),{textBeforeCursor:vl,cursorCharOffset:sl}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,v=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?v="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?v="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(v=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const k=m[0],T=m[1],R=u.length-k.length,ne=(vl=>{let sl=0;const ul=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:rl=>rl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let gl;for(;gl=ul.nextNode();){const rl=(gl.textContent||"").length;if(sl+rl>=vl)return{node:gl,offset:vl-sl};sl+=rl}return null})(R);if(!ne)return;const j=document.createRange();j.setStart(ne.node,ne.offset),j.setEnd(r.endContainer,r.endOffset);const Ie=document.createElement(v);Ie.textContent=T,j.deleteContents(),j.insertNode(Ie);const we=window.getSelection(),yt=document.createRange();yt.setStartAfter(Ie),yt.collapse(!0),we.removeAllRanges(),we.addRange(yt);const Cl=Jt();e.nextTick(()=>{Mt(),Cl&&$l(Cl)})},Yl=()=>{f.value&&(Gt.value=Jt(),wt.value="",Ft.value="",Ue.value="",se.value="",pe.value="",Dt.value=null,Ct.value=null,Be.value="upload",kt.value=!0,nl(),e.nextTick(()=>{De.value&&De.value.focus(),_e.value&&(_e.value.value="")}))},jl=o=>{const n=o.target?.files?.[0];if(!n){Dt.value=null,Ft.value="";return}Dt.value=n;const s=new FileReader;s.onload=r=>{Ft.value=r.target?.result||""},s.readAsDataURL(n)},go=()=>{_e.value&&_e.value.click()},ho=()=>{se.value&&(pe.value="")},yo=()=>{pe.value&&(se.value="")},Bo=()=>{let o=Ct.value;if(!o){const n=window.getSelection();if(n&&n.rangeCount>0){const r=n.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(o){const n=o.getAttribute("data-alt")||o.getAttribute("alt")||"";Ct.value=o,wt.value=n.trim()===""||n.trim()==="Image"?"":n;const s=o.getAttribute("src")||o.src||"";s.startsWith("http://")||s.startsWith("https://")?(Ue.value=s,Ft.value="",Be.value="url"):(Ft.value=s,Ue.value="",Be.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";se.value=c.endsWith("px")?c.replace("px",""):c,pe.value=d.endsWith("px")?d.replace("px",""):d,Gt.value=null}else{Yl();return}kt.value=!0,ye.value=!1,$t.value=!1,e.nextTick(()=>{Be.value==="url"&&jt.value?(jt.value.focus(),jt.value.select()):De.value&&(De.value.focus(),De.value.select()),_e.value&&(_e.value.value="")})},Kl=()=>{kt.value=!1,wt.value="",Ft.value="",Ue.value="",se.value="",pe.value="",Dt.value=null,Ct.value=null,Gt.value=null,Be.value="upload"},ol=()=>{const o=(wt.value||"").trim(),n=f.value?._mutationObserver;n&&n.disconnect(),Re.value?(We.value&&(clearTimeout(We.value),We.value=null),he(),Re.value=!1):he();const s=Be.value==="url"?Ue.value.trim():Ft.value;if(Ct.value&&f.value&&f.value.contains(Ct.value)){s&&(Ct.value.src=s),Ct.value.setAttribute("alt",o),Ct.value.setAttribute("data-alt",o),se.value?(Ct.value.style.width=`${se.value}px`,Ct.value.setAttribute("width",se.value)):(Ct.value.style.removeProperty("width"),Ct.value.removeAttribute("width")),pe.value?(Ct.value.style.height=`${pe.value}px`,Ct.value.setAttribute("height",pe.value)):(Ct.value.style.removeProperty("height"),Ct.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(Ct.value),c.collapse(!0),r.addRange(c)}Mt()}else{if(!s){n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),Kl();return}if(f.value){f.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(Gt.value&&($l(Gt.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&f.value){if(d=document.createRange(),f.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",f.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){Kl();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!f.value.contains(m)){if(d=document.createRange(),f.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",f.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const v=document.createElement("img");v.src=s,v.setAttribute("alt",o),v.setAttribute("data-alt",o),se.value&&(v.style.width=`${se.value}px`,v.setAttribute("width",se.value)),pe.value&&(v.style.height=`${pe.value}px`,v.setAttribute("height",pe.value));try{d.insertNode(v),d.setStartAfter(v),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(f.value){if(f.value.childNodes.length===0){const R=document.createElement("p");f.value.appendChild(R),R.appendChild(v)}else{const R=f.value.lastChild;if(R&&R.nodeType===1)R.appendChild(v);else{const E=document.createElement("p");f.value.appendChild(E),E.appendChild(v)}}const T=document.createRange();T.setStartAfter(v),T.collapse(!0),c&&(c.removeAllRanges(),c.addRange(T))}}Ct.value=v,Mt()}}e.nextTick(()=>{n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),Vl(),Yt(),Kl()})};e.watch(()=>B.modelValue,o=>{if(B.richText&&f.value&&!G.value){const n=$(o||""),r=f.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=n.replace(/&nbsp;|\u00A0/g," ");if(r!==c){const d=Jt();f.value.innerHTML=n,e.nextTick(()=>{Dl();const u=f.value.innerHTML||"",m=B.title||"",v=B.description||"";bt.value=u,J.value=m,Z.value=v,pt.value=u,X.value=m,re.value=v,lt.value=[],Pt.value=[],We.value&&(clearTimeout(We.value),We.value=null),Re.value=!1,d&&$l(d),Nl(),Ke(),an(),Vl(),Yt(),it(),Ol("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>B.richText,o=>{o?(Yt(),e.nextTick(()=>{$o()})):(Rn(),le.value=[],ze.value&&(ze.value.disconnect(),ze.value=null)),it()}),e.watch(()=>B.floatingToolbar,o=>{o?Yt():Rn()}),e.watch(()=>B.disabled,o=>{o&&Rn(),it()}),e.watch(()=>B.description,()=>{e.nextTick(()=>{S.value?_l():cl()})}),e.watch(()=>B.title,()=>{e.nextTick(()=>{tl.value?je():El()})}),e.watch(()=>B.customToolbarSlots,()=>{e.nextTick(()=>{Xl()})},{deep:!0}),e.watch(()=>B.comments,(o,n)=>{if(B.commentUser){if(Ot.value){Ot.value=!1;return}fl.value||B.richText&&f.value&&e.nextTick(()=>{to()})}},{deep:!0,immediate:!1});const to=()=>{if(B.commentUser&&!fl.value&&!(!B.comments||!Array.isArray(B.comments)||B.comments.length===0)&&!(!B.richText||!f.value)){fl.value=!0;try{const o=new Set,n=B.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),s=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=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;n.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const m=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!m)return;const v=String(m);if(d.has(v))return;const k=f.value.querySelector(`[data-comment="${v}"]`);if(k){rn(k,u),d.add(v);return}try{const T=al(u.selection_range,u.selection_text);if(T&&!T.collapsed){const R=T.commonAncestorContainer,E=R.nodeType===3?R.parentElement:R;if(E){const Ie=E.closest("[data-comment], [data-fake-comment]");if(Ie){const we=Ie.getAttribute("data-comment")||Ie.getAttribute("data-fake-comment");if(String(we)===String(m)){Ie.setAttribute("data-comment",v),Ie.removeAttribute("data-fake-comment"),rn(Ie,u),d.add(v);return}else return}}const ne=f.value.querySelector(`[data-comment="${v}"]`);if(ne){rn(ne,u),d.add(v);return}const j=document.createElement("span");j.setAttribute("data-comment",v),rn(j,u);try{T.surroundContents(j),c++,d.add(v)}catch{try{const we=document.createRange();we.setStart(T.startContainer,T.startOffset),we.setEnd(T.endContainer,T.endOffset),Ut(we),we.surroundContents(j),c++,d.add(v)}catch{try{const yt=T.extractContents();j.appendChild(yt),T.insertNode(j),c++,d.add(v)}catch(yt){console.warn("Failed to create comment marker:",yt)}}}}}catch{}}),e.nextTick(()=>{Ol("restoreCommentsFromModel"),Mt(),fl.value=!1})}catch{fl.value=!1}}},Ut=o=>{if(!o||!f.value)return o;try{const n=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let s=o.startContainer,r=o.startOffset;if(s.nodeType===3){const u=s.parentElement;u&&n.includes(u.tagName)&&(r===0&&!Mo(s)||o.setStartBefore(u))}else s.nodeType===1&&n.includes(s.tagName)&&r>0&&o.setStartBefore(s);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&n.includes(u.tagName)&&(d===c.length&&!Ko(c)||o.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},Mo=o=>{let n=o.previousSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.previousSibling}return!1},Ko=o=>{let n=o.nextSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.nextSibling}return!1},al=(o,n)=>{if(!o||!f.value)return null;try{const s=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(s.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(s.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}return u?Ut(s):null}}catch{return null}return null},rn=(o,n)=>{if(!o||!n)return;const s=n.conversation||[],r=new Set,c=[],d=m=>{m&&m.id&&!r.has(m.id)&&(r.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")},Ol=(o="unknown")=>{if(!B.commentUser||!B.richText||!f.value){le.value=[];return}Date.now()-Vt.value<Et&&ft.value!==null||ft.value===null&&(ft.value=requestAnimationFrame(()=>{if(ft.value=null,Vt.value=Date.now(),Oe.value)return;Oe.value=!0;const s={},r=f.value;if(!r){Oe.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){Oe.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(E=>{const ne=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");ne&&E.tagName==="SPAN"&&(m.has(ne)||(u.push(E),m.add(ne)))}),d.forEach(E=>{const ne=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");!ne||m.has(ne)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(E.tagName)?E.querySelector(`span[data-comment="${ne}"], span[data-fake-comment="${ne}"]`)||(u.push(E),m.add(ne)):E.tagName!=="SPAN"&&(u.push(E),m.add(ne)))});const v=c.getBoundingClientRect(),k=r.getBoundingClientRect();u.forEach((E,ne)=>{let j=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");if(!j)return;if(typeof j=="string"&&j.startsWith("comment-")){const cn=E.textContent?.trim(),hn=B.comments?.find(Jl=>(typeof Jl.conversation_id=="string"&&Jl.conversation_id.startsWith("comment-")?null:Jl.conversation_id)&&Jl.selection_text?.trim()===cn);hn?(j=String(hn.conversation_id),E.setAttribute("data-comment",j),E.removeAttribute("data-fake-comment")):(j=String(Date.now()),E.setAttribute("data-comment",j),E.removeAttribute("data-fake-comment"))}const Ie=E.getBoundingClientRect(),we=window.getComputedStyle(E),yt=parseFloat(we.lineHeight)||parseFloat(we.fontSize)*1.2,sl=Ie.top-k.top+yt/2-15,gl=k.top-v.top+sl;let rl=null,Ql=null,Nn=0;const gn=[],Lo=new Set;if(j&&B.comments){const cn=B.comments.find(hn=>String(hn.conversation_id||hn.id)===String(j));if(cn){const hn=cn.conversation||[];hn.length>0?(hn.forEach(Jl=>{Jl.user&&Jl.user.id&&!Lo.has(Jl.user.id)&&(Lo.add(Jl.user.id),gn.push(Jl.user))}),Nn=hn.length):(Nn=0,rl=null,Ql=null),gn.length>0?rl=gn[0]:rl=null,gn.length>1?Ql=gn[1]:Ql=null}}const Ao=Ie.top+yt/2-15,Pn=Ao+30,To=5,Do=Pn>k.top+To&&Ao<k.bottom-To?1:0;le.value.find(cn=>cn.id===j);let no=E;if(!no&&j&&f.value){const cn=String(j);no=f.value.querySelector(`[data-comment="${cn}"], [data-fake-comment="${cn}"]`)}const Ho=gn.length;s[j]?(s[j].top=gl,s[j].opacity=Do,s[j].element=no,s[j].firstUser=rl,s[j].secondUser=Ql,s[j].totalCount=Nn,s[j].uniqueUserCount=Ho):s[j]={id:j,top:gl,opacity:Do,element:no,firstUser:rl,secondUser:Ql,totalCount:Nn,uniqueUserCount:Ho}});const T=Object.values(s).map(E=>{const ne=Math.max(0,(E.uniqueUserCount??0)-2);if(!E.element&&E.id&&f.value){const Ie=String(E.id);E.element=f.value.querySelector(`[data-comment="${Ie}"], [data-fake-comment="${Ie}"]`)}return{...E,firstUser:E.firstUser||null,secondUser:E.secondUser||null,totalCount:E.totalCount,additionalCount:ne}});(le.value.length!==T.length||T.some((E,ne)=>{const j=le.value[ne];if(!j)return!0;const Ie=(j.firstUser?.id||null)!==(E.firstUser?.id||null),we=(j.secondUser?.id||null)!==(E.secondUser?.id||null);return j.id!==E.id||Math.abs(j.top-E.top)>1||j.opacity!==E.opacity||j.totalCount!==E.totalCount||j.additionalCount!==E.additionalCount||Ie||we||j.element!==E.element}))&&(le.value=T),Oe.value=!1}))},Gl=o=>{if(!o)return;let n=o.element;if(!n&&o.id&&f.value){const s=String(o.id);n=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}n&&(An(),Wl.value=n,n.classList.add("editor-comment-highlighted"))},An=(o=!1)=>{!o&&pl.value!==null&&Wl.value&&(Wl.value.getAttribute("data-comment")||Wl.value.getAttribute("data-fake-comment"))===pl.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),Wl.value&&(Wl.value.classList.remove("editor-comment-highlighted"),Wl.value=null))},Vn=o=>{if(!o||!o.element)return;An(!0);const n=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!n)return;const s=`[data-comment="${n}"], [data-fake-comment="${n}"]`;ve("comment-marker-clicked",{commentId:n,selector:s,element:o.element})},_o=()=>{An()},$o=()=>{!B.richText||!f.value||(ze.value&&ze.value.disconnect(),vt.value!==null&&(clearTimeout(vt.value),vt.value=null),ze.value=new MutationObserver(()=>{vt.value===null&&(vt.value=setTimeout(()=>{vt.value=null,e.nextTick(()=>{Ol("MutationObserver")})},200))}),ze.value.observe(f.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Ol("setupCommentMarkersObserver-initial"))},lo=(o,n)=>{if(!o||!n)return;const s=n.getBoundingClientRect();let r=s.top,c=s.right+4;o.style.top=`${r}px`,o.style.left=`${c}px`,o.offsetHeight;const d=o.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const v=s.left-d.width-4;o.style.left=`${v}px`}if(d.bottom>m){const v=Math.max(8,m-d.height-8);o.style.top=`${v}px`}d.top<0&&(o.style.top="8px")};return e.watch(()=>Je.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const r=s.getAttribute("data-submenu-id");if(r===o&&o){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(c){if(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(()=>{lo(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(()=>[xe.value,dt.value],()=>{xe.value==="askAi"||dt.value==="askAi"?e.nextTick(()=>{Ul()}):(Je.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(n=>{if(n.parentNode===document.body){const s=n.getAttribute("data-submenu-id");if(s){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(r)if(n.dataset.originalParentRef==="inside")r.appendChild(n);else{const d=r.closest(".dss-toolbar-dropdown");d&&d.insertBefore(n,r.nextSibling)}}}})}))}),e.watch(()=>B.locale,o=>{o&&o!==ce.value&&(ce.value=o)},{immediate:!0}),oe({openCommentOverlayForSelector:Uo,updateCommentMarkers:Ol,restoreCommentsFromModel:to}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container",[{"editor-with-comments":at.value},Nt.value]]),style:e.normalizeStyle(Bt.value)},[L.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Fu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:ae,title:e.unref(A)("textEditor.toolbar.undo")},[...n[45]||(n[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Iu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!un.value}]),onClick:el,title:e.unref(A)("textEditor.toolbar.redo")},[...n[46]||(n[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,zu),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Pu,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=s=>Hn("paragraph")),title:e.unref(A)("textEditor.toolbar.paragraphFormat")},[V.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:I.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,qu)):V.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:I.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Wu)):V.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:I.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Zu)):V.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:I.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Uu)):V.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:I.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Xu)):V.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:I.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Yu)):(e.openBlock(),e.createElementBlock("svg",ju,[...n[47]||(n[47]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[48]||(n[48]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Ou),xe.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[8]||(n[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[1]||(n[1]=s=>zl("<h1>"))},[e.createElementVNode("img",{src:I.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Ku),e.createElementVNode("h1",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=s=>zl("<h2>"))},[e.createElementVNode("img",{src:I.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Gu),e.createElementVNode("h2",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=s=>zl("<h3>"))},[e.createElementVNode("img",{src:I.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Qu),e.createElementVNode("h3",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=s=>zl("<h4>"))},[e.createElementVNode("img",{src:I.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Ju),e.createElementVNode("h4",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=s=>zl("<h5>"))},[e.createElementVNode("img",{src:I.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,ed),e.createElementVNode("h5",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=s=>zl("<h6>"))},[e.createElementVNode("img",{src:I.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,td),e.createElementVNode("h6",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=s=>zl("<p>"))},[n[49]||(n[49]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("bold")}]),onClick:n[9]||(n[9]=s=>Sl("bold")),title:e.unref(A)("textEditor.toolbar.bold")},[...n[50]||(n[50]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,ld),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("italic")}]),onClick:n[10]||(n[10]=s=>Sl("italic")),title:e.unref(A)("textEditor.toolbar.italic")},[...n[51]||(n[51]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,nd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("underline")}]),onClick:n[11]||(n[11]=s=>Sl("underline")),title:e.unref(A)("textEditor.toolbar.underline")},[...n[52]||(n[52]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,od),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ye.value}]),onClick:ql,title:e.unref(A)("textEditor.toolbar.citation")},[...n[53]||(n[53]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,ad),n[62]||(n[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:pn,title:e.unref(A)("textEditor.toolbar.removeLink")},[...n[55]||(n[55]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,rd)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Yn,title:e.unref(A)("textEditor.toolbar.insertLink")},[...n[54]||(n[54]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,sd)),n[63]||(n[63]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("insertUnorderedList")}]),onClick:Zn,title:e.unref(A)("textEditor.toolbar.bulletList")},[...n[56]||(n[56]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,id),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("insertOrderedList")}]),onClick:wn,title:e.unref(A)("textEditor.toolbar.numberList")},[...n[57]||(n[57]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,cd),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Yl,title:e.unref(A)("textEditor.toolbar.image")},[...n[58]||(n[58]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,ud),at.value&&Y.value?(e.openBlock(),e.createElementBlock("div",dd)):e.createCommentVNode("",!0),at.value&&Y.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(A)("textEditor.toolbar.comment"),onClick:Pl},[...n[59]||(n[59]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,md)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",pd)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",fd,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=s=>Hn("askAi")),title:e.unref(A)("textEditor.toolbar.askAi")},[n[60]||(n[60]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",gd,e.toDisplayString(e.unref(A)("textEditor.toolbar.askAi")),1)],8,vd),xe.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",hd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.customToolbarSlots,(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Ml(s)?(e.openBlock(),e.createElementBlock("div",yd,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),Ml(s)&&r<L.customToolbarSlots.length-1&&mn(r)?(e.openBlock(),e.createElementBlock("div",kd)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(xe.value==="paragraph"||xe.value==="askAi")&&L.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:nl})):e.createCommentVNode("",!0),e.createVNode(la,{showModal:Te.value,width:"500px",height:"55vh",onCloseModal:Qn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(A)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Cd,[e.createElementVNode("div",bd,[e.createElementVNode("label",wd,e.toDisplayString(e.unref(A)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Ze,type:"text","onUpdate:modelValue":n[15]||(n[15]=s=>mt.value=s),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Jn,["enter"])},null,40,xd),[[e.vModelText,mt.value]])]),e.createElementVNode("div",Ed,[e.createElementVNode("label",Sd,e.toDisplayString(e.unref(A)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:W,type:"text","onUpdate:modelValue":n[16]||(n[16]=s=>nt.value=s),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Jn,["enter"])},null,40,Vd),[[e.vModelText,nt.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Qn},e.toDisplayString(e.unref(A)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Jn},e.toDisplayString(e.unref(A)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(la,{showModal:kt.value,width:"500px",height:"80vh",onCloseModal:Kl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Ct.value?e.unref(A)("textEditor.image.editImage"):e.unref(A)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Nd,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Be.value==="upload"}]),onClick:n[17]||(n[17]=s=>Be.value="upload")},e.toDisplayString(e.unref(A)("textEditor.image.upload")),3),n[65]||(n[65]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Be.value==="url"}]),onClick:n[18]||(n[18]=s=>Be.value="url")},e.toDisplayString(e.unref(A)("textEditor.image.imageLink")),3)]),Be.value==="upload"?(e.openBlock(),e.createElementBlock("div",Bd,[e.createElementVNode("div",Md,[e.createElementVNode("div",_d,[yn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",$d,e.toDisplayString(e.unref(A)("textEditor.image.uploadImage")),1)),yn.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:go},[e.createElementVNode("img",{src:Ft.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Ld),n[66]||(n[66]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:_e,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:jl},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:_e,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:jl},null,544))]),e.createElementVNode("div",Ad,[e.createElementVNode("label",Td,e.toDisplayString(e.unref(A)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:De,type:"text","onUpdate:modelValue":n[19]||(n[19]=s=>wt.value=s),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterAltText"),onKeyup:e.withKeys(ol,["enter"])},null,40,Dd),[[e.vModelText,wt.value]])]),e.createElementVNode("div",Hd,[e.createElementVNode("label",Rd,e.toDisplayString(e.unref(A)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=s=>se.value=s),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(ol,["enter"]),onInput:ho},null,40,Fd),[[e.vModelText,se.value]])]),e.createElementVNode("div",Id,[e.createElementVNode("label",zd,e.toDisplayString(e.unref(A)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=s=>pe.value=s),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(ol,["enter"]),onInput:yo},null,40,Pd),[[e.vModelText,pe.value]])])])])):e.createCommentVNode("",!0),Be.value==="url"?(e.openBlock(),e.createElementBlock("div",Od,[e.createElementVNode("div",qd,[e.createElementVNode("div",Wd,[e.createElementVNode("label",Zd,e.toDisplayString(e.unref(A)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:jt,type:"text","onUpdate:modelValue":n[22]||(n[22]=s=>Ue.value=s),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(ol,["enter"])},null,40,Ud),[[e.vModelText,Ue.value]])]),e.createElementVNode("div",Xd,[e.createElementVNode("label",Yd,e.toDisplayString(e.unref(A)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=s=>wt.value=s),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterAltText"),onKeyup:e.withKeys(ol,["enter"])},null,40,jd),[[e.vModelText,wt.value]])]),e.createElementVNode("div",Kd,[e.createElementVNode("label",Gd,e.toDisplayString(e.unref(A)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=s=>se.value=s),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(ol,["enter"]),onInput:ho},null,40,Qd),[[e.vModelText,se.value]])]),e.createElementVNode("div",Jd,[e.createElementVNode("label",e1,e.toDisplayString(e.unref(A)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=s=>pe.value=s),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(ol,["enter"]),onInput:yo},null,40,t1),[[e.vModelText,pe.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Kl},e.toDisplayString(e.unref(A)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:ol},e.toDisplayString(e.unref(A)("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":on.value&&tl.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.labels.title")),1),e.createElementVNode("div",l1,[tl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",n1,[L.title?(e.openBlock(),e.createElementBlock("span",o1,e.toDisplayString(L.title),1)):(e.openBlock(),e.createElementBlock("span",a1,e.toDisplayString(dn.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:fe,value:L.title,onInput:Il,onFocus:At,onBlur:ml,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!tl.value}]),placeholder:dn.value,disabled:L.disabled,rows:"1"},null,42,s1)])],2)):e.createCommentVNode("",!0),L.showTitle&&on.value&&tl.value?(e.openBlock(),e.createElementBlock("div",r1,[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":H.value&&S.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.labels.description")),1),e.createElementVNode("div",i1,[S.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",c1,[L.description?(e.openBlock(),e.createElementBlock("span",u1,e.toDisplayString(L.description),1)):(e.openBlock(),e.createElementBlock("span",d1,e.toDisplayString(Bl.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:et,value:L.description,onInput:Tl,onFocus:Dn,onBlur:Cn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!S.value}]),placeholder:Bl.value,disabled:L.disabled,rows:"1"},null,42,m1)])],2)):e.createCommentVNode("",!0),L.showDescription&&H.value&&S.value?(e.openBlock(),e.createElementBlock("div",p1,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),at.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:6},e.renderList(le.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":pl.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:r=>Gl(s),onMouseleave:_o},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>Vn(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,g1)):(e.openBlock(),e.createElementBlock("span",h1,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,v1)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>Vn(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,k1)):(e.openBlock(),e.createElementBlock("span",C1,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,y1)):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(r=>Vn(s),["stop"])},[e.createElementVNode("span",w1,"+"+e.toDisplayString(s.additionalCount),1)],12,b1)):e.createCommentVNode("",!0)],46,f1))),128)):e.createCommentVNode("",!0),L.richText?(e.openBlock(),e.createElementBlock("div",M1,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":L.disabled,"dss-text-editor-fixed-height":L.fixedHeight}]),style:e.normalizeStyle(Al.value),onInput:Mt,onBlur:ht,onClick:It,onMouseup:Tt,onKeyup:Tt,onKeydown:Xo,onPaste:vo,onMousemove:Ln,onMouseleave:Eo},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[at.value&&pl.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(y.value)},[q.value||Ge.value.length>0?(e.openBlock(),e.createElementBlock("div",_1,[e.createElementVNode("div",$1,[q.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:q.value},null,8,L1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",A1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,(s,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:"dss-comment-message"},[s.user&&(s.user.avatar||s.user.initials||s.user.name)?(e.openBlock(),e.createElementBlock("div",T1,[e.createElementVNode("div",D1,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,H1)):(e.openBlock(),e.createElementBlock("span",R1,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",F1,[e.createElementVNode("div",I1,[e.createElementVNode("div",z1,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",P1,e.toDisplayString(Le(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":ct(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),B.commentUser&&s.user&&s.user.id===B.commentUser.id&&!ct(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>uo(s,r),["stop"]),title:e.unref(A)("textEditor.comment.delete")||"Delete comment"},[...n[68]||(n[68]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,O1)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",q1,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:x,"onUpdate:modelValue":n[26]||(n[26]=s=>h.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(A)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(xn,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(x.value){const s=x.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,W1),[[e.vModelText,h.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(xn,["stop"])},[...n[69]||(n[69]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",Z1,[e.createElementVNode("div",U1,[e.createElementVNode("span",X1,e.toDisplayString(dl.value)+" "+e.toDisplayString(dl.value===1?e.unref(A)("textEditor.footer.word"):e.unref(A)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Y1,e.toDisplayString(ln.value)+" "+e.toDisplayString(ln.value===1?e.unref(A)("textEditor.footer.character"):e.unref(A)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",x1,[e.createElementVNode("textarea",{value:L.modelValue,onInput:rt,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":L.fixedHeight}]),placeholder:kn.value,rows:L.rows,disabled:L.disabled,style:e.normalizeStyle(yl.value)},null,46,E1),e.createElementVNode("div",S1,[e.createElementVNode("div",V1,[e.createElementVNode("span",N1,e.toDisplayString(dl.value)+" "+e.toDisplayString(dl.value===1?e.unref(A)("textEditor.footer.word"):e.unref(A)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",B1,e.toDisplayString(ln.value)+" "+e.toDisplayString(ln.value===1?e.unref(A)("textEditor.footer.character"):e.unref(A)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[U.value&&me.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(F.value),onMouseenter:n[28]||(n[28]=s=>Se.value=!0),onMouseleave:Rl},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Yo,["stop"]),title:me.value},e.toDisplayString(me.value),9,j1),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Vo,["stop"]),title:e.unref(A)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",G1,[...n[71]||(n[71]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,K1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[$t.value&&Wt.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(K.value),onMouseenter:n[29]||(n[29]=s=>ye.value=!0),onMouseleave:Xn},[e.createElementVNode("div",Q1,[Wt.value===e.unref(A)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",J1,[...n[72]||(n[72]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:Wt.value},e.toDisplayString(Wt.value),9,em)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Bo,["stop"]),title:e.unref(A)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",lm,[...n[73]||(n[73]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,tm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.floatingToolbar&&L.richText&&ot.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:tt,class:"dss-floating-toolbar",style:e.normalizeStyle(be.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",nm,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(ae,["stop"]),title:e.unref(A)("textEditor.toolbar.undo")},[...n[74]||(n[74]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,om),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!un.value}]),onClick:e.withModifiers(el,["stop"]),title:e.unref(A)("textEditor.toolbar.redo")},[...n[75]||(n[75]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,am),n[89]||(n[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",sm,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(s=>Gn("paragraph"),["stop"])),title:e.unref(A)("textEditor.toolbar.paragraphFormat")},[V.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:I.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,im)):V.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:I.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,cm)):V.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:I.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,um)):V.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:I.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,dm)):V.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:I.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,mm)):V.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:I.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,pm)):(e.openBlock(),e.createElementBlock("svg",fm,[...n[76]||(n[76]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[77]||(n[77]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,rm),dt.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[38]||(n[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[31]||(n[31]=s=>vn("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=s=>vn("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=s=>vn("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=s=>vn("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=s=>vn("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=s=>vn("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=s=>vn("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),n[90]||(n[90]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(s=>Sl("bold"),["stop"])),title:e.unref(A)("textEditor.toolbar.bold")},[...n[78]||(n[78]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,vm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(s=>Sl("italic"),["stop"])),title:e.unref(A)("textEditor.toolbar.italic")},[...n[79]||(n[79]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,gm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(s=>Sl("underline"),["stop"])),title:e.unref(A)("textEditor.toolbar.underline")},[...n[80]||(n[80]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,hm),n[91]||(n[91]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ye.value}]),onClick:e.withModifiers(ql,["stop"]),title:e.unref(A)("textEditor.toolbar.citation")},[...n[81]||(n[81]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,ym),n[92]||(n[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(pn,["stop"]),title:e.unref(A)("textEditor.toolbar.removeLink")},[...n[83]||(n[83]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,Cm)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Yn,["stop"]),title:e.unref(A)("textEditor.toolbar.insertLink")},[...n[82]||(n[82]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,km)),n[93]||(n[93]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("insertUnorderedList")}]),onClick:e.withModifiers(Zn,["stop"]),title:e.unref(A)("textEditor.toolbar.bulletList")},[...n[84]||(n[84]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,bm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("insertOrderedList")}]),onClick:e.withModifiers(wn,["stop"]),title:e.unref(A)("textEditor.toolbar.numberList")},[...n[85]||(n[85]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,wm),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Yl,["stop"]),title:e.unref(A)("textEditor.toolbar.image")},[...n[86]||(n[86]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,xm),at.value?(e.openBlock(),e.createElementBlock("div",Em)):e.createCommentVNode("",!0),at.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(A)("textEditor.toolbar.comment"),onClick:e.withModifiers(Pl,["stop"])},[...n[87]||(n[87]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,Sm)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",Vm)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",Nm,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(s=>Gn("askAi"),["stop"])),title:e.unref(A)("textEditor.toolbar.askAi")},[n[88]||(n[88]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",Mm,e.toDisplayString(e.unref(A)("textEditor.toolbar.askAi")),1)],8,Bm),dt.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[43]||(n[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),kl.value?(e.openBlock(),e.createElementBlock("div",_m,[L.askAi&&kl.value?(e.openBlock(),e.createElementBlock("div",$m)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.customToolbarSlots,(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Ml(s)&&Fl(s)?(e.openBlock(),e.createElementBlock("div",Lm,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),Ml(s)&&Fl(s)&&r<L.customToolbarSlots.length-1&&nn(r)?(e.openBlock(),e.createElementBlock("div",Am)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Hm={class:"dss-color-picker__section-title"},Rm={class:"dss-color-picker__presets-row"},Fm=["title","onClick"],Im={key:1,class:"dss-color-picker__section"},zm={class:"dss-color-picker__presets-row"},Pm=["title","onClick"],Om={key:2,class:"dss-color-picker__section"},qm={class:"dss-color-picker__section-header"},Wm={class:"dss-color-picker__presets-row"},Zm=["title","onClick"],Um=["onClick"],Xm={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},Ym=["title","onClick"],jm={class:"dss-color-picker__input-row"},Km=["value"],Gm={__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:oe}){function _(J){const Z=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(J);if(!Z)return{h:0,s:0,l:50};const X=parseInt(Z[1],16)/255,re=parseInt(Z[2],16)/255,fe=parseInt(Z[3],16)/255,et=Math.max(X,re,fe),St=Math.min(X,re,fe);let il=0,xt=0;const tl=(et+St)/2;if(et!==St){const S=et-St;switch(xt=tl>.5?S/(2-et-St):S/(et+St),et){case X:il=((re-fe)/S+(re<fe?6:0))/6;break;case re:il=((fe-X)/S+2)/6;break;case fe:il=((X-re)/S+4)/6;break}}return{h:il*360,s:xt*100,l:tl*100}}function A(J,Z,X){Z/=100,X/=100;const re=Z*Math.min(X,1-X),fe=et=>{const St=(et+J/30)%12,il=X-re*Math.max(Math.min(St-3,9-St,1),-1);return Math.round(255*il).toString(16).padStart(2,"0")};return`#${fe(0)}${fe(8)}${fe(4)}`}function ce(J){const Z=J.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!Z)return null;let X=Z[1];return X.length===3&&(X=X.split("").map(re=>re+re).join("")),"#"+X}function I(J){const Z=J.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!Z)return null;const X=Math.max(0,Math.min(255,Number.parseInt(Z[1],10))),re=Math.max(0,Math.min(255,Number.parseInt(Z[2],10))),fe=Math.max(0,Math.min(255,Number.parseInt(Z[3],10)));return`#${X.toString(16).padStart(2,"0")}${re.toString(16).padStart(2,"0")}${fe.toString(16).padStart(2,"0")}`}function B(J){if(typeof J!="string")return null;const Z=J.trim();return ce(Z)||I(Z)}function ve(J,Z,X){Z/=100,X/=100;const re=X+Z*Math.min(X,1-X),fe=re===0?0:2-2*X/re;return{h:J,s:fe*100,v:re*100}}function ut(J,Z,X){Z/=100,X/=100;const re=X*(1-Z/2),fe=re===0||re===1?0:(X-re)/Math.min(re,1-re);return{h:J,s:fe*100,l:re*100}}const Q=L,f=oe,xe=e.ref(!1),Ce=e.ref(!1),G=e.ref(!1),U=e.ref(-1),me=e.ref(-1),F=e.ref(null),Se=e.ref(null),Te=e.ref(null),nt=e.ref(null),mt=e.ref({top:0,left:0}),W=e.ref(_(Q.modelValue||"#b8a5de")),Ze=e.computed(()=>Array.isArray(Q.presetGroups)&&Q.presetGroups.length>0),qe=e.computed(()=>!Q.disableCustomColors),Ee=e.computed(()=>Ze.value?0:Q.initialPresetCount!=null?Q.initialPresetCount:me.value<0?null:me.value),Me=e.computed(()=>{const J=Ee.value;return J==null?!0:Math.max(0,Q.presetColors.length-J)<Q.max}),Ye=e.computed(()=>!!(Ce.value||U.value>=0||!ee.value&&Q.presetColors.length===0));e.computed(()=>{const J=Ee.value;return J!=null&&Q.presetColors.length>J});const ee=e.computed(()=>Ze.value||Ee.value!=null),ot=e.computed(()=>{const J=Ee.value;return J==null?[]:Q.presetColors.slice(0,J)}),be=e.computed(()=>{const J=Ee.value;return J==null?[]:Q.presetColors.slice(J)});function tt(J){const Z=Ee.value;return Z!=null?Z+J:-1}function dt(J){const Z=Ee.value;return Z!=null&&J>=Z}function kt(J){dt(J)&&(U.value=J,W.value=_(Q.presetColors[J]),Ce.value=!0,e.nextTick(()=>nt.value?.focus()))}function wt(J){if(!dt(J))return;const Z=Q.presetColors.filter((fe,et)=>et!==J);f("update:presetColors",Z);const X=ce(Q.modelValue),re=ce(Q.presetColors[J]);if(X&&re&&X.toLowerCase()===re.toLowerCase()){const fe=Z[Math.max(0,J-1)]||Z[0];fe&&f("update:modelValue",fe)}}function Dt(){G.value=!G.value,G.value||(U.value=-1,Ce.value=!1)}function Ft(){if(!qe.value||U.value<0)return;const J=_e.value,Z=ce(J);if(Z){const X=[...Q.presetColors];X[U.value]=Z,f("update:presetColors",X),f("update:modelValue",Z),U.value=-1,Ce.value=!1}}function se(){Q.disabled||!qe.value||(U.value=-1,Ce.value=!Ce.value,Ce.value&&(ye(),e.nextTick(()=>nt.value?.focus())))}function pe(J){const Z=B(J),X=B(Q.modelValue);return Z&&X&&Z.toLowerCase()===X.toLowerCase()}function De(){if(Q.disabled||!qe.value||!Me.value)return;const J=_e.value,Z=ce(J);if(Z){const X=[...Q.presetColors,Z];f("update:presetColors",X),f("update:modelValue",Z);const re=Ee.value??me.value;re>=0&&X.length-re>=Q.max&&(Ce.value=!1)}}const _e=e.computed(()=>{const{h:J,s:Z,l:X}=W.value;return A(J,Z,X)}),jt=e.computed(()=>_e.value.toLowerCase()),Ct=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${W.value.h}, 100%, 50%))`})),Gt=e.computed(()=>{const J=ve(W.value.h,W.value.s,W.value.l);return{left:`${J.s}%`,bottom:`${J.v}%`,transform:"translate(-50%, 50%)"}}),$t=e.computed(()=>({left:`${W.value.h/360*100}%`,transform:"translateX(-50%)"})),Wt=e.computed(()=>({position:"fixed",left:`${mt.value.left}px`,top:`${mt.value.top}px`,zIndex:1002}));function K(){if(!F.value||!xe.value)return;const J=F.value.getBoundingClientRect(),Z=window.innerHeight||document.documentElement.clientHeight;let X=J.bottom+4;const re=Se.value;re&&X+re.offsetHeight>Z-8&&(X=J.top-4-re.offsetHeight),mt.value={top:X,left:J.left}}function ye(){const J=Q.modelValue||"#b8a5de",Z=B(J);Z&&(W.value=_(Z))}function Be(){f("update:modelValue",_e.value)}function Ue(){Q.disabled||(xe.value=!xe.value,xe.value&&(ye(),e.nextTick(()=>{K(),nt.value?.focus()})))}function Je(){const J=_e.value,Z=ce(J);if(Z){if(U.value>=0){const X=[...Q.presetColors];X[U.value]=Z,f("update:presetColors",X),f("update:modelValue",Z)}else if(qe.value&&(Q.presetColors.length>0||Ze.value)&&Ce.value&&Me.value&&!Q.presetColors.some(re=>ce(re)?.toLowerCase()===Z.toLowerCase())){const re=[...Q.presetColors,Z];f("update:presetColors",re),f("update:modelValue",Z)}}xe.value=!1,Ce.value=!1,G.value=!1,U.value=-1}function Lt(J){if(!Te.value)return;const Z=Te.value.getBoundingClientRect(),X=re=>{const fe=Math.max(0,Math.min(1,(re.clientX-Z.left)/Z.width)),et=Math.max(0,Math.min(1,1-(re.clientY-Z.top)/Z.height)),St={h:W.value.h,s:fe*100,v:et*100};W.value=ut(St.h,St.s,St.v)};X(J),document.addEventListener("mousemove",X),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",X),Be()},{once:!0})}function lt(J){if(!J.currentTarget)return;const X=J.currentTarget.getBoundingClientRect(),re=fe=>{const et=Math.max(0,Math.min(1,(fe.clientX-X.left)/X.width));W.value={...W.value,h:et*360}};re(J),document.addEventListener("mousemove",re),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",re),Be()},{once:!0})}function Pt(J){const Z=J.target.value,X=B(Z);X&&(W.value=_(X),f("update:modelValue",X))}function We(J){if(Q.disabled)return;const Z=B(J);Z&&(W.value=_(Z),f("update:modelValue",Z))}let Re=null,bt=null;function pt(){Re&&(document.removeEventListener("keydown",Re),Re=null),bt&&(window.removeEventListener("resize",bt),bt=null)}return e.watch(xe,J=>{if(pt(),J){if(!Ze.value&&Q.initialPresetCount==null){const Z=Q.presetColors.length;Z>0&&(me.value<0||Z<me.value)&&(me.value=Z)}Re=Z=>{Z.key==="Escape"&&Je()},bt=K,document.addEventListener("keydown",Re),window.addEventListener("resize",bt)}}),e.watch(()=>Q.modelValue,()=>{xe.value&&ye()},{immediate:!1}),e.watch(be,J=>{J.length===0&&(G.value=!1,U.value=-1,Ce.value=!1)}),e.onBeforeUnmount(pt),(J,Z)=>(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":xe.value}]),onClick:Ue},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:_e.value})},[...Z[0]||(Z[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[xe.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Je,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Se,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Wt.value)},[ee.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Ze.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(L.presetGroups,(X,re)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+re,class:"dss-color-picker__section"},[e.createElementVNode("span",Hm,e.toDisplayString(X.title),1),e.createElementVNode("div",Rm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.colors,(fe,et)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+re+"-"+et,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":pe(fe)}]),style:e.normalizeStyle({backgroundColor:fe,"--dss-preset-color":fe}),title:fe,onClick:e.withModifiers(St=>We(fe),["stop"])},null,14,Fm))),128))])]))),128)):ot.value.length?(e.openBlock(),e.createElementBlock("div",Im,[Z[1]||(Z[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(ot.value,(X,re)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+re,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":pe(X)}]),style:e.normalizeStyle({backgroundColor:X,"--dss-preset-color":X}),title:X,onClick:e.withModifiers(fe=>We(X),["stop"])},null,14,Pm))),128))])])):e.createCommentVNode("",!0),qe.value?(e.openBlock(),e.createElementBlock("div",Om,[e.createElementVNode("div",qm,[Z[3]||(Z[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),be.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":G.value}]),title:"Manage custom colors",onClick:e.withModifiers(Dt,["stop"])},[...Z[2]||(Z[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Wm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.value,(X,re)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+re,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":G.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!G.value&&pe(X),"dss-color-picker__preset-bubble--editing":G.value&&U.value===tt(re)}]),style:e.normalizeStyle({backgroundColor:U.value===tt(re)?_e.value:X,"--dss-preset-color":U.value===tt(re)?_e.value:X}),title:U.value===tt(re)?_e.value:X,onClick:e.withModifiers(fe=>G.value?kt(tt(re)):We(X),["stop"])},null,14,Zm),G.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(fe=>wt(tt(re)),["stop"])},[...Z[4]||(Z[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,Um)):e.createCommentVNode("",!0)],2))),128)),Me.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(se,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):L.presetColors.length?(e.openBlock(),e.createElementBlock("div",Xm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.presetColors,(X,re)=>(e.openBlock(),e.createElementBlock("button",{key:re,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":pe(X)}]),style:e.normalizeStyle({backgroundColor:X,"--dss-preset-color":X}),title:X,onClick:e.withModifiers(fe=>We(X),["stop"])},null,14,Ym))),128)),qe.value&&Me.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(se,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ye.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:Te,onMousedown:Lt},[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(Gt.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:lt},[Z[5]||(Z[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle($t.value)},null,4)],32),e.createElementVNode("div",jm,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:nt,type:"text",class:"dss-color-picker__hex-input",value:jt.value,onInput:Pt},null,40,Km)]),qe.value&&ee.value&&(L.presetColors.length||Ze.value)&&Me.value&&U.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:De}," Save color ")):e.createCommentVNode("",!0),qe.value&&ee.value&&U.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Ft}," Save color ")):e.createCommentVNode("",!0),ee.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Je}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},Qm={key:0,class:"dss-loader"},Jm={key:0,class:"dss-loader-label"},e2={key:1,class:"dss-loader"},t2={key:0,class:"dss-loader-label"},l2={key:2,class:"dss-loader"},n2={key:0,class:"dss-loader-label"},o2={key:3,class:"dss-loader"},a2={key:0,class:"dss-loader-label"},s2={key:4,class:"dss-loader"},r2={key:0,class:"dss-loader-label"},i2={key:5,class:"dss-loader dss-loader--inline"},c2={class:"dss-loader-inline-text"},u2={__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 oe=L,_=e.computed(()=>oe.size==="small"?"dss-loaders--size-small":oe.size==="large"?"dss-loaders--size-large":oe.size==="medium"||oe.size==null?"dss-loaders--size-medium":null),A=e.computed(()=>{const ce={};if(!(oe.size==="small"||oe.size==="medium"||oe.size==="large"||oe.size==null)){const I=typeof oe.size=="number"?`${oe.size}px`:String(oe.size);ce["--dss-loader-size"]=I}return oe.color&&(ce["--dss-loader-accent"]=oe.color,ce["--dss-loader-accent-soft"]=`color-mix(in srgb, ${oe.color} 30%, white)`),ce});return(ce,I)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",_.value]),style:e.normalizeStyle(A.value)},[L.type==="spinner"?(e.openBlock(),e.createElementBlock("div",Qm,[I[0]||(I[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),L.label?(e.openBlock(),e.createElementBlock("span",Jm,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="dots"?(e.openBlock(),e.createElementBlock("div",e2,[I[1]||(I[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",t2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="battery"?(e.openBlock(),e.createElementBlock("div",l2,[I[2]||(I[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),L.label?(e.openBlock(),e.createElementBlock("span",n2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",o2,[I[3]||(I[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",a2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="bars"?(e.openBlock(),e.createElementBlock("div",s2,[I[4]||(I[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",r2,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="inline"?(e.openBlock(),e.createElementBlock("div",i2,[I[5]||(I[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",c2,[e.renderSlot(ce.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(L.label),1)])])])):e.createCommentVNode("",!0)],6))}},ca="dss-skeleton-item",d2={__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:ca},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(L){const oe=L,_=e.computed(()=>{const I={"dss-skeleton--loading":oe.loading,"dss-skeleton--static":!oe.shimmer,"dss-skeleton--multiple":oe.mode==="multiple","dss-skeleton--dark":oe.darkMode};return oe.mode==="multiple"&&oe.targetClass!==ca&&(I[`dss-skeleton--target-${oe.targetClass}`]=!0),I}),A=e.computed(()=>{const I={};return oe.borderRadius&&(I.borderRadius=oe.borderRadius),I}),ce=e.computed(()=>{const I={};return oe.borderRadius&&(I["--dss-skeleton-border-radius"]=oe.borderRadius),oe.darkMode?(I["--dss-skeleton-bg"]=oe.bgDark||"#322c3f",I["--dss-skeleton-shimmer"]=oe.shimmerDark||"#3e3f41",I):(oe.bgColor&&(I["--dss-skeleton-bg"]=oe.bgColor),oe.shimmerColor&&(I["--dss-skeleton-shimmer"]=oe.shimmerColor),I)});return(I,B)=>(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(A.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(I.$slots,"default")],2)],6))}},m2={key:0,class:"dss-dnd-column-header"},p2={class:"dss-dnd-column-title"},f2={class:"dss-dnd-column-count"},v2=["data-column"],g2={key:0,class:"dss-dnd-indicator"},h2=["onPointerdown"],y2=["onPointerdown"],k2={class:"dss-dnd-item-content"},C2={class:"dss-dnd-item-default"},b2={key:0,class:"dss-dnd-empty"},w2={name:"DSSDnd"},x2=Object.assign(w2,{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:oe}){const _=L,A=oe,ce=e.useSlots(),I=e.computed(()=>!!ce["delete-zone"]),B={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},ve=e.computed(()=>({...B,..._.options})),ut=e.computed(()=>({"--dss-dnd-col-min-w":ve.value.columnMinWidth,"--dss-dnd-col-max-w":ve.value.columnMaxWidth,"--dss-dnd-col-gap":ve.value.columnGap,"--dss-dnd-indicator-color":ve.value.indicatorColor,"--dss-dnd-body-max-h":ve.value.columnBodyMaxHeight}));function Q(K){if(!ve.value.ColColor||!K)return{};const ye=K.background||K.color;return ye?{background:ye}:{}}const f=e.ref(null),xe=e.ref(null),Ce=e.ref(!1),G=e.ref(-1),U=e.ref(null);let me=null,F=null,Se=null,Te=null,nt=0,mt=0,W="",Ze=null;const qe=5,Ee=e.computed(()=>{const K={};for(const ye of _.columns)K[ye.value]=_.items.filter(Be=>Be[_.columnKey]===ye.value).sort((Be,Ue)=>(Be[_.positionKey]??0)-(Ue[_.positionKey]??0));return K}),Me=e.computed(()=>{const K={},ye=!!f.value,Be=f.value?.[_.itemKey],Ue=xe.value,Je=G.value;for(const Lt of _.columns){const lt=Ee.value[Lt.value]||[],Pt=[],We=Ue==Lt.value;let Re=0;for(let bt=0;bt<lt.length;bt++){const pt=lt[bt],J=ye&&pt[_.itemKey]===Be;!J&&We&&Je===Re&&Pt.push({type:"indicator",key:`ind-${Re}`}),J||Re++,Pt.push({type:"item",item:pt,isDragged:J,key:`item-${pt[_.itemKey]}`})}We&&Je>=Re&&Pt.push({type:"indicator",key:"ind-end"}),K[Lt.value]=Pt}return K});function Ye(K,ye){const Ue=(Ee.value[K]||[]).filter(lt=>lt[_.itemKey]!==f.value?.[_.itemKey]);if(Ue.length===0)return 1;if(ye<=0){const lt=Ue[0][_.positionKey];return lt!=null&&lt>0?lt/2:.5}if(ye>=Ue.length){const lt=Ue[Ue.length-1][_.positionKey];return(lt??0)+1}const Je=Ue[ye-1][_.positionKey]??0,Lt=Ue[ye][_.positionKey]??0;return(Je+Lt)/2}function ee(K,ye,Be){Se&&Se.remove();const Ue=K.getBoundingClientRect(),Je=K.cloneNode(!0);Je.classList.add("dss-dnd-ghost"),Je.style.cssText=`
104
104
  position: fixed;
105
- left: ${ye-tt}px;
106
- top: ${Be-pt}px;
105
+ left: ${ye-nt}px;
106
+ top: ${Be-mt}px;
107
107
  width: ${Ue.width}px;
108
108
  height: ${Ue.height}px;
109
109
  z-index: 9999;
@@ -114,5 +114,5 @@
114
114
  background-color: ${ve.value.dragSourceBackground};
115
115
  font-family: 'Work Sans', sans-serif;
116
116
  cursor: grabbing;
117
- `,document.body.appendChild(Ke),Ee=Ke}function lt(K,ye){Ee&&(Ee.style.left=`${K-tt}px`,Ee.style.top=`${ye-pt}px`)}function be(K){K.classList.add("dss-dnd-item--dragging"),K.style.background=ve.value.dragSourceBackground,K.style.borderColor=ve.value.dragSourceBorder,K.style.transform="scale(0.97)"}function Je(K){K.classList.remove("dss-dnd-item--dragging"),K.style.background="",K.style.borderColor="",K.style.transform=""}function ut(K,ye){return document.elementFromPoint(K,ye)?.closest(".dss-dnd-column-body")??null}function Ct(K,ye){return!!document.elementFromPoint(K,ye)?.closest("[data-dss-dnd-delete-zone]")}function Et(K,ye){if(I.value&&Ct(K,ye)){Ce.value=!0,we.value=null,G.value=-1;return}Ce.value=!1;const Be=ut(K,ye),Ue=Be?.getAttribute("data-column")??null;if(!Ue){we.value=null,G.value=-1;return}we.value=Ue;const Ke=Be.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Tt=Ke.length;for(let et=0;et<Ke.length;et++){const Ot=Ke[et].getBoundingClientRect();if(ye<Ot.top+Ot.height/2){Tt=et;break}}G.value=Tt}function Ht(K){K.preventDefault(),lt(K.clientX,K.clientY),!pe&&(pe=requestAnimationFrame(()=>{pe=null,Et(K.clientX,K.clientY)}))}function Pt(K){window.removeEventListener("pointermove",Ht),window.removeEventListener("pointerup",Pt),window.removeEventListener("pointercancel",Pt),De?.releasePointerCapture?.(K.pointerId),Je(De),De=null;const ye=I.value&&Ct(K.clientX,K.clientY);if(f.value&&ye)A("delete",{item:f.value});else{const Ue=ut(K.clientX,K.clientY)?.getAttribute("data-column")??null;if(f.value&&Ue){const Ke=f.value[M.columnKey],Tt=Ue,Ot=(xe.value[Tt]||[]).filter(ft=>ft[M.itemKey]!==f.value[M.itemKey]),We=Math.max(0,Math.min(G.value,Ot.length)),Fe=Ye(Tt,We),xt=f.value[M.itemKey];A("move",{item:f.value,from:Ke,to:Tt,position:Fe,index:We}),F&&clearTimeout(F),U.value={id:xt,from:Ke,to:Tt},F=setTimeout(()=>{U.value=null},3500)}}Ee&&(Ee.remove(),Ee=null),W!==null&&(document.body.style.cursor=W,W=""),qt()}function se(K,ye){K.preventDefault();const Be=K.target.closest(".dss-dnd-item");if(!Be)return;const Ue=Be.getBoundingClientRect();tt=K.clientX-Ue.left,pt=K.clientY-Ue.top,W=document.body.style.cursor,document.body.style.cursor="grabbing",f.value=ye,De=Be,ee(Be,K.clientX,K.clientY),requestAnimationFrame(()=>be(Be)),Be.setPointerCapture?.(K.pointerId),window.addEventListener("pointermove",Ht),window.addEventListener("pointerup",Pt,{once:!0}),window.addEventListener("pointercancel",Pt,{once:!0})}function ge(){Ze&&(window.removeEventListener("pointermove",He),window.removeEventListener("pointerup",_e),window.removeEventListener("pointercancel",_e),Ze=null)}function He(K){if(!Ze||K.pointerId!==Ze.pointerId)return;const ye=K.clientX-Ze.startX,Be=K.clientY-Ze.startY;if(Math.abs(ye)>=qe||Math.abs(Be)>=qe){const Ue=Ze.item;ge(),se(K,Ue)}}function _e(K){!Ze||K.pointerId!==Ze.pointerId||ge()}function Xt(K,ye){ge(),Ze={item:ye,startX:K.clientX,startY:K.clientY,pointerId:K.pointerId},window.addEventListener("pointermove",He),window.addEventListener("pointerup",_e),window.addEventListener("pointercancel",_e)}function bt(K,ye){ve.value.useHandle||Xt(K,ye)}function Gt(K,ye){Xt(K,ye)}function Lt(){pe&&(cancelAnimationFrame(pe),pe=null)}function qt(){Lt(),f.value=null,we.value=null,Ce.value=!1,G.value=-1}return e.onBeforeUnmount(()=>{Lt(),ge(),F&&clearTimeout(F),Ee&&(Ee.remove(),Ee=null)}),(K,ye)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":ve.value.unstyled}]),style:e.normalizeStyle(ct.value)},[I.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(K.$slots,"delete-zone",{isDragging:!!f.value,isOver:Ce.value})],2),[[e.vShow,!!f.value||ve.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.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(Q(Be))},[ve.value.showHeader?(e.openBlock(),e.createElementBlock("div",d2,[e.renderSlot(K.$slots,"column-header",{column:Be,items:xe.value[Be.value]||[]},()=>[e.createElementVNode("span",m2,e.toDisplayString(Be.title||Be.value),1),e.createElementVNode("span",p2,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(Me.value[Be.value],Ue=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Ue.key},[Ue.type==="indicator"?(e.openBlock(),e.createElementBlock("div",v2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Ue.isDragged,"dss-dnd-item--no-handle":!ve.value.useHandle}]),onPointerdown:Ke=>bt(Ke,Ue.item)},[ve.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Ke=>Gt(Ke,Ue.item),["stop"])},[e.renderSlot(K.$slots,"handle",{},()=>[ye[0]||(ye[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,h2)):e.createCommentVNode("",!0),e.createElementVNode("div",y2,[e.renderSlot(K.$slots,"item",{item:Ue.item,column:Be,justDropped:U.value?.id===Ue.item[H.itemKey],droppedFrom:U.value?.id===Ue.item[H.itemKey]?U.value.from:null,droppedTo:U.value?.id===Ue.item[H.itemKey]?U.value.to:null},()=>[e.createElementVNode("div",k2,e.toDisplayString(Ue.item[H.itemKey]),1)])])],42,g2))],64))),128)),(xe.value[Be.value]||[]).length===0&&we.value!=Be.value?(e.openBlock(),e.createElementBlock("div",C2,[e.renderSlot(K.$slots,"empty",{column:Be},()=>[ye[1]||(ye[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,f2)],6))),128))],6))}}),x2={name:"DSSConfetti"},E2=Object.assign(x2,{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(H){const ne=H,M=e.ref(null),A=e.ref(!1);let ue=[],I=null,$=null;function ve(G,U){const pe=[];for(let F=0;F<ne.count;F++)pe.push(ct(G));return pe}function ct(G,U){return{x:Math.random()*G,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 Q(G,U,pe,F){G.clearRect(0,0,U,pe);for(const Ee of ue)G.save(),G.globalAlpha=Ee.opacity*F,G.beginPath(),G.lineWidth=Ee.r,G.strokeStyle=Ee.color,G.moveTo(Ee.x+Ee.tilt+Ee.r/2,Ee.y),G.lineTo(Ee.x+Ee.tilt,Ee.y+Ee.tilt+Ee.r/2),G.stroke(),G.restore()}function f(G,U,pe){const F=.3+pe*.7;for(let Ee=0;Ee<ue.length;Ee++){const De=ue[Ee];De.tiltAngle+=De.tiltInc,De.y+=De.speed*F,De.x+=Math.sin(De.d)*.5*F,De.tilt=Math.sin(De.tiltAngle)*15,pe>=.99&&De.y>U+20&&(ue[Ee]=ct(G))}}function we(){A.value=!0,e.nextTick(()=>{const G=M.value;if(!G)return;const U=G.getContext("2d"),pe=G.parentElement;if(!pe)return;const F=pe.getBoundingClientRect();G.width=F.width,G.height=F.height,ue=ve(G.width,G.height);const Ee=Date.now(),De=Ee+ne.duration,tt=()=>{const pt=Date.now(),W=pt-Ee;if(pt<De){let Ze=1;W>ne.fadeStart&&(Ze=1-(W-ne.fadeStart)/(ne.duration-ne.fadeStart)),Q(U,G.width,G.height,Ze),f(G.width,G.height,Ze),I=requestAnimationFrame(tt)}else Ce()};tt()})}function Ce(){I&&(cancelAnimationFrame(I),I=null),ue=[],A.value=!1}return e.watch(()=>ne.trigger,G=>{G&&($&&clearTimeout($),$=setTimeout(we,ne.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{Ce(),$&&clearTimeout($)}),(G,U)=>A.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:M,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),S2={class:"dss-filter-global-inner"},V2=["placeholder","value"],N2=["title"],B2={key:0,class:"dss-filter-funnel-badge"},M2={key:1,class:"dss-filter-sortby"},_2=["value"],$2=["value"],L2=["disabled","title"],A2={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"},T2={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"},D2={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"},H2={class:"dss-filter-panel"},R2={key:0,class:"dss-filter-empty"},F2={class:"dss-filter-row-prefix"},I2={class:"dss-filter-cell"},z2=["onClick"],P2={class:"dss-filter-trigger-text"},O2=["placeholder"],q2={class:"dss-filter-popup-list"},W2=["onClick"],Z2={key:0,class:"dss-filter-popup-empty"},U2={key:0,class:"dss-filter-cell"},X2=["onClick"],Y2={class:"dss-filter-trigger-text"},j2={class:"dss-filter-popup-list"},K2=["onClick"],G2={key:1,class:"dss-filter-cell dss-filter-cell--value"},Q2=["placeholder","onUpdate:modelValue"],J2={key:1,class:"dss-filter-date-wrap"},e0=["placeholder","onUpdate:modelValue"],t0=["placeholder","value","onInput","step"],l0={key:4,class:"dss-filter-between"},n0=["placeholder","value","onInput","step"],o0={class:"dss-filter-between-sep"},a0=["placeholder","value","onInput","step"],s0={key:5,class:"dss-filter-multiselect"},r0=["onClick"],i0={class:"dss-filter-trigger-text"},c0=["placeholder"],u0={class:"dss-filter-popup-list dss-filter-popup-list--check"},d0=["onClick"],m0=["checked"],p0={key:0,class:"dss-filter-popup-empty"},f0=["onClick"],v0={class:"dss-filter-foot"},g0={class:"dss-filter-cell"},h0=["placeholder"],y0={class:"dss-filter-popup-list"},k0=["onClick"],C0={key:0,class:"dss-filter-popup-divider"},b0=["onClick"],w0=["placeholder"],x0={class:"dss-filter-popup-list"},E0=["onClick"],S0={key:0,class:"dss-filter-popup-empty"},V0=["placeholder"],N0={class:"dss-filter-popup-list"},B0=["onClick"],M0={key:0,class:"dss-filter-popup-empty"},_0={name:"DSSFilter"},$0=Object.assign(_0,{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(H,{expose:ne,emit:M}){const{t:A}=lo.useI18n(),ue=H,I=M,$={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},ve=e.computed(()=>({...$,...ue.options})),ct={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"}]},Q=new Set(["is_empty","is_not_empty","is_true","is_false"]),f=["label","name","title","keyword","full_name","value","text"],we=e.ref(""),Ce=e.ref([]),G=e.ref(null),U=e.ref(!1),pe=e.ref(null),F=e.ref(""),Ee=e.ref(null),De=e.ref(""),tt=e.ref("asc");let pt=1;function W(S){const C=S.find(V=>V&&typeof V=="object");if(!C)return null;for(const V of f)if(V in C&&typeof C[V]=="string")return V;return Object.keys(C).find(V=>typeof C[V]=="string")||null}function Ze(S,C){const V=C.filter(Y=>Y!=null&&Y!=="NULL");if(V.length===0)return null;if(V.every(Y=>Array.isArray(Y))){const Y=V.flatMap(ze=>ze).filter(ze=>ze!=null);return Y.length===0?null:typeof Y.find(ze=>ze!=null)=="object"?"arraySelect":"arrayText"}return V.every(Y=>typeof Y=="boolean")?"boolean":V.every(Y=>typeof Y=="number")?new Set(V).size<=ve.value.maxUniqueForEnum?"select":"range":V.every(Y=>typeof Y=="string")?new Set(V).size<=ve.value.maxUniqueForSelect?"select":"text":V.some(Y=>typeof Y=="object"&&!Array.isArray(Y))?null:"text"}const qe=e.computed(()=>{if(!ue.data?.length)return[];const S=new Set;for(const le of ue.data)if(le&&typeof le=="object")for(const ze of Object.keys(le))S.add(ze);const C=new Set(ue.exclude),V=[];for(const le of S){if(C.has(le))continue;const ze=ue.config[le]||{},gt=ue.data.map(ht=>ht?.[le]),rt=ze.type||Ze(le,gt);if(!rt)continue;const Oe=ze.filterMode||"contain",Bt=Oe==="date"?"date":Oe==="string"?"text":rt,Vt={key:le,label:ze.label||St(le),type:Bt,filterMode:Oe};if(rt==="select"){const ht=gt.filter(yt=>yt!=null&&yt!=="NULL");Vt.uniqueValues=[...new Set(ht)].sort((yt,Mt)=>typeof yt=="number"&&typeof Mt=="number"?yt-Mt:String(yt).localeCompare(String(Mt)))}else if(rt==="range"||rt==="int"){const ht=gt.filter(yt=>typeof yt=="number");Vt.min=Math.min(...ht),Vt.max=Math.max(...ht)}else if(rt==="arraySelect"){const ht=ze.displayKey||W(gt.flatMap(yt=>Array.isArray(yt)?yt:[]));if(Vt.displayKey=ht,Array.isArray(ze.uniqueValues)&&ze.uniqueValues.length>0)Vt.uniqueValues=ze.uniqueValues.map(yt=>String(yt));else{const yt=gt.flatMap(Mt=>Array.isArray(Mt)?Mt:[]).filter(Mt=>Mt!=null).map(Mt=>ht&&typeof Mt=="object"?Mt[ht]:String(Mt)).filter(Mt=>Mt!=null&&Mt!=="");Vt.uniqueValues=[...new Set(yt)].sort((Mt,_t)=>String(Mt).localeCompare(String(_t)))}}V.push(Vt)}const Y=ue.config._order;return Y&&V.sort((le,ze)=>{const gt=Y.indexOf(le.key),rt=Y.indexOf(ze.key);return gt===-1&&rt===-1?0:gt===-1?1:rt===-1?-1:gt-rt}),V}),xe=e.computed(()=>{const S={};for(const C of qe.value)S[C.key]=C;return S}),Me=e.computed(()=>Array.isArray(ue.config.groups)&&ue.config.groups.length>0),Ye=e.computed(()=>{if(!Me.value)return[];const S=new Set(qe.value.map(C=>C.key));return ue.config.groups.map(C=>({...C,keys:C.keys.filter(V=>S.has(V))})).filter(C=>C.keys.length>0)}),ee=e.computed(()=>{if(!Me.value)return[];const S=new Set(ue.config.groups.flatMap(C=>C.keys));return qe.value.filter(C=>!S.has(C.key))}),lt=e.computed(()=>{if(!Ee.value)return[];const S=new Set(Ee.value.keys),C=qe.value.filter(Y=>S.has(Y.key));if(!F.value)return C;const V=F.value.toLowerCase();return C.filter(Y=>Y.label.toLowerCase().includes(V))}),be=e.computed(()=>{if(!F.value)return qe.value;const S=F.value.toLowerCase();return qe.value.filter(C=>C.label.toLowerCase().includes(S))}),Je=e.computed(()=>qe.value.filter(S=>!["arraySelect","arrayText"].includes(S.type))),ut=e.computed(()=>De.value?tt.value==="asc"?"Ascending":"Descending":"No sort selected");function Ct(S){G.value===S?Et():(G.value=S,F.value="",Ee.value=null)}function Et(){G.value=null,F.value="",Ee.value=null}function Ht(S){const C=S.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");G.value&&!C&&!S.target.closest(".dss-filter-popup")&&!S.target.closest(".dss-filter-trigger")&&!S.target.closest(".dss-filter-add-btn")&&Et(),U.value&&pe.value&&!pe.value.contains(S.target)&&(C||(U.value=!1))}e.onMounted(()=>document.addEventListener("click",Ht)),e.onBeforeUnmount(()=>document.removeEventListener("click",Ht));function Pt(S){return xe.value[S]?.label||St(S)}function se(S){return xe.value[S.key]?.filterMode||"contain"}function ge(S){return A(`filter.operators.${S}`)}function He(S){const C=xe.value[S.key];return(ct[C?.type]||ct.text).map(V=>({...V,label:A(`filter.operators.${V.value}`)}))}function _e(S){return Q.has(S)}function Xt(S){const C=xe.value[S.key];return C?C.type==="date"?"date":C.type==="boolean"?"boolean":C.type==="text"||C.type==="arrayText"?"text":C.type==="select"||C.type==="arraySelect"?"multiselect":C.type==="range"||C.type==="int"?S.operator==="between"?"between":"number":"text":"text"}function bt(S){return ct[S]?.[0]?.value||"contains"}function Gt(S,C){return Q.has(C)||S==="date"?null:S==="select"||S==="arraySelect"?[]:(S==="range"||S==="int")&&C==="between"?{min:null,max:null}:S==="range"||S==="int"?null:""}function Lt(S){return xe.value[S.key]?.uniqueValues||[]}function qt(S){const C=Lt(S);if(!F.value)return C;const V=F.value.toLowerCase();return C.filter(Y=>String(Y).toLowerCase().includes(V))}function K(S){const C=S.value;return!C||C.length===0?A("filter.select"):C.length<=2?C.join(", "):A("filter.selectedCount",{count:C.length})}function ye(S){const C=xe.value[S],V=C?.filterMode||"contain",Y=C?.type||"text",le=V==="string"?"contains":bt(Y);Ce.value.push(e.reactive({id:pt++,key:S,operator:le,value:Gt(Y,le)})),Et()}function Be(S){Ce.value=Ce.value.filter(C=>C.id!==S)}function Ue(S,C){const Y=xe.value[C]?.type||"text";S.key=C,S.operator=bt(Y),S.value=Gt(Y,S.operator),Et()}function Ke(S,C){const V=Xt(S);S.operator=C;const Y=Xt(S);if(V!==Y||Q.has(C)){const le=xe.value[S.key];S.value=Gt(le?.type||"text",C)}Et()}function Tt(S,C){const V=C.target.value;S.value=V===""?null:Number(V)}function et(S,C,V){const Y=V.target.value,le=Y===""?null:Number(Y);(!S.value||typeof S.value!="object")&&(S.value={min:null,max:null}),S.value={...S.value,[C]:isNaN(le)?null:le}}function Ot(S,C){const V=S.value||[],Y=V.indexOf(C);S.value=Y>=0?V.filter(le=>le!==C):[...V,C]}function We(){Ce.value=[],we.value="",Et()}function Fe(S){we.value=S.target.value}function xt(S){De.value=S.target.value}function ft(){tt.value=tt.value==="asc"?"desc":"asc"}const J=e.computed(()=>{if(!ue.data)return[];let S=ue.data;if(we.value){const C=we.value.toLowerCase();S=S.filter(V=>{for(const Y of Object.keys(V)){const le=V[Y];if(typeof le=="string"&&le.toLowerCase().includes(C)||typeof le=="number"&&String(le).includes(C)||Array.isArray(le)&&le.some(ze=>ze!=null&&(typeof ze=="string"?ze.toLowerCase().includes(C):typeof ze=="object"?Object.values(ze).some(gt=>typeof gt=="string"&&gt.toLowerCase().includes(C)):!1)))return!0}return!1})}for(const C of Ce.value){if(!re(C))continue;const V=xe.value[C.key];V&&(S=S.filter(Y=>fe(Y,C,V)))}if(ue.showSortBy&&De.value){const C=De.value,V=tt.value==="asc"?1:-1;S=[...S].sort((Y,le)=>Z(Y?.[C],le?.[C])*V)}return S});function Z(S,C){const V=X(S),Y=X(C);return V==null&&Y==null?0:V==null?1:Y==null?-1:typeof V=="number"&&typeof Y=="number"?V-Y:String(V).localeCompare(String(Y),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 re(S){return Q.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 fe(S,C,V){const Y=S?.[C.key],le=C.value,ze=C.operator;if(ze==="is_empty")return rl(Y);if(ze==="is_not_empty")return!rl(Y);const gt=V.type;if(gt==="text"||gt==="arrayText"){const rt=gt==="arrayText"&&Array.isArray(Y)?Y.filter(Vt=>Vt!=null).map(String).join(" "):Y!=null?String(Y):"",Oe=String(le).toLowerCase(),Bt=rt.toLowerCase();switch(ze){case"contains":return Bt.includes(Oe);case"not_contains":return!Bt.includes(Oe);case"equals":return Bt===Oe;case"not_equals":return Bt!==Oe;case"starts_with":return Bt.startsWith(Oe);case"ends_with":return Bt.endsWith(Oe);default:return!0}}if(gt==="select")switch(ze){case"is_any_of":return le.includes(Y);case"is_none_of":return!le.includes(Y);default:return!0}if(gt==="range"||gt==="int"){const rt=typeof Y=="number"?Y:Number(Y);if(typeof rt!="number"||isNaN(rt))return!1;if(ze==="between"){const Bt=le?.min!=null?Number(le.min):null,Vt=le?.max!=null?Number(le.max):null,ht=Bt!=null&&!isNaN(Bt)?Bt:null,yt=Vt!=null&&!isNaN(Vt)?Vt:null;return(ht==null||rt>=ht)&&(yt==null||rt<=yt)}const Oe=typeof le=="number"&&!isNaN(le)?le:Number(le);if(ze==="contains"||ze==="not_contains"){const Bt=String(rt),Vt=String(le??"").toLowerCase(),ht=Bt.toLowerCase().includes(Vt);return ze==="contains"?ht:!ht}if(typeof Oe!="number"||isNaN(Oe))return!1;switch(ze){case"eq":return rt===Oe;case"neq":return rt!==Oe;case"gt":return rt>Oe;case"gte":return rt>=Oe;case"lt":return rt<Oe;case"lte":return rt<=Oe;default:return!0}}if(gt==="arraySelect"){if(!Array.isArray(Y))return!1;const rt=Y.filter(Oe=>Oe!=null).map(Oe=>V.displayKey&&typeof Oe=="object"?Oe[V.displayKey]:String(Oe));switch(ze){case"contains_any":return rt.some(Oe=>le.includes(Oe));case"contains_all":return le.every(Oe=>rt.includes(Oe));case"not_contains_any":return!rt.some(Oe=>le.includes(Oe));default:return!0}}if(gt==="date"){const rt=Ge(le);if(!rt||isNaN(rt.getTime()))return!1;const Oe=Ge(Y);if(!Oe||isNaN(Oe.getTime()))return!1;const Bt=Nt(Oe),Vt=Nt(rt);switch(ze){case"eq":return Bt===Vt;case"before":return Bt<Vt;case"after":return Bt>Vt;default:return!0}}if(gt==="boolean"){const rt=Y===!0||Y==="true"||Y===1,Oe=Y===!1||Y==="false"||Y===0;switch(ze){case"is_true":return rt;case"is_false":return Oe;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 C=new Date(S);return isNaN(C.getTime())?null:C}return null}function Nt(S){const C=S.getFullYear(),V=String(S.getMonth()+1).padStart(2,"0"),Y=String(S.getDate()).padStart(2,"0");return`${C}-${V}-${Y}`}function rl(S){return!!(S==null||S===""||S==="NULL"||Array.isArray(S)&&S.length===0||Array.isArray(S)&&S.every(C=>C==null))}e.watch(J,S=>I("update:modelValue",S),{immediate:!0}),e.watch(()=>ue.data,()=>{Ce.value=[],we.value="",U.value=!1,De.value="",tt.value="asc",Et()});function St(S){return S.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,C=>C.toUpperCase())}function ll(){const S=C=>{if(C==null)return C;if(C instanceof Date)return{_type:"Date",value:C.toISOString(),local:C.toLocaleDateString()};if(Array.isArray(C))return C.map(S);if(typeof C=="object"&&!Array.isArray(C)){const V={};for(const Y of Object.keys(C))V[Y]=S(C[Y]);return V}return C};return{globalSearch:we.value,rows:Ce.value.map(C=>({key:C.key,operator:C.operator,value:S(C.value),defType:xe.value[C.key]?.type,defFilterMode:xe.value[C.key]?.filterMode})),filteredCount:J.value?.length??0}}return ne({getDebugState:ll}),(S,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":ve.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:pe},[e.createElementVNode("div",S2,[C[20]||(C[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref(A)("filter.searchAcrossFields"),value:we.value,onInput:Fe},null,40,V2),we.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:C[0]||(C[0]=V=>we.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:U.value||Ce.value.length>0,"dss-filter-funnel-btn--with-sort":ue.showSortBy}]),onClick:C[1]||(C[1]=V=>U.value=!U.value),type:"button",title:U.value?e.unref(A)("filter.closeAdvancedFilter"):e.unref(A)("filter.openAdvancedFilter")},[C[14]||(C[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),Ce.value.length>0?(e.openBlock(),e.createElementBlock("span",B2,e.toDisplayString(Ce.value.length),1)):e.createCommentVNode("",!0)],10,N2),ue.showSortBy?(e.openBlock(),e.createElementBlock("div",M2,[C[19]||(C[19]=e.createElementVNode("label",{class:"dss-filter-sortby-label",for:"dss-filter-sort-select"},"Sort by",-1)),e.createElementVNode("select",{id:"dss-filter-sort-select",class:"dss-filter-sortby-select",value:De.value,onChange:xt},[C[15]||(C[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,V=>(e.openBlock(),e.createElementBlock("option",{key:V.key,value:V.key},e.toDisplayString(V.label),9,$2))),128))],40,_2),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:ft,disabled:!De.value,title:ut.value},[De.value?tt.value==="asc"?(e.openBlock(),e.createElementBlock("svg",T2,[...C[17]||(C[17]=[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",D2,[...C[18]||(C[18]=[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",A2,[...C[16]||(C[16]=[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"currentColor"},null,-1)])]))],8,L2)])):e.createCommentVNode("",!0)]),U.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:C[13]||(C[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",H2,[Ce.value.length===0?(e.openBlock(),e.createElementBlock("div",R2,e.toDisplayString(e.unref(A)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(V,Y)=>(e.openBlock(),e.createElementBlock("div",{key:V.id,class:"dss-filter-row"},[e.createElementVNode("span",F2,e.toDisplayString(Y===0?e.unref(A)("filter.where"):e.unref(A)("filter.and")),1),e.createElementVNode("div",I2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(le=>Ct(`${V.id}:field`),["stop"])},[e.createElementVNode("span",P2,e.toDisplayString(Pt(V.key)),1),C[21]||(C[21]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,z2),G.value===`${V.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[3]||(C[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[2]||(C[2]=le=>F.value=le),placeholder:e.unref(A)("filter.searchAttributes")},null,8,O2),[[e.vModelText,F.value]]),e.createElementVNode("ul",q2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.value,le=>(e.openBlock(),e.createElementBlock("li",{key:le.key,class:"dss-filter-popup-item",onClick:ze=>Ue(V,le.key)},e.toDisplayString(le.label),9,W2))),128)),be.value.length===0?(e.openBlock(),e.createElementBlock("li",Z2,e.toDisplayString(e.unref(A)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),se(V)==="contain"||se(V)==="date"?(e.openBlock(),e.createElementBlock("div",U2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(le=>Ct(`${V.id}:op`),["stop"])},[e.createElementVNode("span",Y2,e.toDisplayString(ge(V.operator)),1),C[22]||(C[22]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,X2),G.value===`${V.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[4]||(C[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",j2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He(V),le=>(e.openBlock(),e.createElementBlock("li",{key:le.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:V.operator===le.value}]),onClick:ze=>Ke(V,le.value)},e.toDisplayString(le.label),11,K2))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_e(V.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",G2,[se(V)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(A)("filter.enterValue"),"onUpdate:modelValue":le=>V.value=le},null,8,Q2)),[[e.vModelText,V.value]]):se(V)==="date"?(e.openBlock(),e.createElementBlock("div",J2,[e.createVNode(ta,{mode:"single",modelValue:V.value,"onUpdate:modelValue":le=>V.value=le},null,8,["modelValue","onUpdate:modelValue"])])):Xt(V)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(A)("filter.enterValue"),"onUpdate:modelValue":le=>V.value=le},null,8,e0)),[[e.vModelText,V.value]]):Xt(V)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(A)("filter.enterValue"),value:V.value,onInput:le=>Tt(V,le),step:xe.value[V.key]?.type==="int"?1:void 0},null,40,t0)):Xt(V)==="between"?(e.openBlock(),e.createElementBlock("div",l0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(A)("filter.min"),value:V.value?.min,onInput:le=>et(V,"min",le),step:xe.value[V.key]?.type==="int"?1:void 0},null,40,n0),e.createElementVNode("span",o0,e.toDisplayString(e.unref(A)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(A)("filter.max"),value:V.value?.max,onInput:le=>et(V,"max",le),step:xe.value[V.key]?.type==="int"?1:void 0},null,40,a0)])):Xt(V)==="multiselect"?(e.openBlock(),e.createElementBlock("div",s0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(le=>Ct(`${V.id}:val`),["stop"])},[e.createElementVNode("span",i0,e.toDisplayString(K(V)),1),C[23]||(C[23]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,r0),G.value===`${V.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[6]||(C[6]=e.withModifiers(()=>{},["stop"]))},[Lt(V).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[5]||(C[5]=le=>F.value=le),placeholder:e.unref(A)("filter.search")},null,8,c0)),[[e.vModelText,F.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",u0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qt(V),le=>(e.openBlock(),e.createElementBlock("li",{key:le,class:"dss-filter-popup-item",onClick:ze=>Ot(V,le)},[e.createElementVNode("input",{type:"checkbox",checked:(V.value||[]).includes(le),tabindex:"-1"},null,8,m0),e.createElementVNode("span",null,e.toDisplayString(le),1)],8,d0))),128)),qt(V).length===0?(e.openBlock(),e.createElementBlock("li",p0,e.toDisplayString(e.unref(A)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:le=>Be(V.id)},[...C[24]||(C[24]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,f0)]))),128)),e.createElementVNode("div",v0,[e.createElementVNode("div",g0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:C[7]||(C[7]=e.withModifiers(V=>Ct("add"),["stop"]))},e.toDisplayString(e.unref(A)("filter.addFilter")),1),G.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:C[12]||(C[12]=e.withModifiers(()=>{},["stop"]))},[Me.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":C[8]||(C[8]=V=>F.value=V),placeholder:e.unref(A)("filter.searchAttributes")},null,8,h0),[[e.vModelText,F.value]]),e.createElementVNode("ul",y0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:Y=>Ee.value=V},[e.createElementVNode("span",null,e.toDisplayString(V.label),1),C[25]||(C[25]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,k0))),128)),ee.value.length>0?(e.openBlock(),e.createElementBlock("li",C0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:Y=>ye(V.key)},e.toDisplayString(V.label),9,b0))),128))])],64)):Ee.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:C[9]||(C[9]=V=>Ee.value=null)},[C[26]||(C[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(Ee.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[10]||(C[10]=V=>F.value=V),placeholder:e.unref(A)("filter.searchAttributes")},null,8,w0),[[e.vModelText,F.value]]),e.createElementVNode("ul",x0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:Y=>ye(V.key)},e.toDisplayString(V.label),9,E0))),128)),lt.value.length===0?(e.openBlock(),e.createElementBlock("li",S0,e.toDisplayString(e.unref(A)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[11]||(C[11]=V=>F.value=V),placeholder:e.unref(A)("filter.searchAttributes")},null,8,V0),[[e.vModelText,F.value]]),e.createElementVNode("ul",N0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:Y=>ye(V.key)},e.toDisplayString(V.label),9,B0))),128)),be.value.length===0?(e.openBlock(),e.createElementBlock("li",M0,e.toDisplayString(e.unref(A)("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:We},e.toDisplayString(e.unref(A)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),L0={class:"dss-pill-field__pills"},A0=["data-value"],T0=["disabled"],D0={class:"dss-pill-field__pill-text"},H0={key:0,class:"dss-pill-field__pill-actions"},R0=["onClick"],F0=["onClick"],I0=["placeholder","disabled"],z0=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(H,{emit:ne}){const M=H,A=ne,ue=e.ref(""),I=e.ref([...M.modelValue]),$=e.ref(null);let ve=null;const ct=e.ref(null),Q=e.ref(""),f=e.ref(null),we=e.ref(null),Ce=e.computed(()=>{if(!we.value)return;const{width:Me,height:Ye}=we.value;return{minWidth:`${Me}px`,height:`${Ye}px`}});function G(Me,Ye){ct.value===Ye&&(f.value=Me)}function U(){ct.value=null,Q.value="",we.value=null,f.value=null}const pe=e.computed(()=>new Set(I.value.map(Me=>Me.trim()).filter(Boolean)));function F(Me){$.value=Me,ve&&clearTimeout(ve),ve=setTimeout(()=>{$.value=null,ve=null},900)}function Ee(Me){const Ye=Me.trim();return Ye?pe.value.has(Ye)?(F(Ye),!1):(I.value=[...I.value,Ye],A("update:modelValue",[...I.value]),!0):!1}function De(Me){const Ye=Me.split(/\r?\n/g).map(Je=>Je.trim()).filter(Boolean);if(!Ye.length)return;const ee=new Set(I.value.map(Je=>Je.trim()).filter(Boolean)),lt=[...I.value];let be=null;for(const Je of Ye){if(ee.has(Je)){be??=Je;continue}ee.add(Je),lt.push(Je)}lt.length!==I.value.length&&(I.value=lt,A("update:modelValue",[...I.value])),be&&F(be)}function tt(Me){M.disabled||(ct.value===Me&&U(),I.value=I.value.filter((Ye,ee)=>ee!==Me),A("update:modelValue",[...I.value]))}async function pt(Me,Ye){if(M.disabled)return;const ee=Ye.currentTarget.closest(".dss-pill-field__pill");ee&&(we.value={width:ee.offsetWidth,height:ee.offsetHeight}),ct.value=Me,Q.value=I.value[Me]??"",await e.nextTick();const lt=f.value;if(!lt)return;lt.focus();const be=lt.value.length;lt.setSelectionRange(be,be)}function W(){U()}function Ze(){if(M.disabled||ct.value===null)return;const Me=ct.value,Ye=I.value[Me]??"",ee=Q.value.trim();if(U(),ee!==Ye&&pe.value.has(ee)){F(ee);return}if(!ee){I.value=I.value.filter((be,Je)=>Je!==Me),A("update:modelValue",[...I.value]);return}const lt=I.value.map((be,Je)=>Je===Me?ee:be);I.value=lt,A("update:modelValue",[...I.value])}function qe(Me){Me.preventDefault(),!M.disabled&&(Ee(ue.value),ue.value="")}function xe(Me){if(M.disabled)return;const Ye=Me.clipboardData?.getData("text")??"";!Ye.includes(`
118
- `)&&!Ye.includes("\r")||(Me.preventDefault(),De(Ye),ue.value="")}return e.watch(()=>M.modelValue,Me=>{I.value=Array.isArray(Me)?[...Me]:[]},{deep:!0}),e.onBeforeUnmount(()=>{ve&&clearTimeout(ve)}),(Me,Ye)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":Me.disabled}])},[e.createElementVNode("div",L0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(ee,lt)=>(e.openBlock(),e.createElementBlock("span",{key:ee,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":$.value===ee,"dss-pill-field__pill--editing":ct.value===lt}]),style:e.normalizeStyle(ct.value===lt&&we.value?Ce.value:void 0)},[ct.value===lt?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-pill-field__pill-edit-wrap","data-value":Q.value||" "},[e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:be=>G(be,lt),"onUpdate:modelValue":Ye[0]||(Ye[0]=be=>Q.value=be),class:"dss-pill-field__pill-edit",type:"text",disabled:Me.disabled,onKeydown:[e.withKeys(Ze,["enter"]),e.withKeys(W,["esc"])],onBlur:Ze},null,40,T0),[[e.vModelText,Q.value]])],8,A0)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",D0,e.toDisplayString(ee),1),Me.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",H0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:be=>pt(lt,be)},[...Ye[2]||(Ye[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,R0),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:be=>tt(lt)}," × ",8,F0)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Ye[1]||(Ye[1]=ee=>ue.value=ee),class:"dss-pill-field__input",type:"text",placeholder:I.value.length?"":Me.placeholder,disabled:Me.disabled,onPaste:xe,onKeydown:e.withKeys(qe,["enter"])},null,40,I0),[[e.vModelText,ue.value]])])],2))}}),P0={class:"dss-step-bar__header"},O0={class:"dss-step-bar__label"},q0={key:0,class:"dss-step-bar__counter"},W0={class:"dss-step-bar__track-wrapper"},Z0=["aria-valuemax","aria-valuenow","aria-label"],U0=["onMouseenter"],X0={__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:H=>["input","desc","asc"].includes(H)},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(H){const ne=H,M={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"}}},A=se=>se&&typeof se=="object"&&!Array.isArray(se),ue=(se,ge)=>{const He=Object.assign({},se);return!A(se)||!A(ge)||Object.keys(ge).forEach(_e=>{if(A(ge[_e])){_e in se?He[_e]=ue(se[_e],ge[_e]):Object.assign(He,{[_e]:ge[_e]});return}Object.assign(He,{[_e]:ge[_e]})}),He},I=e.computed(()=>ue(M,ne.options)),$=e.computed(()=>Math.max(1,Number(ne.steps)||1)),ve=e.computed(()=>Math.min($.value,Math.max(0,Number(ne.currentStep)||0))),ct=e.computed(()=>Array.isArray(ne.segments)&&ne.segments.length>0),Q=e.computed(()=>{if(!ct.value)return[];const se=ne.segments.map((ge,He)=>{const _e=Number(ge?.value);return{label:ge?.label||`Step ${He+1}`,value:Number.isFinite(_e)&&_e>0?_e:0,color:ge?.color||ne.activeColor,marker:ge?.marker}});return ne.segmentOrder==="desc"?[...se].sort((ge,He)=>He.value-ge.value):ne.segmentOrder==="asc"?[...se].sort((ge,He)=>ge.value-He.value):se}),f=e.computed(()=>ct.value?Q.value.reduce((se,ge)=>se+ge.value,0):ve.value),we=e.computed(()=>ct.value?Number.isFinite(Number(ne.totalValue))&&Number(ne.totalValue)>0?Number(ne.totalValue):Math.max(1,f.value):$.value),Ce=e.computed(()=>ct.value&&Number.isFinite(Number(ne.totalValue))&&Number(ne.totalValue)>0),G=e.computed(()=>Ce.value?Math.max(0,Number(ne.totalValue)-f.value):0),U=e.computed(()=>typeof ne.remainderLabel=="string"&&ne.remainderLabel.trim().length>0),pe=e.computed(()=>G.value>0),F=e.computed(()=>Q.value.reduce((se,ge)=>Math.max(se,Number(ge.value)||0),0)),Ee=e.computed(()=>Q.value.filter(se=>se.value>0).map(se=>`${se.label}: ${Je(se.value)}`).join(" | ")),De=e.computed(()=>ct.value?Ce.value?Q.value.filter(se=>se.value>0):Q.value:[]),tt=e.computed(()=>{if(!ne.counterAsPercentage)return`${f.value} / ${we.value}`;const se=Number(we.value);if(!Number.isFinite(se)||se<=0)return"0%";const ge=Math.round(Number(f.value)/se*100);return`${Math.min(Math.max(ge,0),100)}%`}),pt=e.computed(()=>f.value),W=e.computed(()=>we.value),Ze=e.reactive({visible:!1,x:0,content:""}),qe=e.computed(()=>({left:`${Ze.x}px`})),xe=se=>{const ge=se?.parentElement;return ge?ge.offsetLeft+ge.offsetWidth/2:0},Me=se=>{if(Ce.value){const _e=Math.max(0,Number(se.value)||0);return{flex:`${_e} 0 0`,minWidth:_e>0?"6px":"0",backgroundColor:se.color}}const ge=f.value;return{flex:`${se.value>0?se.value:ge>0?1e-4:1} 0 0`,minWidth:"6px",backgroundColor:se.color}},Ye=se=>Number(se?.value||0)>0&&Number(se?.value||0)===F.value,ee=se=>{const ge=A(se?.marker)?se.marker:{},He=se?.marker===!0||ge.enabled===!0,_e=Ye(se)&&I.value.maxSegment?.marker?.enabled===!0;if(!(He||_e))return{enabled:!1};const bt=ge.backgroundColor??(_e?I.value.maxSegment?.marker?.backgroundColor:I.value.segmentMarker?.backgroundColor),Gt=ge.borderColor??(_e?I.value.maxSegment?.marker?.borderColor:I.value.segmentMarker?.borderColor),Lt=ge.color??(_e?I.value.maxSegment?.marker?.color:I.value.segmentMarker?.color),qt=ge.width??(_e?I.value.maxSegment?.marker?.width:I.value.segmentMarker?.width),K=ge.height??(_e?I.value.maxSegment?.marker?.height:I.value.segmentMarker?.height);return{enabled:!0,backgroundColor:bt,borderColor:Gt,color:Lt,width:qt,height:K,icon:ge.icon??null,...ge}},lt=se=>{const ge=ee(se);return{backgroundColor:ge.backgroundColor??void 0,borderColor:ge.borderColor??void 0,color:ge.color??void 0}},be=se=>{const ge=ee(se);return{width:ge.width??void 0,height:ge.height??void 0}},Je=se=>`${se}${ne.valueLabel}`,ut=e.computed(()=>({flex:`${G.value} 0 0`,minWidth:G.value>0?"6px":"0",backgroundColor:ne.inactiveColor})),Ct=(se,ge)=>{if(!se||!ge?.currentTarget)return;const He=ge.currentTarget;if(ne.remainderTooltipSummary){Ze.x=xe(He),Ze.content=Ee.value,Ze.visible=!!Ze.content;return}Ze.x=He.offsetLeft+He.offsetWidth/2,Ze.content=`${se.label}: ${Je(se.value)}`,Ze.visible=!0},Et=se=>{if(!G.value||!se?.currentTarget)return;const ge=se.currentTarget;if(ne.remainderTooltipSummary){Ze.x=xe(ge),Ze.content=Ee.value,Ze.visible=!!Ze.content;return}Ze.x=ge.offsetLeft+ge.offsetWidth/2,U.value&&(Ze.content=`${ne.remainderLabel}: ${Je(G.value)}`,Ze.visible=!0)},Ht=()=>{Ze.visible=!1},Pt=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}));return(se,ge)=>(e.openBlock(),e.createElementBlock("div",{class:"dss-step-bar",style:e.normalizeStyle(Pt.value)},[e.createElementVNode("div",P0,[e.createElementVNode("span",O0,[e.renderSlot(se.$slots,"label",{label:H.label},()=>[e.createTextVNode(e.toDisplayString(H.label),1)])]),H.showCounter?(e.openBlock(),e.createElementBlock("span",q0,[e.renderSlot(se.$slots,"counter",{counterDisplay:tt.value},()=>[e.createTextVNode(e.toDisplayString(tt.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",W0,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":W.value,"aria-valuenow":pt.value,"aria-label":H.label},[ct.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(De.value,(He,_e)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${_e}-${He.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":Ye(He),"dss-step-bar__segment--marker-enabled":ee(He).enabled}]),style:e.normalizeStyle(Me(He)),onMouseenter:Xt=>Ct(He,Xt),onMouseleave:Ht},[ee(He).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(lt(He)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(be(He))},[e.renderSlot(se.$slots,"segment-marker-icon",{segment:He,index:_e,marker:ee(He)},()=>[e.renderSlot(se.$slots,"max-segment-icon",{segment:He,index:_e,marker:ee(He)},()=>[e.createTextVNode(e.toDisplayString(ee(He).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,U0))),128)),pe.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(ut.value),onMouseenter:ge[0]||(ge[0]=He=>Et(He)),onMouseleave:Ht},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList($.value,He=>(e.openBlock(),e.createElementBlock("div",{key:He,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":He<=ve.value}])},null,2))),128))],8,Z0),Ze.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip",style:e.normalizeStyle(qe.value)},e.toDisplayString(Ze.content),5)):e.createCommentVNode("",!0)])],4))}},Y0={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"}},j0={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"},K0={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"}},G0={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"}},Q0={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"}},no={chart:Y0,table:j0,filter:K0,datepicker:G0,textEditor:Q0},J0={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"}},e9={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"},t9={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"}},l9={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"}},n9={toolbar:{undo:"Annuler",redo:"Rétablir",paragraphFormat:"Format de paragraphe",bold:"Gras",italic:"Italique",underline:"Souligné",citation:"Citation",insertLink:"Insérer un lien",removeLink:"Supprimer le lien",bulletList:"Liste à puces",numberList:"Liste numérotée",image:"Image",comment:"Commentaire",askAi:"Demander à l'IA"},paragraph:{heading1:"En-tête 1",heading2:"En-tête 2",heading3:"En-tête 3",heading4:"En-tête 4",heading5:"En-tête 5",heading6:"En-tête 6",paragraph:"Paragraphe"},link:{editLink:"Modifier le lien",altText:"Texte alternatif :",url:"URL :",enterAltText:"Entrez le texte alternatif...",enterUrl:"Entrez l'URL...",cancel:"Annuler",save:"Enregistrer"},image:{addImage:"Ajouter une image",editImage:"Modifier l'image",upload:"Télécharger",imageLink:"Lien de l'image",uploadImage:"Télécharger l'image :",imageUrl:"URL de l'image :",altText:"Texte alternatif :",width:"Largeur (px) :",height:"Hauteur (px) :",enterAltText:"Entrez le texte alternatif...",enterImageUrl:"https://exemple.com/image.jpg",auto:"Auto",noAlt:"Pas de texte alternatif",cancel:"Annuler",save:"Enregistrer"},comment:{placeholder:"Ajouter un commentaire",send:"Envoyer",delete:"Supprimer le commentaire"},started_conversation:"A démarré la conversation",labels:{title:"Titre",description:"Description"},placeholders:{title:"Entrez le titre...",description:"Entrez la description...",startTyping:"Commencez à taper..."},footer:{word:"mot",words:"mots",character:"caractère",characters:"caractères"}},oo={chart:J0,table:e9,filter:t9,datepicker:l9,textEditor:n9},o9={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"}},a9={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"},s9={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"}},r9={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"}},i9={toolbar:{undo:"Ongedaan maken",redo:"Opnieuw",paragraphFormat:"Alineaopmaak",bold:"Vet",italic:"Cursief",underline:"Onderstreept",citation:"Citaat",insertLink:"Link invoegen",removeLink:"Link verwijderen",bulletList:"Lijst met opsommingstekens",numberList:"Genummerde lijst",image:"Afbeelding",comment:"Commentaar",askAi:"Vraag AI"},paragraph:{heading1:"Kop 1",heading2:"Kop 2",heading3:"Kop 3",heading4:"Kop 4",heading5:"Kop 5",heading6:"Kop 6",paragraph:"Alinea"},link:{editLink:"Link bewerken",altText:"Alt-tekst:",url:"URL:",enterAltText:"Voer alt-tekst in...",enterUrl:"Voer URL in...",cancel:"Annuleren",save:"Opslaan"},image:{addImage:"Afbeelding toevoegen",editImage:"Afbeelding bewerken",upload:"Uploaden",imageLink:"Afbeeldingslink",uploadImage:"Afbeelding uploaden:",imageUrl:"Afbeeldings-URL:",altText:"Alt-tekst:",width:"Breedte (px):",height:"Hoogte (px):",enterAltText:"Voer alt-tekst in...",enterImageUrl:"https://voorbeeld.com/afbeelding.jpg",auto:"Auto",noAlt:"Geen alt-tekst",cancel:"Annuleren",save:"Opslaan"},comment:{placeholder:"Voeg een opmerking toe",send:"Verzenden",delete:"Opmerking verwijderen"},started_conversation:"Gesprek gestart",labels:{title:"Titel",description:"Beschrijving"},placeholders:{title:"Voer titel in...",description:"Voer beschrijving in...",startTyping:"Begin met typen..."},footer:{word:"woord",words:"woorden",character:"teken",characters:"tekens"}},ao={chart:o9,table:a9,filter:s9,datepicker:r9,textEditor:i9},zo={en:no,fr:oo,nl:ao};function ua(H){if(!H||!H.global)return;const ne=H.global.availableLocales||[];Object.keys(zo).forEach(M=>{ne.includes(M)&&H.global.mergeLocaleMessage(M,zo[M])})}const Po={en:{textEditor:no.textEditor},fr:{textEditor:oo.textEditor},nl:{textEditor:ao.textEditor}};function da(H){if(!H||!H.global)return;const ne=H.global.availableLocales||[];Object.keys(Po).forEach(M=>{ne.includes(M)&&H.global.mergeLocaleMessage(M,Po[M])})}const Oo={en:{table:no.table},fr:{table:oo.table},nl:{table:ao.table}};function ma(H){if(!H||!H.global)return;const ne=H.global.availableLocales||[];Object.keys(Oo).forEach(M=>{ne.includes(M)&&H.global.mergeLocaleMessage(M,Oo[M])})}const qo={en:{datepicker:no.datepicker},fr:{datepicker:oo.datepicker},nl:{datepicker:ao.datepicker}};function pa(H){if(!H||!H.global)return;const ne=H.global.availableLocales||[];Object.keys(qo).forEach(M=>{ne.includes(M)&&H.global.mergeLocaleMessage(M,qo[M])})}const Wo={en:{filter:no.filter},fr:{filter:oo.filter},nl:{filter:ao.filter}};function fa(H){if(!H||!H.global)return;const ne=H.global.availableLocales||[];Object.keys(Wo).forEach(M=>{ne.includes(M)&&H.global.mergeLocaleMessage(M,Wo[M])})}const c9={chart:zo,textEditor:Po,table:Oo,datepicker:qo,filter:Wo};function u9(H){!H||!H.global||(ua(H),da(H),ma(H),pa(H),fa(H))}const d9={en:{...no},fr:{...oo},nl:{...ao}};lo.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:d9});exports.DSSChart=cc;exports.DSSChartMessages=zo;exports.DSSColorPicker=Km;exports.DSSConfetti=E2;exports.DSSDatepicker=ta;exports.DSSDatepickerMessages=qo;exports.DSSDnd=w2;exports.DSSFilter=$0;exports.DSSFilterMessages=Wo;exports.DSSLoader=c2;exports.DSSMessages=c9;exports.DSSModal=ea;exports.DSSPillField=z0;exports.DSSSkeleton=u2;exports.DSSStepBar=X0;exports.DSSTable=$u;exports.DSSTableMessages=Oo;exports.DSSTextEditor=Tm;exports.DSSTextEditorMessages=Po;exports.addDSSChartTranslations=ua;exports.addDSSDatepickerTranslations=pa;exports.addDSSFilterTranslations=fa;exports.addDSSTableTranslations=ma;exports.addDSSTextEditorTranslations=da;exports.addDSSTranslations=u9;
117
+ `,document.body.appendChild(Je),Se=Je}function ot(K,ye){Se&&(Se.style.left=`${K-nt}px`,Se.style.top=`${ye-mt}px`)}function be(K){K.classList.add("dss-dnd-item--dragging"),K.style.background=ve.value.dragSourceBackground,K.style.borderColor=ve.value.dragSourceBorder,K.style.transform="scale(0.97)"}function tt(K){K.classList.remove("dss-dnd-item--dragging"),K.style.background="",K.style.borderColor="",K.style.transform=""}function dt(K,ye){return document.elementFromPoint(K,ye)?.closest(".dss-dnd-column-body")??null}function kt(K,ye){return!!document.elementFromPoint(K,ye)?.closest("[data-dss-dnd-delete-zone]")}function wt(K,ye){if(I.value&&kt(K,ye)){Ce.value=!0,xe.value=null,G.value=-1;return}Ce.value=!1;const Be=dt(K,ye),Ue=Be?.getAttribute("data-column")??null;if(!Ue){xe.value=null,G.value=-1;return}xe.value=Ue;const Je=Be.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Lt=Je.length;for(let lt=0;lt<Je.length;lt++){const Pt=Je[lt].getBoundingClientRect();if(ye<Pt.top+Pt.height/2){Lt=lt;break}}G.value=Lt}function Dt(K){K.preventDefault(),ot(K.clientX,K.clientY),!me&&(me=requestAnimationFrame(()=>{me=null,wt(K.clientX,K.clientY)}))}function Ft(K){window.removeEventListener("pointermove",Dt),window.removeEventListener("pointerup",Ft),window.removeEventListener("pointercancel",Ft),Te?.releasePointerCapture?.(K.pointerId),tt(Te),Te=null;const ye=I.value&&kt(K.clientX,K.clientY);if(f.value&&ye)A("delete",{item:f.value});else{const Ue=dt(K.clientX,K.clientY)?.getAttribute("data-column")??null;if(f.value&&Ue){const Je=f.value[_.columnKey],Lt=Ue,Pt=(Ee.value[Lt]||[]).filter(pt=>pt[_.itemKey]!==f.value[_.itemKey]),We=Math.max(0,Math.min(G.value,Pt.length)),Re=Ye(Lt,We),bt=f.value[_.itemKey];A("move",{item:f.value,from:Je,to:Lt,position:Re,index:We}),F&&clearTimeout(F),U.value={id:bt,from:Je,to:Lt},F=setTimeout(()=>{U.value=null},3500)}}Se&&(Se.remove(),Se=null),W!==null&&(document.body.style.cursor=W,W=""),Wt()}function se(K,ye){K.preventDefault();const Be=K.target.closest(".dss-dnd-item");if(!Be)return;const Ue=Be.getBoundingClientRect();nt=K.clientX-Ue.left,mt=K.clientY-Ue.top,W=document.body.style.cursor,document.body.style.cursor="grabbing",f.value=ye,Te=Be,ee(Be,K.clientX,K.clientY),requestAnimationFrame(()=>be(Be)),Be.setPointerCapture?.(K.pointerId),window.addEventListener("pointermove",Dt),window.addEventListener("pointerup",Ft,{once:!0}),window.addEventListener("pointercancel",Ft,{once:!0})}function pe(){Ze&&(window.removeEventListener("pointermove",De),window.removeEventListener("pointerup",_e),window.removeEventListener("pointercancel",_e),Ze=null)}function De(K){if(!Ze||K.pointerId!==Ze.pointerId)return;const ye=K.clientX-Ze.startX,Be=K.clientY-Ze.startY;if(Math.abs(ye)>=qe||Math.abs(Be)>=qe){const Ue=Ze.item;pe(),se(K,Ue)}}function _e(K){!Ze||K.pointerId!==Ze.pointerId||pe()}function jt(K,ye){pe(),Ze={item:ye,startX:K.clientX,startY:K.clientY,pointerId:K.pointerId},window.addEventListener("pointermove",De),window.addEventListener("pointerup",_e),window.addEventListener("pointercancel",_e)}function Ct(K,ye){ve.value.useHandle||jt(K,ye)}function Gt(K,ye){jt(K,ye)}function $t(){me&&(cancelAnimationFrame(me),me=null)}function Wt(){$t(),f.value=null,xe.value=null,Ce.value=!1,G.value=-1}return e.onBeforeUnmount(()=>{$t(),pe(),F&&clearTimeout(F),Se&&(Se.remove(),Se=null)}),(K,ye)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":ve.value.unstyled}]),style:e.normalizeStyle(ut.value)},[I.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(K.$slots,"delete-zone",{isDragging:!!f.value,isOver:Ce.value})],2),[[e.vShow,!!f.value||ve.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":xe.value==Be.value},Be.class||""]]),style:e.normalizeStyle(Q(Be))},[ve.value.showHeader?(e.openBlock(),e.createElementBlock("div",m2,[e.renderSlot(K.$slots,"column-header",{column:Be,items:Ee.value[Be.value]||[]},()=>[e.createElementVNode("span",p2,e.toDisplayString(Be.title||Be.value),1),e.createElementVNode("span",f2,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(Me.value[Be.value],Ue=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Ue.key},[Ue.type==="indicator"?(e.openBlock(),e.createElementBlock("div",g2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Ue.isDragged,"dss-dnd-item--no-handle":!ve.value.useHandle}]),onPointerdown:Je=>Ct(Je,Ue.item)},[ve.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Je=>Gt(Je,Ue.item),["stop"])},[e.renderSlot(K.$slots,"handle",{},()=>[ye[0]||(ye[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,y2)):e.createCommentVNode("",!0),e.createElementVNode("div",k2,[e.renderSlot(K.$slots,"item",{item:Ue.item,column:Be,justDropped:U.value?.id===Ue.item[L.itemKey],droppedFrom:U.value?.id===Ue.item[L.itemKey]?U.value.from:null,droppedTo:U.value?.id===Ue.item[L.itemKey]?U.value.to:null},()=>[e.createElementVNode("div",C2,e.toDisplayString(Ue.item[L.itemKey]),1)])])],42,h2))],64))),128)),(Ee.value[Be.value]||[]).length===0&&xe.value!=Be.value?(e.openBlock(),e.createElementBlock("div",b2,[e.renderSlot(K.$slots,"empty",{column:Be},()=>[ye[1]||(ye[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,v2)],6))),128))],6))}}),E2={name:"DSSConfetti"},S2=Object.assign(E2,{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 oe=L,_=e.ref(null),A=e.ref(!1);let ce=[],I=null,B=null;function ve(G,U){const me=[];for(let F=0;F<oe.count;F++)me.push(ut(G));return me}function ut(G,U){return{x:Math.random()*G,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:oe.colors[Math.floor(Math.random()*oe.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 Q(G,U,me,F){G.clearRect(0,0,U,me);for(const Se of ce)G.save(),G.globalAlpha=Se.opacity*F,G.beginPath(),G.lineWidth=Se.r,G.strokeStyle=Se.color,G.moveTo(Se.x+Se.tilt+Se.r/2,Se.y),G.lineTo(Se.x+Se.tilt,Se.y+Se.tilt+Se.r/2),G.stroke(),G.restore()}function f(G,U,me){const F=.3+me*.7;for(let Se=0;Se<ce.length;Se++){const Te=ce[Se];Te.tiltAngle+=Te.tiltInc,Te.y+=Te.speed*F,Te.x+=Math.sin(Te.d)*.5*F,Te.tilt=Math.sin(Te.tiltAngle)*15,me>=.99&&Te.y>U+20&&(ce[Se]=ut(G))}}function xe(){A.value=!0,e.nextTick(()=>{const G=_.value;if(!G)return;const U=G.getContext("2d"),me=G.parentElement;if(!me)return;const F=me.getBoundingClientRect();G.width=F.width,G.height=F.height,ce=ve(G.width,G.height);const Se=Date.now(),Te=Se+oe.duration,nt=()=>{const mt=Date.now(),W=mt-Se;if(mt<Te){let Ze=1;W>oe.fadeStart&&(Ze=1-(W-oe.fadeStart)/(oe.duration-oe.fadeStart)),Q(U,G.width,G.height,Ze),f(G.width,G.height,Ze),I=requestAnimationFrame(nt)}else Ce()};nt()})}function Ce(){I&&(cancelAnimationFrame(I),I=null),ce=[],A.value=!1}return e.watch(()=>oe.trigger,G=>{G&&(B&&clearTimeout(B),B=setTimeout(xe,oe.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{Ce(),B&&clearTimeout(B)}),(G,U)=>A.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:_,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),V2={class:"dss-filter-global-inner"},N2=["placeholder","value"],B2=["title"],M2={key:0,class:"dss-filter-funnel-badge"},_2={key:1,class:"dss-filter-sortby"},$2=["value"],L2=["value"],A2=["disabled","title"],T2={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"},D2={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"},H2={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"},R2={class:"dss-filter-panel"},F2={key:0,class:"dss-filter-empty"},I2={class:"dss-filter-row-prefix"},z2={class:"dss-filter-cell"},P2=["onClick"],O2={class:"dss-filter-trigger-text"},q2=["placeholder"],W2={class:"dss-filter-popup-list"},Z2=["onClick"],U2={key:0,class:"dss-filter-popup-empty"},X2={key:0,class:"dss-filter-cell"},Y2=["onClick"],j2={class:"dss-filter-trigger-text"},K2={class:"dss-filter-popup-list"},G2=["onClick"],Q2={key:1,class:"dss-filter-cell dss-filter-cell--value"},J2=["placeholder","onUpdate:modelValue"],e0={key:1,class:"dss-filter-date-wrap"},t0=["placeholder","onUpdate:modelValue"],l0=["placeholder","value","onInput","step"],n0={key:4,class:"dss-filter-between"},o0=["placeholder","value","onInput","step"],a0={class:"dss-filter-between-sep"},s0=["placeholder","value","onInput","step"],r0={key:5,class:"dss-filter-multiselect"},i0=["onClick"],c0={class:"dss-filter-trigger-text"},u0=["placeholder"],d0={class:"dss-filter-popup-list dss-filter-popup-list--check"},m0=["onClick"],p0=["checked"],f0={key:0,class:"dss-filter-popup-empty"},v0=["onClick"],g0={class:"dss-filter-foot"},h0={class:"dss-filter-cell"},y0=["placeholder"],k0={class:"dss-filter-popup-list"},C0=["onClick"],b0={key:0,class:"dss-filter-popup-divider"},w0=["onClick"],x0=["placeholder"],E0={class:"dss-filter-popup-list"},S0=["onClick"],V0={key:0,class:"dss-filter-popup-empty"},N0=["placeholder"],B0={class:"dss-filter-popup-list"},M0=["onClick"],_0={key:0,class:"dss-filter-popup-empty"},$0={name:"DSSFilter"},L0=Object.assign($0,{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:oe,emit:_}){const{t:A}=so.useI18n(),ce=L,I=_,B={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},ve=e.computed(()=>({...B,...ce.options})),ut={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"}]},Q=new Set(["is_empty","is_not_empty","is_true","is_false"]),f=["label","name","title","keyword","full_name","value","text"],xe=e.ref(""),Ce=e.ref([]),G=e.ref(null),U=e.ref(!1),me=e.ref(null),F=e.ref(""),Se=e.ref(null),Te=e.ref(""),nt=e.ref("asc");let mt=1;function W(S){const C=S.find(V=>V&&typeof V=="object");if(!C)return null;for(const V of f)if(V in C&&typeof C[V]=="string")return V;return Object.keys(C).find(V=>typeof C[V]=="string")||null}function Ze(S,C){const V=C.filter(Y=>Y!=null&&Y!=="NULL");if(V.length===0)return null;if(V.every(Y=>Array.isArray(Y))){const Y=V.flatMap(ze=>ze).filter(ze=>ze!=null);return Y.length===0?null:typeof Y.find(ze=>ze!=null)=="object"?"arraySelect":"arrayText"}return V.every(Y=>typeof Y=="boolean")?"boolean":V.every(Y=>typeof Y=="number")?new Set(V).size<=ve.value.maxUniqueForEnum?"select":"range":V.every(Y=>typeof Y=="string")?new Set(V).size<=ve.value.maxUniqueForSelect?"select":"text":V.some(Y=>typeof Y=="object"&&!Array.isArray(Y))?null:"text"}const qe=e.computed(()=>{if(!ce.data?.length)return[];const S=new Set;for(const le of ce.data)if(le&&typeof le=="object")for(const ze of Object.keys(le))S.add(ze);const C=new Set(ce.exclude),V=[];for(const le of S){if(C.has(le))continue;const ze=ce.config[le]||{},ft=ce.data.map(vt=>vt?.[le]),st=ze.type||Ze(le,ft);if(!st)continue;const Oe=ze.filterMode||"contain",Vt=Oe==="date"?"date":Oe==="string"?"text":st,Et={key:le,label:ze.label||xt(le),type:Vt,filterMode:Oe};if(st==="select"){const vt=ft.filter(at=>at!=null&&at!=="NULL");Et.uniqueValues=[...new Set(vt)].sort((at,Nt)=>typeof at=="number"&&typeof Nt=="number"?at-Nt:String(at).localeCompare(String(Nt)))}else if(st==="range"||st==="int"){const vt=ft.filter(at=>typeof at=="number");Et.min=Math.min(...vt),Et.max=Math.max(...vt)}else if(st==="arraySelect"){const vt=ze.displayKey||W(ft.flatMap(at=>Array.isArray(at)?at:[]));if(Et.displayKey=vt,Array.isArray(ze.uniqueValues)&&ze.uniqueValues.length>0)Et.uniqueValues=ze.uniqueValues.map(at=>String(at));else{const at=ft.flatMap(Nt=>Array.isArray(Nt)?Nt:[]).filter(Nt=>Nt!=null).map(Nt=>vt&&typeof Nt=="object"?Nt[vt]:String(Nt)).filter(Nt=>Nt!=null&&Nt!=="");Et.uniqueValues=[...new Set(at)].sort((Nt,Bt)=>String(Nt).localeCompare(String(Bt)))}}V.push(Et)}const Y=ce.config._order;return Y&&V.sort((le,ze)=>{const ft=Y.indexOf(le.key),st=Y.indexOf(ze.key);return ft===-1&&st===-1?0:ft===-1?1:st===-1?-1:ft-st}),V}),Ee=e.computed(()=>{const S={};for(const C of qe.value)S[C.key]=C;return S}),Me=e.computed(()=>Array.isArray(ce.config.groups)&&ce.config.groups.length>0),Ye=e.computed(()=>{if(!Me.value)return[];const S=new Set(qe.value.map(C=>C.key));return ce.config.groups.map(C=>({...C,keys:C.keys.filter(V=>S.has(V))})).filter(C=>C.keys.length>0)}),ee=e.computed(()=>{if(!Me.value)return[];const S=new Set(ce.config.groups.flatMap(C=>C.keys));return qe.value.filter(C=>!S.has(C.key))}),ot=e.computed(()=>{if(!Se.value)return[];const S=new Set(Se.value.keys),C=qe.value.filter(Y=>S.has(Y.key));if(!F.value)return C;const V=F.value.toLowerCase();return C.filter(Y=>Y.label.toLowerCase().includes(V))}),be=e.computed(()=>{if(!F.value)return qe.value;const S=F.value.toLowerCase();return qe.value.filter(C=>C.label.toLowerCase().includes(S))}),tt=e.computed(()=>qe.value.filter(S=>!["arraySelect","arrayText"].includes(S.type))),dt=e.computed(()=>Te.value?nt.value==="asc"?"Ascending":"Descending":"No sort selected");function kt(S){G.value===S?wt():(G.value=S,F.value="",Se.value=null)}function wt(){G.value=null,F.value="",Se.value=null}function Dt(S){const C=S.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");G.value&&!C&&!S.target.closest(".dss-filter-popup")&&!S.target.closest(".dss-filter-trigger")&&!S.target.closest(".dss-filter-add-btn")&&wt(),U.value&&me.value&&!me.value.contains(S.target)&&(C||(U.value=!1))}e.onMounted(()=>document.addEventListener("click",Dt)),e.onBeforeUnmount(()=>document.removeEventListener("click",Dt));function Ft(S){return Ee.value[S]?.label||xt(S)}function se(S){return Ee.value[S.key]?.filterMode||"contain"}function pe(S){return A(`filter.operators.${S}`)}function De(S){const C=Ee.value[S.key];return(ut[C?.type]||ut.text).map(V=>({...V,label:A(`filter.operators.${V.value}`)}))}function _e(S){return Q.has(S)}function jt(S){const C=Ee.value[S.key];return C?C.type==="date"?"date":C.type==="boolean"?"boolean":C.type==="text"||C.type==="arrayText"?"text":C.type==="select"||C.type==="arraySelect"?"multiselect":C.type==="range"||C.type==="int"?S.operator==="between"?"between":"number":"text":"text"}function Ct(S){return ut[S]?.[0]?.value||"contains"}function Gt(S,C){return Q.has(C)||S==="date"?null:S==="select"||S==="arraySelect"?[]:(S==="range"||S==="int")&&C==="between"?{min:null,max:null}:S==="range"||S==="int"?null:""}function $t(S){return Ee.value[S.key]?.uniqueValues||[]}function Wt(S){const C=$t(S);if(!F.value)return C;const V=F.value.toLowerCase();return C.filter(Y=>String(Y).toLowerCase().includes(V))}function K(S){const C=S.value;return!C||C.length===0?A("filter.select"):C.length<=2?C.join(", "):A("filter.selectedCount",{count:C.length})}function ye(S){const C=Ee.value[S],V=C?.filterMode||"contain",Y=C?.type||"text",le=V==="string"?"contains":Ct(Y);Ce.value.push(e.reactive({id:mt++,key:S,operator:le,value:Gt(Y,le)})),wt()}function Be(S){Ce.value=Ce.value.filter(C=>C.id!==S)}function Ue(S,C){const Y=Ee.value[C]?.type||"text";S.key=C,S.operator=Ct(Y),S.value=Gt(Y,S.operator),wt()}function Je(S,C){const V=jt(S);S.operator=C;const Y=jt(S);if(V!==Y||Q.has(C)){const le=Ee.value[S.key];S.value=Gt(le?.type||"text",C)}wt()}function Lt(S,C){const V=C.target.value;S.value=V===""?null:Number(V)}function lt(S,C,V){const Y=V.target.value,le=Y===""?null:Number(Y);(!S.value||typeof S.value!="object")&&(S.value={min:null,max:null}),S.value={...S.value,[C]:isNaN(le)?null:le}}function Pt(S,C){const V=S.value||[],Y=V.indexOf(C);S.value=Y>=0?V.filter(le=>le!==C):[...V,C]}function We(){Ce.value=[],xe.value="",wt()}function Re(S){xe.value=S.target.value}function bt(S){Te.value=S.target.value}function pt(){nt.value=nt.value==="asc"?"desc":"asc"}const J=e.computed(()=>{if(!ce.data)return[];let S=ce.data;if(xe.value){const C=xe.value.toLowerCase();S=S.filter(V=>{for(const Y of Object.keys(V)){const le=V[Y];if(typeof le=="string"&&le.toLowerCase().includes(C)||typeof le=="number"&&String(le).includes(C)||Array.isArray(le)&&le.some(ze=>ze!=null&&(typeof ze=="string"?ze.toLowerCase().includes(C):typeof ze=="object"?Object.values(ze).some(ft=>typeof ft=="string"&&ft.toLowerCase().includes(C)):!1)))return!0}return!1})}for(const C of Ce.value){if(!re(C))continue;const V=Ee.value[C.key];V&&(S=S.filter(Y=>fe(Y,C,V)))}if(ce.showSortBy&&Te.value){const C=Te.value,V=nt.value==="asc"?1:-1;S=[...S].sort((Y,le)=>Z(Y?.[C],le?.[C])*V)}return S});function Z(S,C){const V=X(S),Y=X(C);return V==null&&Y==null?0:V==null?1:Y==null?-1:typeof V=="number"&&typeof Y=="number"?V-Y:String(V).localeCompare(String(Y),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 re(S){return Q.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 fe(S,C,V){const Y=S?.[C.key],le=C.value,ze=C.operator;if(ze==="is_empty")return il(Y);if(ze==="is_not_empty")return!il(Y);const ft=V.type;if(ft==="text"||ft==="arrayText"){const st=ft==="arrayText"&&Array.isArray(Y)?Y.filter(Et=>Et!=null).map(String).join(" "):Y!=null?String(Y):"",Oe=String(le).toLowerCase(),Vt=st.toLowerCase();switch(ze){case"contains":return Vt.includes(Oe);case"not_contains":return!Vt.includes(Oe);case"equals":return Vt===Oe;case"not_equals":return Vt!==Oe;case"starts_with":return Vt.startsWith(Oe);case"ends_with":return Vt.endsWith(Oe);default:return!0}}if(ft==="select")switch(ze){case"is_any_of":return le.includes(Y);case"is_none_of":return!le.includes(Y);default:return!0}if(ft==="range"||ft==="int"){const st=typeof Y=="number"?Y:Number(Y);if(typeof st!="number"||isNaN(st))return!1;if(ze==="between"){const Vt=le?.min!=null?Number(le.min):null,Et=le?.max!=null?Number(le.max):null,vt=Vt!=null&&!isNaN(Vt)?Vt:null,at=Et!=null&&!isNaN(Et)?Et:null;return(vt==null||st>=vt)&&(at==null||st<=at)}const Oe=typeof le=="number"&&!isNaN(le)?le:Number(le);if(ze==="contains"||ze==="not_contains"){const Vt=String(st),Et=String(le??"").toLowerCase(),vt=Vt.toLowerCase().includes(Et);return ze==="contains"?vt:!vt}if(typeof Oe!="number"||isNaN(Oe))return!1;switch(ze){case"eq":return st===Oe;case"neq":return st!==Oe;case"gt":return st>Oe;case"gte":return st>=Oe;case"lt":return st<Oe;case"lte":return st<=Oe;default:return!0}}if(ft==="arraySelect"){if(!Array.isArray(Y))return!1;const st=Y.filter(Oe=>Oe!=null).map(Oe=>V.displayKey&&typeof Oe=="object"?Oe[V.displayKey]:String(Oe));switch(ze){case"contains_any":return st.some(Oe=>le.includes(Oe));case"contains_all":return le.every(Oe=>st.includes(Oe));case"not_contains_any":return!st.some(Oe=>le.includes(Oe));default:return!0}}if(ft==="date"){const st=et(le);if(!st||isNaN(st.getTime()))return!1;const Oe=et(Y);if(!Oe||isNaN(Oe.getTime()))return!1;const Vt=St(Oe),Et=St(st);switch(ze){case"eq":return Vt===Et;case"before":return Vt<Et;case"after":return Vt>Et;default:return!0}}if(ft==="boolean"){const st=Y===!0||Y==="true"||Y===1,Oe=Y===!1||Y==="false"||Y===0;switch(ze){case"is_true":return st;case"is_false":return Oe;default:return!0}}return!0}function et(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 C=new Date(S);return isNaN(C.getTime())?null:C}return null}function St(S){const C=S.getFullYear(),V=String(S.getMonth()+1).padStart(2,"0"),Y=String(S.getDate()).padStart(2,"0");return`${C}-${V}-${Y}`}function il(S){return!!(S==null||S===""||S==="NULL"||Array.isArray(S)&&S.length===0||Array.isArray(S)&&S.every(C=>C==null))}e.watch(J,S=>I("update:modelValue",S),{immediate:!0}),e.watch(()=>ce.data,()=>{Ce.value=[],xe.value="",U.value=!1,Te.value="",nt.value="asc",wt()});function xt(S){return S.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,C=>C.toUpperCase())}function tl(){const S=C=>{if(C==null)return C;if(C instanceof Date)return{_type:"Date",value:C.toISOString(),local:C.toLocaleDateString()};if(Array.isArray(C))return C.map(S);if(typeof C=="object"&&!Array.isArray(C)){const V={};for(const Y of Object.keys(C))V[Y]=S(C[Y]);return V}return C};return{globalSearch:xe.value,rows:Ce.value.map(C=>({key:C.key,operator:C.operator,value:S(C.value),defType:Ee.value[C.key]?.type,defFilterMode:Ee.value[C.key]?.filterMode})),filteredCount:J.value?.length??0}}return oe({getDebugState:tl}),(S,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":ve.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:me},[e.createElementVNode("div",V2,[C[20]||(C[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref(A)("filter.searchAcrossFields"),value:xe.value,onInput:Re},null,40,N2),xe.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:C[0]||(C[0]=V=>xe.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:U.value||Ce.value.length>0,"dss-filter-funnel-btn--with-sort":ce.showSortBy}]),onClick:C[1]||(C[1]=V=>U.value=!U.value),type:"button",title:U.value?e.unref(A)("filter.closeAdvancedFilter"):e.unref(A)("filter.openAdvancedFilter")},[C[14]||(C[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),Ce.value.length>0?(e.openBlock(),e.createElementBlock("span",M2,e.toDisplayString(Ce.value.length),1)):e.createCommentVNode("",!0)],10,B2),ce.showSortBy?(e.openBlock(),e.createElementBlock("div",_2,[C[19]||(C[19]=e.createElementVNode("label",{class:"dss-filter-sortby-label",for:"dss-filter-sort-select"},"Sort by",-1)),e.createElementVNode("select",{id:"dss-filter-sort-select",class:"dss-filter-sortby-select",value:Te.value,onChange:bt},[C[15]||(C[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tt.value,V=>(e.openBlock(),e.createElementBlock("option",{key:V.key,value:V.key},e.toDisplayString(V.label),9,L2))),128))],40,$2),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:pt,disabled:!Te.value,title:dt.value},[Te.value?nt.value==="asc"?(e.openBlock(),e.createElementBlock("svg",D2,[...C[17]||(C[17]=[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",H2,[...C[18]||(C[18]=[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",T2,[...C[16]||(C[16]=[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"currentColor"},null,-1)])]))],8,A2)])):e.createCommentVNode("",!0)]),U.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:C[13]||(C[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",R2,[Ce.value.length===0?(e.openBlock(),e.createElementBlock("div",F2,e.toDisplayString(e.unref(A)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(V,Y)=>(e.openBlock(),e.createElementBlock("div",{key:V.id,class:"dss-filter-row"},[e.createElementVNode("span",I2,e.toDisplayString(Y===0?e.unref(A)("filter.where"):e.unref(A)("filter.and")),1),e.createElementVNode("div",z2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(le=>kt(`${V.id}:field`),["stop"])},[e.createElementVNode("span",O2,e.toDisplayString(Ft(V.key)),1),C[21]||(C[21]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,P2),G.value===`${V.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[3]||(C[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[2]||(C[2]=le=>F.value=le),placeholder:e.unref(A)("filter.searchAttributes")},null,8,q2),[[e.vModelText,F.value]]),e.createElementVNode("ul",W2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.value,le=>(e.openBlock(),e.createElementBlock("li",{key:le.key,class:"dss-filter-popup-item",onClick:ze=>Ue(V,le.key)},e.toDisplayString(le.label),9,Z2))),128)),be.value.length===0?(e.openBlock(),e.createElementBlock("li",U2,e.toDisplayString(e.unref(A)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),se(V)==="contain"||se(V)==="date"?(e.openBlock(),e.createElementBlock("div",X2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(le=>kt(`${V.id}:op`),["stop"])},[e.createElementVNode("span",j2,e.toDisplayString(pe(V.operator)),1),C[22]||(C[22]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,Y2),G.value===`${V.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[4]||(C[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",K2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(De(V),le=>(e.openBlock(),e.createElementBlock("li",{key:le.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:V.operator===le.value}]),onClick:ze=>Je(V,le.value)},e.toDisplayString(le.label),11,G2))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_e(V.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Q2,[se(V)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(A)("filter.enterValue"),"onUpdate:modelValue":le=>V.value=le},null,8,J2)),[[e.vModelText,V.value]]):se(V)==="date"?(e.openBlock(),e.createElementBlock("div",e0,[e.createVNode(na,{mode:"single",modelValue:V.value,"onUpdate:modelValue":le=>V.value=le},null,8,["modelValue","onUpdate:modelValue"])])):jt(V)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(A)("filter.enterValue"),"onUpdate:modelValue":le=>V.value=le},null,8,t0)),[[e.vModelText,V.value]]):jt(V)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(A)("filter.enterValue"),value:V.value,onInput:le=>Lt(V,le),step:Ee.value[V.key]?.type==="int"?1:void 0},null,40,l0)):jt(V)==="between"?(e.openBlock(),e.createElementBlock("div",n0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(A)("filter.min"),value:V.value?.min,onInput:le=>lt(V,"min",le),step:Ee.value[V.key]?.type==="int"?1:void 0},null,40,o0),e.createElementVNode("span",a0,e.toDisplayString(e.unref(A)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(A)("filter.max"),value:V.value?.max,onInput:le=>lt(V,"max",le),step:Ee.value[V.key]?.type==="int"?1:void 0},null,40,s0)])):jt(V)==="multiselect"?(e.openBlock(),e.createElementBlock("div",r0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(le=>kt(`${V.id}:val`),["stop"])},[e.createElementVNode("span",c0,e.toDisplayString(K(V)),1),C[23]||(C[23]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,i0),G.value===`${V.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:C[6]||(C[6]=e.withModifiers(()=>{},["stop"]))},[$t(V).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[5]||(C[5]=le=>F.value=le),placeholder:e.unref(A)("filter.search")},null,8,u0)),[[e.vModelText,F.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",d0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wt(V),le=>(e.openBlock(),e.createElementBlock("li",{key:le,class:"dss-filter-popup-item",onClick:ze=>Pt(V,le)},[e.createElementVNode("input",{type:"checkbox",checked:(V.value||[]).includes(le),tabindex:"-1"},null,8,p0),e.createElementVNode("span",null,e.toDisplayString(le),1)],8,m0))),128)),Wt(V).length===0?(e.openBlock(),e.createElementBlock("li",f0,e.toDisplayString(e.unref(A)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:le=>Be(V.id)},[...C[24]||(C[24]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,v0)]))),128)),e.createElementVNode("div",g0,[e.createElementVNode("div",h0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:C[7]||(C[7]=e.withModifiers(V=>kt("add"),["stop"]))},e.toDisplayString(e.unref(A)("filter.addFilter")),1),G.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:C[12]||(C[12]=e.withModifiers(()=>{},["stop"]))},[Me.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":C[8]||(C[8]=V=>F.value=V),placeholder:e.unref(A)("filter.searchAttributes")},null,8,y0),[[e.vModelText,F.value]]),e.createElementVNode("ul",k0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:Y=>Se.value=V},[e.createElementVNode("span",null,e.toDisplayString(V.label),1),C[25]||(C[25]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,C0))),128)),ee.value.length>0?(e.openBlock(),e.createElementBlock("li",b0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:Y=>ye(V.key)},e.toDisplayString(V.label),9,w0))),128))])],64)):Se.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:C[9]||(C[9]=V=>Se.value=null)},[C[26]||(C[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(Se.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[10]||(C[10]=V=>F.value=V),placeholder:e.unref(A)("filter.searchAttributes")},null,8,x0),[[e.vModelText,F.value]]),e.createElementVNode("ul",E0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:Y=>ye(V.key)},e.toDisplayString(V.label),9,S0))),128)),ot.value.length===0?(e.openBlock(),e.createElementBlock("li",V0,e.toDisplayString(e.unref(A)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":C[11]||(C[11]=V=>F.value=V),placeholder:e.unref(A)("filter.searchAttributes")},null,8,N0),[[e.vModelText,F.value]]),e.createElementVNode("ul",B0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:Y=>ye(V.key)},e.toDisplayString(V.label),9,M0))),128)),be.value.length===0?(e.openBlock(),e.createElementBlock("li",_0,e.toDisplayString(e.unref(A)("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:We},e.toDisplayString(e.unref(A)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),A0={class:"dss-pill-field__pills"},T0=["data-value"],D0=["disabled"],H0={class:"dss-pill-field__pill-text"},R0={key:0,class:"dss-pill-field__pill-actions"},F0=["onClick"],I0=["onClick"],z0=["placeholder","disabled"],P0=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(L,{emit:oe}){const _=L,A=oe,ce=e.ref(""),I=e.ref([..._.modelValue]),B=e.ref(null);let ve=null;const ut=e.ref(null),Q=e.ref(""),f=e.ref(null),xe=e.ref(null),Ce=e.computed(()=>{if(!xe.value)return;const{width:Me,height:Ye}=xe.value;return{minWidth:`${Me}px`,height:`${Ye}px`}});function G(Me,Ye){ut.value===Ye&&(f.value=Me)}function U(){ut.value=null,Q.value="",xe.value=null,f.value=null}const me=e.computed(()=>new Set(I.value.map(Me=>Me.trim()).filter(Boolean)));function F(Me){B.value=Me,ve&&clearTimeout(ve),ve=setTimeout(()=>{B.value=null,ve=null},900)}function Se(Me){const Ye=Me.trim();return Ye?me.value.has(Ye)?(F(Ye),!1):(I.value=[...I.value,Ye],A("update:modelValue",[...I.value]),!0):!1}function Te(Me){const Ye=Me.split(/\r?\n/g).map(tt=>tt.trim()).filter(Boolean);if(!Ye.length)return;const ee=new Set(I.value.map(tt=>tt.trim()).filter(Boolean)),ot=[...I.value];let be=null;for(const tt of Ye){if(ee.has(tt)){be??=tt;continue}ee.add(tt),ot.push(tt)}ot.length!==I.value.length&&(I.value=ot,A("update:modelValue",[...I.value])),be&&F(be)}function nt(Me){_.disabled||(ut.value===Me&&U(),I.value=I.value.filter((Ye,ee)=>ee!==Me),A("update:modelValue",[...I.value]))}async function mt(Me,Ye){if(_.disabled)return;const ee=Ye.currentTarget.closest(".dss-pill-field__pill");ee&&(xe.value={width:ee.offsetWidth,height:ee.offsetHeight}),ut.value=Me,Q.value=I.value[Me]??"",await e.nextTick();const ot=f.value;if(!ot)return;ot.focus();const be=ot.value.length;ot.setSelectionRange(be,be)}function W(){U()}function Ze(){if(_.disabled||ut.value===null)return;const Me=ut.value,Ye=I.value[Me]??"",ee=Q.value.trim();if(U(),ee!==Ye&&me.value.has(ee)){F(ee);return}if(!ee){I.value=I.value.filter((be,tt)=>tt!==Me),A("update:modelValue",[...I.value]);return}const ot=I.value.map((be,tt)=>tt===Me?ee:be);I.value=ot,A("update:modelValue",[...I.value])}function qe(Me){Me.preventDefault(),!_.disabled&&(Se(ce.value),ce.value="")}function Ee(Me){if(_.disabled)return;const Ye=Me.clipboardData?.getData("text")??"";!Ye.includes(`
118
+ `)&&!Ye.includes("\r")||(Me.preventDefault(),Te(Ye),ce.value="")}return e.watch(()=>_.modelValue,Me=>{I.value=Array.isArray(Me)?[...Me]:[]},{deep:!0}),e.onBeforeUnmount(()=>{ve&&clearTimeout(ve)}),(Me,Ye)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":Me.disabled}])},[e.createElementVNode("div",A0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(ee,ot)=>(e.openBlock(),e.createElementBlock("span",{key:ee,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":B.value===ee,"dss-pill-field__pill--editing":ut.value===ot}]),style:e.normalizeStyle(ut.value===ot&&xe.value?Ce.value:void 0)},[ut.value===ot?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-pill-field__pill-edit-wrap","data-value":Q.value||" "},[e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:be=>G(be,ot),"onUpdate:modelValue":Ye[0]||(Ye[0]=be=>Q.value=be),class:"dss-pill-field__pill-edit",type:"text",disabled:Me.disabled,onKeydown:[e.withKeys(Ze,["enter"]),e.withKeys(W,["esc"])],onBlur:Ze},null,40,D0),[[e.vModelText,Q.value]])],8,T0)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",H0,e.toDisplayString(ee),1),Me.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",R0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:be=>mt(ot,be)},[...Ye[2]||(Ye[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,F0),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:be=>nt(ot)}," × ",8,I0)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Ye[1]||(Ye[1]=ee=>ce.value=ee),class:"dss-pill-field__input",type:"text",placeholder:I.value.length?"":Me.placeholder,disabled:Me.disabled,onPaste:Ee,onKeydown:e.withKeys(qe,["enter"])},null,40,z0),[[e.vModelText,ce.value]])])],2))}}),O0={class:"dss-step-bar__header"},q0={class:"dss-step-bar__label"},W0={key:0,class:"dss-step-bar__counter"},Z0={class:"dss-step-bar__track-wrapper"},U0=["aria-valuemax","aria-valuenow","aria-label"],X0=["onMouseenter"],Y0={__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)},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 oe=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"}}},A=se=>se&&typeof se=="object"&&!Array.isArray(se),ce=(se,pe)=>{const De=Object.assign({},se);return!A(se)||!A(pe)||Object.keys(pe).forEach(_e=>{if(A(pe[_e])){_e in se?De[_e]=ce(se[_e],pe[_e]):Object.assign(De,{[_e]:pe[_e]});return}Object.assign(De,{[_e]:pe[_e]})}),De},I=e.computed(()=>ce(_,oe.options)),B=e.computed(()=>Math.max(1,Number(oe.steps)||1)),ve=e.computed(()=>Math.min(B.value,Math.max(0,Number(oe.currentStep)||0))),ut=e.computed(()=>Array.isArray(oe.segments)&&oe.segments.length>0),Q=e.computed(()=>{if(!ut.value)return[];const se=oe.segments.map((pe,De)=>{const _e=Number(pe?.value);return{label:pe?.label||`Step ${De+1}`,value:Number.isFinite(_e)&&_e>0?_e:0,color:pe?.color||oe.activeColor,marker:pe?.marker}});return oe.segmentOrder==="desc"?[...se].sort((pe,De)=>De.value-pe.value):oe.segmentOrder==="asc"?[...se].sort((pe,De)=>pe.value-De.value):se}),f=e.computed(()=>ut.value?Q.value.reduce((se,pe)=>se+pe.value,0):ve.value),xe=e.computed(()=>ut.value?Number.isFinite(Number(oe.totalValue))&&Number(oe.totalValue)>0?Number(oe.totalValue):Math.max(1,f.value):B.value),Ce=e.computed(()=>ut.value&&Number.isFinite(Number(oe.totalValue))&&Number(oe.totalValue)>0),G=e.computed(()=>Ce.value?Math.max(0,Number(oe.totalValue)-f.value):0),U=e.computed(()=>typeof oe.remainderLabel=="string"&&oe.remainderLabel.trim().length>0),me=e.computed(()=>G.value>0),F=e.computed(()=>Q.value.reduce((se,pe)=>Math.max(se,Number(pe.value)||0),0)),Se=e.computed(()=>Q.value.filter(se=>se.value>0).map(se=>`${se.label}: ${tt(se.value)}`).join(" | ")),Te=e.computed(()=>ut.value?Ce.value?Q.value.filter(se=>se.value>0):Q.value:[]),nt=e.computed(()=>{if(!oe.counterAsPercentage)return`${f.value} / ${xe.value}`;const se=Number(xe.value);if(!Number.isFinite(se)||se<=0)return"0%";const pe=Math.round(Number(f.value)/se*100);return`${Math.min(Math.max(pe,0),100)}%`}),mt=e.computed(()=>f.value),W=e.computed(()=>xe.value),Ze=e.reactive({visible:!1,x:0,content:""}),qe=e.computed(()=>({left:`${Ze.x}px`})),Ee=se=>{const pe=se?.parentElement;return pe?pe.offsetLeft+pe.offsetWidth/2:0},Me=se=>{if(Ce.value){const _e=Math.max(0,Number(se.value)||0);return{flex:`${_e} 0 0`,minWidth:_e>0?"6px":"0",backgroundColor:se.color}}const pe=f.value;return{flex:`${se.value>0?se.value:pe>0?1e-4:1} 0 0`,minWidth:"6px",backgroundColor:se.color}},Ye=se=>Number(se?.value||0)>0&&Number(se?.value||0)===F.value,ee=se=>{const pe=A(se?.marker)?se.marker:{},De=se?.marker===!0||pe.enabled===!0,_e=Ye(se)&&I.value.maxSegment?.marker?.enabled===!0;if(!(De||_e))return{enabled:!1};const Ct=pe.backgroundColor??(_e?I.value.maxSegment?.marker?.backgroundColor:I.value.segmentMarker?.backgroundColor),Gt=pe.borderColor??(_e?I.value.maxSegment?.marker?.borderColor:I.value.segmentMarker?.borderColor),$t=pe.color??(_e?I.value.maxSegment?.marker?.color:I.value.segmentMarker?.color),Wt=pe.width??(_e?I.value.maxSegment?.marker?.width:I.value.segmentMarker?.width),K=pe.height??(_e?I.value.maxSegment?.marker?.height:I.value.segmentMarker?.height);return{enabled:!0,backgroundColor:Ct,borderColor:Gt,color:$t,width:Wt,height:K,icon:pe.icon??null,...pe}},ot=se=>{const pe=ee(se);return{backgroundColor:pe.backgroundColor??void 0,borderColor:pe.borderColor??void 0,color:pe.color??void 0}},be=se=>{const pe=ee(se);return{width:pe.width??void 0,height:pe.height??void 0}},tt=se=>`${se}${oe.valueLabel}`,dt=e.computed(()=>({flex:`${G.value} 0 0`,minWidth:G.value>0?"6px":"0",backgroundColor:oe.inactiveColor})),kt=(se,pe)=>{if(!se||!pe?.currentTarget)return;const De=pe.currentTarget;if(oe.remainderTooltipSummary){Ze.x=Ee(De),Ze.content=Se.value,Ze.visible=!!Ze.content;return}Ze.x=De.offsetLeft+De.offsetWidth/2,Ze.content=`${se.label}: ${tt(se.value)}`,Ze.visible=!0},wt=se=>{if(!G.value||!se?.currentTarget)return;const pe=se.currentTarget;if(oe.remainderTooltipSummary){Ze.x=Ee(pe),Ze.content=Se.value,Ze.visible=!!Ze.content;return}Ze.x=pe.offsetLeft+pe.offsetWidth/2,U.value&&(Ze.content=`${oe.remainderLabel}: ${tt(G.value)}`,Ze.visible=!0)},Dt=()=>{Ze.visible=!1},Ft=e.computed(()=>({"--dss-step-bar-label-color":oe.labelColor??void 0,"--dss-step-bar-counter-color":oe.counterColor??void 0,"--dss-step-bar-active-color":oe.activeColor,"--dss-step-bar-inactive-color":oe.inactiveColor}));return(se,pe)=>(e.openBlock(),e.createElementBlock("div",{class:"dss-step-bar",style:e.normalizeStyle(Ft.value)},[e.createElementVNode("div",O0,[e.createElementVNode("span",q0,[e.renderSlot(se.$slots,"label",{label:L.label},()=>[e.createTextVNode(e.toDisplayString(L.label),1)])]),L.showCounter?(e.openBlock(),e.createElementBlock("span",W0,[e.renderSlot(se.$slots,"counter",{counterDisplay:nt.value},()=>[e.createTextVNode(e.toDisplayString(nt.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Z0,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":W.value,"aria-valuenow":mt.value,"aria-label":L.label},[ut.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value,(De,_e)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${_e}-${De.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":Ye(De),"dss-step-bar__segment--marker-enabled":ee(De).enabled}]),style:e.normalizeStyle(Me(De)),onMouseenter:jt=>kt(De,jt),onMouseleave:Dt},[ee(De).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(ot(De)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(be(De))},[e.renderSlot(se.$slots,"segment-marker-icon",{segment:De,index:_e,marker:ee(De)},()=>[e.renderSlot(se.$slots,"max-segment-icon",{segment:De,index:_e,marker:ee(De)},()=>[e.createTextVNode(e.toDisplayString(ee(De).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,X0))),128)),me.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(dt.value),onMouseenter:pe[0]||(pe[0]=De=>wt(De)),onMouseleave:Dt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(B.value,De=>(e.openBlock(),e.createElementBlock("div",{key:De,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":De<=ve.value}])},null,2))),128))],8,U0),Ze.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip",style:e.normalizeStyle(qe.value)},e.toDisplayString(Ze.content),5)):e.createCommentVNode("",!0)])],4))}},j0={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"}},K0={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"},G0={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"}},Q0={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"}},J0={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"}},ro={chart:j0,table:K0,filter:G0,datepicker:Q0,textEditor:J0},e9={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"}},t9={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"},l9={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"}},n9={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"}},o9={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"}},io={chart:e9,table:t9,filter:l9,datepicker:n9,textEditor:o9},a9={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"}},s9={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"},r9={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"}},i9={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"}},c9={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"}},co={chart:a9,table:s9,filter:r9,datepicker:i9,textEditor:c9},zo={en:ro,fr:io,nl:co};function ua(L){if(!L||!L.global)return;const oe=L.global.availableLocales||[];Object.keys(zo).forEach(_=>{oe.includes(_)&&L.global.mergeLocaleMessage(_,zo[_])})}const Po={en:{textEditor:ro.textEditor},fr:{textEditor:io.textEditor},nl:{textEditor:co.textEditor}};function da(L){if(!L||!L.global)return;const oe=L.global.availableLocales||[];Object.keys(Po).forEach(_=>{oe.includes(_)&&L.global.mergeLocaleMessage(_,Po[_])})}const Oo={en:{table:ro.table},fr:{table:io.table},nl:{table:co.table}};function ma(L){if(!L||!L.global)return;const oe=L.global.availableLocales||[];Object.keys(Oo).forEach(_=>{oe.includes(_)&&L.global.mergeLocaleMessage(_,Oo[_])})}const qo={en:{datepicker:ro.datepicker},fr:{datepicker:io.datepicker},nl:{datepicker:co.datepicker}};function pa(L){if(!L||!L.global)return;const oe=L.global.availableLocales||[];Object.keys(qo).forEach(_=>{oe.includes(_)&&L.global.mergeLocaleMessage(_,qo[_])})}const Wo={en:{filter:ro.filter},fr:{filter:io.filter},nl:{filter:co.filter}};function fa(L){if(!L||!L.global)return;const oe=L.global.availableLocales||[];Object.keys(Wo).forEach(_=>{oe.includes(_)&&L.global.mergeLocaleMessage(_,Wo[_])})}const u9={chart:zo,textEditor:Po,table:Oo,datepicker:qo,filter:Wo};function d9(L){!L||!L.global||(ua(L),da(L),ma(L),pa(L),fa(L))}const m9={en:{...ro},fr:{...io},nl:{...co}};so.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:m9});exports.DSSChart=cc;exports.DSSChartMessages=zo;exports.DSSColorPicker=Gm;exports.DSSConfetti=S2;exports.DSSDatepicker=na;exports.DSSDatepickerMessages=qo;exports.DSSDnd=x2;exports.DSSFilter=L0;exports.DSSFilterMessages=Wo;exports.DSSLoader=u2;exports.DSSMessages=u9;exports.DSSModal=la;exports.DSSPillField=P0;exports.DSSSkeleton=d2;exports.DSSStepBar=Y0;exports.DSSTable=$u;exports.DSSTableMessages=Oo;exports.DSSTextEditor=Dm;exports.DSSTextEditorMessages=Po;exports.addDSSChartTranslations=ua;exports.addDSSDatepickerTranslations=pa;exports.addDSSFilterTranslations=fa;exports.addDSSTableTranslations=ma;exports.addDSSTextEditorTranslations=da;exports.addDSSTranslations=d9;