dsp-semactic 0.6.56 → 0.6.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Jl=require("vue-i18n"),Sa={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},Va=["value"],Na=["placeholder","value","disabled"],Ba=["placeholder","value"],Ma={key:0,class:"dss-datepicker__double-wrap"},_a={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},$a=["disabled","onClick"],La={class:"dss-datepicker__double-calendars"},Ta={class:"dss-datepicker__double-calendar"},Aa={class:"dss-datepicker__calendar-header"},Da=["aria-label"],Ha={class:"dss-datepicker__month-year-row"},Ra=["aria-label"],Fa={class:"dss-datepicker__weekdays"},Ia={class:"dss-datepicker__grid"},za=["disabled","onClick","onMouseenter"],Pa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Oa={class:"dss-datepicker__double-calendar"},Wa={class:"dss-datepicker__calendar-header"},qa=["aria-label"],Za={class:"dss-datepicker__month-year-row"},Ua=["aria-label"],Xa={class:"dss-datepicker__weekdays"},Ya={class:"dss-datepicker__grid"},ja=["disabled","onClick","onMouseenter"],Ka={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ga={class:"dss-datepicker__calendar-header"},Qa=["aria-label"],Ja={class:"dss-datepicker__month-year-row"},es=["aria-label"],ts={class:"dss-datepicker__weekdays"},ns={class:"dss-datepicker__grid"},ls=["disabled","onClick","onMouseenter"],os={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},as={class:"dss-datepicker__calendar-header"},ss={class:"dss-datepicker__month-year-row"},rs={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},is={class:"dss-datepicker__months-grid"},cs=["onClick"],us={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},ds={class:"dss-datepicker__month-year"},ms={class:"dss-datepicker__years-grid"},ps=["data-year","onClick"],ra=27,ea={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:T=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(T)},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(T,{emit:le}){const M=T,L=le,{t:de,locale:z}=Jl.useI18n(),A=e.ref(!1),ve=e.ref("days"),pt=new Date,J=e.computed(()=>M.minDate instanceof Date?M.minDate:pt),f=e.ref(J.value.getMonth()),be=e.ref(J.value.getFullYear()),Ce=e.ref(J.value.getMonth()),Q=e.ref(J.value.getFullYear()),U=e.ref(J.value.getMonth()),me=e.ref(J.value.getFullYear()),H=e.ref("start"),xe=e.ref(null),He=e.ref(null);function et(){const R=J.value,O=R.getMonth(),F=R.getFullYear(),ne=O===11?0:O+1,Le=O===11?F+1:F;return{left:{month:O,year:F},right:{month:ne,year:Le}}}const vt=e.ref(null),q=e.ref(null),Ue=e.ref(null),Pe=e.ref(null),Ee=e.ref(null),Me=e.ref(null),Ke=new Date().getFullYear(),K=e.computed(()=>["single","singleFromAvailable"].includes(M.mode)),ze=e.computed(()=>["range","rangeFromAvailable"].includes(M.mode)),we=e.computed(()=>{if(M.mode!=="single"&&M.mode!=="singleFromAvailable")return null;const R=M.modelValue;return R instanceof Date?R:null}),st=e.computed(()=>{if(!ze.value)return{start:null,end:null};const R=M.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 lt(R){if(!R||!(R instanceof Date))return"";const O=R.getDate(),F=R.getMonth()+1,ne=R.getFullYear(),Le=dt=>String(dt).padStart(2,"0");return`${Le(O)}/${Le(F)}/${ne}`}const xt=e.computed(()=>lt(we.value)),It=e.computed(()=>{const{start:R,end:O}=st.value;if(!R&&!O)return"";const F=!O||R&&R<=O?R:O,ne=!R||O&&O>=R?O:R;return $e(F,ne)?lt(F):`${lt(F)} - ${lt(ne)}`}),tn=e.computed(()=>{if(M.mode!=="readonly")return"—";const R=M.modelValue;if(R instanceof Date)return lt(R)||"—";if(R&&typeof R=="object"&&("start"in R||"end"in R)){const O=R.start instanceof Date?R.start:null,F=R.end instanceof Date?R.end:null;if(!O&&!F)return"—";const ne=!F||O&&O<=F?O:F,Le=!O||F&&F>=O?F:O;return $e(ne,Le)?lt(ne):`${lt(ne)} - ${lt(Le)}`}return"—"});e.computed(()=>{const R=new Date(be.value,f.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(R)});const Ot=e.computed(()=>He.value==="left"?Ce.value:He.value==="right"?U.value:f.value),oe=e.computed(()=>He.value==="left"?Q.value:He.value==="right"?me.value:be.value),fe=e.computed(()=>{const R=new Date(be.value,f.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(R)}),Fe=e.computed(()=>{const R=new Date(oe.value,Ot.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(R)}),De=e.computed(()=>{const R=new Intl.DateTimeFormat(z.value,{month:"short"});return Array.from({length:12},(O,F)=>R.format(new Date(2024,F,1)))}),Zt=e.computed(()=>{const O=(He.value?oe.value:be.value)-Math.floor(ra/2);return Array.from({length:ra},(F,ne)=>O+ne)}),kt=e.computed(()=>{const R=Zt.value;return R.length?`${R[0]} – ${R[R.length-1]}`:""}),Ut=e.computed(()=>{const R=new Intl.DateTimeFormat(z.value,{weekday:"short"}),O=new Date(2024,0,1),F=[];for(let ne=0;ne<7;ne++){const Le=new Date(O);Le.setDate(O.getDate()+ne),F.push(R.format(Le).slice(0,2))}return F});function St(R,O){const F=new Date(R,O,1),ne=new Date(R,O+1,0),Le=F.getDay(),dt=ne.getDate(),ct=[];for(let tt=0;tt<Le;tt++)ct.push(null);for(let tt=1;tt<=dt;tt++)ct.push(new Date(R,O,tt));return ct}const Wt=e.computed(()=>St(be.value,f.value)),G=e.computed(()=>St(Q.value,Ce.value)),he=e.computed(()=>St(me.value,U.value));e.computed(()=>{const R=new Date(Q.value,Ce.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(R)}),e.computed(()=>{const R=new Date(me.value,U.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(R)});const Be=e.computed(()=>{const R=new Date(Q.value,Ce.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(R)}),Xe=e.computed(()=>{const R=new Date(me.value,U.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(R)}),Ge=e.computed(()=>M.availableDates&&M.availableDates.length>0),Tt=e.computed(()=>Ge.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"}]),Qe=e.ref({top:0,left:0});function zt(){if(!Pe.value||!A.value)return;const R=Pe.value.getBoundingClientRect(),O=window.innerWidth||document.documentElement.clientWidth,F=window.innerHeight||document.documentElement.clientHeight;let ne=R.left,Le=R.bottom+4;const dt=Ee.value;if(dt){const ct=dt.offsetWidth,tt=dt.offsetHeight;if(ne+ct>O-8&&(ne=R.right-ct,ne<8&&(ne=8)),Le+tt>F-8){const mt=R.top-4-tt;mt>=8?Le=mt:Le=Math.max(8,F-tt-8)}}Qe.value={top:Le,left:ne}}const Ze=e.computed(()=>!Pe.value||!A.value?{}:{position:"fixed",left:`${Qe.value.left}px`,top:`${Qe.value.top}px`,zIndex:1002});function $e(R,O){return!R||!O?!1:R.getFullYear()===O.getFullYear()&&R.getMonth()===O.getMonth()&&R.getDate()===O.getDate()}function rt(R){return new Date(R.getFullYear(),R.getMonth(),R.getDate()).getTime()}function Vt(R){return!M.availableDates||!M.availableDates.length?!0:M.availableDates.some(O=>O instanceof Date&&$e(O,R))}function ee(R){const O=rt(R);return!(M.minDate instanceof Date&&O<rt(M.minDate)||M.maxDate instanceof Date&&O>rt(M.maxDate))}function Z(R){const O=new Date(R);return new Date(O.getFullYear(),O.getMonth(),O.getDate())}function X(R){return R.filter(O=>ee(O))}function pe(R,O){if(!(R instanceof Date)||!(O instanceof Date))return null;let F=rt(R),ne=rt(O);if(F>ne&&([F,ne]=[ne,F]),M.minDate instanceof Date){const Le=rt(M.minDate);F=Math.max(F,Le),ne=Math.max(ne,Le)}if(M.maxDate instanceof Date){const Le=rt(M.maxDate);F=Math.min(F,Le),ne=Math.min(ne,Le)}return F>ne?null:{start:Z(F),end:Z(ne)}}function ke(R){return!M.exceptDates||!M.exceptDates.length?!1:M.exceptDates.some(O=>O instanceof Date&&$e(O,R))}function Ye(R){return ke(R)?!1:["singleFromAvailable","rangeFromAvailable"].includes(M.mode)?Vt(R):ee(R)}function Nt(R){const O=we.value,F=st.value,ne=rt(R),Le=ze.value&&F.start&&F.end&&ne>rt(F.start)&&ne<rt(F.end),dt=ze.value&&F.start&&$e(R,F.start),ct=ze.value&&F.end&&$e(R,F.end),tt=dt&&ct,mt=K.value&&O&&$e(R,O)||dt||ct;let an=!1;if(ze.value&&F.start&&!F.end&&xe.value){const Dn=rt(F.start),Hn=rt(xe.value),On=Math.min(Dn,Hn),gl=Math.max(Dn,Hn);an=ne>On&&ne<gl}return{"dss-datepicker__day--selected":mt&&!tt,"dss-datepicker__day--range-start":dt&&!tt,"dss-datepicker__day--range-end":ct&&!tt,"dss-datepicker__day--range-single":tt,"dss-datepicker__day--in-range":Le&&!dt&&!ct,"dss-datepicker__day--in-range-preview":an&&!dt&&!ct&&!Le,"dss-datepicker__day--disabled":!Ye(R)}}function on(R){if(!ze.value)return;const O=st.value;if(!O.start||O.end){xe.value=null;return}if(!Ye(R)){xe.value=null;return}xe.value=new Date(R.getFullYear(),R.getMonth(),R.getDate())}function Ct(){xe.value=null}function Gt(){if(!M.doubleCalendar||!ze.value)return;const R=st.value,{start:O,end:F}=R;if(O&&F){const dt=O<=F?O:F,ct=O<=F?F:O,tt=dt.getMonth(),mt=dt.getFullYear(),an=ct.getMonth(),Dn=ct.getFullYear();if(tt!==an||mt!==Dn){const Hn=Ce.value===tt&&Q.value===mt,On=U.value===an&&me.value===Dn;if(Hn&&On)return;Ce.value=tt,Q.value=mt,U.value=an,me.value=Dn}else{const Hn=tt===0?11:tt-1,On=tt===0?mt-1:mt;Ce.value===Hn&&Q.value===On&&U.value===tt&&me.value===mt||(Ce.value=tt,Q.value=mt,tt===11?(U.value=0,me.value=mt+1):(U.value=tt+1,me.value=mt))}return}const ne=O||F;if(ne){const dt=ne.getMonth(),ct=ne.getFullYear(),tt=Ce.value===dt&&Q.value===ct,mt=U.value===dt&&me.value===ct;if(tt||mt)return;Ce.value=dt,Q.value=ct,dt===11?(U.value=0,me.value=ct+1):(U.value=dt+1,me.value=ct);return}const Le=et();Ce.value=Le.left.month,Q.value=Le.left.year,U.value=Le.right.month,me.value=Le.right.year}function S(R="start"){if(M.mode==="readonly")return;H.value=R;const O=we.value,F=st.value;if(K.value&&O)f.value=O.getMonth(),be.value=O.getFullYear();else if(ze.value)if(M.doubleCalendar)Gt();else{const ne=R==="start"&&F.start?F.start:F.end||F.start;ne&&(f.value=ne.getMonth(),be.value=ne.getFullYear())}Pe.value=K.value?vt.value?.closest(".dss-datepicker__input-wrap"):q.value,ve.value="days",He.value=null,A.value=!0,e.nextTick(()=>{zt()})}function b(){ve.value="days",He.value=null,xe.value=null,A.value=!1}function V(R,O){He.value=R,ve.value=O}function Y(){ve.value="days",He.value=null}function ae(R){const O=new Date,F=O.getFullYear(),ne=O.getMonth(),Le=O.getDate();let dt,ct;if(Ge.value){const tt=X([...M.availableDates].filter(mt=>mt instanceof Date).map(mt=>new Date(mt.getFullYear(),mt.getMonth(),mt.getDate()))).sort((mt,an)=>mt.getTime()-an.getTime());if(tt.length===0)return null;if(R==="all")dt=tt[0],ct=tt[tt.length-1];else{const mt=parseInt(R.replace("last",""),10);if(mt<2||mt>5)return null;const an=tt.slice(-mt);if(an.length===0)return null;dt=an[0],ct=an[an.length-1]}}else{const tt=new Date(F,ne,Le);switch(R){case"today":dt=tt,ct=tt;break;case"lastWeek":dt=new Date(F,ne,Le-6),ct=tt;break;case"last15Days":dt=new Date(F,ne,Le-14),ct=tt;break;case"last30Days":dt=new Date(F,ne,Le-29),ct=tt;break;case"thisMonth":dt=new Date(F,ne,1),ct=tt;break;case"last3Months":dt=new Date(F,ne-3,1),ct=new Date(F,ne,0);break;case"last6Months":dt=new Date(F,ne-6,1),ct=new Date(F,ne,0);break;case"last12Months":dt=new Date(F,ne-12,1),ct=new Date(F,ne,0);break;case"lastYear":dt=new Date(F-1,0,1),ct=new Date(F-1,11,31);break;default:return null}}return{start:dt,end:ct}}function We(R){const O=ae(R);return O?pe(O.start,O.end):null}function ht(R){return We(R)!==null}function it(R){const O=We(R);O&&(L("update:modelValue",O),Gt())}function qe(R){He.value==="left"?Ce.value=R:He.value==="right"?U.value=R:f.value=R,Y()}function Bt(R){He.value==="left"?Q.value=R:He.value==="right"?me.value=R:be.value=R,Y()}function Mt(){f.value===0?(f.value=11,be.value--):f.value--}function Et(){f.value===11?(f.value=0,be.value++):f.value++}function wt(){Ce.value===0?(Ce.value=11,Q.value--):Ce.value--}function At(){Ce.value===11?(Ce.value=0,Q.value++):Ce.value++}function _t(){U.value===0?(U.value=11,me.value--):U.value--}function bn(){U.value===11?(U.value=0,me.value++):U.value++}function En(R){if(!Ye(R))return;const O=new Date(R.getFullYear(),R.getMonth(),R.getDate());if(K.value){L("update:modelValue",O),b();return}const F=st.value;if(!F.start&&!F.end){L("update:modelValue",{start:O,end:null}),H.value="end";return}if(F.start&&F.end){L("update:modelValue",{start:O,end:null}),H.value="end";return}if(H.value==="start"){let ne=O,Le=F.end;ne&&Le&&ne>Le&&([ne,Le]=[Le,ne]),L("update:modelValue",{start:ne||Le,end:Le||ne}),H.value="end"}else{let ne=F.start,Le=O;ne&&Le&&Le<ne&&([ne,Le]=[Le,ne]),L("update:modelValue",{start:ne||Le,end:Le||ne}),H.value="start"}}e.watch(st,()=>{M.doubleCalendar&&ze.value&&A.value&&Gt()},{deep:!0});let An=null,Dt=null,Qt=null;function tl(){An&&(document.removeEventListener("keydown",An),An=null),Dt&&(window.removeEventListener("resize",Dt),Dt=null),Qt&&(window.removeEventListener("scroll",Qt,!0),Qt=null)}return e.watch(ve,R=>{R==="years"&&e.nextTick(()=>{Me.value?.querySelector(`[data-year="${oe.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(A,R=>{tl(),R&&(An=O=>{O.key==="Escape"&&(ve.value==="years"||ve.value==="months"?Y():b())},Dt=()=>{zt()},Qt=()=>{zt()},document.addEventListener("keydown",An),window.addEventListener("resize",Dt),window.addEventListener("scroll",Qt,!0))}),e.onBeforeUnmount(()=>{tl()}),(R,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":T.mode==="readonly"}])},[T.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",Sa,[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:tn.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Va)])):K.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:O[0]||(O[0]=F=>S("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:vt,type:"text",class:"dss-datepicker__input",placeholder:M.placeholder||e.unref(de)("datepicker.selectDate"),value:xt.value,readonly:"",disabled:T.mode==="readonly"},null,8,Na)])):ze.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:q,onClick:O[1]||(O[1]=F=>S("start"))},[O[12]||(O[12]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputRangeRef",ref:Ue,type:"text",class:"dss-datepicker__input",placeholder:M.placeholder||e.unref(de)("datepicker.selectRange"),value:It.value,readonly:""},null,8,Ba)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[A.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(b,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Ee,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":T.doubleCalendar&&ze.value&&ve.value==="days","dss-datepicker__dropdown--quick-select":T.doubleCalendar&&ze.value&&ve.value==="days"&&T.quickSelect}]),onClick:O[9]||(O[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Ze.value)},[ve.value==="days"&&T.doubleCalendar&&ze.value?(e.openBlock(),e.createElementBlock("div",Ma,[T.quickSelect?(e.openBlock(),e.createElementBlock("nav",_a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt.value,F=>(e.openBlock(),e.createElementBlock("button",{key:F.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!ht(F.id),onClick:ne=>it(F.id)},e.toDisplayString(e.unref(de)(F.labelKey)),9,$a))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",La,[e.createElementVNode("div",Ta,[e.createElementVNode("div",Aa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:wt}," ‹ ",8,Da),e.createElementVNode("div",Ha,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[2]||(O[2]=F=>V("left","months"))},e.toDisplayString(Be.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[3]||(O[3]=F=>V("left","years"))},e.toDisplayString(Q.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:At}," › ",8,Ra)]),e.createElementVNode("div",Fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,F=>(e.openBlock(),e.createElementBlock("span",{key:F,class:"dss-datepicker__weekday"},e.toDisplayString(F),1))),128))]),e.createElementVNode("div",Ia,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(F,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+ne},[F?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Nt(F)]),disabled:!Ye(F),onClick:Le=>En(F),onMouseenter:Le=>on(F),onMouseleave:Ct},e.toDisplayString(F.getDate()),43,za)):(e.openBlock(),e.createElementBlock("span",Pa))],64))),128))])]),e.createElementVNode("div",Oa,[e.createElementVNode("div",Wa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:_t}," ‹ ",8,qa),e.createElementVNode("div",Za,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[4]||(O[4]=F=>V("right","months"))},e.toDisplayString(Xe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[5]||(O[5]=F=>V("right","years"))},e.toDisplayString(me.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:bn}," › ",8,Ua)]),e.createElementVNode("div",Xa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,F=>(e.openBlock(),e.createElementBlock("span",{key:F,class:"dss-datepicker__weekday"},e.toDisplayString(F),1))),128))]),e.createElementVNode("div",Ya,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,(F,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+ne},[F?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Nt(F)]),disabled:!Ye(F),onClick:Le=>En(F),onMouseenter:Le=>on(F),onMouseleave:Ct},e.toDisplayString(F.getDate()),43,ja)):(e.openBlock(),e.createElementBlock("span",Ka))],64))),128))])])])])):ve.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Ga,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:Mt}," ‹ ",8,Qa),e.createElementVNode("div",Ja,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[6]||(O[6]=F=>ve.value="months")},e.toDisplayString(fe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[7]||(O[7]=F=>ve.value="years")},e.toDisplayString(be.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:Et}," › ",8,es)]),e.createElementVNode("div",ts,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,F=>(e.openBlock(),e.createElementBlock("span",{key:F,class:"dss-datepicker__weekday"},e.toDisplayString(F),1))),128))]),e.createElementVNode("div",ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wt.value,(F,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ne},[F?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Nt(F)]),disabled:!Ye(F),onClick:Le=>En(F),onMouseenter:Le=>on(F),onMouseleave:Ct},e.toDisplayString(F.getDate()),43,ls)):(e.openBlock(),e.createElementBlock("span",os))],64))),128))])],64)):ve.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",as,[e.createElementVNode("div",ss,[e.createElementVNode("span",rs,e.toDisplayString(Fe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[8]||(O[8]=F=>ve.value="years")},e.toDisplayString(oe.value),1)])]),e.createElementVNode("div",is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(De.value,(F,ne)=>(e.openBlock(),e.createElementBlock("button",{key:ne,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":ne===Ot.value}]),onClick:Le=>qe(ne)},e.toDisplayString(F),11,cs))),128))])],64)):ve.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",us,[e.createElementVNode("span",ds,e.toDisplayString(kt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:Me},[e.createElementVNode("div",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zt.value,F=>(e.openBlock(),e.createElementBlock("button",{key:F,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":F===oe.value,"dss-datepicker__year-cell--current":F===e.unref(Ke)}]),"data-year":F,onClick:ne=>Bt(F)},e.toDisplayString(F),11,ps))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},fs=["data-chart-type"],vs={class:"dss-chart-header-titles"},gs={key:0,class:"dss-chart-title"},hs={key:1,class:"dss-chart-subtitle"},ys=["onClick","onMouseenter"],ks={class:"dss-legend-text"},Cs=["onClick","onMouseenter"],bs={class:"dss-legend-text"},ws=["title"],xs=["src"],Es={class:"dss-chart-area-wrapper"},Ss={key:0,class:"dss-chart-z-axis-label"},Vs=["width","height","data-smooth","data-animated"],Ns=["id"],Bs=["y","width","height"],Ms=["id"],_s=["d"],$s=["id"],Ls=["d"],Ts={key:0},As=["clip-path"],Ds=["x1","x2","y1","y2"],Hs={class:"dss-axes"},Rs=["x1","x2","y1","y2"],Fs=["x1","x2","y1","y2"],Is=["x1","x2","y1","y2"],zs={class:"dss-axis-labels"},Ps=["x","y"],Os=["x","y"],Ws=["x","y"],qs=["x","y"],Zs=["y","transform"],Us=["x","y","transform"],Xs={key:1,class:"dss-flag-markers"},Ys=["clip-path"],js=["x1","x2","y1","y2","onMouseover"],Ks=["x1","x2","y1","y2","onMouseover"],Gs=["x1","x2","y1","y2","onMouseover"],Qs=["cx","cy","onMouseover"],Js=["cx","cy","fill","onMouseover"],er=["x","y"],tr=["clip-path"],nr={key:0},lr=["d","onMouseover"],or=["x","y","width","height","fill","onMouseover"],ar={class:"dss-line-chart"},sr=["d","stroke","stroke-width","stroke-dasharray"],rr=["d","stroke","stroke-width","opacity"],ir=["cx","cy","r","fill","onMouseover"],cr={key:1},ur=["d","stroke","stroke-width","stroke-dasharray"],dr=["d","stroke","stroke-width","stroke-dasharray"],mr=["d","stroke","stroke-width","opacity"],pr=["cx","cy","r","fill","onMouseover"],fr={key:2},vr=["id"],gr=["x","y","width","height"],hr=["d","fill","fill-opacity","mask"],yr=["d","stroke","stroke-width"],kr=["d","fill","onMouseover"],Cr=["x","y","width","height","onMouseover"],br=["clip-path"],wr=["x1","x2","y1","y2","stroke"],xr=["cx","cy","r","fill"],Er={key:1,class:"dss-bubble-chart"},Sr={key:0,class:"dss-bubble-group"},Vr=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Nr=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Br=["transform"],Mr=["cx","cy","r"],_r=["data-chart-type","clip-path"],$r=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],Lr={key:1,class:"dss-radial-segment-data-labels"},Tr=["x","y"],Ar=["x","y","font-size","fill"],Dr=["x1","y1","x2","y2","stroke"],Hr=["x1","y1","x2","y2","stroke"],Rr=["x","y","text-anchor","font-size"],Fr=["transform"],Ir={key:0,class:"dss-spider-grid"},zr=["cx","cy","r"],Pr={class:"dss-spider-grid-labels"},Or=["x","y"],Wr=["x","y"],qr=["x1","x2","y1","y2"],Zr={class:"dss-spider-labels"},Ur=["x","y","text-anchor","dominant-baseline"],Xr=["points","fill","fill-opacity","stroke","stroke-width"],Yr=["cx","cy","r","fill","onMouseover"],jr={class:"dss-chart-logos"},Kr=["cx","cy","r","fill"],Gr=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Qr=["onClick","onMouseenter"],Jr=["src"],ei={class:"dss-marker-tooltip-category"},ti={key:0,class:"dss-marker-tooltip-description"},ni={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},li={class:"dss-tooltip-title dss-spider-tooltip-area-title"},oi={class:"dss-tooltip-series-name"},ai={class:"dss-tooltip-series-value"},si={key:1,class:"dss-tooltip-section"},ri={key:0,class:"dss-tooltip-title"},ii={class:"dss-bubble-tooltip-data"},ci={key:2,class:"dss-tooltip-section"},ui={class:"dss-tooltip-title"},di={class:"dss-tooltip-value"},mi={key:0,class:"dss-tooltip-section"},pi={class:"dss-tooltip-section-title"},fi={class:"dss-tooltip-group-header"},vi={class:"dss-tooltip-item-content"},gi={class:"dss-tooltip-item-text"},hi={key:1,class:"dss-tooltip-section"},yi={class:"dss-tooltip-section-title"},ki={class:"dss-tooltip-item-content"},Ci={class:"dss-tooltip-item-title"},bi={key:0,class:"dss-tooltip-item-description"},wi={class:"dss-tooltip-section"},xi={class:"dss-tooltip-title"},Ei={key:0,class:"dss-bubble-tooltip-data"},Si={class:"dss-tooltip-series-name"},Vi={class:"dss-tooltip-series-value"},Ni={key:0,class:"dss-tooltip-section"},Bi={class:"dss-tooltip-section-title"},Mi={class:"dss-tooltip-group-header"},_i={class:"dss-tooltip-item-content"},$i={class:"dss-tooltip-item-text"},Li={key:1,class:"dss-tooltip-section"},Ti={class:"dss-tooltip-section-title"},Ai={class:"dss-tooltip-item-content"},Di={class:"dss-tooltip-item-title"},Hi={key:0,class:"dss-tooltip-item-description"},Ri=["onClick","onMouseenter"],Fi={class:"dss-legend-text"},Ii={key:1,class:"dss-context-menu-separator"},zi={key:0,class:"dss-context-menu-separator"},Pi={key:0,class:"dss-context-menu-separator"},Oi=["onClick"],Wi=["innerHTML"],qi={key:0,class:"dss-context-menu-icon"},Zi={class:"dss-marker-modal-header"},Ui={class:"dss-marker-modal-body"},Xi={class:"dss-form-group"},Yi={class:"dss-form-group"},ji={for:"dss-marker-description"},Ki={key:0,class:"dss-form-text-display"},Gi=["placeholder"],Qi={class:"dss-marker-modal-footer"},Ji={class:"modal-footer-left"},ec={class:"dss-modal-footer-right"},tc=["disabled"],nc={name:"DSSChart"},lc=Object.assign(nc,{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:T=>typeof T=="object"&&T!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(T,{emit:le}){const{t:M,locale:L}=Jl.useI18n(),de=le,z=e.ref(null),A=e.ref(null),ve=e.ref(null),pt=e.ref(0),J=e.ref(0);let f=null,be=null;const Ce=20,Q=e.computed(()=>{if(J.value,pt.value,!z.value||!A.value)return 0;try{const t=z.value.getBoundingClientRect();return A.value.getBoundingClientRect().top-t.top}catch{return 0}}),U=e.computed(()=>`chart-clip-${H.chartId}`),me=e.computed(()=>`url(#${U.value})`),H=T,xe={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},miniRadial:{minVisiblePercent:1,trackColor:"#E5E7EB",thresholds:{low:33,medium:66},colors:{low:"#E53E3E",medium:"#ED8936",high:"#38A169"}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5},zoom:{enabled:!1,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function He(t,a){const n=Object.assign({},t);return vt(t)&&vt(a)&&Object.keys(a).forEach(i=>{vt(a[i])?i in t?n[i]=He(t[i],a[i]):Object.assign(n,{[i]:a[i]}):Object.assign(n,{[i]:a[i]})}),n}const et=()=>{let t=20,a=0,n=0;if(lt.value&&(t+=30),xt.value&&(t+=25),G.value&&H.series.length>0){const i=H.series.filter((p,g)=>!ot.value.has(g)).length;if(he.value==="top"||he.value==="bottom"){if(Be.value==="horizontal"){const g=Math.floor(Ee.value/100);a=Math.ceil(i/g)*25+10}else a=i*25+10;t+=a}else n=150}return{height:t,legendHeight:a,legendWidth:n}};function vt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const q=e.computed(()=>He(xe,H.options)),Ue=e.computed(()=>{const t=q.value;return t&&t.chart&&t.chart.width==="auto"}),Pe=e.computed(()=>{const t=q.value;return t&&t.chart&&t.chart.height==="auto"}),Ee=e.computed(()=>{const t=q.value;return Ue.value?pt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Me=e.ref(Ce),Ke=e.computed(()=>{if(Pe.value){const t=Ke.value;return t??Math.max(0,(J.value||400)-Me.value*5)}}),K=e.computed(()=>{const t=q.value;if(we.value==="mini-radial")return Ee.value;if(Pe.value){const a=Ke.value;return a??Math.max(0,(J.value||400)-Me.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),ze=e.computed(()=>{if(Pe.value&&we.value==="semi-radial"&&Ke.value!=null)return Me.value+K.value+"px";if(Pe.value)return"100%";if(kn.value)return Me.value+K.value+"px";if(G.value&&he.value==="bottom"){const t=et();return K.value+(t.legendHeight||35)+"px"}return K.value+(G.value?20:0)+"px"}),we=e.computed(()=>{const t=q.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),st=e.computed(()=>{const t=H.series.map(a=>a.type||we.value);return new Set(t).size>1}),lt=e.computed(()=>{const t=q.value;return t&&t.title&&t.title.text?t.title.text:""}),xt=e.computed(()=>{const t=q.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),It=e.computed(()=>{const t=q.value;if(!t||!t.zAxis)return"";const a=t.zAxis;return typeof a=="string"?a:a&&typeof a.label=="string"?a.label:""}),tn=e.computed(()=>{const t=q.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),Ot=e.computed(()=>{const t=q.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),oe=e.computed(()=>{const t=q.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),fe=e.computed(()=>{const t=oe.value;return t&&t.title&&t.title.text?t.title.text:""}),Fe=e.computed(()=>{const t=q.value;if(!t||!t.yAxis)return Vn;const a=t.yAxis.min;return typeof a=="number"||a===Vn?a:Vn}),De=e.computed(()=>{const t=q.value;if(!t||!t.yAxis)return Vn;const a=t.yAxis.max;return typeof a=="number"||a===Vn?a:Vn}),Zt=e.computed(()=>{const t=oe.value;if(!t)return Vn;const a=t.min;return typeof a=="number"||a===Vn?a:Vn}),kt=e.computed(()=>{const t=oe.value;if(!t)return Vn;const a=t.max;return typeof a=="number"||a===Vn?a:Vn}),Ut=e.computed(()=>{const t=q.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),St=e.computed(()=>{const t=q.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),Wt=e.computed(()=>{const t=q.value;return t&&t.grid&&t.grid.show!==!1}),G=e.computed(()=>{const t=q.value;return t&&t.legend&&t.legend.show!==!1}),he=e.computed(()=>{const t=q.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Be=e.computed(()=>{const t=q.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Xe=e.computed(()=>{const t=q.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Ge=e.computed(()=>{const t=q.value;if(!t||!t.crosshair)return!1;const a=t.crosshair.show;return a===!0||a==="true"}),Tt=e.computed(()=>{const t=q.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Qe=e.computed(()=>{const t=q.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),zt=e.computed(()=>{const t=q.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Ze=e.computed(()=>{const t=q.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),$e=e.computed(()=>{const t=q.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),rt=e.computed(()=>{if(!kn.value)return 0;const t=q.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),Vt=e.computed(()=>{const t=q.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),ee=e.computed(()=>{const{maxX:t}=Xt.value;return t===0}),Z=(t,a)=>ee.value&&a===0?5:a,X=t=>{const a=Number(t);return!Number.isFinite(a)||a<=0?0:a},pe=e.computed(()=>{const t=q.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),ke=e.computed(()=>{const t=q.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),Ye=e.computed(()=>{const t=q.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),Nt=e.computed(()=>{const t=q.value;return ke.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),on=e.computed(()=>{const t=q.value,a=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return a.length>0?a:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),Ct=e.computed(()=>{const t=q.value;return t&&t.animations&&t.animations.enabled!==!1}),Gt=e.computed(()=>{const t=q.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),S=e.computed(()=>{const t=q.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),b=e.computed(()=>{const t=q.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),V=e.computed(()=>{const t=q.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Y=e.computed(()=>{const t=q.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),ae=e.computed(()=>{const t=q.value;return t&&t.animations&&t.animations.onDataChange!==!1}),We=e.computed(()=>{const t=q.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),ht=e.computed(()=>{const t=q.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),it=e.computed(()=>q.value?.spider?.gridSteps||5),qe=e.computed(()=>{const t=[],a=it.value;for(let n=1;n<=a;n++)t.push(ut.value/a*n);return t}),Bt=t=>{const a=Mt.value;if(a&&Array.isArray(a)&&a[t]!==void 0)return a[t].toString();const n=qe.value[t];return Math.round(n/ut.value*100)+"%"},Mt=e.computed(()=>q.value?.spider?.gridLabels||null),Et=e.computed(()=>{const t=q.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),wt=e.computed(()=>{const t=q.value,a={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...a,...t.contextMenu.items}:a}),At=e.computed(()=>{const t=q.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),_t=e.computed(()=>{const t=q.value;return t&&t.markers&&t.markers.icon?t.markers.icon:an.value}),bn=e.computed(()=>{const t=q.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),En=e.computed(()=>{const t=q.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),An=e.computed(()=>{const a=q.value?.valueFormat?.extension;return typeof a=="string"?a:""}),Dt=t=>{const a=An.value;if(t==null)return"";const n=String(t);return a?n+a:n},Qt=e.computed(()=>!se.value.isZooming);e.computed(()=>Yt.value.map(t=>{if(t.categoryIndex!==void 0&&(Sn.value||jt.value)){const a=Kt(t.categoryIndex),n=Q.value+I.value.bottom-En.value/2;return{...t,x:a,y:n}}return t}));function tl(t,a){let n;if(t instanceof Date)n=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,C,w]=t.split("-"),P=Number(w?.length===2?`20${w}`:w);n=new Date(P,Number(C)-1,Number(g))}else return 0;let i=0,p=1/0;return a.forEach((g,C)=>{const[w,P,N]=g.split("-"),$=Number(N?.length===2?`20${N}`:N),B=new Date($,Number(P)-1,Number(w)),te=Math.abs(B-n);te<p&&(p=te,i=C)}),i}const R=e.computed(()=>{const t=H.markers.map(n=>{const i=tl(n.marker_date,H.categories),p=Kt(i),g=Q.value+I.value.bottom-En.value/2;return{...n,x:p,y:g,categoryIndex:i,source:"props"}}),a=Yt.value.map(n=>{if(n.categoryIndex!==void 0&&(Sn.value||jt.value)){const i=Kt(n.categoryIndex),p=Q.value+I.value.bottom-En.value/2;return{...n,x:i,y:p,source:"internal"}}return{...n,source:"internal"}});return[...t,...a]}),O=e.computed(()=>{const t=q.value;return t&&t.watermark&&t.watermark.enabled===!0}),F=e.computed(()=>{const t=q.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),ne=e.computed(()=>{const t=q.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),Le=e.computed(()=>{const t=q.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),dt=e.computed(()=>{const t={left:I.value.left,top:I.value.top,width:I.value.width,height:I.value.height};let a,n;const i=String(ne.value);if(i.includes("%")){const p=parseFloat(i)/100;a=t.width*p,n=a*(96/499)}else{const p=parseFloat(i)||25;a=Math.min(t.width*.25,200)*(p/25),n=a*(96/499)}return{width:a,height:n,area:t}}),ct=e.computed(()=>{const{width:t,height:a}=dt.value,n=Le.value;let i,p;const g=I.value.left,C=I.value.right,w=I.value.top,P=I.value.bottom,N=I.value.width,$=I.value.height;switch(n){case"center":i=g+(N-t)/2,p=w+($-a)/2;break;case"top-left":i=g+15,p=w+5;break;case"top-right":i=C-t-15,p=w+5;break;case"bottom-left":i=g+15,p=P-a-5;break;case"bottom-right":default:i=C-t-15,p=P-a-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${a}px`}}),tt=t=>!H.flags||!H.flags.length?[]:H.flags.filter(a=>a.categoryIndex===t),mt=t=>{const a=tt(t),n=dl(t),i=a.filter(C=>C.manual),p=a.filter(C=>!C.manual),g=[];return i.length>0&&g.push({type:M("chart.tooltip.manualFlags"),color:"#698dbe",flags:i.map(C=>({text:C.text,color:"#698dbe"}))}),p.length>0&&g.push({type:M("chart.tooltip.autoFlags"),color:"#a1d499",flags:p.map(C=>({text:C.text,color:"#a1d499"}))}),{flagGroups:g,markers:n.map(C=>({title:C.title,description:C.description,type:M("chart.tooltip.markers"),color:C.color||"#9784ba"}))}},an=e.computed(()=>{const t=H.old?`<svg width="55" height="56" viewBox="0 0 55 56" fill="none" xmlns="http://www.w3.org/2000/svg">
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),eo=require("vue-i18n"),Va={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},Na=["value"],Ba=["placeholder","value","disabled"],Ma=["placeholder","value"],_a={key:0,class:"dss-datepicker__double-wrap"},$a={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},La=["disabled","onClick"],Ta={class:"dss-datepicker__double-calendars"},Aa={class:"dss-datepicker__double-calendar"},Da={class:"dss-datepicker__calendar-header"},Ha=["aria-label"],Ra={class:"dss-datepicker__month-year-row"},Fa=["aria-label"],Ia={class:"dss-datepicker__weekdays"},za={class:"dss-datepicker__grid"},Pa=["disabled","onClick","onMouseenter"],Oa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},qa={class:"dss-datepicker__double-calendar"},Wa={class:"dss-datepicker__calendar-header"},Za=["aria-label"],Ua={class:"dss-datepicker__month-year-row"},Xa=["aria-label"],Ya={class:"dss-datepicker__weekdays"},ja={class:"dss-datepicker__grid"},Ka=["disabled","onClick","onMouseenter"],Ga={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Qa={class:"dss-datepicker__calendar-header"},Ja=["aria-label"],es={class:"dss-datepicker__month-year-row"},ts=["aria-label"],ns={class:"dss-datepicker__weekdays"},ls={class:"dss-datepicker__grid"},os=["disabled","onClick","onMouseenter"],as={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},ss={class:"dss-datepicker__calendar-header"},rs={class:"dss-datepicker__month-year-row"},is={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},cs={class:"dss-datepicker__months-grid"},us=["onClick"],ds={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},ms={class:"dss-datepicker__month-year"},ps={class:"dss-datepicker__years-grid"},fs=["data-year","onClick"],ia=27,Tl=8,ta={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:D=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(D)},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(D,{emit:le}){const M=D,L=le,{t:de,locale:I}=eo.useI18n(),T=e.ref(!1),fe=e.ref("days"),dt=new Date,ee=e.computed(()=>M.minDate instanceof Date?M.minDate:dt),f=e.ref(ee.value.getMonth()),be=e.ref(ee.value.getFullYear()),Ce=e.ref(ee.value.getMonth()),G=e.ref(ee.value.getFullYear()),U=e.ref(ee.value.getMonth()),me=e.ref(ee.value.getFullYear()),R=e.ref("start"),xe=e.ref(null),Ae=e.ref(null);function nt(){const A=ee.value,O=A.getMonth(),P=A.getFullYear(),ie=O===11?0:O+1,Te=O===11?P+1:P;return{left:{month:O,year:P},right:{month:ie,year:Te}}}const ft=e.ref(null),Z=e.ref(null),Ue=e.ref(null),qe=e.ref(null),Ee=e.ref(null),Me=e.ref(null),je=new Date().getFullYear(),Q=e.computed(()=>["single","singleFromAvailable"].includes(M.mode)),ze=e.computed(()=>["range","rangeFromAvailable"].includes(M.mode)),we=e.computed(()=>{if(M.mode!=="single"&&M.mode!=="singleFromAvailable")return null;const A=M.modelValue;return A instanceof Date?A:null}),it=e.computed(()=>{if(!ze.value)return{start:null,end:null};const A=M.modelValue;return!A||typeof A!="object"?{start:null,end:null}:{start:A.start instanceof Date?A.start:null,end:A.end instanceof Date?A.end:null}});function ot(A){if(!A||!(A instanceof Date))return"";const O=A.getDate(),P=A.getMonth()+1,ie=A.getFullYear(),Te=et=>String(et).padStart(2,"0");return`${Te(O)}/${Te(P)}/${ie}`}const bt=e.computed(()=>ot(we.value)),It=e.computed(()=>{const{start:A,end:O}=it.value;if(!A&&!O)return"";const P=!O||A&&A<=O?A:O,ie=!A||O&&O>=A?O:A;return K(P,ie)?ot(P):`${ot(P)} - ${ot(ie)}`}),en=e.computed(()=>{if(M.mode!=="readonly")return"—";const A=M.modelValue;if(A instanceof Date)return ot(A)||"—";if(A&&typeof A=="object"&&("start"in A||"end"in A)){const O=A.start instanceof Date?A.start:null,P=A.end instanceof Date?A.end:null;if(!O&&!P)return"—";const ie=!P||O&&O<=P?O:P,Te=!O||P&&P>=O?P:O;return K(ie,Te)?ot(ie):`${ot(ie)} - ${ot(Te)}`}return"—"});e.computed(()=>{const A=new Date(be.value,f.value,1);return new Intl.DateTimeFormat(I.value,{month:"long",year:"numeric"}).format(A)});const Pt=e.computed(()=>Ae.value==="left"?Ce.value:Ae.value==="right"?U.value:f.value),oe=e.computed(()=>Ae.value==="left"?G.value:Ae.value==="right"?me.value:be.value),ve=e.computed(()=>{const A=new Date(be.value,f.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(A)}),Fe=e.computed(()=>{const A=new Date(oe.value,Pt.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(A)}),De=e.computed(()=>{const A=new Intl.DateTimeFormat(I.value,{month:"short"});return Array.from({length:12},(O,P)=>A.format(new Date(2024,P,1)))}),Zt=e.computed(()=>{const O=(Ae.value?oe.value:be.value)-Math.floor(ia/2);return Array.from({length:ia},(P,ie)=>O+ie)}),yt=e.computed(()=>{const A=Zt.value;return A.length?`${A[0]} – ${A[A.length-1]}`:""}),Ut=e.computed(()=>{const A=new Intl.DateTimeFormat(I.value,{weekday:"short"}),O=new Date(2024,0,1),P=[];for(let ie=0;ie<7;ie++){const Te=new Date(O);Te.setDate(O.getDate()+ie),P.push(A.format(Te).slice(0,2))}return P});function xt(A,O){const P=new Date(A,O,1),ie=new Date(A,O+1,0),Te=P.getDay(),et=ie.getDate(),rt=[];for(let tt=0;tt<Te;tt++)rt.push(null);for(let tt=1;tt<=et;tt++)rt.push(new Date(A,O,tt));return rt}const Ot=e.computed(()=>xt(be.value,f.value)),J=e.computed(()=>xt(G.value,Ce.value)),he=e.computed(()=>xt(me.value,U.value));e.computed(()=>{const A=new Date(G.value,Ce.value,1);return new Intl.DateTimeFormat(I.value,{month:"long",year:"numeric"}).format(A)}),e.computed(()=>{const A=new Date(me.value,U.value,1);return new Intl.DateTimeFormat(I.value,{month:"long",year:"numeric"}).format(A)});const Be=e.computed(()=>{const A=new Date(G.value,Ce.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(A)}),Xe=e.computed(()=>{const A=new Date(me.value,U.value,1);return new Intl.DateTimeFormat(I.value,{month:"long"}).format(A)}),Ke=e.computed(()=>M.availableDates&&M.availableDates.length>0),Lt=e.computed(()=>Ke.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"}]),Ge=e.ref({top:0,left:0}),Dt=e.ref("left");let He=null;function Pe(){T.value&&e.nextTick(()=>{T.value&&(He!==null&&window.cancelAnimationFrame(He),He=window.requestAnimationFrame(()=>{He=null,Et()}))})}function Et(){if(!qe.value||!T.value)return;const A=qe.value.getBoundingClientRect(),O=window.innerWidth||document.documentElement.clientWidth,P=window.innerHeight||document.documentElement.clientHeight;let ie=A.left,Te=A.bottom+4;const et=Ee.value;if(et){const rt=et.offsetWidth,tt=et.offsetHeight;Dt.value==="right"||ie+rt>O-Tl?(Dt.value="right",ie=A.right-rt):Dt.value="left";const on=Math.max(Tl,O-rt-Tl);if(ie=Math.min(Math.max(ie,Tl),on),Te+tt>P-Tl){const An=A.top-4-tt;An>=Tl?Te=An:Te=Math.max(Tl,P-tt-Tl)}}Ge.value={top:Te,left:ie}}const St=e.computed(()=>!qe.value||!T.value?{}:{position:"fixed",left:`${Ge.value.left}px`,top:`${Ge.value.top}px`,zIndex:1002});function K(A,O){return!A||!O?!1:A.getFullYear()===O.getFullYear()&&A.getMonth()===O.getMonth()&&A.getDate()===O.getDate()}function W(A){return new Date(A.getFullYear(),A.getMonth(),A.getDate()).getTime()}function X(A){return!M.availableDates||!M.availableDates.length?!0:M.availableDates.some(O=>O instanceof Date&&K(O,A))}function pe(A){const O=W(A);return!(M.minDate instanceof Date&&O<W(M.minDate)||M.maxDate instanceof Date&&O>W(M.maxDate))}function ye(A){const O=new Date(A);return new Date(O.getFullYear(),O.getMonth(),O.getDate())}function Je(A){return A.filter(O=>pe(O))}function Tt(A,O){if(!(A instanceof Date)||!(O instanceof Date))return null;let P=W(A),ie=W(O);if(P>ie&&([P,ie]=[ie,P]),M.minDate instanceof Date){const Te=W(M.minDate);P=Math.max(P,Te),ie=Math.max(ie,Te)}if(M.maxDate instanceof Date){const Te=W(M.maxDate);P=Math.min(P,Te),ie=Math.min(ie,Te)}return P>ie?null:{start:ye(P),end:ye(ie)}}function mn(A){return!M.exceptDates||!M.exceptDates.length?!1:M.exceptDates.some(O=>O instanceof Date&&K(O,A))}function vt(A){return mn(A)?!1:["singleFromAvailable","rangeFromAvailable"].includes(M.mode)?X(A):pe(A)}function Gt(A){const O=we.value,P=it.value,ie=W(A),Te=ze.value&&P.start&&P.end&&ie>W(P.start)&&ie<W(P.end),et=ze.value&&P.start&&K(A,P.start),rt=ze.value&&P.end&&K(A,P.end),tt=et&&rt,Mt=Q.value&&O&&K(A,O)||et||rt;let on=!1;if(ze.value&&P.start&&!P.end&&xe.value){const An=W(P.start),Fn=W(xe.value),Qn=Math.min(An,Fn),En=Math.max(An,Fn);on=ie>Qn&&ie<En}return{"dss-datepicker__day--selected":Mt&&!tt,"dss-datepicker__day--range-start":et&&!tt,"dss-datepicker__day--range-end":rt&&!tt,"dss-datepicker__day--range-single":tt,"dss-datepicker__day--in-range":Te&&!et&&!rt,"dss-datepicker__day--in-range-preview":on&&!et&&!rt&&!Te,"dss-datepicker__day--disabled":!vt(A)}}function S(A){if(!ze.value)return;const O=it.value;if(!O.start||O.end){xe.value=null;return}if(!vt(A)){xe.value=null;return}xe.value=new Date(A.getFullYear(),A.getMonth(),A.getDate())}function b(){xe.value=null}function V(){if(!M.doubleCalendar||!ze.value)return;const A=it.value,{start:O,end:P}=A;if(O&&P){const et=O<=P?O:P,rt=O<=P?P:O,tt=et.getMonth(),Mt=et.getFullYear(),on=rt.getMonth(),An=rt.getFullYear();if(tt!==on||Mt!==An){const Fn=Ce.value===tt&&G.value===Mt,Qn=U.value===on&&me.value===An;if(Fn&&Qn)return;Ce.value=tt,G.value=Mt,U.value=on,me.value=An}else{const Fn=tt===0?11:tt-1,Qn=tt===0?Mt-1:Mt;Ce.value===Fn&&G.value===Qn&&U.value===tt&&me.value===Mt||(Ce.value=tt,G.value=Mt,tt===11?(U.value=0,me.value=Mt+1):(U.value=tt+1,me.value=Mt))}return}const ie=O||P;if(ie){const et=ie.getMonth(),rt=ie.getFullYear(),tt=Ce.value===et&&G.value===rt,Mt=U.value===et&&me.value===rt;if(tt||Mt)return;Ce.value=et,G.value=rt,et===11?(U.value=0,me.value=rt+1):(U.value=et+1,me.value=rt);return}const Te=nt();Ce.value=Te.left.month,G.value=Te.left.year,U.value=Te.right.month,me.value=Te.right.year}function Y(A="start"){if(M.mode==="readonly")return;R.value=A;const O=we.value,P=it.value;if(Q.value&&O)f.value=O.getMonth(),be.value=O.getFullYear();else if(ze.value)if(M.doubleCalendar)V();else{const ie=A==="start"&&P.start?P.start:P.end||P.start;ie&&(f.value=ie.getMonth(),be.value=ie.getFullYear())}qe.value=Q.value?ft.value?.closest(".dss-datepicker__input-wrap"):Z.value,fe.value="days",Ae.value=null,Dt.value="left",T.value=!0,Pe()}function ne(){fe.value="days",Ae.value=null,xe.value=null,T.value=!1}function Oe(A,O){Ae.value=A,fe.value=O}function mt(){fe.value="days",Ae.value=null}function ct(A){const O=new Date,P=O.getFullYear(),ie=O.getMonth(),Te=O.getDate();let et,rt;if(Ke.value){const tt=Je([...M.availableDates].filter(Mt=>Mt instanceof Date).map(Mt=>new Date(Mt.getFullYear(),Mt.getMonth(),Mt.getDate()))).sort((Mt,on)=>Mt.getTime()-on.getTime());if(tt.length===0)return null;if(A==="all")et=tt[0],rt=tt[tt.length-1];else{const Mt=parseInt(A.replace("last",""),10);if(Mt<2||Mt>5)return null;const on=tt.slice(-Mt);if(on.length===0)return null;et=on[0],rt=on[on.length-1]}}else{const tt=new Date(P,ie,Te);switch(A){case"today":et=tt,rt=tt;break;case"lastWeek":et=new Date(P,ie,Te-6),rt=tt;break;case"last15Days":et=new Date(P,ie,Te-14),rt=tt;break;case"last30Days":et=new Date(P,ie,Te-29),rt=tt;break;case"thisMonth":et=new Date(P,ie,1),rt=tt;break;case"last3Months":et=new Date(P,ie-3,1),rt=new Date(P,ie,0);break;case"last6Months":et=new Date(P,ie-6,1),rt=new Date(P,ie,0);break;case"last12Months":et=new Date(P,ie-12,1),rt=new Date(P,ie,0);break;case"lastYear":et=new Date(P-1,0,1),rt=new Date(P-1,11,31);break;default:return null}}return{start:et,end:rt}}function We(A){const O=ct(A);return O?Tt(O.start,O.end):null}function Vt(A){return We(A)!==null}function Nt(A){const O=We(A);O&&(L("update:modelValue",O),V())}function wt(A){Ae.value==="left"?Ce.value=A:Ae.value==="right"?U.value=A:f.value=A,mt()}function Ct(A){Ae.value==="left"?G.value=A:Ae.value==="right"?me.value=A:be.value=A,mt()}function At(){f.value===0?(f.value=11,be.value--):f.value--}function Bt(){f.value===11?(f.value=0,be.value++):f.value++}function bn(){Ce.value===0?(Ce.value=11,G.value--):Ce.value--}function Tn(){Ce.value===11?(Ce.value=0,G.value++):Ce.value++}function ol(){U.value===0?(U.value=11,me.value--):U.value--}function qt(){U.value===11?(U.value=0,me.value++):U.value++}function ln(A){if(!vt(A))return;const O=new Date(A.getFullYear(),A.getMonth(),A.getDate());if(Q.value){L("update:modelValue",O),ne();return}const P=it.value;if(!P.start&&!P.end){L("update:modelValue",{start:O,end:null}),R.value="end";return}if(P.start&&P.end){L("update:modelValue",{start:O,end:null}),R.value="end";return}if(R.value==="start"){let ie=O,Te=P.end;ie&&Te&&ie>Te&&([ie,Te]=[Te,ie]),L("update:modelValue",{start:ie||Te,end:Te||ie}),R.value="end"}else{let ie=P.start,Te=O;ie&&Te&&Te<ie&&([ie,Te]=[Te,ie]),L("update:modelValue",{start:ie||Te,end:Te||ie}),R.value="start"}}e.watch(it,()=>{M.doubleCalendar&&ze.value&&T.value&&V()},{deep:!0});let On=null,qn=null,Rn=null;function Nn(){On&&(document.removeEventListener("keydown",On),On=null),qn&&(window.removeEventListener("resize",qn),qn=null),Rn&&(window.removeEventListener("scroll",Rn,!0),Rn=null)}return e.watch(fe,A=>{A==="years"&&e.nextTick(()=>{Me.value?.querySelector(`[data-year="${oe.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[T.value,fe.value,f.value,be.value,Ce.value,G.value,U.value,me.value,Ae.value,M.doubleCalendar,M.quickSelect],()=>{Pe()}),e.watch(T,A=>{Nn(),A&&(On=O=>{O.key==="Escape"&&(fe.value==="years"||fe.value==="months"?mt():ne())},qn=()=>{Et()},Rn=()=>{Et()},document.addEventListener("keydown",On),window.addEventListener("resize",qn),window.addEventListener("scroll",Rn,!0))}),e.onBeforeUnmount(()=>{He!==null&&(window.cancelAnimationFrame(He),He=null),Nn()}),(A,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":D.mode==="readonly"}])},[D.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",Va,[O[10]||(O[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:en.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Na)])):Q.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:O[0]||(O[0]=P=>Y("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:ft,type:"text",class:"dss-datepicker__input",placeholder:M.placeholder||e.unref(de)("datepicker.selectDate"),value:bt.value,readonly:"",disabled:D.mode==="readonly"},null,8,Ba)])):ze.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:Z,onClick:O[1]||(O[1]=P=>Y("start"))},[O[12]||(O[12]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputRangeRef",ref:Ue,type:"text",class:"dss-datepicker__input",placeholder:M.placeholder||e.unref(de)("datepicker.selectRange"),value:It.value,readonly:""},null,8,Ma)],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(ne,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Ee,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":D.doubleCalendar&&ze.value&&fe.value==="days","dss-datepicker__dropdown--quick-select":D.doubleCalendar&&ze.value&&fe.value==="days"&&D.quickSelect}]),onClick:O[9]||(O[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(St.value)},[fe.value==="days"&&D.doubleCalendar&&ze.value?(e.openBlock(),e.createElementBlock("div",_a,[D.quickSelect?(e.openBlock(),e.createElementBlock("nav",$a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lt.value,P=>(e.openBlock(),e.createElementBlock("button",{key:P.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!Vt(P.id),onClick:ie=>Nt(P.id)},e.toDisplayString(e.unref(de)(P.labelKey)),9,La))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Ta,[e.createElementVNode("div",Aa,[e.createElementVNode("div",Da,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:bn}," ‹ ",8,Ha),e.createElementVNode("div",Ra,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[2]||(O[2]=P=>Oe("left","months"))},e.toDisplayString(Be.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[3]||(O[3]=P=>Oe("left","years"))},e.toDisplayString(G.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:Tn}," › ",8,Fa)]),e.createElementVNode("div",Ia,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,P=>(e.openBlock(),e.createElementBlock("span",{key:P,class:"dss-datepicker__weekday"},e.toDisplayString(P),1))),128))]),e.createElementVNode("div",za,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.value,(P,ie)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+ie},[P?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Gt(P)]),disabled:!vt(P),onClick:Te=>ln(P),onMouseenter:Te=>S(P),onMouseleave:b},e.toDisplayString(P.getDate()),43,Pa)):(e.openBlock(),e.createElementBlock("span",Oa))],64))),128))])]),e.createElementVNode("div",qa,[e.createElementVNode("div",Wa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:ol}," ‹ ",8,Za),e.createElementVNode("div",Ua,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[4]||(O[4]=P=>Oe("right","months"))},e.toDisplayString(Xe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[5]||(O[5]=P=>Oe("right","years"))},e.toDisplayString(me.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:qt}," › ",8,Xa)]),e.createElementVNode("div",Ya,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,P=>(e.openBlock(),e.createElementBlock("span",{key:P,class:"dss-datepicker__weekday"},e.toDisplayString(P),1))),128))]),e.createElementVNode("div",ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,(P,ie)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+ie},[P?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Gt(P)]),disabled:!vt(P),onClick:Te=>ln(P),onMouseenter:Te=>S(P),onMouseleave:b},e.toDisplayString(P.getDate()),43,Ka)):(e.openBlock(),e.createElementBlock("span",Ga))],64))),128))])])])])):fe.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Qa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.prevMonth"),onClick:At}," ‹ ",8,Ja),e.createElementVNode("div",es,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[6]||(O[6]=P=>fe.value="months")},e.toDisplayString(ve.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[7]||(O[7]=P=>fe.value="years")},e.toDisplayString(be.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(de)("datepicker.nextMonth"),onClick:Bt}," › ",8,ts)]),e.createElementVNode("div",ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,P=>(e.openBlock(),e.createElementBlock("span",{key:P,class:"dss-datepicker__weekday"},e.toDisplayString(P),1))),128))]),e.createElementVNode("div",ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ot.value,(P,ie)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ie},[P?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Gt(P)]),disabled:!vt(P),onClick:Te=>ln(P),onMouseenter:Te=>S(P),onMouseleave:b},e.toDisplayString(P.getDate()),43,os)):(e.openBlock(),e.createElementBlock("span",as))],64))),128))])],64)):fe.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",ss,[e.createElementVNode("div",rs,[e.createElementVNode("span",is,e.toDisplayString(Fe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[8]||(O[8]=P=>fe.value="years")},e.toDisplayString(oe.value),1)])]),e.createElementVNode("div",cs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(De.value,(P,ie)=>(e.openBlock(),e.createElementBlock("button",{key:ie,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":ie===Pt.value}]),onClick:Te=>wt(ie)},e.toDisplayString(P),11,us))),128))])],64)):fe.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",ds,[e.createElementVNode("span",ms,e.toDisplayString(yt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:Me},[e.createElementVNode("div",ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zt.value,P=>(e.openBlock(),e.createElementBlock("button",{key:P,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":P===oe.value,"dss-datepicker__year-cell--current":P===e.unref(je)}]),"data-year":P,onClick:ie=>Ct(P)},e.toDisplayString(P),11,fs))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},vs=["data-chart-type"],gs={class:"dss-chart-header-titles"},hs={key:0,class:"dss-chart-title"},ys={key:1,class:"dss-chart-subtitle"},ks=["onClick","onMouseenter"],Cs={class:"dss-legend-text"},bs=["onClick","onMouseenter"],ws={class:"dss-legend-text"},xs=["title"],Es=["src"],Ss={class:"dss-chart-area-wrapper"},Vs={key:0,class:"dss-chart-z-axis-label"},Ns=["width","height","data-smooth","data-animated"],Bs=["id"],Ms=["y","width","height"],_s=["id"],$s=["d"],Ls=["id"],Ts=["d"],As={key:0},Ds=["clip-path"],Hs=["x1","x2","y1","y2"],Rs={class:"dss-axes"},Fs=["x1","x2","y1","y2"],Is=["x1","x2","y1","y2"],zs=["x1","x2","y1","y2"],Ps={class:"dss-axis-labels"},Os=["x","y"],qs=["x","y"],Ws=["x","y"],Zs=["x","y"],Us=["y","transform"],Xs=["x","y","transform"],Ys={key:1,class:"dss-flag-markers"},js=["clip-path"],Ks=["x1","x2","y1","y2","onMouseover"],Gs=["x1","x2","y1","y2","onMouseover"],Qs=["x1","x2","y1","y2","onMouseover"],Js=["cx","cy","onMouseover"],er=["cx","cy","fill","onMouseover"],tr=["x","y"],nr=["clip-path"],lr={key:0},or=["d","onMouseover"],ar=["x","y","width","height","fill","onMouseover"],sr={class:"dss-line-chart"},rr=["d","stroke","stroke-width","stroke-dasharray"],ir=["d","stroke","stroke-width","opacity"],cr=["cx","cy","r","fill","onMouseover"],ur={key:1},dr=["d","stroke","stroke-width","stroke-dasharray"],mr=["d","stroke","stroke-width","stroke-dasharray"],pr=["d","stroke","stroke-width","opacity"],fr=["cx","cy","r","fill","onMouseover"],vr={key:2},gr=["id"],hr=["x","y","width","height"],yr=["d","fill","fill-opacity","mask"],kr=["d","stroke","stroke-width"],Cr=["d","fill","onMouseover"],br=["x","y","width","height","onMouseover"],wr=["clip-path"],xr=["x1","x2","y1","y2","stroke"],Er=["cx","cy","r","fill"],Sr={key:1,class:"dss-bubble-chart"},Vr={key:0,class:"dss-bubble-group"},Nr=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Br=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Mr=["transform"],_r=["cx","cy","r"],$r=["data-chart-type","clip-path"],Lr=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],Tr={key:1,class:"dss-radial-segment-data-labels"},Ar=["x","y"],Dr=["x","y","font-size","fill"],Hr=["x1","y1","x2","y2","stroke"],Rr=["x1","y1","x2","y2","stroke"],Fr=["x","y","text-anchor","font-size"],Ir=["transform"],zr={key:0,class:"dss-spider-grid"},Pr=["cx","cy","r"],Or={class:"dss-spider-grid-labels"},qr=["x","y"],Wr=["x","y"],Zr=["x1","x2","y1","y2"],Ur={class:"dss-spider-labels"},Xr=["x","y","text-anchor","dominant-baseline"],Yr=["points","fill","fill-opacity","stroke","stroke-width"],jr=["cx","cy","r","fill","onMouseover"],Kr={class:"dss-chart-logos"},Gr=["cx","cy","r","fill"],Qr=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Jr=["onClick","onMouseenter"],ei=["src"],ti={class:"dss-marker-tooltip-category"},ni={key:0,class:"dss-marker-tooltip-description"},li={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},oi={class:"dss-tooltip-title dss-spider-tooltip-area-title"},ai={class:"dss-tooltip-series-name"},si={class:"dss-tooltip-series-value"},ri={key:1,class:"dss-tooltip-section"},ii={key:0,class:"dss-tooltip-title"},ci={class:"dss-bubble-tooltip-data"},ui={key:2,class:"dss-tooltip-section"},di={class:"dss-tooltip-title"},mi={class:"dss-tooltip-value"},pi={key:0,class:"dss-tooltip-section"},fi={class:"dss-tooltip-section-title"},vi={class:"dss-tooltip-group-header"},gi={class:"dss-tooltip-item-content"},hi={class:"dss-tooltip-item-text"},yi={key:1,class:"dss-tooltip-section"},ki={class:"dss-tooltip-section-title"},Ci={class:"dss-tooltip-item-content"},bi={class:"dss-tooltip-item-title"},wi={key:0,class:"dss-tooltip-item-description"},xi={class:"dss-tooltip-section"},Ei={class:"dss-tooltip-title"},Si={key:0,class:"dss-bubble-tooltip-data"},Vi={class:"dss-tooltip-series-name"},Ni={class:"dss-tooltip-series-value"},Bi={key:0,class:"dss-tooltip-section"},Mi={class:"dss-tooltip-section-title"},_i={class:"dss-tooltip-group-header"},$i={class:"dss-tooltip-item-content"},Li={class:"dss-tooltip-item-text"},Ti={key:1,class:"dss-tooltip-section"},Ai={class:"dss-tooltip-section-title"},Di={class:"dss-tooltip-item-content"},Hi={class:"dss-tooltip-item-title"},Ri={key:0,class:"dss-tooltip-item-description"},Fi=["onClick","onMouseenter"],Ii={class:"dss-legend-text"},zi={key:1,class:"dss-context-menu-separator"},Pi={key:0,class:"dss-context-menu-separator"},Oi={key:0,class:"dss-context-menu-separator"},qi=["onClick"],Wi=["innerHTML"],Zi={key:0,class:"dss-context-menu-icon"},Ui={class:"dss-marker-modal-header"},Xi={class:"dss-marker-modal-body"},Yi={class:"dss-form-group"},ji={class:"dss-form-group"},Ki={for:"dss-marker-description"},Gi={key:0,class:"dss-form-text-display"},Qi=["placeholder"],Ji={class:"dss-marker-modal-footer"},ec={class:"modal-footer-left"},tc={class:"dss-modal-footer-right"},nc=["disabled"],lc={name:"DSSChart"},oc=Object.assign(lc,{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:D=>typeof D=="object"&&D!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(D,{emit:le}){const{t:M,locale:L}=eo.useI18n(),de=le,I=e.ref(null),T=e.ref(null),fe=e.ref(null),dt=e.ref(0),ee=e.ref(0);let f=null,be=null;const Ce=20,G=e.computed(()=>{if(ee.value,dt.value,!I.value||!T.value)return 0;try{const t=I.value.getBoundingClientRect();return T.value.getBoundingClientRect().top-t.top}catch{return 0}}),U=e.computed(()=>`chart-clip-${R.chartId}`),me=e.computed(()=>`url(#${U.value})`),R=D,xe={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},miniRadial:{minVisiblePercent:1,trackColor:"#E5E7EB",thresholds:{low:33,medium:66},colors:{low:"#E53E3E",medium:"#ED8936",high:"#38A169"}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5},zoom:{enabled:!1,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function Ae(t,a){const n=Object.assign({},t);return ft(t)&&ft(a)&&Object.keys(a).forEach(i=>{ft(a[i])?i in t?n[i]=Ae(t[i],a[i]):Object.assign(n,{[i]:a[i]}):Object.assign(n,{[i]:a[i]})}),n}const nt=()=>{let t=20,a=0,n=0;if(ot.value&&(t+=30),bt.value&&(t+=25),J.value&&R.series.length>0){const i=R.series.filter((p,g)=>!at.value.has(g)).length;if(he.value==="top"||he.value==="bottom"){if(Be.value==="horizontal"){const g=Math.floor(Ee.value/100);a=Math.ceil(i/g)*25+10}else a=i*25+10;t+=a}else n=150}return{height:t,legendHeight:a,legendWidth:n}};function ft(t){return t&&typeof t=="object"&&!Array.isArray(t)}const Z=e.computed(()=>Ae(xe,R.options)),Ue=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.width==="auto"}),qe=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.height==="auto"}),Ee=e.computed(()=>{const t=Z.value;return Ue.value?dt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Me=e.ref(Ce),je=e.computed(()=>{if(qe.value){const t=je.value;return t??Math.max(0,(ee.value||400)-Me.value*5)}}),Q=e.computed(()=>{const t=Z.value;if(we.value==="mini-radial")return Ee.value;if(qe.value){const a=je.value;return a??Math.max(0,(ee.value||400)-Me.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),ze=e.computed(()=>{if(qe.value&&we.value==="semi-radial"&&je.value!=null)return Me.value+Q.value+"px";if(qe.value)return"100%";if(kn.value)return Me.value+Q.value+"px";if(J.value&&he.value==="bottom"){const t=nt();return Q.value+(t.legendHeight||35)+"px"}return Q.value+(J.value?20:0)+"px"}),we=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),it=e.computed(()=>{const t=R.series.map(a=>a.type||we.value);return new Set(t).size>1}),ot=e.computed(()=>{const t=Z.value;return t&&t.title&&t.title.text?t.title.text:""}),bt=e.computed(()=>{const t=Z.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),It=e.computed(()=>{const t=Z.value;if(!t||!t.zAxis)return"";const a=t.zAxis;return typeof a=="string"?a:a&&typeof a.label=="string"?a.label:""}),en=e.computed(()=>{const t=Z.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),Pt=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),oe=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),ve=e.computed(()=>{const t=oe.value;return t&&t.title&&t.title.text?t.title.text:""}),Fe=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return Vn;const a=t.yAxis.min;return typeof a=="number"||a===Vn?a:Vn}),De=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return Vn;const a=t.yAxis.max;return typeof a=="number"||a===Vn?a:Vn}),Zt=e.computed(()=>{const t=oe.value;if(!t)return Vn;const a=t.min;return typeof a=="number"||a===Vn?a:Vn}),yt=e.computed(()=>{const t=oe.value;if(!t)return Vn;const a=t.max;return typeof a=="number"||a===Vn?a:Vn}),Ut=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),xt=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),Ot=e.computed(()=>{const t=Z.value;return t&&t.grid&&t.grid.show!==!1}),J=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.show!==!1}),he=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Be=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Xe=e.computed(()=>{const t=Z.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Ke=e.computed(()=>{const t=Z.value;if(!t||!t.crosshair)return!1;const a=t.crosshair.show;return a===!0||a==="true"}),Lt=e.computed(()=>{const t=Z.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Ge=e.computed(()=>{const t=Z.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Dt=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),He=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}),Et=e.computed(()=>{if(!kn.value)return 0;const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),St=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}=Xt.value;return t===0}),W=(t,a)=>K.value&&a===0?5:a,X=t=>{const a=Number(t);return!Number.isFinite(a)||a<=0?0:a},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}),ye=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}),Tt=e.computed(()=>{const t=Z.value;return ye.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),mn=e.computed(()=>{const t=Z.value,a=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return a.length>0?a:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),vt=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.enabled!==!1}),Gt=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),S=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),b=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),V=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Y=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),ne=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Oe=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),mt=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),ct=e.computed(()=>Z.value?.spider?.gridSteps||5),We=e.computed(()=>{const t=[],a=ct.value;for(let n=1;n<=a;n++)t.push(ut.value/a*n);return t}),Vt=t=>{const a=Nt.value;if(a&&Array.isArray(a)&&a[t]!==void 0)return a[t].toString();const n=We.value[t];return Math.round(n/ut.value*100)+"%"},Nt=e.computed(()=>Z.value?.spider?.gridLabels||null),wt=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Ct=e.computed(()=>{const t=Z.value,a={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...a,...t.contextMenu.items}:a}),At=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Bt=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.icon?t.markers.icon:rt.value}),bn=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Tn=e.computed(()=>{const t=Z.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),ol=e.computed(()=>{const a=Z.value?.valueFormat?.extension;return typeof a=="string"?a:""}),qt=t=>{const a=ol.value;if(t==null)return"";const n=String(t);return a?n+a:n},ln=e.computed(()=>!ae.value.isZooming);e.computed(()=>Yt.value.map(t=>{if(t.categoryIndex!==void 0&&(Sn.value||jt.value)){const a=Kt(t.categoryIndex),n=G.value+F.value.bottom-Tn.value/2;return{...t,x:a,y:n}}return t}));function On(t,a){let n;if(t instanceof Date)n=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,C,w]=t.split("-"),z=Number(w?.length===2?`20${w}`:w);n=new Date(z,Number(C)-1,Number(g))}else return 0;let i=0,p=1/0;return a.forEach((g,C)=>{const[w,z,N]=g.split("-"),$=Number(N?.length===2?`20${N}`:N),B=new Date($,Number(z)-1,Number(w)),te=Math.abs(B-n);te<p&&(p=te,i=C)}),i}const qn=e.computed(()=>{const t=R.markers.map(n=>{const i=On(n.marker_date,R.categories),p=Kt(i),g=G.value+F.value.bottom-Tn.value/2;return{...n,x:p,y:g,categoryIndex:i,source:"props"}}),a=Yt.value.map(n=>{if(n.categoryIndex!==void 0&&(Sn.value||jt.value)){const i=Kt(n.categoryIndex),p=G.value+F.value.bottom-Tn.value/2;return{...n,x:i,y:p,source:"internal"}}return{...n,source:"internal"}});return[...t,...a]}),Rn=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.enabled===!0}),Nn=e.computed(()=>{const t=Z.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),A=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),O=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),P=e.computed(()=>{const t={left:F.value.left,top:F.value.top,width:F.value.width,height:F.value.height};let a,n;const i=String(A.value);if(i.includes("%")){const p=parseFloat(i)/100;a=t.width*p,n=a*(96/499)}else{const p=parseFloat(i)||25;a=Math.min(t.width*.25,200)*(p/25),n=a*(96/499)}return{width:a,height:n,area:t}}),ie=e.computed(()=>{const{width:t,height:a}=P.value,n=O.value;let i,p;const g=F.value.left,C=F.value.right,w=F.value.top,z=F.value.bottom,N=F.value.width,$=F.value.height;switch(n){case"center":i=g+(N-t)/2,p=w+($-a)/2;break;case"top-left":i=g+15,p=w+5;break;case"top-right":i=C-t-15,p=w+5;break;case"bottom-left":i=g+15,p=z-a-5;break;case"bottom-right":default:i=C-t-15,p=z-a-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${a}px`}}),Te=t=>!R.flags||!R.flags.length?[]:R.flags.filter(a=>a.categoryIndex===t),et=t=>{const a=Te(t),n=fl(t),i=a.filter(C=>C.manual),p=a.filter(C=>!C.manual),g=[];return i.length>0&&g.push({type:M("chart.tooltip.manualFlags"),color:"#698dbe",flags:i.map(C=>({text:C.text,color:"#698dbe"}))}),p.length>0&&g.push({type:M("chart.tooltip.autoFlags"),color:"#a1d499",flags:p.map(C=>({text:C.text,color:"#a1d499"}))}),{flagGroups:g,markers:n.map(C=>({title:C.title,description:C.description,type:M("chart.tooltip.markers"),color:C.color||"#9784ba"}))}},rt=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">
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)}`}),Dn=e.computed(()=>{const t=H.old?`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
18
+ </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),tt=e.computed(()=>{const t=R.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)}`}),Hn=e.computed(()=>{const t=q.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),On=e.computed(()=>{const t=q.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=q.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const gl=e.computed(()=>{const t=q.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),El=e.computed(()=>{const t=q.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),Pl=e.computed(()=>{const t=q.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Rn=e.computed(()=>{const a=q.value?.radialBar?.dataLabels;return a&&(a.show===!0||a.enabled===!0)}),lo=e.computed(()=>{const a=q.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof a=="number"&&a>=0?a:20}),Ol=e.computed(()=>{const a=q.value?.radialBar?.dataCenter;return Hl.value?!0:zn.value&&a&&(a.show===!0||a.enabled===!0)}),Ll=e.computed(()=>{if(!Ol.value||!nt.value.length)return"";if(Hl.value){const i=nt.value[1]??nt.value[0];return Dt(i?.value??0)}const n=q.value?.radialBar?.dataCenter?.showValueOnly===!0?nt.value[0]?.value??0:nt.value.reduce((i,p)=>i+(p.value??0),0);return Dt(n)}),Wl=e.computed(()=>{const a=q.value?.radialBar?.dataCenter?.fontSize;return typeof a=="number"&&a>0?a:24}),cl=e.computed(()=>({x:Rt.value,y:Hl.value?bt.value:bt.value-Wl.value/2})),Sl=e.computed(()=>{const a=q.value?.radialBar?.dataCenter?.color;return typeof a=="string"&&a?a:"#333"}),oo=e.computed(()=>{if(!Rn.value||!kn.value||!nt.value.length)return[];const t=lo.value*Math.PI/180,a=(qt.value+ut.value)/2;return nt.value.map(n=>{const p=n.endAngle-n.startAngle>=t&&!n.isHidden,g=Rt.value+Math.cos(n.midAngle)*a,C=bt.value+Math.sin(n.midAngle)*a;return{value:Dt(n.value),x:g,y:C,show:p,color:n.color,contrastColor:d(n.color)}})}),Kn=e.computed(()=>{if(!H.flags||!H.flags.length)return[];const t=new Map;return H.flags.forEach(a=>{const n=a.categoryIndex;t.has(n)||t.set(n,[]),t.get(n).push(a)}),Array.from(t.entries()).map(([a,n])=>{const i=Kt(a),p=n.filter(C=>C.manual),g=n.filter(C=>!C.manual);return{categoryIndex:parseInt(a),x:i,flags:n,manualCount:p.length,autoCount:g.length,totalCount:n.length,hasManual:p.length>0,hasAuto:g.length>0,texts:n.map(C=>C.text).join(`
45
- `)}})}),yn=e.ref({show:!1,x:0,y:0,content:"",count:0}),Jt=e.computed(()=>q.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),sn=e.computed(()=>{const t=q.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),nl=e.computed(()=>q.value?.bubbles?.tooltip?.formatters||{}),ot=e.ref(new Set),ce=e.ref(null),ul=e.ref(!1),yt=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),pn=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),at=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),gt=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),se=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Yt=e.ref([]),Te=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 bn.value&&t.push(...Object.keys(bn.value)),t}),e.computed(()=>{if(!H.categories||H.categories.length===0){const{maxX:t}=Xt.value;return Array.from({length:t+1},(a,n)=>M("chart.fallback.item",{number:n+1}))}return H.categories});const ao=e.computed(()=>{if(!H.categories||H.categories.length===0)return null;const t=H.categories[0],[a,n,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),C=Number(n)-1;return!g||!n||!p?null:new Date(p,C,g)}),rn=e.computed(()=>{if(!H.categories||H.categories.length===0)return null;const t=H.categories[H.categories.length-1],[a,n,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),C=Number(n)-1;return!g||!n||!p?null:new Date(p,C,g)}),Nn=e.computed(()=>Te.value.editingMarkerId!==null),nn=e.computed(()=>Te.value.readonly),Fn=t=>{ot.value.has(t)||(Ko.value=!0,ce.value=t)},un=()=>{Ko.value=!1,ce.value=null},In=t=>{if(ko.value||Ho.value){at.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top,g=jt.value?i>=I.value.left-50&&i<=I.value.right+50&&p>=I.value.top-50&&p<=I.value.bottom+100:i>=I.value.left&&i<=I.value.right&&p>=I.value.top&&p<=I.value.bottom;if(ul.value=g,jt.value){if(!Ge.value||!g||se.value.isDragging||se.value.isZooming){at.value.show=!1;return}if(j.value.find(ue=>!ue||ue.isHidden?!1:Math.sqrt(Math.pow(ue.x-i,2)+Math.pow(ue.y-p,2))<=ue.radius+3))at.value.show=!1;else{const ue=j.value.filter(ye=>!ye||ye.isHidden?!1:Math.sqrt(Math.pow(ye.x-i,2)+Math.pow(ye.y-p,2))<=250);if(ue.length>0){let ye=ue[0],Ne=Math.sqrt(Math.pow(ye.x-i,2)+Math.pow(ye.y-p,2));ue.forEach(Oe=>{const Ae=Math.sqrt(Math.pow(Oe.x-i,2)+Math.pow(Oe.y-p,2));Ae<Ne&&(Ne=Ae,ye=Oe)});const ge=30,Je=j.value.filter(Oe=>!Oe||Oe.isHidden?!1:Math.abs(Oe.x-ye.x)<=ge).sort((Oe,Ae)=>Oe.y-Ae.y);at.value={show:!0,x:ye.x,categoryIndex:Math.round(ye.originalX),data:(()=>{const Oe=Jt.value,Ae=sn.value,_e=[];return Je.forEach(Re=>{Oe.forEach($t=>{const Pt=Ae[$t]||$t,Yn=rl($t,Re);Yn&&_e.push({seriesName:Re.seriesName,label:Re.label,value:`${Pt}: ${Yn}`,color:Re.color,y:Re.y})})}),_e})()}}else at.value.show=!1}return}if(se.value.isDragging&&se.value.scale>1&&Sn.value&&Qe.value){at.value.show=!1;const je=t.clientX-se.value.lastMouseX,{minX:ue,maxX:ye}=Xt.value,Ne=ye-ue||1,Je=je*.8;se.value.offsetX+=Je;const Oe=Ne/se.value.scale,Ae=Ne-Oe,_e=0,Re=-Ae/Ne*I.value.width,$t=_e;se.value.offsetX=Math.max(Re,Math.min($t,se.value.offsetX)),se.value.lastMouseX=t.clientX,se.value.lastMouseY=t.clientY;return}if(!Ge.value||!Sn.value||se.value.isDragging||se.value.isZooming||!g){at.value.show=!1;return}const{minX:C,maxX:w}=Xt.value,P=w-C||1,N=P/se.value.scale,$=C-se.value.offsetX/I.value.width*P,B=(i-I.value.left)/I.value.width,te=$+B*N,Se=Math.round(te);if(Se>=0&&Se<=w){const je=Kt(Se),ue=Jn.value.map((ye,Ne)=>{const ge=H.series.findIndex(Oe=>Oe===ye),Je=ye.data[Se];return{seriesName:ye.name,value:Je!==void 0?Je:null,color:c(ge),y:Je!==void 0?xn(ye,Je):null}}).filter(ye=>ye.value!==null);at.value={show:!0,x:je,categoryIndex:Se,data:ue}}},Tl=()=>{at.value.show=!1,ul.value=!1,Ho.value=!1,ko.value||(yn.value.show=!1),se.value.isDragging&&(se.value.isDragging=!1),se.value.zoomTimeout&&(clearTimeout(se.value.zoomTimeout),se.value.zoomTimeout=null),se.value.isZooming=!1,setTimeout(()=>{ce.value=null,yt.value.show=!1},150)},Vl=t=>{if(t.preventDefault(),t.stopPropagation(),!Et.value)return;const a=t.currentTarget.getBoundingClientRect(),n=t.clientX-a.left,i=t.clientY-a.top;if(kn.value){gt.value.show=!1,e.nextTick(()=>{gt.value.show=!0,gt.value.x=t.clientX,gt.value.y=t.clientY,gt.value.categoryIndex=null});return}const p=Math.max(0,I.value.left-20),g=I.value.right,C=I.value.top,w=I.value.bottom+80;n>=p&&n<=g&&i>=C&&i<=w&&(gt.value.show=!1,e.nextTick(()=>{gt.value.show=!0,gt.value.x=t.clientX,gt.value.y=t.clientY,gt.value.categoryIndex=null;const P=Math.max(I.value.left,Math.min(n,I.value.right))-I.value.left,$=I.value.width/o.value.length,B=Math.floor(P/$);B>=0&&B<o.value.length&&(gt.value.categoryIndex=B)}))},Wn=t=>{if(!(t&&t.button===2)){if(gt.value.show&&t&&t.type==="click"){const a=document.querySelector(".dss-context-menu");if(a&&a.contains(t.target))return}gt.value.show=!1}},fn=t=>{if(typeof t.template=="function"){const a={series:H.series,categories:H.categories,markers:Yt.value},n={chartX:gt.value.chartX,chartY:gt.value.chartY,dataX:gt.value.mouseDataX,dataY:gt.value.mouseDataY,categoryIndex:gt.value.categoryIndex};return t.template(a,n)}return t.template||t.label||""},ql=t=>{const a=["dss-context-menu-item"];return t.cssClass&&a.push(t.cssClass),a},Zl=t=>t.style||{},ll=t=>t.type&&bn.value[t.type]?bn.value[t.type]:t.customIcon?t.customIcon:_t.value,Al=t=>t==null?"":H.categories&&H.categories[t]?H.categories[t]:"",dl=t=>Yt.value.length?Yt.value.filter(a=>a.categoryIndex===t):[],Bn=t=>{if(!Sn.value&&!jt.value)return{x:0,y:0};const a=Kt(t),n=Q.value+I.value.bottom-En.value/2;return{x:a,y:n}},Dl=()=>{Yt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(Sn.value||jt.value)){const a=Bn(t.categoryIndex);t.x=a.x,t.y=a.y}})},ml=()=>{if(Te.value.description&&Te.value.description.length&&Te.value.date){if(Nn.value){const t=Yt.value.findIndex(a=>a.id===Te.value.editingMarkerId);t!==-1?(Yt.value[t].description=Te.value.description||"",Yt.value[t].color=Te.value.color||"",Yt.value[t].type=Te.value.type||"default",de("update-marker",Yt.value[t])):de("update-marker",{id:Te.value.editingMarkerId,description:Te.value.description||"",color:Te.value.color||"",type:Te.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let a=tl(Te.value.date,H.categories||[]);if(jt.value){const{maxX:C}=Xt.value;a=Math.max(0,Math.min(a,Math.floor(C)))}else Sn.value&&(a=Math.max(0,Math.min(a,Xt.value.maxX)));const n=Kt(a),i=Q.value+I.value.bottom-En.value/2,p=Array.isArray(H.categories)?H.categories[a]:null,g={id:t,title:"",description:Te.value.description||"",color:Te.value.color||"",type:Te.value.type||"default",categoryIndex:a,x:n,y:i,marker_date:p||null};Te.value.categoryIndex=a,Yt.value.push(g),de("add-marker",g)}Lt(),h()}},Lt=()=>{Te.value.show=!1,Te.value.title="",Te.value.description="",Te.value.color="#FF6B6B",Te.value.type="default",Te.value.editingMarkerId=null,Te.value.readonly=!1,Te.value.categoryIndex=null,Te.value.fromButton=!1,Te.value.date=null},qn=()=>{Nn.value&&(ol(Te.value.editingMarkerId),Lt())},ol=t=>{const a=Yt.value.findIndex(n=>n.id===t);a!==-1&&(Yt.value.splice(a,1),h()),de("delete-marker",t)},y=t=>{if(Te.value.show=!0,Te.value.title=t?.title??t?.comment??"",Te.value.description=t?.description??t?.comment??"",Te.value.color=t?.color??"",Te.value.type=t?.type??"default",Te.value.editingMarkerId=t?.id??t?.marker_id??null,Te.value.readonly=t?.readonly??!1,Te.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[a,n,i]=String(t.marker_date).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),C=Number(n)-1;g&&n&&p?Te.value.date=new Date(p,C,g):Te.value.date=null}else Te.value.date=null},h=()=>{try{const t=`dss-chart-markers-${H.chartId}`;localStorage.setItem(t,JSON.stringify(Yt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},x=()=>{try{const t=`dss-chart-markers-${H.chartId}`,a=localStorage.getItem(t);if(a){const n=JSON.parse(a);Array.isArray(n)&&(Yt.value=n.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Yt.value=[]}},W=t=>{const a=lt.value||"Chart",n=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${a.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${n}.${t}`},ie=()=>{const t=at.value.show,a=yt.value.show;return at.value.show=!1,yt.value.show=!1,{originalCrosshair:t,originalTooltip:a}},ft=t=>{at.value.show=t.originalCrosshair,yt.value.show=t.originalTooltip},Ht=async(t,a=32,n=32)=>new Promise((i,p)=>{if(t.startsWith("data:")){i(t);return}const g=new Image;g.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(C);try{const w=document.createElement("canvas"),P=w.getContext("2d");w.width=a,w.height=n,P.fillStyle="#fafafa",P.fillRect(0,0,a,n),P.drawImage(g,0,0,a,n);const N=w.toDataURL("image/png");i(N)}catch(w){console.warn("Canvas conversion failed:",w),i(t)}},g.onerror=w=>{clearTimeout(C),console.warn("Failed to load image:",t,w),i(t)},g.src=t}),Mn=async()=>{try{const t=ie();setTimeout(async()=>{try{const a=A.value;if(!a){console.error("Chart SVG element not found"),ft(t);return}const n=et(),i=Ee.value,p=K.value+n.height,g=a.cloneNode(!0);g.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(ge=>ge.remove());const w=g.querySelectorAll("image"),P=Array.from(w).map(async ge=>{const Je=ge.getAttribute("xlink:href")||ge.getAttribute("href");if(Je&&!Je.startsWith("data:"))try{const Oe=await Ht(Je,32,32);ge.setAttribute("xlink:href",Oe),ge.setAttribute("href",Oe)}catch(Oe){console.warn("Failed to convert logo to base64:",Oe)}});await Promise.all(P);const $=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let B="",te=30;if(lt.value&&(B+=`
44
+ </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Mt=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),on=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 An=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),Fn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),Qn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),En=e.computed(()=>{const a=Z.value?.radialBar?.dataLabels;return a&&(a.show===!0||a.enabled===!0)}),oo=e.computed(()=>{const a=Z.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof a=="number"&&a>=0?a:20}),ql=e.computed(()=>{const a=Z.value?.radialBar?.dataCenter;return Fl.value?!0:Pn.value&&a&&(a.show===!0||a.enabled===!0)}),Al=e.computed(()=>{if(!ql.value||!lt.value.length)return"";if(Fl.value){const i=lt.value[1]??lt.value[0];return qt(i?.value??0)}const n=Z.value?.radialBar?.dataCenter?.showValueOnly===!0?lt.value[0]?.value??0:lt.value.reduce((i,p)=>i+(p.value??0),0);return qt(n)}),Wl=e.computed(()=>{const a=Z.value?.radialBar?.dataCenter?.fontSize;return typeof a=="number"&&a>0?a:24}),ml=e.computed(()=>({x:Rt.value,y:Fl.value?kt.value:kt.value-Wl.value/2})),Vl=e.computed(()=>{const a=Z.value?.radialBar?.dataCenter?.color;return typeof a=="string"&&a?a:"#333"}),ao=e.computed(()=>{if(!En.value||!kn.value||!lt.value.length)return[];const t=oo.value*Math.PI/180,a=(Wt.value+ut.value)/2;return lt.value.map(n=>{const p=n.endAngle-n.startAngle>=t&&!n.isHidden,g=Rt.value+Math.cos(n.midAngle)*a,C=kt.value+Math.sin(n.midAngle)*a;return{value:qt(n.value),x:g,y:C,show:p,color:n.color,contrastColor:d(n.color)}})}),Jn=e.computed(()=>{if(!R.flags||!R.flags.length)return[];const t=new Map;return R.flags.forEach(a=>{const n=a.categoryIndex;t.has(n)||t.set(n,[]),t.get(n).push(a)}),Array.from(t.entries()).map(([a,n])=>{const i=Kt(a),p=n.filter(C=>C.manual),g=n.filter(C=>!C.manual);return{categoryIndex:parseInt(a),x:i,flags:n,manualCount:p.length,autoCount:g.length,totalCount:n.length,hasManual:p.length>0,hasAuto:g.length>0,texts:n.map(C=>C.text).join(`
45
+ `)}})}),yn=e.ref({show:!1,x:0,y:0,content:"",count:0}),Qt=e.computed(()=>Z.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),an=e.computed(()=>{const t=Z.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),al=e.computed(()=>Z.value?.bubbles?.tooltip?.formatters||{}),at=e.ref(new Set),ce=e.ref(null),pl=e.ref(!1),ht=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),pn=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),st=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),gt=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),ae=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Yt=e.ref([]),$e=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 bn.value&&t.push(...Object.keys(bn.value)),t}),e.computed(()=>{if(!R.categories||R.categories.length===0){const{maxX:t}=Xt.value;return Array.from({length:t+1},(a,n)=>M("chart.fallback.item",{number:n+1}))}return R.categories});const so=e.computed(()=>{if(!R.categories||R.categories.length===0)return null;const t=R.categories[0],[a,n,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),C=Number(n)-1;return!g||!n||!p?null:new Date(p,C,g)}),sn=e.computed(()=>{if(!R.categories||R.categories.length===0)return null;const t=R.categories[R.categories.length-1],[a,n,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),C=Number(n)-1;return!g||!n||!p?null:new Date(p,C,g)}),Bn=e.computed(()=>$e.value.editingMarkerId!==null),tn=e.computed(()=>$e.value.readonly),In=t=>{at.value.has(t)||(Go.value=!0,ce.value=t)},cn=()=>{Go.value=!1,ce.value=null},zn=t=>{if(Co.value||Ro.value){st.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top,g=jt.value?i>=F.value.left-50&&i<=F.value.right+50&&p>=F.value.top-50&&p<=F.value.bottom+100:i>=F.value.left&&i<=F.value.right&&p>=F.value.top&&p<=F.value.bottom;if(pl.value=g,jt.value){if(!Ke.value||!g||ae.value.isDragging||ae.value.isZooming){st.value.show=!1;return}if(j.value.find(ue=>!ue||ue.isHidden?!1:Math.sqrt(Math.pow(ue.x-i,2)+Math.pow(ue.y-p,2))<=ue.radius+3))st.value.show=!1;else{const ue=j.value.filter(ke=>!ke||ke.isHidden?!1:Math.sqrt(Math.pow(ke.x-i,2)+Math.pow(ke.y-p,2))<=250);if(ue.length>0){let ke=ue[0],Ne=Math.sqrt(Math.pow(ke.x-i,2)+Math.pow(ke.y-p,2));ue.forEach(Ze=>{const Le=Math.sqrt(Math.pow(Ze.x-i,2)+Math.pow(Ze.y-p,2));Le<Ne&&(Ne=Le,ke=Ze)});const ge=30,Qe=j.value.filter(Ze=>!Ze||Ze.isHidden?!1:Math.abs(Ze.x-ke.x)<=ge).sort((Ze,Le)=>Ze.y-Le.y);st.value={show:!0,x:ke.x,categoryIndex:Math.round(ke.originalX),data:(()=>{const Ze=Qt.value,Le=an.value,_e=[];return Qe.forEach(Re=>{Ze.forEach(_t=>{const zt=Le[_t]||_t,Kn=ul(_t,Re);Kn&&_e.push({seriesName:Re.seriesName,label:Re.label,value:`${zt}: ${Kn}`,color:Re.color,y:Re.y})})}),_e})()}}else st.value.show=!1}return}if(ae.value.isDragging&&ae.value.scale>1&&Sn.value&&Ge.value){st.value.show=!1;const Ye=t.clientX-ae.value.lastMouseX,{minX:ue,maxX:ke}=Xt.value,Ne=ke-ue||1,Qe=Ye*.8;ae.value.offsetX+=Qe;const Ze=Ne/ae.value.scale,Le=Ne-Ze,_e=0,Re=-Le/Ne*F.value.width,_t=_e;ae.value.offsetX=Math.max(Re,Math.min(_t,ae.value.offsetX)),ae.value.lastMouseX=t.clientX,ae.value.lastMouseY=t.clientY;return}if(!Ke.value||!Sn.value||ae.value.isDragging||ae.value.isZooming||!g){st.value.show=!1;return}const{minX:C,maxX:w}=Xt.value,z=w-C||1,N=z/ae.value.scale,$=C-ae.value.offsetX/F.value.width*z,B=(i-F.value.left)/F.value.width,te=$+B*N,Se=Math.round(te);if(Se>=0&&Se<=w){const Ye=Kt(Se),ue=nl.value.map((ke,Ne)=>{const ge=R.series.findIndex(Ze=>Ze===ke),Qe=ke.data[Se];return{seriesName:ke.name,value:Qe!==void 0?Qe:null,color:c(ge),y:Qe!==void 0?xn(ke,Qe):null}}).filter(ke=>ke.value!==null);st.value={show:!0,x:Ye,categoryIndex:Se,data:ue}}},Dl=()=>{st.value.show=!1,pl.value=!1,Ro.value=!1,Co.value||(yn.value.show=!1),ae.value.isDragging&&(ae.value.isDragging=!1),ae.value.zoomTimeout&&(clearTimeout(ae.value.zoomTimeout),ae.value.zoomTimeout=null),ae.value.isZooming=!1,setTimeout(()=>{ce.value=null,ht.value.show=!1},150)},Nl=t=>{if(t.preventDefault(),t.stopPropagation(),!wt.value)return;const a=t.currentTarget.getBoundingClientRect(),n=t.clientX-a.left,i=t.clientY-a.top;if(kn.value){gt.value.show=!1,e.nextTick(()=>{gt.value.show=!0,gt.value.x=t.clientX,gt.value.y=t.clientY,gt.value.categoryIndex=null});return}const p=Math.max(0,F.value.left-20),g=F.value.right,C=F.value.top,w=F.value.bottom+80;n>=p&&n<=g&&i>=C&&i<=w&&(gt.value.show=!1,e.nextTick(()=>{gt.value.show=!0,gt.value.x=t.clientX,gt.value.y=t.clientY,gt.value.categoryIndex=null;const z=Math.max(F.value.left,Math.min(n,F.value.right))-F.value.left,$=F.value.width/o.value.length,B=Math.floor(z/$);B>=0&&B<o.value.length&&(gt.value.categoryIndex=B)}))},Zn=t=>{if(!(t&&t.button===2)){if(gt.value.show&&t&&t.type==="click"){const a=document.querySelector(".dss-context-menu");if(a&&a.contains(t.target))return}gt.value.show=!1}},fn=t=>{if(typeof t.template=="function"){const a={series:R.series,categories:R.categories,markers:Yt.value},n={chartX:gt.value.chartX,chartY:gt.value.chartY,dataX:gt.value.mouseDataX,dataY:gt.value.mouseDataY,categoryIndex:gt.value.categoryIndex};return t.template(a,n)}return t.template||t.label||""},Zl=t=>{const a=["dss-context-menu-item"];return t.cssClass&&a.push(t.cssClass),a},Ul=t=>t.style||{},sl=t=>t.type&&bn.value[t.type]?bn.value[t.type]:t.customIcon?t.customIcon:Bt.value,Hl=t=>t==null?"":R.categories&&R.categories[t]?R.categories[t]:"",fl=t=>Yt.value.length?Yt.value.filter(a=>a.categoryIndex===t):[],Mn=t=>{if(!Sn.value&&!jt.value)return{x:0,y:0};const a=Kt(t),n=G.value+F.value.bottom-Tn.value/2;return{x:a,y:n}},Rl=()=>{Yt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(Sn.value||jt.value)){const a=Mn(t.categoryIndex);t.x=a.x,t.y=a.y}})},vl=()=>{if($e.value.description&&$e.value.description.length&&$e.value.date){if(Bn.value){const t=Yt.value.findIndex(a=>a.id===$e.value.editingMarkerId);t!==-1?(Yt.value[t].description=$e.value.description||"",Yt.value[t].color=$e.value.color||"",Yt.value[t].type=$e.value.type||"default",de("update-marker",Yt.value[t])):de("update-marker",{id:$e.value.editingMarkerId,description:$e.value.description||"",color:$e.value.color||"",type:$e.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let a=On($e.value.date,R.categories||[]);if(jt.value){const{maxX:C}=Xt.value;a=Math.max(0,Math.min(a,Math.floor(C)))}else Sn.value&&(a=Math.max(0,Math.min(a,Xt.value.maxX)));const n=Kt(a),i=G.value+F.value.bottom-Tn.value/2,p=Array.isArray(R.categories)?R.categories[a]:null,g={id:t,title:"",description:$e.value.description||"",color:$e.value.color||"",type:$e.value.type||"default",categoryIndex:a,x:n,y:i,marker_date:p||null};$e.value.categoryIndex=a,Yt.value.push(g),de("add-marker",g)}$t(),h()}},$t=()=>{$e.value.show=!1,$e.value.title="",$e.value.description="",$e.value.color="#FF6B6B",$e.value.type="default",$e.value.editingMarkerId=null,$e.value.readonly=!1,$e.value.categoryIndex=null,$e.value.fromButton=!1,$e.value.date=null},Un=()=>{Bn.value&&(rl($e.value.editingMarkerId),$t())},rl=t=>{const a=Yt.value.findIndex(n=>n.id===t);a!==-1&&(Yt.value.splice(a,1),h()),de("delete-marker",t)},y=t=>{if($e.value.show=!0,$e.value.title=t?.title??t?.comment??"",$e.value.description=t?.description??t?.comment??"",$e.value.color=t?.color??"",$e.value.type=t?.type??"default",$e.value.editingMarkerId=t?.id??t?.marker_id??null,$e.value.readonly=t?.readonly??!1,$e.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[a,n,i]=String(t.marker_date).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),C=Number(n)-1;g&&n&&p?$e.value.date=new Date(p,C,g):$e.value.date=null}else $e.value.date=null},h=()=>{try{const t=`dss-chart-markers-${R.chartId}`;localStorage.setItem(t,JSON.stringify(Yt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},x=()=>{try{const t=`dss-chart-markers-${R.chartId}`,a=localStorage.getItem(t);if(a){const n=JSON.parse(a);Array.isArray(n)&&(Yt.value=n.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Yt.value=[]}},q=t=>{const a=ot.value||"Chart",n=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${a.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${n}.${t}`},re=()=>{const t=st.value.show,a=ht.value.show;return st.value.show=!1,ht.value.show=!1,{originalCrosshair:t,originalTooltip:a}},pt=t=>{st.value.show=t.originalCrosshair,ht.value.show=t.originalTooltip},Ht=async(t,a=32,n=32)=>new Promise((i,p)=>{if(t.startsWith("data:")){i(t);return}const g=new Image;g.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(C);try{const w=document.createElement("canvas"),z=w.getContext("2d");w.width=a,w.height=n,z.fillStyle="#fafafa",z.fillRect(0,0,a,n),z.drawImage(g,0,0,a,n);const N=w.toDataURL("image/png");i(N)}catch(w){console.warn("Canvas conversion failed:",w),i(t)}},g.onerror=w=>{clearTimeout(C),console.warn("Failed to load image:",t,w),i(t)},g.src=t}),_n=async()=>{try{const t=re();setTimeout(async()=>{try{const a=T.value;if(!a){console.error("Chart SVG element not found"),pt(t);return}const n=nt(),i=Ee.value,p=Q.value+n.height,g=a.cloneNode(!0);g.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(ge=>ge.remove());const w=g.querySelectorAll("image"),z=Array.from(w).map(async ge=>{const Qe=ge.getAttribute("xlink:href")||ge.getAttribute("href");if(Qe&&!Qe.startsWith("data:"))try{const Ze=await Ht(Qe,32,32);ge.setAttribute("xlink:href",Ze),ge.setAttribute("href",Ze)}catch(Ze){console.warn("Failed to convert logo to base64:",Ze)}});await Promise.all(z);const $=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let B="",te=30;if(ot.value&&(B+=`
46
46
  <text x="24" y="${te}"
47
47
  font-family="Arial, sans-serif"
48
48
  font-size="18"
49
49
  font-weight="bold"
50
50
  fill="#333">
51
- ${lt.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
52
- </text>`,te+=30),xt.value&&(B+=`
51
+ ${ot.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
52
+ </text>`,te+=30),bt.value&&(B+=`
53
53
  <text x="24" y="${te}"
54
54
  font-family="Arial, sans-serif"
55
55
  font-size="14"
56
56
  fill="#666">
57
- ${xt.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
58
- </text>`,te+=25),G.value&&H.series.length>0){let ge=i-200,Je=lt.value||xt.value?35:25;const Oe=Math.floor((i-250)/120);let Ae=0;H.series.forEach((_e,Re)=>{if(!ot.value.has(Re)){const $t=c(Re),Pt=_e.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");B+=`<circle cx="${ge+6}" cy="${Je-4}" r="6" fill="${$t}"/>`,B+=`<text x="${ge+18}" y="${Je}" font-family="Arial, sans-serif" font-size="12" fill="#333">${Pt}</text>`,Ae++,Ae%Oe===0?(ge=i-200,Je+=20):ge+=Math.min(120,Pt.length*8+35)}})}let Se="";if(O.value)try{const{width:ge,height:Je}=dt.value,Oe=Le.value,Ae=I.value.left,_e=I.value.right,Re=I.value.top,$t=I.value.bottom,Pt=I.value.width,Yn=I.value.height;let hn,jn;switch(Oe){case"center":hn=Ae+(Pt-ge)/2,jn=Re+(Yn-Je)/2;break;case"top-left":hn=Ae+15,jn=Re+5;break;case"top-right":hn=_e-ge-5,jn=Re+5;break;case"bottom-left":hn=Ae+15,jn=$t-Je-5;break;case"bottom-right":default:hn=_e-ge-5,jn=$t-Je-5;break}Se=`
59
- <g opacity="${F.value}">
60
- <g transform="translate(${hn}, ${jn}) scale(${ge/499})">
57
+ ${bt.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
58
+ </text>`,te+=25),J.value&&R.series.length>0){let ge=i-200,Qe=ot.value||bt.value?35:25;const Ze=Math.floor((i-250)/120);let Le=0;R.series.forEach((_e,Re)=>{if(!at.value.has(Re)){const _t=c(Re),zt=_e.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");B+=`<circle cx="${ge+6}" cy="${Qe-4}" r="6" fill="${_t}"/>`,B+=`<text x="${ge+18}" y="${Qe}" font-family="Arial, sans-serif" font-size="12" fill="#333">${zt}</text>`,Le++,Le%Ze===0?(ge=i-200,Qe+=20):ge+=Math.min(120,zt.length*8+35)}})}let Se="";if(Rn.value)try{const{width:ge,height:Qe}=P.value,Ze=O.value,Le=F.value.left,_e=F.value.right,Re=F.value.top,_t=F.value.bottom,zt=F.value.width,Kn=F.value.height;let hn,Gn;switch(Ze){case"center":hn=Le+(zt-ge)/2,Gn=Re+(Kn-Qe)/2;break;case"top-left":hn=Le+15,Gn=Re+5;break;case"top-right":hn=_e-ge-5,Gn=Re+5;break;case"bottom-left":hn=Le+15,Gn=_t-Qe-5;break;case"bottom-right":default:hn=_e-ge-5,Gn=_t-Qe-5;break}Se=`
59
+ <g opacity="${Nn.value}">
60
+ <g transform="translate(${hn}, ${Gn}) scale(${ge/499})">
61
61
  <path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
62
62
  <path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
63
63
  <path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
@@ -72,7 +72,7 @@
72
72
  <path d="M47.5201 77.18H66.2501C73.5601 77.18 79.4801 71.26 79.4801 63.95C79.4801 56.64 73.5601 50.72 66.2501 50.72H47.3601C46.3801 50.72 45.5901 51.52 45.6001 52.5L45.7601 75.44C45.7601 76.41 46.5501 77.19 47.5201 77.19V77.18Z" fill="#07ACDD"/>
73
73
  <path d="M28.4201 76.12C35.1082 76.12 40.5301 70.6982 40.5301 64.01C40.5301 57.3218 35.1082 51.9 28.4201 51.9C21.7319 51.9 16.3101 57.3218 16.3101 64.01C16.3101 70.6982 21.7319 76.12 28.4201 76.12Z" fill="#fafafa"/>
74
74
  </g>
75
- </g>`}catch(ge){console.warn("Watermark processing failed, skipping watermark in SVG:",ge),Se=""}const je=`<?xml version="1.0" encoding="UTF-8"?>
75
+ </g>`}catch(ge){console.warn("Watermark processing failed, skipping watermark in SVG:",ge),Se=""}const Ye=`<?xml version="1.0" encoding="UTF-8"?>
76
76
  <svg width="${i}" height="${p}"
77
77
  xmlns="http://www.w3.org/2000/svg"
78
78
  xmlns:xlink="http://www.w3.org/1999/xlink">
@@ -89,30 +89,30 @@
89
89
  ${$}
90
90
  ${Se}
91
91
  </g>
92
- </svg>`,ue=new Blob([je],{type:"image/svg+xml;charset=utf-8"}),ye=URL.createObjectURL(ue),Ne=document.createElement("a");Ne.href=ye,Ne.download=W("svg"),document.body.appendChild(Ne),Ne.click(),document.body.removeChild(Ne),URL.revokeObjectURL(ye),ft(t),Wn()}catch(a){console.error("Error downloading SVG:",a),ft(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},Ln=async()=>{try{const t=ie();z.value&&z.value.offsetHeight,await new Promise(ge=>setTimeout(ge,300));const a=et(),n=Ee.value,i=K.value+a.height,p=document.createElement("canvas"),g=p.getContext("2d"),C=2;p.width=n*C,p.height=i*C,p.style.width=n+"px",p.style.height=i+"px",g.scale(C,C),g.fillStyle="#fafafa",g.fillRect(0,0,n,i);let w=30;if(lt.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(lt.value,24,w),w+=30),xt.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(xt.value,24,w),w+=25),G.value&&H.series.length>0){let ge=n-200,Je=lt.value||xt.value?35:25;const Oe=Math.floor((n-250)/120);let Ae=0;g.font="12px Arial, sans-serif",H.series.forEach((_e,Re)=>{if(!ot.value.has(Re)){const $t=c(Re);g.beginPath(),g.arc(ge+6,Je-4,6,0,2*Math.PI),g.fillStyle=$t,g.fill(),g.fillStyle="#333",g.fillText(_e.name,ge+18,Je),Ae++,Ae%Oe===0?(ge=n-200,Je+=20):ge+=Math.min(120,_e.name.length*8+35)}})}const N=A.value.cloneNode(!0),$=N.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),B=N.querySelectorAll(".dss-crosshair"),te=N.querySelectorAll('[class*="tooltip"]');$.forEach(ge=>ge.remove()),B.forEach(ge=>ge.remove()),te.forEach(ge=>ge.remove()),N.querySelectorAll("image").forEach((ge,Je)=>{const Oe=ge.getAttribute("xlink:href")||ge.getAttribute("href");if(Oe&&!Oe.startsWith("data:")){const Ae=Do.value[Je],_e=Ae?c(Ae.seriesIndex):"#3B82F6",Re=ge.getAttribute("x")||0,$t=ge.getAttribute("y")||0,Pt=ge.getAttribute("width")||32,Yn=ge.getAttribute("height")||32,hn=document.createElementNS("http://www.w3.org/2000/svg","circle");hn.setAttribute("cx",parseFloat(Re)+parseFloat(Pt)/2),hn.setAttribute("cy",parseFloat($t)+parseFloat(Yn)/2),hn.setAttribute("r",Math.min(parseFloat(Pt),parseFloat(Yn))/2-1),hn.setAttribute("fill",_e),hn.setAttribute("stroke","#fafafa"),hn.setAttribute("stroke-width","2"),ge.parentNode.replaceChild(hn,ge)}});const je=new XMLSerializer().serializeToString(N),ue=new Blob([je],{type:"image/svg+xml;charset=utf-8"}),ye=URL.createObjectURL(ue),Ne=new Image;return new Promise((ge,Je)=>{Ne.onload=async()=>{try{if(g.drawImage(Ne,0,a.height),Do.value.forEach(Oe=>{const Ae=Oe.x,_e=Oe.y+a.height,Re=(Oe.width||32)/2,$t=c(Oe.seriesIndex);g.save(),g.beginPath(),g.arc(Ae,_e,Re-1,0,2*Math.PI),g.fillStyle=$t,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),O.value){const Oe=new Image,Ae=()=>{const{width:Re,height:$t}=dt.value,Pt=Le.value,Yn=I.value.left,hn=I.value.right,jn=I.value.top,Fo=I.value.bottom,xa=I.value.width,Ea=I.value.height;let Gl,Ql;switch(Pt){case"center":Gl=Yn+(xa-Re)/2,Ql=jn+a.height+(Ea-$t)/2;break;case"top-left":Gl=Yn+15,Ql=jn+a.height+10;break;case"top-right":Gl=hn-Re-5,Ql=jn+a.height+10;break;case"bottom-left":Gl=Yn+15,Ql=Fo+a.height-$t-5;break;case"bottom-right":default:Gl=hn-Re-5,Ql=Fo+a.height-$t-5;break}g.globalAlpha=F.value,g.drawImage(Oe,Gl,Ql,Re,$t),g.globalAlpha=1,_e()},_e=()=>{p.toBlob(Re=>{const $t=URL.createObjectURL(Re),Pt=document.createElement("a");Pt.href=$t,Pt.download=W("png"),document.body.appendChild(Pt),Pt.click(),document.body.removeChild(Pt),URL.revokeObjectURL($t),URL.revokeObjectURL(ye),ft(t),Wn(),ge()},"image/png")};Oe.onload=Ae,Oe.onerror=_e,Oe.src=Dn.value}else p.toBlob(Oe=>{const Ae=URL.createObjectURL(Oe),_e=document.createElement("a");_e.href=Ae,_e.download=W("png"),document.body.appendChild(_e),_e.click(),document.body.removeChild(_e),URL.revokeObjectURL(Ae),URL.revokeObjectURL(ye),ft(t),Wn(),ge()},"image/png")}catch(Oe){URL.revokeObjectURL(ye),ft(t),Je(Oe)}},Ne.onerror=()=>{URL.revokeObjectURL(ye),ft(t),Je(new Error("Failed to load SVG image"))},Ne.src=ye})}catch(t){console.error("Error downloading PNG:",t)}},Pn=()=>{try{let t="";lt.value&&(t+=`# ${M("chart.csv.chartTitle")}: ${lt.value}
93
- `),xt.value&&(t+=`# ${M("chart.csv.chartSubtitle")}: ${xt.value}
92
+ </svg>`,ue=new Blob([Ye],{type:"image/svg+xml;charset=utf-8"}),ke=URL.createObjectURL(ue),Ne=document.createElement("a");Ne.href=ke,Ne.download=q("svg"),document.body.appendChild(Ne),Ne.click(),document.body.removeChild(Ne),URL.revokeObjectURL(ke),pt(t),Zn()}catch(a){console.error("Error downloading SVG:",a),pt(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},Dn=async()=>{try{const t=re();I.value&&I.value.offsetHeight,await new Promise(ge=>setTimeout(ge,300));const a=nt(),n=Ee.value,i=Q.value+a.height,p=document.createElement("canvas"),g=p.getContext("2d"),C=2;p.width=n*C,p.height=i*C,p.style.width=n+"px",p.style.height=i+"px",g.scale(C,C),g.fillStyle="#fafafa",g.fillRect(0,0,n,i);let w=30;if(ot.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(ot.value,24,w),w+=30),bt.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(bt.value,24,w),w+=25),J.value&&R.series.length>0){let ge=n-200,Qe=ot.value||bt.value?35:25;const Ze=Math.floor((n-250)/120);let Le=0;g.font="12px Arial, sans-serif",R.series.forEach((_e,Re)=>{if(!at.value.has(Re)){const _t=c(Re);g.beginPath(),g.arc(ge+6,Qe-4,6,0,2*Math.PI),g.fillStyle=_t,g.fill(),g.fillStyle="#333",g.fillText(_e.name,ge+18,Qe),Le++,Le%Ze===0?(ge=n-200,Qe+=20):ge+=Math.min(120,_e.name.length*8+35)}})}const N=T.value.cloneNode(!0),$=N.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),B=N.querySelectorAll(".dss-crosshair"),te=N.querySelectorAll('[class*="tooltip"]');$.forEach(ge=>ge.remove()),B.forEach(ge=>ge.remove()),te.forEach(ge=>ge.remove()),N.querySelectorAll("image").forEach((ge,Qe)=>{const Ze=ge.getAttribute("xlink:href")||ge.getAttribute("href");if(Ze&&!Ze.startsWith("data:")){const Le=Ho.value[Qe],_e=Le?c(Le.seriesIndex):"#3B82F6",Re=ge.getAttribute("x")||0,_t=ge.getAttribute("y")||0,zt=ge.getAttribute("width")||32,Kn=ge.getAttribute("height")||32,hn=document.createElementNS("http://www.w3.org/2000/svg","circle");hn.setAttribute("cx",parseFloat(Re)+parseFloat(zt)/2),hn.setAttribute("cy",parseFloat(_t)+parseFloat(Kn)/2),hn.setAttribute("r",Math.min(parseFloat(zt),parseFloat(Kn))/2-1),hn.setAttribute("fill",_e),hn.setAttribute("stroke","#fafafa"),hn.setAttribute("stroke-width","2"),ge.parentNode.replaceChild(hn,ge)}});const Ye=new XMLSerializer().serializeToString(N),ue=new Blob([Ye],{type:"image/svg+xml;charset=utf-8"}),ke=URL.createObjectURL(ue),Ne=new Image;return new Promise((ge,Qe)=>{Ne.onload=async()=>{try{if(g.drawImage(Ne,0,a.height),Ho.value.forEach(Ze=>{const Le=Ze.x,_e=Ze.y+a.height,Re=(Ze.width||32)/2,_t=c(Ze.seriesIndex);g.save(),g.beginPath(),g.arc(Le,_e,Re-1,0,2*Math.PI),g.fillStyle=_t,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),Rn.value){const Ze=new Image,Le=()=>{const{width:Re,height:_t}=P.value,zt=O.value,Kn=F.value.left,hn=F.value.right,Gn=F.value.top,Io=F.value.bottom,Ea=F.value.width,Sa=F.value.height;let Ql,Jl;switch(zt){case"center":Ql=Kn+(Ea-Re)/2,Jl=Gn+a.height+(Sa-_t)/2;break;case"top-left":Ql=Kn+15,Jl=Gn+a.height+10;break;case"top-right":Ql=hn-Re-5,Jl=Gn+a.height+10;break;case"bottom-left":Ql=Kn+15,Jl=Io+a.height-_t-5;break;case"bottom-right":default:Ql=hn-Re-5,Jl=Io+a.height-_t-5;break}g.globalAlpha=Nn.value,g.drawImage(Ze,Ql,Jl,Re,_t),g.globalAlpha=1,_e()},_e=()=>{p.toBlob(Re=>{const _t=URL.createObjectURL(Re),zt=document.createElement("a");zt.href=_t,zt.download=q("png"),document.body.appendChild(zt),zt.click(),document.body.removeChild(zt),URL.revokeObjectURL(_t),URL.revokeObjectURL(ke),pt(t),Zn(),ge()},"image/png")};Ze.onload=Le,Ze.onerror=_e,Ze.src=tt.value}else p.toBlob(Ze=>{const Le=URL.createObjectURL(Ze),_e=document.createElement("a");_e.href=Le,_e.download=q("png"),document.body.appendChild(_e),_e.click(),document.body.removeChild(_e),URL.revokeObjectURL(Le),URL.revokeObjectURL(ke),pt(t),Zn(),ge()},"image/png")}catch(Ze){URL.revokeObjectURL(ke),pt(t),Qe(Ze)}},Ne.onerror=()=>{URL.revokeObjectURL(ke),pt(t),Qe(new Error("Failed to load SVG image"))},Ne.src=ke})}catch(t){console.error("Error downloading PNG:",t)}},Wn=()=>{try{let t="";ot.value&&(t+=`# ${M("chart.csv.chartTitle")}: ${ot.value}
93
+ `),bt.value&&(t+=`# ${M("chart.csv.chartSubtitle")}: ${bt.value}
94
94
  `),t+=`# ${M("chart.csv.generated")}: ${new Date().toLocaleString()}
95
95
 
96
- `,t+="Category",H.series.forEach(g=>{const C=g.name.replace(/"/g,'""');t+=',"'+C+'"'}),t+=`
97
- `;const a=Math.max(...H.series.map(g=>g.data?.length||0));for(let g=0;g<a;g++){let P='"'+(H.categories[g]||M("chart.fallback.item",{number:g+1})).toString().replace(/"/g,'""')+'"';H.series.forEach(N=>{const $=N.data&&N.data[g]!==void 0?N.data[g]:"";P+=","+$}),t+=P+`
98
- `}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(n),p=document.createElement("a");p.href=i,p.download=W("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(i),Wn()}catch(t){console.error("Error downloading CSV:",t)}},hl=t=>{if(typeof t.action=="function"){const a={series:H.series,categories:H.categories,markers:Yt.value},n={chartX:gt.value.chartX,chartY:gt.value.chartY,dataX:gt.value.mouseDataX,dataY:gt.value.mouseDataY,categoryIndex:clampedCategoryIndex||gt.value.categoryIndex};t.action(a,n)}Wn()},so=()=>{Lt(),Te.value.show=!0,Te.value.categoryIndex=gt.value.categoryIndex,Te.value.fromButton=!1,Wn()},wo=()=>{Lt(),Te.value.show=!0,Te.value.categoryIndex=0,Te.value.fromButton=!0},xo=t=>{if(gt.value.show){const a=document.querySelector(".dss-context-menu");a&&!a.contains(t.target)&&(gt.value.show=!1)}},ro=t=>{gt.value.show&&!t.target.closest(".context-menu")&&(gt.value.show=!1)},Eo=t=>{if(!Sn.value||!Qe.value)return;t.preventDefault(),t.stopPropagation(),se.value.isZooming=!0,at.value.show=!1,se.value.zoomTimeout&&clearTimeout(se.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top;if(i<I.value.left-50||i>I.value.right+50||p<I.value.top-50||p>I.value.bottom+100){se.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,C=Math.max(se.value.minScale,Math.min(se.value.maxScale,se.value.scale*g));if(C!==se.value.scale){const{minX:w,maxX:P}=Xt.value,N=P-w||1,$=N/se.value.scale,B=w-se.value.offsetX/I.value.width*N,te=(i-I.value.left)/I.value.width,Se=B+te*$;se.value.scale=C;const je=N/se.value.scale,ue=Se-te*je;se.value.offsetX=-(ue-w)/N*I.value.width,se.value.scale<=1.01&&(se.value.scale=1,se.value.offsetX=0)}se.value.zoomTimeout=setTimeout(()=>{se.value.isZooming=!1,se.value.zoomTimeout=null},300)},io=t=>{if(!Sn.value||!Qe.value||se.value.scale<=1)return;at.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,se.value.isDragging=!0,se.value.lastMouseX=t.clientX,se.value.lastMouseY=t.clientY,t.preventDefault()},So=()=>{se.value.isDragging=!1},co=()=>{!Sn.value||!Qe.value||(se.value.scale=1,se.value.offsetX=0,se.value.isDragging=!1,se.value.zoomTimeout&&(clearTimeout(se.value.zoomTimeout),se.value.zoomTimeout=null),se.value.isZooming=!1)},qo=()=>!Sn.value||!ul.value||!Qe.value?"default":se.value.isDragging?"grabbing":se.value.scale>1?"grab":"dss-crosshair",Ul=t=>{if(t.length<2)return"";if(t.length===2)return`M ${t[0].x} ${t[0].y} L ${t[1].x} ${t[1].y}`;let a=`M ${t[0].x} ${t[0].y}`;for(let n=0;n<t.length-1;n++){const i=t[Math.max(n-1,0)],p=t[n],g=t[n+1],C=t[Math.min(n+2,t.length-1)],w=p.x+(g.x-i.x)/6*Ye.value,P=p.y+(g.y-i.y)/6*Ye.value,N=g.x-(C.x-p.x)/6*Ye.value,$=g.y-(C.y-p.y)/6*Ye.value;a+=` C ${w} ${P} ${N} ${$} ${g.x} ${g.y}`}return a},_n=e.computed(()=>{const a=q.value?.chart?.padding,n=typeof a=="number"?a:null,i=a&&typeof a=="object"?a:null,p=50;let g=p+(tn.value?30:0)+60;if($n.value){const B={left:p+40,top:p+40,right:p+40,bottom:p+40};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??B.left,top:i.top??B.top,right:i.right??B.right,bottom:i.bottom??B.bottom}:B}if(kn.value){const B=!G.value,te=Hn.value,Se=te?gl.value+El.value+Math.max(24,On.value+16):0,je=B?12:p;let ue=0;lt.value&&(ue+=B?8:15),xt.value&&(ue+=B?6:10);const ye=et();let Ne=je+(B?4:16)+(te?Se:0),ge=je+(te?Se:0);G.value&&he.value==="left"?Ne+=ye.legendWidth||150:G.value&&he.value==="right"&&(ge+=ye.legendWidth||150);const Oe=we.value==="semi-radial"?te?Se:8:te?Se:B?8:p+80,Ae=te?14:0,_e=je+ue+Ae,Re={left:Ne,top:_e,right:ge,bottom:Oe};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??Re.left,top:i.top??Re.top,right:i.right??Re.right,bottom:i.bottom??Re.bottom}:Re}let C=0;lt.value&&(C+=15),xt.value&&(C+=10);const w=et();let P=p+16,N=p;G.value&&he.value==="left"?P+=w.legendWidth||150:G.value&&he.value==="right"&&(N+=w.legendWidth||150),Tn.value&&(N+=44);const $={left:P,top:p+C,right:N,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??$.left,top:i.top??$.top,right:i.right??$.right,bottom:i.bottom??$.bottom}:$}),I=e.computed(()=>({left:_n.value.left,top:_n.value.top,right:Ee.value-_n.value.right,bottom:K.value-_n.value.bottom,width:Ee.value-(_n.value.left+_n.value.right),height:K.value-(_n.value.top+_n.value.bottom)})),Sn=e.computed(()=>["line","area","bar"].includes(we.value)||st.value),Zn=e.computed(()=>st.value),Hl=e.computed(()=>we.value==="mini-radial"),kn=e.computed(()=>["radial","semi-radial","mini-radial"].includes(we.value)),$n=e.computed(()=>we.value==="spider"),jt=e.computed(()=>we.value==="bubble"),en=e.computed(()=>q.value?.chart?.orientation==="horizontal"&&(we.value==="bar"||Zn.value)),pl=t=>{const{minY:a,maxY:n}=Xt.value,i=n-a||1;return I.value.left+(t-a)/i*I.value.width},yl=t=>{const{maxX:a}=Xt.value,n=a+1,p=I.value.height/n;return I.value.top+(t+.5)*p},Rt=e.computed(()=>kn.value?_n.value.left+(Ee.value-_n.value.left-_n.value.right)/2:Ee.value/2),bt=e.computed(()=>$n.value?K.value/2-40:kn.value?_n.value.top+(K.value-_n.value.top-_n.value.bottom)/2:K.value/2),ut=e.computed(()=>{if($n.value){const t=I.value.width-80,a=I.value.height-80;return Math.min(t,a)/2}return Math.min(I.value.width,I.value.height)/2}),qt=e.computed(()=>{const t=q.value,a=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof a=="number"&&a>=0&&a<=1?a:.45;return ut.value*n}),Rl=e.computed(()=>{const t=q.value,a=typeof H.innerSize=="number"?H.innerSize:t?.innerSize;return typeof a!="number"||a<=-100||!(kn.value||$n.value)?1:1+a/100}),ln=e.computed(()=>{const t=Rl.value;if(t===1||t<=0)return;const a=Rt.value,n=bt.value;return`translate(${a}, ${n}) scale(${t}) translate(${-a}, ${-n})`}),Nl=e.ref(0),Xl=e.computed(()=>`semi-radial-fill-clip-${H.chartId}`),zn=e.computed(()=>we.value==="semi-radial"),al=e.computed(()=>zn.value&&Ct.value&&!xl.value),sl=e.computed(()=>zn.value&&Ct.value&&!xl.value&&Gt.value==="fill"),kl=e.computed(()=>{const t=al.value?Nl.value:1,a=Rt.value,n=bt.value,i=qt.value,p=ut.value,g=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${a} ${n} L ${a} ${n} Z`;const w=a+p*Math.cos(g),P=n+p*Math.sin(g),N=a+p*Math.cos(C),$=n+p*Math.sin(C),B=a+i*Math.cos(C),te=n+i*Math.sin(C),Se=a+i*Math.cos(g),je=n+i*Math.sin(g),ue=t>.5?1:0;return`M ${a} ${n} L ${w} ${P} A ${p} ${p} 0 ${ue} 1 ${N} ${$} L ${B} ${te} A ${i} ${i} 0 ${ue} 1 ${Se} ${je} Z`}),Cl=e.computed(()=>{if(!(!zn.value||!al.value)&&!sl.value)return`url(#${Xl.value})`}),Zo=t=>{if(!(!sl.value||t!==0))return`url(#${Xl.value})`},bl=e.ref(0),Bl=e.computed(()=>`radial-reveal-clip-${H.chartId}`),Gn=e.computed(()=>we.value==="radial"),Fl=e.computed(()=>{const t=Gn.value?bl.value:1,a=Rt.value,n=bt.value,i=Math.max(ut.value*1.5,Ee.value,K.value);if(t<=0)return`M ${a} ${n} L ${a} ${n} Z`;if(t>=1){const B=a-i,te=a+i;return`M ${B} ${n} A ${i} ${i} 0 0 1 ${te} ${n} A ${i} ${i} 0 0 1 ${B} ${n} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,C=a+i*Math.cos(p),w=n+i*Math.sin(p),P=a+i*Math.cos(g),N=n+i*Math.sin(g),$=t>=.5?1:0;return`M ${a} ${n} L ${C} ${w} A ${i} ${i} 0 ${$} 1 ${P} ${N} Z`}),Vo=e.computed(()=>{if(Cl.value)return Cl.value;if(Gn.value)return`url(#${Bl.value})`});let Il=null;const Uo=()=>{if(!al.value)return;Nl.value=0;const t=S.value,a=performance.now(),n=i=>{const p=i-a,g=Math.min(1,p/t);Nl.value=Go(V.value,g),g<1&&(Il=requestAnimationFrame(n))};Il=requestAnimationFrame(n)},zl=e.computed(()=>q.value?.bubbles?.minSize||8),uo=e.computed(()=>q.value?.bubbles?.maxSize||50),Yl=e.computed(()=>q.value?.bubbles?.opacity||.7),No=(t,a)=>{const n=[15,20,25,18,22],i=n[t%n.length]||20,p=1+Math.sin(a*.5)*.2;return Math.max(5,i*p)},Bo=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.opacity="1")},mo=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.display="none")},Qn=e.computed(()=>H.series),Jn=e.computed(()=>H.series.filter((t,a)=>!ot.value.has(a))),jl=t=>{if(!t)return"primary";const a=t.yAxis??t.axis??t.yAxisId;return a==="secondary"||a==="right"||a===1?"secondary":"primary"},po=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,Mo=e.computed(()=>Jn.value.filter(t=>jl(t)==="primary")),Ml=e.computed(()=>Jn.value.filter(t=>jl(t)==="secondary")),Tn=e.computed(()=>!en.value&&!!oe.value&&Ml.value.length>0),Vn="auto",fo=(t,a,n,i=0,p=100)=>{let g=1/0,C=-1/0;if(t.forEach(N=>{N?.data?.length&&N.data.forEach($=>{typeof $=="number"&&Number.isFinite($)&&(g=Math.min(g,$),C=Math.max(C,$))})}),g===1/0)return{minY:i,maxY:p};let w;if(a===Vn){const N=C-g,$=N>0?N*.1:1;w=Math.max(0,g-$)}else if(typeof a=="number")w=a;else{const N=C-g,$=N>0?N*.1:1;w=Math.max(0,g-$)}let P;if(n===Vn){const N=C-g,$=N>0?N*.1:2;P=C+$}else if(typeof n=="number")P=n;else{const N=C-g,$=N>0?N*.1:2;P=C+$}return{minY:w,maxY:P}},Xt=e.computed(()=>{if(jt.value)return Xo();if(!Jn.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;Jn.value.forEach(n=>{n.data&&n.data.length&&(t=Math.max(t,n.data.length-1))}),H.categories.length>0&&(t=Math.max(t,H.categories.length-1));const a=fo(Mo.value.length?Mo.value:Jn.value,Fe.value,De.value);return{minX:0,maxX:t,minY:a.minY,maxY:a.maxY}}),_o=e.computed(()=>Tn.value?fo(Ml.value,Zt.value,kt.value,Xt.value.minY,Xt.value.maxY):{minY:Xt.value.minY,maxY:Xt.value.maxY}),Xo=()=>{if(!Jn.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,a=-1/0,n=1/0,i=-1/0,p=1/0,g=-1/0,C=!1;if(Jn.value.forEach((Se,je)=>{Se?.data?.length&&Se.data.forEach((ue,ye)=>{let Ne,ge,Je;if(typeof ue=="object"&&ue!==null&&!Array.isArray(ue))Ne=typeof ue.x=="number"?ue.x:ye,ge=typeof ue.y=="number"?ue.y:0,Je=typeof ue.size=="number"?ue.size:20;else if(Array.isArray(ue)&&ue.length>=3)Ne=typeof ue[0]=="number"?ue[0]:ye,ge=typeof ue[1]=="number"?ue[1]:0,Je=typeof ue[2]=="number"?ue[2]:20;else if(typeof ue=="number")Ne=ye,ge=ue,Je=No(je,ye);else return;isFinite(Ne)&&isFinite(ge)&&isFinite(Je)&&(t=Math.min(t,Ne),a=Math.max(a,Ne),n=Math.min(n,ge),i=Math.max(i,ge),p=Math.min(p,Je),g=Math.max(g,Je),C=!0)})}),!C)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===a&&(t=Math.min(t,0),a=Math.max(a,H.categories?.length-1||8)),n===i&&(n=Math.max(0,n-10),i=n+20);const w=a-t,P=i-n;let N,$,B,te;return Ut.value!==null?N=Ut.value:N=t-w*.1,St.value!==null?$=St.value:$=a+w*.1,Fe.value!==null&&typeof Fe.value=="number"?B=Fe.value:B=Math.max(0,n-P*.1),De.value!==null&&typeof De.value=="number"?te=De.value:te=i+P*.1,{minX:N,maxX:$,minY:B,maxY:te,minSize:p,maxSize:g}},Kt=t=>{if(jt.value){const{minX:w,maxX:P}=Xt.value,N=P-w||1;return I.value.left+(t-w)/N*I.value.width}const{minX:a,maxX:n}=Xt.value,i=n-a;if(n===0||i===0)return I.value.left+I.value.width/2;const p=i/se.value.scale,g=a-se.value.offsetX/I.value.width*i,C=(t-g)/p;return I.value.left+C*I.value.width},wn=t=>{const{minY:a,maxY:n}=Xt.value,i=n-a||1;return I.value.bottom-(t-a)/i*I.value.height},$o=t=>{const{minY:a,maxY:n}=_o.value,i=n-a||1;return I.value.bottom-(t-a)/i*I.value.height},xn=(t,a)=>Tn.value&&jl(t)==="secondary"?$o(a):wn(a),vo=t=>{if(!jt.value)return Vt.value||4;const{maxSize:a}=Xt.value,n=Math.max(1,a),i=Math.min(1,Math.max(0,t/n));return zl.value+i*(uo.value-zl.value)},_l=(t,a=12,n="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(a*.62);_l.canvas||(_l.canvas=document.createElement("canvas"));const i=_l.canvas.getContext("2d");return i?(i.font=`${a}px ${n}`,i.measureText(t).width):t.length*(a*.62)},go=(t,a,n=12)=>{if(typeof t!="string"||typeof a!="number"||a<=0||_l(t,n)<=a)return t;const i="..";if(_l(i,n)>=a)return i;let g=t.length;for(;g>0;){const C=`${t.slice(0,g)}${i}`;if(_l(C,n)<=a)return C;g-=1}return i},Lo=e.computed(()=>s.value.map(t=>({y:t.y}))),o=e.computed(()=>{if(jt.value)return l();if(we.value==="bar"){if(en.value){const _e=[],{minY:Re,maxY:$t}=Xt.value,Pt=5,Yn=$t-Re||1;for(let hn=0;hn<=Pt;hn++){const jn=Re+Yn*(hn/Pt),Fo=pl(jn);_e.push({x:Fo,y:I.value.bottom+20,text:Dt(Math.round(jn))})}return _e}const ye=[],{maxX:Ne}=Xt.value,ge=Ne+1,Je=5,Ae=(I.value.width-Je*2)/ge;for(let _e=0;_e<=Ne;_e++){const Re=I.value.left+Je+(_e+.5)*Ae;ye.push({x:Re,y:I.value.bottom+20,text:go(H.categories[_e]||M("chart.fallback.item",{number:_e+1}),Math.max(Ae-8,24))})}return ye}const t=[],{minX:a,maxX:n}=Xt.value,i=Ut.value!==null?Ut.value:a,p=St.value!==null?St.value:n,g=p-i||1,C=g/se.value.scale,w=i-se.value.offsetX/I.value.width*g,P=w+C,N=Math.max(0,Math.floor(w-2)),$=Math.min(p,Math.ceil(P+2)),B=$-N,te=I.value.width,je=Math.floor(te/60);let ue=1;B>je&&(ue=Math.ceil(B/je));for(let ye=N;ye<=$;ye+=ue)if(ye>=0&&ye<=p){const Ne=Kt(ye);Ne>=I.value.left-100&&Ne<=I.value.right+100&&t.push({x:Ne,y:I.value.bottom+20,text:H.categories[ye]||`Item ${ye+1}`})}return t}),l=()=>{const t=[],{minX:a,maxX:n}=Xt.value,i=n-a||1,p=Math.min(8,Math.max(4,Math.floor(I.value.width/80)));for(let g=0;g<=p;g++){const C=a+i*g/p,w=Kt(C);if(w>=I.value.left-10&&w<=I.value.right+10){const P=Math.round(C),N=H.categories?.[P];t.push({x:w,y:I.value.bottom+20,text:N||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},s=e.computed(()=>{if(en.value){const p=[],{maxX:g}=Xt.value;for(let C=0;C<=g;C++)p.push({x:I.value.left-10,y:yl(C),text:go(H.categories[C]||`Item ${C+1}`,Math.max(I.value.left-28,40))});return p}const t=[],{minY:a,maxY:n}=Xt.value,i=5;for(let p=0;p<=i;p++){const g=a+(n-a)*(p/i),C=Math.round(g);t.push({x:I.value.left-10,y:wn(g),text:Dt(C)})}return t}),r=e.computed(()=>{if(!Tn.value||en.value)return[];const t=[],{minY:a,maxY:n}=_o.value,i=5;for(let p=0;p<=i;p++){const g=a+(n-a)*(p/i),C=Math.round(g);t.push({x:I.value.right+10,y:$o(g),text:Dt(C)})}return t}),c=t=>{const a=on.value;if(!a||a.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return a[t%a.length]},d=t=>{if(!t||typeof t!="string")return"#3a3a3a";const a=t.trim();let n=0,i=0,p=0;const g=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)n=Number(g[1])/255,i=Number(g[2])/255,p=Number(g[3])/255;else{const w=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(w)n=Number(w[1])/255,i=Number(w[2])/255,p=Number(w[3])/255;else{const P=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(P){let N=P[1];N.length===3&&(N=N[0]+N[0]+N[1]+N[1]+N[2]+N[2]),n=parseInt(N.slice(0,2),16)/255,i=parseInt(N.slice(2,4),16)/255,p=parseInt(N.slice(4,6),16)/255}else if(typeof document<"u"){const N=document.createElement("span");N.style.color=a,N.style.display="none",document.body.appendChild(N);const $=getComputedStyle(N).color;document.body.removeChild(N);const B=$.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(B)n=Number(B[1])/255,i=Number(B[2])/255,p=Number(B[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*i+.0722*p>.5?"#3a3a3a":"#fafafa"},u=t=>{if(!t||typeof t!="string")return t;const a=t.trim(),n=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(n){const g=Math.max(0,Math.floor(Number(n[1])*.65)),C=Math.max(0,Math.floor(Number(n[2])*.65)),w=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${C}, ${w})`}const i=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(i){const g=Math.max(0,Math.floor(Number(i[1])*.65)),C=Math.max(0,Math.floor(Number(i[2])*.65)),w=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${C}, ${w}, ${i[4]})`}const p=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(p){let g=p[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const C=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),w=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),P=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[C,w,P].map(N=>N.toString(16).padStart(2,"0")).join("")}`}return a},m=(t,a)=>{const i=q.value?.stroke?.color;return i==null?u(a):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??u(a):u(a)},v=t=>{let a=0;for(let n=1;n<t.length;n++){const i=t[n].x-t[n-1].x,p=t[n].y-t[n-1].y;a+=Math.sqrt(i*i+p*p)}return a},k=e.computed(()=>we.value==="line"||Zn.value?(Zn.value?H.series.filter(a=>(a.type||we.value)==="line"):Qn.value).map((a,n)=>{const i=H.series.findIndex(B=>B===a),p=[];let g=[];a.data.forEach((B,te)=>{B==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:en.value?pl(B):Kt(te),y:en.value?yl(te):xn(a,B),index:te})}),g.length>0&&p.push(g);let C="";p.forEach(B=>{if(B.length>0){let te="";ke.value?te=Ul(B):te=`M ${B[0].x} ${B[0].y}`+B.slice(1).map(Se=>` L ${Se.x} ${Se.y}`).join(""),C+=(C?" ":"")+te}});const w=p.reduce((B,te)=>B+v(te),0),P=ot.value.has(i),N=ce.value===i,$=ce.value!==null&&ce.value!==i;return{path:C,color:c(i),strokeDasharray:po(a),pathLength:w,seriesIndex:i,animationDelay:n*Y.value,isHighlighted:N,isDimmed:$,isHidden:P}}):[]),_=e.computed(()=>{if(!(we.value==="line"||Zn.value))return[];const t=Zn.value?H.series.filter(n=>(n.type||we.value)==="line"):Qn.value,a=[];return t.forEach((n,i)=>{const p=H.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const C=n.data[g];if(C!=null){let w=-1,P=0;for(let N=g+1;N<n.data.length;N++){const $=n.data[N];if($==null)P++;else{w=N;break}}if(P>0&&w!==-1){const N=n.data[w],$=en.value?pl(C):Kt(g),B=en.value?yl(g):xn(n,C),te=en.value?pl(N):Kt(w),Se=en.value?yl(w):xn(n,N),je=ot.value.has(p),ue=ce.value===p,ye=ce.value!==null&&ce.value!==p;a.push({path:`M ${$} ${B} L ${te} ${Se}`,color:c(p),seriesIndex:p,animationDelay:i*Y.value,isHighlighted:ue,isDimmed:ye,isHidden:je,gapSize:P}),g=w-1}}}}),a}),D=e.computed(()=>we.value==="line"||Zn.value?!Ct.value||xl.value||Ft.value.hasAnimated?[]:(Zn.value?H.series.filter(a=>(a.type||we.value)==="line"):Qn.value).map((a,n)=>{const i=H.series.findIndex(P=>P===a);let p="",g=null;a.data.forEach((P,N)=>{if(P!=null){const $={x:en.value?pl(P):Kt(N),y:en.value?yl(N):xn(a,P)};g===null?p+=`M ${$.x} ${$.y}`:p+=` L ${$.x} ${$.y}`,g=$}else if(g!==null){const $=a.data.findIndex((B,te)=>te>N&&B!==null&&B!==void 0);if($!==-1){const B={x:en.value?pl(a.data[$]):Kt($),y:en.value?yl($):xn(a,a.data[$])};p+=` L ${B.x} ${B.y}`,g=B}}});const C=a.data.map((P,N)=>P==null?null:{x:en.value?pl(P):Kt(N),y:en.value?yl(N):xn(a,P)}).filter(P=>P!==null),w=v(C);return{path:p,pathLength:w,color:c(i),strokeDasharray:po(a),animationDelay:n*Y.value,seriesIndex:i}}):[]),E=e.computed(()=>{if(we.value!=="line")return[];const t=[];return Qn.value.forEach((a,n)=>{const i=ce.value===n,p=ce.value!==null&&ce.value!==n,g=ot.value.has(n);a.data.forEach((C,w)=>{C!=null&&t.push({x:Kt(w),y:xn(a,C),color:c(n),value:C,label:H.categories[w]||w.toString(),seriesName:a.name,categoryIndex:w,dataIndex:w,animationDelay:(n*a.data.length+w)*(Y.value/8),isHighlighted:i,isDimmed:p,isHidden:g})})}),t}),re=e.computed(()=>{if(!Zn.value)return[];const t=[];return H.series.filter(n=>(n.type||we.value)==="line").forEach((n,i)=>{const p=H.series.findIndex(P=>P===n),g=ce.value===p,C=ce.value!==null&&ce.value!==p,w=ot.value.has(p);n.data.forEach((P,N)=>{P!=null&&t.push({x:Kt(N),y:xn(n,P),color:c(p),value:P,label:H.categories[N]||N.toString(),seriesName:n.name,categoryIndex:N,dataIndex:N,animationDelay:(i*n.data.length+N)*(Y.value/8),isHighlighted:g,isDimmed:C,isHidden:w})})}),t}),j=e.computed(()=>{if(!jt.value)return[];const t=[];return Qn.value.forEach((a,n)=>{if(!a?.data?.length)return;const i=ce.value,p=i!==null&&i===n,g=i!==null&&i!==n,C=ot.value.has(n);a.data.forEach((w,P)=>{let N,$,B,te,Se;if(typeof w=="object"&&w!==null&&!Array.isArray(w))N=typeof w.x=="number"?w.x:P,$=typeof w.y=="number"?w.y:0,B=typeof w.size=="number"?w.size:20,te=w.label||H.categories?.[P]||`Point ${P+1}`,Se=w.image||w.imageUrl;else if(Array.isArray(w)&&w.length>=3)N=typeof w[0]=="number"?w[0]:P,$=typeof w[1]=="number"?w[1]:0,B=typeof w[2]=="number"?w[2]:20,te=w[3]||H.categories?.[P]||`Point ${P+1}`,Se=w[4];else if(typeof w=="number")N=P,$=w,B=No(n,P),te=H.categories?.[P]||`Point ${P+1}`;else return;!isFinite(N)||!isFinite($)||!isFinite(B)||t.push({x:Kt(N),y:wn($),radius:vo(B),originalX:N,originalY:$,originalSize:B,color:c(n),seriesName:a.name||`Series ${n+1}`,label:te,imageUrl:Se,seriesIndex:n,dataIndex:P,categoryIndex:Math.round(N),isHighlighted:p,isDimmed:g,isHidden:C,opacity:Yl.value})})}),t}),Ie=e.computed(()=>we.value!=="area"?[]:Qn.value.map((t,a)=>{const n=[];let i=[];if(t.data.forEach((B,te)=>{B==null?i.length>0&&(n.push([...i]),i=[]):i.push({x:Kt(te),y:xn(t,B),index:te})}),i.length>0&&n.push(i),n.length===0)return{linePath:"",areaPath:"",color:c(a),isHidden:ot.value.has(a)};const p=I.value.bottom+1;let g="",C="";n.forEach((B,te)=>{if(B.length===0)return;let Se=`M ${B[0].x} ${B[0].y}`;ke.value&&B.length>1?Se=Ul(B):B.slice(1).forEach(ue=>{Se+=` L ${ue.x} ${ue.y}`}),g+=(g?" ":"")+Se;let je=`M ${B[0].x} ${p}`;if(je+=` L ${B[0].x} ${B[0].y}`,ke.value&&B.length>1){const ue=Ul(B),ye=ue.substring(ue.indexOf("C")||ue.indexOf("Q")||ue.indexOf("L"));ye?je+=" "+ye:B.slice(1).forEach(Ne=>{je+=` L ${Ne.x} ${Ne.y}`})}else B.slice(1).forEach(ue=>{je+=` L ${ue.x} ${ue.y}`});je+=` L ${B[B.length-1].x} ${p} Z`,C+=(C?" ":"")+je});const w=ce.value===a,P=ce.value!==null&&ce.value!==a,N=ot.value.has(a),$=n.reduce((B,te)=>B+v(te),0);return{linePath:g,areaPath:C,color:c(a),pathLength:$,isHighlighted:w,isDimmed:P,isHidden:N}})),Ve=e.computed(()=>{if(!(["bar"].includes(we.value)||Zn.value))return[];const t=[],{maxX:a}=Xt.value,n=Zn.value?H.series.filter(p=>(p.type||we.value)==="bar"):Qn.value,i=n.length;if(en.value){const p=a+1,C=I.value.height/p,w=C*(2/3),P=Math.min(4,w/i*.15),N=w-(i-1)*P,$=Math.max(4,N/i);n.forEach((B,te)=>{const Se=H.series.findIndex(Ne=>Ne===B),je=ce.value===Se,ue=ce.value!==null&&ce.value!==Se,ye=ot.value.has(Se);B.data.forEach((Ne,ge)=>{if(Ne==null||typeof Ne!="number"||!isFinite(Ne))return;const Ae=I.value.top+(ge+.5)*C-w/2+te*($+P),_e=I.value.left,Re=Math.abs(pl(Ne)-I.value.left);let $t="";if(ke.value&&Re>0){const Pt=Math.min(Nt.value,$/2,Re/2);$t=[`M ${_e} ${Ae}`,`L ${_e+Re-Pt} ${Ae}`,`Q ${_e+Re} ${Ae} ${_e+Re} ${Ae+Pt}`,`L ${_e+Re} ${Ae+$-Pt}`,`Q ${_e+Re} ${Ae+$} ${_e+Re-Pt} ${Ae+$}`,`L ${_e} ${Ae+$}`,"Z"].join(" ")}t.push({x:_e,y:Ae,width:Re,height:$,color:c(i===1?ge:Se),value:Ne,label:H.categories[ge]||ge.toString(),seriesName:B.name,animationDelay:(te*n.length+ge)*(Y.value/4),isHighlighted:je,isDimmed:ue,isHidden:ye,barPath:$t,isSmooth:ke.value&&Re>0})})})}else{const p=a+1,C=I.value.width/p,w=C*.8,P=w/i,N=P*.05,$=P-N;n.forEach((B,te)=>{const Se=H.series.findIndex(Ne=>Ne===B),je=ce.value===Se,ue=ce.value!==null&&ce.value!==Se,ye=ot.value.has(Se);B.data.forEach((Ne,ge)=>{if(Ne==null||typeof Ne!="number"||!isFinite(Ne))return;const Ae=I.value.left+(ge+.5)*C-w/2+te*P+N/2,_e=wn(Math.max(0,Ne)),Re=Math.abs(wn(0)-wn(Ne));let $t="";if(ke.value&&Re>0){const Pt=Math.min(Nt.value,$/2,Re/2);$t=[`M ${Ae} ${_e+Re}`,`L ${Ae} ${_e+Pt}`,`Q ${Ae} ${_e} ${Ae+Pt} ${_e}`,`L ${Ae+$-Pt} ${_e}`,`Q ${Ae+$} ${_e} ${Ae+$} ${_e+Pt}`,`L ${Ae+$} ${_e+Re}`,"Z"].join(" ")}t.push({x:Ae,y:_e,width:$,height:Re,color:c(i===1?ge:Se),value:Ne,label:H.categories[ge]||ge.toString(),seriesName:B.name,animationDelay:(te*n.length+ge)*(Y.value/4),isHighlighted:je,isDimmed:ue,isHidden:ye,barPath:$t,isSmooth:ke.value&&Re>0})})})}return t}),nt=e.computed(()=>{if(!kn.value)return[];const t=Qn.value.map((C,w)=>({series:C,originalIndex:w})).filter(({originalIndex:C})=>!ot.value.has(C));if(t.length===0)return[];let a=we.value==="semi-radial"?Math.PI:-Math.PI/2;const n=we.value==="semi-radial"?Math.PI:Math.PI*2,i=[],p=(C,w,P,N,$,B)=>{const te=C+(w-C)/2,Se=w-C,je=Rt.value+Math.cos(C)*qt.value,ue=bt.value+Math.sin(C)*qt.value,ye=Rt.value+Math.cos(w)*qt.value,Ne=bt.value+Math.sin(w)*qt.value,ge=Rt.value+Math.cos(w)*ut.value,Je=bt.value+Math.sin(w)*ut.value,Oe=Rt.value+Math.cos(C)*ut.value,Ae=bt.value+Math.sin(C)*ut.value,_e=Se>Math.PI?1:0,Re=[`M ${je} ${ue}`,`A ${qt.value} ${qt.value} 0 ${_e} 1 ${ye} ${Ne}`,`L ${ge} ${Je}`,`A ${ut.value} ${ut.value} 0 ${_e} 0 ${Oe} ${Ae}`,"Z"].join(" "),$t=B||c(P);return{path:Re,color:$t,strokeWidth:rt.value,strokeColor:m(i.length,$t),value:$,seriesName:N,opacity:.8,isHighlighted:ce.value===P,isDimmed:ce.value!==null&&ce.value!==P,isHidden:!1,startAngle:C,endAngle:w,midAngle:te}};if(Hl.value){const{series:C,originalIndex:w}=t[0],P=Number(C?.data?.[0]??0),N=Number.isFinite(P)?Math.min(Math.max(P,0),100):0,$=q.value,B=Math.min(Math.max(Number($?.miniRadial?.minVisiblePercent??1),0),100),Se=(N<=0?B:N)/100*n,je=Number($?.miniRadial?.thresholds?.low??33),ue=Number($?.miniRadial?.thresholds?.medium??66),ye=$?.miniRadial?.colors?.low||"#E53E3E",Ne=$?.miniRadial?.colors?.medium||"#ED8936",ge=$?.miniRadial?.colors?.high||"#38A169",Je=N<=je?ye:N<=ue?Ne:ge,Oe=$?.miniRadial?.trackColor||"#E5E7EB",Ae=C?.name||"Score";return i.push(p(a,a+n-.001,w+1,"Track",100,Oe)),i.push(p(a,a+Se,w,Ae,N,Je)),i}if(t.length===1){const{series:C,originalIndex:w}=t[0],P=C.data[0]||0,N=a,$=a+n-.001,B=N+n/2,te=Rt.value+Math.cos(N)*qt.value,Se=bt.value+Math.sin(N)*qt.value,je=Rt.value+Math.cos($)*qt.value,ue=bt.value+Math.sin($)*qt.value,ye=Rt.value+Math.cos($)*ut.value,Ne=bt.value+Math.sin($)*ut.value,ge=Rt.value+Math.cos(N)*ut.value,Je=bt.value+Math.sin(N)*ut.value,Oe=1,Ae=[`M ${te} ${Se}`,`A ${qt.value} ${qt.value} 0 ${Oe} 1 ${je} ${ue}`,`L ${ye} ${Ne}`,`A ${ut.value} ${ut.value} 0 ${Oe} 0 ${ge} ${Je}`,"Z"].join(" "),_e=c(w);return i.push({path:Ae,color:_e,strokeWidth:rt.value,strokeColor:m(0,_e),value:P,seriesName:C.name,opacity:.8,isHighlighted:ce.value===w,isDimmed:!1,isHidden:!1,startAngle:N,endAngle:$,midAngle:B}),i}if(sl.value&&t.length===2){const C=t[0],w=t[1],P=Math.min(100,Math.max(0,C.series.data[0]||0)),N=P/100*n;return i.push(p(a,a+N,C.originalIndex,C.series.name,P)),i.push(p(a,a+n,w.originalIndex,w.series.name,100)),i}const g=t.reduce((C,{series:w})=>C+(w.data[0]||0),0);return g===0?[]:(t.forEach(({series:C,originalIndex:w})=>{const P=C.data[0]||0,N=P/g*n,$=a,B=a+N,te=$+N/2,Se=Rt.value+Math.cos($)*qt.value,je=bt.value+Math.sin($)*qt.value,ue=Rt.value+Math.cos(B)*qt.value,ye=bt.value+Math.sin(B)*qt.value,Ne=Rt.value+Math.cos(B)*ut.value,ge=bt.value+Math.sin(B)*ut.value,Je=Rt.value+Math.cos($)*ut.value,Oe=bt.value+Math.sin($)*ut.value,Ae=N>Math.PI?1:0,_e=[`M ${Se} ${je}`,`A ${qt.value} ${qt.value} 0 ${Ae} 1 ${ue} ${ye}`,`L ${Ne} ${ge}`,`A ${ut.value} ${ut.value} 0 ${Ae} 0 ${Je} ${Oe}`,"Z"].join(" "),Re=c(w);i.push({path:_e,color:Re,strokeWidth:rt.value,strokeColor:m(i.length,Re),value:P,seriesName:C.name,opacity:.8,isHighlighted:ce.value===w,isDimmed:ce.value!==null&&ce.value!==w,isHidden:!1,startAngle:$,endAngle:B,midAngle:te}),a=B}),i)}),Cn=e.computed(()=>{const t=nt.value;return sl.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((a,n)=>({segment:a,originalIndex:n}))}),vn=e.computed(()=>{if(!Hn.value||!kn.value)return[];const t=On.value,a=gl.value,n=El.value,i=Pl.value,p=15,g=t*1.3,C=.55,w=(B,te)=>{const Se=Rt.value+Math.cos(B.midAngle)*ut.value,je=bt.value+Math.sin(B.midAngle)*ut.value,ue=Rt.value+Math.cos(B.midAngle)*(ut.value+a),ye=bt.value+Math.sin(B.midAngle)*(ut.value+a),ge=ue+n*(te?1:-1),Je=te?ue+p:ue-p,Oe=ye-i,Ae=`${B.seriesName}: ${Dt(B.value)}`,_e=Ae.length*t*C;return{pointerStartX:Se,pointerStartY:je,pointerEndX:ue,pointerEndY:ye,horizontalEndX:ge,horizontalEndY:ye,textX:Je,textY:Oe,text:Ae,textWidth:_e,textAnchor:te?"start":"end",isRightSide:te,pointerLineLength:Math.hypot(ue-Se,ye-je),horizontalLineLength:Math.hypot(ge-ue,0)}},P=(B,te)=>{const Se=Math.abs(B.textY-te.textY)<g,je=B.isRightSide?B.textX:B.textX-B.textWidth,ue=B.isRightSide?B.textX+B.textWidth:B.textX,ye=te.isRightSide?te.textX:te.textX-te.textWidth,Ne=te.isRightSide?te.textX+te.textWidth:te.textX,ge=je<Ne&&ye<ue;return Se&&ge},N=nt.value.filter(B=>!B.isHidden),$=[];for(let B=0;B<N.length;B++){const te=N[B];let Se=Math.cos(te.midAngle)>=0;if(B>0){const ue=$[B-1],ye=w(te,Se);P(ue,ye)&&(Se=!Se)}const je=w(te,Se);$.push({...je,color:te.color,isHighlighted:te.isHighlighted,isDimmed:te.isDimmed})}return $}),cn=t=>{if(!t||t.isHidden)return 0;const a=t.opacity||Yl.value||.7;return ce.value===null||ce.value===void 0?a:ce.value!==null?t.seriesIndex===ce.value?Math.min(1,a+.1):Math.max(.5,a*.8):a},gn=t=>{if(!t||t.isHidden)return 0;const a=t.radius>20?.9:.8;return ce.value!==null?t.seriesIndex===ce.value?Math.min(1,a+.1):a*.7:a},dn=(t,a)=>{if(t)try{if(ce.value===t.seriesIndex?ce.value=null:ce.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:a,chartId:H.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},mn=(t,a)=>{const n=[`dss-bubble-fallback-${a}`];return t.isHighlighted&&n.push("dss-bubble-highlighted"),t.isDimmed&&n.push("dss-bubble-dimmed"),t.isHidden&&n.push("dss-bubble-hidden"),n.push(`dss-bubble-series-${t.seriesIndex}`),n.join(" ")},Un=(t,a)=>{if(!t||(a.stopPropagation(),Ho.value=!0,ce.value=t.seriesIndex,at.value.show=!1,!Xe.value))return;const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect();let p=a.clientX-i.left+10,g=a.clientY-i.top-10;const C=200,w=120;p+C>Ee.value&&(p=a.clientX-i.left-C-10),g+w>i.height&&(g=a.clientY-i.top-w-10),p<0&&(p=10),g<0&&(g=10);const P=Jt.value,N=sn.value,$=P.map(B=>{const te=N[B]||B,Se=rl(B,t);return Se?{seriesName:t.seriesName,label:t.label,value:`${te}: ${Se}`,color:t.color}:null}).filter(Boolean);yt.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:$,categoryIndex:void 0,spiderAreas:[]}},rl=(t,a)=>{let n;switch(t){case"x":n=a.originalX;break;case"y":n=a.originalY;break;case"size":n=a.originalSize;break;case"label":n=a.label;break;case"seriesName":n=a.seriesName;break;default:n=a[t]||""}const i=nl.value[t];if(typeof i=="function")return i(n,a);if(typeof n=="number"){const p=n.toFixed(1);return An.value?p+An.value:p}return n?.toString()||""},fl=()=>{if(!jt.value||!at.value.data||at.value.data.length===0)return"Bubbles";const t=[],a=new Set;return at.value.data.forEach(n=>{if(n.seriesName&&n.label){const i=`${n.seriesName} - ${n.label}`;a.has(i)||(t.push(i),a.add(i))}else n.seriesName&&(a.has(n.seriesName)||(t.push(n.seriesName),a.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},ho=(t,a)=>{t&&(Ho.value=!1,ce.value=null,yt.value.show=!1,yt.value.bubbleData=[])},To=(t,a)=>{const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect(),p=Al(t.categoryIndex),g=t.description||t.comment||"";let C=a.clientX-i.left+15,w=a.clientY-i.top-10;const P=200,N=g?80:50;C+P>Ee.value&&(C=a.clientX-i.left-P-15),w+N>K.value&&(w=a.clientY-i.top-N-10),C<0&&(C=10),w<0&&(w=10),pn.value={show:!0,x:C,y:w,categoryValue:p,description:g}},Yo=()=>{pn.value.show=!1},wl=e.computed(()=>H.categories.length||Math.max(...Jn.value.map(t=>t.data.length))),ta=e.computed(()=>{let t=0;return Jn.value.forEach(a=>{a.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),yo=e.computed(()=>{const t=[],a=wl.value;for(let n=0;n<a;n++){const i=n*2*Math.PI/a-Math.PI/2,p=Rt.value+Math.cos(i)*ut.value,g=bt.value+Math.sin(i)*ut.value;t.push({x:p,y:g,angle:i,index:n})}return t}),Kl=e.computed(()=>{const t=[],a=wl.value;return yo.value.forEach((n,i)=>{const p=ut.value+15,g=i*2*Math.PI/a-Math.PI/2,C=Rt.value+Math.cos(g)*p,w=bt.value+Math.sin(g)*p+5;let P="middle",N="middle";Math.abs(Math.cos(g))>.5&&(P=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(N=Math.sin(g)>0?"hanging":"auto"),t.push({x:C,y:w,text:H.categories[i]||`Axis ${i+1}`,anchor:P,baseline:N})}),t}),Ao=e.ref(new Set),il=(t,a,n)=>{const i=`current-${n}`,p=Ao.value.has(i);return!p&&ce.value===null?a.fillOpacity||ht.value:a.isHighlighted||p?(a.fillOpacity||ht.value)+.15:a.isDimmed?(a.fillOpacity||ht.value)*.3:a.fillOpacity||ht.value},el=e.computed(()=>{if(!$n.value)return[];const t=[],a=wl.value;return Qn.value.forEach((n,i)=>{const p=[],g=[],C=[],w=ce.value===i,P=ce.value!==null&&ce.value!==i,N=ot.value.has(i);for(let $=0;$<a;$++){const B=n.data[$]||0,Se=B/ta.value*ut.value,je=$*2*Math.PI/a-Math.PI/2,ue=Rt.value+Math.cos(je)*Se,ye=bt.value+Math.sin(je)*Se;p.push(`${ue},${ye}`),g.push({x:ue,y:ye}),C.push({x:ue,y:ye,value:B,label:H.categories[$]||`Axis ${$+1}`,seriesName:n.name})}t.push({points:p.join(" "),polygonPoints:g,dataPoints:C,color:c(i),fillOpacity:ht.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:w,isDimmed:P,isHidden:N,seriesIndex:i})}),t}),Xn=(t,a)=>{if(!a||a.length<3)return!1;let n=!1;for(let i=0,p=a.length-1;i<a.length;p=i++){const g=a[i].x,C=a[i].y,w=a[p].x,P=a[p].y;C>t.y!=P>t.y&&t.x<(w-g)*(t.y-C)/(P-C)+g&&(n=!n)}return n},na=t=>{if(!$n.value)return;const a=t.currentTarget.closest(".dss-custom-chart-container");if(!a)return;const n=a.getBoundingClientRect(),i=A.value?.getBoundingClientRect();if(!i)return;const p=t.clientX-i.left,g=t.clientY-i.top,C=el.value.filter(w=>w.isHidden?!1:Xn({x:p,y:g},w.polygonPoints));if(C.length>0){C.length,ce.value=C[0].seriesIndex;const w=t.clientX-n.left+10,P=t.clientY-n.top-10,N=C.length>1?460:260,$=70+wl.value*20;let B=w,te=P;B+N>Ee.value&&(B=t.clientX-n.left-N-10),te+$>K.value&&(te=t.clientY-n.top-$-10),B<0&&(B=10),te<0&&(te=10);const Se=C.map(je=>({seriesName:je.seriesName,color:je.color,points:je.dataPoints.map(ue=>({label:ue.label,value:Dt(ue.value)}))}));yt.value={show:!0,x:B,y:te,title:"",value:"",bubbleData:[],spiderAreas:Se}}else vl()},Do=e.computed(()=>{const t=q.value;return t.logos.map((a,n)=>{const i=H.series[a.seriesIndex];if(!i||!i.data||i.data.length===0||ot.value.has(a.seriesIndex))return null;let p,g;if(Sn.value){let w=-1,P=null;for(let $=i.data.length-1;$>=0;$--)if(i.data[$]!==null&&i.data[$]!==void 0){w=$,P=i.data[$];break}if(w===-1||P===null)return null;const N=i.data.map(($,B)=>$==null?null:{x:Kt(B),y:xn(i,$),index:B}).filter($=>$!==null);if(t.animations.enabled&&!xl.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Ft.value.isAnimating||!Ft.value.hasAnimated))if(Ft.value.isAnimating){const $=Ft.value.currentFrame/Ft.value.totalFrames,B=Go(t.animations.easing,Math.min($,1)),te=wa(N,B);p=te.x+(a.offsetX||0),g=te.y+(a.offsetY||0)}else p=N[0].x+(a.offsetX||0),g=N[0].y+(a.offsetY||0);else p=Kt(w)+(a.offsetX||0),g=wn(P)+(a.offsetY||0)}else if(kn.value||$n.value){const w=Math.PI*2/t.logos.length*n;p=Rt.value+Math.cos(w)*(ut.value+30)+(a.offsetX||0),g=bt.value+Math.sin(w)*(ut.value+30)+(a.offsetY||0)}return{...a,x:p,y:g,seriesIndex:a.seriesIndex}}).filter(Boolean)}),fa=t=>{const a=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.opacity="0"),n&&(n.style.opacity="1")},va=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const a=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.display="none")},jo=t=>{ot.value.has(t)?ot.value.delete(t):ot.value.add(t)},ga=e.computed(()=>{if(!yt.value.show&&!(Ge.value&&at.value.show&&!se.value.isZooming))return{display:"none"};let t,a;if(Ge.value&&at.value.show&&!se.value.isZooming){t=at.value.x+15,a=I.value.top;const n=jt.value?200:150;t+n>Ee.value&&(t=at.value.x-n-15),t<0&&(t=10),a<10&&(a=10)}else t=yt.value.x,a=yt.value.y;return{left:t+"px",top:a+"px"}}),$l=(t,a)=>{if(!Xe.value||ko.value)return;const i=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-i.left+10,g=a.clientY-i.top-10;const C=200,w=120,P=Ee.value,N=K.value;p+C>P&&(p=a.clientX-i.left-C-10),g+w>N&&(g=a.clientY-i.top-w-10),p<0&&(p=10),g<0&&(g=10);let $;typeof t.categoryIndex=="number"?$=t.categoryIndex:typeof t.dataIndex=="number"?$=t.dataIndex:t.label&&H.categories.includes(t.label)&&($=H.categories.indexOf(t.label));const B=(en.value||we.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";yt.value={show:!0,x:p,y:g,title:B,value:Dt(t.value)||"",categoryIndex:$,spiderAreas:[]}},Ko=e.ref(!1),Ho=e.ref(!1),vl=()=>{yt.value.show=!1,yt.value.spiderAreas=[],yt.value.bubbleData=[],at.value.show=!1,Ko.value||(ce.value=null)},ko=e.ref(!1),Co=(t,a)=>{ko.value=!0,yt.value.show=!1,at.value.show=!1;const i=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-i.left+15,g=a.clientY-i.top-10;const C=250;p+C>Ee.value&&(p=a.clientX-i.left-C-15),p<0&&(p=10),g<0&&(g=10),yn.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},bo=()=>{ko.value=!1,yn.value.show=!1},Ft=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),Go=(t,a)=>{switch(t){case"linear":return a;case"ease":return a<.5?2*a*a:-1+(4-2*a)*a;case"ease-in":return a*a;case"ease-out":return a*(2-a);case"ease-in-out":return a<.5?2*a*a:-1+(4-2*a)*a;default:return a}},xl=e.computed(()=>We.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),la=()=>{if(!Ct.value||xl.value){Ft.value.hasAnimated=!0,Gn.value&&(bl.value=1);return}Gn.value&&(bl.value=0),Ft.value.isAnimating=!0,Ft.value.currentFrame=0,Ft.value.totalFrames=Math.ceil(S.value/16.67);const t=()=>{const a=Ft.value.currentFrame/Ft.value.totalFrames,n=Go(V.value,Math.min(a,1));ha(n),Gn.value&&(bl.value=n),a<1?(Ft.value.currentFrame++,Ft.value.animationId=requestAnimationFrame(t)):ya()};Ft.value.animationId=requestAnimationFrame(t)},ha=t=>{const a=z.value;a&&a.style.setProperty("--dss-animation-progress",t)},ya=()=>{Ft.value.isAnimating=!1,Ft.value.hasAnimated=!0,Gn.value&&(bl.value=1),Ft.value.animationId&&(cancelAnimationFrame(Ft.value.animationId),Ft.value.animationId=null)},Qo=e.computed(()=>!kn.value||Ft.value.hasAnimated?!0:Gn.value?bl.value>=1:zn.value?Nl.value>=1:!0),oa=e.computed(()=>Hn.value&&Qo.value),Ro=e.ref(!1);e.watch(oa,t=>{t?(Ro.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Ro.value=!0})})):Ro.value=!1},{immediate:!0});const ka=e.computed(()=>{if(!Ct.value||xl.value||Ft.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${S.value}ms`,t["--dss-animation-easing"]=Ca(V.value),t["--dss-stagger-delay"]=`${Y.value}ms`,t}),Ca=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",ba=()=>{if(!Ct.value||xl.value)return"";const t=["dss-chart-animated"];return Ft.value.hasAnimated||t.push(`dss-animate-${Gt.value}`),Ft.value.hasAnimated||(kn.value&&we.value!=="semi-radial"?t.push("dss-animate-fill"):kn.value||t.push(`dss-animate-${Gt.value}`)),Ft.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>H.series,(t,a)=>{ae.value&&a&&Ft.value.hasAnimated&&(Ft.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>la(),b.value)}))},{deep:!0}),e.watch(()=>se.value.isZooming,(t,a)=>{a&&!t&&setTimeout(()=>{Dl()},50)}),e.watch(()=>[se.value.scale,se.value.offsetX],()=>{!se.value.isZooming&&!se.value.isDragging&&Dl()},{flush:"post"}),e.watch([zt,Ze],([t,a])=>{se.value.minScale=t,se.value.maxScale=a,(se.value.scale<t||se.value.scale>a)&&co()},{immediate:!0}),e.watch(()=>H.locale,t=>{t&&t!==L.value&&(L.value=t)},{immediate:!0}),e.watch(()=>gt.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",ro)}):document.removeEventListener("click",ro)}),e.onMounted(()=>{ce.value=null,Gn.value&&(!Ct.value||xl.value)&&(bl.value=1),x(),z.value&&typeof ResizeObserver<"u"&&(f=new ResizeObserver(t=>{const a=t[0];!a||!a.contentRect||(be&&cancelAnimationFrame(be),be=requestAnimationFrame(()=>{be=null;const{width:n,height:i}=a.contentRect;pt.value=Math.round(n),J.value=Math.round(i),ve.value&&(Me.value=ve.value.offsetHeight||Ce)}))}),f.observe(z.value)),Ct.value&&!xl.value?we.value==="semi-radial"?setTimeout(()=>Uo(),b.value):setTimeout(()=>la(),b.value):(Ft.value.hasAnimated=!0,we.value==="semi-radial"&&(Nl.value=1)),document.addEventListener("mousemove",aa),document.addEventListener("mouseup",sa),document.addEventListener("click",xo)}),e.onUnmounted(()=>{be&&cancelAnimationFrame(be),f&&z.value&&(f.unobserve(z.value),f.disconnect(),f=null),Ft.value.animationId&&cancelAnimationFrame(Ft.value.animationId),Il&&(cancelAnimationFrame(Il),Il=null),se.value.zoomTimeout&&clearTimeout(se.value.zoomTimeout),document.removeEventListener("mousemove",aa),document.removeEventListener("mouseup",sa),document.removeEventListener("click",xo),document.removeEventListener("click",ro)});const aa=t=>{if(se.value.isDragging&&se.value.scale>1&&Sn.value){at.value.show=!1;const a=t.clientX-se.value.lastMouseX,{minX:n,maxX:i}=Xt.value,p=i-n||1,C=a*.8;se.value.offsetX+=C;const w=p/se.value.scale,P=p-w,N=0,$=-P/p*I.value.width,B=N;se.value.offsetX=Math.max($,Math.min(B,se.value.offsetX)),se.value.lastMouseX=t.clientX,se.value.lastMouseY=t.clientY}},sa=()=>{se.value.isDragging&&(se.value.isDragging=!1,setTimeout(()=>{!se.value.isDragging&&se.value.isZooming},100))},wa=(t,a)=>{const n=t.filter(w=>w!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||a<=0)return n[0];if(a>=1)return n[n.length-1];let i=0;const p=[];for(let w=1;w<n.length;w++){const P=n[w].x-n[w-1].x,N=n[w].y-n[w-1].y,$=Math.sqrt(P*P+N*N);p.push($),i+=$}const g=i*a;let C=0;for(let w=0;w<p.length;w++){const P=C+p[w];if(g<=P){const N=(g-C)/p[w],$=n[w],B=n[w+1];return{x:$.x+(B.x-$.x)*N,y:$.y+(B.y-$.y)*N}}C=P}return n[n.length-1]};return(t,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[ba(),{"dss-chart-fill-width":Ue.value,"dss-chart-fill-height":Pe.value,"dss-chart-compact":kn.value&&!G.value}]]),style:e.normalizeStyle({width:Ue.value?"100%":Ee.value+"px",height:ze.value,...Ue.value||Pe.value?{overflow:kn.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...ka.value,cursor:qo()}),"data-chart-type":we.value,ref_key:"containerEl",ref:z,onWheel:Eo,onMousedown:io,onMousemove:In,onMouseup:So,onMouseleave:Tl,onDblclick:co,onContextmenu:e.withModifiers(Vl,["prevent"]),onClick:e.withModifiers(Wn,["left"]),onWheelCapture:Eo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:ve},[e.createElementVNode("div",vs,[lt.value?(e.openBlock(),e.createElementBlock("div",gs,e.toDisplayString(lt.value),1)):e.createCommentVNode("",!0),xt.value?(e.openBlock(),e.createElementBlock("div",hs,e.toDisplayString(xt.value),1)):e.createCommentVNode("",!0)]),G.value&&he.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Be.value==="horizontal","dss-legend-vertical":Be.value==="vertical","dss-legend-top":he.value==="top","dss-legend-bottom":he.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ot.value.has(i),"dss-legend-hovered":ce.value===i,"dss-legend-dimmed":ce.value!==null&&ce.value!==i}]),onClick:p=>jo(i),onMouseenter:p=>Fn(i),onMouseleave:un,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",ks,e.toDisplayString(n.name),1)],46,ys))),128))],2)):e.createCommentVNode("",!0),G.value&&(he.value==="left"||he.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":he.value==="left","dss-legend-right":he.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ot.value.has(i),"dss-legend-hovered":ce.value===i,"dss-legend-dimmed":ce.value!==null&&ce.value!==i}]),onClick:p=>jo(i),onMouseenter:p=>Fn(i),onMouseleave:un,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",bs,e.toDisplayString(n.name),1)],46,Cs))),128))],2)):e.createCommentVNode("",!0)],512),T.showAddMarkerButton&&Et.value&&wt.value.addMarker&&(Sn.value||jt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:wo,title:e.unref(M)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:_t.value,class:"dss-add-marker-button-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,xs),a[4]||(a[4]=e.createElementVNode("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 4V16M4 10H16",stroke:"hsl(60, 2%, 47%)","stroke-width":"2","stroke-linecap":"round"})],-1))],8,ws)):e.createCommentVNode("",!0),e.createElementVNode("div",Es,[jt.value&&It.value?(e.openBlock(),e.createElementBlock("div",Ss,"Bubble size: "+e.toDisplayString(It.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Ee.value,height:K.value,class:"dss-chart-svg","data-smooth":ke.value,"data-animated":Ct.value,ref_key:"svgEl",ref:A},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:U.value},[e.createElementVNode("rect",{x:0,y:I.value.top,width:Ee.value,height:I.value.height*4},null,8,Bs)],8,Ns),zn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Xl.value},[e.createElementVNode("path",{d:kl.value},null,8,_s)],8,Ms)):e.createCommentVNode("",!0),Gn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:Bl.value},[e.createElementVNode("path",{d:Fl.value},null,8,Ls)],8,$s)):e.createCommentVNode("",!0)]),Sn.value||jt.value?(e.openBlock(),e.createElementBlock("g",Ts,[Wt.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":me.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lo.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${i}`,x1:I.value.left,x2:I.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${i*50}ms`})},null,12,Ds))),128))],8,As)):e.createCommentVNode("",!0),e.createElementVNode("g",Hs,[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,Rs),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,Fs),Tn.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,Is)):e.createCommentVNode("",!0)]),e.createElementVNode("g",zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${i}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},e.toDisplayString(n.text),13,Ps))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${i}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(n.text),13,Os))),128)),Tn.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(r.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-secondary-${i}`,x:n.x,y:n.y,"text-anchor":"start","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(n.text),13,Ws))),128)):e.createCommentVNode("",!0),tn.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","font-weight":"bold",fill:"#333"},e.toDisplayString(tn.value),9,qs)):e.createCommentVNode("",!0),Ot.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","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${I.value.top+I.value.height/2})`},e.toDisplayString(Ot.value),9,Zs)):e.createCommentVNode("",!0),Tn.value&&fe.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:Ee.value-15,y:I.value.top+12+I.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(90, ${Ee.value-15}, ${I.value.top+I.value.height/2})`},e.toDisplayString(fe.value),9,Us)):e.createCommentVNode("",!0)]),Kn.value.length>0?(e.openBlock(),e.createElementBlock("g",Xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Kn.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",{"clip-path":me.value},[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:I.value.bottom,y2:I.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>Co(n,i),onMouseleave:bo},null,40,js)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:I.value.bottom,y2:I.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>Co(n,i),onMouseleave:bo},null,40,Ks)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:I.value.bottom,y2:I.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>Co(n,i),onMouseleave:bo},null,40,Gs)):e.createCommentVNode("",!0)],8,Ys),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,I.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>Co(n,i),onMouseleave:bo},null,40,Qs)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,I.value.top-10),r:"14",fill:n.hasManual&&n.hasAuto||n.hasManual?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:i=>Co(n,i),onMouseleave:bo},null,40,Js),e.createElementVNode("text",{x:n.x,y:Math.max(15,I.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(n.totalCount),9,er)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":me.value},[Zn.value?(e.openBlock(),e.createElementBlock("g",nr,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":en.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ve.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${i}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>$l(n,p),onMouseleave:vl},null,46,lr)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>$l(n,p),onMouseleave:vl},null,46,or))],64))),128))],2),e.createElementVNode("g",ar,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?$e.value+2:$e.value,"stroke-dasharray":n.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,sr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?$e.value+2:$e.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,rr))),128)),Vt.value>0||ee.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(re.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:n.x,cy:n.y,r:X(n.isHighlighted?Z(n,Vt.value)+2:Z(n,Vt.value)),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>$l(n,p),onMouseleave:vl},null,46,ir))),128)):e.createCommentVNode("",!0)])])):we.value==="line"?(e.openBlock(),e.createElementBlock("g",cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:n.path,stroke:n.color,"stroke-width":$e.value,"stroke-dasharray":n.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Ft.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,ur))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?$e.value+2:$e.value,"stroke-dasharray":n.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,dr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?$e.value+2:$e.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,mr))),128)),Vt.value>0||ee.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(E.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:n.x,cy:n.y,r:X(n.isHighlighted?Z(n,Vt.value)+2:Z(n,Vt.value)),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>$l(n,p),onMouseleave:vl},null,46,pr))),128)):e.createCommentVNode("",!0)])):we.value==="area"?(e.openBlock(),e.createElementBlock("g",fr,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie.value,(n,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${T.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,gr)],8,vr))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?pe.value+.2:pe.value,mask:`url(#area-mask-${i}-${T.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden})},null,10,hr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?$e.value+1:$e.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${i*Y.value}ms`})},null,14,yr))),128))])):we.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":en.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ve.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${i}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>$l(n,p),onMouseleave:vl},null,46,kr)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>$l(n,p),onMouseleave:vl},null,46,Cr))],64))),128))],2)):e.createCommentVNode("",!0)],8,tr),Ge.value&&at.value.show&&!se.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":me.value},[e.createElementVNode("line",{x1:at.value.x,x2:at.value.x,y1:I.value.top,y2:I.value.bottom,stroke:Tt.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,wr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:at.value.x,cy:n.y,r:X(Vt.value+2),fill:n.color,stroke:"none",opacity:"0.9"},null,8,xr))),128))],8,br)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),jt.value?(e.openBlock(),e.createElementBlock("g",Er,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[n?(e.openBlock(),e.createElementBlock("g",Sr,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:X(n.radius),fill:n.color,"fill-opacity":cn(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(mn(n,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>Un(n,p),onMouseleave:p=>ho(n),onClick:p=>dn(n,p)},null,42,Vr),n.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:n.x-n.radius*.65,y:n.y-n.radius*.65,width:n.radius*1.3,height:n.radius*1.3,"xlink:href":n.imageUrl,class:e.normalizeClass(`dss-bubble-image-${i} ${n.isHighlighted?"dss-bubble-highlighted":""} ${n.isDimmed?"dss-bubble-dimmed":""} ${n.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${n.radius*.65}px at ${n.radius*.65}px ${n.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:gn(n)}),onLoad:p=>Bo(i),onError:p=>mo(i),onMouseenter:p=>Un(n,p),onMouseleave:p=>ho(n),onClick:p=>dn(n,p)},null,46,Nr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),kn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:ln.value},[we.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Rt.value,cy:bt.value,r:ut.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,Mr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":we.value,"clip-path":Vo.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cn.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${n.originalIndex}-${i}`,d:n.segment.path,fill:n.segment.color,"fill-opacity":n.segment.isHighlighted?(n.segment.opacity||.8)+.2:n.segment.opacity||.8,stroke:n.segment.strokeWidth?n.segment.strokeColor||n.segment.color:"none","stroke-width":n.segment.strokeWidth||0,"clip-path":Zo(n.originalIndex),class:e.normalizeClass({"dss-series-highlighted":n.segment.isHighlighted,"dss-series-dimmed":n.segment.isDimmed,"dss-series-hidden":n.segment.isHidden}),onMouseover:p=>$l(n.segment,p),onMouseleave:vl},null,42,$r))),128))],8,_r),Rn.value&&Qo.value?(e.openBlock(),e.createElementBlock("g",Lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(oo.value,(n,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${i}`,x:n.x,y:n.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label",style:e.normalizeStyle({fill:n.contrastColor})},e.toDisplayString(n.value),13,Tr)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),Ol.value&&(Qo.value||zn.value||Hl.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:cl.value.x,y:cl.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Wl.value,fill:Sl.value,class:"dss-radial-data-center"},e.toDisplayString(Ll.value),9,Ar)):e.createCommentVNode("",!0),oa.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Ro.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vn.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${i}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${i*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:n.pointerStartX,y1:n.pointerStartY,x2:n.pointerEndX,y2:n.pointerEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.pointerLineLength})},null,12,Dr),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:n.pointerEndX,y1:n.pointerEndY,x2:n.horizontalEndX,y2:n.horizontalEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.horizontalLineLength})},null,12,Hr),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":On.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,Rr)],6))),128))],2)):e.createCommentVNode("",!0)],8,Br)):e.createCommentVNode("",!0),$n.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:ln.value},[Wt.value?(e.openBlock(),e.createElementBlock("g",Ir,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:Rt.value,cy:bt.value,r:X(n),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,zr))),128)),e.createElementVNode("g",Pr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:Rt.value-16,y:bt.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Or),e.createElementVNode("text",{x:Rt.value,y:bt.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Bt(i)),9,Wr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yo.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:Rt.value,x2:n.x,y1:bt.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,qr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Zr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Kl.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:n.x+Math.cos(i*2*Math.PI/wl.value-Math.PI/2)*16,y:n.y+Math.sin(i*2*Math.PI/wl.value-Math.PI/2)*16,"text-anchor":n.anchor,"dominant-baseline":n.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${i*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,Ur))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:na,onMouseleave:vl},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(el.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":il("current",n,i),stroke:n.color,"stroke-width":n.isHighlighted?$e.value+1:$e.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${i*Y.value}ms`,transition:"all 0.2s ease"})},null,14,Xr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataPoints,(p,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${i}-${g}`,cx:p.x,cy:p.y,r:X(n.isHighlighted?Vt.value+1:Vt.value>0?Vt.value:0),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${i*Y.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>$l(p,C),onMouseleave:vl},null,46,Yr))),128))]))),128))],32)],8,Fr)):e.createCommentVNode("",!0),e.createElementVNode("g",jr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Do.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:n.x,cy:n.y,r:X(n.width/2),fill:c(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,Kr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Do.value,(n,i)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${i}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:p=>fa(i),onError:p=>va(i),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${i}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,46,Gr))),128))])],8,Vs))]),O.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Ee.value+"px",height:K.value+"px",backgroundImage:`url('${Dn.value}')`,backgroundRepeat:"no-repeat",...ct.value,opacity:F.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,(n,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+n.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:n.x+"px",top:n.y+"px",width:En.value+"px",height:En.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>y(n),["stop"]),onMouseenter:p=>To(n,p),onMouseleave:Yo},[e.createElementVNode("img",{src:ll(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Jr)],44,Qr)),[[e.vShow,Qt.value]])),128)),pn.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:pn.value.x+"px",top:pn.value.y+"px"})},[e.createElementVNode("div",ei,e.toDisplayString(pn.value.categoryValue),1),pn.value.description?(e.openBlock(),e.createElementBlock("div",ti,e.toDisplayString(pn.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Xe.value&&(yt.value.show||Ge.value&&at.value.show&&!se.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Ge.value&&at.value.show&&!se.value.isZooming,"dss-spider-tooltip":$n.value&&yt.value.spiderAreas&&yt.value.spiderAreas.length>0}]),style:e.normalizeStyle(ga.value)},[!Ge.value||!at.value.show||se.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[$n.value&&yt.value.spiderAreas&&yt.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",ni,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yt.value.spiderAreas,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${i}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",li,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createTextVNode(" "+e.toDisplayString(n.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.points,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${i}-${g}`,class:"dss-tooltip-series"},[e.createElementVNode("span",oi,e.toDisplayString(p.label),1),e.createElementVNode("span",ai,e.toDisplayString(p.value),1)]))),128))]))),128))])):jt.value&&yt.value.bubbleData&&yt.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",si,[yt.value.title?(e.openBlock(),e.createElementBlock("div",ri,e.toDisplayString(yt.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ii,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yt.value.bubbleData,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",ci,[e.createElementVNode("div",ui,e.toDisplayString(yt.value.title),1),e.createElementVNode("div",di,e.toDisplayString(yt.value.value),1)])),yt.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[mt(yt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",mi,[a[5]||(a[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",pi,e.toDisplayString(e.unref(M)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt(yt.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",fi,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",vi,[e.createElementVNode("div",gi,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),mt(yt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",hi,[a[6]||(a[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",yi,e.toDisplayString(e.unref(M)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt(yt.value.categoryIndex).markers,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",ki,[e.createElementVNode("div",Ci,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",bi,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",wi,[e.createElementVNode("div",xi,e.toDisplayString(jt.value?fl():T.categories[at.value.categoryIndex]||`Category ${at.value.categoryIndex+1}`),1),jt.value?(e.openBlock(),e.createElementBlock("div",Ei,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(at.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Si,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Vi,e.toDisplayString(Dt(n.value)),1)]))),128))]),mt(at.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Ni,[a[7]||(a[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Bi,e.toDisplayString(e.unref(M)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt(at.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",Mi,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",_i,[e.createElementVNode("div",$i,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),mt(at.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Li,[a[8]||(a[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ti,e.toDisplayString(e.unref(M)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt(at.value.categoryIndex).markers,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",Ai,[e.createElementVNode("div",Di,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Hi,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Sn.value&&Qe.value&&se.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:co},[a[9]||(a[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(se.value.scale*100))+"% "+e.toDisplayString(e.unref(M)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,fs),G.value&&he.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Be.value==="horizontal","dss-legend-vertical":Be.value==="vertical","dss-legend-bottom":!0}]),style:{display:"flex","flex-wrap":"wrap","justify-content":"center",padding:"6px 8px 0"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ot.value.has(i),"dss-legend-hovered":ce.value===i,"dss-legend-dimmed":ce.value!==null&&ce.value!==i}]),onClick:p=>jo(i),onMouseenter:p=>Fn(i),onMouseleave:un,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",Fi,e.toDisplayString(n.name),1)],46,Ri))),128))],2)):e.createCommentVNode("",!0),gt.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:gt.value.x+"px",top:gt.value.y+"px"}),onClick:a[0]||(a[0]=e.withModifiers(()=>{},["stop"]))},[wt.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:so},e.toDisplayString(e.unref(M)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),wt.value.addMarker&&(wt.value.downloadSvg||wt.value.downloadPng||wt.value.downloadCsv||At.value.length>0)?(e.openBlock(),e.createElementBlock("div",Ii)):e.createCommentVNode("",!0),wt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Mn},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),wt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Ln},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),wt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Pn},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),At.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[wt.value.downloadSvg||wt.value.downloadPng||wt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",zi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(At.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[n.separator?(e.openBlock(),e.createElementBlock("div",Pi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(ql(n)),style:e.normalizeStyle(Zl(n)),onClick:p=>hl(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:fn(n),class:"dss-custom-menu-content"},null,8,Wi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",qi,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,Oi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Te.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:Lt},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Zi,[e.createElementVNode("h3",null,e.toDisplayString(nn.value?e.unref(M)("chart.modalMarker.viewMarker"):Nn.value?e.unref(M)("chart.modalMarker.editMarker"):e.unref(M)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:Lt},"×")]),e.createElementVNode("div",Ui,[e.createElementVNode("div",Xi,[e.createVNode(ea,{id:"dss-marker-date",mode:"single",modelValue:Te.value.date,"onUpdate:modelValue":a[1]||(a[1]=n=>Te.value.date=n),"min-date":ao.value,"max-date":rn.value,disabled:nn.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",Yi,[e.createElementVNode("label",ji,e.toDisplayString(e.unref(M)("chart.modalMarker.description")),1),nn.value?(e.openBlock(),e.createElementBlock("div",Ki,e.toDisplayString(Te.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":a[2]||(a[2]=n=>Te.value.description=n),placeholder:e.unref(M)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Gi)),[[e.vModelText,Te.value.description]])])]),e.createElementVNode("div",Qi,[e.createElementVNode("div",Ji,[Nn.value&&!nn.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:qn},e.toDisplayString(e.unref(M)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ec,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:Lt},e.toDisplayString(nn.value?e.unref(M)("chart.modalMarker.close"):e.unref(M)("chart.modalMarker.cancel")),1),nn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:ml,disabled:!(Te.value.description&&Te.value.description.length)},e.toDisplayString(Nn.value?e.unref(M)("chart.modalMarker.save"):e.unref(M)("chart.contextMenu.addMarker")),9,tc))])])])])):e.createCommentVNode("",!0)],64))}}),oc={class:"dss-modal-title"},ac={class:"dss-modal-actions"},Jo={__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(T,{emit:le}){const M=T,L=le,de=e.ref(null),z=e.ref(null),A=e.computed(()=>{const U={"max-width":M.width};return M.height!=="auto"&&(U.height=M.height,U["min-height"]="0"),U}),ve=e.computed(()=>({}));function pt(){L("close-modal")}function J(){M.backDrop&&!de.value&&L("close-modal")}function f(U){U.target.tagName==="INPUT"&&(de.value=U.target.tagName)}function be(){setTimeout(()=>{de.value=null},300)}function Ce(){const U=document.body,me=document.documentElement;z.value={bodyOverflow:U.style.overflow,bodyPosition:U.style.position,bodyTop:U.style.top,bodyWidth:U.style.width,htmlOverflow:me.style.overflow,scrollY:window.scrollY},U.style.overflow="hidden",U.style.position="fixed",U.style.top=`-${z.value.scrollY}px`,U.style.width="100%",U.style.left="0",me.style.overflow="hidden"}function Q(){if(!z.value)return;const U=document.body,me=document.documentElement,{bodyOverflow:H,bodyPosition:xe,bodyTop:He,bodyWidth:et,htmlOverflow:vt,scrollY:q}=z.value;U.style.overflow=H||"",U.style.position=xe||"",U.style.top=He||"",U.style.width=et||"",U.style.left="",me.style.overflow=vt||"",window.scrollTo(0,q||0)}return e.watch(()=>M.showModal,U=>{if(U)Ce(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const me=document.getElementById("dss-modal-backdrop");me&&(me.addEventListener("focusin",f),me.addEventListener("focusout",be))},100);else{Q(),document.body.classList.remove("dss-modal-open");const me=document.getElementById("dss-modal-backdrop");me&&(me.removeEventListener("focusin",f),me.removeEventListener("focusout",be))}},{immediate:!0}),e.onUnmounted(()=>{M.showModal&&Q()}),(U,me)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:J},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(A.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:me[0]||(me[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":T.headerType,"font-size":T.titleSize})},[e.createElementVNode("h1",oc,[e.renderSlot(U.$slots,"title",{},()=>[me[1]||(me[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(U.$slots,"title-data"),T.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:pt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(ve.value)},[e.renderSlot(U.$slots,"content",{},()=>[me[2]||(me[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",ac,[e.renderSlot(U.$slots,"actions")])])],4),[[e.vShow,T.showModal]])])):e.createCommentVNode("",!0)]))}},sc={key:0,class:"dss-table-toolbar"},rc={class:"dss-table-toolbar-left"},ic=["aria-expanded"],cc={class:"dss-pagination-select-dropdown",role:"listbox"},uc={class:"dss-table-column-visibility-label"},dc={class:"dss-table-checkbox-wrapper"},mc=["checked","onChange"],pc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},fc={class:"dss-table-column-visibility-text"},vc={class:"dss-table-toolbar-right"},gc=["placeholder","aria-label"],hc=["aria-label"],yc=["aria-label","aria-expanded"],kc={key:1,class:"dss-table-toolbar-extra"},Cc={class:"dss-table-thead"},bc={key:0,class:"dss-table-th dss-table-selection-column"},wc={key:0,class:"dss-table-checkbox-wrapper"},xc=["checked","indeterminate"],Ec={key:0,class:"dss-table-checkbox__indeterminate"},Sc={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Vc=["aria-label"],Nc=["onClick"],Bc={class:"dss-table-th-content"},Mc={class:"dss-table-th-text"},_c={key:0},$c={key:1},Lc={key:2},Tc=["data-filter-column-key","aria-expanded","aria-label","onClick"],Ac={class:"dss-table-tbody"},Dc=["onClick"],Hc={class:"dss-table-checkbox-wrapper"},Rc=["type","name","checked","disabled","onChange"],Fc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Ic={key:1,class:"dss-table-checkbox__dot"},zc=["onClick"],Pc=["aria-expanded","aria-label"],Oc={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},Wc={key:0,class:"dss-table-expansion-row"},qc=["colspan"],Zc=["colspan"],Uc={key:1,class:"dss-table-pagination"},Xc={class:"dss-table-pagination-left"},Yc={key:0},jc={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},Kc={class:"dss-table-pagination-center"},Gc={key:0,class:"dss-pagination-controls"},Qc=["disabled","title"],Jc=["disabled","title"],eu=["aria-label","onKeydown"],tu={class:"dss-pagination-of"},nu=["disabled","title"],lu=["disabled","title"],ou={class:"dss-table-pagination-right"},au={class:"dss-pagination-rows-label"},su=["aria-expanded"],ru=["aria-selected","onClick"],iu={key:0,class:"dss-table-filter-row"},cu=["value","placeholder"],uu=["min","max","value"],du=["min","max","value"],mu={class:"dss-table-filter-double-range-values"},pu={key:2,class:"dss-table-filter-daterange"},fu={class:"dss-table-filter-daterange-row"},vu={class:"dss-table-filter-daterange-label"},gu=["value"],hu={class:"dss-table-filter-daterange-row"},yu={class:"dss-table-filter-daterange-label"},ku=["value"],Cu=["value","placeholder"],bu={class:"dss-table-filter-list"},wu=["checked","onChange"],xu={class:"dss-table-filter-actions"},Eu={name:"DSSTable"},Su=Object.assign(Eu,{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:T=>typeof T=="object"&&T!==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(T,{emit:le}){const{t:M,locale:L}=Jl.useI18n(),de=T,z=le,A={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,expandableRowData:null,expandableRowCondition:null,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single",rowCondition:null},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100],showCounter:!0,showControlsGroup:!0,showControls:!0,showRowsPerPage:!0},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:null};function ve(y,h){const x=Object.assign({},y);return pt(y)&&pt(h)&&Object.keys(h).forEach(W=>{pt(h[W])?W in y?x[W]=ve(y[W],h[W]):Object.assign(x,{[W]:h[W]}):Object.assign(x,{[W]:h[W]})}),x}function pt(y){return y&&typeof y=="object"&&!Array.isArray(y)}const J=e.computed(()=>ve(A,de.options)),f=e.computed(()=>{const y=J.value.table.width;return y==="auto"?null:typeof y=="number"?y:null}),be=e.computed(()=>J.value.table.height),Ce=e.computed(()=>J.value.table.rowHeight??"auto"),Q=e.computed(()=>({height:Ce.value})),U=e.computed(()=>J.value.table.expandable===!0),me=e.computed(()=>J.value.table.expandableRowData??null),H=e.computed(()=>J.value.table.expandableRowCondition??null),xe=e.computed(()=>J.value.table.truncated===!0),He=e.computed(()=>J.value.table.striped),et=e.computed(()=>J.value.table.bordered),vt=e.computed(()=>J.value.table.hoverable),q=e.computed(()=>J.value.table.size),Ue=e.computed(()=>J.value.table.align||"left");e.computed(()=>J.value.title.text),e.computed(()=>J.value.subtitle.text);const Pe=e.computed(()=>J.value.selection.enabled),Ee=e.computed(()=>J.value.selection.mode),Me=e.computed(()=>J.value.selection.rowCondition??null),Ke=e.computed(()=>J.value.sorting.enabled),K=e.computed(()=>J.value.sorting.mode),ze=e.computed(()=>J.value.pagination.enabled),we=e.computed(()=>J.value.pagination.rows),st=e.computed(()=>J.value.pagination.rowsPerPageOptions),lt=e.computed(()=>J.value.pagination.showCounter!==!1),xt=e.computed(()=>J.value.pagination.showControlsGroup),It=e.computed(()=>xt.value===!1?!1:J.value.pagination.showControls!==!1),tn=e.computed(()=>xt.value===!1?!1:J.value.pagination.showRowsPerPage!==!1),Ot=e.computed(()=>ze.value&&(lt.value||It.value||tn.value)),oe=e.computed(()=>J.value.scrollable),fe=e.computed(()=>J.value.emptyMessage||M("table.emptyMessage")),Fe=e.computed(()=>J.value.toolbar?.downloads?.pdf!==!1),De=e.computed(()=>J.value.toolbar?.downloads?.excel!==!1),Zt=e.computed(()=>J.value.toolbar?.search!==!1),kt=e.computed(()=>Fe.value||De.value||Zt.value||Ut.value),Ut=e.computed(()=>J.value.toolbar?.columnVisibility!==!1),St=e.ref(""),Wt=e.ref(!1),G=e.ref(null);let he=null;function Be(){Wt.value?(he&&(clearTimeout(he),he=null),Wt.value=!1,St.value="",z("search",""),G.value?.blur()):(Wt.value=!0,he=setTimeout(()=>{he=null,G.value?.focus()},80))}function Xe(){St.value||(Wt.value=!1)}function Ge(){St.value="",z("search",""),G.value?.focus()}const Tt=e.computed(()=>({"dss-table-striped":He.value,"dss-table-bordered":et.value,"dss-table-hoverable":vt.value,[`dss-table-${q.value}`]:q.value!=="default","dss-table-truncated":xe.value})),Qe=(y,h)=>y?.field??y?.key??h,zt=e.ref(new Set);function Ze(){const y=new Set;return de.columns.forEach((h,x)=>{h?.hidden!==!0&&y.add(Qe(h,x))}),y}function $e(){const y=new Set;return de.columns.forEach((h,x)=>{y.add(Qe(h,x))}),y}function rt(y){if(!Array.isArray(y))return null;const h=$e(),x=[];return y.forEach(W=>{h.has(W)&&x.push(W)}),x}function Vt(){zt.value=Ze()}const ee=e.computed(()=>{const y=rt(de.columnVisibility);return y===null?null:new Set(y)}),Z=e.computed(()=>ee.value??zt.value),X=e.computed(()=>de.columns.filter((y,h)=>Z.value.has(Qe(y,h)))),pe=y=>{const h=de.columns.findIndex(x=>x===y);return Qe(y,h>=0?h:0)},ke=(y,h)=>Z.value.has(Qe(y,h));function Ye(y){z("update:columnVisibility",Array.from(y))}function Nt(y,h){const x=Qe(y,h),W=new Set(Z.value);W.has(x)?W.delete(x):W.add(x),ee.value===null&&(zt.value=W),Ye(W)}const on=e.ref(null),Ct=e.ref(!1);function Gt(y){on.value&&!on.value.contains(y.target)&&(Ct.value=!1)}const S=e.computed(()=>X.value.length+(Pe.value?1:0)+(U.value?1:0)),b=(y,h)=>y?.id??y?.key??h,V=e.ref(new Set),Y=e.ref(null),ae=(y,h)=>V.value.has(b(y,h)),We=(y,h)=>{if(!U.value)return!1;if(typeof H.value=="function")return!!H.value(y,h);if(typeof me.value=="string"&&me.value.trim()){const x=Lt(y,me.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},ht=(y,h,x)=>{if(x&&x.stopPropagation(),!We(y,h))return;const W=b(y,h),ie=new Set(V.value);ie.has(W)?(ie.delete(W),z("row-collapse",{data:y,index:h})):(ie.add(W),z("row-expand",{data:y,index:h})),V.value=ie},it=(y,h)=>{if(!xe.value)return;const x=b(y,h);Y.value!==x&&(Y.value=x)},qe=e.ref(null),Bt=e.ref(0),Mt=e.ref([]),Et=y=>{if(K.value==="single")return qe.value===y.field?Bt.value:0;{const h=Mt.value.find(x=>x.field===y.field);return h?h.order:0}},wt=y=>{const h=Et(y);return{"dss-sort-active":h!==0,"dss-sort-asc":h===1,"dss-sort-desc":h===-1}},At=e.ref({}),_t=e.ref(null),bn=e.ref(null),En=220,An=e.ref(null),Dt=e.computed(()=>X.value.find(y=>pe(y)===_t.value)??null),Qt=e.computed(()=>{if(!Dt.value||Dt.value.filter!=="range")return null;const y=Dt.value,h=_t.value,{min:x,max:W}=gl(y),ie=y.filterMin??x,ft=y.filterMax??W,Ht=F(h),Mn=Ht.min??ie,Ln=Ht.max??ft,Pn=ft-ie,hl=Pn===0?0:(Mn-ie)/Pn*100,so=Pn===0?100:(Ln-ie)/Pn*100;return{rangeMin:ie,rangeMax:ft,currentMin:Mn,currentMax:Ln,minPct:hl,maxPct:so}}),tl=e.ref(null),R=e.ref("max");function O(y){const h=tl.value,x=Qt.value;if(!h||!x)return;const W=h.getBoundingClientRect(),ft=(y.clientX-W.left)/W.width*100,Ht=(x.minPct+x.maxPct)/2;R.value=ft<Ht?"min":"max"}function F(y){return At.value[y]??{}}function ne(y,h){At.value={...At.value,[y]:h}}function Le(y){const h=At.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 dt(y){const h={...At.value};delete h[y],At.value=h,_t.value=null,bn.value=null}function ct(){if(!_t.value){bn.value=null;return}const y=An.value;if(!y)return;const h=y.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${_t.value}"]`);if(!h)return;const x=h.getBoundingClientRect();bn.value={top:x.bottom+6,left:Math.max(8,x.right-En)}}const tt=e.computed(()=>{const y=String(St.value??"").trim().toLowerCase();return y?de.data.filter(h=>X.value.some(x=>an(ml(h,x)).some(ie=>String(ie).toLowerCase().includes(y)))):de.data}),mt=e.computed(()=>{let y=[...tt.value];const h=(St.value??"").trim().toLowerCase();return h&&(y=y.filter(x=>de.columns.some(W=>{if(!W||!W.field)return!1;const ie=ml(x,W);return String(ie??"").toLowerCase().includes(h)}))),X.value.forEach(x=>{const W=pe(x),ie=At.value[W];if(!ie)return;const ft=x.field;if(ft){if(ie.type==="string"&&ie.value?.trim()){const Ht=ie.value.trim().toLowerCase();y=y.filter(Mn=>{const Ln=ml(Mn,x);return String(Ln??"").toLowerCase().includes(Ht)})}else if(ie.type==="range")y=y.filter(Ht=>{const Mn=Lt(Ht,ft),Ln=Number(Mn);return!(Number.isNaN(Ln)||ie.min!=null&&Ln<ie.min||ie.max!=null&&Ln>ie.max)});else if(ie.type==="dateRange"){const Ht=ie.from?new Date(ie.from).getTime():null,Mn=ie.to?new Date(ie.to).getTime():null;y=y.filter(Ln=>{const Pn=Lt(Ln,ft),hl=Pn?new Date(Pn).getTime():NaN;return!(Number.isNaN(hl)||Ht!=null&&hl<Ht||Mn!=null&&hl>Mn)})}else if(ie.type==="list"&&ie.selected?.length){const Ht=new Set(ie.selected);y=y.filter(Mn=>an(ml(Mn,x)).some(Pn=>Ht.has(Pn)))}}}),y});function an(y){if(y==null)return[""];if(Array.isArray(y))return y.flatMap(an);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 Dn(y){const h=new Set;return de.data.forEach(x=>{an(ml(x,y)).forEach(ie=>h.add(ie))}),Array.from(h).sort((x,W)=>String(x).localeCompare(String(W)))}function Hn(y,h){if(_t.value===y){_t.value=null,bn.value=null;return}if(_t.value=y,h?.currentTarget){const x=h.currentTarget.getBoundingClientRect();bn.value={top:x.bottom+6,left:Math.max(8,x.right-En)}}else ct()}function On(y,h){ne(y,{type:"string",value:h})}function gl(y){const h=y.field;if(!h)return{min:0,max:100};let x=1/0,W=-1/0;return de.data.forEach(ie=>{const ft=Lt(ie,h),Ht=Number(ft);Number.isNaN(Ht)||(x=Math.min(x,Ht),W=Math.max(W,Ht))}),{min:x===1/0?0:x,max:W===-1/0?100:W}}function El(y,h,x){const W={...F(y),type:"range"},ie=x===""?null:Number(x),ft=ie===null||Number.isNaN(ie)?null:ie;W[h]=ft,ft!=null&&(h==="min"&&W.max!=null&&ft>W.max&&(W.max=ft),h==="max"&&W.min!=null&&ft<W.min&&(W.min=ft)),ne(y,W)}function Pl(y,h,x){const W={...F(y),type:"dateRange"};W[h]=x||"",ne(y,W)}const Rn=e.reactive({});function lo(y,h){Rn[y]=h}function Ol(y){const h=pe(y),x=(Rn[h]??"").trim().toLowerCase(),W=Dn(y);return x?W.filter(ie=>String(ie).toLowerCase().includes(x)):W}function Ll(y,h){return(F(y).selected??[]).includes(h!=null?String(h):"")}function Wl(y,h){const W=[...F(y).selected??[]],ie=h!=null?String(h):"",ft=W.indexOf(ie);ft>=0?W.splice(ft,1):W.push(ie),ne(y,{type:"list",selected:W})}function cl(y){_t.value&&!y.target.closest(".dss-table-filter-wrap")&&!y.target.closest(".dss-table-filter-dropdown")&&(_t.value=null,bn.value=null)}function Sl(){ct(),sn.value&&at()}const oo=y=>{if(!(y.sortable===!1||!Ke.value))if(K.value==="single")qe.value===y.field?Bt.value=Bt.value===1?-1:Bt.value===-1?0:1:(qe.value=y.field,Bt.value=1),Bt.value===0&&(qe.value=null),z("sort",{field:qe.value,order:Bt.value});else{const h=Mt.value.findIndex(x=>x.field===y.field);h>=0?Mt.value[h].order===1?Mt.value[h].order=-1:Mt.value.splice(h,1):Mt.value.push({field:y.field,order:1}),z("sort",{multiSortMeta:Mt.value})}},Kn=e.computed(()=>{if(!Ke.value)return mt.value;let y=[...mt.value];return K.value==="single"&&qe.value&&Bt.value!==0?y.sort((h,x)=>{const W=Lt(h,qe.value),ie=Lt(x,qe.value);return W===ie?0:W==null?1:ie==null?-1:(W<ie?-1:W>ie?1:0)*Bt.value}):K.value==="multiple"&&Mt.value.length>0&&y.sort((h,x)=>{for(const W of Mt.value){const ie=Lt(h,W.field),ft=Lt(x,W.field);if(ie===ft)continue;if(ie==null)return 1;if(ft==null)return-1;const Ht=ie<ft?-1:ie>ft?1:0;if(Ht!==0)return Ht*W.order}return 0}),y}),yn=e.ref(0),Jt=e.ref(we.value),sn=e.ref(!1),nl=e.ref(null),ot=e.ref(null),ce=e.ref("bottom"),ul=e.ref(null),yt=y=>{Jt.value=y,sn.value=!1,yn.value=0,z("page",{page:0,rows:Jt.value})};function pn(y){nl.value&&!nl.value.contains(y.target)&&(sn.value=!1)}function at(){const y=nl.value,h=ot.value;if(!y||!h)return;const x=y.querySelector(".dss-pagination-select-dropdown");if(!x)return;const W=h.getBoundingClientRect(),ie=x.offsetHeight||0,Ht=(window.innerHeight||document.documentElement.clientHeight)-W.bottom,Mn=W.top;ce.value=Ht<ie+8&&Mn>Ht?"top":"bottom",ul.value={width:`${Math.ceil(W.width)}px`,left:`${Math.max(0,Math.round(h.offsetLeft))}px`}}const gt=e.computed(()=>Kn.value.length),se=e.computed(()=>Math.ceil(gt.value/Jt.value)),Yt=e.computed(()=>Math.max(se.value,1)),Te=e.computed(()=>gt.value===0?0:rn.value+1),ao=e.computed(()=>Nn.value),rn=e.computed(()=>ze.value?yn.value*Jt.value:0),Nn=e.computed(()=>ze.value?Math.min((yn.value+1)*Jt.value,gt.value):gt.value),nn=e.computed(()=>{if(!ze.value)return Kn.value;const y=rn.value,h=Nn.value;return Kn.value.slice(y,h)}),Fn=e.ref(new Set),un=e.computed(()=>Kn.value.filter((y,h)=>Fn.value.has(b(y,h)))),In=(y,h)=>{const x=Me.value;return typeof x!="function"?!0:!!x(y,h)},Tl=e.computed(()=>Kn.value.map((y,h)=>({row:y,index:h})).filter(({row:y,index:h})=>In(y,h))),Vl=e.computed(()=>{const y=Tl.value;return y.length===0?!1:y.every(({row:h,index:x})=>Fn.value.has(b(h,x)))}),Wn=e.computed(()=>{const y=Tl.value;if(y.length===0)return!1;const h=y.filter(({row:x,index:W})=>Fn.value.has(b(x,W))).length;return h>0&&h<y.length}),fn=(y,h)=>Fn.value.has(b(y,h)),ql=()=>{if(Vl.value)Fn.value=new Set,z("unselect-all");else{const y=new Set;Tl.value.forEach(({row:h,index:x})=>y.add(b(h,x))),Fn.value=y,z("select-all",un.value)}},Zl=(y,h)=>{if(!In(y,h))return;const x=b(y,h),W=new Set(Fn.value),ie=W.has(x);Ee.value==="single"?ie?(W.delete(x),z("row-unselect",y)):(W.clear(),W.add(x),z("row-select",y)):ie?(W.delete(x),z("row-unselect",y)):(W.add(x),z("row-select",y)),Fn.value=W},ll=e.ref("1"),Al=()=>{const y=Number.parseInt(String(ll.value),10);if(!Number.isFinite(y)){ll.value=String(yn.value+1);return}const h=Math.min(Yt.value,Math.max(1,y));h!==yn.value+1?dl(h-1):ll.value=String(h)},dl=y=>{y<0||y>=se.value||(yn.value=y,z("page",{page:y,rows:Jt.value}))},Bn=(y,h,x)=>{z("row-click",{data:y,index:h,originalEvent:x}),it(y,rn.value+h)},Dl=(y,h)=>{const x=rn.value+h;return{"dss-table-row-selected":fn(y,x),"dss-table-row-even":h%2===0,"dss-table-row-odd":h%2!==0,"dss-table-row-truncated-clickable":xe.value,"dss-table-row-truncated-expanded":Y.value===b(y,x)}},ml=(y,h)=>h.field?Lt(y,h.field):"",Lt=(y,h)=>h.split(".").reduce((x,W)=>x&&x[W],y),qn=y=>{const h=y.align??Ue.value;return{"dss-table-sortable":y.sortable!==!1&&Ke.value,"dss-table-align-left":h==="left","dss-table-align-center":h==="center","dss-table-align-right":h==="right",[y.className]:y.className}},ol=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(()=>de.locale,y=>{y&&y!==L.value&&(L.value=y)},{immediate:!0}),e.watch(we,y=>{Jt.value=y,yn.value=0}),e.watch(sn,async y=>{y&&(await e.nextTick(),at())}),e.watch(yn,y=>{ll.value=String(y+1)},{immediate:!0}),e.watch(St,y=>{z("search",y??"")}),e.watch(()=>de.columns,()=>{if(ee.value===null){Vt();return}const y=rt(de.columnVisibility)??[];y.length!==de.columnVisibility.length&&z("update:columnVisibility",y)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",pn),document.addEventListener("click",Gt),document.addEventListener("click",cl),window.addEventListener("resize",Sl),window.addEventListener("scroll",Sl,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",pn),document.removeEventListener("click",Gt),document.removeEventListener("click",cl),window.removeEventListener("resize",Sl),window.removeEventListener("scroll",Sl,!0)}),(y,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:An,style:e.normalizeStyle({width:f.value+"px",height:be.value?be.value+"px":"auto"})},[kt.value?(e.openBlock(),e.createElementBlock("div",sc,[e.createElementVNode("div",rc,[Fe.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:h[0]||(h[0]=x=>z("download-pdf"))},[h[22]||(h[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(M)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),De.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:h[1]||(h[1]=x=>z("download-excel"))},[h[23]||(h[23]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(M)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Ut.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:on},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Ct.value}]),onClick:h[2]||(h[2]=x=>Ct.value=!Ct.value),"aria-expanded":Ct.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(M)("table.columnVisibility"))+" ",1),h[24]||(h[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,ic),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",cc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.columns,(x,W)=>(e.openBlock(),e.createElementBlock("li",{key:Qe(x,W),role:"option",class:"dss-table-column-visibility-option",onClick:h[3]||(h[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",uc,[e.createElementVNode("span",dc,[e.createElementVNode("input",{type:"checkbox",checked:ke(x,W),onChange:ie=>Nt(x,W),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,mc),ke(x,W)?(e.openBlock(),e.createElementBlock("span",pc,[...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",fc,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,Ct.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",vc,[Zt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Wt.value||St.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:G,"onUpdate:modelValue":h[4]||(h[4]=x=>St.value=x),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(M)("table.searchPlaceholder"),"aria-label":e.unref(M)("table.searchTableAriaLabel"),onFocus:h[5]||(h[5]=x=>Wt.value=!0),onBlur:Xe},null,40,gc),[[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(M)("table.clearSearchAriaLabel"),onClick:Ge},[...h[26]||(h[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,hc)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(M)("table.searchAriaLabel"),"aria-expanded":Wt.value||!!St.value,onMousedown:e.withModifiers(Be,["prevent"])},[...h[27]||(h[27]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,yc)],2)):e.createCommentVNode("",!0),y.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",kc,[e.renderSlot(y.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":oe.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Tt.value])},[e.createElementVNode("thead",Cc,[e.createElementVNode("tr",null,[Pe.value?(e.openBlock(),e.createElementBlock("th",bc,[Ee.value==="multiple"?(e.openBlock(),e.createElementBlock("span",wc,[e.createElementVNode("input",{type:"checkbox",checked:Vl.value,indeterminate:Wn.value,onChange:ql,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,xc),Wn.value?(e.openBlock(),e.createElementBlock("span",Ec)):Vl.value?(e.openBlock(),e.createElementBlock("span",Sc,[...h[28]||(h[28]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),U.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(M)("table.expandRowAriaLabel")},null,8,Vc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,(x,W)=>(e.openBlock(),e.createElementBlock("th",{key:pe(x),class:e.normalizeClass(["dss-table-th",qn(x)]),style:e.normalizeStyle(ol(x)),onClick:ie=>oo(x)},[e.createElementVNode("div",Bc,[e.createElementVNode("span",Mc,e.toDisplayString(x.header),1),x.sortable!==!1&&Ke.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",wt(x)])},[Et(x)===0?(e.openBlock(),e.createElementBlock("span",_c,[...h[29]||(h[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):Et(x)===1?(e.openBlock(),e.createElementBlock("span",$c,[...h[30]||(h[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):Et(x)===-1?(e.openBlock(),e.createElementBlock("span",Lc,[...h[31]||(h[31]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),x.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":_t.value===pe(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":Le(pe(x))}]),"data-filter-column-key":pe(x),"aria-expanded":_t.value===pe(x),"aria-label":e.unref(M)("table.filterColumnAriaLabel"),onClick:ie=>Hn(pe(x),ie)},[...h[32]||(h[32]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,Tc)],2)):e.createCommentVNode("",!0)])],14,Nc))),128))])]),e.createElementVNode("tbody",Ac,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nn.value,(x,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:b(x,rn.value+W)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Dl(x,W)]),style:e.normalizeStyle(Q.value),onClick:ie=>Bn(x,W,ie)},[Pe.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",Hc,[e.createElementVNode("input",{type:Ee.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${T.tableId}`,checked:fn(x,rn.value+W),disabled:!In(x,rn.value+W),onChange:ie=>Zl(x,rn.value+W),class:e.normalizeClass(["dss-table-checkbox",Ee.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!In(x,rn.value+W)}])},null,42,Rc),Ee.value==="multiple"&&fn(x,rn.value+W)?(e.openBlock(),e.createElementBlock("span",Fc,[...h[33]||(h[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):Ee.value==="single"&&fn(x,rn.value+W)?(e.openBlock(),e.createElementBlock("span",Ic)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),U.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(ie=>ht(x,rn.value+W,ie),["stop"])},[We(x,rn.value+W)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":ae(x,rn.value+W),"aria-label":ae(x,rn.value+W)?e.unref(M)("table.collapseRowAriaLabel"):e.unref(M)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":ae(x,rn.value+W)}]),"aria-hidden":"true"},[...h[34]||(h[34]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,Pc)):(e.openBlock(),e.createElementBlock("span",Oc))],8,zc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,(ie,ft)=>(e.openBlock(),e.createElementBlock("td",{key:pe(ie),class:e.normalizeClass(["dss-table-td",qn(ie)]),style:e.normalizeStyle(ol(ie))},[e.renderSlot(y.$slots,`cell-${ie.field}`,{data:x,column:ie,rowIndex:W,isExpanded:Y.value===b(x,rn.value+W)},()=>[e.createTextVNode(e.toDisplayString(ml(x,ie)),1)])],6))),128))],14,Dc),U.value&&We(x,rn.value+W)&&ae(x,rn.value+W)?(e.openBlock(),e.createElementBlock("tr",Wc,[e.createElementVNode("td",{colspan:S.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(y.$slots,"expansion",{data:x,rowIndex:W})],8,qc)])):e.createCommentVNode("",!0)],64))),128)),nn.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(Q.value)},[e.createElementVNode("td",{colspan:S.value,class:"dss-table-empty-cell"},[e.renderSlot(y.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(fe.value),1)])],8,Zc)],4))])],2)],2),Ot.value?(e.openBlock(),e.createElementBlock("div",Uc,[e.createElementVNode("div",Xc,[lt.value?(e.openBlock(),e.createElementBlock("span",Yc,e.toDisplayString(e.unref(M)("table.showingRange",{start:Te.value,end:ao.value,total:gt.value})),1)):(e.openBlock(),e.createElementBlock("span",jc," "))]),e.createElementVNode("div",Kc,[It.value?(e.openBlock(),e.createElementBlock("div",Gc,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:yn.value===0,onClick:h[8]||(h[8]=x=>dl(0)),title:e.unref(M)("table.firstPage")},[...h[35]||(h[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Qc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:yn.value===0,onClick:h[9]||(h[9]=x=>dl(yn.value-1)),title:e.unref(M)("table.previousPage")}," ‹ ",8,Jc),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[10]||(h[10]=x=>ll.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(M)("table.currentPageAriaLabel"),onBlur:Al,onKeydown:e.withKeys(e.withModifiers(Al,["prevent"]),["enter"])},null,40,eu),[[e.vModelText,ll.value]]),e.createElementVNode("span",tu,e.toDisplayString(e.unref(M)("table.ofPages",{total:Yt.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:yn.value>=se.value-1,onClick:h[11]||(h[11]=x=>dl(yn.value+1)),title:e.unref(M)("table.nextPage")}," › ",8,nu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:yn.value>=se.value-1,onClick:h[12]||(h[12]=x=>dl(se.value-1)),title:e.unref(M)("table.lastPage")},[...h[36]||(h[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,lu)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",ou,[tn.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:nl},[e.createElementVNode("span",au,e.toDisplayString(e.unref(M)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":sn.value}]),onClick:h[13]||(h[13]=x=>sn.value=!sn.value),"aria-expanded":sn.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:ot},[e.createTextVNode(e.toDisplayString(Jt.value)+" ",1),h[37]||(h[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,su),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":ce.value==="top"}]),style:e.normalizeStyle(ul.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(st.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===Jt.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===Jt.value}]),onClick:W=>yt(x)},e.toDisplayString(x),11,ru))),128))],6),[[e.vShow,sn.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(bn.value?{top:bn.value.top+"px",left:bn.value.left+"px",width:En+"px"}:void 0),onClick:h[21]||(h[21]=e.withModifiers(()=>{},["stop"]))},[Dt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Dt.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",iu,[e.createElementVNode("input",{type:"text",value:F(_t.value).value??"",onInput:h[14]||(h[14]=x=>On(_t.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(M)("table.search")},null,40,cu)])):Dt.value.filter==="range"&&Qt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Qt.value.minPct+"%","--range-max-pct":Qt.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:tl,class:"dss-table-filter-double-range-track",onMousemove:O,onMouseenter:O},[e.createElementVNode("input",{type:"range",min:Qt.value.rangeMin,max:Qt.value.rangeMax,value:Qt.value.currentMin,onInput:h[15]||(h[15]=x=>El(_t.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:R.value==="min"?2:1})},null,44,uu),e.createElementVNode("input",{type:"range",min:Qt.value.rangeMin,max:Qt.value.rangeMax,value:Qt.value.currentMax,onInput:h[16]||(h[16]=x=>El(_t.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:R.value==="max"?2:1})},null,44,du)],544),e.createElementVNode("div",mu,e.toDisplayString(Qt.value.currentMin)+" – "+e.toDisplayString(Qt.value.currentMax),1)],4)):Dt.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",pu,[e.createElementVNode("div",fu,[e.createElementVNode("label",vu,e.toDisplayString(e.unref(M)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:F(_t.value).from??"",onInput:h[17]||(h[17]=x=>Pl(_t.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,gu)]),e.createElementVNode("div",hu,[e.createElementVNode("label",yu,e.toDisplayString(e.unref(M)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:F(_t.value).to??"",onInput:h[18]||(h[18]=x=>Pl(_t.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,ku)])])):Dt.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:Rn[_t.value]??"",onInput:h[19]||(h[19]=x=>lo(_t.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(M)("table.search")},null,40,Cu),e.createElementVNode("div",bu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ol(Dt.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:Ll(_t.value,x),onChange:W=>Wl(_t.value,x)},null,40,wu),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",xu,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:h[20]||(h[20]=x=>dt(_t.value))},e.toDisplayString(e.unref(M)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,_t.value&&Dt.value&&bn.value]])]),_:1})]))],64))}}),Vu="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",Nu="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",Bu="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",Mu="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",_u="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",$u="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",Lu={class:"dss-toolbar-left"},Tu=["title"],Au=["title"],Du={class:"dss-toolbar-dropdown-wrapper"},Hu=["title"],Ru=["src"],Fu=["src"],Iu=["src"],zu=["src"],Pu=["src"],Ou=["src"],Wu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},qu=["src"],Zu=["src"],Uu=["src"],Xu=["src"],Yu=["src"],ju=["src"],Ku=["title"],Gu=["title"],Qu=["title"],Ju=["title"],ed=["title"],td=["title"],nd=["title"],ld=["title"],od=["title"],ad={key:2,class:"dss-toolbar-separator"},sd=["title"],rd={key:4,class:"dss-toolbar-separator"},id={key:5,class:"dss-toolbar-dropdown-wrapper"},cd=["title"],ud={class:"dss-toolbar-dropdown-ai"},dd={class:"dss-toolbar-right"},md={key:0,class:"dss-toolbar-custom-group"},pd={key:1,class:"dss-toolbar-separator"},fd={class:"dss-link-modal-content"},vd={class:"dss-link-modal-field"},gd={class:"dss-link-modal-label"},hd=["placeholder"],yd={class:"dss-link-modal-field"},kd={class:"dss-link-modal-label"},Cd=["placeholder"],bd={class:"dss-image-modal-tabs"},wd={key:0,class:"dss-image-tab-content"},xd={class:"dss-link-modal-content"},Ed={class:"dss-link-modal-field"},Sd={key:0,class:"dss-link-modal-label"},Vd=["src"],Nd={class:"dss-link-modal-field"},Bd={class:"dss-link-modal-label"},Md=["placeholder"],_d={class:"dss-link-modal-field"},$d={class:"dss-link-modal-label"},Ld=["placeholder"],Td={class:"dss-link-modal-field"},Ad={class:"dss-link-modal-label"},Dd=["placeholder"],Hd={key:1,class:"dss-image-tab-content"},Rd={class:"dss-link-modal-content"},Fd={class:"dss-link-modal-field"},Id={class:"dss-link-modal-label"},zd=["placeholder"],Pd={class:"dss-link-modal-field"},Od={class:"dss-link-modal-label"},Wd=["placeholder"],qd={class:"dss-link-modal-field"},Zd={class:"dss-link-modal-label"},Ud=["placeholder"],Xd={class:"dss-link-modal-field"},Yd={class:"dss-link-modal-label"},jd=["placeholder"],Kd={class:"dss-text-editor-title-input-container"},Gd={key:0,class:"dss-text-editor-title-preview"},Qd={key:0},Jd={key:1,class:"dss-text-editor-preview-placeholder"},e1=["value","placeholder","disabled"],t1={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},n1={class:"dss-text-editor-description-input-container"},l1={key:0,class:"dss-text-editor-description-preview"},o1={key:0},a1={key:1,class:"dss-text-editor-preview-placeholder"},s1=["value","placeholder","disabled"],r1={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},i1=["data-comment-id","onMouseenter"],c1=["onClick"],u1=["src","alt"],d1={key:1},m1=["onClick"],p1=["src","alt"],f1={key:1},v1=["data-has-second-user","onClick"],g1={class:"editor-comment-marker-count"},h1={key:4,class:"dss-text-editor-textarea-wrapper"},y1=["value","placeholder","rows","disabled"],k1={class:"dss-text-editor-footer"},C1={class:"dss-text-editor-footer-content"},b1={class:"dss-text-editor-footer-stat"},w1={class:"dss-text-editor-footer-stat"},x1={key:5,class:"dss-text-editor-content-wrapper"},E1={key:0,class:"dss-comment-overlay-body"},S1={class:"dss-comment-selection-wrapper"},V1=["innerHTML"],N1={class:"dss-comment-messages-wrapper"},B1={key:0,class:"dss-comment-avatar-wrapper"},M1={class:"dss-comment-avatar"},_1=["src","alt"],$1={key:1},L1={class:"dss-comment-header"},T1={class:"dss-comment-header-text"},A1={class:"dss-comment-author"},D1={key:0,class:"dss-comment-date"},H1=["onClick","title"],R1={class:"dss-comment-overlay-inner"},F1=["placeholder","onKeydown"],I1={class:"dss-text-editor-footer"},z1={class:"dss-text-editor-footer-content"},P1={class:"dss-text-editor-footer-stat"},O1={class:"dss-text-editor-footer-stat"},W1=["title"],q1=["title"],Z1={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:""},U1={class:"dss-image-popup-content"},X1={key:0,class:"dss-image-popup-no-alt-icon"},Y1=["title"],j1=["title"],K1={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:""},G1={class:"dss-toolbar-left"},Q1=["title"],J1=["title"],em={class:"dss-toolbar-dropdown-wrapper"},tm=["title"],nm=["src"],lm=["src"],om=["src"],am=["src"],sm=["src"],rm=["src"],im={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},cm=["title"],um=["title"],dm=["title"],mm=["title"],pm=["title"],fm=["title"],vm=["title"],gm=["title"],hm=["title"],ym=["title"],km={key:2,class:"dss-toolbar-separator"},Cm={key:3,class:"dss-toolbar-dropdown-wrapper"},bm=["title"],wm={class:"dss-toolbar-dropdown-ai"},xm={key:0,class:"dss-toolbar-right"},Em={key:0,class:"dss-toolbar-separator"},Sm={key:0,class:"dss-toolbar-custom-group"},Vm={key:1,class:"dss-toolbar-separator"},Nm={name:"DSSTextEditor"},Bm=Object.assign(Nm,{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:T=>typeof T=="object"&&T!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:T=>typeof T=="object"&&T!==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(T,{expose:le,emit:M}){const{t:L,locale:de}=Jl.useI18n(),z={h1:Vu,h2:Nu,h3:Bu,h4:Mu,h5:_u,h6:$u},A=T,ve=M,pt=e.useSlots(),J=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
96
+ `,t+="Category",R.series.forEach(g=>{const C=g.name.replace(/"/g,'""');t+=',"'+C+'"'}),t+=`
97
+ `;const a=Math.max(...R.series.map(g=>g.data?.length||0));for(let g=0;g<a;g++){let z='"'+(R.categories[g]||M("chart.fallback.item",{number:g+1})).toString().replace(/"/g,'""')+'"';R.series.forEach(N=>{const $=N.data&&N.data[g]!==void 0?N.data[g]:"";z+=","+$}),t+=z+`
98
+ `}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(n),p=document.createElement("a");p.href=i,p.download=q("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(i),Zn()}catch(t){console.error("Error downloading CSV:",t)}},kl=t=>{if(typeof t.action=="function"){const a={series:R.series,categories:R.categories,markers:Yt.value},n={chartX:gt.value.chartX,chartY:gt.value.chartY,dataX:gt.value.mouseDataX,dataY:gt.value.mouseDataY,categoryIndex:clampedCategoryIndex||gt.value.categoryIndex};t.action(a,n)}Zn()},ro=()=>{$t(),$e.value.show=!0,$e.value.categoryIndex=gt.value.categoryIndex,$e.value.fromButton=!1,Zn()},xo=()=>{$t(),$e.value.show=!0,$e.value.categoryIndex=0,$e.value.fromButton=!0},Eo=t=>{if(gt.value.show){const a=document.querySelector(".dss-context-menu");a&&!a.contains(t.target)&&(gt.value.show=!1)}},io=t=>{gt.value.show&&!t.target.closest(".context-menu")&&(gt.value.show=!1)},So=t=>{if(!Sn.value||!Ge.value)return;t.preventDefault(),t.stopPropagation(),ae.value.isZooming=!0,st.value.show=!1,ae.value.zoomTimeout&&clearTimeout(ae.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top;if(i<F.value.left-50||i>F.value.right+50||p<F.value.top-50||p>F.value.bottom+100){ae.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,C=Math.max(ae.value.minScale,Math.min(ae.value.maxScale,ae.value.scale*g));if(C!==ae.value.scale){const{minX:w,maxX:z}=Xt.value,N=z-w||1,$=N/ae.value.scale,B=w-ae.value.offsetX/F.value.width*N,te=(i-F.value.left)/F.value.width,Se=B+te*$;ae.value.scale=C;const Ye=N/ae.value.scale,ue=Se-te*Ye;ae.value.offsetX=-(ue-w)/N*F.value.width,ae.value.scale<=1.01&&(ae.value.scale=1,ae.value.offsetX=0)}ae.value.zoomTimeout=setTimeout(()=>{ae.value.isZooming=!1,ae.value.zoomTimeout=null},300)},co=t=>{if(!Sn.value||!Ge.value||ae.value.scale<=1)return;st.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,ae.value.isDragging=!0,ae.value.lastMouseX=t.clientX,ae.value.lastMouseY=t.clientY,t.preventDefault()},Vo=()=>{ae.value.isDragging=!1},uo=()=>{!Sn.value||!Ge.value||(ae.value.scale=1,ae.value.offsetX=0,ae.value.isDragging=!1,ae.value.zoomTimeout&&(clearTimeout(ae.value.zoomTimeout),ae.value.zoomTimeout=null),ae.value.isZooming=!1)},Zo=()=>!Sn.value||!pl.value||!Ge.value?"default":ae.value.isDragging?"grabbing":ae.value.scale>1?"grab":"dss-crosshair",Xl=t=>{if(t.length<2)return"";if(t.length===2)return`M ${t[0].x} ${t[0].y} L ${t[1].x} ${t[1].y}`;let a=`M ${t[0].x} ${t[0].y}`;for(let n=0;n<t.length-1;n++){const i=t[Math.max(n-1,0)],p=t[n],g=t[n+1],C=t[Math.min(n+2,t.length-1)],w=p.x+(g.x-i.x)/6*Je.value,z=p.y+(g.y-i.y)/6*Je.value,N=g.x-(C.x-p.x)/6*Je.value,$=g.y-(C.y-p.y)/6*Je.value;a+=` C ${w} ${z} ${N} ${$} ${g.x} ${g.y}`}return a},$n=e.computed(()=>{const a=Z.value?.chart?.padding,n=typeof a=="number"?a:null,i=a&&typeof a=="object"?a:null,p=50;let g=p+(en.value?30:0)+60;if(Ln.value){const B={left:p+40,top:p+40,right:p+40,bottom:p+40};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??B.left,top:i.top??B.top,right:i.right??B.right,bottom:i.bottom??B.bottom}:B}if(kn.value){const B=!J.value,te=Mt.value,Se=te?An.value+Fn.value+Math.max(24,on.value+16):0,Ye=B?12:p;let ue=0;ot.value&&(ue+=B?8:15),bt.value&&(ue+=B?6:10);const ke=nt();let Ne=Ye+(B?4:16)+(te?Se:0),ge=Ye+(te?Se:0);J.value&&he.value==="left"?Ne+=ke.legendWidth||150:J.value&&he.value==="right"&&(ge+=ke.legendWidth||150);const Ze=we.value==="semi-radial"?te?Se:8:te?Se:B?8:p+80,Le=te?14:0,_e=Ye+ue+Le,Re={left:Ne,top:_e,right:ge,bottom:Ze};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??Re.left,top:i.top??Re.top,right:i.right??Re.right,bottom:i.bottom??Re.bottom}:Re}let C=0;ot.value&&(C+=15),bt.value&&(C+=10);const w=nt();let z=p+16,N=p;J.value&&he.value==="left"?z+=w.legendWidth||150:J.value&&he.value==="right"&&(N+=w.legendWidth||150),Hn.value&&(N+=44);const $={left:z,top:p+C,right:N,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??$.left,top:i.top??$.top,right:i.right??$.right,bottom:i.bottom??$.bottom}:$}),F=e.computed(()=>({left:$n.value.left,top:$n.value.top,right:Ee.value-$n.value.right,bottom:Q.value-$n.value.bottom,width:Ee.value-($n.value.left+$n.value.right),height:Q.value-($n.value.top+$n.value.bottom)})),Sn=e.computed(()=>["line","area","bar"].includes(we.value)||it.value),Xn=e.computed(()=>it.value),Fl=e.computed(()=>we.value==="mini-radial"),kn=e.computed(()=>["radial","semi-radial","mini-radial"].includes(we.value)),Ln=e.computed(()=>we.value==="spider"),jt=e.computed(()=>we.value==="bubble"),Jt=e.computed(()=>Z.value?.chart?.orientation==="horizontal"&&(we.value==="bar"||Xn.value)),gl=t=>{const{minY:a,maxY:n}=Xt.value,i=n-a||1;return F.value.left+(t-a)/i*F.value.width},Cl=t=>{const{maxX:a}=Xt.value,n=a+1,p=F.value.height/n;return F.value.top+(t+.5)*p},Rt=e.computed(()=>kn.value?$n.value.left+(Ee.value-$n.value.left-$n.value.right)/2:Ee.value/2),kt=e.computed(()=>Ln.value?Q.value/2-40:kn.value?$n.value.top+(Q.value-$n.value.top-$n.value.bottom)/2:Q.value/2),ut=e.computed(()=>{if(Ln.value){const t=F.value.width-80,a=F.value.height-80;return Math.min(t,a)/2}return Math.min(F.value.width,F.value.height)/2}),Wt=e.computed(()=>{const t=Z.value,a=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof a=="number"&&a>=0&&a<=1?a:.45;return ut.value*n}),Il=e.computed(()=>{const t=Z.value,a=typeof R.innerSize=="number"?R.innerSize:t?.innerSize;return typeof a!="number"||a<=-100||!(kn.value||Ln.value)?1:1+a/100}),nn=e.computed(()=>{const t=Il.value;if(t===1||t<=0)return;const a=Rt.value,n=kt.value;return`translate(${a}, ${n}) scale(${t}) translate(${-a}, ${-n})`}),Bl=e.ref(0),Yl=e.computed(()=>`semi-radial-fill-clip-${R.chartId}`),Pn=e.computed(()=>we.value==="semi-radial"),il=e.computed(()=>Pn.value&&vt.value&&!Sl.value),cl=e.computed(()=>Pn.value&&vt.value&&!Sl.value&&Gt.value==="fill"),bl=e.computed(()=>{const t=il.value?Bl.value:1,a=Rt.value,n=kt.value,i=Wt.value,p=ut.value,g=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${a} ${n} L ${a} ${n} Z`;const w=a+p*Math.cos(g),z=n+p*Math.sin(g),N=a+p*Math.cos(C),$=n+p*Math.sin(C),B=a+i*Math.cos(C),te=n+i*Math.sin(C),Se=a+i*Math.cos(g),Ye=n+i*Math.sin(g),ue=t>.5?1:0;return`M ${a} ${n} L ${w} ${z} A ${p} ${p} 0 ${ue} 1 ${N} ${$} L ${B} ${te} A ${i} ${i} 0 ${ue} 1 ${Se} ${Ye} Z`}),wl=e.computed(()=>{if(!(!Pn.value||!il.value)&&!cl.value)return`url(#${Yl.value})`}),Uo=t=>{if(!(!cl.value||t!==0))return`url(#${Yl.value})`},xl=e.ref(0),Ml=e.computed(()=>`radial-reveal-clip-${R.chartId}`),el=e.computed(()=>we.value==="radial"),zl=e.computed(()=>{const t=el.value?xl.value:1,a=Rt.value,n=kt.value,i=Math.max(ut.value*1.5,Ee.value,Q.value);if(t<=0)return`M ${a} ${n} L ${a} ${n} Z`;if(t>=1){const B=a-i,te=a+i;return`M ${B} ${n} A ${i} ${i} 0 0 1 ${te} ${n} A ${i} ${i} 0 0 1 ${B} ${n} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,C=a+i*Math.cos(p),w=n+i*Math.sin(p),z=a+i*Math.cos(g),N=n+i*Math.sin(g),$=t>=.5?1:0;return`M ${a} ${n} L ${C} ${w} A ${i} ${i} 0 ${$} 1 ${z} ${N} Z`}),No=e.computed(()=>{if(wl.value)return wl.value;if(el.value)return`url(#${Ml.value})`});let Pl=null;const Xo=()=>{if(!il.value)return;Bl.value=0;const t=S.value,a=performance.now(),n=i=>{const p=i-a,g=Math.min(1,p/t);Bl.value=Qo(V.value,g),g<1&&(Pl=requestAnimationFrame(n))};Pl=requestAnimationFrame(n)},Ol=e.computed(()=>Z.value?.bubbles?.minSize||8),mo=e.computed(()=>Z.value?.bubbles?.maxSize||50),jl=e.computed(()=>Z.value?.bubbles?.opacity||.7),Bo=(t,a)=>{const n=[15,20,25,18,22],i=n[t%n.length]||20,p=1+Math.sin(a*.5)*.2;return Math.max(5,i*p)},Mo=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.opacity="1")},po=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.display="none")},tl=e.computed(()=>R.series),nl=e.computed(()=>R.series.filter((t,a)=>!at.value.has(a))),Kl=t=>{if(!t)return"primary";const a=t.yAxis??t.axis??t.yAxisId;return a==="secondary"||a==="right"||a===1?"secondary":"primary"},fo=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,_o=e.computed(()=>nl.value.filter(t=>Kl(t)==="primary")),_l=e.computed(()=>nl.value.filter(t=>Kl(t)==="secondary")),Hn=e.computed(()=>!Jt.value&&!!oe.value&&_l.value.length>0),Vn="auto",vo=(t,a,n,i=0,p=100)=>{let g=1/0,C=-1/0;if(t.forEach(N=>{N?.data?.length&&N.data.forEach($=>{typeof $=="number"&&Number.isFinite($)&&(g=Math.min(g,$),C=Math.max(C,$))})}),g===1/0)return{minY:i,maxY:p};let w;if(a===Vn){const N=C-g,$=N>0?N*.1:1;w=Math.max(0,g-$)}else if(typeof a=="number")w=a;else{const N=C-g,$=N>0?N*.1:1;w=Math.max(0,g-$)}let z;if(n===Vn){const N=C-g,$=N>0?N*.1:2;z=C+$}else if(typeof n=="number")z=n;else{const N=C-g,$=N>0?N*.1:2;z=C+$}return{minY:w,maxY:z}},Xt=e.computed(()=>{if(jt.value)return Yo();if(!nl.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;nl.value.forEach(n=>{n.data&&n.data.length&&(t=Math.max(t,n.data.length-1))}),R.categories.length>0&&(t=Math.max(t,R.categories.length-1));const a=vo(_o.value.length?_o.value:nl.value,Fe.value,De.value);return{minX:0,maxX:t,minY:a.minY,maxY:a.maxY}}),$o=e.computed(()=>Hn.value?vo(_l.value,Zt.value,yt.value,Xt.value.minY,Xt.value.maxY):{minY:Xt.value.minY,maxY:Xt.value.maxY}),Yo=()=>{if(!nl.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,a=-1/0,n=1/0,i=-1/0,p=1/0,g=-1/0,C=!1;if(nl.value.forEach((Se,Ye)=>{Se?.data?.length&&Se.data.forEach((ue,ke)=>{let Ne,ge,Qe;if(typeof ue=="object"&&ue!==null&&!Array.isArray(ue))Ne=typeof ue.x=="number"?ue.x:ke,ge=typeof ue.y=="number"?ue.y:0,Qe=typeof ue.size=="number"?ue.size:20;else if(Array.isArray(ue)&&ue.length>=3)Ne=typeof ue[0]=="number"?ue[0]:ke,ge=typeof ue[1]=="number"?ue[1]:0,Qe=typeof ue[2]=="number"?ue[2]:20;else if(typeof ue=="number")Ne=ke,ge=ue,Qe=Bo(Ye,ke);else return;isFinite(Ne)&&isFinite(ge)&&isFinite(Qe)&&(t=Math.min(t,Ne),a=Math.max(a,Ne),n=Math.min(n,ge),i=Math.max(i,ge),p=Math.min(p,Qe),g=Math.max(g,Qe),C=!0)})}),!C)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===a&&(t=Math.min(t,0),a=Math.max(a,R.categories?.length-1||8)),n===i&&(n=Math.max(0,n-10),i=n+20);const w=a-t,z=i-n;let N,$,B,te;return Ut.value!==null?N=Ut.value:N=t-w*.1,xt.value!==null?$=xt.value:$=a+w*.1,Fe.value!==null&&typeof Fe.value=="number"?B=Fe.value:B=Math.max(0,n-z*.1),De.value!==null&&typeof De.value=="number"?te=De.value:te=i+z*.1,{minX:N,maxX:$,minY:B,maxY:te,minSize:p,maxSize:g}},Kt=t=>{if(jt.value){const{minX:w,maxX:z}=Xt.value,N=z-w||1;return F.value.left+(t-w)/N*F.value.width}const{minX:a,maxX:n}=Xt.value,i=n-a;if(n===0||i===0)return F.value.left+F.value.width/2;const p=i/ae.value.scale,g=a-ae.value.offsetX/F.value.width*i,C=(t-g)/p;return F.value.left+C*F.value.width},wn=t=>{const{minY:a,maxY:n}=Xt.value,i=n-a||1;return F.value.bottom-(t-a)/i*F.value.height},Lo=t=>{const{minY:a,maxY:n}=$o.value,i=n-a||1;return F.value.bottom-(t-a)/i*F.value.height},xn=(t,a)=>Hn.value&&Kl(t)==="secondary"?Lo(a):wn(a),go=t=>{if(!jt.value)return St.value||4;const{maxSize:a}=Xt.value,n=Math.max(1,a),i=Math.min(1,Math.max(0,t/n));return Ol.value+i*(mo.value-Ol.value)},$l=(t,a=12,n="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(a*.62);$l.canvas||($l.canvas=document.createElement("canvas"));const i=$l.canvas.getContext("2d");return i?(i.font=`${a}px ${n}`,i.measureText(t).width):t.length*(a*.62)},ho=(t,a,n=12)=>{if(typeof t!="string"||typeof a!="number"||a<=0||$l(t,n)<=a)return t;const i="..";if($l(i,n)>=a)return i;let g=t.length;for(;g>0;){const C=`${t.slice(0,g)}${i}`;if($l(C,n)<=a)return C;g-=1}return i},To=e.computed(()=>s.value.map(t=>({y:t.y}))),o=e.computed(()=>{if(jt.value)return l();if(we.value==="bar"){if(Jt.value){const _e=[],{minY:Re,maxY:_t}=Xt.value,zt=5,Kn=_t-Re||1;for(let hn=0;hn<=zt;hn++){const Gn=Re+Kn*(hn/zt),Io=gl(Gn);_e.push({x:Io,y:F.value.bottom+20,text:qt(Math.round(Gn))})}return _e}const ke=[],{maxX:Ne}=Xt.value,ge=Ne+1,Qe=5,Le=(F.value.width-Qe*2)/ge;for(let _e=0;_e<=Ne;_e++){const Re=F.value.left+Qe+(_e+.5)*Le;ke.push({x:Re,y:F.value.bottom+20,text:ho(R.categories[_e]||M("chart.fallback.item",{number:_e+1}),Math.max(Le-8,24))})}return ke}const t=[],{minX:a,maxX:n}=Xt.value,i=Ut.value!==null?Ut.value:a,p=xt.value!==null?xt.value:n,g=p-i||1,C=g/ae.value.scale,w=i-ae.value.offsetX/F.value.width*g,z=w+C,N=Math.max(0,Math.floor(w-2)),$=Math.min(p,Math.ceil(z+2)),B=$-N,te=F.value.width,Ye=Math.floor(te/60);let ue=1;B>Ye&&(ue=Math.ceil(B/Ye));for(let ke=N;ke<=$;ke+=ue)if(ke>=0&&ke<=p){const Ne=Kt(ke);Ne>=F.value.left-100&&Ne<=F.value.right+100&&t.push({x:Ne,y:F.value.bottom+20,text:R.categories[ke]||`Item ${ke+1}`})}return t}),l=()=>{const t=[],{minX:a,maxX:n}=Xt.value,i=n-a||1,p=Math.min(8,Math.max(4,Math.floor(F.value.width/80)));for(let g=0;g<=p;g++){const C=a+i*g/p,w=Kt(C);if(w>=F.value.left-10&&w<=F.value.right+10){const z=Math.round(C),N=R.categories?.[z];t.push({x:w,y:F.value.bottom+20,text:N||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},s=e.computed(()=>{if(Jt.value){const p=[],{maxX:g}=Xt.value;for(let C=0;C<=g;C++)p.push({x:F.value.left-10,y:Cl(C),text:ho(R.categories[C]||`Item ${C+1}`,Math.max(F.value.left-28,40))});return p}const t=[],{minY:a,maxY:n}=Xt.value,i=5;for(let p=0;p<=i;p++){const g=a+(n-a)*(p/i),C=Math.round(g);t.push({x:F.value.left-10,y:wn(g),text:qt(C)})}return t}),r=e.computed(()=>{if(!Hn.value||Jt.value)return[];const t=[],{minY:a,maxY:n}=$o.value,i=5;for(let p=0;p<=i;p++){const g=a+(n-a)*(p/i),C=Math.round(g);t.push({x:F.value.right+10,y:Lo(g),text:qt(C)})}return t}),c=t=>{const a=mn.value;if(!a||a.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return a[t%a.length]},d=t=>{if(!t||typeof t!="string")return"#3a3a3a";const a=t.trim();let n=0,i=0,p=0;const g=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)n=Number(g[1])/255,i=Number(g[2])/255,p=Number(g[3])/255;else{const w=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(w)n=Number(w[1])/255,i=Number(w[2])/255,p=Number(w[3])/255;else{const z=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(z){let N=z[1];N.length===3&&(N=N[0]+N[0]+N[1]+N[1]+N[2]+N[2]),n=parseInt(N.slice(0,2),16)/255,i=parseInt(N.slice(2,4),16)/255,p=parseInt(N.slice(4,6),16)/255}else if(typeof document<"u"){const N=document.createElement("span");N.style.color=a,N.style.display="none",document.body.appendChild(N);const $=getComputedStyle(N).color;document.body.removeChild(N);const B=$.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(B)n=Number(B[1])/255,i=Number(B[2])/255,p=Number(B[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*i+.0722*p>.5?"#3a3a3a":"#fafafa"},u=t=>{if(!t||typeof t!="string")return t;const a=t.trim(),n=a.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(n){const g=Math.max(0,Math.floor(Number(n[1])*.65)),C=Math.max(0,Math.floor(Number(n[2])*.65)),w=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${C}, ${w})`}const i=a.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(i){const g=Math.max(0,Math.floor(Number(i[1])*.65)),C=Math.max(0,Math.floor(Number(i[2])*.65)),w=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${C}, ${w}, ${i[4]})`}const p=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(p){let g=p[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const C=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),w=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),z=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[C,w,z].map(N=>N.toString(16).padStart(2,"0")).join("")}`}return a},m=(t,a)=>{const i=Z.value?.stroke?.color;return i==null?u(a):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??u(a):u(a)},v=t=>{let a=0;for(let n=1;n<t.length;n++){const i=t[n].x-t[n-1].x,p=t[n].y-t[n-1].y;a+=Math.sqrt(i*i+p*p)}return a},k=e.computed(()=>we.value==="line"||Xn.value?(Xn.value?R.series.filter(a=>(a.type||we.value)==="line"):tl.value).map((a,n)=>{const i=R.series.findIndex(B=>B===a),p=[];let g=[];a.data.forEach((B,te)=>{B==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:Jt.value?gl(B):Kt(te),y:Jt.value?Cl(te):xn(a,B),index:te})}),g.length>0&&p.push(g);let C="";p.forEach(B=>{if(B.length>0){let te="";ye.value?te=Xl(B):te=`M ${B[0].x} ${B[0].y}`+B.slice(1).map(Se=>` L ${Se.x} ${Se.y}`).join(""),C+=(C?" ":"")+te}});const w=p.reduce((B,te)=>B+v(te),0),z=at.value.has(i),N=ce.value===i,$=ce.value!==null&&ce.value!==i;return{path:C,color:c(i),strokeDasharray:fo(a),pathLength:w,seriesIndex:i,animationDelay:n*Y.value,isHighlighted:N,isDimmed:$,isHidden:z}}):[]),_=e.computed(()=>{if(!(we.value==="line"||Xn.value))return[];const t=Xn.value?R.series.filter(n=>(n.type||we.value)==="line"):tl.value,a=[];return t.forEach((n,i)=>{const p=R.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const C=n.data[g];if(C!=null){let w=-1,z=0;for(let N=g+1;N<n.data.length;N++){const $=n.data[N];if($==null)z++;else{w=N;break}}if(z>0&&w!==-1){const N=n.data[w],$=Jt.value?gl(C):Kt(g),B=Jt.value?Cl(g):xn(n,C),te=Jt.value?gl(N):Kt(w),Se=Jt.value?Cl(w):xn(n,N),Ye=at.value.has(p),ue=ce.value===p,ke=ce.value!==null&&ce.value!==p;a.push({path:`M ${$} ${B} L ${te} ${Se}`,color:c(p),seriesIndex:p,animationDelay:i*Y.value,isHighlighted:ue,isDimmed:ke,isHidden:Ye,gapSize:z}),g=w-1}}}}),a}),H=e.computed(()=>we.value==="line"||Xn.value?!vt.value||Sl.value||Ft.value.hasAnimated?[]:(Xn.value?R.series.filter(a=>(a.type||we.value)==="line"):tl.value).map((a,n)=>{const i=R.series.findIndex(z=>z===a);let p="",g=null;a.data.forEach((z,N)=>{if(z!=null){const $={x:Jt.value?gl(z):Kt(N),y:Jt.value?Cl(N):xn(a,z)};g===null?p+=`M ${$.x} ${$.y}`:p+=` L ${$.x} ${$.y}`,g=$}else if(g!==null){const $=a.data.findIndex((B,te)=>te>N&&B!==null&&B!==void 0);if($!==-1){const B={x:Jt.value?gl(a.data[$]):Kt($),y:Jt.value?Cl($):xn(a,a.data[$])};p+=` L ${B.x} ${B.y}`,g=B}}});const C=a.data.map((z,N)=>z==null?null:{x:Jt.value?gl(z):Kt(N),y:Jt.value?Cl(N):xn(a,z)}).filter(z=>z!==null),w=v(C);return{path:p,pathLength:w,color:c(i),strokeDasharray:fo(a),animationDelay:n*Y.value,seriesIndex:i}}):[]),E=e.computed(()=>{if(we.value!=="line")return[];const t=[];return tl.value.forEach((a,n)=>{const i=ce.value===n,p=ce.value!==null&&ce.value!==n,g=at.value.has(n);a.data.forEach((C,w)=>{C!=null&&t.push({x:Kt(w),y:xn(a,C),color:c(n),value:C,label:R.categories[w]||w.toString(),seriesName:a.name,categoryIndex:w,dataIndex:w,animationDelay:(n*a.data.length+w)*(Y.value/8),isHighlighted:i,isDimmed:p,isHidden:g})})}),t}),se=e.computed(()=>{if(!Xn.value)return[];const t=[];return R.series.filter(n=>(n.type||we.value)==="line").forEach((n,i)=>{const p=R.series.findIndex(z=>z===n),g=ce.value===p,C=ce.value!==null&&ce.value!==p,w=at.value.has(p);n.data.forEach((z,N)=>{z!=null&&t.push({x:Kt(N),y:xn(n,z),color:c(p),value:z,label:R.categories[N]||N.toString(),seriesName:n.name,categoryIndex:N,dataIndex:N,animationDelay:(i*n.data.length+N)*(Y.value/8),isHighlighted:g,isDimmed:C,isHidden:w})})}),t}),j=e.computed(()=>{if(!jt.value)return[];const t=[];return tl.value.forEach((a,n)=>{if(!a?.data?.length)return;const i=ce.value,p=i!==null&&i===n,g=i!==null&&i!==n,C=at.value.has(n);a.data.forEach((w,z)=>{let N,$,B,te,Se;if(typeof w=="object"&&w!==null&&!Array.isArray(w))N=typeof w.x=="number"?w.x:z,$=typeof w.y=="number"?w.y:0,B=typeof w.size=="number"?w.size:20,te=w.label||R.categories?.[z]||`Point ${z+1}`,Se=w.image||w.imageUrl;else if(Array.isArray(w)&&w.length>=3)N=typeof w[0]=="number"?w[0]:z,$=typeof w[1]=="number"?w[1]:0,B=typeof w[2]=="number"?w[2]:20,te=w[3]||R.categories?.[z]||`Point ${z+1}`,Se=w[4];else if(typeof w=="number")N=z,$=w,B=Bo(n,z),te=R.categories?.[z]||`Point ${z+1}`;else return;!isFinite(N)||!isFinite($)||!isFinite(B)||t.push({x:Kt(N),y:wn($),radius:go(B),originalX:N,originalY:$,originalSize:B,color:c(n),seriesName:a.name||`Series ${n+1}`,label:te,imageUrl:Se,seriesIndex:n,dataIndex:z,categoryIndex:Math.round(N),isHighlighted:p,isDimmed:g,isHidden:C,opacity:jl.value})})}),t}),Ie=e.computed(()=>we.value!=="area"?[]:tl.value.map((t,a)=>{const n=[];let i=[];if(t.data.forEach((B,te)=>{B==null?i.length>0&&(n.push([...i]),i=[]):i.push({x:Kt(te),y:xn(t,B),index:te})}),i.length>0&&n.push(i),n.length===0)return{linePath:"",areaPath:"",color:c(a),isHidden:at.value.has(a)};const p=F.value.bottom+1;let g="",C="";n.forEach((B,te)=>{if(B.length===0)return;let Se=`M ${B[0].x} ${B[0].y}`;ye.value&&B.length>1?Se=Xl(B):B.slice(1).forEach(ue=>{Se+=` L ${ue.x} ${ue.y}`}),g+=(g?" ":"")+Se;let Ye=`M ${B[0].x} ${p}`;if(Ye+=` L ${B[0].x} ${B[0].y}`,ye.value&&B.length>1){const ue=Xl(B),ke=ue.substring(ue.indexOf("C")||ue.indexOf("Q")||ue.indexOf("L"));ke?Ye+=" "+ke:B.slice(1).forEach(Ne=>{Ye+=` L ${Ne.x} ${Ne.y}`})}else B.slice(1).forEach(ue=>{Ye+=` L ${ue.x} ${ue.y}`});Ye+=` L ${B[B.length-1].x} ${p} Z`,C+=(C?" ":"")+Ye});const w=ce.value===a,z=ce.value!==null&&ce.value!==a,N=at.value.has(a),$=n.reduce((B,te)=>B+v(te),0);return{linePath:g,areaPath:C,color:c(a),pathLength:$,isHighlighted:w,isDimmed:z,isHidden:N}})),Ve=e.computed(()=>{if(!(["bar"].includes(we.value)||Xn.value))return[];const t=[],{maxX:a}=Xt.value,n=Xn.value?R.series.filter(p=>(p.type||we.value)==="bar"):tl.value,i=n.length;if(Jt.value){const p=a+1,C=F.value.height/p,w=C*(2/3),z=Math.min(4,w/i*.15),N=w-(i-1)*z,$=Math.max(4,N/i);n.forEach((B,te)=>{const Se=R.series.findIndex(Ne=>Ne===B),Ye=ce.value===Se,ue=ce.value!==null&&ce.value!==Se,ke=at.value.has(Se);B.data.forEach((Ne,ge)=>{if(Ne==null||typeof Ne!="number"||!isFinite(Ne))return;const Le=F.value.top+(ge+.5)*C-w/2+te*($+z),_e=F.value.left,Re=Math.abs(gl(Ne)-F.value.left);let _t="";if(ye.value&&Re>0){const zt=Math.min(Tt.value,$/2,Re/2);_t=[`M ${_e} ${Le}`,`L ${_e+Re-zt} ${Le}`,`Q ${_e+Re} ${Le} ${_e+Re} ${Le+zt}`,`L ${_e+Re} ${Le+$-zt}`,`Q ${_e+Re} ${Le+$} ${_e+Re-zt} ${Le+$}`,`L ${_e} ${Le+$}`,"Z"].join(" ")}t.push({x:_e,y:Le,width:Re,height:$,color:c(i===1?ge:Se),value:Ne,label:R.categories[ge]||ge.toString(),seriesName:B.name,animationDelay:(te*n.length+ge)*(Y.value/4),isHighlighted:Ye,isDimmed:ue,isHidden:ke,barPath:_t,isSmooth:ye.value&&Re>0})})})}else{const p=a+1,C=F.value.width/p,w=C*.8,z=w/i,N=z*.05,$=z-N;n.forEach((B,te)=>{const Se=R.series.findIndex(Ne=>Ne===B),Ye=ce.value===Se,ue=ce.value!==null&&ce.value!==Se,ke=at.value.has(Se);B.data.forEach((Ne,ge)=>{if(Ne==null||typeof Ne!="number"||!isFinite(Ne))return;const Le=F.value.left+(ge+.5)*C-w/2+te*z+N/2,_e=wn(Math.max(0,Ne)),Re=Math.abs(wn(0)-wn(Ne));let _t="";if(ye.value&&Re>0){const zt=Math.min(Tt.value,$/2,Re/2);_t=[`M ${Le} ${_e+Re}`,`L ${Le} ${_e+zt}`,`Q ${Le} ${_e} ${Le+zt} ${_e}`,`L ${Le+$-zt} ${_e}`,`Q ${Le+$} ${_e} ${Le+$} ${_e+zt}`,`L ${Le+$} ${_e+Re}`,"Z"].join(" ")}t.push({x:Le,y:_e,width:$,height:Re,color:c(i===1?ge:Se),value:Ne,label:R.categories[ge]||ge.toString(),seriesName:B.name,animationDelay:(te*n.length+ge)*(Y.value/4),isHighlighted:Ye,isDimmed:ue,isHidden:ke,barPath:_t,isSmooth:ye.value&&Re>0})})})}return t}),lt=e.computed(()=>{if(!kn.value)return[];const t=tl.value.map((C,w)=>({series:C,originalIndex:w})).filter(({originalIndex:C})=>!at.value.has(C));if(t.length===0)return[];let a=we.value==="semi-radial"?Math.PI:-Math.PI/2;const n=we.value==="semi-radial"?Math.PI:Math.PI*2,i=[],p=(C,w,z,N,$,B)=>{const te=C+(w-C)/2,Se=w-C,Ye=Rt.value+Math.cos(C)*Wt.value,ue=kt.value+Math.sin(C)*Wt.value,ke=Rt.value+Math.cos(w)*Wt.value,Ne=kt.value+Math.sin(w)*Wt.value,ge=Rt.value+Math.cos(w)*ut.value,Qe=kt.value+Math.sin(w)*ut.value,Ze=Rt.value+Math.cos(C)*ut.value,Le=kt.value+Math.sin(C)*ut.value,_e=Se>Math.PI?1:0,Re=[`M ${Ye} ${ue}`,`A ${Wt.value} ${Wt.value} 0 ${_e} 1 ${ke} ${Ne}`,`L ${ge} ${Qe}`,`A ${ut.value} ${ut.value} 0 ${_e} 0 ${Ze} ${Le}`,"Z"].join(" "),_t=B||c(z);return{path:Re,color:_t,strokeWidth:Et.value,strokeColor:m(i.length,_t),value:$,seriesName:N,opacity:.8,isHighlighted:ce.value===z,isDimmed:ce.value!==null&&ce.value!==z,isHidden:!1,startAngle:C,endAngle:w,midAngle:te}};if(Fl.value){const{series:C,originalIndex:w}=t[0],z=Number(C?.data?.[0]??0),N=Number.isFinite(z)?Math.min(Math.max(z,0),100):0,$=Z.value,B=Math.min(Math.max(Number($?.miniRadial?.minVisiblePercent??1),0),100),Se=(N<=0?B:N)/100*n,Ye=Number($?.miniRadial?.thresholds?.low??33),ue=Number($?.miniRadial?.thresholds?.medium??66),ke=$?.miniRadial?.colors?.low||"#E53E3E",Ne=$?.miniRadial?.colors?.medium||"#ED8936",ge=$?.miniRadial?.colors?.high||"#38A169",Qe=N<=Ye?ke:N<=ue?Ne:ge,Ze=$?.miniRadial?.trackColor||"#E5E7EB",Le=C?.name||"Score";return i.push(p(a,a+n-.001,w+1,"Track",100,Ze)),i.push(p(a,a+Se,w,Le,N,Qe)),i}if(t.length===1){const{series:C,originalIndex:w}=t[0],z=C.data[0]||0,N=a,$=a+n-.001,B=N+n/2,te=Rt.value+Math.cos(N)*Wt.value,Se=kt.value+Math.sin(N)*Wt.value,Ye=Rt.value+Math.cos($)*Wt.value,ue=kt.value+Math.sin($)*Wt.value,ke=Rt.value+Math.cos($)*ut.value,Ne=kt.value+Math.sin($)*ut.value,ge=Rt.value+Math.cos(N)*ut.value,Qe=kt.value+Math.sin(N)*ut.value,Ze=1,Le=[`M ${te} ${Se}`,`A ${Wt.value} ${Wt.value} 0 ${Ze} 1 ${Ye} ${ue}`,`L ${ke} ${Ne}`,`A ${ut.value} ${ut.value} 0 ${Ze} 0 ${ge} ${Qe}`,"Z"].join(" "),_e=c(w);return i.push({path:Le,color:_e,strokeWidth:Et.value,strokeColor:m(0,_e),value:z,seriesName:C.name,opacity:.8,isHighlighted:ce.value===w,isDimmed:!1,isHidden:!1,startAngle:N,endAngle:$,midAngle:B}),i}if(cl.value&&t.length===2){const C=t[0],w=t[1],z=Math.min(100,Math.max(0,C.series.data[0]||0)),N=z/100*n;return i.push(p(a,a+N,C.originalIndex,C.series.name,z)),i.push(p(a,a+n,w.originalIndex,w.series.name,100)),i}const g=t.reduce((C,{series:w})=>C+(w.data[0]||0),0);return g===0?[]:(t.forEach(({series:C,originalIndex:w})=>{const z=C.data[0]||0,N=z/g*n,$=a,B=a+N,te=$+N/2,Se=Rt.value+Math.cos($)*Wt.value,Ye=kt.value+Math.sin($)*Wt.value,ue=Rt.value+Math.cos(B)*Wt.value,ke=kt.value+Math.sin(B)*Wt.value,Ne=Rt.value+Math.cos(B)*ut.value,ge=kt.value+Math.sin(B)*ut.value,Qe=Rt.value+Math.cos($)*ut.value,Ze=kt.value+Math.sin($)*ut.value,Le=N>Math.PI?1:0,_e=[`M ${Se} ${Ye}`,`A ${Wt.value} ${Wt.value} 0 ${Le} 1 ${ue} ${ke}`,`L ${Ne} ${ge}`,`A ${ut.value} ${ut.value} 0 ${Le} 0 ${Qe} ${Ze}`,"Z"].join(" "),Re=c(w);i.push({path:_e,color:Re,strokeWidth:Et.value,strokeColor:m(i.length,Re),value:z,seriesName:C.name,opacity:.8,isHighlighted:ce.value===w,isDimmed:ce.value!==null&&ce.value!==w,isHidden:!1,startAngle:$,endAngle:B,midAngle:te}),a=B}),i)}),Cn=e.computed(()=>{const t=lt.value;return cl.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((a,n)=>({segment:a,originalIndex:n}))}),vn=e.computed(()=>{if(!Mt.value||!kn.value)return[];const t=on.value,a=An.value,n=Fn.value,i=Qn.value,p=15,g=t*1.3,C=.55,w=(B,te)=>{const Se=Rt.value+Math.cos(B.midAngle)*ut.value,Ye=kt.value+Math.sin(B.midAngle)*ut.value,ue=Rt.value+Math.cos(B.midAngle)*(ut.value+a),ke=kt.value+Math.sin(B.midAngle)*(ut.value+a),ge=ue+n*(te?1:-1),Qe=te?ue+p:ue-p,Ze=ke-i,Le=`${B.seriesName}: ${qt(B.value)}`,_e=Le.length*t*C;return{pointerStartX:Se,pointerStartY:Ye,pointerEndX:ue,pointerEndY:ke,horizontalEndX:ge,horizontalEndY:ke,textX:Qe,textY:Ze,text:Le,textWidth:_e,textAnchor:te?"start":"end",isRightSide:te,pointerLineLength:Math.hypot(ue-Se,ke-Ye),horizontalLineLength:Math.hypot(ge-ue,0)}},z=(B,te)=>{const Se=Math.abs(B.textY-te.textY)<g,Ye=B.isRightSide?B.textX:B.textX-B.textWidth,ue=B.isRightSide?B.textX+B.textWidth:B.textX,ke=te.isRightSide?te.textX:te.textX-te.textWidth,Ne=te.isRightSide?te.textX+te.textWidth:te.textX,ge=Ye<Ne&&ke<ue;return Se&&ge},N=lt.value.filter(B=>!B.isHidden),$=[];for(let B=0;B<N.length;B++){const te=N[B];let Se=Math.cos(te.midAngle)>=0;if(B>0){const ue=$[B-1],ke=w(te,Se);z(ue,ke)&&(Se=!Se)}const Ye=w(te,Se);$.push({...Ye,color:te.color,isHighlighted:te.isHighlighted,isDimmed:te.isDimmed})}return $}),rn=t=>{if(!t||t.isHidden)return 0;const a=t.opacity||jl.value||.7;return ce.value===null||ce.value===void 0?a:ce.value!==null?t.seriesIndex===ce.value?Math.min(1,a+.1):Math.max(.5,a*.8):a},gn=t=>{if(!t||t.isHidden)return 0;const a=t.radius>20?.9:.8;return ce.value!==null?t.seriesIndex===ce.value?Math.min(1,a+.1):a*.7:a},un=(t,a)=>{if(t)try{if(ce.value===t.seriesIndex?ce.value=null:ce.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:a,chartId:R.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},dn=(t,a)=>{const n=[`dss-bubble-fallback-${a}`];return t.isHighlighted&&n.push("dss-bubble-highlighted"),t.isDimmed&&n.push("dss-bubble-dimmed"),t.isHidden&&n.push("dss-bubble-hidden"),n.push(`dss-bubble-series-${t.seriesIndex}`),n.join(" ")},Yn=(t,a)=>{if(!t||(a.stopPropagation(),Ro.value=!0,ce.value=t.seriesIndex,st.value.show=!1,!Xe.value))return;const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect();let p=a.clientX-i.left+10,g=a.clientY-i.top-10;const C=200,w=120;p+C>Ee.value&&(p=a.clientX-i.left-C-10),g+w>i.height&&(g=a.clientY-i.top-w-10),p<0&&(p=10),g<0&&(g=10);const z=Qt.value,N=an.value,$=z.map(B=>{const te=N[B]||B,Se=ul(B,t);return Se?{seriesName:t.seriesName,label:t.label,value:`${te}: ${Se}`,color:t.color}:null}).filter(Boolean);ht.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:$,categoryIndex:void 0,spiderAreas:[]}},ul=(t,a)=>{let n;switch(t){case"x":n=a.originalX;break;case"y":n=a.originalY;break;case"size":n=a.originalSize;break;case"label":n=a.label;break;case"seriesName":n=a.seriesName;break;default:n=a[t]||""}const i=al.value[t];if(typeof i=="function")return i(n,a);if(typeof n=="number"){const p=n.toFixed(1);return ol.value?p+ol.value:p}return n?.toString()||""},hl=()=>{if(!jt.value||!st.value.data||st.value.data.length===0)return"Bubbles";const t=[],a=new Set;return st.value.data.forEach(n=>{if(n.seriesName&&n.label){const i=`${n.seriesName} - ${n.label}`;a.has(i)||(t.push(i),a.add(i))}else n.seriesName&&(a.has(n.seriesName)||(t.push(n.seriesName),a.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},yo=(t,a)=>{t&&(Ro.value=!1,ce.value=null,ht.value.show=!1,ht.value.bubbleData=[])},Ao=(t,a)=>{const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect(),p=Hl(t.categoryIndex),g=t.description||t.comment||"";let C=a.clientX-i.left+15,w=a.clientY-i.top-10;const z=200,N=g?80:50;C+z>Ee.value&&(C=a.clientX-i.left-z-15),w+N>Q.value&&(w=a.clientY-i.top-N-10),C<0&&(C=10),w<0&&(w=10),pn.value={show:!0,x:C,y:w,categoryValue:p,description:g}},jo=()=>{pn.value.show=!1},El=e.computed(()=>R.categories.length||Math.max(...nl.value.map(t=>t.data.length))),na=e.computed(()=>{let t=0;return nl.value.forEach(a=>{a.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),ko=e.computed(()=>{const t=[],a=El.value;for(let n=0;n<a;n++){const i=n*2*Math.PI/a-Math.PI/2,p=Rt.value+Math.cos(i)*ut.value,g=kt.value+Math.sin(i)*ut.value;t.push({x:p,y:g,angle:i,index:n})}return t}),Gl=e.computed(()=>{const t=[],a=El.value;return ko.value.forEach((n,i)=>{const p=ut.value+15,g=i*2*Math.PI/a-Math.PI/2,C=Rt.value+Math.cos(g)*p,w=kt.value+Math.sin(g)*p+5;let z="middle",N="middle";Math.abs(Math.cos(g))>.5&&(z=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(N=Math.sin(g)>0?"hanging":"auto"),t.push({x:C,y:w,text:R.categories[i]||`Axis ${i+1}`,anchor:z,baseline:N})}),t}),Do=e.ref(new Set),dl=(t,a,n)=>{const i=`current-${n}`,p=Do.value.has(i);return!p&&ce.value===null?a.fillOpacity||mt.value:a.isHighlighted||p?(a.fillOpacity||mt.value)+.15:a.isDimmed?(a.fillOpacity||mt.value)*.3:a.fillOpacity||mt.value},ll=e.computed(()=>{if(!Ln.value)return[];const t=[],a=El.value;return tl.value.forEach((n,i)=>{const p=[],g=[],C=[],w=ce.value===i,z=ce.value!==null&&ce.value!==i,N=at.value.has(i);for(let $=0;$<a;$++){const B=n.data[$]||0,Se=B/na.value*ut.value,Ye=$*2*Math.PI/a-Math.PI/2,ue=Rt.value+Math.cos(Ye)*Se,ke=kt.value+Math.sin(Ye)*Se;p.push(`${ue},${ke}`),g.push({x:ue,y:ke}),C.push({x:ue,y:ke,value:B,label:R.categories[$]||`Axis ${$+1}`,seriesName:n.name})}t.push({points:p.join(" "),polygonPoints:g,dataPoints:C,color:c(i),fillOpacity:mt.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:w,isDimmed:z,isHidden:N,seriesIndex:i})}),t}),jn=(t,a)=>{if(!a||a.length<3)return!1;let n=!1;for(let i=0,p=a.length-1;i<a.length;p=i++){const g=a[i].x,C=a[i].y,w=a[p].x,z=a[p].y;C>t.y!=z>t.y&&t.x<(w-g)*(t.y-C)/(z-C)+g&&(n=!n)}return n},la=t=>{if(!Ln.value)return;const a=t.currentTarget.closest(".dss-custom-chart-container");if(!a)return;const n=a.getBoundingClientRect(),i=T.value?.getBoundingClientRect();if(!i)return;const p=t.clientX-i.left,g=t.clientY-i.top,C=ll.value.filter(w=>w.isHidden?!1:jn({x:p,y:g},w.polygonPoints));if(C.length>0){C.length,ce.value=C[0].seriesIndex;const w=t.clientX-n.left+10,z=t.clientY-n.top-10,N=C.length>1?460:260,$=70+El.value*20;let B=w,te=z;B+N>Ee.value&&(B=t.clientX-n.left-N-10),te+$>Q.value&&(te=t.clientY-n.top-$-10),B<0&&(B=10),te<0&&(te=10);const Se=C.map(Ye=>({seriesName:Ye.seriesName,color:Ye.color,points:Ye.dataPoints.map(ue=>({label:ue.label,value:qt(ue.value)}))}));ht.value={show:!0,x:B,y:te,title:"",value:"",bubbleData:[],spiderAreas:Se}}else yl()},Ho=e.computed(()=>{const t=Z.value;return t.logos.map((a,n)=>{const i=R.series[a.seriesIndex];if(!i||!i.data||i.data.length===0||at.value.has(a.seriesIndex))return null;let p,g;if(Sn.value){let w=-1,z=null;for(let $=i.data.length-1;$>=0;$--)if(i.data[$]!==null&&i.data[$]!==void 0){w=$,z=i.data[$];break}if(w===-1||z===null)return null;const N=i.data.map(($,B)=>$==null?null:{x:Kt(B),y:xn(i,$),index:B}).filter($=>$!==null);if(t.animations.enabled&&!Sl.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Ft.value.isAnimating||!Ft.value.hasAnimated))if(Ft.value.isAnimating){const $=Ft.value.currentFrame/Ft.value.totalFrames,B=Qo(t.animations.easing,Math.min($,1)),te=xa(N,B);p=te.x+(a.offsetX||0),g=te.y+(a.offsetY||0)}else p=N[0].x+(a.offsetX||0),g=N[0].y+(a.offsetY||0);else p=Kt(w)+(a.offsetX||0),g=wn(z)+(a.offsetY||0)}else if(kn.value||Ln.value){const w=Math.PI*2/t.logos.length*n;p=Rt.value+Math.cos(w)*(ut.value+30)+(a.offsetX||0),g=kt.value+Math.sin(w)*(ut.value+30)+(a.offsetY||0)}return{...a,x:p,y:g,seriesIndex:a.seriesIndex}}).filter(Boolean)}),va=t=>{const a=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.opacity="0"),n&&(n.style.opacity="1")},ga=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const a=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.display="none")},Ko=t=>{at.value.has(t)?at.value.delete(t):at.value.add(t)},ha=e.computed(()=>{if(!ht.value.show&&!(Ke.value&&st.value.show&&!ae.value.isZooming))return{display:"none"};let t,a;if(Ke.value&&st.value.show&&!ae.value.isZooming){t=st.value.x+15,a=F.value.top;const n=jt.value?200:150;t+n>Ee.value&&(t=st.value.x-n-15),t<0&&(t=10),a<10&&(a=10)}else t=ht.value.x,a=ht.value.y;return{left:t+"px",top:a+"px"}}),Ll=(t,a)=>{if(!Xe.value||Co.value)return;const i=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-i.left+10,g=a.clientY-i.top-10;const C=200,w=120,z=Ee.value,N=Q.value;p+C>z&&(p=a.clientX-i.left-C-10),g+w>N&&(g=a.clientY-i.top-w-10),p<0&&(p=10),g<0&&(g=10);let $;typeof t.categoryIndex=="number"?$=t.categoryIndex:typeof t.dataIndex=="number"?$=t.dataIndex:t.label&&R.categories.includes(t.label)&&($=R.categories.indexOf(t.label));const B=(Jt.value||we.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";ht.value={show:!0,x:p,y:g,title:B,value:qt(t.value)||"",categoryIndex:$,spiderAreas:[]}},Go=e.ref(!1),Ro=e.ref(!1),yl=()=>{ht.value.show=!1,ht.value.spiderAreas=[],ht.value.bubbleData=[],st.value.show=!1,Go.value||(ce.value=null)},Co=e.ref(!1),bo=(t,a)=>{Co.value=!0,ht.value.show=!1,st.value.show=!1;const i=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-i.left+15,g=a.clientY-i.top-10;const C=250;p+C>Ee.value&&(p=a.clientX-i.left-C-15),p<0&&(p=10),g<0&&(g=10),yn.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},wo=()=>{Co.value=!1,yn.value.show=!1},Ft=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),Qo=(t,a)=>{switch(t){case"linear":return a;case"ease":return a<.5?2*a*a:-1+(4-2*a)*a;case"ease-in":return a*a;case"ease-out":return a*(2-a);case"ease-in-out":return a<.5?2*a*a:-1+(4-2*a)*a;default:return a}},Sl=e.computed(()=>Oe.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),oa=()=>{if(!vt.value||Sl.value){Ft.value.hasAnimated=!0,el.value&&(xl.value=1);return}el.value&&(xl.value=0),Ft.value.isAnimating=!0,Ft.value.currentFrame=0,Ft.value.totalFrames=Math.ceil(S.value/16.67);const t=()=>{const a=Ft.value.currentFrame/Ft.value.totalFrames,n=Qo(V.value,Math.min(a,1));ya(n),el.value&&(xl.value=n),a<1?(Ft.value.currentFrame++,Ft.value.animationId=requestAnimationFrame(t)):ka()};Ft.value.animationId=requestAnimationFrame(t)},ya=t=>{const a=I.value;a&&a.style.setProperty("--dss-animation-progress",t)},ka=()=>{Ft.value.isAnimating=!1,Ft.value.hasAnimated=!0,el.value&&(xl.value=1),Ft.value.animationId&&(cancelAnimationFrame(Ft.value.animationId),Ft.value.animationId=null)},Jo=e.computed(()=>!kn.value||Ft.value.hasAnimated?!0:el.value?xl.value>=1:Pn.value?Bl.value>=1:!0),aa=e.computed(()=>Mt.value&&Jo.value),Fo=e.ref(!1);e.watch(aa,t=>{t?(Fo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Fo.value=!0})})):Fo.value=!1},{immediate:!0});const Ca=e.computed(()=>{if(!vt.value||Sl.value||Ft.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${S.value}ms`,t["--dss-animation-easing"]=ba(V.value),t["--dss-stagger-delay"]=`${Y.value}ms`,t}),ba=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",wa=()=>{if(!vt.value||Sl.value)return"";const t=["dss-chart-animated"];return Ft.value.hasAnimated||t.push(`dss-animate-${Gt.value}`),Ft.value.hasAnimated||(kn.value&&we.value!=="semi-radial"?t.push("dss-animate-fill"):kn.value||t.push(`dss-animate-${Gt.value}`)),Ft.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>R.series,(t,a)=>{ne.value&&a&&Ft.value.hasAnimated&&(Ft.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>oa(),b.value)}))},{deep:!0}),e.watch(()=>ae.value.isZooming,(t,a)=>{a&&!t&&setTimeout(()=>{Rl()},50)}),e.watch(()=>[ae.value.scale,ae.value.offsetX],()=>{!ae.value.isZooming&&!ae.value.isDragging&&Rl()},{flush:"post"}),e.watch([Dt,He],([t,a])=>{ae.value.minScale=t,ae.value.maxScale=a,(ae.value.scale<t||ae.value.scale>a)&&uo()},{immediate:!0}),e.watch(()=>R.locale,t=>{t&&t!==L.value&&(L.value=t)},{immediate:!0}),e.watch(()=>gt.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",io)}):document.removeEventListener("click",io)}),e.onMounted(()=>{ce.value=null,el.value&&(!vt.value||Sl.value)&&(xl.value=1),x(),I.value&&typeof ResizeObserver<"u"&&(f=new ResizeObserver(t=>{const a=t[0];!a||!a.contentRect||(be&&cancelAnimationFrame(be),be=requestAnimationFrame(()=>{be=null;const{width:n,height:i}=a.contentRect;dt.value=Math.round(n),ee.value=Math.round(i),fe.value&&(Me.value=fe.value.offsetHeight||Ce)}))}),f.observe(I.value)),vt.value&&!Sl.value?we.value==="semi-radial"?setTimeout(()=>Xo(),b.value):setTimeout(()=>oa(),b.value):(Ft.value.hasAnimated=!0,we.value==="semi-radial"&&(Bl.value=1)),document.addEventListener("mousemove",sa),document.addEventListener("mouseup",ra),document.addEventListener("click",Eo)}),e.onUnmounted(()=>{be&&cancelAnimationFrame(be),f&&I.value&&(f.unobserve(I.value),f.disconnect(),f=null),Ft.value.animationId&&cancelAnimationFrame(Ft.value.animationId),Pl&&(cancelAnimationFrame(Pl),Pl=null),ae.value.zoomTimeout&&clearTimeout(ae.value.zoomTimeout),document.removeEventListener("mousemove",sa),document.removeEventListener("mouseup",ra),document.removeEventListener("click",Eo),document.removeEventListener("click",io)});const sa=t=>{if(ae.value.isDragging&&ae.value.scale>1&&Sn.value){st.value.show=!1;const a=t.clientX-ae.value.lastMouseX,{minX:n,maxX:i}=Xt.value,p=i-n||1,C=a*.8;ae.value.offsetX+=C;const w=p/ae.value.scale,z=p-w,N=0,$=-z/p*F.value.width,B=N;ae.value.offsetX=Math.max($,Math.min(B,ae.value.offsetX)),ae.value.lastMouseX=t.clientX,ae.value.lastMouseY=t.clientY}},ra=()=>{ae.value.isDragging&&(ae.value.isDragging=!1,setTimeout(()=>{!ae.value.isDragging&&ae.value.isZooming},100))},xa=(t,a)=>{const n=t.filter(w=>w!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||a<=0)return n[0];if(a>=1)return n[n.length-1];let i=0;const p=[];for(let w=1;w<n.length;w++){const z=n[w].x-n[w-1].x,N=n[w].y-n[w-1].y,$=Math.sqrt(z*z+N*N);p.push($),i+=$}const g=i*a;let C=0;for(let w=0;w<p.length;w++){const z=C+p[w];if(g<=z){const N=(g-C)/p[w],$=n[w],B=n[w+1];return{x:$.x+(B.x-$.x)*N,y:$.y+(B.y-$.y)*N}}C=z}return n[n.length-1]};return(t,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[wa(),{"dss-chart-fill-width":Ue.value,"dss-chart-fill-height":qe.value,"dss-chart-compact":kn.value&&!J.value}]]),style:e.normalizeStyle({width:Ue.value?"100%":Ee.value+"px",height:ze.value,...Ue.value||qe.value?{overflow:kn.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Ca.value,cursor:Zo()}),"data-chart-type":we.value,ref_key:"containerEl",ref:I,onWheel:So,onMousedown:co,onMousemove:zn,onMouseup:Vo,onMouseleave:Dl,onDblclick:uo,onContextmenu:e.withModifiers(Nl,["prevent"]),onClick:e.withModifiers(Zn,["left"]),onWheelCapture:So},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:fe},[e.createElementVNode("div",gs,[ot.value?(e.openBlock(),e.createElementBlock("div",hs,e.toDisplayString(ot.value),1)):e.createCommentVNode("",!0),bt.value?(e.openBlock(),e.createElementBlock("div",ys,e.toDisplayString(bt.value),1)):e.createCommentVNode("",!0)]),J.value&&he.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Be.value==="horizontal","dss-legend-vertical":Be.value==="vertical","dss-legend-top":he.value==="top","dss-legend-bottom":he.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":at.value.has(i),"dss-legend-hovered":ce.value===i,"dss-legend-dimmed":ce.value!==null&&ce.value!==i}]),onClick:p=>Ko(i),onMouseenter:p=>In(i),onMouseleave:cn,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",Cs,e.toDisplayString(n.name),1)],46,ks))),128))],2)):e.createCommentVNode("",!0),J.value&&(he.value==="left"||he.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":he.value==="left","dss-legend-right":he.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":at.value.has(i),"dss-legend-hovered":ce.value===i,"dss-legend-dimmed":ce.value!==null&&ce.value!==i}]),onClick:p=>Ko(i),onMouseenter:p=>In(i),onMouseleave:cn,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",ws,e.toDisplayString(n.name),1)],46,bs))),128))],2)):e.createCommentVNode("",!0)],512),D.showAddMarkerButton&&wt.value&&Ct.value.addMarker&&(Sn.value||jt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:xo,title:e.unref(M)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Bt.value,class:"dss-add-marker-button-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Es),a[4]||(a[4]=e.createElementVNode("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 4V16M4 10H16",stroke:"hsl(60, 2%, 47%)","stroke-width":"2","stroke-linecap":"round"})],-1))],8,xs)):e.createCommentVNode("",!0),e.createElementVNode("div",Ss,[jt.value&&It.value?(e.openBlock(),e.createElementBlock("div",Vs,"Bubble size: "+e.toDisplayString(It.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Ee.value,height:Q.value,class:"dss-chart-svg","data-smooth":ye.value,"data-animated":vt.value,ref_key:"svgEl",ref:T},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:U.value},[e.createElementVNode("rect",{x:0,y:F.value.top,width:Ee.value,height:F.value.height*4},null,8,Ms)],8,Bs),Pn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Yl.value},[e.createElementVNode("path",{d:bl.value},null,8,$s)],8,_s)):e.createCommentVNode("",!0),el.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:Ml.value},[e.createElementVNode("path",{d:zl.value},null,8,Ts)],8,Ls)):e.createCommentVNode("",!0)]),Sn.value||jt.value?(e.openBlock(),e.createElementBlock("g",As,[Ot.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":me.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(To.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${i}`,x1:F.value.left,x2:F.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${i*50}ms`})},null,12,Hs))),128))],8,Ds)):e.createCommentVNode("",!0),e.createElementVNode("g",Rs,[e.createElementVNode("line",{x1:F.value.left,x2:F.value.right,y1:F.value.bottom,y2:F.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Fs),e.createElementVNode("line",{x1:F.value.left,x2:F.value.left,y1:F.value.top,y2:F.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Is),Hn.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:F.value.right,x2:F.value.right,y1:F.value.top,y2:F.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,zs)):e.createCommentVNode("",!0)]),e.createElementVNode("g",Ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${i}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},e.toDisplayString(n.text),13,Os))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${i}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(n.text),13,qs))),128)),Hn.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(r.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-secondary-${i}`,x:n.x,y:n.y,"text-anchor":"start","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(n.text),13,Ws))),128)):e.createCommentVNode("",!0),en.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:F.value.left+F.value.width/2,y:F.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(en.value),9,Zs)):e.createCommentVNode("",!0),Pt.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:15,y:F.value.top+12+F.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${F.value.top+F.value.height/2})`},e.toDisplayString(Pt.value),9,Us)):e.createCommentVNode("",!0),Hn.value&&ve.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:Ee.value-15,y:F.value.top+12+F.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(90, ${Ee.value-15}, ${F.value.top+F.value.height/2})`},e.toDisplayString(ve.value),9,Xs)):e.createCommentVNode("",!0)]),Jn.value.length>0?(e.openBlock(),e.createElementBlock("g",Ys,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jn.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",{"clip-path":me.value},[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:F.value.bottom,y2:F.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>bo(n,i),onMouseleave:wo},null,40,Ks)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:F.value.bottom,y2:F.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>bo(n,i),onMouseleave:wo},null,40,Gs)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:F.value.bottom,y2:F.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>bo(n,i),onMouseleave:wo},null,40,Qs)):e.createCommentVNode("",!0)],8,js),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,F.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>bo(n,i),onMouseleave:wo},null,40,Js)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,F.value.top-10),r:"14",fill:n.hasManual&&n.hasAuto||n.hasManual?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:i=>bo(n,i),onMouseleave:wo},null,40,er),e.createElementVNode("text",{x:n.x,y:Math.max(15,F.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(n.totalCount),9,tr)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":me.value},[Xn.value?(e.openBlock(),e.createElementBlock("g",lr,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":Jt.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ve.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${i}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Ll(n,p),onMouseleave:yl},null,46,or)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Ll(n,p),onMouseleave:yl},null,46,ar))],64))),128))],2),e.createElementVNode("g",sr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Pe.value+2:Pe.value,"stroke-dasharray":n.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,rr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Pe.value+2:Pe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,ir))),128)),St.value>0||K.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(se.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:n.x,cy:n.y,r:X(n.isHighlighted?W(n,St.value)+2:W(n,St.value)),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Ll(n,p),onMouseleave:yl},null,46,cr))),128)):e.createCommentVNode("",!0)])])):we.value==="line"?(e.openBlock(),e.createElementBlock("g",ur,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:n.path,stroke:n.color,"stroke-width":Pe.value,"stroke-dasharray":n.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Ft.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,dr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Pe.value+2:Pe.value,"stroke-dasharray":n.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,mr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Pe.value+2:Pe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,pr))),128)),St.value>0||K.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(E.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:n.x,cy:n.y,r:X(n.isHighlighted?W(n,St.value)+2:W(n,St.value)),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Ll(n,p),onMouseleave:yl},null,46,fr))),128)):e.createCommentVNode("",!0)])):we.value==="area"?(e.openBlock(),e.createElementBlock("g",vr,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie.value,(n,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${D.chartId}`},[e.createElementVNode("rect",{x:F.value.left-10,y:F.value.top-10,width:F.value.width+20,height:F.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${F.value.width+20}px`})},null,12,hr)],8,gr))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?pe.value+.2:pe.value,mask:`url(#area-mask-${i}-${D.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden})},null,10,yr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?Pe.value+1:Pe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${i*Y.value}ms`})},null,14,kr))),128))])):we.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":Jt.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ve.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${i}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Ll(n,p),onMouseleave:yl},null,46,Cr)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>Ll(n,p),onMouseleave:yl},null,46,br))],64))),128))],2)):e.createCommentVNode("",!0)],8,nr),Ke.value&&st.value.show&&!ae.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":me.value},[e.createElementVNode("line",{x1:st.value.x,x2:st.value.x,y1:F.value.top,y2:F.value.bottom,stroke:Lt.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,xr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(st.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:st.value.x,cy:n.y,r:X(St.value+2),fill:n.color,stroke:"none",opacity:"0.9"},null,8,Er))),128))],8,wr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),jt.value?(e.openBlock(),e.createElementBlock("g",Sr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[n?(e.openBlock(),e.createElementBlock("g",Vr,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:X(n.radius),fill:n.color,"fill-opacity":rn(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(dn(n,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>Yn(n,p),onMouseleave:p=>yo(n),onClick:p=>un(n,p)},null,42,Nr),n.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:n.x-n.radius*.65,y:n.y-n.radius*.65,width:n.radius*1.3,height:n.radius*1.3,"xlink:href":n.imageUrl,class:e.normalizeClass(`dss-bubble-image-${i} ${n.isHighlighted?"dss-bubble-highlighted":""} ${n.isDimmed?"dss-bubble-dimmed":""} ${n.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${n.radius*.65}px at ${n.radius*.65}px ${n.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:gn(n)}),onLoad:p=>Mo(i),onError:p=>po(i),onMouseenter:p=>Yn(n,p),onMouseleave:p=>yo(n),onClick:p=>un(n,p)},null,46,Br)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),kn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:nn.value},[we.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Rt.value,cy:kt.value,r:ut.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,_r)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":we.value,"clip-path":No.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cn.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${n.originalIndex}-${i}`,d:n.segment.path,fill:n.segment.color,"fill-opacity":n.segment.isHighlighted?(n.segment.opacity||.8)+.2:n.segment.opacity||.8,stroke:n.segment.strokeWidth?n.segment.strokeColor||n.segment.color:"none","stroke-width":n.segment.strokeWidth||0,"clip-path":Uo(n.originalIndex),class:e.normalizeClass({"dss-series-highlighted":n.segment.isHighlighted,"dss-series-dimmed":n.segment.isDimmed,"dss-series-hidden":n.segment.isHidden}),onMouseover:p=>Ll(n.segment,p),onMouseleave:yl},null,42,Lr))),128))],8,$r),En.value&&Jo.value?(e.openBlock(),e.createElementBlock("g",Tr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ao.value,(n,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${i}`,x:n.x,y:n.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label",style:e.normalizeStyle({fill:n.contrastColor})},e.toDisplayString(n.value),13,Ar)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),ql.value&&(Jo.value||Pn.value||Fl.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:ml.value.x,y:ml.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Wl.value,fill:Vl.value,class:"dss-radial-data-center"},e.toDisplayString(Al.value),9,Dr)):e.createCommentVNode("",!0),aa.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Fo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vn.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${i}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${i*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:n.pointerStartX,y1:n.pointerStartY,x2:n.pointerEndX,y2:n.pointerEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.pointerLineLength})},null,12,Hr),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:n.pointerEndX,y1:n.pointerEndY,x2:n.horizontalEndX,y2:n.horizontalEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.horizontalLineLength})},null,12,Rr),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":on.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,Fr)],6))),128))],2)):e.createCommentVNode("",!0)],8,Mr)):e.createCommentVNode("",!0),Ln.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:nn.value},[Ot.value?(e.openBlock(),e.createElementBlock("g",zr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:Rt.value,cy:kt.value,r:X(n),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,Pr))),128)),e.createElementVNode("g",Or,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:Rt.value-16,y:kt.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,qr),e.createElementVNode("text",{x:Rt.value,y:kt.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Vt(i)),9,Wr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ko.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:Rt.value,x2:n.x,y1:kt.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,Zr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Ur,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Gl.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:n.x+Math.cos(i*2*Math.PI/El.value-Math.PI/2)*16,y:n.y+Math.sin(i*2*Math.PI/El.value-Math.PI/2)*16,"text-anchor":n.anchor,"dominant-baseline":n.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${i*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,Xr))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:la,onMouseleave:yl},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ll.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":dl("current",n,i),stroke:n.color,"stroke-width":n.isHighlighted?Pe.value+1:Pe.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${i*Y.value}ms`,transition:"all 0.2s ease"})},null,14,Yr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataPoints,(p,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${i}-${g}`,cx:p.x,cy:p.y,r:X(n.isHighlighted?St.value+1:St.value>0?St.value:0),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${i*Y.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>Ll(p,C),onMouseleave:yl},null,46,jr))),128))]))),128))],32)],8,Ir)):e.createCommentVNode("",!0),e.createElementVNode("g",Kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ho.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:n.x,cy:n.y,r:X(n.width/2),fill:c(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,Gr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ho.value,(n,i)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${i}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:p=>va(i),onError:p=>ga(i),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${i}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,46,Qr))),128))])],8,Ns))]),Rn.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Ee.value+"px",height:Q.value+"px",backgroundImage:`url('${tt.value}')`,backgroundRepeat:"no-repeat",...ie.value,opacity:Nn.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qn.value,(n,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+n.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:n.x+"px",top:n.y+"px",width:Tn.value+"px",height:Tn.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>y(n),["stop"]),onMouseenter:p=>Ao(n,p),onMouseleave:jo},[e.createElementVNode("img",{src:sl(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,ei)],44,Jr)),[[e.vShow,ln.value]])),128)),pn.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:pn.value.x+"px",top:pn.value.y+"px"})},[e.createElementVNode("div",ti,e.toDisplayString(pn.value.categoryValue),1),pn.value.description?(e.openBlock(),e.createElementBlock("div",ni,e.toDisplayString(pn.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Xe.value&&(ht.value.show||Ke.value&&st.value.show&&!ae.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Ke.value&&st.value.show&&!ae.value.isZooming,"dss-spider-tooltip":Ln.value&&ht.value.spiderAreas&&ht.value.spiderAreas.length>0}]),style:e.normalizeStyle(ha.value)},[!Ke.value||!st.value.show||ae.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Ln.value&&ht.value.spiderAreas&&ht.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",li,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ht.value.spiderAreas,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${i}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",oi,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createTextVNode(" "+e.toDisplayString(n.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.points,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${i}-${g}`,class:"dss-tooltip-series"},[e.createElementVNode("span",ai,e.toDisplayString(p.label),1),e.createElementVNode("span",si,e.toDisplayString(p.value),1)]))),128))]))),128))])):jt.value&&ht.value.bubbleData&&ht.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",ri,[ht.value.title?(e.openBlock(),e.createElementBlock("div",ii,e.toDisplayString(ht.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ci,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ht.value.bubbleData,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",ui,[e.createElementVNode("div",di,e.toDisplayString(ht.value.title),1),e.createElementVNode("div",mi,e.toDisplayString(ht.value.value),1)])),ht.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[et(ht.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",pi,[a[5]||(a[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",fi,e.toDisplayString(e.unref(M)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et(ht.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",vi,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",gi,[e.createElementVNode("div",hi,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),et(ht.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",yi,[a[6]||(a[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ki,e.toDisplayString(e.unref(M)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et(ht.value.categoryIndex).markers,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",Ci,[e.createElementVNode("div",bi,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",wi,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",xi,[e.createElementVNode("div",Ei,e.toDisplayString(jt.value?hl():D.categories[st.value.categoryIndex]||`Category ${st.value.categoryIndex+1}`),1),jt.value?(e.openBlock(),e.createElementBlock("div",Si,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(st.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(st.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Vi,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Ni,e.toDisplayString(qt(n.value)),1)]))),128))]),et(st.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Bi,[a[7]||(a[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Mi,e.toDisplayString(e.unref(M)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et(st.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",_i,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",$i,[e.createElementVNode("div",Li,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),et(st.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Ti,[a[8]||(a[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ai,e.toDisplayString(e.unref(M)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et(st.value.categoryIndex).markers,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",Di,[e.createElementVNode("div",Hi,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Ri,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Sn.value&&Ge.value&&ae.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:uo},[a[9]||(a[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(ae.value.scale*100))+"% "+e.toDisplayString(e.unref(M)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,vs),J.value&&he.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Be.value==="horizontal","dss-legend-vertical":Be.value==="vertical","dss-legend-bottom":!0}]),style:{display:"flex","flex-wrap":"wrap","justify-content":"center",padding:"6px 8px 0"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":at.value.has(i),"dss-legend-hovered":ce.value===i,"dss-legend-dimmed":ce.value!==null&&ce.value!==i}]),onClick:p=>Ko(i),onMouseenter:p=>In(i),onMouseleave:cn,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",Ii,e.toDisplayString(n.name),1)],46,Fi))),128))],2)):e.createCommentVNode("",!0),gt.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:gt.value.x+"px",top:gt.value.y+"px"}),onClick:a[0]||(a[0]=e.withModifiers(()=>{},["stop"]))},[Ct.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:ro},e.toDisplayString(e.unref(M)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Ct.value.addMarker&&(Ct.value.downloadSvg||Ct.value.downloadPng||Ct.value.downloadCsv||At.value.length>0)?(e.openBlock(),e.createElementBlock("div",zi)):e.createCommentVNode("",!0),Ct.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:_n},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Ct.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Dn},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Ct.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Wn},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),At.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Ct.value.downloadSvg||Ct.value.downloadPng||Ct.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Pi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(At.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[n.separator?(e.openBlock(),e.createElementBlock("div",Oi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Zl(n)),style:e.normalizeStyle(Ul(n)),onClick:p=>kl(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:fn(n),class:"dss-custom-menu-content"},null,8,Wi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",Zi,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,qi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),$e.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:$t},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Ui,[e.createElementVNode("h3",null,e.toDisplayString(tn.value?e.unref(M)("chart.modalMarker.viewMarker"):Bn.value?e.unref(M)("chart.modalMarker.editMarker"):e.unref(M)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:$t},"×")]),e.createElementVNode("div",Xi,[e.createElementVNode("div",Yi,[e.createVNode(ta,{id:"dss-marker-date",mode:"single",modelValue:$e.value.date,"onUpdate:modelValue":a[1]||(a[1]=n=>$e.value.date=n),"min-date":so.value,"max-date":sn.value,disabled:tn.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",ji,[e.createElementVNode("label",Ki,e.toDisplayString(e.unref(M)("chart.modalMarker.description")),1),tn.value?(e.openBlock(),e.createElementBlock("div",Gi,e.toDisplayString($e.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":a[2]||(a[2]=n=>$e.value.description=n),placeholder:e.unref(M)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Qi)),[[e.vModelText,$e.value.description]])])]),e.createElementVNode("div",Ji,[e.createElementVNode("div",ec,[Bn.value&&!tn.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:Un},e.toDisplayString(e.unref(M)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",tc,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:$t},e.toDisplayString(tn.value?e.unref(M)("chart.modalMarker.close"):e.unref(M)("chart.modalMarker.cancel")),1),tn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:vl,disabled:!($e.value.description&&$e.value.description.length)},e.toDisplayString(Bn.value?e.unref(M)("chart.modalMarker.save"):e.unref(M)("chart.contextMenu.addMarker")),9,nc))])])])])):e.createCommentVNode("",!0)],64))}}),ac={class:"dss-modal-title"},sc={class:"dss-modal-actions"},ea={__name:"DSSModal",props:{showModal:{type:Boolean,required:!0},backDrop:{type:Boolean,default:!0},width:{type:String,default:"800px"},height:{type:String,default:"auto"},showCloseBtn:{type:Boolean,default:!0},headerType:{type:String,default:"space-between"},titleSize:{type:String,default:"24px"}},emits:["close-modal"],setup(D,{emit:le}){const M=D,L=le,de=e.ref(null),I=e.ref(null),T=e.computed(()=>{const U={"max-width":M.width};return M.height!=="auto"&&(U.height=M.height,U["min-height"]="0"),U}),fe=e.computed(()=>({}));function dt(){L("close-modal")}function ee(){M.backDrop&&!de.value&&L("close-modal")}function f(U){U.target.tagName==="INPUT"&&(de.value=U.target.tagName)}function be(){setTimeout(()=>{de.value=null},300)}function Ce(){const U=document.body,me=document.documentElement;I.value={bodyOverflow:U.style.overflow,bodyPosition:U.style.position,bodyTop:U.style.top,bodyWidth:U.style.width,htmlOverflow:me.style.overflow,scrollY:window.scrollY},U.style.overflow="hidden",U.style.position="fixed",U.style.top=`-${I.value.scrollY}px`,U.style.width="100%",U.style.left="0",me.style.overflow="hidden"}function G(){if(!I.value)return;const U=document.body,me=document.documentElement,{bodyOverflow:R,bodyPosition:xe,bodyTop:Ae,bodyWidth:nt,htmlOverflow:ft,scrollY:Z}=I.value;U.style.overflow=R||"",U.style.position=xe||"",U.style.top=Ae||"",U.style.width=nt||"",U.style.left="",me.style.overflow=ft||"",window.scrollTo(0,Z||0)}return e.watch(()=>M.showModal,U=>{if(U)Ce(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const me=document.getElementById("dss-modal-backdrop");me&&(me.addEventListener("focusin",f),me.addEventListener("focusout",be))},100);else{G(),document.body.classList.remove("dss-modal-open");const me=document.getElementById("dss-modal-backdrop");me&&(me.removeEventListener("focusin",f),me.removeEventListener("focusout",be))}},{immediate:!0}),e.onUnmounted(()=>{M.showModal&&G()}),(U,me)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[D.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:ee},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(T.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:me[0]||(me[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":D.headerType,"font-size":D.titleSize})},[e.createElementVNode("h1",ac,[e.renderSlot(U.$slots,"title",{},()=>[me[1]||(me[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(U.$slots,"title-data"),D.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:dt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(fe.value)},[e.renderSlot(U.$slots,"content",{},()=>[me[2]||(me[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",sc,[e.renderSlot(U.$slots,"actions")])])],4),[[e.vShow,D.showModal]])])):e.createCommentVNode("",!0)]))}},rc={key:0,class:"dss-table-toolbar"},ic={class:"dss-table-toolbar-left"},cc=["aria-expanded"],uc={class:"dss-pagination-select-dropdown",role:"listbox"},dc={class:"dss-table-column-visibility-label"},mc={class:"dss-table-checkbox-wrapper"},pc=["checked","onChange"],fc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},vc={class:"dss-table-column-visibility-text"},gc={class:"dss-table-toolbar-right"},hc=["placeholder","aria-label"],yc=["aria-label"],kc=["aria-label","aria-expanded"],Cc={key:1,class:"dss-table-toolbar-extra"},bc={class:"dss-table-thead"},wc={key:0,class:"dss-table-th dss-table-selection-column"},xc={key:0,class:"dss-table-checkbox-wrapper"},Ec=["checked","indeterminate"],Sc={key:0,class:"dss-table-checkbox__indeterminate"},Vc={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Nc=["aria-label"],Bc=["onClick"],Mc={class:"dss-table-th-content"},_c={class:"dss-table-th-text"},$c={key:0},Lc={key:1},Tc={key:2},Ac=["data-filter-column-key","aria-expanded","aria-label","onClick"],Dc={class:"dss-table-tbody"},Hc=["onClick"],Rc={class:"dss-table-checkbox-wrapper"},Fc=["type","name","checked","disabled","onChange"],Ic={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},zc={key:1,class:"dss-table-checkbox__dot"},Pc=["onClick"],Oc=["aria-expanded","aria-label"],qc={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},Wc={key:0,class:"dss-table-expansion-row"},Zc=["colspan"],Uc=["colspan"],Xc={key:1,class:"dss-table-pagination"},Yc={class:"dss-table-pagination-left"},jc={key:0},Kc={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},Gc={class:"dss-table-pagination-center"},Qc={key:0,class:"dss-pagination-controls"},Jc=["disabled","title"],eu=["disabled","title"],tu=["aria-label","onKeydown"],nu={class:"dss-pagination-of"},lu=["disabled","title"],ou=["disabled","title"],au={class:"dss-table-pagination-right"},su={class:"dss-pagination-rows-label"},ru=["aria-expanded"],iu=["aria-selected","onClick"],cu={key:0,class:"dss-table-filter-row"},uu=["value","placeholder"],du=["min","max","value"],mu=["min","max","value"],pu={class:"dss-table-filter-double-range-values"},fu={key:2,class:"dss-table-filter-daterange"},vu={class:"dss-table-filter-daterange-row"},gu={class:"dss-table-filter-daterange-label"},hu=["value"],yu={class:"dss-table-filter-daterange-row"},ku={class:"dss-table-filter-daterange-label"},Cu=["value"],bu=["value","placeholder"],wu={class:"dss-table-filter-list"},xu=["checked","onChange"],Eu={class:"dss-table-filter-actions"},Su={name:"DSSTable"},Vu=Object.assign(Su,{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:D=>typeof D=="object"&&D!==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(D,{emit:le}){const{t:M,locale:L}=eo.useI18n(),de=D,I=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 fe(y,h){const x=Object.assign({},y);return dt(y)&&dt(h)&&Object.keys(h).forEach(q=>{dt(h[q])?q in y?x[q]=fe(y[q],h[q]):Object.assign(x,{[q]:h[q]}):Object.assign(x,{[q]:h[q]})}),x}function dt(y){return y&&typeof y=="object"&&!Array.isArray(y)}const ee=e.computed(()=>fe(T,de.options)),f=e.computed(()=>{const y=ee.value.table.width;return y==="auto"?null:typeof y=="number"?y:null}),be=e.computed(()=>ee.value.table.height),Ce=e.computed(()=>ee.value.table.rowHeight??"auto"),G=e.computed(()=>({height:Ce.value})),U=e.computed(()=>ee.value.table.expandable===!0),me=e.computed(()=>ee.value.table.expandableRowData??null),R=e.computed(()=>ee.value.table.expandableRowCondition??null),xe=e.computed(()=>ee.value.table.truncated===!0),Ae=e.computed(()=>ee.value.table.striped),nt=e.computed(()=>ee.value.table.bordered),ft=e.computed(()=>ee.value.table.hoverable),Z=e.computed(()=>ee.value.table.size),Ue=e.computed(()=>ee.value.table.align||"left");e.computed(()=>ee.value.title.text),e.computed(()=>ee.value.subtitle.text);const qe=e.computed(()=>ee.value.selection.enabled),Ee=e.computed(()=>ee.value.selection.mode),Me=e.computed(()=>ee.value.selection.rowCondition??null),je=e.computed(()=>ee.value.sorting.enabled),Q=e.computed(()=>ee.value.sorting.mode),ze=e.computed(()=>ee.value.pagination.enabled),we=e.computed(()=>ee.value.pagination.rows),it=e.computed(()=>ee.value.pagination.rowsPerPageOptions),ot=e.computed(()=>ee.value.pagination.showCounter!==!1),bt=e.computed(()=>ee.value.pagination.showControlsGroup),It=e.computed(()=>bt.value===!1?!1:ee.value.pagination.showControls!==!1),en=e.computed(()=>bt.value===!1?!1:ee.value.pagination.showRowsPerPage!==!1),Pt=e.computed(()=>ze.value&&(ot.value||It.value||en.value)),oe=e.computed(()=>ee.value.scrollable),ve=e.computed(()=>ee.value.emptyMessage||M("table.emptyMessage")),Fe=e.computed(()=>ee.value.toolbar?.downloads?.pdf!==!1),De=e.computed(()=>ee.value.toolbar?.downloads?.excel!==!1),Zt=e.computed(()=>ee.value.toolbar?.search!==!1),yt=e.computed(()=>Fe.value||De.value||Zt.value||Ut.value),Ut=e.computed(()=>ee.value.toolbar?.columnVisibility!==!1),xt=e.ref(""),Ot=e.ref(!1),J=e.ref(null);let he=null;function Be(){Ot.value?(he&&(clearTimeout(he),he=null),Ot.value=!1,xt.value="",I("search",""),J.value?.blur()):(Ot.value=!0,he=setTimeout(()=>{he=null,J.value?.focus()},80))}function Xe(){xt.value||(Ot.value=!1)}function Ke(){xt.value="",I("search",""),J.value?.focus()}const Lt=e.computed(()=>({"dss-table-striped":Ae.value,"dss-table-bordered":nt.value,"dss-table-hoverable":ft.value,[`dss-table-${Z.value}`]:Z.value!=="default","dss-table-truncated":xe.value})),Ge=(y,h)=>y?.field??y?.key??h,Dt=e.ref(new Set);function He(){const y=new Set;return de.columns.forEach((h,x)=>{h?.hidden!==!0&&y.add(Ge(h,x))}),y}function Pe(){const y=new Set;return de.columns.forEach((h,x)=>{y.add(Ge(h,x))}),y}function Et(y){if(!Array.isArray(y))return null;const h=Pe(),x=[];return y.forEach(q=>{h.has(q)&&x.push(q)}),x}function St(){Dt.value=He()}const K=e.computed(()=>{const y=Et(de.columnVisibility);return y===null?null:new Set(y)}),W=e.computed(()=>K.value??Dt.value),X=e.computed(()=>de.columns.filter((y,h)=>W.value.has(Ge(y,h)))),pe=y=>{const h=de.columns.findIndex(x=>x===y);return Ge(y,h>=0?h:0)},ye=(y,h)=>W.value.has(Ge(y,h));function Je(y){I("update:columnVisibility",Array.from(y))}function Tt(y,h){const x=Ge(y,h),q=new Set(W.value);q.has(x)?q.delete(x):q.add(x),K.value===null&&(Dt.value=q),Je(q)}const mn=e.ref(null),vt=e.ref(!1);function Gt(y){mn.value&&!mn.value.contains(y.target)&&(vt.value=!1)}const S=e.computed(()=>X.value.length+(qe.value?1:0)+(U.value?1:0)),b=(y,h)=>y?.id??y?.key??h,V=e.ref(new Set),Y=e.ref(null),ne=(y,h)=>V.value.has(b(y,h)),Oe=(y,h)=>{if(!U.value)return!1;if(typeof R.value=="function")return!!R.value(y,h);if(typeof me.value=="string"&&me.value.trim()){const x=$t(y,me.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},mt=(y,h,x)=>{if(x&&x.stopPropagation(),!Oe(y,h))return;const q=b(y,h),re=new Set(V.value);re.has(q)?(re.delete(q),I("row-collapse",{data:y,index:h})):(re.add(q),I("row-expand",{data:y,index:h})),V.value=re},ct=(y,h)=>{if(!xe.value)return;const x=b(y,h);Y.value!==x&&(Y.value=x)},We=e.ref(null),Vt=e.ref(0),Nt=e.ref([]),wt=y=>{if(Q.value==="single")return We.value===y.field?Vt.value:0;{const h=Nt.value.find(x=>x.field===y.field);return h?h.order:0}},Ct=y=>{const h=wt(y);return{"dss-sort-active":h!==0,"dss-sort-asc":h===1,"dss-sort-desc":h===-1}},At=e.ref({}),Bt=e.ref(null),bn=e.ref(null),Tn=220,ol=e.ref(null),qt=e.computed(()=>X.value.find(y=>pe(y)===Bt.value)??null),ln=e.computed(()=>{if(!qt.value||qt.value.filter!=="range")return null;const y=qt.value,h=Bt.value,{min:x,max:q}=An(y),re=y.filterMin??x,pt=y.filterMax??q,Ht=Nn(h),_n=Ht.min??re,Dn=Ht.max??pt,Wn=pt-re,kl=Wn===0?0:(_n-re)/Wn*100,ro=Wn===0?100:(Dn-re)/Wn*100;return{rangeMin:re,rangeMax:pt,currentMin:_n,currentMax:Dn,minPct:kl,maxPct:ro}}),On=e.ref(null),qn=e.ref("max");function Rn(y){const h=On.value,x=ln.value;if(!h||!x)return;const q=h.getBoundingClientRect(),pt=(y.clientX-q.left)/q.width*100,Ht=(x.minPct+x.maxPct)/2;qn.value=pt<Ht?"min":"max"}function Nn(y){return At.value[y]??{}}function A(y,h){At.value={...At.value,[y]:h}}function O(y){const h=At.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 P(y){const h={...At.value};delete h[y],At.value=h,Bt.value=null,bn.value=null}function ie(){if(!Bt.value){bn.value=null;return}const y=ol.value;if(!y)return;const h=y.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Bt.value}"]`);if(!h)return;const x=h.getBoundingClientRect();bn.value={top:x.bottom+6,left:Math.max(8,x.right-Tn)}}const Te=e.computed(()=>{const y=String(xt.value??"").trim().toLowerCase();return y?de.data.filter(h=>X.value.some(x=>rt(vl(h,x)).some(re=>String(re).toLowerCase().includes(y)))):de.data}),et=e.computed(()=>{let y=[...Te.value];const h=(xt.value??"").trim().toLowerCase();return h&&(y=y.filter(x=>de.columns.some(q=>{if(!q||!q.field)return!1;const re=vl(x,q);return String(re??"").toLowerCase().includes(h)}))),X.value.forEach(x=>{const q=pe(x),re=At.value[q];if(!re)return;const pt=x.field;if(pt){if(re.type==="string"&&re.value?.trim()){const Ht=re.value.trim().toLowerCase();y=y.filter(_n=>{const Dn=vl(_n,x);return String(Dn??"").toLowerCase().includes(Ht)})}else if(re.type==="range")y=y.filter(Ht=>{const _n=$t(Ht,pt),Dn=Number(_n);return!(Number.isNaN(Dn)||re.min!=null&&Dn<re.min||re.max!=null&&Dn>re.max)});else if(re.type==="dateRange"){const Ht=re.from?new Date(re.from).getTime():null,_n=re.to?new Date(re.to).getTime():null;y=y.filter(Dn=>{const Wn=$t(Dn,pt),kl=Wn?new Date(Wn).getTime():NaN;return!(Number.isNaN(kl)||Ht!=null&&kl<Ht||_n!=null&&kl>_n)})}else if(re.type==="list"&&re.selected?.length){const Ht=new Set(re.selected);y=y.filter(_n=>rt(vl(_n,x)).some(Wn=>Ht.has(Wn)))}}}),y});function rt(y){if(y==null)return[""];if(Array.isArray(y))return y.flatMap(rt);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 tt(y){const h=new Set;return de.data.forEach(x=>{rt(vl(x,y)).forEach(re=>h.add(re))}),Array.from(h).sort((x,q)=>String(x).localeCompare(String(q)))}function Mt(y,h){if(Bt.value===y){Bt.value=null,bn.value=null;return}if(Bt.value=y,h?.currentTarget){const x=h.currentTarget.getBoundingClientRect();bn.value={top:x.bottom+6,left:Math.max(8,x.right-Tn)}}else ie()}function on(y,h){A(y,{type:"string",value:h})}function An(y){const h=y.field;if(!h)return{min:0,max:100};let x=1/0,q=-1/0;return de.data.forEach(re=>{const pt=$t(re,h),Ht=Number(pt);Number.isNaN(Ht)||(x=Math.min(x,Ht),q=Math.max(q,Ht))}),{min:x===1/0?0:x,max:q===-1/0?100:q}}function Fn(y,h,x){const q={...Nn(y),type:"range"},re=x===""?null:Number(x),pt=re===null||Number.isNaN(re)?null:re;q[h]=pt,pt!=null&&(h==="min"&&q.max!=null&&pt>q.max&&(q.max=pt),h==="max"&&q.min!=null&&pt<q.min&&(q.min=pt)),A(y,q)}function Qn(y,h,x){const q={...Nn(y),type:"dateRange"};q[h]=x||"",A(y,q)}const En=e.reactive({});function oo(y,h){En[y]=h}function ql(y){const h=pe(y),x=(En[h]??"").trim().toLowerCase(),q=tt(y);return x?q.filter(re=>String(re).toLowerCase().includes(x)):q}function Al(y,h){return(Nn(y).selected??[]).includes(h!=null?String(h):"")}function Wl(y,h){const q=[...Nn(y).selected??[]],re=h!=null?String(h):"",pt=q.indexOf(re);pt>=0?q.splice(pt,1):q.push(re),A(y,{type:"list",selected:q})}function ml(y){Bt.value&&!y.target.closest(".dss-table-filter-wrap")&&!y.target.closest(".dss-table-filter-dropdown")&&(Bt.value=null,bn.value=null)}function Vl(){ie(),an.value&&st()}const ao=y=>{if(!(y.sortable===!1||!je.value))if(Q.value==="single")We.value===y.field?Vt.value=Vt.value===1?-1:Vt.value===-1?0:1:(We.value=y.field,Vt.value=1),Vt.value===0&&(We.value=null),I("sort",{field:We.value,order:Vt.value});else{const h=Nt.value.findIndex(x=>x.field===y.field);h>=0?Nt.value[h].order===1?Nt.value[h].order=-1:Nt.value.splice(h,1):Nt.value.push({field:y.field,order:1}),I("sort",{multiSortMeta:Nt.value})}},Jn=e.computed(()=>{if(!je.value)return et.value;let y=[...et.value];return Q.value==="single"&&We.value&&Vt.value!==0?y.sort((h,x)=>{const q=$t(h,We.value),re=$t(x,We.value);return q===re?0:q==null?1:re==null?-1:(q<re?-1:q>re?1:0)*Vt.value}):Q.value==="multiple"&&Nt.value.length>0&&y.sort((h,x)=>{for(const q of Nt.value){const re=$t(h,q.field),pt=$t(x,q.field);if(re===pt)continue;if(re==null)return 1;if(pt==null)return-1;const Ht=re<pt?-1:re>pt?1:0;if(Ht!==0)return Ht*q.order}return 0}),y}),yn=e.ref(0),Qt=e.ref(we.value),an=e.ref(!1),al=e.ref(null),at=e.ref(null),ce=e.ref("bottom"),pl=e.ref(null),ht=y=>{Qt.value=y,an.value=!1,yn.value=0,I("page",{page:0,rows:Qt.value})};function pn(y){al.value&&!al.value.contains(y.target)&&(an.value=!1)}function st(){const y=al.value,h=at.value;if(!y||!h)return;const x=y.querySelector(".dss-pagination-select-dropdown");if(!x)return;const q=h.getBoundingClientRect(),re=x.offsetHeight||0,Ht=(window.innerHeight||document.documentElement.clientHeight)-q.bottom,_n=q.top;ce.value=Ht<re+8&&_n>Ht?"top":"bottom",pl.value={width:`${Math.ceil(q.width)}px`,left:`${Math.max(0,Math.round(h.offsetLeft))}px`}}const gt=e.computed(()=>Jn.value.length),ae=e.computed(()=>Math.ceil(gt.value/Qt.value)),Yt=e.computed(()=>Math.max(ae.value,1)),$e=e.computed(()=>gt.value===0?0:sn.value+1),so=e.computed(()=>Bn.value),sn=e.computed(()=>ze.value?yn.value*Qt.value:0),Bn=e.computed(()=>ze.value?Math.min((yn.value+1)*Qt.value,gt.value):gt.value),tn=e.computed(()=>{if(!ze.value)return Jn.value;const y=sn.value,h=Bn.value;return Jn.value.slice(y,h)}),In=e.ref(new Set),cn=e.computed(()=>Jn.value.filter((y,h)=>In.value.has(b(y,h)))),zn=(y,h)=>{const x=Me.value;return typeof x!="function"?!0:!!x(y,h)},Dl=e.computed(()=>Jn.value.map((y,h)=>({row:y,index:h})).filter(({row:y,index:h})=>zn(y,h))),Nl=e.computed(()=>{const y=Dl.value;return y.length===0?!1:y.every(({row:h,index:x})=>In.value.has(b(h,x)))}),Zn=e.computed(()=>{const y=Dl.value;if(y.length===0)return!1;const h=y.filter(({row:x,index:q})=>In.value.has(b(x,q))).length;return h>0&&h<y.length}),fn=(y,h)=>In.value.has(b(y,h)),Zl=()=>{if(Nl.value)In.value=new Set,I("unselect-all");else{const y=new Set;Dl.value.forEach(({row:h,index:x})=>y.add(b(h,x))),In.value=y,I("select-all",cn.value)}},Ul=(y,h)=>{if(!zn(y,h))return;const x=b(y,h),q=new Set(In.value),re=q.has(x);Ee.value==="single"?re?(q.delete(x),I("row-unselect",y)):(q.clear(),q.add(x),I("row-select",y)):re?(q.delete(x),I("row-unselect",y)):(q.add(x),I("row-select",y)),In.value=q},sl=e.ref("1"),Hl=()=>{const y=Number.parseInt(String(sl.value),10);if(!Number.isFinite(y)){sl.value=String(yn.value+1);return}const h=Math.min(Yt.value,Math.max(1,y));h!==yn.value+1?fl(h-1):sl.value=String(h)},fl=y=>{y<0||y>=ae.value||(yn.value=y,I("page",{page:y,rows:Qt.value}))},Mn=(y,h,x)=>{I("row-click",{data:y,index:h,originalEvent:x}),ct(y,sn.value+h)},Rl=(y,h)=>{const x=sn.value+h;return{"dss-table-row-selected":fn(y,x),"dss-table-row-even":h%2===0,"dss-table-row-odd":h%2!==0,"dss-table-row-truncated-clickable":xe.value,"dss-table-row-truncated-expanded":Y.value===b(y,x)}},vl=(y,h)=>h.field?$t(y,h.field):"",$t=(y,h)=>h.split(".").reduce((x,q)=>x&&x[q],y),Un=y=>{const h=y.align??Ue.value;return{"dss-table-sortable":y.sortable!==!1&&je.value,"dss-table-align-left":h==="left","dss-table-align-center":h==="center","dss-table-align-right":h==="right",[y.className]:y.className}},rl=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(()=>de.locale,y=>{y&&y!==L.value&&(L.value=y)},{immediate:!0}),e.watch(we,y=>{Qt.value=y,yn.value=0}),e.watch(an,async y=>{y&&(await e.nextTick(),st())}),e.watch(yn,y=>{sl.value=String(y+1)},{immediate:!0}),e.watch(xt,y=>{I("search",y??"")}),e.watch(()=>de.columns,()=>{if(K.value===null){St();return}const y=Et(de.columnVisibility)??[];y.length!==de.columnVisibility.length&&I("update:columnVisibility",y)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",pn),document.addEventListener("click",Gt),document.addEventListener("click",ml),window.addEventListener("resize",Vl),window.addEventListener("scroll",Vl,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",pn),document.removeEventListener("click",Gt),document.removeEventListener("click",ml),window.removeEventListener("resize",Vl),window.removeEventListener("scroll",Vl,!0)}),(y,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:ol,style:e.normalizeStyle({width:f.value+"px",height:be.value?be.value+"px":"auto"})},[yt.value?(e.openBlock(),e.createElementBlock("div",rc,[e.createElementVNode("div",ic,[Fe.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:h[0]||(h[0]=x=>I("download-pdf"))},[h[22]||(h[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(M)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),De.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:h[1]||(h[1]=x=>I("download-excel"))},[h[23]||(h[23]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(M)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Ut.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:mn},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":vt.value}]),onClick:h[2]||(h[2]=x=>vt.value=!vt.value),"aria-expanded":vt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(M)("table.columnVisibility"))+" ",1),h[24]||(h[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,cc),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",uc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.columns,(x,q)=>(e.openBlock(),e.createElementBlock("li",{key:Ge(x,q),role:"option",class:"dss-table-column-visibility-option",onClick:h[3]||(h[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",dc,[e.createElementVNode("span",mc,[e.createElementVNode("input",{type:"checkbox",checked:ye(x,q),onChange:re=>Tt(x,q),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,pc),ye(x,q)?(e.openBlock(),e.createElementBlock("span",fc,[...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",vc,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,vt.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",gc,[Zt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Ot.value||xt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:J,"onUpdate:modelValue":h[4]||(h[4]=x=>xt.value=x),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(M)("table.searchPlaceholder"),"aria-label":e.unref(M)("table.searchTableAriaLabel"),onFocus:h[5]||(h[5]=x=>Ot.value=!0),onBlur:Xe},null,40,hc),[[e.vModelText,xt.value]]),xt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(M)("table.clearSearchAriaLabel"),onClick:Ke},[...h[26]||(h[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,yc)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(M)("table.searchAriaLabel"),"aria-expanded":Ot.value||!!xt.value,onMousedown:e.withModifiers(Be,["prevent"])},[...h[27]||(h[27]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,kc)],2)):e.createCommentVNode("",!0),y.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Cc,[e.renderSlot(y.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":oe.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Lt.value])},[e.createElementVNode("thead",bc,[e.createElementVNode("tr",null,[qe.value?(e.openBlock(),e.createElementBlock("th",wc,[Ee.value==="multiple"?(e.openBlock(),e.createElementBlock("span",xc,[e.createElementVNode("input",{type:"checkbox",checked:Nl.value,indeterminate:Zn.value,onChange:Zl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ec),Zn.value?(e.openBlock(),e.createElementBlock("span",Sc)):Nl.value?(e.openBlock(),e.createElementBlock("span",Vc,[...h[28]||(h[28]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),U.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(M)("table.expandRowAriaLabel")},null,8,Nc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,(x,q)=>(e.openBlock(),e.createElementBlock("th",{key:pe(x),class:e.normalizeClass(["dss-table-th",Un(x)]),style:e.normalizeStyle(rl(x)),onClick:re=>ao(x)},[e.createElementVNode("div",Mc,[e.createElementVNode("span",_c,e.toDisplayString(x.header),1),x.sortable!==!1&&je.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Ct(x)])},[wt(x)===0?(e.openBlock(),e.createElementBlock("span",$c,[...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)])])):wt(x)===1?(e.openBlock(),e.createElementBlock("span",Lc,[...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)])])):wt(x)===-1?(e.openBlock(),e.createElementBlock("span",Tc,[...h[31]||(h[31]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),x.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Bt.value===pe(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":O(pe(x))}]),"data-filter-column-key":pe(x),"aria-expanded":Bt.value===pe(x),"aria-label":e.unref(M)("table.filterColumnAriaLabel"),onClick:re=>Mt(pe(x),re)},[...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,Ac)],2)):e.createCommentVNode("",!0)])],14,Bc))),128))])]),e.createElementVNode("tbody",Dc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn.value,(x,q)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:b(x,sn.value+q)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Rl(x,q)]),style:e.normalizeStyle(G.value),onClick:re=>Mn(x,q,re)},[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",Rc,[e.createElementVNode("input",{type:Ee.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${D.tableId}`,checked:fn(x,sn.value+q),disabled:!zn(x,sn.value+q),onChange:re=>Ul(x,sn.value+q),class:e.normalizeClass(["dss-table-checkbox",Ee.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!zn(x,sn.value+q)}])},null,42,Fc),Ee.value==="multiple"&&fn(x,sn.value+q)?(e.openBlock(),e.createElementBlock("span",Ic,[...h[33]||(h[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):Ee.value==="single"&&fn(x,sn.value+q)?(e.openBlock(),e.createElementBlock("span",zc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),U.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(re=>mt(x,sn.value+q,re),["stop"])},[Oe(x,sn.value+q)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":ne(x,sn.value+q),"aria-label":ne(x,sn.value+q)?e.unref(M)("table.collapseRowAriaLabel"):e.unref(M)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":ne(x,sn.value+q)}]),"aria-hidden":"true"},[...h[34]||(h[34]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,Oc)):(e.openBlock(),e.createElementBlock("span",qc))],8,Pc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,(re,pt)=>(e.openBlock(),e.createElementBlock("td",{key:pe(re),class:e.normalizeClass(["dss-table-td",Un(re)]),style:e.normalizeStyle(rl(re))},[e.renderSlot(y.$slots,`cell-${re.field}`,{data:x,column:re,rowIndex:q,isExpanded:Y.value===b(x,sn.value+q)},()=>[e.createTextVNode(e.toDisplayString(vl(x,re)),1)])],6))),128))],14,Hc),U.value&&Oe(x,sn.value+q)&&ne(x,sn.value+q)?(e.openBlock(),e.createElementBlock("tr",Wc,[e.createElementVNode("td",{colspan:S.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(y.$slots,"expansion",{data:x,rowIndex:q})],8,Zc)])):e.createCommentVNode("",!0)],64))),128)),tn.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(G.value)},[e.createElementVNode("td",{colspan:S.value,class:"dss-table-empty-cell"},[e.renderSlot(y.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(ve.value),1)])],8,Uc)],4))])],2)],2),Pt.value?(e.openBlock(),e.createElementBlock("div",Xc,[e.createElementVNode("div",Yc,[ot.value?(e.openBlock(),e.createElementBlock("span",jc,e.toDisplayString(e.unref(M)("table.showingRange",{start:$e.value,end:so.value,total:gt.value})),1)):(e.openBlock(),e.createElementBlock("span",Kc," "))]),e.createElementVNode("div",Gc,[It.value?(e.openBlock(),e.createElementBlock("div",Qc,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:yn.value===0,onClick:h[8]||(h[8]=x=>fl(0)),title:e.unref(M)("table.firstPage")},[...h[35]||(h[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Jc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:yn.value===0,onClick:h[9]||(h[9]=x=>fl(yn.value-1)),title:e.unref(M)("table.previousPage")}," ‹ ",8,eu),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[10]||(h[10]=x=>sl.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(M)("table.currentPageAriaLabel"),onBlur:Hl,onKeydown:e.withKeys(e.withModifiers(Hl,["prevent"]),["enter"])},null,40,tu),[[e.vModelText,sl.value]]),e.createElementVNode("span",nu,e.toDisplayString(e.unref(M)("table.ofPages",{total:Yt.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:yn.value>=ae.value-1,onClick:h[11]||(h[11]=x=>fl(yn.value+1)),title:e.unref(M)("table.nextPage")}," › ",8,lu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:yn.value>=ae.value-1,onClick:h[12]||(h[12]=x=>fl(ae.value-1)),title:e.unref(M)("table.lastPage")},[...h[36]||(h[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,ou)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",au,[en.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:al},[e.createElementVNode("span",su,e.toDisplayString(e.unref(M)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":an.value}]),onClick:h[13]||(h[13]=x=>an.value=!an.value),"aria-expanded":an.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:at},[e.createTextVNode(e.toDisplayString(Qt.value)+" ",1),h[37]||(h[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,ru),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":ce.value==="top"}]),style:e.normalizeStyle(pl.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(it.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===Qt.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===Qt.value}]),onClick:q=>ht(x)},e.toDisplayString(x),11,iu))),128))],6),[[e.vShow,an.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(bn.value?{top:bn.value.top+"px",left:bn.value.left+"px",width:Tn+"px"}:void 0),onClick:h[21]||(h[21]=e.withModifiers(()=>{},["stop"]))},[qt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[qt.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",cu,[e.createElementVNode("input",{type:"text",value:Nn(Bt.value).value??"",onInput:h[14]||(h[14]=x=>on(Bt.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(M)("table.search")},null,40,uu)])):qt.value.filter==="range"&&ln.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":ln.value.minPct+"%","--range-max-pct":ln.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:On,class:"dss-table-filter-double-range-track",onMousemove:Rn,onMouseenter:Rn},[e.createElementVNode("input",{type:"range",min:ln.value.rangeMin,max:ln.value.rangeMax,value:ln.value.currentMin,onInput:h[15]||(h[15]=x=>Fn(Bt.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:qn.value==="min"?2:1})},null,44,du),e.createElementVNode("input",{type:"range",min:ln.value.rangeMin,max:ln.value.rangeMax,value:ln.value.currentMax,onInput:h[16]||(h[16]=x=>Fn(Bt.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:qn.value==="max"?2:1})},null,44,mu)],544),e.createElementVNode("div",pu,e.toDisplayString(ln.value.currentMin)+" – "+e.toDisplayString(ln.value.currentMax),1)],4)):qt.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",fu,[e.createElementVNode("div",vu,[e.createElementVNode("label",gu,e.toDisplayString(e.unref(M)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:Nn(Bt.value).from??"",onInput:h[17]||(h[17]=x=>Qn(Bt.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,hu)]),e.createElementVNode("div",yu,[e.createElementVNode("label",ku,e.toDisplayString(e.unref(M)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:Nn(Bt.value).to??"",onInput:h[18]||(h[18]=x=>Qn(Bt.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Cu)])])):qt.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:En[Bt.value]??"",onInput:h[19]||(h[19]=x=>oo(Bt.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(M)("table.search")},null,40,bu),e.createElementVNode("div",wu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ql(qt.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:Al(Bt.value,x),onChange:q=>Wl(Bt.value,x)},null,40,xu),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Eu,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:h[20]||(h[20]=x=>P(Bt.value))},e.toDisplayString(e.unref(M)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Bt.value&&qt.value&&bn.value]])]),_:1})]))],64))}}),Nu="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",Bu="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",Mu="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",_u="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",$u="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",Lu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='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",Tu={class:"dss-toolbar-left"},Au=["title"],Du=["title"],Hu={class:"dss-toolbar-dropdown-wrapper"},Ru=["title"],Fu=["src"],Iu=["src"],zu=["src"],Pu=["src"],Ou=["src"],qu=["src"],Wu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Zu=["src"],Uu=["src"],Xu=["src"],Yu=["src"],ju=["src"],Ku=["src"],Gu=["title"],Qu=["title"],Ju=["title"],ed=["title"],td=["title"],nd=["title"],ld=["title"],od=["title"],ad=["title"],sd={key:2,class:"dss-toolbar-separator"},rd=["title"],id={key:4,class:"dss-toolbar-separator"},cd={key:5,class:"dss-toolbar-dropdown-wrapper"},ud=["title"],dd={class:"dss-toolbar-dropdown-ai"},md={class:"dss-toolbar-right"},pd={key:0,class:"dss-toolbar-custom-group"},fd={key:1,class:"dss-toolbar-separator"},vd={class:"dss-link-modal-content"},gd={class:"dss-link-modal-field"},hd={class:"dss-link-modal-label"},yd=["placeholder"],kd={class:"dss-link-modal-field"},Cd={class:"dss-link-modal-label"},bd=["placeholder"],wd={class:"dss-image-modal-tabs"},xd={key:0,class:"dss-image-tab-content"},Ed={class:"dss-link-modal-content"},Sd={class:"dss-link-modal-field"},Vd={key:0,class:"dss-link-modal-label"},Nd=["src"],Bd={class:"dss-link-modal-field"},Md={class:"dss-link-modal-label"},_d=["placeholder"],$d={class:"dss-link-modal-field"},Ld={class:"dss-link-modal-label"},Td=["placeholder"],Ad={class:"dss-link-modal-field"},Dd={class:"dss-link-modal-label"},Hd=["placeholder"],Rd={key:1,class:"dss-image-tab-content"},Fd={class:"dss-link-modal-content"},Id={class:"dss-link-modal-field"},zd={class:"dss-link-modal-label"},Pd=["placeholder"],Od={class:"dss-link-modal-field"},qd={class:"dss-link-modal-label"},Wd=["placeholder"],Zd={class:"dss-link-modal-field"},Ud={class:"dss-link-modal-label"},Xd=["placeholder"],Yd={class:"dss-link-modal-field"},jd={class:"dss-link-modal-label"},Kd=["placeholder"],Gd={class:"dss-text-editor-title-input-container"},Qd={key:0,class:"dss-text-editor-title-preview"},Jd={key:0},e1={key:1,class:"dss-text-editor-preview-placeholder"},t1=["value","placeholder","disabled"],n1={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},l1={class:"dss-text-editor-description-input-container"},o1={key:0,class:"dss-text-editor-description-preview"},a1={key:0},s1={key:1,class:"dss-text-editor-preview-placeholder"},r1=["value","placeholder","disabled"],i1={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},c1=["data-comment-id","onMouseenter"],u1=["onClick"],d1=["src","alt"],m1={key:1},p1=["onClick"],f1=["src","alt"],v1={key:1},g1=["data-has-second-user","onClick"],h1={class:"editor-comment-marker-count"},y1={key:4,class:"dss-text-editor-textarea-wrapper"},k1=["value","placeholder","rows","disabled"],C1={class:"dss-text-editor-footer"},b1={class:"dss-text-editor-footer-content"},w1={class:"dss-text-editor-footer-stat"},x1={class:"dss-text-editor-footer-stat"},E1={key:5,class:"dss-text-editor-content-wrapper"},S1={key:0,class:"dss-comment-overlay-body"},V1={class:"dss-comment-selection-wrapper"},N1=["innerHTML"],B1={class:"dss-comment-messages-wrapper"},M1={key:0,class:"dss-comment-avatar-wrapper"},_1={class:"dss-comment-avatar"},$1=["src","alt"],L1={key:1},T1={class:"dss-comment-header"},A1={class:"dss-comment-header-text"},D1={class:"dss-comment-author"},H1={key:0,class:"dss-comment-date"},R1=["onClick","title"],F1={class:"dss-comment-overlay-inner"},I1=["placeholder","onKeydown"],z1={class:"dss-text-editor-footer"},P1={class:"dss-text-editor-footer-content"},O1={class:"dss-text-editor-footer-stat"},q1={class:"dss-text-editor-footer-stat"},W1=["title"],Z1=["title"],U1={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:""},X1={class:"dss-image-popup-content"},Y1={key:0,class:"dss-image-popup-no-alt-icon"},j1=["title"],K1=["title"],G1={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},Q1={class:"dss-toolbar-left"},J1=["title"],em=["title"],tm={class:"dss-toolbar-dropdown-wrapper"},nm=["title"],lm=["src"],om=["src"],am=["src"],sm=["src"],rm=["src"],im=["src"],cm={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},um=["title"],dm=["title"],mm=["title"],pm=["title"],fm=["title"],vm=["title"],gm=["title"],hm=["title"],ym=["title"],km=["title"],Cm={key:2,class:"dss-toolbar-separator"},bm={key:3,class:"dss-toolbar-dropdown-wrapper"},wm=["title"],xm={class:"dss-toolbar-dropdown-ai"},Em={key:0,class:"dss-toolbar-right"},Sm={key:0,class:"dss-toolbar-separator"},Vm={key:0,class:"dss-toolbar-custom-group"},Nm={key:1,class:"dss-toolbar-separator"},Bm={name:"DSSTextEditor"},Mm=Object.assign(Bm,{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:D=>typeof D=="object"&&D!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:D=>typeof D=="object"&&D!==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(D,{expose:le,emit:M}){const{t:L,locale:de}=eo.useI18n(),I={h1:Nu,h2:Bu,h3:Mu,h4:_u,h5:$u,h6:Lu},T=D,fe=M,dt=e.useSlots(),ee=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
99
99
  <path d="M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z" fill="#c13340"/>
100
- </svg>`,f=e.ref(null),be=e.ref(null),Ce=e.ref(!1),Q=e.ref(!1),U=e.ref(!1),me=e.ref(""),H=e.ref({}),xe=e.ref(!1),He=e.ref(!1),et=e.ref(""),vt=e.ref(""),q=e.ref(null),Ue=e.ref(null),Pe=e.ref(null),Ee=e.ref(null),Me=e.ref(""),Ke=e.ref(!1),K=e.ref({}),ze=e.ref(!1),we=e.ref({}),st=e.ref(null),lt=e.ref(null),xt=e.ref(!1),It=e.ref(""),tn=e.ref(null),Ot=e.ref(""),oe=e.ref(""),fe=e.ref(""),Fe=e.ref(null),De=e.ref(null),Zt=e.ref(null),kt=e.ref(null),Ut=e.ref(null),St=e.ref(!1),Wt=e.ref(""),G=e.ref({}),he=e.ref(!1),Be=e.ref("upload"),Xe=e.ref(""),Ge=e.ref(null),Tt=e.ref(null),Qe=e.ref([]),zt=e.ref([]),Ze=e.ref(null),$e=e.ref(!1),rt=e.ref(""),Vt=e.ref(""),ee=e.ref(""),Z=e.ref(""),X=e.ref(""),pe=e.ref(""),ke=e.ref(null),Ye=e.ref(null),Nt=e.ref(null),on=e.ref(!1),Ct=e.ref(null),Gt=e.ref(!1),S=e.ref(!1),b=e.ref(null),V=e.ref("p"),Y=e.ref(!1),ae=e.ref([]),We=e.ref(null),ht=e.ref(null),it=e.ref(null),qe=e.ref(!1),Bt=e.ref(0),Mt=100,Et=e.ref(null),wt=e.computed(()=>({"dss-text-editor-no-border":!A.border,"dss-text-editor-rounded":A.rounded,"dss-text-editor-full-height":A.fullHeight,"dss-comment-overlay-open":Lt.value!==null})),At=e.computed(()=>({})),_t=e.computed(()=>!A.fixedHeight||A.fullHeight?{}:{height:`${1.6*14*A.rows+24+2}px`,resize:"none",overflowY:"auto"}),bn=e.computed(()=>!A.fixedHeight||A.fullHeight?{}:{height:`${1.6*14*A.rows+32}px`,overflowY:"auto"}),En=e.computed(()=>A.richText&&zt.value.length>0),An=e.computed(()=>{if(!A.modelValue)return"";if(A.richText){let o=A.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/&nbsp;/g," "),o=o.replace(/&amp;/g,"&"),o=o.replace(/&lt;/g,"<"),o=o.replace(/&gt;/g,">"),o=o.replace(/&quot;/g,'"'),o=o.replace(/&#39;/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return A.modelValue}),Dt=e.computed(()=>{const o=An.value.trim();return o?o.split(/\s+/).filter(l=>l.length>0).length:0}),Qt=e.computed(()=>An.value.length),tl=e.computed(()=>kt.value!==null&&Be.value==="upload"&&Ot.value&&Ot.value.startsWith("data:")),R=e.computed(()=>A.titlePlaceholder||L("textEditor.placeholders.title")),O=e.computed(()=>A.descriptionPlaceholder||L("textEditor.placeholders.description")),F=e.computed(()=>A.placeholder||L("textEditor.placeholders.startTyping")),ne=o=>pt&&pt[o]!==void 0,Le=o=>{for(let l=o+1;l<A.customToolbarSlots.length;l++)if(ne(A.customToolbarSlots[l]))return!0;return!1},dt=o=>{for(let l=o+1;l<A.customToolbarSlots.length;l++){const s=A.customToolbarSlots[l];if(ne(s)&&ct(s))return!0}return!1},ct=o=>A.customToolbarFloatingMap.hasOwnProperty(o)?A.customToolbarFloatingMap[o]===!0:!0,tt=e.computed(()=>A.customToolbarSlots.some(o=>ne(o)&&ct(o))),mt=e.computed(()=>ne("title-slot")),an=e.computed(()=>ne("description-slot")),Dn=o=>{if(!o||o.trim()==="")return"<html></html>";const l=o.trim();return l.startsWith("<html>")&&l.endsWith("</html>")?o:`<html>${o}</html>`},Hn=o=>{if(!o||o.trim()==="")return"";const l=o.replace(/<!--[\s\S]*?-->/g,""),s=l.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():l},On=o=>{if(!o)return;const l=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),s=[];let r=l.nextNode();for(;r;)s.push(r),r=l.nextNode();s.forEach(c=>c.remove())},gl=o=>{try{const l=String(o.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],c=o.getFullYear();return`${l} ${r} ${c}`}catch{return""}},El=o=>{if(!o||typeof o!="string")return!1;const l=o.trim();if(!l)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(l))return!0;try{const c=L("textEditor.started_conversation");if(c&&l===c)return!0}catch{}const r=l.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},Pl=o=>{const l=o.target.value;ve("update:modelValue",l),ve("change",l)},Rn=()=>{if(!ke.value)return;const o=ke.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},lo=()=>{Gt.value=!0,Rn()},Ol=()=>{Gt.value=!1,Ll()},Ll=()=>{if(!ke.value)return;const o=ke.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const l=o.value;o.value="M";const s=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},Wl=o=>{const s=o.target.value;Gt.value&&Rn(),ve("update:title",s),ve("title-change",s),Nt.value="title",A.richText&&($e.value||(Vt.value=rt.value,X.value=ee.value,pe.value=Z.value),Ze.value&&clearTimeout(Ze.value),$e.value=!0,Ze.value=setTimeout(()=>{$e.value=!1,ot()},500))},cl=()=>{if(!Ye.value)return;const o=Ye.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},Sl=()=>{S.value=!0,cl()},oo=()=>{S.value=!1,Kn()},Kn=()=>{if(!Ye.value)return;const o=Ye.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const l=o.value;o.value="M";const s=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},yn=o=>{const s=o.target.value;S.value&&cl(),ve("update:description",s),ve("description-change",s),Nt.value="description",A.richText&&($e.value||(Vt.value=rt.value,X.value=ee.value,pe.value=Z.value),Ze.value&&clearTimeout(Ze.value),$e.value=!0,Ze.value=setTimeout(()=>{$e.value=!1,ot()},500))},Jt=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const l=o.getRangeAt(0);if(l.startContainer.nodeType===1)return{type:"element",element:l.startContainer,offset:l.startOffset};const s=l.cloneRange();return s.selectNodeContents(f.value),s.setEnd(l.startContainer,l.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+l.toString().length}},sn=o=>{if(!(!o||!f.value))try{const l=window.getSelection(),s=document.createRange();if(o.type==="element"&&o.element)if(f.value.contains(o.element)){s.setStart(o.element,o.offset),s.collapse(!0),l.removeAllRanges(),l.addRange(s);return}else{f.value.focus();return}let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(s.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(s.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}l.removeAllRanges(),l.addRange(s)}catch{f.value.focus()}},nl=()=>{if(!f.value)return;f.value.focus();const o=window.getSelection(),l=document.createRange(),s=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let d=c.childNodes.length-1;d>=0;d--){const u=c.childNodes[d],m=s(u);if(m)return m}return c},r=s(f.value);if(r.nodeType===3)l.setStart(r,r.length),l.setEnd(r,r.length);else if(r.childNodes.length>0){const c=s(r);c&&c.nodeType===3?(l.setStart(c,c.length),l.setEnd(c,c.length)):(l.selectNodeContents(r),l.collapse(!1))}else l.setStart(r,0),l.setEnd(r,0);o.removeAllRanges(),o.addRange(l)},ot=(o=!1)=>{if(!f.value)return;const l=f.value.innerHTML,s=A.title||"",r=A.description||"";if(!o&&l===rt.value&&s===ee.value&&r===Z.value)return;const c={content:Vt.value||rt.value,title:X.value!==void 0?X.value:ee.value,description:pe.value!==void 0?pe.value:Z.value},d=Qe.value.length>0?Qe.value[Qe.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&&(Qe.value.push(c),Qe.value.length>50&&Qe.value.shift(),zt.value=[]),rt.value=l,ee.value=s,Z.value=r,Vt.value=l,X.value=s,pe.value=r},ce=o=>{if(!f.value)return;ul(),f.value&&On(f.value);let l=null;f.value&&(f.value.querySelector("p")||(l=Jt(),yt()));const s=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");s&&b.value&&(b.value=null),Q.value=!0;const r=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),c=Dn(r);ve("update:modelValue",c),ve("change",c),Nt.value="editor",$e.value||(Vt.value=rt.value,X.value=ee.value,pe.value=Z.value),Ze.value&&clearTimeout(Ze.value),$e.value=!0,Ze.value=setTimeout(()=>{$e.value=!1,ot(),Yl(),Bo()},500),e.nextTick(()=>{l&&sn(l),ul();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,v=m&&m.collapsed;if(d.forEach(k=>{try{if(v&&b.value?.command===k){K.value[k]=b.value.state;return}if(k==="bold")if(m){const _=m.commonAncestorContainer,D=_.nodeType===3?_.parentElement:_;let E=!1;if(D&&((D.tagName==="STRONG"||D.tagName==="B"||D.closest&&D.closest("strong, b"))&&(E=!0),!E&&D.style&&parseInt(D.style.fontWeight)>=600&&(E=!0),!E))try{const re=window.getComputedStyle(D);parseInt(re.fontWeight)>=600&&(E=!0)}catch{}K.value[k]=E}else K.value.hasOwnProperty(k)||(K.value[k]=!1);else if(k==="italic")if(m){const _=m.commonAncestorContainer,D=_.nodeType===3?_.parentElement:_,E=D&&(D.tagName==="EM"||D.tagName==="I"||D.closest&&D.closest("em, i"));K.value[k]=!!E}else{const _=document.queryCommandState(k);K.value[k]=_}else{const _=document.queryCommandState(k);K.value[k]=_}}catch{}}),Bn(),pn(),Te(),ln(),bt(),wn("handleRichTextInput"),s&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const k=o.data||"";k&&k.length===1&&setTimeout(()=>Bo(k),0),(k===" "||k===`
101
- `||/[.,;:!?]/.test(k))&&setTimeout(()=>{Yl()},100)}Q.value=!1})},ul=()=>{if(!f.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(!r)return;const c=r.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(r!==d&&!d?.contains(r)){const u=l.startContainer.nodeType===3?l.startContainer.parentElement:l.startContainer,m=l.endContainer.nodeType===3?l.endContainer.parentElement:l.endContainer;if(c.contains(u)&&u!==d||c.contains(m)&&m!==d){const v=document.createRange();v.setStartAfter(c),v.collapse(!0),o.removeAllRanges(),o.addRange(v)}}}},yt=()=>{if(!f.value)return;const o=f.value;if(o.querySelector&&o.querySelector("p"))return;const l=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),s=Array.from(o.childNodes);let r=null;s.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}r||(r=document.createElement("p"),o.insertBefore(r,c)),r.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){r=null;return}if(l.has(u)){r=null;return}r||(r=document.createElement("p"),o.insertBefore(r,d)),r.appendChild(d)}})},pn=()=>{if(f.value&&!on.value){on.value=!0;try{f.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),f.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const c=r.parentElement;!c||!c.classList.contains("dss-image-wrapper")?r.remove():c.querySelector("img")||r.remove()}),f.value.querySelectorAll("img").forEach(r=>{let c=r.getAttribute("alt");c===null&&(c=r.alt||"");const d=r.getAttribute("src")||r.src||"";if(c){const k=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),_=c===d||c===k;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||_||_)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=r.parentElement;const v=m&&m.classList.contains("dss-image-wrapper");if(v){const k=m.querySelector(".dss-image-no-alt-icon");k&&k.remove()}else{const k=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;k&&k.remove()}if(u){v?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const k=document.createElement("div");k.className="dss-image-no-alt-icon",k.setAttribute("contenteditable","false"),k.innerHTML=J,m.appendChild(k)}else if(v&&m.children.length===1){const k=m.parentNode;k.insertBefore(r,m),k.removeChild(m)}})}finally{on.value=!1}}},at=o=>{Yl(),ve("blur",o),Rl()},gt=()=>{if(A.disabled||!A.richText||!f.value)return;un(),Ze.value&&(clearTimeout(Ze.value),Ze.value=null),$e.value&&(ot(),$e.value=!1);const o=Nt.value==="title",l=Nt.value==="description",s=Nt.value==="editor";if(Qe.value.length===0){o&&ke.value?ke.value.focus():l&&Ye.value?Ye.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{ce()});return}const r={content:f.value.innerHTML,title:A.title||"",description:A.description||""};zt.value.push(r);const c=Qe.value.pop();if(c!==void 0){Q.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,rt.value=d,ee.value=u,Z.value=m,Vt.value=d,X.value=u,pe.value=m,e.nextTick(()=>{Bn(),fn(),ut(),ln();const v=Dn(d);ve("update:modelValue",v),ve("update:title",u),ve("update:description",m),ve("change",v),ve("title-change",u),ve("description-change",m),Q.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(ke.value){ke.value.focus();const k=u.length;ke.value.setSelectionRange&&ke.value.setSelectionRange(k,k),Rn()}}else if(l){if(Ye.value){Ye.value.focus();const k=m.length;Ye.value.setSelectionRange(k,k)}}else if(s)nl();else if(ke.value&&document.activeElement===ke.value){const k=u.length;ke.value.setSelectionRange&&ke.value.setSelectionRange(k,k),Rn()}else if(Ye.value&&document.activeElement===Ye.value){const k=m.length;Ye.value.setSelectionRange(k,k)}else f.value&&nl()},10)})})}},se=()=>{if(A.disabled||!A.richText||!f.value)return;un();const o=Nt.value==="title",l=Nt.value==="description",s=Nt.value==="editor";if(zt.value.length===0){o&&ke.value?ke.value.focus():l&&Ye.value?Ye.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{ce()});return}const r={content:f.value.innerHTML,title:A.title||"",description:A.description||""};Qe.value.push(r);const c=zt.value.pop();if(c!==void 0){Q.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,rt.value=d,ee.value=u,Z.value=m,Vt.value=d,X.value=u,pe.value=m,e.nextTick(()=>{Bn(),fn(),ut(),ln();const v=Dn(d);ve("update:modelValue",v),ve("update:title",u),ve("update:description",m),ve("change",v),ve("title-change",u),ve("description-change",m),Q.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(ke.value){ke.value.focus();const k=u.length;ke.value.setSelectionRange&&ke.value.setSelectionRange(k,k),Rn()}}else if(l){if(Ye.value){Ye.value.focus();const k=m.length;Ye.value.setSelectionRange(k,k)}}else if(s)nl();else if(ke.value&&document.activeElement===ke.value){const k=u.length;ke.value.setSelectionRange&&ke.value.setSelectionRange(k,k),Rn()}else if(Ye.value&&document.activeElement===Ye.value){const k=m.length;Ye.value.setSelectionRange(k,k)}else f.value&&nl()},10)})})}},Yt=()=>{if(!f.value)return;f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const c=r.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},Te=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},ao=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let s=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="EM"||c.tagName==="I"){s=!0;break}if(c.style&&c.style.fontStyle==="italic"){s=!0;break}c=c.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==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(()=>{Te()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{Te()});else try{const r=l.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{Te()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{Te()})}return!0},rn=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let s=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="STRONG"||c.tagName==="B"){s=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){s=!0;break}c=c.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}}if(s)break}}}if(s)return document.execCommand("bold",!1),e.nextTick(()=>{Yt()}),!1;if(l.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==f.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const v=document.createElement("b");v.style.fontWeight="600";const k=document.createDocumentFragment();for(;u.firstChild;)k.appendChild(u.firstChild);v.appendChild(k),u.parentNode&&u.parentNode.replaceChild(v,u),c.setStart(v,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===f.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c)}}Yt()});else try{const r=l.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{Yt()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Yt()})}return!0},Nn=(o,l=null)=>{if(A.disabled||!A.richText||!f.value)return;$e.value?(Ze.value&&(clearTimeout(Ze.value),Ze.value=null),ot(),$e.value=!1):ot(),un(),f.value.focus();const s=window.getSelection();let r=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&qt(d)&&(r=Jt())}if(o==="createLink"&&l){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const v=document.createTextNode(l);u.insertNode(v),u.selectNodeContents(v)}}}if(o==="bold"){const d=rn();K.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(b.value={command:"bold",state:d}),e.nextTick(()=>{r&&(sn(r),e.nextTick(()=>{const m=nn("bold");K.value.bold=m})),ce(),fn(),ln()});return}if(o==="italic"){const d=ao();K.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(b.value={command:"italic",state:d}),e.nextTick(()=>{r&&(sn(r),e.nextTick(()=>{const m=nn("italic");K.value.italic=m})),ce(),Te(),fn(),ln()});return}let c=!1;try{c=document.execCommand(o,!1,l)}catch{}e.nextTick(()=>{if(r&&sn(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=nn("bold");K.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=nn("italic");K.value.italic=u});else{const u=document.queryCommandState(o);K.value[o]=u}else{const u=document.queryCommandState(o);K.value[o]=u}}catch{K.value.hasOwnProperty(o)?K.value[o]=!K.value[o]:K.value[o]=!0}if(o==="createLink"&&l){const u=window.getSelection();if(u.rangeCount>0){const v=u.getRangeAt(0),k=v.commonAncestorContainer.nodeType===1?v.commonAncestorContainer.closest("a"):v.commonAncestorContainer.parentElement?.closest("a");k&&(!k.getAttribute("href")||k.getAttribute("href")==="")&&k.setAttribute("href",l)}f.value.querySelectorAll("a").forEach(v=>{const k=v.getAttribute("href");(!k||k===""||k==="#")&&v.setAttribute("href",l)})}ce(),fn(),ln()})},nn=(o,l=null)=>{if(A.disabled||!f.value)return!1;try{if(o==="formatBlock"&&l){const r=document.queryCommandValue("formatBlock");if(l==="<blockquote>"){const c=r.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const m=d.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===l||r.toLowerCase()===l.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="STRONG"||v.tagName==="B"||v.closest&&v.closest("strong, b"))&&(u=!0),!u&&v.style&&parseInt(v.style.fontWeight)>=600&&(u=!0),!u))try{const k=window.getComputedStyle(v);parseInt(k.fontWeight)>=600&&(u=!0)}catch{}return K.value.hasOwnProperty(o)?K.value[o]:(K.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const k=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let _;for(;_=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let E=_.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(_.nodeType===1){const D=_;if(D.tagName==="STRONG"||D.tagName==="B"){u=!0;break}if(D.style&&parseInt(D.style.fontWeight)>=600){u=!0;break}}if(u)break}}return K.value[o]=u&&v,u&&v}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="EM"||v.tagName==="I"||v.closest&&v.closest("em, i"))&&(u=!0),!u&&v.style&&v.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(v).fontStyle==="italic"&&(u=!0)}catch{}return K.value.hasOwnProperty(o)?K.value[o]:(K.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const k=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let _;for(;_=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let E=_.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(_.nodeType===1){const D=_;if(D.tagName==="EM"||D.tagName==="I"){u=!0;break}if(D.style&&D.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return K.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return c.collapsed&&K.value.hasOwnProperty(o)?K.value[o]:(K.value[o]=d,d)}return K.value.hasOwnProperty(o)?K.value[o]:!1}catch{return K.value.hasOwnProperty(o)?K.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},Fn=o=>{A.disabled||!A.richText||(be.value=be.value===o?null:o,o==="askAi"&&(lt.value=null))},un=()=>{be.value=null,Ge.value=null},In=o=>{Nn("formatBlock",o),un()},Tl=o=>{if(!o||!f.value)return o;const l=Ie=>{let Ve=Ie.nodeType===Node.TEXT_NODE?Ie.parentElement:Ie;for(;Ve&&Ve!==f.value;){const nt=Ve.tagName;if(nt==="P"){const Cn=Ve.parentElement;if(Cn===f.value||Cn.tagName==="BLOCKQUOTE")return Ve}if(nt==="BLOCKQUOTE")break;Ve=Ve.parentElement}return null},s=l(o.startContainer),r=l(o.endContainer);if(!s||!r)return o;const c=[],d=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Ie=>{const Ve=Ie.tagName;if(Ve==="P"){const nt=Ie.parentElement;if(nt===f.value||nt.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Ve==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(s),v=c.indexOf(r);if(m===-1||v===-1)return o;const k=Math.min(m,v),_=Math.max(m,v),D=c.slice(k,_+1);if(D.length===0)return o;const E=D[0],re=D[D.length-1],j=document.createRange();return j.setStartBefore(E),j.setEndAfter(re),j},Vl=()=>{if(A.disabled||!A.richText||!f.value)return;$e.value?(Ze.value&&(clearTimeout(Ze.value),Ze.value=null),ot(),$e.value=!1):ot(),un(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let l=o.getRangeAt(0);!l.collapsed&&qt(l)&&(l=Tl(l),o.removeAllRanges(),o.addRange(l));let s=null;!l.collapsed&&qt(l)&&(s=Jt());const r=l.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(v=>{if(v.nodeType===Node.ELEMENT_NODE)if(v.tagName==="P"||v.tagName==="DIV")u.insertBefore(v,c);else{const k=document.createElement("p");k.appendChild(v.cloneNode(!0)),u.insertBefore(k,c)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const k=document.createElement("p");k.appendChild(v.cloneNode(!0)),u.insertBefore(k,c)}}),c.remove()}}else if(l.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=l.extractContents();u.appendChild(m),l.insertNode(u);const v=[],k=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:E=>E.parentNode===u&&E.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let _;for(;_=k.nextNode();)v.push(_);if(v.forEach(E=>{const re=document.createElement("p");E.parentNode.insertBefore(re,E),re.appendChild(E)}),u.querySelectorAll("p, div").forEach(E=>{E.textContent.trim()===""&&!E.querySelector("img")&&(E.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const E=document.createElement("p");E.innerHTML="<br>",u.appendChild(E)}}e.nextTick(()=>{s&&sn(s),ut(),ce(),ln()})},Wn=()=>{if(!f.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!r||!f.value.contains(r))return;const c=_=>{if(!_)return!1;const D=_.textContent||"",re=(_.innerHTML||"").trim();return D.trim()===""||re===""||re==="<br>"||re==="<br/>"||re==="<p></p>"||re==="<p><br></p>"||re==="<p><br/></p>"||re==="<p> </p>"||re==="<p><br> </p>"||re==="<div></div>"||re==="<div><br></div>"||re==="<div><br/></div>"};let d=null;for(s.nodeType===3?d=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?d=s:d=s.closest("p, div"),d&&r.contains(d)&&c(d)&&d.remove();r.lastChild;){const _=r.lastChild;if(_.nodeType===1&&_.tagName==="BR")_.remove();else if(_.nodeType===3)if((_.textContent||"").trim()==="")_.remove();else break;else break}if(r.children.length>0)for(let _=r.children.length-1;_>=0;_--){const D=r.children[_];if((D.tagName==="P"||D.tagName==="DIV")&&c(D))D.remove();else break}let u=r.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(r.innerHTML=u);const v=document.createElement("p");v.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(v,r.nextSibling):r.parentNode.appendChild(v):f.value&&f.value.appendChild(v);const k=document.createRange();k.selectNodeContents(v),k.collapse(!0),o.removeAllRanges(),o.addRange(k),e.nextTick(()=>{ut(),ce()})},fn=()=>{if(!f.value){Ce.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");Ce.value=!!r}else Ce.value=!1}catch{Ce.value=!1}},ql=()=>{if(!f.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),Ee.value=Jt();const l=window.getSelection();let s="";l.rangeCount>0&&(s=l.getRangeAt(0).toString()),et.value="",vt.value=s,Me.value="",Pe.value=null,He.value=!0,un(),e.nextTick(()=>{q.value&&q.value.focus()})},Zl=()=>{if(!f.value)return;$e.value?(Ze.value&&(clearTimeout(Ze.value),Ze.value=null),ot(),$e.value=!1):ot();const o=window.getSelection();let l=null;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;l=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!l&&Pe.value&&(l=Pe.value),l&&l.parentNode){const s=document.createDocumentFragment();for(;l.firstChild;)s.appendChild(l.firstChild);if(l.parentNode.replaceChild(s,l),s.firstChild){const r=document.createRange();r.setStartBefore(s.firstChild),r.setEndAfter(s.lastChild||s.firstChild),o.removeAllRanges(),o.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),o.removeAllRanges(),o.addRange(r)}Pe.value=null}else Nn("unlink");Ce.value=!1,un(),e.nextTick(()=>{ce(),fn()})},ll=()=>{A.disabled||!A.richText||f.value&&($e.value?(Ze.value&&(clearTimeout(Ze.value),Ze.value=null),ot(),$e.value=!1):ot(),un(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Bn(),ce(),ln()}))},Al=()=>{A.disabled||!A.richText||f.value&&($e.value?(Ze.value&&(clearTimeout(Ze.value),Ze.value=null),ot(),$e.value=!1):ot(),un(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Bn(),ce(),ln()}))},dl=o=>{const l=o.parentElement;if(!l||l.tagName!=="OL")return null;let s=0,r=o.previousElementSibling;for(;r;)r.tagName==="LI"&&s++,r=r.previousElementSibling;return s+1},Bn=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(l=>{const s=l.parentElement;if(s&&s.tagName==="LI"){const r=dl(s);r!==null&&Array.from(l.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},Dl=()=>{if(A.disabled||!A.richText||!f.value)return;un(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{Bn(),ce()});return}const r=s.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=s.previousElementSibling;if(c&&c.tagName==="LI"){const d=r.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const m=dl(c);u.appendChild(s),m!==null&&r.tagName==="OL"&&s.setAttribute("data-parent-num",String(m)),Bn();const v=document.createRange();v.selectNodeContents(s),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{ce(),ln()})}else document.execCommand("indent",!1),e.nextTick(()=>{Bn(),ce(),ln()})},ml=()=>{if(A.disabled||!A.richText||!f.value)return;un(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{Bn(),ce()});return}const r=s.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=r.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){r.tagName==="OL"&&s.removeAttribute("data-parent-num"),d.insertBefore(s,c.nextSibling),r.children.length===0&&r.remove(),Bn();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{ce(),ln()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Bn(),ce(),ln()})},Lt=e.ref(null),qn=e.ref(null),ol=e.ref({}),y=e.ref(""),h=e.ref(null),x=e.ref("");e.ref("");const W=e.ref(null);e.ref("");const ie=e.ref([]),ft=e.ref(!1),Ht=e.ref(!1),Mn=o=>{if(!o)return"";const l=o.cloneRange(),s=document.createElement("div");return s.appendChild(l.cloneContents()),s.innerHTML},Ln=()=>{if(A.disabled||!A.richText||!f.value)return;if(Lt.value!==null){Lt.value=null,y.value="",x.value="",W.value=null,ie.value=[],xn(!0);return}un(),f.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(l.collapsed||!qt(l))return;x.value=Mn(l)||"",W.value=Jt();const s=l.getBoundingClientRect(),r=f.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=s.bottom-c.top,m=Math.max(d+8,0);ol.value={top:`${m}px`,bottom:"auto"},Lt.value=Date.now(),e.nextTick(()=>{if(y.value="",h.value){const k=h.value;k.style.height="auto",k.style.height=`${k.scrollHeight}px`,k.focus()}const v=r.querySelector(".dss-comment-overlay");if(v&&r){const k=r.querySelector(".dss-text-editor-footer");if(k){const _=r.getBoundingClientRect(),D=v.getBoundingClientRect(),E=k.getBoundingClientRect(),re=D.bottom-_.top,j=E.top-_.top,Ie=8;if(re>j-Ie){const Ve=E.height;ol.value={bottom:`${Ve+Ie}px`,top:"auto"}}else ol.value={top:`${m}px`,bottom:"auto"}}}})},Pn=()=>{if(!y.value.trim())return;const o=y.value.trim(),l=new Date,s={text:o,selectionText:x.value,selectionRange:W.value,commentId:Lt.value,user:A.commentUser||null,createdAt:l.toISOString()};ie.value=[...ie.value,s],ve("comment-submitted",s),ro(s),W.value&&!so(W.value)&&xo(Lt.value,W.value),y.value="",e.nextTick(()=>{if(h.value){const r=h.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}wn("sendComment")})},hl=(o,l)=>{if(!(!A.commentUser||!o.user||o.user.id!==A.commentUser.id)){if(ie.value=ie.value.filter((s,r)=>r!==l),Lt.value!==null&&f.value){const s=String(Lt.value),r=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(r&&ie.value.length>0){const c=[],d=new Set;ie.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),c.push(u.user))}),c.length>0?r.setAttribute("data-comment-user",JSON.stringify(c[0])):r.removeAttribute("data-comment-user"),c.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(c[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(ie.value.length))}else r&&ie.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(ve("comment-deleted",{comment:o,index:l,commentId:Lt.value}),A.comments&&Array.isArray(A.comments)){const s=A.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));ve("update:comments",s)}e.nextTick(()=>{wn("deleteComment")})}},so=o=>{if(!o||!f.value)return!1;try{const l=wo(o);if(!l)return!1;const s=l.commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},wo=o=>{if(!o||!f.value)return null;try{const l=document.createRange();if(o.type==="element"&&o.element)return f.value.contains(o.element)?(l.setStart(o.element,o.offset),l.collapse(!0),l):null;let s=0;const r=[f.value];let c=null,d=!1,u=!1;for(;!u&&(c=r.pop());)if(c.nodeType===3){const m=s+c.length;!d&&o.start>=s&&o.start<=m&&(l.setStart(c,o.start-s),d=!0),d&&o.end>=s&&o.end<=m&&(l.setEnd(c,o.end-s),u=!0),s=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return d?l:null}catch{return null}},xo=(o,l)=>{if(!(!o||!l||!f.value))try{const s=wo(l);if(!s||s.collapsed)return;const r=s.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const m=c.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(o)&&m.getAttribute("data-fake-comment")!==String(o)&&m.setAttribute("data-comment",String(o));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(o));try{const m=s.startContainer,v=s.endContainer,k=s.startOffset,_=s.endOffset,D=m.nodeType===3?m.parentNode:m,E=v.nodeType===3?v.parentNode:v;if(D===E&&k===0&&_===(v.nodeType===3?v.length:E.childNodes.length)&&(D.tagName==="P"||D.tagName==="DIV"||D.tagName==="H1"||D.tagName==="H2"||D.tagName==="H3"||D.tagName==="H4"||D.tagName==="H5"||D.tagName==="H6")){const j=s.extractContents();d.appendChild(j),s.insertNode(d)}else s.surroundContents(d)}catch{const v=s.extractContents();d.appendChild(v),s.insertNode(d)}const u=f.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{wn("wrapSelectionWithCommentMarker"),ce()})}catch{}},ro=o=>{if(!o||!o.commentId)return;const l=Array.isArray(A.comments)?[...A.comments]:[],s=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let r=l.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(s)||d.conversation_id===s);const c={text:o.text,user:o.user,createdAt:o.createdAt,created_at:o.createdAt,updated_at:o.createdAt};if(r>=0){const d=l[r];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=o.createdAt,!d.article_id&&l.length>0){const u=l.find(m=>m.article_id);u&&(d.article_id=u.article_id)}}else{const d=o.selectionRange,u=l.length>0&&l.find(v=>v.article_id)?.article_id||null,m={conversation_id:s,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:o.selectionText||"",conversation:[c],created_by_user:o.user,created_at:o.createdAt,updated_at:o.createdAt,status:"active"};l.push(m)}ft.value=!0,ve("update:comments",l)},Eo=(o,l=[])=>{if(A.disabled||!A.richText||!f.value)return;const s=f.value;let r=null;try{r=s.querySelector(o)}catch{return}if(!r)return;un(),s.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),x.value=r.innerHTML||"",W.value=Jt();const u=c.getBoundingClientRect(),m=s.parentElement;if(m){const _=m.getBoundingClientRect(),D=u.bottom-_.top,re=Math.max(D+8,0);ol.value={top:`${re}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let k=[];if(v&&A.comments&&Array.isArray(A.comments)){const _=A.comments.find(D=>String(D.conversation_id)===String(v));if(_&&_.conversation&&Array.isArray(_.conversation)){const D=_.conversation.map(E=>({id:E.id||E.commentary_id,commentary_id:E.id||E.commentary_id,conversation_id:_.id||_.conversation_id,text:E.text,user:E.user,createdAt:E.created_at||E.createdAt,updated_at:E.updated_at||E.updatedAt}));k.push(...D)}}k.length===0&&Array.isArray(l)&&l.length>0&&(k=l.slice()),k.sort((_,D)=>{const E=Ie=>{if(!Ie)return 0;const Ve=new Date(Ie).getTime();return isNaN(Ve)?0:Ve},re=E(_.createdAt),j=E(D.createdAt);return re===j?0:re-j}),ie.value=k,xn(!0),Lt.value=v||null,r&&(qn.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(y.value="",h.value){const _=h.value;_.style.height="auto",_.style.height=`${_.scrollHeight}px`,_.focus()}if(m){const _=m.querySelector(".dss-comment-overlay");if(_){const D=m.querySelector(".dss-text-editor-footer");if(D){const E=m.getBoundingClientRect(),re=_.getBoundingClientRect(),j=D.getBoundingClientRect(),Ie=re.bottom-E.top,Ve=j.top-E.top,nt=8;if(Ie>Ve-nt){const Cn=j.height;ol.value={bottom:`${Cn+nt}px`,top:"auto"}}}}}wn("openCommentOverlayForSelector")})},io=e.ref(null),So=e.ref(0),co=o=>{if(!(A.disabled||!A.richText)){if(o.key==="Escape"){const l=window.getSelection();if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){o.preventDefault();let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(m,u.nextSibling):c.appendChild(m),setTimeout(()=>{Wn()},50);return}}}if(o.key.length===1||o.key==="Enter"){const l=window.getSelection();if(l&&l.rangeCount>0){const s=l.getRangeAt(0),r=s.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const m=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,v=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(m)&&m!==u||d.contains(v)&&v!==u){o.preventDefault();const k=document.createRange();k.setStartAfter(d),k.collapse(!0),l.removeAllRanges(),l.addRange(k);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const l=window.getSelection();if(l.rangeCount>0){const s=l.getRangeAt(0);let r=null,c=null;if(s.collapsed)if(o.key==="Backspace"){const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const m=u.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const m=u.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=s.commonAncestorContainer,u=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,m=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(r=d,c=r.closest(".dss-image-wrapper")):(r=d.querySelector("img"),r&&(c=r.closest(".dss-image-wrapper"))),c){const v=c.contains(u)||u===c,k=c.contains(m)||m===c,D=s.cloneContents().textContent?.trim()||"",E=c.textContent?.trim()||"";(!v||!k||D.length>E.length)&&(c=null,r=null)}}if(c){o.preventDefault(),o.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const m=document.createRange();m.setStartAfter(u),m.collapse(!0),l.removeAllRanges(),l.addRange(m),e.nextTick(()=>{ce()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?ml():Dl();return}if(o.key==="Enter"){const l=window.getSelection();if(l.rangeCount>0){const s=l.getRangeAt(0);if(s.collapsed){const u=s.startContainer,m=v=>{if(!v)return!1;let k=v.previousSibling;for(;k;){if(k.classList&&k.classList.contains("dss-image-wrapper")||k.tagName==="IMG"||k.querySelector&&k.querySelector(".dss-image-wrapper")||k.querySelector&&k.querySelector("img"))return!0;k=k.previousSibling}const _=v.parentElement;return _&&_!==f.value?m(_):!1};if(u.nodeType===3){const v=u.parentElement;if(v&&(m(v)||m(u))){const k=v.closest("p, div");if(k&&k!==f.value){o.preventDefault(),o.stopPropagation();let _=null;const D=s.startOffset;D<u.length&&(_=u.splitText(D));const E=document.createElement("p");if(_?E.appendChild(_):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 re=document.createRange();_?re.setStart(_,0):re.setStart(E,0),re.collapse(!0),l.removeAllRanges(),l.addRange(re),e.nextTick(()=>{ce()});return}}}}const r=s.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=j=>{if(!j)return!1;const Ie=j.textContent||"",nt=(j.innerHTML||"").trim(),Cn=nt.replace(/<br\s*\/?>/gi,"").trim();return Ie.trim()===""||nt===""||Cn===""||nt==="<br>"||nt==="<br/>"||nt==="<p></p>"||nt==="<p><br></p>"||nt==="<p><br/></p>"||nt==="<p> </p>"||nt==="<p><br> </p>"||nt==="<div></div>"||nt==="<div><br></div>"||nt==="<div><br/></div>"},v=c.lastChild,k=v&&v.nodeType===1&&v.tagName==="BR",_=s.startContainer,D=_.nodeType===3?_.parentElement:_,E=D===c||D&&D.parentElement===c;if(u&&m(u)||k&&E){o.preventDefault(),setTimeout(()=>{Wn()},50);return}}}}if(o.key===" "){const l=Date.now(),s=l-So.value;if(io.value===" "&&s<300){const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(d){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){o.preventDefault(),Dl();return}}}}io.value=" ",So.value=l}else io.value=o.key}},qo=o=>{if(A.disabled||!A.richText)return;o.preventDefault();let l=o.clipboardData.getData("text/html"),s=o.clipboardData.getData("text/plain");l&&(l=l.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),ot();const r=window.getSelection();let c=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),c=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const v=new DOMParser().parseFromString(u,"text/html");let k=f.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach(D=>{if(k>0){const E=v.createElement("p");E.innerHTML=D.innerHTML,D.parentNode.replaceChild(E,D)}else k++}),c){const D=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],E=Array.from(v.body.children).filter(re=>D.includes(re.tagName));if(E.length===1){const re=E[0].tagName,j=c.tagName,Ie=c.textContent.trim()===""&&!c.querySelector("img");let Ve=!1;if(["H1","H2","H3","H4","H5","H6"].includes(j)?Ve=!0:Ie||(re===j||re==="P")&&(Ve=!0),Ve)return E[0].innerHTML.trim()}}return v.body.innerHTML.trim()};if(l){const u=d(l);document.execCommand("insertHTML",!1,u)}else if(s)if(/<[a-z][\s\S]*>/i.test(s)){const m=d(s);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,s);ce()},Ul=o=>{if(be.value){const s=o.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&un()}if(ze.value){const s=o.target,r=s.closest(".dss-floating-toolbar"),c=f.value&&s.closest(".dss-text-editor-content");!r&&!c&&Rl()}if(lt.value){const s=o.target,r=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!r&&!c&&Xl()}const l=o.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(Ge.value=null),!f.value||!l.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const r=s.getRangeAt(0);Y.value=!r.collapsed&&qt(r)}else Y.value=!1}if(Lt.value!==null){const s=document.querySelector(".dss-comment-overlay");let r=!1;if(s){const u=s.getBoundingClientRect(),m=o.clientX,v=o.clientY;r=m>=u.left&&m<=u.right&&v>=u.top&&v<=u.bottom}const c=l.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!r&&!d&&(Lt.value=null,y.value="",x.value="",W.value=null,ie.value=[],xn(!0))}},_n=(o,l)=>{o&&o.stopPropagation&&o.stopPropagation(),Tt.value&&(clearTimeout(Tt.value),Tt.value=null),Ge.value=l},I=o=>{const l=o.relatedTarget;if(l){const s=l.closest(".dss-toolbar-dropdown-submenu"),r=l.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||r)return}Tt.value&&clearTimeout(Tt.value),Tt.value=setTimeout(()=>{Ge.value=null,Tt.value=null},150)},Sn=o=>{Ge.value=null};let Zn=0;const Hl=o=>{if(!o)return;const l=Array.from(o.children);l.forEach(s=>{s.classList.contains("dss-toolbar-dropdown-submenu")||s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(s.tagName==="BUTTON"||s.tagName==="DIV")&&!s.classList.contains("dss-toolbar-dropdown-item")&&s.classList.add("dss-toolbar-dropdown-item")}),l.forEach((s,r)=>{if(s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||s.classList.contains("dss-toolbar-dropdown-submenu")||!s.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(s.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(k=>k.tagName==="BUTTON"||k.tagName==="DIV").length>0:!1),d=s.nextElementSibling,u=d&&!d.classList.contains("dss-toolbar-dropdown-submenu")&&!d.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&d.tagName==="DIV"&&!d.classList.contains("dss-toolbar-dropdown-item")&&Array.from(d.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(c||u){const m=`submenu-auto-${++Zn}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",m);let v=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),v=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),v=d),v&&(v.setAttribute("data-submenu-id",m),v.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(_=>{(_.tagName==="BUTTON"||_.tagName==="DIV")&&!_.classList.contains("dss-toolbar-dropdown-item")&&_.classList.add("dss-toolbar-dropdown-item")}))}})},kn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{Hl(l),l.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=v=>{const k=c.getAttribute("data-submenu-id");k&&_n(v,k)},m=I;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m}}),l.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=k=>{const _=c.getAttribute("data-submenu-id");_&&_n(k,_)},m=I;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(k=>{k.addEventListener("click",Sn)})})})};let $n=null;const jt=()=>{if(Ge.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Ge.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Ge.value}"]`);o&&l&&Lo(o,l)}if(ze.value&&ln(),A.richText){if($n!==null)return;$n=setTimeout(()=>{$n=null,wn("handleWindowResize")},150)}},en=()=>{if(!A.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(l=>{Array.from(l.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},pl=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),l=s=>{if(s.preventDefault(),s.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};o.forEach(s=>{s.addEventListener("selectstart",l),s.addEventListener("mousedown",l),s.addEventListener("dragstart",l),s.addEventListener("contextmenu",l),s.addEventListener("click",r=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Gt.value?Rn():Ll(),S.value?cl():Kn()})}),e.nextTick(()=>{pl()}),A.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Ul),window.addEventListener("resize",jt);let o=null;const l=()=>{o===null&&(o=setTimeout(()=>{o=null,jt()},150))};window.addEventListener("scroll",l,!0),f.value._windowScrollHandler=l,f.value._windowScrollTimeout=o,f.value.closest(".editor-with-comments"),f.value.closest(".dss-text-editor-content-wrapper");const s=f.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,jt()},150))};s&&(s.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{kn(),en()}),f.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!A.disabled&&m.preventDefault();const _=v.closest(".dss-image-no-alt-icon"),D=v.closest(".dss-image-wrapper");if(_||D&&v===D){m.preventDefault(),m.stopPropagation();const E=window.getSelection(),re=document.createRange();re.setStartAfter(D),re.collapse(!0),E.removeAllRanges(),E.addRange(re)}else D&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const E=window.getSelection();if(E.rangeCount>0){const j=E.getRangeAt(0).commonAncestorContainer,Ie=j.nodeType===3?j.parentElement:j;if(D.contains(Ie)&&Ie!==D.querySelector("img")){const Ve=document.createRange();Ve.setStartAfter(D),Ve.collapse(!0),E.removeAllRanges(),E.addRange(Ve)}}else{const re=document.createRange();re.setStartAfter(D),re.collapse(!0),E.addRange(re)}}))},!0),f.value.addEventListener("mousedown",m=>{const v=m.target,k=v.closest(".dss-image-no-alt-icon"),_=v.closest(".dss-image-wrapper");if(k||_&&v.tagName!=="IMG"){m.preventDefault();const D=window.getSelection(),E=document.createRange();_&&(E.setStartAfter(_),E.collapse(!0),D.removeAllRanges(),D.addRange(E))}},!0),f.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!f.value)return;f.value.querySelectorAll("img").forEach(k=>{if(!k.closest(".dss-image-wrapper"))k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="";else{const D=k.getAttribute("alt")||k.alt||"";if(D){const E=k.getAttribute("src")||k.src||"",re=E.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),j=D===E||D===re;(D.startsWith("http://")||D.startsWith("https://")||D.startsWith("data:")||j||j)&&(k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="")}}}),pn()})}),f.value.addEventListener("dragstart",m=>{const v=m.target,k=v.tagName==="IMG"?v:v.closest("img"),_=k?.closest(".dss-image-wrapper");k&&f.value.contains(k)&&(Ct.value=_||k,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",m=>{Ct.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",m=>{Ct.value&&(m.preventDefault(),m.stopPropagation())}),f.value.addEventListener("drop",m=>{if(!Ct.value||!f.value)return;m.preventDefault(),m.stopPropagation();const v=Ct.value,k=v.classList?.contains("dss-image-wrapper"),_=k?v.querySelector("img"):v,D=k?v:_?.closest(".dss-image-wrapper");if(!_||!f.value.contains(_)){Ct.value=null;return}let E=null;const re=m.clientX,j=m.clientY;if(document.caretRangeFromPoint)E=document.caretRangeFromPoint(re,j);else{const cn=window.getSelection();cn.rangeCount>0?E=cn.getRangeAt(0).cloneRange():(E=document.createRange(),E.selectNodeContents(f.value),E.collapse(!1))}if(!E){Ct.value=null;return}const Ie=E.commonAncestorContainer,Ve=Ie.nodeType===3?Ie.parentElement:Ie;if(Ve?.closest(".dss-image-wrapper")===D||D&&D.contains(Ve)){Ct.value=null;return}if(D&&(Ve===D||D.contains(Ve))){Ct.value=null;return}const Cn=_.getAttribute("src");let vn=null;D?vn=D.cloneNode(!0):vn=_.cloneNode(!0);try{let cn=E.startContainer;if(cn.nodeType===3&&(cn=cn.parentElement),D&&(cn===D||D.contains(cn))){const mn=document.createRange();mn.setStartAfter(D),mn.collapse(!0),E=mn}E.insertNode(vn);const gn=document.createRange();gn.setStartAfter(vn),gn.collapse(!0);const dn=window.getSelection();dn.removeAllRanges(),dn.addRange(gn)}catch{if(f.value.childNodes.length===0){const gn=document.createElement("p");gn.appendChild(vn),f.value.appendChild(gn)}else{const gn=f.value.lastChild;if(gn&&gn.nodeType===1)gn.appendChild(vn);else{const dn=document.createElement("p");dn.appendChild(vn),f.value.appendChild(dn)}}}D?D.remove():_.remove(),Ct.value=null,e.nextTick(()=>{const cn=f.value.querySelectorAll("img");let gn=!1;cn.forEach(dn=>{if(dn.getAttribute("src")===Cn)if(!gn)gn=!0;else{const mn=dn.closest(".dss-image-wrapper");mn?mn.remove():dn.remove()}}),pn(),ce()})}),f.value.addEventListener("dragend",m=>{Ct.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(v=>{v.addedNodes.forEach(k=>{if(k.nodeType===1){k.tagName==="IMG"&&(k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="");const _=k.querySelectorAll&&k.querySelectorAll("img");_&&_.forEach(D=>{D.removeAttribute("alt"),D.removeAttribute("data-alt"),D.setAttribute("alt",""),D.setAttribute("data-alt",""),D.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{pn(),en(),d=null},100)});if(u.observe(f.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{en()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),A.modelValue){const m=Hn(A.modelValue);f.value.innerHTML=m,yt()}e.nextTick(()=>{const m=f.value.innerHTML||"",v=A.title||"",k=A.description||"";rt.value=m,ee.value=v,Z.value=k,X.value=v,pe.value=k,Bn(),pn(),Te(),bt(),go(),Vn()}),fn(),ut(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Ul),window.removeEventListener("resize",jt),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),$n!==null&&(clearTimeout($n),$n=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),Ze.value&&clearTimeout(Ze.value),Tt.value&&clearTimeout(Tt.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),We.value&&We.value.disconnect(),ht.value!==null&&(cancelAnimationFrame(ht.value),ht.value=null),it.value!==null&&(clearTimeout(it.value),it.value=null),Et.value!==null&&(clearTimeout(Et.value),Et.value=null),xn(!0),f.value&&f.value._scrollHandlers){const{wrapper:l,content:s,handler:r}=f.value._scrollHandlers;l&&l.removeEventListener("scroll",r),s&&s.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const yl=o=>{const l=o.target,s=l.closest("a");if(s&&!A.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(s);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const r=l.closest(".dss-image-wrapper");r&&l.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(r.contains(m)&&m!==r.querySelector("img")){const v=document.createRange();v.setStartAfter(r),v.collapse(!0),c.removeAllRanges(),c.addRange(v)}}pn(),fn(),ut(),ln(),bt()}):e.nextTick(()=>{pn(),fn(),ut(),ln(),bt()})},Rt=()=>{ul();const o=window.getSelection();if(o&&o.rangeCount>0){const s=o.getRangeAt(0);Y.value=!s.collapsed&&qt(s),!s.collapsed&&b.value&&(b.value=null)}else Y.value=!1;if(pn(),fn(),ut(),ln(),bt(),o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c&&c.closest(".dss-text-editor-footer")){o.removeAllRanges(),Y.value=!1;return}}["bold","italic","underline"].forEach(s=>{try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(!c.collapsed)if(s==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let m=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(m=!0),!m&&u.style&&parseInt(u.style.fontWeight)>=600&&(m=!0),!m))try{const v=window.getComputedStyle(u);parseInt(v.fontWeight)>=600&&(m=!0)}catch{}K.value[s]=m}else{const d=document.queryCommandState(s);K.value[s]=d}}}catch{}})},bt=()=>{if(!A.richText||A.disabled||!f.value){V.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){V.value="p";return}const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(!r||!f.value.contains(r)){V.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){V.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?V.value=d:V.value="p"}catch{V.value="p"}},ut=()=>{if(!f.value){Ke.value=!1;return}try{const o=window.getSelection();let l=!1;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");l=!!(c&&f.value.contains(c))}Ke.value=l}catch{Ke.value=!1}},qt=o=>{if(!o||!f.value)return!1;const l=o.commonAncestorContainer;if(!l)return!1;const s=l.nodeType===3?l.parentElement:l;return s?f.value.contains(s):!1},Rl=()=>{ze.value=!1},ln=()=>{if(!A.floatingToolbar||!A.richText||A.disabled){ze.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){ze.value=!1;return}const l=o.getRangeAt(0);if(l.collapsed||!qt(l)){ze.value=!1;return}const s=l.getBoundingClientRect();if(!s||s.width===0&&s.height===0){ze.value=!1;return}const r=f.value;if(!r){ze.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){ze.value=!1;return}const d=40,u=8,m=s.top-d/2+15;let v=s.left+s.width/2;const k=window.innerWidth||document.documentElement.clientWidth||0;let _=0;st.value&&(_=st.value.getBoundingClientRect().width);const D=(_||320)/2;let E=c.left+D,re=c.right-D;if(re<E){const j=c.left+c.width/2;E=j,re=j}if(k>0){const j=D+u,Ie=k-D-u;if(E=Math.max(E,j),re=Math.min(re,Ie),re<E){const Ve=k/2;E=Ve,re=Ve}}v<E?v=E:v>re&&(v=re),we.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},ze.value=!0},Nl=o=>{A.disabled||!A.richText||(lt.value=lt.value===o?null:o,o==="askAi"&&(be.value=null))},Xl=()=>{lt.value=null,Ge.value=null},zn=o=>{In(o),Xl()};let al=null,sl=null,kl=null,Cl=null;const Zo=o=>{if(A.disabled||!A.richText){Bl(),Fl();return}const l=o.target,s=l.closest("a"),r=l.closest("img");if(al&&(clearTimeout(al),al=null),kl&&(clearTimeout(kl),kl=null),s&&s!==sl){Fl(),sl=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),Pe.value=s,me.value=c,U.value=!0,xe.value=!0,Gn(s)}else!s&&sl?(sl=null,al=setTimeout(()=>{xe.value||Bl()},150)):s&&s===sl&&Gn(s);if(r&&r!==Cl){Bl(),Cl=r;let c=r.getAttribute("alt");c===null&&(c=r.alt||"");let d=r.getAttribute("data-alt");d===null&&(d=c),r.hasAttribute("alt")||r.setAttribute("alt",c),r.hasAttribute("data-alt")||r.setAttribute("data-alt",d),kt.value=r,Wt.value=c.trim()||L("textEditor.image.noAlt"),St.value=!0,he.value=!0,Vo(r)}else!r&&Cl?(Cl=null,kl=setTimeout(()=>{he.value||Fl()},150)):r&&r===Cl&&Vo(r)},bl=o=>{const l=o.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(sl=null,Cl=null,al&&(clearTimeout(al),al=null),kl&&(clearTimeout(kl),kl=null),Bl(),Fl())},Bl=()=>{xe.value=!1,setTimeout(()=>{xe.value||(U.value=!1,me.value="",He.value||(Pe.value=null))},100)},Gn=o=>{if(!o||!f.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;H.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Fl=()=>{he.value=!1,setTimeout(()=>{he.value||(St.value=!1,Wt.value="",xt.value||(kt.value=null))},100)},Vo=o=>{if(!o||!f.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;G.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Il=()=>{if(!me.value||!Pe.value)return;let l=Pe.value.getAttribute("href")||me.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},Uo=()=>{if(Pe.value){const o=Pe.value.textContent||"",l=Pe.value.getAttribute("href")||"",s=Pe.value;et.value=l,vt.value=o,Me.value=o,xe.value=!1,U.value=!1,me.value="",Pe.value=s,He.value=!0}else if(Ce.value){const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(r){const c=r.textContent||"",d=r.getAttribute("href")||"";et.value=d,vt.value=c,Me.value=c,Pe.value=r,He.value=!0}}}else{Ee.value=Jt();const o=window.getSelection();let l="";o.rangeCount>0&&(l=o.getRangeAt(0).toString()),et.value="",vt.value=l,Me.value="",Pe.value=null,He.value=!0}e.nextTick(()=>{q.value&&(q.value.focus(),q.value.select())})},zl=()=>{He.value=!1,et.value="",vt.value="",Me.value="",Pe.value=null,Ee.value=null},uo=()=>{if(!et.value.trim()){zl();return}if($e.value?(Ze.value&&(clearTimeout(Ze.value),Ze.value=null),ot(),$e.value=!1):ot(),vt.value.trim()||(vt.value=et.value.trim()),Pe.value&&f.value&&f.value.contains(Pe.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const l=Pe.value;if(l.setAttribute("href",et.value.trim()),vt.value.trim()!==Me.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=vt.value.trim()}l.style.color="#60afdf",l.style.textDecoration="underline";const s=document.createRange();s.selectNodeContents(l),s.collapse(!1),o.removeAllRanges(),o.addRange(s),ce()}else if(f.value){f.value.focus();const o=window.getSelection();o.removeAllRanges(),Ee.value&&sn(Ee.value);let l=null;if(o.rangeCount>0&&(l=o.getRangeAt(0)),l&&!l.collapsed){l.toString();const s=document.createElement("a");s.href=et.value.trim(),s.textContent=vt.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",l.deleteContents(),l.insertNode(s);const r=document.createTextNode(" ");l.setStartAfter(s),l.insertNode(r),l.setStartAfter(r),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}else{l||(l=document.createRange(),l.selectNodeContents(f.value),l.collapse(!1));const s=l.startContainer,r=s.nodeType===3,c=r&&l.startOffset===s.textContent.length,d=document.createElement("a");if(d.href=et.value.trim(),d.textContent=vt.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=s.parentElement;for(;u&&u!==f.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==f.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const v=document.createTextNode(" ");m.appendChild(v);const k=document.createRange();k.setStartAfter(d),k.collapse(!0),o.removeAllRanges(),o.addRange(k)}else{if(l.startOffset>0){const k=s.textContent.substring(0,l.startOffset),_=k[k.length-1];if(_&&_!==" "&&_!==" "&&_!==`
102
- `){const D=document.createTextNode(" ");l.insertNode(D),l.setStartAfter(D)}}l.insertNode(d);const v=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(v),l.setStartAfter(v),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}}else{if(r&&l.startOffset>0){const m=s.textContent.substring(0,l.startOffset),v=m[m.length-1];if(v&&v!==" "&&v!==" "&&v!==`
103
- `){const k=document.createTextNode(" ");l.insertNode(k),l.setStartAfter(k)}}l.insertNode(d);const u=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(u),l.setStartAfter(u),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}ce()}e.nextTick(()=>{fn(),zl()})},Yl=()=>{if(!f.value||Q.value)return;const o=window.getSelection();let l=null;o&&o.rangeCount>0&&(l=Jt());const s=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,r=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const v=m.parentElement;return!v||v.closest("a")||v.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=r.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const v=c[m],k=v.textContent;s.lastIndex=0;const _=[...k.matchAll(s)];if(_.length===0)continue;const D=_.filter(j=>{const Ie=j[0],Ve=j.index;if(Ve>0&&k[Ve-1]==="@"||Ve+Ie.length<k.length&&k[Ve+Ie.length]==="@")return!1;const nt=v.parentElement;return!(nt&&nt.closest("a"))});if(D.length===0)continue;if(D.length===1&&D[0][0]===k.trim()){const j=D[0][0],Ie=j.startsWith("http://")||j.startsWith("https://")?j:`https://${j}`,Ve=document.createElement("a");Ve.href=Ie,Ve.textContent=j,Ve.style.color="#60afdf",Ve.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(Ve,v),u=!0);continue}let E=0;const re=document.createDocumentFragment();if(D.forEach(j=>{const Ie=j.index,Ve=j[0];if(Ie>E){const vn=k.substring(E,Ie);vn&&re.appendChild(document.createTextNode(vn))}const nt=Ve.startsWith("http://")||Ve.startsWith("https://")?Ve:`https://${Ve}`,Cn=document.createElement("a");Cn.href=nt,Cn.textContent=Ve,Cn.style.color="#60afdf",Cn.style.textDecoration="underline",re.appendChild(Cn),E=Ie+Ve.length}),E<k.length){const j=k.substring(E);j&&re.appendChild(document.createTextNode(j))}v.parentNode&&re.childNodes.length>0&&(v.parentNode.replaceChild(re,v),u=!0)}u&&l&&e.nextTick(()=>{sn(l),fn()})},No=()=>{if(!f.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,l=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),s=[];let r;for(;r=l.nextNode();)s.push(r);for(let c=s.length-1;c>=0;c--){const d=s[c],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let v=0;const k=document.createDocumentFragment();m.forEach(_=>{const D=_.index,E=_[0].startsWith("<u>")?"u":"ins",re=_[1]||_[2]||"";D>v&&k.appendChild(document.createTextNode(u.substring(v,D)));const j=document.createElement(E);j.textContent=re,k.appendChild(j),v=D+_[0].length}),v<u.length&&k.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&k.childNodes.length>0&&d.parentNode.replaceChild(k,d)}},Bo=o=>{if(!f.value||Q.value)return;if(!o){No();return}if(!["*","_",">"].includes(o))return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const r=s.getRangeAt(0);if(!r.collapsed)return;const c=r.startContainer.nodeType===Node.TEXT_NODE?r.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):r.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===f.value||!f.value.contains(c))return;const d=()=>{let vn="",cn=0,gn=!1;const dn=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Un=>Un.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let mn=0;for(;dn.nextNode();){const Un=dn.currentNode,rl=Un.textContent||"",fl=mn;if(mn+=rl.length,Un===r.startContainer){vn+=rl.substring(0,r.startOffset),cn=fl+r.startOffset,gn=!0;break}vn+=rl}return gn||(cn=vn.length),{textBeforeCursor:vn,cursorCharOffset:cn}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,v=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?v="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?v="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(v=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const k=m[0],_=m[1],D=u.length-k.length,re=(vn=>{let cn=0;const gn=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:mn=>mn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let dn;for(;dn=gn.nextNode();){const mn=(dn.textContent||"").length;if(cn+mn>=vn)return{node:dn,offset:vn-cn};cn+=mn}return null})(D);if(!re)return;const j=document.createRange();j.setStart(re.node,re.offset),j.setEnd(r.endContainer,r.endOffset);const Ie=document.createElement(v);Ie.textContent=_,j.deleteContents(),j.insertNode(Ie);const Ve=window.getSelection(),nt=document.createRange();nt.setStartAfter(Ie),nt.collapse(!0),Ve.removeAllRanges(),Ve.addRange(nt);const Cn=Jt();e.nextTick(()=>{ce(),Cn&&sn(Cn)})},mo=()=>{f.value&&(Ut.value=Jt(),It.value="",Ot.value="",Xe.value="",oe.value="",fe.value="",tn.value=null,kt.value=null,Be.value="upload",xt.value=!0,un(),e.nextTick(()=>{Fe.value&&Fe.value.focus(),De.value&&(De.value.value="")}))},Qn=o=>{const l=o.target?.files?.[0];if(!l){tn.value=null,Ot.value="";return}tn.value=l;const s=new FileReader;s.onload=r=>{Ot.value=r.target?.result||""},s.readAsDataURL(l)},Jn=()=>{De.value&&De.value.click()},jl=()=>{oe.value&&(fe.value="")},po=()=>{fe.value&&(oe.value="")},Mo=()=>{let o=kt.value;if(!o){const l=window.getSelection();if(l&&l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(o){const l=o.getAttribute("data-alt")||o.getAttribute("alt")||"";kt.value=o,It.value=l.trim()===""||l.trim()==="Image"?"":l;const s=o.getAttribute("src")||o.src||"";s.startsWith("http://")||s.startsWith("https://")?(Xe.value=s,Ot.value="",Be.value="url"):(Ot.value=s,Xe.value="",Be.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";oe.value=c.endsWith("px")?c.replace("px",""):c,fe.value=d.endsWith("px")?d.replace("px",""):d,Ut.value=null}else{mo();return}xt.value=!0,he.value=!1,St.value=!1,e.nextTick(()=>{Be.value==="url"&&Zt.value?(Zt.value.focus(),Zt.value.select()):Fe.value&&(Fe.value.focus(),Fe.value.select()),De.value&&(De.value.value="")})},Ml=()=>{xt.value=!1,It.value="",Ot.value="",Xe.value="",oe.value="",fe.value="",tn.value=null,kt.value=null,Ut.value=null,Be.value="upload"},Tn=()=>{const o=(It.value||"").trim(),l=f.value?._mutationObserver;l&&l.disconnect(),$e.value?(Ze.value&&(clearTimeout(Ze.value),Ze.value=null),ot(),$e.value=!1):ot();const s=Be.value==="url"?Xe.value.trim():Ot.value;if(kt.value&&f.value&&f.value.contains(kt.value)){s&&(kt.value.src=s),kt.value.setAttribute("alt",o),kt.value.setAttribute("data-alt",o),oe.value?(kt.value.style.width=`${oe.value}px`,kt.value.setAttribute("width",oe.value)):(kt.value.style.removeProperty("width"),kt.value.removeAttribute("width")),fe.value?(kt.value.style.height=`${fe.value}px`,kt.value.setAttribute("height",fe.value)):(kt.value.style.removeProperty("height"),kt.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(kt.value),c.collapse(!0),r.addRange(c)}ce()}else{if(!s){l&&f.value&&l.observe(f.value,{childList:!0,subtree:!0}),Ml();return}if(f.value){f.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(Ut.value&&(sn(Ut.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){Ml();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!f.value.contains(m)){if(d=document.createRange(),f.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",f.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const v=document.createElement("img");v.src=s,v.setAttribute("alt",o),v.setAttribute("data-alt",o),oe.value&&(v.style.width=`${oe.value}px`,v.setAttribute("width",oe.value)),fe.value&&(v.style.height=`${fe.value}px`,v.setAttribute("height",fe.value));try{d.insertNode(v),d.setStartAfter(v),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(f.value){if(f.value.childNodes.length===0){const D=document.createElement("p");f.value.appendChild(D),D.appendChild(v)}else{const D=f.value.lastChild;if(D&&D.nodeType===1)D.appendChild(v);else{const E=document.createElement("p");f.value.appendChild(E),E.appendChild(v)}}const _=document.createRange();_.setStartAfter(v),_.collapse(!0),c&&(c.removeAllRanges(),c.addRange(_))}}kt.value=v,ce()}}e.nextTick(()=>{l&&f.value&&l.observe(f.value,{childList:!0,subtree:!0}),fn(),ln(),Ml()})};e.watch(()=>A.modelValue,o=>{if(A.richText&&f.value&&!Q.value){const l=Hn(o||""),r=f.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=l.replace(/&nbsp;|\u00A0/g," ");if(r!==c){const d=Jt();f.value.innerHTML=l,e.nextTick(()=>{yt();const u=f.value.innerHTML||"",m=A.title||"",v=A.description||"";rt.value=u,ee.value=m,Z.value=v,Vt.value=u,X.value=m,pe.value=v,Qe.value=[],zt.value=[],Ze.value&&(clearTimeout(Ze.value),Ze.value=null),$e.value=!1,d&&sn(d),Bn(),pn(),Te(),fn(),ln(),bt(),wn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>A.richText,o=>{o?(ln(),e.nextTick(()=>{go()})):(Rl(),ae.value=[],We.value&&(We.value.disconnect(),We.value=null)),bt()}),e.watch(()=>A.floatingToolbar,o=>{o?ln():Rl()}),e.watch(()=>A.disabled,o=>{o&&Rl(),bt()}),e.watch(()=>A.description,()=>{e.nextTick(()=>{S.value?cl():Kn()})}),e.watch(()=>A.title,()=>{e.nextTick(()=>{Gt.value?Rn():Ll()})}),e.watch(()=>A.customToolbarSlots,()=>{e.nextTick(()=>{en()})},{deep:!0}),e.watch(()=>A.comments,(o,l)=>{if(ft.value){ft.value=!1;return}Ht.value||A.richText&&f.value&&e.nextTick(()=>{Vn()})},{deep:!0,immediate:!1});const Vn=()=>{if(!Ht.value&&!(!A.comments||!Array.isArray(A.comments)||A.comments.length===0)&&!(!A.richText||!f.value)){Ht.value=!0;try{const o=new Set,l=A.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),s=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=s.length;s.forEach(u=>{const m=u.parentNode;if(m){for(;u.firstChild;)m.insertBefore(u.firstChild,u);m.removeChild(u)}});let c=0;const d=new Set;l.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const m=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!m)return;const v=String(m);if(d.has(v))return;const k=f.value.querySelector(`[data-comment="${v}"]`);if(k){Kt(k,u),d.add(v);return}try{const _=Xo(u.selection_range,u.selection_text);if(_&&!_.collapsed){const D=_.commonAncestorContainer,E=D.nodeType===3?D.parentElement:D;if(E){const Ie=E.closest("[data-comment], [data-fake-comment]");if(Ie){const Ve=Ie.getAttribute("data-comment")||Ie.getAttribute("data-fake-comment");if(String(Ve)===String(m)){Ie.setAttribute("data-comment",v),Ie.removeAttribute("data-fake-comment"),Kt(Ie,u),d.add(v);return}else return}}const re=f.value.querySelector(`[data-comment="${v}"]`);if(re){Kt(re,u),d.add(v);return}const j=document.createElement("span");j.setAttribute("data-comment",v),Kt(j,u);try{_.surroundContents(j),c++,d.add(v)}catch{try{const Ve=document.createRange();Ve.setStart(_.startContainer,_.startOffset),Ve.setEnd(_.endContainer,_.endOffset),fo(Ve),Ve.surroundContents(j),c++,d.add(v)}catch{try{const nt=_.extractContents();j.appendChild(nt),_.insertNode(j),c++,d.add(v)}catch(nt){console.warn("Failed to create comment marker:",nt)}}}}}catch{}}),e.nextTick(()=>{wn("restoreCommentsFromModel"),ce(),Ht.value=!1})}catch{Ht.value=!1}}},fo=o=>{if(!o||!f.value)return o;try{const l=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let s=o.startContainer,r=o.startOffset;if(s.nodeType===3){const u=s.parentElement;u&&l.includes(u.tagName)&&(r===0&&!Xt(s)||o.setStartBefore(u))}else s.nodeType===1&&l.includes(s.tagName)&&r>0&&o.setStartBefore(s);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&l.includes(u.tagName)&&(d===c.length&&!_o(c)||o.setEndAfter(u))}else c.nodeType===1&&l.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},Xt=o=>{let l=o.previousSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.previousSibling}return!1},_o=o=>{let l=o.nextSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.nextSibling}return!1},Xo=(o,l)=>{if(!o||!f.value)return null;try{const s=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(s.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(s.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}return u?fo(s):null}}catch{return null}return null},Kt=(o,l)=>{if(!o||!l)return;const s=l.conversation||[],r=new Set,c=[],d=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),c.push(m))};s.length>0&&s.forEach(m=>{m.user&&d(m.user)}),c.length>0?o.setAttribute("data-comment-user",JSON.stringify(c[0])):o.removeAttribute("data-comment-user"),c.length>1?o.setAttribute("data-comment-user-2",JSON.stringify(c[1])):o.removeAttribute("data-comment-user-2");const u=s.length;u>0?o.setAttribute("data-comment-count",String(u)):o.removeAttribute("data-comment-count")},wn=(o="unknown")=>{if(!A.richText||!f.value){ae.value=[];return}Date.now()-Bt.value<Mt&&ht.value!==null||ht.value===null&&(ht.value=requestAnimationFrame(()=>{if(ht.value=null,Bt.value=Date.now(),qe.value)return;qe.value=!0;const s={},r=f.value;if(!r){qe.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){qe.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(E=>{const re=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");re&&E.tagName==="SPAN"&&(m.has(re)||(u.push(E),m.add(re)))}),d.forEach(E=>{const re=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");!re||m.has(re)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(E.tagName)?E.querySelector(`span[data-comment="${re}"], span[data-fake-comment="${re}"]`)||(u.push(E),m.add(re)):E.tagName!=="SPAN"&&(u.push(E),m.add(re)))});const v=c.getBoundingClientRect(),k=r.getBoundingClientRect();u.forEach((E,re)=>{let j=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");if(!j)return;if(typeof j=="string"&&j.startsWith("comment-")){const il=E.textContent?.trim(),el=A.comments?.find(Xn=>(typeof Xn.conversation_id=="string"&&Xn.conversation_id.startsWith("comment-")?null:Xn.conversation_id)&&Xn.selection_text?.trim()===il);el?(j=String(el.conversation_id),E.setAttribute("data-comment",j),E.removeAttribute("data-fake-comment")):(j=String(Date.now()),E.setAttribute("data-comment",j),E.removeAttribute("data-fake-comment"))}const Ie=E.getBoundingClientRect(),Ve=window.getComputedStyle(E),nt=parseFloat(Ve.lineHeight)||parseFloat(Ve.fontSize)*1.2,cn=Ie.top-k.top+nt/2-15,dn=k.top-v.top+cn;let mn=null,Un=null,rl=0;const fl=[],ho=new Set;if(j&&A.comments){const il=A.comments.find(el=>String(el.conversation_id||el.id)===String(j));if(il){const el=il.conversation||[];el.length>0?(el.forEach(Xn=>{Xn.user&&Xn.user.id&&!ho.has(Xn.user.id)&&(ho.add(Xn.user.id),fl.push(Xn.user))}),rl=el.length):(rl=0,mn=null,Un=null),fl.length>0?mn=fl[0]:mn=null,fl.length>1?Un=fl[1]:Un=null}}const To=Ie.top+nt/2-15,Yo=To+30,wl=5,yo=Yo>k.top+wl&&To<k.bottom-wl?1:0;ae.value.find(il=>il.id===j);let Kl=E;if(!Kl&&j&&f.value){const il=String(j);Kl=f.value.querySelector(`[data-comment="${il}"], [data-fake-comment="${il}"]`)}const Ao=fl.length;s[j]?(s[j].top=dn,s[j].opacity=yo,s[j].element=Kl,s[j].firstUser=mn,s[j].secondUser=Un,s[j].totalCount=rl,s[j].uniqueUserCount=Ao):s[j]={id:j,top:dn,opacity:yo,element:Kl,firstUser:mn,secondUser:Un,totalCount:rl,uniqueUserCount:Ao}});const _=Object.values(s).map(E=>{const re=Math.max(0,(E.uniqueUserCount??0)-2);if(!E.element&&E.id&&f.value){const Ie=String(E.id);E.element=f.value.querySelector(`[data-comment="${Ie}"], [data-fake-comment="${Ie}"]`)}return{...E,firstUser:E.firstUser||null,secondUser:E.secondUser||null,totalCount:E.totalCount,additionalCount:re}});(ae.value.length!==_.length||_.some((E,re)=>{const j=ae.value[re];if(!j)return!0;const Ie=(j.firstUser?.id||null)!==(E.firstUser?.id||null),Ve=(j.secondUser?.id||null)!==(E.secondUser?.id||null);return j.id!==E.id||Math.abs(j.top-E.top)>1||j.opacity!==E.opacity||j.totalCount!==E.totalCount||j.additionalCount!==E.additionalCount||Ie||Ve||j.element!==E.element}))&&(ae.value=_),qe.value=!1}))},$o=o=>{if(!o)return;let l=o.element;if(!l&&o.id&&f.value){const s=String(o.id);l=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}l&&(xn(),qn.value=l,l.classList.add("editor-comment-highlighted"))},xn=(o=!1)=>{!o&&Lt.value!==null&&qn.value&&(qn.value.getAttribute("data-comment")||qn.value.getAttribute("data-fake-comment"))===Lt.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),qn.value&&(qn.value.classList.remove("editor-comment-highlighted"),qn.value=null))},vo=o=>{if(!o||!o.element)return;xn(!0);const l=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!l)return;const s=`[data-comment="${l}"], [data-fake-comment="${l}"]`;ve("comment-marker-clicked",{commentId:l,selector:s,element:o.element})},_l=()=>{xn()},go=()=>{!A.richText||!f.value||(We.value&&We.value.disconnect(),Et.value!==null&&(clearTimeout(Et.value),Et.value=null),We.value=new MutationObserver(()=>{Et.value===null&&(Et.value=setTimeout(()=>{Et.value=null,e.nextTick(()=>{wn("MutationObserver")})},200))}),We.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"]}),wn("setupCommentMarkersObserver-initial"))},Lo=(o,l)=>{if(!o||!l)return;const s=l.getBoundingClientRect();let r=s.top,c=s.right+4;o.style.top=`${r}px`,o.style.left=`${c}px`,o.offsetHeight;const d=o.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const v=s.left-d.width-4;o.style.left=`${v}px`}if(d.bottom>m){const v=Math.max(8,m-d.height-8);o.style.top=`${v}px`}d.top<0&&(o.style.top="8px")};return e.watch(()=>Ge.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const r=s.getAttribute("data-submenu-id");if(r===o&&o){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(c){if(s.parentNode!==document.body){const d=s.parentNode;s.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(s)}s.style.display="block",s.style.visibility="hidden",s.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{Lo(s,c),s.offsetHeight,s.setAttribute("data-active","true"),s.style.visibility="visible",s.style.opacity="1"})})}else s.setAttribute("data-active","true")}else s.setAttribute("data-active","false"),s.style.display="none",s.style.top="",s.style.left="",s.style.visibility="",s.style.opacity=""})})}),e.watch(()=>[be.value,lt.value],()=>{be.value==="askAi"||lt.value==="askAi"?e.nextTick(()=>{kn()}):(Ge.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(l=>{if(l.parentNode===document.body){const s=l.getAttribute("data-submenu-id");if(s){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(r)if(l.dataset.originalParentRef==="inside")r.appendChild(l);else{const d=r.closest(".dss-toolbar-dropdown");d&&d.insertBefore(l,r.nextSibling)}}}})}))}),e.watch(()=>A.locale,o=>{o&&o!==de.value&&(de.value=o)},{immediate:!0}),le({openCommentOverlayForSelector:Eo,updateCommentMarkers:wn,restoreCommentsFromModel:Vn}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",wt.value]),style:e.normalizeStyle(At.value)},[T.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Lu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:gt,title:e.unref(L)("textEditor.toolbar.undo")},[...l[45]||(l[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Tu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!En.value}]),onClick:se,title:e.unref(L)("textEditor.toolbar.redo")},[...l[46]||(l[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,Au),l[61]||(l[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Du,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=s=>Fn("paragraph")),title:e.unref(L)("textEditor.toolbar.paragraphFormat")},[V.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Ru)):V.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Fu)):V.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Iu)):V.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,zu)):V.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Pu)):V.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Ou)):(e.openBlock(),e.createElementBlock("svg",Wu,[...l[47]||(l[47]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[48]||(l[48]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Hu),be.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[8]||(l[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[1]||(l[1]=s=>In("<h1>"))},[e.createElementVNode("img",{src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,qu),e.createElementVNode("h1",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[2]||(l[2]=s=>In("<h2>"))},[e.createElementVNode("img",{src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Zu),e.createElementVNode("h2",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[3]||(l[3]=s=>In("<h3>"))},[e.createElementVNode("img",{src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Uu),e.createElementVNode("h3",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[4]||(l[4]=s=>In("<h4>"))},[e.createElementVNode("img",{src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Xu),e.createElementVNode("h4",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[5]||(l[5]=s=>In("<h5>"))},[e.createElementVNode("img",{src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Yu),e.createElementVNode("h5",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[6]||(l[6]=s=>In("<h6>"))},[e.createElementVNode("img",{src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,ju),e.createElementVNode("h6",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[7]||(l[7]=s=>In("<p>"))},[l[49]||(l[49]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":nn("bold")}]),onClick:l[9]||(l[9]=s=>Nn("bold")),title:e.unref(L)("textEditor.toolbar.bold")},[...l[50]||(l[50]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,Ku),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":nn("italic")}]),onClick:l[10]||(l[10]=s=>Nn("italic")),title:e.unref(L)("textEditor.toolbar.italic")},[...l[51]||(l[51]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,Gu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":nn("underline")}]),onClick:l[11]||(l[11]=s=>Nn("underline")),title:e.unref(L)("textEditor.toolbar.underline")},[...l[52]||(l[52]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Qu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ke.value}]),onClick:Vl,title:e.unref(L)("textEditor.toolbar.citation")},[...l[53]||(l[53]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,Ju),l[62]||(l[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:Zl,title:e.unref(L)("textEditor.toolbar.removeLink")},[...l[55]||(l[55]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,td)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:ql,title:e.unref(L)("textEditor.toolbar.insertLink")},[...l[54]||(l[54]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,ed)),l[63]||(l[63]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":nn("insertUnorderedList")}]),onClick:ll,title:e.unref(L)("textEditor.toolbar.bulletList")},[...l[56]||(l[56]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,nd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":nn("insertOrderedList")}]),onClick:Al,title:e.unref(L)("textEditor.toolbar.numberList")},[...l[57]||(l[57]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,ld),l[64]||(l[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:mo,title:e.unref(L)("textEditor.toolbar.image")},[...l[58]||(l[58]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,od),Y.value?(e.openBlock(),e.createElementBlock("div",ad)):e.createCommentVNode("",!0),Y.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(L)("textEditor.toolbar.comment"),onClick:Ln},[...l[59]||(l[59]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,sd)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",rd)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",id,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=s=>Fn("askAi")),title:e.unref(L)("textEditor.toolbar.askAi")},[l[60]||(l[60]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",ud,e.toDisplayString(e.unref(L)("textEditor.toolbar.askAi")),1)],8,cd),be.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[13]||(l[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",dd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.customToolbarSlots,(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[ne(s)?(e.openBlock(),e.createElementBlock("div",md,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),ne(s)&&r<T.customToolbarSlots.length-1&&Le(r)?(e.openBlock(),e.createElementBlock("div",pd)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(be.value==="paragraph"||be.value==="askAi")&&T.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:un})):e.createCommentVNode("",!0),e.createVNode(Jo,{showModal:He.value,width:"500px",height:"55vh",onCloseModal:zl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(L)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",fd,[e.createElementVNode("div",vd,[e.createElementVNode("label",gd,e.toDisplayString(e.unref(L)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Ue,type:"text","onUpdate:modelValue":l[15]||(l[15]=s=>vt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.link.enterAltText"),onKeyup:e.withKeys(uo,["enter"])},null,40,hd),[[e.vModelText,vt.value]])]),e.createElementVNode("div",yd,[e.createElementVNode("label",kd,e.toDisplayString(e.unref(L)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:q,type:"text","onUpdate:modelValue":l[16]||(l[16]=s=>et.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.link.enterUrl"),onKeyup:e.withKeys(uo,["enter"])},null,40,Cd),[[e.vModelText,et.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:zl},e.toDisplayString(e.unref(L)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:uo},e.toDisplayString(e.unref(L)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Jo,{showModal:xt.value,width:"500px",height:"80vh",onCloseModal:Ml},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(kt.value?e.unref(L)("textEditor.image.editImage"):e.unref(L)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",bd,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Be.value==="upload"}]),onClick:l[17]||(l[17]=s=>Be.value="upload")},e.toDisplayString(e.unref(L)("textEditor.image.upload")),3),l[65]||(l[65]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Be.value==="url"}]),onClick:l[18]||(l[18]=s=>Be.value="url")},e.toDisplayString(e.unref(L)("textEditor.image.imageLink")),3)]),Be.value==="upload"?(e.openBlock(),e.createElementBlock("div",wd,[e.createElementVNode("div",xd,[e.createElementVNode("div",Ed,[tl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Sd,e.toDisplayString(e.unref(L)("textEditor.image.uploadImage")),1)),tl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Jn},[e.createElementVNode("img",{src:Ot.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Vd),l[66]||(l[66]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:De,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Qn},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:De,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Qn},null,544))]),e.createElementVNode("div",Nd,[e.createElementVNode("label",Bd,e.toDisplayString(e.unref(L)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Fe,type:"text","onUpdate:modelValue":l[19]||(l[19]=s=>It.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Tn,["enter"])},null,40,Md),[[e.vModelText,It.value]])]),e.createElementVNode("div",_d,[e.createElementVNode("label",$d,e.toDisplayString(e.unref(L)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=s=>oe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(Tn,["enter"]),onInput:jl},null,40,Ld),[[e.vModelText,oe.value]])]),e.createElementVNode("div",Td,[e.createElementVNode("label",Ad,e.toDisplayString(e.unref(L)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=s=>fe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(Tn,["enter"]),onInput:po},null,40,Dd),[[e.vModelText,fe.value]])])])])):e.createCommentVNode("",!0),Be.value==="url"?(e.openBlock(),e.createElementBlock("div",Hd,[e.createElementVNode("div",Rd,[e.createElementVNode("div",Fd,[e.createElementVNode("label",Id,e.toDisplayString(e.unref(L)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Zt,type:"text","onUpdate:modelValue":l[22]||(l[22]=s=>Xe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(Tn,["enter"])},null,40,zd),[[e.vModelText,Xe.value]])]),e.createElementVNode("div",Pd,[e.createElementVNode("label",Od,e.toDisplayString(e.unref(L)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=s=>It.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Tn,["enter"])},null,40,Wd),[[e.vModelText,It.value]])]),e.createElementVNode("div",qd,[e.createElementVNode("label",Zd,e.toDisplayString(e.unref(L)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=s=>oe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(Tn,["enter"]),onInput:jl},null,40,Ud),[[e.vModelText,oe.value]])]),e.createElementVNode("div",Xd,[e.createElementVNode("label",Yd,e.toDisplayString(e.unref(L)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=s=>fe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(Tn,["enter"]),onInput:po},null,40,jd),[[e.vModelText,fe.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Ml},e.toDisplayString(e.unref(L)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Tn},e.toDisplayString(e.unref(L)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":mt.value&&Gt.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.labels.title")),1),e.createElementVNode("div",Kd,[Gt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Gd,[T.title?(e.openBlock(),e.createElementBlock("span",Qd,e.toDisplayString(T.title),1)):(e.openBlock(),e.createElementBlock("span",Jd,e.toDisplayString(R.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:ke,value:T.title,onInput:Wl,onFocus:lo,onBlur:Ol,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Gt.value}]),placeholder:R.value,disabled:T.disabled,rows:"1"},null,42,e1)])],2),mt.value&&Gt.value?(e.openBlock(),e.createElementBlock("div",t1,[e.renderSlot(o.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":an.value&&S.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.labels.description")),1),e.createElementVNode("div",n1,[S.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",l1,[T.description?(e.openBlock(),e.createElementBlock("span",o1,e.toDisplayString(T.description),1)):(e.openBlock(),e.createElementBlock("span",a1,e.toDisplayString(O.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Ye,value:T.description,onInput:yn,onFocus:Sl,onBlur:oo,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!S.value}]),placeholder:O.value,disabled:T.disabled,rows:"1"},null,42,s1)])],2),an.value&&S.value?(e.openBlock(),e.createElementBlock("div",r1,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":Lt.value===s.id,"editor-comment-marker-group-out-of-view":s.opacity===0}]),"data-comment-id":s.id,style:e.normalizeStyle({top:s.top+"px"}),onMouseenter:r=>$o(s),onMouseleave:_l},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>vo(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,u1)):(e.openBlock(),e.createElementBlock("span",d1,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,c1)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>vo(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,p1)):(e.openBlock(),e.createElementBlock("span",f1,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,m1)):e.createCommentVNode("",!0),s.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:s.secondUser?"30px":"15px"}),"data-has-second-user":s.secondUser?"true":"false",onClick:e.withModifiers(r=>vo(s),["stop"])},[e.createElementVNode("span",g1,"+"+e.toDisplayString(s.additionalCount),1)],12,v1)):e.createCommentVNode("",!0)],46,i1))),128)),T.richText?(e.openBlock(),e.createElementBlock("div",x1,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":T.disabled,"dss-text-editor-fixed-height":T.fixedHeight}]),style:e.normalizeStyle(bn.value),onInput:ce,onBlur:at,onClick:yl,onMouseup:Rt,onKeyup:Rt,onKeydown:co,onPaste:qo,onMousemove:Zo,onMouseleave:bl},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[Lt.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(ol.value)},[x.value||ie.value.length>0?(e.openBlock(),e.createElementBlock("div",E1,[e.createElementVNode("div",S1,[x.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:x.value},null,8,V1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",N1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ie.value,(s,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:"dss-comment-message"},[s.user&&(s.user.avatar||s.user.initials||s.user.name)?(e.openBlock(),e.createElementBlock("div",B1,[e.createElementVNode("div",M1,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,_1)):(e.openBlock(),e.createElementBlock("span",$1,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",L1,[e.createElementVNode("div",T1,[e.createElementVNode("div",A1,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",D1,e.toDisplayString(gl(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":El(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),A.commentUser&&s.user&&s.user.id===A.commentUser.id&&!El(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>hl(s,r),["stop"]),title:e.unref(L)("textEditor.comment.delete")||"Delete comment"},[...l[68]||(l[68]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,H1)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",R1,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:h,"onUpdate:modelValue":l[26]||(l[26]=s=>y.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(L)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Pn,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(h.value){const s=h.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,F1),[[e.vModelText,y.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Pn,["stop"])},[...l[69]||(l[69]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",I1,[e.createElementVNode("div",z1,[e.createElementVNode("span",P1,e.toDisplayString(Dt.value)+" "+e.toDisplayString(Dt.value===1?e.unref(L)("textEditor.footer.word"):e.unref(L)("textEditor.footer.words")),1),l[70]||(l[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",O1,e.toDisplayString(Qt.value)+" "+e.toDisplayString(Qt.value===1?e.unref(L)("textEditor.footer.character"):e.unref(L)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",h1,[e.createElementVNode("textarea",{value:T.modelValue,onInput:Pl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":T.fixedHeight}]),placeholder:F.value,rows:T.rows,disabled:T.disabled,style:e.normalizeStyle(_t.value)},null,46,y1),e.createElementVNode("div",k1,[e.createElementVNode("div",C1,[e.createElementVNode("span",b1,e.toDisplayString(Dt.value)+" "+e.toDisplayString(Dt.value===1?e.unref(L)("textEditor.footer.word"):e.unref(L)("textEditor.footer.words")),1),l[67]||(l[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",w1,e.toDisplayString(Qt.value)+" "+e.toDisplayString(Qt.value===1?e.unref(L)("textEditor.footer.character"):e.unref(L)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[U.value&&me.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(H.value),onMouseenter:l[28]||(l[28]=s=>xe.value=!0),onMouseleave:Bl},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Il,["stop"]),title:me.value},e.toDisplayString(me.value),9,W1),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Uo,["stop"]),title:e.unref(L)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Z1,[...l[71]||(l[71]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,q1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[St.value&&Wt.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(G.value),onMouseenter:l[29]||(l[29]=s=>he.value=!0),onMouseleave:Fl},[e.createElementVNode("div",U1,[Wt.value===e.unref(L)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",X1,[...l[72]||(l[72]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:Wt.value},e.toDisplayString(Wt.value),9,Y1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Mo,["stop"]),title:e.unref(L)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",K1,[...l[73]||(l[73]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,j1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.floatingToolbar&&T.richText&&ze.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:st,class:"dss-floating-toolbar",style:e.normalizeStyle(we.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",G1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(gt,["stop"]),title:e.unref(L)("textEditor.toolbar.undo")},[...l[74]||(l[74]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Q1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!En.value}]),onClick:e.withModifiers(se,["stop"]),title:e.unref(L)("textEditor.toolbar.redo")},[...l[75]||(l[75]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,J1),l[89]||(l[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",em,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(s=>Nl("paragraph"),["stop"])),title:e.unref(L)("textEditor.toolbar.paragraphFormat")},[V.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,nm)):V.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,lm)):V.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,om)):V.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,am)):V.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,sm)):V.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,rm)):(e.openBlock(),e.createElementBlock("svg",im,[...l[76]||(l[76]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[77]||(l[77]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,tm),lt.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[38]||(l[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[31]||(l[31]=s=>zn("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[32]||(l[32]=s=>zn("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[33]||(l[33]=s=>zn("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[34]||(l[34]=s=>zn("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[35]||(l[35]=s=>zn("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[36]||(l[36]=s=>zn("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[37]||(l[37]=s=>zn("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),l[90]||(l[90]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":nn("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(s=>Nn("bold"),["stop"])),title:e.unref(L)("textEditor.toolbar.bold")},[...l[78]||(l[78]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,cm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":nn("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(s=>Nn("italic"),["stop"])),title:e.unref(L)("textEditor.toolbar.italic")},[...l[79]||(l[79]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,um),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":nn("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(s=>Nn("underline"),["stop"])),title:e.unref(L)("textEditor.toolbar.underline")},[...l[80]||(l[80]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,dm),l[91]||(l[91]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ke.value}]),onClick:e.withModifiers(Vl,["stop"]),title:e.unref(L)("textEditor.toolbar.citation")},[...l[81]||(l[81]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,mm),l[92]||(l[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(Zl,["stop"]),title:e.unref(L)("textEditor.toolbar.removeLink")},[...l[83]||(l[83]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,fm)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(ql,["stop"]),title:e.unref(L)("textEditor.toolbar.insertLink")},[...l[82]||(l[82]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,pm)),l[93]||(l[93]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":nn("insertUnorderedList")}]),onClick:e.withModifiers(ll,["stop"]),title:e.unref(L)("textEditor.toolbar.bulletList")},[...l[84]||(l[84]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,vm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":nn("insertOrderedList")}]),onClick:e.withModifiers(Al,["stop"]),title:e.unref(L)("textEditor.toolbar.numberList")},[...l[85]||(l[85]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,gm),l[94]||(l[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(mo,["stop"]),title:e.unref(L)("textEditor.toolbar.image")},[...l[86]||(l[86]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,hm),l[95]||(l[95]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(L)("textEditor.toolbar.comment"),onClick:e.withModifiers(Ln,["stop"])},[...l[87]||(l[87]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,ym),T.askAi?(e.openBlock(),e.createElementBlock("div",km)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",Cm,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(s=>Nl("askAi"),["stop"])),title:e.unref(L)("textEditor.toolbar.askAi")},[l[88]||(l[88]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",wm,e.toDisplayString(e.unref(L)("textEditor.toolbar.askAi")),1)],8,bm),lt.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[43]||(l[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),tt.value?(e.openBlock(),e.createElementBlock("div",xm,[T.askAi&&tt.value?(e.openBlock(),e.createElementBlock("div",Em)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.customToolbarSlots,(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[ne(s)&&ct(s)?(e.openBlock(),e.createElementBlock("div",Sm,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),ne(s)&&ct(s)&&r<T.customToolbarSlots.length-1&&dt(r)?(e.openBlock(),e.createElementBlock("div",Vm)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Mm={class:"dss-color-picker__section-title"},_m={class:"dss-color-picker__presets-row"},$m=["title","onClick"],Lm={key:1,class:"dss-color-picker__section"},Tm={class:"dss-color-picker__presets-row"},Am=["title","onClick"],Dm={key:2,class:"dss-color-picker__section"},Hm={class:"dss-color-picker__section-header"},Rm={class:"dss-color-picker__presets-row"},Fm=["title","onClick"],Im=["onClick"],zm={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},Pm=["title","onClick"],Om={class:"dss-color-picker__input-row"},Wm=["value"],qm={__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(T,{emit:le}){function M(ee){const Z=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(ee);if(!Z)return{h:0,s:0,l:50};const X=parseInt(Z[1],16)/255,pe=parseInt(Z[2],16)/255,ke=parseInt(Z[3],16)/255,Ye=Math.max(X,pe,ke),Nt=Math.min(X,pe,ke);let on=0,Ct=0;const Gt=(Ye+Nt)/2;if(Ye!==Nt){const S=Ye-Nt;switch(Ct=Gt>.5?S/(2-Ye-Nt):S/(Ye+Nt),Ye){case X:on=((pe-ke)/S+(pe<ke?6:0))/6;break;case pe:on=((ke-X)/S+2)/6;break;case ke:on=((X-pe)/S+4)/6;break}}return{h:on*360,s:Ct*100,l:Gt*100}}function L(ee,Z,X){Z/=100,X/=100;const pe=Z*Math.min(X,1-X),ke=Ye=>{const Nt=(Ye+ee/30)%12,on=X-pe*Math.max(Math.min(Nt-3,9-Nt,1),-1);return Math.round(255*on).toString(16).padStart(2,"0")};return`#${ke(0)}${ke(8)}${ke(4)}`}function de(ee){const Z=ee.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!Z)return null;let X=Z[1];return X.length===3&&(X=X.split("").map(pe=>pe+pe).join("")),"#"+X}function z(ee){const Z=ee.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!Z)return null;const X=Math.max(0,Math.min(255,Number.parseInt(Z[1],10))),pe=Math.max(0,Math.min(255,Number.parseInt(Z[2],10))),ke=Math.max(0,Math.min(255,Number.parseInt(Z[3],10)));return`#${X.toString(16).padStart(2,"0")}${pe.toString(16).padStart(2,"0")}${ke.toString(16).padStart(2,"0")}`}function A(ee){if(typeof ee!="string")return null;const Z=ee.trim();return de(Z)||z(Z)}function ve(ee,Z,X){Z/=100,X/=100;const pe=X+Z*Math.min(X,1-X),ke=pe===0?0:2-2*X/pe;return{h:ee,s:ke*100,v:pe*100}}function pt(ee,Z,X){Z/=100,X/=100;const pe=X*(1-Z/2),ke=pe===0||pe===1?0:(X-pe)/Math.min(pe,1-pe);return{h:ee,s:ke*100,l:pe*100}}const J=T,f=le,be=e.ref(!1),Ce=e.ref(!1),Q=e.ref(!1),U=e.ref(-1),me=e.ref(-1),H=e.ref(null),xe=e.ref(null),He=e.ref(null),et=e.ref(null),vt=e.ref({top:0,left:0}),q=e.ref(M(J.modelValue||"#b8a5de")),Ue=e.computed(()=>Array.isArray(J.presetGroups)&&J.presetGroups.length>0),Pe=e.computed(()=>!J.disableCustomColors),Ee=e.computed(()=>Ue.value?0:J.initialPresetCount!=null?J.initialPresetCount:me.value<0?null:me.value),Me=e.computed(()=>{const ee=Ee.value;return ee==null?!0:Math.max(0,J.presetColors.length-ee)<J.max}),Ke=e.computed(()=>!!(Ce.value||U.value>=0||!K.value&&J.presetColors.length===0));e.computed(()=>{const ee=Ee.value;return ee!=null&&J.presetColors.length>ee});const K=e.computed(()=>Ue.value||Ee.value!=null),ze=e.computed(()=>{const ee=Ee.value;return ee==null?[]:J.presetColors.slice(0,ee)}),we=e.computed(()=>{const ee=Ee.value;return ee==null?[]:J.presetColors.slice(ee)});function st(ee){const Z=Ee.value;return Z!=null?Z+ee:-1}function lt(ee){const Z=Ee.value;return Z!=null&&ee>=Z}function xt(ee){lt(ee)&&(U.value=ee,q.value=M(J.presetColors[ee]),Ce.value=!0,e.nextTick(()=>et.value?.focus()))}function It(ee){if(!lt(ee))return;const Z=J.presetColors.filter((ke,Ye)=>Ye!==ee);f("update:presetColors",Z);const X=de(J.modelValue),pe=de(J.presetColors[ee]);if(X&&pe&&X.toLowerCase()===pe.toLowerCase()){const ke=Z[Math.max(0,ee-1)]||Z[0];ke&&f("update:modelValue",ke)}}function tn(){Q.value=!Q.value,Q.value||(U.value=-1,Ce.value=!1)}function Ot(){if(!Pe.value||U.value<0)return;const ee=De.value,Z=de(ee);if(Z){const X=[...J.presetColors];X[U.value]=Z,f("update:presetColors",X),f("update:modelValue",Z),U.value=-1,Ce.value=!1}}function oe(){J.disabled||!Pe.value||(U.value=-1,Ce.value=!Ce.value,Ce.value&&(he(),e.nextTick(()=>et.value?.focus())))}function fe(ee){const Z=A(ee),X=A(J.modelValue);return Z&&X&&Z.toLowerCase()===X.toLowerCase()}function Fe(){if(J.disabled||!Pe.value||!Me.value)return;const ee=De.value,Z=de(ee);if(Z){const X=[...J.presetColors,Z];f("update:presetColors",X),f("update:modelValue",Z);const pe=Ee.value??me.value;pe>=0&&X.length-pe>=J.max&&(Ce.value=!1)}}const De=e.computed(()=>{const{h:ee,s:Z,l:X}=q.value;return L(ee,Z,X)}),Zt=e.computed(()=>De.value.toLowerCase()),kt=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${q.value.h}, 100%, 50%))`})),Ut=e.computed(()=>{const ee=ve(q.value.h,q.value.s,q.value.l);return{left:`${ee.s}%`,bottom:`${ee.v}%`,transform:"translate(-50%, 50%)"}}),St=e.computed(()=>({left:`${q.value.h/360*100}%`,transform:"translateX(-50%)"})),Wt=e.computed(()=>({position:"fixed",left:`${vt.value.left}px`,top:`${vt.value.top}px`,zIndex:1002}));function G(){if(!H.value||!be.value)return;const ee=H.value.getBoundingClientRect(),Z=window.innerHeight||document.documentElement.clientHeight;let X=ee.bottom+4;const pe=xe.value;pe&&X+pe.offsetHeight>Z-8&&(X=ee.top-4-pe.offsetHeight),vt.value={top:X,left:ee.left}}function he(){const ee=J.modelValue||"#b8a5de",Z=A(ee);Z&&(q.value=M(Z))}function Be(){f("update:modelValue",De.value)}function Xe(){J.disabled||(be.value=!be.value,be.value&&(he(),e.nextTick(()=>{G(),et.value?.focus()})))}function Ge(){const ee=De.value,Z=de(ee);if(Z){if(U.value>=0){const X=[...J.presetColors];X[U.value]=Z,f("update:presetColors",X),f("update:modelValue",Z)}else if(Pe.value&&(J.presetColors.length>0||Ue.value)&&Ce.value&&Me.value&&!J.presetColors.some(pe=>de(pe)?.toLowerCase()===Z.toLowerCase())){const pe=[...J.presetColors,Z];f("update:presetColors",pe),f("update:modelValue",Z)}}be.value=!1,Ce.value=!1,Q.value=!1,U.value=-1}function Tt(ee){if(!He.value)return;const Z=He.value.getBoundingClientRect(),X=pe=>{const ke=Math.max(0,Math.min(1,(pe.clientX-Z.left)/Z.width)),Ye=Math.max(0,Math.min(1,1-(pe.clientY-Z.top)/Z.height)),Nt={h:q.value.h,s:ke*100,v:Ye*100};q.value=pt(Nt.h,Nt.s,Nt.v)};X(ee),document.addEventListener("mousemove",X),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",X),Be()},{once:!0})}function Qe(ee){if(!ee.currentTarget)return;const X=ee.currentTarget.getBoundingClientRect(),pe=ke=>{const Ye=Math.max(0,Math.min(1,(ke.clientX-X.left)/X.width));q.value={...q.value,h:Ye*360}};pe(ee),document.addEventListener("mousemove",pe),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",pe),Be()},{once:!0})}function zt(ee){const Z=ee.target.value,X=A(Z);X&&(q.value=M(X),f("update:modelValue",X))}function Ze(ee){if(J.disabled)return;const Z=A(ee);Z&&(q.value=M(Z),f("update:modelValue",Z))}let $e=null,rt=null;function Vt(){$e&&(document.removeEventListener("keydown",$e),$e=null),rt&&(window.removeEventListener("resize",rt),rt=null)}return e.watch(be,ee=>{if(Vt(),ee){if(!Ue.value&&J.initialPresetCount==null){const Z=J.presetColors.length;Z>0&&(me.value<0||Z<me.value)&&(me.value=Z)}$e=Z=>{Z.key==="Escape"&&Ge()},rt=G,document.addEventListener("keydown",$e),window.addEventListener("resize",rt)}}),e.watch(()=>J.modelValue,()=>{be.value&&he()},{immediate:!1}),e.watch(we,ee=>{ee.length===0&&(Q.value=!1,U.value=-1,Ce.value=!1)}),e.onBeforeUnmount(Vt),(ee,Z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":T.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:H,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":be.value}]),onClick:Xe},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:De.value})},[...Z[0]||(Z[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[be.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Ge,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:xe,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Wt.value)},[K.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Ue.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(T.presetGroups,(X,pe)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+pe,class:"dss-color-picker__section"},[e.createElementVNode("span",Mm,e.toDisplayString(X.title),1),e.createElementVNode("div",_m,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.colors,(ke,Ye)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+pe+"-"+Ye,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":fe(ke)}]),style:e.normalizeStyle({backgroundColor:ke,"--dss-preset-color":ke}),title:ke,onClick:e.withModifiers(Nt=>Ze(ke),["stop"])},null,14,$m))),128))])]))),128)):ze.value.length?(e.openBlock(),e.createElementBlock("div",Lm,[Z[1]||(Z[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",Tm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,(X,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":fe(X)}]),style:e.normalizeStyle({backgroundColor:X,"--dss-preset-color":X}),title:X,onClick:e.withModifiers(ke=>Ze(X),["stop"])},null,14,Am))),128))])])):e.createCommentVNode("",!0),Pe.value?(e.openBlock(),e.createElementBlock("div",Dm,[e.createElementVNode("div",Hm,[Z[3]||(Z[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),we.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__manage-icon",{"dss-color-picker__manage-icon--active":Q.value}]),title:"Manage custom colors",onClick:e.withModifiers(tn,["stop"])},[...Z[2]||(Z[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Rm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,(X,pe)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+pe,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":Q.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!Q.value&&fe(X),"dss-color-picker__preset-bubble--editing":Q.value&&U.value===st(pe)}]),style:e.normalizeStyle({backgroundColor:U.value===st(pe)?De.value:X,"--dss-preset-color":U.value===st(pe)?De.value:X}),title:U.value===st(pe)?De.value:X,onClick:e.withModifiers(ke=>Q.value?xt(st(pe)):Ze(X),["stop"])},null,14,Fm),Q.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__preset-action dss-color-picker__preset-action--delete",title:"Delete",onClick:e.withModifiers(ke=>It(st(pe)),["stop"])},[...Z[4]||(Z[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,Im)):e.createCommentVNode("",!0)],2))),128)),Me.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":Ce.value}]),onClick:e.withModifiers(oe,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):T.presetColors.length?(e.openBlock(),e.createElementBlock("div",zm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.presetColors,(X,pe)=>(e.openBlock(),e.createElementBlock("button",{key:pe,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":fe(X)}]),style:e.normalizeStyle({backgroundColor:X,"--dss-preset-color":X}),title:X,onClick:e.withModifiers(ke=>Ze(X),["stop"])},null,14,Pm))),128)),Pe.value&&Me.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":Ce.value}]),onClick:e.withModifiers(oe,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ke.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:He,onMousedown:Tt},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(kt.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Ut.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Qe},[Z[5]||(Z[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(St.value)},null,4)],32),e.createElementVNode("div",Om,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:et,type:"text",class:"dss-color-picker__hex-input",value:Zt.value,onInput:zt},null,40,Wm)]),Pe.value&&K.value&&(T.presetColors.length||Ue.value)&&Me.value&&U.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Fe}," Save color ")):e.createCommentVNode("",!0),Pe.value&&K.value&&U.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Ot}," Save color ")):e.createCommentVNode("",!0),K.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Ge}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},Zm={key:0,class:"dss-loader"},Um={key:0,class:"dss-loader-label"},Xm={key:1,class:"dss-loader"},Ym={key:0,class:"dss-loader-label"},jm={key:2,class:"dss-loader"},Km={key:0,class:"dss-loader-label"},Gm={key:3,class:"dss-loader"},Qm={key:0,class:"dss-loader-label"},Jm={key:4,class:"dss-loader"},e2={key:0,class:"dss-loader-label"},t2={key:5,class:"dss-loader dss-loader--inline"},n2={class:"dss-loader-inline-text"},l2={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(T){const le=T,M=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),L=e.computed(()=>{const de={};if(!(le.size==="small"||le.size==="medium"||le.size==="large"||le.size==null)){const z=typeof le.size=="number"?`${le.size}px`:String(le.size);de["--dss-loader-size"]=z}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,z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",M.value]),style:e.normalizeStyle(L.value)},[T.type==="spinner"?(e.openBlock(),e.createElementBlock("div",Zm,[z[0]||(z[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),T.label?(e.openBlock(),e.createElementBlock("span",Um,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="dots"?(e.openBlock(),e.createElementBlock("div",Xm,[z[1]||(z[1]=e.createElementVNode("span",{class:"dss-loader-dots","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"})],-1)),T.label?(e.openBlock(),e.createElementBlock("span",Ym,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="battery"?(e.openBlock(),e.createElementBlock("div",jm,[z[2]||(z[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),T.label?(e.openBlock(),e.createElementBlock("span",Km,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",Gm,[z[3]||(z[3]=e.createElementVNode("span",{class:"dss-loader-double-circle","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-double-circle-outer"}),e.createElementVNode("span",{class:"dss-loader-double-circle-inner"})],-1)),T.label?(e.openBlock(),e.createElementBlock("span",Qm,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="bars"?(e.openBlock(),e.createElementBlock("div",Jm,[z[4]||(z[4]=e.createElementVNode("span",{class:"dss-loader-bars","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"})],-1)),T.label?(e.openBlock(),e.createElementBlock("span",e2,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="inline"?(e.openBlock(),e.createElementBlock("div",t2,[z[5]||(z[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",n2,[e.renderSlot(de.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(T.label),1)])])])):e.createCommentVNode("",!0)],6))}},ia="dss-skeleton-item",o2={__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:T=>["single","multiple"].includes(T)},targetClass:{type:String,default:ia},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(T){const le=T,M=e.computed(()=>{const z={"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!==ia&&(z[`dss-skeleton--target-${le.targetClass}`]=!0),z}),L=e.computed(()=>{const z={};return le.borderRadius&&(z.borderRadius=le.borderRadius),z}),de=e.computed(()=>{const z={};return le.borderRadius&&(z["--dss-skeleton-border-radius"]=le.borderRadius),le.darkMode?(z["--dss-skeleton-bg"]=le.bgDark||"#322c3f",z["--dss-skeleton-shimmer"]=le.shimmerDark||"#3e3f41",z):(le.bgColor&&(z["--dss-skeleton-bg"]=le.bgColor),le.shimmerColor&&(z["--dss-skeleton-shimmer"]=le.shimmerColor),z)});return(z,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",M.value]),style:e.normalizeStyle(de.value)},[T.loading&&T.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(L.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":T.loading&&T.mode==="single"}])},[e.renderSlot(z.$slots,"default")],2)],6))}},a2={key:0,class:"dss-dnd-column-header"},s2={class:"dss-dnd-column-title"},r2={class:"dss-dnd-column-count"},i2=["data-column"],c2={key:0,class:"dss-dnd-indicator"},u2=["onPointerdown"],d2=["onPointerdown"],m2={class:"dss-dnd-item-content"},p2={class:"dss-dnd-item-default"},f2={key:0,class:"dss-dnd-empty"},v2={name:"DSSDnd"},g2=Object.assign(v2,{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(T,{emit:le}){const M=T,L=le,de=e.useSlots(),z=e.computed(()=>!!de["delete-zone"]),A={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1,ColColor:!1},ve=e.computed(()=>({...A,...M.options})),pt=e.computed(()=>({"--dss-dnd-col-min-w":ve.value.columnMinWidth,"--dss-dnd-col-max-w":ve.value.columnMaxWidth,"--dss-dnd-col-gap":ve.value.columnGap,"--dss-dnd-indicator-color":ve.value.indicatorColor,"--dss-dnd-body-max-h":ve.value.columnBodyMaxHeight}));function J(G){if(!ve.value.ColColor||!G)return{};const he=G.background||G.color;return he?{background:he}:{}}const f=e.ref(null),be=e.ref(null),Ce=e.ref(!1),Q=e.ref(-1),U=e.ref(null);let me=null,H=null,xe=null,He=null,et=0,vt=0,q="",Ue=null;const Pe=5,Ee=e.computed(()=>{const G={};for(const he of M.columns)G[he.value]=M.items.filter(Be=>Be[M.columnKey]===he.value).sort((Be,Xe)=>(Be[M.positionKey]??0)-(Xe[M.positionKey]??0));return G}),Me=e.computed(()=>{const G={},he=!!f.value,Be=f.value?.[M.itemKey],Xe=be.value,Ge=Q.value;for(const Tt of M.columns){const Qe=Ee.value[Tt.value]||[],zt=[],Ze=Xe==Tt.value;let $e=0;for(let rt=0;rt<Qe.length;rt++){const Vt=Qe[rt],ee=he&&Vt[M.itemKey]===Be;!ee&&Ze&&Ge===$e&&zt.push({type:"indicator",key:`ind-${$e}`}),ee||$e++,zt.push({type:"item",item:Vt,isDragged:ee,key:`item-${Vt[M.itemKey]}`})}Ze&&Ge>=$e&&zt.push({type:"indicator",key:"ind-end"}),G[Tt.value]=zt}return G});function Ke(G,he){const Xe=(Ee.value[G]||[]).filter(Qe=>Qe[M.itemKey]!==f.value?.[M.itemKey]);if(Xe.length===0)return 1;if(he<=0){const Qe=Xe[0][M.positionKey];return Qe!=null&&Qe>0?Qe/2:.5}if(he>=Xe.length){const Qe=Xe[Xe.length-1][M.positionKey];return(Qe??0)+1}const Ge=Xe[he-1][M.positionKey]??0,Tt=Xe[he][M.positionKey]??0;return(Ge+Tt)/2}function K(G,he,Be){xe&&xe.remove();const Xe=G.getBoundingClientRect(),Ge=G.cloneNode(!0);Ge.classList.add("dss-dnd-ghost"),Ge.style.cssText=`
100
+ </svg>`,f=e.ref(null),be=e.ref(null),Ce=e.ref(!1),G=e.ref(!1),U=e.ref(!1),me=e.ref(""),R=e.ref({}),xe=e.ref(!1),Ae=e.ref(!1),nt=e.ref(""),ft=e.ref(""),Z=e.ref(null),Ue=e.ref(null),qe=e.ref(null),Ee=e.ref(null),Me=e.ref(""),je=e.ref(!1),Q=e.ref({}),ze=e.ref(!1),we=e.ref({}),it=e.ref(null),ot=e.ref(null),bt=e.ref(!1),It=e.ref(""),en=e.ref(null),Pt=e.ref(""),oe=e.ref(""),ve=e.ref(""),Fe=e.ref(null),De=e.ref(null),Zt=e.ref(null),yt=e.ref(null),Ut=e.ref(null),xt=e.ref(!1),Ot=e.ref(""),J=e.ref({}),he=e.ref(!1),Be=e.ref("upload"),Xe=e.ref(""),Ke=e.ref(null),Lt=e.ref(null),Ge=e.ref([]),Dt=e.ref([]),He=e.ref(null),Pe=e.ref(!1),Et=e.ref(""),St=e.ref(""),K=e.ref(""),W=e.ref(""),X=e.ref(""),pe=e.ref(""),ye=e.ref(null),Je=e.ref(null),Tt=e.ref(null),mn=e.ref(!1),vt=e.ref(null),Gt=e.ref(!1),S=e.ref(!1),b=e.ref(null),V=e.ref("p"),Y=e.ref(!1),ne=e.ref([]),Oe=e.ref(null),mt=e.ref(null),ct=e.ref(null),We=e.ref(!1),Vt=e.ref(0),Nt=100,wt=e.ref(null),Ct=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":$t.value!==null})),At=e.computed(()=>({})),Bt=e.computed(()=>!T.fixedHeight||T.fullHeight?{}:{height:`${1.6*14*T.rows+24+2}px`,resize:"none",overflowY:"auto"}),bn=e.computed(()=>!T.fixedHeight||T.fullHeight?{}:{height:`${1.6*14*T.rows+32}px`,overflowY:"auto"}),Tn=e.computed(()=>T.richText&&Dt.value.length>0),ol=e.computed(()=>{if(!T.modelValue)return"";if(T.richText){let o=T.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/&nbsp;/g," "),o=o.replace(/&amp;/g,"&"),o=o.replace(/&lt;/g,"<"),o=o.replace(/&gt;/g,">"),o=o.replace(/&quot;/g,'"'),o=o.replace(/&#39;/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return T.modelValue}),qt=e.computed(()=>{const o=ol.value.trim();return o?o.split(/\s+/).filter(l=>l.length>0).length:0}),ln=e.computed(()=>ol.value.length),On=e.computed(()=>yt.value!==null&&Be.value==="upload"&&Pt.value&&Pt.value.startsWith("data:")),qn=e.computed(()=>T.titlePlaceholder||L("textEditor.placeholders.title")),Rn=e.computed(()=>T.descriptionPlaceholder||L("textEditor.placeholders.description")),Nn=e.computed(()=>T.placeholder||L("textEditor.placeholders.startTyping")),A=o=>dt&&dt[o]!==void 0,O=o=>{for(let l=o+1;l<T.customToolbarSlots.length;l++)if(A(T.customToolbarSlots[l]))return!0;return!1},P=o=>{for(let l=o+1;l<T.customToolbarSlots.length;l++){const s=T.customToolbarSlots[l];if(A(s)&&ie(s))return!0}return!1},ie=o=>T.customToolbarFloatingMap.hasOwnProperty(o)?T.customToolbarFloatingMap[o]===!0:!0,Te=e.computed(()=>T.customToolbarSlots.some(o=>A(o)&&ie(o))),et=e.computed(()=>A("title-slot")),rt=e.computed(()=>A("description-slot")),tt=o=>{if(!o||o.trim()==="")return"<html></html>";const l=o.trim();return l.startsWith("<html>")&&l.endsWith("</html>")?o:`<html>${o}</html>`},Mt=o=>{if(!o||o.trim()==="")return"";const l=o.replace(/<!--[\s\S]*?-->/g,""),s=l.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():l},on=o=>{if(!o)return;const l=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),s=[];let r=l.nextNode();for(;r;)s.push(r),r=l.nextNode();s.forEach(c=>c.remove())},An=o=>{try{const l=String(o.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],c=o.getFullYear();return`${l} ${r} ${c}`}catch{return""}},Fn=o=>{if(!o||typeof o!="string")return!1;const l=o.trim();if(!l)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(l))return!0;try{const c=L("textEditor.started_conversation");if(c&&l===c)return!0}catch{}const r=l.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},Qn=o=>{const l=o.target.value;fe("update:modelValue",l),fe("change",l)},En=()=>{if(!ye.value)return;const o=ye.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},oo=()=>{Gt.value=!0,En()},ql=()=>{Gt.value=!1,Al()},Al=()=>{if(!ye.value)return;const o=ye.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const l=o.value;o.value="M";const s=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},Wl=o=>{const s=o.target.value;Gt.value&&En(),fe("update:title",s),fe("title-change",s),Tt.value="title",T.richText&&(Pe.value||(St.value=Et.value,X.value=K.value,pe.value=W.value),He.value&&clearTimeout(He.value),Pe.value=!0,He.value=setTimeout(()=>{Pe.value=!1,at()},500))},ml=()=>{if(!Je.value)return;const o=Je.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},Vl=()=>{S.value=!0,ml()},ao=()=>{S.value=!1,Jn()},Jn=()=>{if(!Je.value)return;const o=Je.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const l=o.value;o.value="M";const s=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},yn=o=>{const s=o.target.value;S.value&&ml(),fe("update:description",s),fe("description-change",s),Tt.value="description",T.richText&&(Pe.value||(St.value=Et.value,X.value=K.value,pe.value=W.value),He.value&&clearTimeout(He.value),Pe.value=!0,He.value=setTimeout(()=>{Pe.value=!1,at()},500))},Qt=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const l=o.getRangeAt(0);if(l.startContainer.nodeType===1)return{type:"element",element:l.startContainer,offset:l.startOffset};const s=l.cloneRange();return s.selectNodeContents(f.value),s.setEnd(l.startContainer,l.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+l.toString().length}},an=o=>{if(!(!o||!f.value))try{const l=window.getSelection(),s=document.createRange();if(o.type==="element"&&o.element)if(f.value.contains(o.element)){s.setStart(o.element,o.offset),s.collapse(!0),l.removeAllRanges(),l.addRange(s);return}else{f.value.focus();return}let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(s.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(s.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}l.removeAllRanges(),l.addRange(s)}catch{f.value.focus()}},al=()=>{if(!f.value)return;f.value.focus();const o=window.getSelection(),l=document.createRange(),s=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let d=c.childNodes.length-1;d>=0;d--){const u=c.childNodes[d],m=s(u);if(m)return m}return c},r=s(f.value);if(r.nodeType===3)l.setStart(r,r.length),l.setEnd(r,r.length);else if(r.childNodes.length>0){const c=s(r);c&&c.nodeType===3?(l.setStart(c,c.length),l.setEnd(c,c.length)):(l.selectNodeContents(r),l.collapse(!1))}else l.setStart(r,0),l.setEnd(r,0);o.removeAllRanges(),o.addRange(l)},at=(o=!1)=>{if(!f.value)return;const l=f.value.innerHTML,s=T.title||"",r=T.description||"";if(!o&&l===Et.value&&s===K.value&&r===W.value)return;const c={content:St.value||Et.value,title:X.value!==void 0?X.value:K.value,description:pe.value!==void 0?pe.value:W.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(),Dt.value=[]),Et.value=l,K.value=s,W.value=r,St.value=l,X.value=s,pe.value=r},ce=o=>{if(!f.value)return;pl(),f.value&&on(f.value);let l=null;f.value&&(f.value.querySelector("p")||(l=Qt(),ht()));const s=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");s&&b.value&&(b.value=null),G.value=!0;const r=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),c=tt(r);fe("update:modelValue",c),fe("change",c),Tt.value="editor",Pe.value||(St.value=Et.value,X.value=K.value,pe.value=W.value),He.value&&clearTimeout(He.value),Pe.value=!0,He.value=setTimeout(()=>{Pe.value=!1,at(),jl(),Mo()},500),e.nextTick(()=>{l&&an(l),pl();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,v=m&&m.collapsed;if(d.forEach(k=>{try{if(v&&b.value?.command===k){Q.value[k]=b.value.state;return}if(k==="bold")if(m){const _=m.commonAncestorContainer,H=_.nodeType===3?_.parentElement:_;let E=!1;if(H&&((H.tagName==="STRONG"||H.tagName==="B"||H.closest&&H.closest("strong, b"))&&(E=!0),!E&&H.style&&parseInt(H.style.fontWeight)>=600&&(E=!0),!E))try{const se=window.getComputedStyle(H);parseInt(se.fontWeight)>=600&&(E=!0)}catch{}Q.value[k]=E}else Q.value.hasOwnProperty(k)||(Q.value[k]=!1);else if(k==="italic")if(m){const _=m.commonAncestorContainer,H=_.nodeType===3?_.parentElement:_,E=H&&(H.tagName==="EM"||H.tagName==="I"||H.closest&&H.closest("em, i"));Q.value[k]=!!E}else{const _=document.queryCommandState(k);Q.value[k]=_}else{const _=document.queryCommandState(k);Q.value[k]=_}}catch{}}),Mn(),pn(),$e(),nn(),kt(),wn("handleRichTextInput"),s&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const k=o.data||"";k&&k.length===1&&setTimeout(()=>Mo(k),0),(k===" "||k===`
101
+ `||/[.,;:!?]/.test(k))&&setTimeout(()=>{jl()},100)}G.value=!1})},pl=()=>{if(!f.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(!r)return;const c=r.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(r!==d&&!d?.contains(r)){const u=l.startContainer.nodeType===3?l.startContainer.parentElement:l.startContainer,m=l.endContainer.nodeType===3?l.endContainer.parentElement:l.endContainer;if(c.contains(u)&&u!==d||c.contains(m)&&m!==d){const v=document.createRange();v.setStartAfter(c),v.collapse(!0),o.removeAllRanges(),o.addRange(v)}}}},ht=()=>{if(!f.value)return;const o=f.value;if(o.querySelector&&o.querySelector("p"))return;const l=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),s=Array.from(o.childNodes);let r=null;s.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}r||(r=document.createElement("p"),o.insertBefore(r,c)),r.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){r=null;return}if(l.has(u)){r=null;return}r||(r=document.createElement("p"),o.insertBefore(r,d)),r.appendChild(d)}})},pn=()=>{if(f.value&&!mn.value){mn.value=!0;try{f.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),f.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const c=r.parentElement;!c||!c.classList.contains("dss-image-wrapper")?r.remove():c.querySelector("img")||r.remove()}),f.value.querySelectorAll("img").forEach(r=>{let c=r.getAttribute("alt");c===null&&(c=r.alt||"");const d=r.getAttribute("src")||r.src||"";if(c){const k=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),_=c===d||c===k;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||_||_)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=r.parentElement;const v=m&&m.classList.contains("dss-image-wrapper");if(v){const k=m.querySelector(".dss-image-no-alt-icon");k&&k.remove()}else{const k=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;k&&k.remove()}if(u){v?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const k=document.createElement("div");k.className="dss-image-no-alt-icon",k.setAttribute("contenteditable","false"),k.innerHTML=ee,m.appendChild(k)}else if(v&&m.children.length===1){const k=m.parentNode;k.insertBefore(r,m),k.removeChild(m)}})}finally{mn.value=!1}}},st=o=>{jl(),fe("blur",o),Il()},gt=()=>{if(T.disabled||!T.richText||!f.value)return;cn(),He.value&&(clearTimeout(He.value),He.value=null),Pe.value&&(at(),Pe.value=!1);const o=Tt.value==="title",l=Tt.value==="description",s=Tt.value==="editor";if(Ge.value.length===0){o&&ye.value?ye.value.focus():l&&Je.value?Je.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{ce()});return}const r={content:f.value.innerHTML,title:T.title||"",description:T.description||""};Dt.value.push(r);const c=Ge.value.pop();if(c!==void 0){G.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,Et.value=d,K.value=u,W.value=m,St.value=d,X.value=u,pe.value=m,e.nextTick(()=>{Mn(),fn(),ut(),nn();const v=tt(d);fe("update:modelValue",v),fe("update:title",u),fe("update:description",m),fe("change",v),fe("title-change",u),fe("description-change",m),G.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(ye.value){ye.value.focus();const k=u.length;ye.value.setSelectionRange&&ye.value.setSelectionRange(k,k),En()}}else if(l){if(Je.value){Je.value.focus();const k=m.length;Je.value.setSelectionRange(k,k)}}else if(s)al();else if(ye.value&&document.activeElement===ye.value){const k=u.length;ye.value.setSelectionRange&&ye.value.setSelectionRange(k,k),En()}else if(Je.value&&document.activeElement===Je.value){const k=m.length;Je.value.setSelectionRange(k,k)}else f.value&&al()},10)})})}},ae=()=>{if(T.disabled||!T.richText||!f.value)return;cn();const o=Tt.value==="title",l=Tt.value==="description",s=Tt.value==="editor";if(Dt.value.length===0){o&&ye.value?ye.value.focus():l&&Je.value?Je.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{ce()});return}const r={content:f.value.innerHTML,title:T.title||"",description:T.description||""};Ge.value.push(r);const c=Dt.value.pop();if(c!==void 0){G.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,Et.value=d,K.value=u,W.value=m,St.value=d,X.value=u,pe.value=m,e.nextTick(()=>{Mn(),fn(),ut(),nn();const v=tt(d);fe("update:modelValue",v),fe("update:title",u),fe("update:description",m),fe("change",v),fe("title-change",u),fe("description-change",m),G.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(ye.value){ye.value.focus();const k=u.length;ye.value.setSelectionRange&&ye.value.setSelectionRange(k,k),En()}}else if(l){if(Je.value){Je.value.focus();const k=m.length;Je.value.setSelectionRange(k,k)}}else if(s)al();else if(ye.value&&document.activeElement===ye.value){const k=u.length;ye.value.setSelectionRange&&ye.value.setSelectionRange(k,k),En()}else if(Je.value&&document.activeElement===Je.value){const k=m.length;Je.value.setSelectionRange(k,k)}else f.value&&al()},10)})})}},Yt=()=>{if(!f.value)return;f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const c=r.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},$e=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},so=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let s=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="EM"||c.tagName==="I"){s=!0;break}if(c.style&&c.style.fontStyle==="italic"){s=!0;break}c=c.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==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(()=>{$e()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{$e()});else try{const r=l.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{$e()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{$e()})}return!0},sn=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let s=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="STRONG"||c.tagName==="B"){s=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){s=!0;break}c=c.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}}if(s)break}}}if(s)return document.execCommand("bold",!1),e.nextTick(()=>{Yt()}),!1;if(l.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==f.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const v=document.createElement("b");v.style.fontWeight="600";const k=document.createDocumentFragment();for(;u.firstChild;)k.appendChild(u.firstChild);v.appendChild(k),u.parentNode&&u.parentNode.replaceChild(v,u),c.setStart(v,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===f.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c)}}Yt()});else try{const r=l.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{Yt()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Yt()})}return!0},Bn=(o,l=null)=>{if(T.disabled||!T.richText||!f.value)return;Pe.value?(He.value&&(clearTimeout(He.value),He.value=null),at(),Pe.value=!1):at(),cn(),f.value.focus();const s=window.getSelection();let r=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&Wt(d)&&(r=Qt())}if(o==="createLink"&&l){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const v=document.createTextNode(l);u.insertNode(v),u.selectNodeContents(v)}}}if(o==="bold"){const d=sn();Q.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(b.value={command:"bold",state:d}),e.nextTick(()=>{r&&(an(r),e.nextTick(()=>{const m=tn("bold");Q.value.bold=m})),ce(),fn(),nn()});return}if(o==="italic"){const d=so();Q.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(b.value={command:"italic",state:d}),e.nextTick(()=>{r&&(an(r),e.nextTick(()=>{const m=tn("italic");Q.value.italic=m})),ce(),$e(),fn(),nn()});return}let c=!1;try{c=document.execCommand(o,!1,l)}catch{}e.nextTick(()=>{if(r&&an(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=tn("bold");Q.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=tn("italic");Q.value.italic=u});else{const u=document.queryCommandState(o);Q.value[o]=u}else{const u=document.queryCommandState(o);Q.value[o]=u}}catch{Q.value.hasOwnProperty(o)?Q.value[o]=!Q.value[o]:Q.value[o]=!0}if(o==="createLink"&&l){const u=window.getSelection();if(u.rangeCount>0){const v=u.getRangeAt(0),k=v.commonAncestorContainer.nodeType===1?v.commonAncestorContainer.closest("a"):v.commonAncestorContainer.parentElement?.closest("a");k&&(!k.getAttribute("href")||k.getAttribute("href")==="")&&k.setAttribute("href",l)}f.value.querySelectorAll("a").forEach(v=>{const k=v.getAttribute("href");(!k||k===""||k==="#")&&v.setAttribute("href",l)})}ce(),fn(),nn()})},tn=(o,l=null)=>{if(T.disabled||!f.value)return!1;try{if(o==="formatBlock"&&l){const r=document.queryCommandValue("formatBlock");if(l==="<blockquote>"){const c=r.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const m=d.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===l||r.toLowerCase()===l.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="STRONG"||v.tagName==="B"||v.closest&&v.closest("strong, b"))&&(u=!0),!u&&v.style&&parseInt(v.style.fontWeight)>=600&&(u=!0),!u))try{const k=window.getComputedStyle(v);parseInt(k.fontWeight)>=600&&(u=!0)}catch{}return Q.value.hasOwnProperty(o)?Q.value[o]:(Q.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const k=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let _;for(;_=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let E=_.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(_.nodeType===1){const H=_;if(H.tagName==="STRONG"||H.tagName==="B"){u=!0;break}if(H.style&&parseInt(H.style.fontWeight)>=600){u=!0;break}}if(u)break}}return Q.value[o]=u&&v,u&&v}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="EM"||v.tagName==="I"||v.closest&&v.closest("em, i"))&&(u=!0),!u&&v.style&&v.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(v).fontStyle==="italic"&&(u=!0)}catch{}return Q.value.hasOwnProperty(o)?Q.value[o]:(Q.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const k=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let _;for(;_=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let E=_.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(_.nodeType===1){const H=_;if(H.tagName==="EM"||H.tagName==="I"){u=!0;break}if(H.style&&H.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return Q.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return c.collapsed&&Q.value.hasOwnProperty(o)?Q.value[o]:(Q.value[o]=d,d)}return Q.value.hasOwnProperty(o)?Q.value[o]:!1}catch{return Q.value.hasOwnProperty(o)?Q.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},In=o=>{T.disabled||!T.richText||(be.value=be.value===o?null:o,o==="askAi"&&(ot.value=null))},cn=()=>{be.value=null,Ke.value=null},zn=o=>{Bn("formatBlock",o),cn()},Dl=o=>{if(!o||!f.value)return o;const l=Ie=>{let Ve=Ie.nodeType===Node.TEXT_NODE?Ie.parentElement:Ie;for(;Ve&&Ve!==f.value;){const lt=Ve.tagName;if(lt==="P"){const Cn=Ve.parentElement;if(Cn===f.value||Cn.tagName==="BLOCKQUOTE")return Ve}if(lt==="BLOCKQUOTE")break;Ve=Ve.parentElement}return null},s=l(o.startContainer),r=l(o.endContainer);if(!s||!r)return o;const c=[],d=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Ie=>{const Ve=Ie.tagName;if(Ve==="P"){const lt=Ie.parentElement;if(lt===f.value||lt.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Ve==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(s),v=c.indexOf(r);if(m===-1||v===-1)return o;const k=Math.min(m,v),_=Math.max(m,v),H=c.slice(k,_+1);if(H.length===0)return o;const E=H[0],se=H[H.length-1],j=document.createRange();return j.setStartBefore(E),j.setEndAfter(se),j},Nl=()=>{if(T.disabled||!T.richText||!f.value)return;Pe.value?(He.value&&(clearTimeout(He.value),He.value=null),at(),Pe.value=!1):at(),cn(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let l=o.getRangeAt(0);!l.collapsed&&Wt(l)&&(l=Dl(l),o.removeAllRanges(),o.addRange(l));let s=null;!l.collapsed&&Wt(l)&&(s=Qt());const r=l.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(v=>{if(v.nodeType===Node.ELEMENT_NODE)if(v.tagName==="P"||v.tagName==="DIV")u.insertBefore(v,c);else{const k=document.createElement("p");k.appendChild(v.cloneNode(!0)),u.insertBefore(k,c)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const k=document.createElement("p");k.appendChild(v.cloneNode(!0)),u.insertBefore(k,c)}}),c.remove()}}else if(l.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=l.extractContents();u.appendChild(m),l.insertNode(u);const v=[],k=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:E=>E.parentNode===u&&E.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let _;for(;_=k.nextNode();)v.push(_);if(v.forEach(E=>{const se=document.createElement("p");E.parentNode.insertBefore(se,E),se.appendChild(E)}),u.querySelectorAll("p, div").forEach(E=>{E.textContent.trim()===""&&!E.querySelector("img")&&(E.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const E=document.createElement("p");E.innerHTML="<br>",u.appendChild(E)}}e.nextTick(()=>{s&&an(s),ut(),ce(),nn()})},Zn=()=>{if(!f.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!r||!f.value.contains(r))return;const c=_=>{if(!_)return!1;const H=_.textContent||"",se=(_.innerHTML||"").trim();return H.trim()===""||se===""||se==="<br>"||se==="<br/>"||se==="<p></p>"||se==="<p><br></p>"||se==="<p><br/></p>"||se==="<p> </p>"||se==="<p><br> </p>"||se==="<div></div>"||se==="<div><br></div>"||se==="<div><br/></div>"};let d=null;for(s.nodeType===3?d=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?d=s:d=s.closest("p, div"),d&&r.contains(d)&&c(d)&&d.remove();r.lastChild;){const _=r.lastChild;if(_.nodeType===1&&_.tagName==="BR")_.remove();else if(_.nodeType===3)if((_.textContent||"").trim()==="")_.remove();else break;else break}if(r.children.length>0)for(let _=r.children.length-1;_>=0;_--){const H=r.children[_];if((H.tagName==="P"||H.tagName==="DIV")&&c(H))H.remove();else break}let u=r.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(r.innerHTML=u);const v=document.createElement("p");v.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(v,r.nextSibling):r.parentNode.appendChild(v):f.value&&f.value.appendChild(v);const k=document.createRange();k.selectNodeContents(v),k.collapse(!0),o.removeAllRanges(),o.addRange(k),e.nextTick(()=>{ut(),ce()})},fn=()=>{if(!f.value){Ce.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");Ce.value=!!r}else Ce.value=!1}catch{Ce.value=!1}},Zl=()=>{if(!f.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),Ee.value=Qt();const l=window.getSelection();let s="";l.rangeCount>0&&(s=l.getRangeAt(0).toString()),nt.value="",ft.value=s,Me.value="",qe.value=null,Ae.value=!0,cn(),e.nextTick(()=>{Z.value&&Z.value.focus()})},Ul=()=>{if(!f.value)return;Pe.value?(He.value&&(clearTimeout(He.value),He.value=null),at(),Pe.value=!1):at();const o=window.getSelection();let l=null;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;l=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!l&&qe.value&&(l=qe.value),l&&l.parentNode){const s=document.createDocumentFragment();for(;l.firstChild;)s.appendChild(l.firstChild);if(l.parentNode.replaceChild(s,l),s.firstChild){const r=document.createRange();r.setStartBefore(s.firstChild),r.setEndAfter(s.lastChild||s.firstChild),o.removeAllRanges(),o.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),o.removeAllRanges(),o.addRange(r)}qe.value=null}else Bn("unlink");Ce.value=!1,cn(),e.nextTick(()=>{ce(),fn()})},sl=()=>{T.disabled||!T.richText||f.value&&(Pe.value?(He.value&&(clearTimeout(He.value),He.value=null),at(),Pe.value=!1):at(),cn(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Mn(),ce(),nn()}))},Hl=()=>{T.disabled||!T.richText||f.value&&(Pe.value?(He.value&&(clearTimeout(He.value),He.value=null),at(),Pe.value=!1):at(),cn(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Mn(),ce(),nn()}))},fl=o=>{const l=o.parentElement;if(!l||l.tagName!=="OL")return null;let s=0,r=o.previousElementSibling;for(;r;)r.tagName==="LI"&&s++,r=r.previousElementSibling;return s+1},Mn=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(l=>{const s=l.parentElement;if(s&&s.tagName==="LI"){const r=fl(s);r!==null&&Array.from(l.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},Rl=()=>{if(T.disabled||!T.richText||!f.value)return;cn(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{Mn(),ce()});return}const r=s.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=s.previousElementSibling;if(c&&c.tagName==="LI"){const d=r.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const m=fl(c);u.appendChild(s),m!==null&&r.tagName==="OL"&&s.setAttribute("data-parent-num",String(m)),Mn();const v=document.createRange();v.selectNodeContents(s),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{ce(),nn()})}else document.execCommand("indent",!1),e.nextTick(()=>{Mn(),ce(),nn()})},vl=()=>{if(T.disabled||!T.richText||!f.value)return;cn(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{Mn(),ce()});return}const r=s.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=r.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){r.tagName==="OL"&&s.removeAttribute("data-parent-num"),d.insertBefore(s,c.nextSibling),r.children.length===0&&r.remove(),Mn();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{ce(),nn()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Mn(),ce(),nn()})},$t=e.ref(null),Un=e.ref(null),rl=e.ref({}),y=e.ref(""),h=e.ref(null),x=e.ref("");e.ref("");const q=e.ref(null);e.ref("");const re=e.ref([]),pt=e.ref(!1),Ht=e.ref(!1),_n=o=>{if(!o)return"";const l=o.cloneRange(),s=document.createElement("div");return s.appendChild(l.cloneContents()),s.innerHTML},Dn=()=>{if(T.disabled||!T.richText||!f.value)return;if($t.value!==null){$t.value=null,y.value="",x.value="",q.value=null,re.value=[],xn(!0);return}cn(),f.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(l.collapsed||!Wt(l))return;x.value=_n(l)||"",q.value=Qt();const s=l.getBoundingClientRect(),r=f.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=s.bottom-c.top,m=Math.max(d+8,0);rl.value={top:`${m}px`,bottom:"auto"},$t.value=Date.now(),e.nextTick(()=>{if(y.value="",h.value){const k=h.value;k.style.height="auto",k.style.height=`${k.scrollHeight}px`,k.focus()}const v=r.querySelector(".dss-comment-overlay");if(v&&r){const k=r.querySelector(".dss-text-editor-footer");if(k){const _=r.getBoundingClientRect(),H=v.getBoundingClientRect(),E=k.getBoundingClientRect(),se=H.bottom-_.top,j=E.top-_.top,Ie=8;if(se>j-Ie){const Ve=E.height;rl.value={bottom:`${Ve+Ie}px`,top:"auto"}}else rl.value={top:`${m}px`,bottom:"auto"}}}})},Wn=()=>{if(!y.value.trim())return;const o=y.value.trim(),l=new Date,s={text:o,selectionText:x.value,selectionRange:q.value,commentId:$t.value,user:T.commentUser||null,createdAt:l.toISOString()};re.value=[...re.value,s],fe("comment-submitted",s),io(s),q.value&&!ro(q.value)&&Eo($t.value,q.value),y.value="",e.nextTick(()=>{if(h.value){const r=h.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}wn("sendComment")})},kl=(o,l)=>{if(!(!T.commentUser||!o.user||o.user.id!==T.commentUser.id)){if(re.value=re.value.filter((s,r)=>r!==l),$t.value!==null&&f.value){const s=String($t.value),r=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(r&&re.value.length>0){const c=[],d=new Set;re.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),c.push(u.user))}),c.length>0?r.setAttribute("data-comment-user",JSON.stringify(c[0])):r.removeAttribute("data-comment-user"),c.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(c[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(re.value.length))}else r&&re.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(fe("comment-deleted",{comment:o,index:l,commentId:$t.value}),T.comments&&Array.isArray(T.comments)){const s=T.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));fe("update:comments",s)}e.nextTick(()=>{wn("deleteComment")})}},ro=o=>{if(!o||!f.value)return!1;try{const l=xo(o);if(!l)return!1;const s=l.commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},xo=o=>{if(!o||!f.value)return null;try{const l=document.createRange();if(o.type==="element"&&o.element)return f.value.contains(o.element)?(l.setStart(o.element,o.offset),l.collapse(!0),l):null;let s=0;const r=[f.value];let c=null,d=!1,u=!1;for(;!u&&(c=r.pop());)if(c.nodeType===3){const m=s+c.length;!d&&o.start>=s&&o.start<=m&&(l.setStart(c,o.start-s),d=!0),d&&o.end>=s&&o.end<=m&&(l.setEnd(c,o.end-s),u=!0),s=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return d?l:null}catch{return null}},Eo=(o,l)=>{if(!(!o||!l||!f.value))try{const s=xo(l);if(!s||s.collapsed)return;const r=s.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const m=c.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(o)&&m.getAttribute("data-fake-comment")!==String(o)&&m.setAttribute("data-comment",String(o));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(o));try{const m=s.startContainer,v=s.endContainer,k=s.startOffset,_=s.endOffset,H=m.nodeType===3?m.parentNode:m,E=v.nodeType===3?v.parentNode:v;if(H===E&&k===0&&_===(v.nodeType===3?v.length:E.childNodes.length)&&(H.tagName==="P"||H.tagName==="DIV"||H.tagName==="H1"||H.tagName==="H2"||H.tagName==="H3"||H.tagName==="H4"||H.tagName==="H5"||H.tagName==="H6")){const j=s.extractContents();d.appendChild(j),s.insertNode(d)}else s.surroundContents(d)}catch{const v=s.extractContents();d.appendChild(v),s.insertNode(d)}const u=f.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{wn("wrapSelectionWithCommentMarker"),ce()})}catch{}},io=o=>{if(!o||!o.commentId)return;const l=Array.isArray(T.comments)?[...T.comments]:[],s=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let r=l.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(s)||d.conversation_id===s);const c={text:o.text,user:o.user,createdAt:o.createdAt,created_at:o.createdAt,updated_at:o.createdAt};if(r>=0){const d=l[r];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=o.createdAt,!d.article_id&&l.length>0){const u=l.find(m=>m.article_id);u&&(d.article_id=u.article_id)}}else{const d=o.selectionRange,u=l.length>0&&l.find(v=>v.article_id)?.article_id||null,m={conversation_id:s,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:o.selectionText||"",conversation:[c],created_by_user:o.user,created_at:o.createdAt,updated_at:o.createdAt,status:"active"};l.push(m)}pt.value=!0,fe("update:comments",l)},So=(o,l=[])=>{if(T.disabled||!T.richText||!f.value)return;const s=f.value;let r=null;try{r=s.querySelector(o)}catch{return}if(!r)return;cn(),s.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),x.value=r.innerHTML||"",q.value=Qt();const u=c.getBoundingClientRect(),m=s.parentElement;if(m){const _=m.getBoundingClientRect(),H=u.bottom-_.top,se=Math.max(H+8,0);rl.value={top:`${se}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let k=[];if(v&&T.comments&&Array.isArray(T.comments)){const _=T.comments.find(H=>String(H.conversation_id)===String(v));if(_&&_.conversation&&Array.isArray(_.conversation)){const H=_.conversation.map(E=>({id:E.id||E.commentary_id,commentary_id:E.id||E.commentary_id,conversation_id:_.id||_.conversation_id,text:E.text,user:E.user,createdAt:E.created_at||E.createdAt,updated_at:E.updated_at||E.updatedAt}));k.push(...H)}}k.length===0&&Array.isArray(l)&&l.length>0&&(k=l.slice()),k.sort((_,H)=>{const E=Ie=>{if(!Ie)return 0;const Ve=new Date(Ie).getTime();return isNaN(Ve)?0:Ve},se=E(_.createdAt),j=E(H.createdAt);return se===j?0:se-j}),re.value=k,xn(!0),$t.value=v||null,r&&(Un.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(y.value="",h.value){const _=h.value;_.style.height="auto",_.style.height=`${_.scrollHeight}px`,_.focus()}if(m){const _=m.querySelector(".dss-comment-overlay");if(_){const H=m.querySelector(".dss-text-editor-footer");if(H){const E=m.getBoundingClientRect(),se=_.getBoundingClientRect(),j=H.getBoundingClientRect(),Ie=se.bottom-E.top,Ve=j.top-E.top,lt=8;if(Ie>Ve-lt){const Cn=j.height;rl.value={bottom:`${Cn+lt}px`,top:"auto"}}}}}wn("openCommentOverlayForSelector")})},co=e.ref(null),Vo=e.ref(0),uo=o=>{if(!(T.disabled||!T.richText)){if(o.key==="Escape"){const l=window.getSelection();if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){o.preventDefault();let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(m,u.nextSibling):c.appendChild(m),setTimeout(()=>{Zn()},50);return}}}if(o.key.length===1||o.key==="Enter"){const l=window.getSelection();if(l&&l.rangeCount>0){const s=l.getRangeAt(0),r=s.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const m=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,v=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(m)&&m!==u||d.contains(v)&&v!==u){o.preventDefault();const k=document.createRange();k.setStartAfter(d),k.collapse(!0),l.removeAllRanges(),l.addRange(k);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const l=window.getSelection();if(l.rangeCount>0){const s=l.getRangeAt(0);let r=null,c=null;if(s.collapsed)if(o.key==="Backspace"){const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const m=u.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const m=u.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=s.commonAncestorContainer,u=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,m=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(r=d,c=r.closest(".dss-image-wrapper")):(r=d.querySelector("img"),r&&(c=r.closest(".dss-image-wrapper"))),c){const v=c.contains(u)||u===c,k=c.contains(m)||m===c,H=s.cloneContents().textContent?.trim()||"",E=c.textContent?.trim()||"";(!v||!k||H.length>E.length)&&(c=null,r=null)}}if(c){o.preventDefault(),o.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const m=document.createRange();m.setStartAfter(u),m.collapse(!0),l.removeAllRanges(),l.addRange(m),e.nextTick(()=>{ce()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?vl():Rl();return}if(o.key==="Enter"){const l=window.getSelection();if(l.rangeCount>0){const s=l.getRangeAt(0);if(s.collapsed){const u=s.startContainer,m=v=>{if(!v)return!1;let k=v.previousSibling;for(;k;){if(k.classList&&k.classList.contains("dss-image-wrapper")||k.tagName==="IMG"||k.querySelector&&k.querySelector(".dss-image-wrapper")||k.querySelector&&k.querySelector("img"))return!0;k=k.previousSibling}const _=v.parentElement;return _&&_!==f.value?m(_):!1};if(u.nodeType===3){const v=u.parentElement;if(v&&(m(v)||m(u))){const k=v.closest("p, div");if(k&&k!==f.value){o.preventDefault(),o.stopPropagation();let _=null;const H=s.startOffset;H<u.length&&(_=u.splitText(H));const E=document.createElement("p");if(_?E.appendChild(_):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 se=document.createRange();_?se.setStart(_,0):se.setStart(E,0),se.collapse(!0),l.removeAllRanges(),l.addRange(se),e.nextTick(()=>{ce()});return}}}}const r=s.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=j=>{if(!j)return!1;const Ie=j.textContent||"",lt=(j.innerHTML||"").trim(),Cn=lt.replace(/<br\s*\/?>/gi,"").trim();return Ie.trim()===""||lt===""||Cn===""||lt==="<br>"||lt==="<br/>"||lt==="<p></p>"||lt==="<p><br></p>"||lt==="<p><br/></p>"||lt==="<p> </p>"||lt==="<p><br> </p>"||lt==="<div></div>"||lt==="<div><br></div>"||lt==="<div><br/></div>"},v=c.lastChild,k=v&&v.nodeType===1&&v.tagName==="BR",_=s.startContainer,H=_.nodeType===3?_.parentElement:_,E=H===c||H&&H.parentElement===c;if(u&&m(u)||k&&E){o.preventDefault(),setTimeout(()=>{Zn()},50);return}}}}if(o.key===" "){const l=Date.now(),s=l-Vo.value;if(co.value===" "&&s<300){const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(d){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){o.preventDefault(),Rl();return}}}}co.value=" ",Vo.value=l}else co.value=o.key}},Zo=o=>{if(T.disabled||!T.richText)return;o.preventDefault();let l=o.clipboardData.getData("text/html"),s=o.clipboardData.getData("text/plain");l&&(l=l.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),at();const r=window.getSelection();let c=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),c=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const v=new DOMParser().parseFromString(u,"text/html");let k=f.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach(H=>{if(k>0){const E=v.createElement("p");E.innerHTML=H.innerHTML,H.parentNode.replaceChild(E,H)}else k++}),c){const H=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],E=Array.from(v.body.children).filter(se=>H.includes(se.tagName));if(E.length===1){const se=E[0].tagName,j=c.tagName,Ie=c.textContent.trim()===""&&!c.querySelector("img");let Ve=!1;if(["H1","H2","H3","H4","H5","H6"].includes(j)?Ve=!0:Ie||(se===j||se==="P")&&(Ve=!0),Ve)return E[0].innerHTML.trim()}}return v.body.innerHTML.trim()};if(l){const u=d(l);document.execCommand("insertHTML",!1,u)}else if(s)if(/<[a-z][\s\S]*>/i.test(s)){const m=d(s);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,s);ce()},Xl=o=>{if(be.value){const s=o.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&cn()}if(ze.value){const s=o.target,r=s.closest(".dss-floating-toolbar"),c=f.value&&s.closest(".dss-text-editor-content");!r&&!c&&Il()}if(ot.value){const s=o.target,r=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!r&&!c&&Yl()}const l=o.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(Ke.value=null),!f.value||!l.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const r=s.getRangeAt(0);Y.value=!r.collapsed&&Wt(r)}else Y.value=!1}if($t.value!==null){const s=document.querySelector(".dss-comment-overlay");let r=!1;if(s){const u=s.getBoundingClientRect(),m=o.clientX,v=o.clientY;r=m>=u.left&&m<=u.right&&v>=u.top&&v<=u.bottom}const c=l.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!r&&!d&&($t.value=null,y.value="",x.value="",q.value=null,re.value=[],xn(!0))}},$n=(o,l)=>{o&&o.stopPropagation&&o.stopPropagation(),Lt.value&&(clearTimeout(Lt.value),Lt.value=null),Ke.value=l},F=o=>{const l=o.relatedTarget;if(l){const s=l.closest(".dss-toolbar-dropdown-submenu"),r=l.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||r)return}Lt.value&&clearTimeout(Lt.value),Lt.value=setTimeout(()=>{Ke.value=null,Lt.value=null},150)},Sn=o=>{Ke.value=null};let Xn=0;const Fl=o=>{if(!o)return;const l=Array.from(o.children);l.forEach(s=>{s.classList.contains("dss-toolbar-dropdown-submenu")||s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(s.tagName==="BUTTON"||s.tagName==="DIV")&&!s.classList.contains("dss-toolbar-dropdown-item")&&s.classList.add("dss-toolbar-dropdown-item")}),l.forEach((s,r)=>{if(s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||s.classList.contains("dss-toolbar-dropdown-submenu")||!s.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(s.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(k=>k.tagName==="BUTTON"||k.tagName==="DIV").length>0:!1),d=s.nextElementSibling,u=d&&!d.classList.contains("dss-toolbar-dropdown-submenu")&&!d.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&d.tagName==="DIV"&&!d.classList.contains("dss-toolbar-dropdown-item")&&Array.from(d.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(c||u){const m=`submenu-auto-${++Xn}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",m);let v=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),v=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),v=d),v&&(v.setAttribute("data-submenu-id",m),v.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(_=>{(_.tagName==="BUTTON"||_.tagName==="DIV")&&!_.classList.contains("dss-toolbar-dropdown-item")&&_.classList.add("dss-toolbar-dropdown-item")}))}})},kn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{Fl(l),l.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=v=>{const k=c.getAttribute("data-submenu-id");k&&$n(v,k)},m=F;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m}}),l.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=k=>{const _=c.getAttribute("data-submenu-id");_&&$n(k,_)},m=F;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(k=>{k.addEventListener("click",Sn)})})})};let Ln=null;const jt=()=>{if(Ke.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Ke.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Ke.value}"]`);o&&l&&To(o,l)}if(ze.value&&nn(),T.richText){if(Ln!==null)return;Ln=setTimeout(()=>{Ln=null,wn("handleWindowResize")},150)}},Jt=()=>{if(!T.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(l=>{Array.from(l.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},gl=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),l=s=>{if(s.preventDefault(),s.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};o.forEach(s=>{s.addEventListener("selectstart",l),s.addEventListener("mousedown",l),s.addEventListener("dragstart",l),s.addEventListener("contextmenu",l),s.addEventListener("click",r=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Gt.value?En():Al(),S.value?ml():Jn()})}),e.nextTick(()=>{gl()}),T.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Xl),window.addEventListener("resize",jt);let o=null;const l=()=>{o===null&&(o=setTimeout(()=>{o=null,jt()},150))};window.addEventListener("scroll",l,!0),f.value._windowScrollHandler=l,f.value._windowScrollTimeout=o,f.value.closest(".editor-with-comments"),f.value.closest(".dss-text-editor-content-wrapper");const s=f.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,jt()},150))};s&&(s.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{kn(),Jt()}),f.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!T.disabled&&m.preventDefault();const _=v.closest(".dss-image-no-alt-icon"),H=v.closest(".dss-image-wrapper");if(_||H&&v===H){m.preventDefault(),m.stopPropagation();const E=window.getSelection(),se=document.createRange();se.setStartAfter(H),se.collapse(!0),E.removeAllRanges(),E.addRange(se)}else H&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const E=window.getSelection();if(E.rangeCount>0){const j=E.getRangeAt(0).commonAncestorContainer,Ie=j.nodeType===3?j.parentElement:j;if(H.contains(Ie)&&Ie!==H.querySelector("img")){const Ve=document.createRange();Ve.setStartAfter(H),Ve.collapse(!0),E.removeAllRanges(),E.addRange(Ve)}}else{const se=document.createRange();se.setStartAfter(H),se.collapse(!0),E.addRange(se)}}))},!0),f.value.addEventListener("mousedown",m=>{const v=m.target,k=v.closest(".dss-image-no-alt-icon"),_=v.closest(".dss-image-wrapper");if(k||_&&v.tagName!=="IMG"){m.preventDefault();const H=window.getSelection(),E=document.createRange();_&&(E.setStartAfter(_),E.collapse(!0),H.removeAllRanges(),H.addRange(E))}},!0),f.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!f.value)return;f.value.querySelectorAll("img").forEach(k=>{if(!k.closest(".dss-image-wrapper"))k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="";else{const H=k.getAttribute("alt")||k.alt||"";if(H){const E=k.getAttribute("src")||k.src||"",se=E.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),j=H===E||H===se;(H.startsWith("http://")||H.startsWith("https://")||H.startsWith("data:")||j||j)&&(k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="")}}}),pn()})}),f.value.addEventListener("dragstart",m=>{const v=m.target,k=v.tagName==="IMG"?v:v.closest("img"),_=k?.closest(".dss-image-wrapper");k&&f.value.contains(k)&&(vt.value=_||k,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",m=>{vt.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",m=>{vt.value&&(m.preventDefault(),m.stopPropagation())}),f.value.addEventListener("drop",m=>{if(!vt.value||!f.value)return;m.preventDefault(),m.stopPropagation();const v=vt.value,k=v.classList?.contains("dss-image-wrapper"),_=k?v.querySelector("img"):v,H=k?v:_?.closest(".dss-image-wrapper");if(!_||!f.value.contains(_)){vt.value=null;return}let E=null;const se=m.clientX,j=m.clientY;if(document.caretRangeFromPoint)E=document.caretRangeFromPoint(se,j);else{const rn=window.getSelection();rn.rangeCount>0?E=rn.getRangeAt(0).cloneRange():(E=document.createRange(),E.selectNodeContents(f.value),E.collapse(!1))}if(!E){vt.value=null;return}const Ie=E.commonAncestorContainer,Ve=Ie.nodeType===3?Ie.parentElement:Ie;if(Ve?.closest(".dss-image-wrapper")===H||H&&H.contains(Ve)){vt.value=null;return}if(H&&(Ve===H||H.contains(Ve))){vt.value=null;return}const Cn=_.getAttribute("src");let vn=null;H?vn=H.cloneNode(!0):vn=_.cloneNode(!0);try{let rn=E.startContainer;if(rn.nodeType===3&&(rn=rn.parentElement),H&&(rn===H||H.contains(rn))){const dn=document.createRange();dn.setStartAfter(H),dn.collapse(!0),E=dn}E.insertNode(vn);const gn=document.createRange();gn.setStartAfter(vn),gn.collapse(!0);const un=window.getSelection();un.removeAllRanges(),un.addRange(gn)}catch{if(f.value.childNodes.length===0){const gn=document.createElement("p");gn.appendChild(vn),f.value.appendChild(gn)}else{const gn=f.value.lastChild;if(gn&&gn.nodeType===1)gn.appendChild(vn);else{const un=document.createElement("p");un.appendChild(vn),f.value.appendChild(un)}}}H?H.remove():_.remove(),vt.value=null,e.nextTick(()=>{const rn=f.value.querySelectorAll("img");let gn=!1;rn.forEach(un=>{if(un.getAttribute("src")===Cn)if(!gn)gn=!0;else{const dn=un.closest(".dss-image-wrapper");dn?dn.remove():un.remove()}}),pn(),ce()})}),f.value.addEventListener("dragend",m=>{vt.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(v=>{v.addedNodes.forEach(k=>{if(k.nodeType===1){k.tagName==="IMG"&&(k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="");const _=k.querySelectorAll&&k.querySelectorAll("img");_&&_.forEach(H=>{H.removeAttribute("alt"),H.removeAttribute("data-alt"),H.setAttribute("alt",""),H.setAttribute("data-alt",""),H.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{pn(),Jt(),d=null},100)});if(u.observe(f.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{Jt()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),T.modelValue){const m=Mt(T.modelValue);f.value.innerHTML=m,ht()}e.nextTick(()=>{const m=f.value.innerHTML||"",v=T.title||"",k=T.description||"";Et.value=m,K.value=v,W.value=k,X.value=v,pe.value=k,Mn(),pn(),$e(),kt(),ho(),Vn()}),fn(),ut(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Xl),window.removeEventListener("resize",jt),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),Ln!==null&&(clearTimeout(Ln),Ln=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),He.value&&clearTimeout(He.value),Lt.value&&clearTimeout(Lt.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),Oe.value&&Oe.value.disconnect(),mt.value!==null&&(cancelAnimationFrame(mt.value),mt.value=null),ct.value!==null&&(clearTimeout(ct.value),ct.value=null),wt.value!==null&&(clearTimeout(wt.value),wt.value=null),xn(!0),f.value&&f.value._scrollHandlers){const{wrapper:l,content:s,handler:r}=f.value._scrollHandlers;l&&l.removeEventListener("scroll",r),s&&s.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const Cl=o=>{const l=o.target,s=l.closest("a");if(s&&!T.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(s);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const r=l.closest(".dss-image-wrapper");r&&l.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(r.contains(m)&&m!==r.querySelector("img")){const v=document.createRange();v.setStartAfter(r),v.collapse(!0),c.removeAllRanges(),c.addRange(v)}}pn(),fn(),ut(),nn(),kt()}):e.nextTick(()=>{pn(),fn(),ut(),nn(),kt()})},Rt=()=>{pl();const o=window.getSelection();if(o&&o.rangeCount>0){const s=o.getRangeAt(0);Y.value=!s.collapsed&&Wt(s),!s.collapsed&&b.value&&(b.value=null)}else Y.value=!1;if(pn(),fn(),ut(),nn(),kt(),o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c&&c.closest(".dss-text-editor-footer")){o.removeAllRanges(),Y.value=!1;return}}["bold","italic","underline"].forEach(s=>{try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(!c.collapsed)if(s==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let m=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(m=!0),!m&&u.style&&parseInt(u.style.fontWeight)>=600&&(m=!0),!m))try{const v=window.getComputedStyle(u);parseInt(v.fontWeight)>=600&&(m=!0)}catch{}Q.value[s]=m}else{const d=document.queryCommandState(s);Q.value[s]=d}}}catch{}})},kt=()=>{if(!T.richText||T.disabled||!f.value){V.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){V.value="p";return}const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(!r||!f.value.contains(r)){V.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){V.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?V.value=d:V.value="p"}catch{V.value="p"}},ut=()=>{if(!f.value){je.value=!1;return}try{const o=window.getSelection();let l=!1;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");l=!!(c&&f.value.contains(c))}je.value=l}catch{je.value=!1}},Wt=o=>{if(!o||!f.value)return!1;const l=o.commonAncestorContainer;if(!l)return!1;const s=l.nodeType===3?l.parentElement:l;return s?f.value.contains(s):!1},Il=()=>{ze.value=!1},nn=()=>{if(!T.floatingToolbar||!T.richText||T.disabled){ze.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){ze.value=!1;return}const l=o.getRangeAt(0);if(l.collapsed||!Wt(l)){ze.value=!1;return}const s=l.getBoundingClientRect();if(!s||s.width===0&&s.height===0){ze.value=!1;return}const r=f.value;if(!r){ze.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){ze.value=!1;return}const d=40,u=8,m=s.top-d/2+15;let v=s.left+s.width/2;const k=window.innerWidth||document.documentElement.clientWidth||0;let _=0;it.value&&(_=it.value.getBoundingClientRect().width);const H=(_||320)/2;let E=c.left+H,se=c.right-H;if(se<E){const j=c.left+c.width/2;E=j,se=j}if(k>0){const j=H+u,Ie=k-H-u;if(E=Math.max(E,j),se=Math.min(se,Ie),se<E){const Ve=k/2;E=Ve,se=Ve}}v<E?v=E:v>se&&(v=se),we.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},ze.value=!0},Bl=o=>{T.disabled||!T.richText||(ot.value=ot.value===o?null:o,o==="askAi"&&(be.value=null))},Yl=()=>{ot.value=null,Ke.value=null},Pn=o=>{zn(o),Yl()};let il=null,cl=null,bl=null,wl=null;const Uo=o=>{if(T.disabled||!T.richText){Ml(),zl();return}const l=o.target,s=l.closest("a"),r=l.closest("img");if(il&&(clearTimeout(il),il=null),bl&&(clearTimeout(bl),bl=null),s&&s!==cl){zl(),cl=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),qe.value=s,me.value=c,U.value=!0,xe.value=!0,el(s)}else!s&&cl?(cl=null,il=setTimeout(()=>{xe.value||Ml()},150)):s&&s===cl&&el(s);if(r&&r!==wl){Ml(),wl=r;let c=r.getAttribute("alt");c===null&&(c=r.alt||"");let d=r.getAttribute("data-alt");d===null&&(d=c),r.hasAttribute("alt")||r.setAttribute("alt",c),r.hasAttribute("data-alt")||r.setAttribute("data-alt",d),yt.value=r,Ot.value=c.trim()||L("textEditor.image.noAlt"),xt.value=!0,he.value=!0,No(r)}else!r&&wl?(wl=null,bl=setTimeout(()=>{he.value||zl()},150)):r&&r===wl&&No(r)},xl=o=>{const l=o.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(cl=null,wl=null,il&&(clearTimeout(il),il=null),bl&&(clearTimeout(bl),bl=null),Ml(),zl())},Ml=()=>{xe.value=!1,setTimeout(()=>{xe.value||(U.value=!1,me.value="",Ae.value||(qe.value=null))},100)},el=o=>{if(!o||!f.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;R.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},zl=()=>{he.value=!1,setTimeout(()=>{he.value||(xt.value=!1,Ot.value="",bt.value||(yt.value=null))},100)},No=o=>{if(!o||!f.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;J.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Pl=()=>{if(!me.value||!qe.value)return;let l=qe.value.getAttribute("href")||me.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},Xo=()=>{if(qe.value){const o=qe.value.textContent||"",l=qe.value.getAttribute("href")||"",s=qe.value;nt.value=l,ft.value=o,Me.value=o,xe.value=!1,U.value=!1,me.value="",qe.value=s,Ae.value=!0}else if(Ce.value){const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(r){const c=r.textContent||"",d=r.getAttribute("href")||"";nt.value=d,ft.value=c,Me.value=c,qe.value=r,Ae.value=!0}}}else{Ee.value=Qt();const o=window.getSelection();let l="";o.rangeCount>0&&(l=o.getRangeAt(0).toString()),nt.value="",ft.value=l,Me.value="",qe.value=null,Ae.value=!0}e.nextTick(()=>{Z.value&&(Z.value.focus(),Z.value.select())})},Ol=()=>{Ae.value=!1,nt.value="",ft.value="",Me.value="",qe.value=null,Ee.value=null},mo=()=>{if(!nt.value.trim()){Ol();return}if(Pe.value?(He.value&&(clearTimeout(He.value),He.value=null),at(),Pe.value=!1):at(),ft.value.trim()||(ft.value=nt.value.trim()),qe.value&&f.value&&f.value.contains(qe.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const l=qe.value;if(l.setAttribute("href",nt.value.trim()),ft.value.trim()!==Me.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=ft.value.trim()}l.style.color="#60afdf",l.style.textDecoration="underline";const s=document.createRange();s.selectNodeContents(l),s.collapse(!1),o.removeAllRanges(),o.addRange(s),ce()}else if(f.value){f.value.focus();const o=window.getSelection();o.removeAllRanges(),Ee.value&&an(Ee.value);let l=null;if(o.rangeCount>0&&(l=o.getRangeAt(0)),l&&!l.collapsed){l.toString();const s=document.createElement("a");s.href=nt.value.trim(),s.textContent=ft.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",l.deleteContents(),l.insertNode(s);const r=document.createTextNode(" ");l.setStartAfter(s),l.insertNode(r),l.setStartAfter(r),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}else{l||(l=document.createRange(),l.selectNodeContents(f.value),l.collapse(!1));const s=l.startContainer,r=s.nodeType===3,c=r&&l.startOffset===s.textContent.length,d=document.createElement("a");if(d.href=nt.value.trim(),d.textContent=ft.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=s.parentElement;for(;u&&u!==f.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==f.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const v=document.createTextNode(" ");m.appendChild(v);const k=document.createRange();k.setStartAfter(d),k.collapse(!0),o.removeAllRanges(),o.addRange(k)}else{if(l.startOffset>0){const k=s.textContent.substring(0,l.startOffset),_=k[k.length-1];if(_&&_!==" "&&_!==" "&&_!==`
102
+ `){const H=document.createTextNode(" ");l.insertNode(H),l.setStartAfter(H)}}l.insertNode(d);const v=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(v),l.setStartAfter(v),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}}else{if(r&&l.startOffset>0){const m=s.textContent.substring(0,l.startOffset),v=m[m.length-1];if(v&&v!==" "&&v!==" "&&v!==`
103
+ `){const k=document.createTextNode(" ");l.insertNode(k),l.setStartAfter(k)}}l.insertNode(d);const u=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(u),l.setStartAfter(u),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}ce()}e.nextTick(()=>{fn(),Ol()})},jl=()=>{if(!f.value||G.value)return;const o=window.getSelection();let l=null;o&&o.rangeCount>0&&(l=Qt());const s=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,r=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const v=m.parentElement;return!v||v.closest("a")||v.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=r.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const v=c[m],k=v.textContent;s.lastIndex=0;const _=[...k.matchAll(s)];if(_.length===0)continue;const H=_.filter(j=>{const Ie=j[0],Ve=j.index;if(Ve>0&&k[Ve-1]==="@"||Ve+Ie.length<k.length&&k[Ve+Ie.length]==="@")return!1;const lt=v.parentElement;return!(lt&&lt.closest("a"))});if(H.length===0)continue;if(H.length===1&&H[0][0]===k.trim()){const j=H[0][0],Ie=j.startsWith("http://")||j.startsWith("https://")?j:`https://${j}`,Ve=document.createElement("a");Ve.href=Ie,Ve.textContent=j,Ve.style.color="#60afdf",Ve.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(Ve,v),u=!0);continue}let E=0;const se=document.createDocumentFragment();if(H.forEach(j=>{const Ie=j.index,Ve=j[0];if(Ie>E){const vn=k.substring(E,Ie);vn&&se.appendChild(document.createTextNode(vn))}const lt=Ve.startsWith("http://")||Ve.startsWith("https://")?Ve:`https://${Ve}`,Cn=document.createElement("a");Cn.href=lt,Cn.textContent=Ve,Cn.style.color="#60afdf",Cn.style.textDecoration="underline",se.appendChild(Cn),E=Ie+Ve.length}),E<k.length){const j=k.substring(E);j&&se.appendChild(document.createTextNode(j))}v.parentNode&&se.childNodes.length>0&&(v.parentNode.replaceChild(se,v),u=!0)}u&&l&&e.nextTick(()=>{an(l),fn()})},Bo=()=>{if(!f.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,l=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),s=[];let r;for(;r=l.nextNode();)s.push(r);for(let c=s.length-1;c>=0;c--){const d=s[c],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let v=0;const k=document.createDocumentFragment();m.forEach(_=>{const H=_.index,E=_[0].startsWith("<u>")?"u":"ins",se=_[1]||_[2]||"";H>v&&k.appendChild(document.createTextNode(u.substring(v,H)));const j=document.createElement(E);j.textContent=se,k.appendChild(j),v=H+_[0].length}),v<u.length&&k.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&k.childNodes.length>0&&d.parentNode.replaceChild(k,d)}},Mo=o=>{if(!f.value||G.value)return;if(!o){Bo();return}if(!["*","_",">"].includes(o))return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const r=s.getRangeAt(0);if(!r.collapsed)return;const c=r.startContainer.nodeType===Node.TEXT_NODE?r.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):r.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===f.value||!f.value.contains(c))return;const d=()=>{let vn="",rn=0,gn=!1;const un=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Yn=>Yn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let dn=0;for(;un.nextNode();){const Yn=un.currentNode,ul=Yn.textContent||"",hl=dn;if(dn+=ul.length,Yn===r.startContainer){vn+=ul.substring(0,r.startOffset),rn=hl+r.startOffset,gn=!0;break}vn+=ul}return gn||(rn=vn.length),{textBeforeCursor:vn,cursorCharOffset:rn}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,v=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?v="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?v="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(v=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const k=m[0],_=m[1],H=u.length-k.length,se=(vn=>{let rn=0;const gn=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:dn=>dn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let un;for(;un=gn.nextNode();){const dn=(un.textContent||"").length;if(rn+dn>=vn)return{node:un,offset:vn-rn};rn+=dn}return null})(H);if(!se)return;const j=document.createRange();j.setStart(se.node,se.offset),j.setEnd(r.endContainer,r.endOffset);const Ie=document.createElement(v);Ie.textContent=_,j.deleteContents(),j.insertNode(Ie);const Ve=window.getSelection(),lt=document.createRange();lt.setStartAfter(Ie),lt.collapse(!0),Ve.removeAllRanges(),Ve.addRange(lt);const Cn=Qt();e.nextTick(()=>{ce(),Cn&&an(Cn)})},po=()=>{f.value&&(Ut.value=Qt(),It.value="",Pt.value="",Xe.value="",oe.value="",ve.value="",en.value=null,yt.value=null,Be.value="upload",bt.value=!0,cn(),e.nextTick(()=>{Fe.value&&Fe.value.focus(),De.value&&(De.value.value="")}))},tl=o=>{const l=o.target?.files?.[0];if(!l){en.value=null,Pt.value="";return}en.value=l;const s=new FileReader;s.onload=r=>{Pt.value=r.target?.result||""},s.readAsDataURL(l)},nl=()=>{De.value&&De.value.click()},Kl=()=>{oe.value&&(ve.value="")},fo=()=>{ve.value&&(oe.value="")},_o=()=>{let o=yt.value;if(!o){const l=window.getSelection();if(l&&l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(o){const l=o.getAttribute("data-alt")||o.getAttribute("alt")||"";yt.value=o,It.value=l.trim()===""||l.trim()==="Image"?"":l;const s=o.getAttribute("src")||o.src||"";s.startsWith("http://")||s.startsWith("https://")?(Xe.value=s,Pt.value="",Be.value="url"):(Pt.value=s,Xe.value="",Be.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";oe.value=c.endsWith("px")?c.replace("px",""):c,ve.value=d.endsWith("px")?d.replace("px",""):d,Ut.value=null}else{po();return}bt.value=!0,he.value=!1,xt.value=!1,e.nextTick(()=>{Be.value==="url"&&Zt.value?(Zt.value.focus(),Zt.value.select()):Fe.value&&(Fe.value.focus(),Fe.value.select()),De.value&&(De.value.value="")})},_l=()=>{bt.value=!1,It.value="",Pt.value="",Xe.value="",oe.value="",ve.value="",en.value=null,yt.value=null,Ut.value=null,Be.value="upload"},Hn=()=>{const o=(It.value||"").trim(),l=f.value?._mutationObserver;l&&l.disconnect(),Pe.value?(He.value&&(clearTimeout(He.value),He.value=null),at(),Pe.value=!1):at();const s=Be.value==="url"?Xe.value.trim():Pt.value;if(yt.value&&f.value&&f.value.contains(yt.value)){s&&(yt.value.src=s),yt.value.setAttribute("alt",o),yt.value.setAttribute("data-alt",o),oe.value?(yt.value.style.width=`${oe.value}px`,yt.value.setAttribute("width",oe.value)):(yt.value.style.removeProperty("width"),yt.value.removeAttribute("width")),ve.value?(yt.value.style.height=`${ve.value}px`,yt.value.setAttribute("height",ve.value)):(yt.value.style.removeProperty("height"),yt.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(yt.value),c.collapse(!0),r.addRange(c)}ce()}else{if(!s){l&&f.value&&l.observe(f.value,{childList:!0,subtree:!0}),_l();return}if(f.value){f.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(Ut.value&&(an(Ut.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){_l();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!f.value.contains(m)){if(d=document.createRange(),f.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",f.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const v=document.createElement("img");v.src=s,v.setAttribute("alt",o),v.setAttribute("data-alt",o),oe.value&&(v.style.width=`${oe.value}px`,v.setAttribute("width",oe.value)),ve.value&&(v.style.height=`${ve.value}px`,v.setAttribute("height",ve.value));try{d.insertNode(v),d.setStartAfter(v),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(f.value){if(f.value.childNodes.length===0){const H=document.createElement("p");f.value.appendChild(H),H.appendChild(v)}else{const H=f.value.lastChild;if(H&&H.nodeType===1)H.appendChild(v);else{const E=document.createElement("p");f.value.appendChild(E),E.appendChild(v)}}const _=document.createRange();_.setStartAfter(v),_.collapse(!0),c&&(c.removeAllRanges(),c.addRange(_))}}yt.value=v,ce()}}e.nextTick(()=>{l&&f.value&&l.observe(f.value,{childList:!0,subtree:!0}),fn(),nn(),_l()})};e.watch(()=>T.modelValue,o=>{if(T.richText&&f.value&&!G.value){const l=Mt(o||""),r=f.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=l.replace(/&nbsp;|\u00A0/g," ");if(r!==c){const d=Qt();f.value.innerHTML=l,e.nextTick(()=>{ht();const u=f.value.innerHTML||"",m=T.title||"",v=T.description||"";Et.value=u,K.value=m,W.value=v,St.value=u,X.value=m,pe.value=v,Ge.value=[],Dt.value=[],He.value&&(clearTimeout(He.value),He.value=null),Pe.value=!1,d&&an(d),Mn(),pn(),$e(),fn(),nn(),kt(),wn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>T.richText,o=>{o?(nn(),e.nextTick(()=>{ho()})):(Il(),ne.value=[],Oe.value&&(Oe.value.disconnect(),Oe.value=null)),kt()}),e.watch(()=>T.floatingToolbar,o=>{o?nn():Il()}),e.watch(()=>T.disabled,o=>{o&&Il(),kt()}),e.watch(()=>T.description,()=>{e.nextTick(()=>{S.value?ml():Jn()})}),e.watch(()=>T.title,()=>{e.nextTick(()=>{Gt.value?En():Al()})}),e.watch(()=>T.customToolbarSlots,()=>{e.nextTick(()=>{Jt()})},{deep:!0}),e.watch(()=>T.comments,(o,l)=>{if(pt.value){pt.value=!1;return}Ht.value||T.richText&&f.value&&e.nextTick(()=>{Vn()})},{deep:!0,immediate:!1});const Vn=()=>{if(!Ht.value&&!(!T.comments||!Array.isArray(T.comments)||T.comments.length===0)&&!(!T.richText||!f.value)){Ht.value=!0;try{const o=new Set,l=T.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),s=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=s.length;s.forEach(u=>{const m=u.parentNode;if(m){for(;u.firstChild;)m.insertBefore(u.firstChild,u);m.removeChild(u)}});let c=0;const d=new Set;l.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const m=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!m)return;const v=String(m);if(d.has(v))return;const k=f.value.querySelector(`[data-comment="${v}"]`);if(k){Kt(k,u),d.add(v);return}try{const _=Yo(u.selection_range,u.selection_text);if(_&&!_.collapsed){const H=_.commonAncestorContainer,E=H.nodeType===3?H.parentElement:H;if(E){const Ie=E.closest("[data-comment], [data-fake-comment]");if(Ie){const Ve=Ie.getAttribute("data-comment")||Ie.getAttribute("data-fake-comment");if(String(Ve)===String(m)){Ie.setAttribute("data-comment",v),Ie.removeAttribute("data-fake-comment"),Kt(Ie,u),d.add(v);return}else return}}const se=f.value.querySelector(`[data-comment="${v}"]`);if(se){Kt(se,u),d.add(v);return}const j=document.createElement("span");j.setAttribute("data-comment",v),Kt(j,u);try{_.surroundContents(j),c++,d.add(v)}catch{try{const Ve=document.createRange();Ve.setStart(_.startContainer,_.startOffset),Ve.setEnd(_.endContainer,_.endOffset),vo(Ve),Ve.surroundContents(j),c++,d.add(v)}catch{try{const lt=_.extractContents();j.appendChild(lt),_.insertNode(j),c++,d.add(v)}catch(lt){console.warn("Failed to create comment marker:",lt)}}}}}catch{}}),e.nextTick(()=>{wn("restoreCommentsFromModel"),ce(),Ht.value=!1})}catch{Ht.value=!1}}},vo=o=>{if(!o||!f.value)return o;try{const l=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let s=o.startContainer,r=o.startOffset;if(s.nodeType===3){const u=s.parentElement;u&&l.includes(u.tagName)&&(r===0&&!Xt(s)||o.setStartBefore(u))}else s.nodeType===1&&l.includes(s.tagName)&&r>0&&o.setStartBefore(s);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&l.includes(u.tagName)&&(d===c.length&&!$o(c)||o.setEndAfter(u))}else c.nodeType===1&&l.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},Xt=o=>{let l=o.previousSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.previousSibling}return!1},$o=o=>{let l=o.nextSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.nextSibling}return!1},Yo=(o,l)=>{if(!o||!f.value)return null;try{const s=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(s.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(s.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}return u?vo(s):null}}catch{return null}return null},Kt=(o,l)=>{if(!o||!l)return;const s=l.conversation||[],r=new Set,c=[],d=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),c.push(m))};s.length>0&&s.forEach(m=>{m.user&&d(m.user)}),c.length>0?o.setAttribute("data-comment-user",JSON.stringify(c[0])):o.removeAttribute("data-comment-user"),c.length>1?o.setAttribute("data-comment-user-2",JSON.stringify(c[1])):o.removeAttribute("data-comment-user-2");const u=s.length;u>0?o.setAttribute("data-comment-count",String(u)):o.removeAttribute("data-comment-count")},wn=(o="unknown")=>{if(!T.richText||!f.value){ne.value=[];return}Date.now()-Vt.value<Nt&&mt.value!==null||mt.value===null&&(mt.value=requestAnimationFrame(()=>{if(mt.value=null,Vt.value=Date.now(),We.value)return;We.value=!0;const s={},r=f.value;if(!r){We.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){We.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(E=>{const se=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");se&&E.tagName==="SPAN"&&(m.has(se)||(u.push(E),m.add(se)))}),d.forEach(E=>{const se=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");!se||m.has(se)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(E.tagName)?E.querySelector(`span[data-comment="${se}"], span[data-fake-comment="${se}"]`)||(u.push(E),m.add(se)):E.tagName!=="SPAN"&&(u.push(E),m.add(se)))});const v=c.getBoundingClientRect(),k=r.getBoundingClientRect();u.forEach((E,se)=>{let j=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");if(!j)return;if(typeof j=="string"&&j.startsWith("comment-")){const dl=E.textContent?.trim(),ll=T.comments?.find(jn=>(typeof jn.conversation_id=="string"&&jn.conversation_id.startsWith("comment-")?null:jn.conversation_id)&&jn.selection_text?.trim()===dl);ll?(j=String(ll.conversation_id),E.setAttribute("data-comment",j),E.removeAttribute("data-fake-comment")):(j=String(Date.now()),E.setAttribute("data-comment",j),E.removeAttribute("data-fake-comment"))}const Ie=E.getBoundingClientRect(),Ve=window.getComputedStyle(E),lt=parseFloat(Ve.lineHeight)||parseFloat(Ve.fontSize)*1.2,rn=Ie.top-k.top+lt/2-15,un=k.top-v.top+rn;let dn=null,Yn=null,ul=0;const hl=[],yo=new Set;if(j&&T.comments){const dl=T.comments.find(ll=>String(ll.conversation_id||ll.id)===String(j));if(dl){const ll=dl.conversation||[];ll.length>0?(ll.forEach(jn=>{jn.user&&jn.user.id&&!yo.has(jn.user.id)&&(yo.add(jn.user.id),hl.push(jn.user))}),ul=ll.length):(ul=0,dn=null,Yn=null),hl.length>0?dn=hl[0]:dn=null,hl.length>1?Yn=hl[1]:Yn=null}}const Ao=Ie.top+lt/2-15,jo=Ao+30,El=5,ko=jo>k.top+El&&Ao<k.bottom-El?1:0;ne.value.find(dl=>dl.id===j);let Gl=E;if(!Gl&&j&&f.value){const dl=String(j);Gl=f.value.querySelector(`[data-comment="${dl}"], [data-fake-comment="${dl}"]`)}const Do=hl.length;s[j]?(s[j].top=un,s[j].opacity=ko,s[j].element=Gl,s[j].firstUser=dn,s[j].secondUser=Yn,s[j].totalCount=ul,s[j].uniqueUserCount=Do):s[j]={id:j,top:un,opacity:ko,element:Gl,firstUser:dn,secondUser:Yn,totalCount:ul,uniqueUserCount:Do}});const _=Object.values(s).map(E=>{const se=Math.max(0,(E.uniqueUserCount??0)-2);if(!E.element&&E.id&&f.value){const Ie=String(E.id);E.element=f.value.querySelector(`[data-comment="${Ie}"], [data-fake-comment="${Ie}"]`)}return{...E,firstUser:E.firstUser||null,secondUser:E.secondUser||null,totalCount:E.totalCount,additionalCount:se}});(ne.value.length!==_.length||_.some((E,se)=>{const j=ne.value[se];if(!j)return!0;const Ie=(j.firstUser?.id||null)!==(E.firstUser?.id||null),Ve=(j.secondUser?.id||null)!==(E.secondUser?.id||null);return j.id!==E.id||Math.abs(j.top-E.top)>1||j.opacity!==E.opacity||j.totalCount!==E.totalCount||j.additionalCount!==E.additionalCount||Ie||Ve||j.element!==E.element}))&&(ne.value=_),We.value=!1}))},Lo=o=>{if(!o)return;let l=o.element;if(!l&&o.id&&f.value){const s=String(o.id);l=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}l&&(xn(),Un.value=l,l.classList.add("editor-comment-highlighted"))},xn=(o=!1)=>{!o&&$t.value!==null&&Un.value&&(Un.value.getAttribute("data-comment")||Un.value.getAttribute("data-fake-comment"))===$t.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),Un.value&&(Un.value.classList.remove("editor-comment-highlighted"),Un.value=null))},go=o=>{if(!o||!o.element)return;xn(!0);const l=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!l)return;const s=`[data-comment="${l}"], [data-fake-comment="${l}"]`;fe("comment-marker-clicked",{commentId:l,selector:s,element:o.element})},$l=()=>{xn()},ho=()=>{!T.richText||!f.value||(Oe.value&&Oe.value.disconnect(),wt.value!==null&&(clearTimeout(wt.value),wt.value=null),Oe.value=new MutationObserver(()=>{wt.value===null&&(wt.value=setTimeout(()=>{wt.value=null,e.nextTick(()=>{wn("MutationObserver")})},200))}),Oe.value.observe(f.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),wn("setupCommentMarkersObserver-initial"))},To=(o,l)=>{if(!o||!l)return;const s=l.getBoundingClientRect();let r=s.top,c=s.right+4;o.style.top=`${r}px`,o.style.left=`${c}px`,o.offsetHeight;const d=o.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const v=s.left-d.width-4;o.style.left=`${v}px`}if(d.bottom>m){const v=Math.max(8,m-d.height-8);o.style.top=`${v}px`}d.top<0&&(o.style.top="8px")};return e.watch(()=>Ke.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const r=s.getAttribute("data-submenu-id");if(r===o&&o){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(c){if(s.parentNode!==document.body){const d=s.parentNode;s.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(s)}s.style.display="block",s.style.visibility="hidden",s.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{To(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,ot.value],()=>{be.value==="askAi"||ot.value==="askAi"?e.nextTick(()=>{kn()}):(Ke.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(l=>{if(l.parentNode===document.body){const s=l.getAttribute("data-submenu-id");if(s){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(r)if(l.dataset.originalParentRef==="inside")r.appendChild(l);else{const d=r.closest(".dss-toolbar-dropdown");d&&d.insertBefore(l,r.nextSibling)}}}})}))}),e.watch(()=>T.locale,o=>{o&&o!==de.value&&(de.value=o)},{immediate:!0}),le({openCommentOverlayForSelector:So,updateCommentMarkers:wn,restoreCommentsFromModel:Vn}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",Ct.value]),style:e.normalizeStyle(At.value)},[D.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Tu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:gt,title:e.unref(L)("textEditor.toolbar.undo")},[...l[45]||(l[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Au),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Tn.value}]),onClick:ae,title:e.unref(L)("textEditor.toolbar.redo")},[...l[46]||(l[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,Du),l[61]||(l[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Hu,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=s=>In("paragraph")),title:e.unref(L)("textEditor.toolbar.paragraphFormat")},[V.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:I.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Fu)):V.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:I.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Iu)):V.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:I.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,zu)):V.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:I.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Pu)):V.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:I.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Ou)):V.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:I.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,qu)):(e.openBlock(),e.createElementBlock("svg",Wu,[...l[47]||(l[47]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[48]||(l[48]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Ru),be.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[8]||(l[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[1]||(l[1]=s=>zn("<h1>"))},[e.createElementVNode("img",{src:I.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Zu),e.createElementVNode("h1",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[2]||(l[2]=s=>zn("<h2>"))},[e.createElementVNode("img",{src:I.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Uu),e.createElementVNode("h2",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[3]||(l[3]=s=>zn("<h3>"))},[e.createElementVNode("img",{src:I.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Xu),e.createElementVNode("h3",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[4]||(l[4]=s=>zn("<h4>"))},[e.createElementVNode("img",{src:I.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Yu),e.createElementVNode("h4",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[5]||(l[5]=s=>zn("<h5>"))},[e.createElementVNode("img",{src:I.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,ju),e.createElementVNode("h5",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[6]||(l[6]=s=>zn("<h6>"))},[e.createElementVNode("img",{src:I.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Ku),e.createElementVNode("h6",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[7]||(l[7]=s=>zn("<p>"))},[l[49]||(l[49]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":tn("bold")}]),onClick:l[9]||(l[9]=s=>Bn("bold")),title:e.unref(L)("textEditor.toolbar.bold")},[...l[50]||(l[50]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,Gu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":tn("italic")}]),onClick:l[10]||(l[10]=s=>Bn("italic")),title:e.unref(L)("textEditor.toolbar.italic")},[...l[51]||(l[51]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,Qu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":tn("underline")}]),onClick:l[11]||(l[11]=s=>Bn("underline")),title:e.unref(L)("textEditor.toolbar.underline")},[...l[52]||(l[52]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Ju),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":je.value}]),onClick:Nl,title:e.unref(L)("textEditor.toolbar.citation")},[...l[53]||(l[53]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,ed),l[62]||(l[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:Ul,title:e.unref(L)("textEditor.toolbar.removeLink")},[...l[55]||(l[55]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,nd)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Zl,title:e.unref(L)("textEditor.toolbar.insertLink")},[...l[54]||(l[54]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,td)),l[63]||(l[63]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":tn("insertUnorderedList")}]),onClick:sl,title:e.unref(L)("textEditor.toolbar.bulletList")},[...l[56]||(l[56]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,ld),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":tn("insertOrderedList")}]),onClick:Hl,title:e.unref(L)("textEditor.toolbar.numberList")},[...l[57]||(l[57]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,od),l[64]||(l[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:po,title:e.unref(L)("textEditor.toolbar.image")},[...l[58]||(l[58]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,ad),Y.value?(e.openBlock(),e.createElementBlock("div",sd)):e.createCommentVNode("",!0),Y.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(L)("textEditor.toolbar.comment"),onClick:Dn},[...l[59]||(l[59]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,rd)):e.createCommentVNode("",!0),D.askAi?(e.openBlock(),e.createElementBlock("div",id)):e.createCommentVNode("",!0),D.askAi?(e.openBlock(),e.createElementBlock("div",cd,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=s=>In("askAi")),title:e.unref(L)("textEditor.toolbar.askAi")},[l[60]||(l[60]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",dd,e.toDisplayString(e.unref(L)("textEditor.toolbar.askAi")),1)],8,ud),be.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[13]||(l[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",md,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.customToolbarSlots,(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[A(s)?(e.openBlock(),e.createElementBlock("div",pd,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),A(s)&&r<D.customToolbarSlots.length-1&&O(r)?(e.openBlock(),e.createElementBlock("div",fd)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(be.value==="paragraph"||be.value==="askAi")&&D.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:cn})):e.createCommentVNode("",!0),e.createVNode(ea,{showModal:Ae.value,width:"500px",height:"55vh",onCloseModal:Ol},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(L)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",vd,[e.createElementVNode("div",gd,[e.createElementVNode("label",hd,e.toDisplayString(e.unref(L)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Ue,type:"text","onUpdate:modelValue":l[15]||(l[15]=s=>ft.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.link.enterAltText"),onKeyup:e.withKeys(mo,["enter"])},null,40,yd),[[e.vModelText,ft.value]])]),e.createElementVNode("div",kd,[e.createElementVNode("label",Cd,e.toDisplayString(e.unref(L)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Z,type:"text","onUpdate:modelValue":l[16]||(l[16]=s=>nt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.link.enterUrl"),onKeyup:e.withKeys(mo,["enter"])},null,40,bd),[[e.vModelText,nt.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Ol},e.toDisplayString(e.unref(L)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:mo},e.toDisplayString(e.unref(L)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(ea,{showModal:bt.value,width:"500px",height:"80vh",onCloseModal:_l},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(yt.value?e.unref(L)("textEditor.image.editImage"):e.unref(L)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",wd,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Be.value==="upload"}]),onClick:l[17]||(l[17]=s=>Be.value="upload")},e.toDisplayString(e.unref(L)("textEditor.image.upload")),3),l[65]||(l[65]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Be.value==="url"}]),onClick:l[18]||(l[18]=s=>Be.value="url")},e.toDisplayString(e.unref(L)("textEditor.image.imageLink")),3)]),Be.value==="upload"?(e.openBlock(),e.createElementBlock("div",xd,[e.createElementVNode("div",Ed,[e.createElementVNode("div",Sd,[On.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Vd,e.toDisplayString(e.unref(L)("textEditor.image.uploadImage")),1)),On.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:nl},[e.createElementVNode("img",{src:Pt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Nd),l[66]||(l[66]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:De,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:tl},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:De,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:tl},null,544))]),e.createElementVNode("div",Bd,[e.createElementVNode("label",Md,e.toDisplayString(e.unref(L)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Fe,type:"text","onUpdate:modelValue":l[19]||(l[19]=s=>It.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Hn,["enter"])},null,40,_d),[[e.vModelText,It.value]])]),e.createElementVNode("div",$d,[e.createElementVNode("label",Ld,e.toDisplayString(e.unref(L)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=s=>oe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(Hn,["enter"]),onInput:Kl},null,40,Td),[[e.vModelText,oe.value]])]),e.createElementVNode("div",Ad,[e.createElementVNode("label",Dd,e.toDisplayString(e.unref(L)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=s=>ve.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(Hn,["enter"]),onInput:fo},null,40,Hd),[[e.vModelText,ve.value]])])])])):e.createCommentVNode("",!0),Be.value==="url"?(e.openBlock(),e.createElementBlock("div",Rd,[e.createElementVNode("div",Fd,[e.createElementVNode("div",Id,[e.createElementVNode("label",zd,e.toDisplayString(e.unref(L)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Zt,type:"text","onUpdate:modelValue":l[22]||(l[22]=s=>Xe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(Hn,["enter"])},null,40,Pd),[[e.vModelText,Xe.value]])]),e.createElementVNode("div",Od,[e.createElementVNode("label",qd,e.toDisplayString(e.unref(L)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=s=>It.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Hn,["enter"])},null,40,Wd),[[e.vModelText,It.value]])]),e.createElementVNode("div",Zd,[e.createElementVNode("label",Ud,e.toDisplayString(e.unref(L)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=s=>oe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(Hn,["enter"]),onInput:Kl},null,40,Xd),[[e.vModelText,oe.value]])]),e.createElementVNode("div",Yd,[e.createElementVNode("label",jd,e.toDisplayString(e.unref(L)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=s=>ve.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(Hn,["enter"]),onInput:fo},null,40,Kd),[[e.vModelText,ve.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:_l},e.toDisplayString(e.unref(L)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Hn},e.toDisplayString(e.unref(L)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":et.value&&Gt.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.labels.title")),1),e.createElementVNode("div",Gd,[Gt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Qd,[D.title?(e.openBlock(),e.createElementBlock("span",Jd,e.toDisplayString(D.title),1)):(e.openBlock(),e.createElementBlock("span",e1,e.toDisplayString(qn.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:ye,value:D.title,onInput:Wl,onFocus:oo,onBlur:ql,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Gt.value}]),placeholder:qn.value,disabled:D.disabled,rows:"1"},null,42,t1)])],2),et.value&&Gt.value?(e.openBlock(),e.createElementBlock("div",n1,[e.renderSlot(o.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":rt.value&&S.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.labels.description")),1),e.createElementVNode("div",l1,[S.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",o1,[D.description?(e.openBlock(),e.createElementBlock("span",a1,e.toDisplayString(D.description),1)):(e.openBlock(),e.createElementBlock("span",s1,e.toDisplayString(Rn.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Je,value:D.description,onInput:yn,onFocus:Vl,onBlur:ao,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!S.value}]),placeholder:Rn.value,disabled:D.disabled,rows:"1"},null,42,r1)])],2),rt.value&&S.value?(e.openBlock(),e.createElementBlock("div",i1,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ne.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":$t.value===s.id,"editor-comment-marker-group-out-of-view":s.opacity===0}]),"data-comment-id":s.id,style:e.normalizeStyle({top:s.top+"px"}),onMouseenter:r=>Lo(s),onMouseleave:$l},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>go(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,d1)):(e.openBlock(),e.createElementBlock("span",m1,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,u1)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>go(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,f1)):(e.openBlock(),e.createElementBlock("span",v1,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,p1)):e.createCommentVNode("",!0),s.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:s.secondUser?"30px":"15px"}),"data-has-second-user":s.secondUser?"true":"false",onClick:e.withModifiers(r=>go(s),["stop"])},[e.createElementVNode("span",h1,"+"+e.toDisplayString(s.additionalCount),1)],12,g1)):e.createCommentVNode("",!0)],46,c1))),128)),D.richText?(e.openBlock(),e.createElementBlock("div",E1,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":D.disabled,"dss-text-editor-fixed-height":D.fixedHeight}]),style:e.normalizeStyle(bn.value),onInput:ce,onBlur:st,onClick:Cl,onMouseup:Rt,onKeyup:Rt,onKeydown:uo,onPaste:Zo,onMousemove:Uo,onMouseleave:xl},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[$t.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(rl.value)},[x.value||re.value.length>0?(e.openBlock(),e.createElementBlock("div",S1,[e.createElementVNode("div",V1,[x.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:x.value},null,8,N1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",B1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(s,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:"dss-comment-message"},[s.user&&(s.user.avatar||s.user.initials||s.user.name)?(e.openBlock(),e.createElementBlock("div",M1,[e.createElementVNode("div",_1,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,$1)):(e.openBlock(),e.createElementBlock("span",L1,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",T1,[e.createElementVNode("div",A1,[e.createElementVNode("div",D1,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",H1,e.toDisplayString(An(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":Fn(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),T.commentUser&&s.user&&s.user.id===T.commentUser.id&&!Fn(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>kl(s,r),["stop"]),title:e.unref(L)("textEditor.comment.delete")||"Delete comment"},[...l[68]||(l[68]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,R1)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",F1,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:h,"onUpdate:modelValue":l[26]||(l[26]=s=>y.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(L)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Wn,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(h.value){const s=h.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,I1),[[e.vModelText,y.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Wn,["stop"])},[...l[69]||(l[69]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",z1,[e.createElementVNode("div",P1,[e.createElementVNode("span",O1,e.toDisplayString(qt.value)+" "+e.toDisplayString(qt.value===1?e.unref(L)("textEditor.footer.word"):e.unref(L)("textEditor.footer.words")),1),l[70]||(l[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",q1,e.toDisplayString(ln.value)+" "+e.toDisplayString(ln.value===1?e.unref(L)("textEditor.footer.character"):e.unref(L)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",y1,[e.createElementVNode("textarea",{value:D.modelValue,onInput:Qn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":D.fixedHeight}]),placeholder:Nn.value,rows:D.rows,disabled:D.disabled,style:e.normalizeStyle(Bt.value)},null,46,k1),e.createElementVNode("div",C1,[e.createElementVNode("div",b1,[e.createElementVNode("span",w1,e.toDisplayString(qt.value)+" "+e.toDisplayString(qt.value===1?e.unref(L)("textEditor.footer.word"):e.unref(L)("textEditor.footer.words")),1),l[67]||(l[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",x1,e.toDisplayString(ln.value)+" "+e.toDisplayString(ln.value===1?e.unref(L)("textEditor.footer.character"):e.unref(L)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[U.value&&me.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(R.value),onMouseenter:l[28]||(l[28]=s=>xe.value=!0),onMouseleave:Ml},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Pl,["stop"]),title:me.value},e.toDisplayString(me.value),9,W1),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Xo,["stop"]),title:e.unref(L)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",U1,[...l[71]||(l[71]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,Z1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[xt.value&&Ot.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(J.value),onMouseenter:l[29]||(l[29]=s=>he.value=!0),onMouseleave:zl},[e.createElementVNode("div",X1,[Ot.value===e.unref(L)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Y1,[...l[72]||(l[72]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:Ot.value},e.toDisplayString(Ot.value),9,j1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(_o,["stop"]),title:e.unref(L)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",G1,[...l[73]||(l[73]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,K1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[D.floatingToolbar&&D.richText&&ze.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:it,class:"dss-floating-toolbar",style:e.normalizeStyle(we.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Q1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(gt,["stop"]),title:e.unref(L)("textEditor.toolbar.undo")},[...l[74]||(l[74]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,J1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Tn.value}]),onClick:e.withModifiers(ae,["stop"]),title:e.unref(L)("textEditor.toolbar.redo")},[...l[75]||(l[75]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,em),l[89]||(l[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",tm,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(s=>Bl("paragraph"),["stop"])),title:e.unref(L)("textEditor.toolbar.paragraphFormat")},[V.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:I.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,lm)):V.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:I.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,om)):V.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:I.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,am)):V.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:I.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,sm)):V.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:I.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,rm)):V.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:I.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,im)):(e.openBlock(),e.createElementBlock("svg",cm,[...l[76]||(l[76]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[77]||(l[77]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,nm),ot.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[38]||(l[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[31]||(l[31]=s=>Pn("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[32]||(l[32]=s=>Pn("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[33]||(l[33]=s=>Pn("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[34]||(l[34]=s=>Pn("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[35]||(l[35]=s=>Pn("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[36]||(l[36]=s=>Pn("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[37]||(l[37]=s=>Pn("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),l[90]||(l[90]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":tn("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(s=>Bn("bold"),["stop"])),title:e.unref(L)("textEditor.toolbar.bold")},[...l[78]||(l[78]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,um),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":tn("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(s=>Bn("italic"),["stop"])),title:e.unref(L)("textEditor.toolbar.italic")},[...l[79]||(l[79]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,dm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":tn("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(s=>Bn("underline"),["stop"])),title:e.unref(L)("textEditor.toolbar.underline")},[...l[80]||(l[80]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,mm),l[91]||(l[91]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":je.value}]),onClick:e.withModifiers(Nl,["stop"]),title:e.unref(L)("textEditor.toolbar.citation")},[...l[81]||(l[81]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,pm),l[92]||(l[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(Ul,["stop"]),title:e.unref(L)("textEditor.toolbar.removeLink")},[...l[83]||(l[83]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,vm)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Zl,["stop"]),title:e.unref(L)("textEditor.toolbar.insertLink")},[...l[82]||(l[82]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,fm)),l[93]||(l[93]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":tn("insertUnorderedList")}]),onClick:e.withModifiers(sl,["stop"]),title:e.unref(L)("textEditor.toolbar.bulletList")},[...l[84]||(l[84]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,gm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":tn("insertOrderedList")}]),onClick:e.withModifiers(Hl,["stop"]),title:e.unref(L)("textEditor.toolbar.numberList")},[...l[85]||(l[85]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,hm),l[94]||(l[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(po,["stop"]),title:e.unref(L)("textEditor.toolbar.image")},[...l[86]||(l[86]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,ym),l[95]||(l[95]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(L)("textEditor.toolbar.comment"),onClick:e.withModifiers(Dn,["stop"])},[...l[87]||(l[87]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,km),D.askAi?(e.openBlock(),e.createElementBlock("div",Cm)):e.createCommentVNode("",!0),D.askAi?(e.openBlock(),e.createElementBlock("div",bm,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(s=>Bl("askAi"),["stop"])),title:e.unref(L)("textEditor.toolbar.askAi")},[l[88]||(l[88]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",xm,e.toDisplayString(e.unref(L)("textEditor.toolbar.askAi")),1)],8,wm),ot.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[43]||(l[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Te.value?(e.openBlock(),e.createElementBlock("div",Em,[D.askAi&&Te.value?(e.openBlock(),e.createElementBlock("div",Sm)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.customToolbarSlots,(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[A(s)&&ie(s)?(e.openBlock(),e.createElementBlock("div",Vm,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),A(s)&&ie(s)&&r<D.customToolbarSlots.length-1&&P(r)?(e.openBlock(),e.createElementBlock("div",Nm)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),_m={class:"dss-color-picker__section-title"},$m={class:"dss-color-picker__presets-row"},Lm=["title","onClick"],Tm={key:1,class:"dss-color-picker__section"},Am={class:"dss-color-picker__presets-row"},Dm=["title","onClick"],Hm={key:2,class:"dss-color-picker__section"},Rm={class:"dss-color-picker__section-header"},Fm={class:"dss-color-picker__presets-row"},Im=["title","onClick"],zm=["onClick"],Pm={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},Om=["title","onClick"],qm={class:"dss-color-picker__input-row"},Wm=["value"],Zm={__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(D,{emit:le}){function M(K){const W=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(K);if(!W)return{h:0,s:0,l:50};const X=parseInt(W[1],16)/255,pe=parseInt(W[2],16)/255,ye=parseInt(W[3],16)/255,Je=Math.max(X,pe,ye),Tt=Math.min(X,pe,ye);let mn=0,vt=0;const Gt=(Je+Tt)/2;if(Je!==Tt){const S=Je-Tt;switch(vt=Gt>.5?S/(2-Je-Tt):S/(Je+Tt),Je){case X:mn=((pe-ye)/S+(pe<ye?6:0))/6;break;case pe:mn=((ye-X)/S+2)/6;break;case ye:mn=((X-pe)/S+4)/6;break}}return{h:mn*360,s:vt*100,l:Gt*100}}function L(K,W,X){W/=100,X/=100;const pe=W*Math.min(X,1-X),ye=Je=>{const Tt=(Je+K/30)%12,mn=X-pe*Math.max(Math.min(Tt-3,9-Tt,1),-1);return Math.round(255*mn).toString(16).padStart(2,"0")};return`#${ye(0)}${ye(8)}${ye(4)}`}function de(K){const W=K.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!W)return null;let X=W[1];return X.length===3&&(X=X.split("").map(pe=>pe+pe).join("")),"#"+X}function I(K){const W=K.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!W)return null;const X=Math.max(0,Math.min(255,Number.parseInt(W[1],10))),pe=Math.max(0,Math.min(255,Number.parseInt(W[2],10))),ye=Math.max(0,Math.min(255,Number.parseInt(W[3],10)));return`#${X.toString(16).padStart(2,"0")}${pe.toString(16).padStart(2,"0")}${ye.toString(16).padStart(2,"0")}`}function T(K){if(typeof K!="string")return null;const W=K.trim();return de(W)||I(W)}function fe(K,W,X){W/=100,X/=100;const pe=X+W*Math.min(X,1-X),ye=pe===0?0:2-2*X/pe;return{h:K,s:ye*100,v:pe*100}}function dt(K,W,X){W/=100,X/=100;const pe=X*(1-W/2),ye=pe===0||pe===1?0:(X-pe)/Math.min(pe,1-pe);return{h:K,s:ye*100,l:pe*100}}const ee=D,f=le,be=e.ref(!1),Ce=e.ref(!1),G=e.ref(!1),U=e.ref(-1),me=e.ref(-1),R=e.ref(null),xe=e.ref(null),Ae=e.ref(null),nt=e.ref(null),ft=e.ref({top:0,left:0}),Z=e.ref(M(ee.modelValue||"#b8a5de")),Ue=e.computed(()=>Array.isArray(ee.presetGroups)&&ee.presetGroups.length>0),qe=e.computed(()=>!ee.disableCustomColors),Ee=e.computed(()=>Ue.value?0:ee.initialPresetCount!=null?ee.initialPresetCount:me.value<0?null:me.value),Me=e.computed(()=>{const K=Ee.value;return K==null?!0:Math.max(0,ee.presetColors.length-K)<ee.max}),je=e.computed(()=>!!(Ce.value||U.value>=0||!Q.value&&ee.presetColors.length===0));e.computed(()=>{const K=Ee.value;return K!=null&&ee.presetColors.length>K});const Q=e.computed(()=>Ue.value||Ee.value!=null),ze=e.computed(()=>{const K=Ee.value;return K==null?[]:ee.presetColors.slice(0,K)}),we=e.computed(()=>{const K=Ee.value;return K==null?[]:ee.presetColors.slice(K)});function it(K){const W=Ee.value;return W!=null?W+K:-1}function ot(K){const W=Ee.value;return W!=null&&K>=W}function bt(K){ot(K)&&(U.value=K,Z.value=M(ee.presetColors[K]),Ce.value=!0,e.nextTick(()=>nt.value?.focus()))}function It(K){if(!ot(K))return;const W=ee.presetColors.filter((ye,Je)=>Je!==K);f("update:presetColors",W);const X=de(ee.modelValue),pe=de(ee.presetColors[K]);if(X&&pe&&X.toLowerCase()===pe.toLowerCase()){const ye=W[Math.max(0,K-1)]||W[0];ye&&f("update:modelValue",ye)}}function en(){G.value=!G.value,G.value||(U.value=-1,Ce.value=!1)}function Pt(){if(!qe.value||U.value<0)return;const K=De.value,W=de(K);if(W){const X=[...ee.presetColors];X[U.value]=W,f("update:presetColors",X),f("update:modelValue",W),U.value=-1,Ce.value=!1}}function oe(){ee.disabled||!qe.value||(U.value=-1,Ce.value=!Ce.value,Ce.value&&(he(),e.nextTick(()=>nt.value?.focus())))}function ve(K){const W=T(K),X=T(ee.modelValue);return W&&X&&W.toLowerCase()===X.toLowerCase()}function Fe(){if(ee.disabled||!qe.value||!Me.value)return;const K=De.value,W=de(K);if(W){const X=[...ee.presetColors,W];f("update:presetColors",X),f("update:modelValue",W);const pe=Ee.value??me.value;pe>=0&&X.length-pe>=ee.max&&(Ce.value=!1)}}const De=e.computed(()=>{const{h:K,s:W,l:X}=Z.value;return L(K,W,X)}),Zt=e.computed(()=>De.value.toLowerCase()),yt=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${Z.value.h}, 100%, 50%))`})),Ut=e.computed(()=>{const K=fe(Z.value.h,Z.value.s,Z.value.l);return{left:`${K.s}%`,bottom:`${K.v}%`,transform:"translate(-50%, 50%)"}}),xt=e.computed(()=>({left:`${Z.value.h/360*100}%`,transform:"translateX(-50%)"})),Ot=e.computed(()=>({position:"fixed",left:`${ft.value.left}px`,top:`${ft.value.top}px`,zIndex:1002}));function J(){if(!R.value||!be.value)return;const K=R.value.getBoundingClientRect(),W=window.innerHeight||document.documentElement.clientHeight;let X=K.bottom+4;const pe=xe.value;pe&&X+pe.offsetHeight>W-8&&(X=K.top-4-pe.offsetHeight),ft.value={top:X,left:K.left}}function he(){const K=ee.modelValue||"#b8a5de",W=T(K);W&&(Z.value=M(W))}function Be(){f("update:modelValue",De.value)}function Xe(){ee.disabled||(be.value=!be.value,be.value&&(he(),e.nextTick(()=>{J(),nt.value?.focus()})))}function Ke(){const K=De.value,W=de(K);if(W){if(U.value>=0){const X=[...ee.presetColors];X[U.value]=W,f("update:presetColors",X),f("update:modelValue",W)}else if(qe.value&&(ee.presetColors.length>0||Ue.value)&&Ce.value&&Me.value&&!ee.presetColors.some(pe=>de(pe)?.toLowerCase()===W.toLowerCase())){const pe=[...ee.presetColors,W];f("update:presetColors",pe),f("update:modelValue",W)}}be.value=!1,Ce.value=!1,G.value=!1,U.value=-1}function Lt(K){if(!Ae.value)return;const W=Ae.value.getBoundingClientRect(),X=pe=>{const ye=Math.max(0,Math.min(1,(pe.clientX-W.left)/W.width)),Je=Math.max(0,Math.min(1,1-(pe.clientY-W.top)/W.height)),Tt={h:Z.value.h,s:ye*100,v:Je*100};Z.value=dt(Tt.h,Tt.s,Tt.v)};X(K),document.addEventListener("mousemove",X),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",X),Be()},{once:!0})}function Ge(K){if(!K.currentTarget)return;const X=K.currentTarget.getBoundingClientRect(),pe=ye=>{const Je=Math.max(0,Math.min(1,(ye.clientX-X.left)/X.width));Z.value={...Z.value,h:Je*360}};pe(K),document.addEventListener("mousemove",pe),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",pe),Be()},{once:!0})}function Dt(K){const W=K.target.value,X=T(W);X&&(Z.value=M(X),f("update:modelValue",X))}function He(K){if(ee.disabled)return;const W=T(K);W&&(Z.value=M(W),f("update:modelValue",W))}let Pe=null,Et=null;function St(){Pe&&(document.removeEventListener("keydown",Pe),Pe=null),Et&&(window.removeEventListener("resize",Et),Et=null)}return e.watch(be,K=>{if(St(),K){if(!Ue.value&&ee.initialPresetCount==null){const W=ee.presetColors.length;W>0&&(me.value<0||W<me.value)&&(me.value=W)}Pe=W=>{W.key==="Escape"&&Ke()},Et=J,document.addEventListener("keydown",Pe),window.addEventListener("resize",Et)}}),e.watch(()=>ee.modelValue,()=>{be.value&&he()},{immediate:!1}),e.watch(we,K=>{K.length===0&&(G.value=!1,U.value=-1,Ce.value=!1)}),e.onBeforeUnmount(St),(K,W)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":D.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:R,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":be.value}]),onClick:Xe},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:De.value})},[...W[0]||(W[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[be.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Ke,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:xe,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Ot.value)},[Q.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Ue.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(D.presetGroups,(X,pe)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+pe,class:"dss-color-picker__section"},[e.createElementVNode("span",_m,e.toDisplayString(X.title),1),e.createElementVNode("div",$m,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.colors,(ye,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":ve(ye)}]),style:e.normalizeStyle({backgroundColor:ye,"--dss-preset-color":ye}),title:ye,onClick:e.withModifiers(Tt=>He(ye),["stop"])},null,14,Lm))),128))])]))),128)):ze.value.length?(e.openBlock(),e.createElementBlock("div",Tm,[W[1]||(W[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",Am,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,(X,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":ve(X)}]),style:e.normalizeStyle({backgroundColor:X,"--dss-preset-color":X}),title:X,onClick:e.withModifiers(ye=>He(X),["stop"])},null,14,Dm))),128))])])):e.createCommentVNode("",!0),qe.value?(e.openBlock(),e.createElementBlock("div",Hm,[e.createElementVNode("div",Rm,[W[3]||(W[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),we.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__manage-icon",{"dss-color-picker__manage-icon--active":G.value}]),title:"Manage custom colors",onClick:e.withModifiers(en,["stop"])},[...W[2]||(W[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Fm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,(X,pe)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+pe,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":G.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!G.value&&ve(X),"dss-color-picker__preset-bubble--editing":G.value&&U.value===it(pe)}]),style:e.normalizeStyle({backgroundColor:U.value===it(pe)?De.value:X,"--dss-preset-color":U.value===it(pe)?De.value:X}),title:U.value===it(pe)?De.value:X,onClick:e.withModifiers(ye=>G.value?bt(it(pe)):He(X),["stop"])},null,14,Im),G.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__preset-action dss-color-picker__preset-action--delete",title:"Delete",onClick:e.withModifiers(ye=>It(it(pe)),["stop"])},[...W[4]||(W[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,zm)):e.createCommentVNode("",!0)],2))),128)),Me.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":Ce.value}]),onClick:e.withModifiers(oe,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):D.presetColors.length?(e.openBlock(),e.createElementBlock("div",Pm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.presetColors,(X,pe)=>(e.openBlock(),e.createElementBlock("button",{key:pe,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":ve(X)}]),style:e.normalizeStyle({backgroundColor:X,"--dss-preset-color":X}),title:X,onClick:e.withModifiers(ye=>He(X),["stop"])},null,14,Om))),128)),qe.value&&Me.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":Ce.value}]),onClick:e.withModifiers(oe,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),je.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:Ae,onMousedown:Lt},[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(Ut.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ge},[W[5]||(W[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(xt.value)},null,4)],32),e.createElementVNode("div",qm,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:nt,type:"text",class:"dss-color-picker__hex-input",value:Zt.value,onInput:Dt},null,40,Wm)]),qe.value&&Q.value&&(D.presetColors.length||Ue.value)&&Me.value&&U.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Fe}," Save color ")):e.createCommentVNode("",!0),qe.value&&Q.value&&U.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Pt}," Save color ")):e.createCommentVNode("",!0),Q.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Ke}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},Um={key:0,class:"dss-loader"},Xm={key:0,class:"dss-loader-label"},Ym={key:1,class:"dss-loader"},jm={key:0,class:"dss-loader-label"},Km={key:2,class:"dss-loader"},Gm={key:0,class:"dss-loader-label"},Qm={key:3,class:"dss-loader"},Jm={key:0,class:"dss-loader-label"},e2={key:4,class:"dss-loader"},t2={key:0,class:"dss-loader-label"},n2={key:5,class:"dss-loader dss-loader--inline"},l2={class:"dss-loader-inline-text"},o2={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(D){const le=D,M=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),L=e.computed(()=>{const de={};if(!(le.size==="small"||le.size==="medium"||le.size==="large"||le.size==null)){const I=typeof le.size=="number"?`${le.size}px`:String(le.size);de["--dss-loader-size"]=I}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,I)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",M.value]),style:e.normalizeStyle(L.value)},[D.type==="spinner"?(e.openBlock(),e.createElementBlock("div",Um,[I[0]||(I[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),D.label?(e.openBlock(),e.createElementBlock("span",Xm,e.toDisplayString(D.label),1)):e.createCommentVNode("",!0)])):D.type==="dots"?(e.openBlock(),e.createElementBlock("div",Ym,[I[1]||(I[1]=e.createElementVNode("span",{class:"dss-loader-dots","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"})],-1)),D.label?(e.openBlock(),e.createElementBlock("span",jm,e.toDisplayString(D.label),1)):e.createCommentVNode("",!0)])):D.type==="battery"?(e.openBlock(),e.createElementBlock("div",Km,[I[2]||(I[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),D.label?(e.openBlock(),e.createElementBlock("span",Gm,e.toDisplayString(D.label),1)):e.createCommentVNode("",!0)])):D.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",Qm,[I[3]||(I[3]=e.createElementVNode("span",{class:"dss-loader-double-circle","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-double-circle-outer"}),e.createElementVNode("span",{class:"dss-loader-double-circle-inner"})],-1)),D.label?(e.openBlock(),e.createElementBlock("span",Jm,e.toDisplayString(D.label),1)):e.createCommentVNode("",!0)])):D.type==="bars"?(e.openBlock(),e.createElementBlock("div",e2,[I[4]||(I[4]=e.createElementVNode("span",{class:"dss-loader-bars","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"})],-1)),D.label?(e.openBlock(),e.createElementBlock("span",t2,e.toDisplayString(D.label),1)):e.createCommentVNode("",!0)])):D.type==="inline"?(e.openBlock(),e.createElementBlock("div",n2,[I[5]||(I[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",l2,[e.renderSlot(de.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(D.label),1)])])])):e.createCommentVNode("",!0)],6))}},ca="dss-skeleton-item",a2={__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:D=>["single","multiple"].includes(D)},targetClass:{type:String,default:ca},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(D){const le=D,M=e.computed(()=>{const I={"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!==ca&&(I[`dss-skeleton--target-${le.targetClass}`]=!0),I}),L=e.computed(()=>{const I={};return le.borderRadius&&(I.borderRadius=le.borderRadius),I}),de=e.computed(()=>{const I={};return le.borderRadius&&(I["--dss-skeleton-border-radius"]=le.borderRadius),le.darkMode?(I["--dss-skeleton-bg"]=le.bgDark||"#322c3f",I["--dss-skeleton-shimmer"]=le.shimmerDark||"#3e3f41",I):(le.bgColor&&(I["--dss-skeleton-bg"]=le.bgColor),le.shimmerColor&&(I["--dss-skeleton-shimmer"]=le.shimmerColor),I)});return(I,T)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",M.value]),style:e.normalizeStyle(de.value)},[D.loading&&D.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(L.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":D.loading&&D.mode==="single"}])},[e.renderSlot(I.$slots,"default")],2)],6))}},s2={key:0,class:"dss-dnd-column-header"},r2={class:"dss-dnd-column-title"},i2={class:"dss-dnd-column-count"},c2=["data-column"],u2={key:0,class:"dss-dnd-indicator"},d2=["onPointerdown"],m2=["onPointerdown"],p2={class:"dss-dnd-item-content"},f2={class:"dss-dnd-item-default"},v2={key:0,class:"dss-dnd-empty"},g2={name:"DSSDnd"},h2=Object.assign(g2,{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(D,{emit:le}){const M=D,L=le,de=e.useSlots(),I=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},fe=e.computed(()=>({...T,...M.options})),dt=e.computed(()=>({"--dss-dnd-col-min-w":fe.value.columnMinWidth,"--dss-dnd-col-max-w":fe.value.columnMaxWidth,"--dss-dnd-col-gap":fe.value.columnGap,"--dss-dnd-indicator-color":fe.value.indicatorColor,"--dss-dnd-body-max-h":fe.value.columnBodyMaxHeight}));function ee(J){if(!fe.value.ColColor||!J)return{};const he=J.background||J.color;return he?{background:he}:{}}const f=e.ref(null),be=e.ref(null),Ce=e.ref(!1),G=e.ref(-1),U=e.ref(null);let me=null,R=null,xe=null,Ae=null,nt=0,ft=0,Z="",Ue=null;const qe=5,Ee=e.computed(()=>{const J={};for(const he of M.columns)J[he.value]=M.items.filter(Be=>Be[M.columnKey]===he.value).sort((Be,Xe)=>(Be[M.positionKey]??0)-(Xe[M.positionKey]??0));return J}),Me=e.computed(()=>{const J={},he=!!f.value,Be=f.value?.[M.itemKey],Xe=be.value,Ke=G.value;for(const Lt of M.columns){const Ge=Ee.value[Lt.value]||[],Dt=[],He=Xe==Lt.value;let Pe=0;for(let Et=0;Et<Ge.length;Et++){const St=Ge[Et],K=he&&St[M.itemKey]===Be;!K&&He&&Ke===Pe&&Dt.push({type:"indicator",key:`ind-${Pe}`}),K||Pe++,Dt.push({type:"item",item:St,isDragged:K,key:`item-${St[M.itemKey]}`})}He&&Ke>=Pe&&Dt.push({type:"indicator",key:"ind-end"}),J[Lt.value]=Dt}return J});function je(J,he){const Xe=(Ee.value[J]||[]).filter(Ge=>Ge[M.itemKey]!==f.value?.[M.itemKey]);if(Xe.length===0)return 1;if(he<=0){const Ge=Xe[0][M.positionKey];return Ge!=null&&Ge>0?Ge/2:.5}if(he>=Xe.length){const Ge=Xe[Xe.length-1][M.positionKey];return(Ge??0)+1}const Ke=Xe[he-1][M.positionKey]??0,Lt=Xe[he][M.positionKey]??0;return(Ke+Lt)/2}function Q(J,he,Be){xe&&xe.remove();const Xe=J.getBoundingClientRect(),Ke=J.cloneNode(!0);Ke.classList.add("dss-dnd-ghost"),Ke.style.cssText=`
104
104
  position: fixed;
105
- left: ${he-et}px;
106
- top: ${Be-vt}px;
105
+ left: ${he-nt}px;
106
+ top: ${Be-ft}px;
107
107
  width: ${Xe.width}px;
108
108
  height: ${Xe.height}px;
109
109
  z-index: 9999;
110
110
  pointer-events: none;
111
- opacity: ${ve.value.dragGhostOpacity};
111
+ opacity: ${fe.value.dragGhostOpacity};
112
112
  box-sizing: border-box;
113
113
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
114
- background-color: ${ve.value.dragSourceBackground};
114
+ background-color: ${fe.value.dragSourceBackground};
115
115
  font-family: 'Work Sans', sans-serif;
116
116
  cursor: grabbing;
117
- `,document.body.appendChild(Ge),xe=Ge}function ze(G,he){xe&&(xe.style.left=`${G-et}px`,xe.style.top=`${he-vt}px`)}function we(G){G.classList.add("dss-dnd-item--dragging"),G.style.background=ve.value.dragSourceBackground,G.style.borderColor=ve.value.dragSourceBorder,G.style.transform="scale(0.97)"}function st(G){G.classList.remove("dss-dnd-item--dragging"),G.style.background="",G.style.borderColor="",G.style.transform=""}function lt(G,he){return document.elementFromPoint(G,he)?.closest(".dss-dnd-column-body")??null}function xt(G,he){return!!document.elementFromPoint(G,he)?.closest("[data-dss-dnd-delete-zone]")}function It(G,he){if(z.value&&xt(G,he)){Ce.value=!0,be.value=null,Q.value=-1;return}Ce.value=!1;const Be=lt(G,he),Xe=Be?.getAttribute("data-column")??null;if(!Xe){be.value=null,Q.value=-1;return}be.value=Xe;const Ge=Be.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Tt=Ge.length;for(let Qe=0;Qe<Ge.length;Qe++){const zt=Ge[Qe].getBoundingClientRect();if(he<zt.top+zt.height/2){Tt=Qe;break}}Q.value=Tt}function tn(G){G.preventDefault(),ze(G.clientX,G.clientY),!me&&(me=requestAnimationFrame(()=>{me=null,It(G.clientX,G.clientY)}))}function Ot(G){window.removeEventListener("pointermove",tn),window.removeEventListener("pointerup",Ot),window.removeEventListener("pointercancel",Ot),He?.releasePointerCapture?.(G.pointerId),st(He),He=null;const he=z.value&&xt(G.clientX,G.clientY);if(f.value&&he)L("delete",{item:f.value});else{const Xe=lt(G.clientX,G.clientY)?.getAttribute("data-column")??null;if(f.value&&Xe){const Ge=f.value[M.columnKey],Tt=Xe,zt=(Ee.value[Tt]||[]).filter(Vt=>Vt[M.itemKey]!==f.value[M.itemKey]),Ze=Math.max(0,Math.min(Q.value,zt.length)),$e=Ke(Tt,Ze),rt=f.value[M.itemKey];L("move",{item:f.value,from:Ge,to:Tt,position:$e,index:Ze}),H&&clearTimeout(H),U.value={id:rt,from:Ge,to:Tt},H=setTimeout(()=>{U.value=null},3500)}}xe&&(xe.remove(),xe=null),q!==null&&(document.body.style.cursor=q,q=""),Wt()}function oe(G,he){G.preventDefault();const Be=G.target.closest(".dss-dnd-item");if(!Be)return;const Xe=Be.getBoundingClientRect();et=G.clientX-Xe.left,vt=G.clientY-Xe.top,q=document.body.style.cursor,document.body.style.cursor="grabbing",f.value=he,He=Be,K(Be,G.clientX,G.clientY),requestAnimationFrame(()=>we(Be)),Be.setPointerCapture?.(G.pointerId),window.addEventListener("pointermove",tn),window.addEventListener("pointerup",Ot,{once:!0}),window.addEventListener("pointercancel",Ot,{once:!0})}function fe(){Ue&&(window.removeEventListener("pointermove",Fe),window.removeEventListener("pointerup",De),window.removeEventListener("pointercancel",De),Ue=null)}function Fe(G){if(!Ue||G.pointerId!==Ue.pointerId)return;const he=G.clientX-Ue.startX,Be=G.clientY-Ue.startY;if(Math.abs(he)>=Pe||Math.abs(Be)>=Pe){const Xe=Ue.item;fe(),oe(G,Xe)}}function De(G){!Ue||G.pointerId!==Ue.pointerId||fe()}function Zt(G,he){fe(),Ue={item:he,startX:G.clientX,startY:G.clientY,pointerId:G.pointerId},window.addEventListener("pointermove",Fe),window.addEventListener("pointerup",De),window.addEventListener("pointercancel",De)}function kt(G,he){ve.value.useHandle||Zt(G,he)}function Ut(G,he){Zt(G,he)}function St(){me&&(cancelAnimationFrame(me),me=null)}function Wt(){St(),f.value=null,be.value=null,Ce.value=!1,Q.value=-1}return e.onBeforeUnmount(()=>{St(),fe(),H&&clearTimeout(H),xe&&(xe.remove(),xe=null)}),(G,he)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":ve.value.unstyled}]),style:e.normalizeStyle(pt.value)},[z.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":Ce.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(G.$slots,"delete-zone",{isDragging:!!f.value,isOver:Ce.value})],2),[[e.vShow,!!f.value||ve.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.columns,Be=>(e.openBlock(),e.createElementBlock("div",{key:Be.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":be.value==Be.value},Be.class||""]]),style:e.normalizeStyle(J(Be))},[ve.value.showHeader?(e.openBlock(),e.createElementBlock("div",a2,[e.renderSlot(G.$slots,"column-header",{column:Be,items:Ee.value[Be.value]||[]},()=>[e.createElementVNode("span",s2,e.toDisplayString(Be.title||Be.value),1),e.createElementVNode("span",r2,e.toDisplayString((Ee.value[Be.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Be.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Me.value[Be.value],Xe=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Xe.key},[Xe.type==="indicator"?(e.openBlock(),e.createElementBlock("div",c2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Xe.isDragged,"dss-dnd-item--no-handle":!ve.value.useHandle}]),onPointerdown:Ge=>kt(Ge,Xe.item)},[ve.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Ge=>Ut(Ge,Xe.item),["stop"])},[e.renderSlot(G.$slots,"handle",{},()=>[he[0]||(he[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,d2)):e.createCommentVNode("",!0),e.createElementVNode("div",m2,[e.renderSlot(G.$slots,"item",{item:Xe.item,column:Be,justDropped:U.value?.id===Xe.item[T.itemKey],droppedFrom:U.value?.id===Xe.item[T.itemKey]?U.value.from:null,droppedTo:U.value?.id===Xe.item[T.itemKey]?U.value.to:null},()=>[e.createElementVNode("div",p2,e.toDisplayString(Xe.item[T.itemKey]),1)])])],42,u2))],64))),128)),(Ee.value[Be.value]||[]).length===0&&be.value!=Be.value?(e.openBlock(),e.createElementBlock("div",f2,[e.renderSlot(G.$slots,"empty",{column:Be},()=>[he[1]||(he[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,i2)],6))),128))],6))}}),h2={name:"DSSConfetti"},y2=Object.assign(h2,{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(T){const le=T,M=e.ref(null),L=e.ref(!1);let de=[],z=null,A=null;function ve(Q,U){const me=[];for(let H=0;H<le.count;H++)me.push(pt(Q));return me}function pt(Q,U){return{x:Math.random()*Q,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 J(Q,U,me,H){Q.clearRect(0,0,U,me);for(const xe of de)Q.save(),Q.globalAlpha=xe.opacity*H,Q.beginPath(),Q.lineWidth=xe.r,Q.strokeStyle=xe.color,Q.moveTo(xe.x+xe.tilt+xe.r/2,xe.y),Q.lineTo(xe.x+xe.tilt,xe.y+xe.tilt+xe.r/2),Q.stroke(),Q.restore()}function f(Q,U,me){const H=.3+me*.7;for(let xe=0;xe<de.length;xe++){const He=de[xe];He.tiltAngle+=He.tiltInc,He.y+=He.speed*H,He.x+=Math.sin(He.d)*.5*H,He.tilt=Math.sin(He.tiltAngle)*15,me>=.99&&He.y>U+20&&(de[xe]=pt(Q))}}function be(){L.value=!0,e.nextTick(()=>{const Q=M.value;if(!Q)return;const U=Q.getContext("2d"),me=Q.parentElement;if(!me)return;const H=me.getBoundingClientRect();Q.width=H.width,Q.height=H.height,de=ve(Q.width,Q.height);const xe=Date.now(),He=xe+le.duration,et=()=>{const vt=Date.now(),q=vt-xe;if(vt<He){let Ue=1;q>le.fadeStart&&(Ue=1-(q-le.fadeStart)/(le.duration-le.fadeStart)),J(U,Q.width,Q.height,Ue),f(Q.width,Q.height,Ue),z=requestAnimationFrame(et)}else Ce()};et()})}function Ce(){z&&(cancelAnimationFrame(z),z=null),de=[],L.value=!1}return e.watch(()=>le.trigger,Q=>{Q&&(A&&clearTimeout(A),A=setTimeout(be,le.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{Ce(),A&&clearTimeout(A)}),(Q,U)=>L.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:M,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),k2={class:"dss-filter-global-inner"},C2=["placeholder","value"],b2=["title"],w2={key:0,class:"dss-filter-funnel-badge"},x2={key:1,class:"dss-filter-sortby"},E2=["value"],S2=["value"],V2=["disabled","title"],N2={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"},B2={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"},M2={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"},_2={class:"dss-filter-panel"},$2={key:0,class:"dss-filter-empty"},L2={class:"dss-filter-row-prefix"},T2={class:"dss-filter-cell"},A2=["onClick"],D2={class:"dss-filter-trigger-text"},H2=["placeholder"],R2={class:"dss-filter-popup-list"},F2=["onClick"],I2={key:0,class:"dss-filter-popup-empty"},z2={key:0,class:"dss-filter-cell"},P2=["onClick"],O2={class:"dss-filter-trigger-text"},W2={class:"dss-filter-popup-list"},q2=["onClick"],Z2={key:1,class:"dss-filter-cell dss-filter-cell--value"},U2=["placeholder","onUpdate:modelValue"],X2={key:1,class:"dss-filter-date-wrap"},Y2=["placeholder","onUpdate:modelValue"],j2=["placeholder","value","onInput","step"],K2={key:4,class:"dss-filter-between"},G2=["placeholder","value","onInput","step"],Q2={class:"dss-filter-between-sep"},J2=["placeholder","value","onInput","step"],e0={key:5,class:"dss-filter-multiselect"},t0=["onClick"],n0={class:"dss-filter-trigger-text"},l0=["placeholder"],o0={class:"dss-filter-popup-list dss-filter-popup-list--check"},a0=["onClick"],s0=["checked"],r0={key:0,class:"dss-filter-popup-empty"},i0=["onClick"],c0={class:"dss-filter-foot"},u0={class:"dss-filter-cell"},d0=["placeholder"],m0={class:"dss-filter-popup-list"},p0=["onClick"],f0={key:0,class:"dss-filter-popup-divider"},v0=["onClick"],g0=["placeholder"],h0={class:"dss-filter-popup-list"},y0=["onClick"],k0={key:0,class:"dss-filter-popup-empty"},C0=["placeholder"],b0={class:"dss-filter-popup-list"},w0=["onClick"],x0={key:0,class:"dss-filter-popup-empty"},E0={name:"DSSFilter"},S0=Object.assign(E0,{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(T,{expose:le,emit:M}){const{t:L}=Jl.useI18n(),de=T,z=M,A={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},ve=e.computed(()=>({...A,...de.options})),pt={text:[{value:"contains"},{value:"not_contains"},{value:"equals"},{value:"not_equals"},{value:"starts_with"},{value:"ends_with"},{value:"is_empty"},{value:"is_not_empty"}],select:[{value:"is_any_of"},{value:"is_none_of"},{value:"is_empty"},{value:"is_not_empty"}],range:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],int:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],arraySelect:[{value:"contains_any"},{value:"contains_all"},{value:"not_contains_any"},{value:"is_empty"},{value:"is_not_empty"}],arrayText:[{value:"contains"},{value:"not_contains"},{value:"is_empty"},{value:"is_not_empty"}],date:[{value:"eq"},{value:"before"},{value:"after"},{value:"is_empty"},{value:"is_not_empty"}],boolean:[{value:"is_true"},{value:"is_false"},{value:"is_empty"},{value:"is_not_empty"}]},J=new Set(["is_empty","is_not_empty","is_true","is_false"]),f=["label","name","title","keyword","full_name","value","text"],be=e.ref(""),Ce=e.ref([]),Q=e.ref(null),U=e.ref(!1),me=e.ref(null),H=e.ref(""),xe=e.ref(null),He=e.ref(""),et=e.ref("asc");let vt=1;function q(S){const b=S.find(V=>V&&typeof V=="object");if(!b)return null;for(const V of f)if(V in b&&typeof b[V]=="string")return V;return Object.keys(b).find(V=>typeof b[V]=="string")||null}function Ue(S,b){const V=b.filter(Y=>Y!=null&&Y!=="NULL");if(V.length===0)return null;if(V.every(Y=>Array.isArray(Y))){const Y=V.flatMap(We=>We).filter(We=>We!=null);return Y.length===0?null:typeof Y.find(We=>We!=null)=="object"?"arraySelect":"arrayText"}return V.every(Y=>typeof Y=="boolean")?"boolean":V.every(Y=>typeof Y=="number")?new Set(V).size<=ve.value.maxUniqueForEnum?"select":"range":V.every(Y=>typeof Y=="string")?new Set(V).size<=ve.value.maxUniqueForSelect?"select":"text":V.some(Y=>typeof Y=="object"&&!Array.isArray(Y))?null:"text"}const Pe=e.computed(()=>{if(!de.data?.length)return[];const S=new Set;for(const ae of de.data)if(ae&&typeof ae=="object")for(const We of Object.keys(ae))S.add(We);const b=new Set(de.exclude),V=[];for(const ae of S){if(b.has(ae))continue;const We=de.config[ae]||{},ht=de.data.map(Et=>Et?.[ae]),it=We.type||Ue(ae,ht);if(!it)continue;const qe=We.filterMode||"contain",Bt=qe==="date"?"date":qe==="string"?"text":it,Mt={key:ae,label:We.label||Ct(ae),type:Bt,filterMode:qe};if(it==="select"){const Et=ht.filter(wt=>wt!=null&&wt!=="NULL");Mt.uniqueValues=[...new Set(Et)].sort((wt,At)=>typeof wt=="number"&&typeof At=="number"?wt-At:String(wt).localeCompare(String(At)))}else if(it==="range"||it==="int"){const Et=ht.filter(wt=>typeof wt=="number");Mt.min=Math.min(...Et),Mt.max=Math.max(...Et)}else if(it==="arraySelect"){const Et=We.displayKey||q(ht.flatMap(wt=>Array.isArray(wt)?wt:[]));if(Mt.displayKey=Et,Array.isArray(We.uniqueValues)&&We.uniqueValues.length>0)Mt.uniqueValues=We.uniqueValues.map(wt=>String(wt));else{const wt=ht.flatMap(At=>Array.isArray(At)?At:[]).filter(At=>At!=null).map(At=>Et&&typeof At=="object"?At[Et]:String(At)).filter(At=>At!=null&&At!=="");Mt.uniqueValues=[...new Set(wt)].sort((At,_t)=>String(At).localeCompare(String(_t)))}}V.push(Mt)}const Y=de.config._order;return Y&&V.sort((ae,We)=>{const ht=Y.indexOf(ae.key),it=Y.indexOf(We.key);return ht===-1&&it===-1?0:ht===-1?1:it===-1?-1:ht-it}),V}),Ee=e.computed(()=>{const S={};for(const b of Pe.value)S[b.key]=b;return S}),Me=e.computed(()=>Array.isArray(de.config.groups)&&de.config.groups.length>0),Ke=e.computed(()=>{if(!Me.value)return[];const S=new Set(Pe.value.map(b=>b.key));return de.config.groups.map(b=>({...b,keys:b.keys.filter(V=>S.has(V))})).filter(b=>b.keys.length>0)}),K=e.computed(()=>{if(!Me.value)return[];const S=new Set(de.config.groups.flatMap(b=>b.keys));return Pe.value.filter(b=>!S.has(b.key))}),ze=e.computed(()=>{if(!xe.value)return[];const S=new Set(xe.value.keys),b=Pe.value.filter(Y=>S.has(Y.key));if(!H.value)return b;const V=H.value.toLowerCase();return b.filter(Y=>Y.label.toLowerCase().includes(V))}),we=e.computed(()=>{if(!H.value)return Pe.value;const S=H.value.toLowerCase();return Pe.value.filter(b=>b.label.toLowerCase().includes(S))}),st=e.computed(()=>Pe.value.filter(S=>!["arraySelect","arrayText"].includes(S.type))),lt=e.computed(()=>He.value?et.value==="asc"?"Ascending":"Descending":"No sort selected");function xt(S){Q.value===S?It():(Q.value=S,H.value="",xe.value=null)}function It(){Q.value=null,H.value="",xe.value=null}function tn(S){const b=S.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");Q.value&&!b&&!S.target.closest(".dss-filter-popup")&&!S.target.closest(".dss-filter-trigger")&&!S.target.closest(".dss-filter-add-btn")&&It(),U.value&&me.value&&!me.value.contains(S.target)&&(b||(U.value=!1))}e.onMounted(()=>document.addEventListener("click",tn)),e.onBeforeUnmount(()=>document.removeEventListener("click",tn));function Ot(S){return Ee.value[S]?.label||Ct(S)}function oe(S){return Ee.value[S.key]?.filterMode||"contain"}function fe(S){return L(`filter.operators.${S}`)}function Fe(S){const b=Ee.value[S.key];return(pt[b?.type]||pt.text).map(V=>({...V,label:L(`filter.operators.${V.value}`)}))}function De(S){return J.has(S)}function Zt(S){const b=Ee.value[S.key];return b?b.type==="date"?"date":b.type==="boolean"?"boolean":b.type==="text"||b.type==="arrayText"?"text":b.type==="select"||b.type==="arraySelect"?"multiselect":b.type==="range"||b.type==="int"?S.operator==="between"?"between":"number":"text":"text"}function kt(S){return pt[S]?.[0]?.value||"contains"}function Ut(S,b){return J.has(b)||S==="date"?null:S==="select"||S==="arraySelect"?[]:(S==="range"||S==="int")&&b==="between"?{min:null,max:null}:S==="range"||S==="int"?null:""}function St(S){return Ee.value[S.key]?.uniqueValues||[]}function Wt(S){const b=St(S);if(!H.value)return b;const V=H.value.toLowerCase();return b.filter(Y=>String(Y).toLowerCase().includes(V))}function G(S){const b=S.value;return!b||b.length===0?L("filter.select"):b.length<=2?b.join(", "):L("filter.selectedCount",{count:b.length})}function he(S){const b=Ee.value[S],V=b?.filterMode||"contain",Y=b?.type||"text",ae=V==="string"?"contains":kt(Y);Ce.value.push(e.reactive({id:vt++,key:S,operator:ae,value:Ut(Y,ae)})),It()}function Be(S){Ce.value=Ce.value.filter(b=>b.id!==S)}function Xe(S,b){const Y=Ee.value[b]?.type||"text";S.key=b,S.operator=kt(Y),S.value=Ut(Y,S.operator),It()}function Ge(S,b){const V=Zt(S);S.operator=b;const Y=Zt(S);if(V!==Y||J.has(b)){const ae=Ee.value[S.key];S.value=Ut(ae?.type||"text",b)}It()}function Tt(S,b){const V=b.target.value;S.value=V===""?null:Number(V)}function Qe(S,b,V){const Y=V.target.value,ae=Y===""?null:Number(Y);(!S.value||typeof S.value!="object")&&(S.value={min:null,max:null}),S.value={...S.value,[b]:isNaN(ae)?null:ae}}function zt(S,b){const V=S.value||[],Y=V.indexOf(b);S.value=Y>=0?V.filter(ae=>ae!==b):[...V,b]}function Ze(){Ce.value=[],be.value="",It()}function $e(S){be.value=S.target.value}function rt(S){He.value=S.target.value}function Vt(){et.value=et.value==="asc"?"desc":"asc"}const ee=e.computed(()=>{if(!de.data)return[];let S=de.data;if(be.value){const b=be.value.toLowerCase();S=S.filter(V=>{for(const Y of Object.keys(V)){const ae=V[Y];if(typeof ae=="string"&&ae.toLowerCase().includes(b)||typeof ae=="number"&&String(ae).includes(b)||Array.isArray(ae)&&ae.some(We=>We!=null&&(typeof We=="string"?We.toLowerCase().includes(b):typeof We=="object"?Object.values(We).some(ht=>typeof ht=="string"&&ht.toLowerCase().includes(b)):!1)))return!0}return!1})}for(const b of Ce.value){if(!pe(b))continue;const V=Ee.value[b.key];V&&(S=S.filter(Y=>ke(Y,b,V)))}if(de.showSortBy&&He.value){const b=He.value,V=et.value==="asc"?1:-1;S=[...S].sort((Y,ae)=>Z(Y?.[b],ae?.[b])*V)}return S});function Z(S,b){const V=X(S),Y=X(b);return V==null&&Y==null?0:V==null?1:Y==null?-1:typeof V=="number"&&typeof Y=="number"?V-Y:String(V).localeCompare(String(Y),void 0,{numeric:!0,sensitivity:"base"})}function X(S){return S==null||S==="NULL"?null:typeof S=="string"||typeof S=="number"||typeof S=="boolean"?S:S instanceof Date?S.getTime():null}function pe(S){return J.has(S.operator)?!0:S.value==null||typeof S.value=="string"&&S.value===""||Array.isArray(S.value)&&S.value.length===0?!1:S.value instanceof Date?!isNaN(S.value.getTime()):!(typeof S.value=="object"&&!Array.isArray(S.value)&&S.value.min==null&&S.value.max==null)}function ke(S,b,V){const Y=S?.[b.key],ae=b.value,We=b.operator;if(We==="is_empty")return on(Y);if(We==="is_not_empty")return!on(Y);const ht=V.type;if(ht==="text"||ht==="arrayText"){const it=ht==="arrayText"&&Array.isArray(Y)?Y.filter(Mt=>Mt!=null).map(String).join(" "):Y!=null?String(Y):"",qe=String(ae).toLowerCase(),Bt=it.toLowerCase();switch(We){case"contains":return Bt.includes(qe);case"not_contains":return!Bt.includes(qe);case"equals":return Bt===qe;case"not_equals":return Bt!==qe;case"starts_with":return Bt.startsWith(qe);case"ends_with":return Bt.endsWith(qe);default:return!0}}if(ht==="select")switch(We){case"is_any_of":return ae.includes(Y);case"is_none_of":return!ae.includes(Y);default:return!0}if(ht==="range"||ht==="int"){const it=typeof Y=="number"?Y:Number(Y);if(typeof it!="number"||isNaN(it))return!1;if(We==="between"){const Bt=ae?.min!=null?Number(ae.min):null,Mt=ae?.max!=null?Number(ae.max):null,Et=Bt!=null&&!isNaN(Bt)?Bt:null,wt=Mt!=null&&!isNaN(Mt)?Mt:null;return(Et==null||it>=Et)&&(wt==null||it<=wt)}const qe=typeof ae=="number"&&!isNaN(ae)?ae:Number(ae);if(We==="contains"||We==="not_contains"){const Bt=String(it),Mt=String(ae??"").toLowerCase(),Et=Bt.toLowerCase().includes(Mt);return We==="contains"?Et:!Et}if(typeof qe!="number"||isNaN(qe))return!1;switch(We){case"eq":return it===qe;case"neq":return it!==qe;case"gt":return it>qe;case"gte":return it>=qe;case"lt":return it<qe;case"lte":return it<=qe;default:return!0}}if(ht==="arraySelect"){if(!Array.isArray(Y))return!1;const it=Y.filter(qe=>qe!=null).map(qe=>V.displayKey&&typeof qe=="object"?qe[V.displayKey]:String(qe));switch(We){case"contains_any":return it.some(qe=>ae.includes(qe));case"contains_all":return ae.every(qe=>it.includes(qe));case"not_contains_any":return!it.some(qe=>ae.includes(qe));default:return!0}}if(ht==="date"){const it=Ye(ae);if(!it||isNaN(it.getTime()))return!1;const qe=Ye(Y);if(!qe||isNaN(qe.getTime()))return!1;const Bt=Nt(qe),Mt=Nt(it);switch(We){case"eq":return Bt===Mt;case"before":return Bt<Mt;case"after":return Bt>Mt;default:return!0}}if(ht==="boolean"){const it=Y===!0||Y==="true"||Y===1,qe=Y===!1||Y==="false"||Y===0;switch(We){case"is_true":return it;case"is_false":return qe;default:return!0}}return!0}function Ye(S){if(S==null)return null;if(S instanceof Date)return isNaN(S.getTime())?null:S;if(typeof S=="number")return new Date(S>1e10?S:S*1e3);if(typeof S=="string"){const b=new Date(S);return isNaN(b.getTime())?null:b}return null}function Nt(S){const b=S.getFullYear(),V=String(S.getMonth()+1).padStart(2,"0"),Y=String(S.getDate()).padStart(2,"0");return`${b}-${V}-${Y}`}function on(S){return!!(S==null||S===""||S==="NULL"||Array.isArray(S)&&S.length===0||Array.isArray(S)&&S.every(b=>b==null))}e.watch(ee,S=>z("update:modelValue",S),{immediate:!0}),e.watch(()=>de.data,()=>{Ce.value=[],be.value="",U.value=!1,He.value="",et.value="asc",It()});function Ct(S){return S.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,b=>b.toUpperCase())}function Gt(){const S=b=>{if(b==null)return b;if(b instanceof Date)return{_type:"Date",value:b.toISOString(),local:b.toLocaleDateString()};if(Array.isArray(b))return b.map(S);if(typeof b=="object"&&!Array.isArray(b)){const V={};for(const Y of Object.keys(b))V[Y]=S(b[Y]);return V}return b};return{globalSearch:be.value,rows:Ce.value.map(b=>({key:b.key,operator:b.operator,value:S(b.value),defType:Ee.value[b.key]?.type,defFilterMode:Ee.value[b.key]?.filterMode})),filteredCount:ee.value?.length??0}}return le({getDebugState:Gt}),(S,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":ve.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:me},[e.createElementVNode("div",k2,[b[20]||(b[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref(L)("filter.searchAcrossFields"),value:be.value,onInput:$e},null,40,C2),be.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:b[0]||(b[0]=V=>be.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:U.value||Ce.value.length>0,"dss-filter-funnel-btn--with-sort":de.showSortBy}]),onClick:b[1]||(b[1]=V=>U.value=!U.value),type:"button",title:U.value?e.unref(L)("filter.closeAdvancedFilter"):e.unref(L)("filter.openAdvancedFilter")},[b[14]||(b[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),Ce.value.length>0?(e.openBlock(),e.createElementBlock("span",w2,e.toDisplayString(Ce.value.length),1)):e.createCommentVNode("",!0)],10,b2),de.showSortBy?(e.openBlock(),e.createElementBlock("div",x2,[b[19]||(b[19]=e.createElementVNode("label",{class:"dss-filter-sortby-label",for:"dss-filter-sort-select"},"Sort by",-1)),e.createElementVNode("select",{id:"dss-filter-sort-select",class:"dss-filter-sortby-select",value:He.value,onChange:rt},[b[15]||(b[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(st.value,V=>(e.openBlock(),e.createElementBlock("option",{key:V.key,value:V.key},e.toDisplayString(V.label),9,S2))),128))],40,E2),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:Vt,disabled:!He.value,title:lt.value},[He.value?et.value==="asc"?(e.openBlock(),e.createElementBlock("svg",B2,[...b[17]||(b[17]=[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",M2,[...b[18]||(b[18]=[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",N2,[...b[16]||(b[16]=[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"currentColor"},null,-1)])]))],8,V2)])):e.createCommentVNode("",!0)]),U.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:b[13]||(b[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",_2,[Ce.value.length===0?(e.openBlock(),e.createElementBlock("div",$2,e.toDisplayString(e.unref(L)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(V,Y)=>(e.openBlock(),e.createElementBlock("div",{key:V.id,class:"dss-filter-row"},[e.createElementVNode("span",L2,e.toDisplayString(Y===0?e.unref(L)("filter.where"):e.unref(L)("filter.and")),1),e.createElementVNode("div",T2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ae=>xt(`${V.id}:field`),["stop"])},[e.createElementVNode("span",D2,e.toDisplayString(Ot(V.key)),1),b[21]||(b[21]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,A2),Q.value===`${V.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[3]||(b[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[2]||(b[2]=ae=>H.value=ae),placeholder:e.unref(L)("filter.searchAttributes")},null,8,H2),[[e.vModelText,H.value]]),e.createElementVNode("ul",R2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,ae=>(e.openBlock(),e.createElementBlock("li",{key:ae.key,class:"dss-filter-popup-item",onClick:We=>Xe(V,ae.key)},e.toDisplayString(ae.label),9,F2))),128)),we.value.length===0?(e.openBlock(),e.createElementBlock("li",I2,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),oe(V)==="contain"||oe(V)==="date"?(e.openBlock(),e.createElementBlock("div",z2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ae=>xt(`${V.id}:op`),["stop"])},[e.createElementVNode("span",O2,e.toDisplayString(fe(V.operator)),1),b[22]||(b[22]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,P2),Q.value===`${V.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[4]||(b[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",W2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe(V),ae=>(e.openBlock(),e.createElementBlock("li",{key:ae.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:V.operator===ae.value}]),onClick:We=>Ge(V,ae.value)},e.toDisplayString(ae.label),11,q2))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),De(V.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Z2,[oe(V)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),"onUpdate:modelValue":ae=>V.value=ae},null,8,U2)),[[e.vModelText,V.value]]):oe(V)==="date"?(e.openBlock(),e.createElementBlock("div",X2,[e.createVNode(ea,{mode:"single",modelValue:V.value,"onUpdate:modelValue":ae=>V.value=ae},null,8,["modelValue","onUpdate:modelValue"])])):Zt(V)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),"onUpdate:modelValue":ae=>V.value=ae},null,8,Y2)),[[e.vModelText,V.value]]):Zt(V)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),value:V.value,onInput:ae=>Tt(V,ae),step:Ee.value[V.key]?.type==="int"?1:void 0},null,40,j2)):Zt(V)==="between"?(e.openBlock(),e.createElementBlock("div",K2,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.min"),value:V.value?.min,onInput:ae=>Qe(V,"min",ae),step:Ee.value[V.key]?.type==="int"?1:void 0},null,40,G2),e.createElementVNode("span",Q2,e.toDisplayString(e.unref(L)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.max"),value:V.value?.max,onInput:ae=>Qe(V,"max",ae),step:Ee.value[V.key]?.type==="int"?1:void 0},null,40,J2)])):Zt(V)==="multiselect"?(e.openBlock(),e.createElementBlock("div",e0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ae=>xt(`${V.id}:val`),["stop"])},[e.createElementVNode("span",n0,e.toDisplayString(G(V)),1),b[23]||(b[23]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,t0),Q.value===`${V.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[6]||(b[6]=e.withModifiers(()=>{},["stop"]))},[St(V).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[5]||(b[5]=ae=>H.value=ae),placeholder:e.unref(L)("filter.search")},null,8,l0)),[[e.vModelText,H.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",o0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wt(V),ae=>(e.openBlock(),e.createElementBlock("li",{key:ae,class:"dss-filter-popup-item",onClick:We=>zt(V,ae)},[e.createElementVNode("input",{type:"checkbox",checked:(V.value||[]).includes(ae),tabindex:"-1"},null,8,s0),e.createElementVNode("span",null,e.toDisplayString(ae),1)],8,a0))),128)),Wt(V).length===0?(e.openBlock(),e.createElementBlock("li",r0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:ae=>Be(V.id)},[...b[24]||(b[24]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,i0)]))),128)),e.createElementVNode("div",c0,[e.createElementVNode("div",u0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:b[7]||(b[7]=e.withModifiers(V=>xt("add"),["stop"]))},e.toDisplayString(e.unref(L)("filter.addFilter")),1),Q.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:b[12]||(b[12]=e.withModifiers(()=>{},["stop"]))},[Me.value&&!xe.value&&!H.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[8]||(b[8]=V=>H.value=V),placeholder:e.unref(L)("filter.searchAttributes")},null,8,d0),[[e.vModelText,H.value]]),e.createElementVNode("ul",m0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:Y=>xe.value=V},[e.createElementVNode("span",null,e.toDisplayString(V.label),1),b[25]||(b[25]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,p0))),128)),K.value.length>0?(e.openBlock(),e.createElementBlock("li",f0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:Y=>he(V.key)},e.toDisplayString(V.label),9,v0))),128))])],64)):xe.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:b[9]||(b[9]=V=>xe.value=null)},[b[26]||(b[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(xe.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[10]||(b[10]=V=>H.value=V),placeholder:e.unref(L)("filter.searchAttributes")},null,8,g0),[[e.vModelText,H.value]]),e.createElementVNode("ul",h0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:Y=>he(V.key)},e.toDisplayString(V.label),9,y0))),128)),ze.value.length===0?(e.openBlock(),e.createElementBlock("li",k0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[11]||(b[11]=V=>H.value=V),placeholder:e.unref(L)("filter.searchAttributes")},null,8,C0),[[e.vModelText,H.value]]),e.createElementVNode("ul",b0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:Y=>he(V.key)},e.toDisplayString(V.label),9,w0))),128)),we.value.length===0?(e.openBlock(),e.createElementBlock("li",x0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),Ce.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:Ze},e.toDisplayString(e.unref(L)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),V0={class:"dss-pill-field__pills"},N0=["data-value"],B0=["disabled"],M0={class:"dss-pill-field__pill-text"},_0={key:0,class:"dss-pill-field__pill-actions"},$0=["onClick"],L0=["onClick"],T0=["placeholder","disabled"],A0=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(T,{emit:le}){const M=T,L=le,de=e.ref(""),z=e.ref([...M.modelValue]),A=e.ref(null);let ve=null;const pt=e.ref(null),J=e.ref(""),f=e.ref(null),be=e.ref(null),Ce=e.computed(()=>{if(!be.value)return;const{width:Me,height:Ke}=be.value;return{minWidth:`${Me}px`,height:`${Ke}px`}});function Q(Me,Ke){pt.value===Ke&&(f.value=Me)}function U(){pt.value=null,J.value="",be.value=null,f.value=null}const me=e.computed(()=>new Set(z.value.map(Me=>Me.trim()).filter(Boolean)));function H(Me){A.value=Me,ve&&clearTimeout(ve),ve=setTimeout(()=>{A.value=null,ve=null},900)}function xe(Me){const Ke=Me.trim();return Ke?me.value.has(Ke)?(H(Ke),!1):(z.value=[...z.value,Ke],L("update:modelValue",[...z.value]),!0):!1}function He(Me){const Ke=Me.split(/\r?\n/g).map(st=>st.trim()).filter(Boolean);if(!Ke.length)return;const K=new Set(z.value.map(st=>st.trim()).filter(Boolean)),ze=[...z.value];let we=null;for(const st of Ke){if(K.has(st)){we??=st;continue}K.add(st),ze.push(st)}ze.length!==z.value.length&&(z.value=ze,L("update:modelValue",[...z.value])),we&&H(we)}function et(Me){M.disabled||(pt.value===Me&&U(),z.value=z.value.filter((Ke,K)=>K!==Me),L("update:modelValue",[...z.value]))}async function vt(Me,Ke){if(M.disabled)return;const K=Ke.currentTarget.closest(".dss-pill-field__pill");K&&(be.value={width:K.offsetWidth,height:K.offsetHeight}),pt.value=Me,J.value=z.value[Me]??"",await e.nextTick();const ze=f.value;if(!ze)return;ze.focus();const we=ze.value.length;ze.setSelectionRange(we,we)}function q(){U()}function Ue(){if(M.disabled||pt.value===null)return;const Me=pt.value,Ke=z.value[Me]??"",K=J.value.trim();if(U(),K!==Ke&&me.value.has(K)){H(K);return}if(!K){z.value=z.value.filter((we,st)=>st!==Me),L("update:modelValue",[...z.value]);return}const ze=z.value.map((we,st)=>st===Me?K:we);z.value=ze,L("update:modelValue",[...z.value])}function Pe(Me){Me.preventDefault(),!M.disabled&&(xe(de.value),de.value="")}function Ee(Me){if(M.disabled)return;const Ke=Me.clipboardData?.getData("text")??"";!Ke.includes(`
118
- `)&&!Ke.includes("\r")||(Me.preventDefault(),He(Ke),de.value="")}return e.watch(()=>M.modelValue,Me=>{z.value=Array.isArray(Me)?[...Me]:[]},{deep:!0}),e.onBeforeUnmount(()=>{ve&&clearTimeout(ve)}),(Me,Ke)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":Me.disabled}])},[e.createElementVNode("div",V0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,(K,ze)=>(e.openBlock(),e.createElementBlock("span",{key:K,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":A.value===K,"dss-pill-field__pill--editing":pt.value===ze}]),style:e.normalizeStyle(pt.value===ze&&be.value?Ce.value:void 0)},[pt.value===ze?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-pill-field__pill-edit-wrap","data-value":J.value||" "},[e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:we=>Q(we,ze),"onUpdate:modelValue":Ke[0]||(Ke[0]=we=>J.value=we),class:"dss-pill-field__pill-edit",type:"text",disabled:Me.disabled,onKeydown:[e.withKeys(Ue,["enter"]),e.withKeys(q,["esc"])],onBlur:Ue},null,40,B0),[[e.vModelText,J.value]])],8,N0)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",M0,e.toDisplayString(K),1),Me.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",_0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:we=>vt(ze,we)},[...Ke[2]||(Ke[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,$0),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:we=>et(ze)}," × ",8,L0)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Ke[1]||(Ke[1]=K=>de.value=K),class:"dss-pill-field__input",type:"text",placeholder:z.value.length?"":Me.placeholder,disabled:Me.disabled,onPaste:Ee,onKeydown:e.withKeys(Pe,["enter"])},null,40,T0),[[e.vModelText,de.value]])])],2))}}),D0={class:"dss-step-bar__header"},H0={class:"dss-step-bar__label"},R0={key:0,class:"dss-step-bar__counter"},F0={class:"dss-step-bar__track-wrapper"},I0=["aria-valuemax","aria-valuenow","aria-label"],z0=["onMouseenter"],P0={__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:T=>["input","desc","asc"].includes(T)},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(T){const le=T,M={segmentMarker:{color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"},maxSegment:{marker:{enabled:!1,color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"}}},L=oe=>oe&&typeof oe=="object"&&!Array.isArray(oe),de=(oe,fe)=>{const Fe=Object.assign({},oe);return!L(oe)||!L(fe)||Object.keys(fe).forEach(De=>{if(L(fe[De])){De in oe?Fe[De]=de(oe[De],fe[De]):Object.assign(Fe,{[De]:fe[De]});return}Object.assign(Fe,{[De]:fe[De]})}),Fe},z=e.computed(()=>de(M,le.options)),A=e.computed(()=>Math.max(1,Number(le.steps)||1)),ve=e.computed(()=>Math.min(A.value,Math.max(0,Number(le.currentStep)||0))),pt=e.computed(()=>Array.isArray(le.segments)&&le.segments.length>0),J=e.computed(()=>{if(!pt.value)return[];const oe=le.segments.map((fe,Fe)=>{const De=Number(fe?.value);return{label:fe?.label||`Step ${Fe+1}`,value:Number.isFinite(De)&&De>0?De:0,color:fe?.color||le.activeColor,marker:fe?.marker}});return le.segmentOrder==="desc"?[...oe].sort((fe,Fe)=>Fe.value-fe.value):le.segmentOrder==="asc"?[...oe].sort((fe,Fe)=>fe.value-Fe.value):oe}),f=e.computed(()=>pt.value?J.value.reduce((oe,fe)=>oe+fe.value,0):ve.value),be=e.computed(()=>pt.value?Number.isFinite(Number(le.totalValue))&&Number(le.totalValue)>0?Number(le.totalValue):Math.max(1,f.value):A.value),Ce=e.computed(()=>pt.value&&Number.isFinite(Number(le.totalValue))&&Number(le.totalValue)>0),Q=e.computed(()=>Ce.value?Math.max(0,Number(le.totalValue)-f.value):0),U=e.computed(()=>typeof le.remainderLabel=="string"&&le.remainderLabel.trim().length>0),me=e.computed(()=>Q.value>0),H=e.computed(()=>J.value.reduce((oe,fe)=>Math.max(oe,Number(fe.value)||0),0)),xe=e.computed(()=>J.value.filter(oe=>oe.value>0).map(oe=>`${oe.label}: ${st(oe.value)}`).join(" | ")),He=e.computed(()=>pt.value?Ce.value?J.value.filter(oe=>oe.value>0):J.value:[]),et=e.computed(()=>{if(!le.counterAsPercentage)return`${f.value} / ${be.value}`;const oe=Number(be.value);if(!Number.isFinite(oe)||oe<=0)return"0%";const fe=Math.round(Number(f.value)/oe*100);return`${Math.min(Math.max(fe,0),100)}%`}),vt=e.computed(()=>f.value),q=e.computed(()=>be.value),Ue=e.reactive({visible:!1,x:0,content:""}),Pe=e.computed(()=>({left:`${Ue.x}px`})),Ee=oe=>{const fe=oe?.parentElement;return fe?fe.offsetLeft+fe.offsetWidth/2:0},Me=oe=>{if(Ce.value){const De=Math.max(0,Number(oe.value)||0);return{flex:`${De} 0 0`,minWidth:De>0?"6px":"0",backgroundColor:oe.color}}const fe=f.value;return{flex:`${oe.value>0?oe.value:fe>0?1e-4:1} 0 0`,minWidth:"6px",backgroundColor:oe.color}},Ke=oe=>Number(oe?.value||0)>0&&Number(oe?.value||0)===H.value,K=oe=>{const fe=L(oe?.marker)?oe.marker:{},Fe=oe?.marker===!0||fe.enabled===!0,De=Ke(oe)&&z.value.maxSegment?.marker?.enabled===!0;if(!(Fe||De))return{enabled:!1};const kt=fe.backgroundColor??(De?z.value.maxSegment?.marker?.backgroundColor:z.value.segmentMarker?.backgroundColor),Ut=fe.borderColor??(De?z.value.maxSegment?.marker?.borderColor:z.value.segmentMarker?.borderColor),St=fe.color??(De?z.value.maxSegment?.marker?.color:z.value.segmentMarker?.color),Wt=fe.width??(De?z.value.maxSegment?.marker?.width:z.value.segmentMarker?.width),G=fe.height??(De?z.value.maxSegment?.marker?.height:z.value.segmentMarker?.height);return{enabled:!0,backgroundColor:kt,borderColor:Ut,color:St,width:Wt,height:G,icon:fe.icon??null,...fe}},ze=oe=>{const fe=K(oe);return{backgroundColor:fe.backgroundColor??void 0,borderColor:fe.borderColor??void 0,color:fe.color??void 0}},we=oe=>{const fe=K(oe);return{width:fe.width??void 0,height:fe.height??void 0}},st=oe=>`${oe}${le.valueLabel}`,lt=e.computed(()=>({flex:`${Q.value} 0 0`,minWidth:Q.value>0?"6px":"0",backgroundColor:le.inactiveColor})),xt=(oe,fe)=>{if(!oe||!fe?.currentTarget)return;const Fe=fe.currentTarget;if(le.remainderTooltipSummary){Ue.x=Ee(Fe),Ue.content=xe.value,Ue.visible=!!Ue.content;return}Ue.x=Fe.offsetLeft+Fe.offsetWidth/2,Ue.content=`${oe.label}: ${st(oe.value)}`,Ue.visible=!0},It=oe=>{if(!Q.value||!oe?.currentTarget)return;const fe=oe.currentTarget;if(le.remainderTooltipSummary){Ue.x=Ee(fe),Ue.content=xe.value,Ue.visible=!!Ue.content;return}Ue.x=fe.offsetLeft+fe.offsetWidth/2,U.value&&(Ue.content=`${le.remainderLabel}: ${st(Q.value)}`,Ue.visible=!0)},tn=()=>{Ue.visible=!1},Ot=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}));return(oe,fe)=>(e.openBlock(),e.createElementBlock("div",{class:"dss-step-bar",style:e.normalizeStyle(Ot.value)},[e.createElementVNode("div",D0,[e.createElementVNode("span",H0,[e.renderSlot(oe.$slots,"label",{label:T.label},()=>[e.createTextVNode(e.toDisplayString(T.label),1)])]),T.showCounter?(e.openBlock(),e.createElementBlock("span",R0,[e.renderSlot(oe.$slots,"counter",{counterDisplay:et.value},()=>[e.createTextVNode(e.toDisplayString(et.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",F0,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":q.value,"aria-valuenow":vt.value,"aria-label":T.label},[pt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He.value,(Fe,De)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${De}-${Fe.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":Ke(Fe),"dss-step-bar__segment--marker-enabled":K(Fe).enabled}]),style:e.normalizeStyle(Me(Fe)),onMouseenter:Zt=>xt(Fe,Zt),onMouseleave:tn},[K(Fe).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(ze(Fe)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(we(Fe))},[e.renderSlot(oe.$slots,"segment-marker-icon",{segment:Fe,index:De,marker:K(Fe)},()=>[e.renderSlot(oe.$slots,"max-segment-icon",{segment:Fe,index:De,marker:K(Fe)},()=>[e.createTextVNode(e.toDisplayString(K(Fe).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,z0))),128)),me.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(lt.value),onMouseenter:fe[0]||(fe[0]=Fe=>It(Fe)),onMouseleave:tn},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(A.value,Fe=>(e.openBlock(),e.createElementBlock("div",{key:Fe,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":Fe<=ve.value}])},null,2))),128))],8,I0),Ue.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip",style:e.normalizeStyle(Pe.value)},e.toDisplayString(Ue.content),5)):e.createCommentVNode("",!0)])],4))}},O0={contextMenu:{addMarker:"Add Marker",clearAllMarkers:"Clear All Markers",downloadSvg:"Download SVG",downloadPng:"Download PNG",downloadCsv:"Download CSV"},modalMarker:{editMarker:"Edit Marker",viewMarker:"View Marker",title:"Title",description:"Description",iconType:"Icon Type",defaultIcon:"Default Logo",iconPreview:"Icon Preview",deleteMarker:"Delete Marker",cancel:"Cancel",close:"Close",save:"Save",placeholderTitle:"Enter marker title",placeholderDescription:"Enter marker description (required)"},zoom:{doubleClickToReset:"(Double-click to reset)"},csv:{chartTitle:"Chart Title",chartSubtitle:"Chart Subtitle",generated:"Generated"},fallback:{item:"Item",axis:"Axis"},tooltip:{flags:"Flags",markers:"Markers",manualFlags:"Manual Flags",autoFlags:"Auto Flags"}},W0={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",currentPageAriaLabel:"Current page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",searchAriaLabel:"Search",searchTableAriaLabel:"Search table",clearSearchAriaLabel:"Clear search",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",expandRowAriaLabel:"Expand row",collapseRowAriaLabel:"Collapse row",filterColumnAriaLabel:"Filter column",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy",showingRange:"Showing {start}-{end} from {total}",ofPages:"of {total}",emptyMessage:"No data available"},q0={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"}},Z0={selectDate:"Select Date",selectRange:"Select range",startDate:"Start date",endDate:"End date",prevMonth:"Previous month",nextMonth:"Next month",quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",last3Months:"Last 3 months",last6Months:"Last 6 months",last12Months:"Last 12 months",lastYear:"Last year",allDates:"All dates",last2Dates:"Last 2 dates",last3Dates:"Last 3 dates",last4Dates:"Last 4 dates",last5Dates:"Last 5 dates"}},U0={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"}},eo={chart:O0,table:W0,filter:q0,datepicker:Z0,textEditor:U0},X0={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"}},Y0={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"},j0={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"}},K0={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",startDate:"Date de début",endDate:"Date de fin",prevMonth:"Mois précédent",nextMonth:"Mois suivant",quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",last3Months:"3 derniers mois",last6Months:"6 derniers mois",last12Months:"12 derniers mois",lastYear:"Dernière année",allDates:"Toutes les dates",last2Dates:"2 dernières dates",last3Dates:"3 dernières dates",last4Dates:"4 dernières dates",last5Dates:"5 dernières dates"}},G0={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"}},to={chart:X0,table:Y0,filter:j0,datepicker:K0,textEditor:G0},Q0={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"}},J0={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"},e9={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"}},t9={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",last3Months:"Laatste 3 maanden",last6Months:"Laatste 6 maanden",last12Months:"Laatste 12 maanden",lastYear:"Afgelopen jaar",allDates:"Alle datums",last2Dates:"Laatste 2 datums",last3Dates:"Laatste 3 datums",last4Dates:"Laatste 4 datums",last5Dates:"Laatste 5 datums"}},n9={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"}},no={chart:Q0,table:J0,filter:e9,datepicker:t9,textEditor:n9},Io={en:eo,fr:to,nl:no};function ca(T){if(!T||!T.global)return;const le=T.global.availableLocales||[];Object.keys(Io).forEach(M=>{le.includes(M)&&T.global.mergeLocaleMessage(M,Io[M])})}const zo={en:{textEditor:eo.textEditor},fr:{textEditor:to.textEditor},nl:{textEditor:no.textEditor}};function ua(T){if(!T||!T.global)return;const le=T.global.availableLocales||[];Object.keys(zo).forEach(M=>{le.includes(M)&&T.global.mergeLocaleMessage(M,zo[M])})}const Po={en:{table:eo.table},fr:{table:to.table},nl:{table:no.table}};function da(T){if(!T||!T.global)return;const le=T.global.availableLocales||[];Object.keys(Po).forEach(M=>{le.includes(M)&&T.global.mergeLocaleMessage(M,Po[M])})}const Oo={en:{datepicker:eo.datepicker},fr:{datepicker:to.datepicker},nl:{datepicker:no.datepicker}};function ma(T){if(!T||!T.global)return;const le=T.global.availableLocales||[];Object.keys(Oo).forEach(M=>{le.includes(M)&&T.global.mergeLocaleMessage(M,Oo[M])})}const Wo={en:{filter:eo.filter},fr:{filter:to.filter},nl:{filter:no.filter}};function pa(T){if(!T||!T.global)return;const le=T.global.availableLocales||[];Object.keys(Wo).forEach(M=>{le.includes(M)&&T.global.mergeLocaleMessage(M,Wo[M])})}const l9={chart:Io,textEditor:zo,table:Po,datepicker:Oo,filter:Wo};function o9(T){!T||!T.global||(ca(T),ua(T),da(T),ma(T),pa(T))}const a9={en:{...eo},fr:{...to},nl:{...no}};Jl.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:a9});exports.DSSChart=lc;exports.DSSChartMessages=Io;exports.DSSColorPicker=qm;exports.DSSConfetti=y2;exports.DSSDatepicker=ea;exports.DSSDatepickerMessages=Oo;exports.DSSDnd=g2;exports.DSSFilter=S0;exports.DSSFilterMessages=Wo;exports.DSSLoader=l2;exports.DSSMessages=l9;exports.DSSModal=Jo;exports.DSSPillField=A0;exports.DSSSkeleton=o2;exports.DSSStepBar=P0;exports.DSSTable=Su;exports.DSSTableMessages=Po;exports.DSSTextEditor=Bm;exports.DSSTextEditorMessages=zo;exports.addDSSChartTranslations=ca;exports.addDSSDatepickerTranslations=ma;exports.addDSSFilterTranslations=pa;exports.addDSSTableTranslations=da;exports.addDSSTextEditorTranslations=ua;exports.addDSSTranslations=o9;
117
+ `,document.body.appendChild(Ke),xe=Ke}function ze(J,he){xe&&(xe.style.left=`${J-nt}px`,xe.style.top=`${he-ft}px`)}function we(J){J.classList.add("dss-dnd-item--dragging"),J.style.background=fe.value.dragSourceBackground,J.style.borderColor=fe.value.dragSourceBorder,J.style.transform="scale(0.97)"}function it(J){J.classList.remove("dss-dnd-item--dragging"),J.style.background="",J.style.borderColor="",J.style.transform=""}function ot(J,he){return document.elementFromPoint(J,he)?.closest(".dss-dnd-column-body")??null}function bt(J,he){return!!document.elementFromPoint(J,he)?.closest("[data-dss-dnd-delete-zone]")}function It(J,he){if(I.value&&bt(J,he)){Ce.value=!0,be.value=null,G.value=-1;return}Ce.value=!1;const Be=ot(J,he),Xe=Be?.getAttribute("data-column")??null;if(!Xe){be.value=null,G.value=-1;return}be.value=Xe;const Ke=Be.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Lt=Ke.length;for(let Ge=0;Ge<Ke.length;Ge++){const Dt=Ke[Ge].getBoundingClientRect();if(he<Dt.top+Dt.height/2){Lt=Ge;break}}G.value=Lt}function en(J){J.preventDefault(),ze(J.clientX,J.clientY),!me&&(me=requestAnimationFrame(()=>{me=null,It(J.clientX,J.clientY)}))}function Pt(J){window.removeEventListener("pointermove",en),window.removeEventListener("pointerup",Pt),window.removeEventListener("pointercancel",Pt),Ae?.releasePointerCapture?.(J.pointerId),it(Ae),Ae=null;const he=I.value&&bt(J.clientX,J.clientY);if(f.value&&he)L("delete",{item:f.value});else{const Xe=ot(J.clientX,J.clientY)?.getAttribute("data-column")??null;if(f.value&&Xe){const Ke=f.value[M.columnKey],Lt=Xe,Dt=(Ee.value[Lt]||[]).filter(St=>St[M.itemKey]!==f.value[M.itemKey]),He=Math.max(0,Math.min(G.value,Dt.length)),Pe=je(Lt,He),Et=f.value[M.itemKey];L("move",{item:f.value,from:Ke,to:Lt,position:Pe,index:He}),R&&clearTimeout(R),U.value={id:Et,from:Ke,to:Lt},R=setTimeout(()=>{U.value=null},3500)}}xe&&(xe.remove(),xe=null),Z!==null&&(document.body.style.cursor=Z,Z=""),Ot()}function oe(J,he){J.preventDefault();const Be=J.target.closest(".dss-dnd-item");if(!Be)return;const Xe=Be.getBoundingClientRect();nt=J.clientX-Xe.left,ft=J.clientY-Xe.top,Z=document.body.style.cursor,document.body.style.cursor="grabbing",f.value=he,Ae=Be,Q(Be,J.clientX,J.clientY),requestAnimationFrame(()=>we(Be)),Be.setPointerCapture?.(J.pointerId),window.addEventListener("pointermove",en),window.addEventListener("pointerup",Pt,{once:!0}),window.addEventListener("pointercancel",Pt,{once:!0})}function ve(){Ue&&(window.removeEventListener("pointermove",Fe),window.removeEventListener("pointerup",De),window.removeEventListener("pointercancel",De),Ue=null)}function Fe(J){if(!Ue||J.pointerId!==Ue.pointerId)return;const he=J.clientX-Ue.startX,Be=J.clientY-Ue.startY;if(Math.abs(he)>=qe||Math.abs(Be)>=qe){const Xe=Ue.item;ve(),oe(J,Xe)}}function De(J){!Ue||J.pointerId!==Ue.pointerId||ve()}function Zt(J,he){ve(),Ue={item:he,startX:J.clientX,startY:J.clientY,pointerId:J.pointerId},window.addEventListener("pointermove",Fe),window.addEventListener("pointerup",De),window.addEventListener("pointercancel",De)}function yt(J,he){fe.value.useHandle||Zt(J,he)}function Ut(J,he){Zt(J,he)}function xt(){me&&(cancelAnimationFrame(me),me=null)}function Ot(){xt(),f.value=null,be.value=null,Ce.value=!1,G.value=-1}return e.onBeforeUnmount(()=>{xt(),ve(),R&&clearTimeout(R),xe&&(xe.remove(),xe=null)}),(J,he)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":fe.value.unstyled}]),style:e.normalizeStyle(dt.value)},[I.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":Ce.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(J.$slots,"delete-zone",{isDragging:!!f.value,isOver:Ce.value})],2),[[e.vShow,!!f.value||fe.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.columns,Be=>(e.openBlock(),e.createElementBlock("div",{key:Be.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":be.value==Be.value},Be.class||""]]),style:e.normalizeStyle(ee(Be))},[fe.value.showHeader?(e.openBlock(),e.createElementBlock("div",s2,[e.renderSlot(J.$slots,"column-header",{column:Be,items:Ee.value[Be.value]||[]},()=>[e.createElementVNode("span",r2,e.toDisplayString(Be.title||Be.value),1),e.createElementVNode("span",i2,e.toDisplayString((Ee.value[Be.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Be.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Me.value[Be.value],Xe=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Xe.key},[Xe.type==="indicator"?(e.openBlock(),e.createElementBlock("div",u2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Xe.isDragged,"dss-dnd-item--no-handle":!fe.value.useHandle}]),onPointerdown:Ke=>yt(Ke,Xe.item)},[fe.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Ke=>Ut(Ke,Xe.item),["stop"])},[e.renderSlot(J.$slots,"handle",{},()=>[he[0]||(he[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,m2)):e.createCommentVNode("",!0),e.createElementVNode("div",p2,[e.renderSlot(J.$slots,"item",{item:Xe.item,column:Be,justDropped:U.value?.id===Xe.item[D.itemKey],droppedFrom:U.value?.id===Xe.item[D.itemKey]?U.value.from:null,droppedTo:U.value?.id===Xe.item[D.itemKey]?U.value.to:null},()=>[e.createElementVNode("div",f2,e.toDisplayString(Xe.item[D.itemKey]),1)])])],42,d2))],64))),128)),(Ee.value[Be.value]||[]).length===0&&be.value!=Be.value?(e.openBlock(),e.createElementBlock("div",v2,[e.renderSlot(J.$slots,"empty",{column:Be},()=>[he[1]||(he[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,c2)],6))),128))],6))}}),y2={name:"DSSConfetti"},k2=Object.assign(y2,{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(D){const le=D,M=e.ref(null),L=e.ref(!1);let de=[],I=null,T=null;function fe(G,U){const me=[];for(let R=0;R<le.count;R++)me.push(dt(G));return me}function dt(G,U){return{x:Math.random()*G,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 ee(G,U,me,R){G.clearRect(0,0,U,me);for(const xe of de)G.save(),G.globalAlpha=xe.opacity*R,G.beginPath(),G.lineWidth=xe.r,G.strokeStyle=xe.color,G.moveTo(xe.x+xe.tilt+xe.r/2,xe.y),G.lineTo(xe.x+xe.tilt,xe.y+xe.tilt+xe.r/2),G.stroke(),G.restore()}function f(G,U,me){const R=.3+me*.7;for(let xe=0;xe<de.length;xe++){const Ae=de[xe];Ae.tiltAngle+=Ae.tiltInc,Ae.y+=Ae.speed*R,Ae.x+=Math.sin(Ae.d)*.5*R,Ae.tilt=Math.sin(Ae.tiltAngle)*15,me>=.99&&Ae.y>U+20&&(de[xe]=dt(G))}}function be(){L.value=!0,e.nextTick(()=>{const G=M.value;if(!G)return;const U=G.getContext("2d"),me=G.parentElement;if(!me)return;const R=me.getBoundingClientRect();G.width=R.width,G.height=R.height,de=fe(G.width,G.height);const xe=Date.now(),Ae=xe+le.duration,nt=()=>{const ft=Date.now(),Z=ft-xe;if(ft<Ae){let Ue=1;Z>le.fadeStart&&(Ue=1-(Z-le.fadeStart)/(le.duration-le.fadeStart)),ee(U,G.width,G.height,Ue),f(G.width,G.height,Ue),I=requestAnimationFrame(nt)}else Ce()};nt()})}function Ce(){I&&(cancelAnimationFrame(I),I=null),de=[],L.value=!1}return e.watch(()=>le.trigger,G=>{G&&(T&&clearTimeout(T),T=setTimeout(be,le.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{Ce(),T&&clearTimeout(T)}),(G,U)=>L.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:M,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),C2={class:"dss-filter-global-inner"},b2=["placeholder","value"],w2=["title"],x2={key:0,class:"dss-filter-funnel-badge"},E2={key:1,class:"dss-filter-sortby"},S2=["value"],V2=["value"],N2=["disabled","title"],B2={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"},M2={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"},_2={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"},$2={class:"dss-filter-panel"},L2={key:0,class:"dss-filter-empty"},T2={class:"dss-filter-row-prefix"},A2={class:"dss-filter-cell"},D2=["onClick"],H2={class:"dss-filter-trigger-text"},R2=["placeholder"],F2={class:"dss-filter-popup-list"},I2=["onClick"],z2={key:0,class:"dss-filter-popup-empty"},P2={key:0,class:"dss-filter-cell"},O2=["onClick"],q2={class:"dss-filter-trigger-text"},W2={class:"dss-filter-popup-list"},Z2=["onClick"],U2={key:1,class:"dss-filter-cell dss-filter-cell--value"},X2=["placeholder","onUpdate:modelValue"],Y2={key:1,class:"dss-filter-date-wrap"},j2=["placeholder","onUpdate:modelValue"],K2=["placeholder","value","onInput","step"],G2={key:4,class:"dss-filter-between"},Q2=["placeholder","value","onInput","step"],J2={class:"dss-filter-between-sep"},e0=["placeholder","value","onInput","step"],t0={key:5,class:"dss-filter-multiselect"},n0=["onClick"],l0={class:"dss-filter-trigger-text"},o0=["placeholder"],a0={class:"dss-filter-popup-list dss-filter-popup-list--check"},s0=["onClick"],r0=["checked"],i0={key:0,class:"dss-filter-popup-empty"},c0=["onClick"],u0={class:"dss-filter-foot"},d0={class:"dss-filter-cell"},m0=["placeholder"],p0={class:"dss-filter-popup-list"},f0=["onClick"],v0={key:0,class:"dss-filter-popup-divider"},g0=["onClick"],h0=["placeholder"],y0={class:"dss-filter-popup-list"},k0=["onClick"],C0={key:0,class:"dss-filter-popup-empty"},b0=["placeholder"],w0={class:"dss-filter-popup-list"},x0=["onClick"],E0={key:0,class:"dss-filter-popup-empty"},S0={name:"DSSFilter"},V0=Object.assign(S0,{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(D,{expose:le,emit:M}){const{t:L}=eo.useI18n(),de=D,I=M,T={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},fe=e.computed(()=>({...T,...de.options})),dt={text:[{value:"contains"},{value:"not_contains"},{value:"equals"},{value:"not_equals"},{value:"starts_with"},{value:"ends_with"},{value:"is_empty"},{value:"is_not_empty"}],select:[{value:"is_any_of"},{value:"is_none_of"},{value:"is_empty"},{value:"is_not_empty"}],range:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],int:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],arraySelect:[{value:"contains_any"},{value:"contains_all"},{value:"not_contains_any"},{value:"is_empty"},{value:"is_not_empty"}],arrayText:[{value:"contains"},{value:"not_contains"},{value:"is_empty"},{value:"is_not_empty"}],date:[{value:"eq"},{value:"before"},{value:"after"},{value:"is_empty"},{value:"is_not_empty"}],boolean:[{value:"is_true"},{value:"is_false"},{value:"is_empty"},{value:"is_not_empty"}]},ee=new Set(["is_empty","is_not_empty","is_true","is_false"]),f=["label","name","title","keyword","full_name","value","text"],be=e.ref(""),Ce=e.ref([]),G=e.ref(null),U=e.ref(!1),me=e.ref(null),R=e.ref(""),xe=e.ref(null),Ae=e.ref(""),nt=e.ref("asc");let ft=1;function Z(S){const b=S.find(V=>V&&typeof V=="object");if(!b)return null;for(const V of f)if(V in b&&typeof b[V]=="string")return V;return Object.keys(b).find(V=>typeof b[V]=="string")||null}function Ue(S,b){const V=b.filter(Y=>Y!=null&&Y!=="NULL");if(V.length===0)return null;if(V.every(Y=>Array.isArray(Y))){const Y=V.flatMap(Oe=>Oe).filter(Oe=>Oe!=null);return Y.length===0?null:typeof Y.find(Oe=>Oe!=null)=="object"?"arraySelect":"arrayText"}return V.every(Y=>typeof Y=="boolean")?"boolean":V.every(Y=>typeof Y=="number")?new Set(V).size<=fe.value.maxUniqueForEnum?"select":"range":V.every(Y=>typeof Y=="string")?new Set(V).size<=fe.value.maxUniqueForSelect?"select":"text":V.some(Y=>typeof Y=="object"&&!Array.isArray(Y))?null:"text"}const qe=e.computed(()=>{if(!de.data?.length)return[];const S=new Set;for(const ne of de.data)if(ne&&typeof ne=="object")for(const Oe of Object.keys(ne))S.add(Oe);const b=new Set(de.exclude),V=[];for(const ne of S){if(b.has(ne))continue;const Oe=de.config[ne]||{},mt=de.data.map(wt=>wt?.[ne]),ct=Oe.type||Ue(ne,mt);if(!ct)continue;const We=Oe.filterMode||"contain",Vt=We==="date"?"date":We==="string"?"text":ct,Nt={key:ne,label:Oe.label||vt(ne),type:Vt,filterMode:We};if(ct==="select"){const wt=mt.filter(Ct=>Ct!=null&&Ct!=="NULL");Nt.uniqueValues=[...new Set(wt)].sort((Ct,At)=>typeof Ct=="number"&&typeof At=="number"?Ct-At:String(Ct).localeCompare(String(At)))}else if(ct==="range"||ct==="int"){const wt=mt.filter(Ct=>typeof Ct=="number");Nt.min=Math.min(...wt),Nt.max=Math.max(...wt)}else if(ct==="arraySelect"){const wt=Oe.displayKey||Z(mt.flatMap(Ct=>Array.isArray(Ct)?Ct:[]));if(Nt.displayKey=wt,Array.isArray(Oe.uniqueValues)&&Oe.uniqueValues.length>0)Nt.uniqueValues=Oe.uniqueValues.map(Ct=>String(Ct));else{const Ct=mt.flatMap(At=>Array.isArray(At)?At:[]).filter(At=>At!=null).map(At=>wt&&typeof At=="object"?At[wt]:String(At)).filter(At=>At!=null&&At!=="");Nt.uniqueValues=[...new Set(Ct)].sort((At,Bt)=>String(At).localeCompare(String(Bt)))}}V.push(Nt)}const Y=de.config._order;return Y&&V.sort((ne,Oe)=>{const mt=Y.indexOf(ne.key),ct=Y.indexOf(Oe.key);return mt===-1&&ct===-1?0:mt===-1?1:ct===-1?-1:mt-ct}),V}),Ee=e.computed(()=>{const S={};for(const b of qe.value)S[b.key]=b;return S}),Me=e.computed(()=>Array.isArray(de.config.groups)&&de.config.groups.length>0),je=e.computed(()=>{if(!Me.value)return[];const S=new Set(qe.value.map(b=>b.key));return de.config.groups.map(b=>({...b,keys:b.keys.filter(V=>S.has(V))})).filter(b=>b.keys.length>0)}),Q=e.computed(()=>{if(!Me.value)return[];const S=new Set(de.config.groups.flatMap(b=>b.keys));return qe.value.filter(b=>!S.has(b.key))}),ze=e.computed(()=>{if(!xe.value)return[];const S=new Set(xe.value.keys),b=qe.value.filter(Y=>S.has(Y.key));if(!R.value)return b;const V=R.value.toLowerCase();return b.filter(Y=>Y.label.toLowerCase().includes(V))}),we=e.computed(()=>{if(!R.value)return qe.value;const S=R.value.toLowerCase();return qe.value.filter(b=>b.label.toLowerCase().includes(S))}),it=e.computed(()=>qe.value.filter(S=>!["arraySelect","arrayText"].includes(S.type))),ot=e.computed(()=>Ae.value?nt.value==="asc"?"Ascending":"Descending":"No sort selected");function bt(S){G.value===S?It():(G.value=S,R.value="",xe.value=null)}function It(){G.value=null,R.value="",xe.value=null}function en(S){const b=S.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");G.value&&!b&&!S.target.closest(".dss-filter-popup")&&!S.target.closest(".dss-filter-trigger")&&!S.target.closest(".dss-filter-add-btn")&&It(),U.value&&me.value&&!me.value.contains(S.target)&&(b||(U.value=!1))}e.onMounted(()=>document.addEventListener("click",en)),e.onBeforeUnmount(()=>document.removeEventListener("click",en));function Pt(S){return Ee.value[S]?.label||vt(S)}function oe(S){return Ee.value[S.key]?.filterMode||"contain"}function ve(S){return L(`filter.operators.${S}`)}function Fe(S){const b=Ee.value[S.key];return(dt[b?.type]||dt.text).map(V=>({...V,label:L(`filter.operators.${V.value}`)}))}function De(S){return ee.has(S)}function Zt(S){const b=Ee.value[S.key];return b?b.type==="date"?"date":b.type==="boolean"?"boolean":b.type==="text"||b.type==="arrayText"?"text":b.type==="select"||b.type==="arraySelect"?"multiselect":b.type==="range"||b.type==="int"?S.operator==="between"?"between":"number":"text":"text"}function yt(S){return dt[S]?.[0]?.value||"contains"}function Ut(S,b){return ee.has(b)||S==="date"?null:S==="select"||S==="arraySelect"?[]:(S==="range"||S==="int")&&b==="between"?{min:null,max:null}:S==="range"||S==="int"?null:""}function xt(S){return Ee.value[S.key]?.uniqueValues||[]}function Ot(S){const b=xt(S);if(!R.value)return b;const V=R.value.toLowerCase();return b.filter(Y=>String(Y).toLowerCase().includes(V))}function J(S){const b=S.value;return!b||b.length===0?L("filter.select"):b.length<=2?b.join(", "):L("filter.selectedCount",{count:b.length})}function he(S){const b=Ee.value[S],V=b?.filterMode||"contain",Y=b?.type||"text",ne=V==="string"?"contains":yt(Y);Ce.value.push(e.reactive({id:ft++,key:S,operator:ne,value:Ut(Y,ne)})),It()}function Be(S){Ce.value=Ce.value.filter(b=>b.id!==S)}function Xe(S,b){const Y=Ee.value[b]?.type||"text";S.key=b,S.operator=yt(Y),S.value=Ut(Y,S.operator),It()}function Ke(S,b){const V=Zt(S);S.operator=b;const Y=Zt(S);if(V!==Y||ee.has(b)){const ne=Ee.value[S.key];S.value=Ut(ne?.type||"text",b)}It()}function Lt(S,b){const V=b.target.value;S.value=V===""?null:Number(V)}function Ge(S,b,V){const Y=V.target.value,ne=Y===""?null:Number(Y);(!S.value||typeof S.value!="object")&&(S.value={min:null,max:null}),S.value={...S.value,[b]:isNaN(ne)?null:ne}}function Dt(S,b){const V=S.value||[],Y=V.indexOf(b);S.value=Y>=0?V.filter(ne=>ne!==b):[...V,b]}function He(){Ce.value=[],be.value="",It()}function Pe(S){be.value=S.target.value}function Et(S){Ae.value=S.target.value}function St(){nt.value=nt.value==="asc"?"desc":"asc"}const K=e.computed(()=>{if(!de.data)return[];let S=de.data;if(be.value){const b=be.value.toLowerCase();S=S.filter(V=>{for(const Y of Object.keys(V)){const ne=V[Y];if(typeof ne=="string"&&ne.toLowerCase().includes(b)||typeof ne=="number"&&String(ne).includes(b)||Array.isArray(ne)&&ne.some(Oe=>Oe!=null&&(typeof Oe=="string"?Oe.toLowerCase().includes(b):typeof Oe=="object"?Object.values(Oe).some(mt=>typeof mt=="string"&&mt.toLowerCase().includes(b)):!1)))return!0}return!1})}for(const b of Ce.value){if(!pe(b))continue;const V=Ee.value[b.key];V&&(S=S.filter(Y=>ye(Y,b,V)))}if(de.showSortBy&&Ae.value){const b=Ae.value,V=nt.value==="asc"?1:-1;S=[...S].sort((Y,ne)=>W(Y?.[b],ne?.[b])*V)}return S});function W(S,b){const V=X(S),Y=X(b);return V==null&&Y==null?0:V==null?1:Y==null?-1:typeof V=="number"&&typeof Y=="number"?V-Y:String(V).localeCompare(String(Y),void 0,{numeric:!0,sensitivity:"base"})}function X(S){return S==null||S==="NULL"?null:typeof S=="string"||typeof S=="number"||typeof S=="boolean"?S:S instanceof Date?S.getTime():null}function pe(S){return ee.has(S.operator)?!0:S.value==null||typeof S.value=="string"&&S.value===""||Array.isArray(S.value)&&S.value.length===0?!1:S.value instanceof Date?!isNaN(S.value.getTime()):!(typeof S.value=="object"&&!Array.isArray(S.value)&&S.value.min==null&&S.value.max==null)}function ye(S,b,V){const Y=S?.[b.key],ne=b.value,Oe=b.operator;if(Oe==="is_empty")return mn(Y);if(Oe==="is_not_empty")return!mn(Y);const mt=V.type;if(mt==="text"||mt==="arrayText"){const ct=mt==="arrayText"&&Array.isArray(Y)?Y.filter(Nt=>Nt!=null).map(String).join(" "):Y!=null?String(Y):"",We=String(ne).toLowerCase(),Vt=ct.toLowerCase();switch(Oe){case"contains":return Vt.includes(We);case"not_contains":return!Vt.includes(We);case"equals":return Vt===We;case"not_equals":return Vt!==We;case"starts_with":return Vt.startsWith(We);case"ends_with":return Vt.endsWith(We);default:return!0}}if(mt==="select")switch(Oe){case"is_any_of":return ne.includes(Y);case"is_none_of":return!ne.includes(Y);default:return!0}if(mt==="range"||mt==="int"){const ct=typeof Y=="number"?Y:Number(Y);if(typeof ct!="number"||isNaN(ct))return!1;if(Oe==="between"){const Vt=ne?.min!=null?Number(ne.min):null,Nt=ne?.max!=null?Number(ne.max):null,wt=Vt!=null&&!isNaN(Vt)?Vt:null,Ct=Nt!=null&&!isNaN(Nt)?Nt:null;return(wt==null||ct>=wt)&&(Ct==null||ct<=Ct)}const We=typeof ne=="number"&&!isNaN(ne)?ne:Number(ne);if(Oe==="contains"||Oe==="not_contains"){const Vt=String(ct),Nt=String(ne??"").toLowerCase(),wt=Vt.toLowerCase().includes(Nt);return Oe==="contains"?wt:!wt}if(typeof We!="number"||isNaN(We))return!1;switch(Oe){case"eq":return ct===We;case"neq":return ct!==We;case"gt":return ct>We;case"gte":return ct>=We;case"lt":return ct<We;case"lte":return ct<=We;default:return!0}}if(mt==="arraySelect"){if(!Array.isArray(Y))return!1;const ct=Y.filter(We=>We!=null).map(We=>V.displayKey&&typeof We=="object"?We[V.displayKey]:String(We));switch(Oe){case"contains_any":return ct.some(We=>ne.includes(We));case"contains_all":return ne.every(We=>ct.includes(We));case"not_contains_any":return!ct.some(We=>ne.includes(We));default:return!0}}if(mt==="date"){const ct=Je(ne);if(!ct||isNaN(ct.getTime()))return!1;const We=Je(Y);if(!We||isNaN(We.getTime()))return!1;const Vt=Tt(We),Nt=Tt(ct);switch(Oe){case"eq":return Vt===Nt;case"before":return Vt<Nt;case"after":return Vt>Nt;default:return!0}}if(mt==="boolean"){const ct=Y===!0||Y==="true"||Y===1,We=Y===!1||Y==="false"||Y===0;switch(Oe){case"is_true":return ct;case"is_false":return We;default:return!0}}return!0}function Je(S){if(S==null)return null;if(S instanceof Date)return isNaN(S.getTime())?null:S;if(typeof S=="number")return new Date(S>1e10?S:S*1e3);if(typeof S=="string"){const b=new Date(S);return isNaN(b.getTime())?null:b}return null}function Tt(S){const b=S.getFullYear(),V=String(S.getMonth()+1).padStart(2,"0"),Y=String(S.getDate()).padStart(2,"0");return`${b}-${V}-${Y}`}function mn(S){return!!(S==null||S===""||S==="NULL"||Array.isArray(S)&&S.length===0||Array.isArray(S)&&S.every(b=>b==null))}e.watch(K,S=>I("update:modelValue",S),{immediate:!0}),e.watch(()=>de.data,()=>{Ce.value=[],be.value="",U.value=!1,Ae.value="",nt.value="asc",It()});function vt(S){return S.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,b=>b.toUpperCase())}function Gt(){const S=b=>{if(b==null)return b;if(b instanceof Date)return{_type:"Date",value:b.toISOString(),local:b.toLocaleDateString()};if(Array.isArray(b))return b.map(S);if(typeof b=="object"&&!Array.isArray(b)){const V={};for(const Y of Object.keys(b))V[Y]=S(b[Y]);return V}return b};return{globalSearch:be.value,rows:Ce.value.map(b=>({key:b.key,operator:b.operator,value:S(b.value),defType:Ee.value[b.key]?.type,defFilterMode:Ee.value[b.key]?.filterMode})),filteredCount:K.value?.length??0}}return le({getDebugState:Gt}),(S,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":fe.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:me},[e.createElementVNode("div",C2,[b[20]||(b[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref(L)("filter.searchAcrossFields"),value:be.value,onInput:Pe},null,40,b2),be.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:b[0]||(b[0]=V=>be.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:U.value||Ce.value.length>0,"dss-filter-funnel-btn--with-sort":de.showSortBy}]),onClick:b[1]||(b[1]=V=>U.value=!U.value),type:"button",title:U.value?e.unref(L)("filter.closeAdvancedFilter"):e.unref(L)("filter.openAdvancedFilter")},[b[14]||(b[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),Ce.value.length>0?(e.openBlock(),e.createElementBlock("span",x2,e.toDisplayString(Ce.value.length),1)):e.createCommentVNode("",!0)],10,w2),de.showSortBy?(e.openBlock(),e.createElementBlock("div",E2,[b[19]||(b[19]=e.createElementVNode("label",{class:"dss-filter-sortby-label",for:"dss-filter-sort-select"},"Sort by",-1)),e.createElementVNode("select",{id:"dss-filter-sort-select",class:"dss-filter-sortby-select",value:Ae.value,onChange:Et},[b[15]||(b[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(it.value,V=>(e.openBlock(),e.createElementBlock("option",{key:V.key,value:V.key},e.toDisplayString(V.label),9,V2))),128))],40,S2),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:St,disabled:!Ae.value,title:ot.value},[Ae.value?nt.value==="asc"?(e.openBlock(),e.createElementBlock("svg",M2,[...b[17]||(b[17]=[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",_2,[...b[18]||(b[18]=[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",B2,[...b[16]||(b[16]=[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"currentColor"},null,-1)])]))],8,N2)])):e.createCommentVNode("",!0)]),U.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:b[13]||(b[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",$2,[Ce.value.length===0?(e.openBlock(),e.createElementBlock("div",L2,e.toDisplayString(e.unref(L)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(V,Y)=>(e.openBlock(),e.createElementBlock("div",{key:V.id,class:"dss-filter-row"},[e.createElementVNode("span",T2,e.toDisplayString(Y===0?e.unref(L)("filter.where"):e.unref(L)("filter.and")),1),e.createElementVNode("div",A2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ne=>bt(`${V.id}:field`),["stop"])},[e.createElementVNode("span",H2,e.toDisplayString(Pt(V.key)),1),b[21]||(b[21]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,D2),G.value===`${V.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[3]||(b[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[2]||(b[2]=ne=>R.value=ne),placeholder:e.unref(L)("filter.searchAttributes")},null,8,R2),[[e.vModelText,R.value]]),e.createElementVNode("ul",F2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,ne=>(e.openBlock(),e.createElementBlock("li",{key:ne.key,class:"dss-filter-popup-item",onClick:Oe=>Xe(V,ne.key)},e.toDisplayString(ne.label),9,I2))),128)),we.value.length===0?(e.openBlock(),e.createElementBlock("li",z2,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),oe(V)==="contain"||oe(V)==="date"?(e.openBlock(),e.createElementBlock("div",P2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ne=>bt(`${V.id}:op`),["stop"])},[e.createElementVNode("span",q2,e.toDisplayString(ve(V.operator)),1),b[22]||(b[22]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,O2),G.value===`${V.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[4]||(b[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",W2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe(V),ne=>(e.openBlock(),e.createElementBlock("li",{key:ne.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:V.operator===ne.value}]),onClick:Oe=>Ke(V,ne.value)},e.toDisplayString(ne.label),11,Z2))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),De(V.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",U2,[oe(V)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),"onUpdate:modelValue":ne=>V.value=ne},null,8,X2)),[[e.vModelText,V.value]]):oe(V)==="date"?(e.openBlock(),e.createElementBlock("div",Y2,[e.createVNode(ta,{mode:"single",modelValue:V.value,"onUpdate:modelValue":ne=>V.value=ne},null,8,["modelValue","onUpdate:modelValue"])])):Zt(V)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),"onUpdate:modelValue":ne=>V.value=ne},null,8,j2)),[[e.vModelText,V.value]]):Zt(V)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),value:V.value,onInput:ne=>Lt(V,ne),step:Ee.value[V.key]?.type==="int"?1:void 0},null,40,K2)):Zt(V)==="between"?(e.openBlock(),e.createElementBlock("div",G2,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.min"),value:V.value?.min,onInput:ne=>Ge(V,"min",ne),step:Ee.value[V.key]?.type==="int"?1:void 0},null,40,Q2),e.createElementVNode("span",J2,e.toDisplayString(e.unref(L)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.max"),value:V.value?.max,onInput:ne=>Ge(V,"max",ne),step:Ee.value[V.key]?.type==="int"?1:void 0},null,40,e0)])):Zt(V)==="multiselect"?(e.openBlock(),e.createElementBlock("div",t0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(ne=>bt(`${V.id}:val`),["stop"])},[e.createElementVNode("span",l0,e.toDisplayString(J(V)),1),b[23]||(b[23]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,n0),G.value===`${V.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[6]||(b[6]=e.withModifiers(()=>{},["stop"]))},[xt(V).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[5]||(b[5]=ne=>R.value=ne),placeholder:e.unref(L)("filter.search")},null,8,o0)),[[e.vModelText,R.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",a0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ot(V),ne=>(e.openBlock(),e.createElementBlock("li",{key:ne,class:"dss-filter-popup-item",onClick:Oe=>Dt(V,ne)},[e.createElementVNode("input",{type:"checkbox",checked:(V.value||[]).includes(ne),tabindex:"-1"},null,8,r0),e.createElementVNode("span",null,e.toDisplayString(ne),1)],8,s0))),128)),Ot(V).length===0?(e.openBlock(),e.createElementBlock("li",i0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:ne=>Be(V.id)},[...b[24]||(b[24]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,c0)]))),128)),e.createElementVNode("div",u0,[e.createElementVNode("div",d0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:b[7]||(b[7]=e.withModifiers(V=>bt("add"),["stop"]))},e.toDisplayString(e.unref(L)("filter.addFilter")),1),G.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:b[12]||(b[12]=e.withModifiers(()=>{},["stop"]))},[Me.value&&!xe.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":b[8]||(b[8]=V=>R.value=V),placeholder:e.unref(L)("filter.searchAttributes")},null,8,m0),[[e.vModelText,R.value]]),e.createElementVNode("ul",p0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:Y=>xe.value=V},[e.createElementVNode("span",null,e.toDisplayString(V.label),1),b[25]||(b[25]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,f0))),128)),Q.value.length>0?(e.openBlock(),e.createElementBlock("li",v0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:Y=>he(V.key)},e.toDisplayString(V.label),9,g0))),128))])],64)):xe.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:b[9]||(b[9]=V=>xe.value=null)},[b[26]||(b[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(xe.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[10]||(b[10]=V=>R.value=V),placeholder:e.unref(L)("filter.searchAttributes")},null,8,h0),[[e.vModelText,R.value]]),e.createElementVNode("ul",y0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:Y=>he(V.key)},e.toDisplayString(V.label),9,k0))),128)),ze.value.length===0?(e.openBlock(),e.createElementBlock("li",C0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[11]||(b[11]=V=>R.value=V),placeholder:e.unref(L)("filter.searchAttributes")},null,8,b0),[[e.vModelText,R.value]]),e.createElementVNode("ul",w0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:Y=>he(V.key)},e.toDisplayString(V.label),9,x0))),128)),we.value.length===0?(e.openBlock(),e.createElementBlock("li",E0,e.toDisplayString(e.unref(L)("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:He},e.toDisplayString(e.unref(L)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),N0={class:"dss-pill-field__pills"},B0=["data-value"],M0=["disabled"],_0={class:"dss-pill-field__pill-text"},$0={key:0,class:"dss-pill-field__pill-actions"},L0=["onClick"],T0=["onClick"],A0=["placeholder","disabled"],D0=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(D,{emit:le}){const M=D,L=le,de=e.ref(""),I=e.ref([...M.modelValue]),T=e.ref(null);let fe=null;const dt=e.ref(null),ee=e.ref(""),f=e.ref(null),be=e.ref(null),Ce=e.computed(()=>{if(!be.value)return;const{width:Me,height:je}=be.value;return{minWidth:`${Me}px`,height:`${je}px`}});function G(Me,je){dt.value===je&&(f.value=Me)}function U(){dt.value=null,ee.value="",be.value=null,f.value=null}const me=e.computed(()=>new Set(I.value.map(Me=>Me.trim()).filter(Boolean)));function R(Me){T.value=Me,fe&&clearTimeout(fe),fe=setTimeout(()=>{T.value=null,fe=null},900)}function xe(Me){const je=Me.trim();return je?me.value.has(je)?(R(je),!1):(I.value=[...I.value,je],L("update:modelValue",[...I.value]),!0):!1}function Ae(Me){const je=Me.split(/\r?\n/g).map(it=>it.trim()).filter(Boolean);if(!je.length)return;const Q=new Set(I.value.map(it=>it.trim()).filter(Boolean)),ze=[...I.value];let we=null;for(const it of je){if(Q.has(it)){we??=it;continue}Q.add(it),ze.push(it)}ze.length!==I.value.length&&(I.value=ze,L("update:modelValue",[...I.value])),we&&R(we)}function nt(Me){M.disabled||(dt.value===Me&&U(),I.value=I.value.filter((je,Q)=>Q!==Me),L("update:modelValue",[...I.value]))}async function ft(Me,je){if(M.disabled)return;const Q=je.currentTarget.closest(".dss-pill-field__pill");Q&&(be.value={width:Q.offsetWidth,height:Q.offsetHeight}),dt.value=Me,ee.value=I.value[Me]??"",await e.nextTick();const ze=f.value;if(!ze)return;ze.focus();const we=ze.value.length;ze.setSelectionRange(we,we)}function Z(){U()}function Ue(){if(M.disabled||dt.value===null)return;const Me=dt.value,je=I.value[Me]??"",Q=ee.value.trim();if(U(),Q!==je&&me.value.has(Q)){R(Q);return}if(!Q){I.value=I.value.filter((we,it)=>it!==Me),L("update:modelValue",[...I.value]);return}const ze=I.value.map((we,it)=>it===Me?Q:we);I.value=ze,L("update:modelValue",[...I.value])}function qe(Me){Me.preventDefault(),!M.disabled&&(xe(de.value),de.value="")}function Ee(Me){if(M.disabled)return;const je=Me.clipboardData?.getData("text")??"";!je.includes(`
118
+ `)&&!je.includes("\r")||(Me.preventDefault(),Ae(je),de.value="")}return e.watch(()=>M.modelValue,Me=>{I.value=Array.isArray(Me)?[...Me]:[]},{deep:!0}),e.onBeforeUnmount(()=>{fe&&clearTimeout(fe)}),(Me,je)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":Me.disabled}])},[e.createElementVNode("div",N0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I.value,(Q,ze)=>(e.openBlock(),e.createElementBlock("span",{key:Q,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":T.value===Q,"dss-pill-field__pill--editing":dt.value===ze}]),style:e.normalizeStyle(dt.value===ze&&be.value?Ce.value:void 0)},[dt.value===ze?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-pill-field__pill-edit-wrap","data-value":ee.value||" "},[e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:we=>G(we,ze),"onUpdate:modelValue":je[0]||(je[0]=we=>ee.value=we),class:"dss-pill-field__pill-edit",type:"text",disabled:Me.disabled,onKeydown:[e.withKeys(Ue,["enter"]),e.withKeys(Z,["esc"])],onBlur:Ue},null,40,M0),[[e.vModelText,ee.value]])],8,B0)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",_0,e.toDisplayString(Q),1),Me.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",$0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:we=>ft(ze,we)},[...je[2]||(je[2]=[e.createElementVNode("svg",{class:"dss-pill-field__pill-action-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})],-1)])],8,L0),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:we=>nt(ze)}," × ",8,T0)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":je[1]||(je[1]=Q=>de.value=Q),class:"dss-pill-field__input",type:"text",placeholder:I.value.length?"":Me.placeholder,disabled:Me.disabled,onPaste:Ee,onKeydown:e.withKeys(qe,["enter"])},null,40,A0),[[e.vModelText,de.value]])])],2))}}),H0={class:"dss-step-bar__header"},R0={class:"dss-step-bar__label"},F0={key:0,class:"dss-step-bar__counter"},I0={class:"dss-step-bar__track-wrapper"},z0=["aria-valuemax","aria-valuenow","aria-label"],P0=["onMouseenter"],O0={__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:D=>["input","desc","asc"].includes(D)},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(D){const le=D,M={segmentMarker:{color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"},maxSegment:{marker:{enabled:!1,color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"}}},L=oe=>oe&&typeof oe=="object"&&!Array.isArray(oe),de=(oe,ve)=>{const Fe=Object.assign({},oe);return!L(oe)||!L(ve)||Object.keys(ve).forEach(De=>{if(L(ve[De])){De in oe?Fe[De]=de(oe[De],ve[De]):Object.assign(Fe,{[De]:ve[De]});return}Object.assign(Fe,{[De]:ve[De]})}),Fe},I=e.computed(()=>de(M,le.options)),T=e.computed(()=>Math.max(1,Number(le.steps)||1)),fe=e.computed(()=>Math.min(T.value,Math.max(0,Number(le.currentStep)||0))),dt=e.computed(()=>Array.isArray(le.segments)&&le.segments.length>0),ee=e.computed(()=>{if(!dt.value)return[];const oe=le.segments.map((ve,Fe)=>{const De=Number(ve?.value);return{label:ve?.label||`Step ${Fe+1}`,value:Number.isFinite(De)&&De>0?De:0,color:ve?.color||le.activeColor,marker:ve?.marker}});return le.segmentOrder==="desc"?[...oe].sort((ve,Fe)=>Fe.value-ve.value):le.segmentOrder==="asc"?[...oe].sort((ve,Fe)=>ve.value-Fe.value):oe}),f=e.computed(()=>dt.value?ee.value.reduce((oe,ve)=>oe+ve.value,0):fe.value),be=e.computed(()=>dt.value?Number.isFinite(Number(le.totalValue))&&Number(le.totalValue)>0?Number(le.totalValue):Math.max(1,f.value):T.value),Ce=e.computed(()=>dt.value&&Number.isFinite(Number(le.totalValue))&&Number(le.totalValue)>0),G=e.computed(()=>Ce.value?Math.max(0,Number(le.totalValue)-f.value):0),U=e.computed(()=>typeof le.remainderLabel=="string"&&le.remainderLabel.trim().length>0),me=e.computed(()=>G.value>0),R=e.computed(()=>ee.value.reduce((oe,ve)=>Math.max(oe,Number(ve.value)||0),0)),xe=e.computed(()=>ee.value.filter(oe=>oe.value>0).map(oe=>`${oe.label}: ${it(oe.value)}`).join(" | ")),Ae=e.computed(()=>dt.value?Ce.value?ee.value.filter(oe=>oe.value>0):ee.value:[]),nt=e.computed(()=>{if(!le.counterAsPercentage)return`${f.value} / ${be.value}`;const oe=Number(be.value);if(!Number.isFinite(oe)||oe<=0)return"0%";const ve=Math.round(Number(f.value)/oe*100);return`${Math.min(Math.max(ve,0),100)}%`}),ft=e.computed(()=>f.value),Z=e.computed(()=>be.value),Ue=e.reactive({visible:!1,x:0,content:""}),qe=e.computed(()=>({left:`${Ue.x}px`})),Ee=oe=>{const ve=oe?.parentElement;return ve?ve.offsetLeft+ve.offsetWidth/2:0},Me=oe=>{if(Ce.value){const De=Math.max(0,Number(oe.value)||0);return{flex:`${De} 0 0`,minWidth:De>0?"6px":"0",backgroundColor:oe.color}}const ve=f.value;return{flex:`${oe.value>0?oe.value:ve>0?1e-4:1} 0 0`,minWidth:"6px",backgroundColor:oe.color}},je=oe=>Number(oe?.value||0)>0&&Number(oe?.value||0)===R.value,Q=oe=>{const ve=L(oe?.marker)?oe.marker:{},Fe=oe?.marker===!0||ve.enabled===!0,De=je(oe)&&I.value.maxSegment?.marker?.enabled===!0;if(!(Fe||De))return{enabled:!1};const yt=ve.backgroundColor??(De?I.value.maxSegment?.marker?.backgroundColor:I.value.segmentMarker?.backgroundColor),Ut=ve.borderColor??(De?I.value.maxSegment?.marker?.borderColor:I.value.segmentMarker?.borderColor),xt=ve.color??(De?I.value.maxSegment?.marker?.color:I.value.segmentMarker?.color),Ot=ve.width??(De?I.value.maxSegment?.marker?.width:I.value.segmentMarker?.width),J=ve.height??(De?I.value.maxSegment?.marker?.height:I.value.segmentMarker?.height);return{enabled:!0,backgroundColor:yt,borderColor:Ut,color:xt,width:Ot,height:J,icon:ve.icon??null,...ve}},ze=oe=>{const ve=Q(oe);return{backgroundColor:ve.backgroundColor??void 0,borderColor:ve.borderColor??void 0,color:ve.color??void 0}},we=oe=>{const ve=Q(oe);return{width:ve.width??void 0,height:ve.height??void 0}},it=oe=>`${oe}${le.valueLabel}`,ot=e.computed(()=>({flex:`${G.value} 0 0`,minWidth:G.value>0?"6px":"0",backgroundColor:le.inactiveColor})),bt=(oe,ve)=>{if(!oe||!ve?.currentTarget)return;const Fe=ve.currentTarget;if(le.remainderTooltipSummary){Ue.x=Ee(Fe),Ue.content=xe.value,Ue.visible=!!Ue.content;return}Ue.x=Fe.offsetLeft+Fe.offsetWidth/2,Ue.content=`${oe.label}: ${it(oe.value)}`,Ue.visible=!0},It=oe=>{if(!G.value||!oe?.currentTarget)return;const ve=oe.currentTarget;if(le.remainderTooltipSummary){Ue.x=Ee(ve),Ue.content=xe.value,Ue.visible=!!Ue.content;return}Ue.x=ve.offsetLeft+ve.offsetWidth/2,U.value&&(Ue.content=`${le.remainderLabel}: ${it(G.value)}`,Ue.visible=!0)},en=()=>{Ue.visible=!1},Pt=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}));return(oe,ve)=>(e.openBlock(),e.createElementBlock("div",{class:"dss-step-bar",style:e.normalizeStyle(Pt.value)},[e.createElementVNode("div",H0,[e.createElementVNode("span",R0,[e.renderSlot(oe.$slots,"label",{label:D.label},()=>[e.createTextVNode(e.toDisplayString(D.label),1)])]),D.showCounter?(e.openBlock(),e.createElementBlock("span",F0,[e.renderSlot(oe.$slots,"counter",{counterDisplay:nt.value},()=>[e.createTextVNode(e.toDisplayString(nt.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",I0,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":Z.value,"aria-valuenow":ft.value,"aria-label":D.label},[dt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value,(Fe,De)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${De}-${Fe.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":je(Fe),"dss-step-bar__segment--marker-enabled":Q(Fe).enabled}]),style:e.normalizeStyle(Me(Fe)),onMouseenter:Zt=>bt(Fe,Zt),onMouseleave:en},[Q(Fe).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(ze(Fe)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(we(Fe))},[e.renderSlot(oe.$slots,"segment-marker-icon",{segment:Fe,index:De,marker:Q(Fe)},()=>[e.renderSlot(oe.$slots,"max-segment-icon",{segment:Fe,index:De,marker:Q(Fe)},()=>[e.createTextVNode(e.toDisplayString(Q(Fe).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,P0))),128)),me.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(ot.value),onMouseenter:ve[0]||(ve[0]=Fe=>It(Fe)),onMouseleave:en},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(T.value,Fe=>(e.openBlock(),e.createElementBlock("div",{key:Fe,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":Fe<=fe.value}])},null,2))),128))],8,z0),Ue.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip",style:e.normalizeStyle(qe.value)},e.toDisplayString(Ue.content),5)):e.createCommentVNode("",!0)])],4))}},q0={contextMenu:{addMarker:"Add Marker",clearAllMarkers:"Clear All Markers",downloadSvg:"Download SVG",downloadPng:"Download PNG",downloadCsv:"Download CSV"},modalMarker:{editMarker:"Edit Marker",viewMarker:"View Marker",title:"Title",description:"Description",iconType:"Icon Type",defaultIcon:"Default Logo",iconPreview:"Icon Preview",deleteMarker:"Delete Marker",cancel:"Cancel",close:"Close",save:"Save",placeholderTitle:"Enter marker title",placeholderDescription:"Enter marker description (required)"},zoom:{doubleClickToReset:"(Double-click to reset)"},csv:{chartTitle:"Chart Title",chartSubtitle:"Chart Subtitle",generated:"Generated"},fallback:{item:"Item",axis:"Axis"},tooltip:{flags:"Flags",markers:"Markers",manualFlags:"Manual Flags",autoFlags:"Auto Flags"}},W0={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",currentPageAriaLabel:"Current page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",searchAriaLabel:"Search",searchTableAriaLabel:"Search table",clearSearchAriaLabel:"Clear search",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",expandRowAriaLabel:"Expand row",collapseRowAriaLabel:"Collapse row",filterColumnAriaLabel:"Filter column",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy",showingRange:"Showing {start}-{end} from {total}",ofPages:"of {total}",emptyMessage:"No data available"},Z0={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"}},U0={selectDate:"Select Date",selectRange:"Select range",startDate:"Start date",endDate:"End date",prevMonth:"Previous month",nextMonth:"Next month",quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",last3Months:"Last 3 months",last6Months:"Last 6 months",last12Months:"Last 12 months",lastYear:"Last year",allDates:"All dates",last2Dates:"Last 2 dates",last3Dates:"Last 3 dates",last4Dates:"Last 4 dates",last5Dates:"Last 5 dates"}},X0={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"}},to={chart:q0,table:W0,filter:Z0,datepicker:U0,textEditor:X0},Y0={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"}},j0={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"},K0={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"}},G0={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",startDate:"Date de début",endDate:"Date de fin",prevMonth:"Mois précédent",nextMonth:"Mois suivant",quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",last3Months:"3 derniers mois",last6Months:"6 derniers mois",last12Months:"12 derniers mois",lastYear:"Dernière année",allDates:"Toutes les dates",last2Dates:"2 dernières dates",last3Dates:"3 dernières dates",last4Dates:"4 dernières dates",last5Dates:"5 dernières dates"}},Q0={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"}},no={chart:Y0,table:j0,filter:K0,datepicker:G0,textEditor:Q0},J0={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"}},e9={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"},t9={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"}},n9={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",last3Months:"Laatste 3 maanden",last6Months:"Laatste 6 maanden",last12Months:"Laatste 12 maanden",lastYear:"Afgelopen jaar",allDates:"Alle datums",last2Dates:"Laatste 2 datums",last3Dates:"Laatste 3 datums",last4Dates:"Laatste 4 datums",last5Dates:"Laatste 5 datums"}},l9={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"}},lo={chart:J0,table:e9,filter:t9,datepicker:n9,textEditor:l9},zo={en:to,fr:no,nl:lo};function ua(D){if(!D||!D.global)return;const le=D.global.availableLocales||[];Object.keys(zo).forEach(M=>{le.includes(M)&&D.global.mergeLocaleMessage(M,zo[M])})}const Po={en:{textEditor:to.textEditor},fr:{textEditor:no.textEditor},nl:{textEditor:lo.textEditor}};function da(D){if(!D||!D.global)return;const le=D.global.availableLocales||[];Object.keys(Po).forEach(M=>{le.includes(M)&&D.global.mergeLocaleMessage(M,Po[M])})}const Oo={en:{table:to.table},fr:{table:no.table},nl:{table:lo.table}};function ma(D){if(!D||!D.global)return;const le=D.global.availableLocales||[];Object.keys(Oo).forEach(M=>{le.includes(M)&&D.global.mergeLocaleMessage(M,Oo[M])})}const qo={en:{datepicker:to.datepicker},fr:{datepicker:no.datepicker},nl:{datepicker:lo.datepicker}};function pa(D){if(!D||!D.global)return;const le=D.global.availableLocales||[];Object.keys(qo).forEach(M=>{le.includes(M)&&D.global.mergeLocaleMessage(M,qo[M])})}const Wo={en:{filter:to.filter},fr:{filter:no.filter},nl:{filter:lo.filter}};function fa(D){if(!D||!D.global)return;const le=D.global.availableLocales||[];Object.keys(Wo).forEach(M=>{le.includes(M)&&D.global.mergeLocaleMessage(M,Wo[M])})}const o9={chart:zo,textEditor:Po,table:Oo,datepicker:qo,filter:Wo};function a9(D){!D||!D.global||(ua(D),da(D),ma(D),pa(D),fa(D))}const s9={en:{...to},fr:{...no},nl:{...lo}};eo.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:s9});exports.DSSChart=oc;exports.DSSChartMessages=zo;exports.DSSColorPicker=Zm;exports.DSSConfetti=k2;exports.DSSDatepicker=ta;exports.DSSDatepickerMessages=qo;exports.DSSDnd=h2;exports.DSSFilter=V0;exports.DSSFilterMessages=Wo;exports.DSSLoader=o2;exports.DSSMessages=o9;exports.DSSModal=ea;exports.DSSPillField=D0;exports.DSSSkeleton=a2;exports.DSSStepBar=O0;exports.DSSTable=Vu;exports.DSSTableMessages=Oo;exports.DSSTextEditor=Mm;exports.DSSTextEditorMessages=Po;exports.addDSSChartTranslations=ua;exports.addDSSDatepickerTranslations=pa;exports.addDSSFilterTranslations=fa;exports.addDSSTableTranslations=ma;exports.addDSSTextEditorTranslations=da;exports.addDSSTranslations=a9;