dsp-semactic 0.7.6 → 0.7.7
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/README.md +5 -5
- package/dist/dsp-semactic.css +1 -1
- package/dist/index.cjs.js +35 -35
- package/dist/index.es.js +7553 -7484
- package/package.json +48 -48
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),so=require("vue-i18n"),os={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},as=["value"],ss=["placeholder","value","disabled"],rs=["placeholder","value"],is=["placeholder","value"],cs=["aria-selected","onClick"],us={class:"dss-datepicker__list-item-label"},ds={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"},ms={key:1,class:"dss-datepicker__list-empty"},ps={key:1,class:"dss-datepicker__double-wrap"},vs={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},fs=["disabled","onClick"],hs={class:"dss-datepicker__double-calendars"},gs={class:"dss-datepicker__double-calendar"},ys={class:"dss-datepicker__calendar-header"},ks=["aria-label"],Cs={class:"dss-datepicker__month-year-row"},bs=["aria-label"],ws={class:"dss-datepicker__weekdays"},xs={class:"dss-datepicker__grid"},Es=["disabled","onClick","onMouseenter"],Ss={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Vs={class:"dss-datepicker__double-calendar"},Ns={class:"dss-datepicker__calendar-header"},Bs=["aria-label"],Ms={class:"dss-datepicker__month-year-row"},_s=["aria-label"],$s={class:"dss-datepicker__weekdays"},Ls={class:"dss-datepicker__grid"},Ts=["disabled","onClick","onMouseenter"],As={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ds={class:"dss-datepicker__calendar-header"},Hs=["aria-label"],Rs={class:"dss-datepicker__month-year-row"},Fs=["aria-label"],Is={class:"dss-datepicker__weekdays"},zs={class:"dss-datepicker__grid"},Ps=["disabled","onClick","onMouseenter"],Os={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ws={class:"dss-datepicker__calendar-header"},qs={class:"dss-datepicker__month-year-row"},Zs={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Us={class:"dss-datepicker__months-grid"},Xs=["onClick"],Ys={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},js={class:"dss-datepicker__month-year"},Ks={class:"dss-datepicker__years-grid"},Gs=["data-year","onClick"],Ea=27,In=8,ca={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:E=>["single","range","singleFromAvailable","rangeFromAvailable","listFromAvailable","readonly"].includes(E)},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(E,{emit:le}){const _=E,B=le,{t:de,locale:P}=so.useI18n(),T=e.ref(!1),he=e.ref("days"),st=new Date,te=e.computed(()=>_.minDate instanceof Date?_.minDate:st),f=e.ref(te.value.getMonth()),we=e.ref(te.value.getFullYear()),Ce=e.ref(te.value.getMonth()),J=e.ref(te.value.getFullYear()),X=e.ref(te.value.getMonth()),fe=e.ref(te.value.getFullYear()),R=e.ref("start"),me=e.ref(null),_e=e.ref(null);function Je(){const $=te.value,O=$.getMonth(),D=$.getFullYear(),ne=O===11?0:O+1,Ae=O===11?D+1:D;return{left:{month:O,year:D},right:{month:ne,year:Ae}}}const pt=e.ref(null),Z=e.ref(null),Fe=e.ref(null),We=e.ref(null),Se=e.ref(null),Le=e.ref(null),Ye=e.ref(null),ie=e.ref(null),Ge=new Date().getFullYear(),be=e.computed(()=>["single","singleFromAvailable"].includes(_.mode)),Qe=e.computed(()=>["range","rangeFromAvailable"].includes(_.mode)),ct=e.computed(()=>_.mode==="listFromAvailable"),gt=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes(_.mode))return null;const $=_.modelValue;return $ instanceof Date?$:null}),ut=e.computed(()=>{if(!Qe.value)return{start:null,end:null};const $=_.modelValue;return!$||typeof $!="object"?{start:null,end:null}:{start:$.start instanceof Date?$.start:null,end:$.end instanceof Date?$.end:null}});function qt($){if(!$||!($ instanceof Date))return"";const O=$.getDate(),D=$.getMonth()+1,ne=$.getFullYear(),Ae=it=>String(it).padStart(2,"0");return`${Ae(O)}/${Ae(D)}/${ne}`}const Zt=e.computed(()=>qt(gt.value)),kt=e.computed(()=>{const{start:$,end:O}=ut.value;if(!$&&!O)return"";const D=!O||$&&$<=O?$:O,ne=!$||O&&O>=$?O:$;return jt(D,ne)?qt(D):`${qt(D)} - ${qt(ne)}`}),xt=e.computed(()=>{if(_.mode!=="readonly")return"—";const $=_.modelValue;if($ instanceof Date)return qt($)||"—";if($&&typeof $=="object"&&("start"in $||"end"in $)){const O=$.start instanceof Date?$.start:null,D=$.end instanceof Date?$.end:null;if(!O&&!D)return"—";const ne=!D||O&&O<=D?O:D,Ae=!O||D&&D>=O?D:O;return jt(ne,Ae)?qt(ne):`${qt(ne)} - ${qt(Ae)}`}return"—"});e.computed(()=>{const $=new Date(we.value,f.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format($)});const Yt=e.computed(()=>_e.value==="left"?Ce.value:_e.value==="right"?X.value:f.value),rt=e.computed(()=>_e.value==="left"?J.value:_e.value==="right"?fe.value:we.value),Jt=e.computed(()=>{const $=new Date(we.value,f.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format($)}),yt=e.computed(()=>{const $=new Date(rt.value,Yt.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format($)}),ol=e.computed(()=>{const $=new Intl.DateTimeFormat(P.value,{month:"short"});return Array.from({length:12},(O,D)=>$.format(new Date(2024,D,1)))}),U=e.computed(()=>{const O=(_e.value?rt.value:we.value)-Math.floor(Ea/2);return Array.from({length:Ea},(D,ne)=>O+ne)}),ke=e.computed(()=>{const $=U.value;return $.length?`${$[0]} – ${$[$.length-1]}`:""});function W($){return $===7?0:$}function G($){try{const O=new Intl.Locale($);if(O.weekInfo?.firstDay!=null)return W(O.weekInfo.firstDay)}catch{}return 1}function Ne($){const O=new Date(2024,0,1),D=(O.getDay()-$+7)%7,ne=new Date(O);return ne.setDate(O.getDate()-D),ne}const Ie=e.computed(()=>G(P.value)),Ue=e.computed(()=>{const $=new Intl.DateTimeFormat(P.value,{weekday:"short"}),O=Ne(Ie.value),D=[];for(let ne=0;ne<7;ne++){const Ae=new Date(O);Ae.setDate(O.getDate()+ne),D.push($.format(Ae).slice(0,2))}return D});function Et($,O,D){const ne=new Date($,O,1),Ae=new Date($,O+1,0),it=(ne.getDay()-D+7)%7,vt=Ae.getDate(),tt=[];for(let lt=0;lt<it;lt++)tt.push(null);for(let lt=1;lt<=vt;lt++)tt.push(new Date($,O,lt));return tt}const Ke=e.computed(()=>Et(we.value,f.value,Ie.value)),Ut=e.computed(()=>Et(J.value,Ce.value,Ie.value)),qe=e.computed(()=>Et(fe.value,X.value,Ie.value));e.computed(()=>{const $=new Date(J.value,Ce.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format($)}),e.computed(()=>{const $=new Date(fe.value,X.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format($)});const Pe=e.computed(()=>{const $=new Date(J.value,Ce.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format($)}),Ht=e.computed(()=>{const $=new Date(fe.value,X.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format($)}),$t=e.computed(()=>_.availableDates&&_.availableDates.length>0),oe=e.computed(()=>$t.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"}]),Y=e.ref({top:0,left:0}),j=e.ref("left");let pe=null;function xe(){T.value&&e.nextTick(()=>{T.value&&(pe!==null&&window.cancelAnimationFrame(pe),pe=window.requestAnimationFrame(()=>{pe=null,je()}))})}function je(){if(!Se.value||!T.value)return;const $=Se.value.getBoundingClientRect(),O=window.innerWidth||document.documentElement.clientWidth,D=window.innerHeight||document.documentElement.clientHeight;let ne=$.left,Ae=$.bottom+4;const it=Le.value;if(it){const vt=it.offsetWidth,tt=it.offsetHeight;j.value==="right"||ne+vt>O-In?(j.value="right",ne=$.right-vt):j.value="left";const kl=Math.max(In,O-vt-In);if(ne=Math.min(Math.max(ne,In),kl),Ae+tt>D-In){const Sl=$.top-4-tt;Sl>=In?Ae=Sl:Ae=Math.max(In,D-tt-In)}}Y.value={top:Ae,left:ne}}const Rt=e.computed(()=>!Se.value||!T.value?{}:{position:"fixed",left:`${Y.value.left}px`,top:`${Y.value.top}px`,zIndex:1002});function jt($,O){return!$||!O?!1:$.getFullYear()===O.getFullYear()&&$.getMonth()===O.getMonth()&&$.getDate()===O.getDate()}function et($){return new Date($.getFullYear(),$.getMonth(),$.getDate()).getTime()}function pl($){return!_.availableDates||!_.availableDates.length?!0:_.availableDates.some(O=>O instanceof Date&&jt(O,$))}function M($){const O=et($);return!(_.minDate instanceof Date&&O<et(_.minDate)||_.maxDate instanceof Date&&O>et(_.maxDate))}function w($){const O=new Date($);return new Date(O.getFullYear(),O.getMonth(),O.getDate())}function A($){return $.filter(O=>M(O))}function se($,O){if(!($ instanceof Date)||!(O instanceof Date))return null;let D=et($),ne=et(O);if(D>ne&&([D,ne]=[ne,D]),_.minDate instanceof Date){const Ae=et(_.minDate);D=Math.max(D,Ae),ne=Math.max(ne,Ae)}if(_.maxDate instanceof Date){const Ae=et(_.maxDate);D=Math.min(D,Ae),ne=Math.min(ne,Ae)}return D>ne?null:{start:w(D),end:w(ne)}}function ae($){return!_.exceptDates||!_.exceptDates.length?!1:_.exceptDates.some(O=>O instanceof Date&&jt(O,$))}function He($){return ae($)?!1:["singleFromAvailable","rangeFromAvailable"].includes(_.mode)?pl($):M($)}function Ct($){const O=gt.value,D=ut.value,ne=et($),Ae=Qe.value&&D.start&&D.end&&ne>et(D.start)&&ne<et(D.end),it=Qe.value&&D.start&&jt($,D.start),vt=Qe.value&&D.end&&jt($,D.end),tt=it&&vt,lt=be.value&&O&&jt($,O)||it||vt;let kl=!1;if(Qe.value&&D.start&&!D.end&&me.value){const Sl=et(D.start),Tt=et(me.value),wl=Math.min(Sl,Tt),el=Math.max(Sl,Tt);kl=ne>wl&&ne<el}return{"dss-datepicker__day--selected":lt&&!tt,"dss-datepicker__day--range-start":it&&!tt,"dss-datepicker__day--range-end":vt&&!tt,"dss-datepicker__day--range-single":tt,"dss-datepicker__day--in-range":Ae&&!it&&!vt,"dss-datepicker__day--in-range-preview":kl&&!it&&!vt&&!Ae,"dss-datepicker__day--disabled":!He($)}}function nt($){if(!Qe.value)return;const O=ut.value;if(!O.start||O.end){me.value=null;return}if(!He($)){me.value=null;return}me.value=new Date($.getFullYear(),$.getMonth(),$.getDate())}function Re(){me.value=null}function bt(){if(!_.doubleCalendar||!Qe.value)return;const $=ut.value,{start:O,end:D}=$;if(O&&D){const it=O<=D?O:D,vt=O<=D?D:O,tt=it.getMonth(),lt=it.getFullYear(),kl=vt.getMonth(),Sl=vt.getFullYear();if(tt!==kl||lt!==Sl){const Tt=Ce.value===tt&&J.value===lt,wl=X.value===kl&&fe.value===Sl;if(Tt&&wl)return;Ce.value=tt,J.value=lt,X.value=kl,fe.value=Sl}else{const Tt=tt===0?11:tt-1,wl=tt===0?lt-1:lt;Ce.value===Tt&&J.value===wl&&X.value===tt&&fe.value===lt||(Ce.value=tt,J.value=lt,tt===11?(X.value=0,fe.value=lt+1):(X.value=tt+1,fe.value=lt))}return}const ne=O||D;if(ne){const it=ne.getMonth(),vt=ne.getFullYear(),tt=Ce.value===it&&J.value===vt,lt=X.value===it&&fe.value===vt;if(tt||lt)return;Ce.value=it,J.value=vt,it===11?(X.value=0,fe.value=vt+1):(X.value=it+1,fe.value=vt);return}const Ae=Je();Ce.value=Ae.left.month,J.value=Ae.left.year,X.value=Ae.right.month,fe.value=Ae.right.year}const _t=e.computed(()=>new Intl.DateTimeFormat(P.value,{day:"2-digit",month:"long",year:"numeric"})),St=e.computed(()=>{if(!ct.value)return[];const $=(_.availableDates||[]).filter(D=>D instanceof Date&&!Number.isNaN(D.getTime())).filter(D=>!ae(D)&&M(D)).map(D=>new Date(D.getFullYear(),D.getMonth(),D.getDate()));$.sort((D,ne)=>ne.getTime()-D.getTime());const O=gt.value;return $.map(D=>({date:D,ts:D.getTime(),label:_t.value.format(D),selected:!!(O&&jt(D,O))}))});function Lt(){if(T.value){Kt();return}Se.value=We.value?.closest(".dss-datepicker__input-wrap"),j.value="left",T.value=!0,xe(),e.nextTick(()=>{ie.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function zt($){if(!($ instanceof Date))return;const O=new Date($.getFullYear(),$.getMonth(),$.getDate());B("update:modelValue",O),Kt()}function Bt($="start"){if(_.mode==="readonly")return;R.value=$;const O=gt.value,D=ut.value;if(be.value&&O)f.value=O.getMonth(),we.value=O.getFullYear();else if(Qe.value)if(_.doubleCalendar)bt();else{const ne=$==="start"&&D.start?D.start:D.end||D.start;ne&&(f.value=ne.getMonth(),we.value=ne.getFullYear())}Se.value=be.value?pt.value?.closest(".dss-datepicker__input-wrap"):Z.value,he.value="days",_e.value=null,j.value="left",T.value=!0,xe()}function Kt(){he.value="days",_e.value=null,me.value=null,T.value=!1}function ql($,O){_e.value=$,he.value=O}function jl(){he.value="days",_e.value=null}function El($){const O=new Date,D=O.getFullYear(),ne=O.getMonth(),Ae=O.getDate();let it,vt;if($t.value){const tt=A([..._.availableDates].filter(lt=>lt instanceof Date).map(lt=>new Date(lt.getFullYear(),lt.getMonth(),lt.getDate()))).sort((lt,kl)=>lt.getTime()-kl.getTime());if(tt.length===0)return null;if($==="all")it=tt[0],vt=tt[tt.length-1];else{const lt=parseInt($.replace("last",""),10);if(lt<2||lt>5)return null;const kl=tt.slice(-lt);if(kl.length===0)return null;it=kl[0],vt=kl[kl.length-1]}}else{const tt=new Date(D,ne,Ae);switch($){case"today":it=tt,vt=tt;break;case"lastWeek":it=new Date(D,ne,Ae-6),vt=tt;break;case"last15Days":it=new Date(D,ne,Ae-14),vt=tt;break;case"last30Days":it=new Date(D,ne,Ae-29),vt=tt;break;case"thisMonth":it=new Date(D,ne,1),vt=tt;break;case"last3Months":it=new Date(D,ne-3,1),vt=new Date(D,ne,0);break;case"last6Months":it=new Date(D,ne-6,1),vt=new Date(D,ne,0);break;case"last12Months":it=new Date(D,ne-12,1),vt=new Date(D,ne,0);break;case"lastYear":it=new Date(D-1,0,1),vt=new Date(D-1,11,31);break;default:return null}}return{start:it,end:vt}}function il($){const O=El($);return O?se(O.start,O.end):null}function vl($){return il($)!==null}function dn($){const O=il($);O&&(B("update:modelValue",O),bt())}function wn($){_e.value==="left"?Ce.value=$:_e.value==="right"?X.value=$:f.value=$,jl()}function Dl($){_e.value==="left"?J.value=$:_e.value==="right"?fe.value=$:we.value=$,jl()}function mn(){f.value===0?(f.value=11,we.value--):f.value--}function $l(){f.value===11?(f.value=0,we.value++):f.value++}function zn(){Ce.value===0?(Ce.value=11,J.value--):Ce.value--}function Dn(){Ce.value===11?(Ce.value=0,J.value++):Ce.value++}function on(){X.value===0?(X.value=11,fe.value--):X.value--}function bl(){X.value===11?(X.value=0,fe.value++):X.value++}function Fl($){if(!He($))return;const O=new Date($.getFullYear(),$.getMonth(),$.getDate());if(be.value){B("update:modelValue",O),Kt();return}const D=ut.value;if(!D.start&&!D.end){B("update:modelValue",{start:O,end:null}),R.value="end";return}if(D.start&&D.end){B("update:modelValue",{start:O,end:null}),R.value="end";return}if(R.value==="start"){let ne=O,Ae=D.end;ne&&Ae&&ne>Ae&&([ne,Ae]=[Ae,ne]),B("update:modelValue",{start:ne||Ae,end:Ae||ne}),R.value="end"}else{let ne=D.start,Ae=O;ne&&Ae&&Ae<ne&&([ne,Ae]=[Ae,ne]),B("update:modelValue",{start:ne||Ae,end:Ae||ne}),R.value="start"}}e.watch(ut,()=>{_.doubleCalendar&&Qe.value&&T.value&&bt()},{deep:!0});let Kl=null,Hl=null,Ml=null;function pn(){Kl&&(document.removeEventListener("keydown",Kl),Kl=null),Hl&&(window.removeEventListener("resize",Hl),Hl=null),Ml&&(window.removeEventListener("scroll",Ml,!0),Ml=null)}return e.watch(he,$=>{$==="years"&&e.nextTick(()=>{Ye.value?.querySelector(`[data-year="${rt.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[T.value,he.value,f.value,we.value,Ce.value,J.value,X.value,fe.value,_e.value,_.doubleCalendar,_.quickSelect],()=>{xe()}),e.watch(T,$=>{pn(),$&&(Kl=O=>{O.key==="Escape"&&(he.value==="years"||he.value==="months"?jl():Kt())},Hl=()=>{je()},Ml=()=>{je()},document.addEventListener("keydown",Kl),window.addEventListener("resize",Hl),window.addEventListener("scroll",Ml,!0))}),e.onBeforeUnmount(()=>{pe!==null&&(window.cancelAnimationFrame(pe),pe=null),pn()}),($,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":E.mode==="readonly"}])},[E.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",os,[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:xt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,as)])):be.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:O[0]||(O[0]=D=>Bt("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:_.placeholder||e.unref(de)("datepicker.selectDate"),value:Zt.value,readonly:"",disabled:E.mode==="readonly"},null,8,ss)])):ct.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":T.value}]),onClick:Lt},[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:We,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(de)("datepicker.selectFromList"),value:Zt.value,readonly:""},null,8,rs),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":T.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)):Qe.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:Z,onClick:O[1]||(O[1]=D=>Bt("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:Fe,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(de)("datepicker.selectRange"),value:kt.value,readonly:""},null,8,is)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(Kt,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Le,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":E.doubleCalendar&&Qe.value&&he.value==="days","dss-datepicker__dropdown--quick-select":E.doubleCalendar&&Qe.value&&he.value==="days"&&E.quickSelect,"dss-datepicker__dropdown--list":ct.value}]),onClick:O[9]||(O[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Rt.value)},[ct.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:ie},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St.value,D=>(e.openBlock(),e.createElementBlock("li",{key:D.ts,role:"option","aria-selected":D.selected,class:e.normalizeClass(["dss-datepicker__list-item",{"dss-datepicker__list-item--selected":D.selected}]),onClick:ne=>zt(D.date)},[e.createElementVNode("span",us,e.toDisplayString(D.label),1),D.selected?(e.openBlock(),e.createElementBlock("svg",ds,[...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,cs))),128))],512)):(e.openBlock(),e.createElementBlock("div",ms,e.toDisplayString(e.unref(de)("datepicker.noAvailableDates")),1))],64)):he.value==="days"&&E.doubleCalendar&&Qe.value?(e.openBlock(),e.createElementBlock("div",ps,[E.quickSelect?(e.openBlock(),e.createElementBlock("nav",vs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oe.value,D=>(e.openBlock(),e.createElementBlock("button",{key:D.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!vl(D.id),onClick:ne=>dn(D.id)},e.toDisplayString(e.unref(de)(D.labelKey)),9,fs))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",hs,[e.createElementVNode("div",gs,[e.createElementVNode("div",ys,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:zn}," ‹ ",8,ks),e.createElementVNode("div",Cs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[2]||(O[2]=D=>ql("left","months"))},e.toDisplayString(Pe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[3]||(O[3]=D=>ql("left","years"))},e.toDisplayString(J.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:Dn}," › ",8,bs)]),e.createElementVNode("div",ws,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,D=>(e.openBlock(),e.createElementBlock("span",{key:D,class:"dss-datepicker__weekday"},e.toDisplayString(D),1))),128))]),e.createElementVNode("div",xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,(D,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+ne},[D?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ct(D)]),disabled:!He(D),onClick:Ae=>Fl(D),onMouseenter:Ae=>nt(D),onMouseleave:Re},e.toDisplayString(D.getDate()),43,Es)):(e.openBlock(),e.createElementBlock("span",Ss))],64))),128))])]),e.createElementVNode("div",Vs,[e.createElementVNode("div",Ns,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:on}," ‹ ",8,Bs),e.createElementVNode("div",Ms,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[4]||(O[4]=D=>ql("right","months"))},e.toDisplayString(Ht.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[5]||(O[5]=D=>ql("right","years"))},e.toDisplayString(fe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:bl}," › ",8,_s)]),e.createElementVNode("div",$s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,D=>(e.openBlock(),e.createElementBlock("span",{key:D,class:"dss-datepicker__weekday"},e.toDisplayString(D),1))),128))]),e.createElementVNode("div",Ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value,(D,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+ne},[D?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ct(D)]),disabled:!He(D),onClick:Ae=>Fl(D),onMouseenter:Ae=>nt(D),onMouseleave:Re},e.toDisplayString(D.getDate()),43,Ts)):(e.openBlock(),e.createElementBlock("span",As))],64))),128))])])])])):he.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Ds,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:mn}," ‹ ",8,Hs),e.createElementVNode("div",Rs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[6]||(O[6]=D=>he.value="months")},e.toDisplayString(Jt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[7]||(O[7]=D=>he.value="years")},e.toDisplayString(we.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:$l}," › ",8,Fs)]),e.createElementVNode("div",Is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,D=>(e.openBlock(),e.createElementBlock("span",{key:D,class:"dss-datepicker__weekday"},e.toDisplayString(D),1))),128))]),e.createElementVNode("div",zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,(D,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ne},[D?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Ct(D)]),disabled:!He(D),onClick:Ae=>Fl(D),onMouseenter:Ae=>nt(D),onMouseleave:Re},e.toDisplayString(D.getDate()),43,Ps)):(e.openBlock(),e.createElementBlock("span",Os))],64))),128))])],64)):he.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Ws,[e.createElementVNode("div",qs,[e.createElementVNode("span",Zs,e.toDisplayString(yt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[8]||(O[8]=D=>he.value="years")},e.toDisplayString(rt.value),1)])]),e.createElementVNode("div",Us,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ol.value,(D,ne)=>(e.openBlock(),e.createElementBlock("button",{key:ne,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":ne===Yt.value}]),onClick:Ae=>wn(ne)},e.toDisplayString(D),11,Xs))),128))])],64)):he.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",Ys,[e.createElementVNode("span",js,e.toDisplayString(ke.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:Ye},[e.createElementVNode("div",Ks,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,D=>(e.openBlock(),e.createElementBlock("button",{key:D,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":D===rt.value,"dss-datepicker__year-cell--current":D===e.unref(Ge)}]),"data-year":D,onClick:ne=>Dl(D)},e.toDisplayString(D),11,Gs))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Qs=["data-chart-type"],Js={class:"dss-chart-header-titles"},er={key:0,class:"dss-chart-title"},tr={key:1,class:"dss-chart-subtitle"},lr=["onClick","onMouseenter"],nr={class:"dss-legend-text"},or=["onClick","onMouseenter"],ar={class:"dss-legend-text"},sr=["title"],rr=["src"],ir={class:"dss-chart-area-wrapper"},cr={key:0,class:"dss-chart-z-axis-label"},ur=["width","height","data-smooth","data-animated"],dr=["id"],mr=["y","width","height"],pr=["id"],vr=["d"],fr=["id"],hr=["d"],gr={key:0},yr=["clip-path"],kr=["x1","x2","y1","y2"],Cr=["clip-path"],br=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],wr=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],xr={class:"dss-axes"},Er=["x1","x2","y1","y2"],Sr=["x1","x2","y1","y2"],Vr=["x1","x2","y1","y2"],Nr={class:"dss-axis-labels"},Br=["x","y"],Mr=["x","y"],_r=["x","y"],$r=["x","y"],Lr=["y","transform"],Tr=["x","y","transform"],Ar={key:2,class:"dss-flag-markers"},Dr=["clip-path"],Hr=["x1","x2","y1","y2","onMouseover"],Rr=["x1","x2","y1","y2","onMouseover"],Fr=["x1","x2","y1","y2","onMouseover"],Ir=["cx","cy","onMouseover"],zr=["cx","cy","fill","onMouseover"],Pr=["x","y"],Or=["clip-path"],Wr={key:0},qr=["d","onMouseover"],Zr=["x","y","width","height","fill","onMouseover"],Ur={class:"dss-line-chart"},Xr=["d","stroke","stroke-width","stroke-dasharray"],Yr=["d","stroke","stroke-width","opacity"],jr=["cx","cy","r","fill","onMouseover"],Kr={key:1},Gr=["d","stroke","stroke-width","stroke-dasharray"],Qr=["d","stroke","stroke-width","stroke-dasharray"],Jr=["d","stroke","stroke-width","opacity"],ei=["cx","cy","r","fill","onMouseover"],ti={key:2},li=["id"],ni=["x","y","width","height"],oi=["d","fill","fill-opacity","mask"],ai=["d","stroke","stroke-width"],si={key:3,class:"dss-stepbar-chart"},ri=["id"],ii=["d"],ci=["clip-path"],ui=["x","y","width","height","fill","onMouseover"],di=["d","fill","onMouseover"],mi=["x","y","width","height","onMouseover"],pi=["clip-path"],vi=["x1","x2","y1","y2","stroke"],fi=["cx","cy","r","fill"],hi={key:1,class:"dss-bubble-chart"},gi={key:0,class:"dss-bubble-group"},yi=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],ki=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Ci=["transform"],bi=["cx","cy","r"],wi=["data-chart-type","clip-path"],xi=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],Ei={key:1,class:"dss-radial-segment-data-labels"},Si=["x","y"],Vi=["x","y","font-size","fill"],Ni=["x1","y1","x2","y2","stroke"],Bi=["x1","y1","x2","y2","stroke"],Mi=["x","y","text-anchor","font-size"],_i=["transform"],$i={key:0,class:"dss-spider-grid"},Li=["cx","cy","r"],Ti={class:"dss-spider-grid-labels"},Ai=["x","y"],Di=["x","y"],Hi=["x1","x2","y1","y2"],Ri={class:"dss-spider-labels"},Fi=["x","y","text-anchor","dominant-baseline"],Ii=["points","fill","fill-opacity","stroke","stroke-width","stroke-dasharray"],zi=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],Pi={class:"dss-chart-logos"},Oi=["cx","cy","r","fill"],Wi=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],qi=["onClick","onMouseenter"],Zi=["src"],Ui={class:"dss-marker-tooltip-category"},Xi={key:0,class:"dss-marker-tooltip-description"},Yi={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},ji={class:"dss-tooltip-title dss-spider-tooltip-area-title"},Ki={class:"dss-tooltip-series-name"},Gi={class:"dss-tooltip-series-value"},Qi={key:1,class:"dss-tooltip-section"},Ji={key:0,class:"dss-tooltip-title"},ec={class:"dss-bubble-tooltip-data"},tc={key:2,class:"dss-tooltip-section"},lc={class:"dss-tooltip-title"},nc={class:"dss-tooltip-value"},oc={key:0,class:"dss-tooltip-section"},ac={class:"dss-tooltip-section-title"},sc={class:"dss-tooltip-group-header"},rc={class:"dss-tooltip-item-content"},ic={class:"dss-tooltip-item-text"},cc={key:1,class:"dss-tooltip-section"},uc={class:"dss-tooltip-section-title"},dc={class:"dss-tooltip-item-content"},mc={class:"dss-tooltip-item-title"},pc={key:0,class:"dss-tooltip-item-description"},vc={class:"dss-tooltip-section"},fc={class:"dss-tooltip-title"},hc={key:0,class:"dss-bubble-tooltip-data"},gc={class:"dss-tooltip-series-name"},yc={class:"dss-tooltip-series-value"},kc={key:0,class:"dss-tooltip-section"},Cc={class:"dss-tooltip-section-title"},bc={class:"dss-tooltip-group-header"},wc={class:"dss-tooltip-item-content"},xc={class:"dss-tooltip-item-text"},Ec={key:1,class:"dss-tooltip-section"},Sc={class:"dss-tooltip-section-title"},Vc={class:"dss-tooltip-item-content"},Nc={class:"dss-tooltip-item-title"},Bc={key:0,class:"dss-tooltip-item-description"},Mc=["onClick","onMouseenter"],_c={class:"dss-legend-text"},$c={key:1,class:"dss-context-menu-separator"},Lc={key:0,class:"dss-context-menu-separator"},Tc={key:0,class:"dss-context-menu-separator"},Ac=["onClick"],Dc=["innerHTML"],Hc={key:0,class:"dss-context-menu-icon"},Rc={class:"dss-marker-modal-header"},Fc={class:"dss-marker-modal-body"},Ic={class:"dss-form-group"},zc={class:"dss-form-group"},Pc={for:"dss-marker-description"},Oc={key:0,class:"dss-form-text-display"},Wc=["placeholder"],qc={class:"dss-marker-modal-footer"},Zc={class:"modal-footer-left"},Uc={class:"dss-modal-footer-right"},Xc=["disabled"],Yc={name:"DSSChart"},jc=Object.assign(Yc,{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:E=>typeof E=="object"&&E!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(E,{emit:le}){const{t:_,locale:B}=so.useI18n(),de=le,P=e.ref(null),T=e.ref(null),he=e.ref(null),st=e.ref(0),te=e.ref(0);let f=null,we=null;const Ce=20,J=e.computed(()=>{if(te.value,st.value,!P.value||!T.value)return 0;try{const t=P.value.getBoundingClientRect();return T.value.getBoundingClientRect().top-t.top}catch{return 0}}),X=e.computed(()=>`chart-clip-${R.chartId}`),fe=e.computed(()=>`url(#${X.value})`),R=E,me={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},stepbar:{totalValue:100,segmentOrder:"input",showRemainder:!0,remainderLabel:"Remaining",remainderColor:"#E5E7EB",barWidth:42,minBarWidth:12,maxBarWidth:58,barRadius:6,axisBars:{show:!0,showVertical:!1,color:"#d6d6d6",opacity:.75,width:1,dashArray:"3,4"},maxSegment:{marker:{enabled:!1,icon:"",radius:8,backgroundColor:null,borderColor:"#fafafa",borderWidth:2,color:"#fafafa",fontSize:10}}},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5,comparison:{fillOpacity:0,strokeDasharray:"6,4",usePrimaryColor:!0,bubbleSize:0}},zoom:{enabled:!1,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function _e(t,o){const l=Object.assign({},t);return pt(t)&&pt(o)&&Object.keys(o).forEach(r=>{pt(o[r])?r in t?l[r]=_e(t[r],o[r]):Object.assign(l,{[r]:o[r]}):Object.assign(l,{[r]:o[r]})}),l}const Je=()=>{let t=20,o=0,l=0;if(ct.value&&(t+=30),gt.value&&(t+=25),W.value&&R.series.length>0){const r=R.series.filter((m,v)=>!wt.value.has(v)).length;if(G.value==="top"||G.value==="bottom"){if(Ne.value==="horizontal"){const v=Math.floor(Se.value/100);o=Math.ceil(r/v)*25+10}else o=r*25+10;t+=o}else l=150}return{height:t,legendHeight:o,legendWidth:l}};function pt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const Z=e.computed(()=>_e(me,R.options)),Fe=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.width==="auto"}),We=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.height==="auto"}),Se=e.computed(()=>{const t=Z.value;return Fe.value?st.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Le=e.ref(Ce),Ye=e.computed(()=>{if(We.value){const t=Ye.value;return t??Math.max(0,(te.value||400)-Le.value*5)}}),ie=e.computed(()=>{const t=Z.value;if(be.value==="mini-radial")return Se.value;if(We.value){const o=Ye.value;return o??Math.max(0,(te.value||400)-Le.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Ge=e.computed(()=>{if(We.value&&be.value==="semi-radial"&&Ye.value!=null)return Le.value+ie.value+"px";if(We.value)return"100%";if(cl.value)return Le.value+ie.value+"px";if(W.value&&G.value==="bottom"){const t=Je();return ie.value+(t.legendHeight||35)+"px"}return ie.value+(W.value?20:0)+"px"}),be=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Qe=e.computed(()=>{const t=R.series.map(o=>o.type||be.value);return new Set(t).size>1}),ct=e.computed(()=>{const t=Z.value;return t&&t.title&&t.title.text?t.title.text:""}),gt=e.computed(()=>{const t=Z.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),ut=e.computed(()=>{const t=Z.value;if(!t||!t.zAxis)return"";const o=t.zAxis;return typeof o=="string"?o:o&&typeof o.label=="string"?o.label:""}),qt=e.computed(()=>{const t=Z.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),Zt=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),kt=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),xt=e.computed(()=>{const t=kt.value;return t&&t.title&&t.title.text?t.title.text:""}),Yt=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return Q;const o=t.yAxis.min;return typeof o=="number"||o===Q?o:Q}),rt=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return Q;const o=t.yAxis.max;return typeof o=="number"||o===Q?o:Q}),Jt=e.computed(()=>{const t=kt.value;if(!t)return Q;const o=t.min;return typeof o=="number"||o===Q?o:Q}),yt=e.computed(()=>{const t=kt.value;if(!t)return Q;const o=t.max;return typeof o=="number"||o===Q?o:Q}),ol=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),U=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),ke=e.computed(()=>{const t=Z.value;return t&&t.grid&&t.grid.show!==!1}),W=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.show!==!1}),G=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Ne=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Ie=e.computed(()=>{const t=Z.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Ue=e.computed(()=>{const t=Z.value;if(!t||!t.crosshair)return!1;const o=t.crosshair.show;return o===!0||o==="true"}),Et=e.computed(()=>{const t=Z.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Ke=e.computed(()=>{const t=Z.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Ut=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),qe=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Pe=e.computed(()=>{const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Ht=e.computed(()=>{if(!cl.value)return 0;const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),$t=e.computed(()=>{const t=Z.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),oe=e.computed(()=>{const{maxX:t}=ge.value;return t===0}),Y=(t,o)=>oe.value&&o===0?5:o,j=t=>{const o=Number(t);return!Number.isFinite(o)||o<=0?0:o},pe=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),xe=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),je=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),Rt=e.computed(()=>{const t=Z.value;return xe.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),jt=e.computed(()=>{const t=Z.value,o=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return o.length>0?o:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),et=e.computed(()=>Z.value?.stepbar||{}),pl=e.computed(()=>{const t=et.value?.segmentOrder;return["asc","desc","input"].includes(t)?t:"input"}),M=e.computed(()=>{const t=Number(et.value?.totalValue);return Number.isFinite(t)&&t>0?t:100}),w=e.computed(()=>et.value?.showRemainder!==!1),A=e.computed(()=>et.value?.remainderLabel||"Remaining"),se=e.computed(()=>et.value?.remainderColor||"#E5E7EB"),ae=e.computed(()=>{const t=Number(et.value?.barWidth);return Number.isFinite(t)&&t>0?t:42}),He=e.computed(()=>{const t=Number(et.value?.minBarWidth);return Number.isFinite(t)&&t>0?t:12}),Ct=e.computed(()=>{const t=Number(et.value?.maxBarWidth);return Number.isFinite(t)&&t>0?t:58}),nt=e.computed(()=>{const t=Number(et.value?.barRadius);return Number.isFinite(t)&&t>=0?t:6}),Re=e.computed(()=>et.value?.axisBars||{}),bt=e.computed(()=>Re.value?.show!==!1),_t=e.computed(()=>Re.value?.showVertical===!0),St=e.computed(()=>Re.value?.color||"#d6d6d6"),Lt=e.computed(()=>{const t=Number(Re.value?.opacity);return Number.isFinite(t)?Math.min(Math.max(t,0),1):.75}),zt=e.computed(()=>{const t=Number(Re.value?.width);return Number.isFinite(t)&&t>0?t:1}),Bt=e.computed(()=>Re.value?.dashArray||"3,4"),Kt=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.enabled!==!1}),ql=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),jl=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),El=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),il=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),vl=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),dn=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.onDataChange!==!1}),wn=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Dl=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),mn=e.computed(()=>Z.value?.spider?.gridSteps||5),$l=e.computed(()=>{const t=[],o=mn.value;for(let l=1;l<=o;l++)t.push(Vt.value/o*l);return t}),zn=t=>{const o=Dn.value;if(o&&Array.isArray(o)&&o[t]!==void 0)return o[t].toString();const l=$l.value[t];return Math.round(l/Vt.value*100)+"%"},Dn=e.computed(()=>Z.value?.spider?.gridLabels||null),on=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),bl=e.computed(()=>{const t=Z.value,o={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...o,...t.contextMenu.items}:o}),Fl=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Kl=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.icon?t.markers.icon:wl.value}),Hl=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Ml=e.computed(()=>{const t=Z.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),pn=e.computed(()=>{const o=Z.value?.valueFormat?.extension;return typeof o=="string"?o:""}),$=t=>{const o=pn.value;if(t==null)return"";const l=String(t);return o?l+o:l},O=e.computed(()=>!ce.value.isZooming);e.computed(()=>tl.value.map(t=>{if(t.categoryIndex!==void 0&&(Nl.value||Gt.value)){const o=ht(t.categoryIndex),l=J.value+I.value.bottom-Ml.value/2;return{...t,x:o,y:l}}return t}));function D(t,o){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[v,C,b]=t.split("-"),F=Number(b?.length===2?`20${b}`:b);l=new Date(F,Number(C)-1,Number(v))}else return 0;let r=0,m=1/0;return o.forEach((v,C)=>{const[b,F,N]=v.split("-"),L=Number(N?.length===2?`20${N}`:N),S=new Date(L,Number(F)-1,Number(b)),K=Math.abs(S-l);K<m&&(m=K,r=C)}),r}const ne=e.computed(()=>{const t=R.markers.map(l=>{const r=D(l.marker_date,R.categories),m=ht(r),v=J.value+I.value.bottom-Ml.value/2;return{...l,x:m,y:v,categoryIndex:r,source:"props"}}),o=tl.value.map(l=>{if(l.categoryIndex!==void 0&&(Nl.value||Gt.value)){const r=ht(l.categoryIndex),m=J.value+I.value.bottom-Ml.value/2;return{...l,x:r,y:m,source:"internal"}}return{...l,source:"internal"}});return[...t,...o]}),Ae=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.enabled===!0}),it=e.computed(()=>{const t=Z.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),vt=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),tt=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),lt=e.computed(()=>{const t={left:I.value.left,top:I.value.top,width:I.value.width,height:I.value.height};let o,l;const r=String(vt.value);if(r.includes("%")){const m=parseFloat(r)/100;o=t.width*m,l=o*(96/499)}else{const m=parseFloat(r)||25;o=Math.min(t.width*.25,200)*(m/25),l=o*(96/499)}return{width:o,height:l,area:t}}),kl=e.computed(()=>{const{width:t,height:o}=lt.value,l=tt.value;let r,m;const v=I.value.left,C=I.value.right,b=I.value.top,F=I.value.bottom,N=I.value.width,L=I.value.height;switch(l){case"center":r=v+(N-t)/2,m=b+(L-o)/2;break;case"top-left":r=v+15,m=b+5;break;case"top-right":r=C-t-15,m=b+5;break;case"bottom-left":r=v+15,m=F-o-5;break;case"bottom-right":default:r=C-t-15,m=F-o-5;break}return{backgroundPositionX:r+"px",backgroundPositionY:m+"px",backgroundSize:`${t}px ${o}px`}}),Sl=t=>!R.flags||!R.flags.length?[]:R.flags.filter(o=>o.categoryIndex===t),Tt=t=>{const o=Sl(t),l=hn(t),r=o.filter(C=>C.manual),m=o.filter(C=>!C.manual),v=[];return r.length>0&&v.push({type:_("chart.tooltip.manualFlags"),color:"#698dbe",flags:r.map(C=>({text:C.text,color:"#698dbe"}))}),m.length>0&&v.push({type:_("chart.tooltip.autoFlags"),color:"#a1d499",flags:m.map(C=>({text:C.text,color:"#a1d499"}))}),{flagGroups:v,markers:l.map(C=>({title:C.title,description:C.description,type:_("chart.tooltip.markers"),color:C.color||"#9784ba"}))}},wl=e.computed(()=>{const t=R.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"),gs={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},ys=["value"],ks=["placeholder","value","disabled"],Cs=["placeholder","value"],bs=["placeholder","value"],ws=["aria-selected","onClick"],xs={class:"dss-datepicker__list-item-label"},Es={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"},Ss={key:1,class:"dss-datepicker__list-empty"},Vs={key:1,class:"dss-datepicker__double-wrap"},Ns={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},Bs=["disabled","onClick"],Ms={class:"dss-datepicker__double-calendars"},_s={class:"dss-datepicker__double-calendar"},$s={class:"dss-datepicker__calendar-header"},Ls=["aria-label"],Ts={class:"dss-datepicker__month-year-row"},As=["aria-label"],Ds={class:"dss-datepicker__weekdays"},Hs={class:"dss-datepicker__grid"},Rs=["disabled","onClick","onMouseenter"],Fs={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Is={class:"dss-datepicker__double-calendar"},zs={class:"dss-datepicker__calendar-header"},Ps=["aria-label"],Os={class:"dss-datepicker__month-year-row"},Ws=["aria-label"],qs={class:"dss-datepicker__weekdays"},Zs={class:"dss-datepicker__grid"},Us=["disabled","onClick","onMouseenter"],Xs={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ys={class:"dss-datepicker__calendar-header"},js=["aria-label"],Ks={class:"dss-datepicker__month-year-row"},Gs=["aria-label"],Qs={class:"dss-datepicker__weekdays"},Js={class:"dss-datepicker__grid"},er=["disabled","onClick","onMouseenter"],tr={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},lr={class:"dss-datepicker__calendar-header"},nr={class:"dss-datepicker__month-year-row"},or={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},ar={class:"dss-datepicker__months-grid"},sr=["onClick"],rr={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},ir={class:"dss-datepicker__month-year"},cr={class:"dss-datepicker__years-grid"},ur=["data-year","onClick"],$a=27,On=8,pa={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:S=>["single","range","singleFromAvailable","rangeFromAvailable","listFromAvailable","readonly"].includes(S)},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(S,{emit:ee}){const L=S,N=ee,{t:ue,locale:O}=so.useI18n(),H=e.ref(!1),me=e.ref("days"),ot=new Date,ne=e.computed(()=>L.minDate instanceof Date?L.minDate:ot),f=e.ref(ne.value.getMonth()),be=e.ref(ne.value.getFullYear()),he=e.ref(ne.value.getMonth()),oe=e.ref(ne.value.getFullYear()),j=e.ref(ne.value.getMonth()),fe=e.ref(ne.value.getFullYear()),_e=e.ref("start"),V=e.ref(null),$e=e.ref(null);function lt(){const R=ne.value,W=R.getMonth(),D=R.getFullYear(),se=W===11?0:W+1,De=W===11?D+1:D;return{left:{month:W,year:D},right:{month:se,year:De}}}const rt=e.ref(null),Qe=e.ref(null),Z=e.ref(null),qe=e.ref(null),ze=e.ref(null),ye=e.ref(null),Ue=e.ref(null),ke=e.ref(null),Te=new Date().getFullYear(),at=e.computed(()=>["single","singleFromAvailable"].includes(L.mode)),ge=e.computed(()=>["range","rangeFromAvailable"].includes(L.mode)),Ft=e.computed(()=>L.mode==="listFromAvailable"),dt=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes(L.mode))return null;const R=L.modelValue;return R instanceof Date?R:null}),Ye=e.computed(()=>{if(!ge.value)return{start:null,end:null};const R=L.modelValue;return!R||typeof R!="object"?{start:null,end:null}:{start:R.start instanceof Date?R.start:null,end:R.end instanceof Date?R.end:null}});function Pt(R){if(!R||!(R instanceof Date))return"";const W=R.getDate(),D=R.getMonth()+1,se=R.getFullYear(),De=mt=>String(mt).padStart(2,"0");return`${De(W)}/${De(D)}/${se}`}const It=e.computed(()=>Pt(dt.value)),bt=e.computed(()=>{const{start:R,end:W}=Ye.value;if(!R&&!W)return"";const D=!W||R&&R<=W?R:W,se=!R||W&&W>=R?W:R;return Ot(D,se)?Pt(D):`${Pt(D)} - ${Pt(se)}`}),ft=e.computed(()=>{if(L.mode!=="readonly")return"—";const R=L.modelValue;if(R instanceof Date)return Pt(R)||"—";if(R&&typeof R=="object"&&("start"in R||"end"in R)){const W=R.start instanceof Date?R.start:null,D=R.end instanceof Date?R.end:null;if(!W&&!D)return"—";const se=!D||W&&W<=D?W:D,De=!W||D&&D>=W?D:W;return Ot(se,De)?Pt(se):`${Pt(se)} - ${Pt(De)}`}return"—"});e.computed(()=>{const R=new Date(be.value,f.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(R)});const Yt=e.computed(()=>$e.value==="left"?he.value:$e.value==="right"?j.value:f.value),it=e.computed(()=>$e.value==="left"?oe.value:$e.value==="right"?fe.value:be.value),At=e.computed(()=>{const R=new Date(be.value,f.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(R)}),ht=e.computed(()=>{const R=new Date(it.value,Yt.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(R)}),il=e.computed(()=>{const R=new Intl.DateTimeFormat(O.value,{month:"short"});return Array.from({length:12},(W,D)=>R.format(new Date(2024,D,1)))}),St=e.computed(()=>{const W=($e.value?it.value:be.value)-Math.floor($a/2);return Array.from({length:$a},(D,se)=>W+se)}),Dt=e.computed(()=>{const R=St.value;return R.length?`${R[0]} – ${R[R.length-1]}`:""});function pe(R){return R===7?0:R}function A(R){try{const W=new Intl.Locale(R);if(W.weekInfo?.firstDay!=null)return pe(W.weekInfo.firstDay)}catch{}return 1}function X(R){const W=new Date(2024,0,1),D=(W.getDay()-R+7)%7,se=new Date(W);return se.setDate(W.getDate()-D),se}const ae=e.computed(()=>A(O.value)),Ce=e.computed(()=>{const R=new Intl.DateTimeFormat(O.value,{weekday:"short"}),W=X(ae.value),D=[];for(let se=0;se<7;se++){const De=new Date(W);De.setDate(W.getDate()+se),D.push(R.format(De).slice(0,2))}return D});function je(R,W,D){const se=new Date(R,W,1),De=new Date(R,W+1,0),mt=(se.getDay()-D+7)%7,ut=De.getDate(),Ze=[];for(let Je=0;Je<mt;Je++)Ze.push(null);for(let Je=1;Je<=ut;Je++)Ze.push(new Date(R,W,Je));return Ze}const Ge=e.computed(()=>je(be.value,f.value,ae.value)),Vt=e.computed(()=>je(oe.value,he.value,ae.value)),Pe=e.computed(()=>je(fe.value,j.value,ae.value));e.computed(()=>{const R=new Date(oe.value,he.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(R)}),e.computed(()=>{const R=new Date(fe.value,j.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(R)});const Ke=e.computed(()=>{const R=new Date(oe.value,he.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(R)}),nt=e.computed(()=>{const R=new Date(fe.value,j.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(R)}),qt=e.computed(()=>L.availableDates&&L.availableDates.length>0),te=e.computed(()=>qt.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"}]),K=e.ref({top:0,left:0}),Q=e.ref("left");let ce=null;function Ve(){H.value&&e.nextTick(()=>{H.value&&(ce!==null&&window.cancelAnimationFrame(ce),ce=window.requestAnimationFrame(()=>{ce=null,We()}))})}function We(){if(!ze.value||!H.value)return;const R=ze.value.getBoundingClientRect(),W=window.innerWidth||document.documentElement.clientWidth,D=window.innerHeight||document.documentElement.clientHeight;let se=R.left,De=R.bottom+4;const mt=ye.value;if(mt){const ut=mt.offsetWidth,Ze=mt.offsetHeight;Q.value==="right"||se+ut>W-On?(Q.value="right",se=R.right-ut):Q.value="left";const dl=Math.max(On,W-ut-On);if(se=Math.min(Math.max(se,On),dl),De+Ze>D-On){const ml=R.top-4-Ze;ml>=On?De=ml:De=Math.max(On,D-Ze-On)}}K.value={top:De,left:se}}const Nt=e.computed(()=>!ze.value||!H.value?{}:{position:"fixed",left:`${K.value.left}px`,top:`${K.value.top}px`,zIndex:1002});function Ot(R,W){return!R||!W?!1:R.getFullYear()===W.getFullYear()&&R.getMonth()===W.getMonth()&&R.getDate()===W.getDate()}function pt(R){return new Date(R.getFullYear(),R.getMonth(),R.getDate()).getTime()}function wt(R){return!L.availableDates||!L.availableDates.length?!0:L.availableDates.some(W=>W instanceof Date&&Ot(W,R))}function B(R){const W=pt(R);return!(L.minDate instanceof Date&&W<pt(L.minDate)||L.maxDate instanceof Date&&W>pt(L.maxDate))}function w(R){const W=new Date(R);return new Date(W.getFullYear(),W.getMonth(),W.getDate())}function T(R){return R.filter(W=>B(W))}function ie(R,W){if(!(R instanceof Date)||!(W instanceof Date))return null;let D=pt(R),se=pt(W);if(D>se&&([D,se]=[se,D]),L.minDate instanceof Date){const De=pt(L.minDate);D=Math.max(D,De),se=Math.max(se,De)}if(L.maxDate instanceof Date){const De=pt(L.maxDate);D=Math.min(D,De),se=Math.min(se,De)}return D>se?null:{start:w(D),end:w(se)}}function re(R){return!L.exceptDates||!L.exceptDates.length?!1:L.exceptDates.some(W=>W instanceof Date&&Ot(W,R))}function He(R){return re(R)?!1:["singleFromAvailable","rangeFromAvailable"].includes(L.mode)?wt(R):B(R)}function gt(R){const W=dt.value,D=Ye.value,se=pt(R),De=ge.value&&D.start&&D.end&&se>pt(D.start)&&se<pt(D.end),mt=ge.value&&D.start&&Ot(R,D.start),ut=ge.value&&D.end&&Ot(R,D.end),Ze=mt&&ut,Je=at.value&&W&&Ot(R,W)||mt||ut;let dl=!1;if(ge.value&&D.start&&!D.end&&V.value){const ml=pt(D.start),Tt=pt(V.value),ll=Math.min(ml,Tt),Bt=Math.max(ml,Tt);dl=se>ll&&se<Bt}return{"dss-datepicker__day--selected":Je&&!Ze,"dss-datepicker__day--range-start":mt&&!Ze,"dss-datepicker__day--range-end":ut&&!Ze,"dss-datepicker__day--range-single":Ze,"dss-datepicker__day--in-range":De&&!mt&&!ut,"dss-datepicker__day--in-range-preview":dl&&!mt&&!ut&&!De,"dss-datepicker__day--disabled":!He(R)}}function et(R){if(!ge.value)return;const W=Ye.value;if(!W.start||W.end){V.value=null;return}if(!He(R)){V.value=null;return}V.value=new Date(R.getFullYear(),R.getMonth(),R.getDate())}function Ae(){V.value=null}function yt(){if(!L.doubleCalendar||!ge.value)return;const R=Ye.value,{start:W,end:D}=R;if(W&&D){const mt=W<=D?W:D,ut=W<=D?D:W,Ze=mt.getMonth(),Je=mt.getFullYear(),dl=ut.getMonth(),ml=ut.getFullYear();if(Ze!==dl||Je!==ml){const Tt=he.value===Ze&&oe.value===Je,ll=j.value===dl&&fe.value===ml;if(Tt&&ll)return;he.value=Ze,oe.value=Je,j.value=dl,fe.value=ml}else{const Tt=Ze===0?11:Ze-1,ll=Ze===0?Je-1:Je;he.value===Tt&&oe.value===ll&&j.value===Ze&&fe.value===Je||(he.value=Ze,oe.value=Je,Ze===11?(j.value=0,fe.value=Je+1):(j.value=Ze+1,fe.value=Je))}return}const se=W||D;if(se){const mt=se.getMonth(),ut=se.getFullYear(),Ze=he.value===mt&&oe.value===ut,Je=j.value===mt&&fe.value===ut;if(Ze||Je)return;he.value=mt,oe.value=ut,mt===11?(j.value=0,fe.value=ut+1):(j.value=mt+1,fe.value=ut);return}const De=lt();he.value=De.left.month,oe.value=De.left.year,j.value=De.right.month,fe.value=De.right.year}const Et=e.computed(()=>new Intl.DateTimeFormat(O.value,{day:"2-digit",month:"long",year:"numeric"})),xt=e.computed(()=>{if(!Ft.value)return[];const R=(L.availableDates||[]).filter(D=>D instanceof Date&&!Number.isNaN(D.getTime())).filter(D=>!re(D)&&B(D)).map(D=>new Date(D.getFullYear(),D.getMonth(),D.getDate()));R.sort((D,se)=>se.getTime()-D.getTime());const W=dt.value;return R.map(D=>({date:D,ts:D.getTime(),label:Et.value.format(D),selected:!!(W&&Ot(D,W))}))});function $t(){if(H.value){Gt();return}ze.value=qe.value?.closest(".dss-datepicker__input-wrap"),Q.value="left",H.value=!0,Ve(),e.nextTick(()=>{ke.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function Ht(R){if(!(R instanceof Date))return;const W=new Date(R.getFullYear(),R.getMonth(),R.getDate());N("update:modelValue",W),Gt()}function kt(R="start"){if(L.mode==="readonly")return;_e.value=R;const W=dt.value,D=Ye.value;if(at.value&&W)f.value=W.getMonth(),be.value=W.getFullYear();else if(ge.value)if(L.doubleCalendar)yt();else{const se=R==="start"&&D.start?D.start:D.end||D.start;se&&(f.value=se.getMonth(),be.value=se.getFullYear())}ze.value=at.value?rt.value?.closest(".dss-datepicker__input-wrap"):Qe.value,me.value="days",$e.value=null,Q.value="left",H.value=!0,Ve()}function Gt(){me.value="days",$e.value=null,V.value=null,H.value=!1}function Ll(R,W){$e.value=R,me.value=W}function hl(){me.value="days",$e.value=null}function Nl(R){const W=new Date,D=W.getFullYear(),se=W.getMonth(),De=W.getDate();let mt,ut;if(qt.value){const Ze=T([...L.availableDates].filter(Je=>Je instanceof Date).map(Je=>new Date(Je.getFullYear(),Je.getMonth(),Je.getDate()))).sort((Je,dl)=>Je.getTime()-dl.getTime());if(Ze.length===0)return null;if(R==="all")mt=Ze[0],ut=Ze[Ze.length-1];else{const Je=parseInt(R.replace("last",""),10);if(Je<2||Je>5)return null;const dl=Ze.slice(-Je);if(dl.length===0)return null;mt=dl[0],ut=dl[dl.length-1]}}else{const Ze=new Date(D,se,De);switch(R){case"today":mt=Ze,ut=Ze;break;case"lastWeek":mt=new Date(D,se,De-6),ut=Ze;break;case"last15Days":mt=new Date(D,se,De-14),ut=Ze;break;case"last30Days":mt=new Date(D,se,De-29),ut=Ze;break;case"thisMonth":mt=new Date(D,se,1),ut=Ze;break;case"last3Months":mt=new Date(D,se-3,1),ut=new Date(D,se,0);break;case"last6Months":mt=new Date(D,se-6,1),ut=new Date(D,se,0);break;case"last12Months":mt=new Date(D,se-12,1),ut=new Date(D,se,0);break;case"lastYear":mt=new Date(D-1,0,1),ut=new Date(D-1,11,31);break;default:return null}}return{start:mt,end:ut}}function cl(R){const W=Nl(R);return W?ie(W.start,W.end):null}function nn(R){return cl(R)!==null}function un(R){const W=cl(R);W&&(N("update:modelValue",W),yt())}function Ul(R){$e.value==="left"?he.value=R:$e.value==="right"?j.value=R:f.value=R,hl()}function Tl(R){$e.value==="left"?oe.value=R:$e.value==="right"?fe.value=R:be.value=R,hl()}function dn(){f.value===0?(f.value=11,be.value--):f.value--}function Al(){f.value===11?(f.value=0,be.value++):f.value++}function Wn(){he.value===0?(he.value=11,oe.value--):he.value--}function Ln(){he.value===11?(he.value=0,oe.value++):he.value++}function El(){j.value===0?(j.value=11,fe.value--):j.value--}function on(){j.value===11?(j.value=0,fe.value++):j.value++}function Dl(R){if(!He(R))return;const W=new Date(R.getFullYear(),R.getMonth(),R.getDate());if(at.value){N("update:modelValue",W),Gt();return}const D=Ye.value;if(!D.start&&!D.end){N("update:modelValue",{start:W,end:null}),_e.value="end";return}if(D.start&&D.end){N("update:modelValue",{start:W,end:null}),_e.value="end";return}if(_e.value==="start"){let se=W,De=D.end;se&&De&&se>De&&([se,De]=[De,se]),N("update:modelValue",{start:se||De,end:De||se}),_e.value="end"}else{let se=D.start,De=W;se&&De&&De<se&&([se,De]=[De,se]),N("update:modelValue",{start:se||De,end:De||se}),_e.value="start"}}e.watch(Ye,()=>{L.doubleCalendar&&ge.value&&H.value&&yt()},{deep:!0});let Ol=null,Hl=null,ul=null;function Tn(){Ol&&(document.removeEventListener("keydown",Ol),Ol=null),Hl&&(window.removeEventListener("resize",Hl),Hl=null),ul&&(window.removeEventListener("scroll",ul,!0),ul=null)}return e.watch(me,R=>{R==="years"&&e.nextTick(()=>{Ue.value?.querySelector(`[data-year="${it.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[H.value,me.value,f.value,be.value,he.value,oe.value,j.value,fe.value,$e.value,L.doubleCalendar,L.quickSelect],()=>{Ve()}),e.watch(H,R=>{Tn(),R&&(Ol=W=>{W.key==="Escape"&&(me.value==="years"||me.value==="months"?hl():Gt())},Hl=()=>{We()},ul=()=>{We()},document.addEventListener("keydown",Ol),window.addEventListener("resize",Hl),window.addEventListener("scroll",ul,!0))}),e.onBeforeUnmount(()=>{ce!==null&&(window.cancelAnimationFrame(ce),ce=null),Tn()}),(R,W)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":S.mode==="readonly"}])},[S.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",gs,[W[10]||(W[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:ft.value,readonly:"",disabled:"",tabindex:"-1"},null,8,ys)])):at.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:W[0]||(W[0]=D=>kt("start"))},[W[11]||(W[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:rt,type:"text",class:"dss-datepicker__input",placeholder:L.placeholder||e.unref(ue)("datepicker.selectDate"),value:It.value,readonly:"",disabled:S.mode==="readonly"},null,8,ks)])):Ft.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":H.value}]),onClick:$t},[W[13]||(W[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:L.placeholder||e.unref(ue)("datepicker.selectFromList"),value:It.value,readonly:""},null,8,Cs),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":H.value}]),"aria-hidden":"true"},[...W[12]||(W[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)):ge.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:Qe,onClick:W[1]||(W[1]=D=>kt("start"))},[W[14]||(W[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:Z,type:"text",class:"dss-datepicker__input",placeholder:L.placeholder||e.unref(ue)("datepicker.selectRange"),value:bt.value,readonly:""},null,8,bs)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[H.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(Gt,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ye,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":S.doubleCalendar&&ge.value&&me.value==="days","dss-datepicker__dropdown--quick-select":S.doubleCalendar&&ge.value&&me.value==="days"&&S.quickSelect,"dss-datepicker__dropdown--list":Ft.value}]),onClick:W[9]||(W[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Nt.value)},[Ft.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[xt.value.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"dss-datepicker__list",role:"listbox",ref_key:"listRef",ref:ke},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xt.value,D=>(e.openBlock(),e.createElementBlock("li",{key:D.ts,role:"option","aria-selected":D.selected,class:e.normalizeClass(["dss-datepicker__list-item",{"dss-datepicker__list-item--selected":D.selected}]),onClick:se=>Ht(D.date)},[e.createElementVNode("span",xs,e.toDisplayString(D.label),1),D.selected?(e.openBlock(),e.createElementBlock("svg",Es,[...W[15]||(W[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,ws))),128))],512)):(e.openBlock(),e.createElementBlock("div",Ss,e.toDisplayString(e.unref(ue)("datepicker.noAvailableDates")),1))],64)):me.value==="days"&&S.doubleCalendar&&ge.value?(e.openBlock(),e.createElementBlock("div",Vs,[S.quickSelect?(e.openBlock(),e.createElementBlock("nav",Ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,D=>(e.openBlock(),e.createElementBlock("button",{key:D.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!nn(D.id),onClick:se=>un(D.id)},e.toDisplayString(e.unref(ue)(D.labelKey)),9,Bs))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Ms,[e.createElementVNode("div",_s,[e.createElementVNode("div",$s,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.prevMonth"),onClick:Wn}," ‹ ",8,Ls),e.createElementVNode("div",Ts,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[2]||(W[2]=D=>Ll("left","months"))},e.toDisplayString(Ke.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[3]||(W[3]=D=>Ll("left","years"))},e.toDisplayString(oe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.nextMonth"),onClick:Ln}," › ",8,As)]),e.createElementVNode("div",Ds,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,D=>(e.openBlock(),e.createElementBlock("span",{key:D,class:"dss-datepicker__weekday"},e.toDisplayString(D),1))),128))]),e.createElementVNode("div",Hs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Vt.value,(D,se)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+se},[D?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",gt(D)]),disabled:!He(D),onClick:De=>Dl(D),onMouseenter:De=>et(D),onMouseleave:Ae},e.toDisplayString(D.getDate()),43,Rs)):(e.openBlock(),e.createElementBlock("span",Fs))],64))),128))])]),e.createElementVNode("div",Is,[e.createElementVNode("div",zs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.prevMonth"),onClick:El}," ‹ ",8,Ps),e.createElementVNode("div",Os,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[4]||(W[4]=D=>Ll("right","months"))},e.toDisplayString(nt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[5]||(W[5]=D=>Ll("right","years"))},e.toDisplayString(fe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.nextMonth"),onClick:on}," › ",8,Ws)]),e.createElementVNode("div",qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,D=>(e.openBlock(),e.createElementBlock("span",{key:D,class:"dss-datepicker__weekday"},e.toDisplayString(D),1))),128))]),e.createElementVNode("div",Zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value,(D,se)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+se},[D?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",gt(D)]),disabled:!He(D),onClick:De=>Dl(D),onMouseenter:De=>et(D),onMouseleave:Ae},e.toDisplayString(D.getDate()),43,Us)):(e.openBlock(),e.createElementBlock("span",Xs))],64))),128))])])])])):me.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Ys,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.prevMonth"),onClick:dn}," ‹ ",8,js),e.createElementVNode("div",Ks,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[6]||(W[6]=D=>me.value="months")},e.toDisplayString(At.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[7]||(W[7]=D=>me.value="years")},e.toDisplayString(be.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.nextMonth"),onClick:Al}," › ",8,Gs)]),e.createElementVNode("div",Qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,D=>(e.openBlock(),e.createElementBlock("span",{key:D,class:"dss-datepicker__weekday"},e.toDisplayString(D),1))),128))]),e.createElementVNode("div",Js,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,(D,se)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:se},[D?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",gt(D)]),disabled:!He(D),onClick:De=>Dl(D),onMouseenter:De=>et(D),onMouseleave:Ae},e.toDisplayString(D.getDate()),43,er)):(e.openBlock(),e.createElementBlock("span",tr))],64))),128))])],64)):me.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",lr,[e.createElementVNode("div",nr,[e.createElementVNode("span",or,e.toDisplayString(ht.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[8]||(W[8]=D=>me.value="years")},e.toDisplayString(it.value),1)])]),e.createElementVNode("div",ar,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(il.value,(D,se)=>(e.openBlock(),e.createElementBlock("button",{key:se,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":se===Yt.value}]),onClick:De=>Ul(se)},e.toDisplayString(D),11,sr))),128))])],64)):me.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",rr,[e.createElementVNode("span",ir,e.toDisplayString(Dt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:Ue},[e.createElementVNode("div",cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St.value,D=>(e.openBlock(),e.createElementBlock("button",{key:D,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":D===it.value,"dss-datepicker__year-cell--current":D===e.unref(Te)}]),"data-year":D,onClick:se=>Tl(D)},e.toDisplayString(D),11,ur))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},dr={class:"dss-step-bar__layout"},mr={class:"dss-step-bar__header"},pr={class:"dss-step-bar__label"},vr={key:0,class:"dss-step-bar__counter"},fr={class:"dss-step-bar__track-wrapper"},hr=["aria-valuemax","aria-valuenow","aria-label"],gr=["onMouseenter"],Ta={__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:S=>["input","desc","asc"].includes(S)},orientation:{type:String,default:"horizontal",validator:S=>["horizontal","vertical"].includes(S)},barHeight:{type:[Number,String],default:200},labelPosition:{type:String,default:"up",validator:S=>["up","down","left","right"].includes(S)},sideLabelMaxWidth:{type:[Number,String],default:null},sideLabelWrapWidth:{type:[Number,String],default:"18ch"},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:()=>({})},disableTooltips:{type:Boolean,default:!1}},setup(S){const ee=S,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"}}},N=A=>A&&typeof A=="object"&&!Array.isArray(A),ue=(A,X)=>{const ae=Object.assign({},A);return!N(A)||!N(X)||Object.keys(X).forEach(Ce=>{if(N(X[Ce])){Ce in A?ae[Ce]=ue(A[Ce],X[Ce]):Object.assign(ae,{[Ce]:X[Ce]});return}Object.assign(ae,{[Ce]:X[Ce]})}),ae},O=e.computed(()=>ue(L,ee.options)),H=e.computed(()=>Math.max(1,Number(ee.steps)||1)),me=e.computed(()=>Math.min(H.value,Math.max(0,Number(ee.currentStep)||0))),ot=e.computed(()=>Array.isArray(ee.segments)&&ee.segments.length>0),ne=e.computed(()=>{if(!ot.value)return[];const A=ee.segments.map((X,ae)=>{const Ce=Number(X?.value);return{label:X?.label||`Step ${ae+1}`,value:Number.isFinite(Ce)&&Ce>0?Ce:0,color:X?.color||ee.activeColor,marker:X?.marker}});return ee.segmentOrder==="desc"?[...A].sort((X,ae)=>ae.value-X.value):ee.segmentOrder==="asc"?[...A].sort((X,ae)=>X.value-ae.value):A}),f=e.computed(()=>ot.value?ne.value.reduce((A,X)=>A+X.value,0):me.value),be=e.computed(()=>ot.value?Number.isFinite(Number(ee.totalValue))&&Number(ee.totalValue)>0?Number(ee.totalValue):Math.max(1,f.value):H.value),he=e.computed(()=>ot.value&&Number.isFinite(Number(ee.totalValue))&&Number(ee.totalValue)>0),oe=e.computed(()=>he.value?Math.max(0,Number(ee.totalValue)-f.value):0),j=e.computed(()=>typeof ee.remainderLabel=="string"&&ee.remainderLabel.trim().length>0),fe=e.computed(()=>oe.value>0),_e=e.computed(()=>ne.value.reduce((A,X)=>Math.max(A,Number(X.value)||0),0)),V=e.computed(()=>ne.value.filter(A=>A.value>0).map(A=>`${A.label}: ${bt(A.value)}`).join(" | ")),$e=e.computed(()=>ot.value?he.value?ne.value.filter(A=>A.value>0):ne.value:[]),lt=e.computed(()=>{if(!ee.counterAsPercentage)return`${f.value} / ${be.value}`;const A=Number(be.value);if(!Number.isFinite(A)||A<=0)return"0%";const X=Math.round(Number(f.value)/A*100);return`${Math.min(Math.max(X,0),100)}%`}),rt=e.computed(()=>f.value),Qe=e.computed(()=>be.value),Z=e.reactive({visible:!1,x:0,y:0,content:""}),qe=e.computed(()=>ee.orientation==="vertical"),ze=e.computed(()=>{const A=ee.barHeight;return A==null||A===""?"200px":typeof A=="number"?`${A}px`:String(A)}),ye=e.computed(()=>{const A=ee.sideLabelMaxWidth;if(!(A==null||A===""))return typeof A=="number"?`${A}px`:String(A)}),Ue=e.computed(()=>{const A=ee.sideLabelWrapWidth;return A==null||A===""?"18ch":typeof A=="number"?`${A}ch`:String(A)}),ke=e.computed(()=>({left:`${Z.x}px`,top:`${Z.y}px`,transform:"translate(-50%, calc(-100% - 8px))"})),Te=A=>qe.value?{flex:`${A} 0 0`,minHeight:A>0?"6px":"0",minWidth:"0"}:{flex:`${A} 0 0`,minWidth:A>0?"6px":"0"},at=A=>{const X=A?.parentElement;if(!X)return{x:0,y:0};const ae=X.getBoundingClientRect();return{x:ae.left+ae.width/2,y:ae.top}},ge=A=>{const X=A.getBoundingClientRect();return{x:X.left+X.width/2,y:X.top}},Ft=A=>{if(he.value){const Ce=Math.max(0,Number(A.value)||0);return{...Te(Ce),backgroundColor:A.color}}const X=f.value,ae=A.value>0?A.value:X>0?1e-4:1;return{...Te(ae),backgroundColor:A.color}},dt=A=>Number(A?.value||0)>0&&Number(A?.value||0)===_e.value,Ye=A=>{const X=N(A?.marker)?A.marker:{},ae=A?.marker===!0||X.enabled===!0,Ce=dt(A)&&O.value.maxSegment?.marker?.enabled===!0;if(!(ae||Ce))return{enabled:!1};const Ge=X.backgroundColor??(Ce?O.value.maxSegment?.marker?.backgroundColor:O.value.segmentMarker?.backgroundColor),Vt=X.borderColor??(Ce?O.value.maxSegment?.marker?.borderColor:O.value.segmentMarker?.borderColor),Pe=X.color??(Ce?O.value.maxSegment?.marker?.color:O.value.segmentMarker?.color),Ke=X.width??(Ce?O.value.maxSegment?.marker?.width:O.value.segmentMarker?.width),nt=X.height??(Ce?O.value.maxSegment?.marker?.height:O.value.segmentMarker?.height);return{enabled:!0,backgroundColor:Ge,borderColor:Vt,color:Pe,width:Ke,height:nt,icon:X.icon??null,...X}},Pt=A=>{const X=Ye(A);return{backgroundColor:X.backgroundColor??void 0,borderColor:X.borderColor??void 0,color:X.color??void 0}},It=A=>{const X=Ye(A);return{width:X.width??void 0,height:X.height??void 0}},bt=A=>`${A}${ee.valueLabel}`,ft=e.computed(()=>({...Te(oe.value),backgroundColor:ee.inactiveColor})),Yt=(A,X)=>{ee.disableTooltips||ht(A,X)},it=A=>{ee.disableTooltips||il(A)},At=()=>{ee.disableTooltips||St()},ht=(A,X)=>{if(!A||!X?.currentTarget)return;const ae=X.currentTarget;if(ee.remainderTooltipSummary){const je=at(ae);Z.x=je.x,Z.y=je.y,Z.content=V.value,Z.visible=!!Z.content;return}const Ce=ge(ae);Z.x=Ce.x,Z.y=Ce.y,Z.content=`${A.label}: ${bt(A.value)}`,Z.visible=!0},il=A=>{if(!oe.value||!A?.currentTarget)return;const X=A.currentTarget;if(ee.remainderTooltipSummary){const Ce=at(X);Z.x=Ce.x,Z.y=Ce.y,Z.content=V.value,Z.visible=!!Z.content;return}const ae=ge(X);Z.x=ae.x,Z.y=ae.y,j.value&&(Z.content=`${ee.remainderLabel}: ${bt(oe.value)}`,Z.visible=!0)},St=()=>{Z.visible=!1},Dt=()=>{Z.visible&&St()};e.onMounted(()=>{window.addEventListener("scroll",Dt,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",Dt,!0)});const pe=e.computed(()=>({"--dss-step-bar-label-color":ee.labelColor??void 0,"--dss-step-bar-counter-color":ee.counterColor??void 0,"--dss-step-bar-active-color":ee.activeColor,"--dss-step-bar-inactive-color":ee.inactiveColor,"--dss-step-bar-bar-height":qe.value?ze.value:void 0,"--dss-step-bar-side-label-max-width":ye.value,"--dss-step-bar-side-label-wrap-width":Ue.value}));return(A,X)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-step-bar",[`dss-step-bar--${S.orientation}`,`dss-step-bar--label-${S.labelPosition}`]]),style:e.normalizeStyle(pe.value)},[e.createElementVNode("div",dr,[e.createElementVNode("div",mr,[e.createElementVNode("span",pr,[e.renderSlot(A.$slots,"label",{label:S.label},()=>[e.createTextVNode(e.toDisplayString(S.label),1)])]),S.showCounter?(e.openBlock(),e.createElementBlock("span",vr,[e.renderSlot(A.$slots,"counter",{counterDisplay:lt.value},()=>[e.createTextVNode(e.toDisplayString(lt.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",fr,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":Qe.value,"aria-valuenow":rt.value,"aria-label":S.label},[ot.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,(ae,Ce)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${Ce}-${ae.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":dt(ae),"dss-step-bar__segment--marker-enabled":Ye(ae).enabled}]),style:e.normalizeStyle(Ft(ae)),onMouseenter:je=>Yt(ae,je),onMouseleave:At},[Ye(ae).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(Pt(ae)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(It(ae))},[e.renderSlot(A.$slots,"segment-marker-icon",{segment:ae,index:Ce,marker:Ye(ae)},()=>[e.renderSlot(A.$slots,"max-segment-icon",{segment:ae,index:Ce,marker:Ye(ae)},()=>[e.createTextVNode(e.toDisplayString(Ye(ae).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,gr))),128)),fe.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(ft.value),onMouseenter:X[0]||(X[0]=ae=>it(ae)),onMouseleave:At},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(H.value,ae=>(e.openBlock(),e.createElementBlock("div",{key:ae,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":ae<=me.value}])},null,2))),128))],8,hr)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[!S.disableTooltips&&Z.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip dss-step-bar__tooltip--teleported",style:e.normalizeStyle(ke.value)},e.toDisplayString(Z.content),5)):e.createCommentVNode("",!0)]))],6))}},yr=["data-chart-type"],kr={class:"dss-chart-header-titles"},Cr={key:0,class:"dss-chart-title"},br={key:1,class:"dss-chart-subtitle"},wr=["onClick","onMouseenter"],xr={class:"dss-legend-text"},Er=["onClick","onMouseenter"],Sr={class:"dss-legend-text"},Vr=["title"],Nr=["src"],Br={class:"dss-chart-area-wrapper"},Mr={key:0,class:"dss-chart-z-axis-label"},_r=["width","height","data-smooth","data-animated"],$r=["id"],Lr=["y","width","height"],Tr=["id"],Ar=["d"],Dr=["id"],Hr=["d"],Rr={key:0},Fr=["clip-path"],Ir=["x1","x2","y1","y2"],zr=["clip-path"],Pr=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],Or={class:"dss-axes"},Wr=["x1","x2","y1","y2"],qr=["x1","x2","y1","y2"],Zr=["x1","x2","y1","y2"],Ur={class:"dss-axis-labels"},Xr=["x","y"],Yr=["x","y"],jr=["x","y"],Kr=["x","y"],Gr=["y","transform"],Qr=["x","y","transform"],Jr={key:2,class:"dss-flag-markers"},ei=["clip-path"],ti=["x1","x2","y1","y2","onMouseover"],li=["x1","x2","y1","y2","onMouseover"],ni=["x1","x2","y1","y2","onMouseover"],oi=["cx","cy","onMouseover"],ai=["cx","cy","fill","onMouseover"],si=["x","y"],ri=["clip-path"],ii={key:0},ci=["d","onMouseover"],ui=["x","y","width","height","fill","onMouseover"],di={class:"dss-line-chart"},mi=["d","stroke","stroke-width","stroke-dasharray"],pi=["d","stroke","stroke-width","opacity"],vi=["cx","cy","r","fill","onMouseover"],fi={key:1},hi=["d","stroke","stroke-width","stroke-dasharray"],gi=["d","stroke","stroke-width","stroke-dasharray"],yi=["d","stroke","stroke-width","opacity"],ki=["cx","cy","r","fill","onMouseover"],Ci={key:2},bi=["id"],wi=["x","y","width","height"],xi=["d","fill","fill-opacity","mask"],Ei=["d","stroke","stroke-width"],Si=["d","fill","onMouseover"],Vi=["x","y","width","height","onMouseover"],Ni=["clip-path"],Bi=["x1","x2","y1","y2","stroke"],Mi=["cx","cy","r","fill"],_i={key:1,class:"dss-bubble-chart"},$i={key:0,class:"dss-bubble-group"},Li=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Ti=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Ai=["transform"],Di=["cx","cy","r"],Hi=["data-chart-type","clip-path"],Ri=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],Fi={key:1,class:"dss-radial-segment-data-labels"},Ii=["x","y"],zi=["x","y","font-size","fill"],Pi=["x1","y1","x2","y2","stroke"],Oi=["x1","y1","x2","y2","stroke"],Wi=["x","y","text-anchor","font-size"],qi=["transform"],Zi={key:0,class:"dss-spider-grid"},Ui=["cx","cy","r"],Xi={class:"dss-spider-grid-labels"},Yi=["x","y"],ji=["x","y"],Ki=["x1","x2","y1","y2"],Gi={class:"dss-spider-labels"},Qi=["x","y","text-anchor","dominant-baseline"],Ji=["points","fill","fill-opacity","stroke","stroke-width","stroke-dasharray"],ec=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],tc={class:"dss-chart-logos"},lc=["cx","cy","r","fill"],nc=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],oc={key:0,class:"dss-stepbar-grid-lines","aria-hidden":"true"},ac=["onClick","onMouseenter"],sc=["src"],rc={class:"dss-marker-tooltip-category"},ic={key:0,class:"dss-marker-tooltip-description"},cc={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},uc={class:"dss-tooltip-title dss-spider-tooltip-area-title"},dc={class:"dss-tooltip-series-name"},mc={class:"dss-tooltip-series-value"},pc={key:1,class:"dss-tooltip-section"},vc={key:0,class:"dss-tooltip-title"},fc={class:"dss-bubble-tooltip-data"},hc={key:2,class:"dss-tooltip-section"},gc={class:"dss-tooltip-title"},yc={class:"dss-tooltip-value"},kc={key:0,class:"dss-tooltip-section"},Cc={class:"dss-tooltip-section-title"},bc={class:"dss-tooltip-group-header"},wc={class:"dss-tooltip-item-content"},xc={class:"dss-tooltip-item-text"},Ec={key:1,class:"dss-tooltip-section"},Sc={class:"dss-tooltip-section-title"},Vc={class:"dss-tooltip-item-content"},Nc={class:"dss-tooltip-item-title"},Bc={key:0,class:"dss-tooltip-item-description"},Mc={class:"dss-tooltip-section"},_c={class:"dss-tooltip-title"},$c={key:0,class:"dss-bubble-tooltip-data"},Lc={class:"dss-tooltip-series-name"},Tc={class:"dss-tooltip-series-value"},Ac={key:0,class:"dss-tooltip-section"},Dc={class:"dss-tooltip-section-title"},Hc={class:"dss-tooltip-group-header"},Rc={class:"dss-tooltip-item-content"},Fc={class:"dss-tooltip-item-text"},Ic={key:1,class:"dss-tooltip-section"},zc={class:"dss-tooltip-section-title"},Pc={class:"dss-tooltip-item-content"},Oc={class:"dss-tooltip-item-title"},Wc={key:0,class:"dss-tooltip-item-description"},qc=["onClick","onMouseenter"],Zc={class:"dss-legend-text"},Uc={key:1,class:"dss-context-menu-separator"},Xc={key:0,class:"dss-context-menu-separator"},Yc={key:0,class:"dss-context-menu-separator"},jc=["onClick"],Kc=["innerHTML"],Gc={key:0,class:"dss-context-menu-icon"},Qc={class:"dss-marker-modal-header"},Jc={class:"dss-marker-modal-body"},eu={class:"dss-form-group"},tu={class:"dss-form-group"},lu={for:"dss-marker-description"},nu={key:0,class:"dss-form-text-display"},ou=["placeholder"],au={class:"dss-marker-modal-footer"},su={class:"modal-footer-left"},ru={class:"dss-modal-footer-right"},iu=["disabled"],cu={name:"DSSChart"},uu=Object.assign(cu,{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:S=>typeof S=="object"&&S!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(S,{emit:ee}){const{t:L,locale:N}=so.useI18n(),ue=ee,O=e.ref(null),H=e.ref(null),me=e.ref(null),ot=e.ref(null),ne=e.ref(0),f=e.ref(0);let be=null,he=null;const oe=20,j=e.computed(()=>{if(f.value,ne.value,!O.value||!me.value)return 0;try{const t=O.value.getBoundingClientRect();return me.value.getBoundingClientRect().top-t.top}catch{return 0}}),fe=e.computed(()=>`chart-clip-${V.chartId}`),_e=e.computed(()=>`url(#${fe.value})`),V=S,$e={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},stepbar:{totalValue:100,segmentOrder:"input",showRemainder:!0,remainderLabel:"Remaining",remainderColor:"#E5E7EB",barWidth:14,columnWidth:72,trackWidth:14,minBarWidth:12,maxBarWidth:120,barRadius:6,columnGap:16,labelReserve:48,axisBars:{show:!0,showVertical:!1,color:"#d6d6d6",opacity:.75,width:1,dashArray:"3,4"},maxSegment:{marker:{enabled:!1,icon:"",radius:8,backgroundColor:null,borderColor:"#fafafa",borderWidth:2,color:"#fafafa",fontSize:10}}},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5,comparison:{fillOpacity:0,strokeDasharray:"6,4",usePrimaryColor:!0,bubbleSize:0}},zoom:{enabled:!1,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function lt(t,o){const l=Object.assign({},t);return Qe(t)&&Qe(o)&&Object.keys(o).forEach(r=>{Qe(o[r])?r in t?l[r]=lt(t[r],o[r]):Object.assign(l,{[r]:o[r]}):Object.assign(l,{[r]:o[r]})}),l}const rt=()=>{let t=20,o=0,l=0;if(dt.value&&(t+=30),Ye.value&&(t+=25),A.value&&V.series.length>0){const r=V.series.filter((m,v)=>!st.value.has(v)).length;if(X.value==="top"||X.value==="bottom"){if(ae.value==="horizontal"){const v=Math.floor(ye.value/100);o=Math.ceil(r/v)*25+10}else o=r*25+10;t+=o}else l=150}return{height:t,legendHeight:o,legendWidth:l}};function Qe(t){return t&&typeof t=="object"&&!Array.isArray(t)}const Z=e.computed(()=>lt($e,V.options)),qe=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.width==="auto"}),ze=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.height==="auto"}),ye=e.computed(()=>{const t=Z.value;return qe.value?ne.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Ue=e.ref(oe),ke=e.computed(()=>{if(ze.value){const t=ke.value;return t??Math.max(0,(f.value||400)-Ue.value*5)}}),Te=e.computed(()=>{const t=Z.value;if(ge.value==="mini-radial")return ye.value;if(ze.value){const o=ke.value;return o??Math.max(0,(f.value||400)-Ue.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),at=e.computed(()=>{if(ze.value&&ge.value==="semi-radial"&&ke.value!=null)return Ue.value+Te.value+"px";if(ze.value)return"100%";if(Cl.value)return Ue.value+Te.value+"px";if(A.value&&X.value==="bottom"){const t=rt();return Te.value+(t.legendHeight||35)+"px"}return Te.value+(A.value?20:0)+"px"}),ge=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Ft=e.computed(()=>{const t=V.series.map(o=>o.type||ge.value);return new Set(t).size>1}),dt=e.computed(()=>{const t=Z.value;return t&&t.title&&t.title.text?t.title.text:""}),Ye=e.computed(()=>{const t=Z.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),Pt=e.computed(()=>{const t=Z.value;if(!t||!t.zAxis)return"";const o=t.zAxis;return typeof o=="string"?o:o&&typeof o.label=="string"?o.label:""}),It=e.computed(()=>{const t=Z.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),bt=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),ft=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),Yt=e.computed(()=>{const t=ft.value;return t&&t.title&&t.title.text?t.title.text:""}),it=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return Ml;const o=t.yAxis.min;return typeof o=="number"||o===Ml?o:Ml}),At=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return Ml;const o=t.yAxis.max;return typeof o=="number"||o===Ml?o:Ml}),ht=e.computed(()=>{const t=ft.value;if(!t)return Ml;const o=t.min;return typeof o=="number"||o===Ml?o:Ml}),il=e.computed(()=>{const t=ft.value;if(!t)return Ml;const o=t.max;return typeof o=="number"||o===Ml?o:Ml}),St=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Dt=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),pe=e.computed(()=>{const t=Z.value;return t&&t.grid&&t.grid.show!==!1}),A=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.show!==!1}),X=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),ae=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Ce=e.computed(()=>{const t=Z.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),je=e.computed(()=>{const t=Z.value;if(!t)return!1;if(jt.value){if(!t.crosshair)return!0;const l=t.crosshair.show;return l!==!1&&l!=="false"}if(!t.crosshair)return!1;const o=t.crosshair.show;return o===!0||o==="true"}),Ge=e.computed(()=>{const t=Z.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Vt=e.computed(()=>{const t=Z.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Pe=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Ke=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),nt=e.computed(()=>{const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),qt=e.computed(()=>{if(!Cl.value)return 0;const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),te=e.computed(()=>{const t=Z.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),K=e.computed(()=>{const{maxX:t}=Wt.value;return t===0}),Q=(t,o)=>K.value&&o===0?5:o,ce=t=>{const o=Number(t);return!Number.isFinite(o)||o<=0?0:o},Ve=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),We=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),Nt=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),Ot=e.computed(()=>{const t=Z.value;return We.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),pt=e.computed(()=>{const t=Z.value,o=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return o.length>0?o:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),wt=e.computed(()=>Z.value?.stepbar||{}),B=e.computed(()=>{const t=wt.value?.segmentOrder;return["asc","desc","input"].includes(t)?t:"input"}),w=e.computed(()=>{const t=Number(wt.value?.totalValue);return Number.isFinite(t)&&t>0?t:100}),T=e.computed(()=>wt.value?.showRemainder!==!1),ie=e.computed(()=>wt.value?.remainderLabel||"Remaining"),re=e.computed(()=>wt.value?.remainderColor||"#E5E7EB"),He=e.computed(()=>{const t=Number(wt.value?.barWidth);return Number.isFinite(t)&&t>0?t:42}),gt=e.computed(()=>{const t=Number(wt.value?.minBarWidth);return Number.isFinite(t)&&t>0?t:12}),et=e.computed(()=>{const t=Number(wt.value?.maxBarWidth);return Number.isFinite(t)&&t>0?t:58});e.computed(()=>{const t=Number(wt.value?.barRadius);return Number.isFinite(t)&&t>=0?t:6});const Ae=e.computed(()=>wt.value?.axisBars||{}),yt=e.computed(()=>Ae.value?.show!==!1);e.computed(()=>Ae.value?.showVertical===!0);const Et=e.computed(()=>Ae.value?.color||"#d6d6d6"),xt=e.computed(()=>{const t=Number(Ae.value?.opacity);return Number.isFinite(t)?Math.min(Math.max(t,0),1):.75}),$t=e.computed(()=>{const t=Number(Ae.value?.width);return Number.isFinite(t)&&t>0?t:1}),Ht=e.computed(()=>Ae.value?.dashArray||"3,4"),kt=e.computed(()=>{const t=Number(wt.value?.columnGap);return Number.isFinite(t)&&t>=0?t:16}),Gt=e.computed(()=>{const t=Number(wt.value?.labelReserve);return Number.isFinite(t)&&t>0?t:48}),Ll=e.computed(()=>Math.max(z.value.height,0)),hl=e.computed(()=>{const t=Number(wt.value?.columnWidth);if(Number.isFinite(t)&&t>0)return t;const o=He.value,l=gt.value,r=et.value;return Math.max(l,Math.min(r,o))}),Nl=e.computed(()=>{const t=Number(wt.value?.trackWidth);if(Number.isFinite(t)&&t>0)return Math.min(t,hl.value);const o=Number(wt.value?.barWidth);return Number.isFinite(Number(wt.value?.columnWidth))&&Number(wt.value?.columnWidth)>0&&Number.isFinite(o)&&o>0?Math.min(o,hl.value):Math.min(hl.value,Math.max(10,Math.round(hl.value*.32)))}),cl=e.computed(()=>({width:`${hl.value}px`,flex:`0 0 ${hl.value}px`,"--dss-step-bar-track-thickness":`${Nl.value}px`,"--dss-stepbar-label-height":`${Gt.value}px`})),nn=e.computed(()=>{const t=Ul.value.length;return t?t*hl.value+Math.max(0,t-1)*kt.value:0}),un=e.computed(()=>({maxSegment:{marker:{enabled:!1}}})),Ul=e.computed(()=>jt.value?Qn.value.map(t=>({key:t.key,label:t.axisLabel||t.label,totalValue:t.totalValue,segments:t.segments.filter(o=>!o.isRemainder).map(o=>({label:o.label,value:o.value,color:o.color,marker:o.marker}))})):[]),Tl=e.computed(()=>{if(!jt.value)return[];const{minY:t,maxY:o}=Wt.value,l=5,r=[];for(let m=0;m<=l;m++){const v=t+(o-t)*(m/l);r.push({top:Vl(v)-z.value.top,value:v})}return r}),dn=e.computed(()=>({top:`${z.value.top}px`,left:`${z.value.left}px`,width:`${z.value.width}px`,height:`${Ll.value+Gt.value}px`})),Al=e.computed(()=>({width:`${nn.value}px`,minHeight:`${Ll.value+Gt.value}px`})),Wn=e.computed(()=>jt.value&&je.value&&$.value.show&&!U.value.isZooming),Ln=e.computed(()=>{const t=hl.value+kt.value;return{left:`${$.value.categoryIndex*t+hl.value/2}px`,height:`${Ll.value}px`,borderColor:Ge.value}}),El=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.enabled!==!1}),on=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),Dl=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),Ol=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),Hl=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),ul=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),Tn=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.onDataChange!==!1}),R=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),W=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),D=e.computed(()=>Z.value?.spider?.gridSteps||5),se=e.computed(()=>{const t=[],o=D.value;for(let l=1;l<=o;l++)t.push(vt.value/o*l);return t}),De=t=>{const o=mt.value;if(o&&Array.isArray(o)&&o[t]!==void 0)return o[t].toString();const l=se.value[t];return Math.round(l/vt.value*100)+"%"},mt=e.computed(()=>Z.value?.spider?.gridLabels||null),ut=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Ze=e.computed(()=>{const t=Z.value,o={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...o,...t.contextMenu.items}:o}),Je=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),dl=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Ql.value}),ml=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Tt=e.computed(()=>{const t=Z.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),ll=e.computed(()=>{const o=Z.value?.valueFormat?.extension;return typeof o=="string"?o:""}),Bt=t=>{const o=ll.value;if(t==null)return"";const l=String(t);return o?l+o:l},Bl=e.computed(()=>!U.value.isZooming);e.computed(()=>tt.value.map(t=>{if(t.categoryIndex!==void 0&&(kl.value||el.value)){const o=tl(t.categoryIndex),l=j.value+z.value.bottom-Tt.value/2;return{...t,x:o,y:l}}return t}));function mn(t,o){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[v,C,b]=t.split("-"),q=Number(b?.length===2?`20${b}`:b);l=new Date(q,Number(C)-1,Number(v))}else return 0;let r=0,m=1/0;return o.forEach((v,C)=>{const[b,q,_]=v.split("-"),I=Number(_?.length===2?`20${_}`:_),M=new Date(I,Number(q)-1,Number(b)),G=Math.abs(M-l);G<m&&(m=G,r=C)}),r}const Qt=e.computed(()=>{const t=V.markers.map(l=>{const r=mn(l.marker_date,V.categories),m=tl(r),v=j.value+z.value.bottom-Tt.value/2;return{...l,x:m,y:v,categoryIndex:r,source:"props"}}),o=tt.value.map(l=>{if(l.categoryIndex!==void 0&&(kl.value||el.value)){const r=tl(l.categoryIndex),m=j.value+z.value.bottom-Tt.value/2;return{...l,x:r,y:m,source:"internal"}}return{...l,source:"internal"}});return[...t,...o]}),Mt=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.enabled===!0}),wn=e.computed(()=>{const t=Z.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),An=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),_l=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),an=e.computed(()=>{const t={left:z.value.left,top:z.value.top,width:z.value.width,height:z.value.height};let o,l;const r=String(An.value);if(r.includes("%")){const m=parseFloat(r)/100;o=t.width*m,l=o*(96/499)}else{const m=parseFloat(r)||25;o=Math.min(t.width*.25,200)*(m/25),l=o*(96/499)}return{width:o,height:l,area:t}}),pn=e.computed(()=>{const{width:t,height:o}=an.value,l=_l.value;let r,m;const v=z.value.left,C=z.value.right,b=z.value.top,q=z.value.bottom,_=z.value.width,I=z.value.height;switch(l){case"center":r=v+(_-t)/2,m=b+(I-o)/2;break;case"top-left":r=v+15,m=b+5;break;case"top-right":r=C-t-15,m=b+5;break;case"bottom-left":r=v+15,m=q-o-5;break;case"bottom-right":default:r=C-t-15,m=q-o-5;break}return{backgroundPositionX:r+"px",backgroundPositionY:m+"px",backgroundSize:`${t}px ${o}px`}}),qn=t=>!V.flags||!V.flags.length?[]:V.flags.filter(o=>o.categoryIndex===t),Rl=t=>{const o=qn(t),l=Go(t),r=o.filter(C=>C.manual),m=o.filter(C=>!C.manual),v=[];return r.length>0&&v.push({type:L("chart.tooltip.manualFlags"),color:"#698dbe",flags:r.map(C=>({text:C.text,color:"#698dbe"}))}),m.length>0&&v.push({type:L("chart.tooltip.autoFlags"),color:"#a1d499",flags:m.map(C=>({text:C.text,color:"#a1d499"}))}),{flagGroups:v,markers:l.map(C=>({title:C.title,description:C.description,type:L("chart.tooltip.markers"),color:C.color||"#9784ba"}))}},Ql=e.computed(()=>{const t=V.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)}`}),
|
|
18
|
+
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Jt=e.computed(()=>{const t=V.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)}`}),
|
|
45
|
-
`)}})}),Il=e.ref({show:!1,x:0,y:0,content:"",count:0}),ll=e.computed(()=>Z.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),Wn=e.computed(()=>{const t=Z.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),dl=e.computed(()=>Z.value?.bubbles?.tooltip?.formatters||{}),wt=e.ref(new Set),$e=e.ref(null),Sn=e.ref(!1),dt=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),sl=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),ot=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),mt=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),ce=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),tl=e.ref([]),Oe=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(!R.categories||R.categories.length===0){const{maxX:t}=ge.value;return Array.from({length:t+1},(o,l)=>_("chart.fallback.item",{number:l+1}))}return R.categories});const Ll=e.computed(()=>{if(!R.categories||R.categories.length===0)return null;const t=R.categories[0],[o,l,r]=String(t).split("-"),m=Number(r?.length===2?`20${r}`:r),v=Number(o),C=Number(l)-1;return!v||!l||!m?null:new Date(m,C,v)}),sn=e.computed(()=>{if(!R.categories||R.categories.length===0)return null;const t=R.categories[R.categories.length-1],[o,l,r]=String(t).split("-"),m=Number(r?.length===2?`20${r}`:r),v=Number(o),C=Number(l)-1;return!v||!l||!m?null:new Date(m,C,v)}),Tl=e.computed(()=>Oe.value.editingMarkerId!==null),nl=e.computed(()=>Oe.value.readonly),zl=t=>{wt.value.has(t)||(oa.value=!0,$e.value=t)},y=()=>{oa.value=!1,$e.value=null},g=t=>{if(wo.value||zo.value){ot.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top,v=Gt.value?r>=I.value.left-50&&r<=I.value.right+50&&m>=I.value.top-50&&m<=I.value.bottom+100:r>=I.value.left&&r<=I.value.right&&m>=I.value.top&&m<=I.value.bottom;if(Sn.value=v,Gt.value){if(!Ue.value||!v||ce.value.isDragging||ce.value.isZooming){ot.value.show=!1;return}if(Fo.value.find(re=>!re||re.isHidden?!1:Math.sqrt(Math.pow(re.x-r,2)+Math.pow(re.y-m,2))<=re.radius+3))ot.value.show=!1;else{const re=Fo.value.filter(ye=>!ye||ye.isHidden?!1:Math.sqrt(Math.pow(ye.x-r,2)+Math.pow(ye.y-m,2))<=250);if(re.length>0){let ye=re[0],Ee=Math.sqrt(Math.pow(ye.x-r,2)+Math.pow(ye.y-m,2));re.forEach(ze=>{const Te=Math.sqrt(Math.pow(ze.x-r,2)+Math.pow(ze.y-m,2));Te<Ee&&(Ee=Te,ye=ze)});const ve=30,Xe=Fo.value.filter(ze=>!ze||ze.isHidden?!1:Math.abs(ze.x-ye.x)<=ve).sort((ze,Te)=>ze.y-Te.y);ot.value={show:!0,x:ye.x,categoryIndex:Math.round(ye.originalX),data:(()=>{const ze=ll.value,Te=Wn.value,Ve=[];return Xe.forEach(De=>{ze.forEach(Nt=>{const It=Te[Nt]||Nt,Rl=ha(Nt,De);Rl&&Ve.push({seriesName:De.seriesName,label:De.label,value:`${It}: ${Rl}`,color:De.color,y:De.y})})}),Ve})()}}else ot.value.show=!1}return}if(ce.value.isDragging&&ce.value.scale>1&&Nl.value&&Ke.value){ot.value.show=!1;const Ze=t.clientX-ce.value.lastMouseX,{minX:re,maxX:ye}=ge.value,Ee=ye-re||1,Xe=Ze*.8;ce.value.offsetX+=Xe;const ze=Ee/ce.value.scale,Te=Ee-ze,Ve=0,De=-Te/Ee*I.value.width,Nt=Ve;ce.value.offsetX=Math.max(De,Math.min(Nt,ce.value.offsetX)),ce.value.lastMouseX=t.clientX,ce.value.lastMouseY=t.clientY;return}if(!Ue.value||!Nl.value||ce.value.isDragging||ce.value.isZooming||!v){ot.value.show=!1;return}const{minX:C,maxX:b}=ge.value,F=b-C||1,N=F/ce.value.scale,L=C-ce.value.offsetX/I.value.width*F,S=(r-I.value.left)/I.value.width,K=L+S*N,Be=Math.round(K);if(Be>=0&&Be<=b){const Ze=ht(Be),re=Ql.value.map((ye,Ee)=>{const ve=R.series.findIndex(ze=>ze===ye),Xe=ye.data[Be];return{seriesName:ye.name,value:Xe!==void 0?Xe:null,color:Qt(ve),y:Xe!==void 0?Ot(ye,Xe):null}}).filter(ye=>ye.value!==null);ot.value={show:!0,x:Ze,categoryIndex:Be,data:re}}},x=()=>{ot.value.show=!1,Sn.value=!1,zo.value=!1,wo.value||(Il.value.show=!1),ce.value.isDragging&&(ce.value.isDragging=!1),ce.value.zoomTimeout&&(clearTimeout(ce.value.zoomTimeout),ce.value.zoomTimeout=null),ce.value.isZooming=!1,setTimeout(()=>{$e.value=null,dt.value.show=!1},150)},q=t=>{if(t.preventDefault(),t.stopPropagation(),!on.value)return;const o=t.currentTarget.getBoundingClientRect(),l=t.clientX-o.left,r=t.clientY-o.top;if(cl.value){mt.value.show=!1,e.nextTick(()=>{mt.value.show=!0,mt.value.x=t.clientX,mt.value.y=t.clientY,mt.value.categoryIndex=null});return}const m=Math.max(0,I.value.left-20),v=I.value.right,C=I.value.top,b=I.value.bottom+80;l>=m&&l<=v&&r>=C&&r<=b&&(mt.value.show=!1,e.nextTick(()=>{mt.value.show=!0,mt.value.x=t.clientX,mt.value.y=t.clientY,mt.value.categoryIndex=null;const F=Math.max(I.value.left,Math.min(l,I.value.right))-I.value.left,L=I.value.width/bo.value.length,S=Math.floor(F/L);S>=0&&S<bo.value.length&&(mt.value.categoryIndex=S)}))},ue=t=>{if(!(t&&t.button===2)){if(mt.value.show&&t&&t.type==="click"){const o=document.querySelector(".dss-context-menu");if(o&&o.contains(t.target))return}mt.value.show=!1}},at=t=>{if(typeof t.template=="function"){const o={series:R.series,categories:R.categories,markers:tl.value},l={chartX:mt.value.chartX,chartY:mt.value.chartY,dataX:mt.value.mouseDataX,dataY:mt.value.mouseDataY,categoryIndex:mt.value.categoryIndex};return t.template(o,l)}return t.template||t.label||""},Xt=t=>{const o=["dss-context-menu-item"];return t.cssClass&&o.push(t.cssClass),o},Cl=t=>t.style||{},Pl=t=>t.type&&Hl.value[t.type]?Hl.value[t.type]:t.customIcon?t.customIcon:Kl.value,Ul=t=>t==null?"":R.categories&&R.categories[t]?R.categories[t]:"",hn=t=>tl.value.length?tl.value.filter(o=>o.categoryIndex===t):[],uo=t=>{if(!Nl.value&&!Gt.value)return{x:0,y:0};const o=ht(t),l=J.value+I.value.bottom-Ml.value/2;return{x:o,y:l}},So=()=>{tl.value.forEach(t=>{if(t.categoryIndex!==void 0&&(Nl.value||Gt.value)){const o=uo(t.categoryIndex);t.x=o.x,t.y=o.y}})},Vo=()=>{if(Oe.value.description&&Oe.value.description.length&&Oe.value.date){if(Tl.value){const t=tl.value.findIndex(o=>o.id===Oe.value.editingMarkerId);t!==-1?(tl.value[t].description=Oe.value.description||"",tl.value[t].color=Oe.value.color||"",tl.value[t].type=Oe.value.type||"default",de("update-marker",tl.value[t])):de("update-marker",{id:Oe.value.editingMarkerId,description:Oe.value.description||"",color:Oe.value.color||"",type:Oe.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let o=D(Oe.value.date,R.categories||[]);if(Gt.value){const{maxX:C}=ge.value;o=Math.max(0,Math.min(o,Math.floor(C)))}else Nl.value&&(o=Math.max(0,Math.min(o,ge.value.maxX)));const l=ht(o),r=J.value+I.value.bottom-Ml.value/2,m=Array.isArray(R.categories)?R.categories[o]:null,v={id:t,title:"",description:Oe.value.description||"",color:Oe.value.color||"",type:Oe.value.type||"default",categoryIndex:o,x:l,y:r,marker_date:m||null};Oe.value.categoryIndex=o,tl.value.push(v),de("add-marker",v)}Vn(),po()}},Vn=()=>{Oe.value.show=!1,Oe.value.title="",Oe.value.description="",Oe.value.color="#FF6B6B",Oe.value.type="default",Oe.value.editingMarkerId=null,Oe.value.readonly=!1,Oe.value.categoryIndex=null,Oe.value.fromButton=!1,Oe.value.date=null},Xo=()=>{Tl.value&&(Yo(Oe.value.editingMarkerId),Vn())},Yo=t=>{const o=tl.value.findIndex(l=>l.id===t);o!==-1&&(tl.value.splice(o,1),po()),de("delete-marker",t)},mo=t=>{if(Oe.value.show=!0,Oe.value.title=t?.title??t?.comment??"",Oe.value.description=t?.description??t?.comment??"",Oe.value.color=t?.color??"",Oe.value.type=t?.type??"default",Oe.value.editingMarkerId=t?.id??t?.marker_id??null,Oe.value.readonly=t?.readonly??!1,Oe.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[o,l,r]=String(t.marker_date).split("-"),m=Number(r?.length===2?`20${r}`:r),v=Number(o),C=Number(l)-1;v&&l&&m?Oe.value.date=new Date(m,C,v):Oe.value.date=null}else Oe.value.date=null},po=()=>{try{const t=`dss-chart-markers-${R.chartId}`;localStorage.setItem(t,JSON.stringify(tl.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},jo=()=>{try{const t=`dss-chart-markers-${R.chartId}`,o=localStorage.getItem(t);if(o){const l=JSON.parse(o);Array.isArray(l)&&(tl.value=l.map(r=>({...r,originalYOffset:r.originalYOffset!==void 0?r.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),tl.value=[]}},qn=t=>{const o=ct.value||"Chart",l=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${o.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${l}.${t}`},vo=()=>{const t=ot.value.show,o=dt.value.show;return ot.value.show=!1,dt.value.show=!1,{originalCrosshair:t,originalTooltip:o}},gn=t=>{ot.value.show=t.originalCrosshair,dt.value.show=t.originalTooltip},No=async(t,o=32,l=32)=>new Promise((r,m)=>{if(t.startsWith("data:")){r(t);return}const v=new Image;v.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),r(t)},5e3);v.onload=()=>{clearTimeout(C);try{const b=document.createElement("canvas"),F=b.getContext("2d");b.width=o,b.height=l,F.fillStyle="#fafafa",F.fillRect(0,0,o,l),F.drawImage(v,0,0,o,l);const N=b.toDataURL("image/png");r(N)}catch(b){console.warn("Canvas conversion failed:",b),r(t)}},v.onerror=b=>{clearTimeout(C),console.warn("Failed to load image:",t,b),r(t)},v.src=t}),Ko=async()=>{try{const t=vo();setTimeout(async()=>{try{const o=T.value;if(!o){console.error("Chart SVG element not found"),gn(t);return}const l=Je(),r=Se.value,m=ie.value+l.height,v=o.cloneNode(!0);v.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(ve=>ve.remove());const b=v.querySelectorAll("image"),F=Array.from(b).map(async ve=>{const Xe=ve.getAttribute("xlink:href")||ve.getAttribute("href");if(Xe&&!Xe.startsWith("data:"))try{const ze=await No(Xe,32,32);ve.setAttribute("xlink:href",ze),ve.setAttribute("href",ze)}catch(ze){console.warn("Failed to convert logo to base64:",ze)}});await Promise.all(F);const L=new XMLSerializer().serializeToString(v).replace(/<svg[^>]*>/,"").replace("</svg>","");let S="",K=30;if(ct.value&&(S+=`
|
|
46
|
-
<text x="24" y="${
|
|
44
|
+
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Dn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),Fl=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const Xt=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),Zn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),nl=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Il=e.computed(()=>{const o=Z.value?.radialBar?.dataLabels;return o&&(o.show===!0||o.enabled===!0)}),Un=e.computed(()=>{const o=Z.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof o=="number"&&o>=0?o:20}),Hn=e.computed(()=>{const o=Z.value?.radialBar?.dataCenter;return Kn.value?!0:xl.value&&o&&(o.show===!0||o.enabled===!0)}),xn=e.computed(()=>{if(!Hn.value||!_n.value.length)return"";if(Kn.value){const r=_n.value[1]??_n.value[0];return Bt(r?.value??0)}const l=Z.value?.radialBar?.dataCenter?.showValueOnly===!0?_n.value[0]?.value??0:_n.value.reduce((r,m)=>r+(m.value??0),0);return Bt(l)}),wl=e.computed(()=>{const o=Z.value?.radialBar?.dataCenter?.fontSize;return typeof o=="number"&&o>0?o:24}),Xn=e.computed(()=>({x:Lt.value,y:Kn.value?Ct.value:Ct.value-wl.value/2})),sn=e.computed(()=>{const o=Z.value?.radialBar?.dataCenter?.color;return typeof o=="string"&&o?o:"#333"}),Yn=e.computed(()=>{if(!Il.value||!Cl.value||!_n.value.length)return[];const t=Un.value*Math.PI/180,o=(sl.value+vt.value)/2;return _n.value.map(l=>{const m=l.endAngle-l.startAngle>=t&&!l.isHidden,v=Lt.value+Math.cos(l.midAngle)*o,C=Ct.value+Math.sin(l.midAngle)*o;return{value:Bt(l.value),x:v,y:C,show:m,color:l.color,contrastColor:Oa(l.color)}})}),rn=e.computed(()=>{if(!V.flags||!V.flags.length)return[];const t=new Map;return V.flags.forEach(o=>{const l=o.categoryIndex;t.has(l)||t.set(l,[]),t.get(l).push(o)}),Array.from(t.entries()).map(([o,l])=>{const r=tl(o),m=l.filter(C=>C.manual),v=l.filter(C=>!C.manual);return{categoryIndex:parseInt(o),x:r,flags:l,manualCount:m.length,autoCount:v.length,totalCount:l.length,hasManual:m.length>0,hasAuto:v.length>0,texts:l.map(C=>C.text).join(`
|
|
45
|
+
`)}})}),Rn=e.ref({show:!1,x:0,y:0,content:"",count:0}),Sl=e.computed(()=>Z.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),Jl=e.computed(()=>{const t=Z.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Xl=e.computed(()=>Z.value?.bubbles?.tooltip?.formatters||{}),st=e.ref(new Set),Ne=e.ref(null),y=e.ref(!1),h=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),x=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),$=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),Y=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),U=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),tt=e.ref([]),Se=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 ml.value&&t.push(...Object.keys(ml.value)),t}),e.computed(()=>{if(!V.categories||V.categories.length===0){const{maxX:t}=Wt.value;return Array.from({length:t+1},(o,l)=>L("chart.fallback.item",{number:l+1}))}return V.categories});const zl=e.computed(()=>{if(!V.categories||V.categories.length===0)return null;const t=V.categories[0],[o,l,r]=String(t).split("-"),m=Number(r?.length===2?`20${r}`:r),v=Number(o),C=Number(l)-1;return!v||!l||!m?null:new Date(m,C,v)}),Wl=e.computed(()=>{if(!V.categories||V.categories.length===0)return null;const t=V.categories[V.categories.length-1],[o,l,r]=String(t).split("-"),m=Number(r?.length===2?`20${r}`:r),v=Number(o),C=Number(l)-1;return!v||!l||!m?null:new Date(m,C,v)}),ql=e.computed(()=>Se.value.editingMarkerId!==null),vn=e.computed(()=>Se.value.readonly),uo=t=>{st.value.has(t)||(ca.value=!0,Ne.value=t)},Jn=()=>{ca.value=!1,Ne.value=null},Uo=t=>{if(Co.value||Fo.value){$.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top,v=el.value?r>=z.value.left-50&&r<=z.value.right+50&&m>=z.value.top-50&&m<=z.value.bottom+100:jt.value?r>=z.value.left&&r<=z.value.right&&m>=z.value.top&&m<=z.value.bottom+Gt.value:r>=z.value.left&&r<=z.value.right&&m>=z.value.top&&m<=z.value.bottom;if(y.value=v,el.value){if(!je.value||!v||U.value.isDragging||U.value.isZooming){$.value.show=!1;return}if(Ho.value.find(ve=>!ve||ve.isHidden?!1:Math.sqrt(Math.pow(ve.x-r,2)+Math.pow(ve.y-m,2))<=ve.radius+3))$.value.show=!1;else{const ve=Ho.value.filter(xe=>!xe||xe.isHidden?!1:Math.sqrt(Math.pow(xe.x-r,2)+Math.pow(xe.y-m,2))<=250);if(ve.length>0){let xe=ve[0],Ee=Math.sqrt(Math.pow(xe.x-r,2)+Math.pow(xe.y-m,2));ve.forEach(Ie=>{const Le=Math.sqrt(Math.pow(Ie.x-r,2)+Math.pow(Ie.y-m,2));Le<Ee&&(Ee=Le,xe=Ie)});const de=30,Xe=Ho.value.filter(Ie=>!Ie||Ie.isHidden?!1:Math.abs(Ie.x-xe.x)<=de).sort((Ie,Le)=>Ie.y-Le.y);$.value={show:!0,x:xe.x,categoryIndex:Math.round(xe.originalX),data:(()=>{const Ie=Sl.value,Le=Jl.value,Me=[];return Xe.forEach(Re=>{Ie.forEach(_t=>{const zt=Le[_t]||_t,Kl=xa(_t,Re);Kl&&Me.push({seriesName:Re.seriesName,label:Re.label,value:`${zt}: ${Kl}`,color:Re.color,y:Re.y})})}),Me})()}}else $.value.show=!1}return}if(jt.value){if(!je.value||!v||U.value.isDragging||U.value.isZooming){$.value.show=!1;return}const Oe=H.value;if(!Oe){$.value.show=!1;return}const ve=Oe.getBoundingClientRect(),xe=t.clientX-ve.left+Oe.scrollLeft,Ee=hl.value+kt.value,de=Math.floor(xe/Ee);if(de<0||de>=Ul.value.length){$.value.show=!1;return}const Xe=Qn.value[de];if(!Xe){$.value.show=!1;return}const Ie=de*Ee+hl.value/2,Le=ve.left+Ie-Oe.scrollLeft-l.left;$.value={show:!0,x:Le,categoryIndex:de,data:Xe.segments.filter(Me=>!Me.isRemainder).map(Me=>({seriesName:Me.label,value:Me.value,color:Me.color,y:null}))};return}if(U.value.isDragging&&U.value.scale>1&&kl.value&&Vt.value&&!jt.value){$.value.show=!1;const Oe=t.clientX-U.value.lastMouseX,{minX:ve,maxX:xe}=Wt.value,Ee=xe-ve||1,Xe=Oe*.8;U.value.offsetX+=Xe;const Ie=Ee/U.value.scale,Le=Ee-Ie,Me=0,Re=-Le/Ee*z.value.width,_t=Me;U.value.offsetX=Math.max(Re,Math.min(_t,U.value.offsetX)),U.value.lastMouseX=t.clientX,U.value.lastMouseY=t.clientY;return}if(!je.value||!kl.value||jt.value||U.value.isDragging||U.value.isZooming||!v){$.value.show=!1;return}const{minX:C,maxX:b}=Wt.value,q=b-C||1,_=q/U.value.scale,I=C-U.value.offsetX/z.value.width*q,M=(r-z.value.left)/z.value.width,G=I+M*_,Be=Math.round(G);if(Be>=0&&Be<=b){const Oe=tl(Be),ve=le.value.map((xe,Ee)=>{const de=V.series.findIndex(Ie=>Ie===xe),Xe=xe.data[Be];return{seriesName:xe.name,value:Xe!==void 0?Xe:null,color:Kt(de),y:Xe!==void 0?rl(xe,Xe):null}}).filter(xe=>xe.value!==null);$.value={show:!0,x:Oe,categoryIndex:Be,data:ve}}},Xo=()=>{$.value.show&&($.value.show=!1)},Yo=()=>Ul.value[$.value.categoryIndex]?.label||L("chart.fallback.item",{number:$.value.categoryIndex+1}),mo=()=>{$.value.show=!1,y.value=!1,Fo.value=!1,Co.value||(Rn.value.show=!1),U.value.isDragging&&(U.value.isDragging=!1),U.value.zoomTimeout&&(clearTimeout(U.value.zoomTimeout),U.value.zoomTimeout=null),U.value.isZooming=!1,setTimeout(()=>{Ne.value=null,h.value.show=!1},150)},xo=t=>{if(t.preventDefault(),t.stopPropagation(),!ut.value)return;const o=t.currentTarget.getBoundingClientRect(),l=t.clientX-o.left,r=t.clientY-o.top;if(Cl.value){Y.value.show=!1,e.nextTick(()=>{Y.value.show=!0,Y.value.x=t.clientX,Y.value.y=t.clientY,Y.value.categoryIndex=null});return}const m=Math.max(0,z.value.left-20),v=z.value.right,C=z.value.top,b=z.value.bottom+80;l>=m&&l<=v&&r>=C&&r<=b&&(Y.value.show=!1,e.nextTick(()=>{Y.value.show=!0,Y.value.x=t.clientX,Y.value.y=t.clientY,Y.value.categoryIndex=null;const q=Math.max(z.value.left,Math.min(l,z.value.right))-z.value.left,I=z.value.width/la.value.length,M=Math.floor(q/I);M>=0&&M<la.value.length&&(Y.value.categoryIndex=M)}))},fn=t=>{if(!(t&&t.button===2)){if(Y.value.show&&t&&t.type==="click"){const o=document.querySelector(".dss-context-menu");if(o&&o.contains(t.target))return}Y.value.show=!1}},jo=t=>{if(typeof t.template=="function"){const o={series:V.series,categories:V.categories,markers:tt.value},l={chartX:Y.value.chartX,chartY:Y.value.chartY,dataX:Y.value.mouseDataX,dataY:Y.value.mouseDataY,categoryIndex:Y.value.categoryIndex};return t.template(o,l)}return t.template||t.label||""},Eo=t=>{const o=["dss-context-menu-item"];return t.cssClass&&o.push(t.cssClass),o},So=t=>t.style||{},Vo=t=>t.type&&ml.value[t.type]?ml.value[t.type]:t.customIcon?t.customIcon:dl.value,Ko=t=>t==null?"":V.categories&&V.categories[t]?V.categories[t]:"",Go=t=>tt.value.length?tt.value.filter(o=>o.categoryIndex===t):[],Qo=t=>{if(!kl.value&&!el.value)return{x:0,y:0};const o=tl(t),l=j.value+z.value.bottom-Tt.value/2;return{x:o,y:l}},po=()=>{tt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(kl.value||el.value)){const o=Qo(t.categoryIndex);t.x=o.x,t.y=o.y}})},Fn=()=>{if(Se.value.description&&Se.value.description.length&&Se.value.date){if(ql.value){const t=tt.value.findIndex(o=>o.id===Se.value.editingMarkerId);t!==-1?(tt.value[t].description=Se.value.description||"",tt.value[t].color=Se.value.color||"",tt.value[t].type=Se.value.type||"default",ue("update-marker",tt.value[t])):ue("update-marker",{id:Se.value.editingMarkerId,description:Se.value.description||"",color:Se.value.color||"",type:Se.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let o=mn(Se.value.date,V.categories||[]);if(el.value){const{maxX:C}=Wt.value;o=Math.max(0,Math.min(o,Math.floor(C)))}else kl.value&&(o=Math.max(0,Math.min(o,Wt.value.maxX)));const l=tl(o),r=j.value+z.value.bottom-Tt.value/2,m=Array.isArray(V.categories)?V.categories[o]:null,v={id:t,title:"",description:Se.value.description||"",color:Se.value.color||"",type:Se.value.type||"default",categoryIndex:o,x:l,y:r,marker_date:m||null};Se.value.categoryIndex=o,tt.value.push(v),ue("add-marker",v)}en(),vo()}},en=()=>{Se.value.show=!1,Se.value.title="",Se.value.description="",Se.value.color="#FF6B6B",Se.value.type="default",Se.value.editingMarkerId=null,Se.value.readonly=!1,Se.value.categoryIndex=null,Se.value.fromButton=!1,Se.value.date=null},eo=()=>{ql.value&&(Jo(Se.value.editingMarkerId),en())},Jo=t=>{const o=tt.value.findIndex(l=>l.id===t);o!==-1&&(tt.value.splice(o,1),vo()),ue("delete-marker",t)},ea=t=>{if(Se.value.show=!0,Se.value.title=t?.title??t?.comment??"",Se.value.description=t?.description??t?.comment??"",Se.value.color=t?.color??"",Se.value.type=t?.type??"default",Se.value.editingMarkerId=t?.id??t?.marker_id??null,Se.value.readonly=t?.readonly??!1,Se.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[o,l,r]=String(t.marker_date).split("-"),m=Number(r?.length===2?`20${r}`:r),v=Number(o),C=Number(l)-1;v&&l&&m?Se.value.date=new Date(m,C,v):Se.value.date=null}else Se.value.date=null},vo=()=>{try{const t=`dss-chart-markers-${V.chartId}`;localStorage.setItem(t,JSON.stringify(tt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},hn=()=>{try{const t=`dss-chart-markers-${V.chartId}`,o=localStorage.getItem(t);if(o){const l=JSON.parse(o);Array.isArray(l)&&(tt.value=l.map(r=>({...r,originalYOffset:r.originalYOffset!==void 0?r.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),tt.value=[]}},Zl=t=>{const o=dt.value||"Chart",l=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${o.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${l}.${t}`},gn=()=>{const t=$.value.show,o=h.value.show;return $.value.show=!1,h.value.show=!1,{originalCrosshair:t,originalTooltip:o}},Yl=t=>{$.value.show=t.originalCrosshair,h.value.show=t.originalTooltip},ol=async(t,o=32,l=32)=>new Promise((r,m)=>{if(t.startsWith("data:")){r(t);return}const v=new Image;v.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),r(t)},5e3);v.onload=()=>{clearTimeout(C);try{const b=document.createElement("canvas"),q=b.getContext("2d");b.width=o,b.height=l,q.fillStyle="#fafafa",q.fillRect(0,0,o,l),q.drawImage(v,0,0,o,l);const _=b.toDataURL("image/png");r(_)}catch(b){console.warn("Canvas conversion failed:",b),r(t)}},v.onerror=b=>{clearTimeout(C),console.warn("Failed to load image:",t,b),r(t)},v.src=t}),No=async()=>{try{const t=gn();setTimeout(async()=>{try{const o=me.value;if(!o){console.error("Chart SVG element not found"),Yl(t);return}const l=rt(),r=ye.value,m=Te.value+l.height,v=o.cloneNode(!0);v.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(de=>de.remove());const b=v.querySelectorAll("image"),q=Array.from(b).map(async de=>{const Xe=de.getAttribute("xlink:href")||de.getAttribute("href");if(Xe&&!Xe.startsWith("data:"))try{const Ie=await ol(Xe,32,32);de.setAttribute("xlink:href",Ie),de.setAttribute("href",Ie)}catch(Ie){console.warn("Failed to convert logo to base64:",Ie)}});await Promise.all(q);const I=new XMLSerializer().serializeToString(v).replace(/<svg[^>]*>/,"").replace("</svg>","");let M="",G=30;if(dt.value&&(M+=`
|
|
46
|
+
<text x="24" y="${G}"
|
|
47
47
|
font-family="Arial, sans-serif"
|
|
48
48
|
font-size="18"
|
|
49
49
|
font-weight="bold"
|
|
50
50
|
fill="#333">
|
|
51
|
-
${
|
|
52
|
-
</text>`,
|
|
53
|
-
<text x="24" y="${
|
|
51
|
+
${dt.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
52
|
+
</text>`,G+=30),Ye.value&&(M+=`
|
|
53
|
+
<text x="24" y="${G}"
|
|
54
54
|
font-family="Arial, sans-serif"
|
|
55
55
|
font-size="14"
|
|
56
56
|
fill="#666">
|
|
57
|
-
${
|
|
58
|
-
</text>`,
|
|
59
|
-
<g opacity="${
|
|
60
|
-
<g transform="translate(${
|
|
57
|
+
${Ye.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
58
|
+
</text>`,G+=25),A.value&&V.series.length>0){let de=r-200,Xe=dt.value||Ye.value?35:25;const Ie=Math.floor((r-250)/120);let Le=0;V.series.forEach((Me,Re)=>{if(!st.value.has(Re)){const _t=Kt(Re),zt=Me.name.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");M+=`<circle cx="${de+6}" cy="${Xe-4}" r="6" fill="${_t}"/>`,M+=`<text x="${de+18}" y="${Xe}" font-family="Arial, sans-serif" font-size="12" fill="#333">${zt}</text>`,Le++,Le%Ie===0?(de=r-200,Xe+=20):de+=Math.min(120,zt.length*8+35)}})}let Be="";if(Mt.value)try{const{width:de,height:Xe}=an.value,Ie=_l.value,Le=z.value.left,Me=z.value.right,Re=z.value.top,_t=z.value.bottom,zt=z.value.width,Kl=z.value.height;let yl,Gl;switch(Ie){case"center":yl=Le+(zt-de)/2,Gl=Re+(Kl-Xe)/2;break;case"top-left":yl=Le+15,Gl=Re+5;break;case"top-right":yl=Me-de-5,Gl=Re+5;break;case"bottom-left":yl=Le+15,Gl=_t-Xe-5;break;case"bottom-right":default:yl=Me-de-5,Gl=_t-Xe-5;break}Be=`
|
|
59
|
+
<g opacity="${wn.value}">
|
|
60
|
+
<g transform="translate(${yl}, ${Gl}) scale(${de/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(
|
|
75
|
+
</g>`}catch(de){console.warn("Watermark processing failed, skipping watermark in SVG:",de),Be=""}const Oe=`<?xml version="1.0" encoding="UTF-8"?>
|
|
76
76
|
<svg width="${r}" height="${m}"
|
|
77
77
|
xmlns="http://www.w3.org/2000/svg"
|
|
78
78
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
@@ -84,37 +84,37 @@
|
|
|
84
84
|
</style>
|
|
85
85
|
</defs>
|
|
86
86
|
<rect width="100%" height="100%" fill="#fafafa"/>
|
|
87
|
-
${
|
|
87
|
+
${M}
|
|
88
88
|
<g transform="translate(0, ${l.height})">
|
|
89
|
-
${
|
|
89
|
+
${I}
|
|
90
90
|
${Be}
|
|
91
91
|
</g>
|
|
92
|
-
</svg>`,
|
|
93
|
-
`),
|
|
94
|
-
`),t+=`# ${
|
|
92
|
+
</svg>`,ve=new Blob([Oe],{type:"image/svg+xml;charset=utf-8"}),xe=URL.createObjectURL(ve),Ee=document.createElement("a");Ee.href=xe,Ee.download=Zl("svg"),document.body.appendChild(Ee),Ee.click(),document.body.removeChild(Ee),URL.revokeObjectURL(xe),Yl(t),fn()}catch(o){console.error("Error downloading SVG:",o),Yl(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},Bo=async()=>{try{const t=gn();O.value&&O.value.offsetHeight,await new Promise(de=>setTimeout(de,300));const o=rt(),l=ye.value,r=Te.value+o.height,m=document.createElement("canvas"),v=m.getContext("2d"),C=2;m.width=l*C,m.height=r*C,m.style.width=l+"px",m.style.height=r+"px",v.scale(C,C),v.fillStyle="#fafafa",v.fillRect(0,0,l,r);let b=30;if(dt.value&&(v.fillStyle="#333",v.font="bold 18px Arial, sans-serif",v.fillText(dt.value,24,b),b+=30),Ye.value&&(v.fillStyle="#666",v.font="14px Arial, sans-serif",v.fillText(Ye.value,24,b),b+=25),A.value&&V.series.length>0){let de=l-200,Xe=dt.value||Ye.value?35:25;const Ie=Math.floor((l-250)/120);let Le=0;v.font="12px Arial, sans-serif",V.series.forEach((Me,Re)=>{if(!st.value.has(Re)){const _t=Kt(Re);v.beginPath(),v.arc(de+6,Xe-4,6,0,2*Math.PI),v.fillStyle=_t,v.fill(),v.fillStyle="#333",v.fillText(Me.name,de+18,Xe),Le++,Le%Ie===0?(de=l-200,Xe+=20):de+=Math.min(120,Me.name.length*8+35)}})}const _=me.value.cloneNode(!0),I=_.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),M=_.querySelectorAll(".dss-crosshair"),G=_.querySelectorAll('[class*="tooltip"]');I.forEach(de=>de.remove()),M.forEach(de=>de.remove()),G.forEach(de=>de.remove()),_.querySelectorAll("image").forEach((de,Xe)=>{const Ie=de.getAttribute("xlink:href")||de.getAttribute("href");if(Ie&&!Ie.startsWith("data:")){const Le=Ro.value[Xe],Me=Le?Kt(Le.seriesIndex):"#3B82F6",Re=de.getAttribute("x")||0,_t=de.getAttribute("y")||0,zt=de.getAttribute("width")||32,Kl=de.getAttribute("height")||32,yl=document.createElementNS("http://www.w3.org/2000/svg","circle");yl.setAttribute("cx",parseFloat(Re)+parseFloat(zt)/2),yl.setAttribute("cy",parseFloat(_t)+parseFloat(Kl)/2),yl.setAttribute("r",Math.min(parseFloat(zt),parseFloat(Kl))/2-1),yl.setAttribute("fill",Me),yl.setAttribute("stroke","#fafafa"),yl.setAttribute("stroke-width","2"),de.parentNode.replaceChild(yl,de)}});const Oe=new XMLSerializer().serializeToString(_),ve=new Blob([Oe],{type:"image/svg+xml;charset=utf-8"}),xe=URL.createObjectURL(ve),Ee=new Image;return new Promise((de,Xe)=>{Ee.onload=async()=>{try{if(v.drawImage(Ee,0,o.height),Ro.value.forEach(Ie=>{const Le=Ie.x,Me=Ie.y+o.height,Re=(Ie.width||32)/2,_t=Kt(Ie.seriesIndex);v.save(),v.beginPath(),v.arc(Le,Me,Re-1,0,2*Math.PI),v.fillStyle=_t,v.fill(),v.strokeStyle="#fafafa",v.lineWidth=2,v.stroke(),v.restore()}),Mt.value){const Ie=new Image,Le=()=>{const{width:Re,height:_t}=an.value,zt=_l.value,Kl=z.value.left,yl=z.value.right,Gl=z.value.top,zo=z.value.bottom,fs=z.value.width,hs=z.value.height;let oo,ao;switch(zt){case"center":oo=Kl+(fs-Re)/2,ao=Gl+o.height+(hs-_t)/2;break;case"top-left":oo=Kl+15,ao=Gl+o.height+10;break;case"top-right":oo=yl-Re-5,ao=Gl+o.height+10;break;case"bottom-left":oo=Kl+15,ao=zo+o.height-_t-5;break;case"bottom-right":default:oo=yl-Re-5,ao=zo+o.height-_t-5;break}v.globalAlpha=wn.value,v.drawImage(Ie,oo,ao,Re,_t),v.globalAlpha=1,Me()},Me=()=>{m.toBlob(Re=>{const _t=URL.createObjectURL(Re),zt=document.createElement("a");zt.href=_t,zt.download=Zl("png"),document.body.appendChild(zt),zt.click(),document.body.removeChild(zt),URL.revokeObjectURL(_t),URL.revokeObjectURL(xe),Yl(t),fn(),de()},"image/png")};Ie.onload=Le,Ie.onerror=Me,Ie.src=Jt.value}else m.toBlob(Ie=>{const Le=URL.createObjectURL(Ie),Me=document.createElement("a");Me.href=Le,Me.download=Zl("png"),document.body.appendChild(Me),Me.click(),document.body.removeChild(Me),URL.revokeObjectURL(Le),URL.revokeObjectURL(xe),Yl(t),fn(),de()},"image/png")}catch(Ie){URL.revokeObjectURL(xe),Yl(t),Xe(Ie)}},Ee.onerror=()=>{URL.revokeObjectURL(xe),Yl(t),Xe(new Error("Failed to load SVG image"))},Ee.src=xe})}catch(t){console.error("Error downloading PNG:",t)}},En=()=>{try{let t="";if(dt.value&&(t+=`# ${L("chart.csv.chartTitle")}: ${dt.value}
|
|
93
|
+
`),Ye.value&&(t+=`# ${L("chart.csv.chartSubtitle")}: ${Ye.value}
|
|
94
|
+
`),t+=`# ${L("chart.csv.generated")}: ${new Date().toLocaleString()}
|
|
95
95
|
|
|
96
|
-
`,
|
|
97
|
-
`,
|
|
98
|
-
`})});const v=new Blob([t],{type:"text/csv;charset=utf-8;"}),C=URL.createObjectURL(v),b=document.createElement("a");b.href=C,b.download=
|
|
99
|
-
`;const o=Math.max(...
|
|
100
|
-
`}const l=new Blob([t],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(l),m=document.createElement("a");m.href=r,m.download=qn("csv"),document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(r),ue()}catch(t){console.error("Error downloading CSV:",t)}},Bo=t=>{if(typeof t.action=="function"){const o={series:R.series,categories:R.categories,markers:tl.value},l={chartX:mt.value.chartX,chartY:mt.value.chartY,dataX:mt.value.mouseDataX,dataY:mt.value.mouseDataY,categoryIndex:clampedCategoryIndex||mt.value.categoryIndex};t.action(o,l)}ue()},Rn=()=>{Vn(),Oe.value.show=!0,Oe.value.categoryIndex=mt.value.categoryIndex,Oe.value.fromButton=!1,ue()},Kn=()=>{Vn(),Oe.value.show=!0,Oe.value.categoryIndex=0,Oe.value.fromButton=!0},Zn=t=>{if(mt.value.show){const o=document.querySelector(".dss-context-menu");o&&!o.contains(t.target)&&(mt.value.show=!1)}},fo=t=>{mt.value.show&&!t.target.closest(".context-menu")&&(mt.value.show=!1)},Mo=t=>{if(!Nl.value||!Ke.value)return;t.preventDefault(),t.stopPropagation(),ce.value.isZooming=!0,ot.value.show=!1,ce.value.zoomTimeout&&clearTimeout(ce.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top;if(r<I.value.left-50||r>I.value.right+50||m<I.value.top-50||m>I.value.bottom+100){ce.value.isZooming=!1;return}const v=t.deltaY>0?.9:1.1,C=Math.max(ce.value.minScale,Math.min(ce.value.maxScale,ce.value.scale*v));if(C!==ce.value.scale){const{minX:b,maxX:F}=ge.value,N=F-b||1,L=N/ce.value.scale,S=b-ce.value.offsetX/I.value.width*N,K=(r-I.value.left)/I.value.width,Be=S+K*L;ce.value.scale=C;const Ze=N/ce.value.scale,re=Be-K*Ze;ce.value.offsetX=-(re-b)/N*I.value.width,ce.value.scale<=1.01&&(ce.value.scale=1,ce.value.offsetX=0)}ce.value.zoomTimeout=setTimeout(()=>{ce.value.isZooming=!1,ce.value.zoomTimeout=null},300)},_o=t=>{if(!Nl.value||!Ke.value||ce.value.scale<=1)return;ot.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,ce.value.isDragging=!0,ce.value.lastMouseX=t.clientX,ce.value.lastMouseY=t.clientY,t.preventDefault()},yn=()=>{ce.value.isDragging=!1},tn=()=>{!Nl.value||!Ke.value||(ce.value.scale=1,ce.value.offsetX=0,ce.value.isDragging=!1,ce.value.zoomTimeout&&(clearTimeout(ce.value.zoomTimeout),ce.value.zoomTimeout=null),ce.value.isZooming=!1)},Nn=()=>!Nl.value||!Sn.value||!Ke.value?"default":ce.value.isDragging?"grabbing":ce.value.scale>1?"grab":"dss-crosshair",Bn=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 o=`M ${t[0].x} ${t[0].y}`;for(let l=0;l<t.length-1;l++){const r=t[Math.max(l-1,0)],m=t[l],v=t[l+1],C=t[Math.min(l+2,t.length-1)],b=m.x+(v.x-r.x)/6*je.value,F=m.y+(v.y-r.y)/6*je.value,N=v.x-(C.x-m.x)/6*je.value,L=v.y-(C.y-m.y)/6*je.value;o+=` C ${b} ${F} ${N} ${L} ${v.x} ${v.y}`}return o},Mt=e.computed(()=>{const o=Z.value?.chart?.padding,l=typeof o=="number"?o:null,r=o&&typeof o=="object"?o:null,m=50;let v=m+(qt.value?30:0)+60;if(rl.value){const S={left:m+40,top:m+40,right:m+40,bottom:m+40};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??S.left,top:r.top??S.top,right:r.right??S.right,bottom:r.bottom??S.bottom}:S}if(cl.value){const S=!W.value,K=Vl.value,Be=K?al.value+At.value+Math.max(24,an.value+16):0,Ze=S?12:m;let re=0;ct.value&&(re+=S?8:15),gt.value&&(re+=S?6:10);const ye=Je();let Ee=Ze+(S?4:16)+(K?Be:0),ve=Ze+(K?Be:0);W.value&&G.value==="left"?Ee+=ye.legendWidth||150:W.value&&G.value==="right"&&(ve+=ye.legendWidth||150);const ze=be.value==="semi-radial"?K?Be:8:K?Be:S?8:m+80,Te=K?14:0,Ve=Ze+re+Te,De={left:Ee,top:Ve,right:ve,bottom:ze};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??De.left,top:r.top??De.top,right:r.right??De.right,bottom:r.bottom??De.bottom}:De}let C=0;ct.value&&(C+=15),gt.value&&(C+=10);const b=Je();let F=m+16+(Zt.value?30:0),N=m+(xt.value?30:0);W.value&&G.value==="left"?F+=b.legendWidth||150:W.value&&G.value==="right"&&(N+=b.legendWidth||150),h.value&&(N+=44);const L={left:F,top:m+C,right:N,bottom:v};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??L.left,top:r.top??L.top,right:r.right??L.right,bottom:r.bottom??L.bottom}:L}),I=e.computed(()=>({left:Mt.value.left,top:Mt.value.top,right:Se.value-Mt.value.right,bottom:ie.value-Mt.value.bottom,width:Se.value-(Mt.value.left+Mt.value.right),height:ie.value-(Mt.value.top+Mt.value.bottom)})),Nl=e.computed(()=>["line","area","bar","stepbar"].includes(be.value)||Qe.value),Bl=e.computed(()=>Qe.value),Gl=e.computed(()=>be.value==="mini-radial"),cl=e.computed(()=>["radial","semi-radial","mini-radial"].includes(be.value)),rl=e.computed(()=>be.value==="spider"),Gt=e.computed(()=>be.value==="bubble"),rn=e.computed(()=>be.value==="stepbar"),fl=e.computed(()=>Z.value?.chart?.orientation==="horizontal"&&(be.value==="bar"||Bl.value)),Xl=t=>{const{minY:o,maxY:l}=ge.value,r=l-o||1;return I.value.left+(t-o)/r*I.value.width},kn=t=>{const{maxX:o}=ge.value,l=o+1,m=I.value.height/l;return I.value.top+(t+.5)*m},Dt=e.computed(()=>cl.value?Mt.value.left+(Se.value-Mt.value.left-Mt.value.right)/2:Se.value/2),Pt=e.computed(()=>rl.value?ie.value/2-40:cl.value?Mt.value.top+(ie.value-Mt.value.top-Mt.value.bottom)/2:ie.value/2),Vt=e.computed(()=>{if(rl.value){const t=I.value.width-80,o=I.value.height-80;return Math.min(t,o)/2}return Math.min(I.value.width,I.value.height)/2}),hl=e.computed(()=>{const t=Z.value,o=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof o=="number"&&o>=0&&o<=1?o:.45;return Vt.value*l}),Gn=e.computed(()=>{const t=Z.value,o=typeof R.innerSize=="number"?R.innerSize:t?.innerSize;return typeof o!="number"||o<=-100||!(cl.value||rl.value)?1:1+o/100}),Qn=e.computed(()=>{const t=Gn.value;if(t===1||t<=0)return;const o=Dt.value,l=Pt.value;return`translate(${o}, ${l}) scale(${t}) translate(${-o}, ${-l})`}),Mn=e.ref(0),ho=e.computed(()=>`semi-radial-fill-clip-${R.chartId}`),Cn=e.computed(()=>be.value==="semi-radial"),Un=e.computed(()=>Cn.value&&Kt.value&&!An.value),Xn=e.computed(()=>Cn.value&&Kt.value&&!An.value&&ql.value==="fill"),Jo=e.computed(()=>{const t=Un.value?Mn.value:1,o=Dt.value,l=Pt.value,r=hl.value,m=Vt.value,v=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;const b=o+m*Math.cos(v),F=l+m*Math.sin(v),N=o+m*Math.cos(C),L=l+m*Math.sin(C),S=o+r*Math.cos(C),K=l+r*Math.sin(C),Be=o+r*Math.cos(v),Ze=l+r*Math.sin(v),re=t>.5?1:0;return`M ${o} ${l} L ${b} ${F} A ${m} ${m} 0 ${re} 1 ${N} ${L} L ${S} ${K} A ${r} ${r} 0 ${re} 1 ${Be} ${Ze} Z`}),go=e.computed(()=>{if(!(!Cn.value||!Un.value)&&!Xn.value)return`url(#${ho.value})`}),$o=t=>{if(!(!Xn.value||t!==0))return`url(#${ho.value})`},_n=e.ref(0),Fn=e.computed(()=>`radial-reveal-clip-${R.chartId}`),_l=e.computed(()=>be.value==="radial"),yo=e.computed(()=>{const t=_l.value?_n.value:1,o=Dt.value,l=Pt.value,r=Math.max(Vt.value*1.5,Se.value,ie.value);if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;if(t>=1){const S=o-r,K=o+r;return`M ${S} ${l} A ${r} ${r} 0 0 1 ${K} ${l} A ${r} ${r} 0 0 1 ${S} ${l} Z`}const m=-Math.PI/2,v=m+t*Math.PI*2,C=o+r*Math.cos(m),b=l+r*Math.sin(m),F=o+r*Math.cos(v),N=l+r*Math.sin(v),L=t>=.5?1:0;return`M ${o} ${l} L ${C} ${b} A ${r} ${r} 0 ${L} 1 ${F} ${N} Z`}),Lo=e.computed(()=>{if(go.value)return go.value;if(_l.value)return`url(#${Fn.value})`});let Yn=null;const ea=()=>{if(!Un.value)return;Mn.value=0;const t=jl.value,o=performance.now(),l=r=>{const m=r-o,v=Math.min(1,m/t);Mn.value=aa(il.value,v),v<1&&(Yn=requestAnimationFrame(l))};Yn=requestAnimationFrame(l)},To=e.computed(()=>Z.value?.bubbles?.minSize||8),Jn=e.computed(()=>Z.value?.bubbles?.maxSize||50),Yl=e.computed(()=>Z.value?.bubbles?.opacity||.7),Ao=(t,o)=>{const l=[15,20,25,18,22],r=l[t%l.length]||20,m=1+Math.sin(o*.5)*.2;return Math.max(5,r*m)},$n=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.opacity="1")},ko=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.display="none")},ln=e.computed(()=>R.series),Ql=e.computed(()=>R.series.filter((t,o)=>!wt.value.has(o))),eo=t=>{if(!t)return"primary";const o=t.yAxis??t.axis??t.yAxisId;return o==="secondary"||o==="right"||o===1?"secondary":"primary"},a=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,n=t=>t?t.old===!0||t.comparison===!0||t.dotted===!0:!1,s=e.computed(()=>{const o=Z.value?.spider?.comparison||{};return{fillOpacity:typeof o.fillOpacity=="number"?o.fillOpacity:0,strokeDasharray:o.strokeDasharray||"6,4",usePrimaryColor:o.usePrimaryColor!==!1,bubbleSize:typeof o.bubbleSize=="number"?o.bubbleSize:0}}),i=(t,o)=>typeof t?.bubbles?.size=="number"?t.bubbles.size:typeof t?.bubbleSize=="number"?t.bubbleSize:o?s.value.bubbleSize:$t.value,c=(t,o)=>n(t)&&s.value.usePrimaryColor?Qt(0):Qt(o),d=(t,o)=>rl.value&&n(t)?c(t,o):Qt(o),u=e.computed(()=>Ql.value.filter(t=>eo(t)==="primary")),p=e.computed(()=>Ql.value.filter(t=>eo(t)==="secondary")),h=e.computed(()=>!fl.value&&!!kt.value&&p.value.length>0),k=(t,o=0)=>{const l=Number(t);return Number.isFinite(l)?l:o},H=(t,o,l)=>{if(!Array.isArray(t))return[];const r=t.map((m,v)=>{const C=m&&typeof m=="object"&&!Array.isArray(m),b=k(C?m.value:m,0);return b<=0?null:{key:`${l}-${v}-${C&&m.label||v}`,label:C?m.label||o?.name||`Segment ${v+1}`:o?.name||`Segment ${v+1}`,value:b,color:C?m.color||Qt(v):Qt(l),marker:C?m.marker:null,isRemainder:!1}}).filter(Boolean);return pl.value==="asc"?r.sort((m,v)=>m.value-v.value):pl.value==="desc"?r.sort((m,v)=>v.value-m.value):r},z=(t,o,l,r)=>{const m=t&&typeof t=="object"&&!Array.isArray(t),v=m?t.segments:Array.isArray(t)?t:[{label:l?.name,value:t,color:Qt(r)}],C=H(v,l,r),b=C.reduce((S,K)=>S+K.value,0),F=k(m?t.totalValue??t.total??l?.totalValue??l?.total:l?.totalValue??l?.total,M.value),N=Math.max(F,b,1);w.value&&N>b&&C.push({key:`${r}-${o}-remainder`,label:A.value,value:N-b,color:se.value,marker:null,isRemainder:!0});const L=C.filter(S=>!S.isRemainder).reduce((S,K)=>!S||K.value>S.value?K:S,null);return{key:`${r}-${o}`,label:m?t.label||t.name||R.categories?.[o]||_("chart.fallback.item",{number:o+1}):R.categories?.[o]||_("chart.fallback.item",{number:o+1}),axisLabel:m?t.xLabel??t.label??t.name??R.categories?.[o]??_("chart.fallback.item",{number:o+1}):R.categories?.[o]||_("chart.fallback.item",{number:o+1}),yLabel:m?t.yLabel??null:null,totalValue:N,usedValue:b,segments:C,maxSegmentKey:L?.key||null,seriesName:l?.name||"",seriesIndex:r}},V=e.computed(()=>{if(!rn.value)return[];const t=[];return ln.value.forEach((o,l)=>{wt.value.has(l)||!Array.isArray(o?.data)||o.data.forEach(r=>{const m=z(r,t.length,o,l);m.segments.length>0&&t.push(m)})}),t}),Q="auto",ee=(t,o,l,r=0,m=100)=>{let v=1/0,C=-1/0;if(t.forEach(N=>{N?.data?.length&&N.data.forEach(L=>{typeof L=="number"&&Number.isFinite(L)&&(v=Math.min(v,L),C=Math.max(C,L))})}),v===1/0)return{minY:r,maxY:m};let b;if(o===Q){const N=C-v,L=N>0?N*.1:1;b=Math.max(0,v-L)}else if(typeof o=="number")b=o;else{const N=C-v,L=N>0?N*.1:1;b=Math.max(0,v-L)}let F;if(l===Q){const N=C-v,L=N>0?N*.1:2;F=C+L}else if(typeof l=="number")F=l;else{const N=C-v,L=N>0?N*.1:2;F=C+L}return{minY:b,maxY:F}},ge=e.computed(()=>{if(Gt.value)return xl();if(rn.value)return Me();if(!Ql.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;Ql.value.forEach(l=>{l.data&&l.data.length&&(t=Math.max(t,l.data.length-1))}),R.categories.length>0&&(t=Math.max(t,R.categories.length-1));const o=ee(u.value.length?u.value:Ql.value,Yt.value,rt.value);return{minX:0,maxX:t,minY:o.minY,maxY:o.maxY}}),Me=()=>{const t=V.value,o=t.reduce((v,C)=>Math.max(v,C.totalValue),M.value),l=typeof Yt.value=="number"?Yt.value:0,r=typeof rt.value=="number"?rt.value:o,m=Math.max(r,l+1);return{minX:0,maxX:Math.max(t.length-1,0),minY:l,maxY:m}},ft=e.computed(()=>h.value?ee(p.value,Jt.value,yt.value,ge.value.minY,ge.value.maxY):{minY:ge.value.minY,maxY:ge.value.maxY}),xl=()=>{if(!Ql.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,o=-1/0,l=1/0,r=-1/0,m=1/0,v=-1/0,C=!1;if(Ql.value.forEach((Be,Ze)=>{Be?.data?.length&&Be.data.forEach((re,ye)=>{let Ee,ve,Xe;if(typeof re=="object"&&re!==null&&!Array.isArray(re))Ee=typeof re.x=="number"?re.x:ye,ve=typeof re.y=="number"?re.y:0,Xe=typeof re.size=="number"?re.size:20;else if(Array.isArray(re)&&re.length>=3)Ee=typeof re[0]=="number"?re[0]:ye,ve=typeof re[1]=="number"?re[1]:0,Xe=typeof re[2]=="number"?re[2]:20;else if(typeof re=="number")Ee=ye,ve=re,Xe=Ao(Ze,ye);else return;isFinite(Ee)&&isFinite(ve)&&isFinite(Xe)&&(t=Math.min(t,Ee),o=Math.max(o,Ee),l=Math.min(l,ve),r=Math.max(r,ve),m=Math.min(m,Xe),v=Math.max(v,Xe),C=!0)})}),!C)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===o&&(t=Math.min(t,0),o=Math.max(o,R.categories?.length-1||8)),l===r&&(l=Math.max(0,l-10),r=l+20);const b=o-t,F=r-l;let N,L,S,K;return ol.value!==null?N=ol.value:N=t-b*.1,U.value!==null?L=U.value:L=o+b*.1,Yt.value!==null&&typeof Yt.value=="number"?S=Yt.value:S=Math.max(0,l-F*.1),rt.value!==null&&typeof rt.value=="number"?K=rt.value:K=r+F*.1,{minX:N,maxX:L,minY:S,maxY:K,minSize:m,maxSize:v}},ht=t=>{if(Gt.value){const{minX:b,maxX:F}=ge.value,N=F-b||1;return I.value.left+(t-b)/N*I.value.width}const{minX:o,maxX:l}=ge.value,r=l-o;if(l===0||r===0)return I.value.left+I.value.width/2;const m=r/ce.value.scale,v=o-ce.value.offsetX/I.value.width*r,C=(t-v)/m;return I.value.left+C*I.value.width},Ft=t=>{const{minY:o,maxY:l}=ge.value,r=l-o||1;return I.value.bottom-(t-o)/r*I.value.height},gl=t=>{const{minY:o,maxY:l}=ft.value,r=l-o||1;return I.value.bottom-(t-o)/r*I.value.height},Ot=(t,o)=>h.value&&eo(t)==="secondary"?gl(o):Ft(o),yl=t=>{if(!Gt.value)return $t.value||4;const{maxSize:o}=ge.value,l=Math.max(1,o),r=Math.min(1,Math.max(0,t/l));return To.value+r*(Jn.value-To.value)},Al=(t,o=12,l="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(o*.62);Al.canvas||(Al.canvas=document.createElement("canvas"));const r=Al.canvas.getContext("2d");return r?(r.font=`${o}px ${l}`,r.measureText(t).width):t.length*(o*.62)},nn=(t,o,l=12)=>{if(typeof t!="string"||typeof o!="number"||o<=0||Al(t,l)<=o)return t;const r="..";if(Al(r,l)>=o)return r;let v=t.length;for(;v>0;){const C=`${t.slice(0,v)}${r}`;if(Al(C,l)<=o)return C;v-=1}return r},bn=e.computed(()=>to.value.map(t=>({y:t.y}))),Co=e.computed(()=>!rn.value||!bt.value?[]:to.value.map(t=>({y:t.y}))),Do=e.computed(()=>!rn.value||!bt.value||!_t.value?[]:la.value.map(t=>({x:t.centerX}))),bo=e.computed(()=>{if(Gt.value)return Ho();if(rn.value)return ua();if(be.value==="bar"){if(fl.value){const Ve=[],{minY:De,maxY:Nt}=ge.value,It=5,Rl=Nt-De||1;for(let ml=0;ml<=It;ml++){const Wl=De+Rl*(ml/It),jn=Xl(Wl);Ve.push({x:jn,y:I.value.bottom+20,text:$(Math.round(Wl))})}return Ve}const ye=[],{maxX:Ee}=ge.value,ve=Ee+1,Xe=5,Te=(I.value.width-Xe*2)/ve;for(let Ve=0;Ve<=Ee;Ve++){const De=I.value.left+Xe+(Ve+.5)*Te;ye.push({x:De,y:I.value.bottom+20,text:nn(R.categories[Ve]||_("chart.fallback.item",{number:Ve+1}),Math.max(Te-8,24))})}return ye}const t=[],{minX:o,maxX:l}=ge.value,r=ol.value!==null?ol.value:o,m=U.value!==null?U.value:l,v=m-r||1,C=v/ce.value.scale,b=r-ce.value.offsetX/I.value.width*v,F=b+C,N=Math.max(0,Math.floor(b-2)),L=Math.min(m,Math.ceil(F+2)),S=L-N,K=I.value.width,Ze=Math.floor(K/60);let re=1;S>Ze&&(re=Math.ceil(S/Ze));for(let ye=N;ye<=L;ye+=re)if(ye>=0&&ye<=m){const Ee=ht(ye);Ee>=I.value.left-100&&Ee<=I.value.right+100&&t.push({x:Ee,y:I.value.bottom+20,text:R.categories[ye]||`Item ${ye+1}`})}return t}),Ho=()=>{const t=[],{minX:o,maxX:l}=ge.value,r=l-o||1,m=Math.min(8,Math.max(4,Math.floor(I.value.width/80)));for(let v=0;v<=m;v++){const C=o+r*v/m,b=ht(C);if(b>=I.value.left-10&&b<=I.value.right+10){const F=Math.round(C),N=R.categories?.[F];t.push({x:b,y:I.value.bottom+20,text:N||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},ua=()=>la.value.map(o=>({x:o.centerX,y:I.value.bottom+20,text:nn(o.axisLabel||o.label,Math.max(o.categoryWidth-8,24))})),to=e.computed(()=>{if(fl.value){const m=[],{maxX:v}=ge.value;for(let C=0;C<=v;C++)m.push({x:I.value.left-10,y:kn(C),text:nn(R.categories[C]||`Item ${C+1}`,Math.max(I.value.left-28,40))});return m}const t=[],{minY:o,maxY:l}=ge.value,r=5;for(let m=0;m<=r;m++){const v=o+(l-o)*(m/r),C=Math.round(v);t.push({x:I.value.left-10,y:Ft(v),text:$(C)})}return t}),lo=e.computed(()=>{if(!h.value||fl.value)return[];const t=[],{minY:o,maxY:l}=ft.value,r=5;for(let m=0;m<=r;m++){const v=o+(l-o)*(m/r),C=Math.round(v);t.push({x:I.value.right+10,y:gl(v),text:$(C)})}return t}),Qt=t=>{const o=jt.value;if(!o||o.length===0){const l=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return l[t%l.length]}return o[t%o.length]},cn=t=>{if(!t||typeof t!="string")return"#3a3a3a";const o=t.trim();let l=0,r=0,m=0;const v=o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(v)l=Number(v[1])/255,r=Number(v[2])/255,m=Number(v[3])/255;else{const b=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(b)l=Number(b[1])/255,r=Number(b[2])/255,m=Number(b[3])/255;else{const F=o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(F){let N=F[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,r=parseInt(N.slice(2,4),16)/255,m=parseInt(N.slice(4,6),16)/255}else if(typeof document<"u"){const N=document.createElement("span");N.style.color=o,N.style.display="none",document.body.appendChild(N);const L=getComputedStyle(N).color;document.body.removeChild(N);const S=L.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(S)l=Number(S[1])/255,r=Number(S[2])/255,m=Number(S[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*r+.0722*m>.5?"#3a3a3a":"#fafafa"},Jl=t=>{if(!t||typeof t!="string")return t;const o=t.trim(),l=o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(l){const v=Math.max(0,Math.floor(Number(l[1])*.65)),C=Math.max(0,Math.floor(Number(l[2])*.65)),b=Math.max(0,Math.floor(Number(l[3])*.65));return`rgb(${v}, ${C}, ${b})`}const r=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(r){const v=Math.max(0,Math.floor(Number(r[1])*.65)),C=Math.max(0,Math.floor(Number(r[2])*.65)),b=Math.max(0,Math.floor(Number(r[3])*.65));return`rgba(${v}, ${C}, ${b}, ${r[4]})`}const m=o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(m){let v=m[1];v.length===3&&(v=v[0]+v[0]+v[1]+v[1]+v[2]+v[2]);const C=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(0,2),16)*.65))),b=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(2,4),16)*.65))),F=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(4,6),16)*.65)));return`#${[C,b,F].map(N=>N.toString(16).padStart(2,"0")).join("")}`}return o},Ol=(t,o)=>{const r=Z.value?.stroke?.color;return r==null?Jl(o):typeof r=="string"?r:Array.isArray(r)&&r.length?r[t%r.length]??Jl(o):Jl(o)},Ro=t=>{let o=0;for(let l=1;l<t.length;l++){const r=t[l].x-t[l-1].x,m=t[l].y-t[l-1].y;o+=Math.sqrt(r*r+m*m)}return o},da=e.computed(()=>be.value==="line"||Bl.value?(Bl.value?R.series.filter(o=>(o.type||be.value)==="line"):ln.value).map((o,l)=>{const r=R.series.findIndex(S=>S===o),m=[];let v=[];o.data.forEach((S,K)=>{S==null?v.length>0&&(m.push([...v]),v=[]):v.push({x:fl.value?Xl(S):ht(K),y:fl.value?kn(K):Ot(o,S),index:K})}),v.length>0&&m.push(v);let C="";m.forEach(S=>{if(S.length>0){let K="";xe.value?K=Bn(S):K=`M ${S[0].x} ${S[0].y}`+S.slice(1).map(Be=>` L ${Be.x} ${Be.y}`).join(""),C+=(C?" ":"")+K}});const b=m.reduce((S,K)=>S+Ro(K),0),F=wt.value.has(r),N=$e.value===r,L=$e.value!==null&&$e.value!==r;return{path:C,color:Qt(r),strokeDasharray:a(o),pathLength:b,seriesIndex:r,animationDelay:l*vl.value,isHighlighted:N,isDimmed:L,isHidden:F}}):[]),ma=e.computed(()=>{if(!(be.value==="line"||Bl.value))return[];const t=Bl.value?R.series.filter(l=>(l.type||be.value)==="line"):ln.value,o=[];return t.forEach((l,r)=>{const m=R.series.findIndex(v=>v===l);for(let v=0;v<l.data.length-1;v++){const C=l.data[v];if(C!=null){let b=-1,F=0;for(let N=v+1;N<l.data.length;N++){const L=l.data[N];if(L==null)F++;else{b=N;break}}if(F>0&&b!==-1){const N=l.data[b],L=fl.value?Xl(C):ht(v),S=fl.value?kn(v):Ot(l,C),K=fl.value?Xl(N):ht(b),Be=fl.value?kn(b):Ot(l,N),Ze=wt.value.has(m),re=$e.value===m,ye=$e.value!==null&&$e.value!==m;o.push({path:`M ${L} ${S} L ${K} ${Be}`,color:Qt(m),seriesIndex:m,animationDelay:r*vl.value,isHighlighted:re,isDimmed:ye,isHidden:Ze,gapSize:F}),v=b-1}}}}),o}),$a=e.computed(()=>be.value==="line"||Bl.value?!Kt.value||An.value||Wt.value.hasAnimated?[]:(Bl.value?R.series.filter(o=>(o.type||be.value)==="line"):ln.value).map((o,l)=>{const r=R.series.findIndex(F=>F===o);let m="",v=null;o.data.forEach((F,N)=>{if(F!=null){const L={x:fl.value?Xl(F):ht(N),y:fl.value?kn(N):Ot(o,F)};v===null?m+=`M ${L.x} ${L.y}`:m+=` L ${L.x} ${L.y}`,v=L}else if(v!==null){const L=o.data.findIndex((S,K)=>K>N&&S!==null&&S!==void 0);if(L!==-1){const S={x:fl.value?Xl(o.data[L]):ht(L),y:fl.value?kn(L):Ot(o,o.data[L])};m+=` L ${S.x} ${S.y}`,v=S}}});const C=o.data.map((F,N)=>F==null?null:{x:fl.value?Xl(F):ht(N),y:fl.value?kn(N):Ot(o,F)}).filter(F=>F!==null),b=Ro(C);return{path:m,pathLength:b,color:Qt(r),strokeDasharray:a(o),animationDelay:l*vl.value,seriesIndex:r}}):[]),La=e.computed(()=>{if(be.value!=="line")return[];const t=[];return ln.value.forEach((o,l)=>{const r=$e.value===l,m=$e.value!==null&&$e.value!==l,v=wt.value.has(l);o.data.forEach((C,b)=>{C!=null&&t.push({x:ht(b),y:Ot(o,C),color:Qt(l),value:C,label:R.categories[b]||b.toString(),seriesName:o.name,categoryIndex:b,dataIndex:b,animationDelay:(l*o.data.length+b)*(vl.value/8),isHighlighted:r,isDimmed:m,isHidden:v})})}),t}),Ta=e.computed(()=>{if(!Bl.value)return[];const t=[];return R.series.filter(l=>(l.type||be.value)==="line").forEach((l,r)=>{const m=R.series.findIndex(F=>F===l),v=$e.value===m,C=$e.value!==null&&$e.value!==m,b=wt.value.has(m);l.data.forEach((F,N)=>{F!=null&&t.push({x:ht(N),y:Ot(l,F),color:Qt(m),value:F,label:R.categories[N]||N.toString(),seriesName:l.name,categoryIndex:N,dataIndex:N,animationDelay:(r*l.data.length+N)*(vl.value/8),isHighlighted:v,isDimmed:C,isHidden:b})})}),t}),Fo=e.computed(()=>{if(!Gt.value)return[];const t=[];return ln.value.forEach((o,l)=>{if(!o?.data?.length)return;const r=$e.value,m=r!==null&&r===l,v=r!==null&&r!==l,C=wt.value.has(l);o.data.forEach((b,F)=>{let N,L,S,K,Be;if(typeof b=="object"&&b!==null&&!Array.isArray(b))N=typeof b.x=="number"?b.x:F,L=typeof b.y=="number"?b.y:0,S=typeof b.size=="number"?b.size:20,K=b.label||R.categories?.[F]||`Point ${F+1}`,Be=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)N=typeof b[0]=="number"?b[0]:F,L=typeof b[1]=="number"?b[1]:0,S=typeof b[2]=="number"?b[2]:20,K=b[3]||R.categories?.[F]||`Point ${F+1}`,Be=b[4];else if(typeof b=="number")N=F,L=b,S=Ao(l,F),K=R.categories?.[F]||`Point ${F+1}`;else return;!isFinite(N)||!isFinite(L)||!isFinite(S)||t.push({x:ht(N),y:Ft(L),radius:yl(S),originalX:N,originalY:L,originalSize:S,color:Qt(l),seriesName:o.name||`Series ${l+1}`,label:K,imageUrl:Be,seriesIndex:l,dataIndex:F,categoryIndex:Math.round(N),isHighlighted:m,isDimmed:v,isHidden:C,opacity:Yl.value})})}),t}),ta=e.computed(()=>be.value!=="area"?[]:ln.value.map((t,o)=>{const l=[];let r=[];if(t.data.forEach((S,K)=>{S==null?r.length>0&&(l.push([...r]),r=[]):r.push({x:ht(K),y:Ot(t,S),index:K})}),r.length>0&&l.push(r),l.length===0)return{linePath:"",areaPath:"",color:Qt(o),isHidden:wt.value.has(o)};const m=I.value.bottom+1;let v="",C="";l.forEach((S,K)=>{if(S.length===0)return;let Be=`M ${S[0].x} ${S[0].y}`;xe.value&&S.length>1?Be=Bn(S):S.slice(1).forEach(re=>{Be+=` L ${re.x} ${re.y}`}),v+=(v?" ":"")+Be;let Ze=`M ${S[0].x} ${m}`;if(Ze+=` L ${S[0].x} ${S[0].y}`,xe.value&&S.length>1){const re=Bn(S),ye=re.substring(re.indexOf("C")||re.indexOf("Q")||re.indexOf("L"));ye?Ze+=" "+ye:S.slice(1).forEach(Ee=>{Ze+=` L ${Ee.x} ${Ee.y}`})}else S.slice(1).forEach(re=>{Ze+=` L ${re.x} ${re.y}`});Ze+=` L ${S[S.length-1].x} ${m} Z`,C+=(C?" ":"")+Ze});const b=$e.value===o,F=$e.value!==null&&$e.value!==o,N=wt.value.has(o),L=l.reduce((S,K)=>S+Ro(K),0);return{linePath:v,areaPath:C,color:Qt(o),pathLength:L,isHighlighted:b,isDimmed:F,isHidden:N}})),la=e.computed(()=>{if(!rn.value)return[];const t=V.value,o=t.length;if(!o)return[];const l=Math.max(I.value.width,0),r=o>0?l/o:l,m=Math.max(He.value,Ct.value),v=Math.min(ae.value,m),C=Math.max(4,Math.min(m,Math.max(He.value,v),Math.max(4,r*.62)));return t.map((b,F)=>{const N=I.value.left+(F+.5)*r,L=N-C/2;let S=0;const K=$e.value===b.seriesIndex,Be=$e.value!==null&&$e.value!==b.seriesIndex,Ze=wt.value.has(b.seriesIndex),re=Ft(b.totalValue),ye=Ft(0),Ee=Math.max(0,ye-re),ve=Math.min(nt.value,C/2,Ee/2),Xe=`stepbar-column-clip-${R.chartId}-${b.key}`,ze=ve>0&&Ee>0?[`M ${L} ${re+ve}`,`Q ${L} ${re} ${L+ve} ${re}`,`L ${L+C-ve} ${re}`,`Q ${L+C} ${re} ${L+C} ${re+ve}`,`L ${L+C} ${ye}`,`L ${L} ${ye}`,"Z"].join(" "):`M ${L} ${re} H ${L+C} V ${ye} H ${L} Z`,Te=b.segments.map((Ve,De)=>{const Nt=S,It=S+Ve.value;S=It;const Rl=Ft(It),ml=Ft(Nt),Wl=Math.max(0,ml-Rl),jn=De>0?1:0,ra=(F*b.segments.length+De)*(vl.value/5);return{key:`${b.key}-${Ve.key}`,x:L,y:Rl-jn,width:C,height:Wl+jn,color:Ve.color,value:Ve.value,label:b.label,axisLabel:b.axisLabel,yLabel:b.yLabel,segmentLabel:Ve.label,seriesName:Ve.label,tooltipTitle:`${Ve.label} - ${b.label}`,categoryIndex:F,dataIndex:F,animationDelay:ra,isHighlighted:K,isDimmed:Be,isHidden:Ze,isRemainder:Ve.isRemainder}});return{key:b.key,label:b.label,axisLabel:b.axisLabel,centerX:N,categoryWidth:r,clipPathId:Xe,clipPathRef:`url(#${Xe})`,clipPath:ze,segments:Te}})}),pa=e.computed(()=>{if(!(["bar"].includes(be.value)||Bl.value))return[];const t=[],{maxX:o}=ge.value,l=Bl.value?R.series.filter(m=>(m.type||be.value)==="bar"):ln.value,r=l.length;if(fl.value){const m=o+1,C=I.value.height/m,b=C*(2/3),F=Math.min(4,b/r*.15),N=b-(r-1)*F,L=Math.max(4,N/r);l.forEach((S,K)=>{const Be=R.series.findIndex(Ee=>Ee===S),Ze=$e.value===Be,re=$e.value!==null&&$e.value!==Be,ye=wt.value.has(Be);S.data.forEach((Ee,ve)=>{if(Ee==null||typeof Ee!="number"||!isFinite(Ee))return;const Te=I.value.top+(ve+.5)*C-b/2+K*(L+F),Ve=I.value.left,De=Math.abs(Xl(Ee)-I.value.left);let Nt="";if(xe.value&&De>0){const It=Math.min(Rt.value,L/2,De/2);Nt=[`M ${Ve} ${Te}`,`L ${Ve+De-It} ${Te}`,`Q ${Ve+De} ${Te} ${Ve+De} ${Te+It}`,`L ${Ve+De} ${Te+L-It}`,`Q ${Ve+De} ${Te+L} ${Ve+De-It} ${Te+L}`,`L ${Ve} ${Te+L}`,"Z"].join(" ")}t.push({x:Ve,y:Te,width:De,height:L,color:Qt(r===1?ve:Be),value:Ee,label:R.categories[ve]||ve.toString(),seriesName:S.name,animationDelay:(K*l.length+ve)*(vl.value/4),isHighlighted:Ze,isDimmed:re,isHidden:ye,barPath:Nt,isSmooth:xe.value&&De>0})})})}else{const m=o+1,C=I.value.width/m,b=C*.8,F=b/r,N=F*.05,L=F-N;l.forEach((S,K)=>{const Be=R.series.findIndex(Ee=>Ee===S),Ze=$e.value===Be,re=$e.value!==null&&$e.value!==Be,ye=wt.value.has(Be);S.data.forEach((Ee,ve)=>{if(Ee==null||typeof Ee!="number"||!isFinite(Ee))return;const Te=I.value.left+(ve+.5)*C-b/2+K*F+N/2,Ve=Ft(Math.max(0,Ee)),De=Math.abs(Ft(0)-Ft(Ee));let Nt="";if(xe.value&&De>0){const It=Math.min(Rt.value,L/2,De/2);Nt=[`M ${Te} ${Ve+De}`,`L ${Te} ${Ve+It}`,`Q ${Te} ${Ve} ${Te+It} ${Ve}`,`L ${Te+L-It} ${Ve}`,`Q ${Te+L} ${Ve} ${Te+L} ${Ve+It}`,`L ${Te+L} ${Ve+De}`,"Z"].join(" ")}t.push({x:Te,y:Ve,width:L,height:De,color:Qt(r===1?ve:Be),value:Ee,label:R.categories[ve]||ve.toString(),seriesName:S.name,animationDelay:(K*l.length+ve)*(vl.value/4),isHighlighted:Ze,isDimmed:re,isHidden:ye,barPath:Nt,isSmooth:xe.value&&De>0})})})}return t}),Ln=e.computed(()=>{if(!cl.value)return[];const t=ln.value.map((C,b)=>({series:C,originalIndex:b})).filter(({originalIndex:C})=>!wt.value.has(C));if(t.length===0)return[];let o=be.value==="semi-radial"?Math.PI:-Math.PI/2;const l=be.value==="semi-radial"?Math.PI:Math.PI*2,r=[],m=(C,b,F,N,L,S)=>{const K=C+(b-C)/2,Be=b-C,Ze=Dt.value+Math.cos(C)*hl.value,re=Pt.value+Math.sin(C)*hl.value,ye=Dt.value+Math.cos(b)*hl.value,Ee=Pt.value+Math.sin(b)*hl.value,ve=Dt.value+Math.cos(b)*Vt.value,Xe=Pt.value+Math.sin(b)*Vt.value,ze=Dt.value+Math.cos(C)*Vt.value,Te=Pt.value+Math.sin(C)*Vt.value,Ve=Be>Math.PI?1:0,De=[`M ${Ze} ${re}`,`A ${hl.value} ${hl.value} 0 ${Ve} 1 ${ye} ${Ee}`,`L ${ve} ${Xe}`,`A ${Vt.value} ${Vt.value} 0 ${Ve} 0 ${ze} ${Te}`,"Z"].join(" "),Nt=S||Qt(F);return{path:De,color:Nt,strokeWidth:Ht.value,strokeColor:Ol(r.length,Nt),value:L,seriesName:N,opacity:.8,isHighlighted:$e.value===F,isDimmed:$e.value!==null&&$e.value!==F,isHidden:!1,startAngle:C,endAngle:b,midAngle:K}};if(Gl.value){const{series:C,originalIndex:b}=t[0],F=Number(C?.data?.[0]??0),N=Number.isFinite(F)?Math.min(Math.max(F,0),100):0,L=Z.value,S=Math.min(Math.max(Number(L?.miniRadial?.minVisiblePercent??1),0),100),Be=(N<=0?S:N)/100*l,Ze=Number(L?.miniRadial?.thresholds?.low??33),re=Number(L?.miniRadial?.thresholds?.medium??66),ye=L?.miniRadial?.colors?.low||"#E53E3E",Ee=L?.miniRadial?.colors?.medium||"#ED8936",ve=L?.miniRadial?.colors?.high||"#38A169",Xe=N<=Ze?ye:N<=re?Ee:ve,ze=L?.miniRadial?.trackColor||"#E5E7EB",Te=C?.name||"Score";return r.push(m(o,o+l-.001,b+1,"Track",100,ze)),r.push(m(o,o+Be,b,Te,N,Xe)),r}if(t.length===1){const{series:C,originalIndex:b}=t[0],F=C.data[0]||0,N=o,L=o+l-.001,S=N+l/2,K=Dt.value+Math.cos(N)*hl.value,Be=Pt.value+Math.sin(N)*hl.value,Ze=Dt.value+Math.cos(L)*hl.value,re=Pt.value+Math.sin(L)*hl.value,ye=Dt.value+Math.cos(L)*Vt.value,Ee=Pt.value+Math.sin(L)*Vt.value,ve=Dt.value+Math.cos(N)*Vt.value,Xe=Pt.value+Math.sin(N)*Vt.value,ze=1,Te=[`M ${K} ${Be}`,`A ${hl.value} ${hl.value} 0 ${ze} 1 ${Ze} ${re}`,`L ${ye} ${Ee}`,`A ${Vt.value} ${Vt.value} 0 ${ze} 0 ${ve} ${Xe}`,"Z"].join(" "),Ve=Qt(b);return r.push({path:Te,color:Ve,strokeWidth:Ht.value,strokeColor:Ol(0,Ve),value:F,seriesName:C.name,opacity:.8,isHighlighted:$e.value===b,isDimmed:!1,isHidden:!1,startAngle:N,endAngle:L,midAngle:S}),r}if(Xn.value&&t.length===2){const C=t[0],b=t[1],F=Math.min(100,Math.max(0,C.series.data[0]||0)),N=F/100*l;return r.push(m(o,o+N,C.originalIndex,C.series.name,F)),r.push(m(o,o+l,b.originalIndex,b.series.name,100)),r}const v=t.reduce((C,{series:b})=>C+(b.data[0]||0),0);return v===0?[]:(t.forEach(({series:C,originalIndex:b})=>{const F=C.data[0]||0,N=F/v*l,L=o,S=o+N,K=L+N/2,Be=Dt.value+Math.cos(L)*hl.value,Ze=Pt.value+Math.sin(L)*hl.value,re=Dt.value+Math.cos(S)*hl.value,ye=Pt.value+Math.sin(S)*hl.value,Ee=Dt.value+Math.cos(S)*Vt.value,ve=Pt.value+Math.sin(S)*Vt.value,Xe=Dt.value+Math.cos(L)*Vt.value,ze=Pt.value+Math.sin(L)*Vt.value,Te=N>Math.PI?1:0,Ve=[`M ${Be} ${Ze}`,`A ${hl.value} ${hl.value} 0 ${Te} 1 ${re} ${ye}`,`L ${Ee} ${ve}`,`A ${Vt.value} ${Vt.value} 0 ${Te} 0 ${Xe} ${ze}`,"Z"].join(" "),De=Qt(b);r.push({path:Ve,color:De,strokeWidth:Ht.value,strokeColor:Ol(r.length,De),value:F,seriesName:C.name,opacity:.8,isHighlighted:$e.value===b,isDimmed:$e.value!==null&&$e.value!==b,isHidden:!1,startAngle:L,endAngle:S,midAngle:K}),o=S}),r)}),Aa=e.computed(()=>{const t=Ln.value;return Xn.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((o,l)=>({segment:o,originalIndex:l}))}),Da=e.computed(()=>{if(!Vl.value||!cl.value)return[];const t=an.value,o=al.value,l=At.value,r=Pn.value,m=15,v=t*1.3,C=.55,b=(S,K)=>{const Be=Dt.value+Math.cos(S.midAngle)*Vt.value,Ze=Pt.value+Math.sin(S.midAngle)*Vt.value,re=Dt.value+Math.cos(S.midAngle)*(Vt.value+o),ye=Pt.value+Math.sin(S.midAngle)*(Vt.value+o),ve=re+l*(K?1:-1),Xe=K?re+m:re-m,ze=ye-r,Te=`${S.seriesName}: ${$(S.value)}`,Ve=Te.length*t*C;return{pointerStartX:Be,pointerStartY:Ze,pointerEndX:re,pointerEndY:ye,horizontalEndX:ve,horizontalEndY:ye,textX:Xe,textY:ze,text:Te,textWidth:Ve,textAnchor:K?"start":"end",isRightSide:K,pointerLineLength:Math.hypot(re-Be,ye-Ze),horizontalLineLength:Math.hypot(ve-re,0)}},F=(S,K)=>{const Be=Math.abs(S.textY-K.textY)<v,Ze=S.isRightSide?S.textX:S.textX-S.textWidth,re=S.isRightSide?S.textX+S.textWidth:S.textX,ye=K.isRightSide?K.textX:K.textX-K.textWidth,Ee=K.isRightSide?K.textX+K.textWidth:K.textX,ve=Ze<Ee&&ye<re;return Be&&ve},N=Ln.value.filter(S=>!S.isHidden),L=[];for(let S=0;S<N.length;S++){const K=N[S];let Be=Math.cos(K.midAngle)>=0;if(S>0){const re=L[S-1],ye=b(K,Be);F(re,ye)&&(Be=!Be)}const Ze=b(K,Be);L.push({...Ze,color:K.color,isHighlighted:K.isHighlighted,isDimmed:K.isDimmed})}return L}),Ha=t=>{if(!t||t.isHidden)return 0;const o=t.opacity||Yl.value||.7;return $e.value===null||$e.value===void 0?o:$e.value!==null?t.seriesIndex===$e.value?Math.min(1,o+.1):Math.max(.5,o*.8):o},Ra=t=>{if(!t||t.isHidden)return 0;const o=t.radius>20?.9:.8;return $e.value!==null?t.seriesIndex===$e.value?Math.min(1,o+.1):o*.7:o},va=(t,o)=>{if(t)try{if($e.value===t.seriesIndex?$e.value=null:$e.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:o,chartId:R.chartId}});window.dispatchEvent(l)}}catch(l){console.error("Error in onBubbleClick:",l)}},Fa=(t,o)=>{const l=[`dss-bubble-fallback-${o}`];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(" ")},fa=(t,o)=>{if(!t||(o.stopPropagation(),zo.value=!0,$e.value=t.seriesIndex,ot.value.show=!1,!Ie.value))return;const l=o.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect();let m=o.clientX-r.left+10,v=o.clientY-r.top-10;const C=200,b=120;m+C>Se.value&&(m=o.clientX-r.left-C-10),v+b>r.height&&(v=o.clientY-r.top-b-10),m<0&&(m=10),v<0&&(v=10);const F=ll.value,N=Wn.value,L=F.map(S=>{const K=N[S]||S,Be=ha(S,t);return Be?{seriesName:t.seriesName,label:t.label,value:`${K}: ${Be}`,color:t.color}:null}).filter(Boolean);dt.value={show:!0,x:m,y:v,title:t.label||t.seriesName||"",value:"",bubbleData:L,categoryIndex:void 0,spiderAreas:[]}},ha=(t,o)=>{let l;switch(t){case"x":l=o.originalX;break;case"y":l=o.originalY;break;case"size":l=o.originalSize;break;case"label":l=o.label;break;case"seriesName":l=o.seriesName;break;default:l=o[t]||""}const r=dl.value[t];if(typeof r=="function")return r(l,o);if(typeof l=="number"){const m=l.toFixed(1);return pn.value?m+pn.value:m}return l?.toString()||""},Ia=()=>{if(!Gt.value||!ot.value.data||ot.value.data.length===0)return"Bubbles";const t=[],o=new Set;return ot.value.data.forEach(l=>{if(l.seriesName&&l.label){const r=`${l.seriesName} - ${l.label}`;o.has(r)||(t.push(r),o.add(r))}else l.seriesName&&(o.has(l.seriesName)||(t.push(l.seriesName),o.add(l.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},ga=(t,o)=>{t&&(zo.value=!1,$e.value=null,dt.value.show=!1,dt.value.bubbleData=[])},za=(t,o)=>{const l=o.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect(),m=Ul(t.categoryIndex),v=t.description||t.comment||"";let C=o.clientX-r.left+15,b=o.clientY-r.top-10;const F=200,N=v?80:50;C+F>Se.value&&(C=o.clientX-r.left-F-15),b+N>ie.value&&(b=o.clientY-r.top-N-10),C<0&&(C=10),b<0&&(b=10),sl.value={show:!0,x:C,y:b,categoryValue:m,description:v}},Pa=()=>{sl.value.show=!1},no=e.computed(()=>R.categories.length||Math.max(...Ql.value.map(t=>t.data.length))),Oa=e.computed(()=>{let t=0;return Ql.value.forEach(o=>{o.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),ya=e.computed(()=>{const t=[],o=no.value;for(let l=0;l<o;l++){const r=l*2*Math.PI/o-Math.PI/2,m=Dt.value+Math.cos(r)*Vt.value,v=Pt.value+Math.sin(r)*Vt.value;t.push({x:m,y:v,angle:r,index:l})}return t}),Wa=e.computed(()=>{const t=[],o=no.value;return ya.value.forEach((l,r)=>{const m=Vt.value+15,v=r*2*Math.PI/o-Math.PI/2,C=Dt.value+Math.cos(v)*m,b=Pt.value+Math.sin(v)*m+5;let F="middle",N="middle";Math.abs(Math.cos(v))>.5&&(F=Math.cos(v)>0?"start":"end"),Math.abs(Math.sin(v))>.5&&(N=Math.sin(v)>0?"hanging":"auto"),t.push({x:C,y:b,text:R.categories[r]||`Axis ${r+1}`,anchor:F,baseline:N})}),t}),qa=e.ref(new Set),Za=(t,o,l)=>{const r=`current-${l}`,m=qa.value.has(r),v=o.fillOpacity??Dl.value;return!m&&$e.value===null?v:o.isHighlighted||m?o.isComparison?v:v+.15:o.isDimmed?v*.3:v},ka=e.computed(()=>{if(!rl.value)return[];const t=[],o=no.value;return ln.value.map((r,m)=>({series:r,seriesIndex:m})).sort((r,m)=>{const v=n(r.series)?0:1,C=n(m.series)?0:1;return v-C}).forEach(({series:r,seriesIndex:m})=>{const v=n(r),C=[],b=[],F=[],N=$e.value===m,L=$e.value!==null&&$e.value!==m,S=wt.value.has(m);for(let K=0;K<o;K++){const Be=r.data[K]||0,re=Be/Oa.value*Vt.value,ye=K*2*Math.PI/o-Math.PI/2,Ee=Dt.value+Math.cos(ye)*re,ve=Pt.value+Math.sin(ye)*re;C.push(`${Ee},${ve}`),b.push({x:Ee,y:ve}),F.push({x:Ee,y:ve,value:Be,label:R.categories[K]||`Axis ${K+1}`,seriesName:r.name})}t.push({points:C.join(" "),polygonPoints:b,dataPoints:F,color:c(r,m),fillOpacity:v?s.value.fillOpacity:Dl.value,strokeDasharray:v?a(r)||s.value.strokeDasharray:null,pointRadius:i(r,v),seriesName:r.name,value:`${r.name}: ${r.data.join(", ")}`,isHighlighted:N,isDimmed:L,isHidden:S,isComparison:v,seriesIndex:m})}),t}),Ua=(t,o)=>{if(!o||o.length<3)return!1;let l=!1;for(let r=0,m=o.length-1;r<o.length;m=r++){const v=o[r].x,C=o[r].y,b=o[m].x,F=o[m].y;C>t.y!=F>t.y&&t.x<(b-v)*(t.y-C)/(F-C)+v&&(l=!l)}return l},Xa=t=>{if(!rl.value)return;const o=t.currentTarget.closest(".dss-custom-chart-container");if(!o)return;const l=o.getBoundingClientRect(),r=T.value?.getBoundingClientRect();if(!r)return;const m=t.clientX-r.left,v=t.clientY-r.top,C=ka.value.filter(b=>b.isHidden?!1:Ua({x:m,y:v},b.polygonPoints));if(C.length>0){C.length,$e.value=C[0].seriesIndex;const b=t.clientX-l.left+10,F=t.clientY-l.top-10,N=C.length>1?460:260,L=70+no.value*20;let S=b,K=F;S+N>Se.value&&(S=t.clientX-l.left-N-10),K+L>ie.value&&(K=t.clientY-l.top-L-10),S<0&&(S=10),K<0&&(K=10);const Be=C.map(Ze=>({seriesName:Ze.seriesName,color:Ze.color,points:Ze.dataPoints.map(re=>({label:re.label,value:$(re.value)}))}));dt.value={show:!0,x:S,y:K,title:"",value:"",bubbleData:[],spiderAreas:Be}}else un()},Io=e.computed(()=>{const t=Z.value;return t.logos.map((o,l)=>{const r=R.series[o.seriesIndex];if(!r||!r.data||r.data.length===0||wt.value.has(o.seriesIndex))return null;let m,v;if(Nl.value){let b=-1,F=null;for(let L=r.data.length-1;L>=0;L--)if(r.data[L]!==null&&r.data[L]!==void 0){b=L,F=r.data[L];break}if(b===-1||F===null)return null;const N=r.data.map((L,S)=>L==null?null:{x:ht(S),y:Ot(r,L),index:S}).filter(L=>L!==null);if(t.animations.enabled&&!An.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Wt.value.isAnimating||!Wt.value.hasAnimated))if(Wt.value.isAnimating){const L=Wt.value.currentFrame/Wt.value.totalFrames,S=aa(t.animations.easing,Math.min(L,1)),K=ls(N,S);m=K.x+(o.offsetX||0),v=K.y+(o.offsetY||0)}else m=N[0].x+(o.offsetX||0),v=N[0].y+(o.offsetY||0);else m=ht(b)+(o.offsetX||0),v=Ft(F)+(o.offsetY||0)}else if(cl.value||rl.value){const b=Math.PI*2/t.logos.length*l;m=Dt.value+Math.cos(b)*(Vt.value+30)+(o.offsetX||0),v=Pt.value+Math.sin(b)*(Vt.value+30)+(o.offsetY||0)}return{...o,x:m,y:v,seriesIndex:o.seriesIndex}}).filter(Boolean)}),Ya=t=>{const o=document.querySelector(`.dss-logo-fallback-${t}`),l=document.querySelector(`.dss-logo-image-${t}`);o&&(o.style.opacity="0"),l&&(l.style.opacity="1")},ja=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const o=document.querySelector(`.dss-logo-image-${t}`);o&&(o.style.display="none")},na=t=>{wt.value.has(t)?wt.value.delete(t):wt.value.add(t)},Ka=e.computed(()=>{if(!dt.value.show&&!(Ue.value&&ot.value.show&&!ce.value.isZooming))return{display:"none"};let t,o;if(Ue.value&&ot.value.show&&!ce.value.isZooming){t=ot.value.x+15,o=I.value.top;const l=Gt.value?200:150;t+l>Se.value&&(t=ot.value.x-l-15),t<0&&(t=10),o<10&&(o=10)}else t=dt.value.x,o=dt.value.y;return{left:t+"px",top:o+"px"}}),Tn=(t,o)=>{if(!Ie.value||wo.value)return;const r=o.target.closest(".dss-custom-chart-container").getBoundingClientRect();let m=o.clientX-r.left+10,v=o.clientY-r.top-10;const C=200,b=120,F=Se.value,N=ie.value;m+C>F&&(m=o.clientX-r.left-C-10),v+b>N&&(v=o.clientY-r.top-b-10),m<0&&(m=10),v<0&&(v=10);let L;typeof t.categoryIndex=="number"?L=t.categoryIndex:typeof t.dataIndex=="number"?L=t.dataIndex:t.label&&R.categories.includes(t.label)&&(L=R.categories.indexOf(t.label));let S=t.seriesName||t.label||"";(fl.value||be.value==="bar")&&t.label&&(S=t.label),t.tooltipTitle&&(S=t.tooltipTitle),dt.value={show:!0,x:m,y:v,title:S,value:$(t.value)||"",categoryIndex:L,spiderAreas:[]}},oa=e.ref(!1),zo=e.ref(!1),un=()=>{dt.value.show=!1,dt.value.spiderAreas=[],dt.value.bubbleData=[],ot.value.show=!1,oa.value||($e.value=null)},wo=e.ref(!1),xo=(t,o)=>{wo.value=!0,dt.value.show=!1,ot.value.show=!1;const r=o.target.closest(".dss-custom-chart-container").getBoundingClientRect();let m=o.clientX-r.left+15,v=o.clientY-r.top-10;const C=250;m+C>Se.value&&(m=o.clientX-r.left-C-15),m<0&&(m=10),v<0&&(v=10),Il.value={show:!0,x:m,y:v,content:t.texts,count:t.totalCount}},Eo=()=>{wo.value=!1,Il.value.show=!1},Wt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),aa=(t,o)=>{switch(t){case"linear":return o;case"ease":return o<.5?2*o*o:-1+(4-2*o)*o;case"ease-in":return o*o;case"ease-out":return o*(2-o);case"ease-in-out":return o<.5?2*o*o:-1+(4-2*o)*o;default:return o}},An=e.computed(()=>wn.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Ca=()=>{if(!Kt.value||An.value){Wt.value.hasAnimated=!0,_l.value&&(_n.value=1);return}_l.value&&(_n.value=0),Wt.value.isAnimating=!0,Wt.value.currentFrame=0,Wt.value.totalFrames=Math.ceil(jl.value/16.67);const t=()=>{const o=Wt.value.currentFrame/Wt.value.totalFrames,l=aa(il.value,Math.min(o,1));Ga(l),_l.value&&(_n.value=l),o<1?(Wt.value.currentFrame++,Wt.value.animationId=requestAnimationFrame(t)):Qa()};Wt.value.animationId=requestAnimationFrame(t)},Ga=t=>{const o=P.value;o&&o.style.setProperty("--dss-animation-progress",t)},Qa=()=>{Wt.value.isAnimating=!1,Wt.value.hasAnimated=!0,_l.value&&(_n.value=1),Wt.value.animationId&&(cancelAnimationFrame(Wt.value.animationId),Wt.value.animationId=null)},sa=e.computed(()=>!cl.value||Wt.value.hasAnimated?!0:_l.value?_n.value>=1:Cn.value?Mn.value>=1:!0),ba=e.computed(()=>Vl.value&&sa.value),Po=e.ref(!1);e.watch(ba,t=>{t?(Po.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Po.value=!0})})):Po.value=!1},{immediate:!0});const Ja=e.computed(()=>{if(!Kt.value||An.value||Wt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${jl.value}ms`,t["--dss-animation-easing"]=es(il.value),t["--dss-stagger-delay"]=`${vl.value}ms`,t}),es=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",ts=()=>{if(!Kt.value||An.value)return"";const t=["dss-chart-animated"];return Wt.value.hasAnimated||t.push(`dss-animate-${ql.value}`),Wt.value.hasAnimated||(cl.value&&be.value!=="semi-radial"?t.push("dss-animate-fill"):cl.value||t.push(`dss-animate-${ql.value}`)),Wt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>R.series,(t,o)=>{dn.value&&o&&Wt.value.hasAnimated&&(Wt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Ca(),El.value)}))},{deep:!0}),e.watch(()=>ce.value.isZooming,(t,o)=>{o&&!t&&setTimeout(()=>{So()},50)}),e.watch(()=>[ce.value.scale,ce.value.offsetX],()=>{!ce.value.isZooming&&!ce.value.isDragging&&So()},{flush:"post"}),e.watch([Ut,qe],([t,o])=>{ce.value.minScale=t,ce.value.maxScale=o,(ce.value.scale<t||ce.value.scale>o)&&tn()},{immediate:!0}),e.watch(()=>R.locale,t=>{t&&t!==B.value&&(B.value=t)},{immediate:!0}),e.watch(()=>mt.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",fo)}):document.removeEventListener("click",fo)}),e.onMounted(()=>{$e.value=null,_l.value&&(!Kt.value||An.value)&&(_n.value=1),jo(),P.value&&typeof ResizeObserver<"u"&&(f=new ResizeObserver(t=>{const o=t[0];!o||!o.contentRect||(we&&cancelAnimationFrame(we),we=requestAnimationFrame(()=>{we=null;const{width:l,height:r}=o.contentRect;st.value=Math.round(l),te.value=Math.round(r),he.value&&(Le.value=he.value.offsetHeight||Ce)}))}),f.observe(P.value)),Kt.value&&!An.value?be.value==="semi-radial"?setTimeout(()=>ea(),El.value):setTimeout(()=>Ca(),El.value):(Wt.value.hasAnimated=!0,be.value==="semi-radial"&&(Mn.value=1)),document.addEventListener("mousemove",wa),document.addEventListener("mouseup",xa),document.addEventListener("click",Zn)}),e.onUnmounted(()=>{we&&cancelAnimationFrame(we),f&&P.value&&(f.unobserve(P.value),f.disconnect(),f=null),Wt.value.animationId&&cancelAnimationFrame(Wt.value.animationId),Yn&&(cancelAnimationFrame(Yn),Yn=null),ce.value.zoomTimeout&&clearTimeout(ce.value.zoomTimeout),document.removeEventListener("mousemove",wa),document.removeEventListener("mouseup",xa),document.removeEventListener("click",Zn),document.removeEventListener("click",fo)});const wa=t=>{if(ce.value.isDragging&&ce.value.scale>1&&Nl.value){ot.value.show=!1;const o=t.clientX-ce.value.lastMouseX,{minX:l,maxX:r}=ge.value,m=r-l||1,C=o*.8;ce.value.offsetX+=C;const b=m/ce.value.scale,F=m-b,N=0,L=-F/m*I.value.width,S=N;ce.value.offsetX=Math.max(L,Math.min(S,ce.value.offsetX)),ce.value.lastMouseX=t.clientX,ce.value.lastMouseY=t.clientY}},xa=()=>{ce.value.isDragging&&(ce.value.isDragging=!1,setTimeout(()=>{!ce.value.isDragging&&ce.value.isZooming},100))},ls=(t,o)=>{const l=t.filter(b=>b!=null);if(!l||l.length===0)return{x:0,y:0};if(l.length===1||o<=0)return l[0];if(o>=1)return l[l.length-1];let r=0;const m=[];for(let b=1;b<l.length;b++){const F=l[b].x-l[b-1].x,N=l[b].y-l[b-1].y,L=Math.sqrt(F*F+N*N);m.push(L),r+=L}const v=r*o;let C=0;for(let b=0;b<m.length;b++){const F=C+m[b];if(v<=F){const N=(v-C)/m[b],L=l[b],S=l[b+1];return{x:L.x+(S.x-L.x)*N,y:L.y+(S.y-L.y)*N}}C=F}return l[l.length-1]};return(t,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[ts(),{"dss-chart-fill-width":Fe.value,"dss-chart-fill-height":We.value,"dss-chart-compact":cl.value&&!W.value}]]),style:e.normalizeStyle({width:Fe.value?"100%":Se.value+"px",height:Ge.value,...Fe.value||We.value?{overflow:cl.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Ja.value,cursor:Nn()}),"data-chart-type":be.value,ref_key:"containerEl",ref:P,onWheel:Mo,onMousedown:_o,onMousemove:g,onMouseup:yn,onMouseleave:x,onDblclick:tn,onContextmenu:e.withModifiers(q,["prevent"]),onClick:e.withModifiers(ue,["left"]),onWheelCapture:Mo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:he},[e.createElementVNode("div",Js,[ct.value?(e.openBlock(),e.createElementBlock("div",er,e.toDisplayString(ct.value),1)):e.createCommentVNode("",!0),gt.value?(e.openBlock(),e.createElementBlock("div",tr,e.toDisplayString(gt.value),1)):e.createCommentVNode("",!0)]),W.value&&G.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ne.value==="horizontal","dss-legend-vertical":Ne.value==="vertical","dss-legend-top":G.value==="top","dss-legend-bottom":G.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":wt.value.has(r),"dss-legend-hovered":$e.value===r,"dss-legend-dimmed":$e.value!==null&&$e.value!==r}]),onClick:m=>na(r),onMouseenter:m=>zl(r),onMouseleave:y,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":rl.value&&n(l)}]),style:e.normalizeStyle({backgroundColor:rl.value&&n(l)?"transparent":d(l,r),borderColor:d(l,r)})},null,6),e.createElementVNode("span",nr,e.toDisplayString(l.name),1)],46,lr))),128))],2)):e.createCommentVNode("",!0),W.value&&(G.value==="left"||G.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":G.value==="left","dss-legend-right":G.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":wt.value.has(r),"dss-legend-hovered":$e.value===r,"dss-legend-dimmed":$e.value!==null&&$e.value!==r}]),onClick:m=>na(r),onMouseenter:m=>zl(r),onMouseleave:y,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":rl.value&&n(l)}]),style:e.normalizeStyle({backgroundColor:rl.value&&n(l)?"transparent":d(l,r),borderColor:d(l,r)})},null,6),e.createElementVNode("span",ar,e.toDisplayString(l.name),1)],46,or))),128))],2)):e.createCommentVNode("",!0)],512),E.showAddMarkerButton&&on.value&&bl.value.addMarker&&(Nl.value||Gt.value)&&!rn.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Kn,title:e.unref(_)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Kl.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,rr),o[4]||(o[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,sr)):e.createCommentVNode("",!0),e.createElementVNode("div",ir,[Gt.value&&ut.value?(e.openBlock(),e.createElementBlock("div",cr,"Bubble size: "+e.toDisplayString(ut.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Se.value,height:ie.value,class:"dss-chart-svg","data-smooth":xe.value,"data-animated":Kt.value,ref_key:"svgEl",ref:T},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:X.value},[e.createElementVNode("rect",{x:0,y:I.value.top,width:Se.value,height:I.value.height*4},null,8,mr)],8,dr),Cn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:ho.value},[e.createElementVNode("path",{d:Jo.value},null,8,vr)],8,pr)):e.createCommentVNode("",!0),_l.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:Fn.value},[e.createElementVNode("path",{d:yo.value},null,8,hr)],8,fr)):e.createCommentVNode("",!0)]),Nl.value||Gt.value?(e.openBlock(),e.createElementBlock("g",gr,[ke.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":fe.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${r}`,x1:I.value.left,x2:I.value.right,y1:l.y,y2:l.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${r*50}ms`})},null,12,kr))),128))],8,yr)):e.createCommentVNode("",!0),rn.value&&Co.value.length?(e.openBlock(),e.createElementBlock("g",{key:1,class:"dss-stepbar-axis-bars","clip-path":fe.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Co.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`stepbar-axis-bar-${r}`,x1:I.value.left,x2:I.value.right,y1:l.y,y2:l.y,stroke:St.value,"stroke-width":zt.value,"stroke-dasharray":Bt.value,opacity:Lt.value},null,8,br))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Do.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`stepbar-vertical-axis-bar-${r}`,x1:l.x,x2:l.x,y1:I.value.top,y2:I.value.bottom,stroke:St.value,"stroke-width":zt.value,"stroke-dasharray":Bt.value,opacity:Lt.value*.7},null,8,wr))),128))],8,Cr)):e.createCommentVNode("",!0),e.createElementVNode("g",xr,[e.createElementVNode("line",{x1:I.value.left,x2:I.value.right,y1:I.value.bottom,y2:I.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Er),e.createElementVNode("line",{x1:I.value.left,x2:I.value.left,y1:I.value.top,y2:I.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Sr),h.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:I.value.right,x2:I.value.right,y1:I.value.top,y2:I.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Vr)):e.createCommentVNode("",!0)]),e.createElementVNode("g",Nr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bo.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${r}`,x:l.x,y:l.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},e.toDisplayString(l.text),13,Br))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(to.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${r}`,x:l.x,y:l.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${r*80}ms`})},e.toDisplayString(l.text),13,Mr))),128)),h.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(lo.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`y-secondary-${r}`,x:l.x,y:l.y,"text-anchor":"start","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${r*80}ms`})},e.toDisplayString(l.text),13,_r))),128)):e.createCommentVNode("",!0),qt.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:I.value.left+I.value.width/2,y:I.value.bottom+45,"text-anchor":"middle","font-size":"14",fill:"#666"},e.toDisplayString(qt.value),9,$r)):e.createCommentVNode("",!0),Zt.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:15,y:I.value.top+12+I.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(-90, 15, ${I.value.top+I.value.height/2})`},e.toDisplayString(Zt.value),9,Lr)):e.createCommentVNode("",!0),h.value&&xt.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:Se.value-15,y:I.value.top+12+I.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(90, ${Se.value-15}, ${I.value.top+I.value.height/2})`},e.toDisplayString(xt.value),9,Tr)):e.createCommentVNode("",!0)]),On.value.length>0?(e.openBlock(),e.createElementBlock("g",Ar,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(On.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":fe.value},[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.x,y1:I.value.bottom,y2:I.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>xo(l,r),onMouseleave:Eo},null,40,Hr)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:I.value.bottom,y2:I.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>xo(l,r),onMouseleave:Eo},null,40,Rr)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:I.value.bottom,y2:I.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>xo(l,r),onMouseleave:Eo},null,40,Fr)):e.createCommentVNode("",!0)],8,Dr),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,I.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:r=>xo(l,r),onMouseleave:Eo},null,40,Ir)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,I.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:r=>xo(l,r),onMouseleave:Eo},null,40,zr),e.createElementVNode("text",{x:l.x,y:Math.max(15,I.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(l.totalCount),9,Pr)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":fe.value},[Bl.value?(e.openBlock(),e.createElementBlock("g",Wr,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":fl.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pa.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${r}`},[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:m=>Tn(l,m),onMouseleave:un},null,46,qr)):(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:m=>Tn(l,m),onMouseleave:un},null,46,Zr))],64))),128))],2),e.createElementVNode("g",Ur,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(da.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Pe.value+2:Pe.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,Xr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ma.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Pe.value+2:Pe.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)),$t.value>0||oe.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ta.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${r}`,cx:l.x,cy:l.y,r:j(l.isHighlighted?Y(l,$t.value)+2:Y(l,$t.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:m=>Tn(l,m),onMouseleave:un},null,46,jr))),128)):e.createCommentVNode("",!0)])])):be.value==="line"?(e.openBlock(),e.createElementBlock("g",Kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($a.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${r}`,d:l.path,stroke:l.color,"stroke-width":Pe.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Wt.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(da.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Pe.value+2:Pe.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,Qr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ma.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Pe.value+2:Pe.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,Jr))),128)),$t.value>0||oe.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(La.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${r}`,cx:l.x,cy:l.y,r:j(l.isHighlighted?Y(l,$t.value)+2:Y(l,$t.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:m=>Tn(l,m),onMouseleave:un},null,46,ei))),128)):e.createCommentVNode("",!0)])):be.value==="area"?(e.openBlock(),e.createElementBlock("g",ti,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ta.value,(l,r)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${r}`,id:`area-mask-${r}-${E.chartId}`},[e.createElementVNode("rect",{x:I.value.left-10,y:I.value.top-10,width:I.value.width+20,height:I.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${I.value.width+20}px`})},null,12,ni)],8,li))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ta.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${r}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?pe.value+.2:pe.value,mask:`url(#area-mask-${r}-${E.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,oi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ta.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${r}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?Pe.value+1:Pe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${r*vl.value}ms`})},null,14,ai))),128))])):be.value==="stepbar"?(e.openBlock(),e.createElementBlock("g",si,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(la.value,l=>(e.openBlock(),e.createElementBlock("g",{key:l.key,class:"dss-stepbar-column"},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:l.clipPathId},[e.createElementVNode("path",{d:l.clipPath},null,8,ii)],8,ri)]),e.createElementVNode("g",{"clip-path":l.clipPathRef},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.segments,r=>(e.openBlock(),e.createElementBlock("rect",{key:r.key,x:r.x,y:r.y,width:r.width,height:r.height,fill:r.color,stroke:"none",class:e.normalizeClass({"dss-bar-highlighted":r.isHighlighted,"dss-bar-dimmed":r.isDimmed,"dss-bar-hidden":r.isHidden}),style:e.normalizeStyle({fillOpacity:r.isDimmed?.4:1,animationDelay:`${r.animationDelay}ms`}),onMouseover:m=>Tn(r,m),onMouseleave:un},null,46,ui))),128))],8,ci)]))),128))])):be.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:4,class:e.normalizeClass({"dss-horizontal-bars":fl.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pa.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${r}`},[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:m=>Tn(l,m),onMouseleave:un},null,46,di)):(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:m=>Tn(l,m),onMouseleave:un},null,46,mi))],64))),128))],2)):e.createCommentVNode("",!0)],8,Or),Ue.value&&ot.value.show&&!ce.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-crosshair","clip-path":fe.value},[e.createElementVNode("line",{x1:ot.value.x,x2:ot.value.x,y1:I.value.top,y2:I.value.bottom,stroke:Et.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,vi),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${r}`,cx:ot.value.x,cy:l.y,r:j($t.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,fi))),128))],8,pi)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Gt.value?(e.openBlock(),e.createElementBlock("g",hi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fo.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${r}`},[l?(e.openBlock(),e.createElementBlock("g",gi,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:j(l.radius),fill:l.color,"fill-opacity":Ha(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(Fa(l,r)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:m=>fa(l,m),onMouseleave:m=>ga(l),onClick:m=>va(l,m)},null,42,yi),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-${r} ${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:Ra(l)}),onLoad:m=>$n(r),onError:m=>ko(r),onMouseenter:m=>fa(l,m),onMouseleave:m=>ga(l),onClick:m=>va(l,m)},null,46,ki)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),cl.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:Qn.value},[be.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Dt.value,cy:Pt.value,r:Vt.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,bi)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":be.value,"clip-path":Lo.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Aa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${l.originalIndex}-${r}`,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":$o(l.originalIndex),class:e.normalizeClass({"dss-series-highlighted":l.segment.isHighlighted,"dss-series-dimmed":l.segment.isDimmed,"dss-series-hidden":l.segment.isHidden}),onMouseover:m=>Tn(l.segment,m),onMouseleave:un},null,42,xi))),128))],8,wi),xn.value&&sa.value?(e.openBlock(),e.createElementBlock("g",Ei,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ul.value,(l,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${r}`,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,Si)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),vn.value&&(sa.value||Cn.value||Gl.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:En.value.x,y:En.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Hn.value,fill:en.value,class:"dss-radial-data-center"},e.toDisplayString(fn.value),9,Vi)):e.createCommentVNode("",!0),ba.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Po.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Da.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${r}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":l.isHighlighted,"dss-label-dimmed":l.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${r*.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,Ni),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,Bi),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":an.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,Mi)],6))),128))],2)):e.createCommentVNode("",!0)],8,Ci)):e.createCommentVNode("",!0),rl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:Qn.value},[ke.value?(e.openBlock(),e.createElementBlock("g",$i,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($l.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${r}`,cx:Dt.value,cy:Pt.value,r:j(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*150}ms`})},null,12,Li))),128)),e.createElementVNode("g",Ti,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($l.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${r}`},[e.createElementVNode("rect",{x:Dt.value-16,y:Pt.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Ai),e.createElementVNode("text",{x:Dt.value,y:Pt.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(zn(r)),9,Di)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ya.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${r}`,x1:Dt.value,x2:l.x,y1:Pt.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},null,12,Hi))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Ri,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wa.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${r}`,x:l.x+Math.cos(r*2*Math.PI/no.value-Math.PI/2)*16,y:l.y+Math.sin(r*2*Math.PI/no.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:`${r*120}ms`})},e.toDisplayString(l.text.charAt(0).toUpperCase()+l.text.slice(1)),13,Fi))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Xa,onMouseleave:un},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ka.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${r}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":Za("current",l,r),stroke:l.color,"stroke-width":l.isHighlighted?Pe.value+1:Pe.value,"stroke-dasharray":l.strokeDasharray||void 0,"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:`${r*vl.value}ms`,transition:"all 0.2s ease"})},null,14,Ii),l.pointRadius>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.dataPoints,(m,v)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${r}-${v}`,cx:m.x,cy:m.y,r:j(l.isHighlighted?l.pointRadius+1:l.pointRadius),fill:l.isComparison?"none":l.color,stroke:l.isComparison?l.color:"none","stroke-width":l.isComparison?2:0,class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${r*vl.value+v*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>Tn(m,C),onMouseleave:un},null,46,zi))),128)):e.createCommentVNode("",!0)]))),128))],32)],8,_i)):e.createCommentVNode("",!0),e.createElementVNode("g",Pi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Io.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${r}`,cx:l.x,cy:l.y,r:j(l.width/2),fill:Qt(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${r}`),style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,14,Oi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Io.value,(l,r)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${r}`,x:l.x-l.width/2,y:l.y-l.height/2,width:l.width,height:l.height,"xlink:href":l.url,onLoad:m=>Ya(r),onError:m=>ja(r),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${r}`),"clip-path":`circle(${l.width/2}px at ${l.width/2}px ${l.height/2}px)`,style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,46,Wi))),128))])],8,ur))]),Ae.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Se.value+"px",height:ie.value+"px",backgroundImage:`url('${el.value}')`,backgroundRepeat:"no-repeat",...kl.value,opacity:it.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ne.value,(l,r)=>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:Ml.value+"px",height:Ml.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(m=>mo(l),["stop"]),onMouseenter:m=>za(l,m),onMouseleave:Pa},[e.createElementVNode("img",{src:Pl(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Zi)],44,qi)),[[e.vShow,O.value]])),128)),sl.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:sl.value.x+"px",top:sl.value.y+"px"})},[e.createElementVNode("div",Ui,e.toDisplayString(sl.value.categoryValue),1),sl.value.description?(e.openBlock(),e.createElementBlock("div",Xi,e.toDisplayString(sl.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Ie.value&&(dt.value.show||Ue.value&&ot.value.show&&!ce.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Ue.value&&ot.value.show&&!ce.value.isZooming,"dss-spider-tooltip":rl.value&&dt.value.spiderAreas&&dt.value.spiderAreas.length>0}]),style:e.normalizeStyle(Ka.value)},[!Ue.value||!ot.value.show||ce.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[rl.value&&dt.value.spiderAreas&&dt.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",Yi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dt.value.spiderAreas,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${r}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",ji,[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,(m,v)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${r}-${v}`,class:"dss-tooltip-series"},[e.createElementVNode("span",Ki,e.toDisplayString(m.label),1),e.createElementVNode("span",Gi,e.toDisplayString(m.value),1)]))),128))]))),128))])):Gt.value&&dt.value.bubbleData&&dt.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Qi,[dt.value.title?(e.openBlock(),e.createElementBlock("div",Ji,e.toDisplayString(dt.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ec,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dt.value.bubbleData,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${r}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",tc,[e.createElementVNode("div",lc,e.toDisplayString(dt.value.title),1),e.createElementVNode("div",nc,e.toDisplayString(dt.value.value),1)])),dt.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Tt(dt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",oc,[o[5]||(o[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ac,e.toDisplayString(e.unref(_)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt(dt.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${r}`},[e.createElementVNode("div",sc,[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,(m,v)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${r}-${v}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",rc,[e.createElementVNode("div",ic,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Tt(dt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",cc,[o[6]||(o[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",uc,e.toDisplayString(e.unref(_)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt(dt.value.categoryIndex).markers,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${r}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",dc,[e.createElementVNode("div",mc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",pc,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",vc,[e.createElementVNode("div",fc,e.toDisplayString(Gt.value?Ia():E.categories[ot.value.categoryIndex]||`Category ${ot.value.categoryIndex+1}`),1),Gt.value?(e.openBlock(),e.createElementBlock("div",hc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${r}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(ot.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${r}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",gc,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",yc,e.toDisplayString($(l.value)),1)]))),128))]),Tt(ot.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",kc,[o[7]||(o[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Cc,e.toDisplayString(e.unref(_)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt(ot.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${r}`},[e.createElementVNode("div",bc,[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,(m,v)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${r}-${v}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",wc,[e.createElementVNode("div",xc,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Tt(ot.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Ec,[o[8]||(o[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Sc,e.toDisplayString(e.unref(_)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt(ot.value.categoryIndex).markers,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${r}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",Vc,[e.createElementVNode("div",Nc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",Bc,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Nl.value&&Ke.value&&ce.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:tn},[o[9]||(o[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(ce.value.scale*100))+"% "+e.toDisplayString(e.unref(_)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Qs),W.value&&G.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ne.value==="horizontal","dss-legend-vertical":Ne.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(R.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":wt.value.has(r),"dss-legend-hovered":$e.value===r,"dss-legend-dimmed":$e.value!==null&&$e.value!==r}]),onClick:m=>na(r),onMouseenter:m=>zl(r),onMouseleave:y,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":rl.value&&n(l)}]),style:e.normalizeStyle({backgroundColor:rl.value&&n(l)?"transparent":d(l,r),borderColor:d(l,r)})},null,6),e.createElementVNode("span",_c,e.toDisplayString(l.name),1)],46,Mc))),128))],2)):e.createCommentVNode("",!0),mt.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:mt.value.x+"px",top:mt.value.y+"px"}),onClick:o[0]||(o[0]=e.withModifiers(()=>{},["stop"]))},[bl.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Rn},e.toDisplayString(e.unref(_)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),bl.value.addMarker&&(bl.value.downloadSvg||bl.value.downloadPng||bl.value.downloadCsv||Fl.value.length>0)?(e.openBlock(),e.createElementBlock("div",$c)):e.createCommentVNode("",!0),bl.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Ko},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),bl.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Go},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),bl.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Qo},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Fl.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[bl.value.downloadSvg||bl.value.downloadPng||bl.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Lc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fl.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+r},[l.separator?(e.openBlock(),e.createElementBlock("div",Tc)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Xt(l)),style:e.normalizeStyle(Cl(l)),onClick:m=>Bo(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:at(l),class:"dss-custom-menu-content"},null,8,Dc)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",Hc,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,Ac)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Oe.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:Vn},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:o[3]||(o[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Rc,[e.createElementVNode("h3",null,e.toDisplayString(nl.value?e.unref(_)("chart.modalMarker.viewMarker"):Tl.value?e.unref(_)("chart.modalMarker.editMarker"):e.unref(_)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:Vn},"×")]),e.createElementVNode("div",Fc,[e.createElementVNode("div",Ic,[e.createVNode(ca,{id:"dss-marker-date",mode:"single",modelValue:Oe.value.date,"onUpdate:modelValue":o[1]||(o[1]=l=>Oe.value.date=l),"min-date":Ll.value,"max-date":sn.value,disabled:nl.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",zc,[e.createElementVNode("label",Pc,e.toDisplayString(e.unref(_)("chart.modalMarker.description")),1),nl.value?(e.openBlock(),e.createElementBlock("div",Oc,e.toDisplayString(Oe.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":o[2]||(o[2]=l=>Oe.value.description=l),placeholder:e.unref(_)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Wc)),[[e.vModelText,Oe.value.description]])])]),e.createElementVNode("div",qc,[e.createElementVNode("div",Zc,[Tl.value&&!nl.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:Xo},e.toDisplayString(e.unref(_)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Uc,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:Vn},e.toDisplayString(nl.value?e.unref(_)("chart.modalMarker.close"):e.unref(_)("chart.modalMarker.cancel")),1),nl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:Vo,disabled:!(Oe.value.description&&Oe.value.description.length)},e.toDisplayString(Tl.value?e.unref(_)("chart.modalMarker.save"):e.unref(_)("chart.contextMenu.addMarker")),9,Xc))])])])])):e.createCommentVNode("",!0)],64))}}),Kc={class:"dss-modal-title"},Gc={class:"dss-modal-actions"},ia={__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(E,{emit:le}){const _=E,B=le,de=e.ref(null),P=e.ref(null),T=e.computed(()=>{const X={"max-width":_.width};return _.height!=="auto"&&(X.height=_.height,X["min-height"]="0"),X}),he=e.computed(()=>({}));function st(){B("close-modal")}function te(){_.backDrop&&!de.value&&B("close-modal")}function f(X){X.target.tagName==="INPUT"&&(de.value=X.target.tagName)}function we(){setTimeout(()=>{de.value=null},300)}function Ce(){const X=document.body,fe=document.documentElement;P.value={bodyOverflow:X.style.overflow,bodyPosition:X.style.position,bodyTop:X.style.top,bodyWidth:X.style.width,htmlOverflow:fe.style.overflow,scrollY:window.scrollY},X.style.overflow="hidden",X.style.position="fixed",X.style.top=`-${P.value.scrollY}px`,X.style.width="100%",X.style.left="0",fe.style.overflow="hidden"}function J(){if(!P.value)return;const X=document.body,fe=document.documentElement,{bodyOverflow:R,bodyPosition:me,bodyTop:_e,bodyWidth:Je,htmlOverflow:pt,scrollY:Z}=P.value;X.style.overflow=R||"",X.style.position=me||"",X.style.top=_e||"",X.style.width=Je||"",X.style.left="",fe.style.overflow=pt||"",window.scrollTo(0,Z||0)}return e.watch(()=>_.showModal,X=>{if(X)Ce(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const fe=document.getElementById("dss-modal-backdrop");fe&&(fe.addEventListener("focusin",f),fe.addEventListener("focusout",we))},100);else{J(),document.body.classList.remove("dss-modal-open");const fe=document.getElementById("dss-modal-backdrop");fe&&(fe.removeEventListener("focusin",f),fe.removeEventListener("focusout",we))}},{immediate:!0}),e.onUnmounted(()=>{_.showModal&&J()}),(X,fe)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[E.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:te},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(T.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:fe[0]||(fe[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":E.headerType,"font-size":E.titleSize})},[e.createElementVNode("h1",Kc,[e.renderSlot(X.$slots,"title",{},()=>[fe[1]||(fe[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(X.$slots,"title-data"),E.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:st,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(he.value)},[e.renderSlot(X.$slots,"content",{},()=>[fe[2]||(fe[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Gc,[e.renderSlot(X.$slots,"actions")])])],4),[[e.vShow,E.showModal]])])):e.createCommentVNode("",!0)]))}},Qc={key:0,class:"dss-table-toolbar"},Jc={class:"dss-table-toolbar-left"},eu=["aria-expanded"],tu={class:"dss-pagination-select-dropdown",role:"listbox"},lu={class:"dss-table-column-visibility-label"},nu={class:"dss-table-checkbox-wrapper"},ou=["checked","onChange"],au={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},su={class:"dss-table-column-visibility-text"},ru={class:"dss-table-toolbar-right"},iu=["placeholder","aria-label"],cu=["aria-label"],uu=["aria-label","aria-expanded"],du={key:1,class:"dss-table-toolbar-extra"},mu={class:"dss-table-thead"},pu={key:0,class:"dss-table-th dss-table-selection-column"},vu={key:0,class:"dss-table-checkbox-wrapper"},fu=["checked","indeterminate"],hu={key:0,class:"dss-table-checkbox__indeterminate"},gu={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},yu=["aria-label"],ku=["onClick"],Cu={class:"dss-table-th-content"},bu={class:"dss-table-th-text"},wu={key:0},xu={key:1},Eu={key:2},Su=["data-filter-column-key","aria-expanded","aria-label","onClick"],Vu={class:"dss-table-tbody"},Nu=["onClick"],Bu={class:"dss-table-checkbox-wrapper"},Mu=["type","name","checked","disabled","onChange"],_u={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},$u={key:1,class:"dss-table-checkbox__dot"},Lu=["onClick"],Tu=["aria-expanded","aria-label"],Au={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},Du={key:0,class:"dss-table-expansion-row"},Hu=["colspan"],Ru=["colspan"],Fu={key:1,class:"dss-table-pagination"},Iu={class:"dss-table-pagination-left"},zu={key:0},Pu={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},Ou={class:"dss-table-pagination-center"},Wu={key:0,class:"dss-pagination-controls"},qu=["disabled","title"],Zu=["disabled","title"],Uu=["aria-label","onKeydown"],Xu={class:"dss-pagination-of"},Yu=["disabled","title"],ju=["disabled","title"],Ku={class:"dss-table-pagination-right"},Gu={class:"dss-pagination-rows-label"},Qu=["aria-expanded"],Ju=["aria-selected","onClick"],ed={key:0,class:"dss-table-filter-row"},td=["value","placeholder"],ld=["min","max","value"],nd=["min","max","value"],od={class:"dss-table-filter-double-range-values"},ad={key:2,class:"dss-table-filter-daterange"},sd={class:"dss-table-filter-daterange-row"},rd={class:"dss-table-filter-daterange-label"},id=["value"],cd={class:"dss-table-filter-daterange-row"},ud={class:"dss-table-filter-daterange-label"},dd=["value"],md=["value","placeholder"],pd={class:"dss-table-filter-list"},vd=["checked","onChange"],fd={class:"dss-table-filter-actions"},hd={name:"DSSTable"},gd=Object.assign(hd,{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:E=>typeof E=="object"&&E!==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(E,{emit:le}){const{t:_,locale:B}=so.useI18n(),de=E,P=le,T={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 he(y,g){const x=Object.assign({},y);return st(y)&&st(g)&&Object.keys(g).forEach(q=>{st(g[q])?q in y?x[q]=he(y[q],g[q]):Object.assign(x,{[q]:g[q]}):Object.assign(x,{[q]:g[q]})}),x}function st(y){return y&&typeof y=="object"&&!Array.isArray(y)}const te=e.computed(()=>he(T,de.options)),f=e.computed(()=>{const y=te.value.table.width;return y==="auto"?null:typeof y=="number"?y:null}),we=e.computed(()=>te.value.table.height),Ce=e.computed(()=>te.value.table.rowHeight??"auto"),J=e.computed(()=>({height:Ce.value})),X=e.computed(()=>te.value.table.expandable===!0),fe=e.computed(()=>te.value.table.expandableRowData??null),R=e.computed(()=>te.value.table.expandableRowCondition??null),me=e.computed(()=>te.value.table.truncated===!0),_e=e.computed(()=>te.value.table.striped),Je=e.computed(()=>te.value.table.bordered),pt=e.computed(()=>te.value.table.hoverable),Z=e.computed(()=>te.value.table.size),Fe=e.computed(()=>te.value.table.align||"left");e.computed(()=>te.value.title.text),e.computed(()=>te.value.subtitle.text);const We=e.computed(()=>te.value.selection.enabled),Se=e.computed(()=>te.value.selection.mode),Le=e.computed(()=>te.value.selection.rowCondition??null),Ye=e.computed(()=>te.value.sorting.enabled),ie=e.computed(()=>te.value.sorting.mode),Ge=e.computed(()=>te.value.pagination.enabled),be=e.computed(()=>te.value.pagination.rows),Qe=e.computed(()=>te.value.pagination.rowsPerPageOptions),ct=e.computed(()=>te.value.pagination.showCounter!==!1),gt=e.computed(()=>te.value.pagination.showControlsGroup),ut=e.computed(()=>gt.value===!1?!1:te.value.pagination.showControls!==!1),qt=e.computed(()=>gt.value===!1?!1:te.value.pagination.showRowsPerPage!==!1),Zt=e.computed(()=>Ge.value&&(ct.value||ut.value||qt.value)),kt=e.computed(()=>te.value.scrollable),xt=e.computed(()=>te.value.emptyMessage||_("table.emptyMessage")),Yt=e.computed(()=>te.value.toolbar?.downloads?.pdf!==!1),rt=e.computed(()=>te.value.toolbar?.downloads?.excel!==!1),Jt=e.computed(()=>te.value.toolbar?.search!==!1),yt=e.computed(()=>Yt.value||rt.value||Jt.value||ol.value),ol=e.computed(()=>te.value.toolbar?.columnVisibility!==!1),U=e.ref(""),ke=e.ref(!1),W=e.ref(null);let G=null;function Ne(){ke.value?(G&&(clearTimeout(G),G=null),ke.value=!1,U.value="",P("search",""),W.value?.blur()):(ke.value=!0,G=setTimeout(()=>{G=null,W.value?.focus()},80))}function Ie(){U.value||(ke.value=!1)}function Ue(){U.value="",P("search",""),W.value?.focus()}const Et=e.computed(()=>({"dss-table-striped":_e.value,"dss-table-bordered":Je.value,"dss-table-hoverable":pt.value,[`dss-table-${Z.value}`]:Z.value!=="default","dss-table-truncated":me.value})),Ke=(y,g)=>y?.field??y?.key??g,Ut=e.ref(new Set);function qe(){const y=new Set;return de.columns.forEach((g,x)=>{g?.hidden!==!0&&y.add(Ke(g,x))}),y}function Pe(){const y=new Set;return de.columns.forEach((g,x)=>{y.add(Ke(g,x))}),y}function Ht(y){if(!Array.isArray(y))return null;const g=Pe(),x=[];return y.forEach(q=>{g.has(q)&&x.push(q)}),x}function $t(){Ut.value=qe()}const oe=e.computed(()=>{const y=Ht(de.columnVisibility);return y===null?null:new Set(y)}),Y=e.computed(()=>oe.value??Ut.value),j=e.computed(()=>de.columns.filter((y,g)=>Y.value.has(Ke(y,g)))),pe=y=>{const g=de.columns.findIndex(x=>x===y);return Ke(y,g>=0?g:0)},xe=(y,g)=>Y.value.has(Ke(y,g));function je(y){P("update:columnVisibility",Array.from(y))}function Rt(y,g){const x=Ke(y,g),q=new Set(Y.value);q.has(x)?q.delete(x):q.add(x),oe.value===null&&(Ut.value=q),je(q)}const jt=e.ref(null),et=e.ref(!1);function pl(y){jt.value&&!jt.value.contains(y.target)&&(et.value=!1)}const M=e.computed(()=>j.value.length+(We.value?1:0)+(X.value?1:0)),w=(y,g)=>y?.id??y?.key??g,A=e.ref(new Set),se=e.ref(null),ae=(y,g)=>A.value.has(w(y,g)),He=(y,g)=>{if(!X.value)return!1;if(typeof R.value=="function")return!!R.value(y,g);if(typeof fe.value=="string"&&fe.value.trim()){const x=Tl(y,fe.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},Ct=(y,g,x)=>{if(x&&x.stopPropagation(),!He(y,g))return;const q=w(y,g),ue=new Set(A.value);ue.has(q)?(ue.delete(q),P("row-collapse",{data:y,index:g})):(ue.add(q),P("row-expand",{data:y,index:g})),A.value=ue},nt=(y,g)=>{if(!me.value)return;const x=w(y,g);se.value!==x&&(se.value=x)},Re=e.ref(null),bt=e.ref(0),_t=e.ref([]),St=y=>{if(ie.value==="single")return Re.value===y.field?bt.value:0;{const g=_t.value.find(x=>x.field===y.field);return g?g.order:0}},Lt=y=>{const g=St(y);return{"dss-sort-active":g!==0,"dss-sort-asc":g===1,"dss-sort-desc":g===-1}},zt=e.ref({}),Bt=e.ref(null),Kt=e.ref(null),ql=220,jl=e.ref(null),El=e.computed(()=>j.value.find(y=>pe(y)===Bt.value)??null),il=e.computed(()=>{if(!El.value||El.value.filter!=="range")return null;const y=El.value,g=Bt.value,{min:x,max:q}=pn(y),ue=y.filterMin??x,at=y.filterMax??q,Xt=Dl(g),Cl=Xt.min??ue,Pl=Xt.max??at,Ul=at-ue,hn=Ul===0?0:(Cl-ue)/Ul*100,uo=Ul===0?100:(Pl-ue)/Ul*100;return{rangeMin:ue,rangeMax:at,currentMin:Cl,currentMax:Pl,minPct:hn,maxPct:uo}}),vl=e.ref(null),dn=e.ref("max");function wn(y){const g=vl.value,x=il.value;if(!g||!x)return;const q=g.getBoundingClientRect(),at=(y.clientX-q.left)/q.width*100,Xt=(x.minPct+x.maxPct)/2;dn.value=at<Xt?"min":"max"}function Dl(y){return zt.value[y]??{}}function mn(y,g){zt.value={...zt.value,[y]:g}}function $l(y){const g=zt.value[y];return g?g.type==="string"?!!g.value?.trim():g.type==="range"?g.min!=null||g.max!=null:g.type==="dateRange"?!!(g.from||g.to):g.type==="list"?g.selected?.length>0:!1:!1}function zn(y){const g={...zt.value};delete g[y],zt.value=g,Bt.value=null,Kt.value=null}function Dn(){if(!Bt.value){Kt.value=null;return}const y=jl.value;if(!y)return;const g=y.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Bt.value}"]`);if(!g)return;const x=g.getBoundingClientRect();Kt.value={top:x.bottom+6,left:Math.max(8,x.right-ql)}}const on=e.computed(()=>{const y=String(U.value??"").trim().toLowerCase();return y?de.data.filter(g=>j.value.some(x=>Fl(sn(g,x)).some(ue=>String(ue).toLowerCase().includes(y)))):de.data}),bl=e.computed(()=>{let y=[...on.value];const g=(U.value??"").trim().toLowerCase();return g&&(y=y.filter(x=>de.columns.some(q=>{if(!q||!q.field)return!1;const ue=sn(x,q);return String(ue??"").toLowerCase().includes(g)}))),j.value.forEach(x=>{const q=pe(x),ue=zt.value[q];if(!ue)return;const at=x.field;if(at){if(ue.type==="string"&&ue.value?.trim()){const Xt=ue.value.trim().toLowerCase();y=y.filter(Cl=>{const Pl=sn(Cl,x);return String(Pl??"").toLowerCase().includes(Xt)})}else if(ue.type==="range")y=y.filter(Xt=>{const Cl=Tl(Xt,at),Pl=Number(Cl);return!(Number.isNaN(Pl)||ue.min!=null&&Pl<ue.min||ue.max!=null&&Pl>ue.max)});else if(ue.type==="dateRange"){const Xt=ue.from?new Date(ue.from).getTime():null,Cl=ue.to?new Date(ue.to).getTime():null;y=y.filter(Pl=>{const Ul=Tl(Pl,at),hn=Ul?new Date(Ul).getTime():NaN;return!(Number.isNaN(hn)||Xt!=null&&hn<Xt||Cl!=null&&hn>Cl)})}else if(ue.type==="list"&&ue.selected?.length){const Xt=new Set(ue.selected);y=y.filter(Cl=>Fl(sn(Cl,x)).some(Ul=>Xt.has(Ul)))}}}),y});function Fl(y){if(y==null)return[""];if(Array.isArray(y))return y.flatMap(Fl);if(typeof y=="object"){const g=y?.label??y?.name??y?.value??y?.title;return[g!=null?String(g):String(y)]}return[String(y)]}function Kl(y){const g=new Set;return de.data.forEach(x=>{Fl(sn(x,y)).forEach(ue=>g.add(ue))}),Array.from(g).sort((x,q)=>String(x).localeCompare(String(q)))}function Hl(y,g){if(Bt.value===y){Bt.value=null,Kt.value=null;return}if(Bt.value=y,g?.currentTarget){const x=g.currentTarget.getBoundingClientRect();Kt.value={top:x.bottom+6,left:Math.max(8,x.right-ql)}}else Dn()}function Ml(y,g){mn(y,{type:"string",value:g})}function pn(y){const g=y.field;if(!g)return{min:0,max:100};let x=1/0,q=-1/0;return de.data.forEach(ue=>{const at=Tl(ue,g),Xt=Number(at);Number.isNaN(Xt)||(x=Math.min(x,Xt),q=Math.max(q,Xt))}),{min:x===1/0?0:x,max:q===-1/0?100:q}}function $(y,g,x){const q={...Dl(y),type:"range"},ue=x===""?null:Number(x),at=ue===null||Number.isNaN(ue)?null:ue;q[g]=at,at!=null&&(g==="min"&&q.max!=null&&at>q.max&&(q.max=at),g==="max"&&q.min!=null&&at<q.min&&(q.min=at)),mn(y,q)}function O(y,g,x){const q={...Dl(y),type:"dateRange"};q[g]=x||"",mn(y,q)}const D=e.reactive({});function ne(y,g){D[y]=g}function Ae(y){const g=pe(y),x=(D[g]??"").trim().toLowerCase(),q=Kl(y);return x?q.filter(ue=>String(ue).toLowerCase().includes(x)):q}function it(y,g){return(Dl(y).selected??[]).includes(g!=null?String(g):"")}function vt(y,g){const q=[...Dl(y).selected??[]],ue=g!=null?String(g):"",at=q.indexOf(ue);at>=0?q.splice(at,1):q.push(ue),mn(y,{type:"list",selected:q})}function tt(y){Bt.value&&!y.target.closest(".dss-table-filter-wrap")&&!y.target.closest(".dss-table-filter-dropdown")&&(Bt.value=null,Kt.value=null)}function lt(){Dn(),el.value&&Zl()}const kl=y=>{if(!(y.sortable===!1||!Ye.value))if(ie.value==="single")Re.value===y.field?bt.value=bt.value===1?-1:bt.value===-1?0:1:(Re.value=y.field,bt.value=1),bt.value===0&&(Re.value=null),P("sort",{field:Re.value,order:bt.value});else{const g=_t.value.findIndex(x=>x.field===y.field);g>=0?_t.value[g].order===1?_t.value[g].order=-1:_t.value.splice(g,1):_t.value.push({field:y.field,order:1}),P("sort",{multiSortMeta:_t.value})}},Sl=e.computed(()=>{if(!Ye.value)return bl.value;let y=[...bl.value];return ie.value==="single"&&Re.value&&bt.value!==0?y.sort((g,x)=>{const q=Tl(g,Re.value),ue=Tl(x,Re.value);return q===ue?0:q==null?1:ue==null?-1:(q<ue?-1:q>ue?1:0)*bt.value}):ie.value==="multiple"&&_t.value.length>0&&y.sort((g,x)=>{for(const q of _t.value){const ue=Tl(g,q.field),at=Tl(x,q.field);if(ue===at)continue;if(ue==null)return 1;if(at==null)return-1;const Xt=ue<at?-1:ue>at?1:0;if(Xt!==0)return Xt*q.order}return 0}),y}),Tt=e.ref(0),wl=e.ref(be.value),el=e.ref(!1),Vl=e.ref(null),an=e.ref(null),al=e.ref("bottom"),At=e.ref(null),Pn=y=>{wl.value=y,el.value=!1,Tt.value=0,P("page",{page:0,rows:wl.value})};function xn(y){Vl.value&&!Vl.value.contains(y.target)&&(el.value=!1)}function Zl(){const y=Vl.value,g=an.value;if(!y||!g)return;const x=y.querySelector(".dss-pagination-select-dropdown");if(!x)return;const q=g.getBoundingClientRect(),ue=x.offsetHeight||0,Xt=(window.innerHeight||document.documentElement.clientHeight)-q.bottom,Cl=q.top;al.value=Xt<ue+8&&Cl>Xt?"top":"bottom",At.value={width:`${Math.ceil(q.width)}px`,left:`${Math.max(0,Math.round(g.offsetLeft))}px`}}const vn=e.computed(()=>Sl.value.length),fn=e.computed(()=>Math.ceil(vn.value/wl.value)),Hn=e.computed(()=>Math.max(fn.value,1)),En=e.computed(()=>vn.value===0?0:ul.value+1),en=e.computed(()=>On.value),ul=e.computed(()=>Ge.value?Tt.value*wl.value:0),On=e.computed(()=>Ge.value?Math.min((Tt.value+1)*wl.value,vn.value):vn.value),Il=e.computed(()=>{if(!Ge.value)return Sl.value;const y=ul.value,g=On.value;return Sl.value.slice(y,g)}),ll=e.ref(new Set),Wn=e.computed(()=>Sl.value.filter((y,g)=>ll.value.has(w(y,g)))),dl=(y,g)=>{const x=Le.value;return typeof x!="function"?!0:!!x(y,g)},wt=e.computed(()=>Sl.value.map((y,g)=>({row:y,index:g})).filter(({row:y,index:g})=>dl(y,g))),$e=e.computed(()=>{const y=wt.value;return y.length===0?!1:y.every(({row:g,index:x})=>ll.value.has(w(g,x)))}),Sn=e.computed(()=>{const y=wt.value;if(y.length===0)return!1;const g=y.filter(({row:x,index:q})=>ll.value.has(w(x,q))).length;return g>0&&g<y.length}),dt=(y,g)=>ll.value.has(w(y,g)),sl=()=>{if($e.value)ll.value=new Set,P("unselect-all");else{const y=new Set;wt.value.forEach(({row:g,index:x})=>y.add(w(g,x))),ll.value=y,P("select-all",Wn.value)}},ot=(y,g)=>{if(!dl(y,g))return;const x=w(y,g),q=new Set(ll.value),ue=q.has(x);Se.value==="single"?ue?(q.delete(x),P("row-unselect",y)):(q.clear(),q.add(x),P("row-select",y)):ue?(q.delete(x),P("row-unselect",y)):(q.add(x),P("row-select",y)),ll.value=q},mt=e.ref("1"),ce=()=>{const y=Number.parseInt(String(mt.value),10);if(!Number.isFinite(y)){mt.value=String(Tt.value+1);return}const g=Math.min(Hn.value,Math.max(1,y));g!==Tt.value+1?tl(g-1):mt.value=String(g)},tl=y=>{y<0||y>=fn.value||(Tt.value=y,P("page",{page:y,rows:wl.value}))},Oe=(y,g,x)=>{P("row-click",{data:y,index:g,originalEvent:x}),nt(y,ul.value+g)},Ll=(y,g)=>{const x=ul.value+g;return{"dss-table-row-selected":dt(y,x),"dss-table-row-even":g%2===0,"dss-table-row-odd":g%2!==0,"dss-table-row-truncated-clickable":me.value,"dss-table-row-truncated-expanded":se.value===w(y,x)}},sn=(y,g)=>g.field?Tl(y,g.field):"",Tl=(y,g)=>g.split(".").reduce((x,q)=>x&&x[q],y),nl=y=>{const g=y.align??Fe.value;return{"dss-table-sortable":y.sortable!==!1&&Ye.value,"dss-table-align-left":g==="left","dss-table-align-center":g==="center","dss-table-align-right":g==="right",[y.className]:y.className}},zl=y=>{const g={};return y.width&&(g.width=typeof y.width=="number"?`${y.width}px`:y.width),y.minWidth&&(g.minWidth=typeof y.minWidth=="number"?`${y.minWidth}px`:y.minWidth),y.maxWidth&&(g.maxWidth=typeof y.maxWidth=="number"?`${y.maxWidth}px`:y.maxWidth),g};return e.watch(()=>de.locale,y=>{y&&y!==B.value&&(B.value=y)},{immediate:!0}),e.watch(be,y=>{wl.value=y,Tt.value=0}),e.watch(el,async y=>{y&&(await e.nextTick(),Zl())}),e.watch(Tt,y=>{mt.value=String(y+1)},{immediate:!0}),e.watch(U,y=>{P("search",y??"")}),e.watch(()=>de.columns,()=>{if(oe.value===null){$t();return}const y=Ht(de.columnVisibility)??[];y.length!==de.columnVisibility.length&&P("update:columnVisibility",y)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",xn),document.addEventListener("click",pl),document.addEventListener("click",tt),window.addEventListener("resize",lt),window.addEventListener("scroll",lt,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",xn),document.removeEventListener("click",pl),document.removeEventListener("click",tt),window.removeEventListener("resize",lt),window.removeEventListener("scroll",lt,!0)}),(y,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:jl,style:e.normalizeStyle({width:f.value+"px",height:we.value?we.value+"px":"auto"})},[yt.value?(e.openBlock(),e.createElementBlock("div",Qc,[e.createElementVNode("div",Jc,[Yt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:g[0]||(g[0]=x=>P("download-pdf"))},[g[22]||(g[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),rt.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:g[1]||(g[1]=x=>P("download-excel"))},[g[23]||(g[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),ol.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:jt},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":et.value}]),onClick:g[2]||(g[2]=x=>et.value=!et.value),"aria-expanded":et.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(_)("table.columnVisibility"))+" ",1),g[24]||(g[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,eu),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",tu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.columns,(x,q)=>(e.openBlock(),e.createElementBlock("li",{key:Ke(x,q),role:"option",class:"dss-table-column-visibility-option",onClick:g[3]||(g[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",lu,[e.createElementVNode("span",nu,[e.createElementVNode("input",{type:"checkbox",checked:xe(x,q),onChange:ue=>Rt(x,q),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,ou),xe(x,q)?(e.openBlock(),e.createElementBlock("span",au,[...g[25]||(g[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",su,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,et.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(y.$slots,"header")]),e.createElementVNode("div",ru,[Jt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":ke.value||U.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:W,"onUpdate:modelValue":g[4]||(g[4]=x=>U.value=x),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(_)("table.searchPlaceholder"),"aria-label":e.unref(_)("table.searchTableAriaLabel"),onFocus:g[5]||(g[5]=x=>ke.value=!0),onBlur:Ie},null,40,iu),[[e.vModelText,U.value]]),U.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(_)("table.clearSearchAriaLabel"),onClick:Ue},[...g[26]||(g[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,cu)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(_)("table.searchAriaLabel"),"aria-expanded":ke.value||!!U.value,onMousedown:e.withModifiers(Ne,["prevent"])},[...g[27]||(g[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,uu)],2)):e.createCommentVNode("",!0),y.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",du,[e.renderSlot(y.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":kt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Et.value])},[e.createElementVNode("thead",mu,[e.createElementVNode("tr",null,[We.value?(e.openBlock(),e.createElementBlock("th",pu,[Se.value==="multiple"?(e.openBlock(),e.createElementBlock("span",vu,[e.createElementVNode("input",{type:"checkbox",checked:$e.value,indeterminate:Sn.value,onChange:sl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,fu),Sn.value?(e.openBlock(),e.createElementBlock("span",hu)):$e.value?(e.openBlock(),e.createElementBlock("span",gu,[...g[28]||(g[28]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(_)("table.expandRowAriaLabel")},null,8,yu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(x,q)=>(e.openBlock(),e.createElementBlock("th",{key:pe(x),class:e.normalizeClass(["dss-table-th",nl(x)]),style:e.normalizeStyle(zl(x)),onClick:ue=>kl(x)},[e.createElementVNode("div",Cu,[e.createElementVNode("span",bu,e.toDisplayString(x.header),1),x.sortable!==!1&&Ye.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Lt(x)])},[St(x)===0?(e.openBlock(),e.createElementBlock("span",wu,[...g[29]||(g[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)])])):St(x)===1?(e.openBlock(),e.createElementBlock("span",xu,[...g[30]||(g[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)])])):St(x)===-1?(e.openBlock(),e.createElementBlock("span",Eu,[...g[31]||(g[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===pe(x)}]),onClick:g[6]||(g[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":$l(pe(x))}]),"data-filter-column-key":pe(x),"aria-expanded":Bt.value===pe(x),"aria-label":e.unref(_)("table.filterColumnAriaLabel"),onClick:ue=>Hl(pe(x),ue)},[...g[32]||(g[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,Su)],2)):e.createCommentVNode("",!0)])],14,ku))),128))])]),e.createElementVNode("tbody",Vu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Il.value,(x,q)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:w(x,ul.value+q)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Ll(x,q)]),style:e.normalizeStyle(J.value),onClick:ue=>Oe(x,q,ue)},[We.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:g[7]||(g[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",Bu,[e.createElementVNode("input",{type:Se.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${E.tableId}`,checked:dt(x,ul.value+q),disabled:!dl(x,ul.value+q),onChange:ue=>ot(x,ul.value+q),class:e.normalizeClass(["dss-table-checkbox",Se.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!dl(x,ul.value+q)}])},null,42,Mu),Se.value==="multiple"&&dt(x,ul.value+q)?(e.openBlock(),e.createElementBlock("span",_u,[...g[33]||(g[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)])])):Se.value==="single"&&dt(x,ul.value+q)?(e.openBlock(),e.createElementBlock("span",$u)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(ue=>Ct(x,ul.value+q,ue),["stop"])},[He(x,ul.value+q)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":ae(x,ul.value+q),"aria-label":ae(x,ul.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":ae(x,ul.value+q)}]),"aria-hidden":"true"},[...g[34]||(g[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,Tu)):(e.openBlock(),e.createElementBlock("span",Au))],8,Lu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(ue,at)=>(e.openBlock(),e.createElementBlock("td",{key:pe(ue),class:e.normalizeClass(["dss-table-td",nl(ue)]),style:e.normalizeStyle(zl(ue))},[e.renderSlot(y.$slots,`cell-${ue.field}`,{data:x,column:ue,rowIndex:q,isExpanded:se.value===w(x,ul.value+q)},()=>[e.createTextVNode(e.toDisplayString(sn(x,ue)),1)])],6))),128))],14,Nu),X.value&&He(x,ul.value+q)&&ae(x,ul.value+q)?(e.openBlock(),e.createElementBlock("tr",Du,[e.createElementVNode("td",{colspan:M.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(y.$slots,"expansion",{data:x,rowIndex:q})],8,Hu)])):e.createCommentVNode("",!0)],64))),128)),Il.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(J.value)},[e.createElementVNode("td",{colspan:M.value,class:"dss-table-empty-cell"},[e.renderSlot(y.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(xt.value),1)])],8,Ru)],4))])],2)],2),Zt.value?(e.openBlock(),e.createElementBlock("div",Fu,[e.createElementVNode("div",Iu,[ct.value?(e.openBlock(),e.createElementBlock("span",zu,e.toDisplayString(e.unref(_)("table.showingRange",{start:En.value,end:en.value,total:vn.value})),1)):(e.openBlock(),e.createElementBlock("span",Pu," "))]),e.createElementVNode("div",Ou,[ut.value?(e.openBlock(),e.createElementBlock("div",Wu,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Tt.value===0,onClick:g[8]||(g[8]=x=>tl(0)),title:e.unref(_)("table.firstPage")},[...g[35]||(g[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,qu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Tt.value===0,onClick:g[9]||(g[9]=x=>tl(Tt.value-1)),title:e.unref(_)("table.previousPage")}," ‹ ",8,Zu),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":g[10]||(g[10]=x=>mt.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(_)("table.currentPageAriaLabel"),onBlur:ce,onKeydown:e.withKeys(e.withModifiers(ce,["prevent"]),["enter"])},null,40,Uu),[[e.vModelText,mt.value]]),e.createElementVNode("span",Xu,e.toDisplayString(e.unref(_)("table.ofPages",{total:Hn.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Tt.value>=fn.value-1,onClick:g[11]||(g[11]=x=>tl(Tt.value+1)),title:e.unref(_)("table.nextPage")}," › ",8,Yu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Tt.value>=fn.value-1,onClick:g[12]||(g[12]=x=>tl(fn.value-1)),title:e.unref(_)("table.lastPage")},[...g[36]||(g[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,ju)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ku,[qt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Vl},[e.createElementVNode("span",Gu,e.toDisplayString(e.unref(_)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":el.value}]),onClick:g[13]||(g[13]=x=>el.value=!el.value),"aria-expanded":el.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:an},[e.createTextVNode(e.toDisplayString(wl.value)+" ",1),g[37]||(g[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Qu),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":al.value==="top"}]),style:e.normalizeStyle(At.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===wl.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===wl.value}]),onClick:q=>Pn(x)},e.toDisplayString(x),11,Ju))),128))],6),[[e.vShow,el.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(Kt.value?{top:Kt.value.top+"px",left:Kt.value.left+"px",width:ql+"px"}:void 0),onClick:g[21]||(g[21]=e.withModifiers(()=>{},["stop"]))},[El.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[El.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",ed,[e.createElementVNode("input",{type:"text",value:Dl(Bt.value).value??"",onInput:g[14]||(g[14]=x=>Ml(Bt.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(_)("table.search")},null,40,td)])):El.value.filter==="range"&&il.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":il.value.minPct+"%","--range-max-pct":il.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:vl,class:"dss-table-filter-double-range-track",onMousemove:wn,onMouseenter:wn},[e.createElementVNode("input",{type:"range",min:il.value.rangeMin,max:il.value.rangeMax,value:il.value.currentMin,onInput:g[15]||(g[15]=x=>$(Bt.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:dn.value==="min"?2:1})},null,44,ld),e.createElementVNode("input",{type:"range",min:il.value.rangeMin,max:il.value.rangeMax,value:il.value.currentMax,onInput:g[16]||(g[16]=x=>$(Bt.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:dn.value==="max"?2:1})},null,44,nd)],544),e.createElementVNode("div",od,e.toDisplayString(il.value.currentMin)+" – "+e.toDisplayString(il.value.currentMax),1)],4)):El.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",ad,[e.createElementVNode("div",sd,[e.createElementVNode("label",rd,e.toDisplayString(e.unref(_)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:Dl(Bt.value).from??"",onInput:g[17]||(g[17]=x=>O(Bt.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,id)]),e.createElementVNode("div",cd,[e.createElementVNode("label",ud,e.toDisplayString(e.unref(_)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:Dl(Bt.value).to??"",onInput:g[18]||(g[18]=x=>O(Bt.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,dd)])])):El.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:D[Bt.value]??"",onInput:g[19]||(g[19]=x=>ne(Bt.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(_)("table.search")},null,40,md),e.createElementVNode("div",pd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae(El.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:it(Bt.value,x),onChange:q=>vt(Bt.value,x)},null,40,vd),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",fd,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:g[20]||(g[20]=x=>zn(Bt.value))},e.toDisplayString(e.unref(_)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Bt.value&&El.value&&Kt.value]])]),_:1})]))],64))}}),yd="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",kd="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",Cd="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",bd="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",wd="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",xd="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",Ed={class:"dss-toolbar-left"},Sd=["title"],Vd=["title"],Nd={class:"dss-toolbar-dropdown-wrapper"},Bd=["title"],Md=["src"],_d=["src"],$d=["src"],Ld=["src"],Td=["src"],Ad=["src"],Dd={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Hd=["src"],Rd=["src"],Fd=["src"],Id=["src"],zd=["src"],Pd=["src"],Od=["title"],Wd=["title"],qd=["title"],Zd=["title"],Ud=["title"],Xd=["title"],Yd=["title"],jd=["title"],Kd=["title"],Gd={key:2,class:"dss-toolbar-separator"},Qd=["title"],Jd={key:4,class:"dss-toolbar-separator"},e1={key:5,class:"dss-toolbar-dropdown-wrapper"},t1=["title"],l1={class:"dss-toolbar-dropdown-ai"},n1={class:"dss-toolbar-right"},o1={key:0,class:"dss-toolbar-custom-group"},a1={key:1,class:"dss-toolbar-separator"},s1={class:"dss-link-modal-content"},r1={class:"dss-link-modal-field"},i1={class:"dss-link-modal-label"},c1=["placeholder"],u1={class:"dss-link-modal-field"},d1={class:"dss-link-modal-label"},m1=["placeholder"],p1={class:"dss-image-modal-tabs"},v1={key:0,class:"dss-image-tab-content"},f1={class:"dss-link-modal-content"},h1={class:"dss-link-modal-field"},g1={key:0,class:"dss-link-modal-label"},y1=["src"],k1={class:"dss-link-modal-field"},C1={class:"dss-link-modal-label"},b1=["placeholder"],w1={class:"dss-link-modal-field"},x1={class:"dss-link-modal-label"},E1=["placeholder"],S1={class:"dss-link-modal-field"},V1={class:"dss-link-modal-label"},N1=["placeholder"],B1={key:1,class:"dss-image-tab-content"},M1={class:"dss-link-modal-content"},_1={class:"dss-link-modal-field"},$1={class:"dss-link-modal-label"},L1=["placeholder"],T1={class:"dss-link-modal-field"},A1={class:"dss-link-modal-label"},D1=["placeholder"],H1={class:"dss-link-modal-field"},R1={class:"dss-link-modal-label"},F1=["placeholder"],I1={class:"dss-link-modal-field"},z1={class:"dss-link-modal-label"},P1=["placeholder"],O1={class:"dss-text-editor-title-input-container"},W1={key:0,class:"dss-text-editor-title-preview"},q1={key:0},Z1={key:1,class:"dss-text-editor-preview-placeholder"},U1=["value","placeholder","disabled"],X1={key:3,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},Y1={class:"dss-text-editor-description-input-container"},j1={key:0,class:"dss-text-editor-description-preview"},K1={key:0},G1={key:1,class:"dss-text-editor-preview-placeholder"},Q1=["value","placeholder","disabled"],J1={key:5,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},em=["data-comment-id","onMouseenter"],tm=["onClick"],lm=["src","alt"],nm={key:1},om=["onClick"],am=["src","alt"],sm={key:1},rm=["data-has-second-user","onClick"],im={class:"editor-comment-marker-count"},cm={key:7,class:"dss-text-editor-textarea-wrapper"},um=["value","placeholder","rows","disabled"],dm={class:"dss-text-editor-footer"},mm={class:"dss-text-editor-footer-content"},pm={class:"dss-text-editor-footer-stat"},vm={class:"dss-text-editor-footer-stat"},fm={key:8,class:"dss-text-editor-content-wrapper"},hm={key:0,class:"dss-comment-overlay-body"},gm={class:"dss-comment-selection-wrapper"},ym=["innerHTML"],km={class:"dss-comment-messages-wrapper"},Cm={key:0,class:"dss-comment-avatar-wrapper"},bm={class:"dss-comment-avatar"},wm=["src","alt"],xm={key:1},Em={class:"dss-comment-header"},Sm={class:"dss-comment-header-text"},Vm={class:"dss-comment-author"},Nm={key:0,class:"dss-comment-date"},Bm=["onClick","title"],Mm={class:"dss-comment-overlay-inner"},_m=["placeholder","onKeydown"],$m={class:"dss-text-editor-footer"},Lm={class:"dss-text-editor-footer-content"},Tm={class:"dss-text-editor-footer-stat"},Am={class:"dss-text-editor-footer-stat"},Dm=["title"],Hm=["title"],Rm={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},Fm={class:"dss-image-popup-content"},Im={key:0,class:"dss-image-popup-no-alt-icon"},zm=["title"],Pm=["title"],Om={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:""},Wm={class:"dss-toolbar-left"},qm=["title"],Zm=["title"],Um={class:"dss-toolbar-dropdown-wrapper"},Xm=["title"],Ym=["src"],jm=["src"],Km=["src"],Gm=["src"],Qm=["src"],Jm=["src"],e2={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},t2=["title"],l2=["title"],n2=["title"],o2=["title"],a2=["title"],s2=["title"],r2=["title"],i2=["title"],c2=["title"],u2={key:2,class:"dss-toolbar-separator"},d2=["title"],m2={key:4,class:"dss-toolbar-separator"},p2={key:5,class:"dss-toolbar-dropdown-wrapper"},v2=["title"],f2={class:"dss-toolbar-dropdown-ai"},h2={key:0,class:"dss-toolbar-right"},g2={key:0,class:"dss-toolbar-separator"},y2={key:0,class:"dss-toolbar-custom-group"},k2={key:1,class:"dss-toolbar-separator"},C2={name:"DSSTextEditor"},b2=Object.assign(C2,{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:E=>typeof E=="object"&&E!==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:E=>typeof E=="object"&&E!==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(E,{expose:le,emit:_}){const{t:B,locale:de}=so.useI18n(),P={h1:yd,h2:kd,h3:Cd,h4:bd,h5:wd,h6:xd},T=E,he=_,st=e.useSlots(),te=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
96
|
+
`,jt.value){t+=`Category,Segment,Value
|
|
97
|
+
`,Qn.value.forEach(q=>{q.segments.forEach(_=>{const I=String(q.label||"").replace(/"/g,'""'),M=String(_.label||"").replace(/"/g,'""');t+=`"${I}","${M}",${_.value}
|
|
98
|
+
`})});const v=new Blob([t],{type:"text/csv;charset=utf-8;"}),C=URL.createObjectURL(v),b=document.createElement("a");b.href=C,b.download=Zl("csv"),document.body.appendChild(b),b.click(),document.body.removeChild(b),URL.revokeObjectURL(C),fn();return}t+="Category",V.series.forEach(v=>{const C=v.name.replace(/"/g,'""');t+=',"'+C+'"'}),t+=`
|
|
99
|
+
`;const o=Math.max(...V.series.map(v=>v.data?.length||0));for(let v=0;v<o;v++){let q='"'+(V.categories[v]||L("chart.fallback.item",{number:v+1})).toString().replace(/"/g,'""')+'"';V.series.forEach(_=>{const I=_.data&&_.data[v]!==void 0?_.data[v]:"";q+=","+I}),t+=q+`
|
|
100
|
+
`}const l=new Blob([t],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(l),m=document.createElement("a");m.href=r,m.download=Zl("csv"),document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(r),fn()}catch(t){console.error("Error downloading CSV:",t)}},Sn=t=>{if(typeof t.action=="function"){const o={series:V.series,categories:V.categories,markers:tt.value},l={chartX:Y.value.chartX,chartY:Y.value.chartY,dataX:Y.value.mouseDataX,dataY:Y.value.mouseDataY,categoryIndex:clampedCategoryIndex||Y.value.categoryIndex};t.action(o,l)}fn()},In=()=>{en(),Se.value.show=!0,Se.value.categoryIndex=Y.value.categoryIndex,Se.value.fromButton=!1,fn()},Vn=()=>{en(),Se.value.show=!0,Se.value.categoryIndex=0,Se.value.fromButton=!0},Nn=t=>{if(Y.value.show){const o=document.querySelector(".dss-context-menu");o&&!o.contains(t.target)&&(Y.value.show=!1)}},fo=t=>{Y.value.show&&!t.target.closest(".context-menu")&&(Y.value.show=!1)},Mo=t=>{if(!kl.value||!Vt.value||jt.value)return;t.preventDefault(),t.stopPropagation(),U.value.isZooming=!0,$.value.show=!1,U.value.zoomTimeout&&clearTimeout(U.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top;if(r<z.value.left-50||r>z.value.right+50||m<z.value.top-50||m>z.value.bottom+100){U.value.isZooming=!1;return}const v=t.deltaY>0?.9:1.1,C=Math.max(U.value.minScale,Math.min(U.value.maxScale,U.value.scale*v));if(C!==U.value.scale){const{minX:b,maxX:q}=Wt.value,_=q-b||1,I=_/U.value.scale,M=b-U.value.offsetX/z.value.width*_,G=(r-z.value.left)/z.value.width,Be=M+G*I;U.value.scale=C;const Oe=_/U.value.scale,ve=Be-G*Oe;U.value.offsetX=-(ve-b)/_*z.value.width,U.value.scale<=1.01&&(U.value.scale=1,U.value.offsetX=0)}U.value.zoomTimeout=setTimeout(()=>{U.value.isZooming=!1,U.value.zoomTimeout=null},300)},jn=t=>{if(!kl.value||!Vt.value||U.value.scale<=1)return;$.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,U.value.isDragging=!0,U.value.lastMouseX=t.clientX,U.value.lastMouseY=t.clientY,t.preventDefault()},_o=()=>{U.value.isDragging=!1},Bn=()=>{!kl.value||!Vt.value||(U.value.scale=1,U.value.offsetX=0,U.value.isDragging=!1,U.value.zoomTimeout&&(clearTimeout(U.value.zoomTimeout),U.value.zoomTimeout=null),U.value.isZooming=!1)},$o=()=>!kl.value||!y.value||!Vt.value?"default":U.value.isDragging?"grabbing":U.value.scale>1?"grab":"dss-crosshair",ho=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 o=`M ${t[0].x} ${t[0].y}`;for(let l=0;l<t.length-1;l++){const r=t[Math.max(l-1,0)],m=t[l],v=t[l+1],C=t[Math.min(l+2,t.length-1)],b=m.x+(v.x-r.x)/6*Nt.value,q=m.y+(v.y-r.y)/6*Nt.value,_=v.x-(C.x-m.x)/6*Nt.value,I=v.y-(C.y-m.y)/6*Nt.value;o+=` C ${b} ${q} ${_} ${I} ${v.x} ${v.y}`}return o},$l=e.computed(()=>{const o=Z.value?.chart?.padding,l=typeof o=="number"?o:null,r=o&&typeof o=="object"?o:null,m=50;let v=m+(It.value?30:0)+60;if(gl.value){const M={left:m+40,top:m+40,right:m+40,bottom:m+40};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??M.left,top:r.top??M.top,right:r.right??M.right,bottom:r.bottom??M.bottom}:M}if(Cl.value){const M=!A.value,G=Dn.value,Be=G?Xt.value+Zn.value+Math.max(24,Fl.value+16):0,Oe=M?12:m;let ve=0;dt.value&&(ve+=M?8:15),Ye.value&&(ve+=M?6:10);const xe=rt();let Ee=Oe+(M?4:16)+(G?Be:0),de=Oe+(G?Be:0);A.value&&X.value==="left"?Ee+=xe.legendWidth||150:A.value&&X.value==="right"&&(de+=xe.legendWidth||150);const Ie=ge.value==="semi-radial"?G?Be:8:G?Be:M?8:m+80,Le=G?14:0,Me=Oe+ve+Le,Re={left:Ee,top:Me,right:de,bottom:Ie};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??Re.left,top:r.top??Re.top,right:r.right??Re.right,bottom:r.bottom??Re.bottom}:Re}let C=0;dt.value&&(C+=15),Ye.value&&(C+=10);const b=rt();let q=m+16+(bt.value?30:0),_=m+(Yt.value?30:0);A.value&&X.value==="left"?q+=b.legendWidth||150:A.value&&X.value==="right"&&(_+=b.legendWidth||150),Ut.value&&(_+=44),jt.value&&(v+=Gt.value);const I={left:q,top:m+C,right:_,bottom:v};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??I.left,top:r.top??I.top,right:r.right??I.right,bottom:r.bottom??I.bottom}:I}),z=e.computed(()=>({left:$l.value.left,top:$l.value.top,right:ye.value-$l.value.right,bottom:Te.value-$l.value.bottom,width:ye.value-($l.value.left+$l.value.right),height:Te.value-($l.value.top+$l.value.bottom)})),kl=e.computed(()=>["line","area","bar","stepbar"].includes(ge.value)||Ft.value),Pl=e.computed(()=>Ft.value),Kn=e.computed(()=>ge.value==="mini-radial"),Cl=e.computed(()=>["radial","semi-radial","mini-radial"].includes(ge.value)),gl=e.computed(()=>ge.value==="spider"),el=e.computed(()=>ge.value==="bubble"),jt=e.computed(()=>ge.value==="stepbar"),al=e.computed(()=>Z.value?.chart?.orientation==="horizontal"&&(ge.value==="bar"||Pl.value)),cn=t=>{const{minY:o,maxY:l}=Wt.value,r=l-o||1;return z.value.left+(t-o)/r*z.value.width},Mn=t=>{const{maxX:o}=Wt.value,l=o+1,m=z.value.height/l;return z.value.top+(t+.5)*m},Lt=e.computed(()=>Cl.value?$l.value.left+(ye.value-$l.value.left-$l.value.right)/2:ye.value/2),Ct=e.computed(()=>gl.value?Te.value/2-40:Cl.value?$l.value.top+(Te.value-$l.value.top-$l.value.bottom)/2:Te.value/2),vt=e.computed(()=>{if(gl.value){const t=z.value.width-80,o=z.value.height-80;return Math.min(t,o)/2}return Math.min(z.value.width,z.value.height)/2}),sl=e.computed(()=>{const t=Z.value,o=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof o=="number"&&o>=0&&o<=1?o:.45;return vt.value*l}),ta=e.computed(()=>{const t=Z.value,o=typeof V.innerSize=="number"?V.innerSize:t?.innerSize;return typeof o!="number"||o<=-100||!(Cl.value||gl.value)?1:1+o/100}),Lo=e.computed(()=>{const t=ta.value;if(t===1||t<=0)return;const o=Lt.value,l=Ct.value;return`translate(${o}, ${l}) scale(${t}) translate(${-o}, ${-l})`}),Gn=e.ref(0),zn=e.computed(()=>`semi-radial-fill-clip-${V.chartId}`),xl=e.computed(()=>ge.value==="semi-radial"),go=e.computed(()=>xl.value&&El.value&&!$n.value),tn=e.computed(()=>xl.value&&El.value&&!$n.value&&on.value==="fill"),yo=e.computed(()=>{const t=go.value?Gn.value:1,o=Lt.value,l=Ct.value,r=sl.value,m=vt.value,v=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;const b=o+m*Math.cos(v),q=l+m*Math.sin(v),_=o+m*Math.cos(C),I=l+m*Math.sin(C),M=o+r*Math.cos(C),G=l+r*Math.sin(C),Be=o+r*Math.cos(v),Oe=l+r*Math.sin(v),ve=t>.5?1:0;return`M ${o} ${l} L ${b} ${q} A ${m} ${m} 0 ${ve} 1 ${_} ${I} L ${M} ${G} A ${r} ${r} 0 ${ve} 1 ${Be} ${Oe} Z`}),To=e.computed(()=>{if(!(!xl.value||!go.value)&&!tn.value)return`url(#${zn.value})`}),Ao=t=>{if(!(!tn.value||t!==0))return`url(#${zn.value})`},yn=e.ref(0),a=e.computed(()=>`radial-reveal-clip-${V.chartId}`),n=e.computed(()=>ge.value==="radial"),s=e.computed(()=>{const t=n.value?yn.value:1,o=Lt.value,l=Ct.value,r=Math.max(vt.value*1.5,ye.value,Te.value);if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;if(t>=1){const M=o-r,G=o+r;return`M ${M} ${l} A ${r} ${r} 0 0 1 ${G} ${l} A ${r} ${r} 0 0 1 ${M} ${l} Z`}const m=-Math.PI/2,v=m+t*Math.PI*2,C=o+r*Math.cos(m),b=l+r*Math.sin(m),q=o+r*Math.cos(v),_=l+r*Math.sin(v),I=t>=.5?1:0;return`M ${o} ${l} L ${C} ${b} A ${r} ${r} 0 ${I} 1 ${q} ${_} Z`}),i=e.computed(()=>{if(To.value)return To.value;if(n.value)return`url(#${a.value})`});let c=null;const d=()=>{if(!go.value)return;Gn.value=0;const t=Dl.value,o=performance.now(),l=r=>{const m=r-o,v=Math.min(1,m/t);Gn.value=ua(Hl.value,v),v<1&&(c=requestAnimationFrame(l))};c=requestAnimationFrame(l)},u=e.computed(()=>Z.value?.bubbles?.minSize||8),p=e.computed(()=>Z.value?.bubbles?.maxSize||50),g=e.computed(()=>Z.value?.bubbles?.opacity||.7),k=(t,o)=>{const l=[15,20,25,18,22],r=l[t%l.length]||20,m=1+Math.sin(o*.5)*.2;return Math.max(5,r*m)},F=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.opacity="1")},P=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.display="none")},E=e.computed(()=>V.series),le=e.computed(()=>V.series.filter((t,o)=>!st.value.has(o))),J=t=>{if(!t)return"primary";const o=t.yAxis??t.axis??t.yAxisId;return o==="secondary"||o==="right"||o===1?"secondary":"primary"},Fe=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,we=t=>t?t.old===!0||t.comparison===!0||t.dotted===!0:!1,ct=e.computed(()=>{const o=Z.value?.spider?.comparison||{};return{fillOpacity:typeof o.fillOpacity=="number"?o.fillOpacity:0,strokeDasharray:o.strokeDasharray||"6,4",usePrimaryColor:o.usePrimaryColor!==!1,bubbleSize:typeof o.bubbleSize=="number"?o.bubbleSize:0}}),bl=(t,o)=>typeof t?.bubbles?.size=="number"?t.bubbles.size:typeof t?.bubbleSize=="number"?t.bubbleSize:o?ct.value.bubbleSize:te.value,pl=(t,o)=>we(t)&&ct.value.usePrimaryColor?Kt(0):Kt(o),Zt=(t,o)=>gl.value&&we(t)?pl(t,o):Kt(o),vl=e.computed(()=>le.value.filter(t=>J(t)==="primary")),fl=e.computed(()=>le.value.filter(t=>J(t)==="secondary")),Ut=e.computed(()=>!al.value&&!!ft.value&&fl.value.length>0),jl=(t,o=0)=>{const l=Number(t);return Number.isFinite(l)?l:o},kn=(t,o,l)=>{if(!Array.isArray(t))return[];const r=t.map((m,v)=>{const C=m&&typeof m=="object"&&!Array.isArray(m),b=jl(C?m.value:m,0);return b<=0?null:{key:`${l}-${v}-${C&&m.label||v}`,label:C?m.label||o?.name||`Segment ${v+1}`:o?.name||`Segment ${v+1}`,value:b,color:C?m.color||Kt(v):Kt(l),marker:C?m.marker:null,isRemainder:!1}}).filter(Boolean);return B.value==="asc"?r.sort((m,v)=>m.value-v.value):B.value==="desc"?r.sort((m,v)=>v.value-m.value):r},Cn=(t,o,l,r)=>{const m=t&&typeof t=="object"&&!Array.isArray(t),v=m?t.segments:Array.isArray(t)?t:[{label:l?.name,value:t,color:Kt(r)}],C=kn(v,l,r),b=C.reduce((M,G)=>M+G.value,0),q=jl(m?t.totalValue??t.total??l?.totalValue??l?.total:l?.totalValue??l?.total,w.value),_=Math.max(q,b,1);T.value&&_>b&&C.push({key:`${r}-${o}-remainder`,label:ie.value,value:_-b,color:re.value,marker:null,isRemainder:!0});const I=C.filter(M=>!M.isRemainder).reduce((M,G)=>!M||G.value>M.value?G:M,null);return{key:`${r}-${o}`,label:m?t.label||t.name||V.categories?.[o]||L("chart.fallback.item",{number:o+1}):V.categories?.[o]||L("chart.fallback.item",{number:o+1}),axisLabel:m?t.xLabel??t.label??t.name??V.categories?.[o]??L("chart.fallback.item",{number:o+1}):V.categories?.[o]||L("chart.fallback.item",{number:o+1}),yLabel:m?t.yLabel??null:null,totalValue:_,usedValue:b,segments:C,maxSegmentKey:I?.key||null,seriesName:l?.name||"",seriesIndex:r}},Qn=e.computed(()=>{if(!jt.value)return[];const t=[];return E.value.forEach((o,l)=>{st.value.has(l)||!Array.isArray(o?.data)||o.data.forEach(r=>{const m=Cn(r,t.length,o,l);m.segments.length>0&&t.push(m)})}),t}),Ml="auto",Do=(t,o,l,r=0,m=100)=>{let v=1/0,C=-1/0;if(t.forEach(_=>{_?.data?.length&&_.data.forEach(I=>{typeof I=="number"&&Number.isFinite(I)&&(v=Math.min(v,I),C=Math.max(C,I))})}),v===1/0)return{minY:r,maxY:m};let b;if(o===Ml){const _=C-v,I=_>0?_*.1:1;b=Math.max(0,v-I)}else if(typeof o=="number")b=o;else{const _=C-v,I=_>0?_*.1:1;b=Math.max(0,v-I)}let q;if(l===Ml){const _=C-v,I=_>0?_*.1:2;q=C+I}else if(typeof l=="number")q=l;else{const _=C-v,I=_>0?_*.1:2;q=C+I}return{minY:b,maxY:q}},Wt=e.computed(()=>{if(el.value)return to();if(jt.value)return va();if(!le.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;le.value.forEach(l=>{l.data&&l.data.length&&(t=Math.max(t,l.data.length-1))}),V.categories.length>0&&(t=Math.max(t,V.categories.length-1));const o=Do(vl.value.length?vl.value:le.value,it.value,At.value);return{minX:0,maxX:t,minY:o.minY,maxY:o.maxY}}),va=()=>{const t=Qn.value,o=t.reduce((v,C)=>Math.max(v,C.totalValue),w.value),l=typeof it.value=="number"?it.value:0,r=typeof At.value=="number"?At.value:o,m=Math.max(r,l+1);return{minX:0,maxX:Math.max(t.length-1,0),minY:l,maxY:m}},ko=e.computed(()=>Ut.value?Do(fl.value,ht.value,il.value,Wt.value.minY,Wt.value.maxY):{minY:Wt.value.minY,maxY:Wt.value.maxY}),to=()=>{if(!le.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,o=-1/0,l=1/0,r=-1/0,m=1/0,v=-1/0,C=!1;if(le.value.forEach((Be,Oe)=>{Be?.data?.length&&Be.data.forEach((ve,xe)=>{let Ee,de,Xe;if(typeof ve=="object"&&ve!==null&&!Array.isArray(ve))Ee=typeof ve.x=="number"?ve.x:xe,de=typeof ve.y=="number"?ve.y:0,Xe=typeof ve.size=="number"?ve.size:20;else if(Array.isArray(ve)&&ve.length>=3)Ee=typeof ve[0]=="number"?ve[0]:xe,de=typeof ve[1]=="number"?ve[1]:0,Xe=typeof ve[2]=="number"?ve[2]:20;else if(typeof ve=="number")Ee=xe,de=ve,Xe=k(Oe,xe);else return;isFinite(Ee)&&isFinite(de)&&isFinite(Xe)&&(t=Math.min(t,Ee),o=Math.max(o,Ee),l=Math.min(l,de),r=Math.max(r,de),m=Math.min(m,Xe),v=Math.max(v,Xe),C=!0)})}),!C)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===o&&(t=Math.min(t,0),o=Math.max(o,V.categories?.length-1||8)),l===r&&(l=Math.max(0,l-10),r=l+20);const b=o-t,q=r-l;let _,I,M,G;return St.value!==null?_=St.value:_=t-b*.1,Dt.value!==null?I=Dt.value:I=o+b*.1,it.value!==null&&typeof it.value=="number"?M=it.value:M=Math.max(0,l-q*.1),At.value!==null&&typeof At.value=="number"?G=At.value:G=r+q*.1,{minX:_,maxX:I,minY:M,maxY:G,minSize:m,maxSize:v}},tl=t=>{if(el.value){const{minX:b,maxX:q}=Wt.value,_=q-b||1;return z.value.left+(t-b)/_*z.value.width}const{minX:o,maxX:l}=Wt.value,r=l-o;if(l===0||r===0)return z.value.left+z.value.width/2;const m=r/U.value.scale,v=o-U.value.offsetX/z.value.width*r,C=(t-v)/m;return z.value.left+C*z.value.width},Vl=t=>{const{minY:o,maxY:l}=Wt.value,r=l-o||1;return z.value.bottom-(t-o)/r*z.value.height},ln=t=>{const{minY:o,maxY:l}=ko.value,r=l-o||1;return z.value.bottom-(t-o)/r*z.value.height},rl=(t,o)=>Ut.value&&J(t)==="secondary"?ln(o):Vl(o),fa=t=>{if(!el.value)return te.value||4;const{maxSize:o}=Wt.value,l=Math.max(1,o),r=Math.min(1,Math.max(0,t/l));return u.value+r*(p.value-u.value)},lo=(t,o=12,l="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(o*.62);lo.canvas||(lo.canvas=document.createElement("canvas"));const r=lo.canvas.getContext("2d");return r?(r.font=`${o}px ${l}`,r.measureText(t).width):t.length*(o*.62)},ha=(t,o,l=12)=>{if(typeof t!="string"||typeof o!="number"||o<=0||lo(t,l)<=o)return t;const r="..";if(lo(r,l)>=o)return r;let v=t.length;for(;v>0;){const C=`${t.slice(0,v)}${r}`;if(lo(C,l)<=o)return C;v-=1}return r},Ia=e.computed(()=>na.value.map(t=>({y:t.y}))),ga=e.computed(()=>!jt.value||!yt.value?[]:na.value.map(t=>({y:t.y}))),la=e.computed(()=>{if(el.value)return za();if(jt.value)return[];if(ge.value==="bar"){if(al.value){const Me=[],{minY:Re,maxY:_t}=Wt.value,zt=5,Kl=_t-Re||1;for(let yl=0;yl<=zt;yl++){const Gl=Re+Kl*(yl/zt),zo=cn(Gl);Me.push({x:zo,y:z.value.bottom+20,text:Bt(Math.round(Gl))})}return Me}const xe=[],{maxX:Ee}=Wt.value,de=Ee+1,Xe=5,Le=(z.value.width-Xe*2)/de;for(let Me=0;Me<=Ee;Me++){const Re=z.value.left+Xe+(Me+.5)*Le;xe.push({x:Re,y:z.value.bottom+20,text:ha(V.categories[Me]||L("chart.fallback.item",{number:Me+1}),Math.max(Le-8,24))})}return xe}const t=[],{minX:o,maxX:l}=Wt.value,r=St.value!==null?St.value:o,m=Dt.value!==null?Dt.value:l,v=m-r||1,C=v/U.value.scale,b=r-U.value.offsetX/z.value.width*v,q=b+C,_=Math.max(0,Math.floor(b-2)),I=Math.min(m,Math.ceil(q+2)),M=I-_,G=z.value.width,Oe=Math.floor(G/60);let ve=1;M>Oe&&(ve=Math.ceil(M/Oe));for(let xe=_;xe<=I;xe+=ve)if(xe>=0&&xe<=m){const Ee=tl(xe);Ee>=z.value.left-100&&Ee<=z.value.right+100&&t.push({x:Ee,y:z.value.bottom+20,text:V.categories[xe]||`Item ${xe+1}`})}return t}),za=()=>{const t=[],{minX:o,maxX:l}=Wt.value,r=l-o||1,m=Math.min(8,Math.max(4,Math.floor(z.value.width/80)));for(let v=0;v<=m;v++){const C=o+r*v/m,b=tl(C);if(b>=z.value.left-10&&b<=z.value.right+10){const q=Math.round(C),_=V.categories?.[q];t.push({x:b,y:z.value.bottom+20,text:_||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},na=e.computed(()=>{if(al.value){const m=[],{maxX:v}=Wt.value;for(let C=0;C<=v;C++)m.push({x:z.value.left-10,y:Mn(C),text:ha(V.categories[C]||`Item ${C+1}`,Math.max(z.value.left-28,40))});return m}const t=[],{minY:o,maxY:l}=Wt.value,r=5;for(let m=0;m<=r;m++){const v=o+(l-o)*(m/r),C=Math.round(v);t.push({x:z.value.left-10,y:Vl(v),text:Bt(C)})}return t}),Pa=e.computed(()=>{if(!Ut.value||al.value)return[];const t=[],{minY:o,maxY:l}=ko.value,r=5;for(let m=0;m<=r;m++){const v=o+(l-o)*(m/r),C=Math.round(v);t.push({x:z.value.right+10,y:ln(v),text:Bt(C)})}return t}),Kt=t=>{const o=pt.value;if(!o||o.length===0){const l=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return l[t%l.length]}return o[t%o.length]},Oa=t=>{if(!t||typeof t!="string")return"#3a3a3a";const o=t.trim();let l=0,r=0,m=0;const v=o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(v)l=Number(v[1])/255,r=Number(v[2])/255,m=Number(v[3])/255;else{const b=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(b)l=Number(b[1])/255,r=Number(b[2])/255,m=Number(b[3])/255;else{const q=o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(q){let _=q[1];_.length===3&&(_=_[0]+_[0]+_[1]+_[1]+_[2]+_[2]),l=parseInt(_.slice(0,2),16)/255,r=parseInt(_.slice(2,4),16)/255,m=parseInt(_.slice(4,6),16)/255}else if(typeof document<"u"){const _=document.createElement("span");_.style.color=o,_.style.display="none",document.body.appendChild(_);const I=getComputedStyle(_).color;document.body.removeChild(_);const M=I.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(M)l=Number(M[1])/255,r=Number(M[2])/255,m=Number(M[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*r+.0722*m>.5?"#3a3a3a":"#fafafa"},oa=t=>{if(!t||typeof t!="string")return t;const o=t.trim(),l=o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(l){const v=Math.max(0,Math.floor(Number(l[1])*.65)),C=Math.max(0,Math.floor(Number(l[2])*.65)),b=Math.max(0,Math.floor(Number(l[3])*.65));return`rgb(${v}, ${C}, ${b})`}const r=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(r){const v=Math.max(0,Math.floor(Number(r[1])*.65)),C=Math.max(0,Math.floor(Number(r[2])*.65)),b=Math.max(0,Math.floor(Number(r[3])*.65));return`rgba(${v}, ${C}, ${b}, ${r[4]})`}const m=o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(m){let v=m[1];v.length===3&&(v=v[0]+v[0]+v[1]+v[1]+v[2]+v[2]);const C=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(0,2),16)*.65))),b=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(2,4),16)*.65))),q=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(4,6),16)*.65)));return`#${[C,b,q].map(_=>_.toString(16).padStart(2,"0")).join("")}`}return o},aa=(t,o)=>{const r=Z.value?.stroke?.color;return r==null?oa(o):typeof r=="string"?r:Array.isArray(r)&&r.length?r[t%r.length]??oa(o):oa(o)},sa=t=>{let o=0;for(let l=1;l<t.length;l++){const r=t[l].x-t[l-1].x,m=t[l].y-t[l-1].y;o+=Math.sqrt(r*r+m*m)}return o},ya=e.computed(()=>ge.value==="line"||Pl.value?(Pl.value?V.series.filter(o=>(o.type||ge.value)==="line"):E.value).map((o,l)=>{const r=V.series.findIndex(M=>M===o),m=[];let v=[];o.data.forEach((M,G)=>{M==null?v.length>0&&(m.push([...v]),v=[]):v.push({x:al.value?cn(M):tl(G),y:al.value?Mn(G):rl(o,M),index:G})}),v.length>0&&m.push(v);let C="";m.forEach(M=>{if(M.length>0){let G="";We.value?G=ho(M):G=`M ${M[0].x} ${M[0].y}`+M.slice(1).map(Be=>` L ${Be.x} ${Be.y}`).join(""),C+=(C?" ":"")+G}});const b=m.reduce((M,G)=>M+sa(G),0),q=st.value.has(r),_=Ne.value===r,I=Ne.value!==null&&Ne.value!==r;return{path:C,color:Kt(r),strokeDasharray:Fe(o),pathLength:b,seriesIndex:r,animationDelay:l*ul.value,isHighlighted:_,isDimmed:I,isHidden:q}}):[]),ka=e.computed(()=>{if(!(ge.value==="line"||Pl.value))return[];const t=Pl.value?V.series.filter(l=>(l.type||ge.value)==="line"):E.value,o=[];return t.forEach((l,r)=>{const m=V.series.findIndex(v=>v===l);for(let v=0;v<l.data.length-1;v++){const C=l.data[v];if(C!=null){let b=-1,q=0;for(let _=v+1;_<l.data.length;_++){const I=l.data[_];if(I==null)q++;else{b=_;break}}if(q>0&&b!==-1){const _=l.data[b],I=al.value?cn(C):tl(v),M=al.value?Mn(v):rl(l,C),G=al.value?cn(_):tl(b),Be=al.value?Mn(b):rl(l,_),Oe=st.value.has(m),ve=Ne.value===m,xe=Ne.value!==null&&Ne.value!==m;o.push({path:`M ${I} ${M} L ${G} ${Be}`,color:Kt(m),seriesIndex:m,animationDelay:r*ul.value,isHighlighted:ve,isDimmed:xe,isHidden:Oe,gapSize:q}),v=b-1}}}}),o}),Wa=e.computed(()=>ge.value==="line"||Pl.value?!El.value||$n.value||Rt.value.hasAnimated?[]:(Pl.value?V.series.filter(o=>(o.type||ge.value)==="line"):E.value).map((o,l)=>{const r=V.series.findIndex(q=>q===o);let m="",v=null;o.data.forEach((q,_)=>{if(q!=null){const I={x:al.value?cn(q):tl(_),y:al.value?Mn(_):rl(o,q)};v===null?m+=`M ${I.x} ${I.y}`:m+=` L ${I.x} ${I.y}`,v=I}else if(v!==null){const I=o.data.findIndex((M,G)=>G>_&&M!==null&&M!==void 0);if(I!==-1){const M={x:al.value?cn(o.data[I]):tl(I),y:al.value?Mn(I):rl(o,o.data[I])};m+=` L ${M.x} ${M.y}`,v=M}}});const C=o.data.map((q,_)=>q==null?null:{x:al.value?cn(q):tl(_),y:al.value?Mn(_):rl(o,q)}).filter(q=>q!==null),b=sa(C);return{path:m,pathLength:b,color:Kt(r),strokeDasharray:Fe(o),animationDelay:l*ul.value,seriesIndex:r}}):[]),qa=e.computed(()=>{if(ge.value!=="line")return[];const t=[];return E.value.forEach((o,l)=>{const r=Ne.value===l,m=Ne.value!==null&&Ne.value!==l,v=st.value.has(l);o.data.forEach((C,b)=>{C!=null&&t.push({x:tl(b),y:rl(o,C),color:Kt(l),value:C,label:V.categories[b]||b.toString(),seriesName:o.name,categoryIndex:b,dataIndex:b,animationDelay:(l*o.data.length+b)*(ul.value/8),isHighlighted:r,isDimmed:m,isHidden:v})})}),t}),Za=e.computed(()=>{if(!Pl.value)return[];const t=[];return V.series.filter(l=>(l.type||ge.value)==="line").forEach((l,r)=>{const m=V.series.findIndex(q=>q===l),v=Ne.value===m,C=Ne.value!==null&&Ne.value!==m,b=st.value.has(m);l.data.forEach((q,_)=>{q!=null&&t.push({x:tl(_),y:rl(l,q),color:Kt(m),value:q,label:V.categories[_]||_.toString(),seriesName:l.name,categoryIndex:_,dataIndex:_,animationDelay:(r*l.data.length+_)*(ul.value/8),isHighlighted:v,isDimmed:C,isHidden:b})})}),t}),Ho=e.computed(()=>{if(!el.value)return[];const t=[];return E.value.forEach((o,l)=>{if(!o?.data?.length)return;const r=Ne.value,m=r!==null&&r===l,v=r!==null&&r!==l,C=st.value.has(l);o.data.forEach((b,q)=>{let _,I,M,G,Be;if(typeof b=="object"&&b!==null&&!Array.isArray(b))_=typeof b.x=="number"?b.x:q,I=typeof b.y=="number"?b.y:0,M=typeof b.size=="number"?b.size:20,G=b.label||V.categories?.[q]||`Point ${q+1}`,Be=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)_=typeof b[0]=="number"?b[0]:q,I=typeof b[1]=="number"?b[1]:0,M=typeof b[2]=="number"?b[2]:20,G=b[3]||V.categories?.[q]||`Point ${q+1}`,Be=b[4];else if(typeof b=="number")_=q,I=b,M=k(l,q),G=V.categories?.[q]||`Point ${q+1}`;else return;!isFinite(_)||!isFinite(I)||!isFinite(M)||t.push({x:tl(_),y:Vl(I),radius:fa(M),originalX:_,originalY:I,originalSize:M,color:Kt(l),seriesName:o.name||`Series ${l+1}`,label:G,imageUrl:Be,seriesIndex:l,dataIndex:q,categoryIndex:Math.round(_),isHighlighted:m,isDimmed:v,isHidden:C,opacity:g.value})})}),t}),ra=e.computed(()=>ge.value!=="area"?[]:E.value.map((t,o)=>{const l=[];let r=[];if(t.data.forEach((M,G)=>{M==null?r.length>0&&(l.push([...r]),r=[]):r.push({x:tl(G),y:rl(t,M),index:G})}),r.length>0&&l.push(r),l.length===0)return{linePath:"",areaPath:"",color:Kt(o),isHidden:st.value.has(o)};const m=z.value.bottom+1;let v="",C="";l.forEach((M,G)=>{if(M.length===0)return;let Be=`M ${M[0].x} ${M[0].y}`;We.value&&M.length>1?Be=ho(M):M.slice(1).forEach(ve=>{Be+=` L ${ve.x} ${ve.y}`}),v+=(v?" ":"")+Be;let Oe=`M ${M[0].x} ${m}`;if(Oe+=` L ${M[0].x} ${M[0].y}`,We.value&&M.length>1){const ve=ho(M),xe=ve.substring(ve.indexOf("C")||ve.indexOf("Q")||ve.indexOf("L"));xe?Oe+=" "+xe:M.slice(1).forEach(Ee=>{Oe+=` L ${Ee.x} ${Ee.y}`})}else M.slice(1).forEach(ve=>{Oe+=` L ${ve.x} ${ve.y}`});Oe+=` L ${M[M.length-1].x} ${m} Z`,C+=(C?" ":"")+Oe});const b=Ne.value===o,q=Ne.value!==null&&Ne.value!==o,_=st.value.has(o),I=l.reduce((M,G)=>M+sa(G),0);return{linePath:v,areaPath:C,color:Kt(o),pathLength:I,isHighlighted:b,isDimmed:q,isHidden:_}})),Ca=e.computed(()=>{if(!(["bar"].includes(ge.value)||Pl.value))return[];const t=[],{maxX:o}=Wt.value,l=Pl.value?V.series.filter(m=>(m.type||ge.value)==="bar"):E.value,r=l.length;if(al.value){const m=o+1,C=z.value.height/m,b=C*(2/3),q=Math.min(4,b/r*.15),_=b-(r-1)*q,I=Math.max(4,_/r);l.forEach((M,G)=>{const Be=V.series.findIndex(Ee=>Ee===M),Oe=Ne.value===Be,ve=Ne.value!==null&&Ne.value!==Be,xe=st.value.has(Be);M.data.forEach((Ee,de)=>{if(Ee==null||typeof Ee!="number"||!isFinite(Ee))return;const Le=z.value.top+(de+.5)*C-b/2+G*(I+q),Me=z.value.left,Re=Math.abs(cn(Ee)-z.value.left);let _t="";if(We.value&&Re>0){const zt=Math.min(Ot.value,I/2,Re/2);_t=[`M ${Me} ${Le}`,`L ${Me+Re-zt} ${Le}`,`Q ${Me+Re} ${Le} ${Me+Re} ${Le+zt}`,`L ${Me+Re} ${Le+I-zt}`,`Q ${Me+Re} ${Le+I} ${Me+Re-zt} ${Le+I}`,`L ${Me} ${Le+I}`,"Z"].join(" ")}t.push({x:Me,y:Le,width:Re,height:I,color:Kt(r===1?de:Be),value:Ee,label:V.categories[de]||de.toString(),seriesName:M.name,animationDelay:(G*l.length+de)*(ul.value/4),isHighlighted:Oe,isDimmed:ve,isHidden:xe,barPath:_t,isSmooth:We.value&&Re>0})})})}else{const m=o+1,C=z.value.width/m,b=C*.8,q=b/r,_=q*.05,I=q-_;l.forEach((M,G)=>{const Be=V.series.findIndex(Ee=>Ee===M),Oe=Ne.value===Be,ve=Ne.value!==null&&Ne.value!==Be,xe=st.value.has(Be);M.data.forEach((Ee,de)=>{if(Ee==null||typeof Ee!="number"||!isFinite(Ee))return;const Le=z.value.left+(de+.5)*C-b/2+G*q+_/2,Me=Vl(Math.max(0,Ee)),Re=Math.abs(Vl(0)-Vl(Ee));let _t="";if(We.value&&Re>0){const zt=Math.min(Ot.value,I/2,Re/2);_t=[`M ${Le} ${Me+Re}`,`L ${Le} ${Me+zt}`,`Q ${Le} ${Me} ${Le+zt} ${Me}`,`L ${Le+I-zt} ${Me}`,`Q ${Le+I} ${Me} ${Le+I} ${Me+zt}`,`L ${Le+I} ${Me+Re}`,"Z"].join(" ")}t.push({x:Le,y:Me,width:I,height:Re,color:Kt(r===1?de:Be),value:Ee,label:V.categories[de]||de.toString(),seriesName:M.name,animationDelay:(G*l.length+de)*(ul.value/4),isHighlighted:Oe,isDimmed:ve,isHidden:xe,barPath:_t,isSmooth:We.value&&Re>0})})})}return t}),_n=e.computed(()=>{if(!Cl.value)return[];const t=E.value.map((C,b)=>({series:C,originalIndex:b})).filter(({originalIndex:C})=>!st.value.has(C));if(t.length===0)return[];let o=ge.value==="semi-radial"?Math.PI:-Math.PI/2;const l=ge.value==="semi-radial"?Math.PI:Math.PI*2,r=[],m=(C,b,q,_,I,M)=>{const G=C+(b-C)/2,Be=b-C,Oe=Lt.value+Math.cos(C)*sl.value,ve=Ct.value+Math.sin(C)*sl.value,xe=Lt.value+Math.cos(b)*sl.value,Ee=Ct.value+Math.sin(b)*sl.value,de=Lt.value+Math.cos(b)*vt.value,Xe=Ct.value+Math.sin(b)*vt.value,Ie=Lt.value+Math.cos(C)*vt.value,Le=Ct.value+Math.sin(C)*vt.value,Me=Be>Math.PI?1:0,Re=[`M ${Oe} ${ve}`,`A ${sl.value} ${sl.value} 0 ${Me} 1 ${xe} ${Ee}`,`L ${de} ${Xe}`,`A ${vt.value} ${vt.value} 0 ${Me} 0 ${Ie} ${Le}`,"Z"].join(" "),_t=M||Kt(q);return{path:Re,color:_t,strokeWidth:qt.value,strokeColor:aa(r.length,_t),value:I,seriesName:_,opacity:.8,isHighlighted:Ne.value===q,isDimmed:Ne.value!==null&&Ne.value!==q,isHidden:!1,startAngle:C,endAngle:b,midAngle:G}};if(Kn.value){const{series:C,originalIndex:b}=t[0],q=Number(C?.data?.[0]??0),_=Number.isFinite(q)?Math.min(Math.max(q,0),100):0,I=Z.value,M=Math.min(Math.max(Number(I?.miniRadial?.minVisiblePercent??1),0),100),Be=(_<=0?M:_)/100*l,Oe=Number(I?.miniRadial?.thresholds?.low??33),ve=Number(I?.miniRadial?.thresholds?.medium??66),xe=I?.miniRadial?.colors?.low||"#E53E3E",Ee=I?.miniRadial?.colors?.medium||"#ED8936",de=I?.miniRadial?.colors?.high||"#38A169",Xe=_<=Oe?xe:_<=ve?Ee:de,Ie=I?.miniRadial?.trackColor||"#E5E7EB",Le=C?.name||"Score";return r.push(m(o,o+l-.001,b+1,"Track",100,Ie)),r.push(m(o,o+Be,b,Le,_,Xe)),r}if(t.length===1){const{series:C,originalIndex:b}=t[0],q=C.data[0]||0,_=o,I=o+l-.001,M=_+l/2,G=Lt.value+Math.cos(_)*sl.value,Be=Ct.value+Math.sin(_)*sl.value,Oe=Lt.value+Math.cos(I)*sl.value,ve=Ct.value+Math.sin(I)*sl.value,xe=Lt.value+Math.cos(I)*vt.value,Ee=Ct.value+Math.sin(I)*vt.value,de=Lt.value+Math.cos(_)*vt.value,Xe=Ct.value+Math.sin(_)*vt.value,Ie=1,Le=[`M ${G} ${Be}`,`A ${sl.value} ${sl.value} 0 ${Ie} 1 ${Oe} ${ve}`,`L ${xe} ${Ee}`,`A ${vt.value} ${vt.value} 0 ${Ie} 0 ${de} ${Xe}`,"Z"].join(" "),Me=Kt(b);return r.push({path:Le,color:Me,strokeWidth:qt.value,strokeColor:aa(0,Me),value:q,seriesName:C.name,opacity:.8,isHighlighted:Ne.value===b,isDimmed:!1,isHidden:!1,startAngle:_,endAngle:I,midAngle:M}),r}if(tn.value&&t.length===2){const C=t[0],b=t[1],q=Math.min(100,Math.max(0,C.series.data[0]||0)),_=q/100*l;return r.push(m(o,o+_,C.originalIndex,C.series.name,q)),r.push(m(o,o+l,b.originalIndex,b.series.name,100)),r}const v=t.reduce((C,{series:b})=>C+(b.data[0]||0),0);return v===0?[]:(t.forEach(({series:C,originalIndex:b})=>{const q=C.data[0]||0,_=q/v*l,I=o,M=o+_,G=I+_/2,Be=Lt.value+Math.cos(I)*sl.value,Oe=Ct.value+Math.sin(I)*sl.value,ve=Lt.value+Math.cos(M)*sl.value,xe=Ct.value+Math.sin(M)*sl.value,Ee=Lt.value+Math.cos(M)*vt.value,de=Ct.value+Math.sin(M)*vt.value,Xe=Lt.value+Math.cos(I)*vt.value,Ie=Ct.value+Math.sin(I)*vt.value,Le=_>Math.PI?1:0,Me=[`M ${Be} ${Oe}`,`A ${sl.value} ${sl.value} 0 ${Le} 1 ${ve} ${xe}`,`L ${Ee} ${de}`,`A ${vt.value} ${vt.value} 0 ${Le} 0 ${Xe} ${Ie}`,"Z"].join(" "),Re=Kt(b);r.push({path:Me,color:Re,strokeWidth:qt.value,strokeColor:aa(r.length,Re),value:q,seriesName:C.name,opacity:.8,isHighlighted:Ne.value===b,isDimmed:Ne.value!==null&&Ne.value!==b,isHidden:!1,startAngle:I,endAngle:M,midAngle:G}),o=M}),r)}),Ua=e.computed(()=>{const t=_n.value;return tn.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((o,l)=>({segment:o,originalIndex:l}))}),Xa=e.computed(()=>{if(!Dn.value||!Cl.value)return[];const t=Fl.value,o=Xt.value,l=Zn.value,r=nl.value,m=15,v=t*1.3,C=.55,b=(M,G)=>{const Be=Lt.value+Math.cos(M.midAngle)*vt.value,Oe=Ct.value+Math.sin(M.midAngle)*vt.value,ve=Lt.value+Math.cos(M.midAngle)*(vt.value+o),xe=Ct.value+Math.sin(M.midAngle)*(vt.value+o),de=ve+l*(G?1:-1),Xe=G?ve+m:ve-m,Ie=xe-r,Le=`${M.seriesName}: ${Bt(M.value)}`,Me=Le.length*t*C;return{pointerStartX:Be,pointerStartY:Oe,pointerEndX:ve,pointerEndY:xe,horizontalEndX:de,horizontalEndY:xe,textX:Xe,textY:Ie,text:Le,textWidth:Me,textAnchor:G?"start":"end",isRightSide:G,pointerLineLength:Math.hypot(ve-Be,xe-Oe),horizontalLineLength:Math.hypot(de-ve,0)}},q=(M,G)=>{const Be=Math.abs(M.textY-G.textY)<v,Oe=M.isRightSide?M.textX:M.textX-M.textWidth,ve=M.isRightSide?M.textX+M.textWidth:M.textX,xe=G.isRightSide?G.textX:G.textX-G.textWidth,Ee=G.isRightSide?G.textX+G.textWidth:G.textX,de=Oe<Ee&&xe<ve;return Be&&de},_=_n.value.filter(M=>!M.isHidden),I=[];for(let M=0;M<_.length;M++){const G=_[M];let Be=Math.cos(G.midAngle)>=0;if(M>0){const ve=I[M-1],xe=b(G,Be);q(ve,xe)&&(Be=!Be)}const Oe=b(G,Be);I.push({...Oe,color:G.color,isHighlighted:G.isHighlighted,isDimmed:G.isDimmed})}return I}),Ya=t=>{if(!t||t.isHidden)return 0;const o=t.opacity||g.value||.7;return Ne.value===null||Ne.value===void 0?o:Ne.value!==null?t.seriesIndex===Ne.value?Math.min(1,o+.1):Math.max(.5,o*.8):o},ja=t=>{if(!t||t.isHidden)return 0;const o=t.radius>20?.9:.8;return Ne.value!==null?t.seriesIndex===Ne.value?Math.min(1,o+.1):o*.7:o},ba=(t,o)=>{if(t)try{if(Ne.value===t.seriesIndex?Ne.value=null:Ne.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:o,chartId:V.chartId}});window.dispatchEvent(l)}}catch(l){console.error("Error in onBubbleClick:",l)}},Ka=(t,o)=>{const l=[`dss-bubble-fallback-${o}`];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(" ")},wa=(t,o)=>{if(!t||(o.stopPropagation(),Fo.value=!0,Ne.value=t.seriesIndex,$.value.show=!1,!Ce.value))return;const l=o.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect();let m=o.clientX-r.left+10,v=o.clientY-r.top-10;const C=200,b=120;m+C>ye.value&&(m=o.clientX-r.left-C-10),v+b>r.height&&(v=o.clientY-r.top-b-10),m<0&&(m=10),v<0&&(v=10);const q=Sl.value,_=Jl.value,I=q.map(M=>{const G=_[M]||M,Be=xa(M,t);return Be?{seriesName:t.seriesName,label:t.label,value:`${G}: ${Be}`,color:t.color}:null}).filter(Boolean);h.value={show:!0,x:m,y:v,title:t.label||t.seriesName||"",value:"",bubbleData:I,categoryIndex:void 0,spiderAreas:[]}},xa=(t,o)=>{let l;switch(t){case"x":l=o.originalX;break;case"y":l=o.originalY;break;case"size":l=o.originalSize;break;case"label":l=o.label;break;case"seriesName":l=o.seriesName;break;default:l=o[t]||""}const r=Xl.value[t];if(typeof r=="function")return r(l,o);if(typeof l=="number"){const m=l.toFixed(1);return ll.value?m+ll.value:m}return l?.toString()||""},Ga=()=>{if(!el.value||!$.value.data||$.value.data.length===0)return"Bubbles";const t=[],o=new Set;return $.value.data.forEach(l=>{if(l.seriesName&&l.label){const r=`${l.seriesName} - ${l.label}`;o.has(r)||(t.push(r),o.add(r))}else l.seriesName&&(o.has(l.seriesName)||(t.push(l.seriesName),o.add(l.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},Ea=(t,o)=>{t&&(Fo.value=!1,Ne.value=null,h.value.show=!1,h.value.bubbleData=[])},Qa=(t,o)=>{const l=o.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect(),m=Ko(t.categoryIndex),v=t.description||t.comment||"";let C=o.clientX-r.left+15,b=o.clientY-r.top-10;const q=200,_=v?80:50;C+q>ye.value&&(C=o.clientX-r.left-q-15),b+_>Te.value&&(b=o.clientY-r.top-_-10),C<0&&(C=10),b<0&&(b=10),x.value={show:!0,x:C,y:b,categoryValue:m,description:v}},Ja=()=>{x.value.show=!1},no=e.computed(()=>V.categories.length||Math.max(...le.value.map(t=>t.data.length))),es=e.computed(()=>{let t=0;return le.value.forEach(o=>{o.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),Sa=e.computed(()=>{const t=[],o=no.value;for(let l=0;l<o;l++){const r=l*2*Math.PI/o-Math.PI/2,m=Lt.value+Math.cos(r)*vt.value,v=Ct.value+Math.sin(r)*vt.value;t.push({x:m,y:v,angle:r,index:l})}return t}),ts=e.computed(()=>{const t=[],o=no.value;return Sa.value.forEach((l,r)=>{const m=vt.value+15,v=r*2*Math.PI/o-Math.PI/2,C=Lt.value+Math.cos(v)*m,b=Ct.value+Math.sin(v)*m+5;let q="middle",_="middle";Math.abs(Math.cos(v))>.5&&(q=Math.cos(v)>0?"start":"end"),Math.abs(Math.sin(v))>.5&&(_=Math.sin(v)>0?"hanging":"auto"),t.push({x:C,y:b,text:V.categories[r]||`Axis ${r+1}`,anchor:q,baseline:_})}),t}),ls=e.ref(new Set),ns=(t,o,l)=>{const r=`current-${l}`,m=ls.value.has(r),v=o.fillOpacity??W.value;return!m&&Ne.value===null?v:o.isHighlighted||m?o.isComparison?v:v+.15:o.isDimmed?v*.3:v},Va=e.computed(()=>{if(!gl.value)return[];const t=[],o=no.value;return E.value.map((r,m)=>({series:r,seriesIndex:m})).sort((r,m)=>{const v=we(r.series)?0:1,C=we(m.series)?0:1;return v-C}).forEach(({series:r,seriesIndex:m})=>{const v=we(r),C=[],b=[],q=[],_=Ne.value===m,I=Ne.value!==null&&Ne.value!==m,M=st.value.has(m);for(let G=0;G<o;G++){const Be=r.data[G]||0,ve=Be/es.value*vt.value,xe=G*2*Math.PI/o-Math.PI/2,Ee=Lt.value+Math.cos(xe)*ve,de=Ct.value+Math.sin(xe)*ve;C.push(`${Ee},${de}`),b.push({x:Ee,y:de}),q.push({x:Ee,y:de,value:Be,label:V.categories[G]||`Axis ${G+1}`,seriesName:r.name})}t.push({points:C.join(" "),polygonPoints:b,dataPoints:q,color:pl(r,m),fillOpacity:v?ct.value.fillOpacity:W.value,strokeDasharray:v?Fe(r)||ct.value.strokeDasharray:null,pointRadius:bl(r,v),seriesName:r.name,value:`${r.name}: ${r.data.join(", ")}`,isHighlighted:_,isDimmed:I,isHidden:M,isComparison:v,seriesIndex:m})}),t}),os=(t,o)=>{if(!o||o.length<3)return!1;let l=!1;for(let r=0,m=o.length-1;r<o.length;m=r++){const v=o[r].x,C=o[r].y,b=o[m].x,q=o[m].y;C>t.y!=q>t.y&&t.x<(b-v)*(t.y-C)/(q-C)+v&&(l=!l)}return l},as=t=>{if(!gl.value)return;const o=t.currentTarget.closest(".dss-custom-chart-container");if(!o)return;const l=o.getBoundingClientRect(),r=me.value?.getBoundingClientRect();if(!r)return;const m=t.clientX-r.left,v=t.clientY-r.top,C=Va.value.filter(b=>b.isHidden?!1:os({x:m,y:v},b.polygonPoints));if(C.length>0){C.length,Ne.value=C[0].seriesIndex;const b=t.clientX-l.left+10,q=t.clientY-l.top-10,_=C.length>1?460:260,I=70+no.value*20;let M=b,G=q;M+_>ye.value&&(M=t.clientX-l.left-_-10),G+I>Te.value&&(G=t.clientY-l.top-I-10),M<0&&(M=10),G<0&&(G=10);const Be=C.map(Oe=>({seriesName:Oe.seriesName,color:Oe.color,points:Oe.dataPoints.map(ve=>({label:ve.label,value:Bt(ve.value)}))}));h.value={show:!0,x:M,y:G,title:"",value:"",bubbleData:[],spiderAreas:Be}}else bn()},Ro=e.computed(()=>{const t=Z.value;return t.logos.map((o,l)=>{const r=V.series[o.seriesIndex];if(!r||!r.data||r.data.length===0||st.value.has(o.seriesIndex))return null;let m,v;if(kl.value){let b=-1,q=null;for(let I=r.data.length-1;I>=0;I--)if(r.data[I]!==null&&r.data[I]!==void 0){b=I,q=r.data[I];break}if(b===-1||q===null)return null;const _=r.data.map((I,M)=>I==null?null:{x:tl(M),y:rl(r,I),index:M}).filter(I=>I!==null);if(t.animations.enabled&&!$n.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Rt.value.isAnimating||!Rt.value.hasAnimated))if(Rt.value.isAnimating){const I=Rt.value.currentFrame/Rt.value.totalFrames,M=ua(t.animations.easing,Math.min(I,1)),G=vs(_,M);m=G.x+(o.offsetX||0),v=G.y+(o.offsetY||0)}else m=_[0].x+(o.offsetX||0),v=_[0].y+(o.offsetY||0);else m=tl(b)+(o.offsetX||0),v=Vl(q)+(o.offsetY||0)}else if(Cl.value||gl.value){const b=Math.PI*2/t.logos.length*l;m=Lt.value+Math.cos(b)*(vt.value+30)+(o.offsetX||0),v=Ct.value+Math.sin(b)*(vt.value+30)+(o.offsetY||0)}return{...o,x:m,y:v,seriesIndex:o.seriesIndex}}).filter(Boolean)}),ss=t=>{const o=document.querySelector(`.dss-logo-fallback-${t}`),l=document.querySelector(`.dss-logo-image-${t}`);o&&(o.style.opacity="0"),l&&(l.style.opacity="1")},rs=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const o=document.querySelector(`.dss-logo-image-${t}`);o&&(o.style.display="none")},ia=t=>{st.value.has(t)?st.value.delete(t):st.value.add(t)},is=e.computed(()=>{if(!h.value.show&&!(je.value&&$.value.show&&!U.value.isZooming))return{display:"none"};let t,o;if(je.value&&$.value.show&&!U.value.isZooming){t=$.value.x+15,o=z.value.top;const l=el.value?200:150;t+l>ye.value&&(t=$.value.x-l-15),t<0&&(t=10),o<10&&(o=10)}else t=h.value.x,o=h.value.y;return{left:t+"px",top:o+"px"}}),Pn=(t,o)=>{if(!Ce.value||Co.value)return;const r=o.target.closest(".dss-custom-chart-container").getBoundingClientRect();let m=o.clientX-r.left+10,v=o.clientY-r.top-10;const C=200,b=120,q=ye.value,_=Te.value;m+C>q&&(m=o.clientX-r.left-C-10),v+b>_&&(v=o.clientY-r.top-b-10),m<0&&(m=10),v<0&&(v=10);let I;typeof t.categoryIndex=="number"?I=t.categoryIndex:typeof t.dataIndex=="number"?I=t.dataIndex:t.label&&V.categories.includes(t.label)&&(I=V.categories.indexOf(t.label));let M=t.seriesName||t.label||"";(al.value||ge.value==="bar")&&t.label&&(M=t.label),t.tooltipTitle&&(M=t.tooltipTitle),h.value={show:!0,x:m,y:v,title:M,value:Bt(t.value)||"",categoryIndex:I,spiderAreas:[]}},ca=e.ref(!1),Fo=e.ref(!1),bn=()=>{h.value.show=!1,h.value.spiderAreas=[],h.value.bubbleData=[],$.value.show=!1,ca.value||(Ne.value=null)},Co=e.ref(!1),bo=(t,o)=>{Co.value=!0,h.value.show=!1,$.value.show=!1;const r=o.target.closest(".dss-custom-chart-container").getBoundingClientRect();let m=o.clientX-r.left+15,v=o.clientY-r.top-10;const C=250;m+C>ye.value&&(m=o.clientX-r.left-C-15),m<0&&(m=10),v<0&&(v=10),Rn.value={show:!0,x:m,y:v,content:t.texts,count:t.totalCount}},wo=()=>{Co.value=!1,Rn.value.show=!1},Rt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),ua=(t,o)=>{switch(t){case"linear":return o;case"ease":return o<.5?2*o*o:-1+(4-2*o)*o;case"ease-in":return o*o;case"ease-out":return o*(2-o);case"ease-in-out":return o<.5?2*o*o:-1+(4-2*o)*o;default:return o}},$n=e.computed(()=>R.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Na=()=>{if(!El.value||$n.value){Rt.value.hasAnimated=!0,n.value&&(yn.value=1);return}n.value&&(yn.value=0),Rt.value.isAnimating=!0,Rt.value.currentFrame=0,Rt.value.totalFrames=Math.ceil(Dl.value/16.67);const t=()=>{const o=Rt.value.currentFrame/Rt.value.totalFrames,l=ua(Hl.value,Math.min(o,1));cs(l),n.value&&(yn.value=l),o<1?(Rt.value.currentFrame++,Rt.value.animationId=requestAnimationFrame(t)):us()};Rt.value.animationId=requestAnimationFrame(t)},cs=t=>{const o=O.value;o&&o.style.setProperty("--dss-animation-progress",t)},us=()=>{Rt.value.isAnimating=!1,Rt.value.hasAnimated=!0,n.value&&(yn.value=1),Rt.value.animationId&&(cancelAnimationFrame(Rt.value.animationId),Rt.value.animationId=null)},da=e.computed(()=>!Cl.value||Rt.value.hasAnimated?!0:n.value?yn.value>=1:xl.value?Gn.value>=1:!0),Ba=e.computed(()=>Dn.value&&da.value),Io=e.ref(!1);e.watch(Ba,t=>{t?(Io.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Io.value=!0})})):Io.value=!1},{immediate:!0});const ds=e.computed(()=>{if(!El.value||$n.value||Rt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${Dl.value}ms`,t["--dss-animation-easing"]=ms(Hl.value),t["--dss-stagger-delay"]=`${ul.value}ms`,t}),ms=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",ps=()=>{if(!El.value||$n.value)return"";const t=["dss-chart-animated"];return Rt.value.hasAnimated||t.push(`dss-animate-${on.value}`),Rt.value.hasAnimated||(Cl.value&&ge.value!=="semi-radial"?t.push("dss-animate-fill"):Cl.value||t.push(`dss-animate-${on.value}`)),Rt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>V.series,(t,o)=>{Tn.value&&o&&Rt.value.hasAnimated&&(Rt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Na(),Ol.value)}))},{deep:!0}),e.watch(()=>U.value.isZooming,(t,o)=>{o&&!t&&setTimeout(()=>{po()},50)}),e.watch(()=>[U.value.scale,U.value.offsetX],()=>{!U.value.isZooming&&!U.value.isDragging&&po()},{flush:"post"}),e.watch([Pe,Ke],([t,o])=>{U.value.minScale=t,U.value.maxScale=o,(U.value.scale<t||U.value.scale>o)&&Bn()},{immediate:!0}),e.watch(()=>V.locale,t=>{t&&t!==N.value&&(N.value=t)},{immediate:!0}),e.watch(()=>Y.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",fo)}):document.removeEventListener("click",fo)}),e.onMounted(()=>{Ne.value=null,n.value&&(!El.value||$n.value)&&(yn.value=1),hn(),O.value&&typeof ResizeObserver<"u"&&(be=new ResizeObserver(t=>{const o=t[0];!o||!o.contentRect||(he&&cancelAnimationFrame(he),he=requestAnimationFrame(()=>{he=null;const{width:l,height:r}=o.contentRect;ne.value=Math.round(l),f.value=Math.round(r),ot.value&&(Ue.value=ot.value.offsetHeight||oe)}))}),be.observe(O.value)),El.value&&!$n.value?ge.value==="semi-radial"?setTimeout(()=>d(),Ol.value):setTimeout(()=>Na(),Ol.value):(Rt.value.hasAnimated=!0,ge.value==="semi-radial"&&(Gn.value=1)),document.addEventListener("mousemove",Ma),document.addEventListener("mouseup",_a),document.addEventListener("click",Nn)}),e.onUnmounted(()=>{he&&cancelAnimationFrame(he),be&&O.value&&(be.unobserve(O.value),be.disconnect(),be=null),Rt.value.animationId&&cancelAnimationFrame(Rt.value.animationId),c&&(cancelAnimationFrame(c),c=null),U.value.zoomTimeout&&clearTimeout(U.value.zoomTimeout),document.removeEventListener("mousemove",Ma),document.removeEventListener("mouseup",_a),document.removeEventListener("click",Nn),document.removeEventListener("click",fo)});const Ma=t=>{if(U.value.isDragging&&U.value.scale>1&&kl.value){$.value.show=!1;const o=t.clientX-U.value.lastMouseX,{minX:l,maxX:r}=Wt.value,m=r-l||1,C=o*.8;U.value.offsetX+=C;const b=m/U.value.scale,q=m-b,_=0,I=-q/m*z.value.width,M=_;U.value.offsetX=Math.max(I,Math.min(M,U.value.offsetX)),U.value.lastMouseX=t.clientX,U.value.lastMouseY=t.clientY}},_a=()=>{U.value.isDragging&&(U.value.isDragging=!1,setTimeout(()=>{!U.value.isDragging&&U.value.isZooming},100))},vs=(t,o)=>{const l=t.filter(b=>b!=null);if(!l||l.length===0)return{x:0,y:0};if(l.length===1||o<=0)return l[0];if(o>=1)return l[l.length-1];let r=0;const m=[];for(let b=1;b<l.length;b++){const q=l[b].x-l[b-1].x,_=l[b].y-l[b-1].y,I=Math.sqrt(q*q+_*_);m.push(I),r+=I}const v=r*o;let C=0;for(let b=0;b<m.length;b++){const q=C+m[b];if(v<=q){const _=(v-C)/m[b],I=l[b],M=l[b+1];return{x:I.x+(M.x-I.x)*_,y:I.y+(M.y-I.y)*_}}C=q}return l[l.length-1]};return(t,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[ps(),{"dss-chart-fill-width":qe.value,"dss-chart-fill-height":ze.value,"dss-chart-compact":Cl.value&&!A.value}]]),style:e.normalizeStyle({width:qe.value?"100%":ye.value+"px",height:at.value,...qe.value||ze.value?{overflow:Cl.value||jt.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...ds.value,cursor:$o()}),"data-chart-type":ge.value,ref_key:"containerEl",ref:O,onWheel:Mo,onMousedown:jn,onMousemove:Uo,onMouseup:_o,onMouseleave:mo,onDblclick:Bn,onContextmenu:e.withModifiers(xo,["prevent"]),onClick:e.withModifiers(fn,["left"]),onWheelCapture:Mo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:ot},[e.createElementVNode("div",kr,[dt.value?(e.openBlock(),e.createElementBlock("div",Cr,e.toDisplayString(dt.value),1)):e.createCommentVNode("",!0),Ye.value?(e.openBlock(),e.createElementBlock("div",br,e.toDisplayString(Ye.value),1)):e.createCommentVNode("",!0)]),A.value&&X.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":ae.value==="horizontal","dss-legend-vertical":ae.value==="vertical","dss-legend-top":X.value==="top","dss-legend-bottom":X.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":st.value.has(r),"dss-legend-hovered":Ne.value===r,"dss-legend-dimmed":Ne.value!==null&&Ne.value!==r}]),onClick:m=>ia(r),onMouseenter:m=>uo(r),onMouseleave:Jn,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":gl.value&&we(l)}]),style:e.normalizeStyle({backgroundColor:gl.value&&we(l)?"transparent":Zt(l,r),borderColor:Zt(l,r)})},null,6),e.createElementVNode("span",xr,e.toDisplayString(l.name),1)],46,wr))),128))],2)):e.createCommentVNode("",!0),A.value&&(X.value==="left"||X.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":X.value==="left","dss-legend-right":X.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":st.value.has(r),"dss-legend-hovered":Ne.value===r,"dss-legend-dimmed":Ne.value!==null&&Ne.value!==r}]),onClick:m=>ia(r),onMouseenter:m=>uo(r),onMouseleave:Jn,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":gl.value&&we(l)}]),style:e.normalizeStyle({backgroundColor:gl.value&&we(l)?"transparent":Zt(l,r),borderColor:Zt(l,r)})},null,6),e.createElementVNode("span",Sr,e.toDisplayString(l.name),1)],46,Er))),128))],2)):e.createCommentVNode("",!0)],512),S.showAddMarkerButton&&ut.value&&Ze.value.addMarker&&(kl.value||el.value)&&!jt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Vn,title:e.unref(L)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:dl.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,Nr),o[4]||(o[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,Vr)):e.createCommentVNode("",!0),e.createElementVNode("div",Br,[el.value&&Pt.value?(e.openBlock(),e.createElementBlock("div",Mr,"Bubble size: "+e.toDisplayString(Pt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:ye.value,height:Te.value,class:"dss-chart-svg","data-smooth":We.value,"data-animated":El.value,ref_key:"svgEl",ref:me},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:fe.value},[e.createElementVNode("rect",{x:0,y:z.value.top,width:ye.value,height:z.value.height*4},null,8,Lr)],8,$r),xl.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:zn.value},[e.createElementVNode("path",{d:yo.value},null,8,Ar)],8,Tr)):e.createCommentVNode("",!0),n.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:a.value},[e.createElementVNode("path",{d:s.value},null,8,Hr)],8,Dr)):e.createCommentVNode("",!0)]),kl.value||el.value?(e.openBlock(),e.createElementBlock("g",Rr,[pe.value&&!jt.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":_e.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ia.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${r}`,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:`${r*50}ms`})},null,12,Ir))),128))],8,Fr)):e.createCommentVNode("",!0),jt.value&&ga.value.length?(e.openBlock(),e.createElementBlock("g",{key:1,class:"dss-stepbar-axis-bars dss-stepbar-axis-bars--y-only","clip-path":_e.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ga.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`stepbar-axis-bar-${r}`,x1:z.value.left,x2:z.value.right,y1:l.y,y2:l.y,stroke:Et.value,"stroke-width":$t.value,"stroke-dasharray":Ht.value,opacity:xt.value},null,8,Pr))),128))],8,zr)):e.createCommentVNode("",!0),e.createElementVNode("g",Or,[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,Wr),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,qr),Ut.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,Zr)):e.createCommentVNode("",!0)]),e.createElementVNode("g",Ur,[jt.value?e.createCommentVNode("",!0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(la.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${r}`,x:l.x,y:l.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},e.toDisplayString(l.text),13,Xr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(na.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${r}`,x:l.x,y:l.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${r*80}ms`})},e.toDisplayString(l.text),13,Yr))),128)),Ut.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Pa.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`y-secondary-${r}`,x:l.x,y:l.y,"text-anchor":"start","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${r*80}ms`})},e.toDisplayString(l.text),13,jr))),128)):e.createCommentVNode("",!0),It.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:z.value.left+z.value.width/2,y:z.value.bottom+45,"text-anchor":"middle","font-size":"14",fill:"#666"},e.toDisplayString(It.value),9,Kr)):e.createCommentVNode("",!0),bt.value?(e.openBlock(),e.createElementBlock("text",{key:3,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(bt.value),9,Gr)):e.createCommentVNode("",!0),Ut.value&&Yt.value?(e.openBlock(),e.createElementBlock("text",{key:4,x:ye.value-15,y:z.value.top+12+z.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(90, ${ye.value-15}, ${z.value.top+z.value.height/2})`},e.toDisplayString(Yt.value),9,Qr)):e.createCommentVNode("",!0)]),rn.value.length>0?(e.openBlock(),e.createElementBlock("g",Jr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rn.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":_e.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:r=>bo(l,r),onMouseleave:wo},null,40,ti)):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:r=>bo(l,r),onMouseleave:wo},null,40,li)):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:r=>bo(l,r),onMouseleave:wo},null,40,ni)):e.createCommentVNode("",!0)],8,ei),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:r=>bo(l,r),onMouseleave:wo},null,40,oi)):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:r=>bo(l,r),onMouseleave:wo},null,40,ai),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,si)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":_e.value},[Pl.value?(e.openBlock(),e.createElementBlock("g",ii,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":al.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ca.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${r}`},[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:m=>Pn(l,m),onMouseleave:bn},null,46,ci)):(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:m=>Pn(l,m),onMouseleave:bn},null,46,ui))],64))),128))],2),e.createElementVNode("g",di,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ya.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?nt.value+2:nt.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,mi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ka.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?nt.value+2:nt.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,pi))),128)),te.value>0||K.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Za.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${r}`,cx:l.x,cy:l.y,r:ce(l.isHighlighted?Q(l,te.value)+2:Q(l,te.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:m=>Pn(l,m),onMouseleave:bn},null,46,vi))),128)):e.createCommentVNode("",!0)])])):ge.value==="line"?(e.openBlock(),e.createElementBlock("g",fi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${r}`,d:l.path,stroke:l.color,"stroke-width":nt.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,hi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ya.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?nt.value+2:nt.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,gi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ka.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?nt.value+2:nt.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,yi))),128)),te.value>0||K.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(qa.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${r}`,cx:l.x,cy:l.y,r:ce(l.isHighlighted?Q(l,te.value)+2:Q(l,te.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:m=>Pn(l,m),onMouseleave:bn},null,46,ki))),128)):e.createCommentVNode("",!0)])):ge.value==="area"?(e.openBlock(),e.createElementBlock("g",Ci,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ra.value,(l,r)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${r}`,id:`area-mask-${r}-${S.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,wi)],8,bi))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ra.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${r}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?Ve.value+.2:Ve.value,mask:`url(#area-mask-${r}-${S.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,xi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ra.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${r}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?nt.value+1:nt.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:`${r*ul.value}ms`})},null,14,Ei))),128))])):ge.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":al.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ca.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${r}`},[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:m=>Pn(l,m),onMouseleave:bn},null,46,Si)):(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:m=>Pn(l,m),onMouseleave:bn},null,46,Vi))],64))),128))],2)):e.createCommentVNode("",!0)],8,ri),je.value&&$.value.show&&!U.value.isZooming&&!jt.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-crosshair","clip-path":_e.value},[e.createElementVNode("line",{x1:$.value.x,x2:$.value.x,y1:z.value.top,y2:z.value.bottom,stroke:Ge.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Bi),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${r}`,cx:$.value.x,cy:l.y,r:ce(te.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,Mi))),128))],8,Ni)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),el.value?(e.openBlock(),e.createElementBlock("g",_i,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ho.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${r}`},[l?(e.openBlock(),e.createElementBlock("g",$i,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:ce(l.radius),fill:l.color,"fill-opacity":Ya(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(Ka(l,r)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:m=>wa(l,m),onMouseleave:m=>Ea(l),onClick:m=>ba(l,m)},null,42,Li),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-${r} ${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:ja(l)}),onLoad:m=>F(r),onError:m=>P(r),onMouseenter:m=>wa(l,m),onMouseleave:m=>Ea(l),onClick:m=>ba(l,m)},null,46,Ti)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),Cl.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:Lo.value},[ge.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Lt.value,cy:Ct.value,r:vt.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,Di)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":ge.value,"clip-path":i.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ua.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${l.originalIndex}-${r}`,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":Ao(l.originalIndex),class:e.normalizeClass({"dss-series-highlighted":l.segment.isHighlighted,"dss-series-dimmed":l.segment.isDimmed,"dss-series-hidden":l.segment.isHidden}),onMouseover:m=>Pn(l.segment,m),onMouseleave:bn},null,42,Ri))),128))],8,Hi),Il.value&&da.value?(e.openBlock(),e.createElementBlock("g",Fi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yn.value,(l,r)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${r}`,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,Ii)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),Hn.value&&(da.value||xl.value||Kn.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:Xn.value.x,y:Xn.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":wl.value,fill:sn.value,class:"dss-radial-data-center"},e.toDisplayString(xn.value),9,zi)):e.createCommentVNode("",!0),Ba.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Io.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xa.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${r}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":l.isHighlighted,"dss-label-dimmed":l.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${r*.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,Pi),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,Oi),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":Fl.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,Wi)],6))),128))],2)):e.createCommentVNode("",!0)],8,Ai)):e.createCommentVNode("",!0),gl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:Lo.value},[pe.value?(e.openBlock(),e.createElementBlock("g",Zi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(se.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${r}`,cx:Lt.value,cy:Ct.value,r:ce(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*150}ms`})},null,12,Ui))),128)),e.createElementVNode("g",Xi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(se.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${r}`},[e.createElementVNode("rect",{x:Lt.value-16,y:Ct.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Yi),e.createElementVNode("text",{x:Lt.value,y:Ct.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(De(r)),9,ji)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Sa.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${r}`,x1:Lt.value,x2:l.x,y1:Ct.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},null,12,Ki))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Gi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ts.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${r}`,x:l.x+Math.cos(r*2*Math.PI/no.value-Math.PI/2)*16,y:l.y+Math.sin(r*2*Math.PI/no.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:`${r*120}ms`})},e.toDisplayString(l.text.charAt(0).toUpperCase()+l.text.slice(1)),13,Qi))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:as,onMouseleave:bn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Va.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${r}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":ns("current",l,r),stroke:l.color,"stroke-width":l.isHighlighted?nt.value+1:nt.value,"stroke-dasharray":l.strokeDasharray||void 0,"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:`${r*ul.value}ms`,transition:"all 0.2s ease"})},null,14,Ji),l.pointRadius>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.dataPoints,(m,v)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${r}-${v}`,cx:m.x,cy:m.y,r:ce(l.isHighlighted?l.pointRadius+1:l.pointRadius),fill:l.isComparison?"none":l.color,stroke:l.isComparison?l.color:"none","stroke-width":l.isComparison?2:0,class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${r*ul.value+v*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>Pn(m,C),onMouseleave:bn},null,46,ec))),128)):e.createCommentVNode("",!0)]))),128))],32)],8,qi)):e.createCommentVNode("",!0),e.createElementVNode("g",tc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ro.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${r}`,cx:l.x,cy:l.y,r:ce(l.width/2),fill:Kt(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${r}`),style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,14,lc))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ro.value,(l,r)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${r}`,x:l.x-l.width/2,y:l.y-l.height/2,width:l.width,height:l.height,"xlink:href":l.url,onLoad:m=>ss(r),onError:m=>rs(r),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${r}`),"clip-path":`circle(${l.width/2}px at ${l.width/2}px ${l.height/2}px)`,style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,46,nc))),128))])],8,_r)),jt.value&&Ul.value.length?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-stepbar-chart-host",style:e.normalizeStyle(dn.value)},[e.createElementVNode("div",{ref_key:"stepbarScrollEl",ref:H,class:"dss-stepbar-scroll",onScroll:Xo},[e.createElementVNode("div",{class:"dss-stepbar-scroll-content",style:e.normalizeStyle(Al.value)},[yt.value?(e.openBlock(),e.createElementBlock("div",oc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tl.value,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`stepbar-grid-${r}`,class:"dss-stepbar-grid-line",style:e.normalizeStyle({top:`${l.top}px`,borderTopColor:Et.value,borderTopWidth:`${$t.value}px`,borderTopStyle:"dashed",opacity:xt.value})},null,4))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-stepbar-columns",style:e.normalizeStyle({gap:`${kt.value}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ul.value,l=>(e.openBlock(),e.createBlock(Ta,{key:l.key,class:"dss-stepbar-chart-column",style:e.normalizeStyle(cl.value),label:l.label,segments:l.segments,"total-value":l.totalValue,"show-counter":!1,"value-label":ll.value,orientation:"vertical","label-position":"down","bar-height":Ll.value,"segment-order":B.value,"remainder-label":ie.value,"inactive-color":re.value,options:un.value,"disable-tooltips":""},null,8,["style","label","segments","total-value","value-label","bar-height","segment-order","remainder-label","inactive-color","options"]))),128))],4),Wn.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-stepbar-crosshair-line",style:e.normalizeStyle(Ln.value)},null,4)):e.createCommentVNode("",!0)],4)],544)],4)):e.createCommentVNode("",!0)]),Mt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:ye.value+"px",height:Te.value+"px",backgroundImage:`url('${Jt.value}')`,backgroundRepeat:"no-repeat",...pn.value,opacity:wn.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qt.value,(l,r)=>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:Tt.value+"px",height:Tt.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(m=>ea(l),["stop"]),onMouseenter:m=>Qa(l,m),onMouseleave:Ja},[e.createElementVNode("img",{src:Vo(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,sc)],44,ac)),[[e.vShow,Bl.value]])),128)),x.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:x.value.x+"px",top:x.value.y+"px"})},[e.createElementVNode("div",rc,e.toDisplayString(x.value.categoryValue),1),x.value.description?(e.openBlock(),e.createElementBlock("div",ic,e.toDisplayString(x.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Ce.value&&(h.value.show||je.value&&$.value.show&&!U.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":je.value&&$.value.show&&!U.value.isZooming,"dss-spider-tooltip":gl.value&&h.value.spiderAreas&&h.value.spiderAreas.length>0}]),style:e.normalizeStyle(is.value)},[!je.value||!$.value.show||U.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[gl.value&&h.value.spiderAreas&&h.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",cc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.spiderAreas,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${r}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",uc,[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,(m,v)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${r}-${v}`,class:"dss-tooltip-series"},[e.createElementVNode("span",dc,e.toDisplayString(m.label),1),e.createElementVNode("span",mc,e.toDisplayString(m.value),1)]))),128))]))),128))])):el.value&&h.value.bubbleData&&h.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",pc,[h.value.title?(e.openBlock(),e.createElementBlock("div",vc,e.toDisplayString(h.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.bubbleData,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${r}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",hc,[e.createElementVNode("div",gc,e.toDisplayString(h.value.title),1),e.createElementVNode("div",yc,e.toDisplayString(h.value.value),1)])),h.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Rl(h.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",kc,[o[5]||(o[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Cc,e.toDisplayString(e.unref(L)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rl(h.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${r}`},[e.createElementVNode("div",bc,[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,(m,v)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${r}-${v}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",wc,[e.createElementVNode("div",xc,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Rl(h.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Ec,[o[6]||(o[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Sc,e.toDisplayString(e.unref(L)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rl(h.value.categoryIndex).markers,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${r}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",Vc,[e.createElementVNode("div",Nc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",Bc,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",Mc,[e.createElementVNode("div",_c,e.toDisplayString(jt.value?Yo():el.value?Ga():S.categories[$.value.categoryIndex]||`Category ${$.value.categoryIndex+1}`),1),el.value?(e.openBlock(),e.createElementBlock("div",$c,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${r}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList($.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${r}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",Lc,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",Tc,e.toDisplayString(Bt(l.value)),1)]))),128))]),Rl($.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Ac,[o[7]||(o[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Dc,e.toDisplayString(e.unref(L)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rl($.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${r}`},[e.createElementVNode("div",Hc,[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,(m,v)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${r}-${v}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Rc,[e.createElementVNode("div",Fc,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Rl($.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Ic,[o[8]||(o[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",zc,e.toDisplayString(e.unref(L)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rl($.value.categoryIndex).markers,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${r}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",Pc,[e.createElementVNode("div",Oc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",Wc,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),kl.value&&Vt.value&&U.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Bn},[o[9]||(o[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(U.value.scale*100))+"% "+e.toDisplayString(e.unref(L)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,yr),A.value&&X.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":ae.value==="horizontal","dss-legend-vertical":ae.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(V.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":st.value.has(r),"dss-legend-hovered":Ne.value===r,"dss-legend-dimmed":Ne.value!==null&&Ne.value!==r}]),onClick:m=>ia(r),onMouseenter:m=>uo(r),onMouseleave:Jn,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":gl.value&&we(l)}]),style:e.normalizeStyle({backgroundColor:gl.value&&we(l)?"transparent":Zt(l,r),borderColor:Zt(l,r)})},null,6),e.createElementVNode("span",Zc,e.toDisplayString(l.name),1)],46,qc))),128))],2)):e.createCommentVNode("",!0),Y.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:Y.value.x+"px",top:Y.value.y+"px"}),onClick:o[0]||(o[0]=e.withModifiers(()=>{},["stop"]))},[Ze.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:In},e.toDisplayString(e.unref(L)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Ze.value.addMarker&&(Ze.value.downloadSvg||Ze.value.downloadPng||Ze.value.downloadCsv||Je.value.length>0)?(e.openBlock(),e.createElementBlock("div",Uc)):e.createCommentVNode("",!0),Ze.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:No},e.toDisplayString(e.unref(L)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Ze.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Bo},e.toDisplayString(e.unref(L)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Ze.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:En},e.toDisplayString(e.unref(L)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Je.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Ze.value.downloadSvg||Ze.value.downloadPng||Ze.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Xc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+r},[l.separator?(e.openBlock(),e.createElementBlock("div",Yc)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Eo(l)),style:e.normalizeStyle(So(l)),onClick:m=>Sn(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:jo(l),class:"dss-custom-menu-content"},null,8,Kc)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",Gc,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,jc)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Se.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:en},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:o[3]||(o[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Qc,[e.createElementVNode("h3",null,e.toDisplayString(vn.value?e.unref(L)("chart.modalMarker.viewMarker"):ql.value?e.unref(L)("chart.modalMarker.editMarker"):e.unref(L)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:en},"×")]),e.createElementVNode("div",Jc,[e.createElementVNode("div",eu,[e.createVNode(pa,{id:"dss-marker-date",mode:"single",modelValue:Se.value.date,"onUpdate:modelValue":o[1]||(o[1]=l=>Se.value.date=l),"min-date":zl.value,"max-date":Wl.value,disabled:vn.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",tu,[e.createElementVNode("label",lu,e.toDisplayString(e.unref(L)("chart.modalMarker.description")),1),vn.value?(e.openBlock(),e.createElementBlock("div",nu,e.toDisplayString(Se.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":o[2]||(o[2]=l=>Se.value.description=l),placeholder:e.unref(L)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,ou)),[[e.vModelText,Se.value.description]])])]),e.createElementVNode("div",au,[e.createElementVNode("div",su,[ql.value&&!vn.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:eo},e.toDisplayString(e.unref(L)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ru,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:en},e.toDisplayString(vn.value?e.unref(L)("chart.modalMarker.close"):e.unref(L)("chart.modalMarker.cancel")),1),vn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:Fn,disabled:!(Se.value.description&&Se.value.description.length)},e.toDisplayString(ql.value?e.unref(L)("chart.modalMarker.save"):e.unref(L)("chart.contextMenu.addMarker")),9,iu))])])])])):e.createCommentVNode("",!0)],64))}}),du={class:"dss-modal-title"},mu={class:"dss-modal-actions"},ma={__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(S,{emit:ee}){const L=S,N=ee,ue=e.ref(null),O=e.ref(null),H=e.computed(()=>{const j={"max-width":L.width};return L.height!=="auto"&&(j.height=L.height,j["min-height"]="0"),j}),me=e.computed(()=>({}));function ot(){N("close-modal")}function ne(){L.backDrop&&!ue.value&&N("close-modal")}function f(j){j.target.tagName==="INPUT"&&(ue.value=j.target.tagName)}function be(){setTimeout(()=>{ue.value=null},300)}function he(){const j=document.body,fe=document.documentElement;O.value={bodyOverflow:j.style.overflow,bodyPosition:j.style.position,bodyTop:j.style.top,bodyWidth:j.style.width,htmlOverflow:fe.style.overflow,scrollY:window.scrollY},j.style.overflow="hidden",j.style.position="fixed",j.style.top=`-${O.value.scrollY}px`,j.style.width="100%",j.style.left="0",fe.style.overflow="hidden"}function oe(){if(!O.value)return;const j=document.body,fe=document.documentElement,{bodyOverflow:_e,bodyPosition:V,bodyTop:$e,bodyWidth:lt,htmlOverflow:rt,scrollY:Qe}=O.value;j.style.overflow=_e||"",j.style.position=V||"",j.style.top=$e||"",j.style.width=lt||"",j.style.left="",fe.style.overflow=rt||"",window.scrollTo(0,Qe||0)}return e.watch(()=>L.showModal,j=>{if(j)he(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const fe=document.getElementById("dss-modal-backdrop");fe&&(fe.addEventListener("focusin",f),fe.addEventListener("focusout",be))},100);else{oe(),document.body.classList.remove("dss-modal-open");const fe=document.getElementById("dss-modal-backdrop");fe&&(fe.removeEventListener("focusin",f),fe.removeEventListener("focusout",be))}},{immediate:!0}),e.onUnmounted(()=>{L.showModal&&oe()}),(j,fe)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[S.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:ne},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(H.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:fe[0]||(fe[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":S.headerType,"font-size":S.titleSize})},[e.createElementVNode("h1",du,[e.renderSlot(j.$slots,"title",{},()=>[fe[1]||(fe[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(j.$slots,"title-data"),S.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:ot,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(me.value)},[e.renderSlot(j.$slots,"content",{},()=>[fe[2]||(fe[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",mu,[e.renderSlot(j.$slots,"actions")])])],4),[[e.vShow,S.showModal]])])):e.createCommentVNode("",!0)]))}},pu={key:0,class:"dss-table-toolbar"},vu={class:"dss-table-toolbar-left"},fu=["aria-expanded"],hu={class:"dss-pagination-select-dropdown",role:"listbox"},gu={class:"dss-table-column-visibility-label"},yu={class:"dss-table-checkbox-wrapper"},ku=["checked","onChange"],Cu={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},bu={class:"dss-table-column-visibility-text"},wu={class:"dss-table-toolbar-right"},xu=["placeholder","aria-label"],Eu=["aria-label"],Su=["aria-label","aria-expanded"],Vu={key:1,class:"dss-table-toolbar-extra"},Nu={class:"dss-table-thead"},Bu={key:0,class:"dss-table-th dss-table-selection-column"},Mu={key:0,class:"dss-table-checkbox-wrapper"},_u=["checked","indeterminate"],$u={key:0,class:"dss-table-checkbox__indeterminate"},Lu={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Tu=["aria-label"],Au=["onClick"],Du={class:"dss-table-th-content"},Hu={class:"dss-table-th-text"},Ru={key:0},Fu={key:1},Iu={key:2},zu=["data-filter-column-key","aria-expanded","aria-label","onClick"],Pu={class:"dss-table-tbody"},Ou=["onClick"],Wu={class:"dss-table-checkbox-wrapper"},qu=["type","name","checked","disabled","onChange"],Zu={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Uu={key:1,class:"dss-table-checkbox__dot"},Xu=["onClick"],Yu=["aria-expanded","aria-label"],ju={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},Ku={key:0,class:"dss-table-expansion-row"},Gu=["colspan"],Qu=["colspan"],Ju={key:1,class:"dss-table-pagination"},ed={class:"dss-table-pagination-left"},td={key:0},ld={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},nd={class:"dss-table-pagination-center"},od={key:0,class:"dss-pagination-controls"},ad=["disabled","title"],sd=["disabled","title"],rd=["aria-label","onKeydown"],id={class:"dss-pagination-of"},cd=["disabled","title"],ud=["disabled","title"],dd={class:"dss-table-pagination-right"},md={class:"dss-pagination-rows-label"},pd=["aria-expanded"],vd=["aria-selected","onClick"],fd={key:0,class:"dss-table-filter-row"},hd=["value","placeholder"],gd=["min","max","value"],yd=["min","max","value"],kd={class:"dss-table-filter-double-range-values"},Cd={key:2,class:"dss-table-filter-daterange"},bd={class:"dss-table-filter-daterange-row"},wd={class:"dss-table-filter-daterange-label"},xd=["value"],Ed={class:"dss-table-filter-daterange-row"},Sd={class:"dss-table-filter-daterange-label"},Vd=["value"],Nd=["value","placeholder"],Bd={class:"dss-table-filter-list"},Md=["checked","onChange"],_d={class:"dss-table-filter-actions"},$d={name:"DSSTable"},Ld=Object.assign($d,{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:S=>typeof S=="object"&&S!==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(S,{emit:ee}){const{t:L,locale:N}=so.useI18n(),ue=S,O=ee,H={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 me(y,h){const x=Object.assign({},y);return ot(y)&&ot(h)&&Object.keys(h).forEach($=>{ot(h[$])?$ in y?x[$]=me(y[$],h[$]):Object.assign(x,{[$]:h[$]}):Object.assign(x,{[$]:h[$]})}),x}function ot(y){return y&&typeof y=="object"&&!Array.isArray(y)}const ne=e.computed(()=>me(H,ue.options)),f=e.computed(()=>{const y=ne.value.table.width;return y==="auto"?null:typeof y=="number"?y:null}),be=e.computed(()=>ne.value.table.height),he=e.computed(()=>ne.value.table.rowHeight??"auto"),oe=e.computed(()=>({height:he.value})),j=e.computed(()=>ne.value.table.expandable===!0),fe=e.computed(()=>ne.value.table.expandableRowData??null),_e=e.computed(()=>ne.value.table.expandableRowCondition??null),V=e.computed(()=>ne.value.table.truncated===!0),$e=e.computed(()=>ne.value.table.striped),lt=e.computed(()=>ne.value.table.bordered),rt=e.computed(()=>ne.value.table.hoverable),Qe=e.computed(()=>ne.value.table.size),Z=e.computed(()=>ne.value.table.align||"left");e.computed(()=>ne.value.title.text),e.computed(()=>ne.value.subtitle.text);const qe=e.computed(()=>ne.value.selection.enabled),ze=e.computed(()=>ne.value.selection.mode),ye=e.computed(()=>ne.value.selection.rowCondition??null),Ue=e.computed(()=>ne.value.sorting.enabled),ke=e.computed(()=>ne.value.sorting.mode),Te=e.computed(()=>ne.value.pagination.enabled),at=e.computed(()=>ne.value.pagination.rows),ge=e.computed(()=>ne.value.pagination.rowsPerPageOptions),Ft=e.computed(()=>ne.value.pagination.showCounter!==!1),dt=e.computed(()=>ne.value.pagination.showControlsGroup),Ye=e.computed(()=>dt.value===!1?!1:ne.value.pagination.showControls!==!1),Pt=e.computed(()=>dt.value===!1?!1:ne.value.pagination.showRowsPerPage!==!1),It=e.computed(()=>Te.value&&(Ft.value||Ye.value||Pt.value)),bt=e.computed(()=>ne.value.scrollable),ft=e.computed(()=>ne.value.emptyMessage||L("table.emptyMessage")),Yt=e.computed(()=>ne.value.toolbar?.downloads?.pdf!==!1),it=e.computed(()=>ne.value.toolbar?.downloads?.excel!==!1),At=e.computed(()=>ne.value.toolbar?.search!==!1),ht=e.computed(()=>Yt.value||it.value||At.value||il.value),il=e.computed(()=>ne.value.toolbar?.columnVisibility!==!1),St=e.ref(""),Dt=e.ref(!1),pe=e.ref(null);let A=null;function X(){Dt.value?(A&&(clearTimeout(A),A=null),Dt.value=!1,St.value="",O("search",""),pe.value?.blur()):(Dt.value=!0,A=setTimeout(()=>{A=null,pe.value?.focus()},80))}function ae(){St.value||(Dt.value=!1)}function Ce(){St.value="",O("search",""),pe.value?.focus()}const je=e.computed(()=>({"dss-table-striped":$e.value,"dss-table-bordered":lt.value,"dss-table-hoverable":rt.value,[`dss-table-${Qe.value}`]:Qe.value!=="default","dss-table-truncated":V.value})),Ge=(y,h)=>y?.field??y?.key??h,Vt=e.ref(new Set);function Pe(){const y=new Set;return ue.columns.forEach((h,x)=>{h?.hidden!==!0&&y.add(Ge(h,x))}),y}function Ke(){const y=new Set;return ue.columns.forEach((h,x)=>{y.add(Ge(h,x))}),y}function nt(y){if(!Array.isArray(y))return null;const h=Ke(),x=[];return y.forEach($=>{h.has($)&&x.push($)}),x}function qt(){Vt.value=Pe()}const te=e.computed(()=>{const y=nt(ue.columnVisibility);return y===null?null:new Set(y)}),K=e.computed(()=>te.value??Vt.value),Q=e.computed(()=>ue.columns.filter((y,h)=>K.value.has(Ge(y,h)))),ce=y=>{const h=ue.columns.findIndex(x=>x===y);return Ge(y,h>=0?h:0)},Ve=(y,h)=>K.value.has(Ge(y,h));function We(y){O("update:columnVisibility",Array.from(y))}function Nt(y,h){const x=Ge(y,h),$=new Set(K.value);$.has(x)?$.delete(x):$.add(x),te.value===null&&(Vt.value=$),We($)}const Ot=e.ref(null),pt=e.ref(!1);function wt(y){Ot.value&&!Ot.value.contains(y.target)&&(pt.value=!1)}const B=e.computed(()=>Q.value.length+(qe.value?1:0)+(j.value?1:0)),w=(y,h)=>y?.id??y?.key??h,T=e.ref(new Set),ie=e.ref(null),re=(y,h)=>T.value.has(w(y,h)),He=(y,h)=>{if(!j.value)return!1;if(typeof _e.value=="function")return!!_e.value(y,h);if(typeof fe.value=="string"&&fe.value.trim()){const x=Xl(y,fe.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(),!He(y,h))return;const $=w(y,h),Y=new Set(T.value);Y.has($)?(Y.delete($),O("row-collapse",{data:y,index:h})):(Y.add($),O("row-expand",{data:y,index:h})),T.value=Y},et=(y,h)=>{if(!V.value)return;const x=w(y,h);ie.value!==x&&(ie.value=x)},Ae=e.ref(null),yt=e.ref(0),Et=e.ref([]),xt=y=>{if(ke.value==="single")return Ae.value===y.field?yt.value:0;{const h=Et.value.find(x=>x.field===y.field);return h?h.order:0}},$t=y=>{const h=xt(y);return{"dss-sort-active":h!==0,"dss-sort-asc":h===1,"dss-sort-desc":h===-1}},Ht=e.ref({}),kt=e.ref(null),Gt=e.ref(null),Ll=220,hl=e.ref(null),Nl=e.computed(()=>Q.value.find(y=>ce(y)===kt.value)??null),cl=e.computed(()=>{if(!Nl.value||Nl.value.filter!=="range")return null;const y=Nl.value,h=kt.value,{min:x,max:$}=Tn(y),Y=y.filterMin??x,U=y.filterMax??$,tt=Tl(h),Se=tt.min??Y,zl=tt.max??U,Wl=U-Y,ql=Wl===0?0:(Se-Y)/Wl*100,vn=Wl===0?100:(zl-Y)/Wl*100;return{rangeMin:Y,rangeMax:U,currentMin:Se,currentMax:zl,minPct:ql,maxPct:vn}}),nn=e.ref(null),un=e.ref("max");function Ul(y){const h=nn.value,x=cl.value;if(!h||!x)return;const $=h.getBoundingClientRect(),U=(y.clientX-$.left)/$.width*100,tt=(x.minPct+x.maxPct)/2;un.value=U<tt?"min":"max"}function Tl(y){return Ht.value[y]??{}}function dn(y,h){Ht.value={...Ht.value,[y]:h}}function Al(y){const h=Ht.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 Wn(y){const h={...Ht.value};delete h[y],Ht.value=h,kt.value=null,Gt.value=null}function Ln(){if(!kt.value){Gt.value=null;return}const y=hl.value;if(!y)return;const h=y.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${kt.value}"]`);if(!h)return;const x=h.getBoundingClientRect();Gt.value={top:x.bottom+6,left:Math.max(8,x.right-Ll)}}const El=e.computed(()=>{const y=String(St.value??"").trim().toLowerCase();return y?ue.data.filter(h=>Q.value.some(x=>Dl(Jl(h,x)).some(Y=>String(Y).toLowerCase().includes(y)))):ue.data}),on=e.computed(()=>{let y=[...El.value];const h=(St.value??"").trim().toLowerCase();return h&&(y=y.filter(x=>ue.columns.some($=>{if(!$||!$.field)return!1;const Y=Jl(x,$);return String(Y??"").toLowerCase().includes(h)}))),Q.value.forEach(x=>{const $=ce(x),Y=Ht.value[$];if(!Y)return;const U=x.field;if(U){if(Y.type==="string"&&Y.value?.trim()){const tt=Y.value.trim().toLowerCase();y=y.filter(Se=>{const zl=Jl(Se,x);return String(zl??"").toLowerCase().includes(tt)})}else if(Y.type==="range")y=y.filter(tt=>{const Se=Xl(tt,U),zl=Number(Se);return!(Number.isNaN(zl)||Y.min!=null&&zl<Y.min||Y.max!=null&&zl>Y.max)});else if(Y.type==="dateRange"){const tt=Y.from?new Date(Y.from).getTime():null,Se=Y.to?new Date(Y.to).getTime():null;y=y.filter(zl=>{const Wl=Xl(zl,U),ql=Wl?new Date(Wl).getTime():NaN;return!(Number.isNaN(ql)||tt!=null&&ql<tt||Se!=null&&ql>Se)})}else if(Y.type==="list"&&Y.selected?.length){const tt=new Set(Y.selected);y=y.filter(Se=>Dl(Jl(Se,x)).some(Wl=>tt.has(Wl)))}}}),y});function Dl(y){if(y==null)return[""];if(Array.isArray(y))return y.flatMap(Dl);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 Ol(y){const h=new Set;return ue.data.forEach(x=>{Dl(Jl(x,y)).forEach(Y=>h.add(Y))}),Array.from(h).sort((x,$)=>String(x).localeCompare(String($)))}function Hl(y,h){if(kt.value===y){kt.value=null,Gt.value=null;return}if(kt.value=y,h?.currentTarget){const x=h.currentTarget.getBoundingClientRect();Gt.value={top:x.bottom+6,left:Math.max(8,x.right-Ll)}}else Ln()}function ul(y,h){dn(y,{type:"string",value:h})}function Tn(y){const h=y.field;if(!h)return{min:0,max:100};let x=1/0,$=-1/0;return ue.data.forEach(Y=>{const U=Xl(Y,h),tt=Number(U);Number.isNaN(tt)||(x=Math.min(x,tt),$=Math.max($,tt))}),{min:x===1/0?0:x,max:$===-1/0?100:$}}function R(y,h,x){const $={...Tl(y),type:"range"},Y=x===""?null:Number(x),U=Y===null||Number.isNaN(Y)?null:Y;$[h]=U,U!=null&&(h==="min"&&$.max!=null&&U>$.max&&($.max=U),h==="max"&&$.min!=null&&U<$.min&&($.min=U)),dn(y,$)}function W(y,h,x){const $={...Tl(y),type:"dateRange"};$[h]=x||"",dn(y,$)}const D=e.reactive({});function se(y,h){D[y]=h}function De(y){const h=ce(y),x=(D[h]??"").trim().toLowerCase(),$=Ol(y);return x?$.filter(Y=>String(Y).toLowerCase().includes(x)):$}function mt(y,h){return(Tl(y).selected??[]).includes(h!=null?String(h):"")}function ut(y,h){const $=[...Tl(y).selected??[]],Y=h!=null?String(h):"",U=$.indexOf(Y);U>=0?$.splice(U,1):$.push(Y),dn(y,{type:"list",selected:$})}function Ze(y){kt.value&&!y.target.closest(".dss-table-filter-wrap")&&!y.target.closest(".dss-table-filter-dropdown")&&(kt.value=null,Gt.value=null)}function Je(){Ln(),Bt.value&&_l()}const dl=y=>{if(!(y.sortable===!1||!Ue.value))if(ke.value==="single")Ae.value===y.field?yt.value=yt.value===1?-1:yt.value===-1?0:1:(Ae.value=y.field,yt.value=1),yt.value===0&&(Ae.value=null),O("sort",{field:Ae.value,order:yt.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}),O("sort",{multiSortMeta:Et.value})}},ml=e.computed(()=>{if(!Ue.value)return on.value;let y=[...on.value];return ke.value==="single"&&Ae.value&&yt.value!==0?y.sort((h,x)=>{const $=Xl(h,Ae.value),Y=Xl(x,Ae.value);return $===Y?0:$==null?1:Y==null?-1:($<Y?-1:$>Y?1:0)*yt.value}):ke.value==="multiple"&&Et.value.length>0&&y.sort((h,x)=>{for(const $ of Et.value){const Y=Xl(h,$.field),U=Xl(x,$.field);if(Y===U)continue;if(Y==null)return 1;if(U==null)return-1;const tt=Y<U?-1:Y>U?1:0;if(tt!==0)return tt*$.order}return 0}),y}),Tt=e.ref(0),ll=e.ref(at.value),Bt=e.ref(!1),Bl=e.ref(null),mn=e.ref(null),Qt=e.ref("bottom"),Mt=e.ref(null),wn=y=>{ll.value=y,Bt.value=!1,Tt.value=0,O("page",{page:0,rows:ll.value})};function An(y){Bl.value&&!Bl.value.contains(y.target)&&(Bt.value=!1)}function _l(){const y=Bl.value,h=mn.value;if(!y||!h)return;const x=y.querySelector(".dss-pagination-select-dropdown");if(!x)return;const $=h.getBoundingClientRect(),Y=x.offsetHeight||0,tt=(window.innerHeight||document.documentElement.clientHeight)-$.bottom,Se=$.top;Qt.value=tt<Y+8&&Se>tt?"top":"bottom",Mt.value={width:`${Math.ceil($.width)}px`,left:`${Math.max(0,Math.round(h.offsetLeft))}px`}}const an=e.computed(()=>ml.value.length),pn=e.computed(()=>Math.ceil(an.value/ll.value)),qn=e.computed(()=>Math.max(pn.value,1)),Rl=e.computed(()=>an.value===0?0:Jt.value+1),Ql=e.computed(()=>Dn.value),Jt=e.computed(()=>Te.value?Tt.value*ll.value:0),Dn=e.computed(()=>Te.value?Math.min((Tt.value+1)*ll.value,an.value):an.value),Fl=e.computed(()=>{if(!Te.value)return ml.value;const y=Jt.value,h=Dn.value;return ml.value.slice(y,h)}),Xt=e.ref(new Set),Zn=e.computed(()=>ml.value.filter((y,h)=>Xt.value.has(w(y,h)))),nl=(y,h)=>{const x=ye.value;return typeof x!="function"?!0:!!x(y,h)},Il=e.computed(()=>ml.value.map((y,h)=>({row:y,index:h})).filter(({row:y,index:h})=>nl(y,h))),Un=e.computed(()=>{const y=Il.value;return y.length===0?!1:y.every(({row:h,index:x})=>Xt.value.has(w(h,x)))}),Hn=e.computed(()=>{const y=Il.value;if(y.length===0)return!1;const h=y.filter(({row:x,index:$})=>Xt.value.has(w(x,$))).length;return h>0&&h<y.length}),xn=(y,h)=>Xt.value.has(w(y,h)),wl=()=>{if(Un.value)Xt.value=new Set,O("unselect-all");else{const y=new Set;Il.value.forEach(({row:h,index:x})=>y.add(w(h,x))),Xt.value=y,O("select-all",Zn.value)}},Xn=(y,h)=>{if(!nl(y,h))return;const x=w(y,h),$=new Set(Xt.value),Y=$.has(x);ze.value==="single"?Y?($.delete(x),O("row-unselect",y)):($.clear(),$.add(x),O("row-select",y)):Y?($.delete(x),O("row-unselect",y)):($.add(x),O("row-select",y)),Xt.value=$},sn=e.ref("1"),Yn=()=>{const y=Number.parseInt(String(sn.value),10);if(!Number.isFinite(y)){sn.value=String(Tt.value+1);return}const h=Math.min(qn.value,Math.max(1,y));h!==Tt.value+1?rn(h-1):sn.value=String(h)},rn=y=>{y<0||y>=pn.value||(Tt.value=y,O("page",{page:y,rows:ll.value}))},Rn=(y,h,x)=>{O("row-click",{data:y,index:h,originalEvent:x}),et(y,Jt.value+h)},Sl=(y,h)=>{const x=Jt.value+h;return{"dss-table-row-selected":xn(y,x),"dss-table-row-even":h%2===0,"dss-table-row-odd":h%2!==0,"dss-table-row-truncated-clickable":V.value,"dss-table-row-truncated-expanded":ie.value===w(y,x)}},Jl=(y,h)=>h.field?Xl(y,h.field):"",Xl=(y,h)=>h.split(".").reduce((x,$)=>x&&x[$],y),st=y=>{const h=y.align??Z.value;return{"dss-table-sortable":y.sortable!==!1&&Ue.value,"dss-table-align-left":h==="left","dss-table-align-center":h==="center","dss-table-align-right":h==="right",[y.className]:y.className}},Ne=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!==N.value&&(N.value=y)},{immediate:!0}),e.watch(at,y=>{ll.value=y,Tt.value=0}),e.watch(Bt,async y=>{y&&(await e.nextTick(),_l())}),e.watch(Tt,y=>{sn.value=String(y+1)},{immediate:!0}),e.watch(St,y=>{O("search",y??"")}),e.watch(()=>ue.columns,()=>{if(te.value===null){qt();return}const y=nt(ue.columnVisibility)??[];y.length!==ue.columnVisibility.length&&O("update:columnVisibility",y)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",An),document.addEventListener("click",wt),document.addEventListener("click",Ze),window.addEventListener("resize",Je),window.addEventListener("scroll",Je,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",An),document.removeEventListener("click",wt),document.removeEventListener("click",Ze),window.removeEventListener("resize",Je),window.removeEventListener("scroll",Je,!0)}),(y,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:hl,style:e.normalizeStyle({width:f.value+"px",height:be.value?be.value+"px":"auto"})},[ht.value?(e.openBlock(),e.createElementBlock("div",pu,[e.createElementVNode("div",vu,[Yt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:h[0]||(h[0]=x=>O("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(L)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),it.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:h[1]||(h[1]=x=>O("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(L)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),il.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:Ot},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":pt.value}]),onClick:h[2]||(h[2]=x=>pt.value=!pt.value),"aria-expanded":pt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(L)("table.columnVisibility"))+" ",1),h[24]||(h[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,fu),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",hu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.columns,(x,$)=>(e.openBlock(),e.createElementBlock("li",{key:Ge(x,$),role:"option",class:"dss-table-column-visibility-option",onClick:h[3]||(h[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",gu,[e.createElementVNode("span",yu,[e.createElementVNode("input",{type:"checkbox",checked:Ve(x,$),onChange:Y=>Nt(x,$),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,ku),Ve(x,$)?(e.openBlock(),e.createElementBlock("span",Cu,[...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",bu,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,pt.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(y.$slots,"header")]),e.createElementVNode("div",wu,[At.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Dt.value||St.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:pe,"onUpdate:modelValue":h[4]||(h[4]=x=>St.value=x),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(L)("table.searchPlaceholder"),"aria-label":e.unref(L)("table.searchTableAriaLabel"),onFocus:h[5]||(h[5]=x=>Dt.value=!0),onBlur:ae},null,40,xu),[[e.vModelText,St.value]]),St.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(L)("table.clearSearchAriaLabel"),onClick:Ce},[...h[26]||(h[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,Eu)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(L)("table.searchAriaLabel"),"aria-expanded":Dt.value||!!St.value,onMousedown:e.withModifiers(X,["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,Su)],2)):e.createCommentVNode("",!0),y.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Vu,[e.renderSlot(y.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":bt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",je.value])},[e.createElementVNode("thead",Nu,[e.createElementVNode("tr",null,[qe.value?(e.openBlock(),e.createElementBlock("th",Bu,[ze.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Mu,[e.createElementVNode("input",{type:"checkbox",checked:Un.value,indeterminate:Hn.value,onChange:wl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,_u),Hn.value?(e.openBlock(),e.createElementBlock("span",$u)):Un.value?(e.openBlock(),e.createElementBlock("span",Lu,[...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),j.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(L)("table.expandRowAriaLabel")},null,8,Tu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,(x,$)=>(e.openBlock(),e.createElementBlock("th",{key:ce(x),class:e.normalizeClass(["dss-table-th",st(x)]),style:e.normalizeStyle(Ne(x)),onClick:Y=>dl(x)},[e.createElementVNode("div",Du,[e.createElementVNode("span",Hu,e.toDisplayString(x.header),1),x.sortable!==!1&&Ue.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",$t(x)])},[xt(x)===0?(e.openBlock(),e.createElementBlock("span",Ru,[...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)])])):xt(x)===1?(e.openBlock(),e.createElementBlock("span",Fu,[...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)])])):xt(x)===-1?(e.openBlock(),e.createElementBlock("span",Iu,[...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":kt.value===ce(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":Al(ce(x))}]),"data-filter-column-key":ce(x),"aria-expanded":kt.value===ce(x),"aria-label":e.unref(L)("table.filterColumnAriaLabel"),onClick:Y=>Hl(ce(x),Y)},[...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,zu)],2)):e.createCommentVNode("",!0)])],14,Au))),128))])]),e.createElementVNode("tbody",Pu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fl.value,(x,$)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:w(x,Jt.value+$)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Sl(x,$)]),style:e.normalizeStyle(oe.value),onClick:Y=>Rn(x,$,Y)},[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",Wu,[e.createElementVNode("input",{type:ze.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${S.tableId}`,checked:xn(x,Jt.value+$),disabled:!nl(x,Jt.value+$),onChange:Y=>Xn(x,Jt.value+$),class:e.normalizeClass(["dss-table-checkbox",ze.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!nl(x,Jt.value+$)}])},null,42,qu),ze.value==="multiple"&&xn(x,Jt.value+$)?(e.openBlock(),e.createElementBlock("span",Zu,[...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)])])):ze.value==="single"&&xn(x,Jt.value+$)?(e.openBlock(),e.createElementBlock("span",Uu)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),j.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(Y=>gt(x,Jt.value+$,Y),["stop"])},[He(x,Jt.value+$)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":re(x,Jt.value+$),"aria-label":re(x,Jt.value+$)?e.unref(L)("table.collapseRowAriaLabel"):e.unref(L)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":re(x,Jt.value+$)}]),"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,Yu)):(e.openBlock(),e.createElementBlock("span",ju))],8,Xu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,(Y,U)=>(e.openBlock(),e.createElementBlock("td",{key:ce(Y),class:e.normalizeClass(["dss-table-td",st(Y)]),style:e.normalizeStyle(Ne(Y))},[e.renderSlot(y.$slots,`cell-${Y.field}`,{data:x,column:Y,rowIndex:$,isExpanded:ie.value===w(x,Jt.value+$)},()=>[e.createTextVNode(e.toDisplayString(Jl(x,Y)),1)])],6))),128))],14,Ou),j.value&&He(x,Jt.value+$)&&re(x,Jt.value+$)?(e.openBlock(),e.createElementBlock("tr",Ku,[e.createElementVNode("td",{colspan:B.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(y.$slots,"expansion",{data:x,rowIndex:$})],8,Gu)])):e.createCommentVNode("",!0)],64))),128)),Fl.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(oe.value)},[e.createElementVNode("td",{colspan:B.value,class:"dss-table-empty-cell"},[e.renderSlot(y.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(ft.value),1)])],8,Qu)],4))])],2)],2),It.value?(e.openBlock(),e.createElementBlock("div",Ju,[e.createElementVNode("div",ed,[Ft.value?(e.openBlock(),e.createElementBlock("span",td,e.toDisplayString(e.unref(L)("table.showingRange",{start:Rl.value,end:Ql.value,total:an.value})),1)):(e.openBlock(),e.createElementBlock("span",ld," "))]),e.createElementVNode("div",nd,[Ye.value?(e.openBlock(),e.createElementBlock("div",od,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Tt.value===0,onClick:h[8]||(h[8]=x=>rn(0)),title:e.unref(L)("table.firstPage")},[...h[35]||(h[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,ad),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Tt.value===0,onClick:h[9]||(h[9]=x=>rn(Tt.value-1)),title:e.unref(L)("table.previousPage")}," ‹ ",8,sd),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[10]||(h[10]=x=>sn.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(L)("table.currentPageAriaLabel"),onBlur:Yn,onKeydown:e.withKeys(e.withModifiers(Yn,["prevent"]),["enter"])},null,40,rd),[[e.vModelText,sn.value]]),e.createElementVNode("span",id,e.toDisplayString(e.unref(L)("table.ofPages",{total:qn.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Tt.value>=pn.value-1,onClick:h[11]||(h[11]=x=>rn(Tt.value+1)),title:e.unref(L)("table.nextPage")}," › ",8,cd),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Tt.value>=pn.value-1,onClick:h[12]||(h[12]=x=>rn(pn.value-1)),title:e.unref(L)("table.lastPage")},[...h[36]||(h[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,ud)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",dd,[Pt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Bl},[e.createElementVNode("span",md,e.toDisplayString(e.unref(L)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Bt.value}]),onClick:h[13]||(h[13]=x=>Bt.value=!Bt.value),"aria-expanded":Bt.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:mn},[e.createTextVNode(e.toDisplayString(ll.value)+" ",1),h[37]||(h[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,pd),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":Qt.value==="top"}]),style:e.normalizeStyle(Mt.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===ll.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===ll.value}]),onClick:$=>wn(x)},e.toDisplayString(x),11,vd))),128))],6),[[e.vShow,Bt.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(Gt.value?{top:Gt.value.top+"px",left:Gt.value.left+"px",width:Ll+"px"}:void 0),onClick:h[21]||(h[21]=e.withModifiers(()=>{},["stop"]))},[Nl.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Nl.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",fd,[e.createElementVNode("input",{type:"text",value:Tl(kt.value).value??"",onInput:h[14]||(h[14]=x=>ul(kt.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(L)("table.search")},null,40,hd)])):Nl.value.filter==="range"&&cl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":cl.value.minPct+"%","--range-max-pct":cl.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:nn,class:"dss-table-filter-double-range-track",onMousemove:Ul,onMouseenter:Ul},[e.createElementVNode("input",{type:"range",min:cl.value.rangeMin,max:cl.value.rangeMax,value:cl.value.currentMin,onInput:h[15]||(h[15]=x=>R(kt.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:un.value==="min"?2:1})},null,44,gd),e.createElementVNode("input",{type:"range",min:cl.value.rangeMin,max:cl.value.rangeMax,value:cl.value.currentMax,onInput:h[16]||(h[16]=x=>R(kt.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:un.value==="max"?2:1})},null,44,yd)],544),e.createElementVNode("div",kd,e.toDisplayString(cl.value.currentMin)+" – "+e.toDisplayString(cl.value.currentMax),1)],4)):Nl.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Cd,[e.createElementVNode("div",bd,[e.createElementVNode("label",wd,e.toDisplayString(e.unref(L)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:Tl(kt.value).from??"",onInput:h[17]||(h[17]=x=>W(kt.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,xd)]),e.createElementVNode("div",Ed,[e.createElementVNode("label",Sd,e.toDisplayString(e.unref(L)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:Tl(kt.value).to??"",onInput:h[18]||(h[18]=x=>W(kt.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Vd)])])):Nl.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:D[kt.value]??"",onInput:h[19]||(h[19]=x=>se(kt.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(L)("table.search")},null,40,Nd),e.createElementVNode("div",Bd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(De(Nl.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:mt(kt.value,x),onChange:$=>ut(kt.value,x)},null,40,Md),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",_d,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:h[20]||(h[20]=x=>Wn(kt.value))},e.toDisplayString(e.unref(L)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,kt.value&&Nl.value&&Gt.value]])]),_:1})]))],64))}}),Td="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",Ad="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",Dd="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",Hd="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",Rd="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",Fd="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",Id={class:"dss-toolbar-left"},zd=["title"],Pd=["title"],Od={class:"dss-toolbar-dropdown-wrapper"},Wd=["title"],qd=["src"],Zd=["src"],Ud=["src"],Xd=["src"],Yd=["src"],jd=["src"],Kd={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Gd=["src"],Qd=["src"],Jd=["src"],e1=["src"],t1=["src"],l1=["src"],n1=["title"],o1=["title"],a1=["title"],s1=["title"],r1=["title"],i1=["title"],c1=["title"],u1=["title"],d1=["title"],m1={key:2,class:"dss-toolbar-separator"},p1=["title"],v1={key:4,class:"dss-toolbar-separator"},f1={key:5,class:"dss-toolbar-dropdown-wrapper"},h1=["title"],g1={class:"dss-toolbar-dropdown-ai"},y1={class:"dss-toolbar-right"},k1={key:0,class:"dss-toolbar-custom-group"},C1={key:1,class:"dss-toolbar-separator"},b1={class:"dss-link-modal-content"},w1={class:"dss-link-modal-field"},x1={class:"dss-link-modal-label"},E1=["placeholder"],S1={class:"dss-link-modal-field"},V1={class:"dss-link-modal-label"},N1=["placeholder"],B1={class:"dss-image-modal-tabs"},M1={key:0,class:"dss-image-tab-content"},_1={class:"dss-link-modal-content"},$1={class:"dss-link-modal-field"},L1={key:0,class:"dss-link-modal-label"},T1=["src"],A1={class:"dss-link-modal-field"},D1={class:"dss-link-modal-label"},H1=["placeholder"],R1={class:"dss-link-modal-field"},F1={class:"dss-link-modal-label"},I1=["placeholder"],z1={class:"dss-link-modal-field"},P1={class:"dss-link-modal-label"},O1=["placeholder"],W1={key:1,class:"dss-image-tab-content"},q1={class:"dss-link-modal-content"},Z1={class:"dss-link-modal-field"},U1={class:"dss-link-modal-label"},X1=["placeholder"],Y1={class:"dss-link-modal-field"},j1={class:"dss-link-modal-label"},K1=["placeholder"],G1={class:"dss-link-modal-field"},Q1={class:"dss-link-modal-label"},J1=["placeholder"],em={class:"dss-link-modal-field"},tm={class:"dss-link-modal-label"},lm=["placeholder"],nm={class:"dss-text-editor-title-input-container"},om={key:0,class:"dss-text-editor-title-preview"},am={key:0},sm={key:1,class:"dss-text-editor-preview-placeholder"},rm=["value","placeholder","disabled"],im={key:3,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},cm={class:"dss-text-editor-description-input-container"},um={key:0,class:"dss-text-editor-description-preview"},dm={key:0},mm={key:1,class:"dss-text-editor-preview-placeholder"},pm=["value","placeholder","disabled"],vm={key:5,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},fm=["data-comment-id","onMouseenter"],hm=["onClick"],gm=["src","alt"],ym={key:1},km=["onClick"],Cm=["src","alt"],bm={key:1},wm=["data-has-second-user","onClick"],xm={class:"editor-comment-marker-count"},Em={key:7,class:"dss-text-editor-textarea-wrapper"},Sm=["value","placeholder","rows","disabled"],Vm={class:"dss-text-editor-footer"},Nm={class:"dss-text-editor-footer-content"},Bm={class:"dss-text-editor-footer-stat"},Mm={class:"dss-text-editor-footer-stat"},_m={key:8,class:"dss-text-editor-content-wrapper"},$m={key:0,class:"dss-comment-overlay-body"},Lm={class:"dss-comment-selection-wrapper"},Tm=["innerHTML"],Am={class:"dss-comment-messages-wrapper"},Dm={key:0,class:"dss-comment-avatar-wrapper"},Hm={class:"dss-comment-avatar"},Rm=["src","alt"],Fm={key:1},Im={class:"dss-comment-header"},zm={class:"dss-comment-header-text"},Pm={class:"dss-comment-author"},Om={key:0,class:"dss-comment-date"},Wm=["onClick","title"],qm={class:"dss-comment-overlay-inner"},Zm=["placeholder","onKeydown"],Um={class:"dss-text-editor-footer"},Xm={class:"dss-text-editor-footer-content"},Ym={class:"dss-text-editor-footer-stat"},jm={class:"dss-text-editor-footer-stat"},Km=["title"],Gm=["title"],Qm={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:""},Jm={class:"dss-image-popup-content"},e2={key:0,class:"dss-image-popup-no-alt-icon"},t2=["title"],l2=["title"],n2={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:""},o2={class:"dss-toolbar-left"},a2=["title"],s2=["title"],r2={class:"dss-toolbar-dropdown-wrapper"},i2=["title"],c2=["src"],u2=["src"],d2=["src"],m2=["src"],p2=["src"],v2=["src"],f2={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},h2=["title"],g2=["title"],y2=["title"],k2=["title"],C2=["title"],b2=["title"],w2=["title"],x2=["title"],E2=["title"],S2={key:2,class:"dss-toolbar-separator"},V2=["title"],N2={key:4,class:"dss-toolbar-separator"},B2={key:5,class:"dss-toolbar-dropdown-wrapper"},M2=["title"],_2={class:"dss-toolbar-dropdown-ai"},$2={key:0,class:"dss-toolbar-right"},L2={key:0,class:"dss-toolbar-separator"},T2={key:0,class:"dss-toolbar-custom-group"},A2={key:1,class:"dss-toolbar-separator"},D2={name:"DSSTextEditor"},H2=Object.assign(D2,{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:S=>typeof S=="object"&&S!==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:S=>typeof S=="object"&&S!==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(S,{expose:ee,emit:L}){const{t:N,locale:ue}=so.useI18n(),O={h1:Td,h2:Ad,h3:Dd,h4:Hd,h5:Rd,h6:Fd},H=S,me=L,ot=e.useSlots(),ne=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
101
101
|
<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"/>
|
|
102
|
-
</svg>`,f=e.ref(null),we=e.ref(null),Ce=e.ref(!1),J=e.ref(!1),X=e.ref(!1),fe=e.ref(""),R=e.ref({}),me=e.ref(!1),_e=e.ref(!1),Je=e.ref(""),pt=e.ref(""),Z=e.ref(null),Fe=e.ref(null),We=e.ref(null),Se=e.ref(null),Le=e.ref(""),Ye=e.ref(!1),ie=e.ref({}),Ge=e.ref(!1),be=e.ref({}),Qe=e.ref(null),ct=e.ref(null),gt=e.ref(!1),ut=e.ref(""),qt=e.ref(null),Zt=e.ref(""),kt=e.ref(""),xt=e.ref(""),Yt=e.ref(null),rt=e.ref(null),Jt=e.ref(null),yt=e.ref(null),ol=e.ref(null),U=e.ref(!1),ke=e.ref(""),W=e.ref({}),G=e.ref(!1),Ne=e.ref("upload"),Ie=e.ref(""),Ue=e.ref(null),Et=e.ref(null),Ke=e.ref([]),Ut=e.ref([]),qe=e.ref(null),Pe=e.ref(!1),Ht=e.ref(""),$t=e.ref(""),oe=e.ref(""),Y=e.ref(""),j=e.ref(""),pe=e.ref(""),xe=e.ref(null),je=e.ref(null),Rt=e.ref(null),jt=e.ref(!1),et=e.ref(null),pl=e.ref(!1),M=e.ref(!1),w=e.ref(null),A=e.ref("p"),se=e.ref(!1),ae=e.ref([]),He=e.ref(null),Ct=e.ref(null),nt=e.ref(null),Re=e.ref(!1),bt=e.ref(0),_t=100,St=e.ref(null),Lt=e.computed(()=>!!T.commentUser),zt=e.computed(()=>({"dss-text-editor-no-border":!T.border,"dss-text-editor-rounded":T.rounded,"dss-text-editor-full-height":T.fullHeight,"dss-comment-overlay-open":Lt.value&&nl.value!==null})),Bt=e.computed(()=>({})),Kt=e.computed(()=>!T.fixedHeight||T.fullHeight?{}:{height:`${1.6*14*T.rows+24+2}px`,resize:"none",overflowY:"auto"}),ql=e.computed(()=>!T.fixedHeight||T.fullHeight?{}:{height:`${1.6*14*T.rows+32}px`,overflowY:"auto"}),jl=e.computed(()=>T.richText&&Ut.value.length>0),El=e.computed(()=>{if(!T.modelValue)return"";if(T.richText){let a=T.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return a=a.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),a=a.replace(/<[^>]+>/g,""),a=a.replace(/ /g," "),a=a.replace(/&/g,"&"),a=a.replace(/</g,"<"),a=a.replace(/>/g,">"),a=a.replace(/"/g,'"'),a=a.replace(/'/g,"'"),a=a.replace(/\s+/g," ").trim(),a}return T.modelValue}),il=e.computed(()=>{const a=El.value.trim();return a?a.split(/\s+/).filter(n=>n.length>0).length:0}),vl=e.computed(()=>El.value.length),dn=e.computed(()=>yt.value!==null&&Ne.value==="upload"&&Zt.value&&Zt.value.startsWith("data:")),wn=e.computed(()=>T.titlePlaceholder||B("textEditor.placeholders.title")),Dl=e.computed(()=>T.descriptionPlaceholder||B("textEditor.placeholders.description")),mn=e.computed(()=>T.placeholder||B("textEditor.placeholders.startTyping")),$l=a=>st&&st[a]!==void 0,zn=a=>{for(let n=a+1;n<T.customToolbarSlots.length;n++)if($l(T.customToolbarSlots[n]))return!0;return!1},Dn=a=>{for(let n=a+1;n<T.customToolbarSlots.length;n++){const s=T.customToolbarSlots[n];if($l(s)&&on(s))return!0}return!1},on=a=>T.customToolbarFloatingMap.hasOwnProperty(a)?T.customToolbarFloatingMap[a]===!0:!0,bl=e.computed(()=>T.customToolbarSlots.some(a=>$l(a)&&on(a))),Fl=e.computed(()=>$l("title-slot")),Kl=e.computed(()=>$l("description-slot")),Hl=a=>{if(!a||a.trim()==="")return"<html></html>";const n=a.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?a:`<html>${a}</html>`},Ml=a=>{if(!a||a.trim()==="")return"";const n=a.replace(/<!--[\s\S]*?-->/g,""),s=n.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():n},pn=a=>{if(!a)return;const n=document.createTreeWalker(a,NodeFilter.SHOW_COMMENT,null,!1),s=[];let i=n.nextNode();for(;i;)s.push(i),i=n.nextNode();s.forEach(c=>c.remove())},$=a=>{try{const n=String(a.getDate()).padStart(2,"0"),i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a.getMonth()],c=a.getFullYear();return`${n} ${i} ${c}`}catch{return""}},O=a=>{if(!a||typeof a!="string")return!1;const n=a.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const c=B("textEditor.started_conversation");if(c&&n===c)return!0}catch{}const i=n.toLowerCase();return i.includes("started conversation")||i.includes("démarré la conversation")||i==="started conversation"||i==="a démarré la conversation"},D=a=>{const n=a.target.value;he("update:modelValue",n),he("change",n)},ne=()=>{if(!xe.value)return;const a=xe.value;if(a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important"),a.value.trim()===""){const i=a.value;a.value="M";const c=a.scrollHeight;a.value=i,a.style.setProperty("height",`${c}px`,"important"),a.style.setProperty("overflow-y","hidden","important");return}a.offsetHeight;const s=a.scrollHeight;a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important")},Ae=()=>{pl.value=!0,ne()},it=()=>{pl.value=!1,vt()},vt=()=>{if(!xe.value)return;const a=xe.value;a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important");const n=a.value;a.value="M";const s=a.scrollHeight;a.value=n,a.offsetHeight,a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important"),a.style.setProperty("overflow-x","hidden","important"),a.style.setProperty("text-overflow","ellipsis","important"),a.style.setProperty("white-space","nowrap","important")},tt=a=>{const s=a.target.value;pl.value&&ne(),he("update:title",s),he("title-change",s),Rt.value="title",T.richText&&(Pe.value||($t.value=Ht.value,j.value=oe.value,pe.value=Y.value),qe.value&&clearTimeout(qe.value),Pe.value=!0,qe.value=setTimeout(()=>{Pe.value=!1,al()},500))},lt=()=>{if(!je.value)return;const a=je.value;if(a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important"),a.value.trim()===""){const i=a.value;a.value="M";const c=a.scrollHeight;a.value=i,a.style.setProperty("height",`${c}px`,"important"),a.style.setProperty("overflow-y","hidden","important");return}a.offsetHeight;const s=a.scrollHeight;a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important")},kl=()=>{M.value=!0,lt()},Sl=()=>{M.value=!1,Tt()},Tt=()=>{if(!je.value)return;const a=je.value;a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important");const n=a.value;a.value="M";const s=a.scrollHeight;a.value=n,a.offsetHeight,a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important"),a.style.setProperty("overflow-x","hidden","important"),a.style.setProperty("text-overflow","ellipsis","important"),a.style.setProperty("white-space","nowrap","important")},wl=a=>{const s=a.target.value;M.value&<(),he("update:description",s),he("description-change",s),Rt.value="description",T.richText&&(Pe.value||($t.value=Ht.value,j.value=oe.value,pe.value=Y.value),qe.value&&clearTimeout(qe.value),Pe.value=!0,qe.value=setTimeout(()=>{Pe.value=!1,al()},500))},el=()=>{const a=window.getSelection();if(a.rangeCount===0)return null;const n=a.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}},Vl=a=>{if(!(!a||!f.value))try{const n=window.getSelection(),s=document.createRange();if(a.type==="element"&&a.element)if(f.value.contains(a.element)){s.setStart(a.element,a.offset),s.collapse(!0),n.removeAllRanges(),n.addRange(s);return}else{f.value.focus();return}let i=0;const c=[f.value];let d=null,u=!1,p=!1;for(;!p&&(d=c.pop());)if(d.nodeType===3){const h=i+d.length;!u&&a.start>=i&&a.start<=h&&(s.setStart(d,a.start-i),u=!0),u&&a.end>=i&&a.end<=h&&(s.setEnd(d,a.end-i),p=!0),i=h}else{let h=d.childNodes.length;for(;h--;)c.push(d.childNodes[h])}n.removeAllRanges(),n.addRange(s)}catch{f.value.focus()}},an=()=>{if(!f.value)return;f.value.focus();const a=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],p=s(u);if(p)return p}return c},i=s(f.value);if(i.nodeType===3)n.setStart(i,i.length),n.setEnd(i,i.length);else if(i.childNodes.length>0){const c=s(i);c&&c.nodeType===3?(n.setStart(c,c.length),n.setEnd(c,c.length)):(n.selectNodeContents(i),n.collapse(!1))}else n.setStart(i,0),n.setEnd(i,0);a.removeAllRanges(),a.addRange(n)},al=(a=!1)=>{if(!f.value)return;const n=f.value.innerHTML,s=T.title||"",i=T.description||"";if(!a&&n===Ht.value&&s===oe.value&&i===Y.value)return;const c={content:$t.value||Ht.value,title:j.value!==void 0?j.value:oe.value,description:pe.value!==void 0?pe.value:Y.value},d=Ke.value.length>0?Ke.value[Ke.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&&(Ke.value.push(c),Ke.value.length>50&&Ke.value.shift(),Ut.value=[]),Ht.value=n,oe.value=s,Y.value=i,$t.value=n,j.value=s,pe.value=i},At=a=>{if(!f.value)return;Pn(),f.value&&pn(f.value);let n=null;f.value&&(f.value.querySelector("p")||(n=el(),xn()));const s=a&&a.inputType&&(a.inputType==="insertText"||a.inputType==="insertCompositionText"||a.inputType==="deleteContentBackward"||a.inputType==="deleteContentForward");s&&w.value&&(w.value=null),J.value=!0;const i=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=Hl(i);he("update:modelValue",c),he("change",c),Rt.value="editor",Pe.value||($t.value=Ht.value,j.value=oe.value,pe.value=Y.value),qe.value&&clearTimeout(qe.value),Pe.value=!0,qe.value=setTimeout(()=>{Pe.value=!1,al(),Mn(),Cn()},500),e.nextTick(()=>{n&&Vl(n),Pn();const d=["bold","italic","underline"],u=window.getSelection(),p=u.rangeCount>0?u.getRangeAt(0):null,h=p&&p.collapsed;if(d.forEach(k=>{try{if(h&&w.value?.command===k){ie.value[k]=w.value.state;return}if(k==="bold")if(p){const H=p.commonAncestorContainer,z=H.nodeType===3?H.parentElement:H;let V=!1;if(z&&((z.tagName==="STRONG"||z.tagName==="B"||z.closest&&z.closest("strong, b"))&&(V=!0),!V&&z.style&&parseInt(z.style.fontWeight)>=600&&(V=!0),!V))try{const Q=window.getComputedStyle(z);parseInt(Q.fontWeight)>=600&&(V=!0)}catch{}ie.value[k]=V}else ie.value.hasOwnProperty(k)||(ie.value[k]=!1);else if(k==="italic")if(p){const H=p.commonAncestorContainer,z=H.nodeType===3?H.parentElement:H,V=z&&(z.tagName==="EM"||z.tagName==="I"||z.closest&&z.closest("em, i"));ie.value[k]=!!V}else{const H=document.queryCommandState(k);ie.value[k]=H}else{const H=document.queryCommandState(k);ie.value[k]=H}}catch{}}),Ll(),Zl(),en(),Mt(),yn(),Yl("handleRichTextInput"),s&&(a.inputType==="insertText"||a.inputType==="insertCompositionText")){const k=a.data||"";k&&k.length===1&&setTimeout(()=>Cn(k),0),(k===" "||k===`
|
|
103
|
-
`||/[.,;:!?]/.test(k))&&setTimeout(()=>{Mn()},100)}J.value=!1})},Pn=()=>{if(!f.value)return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i)return;const c=i.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(i!==d&&!d?.contains(i)){const u=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,p=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.contains(u)&&u!==d||c.contains(p)&&p!==d){const h=document.createRange();h.setStartAfter(c),h.collapse(!0),a.removeAllRanges(),a.addRange(h)}}}},xn=()=>{if(!f.value)return;const a=f.value;if(a.querySelector&&a.querySelector("p"))return;const n=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),s=Array.from(a.childNodes);let i=null;s.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===a&&a.removeChild(c);return}i||(i=document.createElement("p"),a.insertBefore(i,c)),i.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){i=null;return}if(n.has(u)){i=null;return}i||(i=document.createElement("p"),a.insertBefore(i,d)),i.appendChild(d)}})},Zl=()=>{if(f.value&&!jt.value){jt.value=!0;try{f.value.querySelectorAll(".dss-image-wrapper").forEach(i=>{i.querySelector("img")||i.remove()}),f.value.querySelectorAll(".dss-image-no-alt-icon").forEach(i=>{const c=i.parentElement;!c||!c.classList.contains("dss-image-wrapper")?i.remove():c.querySelector("img")||i.remove()}),f.value.querySelectorAll("img").forEach(i=>{let c=i.getAttribute("alt");c===null&&(c=i.alt||"");const d=i.getAttribute("src")||i.src||"";if(c){const k=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),H=c===d||c===k;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||H||H)&&(c="")}i.setAttribute("alt",c),i.setAttribute("data-alt",c);const u=!c||c.trim()==="";let p=i.parentElement;const h=p&&p.classList.contains("dss-image-wrapper");if(h){const k=p.querySelector(".dss-image-no-alt-icon");k&&k.remove()}else{const k=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;k&&k.remove()}if(u){h?p.setAttribute("contenteditable","false"):(p=document.createElement("span"),p.className="dss-image-wrapper",p.setAttribute("contenteditable","false"),i.parentNode.insertBefore(p,i),p.appendChild(i));const k=document.createElement("div");k.className="dss-image-no-alt-icon",k.setAttribute("contenteditable","false"),k.innerHTML=te,p.appendChild(k)}else if(h&&p.children.length===1){const k=p.parentNode;k.insertBefore(i,p),k.removeChild(p)}})}finally{jt.value=!1}}},vn=a=>{Mn(),he("blur",a),Bn()},fn=()=>{if(T.disabled||!T.richText||!f.value)return;dl(),qe.value&&(clearTimeout(qe.value),qe.value=null),Pe.value&&(al(),Pe.value=!1);const a=Rt.value==="title",n=Rt.value==="description",s=Rt.value==="editor";if(Ke.value.length===0){a&&xe.value?xe.value.focus():n&&je.value?je.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{At()});return}const i={content:f.value.innerHTML,title:T.title||"",description:T.description||""};Ut.value.push(i);const c=Ke.value.pop();if(c!==void 0){J.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",p=typeof c=="object"&&c.description||"";f.value.innerHTML=d,Ht.value=d,oe.value=u,Y.value=p,$t.value=d,j.value=u,pe.value=p,e.nextTick(()=>{Ll(),sl(),tn(),Mt();const h=Hl(d);he("update:modelValue",h),he("update:title",u),he("update:description",p),he("change",h),he("title-change",u),he("description-change",p),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(xe.value){xe.value.focus();const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),ne()}}else if(n){if(je.value){je.value.focus();const k=p.length;je.value.setSelectionRange(k,k)}}else if(s)an();else if(xe.value&&document.activeElement===xe.value){const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),ne()}else if(je.value&&document.activeElement===je.value){const k=p.length;je.value.setSelectionRange(k,k)}else f.value&&an()},10)})})}},Hn=()=>{if(T.disabled||!T.richText||!f.value)return;dl();const a=Rt.value==="title",n=Rt.value==="description",s=Rt.value==="editor";if(Ut.value.length===0){a&&xe.value?xe.value.focus():n&&je.value?je.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{At()});return}const i={content:f.value.innerHTML,title:T.title||"",description:T.description||""};Ke.value.push(i);const c=Ut.value.pop();if(c!==void 0){J.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",p=typeof c=="object"&&c.description||"";f.value.innerHTML=d,Ht.value=d,oe.value=u,Y.value=p,$t.value=d,j.value=u,pe.value=p,e.nextTick(()=>{Ll(),sl(),tn(),Mt();const h=Hl(d);he("update:modelValue",h),he("update:title",u),he("update:description",p),he("change",h),he("title-change",u),he("description-change",p),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(xe.value){xe.value.focus();const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),ne()}}else if(n){if(je.value){je.value.focus();const k=p.length;je.value.setSelectionRange(k,k)}}else if(s)an();else if(xe.value&&document.activeElement===xe.value){const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),ne()}else if(je.value&&document.activeElement===je.value){const k=p.length;je.value.setSelectionRange(k,k)}else f.value&&an()},10)})})}},En=()=>{if(!f.value)return;f.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{const c=i.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),f.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{if(parseInt(i.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),f.value.querySelectorAll("b, strong").forEach(i=>{i.style.fontWeight="600"})},en=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},ul=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const n=a.getRangeAt(0);let s=!1;if(n.collapsed){const i=n.startContainer;let c=i.nodeType===3?i.parentElement:i;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 i=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,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(()=>{en()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{en()});else try{const i=n.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(i),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),a.removeAllRanges(),a.addRange(n),e.nextTick(()=>{en()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{en()})}return!0},On=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const n=a.getRangeAt(0);let s=!1;if(n.collapsed){const i=n.startContainer;let c=i.nodeType===3?i.parentElement:i;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 i=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,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(()=>{En()}),!1;if(n.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==f.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const p=u.style.fontWeight;if(p==="normal"||p==="400"){const h=document.createElement("b");h.style.fontWeight="600";const k=document.createDocumentFragment();for(;u.firstChild;)k.appendChild(u.firstChild);h.appendChild(k),u.parentNode&&u.parentNode.replaceChild(h,u),c.setStart(h,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===f.value){const p=document.createElement("b");p.style.fontWeight="600",p.innerHTML="<br>",c.insertNode(p),c.setStart(p,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c)}}En()});else try{const i=n.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(i),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),a.removeAllRanges(),a.addRange(n),e.nextTick(()=>{En()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{En()})}return!0},Il=(a,n=null)=>{if(T.disabled||!T.richText||!f.value)return;Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al(),dl(),f.value.focus();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&Nn(d)&&(i=el())}if(a==="createLink"&&n){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const h=document.createTextNode(n);u.insertNode(h),u.selectNodeContents(h)}}}if(a==="bold"){const d=On();ie.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"bold",state:d}),e.nextTick(()=>{i&&(Vl(i),e.nextTick(()=>{const p=ll("bold");ie.value.bold=p})),At(),sl(),Mt()});return}if(a==="italic"){const d=ul();ie.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"italic",state:d}),e.nextTick(()=>{i&&(Vl(i),e.nextTick(()=>{const p=ll("italic");ie.value.italic=p})),At(),en(),sl(),Mt()});return}let c=!1;try{c=document.execCommand(a,!1,n)}catch{}e.nextTick(()=>{if(i&&Vl(i),["bold","italic","underline"].includes(a))try{if(a==="bold")i&&e.nextTick(()=>{const u=ll("bold");ie.value.bold=u});else if(a==="italic")if(i)e.nextTick(()=>{const u=ll("italic");ie.value.italic=u});else{const u=document.queryCommandState(a);ie.value[a]=u}else{const u=document.queryCommandState(a);ie.value[a]=u}}catch{ie.value.hasOwnProperty(a)?ie.value[a]=!ie.value[a]:ie.value[a]=!0}if(a==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const h=u.getRangeAt(0),k=h.commonAncestorContainer.nodeType===1?h.commonAncestorContainer.closest("a"):h.commonAncestorContainer.parentElement?.closest("a");k&&(!k.getAttribute("href")||k.getAttribute("href")==="")&&k.setAttribute("href",n)}f.value.querySelectorAll("a").forEach(h=>{const k=h.getAttribute("href");(!k||k===""||k==="#")&&h.setAttribute("href",n)})}At(),sl(),Mt()})},ll=(a,n=null)=>{if(T.disabled||!f.value)return!1;try{if(a==="formatBlock"&&n){const i=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const c=i.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const p=d.getRangeAt(0).commonAncestorContainer;return!!(p.nodeType===1?p.tagName==="BLOCKQUOTE"?p:p.closest("blockquote"):p.parentElement?.closest("blockquote"))}}return i===n||i.toLowerCase()===n.toLowerCase()}if(["bold","italic","underline"].includes(a))try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(a==="bold"){let u=!1;if(c.collapsed){const p=c.commonAncestorContainer,h=p.nodeType===3?p.parentElement:p;if(h&&((h.tagName==="STRONG"||h.tagName==="B"||h.closest&&h.closest("strong, b"))&&(u=!0),!u&&h.style&&parseInt(h.style.fontWeight)>=600&&(u=!0),!u))try{const k=window.getComputedStyle(h);parseInt(k.fontWeight)>=600&&(u=!0)}catch{}return ie.value.hasOwnProperty(a)?ie.value[a]:(ie.value[a]=u,u)}else{const p=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let h=!1;if(p){const k=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let H;for(;H=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(H))){if(H.nodeType===3){if(!(H.textContent||"").trim())continue;h=!0;let V=H.parentElement;for(;V&&V!==f.value;){if(V.tagName==="STRONG"||V.tagName==="B"){u=!0;break}if(V.style&&parseInt(V.style.fontWeight)>=600){u=!0;break}V=V.parentElement}}else if(H.nodeType===1){const z=H;if(z.tagName==="STRONG"||z.tagName==="B"){u=!0;break}if(z.style&&parseInt(z.style.fontWeight)>=600){u=!0;break}}if(u)break}}return ie.value[a]=u&&h,u&&h}}if(a==="italic"){let u=!1;if(c.collapsed){const p=c.commonAncestorContainer,h=p.nodeType===3?p.parentElement:p;if(h&&((h.tagName==="EM"||h.tagName==="I"||h.closest&&h.closest("em, i"))&&(u=!0),!u&&h.style&&h.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(h).fontStyle==="italic"&&(u=!0)}catch{}return ie.value.hasOwnProperty(a)?ie.value[a]:(ie.value[a]=u,u)}else{const p=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let h=!1;if(p){const k=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let H;for(;H=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(H))){if(H.nodeType===3){if(!(H.textContent||"").trim())continue;h=!0;let V=H.parentElement;for(;V&&V!==f.value;){if(V.tagName==="EM"||V.tagName==="I"){u=!0;break}if(V.style&&V.style.fontStyle==="italic"){u=!0;break}V=V.parentElement}}else if(H.nodeType===1){const z=H;if(z.tagName==="EM"||z.tagName==="I"){u=!0;break}if(z.style&&z.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return ie.value[a]=u&&h,u&&h}}const d=document.queryCommandState(a);return c.collapsed&&ie.value.hasOwnProperty(a)?ie.value[a]:(ie.value[a]=d,d)}return ie.value.hasOwnProperty(a)?ie.value[a]:!1}catch{return ie.value.hasOwnProperty(a)?ie.value[a]:!1}try{return document.queryCommandState(a)}catch{return!1}}catch{return!1}},Wn=a=>{T.disabled||!T.richText||(we.value=we.value===a?null:a,a==="askAi"&&(ct.value=null))},dl=()=>{we.value=null,Ue.value=null},wt=a=>{Il("formatBlock",a),dl()},$e=a=>{if(!a||!f.value)return a;const n=ge=>{let Me=ge.nodeType===Node.TEXT_NODE?ge.parentElement:ge;for(;Me&&Me!==f.value;){const ft=Me.tagName;if(ft==="P"){const xl=Me.parentElement;if(xl===f.value||xl.tagName==="BLOCKQUOTE")return Me}if(ft==="BLOCKQUOTE")break;Me=Me.parentElement}return null},s=n(a.startContainer),i=n(a.endContainer);if(!s||!i)return a;const c=[],d=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:ge=>{const Me=ge.tagName;if(Me==="P"){const ft=ge.parentElement;if(ft===f.value||ft.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Me==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const p=c.indexOf(s),h=c.indexOf(i);if(p===-1||h===-1)return a;const k=Math.min(p,h),H=Math.max(p,h),z=c.slice(k,H+1);if(z.length===0)return a;const V=z[0],Q=z[z.length-1],ee=document.createRange();return ee.setStartBefore(V),ee.setEndAfter(Q),ee},Sn=()=>{if(T.disabled||!T.richText||!f.value)return;Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al(),dl(),f.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;let n=a.getRangeAt(0);!n.collapsed&&Nn(n)&&(n=$e(n),a.removeAllRanges(),a.addRange(n));let s=null;!n.collapsed&&Nn(n)&&(s=el());const i=n.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&f.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(h=>{if(h.nodeType===Node.ELEMENT_NODE)if(h.tagName==="P"||h.tagName==="DIV")u.insertBefore(h,c);else{const k=document.createElement("p");k.appendChild(h.cloneNode(!0)),u.insertBefore(k,c)}else if(h.nodeType===Node.TEXT_NODE&&h.textContent.trim()){const k=document.createElement("p");k.appendChild(h.cloneNode(!0)),u.insertBefore(k,c)}}),c.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),p=n.extractContents();u.appendChild(p),n.insertNode(u);const h=[],k=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:V=>V.parentNode===u&&V.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let H;for(;H=k.nextNode();)h.push(H);if(h.forEach(V=>{const Q=document.createElement("p");V.parentNode.insertBefore(Q,V),Q.appendChild(V)}),u.querySelectorAll("p, div").forEach(V=>{V.textContent.trim()===""&&!V.querySelector("img")&&(V.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const V=document.createElement("p");V.innerHTML="<br>",u.appendChild(V)}}e.nextTick(()=>{s&&Vl(s),tn(),At(),Mt()})},dt=()=>{if(!f.value)return;const a=window.getSelection();if(a.rangeCount===0)return;const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!i||!f.value.contains(i))return;const c=H=>{if(!H)return!1;const z=H.textContent||"",Q=(H.innerHTML||"").trim();return z.trim()===""||Q===""||Q==="<br>"||Q==="<br/>"||Q==="<p></p>"||Q==="<p><br></p>"||Q==="<p><br/></p>"||Q==="<p> </p>"||Q==="<p><br> </p>"||Q==="<div></div>"||Q==="<div><br></div>"||Q==="<div><br/></div>"};let d=null;for(s.nodeType===3?d=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?d=s:d=s.closest("p, div"),d&&i.contains(d)&&c(d)&&d.remove();i.lastChild;){const H=i.lastChild;if(H.nodeType===1&&H.tagName==="BR")H.remove();else if(H.nodeType===3)if((H.textContent||"").trim()==="")H.remove();else break;else break}if(i.children.length>0)for(let H=i.children.length-1;H>=0;H--){const z=i.children[H];if((z.tagName==="P"||z.tagName==="DIV")&&c(z))z.remove();else break}let u=i.innerHTML;const p=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==p&&(i.innerHTML=u);const h=document.createElement("p");h.innerHTML="<br>",i.parentNode?i.nextSibling?i.parentNode.insertBefore(h,i.nextSibling):i.parentNode.appendChild(h):f.value&&f.value.appendChild(h);const k=document.createRange();k.selectNodeContents(h),k.collapse(!0),a.removeAllRanges(),a.addRange(k),e.nextTick(()=>{tn(),At()})},sl=()=>{if(!f.value){Ce.value=!1;return}try{const a=window.getSelection();if(a.rangeCount>0){const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");Ce.value=!!i}else Ce.value=!1}catch{Ce.value=!1}},ot=()=>{if(!f.value)return;const a=window.getSelection();a&&a.rangeCount>0&&a.getRangeAt(0),Se.value=el();const n=window.getSelection();let s="";n.rangeCount>0&&(s=n.getRangeAt(0).toString()),Je.value="",pt.value=s,Le.value="",We.value=null,_e.value=!0,dl(),e.nextTick(()=>{Z.value&&Z.value.focus()})},mt=()=>{if(!f.value)return;Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al();const a=window.getSelection();let n=null;if(a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer;n=i.nodeType===1?i.closest("a"):i.parentElement?.closest("a")}if(!n&&We.value&&(n=We.value),n&&n.parentNode){const s=document.createDocumentFragment();for(;n.firstChild;)s.appendChild(n.firstChild);if(n.parentNode.replaceChild(s,n),s.firstChild){const i=document.createRange();i.setStartBefore(s.firstChild),i.setEndAfter(s.lastChild||s.firstChild),a.removeAllRanges(),a.addRange(i),document.execCommand("removeFormat",!1),i.collapse(!1),a.removeAllRanges(),a.addRange(i)}We.value=null}else Il("unlink");Ce.value=!1,dl(),e.nextTick(()=>{At(),sl()})},ce=()=>{T.disabled||!T.richText||f.value&&(Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al(),dl(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Ll(),At(),Mt()}))},tl=()=>{T.disabled||!T.richText||f.value&&(Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al(),dl(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Ll(),At(),Mt()}))},Oe=a=>{const n=a.parentElement;if(!n||n.tagName!=="OL")return null;let s=0,i=a.previousElementSibling;for(;i;)i.tagName==="LI"&&s++,i=i.previousElementSibling;return s+1},Ll=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(n=>{const s=n.parentElement;if(s&&s.tagName==="LI"){const i=Oe(s);i!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(i))})}})},sn=()=>{if(T.disabled||!T.richText||!f.value)return;dl(),f.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{Ll(),At()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=s.previousElementSibling;if(c&&c.tagName==="LI"){const d=i.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const p=Oe(c);u.appendChild(s),p!==null&&i.tagName==="OL"&&s.setAttribute("data-parent-num",String(p)),Ll();const h=document.createRange();h.selectNodeContents(s),h.collapse(!1),a.removeAllRanges(),a.addRange(h),e.nextTick(()=>{At(),Mt()})}else document.execCommand("indent",!1),e.nextTick(()=>{Ll(),At(),Mt()})},Tl=()=>{if(T.disabled||!T.richText||!f.value)return;dl(),f.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{Ll(),At()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=i.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){i.tagName==="OL"&&s.removeAttribute("data-parent-num"),d.insertBefore(s,c.nextSibling),i.children.length===0&&i.remove(),Ll();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),a.removeAllRanges(),a.addRange(u),e.nextTick(()=>{At(),Mt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Ll(),At(),Mt()})},nl=e.ref(null),zl=e.ref(null),y=e.ref({}),g=e.ref(""),x=e.ref(null),q=e.ref("");e.ref("");const ue=e.ref(null);e.ref("");const at=e.ref([]),Xt=e.ref(!1),Cl=e.ref(!1),Pl=a=>{if(!a)return"";const n=a.cloneRange(),s=document.createElement("div");return s.appendChild(n.cloneContents()),s.innerHTML},Ul=()=>{if(!T.commentUser||T.disabled||!T.richText||!f.value)return;if(nl.value!==null){nl.value=null,g.value="",q.value="",ue.value=null,at.value=[],$n(!0);return}dl(),f.value.focus();const a=window.getSelection();if(!a||a.rangeCount===0)return;const n=a.getRangeAt(0);if(n.collapsed||!Nn(n))return;q.value=Pl(n)||"",ue.value=el();const s=n.getBoundingClientRect(),i=f.value.parentElement;if(!i)return;const c=i.getBoundingClientRect(),d=s.bottom-c.top,p=Math.max(d+8,0);y.value={top:`${p}px`,bottom:"auto"},nl.value=Date.now(),e.nextTick(()=>{if(g.value="",x.value){const k=x.value;k.style.height="auto",k.style.height=`${k.scrollHeight}px`,k.focus()}const h=i.querySelector(".dss-comment-overlay");if(h&&i){const k=i.querySelector(".dss-text-editor-footer");if(k){const H=i.getBoundingClientRect(),z=h.getBoundingClientRect(),V=k.getBoundingClientRect(),Q=z.bottom-H.top,ee=V.top-H.top,ge=8;if(Q>ee-ge){const Me=V.height;y.value={bottom:`${Me+ge}px`,top:"auto"}}else y.value={top:`${p}px`,bottom:"auto"}}}})},hn=()=>{if(!g.value.trim())return;const a=g.value.trim(),n=new Date,s={text:a,selectionText:q.value,selectionRange:ue.value,commentId:nl.value,user:T.commentUser||null,createdAt:n.toISOString()};at.value=[...at.value,s],he("comment-submitted",s),Xo(s),ue.value&&!So(ue.value)&&Vn(nl.value,ue.value),g.value="",e.nextTick(()=>{if(x.value){const i=x.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}Yl("sendComment")})},uo=(a,n)=>{if(!(!T.commentUser||!a.user||a.user.id!==T.commentUser.id)){if(at.value=at.value.filter((s,i)=>i!==n),nl.value!==null&&f.value){const s=String(nl.value),i=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(i&&at.value.length>0){const c=[],d=new Set;at.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),c.push(u.user))}),c.length>0?i.setAttribute("data-comment-user",JSON.stringify(c[0])):i.removeAttribute("data-comment-user"),c.length>1?i.setAttribute("data-comment-user-2",JSON.stringify(c[1])):i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count",String(at.value.length))}else i&&at.value.length===0&&(i.removeAttribute("data-comment-user"),i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count","0"))}if(he("comment-deleted",{comment:a,index:n,commentId:nl.value}),T.comments&&Array.isArray(T.comments)){const s=T.comments.filter(i=>!(i.commentId===a.commentId&&i.text===a.text&&i.user?.id===a.user?.id));he("update:comments",s)}e.nextTick(()=>{Yl("deleteComment")})}},So=a=>{if(!a||!f.value)return!1;try{const n=Vo(a);if(!n)return!1;const s=n.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i)return!!i.closest("[data-comment], [data-fake-comment]")}catch{}return!1},Vo=a=>{if(!a||!f.value)return null;try{const n=document.createRange();if(a.type==="element"&&a.element)return f.value.contains(a.element)?(n.setStart(a.element,a.offset),n.collapse(!0),n):null;let s=0;const i=[f.value];let c=null,d=!1,u=!1;for(;!u&&(c=i.pop());)if(c.nodeType===3){const p=s+c.length;!d&&a.start>=s&&a.start<=p&&(n.setStart(c,a.start-s),d=!0),d&&a.end>=s&&a.end<=p&&(n.setEnd(c,a.end-s),u=!0),s=p}else{let p=c.childNodes.length;for(;p--;)i.push(c.childNodes[p])}return d?n:null}catch{return null}},Vn=(a,n)=>{if(!(!a||!n||!f.value))try{const s=Vo(n);if(!s||s.collapsed)return;const i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const p=c.closest("[data-comment], [data-fake-comment]");if(p){p.getAttribute("data-comment")!==String(a)&&p.getAttribute("data-fake-comment")!==String(a)&&p.setAttribute("data-comment",String(a));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(a));try{const p=s.startContainer,h=s.endContainer,k=s.startOffset,H=s.endOffset,z=p.nodeType===3?p.parentNode:p,V=h.nodeType===3?h.parentNode:h;if(z===V&&k===0&&H===(h.nodeType===3?h.length:V.childNodes.length)&&(z.tagName==="P"||z.tagName==="DIV"||z.tagName==="H1"||z.tagName==="H2"||z.tagName==="H3"||z.tagName==="H4"||z.tagName==="H5"||z.tagName==="H6")){const ee=s.extractContents();d.appendChild(ee),s.insertNode(d)}else s.surroundContents(d)}catch{const h=s.extractContents();d.appendChild(h),s.insertNode(d)}const u=f.value.querySelector(`[data-comment="${String(a)}"]`);e.nextTick(()=>{Yl("wrapSelectionWithCommentMarker"),At()})}catch{}},Xo=a=>{if(!a||!a.commentId)return;const n=Array.isArray(T.comments)?[...T.comments]:[],s=typeof a.commentId=="string"&&a.commentId.startsWith("comment-")?Date.now():Number(a.commentId)||a.commentId;let i=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:a.text,user:a.user,createdAt:a.createdAt,created_at:a.createdAt,updated_at:a.createdAt};if(i>=0){const d=n[i];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=a.createdAt,!d.article_id&&n.length>0){const u=n.find(p=>p.article_id);u&&(d.article_id=u.article_id)}}else{const d=a.selectionRange,u=n.length>0&&n.find(h=>h.article_id)?.article_id||null,p={conversation_id:s,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:a.selectionText||"",conversation:[c],created_by_user:a.user,created_at:a.createdAt,updated_at:a.createdAt,status:"active"};n.push(p)}Xt.value=!0,he("update:comments",n)},Yo=(a,n=[])=>{if(!T.commentUser||T.disabled||!T.richText||!f.value)return;const s=f.value;let i=null;try{i=s.querySelector(a)}catch{return}if(!i)return;dl(),s.focus();const c=document.createRange();c.selectNodeContents(i);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),q.value=i.innerHTML||"",ue.value=el();const u=c.getBoundingClientRect(),p=s.parentElement;if(p){const H=p.getBoundingClientRect(),z=u.bottom-H.top,Q=Math.max(z+8,0);y.value={top:`${Q}px`,bottom:"auto"}}const h=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");let k=[];if(h&&T.comments&&Array.isArray(T.comments)){const H=T.comments.find(z=>String(z.conversation_id)===String(h));if(H&&H.conversation&&Array.isArray(H.conversation)){const z=H.conversation.map(V=>({id:V.id||V.commentary_id,commentary_id:V.id||V.commentary_id,conversation_id:H.id||H.conversation_id,text:V.text,user:V.user,createdAt:V.created_at||V.createdAt,updated_at:V.updated_at||V.updatedAt}));k.push(...z)}}k.length===0&&Array.isArray(n)&&n.length>0&&(k=n.slice()),k.sort((H,z)=>{const V=ge=>{if(!ge)return 0;const Me=new Date(ge).getTime();return isNaN(Me)?0:Me},Q=V(H.createdAt),ee=V(z.createdAt);return Q===ee?0:Q-ee}),at.value=k,$n(!0),nl.value=h||null,i&&(zl.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(g.value="",x.value){const H=x.value;H.style.height="auto",H.style.height=`${H.scrollHeight}px`,H.focus()}if(p){const H=p.querySelector(".dss-comment-overlay");if(H){const z=p.querySelector(".dss-text-editor-footer");if(z){const V=p.getBoundingClientRect(),Q=H.getBoundingClientRect(),ee=z.getBoundingClientRect(),ge=Q.bottom-V.top,Me=ee.top-V.top,ft=8;if(ge>Me-ft){const xl=ee.height;y.value={bottom:`${xl+ft}px`,top:"auto"}}}}}Yl("openCommentOverlayForSelector")})},mo=e.ref(null),po=e.ref(0),jo=a=>{if(!(T.disabled||!T.richText)){if(a.key==="Escape"){const n=window.getSelection();if(n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){a.preventDefault();let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const p=document.createElement("p");p.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(p,u.nextSibling):c.appendChild(p),setTimeout(()=>{dt()},50);return}}}if(a.key.length===1||a.key==="Enter"){const n=window.getSelection();if(n&&n.rangeCount>0){const s=n.getRangeAt(0),i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const p=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,h=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(p)&&p!==u||d.contains(h)&&h!==u){a.preventDefault();const k=document.createRange();k.setStartAfter(d),k.collapse(!0),n.removeAllRanges(),n.addRange(k);return}}}}}}if(a.key==="Backspace"||a.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);let i=null,c=null;if(s.collapsed)if(a.key==="Backspace"){const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const p=u.previousSibling;p&&(p.classList&&p.classList.contains("dss-image-wrapper")?c=p:p.tagName==="IMG"&&(i=p,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const p=u.nextSibling;p&&(p.classList&&p.classList.contains("dss-image-wrapper")?c=p:p.tagName==="IMG"&&(i=p,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const d=s.commonAncestorContainer,u=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,p=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(i=d,c=i.closest(".dss-image-wrapper")):(i=d.querySelector("img"),i&&(c=i.closest(".dss-image-wrapper"))),c){const h=c.contains(u)||u===c,k=c.contains(p)||p===c,z=s.cloneContents().textContent?.trim()||"",V=c.textContent?.trim()||"";(!h||!k||z.length>V.length)&&(c=null,i=null)}}if(c){a.preventDefault(),a.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const p=document.createRange();p.setStartAfter(u),p.collapse(!0),n.removeAllRanges(),n.addRange(p),e.nextTick(()=>{At()});return}}}}if(a.key==="Tab"){a.preventDefault(),a.shiftKey?Tl():sn();return}if(a.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);if(s.collapsed){const u=s.startContainer,p=h=>{if(!h)return!1;let k=h.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 H=h.parentElement;return H&&H!==f.value?p(H):!1};if(u.nodeType===3){const h=u.parentElement;if(h&&(p(h)||p(u))){const k=h.closest("p, div");if(k&&k!==f.value){a.preventDefault(),a.stopPropagation();let H=null;const z=s.startOffset;z<u.length&&(H=u.splitText(z));const V=document.createElement("p");if(H?V.appendChild(H):V.innerHTML="<br>",u.length===0){const ee=u.parentElement;ee&&(ee.removeChild(u),ee.childNodes.length===0&&ee.appendChild(document.createElement("br")))}k.nextSibling?k.parentNode.insertBefore(V,k.nextSibling):k.parentNode.appendChild(V);const Q=document.createRange();H?Q.setStart(H,0):Q.setStart(V,0),Q.collapse(!0),n.removeAllRanges(),n.addRange(Q),e.nextTick(()=>{At()});return}}}}const i=s.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const p=ee=>{if(!ee)return!1;const ge=ee.textContent||"",ft=(ee.innerHTML||"").trim(),xl=ft.replace(/<br\s*\/?>/gi,"").trim();return ge.trim()===""||ft===""||xl===""||ft==="<br>"||ft==="<br/>"||ft==="<p></p>"||ft==="<p><br></p>"||ft==="<p><br/></p>"||ft==="<p> </p>"||ft==="<p><br> </p>"||ft==="<div></div>"||ft==="<div><br></div>"||ft==="<div><br/></div>"},h=c.lastChild,k=h&&h.nodeType===1&&h.tagName==="BR",H=s.startContainer,z=H.nodeType===3?H.parentElement:H,V=z===c||z&&z.parentElement===c;if(u&&p(u)||k&&V){a.preventDefault(),setTimeout(()=>{dt()},50);return}}}}if(a.key===" "){const n=Date.now(),s=n-po.value;if(mo.value===" "&&s<300){const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(d){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){a.preventDefault(),sn();return}}}}mo.value=" ",po.value=n}else mo.value=a.key}},qn=a=>{if(T.disabled||!T.richText)return;a.preventDefault();let n=a.clipboardData.getData("text/html"),s=a.clipboardData.getData("text/plain");n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),al();const i=window.getSelection();let c=null;if(i&&i.rangeCount>0){let p=i.getRangeAt(0).commonAncestorContainer;p.nodeType===3&&(p=p.parentNode),c=p.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const h=new DOMParser().parseFromString(u,"text/html");let k=f.value.querySelector("h1")?1:0;if(h.querySelectorAll("h1").forEach(z=>{if(k>0){const V=h.createElement("p");V.innerHTML=z.innerHTML,z.parentNode.replaceChild(V,z)}else k++}),c){const z=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],V=Array.from(h.body.children).filter(Q=>z.includes(Q.tagName));if(V.length===1){const Q=V[0].tagName,ee=c.tagName,ge=c.textContent.trim()===""&&!c.querySelector("img");let Me=!1;if(["H1","H2","H3","H4","H5","H6"].includes(ee)?Me=!0:ge||(Q===ee||Q==="P")&&(Me=!0),Me)return V[0].innerHTML.trim()}}return h.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 p=d(s);document.execCommand("insertHTML",!1,p)}else document.execCommand("insertText",!1,s);At()},vo=a=>{if(we.value){const s=a.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&dl()}if(Ge.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=f.value&&s.closest(".dss-text-editor-content");!i&&!c&&Bn()}if(ct.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!i&&!c&&Nl()}const n=a.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(Ue.value=null),!f.value||!n.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const i=s.getRangeAt(0);se.value=!i.collapsed&&Nn(i)}else se.value=!1}if(nl.value!==null){const s=document.querySelector(".dss-comment-overlay");let i=!1;if(s){const u=s.getBoundingClientRect(),p=a.clientX,h=a.clientY;i=p>=u.left&&p<=u.right&&h>=u.top&&h<=u.bottom}const c=n.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!i&&!d&&(nl.value=null,g.value="",q.value="",ue.value=null,at.value=[],$n(!0))}},gn=(a,n)=>{a&&a.stopPropagation&&a.stopPropagation(),Et.value&&(clearTimeout(Et.value),Et.value=null),Ue.value=n},No=a=>{const n=a.relatedTarget;if(n){const s=n.closest(".dss-toolbar-dropdown-submenu"),i=n.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||i)return}Et.value&&clearTimeout(Et.value),Et.value=setTimeout(()=>{Ue.value=null,Et.value=null},150)},Ko=a=>{Ue.value=null};let Go=0;const Qo=a=>{if(!a)return;const n=Array.from(a.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,i)=>{if(s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||s.classList.contains("dss-toolbar-dropdown-submenu")||!s.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(s.children).find(p=>p.tagName==="DIV"?p.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(p.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(p=>p.tagName==="BUTTON"||p.tagName==="DIV");if(c||u){const p=`submenu-auto-${++Go}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",p);let h=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),h=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),h=d),h&&(h.setAttribute("data-submenu-id",p),h.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?h.dataset.originalParentRef="inside":h.dataset.originalParentRef="sibling",Array.from(h.children).forEach(H=>{(H.tagName==="BUTTON"||H.tagName==="DIV")&&!H.classList.contains("dss-toolbar-dropdown-item")&&H.classList.add("dss-toolbar-dropdown-item")}))}})},Bo=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{Qo(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=h=>{const k=c.getAttribute("data-submenu-id");k&&gn(h,k)},p=No;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",p),c._subMenuHandlers={enter:u,leave:p}}),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 H=c.getAttribute("data-submenu-id");H&&gn(k,H)},p=No;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",p),c._subMenuHandlers={enter:u,leave:p},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(k=>{k.addEventListener("click",Ko)})})})};let Rn=null;const Kn=()=>{if(Ue.value){const a=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Ue.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Ue.value}"]`);a&&n&&eo(a,n)}if(Ge.value&&Mt(),T.richText){if(Rn!==null)return;Rn=setTimeout(()=>{Rn=null,Yl("handleWindowResize")},150)}},Zn=()=>{if(!T.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(n=>{Array.from(n.children).filter(i=>i.tagName==="DIV"&&!i.classList.contains("dss-toolbar-button")).forEach(i=>{i.classList.add("dss-toolbar-button")})})},fo=()=>{const a=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 i=window.getSelection();i.removeAllRanges?i.removeAllRanges():i.empty&&i.empty()}return!1};a.forEach(s=>{s.addEventListener("selectstart",n),s.addEventListener("mousedown",n),s.addEventListener("dragstart",n),s.addEventListener("contextmenu",n),s.addEventListener("click",i=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{pl.value?ne():vt(),M.value?lt():Tt()})}),e.nextTick(()=>{fo()}),T.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",vo),window.addEventListener("resize",Kn);let a=null;const n=()=>{a===null&&(a=setTimeout(()=>{a=null,Kn()},150))};window.addEventListener("scroll",n,!0),f.value._windowScrollHandler=n,f.value._windowScrollTimeout=a,f.value.closest(".editor-with-comments"),f.value.closest(".dss-text-editor-content-wrapper");const s=f.value.closest(".dss-text-editor-content");let i=null;const c=()=>{i===null&&(i=setTimeout(()=>{i=null,Kn()},150))};s&&(s.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{Bo(),Zn()}),f.value.addEventListener("click",p=>{const h=p.target;h.closest("a")&&!T.disabled&&p.preventDefault();const H=h.closest(".dss-image-no-alt-icon"),z=h.closest(".dss-image-wrapper");if(H||z&&h===z){p.preventDefault(),p.stopPropagation();const V=window.getSelection(),Q=document.createRange();Q.setStartAfter(z),Q.collapse(!0),V.removeAllRanges(),V.addRange(Q)}else z&&h.tagName!=="IMG"&&(p.preventDefault(),e.nextTick(()=>{const V=window.getSelection();if(V.rangeCount>0){const ee=V.getRangeAt(0).commonAncestorContainer,ge=ee.nodeType===3?ee.parentElement:ee;if(z.contains(ge)&&ge!==z.querySelector("img")){const Me=document.createRange();Me.setStartAfter(z),Me.collapse(!0),V.removeAllRanges(),V.addRange(Me)}}else{const Q=document.createRange();Q.setStartAfter(z),Q.collapse(!0),V.addRange(Q)}}))},!0),f.value.addEventListener("mousedown",p=>{const h=p.target,k=h.closest(".dss-image-no-alt-icon"),H=h.closest(".dss-image-wrapper");if(k||H&&h.tagName!=="IMG"){p.preventDefault();const z=window.getSelection(),V=document.createRange();H&&(V.setStartAfter(H),V.collapse(!0),z.removeAllRanges(),z.addRange(V))}},!0),f.value.addEventListener("paste",p=>{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 z=k.getAttribute("alt")||k.alt||"";if(z){const V=k.getAttribute("src")||k.src||"",Q=V.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),ee=z===V||z===Q;(z.startsWith("http://")||z.startsWith("https://")||z.startsWith("data:")||ee||ee)&&(k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="")}}}),Zl()})}),f.value.addEventListener("dragstart",p=>{const h=p.target,k=h.tagName==="IMG"?h:h.closest("img"),H=k?.closest(".dss-image-wrapper");k&&f.value.contains(k)&&(et.value=H||k,p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",p=>{et.value&&(p.preventDefault(),p.stopPropagation(),p.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",p=>{et.value&&(p.preventDefault(),p.stopPropagation())}),f.value.addEventListener("drop",p=>{if(!et.value||!f.value)return;p.preventDefault(),p.stopPropagation();const h=et.value,k=h.classList?.contains("dss-image-wrapper"),H=k?h.querySelector("img"):h,z=k?h:H?.closest(".dss-image-wrapper");if(!H||!f.value.contains(H)){et.value=null;return}let V=null;const Q=p.clientX,ee=p.clientY;if(document.caretRangeFromPoint)V=document.caretRangeFromPoint(Q,ee);else{const Ft=window.getSelection();Ft.rangeCount>0?V=Ft.getRangeAt(0).cloneRange():(V=document.createRange(),V.selectNodeContents(f.value),V.collapse(!1))}if(!V){et.value=null;return}const ge=V.commonAncestorContainer,Me=ge.nodeType===3?ge.parentElement:ge;if(Me?.closest(".dss-image-wrapper")===z||z&&z.contains(Me)){et.value=null;return}if(z&&(Me===z||z.contains(Me))){et.value=null;return}const xl=H.getAttribute("src");let ht=null;z?ht=z.cloneNode(!0):ht=H.cloneNode(!0);try{let Ft=V.startContainer;if(Ft.nodeType===3&&(Ft=Ft.parentElement),z&&(Ft===z||z.contains(Ft))){const yl=document.createRange();yl.setStartAfter(z),yl.collapse(!0),V=yl}V.insertNode(ht);const gl=document.createRange();gl.setStartAfter(ht),gl.collapse(!0);const Ot=window.getSelection();Ot.removeAllRanges(),Ot.addRange(gl)}catch{if(f.value.childNodes.length===0){const gl=document.createElement("p");gl.appendChild(ht),f.value.appendChild(gl)}else{const gl=f.value.lastChild;if(gl&&gl.nodeType===1)gl.appendChild(ht);else{const Ot=document.createElement("p");Ot.appendChild(ht),f.value.appendChild(Ot)}}}z?z.remove():H.remove(),et.value=null,e.nextTick(()=>{const Ft=f.value.querySelectorAll("img");let gl=!1;Ft.forEach(Ot=>{if(Ot.getAttribute("src")===xl)if(!gl)gl=!0;else{const yl=Ot.closest(".dss-image-wrapper");yl?yl.remove():Ot.remove()}}),Zl(),At()})}),f.value.addEventListener("dragend",p=>{et.value=null});let d=null;const u=new MutationObserver(p=>{p.forEach(h=>{h.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 H=k.querySelectorAll&&k.querySelectorAll("img");H&&H.forEach(z=>{z.removeAttribute("alt"),z.removeAttribute("data-alt"),z.setAttribute("alt",""),z.setAttribute("data-alt",""),z.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Zl(),Zn(),d=null},100)});if(u.observe(f.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const p=document.querySelector(".dss-text-editor-toolbar");if(p){const h=new MutationObserver(()=>{e.nextTick(()=>{Zn()})});h.observe(p,{childList:!0,subtree:!0}),p._toolbarMutationObserver=h}}),T.modelValue){const p=Ml(T.modelValue);f.value.innerHTML=p,xn()}e.nextTick(()=>{const p=f.value.innerHTML||"",h=T.title||"",k=T.description||"";Ht.value=p,oe.value=h,Y.value=k,j.value=h,pe.value=k,Ll(),Zl(),en(),yn(),Ql(),yo()}),sl(),tn(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",vo),window.removeEventListener("resize",Kn),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),Rn!==null&&(clearTimeout(Rn),Rn=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),qe.value&&clearTimeout(qe.value),Et.value&&clearTimeout(Et.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),He.value&&He.value.disconnect(),Ct.value!==null&&(cancelAnimationFrame(Ct.value),Ct.value=null),nt.value!==null&&(clearTimeout(nt.value),nt.value=null),St.value!==null&&(clearTimeout(St.value),St.value=null),$n(!0),f.value&&f.value._scrollHandlers){const{wrapper:n,content:s,handler:i}=f.value._scrollHandlers;n&&n.removeEventListener("scroll",i),s&&s.removeEventListener("scroll",i)}const a=document.querySelector(".dss-text-editor-toolbar");a&&a._toolbarMutationObserver&&a._toolbarMutationObserver.disconnect()});const Mo=a=>{const n=a.target,s=n.closest("a");if(s&&!T.disabled){a.preventDefault();const c=document.createRange();c.selectNodeContents(s);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const i=n.closest(".dss-image-wrapper");i&&n.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,p=u.nodeType===3?u.parentElement:u;if(i.contains(p)&&p!==i.querySelector("img")){const h=document.createRange();h.setStartAfter(i),h.collapse(!0),c.removeAllRanges(),c.addRange(h)}}Zl(),sl(),tn(),Mt(),yn()}):e.nextTick(()=>{Zl(),sl(),tn(),Mt(),yn()})},_o=()=>{Pn();const a=window.getSelection();if(a&&a.rangeCount>0){const s=a.getRangeAt(0);se.value=!s.collapsed&&Nn(s),!s.collapsed&&w.value&&(w.value=null)}else se.value=!1;if(Zl(),sl(),tn(),Mt(),yn(),a&&a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c&&c.closest(".dss-text-editor-footer")){a.removeAllRanges(),se.value=!1;return}}["bold","italic","underline"].forEach(s=>{try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(!c.collapsed)if(s==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let p=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(p=!0),!p&&u.style&&parseInt(u.style.fontWeight)>=600&&(p=!0),!p))try{const h=window.getComputedStyle(u);parseInt(h.fontWeight)>=600&&(p=!0)}catch{}ie.value[s]=p}else{const d=document.queryCommandState(s);ie.value[s]=d}}}catch{}})},yn=()=>{if(!T.richText||T.disabled||!f.value){A.value="p";return}try{const a=window.getSelection();if(!a||a.rangeCount===0){A.value="p";return}const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i||!f.value.contains(i)){A.value="p";return}const c=i.closest("h1, h2, h3, h4, h5, h6, p");if(!c){A.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?A.value=d:A.value="p"}catch{A.value="p"}},tn=()=>{if(!f.value){Ye.value=!1;return}try{const a=window.getSelection();let n=!1;if(a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");n=!!(c&&f.value.contains(c))}Ye.value=n}catch{Ye.value=!1}},Nn=a=>{if(!a||!f.value)return!1;const n=a.commonAncestorContainer;if(!n)return!1;const s=n.nodeType===3?n.parentElement:n;return s?f.value.contains(s):!1},Bn=()=>{Ge.value=!1},Mt=()=>{if(!T.floatingToolbar||!T.richText||T.disabled){Ge.value=!1;return}const a=window.getSelection();if(!a||a.rangeCount===0){Ge.value=!1;return}const n=a.getRangeAt(0);if(n.collapsed||!Nn(n)){Ge.value=!1;return}const s=n.getBoundingClientRect();if(!s||s.width===0&&s.height===0){Ge.value=!1;return}const i=f.value;if(!i){Ge.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){Ge.value=!1;return}const d=40,u=8,p=s.top-d/2+15;let h=s.left+s.width/2;const k=window.innerWidth||document.documentElement.clientWidth||0;let H=0;Qe.value&&(H=Qe.value.getBoundingClientRect().width);const z=(H||320)/2;let V=c.left+z,Q=c.right-z;if(Q<V){const ee=c.left+c.width/2;V=ee,Q=ee}if(k>0){const ee=z+u,ge=k-z-u;if(V=Math.max(V,ee),Q=Math.min(Q,ge),Q<V){const Me=k/2;V=Me,Q=Me}}h<V?h=V:h>Q&&(h=Q),be.value={position:"fixed",top:`${Math.max(p,8)}px`,left:`${h}px`,transform:"translate(-50%, -100%)",zIndex:10003},Ge.value=!0},I=a=>{T.disabled||!T.richText||(ct.value=ct.value===a?null:a,a==="askAi"&&(we.value=null))},Nl=()=>{ct.value=null,Ue.value=null},Bl=a=>{wt(a),Nl()};let Gl=null,cl=null,rl=null,Gt=null;const rn=a=>{if(T.disabled||!T.richText){Xl(),Dt();return}const n=a.target,s=n.closest("a"),i=n.closest("img");if(Gl&&(clearTimeout(Gl),Gl=null),rl&&(clearTimeout(rl),rl=null),s&&s!==cl){Dt(),cl=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),We.value=s,fe.value=c,X.value=!0,me.value=!0,kn(s)}else!s&&cl?(cl=null,Gl=setTimeout(()=>{me.value||Xl()},150)):s&&s===cl&&kn(s);if(i&&i!==Gt){Xl(),Gt=i;let c=i.getAttribute("alt");c===null&&(c=i.alt||"");let d=i.getAttribute("data-alt");d===null&&(d=c),i.hasAttribute("alt")||i.setAttribute("alt",c),i.hasAttribute("data-alt")||i.setAttribute("data-alt",d),yt.value=i,ke.value=c.trim()||B("textEditor.image.noAlt"),U.value=!0,G.value=!0,Pt(i)}else!i&&Gt?(Gt=null,rl=setTimeout(()=>{G.value||Dt()},150)):i&&i===Gt&&Pt(i)},fl=a=>{const n=a.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(cl=null,Gt=null,Gl&&(clearTimeout(Gl),Gl=null),rl&&(clearTimeout(rl),rl=null),Xl(),Dt())},Xl=()=>{me.value=!1,setTimeout(()=>{me.value||(X.value=!1,fe.value="",_e.value||(We.value=null))},100)},kn=a=>{if(!a||!f.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;R.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Dt=()=>{G.value=!1,setTimeout(()=>{G.value||(U.value=!1,ke.value="",gt.value||(yt.value=null))},100)},Pt=a=>{if(!a||!f.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;W.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Vt=()=>{if(!fe.value||!We.value)return;let n=We.value.getAttribute("href")||fe.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},hl=()=>{if(We.value){const a=We.value.textContent||"",n=We.value.getAttribute("href")||"",s=We.value;Je.value=n,pt.value=a,Le.value=a,me.value=!1,X.value=!1,fe.value="",We.value=s,_e.value=!0}else if(Ce.value){const a=window.getSelection();if(a.rangeCount>0){const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(i){const c=i.textContent||"",d=i.getAttribute("href")||"";Je.value=d,pt.value=c,Le.value=c,We.value=i,_e.value=!0}}}else{Se.value=el();const a=window.getSelection();let n="";a.rangeCount>0&&(n=a.getRangeAt(0).toString()),Je.value="",pt.value=n,Le.value="",We.value=null,_e.value=!0}e.nextTick(()=>{Z.value&&(Z.value.focus(),Z.value.select())})},Gn=()=>{_e.value=!1,Je.value="",pt.value="",Le.value="",We.value=null,Se.value=null},Qn=()=>{if(!Je.value.trim()){Gn();return}if(Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al(),pt.value.trim()||(pt.value=Je.value.trim()),We.value&&f.value&&f.value.contains(We.value)){const a=window.getSelection();a.rangeCount>0&&a.removeAllRanges();const n=We.value;if(n.setAttribute("href",Je.value.trim()),pt.value.trim()!==Le.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),a.removeAllRanges(),a.addRange(s),At()}else if(f.value){f.value.focus();const a=window.getSelection();a.removeAllRanges(),Se.value&&Vl(Se.value);let n=null;if(a.rangeCount>0&&(n=a.getRangeAt(0)),n&&!n.collapsed){n.toString();const s=document.createElement("a");s.href=Je.value.trim(),s.textContent=pt.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",n.deleteContents(),n.insertNode(s);const i=document.createTextNode(" ");n.setStartAfter(s),n.insertNode(i),n.setStartAfter(i),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(f.value),n.collapse(!1));const s=n.startContainer,i=s.nodeType===3,c=i&&n.startOffset===s.textContent.length,d=document.createElement("a");if(d.href=Je.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 p=u.nextElementSibling;if(p&&(p.innerHTML==="<br>"||p.innerHTML==="<br/>"||p.textContent.trim()==="")){p.textContent="",p.appendChild(d);const h=document.createTextNode(" ");p.appendChild(h);const k=document.createRange();k.setStartAfter(d),k.collapse(!0),a.removeAllRanges(),a.addRange(k)}else{if(n.startOffset>0){const k=s.textContent.substring(0,n.startOffset),H=k[k.length-1];if(H&&H!==" "&&H!==" "&&H!==`
|
|
104
|
-
`){const
|
|
105
|
-
`){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),a.removeAllRanges(),a.addRange(n)}}At()}e.nextTick(()=>{sl(),Gn()})},Mn=()=>{if(!f.value||J.value)return;const a=window.getSelection();let n=null;a&&a.rangeCount>0&&(n=el());const s=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,i=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:p=>{const h=p.parentElement;return!h||h.closest("a")||h.closest(".dss-image-wrapper")||!p.textContent||p.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=i.nextNode();)c.push(d);let u=!1;for(let p=c.length-1;p>=0;p--){const h=c[p],k=h.textContent;s.lastIndex=0;const H=[...k.matchAll(s)];if(H.length===0)continue;const z=H.filter(ee=>{const ge=ee[0],Me=ee.index;if(Me>0&&k[Me-1]==="@"||Me+ge.length<k.length&&k[Me+ge.length]==="@")return!1;const ft=h.parentElement;return!(ft&&ft.closest("a"))});if(z.length===0)continue;if(z.length===1&&z[0][0]===k.trim()){const ee=z[0][0],ge=ee.startsWith("http://")||ee.startsWith("https://")?ee:`https://${ee}`,Me=document.createElement("a");Me.href=ge,Me.textContent=ee,Me.style.color="#60afdf",Me.style.textDecoration="underline",h.parentNode&&(h.parentNode.replaceChild(Me,h),u=!0);continue}let V=0;const Q=document.createDocumentFragment();if(z.forEach(ee=>{const ge=ee.index,Me=ee[0];if(ge>V){const ht=k.substring(V,ge);ht&&Q.appendChild(document.createTextNode(ht))}const ft=Me.startsWith("http://")||Me.startsWith("https://")?Me:`https://${Me}`,xl=document.createElement("a");xl.href=ft,xl.textContent=Me,xl.style.color="#60afdf",xl.style.textDecoration="underline",Q.appendChild(xl),V=ge+Me.length}),V<k.length){const ee=k.substring(V);ee&&Q.appendChild(document.createTextNode(ee))}h.parentNode&&Q.childNodes.length>0&&(h.parentNode.replaceChild(Q,h),u=!0)}u&&n&&e.nextTick(()=>{Vl(n),sl()})},ho=()=>{if(!f.value)return;const a=/<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 i;for(;i=n.nextNode();)s.push(i);for(let c=s.length-1;c>=0;c--){const d=s[c],u=d.textContent,p=[...u.matchAll(a)];if(p.length===0)continue;let h=0;const k=document.createDocumentFragment();p.forEach(H=>{const z=H.index,V=H[0].startsWith("<u>")?"u":"ins",Q=H[1]||H[2]||"";z>h&&k.appendChild(document.createTextNode(u.substring(h,z)));const ee=document.createElement(V);ee.textContent=Q,k.appendChild(ee),h=z+H[0].length}),h<u.length&&k.appendChild(document.createTextNode(u.substring(h))),d.parentNode&&k.childNodes.length>0&&d.parentNode.replaceChild(k,d)}},Cn=a=>{if(!f.value||J.value)return;if(!a){ho();return}if(!["*","_",">"].includes(a))return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const i=s.getRangeAt(0);if(!i.collapsed)return;const c=i.startContainer.nodeType===Node.TEXT_NODE?i.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):i.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===f.value||!f.value.contains(c))return;const d=()=>{let ht="",Ft=0,gl=!1;const Ot=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Al=>Al.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let yl=0;for(;Ot.nextNode();){const Al=Ot.currentNode,nn=Al.textContent||"",bn=yl;if(yl+=nn.length,Al===i.startContainer){ht+=nn.substring(0,i.startOffset),Ft=bn+i.startOffset,gl=!0;break}ht+=nn}return gl||(Ft=ht.length),{textBeforeCursor:ht,cursorCharOffset:Ft}},{textBeforeCursor:u}=d();if(!u.length)return;let p=null,h=null;if(u.endsWith("**")&&(p=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(p=u.match(/__(.+?)__$/s))?h="strong":u.endsWith("*")&&!u.endsWith("**")&&(p=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(p=u.match(new RegExp("(?<!_)_([^_]+)_$")))?h="em":a===">"&&((p=u.match(/<u>(.+?)<\/u>$/s))||(p=u.match(/<ins>(.+?)<\/ins>$/s)))&&(h=p[0].startsWith("<u>")?"u":"ins",p[0].startsWith("<u>"),p[0].startsWith("<u>")),!p||!p[1])return;const k=p[0],H=p[1],z=u.length-k.length,Q=(ht=>{let Ft=0;const gl=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:yl=>yl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let Ot;for(;Ot=gl.nextNode();){const yl=(Ot.textContent||"").length;if(Ft+yl>=ht)return{node:Ot,offset:ht-Ft};Ft+=yl}return null})(z);if(!Q)return;const ee=document.createRange();ee.setStart(Q.node,Q.offset),ee.setEnd(i.endContainer,i.endOffset);const ge=document.createElement(h);ge.textContent=H,ee.deleteContents(),ee.insertNode(ge);const Me=window.getSelection(),ft=document.createRange();ft.setStartAfter(ge),ft.collapse(!0),Me.removeAllRanges(),Me.addRange(ft);const xl=el();e.nextTick(()=>{At(),xl&&Vl(xl)})},Un=()=>{f.value&&(ol.value=el(),ut.value="",Zt.value="",Ie.value="",kt.value="",xt.value="",qt.value=null,yt.value=null,Ne.value="upload",gt.value=!0,dl(),e.nextTick(()=>{Yt.value&&Yt.value.focus(),rt.value&&(rt.value.value="")}))},Xn=a=>{const n=a.target?.files?.[0];if(!n){qt.value=null,Zt.value="";return}qt.value=n;const s=new FileReader;s.onload=i=>{Zt.value=i.target?.result||""},s.readAsDataURL(n)},Jo=()=>{rt.value&&rt.value.click()},go=()=>{kt.value&&(xt.value="")},$o=()=>{xt.value&&(kt.value="")},_n=()=>{let a=yt.value;if(!a){const n=window.getSelection();if(n&&n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer;a=i.nodeType===1?i.closest("img"):i.parentElement?.closest("img")}}if(a){const n=a.getAttribute("data-alt")||a.getAttribute("alt")||"";yt.value=a,ut.value=n.trim()===""||n.trim()==="Image"?"":n;const s=a.getAttribute("src")||a.src||"";s.startsWith("http://")||s.startsWith("https://")?(Ie.value=s,Zt.value="",Ne.value="url"):(Zt.value=s,Ie.value="",Ne.value="upload");const c=a.style.width||a.getAttribute("width")||"",d=a.style.height||a.getAttribute("height")||"";kt.value=c.endsWith("px")?c.replace("px",""):c,xt.value=d.endsWith("px")?d.replace("px",""):d,ol.value=null}else{Un();return}gt.value=!0,G.value=!1,U.value=!1,e.nextTick(()=>{Ne.value==="url"&&Jt.value?(Jt.value.focus(),Jt.value.select()):Yt.value&&(Yt.value.focus(),Yt.value.select()),rt.value&&(rt.value.value="")})},Fn=()=>{gt.value=!1,ut.value="",Zt.value="",Ie.value="",kt.value="",xt.value="",qt.value=null,yt.value=null,ol.value=null,Ne.value="upload"},_l=()=>{const a=(ut.value||"").trim(),n=f.value?._mutationObserver;n&&n.disconnect(),Pe.value?(qe.value&&(clearTimeout(qe.value),qe.value=null),al(),Pe.value=!1):al();const s=Ne.value==="url"?Ie.value.trim():Zt.value;if(yt.value&&f.value&&f.value.contains(yt.value)){s&&(yt.value.src=s),yt.value.setAttribute("alt",a),yt.value.setAttribute("data-alt",a),kt.value?(yt.value.style.width=`${kt.value}px`,yt.value.setAttribute("width",kt.value)):(yt.value.style.removeProperty("width"),yt.value.removeAttribute("width")),xt.value?(yt.value.style.height=`${xt.value}px`,yt.value.setAttribute("height",xt.value)):(yt.value.style.removeProperty("height"),yt.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(yt.value),c.collapse(!0),i.addRange(c)}At()}else{if(!s){n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),Fn();return}if(f.value){f.value.focus();const i=window.getSelection();i&&i.rangeCount>0&&i.removeAllRanges();const c=window.getSelection();let d=null;if(ol.value&&(Vl(ol.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){Fn();return}const u=d.commonAncestorContainer,p=u.nodeType===3?u.parentElement:u;if(!f.value.contains(p)){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 h=document.createElement("img");h.src=s,h.setAttribute("alt",a),h.setAttribute("data-alt",a),kt.value&&(h.style.width=`${kt.value}px`,h.setAttribute("width",kt.value)),xt.value&&(h.style.height=`${xt.value}px`,h.setAttribute("height",xt.value));try{d.insertNode(h),d.setStartAfter(h),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(f.value){if(f.value.childNodes.length===0){const z=document.createElement("p");f.value.appendChild(z),z.appendChild(h)}else{const z=f.value.lastChild;if(z&&z.nodeType===1)z.appendChild(h);else{const V=document.createElement("p");f.value.appendChild(V),V.appendChild(h)}}const H=document.createRange();H.setStartAfter(h),H.collapse(!0),c&&(c.removeAllRanges(),c.addRange(H))}}yt.value=h,At()}}e.nextTick(()=>{n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),sl(),Mt(),Fn()})};e.watch(()=>T.modelValue,a=>{if(T.richText&&f.value&&!J.value){const n=Ml(a||""),i=f.value.innerHTML.replace(/ |\u00A0/g," "),c=n.replace(/ |\u00A0/g," ");if(i!==c){const d=el();f.value.innerHTML=n,e.nextTick(()=>{xn();const u=f.value.innerHTML||"",p=T.title||"",h=T.description||"";Ht.value=u,oe.value=p,Y.value=h,$t.value=u,j.value=p,pe.value=h,Ke.value=[],Ut.value=[],qe.value&&(clearTimeout(qe.value),qe.value=null),Pe.value=!1,d&&Vl(d),Ll(),Zl(),en(),sl(),Mt(),yn(),Yl("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>T.richText,a=>{a?(Mt(),e.nextTick(()=>{Ql()})):(Bn(),ae.value=[],He.value&&(He.value.disconnect(),He.value=null)),yn()}),e.watch(()=>T.floatingToolbar,a=>{a?Mt():Bn()}),e.watch(()=>T.disabled,a=>{a&&Bn(),yn()}),e.watch(()=>T.description,()=>{e.nextTick(()=>{M.value?lt():Tt()})}),e.watch(()=>T.title,()=>{e.nextTick(()=>{pl.value?ne():vt()})}),e.watch(()=>T.customToolbarSlots,()=>{e.nextTick(()=>{Zn()})},{deep:!0}),e.watch(()=>T.comments,(a,n)=>{if(T.commentUser){if(Xt.value){Xt.value=!1;return}Cl.value||T.richText&&f.value&&e.nextTick(()=>{yo()})}},{deep:!0,immediate:!1});const yo=()=>{if(T.commentUser&&!Cl.value&&!(!T.comments||!Array.isArray(T.comments)||T.comments.length===0)&&!(!T.richText||!f.value)){Cl.value=!0;try{const a=new Set,n=T.comments.filter(u=>{const p=String(u.conversation_id||u.id);return a.has(p)?!1:(a.add(p),!0)}),s=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),i=s.length;s.forEach(u=>{const p=u.parentNode;if(p){for(;u.firstChild;)p.insertBefore(u.firstChild,u);p.removeChild(u)}});let c=0;const d=new Set;n.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const p=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!p)return;const h=String(p);if(d.has(h))return;const k=f.value.querySelector(`[data-comment="${h}"]`);if(k){Jn(k,u),d.add(h);return}try{const H=To(u.selection_range,u.selection_text);if(H&&!H.collapsed){const z=H.commonAncestorContainer,V=z.nodeType===3?z.parentElement:z;if(V){const ge=V.closest("[data-comment], [data-fake-comment]");if(ge){const Me=ge.getAttribute("data-comment")||ge.getAttribute("data-fake-comment");if(String(Me)===String(p)){ge.setAttribute("data-comment",h),ge.removeAttribute("data-fake-comment"),Jn(ge,u),d.add(h);return}else return}}const Q=f.value.querySelector(`[data-comment="${h}"]`);if(Q){Jn(Q,u),d.add(h);return}const ee=document.createElement("span");ee.setAttribute("data-comment",h),Jn(ee,u);try{H.surroundContents(ee),c++,d.add(h)}catch{try{const Me=document.createRange();Me.setStart(H.startContainer,H.startOffset),Me.setEnd(H.endContainer,H.endOffset),Lo(Me),Me.surroundContents(ee),c++,d.add(h)}catch{try{const ft=H.extractContents();ee.appendChild(ft),H.insertNode(ee),c++,d.add(h)}catch(ft){console.warn("Failed to create comment marker:",ft)}}}}}catch{}}),e.nextTick(()=>{Yl("restoreCommentsFromModel"),At(),Cl.value=!1})}catch{Cl.value=!1}}},Lo=a=>{if(!a||!f.value)return a;try{const n=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let s=a.startContainer,i=a.startOffset;if(s.nodeType===3){const u=s.parentElement;u&&n.includes(u.tagName)&&(i===0&&!Yn(s)||a.setStartBefore(u))}else s.nodeType===1&&n.includes(s.tagName)&&i>0&&a.setStartBefore(s);let c=a.endContainer,d=a.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&n.includes(u.tagName)&&(d===c.length&&!ea(c)||a.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&d<c.childNodes.length&&a.setEndAfter(c);return a}catch{return a}},Yn=a=>{let n=a.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},ea=a=>{let n=a.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},To=(a,n)=>{if(!a||!f.value)return null;try{const s=document.createRange();if(a.type==="text"&&typeof a.start=="number"&&typeof a.end=="number"){let i=0;const c=[f.value];let d=null,u=!1,p=!1;for(;!p&&(d=c.pop());)if(d.nodeType===3){const h=i+d.length;!u&&a.start>=i&&a.start<=h&&(s.setStart(d,a.start-i),u=!0),u&&a.end>=i&&a.end<=h&&(s.setEnd(d,a.end-i),p=!0),i=h}else{let h=d.childNodes.length;for(;h--;)c.push(d.childNodes[h])}return u?Lo(s):null}}catch{return null}return null},Jn=(a,n)=>{if(!a||!n)return;const s=n.conversation||[],i=new Set,c=[],d=p=>{p&&p.id&&!i.has(p.id)&&(i.add(p.id),c.push(p))};s.length>0&&s.forEach(p=>{p.user&&d(p.user)}),c.length>0?a.setAttribute("data-comment-user",JSON.stringify(c[0])):a.removeAttribute("data-comment-user"),c.length>1?a.setAttribute("data-comment-user-2",JSON.stringify(c[1])):a.removeAttribute("data-comment-user-2");const u=s.length;u>0?a.setAttribute("data-comment-count",String(u)):a.removeAttribute("data-comment-count")},Yl=(a="unknown")=>{if(!T.commentUser||!T.richText||!f.value){ae.value=[];return}Date.now()-bt.value<_t&&Ct.value!==null||Ct.value===null&&(Ct.value=requestAnimationFrame(()=>{if(Ct.value=null,bt.value=Date.now(),Re.value)return;Re.value=!0;const s={},i=f.value;if(!i){Re.value=!1;return}const c=i.closest(".editor-with-comments");if(!c){Re.value=!1;return}const d=i.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],p=new Set;d.forEach(V=>{const Q=V.getAttribute("data-comment")||V.getAttribute("data-fake-comment");Q&&V.tagName==="SPAN"&&(p.has(Q)||(u.push(V),p.add(Q)))}),d.forEach(V=>{const Q=V.getAttribute("data-comment")||V.getAttribute("data-fake-comment");!Q||p.has(Q)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(V.tagName)?V.querySelector(`span[data-comment="${Q}"], span[data-fake-comment="${Q}"]`)||(u.push(V),p.add(Q)):V.tagName!=="SPAN"&&(u.push(V),p.add(Q)))});const h=c.getBoundingClientRect(),k=i.getBoundingClientRect();u.forEach((V,Q)=>{let ee=V.getAttribute("data-comment")||V.getAttribute("data-fake-comment");if(!ee)return;if(typeof ee=="string"&&ee.startsWith("comment-")){const cn=V.textContent?.trim(),Jl=T.comments?.find(Ol=>(typeof Ol.conversation_id=="string"&&Ol.conversation_id.startsWith("comment-")?null:Ol.conversation_id)&&Ol.selection_text?.trim()===cn);Jl?(ee=String(Jl.conversation_id),V.setAttribute("data-comment",ee),V.removeAttribute("data-fake-comment")):(ee=String(Date.now()),V.setAttribute("data-comment",ee),V.removeAttribute("data-fake-comment"))}const ge=V.getBoundingClientRect(),Me=window.getComputedStyle(V),ft=parseFloat(Me.lineHeight)||parseFloat(Me.fontSize)*1.2,Ft=ge.top-k.top+ft/2-15,Ot=k.top-h.top+Ft;let yl=null,Al=null,nn=0;const bn=[],Co=new Set;if(ee&&T.comments){const cn=T.comments.find(Jl=>String(Jl.conversation_id||Jl.id)===String(ee));if(cn){const Jl=cn.conversation||[];Jl.length>0?(Jl.forEach(Ol=>{Ol.user&&Ol.user.id&&!Co.has(Ol.user.id)&&(Co.add(Ol.user.id),bn.push(Ol.user))}),nn=Jl.length):(nn=0,yl=null,Al=null),bn.length>0?yl=bn[0]:yl=null,bn.length>1?Al=bn[1]:Al=null}}const Do=ge.top+ft/2-15,bo=Do+30,Ho=5,to=bo>k.top+Ho&&Do<k.bottom-Ho?1:0;ae.value.find(cn=>cn.id===ee);let lo=V;if(!lo&&ee&&f.value){const cn=String(ee);lo=f.value.querySelector(`[data-comment="${cn}"], [data-fake-comment="${cn}"]`)}const Qt=bn.length;s[ee]?(s[ee].top=Ot,s[ee].opacity=to,s[ee].element=lo,s[ee].firstUser=yl,s[ee].secondUser=Al,s[ee].totalCount=nn,s[ee].uniqueUserCount=Qt):s[ee]={id:ee,top:Ot,opacity:to,element:lo,firstUser:yl,secondUser:Al,totalCount:nn,uniqueUserCount:Qt}});const H=Object.values(s).map(V=>{const Q=Math.max(0,(V.uniqueUserCount??0)-2);if(!V.element&&V.id&&f.value){const ge=String(V.id);V.element=f.value.querySelector(`[data-comment="${ge}"], [data-fake-comment="${ge}"]`)}return{...V,firstUser:V.firstUser||null,secondUser:V.secondUser||null,totalCount:V.totalCount,additionalCount:Q}});(ae.value.length!==H.length||H.some((V,Q)=>{const ee=ae.value[Q];if(!ee)return!0;const ge=(ee.firstUser?.id||null)!==(V.firstUser?.id||null),Me=(ee.secondUser?.id||null)!==(V.secondUser?.id||null);return ee.id!==V.id||Math.abs(ee.top-V.top)>1||ee.opacity!==V.opacity||ee.totalCount!==V.totalCount||ee.additionalCount!==V.additionalCount||ge||Me||ee.element!==V.element}))&&(ae.value=H),Re.value=!1}))},Ao=a=>{if(!a)return;let n=a.element;if(!n&&a.id&&f.value){const s=String(a.id);n=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}n&&($n(),zl.value=n,n.classList.add("editor-comment-highlighted"))},$n=(a=!1)=>{!a&&nl.value!==null&&zl.value&&(zl.value.getAttribute("data-comment")||zl.value.getAttribute("data-fake-comment"))===nl.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))},ko=a=>{if(!a||!a.element)return;$n(!0);const n=a.element.getAttribute("data-comment")||a.element.getAttribute("data-fake-comment");if(!n)return;const s=`[data-comment="${n}"], [data-fake-comment="${n}"]`;he("comment-marker-clicked",{commentId:n,selector:s,element:a.element})},ln=()=>{$n()},Ql=()=>{!T.richText||!f.value||(He.value&&He.value.disconnect(),St.value!==null&&(clearTimeout(St.value),St.value=null),He.value=new MutationObserver(()=>{St.value===null&&(St.value=setTimeout(()=>{St.value=null,e.nextTick(()=>{Yl("MutationObserver")})},200))}),He.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"]}),Yl("setupCommentMarkersObserver-initial"))},eo=(a,n)=>{if(!a||!n)return;const s=n.getBoundingClientRect();let i=s.top,c=s.right+4;a.style.top=`${i}px`,a.style.left=`${c}px`,a.offsetHeight;const d=a.getBoundingClientRect(),u=window.innerWidth,p=window.innerHeight;if(d.right>u){const h=s.left-d.width-4;a.style.left=`${h}px`}if(d.bottom>p){const h=Math.max(8,p-d.height-8);a.style.top=`${h}px`}d.top<0&&(a.style.top="8px")};return e.watch(()=>Ue.value,a=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const i=s.getAttribute("data-submenu-id");if(i===a&&a){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${i}"]`);if(c){if(s.parentNode!==document.body){const d=s.parentNode;s.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(s)}s.style.display="block",s.style.visibility="hidden",s.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{eo(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,ct.value],()=>{we.value==="askAi"||ct.value==="askAi"?e.nextTick(()=>{Bo()}):(Ue.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 i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(i)if(n.dataset.originalParentRef==="inside")i.appendChild(n);else{const d=i.closest(".dss-toolbar-dropdown");d&&d.insertBefore(n,i.nextSibling)}}}})}))}),e.watch(()=>T.locale,a=>{a&&a!==de.value&&(de.value=a)},{immediate:!0}),le({openCommentOverlayForSelector:Yo,updateCommentMarkers:Yl,restoreCommentsFromModel:yo}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container",[{"editor-with-comments":Lt.value},zt.value]]),style:e.normalizeStyle(Bt.value)},[E.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Ed,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:fn,title:e.unref(B)("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,Sd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!jl.value}]),onClick:Hn,title:e.unref(B)("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,Vd),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Nd,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=s=>Wn("paragraph")),title:e.unref(B)("textEditor.toolbar.paragraphFormat")},[A.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:P.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Md)):A.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:P.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,_d)):A.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:P.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,$d)):A.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:P.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Ld)):A.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:P.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Td)):A.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:P.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Ad)):(e.openBlock(),e.createElementBlock("svg",Dd,[...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,Bd),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=>wt("<h1>"))},[e.createElementVNode("img",{src:P.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Hd),e.createElementVNode("h1",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=s=>wt("<h2>"))},[e.createElementVNode("img",{src:P.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Rd),e.createElementVNode("h2",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=s=>wt("<h3>"))},[e.createElementVNode("img",{src:P.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Fd),e.createElementVNode("h3",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=s=>wt("<h4>"))},[e.createElementVNode("img",{src:P.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Id),e.createElementVNode("h4",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=s=>wt("<h5>"))},[e.createElementVNode("img",{src:P.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,zd),e.createElementVNode("h5",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=s=>wt("<h6>"))},[e.createElementVNode("img",{src:P.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Pd),e.createElementVNode("h6",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=s=>wt("<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(B)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("bold")}]),onClick:n[9]||(n[9]=s=>Il("bold")),title:e.unref(B)("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,Od),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("italic")}]),onClick:n[10]||(n[10]=s=>Il("italic")),title:e.unref(B)("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,Wd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("underline")}]),onClick:n[11]||(n[11]=s=>Il("underline")),title:e.unref(B)("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,qd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ye.value}]),onClick:Sn,title:e.unref(B)("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,Zd),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:mt,title:e.unref(B)("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,Xd)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:ot,title:e.unref(B)("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,Ud)),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":ll("insertUnorderedList")}]),onClick:ce,title:e.unref(B)("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,Yd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("insertOrderedList")}]),onClick:tl,title:e.unref(B)("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,jd),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Un,title:e.unref(B)("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,Kd),Lt.value&&se.value?(e.openBlock(),e.createElementBlock("div",Gd)):e.createCommentVNode("",!0),Lt.value&&se.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(B)("textEditor.toolbar.comment"),onClick:Ul},[...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,Qd)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",Jd)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",e1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=s=>Wn("askAi")),title:e.unref(B)("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",l1,e.toDisplayString(e.unref(B)("textEditor.toolbar.askAi")),1)],8,t1),we.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(a.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",n1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[$l(s)?(e.openBlock(),e.createElementBlock("div",o1,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),$l(s)&&i<E.customToolbarSlots.length-1&&zn(i)?(e.openBlock(),e.createElementBlock("div",a1)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(we.value==="paragraph"||we.value==="askAi")&&E.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:dl})):e.createCommentVNode("",!0),e.createVNode(ia,{showModal:_e.value,width:"500px",height:"55vh",onCloseModal:Gn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(B)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",s1,[e.createElementVNode("div",r1,[e.createElementVNode("label",i1,e.toDisplayString(e.unref(B)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Fe,type:"text","onUpdate:modelValue":n[15]||(n[15]=s=>pt.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Qn,["enter"])},null,40,c1),[[e.vModelText,pt.value]])]),e.createElementVNode("div",u1,[e.createElementVNode("label",d1,e.toDisplayString(e.unref(B)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Z,type:"text","onUpdate:modelValue":n[16]||(n[16]=s=>Je.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Qn,["enter"])},null,40,m1),[[e.vModelText,Je.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Gn},e.toDisplayString(e.unref(B)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Qn},e.toDisplayString(e.unref(B)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(ia,{showModal:gt.value,width:"500px",height:"80vh",onCloseModal:Fn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(yt.value?e.unref(B)("textEditor.image.editImage"):e.unref(B)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",p1,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Ne.value==="upload"}]),onClick:n[17]||(n[17]=s=>Ne.value="upload")},e.toDisplayString(e.unref(B)("textEditor.image.upload")),3),n[65]||(n[65]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Ne.value==="url"}]),onClick:n[18]||(n[18]=s=>Ne.value="url")},e.toDisplayString(e.unref(B)("textEditor.image.imageLink")),3)]),Ne.value==="upload"?(e.openBlock(),e.createElementBlock("div",v1,[e.createElementVNode("div",f1,[e.createElementVNode("div",h1,[dn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",g1,e.toDisplayString(e.unref(B)("textEditor.image.uploadImage")),1)),dn.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Jo},[e.createElementVNode("img",{src:Zt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,y1),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:rt,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Xn},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:rt,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Xn},null,544))]),e.createElementVNode("div",k1,[e.createElementVNode("label",C1,e.toDisplayString(e.unref(B)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Yt,type:"text","onUpdate:modelValue":n[19]||(n[19]=s=>ut.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.enterAltText"),onKeyup:e.withKeys(_l,["enter"])},null,40,b1),[[e.vModelText,ut.value]])]),e.createElementVNode("div",w1,[e.createElementVNode("label",x1,e.toDisplayString(e.unref(B)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=s=>kt.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.auto"),onKeyup:e.withKeys(_l,["enter"]),onInput:go},null,40,E1),[[e.vModelText,kt.value]])]),e.createElementVNode("div",S1,[e.createElementVNode("label",V1,e.toDisplayString(e.unref(B)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=s=>xt.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.auto"),onKeyup:e.withKeys(_l,["enter"]),onInput:$o},null,40,N1),[[e.vModelText,xt.value]])])])])):e.createCommentVNode("",!0),Ne.value==="url"?(e.openBlock(),e.createElementBlock("div",B1,[e.createElementVNode("div",M1,[e.createElementVNode("div",_1,[e.createElementVNode("label",$1,e.toDisplayString(e.unref(B)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Jt,type:"text","onUpdate:modelValue":n[22]||(n[22]=s=>Ie.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(_l,["enter"])},null,40,L1),[[e.vModelText,Ie.value]])]),e.createElementVNode("div",T1,[e.createElementVNode("label",A1,e.toDisplayString(e.unref(B)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=s=>ut.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.enterAltText"),onKeyup:e.withKeys(_l,["enter"])},null,40,D1),[[e.vModelText,ut.value]])]),e.createElementVNode("div",H1,[e.createElementVNode("label",R1,e.toDisplayString(e.unref(B)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=s=>kt.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.auto"),onKeyup:e.withKeys(_l,["enter"]),onInput:go},null,40,F1),[[e.vModelText,kt.value]])]),e.createElementVNode("div",I1,[e.createElementVNode("label",z1,e.toDisplayString(e.unref(B)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=s=>xt.value=s),class:"dss-link-modal-input",placeholder:e.unref(B)("textEditor.image.auto"),onKeyup:e.withKeys(_l,["enter"]),onInput:$o},null,40,P1),[[e.vModelText,xt.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Fn},e.toDisplayString(e.unref(B)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:_l},e.toDisplayString(e.unref(B)("textEditor.image.save")),1)]),_:1},8,["showModal"]),E.showTitle?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Fl.value&&pl.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(B)("textEditor.labels.title")),1),e.createElementVNode("div",O1,[pl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",W1,[E.title?(e.openBlock(),e.createElementBlock("span",q1,e.toDisplayString(E.title),1)):(e.openBlock(),e.createElementBlock("span",Z1,e.toDisplayString(wn.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:xe,value:E.title,onInput:tt,onFocus:Ae,onBlur:it,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!pl.value}]),placeholder:wn.value,disabled:E.disabled,rows:"1"},null,42,U1)])],2)):e.createCommentVNode("",!0),E.showTitle&&Fl.value&&pl.value?(e.openBlock(),e.createElementBlock("div",X1,[e.renderSlot(a.$slots,"title-slot")])):e.createCommentVNode("",!0),E.showDescription?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":Kl.value&&M.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(B)("textEditor.labels.description")),1),e.createElementVNode("div",Y1,[M.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",j1,[E.description?(e.openBlock(),e.createElementBlock("span",K1,e.toDisplayString(E.description),1)):(e.openBlock(),e.createElementBlock("span",G1,e.toDisplayString(Dl.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:je,value:E.description,onInput:wl,onFocus:kl,onBlur:Sl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!M.value}]),placeholder:Dl.value,disabled:E.disabled,rows:"1"},null,42,Q1)])],2)):e.createCommentVNode("",!0),E.showDescription&&Kl.value&&M.value?(e.openBlock(),e.createElementBlock("div",J1,[e.renderSlot(a.$slots,"description-slot")])):e.createCommentVNode("",!0),Lt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:6},e.renderList(ae.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":nl.value===s.id,"editor-comment-marker-group-out-of-view":s.opacity===0}]),"data-comment-id":s.id,style:e.normalizeStyle({top:s.top+"px"}),onMouseenter:i=>Ao(s),onMouseleave:ln},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>ko(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,lm)):(e.openBlock(),e.createElementBlock("span",nm,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,tm)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>ko(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,am)):(e.openBlock(),e.createElementBlock("span",sm,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,om)):e.createCommentVNode("",!0),s.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:s.secondUser?"30px":"15px"}),"data-has-second-user":s.secondUser?"true":"false",onClick:e.withModifiers(i=>ko(s),["stop"])},[e.createElementVNode("span",im,"+"+e.toDisplayString(s.additionalCount),1)],12,rm)):e.createCommentVNode("",!0)],46,em))),128)):e.createCommentVNode("",!0),E.richText?(e.openBlock(),e.createElementBlock("div",fm,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":E.disabled,"dss-text-editor-fixed-height":E.fixedHeight}]),style:e.normalizeStyle(ql.value),onInput:At,onBlur:vn,onClick:Mo,onMouseup:_o,onKeyup:_o,onKeydown:jo,onPaste:qn,onMousemove:rn,onMouseleave:fl},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[Lt.value&&nl.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(y.value)},[q.value||at.value.length>0?(e.openBlock(),e.createElementBlock("div",hm,[e.createElementVNode("div",gm,[q.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:q.value},null,8,ym)):e.createCommentVNode("",!0)]),e.createElementVNode("div",km,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value,(s,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:"dss-comment-message"},[s.user&&(s.user.avatar||s.user.initials||s.user.name)?(e.openBlock(),e.createElementBlock("div",Cm,[e.createElementVNode("div",bm,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,wm)):(e.openBlock(),e.createElementBlock("span",xm,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Em,[e.createElementVNode("div",Sm,[e.createElementVNode("div",Vm,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",Nm,e.toDisplayString($(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":O(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),T.commentUser&&s.user&&s.user.id===T.commentUser.id&&!O(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>uo(s,i),["stop"]),title:e.unref(B)("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,Bm)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Mm,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:x,"onUpdate:modelValue":n[26]||(n[26]=s=>g.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(B)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(hn,["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,_m),[[e.vModelText,g.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(hn,["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",$m,[e.createElementVNode("div",Lm,[e.createElementVNode("span",Tm,e.toDisplayString(il.value)+" "+e.toDisplayString(il.value===1?e.unref(B)("textEditor.footer.word"):e.unref(B)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Am,e.toDisplayString(vl.value)+" "+e.toDisplayString(vl.value===1?e.unref(B)("textEditor.footer.character"):e.unref(B)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",cm,[e.createElementVNode("textarea",{value:E.modelValue,onInput:D,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":E.fixedHeight}]),placeholder:mn.value,rows:E.rows,disabled:E.disabled,style:e.normalizeStyle(Kt.value)},null,46,um),e.createElementVNode("div",dm,[e.createElementVNode("div",mm,[e.createElementVNode("span",pm,e.toDisplayString(il.value)+" "+e.toDisplayString(il.value===1?e.unref(B)("textEditor.footer.word"):e.unref(B)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",vm,e.toDisplayString(vl.value)+" "+e.toDisplayString(vl.value===1?e.unref(B)("textEditor.footer.character"):e.unref(B)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[X.value&&fe.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(R.value),onMouseenter:n[28]||(n[28]=s=>me.value=!0),onMouseleave:Xl},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Vt,["stop"]),title:fe.value},e.toDisplayString(fe.value),9,Dm),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(hl,["stop"]),title:e.unref(B)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Rm,[...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,Hm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[U.value&&ke.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(W.value),onMouseenter:n[29]||(n[29]=s=>G.value=!0),onMouseleave:Dt},[e.createElementVNode("div",Fm,[ke.value===e.unref(B)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Im,[...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:ke.value},e.toDisplayString(ke.value),9,zm)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(_n,["stop"]),title:e.unref(B)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",Om,[...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,Pm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[E.floatingToolbar&&E.richText&&Ge.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Qe,class:"dss-floating-toolbar",style:e.normalizeStyle(be.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Wm,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(fn,["stop"]),title:e.unref(B)("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,qm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!jl.value}]),onClick:e.withModifiers(Hn,["stop"]),title:e.unref(B)("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,Zm),n[89]||(n[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Um,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(s=>I("paragraph"),["stop"])),title:e.unref(B)("textEditor.toolbar.paragraphFormat")},[A.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:P.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Ym)):A.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:P.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,jm)):A.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:P.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Km)):A.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:P.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Gm)):A.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:P.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Qm)):A.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:P.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Jm)):(e.openBlock(),e.createElementBlock("svg",e2,[...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,Xm),ct.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=>Bl("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=s=>Bl("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=s=>Bl("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=s=>Bl("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=s=>Bl("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=s=>Bl("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(B)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=s=>Bl("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(B)("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":ll("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(s=>Il("bold"),["stop"])),title:e.unref(B)("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,t2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(s=>Il("italic"),["stop"])),title:e.unref(B)("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,l2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(s=>Il("underline"),["stop"])),title:e.unref(B)("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,n2),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(Sn,["stop"]),title:e.unref(B)("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,o2),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(mt,["stop"]),title:e.unref(B)("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,s2)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(ot,["stop"]),title:e.unref(B)("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,a2)),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":ll("insertUnorderedList")}]),onClick:e.withModifiers(ce,["stop"]),title:e.unref(B)("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,r2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ll("insertOrderedList")}]),onClick:e.withModifiers(tl,["stop"]),title:e.unref(B)("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,i2),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Un,["stop"]),title:e.unref(B)("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,c2),Lt.value?(e.openBlock(),e.createElementBlock("div",u2)):e.createCommentVNode("",!0),Lt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(B)("textEditor.toolbar.comment"),onClick:e.withModifiers(Ul,["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,d2)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",m2)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",p2,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(s=>I("askAi"),["stop"])),title:e.unref(B)("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",f2,e.toDisplayString(e.unref(B)("textEditor.toolbar.askAi")),1)],8,v2),ct.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[43]||(n[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(a.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),bl.value?(e.openBlock(),e.createElementBlock("div",h2,[E.askAi&&bl.value?(e.openBlock(),e.createElementBlock("div",g2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[$l(s)&&on(s)?(e.openBlock(),e.createElementBlock("div",y2,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),$l(s)&&on(s)&&i<E.customToolbarSlots.length-1&&Dn(i)?(e.openBlock(),e.createElementBlock("div",k2)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),w2={class:"dss-color-picker__section-title"},x2={class:"dss-color-picker__presets-row"},E2=["title","onClick"],S2={key:1,class:"dss-color-picker__section"},V2={class:"dss-color-picker__presets-row"},N2=["title","onClick"],B2={key:2,class:"dss-color-picker__section"},M2={class:"dss-color-picker__section-header"},_2={class:"dss-color-picker__presets-row"},$2=["title","onClick"],L2=["onClick"],T2={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},A2=["title","onClick"],D2={class:"dss-color-picker__input-row"},H2=["value"],R2={__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(E,{emit:le}){function _(oe){const Y=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(oe);if(!Y)return{h:0,s:0,l:50};const j=parseInt(Y[1],16)/255,pe=parseInt(Y[2],16)/255,xe=parseInt(Y[3],16)/255,je=Math.max(j,pe,xe),Rt=Math.min(j,pe,xe);let jt=0,et=0;const pl=(je+Rt)/2;if(je!==Rt){const M=je-Rt;switch(et=pl>.5?M/(2-je-Rt):M/(je+Rt),je){case j:jt=((pe-xe)/M+(pe<xe?6:0))/6;break;case pe:jt=((xe-j)/M+2)/6;break;case xe:jt=((j-pe)/M+4)/6;break}}return{h:jt*360,s:et*100,l:pl*100}}function B(oe,Y,j){Y/=100,j/=100;const pe=Y*Math.min(j,1-j),xe=je=>{const Rt=(je+oe/30)%12,jt=j-pe*Math.max(Math.min(Rt-3,9-Rt,1),-1);return Math.round(255*jt).toString(16).padStart(2,"0")};return`#${xe(0)}${xe(8)}${xe(4)}`}function de(oe){const Y=oe.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!Y)return null;let j=Y[1];return j.length===3&&(j=j.split("").map(pe=>pe+pe).join("")),"#"+j}function P(oe){const Y=oe.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!Y)return null;const j=Math.max(0,Math.min(255,Number.parseInt(Y[1],10))),pe=Math.max(0,Math.min(255,Number.parseInt(Y[2],10))),xe=Math.max(0,Math.min(255,Number.parseInt(Y[3],10)));return`#${j.toString(16).padStart(2,"0")}${pe.toString(16).padStart(2,"0")}${xe.toString(16).padStart(2,"0")}`}function T(oe){if(typeof oe!="string")return null;const Y=oe.trim();return de(Y)||P(Y)}function he(oe,Y,j){Y/=100,j/=100;const pe=j+Y*Math.min(j,1-j),xe=pe===0?0:2-2*j/pe;return{h:oe,s:xe*100,v:pe*100}}function st(oe,Y,j){Y/=100,j/=100;const pe=j*(1-Y/2),xe=pe===0||pe===1?0:(j-pe)/Math.min(pe,1-pe);return{h:oe,s:xe*100,l:pe*100}}const te=E,f=le,we=e.ref(!1),Ce=e.ref(!1),J=e.ref(!1),X=e.ref(-1),fe=e.ref(-1),R=e.ref(null),me=e.ref(null),_e=e.ref(null),Je=e.ref(null),pt=e.ref({top:0,left:0}),Z=e.ref(_(te.modelValue||"#b8a5de")),Fe=e.computed(()=>Array.isArray(te.presetGroups)&&te.presetGroups.length>0),We=e.computed(()=>!te.disableCustomColors),Se=e.computed(()=>Fe.value?0:te.initialPresetCount!=null?te.initialPresetCount:fe.value<0?null:fe.value),Le=e.computed(()=>{const oe=Se.value;return oe==null?!0:Math.max(0,te.presetColors.length-oe)<te.max}),Ye=e.computed(()=>!!(Ce.value||X.value>=0||!ie.value&&te.presetColors.length===0));e.computed(()=>{const oe=Se.value;return oe!=null&&te.presetColors.length>oe});const ie=e.computed(()=>Fe.value||Se.value!=null),Ge=e.computed(()=>{const oe=Se.value;return oe==null?[]:te.presetColors.slice(0,oe)}),be=e.computed(()=>{const oe=Se.value;return oe==null?[]:te.presetColors.slice(oe)});function Qe(oe){const Y=Se.value;return Y!=null?Y+oe:-1}function ct(oe){const Y=Se.value;return Y!=null&&oe>=Y}function gt(oe){ct(oe)&&(X.value=oe,Z.value=_(te.presetColors[oe]),Ce.value=!0,e.nextTick(()=>Je.value?.focus()))}function ut(oe){if(!ct(oe))return;const Y=te.presetColors.filter((xe,je)=>je!==oe);f("update:presetColors",Y);const j=de(te.modelValue),pe=de(te.presetColors[oe]);if(j&&pe&&j.toLowerCase()===pe.toLowerCase()){const xe=Y[Math.max(0,oe-1)]||Y[0];xe&&f("update:modelValue",xe)}}function qt(){J.value=!J.value,J.value||(X.value=-1,Ce.value=!1)}function Zt(){if(!We.value||X.value<0)return;const oe=rt.value,Y=de(oe);if(Y){const j=[...te.presetColors];j[X.value]=Y,f("update:presetColors",j),f("update:modelValue",Y),X.value=-1,Ce.value=!1}}function kt(){te.disabled||!We.value||(X.value=-1,Ce.value=!Ce.value,Ce.value&&(G(),e.nextTick(()=>Je.value?.focus())))}function xt(oe){const Y=T(oe),j=T(te.modelValue);return Y&&j&&Y.toLowerCase()===j.toLowerCase()}function Yt(){if(te.disabled||!We.value||!Le.value)return;const oe=rt.value,Y=de(oe);if(Y){const j=[...te.presetColors,Y];f("update:presetColors",j),f("update:modelValue",Y);const pe=Se.value??fe.value;pe>=0&&j.length-pe>=te.max&&(Ce.value=!1)}}const rt=e.computed(()=>{const{h:oe,s:Y,l:j}=Z.value;return B(oe,Y,j)}),Jt=e.computed(()=>rt.value.toLowerCase()),yt=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${Z.value.h}, 100%, 50%))`})),ol=e.computed(()=>{const oe=he(Z.value.h,Z.value.s,Z.value.l);return{left:`${oe.s}%`,bottom:`${oe.v}%`,transform:"translate(-50%, 50%)"}}),U=e.computed(()=>({left:`${Z.value.h/360*100}%`,transform:"translateX(-50%)"})),ke=e.computed(()=>({position:"fixed",left:`${pt.value.left}px`,top:`${pt.value.top}px`,zIndex:1002}));function W(){if(!R.value||!we.value)return;const oe=R.value.getBoundingClientRect(),Y=window.innerHeight||document.documentElement.clientHeight;let j=oe.bottom+4;const pe=me.value;pe&&j+pe.offsetHeight>Y-8&&(j=oe.top-4-pe.offsetHeight),pt.value={top:j,left:oe.left}}function G(){const oe=te.modelValue||"#b8a5de",Y=T(oe);Y&&(Z.value=_(Y))}function Ne(){f("update:modelValue",rt.value)}function Ie(){te.disabled||(we.value=!we.value,we.value&&(G(),e.nextTick(()=>{W(),Je.value?.focus()})))}function Ue(){const oe=rt.value,Y=de(oe);if(Y){if(X.value>=0){const j=[...te.presetColors];j[X.value]=Y,f("update:presetColors",j),f("update:modelValue",Y)}else if(We.value&&(te.presetColors.length>0||Fe.value)&&Ce.value&&Le.value&&!te.presetColors.some(pe=>de(pe)?.toLowerCase()===Y.toLowerCase())){const pe=[...te.presetColors,Y];f("update:presetColors",pe),f("update:modelValue",Y)}}we.value=!1,Ce.value=!1,J.value=!1,X.value=-1}function Et(oe){if(!_e.value)return;const Y=_e.value.getBoundingClientRect(),j=pe=>{const xe=Math.max(0,Math.min(1,(pe.clientX-Y.left)/Y.width)),je=Math.max(0,Math.min(1,1-(pe.clientY-Y.top)/Y.height)),Rt={h:Z.value.h,s:xe*100,v:je*100};Z.value=st(Rt.h,Rt.s,Rt.v)};j(oe),document.addEventListener("mousemove",j),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",j),Ne()},{once:!0})}function Ke(oe){if(!oe.currentTarget)return;const j=oe.currentTarget.getBoundingClientRect(),pe=xe=>{const je=Math.max(0,Math.min(1,(xe.clientX-j.left)/j.width));Z.value={...Z.value,h:je*360}};pe(oe),document.addEventListener("mousemove",pe),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",pe),Ne()},{once:!0})}function Ut(oe){const Y=oe.target.value,j=T(Y);j&&(Z.value=_(j),f("update:modelValue",j))}function qe(oe){if(te.disabled)return;const Y=T(oe);Y&&(Z.value=_(Y),f("update:modelValue",Y))}let Pe=null,Ht=null;function $t(){Pe&&(document.removeEventListener("keydown",Pe),Pe=null),Ht&&(window.removeEventListener("resize",Ht),Ht=null)}return e.watch(we,oe=>{if($t(),oe){if(!Fe.value&&te.initialPresetCount==null){const Y=te.presetColors.length;Y>0&&(fe.value<0||Y<fe.value)&&(fe.value=Y)}Pe=Y=>{Y.key==="Escape"&&Ue()},Ht=W,document.addEventListener("keydown",Pe),window.addEventListener("resize",Ht)}}),e.watch(()=>te.modelValue,()=>{we.value&&G()},{immediate:!1}),e.watch(be,oe=>{oe.length===0&&(J.value=!1,X.value=-1,Ce.value=!1)}),e.onBeforeUnmount($t),(oe,Y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":E.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:R,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":we.value}]),onClick:Ie},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:rt.value})},[...Y[0]||(Y[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[we.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Ue,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:me,class:"dss-color-picker__dropdown",style:e.normalizeStyle(ke.value)},[ie.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Fe.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(E.presetGroups,(j,pe)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+pe,class:"dss-color-picker__section"},[e.createElementVNode("span",w2,e.toDisplayString(j.title),1),e.createElementVNode("div",x2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.colors,(xe,je)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+pe+"-"+je,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xt(xe)}]),style:e.normalizeStyle({backgroundColor:xe,"--dss-preset-color":xe}),title:xe,onClick:e.withModifiers(Rt=>qe(xe),["stop"])},null,14,E2))),128))])]))),128)):Ge.value.length?(e.openBlock(),e.createElementBlock("div",S2,[Y[1]||(Y[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",V2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,(j,pe)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+pe,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xt(j)}]),style:e.normalizeStyle({backgroundColor:j,"--dss-preset-color":j}),title:j,onClick:e.withModifiers(xe=>qe(j),["stop"])},null,14,N2))),128))])])):e.createCommentVNode("",!0),We.value?(e.openBlock(),e.createElementBlock("div",B2,[e.createElementVNode("div",M2,[Y[3]||(Y[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":J.value}]),title:"Manage custom colors",onClick:e.withModifiers(qt,["stop"])},[...Y[2]||(Y[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",_2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.value,(j,pe)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+pe,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":J.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!J.value&&xt(j),"dss-color-picker__preset-bubble--editing":J.value&&X.value===Qe(pe)}]),style:e.normalizeStyle({backgroundColor:X.value===Qe(pe)?rt.value:j,"--dss-preset-color":X.value===Qe(pe)?rt.value:j}),title:X.value===Qe(pe)?rt.value:j,onClick:e.withModifiers(xe=>J.value?gt(Qe(pe)):qe(j),["stop"])},null,14,$2),J.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__preset-action dss-color-picker__preset-action--delete",title:"Delete",onClick:e.withModifiers(xe=>ut(Qe(pe)),["stop"])},[...Y[4]||(Y[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,L2)):e.createCommentVNode("",!0)],2))),128)),Le.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(kt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):E.presetColors.length?(e.openBlock(),e.createElementBlock("div",T2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.presetColors,(j,pe)=>(e.openBlock(),e.createElementBlock("button",{key:pe,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xt(j)}]),style:e.normalizeStyle({backgroundColor:j,"--dss-preset-color":j}),title:j,onClick:e.withModifiers(xe=>qe(j),["stop"])},null,14,A2))),128)),We.value&&Le.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(kt,["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:_e,onMousedown:Et},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(yt.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(ol.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ke},[Y[5]||(Y[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(U.value)},null,4)],32),e.createElementVNode("div",D2,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:Je,type:"text",class:"dss-color-picker__hex-input",value:Jt.value,onInput:Ut},null,40,H2)]),We.value&&ie.value&&(E.presetColors.length||Fe.value)&&Le.value&&X.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Yt}," Save color ")):e.createCommentVNode("",!0),We.value&&ie.value&&X.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Zt}," Save color ")):e.createCommentVNode("",!0),ie.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Ue}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},F2={key:0,class:"dss-loader"},I2={key:0,class:"dss-loader-label"},z2={key:1,class:"dss-loader"},P2={key:0,class:"dss-loader-label"},O2={key:2,class:"dss-loader"},W2={key:0,class:"dss-loader-label"},q2={key:3,class:"dss-loader"},Z2={key:0,class:"dss-loader-label"},U2={key:4,class:"dss-loader"},X2={key:0,class:"dss-loader-label"},Y2={key:5,class:"dss-loader dss-loader--inline"},j2={class:"dss-loader-inline-text"},K2={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(E){const le=E,_=e.computed(()=>le.size==="small"?"dss-loaders--size-small":le.size==="large"?"dss-loaders--size-large":le.size==="medium"||le.size==null?"dss-loaders--size-medium":null),B=e.computed(()=>{const de={};if(!(le.size==="small"||le.size==="medium"||le.size==="large"||le.size==null)){const P=typeof le.size=="number"?`${le.size}px`:String(le.size);de["--dss-loader-size"]=P}return le.color&&(de["--dss-loader-accent"]=le.color,de["--dss-loader-accent-soft"]=`color-mix(in srgb, ${le.color} 30%, white)`),de});return(de,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",_.value]),style:e.normalizeStyle(B.value)},[E.type==="spinner"?(e.openBlock(),e.createElementBlock("div",F2,[P[0]||(P[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),E.label?(e.openBlock(),e.createElementBlock("span",I2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="dots"?(e.openBlock(),e.createElementBlock("div",z2,[P[1]||(P[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)),E.label?(e.openBlock(),e.createElementBlock("span",P2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="battery"?(e.openBlock(),e.createElementBlock("div",O2,[P[2]||(P[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),E.label?(e.openBlock(),e.createElementBlock("span",W2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",q2,[P[3]||(P[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)),E.label?(e.openBlock(),e.createElementBlock("span",Z2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="bars"?(e.openBlock(),e.createElementBlock("div",U2,[P[4]||(P[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)),E.label?(e.openBlock(),e.createElementBlock("span",X2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="inline"?(e.openBlock(),e.createElementBlock("div",Y2,[P[5]||(P[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",j2,[e.renderSlot(de.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(E.label),1)])])])):e.createCommentVNode("",!0)],6))}},Sa="dss-skeleton-item",G2={__name:"DSSSkeleton",props:{loading:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},borderRadius:{type:String,default:"16px"},shimmer:{type:Boolean,default:!0},mode:{type:String,default:"single",validator:E=>["single","multiple"].includes(E)},targetClass:{type:String,default:Sa},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(E){const le=E,_=e.computed(()=>{const P={"dss-skeleton--loading":le.loading,"dss-skeleton--static":!le.shimmer,"dss-skeleton--multiple":le.mode==="multiple","dss-skeleton--dark":le.darkMode};return le.mode==="multiple"&&le.targetClass!==Sa&&(P[`dss-skeleton--target-${le.targetClass}`]=!0),P}),B=e.computed(()=>{const P={};return le.borderRadius&&(P.borderRadius=le.borderRadius),P}),de=e.computed(()=>{const P={};return le.borderRadius&&(P["--dss-skeleton-border-radius"]=le.borderRadius),le.darkMode?(P["--dss-skeleton-bg"]=le.bgDark||"#322c3f",P["--dss-skeleton-shimmer"]=le.shimmerDark||"#3e3f41",P):(le.bgColor&&(P["--dss-skeleton-bg"]=le.bgColor),le.shimmerColor&&(P["--dss-skeleton-shimmer"]=le.shimmerColor),P)});return(P,T)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",_.value]),style:e.normalizeStyle(de.value)},[E.loading&&E.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(B.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":E.loading&&E.mode==="single"}])},[e.renderSlot(P.$slots,"default")],2)],6))}},Q2={key:0,class:"dss-dnd-column-header"},J2={class:"dss-dnd-column-title"},e0={class:"dss-dnd-column-count"},t0=["data-column"],l0={key:0,class:"dss-dnd-indicator"},n0=["onPointerdown"],o0=["onPointerdown"],a0={class:"dss-dnd-item-content"},s0={class:"dss-dnd-item-default"},r0={key:0,class:"dss-dnd-empty"},i0={name:"DSSDnd"},c0=Object.assign(i0,{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(E,{emit:le}){const _=E,B=le,de=e.useSlots(),P=e.computed(()=>!!de["delete-zone"]),T={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},he=e.computed(()=>({...T,..._.options})),st=e.computed(()=>({"--dss-dnd-col-min-w":he.value.columnMinWidth,"--dss-dnd-col-max-w":he.value.columnMaxWidth,"--dss-dnd-col-gap":he.value.columnGap,"--dss-dnd-indicator-color":he.value.indicatorColor,"--dss-dnd-body-max-h":he.value.columnBodyMaxHeight}));function te(W){if(!he.value.ColColor||!W)return{};const G=W.background||W.color;return G?{background:G}:{}}const f=e.ref(null),we=e.ref(null),Ce=e.ref(!1),J=e.ref(-1),X=e.ref(null);let fe=null,R=null,me=null,_e=null,Je=0,pt=0,Z="",Fe=null;const We=5,Se=e.computed(()=>{const W={};for(const G of _.columns)W[G.value]=_.items.filter(Ne=>Ne[_.columnKey]===G.value).sort((Ne,Ie)=>(Ne[_.positionKey]??0)-(Ie[_.positionKey]??0));return W}),Le=e.computed(()=>{const W={},G=!!f.value,Ne=f.value?.[_.itemKey],Ie=we.value,Ue=J.value;for(const Et of _.columns){const Ke=Se.value[Et.value]||[],Ut=[],qe=Ie==Et.value;let Pe=0;for(let Ht=0;Ht<Ke.length;Ht++){const $t=Ke[Ht],oe=G&&$t[_.itemKey]===Ne;!oe&&qe&&Ue===Pe&&Ut.push({type:"indicator",key:`ind-${Pe}`}),oe||Pe++,Ut.push({type:"item",item:$t,isDragged:oe,key:`item-${$t[_.itemKey]}`})}qe&&Ue>=Pe&&Ut.push({type:"indicator",key:"ind-end"}),W[Et.value]=Ut}return W});function Ye(W,G){const Ie=(Se.value[W]||[]).filter(Ke=>Ke[_.itemKey]!==f.value?.[_.itemKey]);if(Ie.length===0)return 1;if(G<=0){const Ke=Ie[0][_.positionKey];return Ke!=null&&Ke>0?Ke/2:.5}if(G>=Ie.length){const Ke=Ie[Ie.length-1][_.positionKey];return(Ke??0)+1}const Ue=Ie[G-1][_.positionKey]??0,Et=Ie[G][_.positionKey]??0;return(Ue+Et)/2}function ie(W,G,Ne){me&&me.remove();const Ie=W.getBoundingClientRect(),Ue=W.cloneNode(!0);Ue.classList.add("dss-dnd-ghost"),Ue.style.cssText=`
|
|
102
|
+
</svg>`,f=e.ref(null),be=e.ref(null),he=e.ref(!1),oe=e.ref(!1),j=e.ref(!1),fe=e.ref(""),_e=e.ref({}),V=e.ref(!1),$e=e.ref(!1),lt=e.ref(""),rt=e.ref(""),Qe=e.ref(null),Z=e.ref(null),qe=e.ref(null),ze=e.ref(null),ye=e.ref(""),Ue=e.ref(!1),ke=e.ref({}),Te=e.ref(!1),at=e.ref({}),ge=e.ref(null),Ft=e.ref(null),dt=e.ref(!1),Ye=e.ref(""),Pt=e.ref(null),It=e.ref(""),bt=e.ref(""),ft=e.ref(""),Yt=e.ref(null),it=e.ref(null),At=e.ref(null),ht=e.ref(null),il=e.ref(null),St=e.ref(!1),Dt=e.ref(""),pe=e.ref({}),A=e.ref(!1),X=e.ref("upload"),ae=e.ref(""),Ce=e.ref(null),je=e.ref(null),Ge=e.ref([]),Vt=e.ref([]),Pe=e.ref(null),Ke=e.ref(!1),nt=e.ref(""),qt=e.ref(""),te=e.ref(""),K=e.ref(""),Q=e.ref(""),ce=e.ref(""),Ve=e.ref(null),We=e.ref(null),Nt=e.ref(null),Ot=e.ref(!1),pt=e.ref(null),wt=e.ref(!1),B=e.ref(!1),w=e.ref(null),T=e.ref("p"),ie=e.ref(!1),re=e.ref([]),He=e.ref(null),gt=e.ref(null),et=e.ref(null),Ae=e.ref(!1),yt=e.ref(0),Et=100,xt=e.ref(null),$t=e.computed(()=>!!H.commentUser),Ht=e.computed(()=>({"dss-text-editor-no-border":!H.border,"dss-text-editor-rounded":H.rounded,"dss-text-editor-full-height":H.fullHeight,"dss-comment-overlay-open":$t.value&&st.value!==null})),kt=e.computed(()=>({})),Gt=e.computed(()=>!H.fixedHeight||H.fullHeight?{}:{height:`${1.6*14*H.rows+24+2}px`,resize:"none",overflowY:"auto"}),Ll=e.computed(()=>!H.fixedHeight||H.fullHeight?{}:{height:`${1.6*14*H.rows+32}px`,overflowY:"auto"}),hl=e.computed(()=>H.richText&&Vt.value.length>0),Nl=e.computed(()=>{if(!H.modelValue)return"";if(H.richText){let a=H.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return a=a.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),a=a.replace(/<[^>]+>/g,""),a=a.replace(/ /g," "),a=a.replace(/&/g,"&"),a=a.replace(/</g,"<"),a=a.replace(/>/g,">"),a=a.replace(/"/g,'"'),a=a.replace(/'/g,"'"),a=a.replace(/\s+/g," ").trim(),a}return H.modelValue}),cl=e.computed(()=>{const a=Nl.value.trim();return a?a.split(/\s+/).filter(n=>n.length>0).length:0}),nn=e.computed(()=>Nl.value.length),un=e.computed(()=>ht.value!==null&&X.value==="upload"&&It.value&&It.value.startsWith("data:")),Ul=e.computed(()=>H.titlePlaceholder||N("textEditor.placeholders.title")),Tl=e.computed(()=>H.descriptionPlaceholder||N("textEditor.placeholders.description")),dn=e.computed(()=>H.placeholder||N("textEditor.placeholders.startTyping")),Al=a=>ot&&ot[a]!==void 0,Wn=a=>{for(let n=a+1;n<H.customToolbarSlots.length;n++)if(Al(H.customToolbarSlots[n]))return!0;return!1},Ln=a=>{for(let n=a+1;n<H.customToolbarSlots.length;n++){const s=H.customToolbarSlots[n];if(Al(s)&&El(s))return!0}return!1},El=a=>H.customToolbarFloatingMap.hasOwnProperty(a)?H.customToolbarFloatingMap[a]===!0:!0,on=e.computed(()=>H.customToolbarSlots.some(a=>Al(a)&&El(a))),Dl=e.computed(()=>Al("title-slot")),Ol=e.computed(()=>Al("description-slot")),Hl=a=>{if(!a||a.trim()==="")return"<html></html>";const n=a.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?a:`<html>${a}</html>`},ul=a=>{if(!a||a.trim()==="")return"";const n=a.replace(/<!--[\s\S]*?-->/g,""),s=n.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():n},Tn=a=>{if(!a)return;const n=document.createTreeWalker(a,NodeFilter.SHOW_COMMENT,null,!1),s=[];let i=n.nextNode();for(;i;)s.push(i),i=n.nextNode();s.forEach(c=>c.remove())},R=a=>{try{const n=String(a.getDate()).padStart(2,"0"),i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a.getMonth()],c=a.getFullYear();return`${n} ${i} ${c}`}catch{return""}},W=a=>{if(!a||typeof a!="string")return!1;const n=a.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const c=N("textEditor.started_conversation");if(c&&n===c)return!0}catch{}const i=n.toLowerCase();return i.includes("started conversation")||i.includes("démarré la conversation")||i==="started conversation"||i==="a démarré la conversation"},D=a=>{const n=a.target.value;me("update:modelValue",n),me("change",n)},se=()=>{if(!Ve.value)return;const a=Ve.value;if(a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important"),a.value.trim()===""){const i=a.value;a.value="M";const c=a.scrollHeight;a.value=i,a.style.setProperty("height",`${c}px`,"important"),a.style.setProperty("overflow-y","hidden","important");return}a.offsetHeight;const s=a.scrollHeight;a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important")},De=()=>{wt.value=!0,se()},mt=()=>{wt.value=!1,ut()},ut=()=>{if(!Ve.value)return;const a=Ve.value;a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important");const n=a.value;a.value="M";const s=a.scrollHeight;a.value=n,a.offsetHeight,a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important"),a.style.setProperty("overflow-x","hidden","important"),a.style.setProperty("text-overflow","ellipsis","important"),a.style.setProperty("white-space","nowrap","important")},Ze=a=>{const s=a.target.value;wt.value&&se(),me("update:title",s),me("title-change",s),Nt.value="title",H.richText&&(Ke.value||(qt.value=nt.value,Q.value=te.value,ce.value=K.value),Pe.value&&clearTimeout(Pe.value),Ke.value=!0,Pe.value=setTimeout(()=>{Ke.value=!1,Qt()},500))},Je=()=>{if(!We.value)return;const a=We.value;if(a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important"),a.value.trim()===""){const i=a.value;a.value="M";const c=a.scrollHeight;a.value=i,a.style.setProperty("height",`${c}px`,"important"),a.style.setProperty("overflow-y","hidden","important");return}a.offsetHeight;const s=a.scrollHeight;a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important")},dl=()=>{B.value=!0,Je()},ml=()=>{B.value=!1,Tt()},Tt=()=>{if(!We.value)return;const a=We.value;a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important");const n=a.value;a.value="M";const s=a.scrollHeight;a.value=n,a.offsetHeight,a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important"),a.style.setProperty("overflow-x","hidden","important"),a.style.setProperty("text-overflow","ellipsis","important"),a.style.setProperty("white-space","nowrap","important")},ll=a=>{const s=a.target.value;B.value&&Je(),me("update:description",s),me("description-change",s),Nt.value="description",H.richText&&(Ke.value||(qt.value=nt.value,Q.value=te.value,ce.value=K.value),Pe.value&&clearTimeout(Pe.value),Ke.value=!0,Pe.value=setTimeout(()=>{Ke.value=!1,Qt()},500))},Bt=()=>{const a=window.getSelection();if(a.rangeCount===0)return null;const n=a.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}},Bl=a=>{if(!(!a||!f.value))try{const n=window.getSelection(),s=document.createRange();if(a.type==="element"&&a.element)if(f.value.contains(a.element)){s.setStart(a.element,a.offset),s.collapse(!0),n.removeAllRanges(),n.addRange(s);return}else{f.value.focus();return}let i=0;const c=[f.value];let d=null,u=!1,p=!1;for(;!p&&(d=c.pop());)if(d.nodeType===3){const g=i+d.length;!u&&a.start>=i&&a.start<=g&&(s.setStart(d,a.start-i),u=!0),u&&a.end>=i&&a.end<=g&&(s.setEnd(d,a.end-i),p=!0),i=g}else{let g=d.childNodes.length;for(;g--;)c.push(d.childNodes[g])}n.removeAllRanges(),n.addRange(s)}catch{f.value.focus()}},mn=()=>{if(!f.value)return;f.value.focus();const a=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],p=s(u);if(p)return p}return c},i=s(f.value);if(i.nodeType===3)n.setStart(i,i.length),n.setEnd(i,i.length);else if(i.childNodes.length>0){const c=s(i);c&&c.nodeType===3?(n.setStart(c,c.length),n.setEnd(c,c.length)):(n.selectNodeContents(i),n.collapse(!1))}else n.setStart(i,0),n.setEnd(i,0);a.removeAllRanges(),a.addRange(n)},Qt=(a=!1)=>{if(!f.value)return;const n=f.value.innerHTML,s=H.title||"",i=H.description||"";if(!a&&n===nt.value&&s===te.value&&i===K.value)return;const c={content:qt.value||nt.value,title:Q.value!==void 0?Q.value:te.value,description:ce.value!==void 0?ce.value:K.value},d=Ge.value.length>0?Ge.value[Ge.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=c.content!==d:u=c.content!==d.content||c.title!==d.title||c.description!==d.description),u&&(Ge.value.push(c),Ge.value.length>50&&Ge.value.shift(),Vt.value=[]),nt.value=n,te.value=s,K.value=i,qt.value=n,Q.value=s,ce.value=i},Mt=a=>{if(!f.value)return;wn(),f.value&&Tn(f.value);let n=null;f.value&&(f.value.querySelector("p")||(n=Bt(),An()));const s=a&&a.inputType&&(a.inputType==="insertText"||a.inputType==="insertCompositionText"||a.inputType==="deleteContentBackward"||a.inputType==="deleteContentForward");s&&w.value&&(w.value=null),oe.value=!0;const i=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=Hl(i);me("update:modelValue",c),me("change",c),Nt.value="editor",Ke.value||(qt.value=nt.value,Q.value=te.value,ce.value=K.value),Pe.value&&clearTimeout(Pe.value),Ke.value=!0,Pe.value=setTimeout(()=>{Ke.value=!1,Qt(),Pl(),Cl()},500),e.nextTick(()=>{n&&Bl(n),wn();const d=["bold","italic","underline"],u=window.getSelection(),p=u.rangeCount>0?u.getRangeAt(0):null,g=p&&p.collapsed;if(d.forEach(k=>{try{if(g&&w.value?.command===k){ke.value[k]=w.value.state;return}if(k==="bold")if(p){const F=p.commonAncestorContainer,P=F.nodeType===3?F.parentElement:F;let E=!1;if(P&&((P.tagName==="STRONG"||P.tagName==="B"||P.closest&&P.closest("strong, b"))&&(E=!0),!E&&P.style&&parseInt(P.style.fontWeight)>=600&&(E=!0),!E))try{const le=window.getComputedStyle(P);parseInt(le.fontWeight)>=600&&(E=!0)}catch{}ke.value[k]=E}else ke.value.hasOwnProperty(k)||(ke.value[k]=!1);else if(k==="italic")if(p){const F=p.commonAncestorContainer,P=F.nodeType===3?F.parentElement:F,E=P&&(P.tagName==="EM"||P.tagName==="I"||P.closest&&P.closest("em, i"));ke.value[k]=!!E}else{const F=document.queryCommandState(k);ke.value[k]=F}else{const F=document.queryCommandState(k);ke.value[k]=F}}catch{}}),Sl(),_l(),Ql(),ol(),hn(),xl("handleRichTextInput"),s&&(a.inputType==="insertText"||a.inputType==="insertCompositionText")){const k=a.data||"";k&&k.length===1&&setTimeout(()=>Cl(k),0),(k===" "||k===`
|
|
103
|
+
`||/[.,;:!?]/.test(k))&&setTimeout(()=>{Pl()},100)}oe.value=!1})},wn=()=>{if(!f.value)return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i)return;const c=i.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(i!==d&&!d?.contains(i)){const u=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,p=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.contains(u)&&u!==d||c.contains(p)&&p!==d){const g=document.createRange();g.setStartAfter(c),g.collapse(!0),a.removeAllRanges(),a.addRange(g)}}}},An=()=>{if(!f.value)return;const a=f.value;if(a.querySelector&&a.querySelector("p"))return;const n=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),s=Array.from(a.childNodes);let i=null;s.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===a&&a.removeChild(c);return}i||(i=document.createElement("p"),a.insertBefore(i,c)),i.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){i=null;return}if(n.has(u)){i=null;return}i||(i=document.createElement("p"),a.insertBefore(i,d)),i.appendChild(d)}})},_l=()=>{if(f.value&&!Ot.value){Ot.value=!0;try{f.value.querySelectorAll(".dss-image-wrapper").forEach(i=>{i.querySelector("img")||i.remove()}),f.value.querySelectorAll(".dss-image-no-alt-icon").forEach(i=>{const c=i.parentElement;!c||!c.classList.contains("dss-image-wrapper")?i.remove():c.querySelector("img")||i.remove()}),f.value.querySelectorAll("img").forEach(i=>{let c=i.getAttribute("alt");c===null&&(c=i.alt||"");const d=i.getAttribute("src")||i.src||"";if(c){const k=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),F=c===d||c===k;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||F||F)&&(c="")}i.setAttribute("alt",c),i.setAttribute("data-alt",c);const u=!c||c.trim()==="";let p=i.parentElement;const g=p&&p.classList.contains("dss-image-wrapper");if(g){const k=p.querySelector(".dss-image-no-alt-icon");k&&k.remove()}else{const k=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;k&&k.remove()}if(u){g?p.setAttribute("contenteditable","false"):(p=document.createElement("span"),p.className="dss-image-wrapper",p.setAttribute("contenteditable","false"),i.parentNode.insertBefore(p,i),p.appendChild(i));const k=document.createElement("div");k.className="dss-image-no-alt-icon",k.setAttribute("contenteditable","false"),k.innerHTML=ne,p.appendChild(k)}else if(g&&p.children.length===1){const k=p.parentNode;k.insertBefore(i,p),k.removeChild(p)}})}finally{Ot.value=!1}}},an=a=>{Pl(),me("blur",a),Yl()},pn=()=>{if(H.disabled||!H.richText||!f.value)return;nl(),Pe.value&&(clearTimeout(Pe.value),Pe.value=null),Ke.value&&(Qt(),Ke.value=!1);const a=Nt.value==="title",n=Nt.value==="description",s=Nt.value==="editor";if(Ge.value.length===0){a&&Ve.value?Ve.value.focus():n&&We.value?We.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{Mt()});return}const i={content:f.value.innerHTML,title:H.title||"",description:H.description||""};Vt.value.push(i);const c=Ge.value.pop();if(c!==void 0){oe.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",p=typeof c=="object"&&c.description||"";f.value.innerHTML=d,nt.value=d,te.value=u,K.value=p,qt.value=d,Q.value=u,ce.value=p,e.nextTick(()=>{Sl(),wl(),Zl(),ol();const g=Hl(d);me("update:modelValue",g),me("update:title",u),me("update:description",p),me("change",g),me("title-change",u),me("description-change",p),oe.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(Ve.value){Ve.value.focus();const k=u.length;Ve.value.setSelectionRange&&Ve.value.setSelectionRange(k,k),se()}}else if(n){if(We.value){We.value.focus();const k=p.length;We.value.setSelectionRange(k,k)}}else if(s)mn();else if(Ve.value&&document.activeElement===Ve.value){const k=u.length;Ve.value.setSelectionRange&&Ve.value.setSelectionRange(k,k),se()}else if(We.value&&document.activeElement===We.value){const k=p.length;We.value.setSelectionRange(k,k)}else f.value&&mn()},10)})})}},qn=()=>{if(H.disabled||!H.richText||!f.value)return;nl();const a=Nt.value==="title",n=Nt.value==="description",s=Nt.value==="editor";if(Vt.value.length===0){a&&Ve.value?Ve.value.focus():n&&We.value?We.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{Mt()});return}const i={content:f.value.innerHTML,title:H.title||"",description:H.description||""};Ge.value.push(i);const c=Vt.value.pop();if(c!==void 0){oe.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",p=typeof c=="object"&&c.description||"";f.value.innerHTML=d,nt.value=d,te.value=u,K.value=p,qt.value=d,Q.value=u,ce.value=p,e.nextTick(()=>{Sl(),wl(),Zl(),ol();const g=Hl(d);me("update:modelValue",g),me("update:title",u),me("update:description",p),me("change",g),me("title-change",u),me("description-change",p),oe.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(Ve.value){Ve.value.focus();const k=u.length;Ve.value.setSelectionRange&&Ve.value.setSelectionRange(k,k),se()}}else if(n){if(We.value){We.value.focus();const k=p.length;We.value.setSelectionRange(k,k)}}else if(s)mn();else if(Ve.value&&document.activeElement===Ve.value){const k=u.length;Ve.value.setSelectionRange&&Ve.value.setSelectionRange(k,k),se()}else if(We.value&&document.activeElement===We.value){const k=p.length;We.value.setSelectionRange(k,k)}else f.value&&mn()},10)})})}},Rl=()=>{if(!f.value)return;f.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{const c=i.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),f.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{if(parseInt(i.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),f.value.querySelectorAll("b, strong").forEach(i=>{i.style.fontWeight="600"})},Ql=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},Jt=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const n=a.getRangeAt(0);let s=!1;if(n.collapsed){const i=n.startContainer;let c=i.nodeType===3?i.parentElement:i;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 i=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,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(()=>{Ql()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{Ql()});else try{const i=n.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(i),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),a.removeAllRanges(),a.addRange(n),e.nextTick(()=>{Ql()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{Ql()})}return!0},Dn=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const n=a.getRangeAt(0);let s=!1;if(n.collapsed){const i=n.startContainer;let c=i.nodeType===3?i.parentElement:i;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 i=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,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(()=>{Rl()}),!1;if(n.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==f.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const p=u.style.fontWeight;if(p==="normal"||p==="400"){const g=document.createElement("b");g.style.fontWeight="600";const k=document.createDocumentFragment();for(;u.firstChild;)k.appendChild(u.firstChild);g.appendChild(k),u.parentNode&&u.parentNode.replaceChild(g,u),c.setStart(g,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===f.value){const p=document.createElement("b");p.style.fontWeight="600",p.innerHTML="<br>",c.insertNode(p),c.setStart(p,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c)}}Rl()});else try{const i=n.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(i),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),a.removeAllRanges(),a.addRange(n),e.nextTick(()=>{Rl()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Rl()})}return!0},Fl=(a,n=null)=>{if(H.disabled||!H.richText||!f.value)return;Ke.value?(Pe.value&&(clearTimeout(Pe.value),Pe.value=null),Qt(),Ke.value=!1):Qt(),nl(),f.value.focus();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&gn(d)&&(i=Bt())}if(a==="createLink"&&n){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const g=document.createTextNode(n);u.insertNode(g),u.selectNodeContents(g)}}}if(a==="bold"){const d=Dn();ke.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"bold",state:d}),e.nextTick(()=>{i&&(Bl(i),e.nextTick(()=>{const p=Xt("bold");ke.value.bold=p})),Mt(),wl(),ol()});return}if(a==="italic"){const d=Jt();ke.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"italic",state:d}),e.nextTick(()=>{i&&(Bl(i),e.nextTick(()=>{const p=Xt("italic");ke.value.italic=p})),Mt(),Ql(),wl(),ol()});return}let c=!1;try{c=document.execCommand(a,!1,n)}catch{}e.nextTick(()=>{if(i&&Bl(i),["bold","italic","underline"].includes(a))try{if(a==="bold")i&&e.nextTick(()=>{const u=Xt("bold");ke.value.bold=u});else if(a==="italic")if(i)e.nextTick(()=>{const u=Xt("italic");ke.value.italic=u});else{const u=document.queryCommandState(a);ke.value[a]=u}else{const u=document.queryCommandState(a);ke.value[a]=u}}catch{ke.value.hasOwnProperty(a)?ke.value[a]=!ke.value[a]:ke.value[a]=!0}if(a==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const g=u.getRangeAt(0),k=g.commonAncestorContainer.nodeType===1?g.commonAncestorContainer.closest("a"):g.commonAncestorContainer.parentElement?.closest("a");k&&(!k.getAttribute("href")||k.getAttribute("href")==="")&&k.setAttribute("href",n)}f.value.querySelectorAll("a").forEach(g=>{const k=g.getAttribute("href");(!k||k===""||k==="#")&&g.setAttribute("href",n)})}Mt(),wl(),ol()})},Xt=(a,n=null)=>{if(H.disabled||!f.value)return!1;try{if(a==="formatBlock"&&n){const i=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const c=i.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const p=d.getRangeAt(0).commonAncestorContainer;return!!(p.nodeType===1?p.tagName==="BLOCKQUOTE"?p:p.closest("blockquote"):p.parentElement?.closest("blockquote"))}}return i===n||i.toLowerCase()===n.toLowerCase()}if(["bold","italic","underline"].includes(a))try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(a==="bold"){let u=!1;if(c.collapsed){const p=c.commonAncestorContainer,g=p.nodeType===3?p.parentElement:p;if(g&&((g.tagName==="STRONG"||g.tagName==="B"||g.closest&&g.closest("strong, b"))&&(u=!0),!u&&g.style&&parseInt(g.style.fontWeight)>=600&&(u=!0),!u))try{const k=window.getComputedStyle(g);parseInt(k.fontWeight)>=600&&(u=!0)}catch{}return ke.value.hasOwnProperty(a)?ke.value[a]:(ke.value[a]=u,u)}else{const p=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let g=!1;if(p){const k=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let F;for(;F=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(F))){if(F.nodeType===3){if(!(F.textContent||"").trim())continue;g=!0;let E=F.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(F.nodeType===1){const P=F;if(P.tagName==="STRONG"||P.tagName==="B"){u=!0;break}if(P.style&&parseInt(P.style.fontWeight)>=600){u=!0;break}}if(u)break}}return ke.value[a]=u&&g,u&&g}}if(a==="italic"){let u=!1;if(c.collapsed){const p=c.commonAncestorContainer,g=p.nodeType===3?p.parentElement:p;if(g&&((g.tagName==="EM"||g.tagName==="I"||g.closest&&g.closest("em, i"))&&(u=!0),!u&&g.style&&g.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(g).fontStyle==="italic"&&(u=!0)}catch{}return ke.value.hasOwnProperty(a)?ke.value[a]:(ke.value[a]=u,u)}else{const p=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let g=!1;if(p){const k=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let F;for(;F=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(F))){if(F.nodeType===3){if(!(F.textContent||"").trim())continue;g=!0;let E=F.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(F.nodeType===1){const P=F;if(P.tagName==="EM"||P.tagName==="I"){u=!0;break}if(P.style&&P.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return ke.value[a]=u&&g,u&&g}}const d=document.queryCommandState(a);return c.collapsed&&ke.value.hasOwnProperty(a)?ke.value[a]:(ke.value[a]=d,d)}return ke.value.hasOwnProperty(a)?ke.value[a]:!1}catch{return ke.value.hasOwnProperty(a)?ke.value[a]:!1}try{return document.queryCommandState(a)}catch{return!1}}catch{return!1}},Zn=a=>{H.disabled||!H.richText||(be.value=be.value===a?null:a,a==="askAi"&&(Ft.value=null))},nl=()=>{be.value=null,Ce.value=null},Il=a=>{Fl("formatBlock",a),nl()},Un=a=>{if(!a||!f.value)return a;const n=Fe=>{let we=Fe.nodeType===Node.TEXT_NODE?Fe.parentElement:Fe;for(;we&&we!==f.value;){const ct=we.tagName;if(ct==="P"){const bl=we.parentElement;if(bl===f.value||bl.tagName==="BLOCKQUOTE")return we}if(ct==="BLOCKQUOTE")break;we=we.parentElement}return null},s=n(a.startContainer),i=n(a.endContainer);if(!s||!i)return a;const c=[],d=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Fe=>{const we=Fe.tagName;if(we==="P"){const ct=Fe.parentElement;if(ct===f.value||ct.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 p=c.indexOf(s),g=c.indexOf(i);if(p===-1||g===-1)return a;const k=Math.min(p,g),F=Math.max(p,g),P=c.slice(k,F+1);if(P.length===0)return a;const E=P[0],le=P[P.length-1],J=document.createRange();return J.setStartBefore(E),J.setEndAfter(le),J},Hn=()=>{if(H.disabled||!H.richText||!f.value)return;Ke.value?(Pe.value&&(clearTimeout(Pe.value),Pe.value=null),Qt(),Ke.value=!1):Qt(),nl(),f.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;let n=a.getRangeAt(0);!n.collapsed&&gn(n)&&(n=Un(n),a.removeAllRanges(),a.addRange(n));let s=null;!n.collapsed&&gn(n)&&(s=Bt());const i=n.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&f.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(g=>{if(g.nodeType===Node.ELEMENT_NODE)if(g.tagName==="P"||g.tagName==="DIV")u.insertBefore(g,c);else{const k=document.createElement("p");k.appendChild(g.cloneNode(!0)),u.insertBefore(k,c)}else if(g.nodeType===Node.TEXT_NODE&&g.textContent.trim()){const k=document.createElement("p");k.appendChild(g.cloneNode(!0)),u.insertBefore(k,c)}}),c.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),p=n.extractContents();u.appendChild(p),n.insertNode(u);const g=[],k=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:E=>E.parentNode===u&&E.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let F;for(;F=k.nextNode();)g.push(F);if(g.forEach(E=>{const le=document.createElement("p");E.parentNode.insertBefore(le,E),le.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&&Bl(s),Zl(),Mt(),ol()})},xn=()=>{if(!f.value)return;const a=window.getSelection();if(a.rangeCount===0)return;const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!i||!f.value.contains(i))return;const c=F=>{if(!F)return!1;const P=F.textContent||"",le=(F.innerHTML||"").trim();return P.trim()===""||le===""||le==="<br>"||le==="<br/>"||le==="<p></p>"||le==="<p><br></p>"||le==="<p><br/></p>"||le==="<p> </p>"||le==="<p><br> </p>"||le==="<div></div>"||le==="<div><br></div>"||le==="<div><br/></div>"};let d=null;for(s.nodeType===3?d=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?d=s:d=s.closest("p, div"),d&&i.contains(d)&&c(d)&&d.remove();i.lastChild;){const F=i.lastChild;if(F.nodeType===1&&F.tagName==="BR")F.remove();else if(F.nodeType===3)if((F.textContent||"").trim()==="")F.remove();else break;else break}if(i.children.length>0)for(let F=i.children.length-1;F>=0;F--){const P=i.children[F];if((P.tagName==="P"||P.tagName==="DIV")&&c(P))P.remove();else break}let u=i.innerHTML;const p=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==p&&(i.innerHTML=u);const g=document.createElement("p");g.innerHTML="<br>",i.parentNode?i.nextSibling?i.parentNode.insertBefore(g,i.nextSibling):i.parentNode.appendChild(g):f.value&&f.value.appendChild(g);const k=document.createRange();k.selectNodeContents(g),k.collapse(!0),a.removeAllRanges(),a.addRange(k),e.nextTick(()=>{Zl(),Mt()})},wl=()=>{if(!f.value){he.value=!1;return}try{const a=window.getSelection();if(a.rangeCount>0){const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");he.value=!!i}else he.value=!1}catch{he.value=!1}},Xn=()=>{if(!f.value)return;const a=window.getSelection();a&&a.rangeCount>0&&a.getRangeAt(0),ze.value=Bt();const n=window.getSelection();let s="";n.rangeCount>0&&(s=n.getRangeAt(0).toString()),lt.value="",rt.value=s,ye.value="",qe.value=null,$e.value=!0,nl(),e.nextTick(()=>{Qe.value&&Qe.value.focus()})},sn=()=>{if(!f.value)return;Ke.value?(Pe.value&&(clearTimeout(Pe.value),Pe.value=null),Qt(),Ke.value=!1):Qt();const a=window.getSelection();let n=null;if(a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer;n=i.nodeType===1?i.closest("a"):i.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 i=document.createRange();i.setStartBefore(s.firstChild),i.setEndAfter(s.lastChild||s.firstChild),a.removeAllRanges(),a.addRange(i),document.execCommand("removeFormat",!1),i.collapse(!1),a.removeAllRanges(),a.addRange(i)}qe.value=null}else Fl("unlink");he.value=!1,nl(),e.nextTick(()=>{Mt(),wl()})},Yn=()=>{H.disabled||!H.richText||f.value&&(Ke.value?(Pe.value&&(clearTimeout(Pe.value),Pe.value=null),Qt(),Ke.value=!1):Qt(),nl(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Sl(),Mt(),ol()}))},rn=()=>{H.disabled||!H.richText||f.value&&(Ke.value?(Pe.value&&(clearTimeout(Pe.value),Pe.value=null),Qt(),Ke.value=!1):Qt(),nl(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Sl(),Mt(),ol()}))},Rn=a=>{const n=a.parentElement;if(!n||n.tagName!=="OL")return null;let s=0,i=a.previousElementSibling;for(;i;)i.tagName==="LI"&&s++,i=i.previousElementSibling;return s+1},Sl=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(n=>{const s=n.parentElement;if(s&&s.tagName==="LI"){const i=Rn(s);i!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(i))})}})},Jl=()=>{if(H.disabled||!H.richText||!f.value)return;nl(),f.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{Sl(),Mt()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=s.previousElementSibling;if(c&&c.tagName==="LI"){const d=i.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const p=Rn(c);u.appendChild(s),p!==null&&i.tagName==="OL"&&s.setAttribute("data-parent-num",String(p)),Sl();const g=document.createRange();g.selectNodeContents(s),g.collapse(!1),a.removeAllRanges(),a.addRange(g),e.nextTick(()=>{Mt(),ol()})}else document.execCommand("indent",!1),e.nextTick(()=>{Sl(),Mt(),ol()})},Xl=()=>{if(H.disabled||!H.richText||!f.value)return;nl(),f.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{Sl(),Mt()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=i.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){i.tagName==="OL"&&s.removeAttribute("data-parent-num"),d.insertBefore(s,c.nextSibling),i.children.length===0&&i.remove(),Sl();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),a.removeAllRanges(),a.addRange(u),e.nextTick(()=>{Mt(),ol()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Sl(),Mt(),ol()})},st=e.ref(null),Ne=e.ref(null),y=e.ref({}),h=e.ref(""),x=e.ref(null),$=e.ref("");e.ref("");const Y=e.ref(null);e.ref("");const U=e.ref([]),tt=e.ref(!1),Se=e.ref(!1),zl=a=>{if(!a)return"";const n=a.cloneRange(),s=document.createElement("div");return s.appendChild(n.cloneContents()),s.innerHTML},Wl=()=>{if(!H.commentUser||H.disabled||!H.richText||!f.value)return;if(st.value!==null){st.value=null,h.value="",$.value="",Y.value=null,U.value=[],tn(!0);return}nl(),f.value.focus();const a=window.getSelection();if(!a||a.rangeCount===0)return;const n=a.getRangeAt(0);if(n.collapsed||!gn(n))return;$.value=zl(n)||"",Y.value=Bt();const s=n.getBoundingClientRect(),i=f.value.parentElement;if(!i)return;const c=i.getBoundingClientRect(),d=s.bottom-c.top,p=Math.max(d+8,0);y.value={top:`${p}px`,bottom:"auto"},st.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 g=i.querySelector(".dss-comment-overlay");if(g&&i){const k=i.querySelector(".dss-text-editor-footer");if(k){const F=i.getBoundingClientRect(),P=g.getBoundingClientRect(),E=k.getBoundingClientRect(),le=P.bottom-F.top,J=E.top-F.top,Fe=8;if(le>J-Fe){const we=E.height;y.value={bottom:`${we+Fe}px`,top:"auto"}}else y.value={top:`${p}px`,bottom:"auto"}}}})},ql=()=>{if(!h.value.trim())return;const a=h.value.trim(),n=new Date,s={text:a,selectionText:$.value,selectionRange:Y.value,commentId:st.value,user:H.commentUser||null,createdAt:n.toISOString()};U.value=[...U.value,s],me("comment-submitted",s),Xo(s),Y.value&&!uo(Y.value)&&Uo(st.value,Y.value),h.value="",e.nextTick(()=>{if(x.value){const i=x.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}xl("sendComment")})},vn=(a,n)=>{if(!(!H.commentUser||!a.user||a.user.id!==H.commentUser.id)){if(U.value=U.value.filter((s,i)=>i!==n),st.value!==null&&f.value){const s=String(st.value),i=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(i&&U.value.length>0){const c=[],d=new Set;U.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),c.push(u.user))}),c.length>0?i.setAttribute("data-comment-user",JSON.stringify(c[0])):i.removeAttribute("data-comment-user"),c.length>1?i.setAttribute("data-comment-user-2",JSON.stringify(c[1])):i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count",String(U.value.length))}else i&&U.value.length===0&&(i.removeAttribute("data-comment-user"),i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count","0"))}if(me("comment-deleted",{comment:a,index:n,commentId:st.value}),H.comments&&Array.isArray(H.comments)){const s=H.comments.filter(i=>!(i.commentId===a.commentId&&i.text===a.text&&i.user?.id===a.user?.id));me("update:comments",s)}e.nextTick(()=>{xl("deleteComment")})}},uo=a=>{if(!a||!f.value)return!1;try{const n=Jn(a);if(!n)return!1;const s=n.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i)return!!i.closest("[data-comment], [data-fake-comment]")}catch{}return!1},Jn=a=>{if(!a||!f.value)return null;try{const n=document.createRange();if(a.type==="element"&&a.element)return f.value.contains(a.element)?(n.setStart(a.element,a.offset),n.collapse(!0),n):null;let s=0;const i=[f.value];let c=null,d=!1,u=!1;for(;!u&&(c=i.pop());)if(c.nodeType===3){const p=s+c.length;!d&&a.start>=s&&a.start<=p&&(n.setStart(c,a.start-s),d=!0),d&&a.end>=s&&a.end<=p&&(n.setEnd(c,a.end-s),u=!0),s=p}else{let p=c.childNodes.length;for(;p--;)i.push(c.childNodes[p])}return d?n:null}catch{return null}},Uo=(a,n)=>{if(!(!a||!n||!f.value))try{const s=Jn(n);if(!s||s.collapsed)return;const i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const p=c.closest("[data-comment], [data-fake-comment]");if(p){p.getAttribute("data-comment")!==String(a)&&p.getAttribute("data-fake-comment")!==String(a)&&p.setAttribute("data-comment",String(a));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(a));try{const p=s.startContainer,g=s.endContainer,k=s.startOffset,F=s.endOffset,P=p.nodeType===3?p.parentNode:p,E=g.nodeType===3?g.parentNode:g;if(P===E&&k===0&&F===(g.nodeType===3?g.length:E.childNodes.length)&&(P.tagName==="P"||P.tagName==="DIV"||P.tagName==="H1"||P.tagName==="H2"||P.tagName==="H3"||P.tagName==="H4"||P.tagName==="H5"||P.tagName==="H6")){const J=s.extractContents();d.appendChild(J),s.insertNode(d)}else s.surroundContents(d)}catch{const g=s.extractContents();d.appendChild(g),s.insertNode(d)}const u=f.value.querySelector(`[data-comment="${String(a)}"]`);e.nextTick(()=>{xl("wrapSelectionWithCommentMarker"),Mt()})}catch{}},Xo=a=>{if(!a||!a.commentId)return;const n=Array.isArray(H.comments)?[...H.comments]:[],s=typeof a.commentId=="string"&&a.commentId.startsWith("comment-")?Date.now():Number(a.commentId)||a.commentId;let i=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:a.text,user:a.user,createdAt:a.createdAt,created_at:a.createdAt,updated_at:a.createdAt};if(i>=0){const d=n[i];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=a.createdAt,!d.article_id&&n.length>0){const u=n.find(p=>p.article_id);u&&(d.article_id=u.article_id)}}else{const d=a.selectionRange,u=n.length>0&&n.find(g=>g.article_id)?.article_id||null,p={conversation_id:s,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:a.selectionText||"",conversation:[c],created_by_user:a.user,created_at:a.createdAt,updated_at:a.createdAt,status:"active"};n.push(p)}tt.value=!0,me("update:comments",n)},Yo=(a,n=[])=>{if(!H.commentUser||H.disabled||!H.richText||!f.value)return;const s=f.value;let i=null;try{i=s.querySelector(a)}catch{return}if(!i)return;nl(),s.focus();const c=document.createRange();c.selectNodeContents(i);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),$.value=i.innerHTML||"",Y.value=Bt();const u=c.getBoundingClientRect(),p=s.parentElement;if(p){const F=p.getBoundingClientRect(),P=u.bottom-F.top,le=Math.max(P+8,0);y.value={top:`${le}px`,bottom:"auto"}}const g=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");let k=[];if(g&&H.comments&&Array.isArray(H.comments)){const F=H.comments.find(P=>String(P.conversation_id)===String(g));if(F&&F.conversation&&Array.isArray(F.conversation)){const P=F.conversation.map(E=>({id:E.id||E.commentary_id,commentary_id:E.id||E.commentary_id,conversation_id:F.id||F.conversation_id,text:E.text,user:E.user,createdAt:E.created_at||E.createdAt,updated_at:E.updated_at||E.updatedAt}));k.push(...P)}}k.length===0&&Array.isArray(n)&&n.length>0&&(k=n.slice()),k.sort((F,P)=>{const E=Fe=>{if(!Fe)return 0;const we=new Date(Fe).getTime();return isNaN(we)?0:we},le=E(F.createdAt),J=E(P.createdAt);return le===J?0:le-J}),U.value=k,tn(!0),st.value=g||null,i&&(Ne.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(h.value="",x.value){const F=x.value;F.style.height="auto",F.style.height=`${F.scrollHeight}px`,F.focus()}if(p){const F=p.querySelector(".dss-comment-overlay");if(F){const P=p.querySelector(".dss-text-editor-footer");if(P){const E=p.getBoundingClientRect(),le=F.getBoundingClientRect(),J=P.getBoundingClientRect(),Fe=le.bottom-E.top,we=J.top-E.top,ct=8;if(Fe>we-ct){const bl=J.height;y.value={bottom:`${bl+ct}px`,top:"auto"}}}}}xl("openCommentOverlayForSelector")})},mo=e.ref(null),xo=e.ref(0),fn=a=>{if(!(H.disabled||!H.richText)){if(a.key==="Escape"){const n=window.getSelection();if(n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){a.preventDefault();let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const p=document.createElement("p");p.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(p,u.nextSibling):c.appendChild(p),setTimeout(()=>{xn()},50);return}}}if(a.key.length===1||a.key==="Enter"){const n=window.getSelection();if(n&&n.rangeCount>0){const s=n.getRangeAt(0),i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const p=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,g=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(p)&&p!==u||d.contains(g)&&g!==u){a.preventDefault();const k=document.createRange();k.setStartAfter(d),k.collapse(!0),n.removeAllRanges(),n.addRange(k);return}}}}}}if(a.key==="Backspace"||a.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);let i=null,c=null;if(s.collapsed)if(a.key==="Backspace"){const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const p=u.previousSibling;p&&(p.classList&&p.classList.contains("dss-image-wrapper")?c=p:p.tagName==="IMG"&&(i=p,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const p=u.nextSibling;p&&(p.classList&&p.classList.contains("dss-image-wrapper")?c=p:p.tagName==="IMG"&&(i=p,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const d=s.commonAncestorContainer,u=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,p=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(i=d,c=i.closest(".dss-image-wrapper")):(i=d.querySelector("img"),i&&(c=i.closest(".dss-image-wrapper"))),c){const g=c.contains(u)||u===c,k=c.contains(p)||p===c,P=s.cloneContents().textContent?.trim()||"",E=c.textContent?.trim()||"";(!g||!k||P.length>E.length)&&(c=null,i=null)}}if(c){a.preventDefault(),a.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const p=document.createRange();p.setStartAfter(u),p.collapse(!0),n.removeAllRanges(),n.addRange(p),e.nextTick(()=>{Mt()});return}}}}if(a.key==="Tab"){a.preventDefault(),a.shiftKey?Xl():Jl();return}if(a.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);if(s.collapsed){const u=s.startContainer,p=g=>{if(!g)return!1;let k=g.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 F=g.parentElement;return F&&F!==f.value?p(F):!1};if(u.nodeType===3){const g=u.parentElement;if(g&&(p(g)||p(u))){const k=g.closest("p, div");if(k&&k!==f.value){a.preventDefault(),a.stopPropagation();let F=null;const P=s.startOffset;P<u.length&&(F=u.splitText(P));const E=document.createElement("p");if(F?E.appendChild(F):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 le=document.createRange();F?le.setStart(F,0):le.setStart(E,0),le.collapse(!0),n.removeAllRanges(),n.addRange(le),e.nextTick(()=>{Mt()});return}}}}const i=s.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const p=J=>{if(!J)return!1;const Fe=J.textContent||"",ct=(J.innerHTML||"").trim(),bl=ct.replace(/<br\s*\/?>/gi,"").trim();return Fe.trim()===""||ct===""||bl===""||ct==="<br>"||ct==="<br/>"||ct==="<p></p>"||ct==="<p><br></p>"||ct==="<p><br/></p>"||ct==="<p> </p>"||ct==="<p><br> </p>"||ct==="<div></div>"||ct==="<div><br></div>"||ct==="<div><br/></div>"},g=c.lastChild,k=g&&g.nodeType===1&&g.tagName==="BR",F=s.startContainer,P=F.nodeType===3?F.parentElement:F,E=P===c||P&&P.parentElement===c;if(u&&p(u)||k&&E){a.preventDefault(),setTimeout(()=>{xn()},50);return}}}}if(a.key===" "){const n=Date.now(),s=n-xo.value;if(mo.value===" "&&s<300){const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(d){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){a.preventDefault(),Jl();return}}}}mo.value=" ",xo.value=n}else mo.value=a.key}},jo=a=>{if(H.disabled||!H.richText)return;a.preventDefault();let n=a.clipboardData.getData("text/html"),s=a.clipboardData.getData("text/plain");n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),Qt();const i=window.getSelection();let c=null;if(i&&i.rangeCount>0){let p=i.getRangeAt(0).commonAncestorContainer;p.nodeType===3&&(p=p.parentNode),c=p.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const g=new DOMParser().parseFromString(u,"text/html");let k=f.value.querySelector("h1")?1:0;if(g.querySelectorAll("h1").forEach(P=>{if(k>0){const E=g.createElement("p");E.innerHTML=P.innerHTML,P.parentNode.replaceChild(E,P)}else k++}),c){const P=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],E=Array.from(g.body.children).filter(le=>P.includes(le.tagName));if(E.length===1){const le=E[0].tagName,J=c.tagName,Fe=c.textContent.trim()===""&&!c.querySelector("img");let we=!1;if(["H1","H2","H3","H4","H5","H6"].includes(J)?we=!0:Fe||(le===J||le==="P")&&(we=!0),we)return E[0].innerHTML.trim()}}return g.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 p=d(s);document.execCommand("insertHTML",!1,p)}else document.execCommand("insertText",!1,s);Mt()},Eo=a=>{if(be.value){const s=a.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&nl()}if(Te.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=f.value&&s.closest(".dss-text-editor-content");!i&&!c&&Yl()}if(Ft.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!i&&!c&&Bo()}const n=a.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(Ce.value=null),!f.value||!n.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const i=s.getRangeAt(0);ie.value=!i.collapsed&&gn(i)}else ie.value=!1}if(st.value!==null){const s=document.querySelector(".dss-comment-overlay");let i=!1;if(s){const u=s.getBoundingClientRect(),p=a.clientX,g=a.clientY;i=p>=u.left&&p<=u.right&&g>=u.top&&g<=u.bottom}const c=n.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!i&&!d&&(st.value=null,h.value="",$.value="",Y.value=null,U.value=[],tn(!0))}},So=(a,n)=>{a&&a.stopPropagation&&a.stopPropagation(),je.value&&(clearTimeout(je.value),je.value=null),Ce.value=n},Vo=a=>{const n=a.relatedTarget;if(n){const s=n.closest(".dss-toolbar-dropdown-submenu"),i=n.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||i)return}je.value&&clearTimeout(je.value),je.value=setTimeout(()=>{Ce.value=null,je.value=null},150)},Ko=a=>{Ce.value=null};let Go=0;const Qo=a=>{if(!a)return;const n=Array.from(a.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,i)=>{if(s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||s.classList.contains("dss-toolbar-dropdown-submenu")||!s.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(s.children).find(p=>p.tagName==="DIV"?p.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(p.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(p=>p.tagName==="BUTTON"||p.tagName==="DIV");if(c||u){const p=`submenu-auto-${++Go}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",p);let g=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),g=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),g=d),g&&(g.setAttribute("data-submenu-id",p),g.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?g.dataset.originalParentRef="inside":g.dataset.originalParentRef="sibling",Array.from(g.children).forEach(F=>{(F.tagName==="BUTTON"||F.tagName==="DIV")&&!F.classList.contains("dss-toolbar-dropdown-item")&&F.classList.add("dss-toolbar-dropdown-item")}))}})},po=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{Qo(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=g=>{const k=c.getAttribute("data-submenu-id");k&&So(g,k)},p=Vo;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",p),c._subMenuHandlers={enter:u,leave:p}}),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 F=c.getAttribute("data-submenu-id");F&&So(k,F)},p=Vo;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",p),c._subMenuHandlers={enter:u,leave:p},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(k=>{k.addEventListener("click",Ko)})})})};let Fn=null;const en=()=>{if(Ce.value){const a=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Ce.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Ce.value}"]`);a&&n&&yn(a,n)}if(Te.value&&ol(),H.richText){if(Fn!==null)return;Fn=setTimeout(()=>{Fn=null,xl("handleWindowResize")},150)}},eo=()=>{if(!H.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(n=>{Array.from(n.children).filter(i=>i.tagName==="DIV"&&!i.classList.contains("dss-toolbar-button")).forEach(i=>{i.classList.add("dss-toolbar-button")})})},Jo=()=>{const a=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 i=window.getSelection();i.removeAllRanges?i.removeAllRanges():i.empty&&i.empty()}return!1};a.forEach(s=>{s.addEventListener("selectstart",n),s.addEventListener("mousedown",n),s.addEventListener("dragstart",n),s.addEventListener("contextmenu",n),s.addEventListener("click",i=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{wt.value?se():ut(),B.value?Je():Tt()})}),e.nextTick(()=>{Jo()}),H.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Eo),window.addEventListener("resize",en);let a=null;const n=()=>{a===null&&(a=setTimeout(()=>{a=null,en()},150))};window.addEventListener("scroll",n,!0),f.value._windowScrollHandler=n,f.value._windowScrollTimeout=a,f.value.closest(".editor-with-comments"),f.value.closest(".dss-text-editor-content-wrapper");const s=f.value.closest(".dss-text-editor-content");let i=null;const c=()=>{i===null&&(i=setTimeout(()=>{i=null,en()},150))};s&&(s.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{po(),eo()}),f.value.addEventListener("click",p=>{const g=p.target;g.closest("a")&&!H.disabled&&p.preventDefault();const F=g.closest(".dss-image-no-alt-icon"),P=g.closest(".dss-image-wrapper");if(F||P&&g===P){p.preventDefault(),p.stopPropagation();const E=window.getSelection(),le=document.createRange();le.setStartAfter(P),le.collapse(!0),E.removeAllRanges(),E.addRange(le)}else P&&g.tagName!=="IMG"&&(p.preventDefault(),e.nextTick(()=>{const E=window.getSelection();if(E.rangeCount>0){const J=E.getRangeAt(0).commonAncestorContainer,Fe=J.nodeType===3?J.parentElement:J;if(P.contains(Fe)&&Fe!==P.querySelector("img")){const we=document.createRange();we.setStartAfter(P),we.collapse(!0),E.removeAllRanges(),E.addRange(we)}}else{const le=document.createRange();le.setStartAfter(P),le.collapse(!0),E.addRange(le)}}))},!0),f.value.addEventListener("mousedown",p=>{const g=p.target,k=g.closest(".dss-image-no-alt-icon"),F=g.closest(".dss-image-wrapper");if(k||F&&g.tagName!=="IMG"){p.preventDefault();const P=window.getSelection(),E=document.createRange();F&&(E.setStartAfter(F),E.collapse(!0),P.removeAllRanges(),P.addRange(E))}},!0),f.value.addEventListener("paste",p=>{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 P=k.getAttribute("alt")||k.alt||"";if(P){const E=k.getAttribute("src")||k.src||"",le=E.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),J=P===E||P===le;(P.startsWith("http://")||P.startsWith("https://")||P.startsWith("data:")||J||J)&&(k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="")}}}),_l()})}),f.value.addEventListener("dragstart",p=>{const g=p.target,k=g.tagName==="IMG"?g:g.closest("img"),F=k?.closest(".dss-image-wrapper");k&&f.value.contains(k)&&(pt.value=F||k,p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",p=>{pt.value&&(p.preventDefault(),p.stopPropagation(),p.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",p=>{pt.value&&(p.preventDefault(),p.stopPropagation())}),f.value.addEventListener("drop",p=>{if(!pt.value||!f.value)return;p.preventDefault(),p.stopPropagation();const g=pt.value,k=g.classList?.contains("dss-image-wrapper"),F=k?g.querySelector("img"):g,P=k?g:F?.closest(".dss-image-wrapper");if(!F||!f.value.contains(F)){pt.value=null;return}let E=null;const le=p.clientX,J=p.clientY;if(document.caretRangeFromPoint)E=document.caretRangeFromPoint(le,J);else{const Zt=window.getSelection();Zt.rangeCount>0?E=Zt.getRangeAt(0).cloneRange():(E=document.createRange(),E.selectNodeContents(f.value),E.collapse(!1))}if(!E){pt.value=null;return}const Fe=E.commonAncestorContainer,we=Fe.nodeType===3?Fe.parentElement:Fe;if(we?.closest(".dss-image-wrapper")===P||P&&P.contains(we)){pt.value=null;return}if(P&&(we===P||P.contains(we))){pt.value=null;return}const bl=F.getAttribute("src");let pl=null;P?pl=P.cloneNode(!0):pl=F.cloneNode(!0);try{let Zt=E.startContainer;if(Zt.nodeType===3&&(Zt=Zt.parentElement),P&&(Zt===P||P.contains(Zt))){const Ut=document.createRange();Ut.setStartAfter(P),Ut.collapse(!0),E=Ut}E.insertNode(pl);const vl=document.createRange();vl.setStartAfter(pl),vl.collapse(!0);const fl=window.getSelection();fl.removeAllRanges(),fl.addRange(vl)}catch{if(f.value.childNodes.length===0){const vl=document.createElement("p");vl.appendChild(pl),f.value.appendChild(vl)}else{const vl=f.value.lastChild;if(vl&&vl.nodeType===1)vl.appendChild(pl);else{const fl=document.createElement("p");fl.appendChild(pl),f.value.appendChild(fl)}}}P?P.remove():F.remove(),pt.value=null,e.nextTick(()=>{const Zt=f.value.querySelectorAll("img");let vl=!1;Zt.forEach(fl=>{if(fl.getAttribute("src")===bl)if(!vl)vl=!0;else{const Ut=fl.closest(".dss-image-wrapper");Ut?Ut.remove():fl.remove()}}),_l(),Mt()})}),f.value.addEventListener("dragend",p=>{pt.value=null});let d=null;const u=new MutationObserver(p=>{p.forEach(g=>{g.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 F=k.querySelectorAll&&k.querySelectorAll("img");F&&F.forEach(P=>{P.removeAttribute("alt"),P.removeAttribute("data-alt"),P.setAttribute("alt",""),P.setAttribute("data-alt",""),P.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{_l(),eo(),d=null},100)});if(u.observe(f.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const p=document.querySelector(".dss-text-editor-toolbar");if(p){const g=new MutationObserver(()=>{e.nextTick(()=>{eo()})});g.observe(p,{childList:!0,subtree:!0}),p._toolbarMutationObserver=g}}),H.modelValue){const p=ul(H.modelValue);f.value.innerHTML=p,An()}e.nextTick(()=>{const p=f.value.innerHTML||"",g=H.title||"",k=H.description||"";nt.value=p,te.value=g,K.value=k,Q.value=g,ce.value=k,Sl(),_l(),Ql(),hn(),Ao(),vt()}),wl(),Zl(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Eo),window.removeEventListener("resize",en),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),Fn!==null&&(clearTimeout(Fn),Fn=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),Pe.value&&clearTimeout(Pe.value),je.value&&clearTimeout(je.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),He.value&&He.value.disconnect(),gt.value!==null&&(cancelAnimationFrame(gt.value),gt.value=null),et.value!==null&&(clearTimeout(et.value),et.value=null),xt.value!==null&&(clearTimeout(xt.value),xt.value=null),tn(!0),f.value&&f.value._scrollHandlers){const{wrapper:n,content:s,handler:i}=f.value._scrollHandlers;n&&n.removeEventListener("scroll",i),s&&s.removeEventListener("scroll",i)}const a=document.querySelector(".dss-text-editor-toolbar");a&&a._toolbarMutationObserver&&a._toolbarMutationObserver.disconnect()});const ea=a=>{const n=a.target,s=n.closest("a");if(s&&!H.disabled){a.preventDefault();const c=document.createRange();c.selectNodeContents(s);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const i=n.closest(".dss-image-wrapper");i&&n.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,p=u.nodeType===3?u.parentElement:u;if(i.contains(p)&&p!==i.querySelector("img")){const g=document.createRange();g.setStartAfter(i),g.collapse(!0),c.removeAllRanges(),c.addRange(g)}}_l(),wl(),Zl(),ol(),hn()}):e.nextTick(()=>{_l(),wl(),Zl(),ol(),hn()})},vo=()=>{wn();const a=window.getSelection();if(a&&a.rangeCount>0){const s=a.getRangeAt(0);ie.value=!s.collapsed&&gn(s),!s.collapsed&&w.value&&(w.value=null)}else ie.value=!1;if(_l(),wl(),Zl(),ol(),hn(),a&&a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c&&c.closest(".dss-text-editor-footer")){a.removeAllRanges(),ie.value=!1;return}}["bold","italic","underline"].forEach(s=>{try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(!c.collapsed)if(s==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let p=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(p=!0),!p&&u.style&&parseInt(u.style.fontWeight)>=600&&(p=!0),!p))try{const g=window.getComputedStyle(u);parseInt(g.fontWeight)>=600&&(p=!0)}catch{}ke.value[s]=p}else{const d=document.queryCommandState(s);ke.value[s]=d}}}catch{}})},hn=()=>{if(!H.richText||H.disabled||!f.value){T.value="p";return}try{const a=window.getSelection();if(!a||a.rangeCount===0){T.value="p";return}const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i||!f.value.contains(i)){T.value="p";return}const c=i.closest("h1, h2, h3, h4, h5, h6, p");if(!c){T.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?T.value=d:T.value="p"}catch{T.value="p"}},Zl=()=>{if(!f.value){Ue.value=!1;return}try{const a=window.getSelection();let n=!1;if(a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");n=!!(c&&f.value.contains(c))}Ue.value=n}catch{Ue.value=!1}},gn=a=>{if(!a||!f.value)return!1;const n=a.commonAncestorContainer;if(!n)return!1;const s=n.nodeType===3?n.parentElement:n;return s?f.value.contains(s):!1},Yl=()=>{Te.value=!1},ol=()=>{if(!H.floatingToolbar||!H.richText||H.disabled){Te.value=!1;return}const a=window.getSelection();if(!a||a.rangeCount===0){Te.value=!1;return}const n=a.getRangeAt(0);if(n.collapsed||!gn(n)){Te.value=!1;return}const s=n.getBoundingClientRect();if(!s||s.width===0&&s.height===0){Te.value=!1;return}const i=f.value;if(!i){Te.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){Te.value=!1;return}const d=40,u=8,p=s.top-d/2+15;let g=s.left+s.width/2;const k=window.innerWidth||document.documentElement.clientWidth||0;let F=0;ge.value&&(F=ge.value.getBoundingClientRect().width);const P=(F||320)/2;let E=c.left+P,le=c.right-P;if(le<E){const J=c.left+c.width/2;E=J,le=J}if(k>0){const J=P+u,Fe=k-P-u;if(E=Math.max(E,J),le=Math.min(le,Fe),le<E){const we=k/2;E=we,le=we}}g<E?g=E:g>le&&(g=le),at.value={position:"fixed",top:`${Math.max(p,8)}px`,left:`${g}px`,transform:"translate(-50%, -100%)",zIndex:10003},Te.value=!0},No=a=>{H.disabled||!H.richText||(Ft.value=Ft.value===a?null:a,a==="askAi"&&(be.value=null))},Bo=()=>{Ft.value=null,Ce.value=null},En=a=>{Il(a),Bo()};let Sn=null,In=null,Vn=null,Nn=null;const fo=a=>{if(H.disabled||!H.richText){jn(),Bn();return}const n=a.target,s=n.closest("a"),i=n.closest("img");if(Sn&&(clearTimeout(Sn),Sn=null),Vn&&(clearTimeout(Vn),Vn=null),s&&s!==In){Bn(),In=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),qe.value=s,fe.value=c,j.value=!0,V.value=!0,_o(s)}else!s&&In?(In=null,Sn=setTimeout(()=>{V.value||jn()},150)):s&&s===In&&_o(s);if(i&&i!==Nn){jn(),Nn=i;let c=i.getAttribute("alt");c===null&&(c=i.alt||"");let d=i.getAttribute("data-alt");d===null&&(d=c),i.hasAttribute("alt")||i.setAttribute("alt",c),i.hasAttribute("data-alt")||i.setAttribute("data-alt",d),ht.value=i,Dt.value=c.trim()||N("textEditor.image.noAlt"),St.value=!0,A.value=!0,$o(i)}else!i&&Nn?(Nn=null,Vn=setTimeout(()=>{A.value||Bn()},150)):i&&i===Nn&&$o(i)},Mo=a=>{const n=a.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(In=null,Nn=null,Sn&&(clearTimeout(Sn),Sn=null),Vn&&(clearTimeout(Vn),Vn=null),jn(),Bn())},jn=()=>{V.value=!1,setTimeout(()=>{V.value||(j.value=!1,fe.value="",$e.value||(qe.value=null))},100)},_o=a=>{if(!a||!f.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;_e.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Bn=()=>{A.value=!1,setTimeout(()=>{A.value||(St.value=!1,Dt.value="",dt.value||(ht.value=null))},100)},$o=a=>{if(!a||!f.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;pe.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},ho=()=>{if(!fe.value||!qe.value)return;let n=qe.value.getAttribute("href")||fe.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},$l=()=>{if(qe.value){const a=qe.value.textContent||"",n=qe.value.getAttribute("href")||"",s=qe.value;lt.value=n,rt.value=a,ye.value=a,V.value=!1,j.value=!1,fe.value="",qe.value=s,$e.value=!0}else if(he.value){const a=window.getSelection();if(a.rangeCount>0){const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(i){const c=i.textContent||"",d=i.getAttribute("href")||"";lt.value=d,rt.value=c,ye.value=c,qe.value=i,$e.value=!0}}}else{ze.value=Bt();const a=window.getSelection();let n="";a.rangeCount>0&&(n=a.getRangeAt(0).toString()),lt.value="",rt.value=n,ye.value="",qe.value=null,$e.value=!0}e.nextTick(()=>{Qe.value&&(Qe.value.focus(),Qe.value.select())})},z=()=>{$e.value=!1,lt.value="",rt.value="",ye.value="",qe.value=null,ze.value=null},kl=()=>{if(!lt.value.trim()){z();return}if(Ke.value?(Pe.value&&(clearTimeout(Pe.value),Pe.value=null),Qt(),Ke.value=!1):Qt(),rt.value.trim()||(rt.value=lt.value.trim()),qe.value&&f.value&&f.value.contains(qe.value)){const a=window.getSelection();a.rangeCount>0&&a.removeAllRanges();const n=qe.value;if(n.setAttribute("href",lt.value.trim()),rt.value.trim()!==ye.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=rt.value.trim()}n.style.color="#60afdf",n.style.textDecoration="underline";const s=document.createRange();s.selectNodeContents(n),s.collapse(!1),a.removeAllRanges(),a.addRange(s),Mt()}else if(f.value){f.value.focus();const a=window.getSelection();a.removeAllRanges(),ze.value&&Bl(ze.value);let n=null;if(a.rangeCount>0&&(n=a.getRangeAt(0)),n&&!n.collapsed){n.toString();const s=document.createElement("a");s.href=lt.value.trim(),s.textContent=rt.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",n.deleteContents(),n.insertNode(s);const i=document.createTextNode(" ");n.setStartAfter(s),n.insertNode(i),n.setStartAfter(i),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(f.value),n.collapse(!1));const s=n.startContainer,i=s.nodeType===3,c=i&&n.startOffset===s.textContent.length,d=document.createElement("a");if(d.href=lt.value.trim(),d.textContent=rt.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 p=u.nextElementSibling;if(p&&(p.innerHTML==="<br>"||p.innerHTML==="<br/>"||p.textContent.trim()==="")){p.textContent="",p.appendChild(d);const g=document.createTextNode(" ");p.appendChild(g);const k=document.createRange();k.setStartAfter(d),k.collapse(!0),a.removeAllRanges(),a.addRange(k)}else{if(n.startOffset>0){const k=s.textContent.substring(0,n.startOffset),F=k[k.length-1];if(F&&F!==" "&&F!==" "&&F!==`
|
|
104
|
+
`){const P=document.createTextNode(" ");n.insertNode(P),n.setStartAfter(P)}}n.insertNode(d);const g=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(g),n.setStartAfter(g),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}}}else{if(i&&n.startOffset>0){const p=s.textContent.substring(0,n.startOffset),g=p[p.length-1];if(g&&g!==" "&&g!==" "&&g!==`
|
|
105
|
+
`){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),a.removeAllRanges(),a.addRange(n)}}Mt()}e.nextTick(()=>{wl(),z()})},Pl=()=>{if(!f.value||oe.value)return;const a=window.getSelection();let n=null;a&&a.rangeCount>0&&(n=Bt());const s=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,i=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:p=>{const g=p.parentElement;return!g||g.closest("a")||g.closest(".dss-image-wrapper")||!p.textContent||p.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=i.nextNode();)c.push(d);let u=!1;for(let p=c.length-1;p>=0;p--){const g=c[p],k=g.textContent;s.lastIndex=0;const F=[...k.matchAll(s)];if(F.length===0)continue;const P=F.filter(J=>{const Fe=J[0],we=J.index;if(we>0&&k[we-1]==="@"||we+Fe.length<k.length&&k[we+Fe.length]==="@")return!1;const ct=g.parentElement;return!(ct&&ct.closest("a"))});if(P.length===0)continue;if(P.length===1&&P[0][0]===k.trim()){const J=P[0][0],Fe=J.startsWith("http://")||J.startsWith("https://")?J:`https://${J}`,we=document.createElement("a");we.href=Fe,we.textContent=J,we.style.color="#60afdf",we.style.textDecoration="underline",g.parentNode&&(g.parentNode.replaceChild(we,g),u=!0);continue}let E=0;const le=document.createDocumentFragment();if(P.forEach(J=>{const Fe=J.index,we=J[0];if(Fe>E){const pl=k.substring(E,Fe);pl&&le.appendChild(document.createTextNode(pl))}const ct=we.startsWith("http://")||we.startsWith("https://")?we:`https://${we}`,bl=document.createElement("a");bl.href=ct,bl.textContent=we,bl.style.color="#60afdf",bl.style.textDecoration="underline",le.appendChild(bl),E=Fe+we.length}),E<k.length){const J=k.substring(E);J&&le.appendChild(document.createTextNode(J))}g.parentNode&&le.childNodes.length>0&&(g.parentNode.replaceChild(le,g),u=!0)}u&&n&&e.nextTick(()=>{Bl(n),wl()})},Kn=()=>{if(!f.value)return;const a=/<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 i;for(;i=n.nextNode();)s.push(i);for(let c=s.length-1;c>=0;c--){const d=s[c],u=d.textContent,p=[...u.matchAll(a)];if(p.length===0)continue;let g=0;const k=document.createDocumentFragment();p.forEach(F=>{const P=F.index,E=F[0].startsWith("<u>")?"u":"ins",le=F[1]||F[2]||"";P>g&&k.appendChild(document.createTextNode(u.substring(g,P)));const J=document.createElement(E);J.textContent=le,k.appendChild(J),g=P+F[0].length}),g<u.length&&k.appendChild(document.createTextNode(u.substring(g))),d.parentNode&&k.childNodes.length>0&&d.parentNode.replaceChild(k,d)}},Cl=a=>{if(!f.value||oe.value)return;if(!a){Kn();return}if(!["*","_",">"].includes(a))return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const i=s.getRangeAt(0);if(!i.collapsed)return;const c=i.startContainer.nodeType===Node.TEXT_NODE?i.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):i.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===f.value||!f.value.contains(c))return;const d=()=>{let pl="",Zt=0,vl=!1;const fl=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:jl=>jl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let Ut=0;for(;fl.nextNode();){const jl=fl.currentNode,kn=jl.textContent||"",Cn=Ut;if(Ut+=kn.length,jl===i.startContainer){pl+=kn.substring(0,i.startOffset),Zt=Cn+i.startOffset,vl=!0;break}pl+=kn}return vl||(Zt=pl.length),{textBeforeCursor:pl,cursorCharOffset:Zt}},{textBeforeCursor:u}=d();if(!u.length)return;let p=null,g=null;if(u.endsWith("**")&&(p=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(p=u.match(/__(.+?)__$/s))?g="strong":u.endsWith("*")&&!u.endsWith("**")&&(p=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(p=u.match(new RegExp("(?<!_)_([^_]+)_$")))?g="em":a===">"&&((p=u.match(/<u>(.+?)<\/u>$/s))||(p=u.match(/<ins>(.+?)<\/ins>$/s)))&&(g=p[0].startsWith("<u>")?"u":"ins",p[0].startsWith("<u>"),p[0].startsWith("<u>")),!p||!p[1])return;const k=p[0],F=p[1],P=u.length-k.length,le=(pl=>{let Zt=0;const vl=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Ut=>Ut.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let fl;for(;fl=vl.nextNode();){const Ut=(fl.textContent||"").length;if(Zt+Ut>=pl)return{node:fl,offset:pl-Zt};Zt+=Ut}return null})(P);if(!le)return;const J=document.createRange();J.setStart(le.node,le.offset),J.setEnd(i.endContainer,i.endOffset);const Fe=document.createElement(g);Fe.textContent=F,J.deleteContents(),J.insertNode(Fe);const we=window.getSelection(),ct=document.createRange();ct.setStartAfter(Fe),ct.collapse(!0),we.removeAllRanges(),we.addRange(ct);const bl=Bt();e.nextTick(()=>{Mt(),bl&&Bl(bl)})},gl=()=>{f.value&&(il.value=Bt(),Ye.value="",It.value="",ae.value="",bt.value="",ft.value="",Pt.value=null,ht.value=null,X.value="upload",dt.value=!0,nl(),e.nextTick(()=>{Yt.value&&Yt.value.focus(),it.value&&(it.value.value="")}))},el=a=>{const n=a.target?.files?.[0];if(!n){Pt.value=null,It.value="";return}Pt.value=n;const s=new FileReader;s.onload=i=>{It.value=i.target?.result||""},s.readAsDataURL(n)},jt=()=>{it.value&&it.value.click()},al=()=>{bt.value&&(ft.value="")},cn=()=>{ft.value&&(bt.value="")},Mn=()=>{let a=ht.value;if(!a){const n=window.getSelection();if(n&&n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer;a=i.nodeType===1?i.closest("img"):i.parentElement?.closest("img")}}if(a){const n=a.getAttribute("data-alt")||a.getAttribute("alt")||"";ht.value=a,Ye.value=n.trim()===""||n.trim()==="Image"?"":n;const s=a.getAttribute("src")||a.src||"";s.startsWith("http://")||s.startsWith("https://")?(ae.value=s,It.value="",X.value="url"):(It.value=s,ae.value="",X.value="upload");const c=a.style.width||a.getAttribute("width")||"",d=a.style.height||a.getAttribute("height")||"";bt.value=c.endsWith("px")?c.replace("px",""):c,ft.value=d.endsWith("px")?d.replace("px",""):d,il.value=null}else{gl();return}dt.value=!0,A.value=!1,St.value=!1,e.nextTick(()=>{X.value==="url"&&At.value?(At.value.focus(),At.value.select()):Yt.value&&(Yt.value.focus(),Yt.value.select()),it.value&&(it.value.value="")})},Lt=()=>{dt.value=!1,Ye.value="",It.value="",ae.value="",bt.value="",ft.value="",Pt.value=null,ht.value=null,il.value=null,X.value="upload"},Ct=()=>{const a=(Ye.value||"").trim(),n=f.value?._mutationObserver;n&&n.disconnect(),Ke.value?(Pe.value&&(clearTimeout(Pe.value),Pe.value=null),Qt(),Ke.value=!1):Qt();const s=X.value==="url"?ae.value.trim():It.value;if(ht.value&&f.value&&f.value.contains(ht.value)){s&&(ht.value.src=s),ht.value.setAttribute("alt",a),ht.value.setAttribute("data-alt",a),bt.value?(ht.value.style.width=`${bt.value}px`,ht.value.setAttribute("width",bt.value)):(ht.value.style.removeProperty("width"),ht.value.removeAttribute("width")),ft.value?(ht.value.style.height=`${ft.value}px`,ht.value.setAttribute("height",ft.value)):(ht.value.style.removeProperty("height"),ht.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(ht.value),c.collapse(!0),i.addRange(c)}Mt()}else{if(!s){n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),Lt();return}if(f.value){f.value.focus();const i=window.getSelection();i&&i.rangeCount>0&&i.removeAllRanges();const c=window.getSelection();let d=null;if(il.value&&(Bl(il.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){Lt();return}const u=d.commonAncestorContainer,p=u.nodeType===3?u.parentElement:u;if(!f.value.contains(p)){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 g=document.createElement("img");g.src=s,g.setAttribute("alt",a),g.setAttribute("data-alt",a),bt.value&&(g.style.width=`${bt.value}px`,g.setAttribute("width",bt.value)),ft.value&&(g.style.height=`${ft.value}px`,g.setAttribute("height",ft.value));try{d.insertNode(g),d.setStartAfter(g),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(f.value){if(f.value.childNodes.length===0){const P=document.createElement("p");f.value.appendChild(P),P.appendChild(g)}else{const P=f.value.lastChild;if(P&&P.nodeType===1)P.appendChild(g);else{const E=document.createElement("p");f.value.appendChild(E),E.appendChild(g)}}const F=document.createRange();F.setStartAfter(g),F.collapse(!0),c&&(c.removeAllRanges(),c.addRange(F))}}ht.value=g,Mt()}}e.nextTick(()=>{n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),wl(),ol(),Lt()})};e.watch(()=>H.modelValue,a=>{if(H.richText&&f.value&&!oe.value){const n=ul(a||""),i=f.value.innerHTML.replace(/ |\u00A0/g," "),c=n.replace(/ |\u00A0/g," ");if(i!==c){const d=Bt();f.value.innerHTML=n,e.nextTick(()=>{An();const u=f.value.innerHTML||"",p=H.title||"",g=H.description||"";nt.value=u,te.value=p,K.value=g,qt.value=u,Q.value=p,ce.value=g,Ge.value=[],Vt.value=[],Pe.value&&(clearTimeout(Pe.value),Pe.value=null),Ke.value=!1,d&&Bl(d),Sl(),_l(),Ql(),wl(),ol(),hn(),xl("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>H.richText,a=>{a?(ol(),e.nextTick(()=>{Ao()})):(Yl(),re.value=[],He.value&&(He.value.disconnect(),He.value=null)),hn()}),e.watch(()=>H.floatingToolbar,a=>{a?ol():Yl()}),e.watch(()=>H.disabled,a=>{a&&Yl(),hn()}),e.watch(()=>H.description,()=>{e.nextTick(()=>{B.value?Je():Tt()})}),e.watch(()=>H.title,()=>{e.nextTick(()=>{wt.value?se():ut()})}),e.watch(()=>H.customToolbarSlots,()=>{e.nextTick(()=>{eo()})},{deep:!0}),e.watch(()=>H.comments,(a,n)=>{if(H.commentUser){if(tt.value){tt.value=!1;return}Se.value||H.richText&&f.value&&e.nextTick(()=>{vt()})}},{deep:!0,immediate:!1});const vt=()=>{if(H.commentUser&&!Se.value&&!(!H.comments||!Array.isArray(H.comments)||H.comments.length===0)&&!(!H.richText||!f.value)){Se.value=!0;try{const a=new Set,n=H.comments.filter(u=>{const p=String(u.conversation_id||u.id);return a.has(p)?!1:(a.add(p),!0)}),s=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),i=s.length;s.forEach(u=>{const p=u.parentNode;if(p){for(;u.firstChild;)p.insertBefore(u.firstChild,u);p.removeChild(u)}});let c=0;const d=new Set;n.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const p=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!p)return;const g=String(p);if(d.has(g))return;const k=f.value.querySelector(`[data-comment="${g}"]`);if(k){zn(k,u),d.add(g);return}try{const F=Gn(u.selection_range,u.selection_text);if(F&&!F.collapsed){const P=F.commonAncestorContainer,E=P.nodeType===3?P.parentElement:P;if(E){const Fe=E.closest("[data-comment], [data-fake-comment]");if(Fe){const we=Fe.getAttribute("data-comment")||Fe.getAttribute("data-fake-comment");if(String(we)===String(p)){Fe.setAttribute("data-comment",g),Fe.removeAttribute("data-fake-comment"),zn(Fe,u),d.add(g);return}else return}}const le=f.value.querySelector(`[data-comment="${g}"]`);if(le){zn(le,u),d.add(g);return}const J=document.createElement("span");J.setAttribute("data-comment",g),zn(J,u);try{F.surroundContents(J),c++,d.add(g)}catch{try{const we=document.createRange();we.setStart(F.startContainer,F.startOffset),we.setEnd(F.endContainer,F.endOffset),sl(we),we.surroundContents(J),c++,d.add(g)}catch{try{const ct=F.extractContents();J.appendChild(ct),F.insertNode(J),c++,d.add(g)}catch(ct){console.warn("Failed to create comment marker:",ct)}}}}}catch{}}),e.nextTick(()=>{xl("restoreCommentsFromModel"),Mt(),Se.value=!1})}catch{Se.value=!1}}},sl=a=>{if(!a||!f.value)return a;try{const n=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let s=a.startContainer,i=a.startOffset;if(s.nodeType===3){const u=s.parentElement;u&&n.includes(u.tagName)&&(i===0&&!ta(s)||a.setStartBefore(u))}else s.nodeType===1&&n.includes(s.tagName)&&i>0&&a.setStartBefore(s);let c=a.endContainer,d=a.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&n.includes(u.tagName)&&(d===c.length&&!Lo(c)||a.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&d<c.childNodes.length&&a.setEndAfter(c);return a}catch{return a}},ta=a=>{let n=a.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},Lo=a=>{let n=a.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},Gn=(a,n)=>{if(!a||!f.value)return null;try{const s=document.createRange();if(a.type==="text"&&typeof a.start=="number"&&typeof a.end=="number"){let i=0;const c=[f.value];let d=null,u=!1,p=!1;for(;!p&&(d=c.pop());)if(d.nodeType===3){const g=i+d.length;!u&&a.start>=i&&a.start<=g&&(s.setStart(d,a.start-i),u=!0),u&&a.end>=i&&a.end<=g&&(s.setEnd(d,a.end-i),p=!0),i=g}else{let g=d.childNodes.length;for(;g--;)c.push(d.childNodes[g])}return u?sl(s):null}}catch{return null}return null},zn=(a,n)=>{if(!a||!n)return;const s=n.conversation||[],i=new Set,c=[],d=p=>{p&&p.id&&!i.has(p.id)&&(i.add(p.id),c.push(p))};s.length>0&&s.forEach(p=>{p.user&&d(p.user)}),c.length>0?a.setAttribute("data-comment-user",JSON.stringify(c[0])):a.removeAttribute("data-comment-user"),c.length>1?a.setAttribute("data-comment-user-2",JSON.stringify(c[1])):a.removeAttribute("data-comment-user-2");const u=s.length;u>0?a.setAttribute("data-comment-count",String(u)):a.removeAttribute("data-comment-count")},xl=(a="unknown")=>{if(!H.commentUser||!H.richText||!f.value){re.value=[];return}Date.now()-yt.value<Et&>.value!==null||gt.value===null&&(gt.value=requestAnimationFrame(()=>{if(gt.value=null,yt.value=Date.now(),Ae.value)return;Ae.value=!0;const s={},i=f.value;if(!i){Ae.value=!1;return}const c=i.closest(".editor-with-comments");if(!c){Ae.value=!1;return}const d=i.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],p=new Set;d.forEach(E=>{const le=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");le&&E.tagName==="SPAN"&&(p.has(le)||(u.push(E),p.add(le)))}),d.forEach(E=>{const le=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");!le||p.has(le)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(E.tagName)?E.querySelector(`span[data-comment="${le}"], span[data-fake-comment="${le}"]`)||(u.push(E),p.add(le)):E.tagName!=="SPAN"&&(u.push(E),p.add(le)))});const g=c.getBoundingClientRect(),k=i.getBoundingClientRect();u.forEach((E,le)=>{let J=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");if(!J)return;if(typeof J=="string"&&J.startsWith("comment-")){const Vl=E.textContent?.trim(),ln=H.comments?.find(rl=>(typeof rl.conversation_id=="string"&&rl.conversation_id.startsWith("comment-")?null:rl.conversation_id)&&rl.selection_text?.trim()===Vl);ln?(J=String(ln.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 Fe=E.getBoundingClientRect(),we=window.getComputedStyle(E),ct=parseFloat(we.lineHeight)||parseFloat(we.fontSize)*1.2,Zt=Fe.top-k.top+ct/2-15,fl=k.top-g.top+Zt;let Ut=null,jl=null,kn=0;const Cn=[],Qn=new Set;if(J&&H.comments){const Vl=H.comments.find(ln=>String(ln.conversation_id||ln.id)===String(J));if(Vl){const ln=Vl.conversation||[];ln.length>0?(ln.forEach(rl=>{rl.user&&rl.user.id&&!Qn.has(rl.user.id)&&(Qn.add(rl.user.id),Cn.push(rl.user))}),kn=ln.length):(kn=0,Ut=null,jl=null),Cn.length>0?Ut=Cn[0]:Ut=null,Cn.length>1?jl=Cn[1]:jl=null}}const Ml=Fe.top+ct/2-15,Do=Ml+30,Wt=5,ko=Do>k.top+Wt&&Ml<k.bottom-Wt?1:0;re.value.find(Vl=>Vl.id===J);let to=E;if(!to&&J&&f.value){const Vl=String(J);to=f.value.querySelector(`[data-comment="${Vl}"], [data-fake-comment="${Vl}"]`)}const tl=Cn.length;s[J]?(s[J].top=fl,s[J].opacity=ko,s[J].element=to,s[J].firstUser=Ut,s[J].secondUser=jl,s[J].totalCount=kn,s[J].uniqueUserCount=tl):s[J]={id:J,top:fl,opacity:ko,element:to,firstUser:Ut,secondUser:jl,totalCount:kn,uniqueUserCount:tl}});const F=Object.values(s).map(E=>{const le=Math.max(0,(E.uniqueUserCount??0)-2);if(!E.element&&E.id&&f.value){const Fe=String(E.id);E.element=f.value.querySelector(`[data-comment="${Fe}"], [data-fake-comment="${Fe}"]`)}return{...E,firstUser:E.firstUser||null,secondUser:E.secondUser||null,totalCount:E.totalCount,additionalCount:le}});(re.value.length!==F.length||F.some((E,le)=>{const J=re.value[le];if(!J)return!0;const Fe=(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||Fe||we||J.element!==E.element}))&&(re.value=F),Ae.value=!1}))},go=a=>{if(!a)return;let n=a.element;if(!n&&a.id&&f.value){const s=String(a.id);n=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}n&&(tn(),Ne.value=n,n.classList.add("editor-comment-highlighted"))},tn=(a=!1)=>{!a&&st.value!==null&&Ne.value&&(Ne.value.getAttribute("data-comment")||Ne.value.getAttribute("data-fake-comment"))===st.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),Ne.value&&(Ne.value.classList.remove("editor-comment-highlighted"),Ne.value=null))},yo=a=>{if(!a||!a.element)return;tn(!0);const n=a.element.getAttribute("data-comment")||a.element.getAttribute("data-fake-comment");if(!n)return;const s=`[data-comment="${n}"], [data-fake-comment="${n}"]`;me("comment-marker-clicked",{commentId:n,selector:s,element:a.element})},To=()=>{tn()},Ao=()=>{!H.richText||!f.value||(He.value&&He.value.disconnect(),xt.value!==null&&(clearTimeout(xt.value),xt.value=null),He.value=new MutationObserver(()=>{xt.value===null&&(xt.value=setTimeout(()=>{xt.value=null,e.nextTick(()=>{xl("MutationObserver")})},200))}),He.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"]}),xl("setupCommentMarkersObserver-initial"))},yn=(a,n)=>{if(!a||!n)return;const s=n.getBoundingClientRect();let i=s.top,c=s.right+4;a.style.top=`${i}px`,a.style.left=`${c}px`,a.offsetHeight;const d=a.getBoundingClientRect(),u=window.innerWidth,p=window.innerHeight;if(d.right>u){const g=s.left-d.width-4;a.style.left=`${g}px`}if(d.bottom>p){const g=Math.max(8,p-d.height-8);a.style.top=`${g}px`}d.top<0&&(a.style.top="8px")};return e.watch(()=>Ce.value,a=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const i=s.getAttribute("data-submenu-id");if(i===a&&a){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${i}"]`);if(c){if(s.parentNode!==document.body){const d=s.parentNode;s.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(s)}s.style.display="block",s.style.visibility="hidden",s.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{yn(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(()=>[be.value,Ft.value],()=>{be.value==="askAi"||Ft.value==="askAi"?e.nextTick(()=>{po()}):(Ce.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 i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(i)if(n.dataset.originalParentRef==="inside")i.appendChild(n);else{const d=i.closest(".dss-toolbar-dropdown");d&&d.insertBefore(n,i.nextSibling)}}}})}))}),e.watch(()=>H.locale,a=>{a&&a!==ue.value&&(ue.value=a)},{immediate:!0}),ee({openCommentOverlayForSelector:Yo,updateCommentMarkers:xl,restoreCommentsFromModel:vt}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container",[{"editor-with-comments":$t.value},Ht.value]]),style:e.normalizeStyle(kt.value)},[S.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Id,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:pn,title:e.unref(N)("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,zd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!hl.value}]),onClick:qn,title:e.unref(N)("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,Pd),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Od,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=s=>Zn("paragraph")),title:e.unref(N)("textEditor.toolbar.paragraphFormat")},[T.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:O.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,qd)):T.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Zd)):T.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Ud)):T.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Xd)):T.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Yd)):T.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,jd)):(e.openBlock(),e.createElementBlock("svg",Kd,[...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,Wd),be.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[8]||(n[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[1]||(n[1]=s=>Il("<h1>"))},[e.createElementVNode("img",{src:O.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Gd),e.createElementVNode("h1",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=s=>Il("<h2>"))},[e.createElementVNode("img",{src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Qd),e.createElementVNode("h2",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=s=>Il("<h3>"))},[e.createElementVNode("img",{src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Jd),e.createElementVNode("h3",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=s=>Il("<h4>"))},[e.createElementVNode("img",{src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,e1),e.createElementVNode("h4",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=s=>Il("<h5>"))},[e.createElementVNode("img",{src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,t1),e.createElementVNode("h5",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=s=>Il("<h6>"))},[e.createElementVNode("img",{src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,l1),e.createElementVNode("h6",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=s=>Il("<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(N)("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=>Fl("bold")),title:e.unref(N)("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,n1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("italic")}]),onClick:n[10]||(n[10]=s=>Fl("italic")),title:e.unref(N)("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,o1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("underline")}]),onClick:n[11]||(n[11]=s=>Fl("underline")),title:e.unref(N)("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,a1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ue.value}]),onClick:Hn,title:e.unref(N)("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,s1),n[62]||(n[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),he.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:sn,title:e.unref(N)("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,i1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Xn,title:e.unref(N)("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,r1)),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:Yn,title:e.unref(N)("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,c1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("insertOrderedList")}]),onClick:rn,title:e.unref(N)("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,u1),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:gl,title:e.unref(N)("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,d1),$t.value&&ie.value?(e.openBlock(),e.createElementBlock("div",m1)):e.createCommentVNode("",!0),$t.value&&ie.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(N)("textEditor.toolbar.comment"),onClick:Wl},[...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,p1)):e.createCommentVNode("",!0),S.askAi?(e.openBlock(),e.createElementBlock("div",v1)):e.createCommentVNode("",!0),S.askAi?(e.openBlock(),e.createElementBlock("div",f1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=s=>Zn("askAi")),title:e.unref(N)("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",g1,e.toDisplayString(e.unref(N)("textEditor.toolbar.askAi")),1)],8,h1),be.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(a.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",y1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Al(s)?(e.openBlock(),e.createElementBlock("div",k1,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),Al(s)&&i<S.customToolbarSlots.length-1&&Wn(i)?(e.openBlock(),e.createElementBlock("div",C1)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(be.value==="paragraph"||be.value==="askAi")&&S.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:nl})):e.createCommentVNode("",!0),e.createVNode(ma,{showModal:$e.value,width:"500px",height:"55vh",onCloseModal:z},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",b1,[e.createElementVNode("div",w1,[e.createElementVNode("label",x1,e.toDisplayString(e.unref(N)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Z,type:"text","onUpdate:modelValue":n[15]||(n[15]=s=>rt.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.link.enterAltText"),onKeyup:e.withKeys(kl,["enter"])},null,40,E1),[[e.vModelText,rt.value]])]),e.createElementVNode("div",S1,[e.createElementVNode("label",V1,e.toDisplayString(e.unref(N)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Qe,type:"text","onUpdate:modelValue":n[16]||(n[16]=s=>lt.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.link.enterUrl"),onKeyup:e.withKeys(kl,["enter"])},null,40,N1),[[e.vModelText,lt.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:z},e.toDisplayString(e.unref(N)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:kl},e.toDisplayString(e.unref(N)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(ma,{showModal:dt.value,width:"500px",height:"80vh",onCloseModal:Lt},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ht.value?e.unref(N)("textEditor.image.editImage"):e.unref(N)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",B1,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":X.value==="upload"}]),onClick:n[17]||(n[17]=s=>X.value="upload")},e.toDisplayString(e.unref(N)("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":X.value==="url"}]),onClick:n[18]||(n[18]=s=>X.value="url")},e.toDisplayString(e.unref(N)("textEditor.image.imageLink")),3)]),X.value==="upload"?(e.openBlock(),e.createElementBlock("div",M1,[e.createElementVNode("div",_1,[e.createElementVNode("div",$1,[un.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",L1,e.toDisplayString(e.unref(N)("textEditor.image.uploadImage")),1)),un.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:jt},[e.createElementVNode("img",{src:It.value,alt:"Preview",class:"dss-image-preview-image"},null,8,T1),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:it,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:el},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:it,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:el},null,544))]),e.createElementVNode("div",A1,[e.createElementVNode("label",D1,e.toDisplayString(e.unref(N)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Yt,type:"text","onUpdate:modelValue":n[19]||(n[19]=s=>Ye.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Ct,["enter"])},null,40,H1),[[e.vModelText,Ye.value]])]),e.createElementVNode("div",R1,[e.createElementVNode("label",F1,e.toDisplayString(e.unref(N)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=s=>bt.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.auto"),onKeyup:e.withKeys(Ct,["enter"]),onInput:al},null,40,I1),[[e.vModelText,bt.value]])]),e.createElementVNode("div",z1,[e.createElementVNode("label",P1,e.toDisplayString(e.unref(N)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=s=>ft.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.auto"),onKeyup:e.withKeys(Ct,["enter"]),onInput:cn},null,40,O1),[[e.vModelText,ft.value]])])])])):e.createCommentVNode("",!0),X.value==="url"?(e.openBlock(),e.createElementBlock("div",W1,[e.createElementVNode("div",q1,[e.createElementVNode("div",Z1,[e.createElementVNode("label",U1,e.toDisplayString(e.unref(N)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:At,type:"text","onUpdate:modelValue":n[22]||(n[22]=s=>ae.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(Ct,["enter"])},null,40,X1),[[e.vModelText,ae.value]])]),e.createElementVNode("div",Y1,[e.createElementVNode("label",j1,e.toDisplayString(e.unref(N)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=s=>Ye.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Ct,["enter"])},null,40,K1),[[e.vModelText,Ye.value]])]),e.createElementVNode("div",G1,[e.createElementVNode("label",Q1,e.toDisplayString(e.unref(N)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=s=>bt.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.auto"),onKeyup:e.withKeys(Ct,["enter"]),onInput:al},null,40,J1),[[e.vModelText,bt.value]])]),e.createElementVNode("div",em,[e.createElementVNode("label",tm,e.toDisplayString(e.unref(N)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=s=>ft.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.auto"),onKeyup:e.withKeys(Ct,["enter"]),onInput:cn},null,40,lm),[[e.vModelText,ft.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Lt},e.toDisplayString(e.unref(N)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Ct},e.toDisplayString(e.unref(N)("textEditor.image.save")),1)]),_:1},8,["showModal"]),S.showTitle?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Dl.value&&wt.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(N)("textEditor.labels.title")),1),e.createElementVNode("div",nm,[wt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",om,[S.title?(e.openBlock(),e.createElementBlock("span",am,e.toDisplayString(S.title),1)):(e.openBlock(),e.createElementBlock("span",sm,e.toDisplayString(Ul.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Ve,value:S.title,onInput:Ze,onFocus:De,onBlur:mt,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!wt.value}]),placeholder:Ul.value,disabled:S.disabled,rows:"1"},null,42,rm)])],2)):e.createCommentVNode("",!0),S.showTitle&&Dl.value&&wt.value?(e.openBlock(),e.createElementBlock("div",im,[e.renderSlot(a.$slots,"title-slot")])):e.createCommentVNode("",!0),S.showDescription?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":Ol.value&&B.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(N)("textEditor.labels.description")),1),e.createElementVNode("div",cm,[B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",um,[S.description?(e.openBlock(),e.createElementBlock("span",dm,e.toDisplayString(S.description),1)):(e.openBlock(),e.createElementBlock("span",mm,e.toDisplayString(Tl.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:We,value:S.description,onInput:ll,onFocus:dl,onBlur:ml,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!B.value}]),placeholder:Tl.value,disabled:S.disabled,rows:"1"},null,42,pm)])],2)):e.createCommentVNode("",!0),S.showDescription&&Ol.value&&B.value?(e.openBlock(),e.createElementBlock("div",vm,[e.renderSlot(a.$slots,"description-slot")])):e.createCommentVNode("",!0),$t.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:6},e.renderList(re.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":st.value===s.id,"editor-comment-marker-group-out-of-view":s.opacity===0}]),"data-comment-id":s.id,style:e.normalizeStyle({top:s.top+"px"}),onMouseenter:i=>go(s),onMouseleave:To},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>yo(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,gm)):(e.openBlock(),e.createElementBlock("span",ym,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,hm)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>yo(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,Cm)):(e.openBlock(),e.createElementBlock("span",bm,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,km)):e.createCommentVNode("",!0),s.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:s.secondUser?"30px":"15px"}),"data-has-second-user":s.secondUser?"true":"false",onClick:e.withModifiers(i=>yo(s),["stop"])},[e.createElementVNode("span",xm,"+"+e.toDisplayString(s.additionalCount),1)],12,wm)):e.createCommentVNode("",!0)],46,fm))),128)):e.createCommentVNode("",!0),S.richText?(e.openBlock(),e.createElementBlock("div",_m,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":S.disabled,"dss-text-editor-fixed-height":S.fixedHeight}]),style:e.normalizeStyle(Ll.value),onInput:Mt,onBlur:an,onClick:ea,onMouseup:vo,onKeyup:vo,onKeydown:fn,onPaste:jo,onMousemove:fo,onMouseleave:Mo},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[$t.value&&st.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(y.value)},[$.value||U.value.length>0?(e.openBlock(),e.createElementBlock("div",$m,[e.createElementVNode("div",Lm,[$.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:$.value},null,8,Tm)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Am,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,(s,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:"dss-comment-message"},[s.user&&(s.user.avatar||s.user.initials||s.user.name)?(e.openBlock(),e.createElementBlock("div",Dm,[e.createElementVNode("div",Hm,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,Rm)):(e.openBlock(),e.createElementBlock("span",Fm,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Im,[e.createElementVNode("div",zm,[e.createElementVNode("div",Pm,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",Om,e.toDisplayString(R(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":W(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),H.commentUser&&s.user&&s.user.id===H.commentUser.id&&!W(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>vn(s,i),["stop"]),title:e.unref(N)("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,Wm)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",qm,[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(N)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(ql,["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,Zm),[[e.vModelText,h.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",Um,[e.createElementVNode("div",Xm,[e.createElementVNode("span",Ym,e.toDisplayString(cl.value)+" "+e.toDisplayString(cl.value===1?e.unref(N)("textEditor.footer.word"):e.unref(N)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",jm,e.toDisplayString(nn.value)+" "+e.toDisplayString(nn.value===1?e.unref(N)("textEditor.footer.character"):e.unref(N)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Em,[e.createElementVNode("textarea",{value:S.modelValue,onInput:D,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":S.fixedHeight}]),placeholder:dn.value,rows:S.rows,disabled:S.disabled,style:e.normalizeStyle(Gt.value)},null,46,Sm),e.createElementVNode("div",Vm,[e.createElementVNode("div",Nm,[e.createElementVNode("span",Bm,e.toDisplayString(cl.value)+" "+e.toDisplayString(cl.value===1?e.unref(N)("textEditor.footer.word"):e.unref(N)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Mm,e.toDisplayString(nn.value)+" "+e.toDisplayString(nn.value===1?e.unref(N)("textEditor.footer.character"):e.unref(N)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[j.value&&fe.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(_e.value),onMouseenter:n[28]||(n[28]=s=>V.value=!0),onMouseleave:jn},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(ho,["stop"]),title:fe.value},e.toDisplayString(fe.value),9,Km),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers($l,["stop"]),title:e.unref(N)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Qm,[...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,Gm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[St.value&&Dt.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(pe.value),onMouseenter:n[29]||(n[29]=s=>A.value=!0),onMouseleave:Bn},[e.createElementVNode("div",Jm,[Dt.value===e.unref(N)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",e2,[...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:Dt.value},e.toDisplayString(Dt.value),9,t2)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Mn,["stop"]),title:e.unref(N)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",n2,[...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,l2)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[S.floatingToolbar&&S.richText&&Te.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:ge,class:"dss-floating-toolbar",style:e.normalizeStyle(at.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",o2,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(pn,["stop"]),title:e.unref(N)("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,a2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!hl.value}]),onClick:e.withModifiers(qn,["stop"]),title:e.unref(N)("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,s2),n[89]||(n[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",r2,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(s=>No("paragraph"),["stop"])),title:e.unref(N)("textEditor.toolbar.paragraphFormat")},[T.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:O.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,c2)):T.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,u2)):T.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,d2)):T.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,m2)):T.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,p2)):T.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,v2)):(e.openBlock(),e.createElementBlock("svg",f2,[...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,i2),Ft.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=>En("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=s=>En("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=s=>En("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=s=>En("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=s=>En("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=s=>En("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=s=>En("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(N)("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=>Fl("bold"),["stop"])),title:e.unref(N)("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,h2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(s=>Fl("italic"),["stop"])),title:e.unref(N)("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,g2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(s=>Fl("underline"),["stop"])),title:e.unref(N)("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,y2),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":Ue.value}]),onClick:e.withModifiers(Hn,["stop"]),title:e.unref(N)("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,k2),n[92]||(n[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),he.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(sn,["stop"]),title:e.unref(N)("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,b2)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Xn,["stop"]),title:e.unref(N)("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,C2)),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(Yn,["stop"]),title:e.unref(N)("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,w2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("insertOrderedList")}]),onClick:e.withModifiers(rn,["stop"]),title:e.unref(N)("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,x2),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(gl,["stop"]),title:e.unref(N)("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,E2),$t.value?(e.openBlock(),e.createElementBlock("div",S2)):e.createCommentVNode("",!0),$t.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(N)("textEditor.toolbar.comment"),onClick:e.withModifiers(Wl,["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,V2)):e.createCommentVNode("",!0),S.askAi?(e.openBlock(),e.createElementBlock("div",N2)):e.createCommentVNode("",!0),S.askAi?(e.openBlock(),e.createElementBlock("div",B2,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(s=>No("askAi"),["stop"])),title:e.unref(N)("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",_2,e.toDisplayString(e.unref(N)("textEditor.toolbar.askAi")),1)],8,M2),Ft.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[43]||(n[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(a.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),on.value?(e.openBlock(),e.createElementBlock("div",$2,[S.askAi&&on.value?(e.openBlock(),e.createElementBlock("div",L2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Al(s)&&El(s)?(e.openBlock(),e.createElementBlock("div",T2,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),Al(s)&&El(s)&&i<S.customToolbarSlots.length-1&&Ln(i)?(e.openBlock(),e.createElementBlock("div",A2)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),R2={class:"dss-color-picker__section-title"},F2={class:"dss-color-picker__presets-row"},I2=["title","onClick"],z2={key:1,class:"dss-color-picker__section"},P2={class:"dss-color-picker__presets-row"},O2=["title","onClick"],W2={key:2,class:"dss-color-picker__section"},q2={class:"dss-color-picker__section-header"},Z2={class:"dss-color-picker__presets-row"},U2=["title","onClick"],X2=["onClick"],Y2={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},j2=["title","onClick"],K2={class:"dss-color-picker__input-row"},G2=["value"],Q2={__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(S,{emit:ee}){function L(te){const K=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(te);if(!K)return{h:0,s:0,l:50};const Q=parseInt(K[1],16)/255,ce=parseInt(K[2],16)/255,Ve=parseInt(K[3],16)/255,We=Math.max(Q,ce,Ve),Nt=Math.min(Q,ce,Ve);let Ot=0,pt=0;const wt=(We+Nt)/2;if(We!==Nt){const B=We-Nt;switch(pt=wt>.5?B/(2-We-Nt):B/(We+Nt),We){case Q:Ot=((ce-Ve)/B+(ce<Ve?6:0))/6;break;case ce:Ot=((Ve-Q)/B+2)/6;break;case Ve:Ot=((Q-ce)/B+4)/6;break}}return{h:Ot*360,s:pt*100,l:wt*100}}function N(te,K,Q){K/=100,Q/=100;const ce=K*Math.min(Q,1-Q),Ve=We=>{const Nt=(We+te/30)%12,Ot=Q-ce*Math.max(Math.min(Nt-3,9-Nt,1),-1);return Math.round(255*Ot).toString(16).padStart(2,"0")};return`#${Ve(0)}${Ve(8)}${Ve(4)}`}function ue(te){const K=te.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!K)return null;let Q=K[1];return Q.length===3&&(Q=Q.split("").map(ce=>ce+ce).join("")),"#"+Q}function O(te){const K=te.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!K)return null;const Q=Math.max(0,Math.min(255,Number.parseInt(K[1],10))),ce=Math.max(0,Math.min(255,Number.parseInt(K[2],10))),Ve=Math.max(0,Math.min(255,Number.parseInt(K[3],10)));return`#${Q.toString(16).padStart(2,"0")}${ce.toString(16).padStart(2,"0")}${Ve.toString(16).padStart(2,"0")}`}function H(te){if(typeof te!="string")return null;const K=te.trim();return ue(K)||O(K)}function me(te,K,Q){K/=100,Q/=100;const ce=Q+K*Math.min(Q,1-Q),Ve=ce===0?0:2-2*Q/ce;return{h:te,s:Ve*100,v:ce*100}}function ot(te,K,Q){K/=100,Q/=100;const ce=Q*(1-K/2),Ve=ce===0||ce===1?0:(Q-ce)/Math.min(ce,1-ce);return{h:te,s:Ve*100,l:ce*100}}const ne=S,f=ee,be=e.ref(!1),he=e.ref(!1),oe=e.ref(!1),j=e.ref(-1),fe=e.ref(-1),_e=e.ref(null),V=e.ref(null),$e=e.ref(null),lt=e.ref(null),rt=e.ref({top:0,left:0}),Qe=e.ref(L(ne.modelValue||"#b8a5de")),Z=e.computed(()=>Array.isArray(ne.presetGroups)&&ne.presetGroups.length>0),qe=e.computed(()=>!ne.disableCustomColors),ze=e.computed(()=>Z.value?0:ne.initialPresetCount!=null?ne.initialPresetCount:fe.value<0?null:fe.value),ye=e.computed(()=>{const te=ze.value;return te==null?!0:Math.max(0,ne.presetColors.length-te)<ne.max}),Ue=e.computed(()=>!!(he.value||j.value>=0||!ke.value&&ne.presetColors.length===0));e.computed(()=>{const te=ze.value;return te!=null&&ne.presetColors.length>te});const ke=e.computed(()=>Z.value||ze.value!=null),Te=e.computed(()=>{const te=ze.value;return te==null?[]:ne.presetColors.slice(0,te)}),at=e.computed(()=>{const te=ze.value;return te==null?[]:ne.presetColors.slice(te)});function ge(te){const K=ze.value;return K!=null?K+te:-1}function Ft(te){const K=ze.value;return K!=null&&te>=K}function dt(te){Ft(te)&&(j.value=te,Qe.value=L(ne.presetColors[te]),he.value=!0,e.nextTick(()=>lt.value?.focus()))}function Ye(te){if(!Ft(te))return;const K=ne.presetColors.filter((Ve,We)=>We!==te);f("update:presetColors",K);const Q=ue(ne.modelValue),ce=ue(ne.presetColors[te]);if(Q&&ce&&Q.toLowerCase()===ce.toLowerCase()){const Ve=K[Math.max(0,te-1)]||K[0];Ve&&f("update:modelValue",Ve)}}function Pt(){oe.value=!oe.value,oe.value||(j.value=-1,he.value=!1)}function It(){if(!qe.value||j.value<0)return;const te=it.value,K=ue(te);if(K){const Q=[...ne.presetColors];Q[j.value]=K,f("update:presetColors",Q),f("update:modelValue",K),j.value=-1,he.value=!1}}function bt(){ne.disabled||!qe.value||(j.value=-1,he.value=!he.value,he.value&&(A(),e.nextTick(()=>lt.value?.focus())))}function ft(te){const K=H(te),Q=H(ne.modelValue);return K&&Q&&K.toLowerCase()===Q.toLowerCase()}function Yt(){if(ne.disabled||!qe.value||!ye.value)return;const te=it.value,K=ue(te);if(K){const Q=[...ne.presetColors,K];f("update:presetColors",Q),f("update:modelValue",K);const ce=ze.value??fe.value;ce>=0&&Q.length-ce>=ne.max&&(he.value=!1)}}const it=e.computed(()=>{const{h:te,s:K,l:Q}=Qe.value;return N(te,K,Q)}),At=e.computed(()=>it.value.toLowerCase()),ht=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${Qe.value.h}, 100%, 50%))`})),il=e.computed(()=>{const te=me(Qe.value.h,Qe.value.s,Qe.value.l);return{left:`${te.s}%`,bottom:`${te.v}%`,transform:"translate(-50%, 50%)"}}),St=e.computed(()=>({left:`${Qe.value.h/360*100}%`,transform:"translateX(-50%)"})),Dt=e.computed(()=>({position:"fixed",left:`${rt.value.left}px`,top:`${rt.value.top}px`,zIndex:1002}));function pe(){if(!_e.value||!be.value)return;const te=_e.value.getBoundingClientRect(),K=window.innerHeight||document.documentElement.clientHeight;let Q=te.bottom+4;const ce=V.value;ce&&Q+ce.offsetHeight>K-8&&(Q=te.top-4-ce.offsetHeight),rt.value={top:Q,left:te.left}}function A(){const te=ne.modelValue||"#b8a5de",K=H(te);K&&(Qe.value=L(K))}function X(){f("update:modelValue",it.value)}function ae(){ne.disabled||(be.value=!be.value,be.value&&(A(),e.nextTick(()=>{pe(),lt.value?.focus()})))}function Ce(){const te=it.value,K=ue(te);if(K){if(j.value>=0){const Q=[...ne.presetColors];Q[j.value]=K,f("update:presetColors",Q),f("update:modelValue",K)}else if(qe.value&&(ne.presetColors.length>0||Z.value)&&he.value&&ye.value&&!ne.presetColors.some(ce=>ue(ce)?.toLowerCase()===K.toLowerCase())){const ce=[...ne.presetColors,K];f("update:presetColors",ce),f("update:modelValue",K)}}be.value=!1,he.value=!1,oe.value=!1,j.value=-1}function je(te){if(!$e.value)return;const K=$e.value.getBoundingClientRect(),Q=ce=>{const Ve=Math.max(0,Math.min(1,(ce.clientX-K.left)/K.width)),We=Math.max(0,Math.min(1,1-(ce.clientY-K.top)/K.height)),Nt={h:Qe.value.h,s:Ve*100,v:We*100};Qe.value=ot(Nt.h,Nt.s,Nt.v)};Q(te),document.addEventListener("mousemove",Q),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",Q),X()},{once:!0})}function Ge(te){if(!te.currentTarget)return;const Q=te.currentTarget.getBoundingClientRect(),ce=Ve=>{const We=Math.max(0,Math.min(1,(Ve.clientX-Q.left)/Q.width));Qe.value={...Qe.value,h:We*360}};ce(te),document.addEventListener("mousemove",ce),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ce),X()},{once:!0})}function Vt(te){const K=te.target.value,Q=H(K);Q&&(Qe.value=L(Q),f("update:modelValue",Q))}function Pe(te){if(ne.disabled)return;const K=H(te);K&&(Qe.value=L(K),f("update:modelValue",K))}let Ke=null,nt=null;function qt(){Ke&&(document.removeEventListener("keydown",Ke),Ke=null),nt&&(window.removeEventListener("resize",nt),nt=null)}return e.watch(be,te=>{if(qt(),te){if(!Z.value&&ne.initialPresetCount==null){const K=ne.presetColors.length;K>0&&(fe.value<0||K<fe.value)&&(fe.value=K)}Ke=K=>{K.key==="Escape"&&Ce()},nt=pe,document.addEventListener("keydown",Ke),window.addEventListener("resize",nt)}}),e.watch(()=>ne.modelValue,()=>{be.value&&A()},{immediate:!1}),e.watch(at,te=>{te.length===0&&(oe.value=!1,j.value=-1,he.value=!1)}),e.onBeforeUnmount(qt),(te,K)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":S.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:_e,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":be.value}]),onClick:ae},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:it.value})},[...K[0]||(K[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"},[be.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Ce,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:V,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Dt.value)},[ke.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Z.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(S.presetGroups,(Q,ce)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ce,class:"dss-color-picker__section"},[e.createElementVNode("span",R2,e.toDisplayString(Q.title),1),e.createElementVNode("div",F2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.colors,(Ve,We)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ce+"-"+We,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":ft(Ve)}]),style:e.normalizeStyle({backgroundColor:Ve,"--dss-preset-color":Ve}),title:Ve,onClick:e.withModifiers(Nt=>Pe(Ve),["stop"])},null,14,I2))),128))])]))),128)):Te.value.length?(e.openBlock(),e.createElementBlock("div",z2,[K[1]||(K[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",P2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value,(Q,ce)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ce,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":ft(Q)}]),style:e.normalizeStyle({backgroundColor:Q,"--dss-preset-color":Q}),title:Q,onClick:e.withModifiers(Ve=>Pe(Q),["stop"])},null,14,O2))),128))])])):e.createCommentVNode("",!0),qe.value?(e.openBlock(),e.createElementBlock("div",W2,[e.createElementVNode("div",q2,[K[3]||(K[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),at.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":oe.value}]),title:"Manage custom colors",onClick:e.withModifiers(Pt,["stop"])},[...K[2]||(K[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",Z2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value,(Q,ce)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ce,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":oe.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!oe.value&&ft(Q),"dss-color-picker__preset-bubble--editing":oe.value&&j.value===ge(ce)}]),style:e.normalizeStyle({backgroundColor:j.value===ge(ce)?it.value:Q,"--dss-preset-color":j.value===ge(ce)?it.value:Q}),title:j.value===ge(ce)?it.value:Q,onClick:e.withModifiers(Ve=>oe.value?dt(ge(ce)):Pe(Q),["stop"])},null,14,U2),oe.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(Ve=>Ye(ge(ce)),["stop"])},[...K[4]||(K[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,X2)):e.createCommentVNode("",!0)],2))),128)),ye.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":he.value}]),onClick:e.withModifiers(bt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):S.presetColors.length?(e.openBlock(),e.createElementBlock("div",Y2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.presetColors,(Q,ce)=>(e.openBlock(),e.createElementBlock("button",{key:ce,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":ft(Q)}]),style:e.normalizeStyle({backgroundColor:Q,"--dss-preset-color":Q}),title:Q,onClick:e.withModifiers(Ve=>Pe(Q),["stop"])},null,14,j2))),128)),qe.value&&ye.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":he.value}]),onClick:e.withModifiers(bt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ue.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:$e,onMousedown:je},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(ht.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(il.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ge},[K[5]||(K[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(St.value)},null,4)],32),e.createElementVNode("div",K2,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:lt,type:"text",class:"dss-color-picker__hex-input",value:At.value,onInput:Vt},null,40,G2)]),qe.value&&ke.value&&(S.presetColors.length||Z.value)&&ye.value&&j.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Yt}," Save color ")):e.createCommentVNode("",!0),qe.value&&ke.value&&j.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:It}," Save color ")):e.createCommentVNode("",!0),ke.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Ce}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},J2={key:0,class:"dss-loader"},ep={key:0,class:"dss-loader-label"},tp={key:1,class:"dss-loader"},lp={key:0,class:"dss-loader-label"},np={key:2,class:"dss-loader"},op={key:0,class:"dss-loader-label"},ap={key:3,class:"dss-loader"},sp={key:0,class:"dss-loader-label"},rp={key:4,class:"dss-loader"},ip={key:0,class:"dss-loader-label"},cp={key:5,class:"dss-loader dss-loader--inline"},up={class:"dss-loader-inline-text"},dp={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(S){const ee=S,L=e.computed(()=>ee.size==="small"?"dss-loaders--size-small":ee.size==="large"?"dss-loaders--size-large":ee.size==="medium"||ee.size==null?"dss-loaders--size-medium":null),N=e.computed(()=>{const ue={};if(!(ee.size==="small"||ee.size==="medium"||ee.size==="large"||ee.size==null)){const O=typeof ee.size=="number"?`${ee.size}px`:String(ee.size);ue["--dss-loader-size"]=O}return ee.color&&(ue["--dss-loader-accent"]=ee.color,ue["--dss-loader-accent-soft"]=`color-mix(in srgb, ${ee.color} 30%, white)`),ue});return(ue,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",L.value]),style:e.normalizeStyle(N.value)},[S.type==="spinner"?(e.openBlock(),e.createElementBlock("div",J2,[O[0]||(O[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),S.label?(e.openBlock(),e.createElementBlock("span",ep,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)])):S.type==="dots"?(e.openBlock(),e.createElementBlock("div",tp,[O[1]||(O[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)),S.label?(e.openBlock(),e.createElementBlock("span",lp,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)])):S.type==="battery"?(e.openBlock(),e.createElementBlock("div",np,[O[2]||(O[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),S.label?(e.openBlock(),e.createElementBlock("span",op,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)])):S.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",ap,[O[3]||(O[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)),S.label?(e.openBlock(),e.createElementBlock("span",sp,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)])):S.type==="bars"?(e.openBlock(),e.createElementBlock("div",rp,[O[4]||(O[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)),S.label?(e.openBlock(),e.createElementBlock("span",ip,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)])):S.type==="inline"?(e.openBlock(),e.createElementBlock("div",cp,[O[5]||(O[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",up,[e.renderSlot(ue.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(S.label),1)])])])):e.createCommentVNode("",!0)],6))}},La="dss-skeleton-item",mp={__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:S=>["single","multiple"].includes(S)},targetClass:{type:String,default:La},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(S){const ee=S,L=e.computed(()=>{const O={"dss-skeleton--loading":ee.loading,"dss-skeleton--static":!ee.shimmer,"dss-skeleton--multiple":ee.mode==="multiple","dss-skeleton--dark":ee.darkMode};return ee.mode==="multiple"&&ee.targetClass!==La&&(O[`dss-skeleton--target-${ee.targetClass}`]=!0),O}),N=e.computed(()=>{const O={};return ee.borderRadius&&(O.borderRadius=ee.borderRadius),O}),ue=e.computed(()=>{const O={};return ee.borderRadius&&(O["--dss-skeleton-border-radius"]=ee.borderRadius),ee.darkMode?(O["--dss-skeleton-bg"]=ee.bgDark||"#322c3f",O["--dss-skeleton-shimmer"]=ee.shimmerDark||"#3e3f41",O):(ee.bgColor&&(O["--dss-skeleton-bg"]=ee.bgColor),ee.shimmerColor&&(O["--dss-skeleton-shimmer"]=ee.shimmerColor),O)});return(O,H)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",L.value]),style:e.normalizeStyle(ue.value)},[S.loading&&S.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(N.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":S.loading&&S.mode==="single"}])},[e.renderSlot(O.$slots,"default")],2)],6))}},pp={key:0,class:"dss-dnd-column-header"},vp={class:"dss-dnd-column-title"},fp={class:"dss-dnd-column-count"},hp=["data-column"],gp={key:0,class:"dss-dnd-indicator"},yp=["onPointerdown"],kp=["onPointerdown"],Cp={class:"dss-dnd-item-content"},bp={class:"dss-dnd-item-default"},wp={key:0,class:"dss-dnd-empty"},xp={name:"DSSDnd"},Ep=Object.assign(xp,{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(S,{emit:ee}){const L=S,N=ee,ue=e.useSlots(),O=e.computed(()=>!!ue["delete-zone"]),H={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},me=e.computed(()=>({...H,...L.options})),ot=e.computed(()=>({"--dss-dnd-col-min-w":me.value.columnMinWidth,"--dss-dnd-col-max-w":me.value.columnMaxWidth,"--dss-dnd-col-gap":me.value.columnGap,"--dss-dnd-indicator-color":me.value.indicatorColor,"--dss-dnd-body-max-h":me.value.columnBodyMaxHeight}));function ne(pe){if(!me.value.ColColor||!pe)return{};const A=pe.background||pe.color;return A?{background:A}:{}}const f=e.ref(null),be=e.ref(null),he=e.ref(!1),oe=e.ref(-1),j=e.ref(null);let fe=null,_e=null,V=null,$e=null,lt=0,rt=0,Qe="",Z=null;const qe=5,ze=e.computed(()=>{const pe={};for(const A of L.columns)pe[A.value]=L.items.filter(X=>X[L.columnKey]===A.value).sort((X,ae)=>(X[L.positionKey]??0)-(ae[L.positionKey]??0));return pe}),ye=e.computed(()=>{const pe={},A=!!f.value,X=f.value?.[L.itemKey],ae=be.value,Ce=oe.value;for(const je of L.columns){const Ge=ze.value[je.value]||[],Vt=[],Pe=ae==je.value;let Ke=0;for(let nt=0;nt<Ge.length;nt++){const qt=Ge[nt],te=A&&qt[L.itemKey]===X;!te&&Pe&&Ce===Ke&&Vt.push({type:"indicator",key:`ind-${Ke}`}),te||Ke++,Vt.push({type:"item",item:qt,isDragged:te,key:`item-${qt[L.itemKey]}`})}Pe&&Ce>=Ke&&Vt.push({type:"indicator",key:"ind-end"}),pe[je.value]=Vt}return pe});function Ue(pe,A){const ae=(ze.value[pe]||[]).filter(Ge=>Ge[L.itemKey]!==f.value?.[L.itemKey]);if(ae.length===0)return 1;if(A<=0){const Ge=ae[0][L.positionKey];return Ge!=null&&Ge>0?Ge/2:.5}if(A>=ae.length){const Ge=ae[ae.length-1][L.positionKey];return(Ge??0)+1}const Ce=ae[A-1][L.positionKey]??0,je=ae[A][L.positionKey]??0;return(Ce+je)/2}function ke(pe,A,X){V&&V.remove();const ae=pe.getBoundingClientRect(),Ce=pe.cloneNode(!0);Ce.classList.add("dss-dnd-ghost"),Ce.style.cssText=`
|
|
106
106
|
position: fixed;
|
|
107
|
-
left: ${
|
|
108
|
-
top: ${
|
|
109
|
-
width: ${
|
|
110
|
-
height: ${
|
|
107
|
+
left: ${A-lt}px;
|
|
108
|
+
top: ${X-rt}px;
|
|
109
|
+
width: ${ae.width}px;
|
|
110
|
+
height: ${ae.height}px;
|
|
111
111
|
z-index: 9999;
|
|
112
112
|
pointer-events: none;
|
|
113
|
-
opacity: ${
|
|
113
|
+
opacity: ${me.value.dragGhostOpacity};
|
|
114
114
|
box-sizing: border-box;
|
|
115
115
|
box-shadow: 0 8px 24px rgba(0,0,0,0.15);
|
|
116
|
-
background-color: ${
|
|
116
|
+
background-color: ${me.value.dragSourceBackground};
|
|
117
117
|
font-family: 'Work Sans', sans-serif;
|
|
118
118
|
cursor: grabbing;
|
|
119
|
-
`,document.body.appendChild(Ue),me=Ue}function Ge(W,G){me&&(me.style.left=`${W-Je}px`,me.style.top=`${G-pt}px`)}function be(W){W.classList.add("dss-dnd-item--dragging"),W.style.background=he.value.dragSourceBackground,W.style.borderColor=he.value.dragSourceBorder,W.style.transform="scale(0.97)"}function Qe(W){W.classList.remove("dss-dnd-item--dragging"),W.style.background="",W.style.borderColor="",W.style.transform=""}function ct(W,G){return document.elementFromPoint(W,G)?.closest(".dss-dnd-column-body")??null}function gt(W,G){return!!document.elementFromPoint(W,G)?.closest("[data-dss-dnd-delete-zone]")}function ut(W,G){if(P.value&>(W,G)){Ce.value=!0,we.value=null,J.value=-1;return}Ce.value=!1;const Ne=ct(W,G),Ie=Ne?.getAttribute("data-column")??null;if(!Ie){we.value=null,J.value=-1;return}we.value=Ie;const Ue=Ne.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Et=Ue.length;for(let Ke=0;Ke<Ue.length;Ke++){const Ut=Ue[Ke].getBoundingClientRect();if(G<Ut.top+Ut.height/2){Et=Ke;break}}J.value=Et}function qt(W){W.preventDefault(),Ge(W.clientX,W.clientY),!fe&&(fe=requestAnimationFrame(()=>{fe=null,ut(W.clientX,W.clientY)}))}function Zt(W){window.removeEventListener("pointermove",qt),window.removeEventListener("pointerup",Zt),window.removeEventListener("pointercancel",Zt),_e?.releasePointerCapture?.(W.pointerId),Qe(_e),_e=null;const G=P.value&>(W.clientX,W.clientY);if(f.value&&G)B("delete",{item:f.value});else{const Ie=ct(W.clientX,W.clientY)?.getAttribute("data-column")??null;if(f.value&&Ie){const Ue=f.value[_.columnKey],Et=Ie,Ut=(Se.value[Et]||[]).filter($t=>$t[_.itemKey]!==f.value[_.itemKey]),qe=Math.max(0,Math.min(J.value,Ut.length)),Pe=Ye(Et,qe),Ht=f.value[_.itemKey];B("move",{item:f.value,from:Ue,to:Et,position:Pe,index:qe}),R&&clearTimeout(R),X.value={id:Ht,from:Ue,to:Et},R=setTimeout(()=>{X.value=null},3500)}}me&&(me.remove(),me=null),Z!==null&&(document.body.style.cursor=Z,Z=""),ke()}function kt(W,G){W.preventDefault();const Ne=W.target.closest(".dss-dnd-item");if(!Ne)return;const Ie=Ne.getBoundingClientRect();Je=W.clientX-Ie.left,pt=W.clientY-Ie.top,Z=document.body.style.cursor,document.body.style.cursor="grabbing",f.value=G,_e=Ne,ie(Ne,W.clientX,W.clientY),requestAnimationFrame(()=>be(Ne)),Ne.setPointerCapture?.(W.pointerId),window.addEventListener("pointermove",qt),window.addEventListener("pointerup",Zt,{once:!0}),window.addEventListener("pointercancel",Zt,{once:!0})}function xt(){Fe&&(window.removeEventListener("pointermove",Yt),window.removeEventListener("pointerup",rt),window.removeEventListener("pointercancel",rt),Fe=null)}function Yt(W){if(!Fe||W.pointerId!==Fe.pointerId)return;const G=W.clientX-Fe.startX,Ne=W.clientY-Fe.startY;if(Math.abs(G)>=We||Math.abs(Ne)>=We){const Ie=Fe.item;xt(),kt(W,Ie)}}function rt(W){!Fe||W.pointerId!==Fe.pointerId||xt()}function Jt(W,G){xt(),Fe={item:G,startX:W.clientX,startY:W.clientY,pointerId:W.pointerId},window.addEventListener("pointermove",Yt),window.addEventListener("pointerup",rt),window.addEventListener("pointercancel",rt)}function yt(W,G){he.value.useHandle||Jt(W,G)}function ol(W,G){Jt(W,G)}function U(){fe&&(cancelAnimationFrame(fe),fe=null)}function ke(){U(),f.value=null,we.value=null,Ce.value=!1,J.value=-1}return e.onBeforeUnmount(()=>{U(),xt(),R&&clearTimeout(R),me&&(me.remove(),me=null)}),(W,G)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":he.value.unstyled}]),style:e.normalizeStyle(st.value)},[P.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(W.$slots,"delete-zone",{isDragging:!!f.value,isOver:Ce.value})],2),[[e.vShow,!!f.value||he.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.columns,Ne=>(e.openBlock(),e.createElementBlock("div",{key:Ne.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":we.value==Ne.value},Ne.class||""]]),style:e.normalizeStyle(te(Ne))},[he.value.showHeader?(e.openBlock(),e.createElementBlock("div",Q2,[e.renderSlot(W.$slots,"column-header",{column:Ne,items:Se.value[Ne.value]||[]},()=>[e.createElementVNode("span",J2,e.toDisplayString(Ne.title||Ne.value),1),e.createElementVNode("span",e0,e.toDisplayString((Se.value[Ne.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Ne.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value[Ne.value],Ie=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Ie.key},[Ie.type==="indicator"?(e.openBlock(),e.createElementBlock("div",l0)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Ie.isDragged,"dss-dnd-item--no-handle":!he.value.useHandle}]),onPointerdown:Ue=>yt(Ue,Ie.item)},[he.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Ue=>ol(Ue,Ie.item),["stop"])},[e.renderSlot(W.$slots,"handle",{},()=>[G[0]||(G[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,o0)):e.createCommentVNode("",!0),e.createElementVNode("div",a0,[e.renderSlot(W.$slots,"item",{item:Ie.item,column:Ne,justDropped:X.value?.id===Ie.item[E.itemKey],droppedFrom:X.value?.id===Ie.item[E.itemKey]?X.value.from:null,droppedTo:X.value?.id===Ie.item[E.itemKey]?X.value.to:null},()=>[e.createElementVNode("div",s0,e.toDisplayString(Ie.item[E.itemKey]),1)])])],42,n0))],64))),128)),(Se.value[Ne.value]||[]).length===0&&we.value!=Ne.value?(e.openBlock(),e.createElementBlock("div",r0,[e.renderSlot(W.$slots,"empty",{column:Ne},()=>[G[1]||(G[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,t0)],6))),128))],6))}}),u0={name:"DSSConfetti"},d0=Object.assign(u0,{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(E){const le=E,_=e.ref(null),B=e.ref(!1);let de=[],P=null,T=null;function he(J,X){const fe=[];for(let R=0;R<le.count;R++)fe.push(st(J));return fe}function st(J,X){return{x:Math.random()*J,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:le.colors[Math.floor(Math.random()*le.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 te(J,X,fe,R){J.clearRect(0,0,X,fe);for(const me of de)J.save(),J.globalAlpha=me.opacity*R,J.beginPath(),J.lineWidth=me.r,J.strokeStyle=me.color,J.moveTo(me.x+me.tilt+me.r/2,me.y),J.lineTo(me.x+me.tilt,me.y+me.tilt+me.r/2),J.stroke(),J.restore()}function f(J,X,fe){const R=.3+fe*.7;for(let me=0;me<de.length;me++){const _e=de[me];_e.tiltAngle+=_e.tiltInc,_e.y+=_e.speed*R,_e.x+=Math.sin(_e.d)*.5*R,_e.tilt=Math.sin(_e.tiltAngle)*15,fe>=.99&&_e.y>X+20&&(de[me]=st(J))}}function we(){B.value=!0,e.nextTick(()=>{const J=_.value;if(!J)return;const X=J.getContext("2d"),fe=J.parentElement;if(!fe)return;const R=fe.getBoundingClientRect();J.width=R.width,J.height=R.height,de=he(J.width,J.height);const me=Date.now(),_e=me+le.duration,Je=()=>{const pt=Date.now(),Z=pt-me;if(pt<_e){let Fe=1;Z>le.fadeStart&&(Fe=1-(Z-le.fadeStart)/(le.duration-le.fadeStart)),te(X,J.width,J.height,Fe),f(J.width,J.height,Fe),P=requestAnimationFrame(Je)}else Ce()};Je()})}function Ce(){P&&(cancelAnimationFrame(P),P=null),de=[],B.value=!1}return e.watch(()=>le.trigger,J=>{J&&(T&&clearTimeout(T),T=setTimeout(we,le.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{Ce(),T&&clearTimeout(T)}),(J,X)=>B.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:_,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),m0={class:"dss-filter-global-inner"},p0=["placeholder","value"],v0=["title"],f0={key:0,class:"dss-filter-funnel-badge"},h0={key:1,class:"dss-filter-sortby"},g0=["value"],y0=["value"],k0=["disabled","title"],C0={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"},b0={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"},w0={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"},x0={class:"dss-filter-panel"},E0={key:0,class:"dss-filter-empty"},S0={class:"dss-filter-row-prefix"},V0={class:"dss-filter-cell"},N0=["onClick"],B0={class:"dss-filter-trigger-text"},M0=["placeholder"],_0={class:"dss-filter-popup-list"},$0=["onClick"],L0={key:0,class:"dss-filter-popup-empty"},T0={key:0,class:"dss-filter-cell"},A0=["onClick"],D0={class:"dss-filter-trigger-text"},H0={class:"dss-filter-popup-list"},R0=["onClick"],F0={key:1,class:"dss-filter-cell dss-filter-cell--value"},I0=["placeholder","onUpdate:modelValue"],z0={key:1,class:"dss-filter-date-wrap"},P0=["placeholder","onUpdate:modelValue"],O0=["placeholder","value","onInput","step"],W0={key:4,class:"dss-filter-between"},q0=["placeholder","value","onInput","step"],Z0={class:"dss-filter-between-sep"},U0=["placeholder","value","onInput","step"],X0={key:5,class:"dss-filter-multiselect"},Y0=["onClick"],j0={class:"dss-filter-trigger-text"},K0=["placeholder"],G0={class:"dss-filter-popup-list dss-filter-popup-list--check"},Q0=["onClick"],J0=["checked"],ep={key:0,class:"dss-filter-popup-empty"},tp=["onClick"],lp={class:"dss-filter-foot"},np={class:"dss-filter-cell"},op=["placeholder"],ap={class:"dss-filter-popup-list"},sp=["onClick"],rp={key:0,class:"dss-filter-popup-divider"},ip=["onClick"],cp=["placeholder"],up={class:"dss-filter-popup-list"},dp=["onClick"],mp={key:0,class:"dss-filter-popup-empty"},pp=["placeholder"],vp={class:"dss-filter-popup-list"},fp=["onClick"],hp={key:0,class:"dss-filter-popup-empty"},gp={name:"DSSFilter"},yp=Object.assign(gp,{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(E,{expose:le,emit:_}){const{t:B}=so.useI18n(),de=E,P=_,T={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},he=e.computed(()=>({...T,...de.options})),st={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"}]},te=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([]),J=e.ref(null),X=e.ref(!1),fe=e.ref(null),R=e.ref(""),me=e.ref(null),_e=e.ref(""),Je=e.ref("asc");let pt=1;function Z(M){const w=M.find(A=>A&&typeof A=="object");if(!w)return null;for(const A of f)if(A in w&&typeof w[A]=="string")return A;return Object.keys(w).find(A=>typeof w[A]=="string")||null}function Fe(M,w){const A=w.filter(se=>se!=null&&se!=="NULL");if(A.length===0)return null;if(A.every(se=>Array.isArray(se))){const se=A.flatMap(He=>He).filter(He=>He!=null);return se.length===0?null:typeof se.find(He=>He!=null)=="object"?"arraySelect":"arrayText"}return A.every(se=>typeof se=="boolean")?"boolean":A.every(se=>typeof se=="number")?new Set(A).size<=he.value.maxUniqueForEnum?"select":"range":A.every(se=>typeof se=="string")?new Set(A).size<=he.value.maxUniqueForSelect?"select":"text":A.some(se=>typeof se=="object"&&!Array.isArray(se))?null:"text"}const We=e.computed(()=>{if(!de.data?.length)return[];const M=new Set;for(const ae of de.data)if(ae&&typeof ae=="object")for(const He of Object.keys(ae))M.add(He);const w=new Set(de.exclude),A=[];for(const ae of M){if(w.has(ae))continue;const He=de.config[ae]||{},Ct=de.data.map(St=>St?.[ae]),nt=He.type||Fe(ae,Ct);if(!nt)continue;const Re=He.filterMode||"contain",bt=Re==="date"?"date":Re==="string"?"text":nt,_t={key:ae,label:He.label||et(ae),type:bt,filterMode:Re};if(nt==="select"){const St=Ct.filter(Lt=>Lt!=null&&Lt!=="NULL");_t.uniqueValues=[...new Set(St)].sort((Lt,zt)=>typeof Lt=="number"&&typeof zt=="number"?Lt-zt:String(Lt).localeCompare(String(zt)))}else if(nt==="range"||nt==="int"){const St=Ct.filter(Lt=>typeof Lt=="number");_t.min=Math.min(...St),_t.max=Math.max(...St)}else if(nt==="arraySelect"){const St=He.displayKey||Z(Ct.flatMap(Lt=>Array.isArray(Lt)?Lt:[]));if(_t.displayKey=St,Array.isArray(He.uniqueValues)&&He.uniqueValues.length>0)_t.uniqueValues=He.uniqueValues.map(Lt=>String(Lt));else{const Lt=Ct.flatMap(zt=>Array.isArray(zt)?zt:[]).filter(zt=>zt!=null).map(zt=>St&&typeof zt=="object"?zt[St]:String(zt)).filter(zt=>zt!=null&&zt!=="");_t.uniqueValues=[...new Set(Lt)].sort((zt,Bt)=>String(zt).localeCompare(String(Bt)))}}A.push(_t)}const se=de.config._order;return se&&A.sort((ae,He)=>{const Ct=se.indexOf(ae.key),nt=se.indexOf(He.key);return Ct===-1&&nt===-1?0:Ct===-1?1:nt===-1?-1:Ct-nt}),A}),Se=e.computed(()=>{const M={};for(const w of We.value)M[w.key]=w;return M}),Le=e.computed(()=>Array.isArray(de.config.groups)&&de.config.groups.length>0),Ye=e.computed(()=>{if(!Le.value)return[];const M=new Set(We.value.map(w=>w.key));return de.config.groups.map(w=>({...w,keys:w.keys.filter(A=>M.has(A))})).filter(w=>w.keys.length>0)}),ie=e.computed(()=>{if(!Le.value)return[];const M=new Set(de.config.groups.flatMap(w=>w.keys));return We.value.filter(w=>!M.has(w.key))}),Ge=e.computed(()=>{if(!me.value)return[];const M=new Set(me.value.keys),w=We.value.filter(se=>M.has(se.key));if(!R.value)return w;const A=R.value.toLowerCase();return w.filter(se=>se.label.toLowerCase().includes(A))}),be=e.computed(()=>{if(!R.value)return We.value;const M=R.value.toLowerCase();return We.value.filter(w=>w.label.toLowerCase().includes(M))}),Qe=e.computed(()=>We.value.filter(M=>!["arraySelect","arrayText"].includes(M.type))),ct=e.computed(()=>_e.value?Je.value==="asc"?"Ascending":"Descending":"No sort selected");function gt(M){J.value===M?ut():(J.value=M,R.value="",me.value=null)}function ut(){J.value=null,R.value="",me.value=null}function qt(M){const w=M.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");J.value&&!w&&!M.target.closest(".dss-filter-popup")&&!M.target.closest(".dss-filter-trigger")&&!M.target.closest(".dss-filter-add-btn")&&ut(),X.value&&fe.value&&!fe.value.contains(M.target)&&(w||(X.value=!1))}e.onMounted(()=>document.addEventListener("click",qt)),e.onBeforeUnmount(()=>document.removeEventListener("click",qt));function Zt(M){return Se.value[M]?.label||et(M)}function kt(M){return Se.value[M.key]?.filterMode||"contain"}function xt(M){return B(`filter.operators.${M}`)}function Yt(M){const w=Se.value[M.key];return(st[w?.type]||st.text).map(A=>({...A,label:B(`filter.operators.${A.value}`)}))}function rt(M){return te.has(M)}function Jt(M){const w=Se.value[M.key];return w?w.type==="date"?"date":w.type==="boolean"?"boolean":w.type==="text"||w.type==="arrayText"?"text":w.type==="select"||w.type==="arraySelect"?"multiselect":w.type==="range"||w.type==="int"?M.operator==="between"?"between":"number":"text":"text"}function yt(M){return st[M]?.[0]?.value||"contains"}function ol(M,w){return te.has(w)||M==="date"?null:M==="select"||M==="arraySelect"?[]:(M==="range"||M==="int")&&w==="between"?{min:null,max:null}:M==="range"||M==="int"?null:""}function U(M){return Se.value[M.key]?.uniqueValues||[]}function ke(M){const w=U(M);if(!R.value)return w;const A=R.value.toLowerCase();return w.filter(se=>String(se).toLowerCase().includes(A))}function W(M){const w=M.value;return!w||w.length===0?B("filter.select"):w.length<=2?w.join(", "):B("filter.selectedCount",{count:w.length})}function G(M){const w=Se.value[M],A=w?.filterMode||"contain",se=w?.type||"text",ae=A==="string"?"contains":yt(se);Ce.value.push(e.reactive({id:pt++,key:M,operator:ae,value:ol(se,ae)})),ut()}function Ne(M){Ce.value=Ce.value.filter(w=>w.id!==M)}function Ie(M,w){const se=Se.value[w]?.type||"text";M.key=w,M.operator=yt(se),M.value=ol(se,M.operator),ut()}function Ue(M,w){const A=Jt(M);M.operator=w;const se=Jt(M);if(A!==se||te.has(w)){const ae=Se.value[M.key];M.value=ol(ae?.type||"text",w)}ut()}function Et(M,w){const A=w.target.value;M.value=A===""?null:Number(A)}function Ke(M,w,A){const se=A.target.value,ae=se===""?null:Number(se);(!M.value||typeof M.value!="object")&&(M.value={min:null,max:null}),M.value={...M.value,[w]:isNaN(ae)?null:ae}}function Ut(M,w){const A=M.value||[],se=A.indexOf(w);M.value=se>=0?A.filter(ae=>ae!==w):[...A,w]}function qe(){Ce.value=[],we.value="",ut()}function Pe(M){we.value=M.target.value}function Ht(M){_e.value=M.target.value}function $t(){Je.value=Je.value==="asc"?"desc":"asc"}const oe=e.computed(()=>{if(!de.data)return[];let M=de.data;if(we.value){const w=we.value.toLowerCase();M=M.filter(A=>{for(const se of Object.keys(A)){const ae=A[se];if(typeof ae=="string"&&ae.toLowerCase().includes(w)||typeof ae=="number"&&String(ae).includes(w)||Array.isArray(ae)&&ae.some(He=>He!=null&&(typeof He=="string"?He.toLowerCase().includes(w):typeof He=="object"?Object.values(He).some(Ct=>typeof Ct=="string"&&Ct.toLowerCase().includes(w)):!1)))return!0}return!1})}for(const w of Ce.value){if(!pe(w))continue;const A=Se.value[w.key];A&&(M=M.filter(se=>xe(se,w,A)))}if(de.showSortBy&&_e.value){const w=_e.value,A=Je.value==="asc"?1:-1;M=[...M].sort((se,ae)=>Y(se?.[w],ae?.[w])*A)}return M});function Y(M,w){const A=j(M),se=j(w);return A==null&&se==null?0:A==null?1:se==null?-1:typeof A=="number"&&typeof se=="number"?A-se:String(A).localeCompare(String(se),void 0,{numeric:!0,sensitivity:"base"})}function j(M){return M==null||M==="NULL"?null:typeof M=="string"||typeof M=="number"||typeof M=="boolean"?M:M instanceof Date?M.getTime():null}function pe(M){return te.has(M.operator)?!0:M.value==null||typeof M.value=="string"&&M.value===""||Array.isArray(M.value)&&M.value.length===0?!1:M.value instanceof Date?!isNaN(M.value.getTime()):!(typeof M.value=="object"&&!Array.isArray(M.value)&&M.value.min==null&&M.value.max==null)}function xe(M,w,A){const se=M?.[w.key],ae=w.value,He=w.operator;if(He==="is_empty")return jt(se);if(He==="is_not_empty")return!jt(se);const Ct=A.type;if(Ct==="text"||Ct==="arrayText"){const nt=Ct==="arrayText"&&Array.isArray(se)?se.filter(_t=>_t!=null).map(String).join(" "):se!=null?String(se):"",Re=String(ae).toLowerCase(),bt=nt.toLowerCase();switch(He){case"contains":return bt.includes(Re);case"not_contains":return!bt.includes(Re);case"equals":return bt===Re;case"not_equals":return bt!==Re;case"starts_with":return bt.startsWith(Re);case"ends_with":return bt.endsWith(Re);default:return!0}}if(Ct==="select")switch(He){case"is_any_of":return ae.includes(se);case"is_none_of":return!ae.includes(se);default:return!0}if(Ct==="range"||Ct==="int"){const nt=typeof se=="number"?se:Number(se);if(typeof nt!="number"||isNaN(nt))return!1;if(He==="between"){const bt=ae?.min!=null?Number(ae.min):null,_t=ae?.max!=null?Number(ae.max):null,St=bt!=null&&!isNaN(bt)?bt:null,Lt=_t!=null&&!isNaN(_t)?_t:null;return(St==null||nt>=St)&&(Lt==null||nt<=Lt)}const Re=typeof ae=="number"&&!isNaN(ae)?ae:Number(ae);if(He==="contains"||He==="not_contains"){const bt=String(nt),_t=String(ae??"").toLowerCase(),St=bt.toLowerCase().includes(_t);return He==="contains"?St:!St}if(typeof Re!="number"||isNaN(Re))return!1;switch(He){case"eq":return nt===Re;case"neq":return nt!==Re;case"gt":return nt>Re;case"gte":return nt>=Re;case"lt":return nt<Re;case"lte":return nt<=Re;default:return!0}}if(Ct==="arraySelect"){if(!Array.isArray(se))return!1;const nt=se.filter(Re=>Re!=null).map(Re=>A.displayKey&&typeof Re=="object"?Re[A.displayKey]:String(Re));switch(He){case"contains_any":return nt.some(Re=>ae.includes(Re));case"contains_all":return ae.every(Re=>nt.includes(Re));case"not_contains_any":return!nt.some(Re=>ae.includes(Re));default:return!0}}if(Ct==="date"){const nt=je(ae);if(!nt||isNaN(nt.getTime()))return!1;const Re=je(se);if(!Re||isNaN(Re.getTime()))return!1;const bt=Rt(Re),_t=Rt(nt);switch(He){case"eq":return bt===_t;case"before":return bt<_t;case"after":return bt>_t;default:return!0}}if(Ct==="boolean"){const nt=se===!0||se==="true"||se===1,Re=se===!1||se==="false"||se===0;switch(He){case"is_true":return nt;case"is_false":return Re;default:return!0}}return!0}function je(M){if(M==null)return null;if(M instanceof Date)return isNaN(M.getTime())?null:M;if(typeof M=="number")return new Date(M>1e10?M:M*1e3);if(typeof M=="string"){const w=new Date(M);return isNaN(w.getTime())?null:w}return null}function Rt(M){const w=M.getFullYear(),A=String(M.getMonth()+1).padStart(2,"0"),se=String(M.getDate()).padStart(2,"0");return`${w}-${A}-${se}`}function jt(M){return!!(M==null||M===""||M==="NULL"||Array.isArray(M)&&M.length===0||Array.isArray(M)&&M.every(w=>w==null))}e.watch(oe,M=>P("update:modelValue",M),{immediate:!0}),e.watch(()=>de.data,()=>{Ce.value=[],we.value="",X.value=!1,_e.value="",Je.value="asc",ut()});function et(M){return M.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,w=>w.toUpperCase())}function pl(){const M=w=>{if(w==null)return w;if(w instanceof Date)return{_type:"Date",value:w.toISOString(),local:w.toLocaleDateString()};if(Array.isArray(w))return w.map(M);if(typeof w=="object"&&!Array.isArray(w)){const A={};for(const se of Object.keys(w))A[se]=M(w[se]);return A}return w};return{globalSearch:we.value,rows:Ce.value.map(w=>({key:w.key,operator:w.operator,value:M(w.value),defType:Se.value[w.key]?.type,defFilterMode:Se.value[w.key]?.filterMode})),filteredCount:oe.value?.length??0}}return le({getDebugState:pl}),(M,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":he.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:fe},[e.createElementVNode("div",m0,[w[20]||(w[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(B)("filter.searchAcrossFields"),value:we.value,onInput:Pe},null,40,p0),we.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:w[0]||(w[0]=A=>we.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:X.value||Ce.value.length>0,"dss-filter-funnel-btn--with-sort":de.showSortBy}]),onClick:w[1]||(w[1]=A=>X.value=!X.value),type:"button",title:X.value?e.unref(B)("filter.closeAdvancedFilter"):e.unref(B)("filter.openAdvancedFilter")},[w[14]||(w[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",f0,e.toDisplayString(Ce.value.length),1)):e.createCommentVNode("",!0)],10,v0),de.showSortBy?(e.openBlock(),e.createElementBlock("div",h0,[w[19]||(w[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:_e.value,onChange:Ht},[w[15]||(w[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe.value,A=>(e.openBlock(),e.createElementBlock("option",{key:A.key,value:A.key},e.toDisplayString(A.label),9,y0))),128))],40,g0),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:$t,disabled:!_e.value,title:ct.value},[_e.value?Je.value==="asc"?(e.openBlock(),e.createElementBlock("svg",b0,[...w[17]||(w[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",w0,[...w[18]||(w[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",C0,[...w[16]||(w[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,k0)])):e.createCommentVNode("",!0)]),X.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:w[13]||(w[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",x0,[Ce.value.length===0?(e.openBlock(),e.createElementBlock("div",E0,e.toDisplayString(e.unref(B)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(A,se)=>(e.openBlock(),e.createElementBlock("div",{key:A.id,class:"dss-filter-row"},[e.createElementVNode("span",S0,e.toDisplayString(se===0?e.unref(B)("filter.where"):e.unref(B)("filter.and")),1),e.createElementVNode("div",V0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ae=>gt(`${A.id}:field`),["stop"])},[e.createElementVNode("span",B0,e.toDisplayString(Zt(A.key)),1),w[21]||(w[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,N0),J.value===`${A.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[3]||(w[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[2]||(w[2]=ae=>R.value=ae),placeholder:e.unref(B)("filter.searchAttributes")},null,8,M0),[[e.vModelText,R.value]]),e.createElementVNode("ul",_0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.value,ae=>(e.openBlock(),e.createElementBlock("li",{key:ae.key,class:"dss-filter-popup-item",onClick:He=>Ie(A,ae.key)},e.toDisplayString(ae.label),9,$0))),128)),be.value.length===0?(e.openBlock(),e.createElementBlock("li",L0,e.toDisplayString(e.unref(B)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),kt(A)==="contain"||kt(A)==="date"?(e.openBlock(),e.createElementBlock("div",T0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ae=>gt(`${A.id}:op`),["stop"])},[e.createElementVNode("span",D0,e.toDisplayString(xt(A.operator)),1),w[22]||(w[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,A0),J.value===`${A.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[4]||(w[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",H0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt(A),ae=>(e.openBlock(),e.createElementBlock("li",{key:ae.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:A.operator===ae.value}]),onClick:He=>Ue(A,ae.value)},e.toDisplayString(ae.label),11,R0))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),rt(A.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",F0,[kt(A)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(B)("filter.enterValue"),"onUpdate:modelValue":ae=>A.value=ae},null,8,I0)),[[e.vModelText,A.value]]):kt(A)==="date"?(e.openBlock(),e.createElementBlock("div",z0,[e.createVNode(ca,{mode:"single",modelValue:A.value,"onUpdate:modelValue":ae=>A.value=ae},null,8,["modelValue","onUpdate:modelValue"])])):Jt(A)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(B)("filter.enterValue"),"onUpdate:modelValue":ae=>A.value=ae},null,8,P0)),[[e.vModelText,A.value]]):Jt(A)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(B)("filter.enterValue"),value:A.value,onInput:ae=>Et(A,ae),step:Se.value[A.key]?.type==="int"?1:void 0},null,40,O0)):Jt(A)==="between"?(e.openBlock(),e.createElementBlock("div",W0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(B)("filter.min"),value:A.value?.min,onInput:ae=>Ke(A,"min",ae),step:Se.value[A.key]?.type==="int"?1:void 0},null,40,q0),e.createElementVNode("span",Z0,e.toDisplayString(e.unref(B)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(B)("filter.max"),value:A.value?.max,onInput:ae=>Ke(A,"max",ae),step:Se.value[A.key]?.type==="int"?1:void 0},null,40,U0)])):Jt(A)==="multiselect"?(e.openBlock(),e.createElementBlock("div",X0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ae=>gt(`${A.id}:val`),["stop"])},[e.createElementVNode("span",j0,e.toDisplayString(W(A)),1),w[23]||(w[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,Y0),J.value===`${A.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[6]||(w[6]=e.withModifiers(()=>{},["stop"]))},[U(A).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[5]||(w[5]=ae=>R.value=ae),placeholder:e.unref(B)("filter.search")},null,8,K0)),[[e.vModelText,R.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",G0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke(A),ae=>(e.openBlock(),e.createElementBlock("li",{key:ae,class:"dss-filter-popup-item",onClick:He=>Ut(A,ae)},[e.createElementVNode("input",{type:"checkbox",checked:(A.value||[]).includes(ae),tabindex:"-1"},null,8,J0),e.createElementVNode("span",null,e.toDisplayString(ae),1)],8,Q0))),128)),ke(A).length===0?(e.openBlock(),e.createElementBlock("li",ep,e.toDisplayString(e.unref(B)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:ae=>Ne(A.id)},[...w[24]||(w[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,tp)]))),128)),e.createElementVNode("div",lp,[e.createElementVNode("div",np,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:w[7]||(w[7]=e.withModifiers(A=>gt("add"),["stop"]))},e.toDisplayString(e.unref(B)("filter.addFilter")),1),J.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:w[12]||(w[12]=e.withModifiers(()=>{},["stop"]))},[Le.value&&!me.value&&!R.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[8]||(w[8]=A=>R.value=A),placeholder:e.unref(B)("filter.searchAttributes")},null,8,op),[[e.vModelText,R.value]]),e.createElementVNode("ul",ap,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:se=>me.value=A},[e.createElementVNode("span",null,e.toDisplayString(A.label),1),w[25]||(w[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,sp))),128)),ie.value.length>0?(e.openBlock(),e.createElementBlock("li",rp)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ie.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.key,class:"dss-filter-popup-item",onClick:se=>G(A.key)},e.toDisplayString(A.label),9,ip))),128))])],64)):me.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:w[9]||(w[9]=A=>me.value=null)},[w[26]||(w[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(me.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[10]||(w[10]=A=>R.value=A),placeholder:e.unref(B)("filter.searchAttributes")},null,8,cp),[[e.vModelText,R.value]]),e.createElementVNode("ul",up,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.key,class:"dss-filter-popup-item",onClick:se=>G(A.key)},e.toDisplayString(A.label),9,dp))),128)),Ge.value.length===0?(e.openBlock(),e.createElementBlock("li",mp,e.toDisplayString(e.unref(B)("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":w[11]||(w[11]=A=>R.value=A),placeholder:e.unref(B)("filter.searchAttributes")},null,8,pp),[[e.vModelText,R.value]]),e.createElementVNode("ul",vp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.key,class:"dss-filter-popup-item",onClick:se=>G(A.key)},e.toDisplayString(A.label),9,fp))),128)),be.value.length===0?(e.openBlock(),e.createElementBlock("li",hp,e.toDisplayString(e.unref(B)("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:qe},e.toDisplayString(e.unref(B)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),kp={class:"dss-pill-field__pills"},Cp=["data-value"],bp=["disabled"],wp={class:"dss-pill-field__pill-text"},xp={key:0,class:"dss-pill-field__pill-actions"},Ep=["onClick"],Sp=["onClick"],Vp=["placeholder","disabled"],Np=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(E,{emit:le}){const _=E,B=le,de=e.ref(""),P=e.ref([..._.modelValue]),T=e.ref(null);let he=null;const st=e.ref(null),te=e.ref(""),f=e.ref(null),we=e.ref(null),Ce=e.computed(()=>{if(!we.value)return;const{width:Le,height:Ye}=we.value;return{minWidth:`${Le}px`,height:`${Ye}px`}});function J(Le,Ye){st.value===Ye&&(f.value=Le)}function X(){st.value=null,te.value="",we.value=null,f.value=null}const fe=e.computed(()=>new Set(P.value.map(Le=>Le.trim()).filter(Boolean)));function R(Le){T.value=Le,he&&clearTimeout(he),he=setTimeout(()=>{T.value=null,he=null},900)}function me(Le){const Ye=Le.trim();return Ye?fe.value.has(Ye)?(R(Ye),!1):(P.value=[...P.value,Ye],B("update:modelValue",[...P.value]),!0):!1}function _e(Le){const Ye=Le.split(/\r?\n/g).map(Qe=>Qe.trim()).filter(Boolean);if(!Ye.length)return;const ie=new Set(P.value.map(Qe=>Qe.trim()).filter(Boolean)),Ge=[...P.value];let be=null;for(const Qe of Ye){if(ie.has(Qe)){be??=Qe;continue}ie.add(Qe),Ge.push(Qe)}Ge.length!==P.value.length&&(P.value=Ge,B("update:modelValue",[...P.value])),be&&R(be)}function Je(Le){_.disabled||(st.value===Le&&X(),P.value=P.value.filter((Ye,ie)=>ie!==Le),B("update:modelValue",[...P.value]))}async function pt(Le,Ye){if(_.disabled)return;const ie=Ye.currentTarget.closest(".dss-pill-field__pill");ie&&(we.value={width:ie.offsetWidth,height:ie.offsetHeight}),st.value=Le,te.value=P.value[Le]??"",await e.nextTick();const Ge=f.value;if(!Ge)return;Ge.focus();const be=Ge.value.length;Ge.setSelectionRange(be,be)}function Z(){X()}function Fe(){if(_.disabled||st.value===null)return;const Le=st.value,Ye=P.value[Le]??"",ie=te.value.trim();if(X(),ie!==Ye&&fe.value.has(ie)){R(ie);return}if(!ie){P.value=P.value.filter((be,Qe)=>Qe!==Le),B("update:modelValue",[...P.value]);return}const Ge=P.value.map((be,Qe)=>Qe===Le?ie:be);P.value=Ge,B("update:modelValue",[...P.value])}function We(Le){Le.preventDefault(),!_.disabled&&(me(de.value),de.value="")}function Se(Le){if(_.disabled)return;const Ye=Le.clipboardData?.getData("text")??"";!Ye.includes(`
|
|
120
|
-
`)&&!Ye.includes("\r")||(Le.preventDefault(),_e(Ye),de.value="")}return e.watch(()=>_.modelValue,Le=>{P.value=Array.isArray(Le)?[...Le]:[]},{deep:!0}),e.onBeforeUnmount(()=>{he&&clearTimeout(he)}),(Le,Ye)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":Le.disabled}])},[e.createElementVNode("div",kp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(ie,Ge)=>(e.openBlock(),e.createElementBlock("span",{key:ie,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":T.value===ie,"dss-pill-field__pill--editing":st.value===Ge}]),style:e.normalizeStyle(st.value===Ge&&we.value?Ce.value:void 0)},[st.value===Ge?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-pill-field__pill-edit-wrap","data-value":te.value||" "},[e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:be=>J(be,Ge),"onUpdate:modelValue":Ye[0]||(Ye[0]=be=>te.value=be),class:"dss-pill-field__pill-edit",type:"text",disabled:Le.disabled,onKeydown:[e.withKeys(Fe,["enter"]),e.withKeys(Z,["esc"])],onBlur:Fe},null,40,bp),[[e.vModelText,te.value]])],8,Cp)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",wp,e.toDisplayString(ie),1),Le.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",xp,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:be=>pt(Ge,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,Ep),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:be=>Je(Ge)}," × ",8,Sp)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Ye[1]||(Ye[1]=ie=>de.value=ie),class:"dss-pill-field__input",type:"text",placeholder:P.value.length?"":Le.placeholder,disabled:Le.disabled,onPaste:Se,onKeydown:e.withKeys(We,["enter"])},null,40,Vp),[[e.vModelText,de.value]])])],2))}}),Bp={class:"dss-step-bar__layout"},Mp={class:"dss-step-bar__header"},_p={class:"dss-step-bar__label"},$p={key:0,class:"dss-step-bar__counter"},Lp={class:"dss-step-bar__track-wrapper"},Tp=["aria-valuemax","aria-valuenow","aria-label"],Ap=["onMouseenter"],Dp={__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:E=>["input","desc","asc"].includes(E)},orientation:{type:String,default:"horizontal",validator:E=>["horizontal","vertical"].includes(E)},barHeight:{type:[Number,String],default:200},labelPosition:{type:String,default:"up",validator:E=>["up","down","left","right"].includes(E)},sideLabelMaxWidth:{type:[Number,String],default:null},sideLabelWrapWidth:{type:[Number,String],default:"18ch"},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(E){const le=E,_={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"}}},B=U=>U&&typeof U=="object"&&!Array.isArray(U),de=(U,ke)=>{const W=Object.assign({},U);return!B(U)||!B(ke)||Object.keys(ke).forEach(G=>{if(B(ke[G])){G in U?W[G]=de(U[G],ke[G]):Object.assign(W,{[G]:ke[G]});return}Object.assign(W,{[G]:ke[G]})}),W},P=e.computed(()=>de(_,le.options)),T=e.computed(()=>Math.max(1,Number(le.steps)||1)),he=e.computed(()=>Math.min(T.value,Math.max(0,Number(le.currentStep)||0))),st=e.computed(()=>Array.isArray(le.segments)&&le.segments.length>0),te=e.computed(()=>{if(!st.value)return[];const U=le.segments.map((ke,W)=>{const G=Number(ke?.value);return{label:ke?.label||`Step ${W+1}`,value:Number.isFinite(G)&&G>0?G:0,color:ke?.color||le.activeColor,marker:ke?.marker}});return le.segmentOrder==="desc"?[...U].sort((ke,W)=>W.value-ke.value):le.segmentOrder==="asc"?[...U].sort((ke,W)=>ke.value-W.value):U}),f=e.computed(()=>st.value?te.value.reduce((U,ke)=>U+ke.value,0):he.value),we=e.computed(()=>st.value?Number.isFinite(Number(le.totalValue))&&Number(le.totalValue)>0?Number(le.totalValue):Math.max(1,f.value):T.value),Ce=e.computed(()=>st.value&&Number.isFinite(Number(le.totalValue))&&Number(le.totalValue)>0),J=e.computed(()=>Ce.value?Math.max(0,Number(le.totalValue)-f.value):0),X=e.computed(()=>typeof le.remainderLabel=="string"&&le.remainderLabel.trim().length>0),fe=e.computed(()=>J.value>0),R=e.computed(()=>te.value.reduce((U,ke)=>Math.max(U,Number(ke.value)||0),0)),me=e.computed(()=>te.value.filter(U=>U.value>0).map(U=>`${U.label}: ${kt(U.value)}`).join(" | ")),_e=e.computed(()=>st.value?Ce.value?te.value.filter(U=>U.value>0):te.value:[]),Je=e.computed(()=>{if(!le.counterAsPercentage)return`${f.value} / ${we.value}`;const U=Number(we.value);if(!Number.isFinite(U)||U<=0)return"0%";const ke=Math.round(Number(f.value)/U*100);return`${Math.min(Math.max(ke,0),100)}%`}),pt=e.computed(()=>f.value),Z=e.computed(()=>we.value),Fe=e.reactive({visible:!1,x:0,y:0,content:""}),We=e.computed(()=>le.orientation==="vertical"),Se=e.computed(()=>{const U=le.barHeight;return U==null||U===""?"200px":typeof U=="number"?`${U}px`:String(U)}),Le=e.computed(()=>{const U=le.sideLabelMaxWidth;if(!(U==null||U===""))return typeof U=="number"?`${U}px`:String(U)}),Ye=e.computed(()=>{const U=le.sideLabelWrapWidth;return U==null||U===""?"18ch":typeof U=="number"?`${U}ch`:String(U)}),ie=e.computed(()=>({left:`${Fe.x}px`,top:`${Fe.y}px`,transform:"translate(-50%, calc(-100% - 8px))"})),Ge=U=>We.value?{flex:`${U} 0 0`,minHeight:U>0?"6px":"0",minWidth:"0"}:{flex:`${U} 0 0`,minWidth:U>0?"6px":"0"},be=U=>{const ke=U?.parentElement;if(!ke)return{x:0,y:0};const W=ke.getBoundingClientRect();return{x:W.left+W.width/2,y:W.top}},Qe=U=>{const ke=U.getBoundingClientRect();return{x:ke.left+ke.width/2,y:ke.top}},ct=U=>{if(Ce.value){const G=Math.max(0,Number(U.value)||0);return{...Ge(G),backgroundColor:U.color}}const ke=f.value,W=U.value>0?U.value:ke>0?1e-4:1;return{...Ge(W),backgroundColor:U.color}},gt=U=>Number(U?.value||0)>0&&Number(U?.value||0)===R.value,ut=U=>{const ke=B(U?.marker)?U.marker:{},W=U?.marker===!0||ke.enabled===!0,G=gt(U)&&P.value.maxSegment?.marker?.enabled===!0;if(!(W||G))return{enabled:!1};const Ie=ke.backgroundColor??(G?P.value.maxSegment?.marker?.backgroundColor:P.value.segmentMarker?.backgroundColor),Ue=ke.borderColor??(G?P.value.maxSegment?.marker?.borderColor:P.value.segmentMarker?.borderColor),Et=ke.color??(G?P.value.maxSegment?.marker?.color:P.value.segmentMarker?.color),Ke=ke.width??(G?P.value.maxSegment?.marker?.width:P.value.segmentMarker?.width),Ut=ke.height??(G?P.value.maxSegment?.marker?.height:P.value.segmentMarker?.height);return{enabled:!0,backgroundColor:Ie,borderColor:Ue,color:Et,width:Ke,height:Ut,icon:ke.icon??null,...ke}},qt=U=>{const ke=ut(U);return{backgroundColor:ke.backgroundColor??void 0,borderColor:ke.borderColor??void 0,color:ke.color??void 0}},Zt=U=>{const ke=ut(U);return{width:ke.width??void 0,height:ke.height??void 0}},kt=U=>`${U}${le.valueLabel}`,xt=e.computed(()=>({...Ge(J.value),backgroundColor:le.inactiveColor})),Yt=(U,ke)=>{if(!U||!ke?.currentTarget)return;const W=ke.currentTarget;if(le.remainderTooltipSummary){const Ne=be(W);Fe.x=Ne.x,Fe.y=Ne.y,Fe.content=me.value,Fe.visible=!!Fe.content;return}const G=Qe(W);Fe.x=G.x,Fe.y=G.y,Fe.content=`${U.label}: ${kt(U.value)}`,Fe.visible=!0},rt=U=>{if(!J.value||!U?.currentTarget)return;const ke=U.currentTarget;if(le.remainderTooltipSummary){const G=be(ke);Fe.x=G.x,Fe.y=G.y,Fe.content=me.value,Fe.visible=!!Fe.content;return}const W=Qe(ke);Fe.x=W.x,Fe.y=W.y,X.value&&(Fe.content=`${le.remainderLabel}: ${kt(J.value)}`,Fe.visible=!0)},Jt=()=>{Fe.visible=!1},yt=()=>{Fe.visible&&Jt()};e.onMounted(()=>{window.addEventListener("scroll",yt,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",yt,!0)});const ol=e.computed(()=>({"--dss-step-bar-label-color":le.labelColor??void 0,"--dss-step-bar-counter-color":le.counterColor??void 0,"--dss-step-bar-active-color":le.activeColor,"--dss-step-bar-inactive-color":le.inactiveColor,"--dss-step-bar-bar-height":We.value?Se.value:void 0,"--dss-step-bar-side-label-max-width":Le.value,"--dss-step-bar-side-label-wrap-width":Ye.value}));return(U,ke)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-step-bar",[`dss-step-bar--${E.orientation}`,`dss-step-bar--label-${E.labelPosition}`]]),style:e.normalizeStyle(ol.value)},[e.createElementVNode("div",Bp,[e.createElementVNode("div",Mp,[e.createElementVNode("span",_p,[e.renderSlot(U.$slots,"label",{label:E.label},()=>[e.createTextVNode(e.toDisplayString(E.label),1)])]),E.showCounter?(e.openBlock(),e.createElementBlock("span",$p,[e.renderSlot(U.$slots,"counter",{counterDisplay:Je.value},()=>[e.createTextVNode(e.toDisplayString(Je.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Lp,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":Z.value,"aria-valuenow":pt.value,"aria-label":E.label},[st.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_e.value,(W,G)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${G}-${W.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":gt(W),"dss-step-bar__segment--marker-enabled":ut(W).enabled}]),style:e.normalizeStyle(ct(W)),onMouseenter:Ne=>Yt(W,Ne),onMouseleave:Jt},[ut(W).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(qt(W)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(Zt(W))},[e.renderSlot(U.$slots,"segment-marker-icon",{segment:W,index:G,marker:ut(W)},()=>[e.renderSlot(U.$slots,"max-segment-icon",{segment:W,index:G,marker:ut(W)},()=>[e.createTextVNode(e.toDisplayString(ut(W).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,Ap))),128)),fe.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(xt.value),onMouseenter:ke[0]||(ke[0]=W=>rt(W)),onMouseleave:Jt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(T.value,W=>(e.openBlock(),e.createElementBlock("div",{key:W,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":W<=he.value}])},null,2))),128))],8,Tp)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Fe.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip dss-step-bar__tooltip--teleported",style:e.normalizeStyle(ie.value)},e.toDisplayString(Fe.content),5)):e.createCommentVNode("",!0)]))],6))}},Hp={key:0,class:"dss-title dss-title--separator"},Rp={__name:"DSSTitle",props:{type:{type:String,default:"main",validator:E=>["main","separator","subtitle"].includes(E)},h:{type:Number,default:null,validator:E=>E===null||Number.isInteger(E)&&E>=1&&E<=6},size:{type:[String,Number],default:null},weight:{type:[String,Number],default:null},color:{type:String,default:null},editable:{type:Boolean,default:!1},modelValue:{type:String,default:""}},emits:["update:modelValue","change"],setup(E,{expose:le,emit:_}){const B=E,de=_,P=e.ref(null),T=e.computed(()=>`dss-title--${B.type}`),he=e.computed(()=>B.h!=null?`dss-title--h${B.h}`:null),st={main:"div",subtitle:"p",separator:"span"},te=e.computed(()=>B.h!=null?`h${B.h}`:st[B.type]??"div"),f=e.computed(()=>B.editable?"plaintext-only":void 0),we=e.computed(()=>{const me={};return B.size!=null&&(me.fontSize=typeof B.size=="number"?`${B.size}px`:B.size),B.weight!=null&&(me.fontWeight=B.weight),B.color!=null&&(me.color=B.color),Object.keys(me).length?me:void 0}),Ce=e.computed(()=>B.editable?{input:X,keydown:fe,paste:R}:{}),J=()=>{const me=P.value;!B.editable||!me||document.activeElement!==me&&(me.innerText=B.modelValue??"")},X=me=>{const _e=me.target.innerText;de("update:modelValue",_e),de("change",_e)},fe=me=>{me.key==="Enter"&&me.preventDefault()},R=me=>{me.preventDefault();const _e=(me.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,_e)};return e.watch(()=>B.modelValue,()=>{J()}),e.watch(()=>B.editable,()=>{e.nextTick(J)}),e.onMounted(()=>{e.nextTick(J)}),le({focus:()=>P.value?.focus()}),(me,_e)=>E.type==="separator"?(e.openBlock(),e.createElementBlock("div",Hp,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(te.value),e.mergeProps({ref_key:"titleRef",ref:P,class:["dss-title__separator-label",he.value,{"dss-title--editable":E.editable}],style:we.value,contenteditable:f.value,spellcheck:E.editable?!1:void 0},e.toHandlers(Ce.value)),{default:e.withCtx(()=>[E.editable?e.createCommentVNode("",!0):e.renderSlot(me.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(E.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(te.value),e.mergeProps({key:1,ref_key:"titleRef",ref:P,class:["dss-title",[T.value,he.value,{"dss-title--editable":E.editable}]],style:we.value,contenteditable:f.value,spellcheck:E.editable?!1:void 0},e.toHandlers(Ce.value)),{default:e.withCtx(()=>[E.editable?e.createCommentVNode("",!0):e.renderSlot(me.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(E.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))}},Fp={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"}},Ip={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"},zp={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"}},Pp={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"}},Op={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:Fp,table:Ip,filter:zp,datepicker:Pp,textEditor:Op},Wp={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"}},qp={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"},Zp={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"}},Up={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"}},Xp={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:Wp,table:qp,filter:Zp,datepicker:Up,textEditor:Xp},Yp={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"}},jp={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"},Kp={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"}},Gp={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"}},Qp={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:Yp,table:jp,filter:Kp,datepicker:Gp,textEditor:Qp},Oo={en:ro,fr:io,nl:co};function Va(E){if(!E||!E.global)return;const le=E.global.availableLocales||[];Object.keys(Oo).forEach(_=>{le.includes(_)&&E.global.mergeLocaleMessage(_,Oo[_])})}const Wo={en:{textEditor:ro.textEditor},fr:{textEditor:io.textEditor},nl:{textEditor:co.textEditor}};function Na(E){if(!E||!E.global)return;const le=E.global.availableLocales||[];Object.keys(Wo).forEach(_=>{le.includes(_)&&E.global.mergeLocaleMessage(_,Wo[_])})}const qo={en:{table:ro.table},fr:{table:io.table},nl:{table:co.table}};function Ba(E){if(!E||!E.global)return;const le=E.global.availableLocales||[];Object.keys(qo).forEach(_=>{le.includes(_)&&E.global.mergeLocaleMessage(_,qo[_])})}const Zo={en:{datepicker:ro.datepicker},fr:{datepicker:io.datepicker},nl:{datepicker:co.datepicker}};function Ma(E){if(!E||!E.global)return;const le=E.global.availableLocales||[];Object.keys(Zo).forEach(_=>{le.includes(_)&&E.global.mergeLocaleMessage(_,Zo[_])})}const Uo={en:{filter:ro.filter},fr:{filter:io.filter},nl:{filter:co.filter}};function _a(E){if(!E||!E.global)return;const le=E.global.availableLocales||[];Object.keys(Uo).forEach(_=>{le.includes(_)&&E.global.mergeLocaleMessage(_,Uo[_])})}const Jp={chart:Oo,textEditor:Wo,table:qo,datepicker:Zo,filter:Uo};function e9(E){!E||!E.global||(Va(E),Na(E),Ba(E),Ma(E),_a(E))}const t9={en:{...ro},fr:{...io},nl:{...co}};so.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:t9});exports.DSSChart=jc;exports.DSSChartMessages=Oo;exports.DSSColorPicker=R2;exports.DSSConfetti=d0;exports.DSSDatepicker=ca;exports.DSSDatepickerMessages=Zo;exports.DSSDnd=c0;exports.DSSFilter=yp;exports.DSSFilterMessages=Uo;exports.DSSLoader=K2;exports.DSSMessages=Jp;exports.DSSModal=ia;exports.DSSPillField=Np;exports.DSSSkeleton=G2;exports.DSSStepBar=Dp;exports.DSSTable=gd;exports.DSSTableMessages=qo;exports.DSSTextEditor=b2;exports.DSSTextEditorMessages=Wo;exports.DSSTitle=Rp;exports.addDSSChartTranslations=Va;exports.addDSSDatepickerTranslations=Ma;exports.addDSSFilterTranslations=_a;exports.addDSSTableTranslations=Ba;exports.addDSSTextEditorTranslations=Na;exports.addDSSTranslations=e9;
|
|
119
|
+
`,document.body.appendChild(Ce),V=Ce}function Te(pe,A){V&&(V.style.left=`${pe-lt}px`,V.style.top=`${A-rt}px`)}function at(pe){pe.classList.add("dss-dnd-item--dragging"),pe.style.background=me.value.dragSourceBackground,pe.style.borderColor=me.value.dragSourceBorder,pe.style.transform="scale(0.97)"}function ge(pe){pe.classList.remove("dss-dnd-item--dragging"),pe.style.background="",pe.style.borderColor="",pe.style.transform=""}function Ft(pe,A){return document.elementFromPoint(pe,A)?.closest(".dss-dnd-column-body")??null}function dt(pe,A){return!!document.elementFromPoint(pe,A)?.closest("[data-dss-dnd-delete-zone]")}function Ye(pe,A){if(O.value&&dt(pe,A)){he.value=!0,be.value=null,oe.value=-1;return}he.value=!1;const X=Ft(pe,A),ae=X?.getAttribute("data-column")??null;if(!ae){be.value=null,oe.value=-1;return}be.value=ae;const Ce=X.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let je=Ce.length;for(let Ge=0;Ge<Ce.length;Ge++){const Vt=Ce[Ge].getBoundingClientRect();if(A<Vt.top+Vt.height/2){je=Ge;break}}oe.value=je}function Pt(pe){pe.preventDefault(),Te(pe.clientX,pe.clientY),!fe&&(fe=requestAnimationFrame(()=>{fe=null,Ye(pe.clientX,pe.clientY)}))}function It(pe){window.removeEventListener("pointermove",Pt),window.removeEventListener("pointerup",It),window.removeEventListener("pointercancel",It),$e?.releasePointerCapture?.(pe.pointerId),ge($e),$e=null;const A=O.value&&dt(pe.clientX,pe.clientY);if(f.value&&A)N("delete",{item:f.value});else{const ae=Ft(pe.clientX,pe.clientY)?.getAttribute("data-column")??null;if(f.value&&ae){const Ce=f.value[L.columnKey],je=ae,Vt=(ze.value[je]||[]).filter(qt=>qt[L.itemKey]!==f.value[L.itemKey]),Pe=Math.max(0,Math.min(oe.value,Vt.length)),Ke=Ue(je,Pe),nt=f.value[L.itemKey];N("move",{item:f.value,from:Ce,to:je,position:Ke,index:Pe}),_e&&clearTimeout(_e),j.value={id:nt,from:Ce,to:je},_e=setTimeout(()=>{j.value=null},3500)}}V&&(V.remove(),V=null),Qe!==null&&(document.body.style.cursor=Qe,Qe=""),Dt()}function bt(pe,A){pe.preventDefault();const X=pe.target.closest(".dss-dnd-item");if(!X)return;const ae=X.getBoundingClientRect();lt=pe.clientX-ae.left,rt=pe.clientY-ae.top,Qe=document.body.style.cursor,document.body.style.cursor="grabbing",f.value=A,$e=X,ke(X,pe.clientX,pe.clientY),requestAnimationFrame(()=>at(X)),X.setPointerCapture?.(pe.pointerId),window.addEventListener("pointermove",Pt),window.addEventListener("pointerup",It,{once:!0}),window.addEventListener("pointercancel",It,{once:!0})}function ft(){Z&&(window.removeEventListener("pointermove",Yt),window.removeEventListener("pointerup",it),window.removeEventListener("pointercancel",it),Z=null)}function Yt(pe){if(!Z||pe.pointerId!==Z.pointerId)return;const A=pe.clientX-Z.startX,X=pe.clientY-Z.startY;if(Math.abs(A)>=qe||Math.abs(X)>=qe){const ae=Z.item;ft(),bt(pe,ae)}}function it(pe){!Z||pe.pointerId!==Z.pointerId||ft()}function At(pe,A){ft(),Z={item:A,startX:pe.clientX,startY:pe.clientY,pointerId:pe.pointerId},window.addEventListener("pointermove",Yt),window.addEventListener("pointerup",it),window.addEventListener("pointercancel",it)}function ht(pe,A){me.value.useHandle||At(pe,A)}function il(pe,A){At(pe,A)}function St(){fe&&(cancelAnimationFrame(fe),fe=null)}function Dt(){St(),f.value=null,be.value=null,he.value=!1,oe.value=-1}return e.onBeforeUnmount(()=>{St(),ft(),_e&&clearTimeout(_e),V&&(V.remove(),V=null)}),(pe,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":me.value.unstyled}]),style:e.normalizeStyle(ot.value)},[O.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":he.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(pe.$slots,"delete-zone",{isDragging:!!f.value,isOver:he.value})],2),[[e.vShow,!!f.value||me.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.columns,X=>(e.openBlock(),e.createElementBlock("div",{key:X.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":be.value==X.value},X.class||""]]),style:e.normalizeStyle(ne(X))},[me.value.showHeader?(e.openBlock(),e.createElementBlock("div",pp,[e.renderSlot(pe.$slots,"column-header",{column:X,items:ze.value[X.value]||[]},()=>[e.createElementVNode("span",vp,e.toDisplayString(X.title||X.value),1),e.createElementVNode("span",fp,e.toDisplayString((ze.value[X.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":X.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye.value[X.value],ae=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ae.key},[ae.type==="indicator"?(e.openBlock(),e.createElementBlock("div",gp)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":ae.isDragged,"dss-dnd-item--no-handle":!me.value.useHandle}]),onPointerdown:Ce=>ht(Ce,ae.item)},[me.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Ce=>il(Ce,ae.item),["stop"])},[e.renderSlot(pe.$slots,"handle",{},()=>[A[0]||(A[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,kp)):e.createCommentVNode("",!0),e.createElementVNode("div",Cp,[e.renderSlot(pe.$slots,"item",{item:ae.item,column:X,justDropped:j.value?.id===ae.item[S.itemKey],droppedFrom:j.value?.id===ae.item[S.itemKey]?j.value.from:null,droppedTo:j.value?.id===ae.item[S.itemKey]?j.value.to:null},()=>[e.createElementVNode("div",bp,e.toDisplayString(ae.item[S.itemKey]),1)])])],42,yp))],64))),128)),(ze.value[X.value]||[]).length===0&&be.value!=X.value?(e.openBlock(),e.createElementBlock("div",wp,[e.renderSlot(pe.$slots,"empty",{column:X},()=>[A[1]||(A[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,hp)],6))),128))],6))}}),Sp={name:"DSSConfetti"},Vp=Object.assign(Sp,{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(S){const ee=S,L=e.ref(null),N=e.ref(!1);let ue=[],O=null,H=null;function me(oe,j){const fe=[];for(let _e=0;_e<ee.count;_e++)fe.push(ot(oe));return fe}function ot(oe,j){return{x:Math.random()*oe,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:ee.colors[Math.floor(Math.random()*ee.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 ne(oe,j,fe,_e){oe.clearRect(0,0,j,fe);for(const V of ue)oe.save(),oe.globalAlpha=V.opacity*_e,oe.beginPath(),oe.lineWidth=V.r,oe.strokeStyle=V.color,oe.moveTo(V.x+V.tilt+V.r/2,V.y),oe.lineTo(V.x+V.tilt,V.y+V.tilt+V.r/2),oe.stroke(),oe.restore()}function f(oe,j,fe){const _e=.3+fe*.7;for(let V=0;V<ue.length;V++){const $e=ue[V];$e.tiltAngle+=$e.tiltInc,$e.y+=$e.speed*_e,$e.x+=Math.sin($e.d)*.5*_e,$e.tilt=Math.sin($e.tiltAngle)*15,fe>=.99&&$e.y>j+20&&(ue[V]=ot(oe))}}function be(){N.value=!0,e.nextTick(()=>{const oe=L.value;if(!oe)return;const j=oe.getContext("2d"),fe=oe.parentElement;if(!fe)return;const _e=fe.getBoundingClientRect();oe.width=_e.width,oe.height=_e.height,ue=me(oe.width,oe.height);const V=Date.now(),$e=V+ee.duration,lt=()=>{const rt=Date.now(),Qe=rt-V;if(rt<$e){let Z=1;Qe>ee.fadeStart&&(Z=1-(Qe-ee.fadeStart)/(ee.duration-ee.fadeStart)),ne(j,oe.width,oe.height,Z),f(oe.width,oe.height,Z),O=requestAnimationFrame(lt)}else he()};lt()})}function he(){O&&(cancelAnimationFrame(O),O=null),ue=[],N.value=!1}return e.watch(()=>ee.trigger,oe=>{oe&&(H&&clearTimeout(H),H=setTimeout(be,ee.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{he(),H&&clearTimeout(H)}),(oe,j)=>N.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:L,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),Np={class:"dss-filter-global-inner"},Bp=["placeholder","value"],Mp=["title"],_p={key:0,class:"dss-filter-funnel-badge"},$p={key:1,class:"dss-filter-sortby"},Lp=["value"],Tp=["value"],Ap=["disabled","title"],Dp={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"},Hp={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"},Rp={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"},Fp={class:"dss-filter-panel"},Ip={key:0,class:"dss-filter-empty"},zp={class:"dss-filter-row-prefix"},Pp={class:"dss-filter-cell"},Op=["onClick"],Wp={class:"dss-filter-trigger-text"},qp=["placeholder"],Zp={class:"dss-filter-popup-list"},Up=["onClick"],Xp={key:0,class:"dss-filter-popup-empty"},Yp={key:0,class:"dss-filter-cell"},jp=["onClick"],Kp={class:"dss-filter-trigger-text"},Gp={class:"dss-filter-popup-list"},Qp=["onClick"],Jp={key:1,class:"dss-filter-cell dss-filter-cell--value"},e0=["placeholder","onUpdate:modelValue"],t0={key:1,class:"dss-filter-date-wrap"},l0=["placeholder","onUpdate:modelValue"],n0=["placeholder","value","onInput","step"],o0={key:4,class:"dss-filter-between"},a0=["placeholder","value","onInput","step"],s0={class:"dss-filter-between-sep"},r0=["placeholder","value","onInput","step"],i0={key:5,class:"dss-filter-multiselect"},c0=["onClick"],u0={class:"dss-filter-trigger-text"},d0=["placeholder"],m0={class:"dss-filter-popup-list dss-filter-popup-list--check"},p0=["onClick"],v0=["checked"],f0={key:0,class:"dss-filter-popup-empty"},h0=["onClick"],g0={class:"dss-filter-foot"},y0={class:"dss-filter-cell"},k0=["placeholder"],C0={class:"dss-filter-popup-list"},b0=["onClick"],w0={key:0,class:"dss-filter-popup-divider"},x0=["onClick"],E0=["placeholder"],S0={class:"dss-filter-popup-list"},V0=["onClick"],N0={key:0,class:"dss-filter-popup-empty"},B0=["placeholder"],M0={class:"dss-filter-popup-list"},_0=["onClick"],$0={key:0,class:"dss-filter-popup-empty"},L0={name:"DSSFilter"},T0=Object.assign(L0,{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(S,{expose:ee,emit:L}){const{t:N}=so.useI18n(),ue=S,O=L,H={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},me=e.computed(()=>({...H,...ue.options})),ot={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"}]},ne=new Set(["is_empty","is_not_empty","is_true","is_false"]),f=["label","name","title","keyword","full_name","value","text"],be=e.ref(""),he=e.ref([]),oe=e.ref(null),j=e.ref(!1),fe=e.ref(null),_e=e.ref(""),V=e.ref(null),$e=e.ref(""),lt=e.ref("asc");let rt=1;function Qe(B){const w=B.find(T=>T&&typeof T=="object");if(!w)return null;for(const T of f)if(T in w&&typeof w[T]=="string")return T;return Object.keys(w).find(T=>typeof w[T]=="string")||null}function Z(B,w){const T=w.filter(ie=>ie!=null&&ie!=="NULL");if(T.length===0)return null;if(T.every(ie=>Array.isArray(ie))){const ie=T.flatMap(He=>He).filter(He=>He!=null);return ie.length===0?null:typeof ie.find(He=>He!=null)=="object"?"arraySelect":"arrayText"}return T.every(ie=>typeof ie=="boolean")?"boolean":T.every(ie=>typeof ie=="number")?new Set(T).size<=me.value.maxUniqueForEnum?"select":"range":T.every(ie=>typeof ie=="string")?new Set(T).size<=me.value.maxUniqueForSelect?"select":"text":T.some(ie=>typeof ie=="object"&&!Array.isArray(ie))?null:"text"}const qe=e.computed(()=>{if(!ue.data?.length)return[];const B=new Set;for(const re of ue.data)if(re&&typeof re=="object")for(const He of Object.keys(re))B.add(He);const w=new Set(ue.exclude),T=[];for(const re of B){if(w.has(re))continue;const He=ue.config[re]||{},gt=ue.data.map(xt=>xt?.[re]),et=He.type||Z(re,gt);if(!et)continue;const Ae=He.filterMode||"contain",yt=Ae==="date"?"date":Ae==="string"?"text":et,Et={key:re,label:He.label||pt(re),type:yt,filterMode:Ae};if(et==="select"){const xt=gt.filter($t=>$t!=null&&$t!=="NULL");Et.uniqueValues=[...new Set(xt)].sort(($t,Ht)=>typeof $t=="number"&&typeof Ht=="number"?$t-Ht:String($t).localeCompare(String(Ht)))}else if(et==="range"||et==="int"){const xt=gt.filter($t=>typeof $t=="number");Et.min=Math.min(...xt),Et.max=Math.max(...xt)}else if(et==="arraySelect"){const xt=He.displayKey||Qe(gt.flatMap($t=>Array.isArray($t)?$t:[]));if(Et.displayKey=xt,Array.isArray(He.uniqueValues)&&He.uniqueValues.length>0)Et.uniqueValues=He.uniqueValues.map($t=>String($t));else{const $t=gt.flatMap(Ht=>Array.isArray(Ht)?Ht:[]).filter(Ht=>Ht!=null).map(Ht=>xt&&typeof Ht=="object"?Ht[xt]:String(Ht)).filter(Ht=>Ht!=null&&Ht!=="");Et.uniqueValues=[...new Set($t)].sort((Ht,kt)=>String(Ht).localeCompare(String(kt)))}}T.push(Et)}const ie=ue.config._order;return ie&&T.sort((re,He)=>{const gt=ie.indexOf(re.key),et=ie.indexOf(He.key);return gt===-1&&et===-1?0:gt===-1?1:et===-1?-1:gt-et}),T}),ze=e.computed(()=>{const B={};for(const w of qe.value)B[w.key]=w;return B}),ye=e.computed(()=>Array.isArray(ue.config.groups)&&ue.config.groups.length>0),Ue=e.computed(()=>{if(!ye.value)return[];const B=new Set(qe.value.map(w=>w.key));return ue.config.groups.map(w=>({...w,keys:w.keys.filter(T=>B.has(T))})).filter(w=>w.keys.length>0)}),ke=e.computed(()=>{if(!ye.value)return[];const B=new Set(ue.config.groups.flatMap(w=>w.keys));return qe.value.filter(w=>!B.has(w.key))}),Te=e.computed(()=>{if(!V.value)return[];const B=new Set(V.value.keys),w=qe.value.filter(ie=>B.has(ie.key));if(!_e.value)return w;const T=_e.value.toLowerCase();return w.filter(ie=>ie.label.toLowerCase().includes(T))}),at=e.computed(()=>{if(!_e.value)return qe.value;const B=_e.value.toLowerCase();return qe.value.filter(w=>w.label.toLowerCase().includes(B))}),ge=e.computed(()=>qe.value.filter(B=>!["arraySelect","arrayText"].includes(B.type))),Ft=e.computed(()=>$e.value?lt.value==="asc"?"Ascending":"Descending":"No sort selected");function dt(B){oe.value===B?Ye():(oe.value=B,_e.value="",V.value=null)}function Ye(){oe.value=null,_e.value="",V.value=null}function Pt(B){const w=B.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");oe.value&&!w&&!B.target.closest(".dss-filter-popup")&&!B.target.closest(".dss-filter-trigger")&&!B.target.closest(".dss-filter-add-btn")&&Ye(),j.value&&fe.value&&!fe.value.contains(B.target)&&(w||(j.value=!1))}e.onMounted(()=>document.addEventListener("click",Pt)),e.onBeforeUnmount(()=>document.removeEventListener("click",Pt));function It(B){return ze.value[B]?.label||pt(B)}function bt(B){return ze.value[B.key]?.filterMode||"contain"}function ft(B){return N(`filter.operators.${B}`)}function Yt(B){const w=ze.value[B.key];return(ot[w?.type]||ot.text).map(T=>({...T,label:N(`filter.operators.${T.value}`)}))}function it(B){return ne.has(B)}function At(B){const w=ze.value[B.key];return w?w.type==="date"?"date":w.type==="boolean"?"boolean":w.type==="text"||w.type==="arrayText"?"text":w.type==="select"||w.type==="arraySelect"?"multiselect":w.type==="range"||w.type==="int"?B.operator==="between"?"between":"number":"text":"text"}function ht(B){return ot[B]?.[0]?.value||"contains"}function il(B,w){return ne.has(w)||B==="date"?null:B==="select"||B==="arraySelect"?[]:(B==="range"||B==="int")&&w==="between"?{min:null,max:null}:B==="range"||B==="int"?null:""}function St(B){return ze.value[B.key]?.uniqueValues||[]}function Dt(B){const w=St(B);if(!_e.value)return w;const T=_e.value.toLowerCase();return w.filter(ie=>String(ie).toLowerCase().includes(T))}function pe(B){const w=B.value;return!w||w.length===0?N("filter.select"):w.length<=2?w.join(", "):N("filter.selectedCount",{count:w.length})}function A(B){const w=ze.value[B],T=w?.filterMode||"contain",ie=w?.type||"text",re=T==="string"?"contains":ht(ie);he.value.push(e.reactive({id:rt++,key:B,operator:re,value:il(ie,re)})),Ye()}function X(B){he.value=he.value.filter(w=>w.id!==B)}function ae(B,w){const ie=ze.value[w]?.type||"text";B.key=w,B.operator=ht(ie),B.value=il(ie,B.operator),Ye()}function Ce(B,w){const T=At(B);B.operator=w;const ie=At(B);if(T!==ie||ne.has(w)){const re=ze.value[B.key];B.value=il(re?.type||"text",w)}Ye()}function je(B,w){const T=w.target.value;B.value=T===""?null:Number(T)}function Ge(B,w,T){const ie=T.target.value,re=ie===""?null:Number(ie);(!B.value||typeof B.value!="object")&&(B.value={min:null,max:null}),B.value={...B.value,[w]:isNaN(re)?null:re}}function Vt(B,w){const T=B.value||[],ie=T.indexOf(w);B.value=ie>=0?T.filter(re=>re!==w):[...T,w]}function Pe(){he.value=[],be.value="",Ye()}function Ke(B){be.value=B.target.value}function nt(B){$e.value=B.target.value}function qt(){lt.value=lt.value==="asc"?"desc":"asc"}const te=e.computed(()=>{if(!ue.data)return[];let B=ue.data;if(be.value){const w=be.value.toLowerCase();B=B.filter(T=>{for(const ie of Object.keys(T)){const re=T[ie];if(typeof re=="string"&&re.toLowerCase().includes(w)||typeof re=="number"&&String(re).includes(w)||Array.isArray(re)&&re.some(He=>He!=null&&(typeof He=="string"?He.toLowerCase().includes(w):typeof He=="object"?Object.values(He).some(gt=>typeof gt=="string"&>.toLowerCase().includes(w)):!1)))return!0}return!1})}for(const w of he.value){if(!ce(w))continue;const T=ze.value[w.key];T&&(B=B.filter(ie=>Ve(ie,w,T)))}if(ue.showSortBy&&$e.value){const w=$e.value,T=lt.value==="asc"?1:-1;B=[...B].sort((ie,re)=>K(ie?.[w],re?.[w])*T)}return B});function K(B,w){const T=Q(B),ie=Q(w);return T==null&&ie==null?0:T==null?1:ie==null?-1:typeof T=="number"&&typeof ie=="number"?T-ie:String(T).localeCompare(String(ie),void 0,{numeric:!0,sensitivity:"base"})}function Q(B){return B==null||B==="NULL"?null:typeof B=="string"||typeof B=="number"||typeof B=="boolean"?B:B instanceof Date?B.getTime():null}function ce(B){return ne.has(B.operator)?!0:B.value==null||typeof B.value=="string"&&B.value===""||Array.isArray(B.value)&&B.value.length===0?!1:B.value instanceof Date?!isNaN(B.value.getTime()):!(typeof B.value=="object"&&!Array.isArray(B.value)&&B.value.min==null&&B.value.max==null)}function Ve(B,w,T){const ie=B?.[w.key],re=w.value,He=w.operator;if(He==="is_empty")return Ot(ie);if(He==="is_not_empty")return!Ot(ie);const gt=T.type;if(gt==="text"||gt==="arrayText"){const et=gt==="arrayText"&&Array.isArray(ie)?ie.filter(Et=>Et!=null).map(String).join(" "):ie!=null?String(ie):"",Ae=String(re).toLowerCase(),yt=et.toLowerCase();switch(He){case"contains":return yt.includes(Ae);case"not_contains":return!yt.includes(Ae);case"equals":return yt===Ae;case"not_equals":return yt!==Ae;case"starts_with":return yt.startsWith(Ae);case"ends_with":return yt.endsWith(Ae);default:return!0}}if(gt==="select")switch(He){case"is_any_of":return re.includes(ie);case"is_none_of":return!re.includes(ie);default:return!0}if(gt==="range"||gt==="int"){const et=typeof ie=="number"?ie:Number(ie);if(typeof et!="number"||isNaN(et))return!1;if(He==="between"){const yt=re?.min!=null?Number(re.min):null,Et=re?.max!=null?Number(re.max):null,xt=yt!=null&&!isNaN(yt)?yt:null,$t=Et!=null&&!isNaN(Et)?Et:null;return(xt==null||et>=xt)&&($t==null||et<=$t)}const Ae=typeof re=="number"&&!isNaN(re)?re:Number(re);if(He==="contains"||He==="not_contains"){const yt=String(et),Et=String(re??"").toLowerCase(),xt=yt.toLowerCase().includes(Et);return He==="contains"?xt:!xt}if(typeof Ae!="number"||isNaN(Ae))return!1;switch(He){case"eq":return et===Ae;case"neq":return et!==Ae;case"gt":return et>Ae;case"gte":return et>=Ae;case"lt":return et<Ae;case"lte":return et<=Ae;default:return!0}}if(gt==="arraySelect"){if(!Array.isArray(ie))return!1;const et=ie.filter(Ae=>Ae!=null).map(Ae=>T.displayKey&&typeof Ae=="object"?Ae[T.displayKey]:String(Ae));switch(He){case"contains_any":return et.some(Ae=>re.includes(Ae));case"contains_all":return re.every(Ae=>et.includes(Ae));case"not_contains_any":return!et.some(Ae=>re.includes(Ae));default:return!0}}if(gt==="date"){const et=We(re);if(!et||isNaN(et.getTime()))return!1;const Ae=We(ie);if(!Ae||isNaN(Ae.getTime()))return!1;const yt=Nt(Ae),Et=Nt(et);switch(He){case"eq":return yt===Et;case"before":return yt<Et;case"after":return yt>Et;default:return!0}}if(gt==="boolean"){const et=ie===!0||ie==="true"||ie===1,Ae=ie===!1||ie==="false"||ie===0;switch(He){case"is_true":return et;case"is_false":return Ae;default:return!0}}return!0}function We(B){if(B==null)return null;if(B instanceof Date)return isNaN(B.getTime())?null:B;if(typeof B=="number")return new Date(B>1e10?B:B*1e3);if(typeof B=="string"){const w=new Date(B);return isNaN(w.getTime())?null:w}return null}function Nt(B){const w=B.getFullYear(),T=String(B.getMonth()+1).padStart(2,"0"),ie=String(B.getDate()).padStart(2,"0");return`${w}-${T}-${ie}`}function Ot(B){return!!(B==null||B===""||B==="NULL"||Array.isArray(B)&&B.length===0||Array.isArray(B)&&B.every(w=>w==null))}e.watch(te,B=>O("update:modelValue",B),{immediate:!0}),e.watch(()=>ue.data,()=>{he.value=[],be.value="",j.value=!1,$e.value="",lt.value="asc",Ye()});function pt(B){return B.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,w=>w.toUpperCase())}function wt(){const B=w=>{if(w==null)return w;if(w instanceof Date)return{_type:"Date",value:w.toISOString(),local:w.toLocaleDateString()};if(Array.isArray(w))return w.map(B);if(typeof w=="object"&&!Array.isArray(w)){const T={};for(const ie of Object.keys(w))T[ie]=B(w[ie]);return T}return w};return{globalSearch:be.value,rows:he.value.map(w=>({key:w.key,operator:w.operator,value:B(w.value),defType:ze.value[w.key]?.type,defFilterMode:ze.value[w.key]?.filterMode})),filteredCount:te.value?.length??0}}return ee({getDebugState:wt}),(B,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":me.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:fe},[e.createElementVNode("div",Np,[w[20]||(w[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(N)("filter.searchAcrossFields"),value:be.value,onInput:Ke},null,40,Bp),be.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:w[0]||(w[0]=T=>be.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:j.value||he.value.length>0,"dss-filter-funnel-btn--with-sort":ue.showSortBy}]),onClick:w[1]||(w[1]=T=>j.value=!j.value),type:"button",title:j.value?e.unref(N)("filter.closeAdvancedFilter"):e.unref(N)("filter.openAdvancedFilter")},[w[14]||(w[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)),he.value.length>0?(e.openBlock(),e.createElementBlock("span",_p,e.toDisplayString(he.value.length),1)):e.createCommentVNode("",!0)],10,Mp),ue.showSortBy?(e.openBlock(),e.createElementBlock("div",$p,[w[19]||(w[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:$e.value,onChange:nt},[w[15]||(w[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,T=>(e.openBlock(),e.createElementBlock("option",{key:T.key,value:T.key},e.toDisplayString(T.label),9,Tp))),128))],40,Lp),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:qt,disabled:!$e.value,title:Ft.value},[$e.value?lt.value==="asc"?(e.openBlock(),e.createElementBlock("svg",Hp,[...w[17]||(w[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",Rp,[...w[18]||(w[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",Dp,[...w[16]||(w[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,Ap)])):e.createCommentVNode("",!0)]),j.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:w[13]||(w[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Fp,[he.value.length===0?(e.openBlock(),e.createElementBlock("div",Ip,e.toDisplayString(e.unref(N)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,(T,ie)=>(e.openBlock(),e.createElementBlock("div",{key:T.id,class:"dss-filter-row"},[e.createElementVNode("span",zp,e.toDisplayString(ie===0?e.unref(N)("filter.where"):e.unref(N)("filter.and")),1),e.createElementVNode("div",Pp,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(re=>dt(`${T.id}:field`),["stop"])},[e.createElementVNode("span",Wp,e.toDisplayString(It(T.key)),1),w[21]||(w[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,Op),oe.value===`${T.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[3]||(w[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[2]||(w[2]=re=>_e.value=re),placeholder:e.unref(N)("filter.searchAttributes")},null,8,qp),[[e.vModelText,_e.value]]),e.createElementVNode("ul",Zp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value,re=>(e.openBlock(),e.createElementBlock("li",{key:re.key,class:"dss-filter-popup-item",onClick:He=>ae(T,re.key)},e.toDisplayString(re.label),9,Up))),128)),at.value.length===0?(e.openBlock(),e.createElementBlock("li",Xp,e.toDisplayString(e.unref(N)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),bt(T)==="contain"||bt(T)==="date"?(e.openBlock(),e.createElementBlock("div",Yp,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(re=>dt(`${T.id}:op`),["stop"])},[e.createElementVNode("span",Kp,e.toDisplayString(ft(T.operator)),1),w[22]||(w[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,jp),oe.value===`${T.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[4]||(w[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",Gp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt(T),re=>(e.openBlock(),e.createElementBlock("li",{key:re.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:T.operator===re.value}]),onClick:He=>Ce(T,re.value)},e.toDisplayString(re.label),11,Qp))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),it(T.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Jp,[bt(T)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(N)("filter.enterValue"),"onUpdate:modelValue":re=>T.value=re},null,8,e0)),[[e.vModelText,T.value]]):bt(T)==="date"?(e.openBlock(),e.createElementBlock("div",t0,[e.createVNode(pa,{mode:"single",modelValue:T.value,"onUpdate:modelValue":re=>T.value=re},null,8,["modelValue","onUpdate:modelValue"])])):At(T)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(N)("filter.enterValue"),"onUpdate:modelValue":re=>T.value=re},null,8,l0)),[[e.vModelText,T.value]]):At(T)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(N)("filter.enterValue"),value:T.value,onInput:re=>je(T,re),step:ze.value[T.key]?.type==="int"?1:void 0},null,40,n0)):At(T)==="between"?(e.openBlock(),e.createElementBlock("div",o0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(N)("filter.min"),value:T.value?.min,onInput:re=>Ge(T,"min",re),step:ze.value[T.key]?.type==="int"?1:void 0},null,40,a0),e.createElementVNode("span",s0,e.toDisplayString(e.unref(N)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(N)("filter.max"),value:T.value?.max,onInput:re=>Ge(T,"max",re),step:ze.value[T.key]?.type==="int"?1:void 0},null,40,r0)])):At(T)==="multiselect"?(e.openBlock(),e.createElementBlock("div",i0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(re=>dt(`${T.id}:val`),["stop"])},[e.createElementVNode("span",u0,e.toDisplayString(pe(T)),1),w[23]||(w[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,c0),oe.value===`${T.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[6]||(w[6]=e.withModifiers(()=>{},["stop"]))},[St(T).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[5]||(w[5]=re=>_e.value=re),placeholder:e.unref(N)("filter.search")},null,8,d0)),[[e.vModelText,_e.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",m0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt(T),re=>(e.openBlock(),e.createElementBlock("li",{key:re,class:"dss-filter-popup-item",onClick:He=>Vt(T,re)},[e.createElementVNode("input",{type:"checkbox",checked:(T.value||[]).includes(re),tabindex:"-1"},null,8,v0),e.createElementVNode("span",null,e.toDisplayString(re),1)],8,p0))),128)),Dt(T).length===0?(e.openBlock(),e.createElementBlock("li",f0,e.toDisplayString(e.unref(N)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:re=>X(T.id)},[...w[24]||(w[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,h0)]))),128)),e.createElementVNode("div",g0,[e.createElementVNode("div",y0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:w[7]||(w[7]=e.withModifiers(T=>dt("add"),["stop"]))},e.toDisplayString(e.unref(N)("filter.addFilter")),1),oe.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:w[12]||(w[12]=e.withModifiers(()=>{},["stop"]))},[ye.value&&!V.value&&!_e.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[8]||(w[8]=T=>_e.value=T),placeholder:e.unref(N)("filter.searchAttributes")},null,8,k0),[[e.vModelText,_e.value]]),e.createElementVNode("ul",C0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,T=>(e.openBlock(),e.createElementBlock("li",{key:T.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:ie=>V.value=T},[e.createElementVNode("span",null,e.toDisplayString(T.label),1),w[25]||(w[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,b0))),128)),ke.value.length>0?(e.openBlock(),e.createElementBlock("li",w0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,T=>(e.openBlock(),e.createElementBlock("li",{key:T.key,class:"dss-filter-popup-item",onClick:ie=>A(T.key)},e.toDisplayString(T.label),9,x0))),128))])],64)):V.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:w[9]||(w[9]=T=>V.value=null)},[w[26]||(w[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(V.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[10]||(w[10]=T=>_e.value=T),placeholder:e.unref(N)("filter.searchAttributes")},null,8,E0),[[e.vModelText,_e.value]]),e.createElementVNode("ul",S0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value,T=>(e.openBlock(),e.createElementBlock("li",{key:T.key,class:"dss-filter-popup-item",onClick:ie=>A(T.key)},e.toDisplayString(T.label),9,V0))),128)),Te.value.length===0?(e.openBlock(),e.createElementBlock("li",N0,e.toDisplayString(e.unref(N)("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":w[11]||(w[11]=T=>_e.value=T),placeholder:e.unref(N)("filter.searchAttributes")},null,8,B0),[[e.vModelText,_e.value]]),e.createElementVNode("ul",M0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value,T=>(e.openBlock(),e.createElementBlock("li",{key:T.key,class:"dss-filter-popup-item",onClick:ie=>A(T.key)},e.toDisplayString(T.label),9,_0))),128)),at.value.length===0?(e.openBlock(),e.createElementBlock("li",$0,e.toDisplayString(e.unref(N)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),he.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:Pe},e.toDisplayString(e.unref(N)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),A0={class:"dss-pill-field__pills"},D0=["data-value"],H0=["disabled"],R0={class:"dss-pill-field__pill-text"},F0={key:0,class:"dss-pill-field__pill-actions"},I0=["onClick"],z0=["onClick"],P0=["placeholder","disabled"],O0=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(S,{emit:ee}){const L=S,N=ee,ue=e.ref(""),O=e.ref([...L.modelValue]),H=e.ref(null);let me=null;const ot=e.ref(null),ne=e.ref(""),f=e.ref(null),be=e.ref(null),he=e.computed(()=>{if(!be.value)return;const{width:ye,height:Ue}=be.value;return{minWidth:`${ye}px`,height:`${Ue}px`}});function oe(ye,Ue){ot.value===Ue&&(f.value=ye)}function j(){ot.value=null,ne.value="",be.value=null,f.value=null}const fe=e.computed(()=>new Set(O.value.map(ye=>ye.trim()).filter(Boolean)));function _e(ye){H.value=ye,me&&clearTimeout(me),me=setTimeout(()=>{H.value=null,me=null},900)}function V(ye){const Ue=ye.trim();return Ue?fe.value.has(Ue)?(_e(Ue),!1):(O.value=[...O.value,Ue],N("update:modelValue",[...O.value]),!0):!1}function $e(ye){const Ue=ye.split(/\r?\n/g).map(ge=>ge.trim()).filter(Boolean);if(!Ue.length)return;const ke=new Set(O.value.map(ge=>ge.trim()).filter(Boolean)),Te=[...O.value];let at=null;for(const ge of Ue){if(ke.has(ge)){at??=ge;continue}ke.add(ge),Te.push(ge)}Te.length!==O.value.length&&(O.value=Te,N("update:modelValue",[...O.value])),at&&_e(at)}function lt(ye){L.disabled||(ot.value===ye&&j(),O.value=O.value.filter((Ue,ke)=>ke!==ye),N("update:modelValue",[...O.value]))}async function rt(ye,Ue){if(L.disabled)return;const ke=Ue.currentTarget.closest(".dss-pill-field__pill");ke&&(be.value={width:ke.offsetWidth,height:ke.offsetHeight}),ot.value=ye,ne.value=O.value[ye]??"",await e.nextTick();const Te=f.value;if(!Te)return;Te.focus();const at=Te.value.length;Te.setSelectionRange(at,at)}function Qe(){j()}function Z(){if(L.disabled||ot.value===null)return;const ye=ot.value,Ue=O.value[ye]??"",ke=ne.value.trim();if(j(),ke!==Ue&&fe.value.has(ke)){_e(ke);return}if(!ke){O.value=O.value.filter((at,ge)=>ge!==ye),N("update:modelValue",[...O.value]);return}const Te=O.value.map((at,ge)=>ge===ye?ke:at);O.value=Te,N("update:modelValue",[...O.value])}function qe(ye){ye.preventDefault(),!L.disabled&&(V(ue.value),ue.value="")}function ze(ye){if(L.disabled)return;const Ue=ye.clipboardData?.getData("text")??"";!Ue.includes(`
|
|
120
|
+
`)&&!Ue.includes("\r")||(ye.preventDefault(),$e(Ue),ue.value="")}return e.watch(()=>L.modelValue,ye=>{O.value=Array.isArray(ye)?[...ye]:[]},{deep:!0}),e.onBeforeUnmount(()=>{me&&clearTimeout(me)}),(ye,Ue)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":ye.disabled}])},[e.createElementVNode("div",A0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,(ke,Te)=>(e.openBlock(),e.createElementBlock("span",{key:ke,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":H.value===ke,"dss-pill-field__pill--editing":ot.value===Te}]),style:e.normalizeStyle(ot.value===Te&&be.value?he.value:void 0)},[ot.value===Te?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-pill-field__pill-edit-wrap","data-value":ne.value||" "},[e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:at=>oe(at,Te),"onUpdate:modelValue":Ue[0]||(Ue[0]=at=>ne.value=at),class:"dss-pill-field__pill-edit",type:"text",disabled:ye.disabled,onKeydown:[e.withKeys(Z,["enter"]),e.withKeys(Qe,["esc"])],onBlur:Z},null,40,H0),[[e.vModelText,ne.value]])],8,D0)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",R0,e.toDisplayString(ke),1),ye.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",F0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:at=>rt(Te,at)},[...Ue[2]||(Ue[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,I0),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:at=>lt(Te)}," × ",8,z0)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Ue[1]||(Ue[1]=ke=>ue.value=ke),class:"dss-pill-field__input",type:"text",placeholder:O.value.length?"":ye.placeholder,disabled:ye.disabled,onPaste:ze,onKeydown:e.withKeys(qe,["enter"])},null,40,P0),[[e.vModelText,ue.value]])])],2))}}),W0={key:0,class:"dss-title dss-title--separator"},q0={__name:"DSSTitle",props:{type:{type:String,default:"main",validator:S=>["main","separator","subtitle"].includes(S)},h:{type:Number,default:null,validator:S=>S===null||Number.isInteger(S)&&S>=1&&S<=6},size:{type:[String,Number],default:null},weight:{type:[String,Number],default:null},color:{type:String,default:null},editable:{type:Boolean,default:!1},modelValue:{type:String,default:""}},emits:["update:modelValue","change"],setup(S,{expose:ee,emit:L}){const N=S,ue=L,O=e.ref(null),H=e.computed(()=>`dss-title--${N.type}`),me=e.computed(()=>N.h!=null?`dss-title--h${N.h}`:null),ot={main:"div",subtitle:"p",separator:"span"},ne=e.computed(()=>N.h!=null?`h${N.h}`:ot[N.type]??"div"),f=e.computed(()=>N.editable?"plaintext-only":void 0),be=e.computed(()=>{const V={};return N.size!=null&&(V.fontSize=typeof N.size=="number"?`${N.size}px`:N.size),N.weight!=null&&(V.fontWeight=N.weight),N.color!=null&&(V.color=N.color),Object.keys(V).length?V:void 0}),he=e.computed(()=>N.editable?{input:j,keydown:fe,paste:_e}:{}),oe=()=>{const V=O.value;!N.editable||!V||document.activeElement!==V&&(V.innerText=N.modelValue??"")},j=V=>{const $e=V.target.innerText;ue("update:modelValue",$e),ue("change",$e)},fe=V=>{V.key==="Enter"&&V.preventDefault()},_e=V=>{V.preventDefault();const $e=(V.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,$e)};return e.watch(()=>N.modelValue,()=>{oe()}),e.watch(()=>N.editable,()=>{e.nextTick(oe)}),e.onMounted(()=>{e.nextTick(oe)}),ee({focus:()=>O.value?.focus()}),(V,$e)=>S.type==="separator"?(e.openBlock(),e.createElementBlock("div",W0,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(ne.value),e.mergeProps({ref_key:"titleRef",ref:O,class:["dss-title__separator-label",me.value,{"dss-title--editable":S.editable}],style:be.value,contenteditable:f.value,spellcheck:S.editable?!1:void 0},e.toHandlers(he.value)),{default:e.withCtx(()=>[S.editable?e.createCommentVNode("",!0):e.renderSlot(V.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(S.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(ne.value),e.mergeProps({key:1,ref_key:"titleRef",ref:O,class:["dss-title",[H.value,me.value,{"dss-title--editable":S.editable}]],style:be.value,contenteditable:f.value,spellcheck:S.editable?!1:void 0},e.toHandlers(he.value)),{default:e.withCtx(()=>[S.editable?e.createCommentVNode("",!0):e.renderSlot(V.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(S.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))}},Z0={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"}},U0={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",currentPageAriaLabel:"Current page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",searchAriaLabel:"Search",searchTableAriaLabel:"Search table",clearSearchAriaLabel:"Clear search",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",expandRowAriaLabel:"Expand row",collapseRowAriaLabel:"Collapse row",filterColumnAriaLabel:"Filter column",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy",showingRange:"Showing {start}-{end} from {total}",ofPages:"of {total}",emptyMessage:"No data available"},X0={searchAcrossFields:"Search across all fields...",openAdvancedFilter:"Open advanced filter",closeAdvancedFilter:"Close advanced filter",noConditionsApplied:"No filter conditions are applied to this view",where:"Where",and:"And",searchAttributes:"Search attributes...",noMatch:"No match",enterValue:"Enter value...",min:"Min",max:"Max",search:"Search...",addFilter:"Add filter",clearAllFilters:"Clear all filters",select:"Select...",selectedCount:"{count} selected",operators:{contains:"contains",not_contains:"does not contain",equals:"equals",not_equals:"does not equal",starts_with:"starts with",ends_with:"ends with",is_empty:"is empty",is_not_empty:"is not empty",is_any_of:"is any of",is_none_of:"is none of",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"between",contains_any:"contains any of",contains_all:"contains all of",not_contains_any:"does not contain",before:"before",after:"after",is_true:"is true",is_false:"is false"}},Y0={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:Z0,table:U0,filter:X0,datepicker:Y0,textEditor:j0},K0={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"}},G0={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"},Q0={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"}},J0={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"}},e9={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:K0,table:G0,filter:Q0,datepicker:J0,textEditor:e9},t9={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"}},l9={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"},n9={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"}},o9={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"}},a9={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:t9,table:l9,filter:n9,datepicker:o9,textEditor:a9},Po={en:ro,fr:io,nl:co};function Aa(S){if(!S||!S.global)return;const ee=S.global.availableLocales||[];Object.keys(Po).forEach(L=>{ee.includes(L)&&S.global.mergeLocaleMessage(L,Po[L])})}const Oo={en:{textEditor:ro.textEditor},fr:{textEditor:io.textEditor},nl:{textEditor:co.textEditor}};function Da(S){if(!S||!S.global)return;const ee=S.global.availableLocales||[];Object.keys(Oo).forEach(L=>{ee.includes(L)&&S.global.mergeLocaleMessage(L,Oo[L])})}const Wo={en:{table:ro.table},fr:{table:io.table},nl:{table:co.table}};function Ha(S){if(!S||!S.global)return;const ee=S.global.availableLocales||[];Object.keys(Wo).forEach(L=>{ee.includes(L)&&S.global.mergeLocaleMessage(L,Wo[L])})}const qo={en:{datepicker:ro.datepicker},fr:{datepicker:io.datepicker},nl:{datepicker:co.datepicker}};function Ra(S){if(!S||!S.global)return;const ee=S.global.availableLocales||[];Object.keys(qo).forEach(L=>{ee.includes(L)&&S.global.mergeLocaleMessage(L,qo[L])})}const Zo={en:{filter:ro.filter},fr:{filter:io.filter},nl:{filter:co.filter}};function Fa(S){if(!S||!S.global)return;const ee=S.global.availableLocales||[];Object.keys(Zo).forEach(L=>{ee.includes(L)&&S.global.mergeLocaleMessage(L,Zo[L])})}const s9={chart:Po,textEditor:Oo,table:Wo,datepicker:qo,filter:Zo};function r9(S){!S||!S.global||(Aa(S),Da(S),Ha(S),Ra(S),Fa(S))}const i9={en:{...ro},fr:{...io},nl:{...co}};so.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:i9});exports.DSSChart=uu;exports.DSSChartMessages=Po;exports.DSSColorPicker=Q2;exports.DSSConfetti=Vp;exports.DSSDatepicker=pa;exports.DSSDatepickerMessages=qo;exports.DSSDnd=Ep;exports.DSSFilter=T0;exports.DSSFilterMessages=Zo;exports.DSSLoader=dp;exports.DSSMessages=s9;exports.DSSModal=ma;exports.DSSPillField=O0;exports.DSSSkeleton=mp;exports.DSSStepBar=Ta;exports.DSSTable=Ld;exports.DSSTableMessages=Wo;exports.DSSTextEditor=H2;exports.DSSTextEditorMessages=Oo;exports.DSSTitle=q0;exports.addDSSChartTranslations=Aa;exports.addDSSDatepickerTranslations=Ra;exports.addDSSFilterTranslations=Fa;exports.addDSSTableTranslations=Ha;exports.addDSSTextEditorTranslations=Da;exports.addDSSTranslations=r9;
|