dsp-semactic 0.6.55 → 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/README.md +5 -5
- package/dist/dsp-semactic.css +1 -1
- package/dist/index.cjs.js +29 -29
- package/dist/index.es.js +5693 -5634
- package/package.json +48 -48
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Gl=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:oe}){const M=T,L=oe,{t:fe,locale:P}=Gl.useI18n(),A=e.ref(!1),pe=e.ref("days"),ft=new Date,ee=e.computed(()=>M.minDate instanceof Date?M.minDate:ft),f=e.ref(ee.value.getMonth()),be=e.ref(ee.value.getFullYear()),Ce=e.ref(ee.value.getMonth()),Q=e.ref(ee.value.getFullYear()),X=e.ref(ee.value.getMonth()),de=e.ref(ee.value.getFullYear()),H=e.ref("start"),Ee=e.ref(null),Ie=e.ref(null);function ot(){const R=ee.value,W=R.getMonth(),I=R.getFullYear(),ne=W===11?0:W+1,Ae=W===11?I+1:I;return{left:{month:W,year:I},right:{month:ne,year:Ae}}}const vt=e.ref(null),q=e.ref(null),Ye=e.ref(null),qe=e.ref(null),Se=e.ref(null),$e=e.ref(null),Ge=new Date().getFullYear(),K=e.computed(()=>["single","singleFromAvailable"].includes(M.mode)),We=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}),ct=e.computed(()=>{if(!We.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 rt(R){if(!R||!(R instanceof Date))return"";const W=R.getDate(),I=R.getMonth()+1,ne=R.getFullYear(),Ae=dt=>String(dt).padStart(2,"0");return`${Ae(W)}/${Ae(I)}/${ne}`}const Et=e.computed(()=>rt(we.value)),Rt=e.computed(()=>{const{start:R,end:W}=ct.value;if(!R&&!W)return"";const I=!W||R&&R<=W?R:W,ne=!R||W&&W>=R?W:R;return Be(I,ne)?rt(I):`${rt(I)} - ${rt(ne)}`}),Qt=e.computed(()=>{if(M.mode!=="readonly")return"—";const R=M.modelValue;if(R instanceof Date)return rt(R)||"—";if(R&&typeof R=="object"&&("start"in R||"end"in R)){const W=R.start instanceof Date?R.start:null,I=R.end instanceof Date?R.end:null;if(!W&&!I)return"—";const ne=!I||W&&W<=I?W:I,Ae=!W||I&&I>=W?I:W;return Be(ne,Ae)?rt(ne):`${rt(ne)} - ${rt(Ae)}`}return"—"});e.computed(()=>{const R=new Date(be.value,f.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format(R)});const It=e.computed(()=>Ie.value==="left"?Ce.value:Ie.value==="right"?X.value:f.value),ae=e.computed(()=>Ie.value==="left"?Q.value:Ie.value==="right"?de.value:be.value),me=e.computed(()=>{const R=new Date(be.value,f.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format(R)}),Pe=e.computed(()=>{const R=new Date(ae.value,It.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format(R)}),Re=e.computed(()=>{const R=new Intl.DateTimeFormat(P.value,{month:"short"});return Array.from({length:12},(W,I)=>R.format(new Date(2024,I,1)))}),Wt=e.computed(()=>{const W=(Ie.value?ae.value:be.value)-Math.floor(ra/2);return Array.from({length:ra},(I,ne)=>W+ne)}),kt=e.computed(()=>{const R=Wt.value;return R.length?`${R[0]} – ${R[R.length-1]}`:""}),qt=e.computed(()=>{const R=new Intl.DateTimeFormat(P.value,{weekday:"short"}),W=new Date(2024,0,1),I=[];for(let ne=0;ne<7;ne++){const Ae=new Date(W);Ae.setDate(W.getDate()+ne),I.push(R.format(Ae).slice(0,2))}return I});function Bt(R,W){const I=new Date(R,W,1),ne=new Date(R,W+1,0),Ae=I.getDay(),dt=ne.getDate(),mt=[];for(let at=0;at<Ae;at++)mt.push(null);for(let at=1;at<=dt;at++)mt.push(new Date(R,W,at));return mt}const Pt=e.computed(()=>Bt(be.value,f.value)),G=e.computed(()=>Bt(Q.value,Ce.value)),he=e.computed(()=>Bt(de.value,X.value));e.computed(()=>{const R=new Date(Q.value,Ce.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format(R)}),e.computed(()=>{const R=new Date(de.value,X.value,1);return new Intl.DateTimeFormat(P.value,{month:"long",year:"numeric"}).format(R)});const _e=e.computed(()=>{const R=new Date(Q.value,Ce.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format(R)}),je=e.computed(()=>{const R=new Date(de.value,X.value,1);return new Intl.DateTimeFormat(P.value,{month:"long"}).format(R)}),Qe=e.computed(()=>M.availableDates&&M.availableDates.length>0),Lt=e.computed(()=>Qe.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"}]),tt=e.ref({top:0,left:0});function Tt(){if(!qe.value||!A.value)return;const R=qe.value.getBoundingClientRect(),W=window.innerWidth||document.documentElement.clientWidth,I=window.innerHeight||document.documentElement.clientHeight;let ne=R.left,Ae=R.bottom+4;const dt=Se.value;if(dt){const mt=dt.offsetWidth,at=dt.offsetHeight;if(ne+mt>W-8&&(ne=R.right-mt,ne<8&&(ne=8)),Ae+at>I-8){const pt=R.top-4-at;pt>=8?Ae=pt:Ae=Math.max(8,I-at-8)}}tt.value={top:Ae,left:ne}}const Xe=e.computed(()=>!qe.value||!A.value?{}:{position:"fixed",left:`${tt.value.left}px`,top:`${tt.value.top}px`,zIndex:1002});function Be(R,W){return!R||!W?!1:R.getFullYear()===W.getFullYear()&&R.getMonth()===W.getMonth()&&R.getDate()===W.getDate()}function Je(R){return new Date(R.getFullYear(),R.getMonth(),R.getDate()).getTime()}function St(R){return!M.availableDates||!M.availableDates.length?!0:M.availableDates.some(W=>W instanceof Date&&Be(W,R))}function le(R){const W=Je(R);return!(M.minDate instanceof Date&&W<Je(M.minDate)||M.maxDate instanceof Date&&W>Je(M.maxDate))}function U(R){const W=new Date(R);return new Date(W.getFullYear(),W.getMonth(),W.getDate())}function Y(R){return R.filter(W=>le(W))}function ge(R,W){if(!(R instanceof Date)||!(W instanceof Date))return null;let I=Je(R),ne=Je(W);if(I>ne&&([I,ne]=[ne,I]),M.minDate instanceof Date){const Ae=Je(M.minDate);I=Math.max(I,Ae),ne=Math.max(ne,Ae)}if(M.maxDate instanceof Date){const Ae=Je(M.maxDate);I=Math.min(I,Ae),ne=Math.min(ne,Ae)}return I>ne?null:{start:U(I),end:U(ne)}}function ke(R){return!M.exceptDates||!M.exceptDates.length?!1:M.exceptDates.some(W=>W instanceof Date&&Be(W,R))}function Le(R){return ke(R)?!1:["singleFromAvailable","rangeFromAvailable"].includes(M.mode)?St(R):le(R)}function xt(R){const W=we.value,I=ct.value,ne=Je(R),Ae=We.value&&I.start&&I.end&&ne>Je(I.start)&&ne<Je(I.end),dt=We.value&&I.start&&Be(R,I.start),mt=We.value&&I.end&&Be(R,I.end),at=dt&&mt,pt=K.value&&W&&Be(R,W)||dt||mt;let dn=!1;if(We.value&&I.start&&!I.end&&Ee.value){const Vn=Je(I.start),Dn=Je(Ee.value),zn=Math.min(Vn,Dn),pl=Math.max(Vn,Dn);dn=ne>zn&&ne<pl}return{"dss-datepicker__day--selected":pt&&!at,"dss-datepicker__day--range-start":dt&&!at,"dss-datepicker__day--range-end":mt&&!at,"dss-datepicker__day--range-single":at,"dss-datepicker__day--in-range":Ae&&!dt&&!mt,"dss-datepicker__day--in-range-preview":dn&&!dt&&!mt&&!Ae,"dss-datepicker__day--disabled":!Le(R)}}function Jt(R){if(!We.value)return;const W=ct.value;if(!W.start||W.end){Ee.value=null;return}if(!Le(R)){Ee.value=null;return}Ee.value=new Date(R.getFullYear(),R.getMonth(),R.getDate())}function Vt(){Ee.value=null}function Ut(){if(!M.doubleCalendar||!We.value)return;const R=ct.value,{start:W,end:I}=R;if(W&&I){const dt=W<=I?W:I,mt=W<=I?I:W,at=dt.getMonth(),pt=dt.getFullYear(),dn=mt.getMonth(),Vn=mt.getFullYear();if(at!==dn||pt!==Vn){const Dn=Ce.value===at&&Q.value===pt,zn=X.value===dn&&de.value===Vn;if(Dn&&zn)return;Ce.value=at,Q.value=pt,X.value=dn,de.value=Vn}else{const Dn=at===0?11:at-1,zn=at===0?pt-1:pt;Ce.value===Dn&&Q.value===zn&&X.value===at&&de.value===pt||(Ce.value=at,Q.value=pt,at===11?(X.value=0,de.value=pt+1):(X.value=at+1,de.value=pt))}return}const ne=W||I;if(ne){const dt=ne.getMonth(),mt=ne.getFullYear(),at=Ce.value===dt&&Q.value===mt,pt=X.value===dt&&de.value===mt;if(at||pt)return;Ce.value=dt,Q.value=mt,dt===11?(X.value=0,de.value=mt+1):(X.value=dt+1,de.value=mt);return}const Ae=ot();Ce.value=Ae.left.month,Q.value=Ae.left.year,X.value=Ae.right.month,de.value=Ae.right.year}function V(R="start"){if(M.mode==="readonly")return;H.value=R;const W=we.value,I=ct.value;if(K.value&&W)f.value=W.getMonth(),be.value=W.getFullYear();else if(We.value)if(M.doubleCalendar)Ut();else{const ne=R==="start"&&I.start?I.start:I.end||I.start;ne&&(f.value=ne.getMonth(),be.value=ne.getFullYear())}qe.value=K.value?vt.value?.closest(".dss-datepicker__input-wrap"):q.value,pe.value="days",Ie.value=null,A.value=!0,e.nextTick(()=>{Tt()})}function w(){pe.value="days",Ie.value=null,Ee.value=null,A.value=!1}function S(R,W){Ie.value=R,pe.value=W}function Z(){pe.value="days",Ie.value=null}function J(R){const W=new Date,I=W.getFullYear(),ne=W.getMonth(),Ae=W.getDate();let dt,mt;if(Qe.value){const at=Y([...M.availableDates].filter(pt=>pt instanceof Date).map(pt=>new Date(pt.getFullYear(),pt.getMonth(),pt.getDate()))).sort((pt,dn)=>pt.getTime()-dn.getTime());if(at.length===0)return null;if(R==="all")dt=at[0],mt=at[at.length-1];else{const pt=parseInt(R.replace("last",""),10);if(pt<2||pt>5)return null;const dn=at.slice(-pt);if(dn.length===0)return null;dt=dn[0],mt=dn[dn.length-1]}}else{const at=new Date(I,ne,Ae);switch(R){case"today":dt=at,mt=at;break;case"lastWeek":dt=new Date(I,ne,Ae-6),mt=at;break;case"last15Days":dt=new Date(I,ne,Ae-14),mt=at;break;case"last30Days":dt=new Date(I,ne,Ae-29),mt=at;break;case"thisMonth":dt=new Date(I,ne,1),mt=at;break;case"last3Months":dt=new Date(I,ne-3,1),mt=new Date(I,ne,0);break;case"last6Months":dt=new Date(I,ne-6,1),mt=new Date(I,ne,0);break;case"last12Months":dt=new Date(I,ne-12,1),mt=new Date(I,ne,0);break;case"lastYear":dt=new Date(I-1,0,1),mt=new Date(I-1,11,31);break;default:return null}}return{start:dt,end:mt}}function Ze(R){const W=J(R);return W?ge(W.start,W.end):null}function gt(R){return Ze(R)!==null}function nt(R){const W=Ze(R);W&&(L("update:modelValue",W),Ut())}function xe(R){Ie.value==="left"?Ce.value=R:Ie.value==="right"?X.value=R:f.value=R,Z()}function Nt(R){Ie.value==="left"?Q.value=R:Ie.value==="right"?de.value=R:be.value=R,Z()}function zt(){f.value===0?(f.value=11,be.value--):f.value--}function $t(){f.value===11?(f.value=0,be.value++):f.value++}function it(){Ce.value===0?(Ce.value=11,Q.value--):Ce.value--}function Ct(){Ce.value===11?(Ce.value=0,Q.value++):Ce.value++}function Jn(){X.value===0?(X.value=11,de.value--):X.value--}function Xn(){X.value===11?(X.value=0,de.value++):X.value++}function Sn(R){if(!Le(R))return;const W=new Date(R.getFullYear(),R.getMonth(),R.getDate());if(K.value){L("update:modelValue",W),w();return}const I=ct.value;if(!I.start&&!I.end){L("update:modelValue",{start:W,end:null}),H.value="end";return}if(I.start&&I.end){L("update:modelValue",{start:W,end:null}),H.value="end";return}if(H.value==="start"){let ne=W,Ae=I.end;ne&&Ae&&ne>Ae&&([ne,Ae]=[Ae,ne]),L("update:modelValue",{start:ne||Ae,end:Ae||ne}),H.value="end"}else{let ne=I.start,Ae=W;ne&&Ae&&Ae<ne&&([ne,Ae]=[Ae,ne]),L("update:modelValue",{start:ne||Ae,end:Ae||ne}),H.value="start"}}e.watch(ct,()=>{M.doubleCalendar&&We.value&&A.value&&Ut()},{deep:!0});let un=null,Xt=null,Fn=null;function sl(){un&&(document.removeEventListener("keydown",un),un=null),Xt&&(window.removeEventListener("resize",Xt),Xt=null),Fn&&(window.removeEventListener("scroll",Fn,!0),Fn=null)}return e.watch(pe,R=>{R==="years"&&e.nextTick(()=>{$e.value?.querySelector(`[data-year="${ae.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(A,R=>{sl(),R&&(un=W=>{W.key==="Escape"&&(pe.value==="years"||pe.value==="months"?Z():w())},Xt=()=>{Tt()},Fn=()=>{Tt()},document.addEventListener("keydown",un),window.addEventListener("resize",Xt),window.addEventListener("scroll",Fn,!0))}),e.onBeforeUnmount(()=>{sl()}),(R,W)=>(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,[W[10]||(W[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:Qt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Va)])):K.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:W[0]||(W[0]=I=>V("start"))},[W[11]||(W[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:vt,type:"text",class:"dss-datepicker__input",placeholder:M.placeholder||e.unref(fe)("datepicker.selectDate"),value:Et.value,readonly:"",disabled:T.mode==="readonly"},null,8,Na)])):We.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:q,onClick:W[1]||(W[1]=I=>V("start"))},[W[12]||(W[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:Ye,type:"text",class:"dss-datepicker__input",placeholder:M.placeholder||e.unref(fe)("datepicker.selectRange"),value:Rt.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(w,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Se,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":T.doubleCalendar&&We.value&&pe.value==="days","dss-datepicker__dropdown--quick-select":T.doubleCalendar&&We.value&&pe.value==="days"&&T.quickSelect}]),onClick:W[9]||(W[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Xe.value)},[pe.value==="days"&&T.doubleCalendar&&We.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(Lt.value,I=>(e.openBlock(),e.createElementBlock("button",{key:I.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!gt(I.id),onClick:ne=>nt(I.id)},e.toDisplayString(e.unref(fe)(I.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(fe)("datepicker.prevMonth"),onClick:it}," ‹ ",8,Da),e.createElementVNode("div",Ha,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[2]||(W[2]=I=>S("left","months"))},e.toDisplayString(_e.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[3]||(W[3]=I=>S("left","years"))},e.toDisplayString(Q.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(fe)("datepicker.nextMonth"),onClick:Ct}," › ",8,Ra)]),e.createElementVNode("div",Fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qt.value,I=>(e.openBlock(),e.createElementBlock("span",{key:I,class:"dss-datepicker__weekday"},e.toDisplayString(I),1))),128))]),e.createElementVNode("div",Ia,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(I,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+ne},[I?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",xt(I)]),disabled:!Le(I),onClick:Ae=>Sn(I),onMouseenter:Ae=>Jt(I),onMouseleave:Vt},e.toDisplayString(I.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(fe)("datepicker.prevMonth"),onClick:Jn}," ‹ ",8,qa),e.createElementVNode("div",Za,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[4]||(W[4]=I=>S("right","months"))},e.toDisplayString(je.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[5]||(W[5]=I=>S("right","years"))},e.toDisplayString(de.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(fe)("datepicker.nextMonth"),onClick:Xn}," › ",8,Ua)]),e.createElementVNode("div",Xa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qt.value,I=>(e.openBlock(),e.createElementBlock("span",{key:I,class:"dss-datepicker__weekday"},e.toDisplayString(I),1))),128))]),e.createElementVNode("div",Ya,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,(I,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+ne},[I?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",xt(I)]),disabled:!Le(I),onClick:Ae=>Sn(I),onMouseenter:Ae=>Jt(I),onMouseleave:Vt},e.toDisplayString(I.getDate()),43,ja)):(e.openBlock(),e.createElementBlock("span",Ka))],64))),128))])])])])):pe.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(fe)("datepicker.prevMonth"),onClick:zt}," ‹ ",8,Qa),e.createElementVNode("div",Ja,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[6]||(W[6]=I=>pe.value="months")},e.toDisplayString(me.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[7]||(W[7]=I=>pe.value="years")},e.toDisplayString(be.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(fe)("datepicker.nextMonth"),onClick:$t}," › ",8,es)]),e.createElementVNode("div",ts,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qt.value,I=>(e.openBlock(),e.createElementBlock("span",{key:I,class:"dss-datepicker__weekday"},e.toDisplayString(I),1))),128))]),e.createElementVNode("div",ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pt.value,(I,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ne},[I?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",xt(I)]),disabled:!Le(I),onClick:Ae=>Sn(I),onMouseenter:Ae=>Jt(I),onMouseleave:Vt},e.toDisplayString(I.getDate()),43,ls)):(e.openBlock(),e.createElementBlock("span",os))],64))),128))])],64)):pe.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",as,[e.createElementVNode("div",ss,[e.createElementVNode("span",rs,e.toDisplayString(Pe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[8]||(W[8]=I=>pe.value="years")},e.toDisplayString(ae.value),1)])]),e.createElementVNode("div",is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,(I,ne)=>(e.openBlock(),e.createElementBlock("button",{key:ne,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":ne===It.value}]),onClick:Ae=>xe(ne)},e.toDisplayString(I),11,cs))),128))])],64)):pe.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:$e},[e.createElementVNode("div",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wt.value,I=>(e.openBlock(),e.createElementBlock("button",{key:I,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":I===ae.value,"dss-datepicker__year-cell--current":I===e.unref(Ge)}]),"data-year":I,onClick:ne=>Nt(I)},e.toDisplayString(I),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:oe}){const{t:M,locale:L}=Gl.useI18n(),fe=oe,P=e.ref(null),A=e.ref(null),pe=e.ref(null),ft=e.ref(0),ee=e.ref(0);let f=null,be=null;const Ce=20,Q=e.computed(()=>{if(ee.value,ft.value,!P.value||!A.value)return 0;try{const t=P.value.getBoundingClientRect();return A.value.getBoundingClientRect().top-t.top}catch{return 0}}),X=e.computed(()=>`chart-clip-${H.chartId}`),de=e.computed(()=>`url(#${X.value})`),H=T,Ee={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},miniRadial:{minVisiblePercent:1,trackColor:"#E5E7EB",thresholds:{low:33,medium:66},colors:{low:"#E53E3E",medium:"#ED8936",high:"#38A169"}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5},zoom:{enabled:!1,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function Ie(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]=Ie(t[i],a[i]):Object.assign(n,{[i]:a[i]}):Object.assign(n,{[i]:a[i]})}),n}const ot=()=>{let t=20,a=0,n=0;if(rt.value&&(t+=30),Et.value&&(t+=25),G.value&&H.series.length>0){const i=H.series.filter((p,g)=>!lt.value.has(g)).length;if(he.value==="top"||he.value==="bottom"){if(_e.value==="horizontal"){const g=Math.floor(Se.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(()=>Ie(Ee,H.options)),Ye=e.computed(()=>{const t=q.value;return t&&t.chart&&t.chart.width==="auto"}),qe=e.computed(()=>{const t=q.value;return t&&t.chart&&t.chart.height==="auto"}),Se=e.computed(()=>{const t=q.value;return Ye.value?ft.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),$e=e.ref(Ce),Ge=e.computed(()=>{if(qe.value){const t=Ge.value;return t??Math.max(0,(ee.value||400)-$e.value*5)}}),K=e.computed(()=>{const t=q.value;if(we.value==="mini-radial")return Se.value;if(qe.value){const a=Ge.value;return a??Math.max(0,(ee.value||400)-$e.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),We=e.computed(()=>{if(qe.value&&we.value==="semi-radial"&&Ge.value!=null)return $e.value+K.value+"px";if(qe.value)return"100%";if(hn.value)return $e.value+K.value+"px";if(G.value&&he.value==="bottom"){const t=ot();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"}),ct=e.computed(()=>{const t=H.series.map(a=>a.type||we.value);return new Set(t).size>1}),rt=e.computed(()=>{const t=q.value;return t&&t.title&&t.title.text?t.title.text:""}),Et=e.computed(()=>{const t=q.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),Rt=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:""}),Qt=e.computed(()=>{const t=q.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),It=e.computed(()=>{const t=q.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),ae=e.computed(()=>{const t=q.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),me=e.computed(()=>{const t=ae.value;return t&&t.title&&t.title.text?t.title.text:""}),Pe=e.computed(()=>{const t=q.value;if(!t||!t.yAxis)return En;const a=t.yAxis.min;return typeof a=="number"||a===En?a:En}),Re=e.computed(()=>{const t=q.value;if(!t||!t.yAxis)return En;const a=t.yAxis.max;return typeof a=="number"||a===En?a:En}),Wt=e.computed(()=>{const t=ae.value;if(!t)return En;const a=t.min;return typeof a=="number"||a===En?a:En}),kt=e.computed(()=>{const t=ae.value;if(!t)return En;const a=t.max;return typeof a=="number"||a===En?a:En}),qt=e.computed(()=>{const t=q.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Bt=e.computed(()=>{const t=q.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),Pt=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"}),_e=e.computed(()=>{const t=q.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),je=e.computed(()=>{const t=q.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Qe=e.computed(()=>{const t=q.value;if(!t||!t.crosshair)return!1;const a=t.crosshair.show;return a===!0||a==="true"}),Lt=e.computed(()=>{const t=q.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),tt=e.computed(()=>{const t=q.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Tt=e.computed(()=>{const t=q.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Xe=e.computed(()=>{const t=q.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Be=e.computed(()=>{const t=q.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Je=e.computed(()=>{if(!hn.value)return 0;const t=q.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),St=e.computed(()=>{const t=q.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),le=e.computed(()=>{const{maxX:t}=Zt.value;return t===0}),U=(t,a)=>le.value&&a===0?5:a,Y=t=>{const a=Number(t);return!Number.isFinite(a)||a<=0?0:a},ge=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}),Le=e.computed(()=>{const t=q.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),xt=e.computed(()=>{const t=q.value;return ke.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),Jt=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"]}),Vt=e.computed(()=>{const t=q.value;return t&&t.animations&&t.animations.enabled!==!1}),Ut=e.computed(()=>{const t=q.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),V=e.computed(()=>{const t=q.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),w=e.computed(()=>{const t=q.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),S=e.computed(()=>{const t=q.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Z=e.computed(()=>{const t=q.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),J=e.computed(()=>{const t=q.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Ze=e.computed(()=>{const t=q.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),gt=e.computed(()=>{const t=q.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),nt=e.computed(()=>q.value?.spider?.gridSteps||5),xe=e.computed(()=>{const t=[],a=nt.value;for(let n=1;n<=a;n++)t.push(ut.value/a*n);return t}),Nt=t=>{const a=zt.value;if(a&&Array.isArray(a)&&a[t]!==void 0)return a[t].toString();const n=xe.value[t];return Math.round(n/ut.value*100)+"%"},zt=e.computed(()=>q.value?.spider?.gridLabels||null),$t=e.computed(()=>{const t=q.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),it=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}),Ct=e.computed(()=>{const t=q.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Jn=e.computed(()=>{const t=q.value;return t&&t.markers&&t.markers.icon?t.markers.icon:dn.value}),Xn=e.computed(()=>{const t=q.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Sn=e.computed(()=>{const t=q.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),un=e.computed(()=>{const a=q.value?.valueFormat?.extension;return typeof a=="string"?a:""}),Xt=t=>{const a=un.value;if(t==null)return"";const n=String(t);return a?n+a:n},Fn=e.computed(()=>!re.value.isZooming);e.computed(()=>At.value.map(t=>{if(t.categoryIndex!==void 0&&(xn.value||jt.value)){const a=Kt(t.categoryIndex),n=Q.value+F.value.bottom-Sn.value/2;return{...t,x:a,y:n}}return t}));function sl(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,b]=t.split("-"),z=Number(b?.length===2?`20${b}`:b);n=new Date(z,Number(C)-1,Number(g))}else return 0;let i=0,p=1/0;return a.forEach((g,C)=>{const[b,z,N]=g.split("-"),$=Number(N?.length===2?`20${N}`:N),B=new Date($,Number(z)-1,Number(b)),te=Math.abs(B-n);te<p&&(p=te,i=C)}),i}const R=e.computed(()=>{const t=H.markers.map(n=>{const i=sl(n.marker_date,H.categories),p=Kt(i),g=Q.value+F.value.bottom-Sn.value/2;return{...n,x:p,y:g,categoryIndex:i,source:"props"}}),a=At.value.map(n=>{if(n.categoryIndex!==void 0&&(xn.value||jt.value)){const i=Kt(n.categoryIndex),p=Q.value+F.value.bottom-Sn.value/2;return{...n,x:i,y:p,source:"internal"}}return{...n,source:"internal"}});return[...t,...a]}),W=e.computed(()=>{const t=q.value;return t&&t.watermark&&t.watermark.enabled===!0}),I=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}),Ae=e.computed(()=>{const t=q.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),dt=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(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}}),mt=e.computed(()=>{const{width:t,height:a}=dt.value,n=Ae.value;let i,p;const g=F.value.left,C=F.value.right,b=F.value.top,z=F.value.bottom,N=F.value.width,$=F.value.height;switch(n){case"center":i=g+(N-t)/2,p=b+($-a)/2;break;case"top-left":i=g+15,p=b+5;break;case"top-right":i=C-t-15,p=b+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`}}),at=t=>!H.flags||!H.flags.length?[]:H.flags.filter(a=>a.categoryIndex===t),pt=t=>{const a=at(t),n=Al(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"}))}},dn=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)}`}),
|
|
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)}`}),
|
|
45
|
-
`)}})}),xl=e.ref({show:!1,x:0,y:0,content:"",count:0}),$n=e.computed(()=>q.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),Ln=e.computed(()=>{const t=q.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),vl=e.computed(()=>q.value?.bubbles?.tooltip?.formatters||{}),lt=e.ref(new Set),ie=e.ref(null),il=e.ref(!1),ht=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),gn=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Fe=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),bt=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),re=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),At=e.ref([]),De=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 Xn.value&&t.push(...Object.keys(Xn.value)),t}),e.computed(()=>{if(!H.categories||H.categories.length===0){const{maxX:t}=Zt.value;return Array.from({length:t+1},(a,n)=>M("chart.fallback.item",{number:n+1}))}return H.categories});const El=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)}),$l=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)}),bn=e.computed(()=>De.value.editingMarkerId!==null),en=e.computed(()=>De.value.readonly),el=t=>{lt.value.has(t)||(Ko.value=!0,ie.value=t)},on=()=>{Ko.value=!1,ie.value=null},Yn=t=>{if(fo.value||To.value){Fe.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(il.value=g,jt.value){if(!Qe.value||!g||re.value.isDragging||re.value.isZooming){Fe.value.show=!1;return}if(j.value.find(ce=>!ce||ce.isHidden?!1:Math.sqrt(Math.pow(ce.x-i,2)+Math.pow(ce.y-p,2))<=ce.radius+3))Fe.value.show=!1;else{const ce=j.value.filter(ye=>!ye||ye.isHidden?!1:Math.sqrt(Math.pow(ye.x-i,2)+Math.pow(ye.y-p,2))<=250);if(ce.length>0){let ye=ce[0],Me=Math.sqrt(Math.pow(ye.x-i,2)+Math.pow(ye.y-p,2));ce.forEach(Ue=>{const He=Math.sqrt(Math.pow(Ue.x-i,2)+Math.pow(Ue.y-p,2));He<Me&&(Me=He,ye=Ue)});const ve=30,et=j.value.filter(Ue=>!Ue||Ue.isHidden?!1:Math.abs(Ue.x-ye.x)<=ve).sort((Ue,He)=>Ue.y-He.y);Fe.value={show:!0,x:ye.x,categoryIndex:Math.round(ye.originalX),data:(()=>{const Ue=$n.value,He=Ln.value,Te=[];return et.forEach(ze=>{Ue.forEach(_t=>{const Ft=He[_t]||_t,Zn=ol(_t,ze);Zn&&Te.push({seriesName:ze.seriesName,label:ze.label,value:`${Ft}: ${Zn}`,color:ze.color,y:ze.y})})}),Te})()}}else Fe.value.show=!1}return}if(re.value.isDragging&&re.value.scale>1&&xn.value&&tt.value){Fe.value.show=!1;const Ke=t.clientX-re.value.lastMouseX,{minX:ce,maxX:ye}=Zt.value,Me=ye-ce||1,et=Ke*.8;re.value.offsetX+=et;const Ue=Me/re.value.scale,He=Me-Ue,Te=0,ze=-He/Me*F.value.width,_t=Te;re.value.offsetX=Math.max(ze,Math.min(_t,re.value.offsetX)),re.value.lastMouseX=t.clientX,re.value.lastMouseY=t.clientY;return}if(!Qe.value||!xn.value||re.value.isDragging||re.value.isZooming||!g){Fe.value.show=!1;return}const{minX:C,maxX:b}=Zt.value,z=b-C||1,N=z/re.value.scale,$=C-re.value.offsetX/F.value.width*z,B=(i-F.value.left)/F.value.width,te=$+B*N,Ve=Math.round(te);if(Ve>=0&&Ve<=b){const Ke=Kt(Ve),ce=Gn.value.map((ye,Me)=>{const ve=H.series.findIndex(Ue=>Ue===ye),et=ye.data[Ve];return{seriesName:ye.name,value:et!==void 0?et:null,color:c(ve),y:et!==void 0?Cn(ye,et):null}}).filter(ye=>ye.value!==null);Fe.value={show:!0,x:Ke,categoryIndex:Ve,data:ce}}},cl=()=>{Fe.value.show=!1,il.value=!1,To.value=!1,fo.value||(xl.value.show=!1),re.value.isDragging&&(re.value.isDragging=!1),re.value.zoomTimeout&&(clearTimeout(re.value.zoomTimeout),re.value.zoomTimeout=null),re.value.isZooming=!1,setTimeout(()=>{ie.value=null,ht.value.show=!1},150)},Ll=t=>{if(t.preventDefault(),t.stopPropagation(),!$t.value)return;const a=t.currentTarget.getBoundingClientRect(),n=t.clientX-a.left,i=t.clientY-a.top;if(hn.value){bt.value.show=!1,e.nextTick(()=>{bt.value.show=!0,bt.value.x=t.clientX,bt.value.y=t.clientY,bt.value.categoryIndex=null});return}const p=Math.max(0,F.value.left-20),g=F.value.right,C=F.value.top,b=F.value.bottom+80;n>=p&&n<=g&&i>=C&&i<=b&&(bt.value.show=!1,e.nextTick(()=>{bt.value.show=!0,bt.value.x=t.clientX,bt.value.y=t.clientY,bt.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&&(bt.value.categoryIndex=B)}))},Tn=t=>{if(!(t&&t.button===2)){if(bt.value.show&&t&&t.type==="click"){const a=document.querySelector(".dss-context-menu");if(a&&a.contains(t.target))return}bt.value.show=!1}},wn=t=>{if(typeof t.template=="function"){const a={series:H.series,categories:H.categories,markers:At.value},n={chartX:bt.value.chartX,chartY:bt.value.chartY,dataX:bt.value.mouseDataX,dataY:bt.value.mouseDataY,categoryIndex:bt.value.categoryIndex};return t.template(a,n)}return t.template||t.label||""},Wl=t=>{const a=["dss-context-menu-item"];return t.cssClass&&a.push(t.cssClass),a},tl=t=>t.style||{},In=t=>t.type&&Xn.value[t.type]?Xn.value[t.type]:t.customIcon?t.customIcon:Jn.value,Tl=t=>t==null?"":H.categories&&H.categories[t]?H.categories[t]:"",Al=t=>At.value.length?At.value.filter(a=>a.categoryIndex===t):[],k=t=>{if(!xn.value&&!jt.value)return{x:0,y:0};const a=Kt(t),n=Q.value+F.value.bottom-Sn.value/2;return{x:a,y:n}},h=()=>{At.value.forEach(t=>{if(t.categoryIndex!==void 0&&(xn.value||jt.value)){const a=k(t.categoryIndex);t.x=a.x,t.y=a.y}})},x=()=>{if(De.value.description&&De.value.description.length&&De.value.date){if(bn.value){const t=At.value.findIndex(a=>a.id===De.value.editingMarkerId);t!==-1?(At.value[t].description=De.value.description||"",At.value[t].color=De.value.color||"",At.value[t].type=De.value.type||"default",fe("update-marker",At.value[t])):fe("update-marker",{id:De.value.editingMarkerId,description:De.value.description||"",color:De.value.color||"",type:De.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let a=sl(De.value.date,H.categories||[]);if(jt.value){const{maxX:C}=Zt.value;a=Math.max(0,Math.min(a,Math.floor(C)))}else xn.value&&(a=Math.max(0,Math.min(a,Zt.value.maxX)));const n=Kt(a),i=Q.value+F.value.bottom-Sn.value/2,p=Array.isArray(H.categories)?H.categories[a]:null,g={id:t,title:"",description:De.value.description||"",color:De.value.color||"",type:De.value.type||"default",categoryIndex:a,x:n,y:i,marker_date:p||null};De.value.categoryIndex=a,At.value.push(g),fe("add-marker",g)}O(),Yt()}},O=()=>{De.value.show=!1,De.value.title="",De.value.description="",De.value.color="#FF6B6B",De.value.type="default",De.value.editingMarkerId=null,De.value.readonly=!1,De.value.categoryIndex=null,De.value.fromButton=!1,De.value.date=null},ue=()=>{bn.value&&(yt(De.value.editingMarkerId),O())},yt=t=>{const a=At.value.findIndex(n=>n.id===t);a!==-1&&(At.value.splice(a,1),Yt()),fe("delete-marker",t)},Mt=t=>{if(De.value.show=!0,De.value.title=t?.title??t?.comment??"",De.value.description=t?.description??t?.comment??"",De.value.color=t?.color??"",De.value.type=t?.type??"default",De.value.editingMarkerId=t?.id??t?.marker_id??null,De.value.readonly=t?.readonly??!1,De.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?De.value.date=new Date(p,C,g):De.value.date=null}else De.value.date=null},Yt=()=>{try{const t=`dss-chart-markers-${H.chartId}`;localStorage.setItem(t,JSON.stringify(At.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},an=()=>{try{const t=`dss-chart-markers-${H.chartId}`,a=localStorage.getItem(t);if(a){const n=JSON.parse(a);Array.isArray(n)&&(At.value=n.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),At.value=[]}},nn=t=>{const a=rt.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}`},sn=()=>{const t=Fe.value.show,a=ht.value.show;return Fe.value.show=!1,ht.value.show=!1,{originalCrosshair:t,originalTooltip:a}},Pn=t=>{Fe.value.show=t.originalCrosshair,ht.value.show=t.originalTooltip},Dl=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 b=document.createElement("canvas"),z=b.getContext("2d");b.width=a,b.height=n,z.fillStyle="#fafafa",z.fillRect(0,0,a,n),z.drawImage(g,0,0,a,n);const N=b.toDataURL("image/png");i(N)}catch(b){console.warn("Canvas conversion failed:",b),i(t)}},g.onerror=b=>{clearTimeout(C),console.warn("Failed to load image:",t,b),i(t)},g.src=t}),Po=async()=>{try{const t=sn();setTimeout(async()=>{try{const a=A.value;if(!a){console.error("Chart SVG element not found"),Pn(t);return}const n=ot(),i=Se.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(ve=>ve.remove());const b=g.querySelectorAll("image"),z=Array.from(b).map(async ve=>{const et=ve.getAttribute("xlink:href")||ve.getAttribute("href");if(et&&!et.startsWith("data:"))try{const Ue=await Dl(et,32,32);ve.setAttribute("xlink:href",Ue),ve.setAttribute("href",Ue)}catch(Ue){console.warn("Failed to convert logo to base64:",Ue)}});await Promise.all(z);const $=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let B="",te=30;if(rt.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
|
-
${
|
|
52
|
-
</text>`,te+=30),
|
|
51
|
+
${ot.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
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
|
-
${
|
|
58
|
-
</text>`,te+=25),
|
|
59
|
-
<g opacity="${
|
|
60
|
-
<g transform="translate(${
|
|
57
|
+
${bt.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
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,"&").replace(/</g,"<").replace(/>/g,">");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(
|
|
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">
|
|
@@ -87,32 +87,32 @@
|
|
|
87
87
|
${B}
|
|
88
88
|
<g transform="translate(0, ${n.height})">
|
|
89
89
|
${$}
|
|
90
|
-
${
|
|
90
|
+
${Se}
|
|
91
91
|
</g>
|
|
92
|
-
</svg>`,
|
|
93
|
-
`),
|
|
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",
|
|
97
|
-
`;const a=Math.max(...
|
|
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=nn("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(i),Tn()}catch(t){console.error("Error downloading CSV:",t)}},Oo=t=>{if(typeof t.action=="function"){const a={series:H.series,categories:H.categories,markers:At.value},n={chartX:bt.value.chartX,chartY:bt.value.chartY,dataX:bt.value.mouseDataX,dataY:bt.value.mouseDataY,categoryIndex:clampedCategoryIndex||bt.value.categoryIndex};t.action(a,n)}Tn()},Wo=()=>{O(),De.value.show=!0,De.value.categoryIndex=bt.value.categoryIndex,De.value.fromButton=!1,Tn()},ko=()=>{O(),De.value.show=!0,De.value.categoryIndex=0,De.value.fromButton=!0},Co=t=>{if(bt.value.show){const a=document.querySelector(".dss-context-menu");a&&!a.contains(t.target)&&(bt.value.show=!1)}},no=t=>{bt.value.show&&!t.target.closest(".context-menu")&&(bt.value.show=!1)},bo=t=>{if(!xn.value||!tt.value)return;t.preventDefault(),t.stopPropagation(),re.value.isZooming=!0,Fe.value.show=!1,re.value.zoomTimeout&&clearTimeout(re.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){re.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,C=Math.max(re.value.minScale,Math.min(re.value.maxScale,re.value.scale*g));if(C!==re.value.scale){const{minX:b,maxX:z}=Zt.value,N=z-b||1,$=N/re.value.scale,B=b-re.value.offsetX/F.value.width*N,te=(i-F.value.left)/F.value.width,Ve=B+te*$;re.value.scale=C;const Ke=N/re.value.scale,ce=Ve-te*Ke;re.value.offsetX=-(ce-b)/N*F.value.width,re.value.scale<=1.01&&(re.value.scale=1,re.value.offsetX=0)}re.value.zoomTimeout=setTimeout(()=>{re.value.isZooming=!1,re.value.zoomTimeout=null},300)},lo=t=>{if(!xn.value||!tt.value||re.value.scale<=1)return;Fe.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,re.value.isDragging=!0,re.value.lastMouseX=t.clientX,re.value.lastMouseY=t.clientY,t.preventDefault()},wo=()=>{re.value.isDragging=!1},oo=()=>{!xn.value||!tt.value||(re.value.scale=1,re.value.offsetX=0,re.value.isDragging=!1,re.value.zoomTimeout&&(clearTimeout(re.value.zoomTimeout),re.value.zoomTimeout=null),re.value.isZooming=!1)},qo=()=>!xn.value||!il.value||!tt.value?"default":re.value.isDragging?"grabbing":re.value.scale>1?"grab":"dss-crosshair",ql=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)],b=p.x+(g.x-i.x)/6*Le.value,z=p.y+(g.y-i.y)/6*Le.value,N=g.x-(C.x-p.x)/6*Le.value,$=g.y-(C.y-p.y)/6*Le.value;a+=` C ${b} ${z} ${N} ${$} ${g.x} ${g.y}`}return a},Bn=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+(Qt.value?30:0)+60;if(Mn.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(hn.value){const B=!G.value,te=Dn.value,Ve=te?pl.value+_l.value+Math.max(24,zn.value+16):0,Ke=B?12:p;let ce=0;rt.value&&(ce+=B?8:15),Et.value&&(ce+=B?6:10);const ye=ot();let Me=Ke+(B?4:16)+(te?Ve:0),ve=Ke+(te?Ve:0);G.value&&he.value==="left"?Me+=ye.legendWidth||150:G.value&&he.value==="right"&&(ve+=ye.legendWidth||150);const Ue=we.value==="semi-radial"?te?Ve:8:te?Ve:B?8:p+80,He=te?14:0,Te=Ke+ce+He,ze={left:Me,top:Te,right:ve,bottom:Ue};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??ze.left,top:i.top??ze.top,right:i.right??ze.right,bottom:i.bottom??ze.bottom}:ze}let C=0;rt.value&&(C+=15),Et.value&&(C+=10);const b=ot();let z=p+16,N=p;G.value&&he.value==="left"?z+=b.legendWidth||150:G.value&&he.value==="right"&&(N+=b.legendWidth||150),An.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:Bn.value.left,top:Bn.value.top,right:Se.value-Bn.value.right,bottom:K.value-Bn.value.bottom,width:Se.value-(Bn.value.left+Bn.value.right),height:K.value-(Bn.value.top+Bn.value.bottom)})),xn=e.computed(()=>["line","area","bar"].includes(we.value)||ct.value),On=e.computed(()=>ct.value),Hl=e.computed(()=>we.value==="mini-radial"),hn=e.computed(()=>["radial","semi-radial","mini-radial"].includes(we.value)),Mn=e.computed(()=>we.value==="spider"),jt=e.computed(()=>we.value==="bubble"),Gt=e.computed(()=>q.value?.chart?.orientation==="horizontal"&&(we.value==="bar"||On.value)),ul=t=>{const{minY:a,maxY:n}=Zt.value,i=n-a||1;return F.value.left+(t-a)/i*F.value.width},gl=t=>{const{maxX:a}=Zt.value,n=a+1,p=F.value.height/n;return F.value.top+(t+.5)*p},Dt=e.computed(()=>hn.value?Bn.value.left+(Se.value-Bn.value.left-Bn.value.right)/2:Se.value/2),wt=e.computed(()=>Mn.value?K.value/2-40:hn.value?Bn.value.top+(K.value-Bn.value.top-Bn.value.bottom)/2:K.value/2),ut=e.computed(()=>{if(Mn.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}),Ot=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||!(hn.value||Mn.value)?1:1+a/100}),tn=e.computed(()=>{const t=Rl.value;if(t===1||t<=0)return;const a=Dt.value,n=wt.value;return`translate(${a}, ${n}) scale(${t}) translate(${-a}, ${-n})`}),Sl=e.ref(0),Zl=e.computed(()=>`semi-radial-fill-clip-${H.chartId}`),Rn=e.computed(()=>we.value==="semi-radial"),nl=e.computed(()=>Rn.value&&Vt.value&&!bl.value),ll=e.computed(()=>Rn.value&&Vt.value&&!bl.value&&Ut.value==="fill"),hl=e.computed(()=>{const t=nl.value?Sl.value:1,a=Dt.value,n=wt.value,i=Ot.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 b=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),Ve=a+i*Math.cos(g),Ke=n+i*Math.sin(g),ce=t>.5?1:0;return`M ${a} ${n} L ${b} ${z} A ${p} ${p} 0 ${ce} 1 ${N} ${$} L ${B} ${te} A ${i} ${i} 0 ${ce} 1 ${Ve} ${Ke} Z`}),yl=e.computed(()=>{if(!(!Rn.value||!nl.value)&&!ll.value)return`url(#${Zl.value})`}),Zo=t=>{if(!(!ll.value||t!==0))return`url(#${Zl.value})`},kl=e.ref(0),Vl=e.computed(()=>`radial-reveal-clip-${H.chartId}`),jn=e.computed(()=>we.value==="radial"),Fl=e.computed(()=>{const t=jn.value?kl.value:1,a=Dt.value,n=wt.value,i=Math.max(ut.value*1.5,Se.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),b=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} ${b} A ${i} ${i} 0 ${$} 1 ${z} ${N} Z`}),xo=e.computed(()=>{if(yl.value)return yl.value;if(jn.value)return`url(#${Vl.value})`});let Il=null;const Uo=()=>{if(!nl.value)return;Sl.value=0;const t=V.value,a=performance.now(),n=i=>{const p=i-a,g=Math.min(1,p/t);Sl.value=Go(S.value,g),g<1&&(Il=requestAnimationFrame(n))};Il=requestAnimationFrame(n)},zl=e.computed(()=>q.value?.bubbles?.minSize||8),ao=e.computed(()=>q.value?.bubbles?.maxSize||50),Ul=e.computed(()=>q.value?.bubbles?.opacity||.7),Eo=(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)},So=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.opacity="1")},so=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.display="none")},Kn=e.computed(()=>H.series),Gn=e.computed(()=>H.series.filter((t,a)=>!lt.value.has(a))),Xl=t=>{if(!t)return"primary";const a=t.yAxis??t.axis??t.yAxisId;return a==="secondary"||a==="right"||a===1?"secondary":"primary"},ro=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,Vo=e.computed(()=>Gn.value.filter(t=>Xl(t)==="primary")),Nl=e.computed(()=>Gn.value.filter(t=>Xl(t)==="secondary")),An=e.computed(()=>!Gt.value&&!!ae.value&&Nl.value.length>0),En="auto",io=(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 b;if(a===En){const N=C-g,$=N>0?N*.1:1;b=Math.max(0,g-$)}else if(typeof a=="number")b=a;else{const N=C-g,$=N>0?N*.1:1;b=Math.max(0,g-$)}let z;if(n===En){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:b,maxY:z}},Zt=e.computed(()=>{if(jt.value)return Xo();if(!Gn.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;Gn.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=io(Vo.value.length?Vo.value:Gn.value,Pe.value,Re.value);return{minX:0,maxX:t,minY:a.minY,maxY:a.maxY}}),No=e.computed(()=>An.value?io(Nl.value,Wt.value,kt.value,Zt.value.minY,Zt.value.maxY):{minY:Zt.value.minY,maxY:Zt.value.maxY}),Xo=()=>{if(!Gn.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(Gn.value.forEach((Ve,Ke)=>{Ve?.data?.length&&Ve.data.forEach((ce,ye)=>{let Me,ve,et;if(typeof ce=="object"&&ce!==null&&!Array.isArray(ce))Me=typeof ce.x=="number"?ce.x:ye,ve=typeof ce.y=="number"?ce.y:0,et=typeof ce.size=="number"?ce.size:20;else if(Array.isArray(ce)&&ce.length>=3)Me=typeof ce[0]=="number"?ce[0]:ye,ve=typeof ce[1]=="number"?ce[1]:0,et=typeof ce[2]=="number"?ce[2]:20;else if(typeof ce=="number")Me=ye,ve=ce,et=Eo(Ke,ye);else return;isFinite(Me)&&isFinite(ve)&&isFinite(et)&&(t=Math.min(t,Me),a=Math.max(a,Me),n=Math.min(n,ve),i=Math.max(i,ve),p=Math.min(p,et),g=Math.max(g,et),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 b=a-t,z=i-n;let N,$,B,te;return qt.value!==null?N=qt.value:N=t-b*.1,Bt.value!==null?$=Bt.value:$=a+b*.1,Pe.value!==null&&typeof Pe.value=="number"?B=Pe.value:B=Math.max(0,n-z*.1),Re.value!==null&&typeof Re.value=="number"?te=Re.value:te=i+z*.1,{minX:N,maxX:$,minY:B,maxY:te,minSize:p,maxSize:g}},Kt=t=>{if(jt.value){const{minX:b,maxX:z}=Zt.value,N=z-b||1;return F.value.left+(t-b)/N*F.value.width}const{minX:a,maxX:n}=Zt.value,i=n-a;if(n===0||i===0)return F.value.left+F.value.width/2;const p=i/re.value.scale,g=a-re.value.offsetX/F.value.width*i,C=(t-g)/p;return F.value.left+C*F.value.width},kn=t=>{const{minY:a,maxY:n}=Zt.value,i=n-a||1;return F.value.bottom-(t-a)/i*F.value.height},Bo=t=>{const{minY:a,maxY:n}=No.value,i=n-a||1;return F.value.bottom-(t-a)/i*F.value.height},Cn=(t,a)=>An.value&&Xl(t)==="secondary"?Bo(a):kn(a),co=t=>{if(!jt.value)return St.value||4;const{maxSize:a}=Zt.value,n=Math.max(1,a),i=Math.min(1,Math.max(0,t/n));return zl.value+i*(ao.value-zl.value)},Bl=(t,a=12,n="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(a*.62);Bl.canvas||(Bl.canvas=document.createElement("canvas"));const i=Bl.canvas.getContext("2d");return i?(i.font=`${a}px ${n}`,i.measureText(t).width):t.length*(a*.62)},uo=(t,a,n=12)=>{if(typeof t!="string"||typeof a!="number"||a<=0||Bl(t,n)<=a)return t;const i="..";if(Bl(i,n)>=a)return i;let g=t.length;for(;g>0;){const C=`${t.slice(0,g)}${i}`;if(Bl(C,n)<=a)return C;g-=1}return i},Mo=e.computed(()=>s.value.map(t=>({y:t.y}))),o=e.computed(()=>{if(jt.value)return l();if(we.value==="bar"){if(Gt.value){const Te=[],{minY:ze,maxY:_t}=Zt.value,Ft=5,Zn=_t-ze||1;for(let fn=0;fn<=Ft;fn++){const Un=ze+Zn*(fn/Ft),Do=ul(Un);Te.push({x:Do,y:F.value.bottom+20,text:Xt(Math.round(Un))})}return Te}const ye=[],{maxX:Me}=Zt.value,ve=Me+1,et=5,He=(F.value.width-et*2)/ve;for(let Te=0;Te<=Me;Te++){const ze=F.value.left+et+(Te+.5)*He;ye.push({x:ze,y:F.value.bottom+20,text:uo(H.categories[Te]||M("chart.fallback.item",{number:Te+1}),Math.max(He-8,24))})}return ye}const t=[],{minX:a,maxX:n}=Zt.value,i=qt.value!==null?qt.value:a,p=Bt.value!==null?Bt.value:n,g=p-i||1,C=g/re.value.scale,b=i-re.value.offsetX/F.value.width*g,z=b+C,N=Math.max(0,Math.floor(b-2)),$=Math.min(p,Math.ceil(z+2)),B=$-N,te=F.value.width,Ke=Math.floor(te/60);let ce=1;B>Ke&&(ce=Math.ceil(B/Ke));for(let ye=N;ye<=$;ye+=ce)if(ye>=0&&ye<=p){const Me=Kt(ye);Me>=F.value.left-100&&Me<=F.value.right+100&&t.push({x:Me,y:F.value.bottom+20,text:H.categories[ye]||`Item ${ye+1}`})}return t}),l=()=>{const t=[],{minX:a,maxX:n}=Zt.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,b=Kt(C);if(b>=F.value.left-10&&b<=F.value.right+10){const z=Math.round(C),N=H.categories?.[z];t.push({x:b,y:F.value.bottom+20,text:N||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},s=e.computed(()=>{if(Gt.value){const p=[],{maxX:g}=Zt.value;for(let C=0;C<=g;C++)p.push({x:F.value.left-10,y:gl(C),text:uo(H.categories[C]||`Item ${C+1}`,Math.max(F.value.left-28,40))});return p}const t=[],{minY:a,maxY:n}=Zt.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:kn(g),text:Xt(C)})}return t}),r=e.computed(()=>{if(!An.value||Gt.value)return[];const t=[],{minY:a,maxY:n}=No.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:Bo(g),text:Xt(C)})}return t}),c=t=>{const a=Jt.value;if(!a||a.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return a[t%a.length]},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 b=a.match(/^rgba\s*\(\s*(\d+)\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{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)),b=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${C}, ${b})`}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)),b=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${C}, ${b}, ${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))),b=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,b,z].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},y=e.computed(()=>we.value==="line"||On.value?(On.value?H.series.filter(a=>(a.type||we.value)==="line"):Kn.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:Gt.value?ul(B):Kt(te),y:Gt.value?gl(te):Cn(a,B),index:te})}),g.length>0&&p.push(g);let C="";p.forEach(B=>{if(B.length>0){let te="";ke.value?te=ql(B):te=`M ${B[0].x} ${B[0].y}`+B.slice(1).map(Ve=>` L ${Ve.x} ${Ve.y}`).join(""),C+=(C?" ":"")+te}});const b=p.reduce((B,te)=>B+v(te),0),z=lt.value.has(i),N=ie.value===i,$=ie.value!==null&&ie.value!==i;return{path:C,color:c(i),strokeDasharray:ro(a),pathLength:b,seriesIndex:i,animationDelay:n*Z.value,isHighlighted:N,isDimmed:$,isHidden:z}}):[]),_=e.computed(()=>{if(!(we.value==="line"||On.value))return[];const t=On.value?H.series.filter(n=>(n.type||we.value)==="line"):Kn.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 b=-1,z=0;for(let N=g+1;N<n.data.length;N++){const $=n.data[N];if($==null)z++;else{b=N;break}}if(z>0&&b!==-1){const N=n.data[b],$=Gt.value?ul(C):Kt(g),B=Gt.value?gl(g):Cn(n,C),te=Gt.value?ul(N):Kt(b),Ve=Gt.value?gl(b):Cn(n,N),Ke=lt.value.has(p),ce=ie.value===p,ye=ie.value!==null&&ie.value!==p;a.push({path:`M ${$} ${B} L ${te} ${Ve}`,color:c(p),seriesIndex:p,animationDelay:i*Z.value,isHighlighted:ce,isDimmed:ye,isHidden:Ke,gapSize:z}),g=b-1}}}}),a}),D=e.computed(()=>we.value==="line"||On.value?!Vt.value||bl.value||Ht.value.hasAnimated?[]:(On.value?H.series.filter(a=>(a.type||we.value)==="line"):Kn.value).map((a,n)=>{const i=H.series.findIndex(z=>z===a);let p="",g=null;a.data.forEach((z,N)=>{if(z!=null){const $={x:Gt.value?ul(z):Kt(N),y:Gt.value?gl(N):Cn(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:Gt.value?ul(a.data[$]):Kt($),y:Gt.value?gl($):Cn(a,a.data[$])};p+=` L ${B.x} ${B.y}`,g=B}}});const C=a.data.map((z,N)=>z==null?null:{x:Gt.value?ul(z):Kt(N),y:Gt.value?gl(N):Cn(a,z)}).filter(z=>z!==null),b=v(C);return{path:p,pathLength:b,color:c(i),strokeDasharray:ro(a),animationDelay:n*Z.value,seriesIndex:i}}):[]),E=e.computed(()=>{if(we.value!=="line")return[];const t=[];return Kn.value.forEach((a,n)=>{const i=ie.value===n,p=ie.value!==null&&ie.value!==n,g=lt.value.has(n);a.data.forEach((C,b)=>{C!=null&&t.push({x:Kt(b),y:Cn(a,C),color:c(n),value:C,label:H.categories[b]||b.toString(),seriesName:a.name,categoryIndex:b,dataIndex:b,animationDelay:(n*a.data.length+b)*(Z.value/8),isHighlighted:i,isDimmed:p,isHidden:g})})}),t}),se=e.computed(()=>{if(!On.value)return[];const t=[];return H.series.filter(n=>(n.type||we.value)==="line").forEach((n,i)=>{const p=H.series.findIndex(z=>z===n),g=ie.value===p,C=ie.value!==null&&ie.value!==p,b=lt.value.has(p);n.data.forEach((z,N)=>{z!=null&&t.push({x:Kt(N),y:Cn(n,z),color:c(p),value:z,label:H.categories[N]||N.toString(),seriesName:n.name,categoryIndex:N,dataIndex:N,animationDelay:(i*n.data.length+N)*(Z.value/8),isHighlighted:g,isDimmed:C,isHidden:b})})}),t}),j=e.computed(()=>{if(!jt.value)return[];const t=[];return Kn.value.forEach((a,n)=>{if(!a?.data?.length)return;const i=ie.value,p=i!==null&&i===n,g=i!==null&&i!==n,C=lt.value.has(n);a.data.forEach((b,z)=>{let N,$,B,te,Ve;if(typeof b=="object"&&b!==null&&!Array.isArray(b))N=typeof b.x=="number"?b.x:z,$=typeof b.y=="number"?b.y:0,B=typeof b.size=="number"?b.size:20,te=b.label||H.categories?.[z]||`Point ${z+1}`,Ve=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)N=typeof b[0]=="number"?b[0]:z,$=typeof b[1]=="number"?b[1]:0,B=typeof b[2]=="number"?b[2]:20,te=b[3]||H.categories?.[z]||`Point ${z+1}`,Ve=b[4];else if(typeof b=="number")N=z,$=b,B=Eo(n,z),te=H.categories?.[z]||`Point ${z+1}`;else return;!isFinite(N)||!isFinite($)||!isFinite(B)||t.push({x:Kt(N),y:kn($),radius:co(B),originalX:N,originalY:$,originalSize:B,color:c(n),seriesName:a.name||`Series ${n+1}`,label:te,imageUrl:Ve,seriesIndex:n,dataIndex:z,categoryIndex:Math.round(N),isHighlighted:p,isDimmed:g,isHidden:C,opacity:Ul.value})})}),t}),Oe=e.computed(()=>we.value!=="area"?[]:Kn.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:Cn(t,B),index:te})}),i.length>0&&n.push(i),n.length===0)return{linePath:"",areaPath:"",color:c(a),isHidden:lt.value.has(a)};const p=F.value.bottom+1;let g="",C="";n.forEach((B,te)=>{if(B.length===0)return;let Ve=`M ${B[0].x} ${B[0].y}`;ke.value&&B.length>1?Ve=ql(B):B.slice(1).forEach(ce=>{Ve+=` L ${ce.x} ${ce.y}`}),g+=(g?" ":"")+Ve;let Ke=`M ${B[0].x} ${p}`;if(Ke+=` L ${B[0].x} ${B[0].y}`,ke.value&&B.length>1){const ce=ql(B),ye=ce.substring(ce.indexOf("C")||ce.indexOf("Q")||ce.indexOf("L"));ye?Ke+=" "+ye:B.slice(1).forEach(Me=>{Ke+=` L ${Me.x} ${Me.y}`})}else B.slice(1).forEach(ce=>{Ke+=` L ${ce.x} ${ce.y}`});Ke+=` L ${B[B.length-1].x} ${p} Z`,C+=(C?" ":"")+Ke});const b=ie.value===a,z=ie.value!==null&&ie.value!==a,N=lt.value.has(a),$=n.reduce((B,te)=>B+v(te),0);return{linePath:g,areaPath:C,color:c(a),pathLength:$,isHighlighted:b,isDimmed:z,isHidden:N}})),Ne=e.computed(()=>{if(!(["bar"].includes(we.value)||On.value))return[];const t=[],{maxX:a}=Zt.value,n=On.value?H.series.filter(p=>(p.type||we.value)==="bar"):Kn.value,i=n.length;if(Gt.value){const p=a+1,C=F.value.height/p,b=C*(2/3),z=Math.min(4,b/i*.15),N=b-(i-1)*z,$=Math.max(4,N/i);n.forEach((B,te)=>{const Ve=H.series.findIndex(Me=>Me===B),Ke=ie.value===Ve,ce=ie.value!==null&&ie.value!==Ve,ye=lt.value.has(Ve);B.data.forEach((Me,ve)=>{if(Me==null||typeof Me!="number"||!isFinite(Me))return;const He=F.value.top+(ve+.5)*C-b/2+te*($+z),Te=F.value.left,ze=Math.abs(ul(Me)-F.value.left);let _t="";if(ke.value&&ze>0){const Ft=Math.min(xt.value,$/2,ze/2);_t=[`M ${Te} ${He}`,`L ${Te+ze-Ft} ${He}`,`Q ${Te+ze} ${He} ${Te+ze} ${He+Ft}`,`L ${Te+ze} ${He+$-Ft}`,`Q ${Te+ze} ${He+$} ${Te+ze-Ft} ${He+$}`,`L ${Te} ${He+$}`,"Z"].join(" ")}t.push({x:Te,y:He,width:ze,height:$,color:c(i===1?ve:Ve),value:Me,label:H.categories[ve]||ve.toString(),seriesName:B.name,animationDelay:(te*n.length+ve)*(Z.value/4),isHighlighted:Ke,isDimmed:ce,isHidden:ye,barPath:_t,isSmooth:ke.value&&ze>0})})})}else{const p=a+1,C=F.value.width/p,b=C*.8,z=b/i,N=z*.05,$=z-N;n.forEach((B,te)=>{const Ve=H.series.findIndex(Me=>Me===B),Ke=ie.value===Ve,ce=ie.value!==null&&ie.value!==Ve,ye=lt.value.has(Ve);B.data.forEach((Me,ve)=>{if(Me==null||typeof Me!="number"||!isFinite(Me))return;const He=F.value.left+(ve+.5)*C-b/2+te*z+N/2,Te=kn(Math.max(0,Me)),ze=Math.abs(kn(0)-kn(Me));let _t="";if(ke.value&&ze>0){const Ft=Math.min(xt.value,$/2,ze/2);_t=[`M ${He} ${Te+ze}`,`L ${He} ${Te+Ft}`,`Q ${He} ${Te} ${He+Ft} ${Te}`,`L ${He+$-Ft} ${Te}`,`Q ${He+$} ${Te} ${He+$} ${Te+Ft}`,`L ${He+$} ${Te+ze}`,"Z"].join(" ")}t.push({x:He,y:Te,width:$,height:ze,color:c(i===1?ve:Ve),value:Me,label:H.categories[ve]||ve.toString(),seriesName:B.name,animationDelay:(te*n.length+ve)*(Z.value/4),isHighlighted:Ke,isDimmed:ce,isHidden:ye,barPath:_t,isSmooth:ke.value&&ze>0})})})}return t}),st=e.computed(()=>{if(!hn.value)return[];const t=Kn.value.map((C,b)=>({series:C,originalIndex:b})).filter(({originalIndex:C})=>!lt.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,b,z,N,$,B)=>{const te=C+(b-C)/2,Ve=b-C,Ke=Dt.value+Math.cos(C)*Ot.value,ce=wt.value+Math.sin(C)*Ot.value,ye=Dt.value+Math.cos(b)*Ot.value,Me=wt.value+Math.sin(b)*Ot.value,ve=Dt.value+Math.cos(b)*ut.value,et=wt.value+Math.sin(b)*ut.value,Ue=Dt.value+Math.cos(C)*ut.value,He=wt.value+Math.sin(C)*ut.value,Te=Ve>Math.PI?1:0,ze=[`M ${Ke} ${ce}`,`A ${Ot.value} ${Ot.value} 0 ${Te} 1 ${ye} ${Me}`,`L ${ve} ${et}`,`A ${ut.value} ${ut.value} 0 ${Te} 0 ${Ue} ${He}`,"Z"].join(" "),_t=B||c(z);return{path:ze,color:_t,strokeWidth:Je.value,strokeColor:m(i.length,_t),value:$,seriesName:N,opacity:.8,isHighlighted:ie.value===z,isDimmed:ie.value!==null&&ie.value!==z,isHidden:!1,startAngle:C,endAngle:b,midAngle:te}};if(Hl.value){const{series:C,originalIndex:b}=t[0],z=Number(C?.data?.[0]??0),N=Number.isFinite(z)?Math.min(Math.max(z,0),100):0,$=q.value,B=Math.min(Math.max(Number($?.miniRadial?.minVisiblePercent??1),0),100),Ve=(N<=0?B:N)/100*n,Ke=Number($?.miniRadial?.thresholds?.low??33),ce=Number($?.miniRadial?.thresholds?.medium??66),ye=$?.miniRadial?.colors?.low||"#E53E3E",Me=$?.miniRadial?.colors?.medium||"#ED8936",ve=$?.miniRadial?.colors?.high||"#38A169",et=N<=Ke?ye:N<=ce?Me:ve,Ue=$?.miniRadial?.trackColor||"#E5E7EB",He=C?.name||"Score";return i.push(p(a,a+n-.001,b+1,"Track",100,Ue)),i.push(p(a,a+Ve,b,He,N,et)),i}if(t.length===1){const{series:C,originalIndex:b}=t[0],z=C.data[0]||0,N=a,$=a+n-.001,B=N+n/2,te=Dt.value+Math.cos(N)*Ot.value,Ve=wt.value+Math.sin(N)*Ot.value,Ke=Dt.value+Math.cos($)*Ot.value,ce=wt.value+Math.sin($)*Ot.value,ye=Dt.value+Math.cos($)*ut.value,Me=wt.value+Math.sin($)*ut.value,ve=Dt.value+Math.cos(N)*ut.value,et=wt.value+Math.sin(N)*ut.value,Ue=1,He=[`M ${te} ${Ve}`,`A ${Ot.value} ${Ot.value} 0 ${Ue} 1 ${Ke} ${ce}`,`L ${ye} ${Me}`,`A ${ut.value} ${ut.value} 0 ${Ue} 0 ${ve} ${et}`,"Z"].join(" "),Te=c(b);return i.push({path:He,color:Te,strokeWidth:Je.value,strokeColor:m(0,Te),value:z,seriesName:C.name,opacity:.8,isHighlighted:ie.value===b,isDimmed:!1,isHidden:!1,startAngle:N,endAngle:$,midAngle:B}),i}if(ll.value&&t.length===2){const C=t[0],b=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,b.originalIndex,b.series.name,100)),i}const g=t.reduce((C,{series:b})=>C+(b.data[0]||0),0);return g===0?[]:(t.forEach(({series:C,originalIndex:b})=>{const z=C.data[0]||0,N=z/g*n,$=a,B=a+N,te=$+N/2,Ve=Dt.value+Math.cos($)*Ot.value,Ke=wt.value+Math.sin($)*Ot.value,ce=Dt.value+Math.cos(B)*Ot.value,ye=wt.value+Math.sin(B)*Ot.value,Me=Dt.value+Math.cos(B)*ut.value,ve=wt.value+Math.sin(B)*ut.value,et=Dt.value+Math.cos($)*ut.value,Ue=wt.value+Math.sin($)*ut.value,He=N>Math.PI?1:0,Te=[`M ${Ve} ${Ke}`,`A ${Ot.value} ${Ot.value} 0 ${He} 1 ${ce} ${ye}`,`L ${Me} ${ve}`,`A ${ut.value} ${ut.value} 0 ${He} 0 ${et} ${Ue}`,"Z"].join(" "),ze=c(b);i.push({path:Te,color:ze,strokeWidth:Je.value,strokeColor:m(i.length,ze),value:z,seriesName:C.name,opacity:.8,isHighlighted:ie.value===b,isDimmed:ie.value!==null&&ie.value!==b,isHidden:!1,startAngle:$,endAngle:B,midAngle:te}),a=B}),i)}),yn=e.computed(()=>{const t=st.value;return ll.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((a,n)=>({segment:a,originalIndex:n}))}),mn=e.computed(()=>{if(!Dn.value||!hn.value)return[];const t=zn.value,a=pl.value,n=_l.value,i=Pl.value,p=15,g=t*1.3,C=.55,b=(B,te)=>{const Ve=Dt.value+Math.cos(B.midAngle)*ut.value,Ke=wt.value+Math.sin(B.midAngle)*ut.value,ce=Dt.value+Math.cos(B.midAngle)*(ut.value+a),ye=wt.value+Math.sin(B.midAngle)*(ut.value+a),ve=ce+n*(te?1:-1),et=te?ce+p:ce-p,Ue=ye-i,He=`${B.seriesName}: ${Xt(B.value)}`,Te=He.length*t*C;return{pointerStartX:Ve,pointerStartY:Ke,pointerEndX:ce,pointerEndY:ye,horizontalEndX:ve,horizontalEndY:ye,textX:et,textY:Ue,text:He,textWidth:Te,textAnchor:te?"start":"end",isRightSide:te,pointerLineLength:Math.hypot(ce-Ve,ye-Ke),horizontalLineLength:Math.hypot(ve-ce,0)}},z=(B,te)=>{const Ve=Math.abs(B.textY-te.textY)<g,Ke=B.isRightSide?B.textX:B.textX-B.textWidth,ce=B.isRightSide?B.textX+B.textWidth:B.textX,ye=te.isRightSide?te.textX:te.textX-te.textWidth,Me=te.isRightSide?te.textX+te.textWidth:te.textX,ve=Ke<Me&&ye<ce;return Ve&&ve},N=st.value.filter(B=>!B.isHidden),$=[];for(let B=0;B<N.length;B++){const te=N[B];let Ve=Math.cos(te.midAngle)>=0;if(B>0){const ce=$[B-1],ye=b(te,Ve);z(ce,ye)&&(Ve=!Ve)}const Ke=b(te,Ve);$.push({...Ke,color:te.color,isHighlighted:te.isHighlighted,isDimmed:te.isDimmed})}return $}),ln=t=>{if(!t||t.isHidden)return 0;const a=t.opacity||Ul.value||.7;return ie.value===null||ie.value===void 0?a:ie.value!==null?t.seriesIndex===ie.value?Math.min(1,a+.1):Math.max(.5,a*.8):a},pn=t=>{if(!t||t.isHidden)return 0;const a=t.radius>20?.9:.8;return ie.value!==null?t.seriesIndex===ie.value?Math.min(1,a+.1):a*.7:a},rn=(t,a)=>{if(t)try{if(ie.value===t.seriesIndex?ie.value=null:ie.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)}},cn=(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(" ")},Wn=(t,a)=>{if(!t||(a.stopPropagation(),To.value=!0,ie.value=t.seriesIndex,Fe.value.show=!1,!je.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,b=120;p+C>Se.value&&(p=a.clientX-i.left-C-10),g+b>i.height&&(g=a.clientY-i.top-b-10),p<0&&(p=10),g<0&&(g=10);const z=$n.value,N=Ln.value,$=z.map(B=>{const te=N[B]||B,Ve=ol(B,t);return Ve?{seriesName:t.seriesName,label:t.label,value:`${te}: ${Ve}`,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:[]}},ol=(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=vl.value[t];if(typeof i=="function")return i(n,a);if(typeof n=="number"){const p=n.toFixed(1);return un.value?p+un.value:p}return n?.toString()||""},dl=()=>{if(!jt.value||!Fe.value.data||Fe.value.data.length===0)return"Bubbles";const t=[],a=new Set;return Fe.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"},mo=(t,a)=>{t&&(To.value=!1,ie.value=null,ht.value.show=!1,ht.value.bubbleData=[])},_o=(t,a)=>{const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect(),p=Tl(t.categoryIndex),g=t.description||t.comment||"";let C=a.clientX-i.left+15,b=a.clientY-i.top-10;const z=200,N=g?80:50;C+z>Se.value&&(C=a.clientX-i.left-z-15),b+N>K.value&&(b=a.clientY-i.top-N-10),C<0&&(C=10),b<0&&(b=10),gn.value={show:!0,x:C,y:b,categoryValue:p,description:g}},Yo=()=>{gn.value.show=!1},Cl=e.computed(()=>H.categories.length||Math.max(...Gn.value.map(t=>t.data.length))),ta=e.computed(()=>{let t=0;return Gn.value.forEach(a=>{a.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),po=e.computed(()=>{const t=[],a=Cl.value;for(let n=0;n<a;n++){const i=n*2*Math.PI/a-Math.PI/2,p=Dt.value+Math.cos(i)*ut.value,g=wt.value+Math.sin(i)*ut.value;t.push({x:p,y:g,angle:i,index:n})}return t}),Yl=e.computed(()=>{const t=[],a=Cl.value;return po.value.forEach((n,i)=>{const p=ut.value+15,g=i*2*Math.PI/a-Math.PI/2,C=Dt.value+Math.cos(g)*p,b=wt.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:b,text:H.categories[i]||`Axis ${i+1}`,anchor:z,baseline:N})}),t}),$o=e.ref(new Set),al=(t,a,n)=>{const i=`current-${n}`,p=$o.value.has(i);return!p&&ie.value===null?a.fillOpacity||gt.value:a.isHighlighted||p?(a.fillOpacity||gt.value)+.15:a.isDimmed?(a.fillOpacity||gt.value)*.3:a.fillOpacity||gt.value},Qn=e.computed(()=>{if(!Mn.value)return[];const t=[],a=Cl.value;return Kn.value.forEach((n,i)=>{const p=[],g=[],C=[],b=ie.value===i,z=ie.value!==null&&ie.value!==i,N=lt.value.has(i);for(let $=0;$<a;$++){const B=n.data[$]||0,Ve=B/ta.value*ut.value,Ke=$*2*Math.PI/a-Math.PI/2,ce=Dt.value+Math.cos(Ke)*Ve,ye=wt.value+Math.sin(Ke)*Ve;p.push(`${ce},${ye}`),g.push({x:ce,y:ye}),C.push({x:ce,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:gt.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:b,isDimmed:z,isHidden:N,seriesIndex:i})}),t}),qn=(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,b=a[p].x,z=a[p].y;C>t.y!=z>t.y&&t.x<(b-g)*(t.y-C)/(z-C)+g&&(n=!n)}return n},na=t=>{if(!Mn.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=Qn.value.filter(b=>b.isHidden?!1:qn({x:p,y:g},b.polygonPoints));if(C.length>0){C.length,ie.value=C[0].seriesIndex;const b=t.clientX-n.left+10,z=t.clientY-n.top-10,N=C.length>1?460:260,$=70+Cl.value*20;let B=b,te=z;B+N>Se.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 Ve=C.map(Ke=>({seriesName:Ke.seriesName,color:Ke.color,points:Ke.dataPoints.map(ce=>({label:ce.label,value:Xt(ce.value)}))}));ht.value={show:!0,x:B,y:te,title:"",value:"",bubbleData:[],spiderAreas:Ve}}else ml()},Lo=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||lt.value.has(a.seriesIndex))return null;let p,g;if(xn.value){let b=-1,z=null;for(let $=i.data.length-1;$>=0;$--)if(i.data[$]!==null&&i.data[$]!==void 0){b=$,z=i.data[$];break}if(b===-1||z===null)return null;const N=i.data.map(($,B)=>$==null?null:{x:Kt(B),y:Cn(i,$),index:B}).filter($=>$!==null);if(t.animations.enabled&&!bl.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Ht.value.isAnimating||!Ht.value.hasAnimated))if(Ht.value.isAnimating){const $=Ht.value.currentFrame/Ht.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(b)+(a.offsetX||0),g=kn(z)+(a.offsetY||0)}else if(hn.value||Mn.value){const b=Math.PI*2/t.logos.length*n;p=Dt.value+Math.cos(b)*(ut.value+30)+(a.offsetX||0),g=wt.value+Math.sin(b)*(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=>{lt.value.has(t)?lt.value.delete(t):lt.value.add(t)},ga=e.computed(()=>{if(!ht.value.show&&!(Qe.value&&Fe.value.show&&!re.value.isZooming))return{display:"none"};let t,a;if(Qe.value&&Fe.value.show&&!re.value.isZooming){t=Fe.value.x+15,a=F.value.top;const n=jt.value?200:150;t+n>Se.value&&(t=Fe.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"}}),Ml=(t,a)=>{if(!je.value||fo.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,b=120,z=Se.value,N=K.value;p+C>z&&(p=a.clientX-i.left-C-10),g+b>N&&(g=a.clientY-i.top-b-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=(Gt.value||we.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";ht.value={show:!0,x:p,y:g,title:B,value:Xt(t.value)||"",categoryIndex:$,spiderAreas:[]}},Ko=e.ref(!1),To=e.ref(!1),ml=()=>{ht.value.show=!1,ht.value.spiderAreas=[],ht.value.bubbleData=[],Fe.value.show=!1,Ko.value||(ie.value=null)},fo=e.ref(!1),vo=(t,a)=>{fo.value=!0,ht.value.show=!1,Fe.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>Se.value&&(p=a.clientX-i.left-C-15),p<0&&(p=10),g<0&&(g=10),xl.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},go=()=>{fo.value=!1,xl.value.show=!1},Ht=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}},bl=e.computed(()=>Ze.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),la=()=>{if(!Vt.value||bl.value){Ht.value.hasAnimated=!0,jn.value&&(kl.value=1);return}jn.value&&(kl.value=0),Ht.value.isAnimating=!0,Ht.value.currentFrame=0,Ht.value.totalFrames=Math.ceil(V.value/16.67);const t=()=>{const a=Ht.value.currentFrame/Ht.value.totalFrames,n=Go(S.value,Math.min(a,1));ha(n),jn.value&&(kl.value=n),a<1?(Ht.value.currentFrame++,Ht.value.animationId=requestAnimationFrame(t)):ya()};Ht.value.animationId=requestAnimationFrame(t)},ha=t=>{const a=P.value;a&&a.style.setProperty("--dss-animation-progress",t)},ya=()=>{Ht.value.isAnimating=!1,Ht.value.hasAnimated=!0,jn.value&&(kl.value=1),Ht.value.animationId&&(cancelAnimationFrame(Ht.value.animationId),Ht.value.animationId=null)},Qo=e.computed(()=>!hn.value||Ht.value.hasAnimated?!0:jn.value?kl.value>=1:Rn.value?Sl.value>=1:!0),oa=e.computed(()=>Dn.value&&Qo.value),Ao=e.ref(!1);e.watch(oa,t=>{t?(Ao.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Ao.value=!0})})):Ao.value=!1},{immediate:!0});const ka=e.computed(()=>{if(!Vt.value||bl.value||Ht.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${V.value}ms`,t["--dss-animation-easing"]=Ca(S.value),t["--dss-stagger-delay"]=`${Z.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(!Vt.value||bl.value)return"";const t=["dss-chart-animated"];return Ht.value.hasAnimated||t.push(`dss-animate-${Ut.value}`),Ht.value.hasAnimated||(hn.value&&we.value!=="semi-radial"?t.push("dss-animate-fill"):hn.value||t.push(`dss-animate-${Ut.value}`)),Ht.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>H.series,(t,a)=>{J.value&&a&&Ht.value.hasAnimated&&(Ht.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>la(),w.value)}))},{deep:!0}),e.watch(()=>re.value.isZooming,(t,a)=>{a&&!t&&setTimeout(()=>{h()},50)}),e.watch(()=>[re.value.scale,re.value.offsetX],()=>{!re.value.isZooming&&!re.value.isDragging&&h()},{flush:"post"}),e.watch([Tt,Xe],([t,a])=>{re.value.minScale=t,re.value.maxScale=a,(re.value.scale<t||re.value.scale>a)&&oo()},{immediate:!0}),e.watch(()=>H.locale,t=>{t&&t!==L.value&&(L.value=t)},{immediate:!0}),e.watch(()=>bt.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",no)}):document.removeEventListener("click",no)}),e.onMounted(()=>{ie.value=null,jn.value&&(!Vt.value||bl.value)&&(kl.value=1),an(),P.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;ft.value=Math.round(n),ee.value=Math.round(i),pe.value&&($e.value=pe.value.offsetHeight||Ce)}))}),f.observe(P.value)),Vt.value&&!bl.value?we.value==="semi-radial"?setTimeout(()=>Uo(),w.value):setTimeout(()=>la(),w.value):(Ht.value.hasAnimated=!0,we.value==="semi-radial"&&(Sl.value=1)),document.addEventListener("mousemove",aa),document.addEventListener("mouseup",sa),document.addEventListener("click",Co)}),e.onUnmounted(()=>{be&&cancelAnimationFrame(be),f&&P.value&&(f.unobserve(P.value),f.disconnect(),f=null),Ht.value.animationId&&cancelAnimationFrame(Ht.value.animationId),Il&&(cancelAnimationFrame(Il),Il=null),re.value.zoomTimeout&&clearTimeout(re.value.zoomTimeout),document.removeEventListener("mousemove",aa),document.removeEventListener("mouseup",sa),document.removeEventListener("click",Co),document.removeEventListener("click",no)});const aa=t=>{if(re.value.isDragging&&re.value.scale>1&&xn.value){Fe.value.show=!1;const a=t.clientX-re.value.lastMouseX,{minX:n,maxX:i}=Zt.value,p=i-n||1,C=a*.8;re.value.offsetX+=C;const b=p/re.value.scale,z=p-b,N=0,$=-z/p*F.value.width,B=N;re.value.offsetX=Math.max($,Math.min(B,re.value.offsetX)),re.value.lastMouseX=t.clientX,re.value.lastMouseY=t.clientY}},sa=()=>{re.value.isDragging&&(re.value.isDragging=!1,setTimeout(()=>{!re.value.isDragging&&re.value.isZooming},100))},wa=(t,a)=>{const n=t.filter(b=>b!=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 b=1;b<n.length;b++){const z=n[b].x-n[b-1].x,N=n[b].y-n[b-1].y,$=Math.sqrt(z*z+N*N);p.push($),i+=$}const g=i*a;let C=0;for(let b=0;b<p.length;b++){const z=C+p[b];if(g<=z){const N=(g-C)/p[b],$=n[b],B=n[b+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",[ba(),{"dss-chart-fill-width":Ye.value,"dss-chart-fill-height":qe.value,"dss-chart-compact":hn.value&&!G.value}]]),style:e.normalizeStyle({width:Ye.value?"100%":Se.value+"px",height:We.value,...Ye.value||qe.value?{overflow:hn.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...ka.value,cursor:qo()}),"data-chart-type":we.value,ref_key:"containerEl",ref:P,onWheel:bo,onMousedown:lo,onMousemove:Yn,onMouseup:wo,onMouseleave:cl,onDblclick:oo,onContextmenu:e.withModifiers(Ll,["prevent"]),onClick:e.withModifiers(Tn,["left"]),onWheelCapture:bo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:pe},[e.createElementVNode("div",vs,[rt.value?(e.openBlock(),e.createElementBlock("div",gs,e.toDisplayString(rt.value),1)):e.createCommentVNode("",!0),Et.value?(e.openBlock(),e.createElementBlock("div",hs,e.toDisplayString(Et.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":_e.value==="horizontal","dss-legend-vertical":_e.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":lt.value.has(i),"dss-legend-hovered":ie.value===i,"dss-legend-dimmed":ie.value!==null&&ie.value!==i}]),onClick:p=>jo(i),onMouseenter:p=>el(i),onMouseleave:on,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":lt.value.has(i),"dss-legend-hovered":ie.value===i,"dss-legend-dimmed":ie.value!==null&&ie.value!==i}]),onClick:p=>jo(i),onMouseenter:p=>el(i),onMouseleave:on,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&&$t.value&&it.value.addMarker&&(xn.value||jt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:ko,title:e.unref(M)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Jn.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&&Rt.value?(e.openBlock(),e.createElementBlock("div",Ss,"Bubble size: "+e.toDisplayString(Rt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Se.value,height:K.value,class:"dss-chart-svg","data-smooth":ke.value,"data-animated":Vt.value,ref_key:"svgEl",ref:A},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:X.value},[e.createElementVNode("rect",{x:0,y:F.value.top,width:Se.value,height:F.value.height*4},null,8,Bs)],8,Ns),Rn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Zl.value},[e.createElementVNode("path",{d:hl.value},null,8,_s)],8,Ms)):e.createCommentVNode("",!0),jn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:Vl.value},[e.createElementVNode("path",{d:Fl.value},null,8,Ls)],8,$s)):e.createCommentVNode("",!0)]),xn.value||jt.value?(e.openBlock(),e.createElementBlock("g",Ts,[Pt.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":de.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Mo.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,Ds))),128))],8,As)):e.createCommentVNode("",!0),e.createElementVNode("g",Hs,[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,Rs),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,Fs),An.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,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)),An.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),Qt.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(Qt.value),9,qs)):e.createCommentVNode("",!0),It.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(It.value),9,Zs)):e.createCommentVNode("",!0),An.value&&me.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:Se.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, ${Se.value-15}, ${F.value.top+F.value.height/2})`},e.toDisplayString(me.value),9,Us)):e.createCommentVNode("",!0)]),fl.value.length>0?(e.openBlock(),e.createElementBlock("g",Xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fl.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",{"clip-path":de.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=>vo(n,i),onMouseleave:go},null,40,js)):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=>vo(n,i),onMouseleave:go},null,40,Ks)):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=>vo(n,i),onMouseleave:go},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,F.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,Qs)):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=>vo(n,i),onMouseleave:go},null,40,Js),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,er)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":de.value},[On.value?(e.openBlock(),e.createElementBlock("g",nr,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":Gt.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ne.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=>Ml(n,p),onMouseleave:ml},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=>Ml(n,p),onMouseleave:ml},null,46,or))],64))),128))],2),e.createElementVNode("g",ar,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Be.value+2:Be.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?Be.value+2:Be.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)),St.value>0||le.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:Y(n.isHighlighted?U(n,St.value)+2:U(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=>Ml(n,p),onMouseleave:ml},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":Be.value,"stroke-dasharray":n.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Ht.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(y.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Be.value+2:Be.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?Be.value+2:Be.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)),St.value>0||le.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:Y(n.isHighlighted?U(n,St.value)+2:U(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=>Ml(n,p),onMouseleave:ml},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(Oe.value,(n,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${T.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,gr)],8,vr))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?ge.value+.2:ge.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(Oe.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?Be.value+1:Be.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*Z.value}ms`})},null,14,yr))),128))])):we.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":Gt.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ne.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=>Ml(n,p),onMouseleave:ml},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=>Ml(n,p),onMouseleave:ml},null,46,Cr))],64))),128))],2)):e.createCommentVNode("",!0)],8,tr),Qe.value&&Fe.value.show&&!re.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":de.value},[e.createElementVNode("line",{x1:Fe.value.x,x2:Fe.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,wr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:Fe.value.x,cy:n.y,r:Y(St.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:Y(n.radius),fill:n.color,"fill-opacity":ln(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(cn(n,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>Wn(n,p),onMouseleave:p=>mo(n),onClick:p=>rn(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:pn(n)}),onLoad:p=>So(i),onError:p=>so(i),onMouseenter:p=>Wn(n,p),onMouseleave:p=>mo(n),onClick:p=>rn(n,p)},null,46,Nr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),hn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:tn.value},[we.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Dt.value,cy:wt.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":xo.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yn.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=>Ml(n.segment,p),onMouseleave:ml},null,42,$r))),128))],8,_r),_n.value&&Qo.value?(e.openBlock(),e.createElementBlock("g",Lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ol.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),rl.value&&(Qo.value||Rn.value||Hl.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:Nn.value.x,y:Nn.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Hn.value,fill:wl.value,class:"dss-radial-data-center"},e.toDisplayString(vn.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":Ao.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.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":zn.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,Rr)],6))),128))],2)):e.createCommentVNode("",!0)],8,Br)):e.createCommentVNode("",!0),Mn.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:tn.value},[Pt.value?(e.openBlock(),e.createElementBlock("g",Ir,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:Dt.value,cy:wt.value,r:Y(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(xe.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:Dt.value-16,y:wt.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Or),e.createElementVNode("text",{x:Dt.value,y:wt.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Nt(i)),9,Wr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(po.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:Dt.value,x2:n.x,y1:wt.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(Yl.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:n.x+Math.cos(i*2*Math.PI/Cl.value-Math.PI/2)*16,y:n.y+Math.sin(i*2*Math.PI/Cl.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:ml},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qn.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":al("current",n,i),stroke:n.color,"stroke-width":n.isHighlighted?Be.value+1:Be.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*Z.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:Y(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*Z.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>Ml(p,C),onMouseleave:ml},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(Lo.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:n.x,cy:n.y,r:Y(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(Lo.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))]),W.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Se.value+"px",height:K.value+"px",backgroundImage:`url('${Vn.value}')`,backgroundRepeat:"no-repeat",...mt.value,opacity:I.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:Sn.value+"px",height:Sn.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>Mt(n),["stop"]),onMouseenter:p=>_o(n,p),onMouseleave:Yo},[e.createElementVNode("img",{src:In(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,Fn.value]])),128)),gn.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:gn.value.x+"px",top:gn.value.y+"px"})},[e.createElementVNode("div",ei,e.toDisplayString(gn.value.categoryValue),1),gn.value.description?(e.openBlock(),e.createElementBlock("div",ti,e.toDisplayString(gn.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),je.value&&(ht.value.show||Qe.value&&Fe.value.show&&!re.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Qe.value&&Fe.value.show&&!re.value.isZooming,"dss-spider-tooltip":Mn.value&&ht.value.spiderAreas&&ht.value.spiderAreas.length>0}]),style:e.normalizeStyle(ga.value)},[!Qe.value||!Fe.value.show||re.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Mn.value&&ht.value.spiderAreas&&ht.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",ni,[(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",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&&ht.value.bubbleData&&ht.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",si,[ht.value.title?(e.openBlock(),e.createElementBlock("div",ri,e.toDisplayString(ht.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ii,[(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",ci,[e.createElementVNode("div",ui,e.toDisplayString(ht.value.title),1),e.createElementVNode("div",di,e.toDisplayString(ht.value.value),1)])),ht.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[pt(ht.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(pt(ht.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),pt(ht.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(pt(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",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?dl():T.categories[Fe.value.categoryIndex]||`Category ${Fe.value.categoryIndex+1}`),1),jt.value?(e.openBlock(),e.createElementBlock("div",Ei,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe.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(Fe.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(Xt(n.value)),1)]))),128))]),pt(Fe.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(pt(Fe.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),pt(Fe.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(pt(Fe.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),xn.value&&tt.value&&re.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:oo},[a[9]||(a[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(re.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":_e.value==="horizontal","dss-legend-vertical":_e.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":lt.value.has(i),"dss-legend-hovered":ie.value===i,"dss-legend-dimmed":ie.value!==null&&ie.value!==i}]),onClick:p=>jo(i),onMouseenter:p=>el(i),onMouseleave:on,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),bt.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:bt.value.x+"px",top:bt.value.y+"px"}),onClick:a[0]||(a[0]=e.withModifiers(()=>{},["stop"]))},[it.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Wo},e.toDisplayString(e.unref(M)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),it.value.addMarker&&(it.value.downloadSvg||it.value.downloadPng||it.value.downloadCsv||Ct.value.length>0)?(e.openBlock(),e.createElementBlock("div",Ii)):e.createCommentVNode("",!0),it.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Po},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),it.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:ho},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),it.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:yo},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Ct.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[it.value.downloadSvg||it.value.downloadPng||it.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",zi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ct.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(Wl(n)),style:e.normalizeStyle(tl(n)),onClick:p=>Oo(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:wn(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),De.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:O},[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(en.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:O},"×")]),e.createElementVNode("div",Ui,[e.createElementVNode("div",Xi,[e.createVNode(ea,{id:"dss-marker-date",mode:"single",modelValue:De.value.date,"onUpdate:modelValue":a[1]||(a[1]=n=>De.value.date=n),"min-date":El.value,"max-date":$l.value,disabled:en.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),en.value?(e.openBlock(),e.createElementBlock("div",Ki,e.toDisplayString(De.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":a[2]||(a[2]=n=>De.value.description=n),placeholder:e.unref(M)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Gi)),[[e.vModelText,De.value.description]])])]),e.createElementVNode("div",Qi,[e.createElementVNode("div",Ji,[bn.value&&!en.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:ue},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:O},e.toDisplayString(en.value?e.unref(M)("chart.modalMarker.close"):e.unref(M)("chart.modalMarker.cancel")),1),en.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:x,disabled:!(De.value.description&&De.value.description.length)},e.toDisplayString(bn.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:oe}){const M=T,L=oe,fe=e.ref(null),P=e.ref(null),A=e.computed(()=>{const X={"max-width":M.width};return M.height!=="auto"&&(X.height=M.height,X["min-height"]="0"),X}),pe=e.computed(()=>({}));function ft(){L("close-modal")}function ee(){M.backDrop&&!fe.value&&L("close-modal")}function f(X){X.target.tagName==="INPUT"&&(fe.value=X.target.tagName)}function be(){setTimeout(()=>{fe.value=null},300)}function Ce(){const X=document.body,de=document.documentElement;P.value={bodyOverflow:X.style.overflow,bodyPosition:X.style.position,bodyTop:X.style.top,bodyWidth:X.style.width,htmlOverflow:de.style.overflow,scrollY:window.scrollY},X.style.overflow="hidden",X.style.position="fixed",X.style.top=`-${P.value.scrollY}px`,X.style.width="100%",X.style.left="0",de.style.overflow="hidden"}function Q(){if(!P.value)return;const X=document.body,de=document.documentElement,{bodyOverflow:H,bodyPosition:Ee,bodyTop:Ie,bodyWidth:ot,htmlOverflow:vt,scrollY:q}=P.value;X.style.overflow=H||"",X.style.position=Ee||"",X.style.top=Ie||"",X.style.width=ot||"",X.style.left="",de.style.overflow=vt||"",window.scrollTo(0,q||0)}return e.watch(()=>M.showModal,X=>{if(X)Ce(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const de=document.getElementById("dss-modal-backdrop");de&&(de.addEventListener("focusin",f),de.addEventListener("focusout",be))},100);else{Q(),document.body.classList.remove("dss-modal-open");const de=document.getElementById("dss-modal-backdrop");de&&(de.removeEventListener("focusin",f),de.removeEventListener("focusout",be))}},{immediate:!0}),e.onUnmounted(()=>{M.showModal&&Q()}),(X,de)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.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(A.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:de[0]||(de[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(X.$slots,"title",{},()=>[de[1]||(de[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(X.$slots,"title-data"),T.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:ft,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(pe.value)},[e.renderSlot(X.$slots,"content",{},()=>[de[2]||(de[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",ac,[e.renderSlot(X.$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}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(T,{emit:oe}){const{t:M,locale:L}=Gl.useI18n(),fe=T,P=oe,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 pe(k,h){const x=Object.assign({},k);return ft(k)&&ft(h)&&Object.keys(h).forEach(O=>{ft(h[O])?O in k?x[O]=pe(k[O],h[O]):Object.assign(x,{[O]:h[O]}):Object.assign(x,{[O]:h[O]})}),x}function ft(k){return k&&typeof k=="object"&&!Array.isArray(k)}const ee=e.computed(()=>pe(A,fe.options)),f=e.computed(()=>{const k=ee.value.table.width;return k==="auto"?null:typeof k=="number"?k:null}),be=e.computed(()=>ee.value.table.height),Ce=e.computed(()=>ee.value.table.rowHeight??"auto"),Q=e.computed(()=>({height:Ce.value})),X=e.computed(()=>ee.value.table.expandable===!0),de=e.computed(()=>ee.value.table.expandableRowData??null),H=e.computed(()=>ee.value.table.expandableRowCondition??null),Ee=e.computed(()=>ee.value.table.truncated===!0),Ie=e.computed(()=>ee.value.table.striped),ot=e.computed(()=>ee.value.table.bordered),vt=e.computed(()=>ee.value.table.hoverable),q=e.computed(()=>ee.value.table.size),Ye=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),Se=e.computed(()=>ee.value.selection.mode),$e=e.computed(()=>ee.value.selection.rowCondition??null),Ge=e.computed(()=>ee.value.sorting.enabled),K=e.computed(()=>ee.value.sorting.mode),We=e.computed(()=>ee.value.pagination.enabled),we=e.computed(()=>ee.value.pagination.rows),ct=e.computed(()=>ee.value.pagination.rowsPerPageOptions),rt=e.computed(()=>ee.value.pagination.showCounter!==!1),Et=e.computed(()=>ee.value.pagination.showControlsGroup),Rt=e.computed(()=>Et.value===!1?!1:ee.value.pagination.showControls!==!1),Qt=e.computed(()=>Et.value===!1?!1:ee.value.pagination.showRowsPerPage!==!1),It=e.computed(()=>We.value&&(rt.value||Rt.value||Qt.value)),ae=e.computed(()=>ee.value.scrollable),me=e.computed(()=>ee.value.emptyMessage||M("table.emptyMessage")),Pe=e.computed(()=>ee.value.toolbar?.downloads?.pdf!==!1),Re=e.computed(()=>ee.value.toolbar?.downloads?.excel!==!1),Wt=e.computed(()=>ee.value.toolbar?.search!==!1),kt=e.computed(()=>Pe.value||Re.value||Wt.value||qt.value),qt=e.computed(()=>ee.value.toolbar?.columnVisibility!==!1),Bt=e.ref(""),Pt=e.ref(!1),G=e.ref(null);let he=null;function _e(){Pt.value?(he&&(clearTimeout(he),he=null),Pt.value=!1,Bt.value="",P("search",""),G.value?.blur()):(Pt.value=!0,he=setTimeout(()=>{he=null,G.value?.focus()},80))}function je(){Bt.value||(Pt.value=!1)}function Qe(){Bt.value="",P("search",""),G.value?.focus()}const Lt=e.computed(()=>({"dss-table-striped":Ie.value,"dss-table-bordered":ot.value,"dss-table-hoverable":vt.value,[`dss-table-${q.value}`]:q.value!=="default","dss-table-truncated":Ee.value})),tt=(k,h)=>k?.field??k?.key??h,Tt=e.ref(new Set);function Xe(){const k=new Set;fe.columns.forEach((h,x)=>{h?.hidden!==!0&&k.add(tt(h,x))}),Tt.value=k}const Be=e.computed(()=>fe.columns.filter((k,h)=>Tt.value.has(tt(k,h)))),Je=k=>{const h=fe.columns.findIndex(x=>x===k);return tt(k,h>=0?h:0)},St=(k,h)=>Tt.value.has(tt(k,h));function le(k,h){const x=tt(k,h),O=new Set(Tt.value);O.has(x)?O.delete(x):O.add(x),Tt.value=O}const U=e.ref(null),Y=e.ref(!1);function ge(k){U.value&&!U.value.contains(k.target)&&(Y.value=!1)}const ke=e.computed(()=>Be.value.length+(qe.value?1:0)+(X.value?1:0)),Le=(k,h)=>k?.id??k?.key??h,xt=e.ref(new Set),Jt=e.ref(null),Vt=(k,h)=>xt.value.has(Le(k,h)),Ut=(k,h)=>{if(!X.value)return!1;if(typeof H.value=="function")return!!H.value(k,h);if(typeof de.value=="string"&&de.value.trim()){const x=In(k,de.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},V=(k,h,x)=>{if(x&&x.stopPropagation(),!Ut(k,h))return;const O=Le(k,h),ue=new Set(xt.value);ue.has(O)?(ue.delete(O),P("row-collapse",{data:k,index:h})):(ue.add(O),P("row-expand",{data:k,index:h})),xt.value=ue},w=(k,h)=>{if(!Ee.value)return;const x=Le(k,h);Jt.value!==x&&(Jt.value=x)},S=e.ref(null),Z=e.ref(0),J=e.ref([]),Ze=k=>{if(K.value==="single")return S.value===k.field?Z.value:0;{const h=J.value.find(x=>x.field===k.field);return h?h.order:0}},gt=k=>{const h=Ze(k);return{"dss-sort-active":h!==0,"dss-sort-asc":h===1,"dss-sort-desc":h===-1}},nt=e.ref({}),xe=e.ref(null),Nt=e.ref(null),zt=220,$t=e.ref(null),it=e.computed(()=>Be.value.find(k=>Je(k)===xe.value)??null),Ct=e.computed(()=>{if(!it.value||it.value.filter!=="range")return null;const k=it.value,h=xe.value,{min:x,max:O}=at(k),ue=k.filterMin??x,yt=k.filterMax??O,Mt=un(h),Yt=Mt.min??ue,an=Mt.max??yt,nn=yt-ue,sn=nn===0?0:(Yt-ue)/nn*100,Pn=nn===0?100:(an-ue)/nn*100;return{rangeMin:ue,rangeMax:yt,currentMin:Yt,currentMax:an,minPct:sn,maxPct:Pn}}),Jn=e.ref(null),Xn=e.ref("max");function Sn(k){const h=Jn.value,x=Ct.value;if(!h||!x)return;const O=h.getBoundingClientRect(),yt=(k.clientX-O.left)/O.width*100,Mt=(x.minPct+x.maxPct)/2;Xn.value=yt<Mt?"min":"max"}function un(k){return nt.value[k]??{}}function Xt(k,h){nt.value={...nt.value,[k]:h}}function Fn(k){const h=nt.value[k];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 sl(k){const h={...nt.value};delete h[k],nt.value=h,xe.value=null,Nt.value=null}function R(){if(!xe.value){Nt.value=null;return}const k=$t.value;if(!k)return;const h=k.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${xe.value}"]`);if(!h)return;const x=h.getBoundingClientRect();Nt.value={top:x.bottom+6,left:Math.max(8,x.right-zt)}}const W=e.computed(()=>{const k=String(Bt.value??"").trim().toLowerCase();return k?fe.data.filter(h=>Be.value.some(x=>ne(tl(h,x)).some(ue=>String(ue).toLowerCase().includes(k)))):fe.data}),I=e.computed(()=>{let k=[...W.value];const h=(Bt.value??"").trim().toLowerCase();return h&&(k=k.filter(x=>fe.columns.some(O=>{if(!O||!O.field)return!1;const ue=tl(x,O);return String(ue??"").toLowerCase().includes(h)}))),Be.value.forEach(x=>{const O=Je(x),ue=nt.value[O];if(!ue)return;const yt=x.field;if(yt){if(ue.type==="string"&&ue.value?.trim()){const Mt=ue.value.trim().toLowerCase();k=k.filter(Yt=>{const an=tl(Yt,x);return String(an??"").toLowerCase().includes(Mt)})}else if(ue.type==="range")k=k.filter(Mt=>{const Yt=In(Mt,yt),an=Number(Yt);return!(Number.isNaN(an)||ue.min!=null&&an<ue.min||ue.max!=null&&an>ue.max)});else if(ue.type==="dateRange"){const Mt=ue.from?new Date(ue.from).getTime():null,Yt=ue.to?new Date(ue.to).getTime():null;k=k.filter(an=>{const nn=In(an,yt),sn=nn?new Date(nn).getTime():NaN;return!(Number.isNaN(sn)||Mt!=null&&sn<Mt||Yt!=null&&sn>Yt)})}else if(ue.type==="list"&&ue.selected?.length){const Mt=new Set(ue.selected);k=k.filter(Yt=>ne(tl(Yt,x)).some(nn=>Mt.has(nn)))}}}),k});function ne(k){if(k==null)return[""];if(Array.isArray(k))return k.flatMap(ne);if(typeof k=="object"){const h=k?.label??k?.name??k?.value??k?.title;return[h!=null?String(h):String(k)]}return[String(k)]}function Ae(k){const h=new Set;return fe.data.forEach(x=>{ne(tl(x,k)).forEach(ue=>h.add(ue))}),Array.from(h).sort((x,O)=>String(x).localeCompare(String(O)))}function dt(k,h){if(xe.value===k){xe.value=null,Nt.value=null;return}if(xe.value=k,h?.currentTarget){const x=h.currentTarget.getBoundingClientRect();Nt.value={top:x.bottom+6,left:Math.max(8,x.right-zt)}}else R()}function mt(k,h){Xt(k,{type:"string",value:h})}function at(k){const h=k.field;if(!h)return{min:0,max:100};let x=1/0,O=-1/0;return fe.data.forEach(ue=>{const yt=In(ue,h),Mt=Number(yt);Number.isNaN(Mt)||(x=Math.min(x,Mt),O=Math.max(O,Mt))}),{min:x===1/0?0:x,max:O===-1/0?100:O}}function pt(k,h,x){const O={...un(k),type:"range"},ue=x===""?null:Number(x),yt=ue===null||Number.isNaN(ue)?null:ue;O[h]=yt,yt!=null&&(h==="min"&&O.max!=null&&yt>O.max&&(O.max=yt),h==="max"&&O.min!=null&&yt<O.min&&(O.min=yt)),Xt(k,O)}function dn(k,h,x){const O={...un(k),type:"dateRange"};O[h]=x||"",Xt(k,O)}const Vn=e.reactive({});function Dn(k,h){Vn[k]=h}function zn(k){const h=Je(k),x=(Vn[h]??"").trim().toLowerCase(),O=Ae(k);return x?O.filter(ue=>String(ue).toLowerCase().includes(x)):O}function pl(k,h){return(un(k).selected??[]).includes(h!=null?String(h):"")}function _l(k,h){const O=[...un(k).selected??[]],ue=h!=null?String(h):"",yt=O.indexOf(ue);yt>=0?O.splice(yt,1):O.push(ue),Xt(k,{type:"list",selected:O})}function Pl(k){xe.value&&!k.target.closest(".dss-table-filter-wrap")&&!k.target.closest(".dss-table-filter-dropdown")&&(xe.value=null,Nt.value=null)}function _n(){R(),Nn.value&&vl()}const to=k=>{if(!(k.sortable===!1||!Ge.value))if(K.value==="single")S.value===k.field?Z.value=Z.value===1?-1:Z.value===-1?0:1:(S.value=k.field,Z.value=1),Z.value===0&&(S.value=null),P("sort",{field:S.value,order:Z.value});else{const h=J.value.findIndex(x=>x.field===k.field);h>=0?J.value[h].order===1?J.value[h].order=-1:J.value.splice(h,1):J.value.push({field:k.field,order:1}),P("sort",{multiSortMeta:J.value})}},rl=e.computed(()=>{if(!Ge.value)return I.value;let k=[...I.value];return K.value==="single"&&S.value&&Z.value!==0?k.sort((h,x)=>{const O=In(h,S.value),ue=In(x,S.value);return O===ue?0:O==null?1:ue==null?-1:(O<ue?-1:O>ue?1:0)*Z.value}):K.value==="multiple"&&J.value.length>0&&k.sort((h,x)=>{for(const O of J.value){const ue=In(h,O.field),yt=In(x,O.field);if(ue===yt)continue;if(ue==null)return 1;if(yt==null)return-1;const Mt=ue<yt?-1:ue>yt?1:0;if(Mt!==0)return Mt*O.order}return 0}),k}),vn=e.ref(0),Hn=e.ref(we.value),Nn=e.ref(!1),wl=e.ref(null),Ol=e.ref(null),fl=e.ref("bottom"),xl=e.ref(null),$n=k=>{Hn.value=k,Nn.value=!1,vn.value=0,P("page",{page:0,rows:Hn.value})};function Ln(k){wl.value&&!wl.value.contains(k.target)&&(Nn.value=!1)}function vl(){const k=wl.value,h=Ol.value;if(!k||!h)return;const x=k.querySelector(".dss-pagination-select-dropdown");if(!x)return;const O=h.getBoundingClientRect(),ue=x.offsetHeight||0,Mt=(window.innerHeight||document.documentElement.clientHeight)-O.bottom,Yt=O.top;fl.value=Mt<ue+8&&Yt>Mt?"top":"bottom",xl.value={width:`${Math.ceil(O.width)}px`,left:`${Math.max(0,Math.round(h.offsetLeft))}px`}}const lt=e.computed(()=>rl.value.length),ie=e.computed(()=>Math.ceil(lt.value/Hn.value)),il=e.computed(()=>Math.max(ie.value,1)),ht=e.computed(()=>lt.value===0?0:Fe.value+1),gn=e.computed(()=>bt.value),Fe=e.computed(()=>We.value?vn.value*Hn.value:0),bt=e.computed(()=>We.value?Math.min((vn.value+1)*Hn.value,lt.value):lt.value),re=e.computed(()=>{if(!We.value)return rl.value;const k=Fe.value,h=bt.value;return rl.value.slice(k,h)}),At=e.ref(new Set),De=e.computed(()=>rl.value.filter((k,h)=>At.value.has(Le(k,h)))),El=(k,h)=>{const x=$e.value;return typeof x!="function"?!0:!!x(k,h)},$l=e.computed(()=>rl.value.map((k,h)=>({row:k,index:h})).filter(({row:k,index:h})=>El(k,h))),bn=e.computed(()=>{const k=$l.value;return k.length===0?!1:k.every(({row:h,index:x})=>At.value.has(Le(h,x)))}),en=e.computed(()=>{const k=$l.value;if(k.length===0)return!1;const h=k.filter(({row:x,index:O})=>At.value.has(Le(x,O))).length;return h>0&&h<k.length}),el=(k,h)=>At.value.has(Le(k,h)),on=()=>{if(bn.value)At.value=new Set,P("unselect-all");else{const k=new Set;$l.value.forEach(({row:h,index:x})=>k.add(Le(h,x))),At.value=k,P("select-all",De.value)}},Yn=(k,h)=>{if(!El(k,h))return;const x=Le(k,h),O=new Set(At.value),ue=O.has(x);Se.value==="single"?ue?(O.delete(x),P("row-unselect",k)):(O.clear(),O.add(x),P("row-select",k)):ue?(O.delete(x),P("row-unselect",k)):(O.add(x),P("row-select",k)),At.value=O},cl=e.ref("1"),Ll=()=>{const k=Number.parseInt(String(cl.value),10);if(!Number.isFinite(k)){cl.value=String(vn.value+1);return}const h=Math.min(il.value,Math.max(1,k));h!==vn.value+1?Tn(h-1):cl.value=String(h)},Tn=k=>{k<0||k>=ie.value||(vn.value=k,P("page",{page:k,rows:Hn.value}))},wn=(k,h,x)=>{P("row-click",{data:k,index:h,originalEvent:x}),w(k,Fe.value+h)},Wl=(k,h)=>{const x=Fe.value+h;return{"dss-table-row-selected":el(k,x),"dss-table-row-even":h%2===0,"dss-table-row-odd":h%2!==0,"dss-table-row-truncated-clickable":Ee.value,"dss-table-row-truncated-expanded":Jt.value===Le(k,x)}},tl=(k,h)=>h.field?In(k,h.field):"",In=(k,h)=>h.split(".").reduce((x,O)=>x&&x[O],k),Tl=k=>{const h=k.align??Ye.value;return{"dss-table-sortable":k.sortable!==!1&&Ge.value,"dss-table-align-left":h==="left","dss-table-align-center":h==="center","dss-table-align-right":h==="right",[k.className]:k.className}},Al=k=>{const h={};return k.width&&(h.width=typeof k.width=="number"?`${k.width}px`:k.width),k.minWidth&&(h.minWidth=typeof k.minWidth=="number"?`${k.minWidth}px`:k.minWidth),k.maxWidth&&(h.maxWidth=typeof k.maxWidth=="number"?`${k.maxWidth}px`:k.maxWidth),h};return e.watch(()=>fe.locale,k=>{k&&k!==L.value&&(L.value=k)},{immediate:!0}),e.watch(we,k=>{Hn.value=k,vn.value=0}),e.watch(Nn,async k=>{k&&(await e.nextTick(),vl())}),e.watch(vn,k=>{cl.value=String(k+1)},{immediate:!0}),e.watch(Bt,k=>{P("search",k??"")}),e.watch(()=>fe.columns,()=>{Xe()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Ln),document.addEventListener("click",ge),document.addEventListener("click",Pl),window.addEventListener("resize",_n),window.addEventListener("scroll",_n,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Ln),document.removeEventListener("click",ge),document.removeEventListener("click",Pl),window.removeEventListener("resize",_n),window.removeEventListener("scroll",_n,!0)}),(k,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:$t,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,[Pe.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:h[0]||(h[0]=x=>P("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),Re.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:h[1]||(h[1]=x=>P("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),qt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:U},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Y.value}]),onClick:h[2]||(h[2]=x=>Y.value=!Y.value),"aria-expanded":Y.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,O)=>(e.openBlock(),e.createElementBlock("li",{key:tt(x,O),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:St(x,O),onChange:ue=>le(x,O),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,mc),St(x,O)?(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,Y.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",vc,[Wt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Pt.value||Bt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:G,"onUpdate:modelValue":h[4]||(h[4]=x=>Bt.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=>Pt.value=!0),onBlur:je},null,40,gc),[[e.vModelText,Bt.value]]),Bt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(M)("table.clearSearchAriaLabel"),onClick:Qe},[...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":Pt.value||!!Bt.value,onMousedown:e.withModifiers(_e,["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),k.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",kc,[e.renderSlot(k.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":ae.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Lt.value])},[e.createElementVNode("thead",Cc,[e.createElementVNode("tr",null,[qe.value?(e.openBlock(),e.createElementBlock("th",bc,[Se.value==="multiple"?(e.openBlock(),e.createElementBlock("span",wc,[e.createElementVNode("input",{type:"checkbox",checked:bn.value,indeterminate:en.value,onChange:on,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,xc),en.value?(e.openBlock(),e.createElementBlock("span",Ec)):bn.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),X.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(Be.value,(x,O)=>(e.openBlock(),e.createElementBlock("th",{key:Je(x),class:e.normalizeClass(["dss-table-th",Tl(x)]),style:e.normalizeStyle(Al(x)),onClick:ue=>to(x)},[e.createElementVNode("div",Bc,[e.createElementVNode("span",Mc,e.toDisplayString(x.header),1),x.sortable!==!1&&Ge.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",gt(x)])},[Ze(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)])])):Ze(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)])])):Ze(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":xe.value===Je(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":Fn(Je(x))}]),"data-filter-column-key":Je(x),"aria-expanded":xe.value===Je(x),"aria-label":e.unref(M)("table.filterColumnAriaLabel"),onClick:ue=>dt(Je(x),ue)},[...h[32]||(h[32]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,Tc)],2)):e.createCommentVNode("",!0)])],14,Nc))),128))])]),e.createElementVNode("tbody",Ac,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,(x,O)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Le(x,Fe.value+O)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Wl(x,O)]),style:e.normalizeStyle(Q.value),onClick:ue=>wn(x,O,ue)},[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",Hc,[e.createElementVNode("input",{type:Se.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${T.tableId}`,checked:el(x,Fe.value+O),disabled:!El(x,Fe.value+O),onChange:ue=>Yn(x,Fe.value+O),class:e.normalizeClass(["dss-table-checkbox",Se.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!El(x,Fe.value+O)}])},null,42,Rc),Se.value==="multiple"&&el(x,Fe.value+O)?(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)])])):Se.value==="single"&&el(x,Fe.value+O)?(e.openBlock(),e.createElementBlock("span",Ic)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(ue=>V(x,Fe.value+O,ue),["stop"])},[Ut(x,Fe.value+O)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":Vt(x,Fe.value+O),"aria-label":Vt(x,Fe.value+O)?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":Vt(x,Fe.value+O)}]),"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(Be.value,(ue,yt)=>(e.openBlock(),e.createElementBlock("td",{key:Je(ue),class:e.normalizeClass(["dss-table-td",Tl(ue)]),style:e.normalizeStyle(Al(ue))},[e.renderSlot(k.$slots,`cell-${ue.field}`,{data:x,column:ue,rowIndex:O,isExpanded:Jt.value===Le(x,Fe.value+O)},()=>[e.createTextVNode(e.toDisplayString(tl(x,ue)),1)])],6))),128))],14,Dc),X.value&&Ut(x,Fe.value+O)&&Vt(x,Fe.value+O)?(e.openBlock(),e.createElementBlock("tr",Wc,[e.createElementVNode("td",{colspan:ke.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(k.$slots,"expansion",{data:x,rowIndex:O})],8,qc)])):e.createCommentVNode("",!0)],64))),128)),re.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:ke.value,class:"dss-table-empty-cell"},[e.renderSlot(k.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(me.value),1)])],8,Zc)],4))])],2)],2),It.value?(e.openBlock(),e.createElementBlock("div",Uc,[e.createElementVNode("div",Xc,[rt.value?(e.openBlock(),e.createElementBlock("span",Yc,e.toDisplayString(e.unref(M)("table.showingRange",{start:ht.value,end:gn.value,total:lt.value})),1)):(e.openBlock(),e.createElementBlock("span",jc," "))]),e.createElementVNode("div",Kc,[Rt.value?(e.openBlock(),e.createElementBlock("div",Gc,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:vn.value===0,onClick:h[8]||(h[8]=x=>Tn(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:vn.value===0,onClick:h[9]||(h[9]=x=>Tn(vn.value-1)),title:e.unref(M)("table.previousPage")}," ‹ ",8,Jc),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[10]||(h[10]=x=>cl.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(M)("table.currentPageAriaLabel"),onBlur:Ll,onKeydown:e.withKeys(e.withModifiers(Ll,["prevent"]),["enter"])},null,40,eu),[[e.vModelText,cl.value]]),e.createElementVNode("span",tu,e.toDisplayString(e.unref(M)("table.ofPages",{total:il.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:vn.value>=ie.value-1,onClick:h[11]||(h[11]=x=>Tn(vn.value+1)),title:e.unref(M)("table.nextPage")}," › ",8,nu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:vn.value>=ie.value-1,onClick:h[12]||(h[12]=x=>Tn(ie.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,[Qt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:wl},[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":Nn.value}]),onClick:h[13]||(h[13]=x=>Nn.value=!Nn.value),"aria-expanded":Nn.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:Ol},[e.createTextVNode(e.toDisplayString(Hn.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":fl.value==="top"}]),style:e.normalizeStyle(xl.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ct.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===Hn.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===Hn.value}]),onClick:O=>$n(x)},e.toDisplayString(x),11,ru))),128))],6),[[e.vShow,Nn.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(Nt.value?{top:Nt.value.top+"px",left:Nt.value.left+"px",width:zt+"px"}:void 0),onClick:h[21]||(h[21]=e.withModifiers(()=>{},["stop"]))},[it.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[it.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",iu,[e.createElementVNode("input",{type:"text",value:un(xe.value).value??"",onInput:h[14]||(h[14]=x=>mt(xe.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(M)("table.search")},null,40,cu)])):it.value.filter==="range"&&Ct.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Ct.value.minPct+"%","--range-max-pct":Ct.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Jn,class:"dss-table-filter-double-range-track",onMousemove:Sn,onMouseenter:Sn},[e.createElementVNode("input",{type:"range",min:Ct.value.rangeMin,max:Ct.value.rangeMax,value:Ct.value.currentMin,onInput:h[15]||(h[15]=x=>pt(xe.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:Xn.value==="min"?2:1})},null,44,uu),e.createElementVNode("input",{type:"range",min:Ct.value.rangeMin,max:Ct.value.rangeMax,value:Ct.value.currentMax,onInput:h[16]||(h[16]=x=>pt(xe.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:Xn.value==="max"?2:1})},null,44,du)],544),e.createElementVNode("div",mu,e.toDisplayString(Ct.value.currentMin)+" – "+e.toDisplayString(Ct.value.currentMax),1)],4)):it.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:un(xe.value).from??"",onInput:h[17]||(h[17]=x=>dn(xe.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:un(xe.value).to??"",onInput:h[18]||(h[18]=x=>dn(xe.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,ku)])])):it.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:Vn[xe.value]??"",onInput:h[19]||(h[19]=x=>Dn(xe.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(zn(it.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:pl(xe.value,x),onChange:O=>_l(xe.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=>sl(xe.value))},e.toDisplayString(e.unref(M)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,xe.value&&it.value&&Nt.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:oe,emit:M}){const{t:L,locale:fe}=Gl.useI18n(),P={h1:Vu,h2:Nu,h3:Bu,h4:Mu,h5:_u,h6:$u},A=T,pe=M,ft=e.useSlots(),ee=`<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),X=e.ref(!1),de=e.ref(""),H=e.ref({}),Ee=e.ref(!1),Ie=e.ref(!1),ot=e.ref(""),vt=e.ref(""),q=e.ref(null),Ye=e.ref(null),qe=e.ref(null),Se=e.ref(null),$e=e.ref(""),Ge=e.ref(!1),K=e.ref({}),We=e.ref(!1),we=e.ref({}),ct=e.ref(null),rt=e.ref(null),Et=e.ref(!1),Rt=e.ref(""),Qt=e.ref(null),It=e.ref(""),ae=e.ref(""),me=e.ref(""),Pe=e.ref(null),Re=e.ref(null),Wt=e.ref(null),kt=e.ref(null),qt=e.ref(null),Bt=e.ref(!1),Pt=e.ref(""),G=e.ref({}),he=e.ref(!1),_e=e.ref("upload"),je=e.ref(""),Qe=e.ref(null),Lt=e.ref(null),tt=e.ref([]),Tt=e.ref([]),Xe=e.ref(null),Be=e.ref(!1),Je=e.ref(""),St=e.ref(""),le=e.ref(""),U=e.ref(""),Y=e.ref(""),ge=e.ref(""),ke=e.ref(null),Le=e.ref(null),xt=e.ref(null),Jt=e.ref(!1),Vt=e.ref(null),Ut=e.ref(!1),V=e.ref(!1),w=e.ref(null),S=e.ref("p"),Z=e.ref(!1),J=e.ref([]),Ze=e.ref(null),gt=e.ref(null),nt=e.ref(null),xe=e.ref(!1),Nt=e.ref(0),zt=100,$t=e.ref(null),it=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":O.value!==null})),Ct=e.computed(()=>({})),Jn=e.computed(()=>!A.fixedHeight||A.fullHeight?{}:{height:`${1.6*14*A.rows+24+2}px`,resize:"none",overflowY:"auto"}),Xn=e.computed(()=>!A.fixedHeight||A.fullHeight?{}:{height:`${1.6*14*A.rows+32}px`,overflowY:"auto"}),Sn=e.computed(()=>A.richText&&Tt.value.length>0),un=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(/ /g," "),o=o.replace(/&/g,"&"),o=o.replace(/</g,"<"),o=o.replace(/>/g,">"),o=o.replace(/"/g,'"'),o=o.replace(/'/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return A.modelValue}),Xt=e.computed(()=>{const o=un.value.trim();return o?o.split(/\s+/).filter(l=>l.length>0).length:0}),Fn=e.computed(()=>un.value.length),sl=e.computed(()=>kt.value!==null&&_e.value==="upload"&&It.value&&It.value.startsWith("data:")),R=e.computed(()=>A.titlePlaceholder||L("textEditor.placeholders.title")),W=e.computed(()=>A.descriptionPlaceholder||L("textEditor.placeholders.description")),I=e.computed(()=>A.placeholder||L("textEditor.placeholders.startTyping")),ne=o=>ft&&ft[o]!==void 0,Ae=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)&&mt(s))return!0}return!1},mt=o=>A.customToolbarFloatingMap.hasOwnProperty(o)?A.customToolbarFloatingMap[o]===!0:!0,at=e.computed(()=>A.customToolbarSlots.some(o=>ne(o)&&mt(o))),pt=e.computed(()=>ne("title-slot")),dn=e.computed(()=>ne("description-slot")),Vn=o=>{if(!o||o.trim()==="")return"<html></html>";const l=o.trim();return l.startsWith("<html>")&&l.endsWith("</html>")?o:`<html>${o}</html>`},Dn=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},zn=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())},pl=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""}},_l=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;pe("update:modelValue",l),pe("change",l)},_n=()=>{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")},to=()=>{Ut.value=!0,_n()},rl=()=>{Ut.value=!1,vn()},vn=()=>{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")},Hn=o=>{const s=o.target.value;Ut.value&&_n(),pe("update:title",s),pe("title-change",s),xt.value="title",A.richText&&(Be.value||(St.value=Je.value,Y.value=le.value,ge.value=U.value),Xe.value&&clearTimeout(Xe.value),Be.value=!0,Xe.value=setTimeout(()=>{Be.value=!1,lt()},500))},Nn=()=>{if(!Le.value)return;const o=Le.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")},wl=()=>{V.value=!0,Nn()},Ol=()=>{V.value=!1,fl()},fl=()=>{if(!Le.value)return;const o=Le.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")},xl=o=>{const s=o.target.value;V.value&&Nn(),pe("update:description",s),pe("description-change",s),xt.value="description",A.richText&&(Be.value||(St.value=Je.value,Y.value=le.value,ge.value=U.value),Xe.value&&clearTimeout(Xe.value),Be.value=!0,Xe.value=setTimeout(()=>{Be.value=!1,lt()},500))},$n=()=>{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}},Ln=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()}},vl=()=>{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)},lt=(o=!1)=>{if(!f.value)return;const l=f.value.innerHTML,s=A.title||"",r=A.description||"";if(!o&&l===Je.value&&s===le.value&&r===U.value)return;const c={content:St.value||Je.value,title:Y.value!==void 0?Y.value:le.value,description:ge.value!==void 0?ge.value:U.value},d=tt.value.length>0?tt.value[tt.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&&(tt.value.push(c),tt.value.length>50&&tt.value.shift(),Tt.value=[]),Je.value=l,le.value=s,U.value=r,St.value=l,Y.value=s,ge.value=r},ie=o=>{if(!f.value)return;il(),f.value&&zn(f.value);let l=null;f.value&&(f.value.querySelector("p")||(l=$n(),ht()));const s=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");s&&w.value&&(w.value=null),Q.value=!0;const r=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=Vn(r);pe("update:modelValue",c),pe("change",c),xt.value="editor",Be.value||(St.value=Je.value,Y.value=le.value,ge.value=U.value),Xe.value&&clearTimeout(Xe.value),Be.value=!0,Xe.value=setTimeout(()=>{Be.value=!1,lt(),Ul(),So()},500),e.nextTick(()=>{l&&Ln(l),il();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,v=m&&m.collapsed;if(d.forEach(y=>{try{if(v&&w.value?.command===y){K.value[y]=w.value.state;return}if(y==="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 se=window.getComputedStyle(D);parseInt(se.fontWeight)>=600&&(E=!0)}catch{}K.value[y]=E}else K.value.hasOwnProperty(y)||(K.value[y]=!1);else if(y==="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[y]=!!E}else{const _=document.queryCommandState(y);K.value[y]=_}else{const _=document.queryCommandState(y);K.value[y]=_}}catch{}}),k(),gn(),De(),tn(),wt(),kn("handleRichTextInput"),s&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const y=o.data||"";y&&y.length===1&&setTimeout(()=>So(y),0),(y===" "||y===`
|
|
101
|
-
`||/[.,;:!?]/.test(y))&&setTimeout(()=>{Ul()},100)}Q.value=!1})},il=()=>{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)}})},gn=()=>{if(f.value&&!Jt.value){Jt.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 y=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),_=c===d||c===y;(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 y=m.querySelector(".dss-image-no-alt-icon");y&&y.remove()}else{const y=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;y&&y.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 y=document.createElement("div");y.className="dss-image-no-alt-icon",y.setAttribute("contenteditable","false"),y.innerHTML=ee,m.appendChild(y)}else if(v&&m.children.length===1){const y=m.parentNode;y.insertBefore(r,m),y.removeChild(m)}})}finally{Jt.value=!1}}},Fe=o=>{Ul(),pe("blur",o),Rl()},bt=()=>{if(A.disabled||!A.richText||!f.value)return;on(),Xe.value&&(clearTimeout(Xe.value),Xe.value=null),Be.value&&(lt(),Be.value=!1);const o=xt.value==="title",l=xt.value==="description",s=xt.value==="editor";if(tt.value.length===0){o&&ke.value?ke.value.focus():l&&Le.value?Le.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{ie()});return}const r={content:f.value.innerHTML,title:A.title||"",description:A.description||""};Tt.value.push(r);const c=tt.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,Je.value=d,le.value=u,U.value=m,St.value=d,Y.value=u,ge.value=m,e.nextTick(()=>{k(),wn(),ut(),tn();const v=Vn(d);pe("update:modelValue",v),pe("update:title",u),pe("update:description",m),pe("change",v),pe("title-change",u),pe("description-change",m),Q.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(ke.value){ke.value.focus();const y=u.length;ke.value.setSelectionRange&&ke.value.setSelectionRange(y,y),_n()}}else if(l){if(Le.value){Le.value.focus();const y=m.length;Le.value.setSelectionRange(y,y)}}else if(s)vl();else if(ke.value&&document.activeElement===ke.value){const y=u.length;ke.value.setSelectionRange&&ke.value.setSelectionRange(y,y),_n()}else if(Le.value&&document.activeElement===Le.value){const y=m.length;Le.value.setSelectionRange(y,y)}else f.value&&vl()},10)})})}},re=()=>{if(A.disabled||!A.richText||!f.value)return;on();const o=xt.value==="title",l=xt.value==="description",s=xt.value==="editor";if(Tt.value.length===0){o&&ke.value?ke.value.focus():l&&Le.value?Le.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{ie()});return}const r={content:f.value.innerHTML,title:A.title||"",description:A.description||""};tt.value.push(r);const c=Tt.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,Je.value=d,le.value=u,U.value=m,St.value=d,Y.value=u,ge.value=m,e.nextTick(()=>{k(),wn(),ut(),tn();const v=Vn(d);pe("update:modelValue",v),pe("update:title",u),pe("update:description",m),pe("change",v),pe("title-change",u),pe("description-change",m),Q.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(ke.value){ke.value.focus();const y=u.length;ke.value.setSelectionRange&&ke.value.setSelectionRange(y,y),_n()}}else if(l){if(Le.value){Le.value.focus();const y=m.length;Le.value.setSelectionRange(y,y)}}else if(s)vl();else if(ke.value&&document.activeElement===ke.value){const y=u.length;ke.value.setSelectionRange&&ke.value.setSelectionRange(y,y),_n()}else if(Le.value&&document.activeElement===Le.value){const y=m.length;Le.value.setSelectionRange(y,y)}else f.value&&vl()},10)})})}},At=()=>{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"})},De=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},El=()=>{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(()=>{De()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{De()});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(()=>{De()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{De()})}return!0},$l=()=>{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(()=>{At()}),!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 y=document.createDocumentFragment();for(;u.firstChild;)y.appendChild(u.firstChild);v.appendChild(y),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)}}At()});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(()=>{At()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{At()})}return!0},bn=(o,l=null)=>{if(A.disabled||!A.richText||!f.value)return;Be.value?(Xe.value&&(clearTimeout(Xe.value),Xe.value=null),lt(),Be.value=!1):lt(),on(),f.value.focus();const s=window.getSelection();let r=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&Ot(d)&&(r=$n())}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=$l();K.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"bold",state:d}),e.nextTick(()=>{r&&(Ln(r),e.nextTick(()=>{const m=en("bold");K.value.bold=m})),ie(),wn(),tn()});return}if(o==="italic"){const d=El();K.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"italic",state:d}),e.nextTick(()=>{r&&(Ln(r),e.nextTick(()=>{const m=en("italic");K.value.italic=m})),ie(),De(),wn(),tn()});return}let c=!1;try{c=document.execCommand(o,!1,l)}catch{}e.nextTick(()=>{if(r&&Ln(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=en("bold");K.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=en("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),y=v.commonAncestorContainer.nodeType===1?v.commonAncestorContainer.closest("a"):v.commonAncestorContainer.parentElement?.closest("a");y&&(!y.getAttribute("href")||y.getAttribute("href")==="")&&y.setAttribute("href",l)}f.value.querySelectorAll("a").forEach(v=>{const y=v.getAttribute("href");(!y||y===""||y==="#")&&v.setAttribute("href",l)})}ie(),wn(),tn()})},en=(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 y=window.getComputedStyle(v);parseInt(y.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 y=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let _;for(;_=y.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 y=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let _;for(;_=y.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}},el=o=>{A.disabled||!A.richText||(be.value=be.value===o?null:o,o==="askAi"&&(rt.value=null))},on=()=>{be.value=null,Qe.value=null},Yn=o=>{bn("formatBlock",o),on()},cl=o=>{if(!o||!f.value)return o;const l=Oe=>{let Ne=Oe.nodeType===Node.TEXT_NODE?Oe.parentElement:Oe;for(;Ne&&Ne!==f.value;){const st=Ne.tagName;if(st==="P"){const yn=Ne.parentElement;if(yn===f.value||yn.tagName==="BLOCKQUOTE")return Ne}if(st==="BLOCKQUOTE")break;Ne=Ne.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:Oe=>{const Ne=Oe.tagName;if(Ne==="P"){const st=Oe.parentElement;if(st===f.value||st.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Ne==="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 y=Math.min(m,v),_=Math.max(m,v),D=c.slice(y,_+1);if(D.length===0)return o;const E=D[0],se=D[D.length-1],j=document.createRange();return j.setStartBefore(E),j.setEndAfter(se),j},Ll=()=>{if(A.disabled||!A.richText||!f.value)return;Be.value?(Xe.value&&(clearTimeout(Xe.value),Xe.value=null),lt(),Be.value=!1):lt(),on(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let l=o.getRangeAt(0);!l.collapsed&&Ot(l)&&(l=cl(l),o.removeAllRanges(),o.addRange(l));let s=null;!l.collapsed&&Ot(l)&&(s=$n());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 y=document.createElement("p");y.appendChild(v.cloneNode(!0)),u.insertBefore(y,c)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const y=document.createElement("p");y.appendChild(v.cloneNode(!0)),u.insertBefore(y,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=[],y=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:E=>E.parentNode===u&&E.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let _;for(;_=y.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&&Ln(s),ut(),ie(),tn()})},Tn=()=>{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||"",se=(_.innerHTML||"").trim();return D.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 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 y=document.createRange();y.selectNodeContents(v),y.collapse(!0),o.removeAllRanges(),o.addRange(y),e.nextTick(()=>{ut(),ie()})},wn=()=>{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}},Wl=()=>{if(!f.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),Se.value=$n();const l=window.getSelection();let s="";l.rangeCount>0&&(s=l.getRangeAt(0).toString()),ot.value="",vt.value=s,$e.value="",qe.value=null,Ie.value=!0,on(),e.nextTick(()=>{q.value&&q.value.focus()})},tl=()=>{if(!f.value)return;Be.value?(Xe.value&&(clearTimeout(Xe.value),Xe.value=null),lt(),Be.value=!1):lt();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,on(),e.nextTick(()=>{ie(),wn()})},In=()=>{A.disabled||!A.richText||f.value&&(Be.value?(Xe.value&&(clearTimeout(Xe.value),Xe.value=null),lt(),Be.value=!1):lt(),on(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{k(),ie(),tn()}))},Tl=()=>{A.disabled||!A.richText||f.value&&(Be.value?(Xe.value&&(clearTimeout(Xe.value),Xe.value=null),lt(),Be.value=!1):lt(),on(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{k(),ie(),tn()}))},Al=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},k=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(l=>{const s=l.parentElement;if(s&&s.tagName==="LI"){const r=Al(s);r!==null&&Array.from(l.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},h=()=>{if(A.disabled||!A.richText||!f.value)return;on(),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(()=>{k(),ie()});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=Al(c);u.appendChild(s),m!==null&&r.tagName==="OL"&&s.setAttribute("data-parent-num",String(m)),k();const v=document.createRange();v.selectNodeContents(s),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{ie(),tn()})}else document.execCommand("indent",!1),e.nextTick(()=>{k(),ie(),tn()})},x=()=>{if(A.disabled||!A.richText||!f.value)return;on(),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(()=>{k(),ie()});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(),k();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{ie(),tn()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{k(),ie(),tn()})},O=e.ref(null),ue=e.ref(null),yt=e.ref({}),Mt=e.ref(""),Yt=e.ref(null),an=e.ref("");e.ref("");const nn=e.ref(null);e.ref("");const sn=e.ref([]),Pn=e.ref(!1),Dl=e.ref(!1),Po=o=>{if(!o)return"";const l=o.cloneRange(),s=document.createElement("div");return s.appendChild(l.cloneContents()),s.innerHTML},ho=()=>{if(A.disabled||!A.richText||!f.value)return;if(O.value!==null){O.value=null,Mt.value="",an.value="",nn.value=null,sn.value=[],Cn(!0);return}on(),f.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(l.collapsed||!Ot(l))return;an.value=Po(l)||"",nn.value=$n();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);yt.value={top:`${m}px`,bottom:"auto"},O.value=Date.now(),e.nextTick(()=>{if(Mt.value="",Yt.value){const y=Yt.value;y.style.height="auto",y.style.height=`${y.scrollHeight}px`,y.focus()}const v=r.querySelector(".dss-comment-overlay");if(v&&r){const y=r.querySelector(".dss-text-editor-footer");if(y){const _=r.getBoundingClientRect(),D=v.getBoundingClientRect(),E=y.getBoundingClientRect(),se=D.bottom-_.top,j=E.top-_.top,Oe=8;if(se>j-Oe){const Ne=E.height;yt.value={bottom:`${Ne+Oe}px`,top:"auto"}}else yt.value={top:`${m}px`,bottom:"auto"}}}})},yo=()=>{if(!Mt.value.trim())return;const o=Mt.value.trim(),l=new Date,s={text:o,selectionText:an.value,selectionRange:nn.value,commentId:O.value,user:A.commentUser||null,createdAt:l.toISOString()};sn.value=[...sn.value,s],pe("comment-submitted",s),no(s),nn.value&&!Wo(nn.value)&&Co(O.value,nn.value),Mt.value="",e.nextTick(()=>{if(Yt.value){const r=Yt.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}kn("sendComment")})},Oo=(o,l)=>{if(!(!A.commentUser||!o.user||o.user.id!==A.commentUser.id)){if(sn.value=sn.value.filter((s,r)=>r!==l),O.value!==null&&f.value){const s=String(O.value),r=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(r&&sn.value.length>0){const c=[],d=new Set;sn.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(sn.value.length))}else r&&sn.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(pe("comment-deleted",{comment:o,index:l,commentId:O.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));pe("update:comments",s)}e.nextTick(()=>{kn("deleteComment")})}},Wo=o=>{if(!o||!f.value)return!1;try{const l=ko(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},ko=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}},Co=(o,l)=>{if(!(!o||!l||!f.value))try{const s=ko(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,y=s.startOffset,_=s.endOffset,D=m.nodeType===3?m.parentNode:m,E=v.nodeType===3?v.parentNode:v;if(D===E&&y===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(()=>{kn("wrapSelectionWithCommentMarker"),ie()})}catch{}},no=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)}Pn.value=!0,pe("update:comments",l)},bo=(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;on(),s.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),an.value=r.innerHTML||"",nn.value=$n();const u=c.getBoundingClientRect(),m=s.parentElement;if(m){const _=m.getBoundingClientRect(),D=u.bottom-_.top,se=Math.max(D+8,0);yt.value={top:`${se}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let y=[];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}));y.push(...D)}}y.length===0&&Array.isArray(l)&&l.length>0&&(y=l.slice()),y.sort((_,D)=>{const E=Oe=>{if(!Oe)return 0;const Ne=new Date(Oe).getTime();return isNaN(Ne)?0:Ne},se=E(_.createdAt),j=E(D.createdAt);return se===j?0:se-j}),sn.value=y,Cn(!0),O.value=v||null,r&&(ue.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(Mt.value="",Yt.value){const _=Yt.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(),se=_.getBoundingClientRect(),j=D.getBoundingClientRect(),Oe=se.bottom-E.top,Ne=j.top-E.top,st=8;if(Oe>Ne-st){const yn=j.height;yt.value={bottom:`${yn+st}px`,top:"auto"}}}}}kn("openCommentOverlayForSelector")})},lo=e.ref(null),wo=e.ref(0),oo=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(()=>{Tn()},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 y=document.createRange();y.setStartAfter(d),y.collapse(!0),l.removeAllRanges(),l.addRange(y);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,y=c.contains(m)||m===c,D=s.cloneContents().textContent?.trim()||"",E=c.textContent?.trim()||"";(!v||!y||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(()=>{ie()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?x():h();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 y=v.previousSibling;for(;y;){if(y.classList&&y.classList.contains("dss-image-wrapper")||y.tagName==="IMG"||y.querySelector&&y.querySelector(".dss-image-wrapper")||y.querySelector&&y.querySelector("img"))return!0;y=y.previousSibling}const _=v.parentElement;return _&&_!==f.value?m(_):!1};if(u.nodeType===3){const v=u.parentElement;if(v&&(m(v)||m(u))){const y=v.closest("p, div");if(y&&y!==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")))}y.nextSibling?y.parentNode.insertBefore(E,y.nextSibling):y.parentNode.appendChild(E);const se=document.createRange();_?se.setStart(_,0):se.setStart(E,0),se.collapse(!0),l.removeAllRanges(),l.addRange(se),e.nextTick(()=>{ie()});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 Oe=j.textContent||"",st=(j.innerHTML||"").trim(),yn=st.replace(/<br\s*\/?>/gi,"").trim();return Oe.trim()===""||st===""||yn===""||st==="<br>"||st==="<br/>"||st==="<p></p>"||st==="<p><br></p>"||st==="<p><br/></p>"||st==="<p> </p>"||st==="<p><br> </p>"||st==="<div></div>"||st==="<div><br></div>"||st==="<div><br/></div>"},v=c.lastChild,y=v&&v.nodeType===1&&v.tagName==="BR",_=s.startContainer,D=_.nodeType===3?_.parentElement:_,E=D===c||D&&D.parentElement===c;if(u&&m(u)||y&&E){o.preventDefault(),setTimeout(()=>{Tn()},50);return}}}}if(o.key===" "){const l=Date.now(),s=l-wo.value;if(lo.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(),h();return}}}}lo.value=" ",wo.value=l}else lo.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,"")),lt();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 y=f.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach(D=>{if(y>0){const E=v.createElement("p");E.innerHTML=D.innerHTML,D.parentNode.replaceChild(E,D)}else y++}),c){const D=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],E=Array.from(v.body.children).filter(se=>D.includes(se.tagName));if(E.length===1){const se=E[0].tagName,j=c.tagName,Oe=c.textContent.trim()===""&&!c.querySelector("img");let Ne=!1;if(["H1","H2","H3","H4","H5","H6"].includes(j)?Ne=!0:Oe||(se===j||se==="P")&&(Ne=!0),Ne)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);ie()},ql=o=>{if(be.value){const s=o.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&on()}if(We.value){const s=o.target,r=s.closest(".dss-floating-toolbar"),c=f.value&&s.closest(".dss-text-editor-content");!r&&!c&&Rl()}if(rt.value){const s=o.target,r=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!r&&!c&&Zl()}const l=o.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(Qe.value=null),!f.value||!l.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const r=s.getRangeAt(0);Z.value=!r.collapsed&&Ot(r)}else Z.value=!1}if(O.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&&(O.value=null,Mt.value="",an.value="",nn.value=null,sn.value=[],Cn(!0))}},Bn=(o,l)=>{o&&o.stopPropagation&&o.stopPropagation(),Lt.value&&(clearTimeout(Lt.value),Lt.value=null),Qe.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(()=>{Qe.value=null,Lt.value=null},150)},xn=o=>{Qe.value=null};let On=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(y=>y.tagName==="BUTTON"||y.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-${++On}`;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")}))}})},hn=()=>{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 y=c.getAttribute("data-submenu-id");y&&Bn(v,y)},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=y=>{const _=c.getAttribute("data-submenu-id");_&&Bn(y,_)},m=F;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(y=>{y.addEventListener("click",xn)})})})};let Mn=null;const jt=()=>{if(Qe.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Qe.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Qe.value}"]`);o&&l&&Mo(o,l)}if(We.value&&tn(),A.richText){if(Mn!==null)return;Mn=setTimeout(()=>{Mn=null,kn("handleWindowResize")},150)}},Gt=()=>{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")})})},ul=()=>{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(()=>{Ut.value?_n():vn(),V.value?Nn():fl()})}),e.nextTick(()=>{ul()}),A.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",ql),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(()=>{hn(),Gt()}),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(),se=document.createRange();se.setStartAfter(D),se.collapse(!0),E.removeAllRanges(),E.addRange(se)}else D&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const E=window.getSelection();if(E.rangeCount>0){const j=E.getRangeAt(0).commonAncestorContainer,Oe=j.nodeType===3?j.parentElement:j;if(D.contains(Oe)&&Oe!==D.querySelector("img")){const Ne=document.createRange();Ne.setStartAfter(D),Ne.collapse(!0),E.removeAllRanges(),E.addRange(Ne)}}else{const se=document.createRange();se.setStartAfter(D),se.collapse(!0),E.addRange(se)}}))},!0),f.value.addEventListener("mousedown",m=>{const v=m.target,y=v.closest(".dss-image-no-alt-icon"),_=v.closest(".dss-image-wrapper");if(y||_&&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(y=>{if(!y.closest(".dss-image-wrapper"))y.removeAttribute("alt"),y.removeAttribute("data-alt"),y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="";else{const D=y.getAttribute("alt")||y.alt||"";if(D){const E=y.getAttribute("src")||y.src||"",se=E.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),j=D===E||D===se;(D.startsWith("http://")||D.startsWith("https://")||D.startsWith("data:")||j||j)&&(y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="")}}}),gn()})}),f.value.addEventListener("dragstart",m=>{const v=m.target,y=v.tagName==="IMG"?v:v.closest("img"),_=y?.closest(".dss-image-wrapper");y&&f.value.contains(y)&&(Vt.value=_||y,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,y=v.classList?.contains("dss-image-wrapper"),_=y?v.querySelector("img"):v,D=y?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 ln=window.getSelection();ln.rangeCount>0?E=ln.getRangeAt(0).cloneRange():(E=document.createRange(),E.selectNodeContents(f.value),E.collapse(!1))}if(!E){Vt.value=null;return}const Oe=E.commonAncestorContainer,Ne=Oe.nodeType===3?Oe.parentElement:Oe;if(Ne?.closest(".dss-image-wrapper")===D||D&&D.contains(Ne)){Vt.value=null;return}if(D&&(Ne===D||D.contains(Ne))){Vt.value=null;return}const yn=_.getAttribute("src");let mn=null;D?mn=D.cloneNode(!0):mn=_.cloneNode(!0);try{let ln=E.startContainer;if(ln.nodeType===3&&(ln=ln.parentElement),D&&(ln===D||D.contains(ln))){const cn=document.createRange();cn.setStartAfter(D),cn.collapse(!0),E=cn}E.insertNode(mn);const pn=document.createRange();pn.setStartAfter(mn),pn.collapse(!0);const rn=window.getSelection();rn.removeAllRanges(),rn.addRange(pn)}catch{if(f.value.childNodes.length===0){const pn=document.createElement("p");pn.appendChild(mn),f.value.appendChild(pn)}else{const pn=f.value.lastChild;if(pn&&pn.nodeType===1)pn.appendChild(mn);else{const rn=document.createElement("p");rn.appendChild(mn),f.value.appendChild(rn)}}}D?D.remove():_.remove(),Vt.value=null,e.nextTick(()=>{const ln=f.value.querySelectorAll("img");let pn=!1;ln.forEach(rn=>{if(rn.getAttribute("src")===yn)if(!pn)pn=!0;else{const cn=rn.closest(".dss-image-wrapper");cn?cn.remove():rn.remove()}}),gn(),ie()})}),f.value.addEventListener("dragend",m=>{Vt.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(v=>{v.addedNodes.forEach(y=>{if(y.nodeType===1){y.tagName==="IMG"&&(y.removeAttribute("alt"),y.removeAttribute("data-alt"),y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="");const _=y.querySelectorAll&&y.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(()=>{gn(),Gt(),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(()=>{Gt()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),A.modelValue){const m=Dn(A.modelValue);f.value.innerHTML=m,ht()}e.nextTick(()=>{const m=f.value.innerHTML||"",v=A.title||"",y=A.description||"";Je.value=m,le.value=v,U.value=y,Y.value=v,ge.value=y,k(),gn(),De(),wt(),uo(),En()}),wn(),ut(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",ql),window.removeEventListener("resize",jt),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),Mn!==null&&(clearTimeout(Mn),Mn=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),Xe.value&&clearTimeout(Xe.value),Lt.value&&clearTimeout(Lt.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),Ze.value&&Ze.value.disconnect(),gt.value!==null&&(cancelAnimationFrame(gt.value),gt.value=null),nt.value!==null&&(clearTimeout(nt.value),nt.value=null),$t.value!==null&&(clearTimeout($t.value),$t.value=null),Cn(!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 gl=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)}}gn(),wn(),ut(),tn(),wt()}):e.nextTick(()=>{gn(),wn(),ut(),tn(),wt()})},Dt=()=>{il();const o=window.getSelection();if(o&&o.rangeCount>0){const s=o.getRangeAt(0);Z.value=!s.collapsed&&Ot(s),!s.collapsed&&w.value&&(w.value=null)}else Z.value=!1;if(gn(),wn(),ut(),tn(),wt(),o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c&&c.closest(".dss-text-editor-footer")){o.removeAllRanges(),Z.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{}})},wt=()=>{if(!A.richText||A.disabled||!f.value){S.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){S.value="p";return}const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(!r||!f.value.contains(r)){S.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){S.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?S.value=d:S.value="p"}catch{S.value="p"}},ut=()=>{if(!f.value){Ge.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))}Ge.value=l}catch{Ge.value=!1}},Ot=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=()=>{We.value=!1},tn=()=>{if(!A.floatingToolbar||!A.richText||A.disabled){We.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){We.value=!1;return}const l=o.getRangeAt(0);if(l.collapsed||!Ot(l)){We.value=!1;return}const s=l.getBoundingClientRect();if(!s||s.width===0&&s.height===0){We.value=!1;return}const r=f.value;if(!r){We.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){We.value=!1;return}const d=40,u=8,m=s.top-d/2+15;let v=s.left+s.width/2;const y=window.innerWidth||document.documentElement.clientWidth||0;let _=0;ct.value&&(_=ct.value.getBoundingClientRect().width);const D=(_||320)/2;let E=c.left+D,se=c.right-D;if(se<E){const j=c.left+c.width/2;E=j,se=j}if(y>0){const j=D+u,Oe=y-D-u;if(E=Math.max(E,j),se=Math.min(se,Oe),se<E){const Ne=y/2;E=Ne,se=Ne}}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},We.value=!0},Sl=o=>{A.disabled||!A.richText||(rt.value=rt.value===o?null:o,o==="askAi"&&(be.value=null))},Zl=()=>{rt.value=null,Qe.value=null},Rn=o=>{Yn(o),Zl()};let nl=null,ll=null,hl=null,yl=null;const Zo=o=>{if(A.disabled||!A.richText){Vl(),Fl();return}const l=o.target,s=l.closest("a"),r=l.closest("img");if(nl&&(clearTimeout(nl),nl=null),hl&&(clearTimeout(hl),hl=null),s&&s!==ll){Fl(),ll=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),qe.value=s,de.value=c,X.value=!0,Ee.value=!0,jn(s)}else!s&&ll?(ll=null,nl=setTimeout(()=>{Ee.value||Vl()},150)):s&&s===ll&&jn(s);if(r&&r!==yl){Vl(),yl=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,Pt.value=c.trim()||L("textEditor.image.noAlt"),Bt.value=!0,he.value=!0,xo(r)}else!r&&yl?(yl=null,hl=setTimeout(()=>{he.value||Fl()},150)):r&&r===yl&&xo(r)},kl=o=>{const l=o.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(ll=null,yl=null,nl&&(clearTimeout(nl),nl=null),hl&&(clearTimeout(hl),hl=null),Vl(),Fl())},Vl=()=>{Ee.value=!1,setTimeout(()=>{Ee.value||(X.value=!1,de.value="",Ie.value||(qe.value=null))},100)},jn=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||(Bt.value=!1,Pt.value="",Et.value||(kt.value=null))},100)},xo=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(!de.value||!qe.value)return;let l=qe.value.getAttribute("href")||de.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},Uo=()=>{if(qe.value){const o=qe.value.textContent||"",l=qe.value.getAttribute("href")||"",s=qe.value;ot.value=l,vt.value=o,$e.value=o,Ee.value=!1,X.value=!1,de.value="",qe.value=s,Ie.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")||"";ot.value=d,vt.value=c,$e.value=c,qe.value=r,Ie.value=!0}}}else{Se.value=$n();const o=window.getSelection();let l="";o.rangeCount>0&&(l=o.getRangeAt(0).toString()),ot.value="",vt.value=l,$e.value="",qe.value=null,Ie.value=!0}e.nextTick(()=>{q.value&&(q.value.focus(),q.value.select())})},zl=()=>{Ie.value=!1,ot.value="",vt.value="",$e.value="",qe.value=null,Se.value=null},ao=()=>{if(!ot.value.trim()){zl();return}if(Be.value?(Xe.value&&(clearTimeout(Xe.value),Xe.value=null),lt(),Be.value=!1):lt(),vt.value.trim()||(vt.value=ot.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",ot.value.trim()),vt.value.trim()!==$e.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),ie()}else if(f.value){f.value.focus();const o=window.getSelection();o.removeAllRanges(),Se.value&&Ln(Se.value);let l=null;if(o.rangeCount>0&&(l=o.getRangeAt(0)),l&&!l.collapsed){l.toString();const s=document.createElement("a");s.href=ot.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=ot.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 y=document.createRange();y.setStartAfter(d),y.collapse(!0),o.removeAllRanges(),o.addRange(y)}else{if(l.startOffset>0){const y=s.textContent.substring(0,l.startOffset),_=y[y.length-1];if(_&&_!==" "&&_!==" "&&_!==`
|
|
102
|
-
`){const
|
|
103
|
-
`){const y=document.createTextNode(" ");l.insertNode(y),l.setStartAfter(y)}}l.insertNode(d);const u=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(u),l.setStartAfter(u),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}ie()}e.nextTick(()=>{wn(),zl()})},Ul=()=>{if(!f.value||Q.value)return;const o=window.getSelection();let l=null;o&&o.rangeCount>0&&(l=$n());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],y=v.textContent;s.lastIndex=0;const _=[...y.matchAll(s)];if(_.length===0)continue;const D=_.filter(j=>{const Oe=j[0],Ne=j.index;if(Ne>0&&y[Ne-1]==="@"||Ne+Oe.length<y.length&&y[Ne+Oe.length]==="@")return!1;const st=v.parentElement;return!(st&&st.closest("a"))});if(D.length===0)continue;if(D.length===1&&D[0][0]===y.trim()){const j=D[0][0],Oe=j.startsWith("http://")||j.startsWith("https://")?j:`https://${j}`,Ne=document.createElement("a");Ne.href=Oe,Ne.textContent=j,Ne.style.color="#60afdf",Ne.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(Ne,v),u=!0);continue}let E=0;const se=document.createDocumentFragment();if(D.forEach(j=>{const Oe=j.index,Ne=j[0];if(Oe>E){const mn=y.substring(E,Oe);mn&&se.appendChild(document.createTextNode(mn))}const st=Ne.startsWith("http://")||Ne.startsWith("https://")?Ne:`https://${Ne}`,yn=document.createElement("a");yn.href=st,yn.textContent=Ne,yn.style.color="#60afdf",yn.style.textDecoration="underline",se.appendChild(yn),E=Oe+Ne.length}),E<y.length){const j=y.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(()=>{Ln(l),wn()})},Eo=()=>{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 y=document.createDocumentFragment();m.forEach(_=>{const D=_.index,E=_[0].startsWith("<u>")?"u":"ins",se=_[1]||_[2]||"";D>v&&y.appendChild(document.createTextNode(u.substring(v,D)));const j=document.createElement(E);j.textContent=se,y.appendChild(j),v=D+_[0].length}),v<u.length&&y.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&y.childNodes.length>0&&d.parentNode.replaceChild(y,d)}},So=o=>{if(!f.value||Q.value)return;if(!o){Eo();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 mn="",ln=0,pn=!1;const rn=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Wn=>Wn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let cn=0;for(;rn.nextNode();){const Wn=rn.currentNode,ol=Wn.textContent||"",dl=cn;if(cn+=ol.length,Wn===r.startContainer){mn+=ol.substring(0,r.startOffset),ln=dl+r.startOffset,pn=!0;break}mn+=ol}return pn||(ln=mn.length),{textBeforeCursor:mn,cursorCharOffset:ln}},{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 y=m[0],_=m[1],D=u.length-y.length,se=(mn=>{let ln=0;const pn=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:cn=>cn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let rn;for(;rn=pn.nextNode();){const cn=(rn.textContent||"").length;if(ln+cn>=mn)return{node:rn,offset:mn-ln};ln+=cn}return null})(D);if(!se)return;const j=document.createRange();j.setStart(se.node,se.offset),j.setEnd(r.endContainer,r.endOffset);const Oe=document.createElement(v);Oe.textContent=_,j.deleteContents(),j.insertNode(Oe);const Ne=window.getSelection(),st=document.createRange();st.setStartAfter(Oe),st.collapse(!0),Ne.removeAllRanges(),Ne.addRange(st);const yn=$n();e.nextTick(()=>{ie(),yn&&Ln(yn)})},so=()=>{f.value&&(qt.value=$n(),Rt.value="",It.value="",je.value="",ae.value="",me.value="",Qt.value=null,kt.value=null,_e.value="upload",Et.value=!0,on(),e.nextTick(()=>{Pe.value&&Pe.value.focus(),Re.value&&(Re.value.value="")}))},Kn=o=>{const l=o.target?.files?.[0];if(!l){Qt.value=null,It.value="";return}Qt.value=l;const s=new FileReader;s.onload=r=>{It.value=r.target?.result||""},s.readAsDataURL(l)},Gn=()=>{Re.value&&Re.value.click()},Xl=()=>{ae.value&&(me.value="")},ro=()=>{me.value&&(ae.value="")},Vo=()=>{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,Rt.value=l.trim()===""||l.trim()==="Image"?"":l;const s=o.getAttribute("src")||o.src||"";s.startsWith("http://")||s.startsWith("https://")?(je.value=s,It.value="",_e.value="url"):(It.value=s,je.value="",_e.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";ae.value=c.endsWith("px")?c.replace("px",""):c,me.value=d.endsWith("px")?d.replace("px",""):d,qt.value=null}else{so();return}Et.value=!0,he.value=!1,Bt.value=!1,e.nextTick(()=>{_e.value==="url"&&Wt.value?(Wt.value.focus(),Wt.value.select()):Pe.value&&(Pe.value.focus(),Pe.value.select()),Re.value&&(Re.value.value="")})},Nl=()=>{Et.value=!1,Rt.value="",It.value="",je.value="",ae.value="",me.value="",Qt.value=null,kt.value=null,qt.value=null,_e.value="upload"},An=()=>{const o=(Rt.value||"").trim(),l=f.value?._mutationObserver;l&&l.disconnect(),Be.value?(Xe.value&&(clearTimeout(Xe.value),Xe.value=null),lt(),Be.value=!1):lt();const s=_e.value==="url"?je.value.trim():It.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),ae.value?(kt.value.style.width=`${ae.value}px`,kt.value.setAttribute("width",ae.value)):(kt.value.style.removeProperty("width"),kt.value.removeAttribute("width")),me.value?(kt.value.style.height=`${me.value}px`,kt.value.setAttribute("height",me.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)}ie()}else{if(!s){l&&f.value&&l.observe(f.value,{childList:!0,subtree:!0}),Nl();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(qt.value&&(Ln(qt.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 y=document.createElement("p");y.innerHTML="<br>",f.value.appendChild(y),d.setStart(y,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){Nl();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 y=document.createElement("p");y.innerHTML="<br>",f.value.appendChild(y),d.setStart(y,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),ae.value&&(v.style.width=`${ae.value}px`,v.setAttribute("width",ae.value)),me.value&&(v.style.height=`${me.value}px`,v.setAttribute("height",me.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,ie()}}e.nextTick(()=>{l&&f.value&&l.observe(f.value,{childList:!0,subtree:!0}),wn(),tn(),Nl()})};e.watch(()=>A.modelValue,o=>{if(A.richText&&f.value&&!Q.value){const l=Dn(o||""),r=f.value.innerHTML.replace(/ |\u00A0/g," "),c=l.replace(/ |\u00A0/g," ");if(r!==c){const d=$n();f.value.innerHTML=l,e.nextTick(()=>{ht();const u=f.value.innerHTML||"",m=A.title||"",v=A.description||"";Je.value=u,le.value=m,U.value=v,St.value=u,Y.value=m,ge.value=v,tt.value=[],Tt.value=[],Xe.value&&(clearTimeout(Xe.value),Xe.value=null),Be.value=!1,d&&Ln(d),k(),gn(),De(),wn(),tn(),wt(),kn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>A.richText,o=>{o?(tn(),e.nextTick(()=>{uo()})):(Rl(),J.value=[],Ze.value&&(Ze.value.disconnect(),Ze.value=null)),wt()}),e.watch(()=>A.floatingToolbar,o=>{o?tn():Rl()}),e.watch(()=>A.disabled,o=>{o&&Rl(),wt()}),e.watch(()=>A.description,()=>{e.nextTick(()=>{V.value?Nn():fl()})}),e.watch(()=>A.title,()=>{e.nextTick(()=>{Ut.value?_n():vn()})}),e.watch(()=>A.customToolbarSlots,()=>{e.nextTick(()=>{Gt()})},{deep:!0}),e.watch(()=>A.comments,(o,l)=>{if(Pn.value){Pn.value=!1;return}Dl.value||A.richText&&f.value&&e.nextTick(()=>{En()})},{deep:!0,immediate:!1});const En=()=>{if(!Dl.value&&!(!A.comments||!Array.isArray(A.comments)||A.comments.length===0)&&!(!A.richText||!f.value)){Dl.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 y=f.value.querySelector(`[data-comment="${v}"]`);if(y){Kt(y,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 Oe=E.closest("[data-comment], [data-fake-comment]");if(Oe){const Ne=Oe.getAttribute("data-comment")||Oe.getAttribute("data-fake-comment");if(String(Ne)===String(m)){Oe.setAttribute("data-comment",v),Oe.removeAttribute("data-fake-comment"),Kt(Oe,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 Ne=document.createRange();Ne.setStart(_.startContainer,_.startOffset),Ne.setEnd(_.endContainer,_.endOffset),io(Ne),Ne.surroundContents(j),c++,d.add(v)}catch{try{const st=_.extractContents();j.appendChild(st),_.insertNode(j),c++,d.add(v)}catch(st){console.warn("Failed to create comment marker:",st)}}}}}catch{}}),e.nextTick(()=>{kn("restoreCommentsFromModel"),ie(),Dl.value=!1})}catch{Dl.value=!1}}},io=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&&!Zt(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&&!No(c)||o.setEndAfter(u))}else c.nodeType===1&&l.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},Zt=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},No=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?io(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")},kn=(o="unknown")=>{if(!A.richText||!f.value){J.value=[];return}Date.now()-Nt.value<zt&>.value!==null||gt.value===null&&(gt.value=requestAnimationFrame(()=>{if(gt.value=null,Nt.value=Date.now(),xe.value)return;xe.value=!0;const s={},r=f.value;if(!r){xe.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){xe.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(),y=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 al=E.textContent?.trim(),Qn=A.comments?.find(qn=>(typeof qn.conversation_id=="string"&&qn.conversation_id.startsWith("comment-")?null:qn.conversation_id)&&qn.selection_text?.trim()===al);Qn?(j=String(Qn.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 Oe=E.getBoundingClientRect(),Ne=window.getComputedStyle(E),st=parseFloat(Ne.lineHeight)||parseFloat(Ne.fontSize)*1.2,ln=Oe.top-y.top+st/2-15,rn=y.top-v.top+ln;let cn=null,Wn=null,ol=0;const dl=[],mo=new Set;if(j&&A.comments){const al=A.comments.find(Qn=>String(Qn.conversation_id||Qn.id)===String(j));if(al){const Qn=al.conversation||[];Qn.length>0?(Qn.forEach(qn=>{qn.user&&qn.user.id&&!mo.has(qn.user.id)&&(mo.add(qn.user.id),dl.push(qn.user))}),ol=Qn.length):(ol=0,cn=null,Wn=null),dl.length>0?cn=dl[0]:cn=null,dl.length>1?Wn=dl[1]:Wn=null}}const _o=Oe.top+st/2-15,Yo=_o+30,Cl=5,po=Yo>y.top+Cl&&_o<y.bottom-Cl?1:0;J.value.find(al=>al.id===j);let Yl=E;if(!Yl&&j&&f.value){const al=String(j);Yl=f.value.querySelector(`[data-comment="${al}"], [data-fake-comment="${al}"]`)}const $o=dl.length;s[j]?(s[j].top=rn,s[j].opacity=po,s[j].element=Yl,s[j].firstUser=cn,s[j].secondUser=Wn,s[j].totalCount=ol,s[j].uniqueUserCount=$o):s[j]={id:j,top:rn,opacity:po,element:Yl,firstUser:cn,secondUser:Wn,totalCount:ol,uniqueUserCount:$o}});const _=Object.values(s).map(E=>{const se=Math.max(0,(E.uniqueUserCount??0)-2);if(!E.element&&E.id&&f.value){const Oe=String(E.id);E.element=f.value.querySelector(`[data-comment="${Oe}"], [data-fake-comment="${Oe}"]`)}return{...E,firstUser:E.firstUser||null,secondUser:E.secondUser||null,totalCount:E.totalCount,additionalCount:se}});(J.value.length!==_.length||_.some((E,se)=>{const j=J.value[se];if(!j)return!0;const Oe=(j.firstUser?.id||null)!==(E.firstUser?.id||null),Ne=(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||Oe||Ne||j.element!==E.element}))&&(J.value=_),xe.value=!1}))},Bo=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&&(Cn(),ue.value=l,l.classList.add("editor-comment-highlighted"))},Cn=(o=!1)=>{!o&&O.value!==null&&ue.value&&(ue.value.getAttribute("data-comment")||ue.value.getAttribute("data-fake-comment"))===O.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),ue.value&&(ue.value.classList.remove("editor-comment-highlighted"),ue.value=null))},co=o=>{if(!o||!o.element)return;Cn(!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}"]`;pe("comment-marker-clicked",{commentId:l,selector:s,element:o.element})},Bl=()=>{Cn()},uo=()=>{!A.richText||!f.value||(Ze.value&&Ze.value.disconnect(),$t.value!==null&&(clearTimeout($t.value),$t.value=null),Ze.value=new MutationObserver(()=>{$t.value===null&&($t.value=setTimeout(()=>{$t.value=null,e.nextTick(()=>{kn("MutationObserver")})},200))}),Ze.value.observe(f.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),kn("setupCommentMarkersObserver-initial"))},Mo=(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(()=>Qe.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(()=>{Mo(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,rt.value],()=>{be.value==="askAi"||rt.value==="askAi"?e.nextTick(()=>{hn()}):(Qe.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!==fe.value&&(fe.value=o)},{immediate:!0}),oe({openCommentOverlayForSelector:bo,updateCommentMarkers:kn,restoreCommentsFromModel:En}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",it.value]),style:e.normalizeStyle(Ct.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:bt,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":!Sn.value}]),onClick:re,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=>el("paragraph")),title:e.unref(L)("textEditor.toolbar.paragraphFormat")},[S.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:P.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Ru)):S.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:P.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Fu)):S.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:P.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Iu)):S.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:P.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,zu)):S.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:P.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Pu)):S.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:P.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=>Yn("<h1>"))},[e.createElementVNode("img",{src:P.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=>Yn("<h2>"))},[e.createElementVNode("img",{src:P.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=>Yn("<h3>"))},[e.createElementVNode("img",{src:P.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=>Yn("<h4>"))},[e.createElementVNode("img",{src:P.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=>Yn("<h5>"))},[e.createElementVNode("img",{src:P.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=>Yn("<h6>"))},[e.createElementVNode("img",{src:P.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=>Yn("<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":en("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,Ku),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":en("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,Gu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":en("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,Qu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ge.value}]),onClick:Ll,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:tl,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:Wl,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":en("insertUnorderedList")}]),onClick:In,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":en("insertOrderedList")}]),onClick:Tl,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:so,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),Z.value?(e.openBlock(),e.createElementBlock("div",ad)):e.createCommentVNode("",!0),Z.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(L)("textEditor.toolbar.comment"),onClick:ho},[...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=>el("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&&Ae(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:on})):e.createCommentVNode("",!0),e.createVNode(Jo,{showModal:Ie.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:Ye,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(ao,["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=>ot.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.link.enterUrl"),onKeyup:e.withKeys(ao,["enter"])},null,40,Cd),[[e.vModelText,ot.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:ao},e.toDisplayString(e.unref(L)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Jo,{showModal:Et.value,width:"500px",height:"80vh",onCloseModal:Nl},{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":_e.value==="upload"}]),onClick:l[17]||(l[17]=s=>_e.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":_e.value==="url"}]),onClick:l[18]||(l[18]=s=>_e.value="url")},e.toDisplayString(e.unref(L)("textEditor.image.imageLink")),3)]),_e.value==="upload"?(e.openBlock(),e.createElementBlock("div",wd,[e.createElementVNode("div",xd,[e.createElementVNode("div",Ed,[sl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Sd,e.toDisplayString(e.unref(L)("textEditor.image.uploadImage")),1)),sl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Gn},[e.createElementVNode("img",{src:It.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:Re,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Kn},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Re,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Kn},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:Pe,type:"text","onUpdate:modelValue":l[19]||(l[19]=s=>Rt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterAltText"),onKeyup:e.withKeys(An,["enter"])},null,40,Md),[[e.vModelText,Rt.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=>ae.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(An,["enter"]),onInput:Xl},null,40,Ld),[[e.vModelText,ae.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=>me.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(An,["enter"]),onInput:ro},null,40,Dd),[[e.vModelText,me.value]])])])])):e.createCommentVNode("",!0),_e.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:Wt,type:"text","onUpdate:modelValue":l[22]||(l[22]=s=>je.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(An,["enter"])},null,40,zd),[[e.vModelText,je.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=>Rt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterAltText"),onKeyup:e.withKeys(An,["enter"])},null,40,Wd),[[e.vModelText,Rt.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=>ae.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(An,["enter"]),onInput:Xl},null,40,Ud),[[e.vModelText,ae.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=>me.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(An,["enter"]),onInput:ro},null,40,jd),[[e.vModelText,me.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Nl},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:An},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":pt.value&&Ut.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.labels.title")),1),e.createElementVNode("div",Kd,[Ut.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:Hn,onFocus:to,onBlur:rl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Ut.value}]),placeholder:R.value,disabled:T.disabled,rows:"1"},null,42,e1)])],2),pt.value&&Ut.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":dn.value&&V.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.labels.description")),1),e.createElementVNode("div",n1,[V.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(W.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Le,value:T.description,onInput:xl,onFocus:wl,onBlur:Ol,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!V.value}]),placeholder:W.value,disabled:T.disabled,rows:"1"},null,42,s1)])],2),dn.value&&V.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(J.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":O.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=>Bo(s),onMouseleave:Bl},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>co(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=>co(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=>co(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(Xn.value),onInput:ie,onBlur:Fe,onClick:gl,onMouseup:Dt,onKeyup:Dt,onKeydown:oo,onPaste:qo,onMousemove:Zo,onMouseleave:kl},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[O.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(yt.value)},[an.value||sn.value.length>0?(e.openBlock(),e.createElementBlock("div",E1,[e.createElementVNode("div",S1,[an.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:an.value},null,8,V1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",N1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(sn.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(pl(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":_l(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),A.commentUser&&s.user&&s.user.id===A.commentUser.id&&!_l(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>Oo(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:Yt,"onUpdate:modelValue":l[26]||(l[26]=s=>Mt.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(L)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(yo,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(Yt.value){const s=Yt.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,F1),[[e.vModelText,Mt.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(yo,["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(Xt.value)+" "+e.toDisplayString(Xt.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(Fn.value)+" "+e.toDisplayString(Fn.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:I.value,rows:T.rows,disabled:T.disabled,style:e.normalizeStyle(Jn.value)},null,46,y1),e.createElementVNode("div",k1,[e.createElementVNode("div",C1,[e.createElementVNode("span",b1,e.toDisplayString(Xt.value)+" "+e.toDisplayString(Xt.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(Fn.value)+" "+e.toDisplayString(Fn.value===1?e.unref(L)("textEditor.footer.character"):e.unref(L)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[X.value&&de.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=>Ee.value=!0),onMouseleave:Vl},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Il,["stop"]),title:de.value},e.toDisplayString(de.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"},[Bt.value&&Pt.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,[Pt.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:Pt.value},e.toDisplayString(Pt.value),9,Y1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Vo,["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&&We.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:ct,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(bt,["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":!Sn.value}]),onClick:e.withModifiers(re,["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=>Sl("paragraph"),["stop"])),title:e.unref(L)("textEditor.toolbar.paragraphFormat")},[S.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:P.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,nm)):S.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:P.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,lm)):S.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:P.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,om)):S.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:P.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,am)):S.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:P.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,sm)):S.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:P.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),rt.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=>Rn("<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=>Rn("<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=>Rn("<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=>Rn("<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=>Rn("<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=>Rn("<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=>Rn("<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":en("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,cm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":en("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,um),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":en("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,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":Ge.value}]),onClick:e.withModifiers(Ll,["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(tl,["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(Wl,["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":en("insertUnorderedList")}]),onClick:e.withModifiers(In,["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":en("insertOrderedList")}]),onClick:e.withModifiers(Tl,["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(so,["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(ho,["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=>Sl("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),rt.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)]),at.value?(e.openBlock(),e.createElementBlock("div",xm,[T.askAi&&at.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)&&mt(s)?(e.openBlock(),e.createElementBlock("div",Sm,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),ne(s)&&mt(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:oe}){function M(le){const U=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(le);if(!U)return{h:0,s:0,l:50};const Y=parseInt(U[1],16)/255,ge=parseInt(U[2],16)/255,ke=parseInt(U[3],16)/255,Le=Math.max(Y,ge,ke),xt=Math.min(Y,ge,ke);let Jt=0,Vt=0;const Ut=(Le+xt)/2;if(Le!==xt){const V=Le-xt;switch(Vt=Ut>.5?V/(2-Le-xt):V/(Le+xt),Le){case Y:Jt=((ge-ke)/V+(ge<ke?6:0))/6;break;case ge:Jt=((ke-Y)/V+2)/6;break;case ke:Jt=((Y-ge)/V+4)/6;break}}return{h:Jt*360,s:Vt*100,l:Ut*100}}function L(le,U,Y){U/=100,Y/=100;const ge=U*Math.min(Y,1-Y),ke=Le=>{const xt=(Le+le/30)%12,Jt=Y-ge*Math.max(Math.min(xt-3,9-xt,1),-1);return Math.round(255*Jt).toString(16).padStart(2,"0")};return`#${ke(0)}${ke(8)}${ke(4)}`}function fe(le){const U=le.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!U)return null;let Y=U[1];return Y.length===3&&(Y=Y.split("").map(ge=>ge+ge).join("")),"#"+Y}function P(le){const U=le.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!U)return null;const Y=Math.max(0,Math.min(255,Number.parseInt(U[1],10))),ge=Math.max(0,Math.min(255,Number.parseInt(U[2],10))),ke=Math.max(0,Math.min(255,Number.parseInt(U[3],10)));return`#${Y.toString(16).padStart(2,"0")}${ge.toString(16).padStart(2,"0")}${ke.toString(16).padStart(2,"0")}`}function A(le){if(typeof le!="string")return null;const U=le.trim();return fe(U)||P(U)}function pe(le,U,Y){U/=100,Y/=100;const ge=Y+U*Math.min(Y,1-Y),ke=ge===0?0:2-2*Y/ge;return{h:le,s:ke*100,v:ge*100}}function ft(le,U,Y){U/=100,Y/=100;const ge=Y*(1-U/2),ke=ge===0||ge===1?0:(Y-ge)/Math.min(ge,1-ge);return{h:le,s:ke*100,l:ge*100}}const ee=T,f=oe,be=e.ref(!1),Ce=e.ref(!1),Q=e.ref(!1),X=e.ref(-1),de=e.ref(-1),H=e.ref(null),Ee=e.ref(null),Ie=e.ref(null),ot=e.ref(null),vt=e.ref({top:0,left:0}),q=e.ref(M(ee.modelValue||"#b8a5de")),Ye=e.computed(()=>Array.isArray(ee.presetGroups)&&ee.presetGroups.length>0),qe=e.computed(()=>!ee.disableCustomColors),Se=e.computed(()=>Ye.value?0:ee.initialPresetCount!=null?ee.initialPresetCount:de.value<0?null:de.value),$e=e.computed(()=>{const le=Se.value;return le==null?!0:Math.max(0,ee.presetColors.length-le)<ee.max}),Ge=e.computed(()=>!!(Ce.value||X.value>=0||!K.value&&ee.presetColors.length===0));e.computed(()=>{const le=Se.value;return le!=null&&ee.presetColors.length>le});const K=e.computed(()=>Ye.value||Se.value!=null),We=e.computed(()=>{const le=Se.value;return le==null?[]:ee.presetColors.slice(0,le)}),we=e.computed(()=>{const le=Se.value;return le==null?[]:ee.presetColors.slice(le)});function ct(le){const U=Se.value;return U!=null?U+le:-1}function rt(le){const U=Se.value;return U!=null&&le>=U}function Et(le){rt(le)&&(X.value=le,q.value=M(ee.presetColors[le]),Ce.value=!0,e.nextTick(()=>ot.value?.focus()))}function Rt(le){if(!rt(le))return;const U=ee.presetColors.filter((ke,Le)=>Le!==le);f("update:presetColors",U);const Y=fe(ee.modelValue),ge=fe(ee.presetColors[le]);if(Y&&ge&&Y.toLowerCase()===ge.toLowerCase()){const ke=U[Math.max(0,le-1)]||U[0];ke&&f("update:modelValue",ke)}}function Qt(){Q.value=!Q.value,Q.value||(X.value=-1,Ce.value=!1)}function It(){if(!qe.value||X.value<0)return;const le=Re.value,U=fe(le);if(U){const Y=[...ee.presetColors];Y[X.value]=U,f("update:presetColors",Y),f("update:modelValue",U),X.value=-1,Ce.value=!1}}function ae(){ee.disabled||!qe.value||(X.value=-1,Ce.value=!Ce.value,Ce.value&&(he(),e.nextTick(()=>ot.value?.focus())))}function me(le){const U=A(le),Y=A(ee.modelValue);return U&&Y&&U.toLowerCase()===Y.toLowerCase()}function Pe(){if(ee.disabled||!qe.value||!$e.value)return;const le=Re.value,U=fe(le);if(U){const Y=[...ee.presetColors,U];f("update:presetColors",Y),f("update:modelValue",U);const ge=Se.value??de.value;ge>=0&&Y.length-ge>=ee.max&&(Ce.value=!1)}}const Re=e.computed(()=>{const{h:le,s:U,l:Y}=q.value;return L(le,U,Y)}),Wt=e.computed(()=>Re.value.toLowerCase()),kt=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${q.value.h}, 100%, 50%))`})),qt=e.computed(()=>{const le=pe(q.value.h,q.value.s,q.value.l);return{left:`${le.s}%`,bottom:`${le.v}%`,transform:"translate(-50%, 50%)"}}),Bt=e.computed(()=>({left:`${q.value.h/360*100}%`,transform:"translateX(-50%)"})),Pt=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 le=H.value.getBoundingClientRect(),U=window.innerHeight||document.documentElement.clientHeight;let Y=le.bottom+4;const ge=Ee.value;ge&&Y+ge.offsetHeight>U-8&&(Y=le.top-4-ge.offsetHeight),vt.value={top:Y,left:le.left}}function he(){const le=ee.modelValue||"#b8a5de",U=A(le);U&&(q.value=M(U))}function _e(){f("update:modelValue",Re.value)}function je(){ee.disabled||(be.value=!be.value,be.value&&(he(),e.nextTick(()=>{G(),ot.value?.focus()})))}function Qe(){const le=Re.value,U=fe(le);if(U){if(X.value>=0){const Y=[...ee.presetColors];Y[X.value]=U,f("update:presetColors",Y),f("update:modelValue",U)}else if(qe.value&&(ee.presetColors.length>0||Ye.value)&&Ce.value&&$e.value&&!ee.presetColors.some(ge=>fe(ge)?.toLowerCase()===U.toLowerCase())){const ge=[...ee.presetColors,U];f("update:presetColors",ge),f("update:modelValue",U)}}be.value=!1,Ce.value=!1,Q.value=!1,X.value=-1}function Lt(le){if(!Ie.value)return;const U=Ie.value.getBoundingClientRect(),Y=ge=>{const ke=Math.max(0,Math.min(1,(ge.clientX-U.left)/U.width)),Le=Math.max(0,Math.min(1,1-(ge.clientY-U.top)/U.height)),xt={h:q.value.h,s:ke*100,v:Le*100};q.value=ft(xt.h,xt.s,xt.v)};Y(le),document.addEventListener("mousemove",Y),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",Y),_e()},{once:!0})}function tt(le){if(!le.currentTarget)return;const Y=le.currentTarget.getBoundingClientRect(),ge=ke=>{const Le=Math.max(0,Math.min(1,(ke.clientX-Y.left)/Y.width));q.value={...q.value,h:Le*360}};ge(le),document.addEventListener("mousemove",ge),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ge),_e()},{once:!0})}function Tt(le){const U=le.target.value,Y=A(U);Y&&(q.value=M(Y),f("update:modelValue",Y))}function Xe(le){if(ee.disabled)return;const U=A(le);U&&(q.value=M(U),f("update:modelValue",U))}let Be=null,Je=null;function St(){Be&&(document.removeEventListener("keydown",Be),Be=null),Je&&(window.removeEventListener("resize",Je),Je=null)}return e.watch(be,le=>{if(St(),le){if(!Ye.value&&ee.initialPresetCount==null){const U=ee.presetColors.length;U>0&&(de.value<0||U<de.value)&&(de.value=U)}Be=U=>{U.key==="Escape"&&Qe()},Je=G,document.addEventListener("keydown",Be),window.addEventListener("resize",Je)}}),e.watch(()=>ee.modelValue,()=>{be.value&&he()},{immediate:!1}),e.watch(we,le=>{le.length===0&&(Q.value=!1,X.value=-1,Ce.value=!1)}),e.onBeforeUnmount(St),(le,U)=>(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:je},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:Re.value})},[...U[0]||(U[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[be.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Qe,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Ee,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Pt.value)},[K.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Ye.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(T.presetGroups,(Y,ge)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ge,class:"dss-color-picker__section"},[e.createElementVNode("span",Mm,e.toDisplayString(Y.title),1),e.createElementVNode("div",_m,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.colors,(ke,Le)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ge+"-"+Le,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":me(ke)}]),style:e.normalizeStyle({backgroundColor:ke,"--dss-preset-color":ke}),title:ke,onClick:e.withModifiers(xt=>Xe(ke),["stop"])},null,14,$m))),128))])]))),128)):We.value.length?(e.openBlock(),e.createElementBlock("div",Lm,[U[1]||(U[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(We.value,(Y,ge)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ge,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":me(Y)}]),style:e.normalizeStyle({backgroundColor:Y,"--dss-preset-color":Y}),title:Y,onClick:e.withModifiers(ke=>Xe(Y),["stop"])},null,14,Am))),128))])])):e.createCommentVNode("",!0),qe.value?(e.openBlock(),e.createElementBlock("div",Dm,[e.createElementVNode("div",Hm,[U[3]||(U[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(Qt,["stop"])},[...U[2]||(U[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Rm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,(Y,ge)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ge,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&&me(Y),"dss-color-picker__preset-bubble--editing":Q.value&&X.value===ct(ge)}]),style:e.normalizeStyle({backgroundColor:X.value===ct(ge)?Re.value:Y,"--dss-preset-color":X.value===ct(ge)?Re.value:Y}),title:X.value===ct(ge)?Re.value:Y,onClick:e.withModifiers(ke=>Q.value?Et(ct(ge)):Xe(Y),["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=>Rt(ct(ge)),["stop"])},[...U[4]||(U[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,Im)):e.createCommentVNode("",!0)],2))),128)),$e.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":Ce.value}]),onClick:e.withModifiers(ae,["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,(Y,ge)=>(e.openBlock(),e.createElementBlock("button",{key:ge,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":me(Y)}]),style:e.normalizeStyle({backgroundColor:Y,"--dss-preset-color":Y}),title:Y,onClick:e.withModifiers(ke=>Xe(Y),["stop"])},null,14,Pm))),128)),qe.value&&$e.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":Ce.value}]),onClick:e.withModifiers(ae,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ge.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:Ie,onMousedown:Lt},[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(qt.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:tt},[U[5]||(U[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(Bt.value)},null,4)],32),e.createElementVNode("div",Om,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:ot,type:"text",class:"dss-color-picker__hex-input",value:Wt.value,onInput:Tt},null,40,Wm)]),qe.value&&K.value&&(T.presetColors.length||Ye.value)&&$e.value&&X.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Pe}," Save color ")):e.createCommentVNode("",!0),qe.value&&K.value&&X.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:It}," 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:Qe}," 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 oe=T,M=e.computed(()=>oe.size==="small"?"dss-loaders--size-small":oe.size==="large"?"dss-loaders--size-large":oe.size==="medium"||oe.size==null?"dss-loaders--size-medium":null),L=e.computed(()=>{const fe={};if(!(oe.size==="small"||oe.size==="medium"||oe.size==="large"||oe.size==null)){const P=typeof oe.size=="number"?`${oe.size}px`:String(oe.size);fe["--dss-loader-size"]=P}return oe.color&&(fe["--dss-loader-accent"]=oe.color,fe["--dss-loader-accent-soft"]=`color-mix(in srgb, ${oe.color} 30%, white)`),fe});return(fe,P)=>(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,[P[0]||(P[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,[P[1]||(P[1]=e.createElementVNode("span",{class:"dss-loader-dots","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"})],-1)),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,[P[2]||(P[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,[P[3]||(P[3]=e.createElementVNode("span",{class:"dss-loader-double-circle","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-double-circle-outer"}),e.createElementVNode("span",{class:"dss-loader-double-circle-inner"})],-1)),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,[P[4]||(P[4]=e.createElementVNode("span",{class:"dss-loader-bars","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"})],-1)),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,[P[5]||(P[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",n2,[e.renderSlot(fe.$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 oe=T,M=e.computed(()=>{const P={"dss-skeleton--loading":oe.loading,"dss-skeleton--static":!oe.shimmer,"dss-skeleton--multiple":oe.mode==="multiple","dss-skeleton--dark":oe.darkMode};return oe.mode==="multiple"&&oe.targetClass!==ia&&(P[`dss-skeleton--target-${oe.targetClass}`]=!0),P}),L=e.computed(()=>{const P={};return oe.borderRadius&&(P.borderRadius=oe.borderRadius),P}),fe=e.computed(()=>{const P={};return oe.borderRadius&&(P["--dss-skeleton-border-radius"]=oe.borderRadius),oe.darkMode?(P["--dss-skeleton-bg"]=oe.bgDark||"#322c3f",P["--dss-skeleton-shimmer"]=oe.shimmerDark||"#3e3f41",P):(oe.bgColor&&(P["--dss-skeleton-bg"]=oe.bgColor),oe.shimmerColor&&(P["--dss-skeleton-shimmer"]=oe.shimmerColor),P)});return(P,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",M.value]),style:e.normalizeStyle(fe.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(P.$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:oe}){const M=T,L=oe,fe=e.useSlots(),P=e.computed(()=>!!fe["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},pe=e.computed(()=>({...A,...M.options})),ft=e.computed(()=>({"--dss-dnd-col-min-w":pe.value.columnMinWidth,"--dss-dnd-col-max-w":pe.value.columnMaxWidth,"--dss-dnd-col-gap":pe.value.columnGap,"--dss-dnd-indicator-color":pe.value.indicatorColor,"--dss-dnd-body-max-h":pe.value.columnBodyMaxHeight}));function ee(G){if(!pe.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),X=e.ref(null);let de=null,H=null,Ee=null,Ie=null,ot=0,vt=0,q="",Ye=null;const qe=5,Se=e.computed(()=>{const G={};for(const he of M.columns)G[he.value]=M.items.filter(_e=>_e[M.columnKey]===he.value).sort((_e,je)=>(_e[M.positionKey]??0)-(je[M.positionKey]??0));return G}),$e=e.computed(()=>{const G={},he=!!f.value,_e=f.value?.[M.itemKey],je=be.value,Qe=Q.value;for(const Lt of M.columns){const tt=Se.value[Lt.value]||[],Tt=[],Xe=je==Lt.value;let Be=0;for(let Je=0;Je<tt.length;Je++){const St=tt[Je],le=he&&St[M.itemKey]===_e;!le&&Xe&&Qe===Be&&Tt.push({type:"indicator",key:`ind-${Be}`}),le||Be++,Tt.push({type:"item",item:St,isDragged:le,key:`item-${St[M.itemKey]}`})}Xe&&Qe>=Be&&Tt.push({type:"indicator",key:"ind-end"}),G[Lt.value]=Tt}return G});function Ge(G,he){const je=(Se.value[G]||[]).filter(tt=>tt[M.itemKey]!==f.value?.[M.itemKey]);if(je.length===0)return 1;if(he<=0){const tt=je[0][M.positionKey];return tt!=null&&tt>0?tt/2:.5}if(he>=je.length){const tt=je[je.length-1][M.positionKey];return(tt??0)+1}const Qe=je[he-1][M.positionKey]??0,Lt=je[he][M.positionKey]??0;return(Qe+Lt)/2}function K(G,he,_e){Ee&&Ee.remove();const je=G.getBoundingClientRect(),Qe=G.cloneNode(!0);Qe.classList.add("dss-dnd-ghost"),Qe.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(/ /g," "),o=o.replace(/&/g,"&"),o=o.replace(/</g,"<"),o=o.replace(/>/g,">"),o=o.replace(/"/g,'"'),o=o.replace(/'/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return 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(/ |\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&<.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(/ |\u00A0/g," "),c=l.replace(/ |\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-
|
|
106
|
-
top: ${
|
|
107
|
-
width: ${
|
|
108
|
-
height: ${
|
|
105
|
+
left: ${he-nt}px;
|
|
106
|
+
top: ${Be-ft}px;
|
|
107
|
+
width: ${Xe.width}px;
|
|
108
|
+
height: ${Xe.height}px;
|
|
109
109
|
z-index: 9999;
|
|
110
110
|
pointer-events: none;
|
|
111
|
-
opacity: ${
|
|
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: ${
|
|
114
|
+
background-color: ${fe.value.dragSourceBackground};
|
|
115
115
|
font-family: 'Work Sans', sans-serif;
|
|
116
116
|
cursor: grabbing;
|
|
117
|
-
`,document.body.appendChild(Qe),Ee=Qe}function We(G,he){Ee&&(Ee.style.left=`${G-ot}px`,Ee.style.top=`${he-vt}px`)}function we(G){G.classList.add("dss-dnd-item--dragging"),G.style.background=pe.value.dragSourceBackground,G.style.borderColor=pe.value.dragSourceBorder,G.style.transform="scale(0.97)"}function ct(G){G.classList.remove("dss-dnd-item--dragging"),G.style.background="",G.style.borderColor="",G.style.transform=""}function rt(G,he){return document.elementFromPoint(G,he)?.closest(".dss-dnd-column-body")??null}function Et(G,he){return!!document.elementFromPoint(G,he)?.closest("[data-dss-dnd-delete-zone]")}function Rt(G,he){if(P.value&&Et(G,he)){Ce.value=!0,be.value=null,Q.value=-1;return}Ce.value=!1;const _e=rt(G,he),je=_e?.getAttribute("data-column")??null;if(!je){be.value=null,Q.value=-1;return}be.value=je;const Qe=_e.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Lt=Qe.length;for(let tt=0;tt<Qe.length;tt++){const Tt=Qe[tt].getBoundingClientRect();if(he<Tt.top+Tt.height/2){Lt=tt;break}}Q.value=Lt}function Qt(G){G.preventDefault(),We(G.clientX,G.clientY),!de&&(de=requestAnimationFrame(()=>{de=null,Rt(G.clientX,G.clientY)}))}function It(G){window.removeEventListener("pointermove",Qt),window.removeEventListener("pointerup",It),window.removeEventListener("pointercancel",It),Ie?.releasePointerCapture?.(G.pointerId),ct(Ie),Ie=null;const he=P.value&&Et(G.clientX,G.clientY);if(f.value&&he)L("delete",{item:f.value});else{const je=rt(G.clientX,G.clientY)?.getAttribute("data-column")??null;if(f.value&&je){const Qe=f.value[M.columnKey],Lt=je,Tt=(Se.value[Lt]||[]).filter(St=>St[M.itemKey]!==f.value[M.itemKey]),Xe=Math.max(0,Math.min(Q.value,Tt.length)),Be=Ge(Lt,Xe),Je=f.value[M.itemKey];L("move",{item:f.value,from:Qe,to:Lt,position:Be,index:Xe}),H&&clearTimeout(H),X.value={id:Je,from:Qe,to:Lt},H=setTimeout(()=>{X.value=null},3500)}}Ee&&(Ee.remove(),Ee=null),q!==null&&(document.body.style.cursor=q,q=""),Pt()}function ae(G,he){G.preventDefault();const _e=G.target.closest(".dss-dnd-item");if(!_e)return;const je=_e.getBoundingClientRect();ot=G.clientX-je.left,vt=G.clientY-je.top,q=document.body.style.cursor,document.body.style.cursor="grabbing",f.value=he,Ie=_e,K(_e,G.clientX,G.clientY),requestAnimationFrame(()=>we(_e)),_e.setPointerCapture?.(G.pointerId),window.addEventListener("pointermove",Qt),window.addEventListener("pointerup",It,{once:!0}),window.addEventListener("pointercancel",It,{once:!0})}function me(){Ye&&(window.removeEventListener("pointermove",Pe),window.removeEventListener("pointerup",Re),window.removeEventListener("pointercancel",Re),Ye=null)}function Pe(G){if(!Ye||G.pointerId!==Ye.pointerId)return;const he=G.clientX-Ye.startX,_e=G.clientY-Ye.startY;if(Math.abs(he)>=qe||Math.abs(_e)>=qe){const je=Ye.item;me(),ae(G,je)}}function Re(G){!Ye||G.pointerId!==Ye.pointerId||me()}function Wt(G,he){me(),Ye={item:he,startX:G.clientX,startY:G.clientY,pointerId:G.pointerId},window.addEventListener("pointermove",Pe),window.addEventListener("pointerup",Re),window.addEventListener("pointercancel",Re)}function kt(G,he){pe.value.useHandle||Wt(G,he)}function qt(G,he){Wt(G,he)}function Bt(){de&&(cancelAnimationFrame(de),de=null)}function Pt(){Bt(),f.value=null,be.value=null,Ce.value=!1,Q.value=-1}return e.onBeforeUnmount(()=>{Bt(),me(),H&&clearTimeout(H),Ee&&(Ee.remove(),Ee=null)}),(G,he)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":pe.value.unstyled}]),style:e.normalizeStyle(ft.value)},[P.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":Ce.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(G.$slots,"delete-zone",{isDragging:!!f.value,isOver:Ce.value})],2),[[e.vShow,!!f.value||pe.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.columns,_e=>(e.openBlock(),e.createElementBlock("div",{key:_e.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":be.value==_e.value},_e.class||""]]),style:e.normalizeStyle(ee(_e))},[pe.value.showHeader?(e.openBlock(),e.createElementBlock("div",a2,[e.renderSlot(G.$slots,"column-header",{column:_e,items:Se.value[_e.value]||[]},()=>[e.createElementVNode("span",s2,e.toDisplayString(_e.title||_e.value),1),e.createElementVNode("span",r2,e.toDisplayString((Se.value[_e.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":_e.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value[_e.value],je=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:je.key},[je.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":je.isDragged,"dss-dnd-item--no-handle":!pe.value.useHandle}]),onPointerdown:Qe=>kt(Qe,je.item)},[pe.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Qe=>qt(Qe,je.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:je.item,column:_e,justDropped:X.value?.id===je.item[T.itemKey],droppedFrom:X.value?.id===je.item[T.itemKey]?X.value.from:null,droppedTo:X.value?.id===je.item[T.itemKey]?X.value.to:null},()=>[e.createElementVNode("div",p2,e.toDisplayString(je.item[T.itemKey]),1)])])],42,u2))],64))),128)),(Se.value[_e.value]||[]).length===0&&be.value!=_e.value?(e.openBlock(),e.createElementBlock("div",f2,[e.renderSlot(G.$slots,"empty",{column:_e},()=>[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 oe=T,M=e.ref(null),L=e.ref(!1);let fe=[],P=null,A=null;function pe(Q,X){const de=[];for(let H=0;H<oe.count;H++)de.push(ft(Q));return de}function ft(Q,X){return{x:Math.random()*Q,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:oe.colors[Math.floor(Math.random()*oe.colors.length)],tilt:Math.floor(Math.random()*10)-10,tiltInc:Math.random()*.08+.04,tiltAngle:0,opacity:Math.random()*.7+.3,speed:Math.random()*4+1.5}}function ee(Q,X,de,H){Q.clearRect(0,0,X,de);for(const Ee of fe)Q.save(),Q.globalAlpha=Ee.opacity*H,Q.beginPath(),Q.lineWidth=Ee.r,Q.strokeStyle=Ee.color,Q.moveTo(Ee.x+Ee.tilt+Ee.r/2,Ee.y),Q.lineTo(Ee.x+Ee.tilt,Ee.y+Ee.tilt+Ee.r/2),Q.stroke(),Q.restore()}function f(Q,X,de){const H=.3+de*.7;for(let Ee=0;Ee<fe.length;Ee++){const Ie=fe[Ee];Ie.tiltAngle+=Ie.tiltInc,Ie.y+=Ie.speed*H,Ie.x+=Math.sin(Ie.d)*.5*H,Ie.tilt=Math.sin(Ie.tiltAngle)*15,de>=.99&&Ie.y>X+20&&(fe[Ee]=ft(Q))}}function be(){L.value=!0,e.nextTick(()=>{const Q=M.value;if(!Q)return;const X=Q.getContext("2d"),de=Q.parentElement;if(!de)return;const H=de.getBoundingClientRect();Q.width=H.width,Q.height=H.height,fe=pe(Q.width,Q.height);const Ee=Date.now(),Ie=Ee+oe.duration,ot=()=>{const vt=Date.now(),q=vt-Ee;if(vt<Ie){let Ye=1;q>oe.fadeStart&&(Ye=1-(q-oe.fadeStart)/(oe.duration-oe.fadeStart)),ee(X,Q.width,Q.height,Ye),f(Q.width,Q.height,Ye),P=requestAnimationFrame(ot)}else Ce()};ot()})}function Ce(){P&&(cancelAnimationFrame(P),P=null),fe=[],L.value=!1}return e.watch(()=>oe.trigger,Q=>{Q&&(A&&clearTimeout(A),A=setTimeout(be,oe.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{Ce(),A&&clearTimeout(A)}),(Q,X)=>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:oe,emit:M}){const{t:L}=Gl.useI18n(),fe=T,P=M,A={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},pe=e.computed(()=>({...A,...fe.options})),ft={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([]),Q=e.ref(null),X=e.ref(!1),de=e.ref(null),H=e.ref(""),Ee=e.ref(null),Ie=e.ref(""),ot=e.ref("asc");let vt=1;function q(V){const w=V.find(S=>S&&typeof S=="object");if(!w)return null;for(const S of f)if(S in w&&typeof w[S]=="string")return S;return Object.keys(w).find(S=>typeof w[S]=="string")||null}function Ye(V,w){const S=w.filter(Z=>Z!=null&&Z!=="NULL");if(S.length===0)return null;if(S.every(Z=>Array.isArray(Z))){const Z=S.flatMap(Ze=>Ze).filter(Ze=>Ze!=null);return Z.length===0?null:typeof Z.find(Ze=>Ze!=null)=="object"?"arraySelect":"arrayText"}return S.every(Z=>typeof Z=="boolean")?"boolean":S.every(Z=>typeof Z=="number")?new Set(S).size<=pe.value.maxUniqueForEnum?"select":"range":S.every(Z=>typeof Z=="string")?new Set(S).size<=pe.value.maxUniqueForSelect?"select":"text":S.some(Z=>typeof Z=="object"&&!Array.isArray(Z))?null:"text"}const qe=e.computed(()=>{if(!fe.data?.length)return[];const V=new Set;for(const J of fe.data)if(J&&typeof J=="object")for(const Ze of Object.keys(J))V.add(Ze);const w=new Set(fe.exclude),S=[];for(const J of V){if(w.has(J))continue;const Ze=fe.config[J]||{},gt=fe.data.map($t=>$t?.[J]),nt=Ze.type||Ye(J,gt);if(!nt)continue;const xe=Ze.filterMode||"contain",Nt=xe==="date"?"date":xe==="string"?"text":nt,zt={key:J,label:Ze.label||Vt(J),type:Nt,filterMode:xe};if(nt==="select"){const $t=gt.filter(it=>it!=null&&it!=="NULL");zt.uniqueValues=[...new Set($t)].sort((it,Ct)=>typeof it=="number"&&typeof Ct=="number"?it-Ct:String(it).localeCompare(String(Ct)))}else if(nt==="range"||nt==="int"){const $t=gt.filter(it=>typeof it=="number");zt.min=Math.min(...$t),zt.max=Math.max(...$t)}else if(nt==="arraySelect"){const $t=Ze.displayKey||q(gt.flatMap(it=>Array.isArray(it)?it:[]));if(zt.displayKey=$t,Array.isArray(Ze.uniqueValues)&&Ze.uniqueValues.length>0)zt.uniqueValues=Ze.uniqueValues.map(it=>String(it));else{const it=gt.flatMap(Ct=>Array.isArray(Ct)?Ct:[]).filter(Ct=>Ct!=null).map(Ct=>$t&&typeof Ct=="object"?Ct[$t]:String(Ct)).filter(Ct=>Ct!=null&&Ct!=="");zt.uniqueValues=[...new Set(it)].sort((Ct,Jn)=>String(Ct).localeCompare(String(Jn)))}}S.push(zt)}const Z=fe.config._order;return Z&&S.sort((J,Ze)=>{const gt=Z.indexOf(J.key),nt=Z.indexOf(Ze.key);return gt===-1&&nt===-1?0:gt===-1?1:nt===-1?-1:gt-nt}),S}),Se=e.computed(()=>{const V={};for(const w of qe.value)V[w.key]=w;return V}),$e=e.computed(()=>Array.isArray(fe.config.groups)&&fe.config.groups.length>0),Ge=e.computed(()=>{if(!$e.value)return[];const V=new Set(qe.value.map(w=>w.key));return fe.config.groups.map(w=>({...w,keys:w.keys.filter(S=>V.has(S))})).filter(w=>w.keys.length>0)}),K=e.computed(()=>{if(!$e.value)return[];const V=new Set(fe.config.groups.flatMap(w=>w.keys));return qe.value.filter(w=>!V.has(w.key))}),We=e.computed(()=>{if(!Ee.value)return[];const V=new Set(Ee.value.keys),w=qe.value.filter(Z=>V.has(Z.key));if(!H.value)return w;const S=H.value.toLowerCase();return w.filter(Z=>Z.label.toLowerCase().includes(S))}),we=e.computed(()=>{if(!H.value)return qe.value;const V=H.value.toLowerCase();return qe.value.filter(w=>w.label.toLowerCase().includes(V))}),ct=e.computed(()=>qe.value.filter(V=>!["arraySelect","arrayText"].includes(V.type))),rt=e.computed(()=>Ie.value?ot.value==="asc"?"Ascending":"Descending":"No sort selected");function Et(V){Q.value===V?Rt():(Q.value=V,H.value="",Ee.value=null)}function Rt(){Q.value=null,H.value="",Ee.value=null}function Qt(V){const w=V.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");Q.value&&!w&&!V.target.closest(".dss-filter-popup")&&!V.target.closest(".dss-filter-trigger")&&!V.target.closest(".dss-filter-add-btn")&&Rt(),X.value&&de.value&&!de.value.contains(V.target)&&(w||(X.value=!1))}e.onMounted(()=>document.addEventListener("click",Qt)),e.onBeforeUnmount(()=>document.removeEventListener("click",Qt));function It(V){return Se.value[V]?.label||Vt(V)}function ae(V){return Se.value[V.key]?.filterMode||"contain"}function me(V){return L(`filter.operators.${V}`)}function Pe(V){const w=Se.value[V.key];return(ft[w?.type]||ft.text).map(S=>({...S,label:L(`filter.operators.${S.value}`)}))}function Re(V){return ee.has(V)}function Wt(V){const w=Se.value[V.key];return w?w.type==="date"?"date":w.type==="boolean"?"boolean":w.type==="text"||w.type==="arrayText"?"text":w.type==="select"||w.type==="arraySelect"?"multiselect":w.type==="range"||w.type==="int"?V.operator==="between"?"between":"number":"text":"text"}function kt(V){return ft[V]?.[0]?.value||"contains"}function qt(V,w){return ee.has(w)||V==="date"?null:V==="select"||V==="arraySelect"?[]:(V==="range"||V==="int")&&w==="between"?{min:null,max:null}:V==="range"||V==="int"?null:""}function Bt(V){return Se.value[V.key]?.uniqueValues||[]}function Pt(V){const w=Bt(V);if(!H.value)return w;const S=H.value.toLowerCase();return w.filter(Z=>String(Z).toLowerCase().includes(S))}function G(V){const w=V.value;return!w||w.length===0?L("filter.select"):w.length<=2?w.join(", "):L("filter.selectedCount",{count:w.length})}function he(V){const w=Se.value[V],S=w?.filterMode||"contain",Z=w?.type||"text",J=S==="string"?"contains":kt(Z);Ce.value.push(e.reactive({id:vt++,key:V,operator:J,value:qt(Z,J)})),Rt()}function _e(V){Ce.value=Ce.value.filter(w=>w.id!==V)}function je(V,w){const Z=Se.value[w]?.type||"text";V.key=w,V.operator=kt(Z),V.value=qt(Z,V.operator),Rt()}function Qe(V,w){const S=Wt(V);V.operator=w;const Z=Wt(V);if(S!==Z||ee.has(w)){const J=Se.value[V.key];V.value=qt(J?.type||"text",w)}Rt()}function Lt(V,w){const S=w.target.value;V.value=S===""?null:Number(S)}function tt(V,w,S){const Z=S.target.value,J=Z===""?null:Number(Z);(!V.value||typeof V.value!="object")&&(V.value={min:null,max:null}),V.value={...V.value,[w]:isNaN(J)?null:J}}function Tt(V,w){const S=V.value||[],Z=S.indexOf(w);V.value=Z>=0?S.filter(J=>J!==w):[...S,w]}function Xe(){Ce.value=[],be.value="",Rt()}function Be(V){be.value=V.target.value}function Je(V){Ie.value=V.target.value}function St(){ot.value=ot.value==="asc"?"desc":"asc"}const le=e.computed(()=>{if(!fe.data)return[];let V=fe.data;if(be.value){const w=be.value.toLowerCase();V=V.filter(S=>{for(const Z of Object.keys(S)){const J=S[Z];if(typeof J=="string"&&J.toLowerCase().includes(w)||typeof J=="number"&&String(J).includes(w)||Array.isArray(J)&&J.some(Ze=>Ze!=null&&(typeof Ze=="string"?Ze.toLowerCase().includes(w):typeof Ze=="object"?Object.values(Ze).some(gt=>typeof gt=="string"&>.toLowerCase().includes(w)):!1)))return!0}return!1})}for(const w of Ce.value){if(!ge(w))continue;const S=Se.value[w.key];S&&(V=V.filter(Z=>ke(Z,w,S)))}if(fe.showSortBy&&Ie.value){const w=Ie.value,S=ot.value==="asc"?1:-1;V=[...V].sort((Z,J)=>U(Z?.[w],J?.[w])*S)}return V});function U(V,w){const S=Y(V),Z=Y(w);return S==null&&Z==null?0:S==null?1:Z==null?-1:typeof S=="number"&&typeof Z=="number"?S-Z:String(S).localeCompare(String(Z),void 0,{numeric:!0,sensitivity:"base"})}function Y(V){return V==null||V==="NULL"?null:typeof V=="string"||typeof V=="number"||typeof V=="boolean"?V:V instanceof Date?V.getTime():null}function ge(V){return ee.has(V.operator)?!0:V.value==null||typeof V.value=="string"&&V.value===""||Array.isArray(V.value)&&V.value.length===0?!1:V.value instanceof Date?!isNaN(V.value.getTime()):!(typeof V.value=="object"&&!Array.isArray(V.value)&&V.value.min==null&&V.value.max==null)}function ke(V,w,S){const Z=V?.[w.key],J=w.value,Ze=w.operator;if(Ze==="is_empty")return Jt(Z);if(Ze==="is_not_empty")return!Jt(Z);const gt=S.type;if(gt==="text"||gt==="arrayText"){const nt=gt==="arrayText"&&Array.isArray(Z)?Z.filter(zt=>zt!=null).map(String).join(" "):Z!=null?String(Z):"",xe=String(J).toLowerCase(),Nt=nt.toLowerCase();switch(Ze){case"contains":return Nt.includes(xe);case"not_contains":return!Nt.includes(xe);case"equals":return Nt===xe;case"not_equals":return Nt!==xe;case"starts_with":return Nt.startsWith(xe);case"ends_with":return Nt.endsWith(xe);default:return!0}}if(gt==="select")switch(Ze){case"is_any_of":return J.includes(Z);case"is_none_of":return!J.includes(Z);default:return!0}if(gt==="range"||gt==="int"){const nt=typeof Z=="number"?Z:Number(Z);if(typeof nt!="number"||isNaN(nt))return!1;if(Ze==="between"){const Nt=J?.min!=null?Number(J.min):null,zt=J?.max!=null?Number(J.max):null,$t=Nt!=null&&!isNaN(Nt)?Nt:null,it=zt!=null&&!isNaN(zt)?zt:null;return($t==null||nt>=$t)&&(it==null||nt<=it)}const xe=typeof J=="number"&&!isNaN(J)?J:Number(J);if(Ze==="contains"||Ze==="not_contains"){const Nt=String(nt),zt=String(J??"").toLowerCase(),$t=Nt.toLowerCase().includes(zt);return Ze==="contains"?$t:!$t}if(typeof xe!="number"||isNaN(xe))return!1;switch(Ze){case"eq":return nt===xe;case"neq":return nt!==xe;case"gt":return nt>xe;case"gte":return nt>=xe;case"lt":return nt<xe;case"lte":return nt<=xe;default:return!0}}if(gt==="arraySelect"){if(!Array.isArray(Z))return!1;const nt=Z.filter(xe=>xe!=null).map(xe=>S.displayKey&&typeof xe=="object"?xe[S.displayKey]:String(xe));switch(Ze){case"contains_any":return nt.some(xe=>J.includes(xe));case"contains_all":return J.every(xe=>nt.includes(xe));case"not_contains_any":return!nt.some(xe=>J.includes(xe));default:return!0}}if(gt==="date"){const nt=Le(J);if(!nt||isNaN(nt.getTime()))return!1;const xe=Le(Z);if(!xe||isNaN(xe.getTime()))return!1;const Nt=xt(xe),zt=xt(nt);switch(Ze){case"eq":return Nt===zt;case"before":return Nt<zt;case"after":return Nt>zt;default:return!0}}if(gt==="boolean"){const nt=Z===!0||Z==="true"||Z===1,xe=Z===!1||Z==="false"||Z===0;switch(Ze){case"is_true":return nt;case"is_false":return xe;default:return!0}}return!0}function Le(V){if(V==null)return null;if(V instanceof Date)return isNaN(V.getTime())?null:V;if(typeof V=="number")return new Date(V>1e10?V:V*1e3);if(typeof V=="string"){const w=new Date(V);return isNaN(w.getTime())?null:w}return null}function xt(V){const w=V.getFullYear(),S=String(V.getMonth()+1).padStart(2,"0"),Z=String(V.getDate()).padStart(2,"0");return`${w}-${S}-${Z}`}function Jt(V){return!!(V==null||V===""||V==="NULL"||Array.isArray(V)&&V.length===0||Array.isArray(V)&&V.every(w=>w==null))}e.watch(le,V=>P("update:modelValue",V),{immediate:!0}),e.watch(()=>fe.data,()=>{Ce.value=[],be.value="",X.value=!1,Ie.value="",ot.value="asc",Rt()});function Vt(V){return V.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,w=>w.toUpperCase())}function Ut(){const V=w=>{if(w==null)return w;if(w instanceof Date)return{_type:"Date",value:w.toISOString(),local:w.toLocaleDateString()};if(Array.isArray(w))return w.map(V);if(typeof w=="object"&&!Array.isArray(w)){const S={};for(const Z of Object.keys(w))S[Z]=V(w[Z]);return S}return w};return{globalSearch:be.value,rows:Ce.value.map(w=>({key:w.key,operator:w.operator,value:V(w.value),defType:Se.value[w.key]?.type,defFilterMode:Se.value[w.key]?.filterMode})),filteredCount:le.value?.length??0}}return oe({getDebugState:Ut}),(V,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":pe.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:de},[e.createElementVNode("div",k2,[w[20]||(w[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref(L)("filter.searchAcrossFields"),value:be.value,onInput:Be},null,40,C2),be.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:w[0]||(w[0]=S=>be.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:X.value||Ce.value.length>0,"dss-filter-funnel-btn--with-sort":fe.showSortBy}]),onClick:w[1]||(w[1]=S=>X.value=!X.value),type:"button",title:X.value?e.unref(L)("filter.closeAdvancedFilter"):e.unref(L)("filter.openAdvancedFilter")},[w[14]||(w[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),Ce.value.length>0?(e.openBlock(),e.createElementBlock("span",w2,e.toDisplayString(Ce.value.length),1)):e.createCommentVNode("",!0)],10,b2),fe.showSortBy?(e.openBlock(),e.createElementBlock("div",x2,[w[19]||(w[19]=e.createElementVNode("label",{class:"dss-filter-sortby-label",for:"dss-filter-sort-select"},"Sort by",-1)),e.createElementVNode("select",{id:"dss-filter-sort-select",class:"dss-filter-sortby-select",value:Ie.value,onChange:Je},[w[15]||(w[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ct.value,S=>(e.openBlock(),e.createElementBlock("option",{key:S.key,value:S.key},e.toDisplayString(S.label),9,S2))),128))],40,E2),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:St,disabled:!Ie.value,title:rt.value},[Ie.value?ot.value==="asc"?(e.openBlock(),e.createElementBlock("svg",B2,[...w[17]||(w[17]=[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",M2,[...w[18]||(w[18]=[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",N2,[...w[16]||(w[16]=[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"currentColor"},null,-1)])]))],8,V2)])):e.createCommentVNode("",!0)]),X.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:w[13]||(w[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",_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,(S,Z)=>(e.openBlock(),e.createElementBlock("div",{key:S.id,class:"dss-filter-row"},[e.createElementVNode("span",L2,e.toDisplayString(Z===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(J=>Et(`${S.id}:field`),["stop"])},[e.createElementVNode("span",D2,e.toDisplayString(It(S.key)),1),w[21]||(w[21]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,A2),Q.value===`${S.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[3]||(w[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[2]||(w[2]=J=>H.value=J),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,J=>(e.openBlock(),e.createElementBlock("li",{key:J.key,class:"dss-filter-popup-item",onClick:Ze=>je(S,J.key)},e.toDisplayString(J.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)]),ae(S)==="contain"||ae(S)==="date"?(e.openBlock(),e.createElementBlock("div",z2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(J=>Et(`${S.id}:op`),["stop"])},[e.createElementVNode("span",O2,e.toDisplayString(me(S.operator)),1),w[22]||(w[22]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,P2),Q.value===`${S.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[4]||(w[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",W2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe(S),J=>(e.openBlock(),e.createElementBlock("li",{key:J.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:S.operator===J.value}]),onClick:Ze=>Qe(S,J.value)},e.toDisplayString(J.label),11,q2))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Re(S.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Z2,[ae(S)==="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":J=>S.value=J},null,8,U2)),[[e.vModelText,S.value]]):ae(S)==="date"?(e.openBlock(),e.createElementBlock("div",X2,[e.createVNode(ea,{mode:"single",modelValue:S.value,"onUpdate:modelValue":J=>S.value=J},null,8,["modelValue","onUpdate:modelValue"])])):Wt(S)==="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":J=>S.value=J},null,8,Y2)),[[e.vModelText,S.value]]):Wt(S)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),value:S.value,onInput:J=>Lt(S,J),step:Se.value[S.key]?.type==="int"?1:void 0},null,40,j2)):Wt(S)==="between"?(e.openBlock(),e.createElementBlock("div",K2,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.min"),value:S.value?.min,onInput:J=>tt(S,"min",J),step:Se.value[S.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:S.value?.max,onInput:J=>tt(S,"max",J),step:Se.value[S.key]?.type==="int"?1:void 0},null,40,J2)])):Wt(S)==="multiselect"?(e.openBlock(),e.createElementBlock("div",e0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(J=>Et(`${S.id}:val`),["stop"])},[e.createElementVNode("span",n0,e.toDisplayString(G(S)),1),w[23]||(w[23]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,t0),Q.value===`${S.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[6]||(w[6]=e.withModifiers(()=>{},["stop"]))},[Bt(S).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[5]||(w[5]=J=>H.value=J),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(Pt(S),J=>(e.openBlock(),e.createElementBlock("li",{key:J,class:"dss-filter-popup-item",onClick:Ze=>Tt(S,J)},[e.createElementVNode("input",{type:"checkbox",checked:(S.value||[]).includes(J),tabindex:"-1"},null,8,s0),e.createElementVNode("span",null,e.toDisplayString(J),1)],8,a0))),128)),Pt(S).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:J=>_e(S.id)},[...w[24]||(w[24]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,i0)]))),128)),e.createElementVNode("div",c0,[e.createElementVNode("div",u0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:w[7]||(w[7]=e.withModifiers(S=>Et("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:w[12]||(w[12]=e.withModifiers(()=>{},["stop"]))},[$e.value&&!Ee.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":w[8]||(w[8]=S=>H.value=S),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(Ge.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:Z=>Ee.value=S},[e.createElementVNode("span",null,e.toDisplayString(S.label),1),w[25]||(w[25]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,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,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:Z=>he(S.key)},e.toDisplayString(S.label),9,v0))),128))])],64)):Ee.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:w[9]||(w[9]=S=>Ee.value=null)},[w[26]||(w[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(Ee.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[10]||(w[10]=S=>H.value=S),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(We.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:Z=>he(S.key)},e.toDisplayString(S.label),9,y0))),128)),We.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":w[11]||(w[11]=S=>H.value=S),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,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:Z=>he(S.key)},e.toDisplayString(S.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:Xe},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:oe}){const M=T,L=oe,fe=e.ref(""),P=e.ref([...M.modelValue]),A=e.ref(null);let pe=null;const ft=e.ref(null),ee=e.ref(""),f=e.ref(null),be=e.ref(null),Ce=e.computed(()=>{if(!be.value)return;const{width:$e,height:Ge}=be.value;return{minWidth:`${$e}px`,height:`${Ge}px`}});function Q($e,Ge){ft.value===Ge&&(f.value=$e)}function X(){ft.value=null,ee.value="",be.value=null,f.value=null}const de=e.computed(()=>new Set(P.value.map($e=>$e.trim()).filter(Boolean)));function H($e){A.value=$e,pe&&clearTimeout(pe),pe=setTimeout(()=>{A.value=null,pe=null},900)}function Ee($e){const Ge=$e.trim();return Ge?de.value.has(Ge)?(H(Ge),!1):(P.value=[...P.value,Ge],L("update:modelValue",[...P.value]),!0):!1}function Ie($e){const Ge=$e.split(/\r?\n/g).map(ct=>ct.trim()).filter(Boolean);if(!Ge.length)return;const K=new Set(P.value.map(ct=>ct.trim()).filter(Boolean)),We=[...P.value];let we=null;for(const ct of Ge){if(K.has(ct)){we??=ct;continue}K.add(ct),We.push(ct)}We.length!==P.value.length&&(P.value=We,L("update:modelValue",[...P.value])),we&&H(we)}function ot($e){M.disabled||(ft.value===$e&&X(),P.value=P.value.filter((Ge,K)=>K!==$e),L("update:modelValue",[...P.value]))}async function vt($e,Ge){if(M.disabled)return;const K=Ge.currentTarget.closest(".dss-pill-field__pill");K&&(be.value={width:K.offsetWidth,height:K.offsetHeight}),ft.value=$e,ee.value=P.value[$e]??"",await e.nextTick();const We=f.value;if(!We)return;We.focus();const we=We.value.length;We.setSelectionRange(we,we)}function q(){X()}function Ye(){if(M.disabled||ft.value===null)return;const $e=ft.value,Ge=P.value[$e]??"",K=ee.value.trim();if(X(),K!==Ge&&de.value.has(K)){H(K);return}if(!K){P.value=P.value.filter((we,ct)=>ct!==$e),L("update:modelValue",[...P.value]);return}const We=P.value.map((we,ct)=>ct===$e?K:we);P.value=We,L("update:modelValue",[...P.value])}function qe($e){$e.preventDefault(),!M.disabled&&(Ee(fe.value),fe.value="")}function Se($e){if(M.disabled)return;const Ge=$e.clipboardData?.getData("text")??"";!Ge.includes(`
|
|
118
|
-
`)&&!Ge.includes("\r")||($e.preventDefault(),Ie(Ge),fe.value="")}return e.watch(()=>M.modelValue,$e=>{P.value=Array.isArray($e)?[...$e]:[]},{deep:!0}),e.onBeforeUnmount(()=>{pe&&clearTimeout(pe)}),($e,Ge)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":$e.disabled}])},[e.createElementVNode("div",V0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,(K,We)=>(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":ft.value===We}]),style:e.normalizeStyle(ft.value===We&&be.value?Ce.value:void 0)},[ft.value===We?(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=>Q(we,We),"onUpdate:modelValue":Ge[0]||(Ge[0]=we=>ee.value=we),class:"dss-pill-field__pill-edit",type:"text",disabled:$e.disabled,onKeydown:[e.withKeys(Ye,["enter"]),e.withKeys(q,["esc"])],onBlur:Ye},null,40,B0),[[e.vModelText,ee.value]])],8,N0)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",M0,e.toDisplayString(K),1),$e.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",_0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:we=>vt(We,we)},[...Ge[2]||(Ge[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=>ot(We)}," × ",8,L0)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Ge[1]||(Ge[1]=K=>fe.value=K),class:"dss-pill-field__input",type:"text",placeholder:P.value.length?"":$e.placeholder,disabled:$e.disabled,onPaste:Se,onKeydown:e.withKeys(qe,["enter"])},null,40,T0),[[e.vModelText,fe.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 oe=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=ae=>ae&&typeof ae=="object"&&!Array.isArray(ae),fe=(ae,me)=>{const Pe=Object.assign({},ae);return!L(ae)||!L(me)||Object.keys(me).forEach(Re=>{if(L(me[Re])){Re in ae?Pe[Re]=fe(ae[Re],me[Re]):Object.assign(Pe,{[Re]:me[Re]});return}Object.assign(Pe,{[Re]:me[Re]})}),Pe},P=e.computed(()=>fe(M,oe.options)),A=e.computed(()=>Math.max(1,Number(oe.steps)||1)),pe=e.computed(()=>Math.min(A.value,Math.max(0,Number(oe.currentStep)||0))),ft=e.computed(()=>Array.isArray(oe.segments)&&oe.segments.length>0),ee=e.computed(()=>{if(!ft.value)return[];const ae=oe.segments.map((me,Pe)=>{const Re=Number(me?.value);return{label:me?.label||`Step ${Pe+1}`,value:Number.isFinite(Re)&&Re>0?Re:0,color:me?.color||oe.activeColor,marker:me?.marker}});return oe.segmentOrder==="desc"?[...ae].sort((me,Pe)=>Pe.value-me.value):oe.segmentOrder==="asc"?[...ae].sort((me,Pe)=>me.value-Pe.value):ae}),f=e.computed(()=>ft.value?ee.value.reduce((ae,me)=>ae+me.value,0):pe.value),be=e.computed(()=>ft.value?Number.isFinite(Number(oe.totalValue))&&Number(oe.totalValue)>0?Number(oe.totalValue):Math.max(1,f.value):A.value),Ce=e.computed(()=>ft.value&&Number.isFinite(Number(oe.totalValue))&&Number(oe.totalValue)>0),Q=e.computed(()=>Ce.value?Math.max(0,Number(oe.totalValue)-f.value):0),X=e.computed(()=>typeof oe.remainderLabel=="string"&&oe.remainderLabel.trim().length>0),de=e.computed(()=>Q.value>0),H=e.computed(()=>ee.value.reduce((ae,me)=>Math.max(ae,Number(me.value)||0),0)),Ee=e.computed(()=>ee.value.filter(ae=>ae.value>0).map(ae=>`${ae.label}: ${ct(ae.value)}`).join(" | ")),Ie=e.computed(()=>ft.value?Ce.value?ee.value.filter(ae=>ae.value>0):ee.value:[]),ot=e.computed(()=>{if(!oe.counterAsPercentage)return`${f.value} / ${be.value}`;const ae=Number(be.value);if(!Number.isFinite(ae)||ae<=0)return"0%";const me=Math.round(Number(f.value)/ae*100);return`${Math.min(Math.max(me,0),100)}%`}),vt=e.computed(()=>f.value),q=e.computed(()=>be.value),Ye=e.reactive({visible:!1,x:0,content:""}),qe=e.computed(()=>({left:`${Ye.x}px`})),Se=ae=>{const me=ae?.parentElement;return me?me.offsetLeft+me.offsetWidth/2:0},$e=ae=>{if(Ce.value){const Re=Math.max(0,Number(ae.value)||0);return{flex:`${Re} 0 0`,minWidth:Re>0?"6px":"0",backgroundColor:ae.color}}const me=f.value;return{flex:`${ae.value>0?ae.value:me>0?1e-4:1} 0 0`,minWidth:"6px",backgroundColor:ae.color}},Ge=ae=>Number(ae?.value||0)>0&&Number(ae?.value||0)===H.value,K=ae=>{const me=L(ae?.marker)?ae.marker:{},Pe=ae?.marker===!0||me.enabled===!0,Re=Ge(ae)&&P.value.maxSegment?.marker?.enabled===!0;if(!(Pe||Re))return{enabled:!1};const kt=me.backgroundColor??(Re?P.value.maxSegment?.marker?.backgroundColor:P.value.segmentMarker?.backgroundColor),qt=me.borderColor??(Re?P.value.maxSegment?.marker?.borderColor:P.value.segmentMarker?.borderColor),Bt=me.color??(Re?P.value.maxSegment?.marker?.color:P.value.segmentMarker?.color),Pt=me.width??(Re?P.value.maxSegment?.marker?.width:P.value.segmentMarker?.width),G=me.height??(Re?P.value.maxSegment?.marker?.height:P.value.segmentMarker?.height);return{enabled:!0,backgroundColor:kt,borderColor:qt,color:Bt,width:Pt,height:G,icon:me.icon??null,...me}},We=ae=>{const me=K(ae);return{backgroundColor:me.backgroundColor??void 0,borderColor:me.borderColor??void 0,color:me.color??void 0}},we=ae=>{const me=K(ae);return{width:me.width??void 0,height:me.height??void 0}},ct=ae=>`${ae}${oe.valueLabel}`,rt=e.computed(()=>({flex:`${Q.value} 0 0`,minWidth:Q.value>0?"6px":"0",backgroundColor:oe.inactiveColor})),Et=(ae,me)=>{if(!ae||!me?.currentTarget)return;const Pe=me.currentTarget;if(oe.remainderTooltipSummary){Ye.x=Se(Pe),Ye.content=Ee.value,Ye.visible=!!Ye.content;return}Ye.x=Pe.offsetLeft+Pe.offsetWidth/2,Ye.content=`${ae.label}: ${ct(ae.value)}`,Ye.visible=!0},Rt=ae=>{if(!Q.value||!ae?.currentTarget)return;const me=ae.currentTarget;if(oe.remainderTooltipSummary){Ye.x=Se(me),Ye.content=Ee.value,Ye.visible=!!Ye.content;return}Ye.x=me.offsetLeft+me.offsetWidth/2,X.value&&(Ye.content=`${oe.remainderLabel}: ${ct(Q.value)}`,Ye.visible=!0)},Qt=()=>{Ye.visible=!1},It=e.computed(()=>({"--dss-step-bar-label-color":oe.labelColor??void 0,"--dss-step-bar-counter-color":oe.counterColor??void 0,"--dss-step-bar-active-color":oe.activeColor,"--dss-step-bar-inactive-color":oe.inactiveColor}));return(ae,me)=>(e.openBlock(),e.createElementBlock("div",{class:"dss-step-bar",style:e.normalizeStyle(It.value)},[e.createElementVNode("div",D0,[e.createElementVNode("span",H0,[e.renderSlot(ae.$slots,"label",{label:T.label},()=>[e.createTextVNode(e.toDisplayString(T.label),1)])]),T.showCounter?(e.openBlock(),e.createElementBlock("span",R0,[e.renderSlot(ae.$slots,"counter",{counterDisplay:ot.value},()=>[e.createTextVNode(e.toDisplayString(ot.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},[ft.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie.value,(Pe,Re)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${Re}-${Pe.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":Ge(Pe),"dss-step-bar__segment--marker-enabled":K(Pe).enabled}]),style:e.normalizeStyle($e(Pe)),onMouseenter:Wt=>Et(Pe,Wt),onMouseleave:Qt},[K(Pe).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(We(Pe)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(we(Pe))},[e.renderSlot(ae.$slots,"segment-marker-icon",{segment:Pe,index:Re,marker:K(Pe)},()=>[e.renderSlot(ae.$slots,"max-segment-icon",{segment:Pe,index:Re,marker:K(Pe)},()=>[e.createTextVNode(e.toDisplayString(K(Pe).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,z0))),128)),de.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(rt.value),onMouseenter:me[0]||(me[0]=Pe=>Rt(Pe)),onMouseleave:Qt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(A.value,Pe=>(e.openBlock(),e.createElementBlock("div",{key:Pe,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":Pe<=pe.value}])},null,2))),128))],8,I0),Ye.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip",style:e.normalizeStyle(qe.value)},e.toDisplayString(Ye.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"}},Ql={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"}},Jl={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"}},eo={chart:Q0,table:J0,filter:e9,datepicker:t9,textEditor:n9},Ho={en:Ql,fr:Jl,nl:eo};function ca(T){if(!T||!T.global)return;const oe=T.global.availableLocales||[];Object.keys(Ho).forEach(M=>{oe.includes(M)&&T.global.mergeLocaleMessage(M,Ho[M])})}const Ro={en:{textEditor:Ql.textEditor},fr:{textEditor:Jl.textEditor},nl:{textEditor:eo.textEditor}};function ua(T){if(!T||!T.global)return;const oe=T.global.availableLocales||[];Object.keys(Ro).forEach(M=>{oe.includes(M)&&T.global.mergeLocaleMessage(M,Ro[M])})}const Fo={en:{table:Ql.table},fr:{table:Jl.table},nl:{table:eo.table}};function da(T){if(!T||!T.global)return;const oe=T.global.availableLocales||[];Object.keys(Fo).forEach(M=>{oe.includes(M)&&T.global.mergeLocaleMessage(M,Fo[M])})}const Io={en:{datepicker:Ql.datepicker},fr:{datepicker:Jl.datepicker},nl:{datepicker:eo.datepicker}};function ma(T){if(!T||!T.global)return;const oe=T.global.availableLocales||[];Object.keys(Io).forEach(M=>{oe.includes(M)&&T.global.mergeLocaleMessage(M,Io[M])})}const zo={en:{filter:Ql.filter},fr:{filter:Jl.filter},nl:{filter:eo.filter}};function pa(T){if(!T||!T.global)return;const oe=T.global.availableLocales||[];Object.keys(zo).forEach(M=>{oe.includes(M)&&T.global.mergeLocaleMessage(M,zo[M])})}const l9={chart:Ho,textEditor:Ro,table:Fo,datepicker:Io,filter:zo};function o9(T){!T||!T.global||(ca(T),ua(T),da(T),ma(T),pa(T))}const a9={en:{...Ql},fr:{...Jl},nl:{...eo}};Gl.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:a9});exports.DSSChart=lc;exports.DSSChartMessages=Ho;exports.DSSColorPicker=qm;exports.DSSConfetti=y2;exports.DSSDatepicker=ea;exports.DSSDatepickerMessages=Io;exports.DSSDnd=g2;exports.DSSFilter=S0;exports.DSSFilterMessages=zo;exports.DSSLoader=l2;exports.DSSMessages=l9;exports.DSSModal=Jo;exports.DSSPillField=A0;exports.DSSSkeleton=o2;exports.DSSStepBar=P0;exports.DSSTable=Su;exports.DSSTableMessages=Fo;exports.DSSTextEditor=Bm;exports.DSSTextEditorMessages=Ro;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;
|